diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fd2792b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,44 @@ +* text eol=lf + +*.[jJ][aA][rR] binary + +*.[pP][nN][gG] binary +*.[jJ][pP][gG] binary +*.[jJ][pP][eE][gG] binary +*.[gG][iI][fF] binary +*.[tT][iI][fF] binary +*.[tT][iI][fF][fF] binary +*.[iI][cC][oO] binary +*.[sS][vV][gG] text +*.[eE][pP][sS] binary +*.[xX][cC][fF] binary + +*.[kK][aA][rR] binary +*.[mM]4[aA] binary +*.[mM][iI][dD] binary +*.[mM][iI][dD][iI] binary +*.[mM][pP]3 binary +*.[oO][gG][gG] binary +*.[rR][aA] binary + +*.7[zZ] binary +*.[gG][zZ] binary +*.[tT][aA][rR] binary +*.[tT][gG][zZ] binary +*.[zZ][iI][pP] binary + +*.[tT][cC][nN] binary +*.[sS][oO] binary +*.[dD][lL][lL] binary +*.[dD][yY][lL][iI][bB] binary +*.[pP][sS][dD] binary +*.[tT][tT][fF] binary +*.[oO][tT][fF] binary + +*.[pP][aA][tT][cC][hH] -text + +*.[bB][aA][tT] text eol=crlf +*.[cC][mM][dD] text eol=crlf +*.[pP][sS]1 text eol=crlf + +*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary diff --git a/.gradle/8.2.1/checksums/checksums.lock b/.gradle/8.2.1/checksums/checksums.lock new file mode 100644 index 0000000..3b05522 Binary files /dev/null and b/.gradle/8.2.1/checksums/checksums.lock differ diff --git a/.gradle/8.2.1/checksums/sha1-checksums.bin b/.gradle/8.2.1/checksums/sha1-checksums.bin new file mode 100644 index 0000000..6ee202a Binary files /dev/null and b/.gradle/8.2.1/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.2.1/dependencies-accessors/dependencies-accessors.lock b/.gradle/8.2.1/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..1d08cad Binary files /dev/null and b/.gradle/8.2.1/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/8.2.1/dependencies-accessors/gc.properties b/.gradle/8.2.1/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/8.2.1/executionHistory/executionHistory.bin b/.gradle/8.2.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..03e3a97 Binary files /dev/null and b/.gradle/8.2.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.2.1/executionHistory/executionHistory.lock b/.gradle/8.2.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..c2f3013 Binary files /dev/null and b/.gradle/8.2.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.2.1/fileChanges/last-build.bin b/.gradle/8.2.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.2.1/fileChanges/last-build.bin differ diff --git a/.gradle/8.2.1/fileHashes/fileHashes.bin b/.gradle/8.2.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..3d28598 Binary files /dev/null and b/.gradle/8.2.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.2.1/fileHashes/fileHashes.lock b/.gradle/8.2.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..13cb510 Binary files /dev/null and b/.gradle/8.2.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.2.1/fileHashes/resourceHashesCache.bin b/.gradle/8.2.1/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..c6bd94a Binary files /dev/null and b/.gradle/8.2.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.2.1/gc.properties b/.gradle/8.2.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..cf82b6e Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..12e8c74 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Apr 05 06:12:54 EEST 2024 +gradle.version=8.2.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..3f5f2ac Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..b3cef8e Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..a6b5f68 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,3 @@ +# Any Github changes require admin approval +/.github/** @GTNewHorizons/admin + diff --git a/LICENSE-template b/LICENSE-template new file mode 100644 index 0000000..242da62 --- /dev/null +++ b/LICENSE-template @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/assets b/assets new file mode 120000 index 0000000..3775269 --- /dev/null +++ b/assets @@ -0,0 +1 @@ +/home/shinare/Java/CinderLoE/src/main/resources/assets \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..b314717 --- /dev/null +++ b/build.gradle @@ -0,0 +1,1623 @@ +//version: 1699290261 +/* + DO NOT CHANGE THIS FILE! + Also, you may replace this file at any time if there is an update available. + Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates. + */ + + +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute +import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar +import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask +import com.gtnewhorizons.retrofuturagradle.util.Distribution +import com.matthewprenger.cursegradle.CurseArtifact +import com.matthewprenger.cursegradle.CurseRelation +import com.modrinth.minotaur.dependencies.ModDependency +import com.modrinth.minotaur.dependencies.VersionDependency +import org.gradle.internal.logging.text.StyledTextOutput.Style +import org.gradle.internal.logging.text.StyledTextOutputFactory +import org.gradle.internal.xml.XmlTransformer +import org.jetbrains.gradle.ext.Application +import org.jetbrains.gradle.ext.Gradle + +import javax.inject.Inject +import java.nio.file.Files +import java.nio.file.Paths +import java.util.concurrent.TimeUnit + +buildscript { + repositories { + mavenCentral() + + maven { + name 'forge' + url 'https://maven.minecraftforge.net' + } + maven { + // GTNH RetroFuturaGradle and ASM Fork + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + } + maven { + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + maven { + name 'Scala CI dependencies' + url 'https://repo1.maven.org/maven2/' + } + + mavenLocal() + } +} +plugins { + id 'java-library' + id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" + id 'eclipse' + id 'scala' + id 'maven-publish' + id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false + id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false + id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false + id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false + id 'com.palantir.git-version' version '3.0.0' apply false + id 'de.undercouch.download' version '5.4.0' + id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle + id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version + id 'com.modrinth.minotaur' version '2.+' apply false + id 'com.matthewprenger.cursegradle' version '1.4.0' apply false + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' +} + +print("You might want to check out './gradlew :faq' if your build fails.\n") + +boolean settingsupdated = verifySettingsGradle() +settingsupdated = verifyGitAttributes() || settingsupdated +if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") + +// In submodules, .git is a file pointing to the real git dir +if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) { + apply plugin: 'com.palantir.git-version' +} + +def out = services.get(StyledTextOutputFactory).create('an-output') + +def projectJavaVersion = JavaLanguageVersion.of(8) + +boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false +boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false + +final String CHECKSTYLE_CONFIG = """ + + + + + + + + + + + +""" + +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("autoUpdateBuildScript") +checkPropertyExists("minecraftVersion") +checkPropertyExists("forgeVersion") +checkPropertyExists("replaceGradleTokenInFile") +checkPropertyExists("gradleTokenVersion") +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinPlugin") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") +checkPropertyExists("usesShadowedDependencies") +checkPropertyExists("developmentEnvironmentUserName") + +propertyDefaultIfUnset("generateGradleTokenClass", "") +propertyDefaultIfUnset("includeWellKnownRepositories", true) +propertyDefaultIfUnset("noPublishedSources", false) +propertyDefaultIfUnset("usesMixinDebug", project.usesMixins) +propertyDefaultIfUnset("forceEnableMixins", false) +propertyDefaultIfUnset("channel", "stable") +propertyDefaultIfUnset("mappingsVersion", "12") +propertyDefaultIfUnset("usesMavenPublishing", true) +propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases") +propertyDefaultIfUnset("modrinthProjectId", "") +propertyDefaultIfUnset("modrinthRelations", "") +propertyDefaultIfUnset("curseForgeProjectId", "") +propertyDefaultIfUnset("curseForgeRelations", "") +propertyDefaultIfUnset("minimizeShadowedDependencies", true) +propertyDefaultIfUnset("relocateShadowedDependencies", true) +// Deprecated properties (kept for backwards compat) +propertyDefaultIfUnset("gradleTokenModId", "") +propertyDefaultIfUnset("gradleTokenModName", "") +propertyDefaultIfUnset("gradleTokenGroupName", "") + +propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only +propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only + +// this is meant to be set using the user wide property file. by default we do nothing. +propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea" + +project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts +if (!disableSpotless) { + apply plugin: 'com.diffplug.spotless' + apply from: Blowdryer.file('spotless.gradle') +} + +if (!disableCheckstyle) { + apply plugin: 'checkstyle' + tasks.named("checkstylePatchedMc") { enabled = false } + tasks.named("checkstyleMcLauncher") { enabled = false } + tasks.named("checkstyleIdeVirtualMain") { enabled = false } + tasks.named("checkstyleInjectedTags") { enabled = false } + checkstyle { + config = resources.text.fromString(CHECKSTYLE_CONFIG) + } +} + +String javaSourceDir = "src/main/java/" +String scalaSourceDir = "src/main/scala/" +String kotlinSourceDir = "src/main/kotlin/" + +if (usesShadowedDependencies.toBoolean()) { + apply plugin: "com.github.johnrengelman.shadow" +} + +java { + toolchain { + if (enableModernJavaSyntax.toBoolean()) { + languageVersion.set(JavaLanguageVersion.of(17)) + } else { + languageVersion.set(projectJavaVersion) + } + vendor.set(JvmVendorSpec.AZUL) + } + if (!noPublishedSources) { + withSourcesJar() + } +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" +} + +tasks.withType(ScalaCompile).configureEach { + options.encoding = "UTF-8" +} + +pluginManager.withPlugin('org.jetbrains.kotlin.jvm') { + // If Kotlin is enabled in the project + kotlin { + jvmToolchain(8) + } + // Kotlin hacks our source sets, so we hack Kotlin's tasks + def disabledKotlinTaskList = [ + "kaptGenerateStubsMcLauncherKotlin", + "kaptGenerateStubsPatchedMcKotlin", + "kaptGenerateStubsInjectedTagsKotlin", + "compileMcLauncherKotlin", + "compilePatchedMcKotlin", + "compileInjectedTagsKotlin", + "kaptMcLauncherKotlin", + "kaptPatchedMcKotlin", + "kaptInjectedTagsKotlin", + "kspMcLauncherKotlin", + "kspPatchedMcKotlin", + "kspInjectedTagsKotlin", + ] + tasks.configureEach { task -> + if (task.name in disabledKotlinTaskList) { + task.enabled = false + } + } +} + +configurations { + create("runtimeOnlyNonPublishable") { + description = "Runtime only dependencies that are not published alongside the jar" + canBeConsumed = false + canBeResolved = false + } + + create("devOnlyNonPublishable") { + description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)" + canBeConsumed = false + canBeResolved = false + } + compileOnly.extendsFrom(devOnlyNonPublishable) + runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable) +} + +if (enableModernJavaSyntax.toBoolean()) { + repositories { + mavenCentral { + mavenContent { + includeGroup("me.eigenraven.java8unsupported") + } + } + } + + dependencies { + annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0' + // workaround for https://github.com/bsideup/jabel/issues/174 + annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0' + compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') { + transitive = false // We only care about the 1 annotation class + } + // Allow using jdk.unsupported classes like sun.misc.Unsafe in the compiled code, working around JDK-8206937. + patchedMinecraft('me.eigenraven.java8unsupported:java-8-unsupported-shim:1.0.0') + } + + tasks.withType(JavaCompile).configureEach { + if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) { + return + } + sourceCompatibility = 17 // for the IDE support + options.release.set(8) + + javaCompiler.set(javaToolchains.compilerFor { + languageVersion.set(JavaLanguageVersion.of(17)) + vendor.set(JvmVendorSpec.AZUL) + }) + } +} + +eclipse { + classpath { + downloadSources = true + downloadJavadoc = true + } +} + +final String modGroupPath = modGroup.toString().replace('.' as char, '/' as char) +final String apiPackagePath = apiPackage.toString().replace('.' as char, '/' as char) + +String targetPackageJava = javaSourceDir + modGroupPath +String targetPackageScala = scalaSourceDir + modGroupPath +String targetPackageKotlin = kotlinSourceDir + modGroupPath +if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) +} + +if (apiPackage) { + targetPackageJava = javaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + apiPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + apiPackagePath + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) + } +} + +if (accessTransformersFile) { + for (atFile in accessTransformersFile.split(" ")) { + String targetFile = "src/main/resources/META-INF/" + atFile.trim() + if (!getFile(targetFile).exists()) { + throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) + } + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile) + } +} else { + boolean atsFound = false + for (File at : sourceSets.getByName("main").resources.files) { + if (at.name.toLowerCase().endsWith("_at.cfg")) { + atsFound = true + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) + } + } + for (File at : sourceSets.getByName("api").resources.files) { + if (at.name.toLowerCase().endsWith("_at.cfg")) { + atsFound = true + tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at) + tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at) + } + } + if (atsFound) { + logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name") + } +} + +if (usesMixins.toBoolean()) { + if (mixinsPackage.isEmpty()) { + throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!") + } + final String mixinPackagePath = mixinsPackage.toString().replaceAll("\\.", "/") + final String mixinPluginPath = mixinPlugin.toString().replaceAll("\\.", "/") + + targetPackageJava = javaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageScala = scalaSourceDir + modGroupPath + "/" + mixinPackagePath + targetPackageKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPackagePath + if (!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin) + } + + if (!mixinPlugin.isEmpty()) { + String targetFileJava = javaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + mixinPluginPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + mixinPluginPath + ".kt" + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + } + } +} + +if (coreModClass) { + final String coreModPath = coreModClass.toString().replaceAll("\\.", "/") + String targetFileJava = javaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileScala = scalaSourceDir + modGroupPath + "/" + coreModPath + ".scala" + String targetFileScalaJava = scalaSourceDir + modGroupPath + "/" + coreModPath + ".java" + String targetFileKotlin = kotlinSourceDir + modGroupPath + "/" + coreModPath + ".kt" + if (!(getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists() || getFile(targetFileKotlin).exists())) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava + " or " + targetFileKotlin) + } +} + +configurations.configureEach { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + + // Make sure GregTech build won't time out + System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) + System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) +} + +// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version +try { + 'git config core.fileMode false'.execute() +} +catch (Exception ignored) { + out.style(Style.Failure).println("git isn't installed at all") +} + +// Pulls version first from the VERSION env and then git tag +String identifiedVersion +String versionOverride = System.getenv("VERSION") ?: null +try { + // Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty + if (versionOverride == null) { + def gitDetails = versionDetails() + def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning + String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git') + if (branchName.startsWith('origin/')) { + branchName = branchName.minus('origin/') + } + branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver + identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}' + if (gitDetails.commitDistance > 0) { + identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}" + if (isDirty) { + identifiedVersion += "-dirty" + } + } else if (isDirty) { + identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty" + } + } else { + identifiedVersion = versionOverride + } +} +catch (Exception ignored) { + out.style(Style.Failure).text( + 'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' + + 'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' + + 'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)' + ) + versionOverride = '1.1' + identifiedVersion = versionOverride +} +version = identifiedVersion +ext { + modVersion = identifiedVersion +} + +if (identifiedVersion == versionOverride) { + out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7') +} + +group = "com.github.GTNewHorizons" +if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { + base { + archivesName = customArchiveBaseName + } +} else { + base { + archivesName = modId + } +} + + +minecraft { + if (replaceGradleTokenInFile) { + for (f in replaceGradleTokenInFile.split(',')) { + tagReplacementFiles.add f + } + } + if (gradleTokenModId) { + injectedTags.put gradleTokenModId, modId + } + if (gradleTokenModName) { + injectedTags.put gradleTokenModName, modName + } + if (gradleTokenVersion) { + injectedTags.put gradleTokenVersion, modVersion + } + if (gradleTokenGroupName) { + injectedTags.put gradleTokenGroupName, modGroup + } + if (enableGenericInjection.toBoolean()) { + injectMissingGenerics.set(true) + } + + username = developmentEnvironmentUserName.toString() + + lwjgl3Version = "3.3.2" + + // Enable assertions in the current mod + extraRunJvmArguments.add("-ea:${modGroup}") + + if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { + if (usesMixinDebug.toBoolean()) { + extraRunJvmArguments.addAll([ + "-Dmixin.debug.countInjections=true", + "-Dmixin.debug.verbose=true", + "-Dmixin.debug.export=true" + ]) + } + } + + // Blowdryer is present in some old mod builds, do not propagate it further as a dependency + // IC2 has no reobf jars in its Maven + groupsToExcludeFromAutoReobfMapping.addAll(["com.diffplug", "com.diffplug.durian", "net.industrial-craft"]) +} + +if (generateGradleTokenClass) { + tasks.injectTags.outputClassName.set(generateGradleTokenClass) +} + +// Custom reobf auto-mappings +configurations.configureEach { + dependencies.configureEach { dep -> + if (dep instanceof org.gradle.api.artifacts.ExternalModuleDependency) { + if (dep.group == "net.industrial-craft" && dep.name == "industrialcraft-2") { + // https://www.curseforge.com/minecraft/mc-mods/industrial-craft/files/2353971 + project.dependencies.reobfJarConfiguration("curse.maven:ic2-242638:2353971") + } + } + } + def obfuscationAttr = it.attributes.getAttribute(ObfuscationAttribute.OBFUSCATION_ATTRIBUTE) + if (obfuscationAttr != null && obfuscationAttr.name == ObfuscationAttribute.SRG) { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + // Remap CoFH core cursemaven dev jar to the obfuscated version for runObfClient/Server + if (details.requested.group == 'curse.maven' && details.requested.name.endsWith('-69162') && details.requested.version == '2388751') { + details.useVersion '2388750' + details.because 'Pick obfuscated jar' + } + } + } +} + +// Ensure tests have access to minecraft classes +sourceSets { + test { + java { + compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output + runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output + } + } +} + +if (file('addon.gradle.kts').exists()) { + apply from: 'addon.gradle.kts' +} else if (file('addon.gradle').exists()) { + apply from: 'addon.gradle' +} + +// File for local tweaks not commited to Git +if (file('addon.local.gradle.kts').exists()) { + apply from: 'addon.local.gradle.kts' +} else if (file('addon.local.gradle').exists()) { + apply from: 'addon.local.gradle' +} + +// Allow unsafe repos but warn +repositories.configureEach { repo -> + if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) { + if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) { + logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'") + repo.allowInsecureProtocol = true + } + } +} + +if (file('repositories.gradle.kts').exists()) { + apply from: 'repositories.gradle.kts' +} else if (file('repositories.gradle').exists()) { + apply from: 'repositories.gradle' +} else { + logger.error("Neither repositories.gradle.kts nor repositories.gradle was found, make sure you extracted the full ExampleMod template.") + throw new RuntimeException("Missing repositories.gradle[.kts]") +} + +configurations { + runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable) + for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) { + if (usesShadowedDependencies.toBoolean()) { + config.extendsFrom(shadowImplementation) + // TODO: remove Compile after all uses are refactored to Implementation + config.extendsFrom(shadeCompile) + config.extendsFrom(shadowCompile) + } + } + // A "bag-of-dependencies"-style configuration for backwards compatibility, gets put in "api" + create("compile") { + description = "Deprecated: use api or implementation instead, gets put in api" + canBeConsumed = false + canBeResolved = false + visible = false + } + create("testCompile") { + description = "Deprecated: use testImplementation instead" + canBeConsumed = false + canBeResolved = false + visible = false + } + api.extendsFrom(compile) + testImplementation.extendsFrom(testCompile) +} + +afterEvaluate { + if (!configurations.compile.allDependencies.empty || !configurations.testCompile.allDependencies.empty) { + logger.warn("This project uses deprecated `compile` dependencies, please migrate to using `api` and `implementation`") + logger.warn("For more details, see https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/dependencies.gradle") + } +} + +repositories { + maven { + name 'Overmind forge repo mirror' + url 'https://gregtech.overminddl1.com/' + } + maven { + name = "GTNH Maven" + url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + } + maven { + name 'sonatype' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + content { + includeGroup "org.lwjgl" + } + } + if (includeWellKnownRepositories.toBoolean()) { + exclusiveContent { + forRepository { + maven { + name "CurseMaven" + url "https://cursemaven.com" + } + } + filter { + includeGroup "curse.maven" + } + } + exclusiveContent { + forRepository { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + } + filter { + includeGroup "maven.modrinth" + } + } + maven { + name = "ic2" + url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + content { + includeGroup "net.industrial-craft" + } + metadataSources { + mavenPom() + artifact() + } + } + maven { + name "MMD Maven" + url "https://maven.mcmoddev.com/" + } + } +} + +def mixinProviderGroup = "io.github.legacymoddingmc" +def mixinProviderModule = "unimixins" +def mixinProviderVersion = "0.1.13" +def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" +def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" +ext.mixinProviderSpec = mixinProviderSpec + +def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' + +dependencies { + if (usesMixins.toBoolean()) { + annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') + annotationProcessor('com.google.guava:guava:24.1.1-jre') + annotationProcessor('com.google.code.gson:gson:2.8.6') + annotationProcessor(mixinProviderSpec) + if (usesMixinDebug.toBoolean()) { + runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16') + } + } + if (usesMixins.toBoolean()) { + implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap)) + } else if (forceEnableMixins.toBoolean()) { + runtimeOnlyNonPublishable(mixinProviderSpec) + } +} + +pluginManager.withPlugin('org.jetbrains.kotlin.kapt') { + if (usesMixins.toBoolean()) { + dependencies { + kapt(mixinProviderSpec) + } + } +} + +// Replace old mixin mods with unimixins +// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier +configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") + substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + } +} + +dependencies { + constraints { + def minGtnhLibVersion = "0.0.13" + implementation("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + runtimeOnly("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + devOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:${minGtnhLibVersion}") { + because("fixes duplicate mod errors in java 17 configurations using old gtnhlib") + } + } +} + +if (file('dependencies.gradle.kts').exists()) { + apply from: 'dependencies.gradle.kts' +} else if (file('dependencies.gradle').exists()) { + apply from: 'dependencies.gradle' +} else { + logger.error("Neither dependencies.gradle.kts nor dependencies.gradle was found, make sure you extracted the full ExampleMod template.") + throw new RuntimeException("Missing dependencies.gradle[.kts]") +} + +tasks.register('generateAssets') { + group = "GTNH Buildscript" + description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed" + onlyIf { usesMixins.toBoolean() } + doLast { + def mixinConfigFile = getFile("/src/main/resources/mixins." + modId + ".json") + if (!mixinConfigFile.exists()) { + def mixinPluginLine = "" + if (!mixinPlugin.isEmpty()) { + // We might not have a mixin plugin if we're using early/late mixins + mixinPluginLine += """\n "plugin": "${modGroup}.${mixinPlugin}", """ + } + + mixinConfigFile.text = """{ + "required": true, + "minVersion": "0.8.5-GTNH", + "package": "${modGroup}.${mixinsPackage}",${mixinPluginLine} + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [], + "client": [], + "server": [] +} +""" + } + } +} + +if (usesMixins.toBoolean()) { + tasks.named("processResources").configure { + dependsOn("generateAssets") + } + + tasks.named("compileJava", JavaCompile).configure { + options.compilerArgs += [ + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" + ] + } +} + +tasks.named("processResources", ProcessResources).configure { + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.mcVersion + exclude("spotless.gradle") + + // replace stuff in mcmod.info, nothing else. replaces ${key} with value in text + filesMatching("mcmod.info") { + expand "minecraftVersion": project.minecraft.mcVersion, + "modVersion": modVersion, + "modId": modId, + "modName": modName + } + + if (usesMixins.toBoolean()) { + dependsOn("compileJava", "compileScala") + } +} + +ext.java17Toolchain = (JavaToolchainSpec spec) -> { + spec.languageVersion.set(JavaLanguageVersion.of(17)) + spec.vendor.set(JvmVendorSpec.matching("jetbrains")) +} + +ext.java17DependenciesCfg = configurations.create("java17Dependencies") { + extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution + canBeConsumed = false +} +ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") { + canBeConsumed = false +} + +dependencies { + def lwjgl3ifyVersion = '1.5.1' + if (modId != 'lwjgl3ify') { + java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") + } + if (modId != 'hodgepodge') { + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17') + } + + java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} +} + +ext.java17JvmArgs = [ + // Java 9+ support + "--illegal-access=warn", + "-Djava.security.manager=allow", + "-Dfile.encoding=UTF-8", + "--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED", + "--add-opens", "java.base/java.net=ALL-UNNAMED", + "--add-opens", "java.base/java.nio=ALL-UNNAMED", + "--add-opens", "java.base/java.io=ALL-UNNAMED", + "--add-opens", "java.base/java.lang=ALL-UNNAMED", + "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", + "--add-opens", "java.base/java.text=ALL-UNNAMED", + "--add-opens", "java.base/java.util=ALL-UNNAMED", + "--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED", + "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", + "--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming", + "--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED", + "--add-modules", "jdk.dynalink", + "--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED", + "--add-modules", "java.sql.rowset", + "--add-opens", "java.sql.rowset/javax.sql.rowset.serial=ALL-UNNAMED" +] + +ext.hotswapJvmArgs = [ + // DCEVM advanced hot reload + "-XX:+AllowEnhancedClassRedefinition", + "-XX:HotswapAgent=fatjar" +] + +ext.setupHotswapAgentTask = tasks.register("setupHotswapAgent") { + group = "GTNH Buildscript" + description = "Installs a recent version of HotSwapAgent into the Java 17 JetBrains runtime directory" + def hsaUrl = 'https://github.com/HotswapProjects/HotswapAgent/releases/download/1.4.2-SNAPSHOT/hotswap-agent-1.4.2-SNAPSHOT.jar' + def targetFolderProvider = javaToolchains.launcherFor(java17Toolchain).map {it.metadata.installationPath.dir("lib/hotswap")} + def targetFilename = "hotswap-agent.jar" + onlyIf { + !targetFolderProvider.get().file(targetFilename).asFile.exists() + } + doLast { + def targetFolder = targetFolderProvider.get() + targetFolder.asFile.mkdirs() + download.run { + src hsaUrl + dest targetFolder.file(targetFilename).asFile + overwrite false + tempAndMove true + } + } +} + +public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { + // IntelliJ doesn't seem to allow commandline arguments so we also support an env variable + private boolean enableHotswap = Boolean.valueOf(System.getenv("HOTSWAP")); + + @Input + public boolean getEnableHotswap() { return enableHotswap } + @Option(option = "hotswap", description = "Enables HotSwapAgent for enhanced class reloading under a debugger") + public boolean setEnableHotswap(boolean enable) { enableHotswap = enable } + + @Inject + public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) { + super(side, gradle) + + this.lwjglVersion = 3 + this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain) + this.extraJvmArgs.addAll(project.java17JvmArgs) + this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : [])) + + this.classpath(project.java17PatchDependenciesCfg) + if (side == Distribution.CLIENT) { + this.classpath(project.minecraftTasks.lwjgl3Configuration) + } + // Use a raw provider instead of map to not create a dependency on the task + this.classpath(project.provider(() -> project.tasks.named(superTask, RunMinecraftTask).get().classpath)) + this.classpath.filter { file -> + !file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2 + } + this.classpath(project.java17DependenciesCfg) + } + + public void setup(Project project) { + super.setup(project) + if (project.usesMixins.toBoolean()) { + this.extraJvmArgs.addAll(project.provider(() -> { + def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec)) + mixinCfg.canBeConsumed = false + mixinCfg.transitive = false + enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : [] + })) + } + } +} + +def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") +runClient17Task.configure { + setup(project) + group = "Modded Minecraft" + description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge" + dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') + mainClass = "GradleStart" + username = minecraft.username + userUUID = minecraft.userUUID +} + +def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer") +runServer17Task.configure { + setup(project) + group = "Modded Minecraft" + description = "Runs the modded server using Java 17, lwjgl3ify and Hodgepodge" + dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar') + mainClass = "GradleStartServer" + extraArgs.add("nogui") +} + +def getManifestAttributes() { + def manifestAttributes = [:] + if (!containsMixinsAndOrCoreModOnly.toBoolean() && (usesMixins.toBoolean() || coreModClass)) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if (accessTransformersFile) { + manifestAttributes += ["FMLAT": accessTransformersFile.toString()] + } + + if (coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if (usesMixins.toBoolean()) { + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : "mixins." + modId + ".json", + "ForceLoadAsMod": !containsMixinsAndOrCoreModOnly.toBoolean() + ] + } + return manifestAttributes +} + +tasks.named("jar", Jar).configure { + manifest { + attributes(getManifestAttributes()) + } +} + +if (usesShadowedDependencies.toBoolean()) { + tasks.named("shadowJar", ShadowJar).configure { + manifest { + attributes(getManifestAttributes()) + } + + if (minimizeShadowedDependencies.toBoolean()) { + minimize() // This will only allow shading for actually used classes + } + configurations = [ + project.configurations.shadowImplementation, + project.configurations.shadowCompile, + project.configurations.shadeCompile + ] + archiveClassifier.set('dev') + if (relocateShadowedDependencies.toBoolean()) { + relocationPrefix = modGroup + ".shadow" + enableRelocation = true + } + } + configurations.runtimeElements.outgoing.artifacts.clear() + configurations.apiElements.outgoing.artifacts.clear() + configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) + configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) + tasks.named("jar", Jar) { + enabled = false + finalizedBy(tasks.shadowJar) + } + tasks.named("reobfJar", ReobfuscatedJar) { + inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) + } + AdhocComponentWithVariants javaComponent = (AdhocComponentWithVariants) project.components.findByName("java") + javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { + skip() + } + for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) { + tasks.named(runTask).configure { + dependsOn("shadowJar") + } + } +} +ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar +ext.publishableObfJar = tasks.reobfJar + +tasks.register('apiJar', Jar) { + from(sourceSets.main.allSource) { + include modGroupPath + "/" + apiPackagePath + '/**' + } + + from(sourceSets.main.output) { + include modGroupPath + "/" + apiPackagePath + '/**' + } + + from(sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') +} + +artifacts { + if (!noPublishedSources) { + archives tasks.named("sourcesJar") + } + if (apiPackage) { + archives tasks.named("apiJar") + } +} + +idea { + module { + downloadJavadoc = true + downloadSources = true + inheritOutputDirs = true + } + project { + settings { + if (ideaOverrideBuildType != "") { + delegateActions { + if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) { + delegateBuildRunToGradle = true + testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE + } else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) { + delegateBuildRunToGradle = false + testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM + } else { + throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.') + } + } + } + runConfigurations { + "0. Build and Test"(Gradle) { + taskNames = ["build"] + } + "1. Run Client"(Gradle) { + taskNames = ["runClient"] + } + "2. Run Server"(Gradle) { + taskNames = ["runServer"] + } + "1a. Run Client (Java 17)"(Gradle) { + taskNames = ["runClient17"] + } + "2a. Run Server (Java 17)"(Gradle) { + taskNames = ["runServer17"] + } + "1b. Run Client (Java 17, Hotswap)"(Gradle) { + taskNames = ["runClient17"] + envs = ["HOTSWAP": "true"] + } + "2b. Run Server (Java 17, Hotswap)"(Gradle) { + taskNames = ["runServer17"] + envs = ["HOTSWAP": "true"] + } + "3. Run Obfuscated Client"(Gradle) { + taskNames = ["runObfClient"] + } + "4. Run Obfuscated Server"(Gradle) { + taskNames = ["runObfServer"] + } + if (!disableSpotless) { + "5. Apply spotless"(Gradle) { + taskNames = ["spotlessApply"] + } + } + def coreModArgs = "" + if (coreModClass) { + coreModArgs = ' "-Dfml.coreMods.load=' + modGroup + '.' + coreModClass + '"' + } + "Run Client (IJ Native)"(Application) { + mainClass = "GradleStart" + moduleName = project.name + ".ideVirtualMain" + afterEvaluate { + workingDirectory = tasks.runClient.workingDir.absolutePath + programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runClient.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runClient.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + "Run Server (IJ Native)"(Application) { + mainClass = "GradleStartServer" + moduleName = project.name + ".ideVirtualMain" + afterEvaluate { + workingDirectory = tasks.runServer.workingDir.absolutePath + programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ') + jvmArgs = tasks.runServer.calculateJvmArgs(project).collect { '"' + it + '"' }.join(' ') + + ' ' + tasks.runServer.systemProperties.collect { '"-D' + it.key + '=' + it.value.toString() + '"' }.join(' ') + + coreModArgs + } + } + } + compiler.javac { + afterEvaluate { + javacAdditionalOptions = "-encoding utf8" + moduleJavacAdditionalOptions = [ + (project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ') + ] + } + } + withIDEADir { File ideaDir -> + if (!ideaDir.path.contains(".idea")) { + // If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory + ideaDir = new File(ideaDir, ".idea") + } + if (ideaDir.isDirectory()) { + def miscFile = new File(ideaDir, "misc.xml") + if (miscFile.isFile()) { + boolean dirty = false + def miscTransformer = new XmlTransformer() + miscTransformer.addAction { root -> + Node rootNode = root.asNode() + def rootManager = rootNode + .component.find { it.@name == 'ProjectRootManager' } + if (!rootManager) { + rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2']) + dirty = true + } + def output = rootManager.output + if (!output) { + output = rootManager.appendNode('output') + dirty = true + } + if (!output.@url) { + // Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow. + // This is a sensible default for most setups + output.@url = 'file://$PROJECT_DIR$/build/ideaBuild' + dirty = true + } + } + def result = miscTransformer.transform(miscFile.text) + if (dirty) { + miscFile.write(result) + } + } else { + miscFile.text = """ + + + + + +""" + } + } + } + } + } +} + +tasks.named("processIdeaSettings").configure { + dependsOn("injectTags") +} + +tasks.named("ideVirtualMainClasses").configure { + // Make IntelliJ "Build project" build the mod jars + dependsOn("jar", "reobfJar") + if (!disableSpotless) { + dependsOn("spotlessCheck") + } +} + +// workaround variable hiding in pom processing +def projectConfigs = project.configurations + +publishing { + publications { + create("maven", MavenPublication) { + from components.java + + if (apiPackage) { + artifact apiJar + } + + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group + artifactId = System.getenv("ARTIFACT_ID") ?: project.name + // Using the identified version, not project.version as it has the prepended 1.7.10 + version = System.getenv("RELEASE_VERSION") ?: identifiedVersion + } + } + repositories { + if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { + maven { + url = mavenPublishUrl + allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven + credentials { + username = System.getenv("MAVEN_USER") ?: "NONE" + password = System.getenv("MAVEN_PASSWORD") ?: "NONE" + } + } + } + } +} + +if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { + apply plugin: 'com.modrinth.minotaur' + + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") + + modrinth { + token = System.getenv("MODRINTH_TOKEN") + projectId = modrinthProjectId + versionNumber = identifiedVersion + versionType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + changelog = changelogFile.exists() ? changelogFile.getText("UTF-8") : "" + uploadFile = publishableObfJar + additionalFiles = getSecondaryArtifacts() + gameVersions = [minecraftVersion] + loaders = ["forge"] + debugMode = false + } + + if (modrinthRelations.size() != 0) { + String[] deps = modrinthRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + String[] qual = parts[0].split("-") + addModrinthDep(qual[0], qual[1], parts[1]) + } + } + if (usesMixins.toBoolean()) { + addModrinthDep("required", "project", "unimixins") + } + tasks.modrinth.dependsOn(build) + tasks.publish.dependsOn(tasks.modrinth) +} + +if (curseForgeProjectId.size() != 0 && System.getenv("CURSEFORGE_TOKEN") != null) { + apply plugin: 'com.matthewprenger.cursegradle' + + File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md") + + curseforge { + apiKey = System.getenv("CURSEFORGE_TOKEN") + project { + id = curseForgeProjectId + if (changelogFile.exists()) { + changelogType = "markdown" + changelog = changelogFile + } + releaseType = identifiedVersion.endsWith("-pre") ? "beta" : "release" + addGameVersion minecraftVersion + addGameVersion "Forge" + mainArtifact publishableObfJar + for (artifact in getSecondaryArtifacts()) addArtifact artifact + } + + options { + javaIntegration = false + forgeGradleIntegration = false + debug = false + } + } + + if (curseForgeRelations.size() != 0) { + String[] deps = curseForgeRelations.split(";") + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(":") + addCurseForgeRelation(parts[0], parts[1]) + } + } + if (usesMixins.toBoolean()) { + addCurseForgeRelation("requiredDependency", "unimixins") + } + tasks.curseforge.dependsOn(build) + tasks.publish.dependsOn(tasks.curseforge) +} + +def addModrinthDep(String scope, String type, String name) { + com.modrinth.minotaur.dependencies.Dependency dep; + if (!(scope in ["required", "optional", "incompatible", "embedded"])) { + throw new Exception("Invalid modrinth dependency scope: " + scope) + } + switch (type) { + case "project": + dep = new ModDependency(name, scope) + break + case "version": + dep = new VersionDependency(name, scope) + break + default: + throw new Exception("Invalid modrinth dependency type: " + type) + } + project.modrinth.dependencies.add(dep) +} + +def addCurseForgeRelation(String type, String name) { + if (!(type in ["requiredDependency", "embeddedLibrary", "optionalDependency", "tool", "incompatible"])) { + throw new Exception("Invalid CurseForge relation type: " + type) + } + CurseArtifact artifact = project.curseforge.curseProjects[0].mainArtifact + CurseRelation rel = (artifact.curseRelations ?: (artifact.curseRelations = new CurseRelation())) + rel."$type"(name) +} + +// Updating + +def buildscriptGradleVersion = "8.2.1" + +tasks.named('wrapper', Wrapper).configure { + gradleVersion = buildscriptGradleVersion +} + +tasks.register('updateBuildScript') { + group = 'GTNH Buildscript' + description = 'Updates the build script to the latest version' + + if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) { + dependsOn('wrapper') + } + + doLast { + if (performBuildScriptUpdate()) return + + print("Build script already up-to-date!") + } +} + +if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_UPDATE_CHECK') && isNewBuildScriptVersionAvailable()) { + if (autoUpdateBuildScript.toBoolean()) { + performBuildScriptUpdate() + } else { + out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'") + if (gradle.gradleVersion != buildscriptGradleVersion) { + out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n") + } + } +} + +// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large +tasks.register('faq') { + group = 'GTNH Buildscript' + description = 'Prints frequently asked questions about building a project' + + doLast { + print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " + + "Or you can manually check if the versions are still on the distributing sites - " + + "the links can be found in repositories.gradle and build.gradle:repositories, " + + "but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" + + "If your build fails to recognize the syntax of new Java versions, enable Jabel in your " + + "gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " + + "However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " + + "Java 9 or later.") + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle") +} + +static URL exampleSettingsGradleUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/settings.gradle.example") +} + +static URL exampleGitAttributesUrl() { + new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/.gitattributes") +} + + +boolean verifyGitAttributes() { + def gitattributesFile = getFile(".gitattributes") + if (!gitattributesFile.exists()) { + println("Downloading default .gitattributes") + exampleGitAttributesUrl().withInputStream { i -> gitattributesFile.withOutputStream { it << i } } + exec { + workingDir '.' + commandLine 'git', 'add', '--renormalize', '.' + } + return true + } + return false +} + +boolean verifySettingsGradle() { + def settingsFile = getFile("settings.gradle") + if (!settingsFile.exists()) { + println("Downloading default settings.gradle") + exampleSettingsGradleUrl().withInputStream { i -> settingsFile.withOutputStream { it << i } } + return true + } + return false +} + +boolean performBuildScriptUpdate() { + if (isNewBuildScriptVersionAvailable()) { + def buildscriptFile = getFile("build.gradle") + availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + def out = services.get(StyledTextOutputFactory).create('buildscript-update-output') + out.style(Style.Success).print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + boolean settingsupdated = verifySettingsGradle() + settingsupdated = verifyGitAttributes() || settingsupdated + if (settingsupdated) + throw new GradleException("Settings has been updated, please re-run task.") + return true + } + return false +} + +boolean isNewBuildScriptVersionAvailable() { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = getFile("build.gradle").getText() + String currentBuildScriptHash = getVersionHash(currentBuildScript) + String availableBuildScriptHash + try { + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + availableBuildScriptHash = getVersionHash(availableBuildScript) + } catch (IOException e) { + logger.warn("Could not check for buildscript update availability: {}", e.message) + return false + } + + boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash + return !isUpToDate +} + +static String getVersionHash(String buildScriptContent) { + String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") + if (versionLine != null) { + return versionLine.split(": ").last() + } + return "" +} + +// Parameter Deobfuscation + +tasks.register('deobfParams') { + group = 'GTNH Buildscript' + description = 'Rename all obfuscated parameter names inherited from Minecraft classes' + doLast { // TODO + + String mcpDir = "$project.gradle.gradleUserHomeDir/caches/minecraft/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion" + String mcpZIP = "$mcpDir/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + String paramsCSV = "$mcpDir/params.csv" + + download.run { + src "https://maven.minecraftforge.net/de/oceanlabs/mcp/mcp_$channel/$mappingsVersion-$minecraftVersion/mcp_$channel-$mappingsVersion-${minecraftVersion}.zip" + dest mcpZIP + overwrite false + } + + if (!file(paramsCSV).exists()) { + println("Extracting MCP archive ...") + copy { + from(zipTree(mcpZIP)) + into(mcpDir) + } + } + + println("Parsing params.csv ...") + Map params = new HashMap<>() + Files.lines(Paths.get(paramsCSV)).forEach { line -> + String[] cells = line.split(",") + if (cells.length > 2 && cells[0].matches("p_i?\\d+_\\d+_")) { + params.put(cells[0], cells[1]) + } + } + + out.style(Style.Success).println("Modified ${replaceParams(file("$projectDir/src/main/java"), params)} files!") + out.style(Style.Failure).println("Don't forget to verify that the code still works as before!\n It could be broken due to duplicate variables existing now\n or parameters taking priority over other variables.") + } +} + +static int replaceParams(File file, Map params) { + int fileCount = 0 + + if (file.isDirectory()) { + for (File f : file.listFiles()) { + fileCount += replaceParams(f, params) + } + return fileCount + } + println("Visiting ${file.getName()} ...") + try { + String content = new String(Files.readAllBytes(file.toPath())) + int hash = content.hashCode() + params.forEach { key, value -> + content = content.replaceAll(key, value) + } + if (hash != content.hashCode()) { + Files.write(file.toPath(), content.getBytes("UTF-8")) + return 1 + } + } catch (Exception e) { + e.printStackTrace() + } + return 0 +} + +// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle) + +def deobf(String sourceURL) { + try { + URL url = new URL(sourceURL) + String fileName = url.getFile() + + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if (lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if (fileName.endsWith(".jar") || fileName.endsWith(".litemod")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + } + + String hostName = url.getHost() + if (hostName.startsWith("www.")) { + hostName = hostName.substring(4) + } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + + return deobf(sourceURL, "$hostName/$fileName") + } catch (Exception ignored) { + return deobf(sourceURL, "deobf/${sourceURL.hashCode()}") + } +} + +def deobfMaven(String repoURL, String mavenDep) { + if (!repoURL.endsWith("/")) { + repoURL += "/" + } + String[] parts = mavenDep.split(":") + parts[0] = parts[0].replace('.', '/') + def jarURL = repoURL + parts[0] + "/" + parts[1] + "/" + parts[2] + "/" + parts[1] + "-" + parts[2] + ".jar" + return deobf(jarURL) +} + +def deobfCurse(String curseDep) { + return dependencies.rfg.deobf("curse.maven:$curseDep") +} + +// The method above is to be preferred. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String rawFileName) { + String bon2Version = "2.5.1" + String fileName = URLDecoder.decode(rawFileName, "UTF-8") + String cacheDir = "$project.gradle.gradleUserHomeDir/caches" + String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar" + + download.run { + src sourceURL + dest obfFile + quiet true + overwrite false + } + return dependencies.rfg.deobf(files(obfFile)) +} +// Helper methods + +def checkPropertyExists(String propertyName) { + if (!project.hasProperty(propertyName)) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/main/gradle.properties") + } +} + +def propertyDefaultIfUnset(String propertyName, defaultValue) { + if (!project.hasProperty(propertyName) || project.property(propertyName) == "") { + project.ext.setProperty(propertyName, defaultValue) + } +} + +def getFile(String relativePath) { + return new File(projectDir, relativePath) +} + +def getSecondaryArtifacts() { + // Because noPublishedSources from the beginning of the script is somehow not visible here... + boolean noPublishedSources = project.hasProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false + def secondaryArtifacts = [publishableDevJar] + if (!noPublishedSources) secondaryArtifacts += [sourcesJar] + if (apiPackage) secondaryArtifacts += [apiJar] + return secondaryArtifacts +} + +def getURL(String main, String fallback) { + return pingURL(main, 10000) ? main : fallback +} + +// credit: https://stackoverflow.com/a/3584332 +def pingURL(String url, int timeout) { + url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates. + try { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection() + connection.setConnectTimeout(timeout) + connection.setReadTimeout(timeout) + connection.setRequestMethod("HEAD") + int responseCode = connection.getResponseCode() + return 200 <= responseCode && responseCode <= 399 + } catch (IOException ignored) { + return false + } +} + +// For easier scripting of things that require variables defined earlier in the buildscript +if (file('addon.late.gradle.kts').exists()) { + apply from: 'addon.late.gradle.kts' +} else if (file('addon.late.gradle').exists()) { + apply from: 'addon.late.gradle' +} + +// File for local tweaks not commited to Git +if (file('addon.late.local.gradle.kts').exists()) { + apply from: 'addon.late.local.gradle.kts' +} else if (file('addon.late.local.gradle').exists()) { + apply from: 'addon.late.local.gradle' +} diff --git a/build/classes/java/injectedTags/com/zivilon/cinder_loe/Tags.class b/build/classes/java/injectedTags/com/zivilon/cinder_loe/Tags.class new file mode 100644 index 0000000..18b120b Binary files /dev/null and b/build/classes/java/injectedTags/com/zivilon/cinder_loe/Tags.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ClientProxy.class b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ClientProxy.class new file mode 100644 index 0000000..bf8d71e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ClientProxy.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$CommonProxy.class b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$CommonProxy.class new file mode 100644 index 0000000..a4140cb Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$CommonProxy.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ServerProxy.class b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ServerProxy.class new file mode 100644 index 0000000..fbdf23f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE$ServerProxy.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE.class b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE.class new file mode 100644 index 0000000..3098d1f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE_Config.class b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE_Config.class new file mode 100644 index 0000000..52f3024 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/CinderLoE_Config.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/Materials.class b/build/classes/java/main/com/zivilon/cinder_loe/Materials.class new file mode 100644 index 0000000..ea8aa7b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/Materials.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/BarsBase.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/BarsBase.class new file mode 100644 index 0000000..586af35 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/BarsBase.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.class new file mode 100644 index 0000000..6b56d94 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/ChandelierBase.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ChandelierBase.class new file mode 100644 index 0000000..85eb703 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ChandelierBase.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/CinderBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/CinderBlock.class new file mode 100644 index 0000000..50ce567 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/CinderBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/FishBarrel.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/FishBarrel.class new file mode 100644 index 0000000..29d5fb8 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/FishBarrel.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/FurBundle.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/FurBundle.class new file mode 100644 index 0000000..fefa781 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/FurBundle.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/IvoryBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/IvoryBlock.class new file mode 100644 index 0000000..ede1826 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/IvoryBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/LeatherBundle.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/LeatherBundle.class new file mode 100644 index 0000000..4f04f59 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/LeatherBundle.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/MistBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/MistBlock.class new file mode 100644 index 0000000..2b69a0b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/MistBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfBars.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfBars.class new file mode 100644 index 0000000..d985333 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfBars.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.class new file mode 100644 index 0000000..39c10eb Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/ReedBale.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ReedBale.class new file mode 100644 index 0000000..9af2ed0 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ReedBale.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.class new file mode 100644 index 0000000..b80dae2 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.class new file mode 100644 index 0000000..128d698 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.class new file mode 100644 index 0000000..ca42e4e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/StaticBlockBase3.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/StaticBlockBase3.class new file mode 100644 index 0000000..ff2646c Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/StaticBlockBase3.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/goldChain.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/goldChain.class new file mode 100644 index 0000000..e0f41cc Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/goldChain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/ironChain.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ironChain.class new file mode 100644 index 0000000..787c1b1 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/ironChain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/blocks/silverChain.class b/build/classes/java/main/com/zivilon/cinder_loe/blocks/silverChain.class new file mode 100644 index 0000000..2e2b56a Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/blocks/silverChain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterEventListener.class b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterEventListener.class new file mode 100644 index 0000000..b829f16 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterEventListener.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI$1.class b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI$1.class new file mode 100644 index 0000000..c99408e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI$1.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI.class b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI.class new file mode 100644 index 0000000..cc8a3ee Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/character/CharacterRoleAPI.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.class b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.class new file mode 100644 index 0000000..d254f5f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornElk.class b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornElk.class new file mode 100644 index 0000000..1bcb81d Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornElk.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornWolf.class b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornWolf.class new file mode 100644 index 0000000..e9e5ac2 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelFangornWolf.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.class b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.class new file mode 100644 index 0000000..b52f293 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderBattleNun.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderBattleNun.class new file mode 100644 index 0000000..41c2643 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderBattleNun.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.class new file mode 100644 index 0000000..88ae19d Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornBear.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornBear.class new file mode 100644 index 0000000..5aef748 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornBear.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornElk.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornElk.class new file mode 100644 index 0000000..a4f1610 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornElk.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.class new file mode 100644 index 0000000..c5f1cd7 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWolf.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWolf.class new file mode 100644 index 0000000..03c354f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderFangornWolf.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderLimwaith.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderLimwaith.class new file mode 100644 index 0000000..000caf0 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderLimwaith.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderRenegade.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderRenegade.class new file mode 100644 index 0000000..0de22ff Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderRenegade.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.class new file mode 100644 index 0000000..133d7dc Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderWraith.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderWraith.class new file mode 100644 index 0000000..526fb18 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/RenderWraith.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.class new file mode 100644 index 0000000..b228d3b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/client/render/item/RenderHelper.class b/build/classes/java/main/com/zivilon/cinder_loe/client/render/item/RenderHelper.class new file mode 100644 index 0000000..d27312e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/client/render/item/RenderHelper.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/command/CommandCinderCharacter.class b/build/classes/java/main/com/zivilon/cinder_loe/command/CommandCinderCharacter.class new file mode 100644 index 0000000..f9d987d Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/command/CommandCinderCharacter.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/CoreMod.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/CoreMod.class new file mode 100644 index 0000000..c32d794 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/CoreMod.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder$BannerInfo.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder$BannerInfo.class new file mode 100644 index 0000000..1ca4bb4 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder$BannerInfo.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.class new file mode 100644 index 0000000..fb07589 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.class new file mode 100644 index 0000000..a274661 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker$1.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker$1.class new file mode 100644 index 0000000..8c2098e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker$1.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.class new file mode 100644 index 0000000..6f3bac7 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker$1.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker$1.class new file mode 100644 index 0000000..376d892 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker$1.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.class new file mode 100644 index 0000000..b145f13 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/coremod/OptiFinePatcher.class b/build/classes/java/main/com/zivilon/cinder_loe/coremod/OptiFinePatcher.class new file mode 100644 index 0000000..60f3a26 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/coremod/OptiFinePatcher.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorBannerBearer.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorBannerBearer.class new file mode 100644 index 0000000..536d713 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorBannerBearer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorCaptain.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorCaptain.class new file mode 100644 index 0000000..de9e445 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorCaptain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldier.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldier.class new file mode 100644 index 0000000..af841ea Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldier.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.class new file mode 100644 index 0000000..b54353b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BattleNun.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BattleNun.class new file mode 100644 index 0000000..07cb2be Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BattleNun.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCaptain.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCaptain.class new file mode 100644 index 0000000..33e752b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCaptain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCrossbowman.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCrossbowman.class new file mode 100644 index 0000000..00334d5 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeCrossbowman.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeOutrider.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeOutrider.class new file mode 100644 index 0000000..8c32def Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeOutrider.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldier.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldier.class new file mode 100644 index 0000000..7e8bcc8 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldier.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.class new file mode 100644 index 0000000..f6a29dc Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAnimal.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAnimal.class new file mode 100644 index 0000000..f805676 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAnimal.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAuroch.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAuroch.class new file mode 100644 index 0000000..4e09cd1 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornAuroch.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$1.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$1.class new file mode 100644 index 0000000..e026d11 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$1.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$BearGroupSpawnData.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$BearGroupSpawnData.class new file mode 100644 index 0000000..9d076cd Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear$BearGroupSpawnData.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear.class new file mode 100644 index 0000000..a1d6e8b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornBear.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornElk.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornElk.class new file mode 100644 index 0000000..1fa5274 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornElk.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWildBoar.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWildBoar.class new file mode 100644 index 0000000..32a9681 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWildBoar.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWolf.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWolf.class new file mode 100644 index 0000000..a122bff Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/FangornWolf.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/Limwaith.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/Limwaith.class new file mode 100644 index 0000000..b7502cf Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/Limwaith.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.class new file mode 100644 index 0000000..2f161a0 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.class new file mode 100644 index 0000000..96e4ca8 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithChieftain.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithChieftain.class new file mode 100644 index 0000000..a7402bb Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithChieftain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithWarrior.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithWarrior.class new file mode 100644 index 0000000..384420b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/LimwaithWarrior.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfArbalest.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfArbalest.class new file mode 100644 index 0000000..1b7b117 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfArbalest.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.class new file mode 100644 index 0000000..777f54f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfCommander.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfCommander.class new file mode 100644 index 0000000..fba4ec2 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfCommander.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfWarrior.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfWarrior.class new file mode 100644 index 0000000..a1341b9 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/RedDwarfWarrior.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/Renegade.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/Renegade.class new file mode 100644 index 0000000..aee385d Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/Renegade.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/RenegadeCaptain.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/RenegadeCaptain.class new file mode 100644 index 0000000..8b32d88 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/RenegadeCaptain.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/SarumanFireball.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/SarumanFireball.class new file mode 100644 index 0000000..d7f56e9 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/SarumanFireball.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/SpeechBankModifier.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/SpeechBankModifier.class new file mode 100644 index 0000000..71114dc Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/SpeechBankModifier.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.class new file mode 100644 index 0000000..eff326f Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/entity/Wraith.class b/build/classes/java/main/com/zivilon/cinder_loe/entity/Wraith.class new file mode 100644 index 0000000..ebb9693 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/entity/Wraith.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/AlatarStaff.class b/build/classes/java/main/com/zivilon/cinder_loe/items/AlatarStaff.class new file mode 100644 index 0000000..98813ee Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/AlatarStaff.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.class b/build/classes/java/main/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.class new file mode 100644 index 0000000..04af1df Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/PallandoStaff.class b/build/classes/java/main/com/zivilon/cinder_loe/items/PallandoStaff.class new file mode 100644 index 0000000..38b155d Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/PallandoStaff.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/RadagastStaff.class b/build/classes/java/main/com/zivilon/cinder_loe/items/RadagastStaff.class new file mode 100644 index 0000000..45f46ec Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/RadagastStaff.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/SarumanStaff.class b/build/classes/java/main/com/zivilon/cinder_loe/items/SarumanStaff.class new file mode 100644 index 0000000..066b4f3 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/SarumanStaff.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/Whip.class b/build/classes/java/main/com/zivilon/cinder_loe/items/Whip.class new file mode 100644 index 0000000..d3b7897 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/Whip.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/items/WizardStaff.class b/build/classes/java/main/com/zivilon/cinder_loe/items/WizardStaff.class new file mode 100644 index 0000000..0cb845b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/items/WizardStaff.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemBlock.class new file mode 100644 index 0000000..3a62fad Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemRenderer.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemRenderer.class new file mode 100644 index 0000000..c3e4a45 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinItemRenderer.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.class new file mode 100644 index 0000000..b99e269 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.class new file mode 100644 index 0000000..345df78 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.class new file mode 100644 index 0000000..6fb04af Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.class new file mode 100644 index 0000000..cb726eb Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.class new file mode 100644 index 0000000..8b2a710 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.class new file mode 100644 index 0000000..4d211a7 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.class new file mode 100644 index 0000000..7399a13 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.class new file mode 100644 index 0000000..c846615 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.class new file mode 100644 index 0000000..b8bd8a5 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.class new file mode 100644 index 0000000..d5086b5 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.class new file mode 100644 index 0000000..823d013 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.class new file mode 100644 index 0000000..90a9c6b Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.class new file mode 100644 index 0000000..2e05f5e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.class new file mode 100644 index 0000000..3eb9727 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.class new file mode 100644 index 0000000..1d20d5c Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.class new file mode 100644 index 0000000..b5fce5c Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.class new file mode 100644 index 0000000..5c8a303 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.class new file mode 100644 index 0000000..ea59e3c Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.class new file mode 100644 index 0000000..5b0f99e Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.class new file mode 100644 index 0000000..297df35 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.class new file mode 100644 index 0000000..dfd99f3 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.class new file mode 100644 index 0000000..85df84a Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.class new file mode 100644 index 0000000..fab5c8c Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRenderItem.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRenderItem.class new file mode 100644 index 0000000..a124292 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRenderItem.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.class b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.class new file mode 100644 index 0000000..d1e2f24 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/recipes.class b/build/classes/java/main/com/zivilon/cinder_loe/recipes.class new file mode 100644 index 0000000..52e14dc Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/recipes.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.class b/build/classes/java/main/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.class new file mode 100644 index 0000000..417c50a Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/util/BlockPos.class b/build/classes/java/main/com/zivilon/cinder_loe/util/BlockPos.class new file mode 100644 index 0000000..4988a33 Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/util/BlockPos.class differ diff --git a/build/classes/java/main/com/zivilon/cinder_loe/util/Utilities.class b/build/classes/java/main/com/zivilon/cinder_loe/util/Utilities.class new file mode 100644 index 0000000..97859fe Binary files /dev/null and b/build/classes/java/main/com/zivilon/cinder_loe/util/Utilities.class differ diff --git a/build/classes/java/mcLauncher/GradleStart$AssetIndex$AssetEntry.class b/build/classes/java/mcLauncher/GradleStart$AssetIndex$AssetEntry.class new file mode 100644 index 0000000..4df4126 Binary files /dev/null and b/build/classes/java/mcLauncher/GradleStart$AssetIndex$AssetEntry.class differ diff --git a/build/classes/java/mcLauncher/GradleStart$AssetIndex.class b/build/classes/java/mcLauncher/GradleStart$AssetIndex.class new file mode 100644 index 0000000..b6f8fa3 Binary files /dev/null and b/build/classes/java/mcLauncher/GradleStart$AssetIndex.class differ diff --git a/build/classes/java/mcLauncher/GradleStart.class b/build/classes/java/mcLauncher/GradleStart.class new file mode 100644 index 0000000..acbb9c5 Binary files /dev/null and b/build/classes/java/mcLauncher/GradleStart.class differ diff --git a/build/classes/java/mcLauncher/GradleStartServer.class b/build/classes/java/mcLauncher/GradleStartServer.class new file mode 100644 index 0000000..1221132 Binary files /dev/null and b/build/classes/java/mcLauncher/GradleStartServer.class differ diff --git a/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon$AccessTransformerTransformer.class b/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon$AccessTransformerTransformer.class new file mode 100644 index 0000000..3543bd2 Binary files /dev/null and b/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon$AccessTransformerTransformer.class differ diff --git a/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon.class b/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon.class new file mode 100644 index 0000000..c367753 Binary files /dev/null and b/build/classes/java/mcLauncher/net/minecraftforge/gradle/GradleStartCommon.class differ diff --git a/build/classes/java/mcLauncher/net/minecraftforge/gradle/OldPropertyMapSerializer.class b/build/classes/java/mcLauncher/net/minecraftforge/gradle/OldPropertyMapSerializer.class new file mode 100644 index 0000000..f043473 Binary files /dev/null and b/build/classes/java/mcLauncher/net/minecraftforge/gradle/OldPropertyMapSerializer.class differ diff --git a/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.class b/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.class new file mode 100644 index 0000000..3f7e633 Binary files /dev/null and b/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.class differ diff --git a/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/CoremodTweaker.class b/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/CoremodTweaker.class new file mode 100644 index 0000000..6fef1f5 Binary files /dev/null and b/build/classes/java/mcLauncher/net/minecraftforge/gradle/tweakers/CoremodTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.class b/build/classes/java/patchedMc/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.class new file mode 100644 index 0000000..73d50e8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/ExtendedServerListData.class b/build/classes/java/patchedMc/cpw/mods/fml/client/ExtendedServerListData.class new file mode 100644 index 0000000..b76c8ec Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/ExtendedServerListData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLClientHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLClientHandler.class new file mode 100644 index 0000000..cbecb82 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLClientHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$1.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$1.class new file mode 100644 index 0000000..2e15006 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$FMLConfigGuiScreen.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$FMLConfigGuiScreen.class new file mode 100644 index 0000000..f77212b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory$FMLConfigGuiScreen.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory.class new file mode 100644 index 0000000..95b5900 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLConfigGuiFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFileResourcePack.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFileResourcePack.class new file mode 100644 index 0000000..46519a7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFileResourcePack.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFolderResourcePack.class b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFolderResourcePack.class new file mode 100644 index 0000000..be882f5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/FMLFolderResourcePack.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiAccessDenied.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiAccessDenied.class new file mode 100644 index 0000000..95e3b2d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiAccessDenied.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiBackupFailed.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiBackupFailed.class new file mode 100644 index 0000000..06f5b7d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiBackupFailed.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiConfirmation.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiConfirmation.class new file mode 100644 index 0000000..dc9dc80 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiConfirmation.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.class new file mode 100644 index 0000000..6519074 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiDupesFound.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiDupesFound.class new file mode 100644 index 0000000..76dd678 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiDupesFound.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiIngameModOptions.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiIngameModOptions.class new file mode 100644 index 0000000..3069283 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiIngameModOptions.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModList.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModList.class new file mode 100644 index 0000000..b10086e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModOptionList.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModOptionList.class new file mode 100644 index 0000000..5b85e21 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModOptionList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissing.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissing.class new file mode 100644 index 0000000..1c4afd6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissing.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissingForServer.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissingForServer.class new file mode 100644 index 0000000..9441a00 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiModsMissingForServer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiNotification.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiNotification.class new file mode 100644 index 0000000..78f4d2d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiNotification.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiOldSaveLoadConfirm.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiOldSaveLoadConfirm.class new file mode 100644 index 0000000..c2afc59 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiOldSaveLoadConfirm.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiScrollingList.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiScrollingList.class new file mode 100644 index 0000000..4a97644 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiScrollingList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSlotModList.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSlotModList.class new file mode 100644 index 0000000..ea4c5f6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSlotModList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSortingProblem.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSortingProblem.class new file mode 100644 index 0000000..a88ba71 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiSortingProblem.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/GuiWrongMinecraft.class b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiWrongMinecraft.class new file mode 100644 index 0000000..27d56f2 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/GuiWrongMinecraft.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionCategoryElement.class b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionCategoryElement.class new file mode 100644 index 0000000..e41ee8d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionCategoryElement.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionGuiHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionGuiHandler.class new file mode 100644 index 0000000..c365c6b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory$RuntimeOptionGuiHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory.class new file mode 100644 index 0000000..cb3d070 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/IModGuiFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$1.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$1.class new file mode 100644 index 0000000..df82c73 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$2.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$2.class new file mode 100644 index 0000000..f8f50d5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$3.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$3.class new file mode 100644 index 0000000..ab0f1a7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$4.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$4.class new file mode 100644 index 0000000..c4abe26 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$4.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$5.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$5.class new file mode 100644 index 0000000..4c4b3ea Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$5.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$6.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$6.class new file mode 100644 index 0000000..dbe821c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$6.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$SplashFontRenderer.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$SplashFontRenderer.class new file mode 100644 index 0000000..0706b71 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$SplashFontRenderer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$Texture.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$Texture.class new file mode 100644 index 0000000..d3a21c5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress$Texture.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress.class b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress.class new file mode 100644 index 0000000..6aab529 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/SplashProgress.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/ConfigGuiType.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/ConfigGuiType.class new file mode 100644 index 0000000..f9629f7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/ConfigGuiType.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyCategoryElement.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyCategoryElement.class new file mode 100644 index 0000000..566c17b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyCategoryElement.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyListElement.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyListElement.class new file mode 100644 index 0000000..3a9c228 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement$DummyListElement.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement.class new file mode 100644 index 0000000..2f6f85a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/DummyConfigElement.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiButtonExt.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiButtonExt.class new file mode 100644 index 0000000..fafca2f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiButtonExt.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiCheckBox.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiCheckBox.class new file mode 100644 index 0000000..2b73361 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiCheckBox.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfig.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfig.class new file mode 100644 index 0000000..85982ef Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfig.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$1.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$1.class new file mode 100644 index 0000000..0f39a5e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ArrayEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ArrayEntry.class new file mode 100644 index 0000000..2d82b77 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ArrayEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$BooleanEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$BooleanEntry.class new file mode 100644 index 0000000..c6d132a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$BooleanEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ButtonEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ButtonEntry.class new file mode 100644 index 0000000..11d7c0d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ButtonEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CategoryEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CategoryEntry.class new file mode 100644 index 0000000..f6f6edb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CategoryEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ChatColorEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ChatColorEntry.class new file mode 100644 index 0000000..6177ead Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ChatColorEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CycleValueEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CycleValueEntry.class new file mode 100644 index 0000000..2a68a98 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$CycleValueEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$DoubleEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$DoubleEntry.class new file mode 100644 index 0000000..e2472cc Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$DoubleEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IConfigEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IConfigEntry.class new file mode 100644 index 0000000..fbb2c9d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IConfigEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IntegerEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IntegerEntry.class new file mode 100644 index 0000000..336bf5a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$IntegerEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ListEntryBase.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ListEntryBase.class new file mode 100644 index 0000000..1a9ae52 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$ListEntryBase.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$NumberSliderEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$NumberSliderEntry.class new file mode 100644 index 0000000..4ca0dfb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$NumberSliderEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$SelectValueEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$SelectValueEntry.class new file mode 100644 index 0000000..d289bdd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$SelectValueEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$StringEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$StringEntry.class new file mode 100644 index 0000000..979952e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries$StringEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries.class new file mode 100644 index 0000000..127b992 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiConfigEntries.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArray.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArray.class new file mode 100644 index 0000000..adecc45 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArray.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BaseEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BaseEntry.class new file mode 100644 index 0000000..5aade73 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BaseEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BooleanEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BooleanEntry.class new file mode 100644 index 0000000..831f71c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$BooleanEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$DoubleEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$DoubleEntry.class new file mode 100644 index 0000000..aa5d086 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$DoubleEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IArrayEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IArrayEntry.class new file mode 100644 index 0000000..8eb280b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IArrayEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IntegerEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IntegerEntry.class new file mode 100644 index 0000000..1e1efb7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$IntegerEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$StringEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$StringEntry.class new file mode 100644 index 0000000..f28d93e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries$StringEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries.class new file mode 100644 index 0000000..2586261 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiEditArrayEntries.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiMessageDialog.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiMessageDialog.class new file mode 100644 index 0000000..4cdee76 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiMessageDialog.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectString.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectString.class new file mode 100644 index 0000000..ab27b25 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectString.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$EntryComparator.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$EntryComparator.class new file mode 100644 index 0000000..eaae0cd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$EntryComparator.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$IGuiSelectStringListEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$IGuiSelectStringListEntry.class new file mode 100644 index 0000000..64de078 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$IGuiSelectStringListEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$ListEntry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$ListEntry.class new file mode 100644 index 0000000..e6c66f2 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries$ListEntry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries.class new file mode 100644 index 0000000..ab36938 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSelectStringEntries.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider$ISlider.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider$ISlider.class new file mode 100644 index 0000000..9ba7496 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider$ISlider.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider.class new file mode 100644 index 0000000..9390d93 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiSlider.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.class new file mode 100644 index 0000000..9a829a5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUtils.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUtils.class new file mode 100644 index 0000000..9d2473b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/GuiUtils.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/HoverChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/HoverChecker.class new file mode 100644 index 0000000..1668b03 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/HoverChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/config/IConfigElement.class b/build/classes/java/patchedMc/cpw/mods/fml/client/config/IConfigElement.class new file mode 100644 index 0000000..26256ea Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/config/IConfigElement.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$OnConfigChangedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$OnConfigChangedEvent.class new file mode 100644 index 0000000..32da86c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$OnConfigChangedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$PostConfigChangedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$PostConfigChangedEvent.class new file mode 100644 index 0000000..f9a6d55 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent$PostConfigChangedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent.class new file mode 100644 index 0000000..babc3d4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/event/ConfigChangedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ClientRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ClientRegistry.class new file mode 100644 index 0000000..f191474 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ClientRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.class new file mode 100644 index 0000000..db199fd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry$EntityRendererInfo.class b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry$EntityRendererInfo.class new file mode 100644 index 0000000..fc66144 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry$EntityRendererInfo.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry.class new file mode 100644 index 0000000..1a1e4ad Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/client/registry/RenderingRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/API.class b/build/classes/java/patchedMc/cpw/mods/fml/common/API.class new file mode 100644 index 0000000..b13fc06 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/API.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitPluginRef.class b/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitPluginRef.class new file mode 100644 index 0000000..3dc5fd0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitPluginRef.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitProxy.class b/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitProxy.class new file mode 100644 index 0000000..f7ebd9e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/BukkitProxy.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/CertificateHelper.class b/build/classes/java/patchedMc/cpw/mods/fml/common/CertificateHelper.class new file mode 100644 index 0000000..f673ad0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/CertificateHelper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ClassNameUtils.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ClassNameUtils.class new file mode 100644 index 0000000..f176362 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ClassNameUtils.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/DummyModContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/DummyModContainer.class new file mode 100644 index 0000000..d2bf5b8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/DummyModContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/DuplicateModsFoundException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/DuplicateModsFoundException.class new file mode 100644 index 0000000..3a95923 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/DuplicateModsFoundException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$1.class new file mode 100644 index 0000000..8c29fce Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$2.class new file mode 100644 index 0000000..c2f9e77 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$3.class b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$3.class new file mode 100644 index 0000000..924401f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$WrappedPrintStream.class b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$WrappedPrintStream.class new file mode 100644 index 0000000..56441fb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException$WrappedPrintStream.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException.class new file mode 100644 index 0000000..570051c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/EnhancedRuntimeException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLCommonHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLCommonHandler.class new file mode 100644 index 0000000..5bc1bbb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLCommonHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainer.class new file mode 100644 index 0000000..ef5326e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainerHolder.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainerHolder.class new file mode 100644 index 0000000..32a9161 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLContainerHolder.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLLog.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLLog.class new file mode 100644 index 0000000..078990d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLLog.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$1.class new file mode 100644 index 0000000..a1537e0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$2.class new file mode 100644 index 0000000..e7bb5b8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer.class new file mode 100644 index 0000000..17f0b36 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/FMLModContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/IASMHook.class b/build/classes/java/patchedMc/cpw/mods/fml/common/IASMHook.class new file mode 100644 index 0000000..cb123af Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/IASMHook.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ICrashCallable.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ICrashCallable.class new file mode 100644 index 0000000..2914bce Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ICrashCallable.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLHandledException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLHandledException.class new file mode 100644 index 0000000..9dd9123 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLHandledException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLSidedHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLSidedHandler.class new file mode 100644 index 0000000..74a2975 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/IFMLSidedHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/IFuelHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/IFuelHandler.class new file mode 100644 index 0000000..b85e4a6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/IFuelHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$JavaAdapter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$JavaAdapter.class new file mode 100644 index 0000000..2a4d2ef Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$JavaAdapter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$ScalaAdapter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$ScalaAdapter.class new file mode 100644 index 0000000..3354965 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter$ScalaAdapter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter.class new file mode 100644 index 0000000..dae1a46 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ILanguageAdapter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/IWorldGenerator.class b/build/classes/java/patchedMc/cpw/mods/fml/common/IWorldGenerator.class new file mode 100644 index 0000000..e4b3c3c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/IWorldGenerator.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/InjectedModContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/InjectedModContainer.class new file mode 100644 index 0000000..9b57ff0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/InjectedModContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController$FMLSecurityManager.class b/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController$FMLSecurityManager.class new file mode 100644 index 0000000..7d77605 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController$FMLSecurityManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController.class b/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController.class new file mode 100644 index 0000000..0924515 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/LoadController.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$1.class new file mode 100644 index 0000000..2774fb5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$2.class new file mode 100644 index 0000000..5e8aeda Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$3.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$3.class new file mode 100644 index 0000000..7581cfc Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$ModIdComparator.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$ModIdComparator.class new file mode 100644 index 0000000..c66a1d7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader$ModIdComparator.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Loader.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader.class new file mode 100644 index 0000000..8f001be Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Loader.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderException.class new file mode 100644 index 0000000..d024652 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState$ModState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState$ModState.class new file mode 100644 index 0000000..b86e4b6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState$ModState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState.class new file mode 100644 index 0000000..58f5b4f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/LoaderState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/MCPDummyContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/MCPDummyContainer.class new file mode 100644 index 0000000..d6b768d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/MCPDummyContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection$ArtifactVersionAdapter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection$ArtifactVersionAdapter.class new file mode 100644 index 0000000..802410a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection$ArtifactVersionAdapter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection.class b/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection.class new file mode 100644 index 0000000..4ec4b5e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/MetadataCollection.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/MinecraftDummyContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/MinecraftDummyContainer.class new file mode 100644 index 0000000..a813701 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/MinecraftDummyContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/MissingModsException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/MissingModsException.class new file mode 100644 index 0000000..60d4ba0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/MissingModsException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$CustomProperty.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$CustomProperty.class new file mode 100644 index 0000000..acc9d68 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$CustomProperty.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$EventHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$EventHandler.class new file mode 100644 index 0000000..357d2ba Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$EventHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Instance.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Instance.class new file mode 100644 index 0000000..5e3aead Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Instance.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$InstanceFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$InstanceFactory.class new file mode 100644 index 0000000..6bdf994 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$InstanceFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Metadata.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Metadata.class new file mode 100644 index 0000000..3402050 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod$Metadata.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Mod.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod.class new file mode 100644 index 0000000..872bceb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Mod.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager$APIContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager$APIContainer.class new file mode 100644 index 0000000..2911ab0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager$APIContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager.class new file mode 100644 index 0000000..daabde8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModAPIManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModClassLoader.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModClassLoader.class new file mode 100644 index 0000000..210073d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModClassLoader.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer$Disableable.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer$Disableable.class new file mode 100644 index 0000000..7727896 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer$Disableable.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer.class new file mode 100644 index 0000000..c5163a7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainerFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainerFactory.class new file mode 100644 index 0000000..2406eee Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModContainerFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ModMetadata.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ModMetadata.class new file mode 100644 index 0000000..d6ae1c8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ModMetadata.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ObfuscationReflectionHelper.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ObfuscationReflectionHelper.class new file mode 100644 index 0000000..1ff2e25 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ObfuscationReflectionHelper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Interface.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Interface.class new file mode 100644 index 0000000..c3c1e86 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Interface.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$InterfaceList.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$InterfaceList.class new file mode 100644 index 0000000..49adb88 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$InterfaceList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Method.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Method.class new file mode 100644 index 0000000..4dfb031 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional$Method.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/Optional.class b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional.class new file mode 100644 index 0000000..cd6ccaf Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/Optional.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$1.class new file mode 100644 index 0000000..17dd8bd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$ProgressBar.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$ProgressBar.class new file mode 100644 index 0000000..d28102f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager$ProgressBar.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager.class new file mode 100644 index 0000000..60e14fe Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ProgressManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ProxyInjector.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ProxyInjector.class new file mode 100644 index 0000000..c7c9f43 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ProxyInjector.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/SaveInspectionHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/SaveInspectionHandler.class new file mode 100644 index 0000000..377b8ee Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/SaveInspectionHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/SidedProxy.class b/build/classes/java/patchedMc/cpw/mods/fml/common/SidedProxy.class new file mode 100644 index 0000000..78cae71 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/SidedProxy.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$1.class new file mode 100644 index 0000000..7d571e6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$AbortedException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$AbortedException.class new file mode 100644 index 0000000..8fd9cae Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery$AbortedException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery.class b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery.class new file mode 100644 index 0000000..947d49e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/StartupQuery.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/TracingPrintStream.class b/build/classes/java/patchedMc/cpw/mods/fml/common/TracingPrintStream.class new file mode 100644 index 0000000..0870118 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/TracingPrintStream.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/WorldAccessContainer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/WorldAccessContainer.class new file mode 100644 index 0000000..aa2e7d6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/WorldAccessContainer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/WrongMinecraftVersionException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/WrongMinecraftVersionException.class new file mode 100644 index 0000000..9267cf0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/WrongMinecraftVersionException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/ZipperUtil.class b/build/classes/java/patchedMc/cpw/mods/fml/common/ZipperUtil.class new file mode 100644 index 0000000..f83f0f5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/ZipperUtil.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/FMLSanityChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/FMLSanityChecker.class new file mode 100644 index 0000000..6be6314 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/FMLSanityChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/ReobfuscationMarker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/ReobfuscationMarker.class new file mode 100644 index 0000000..2454e0d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/ReobfuscationMarker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$1.class new file mode 100644 index 0000000..c856642 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$Modifier.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$Modifier.class new file mode 100644 index 0000000..2e486f0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer$Modifier.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer.class new file mode 100644 index 0000000..22fc772 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/AccessTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.class new file mode 100644 index 0000000..cbdf02a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.class new file mode 100644 index 0000000..4d73cd2 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.class new file mode 100644 index 0000000..703496e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer$1.class new file mode 100644 index 0000000..6ea0bf8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer.class new file mode 100644 index 0000000..3afa4b7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/MarkerTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAPITransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAPITransformer.class new file mode 100644 index 0000000..236e478 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAPITransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer$JarByteSource.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer$JarByteSource.class new file mode 100644 index 0000000..72f4697 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer$JarByteSource.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.class new file mode 100644 index 0000000..c376661 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/PatchingTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/PatchingTransformer.class new file mode 100644 index 0000000..95e2f52 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/PatchingTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/SideTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/SideTransformer.class new file mode 100644 index 0000000..8d8fb68 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/SideTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$1.class new file mode 100644 index 0000000..d4c02f1 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor$1.class new file mode 100644 index 0000000..83e83c8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor.class new file mode 100644 index 0000000..9f7073d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer$ExitVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer.class new file mode 100644 index 0000000..c8ab3f0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/TerminalTransformer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.class new file mode 100644 index 0000000..f7f3a2b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter$StaticFixingMethodVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter$StaticFixingMethodVisitor.class new file mode 100644 index 0000000..ec34e5b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter$StaticFixingMethodVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.class new file mode 100644 index 0000000..e8810f9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.class b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.class new file mode 100644 index 0000000..04feb90 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ASMData.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ASMData.class new file mode 100644 index 0000000..d87aa71 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ASMData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ModContainerPredicate.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ModContainerPredicate.class new file mode 100644 index 0000000..a2be53d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable$ModContainerPredicate.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable.class new file mode 100644 index 0000000..b1b18ff Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ASMDataTable.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ContainerType.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ContainerType.class new file mode 100644 index 0000000..415b542 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ContainerType.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$1.class new file mode 100644 index 0000000..fff3c0c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$ClassFilter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$ClassFilter.class new file mode 100644 index 0000000..5549f63 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer$ClassFilter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer.class new file mode 100644 index 0000000..4fc6885 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/DirectoryDiscoverer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ITypeDiscoverer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ITypeDiscoverer.class new file mode 100644 index 0000000..ca8780a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ITypeDiscoverer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/JarDiscoverer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/JarDiscoverer.class new file mode 100644 index 0000000..66d84f4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/JarDiscoverer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModCandidate.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModCandidate.class new file mode 100644 index 0000000..f588391 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModCandidate.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModDiscoverer.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModDiscoverer.class new file mode 100644 index 0000000..5fdd960 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/ModDiscoverer.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser$AnnotationType.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser$AnnotationType.class new file mode 100644 index 0000000..262f44d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser$AnnotationType.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser.class new file mode 100644 index 0000000..f78cd70 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ASMModParser.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation$EnumHolder.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation$EnumHolder.class new file mode 100644 index 0000000..99f5cea Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation$EnumHolder.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation.class new file mode 100644 index 0000000..8056625 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotation.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.class new file mode 100644 index 0000000..b67677e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModClassVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModClassVisitor.class new file mode 100644 index 0000000..9857d6b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModClassVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.class new file mode 100644 index 0000000..d0429ee Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.class b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.class new file mode 100644 index 0000000..1bd0686 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLConstructionEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLConstructionEvent.class new file mode 100644 index 0000000..80893d8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLConstructionEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLEvent.class new file mode 100644 index 0000000..1c0e1aa Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.class new file mode 100644 index 0000000..b7458db Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInitializationEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInitializationEvent.class new file mode 100644 index 0000000..8052af0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInitializationEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$1.class new file mode 100644 index 0000000..4989953 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCEvent.class new file mode 100644 index 0000000..6cb48cf Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCMessage.class new file mode 100644 index 0000000..210be12 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms$IMCMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms.class new file mode 100644 index 0000000..a7434e9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLInterModComms.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadCompleteEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadCompleteEvent.class new file mode 100644 index 0000000..96aac25 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadCompleteEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadEvent.class new file mode 100644 index 0000000..c88496e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLLoadEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$Action.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$Action.class new file mode 100644 index 0000000..8d3c9af Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$Action.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$MissingMapping.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$MissingMapping.class new file mode 100644 index 0000000..f40bc67 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent$MissingMapping.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent.class new file mode 100644 index 0000000..8266885 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLMissingMappingsEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModDisabledEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModDisabledEvent.class new file mode 100644 index 0000000..7f3910e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModDisabledEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$1.class new file mode 100644 index 0000000..1a1034a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$ModRemapping.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$ModRemapping.class new file mode 100644 index 0000000..863c6e3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$ModRemapping.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$RemapTarget.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$RemapTarget.class new file mode 100644 index 0000000..dde59d5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent$RemapTarget.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent.class new file mode 100644 index 0000000..e62d812 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLModIdMappingEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPostInitializationEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPostInitializationEvent.class new file mode 100644 index 0000000..5d962c8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPostInitializationEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPreInitializationEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPreInitializationEvent.class new file mode 100644 index 0000000..26832b3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLPreInitializationEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.class new file mode 100644 index 0000000..2de240e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartedEvent.class new file mode 100644 index 0000000..f741023 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartingEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartingEvent.class new file mode 100644 index 0000000..529af8d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStartingEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppedEvent.class new file mode 100644 index 0000000..b23f598 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppingEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppingEvent.class new file mode 100644 index 0000000..6ab69e5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLServerStoppingEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLStateEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLStateEvent.class new file mode 100644 index 0000000..23e13ca Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/event/FMLStateEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$1.class new file mode 100644 index 0000000..7fb8223 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$ASMClassLoader.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$ASMClassLoader.class new file mode 100644 index 0000000..cc043d0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler$ASMClassLoader.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler.class new file mode 100644 index 0000000..b7a7328 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ASMEventHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Cancelable.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Cancelable.class new file mode 100644 index 0000000..4ad5e5a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Cancelable.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$HasResult.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$HasResult.class new file mode 100644 index 0000000..171d2e3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$HasResult.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$Result.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$Result.class new file mode 100644 index 0000000..63d9ca9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event$Result.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event.class new file mode 100644 index 0000000..c7fb707 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/Event.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventBus.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventBus.class new file mode 100644 index 0000000..d215d93 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventBus.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventPriority.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventPriority.class new file mode 100644 index 0000000..a041c92 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/EventPriority.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.class new file mode 100644 index 0000000..491a1b9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventListener.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventListener.class new file mode 100644 index 0000000..ee5dce4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/IEventListener.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$1.class new file mode 100644 index 0000000..41aaf5b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$ListenerListInst.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$ListenerListInst.class new file mode 100644 index 0000000..3eeae00 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList$ListenerListInst.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList.class new file mode 100644 index 0000000..961918a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/ListenerList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/SubscribeEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/SubscribeEvent.class new file mode 100644 index 0000000..f153442 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/eventhandler/SubscribeEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.class new file mode 100644 index 0000000..9fd68ce Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/CollectionWrapperFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/CollectionWrapperFactory.class new file mode 100644 index 0000000..b6abaca Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/CollectionWrapperFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory$1.class new file mode 100644 index 0000000..a628b18 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory.class new file mode 100644 index 0000000..c89542f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/GenericIterableFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModIdFunction.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModIdFunction.class new file mode 100644 index 0000000..d0581c6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModIdFunction.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModNameFunction.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModNameFunction.class new file mode 100644 index 0000000..96f1376 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/ModNameFunction.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/functions/TypeCastFunction.class b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/TypeCastFunction.class new file mode 100644 index 0000000..c6e03d6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/functions/TypeCastFunction.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$KeyInputEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$KeyInputEvent.class new file mode 100644 index 0000000..a09ab8e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$KeyInputEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$MouseInputEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$MouseInputEvent.class new file mode 100644 index 0000000..ae7faf9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent$MouseInputEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent.class new file mode 100644 index 0000000..9aab9a3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/InputEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$1.class new file mode 100644 index 0000000..8e77e61 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemCraftedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemCraftedEvent.class new file mode 100644 index 0000000..b363050 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemCraftedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemPickupEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemPickupEvent.class new file mode 100644 index 0000000..b5606ef Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemPickupEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemSmeltedEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemSmeltedEvent.class new file mode 100644 index 0000000..61af822 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$ItemSmeltedEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerChangedDimensionEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerChangedDimensionEvent.class new file mode 100644 index 0000000..fa85b99 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerChangedDimensionEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedInEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedInEvent.class new file mode 100644 index 0000000..86d748f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedInEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedOutEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedOutEvent.class new file mode 100644 index 0000000..981a91a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerLoggedOutEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerRespawnEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerRespawnEvent.class new file mode 100644 index 0000000..005ad81 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent$PlayerRespawnEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent.class new file mode 100644 index 0000000..d377777 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/PlayerEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent.class new file mode 100644 index 0000000..ccb8a6d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ClientTickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Phase.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Phase.class new file mode 100644 index 0000000..f59465d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Phase.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent.class new file mode 100644 index 0000000..583ef90 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$PlayerTickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$RenderTickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$RenderTickEvent.class new file mode 100644 index 0000000..0be21e0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$RenderTickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ServerTickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ServerTickEvent.class new file mode 100644 index 0000000..ac8944d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$ServerTickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Type.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Type.class new file mode 100644 index 0000000..ed9e8ec Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$Type.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$WorldTickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$WorldTickEvent.class new file mode 100644 index 0000000..e54d612 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent$WorldTickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent.class new file mode 100644 index 0000000..d7da218 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/gameevent/TickEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLDeobfTweaker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLDeobfTweaker.class new file mode 100644 index 0000000..06048f0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLDeobfTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.class new file mode 100644 index 0000000..3d1bf5d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLServerTweaker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLServerTweaker.class new file mode 100644 index 0000000..31e045d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLServerTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLTweaker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLTweaker.class new file mode 100644 index 0000000..2880bb3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/FMLTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/TerminalTweaker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/TerminalTweaker.class new file mode 100644 index 0000000..2bb57d7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/TerminalTweaker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/Yggdrasil.class b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/Yggdrasil.class new file mode 100644 index 0000000..b5d7b65 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/launcher/Yggdrasil.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/ByteBufUtils.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/ByteBufUtils.class new file mode 100644 index 0000000..f70180b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/ByteBufUtils.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEmbeddedChannel.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEmbeddedChannel.class new file mode 100644 index 0000000..1f96a50 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEmbeddedChannel.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$1.class new file mode 100644 index 0000000..e79c7ca Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$1.class new file mode 100644 index 0000000..71e3e09 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$2.class new file mode 100644 index 0000000..15f15d8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory.class new file mode 100644 index 0000000..0c3a67c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel$EventFactory.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel.class new file mode 100644 index 0000000..d6f7565 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLEventChannel.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.class new file mode 100644 index 0000000..91d2716 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientConnectedToServerEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientConnectedToServerEvent.class new file mode 100644 index 0000000..658dcff Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientConnectedToServerEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientCustomPacketEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientCustomPacketEvent.class new file mode 100644 index 0000000..5497ed8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientCustomPacketEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientDisconnectionFromServerEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientDisconnectionFromServerEvent.class new file mode 100644 index 0000000..ba97a0d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ClientDisconnectionFromServerEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomNetworkEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomNetworkEvent.class new file mode 100644 index 0000000..00629ba Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomNetworkEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketEvent.class new file mode 100644 index 0000000..dd3b206 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketRegistrationEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketRegistrationEvent.class new file mode 100644 index 0000000..a4fcef2 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$CustomPacketRegistrationEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerConnectionFromClientEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerConnectionFromClientEvent.class new file mode 100644 index 0000000..16a2932 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerConnectionFromClientEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerCustomPacketEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerCustomPacketEvent.class new file mode 100644 index 0000000..1be7929 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerCustomPacketEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerDisconnectionFromClientEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerDisconnectionFromClientEvent.class new file mode 100644 index 0000000..bc6a349 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent$ServerDisconnectionFromClientEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent.class new file mode 100644 index 0000000..7fc8c7a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkEvent.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkException.class new file mode 100644 index 0000000..7d634ec Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLNetworkException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$1.class new file mode 100644 index 0000000..c8b5014 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$1.class new file mode 100644 index 0000000..6b9e1d6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$2.class new file mode 100644 index 0000000..7d36573 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$3.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$3.class new file mode 100644 index 0000000..4fd204b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$4.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$4.class new file mode 100644 index 0000000..f6c7be7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$4.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$5.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$5.class new file mode 100644 index 0000000..2a0529a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$5.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$6.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$6.class new file mode 100644 index 0000000..8ff3a6d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$6.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$7.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$7.class new file mode 100644 index 0000000..78d2827 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$7.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$8.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$8.class new file mode 100644 index 0000000..b476d61 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget$8.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget.class new file mode 100644 index 0000000..0974d3f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler$OutboundTarget.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler.class new file mode 100644 index 0000000..4b81e13 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/FMLOutboundHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/IGuiHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/IGuiHandler.class new file mode 100644 index 0000000..a555159 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/IGuiHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkCheckHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkCheckHandler.class new file mode 100644 index 0000000..4870355 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkCheckHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkEventFiringHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkEventFiringHandler.class new file mode 100644 index 0000000..aa71880 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkEventFiringHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkHandshakeEstablished.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkHandshakeEstablished.class new file mode 100644 index 0000000..6e40aad Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkHandshakeEstablished.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry$TargetPoint.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry$TargetPoint.class new file mode 100644 index 0000000..6bdad6a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry$TargetPoint.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry.class new file mode 100644 index 0000000..94f2597 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/NetworkRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.class new file mode 100644 index 0000000..5a8adf7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$1.class new file mode 100644 index 0000000..2713871 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$2.class new file mode 100644 index 0000000..a4bd8c1 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$3.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$3.class new file mode 100644 index 0000000..023bd80 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$4.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$4.class new file mode 100644 index 0000000..bf49ba9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$4.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$5.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$5.class new file mode 100644 index 0000000..69e6318 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$5.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$6.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$6.class new file mode 100644 index 0000000..d35fc05 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$6.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$7.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$7.class new file mode 100644 index 0000000..d63ecac Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$7.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$8.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$8.class new file mode 100644 index 0000000..7a6bb23 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState$8.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.class new file mode 100644 index 0000000..816388d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.class new file mode 100644 index 0000000..5ea0581 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ClientHello.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ClientHello.class new file mode 100644 index 0000000..878ec11 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ClientHello.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeAck.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeAck.class new file mode 100644 index 0000000..86f2006 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeAck.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeReset.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeReset.class new file mode 100644 index 0000000..b0424d8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$HandshakeReset.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModIdData.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModIdData.class new file mode 100644 index 0000000..4a3df65 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModIdData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModList.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModList.class new file mode 100644 index 0000000..8cbd6d4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ModList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ServerHello.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ServerHello.class new file mode 100644 index 0000000..abe591c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage$ServerHello.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.class new file mode 100644 index 0000000..b461302 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$1.class new file mode 100644 index 0000000..ce4af70 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$2.class new file mode 100644 index 0000000..d03fea8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$3.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$3.class new file mode 100644 index 0000000..48c07b7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$4.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$4.class new file mode 100644 index 0000000..3c1fdd7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$4.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$5.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$5.class new file mode 100644 index 0000000..7889b05 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$5.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$6.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$6.class new file mode 100644 index 0000000..9069cd8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState$6.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.class new file mode 100644 index 0000000..822dc89 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeInjector.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeInjector.class new file mode 100644 index 0000000..c7f694f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeInjector.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.class new file mode 100644 index 0000000..c450a2f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/IHandshakeState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/IHandshakeState.class new file mode 100644 index 0000000..c37c07c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/IHandshakeState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$1.class new file mode 100644 index 0000000..b3a5a32 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionState.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionState.class new file mode 100644 index 0000000..0deafd8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionType.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionType.class new file mode 100644 index 0000000..b64ab07 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$ConnectionType.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter$1.class new file mode 100644 index 0000000..4acfb1b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter.class new file mode 100644 index 0000000..e9cb6c0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher$VanillaTimeoutWaiter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher.class new file mode 100644 index 0000000..f67c80a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/handshake/NetworkDispatcher.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/EntitySpawnHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/EntitySpawnHandler.class new file mode 100644 index 0000000..5c2787b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/EntitySpawnHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$CompleteHandshake.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$CompleteHandshake.class new file mode 100644 index 0000000..19b20ab Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$CompleteHandshake.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityAdjustMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityAdjustMessage.class new file mode 100644 index 0000000..13d775c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityAdjustMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityMessage.class new file mode 100644 index 0000000..ce38fac Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntityMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntitySpawnMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntitySpawnMessage.class new file mode 100644 index 0000000..59592dc Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$EntitySpawnMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$OpenGui.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$OpenGui.class new file mode 100644 index 0000000..4be9c9c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage$OpenGui.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage.class new file mode 100644 index 0000000..f9360de Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLNetworkHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLNetworkHandler.class new file mode 100644 index 0000000..d54343e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLNetworkHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLProxyPacket.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLProxyPacket.class new file mode 100644 index 0000000..f1d6458 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLProxyPacket.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.class new file mode 100644 index 0000000..e3d2db7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.class new file mode 100644 index 0000000..7cd7a7a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$1.class new file mode 100644 index 0000000..a8e2209 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$DefaultNetworkChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$DefaultNetworkChecker.class new file mode 100644 index 0000000..a79d514 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$DefaultNetworkChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$IgnoredChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$IgnoredChecker.class new file mode 100644 index 0000000..d3afb36 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$IgnoredChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$MethodNetworkChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$MethodNetworkChecker.class new file mode 100644 index 0000000..da2b6dd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$MethodNetworkChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$NetworkChecker.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$NetworkChecker.class new file mode 100644 index 0000000..e90aee3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder$NetworkChecker.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder.class new file mode 100644 index 0000000..4c92c56 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/NetworkModHolder.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/OpenGuiHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/OpenGuiHandler.class new file mode 100644 index 0000000..c75d373 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/internal/OpenGuiHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessage.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessage.class new file mode 100644 index 0000000..fd1ac1c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessage.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.class new file mode 100644 index 0000000..c918a31 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/MessageContext.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/MessageContext.class new file mode 100644 index 0000000..6c49463 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/MessageContext.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.class new file mode 100644 index 0000000..81b944f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.class new file mode 100644 index 0000000..fe509cb Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.class b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.class new file mode 100644 index 0000000..6f8532c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatch.class b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatch.class new file mode 100644 index 0000000..2b7802b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatch.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatchManager.class b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatchManager.class new file mode 100644 index 0000000..ee13861 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/ClassPatchManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/GenDiffSet.class b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/GenDiffSet.class new file mode 100644 index 0000000..cf4bb62 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/patcher/GenDiffSet.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry$EntityRegistration.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry$EntityRegistration.class new file mode 100644 index 0000000..671132e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry$EntityRegistration.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry.class new file mode 100644 index 0000000..9558093 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/EntityRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ExistingSubstitutionException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ExistingSubstitutionException.class new file mode 100644 index 0000000..05a80c1 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ExistingSubstitutionException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.class new file mode 100644 index 0000000..b95e51b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData$GameDataSnapshot.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData$GameDataSnapshot.class new file mode 100644 index 0000000..1ee78da Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData$GameDataSnapshot.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData.class new file mode 100644 index 0000000..7cd31a4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$1.class new file mode 100644 index 0000000..6e46688 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ItemStackHolder.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ItemStackHolder.class new file mode 100644 index 0000000..b900107 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ItemStackHolder.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ObjectHolder.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ObjectHolder.class new file mode 100644 index 0000000..62b4b04 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$ObjectHolder.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$1.class new file mode 100644 index 0000000..15706a1 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$2.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$2.class new file mode 100644 index 0000000..0a320ad Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type.class new file mode 100644 index 0000000..82193b8 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$Type.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$UniqueIdentifier.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$UniqueIdentifier.class new file mode 100644 index 0000000..dbf5f12 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry$UniqueIdentifier.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry.class new file mode 100644 index 0000000..06dbfce Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/GameRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.class new file mode 100644 index 0000000..b324973 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IThrowableEntity.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IThrowableEntity.class new file mode 100644 index 0000000..629d857 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IThrowableEntity.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.class new file mode 100644 index 0000000..109b307 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderInjector.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderInjector.class new file mode 100644 index 0000000..8a146c0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderInjector.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderRef.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderRef.class new file mode 100644 index 0000000..94bb144 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ItemStackHolderRef.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/LanguageRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/LanguageRegistry.class new file mode 100644 index 0000000..2222c6b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/LanguageRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRef.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRef.class new file mode 100644 index 0000000..0d26d9d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRef.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRegistry.class new file mode 100644 index 0000000..34d5ac3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/ObjectHolderRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate$Delegate.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate$Delegate.class new file mode 100644 index 0000000..ecdfe14 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate$Delegate.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate.class new file mode 100644 index 0000000..5ed705e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/RegistryDelegate.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageCreationHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageCreationHandler.class new file mode 100644 index 0000000..1dcd551 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageCreationHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageTradeHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageTradeHandler.class new file mode 100644 index 0000000..40f8528 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry$IVillageTradeHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry.class b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry.class new file mode 100644 index 0000000..a016254 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/registry/VillagerRegistry.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSorter.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSorter.class new file mode 100644 index 0000000..ec3e7a3 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSorter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException$SortingExceptionData.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException$SortingExceptionData.class new file mode 100644 index 0000000..eca6472 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException$SortingExceptionData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException.class new file mode 100644 index 0000000..fe0b5b7 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/ModSortingException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph$1.class new file mode 100644 index 0000000..f16ad65 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph.class new file mode 100644 index 0000000..aa28a96 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort$DirectedGraph.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort.class b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort.class new file mode 100644 index 0000000..24531ad Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/toposort/TopologicalSort.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ArtifactVersion.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ArtifactVersion.class new file mode 100644 index 0000000..f21d78e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ArtifactVersion.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$1.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$1.class new file mode 100644 index 0000000..1638ebc Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$IntegerItem.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$IntegerItem.class new file mode 100644 index 0000000..09af9fe Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$IntegerItem.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$Item.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$Item.class new file mode 100644 index 0000000..344580c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$Item.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$ListItem.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$ListItem.class new file mode 100644 index 0000000..572d99d Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$ListItem.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$StringItem.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$StringItem.class new file mode 100644 index 0000000..6231aa6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion$StringItem.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion.class new file mode 100644 index 0000000..29d62f5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/ComparableVersion.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/DefaultArtifactVersion.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/DefaultArtifactVersion.class new file mode 100644 index 0000000..b13fb25 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/DefaultArtifactVersion.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.class new file mode 100644 index 0000000..1955b6f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/Restriction.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/Restriction.class new file mode 100644 index 0000000..3581b41 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/Restriction.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionParser.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionParser.class new file mode 100644 index 0000000..954c6bd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionParser.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionRange.class b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionRange.class new file mode 100644 index 0000000..7c5e8e5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/common/versioning/VersionRange.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$1.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$1.class new file mode 100644 index 0000000..dca79c4 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$1.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$2.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$2.class new file mode 100644 index 0000000..948cecd Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$2.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$3.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$3.class new file mode 100644 index 0000000..e6d2c85 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$3.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$4.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$4.class new file mode 100644 index 0000000..c884a01 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$4.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$FMLPluginWrapper.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$FMLPluginWrapper.class new file mode 100644 index 0000000..b38c6ae Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager$FMLPluginWrapper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager.class new file mode 100644 index 0000000..2ad5364 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/CoreModManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLCorePlugin.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLCorePlugin.class new file mode 100644 index 0000000..7997b5f Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLCorePlugin.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLInjectionData.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLInjectionData.class new file mode 100644 index 0000000..1e4bd56 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLInjectionData.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLLaunchHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLLaunchHandler.class new file mode 100644 index 0000000..8d8de3c Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLLaunchHandler.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLRelaunchLog.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLRelaunchLog.class new file mode 100644 index 0000000..bf83442 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLRelaunchLog.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager$ExitTrappedException.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager$ExitTrappedException.class new file mode 100644 index 0000000..abcf1c6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager$ExitTrappedException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager.class new file mode 100644 index 0000000..2889a11 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FMLSecurityManager.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper$CaseInsensitiveFileComparator.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper$CaseInsensitiveFileComparator.class new file mode 100644 index 0000000..96258b2 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper$CaseInsensitiveFileComparator.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper.class new file mode 100644 index 0000000..089f745 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/FileListHelper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLCallHook.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLCallHook.class new file mode 100644 index 0000000..a738171 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLCallHook.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$DependsOn.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$DependsOn.class new file mode 100644 index 0000000..5211768 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$DependsOn.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$MCVersion.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$MCVersion.class new file mode 100644 index 0000000..b72f8f9 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$MCVersion.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$Name.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$Name.class new file mode 100644 index 0000000..50a0e9b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$Name.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$SortingIndex.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$SortingIndex.class new file mode 100644 index 0000000..598c4bf Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$SortingIndex.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$TransformerExclusions.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$TransformerExclusions.class new file mode 100644 index 0000000..b77fb4e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin$TransformerExclusions.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin.class new file mode 100644 index 0000000..b22341a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/IFMLLoadingPlugin.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper$JsonModList.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper$JsonModList.class new file mode 100644 index 0000000..423bd7e Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper$JsonModList.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper.class new file mode 100644 index 0000000..eef7a55 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ModListHelper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToAccessFieldException.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToAccessFieldException.class new file mode 100644 index 0000000..814f6c5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToAccessFieldException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindClassException.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindClassException.class new file mode 100644 index 0000000..25a3437 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindClassException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindFieldException.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindFieldException.class new file mode 100644 index 0000000..e2e122b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindFieldException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindMethodException.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindMethodException.class new file mode 100644 index 0000000..1276042 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper$UnableToFindMethodException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper.class new file mode 100644 index 0000000..1dfcace Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ReflectionHelper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ServerLaunchWrapper.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ServerLaunchWrapper.class new file mode 100644 index 0000000..1ef4806 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/ServerLaunchWrapper.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/Side.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/Side.class new file mode 100644 index 0000000..9d69000 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/Side.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/relauncher/SideOnly.class b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/SideOnly.class new file mode 100644 index 0000000..e7ac224 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/relauncher/SideOnly.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.class new file mode 100644 index 0000000..602d3e5 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Checksum.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Checksum.class new file mode 100644 index 0000000..dc3159b Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Checksum.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.class new file mode 100644 index 0000000..435f7f6 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$SourceState.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$SourceState.class new file mode 100644 index 0000000..778de1a Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$SourceState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$TargetState.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$TargetState.class new file mode 100644 index 0000000..4955efe Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta$TargetState.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta.class new file mode 100644 index 0000000..f9ea1fe Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/Delta.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.class new file mode 100644 index 0000000..ff60135 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.class new file mode 100644 index 0000000..2ce0e03 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.class new file mode 100644 index 0000000..d576611 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/PatchException.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/PatchException.class new file mode 100644 index 0000000..d557654 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/PatchException.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.class new file mode 100644 index 0000000..634a4e0 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.class b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.class new file mode 100644 index 0000000..3040274 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.class differ diff --git a/build/classes/java/patchedMc/cpw/mods/fml/server/FMLServerHandler.class b/build/classes/java/patchedMc/cpw/mods/fml/server/FMLServerHandler.class new file mode 100644 index 0000000..ecdef92 Binary files /dev/null and b/build/classes/java/patchedMc/cpw/mods/fml/server/FMLServerHandler.class differ diff --git a/build/classes/java/patchedMc/ibxm/Channel.class b/build/classes/java/patchedMc/ibxm/Channel.class new file mode 100644 index 0000000..ade2838 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Channel.class differ diff --git a/build/classes/java/patchedMc/ibxm/Envelope.class b/build/classes/java/patchedMc/ibxm/Envelope.class new file mode 100644 index 0000000..85ee0cb Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Envelope.class differ diff --git a/build/classes/java/patchedMc/ibxm/FastTracker2.class b/build/classes/java/patchedMc/ibxm/FastTracker2.class new file mode 100644 index 0000000..9e4b1e0 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/FastTracker2.class differ diff --git a/build/classes/java/patchedMc/ibxm/IBXM.class b/build/classes/java/patchedMc/ibxm/IBXM.class new file mode 100644 index 0000000..0b7adda Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/IBXM.class differ diff --git a/build/classes/java/patchedMc/ibxm/Instrument.class b/build/classes/java/patchedMc/ibxm/Instrument.class new file mode 100644 index 0000000..0fa29d6 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Instrument.class differ diff --git a/build/classes/java/patchedMc/ibxm/LogTable.class b/build/classes/java/patchedMc/ibxm/LogTable.class new file mode 100644 index 0000000..84918e2 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/LogTable.class differ diff --git a/build/classes/java/patchedMc/ibxm/Module.class b/build/classes/java/patchedMc/ibxm/Module.class new file mode 100644 index 0000000..cec1d8e Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Module.class differ diff --git a/build/classes/java/patchedMc/ibxm/Pattern.class b/build/classes/java/patchedMc/ibxm/Pattern.class new file mode 100644 index 0000000..5b196c2 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Pattern.class differ diff --git a/build/classes/java/patchedMc/ibxm/Player$1.class b/build/classes/java/patchedMc/ibxm/Player$1.class new file mode 100644 index 0000000..85024c6 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Player$1.class differ diff --git a/build/classes/java/patchedMc/ibxm/Player$Driver.class b/build/classes/java/patchedMc/ibxm/Player$Driver.class new file mode 100644 index 0000000..b46a018 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Player$Driver.class differ diff --git a/build/classes/java/patchedMc/ibxm/Player.class b/build/classes/java/patchedMc/ibxm/Player.class new file mode 100644 index 0000000..9a8cd4a Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Player.class differ diff --git a/build/classes/java/patchedMc/ibxm/ProTracker.class b/build/classes/java/patchedMc/ibxm/ProTracker.class new file mode 100644 index 0000000..dbc0f2b Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/ProTracker.class differ diff --git a/build/classes/java/patchedMc/ibxm/Sample.class b/build/classes/java/patchedMc/ibxm/Sample.class new file mode 100644 index 0000000..9cfa357 Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/Sample.class differ diff --git a/build/classes/java/patchedMc/ibxm/ScreamTracker3.class b/build/classes/java/patchedMc/ibxm/ScreamTracker3.class new file mode 100644 index 0000000..db19aeb Binary files /dev/null and b/build/classes/java/patchedMc/ibxm/ScreamTracker3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$1.class b/build/classes/java/patchedMc/net/minecraft/block/Block$1.class new file mode 100644 index 0000000..d6a3d39 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$2.class b/build/classes/java/patchedMc/net/minecraft/block/Block$2.class new file mode 100644 index 0000000..21e90e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$3.class b/build/classes/java/patchedMc/net/minecraft/block/Block$3.class new file mode 100644 index 0000000..30e15cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$4.class b/build/classes/java/patchedMc/net/minecraft/block/Block$4.class new file mode 100644 index 0000000..a012922 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$5.class b/build/classes/java/patchedMc/net/minecraft/block/Block$5.class new file mode 100644 index 0000000..b996431 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$6.class b/build/classes/java/patchedMc/net/minecraft/block/Block$6.class new file mode 100644 index 0000000..9257510 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block$SoundType.class b/build/classes/java/patchedMc/net/minecraft/block/Block$SoundType.class new file mode 100644 index 0000000..0f6fa81 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block$SoundType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/Block.class b/build/classes/java/patchedMc/net/minecraft/block/Block.class new file mode 100644 index 0000000..c91dab1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/Block.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockAir.class b/build/classes/java/patchedMc/net/minecraft/block/BlockAir.class new file mode 100644 index 0000000..c6598d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockAir.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockAnvil.class b/build/classes/java/patchedMc/net/minecraft/block/BlockAnvil.class new file mode 100644 index 0000000..f33794c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockAnvil.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBasePressurePlate.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBasePressurePlate.class new file mode 100644 index 0000000..c76eff7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBasePressurePlate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBeacon.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBeacon.class new file mode 100644 index 0000000..7a268a5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBeacon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBed.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBed.class new file mode 100644 index 0000000..55f4e6f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBookshelf.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBookshelf.class new file mode 100644 index 0000000..e2bf8f7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBookshelf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBreakable.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBreakable.class new file mode 100644 index 0000000..7db9e54 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBreakable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBrewingStand.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBrewingStand.class new file mode 100644 index 0000000..4e70851 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBrewingStand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockBush.class b/build/classes/java/patchedMc/net/minecraft/block/BlockBush.class new file mode 100644 index 0000000..a08a057 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockBush.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockButton.class b/build/classes/java/patchedMc/net/minecraft/block/BlockButton.class new file mode 100644 index 0000000..fa45feb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockButtonStone.class b/build/classes/java/patchedMc/net/minecraft/block/BlockButtonStone.class new file mode 100644 index 0000000..9e7ba87 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockButtonStone.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockButtonWood.class b/build/classes/java/patchedMc/net/minecraft/block/BlockButtonWood.class new file mode 100644 index 0000000..de30335 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockButtonWood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCactus.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCactus.class new file mode 100644 index 0000000..c4cf394 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCactus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCake.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCake.class new file mode 100644 index 0000000..1ce98ad Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCake.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCarpet.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCarpet.class new file mode 100644 index 0000000..9daea35 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCarpet.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCarrot.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCarrot.class new file mode 100644 index 0000000..11fd0da Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCarrot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCauldron.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCauldron.class new file mode 100644 index 0000000..0b36f09 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCauldron.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockChest.class b/build/classes/java/patchedMc/net/minecraft/block/BlockChest.class new file mode 100644 index 0000000..99dd73e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockClay.class b/build/classes/java/patchedMc/net/minecraft/block/BlockClay.class new file mode 100644 index 0000000..f7ae9c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockClay.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCocoa.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCocoa.class new file mode 100644 index 0000000..b5e7238 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCocoa.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockColored.class b/build/classes/java/patchedMc/net/minecraft/block/BlockColored.class new file mode 100644 index 0000000..b328980 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockColored.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCommandBlock.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCommandBlock.class new file mode 100644 index 0000000..f47b7e0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCommandBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCompressed.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCompressed.class new file mode 100644 index 0000000..d4e784b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCompressed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCompressedPowered.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCompressedPowered.class new file mode 100644 index 0000000..198fa01 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCompressedPowered.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockContainer.class b/build/classes/java/patchedMc/net/minecraft/block/BlockContainer.class new file mode 100644 index 0000000..6e13ee8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockContainer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockCrops.class b/build/classes/java/patchedMc/net/minecraft/block/BlockCrops.class new file mode 100644 index 0000000..30f7f0d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockCrops.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDaylightDetector.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDaylightDetector.class new file mode 100644 index 0000000..e13b214 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDaylightDetector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDeadBush.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDeadBush.class new file mode 100644 index 0000000..25b0b92 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDeadBush.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDirectional.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDirectional.class new file mode 100644 index 0000000..044f747 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDirectional.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDirt.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDirt.class new file mode 100644 index 0000000..deed66d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDirt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDispenser.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDispenser.class new file mode 100644 index 0000000..e11d5cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDispenser.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDoor.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDoor.class new file mode 100644 index 0000000..9afe674 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDoublePlant.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDoublePlant.class new file mode 100644 index 0000000..b61b1ec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDoublePlant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDragonEgg.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDragonEgg.class new file mode 100644 index 0000000..f104cb2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDragonEgg.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDropper.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDropper.class new file mode 100644 index 0000000..79beb2b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDropper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockDynamicLiquid.class b/build/classes/java/patchedMc/net/minecraft/block/BlockDynamicLiquid.class new file mode 100644 index 0000000..7ea63ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockDynamicLiquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockEnchantmentTable.class b/build/classes/java/patchedMc/net/minecraft/block/BlockEnchantmentTable.class new file mode 100644 index 0000000..b4f40a4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockEnchantmentTable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortal.class b/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortal.class new file mode 100644 index 0000000..7395ae1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortalFrame.class b/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortalFrame.class new file mode 100644 index 0000000..ee5647c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockEndPortalFrame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockEnderChest.class b/build/classes/java/patchedMc/net/minecraft/block/BlockEnderChest.class new file mode 100644 index 0000000..f933043 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockEnderChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockEventData.class b/build/classes/java/patchedMc/net/minecraft/block/BlockEventData.class new file mode 100644 index 0000000..16197b2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockEventData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFalling.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFalling.class new file mode 100644 index 0000000..73955f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFalling.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFarmland.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFarmland.class new file mode 100644 index 0000000..3919b8e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFarmland.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFence.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFence.class new file mode 100644 index 0000000..1cc3a70 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFence.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFenceGate.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFenceGate.class new file mode 100644 index 0000000..429e960 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFenceGate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFire$1.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFire$1.class new file mode 100644 index 0000000..8b31ba4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFire$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFire$FireInfo.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFire$FireInfo.class new file mode 100644 index 0000000..3146a19 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFire$FireInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFire.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFire.class new file mode 100644 index 0000000..891420d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFire.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFlower.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFlower.class new file mode 100644 index 0000000..e0e6e26 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFlower.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFlowerPot.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFlowerPot.class new file mode 100644 index 0000000..9b15f60 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFlowerPot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockFurnace.class b/build/classes/java/patchedMc/net/minecraft/block/BlockFurnace.class new file mode 100644 index 0000000..849d882 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockGlass.class b/build/classes/java/patchedMc/net/minecraft/block/BlockGlass.class new file mode 100644 index 0000000..0897ce1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockGlass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockGlowstone.class b/build/classes/java/patchedMc/net/minecraft/block/BlockGlowstone.class new file mode 100644 index 0000000..ec3cb49 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockGlowstone.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockGrass.class b/build/classes/java/patchedMc/net/minecraft/block/BlockGrass.class new file mode 100644 index 0000000..c4a8a27 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockGrass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockGravel.class b/build/classes/java/patchedMc/net/minecraft/block/BlockGravel.class new file mode 100644 index 0000000..eee8f10 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockGravel.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockHardenedClay.class b/build/classes/java/patchedMc/net/minecraft/block/BlockHardenedClay.class new file mode 100644 index 0000000..8ba4726 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockHardenedClay.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockHay.class b/build/classes/java/patchedMc/net/minecraft/block/BlockHay.class new file mode 100644 index 0000000..df3cbb3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockHay.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockHopper.class b/build/classes/java/patchedMc/net/minecraft/block/BlockHopper.class new file mode 100644 index 0000000..9931bfc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockHugeMushroom.class b/build/classes/java/patchedMc/net/minecraft/block/BlockHugeMushroom.class new file mode 100644 index 0000000..a9f352f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockHugeMushroom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockIce.class b/build/classes/java/patchedMc/net/minecraft/block/BlockIce.class new file mode 100644 index 0000000..5f08fb6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockIce.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox$TileEntityJukebox.class b/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox$TileEntityJukebox.class new file mode 100644 index 0000000..d595121 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox$TileEntityJukebox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox.class b/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox.class new file mode 100644 index 0000000..5391926 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockJukebox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLadder.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLadder.class new file mode 100644 index 0000000..9d47ca5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLadder.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLeaves.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLeaves.class new file mode 100644 index 0000000..484c128 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLeaves.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLeavesBase.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLeavesBase.class new file mode 100644 index 0000000..968e6f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLeavesBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLever.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLever.class new file mode 100644 index 0000000..bbd29e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLever.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLilyPad.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLilyPad.class new file mode 100644 index 0000000..57b4844 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLilyPad.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLiquid.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLiquid.class new file mode 100644 index 0000000..92bbb60 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLiquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockLog.class b/build/classes/java/patchedMc/net/minecraft/block/BlockLog.class new file mode 100644 index 0000000..f2ba09f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockLog.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockMelon.class b/build/classes/java/patchedMc/net/minecraft/block/BlockMelon.class new file mode 100644 index 0000000..531dea3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockMelon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockMobSpawner.class b/build/classes/java/patchedMc/net/minecraft/block/BlockMobSpawner.class new file mode 100644 index 0000000..16e43dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockMobSpawner.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockMushroom.class b/build/classes/java/patchedMc/net/minecraft/block/BlockMushroom.class new file mode 100644 index 0000000..b585bd8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockMushroom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockMycelium.class b/build/classes/java/patchedMc/net/minecraft/block/BlockMycelium.class new file mode 100644 index 0000000..a2df203 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockMycelium.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockNetherWart.class b/build/classes/java/patchedMc/net/minecraft/block/BlockNetherWart.class new file mode 100644 index 0000000..e150381 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockNetherWart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockNetherrack.class b/build/classes/java/patchedMc/net/minecraft/block/BlockNetherrack.class new file mode 100644 index 0000000..0eb6101 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockNetherrack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockNewLeaf.class b/build/classes/java/patchedMc/net/minecraft/block/BlockNewLeaf.class new file mode 100644 index 0000000..7b69248 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockNewLeaf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockNewLog.class b/build/classes/java/patchedMc/net/minecraft/block/BlockNewLog.class new file mode 100644 index 0000000..172a081 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockNewLog.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockNote.class b/build/classes/java/patchedMc/net/minecraft/block/BlockNote.class new file mode 100644 index 0000000..646f2cb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockNote.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockObsidian.class b/build/classes/java/patchedMc/net/minecraft/block/BlockObsidian.class new file mode 100644 index 0000000..0b82737 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockObsidian.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockOldLeaf.class b/build/classes/java/patchedMc/net/minecraft/block/BlockOldLeaf.class new file mode 100644 index 0000000..e1b6fc3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockOldLeaf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockOldLog.class b/build/classes/java/patchedMc/net/minecraft/block/BlockOldLog.class new file mode 100644 index 0000000..b4820b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockOldLog.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockOre.class b/build/classes/java/patchedMc/net/minecraft/block/BlockOre.class new file mode 100644 index 0000000..38d98ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockOre.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPackedIce.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPackedIce.class new file mode 100644 index 0000000..bebfd1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPackedIce.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPane.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPane.class new file mode 100644 index 0000000..82609cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPane.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPistonBase.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonBase.class new file mode 100644 index 0000000..8cdbc24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPistonExtension.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonExtension.class new file mode 100644 index 0000000..3c34dd0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonExtension.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPistonMoving.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonMoving.class new file mode 100644 index 0000000..e799f77 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPistonMoving.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPortal$Size.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPortal$Size.class new file mode 100644 index 0000000..bd0813e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPortal$Size.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPortal.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPortal.class new file mode 100644 index 0000000..d5379dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPortal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPotato.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPotato.class new file mode 100644 index 0000000..b5c61dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPotato.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate$Sensitivity.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate$Sensitivity.class new file mode 100644 index 0000000..fd76c31 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate$Sensitivity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate.class new file mode 100644 index 0000000..e04d00a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlateWeighted.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlateWeighted.class new file mode 100644 index 0000000..8a8c5ac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPressurePlateWeighted.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockPumpkin.class b/build/classes/java/patchedMc/net/minecraft/block/BlockPumpkin.class new file mode 100644 index 0000000..43878f9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockPumpkin.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockQuartz.class b/build/classes/java/patchedMc/net/minecraft/block/BlockQuartz.class new file mode 100644 index 0000000..995845a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockQuartz.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRail.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRail.class new file mode 100644 index 0000000..2111ac8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRail.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase$Rail.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase$Rail.class new file mode 100644 index 0000000..18f068e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase$Rail.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase.class new file mode 100644 index 0000000..c550dae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRailBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRailDetector.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRailDetector.class new file mode 100644 index 0000000..4cd8401 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRailDetector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRailPowered.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRailPowered.class new file mode 100644 index 0000000..f7cc5dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRailPowered.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneComparator.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneComparator.class new file mode 100644 index 0000000..cef0815 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneDiode.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneDiode.class new file mode 100644 index 0000000..948913d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneDiode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneLight.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneLight.class new file mode 100644 index 0000000..3823985 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneLight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneOre.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneOre.class new file mode 100644 index 0000000..7d176d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneOre.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneRepeater.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneRepeater.class new file mode 100644 index 0000000..b680978 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneRepeater.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch$Toggle.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch$Toggle.class new file mode 100644 index 0000000..d9f6ec5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch$Toggle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch.class new file mode 100644 index 0000000..dabf330 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneTorch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneWire.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneWire.class new file mode 100644 index 0000000..9b0feff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRedstoneWire.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockReed.class b/build/classes/java/patchedMc/net/minecraft/block/BlockReed.class new file mode 100644 index 0000000..72235c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockReed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockRotatedPillar.class b/build/classes/java/patchedMc/net/minecraft/block/BlockRotatedPillar.class new file mode 100644 index 0000000..1303f82 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockRotatedPillar.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSand.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSand.class new file mode 100644 index 0000000..a09a530 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSandStone.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSandStone.class new file mode 100644 index 0000000..3fb0d1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSandStone.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSapling.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSapling.class new file mode 100644 index 0000000..8f09889 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSapling.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSign.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSign.class new file mode 100644 index 0000000..76aba0f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSilverfish.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSilverfish.class new file mode 100644 index 0000000..c40680c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSilverfish.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSkull.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSkull.class new file mode 100644 index 0000000..020c1da Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSkull.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSlab.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSlab.class new file mode 100644 index 0000000..961d53f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSlab.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSnow.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSnow.class new file mode 100644 index 0000000..5e0d193 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSnow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSnowBlock.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSnowBlock.class new file mode 100644 index 0000000..40fce22 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSnowBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSoulSand.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSoulSand.class new file mode 100644 index 0000000..72db4ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSoulSand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSourceImpl.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSourceImpl.class new file mode 100644 index 0000000..7b1e340 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSourceImpl.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockSponge.class b/build/classes/java/patchedMc/net/minecraft/block/BlockSponge.class new file mode 100644 index 0000000..ddcd60e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockSponge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlass.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlass.class new file mode 100644 index 0000000..c041092 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlassPane.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlassPane.class new file mode 100644 index 0000000..7ba65d4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStainedGlassPane.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStairs.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStairs.class new file mode 100644 index 0000000..d164415 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStairs.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStaticLiquid.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStaticLiquid.class new file mode 100644 index 0000000..c7307e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStaticLiquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStem.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStem.class new file mode 100644 index 0000000..4585c6b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStone.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStone.class new file mode 100644 index 0000000..255e60e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStone.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStoneBrick.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStoneBrick.class new file mode 100644 index 0000000..64c2ac4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStoneBrick.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockStoneSlab.class b/build/classes/java/patchedMc/net/minecraft/block/BlockStoneSlab.class new file mode 100644 index 0000000..092aa89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockStoneSlab.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTNT.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTNT.class new file mode 100644 index 0000000..0aaa77a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTNT.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTallGrass.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTallGrass.class new file mode 100644 index 0000000..fd7dd39 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTallGrass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTorch.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTorch.class new file mode 100644 index 0000000..8422e3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTorch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTrapDoor.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTrapDoor.class new file mode 100644 index 0000000..abd6c24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTrapDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTripWire.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTripWire.class new file mode 100644 index 0000000..9ca2b5f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTripWire.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockTripWireHook.class b/build/classes/java/patchedMc/net/minecraft/block/BlockTripWireHook.class new file mode 100644 index 0000000..bdab6e6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockTripWireHook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockVine.class b/build/classes/java/patchedMc/net/minecraft/block/BlockVine.class new file mode 100644 index 0000000..b9dba41 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockVine.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockWall.class b/build/classes/java/patchedMc/net/minecraft/block/BlockWall.class new file mode 100644 index 0000000..6d9dff0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockWall.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockWeb.class b/build/classes/java/patchedMc/net/minecraft/block/BlockWeb.class new file mode 100644 index 0000000..2486de6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockWeb.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockWood.class b/build/classes/java/patchedMc/net/minecraft/block/BlockWood.class new file mode 100644 index 0000000..e441502 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockWood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockWoodSlab.class b/build/classes/java/patchedMc/net/minecraft/block/BlockWoodSlab.class new file mode 100644 index 0000000..c2970a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockWoodSlab.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/BlockWorkbench.class b/build/classes/java/patchedMc/net/minecraft/block/BlockWorkbench.class new file mode 100644 index 0000000..35d71cd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/BlockWorkbench.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/IGrowable.class b/build/classes/java/patchedMc/net/minecraft/block/IGrowable.class new file mode 100644 index 0000000..1a9896d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/IGrowable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/ITileEntityProvider.class b/build/classes/java/patchedMc/net/minecraft/block/ITileEntityProvider.class new file mode 100644 index 0000000..fc22c32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/ITileEntityProvider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/MapColor.class b/build/classes/java/patchedMc/net/minecraft/block/material/MapColor.class new file mode 100644 index 0000000..941dd90 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/MapColor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/Material$1.class b/build/classes/java/patchedMc/net/minecraft/block/material/Material$1.class new file mode 100644 index 0000000..3049340 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/Material$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/Material.class b/build/classes/java/patchedMc/net/minecraft/block/material/Material.class new file mode 100644 index 0000000..b529add Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/Material.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLiquid.class b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLiquid.class new file mode 100644 index 0000000..ec7f4c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLiquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLogic.class b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLogic.class new file mode 100644 index 0000000..b0bde84 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialLogic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/MaterialPortal.class b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialPortal.class new file mode 100644 index 0000000..dbcb709 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialPortal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/block/material/MaterialTransparent.class b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialTransparent.class new file mode 100644 index 0000000..d41151c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/block/material/MaterialTransparent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/AnvilConverterException.class b/build/classes/java/patchedMc/net/minecraft/client/AnvilConverterException.class new file mode 100644 index 0000000..e1fa8b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/AnvilConverterException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/ClientBrandRetriever.class b/build/classes/java/patchedMc/net/minecraft/client/ClientBrandRetriever.class new file mode 100644 index 0000000..0784d1d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/ClientBrandRetriever.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/LoadingScreenRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/LoadingScreenRenderer.class new file mode 100644 index 0000000..026b28f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/LoadingScreenRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$1.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$1.class new file mode 100644 index 0000000..1da20df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$10.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$10.class new file mode 100644 index 0000000..5d6b092 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$10.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$11.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$11.class new file mode 100644 index 0000000..81744be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$11.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$12.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$12.class new file mode 100644 index 0000000..b013a6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$12.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$13.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$13.class new file mode 100644 index 0000000..741fd25 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$13.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$14.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$14.class new file mode 100644 index 0000000..ddf7eb6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$14.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$15.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$15.class new file mode 100644 index 0000000..03192d4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$15.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$16.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$16.class new file mode 100644 index 0000000..769e4fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$16.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$2.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$2.class new file mode 100644 index 0000000..fb6a1a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$3.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$3.class new file mode 100644 index 0000000..7c13f59 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$4.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$4.class new file mode 100644 index 0000000..09a4de0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$5.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$5.class new file mode 100644 index 0000000..97f525c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$6.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$6.class new file mode 100644 index 0000000..8069982 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$7.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$7.class new file mode 100644 index 0000000..1a5256d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$8.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$8.class new file mode 100644 index 0000000..c00208d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$8.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$9.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$9.class new file mode 100644 index 0000000..b9af567 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$9.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft$SwitchMovingObjectType.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$SwitchMovingObjectType.class new file mode 100644 index 0000000..0383a83 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft$SwitchMovingObjectType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/Minecraft.class b/build/classes/java/patchedMc/net/minecraft/client/Minecraft.class new file mode 100644 index 0000000..14dae85 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/Minecraft.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/ISound$AttenuationType.class b/build/classes/java/patchedMc/net/minecraft/client/audio/ISound$AttenuationType.class new file mode 100644 index 0000000..7ec7dbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/ISound$AttenuationType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/ISound.class b/build/classes/java/patchedMc/net/minecraft/client/audio/ISound.class new file mode 100644 index 0000000..74a5fb1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/ISound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/ISoundEventAccessor.class b/build/classes/java/patchedMc/net/minecraft/client/audio/ISoundEventAccessor.class new file mode 100644 index 0000000..734a7c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/ISoundEventAccessor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/ITickableSound.class b/build/classes/java/patchedMc/net/minecraft/client/audio/ITickableSound.class new file mode 100644 index 0000000..b2bd8fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/ITickableSound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSound.class b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSound.class new file mode 100644 index 0000000..2341c23 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecart.class b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecart.class new file mode 100644 index 0000000..efc9819 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecartRiding.class b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecartRiding.class new file mode 100644 index 0000000..b7adff6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/MovingSoundMinecartRiding.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker$MusicType.class b/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker$MusicType.class new file mode 100644 index 0000000..a673495 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker$MusicType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker.class b/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker.class new file mode 100644 index 0000000..1e1e5f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/MusicTicker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSound.class b/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSound.class new file mode 100644 index 0000000..0c29b24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSoundRecord.class b/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSoundRecord.class new file mode 100644 index 0000000..babcf46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/PositionedSoundRecord.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundCategory.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundCategory.class new file mode 100644 index 0000000..686f777 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundCategory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessor.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessor.class new file mode 100644 index 0000000..83b4d5a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessorComposite.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessorComposite.class new file mode 100644 index 0000000..a714267 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundEventAccessorComposite.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$1.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$1.class new file mode 100644 index 0000000..aec0d01 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$2.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$2.class new file mode 100644 index 0000000..dff489c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$SwitchType.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$SwitchType.class new file mode 100644 index 0000000..8a28514 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler$SwitchType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler.class new file mode 100644 index 0000000..7b3ab86 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry$Type.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry$Type.class new file mode 100644 index 0000000..e620699 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry$Type.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry.class new file mode 100644 index 0000000..8a07e61 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList$SoundEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList.class new file mode 100644 index 0000000..eee2cde Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundListSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundListSerializer.class new file mode 100644 index 0000000..1bcdc64 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundListSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$1.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$1.class new file mode 100644 index 0000000..43c5ce8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2$1.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2$1.class new file mode 100644 index 0000000..9a80e24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2.class new file mode 100644 index 0000000..6c96bcc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$SoundSystemStarterThread.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$SoundSystemStarterThread.class new file mode 100644 index 0000000..caa7ab3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager$SoundSystemStarterThread.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager.class new file mode 100644 index 0000000..bd64293 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundPoolEntry.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundPoolEntry.class new file mode 100644 index 0000000..72f8e6d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundPoolEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/audio/SoundRegistry.class b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundRegistry.class new file mode 100644 index 0000000..2780ae8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/audio/SoundRegistry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer$SwitchType.class b/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer$SwitchType.class new file mode 100644 index 0000000..bb2f17a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer$SwitchType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer.class b/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer.class new file mode 100644 index 0000000..b9a5462 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/entity/AbstractClientPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/entity/EntityClientPlayerMP.class b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityClientPlayerMP.class new file mode 100644 index 0000000..5cf2945 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityClientPlayerMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/entity/EntityOtherPlayerMP.class b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityOtherPlayerMP.class new file mode 100644 index 0000000..dd9416e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityOtherPlayerMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/entity/EntityPlayerSP.class b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityPlayerSP.class new file mode 100644 index 0000000..14a22aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/entity/EntityPlayerSP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ChatLine.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ChatLine.class new file mode 100644 index 0000000..d0ab645 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ChatLine.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/FontRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/gui/FontRenderer.class new file mode 100644 index 0000000..d3e7321 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/FontRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/Gui.class b/build/classes/java/patchedMc/net/minecraft/client/gui/Gui.class new file mode 100644 index 0000000..5d3913e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/Gui.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButton.class new file mode 100644 index 0000000..ab10f04 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonLanguage.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonLanguage.class new file mode 100644 index 0000000..98ed5e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonLanguage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonRealmsProxy.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonRealmsProxy.class new file mode 100644 index 0000000..3a002bc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiButtonRealmsProxy.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiChat.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiChat.class new file mode 100644 index 0000000..9f8ef60 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiChat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCommandBlock.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCommandBlock.class new file mode 100644 index 0000000..90cd039 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCommandBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiConfirmOpenLink.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiConfirmOpenLink.class new file mode 100644 index 0000000..78507a6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiConfirmOpenLink.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiControls.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiControls.class new file mode 100644 index 0000000..b8f8e3e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiControls.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld$Details.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld$Details.class new file mode 100644 index 0000000..f13b8ab Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld$Details.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld.class new file mode 100644 index 0000000..6d59299 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateFlatWorld.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateWorld.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateWorld.class new file mode 100644 index 0000000..6d0c052 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiCreateWorld.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDisconnected.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDisconnected.class new file mode 100644 index 0000000..cf62df4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDisconnected.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDownloadTerrain.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDownloadTerrain.class new file mode 100644 index 0000000..704f430 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiDownloadTerrain.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiEnchantment.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiEnchantment.class new file mode 100644 index 0000000..3194d21 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiEnchantment.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiErrorScreen.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiErrorScreen.class new file mode 100644 index 0000000..6f13343 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiErrorScreen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$LayerItem.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$LayerItem.class new file mode 100644 index 0000000..2e1a9c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$LayerItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$ListSlot.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$ListSlot.class new file mode 100644 index 0000000..3d1d260 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets$ListSlot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets.class new file mode 100644 index 0000000..c9c64df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiFlatPresets.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiGameOver.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiGameOver.class new file mode 100644 index 0000000..459abdc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiGameOver.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiHopper.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiHopper.class new file mode 100644 index 0000000..f4f7426 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngame.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngame.class new file mode 100644 index 0000000..119cedc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngameMenu.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngameMenu.class new file mode 100644 index 0000000..066839c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiIngameMenu.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry.class new file mode 100644 index 0000000..e40e6ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$KeyEntry.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$KeyEntry.class new file mode 100644 index 0000000..a23fb06 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList$KeyEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList.class new file mode 100644 index 0000000..2041310 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiKeyBindingList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLabel.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLabel.class new file mode 100644 index 0000000..e324d59 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLabel.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage$List.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage$List.class new file mode 100644 index 0000000..c1296d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage$List.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage.class new file mode 100644 index 0000000..78792e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiLanguage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended$IGuiListEntry.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended$IGuiListEntry.class new file mode 100644 index 0000000..bf03976 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended$IGuiListEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended.class new file mode 100644 index 0000000..2d24738 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiListExtended.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMainMenu.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMainMenu.class new file mode 100644 index 0000000..a444013 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMainMenu.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMemoryErrorScreen.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMemoryErrorScreen.class new file mode 100644 index 0000000..ca1273f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMemoryErrorScreen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant$MerchantButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant$MerchantButton.class new file mode 100644 index 0000000..ceabac3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant$MerchantButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant.class new file mode 100644 index 0000000..e7ff08d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMerchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMultiplayer.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMultiplayer.class new file mode 100644 index 0000000..6dc0ca9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiMultiplayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiNewChat.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiNewChat.class new file mode 100644 index 0000000..ab823c7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiNewChat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionButton.class new file mode 100644 index 0000000..e80328c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionSlider.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionSlider.class new file mode 100644 index 0000000..aaa3a12 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionSlider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions$1.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions$1.class new file mode 100644 index 0000000..8f84227 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions.class new file mode 100644 index 0000000..f95b6e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptions.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList$Row.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList$Row.class new file mode 100644 index 0000000..858d981 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList$Row.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList.class new file mode 100644 index 0000000..62d9769 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiOptionsRowList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiPlayerInfo.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiPlayerInfo.class new file mode 100644 index 0000000..03459fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiPlayerInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRenameWorld.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRenameWorld.class new file mode 100644 index 0000000..b2486e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRenameWorld.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRepair.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRepair.class new file mode 100644 index 0000000..c9627dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiRepair.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackAvailable.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackAvailable.class new file mode 100644 index 0000000..fd48c20 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackAvailable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackList.class new file mode 100644 index 0000000..fdbdc4d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackSelected.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackSelected.class new file mode 100644 index 0000000..c614222 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiResourcePackSelected.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreen.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreen.class new file mode 100644 index 0000000..015650e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenAddServer.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenAddServer.class new file mode 100644 index 0000000..e2d207a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenAddServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook$NextPageButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook$NextPageButton.class new file mode 100644 index 0000000..685c18d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook$NextPageButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook.class new file mode 100644 index 0000000..e6f902b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenDemo.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenDemo.class new file mode 100644 index 0000000..84fbed8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenDemo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds$Button.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds$Button.class new file mode 100644 index 0000000..7fdc455 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds$Button.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds.class new file mode 100644 index 0000000..399036e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenOptionsSounds.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenRealmsProxy.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenRealmsProxy.class new file mode 100644 index 0000000..ea7c064 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenRealmsProxy.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenResourcePacks.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenResourcePacks.class new file mode 100644 index 0000000..4410ec7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenResourcePacks.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenServerList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenServerList.class new file mode 100644 index 0000000..be38921 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenServerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenWorking.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenWorking.class new file mode 100644 index 0000000..2d5ddb1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiScreenWorking.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld$List.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld$List.class new file mode 100644 index 0000000..7f7bc7c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld$List.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld.class new file mode 100644 index 0000000..4062959 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSelectWorld.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiShareToLan.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiShareToLan.class new file mode 100644 index 0000000..8470915 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiShareToLan.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSleepMP.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSleepMP.class new file mode 100644 index 0000000..77e4eaf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSleepMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlot.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlot.class new file mode 100644 index 0000000..092ea29 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlotRealmsProxy.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlotRealmsProxy.class new file mode 100644 index 0000000..575d81d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSlotRealmsProxy.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper$List.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper$List.class new file mode 100644 index 0000000..a934f03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper$List.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper.class new file mode 100644 index 0000000..e3a5f71 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiSnooper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiStreamIndicator.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiStreamIndicator.class new file mode 100644 index 0000000..94452cd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiStreamIndicator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiTextField.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiTextField.class new file mode 100644 index 0000000..724dc58 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiTextField.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiVideoSettings.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiVideoSettings.class new file mode 100644 index 0000000..e9db796 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiVideoSettings.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiWinGame.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiWinGame.class new file mode 100644 index 0000000..8dbc58f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiWinGame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNo.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNo.class new file mode 100644 index 0000000..bb4e9d8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNoCallback.class b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNoCallback.class new file mode 100644 index 0000000..bd86141 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/GuiYesNoCallback.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/IProgressMeter.class b/build/classes/java/patchedMc/net/minecraft/client/gui/IProgressMeter.class new file mode 100644 index 0000000..7e959a9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/IProgressMeter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer$Instance.class b/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer$Instance.class new file mode 100644 index 0000000..c26a439 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer$Instance.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer.class new file mode 100644 index 0000000..6699aa9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/MapItemRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ScaledResolution.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ScaledResolution.class new file mode 100644 index 0000000..ea0d977 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ScaledResolution.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ScreenChatOptions.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ScreenChatOptions.class new file mode 100644 index 0000000..b1328aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ScreenChatOptions.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanDetected.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanDetected.class new file mode 100644 index 0000000..080c68f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanDetected.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanScan.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanScan.class new file mode 100644 index 0000000..d7a237e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryLanScan.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal$1.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal$1.class new file mode 100644 index 0000000..3251321 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal.class new file mode 100644 index 0000000..6cf53fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerListEntryNormal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/ServerSelectionList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerSelectionList.class new file mode 100644 index 0000000..8f3a418 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/ServerSelectionList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievement.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievement.class new file mode 100644 index 0000000..7d55905 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievement.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievements.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievements.class new file mode 100644 index 0000000..edb92a4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiAchievements.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$Stats.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$Stats.class new file mode 100644 index 0000000..79eb851 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$Stats.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1.class new file mode 100644 index 0000000..fb221f7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock.class new file mode 100644 index 0000000..f1fabca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsGeneral.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsGeneral.class new file mode 100644 index 0000000..dd4798c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsGeneral.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem$1.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem$1.class new file mode 100644 index 0000000..cf62957 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem.class new file mode 100644 index 0000000..d67e42d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsMobsList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsMobsList.class new file mode 100644 index 0000000..067d37f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats$StatsMobsList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats.class b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats.class new file mode 100644 index 0000000..32879d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/achievement/GuiStats.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/CreativeCrafting.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/CreativeCrafting.class new file mode 100644 index 0000000..9d5e2dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/CreativeCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$Button.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$Button.class new file mode 100644 index 0000000..a243331 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$Button.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$CancelButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$CancelButton.class new file mode 100644 index 0000000..88a6991 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$CancelButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton.class new file mode 100644 index 0000000..d6413b2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$PowerButton.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$PowerButton.class new file mode 100644 index 0000000..62d3e44 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon$PowerButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon.class new file mode 100644 index 0000000..9e1f5be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBeacon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBrewingStand.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBrewingStand.class new file mode 100644 index 0000000..1534240 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiBrewingStand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiChest.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiChest.class new file mode 100644 index 0000000..e9ee440 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainer.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainer.class new file mode 100644 index 0000000..869b8db Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative.class new file mode 100644 index 0000000..5da7ff8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot.class new file mode 100644 index 0000000..590555f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative.class new file mode 100644 index 0000000..3cbc07c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiContainerCreative.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiCrafting.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiCrafting.class new file mode 100644 index 0000000..25f846b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiDispenser.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiDispenser.class new file mode 100644 index 0000000..ff6cb8c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiDispenser.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiEditSign.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiEditSign.class new file mode 100644 index 0000000..8c40cdf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiEditSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiFurnace.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiFurnace.class new file mode 100644 index 0000000..3944d8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiInventory.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiInventory.class new file mode 100644 index 0000000..47b1733 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.class b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.class new file mode 100644 index 0000000..b03ccc8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers$ServerList.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers$ServerList.class new file mode 100644 index 0000000..444e45f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers$ServerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers.class new file mode 100644 index 0000000..8df2d69 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiIngestServers.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamOptions.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamOptions.class new file mode 100644 index 0000000..29b9bdd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamOptions.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason.class new file mode 100644 index 0000000..e72e022 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason.class new file mode 100644 index 0000000..cfb488d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable.class new file mode 100644 index 0000000..116930d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiStreamUnavailable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiTwitchUserMode.class b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiTwitchUserMode.class new file mode 100644 index 0000000..41cb256 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/gui/stream/GuiTwitchUserMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/main/Main$1$1.class b/build/classes/java/patchedMc/net/minecraft/client/main/Main$1$1.class new file mode 100644 index 0000000..563d8ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/main/Main$1$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/main/Main$1.class b/build/classes/java/patchedMc/net/minecraft/client/main/Main$1.class new file mode 100644 index 0000000..b1977b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/main/Main$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/main/Main$2.class b/build/classes/java/patchedMc/net/minecraft/client/main/Main$2.class new file mode 100644 index 0000000..a98b1f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/main/Main$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/main/Main$3.class b/build/classes/java/patchedMc/net/minecraft/client/main/Main$3.class new file mode 100644 index 0000000..c1ec5be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/main/Main$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/main/Main.class b/build/classes/java/patchedMc/net/minecraft/client/main/Main.class new file mode 100644 index 0000000..db924fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/main/Main.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBase.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBase.class new file mode 100644 index 0000000..8d63471 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBat.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBat.class new file mode 100644 index 0000000..ca66878 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBiped.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBiped.class new file mode 100644 index 0000000..4685603 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBiped.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBlaze.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBlaze.class new file mode 100644 index 0000000..ecd5cc3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBlaze.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBoat.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBoat.class new file mode 100644 index 0000000..a544a66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBoat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBook.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBook.class new file mode 100644 index 0000000..6f364ec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelBox.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBox.class new file mode 100644 index 0000000..fbe28c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelBox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelChest.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelChest.class new file mode 100644 index 0000000..dd9ef1c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelChicken.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelChicken.class new file mode 100644 index 0000000..73a7c6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelChicken.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelCow.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelCow.class new file mode 100644 index 0000000..524ec47 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelCow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelCreeper.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelCreeper.class new file mode 100644 index 0000000..cb68398 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelCreeper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelDragon.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelDragon.class new file mode 100644 index 0000000..fea3437 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelDragon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderCrystal.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderCrystal.class new file mode 100644 index 0000000..1e5e9ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderCrystal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderman.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderman.class new file mode 100644 index 0000000..0ca4589 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelEnderman.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelGhast.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelGhast.class new file mode 100644 index 0000000..1cdfa46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelGhast.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelHorse.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelHorse.class new file mode 100644 index 0000000..a821cb4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelHorse.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelIronGolem.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelIronGolem.class new file mode 100644 index 0000000..27ca822 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelIronGolem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelLargeChest.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelLargeChest.class new file mode 100644 index 0000000..1ba5bfc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelLargeChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelLeashKnot.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelLeashKnot.class new file mode 100644 index 0000000..e2ea8e3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelLeashKnot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelMagmaCube.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelMagmaCube.class new file mode 100644 index 0000000..67e5ae6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelMagmaCube.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelMinecart.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelMinecart.class new file mode 100644 index 0000000..bd9e278 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelOcelot.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelOcelot.class new file mode 100644 index 0000000..00e242b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelOcelot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelPig.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelPig.class new file mode 100644 index 0000000..d8dbc62 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelPig.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelQuadruped.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelQuadruped.class new file mode 100644 index 0000000..3bfa3c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelQuadruped.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelRenderer.class new file mode 100644 index 0000000..6854dce Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep1.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep1.class new file mode 100644 index 0000000..106f1a8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep2.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep2.class new file mode 100644 index 0000000..02c3389 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSheep2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSign.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSign.class new file mode 100644 index 0000000..5d50e7d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSilverfish.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSilverfish.class new file mode 100644 index 0000000..7d3738c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSilverfish.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeleton.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeleton.class new file mode 100644 index 0000000..7f757d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeleton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeletonHead.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeletonHead.class new file mode 100644 index 0000000..33f473f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSkeletonHead.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSlime.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSlime.class new file mode 100644 index 0000000..bd32f45 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSlime.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSnowMan.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSnowMan.class new file mode 100644 index 0000000..1afaace Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSnowMan.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSpider.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSpider.class new file mode 100644 index 0000000..3d9f00f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSpider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelSquid.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSquid.class new file mode 100644 index 0000000..49e938c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelSquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelVillager.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelVillager.class new file mode 100644 index 0000000..03dea7e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelVillager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelWitch.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWitch.class new file mode 100644 index 0000000..870ac15 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWitch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelWither.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWither.class new file mode 100644 index 0000000..c801e16 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWither.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelWolf.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWolf.class new file mode 100644 index 0000000..1a138bd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelWolf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombie.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombie.class new file mode 100644 index 0000000..a82f0fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombieVillager.class b/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombieVillager.class new file mode 100644 index 0000000..f3eadb2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/ModelZombieVillager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/PositionTextureVertex.class b/build/classes/java/patchedMc/net/minecraft/client/model/PositionTextureVertex.class new file mode 100644 index 0000000..fac8407 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/PositionTextureVertex.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/TextureOffset.class b/build/classes/java/patchedMc/net/minecraft/client/model/TextureOffset.class new file mode 100644 index 0000000..596315a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/TextureOffset.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/model/TexturedQuad.class b/build/classes/java/patchedMc/net/minecraft/client/model/TexturedQuad.class new file mode 100644 index 0000000..4a5b0b7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/model/TexturedQuad.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ChunkProviderClient.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ChunkProviderClient.class new file mode 100644 index 0000000..2a7676b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ChunkProviderClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting$1.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting$1.class new file mode 100644 index 0000000..778db75 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting.class new file mode 100644 index 0000000..2eabd12 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/GuiConnecting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/PlayerControllerMP.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/PlayerControllerMP.class new file mode 100644 index 0000000..09a014a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/PlayerControllerMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerAddress.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerAddress.class new file mode 100644 index 0000000..34b4969 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerAddress.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData$ServerResourceMode.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData$ServerResourceMode.class new file mode 100644 index 0000000..b19afbf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData$ServerResourceMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData.class new file mode 100644 index 0000000..56a0bae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerList.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerList.class new file mode 100644 index 0000000..aa1a213 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ServerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ThreadLanServerPing.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ThreadLanServerPing.class new file mode 100644 index 0000000..76fda8a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/ThreadLanServerPing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$1.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$1.class new file mode 100644 index 0000000..d4986f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$2.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$2.class new file mode 100644 index 0000000..87017bf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$3.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$3.class new file mode 100644 index 0000000..a667a43 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$4.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$4.class new file mode 100644 index 0000000..c5a99d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient.class b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient.class new file mode 100644 index 0000000..79cbd3b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/multiplayer/WorldClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServer.class b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServer.class new file mode 100644 index 0000000..de1e737 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServerList.class b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServerList.class new file mode 100644 index 0000000..2a69739 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$LanServerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$ThreadLanServerFind.class b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$ThreadLanServerFind.class new file mode 100644 index 0000000..0c36522 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector$ThreadLanServerFind.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector.class b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector.class new file mode 100644 index 0000000..395e486 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/LanServerDetector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState.class new file mode 100644 index 0000000..611a2db Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory.class new file mode 100644 index 0000000..7d7cfb4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerHandshakeMemory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient$1.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient$1.class new file mode 100644 index 0000000..0616446 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient.class new file mode 100644 index 0000000..f9ec934 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerLoginClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient$1.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient$1.class new file mode 100644 index 0000000..5b3c40a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient.class b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient.class new file mode 100644 index 0000000..7437a71 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/NetHandlerPlayClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$1.class b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$1.class new file mode 100644 index 0000000..91063dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2$1.class b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2$1.class new file mode 100644 index 0000000..8011013 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2.class b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2.class new file mode 100644 index 0000000..9c46c18 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger.class b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger.class new file mode 100644 index 0000000..2025af5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/network/OldServerPinger.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$1.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$1.class new file mode 100644 index 0000000..8ab17d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$2.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$2.class new file mode 100644 index 0000000..d157f03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$3.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$3.class new file mode 100644 index 0000000..93ada85 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$4.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$4.class new file mode 100644 index 0000000..51e0928 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer.class new file mode 100644 index 0000000..30b8545 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EffectRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityAuraFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityAuraFX.class new file mode 100644 index 0000000..aa2fb0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityAuraFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBlockDustFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBlockDustFX.class new file mode 100644 index 0000000..85c512a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBlockDustFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBreakingFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBreakingFX.class new file mode 100644 index 0000000..470fa8c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBreakingFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBubbleFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBubbleFX.class new file mode 100644 index 0000000..fd369f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityBubbleFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCloudFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCloudFX.class new file mode 100644 index 0000000..17a1b6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCloudFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCrit2FX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCrit2FX.class new file mode 100644 index 0000000..5461b03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCrit2FX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCritFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCritFX.class new file mode 100644 index 0000000..ffafa07 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityCritFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDiggingFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDiggingFX.class new file mode 100644 index 0000000..c459814 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDiggingFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDropParticleFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDropParticleFX.class new file mode 100644 index 0000000..178bf64 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityDropParticleFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.class new file mode 100644 index 0000000..898e805 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityExplodeFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityExplodeFX.class new file mode 100644 index 0000000..592e47e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityExplodeFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFX.class new file mode 100644 index 0000000..0f0a1f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkOverlayFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkOverlayFX.class new file mode 100644 index 0000000..393ede7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkOverlayFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkSparkFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkSparkFX.class new file mode 100644 index 0000000..a5ac73a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkSparkFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkStarterFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkStarterFX.class new file mode 100644 index 0000000..5d195de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFireworkStarterFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFishWakeFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFishWakeFX.class new file mode 100644 index 0000000..6632b7d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFishWakeFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFlameFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFlameFX.class new file mode 100644 index 0000000..4a8ba0b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFlameFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFootStepFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFootStepFX.class new file mode 100644 index 0000000..a765493 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityFootStepFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHeartFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHeartFX.class new file mode 100644 index 0000000..6c6c9bf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHeartFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHugeExplodeFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHugeExplodeFX.class new file mode 100644 index 0000000..f7e4437 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityHugeExplodeFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLargeExplodeFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLargeExplodeFX.class new file mode 100644 index 0000000..c6b0a45 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLargeExplodeFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLavaFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLavaFX.class new file mode 100644 index 0000000..7f44386 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityLavaFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityNoteFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityNoteFX.class new file mode 100644 index 0000000..83341db Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityNoteFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPickupFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPickupFX.class new file mode 100644 index 0000000..4a1de76 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPickupFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPortalFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPortalFX.class new file mode 100644 index 0000000..b6f9156 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityPortalFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityRainFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityRainFX.class new file mode 100644 index 0000000..9468de7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityRainFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntityReddustFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityReddustFX.class new file mode 100644 index 0000000..d6abfe7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntityReddustFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySmokeFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySmokeFX.class new file mode 100644 index 0000000..4c633d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySmokeFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySnowShovelFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySnowShovelFX.class new file mode 100644 index 0000000..418d509 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySnowShovelFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySpellParticleFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySpellParticleFX.class new file mode 100644 index 0000000..b4f9ada Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySpellParticleFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySplashFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySplashFX.class new file mode 100644 index 0000000..0c7676b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySplashFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySuspendFX.class b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySuspendFX.class new file mode 100644 index 0000000..54a5350 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/particle/EntitySuspendFX.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/ActiveRenderInfo.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/ActiveRenderInfo.class new file mode 100644 index 0000000..4a284bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/ActiveRenderInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/DestroyBlockProgress.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/DestroyBlockProgress.class new file mode 100644 index 0000000..5206f10 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/DestroyBlockProgress.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$1.class new file mode 100644 index 0000000..1b8a9cb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$2.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$2.class new file mode 100644 index 0000000..3173478 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$3.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$3.class new file mode 100644 index 0000000..68bf5a9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer.class new file mode 100644 index 0000000..90e57be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntityRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/EntitySorter.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntitySorter.class new file mode 100644 index 0000000..d5af935 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/EntitySorter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/GLAllocation.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/GLAllocation.class new file mode 100644 index 0000000..11ae658 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/GLAllocation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/IImageBuffer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/IImageBuffer.class new file mode 100644 index 0000000..a09349d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/IImageBuffer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/IconFlipped.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/IconFlipped.class new file mode 100644 index 0000000..f6d4db7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/IconFlipped.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/ImageBufferDownload.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/ImageBufferDownload.class new file mode 100644 index 0000000..301959b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/ImageBufferDownload.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/InventoryEffectRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/InventoryEffectRenderer.class new file mode 100644 index 0000000..574a9ca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/InventoryEffectRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/ItemRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/ItemRenderer.class new file mode 100644 index 0000000..a21a936 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/ItemRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlCapsChecker.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlCapsChecker.class new file mode 100644 index 0000000..890d94a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlCapsChecker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlHelper.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlHelper.class new file mode 100644 index 0000000..54ee547 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/OpenGlHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderBlocks.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderBlocks.class new file mode 100644 index 0000000..39e8afa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderBlocks.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal$1.class new file mode 100644 index 0000000..5f511d2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal.class new file mode 100644 index 0000000..0cad0e7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderGlobal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderHelper.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderHelper.class new file mode 100644 index 0000000..7988dc7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderList.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderList.class new file mode 100644 index 0000000..697df58 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderSorter.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderSorter.class new file mode 100644 index 0000000..52426ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/RenderSorter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/StitcherException.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/StitcherException.class new file mode 100644 index 0000000..c5645c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/StitcherException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/Tessellator.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/Tessellator.class new file mode 100644 index 0000000..be57419 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/Tessellator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData$1.class new file mode 100644 index 0000000..84113e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData.class new file mode 100644 index 0000000..7728bc9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/ThreadDownloadImageData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/WorldRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/WorldRenderer.class new file mode 100644 index 0000000..ae21e96 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/WorldRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelper.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelper.class new file mode 100644 index 0000000..775c284 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelperImpl.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelperImpl.class new file mode 100644 index 0000000..defa080 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ClippingHelperImpl.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/Frustrum.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/Frustrum.class new file mode 100644 index 0000000..a139b70 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/Frustrum.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ICamera.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ICamera.class new file mode 100644 index 0000000..5380ca4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/culling/ICamera.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/Render.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/Render.class new file mode 100644 index 0000000..18f5388 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/Render.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderArrow.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderArrow.class new file mode 100644 index 0000000..c058e72 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderArrow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBat.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBat.class new file mode 100644 index 0000000..8f4a222 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBiped.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBiped.class new file mode 100644 index 0000000..2369ea8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBiped.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBlaze.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBlaze.class new file mode 100644 index 0000000..ee32b7b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBlaze.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBoat.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBoat.class new file mode 100644 index 0000000..7ca1fe9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderBoat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCaveSpider.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCaveSpider.class new file mode 100644 index 0000000..4d9e5e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCaveSpider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderChicken.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderChicken.class new file mode 100644 index 0000000..434af15 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderChicken.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCow.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCow.class new file mode 100644 index 0000000..0c08055 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCreeper.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCreeper.class new file mode 100644 index 0000000..b104309 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderCreeper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderDragon.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderDragon.class new file mode 100644 index 0000000..38b074e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderDragon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnchantmentTable.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnchantmentTable.class new file mode 100644 index 0000000..ada33d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnchantmentTable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnderman.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnderman.class new file mode 100644 index 0000000..b1cc816 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEnderman.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEntity.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEntity.class new file mode 100644 index 0000000..812e38f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFallingBlock.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFallingBlock.class new file mode 100644 index 0000000..58537a1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFallingBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFireball.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFireball.class new file mode 100644 index 0000000..f11bbd6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFireball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFish.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFish.class new file mode 100644 index 0000000..e7c109a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderFish.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGhast.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGhast.class new file mode 100644 index 0000000..d03ea04 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGhast.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGiantZombie.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGiantZombie.class new file mode 100644 index 0000000..f3e4b6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderGiantZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderHorse.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderHorse.class new file mode 100644 index 0000000..2a929de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderHorse.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderIronGolem.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderIronGolem.class new file mode 100644 index 0000000..efbc820 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderIronGolem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$1.class new file mode 100644 index 0000000..01f728d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$2.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$2.class new file mode 100644 index 0000000..bfa8f70 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$3.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$3.class new file mode 100644 index 0000000..6c1e6ac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$4.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$4.class new file mode 100644 index 0000000..cd37193 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem.class new file mode 100644 index 0000000..78adafe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLeashKnot.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLeashKnot.class new file mode 100644 index 0000000..032db9e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLeashKnot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLightningBolt.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLightningBolt.class new file mode 100644 index 0000000..d61a1be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLightningBolt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLiving.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLiving.class new file mode 100644 index 0000000..c0cdf41 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderLiving.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMagmaCube.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMagmaCube.class new file mode 100644 index 0000000..7d22166 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMagmaCube.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderManager.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderManager.class new file mode 100644 index 0000000..897b40c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecart.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecart.class new file mode 100644 index 0000000..2f3d493 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.class new file mode 100644 index 0000000..130e5fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMinecartMobSpawner.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMooshroom.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMooshroom.class new file mode 100644 index 0000000..143433c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderMooshroom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderOcelot.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderOcelot.class new file mode 100644 index 0000000..a66f29d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderOcelot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPainting.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPainting.class new file mode 100644 index 0000000..cd419c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPainting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPig.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPig.class new file mode 100644 index 0000000..d1c1b91 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPig.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPlayer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPlayer.class new file mode 100644 index 0000000..652ef0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSheep.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSheep.class new file mode 100644 index 0000000..aa9c1b7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSheep.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSilverfish.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSilverfish.class new file mode 100644 index 0000000..88f4b7f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSilverfish.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSkeleton.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSkeleton.class new file mode 100644 index 0000000..139711c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSkeleton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSlime.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSlime.class new file mode 100644 index 0000000..e5c853e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSlime.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowMan.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowMan.class new file mode 100644 index 0000000..f67ee6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowMan.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowball.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowball.class new file mode 100644 index 0000000..b744575 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSnowball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSpider.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSpider.class new file mode 100644 index 0000000..abf6e8f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSpider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSquid.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSquid.class new file mode 100644 index 0000000..80ea1d1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderSquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTNTPrimed.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTNTPrimed.class new file mode 100644 index 0000000..252505a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTNTPrimed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTntMinecart.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTntMinecart.class new file mode 100644 index 0000000..f51e53d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderTntMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderVillager.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderVillager.class new file mode 100644 index 0000000..b8bb356 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderVillager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWitch.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWitch.class new file mode 100644 index 0000000..2277adf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWitch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWither.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWither.class new file mode 100644 index 0000000..20dabf6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWither.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWolf.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWolf.class new file mode 100644 index 0000000..2181b8f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderWolf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderXPOrb.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderXPOrb.class new file mode 100644 index 0000000..1096d6d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderXPOrb.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderZombie.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderZombie.class new file mode 100644 index 0000000..fe8a231 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RenderZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RendererLivingEntity.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RendererLivingEntity.class new file mode 100644 index 0000000..92faf45 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/entity/RendererLivingEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/AbstractTexture.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/AbstractTexture.class new file mode 100644 index 0000000..7e1245e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/AbstractTexture.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/DynamicTexture.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/DynamicTexture.class new file mode 100644 index 0000000..5ed4546 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/DynamicTexture.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/IIconRegister.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/IIconRegister.class new file mode 100644 index 0000000..ba39afa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/IIconRegister.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITextureObject.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITextureObject.class new file mode 100644 index 0000000..0e58123 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITextureObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickable.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickable.class new file mode 100644 index 0000000..04ac692 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickableTextureObject.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickableTextureObject.class new file mode 100644 index 0000000..5065174 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/ITickableTextureObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/LayeredTexture.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/LayeredTexture.class new file mode 100644 index 0000000..be827a5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/LayeredTexture.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/SimpleTexture.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/SimpleTexture.class new file mode 100644 index 0000000..69da065 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/SimpleTexture.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Holder.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Holder.class new file mode 100644 index 0000000..6f4f682 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Holder.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Slot.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Slot.class new file mode 100644 index 0000000..f73fdb9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher$Slot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher.class new file mode 100644 index 0000000..3b9fe6f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/Stitcher.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite$1.class new file mode 100644 index 0000000..86d836b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite.class new file mode 100644 index 0000000..ff48162 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureAtlasSprite.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureClock.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureClock.class new file mode 100644 index 0000000..f137e86 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureClock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureCompass.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureCompass.class new file mode 100644 index 0000000..c16c690 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureCompass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager$1.class new file mode 100644 index 0000000..988fa18 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager.class new file mode 100644 index 0000000..4d7f973 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$1.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$1.class new file mode 100644 index 0000000..e0d5f15 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$2.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$2.class new file mode 100644 index 0000000..3f25654 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$3.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$3.class new file mode 100644 index 0000000..9dbccaa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap.class new file mode 100644 index 0000000..95cadf9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureUtil.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureUtil.class new file mode 100644 index 0000000..34522d4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/texture/TextureUtil.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEndPortal.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEndPortal.class new file mode 100644 index 0000000..b754e10 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEndPortal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.class new file mode 100644 index 0000000..78f724a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderItemFrame.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderItemFrame.class new file mode 100644 index 0000000..f71c675 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderItemFrame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderWitherSkull.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderWitherSkull.class new file mode 100644 index 0000000..9334d3f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/RenderWitherSkull.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.class new file mode 100644 index 0000000..9600bdb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityBeaconRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.class new file mode 100644 index 0000000..1b0d1ce Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.class new file mode 100644 index 0000000..8243ab7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.class new file mode 100644 index 0000000..8cfe2b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.class new file mode 100644 index 0000000..5eb7cd6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.class new file mode 100644 index 0000000..a96bb40 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.class new file mode 100644 index 0000000..75ea62b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.class new file mode 100644 index 0000000..3b41f69 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.class new file mode 100644 index 0000000..77536d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.class b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.class new file mode 100644 index 0000000..bd6bc82 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/AbstractResourcePack.class b/build/classes/java/patchedMc/net/minecraft/client/resources/AbstractResourcePack.class new file mode 100644 index 0000000..0c3cd30 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/AbstractResourcePack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/DefaultResourcePack.class b/build/classes/java/patchedMc/net/minecraft/client/resources/DefaultResourcePack.class new file mode 100644 index 0000000..0c93e91 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/DefaultResourcePack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/FallbackResourceManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/FallbackResourceManager.class new file mode 100644 index 0000000..edca2fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/FallbackResourceManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/FileResourcePack.class b/build/classes/java/patchedMc/net/minecraft/client/resources/FileResourcePack.class new file mode 100644 index 0000000..fe7bb1c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/FileResourcePack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/FolderResourcePack.class b/build/classes/java/patchedMc/net/minecraft/client/resources/FolderResourcePack.class new file mode 100644 index 0000000..44dbae5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/FolderResourcePack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/FoliageColorReloadListener.class b/build/classes/java/patchedMc/net/minecraft/client/resources/FoliageColorReloadListener.class new file mode 100644 index 0000000..9b7467d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/FoliageColorReloadListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/GrassColorReloadListener.class b/build/classes/java/patchedMc/net/minecraft/client/resources/GrassColorReloadListener.class new file mode 100644 index 0000000..279c0e1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/GrassColorReloadListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/I18n.class b/build/classes/java/patchedMc/net/minecraft/client/resources/I18n.class new file mode 100644 index 0000000..7519c5e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/I18n.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/IReloadableResourceManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/IReloadableResourceManager.class new file mode 100644 index 0000000..dcca199 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/IReloadableResourceManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/IResource.class b/build/classes/java/patchedMc/net/minecraft/client/resources/IResource.class new file mode 100644 index 0000000..7e917f1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/IResource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManager.class new file mode 100644 index 0000000..bf7c54e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManagerReloadListener.class b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManagerReloadListener.class new file mode 100644 index 0000000..073ec6e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourceManagerReloadListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/IResourcePack.class b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourcePack.class new file mode 100644 index 0000000..553c474 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/IResourcePack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/Language.class b/build/classes/java/patchedMc/net/minecraft/client/resources/Language.class new file mode 100644 index 0000000..3ab631f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/Language.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/LanguageManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/LanguageManager.class new file mode 100644 index 0000000..72be349 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/LanguageManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/Locale.class b/build/classes/java/patchedMc/net/minecraft/client/resources/Locale.class new file mode 100644 index 0000000..5c618f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/Locale.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourceIndex.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourceIndex.class new file mode 100644 index 0000000..f1a71fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourceIndex.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackFileNotFoundException.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackFileNotFoundException.class new file mode 100644 index 0000000..6329ec0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackFileNotFoundException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntry.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntry.class new file mode 100644 index 0000000..e34feac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryDefault.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryDefault.class new file mode 100644 index 0000000..956e14e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryDefault.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryFound.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryFound.class new file mode 100644 index 0000000..65584e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackListEntryFound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$1.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$1.class new file mode 100644 index 0000000..044a7bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$2.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$2.class new file mode 100644 index 0000000..6cddb9f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$Entry.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$Entry.class new file mode 100644 index 0000000..ed54ff0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository$Entry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository.class b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository.class new file mode 100644 index 0000000..8015045 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/ResourcePackRepository.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager$1.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager$1.class new file mode 100644 index 0000000..3b43952 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager.class new file mode 100644 index 0000000..4266b38 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleReloadableResourceManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleResource.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleResource.class new file mode 100644 index 0000000..cf1d6ec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SimpleResource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$1.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$1.class new file mode 100644 index 0000000..a6c1654 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$2.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$2.class new file mode 100644 index 0000000..6397548 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3$1.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3$1.class new file mode 100644 index 0000000..e430702 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3.class new file mode 100644 index 0000000..d38b3c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$SkinAvailableCallback.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$SkinAvailableCallback.class new file mode 100644 index 0000000..c809cf2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager$SkinAvailableCallback.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager.class b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager.class new file mode 100644 index 0000000..5bd8075 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/SkinManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationFrame.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationFrame.class new file mode 100644 index 0000000..6c968bd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationFrame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSection.class new file mode 100644 index 0000000..a93b204 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.class new file mode 100644 index 0000000..d479fa8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.class new file mode 100644 index 0000000..c344e89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSection.class new file mode 100644 index 0000000..995ae3d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSectionSerializer.class new file mode 100644 index 0000000..1aac8e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/FontMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSection.class new file mode 100644 index 0000000..1ab82f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSectionSerializer.class new file mode 100644 index 0000000..9de5414 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer$Registration.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer$Registration.class new file mode 100644 index 0000000..f8a83aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer$Registration.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer.class new file mode 100644 index 0000000..2bdd12e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/IMetadataSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSection.class new file mode 100644 index 0000000..28b61ce Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.class new file mode 100644 index 0000000..8c609be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSection.class new file mode 100644 index 0000000..e21a489 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSectionSerializer.class new file mode 100644 index 0000000..9879fd3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/PackMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSection.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSection.class new file mode 100644 index 0000000..e149cd1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.class b/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.class new file mode 100644 index 0000000..54024c6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$1.class b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$1.class new file mode 100644 index 0000000..48f21a9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options$1.class b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options$1.class new file mode 100644 index 0000000..ed108c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options.class b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options.class new file mode 100644 index 0000000..258887c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$Options.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$SwitchOptions.class b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$SwitchOptions.class new file mode 100644 index 0000000..4269077 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings$SwitchOptions.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings.class b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings.class new file mode 100644 index 0000000..5424c6d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/GameSettings.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/settings/KeyBinding.class b/build/classes/java/patchedMc/net/minecraft/client/settings/KeyBinding.class new file mode 100644 index 0000000..8f7b39f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/settings/KeyBinding.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/Framebuffer.class b/build/classes/java/patchedMc/net/minecraft/client/shader/Framebuffer.class new file mode 100644 index 0000000..61570dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/Framebuffer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/Shader.class b/build/classes/java/patchedMc/net/minecraft/client/shader/Shader.class new file mode 100644 index 0000000..d3ebad3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/Shader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderDefault.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderDefault.class new file mode 100644 index 0000000..13773cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderDefault.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderGroup.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderGroup.class new file mode 100644 index 0000000..6ef9f6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderGroup.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLinkHelper.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLinkHelper.class new file mode 100644 index 0000000..225113b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLinkHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader$ShaderType.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader$ShaderType.class new file mode 100644 index 0000000..d1da7bd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader$ShaderType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader.class new file mode 100644 index 0000000..4f45bdd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderManager.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderManager.class new file mode 100644 index 0000000..81109e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderUniform.class b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderUniform.class new file mode 100644 index 0000000..97cb1b6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/ShaderUniform.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/shader/TesselatorVertexState.class b/build/classes/java/patchedMc/net/minecraft/client/shader/TesselatorVertexState.class new file mode 100644 index 0000000..2531082 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/shader/TesselatorVertexState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastListener.class b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastListener.class new file mode 100644 index 0000000..4aea6d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastState.class b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastState.class new file mode 100644 index 0000000..ba8548a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$BroadcastState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$SwitchBroadcastState.class b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$SwitchBroadcastState.class new file mode 100644 index 0000000..cb883cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController$SwitchBroadcastState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController.class b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController.class new file mode 100644 index 0000000..b06441a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/BroadcastController.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatListener.class b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatListener.class new file mode 100644 index 0000000..a679966 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatState.class b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatState.class new file mode 100644 index 0000000..1d24fbc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$ChatState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$SwitchChatState.class b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$SwitchChatState.class new file mode 100644 index 0000000..4c6871c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController$SwitchChatState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController.class b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController.class new file mode 100644 index 0000000..eb55f2c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/ChatController.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IStream$AuthFailureReason.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IStream$AuthFailureReason.class new file mode 100644 index 0000000..e9d1e4c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IStream$AuthFailureReason.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IStream.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IStream.class new file mode 100644 index 0000000..e109447 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IStream.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestListener.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestListener.class new file mode 100644 index 0000000..d292871 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestState.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestState.class new file mode 100644 index 0000000..c4fb31d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$IngestTestState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$SwitchStatType.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$SwitchStatType.class new file mode 100644 index 0000000..9d7bac6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester$SwitchStatType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester.class b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester.class new file mode 100644 index 0000000..50b7c0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/IngestServerTester.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/Metadata.class b/build/classes/java/patchedMc/net/minecraft/client/stream/Metadata.class new file mode 100644 index 0000000..a9b189e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/Metadata.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/MetadataAchievement.class b/build/classes/java/patchedMc/net/minecraft/client/stream/MetadataAchievement.class new file mode 100644 index 0000000..0b593e6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/MetadataAchievement.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/NullStream.class b/build/classes/java/patchedMc/net/minecraft/client/stream/NullStream.class new file mode 100644 index 0000000..864ec4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/NullStream.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1$1.class b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1$1.class new file mode 100644 index 0000000..9dd2a6b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1.class b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1.class new file mode 100644 index 0000000..0345348 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream.class b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream.class new file mode 100644 index 0000000..8da70b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/stream/TwitchStream.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/util/JsonBlendingMode.class b/build/classes/java/patchedMc/net/minecraft/client/util/JsonBlendingMode.class new file mode 100644 index 0000000..5d6c712 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/util/JsonBlendingMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/util/JsonException$Entry.class b/build/classes/java/patchedMc/net/minecraft/client/util/JsonException$Entry.class new file mode 100644 index 0000000..bf9d7a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/util/JsonException$Entry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/util/JsonException.class b/build/classes/java/patchedMc/net/minecraft/client/util/JsonException.class new file mode 100644 index 0000000..ed791ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/util/JsonException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/util/QuadComparator.class b/build/classes/java/patchedMc/net/minecraft/client/util/QuadComparator.class new file mode 100644 index 0000000..6f12b1d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/util/QuadComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/client/util/RenderDistanceSorter.class b/build/classes/java/patchedMc/net/minecraft/client/util/RenderDistanceSorter.class new file mode 100644 index 0000000..c2ff03c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/client/util/RenderDistanceSorter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandBase.class b/build/classes/java/patchedMc/net/minecraft/command/CommandBase.class new file mode 100644 index 0000000..f3bf76f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandClearInventory.class b/build/classes/java/patchedMc/net/minecraft/command/CommandClearInventory.class new file mode 100644 index 0000000..3901406 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandClearInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandDebug.class b/build/classes/java/patchedMc/net/minecraft/command/CommandDebug.class new file mode 100644 index 0000000..634f866 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandDebug.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandDefaultGameMode.class b/build/classes/java/patchedMc/net/minecraft/command/CommandDefaultGameMode.class new file mode 100644 index 0000000..49998e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandDefaultGameMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandDifficulty.class b/build/classes/java/patchedMc/net/minecraft/command/CommandDifficulty.class new file mode 100644 index 0000000..0d3b3ba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandDifficulty.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandEffect.class b/build/classes/java/patchedMc/net/minecraft/command/CommandEffect.class new file mode 100644 index 0000000..8f817da Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandEnchant.class b/build/classes/java/patchedMc/net/minecraft/command/CommandEnchant.class new file mode 100644 index 0000000..21c3b0b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandEnchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandException.class b/build/classes/java/patchedMc/net/minecraft/command/CommandException.class new file mode 100644 index 0000000..8aff807 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandGameMode.class b/build/classes/java/patchedMc/net/minecraft/command/CommandGameMode.class new file mode 100644 index 0000000..0eb4655 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandGameMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandGameRule.class b/build/classes/java/patchedMc/net/minecraft/command/CommandGameRule.class new file mode 100644 index 0000000..45613e7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandGameRule.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandGive.class b/build/classes/java/patchedMc/net/minecraft/command/CommandGive.class new file mode 100644 index 0000000..121d672 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandGive.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandHandler.class b/build/classes/java/patchedMc/net/minecraft/command/CommandHandler.class new file mode 100644 index 0000000..18c1b97 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandHelp.class b/build/classes/java/patchedMc/net/minecraft/command/CommandHelp.class new file mode 100644 index 0000000..ac1b3c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandHelp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandKill.class b/build/classes/java/patchedMc/net/minecraft/command/CommandKill.class new file mode 100644 index 0000000..e5b3116 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandKill.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandNotFoundException.class b/build/classes/java/patchedMc/net/minecraft/command/CommandNotFoundException.class new file mode 100644 index 0000000..51c42b3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandNotFoundException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandPlaySound.class b/build/classes/java/patchedMc/net/minecraft/command/CommandPlaySound.class new file mode 100644 index 0000000..1d7e3a9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandPlaySound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandServerKick.class b/build/classes/java/patchedMc/net/minecraft/command/CommandServerKick.class new file mode 100644 index 0000000..cf19391 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandServerKick.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandSetPlayerTimeout.class b/build/classes/java/patchedMc/net/minecraft/command/CommandSetPlayerTimeout.class new file mode 100644 index 0000000..a8404c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandSetPlayerTimeout.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandSetSpawnpoint.class b/build/classes/java/patchedMc/net/minecraft/command/CommandSetSpawnpoint.class new file mode 100644 index 0000000..1624c06 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandSetSpawnpoint.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandShowSeed.class b/build/classes/java/patchedMc/net/minecraft/command/CommandShowSeed.class new file mode 100644 index 0000000..b28c0e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandShowSeed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers$Position.class b/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers$Position.class new file mode 100644 index 0000000..bc1fa66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers$Position.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers.class b/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers.class new file mode 100644 index 0000000..491b049 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandSpreadPlayers.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandTime.class b/build/classes/java/patchedMc/net/minecraft/command/CommandTime.class new file mode 100644 index 0000000..20cf5e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandTime.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandToggleDownfall.class b/build/classes/java/patchedMc/net/minecraft/command/CommandToggleDownfall.class new file mode 100644 index 0000000..2c696ca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandToggleDownfall.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandWeather.class b/build/classes/java/patchedMc/net/minecraft/command/CommandWeather.class new file mode 100644 index 0000000..c587c3a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandWeather.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/CommandXP.class b/build/classes/java/patchedMc/net/minecraft/command/CommandXP.class new file mode 100644 index 0000000..e23e5ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/CommandXP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IAdminCommand.class b/build/classes/java/patchedMc/net/minecraft/command/IAdminCommand.class new file mode 100644 index 0000000..16e4c51 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IAdminCommand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/ICommand.class b/build/classes/java/patchedMc/net/minecraft/command/ICommand.class new file mode 100644 index 0000000..86efce4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/ICommand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/ICommandManager.class b/build/classes/java/patchedMc/net/minecraft/command/ICommandManager.class new file mode 100644 index 0000000..e6d1b20 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/ICommandManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/ICommandSender.class b/build/classes/java/patchedMc/net/minecraft/command/ICommandSender.class new file mode 100644 index 0000000..1cbbaee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/ICommandSender.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$1.class b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$1.class new file mode 100644 index 0000000..b23014a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$2.class b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$2.class new file mode 100644 index 0000000..3cff4ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$3.class b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$3.class new file mode 100644 index 0000000..4ab9779 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$ArmoredMob.class b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$ArmoredMob.class new file mode 100644 index 0000000..63493c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector$ArmoredMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector.class b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector.class new file mode 100644 index 0000000..e96fe66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/IEntitySelector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/NumberInvalidException.class b/build/classes/java/patchedMc/net/minecraft/command/NumberInvalidException.class new file mode 100644 index 0000000..0dbfb2e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/NumberInvalidException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/PlayerNotFoundException.class b/build/classes/java/patchedMc/net/minecraft/command/PlayerNotFoundException.class new file mode 100644 index 0000000..2b9add5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/PlayerNotFoundException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/PlayerSelector.class b/build/classes/java/patchedMc/net/minecraft/command/PlayerSelector.class new file mode 100644 index 0000000..a960ffa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/PlayerSelector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/ServerCommand.class b/build/classes/java/patchedMc/net/minecraft/command/ServerCommand.class new file mode 100644 index 0000000..89b6e50 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/ServerCommand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/ServerCommandManager.class b/build/classes/java/patchedMc/net/minecraft/command/ServerCommandManager.class new file mode 100644 index 0000000..aa00eb7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/ServerCommandManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/SyntaxErrorException.class b/build/classes/java/patchedMc/net/minecraft/command/SyntaxErrorException.class new file mode 100644 index 0000000..62bdcda Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/SyntaxErrorException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/WrongUsageException.class b/build/classes/java/patchedMc/net/minecraft/command/WrongUsageException.class new file mode 100644 index 0000000..c8d9ba7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/WrongUsageException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandAchievement.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandAchievement.class new file mode 100644 index 0000000..1287e1c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandAchievement.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanIp.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanIp.class new file mode 100644 index 0000000..48cef1d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanIp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanPlayer.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanPlayer.class new file mode 100644 index 0000000..350e7fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBanPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandBlockLogic.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBlockLogic.class new file mode 100644 index 0000000..94bee85 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBlockLogic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandBroadcast.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBroadcast.class new file mode 100644 index 0000000..967b1e6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandBroadcast.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandDeOp.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandDeOp.class new file mode 100644 index 0000000..cb185a6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandDeOp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandEmote.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandEmote.class new file mode 100644 index 0000000..3e2a6c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandEmote.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandListBans.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandListBans.class new file mode 100644 index 0000000..420b09a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandListBans.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandListPlayers.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandListPlayers.class new file mode 100644 index 0000000..dd91e5e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandListPlayers.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessage.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessage.class new file mode 100644 index 0000000..1912296 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessageRaw.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessageRaw.class new file mode 100644 index 0000000..5faff66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandMessageRaw.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandNetstat.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandNetstat.class new file mode 100644 index 0000000..49d7bb7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandNetstat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandOp.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandOp.class new file mode 100644 index 0000000..8e336ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandOp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonIp.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonIp.class new file mode 100644 index 0000000..47a39ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonIp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonPlayer.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonPlayer.class new file mode 100644 index 0000000..c892414 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPardonPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandPublishLocalServer.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPublishLocalServer.class new file mode 100644 index 0000000..af43c63 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandPublishLocalServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveAll.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveAll.class new file mode 100644 index 0000000..321b797 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveAll.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOff.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOff.class new file mode 100644 index 0000000..6e403e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOff.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOn.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOn.class new file mode 100644 index 0000000..cf627dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSaveOn.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandScoreboard.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandScoreboard.class new file mode 100644 index 0000000..9610d77 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandScoreboard.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetBlock.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetBlock.class new file mode 100644 index 0000000..eb7cbdf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetDefaultSpawnpoint.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetDefaultSpawnpoint.class new file mode 100644 index 0000000..622433d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSetDefaultSpawnpoint.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandStop.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandStop.class new file mode 100644 index 0000000..e4f1864 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandStop.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandSummon.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSummon.class new file mode 100644 index 0000000..c6fc92c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandSummon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandTeleport.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTeleport.class new file mode 100644 index 0000000..dfb0cfb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTeleport.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestFor.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestFor.class new file mode 100644 index 0000000..f2c8dc5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestFor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestForBlock.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestForBlock.class new file mode 100644 index 0000000..88cac3d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandTestForBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/command/server/CommandWhitelist.class b/build/classes/java/patchedMc/net/minecraft/command/server/CommandWhitelist.class new file mode 100644 index 0000000..577d9b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/command/server/CommandWhitelist.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$1.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$1.class new file mode 100644 index 0000000..547e099 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$2.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$2.class new file mode 100644 index 0000000..7ee1f33 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$3.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$3.class new file mode 100644 index 0000000..0d49aaf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$4.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$4.class new file mode 100644 index 0000000..b768da3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$5.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$5.class new file mode 100644 index 0000000..6b3d8cd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$6.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$6.class new file mode 100644 index 0000000..0d89876 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$7.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$7.class new file mode 100644 index 0000000..86960d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$8.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$8.class new file mode 100644 index 0000000..9752fa3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport$8.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReport.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport.class new file mode 100644 index 0000000..07fff16 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReport.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$1.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$1.class new file mode 100644 index 0000000..9baaa97 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$2.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$2.class new file mode 100644 index 0000000..6b46168 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$3.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$3.class new file mode 100644 index 0000000..8d6d04d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$Entry.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$Entry.class new file mode 100644 index 0000000..80bf491 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory$Entry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory.class b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory.class new file mode 100644 index 0000000..8b27ae1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/crash/CrashReportCategory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$1.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$1.class new file mode 100644 index 0000000..9aa292f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$10.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$10.class new file mode 100644 index 0000000..1e8e7fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$10.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$11.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$11.class new file mode 100644 index 0000000..2decc6f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$11.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$12.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$12.class new file mode 100644 index 0000000..15d7770 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$12.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$2.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$2.class new file mode 100644 index 0000000..048713f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$3.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$3.class new file mode 100644 index 0000000..e79d0ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$4.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$4.class new file mode 100644 index 0000000..4facf80 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$5.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$5.class new file mode 100644 index 0000000..4abef27 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$6.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$6.class new file mode 100644 index 0000000..13bd8a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$7.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$7.class new file mode 100644 index 0000000..32fe902 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$8.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$8.class new file mode 100644 index 0000000..b4478ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$8.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$9.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$9.class new file mode 100644 index 0000000..c71a6ab Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs$9.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs.class b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs.class new file mode 100644 index 0000000..673f6f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/creativetab/CreativeTabs.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorDefaultDispenseItem.class b/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorDefaultDispenseItem.class new file mode 100644 index 0000000..f31363b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorDefaultDispenseItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorProjectileDispense.class b/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorProjectileDispense.class new file mode 100644 index 0000000..5aacfb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/BehaviorProjectileDispense.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem$1.class b/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem$1.class new file mode 100644 index 0000000..5ff7088 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem.class b/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem.class new file mode 100644 index 0000000..3674cd9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/IBehaviorDispenseItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/IBlockSource.class b/build/classes/java/patchedMc/net/minecraft/dispenser/IBlockSource.class new file mode 100644 index 0000000..64e18a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/IBlockSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/ILocatableSource.class b/build/classes/java/patchedMc/net/minecraft/dispenser/ILocatableSource.class new file mode 100644 index 0000000..d0b6ba3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/ILocatableSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/ILocation.class b/build/classes/java/patchedMc/net/minecraft/dispenser/ILocation.class new file mode 100644 index 0000000..a1e6c20 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/ILocation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/IPosition.class b/build/classes/java/patchedMc/net/minecraft/dispenser/IPosition.class new file mode 100644 index 0000000..0f66dee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/IPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/dispenser/PositionImpl.class b/build/classes/java/patchedMc/net/minecraft/dispenser/PositionImpl.class new file mode 100644 index 0000000..11a9fa1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/dispenser/PositionImpl.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/Enchantment.class b/build/classes/java/patchedMc/net/minecraft/enchantment/Enchantment.class new file mode 100644 index 0000000..880d5f2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/Enchantment.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowDamage.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowDamage.class new file mode 100644 index 0000000..677c445 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowDamage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowFire.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowFire.class new file mode 100644 index 0000000..2147532 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowFire.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowInfinite.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowInfinite.class new file mode 100644 index 0000000..91e7bc4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowInfinite.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowKnockback.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowKnockback.class new file mode 100644 index 0000000..6636876 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentArrowKnockback.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDamage.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDamage.class new file mode 100644 index 0000000..c7f0a3f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDamage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentData.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentData.class new file mode 100644 index 0000000..2de40c6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDigging.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDigging.class new file mode 100644 index 0000000..9a1c448 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDigging.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDurability.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDurability.class new file mode 100644 index 0000000..cd4c3cd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentDurability.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFireAspect.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFireAspect.class new file mode 100644 index 0000000..ea84276 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFireAspect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFishingSpeed.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFishingSpeed.class new file mode 100644 index 0000000..c273604 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentFishingSpeed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$DamageIterator.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$DamageIterator.class new file mode 100644 index 0000000..4f8b37f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$DamageIterator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$HurtIterator.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$HurtIterator.class new file mode 100644 index 0000000..ea7b3be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$HurtIterator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$IModifier.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$IModifier.class new file mode 100644 index 0000000..926e964 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$IModifier.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierDamage.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierDamage.class new file mode 100644 index 0000000..25c23eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierDamage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierLiving.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierLiving.class new file mode 100644 index 0000000..5888b88 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper$ModifierLiving.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper.class new file mode 100644 index 0000000..3d881af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentKnockback.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentKnockback.class new file mode 100644 index 0000000..f6b02ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentKnockback.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentLootBonus.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentLootBonus.class new file mode 100644 index 0000000..43e0fcb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentLootBonus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentOxygen.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentOxygen.class new file mode 100644 index 0000000..5c39d7d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentOxygen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentProtection.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentProtection.class new file mode 100644 index 0000000..9828c4b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentProtection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentThorns.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentThorns.class new file mode 100644 index 0000000..643483d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentThorns.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentUntouching.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentUntouching.class new file mode 100644 index 0000000..155f153 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentUntouching.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentWaterWorker.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentWaterWorker.class new file mode 100644 index 0000000..89833aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnchantmentWaterWorker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/enchantment/EnumEnchantmentType.class b/build/classes/java/patchedMc/net/minecraft/enchantment/EnumEnchantmentType.class new file mode 100644 index 0000000..eb5afc4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/enchantment/EnumEnchantmentType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher$WatchableObject.class b/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher$WatchableObject.class new file mode 100644 index 0000000..1f32379 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher$WatchableObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher.class b/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher.class new file mode 100644 index 0000000..c97e64f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/DataWatcher.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/Entity$1.class b/build/classes/java/patchedMc/net/minecraft/entity/Entity$1.class new file mode 100644 index 0000000..9ce2468 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/Entity$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/Entity$2.class b/build/classes/java/patchedMc/net/minecraft/entity/Entity$2.class new file mode 100644 index 0000000..12c3209 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/Entity$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/Entity$EnumEntitySize.class b/build/classes/java/patchedMc/net/minecraft/entity/Entity$EnumEntitySize.class new file mode 100644 index 0000000..53285a1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/Entity$EnumEntitySize.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/Entity$SwitchEnumEntitySize.class b/build/classes/java/patchedMc/net/minecraft/entity/Entity$SwitchEnumEntitySize.class new file mode 100644 index 0000000..24e6144 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/Entity$SwitchEnumEntitySize.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/Entity.class b/build/classes/java/patchedMc/net/minecraft/entity/Entity.class new file mode 100644 index 0000000..3377a27 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/Entity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityAgeable.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityAgeable.class new file mode 100644 index 0000000..085be0d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityAgeable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityBodyHelper.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityBodyHelper.class new file mode 100644 index 0000000..b7dd8c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityBodyHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityCreature.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityCreature.class new file mode 100644 index 0000000..22775d2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityCreature.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityFlying.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityFlying.class new file mode 100644 index 0000000..ed9078c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityFlying.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityHanging.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityHanging.class new file mode 100644 index 0000000..7b5ffb0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityHanging.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityLeashKnot.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityLeashKnot.class new file mode 100644 index 0000000..cee4998 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityLeashKnot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityList$EntityEggInfo.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityList$EntityEggInfo.class new file mode 100644 index 0000000..2e622e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityList$EntityEggInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityList.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityList.class new file mode 100644 index 0000000..a8ef46a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityLiving.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityLiving.class new file mode 100644 index 0000000..98f2fb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityLiving.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityLivingBase.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityLivingBase.class new file mode 100644 index 0000000..af767de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityLivingBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock$1.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock$1.class new file mode 100644 index 0000000..dac394c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock.class new file mode 100644 index 0000000..e3ac68a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityMinecartCommandBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker$1.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker$1.class new file mode 100644 index 0000000..9226bc1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker.class new file mode 100644 index 0000000..98bfa0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityTracker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EntityTrackerEntry.class b/build/classes/java/patchedMc/net/minecraft/entity/EntityTrackerEntry.class new file mode 100644 index 0000000..bc5d34a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EntityTrackerEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureAttribute.class b/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureAttribute.class new file mode 100644 index 0000000..0d7f1fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureAttribute.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureType.class b/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureType.class new file mode 100644 index 0000000..f35e766 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/EnumCreatureType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IEntityLivingData.class b/build/classes/java/patchedMc/net/minecraft/entity/IEntityLivingData.class new file mode 100644 index 0000000..8e76e1a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IEntityLivingData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IEntityMultiPart.class b/build/classes/java/patchedMc/net/minecraft/entity/IEntityMultiPart.class new file mode 100644 index 0000000..c266edd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IEntityMultiPart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IEntityOwnable.class b/build/classes/java/patchedMc/net/minecraft/entity/IEntityOwnable.class new file mode 100644 index 0000000..230581a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IEntityOwnable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IMerchant.class b/build/classes/java/patchedMc/net/minecraft/entity/IMerchant.class new file mode 100644 index 0000000..0c1db53 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IMerchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/INpc.class b/build/classes/java/patchedMc/net/minecraft/entity/INpc.class new file mode 100644 index 0000000..09660e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/INpc.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IProjectile.class b/build/classes/java/patchedMc/net/minecraft/entity/IProjectile.class new file mode 100644 index 0000000..17c9f57 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IProjectile.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/IRangedAttackMob.class b/build/classes/java/patchedMc/net/minecraft/entity/IRangedAttackMob.class new file mode 100644 index 0000000..dd49f2e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/IRangedAttackMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/NpcMerchant.class b/build/classes/java/patchedMc/net/minecraft/entity/NpcMerchant.class new file mode 100644 index 0000000..2d037d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/NpcMerchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/SharedMonsterAttributes.class b/build/classes/java/patchedMc/net/minecraft/entity/SharedMonsterAttributes.class new file mode 100644 index 0000000..639a655 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/SharedMonsterAttributes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIArrowAttack.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIArrowAttack.class new file mode 100644 index 0000000..c4de6a8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIArrowAttack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAttackOnCollide.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAttackOnCollide.class new file mode 100644 index 0000000..8e97169 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAttackOnCollide.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity$1.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity$1.class new file mode 100644 index 0000000..f75afb3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity.class new file mode 100644 index 0000000..847d0d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIAvoidEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBase.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBase.class new file mode 100644 index 0000000..344039f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBeg.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBeg.class new file mode 100644 index 0000000..d206d39 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBeg.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBreakDoor.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBreakDoor.class new file mode 100644 index 0000000..7625be3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIBreakDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIControlledByPlayer.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIControlledByPlayer.class new file mode 100644 index 0000000..1556a21 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIControlledByPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAICreeperSwell.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAICreeperSwell.class new file mode 100644 index 0000000..84d7960 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAICreeperSwell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDefendVillage.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDefendVillage.class new file mode 100644 index 0000000..6f0f503 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDefendVillage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDoorInteract.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDoorInteract.class new file mode 100644 index 0000000..8c47b2c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIDoorInteract.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIEatGrass.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIEatGrass.class new file mode 100644 index 0000000..679d8fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIEatGrass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFleeSun.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFleeSun.class new file mode 100644 index 0000000..989de06 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFleeSun.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowGolem.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowGolem.class new file mode 100644 index 0000000..1db900f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowGolem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowOwner.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowOwner.class new file mode 100644 index 0000000..9810cdd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowOwner.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowParent.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowParent.class new file mode 100644 index 0000000..1ac3b6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIFollowParent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIHurtByTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIHurtByTarget.class new file mode 100644 index 0000000..e4ad929 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIHurtByTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILeapAtTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILeapAtTarget.class new file mode 100644 index 0000000..a2e87f0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILeapAtTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtTradePlayer.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtTradePlayer.class new file mode 100644 index 0000000..337df3a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtTradePlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtVillager.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtVillager.class new file mode 100644 index 0000000..d6d82eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookAtVillager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookIdle.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookIdle.class new file mode 100644 index 0000000..d2b24b3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAILookIdle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMate.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMate.class new file mode 100644 index 0000000..0addc47 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveIndoors.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveIndoors.class new file mode 100644 index 0000000..ba2d33a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveIndoors.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveThroughVillage.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveThroughVillage.class new file mode 100644 index 0000000..9dca314 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveThroughVillage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.class new file mode 100644 index 0000000..f5349ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.class new file mode 100644 index 0000000..a506100 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$1.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$1.class new file mode 100644 index 0000000..11d8fe5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter.class new file mode 100644 index 0000000..a6e9e8c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget.class new file mode 100644 index 0000000..bebdf0b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAINearestAttackableTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotAttack.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotAttack.class new file mode 100644 index 0000000..549ab7a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotAttack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotSit.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotSit.class new file mode 100644 index 0000000..93b43af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOcelotSit.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOpenDoor.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOpenDoor.class new file mode 100644 index 0000000..a51b4d1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOpenDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.class new file mode 100644 index 0000000..37ce68c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.class new file mode 100644 index 0000000..5619b46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPanic.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPanic.class new file mode 100644 index 0000000..f5db5b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPanic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPlay.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPlay.class new file mode 100644 index 0000000..357c6fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIPlay.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.class new file mode 100644 index 0000000..a4797be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictSun.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictSun.class new file mode 100644 index 0000000..3764fa2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRestrictSun.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.class new file mode 100644 index 0000000..2785a54 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISit.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISit.class new file mode 100644 index 0000000..1b715d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISit.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISwimming.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISwimming.class new file mode 100644 index 0000000..c6b333a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAISwimming.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITarget.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITarget.class new file mode 100644 index 0000000..9de6ed9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITarget.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITargetNonTamed.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITargetNonTamed.class new file mode 100644 index 0000000..16ddcc7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITargetNonTamed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry.class new file mode 100644 index 0000000..ed3b828 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks.class new file mode 100644 index 0000000..e8683d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITasks.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITempt.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITempt.class new file mode 100644 index 0000000..f557efb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITempt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITradePlayer.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITradePlayer.class new file mode 100644 index 0000000..26fad34 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAITradePlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIVillagerMate.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIVillagerMate.class new file mode 100644 index 0000000..65dc036 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIVillagerMate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWander.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWander.class new file mode 100644 index 0000000..1f23b09 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWander.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest.class new file mode 100644 index 0000000..6eaad88 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest2.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest2.class new file mode 100644 index 0000000..da352c7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityAIWatchClosest2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityJumpHelper.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityJumpHelper.class new file mode 100644 index 0000000..41062c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityJumpHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityLookHelper.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityLookHelper.class new file mode 100644 index 0000000..3508012 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityLookHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner$1.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner$1.class new file mode 100644 index 0000000..013ea6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner.class new file mode 100644 index 0000000..d227e82 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMinecartMobSpawner.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMoveHelper.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMoveHelper.class new file mode 100644 index 0000000..554af06 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntityMoveHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/EntitySenses.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntitySenses.class new file mode 100644 index 0000000..fd289be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/EntitySenses.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/RandomPositionGenerator.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/RandomPositionGenerator.class new file mode 100644 index 0000000..5ea8fbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/RandomPositionGenerator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/AttributeModifier.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/AttributeModifier.class new file mode 100644 index 0000000..7e402da Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/AttributeModifier.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttribute.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttribute.class new file mode 100644 index 0000000..7206919 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttribute.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttributeMap.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttributeMap.class new file mode 100644 index 0000000..c240256 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/BaseAttributeMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttribute.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttribute.class new file mode 100644 index 0000000..fbcffbe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttribute.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttributeInstance.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttributeInstance.class new file mode 100644 index 0000000..030dfdf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/IAttributeInstance.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.class new file mode 100644 index 0000000..856727b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/RangedAttribute.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/RangedAttribute.class new file mode 100644 index 0000000..195ce00 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/RangedAttribute.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ServersideAttributeMap.class b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ServersideAttributeMap.class new file mode 100644 index 0000000..e6673f1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/ai/attributes/ServersideAttributeMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/BossStatus.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/BossStatus.class new file mode 100644 index 0000000..8c9d68d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/BossStatus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragon.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragon.class new file mode 100644 index 0000000..9b8ad0f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragonPart.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragonPart.class new file mode 100644 index 0000000..072d00f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityDragonPart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither$1.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither$1.class new file mode 100644 index 0000000..8851504 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither.class new file mode 100644 index 0000000..cc41028 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/EntityWither.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/boss/IBossDisplayData.class b/build/classes/java/patchedMc/net/minecraft/entity/boss/IBossDisplayData.class new file mode 100644 index 0000000..1882611 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/boss/IBossDisplayData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityLightningBolt.class b/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityLightningBolt.class new file mode 100644 index 0000000..3683236 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityLightningBolt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityWeatherEffect.class b/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityWeatherEffect.class new file mode 100644 index 0000000..e716665 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/effect/EntityWeatherEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityBoat.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityBoat.class new file mode 100644 index 0000000..163884d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityBoat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderCrystal.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderCrystal.class new file mode 100644 index 0000000..bad10e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderCrystal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderEye.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderEye.class new file mode 100644 index 0000000..142b214 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderEye.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderPearl.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderPearl.class new file mode 100644 index 0000000..f0a09a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityEnderPearl.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityExpBottle.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityExpBottle.class new file mode 100644 index 0000000..d534cf4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityExpBottle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFallingBlock.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFallingBlock.class new file mode 100644 index 0000000..0ef85cb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFallingBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFireworkRocket.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFireworkRocket.class new file mode 100644 index 0000000..d653990 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityFireworkRocket.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItem.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItem.class new file mode 100644 index 0000000..c95ee03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItemFrame.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItemFrame.class new file mode 100644 index 0000000..85984e7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityItemFrame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecart.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecart.class new file mode 100644 index 0000000..f2a7e62 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartChest.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartChest.class new file mode 100644 index 0000000..936daae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartContainer.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartContainer.class new file mode 100644 index 0000000..7a3a074 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartContainer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartEmpty.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartEmpty.class new file mode 100644 index 0000000..715972a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartEmpty.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartFurnace.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartFurnace.class new file mode 100644 index 0000000..ff0219e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartHopper.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartHopper.class new file mode 100644 index 0000000..fbcd0c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartTNT.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartTNT.class new file mode 100644 index 0000000..3a25bd5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityMinecartTNT.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting$EnumArt.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting$EnumArt.class new file mode 100644 index 0000000..dcd72b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting$EnumArt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting.class new file mode 100644 index 0000000..ca55108 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityPainting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityTNTPrimed.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityTNTPrimed.class new file mode 100644 index 0000000..0a22f52 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityTNTPrimed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/item/EntityXPOrb.class b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityXPOrb.class new file mode 100644 index 0000000..ce13512 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/item/EntityXPOrb.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityBlaze.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityBlaze.class new file mode 100644 index 0000000..6dfe3de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityBlaze.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCaveSpider.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCaveSpider.class new file mode 100644 index 0000000..f147d3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCaveSpider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCreeper.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCreeper.class new file mode 100644 index 0000000..88cacd3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityCreeper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityEnderman.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityEnderman.class new file mode 100644 index 0000000..8a53014 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityEnderman.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGhast.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGhast.class new file mode 100644 index 0000000..82dd65e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGhast.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGiantZombie.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGiantZombie.class new file mode 100644 index 0000000..eeec8bc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGiantZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGolem.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGolem.class new file mode 100644 index 0000000..e8e891e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityGolem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityIronGolem.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityIronGolem.class new file mode 100644 index 0000000..418084e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityIronGolem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMagmaCube.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMagmaCube.class new file mode 100644 index 0000000..3f3b412 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMagmaCube.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMob.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMob.class new file mode 100644 index 0000000..f7cb859 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityPigZombie.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityPigZombie.class new file mode 100644 index 0000000..0441c3f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityPigZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySilverfish.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySilverfish.class new file mode 100644 index 0000000..729a9ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySilverfish.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySkeleton.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySkeleton.class new file mode 100644 index 0000000..4dec415 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySkeleton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySlime.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySlime.class new file mode 100644 index 0000000..e3048f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySlime.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySnowman.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySnowman.class new file mode 100644 index 0000000..fc3969f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySnowman.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider$GroupData.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider$GroupData.class new file mode 100644 index 0000000..7d69742 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider$GroupData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider.class new file mode 100644 index 0000000..a7071f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntitySpider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityWitch.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityWitch.class new file mode 100644 index 0000000..98d4ef6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityWitch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie$GroupData.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie$GroupData.class new file mode 100644 index 0000000..49325f7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie$GroupData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie.class new file mode 100644 index 0000000..7168989 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/EntityZombie.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob$1.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob$1.class new file mode 100644 index 0000000..1f74201 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob.class b/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob.class new file mode 100644 index 0000000..32ee191 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/monster/IMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAmbientCreature.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAmbientCreature.class new file mode 100644 index 0000000..e339f46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAmbientCreature.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAnimal.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAnimal.class new file mode 100644 index 0000000..9e75c4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityAnimal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityBat.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityBat.class new file mode 100644 index 0000000..dc0b39a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityBat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityChicken.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityChicken.class new file mode 100644 index 0000000..75e1a84 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityChicken.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityCow.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityCow.class new file mode 100644 index 0000000..ef58830 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityCow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$1.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$1.class new file mode 100644 index 0000000..865114c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$GroupData.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$GroupData.class new file mode 100644 index 0000000..280a59e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse$GroupData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse.class new file mode 100644 index 0000000..336e888 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityHorse.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityMooshroom.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityMooshroom.class new file mode 100644 index 0000000..a899405 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityMooshroom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityOcelot.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityOcelot.class new file mode 100644 index 0000000..d951c07 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityOcelot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityPig.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityPig.class new file mode 100644 index 0000000..5fee147 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityPig.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep$1.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep$1.class new file mode 100644 index 0000000..1b3b3a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep.class new file mode 100644 index 0000000..f272ba5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySheep.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySquid.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySquid.class new file mode 100644 index 0000000..4f8edba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntitySquid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityTameable.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityTameable.class new file mode 100644 index 0000000..5480e21 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityTameable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityVillager.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityVillager.class new file mode 100644 index 0000000..cb89c9c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityVillager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWaterMob.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWaterMob.class new file mode 100644 index 0000000..56223d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWaterMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWolf.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWolf.class new file mode 100644 index 0000000..e50ac1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/EntityWolf.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/passive/IAnimals.class b/build/classes/java/patchedMc/net/minecraft/entity/passive/IAnimals.class new file mode 100644 index 0000000..7b0046d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/passive/IAnimals.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumChatVisibility.class b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumChatVisibility.class new file mode 100644 index 0000000..73a3edf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumChatVisibility.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumStatus.class b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumStatus.class new file mode 100644 index 0000000..61dbf29 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer$EnumStatus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer.class b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer.class new file mode 100644 index 0000000..9e52261 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayerMP.class b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayerMP.class new file mode 100644 index 0000000..aec9bcc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/EntityPlayerMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer$1.class b/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer$1.class new file mode 100644 index 0000000..7ba8816 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer.class b/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer.class new file mode 100644 index 0000000..8da4602 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/InventoryPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/player/PlayerCapabilities.class b/build/classes/java/patchedMc/net/minecraft/entity/player/PlayerCapabilities.class new file mode 100644 index 0000000..a7c66f7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/player/PlayerCapabilities.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityArrow.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityArrow.class new file mode 100644 index 0000000..1bdedef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityArrow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityEgg.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityEgg.class new file mode 100644 index 0000000..0c57f2f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityEgg.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFireball.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFireball.class new file mode 100644 index 0000000..33080e3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFireball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFishHook.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFishHook.class new file mode 100644 index 0000000..e490741 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityFishHook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityLargeFireball.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityLargeFireball.class new file mode 100644 index 0000000..9c62855 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityLargeFireball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityPotion.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityPotion.class new file mode 100644 index 0000000..d89df54 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityPotion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySmallFireball.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySmallFireball.class new file mode 100644 index 0000000..06a8a5d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySmallFireball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySnowball.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySnowball.class new file mode 100644 index 0000000..cd5897d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntitySnowball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityThrowable.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityThrowable.class new file mode 100644 index 0000000..c457711 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityThrowable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityWitherSkull.class b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityWitherSkull.class new file mode 100644 index 0000000..9649b89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/entity/projectile/EntityWitherSkull.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/event/ClickEvent$Action.class b/build/classes/java/patchedMc/net/minecraft/event/ClickEvent$Action.class new file mode 100644 index 0000000..c6d6a17 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/event/ClickEvent$Action.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/event/ClickEvent.class b/build/classes/java/patchedMc/net/minecraft/event/ClickEvent.class new file mode 100644 index 0000000..f1ff3cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/event/ClickEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/event/HoverEvent$Action.class b/build/classes/java/patchedMc/net/minecraft/event/HoverEvent$Action.class new file mode 100644 index 0000000..282921d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/event/HoverEvent$Action.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/event/HoverEvent.class b/build/classes/java/patchedMc/net/minecraft/event/HoverEvent.class new file mode 100644 index 0000000..7957c28 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/event/HoverEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Blocks.class b/build/classes/java/patchedMc/net/minecraft/init/Blocks.class new file mode 100644 index 0000000..7b888d0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Blocks.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$1.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$1.class new file mode 100644 index 0000000..5ae61e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$10.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$10.class new file mode 100644 index 0000000..f144145 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$10.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$11.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$11.class new file mode 100644 index 0000000..5d0957b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$11.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$12.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$12.class new file mode 100644 index 0000000..54085f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$12.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$13.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$13.class new file mode 100644 index 0000000..f1911d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$13.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$14.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$14.class new file mode 100644 index 0000000..18c998b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$14.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$2.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$2.class new file mode 100644 index 0000000..b2ded59 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$3.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$3.class new file mode 100644 index 0000000..2ee73d8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$4.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$4.class new file mode 100644 index 0000000..96fa758 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5$1.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5$1.class new file mode 100644 index 0000000..4ea3933 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5.class new file mode 100644 index 0000000..6acca39 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$6.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$6.class new file mode 100644 index 0000000..7301de8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$7.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$7.class new file mode 100644 index 0000000..f1f3d4f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$8.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$8.class new file mode 100644 index 0000000..10d99ac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$8.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$9.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$9.class new file mode 100644 index 0000000..6b3db68 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap$9.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Bootstrap.class b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap.class new file mode 100644 index 0000000..7626e8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Bootstrap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/init/Items.class b/build/classes/java/patchedMc/net/minecraft/init/Items.class new file mode 100644 index 0000000..3c98b54 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/init/Items.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/AnimalChest.class b/build/classes/java/patchedMc/net/minecraft/inventory/AnimalChest.class new file mode 100644 index 0000000..6b9d0a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/AnimalChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/Container.class b/build/classes/java/patchedMc/net/minecraft/inventory/Container.class new file mode 100644 index 0000000..fef0c53 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/Container.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon$BeaconSlot.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon$BeaconSlot.class new file mode 100644 index 0000000..343ea2e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon$BeaconSlot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon.class new file mode 100644 index 0000000..829240e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBeacon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Ingredient.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Ingredient.class new file mode 100644 index 0000000..3bc0954 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Ingredient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Potion.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Potion.class new file mode 100644 index 0000000..1395504 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand$Potion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand.class new file mode 100644 index 0000000..b792ef0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerBrewingStand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerChest.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerChest.class new file mode 100644 index 0000000..cf070fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerDispenser.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerDispenser.class new file mode 100644 index 0000000..91bb4f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerDispenser.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$1.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$1.class new file mode 100644 index 0000000..79afe61 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$2.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$2.class new file mode 100644 index 0000000..1c8cd2e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment.class new file mode 100644 index 0000000..2ce5a88 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerEnchantment.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerFurnace.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerFurnace.class new file mode 100644 index 0000000..6c58c2e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHopper.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHopper.class new file mode 100644 index 0000000..6366c71 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$1.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$1.class new file mode 100644 index 0000000..ffc8d8b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$2.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$2.class new file mode 100644 index 0000000..21ba346 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory.class new file mode 100644 index 0000000..389ea99 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerHorseInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerMerchant.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerMerchant.class new file mode 100644 index 0000000..6c3a44f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerMerchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer$1.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer$1.class new file mode 100644 index 0000000..3dc6452 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer.class new file mode 100644 index 0000000..69f9da4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$1.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$1.class new file mode 100644 index 0000000..9aceb07 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$2.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$2.class new file mode 100644 index 0000000..e78a8e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair.class new file mode 100644 index 0000000..9263b28 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerRepair.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ContainerWorkbench.class b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerWorkbench.class new file mode 100644 index 0000000..5d6124e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ContainerWorkbench.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ICrafting.class b/build/classes/java/patchedMc/net/minecraft/inventory/ICrafting.class new file mode 100644 index 0000000..adf0559 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ICrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/IInvBasic.class b/build/classes/java/patchedMc/net/minecraft/inventory/IInvBasic.class new file mode 100644 index 0000000..570fe0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/IInvBasic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/IInventory.class b/build/classes/java/patchedMc/net/minecraft/inventory/IInventory.class new file mode 100644 index 0000000..7bcf980 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/IInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/ISidedInventory.class b/build/classes/java/patchedMc/net/minecraft/inventory/ISidedInventory.class new file mode 100644 index 0000000..5ca8642 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/ISidedInventory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryBasic.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryBasic.class new file mode 100644 index 0000000..dd7b230 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryBasic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCraftResult.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCraftResult.class new file mode 100644 index 0000000..f3f1407 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCraftResult.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCrafting.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCrafting.class new file mode 100644 index 0000000..ef1dc70 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryEnderChest.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryEnderChest.class new file mode 100644 index 0000000..52d134b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryEnderChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryLargeChest.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryLargeChest.class new file mode 100644 index 0000000..41a6edb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryLargeChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/InventoryMerchant.class b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryMerchant.class new file mode 100644 index 0000000..d6876d0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/InventoryMerchant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/Slot.class b/build/classes/java/patchedMc/net/minecraft/inventory/Slot.class new file mode 100644 index 0000000..a3a4138 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/Slot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/SlotCrafting.class b/build/classes/java/patchedMc/net/minecraft/inventory/SlotCrafting.class new file mode 100644 index 0000000..c02281f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/SlotCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/SlotFurnace.class b/build/classes/java/patchedMc/net/minecraft/inventory/SlotFurnace.class new file mode 100644 index 0000000..09292c2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/SlotFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/inventory/SlotMerchantResult.class b/build/classes/java/patchedMc/net/minecraft/inventory/SlotMerchantResult.class new file mode 100644 index 0000000..e680633 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/inventory/SlotMerchantResult.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/EnumAction.class b/build/classes/java/patchedMc/net/minecraft/item/EnumAction.class new file mode 100644 index 0000000..719b842 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/EnumAction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/EnumRarity.class b/build/classes/java/patchedMc/net/minecraft/item/EnumRarity.class new file mode 100644 index 0000000..dd8150f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/EnumRarity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/Item$1.class b/build/classes/java/patchedMc/net/minecraft/item/Item$1.class new file mode 100644 index 0000000..432aac0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/Item$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/Item$ToolMaterial.class b/build/classes/java/patchedMc/net/minecraft/item/Item$ToolMaterial.class new file mode 100644 index 0000000..020eae0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/Item$ToolMaterial.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/Item.class b/build/classes/java/patchedMc/net/minecraft/item/Item.class new file mode 100644 index 0000000..7dabc18 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/Item.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemAnvilBlock.class b/build/classes/java/patchedMc/net/minecraft/item/ItemAnvilBlock.class new file mode 100644 index 0000000..2764d84 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemAnvilBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemAppleGold.class b/build/classes/java/patchedMc/net/minecraft/item/ItemAppleGold.class new file mode 100644 index 0000000..5de4664 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemAppleGold.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$1.class b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$1.class new file mode 100644 index 0000000..eb176f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$ArmorMaterial.class b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$ArmorMaterial.class new file mode 100644 index 0000000..0ab1c13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor$ArmorMaterial.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemArmor.class b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor.class new file mode 100644 index 0000000..1a54973 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemArmor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemAxe.class b/build/classes/java/patchedMc/net/minecraft/item/ItemAxe.class new file mode 100644 index 0000000..cf1783a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemAxe.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBed.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBed.class new file mode 100644 index 0000000..1a03f4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBlock.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBlock.class new file mode 100644 index 0000000..87bcb4d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBlockWithMetadata.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBlockWithMetadata.class new file mode 100644 index 0000000..fc25e0e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBlockWithMetadata.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBoat.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBoat.class new file mode 100644 index 0000000..1141b75 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBoat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBook.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBook.class new file mode 100644 index 0000000..bcd7337 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBow.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBow.class new file mode 100644 index 0000000..f3bef2a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBucket.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBucket.class new file mode 100644 index 0000000..40e83c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBucket.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemBucketMilk.class b/build/classes/java/patchedMc/net/minecraft/item/ItemBucketMilk.class new file mode 100644 index 0000000..6a8a921 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemBucketMilk.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemCarrotOnAStick.class b/build/classes/java/patchedMc/net/minecraft/item/ItemCarrotOnAStick.class new file mode 100644 index 0000000..f124df9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemCarrotOnAStick.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemCloth.class b/build/classes/java/patchedMc/net/minecraft/item/ItemCloth.class new file mode 100644 index 0000000..e4b7343 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemCloth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemCoal.class b/build/classes/java/patchedMc/net/minecraft/item/ItemCoal.class new file mode 100644 index 0000000..34f4c60 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemCoal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemColored.class b/build/classes/java/patchedMc/net/minecraft/item/ItemColored.class new file mode 100644 index 0000000..74cf9b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemColored.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemDoor.class b/build/classes/java/patchedMc/net/minecraft/item/ItemDoor.class new file mode 100644 index 0000000..e473e80 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemDoublePlant.class b/build/classes/java/patchedMc/net/minecraft/item/ItemDoublePlant.class new file mode 100644 index 0000000..c794143 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemDoublePlant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemDye.class b/build/classes/java/patchedMc/net/minecraft/item/ItemDye.class new file mode 100644 index 0000000..7f909c3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemDye.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEditableBook.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEditableBook.class new file mode 100644 index 0000000..8ddc217 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEditableBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEgg.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEgg.class new file mode 100644 index 0000000..b91b2ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEgg.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEmptyMap.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEmptyMap.class new file mode 100644 index 0000000..0558332 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEmptyMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEnchantedBook.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEnchantedBook.class new file mode 100644 index 0000000..d329168 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEnchantedBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEnderEye.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEnderEye.class new file mode 100644 index 0000000..0ecf9c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEnderEye.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemEnderPearl.class b/build/classes/java/patchedMc/net/minecraft/item/ItemEnderPearl.class new file mode 100644 index 0000000..233a153 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemEnderPearl.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemExpBottle.class b/build/classes/java/patchedMc/net/minecraft/item/ItemExpBottle.class new file mode 100644 index 0000000..ec605ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemExpBottle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFireball.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFireball.class new file mode 100644 index 0000000..a494858 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFireball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFirework.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFirework.class new file mode 100644 index 0000000..5270c77 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFirework.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFireworkCharge.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFireworkCharge.class new file mode 100644 index 0000000..30016e0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFireworkCharge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood$FishType.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood$FishType.class new file mode 100644 index 0000000..51a0613 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood$FishType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood.class new file mode 100644 index 0000000..70afae4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFishFood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFishingRod.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFishingRod.class new file mode 100644 index 0000000..5f0f14d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFishingRod.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFlintAndSteel.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFlintAndSteel.class new file mode 100644 index 0000000..d8880d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFlintAndSteel.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemFood.class b/build/classes/java/patchedMc/net/minecraft/item/ItemFood.class new file mode 100644 index 0000000..bcf4493 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemFood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemGlassBottle.class b/build/classes/java/patchedMc/net/minecraft/item/ItemGlassBottle.class new file mode 100644 index 0000000..edec26a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemGlassBottle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemHangingEntity.class b/build/classes/java/patchedMc/net/minecraft/item/ItemHangingEntity.class new file mode 100644 index 0000000..39fb1dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemHangingEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemHoe.class b/build/classes/java/patchedMc/net/minecraft/item/ItemHoe.class new file mode 100644 index 0000000..23235a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemHoe.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemLead.class b/build/classes/java/patchedMc/net/minecraft/item/ItemLead.class new file mode 100644 index 0000000..a470c4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemLead.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemLeaves.class b/build/classes/java/patchedMc/net/minecraft/item/ItemLeaves.class new file mode 100644 index 0000000..3758749 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemLeaves.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemLilyPad.class b/build/classes/java/patchedMc/net/minecraft/item/ItemLilyPad.class new file mode 100644 index 0000000..3c8dd81 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemLilyPad.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMap.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMap.class new file mode 100644 index 0000000..5442d43 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMapBase.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMapBase.class new file mode 100644 index 0000000..31b323c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMapBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart$1.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart$1.class new file mode 100644 index 0000000..d0dc228 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart.class new file mode 100644 index 0000000..7931a17 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMonsterPlacer.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMonsterPlacer.class new file mode 100644 index 0000000..4c29238 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMonsterPlacer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemMultiTexture.class b/build/classes/java/patchedMc/net/minecraft/item/ItemMultiTexture.class new file mode 100644 index 0000000..f17e131 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemMultiTexture.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemNameTag.class b/build/classes/java/patchedMc/net/minecraft/item/ItemNameTag.class new file mode 100644 index 0000000..ec0c4d6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemNameTag.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemPickaxe.class b/build/classes/java/patchedMc/net/minecraft/item/ItemPickaxe.class new file mode 100644 index 0000000..2d4f41d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemPickaxe.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemPiston.class b/build/classes/java/patchedMc/net/minecraft/item/ItemPiston.class new file mode 100644 index 0000000..c3eb15b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemPiston.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemPotion.class b/build/classes/java/patchedMc/net/minecraft/item/ItemPotion.class new file mode 100644 index 0000000..28c6108 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemPotion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemRecord.class b/build/classes/java/patchedMc/net/minecraft/item/ItemRecord.class new file mode 100644 index 0000000..d4d0a4f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemRecord.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemRedstone.class b/build/classes/java/patchedMc/net/minecraft/item/ItemRedstone.class new file mode 100644 index 0000000..cdda1d1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemRedstone.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemReed.class b/build/classes/java/patchedMc/net/minecraft/item/ItemReed.class new file mode 100644 index 0000000..ac99ace Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemReed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSaddle.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSaddle.class new file mode 100644 index 0000000..58c7c11 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSaddle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSeedFood.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSeedFood.class new file mode 100644 index 0000000..707b5c4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSeedFood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSeeds.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSeeds.class new file mode 100644 index 0000000..08a2e51 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSeeds.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemShears.class b/build/classes/java/patchedMc/net/minecraft/item/ItemShears.class new file mode 100644 index 0000000..81700f9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemShears.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSign.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSign.class new file mode 100644 index 0000000..d76f3d0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSimpleFoiled.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSimpleFoiled.class new file mode 100644 index 0000000..f0f041a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSimpleFoiled.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSkull.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSkull.class new file mode 100644 index 0000000..c28a2f2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSkull.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSlab.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSlab.class new file mode 100644 index 0000000..20fa7e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSlab.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSnow.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSnow.class new file mode 100644 index 0000000..c65bc13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSnow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSnowball.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSnowball.class new file mode 100644 index 0000000..5a9ad95 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSnowball.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSoup.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSoup.class new file mode 100644 index 0000000..0ec8fb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSoup.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSpade.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSpade.class new file mode 100644 index 0000000..e0b7ba9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSpade.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemStack.class b/build/classes/java/patchedMc/net/minecraft/item/ItemStack.class new file mode 100644 index 0000000..3ac55c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemStack.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemSword.class b/build/classes/java/patchedMc/net/minecraft/item/ItemSword.class new file mode 100644 index 0000000..129e80c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemSword.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemTool.class b/build/classes/java/patchedMc/net/minecraft/item/ItemTool.class new file mode 100644 index 0000000..f52f1e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemTool.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/ItemWritableBook.class b/build/classes/java/patchedMc/net/minecraft/item/ItemWritableBook.class new file mode 100644 index 0000000..79e4a6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/ItemWritableBook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager$1.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager$1.class new file mode 100644 index 0000000..96e421e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager.class new file mode 100644 index 0000000..5291c5c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/CraftingManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/FurnaceRecipes.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/FurnaceRecipes.class new file mode 100644 index 0000000..fdc3dd2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/FurnaceRecipes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/IRecipe.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/IRecipe.class new file mode 100644 index 0000000..1001bbe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/IRecipe.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeBookCloning.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeBookCloning.class new file mode 100644 index 0000000..1457225 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeBookCloning.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeFireworks.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeFireworks.class new file mode 100644 index 0000000..2db8e58 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipeFireworks.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmor.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmor.class new file mode 100644 index 0000000..f5744aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmorDyes.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmorDyes.class new file mode 100644 index 0000000..47a5340 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesArmorDyes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesCrafting.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesCrafting.class new file mode 100644 index 0000000..23b2a5b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesDyes.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesDyes.class new file mode 100644 index 0000000..c8cfdb2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesDyes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesFood.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesFood.class new file mode 100644 index 0000000..48d6de3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesFood.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesIngots.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesIngots.class new file mode 100644 index 0000000..e4d5a4d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesIngots.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapCloning.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapCloning.class new file mode 100644 index 0000000..b83f1a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapCloning.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapExtending.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapExtending.class new file mode 100644 index 0000000..d08b940 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesMapExtending.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesTools.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesTools.class new file mode 100644 index 0000000..3cf43f3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesTools.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesWeapons.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesWeapons.class new file mode 100644 index 0000000..7833073 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/RecipesWeapons.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapedRecipes.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapedRecipes.class new file mode 100644 index 0000000..1d7f7ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapedRecipes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapelessRecipes.class b/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapelessRecipes.class new file mode 100644 index 0000000..af42c1d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/item/crafting/ShapelessRecipes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/CompressedStreamTools.class b/build/classes/java/patchedMc/net/minecraft/nbt/CompressedStreamTools.class new file mode 100644 index 0000000..aab62d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/CompressedStreamTools.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Any.class b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Any.class new file mode 100644 index 0000000..bdfa282 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Any.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Compound.class b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Compound.class new file mode 100644 index 0000000..18ee4ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Compound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$List.class b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$List.class new file mode 100644 index 0000000..3ae1112 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$List.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Primitive.class b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Primitive.class new file mode 100644 index 0000000..51fa077 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT$Primitive.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT.class b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT.class new file mode 100644 index 0000000..6a329ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/JsonToNBT.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase$NBTPrimitive.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase$NBTPrimitive.class new file mode 100644 index 0000000..1444f0a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase$NBTPrimitive.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase.class new file mode 100644 index 0000000..167177a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTException.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTException.class new file mode 100644 index 0000000..1aada8a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker$1.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker$1.class new file mode 100644 index 0000000..26a0c19 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker.class new file mode 100644 index 0000000..e151e2d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTSizeTracker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByte.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByte.class new file mode 100644 index 0000000..008ad8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByte.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByteArray.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByteArray.class new file mode 100644 index 0000000..0ef4768 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagByteArray.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$1.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$1.class new file mode 100644 index 0000000..0dcc0f1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$2.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$2.class new file mode 100644 index 0000000..0662d21 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound.class new file mode 100644 index 0000000..1434a0b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagCompound.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagDouble.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagDouble.class new file mode 100644 index 0000000..3c13b23 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagDouble.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagEnd.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagEnd.class new file mode 100644 index 0000000..b955688 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagEnd.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagFloat.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagFloat.class new file mode 100644 index 0000000..749a2c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagFloat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagInt.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagInt.class new file mode 100644 index 0000000..a5e78c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagInt.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagIntArray.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagIntArray.class new file mode 100644 index 0000000..d5a6e3b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagIntArray.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagList.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagList.class new file mode 100644 index 0000000..6e2f6e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagLong.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagLong.class new file mode 100644 index 0000000..9c6d58b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagLong.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagShort.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagShort.class new file mode 100644 index 0000000..08e71d9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagShort.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagString.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagString.class new file mode 100644 index 0000000..a7d6662 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTTagString.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/nbt/NBTUtil.class b/build/classes/java/patchedMc/net/minecraft/nbt/NBTUtil.class new file mode 100644 index 0000000..0d23d49 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/nbt/NBTUtil.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$1.class b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$1.class new file mode 100644 index 0000000..985d75a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$2.class b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$2.class new file mode 100644 index 0000000..620729c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$3.class b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$3.class new file mode 100644 index 0000000..ef8225a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$4.class b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$4.class new file mode 100644 index 0000000..349cfd4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState.class b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState.class new file mode 100644 index 0000000..a45b092 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/EnumConnectionState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/INetHandler.class b/build/classes/java/patchedMc/net/minecraft/network/INetHandler.class new file mode 100644 index 0000000..1dd0790 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/INetHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$1.class b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$1.class new file mode 100644 index 0000000..b274afa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$2.class b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$2.class new file mode 100644 index 0000000..03b2776 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$SwitchEnumState.class b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$SwitchEnumState.class new file mode 100644 index 0000000..19948e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer$SwitchEnumState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer.class b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer.class new file mode 100644 index 0000000..a0d1b9f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetHandlerPlayServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingDecoder.class b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingDecoder.class new file mode 100644 index 0000000..d2f8cf4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingDecoder.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingEncoder.class b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingEncoder.class new file mode 100644 index 0000000..8e383d0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptingEncoder.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptionTranslator.class b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptionTranslator.class new file mode 100644 index 0000000..4574409 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NettyEncryptionTranslator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$1.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$1.class new file mode 100644 index 0000000..9833a89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$2.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$2.class new file mode 100644 index 0000000..98e3ff5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$3.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$3.class new file mode 100644 index 0000000..f96aa1e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener.class new file mode 100644 index 0000000..229bd1e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkManager.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager.class new file mode 100644 index 0000000..7c748a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStat.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStat.class new file mode 100644 index 0000000..ab87b66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStatData.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStatData.class new file mode 100644 index 0000000..02af250 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$PacketStatData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$Tracker.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$Tracker.class new file mode 100644 index 0000000..bd4a6dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics$Tracker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics.class new file mode 100644 index 0000000..de9b1f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkStatistics.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$1.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$1.class new file mode 100644 index 0000000..6af1db8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$2.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$2.class new file mode 100644 index 0000000..2bfc084 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$3.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$3.class new file mode 100644 index 0000000..5706082 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$4.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$4.class new file mode 100644 index 0000000..eec712d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem.class b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem.class new file mode 100644 index 0000000..1ce6a65 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/NetworkSystem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/Packet.class b/build/classes/java/patchedMc/net/minecraft/network/Packet.class new file mode 100644 index 0000000..b3de322 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/Packet.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/PacketBuffer.class b/build/classes/java/patchedMc/net/minecraft/network/PacketBuffer.class new file mode 100644 index 0000000..b91886a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/PacketBuffer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/PingResponseHandler.class b/build/classes/java/patchedMc/net/minecraft/network/PingResponseHandler.class new file mode 100644 index 0000000..5b31e8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/PingResponseHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer.class new file mode 100644 index 0000000..c28e5b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier.class new file mode 100644 index 0000000..7d7f9ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer.class new file mode 100644 index 0000000..2014267 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData.class new file mode 100644 index 0000000..657d61c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$PlayerCountData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$Serializer.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$Serializer.class new file mode 100644 index 0000000..aeeb55a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse.class b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse.class new file mode 100644 index 0000000..42a4a42 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/ServerStatusResponse.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/handshake/INetHandlerHandshakeServer.class b/build/classes/java/patchedMc/net/minecraft/network/handshake/INetHandlerHandshakeServer.class new file mode 100644 index 0000000..8b3daaa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/handshake/INetHandlerHandshakeServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/handshake/client/C00Handshake.class b/build/classes/java/patchedMc/net/minecraft/network/handshake/client/C00Handshake.class new file mode 100644 index 0000000..c20a47f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/handshake/client/C00Handshake.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginClient.class b/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginClient.class new file mode 100644 index 0000000..eb13212 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginServer.class b/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginServer.class new file mode 100644 index 0000000..53e4bb2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/INetHandlerLoginServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/client/C00PacketLoginStart.class b/build/classes/java/patchedMc/net/minecraft/network/login/client/C00PacketLoginStart.class new file mode 100644 index 0000000..628ae99 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/client/C00PacketLoginStart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/client/C01PacketEncryptionResponse.class b/build/classes/java/patchedMc/net/minecraft/network/login/client/C01PacketEncryptionResponse.class new file mode 100644 index 0000000..1abe7c6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/client/C01PacketEncryptionResponse.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/server/S00PacketDisconnect.class b/build/classes/java/patchedMc/net/minecraft/network/login/server/S00PacketDisconnect.class new file mode 100644 index 0000000..11a3a60 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/server/S00PacketDisconnect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/server/S01PacketEncryptionRequest.class b/build/classes/java/patchedMc/net/minecraft/network/login/server/S01PacketEncryptionRequest.class new file mode 100644 index 0000000..83ebee7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/server/S01PacketEncryptionRequest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/login/server/S02PacketLoginSuccess.class b/build/classes/java/patchedMc/net/minecraft/network/login/server/S02PacketLoginSuccess.class new file mode 100644 index 0000000..acc3d24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/login/server/S02PacketLoginSuccess.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayClient.class b/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayClient.class new file mode 100644 index 0000000..c9f8a6e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayServer.class b/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayServer.class new file mode 100644 index 0000000..f359113 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/INetHandlerPlayServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C00PacketKeepAlive.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C00PacketKeepAlive.class new file mode 100644 index 0000000..aca43bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C00PacketKeepAlive.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C01PacketChatMessage.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C01PacketChatMessage.class new file mode 100644 index 0000000..1b1867f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C01PacketChatMessage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity$Action.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity$Action.class new file mode 100644 index 0000000..8252caa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity$Action.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity.class new file mode 100644 index 0000000..222a494 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C02PacketUseEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition.class new file mode 100644 index 0000000..5e76a03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook.class new file mode 100644 index 0000000..f0a57de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook.class new file mode 100644 index 0000000..ecfb22e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer.class new file mode 100644 index 0000000..2dbf28f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C03PacketPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C07PacketPlayerDigging.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C07PacketPlayerDigging.class new file mode 100644 index 0000000..22c2aa8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C07PacketPlayerDigging.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.class new file mode 100644 index 0000000..b21f0b5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C09PacketHeldItemChange.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C09PacketHeldItemChange.class new file mode 100644 index 0000000..573cfdd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C09PacketHeldItemChange.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0APacketAnimation.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0APacketAnimation.class new file mode 100644 index 0000000..9238f42 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0APacketAnimation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0BPacketEntityAction.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0BPacketEntityAction.class new file mode 100644 index 0000000..c20a32b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0BPacketEntityAction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0CPacketInput.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0CPacketInput.class new file mode 100644 index 0000000..07ee3ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0CPacketInput.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0DPacketCloseWindow.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0DPacketCloseWindow.class new file mode 100644 index 0000000..11f85c7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0DPacketCloseWindow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0EPacketClickWindow.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0EPacketClickWindow.class new file mode 100644 index 0000000..5afcabf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0EPacketClickWindow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C0FPacketConfirmTransaction.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0FPacketConfirmTransaction.class new file mode 100644 index 0000000..bc81bff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C0FPacketConfirmTransaction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.class new file mode 100644 index 0000000..0a97333 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C11PacketEnchantItem.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C11PacketEnchantItem.class new file mode 100644 index 0000000..e49f306 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C11PacketEnchantItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C12PacketUpdateSign.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C12PacketUpdateSign.class new file mode 100644 index 0000000..102588f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C12PacketUpdateSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C13PacketPlayerAbilities.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C13PacketPlayerAbilities.class new file mode 100644 index 0000000..219f7ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C13PacketPlayerAbilities.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C14PacketTabComplete.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C14PacketTabComplete.class new file mode 100644 index 0000000..7d09a3b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C14PacketTabComplete.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C15PacketClientSettings.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C15PacketClientSettings.class new file mode 100644 index 0000000..7f42017 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C15PacketClientSettings.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus$EnumState.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus$EnumState.class new file mode 100644 index 0000000..5aa83ac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus$EnumState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus.class new file mode 100644 index 0000000..3c5f7e1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C16PacketClientStatus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/client/C17PacketCustomPayload.class b/build/classes/java/patchedMc/net/minecraft/network/play/client/C17PacketCustomPayload.class new file mode 100644 index 0000000..0b030b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/client/C17PacketCustomPayload.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S00PacketKeepAlive.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S00PacketKeepAlive.class new file mode 100644 index 0000000..395c3fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S00PacketKeepAlive.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S01PacketJoinGame.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S01PacketJoinGame.class new file mode 100644 index 0000000..033a66a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S01PacketJoinGame.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S02PacketChat.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S02PacketChat.class new file mode 100644 index 0000000..03d52db Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S02PacketChat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S03PacketTimeUpdate.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S03PacketTimeUpdate.class new file mode 100644 index 0000000..131f104 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S03PacketTimeUpdate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S04PacketEntityEquipment.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S04PacketEntityEquipment.class new file mode 100644 index 0000000..ed57155 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S04PacketEntityEquipment.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S05PacketSpawnPosition.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S05PacketSpawnPosition.class new file mode 100644 index 0000000..896e6f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S05PacketSpawnPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S06PacketUpdateHealth.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S06PacketUpdateHealth.class new file mode 100644 index 0000000..3ceb2ba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S06PacketUpdateHealth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S07PacketRespawn.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S07PacketRespawn.class new file mode 100644 index 0000000..cebb02d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S07PacketRespawn.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S08PacketPlayerPosLook.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S08PacketPlayerPosLook.class new file mode 100644 index 0000000..b3e4053 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S08PacketPlayerPosLook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S09PacketHeldItemChange.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S09PacketHeldItemChange.class new file mode 100644 index 0000000..889f0ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S09PacketHeldItemChange.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0APacketUseBed.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0APacketUseBed.class new file mode 100644 index 0000000..eab347b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0APacketUseBed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0BPacketAnimation.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0BPacketAnimation.class new file mode 100644 index 0000000..8db1bd3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0BPacketAnimation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0CPacketSpawnPlayer.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0CPacketSpawnPlayer.class new file mode 100644 index 0000000..a8e56bf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0CPacketSpawnPlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0DPacketCollectItem.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0DPacketCollectItem.class new file mode 100644 index 0000000..26d187f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0DPacketCollectItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0EPacketSpawnObject.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0EPacketSpawnObject.class new file mode 100644 index 0000000..6fc4698 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0EPacketSpawnObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S0FPacketSpawnMob.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0FPacketSpawnMob.class new file mode 100644 index 0000000..c2b9347 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S0FPacketSpawnMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S10PacketSpawnPainting.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S10PacketSpawnPainting.class new file mode 100644 index 0000000..81b0f41 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S10PacketSpawnPainting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.class new file mode 100644 index 0000000..2ced01d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S12PacketEntityVelocity.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S12PacketEntityVelocity.class new file mode 100644 index 0000000..86147e0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S12PacketEntityVelocity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S13PacketDestroyEntities.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S13PacketDestroyEntities.class new file mode 100644 index 0000000..8bc9158 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S13PacketDestroyEntities.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove.class new file mode 100644 index 0000000..60f634d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook.class new file mode 100644 index 0000000..04567c7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove.class new file mode 100644 index 0000000..9e8d2e2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity.class new file mode 100644 index 0000000..bcf71c4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S14PacketEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S18PacketEntityTeleport.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S18PacketEntityTeleport.class new file mode 100644 index 0000000..7c5f1fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S18PacketEntityTeleport.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityHeadLook.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityHeadLook.class new file mode 100644 index 0000000..d1475ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityHeadLook.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityStatus.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityStatus.class new file mode 100644 index 0000000..5319cf0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S19PacketEntityStatus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S1BPacketEntityAttach.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1BPacketEntityAttach.class new file mode 100644 index 0000000..3287377 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1BPacketEntityAttach.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S1CPacketEntityMetadata.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1CPacketEntityMetadata.class new file mode 100644 index 0000000..87676b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1CPacketEntityMetadata.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S1DPacketEntityEffect.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1DPacketEntityEffect.class new file mode 100644 index 0000000..0f46af5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1DPacketEntityEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.class new file mode 100644 index 0000000..9f8dfac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S1FPacketSetExperience.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1FPacketSetExperience.class new file mode 100644 index 0000000..c8e0ed1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S1FPacketSetExperience.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot.class new file mode 100644 index 0000000..003e553 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties.class new file mode 100644 index 0000000..0179e7f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S20PacketEntityProperties.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData$Extracted.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData$Extracted.class new file mode 100644 index 0000000..3a75368 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData$Extracted.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData.class new file mode 100644 index 0000000..c76d6df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S21PacketChunkData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S22PacketMultiBlockChange.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S22PacketMultiBlockChange.class new file mode 100644 index 0000000..825140a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S22PacketMultiBlockChange.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S23PacketBlockChange.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S23PacketBlockChange.class new file mode 100644 index 0000000..8696cf6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S23PacketBlockChange.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S24PacketBlockAction.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S24PacketBlockAction.class new file mode 100644 index 0000000..b2aa8cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S24PacketBlockAction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S25PacketBlockBreakAnim.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S25PacketBlockBreakAnim.class new file mode 100644 index 0000000..7901a0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S25PacketBlockBreakAnim.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S26PacketMapChunkBulk.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S26PacketMapChunkBulk.class new file mode 100644 index 0000000..ea12b91 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S26PacketMapChunkBulk.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S27PacketExplosion.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S27PacketExplosion.class new file mode 100644 index 0000000..12410fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S27PacketExplosion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S28PacketEffect.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S28PacketEffect.class new file mode 100644 index 0000000..d3b0923 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S28PacketEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S29PacketSoundEffect.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S29PacketSoundEffect.class new file mode 100644 index 0000000..9efbf85 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S29PacketSoundEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2APacketParticles.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2APacketParticles.class new file mode 100644 index 0000000..63dcef7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2APacketParticles.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2BPacketChangeGameState.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2BPacketChangeGameState.class new file mode 100644 index 0000000..bf1f3f6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2BPacketChangeGameState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.class new file mode 100644 index 0000000..482a6c3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2DPacketOpenWindow.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2DPacketOpenWindow.class new file mode 100644 index 0000000..663f6cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2DPacketOpenWindow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2EPacketCloseWindow.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2EPacketCloseWindow.class new file mode 100644 index 0000000..86c984a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2EPacketCloseWindow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S2FPacketSetSlot.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2FPacketSetSlot.class new file mode 100644 index 0000000..2d3d6f4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S2FPacketSetSlot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S30PacketWindowItems.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S30PacketWindowItems.class new file mode 100644 index 0000000..9b9693d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S30PacketWindowItems.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S31PacketWindowProperty.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S31PacketWindowProperty.class new file mode 100644 index 0000000..2d30bfb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S31PacketWindowProperty.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S32PacketConfirmTransaction.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S32PacketConfirmTransaction.class new file mode 100644 index 0000000..817b710 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S32PacketConfirmTransaction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S33PacketUpdateSign.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S33PacketUpdateSign.class new file mode 100644 index 0000000..3ae3921 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S33PacketUpdateSign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S34PacketMaps.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S34PacketMaps.class new file mode 100644 index 0000000..6b7bf7b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S34PacketMaps.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S35PacketUpdateTileEntity.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S35PacketUpdateTileEntity.class new file mode 100644 index 0000000..a4316ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S35PacketUpdateTileEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S36PacketSignEditorOpen.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S36PacketSignEditorOpen.class new file mode 100644 index 0000000..464a1fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S36PacketSignEditorOpen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S37PacketStatistics.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S37PacketStatistics.class new file mode 100644 index 0000000..d7a36b5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S37PacketStatistics.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S38PacketPlayerListItem.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S38PacketPlayerListItem.class new file mode 100644 index 0000000..81aee13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S38PacketPlayerListItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S39PacketPlayerAbilities.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S39PacketPlayerAbilities.class new file mode 100644 index 0000000..87bef15 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S39PacketPlayerAbilities.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3APacketTabComplete.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3APacketTabComplete.class new file mode 100644 index 0000000..4b5f7fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3APacketTabComplete.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3BPacketScoreboardObjective.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3BPacketScoreboardObjective.class new file mode 100644 index 0000000..6505452 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3BPacketScoreboardObjective.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3CPacketUpdateScore.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3CPacketUpdateScore.class new file mode 100644 index 0000000..4411b79 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3CPacketUpdateScore.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.class new file mode 100644 index 0000000..828f5f9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3EPacketTeams.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3EPacketTeams.class new file mode 100644 index 0000000..3e679b7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3EPacketTeams.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S3FPacketCustomPayload.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3FPacketCustomPayload.class new file mode 100644 index 0000000..2c0d6e1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S3FPacketCustomPayload.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/play/server/S40PacketDisconnect.class b/build/classes/java/patchedMc/net/minecraft/network/play/server/S40PacketDisconnect.class new file mode 100644 index 0000000..5e849be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/play/server/S40PacketDisconnect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/IServer.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/IServer.class new file mode 100644 index 0000000..f7195c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/IServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConConsoleSource.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConConsoleSource.class new file mode 100644 index 0000000..901bb4b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConConsoleSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConOutputStream.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConOutputStream.class new file mode 100644 index 0000000..ed421d2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConOutputStream.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadBase.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadBase.class new file mode 100644 index 0000000..b6a8e96 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadClient.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadClient.class new file mode 100644 index 0000000..327adfd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadMain.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadMain.class new file mode 100644 index 0000000..adbb9fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadMain.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery$Auth.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery$Auth.class new file mode 100644 index 0000000..e6ca645 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery$Auth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery.class new file mode 100644 index 0000000..46c65dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConThreadQuery.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/rcon/RConUtils.class b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConUtils.class new file mode 100644 index 0000000..39d2c89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/rcon/RConUtils.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusClient.class b/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusClient.class new file mode 100644 index 0000000..f3a4245 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusServer.class b/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusServer.class new file mode 100644 index 0000000..7500157 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/INetHandlerStatusServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/client/C00PacketServerQuery.class b/build/classes/java/patchedMc/net/minecraft/network/status/client/C00PacketServerQuery.class new file mode 100644 index 0000000..8908c48 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/client/C00PacketServerQuery.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/client/C01PacketPing.class b/build/classes/java/patchedMc/net/minecraft/network/status/client/C01PacketPing.class new file mode 100644 index 0000000..1217a69 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/client/C01PacketPing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/server/S00PacketServerInfo.class b/build/classes/java/patchedMc/net/minecraft/network/status/server/S00PacketServerInfo.class new file mode 100644 index 0000000..d5dd0d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/server/S00PacketServerInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/network/status/server/S01PacketPong.class b/build/classes/java/patchedMc/net/minecraft/network/status/server/S01PacketPong.class new file mode 100644 index 0000000..bf887a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/network/status/server/S01PacketPong.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/pathfinding/Path.class b/build/classes/java/patchedMc/net/minecraft/pathfinding/Path.class new file mode 100644 index 0000000..dd85912 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/pathfinding/Path.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/pathfinding/PathEntity.class b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathEntity.class new file mode 100644 index 0000000..7309bca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/pathfinding/PathFinder.class b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathFinder.class new file mode 100644 index 0000000..da2e7ba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathFinder.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/pathfinding/PathNavigate.class b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathNavigate.class new file mode 100644 index 0000000..ae813bf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathNavigate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/pathfinding/PathPoint.class b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathPoint.class new file mode 100644 index 0000000..666138d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/pathfinding/PathPoint.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/Potion.class b/build/classes/java/patchedMc/net/minecraft/potion/Potion.class new file mode 100644 index 0000000..86f8119 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/Potion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionAbsoption.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionAbsoption.class new file mode 100644 index 0000000..6b21dc2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionAbsoption.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionAttackDamage.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionAttackDamage.class new file mode 100644 index 0000000..d5a95de Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionAttackDamage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionEffect.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionEffect.class new file mode 100644 index 0000000..3faf067 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionEffect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionHealth.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionHealth.class new file mode 100644 index 0000000..8b03088 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionHealth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionHealthBoost.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionHealthBoost.class new file mode 100644 index 0000000..2c19d00 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionHealthBoost.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/potion/PotionHelper.class b/build/classes/java/patchedMc/net/minecraft/potion/PotionHelper.class new file mode 100644 index 0000000..08c56eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/potion/PotionHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/profiler/IPlayerUsage.class b/build/classes/java/patchedMc/net/minecraft/profiler/IPlayerUsage.class new file mode 100644 index 0000000..d3f8b41 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/profiler/IPlayerUsage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper$1.class b/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper$1.class new file mode 100644 index 0000000..c7ee618 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper.class b/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper.class new file mode 100644 index 0000000..edcc16f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/profiler/PlayerUsageSnooper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/profiler/Profiler$Result.class b/build/classes/java/patchedMc/net/minecraft/profiler/Profiler$Result.class new file mode 100644 index 0000000..1dc7b92 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/profiler/Profiler$Result.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/profiler/Profiler.class b/build/classes/java/patchedMc/net/minecraft/profiler/Profiler.class new file mode 100644 index 0000000..e303079 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/profiler/Profiler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/DisconnectedOnlineScreen.class b/build/classes/java/patchedMc/net/minecraft/realms/DisconnectedOnlineScreen.class new file mode 100644 index 0000000..96025c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/DisconnectedOnlineScreen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/Realms.class b/build/classes/java/patchedMc/net/minecraft/realms/Realms.class new file mode 100644 index 0000000..0fea1df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/Realms.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsAnvilLevelStorageSource.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsAnvilLevelStorageSource.class new file mode 100644 index 0000000..fc5c9e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsAnvilLevelStorageSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsBridge.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsBridge.class new file mode 100644 index 0000000..4e85539 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsBridge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsButton.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsButton.class new file mode 100644 index 0000000..04cb527 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect$1.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect$1.class new file mode 100644 index 0000000..14d3366 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect.class new file mode 100644 index 0000000..e962e94 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsConnect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsEditBox.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsEditBox.class new file mode 100644 index 0000000..67b2ec7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsEditBox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsLevelSummary.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsLevelSummary.class new file mode 100644 index 0000000..2b54626 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsLevelSummary.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsMth.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsMth.class new file mode 100644 index 0000000..5603405 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsMth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsScreen.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsScreen.class new file mode 100644 index 0000000..1607cb5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsScreen.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsScrolledSelectionList.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsScrolledSelectionList.class new file mode 100644 index 0000000..0eb286c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsScrolledSelectionList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerAddress.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerAddress.class new file mode 100644 index 0000000..9fca7f4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerAddress.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger$1.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger$1.class new file mode 100644 index 0000000..a91d0b2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger.class new file mode 100644 index 0000000..b29093b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsServerStatusPinger.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsSharedConstants.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsSharedConstants.class new file mode 100644 index 0000000..a0bf2d2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsSharedConstants.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RealmsSliderButton.class b/build/classes/java/patchedMc/net/minecraft/realms/RealmsSliderButton.class new file mode 100644 index 0000000..7f3324e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RealmsSliderButton.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/RendererUtility.class b/build/classes/java/patchedMc/net/minecraft/realms/RendererUtility.class new file mode 100644 index 0000000..b5ef25b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/RendererUtility.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/ServerPing.class b/build/classes/java/patchedMc/net/minecraft/realms/ServerPing.class new file mode 100644 index 0000000..08dfa29 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/ServerPing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/realms/Tezzelator.class b/build/classes/java/patchedMc/net/minecraft/realms/Tezzelator.class new file mode 100644 index 0000000..ef1452f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/realms/Tezzelator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/IScoreObjectiveCriteria.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/IScoreObjectiveCriteria.class new file mode 100644 index 0000000..f80711d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/IScoreObjectiveCriteria.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/Score$1.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/Score$1.class new file mode 100644 index 0000000..3755174 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/Score$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/Score.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/Score.class new file mode 100644 index 0000000..81afb2b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/Score.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreDummyCriteria.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreDummyCriteria.class new file mode 100644 index 0000000..e188b96 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreDummyCriteria.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreHealthCriteria.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreHealthCriteria.class new file mode 100644 index 0000000..4e48aa0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreHealthCriteria.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreObjective.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreObjective.class new file mode 100644 index 0000000..9f095c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreObjective.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ScorePlayerTeam.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScorePlayerTeam.class new file mode 100644 index 0000000..ef3cab9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScorePlayerTeam.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/Scoreboard.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/Scoreboard.class new file mode 100644 index 0000000..04f5b46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/Scoreboard.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreboardSaveData.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreboardSaveData.class new file mode 100644 index 0000000..2ff89fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ScoreboardSaveData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/ServerScoreboard.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/ServerScoreboard.class new file mode 100644 index 0000000..26cdb40 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/ServerScoreboard.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/scoreboard/Team.class b/build/classes/java/patchedMc/net/minecraft/scoreboard/Team.class new file mode 100644 index 0000000..070c16c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/scoreboard/Team.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$1.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$1.class new file mode 100644 index 0000000..a8bba3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$2.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$2.class new file mode 100644 index 0000000..c725296 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$3.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$3.class new file mode 100644 index 0000000..8ddd591 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$4.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$4.class new file mode 100644 index 0000000..a0fc238 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$5.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$5.class new file mode 100644 index 0000000..a57ee28 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$6.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$6.class new file mode 100644 index 0000000..b153008 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer.class b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer.class new file mode 100644 index 0000000..962f364 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/MinecraftServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/ServerEula.class b/build/classes/java/patchedMc/net/minecraft/server/ServerEula.class new file mode 100644 index 0000000..8f4afb9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/ServerEula.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedPlayerList.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedPlayerList.class new file mode 100644 index 0000000..ff38e48 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedPlayerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$1.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$1.class new file mode 100644 index 0000000..7bad1dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$2.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$2.class new file mode 100644 index 0000000..b577183 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$3.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$3.class new file mode 100644 index 0000000..6edb606 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$4.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$4.class new file mode 100644 index 0000000..08febc0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer.class new file mode 100644 index 0000000..056326e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/DedicatedServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/dedicated/PropertyManager.class b/build/classes/java/patchedMc/net/minecraft/server/dedicated/PropertyManager.class new file mode 100644 index 0000000..c048beb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/dedicated/PropertyManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/IUpdatePlayerListBox.class b/build/classes/java/patchedMc/net/minecraft/server/gui/IUpdatePlayerListBox.class new file mode 100644 index 0000000..4f85f08 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/IUpdatePlayerListBox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$1.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$1.class new file mode 100644 index 0000000..8e76648 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$2.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$2.class new file mode 100644 index 0000000..79f99ad Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$3.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$3.class new file mode 100644 index 0000000..06b9053 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$4.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$4.class new file mode 100644 index 0000000..6ab5aa2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$5.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$5.class new file mode 100644 index 0000000..072e7e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui.class b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui.class new file mode 100644 index 0000000..24280eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/MinecraftServerGui.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/PlayerListComponent.class b/build/classes/java/patchedMc/net/minecraft/server/gui/PlayerListComponent.class new file mode 100644 index 0000000..7a6df81 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/PlayerListComponent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent$1.class b/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent$1.class new file mode 100644 index 0000000..bf84dbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent.class b/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent.class new file mode 100644 index 0000000..8f51862 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/gui/StatsComponent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedPlayerList.class b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedPlayerList.class new file mode 100644 index 0000000..599cb1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedPlayerList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$1.class b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$1.class new file mode 100644 index 0000000..3c55d15 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$2.class b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$2.class new file mode 100644 index 0000000..b2b7a34 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer.class b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer.class new file mode 100644 index 0000000..7df194b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/integrated/IntegratedServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/BanEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/BanEntry.class new file mode 100644 index 0000000..227ff26 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/BanEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/BanList.class b/build/classes/java/patchedMc/net/minecraft/server/management/BanList.class new file mode 100644 index 0000000..1d9d99e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/BanList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/IPBanEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/IPBanEntry.class new file mode 100644 index 0000000..c3b1a27 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/IPBanEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/ItemInWorldManager.class b/build/classes/java/patchedMc/net/minecraft/server/management/ItemInWorldManager.class new file mode 100644 index 0000000..a82756e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/ItemInWorldManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/LowerStringMap.class b/build/classes/java/patchedMc/net/minecraft/server/management/LowerStringMap.class new file mode 100644 index 0000000..4168a42 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/LowerStringMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$1.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$1.class new file mode 100644 index 0000000..c72f06d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$2.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$2.class new file mode 100644 index 0000000..d4e9852 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance.class new file mode 100644 index 0000000..6bf904e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager$PlayerInstance.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager.class new file mode 100644 index 0000000..25d92fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerPositionComparator.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerPositionComparator.class new file mode 100644 index 0000000..92b97b7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerPositionComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$1.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$1.class new file mode 100644 index 0000000..c6ba0a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$2.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$2.class new file mode 100644 index 0000000..05a390c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$ProfileEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$ProfileEntry.class new file mode 100644 index 0000000..58747d6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$ProfileEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$Serializer.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$Serializer.class new file mode 100644 index 0000000..045483f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache.class b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache.class new file mode 100644 index 0000000..cbaa9c1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PlayerProfileCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$1.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$1.class new file mode 100644 index 0000000..a8b6e89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$2.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$2.class new file mode 100644 index 0000000..29c186d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$3.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$3.class new file mode 100644 index 0000000..71c0062 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$4.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$4.class new file mode 100644 index 0000000..a2aec11 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$5.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$5.class new file mode 100644 index 0000000..38587b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$6.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$6.class new file mode 100644 index 0000000..502533a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$7.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$7.class new file mode 100644 index 0000000..f036e11 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$ConversionError.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$ConversionError.class new file mode 100644 index 0000000..5e7f076 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter$ConversionError.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter.class b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter.class new file mode 100644 index 0000000..815fb03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/PreYggdrasilConverter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/ServerConfigurationManager.class b/build/classes/java/patchedMc/net/minecraft/server/management/ServerConfigurationManager.class new file mode 100644 index 0000000..7452483 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/ServerConfigurationManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserList$1.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserList$1.class new file mode 100644 index 0000000..c06ea6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserList$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserList$Serializer.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserList$Serializer.class new file mode 100644 index 0000000..146ab3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserList$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserList.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserList.class new file mode 100644 index 0000000..fc6513d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListBans.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListBans.class new file mode 100644 index 0000000..7baf571 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListBans.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListBansEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListBansEntry.class new file mode 100644 index 0000000..bc3ffc1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListBansEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListEntry.class new file mode 100644 index 0000000..f74ec19 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListOps.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListOps.class new file mode 100644 index 0000000..4d7e1ca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListOps.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListOpsEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListOpsEntry.class new file mode 100644 index 0000000..86f81b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListOpsEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelist.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelist.class new file mode 100644 index 0000000..86afcaf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelist.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelistEntry.class b/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelistEntry.class new file mode 100644 index 0000000..fa9126f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/management/UserListWhitelistEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState.class new file mode 100644 index 0000000..ac9dd14 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP.class new file mode 100644 index 0000000..85be842 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerHandshakeTCP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$1.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$1.class new file mode 100644 index 0000000..d9b627c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$LoginState.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$LoginState.class new file mode 100644 index 0000000..7d19662 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer$LoginState.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer.class new file mode 100644 index 0000000..714848d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerLoginServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerStatusServer.class b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerStatusServer.class new file mode 100644 index 0000000..e648273 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/server/network/NetHandlerStatusServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/src/FMLRenderAccessLibrary.class b/build/classes/java/patchedMc/net/minecraft/src/FMLRenderAccessLibrary.class new file mode 100644 index 0000000..1afa11d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/src/FMLRenderAccessLibrary.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/Achievement.class b/build/classes/java/patchedMc/net/minecraft/stats/Achievement.class new file mode 100644 index 0000000..d8388a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/Achievement.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/AchievementList.class b/build/classes/java/patchedMc/net/minecraft/stats/AchievementList.class new file mode 100644 index 0000000..6b0d354 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/AchievementList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/IStatStringFormat.class b/build/classes/java/patchedMc/net/minecraft/stats/IStatStringFormat.class new file mode 100644 index 0000000..451a16a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/IStatStringFormat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/IStatType.class b/build/classes/java/patchedMc/net/minecraft/stats/IStatType.class new file mode 100644 index 0000000..6d2eaba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/IStatType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/ObjectiveStat.class b/build/classes/java/patchedMc/net/minecraft/stats/ObjectiveStat.class new file mode 100644 index 0000000..080d603 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/ObjectiveStat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBase$1.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$1.class new file mode 100644 index 0000000..2f7f885 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBase$2.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$2.class new file mode 100644 index 0000000..e6c895b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBase$3.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$3.class new file mode 100644 index 0000000..a3d9480 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBase$4.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$4.class new file mode 100644 index 0000000..428fc71 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBase$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBase.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBase.class new file mode 100644 index 0000000..76a0e65 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatBasic.class b/build/classes/java/patchedMc/net/minecraft/stats/StatBasic.class new file mode 100644 index 0000000..9ed27a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatBasic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatCrafting.class b/build/classes/java/patchedMc/net/minecraft/stats/StatCrafting.class new file mode 100644 index 0000000..391b100 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatCrafting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatFileWriter.class b/build/classes/java/patchedMc/net/minecraft/stats/StatFileWriter.class new file mode 100644 index 0000000..ecf85c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatFileWriter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatList.class b/build/classes/java/patchedMc/net/minecraft/stats/StatList.class new file mode 100644 index 0000000..60b0e22 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/stats/StatisticsFile.class b/build/classes/java/patchedMc/net/minecraft/stats/StatisticsFile.class new file mode 100644 index 0000000..6433769 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/stats/StatisticsFile.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/IHopper.class b/build/classes/java/patchedMc/net/minecraft/tileentity/IHopper.class new file mode 100644 index 0000000..61c49bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/IHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart.class b/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart.class new file mode 100644 index 0000000..9d99db0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic.class b/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic.class new file mode 100644 index 0000000..d5f9477 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/MobSpawnerBaseLogic.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$1.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$1.class new file mode 100644 index 0000000..7dee247 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$2.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$2.class new file mode 100644 index 0000000..e28293b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$3.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$3.class new file mode 100644 index 0000000..d794eae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity.class new file mode 100644 index 0000000..1306a13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntity.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBeacon.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBeacon.class new file mode 100644 index 0000000..191adc6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBeacon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBrewingStand.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBrewingStand.class new file mode 100644 index 0000000..5a12b26 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityBrewingStand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityChest.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityChest.class new file mode 100644 index 0000000..98e62f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock$1.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock$1.class new file mode 100644 index 0000000..b0b8430 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock.class new file mode 100644 index 0000000..d2888d2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityCommandBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityComparator.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityComparator.class new file mode 100644 index 0000000..a5ed455 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDaylightDetector.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDaylightDetector.class new file mode 100644 index 0000000..8a805df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDaylightDetector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDispenser.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDispenser.class new file mode 100644 index 0000000..978de8e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDispenser.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDropper.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDropper.class new file mode 100644 index 0000000..6282f32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityDropper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnchantmentTable.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnchantmentTable.class new file mode 100644 index 0000000..89eb9fd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnchantmentTable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEndPortal.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEndPortal.class new file mode 100644 index 0000000..e9b7e28 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEndPortal.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnderChest.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnderChest.class new file mode 100644 index 0000000..8cd3620 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityEnderChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFlowerPot.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFlowerPot.class new file mode 100644 index 0000000..8b7567f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFlowerPot.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFurnace.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFurnace.class new file mode 100644 index 0000000..b05313b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityFurnace.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityHopper.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityHopper.class new file mode 100644 index 0000000..201d9a8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityHopper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner$1.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner$1.class new file mode 100644 index 0000000..9bc8165 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner.class new file mode 100644 index 0000000..7344849 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityMobSpawner.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityNote.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityNote.class new file mode 100644 index 0000000..5698dbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityNote.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityPiston.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityPiston.class new file mode 100644 index 0000000..e1c5879 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntityPiston.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySign.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySign.class new file mode 100644 index 0000000..3941837 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySign.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySkull.class b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySkull.class new file mode 100644 index 0000000..6539cba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/tileentity/TileEntitySkull.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/AxisAlignedBB.class b/build/classes/java/patchedMc/net/minecraft/util/AxisAlignedBB.class new file mode 100644 index 0000000..0378f01 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/AxisAlignedBB.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatAllowedCharacters.class b/build/classes/java/patchedMc/net/minecraft/util/ChatAllowedCharacters.class new file mode 100644 index 0000000..0d3aeba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatAllowedCharacters.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$1.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$1.class new file mode 100644 index 0000000..2ebd1c7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$2.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$2.class new file mode 100644 index 0000000..c1eebcf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle.class new file mode 100644 index 0000000..c31e5d8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentStyle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentText.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentText.class new file mode 100644 index 0000000..3ed092d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentText.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslation.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslation.class new file mode 100644 index 0000000..66daa24 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslationFormatException.class b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslationFormatException.class new file mode 100644 index 0000000..0268fc9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatComponentTranslationFormatException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$1.class b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$1.class new file mode 100644 index 0000000..3c444fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$Serializer.class b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$Serializer.class new file mode 100644 index 0000000..e3361fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChatStyle.class b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle.class new file mode 100644 index 0000000..fc704c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChatStyle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ChunkCoordinates.class b/build/classes/java/patchedMc/net/minecraft/util/ChunkCoordinates.class new file mode 100644 index 0000000..42ede67 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ChunkCoordinates.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/CombatEntry.class b/build/classes/java/patchedMc/net/minecraft/util/CombatEntry.class new file mode 100644 index 0000000..2979ebc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/CombatEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/CombatTracker.class b/build/classes/java/patchedMc/net/minecraft/util/CombatTracker.class new file mode 100644 index 0000000..aa6a824 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/CombatTracker.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/CryptManager.class b/build/classes/java/patchedMc/net/minecraft/util/CryptManager.class new file mode 100644 index 0000000..553bd66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/CryptManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/DamageSource.class b/build/classes/java/patchedMc/net/minecraft/util/DamageSource.class new file mode 100644 index 0000000..cd7ec1c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/DamageSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Direction.class b/build/classes/java/patchedMc/net/minecraft/util/Direction.class new file mode 100644 index 0000000..73f1ef8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Direction.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EnchantmentNameParts.class b/build/classes/java/patchedMc/net/minecraft/util/EnchantmentNameParts.class new file mode 100644 index 0000000..b5a9564 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EnchantmentNameParts.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSource.class b/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSource.class new file mode 100644 index 0000000..36b74c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSource.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSourceIndirect.class b/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSourceIndirect.class new file mode 100644 index 0000000..bedde43 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EntityDamageSourceIndirect.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EnumChatFormatting.class b/build/classes/java/patchedMc/net/minecraft/util/EnumChatFormatting.class new file mode 100644 index 0000000..d02051c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EnumChatFormatting.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EnumFacing.class b/build/classes/java/patchedMc/net/minecraft/util/EnumFacing.class new file mode 100644 index 0000000..21983ca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EnumFacing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory$1.class b/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory$1.class new file mode 100644 index 0000000..5b3842a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory.class b/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory.class new file mode 100644 index 0000000..7d8f5f4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/EnumTypeAdapterFactory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Facing.class b/build/classes/java/patchedMc/net/minecraft/util/Facing.class new file mode 100644 index 0000000..4797cf7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Facing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/FoodStats.class b/build/classes/java/patchedMc/net/minecraft/util/FoodStats.class new file mode 100644 index 0000000..024390f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/FoodStats.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$1.class b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$1.class new file mode 100644 index 0000000..6ad425f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$DownloadListener.class b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$DownloadListener.class new file mode 100644 index 0000000..2b0d0e6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil$DownloadListener.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/HttpUtil.class b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil.class new file mode 100644 index 0000000..79dadcb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/HttpUtil.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IChatComponent$Serializer.class b/build/classes/java/patchedMc/net/minecraft/util/IChatComponent$Serializer.class new file mode 100644 index 0000000..6ef132e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IChatComponent$Serializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IChatComponent.class b/build/classes/java/patchedMc/net/minecraft/util/IChatComponent.class new file mode 100644 index 0000000..1bf0817 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IChatComponent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IIcon.class b/build/classes/java/patchedMc/net/minecraft/util/IIcon.class new file mode 100644 index 0000000..37eea0a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IIcon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IJsonSerializable.class b/build/classes/java/patchedMc/net/minecraft/util/IJsonSerializable.class new file mode 100644 index 0000000..d808172 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IJsonSerializable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IObjectIntIterable.class b/build/classes/java/patchedMc/net/minecraft/util/IObjectIntIterable.class new file mode 100644 index 0000000..9146902 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IObjectIntIterable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IProgressUpdate.class b/build/classes/java/patchedMc/net/minecraft/util/IProgressUpdate.class new file mode 100644 index 0000000..4046e4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IProgressUpdate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IRegistry.class b/build/classes/java/patchedMc/net/minecraft/util/IRegistry.class new file mode 100644 index 0000000..41c664a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IRegistry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IntHashMap$Entry.class b/build/classes/java/patchedMc/net/minecraft/util/IntHashMap$Entry.class new file mode 100644 index 0000000..77435c4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IntHashMap$Entry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/IntHashMap.class b/build/classes/java/patchedMc/net/minecraft/util/IntHashMap.class new file mode 100644 index 0000000..5d242b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/IntHashMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/JsonSerializableSet.class b/build/classes/java/patchedMc/net/minecraft/util/JsonSerializableSet.class new file mode 100644 index 0000000..a5ddf77 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/JsonSerializableSet.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/JsonUtils.class b/build/classes/java/patchedMc/net/minecraft/util/JsonUtils.class new file mode 100644 index 0000000..734180a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/JsonUtils.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/LongHashMap$Entry.class b/build/classes/java/patchedMc/net/minecraft/util/LongHashMap$Entry.class new file mode 100644 index 0000000..b0830a4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/LongHashMap$Entry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/LongHashMap.class b/build/classes/java/patchedMc/net/minecraft/util/LongHashMap.class new file mode 100644 index 0000000..128a19b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/LongHashMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MathHelper.class b/build/classes/java/patchedMc/net/minecraft/util/MathHelper.class new file mode 100644 index 0000000..2d6db6d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MathHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer.class b/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer.class new file mode 100644 index 0000000..cc1eb3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer2.class b/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer2.class new file mode 100644 index 0000000..33d780e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MessageDeserializer2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer.class b/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer.class new file mode 100644 index 0000000..66de015 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer2.class b/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer2.class new file mode 100644 index 0000000..9e0d674 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MessageSerializer2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MinecraftError.class b/build/classes/java/patchedMc/net/minecraft/util/MinecraftError.class new file mode 100644 index 0000000..187bf2b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MinecraftError.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MouseFilter.class b/build/classes/java/patchedMc/net/minecraft/util/MouseFilter.class new file mode 100644 index 0000000..1cd27ac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MouseFilter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MouseHelper.class b/build/classes/java/patchedMc/net/minecraft/util/MouseHelper.class new file mode 100644 index 0000000..6ee50ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MouseHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MovementInput.class b/build/classes/java/patchedMc/net/minecraft/util/MovementInput.class new file mode 100644 index 0000000..a0764c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MovementInput.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MovementInputFromOptions.class b/build/classes/java/patchedMc/net/minecraft/util/MovementInputFromOptions.class new file mode 100644 index 0000000..847121f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MovementInputFromOptions.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition$MovingObjectType.class b/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition$MovingObjectType.class new file mode 100644 index 0000000..b67bd7c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition$MovingObjectType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition.class b/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition.class new file mode 100644 index 0000000..0719bbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/MovingObjectPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ObjectIntIdentityMap.class b/build/classes/java/patchedMc/net/minecraft/util/ObjectIntIdentityMap.class new file mode 100644 index 0000000..1080543 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ObjectIntIdentityMap.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/RegistryDefaulted.class b/build/classes/java/patchedMc/net/minecraft/util/RegistryDefaulted.class new file mode 100644 index 0000000..33168d1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/RegistryDefaulted.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespaced.class b/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespaced.class new file mode 100644 index 0000000..3b7551f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespaced.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespacedDefaultedByKey.class b/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespacedDefaultedByKey.class new file mode 100644 index 0000000..134de3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/RegistryNamespacedDefaultedByKey.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/RegistrySimple.class b/build/classes/java/patchedMc/net/minecraft/util/RegistrySimple.class new file mode 100644 index 0000000..2210be2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/RegistrySimple.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ReportedException.class b/build/classes/java/patchedMc/net/minecraft/util/ReportedException.class new file mode 100644 index 0000000..37fed0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ReportedException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ResourceLocation.class b/build/classes/java/patchedMc/net/minecraft/util/ResourceLocation.class new file mode 100644 index 0000000..875acb9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ResourceLocation.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ScreenShotHelper.class b/build/classes/java/patchedMc/net/minecraft/util/ScreenShotHelper.class new file mode 100644 index 0000000..f20971f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ScreenShotHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Session$Type.class b/build/classes/java/patchedMc/net/minecraft/util/Session$Type.class new file mode 100644 index 0000000..3f0da59 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Session$Type.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Session.class b/build/classes/java/patchedMc/net/minecraft/util/Session.class new file mode 100644 index 0000000..8458d04 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Session.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/StatCollector.class b/build/classes/java/patchedMc/net/minecraft/util/StatCollector.class new file mode 100644 index 0000000..def3936 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/StatCollector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/StringTranslate.class b/build/classes/java/patchedMc/net/minecraft/util/StringTranslate.class new file mode 100644 index 0000000..d850694 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/StringTranslate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/StringUtils.class b/build/classes/java/patchedMc/net/minecraft/util/StringUtils.class new file mode 100644 index 0000000..0bad502 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/StringUtils.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/ThreadSafeBoundList.class b/build/classes/java/patchedMc/net/minecraft/util/ThreadSafeBoundList.class new file mode 100644 index 0000000..c38a458 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/ThreadSafeBoundList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Timer.class b/build/classes/java/patchedMc/net/minecraft/util/Timer.class new file mode 100644 index 0000000..9495b71 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Timer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Tuple.class b/build/classes/java/patchedMc/net/minecraft/util/Tuple.class new file mode 100644 index 0000000..ab17cbb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Tuple.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/TupleIntJsonSerializable.class b/build/classes/java/patchedMc/net/minecraft/util/TupleIntJsonSerializable.class new file mode 100644 index 0000000..3e35b6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/TupleIntJsonSerializable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Util$EnumOS.class b/build/classes/java/patchedMc/net/minecraft/util/Util$EnumOS.class new file mode 100644 index 0000000..9cbf5f0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Util$EnumOS.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Util.class b/build/classes/java/patchedMc/net/minecraft/util/Util.class new file mode 100644 index 0000000..a381f03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Util.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/Vec3.class b/build/classes/java/patchedMc/net/minecraft/util/Vec3.class new file mode 100644 index 0000000..aed2319 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/Vec3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom$Item.class b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom$Item.class new file mode 100644 index 0000000..6f137f0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom$Item.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom.class b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom.class new file mode 100644 index 0000000..b46da19 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomChestContent.class b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomChestContent.class new file mode 100644 index 0000000..2aec357 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomChestContent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomFishable.class b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomFishable.class new file mode 100644 index 0000000..a897721 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/util/WeightedRandomFishable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipe.class b/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipe.class new file mode 100644 index 0000000..93a433e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipe.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipeList.class b/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipeList.class new file mode 100644 index 0000000..49d5b57 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/MerchantRecipeList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/Village$VillageAgressor.class b/build/classes/java/patchedMc/net/minecraft/village/Village$VillageAgressor.class new file mode 100644 index 0000000..5ac7255 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/Village$VillageAgressor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/Village.class b/build/classes/java/patchedMc/net/minecraft/village/Village.class new file mode 100644 index 0000000..dd2bc62 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/Village.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/VillageCollection.class b/build/classes/java/patchedMc/net/minecraft/village/VillageCollection.class new file mode 100644 index 0000000..03e09b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/VillageCollection.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/VillageDoorInfo.class b/build/classes/java/patchedMc/net/minecraft/village/VillageDoorInfo.class new file mode 100644 index 0000000..946d542 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/VillageDoorInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/village/VillageSiege.class b/build/classes/java/patchedMc/net/minecraft/village/VillageSiege.class new file mode 100644 index 0000000..4097dd8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/village/VillageSiege.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/ChunkCache.class b/build/classes/java/patchedMc/net/minecraft/world/ChunkCache.class new file mode 100644 index 0000000..ebd0bc0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/ChunkCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/ChunkCoordIntPair.class b/build/classes/java/patchedMc/net/minecraft/world/ChunkCoordIntPair.class new file mode 100644 index 0000000..c286cee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/ChunkCoordIntPair.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/ChunkPosition.class b/build/classes/java/patchedMc/net/minecraft/world/ChunkPosition.class new file mode 100644 index 0000000..6f3f317 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/ChunkPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/ColorizerFoliage.class b/build/classes/java/patchedMc/net/minecraft/world/ColorizerFoliage.class new file mode 100644 index 0000000..cbe9267 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/ColorizerFoliage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/ColorizerGrass.class b/build/classes/java/patchedMc/net/minecraft/world/ColorizerGrass.class new file mode 100644 index 0000000..fcf0ed6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/ColorizerGrass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/EnumDifficulty.class b/build/classes/java/patchedMc/net/minecraft/world/EnumDifficulty.class new file mode 100644 index 0000000..ab86da9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/EnumDifficulty.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/EnumSkyBlock.class b/build/classes/java/patchedMc/net/minecraft/world/EnumSkyBlock.class new file mode 100644 index 0000000..07cd645 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/EnumSkyBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/Explosion.class b/build/classes/java/patchedMc/net/minecraft/world/Explosion.class new file mode 100644 index 0000000..5e0caf7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/Explosion.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/GameRules$Value.class b/build/classes/java/patchedMc/net/minecraft/world/GameRules$Value.class new file mode 100644 index 0000000..a15fff5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/GameRules$Value.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/GameRules.class b/build/classes/java/patchedMc/net/minecraft/world/GameRules.class new file mode 100644 index 0000000..35ed4d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/GameRules.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/IBlockAccess.class b/build/classes/java/patchedMc/net/minecraft/world/IBlockAccess.class new file mode 100644 index 0000000..2eefdd4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/IBlockAccess.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/IWorldAccess.class b/build/classes/java/patchedMc/net/minecraft/world/IWorldAccess.class new file mode 100644 index 0000000..fc94acd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/IWorldAccess.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/MinecraftException.class b/build/classes/java/patchedMc/net/minecraft/world/MinecraftException.class new file mode 100644 index 0000000..cbc4a43 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/MinecraftException.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/NextTickListEntry.class b/build/classes/java/patchedMc/net/minecraft/world/NextTickListEntry.class new file mode 100644 index 0000000..c068ff1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/NextTickListEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/SpawnerAnimals.class b/build/classes/java/patchedMc/net/minecraft/world/SpawnerAnimals.class new file mode 100644 index 0000000..e14c111 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/SpawnerAnimals.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/Teleporter$PortalPosition.class b/build/classes/java/patchedMc/net/minecraft/world/Teleporter$PortalPosition.class new file mode 100644 index 0000000..f29b305 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/Teleporter$PortalPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/Teleporter.class b/build/classes/java/patchedMc/net/minecraft/world/Teleporter.class new file mode 100644 index 0000000..c202187 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/Teleporter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/World$1.class b/build/classes/java/patchedMc/net/minecraft/world/World$1.class new file mode 100644 index 0000000..c8502d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/World$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/World$2.class b/build/classes/java/patchedMc/net/minecraft/world/World$2.class new file mode 100644 index 0000000..b981c17 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/World$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/World$3.class b/build/classes/java/patchedMc/net/minecraft/world/World$3.class new file mode 100644 index 0000000..c240944 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/World$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/World$4.class b/build/classes/java/patchedMc/net/minecraft/world/World$4.class new file mode 100644 index 0000000..1500ee6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/World$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/World.class b/build/classes/java/patchedMc/net/minecraft/world/World.class new file mode 100644 index 0000000..c6e9819 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/World.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldManager.class b/build/classes/java/patchedMc/net/minecraft/world/WorldManager.class new file mode 100644 index 0000000..06bbce6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldProvider.class b/build/classes/java/patchedMc/net/minecraft/world/WorldProvider.class new file mode 100644 index 0000000..a5f134e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldProvider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldProviderEnd.class b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderEnd.class new file mode 100644 index 0000000..849cc32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderEnd.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldProviderHell.class b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderHell.class new file mode 100644 index 0000000..34cf1bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderHell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldProviderSurface.class b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderSurface.class new file mode 100644 index 0000000..8ad0ea6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldProviderSurface.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldSavedData.class b/build/classes/java/patchedMc/net/minecraft/world/WorldSavedData.class new file mode 100644 index 0000000..d4e57c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldSavedData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldServer$ServerBlockEventList.class b/build/classes/java/patchedMc/net/minecraft/world/WorldServer$ServerBlockEventList.class new file mode 100644 index 0000000..301f1c3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldServer$ServerBlockEventList.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldServer.class b/build/classes/java/patchedMc/net/minecraft/world/WorldServer.class new file mode 100644 index 0000000..02ed9cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldServerMulti.class b/build/classes/java/patchedMc/net/minecraft/world/WorldServerMulti.class new file mode 100644 index 0000000..187a1ce Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldServerMulti.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldSettings$GameType.class b/build/classes/java/patchedMc/net/minecraft/world/WorldSettings$GameType.class new file mode 100644 index 0000000..26bf964 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldSettings$GameType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldSettings.class b/build/classes/java/patchedMc/net/minecraft/world/WorldSettings.class new file mode 100644 index 0000000..149e59d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldSettings.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/WorldType.class b/build/classes/java/patchedMc/net/minecraft/world/WorldType.class new file mode 100644 index 0000000..e7763ab Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/WorldType.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache$Block.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache$Block.class new file mode 100644 index 0000000..d31a937 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache$Block.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache.class new file mode 100644 index 0000000..c947def Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeDecorator.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeDecorator.class new file mode 100644 index 0000000..d1a9892 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeDecorator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeEndDecorator.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeEndDecorator.class new file mode 100644 index 0000000..6d3f487 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeEndDecorator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$FlowerEntry.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$FlowerEntry.class new file mode 100644 index 0000000..b498ebe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$FlowerEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$Height.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$Height.class new file mode 100644 index 0000000..841c96a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$Height.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$SpawnListEntry.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$SpawnListEntry.class new file mode 100644 index 0000000..070ce4e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$SpawnListEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$TempCategory.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$TempCategory.class new file mode 100644 index 0000000..3449dd4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase$TempCategory.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase.class new file mode 100644 index 0000000..4ab6fd1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBeach.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBeach.class new file mode 100644 index 0000000..820f71d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenBeach.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenDesert.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenDesert.class new file mode 100644 index 0000000..36e9d65 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenDesert.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenEnd.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenEnd.class new file mode 100644 index 0000000..7ea1b90 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenEnd.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$1.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$1.class new file mode 100644 index 0000000..66b03fe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$2.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$2.class new file mode 100644 index 0000000..7f54faf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest.class new file mode 100644 index 0000000..5a07136 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenForest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHell.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHell.class new file mode 100644 index 0000000..083620c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHills.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHills.class new file mode 100644 index 0000000..9b97d92 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenHills.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenJungle.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenJungle.class new file mode 100644 index 0000000..27c61d7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenJungle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMesa.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMesa.class new file mode 100644 index 0000000..76deb92 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMesa.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMushroomIsland.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMushroomIsland.class new file mode 100644 index 0000000..9ccdaa4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMushroomIsland.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMutated.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMutated.class new file mode 100644 index 0000000..619120d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenMutated.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenOcean.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenOcean.class new file mode 100644 index 0000000..ad6d87c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenOcean.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenPlains.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenPlains.class new file mode 100644 index 0000000..bcd07db Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenPlains.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenRiver.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenRiver.class new file mode 100644 index 0000000..ac268be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenRiver.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna$Mutated.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna$Mutated.class new file mode 100644 index 0000000..2f4fc1e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna$Mutated.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna.class new file mode 100644 index 0000000..fa1d098 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSavanna.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSnow.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSnow.class new file mode 100644 index 0000000..404f6f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSnow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenStoneBeach.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenStoneBeach.class new file mode 100644 index 0000000..ccc0942 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenStoneBeach.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSwamp.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSwamp.class new file mode 100644 index 0000000..cb5edc8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenSwamp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenTaiga.class b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenTaiga.class new file mode 100644 index 0000000..477f997 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/BiomeGenTaiga.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManager.class b/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManager.class new file mode 100644 index 0000000..d614086 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManagerHell.class b/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManagerHell.class new file mode 100644 index 0000000..a6974e7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/biome/WorldChunkManagerHell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk$1.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk$1.class new file mode 100644 index 0000000..d17a7b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk.class new file mode 100644 index 0000000..14ee55a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/Chunk.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/EmptyChunk.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/EmptyChunk.class new file mode 100644 index 0000000..6cff27d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/EmptyChunk.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/IChunkProvider.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/IChunkProvider.class new file mode 100644 index 0000000..6c6a658 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/IChunkProvider.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/NibbleArray.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/NibbleArray.class new file mode 100644 index 0000000..36fa3a0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/NibbleArray.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk.class new file mode 100644 index 0000000..52f929b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader.class new file mode 100644 index 0000000..34d6fbf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilChunkLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter$1.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter$1.class new file mode 100644 index 0000000..d3a1049 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter.class new file mode 100644 index 0000000..90a3c45 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveConverter.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveHandler.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveHandler.class new file mode 100644 index 0000000..5cc97e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/AnvilSaveHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData.class new file mode 100644 index 0000000..1080fd9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader.class new file mode 100644 index 0000000..4eb5475 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ChunkLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ExtendedBlockStorage.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ExtendedBlockStorage.class new file mode 100644 index 0000000..ff5fe21 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/ExtendedBlockStorage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/IChunkLoader.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/IChunkLoader.class new file mode 100644 index 0000000..6d22952 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/IChunkLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/NibbleArrayReader.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/NibbleArrayReader.class new file mode 100644 index 0000000..0af41c9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/NibbleArrayReader.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer.class new file mode 100644 index 0000000..0ad1d56 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile.class new file mode 100644 index 0000000..b38dbc0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFile.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFileCache.class b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFileCache.class new file mode 100644 index 0000000..27897d3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/chunk/storage/RegionFileCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldManager.class b/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldManager.class new file mode 100644 index 0000000..6db76b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldServer.class b/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldServer.class new file mode 100644 index 0000000..07fc3a9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/demo/DemoWorldServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderEnd.class b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderEnd.class new file mode 100644 index 0000000..2d876ab Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderEnd.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderFlat.class b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderFlat.class new file mode 100644 index 0000000..0b24f22 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderFlat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderGenerate.class b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderGenerate.class new file mode 100644 index 0000000..5c858e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderGenerate.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderHell.class b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderHell.class new file mode 100644 index 0000000..0c27511 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderHell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderServer.class b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderServer.class new file mode 100644 index 0000000..8e6854b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/ChunkProviderServer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/FlatGeneratorInfo.class b/build/classes/java/patchedMc/net/minecraft/world/gen/FlatGeneratorInfo.class new file mode 100644 index 0000000..5e1701f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/FlatGeneratorInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/FlatLayerInfo.class b/build/classes/java/patchedMc/net/minecraft/world/gen/FlatLayerInfo.class new file mode 100644 index 0000000..024bd27 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/FlatLayerInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenBase.class b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenBase.class new file mode 100644 index 0000000..c6b07b8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCaves.class b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCaves.class new file mode 100644 index 0000000..2a908af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCaves.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCavesHell.class b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCavesHell.class new file mode 100644 index 0000000..1defd81 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenCavesHell.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenRavine.class b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenRavine.class new file mode 100644 index 0000000..4344053 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/MapGenRavine.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGenerator.class b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGenerator.class new file mode 100644 index 0000000..32b2f32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGenerator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorImproved.class b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorImproved.class new file mode 100644 index 0000000..7e9a249 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorImproved.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorOctaves.class b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorOctaves.class new file mode 100644 index 0000000..714ba2c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorOctaves.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorPerlin.class b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorPerlin.class new file mode 100644 index 0000000..0f40f55 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorPerlin.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorSimplex.class b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorSimplex.class new file mode 100644 index 0000000..1d7a183 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/NoiseGeneratorSimplex.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenAbstractTree.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenAbstractTree.class new file mode 100644 index 0000000..35041e4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenAbstractTree.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigMushroom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigMushroom.class new file mode 100644 index 0000000..e7246b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigMushroom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigTree.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigTree.class new file mode 100644 index 0000000..b40298e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBigTree.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBlockBlob.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBlockBlob.class new file mode 100644 index 0000000..ac963b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenBlockBlob.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCactus.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCactus.class new file mode 100644 index 0000000..e58dad4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCactus.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCanopyTree.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCanopyTree.class new file mode 100644 index 0000000..d1dd0e7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenCanopyTree.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenClay.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenClay.class new file mode 100644 index 0000000..8a4a53e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenClay.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDeadBush.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDeadBush.class new file mode 100644 index 0000000..8280b07 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDeadBush.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDesertWells.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDesertWells.class new file mode 100644 index 0000000..2db3ead Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDesertWells.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDoublePlant.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDoublePlant.class new file mode 100644 index 0000000..40c4f9b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDoublePlant.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDungeons.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDungeons.class new file mode 100644 index 0000000..8ef2380 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenDungeons.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFire.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFire.class new file mode 100644 index 0000000..11a011a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFire.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFlowers.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFlowers.class new file mode 100644 index 0000000..46486a4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenFlowers.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenForest.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenForest.class new file mode 100644 index 0000000..a10ca5c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenForest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone1.class new file mode 100644 index 0000000..f094851 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone2.class new file mode 100644 index 0000000..88fa829 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenGlowStone2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHellLava.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHellLava.class new file mode 100644 index 0000000..084d969 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHellLava.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHugeTrees.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHugeTrees.class new file mode 100644 index 0000000..1a0304d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenHugeTrees.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIcePath.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIcePath.class new file mode 100644 index 0000000..2e3fba5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIcePath.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIceSpike.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIceSpike.class new file mode 100644 index 0000000..c22441e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenIceSpike.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLakes.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLakes.class new file mode 100644 index 0000000..b2908af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLakes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLiquids.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLiquids.class new file mode 100644 index 0000000..3046fdf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenLiquids.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaJungle.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaJungle.class new file mode 100644 index 0000000..02d00ab Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaJungle.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaPineTree.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaPineTree.class new file mode 100644 index 0000000..48fdef1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMegaPineTree.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMelon.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMelon.class new file mode 100644 index 0000000..dbac43b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMelon.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMinable.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMinable.class new file mode 100644 index 0000000..dfd67a1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenMinable.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenPumpkin.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenPumpkin.class new file mode 100644 index 0000000..d45df20 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenPumpkin.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenReed.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenReed.class new file mode 100644 index 0000000..5373105 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenReed.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSand.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSand.class new file mode 100644 index 0000000..b531963 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSand.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSavannaTree.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSavannaTree.class new file mode 100644 index 0000000..507c62e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSavannaTree.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenShrub.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenShrub.class new file mode 100644 index 0000000..5fcc451 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenShrub.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSpikes.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSpikes.class new file mode 100644 index 0000000..f7e696e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSpikes.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSwamp.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSwamp.class new file mode 100644 index 0000000..3dd18af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenSwamp.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga1.class new file mode 100644 index 0000000..dc40489 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga2.class new file mode 100644 index 0000000..514c03d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTaiga2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTallGrass.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTallGrass.class new file mode 100644 index 0000000..c760e26 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTallGrass.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTrees.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTrees.class new file mode 100644 index 0000000..e29b5a3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenTrees.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenVines.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenVines.class new file mode 100644 index 0000000..1af640a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenVines.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenWaterlily.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenWaterlily.class new file mode 100644 index 0000000..f167414 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenWaterlily.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenerator.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenerator.class new file mode 100644 index 0000000..546373e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGenerator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.class b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.class new file mode 100644 index 0000000..c7aec37 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$1.class new file mode 100644 index 0000000..7b76e1d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$2.class new file mode 100644 index 0000000..32c9c79 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer.class new file mode 100644 index 0000000..22adffd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddIsland.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddIsland.class new file mode 100644 index 0000000..7096f3b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddIsland.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.class new file mode 100644 index 0000000..a89a3ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddSnow.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddSnow.class new file mode 100644 index 0000000..476959f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerAddSnow.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiome.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiome.class new file mode 100644 index 0000000..1c6c12b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiome.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiomeEdge.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiomeEdge.class new file mode 100644 index 0000000..d8dc413 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerBiomeEdge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerDeepOcean.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerDeepOcean.class new file mode 100644 index 0000000..36a857d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerDeepOcean.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$Mode.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$Mode.class new file mode 100644 index 0000000..26f23ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$Mode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode.class new file mode 100644 index 0000000..ba2c188 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge.class new file mode 100644 index 0000000..6610589 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerEdge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.class new file mode 100644 index 0000000..96a943e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerHills.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerHills.class new file mode 100644 index 0000000..180a86a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerHills.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerIsland.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerIsland.class new file mode 100644 index 0000000..93be72c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerIsland.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRareBiome.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRareBiome.class new file mode 100644 index 0000000..5ce5a33 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRareBiome.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.class new file mode 100644 index 0000000..1f0159e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiver.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiver.class new file mode 100644 index 0000000..5e8580f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiver.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverInit.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverInit.class new file mode 100644 index 0000000..151be32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverInit.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverMix.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverMix.class new file mode 100644 index 0000000..2b64226 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerRiverMix.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerShore.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerShore.class new file mode 100644 index 0000000..57be934 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerShore.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerSmooth.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerSmooth.class new file mode 100644 index 0000000..e069234 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerSmooth.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.class new file mode 100644 index 0000000..4f7a453 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerZoom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerZoom.class new file mode 100644 index 0000000..0d53893 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/GenLayerZoom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/layer/IntCache.class b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/IntCache.class new file mode 100644 index 0000000..f55db0c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/layer/IntCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid.class new file mode 100644 index 0000000..fd012dd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature.class new file mode 100644 index 0000000..e844171 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones.class new file mode 100644 index 0000000..283cd6f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid.class new file mode 100644 index 0000000..cea3572 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut.class new file mode 100644 index 0000000..c558d36 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.class new file mode 100644 index 0000000..fd86950 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenMineshaft.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenMineshaft.class new file mode 100644 index 0000000..1769d54 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenMineshaft.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge$Start.class new file mode 100644 index 0000000..e11afec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge.class new file mode 100644 index 0000000..af80c5d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenNetherBridge.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature$Start.class new file mode 100644 index 0000000..31b869e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature.class new file mode 100644 index 0000000..3c6a89d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenScatteredFeature.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold$Start.class new file mode 100644 index 0000000..d919f6d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold.class new file mode 100644 index 0000000..2ce6614 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStronghold.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$1.class new file mode 100644 index 0000000..0e22653 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$2.class new file mode 100644 index 0000000..cc89756 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$3.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$3.class new file mode 100644 index 0000000..9090acd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure.class new file mode 100644 index 0000000..ca4c1c2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructure.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureData.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureData.class new file mode 100644 index 0000000..98c8d13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureIO.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureIO.class new file mode 100644 index 0000000..22a8b8c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenStructureIO.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage$Start.class new file mode 100644 index 0000000..6949970 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage.class new file mode 100644 index 0000000..fd8185a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/MapGenVillage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureBoundingBox.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureBoundingBox.class new file mode 100644 index 0000000..4e02dbf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureBoundingBox.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent$BlockSelector.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent$BlockSelector.class new file mode 100644 index 0000000..639f732 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent$BlockSelector.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent.class new file mode 100644 index 0000000..10517ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureComponent.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor.class new file mode 100644 index 0000000..a067079 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross.class new file mode 100644 index 0000000..4d11844 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Room.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Room.class new file mode 100644 index 0000000..d24767b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Room.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs.class new file mode 100644 index 0000000..cb27f11 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces.class new file mode 100644 index 0000000..33a82e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftPieces.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftStart.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftStart.class new file mode 100644 index 0000000..ecaa13f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureMineshaftStart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor.class new file mode 100644 index 0000000..1ac56c2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2.class new file mode 100644 index 0000000..bfc7e47 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3.class new file mode 100644 index 0000000..dda727f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4.class new file mode 100644 index 0000000..d476ce5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5.class new file mode 100644 index 0000000..6d3e42a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing.class new file mode 100644 index 0000000..6a5cfb7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2.class new file mode 100644 index 0000000..159d43c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3.class new file mode 100644 index 0000000..710b0a1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$End.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$End.class new file mode 100644 index 0000000..358c213 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$End.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance.class new file mode 100644 index 0000000..54ead7f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom.class new file mode 100644 index 0000000..1a8a364 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece.class new file mode 100644 index 0000000..273c221 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight.class new file mode 100644 index 0000000..5ae2342 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs.class new file mode 100644 index 0000000..56266be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start.class new file mode 100644 index 0000000..e9f00df Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight.class new file mode 100644 index 0000000..4c72977 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne.class new file mode 100644 index 0000000..360adb7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces.class new file mode 100644 index 0000000..589d286 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureNetherBridgePieces.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStart.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStart.class new file mode 100644 index 0000000..bfe5d12 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStart.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$1.class new file mode 100644 index 0000000..64a11b5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$2.class new file mode 100644 index 0000000..3502415 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor.class new file mode 100644 index 0000000..466c12d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor.class new file mode 100644 index 0000000..eeba725 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing.class new file mode 100644 index 0000000..507940d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn.class new file mode 100644 index 0000000..29eb444 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Library.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Library.class new file mode 100644 index 0000000..b606596 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Library.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight.class new file mode 100644 index 0000000..48655bb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom.class new file mode 100644 index 0000000..e094489 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison.class new file mode 100644 index 0000000..bf3161c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn.class new file mode 100644 index 0000000..19b4f50 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing.class new file mode 100644 index 0000000..cbb8710 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs.class new file mode 100644 index 0000000..cd564ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2.class new file mode 100644 index 0000000..150e8e9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight.class new file mode 100644 index 0000000..ae6f7e6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones.class new file mode 100644 index 0000000..a9d83b4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight.class new file mode 100644 index 0000000..c10e9bd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door.class new file mode 100644 index 0000000..a41c1a4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold.class new file mode 100644 index 0000000..62a8242 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor.class new file mode 100644 index 0000000..af39027 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces.class new file mode 100644 index 0000000..277d5dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureStrongholdPieces.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Church.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Church.class new file mode 100644 index 0000000..f00d69b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Church.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field1.class new file mode 100644 index 0000000..eb0af19 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field2.class new file mode 100644 index 0000000..585fe28 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Field2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Hall.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Hall.class new file mode 100644 index 0000000..faba848 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Hall.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House1.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House1.class new file mode 100644 index 0000000..74a3b0f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House2.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House2.class new file mode 100644 index 0000000..432190b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House3.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House3.class new file mode 100644 index 0000000..052e999 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden.class new file mode 100644 index 0000000..6e7c022 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Path.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Path.class new file mode 100644 index 0000000..f7b44cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Path.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight.class new file mode 100644 index 0000000..0bd6d14 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Road.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Road.class new file mode 100644 index 0000000..5c33af0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Road.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Start.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Start.class new file mode 100644 index 0000000..ee50e3a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Torch.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Torch.class new file mode 100644 index 0000000..42f27c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Torch.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Village.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Village.class new file mode 100644 index 0000000..bde2c9b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Village.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Well.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Well.class new file mode 100644 index 0000000..4dedc3a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$Well.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut.class new file mode 100644 index 0000000..206db6f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces.class b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces.class new file mode 100644 index 0000000..9812bde Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/gen/structure/StructureVillagePieces.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/DerivedWorldInfo.class b/build/classes/java/patchedMc/net/minecraft/world/storage/DerivedWorldInfo.class new file mode 100644 index 0000000..4264ad9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/DerivedWorldInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/IPlayerFileData.class b/build/classes/java/patchedMc/net/minecraft/world/storage/IPlayerFileData.class new file mode 100644 index 0000000..59cedbe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/IPlayerFileData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveFormat.class b/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveFormat.class new file mode 100644 index 0000000..2a2d048 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveFormat.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveHandler.class b/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveHandler.class new file mode 100644 index 0000000..680792d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/ISaveHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/IThreadedFileIO.class b/build/classes/java/patchedMc/net/minecraft/world/storage/IThreadedFileIO.class new file mode 100644 index 0000000..c0f3eb4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/IThreadedFileIO.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapCoord.class b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapCoord.class new file mode 100644 index 0000000..327c06f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapCoord.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapInfo.class b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapInfo.class new file mode 100644 index 0000000..c192e3a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData$MapInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/MapData.class b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData.class new file mode 100644 index 0000000..10ef549 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/MapData.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/MapStorage.class b/build/classes/java/patchedMc/net/minecraft/world/storage/MapStorage.class new file mode 100644 index 0000000..9e372fb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/MapStorage.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatComparator.class b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatComparator.class new file mode 100644 index 0000000..f263f2a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatOld.class b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatOld.class new file mode 100644 index 0000000..185d508 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveFormatOld.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandler.class b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandler.class new file mode 100644 index 0000000..9b64013 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandlerMP.class b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandlerMP.class new file mode 100644 index 0000000..b172dfa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/SaveHandlerMP.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/ThreadedFileIOBase.class b/build/classes/java/patchedMc/net/minecraft/world/storage/ThreadedFileIOBase.class new file mode 100644 index 0000000..c9708c8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/ThreadedFileIOBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$1.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$1.class new file mode 100644 index 0000000..ff664e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$2.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$2.class new file mode 100644 index 0000000..4fae6b3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$3.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$3.class new file mode 100644 index 0000000..e1fa55f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$3.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$4.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$4.class new file mode 100644 index 0000000..649ba43 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$4.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$5.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$5.class new file mode 100644 index 0000000..a089135 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$5.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$6.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$6.class new file mode 100644 index 0000000..0afbfee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$6.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$7.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$7.class new file mode 100644 index 0000000..71145be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$7.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$8.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$8.class new file mode 100644 index 0000000..6563828 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$8.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$9.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$9.class new file mode 100644 index 0000000..8db301e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo$9.class differ diff --git a/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo.class b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo.class new file mode 100644 index 0000000..5b1cd51 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraft/world/storage/WorldInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/classloading/FMLForgePlugin.class b/build/classes/java/patchedMc/net/minecraftforge/classloading/FMLForgePlugin.class new file mode 100644 index 0000000..33281c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/classloading/FMLForgePlugin.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/classloading/FluidIdTransformer.class b/build/classes/java/patchedMc/net/minecraftforge/classloading/FluidIdTransformer.class new file mode 100644 index 0000000..3684ee7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/classloading/FluidIdTransformer.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/ClientCommandHandler.class b/build/classes/java/patchedMc/net/minecraftforge/client/ClientCommandHandler.class new file mode 100644 index 0000000..bfd7857 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/ClientCommandHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/EnumHelperClient.class b/build/classes/java/patchedMc/net/minecraftforge/client/EnumHelperClient.class new file mode 100644 index 0000000..78a92dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/EnumHelperClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient$1.class b/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient$1.class new file mode 100644 index 0000000..0714c96 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient.class b/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient.class new file mode 100644 index 0000000..8b06cbd Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/ForgeHooksClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/GuiIngameForge.class b/build/classes/java/patchedMc/net/minecraftforge/client/GuiIngameForge.class new file mode 100644 index 0000000..bc91032 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/GuiIngameForge.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRenderType.class b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRenderType.class new file mode 100644 index 0000000..1e56081 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRenderType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRendererHelper.class b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRendererHelper.class new file mode 100644 index 0000000..2eb2585 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer$ItemRendererHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer.class b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer.class new file mode 100644 index 0000000..02ff42c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/IItemRenderer.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/IRenderContextHandler.class b/build/classes/java/patchedMc/net/minecraftforge/client/IRenderContextHandler.class new file mode 100644 index 0000000..e60d3e0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/IRenderContextHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/IRenderHandler.class b/build/classes/java/patchedMc/net/minecraftforge/client/IRenderHandler.class new file mode 100644 index 0000000..c421373 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/IRenderHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/MinecraftForgeClient.class b/build/classes/java/patchedMc/net/minecraftforge/client/MinecraftForgeClient.class new file mode 100644 index 0000000..9a9e8f7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/MinecraftForgeClient.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/ClientChatReceivedEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/ClientChatReceivedEvent.class new file mode 100644 index 0000000..2eafbf2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/ClientChatReceivedEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/DrawBlockHighlightEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/DrawBlockHighlightEvent.class new file mode 100644 index 0000000..6e906ca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/DrawBlockHighlightEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogColors.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogColors.class new file mode 100644 index 0000000..c196d3d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogColors.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogDensity.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogDensity.class new file mode 100644 index 0000000..a0aad32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$FogDensity.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$RenderFogEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$RenderFogEvent.class new file mode 100644 index 0000000..9606bb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent$RenderFogEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent.class new file mode 100644 index 0000000..6c8984c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/EntityViewRenderEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/FOVUpdateEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/FOVUpdateEvent.class new file mode 100644 index 0000000..318d663 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/FOVUpdateEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiOpenEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiOpenEvent.class new file mode 100644 index 0000000..aaeb65a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiOpenEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Post.class new file mode 100644 index 0000000..68a972c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Pre.class new file mode 100644 index 0000000..354facc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent.class new file mode 100644 index 0000000..c456a6a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$ActionPerformedEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Post.class new file mode 100644 index 0000000..517c624 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Pre.class new file mode 100644 index 0000000..f41f2b5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent.class new file mode 100644 index 0000000..715adee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$DrawScreenEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Post.class new file mode 100644 index 0000000..ab004e3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Pre.class new file mode 100644 index 0000000..c31ca38 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent.class new file mode 100644 index 0000000..6bfee8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent$InitGuiEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent.class new file mode 100644 index 0000000..c54f51c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/GuiScreenEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/MouseEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/MouseEvent.class new file mode 100644 index 0000000..ac2ba78 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/MouseEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent$OverlayType.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent$OverlayType.class new file mode 100644 index 0000000..c754788 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent$OverlayType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent.class new file mode 100644 index 0000000..b3cd268 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderBlockOverlayEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$1.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$1.class new file mode 100644 index 0000000..1fd5225 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Chat.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Chat.class new file mode 100644 index 0000000..cc82cc7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Chat.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$ElementType.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$ElementType.class new file mode 100644 index 0000000..a140e89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$ElementType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Post.class new file mode 100644 index 0000000..ba8586f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Pre.class new file mode 100644 index 0000000..15d6b1a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Text.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Text.class new file mode 100644 index 0000000..1c7d81a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent$Text.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent.class new file mode 100644 index 0000000..97ce688 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderGameOverlayEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderHandEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderHandEvent.class new file mode 100644 index 0000000..9d6579f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderHandEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderItemInFrameEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderItemInFrameEvent.class new file mode 100644 index 0000000..7781f70 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderItemInFrameEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Post.class new file mode 100644 index 0000000..ec31f23 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Pre.class new file mode 100644 index 0000000..32e0916 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Post.class new file mode 100644 index 0000000..2d846e0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Pre.class new file mode 100644 index 0000000..a6c3bb9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials.class new file mode 100644 index 0000000..7580c92 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent$Specials.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent.class new file mode 100644 index 0000000..00f337e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderLivingEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Post.class new file mode 100644 index 0000000..0cdf12b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Pre.class new file mode 100644 index 0000000..2e1f2e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$SetArmorModel.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$SetArmorModel.class new file mode 100644 index 0000000..522b0a8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$SetArmorModel.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Post.class new file mode 100644 index 0000000..b521c4f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Pre.class new file mode 100644 index 0000000..eafa33e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials.class new file mode 100644 index 0000000..82bc332 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent$Specials.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent.class new file mode 100644 index 0000000..5f2af64 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderPlayerEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Post.class new file mode 100644 index 0000000..2bfbbb4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Pre.class new file mode 100644 index 0000000..93edbba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent.class new file mode 100644 index 0000000..539d02d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldLastEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldLastEvent.class new file mode 100644 index 0000000..ce6fd98 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/RenderWorldLastEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Post.class new file mode 100644 index 0000000..01f4fff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Pre.class new file mode 100644 index 0000000..c27a949 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent.class new file mode 100644 index 0000000..0fb0f30 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/TextureStitchEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.class new file mode 100644 index 0000000..c45f080 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.class new file mode 100644 index 0000000..b20d33d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.class new file mode 100644 index 0000000..c38e068 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent.class new file mode 100644 index 0000000..3efd04c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent17.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent17.class new file mode 100644 index 0000000..9a8faec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundEvent17.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.class new file mode 100644 index 0000000..e36fcd8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingEvent.class new file mode 100644 index 0000000..a076389 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.class new file mode 100644 index 0000000..da8c34b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent$SoundSourceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent$SoundSourceEvent.class new file mode 100644 index 0000000..f1030ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent$SoundSourceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent.class new file mode 100644 index 0000000..736d2f4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundLoadEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundLoadEvent.class new file mode 100644 index 0000000..2efb7aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundLoadEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundResultEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundResultEvent.class new file mode 100644 index 0000000..d9ecaf8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundResultEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundSetupEvent.class b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundSetupEvent.class new file mode 100644 index 0000000..6599d9a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/event/sound/SoundSetupEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$AddModOverrideEntry.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$AddModOverrideEntry.class new file mode 100644 index 0000000..04bd385 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$AddModOverrideEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ChunkLoaderEntry.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ChunkLoaderEntry.class new file mode 100644 index 0000000..fb98c08 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ChunkLoaderEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$GeneralEntry.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$GeneralEntry.class new file mode 100644 index 0000000..50a6694 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$GeneralEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModIDEntry.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModIDEntry.class new file mode 100644 index 0000000..2dc7a75 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModIDEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModOverridesEntry.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModOverridesEntry.class new file mode 100644 index 0000000..d79ffc8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui$ModOverridesEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui.class new file mode 100644 index 0000000..24ab864 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory$ForgeConfigGui.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory.class b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory.class new file mode 100644 index 0000000..260a496 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/gui/ForgeGuiFactory.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/AdvancedModelLoader.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/AdvancedModelLoader.class new file mode 100644 index 0000000..96f40d1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/AdvancedModelLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustom.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustom.class new file mode 100644 index 0000000..bcb92ad Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustom.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustomLoader.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustomLoader.class new file mode 100644 index 0000000..f6e65f1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/IModelCustomLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/ModelFormatException.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/ModelFormatException.class new file mode 100644 index 0000000..50ebe7f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/ModelFormatException.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Face.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Face.class new file mode 100644 index 0000000..165bf2c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Face.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/GroupObject.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/GroupObject.class new file mode 100644 index 0000000..9ae8f8b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/GroupObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/ObjModelLoader.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/ObjModelLoader.class new file mode 100644 index 0000000..94b6e2c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/ObjModelLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/TextureCoordinate.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/TextureCoordinate.class new file mode 100644 index 0000000..2bde967 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/TextureCoordinate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Vertex.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Vertex.class new file mode 100644 index 0000000..60df972 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/Vertex.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/WavefrontObject.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/WavefrontObject.class new file mode 100644 index 0000000..6f6ca7a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/obj/WavefrontObject.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModel.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModel.class new file mode 100644 index 0000000..9b28741 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModel.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModelLoader.class b/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModelLoader.class new file mode 100644 index 0000000..728f7fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/client/model/techne/TechneModelLoader.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/AchievementPage.class b/build/classes/java/patchedMc/net/minecraftforge/common/AchievementPage.class new file mode 100644 index 0000000..3898aac Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/AchievementPage.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$BiomeInfo.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$BiomeInfo.class new file mode 100644 index 0000000..9185128 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$BiomeInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$Type.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$Type.class new file mode 100644 index 0000000..0d230d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary$Type.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary.class new file mode 100644 index 0000000..8467f5c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeDictionary.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeEntry.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeEntry.class new file mode 100644 index 0000000..efedbca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeType.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeType.class new file mode 100644 index 0000000..2ecc3eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$BiomeType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$TrackedList.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$TrackedList.class new file mode 100644 index 0000000..7115b46 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager$TrackedList.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager.class b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager.class new file mode 100644 index 0000000..31d53ed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/BiomeManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ChestGenHooks.class b/build/classes/java/patchedMc/net/minecraftforge/common/ChestGenHooks.class new file mode 100644 index 0000000..8437835 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ChestGenHooks.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/DimensionManager.class b/build/classes/java/patchedMc/net/minecraftforge/common/DimensionManager.class new file mode 100644 index 0000000..f4ae7e3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/DimensionManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks$DungeonMob.class b/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks$DungeonMob.class new file mode 100644 index 0000000..58537bc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks$DungeonMob.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks.class b/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks.class new file mode 100644 index 0000000..c1ec552 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/DungeonHooks.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/EnumPlantType.class b/build/classes/java/patchedMc/net/minecraftforge/common/EnumPlantType.class new file mode 100644 index 0000000..81d6856 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/EnumPlantType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks$FishableCategory.class b/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks$FishableCategory.class new file mode 100644 index 0000000..ba8d12b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks$FishableCategory.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks.class b/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks.class new file mode 100644 index 0000000..37a13cb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/FishingHooks.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent.class new file mode 100644 index 0000000..e84800e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$LoadingCallback.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$LoadingCallback.class new file mode 100644 index 0000000..e03b845 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$LoadingCallback.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$OrderedLoadingCallback.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$OrderedLoadingCallback.class new file mode 100644 index 0000000..c64d71a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$OrderedLoadingCallback.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$PlayerOrderedLoadingCallback.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$PlayerOrderedLoadingCallback.class new file mode 100644 index 0000000..c1614ba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$PlayerOrderedLoadingCallback.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Ticket.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Ticket.class new file mode 100644 index 0000000..88ca7aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Ticket.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Type.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Type.class new file mode 100644 index 0000000..bcfda55 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$Type.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent.class new file mode 100644 index 0000000..ca06fd4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager.class new file mode 100644 index 0000000..955c264 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeChunkManager.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks$SeedEntry.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks$SeedEntry.class new file mode 100644 index 0000000..9a1e4b2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks$SeedEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks.class new file mode 100644 index 0000000..9f677be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeHooks.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeInternalHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeInternalHandler.class new file mode 100644 index 0000000..3e6f078 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeInternalHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeModContainer.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeModContainer.class new file mode 100644 index 0000000..0b8c39c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeModContainer.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$1.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$1.class new file mode 100644 index 0000000..80d83ea Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$Status.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$Status.class new file mode 100644 index 0000000..81e4993 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion$Status.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion.class b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion.class new file mode 100644 index 0000000..8b8ce08 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ForgeVersion.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/IExtendedEntityProperties.class b/build/classes/java/patchedMc/net/minecraftforge/common/IExtendedEntityProperties.class new file mode 100644 index 0000000..29c5597 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/IExtendedEntityProperties.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/IMinecartCollisionHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/IMinecartCollisionHandler.class new file mode 100644 index 0000000..afc8c5d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/IMinecartCollisionHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/IPlantable.class b/build/classes/java/patchedMc/net/minecraftforge/common/IPlantable.class new file mode 100644 index 0000000..aab2e52 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/IPlantable.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/IShearable.class b/build/classes/java/patchedMc/net/minecraftforge/common/IShearable.class new file mode 100644 index 0000000..ef7d691 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/IShearable.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor$ArmorProperties.class b/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor$ArmorProperties.class new file mode 100644 index 0000000..1c91f0f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor$ArmorProperties.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor.class b/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor.class new file mode 100644 index 0000000..6108bae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/ISpecialArmor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/MinecraftForge.class b/build/classes/java/patchedMc/net/minecraftforge/common/MinecraftForge.class new file mode 100644 index 0000000..e617279 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/MinecraftForge.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$1.class b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$1.class new file mode 100644 index 0000000..81b76dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$SaveThread.class b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$SaveThread.class new file mode 100644 index 0000000..49292eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache$SaveThread.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache.class b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache.class new file mode 100644 index 0000000..15e7141 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/UsernameCache.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/WorldSpecificSaveHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/WorldSpecificSaveHandler.class new file mode 100644 index 0000000..9ac4696 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/WorldSpecificSaveHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOExecutor.class b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOExecutor.class new file mode 100644 index 0000000..9a21d03 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOExecutor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOProvider.class b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOProvider.class new file mode 100644 index 0000000..86d8c66 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/ChunkIOProvider.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/QueuedChunk.class b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/QueuedChunk.class new file mode 100644 index 0000000..22c9664 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/chunkio/QueuedChunk.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigCategory.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigCategory.class new file mode 100644 index 0000000..940dee7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigCategory.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement$1.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement$1.class new file mode 100644 index 0000000..e77842c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement.class new file mode 100644 index 0000000..f92bc5b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/ConfigElement.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration$UnicodeInputStreamReader.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration$UnicodeInputStreamReader.class new file mode 100644 index 0000000..337bf20 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration$UnicodeInputStreamReader.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration.class new file mode 100644 index 0000000..5ca7c2f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/Configuration.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/Property$Type.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/Property$Type.class new file mode 100644 index 0000000..27f2aae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/Property$Type.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/config/Property.class b/build/classes/java/patchedMc/net/minecraftforge/common/config/Property.class new file mode 100644 index 0000000..fcc5ea6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/config/Property.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/DimensionMessageHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/DimensionMessageHandler.class new file mode 100644 index 0000000..8a27eca Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/DimensionMessageHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.class new file mode 100644 index 0000000..12df647 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$DimensionRegisterMessage.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$DimensionRegisterMessage.class new file mode 100644 index 0000000..dea8b6e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$DimensionRegisterMessage.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$FluidIdMapMessage.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$FluidIdMapMessage.class new file mode 100644 index 0000000..a5b914d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage$FluidIdMapMessage.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage.class new file mode 100644 index 0000000..e932f55 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeMessage.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeNetworkHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeNetworkHandler.class new file mode 100644 index 0000000..796157b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeNetworkHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeRuntimeCodec.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeRuntimeCodec.class new file mode 100644 index 0000000..f07ab5d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ForgeRuntimeCodec.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.class b/build/classes/java/patchedMc/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.class new file mode 100644 index 0000000..90721b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$CallBackProvider.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$CallBackProvider.class new file mode 100644 index 0000000..0109033 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$CallBackProvider.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$Task.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$Task.class new file mode 100644 index 0000000..0f05e8a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor$Task.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor.class new file mode 100644 index 0000000..b286841 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/AsynchronousExecutor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/BlockSnapshot.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/BlockSnapshot.class new file mode 100644 index 0000000..af13816 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/BlockSnapshot.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/ChunkCoordComparator.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/ChunkCoordComparator.class new file mode 100644 index 0000000..e43f10f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/ChunkCoordComparator.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants$NBT.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants$NBT.class new file mode 100644 index 0000000..0aedaae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants$NBT.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants.class new file mode 100644 index 0000000..a30d54c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/Constants.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/EnumHelper.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/EnumHelper.class new file mode 100644 index 0000000..f4e383f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/EnumHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayer.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayer.class new file mode 100644 index 0000000..11fad56 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayer.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayerFactory.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayerFactory.class new file mode 100644 index 0000000..34bcaff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/FakePlayerFactory.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/ForgeDirection.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/ForgeDirection.class new file mode 100644 index 0000000..0fab88f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/ForgeDirection.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper$BlockType.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper$BlockType.class new file mode 100644 index 0000000..e8ff9aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper$BlockType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper.class b/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper.class new file mode 100644 index 0000000..26f5c41 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/common/util/RotationHelper.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/AnvilUpdateEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/AnvilUpdateEvent.class new file mode 100644 index 0000000..1a007cf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/AnvilUpdateEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/CommandEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/CommandEvent.class new file mode 100644 index 0000000..2f25267 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/CommandEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/ForgeEventFactory.class b/build/classes/java/patchedMc/net/minecraftforge/event/ForgeEventFactory.class new file mode 100644 index 0000000..7e14d91 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/ForgeEventFactory.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/FuelBurnTimeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/FuelBurnTimeEvent.class new file mode 100644 index 0000000..49910a2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/FuelBurnTimeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/ServerChatEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/ServerChatEvent.class new file mode 100644 index 0000000..dfb17c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/ServerChatEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Post.class new file mode 100644 index 0000000..cf45b23 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Pre.class new file mode 100644 index 0000000..9240b49 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent.class new file mode 100644 index 0000000..15a9eb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewedEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewedEvent.class new file mode 100644 index 0000000..c5cceaa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/brewing/PotionBrewedEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$CanUpdate.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$CanUpdate.class new file mode 100644 index 0000000..f05c60a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$CanUpdate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EnteringChunk.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EnteringChunk.class new file mode 100644 index 0000000..3ef28b6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EnteringChunk.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EntityConstructing.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EntityConstructing.class new file mode 100644 index 0000000..c116001 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent$EntityConstructing.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent.class new file mode 100644 index 0000000..68fd0f0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityJoinWorldEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityJoinWorldEvent.class new file mode 100644 index 0000000..570898d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityJoinWorldEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityStruckByLightningEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityStruckByLightningEvent.class new file mode 100644 index 0000000..555c40e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/EntityStruckByLightningEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.class new file mode 100644 index 0000000..82f8d00 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemEvent.class new file mode 100644 index 0000000..6d7cbec Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemExpireEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemExpireEvent.class new file mode 100644 index 0000000..a86d113 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemExpireEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemTossEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemTossEvent.class new file mode 100644 index 0000000..1ec3a2f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/item/ItemTossEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/EnderTeleportEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/EnderTeleportEvent.class new file mode 100644 index 0000000..fb85b32 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/EnderTeleportEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingAttackEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingAttackEvent.class new file mode 100644 index 0000000..6dbbe99 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingAttackEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDeathEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDeathEvent.class new file mode 100644 index 0000000..56c0207 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDeathEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDropsEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDropsEvent.class new file mode 100644 index 0000000..9e95819 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingDropsEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingJumpEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingJumpEvent.class new file mode 100644 index 0000000..78d74ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingJumpEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingUpdateEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingUpdateEvent.class new file mode 100644 index 0000000..ff0c07a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent$LivingUpdateEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent.class new file mode 100644 index 0000000..bd882f0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingFallEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingFallEvent.class new file mode 100644 index 0000000..88f10a6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingFallEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHealEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHealEvent.class new file mode 100644 index 0000000..323ca8e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHealEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHurtEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHurtEvent.class new file mode 100644 index 0000000..7f66d44 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingHurtEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingPackSizeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingPackSizeEvent.class new file mode 100644 index 0000000..5a22a47 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingPackSizeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.class new file mode 100644 index 0000000..a02edb3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$AllowDespawn.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$AllowDespawn.class new file mode 100644 index 0000000..11c61b2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$AllowDespawn.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$CheckSpawn.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$CheckSpawn.class new file mode 100644 index 0000000..3ba2129 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$CheckSpawn.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$SpecialSpawn.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$SpecialSpawn.class new file mode 100644 index 0000000..124fc0b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent$SpecialSpawn.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent.class new file mode 100644 index 0000000..280dc48 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/LivingSpawnEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent$SummonAidEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent$SummonAidEvent.class new file mode 100644 index 0000000..cd20fdb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent$SummonAidEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent.class new file mode 100644 index 0000000..d6d4887 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/living/ZombieEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.class new file mode 100644 index 0000000..f54cd3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartEvent.class new file mode 100644 index 0000000..efd271b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.class new file mode 100644 index 0000000..9fe9c3c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.class new file mode 100644 index 0000000..9aeaa8c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AchievementEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AchievementEvent.class new file mode 100644 index 0000000..f9ab4b1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AchievementEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AnvilRepairEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AnvilRepairEvent.class new file mode 100644 index 0000000..f1bdc53 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AnvilRepairEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowLooseEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowLooseEvent.class new file mode 100644 index 0000000..a95915f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowLooseEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowNockEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowNockEvent.class new file mode 100644 index 0000000..4f2ebbb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ArrowNockEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AttackEntityEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AttackEntityEvent.class new file mode 100644 index 0000000..7441d56 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/AttackEntityEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/BonemealEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/BonemealEvent.class new file mode 100644 index 0000000..4517780 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/BonemealEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityInteractEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityInteractEvent.class new file mode 100644 index 0000000..81a99a6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityInteractEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityItemPickupEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityItemPickupEvent.class new file mode 100644 index 0000000..0a3a415 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/EntityItemPickupEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/FillBucketEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/FillBucketEvent.class new file mode 100644 index 0000000..42bbe49 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/FillBucketEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ItemTooltipEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ItemTooltipEvent.class new file mode 100644 index 0000000..898e2e3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/ItemTooltipEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.class new file mode 100644 index 0000000..6976815 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDropsEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDropsEvent.class new file mode 100644 index 0000000..fd4247a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerDropsEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$BreakSpeed.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$BreakSpeed.class new file mode 100644 index 0000000..86e12cc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$BreakSpeed.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$Clone.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$Clone.class new file mode 100644 index 0000000..6561fe1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$Clone.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$HarvestCheck.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$HarvestCheck.class new file mode 100644 index 0000000..a98c9ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$HarvestCheck.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$LoadFromFile.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$LoadFromFile.class new file mode 100644 index 0000000..4af086a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$LoadFromFile.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$NameFormat.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$NameFormat.class new file mode 100644 index 0000000..8de758a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$NameFormat.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$SaveToFile.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$SaveToFile.class new file mode 100644 index 0000000..c452fe7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$SaveToFile.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StartTracking.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StartTracking.class new file mode 100644 index 0000000..3a9e5a3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StartTracking.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StopTracking.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StopTracking.class new file mode 100644 index 0000000..99d917a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent$StopTracking.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent.class new file mode 100644 index 0000000..8019528 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.class new file mode 100644 index 0000000..201eab5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent$Action.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent$Action.class new file mode 100644 index 0000000..2cee863 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent$Action.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent.class new file mode 100644 index 0000000..d537a13 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerInteractEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.class new file mode 100644 index 0000000..938ba8d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.class new file mode 100644 index 0000000..560c90f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.class new file mode 100644 index 0000000..31405f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$1.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$1.class new file mode 100644 index 0000000..3fe05ba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Finish.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Finish.class new file mode 100644 index 0000000..02775dc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Finish.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Start.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Start.class new file mode 100644 index 0000000..69f98eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Stop.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Stop.class new file mode 100644 index 0000000..46420ff Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Stop.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Tick.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Tick.class new file mode 100644 index 0000000..be5fd37 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent$Tick.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent.class new file mode 100644 index 0000000..1808632 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerUseItemEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.class new file mode 100644 index 0000000..b5daedf Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/UseHoeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/UseHoeEvent.class new file mode 100644 index 0000000..8393e89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/entity/player/UseHoeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$BiomeColor.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$BiomeColor.class new file mode 100644 index 0000000..00911eb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$BiomeColor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$CreateDecorator.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$CreateDecorator.class new file mode 100644 index 0000000..a6a67f8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$CreateDecorator.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetFoliageColor.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetFoliageColor.class new file mode 100644 index 0000000..cbdd108 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetFoliageColor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetGrassColor.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetGrassColor.class new file mode 100644 index 0000000..afb433d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetGrassColor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockID.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockID.class new file mode 100644 index 0000000..0ec39ee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockID.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockMeta.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockMeta.class new file mode 100644 index 0000000..e2e7aef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetVillageBlockMeta.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetWaterColor.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetWaterColor.class new file mode 100644 index 0000000..f42fc89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent$GetWaterColor.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent.class new file mode 100644 index 0000000..34abdba Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/BiomeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$InitNoiseField.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$InitNoiseField.class new file mode 100644 index 0000000..ea1f398 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$InitNoiseField.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$ReplaceBiomeBlocks.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$ReplaceBiomeBlocks.class new file mode 100644 index 0000000..981468c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent$ReplaceBiomeBlocks.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent.class new file mode 100644 index 0000000..610c481 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/ChunkProviderEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate$EventType.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate$EventType.class new file mode 100644 index 0000000..945ff0d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate$EventType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate.class new file mode 100644 index 0000000..ba996c6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Decorate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Post.class new file mode 100644 index 0000000..8762555 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Pre.class new file mode 100644 index 0000000..c98bab3 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent.class new file mode 100644 index 0000000..d30a9a8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DecorateBiomeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.class new file mode 100644 index 0000000..84e9c39 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent$EventType.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent$EventType.class new file mode 100644 index 0000000..4c57e1c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent$EventType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent.class new file mode 100644 index 0000000..78ada6e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitMapGenEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitNoiseGensEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitNoiseGensEvent.class new file mode 100644 index 0000000..53c60e8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/InitNoiseGensEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable$EventType.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable$EventType.class new file mode 100644 index 0000000..36e5d1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable$EventType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable.class new file mode 100644 index 0000000..3dc4afb Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$GenerateMinable.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Post.class new file mode 100644 index 0000000..26e53a5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Pre.class new file mode 100644 index 0000000..834b253 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent.class new file mode 100644 index 0000000..7081e5b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/OreGenEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate$EventType.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate$EventType.class new file mode 100644 index 0000000..49adf25 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate$EventType.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate.class new file mode 100644 index 0000000..4790dfe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Populate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Post.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Post.class new file mode 100644 index 0000000..5d33984 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Post.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Pre.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Pre.class new file mode 100644 index 0000000..bb4b546 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent$Pre.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent.class new file mode 100644 index 0000000..6204021 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/PopulateChunkEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.class new file mode 100644 index 0000000..2a9a0c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/TerrainGen.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/TerrainGen.class new file mode 100644 index 0000000..ffa23e5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/TerrainGen.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$BiomeSize.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$BiomeSize.class new file mode 100644 index 0000000..0dd6af2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$BiomeSize.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$InitBiomeGens.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$InitBiomeGens.class new file mode 100644 index 0000000..dc25b7d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent$InitBiomeGens.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent.class new file mode 100644 index 0000000..7f392b9 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/terraingen/WorldTypeEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$BreakEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$BreakEvent.class new file mode 100644 index 0000000..7b8526a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$BreakEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$HarvestDropsEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$HarvestDropsEvent.class new file mode 100644 index 0000000..3da300f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$HarvestDropsEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$MultiPlaceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$MultiPlaceEvent.class new file mode 100644 index 0000000..7f83b6c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$MultiPlaceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$PlaceEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$PlaceEvent.class new file mode 100644 index 0000000..0826bed Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent$PlaceEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent.class new file mode 100644 index 0000000..eba0af5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/BlockEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Load.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Load.class new file mode 100644 index 0000000..5351da6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Load.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Save.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Save.class new file mode 100644 index 0000000..9e47bb8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent$Save.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent.class new file mode 100644 index 0000000..8970afe Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkDataEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Load.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Load.class new file mode 100644 index 0000000..70ac097 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Load.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Unload.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Unload.class new file mode 100644 index 0000000..09c76d5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent$Unload.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent.class new file mode 100644 index 0000000..b7b2c99 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$UnWatch.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$UnWatch.class new file mode 100644 index 0000000..b929050 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$UnWatch.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$Watch.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$Watch.class new file mode 100644 index 0000000..6e9daee Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent$Watch.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent.class new file mode 100644 index 0000000..5c7f7af Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ChunkWatchEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Detonate.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Detonate.class new file mode 100644 index 0000000..e83bed8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Detonate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Start.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Start.class new file mode 100644 index 0000000..0e75d52 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent$Start.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent.class new file mode 100644 index 0000000..fe43ea8 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/ExplosionEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Change.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Change.class new file mode 100644 index 0000000..fd665a7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Change.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Instrument.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Instrument.class new file mode 100644 index 0000000..9c7a0f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Instrument.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Note.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Note.class new file mode 100644 index 0000000..a584671 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Note.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Octave.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Octave.class new file mode 100644 index 0000000..fa08cef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Octave.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Play.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Play.class new file mode 100644 index 0000000..7a4f665 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent$Play.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent.class new file mode 100644 index 0000000..275abd6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/NoteBlockEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$CreateSpawnPosition.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$CreateSpawnPosition.class new file mode 100644 index 0000000..b764df0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$CreateSpawnPosition.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Load.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Load.class new file mode 100644 index 0000000..3e2e04d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Load.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$PotentialSpawns.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$PotentialSpawns.class new file mode 100644 index 0000000..dadaab7 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$PotentialSpawns.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Save.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Save.class new file mode 100644 index 0000000..f13724d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Save.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Unload.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Unload.class new file mode 100644 index 0000000..3c765be Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent$Unload.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent.class b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent.class new file mode 100644 index 0000000..144856f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/event/world/WorldEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidBase.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidBase.class new file mode 100644 index 0000000..a7c4f17 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidBase.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidClassic.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidClassic.class new file mode 100644 index 0000000..0800209 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidClassic.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidFinite.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidFinite.class new file mode 100644 index 0000000..653a03f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/BlockFluidFinite.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/Fluid.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/Fluid.class new file mode 100644 index 0000000..5ce670e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/Fluid.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$1.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$1.class new file mode 100644 index 0000000..de5ec0e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$ContainerKey.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$ContainerKey.class new file mode 100644 index 0000000..f9f816d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$ContainerKey.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerData.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerData.class new file mode 100644 index 0000000..426b3ae Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerData.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerRegisterEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerRegisterEvent.class new file mode 100644 index 0000000..6d5dbd2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry$FluidContainerRegisterEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry.class new file mode 100644 index 0000000..3e29341 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidContainerRegistry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidDrainingEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidDrainingEvent.class new file mode 100644 index 0000000..a89c5aa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidDrainingEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidFillingEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidFillingEvent.class new file mode 100644 index 0000000..aa532f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidFillingEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidMotionEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidMotionEvent.class new file mode 100644 index 0000000..637873e Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidMotionEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidSpilledEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidSpilledEvent.class new file mode 100644 index 0000000..ca6418a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent$FluidSpilledEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent.class new file mode 100644 index 0000000..5b0e6a1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$1.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$1.class new file mode 100644 index 0000000..f2dc55a Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$2.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$2.class new file mode 100644 index 0000000..b3bded6 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidDelegate.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidDelegate.class new file mode 100644 index 0000000..cbb57c0 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidDelegate.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidRegisterEvent.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidRegisterEvent.class new file mode 100644 index 0000000..3a87819 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry$FluidRegisterEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry.class new file mode 100644 index 0000000..e99a1fc Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidRegistry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidStack.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidStack.class new file mode 100644 index 0000000..065ff33 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidStack.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTank.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTank.class new file mode 100644 index 0000000..0cf9df2 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTank.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTankInfo.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTankInfo.class new file mode 100644 index 0000000..e0bb020 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/FluidTankInfo.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidBlock.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidBlock.class new file mode 100644 index 0000000..034b5ef Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidBlock.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidContainerItem.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidContainerItem.class new file mode 100644 index 0000000..45456f5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidContainerItem.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidHandler.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidHandler.class new file mode 100644 index 0000000..3ec0d89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidTank.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidTank.class new file mode 100644 index 0000000..827fb99 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/IFluidTank.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/ItemFluidContainer.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/ItemFluidContainer.class new file mode 100644 index 0000000..8484d89 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/ItemFluidContainer.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/RenderBlockFluid.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/RenderBlockFluid.class new file mode 100644 index 0000000..98d378c Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/RenderBlockFluid.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/fluids/TileFluidHandler.class b/build/classes/java/patchedMc/net/minecraftforge/fluids/TileFluidHandler.class new file mode 100644 index 0000000..7567f68 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/fluids/TileFluidHandler.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$OreRegisterEvent.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$OreRegisterEvent.class new file mode 100644 index 0000000..8ecb846 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$OreRegisterEvent.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$1.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$1.class new file mode 100644 index 0000000..9deefe4 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$2.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$2.class new file mode 100644 index 0000000..c159a25 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList$2.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList.class new file mode 100644 index 0000000..2eee93d Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary$UnmodifiableArrayList.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary.class new file mode 100644 index 0000000..d38ee1b Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/OreDictionary.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$1.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$1.class new file mode 100644 index 0000000..7717a25 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$1.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$Category.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$Category.class new file mode 100644 index 0000000..bd04b57 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$Category.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$SortEntry.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$SortEntry.class new file mode 100644 index 0000000..9fd53fa Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter$SortEntry.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter.class new file mode 100644 index 0000000..4a753e1 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/RecipeSorter.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapedOreRecipe.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapedOreRecipe.class new file mode 100644 index 0000000..74e9c4f Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapedOreRecipe.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapelessOreRecipe.class b/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapelessOreRecipe.class new file mode 100644 index 0000000..d74c4c5 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/oredict/ShapelessOreRecipe.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/server/ForgeTimeTracker.class b/build/classes/java/patchedMc/net/minecraftforge/server/ForgeTimeTracker.class new file mode 100644 index 0000000..5d23519 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/server/ForgeTimeTracker.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/server/command/ForgeCommand.class b/build/classes/java/patchedMc/net/minecraftforge/server/command/ForgeCommand.class new file mode 100644 index 0000000..05db420 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/server/command/ForgeCommand.class differ diff --git a/build/classes/java/patchedMc/net/minecraftforge/transformers/ForgeAccessTransformer.class b/build/classes/java/patchedMc/net/minecraftforge/transformers/ForgeAccessTransformer.class new file mode 100644 index 0000000..6c9c266 Binary files /dev/null and b/build/classes/java/patchedMc/net/minecraftforge/transformers/ForgeAccessTransformer.class differ diff --git a/build/classes/java/patchedMc/paulscode/sound/codecs/CodecIBXM.class b/build/classes/java/patchedMc/paulscode/sound/codecs/CodecIBXM.class new file mode 100644 index 0000000..789c7c8 Binary files /dev/null and b/build/classes/java/patchedMc/paulscode/sound/codecs/CodecIBXM.class differ diff --git a/build/generated/sources/injectTags/com/zivilon/cinder_loe/Tags.java b/build/generated/sources/injectTags/com/zivilon/cinder_loe/Tags.java new file mode 100644 index 0000000..55d720a --- /dev/null +++ b/build/generated/sources/injectTags/com/zivilon/cinder_loe/Tags.java @@ -0,0 +1,13 @@ +package com.zivilon.cinder_loe; + +/** Auto-generated tags from RetroFuturaGradle */ +public class Tags { + private Tags() {} + + /** Auto-generated tag from RetroFuturaGradle */ + public static final String MODID = "cinder_loe"; + /** Auto-generated tag from RetroFuturaGradle */ + public static final String MODNAME = "CinderLoE"; + /** Auto-generated tag from RetroFuturaGradle */ + public static final String GROUPNAME = "com.zivilon.cinder_loe"; +} diff --git a/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-dev.jar b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-dev.jar new file mode 100644 index 0000000..9fb739d Binary files /dev/null and b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-dev.jar differ diff --git a/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-sources.jar b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-sources.jar new file mode 100644 index 0000000..d3f17cb Binary files /dev/null and b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty-sources.jar differ diff --git a/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty.jar b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty.jar new file mode 100644 index 0000000..146868d Binary files /dev/null and b/build/libs/cinder_loe-68a4f22-main+68a4f22a48-dirty.jar differ diff --git a/build/mc-vanilla/mc_version_manifest.json b/build/mc-vanilla/mc_version_manifest.json new file mode 100644 index 0000000..ced1bed --- /dev/null +++ b/build/mc-vanilla/mc_version_manifest.json @@ -0,0 +1 @@ +{"assetIndex": {"id": "1.7.10", "sha1": "1863782e33ce7b584fc45b037325a1964e095d3e", "size": 72996, "totalSize": 112396854, "url": "https://launchermeta.mojang.com/v1/packages/1863782e33ce7b584fc45b037325a1964e095d3e/1.7.10.json"}, "assets": "1.7.10", "complianceLevel": 0, "downloads": {"client": {"sha1": "e80d9b3bf5085002218d4be59e668bac718abbc6", "size": 5256245, "url": "https://launcher.mojang.com/v1/objects/e80d9b3bf5085002218d4be59e668bac718abbc6/client.jar"}, "server": {"sha1": "952438ac4e01b4d115c5fc38f891710c4941df29", "size": 9605030, "url": "https://launcher.mojang.com/v1/objects/952438ac4e01b4d115c5fc38f891710c4941df29/server.jar"}, "windows_server": {"sha1": "a79b91ef69b9b4af63d1c7007f60259106869b21", "size": 9999270, "url": "https://launcher.mojang.com/v1/objects/a79b91ef69b9b4af63d1c7007f60259106869b21/windows_server.exe"}}, "id": "1.7.10", "javaVersion": {"component": "jre-legacy", "majorVersion": 8}, "libraries": [{"downloads": {"artifact": {"path": "com/mojang/netty/1.8.8/netty-1.8.8.jar", "sha1": "0a796914d1c8a55b4da9f4a8856dd9623375d8bb", "size": 15966, "url": "https://libraries.minecraft.net/com/mojang/netty/1.8.8/netty-1.8.8.jar"}}, "name": "com.mojang:netty:1.8.8"}, {"downloads": {"artifact": {"path": "com/mojang/realms/1.3.5/realms-1.3.5.jar", "sha1": "0807ae355ee63583becd7ea60e76aab1532bb42e", "size": 353818, "url": "https://libraries.minecraft.net/com/mojang/realms/1.3.5/realms-1.3.5.jar"}}, "name": "com.mojang:realms:1.3.5"}, {"downloads": {"artifact": {"path": "org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar", "sha1": "a698750c16740fd5b3871425f4cb3bbaa87f529d", "size": 365552, "url": "https://libraries.minecraft.net/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar"}}, "name": "org.apache.commons:commons-compress:1.8.1"}, {"downloads": {"artifact": {"path": "org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar", "sha1": "18f4247ff4572a074444572cee34647c43e7c9c7", "size": 589512, "url": "https://libraries.minecraft.net/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar"}}, "name": "org.apache.httpcomponents:httpclient:4.3.3"}, {"downloads": {"artifact": {"path": "commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar", "sha1": "f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f", "size": 62050, "url": "https://libraries.minecraft.net/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar"}}, "name": "commons-logging:commons-logging:1.1.3"}, {"downloads": {"artifact": {"path": "org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar", "sha1": "31fbbff1ddbf98f3aa7377c94d33b0447c646b6e", "size": 282269, "url": "https://libraries.minecraft.net/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar"}}, "name": "org.apache.httpcomponents:httpcore:4.3.2"}, {"downloads": {"artifact": {"path": "java3d/vecmath/1.3.1/vecmath-1.3.1.jar", "sha1": "a0ae4f51da409fa0c20fa0ca59e6bbc9413ae71d", "size": 289881, "url": "https://libraries.minecraft.net/java3d/vecmath/1.3.1/vecmath-1.3.1.jar"}}, "name": "java3d:vecmath:1.3.1"}, {"downloads": {"artifact": {"path": "net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar", "sha1": "42ccaf4761f0dfdfa805c9e340d99a755907e2dd", "size": 2523218, "url": "https://libraries.minecraft.net/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar"}}, "name": "net.sf.trove4j:trove4j:3.0.3"}, {"downloads": {"artifact": {"path": "com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar", "sha1": "63d216a9311cca6be337c1e458e587f99d382b84", "size": 1634692, "url": "https://libraries.minecraft.net/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar"}}, "name": "com.ibm.icu:icu4j-core-mojang:51.2"}, {"downloads": {"artifact": {"path": "net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar", "sha1": "6065cc95c661255349c1d0756657be17c29a4fd3", "size": 61311, "url": "https://libraries.minecraft.net/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar"}}, "name": "net.sf.jopt-simple:jopt-simple:4.5"}, {"downloads": {"artifact": {"path": "com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar", "sha1": "c73b5636faf089d9f00e8732a829577de25237ee", "size": 103871, "url": "https://libraries.minecraft.net/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar"}}, "name": "com.paulscode:codecjorbis:20101023"}, {"downloads": {"artifact": {"path": "com/paulscode/codecwav/20101023/codecwav-20101023.jar", "sha1": "12f031cfe88fef5c1dd36c563c0a3a69bd7261da", "size": 5618, "url": "https://libraries.minecraft.net/com/paulscode/codecwav/20101023/codecwav-20101023.jar"}}, "name": "com.paulscode:codecwav:20101023"}, {"downloads": {"artifact": {"path": "com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar", "sha1": "5c5e304366f75f9eaa2e8cca546a1fb6109348b3", "size": 21679, "url": "https://libraries.minecraft.net/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar"}}, "name": "com.paulscode:libraryjavasound:20101123"}, {"downloads": {"artifact": {"path": "com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar", "sha1": "73e80d0794c39665aec3f62eee88ca91676674ef", "size": 18981, "url": "https://libraries.minecraft.net/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar"}}, "name": "com.paulscode:librarylwjglopenal:20100824"}, {"downloads": {"artifact": {"path": "com/paulscode/soundsystem/20120107/soundsystem-20120107.jar", "sha1": "419c05fe9be71f792b2d76cfc9b67f1ed0fec7f6", "size": 65020, "url": "https://libraries.minecraft.net/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar"}}, "name": "com.paulscode:soundsystem:20120107"}, {"downloads": {"artifact": {"path": "io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar", "sha1": "9e50bd52ffe257a0e2cd8d971688d6ce7d174325", "size": 1452995, "url": "https://libraries.minecraft.net/io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar"}}, "name": "io.netty:netty-all:4.0.10.Final"}, {"downloads": {"artifact": {"path": "com/google/guava/guava/15.0/guava-15.0.jar", "sha1": "ed727a8d9f247e2050281cb083f1c77b09dcb5cd", "size": 2172168, "url": "https://libraries.minecraft.net/com/google/guava/guava/15.0/guava-15.0.jar"}}, "name": "com.google.guava:guava:15.0"}, {"downloads": {"artifact": {"path": "org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar", "sha1": "905075e6c80f206bbe6cf1e809d2caa69f420c76", "size": 315805, "url": "https://libraries.minecraft.net/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar"}}, "name": "org.apache.commons:commons-lang3:3.1"}, {"downloads": {"artifact": {"path": "commons-io/commons-io/2.4/commons-io-2.4.jar", "sha1": "b1b6ea3b7e4aa4f492509a4952029cd8e48019ad", "size": 185140, "url": "https://libraries.minecraft.net/commons-io/commons-io/2.4/commons-io-2.4.jar"}}, "name": "commons-io:commons-io:2.4"}, {"downloads": {"artifact": {"path": "commons-codec/commons-codec/1.9/commons-codec-1.9.jar", "sha1": "9ce04e34240f674bc72680f8b843b1457383161a", "size": 263965, "url": "https://libraries.minecraft.net/commons-codec/commons-codec/1.9/commons-codec-1.9.jar"}}, "name": "commons-codec:commons-codec:1.9"}, {"downloads": {"artifact": {"path": "net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar", "sha1": "39c7796b469a600f72380316f6b1f11db6c2c7c4", "size": 208338, "url": "https://libraries.minecraft.net/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar"}}, "name": "net.java.jinput:jinput:2.0.5"}, {"downloads": {"artifact": {"path": "net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar", "sha1": "e12fe1fda814bd348c1579329c86943d2cd3c6a6", "size": 7508, "url": "https://libraries.minecraft.net/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar"}}, "name": "net.java.jutils:jutils:1.0.0"}, {"downloads": {"artifact": {"path": "com/google/code/gson/gson/2.2.4/gson-2.2.4.jar", "sha1": "a60a5e993c98c864010053cb901b7eab25306568", "size": 190432, "url": "https://libraries.minecraft.net/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar"}}, "name": "com.google.code.gson:gson:2.2.4"}, {"downloads": {"artifact": {"path": "com/mojang/authlib/1.5.21/authlib-1.5.21.jar", "sha1": "aefba0d5b53fbcb70860bc8046ab95d5854c07a5", "size": 64412, "url": "https://libraries.minecraft.net/com/mojang/authlib/1.5.21/authlib-1.5.21.jar"}}, "name": "com.mojang:authlib:1.5.21"}, {"downloads": {"artifact": {"path": "org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar", "sha1": "1dd66e68cccd907880229f9e2de1314bd13ff785", "size": 108161, "url": "https://libraries.minecraft.net/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar"}}, "name": "org.apache.logging.log4j:log4j-api:2.0-beta9"}, {"downloads": {"artifact": {"path": "org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar", "sha1": "678861ba1b2e1fccb594bb0ca03114bb05da9695", "size": 681134, "url": "https://libraries.minecraft.net/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar"}}, "name": "org.apache.logging.log4j:log4j-core:2.0-beta9"}, {"downloads": {"artifact": {"path": "org/lwjgl/lwjgl/lwjgl/2.9.1/lwjgl-2.9.1.jar", "sha1": "f58c5aabcef0e41718a564be9f8e412fff8db847", "size": 1014790, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl/lwjgl/2.9.1/lwjgl-2.9.1.jar"}}, "name": "org.lwjgl.lwjgl:lwjgl:2.9.1"}, {"downloads": {"artifact": {"path": "org/lwjgl/lwjgl/lwjgl_util/2.9.1/lwjgl_util-2.9.1.jar", "sha1": "290d7ba8a1bd9566f5ddf16ad06f09af5ec9b20e", "size": 173909, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl/lwjgl_util/2.9.1/lwjgl_util-2.9.1.jar"}}, "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.1"}, {"downloads": {"classifiers": {"natives-linux": {"path": "org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-linux.jar", "sha1": "aa9aae879af8eb378e22cfc64db56ec2ca9a44d1", "size": 571424, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-linux.jar"}, "natives-osx": {"path": "org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-osx.jar", "sha1": "2d12c83fdfbc04ecabf02c7bc8cc54d034f0daac", "size": 527196, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-osx.jar"}, "natives-windows": {"path": "org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-windows.jar", "sha1": "4c517eca808522457dd95ee8fc1fbcdbb602efbe", "size": 611334, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl/lwjgl-platform/2.9.1/lwjgl-platform-2.9.1-natives-windows.jar"}}}, "extract": {"exclude": ["META-INF/"]}, "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.1", "natives": {"linux": "natives-linux", "osx": "natives-osx", "windows": "natives-windows"}}, {"downloads": {"classifiers": {"natives-linux": {"path": "net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar", "sha1": "7ff832a6eb9ab6a767f1ade2b548092d0fa64795", "size": 10362, "url": "https://libraries.minecraft.net/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar"}, "natives-osx": {"path": "net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-osx.jar", "sha1": "53f9c919f34d2ca9de8c51fc4e1e8282029a9232", "size": 12186, "url": "https://libraries.minecraft.net/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-osx.jar"}, "natives-windows": {"path": "net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows.jar", "sha1": "385ee093e01f587f30ee1c8a2ee7d408fd732e16", "size": 155179, "url": "https://libraries.minecraft.net/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows.jar"}}}, "extract": {"exclude": ["META-INF/"]}, "name": "net.java.jinput:jinput-platform:2.0.5", "natives": {"linux": "natives-linux", "osx": "natives-osx", "windows": "natives-windows"}}, {"downloads": {"artifact": {"path": "tv/twitch/twitch/5.16/twitch-5.16.jar", "sha1": "1f55f009c61637c10c0acfb8b5ffc600f30044b4", "size": 52315, "url": "https://libraries.minecraft.net/tv/twitch/twitch/5.16/twitch-5.16.jar"}}, "name": "tv.twitch:twitch:5.16"}, {"downloads": {"classifiers": {"natives-osx": {"path": "tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-osx.jar", "sha1": "62503ee712766cf77f97252e5902786fd834b8c5", "size": 418331, "url": "https://libraries.minecraft.net/tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-osx.jar"}, "natives-windows-32": {"path": "tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-windows-32.jar", "sha1": "7c6affe439099806a4f552da14c42f9d643d8b23", "size": 386792, "url": "https://libraries.minecraft.net/tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-windows-32.jar"}, "natives-windows-64": {"path": "tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-windows-64.jar", "sha1": "39d0c3d363735b4785598e0e7fbf8297c706a9f9", "size": 463390, "url": "https://libraries.minecraft.net/tv/twitch/twitch-platform/5.16/twitch-platform-5.16-natives-windows-64.jar"}}}, "extract": {"exclude": ["META-INF/"]}, "name": "tv.twitch:twitch-platform:5.16", "natives": {"linux": "natives-linux", "osx": "natives-osx", "windows": "natives-windows-${arch}"}, "rules": [{"action": "allow"}, {"action": "disallow", "os": {"name": "linux"}}]}, {"downloads": {"classifiers": {"natives-windows-32": {"path": "tv/twitch/twitch-external-platform/4.5/twitch-external-platform-4.5-natives-windows-32.jar", "sha1": "18215140f010c05b9f86ef6f0f8871954d2ccebf", "size": 5654047, "url": "https://libraries.minecraft.net/tv/twitch/twitch-external-platform/4.5/twitch-external-platform-4.5-natives-windows-32.jar"}, "natives-windows-64": {"path": "tv/twitch/twitch-external-platform/4.5/twitch-external-platform-4.5-natives-windows-64.jar", "sha1": "c3cde57891b935d41b6680a9c5e1502eeab76d86", "size": 7457619, "url": "https://libraries.minecraft.net/tv/twitch/twitch-external-platform/4.5/twitch-external-platform-4.5-natives-windows-64.jar"}}}, "extract": {"exclude": ["META-INF/"]}, "name": "tv.twitch:twitch-external-platform:4.5", "natives": {"windows": "natives-windows-${arch}"}, "rules": [{"action": "allow", "os": {"name": "windows"}}]}], "logging": {"client": {"argument": "-Dlog4j.configurationFile=${path}", "file": {"id": "client-1.7.xml", "sha1": "50c9cc4af6d853d9fc137c84bcd153e2bd3a9a82", "size": 966, "url": "https://launcher.mojang.com/v1/objects/50c9cc4af6d853d9fc137c84bcd153e2bd3a9a82/client-1.7.xml"}, "type": "log4j2-xml"}}, "mainClass": "net.minecraft.client.main.Main", "minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userProperties ${user_properties} --userType ${user_type}", "minimumLauncherVersion": 13, "releaseTime": "2014-05-14T17:29:23+00:00", "time": "2014-05-14T17:29:23+00:00", "type": "release"} \ No newline at end of file diff --git a/build/resources/main/LICENSE b/build/resources/main/LICENSE new file mode 100644 index 0000000..be08a1d --- /dev/null +++ b/build/resources/main/LICENSE @@ -0,0 +1,88 @@ +Code of CinderLoE is marked with CC0 1.0 Universal. To view a copy of this license, visit http://creativecommons.org/publicdomain/zero/1.0 +License not applicable to graphics contained within the package. + +Graphics: +KeyLime17 & cleric_red: (All rights reserved) +- assets/cinder_loe/mob/limwaith/* +- assets/lotr/armor/* +- assets/lotr/item/banner/banner_redDwarf.png +- assets/lotr/textures/blocks/bars_red_dwarf.png +- assets/lotr/textures/blocks/chandelier_red_dwarf.png +- assets/lotr/textures/blocks/red_dwarf_steel.png +- assets/lotr/textures/items/alatarStaff.png +- assets/lotr/textures/items/pallandoStaff.png +- assets/lotr/textures/items/radagastStaff.png +- assets/lotr/textures/items/sarumanStaff.png +- assets/lotr/textures/items/banner_redDwarf.png +- assets/lotr/textures/items/battleaxeLimwaith.png +- assets/lotr/textures/items/blowgunLimwaith.png +- assets/lotr/textures/items/daggerLimwaith.png +- assets/lotr/textures/items/daggerLimwaithPoisoned.png +- assets/lotr/textures/items/tridentLimwaith.png +- assets/lotr/textures/items/truncheonLimwaith.png +- assets/lotr/textures/items/spearLimwaith.png +- assets/lotr/textures/items/helmetLimwaith.png +- assets/lotr/textures/items/bodyLimwaith.png +- assets/lotr/textures/items/legsLimwaith.png +- assets/lotr/textures/items/bootsLimwaith.png +- assets/lotr/textures/items/battleaxeRedDwarf.png +- assets/lotr/textures/items/crossbowRedDwarf.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_0.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_1.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_2.png +- assets/lotr/textures/items/daggerRedDwarf.png +- assets/lotr/textures/items/daggerRedDwarfPoisoned.png +- assets/lotr/textures/items/hammerRedDwarf.png +- assets/lotr/textures/items/pikeRedDwarf.png +- assets/lotr/textures/items/spearRedDwarf.png +- assets/lotr/textures/items/swordRedDwarf.png +- assets/lotr/textures/items/redDwarfSteel.png +- assets/lotr/textures/items/helmetRedDwarf.png +- assets/lotr/textures/items/bodyRedDwarf.png +- assets/lotr/textures/items/legsRedDwarf.png +- assets/lotr/textures/items/bootsRedDwarf.png +- assets/lotr/textures/items/boarArmorRedDwarf.png +- assets/lotr/textures/items/large/alatarStaff.png +- assets/lotr/textures/items/large/pallandoStaff.png +- assets/lotr/textures/items/large/radagastStaff.png +- assets/lotr/textures/items/large/sarumanStaff.png +- assets/lotr/textures/items/large/battleaxeLimwaith.png +- assets/lotr/textures/items/large/tridentLimwaith.png +- assets/lotr/textures/items/large/spearLimwaith.png +- assets/lotr/textures/items/large/spearRedDwarf.png +- assets/lotr/textures/items/large2/pikeRedDwarf.png +- assets/lotr/textures/shield/alignment_RedDwarf.png + +LOTRMod team: (All rights reserved) +- assets/lotr/textures/blocks/fur_bundle_bottom.png +- assets/lotr/textures/blocks/fur_bundle_top.png +- assets/lotr/textures/blocks/fur_bundle_side_0.png +- assets/lotr/textures/blocks/fur_bundle_side_90.png +- assets/lotr/textures/blocks/fur_bundle_side_180.png +- assets/lotr/textures/blocks/fur_bundle_side_270.png +- assets/lotr/textures/blocks/leather_bundle_bottom.png +- assets/lotr/textures/blocks/leather_bundle_top.png +- assets/lotr/textures/blocks/leather_bundle_side_0.png +- assets/lotr/textures/blocks/leather_bundle_side_90.png +- assets/lotr/textures/blocks/leather_bundle_side_180.png +- assets/lotr/textures/blocks/leather_bundle_side_270.png +- assets/lotr/textures/blocks/reed_bale_bottom.png +- assets/lotr/textures/blocks/reed_bale_top.png +- assets/lotr/textures/blocks/reed_bale_side_0.png +- assets/lotr/textures/blocks/reed_bale_side_90.png +- assets/lotr/textures/blocks/reed_bale_side_180.png +- assets/lotr/textures/blocks/reed_bale_side_270.png +- assets/lotr/textures/items/gandalfStaffGrey.png +- assets/lotr/textures/items/gandalfStaffWhite.png +- assets/lotr/textures/items/large/gandalfStaffGrey.png +- assets/lotr/textures/items/large/gandalfStaffWhite.png + + +Mojang: (All rights reserved) +- assets/lotr/textures/items/spawn_egg.png + +Unidentified: (Assume all rights reserved) +- assets/lotr/textures/blocks/cinder_block.png +- assets/lotr/textures/blocks/ivory_block_top.png +- assets/lotr/textures/blocks/ivory_block_side_0.png +- assets/lotr/textures/blocks/ivory_block_side_90.png diff --git a/build/resources/main/assets/cinder_loe/lang/en_GB.lang b/build/resources/main/assets/cinder_loe/lang/en_GB.lang new file mode 100644 index 0000000..9206c9c --- /dev/null +++ b/build/resources/main/assets/cinder_loe/lang/en_GB.lang @@ -0,0 +1,2 @@ +item.lotr:sarumanStaff.name=Staff of Saruman of Many Colours +item.lotr:boarArmorRedDwarf.name=Red Dwarven Boar Armour diff --git a/build/resources/main/assets/cinder_loe/lang/en_US.lang b/build/resources/main/assets/cinder_loe/lang/en_US.lang new file mode 100644 index 0000000..b9b961e --- /dev/null +++ b/build/resources/main/assets/cinder_loe/lang/en_US.lang @@ -0,0 +1,116 @@ +tile.lotr:cinderBlock.name=Cinder Block +tile.lotr:ironChain.name=Iron Chain +tile.lotr:silverChain.name=Silver Chain +tile.lotr:goldChain.name=Gold Chain +tile.lotr:blockRedDwarfSteel.name=Red Dwarven Steel Block +tile.lotr:chandelierRedDwarf.name=Red Dwarven Chandelier +tile.lotr:barsRedDwarf.name=Red Dwarven Bars +tile.lotr:reedBale.name=Reed Bale +tile.lotr:leatherBundle.name=Leather Bundle +tile.lotr:furBundle.name=Fur Bundle +tile.lotr:dwarvenBrickRuned.name=Runed Dwarven Brick +tile.lotr:ivoryBlock.name=Ivory Block +tile.lotr:mistBlock.name=Mist +tile.lotr:fishbarrel.name=Barrel of Fish + +item.lotr:frostblade.name=Frostblade +item.lotr:whip.name=Whip +item.lotr:spearsolidgold.name=Solid Gold Spear +item.lotr:helmetRedDwarf.name=Red Dwarven Helmet +item.lotr:bodyRedDwarf.name=Red Dwarven Chestplate +item.lotr:legsRedDwarf.name=Red Dwarven Leggings +item.lotr:bootsRedDwarf.name=Red Dwarven Boots +item.lotr:redDwarfSteel.name=Red Dwarven Steel +item.lotr:spearRedDwarf.name=Red Dwarven Spear +item.lotr:swordRedDwarf.name=Red Dwarven Sword +item.lotr:battleaxeRedDwarf.name=Red Dwarven Battleaxe +item.lotr:pikeRedDwarf.name=Red Dwarven Pike +item.lotr:hammerRedDwarf.name=Red Dwarven Hammer +item.lotr:daggerRedDwarf.name=Red Dwarven Dagger +item.lotr:daggerRedDwarfPoisoned.name=Poisoned Red Dwarven Dagger +item.lotr:crossbowRedDwarf.name=Red Dwarven Crossbow +item.lotr:boarArmorRedDwarf.name=Red Dwarven Boar Armor +item.lotr:radagastStaff.name=Staff of Radagast the Brown +item.lotr:pallandoStaff.name=Staff of Pallando the Blue +item.lotr:alatarStaff.name=Staff of Alatar the Blue +item.lotr:sarumanStaff.name=Staff of Saruman of Many Colors +item.lotr:helmetLimwaith.name=Limwaith Helmet +item.lotr:bodyLimwaith.name=Limwaith Chestplate +item.lotr:legsLimwaith.name=Limwaith Leggings +item.lotr:bootsLimwaith.name=Limwaith Boots +item.lotr:spearLimwaith.name=Limwaith Spear +item.lotr:tridentLimwaith.name=Limwaith Trident +item.lotr:battleaxeLimwaith.name=Limwaith Battleaxe +item.lotr:truncheonLimwaith.name=Limwaith Truncheon +item.lotr:daggerLimwaith.name=Limwaith Dagger +item.lotr:daggerLimwaithPoisoned.name=Poisoned Limwaith Dagger +item.lotr:blowgunLimwaith.name=Limwaith Blowgun +item.lotr:helmetBree.name=Bree-land Helmet +item.lotr:bodyBree.name=Bree-land Chestplate +item.lotr:legsBree.name=Bree-land Leggings +item.lotr:bootsBree.name=Bree-land Boots +item.lotr:swordBree.name=Bree-land Sword + +item.lotr:helmetArnorBanner.name=Arnorian Hood +item.lotr:bodyArnorBanner.name=Light Arnorian Chestplate +item.lotr:legsArnorBanner.name=Light Arnorian Leggings +item.lotr:bootsArnorBanner.name=Light Arnorian Boots +item.lotr:maceArnor.name=Arnorian Mace + +item.spawn_egg_fangornauroch.name=Spawn Fangorn Auroch +item.spawn_egg_fangornbear.name=Spawn Fangorn Bear +item.spawn_egg_fangornwildboar.name=Spawn Fangorn Wild Boar +item.spawn_egg_fangornelk.name=Spawn Fangorn Elk +item.spawn_egg_reddwarfwarrior.name=Spawn Red Dwarf Warrior +item.spawn_egg_reddwarfarbalest.name=Spawn Red Dwarf Arbalest +item.spawn_egg_reddwarfbannerbearer.name=Spawn Red Dwarf Banner Bearer +item.spawn_egg_reddwarfcommander.name=Spawn Red Dwarf Commander +item.spawn_egg_limwaithwarrior.name=Spawn Limwaith Warrior +item.spawn_egg_limwaithblowgunner.name=Spawn Limwaith Blowgunner +item.spawn_egg_limwaithbannerbearer.name=Spawn Limwaith Banner Bearer +item.spawn_egg_limwaithchieftain.name=Spawn Limwaith Chieftain +item.spawn_egg_renegade.name=Spawn Renegade +item.spawn_egg_renegadecaptain.name=Spawn Renegade Captain +item.spawn_egg_wraith.name=Spawn Wraith +item.spawn_egg_lotrentitysauron.name=Spawn Sauron +item.spawn_egg_arnorsoldier.name=Spawn Arnorian Soldier +item.spawn_egg_arnorsoldierarcher.name=Spawn Arnorian Archer +item.spawn_egg_arnorcaptain.name=Spawn Arnorian Captain +item.spawn_egg_arnorbannerbearer.name=Spawn Arnorian Banner Bearer +item.spawn_egg_battlenun.name=Spawn Keeper of the Elendilmir +item.spawn_egg_breesoldier.name=Spawn Bree-Land Soldier +item.spawn_egg_breecrossbowman.name=Spawn Bree-Land Crossbowman +item.spawn_egg_breecaptain.name=Spawn Bree-Land Captain +item.spawn_egg_breesoldierbannerbearer.name=Spawn Bree-Land Bannerbearer +item.spawn_egg_breeoutrider.name=Spawn Bree-Land Outrider + +entity.cinder_loe.RedDwarfWarrior.name=Red Dwarf Warrior +entity.cinder_loe.RedDwarfArbalest.name=Red Dwarf Arbalest +entity.cinder_loe.RedDwarfBannerBearer.name=Red Dwarf Banner Bearer +entity.cinder_loe.RedDwarfCommander.name=Red Dwarf Commander +entity.cinder_loe.LimwaithWarrior.name=Limwaith Warrior +entity.cinder_loe.LimwaithBlowgunner.name=Limwaith Blowgunner +entity.cinder_loe.LimwaithBannerBearer.name=Limwaith Banner Bearer +entity.cinder_loe.LimwaithChieftain.name=Limwaith Chieftain +entity.cinder_loe.Renegade.entityName=%s the Renegade +entity.cinder_loe.RenegadeCaptain.name=Renegade Captain +entity.cinder_loe.FangornBear.name=Bear +entity.cinder_loe.FangornElk.name=Elk +entity.cinder_loe.FangornAuroch.name=Auroch +entity.cinder_loe.FangornWildBoar.name=Wild Boar +entity.cinder_loe.FangornWolf.name=Wolf +lotr.unit.RedDwarfWarrior_Boar=Boar Rider +lotr.unit.RedDwarfArbalest_Boar=Boar Arbalest Rider +entity.cinder_loe.ArnorSoldier.name=Arnorian Soldier +entity.cinder_loe.ArnorSoldierArcher.name=Arnorian Archer +entity.cinder_loe.ArnorBannerBearer.name=Arnorian Banner Bearer +entity.cinder_loe.ArnorCaptain.name=Captain of Arnor +entity.cinder_loe.BattleNun.name=Keeper of the Elendilmir +lotr.unit.Arnor_Horse=Arnorian Knight +entity.cinder_loe.BreeSoldier.name=Bree-land Soldier +entity.cinder_loe.BreeOutrider.name=Bree-land Outrider +entity.cinder_loe.BreeCrossbowman.name=Bree-land Crossbowman +entity.cinder_loe.BreeSoldierBannerBearer.name=Bree-land Banner Bearer +entity.cinder_loe.BreeCaptain.name=Bree-land Captain +lotr.unit.Bree_Horse=Bree-land Outrider +entity.cinder_loe.LOTREntitySauron.name=Sauron diff --git a/build/resources/main/assets/cinder_loe/misc/particles.png b/build/resources/main/assets/cinder_loe/misc/particles.png new file mode 100644 index 0000000..49e035d Binary files /dev/null and b/build/resources/main/assets/cinder_loe/misc/particles.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png b/build/resources/main/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png new file mode 100644 index 0000000..90a331b Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/0.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/0.png new file mode 100644 index 0000000..db405db Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/1.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/1.png new file mode 100644 index 0000000..2439ab5 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/1.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/2.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/2.png new file mode 100644 index 0000000..e6f4144 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_female/2.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/0.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/0.png new file mode 100644 index 0000000..b02b20c Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/1.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/1.png new file mode 100644 index 0000000..326a144 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/1.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/2.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/2.png new file mode 100644 index 0000000..7008447 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/2.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/3.png b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/3.png new file mode 100644 index 0000000..ef8ce6d Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/limwaith/limwaith_male/3.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/headwear_female/0.png b/build/resources/main/assets/cinder_loe/mob/renegade/headwear_female/0.png new file mode 100644 index 0000000..e13c741 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/headwear_female/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/0.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/0.png new file mode 100644 index 0000000..6428958 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/1.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/1.png new file mode 100644 index 0000000..e116169 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/1.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/2.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/2.png new file mode 100644 index 0000000..d4bedf3 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/2.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/3.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/3.png new file mode 100644 index 0000000..f442b73 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/3.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/4.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/4.png new file mode 100644 index 0000000..2807638 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/4.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/5.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/5.png new file mode 100644 index 0000000..8714484 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/5.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/6.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/6.png new file mode 100644 index 0000000..ab8815a Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/6.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/7.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/7.png new file mode 100644 index 0000000..c623dba Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_female/7.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/0.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/0.png new file mode 100644 index 0000000..775d84f Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/0.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/1.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/1.png new file mode 100644 index 0000000..dfd0311 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/1.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/10.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/10.png new file mode 100644 index 0000000..ed4ebef Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/10.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/11.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/11.png new file mode 100644 index 0000000..6a47a16 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/11.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/12.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/12.png new file mode 100644 index 0000000..6b8abbd Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/12.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/13.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/13.png new file mode 100644 index 0000000..9577f8e Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/13.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/2.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/2.png new file mode 100644 index 0000000..f3ca034 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/2.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/3.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/3.png new file mode 100644 index 0000000..9d462c2 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/3.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/4.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/4.png new file mode 100644 index 0000000..848293f Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/4.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/5.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/5.png new file mode 100644 index 0000000..c6dca42 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/5.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/6.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/6.png new file mode 100644 index 0000000..795a45c Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/6.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/7.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/7.png new file mode 100644 index 0000000..256ac7f Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/7.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/8.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/8.png new file mode 100644 index 0000000..02a3f2d Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/8.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/9.png b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/9.png new file mode 100644 index 0000000..c98b746 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/renegade/renegade_male/9.png differ diff --git a/build/resources/main/assets/cinder_loe/mob/wraith/wraith.png b/build/resources/main/assets/cinder_loe/mob/wraith/wraith.png new file mode 100644 index 0000000..3276887 Binary files /dev/null and b/build/resources/main/assets/cinder_loe/mob/wraith/wraith.png differ diff --git a/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt new file mode 100644 index 0000000..b89983a --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt @@ -0,0 +1,11 @@ +Do you seek to command the Dúnedain of the North, friend #? +These Dúnedain will follow your leadership for a small price, #. +Bring some silver coins and you can have some soldiers under your command. +Are you here with the intention of hiring Rangers of the North? +I can grant you the leadership of some excellent Dúnedain Soldiers in return for silver coins. +The Rangers of the North now respect you enough to follow your command, #. +The men of Arnor only follow good and valiant Men into battle. You are worthy to lead us. +My men are the finest warriors in all of the North! +I will give you some of my men for a dozen silver coins. +Such great warriors as my men do not fight for nothing, #! They require payment. +You are worthy enough to command my valiant Soldiers. \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt new file mode 100644 index 0000000..5d7c7e4 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt @@ -0,0 +1,12 @@ +Only the strongest friends of the Dúnedain may fight with us in battle, #. +If you wish to captain the warriors of Arnor, you must prove your trust. +Are you friend or foe, #? +They say you are a friend of the Dúnedain, but I cannot be sure until you have done more good. +One does not simply command the men of Arnor without gaining some reputation first. +You are not yet thought of highly enough to fight with my warriors in battle, #. +Show us that you can be trusted, #, and we will fight alongside you. +You will have to prove yourself to our kin, if you wish to command some of our mighty warriors. +We Dúnedain do not follow any stranger into battle. You will have to prove that you truly fight for good in this world. +Prove your allegiance to us, and we shall ally with you. +You must prove yourself worthy first, if you wish to lead us to battle. +Only a true friend of our folk may lead us against the servants of evil. \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt new file mode 100644 index 0000000..505b7d7 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt @@ -0,0 +1,23 @@ +Long have we guarded these lands, #. +We Arnorians have watched over these lands for generations lost to memory. +What brings you to this wilderness, #? +May your journey be swift and your cloak warm, #. +By nightfall this land will be crawling with Orcs. +Be on your guard, #. There are many enemies in these parts. +Good day, #. From which land do you hail? +Keep a safe camp at night, and stay out of the shadows. +It is not for nothing that we watch these lands, #. Many foul beasts nest here. +We Arnorians remember the ancient lore of the West. We have ways to walk unseen. +These lands are my domain, #, and I do all in my power to safeguard them. +Beware the wretched Morgul-scum that crawls out at night, #. +The wolf that one hears is worse than the Orc that one fears. +Were it not for us, these lands would have fallen to the darkness long ago. +Many of the folk that dwell here consider us bandits and outcasts. They do not know our true duties. +My kin has long guarded these lands from the dangers that lie to the North. +Be wary, #. Many new dangers have arisen in these dark days. +As long as we watch over these lands, travellers such as you will be able to journey in peace, #. +Lonely folk are we, Soldiers of the North, guardians - but ever guarding against the servants of the Enemy. +The servants of the Enemy are found in many places, not in Mordor only. +Beware of the ancient wights and shades that roam this land, #. It is said they can take over your body. +In time of need, we will ride to the aid of Isildur's heir. +Our homes, such as we have, are here in the North. \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt new file mode 100644 index 0000000..ef5f61b --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt @@ -0,0 +1,15 @@ +My duty is to my captain # and the lands over which I stand guard. +The Morgul-filth of the night shall perish before us! +I have sworn to defend the lands of the free peoples, and defend them I shall! +May your journey be swift and your cloak warm, captain #. +By nightfall this land will be crawling with Orcs. +Be on your guard, captain #. There are many enemies in these parts. +Long have we guarded these lands, captain #. +We Soldiers have watched over these lands for generations lost to memory. +We Soldiers remember the ancient lore of the West. +The wolf that one hears is worse than the Orc that one fears. +My kin have long guarded these lands. +I will follow you wherever you go! +I have ways to move unseen in the shadows. +Let's hunt some Orc! +Be on your guard, captain #. There are keylimes lurking, waiting to nerf. \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt new file mode 100644 index 0000000..fb46e82 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt @@ -0,0 +1,16 @@ +Your death shall come swift as the arrow that pierces flesh, #! +I shall make an end of you! +You are not welcome in these lands, #! +Flee our lands, you wretched ally of the Morgul-filth! +You are an enemy of the race of Men, #! +What madness led you here? +Crawl back into the night, #! +You thought you could match our skill? You are sorely mistaken! +When did # forsake reason for madness? +Your doom approaches, #! +Do not underestimate the Kingdom of Arnor. +Go back to the darkness whence you came! +What devilry of the Dark Lord do you bring here? +Begone from these lands! +You shall meet your doom swiftly, scum of Mordor! +I will not allow you to harm the free folk of these lands! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt b/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt new file mode 100644 index 0000000..6ce35d7 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt @@ -0,0 +1,25 @@ +Do you seek my noble company, #? +You are indeed a brave warrior! +Let us share tales of war together! +You are indeed a Man of great bravery, #! +The Forest-Men have been cowering from you! +You come to hire my men? I have plenty of fierce warriors, #. +#! Have you been fighting in the North? +I hope the Forest-Men speak our names in fear, #! +The stars in the North make me dizzy. Have you felt this too? +The Great Sunken ones finds you worthy to lead my men, #. +Men wait to be led to their glory by you, #! +The finest warriors cost a pretty penny! +Even Jungle-blood does not buy an honourable warrior! I hope you come with money! +My men would be proud to serve under your banner. +Many fine tribesmen have fallen in battle and met the Great sunken ones. Many more would meet him for you! +Your blade speaks finer than the sharp sides of the sea! +Do you come from the tides, #? +For only a small commission my men will slice the throats of your enemies. +An enemy of my enemy is my friend! +I sell no ordinary warriors! +I hear tell of tall Men in the far south. I fear they may be trouble. +My warriors can be your warriors, #! +My warriors are better than anything the snake-men can muster! +The Great Sunken ones sleep beneath the tides... +My warriors would serve you bravely! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt b/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt new file mode 100644 index 0000000..a0fdf90 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt @@ -0,0 +1,22 @@ +My honour is proven. Do you wish to prove yours, #? +You wish to control my men? Prove your valour! +You are not yet worthy of mango. May you become so. +My men serve no commoner, #! +My men slaughter Forest-Men every day! +Who are you? I am from ancient Greece! +#? What a common name! +The best animal to hunt is Forest-Man! +Fish have more bravery than you, #. Prove your worth! +Your blade has not yet tasted Forest-Man, #. +I am a proven warrior. What are you? +The Sunken ones will soon notice my name! +Mangoes are the fruit of true warlords! +I have seen the Sunken Ones with my own eyes! +You must work harder for your rewards, #. +Soon my turn will come to see the Sunken Ones. +I have others more worthy of my time. +I wish to speak to honourable Men. Move out of my way, #! +Us Men of the Sea deserve more Men like me! +I do certainly desire to consume a mango. +The only Men you will lead are the banana-collectors, #. +Return with the lives of enemies upon your sword! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/friendly.txt b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/friendly.txt new file mode 100644 index 0000000..2ba88a5 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/friendly.txt @@ -0,0 +1,37 @@ +The filthy Forest-Men hide in their trees. So we chop them down. +The fruits of our land are sweeter even than the wines of the Snake-Men! +War makes men! +At night the Sunken Ones prowl the waters. Make sure you are safe, #. +#! Do you come to bring tidings of the war? +They may appear brave, but even our leaders fear the Sunken Ones. +May the Sunken Ones never devour your offspring! +The banner of our men stands stronger than ever. +Do you seek meat or merriment, #? +Have you seen the North, #? They say the stars are strange there. +A true warrior has the blood of the a Sea Serpent! +Gold and meat. What more do I need? +My dagger has pierced many a Forest-Man. +The Men of the Forests have the strength of a twig, the pride of a mango, and the wits of a Troll-Man! +The stars foretell death. +War is imminent. I shall finally be able to prove my strength! +The Forest-Men will fall to our warriors soon! +#, have you come to listen to my brave deeds? +My blade will stain the forest red! +If you want to kill Forest-Men, #, then join me, friend! +Our chieftains say that we must fight alongside the Troll-Men in the great war. +Beware the Troll-Men, #. They are demons in the form of Men. +The Troll-Men may march with us in the war to come, but I fear and hate them no less for this. +As long as we can remember, the Troll-Men have raided our villages and murdered our people. And now we must fight alongside them? I do not like this, #. +In the deep past, our chieftains led us out of the Shadow into the Sunlands. Now I fear the Shadow is falling upon us once more. +The tribes of the great forests have long been our enemies. +I know little of the Men in the North, but our chieftains say we must march to war against them. So we shall. +We will be slaves to the Forests no longer! +Merchants from the lands of the serpent often visit our tribe. Pay them no heed. They carry useless trinkets. +Some of my people have gone to fight for the Serpent, for silver. Honourless, I call them. +King or slave, brave or weak, old or young... in time, the Sunken Ones will drown us all. +The Serpent cannot swim, the Lion is a cat that fears water, true power is with the Sunken Ones +The Sunken Ones wait deep below, beyond the light. They wait for the end, #. +The Plains-Men are proud, #. But they forget, the Waters will soon drown us all. +Beware the forests, #. Wicked Men lurk within. +Long ago, the Forest-Men made war against our people. We do not forget. +Praise the great Eye, #! He has made an end to the Troll-Men raids! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hired.txt b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hired.txt new file mode 100644 index 0000000..d8f6958 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hired.txt @@ -0,0 +1,24 @@ +If I die fighting, my family shall be proud! +May the Sunken Ones bless our weapons! +#, do we stop for meat? +I can finally prove myself in battle! +The wind holds tidings of war. +I hope one day to return to my tribe. +My feet are sore, #. +Are we to fight for the flaming Eye? +It would take a lake to quench my thirst! +You fight like a lord, #. +I have hunted zebra and crocodile. One day I shall hunt Forest-Man! +It is merely a flesh wound. +I smell battle! +My children shall be big when I return! +When a man dies, his soul meets the Sunken Ones. Some day I too will meet them. +I have trained for many a day in the heat of the plains. +Some fruit and Snake-Man water would be a blessing! +The flaming Eye fills me with fear, #. +A banana is always welcome on my plate! +#, where are we headed today? +#! Please don't put me on guard duty again! +I know no fear! +Filthy Forest-Men fear my name! +Time for drinking! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hostile.txt b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hostile.txt new file mode 100644 index 0000000..7692b03 --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/limwaith/moredain/hostile.txt @@ -0,0 +1,23 @@ +The Sunken Ones will drown your soul, #! +Flee, coward! +May you never taste mango again! +The flaming Eye will destroy you! +Did the Forest-Men send you? +#, your name will be lost to the tides! +Another soul for my blade to feed on! +An enemy of the tribes has no friends in these lands! +Go back to the forest, you pitiful twig! +Raaaaargh! +For the Sunken Ones! +Flee, unworthy creature! +#, savour your demise! +I want your blood, #! +You have the strength of the flamingo! +You defy the Oceans? +Yaaargh! +Forest-Man! Die, #! +Run or face your death, soulless one! +I have no pity for you, coward! +Our tales tell of Men such as you, #! Know that they all met their end painfully! +A test for my strength! I shall savour my victory over you! +I have seen braver bananas than you, #! \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/renegade/drunkard/neutral.txt b/build/resources/main/assets/cinder_loe/speech/renegade/drunkard/neutral.txt new file mode 100644 index 0000000..fe8fdfb --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/renegade/drunkard/neutral.txt @@ -0,0 +1,7 @@ +With three beers down, the Orc did frown, and bid the Elf goodbye, for none could know, 'twas not for show, and someone had to die. +Never enough gold... just need one more good haul. +Should have known she was lying... she said she would wait for me, but they never wait.. +...mead, mead, mead... ...kill 'em to get some beer every now and then.. Stupid bees and their stupid honey... +Lying little harlot.. that brat ain't mine, could be anyone's... won't get a single silver from me... +Hmph, wizards... now that's power.. bet they got that "secret magic".. turn wood into gold.. yeah, wish I could turn wood into gold... +Go to the college, da said. Use your smarts, he said. Idiot, how was I supposed to know what college he meant? \ No newline at end of file diff --git a/build/resources/main/assets/cinder_loe/speech/renegade/man/hostile.txt b/build/resources/main/assets/cinder_loe/speech/renegade/man/hostile.txt new file mode 100644 index 0000000..5cb584a --- /dev/null +++ b/build/resources/main/assets/cinder_loe/speech/renegade/man/hostile.txt @@ -0,0 +1,6 @@ +Your money or your life! +You'll be so much easier to rob when you're dead! +Can't wait to count out your coin... +Tell you what. You start running so I can stab you in the back. +Lookie here. Looks like we got ourselves a hero. +You picked a bad time to get lost, friend. \ No newline at end of file diff --git a/build/resources/main/assets/lotr/armor/battlenun_1.png b/build/resources/main/assets/lotr/armor/battlenun_1.png new file mode 100644 index 0000000..99ceaaa Binary files /dev/null and b/build/resources/main/assets/lotr/armor/battlenun_1.png differ diff --git a/build/resources/main/assets/lotr/armor/battlenun_2.png b/build/resources/main/assets/lotr/armor/battlenun_2.png new file mode 100644 index 0000000..b4e925e Binary files /dev/null and b/build/resources/main/assets/lotr/armor/battlenun_2.png differ diff --git a/build/resources/main/assets/lotr/armor/bree_1.png b/build/resources/main/assets/lotr/armor/bree_1.png new file mode 100644 index 0000000..7f65418 Binary files /dev/null and b/build/resources/main/assets/lotr/armor/bree_1.png differ diff --git a/build/resources/main/assets/lotr/armor/bree_2.png b/build/resources/main/assets/lotr/armor/bree_2.png new file mode 100644 index 0000000..a036bdf Binary files /dev/null and b/build/resources/main/assets/lotr/armor/bree_2.png differ diff --git a/build/resources/main/assets/lotr/armor/limwaith_wood_1.png b/build/resources/main/assets/lotr/armor/limwaith_wood_1.png new file mode 100644 index 0000000..7bfda2f Binary files /dev/null and b/build/resources/main/assets/lotr/armor/limwaith_wood_1.png differ diff --git a/build/resources/main/assets/lotr/armor/limwaith_wood_2.png b/build/resources/main/assets/lotr/armor/limwaith_wood_2.png new file mode 100644 index 0000000..952e0ff Binary files /dev/null and b/build/resources/main/assets/lotr/armor/limwaith_wood_2.png differ diff --git a/build/resources/main/assets/lotr/armor/mount/boar_red_dwarf.png b/build/resources/main/assets/lotr/armor/mount/boar_red_dwarf.png new file mode 100644 index 0000000..2f30c0d Binary files /dev/null and b/build/resources/main/assets/lotr/armor/mount/boar_red_dwarf.png differ diff --git a/build/resources/main/assets/lotr/armor/red_dwarf_1.png b/build/resources/main/assets/lotr/armor/red_dwarf_1.png new file mode 100644 index 0000000..e97e829 Binary files /dev/null and b/build/resources/main/assets/lotr/armor/red_dwarf_1.png differ diff --git a/build/resources/main/assets/lotr/armor/red_dwarf_2.png b/build/resources/main/assets/lotr/armor/red_dwarf_2.png new file mode 100644 index 0000000..3382154 Binary files /dev/null and b/build/resources/main/assets/lotr/armor/red_dwarf_2.png differ diff --git a/build/resources/main/assets/lotr/armor/red_dwarf_helmet.png b/build/resources/main/assets/lotr/armor/red_dwarf_helmet.png new file mode 100644 index 0000000..d1c59be Binary files /dev/null and b/build/resources/main/assets/lotr/armor/red_dwarf_helmet.png differ diff --git a/build/resources/main/assets/lotr/item/banner/banner_redDwarf.png b/build/resources/main/assets/lotr/item/banner/banner_redDwarf.png new file mode 100644 index 0000000..bed495d Binary files /dev/null and b/build/resources/main/assets/lotr/item/banner/banner_redDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/bars_red_dwarf.png b/build/resources/main/assets/lotr/textures/blocks/bars_red_dwarf.png new file mode 100644 index 0000000..a8e2578 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/bars_red_dwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/chandelier_red_dwarf.png b/build/resources/main/assets/lotr/textures/blocks/chandelier_red_dwarf.png new file mode 100644 index 0000000..4ac4b7e Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/chandelier_red_dwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/cinder_block.png b/build/resources/main/assets/lotr/textures/blocks/cinder_block.png new file mode 100644 index 0000000..e992bfa Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/cinder_block.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/dwarven_brick_runed.png b/build/resources/main/assets/lotr/textures/blocks/dwarven_brick_runed.png new file mode 100644 index 0000000..a088a2b Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/dwarven_brick_runed.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fishbarrel_bottom.png b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_bottom.png new file mode 100644 index 0000000..d34f15b Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fishbarrel_side.png b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_side.png new file mode 100644 index 0000000..88b7466 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_side.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fishbarrel_top.png b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_top.png new file mode 100644 index 0000000..93f7d58 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fishbarrel_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_bottom.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_bottom.png new file mode 100644 index 0000000..83ed3e6 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_0.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_0.png new file mode 100644 index 0000000..88acb55 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_0.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_180.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_180.png new file mode 100644 index 0000000..2073682 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_180.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_270.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_270.png new file mode 100644 index 0000000..fda3957 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_270.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_90.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_90.png new file mode 100644 index 0000000..da635bb Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_side_90.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/fur_bundle_top.png b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_top.png new file mode 100644 index 0000000..9de20c3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/fur_bundle_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/goldChain_bottom.png b/build/resources/main/assets/lotr/textures/blocks/goldChain_bottom.png new file mode 100644 index 0000000..6b76c9b Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/goldChain_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/goldChain_mid.png b/build/resources/main/assets/lotr/textures/blocks/goldChain_mid.png new file mode 100644 index 0000000..c40b6eb Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/goldChain_mid.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/goldChain_single.png b/build/resources/main/assets/lotr/textures/blocks/goldChain_single.png new file mode 100644 index 0000000..f8b0e15 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/goldChain_single.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/goldChain_top.png b/build/resources/main/assets/lotr/textures/blocks/goldChain_top.png new file mode 100644 index 0000000..f8b0e15 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/goldChain_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ironChain_bottom.png b/build/resources/main/assets/lotr/textures/blocks/ironChain_bottom.png new file mode 100644 index 0000000..05523c5 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ironChain_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ironChain_mid.png b/build/resources/main/assets/lotr/textures/blocks/ironChain_mid.png new file mode 100644 index 0000000..ee0680f Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ironChain_mid.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ironChain_single.png b/build/resources/main/assets/lotr/textures/blocks/ironChain_single.png new file mode 100644 index 0000000..be3a2f4 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ironChain_single.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ironChain_top.png b/build/resources/main/assets/lotr/textures/blocks/ironChain_top.png new file mode 100644 index 0000000..be3a2f4 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ironChain_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_0.png b/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_0.png new file mode 100644 index 0000000..e427528 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_0.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_90.png b/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_90.png new file mode 100644 index 0000000..b6c0bfe Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ivory_block_side_90.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/ivory_block_top.png b/build/resources/main/assets/lotr/textures/blocks/ivory_block_top.png new file mode 100644 index 0000000..74ac7de Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/ivory_block_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_bottom.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_bottom.png new file mode 100644 index 0000000..0ef6a5f Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_0.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_0.png new file mode 100644 index 0000000..da97577 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_0.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_180.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_180.png new file mode 100644 index 0000000..2cf3158 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_180.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_270.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_270.png new file mode 100644 index 0000000..c61e62e Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_270.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_90.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_90.png new file mode 100644 index 0000000..781aba3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_side_90.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/leather_bundle_top.png b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_top.png new file mode 100644 index 0000000..852cd71 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/leather_bundle_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/red_dwarf_steel.png b/build/resources/main/assets/lotr/textures/blocks/red_dwarf_steel.png new file mode 100644 index 0000000..66984c3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/red_dwarf_steel.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_bottom.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_bottom.png new file mode 100644 index 0000000..7e4a8ad Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_0.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_0.png new file mode 100644 index 0000000..e6c2ef9 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_0.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_180.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_180.png new file mode 100644 index 0000000..671c03a Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_180.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_270.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_270.png new file mode 100644 index 0000000..0839f6a Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_270.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_90.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_90.png new file mode 100644 index 0000000..51fdaec Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_side_90.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/reed_bale_top.png b/build/resources/main/assets/lotr/textures/blocks/reed_bale_top.png new file mode 100644 index 0000000..7e4a8ad Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/reed_bale_top.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/silverChain_bottom.png b/build/resources/main/assets/lotr/textures/blocks/silverChain_bottom.png new file mode 100644 index 0000000..b916cbf Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/silverChain_bottom.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/silverChain_mid.png b/build/resources/main/assets/lotr/textures/blocks/silverChain_mid.png new file mode 100644 index 0000000..f2fcebc Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/silverChain_mid.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/silverChain_single.png b/build/resources/main/assets/lotr/textures/blocks/silverChain_single.png new file mode 100644 index 0000000..3459046 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/silverChain_single.png differ diff --git a/build/resources/main/assets/lotr/textures/blocks/silverChain_top.png b/build/resources/main/assets/lotr/textures/blocks/silverChain_top.png new file mode 100644 index 0000000..3459046 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/blocks/silverChain_top.png differ diff --git a/build/resources/main/assets/lotr/textures/items/alatarStaff.png b/build/resources/main/assets/lotr/textures/items/alatarStaff.png new file mode 100644 index 0000000..e3c599a Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/alatarStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/banner_redDwarf.png b/build/resources/main/assets/lotr/textures/items/banner_redDwarf.png new file mode 100644 index 0000000..67b317a Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/banner_redDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/battleaxeLimwaith.png b/build/resources/main/assets/lotr/textures/items/battleaxeLimwaith.png new file mode 100644 index 0000000..5c54f68 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/battleaxeLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/battleaxeRedDwarf.png b/build/resources/main/assets/lotr/textures/items/battleaxeRedDwarf.png new file mode 100644 index 0000000..21c81a2 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/battleaxeRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/blowgunLimwaith.png b/build/resources/main/assets/lotr/textures/items/blowgunLimwaith.png new file mode 100644 index 0000000..26859f1 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/blowgunLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/boarArmorRedDwarf.png b/build/resources/main/assets/lotr/textures/items/boarArmorRedDwarf.png new file mode 100644 index 0000000..0ba3968 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/boarArmorRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bodyArnorBanner.png b/build/resources/main/assets/lotr/textures/items/bodyArnorBanner.png new file mode 100644 index 0000000..a50fc62 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bodyArnorBanner.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bodyBree.png b/build/resources/main/assets/lotr/textures/items/bodyBree.png new file mode 100644 index 0000000..386f36b Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bodyBree.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bodyLimwaith.png b/build/resources/main/assets/lotr/textures/items/bodyLimwaith.png new file mode 100644 index 0000000..b919b0a Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bodyLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bodyRedDwarf.png b/build/resources/main/assets/lotr/textures/items/bodyRedDwarf.png new file mode 100644 index 0000000..6bff7e4 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bodyRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bootsArnorBanner.png b/build/resources/main/assets/lotr/textures/items/bootsArnorBanner.png new file mode 100644 index 0000000..09309d9 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bootsArnorBanner.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bootsBree.png b/build/resources/main/assets/lotr/textures/items/bootsBree.png new file mode 100644 index 0000000..f794b8c Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bootsBree.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bootsLimwaith.png b/build/resources/main/assets/lotr/textures/items/bootsLimwaith.png new file mode 100644 index 0000000..2268432 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bootsLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/bootsRedDwarf.png b/build/resources/main/assets/lotr/textures/items/bootsRedDwarf.png new file mode 100644 index 0000000..a6b8890 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/bootsRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf.png b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf.png new file mode 100644 index 0000000..3896ba0 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png new file mode 100644 index 0000000..c161d32 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png differ diff --git a/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png new file mode 100644 index 0000000..eecc1d9 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png differ diff --git a/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png new file mode 100644 index 0000000..fcf1e47 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png differ diff --git a/build/resources/main/assets/lotr/textures/items/daggerLimwaith.png b/build/resources/main/assets/lotr/textures/items/daggerLimwaith.png new file mode 100644 index 0000000..8b7b130 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/daggerLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/daggerLimwaithPoisoned.png b/build/resources/main/assets/lotr/textures/items/daggerLimwaithPoisoned.png new file mode 100644 index 0000000..49d50ca Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/daggerLimwaithPoisoned.png differ diff --git a/build/resources/main/assets/lotr/textures/items/daggerRedDwarf.png b/build/resources/main/assets/lotr/textures/items/daggerRedDwarf.png new file mode 100644 index 0000000..3d34186 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/daggerRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/daggerRedDwarfPoisoned.png b/build/resources/main/assets/lotr/textures/items/daggerRedDwarfPoisoned.png new file mode 100644 index 0000000..d8acb24 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/daggerRedDwarfPoisoned.png differ diff --git a/build/resources/main/assets/lotr/textures/items/frostblade.png b/build/resources/main/assets/lotr/textures/items/frostblade.png new file mode 100644 index 0000000..16fb0b0 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/frostblade.png differ diff --git a/build/resources/main/assets/lotr/textures/items/gandalfStaffGrey.png b/build/resources/main/assets/lotr/textures/items/gandalfStaffGrey.png new file mode 100644 index 0000000..6dcb3ef Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/gandalfStaffGrey.png differ diff --git a/build/resources/main/assets/lotr/textures/items/gandalfStaffWhite.png b/build/resources/main/assets/lotr/textures/items/gandalfStaffWhite.png new file mode 100644 index 0000000..fba1bf1 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/gandalfStaffWhite.png differ diff --git a/build/resources/main/assets/lotr/textures/items/goldChain.png b/build/resources/main/assets/lotr/textures/items/goldChain.png new file mode 100644 index 0000000..3f28968 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/goldChain.png differ diff --git a/build/resources/main/assets/lotr/textures/items/hammerRedDwarf.png b/build/resources/main/assets/lotr/textures/items/hammerRedDwarf.png new file mode 100644 index 0000000..1447866 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/hammerRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/helmetArnorBanner.png b/build/resources/main/assets/lotr/textures/items/helmetArnorBanner.png new file mode 100644 index 0000000..89539fa Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/helmetArnorBanner.png differ diff --git a/build/resources/main/assets/lotr/textures/items/helmetBree.png b/build/resources/main/assets/lotr/textures/items/helmetBree.png new file mode 100644 index 0000000..49b55a3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/helmetBree.png differ diff --git a/build/resources/main/assets/lotr/textures/items/helmetLimwaith.png b/build/resources/main/assets/lotr/textures/items/helmetLimwaith.png new file mode 100644 index 0000000..191eaeb Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/helmetLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/helmetRedDwarf.png b/build/resources/main/assets/lotr/textures/items/helmetRedDwarf.png new file mode 100644 index 0000000..5b3c30e Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/helmetRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/ironChain.png b/build/resources/main/assets/lotr/textures/items/ironChain.png new file mode 100644 index 0000000..c9e8732 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/ironChain.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/alatarStaff.png b/build/resources/main/assets/lotr/textures/items/large/alatarStaff.png new file mode 100644 index 0000000..9ec9224 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/alatarStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/battleaxeLimwaith.png b/build/resources/main/assets/lotr/textures/items/large/battleaxeLimwaith.png new file mode 100644 index 0000000..59c9ef9 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/battleaxeLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/frostblade.png b/build/resources/main/assets/lotr/textures/items/large/frostblade.png new file mode 100644 index 0000000..b03cd28 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/frostblade.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/gandalfStaffGrey.png b/build/resources/main/assets/lotr/textures/items/large/gandalfStaffGrey.png new file mode 100644 index 0000000..bc9a248 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/gandalfStaffGrey.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/gandalfStaffWhite.png b/build/resources/main/assets/lotr/textures/items/large/gandalfStaffWhite.png new file mode 100644 index 0000000..e86f7ab Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/gandalfStaffWhite.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/pallandoStaff.png b/build/resources/main/assets/lotr/textures/items/large/pallandoStaff.png new file mode 100644 index 0000000..f7ea81d Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/pallandoStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/radagastStaff.png b/build/resources/main/assets/lotr/textures/items/large/radagastStaff.png new file mode 100644 index 0000000..966a4b4 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/radagastStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/sarumanStaff.png b/build/resources/main/assets/lotr/textures/items/large/sarumanStaff.png new file mode 100644 index 0000000..0262cb5 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/sarumanStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/spearLimwaith.png b/build/resources/main/assets/lotr/textures/items/large/spearLimwaith.png new file mode 100644 index 0000000..22ac4ef Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/spearLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/spearRedDwarf.png b/build/resources/main/assets/lotr/textures/items/large/spearRedDwarf.png new file mode 100644 index 0000000..33b2080 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/spearRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png b/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png new file mode 100644 index 0000000..1ab9bc9 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta b/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta new file mode 100644 index 0000000..dbfacda --- /dev/null +++ b/build/resources/main/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta @@ -0,0 +1,68 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14 + ] + } +} diff --git a/build/resources/main/assets/lotr/textures/items/large/tridentLimwaith.png b/build/resources/main/assets/lotr/textures/items/large/tridentLimwaith.png new file mode 100644 index 0000000..0f0c260 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/tridentLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large/whip.png b/build/resources/main/assets/lotr/textures/items/large/whip.png new file mode 100644 index 0000000..838c6e6 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large/whip.png differ diff --git a/build/resources/main/assets/lotr/textures/items/large2/pikeRedDwarf.png b/build/resources/main/assets/lotr/textures/items/large2/pikeRedDwarf.png new file mode 100644 index 0000000..a2a5b41 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/large2/pikeRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/legsArnorBanner.png b/build/resources/main/assets/lotr/textures/items/legsArnorBanner.png new file mode 100644 index 0000000..00de686 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/legsArnorBanner.png differ diff --git a/build/resources/main/assets/lotr/textures/items/legsBree.png b/build/resources/main/assets/lotr/textures/items/legsBree.png new file mode 100644 index 0000000..2a93dfd Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/legsBree.png differ diff --git a/build/resources/main/assets/lotr/textures/items/legsLimwaith.png b/build/resources/main/assets/lotr/textures/items/legsLimwaith.png new file mode 100644 index 0000000..1b181d4 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/legsLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/legsRedDwarf.png b/build/resources/main/assets/lotr/textures/items/legsRedDwarf.png new file mode 100644 index 0000000..5ade19c Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/legsRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/maceArnor.png b/build/resources/main/assets/lotr/textures/items/maceArnor.png new file mode 100644 index 0000000..f7e7dd3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/maceArnor.png differ diff --git a/build/resources/main/assets/lotr/textures/items/pallandoStaff.png b/build/resources/main/assets/lotr/textures/items/pallandoStaff.png new file mode 100644 index 0000000..2f5793b Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/pallandoStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/pikeRedDwarf.png b/build/resources/main/assets/lotr/textures/items/pikeRedDwarf.png new file mode 100644 index 0000000..54c70a3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/pikeRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/radagastStaff.png b/build/resources/main/assets/lotr/textures/items/radagastStaff.png new file mode 100644 index 0000000..cb83a47 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/radagastStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/redDwarfSteel.png b/build/resources/main/assets/lotr/textures/items/redDwarfSteel.png new file mode 100644 index 0000000..d6dc164 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/redDwarfSteel.png differ diff --git a/build/resources/main/assets/lotr/textures/items/sarumanStaff.png b/build/resources/main/assets/lotr/textures/items/sarumanStaff.png new file mode 100644 index 0000000..c5eb5b8 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/sarumanStaff.png differ diff --git a/build/resources/main/assets/lotr/textures/items/silverChain.png b/build/resources/main/assets/lotr/textures/items/silverChain.png new file mode 100644 index 0000000..422357d Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/silverChain.png differ diff --git a/build/resources/main/assets/lotr/textures/items/spawn_egg.png b/build/resources/main/assets/lotr/textures/items/spawn_egg.png new file mode 100644 index 0000000..b1a25ee Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/spawn_egg.png differ diff --git a/build/resources/main/assets/lotr/textures/items/spearLimwaith.png b/build/resources/main/assets/lotr/textures/items/spearLimwaith.png new file mode 100644 index 0000000..51f8cdf Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/spearLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/spearRedDwarf.png b/build/resources/main/assets/lotr/textures/items/spearRedDwarf.png new file mode 100644 index 0000000..c794507 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/spearRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/spearsolidgold.png b/build/resources/main/assets/lotr/textures/items/spearsolidgold.png new file mode 100644 index 0000000..6e830d3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/spearsolidgold.png differ diff --git a/build/resources/main/assets/lotr/textures/items/spearsolidgold.png.mcmeta b/build/resources/main/assets/lotr/textures/items/spearsolidgold.png.mcmeta new file mode 100644 index 0000000..0b19d78 --- /dev/null +++ b/build/resources/main/assets/lotr/textures/items/spearsolidgold.png.mcmeta @@ -0,0 +1,66 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ] + } +} \ No newline at end of file diff --git a/build/resources/main/assets/lotr/textures/items/swordBree.png b/build/resources/main/assets/lotr/textures/items/swordBree.png new file mode 100644 index 0000000..d641eb3 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/swordBree.png differ diff --git a/build/resources/main/assets/lotr/textures/items/swordRedDwarf.png b/build/resources/main/assets/lotr/textures/items/swordRedDwarf.png new file mode 100644 index 0000000..d54a24e Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/swordRedDwarf.png differ diff --git a/build/resources/main/assets/lotr/textures/items/tridentLimwaith.png b/build/resources/main/assets/lotr/textures/items/tridentLimwaith.png new file mode 100644 index 0000000..6170c89 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/tridentLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/truncheonLimwaith.png b/build/resources/main/assets/lotr/textures/items/truncheonLimwaith.png new file mode 100644 index 0000000..f815038 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/truncheonLimwaith.png differ diff --git a/build/resources/main/assets/lotr/textures/items/whip.png b/build/resources/main/assets/lotr/textures/items/whip.png new file mode 100644 index 0000000..7e22414 Binary files /dev/null and b/build/resources/main/assets/lotr/textures/items/whip.png differ diff --git a/build/resources/main/assets/lotr/textures/shield/alignment_RedDwarf.png b/build/resources/main/assets/lotr/textures/shield/alignment_RedDwarf.png new file mode 100644 index 0000000..065901c Binary files /dev/null and b/build/resources/main/assets/lotr/textures/shield/alignment_RedDwarf.png differ diff --git a/build/resources/main/mcmod.info b/build/resources/main/mcmod.info new file mode 100644 index 0000000..ee0494e --- /dev/null +++ b/build/resources/main/mcmod.info @@ -0,0 +1,22 @@ +{ + "modListVersion": 2, + "modList": [{ + "modid": "cinder_loe", + "name": "CinderLoE", + "description": "CINDER MOD. +Mod designed to add blocks to The Lord of Embers Minecraft server.", + "version": "68a4f22-main+68a4f22a48-dirty", + "mcversion": "extension 'minecraft' property 'mcVersion'", + "url": "thelordofembers.com", + "updateUrl": "", + "authorList": ["Shinare"], + "credits": "", + "logoFile": "", + "screenshots": [], + "parent": "", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + }] +} diff --git a/build/resources/main/mixins.cinder_loe.json b/build/resources/main/mixins.cinder_loe.json new file mode 100644 index 0000000..aae8119 --- /dev/null +++ b/build/resources/main/mixins.cinder_loe.json @@ -0,0 +1,34 @@ +{ + "required": true, + "minVersion": "0.7.11", + "package": "com.zivilon.cinder_loe.mixins", + "refmap": "mixins.cinder_loe.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "MixinLOTRTileEntityDwarvenForge", + "MixinLOTRIntCache", + "MixinLOTRWorldGenMumakSkeleton", + "MixinItemRenderer", + "MixinRenderItem", + "MixinLOTRClientProxy", + "MixinLOTRContainerAnvil", + "MixinLOTRArmorModels", + "MixinLOTRRenderElvenBlade", + "MixinLOTRRenderLargeItem", + "MixinLOTRRenderCrossbow", + "MixinLOTRRenderThrowingAxe", + "MixinLOTRRenderPlateFood", + "MixinLOTRRenderBlownItem", + "MixinLOTRRenderBow", + "MixinLOTRRenderElf", + "MixinLOTRNPCRendering", + "MixinLOTRRenderDart", + "MixinLOTRRenderTraderRespawn", + "MixinLOTRRenderNPCRespawner", + "MixinRendererLivingEntity", + "MixinLOTRRenderArmorStand", + "MixinLOTREntitySauron" + ], + "client": [] +} diff --git a/build/resources/main/mixins.cinder_loe.refmap.json b/build/resources/main/mixins.cinder_loe.refmap.json new file mode 100644 index 0000000..456f831 --- /dev/null +++ b/build/resources/main/mixins.cinder_loe.refmap.json @@ -0,0 +1,4 @@ +{ + "mappings": {}, + "data": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/Log4j-config.xsd b/build/resources/patchedMc/Log4j-config.xsd new file mode 100644 index 0000000..a19e125 --- /dev/null +++ b/build/resources/patchedMc/Log4j-config.xsd @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/resources/patchedMc/Log4j-events.dtd b/build/resources/patchedMc/Log4j-events.dtd new file mode 100644 index 0000000..91af8c7 --- /dev/null +++ b/build/resources/patchedMc/Log4j-events.dtd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/resources/patchedMc/Log4j-events.xsd b/build/resources/patchedMc/Log4j-events.xsd new file mode 100644 index 0000000..2310227 --- /dev/null +++ b/build/resources/patchedMc/Log4j-events.xsd @@ -0,0 +1,74 @@ + + + + + + + Log4J 2.0 XML Schema for XML log event files. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/resources/patchedMc/assets/fml/lang/en_US.lang b/build/resources/patchedMc/assets/fml/lang/en_US.lang new file mode 100644 index 0000000..d57f99f --- /dev/null +++ b/build/resources/patchedMc/assets/fml/lang/en_US.lang @@ -0,0 +1,82 @@ +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point! SIMPSON'S INDIVIDUAL STRINGETTES! THE NOW STRING! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default: %s] +fml.configgui.tooltip.defaultNumeric=[range: %s ~ %s, default: %s] diff --git a/build/resources/patchedMc/assets/fml/textures/gui/forge.gif b/build/resources/patchedMc/assets/fml/textures/gui/forge.gif new file mode 100644 index 0000000..b316837 Binary files /dev/null and b/build/resources/patchedMc/assets/fml/textures/gui/forge.gif differ diff --git a/build/resources/patchedMc/assets/fml/textures/gui/forge.png b/build/resources/patchedMc/assets/fml/textures/gui/forge.png new file mode 100644 index 0000000..1be137a Binary files /dev/null and b/build/resources/patchedMc/assets/fml/textures/gui/forge.png differ diff --git a/build/resources/patchedMc/assets/fml/textures/gui/icons.png b/build/resources/patchedMc/assets/fml/textures/gui/icons.png new file mode 100644 index 0000000..20bb91e Binary files /dev/null and b/build/resources/patchedMc/assets/fml/textures/gui/icons.png differ diff --git a/build/resources/patchedMc/assets/forge/lang/af_ZA.lang b/build/resources/patchedMc/assets/forge/lang/af_ZA.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/af_ZA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ar_SA.lang b/build/resources/patchedMc/assets/forge/lang/ar_SA.lang new file mode 100644 index 0000000..74c99f9 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ar_SA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=استخدم /forge الأوامر الفرعية المتاحة "tps" و "tack" +commands.forge.usage.tracking=استخدم forge track / . الأنواع المقبولة Tile Entities) te). يجب أن تكون المدة أقل من 60. +commands.forge.tps.summary=%s \: تعني وقت الدقز \: %d ميللي ثانية. Mean TPS\:%d + +commands.forge.tracking.te.enabled=بلاط تعقب الكيان ممكن ل %d ثوان. +forge.texture.preload.warning=تحذير\: النسيج %s لم يتم تحميله مسبقا، مما سيؤدي لأخطاء في التجسيد\! +forge.client.shutdown.internal=يتم إغلاق السيرفر الداخلي... +forge.update.newversion=إصدار جديد من فورج موجود\: %s +forge.update.beta.1=%sتحذير\:%s نسخة بيتا من فورج +forge.update.beta.2=مشاكل كبيرة قد تظهر، تأك\\ قبل الإبلاغ. + +forge.configgui.forgeConfigTitle=خيارات ماينكرافت فورج +forge.configgui.ctgy.forgeGeneralConfig.tooltip=هنا يمكنك أن تغير الخيارات الموجودة في forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=الخيارات العامة +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=هنا حيث يمكنك تعديل الإعدادات المحتواة في forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/br_FR.lang b/build/resources/patchedMc/assets/forge/lang/br_FR.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/br_FR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ca_ES.lang b/build/resources/patchedMc/assets/forge/lang/ca_ES.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ca_ES.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/cs_CZ.lang b/build/resources/patchedMc/assets/forge/lang/cs_CZ.lang new file mode 100644 index 0000000..4bf54fe --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/cs_CZ.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Použijte /forge . Podpříkazy jsou tps, track +commands.forge.usage.tracking=Použijte /forge track . Platné typy jsou te (Tile Entity). Trvání je < 60. +commands.forge.tps.summary=%s \: Průměrná délka ticku\: %d ms. Průměrný počet ticků za vteřinu (TPS)\: %d + +commands.forge.tracking.te.enabled=Sledování Tile Entit zapnuto na %d sekund. +forge.texture.preload.warning=Upozornění\: Textura %s nebyla načtena, to může způsobit chyby v grafice\! +forge.client.shutdown.internal=Vypínám interní server... +forge.update.newversion=Je k dispozici nová verze Forge\: %s +forge.update.beta.1=%sVarování\: %sForge Beta +forge.update.beta.2=Mohou se vyskytnout vážné problémy, prosím hlaste pouze reprodukovatelné chyby. + +forge.configgui.forgeConfigTitle=Nastavení Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Zde můžete upravovat nastavení uložená ve forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Obecná nastavení +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Zde můžete upravovat nastavení uložená ve forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Výchozí nastavení Forge Chunk Loaderu +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Zde můžete nastavit volby pro každou modifikaci (mod), tyto volby se použijí místo výchozích. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Umožňují změnit nastavení pro každou modifikaci (mod) zvlášť, tato nastavení přepíší výchozí. Hodnota nula v jakékoliv položce způsobí zakázání načítání chunků pro danou modifikaci. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Ovládá rozsah prolínání barev oblohy u biomů. +forge.configgui.biomeSkyBlendRange=Rozsah prolínání barev oblohy +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Vypnout kontrolu verze Forge +forge.configgui.enableGlobalConfig=Povolit globální nastavení +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Nastavte tuto položku na true, pokud chcete vynutit spadnutí v případě pokusu o propojení více než jednoho bloku ke stejné tekutině. +forge.configgui.forceDuplicateFluidBlockCrash=Vynutit spadnutí při duplikaci bloku tekutiny +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Odstranit entity způsobující chyby +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Odstranit blokové entity způsobující chyby +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Řazení receptů +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Šance na zombie dítě +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Šance vyvolání zombie +forge.configgui.stencilbits=Povolit GL Stencil bity +forge.configgui.spawnfuzz=Rozptyl průměru oživení + +forge.configgui.modID.tooltip=ID modu pro který chcete přidat přepisovací volby. +forge.configgui.modID=ID modu +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Povolit přepisovací pravidla modifikací +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/da_DK.lang b/build/resources/patchedMc/assets/forge/lang/da_DK.lang new file mode 100644 index 0000000..84796df --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/da_DK.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Gennemsnitlig tick tid\: %d ms. Gennemsnitlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forudindlæst, dette vil foresage grafiske fejl\! +forge.client.shutdown.internal=Lukker intern server... +forge.update.newversion=Ny Forge version tilgængelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan finde sted, tjek før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge Konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Her kan du redigere de indstillinger, der findes i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle indstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Her kan du redigere de indstillinger, der findes i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Kontroller rækkevidden af himmel blanding for farvede himle i biomer. +forge.configgui.biomeSkyBlendRange=Biome Himmelblandings Rækkevidde +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Pakkesammenklumpningstærskel +forge.configgui.disableVersionCheck.tooltip=Set til sand for at deaktivere Forge's verions tjeknings mekanik. Forge henter en lille json fil fra vores server for versionsinformation. For flere detaljer se ForgeVersion klassen på vores github. +forge.configgui.disableVersionCheck=Deaktiver Forge Versionstjek +forge.configgui.enableGlobalConfig=Aktiver Global Konfiguration +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set dette til sand for at fremtvinge et crash hvis mere end en block førsoger at koble tilbage til den samme væske. +forge.configgui.forceDuplicateFluidBlockCrash=Tving Duplikat Væske Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sorter Opskrifter +forge.configgui.zombieBabyChance.tooltip=Chancen hvorpå en zombie (eller underklasse) er en baby. Tillader ændringen af zombie spawn mekanikken. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Grundlæggende zombie fremmanings spawn chance. Tillader ændringen af bonus zombie fremmaningsmekanikken. +forge.configgui.zombieBaseSummonChance=Zombie Fremmanings Chance +forge.configgui.stencilbits=Aktiver GL Stencil Bits +forge.configgui.spawnfuzz=Genoplivningsvariations Diameter + +forge.configgui.modID.tooltip=Mod ID'en du ønsker at overskrive indstillinger for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Aktiver den indstilling for at tillade definitionen af brugerdefinerede pr. mod indstillinger. +forge.configgui.enableModOverrides=Aktiver Mod Overskrivning +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Billet Begrænsning +forge.configgui.playerTicketCount.tooltip=Mængden af billeter en spiller kan tildeles i stedet for et mod. Dette er delt over alle mods, og det er op til mods'ene at bruge det. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/de_DE.lang b/build/resources/patchedMc/assets/forge/lang/de_DE.lang new file mode 100644 index 0000000..8972140 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/de_DE.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Verwende /forge . Mögliche Befehle sind\: tps, track +commands.forge.usage.tracking=Verwende /forge track . Gültige Typen sind te (Tile Entities). Dauer ist < 60. +commands.forge.tps.summary=%s \: Durchschnittliche Zeit pro Tick\: %d ms. Durchschnittliche TPS\: %d + +commands.forge.tracking.te.enabled=Tile-Entity-Tracking für %d Sekunden aktiviert. +forge.texture.preload.warning=Warnung\: Textur %s nicht geladen, dies wird Rendering-Fehler verursachen\! +forge.client.shutdown.internal=Interner Server wird heruntergefahren... +forge.update.newversion=Neue Forge-Version verfügbar\: %s +forge.update.beta.1=%sWARNUNG\: %sForge Beta +forge.update.beta.2=Größere Probleme könnten auftreten, bitte nur reproduzierbare Fehler melden. + +forge.configgui.forgeConfigTitle=Minecraft Forge-Konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Hier kannst du die in forge.cfg gespeicherten Einstellungen bearbeiten. +forge.configgui.ctgy.forgeGeneralConfig=Allgemeine Einstellungen +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Hier können sie die in forgeChunkLoading.cfg gespeicherten Einstellungen bearbeiten. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Standard Einstellungen +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Hier kannst du mod-spezifische Einstellungen überschreiben, welche statt des Standards genutzt werden. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod-Überschreibung +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Erlaubt dir, mod-spezifische Einstellungen festzulegen, welche die Standardwerte überschreiben. Ein Wert von 0 deaktiviert effektiv jede Chunkloading Fähigkeiten einer Mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Füge neue Mod-Überschreibung hinzu +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Bestimmt die Reichweite für Überblendung des gefärbten Himmels in Biomen. +forge.configgui.biomeSkyBlendRange=Reichweite der Biom-Himmelsüberblendung +forge.configgui.clumpingThreshold.tooltip=Bestimmt die Schwelle, ab der Packet51 statt Packet52 bevorzugt wird. +forge.configgui.clumpingThreshold=Schwelle der Packet-Gruppierung +forge.configgui.disableVersionCheck.tooltip=Setze diesen Wert auf true, um die Versionsüberprüfung von Forge zu deaktivieren. Forge ruft eine kleine JSON-Datei mit Versionsinformationen auf unserem Server ab. Die ForgeVersion-Klasse auf GitHub enthält weitere Details. +forge.configgui.disableVersionCheck=Deaktiviere den Forge Versions-Check +forge.configgui.enableGlobalConfig=Nutze globale Konfiguration +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Setz dies auf true um einen Absturz zu erzwingen, wenn mehr als ein Block versucht sich zu einer Flüssigkeit zu verbinden. +forge.configgui.forceDuplicateFluidBlockCrash=Erzwinge einen Crash bei doppelt registrierten Flüssigkeitsblöcken +forge.configgui.fullBoundingBoxLadders.tooltip=Setze diesen Wert auf true, damit die ganze Kollisionsbox eines Entitys statt nur der aktuelle Block bei Leitern überprüft wird. Verursacht bemerkbare Unterschiede in der Spielmechanik, weshalb Vanilla das Standardverhalten vorgibt. +forge.configgui.fullBoundingBoxLadders=Leitern mit gesamter Kollisionsbox +forge.configgui.removeErroringEntities.tooltip=Setze dies auf true, um jeden Entity, welcher einen Fehler während seiner Update-Methode erzeugt, zu löschen, anstatt dass der Server geschlossen wird und ein Absturzbericht erzeugt wird. SEI GEWARNT, DIES KÖNNTE EIN CHAOS ERZEUGEN. BENUTZE ES SPARSAM, WIR ÜBERNEHMEN KEINERLEI HAFTUNG BEI SCHÄDEN. +forge.configgui.removeErroringEntities=Entferne fehlerhafte Entities +forge.configgui.removeErroringTileEntities.tooltip=Setze diesen Wert auf true, damit alle TileEntities, die Fehler bei ihrer Aktualisierung verursachen, gelöscht werden und der Server nicht abstürzt. DIESE EINSTELLUNG KANN ALLES ZERSTÖREN, VERWENDE SIE DESHALB MIT VORSICHT. WIR ÜBERNEHMEN KEINERLEI HAFTUNG BEI SCHÄDEN. +forge.configgui.removeErroringTileEntities=Entferne fehlerhafte Tile Entities +forge.configgui.sortRecipies.tooltip=Setze diesen Wert auf true, damit Forge Crafting-Rezepte nach dem letzten Ladeschritt sortiert. Kann Asynchronität bei widersprüchlichen Rezepten verursachen. MINECRAFT MUSS NEUGESTARTET WERDEN, WENN DIESE EINSTELLUNG IN DER GUI GEÄNDERT WIRD. +forge.configgui.sortRecipies=Rezepte sortieren +forge.configgui.zombieBabyChance.tooltip=Wahrscheinlichkeit, dass ein Zombie (oder Unterklasse) ein Baby ist. Erlaubt das Ändern des Zombie-Spawning-Verhaltens. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Basiswahrscheinlichkeit für das Spawnen von Zombie-Verstärkung. Ermöglicht die Änderung des Mechanismus zur Bonus-Zombie-Verstärkung. +forge.configgui.zombieBaseSummonChance=Zombie Spawn Chance +forge.configgui.stencilbits=GL-Stencil-Bits aktivieren +forge.configgui.spawnfuzz=Respawn-Durchmesser + +forge.configgui.modID.tooltip=Die Mod-ID, für die du eigene Einstellungen setzen willst. +forge.configgui.modID=Mod-ID +forge.configgui.dormantChunkCacheSize.tooltip=Night geladene Chunks können zuerst in einem ruhenden Cache belassen werden, um schnellere Ladezeiten zu erreichen. Lege die Größe (in Chunks) dieses Cache hier fest. +forge.configgui.dormantChunkCacheSize=Größe des ruhenden Chunk-Caches +forge.configgui.enableModOverrides.tooltip=Aktiviere diese Einstellung, um eigene Mod-spezifische Einstellungen zu definieren. +forge.configgui.enableModOverrides=Mod-Overrides aktivieren +forge.configgui.maximumChunksPerTicket.tooltip=Dies ist die maximale Anzahl an Chunks, die ein einzelnes Ticket erzwingen kann. +forge.configgui.maximumChunksPerTicket=Chunks pro Ticket Limit +forge.configgui.maximumTicketCount.tooltip=Dies ist die Anzahl an Chunk-Ladeanfragen, die eine Mod machen darf. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=Die Anzahl der Tickets, die einem Spieler statt einer Mod zugeordnet werden können. Dieser Wert wird von allen Mods geteilt und muss von diesen verwendet werden. +forge.configgui.playerTicketCount=Spieler Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/el_GR.lang b/build/resources/patchedMc/assets/forge/lang/el_GR.lang new file mode 100644 index 0000000..68c7145 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/el_GR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Χρησιμοποιήστε /forge . Οι υποεντολές είναι tps, track +commands.forge.usage.tracking=Χρησιμοποιήστε /forge track . Έγκυροι τύποι είναι te (Tile Entities).H Διάρκεια είναι <60. +commands.forge.tps.summary=%s \: Μέσος χρόνος tick \: %d ms. Μέσος TPS\: %d + +commands.forge.tracking.te.enabled=Εντοπισμός Tile Entity ενεργοποιημένος για %d δευτερόλεπτα. +forge.texture.preload.warning=Προειδοποίηση\: Το Texture %s δεν είναι προφορτωμένο και αυτό θα προκαλέσει πρόβληματα στο render\! +forge.client.shutdown.internal=Τερματισμός του εσωτερικού διακομιστή... +forge.update.newversion=Νέα έκδοση του Forge διαθέσιμη\: %s +forge.update.beta.1=%sΠΡΟΣΟΧΗ\:%sForge Beta +forge.update.beta.2=Σοβαρά προβλήματα μπορεί να προκύψουν, επαληθεύστε πριν το αναφέρεται. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Από εδώ μπορείτε να επεξεργαστείτε τις ρυθμίσεις που περιέχονται στο forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Γενικές Ρυθμίσεις +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Απενεργοποίηση ελέγχου έκδοσης Forge +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ταξινόμηση Συνταγών +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/en_US.lang b/build/resources/patchedMc/assets/forge/lang/en_US.lang new file mode 100644 index 0000000..aade6ab --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/en_US.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with no defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/es_ES.lang b/build/resources/patchedMc/assets/forge/lang/es_ES.lang new file mode 100644 index 0000000..ed708dd --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/es_ES.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Utilice /forge . Los subcomandos son tps, track +commands.forge.usage.tracking=Use /forge track . Los tipos válidos son te (Tile Entities). La duración es < 60. +commands.forge.tps.summary=%s \: Tiempo medio por tick\: %d ms. TPS medio\: %d + +commands.forge.tracking.te.enabled=Seguimiento de Tile Entity activado por %d segundos. +forge.texture.preload.warning=ADVERTENCIA\: Textura %s no precargada, causará fallos gráficos\! +forge.client.shutdown.internal=Apagando el servidor interno... +forge.update.newversion=Nueva versión de Forge disponible\: %s +forge.update.beta.1=%sADVERTENCIA\: %sForge Beta +forge.update.beta.2=Problemas mayores pueden surgir, verificar antes de reportar. + +forge.configgui.forgeConfigTitle=Configuración de Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aquí es donde puedes editar la configuración contenida en forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Configuración General +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aquí es donde puedes editar la configuración contenida en forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configuración Por Defecto Del Cargador De Divisiones De Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aquí es donde puedes definir ajustes específicos de modificaciones, que se utilizarán en lugar de los predeterminados. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Sobrecarga Por Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir una modificación por cada mod respecto de los valores por defecto. Un valor en cero en cualquiera de los campos previene al mod de cargar divisiones de el mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Agregar Sobrecarga Por Mod +forge.configgui.ctgy.VersionCheckConfig=Ajustes de comprobación de versiones + +forge.configgui.biomeSkyBlendRange.tooltip=Controla el rango de la mezcla para cielos colorizados por biomas. +forge.configgui.biomeSkyBlendRange=Rango De Mezcla Del Cielo Por Bioma +forge.configgui.clumpingThreshold.tooltip=Controla el umbral en el cual un Packet51 es preferido sobre un Packet52. +forge.configgui.clumpingThreshold=Umbral De Corte De Paquete +forge.configgui.disableVersionCheck.tooltip=Establecer en true para deshabilitar la comprobación de la versión de Forge. Forge consulta un pequeño archivo json en nuestro servidor para obtener información de la versión. Para mas detalles puede consultar la clase ForgeVersion en nuestro repositorio github. +forge.configgui.disableVersionCheck=Deshabilitar La Comprobación De Versión De Forge +forge.configgui.enableGlobalConfig=Habilitar La Configuración Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Al establecer esta opción en true se fuerza la detención si más de un líquido intenta ocupar el mismo bloque al mismo tiempo. +forge.configgui.forceDuplicateFluidBlockCrash=Forzar Detención En Duplicación De Bloque Liquido +forge.configgui.fullBoundingBoxLadders.tooltip=Al establecer esta opción en true se comprobará la colisión de la entidad en una caja para escaleras de mano en lugar de el bloque en el que estén. Provoca diferencias notables en la su funcionamiento, por lo que por defecto su comportamiento es el predeterminado. +forge.configgui.fullBoundingBoxLadders=Colisión de la entidad en una caja para escaleras de mano +forge.configgui.removeErroringEntities.tooltip=Al establecer esta opción en true se elimina cualquier entidad que muestre un error en su método de actualización en vez de cerrar el servidor e informar en el registro de cuelgues. ADVERTENCIA\: ESTO PUEDE CAUSAR ERRORES IRREVERSIBLES. USAR CON PRECAUCIÓN, NO NOS HACEMOS RESPONSABLES DE CUALQUIER DAÑO OCASIONADO. +forge.configgui.removeErroringEntities=Quitar Entidades con Errores +forge.configgui.removeErroringTileEntities.tooltip=Al establecer esta opción en true se elimina cualquier TileEntity que muestre un error en su método de actualización en vez de cerrar el servidor e informar en el registro de cuelgues. ADVERTENCIA\: ESTO PUEDE CAUSAR ERRORES IRREVERSIBLES. USAR CON PRECAUCIÓN, NO NOS HACEMOS RESPONSABLES DE CUALQUIER DAÑO OCASIONADO. +forge.configgui.removeErroringTileEntities=Quitar Tile Entities con Errores +forge.configgui.sortRecipies.tooltip=Poner en true para permitir el ordenamiento post inicializacion de recetas de crafteo usando el clasificador de Forge. Puede causar un desempate en recetas con conflictos. SE DEBE REINICIAR MINECRAFT SI HUBO CAMBIOS EN EL INTERFAZ DE CONFIGURACION "CONFIG GUI". +forge.configgui.sortRecipies=Ordenar Recetas +forge.configgui.zombieBabyChance.tooltip=Probabilidad de que un zombie (o subclase) sea un bebé. Permite cambiar la mecanica de generación de zombies. +forge.configgui.zombieBabyChance=Probablildad de Zombie bebé +forge.configgui.zombieBaseSummonChance.tooltip=Probabilidad base de generación de zombis. Permite cambiar la función de generación adicional de zombis. +forge.configgui.zombieBaseSummonChance=Probabilidad de invocación de zombie +forge.configgui.stencilbits=Activar plantillas de bits GL +forge.configgui.spawnfuzz=Diámetro de regeneración + +forge.configgui.modID.tooltip=la ID del mod que quieres definir anula la configuración. +forge.configgui.modID=ID del mod +forge.configgui.dormantChunkCacheSize.tooltip=Las porciones de terreno que no se hayan cargado se pueden conservar en una caché latente para cargarlas más rápido la próxima vez. Especifica el tamaño (en porciones de terreno) de la caché aquí. +forge.configgui.dormantChunkCacheSize=Tamaño de la caché latente de porciones de terreno +forge.configgui.enableModOverrides.tooltip=Activa esta opción para permitir personalizaciones. +forge.configgui.enableModOverrides=Activar sustitución de mods +forge.configgui.maximumChunksPerTicket.tooltip=Este es el número máximo de porciones de terreno que un solo tique puede forzar. +forge.configgui.maximumChunksPerTicket=Límite de porciones de terreno por tique +forge.configgui.maximumTicketCount.tooltip=Este es el número solicitudes de carga de porciones de terreno que un mod puede hacer. +forge.configgui.maximumTicketCount=Límite de tique de mod +forge.configgui.playerTicketCount.tooltip=El número de tiques que un jugador puede asignar en lugar de un mod. Esto es general para todos los mods y depende de ellos para usarse. +forge.configgui.playerTicketCount=Límite de tiques de jugador + +fml.config.sample.basicDouble.tooltip=Una propiedad doble sin límites definidos. +fml.config.sample.basicDouble=Doble sin límites +fml.config.sample.basicInteger.tooltip=Una propiedad de entero sin límites definidos. +fml.config.sample.basicInteger=Entero sin límites +fml.config.sample.basicString.tooltip=Propiedad de cadena básica. El usuario puede escribir cualquier cosa en este cuadro de texto. +fml.config.sample.basicString=Cadena básica +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/fa_IR.lang b/build/resources/patchedMc/assets/forge/lang/fa_IR.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/fa_IR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/fi_FI.lang b/build/resources/patchedMc/assets/forge/lang/fi_FI.lang new file mode 100644 index 0000000..594b353 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/fi_FI.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Käytä /forge . Alikomentoja ovat tps ja track +commands.forge.usage.tracking=Käytä /forge track . Hyväksytyt tyypit ovat te (Tile Entities). Kestoaika on oltava alle 60.  +commands.forge.tps.summary=%s \: Keskimääräinen päivityksen kesto\: %d ms. Keskimääräinen määrä päivityksiä sekunnissa\: %d + +commands.forge.tracking.te.enabled=Palikkaentiteetin seuranta käytössä %d sekunnin ajan. +forge.texture.preload.warning=Varoitus\: Tekstuuri %s ei ole ennalta ladattu. Tämä aiheuttaa renderöintivirheitä\! +forge.client.shutdown.internal=Sammutetaan sisäistä palvelinta... +forge.update.newversion=Uusi Forge versio saatavilla\: %s +forge.update.beta.1=%sVAROITUS\: %sForge Beta +forge.update.beta.2=Suuria ongelmia voi syntyä, varmista ennen raportointia. + +forge.configgui.forgeConfigTitle=Minecraft Forge Asetukset +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Täällä voit muokata asetuksia, jotka ovat forge.cfg\:ssä. +forge.configgui.ctgy.forgeGeneralConfig=Yleiset Asetukset +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Täällä voit muokata asetuksia, jotka ovat forgeChunkLoading.cfg\:ssä. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader oletusasetukset +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Täällä voit määrittää modikohtaiset asetukset, joita käytetään oletusasetusten sijasta. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Modien Asetusten Ohitukset +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Tämä antaa sinun määrittää mod-kohtaisia asetuksia, jotka ohittavat oletusasetukset. Jos arvo on nolla kummassakaan kohdassa, kyseisen modin maailmanlatauskyky poistuu. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Lisää uusi ohitus modille +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Hallitse taivaan värien sekoittamisaluetta, jos eri väriset taivaat eri biomeille ovat käytössä. +forge.configgui.biomeSkyBlendRange=Biomi Taivaan Sekoitus Alue +forge.configgui.clumpingThreshold.tooltip=Määrittää numeerisen rajan, jossa Paketilla 51 on etusija Pakettiin 52 verrattuna. +forge.configgui.clumpingThreshold=Pakettien yhdistämiskynnys +forge.configgui.disableVersionCheck.tooltip=Asettamalla arvoksi tosi (true), voit poistaa käytöstä Forgen versiontarkistusmekaniikan. Forge hakee pienen json tiedoston meidän palvelimiltamme versiotietoja varten. Jos haluat lisää tietoja, katso ForgeVersion-luokkaa githubissamme. +forge.configgui.disableVersionCheck=Poista käytöstä Forgen versiontarkistus +forge.configgui.enableGlobalConfig=Aktivoi globaalit asetukset +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Asettamalla arvoksi tosi (true), voit pakottaa kaatumisen siinä tapauksessa, että useampi kuin yksi palikka yrittää yhdistää samaan nestepalikkaan. +forge.configgui.forceDuplicateFluidBlockCrash=Pakota kaatuminen nestepalikan tuplaantuessa +forge.configgui.fullBoundingBoxLadders.tooltip=Asettamalla arvoksi tosi (true), tikkaita noustessa koko olennon törmäyslaatikko tarkastetaan tikkaiden varalta sen sijaan, että tarkastettaisiin vain se palikka missä olento on. Aiheuttaa huomattavia eroja mekaniikoissa, joten oletus on tavallisen Minecraftin mekaniikka. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Aseta tämän arvoksi tosi (true) poistaaksesi kaikki entiteetit, jotka heittävät virheitä päivitysmetodeistaan ilman palvelimen sammuttamista ja ongelman raportoimista kaatumislokiin. VAROITUS\: TÄMÄ SAATTAA HAJOITTAA KAIKEN, JOTEN KÄYTÄ SITÄ VAROVASTI. ME EMME OLE VASTUUSSA VAHINGOISTA. +forge.configgui.removeErroringEntities=Poista virheitä heittävät entiteetit +forge.configgui.removeErroringTileEntities.tooltip=Aseta tämän arvoksi tosi (true) poistaaksesi kaikki palikkaentiteetit, jotka heittävät virheitä päivitysmetodeistaan ilman palvelimen sammuttamista ja ongelman raportoimista kaatumislokiin. VAROITUS\: TÄMÄ SAATTAA HAJOITTAA KAIKEN, JOTEN KÄYTÄ SITÄ VAROVASTI. ME EMME OLE VASTUUSSA VAHINGOISTA. +forge.configgui.removeErroringTileEntities=Poista virheitä heittävät palikkaentiteetit +forge.configgui.sortRecipies.tooltip=Asettamalla arvoksi tosi (true) voit aktivoida reseptien järjestelemisen jälkialustuksen jälkeen Forgen järjestelijällä. Tämä saattaa aiheuttaa synkronointiongelmia ristiriitaisissa resepteissä. MINECRAFT ON KÄYNNISTETTÄVÄ UUDELLEEN, JOS TÄTÄ MUUTETAAN PELIN SISÄLTÄ KÄSIN. +forge.configgui.sortRecipies=Järjestä reseptit +forge.configgui.zombieBabyChance.tooltip=Mahdollisuus, että zombi (tai sen alaluokka) on vauva. Antaa muuttaa zombien syntymismekaniikkaa. +forge.configgui.zombieBabyChance=Vauvazombien mahdollisuus +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombien kutsumismahdollisuus +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=Sen modin ID, jolle haluat antaa omat asetukset. +forge.configgui.modID=Modin tunnus +forge.configgui.dormantChunkCacheSize.tooltip=Muistista poistetut chunkit voidaan pitää välimuistissa nopeampaa lataamista varten, Määritä välimuistin koko (chunkkeina) tähän. +forge.configgui.dormantChunkCacheSize=Chunk-välimuistin koko +forge.configgui.enableModOverrides.tooltip=Aktivoi tämä asetus, jos haluat asettaa tietyille modeille eri asetukset. +forge.configgui.enableModOverrides=Aktivoi Modien Ohitukset +forge.configgui.maximumChunksPerTicket.tooltip=Tämä on maksimimäärä chunkkeja, jota yksittäinen lippu voi pakottaa. +forge.configgui.maximumChunksPerTicket=Maksimimäärä chunkkeja lippua kohden +forge.configgui.maximumTicketCount.tooltip=Tämä on määrä chunkkien latauspyyntöjä, jota yksittäinen modi saa tehdä. +forge.configgui.maximumTicketCount=Maksimimäärä lippuja modia kohden +forge.configgui.playerTicketCount.tooltip=Tämä on määrä lippuja, jotka voidaan asettaa pelaajalle modin sijasta. Tämä jaetaan kaikille modeille ja sen käyttö riippuu modeista. +forge.configgui.playerTicketCount=Maksimimäärä lippuja pelaajaa kohden + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/fr_FR.lang b/build/resources/patchedMc/assets/forge/lang/fr_FR.lang new file mode 100644 index 0000000..a832f93 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/fr_FR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Utilisez /forge . Les sous-commandes sont tps, track +commands.forge.usage.tracking=Utilisez /forge track . Les types valides sont te (Tile Entities). La durée doit être inférieur à 60. +commands.forge.tps.summary=commands.forge.tps.summary\=%s \: Durée de tick \: %d ms. TPS moyen \: %d + +commands.forge.tracking.te.enabled=Pistage des Tile Entity activé pour %d secondes. +forge.texture.preload.warning=Attention \: La texture %s n'est pas préchargée, cela causera des bugs de rendu \! +forge.client.shutdown.internal=Arrêt du serveur interne... +forge.update.newversion=Une nouvelle version de Forge est disponible \: %s +forge.update.beta.1=%sAVERTISSEMENT \: %sForge Beta +forge.update.beta.2=Des problèmes majeurs peuvent survenir, vérifiez avant de les signaler. + +forge.configgui.forgeConfigTitle=Configuration de Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Vous pouvez modifier ici les paramètres contenu dans le fichier forge.cfg . +forge.configgui.ctgy.forgeGeneralConfig=Paramètres généraux +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=C'est ici que vous pouvez modifier les paramètres contenus dans le fichier forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Paramètres par défaut de Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=C'est ici que vous pouvez définir les paramètres de remplacement spécifiques aux mods qui seront utilisés au lieu de ceux par défaut. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Remplacements de mods +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Vous permet de définir les paramètres spécifiques aux mods qui remplaceront ceux par défaut. Une valeur de zéro dans chaque entrée désactive efficacement n'importe quelles capacités de chargement de chunk pour ce mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Ajout d'un nouveau remplacement de mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Contrôle l'étendue de fondu de couleur du ciel pour les cieux colorés dans les biomes. +forge.configgui.biomeSkyBlendRange=Étendue de fondu du ciel des biomes +forge.configgui.clumpingThreshold.tooltip=Contrôle le seuil du nombre auquel Packet51 est préféré sur Packet52. +forge.configgui.clumpingThreshold=Seuil d'amas de paquets +forge.configgui.disableVersionCheck.tooltip=Mettez ceci à "true" pour désactiver les mécanismes de vérification de la version de Forge. Forge interroge un petit fichier json sur notre serveur pour les informations de version. Pour plus de détails, consultez la classe ForgeVersion dans notre Github. +forge.configgui.disableVersionCheck=Désactiver la vérification de la version de Forge +forge.configgui.enableGlobalConfig=Activer la configuration globale +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Mettez ceci à "true" pour forcer un plantage si plus d'un bloc tente de se relier au même fluide. +forge.configgui.forceDuplicateFluidBlockCrash=Forcer le plantage de duplication de bloc de fluide +forge.configgui.fullBoundingBoxLadders.tooltip=Mettez ceci à "true" pour vérifier la boîte de collision de l'entité entière pour les échelles au lieu de juste le bloc où elles sont. Cause des différences notables dans les mécanismes et le comportement vanilla est par défaut. +forge.configgui.fullBoundingBoxLadders=Échelles à boîte de collision complète +forge.configgui.removeErroringEntities.tooltip=Mettez ceci à "true" pour enlever n'importe quelle entité qui lance une erreur dans sa méthode de mise à jour au lieu de fermer le serveur et de créer un log de plantage. SOYEZ PRÉVENU(E) QUE CELA PEUT TOUT BOUSILLER. UTILISEZ AVEC PRÉCAUTION. NOUS NE SOMMES PAS RESPONSABLES DES DÉGÂTS ENGENDRÉS. +forge.configgui.removeErroringEntities=Enlever les entités causant une erreur +forge.configgui.removeErroringTileEntities.tooltip=Mettez ceci à "true" pour enlever n'importe quelle entité de bloc qui lance une erreur dans sa méthode de mise à jour au lieu de fermer le serveur et de créer un log de plantage. SOYEZ PRÉVENU(E) QUE CELA PEUT TOUT BOUSILLER. UTILISEZ AVEC PRÉCAUTION. NOUS NE SOMMES PAS RESPONSABLES DES DÉGÂTS ENGENDRÉS. +forge.configgui.removeErroringTileEntities=Enlever les entités de bloc causant une erreur +forge.configgui.sortRecipies.tooltip=Mettez ceci à "true" pour activer le tri de post-initialisation des recettes de fabrication qui utilisent la trieuse de Forge. Cela peut causer de la désynchronisation sur les recettes en conflits. VOUS DEVEZ REDÉMARRER MINECRAFT SI L'OPTION A ÉTÉ CHANGÉE DEPUIS L'INTERFACE DE CONFIGURATION. +forge.configgui.sortRecipies=Tri des recettes +forge.configgui.zombieBabyChance.tooltip=Chance qu'un zombie (ou une sous-classe) soit un bébé. Permet de changer le mécanisme de spawn des zombies. +forge.configgui.zombieBabyChance=Chance d'avoir un bébé zombie +forge.configgui.zombieBaseSummonChance.tooltip=Chance de spawner des zombies de renforts. Permet de changer le mécanisme de renforts de zombies. +forge.configgui.zombieBaseSummonChance=Chance d'avoir un zombie de renfort +forge.configgui.stencilbits=Activer les bits de stencil d'OpenGL +forge.configgui.spawnfuzz=Respawn du fuzz diamètre + +forge.configgui.modID.tooltip=L'ID du mod que vous voulez définir les paramètres de remplacement. +forge.configgui.modID=ID du mod +forge.configgui.dormantChunkCacheSize.tooltip=Les chunks déchargés peuvent d'abord être gardés dans une cache mémoire dormante pour des temps de chargement plus rapides. Spécifiez la taille (en chunks) de cette cache ici. +forge.configgui.dormantChunkCacheSize=Taille de la mémoire cache dormante des chunks +forge.configgui.enableModOverrides.tooltip=Activez ce paramètre pour permettre les paramètres personnalisés par mod d'être définis. +forge.configgui.enableModOverrides=Activer les remplacements de mods +forge.configgui.maximumChunksPerTicket.tooltip=C'est le nombre maximal de chunks qu'un seul billet peut forcer. +forge.configgui.maximumChunksPerTicket=Limite de chunks par billet +forge.configgui.maximumTicketCount.tooltip=Ceci est le nombre de requêtes de chargement de chunk qu'un mod est permis de faire. +forge.configgui.maximumTicketCount=Limite de billets par mod +forge.configgui.playerTicketCount.tooltip=Ceci est le nombre de billets qui peuvent être assignés à un joueur au lieu d'un mod. Ceci est partagé parmi tous les mods et c'est aux mods de l'utiliser. +forge.configgui.playerTicketCount=Limite de billets par joueur + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/he_IL.lang b/build/resources/patchedMc/assets/forge/lang/he_IL.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/he_IL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/hu_HU.lang b/build/resources/patchedMc/assets/forge/lang/hu_HU.lang new file mode 100644 index 0000000..a94c131 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/hu_HU.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Használd a /forge parancsot. Alparancsok\: tps, track +commands.forge.usage.tracking=Használd a /forge track . Elfogadható típusok az entitások. Az időtartam kisebb mint 60. \n +commands.forge.tps.summary=%s \: Átlagos tick idő\: %d ms. Átlagos TPS\: %d + +commands.forge.tracking.te.enabled=Entitások figyelése aktiválva %d másodpercre. +forge.texture.preload.warning=Figyelem\: A(z) %s textúra nem lett betöltve, ami megjelenítési hibákat okozhat\! +forge.client.shutdown.internal=Integrált szerver leállítása... +forge.update.newversion=Új forge verzió elérhető\: %s +forge.update.beta.1=%s Figyelem\: %s Béta Forge Verzió +forge.update.beta.2=Hibák előfordulhatnak, bizonyosodj meg felőle, hogy tényleg hiba e. + +forge.configgui.forgeConfigTitle=Minecraft Forge konfiguráció +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Itt tudod módosítani a forge.cfg beállításait. +forge.configgui.ctgy.forgeGeneralConfig=Általános beállítások +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Itt tudod módosítani a forgeChunkLoading.cfg beállításait. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Betöltő alapbeállítások +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Itt tudod beállítani modonként a felülíró beállításokat, így ezeket fogja használni az alap beállítások helyett. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod felülírások +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Modonkénti felülírási beállításokat tudsz beállítani az alapértékek helyett. A nulla érték tejlesen kikapcsolja a chunk betöltési képességeit a kiválasztott modnak. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=Új mod felülírás hozzáadása +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Az ég színének éghajlatonkénti elmosásának a távolságát módosító szám. +forge.configgui.biomeSkyBlendRange=Éghajlat égi színének elmosási távolsága +forge.configgui.clumpingThreshold.tooltip=A küszöbérték számát módosítja ami a 51. Packet-hez rendeli az 52. Packet helyett. +forge.configgui.clumpingThreshold=Packet halmozási küszöb +forge.configgui.disableVersionCheck.tooltip=Tedd "true"-ra hogy bekapcsold a forge verzió ellenőrzését, ami egy kis json fájlon keresztül történik a fájlszerverünkön keresztül. Részletekért lást a "ForgeVersion" nevű class fájlt a github oldalunkon. +forge.configgui.disableVersionCheck=Forge verzióellenőrzés kikapcsolása +forge.configgui.enableGlobalConfig=Globális configuráció engedélyezése +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Engedélyezd ezt, hogy egy kényszerített crash-t okozz ha 1-nél több blokk ugyanarra a Folyadékra utal rá. +forge.configgui.forceDuplicateFluidBlockCrash=Folyadék blokk crash kényszerítése +forge.configgui.fullBoundingBoxLadders.tooltip=Engedélyezd ezt, hogy a minecraft az entititások hitboxát is ellenőrizze, ahelyett, hogy csak a blokkokéval vetné össze. Észrevehető változásokat okozhat 1-2 dologban, ugyanúgy mint a vanilla minecraft működésében is. +forge.configgui.fullBoundingBoxLadders=Teljes határoló dobozú létrák +forge.configgui.removeErroringEntities.tooltip=Tedd ezt igazzá, hogy eltávolítsd azokat az entititásokat, amik hibát jeleznek az helyett, hogy bezárnák a szervert és kicrashelnék azt. FIGYELEM\: TÖNKRE TEHET BÁRMIT, SEMMI FELELŐSSÉGET NEM VÁLLALUNK. +forge.configgui.removeErroringEntities=Hibás entititások eltávolítása +forge.configgui.removeErroringTileEntities.tooltip=Tedd ezt igazzá, hogy eltávolítsd azokat a blokk entititásokat, amik hibát jeleznek az helyett, hogy bezárnák a szervert és kicrashelnék azt. FIGYELEM\: TÖNKRE TEHET BÁRMIT, SEMMI FELELŐSSÉGET NEM VÁLLALUNK. +forge.configgui.removeErroringTileEntities=Hibás blokk entititások eltávolítása +forge.configgui.sortRecipies.tooltip=Tedd igazzá, hogy engedélyezd a késői recept rendezést a Forge recept rendező segítségével. Deszinkronizációt okozhat egyező receptek esetén. ÚJRA KELL INDÍTANI A MC-T HA A JÁTÉKON BELÜL VÁLTOZTATTAD MEG EZT A BEÁLLÍTÁST. +forge.configgui.sortRecipies=Receptek rendezése +forge.configgui.zombieBabyChance.tooltip=Esély egy zombi(vagy olyan fajta) élőlény bébi lesz. Ezzel tudod módosítani a zombi spawnolási mechanikát. +forge.configgui.zombieBabyChance=Pici zombi esély +forge.configgui.zombieBaseSummonChance.tooltip=Alap zombi spawnolási esély. Ezzel tudod személyre szabni a zombik spawnolási mechanikáját. +forge.configgui.zombieBaseSummonChance=Zombi spawnolási esélye +forge.configgui.stencilbits=Gl Stencil Bit-ek engedélyezése +forge.configgui.spawnfuzz=Respawn távolság átmérője + +forge.configgui.modID.tooltip=A mod ID-je amit akarsz a felülíró beállítások definiálására. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=A kitöltött chunkokat egy gyorsítótárba lehet helyezni a gyorsabb betöltődés érdekében. itt betudod állítani a tár méretét. +forge.configgui.dormantChunkCacheSize=Chunk gyorsítótár mérete +forge.configgui.enableModOverrides.tooltip=Engedélyezd ezt, hogy engedélyezt a modonkénti beállítások módosítását. +forge.configgui.enableModOverrides=Mod felülírások engedélyezése +forge.configgui.maximumChunksPerTicket.tooltip=Ez a maximum szám, amit egy darab chunk 1 db "ticket"-et tud kényszeríteni. +forge.configgui.maximumChunksPerTicket=Chunkonkénti "ticket" limit +forge.configgui.maximumTicketCount.tooltip=Ez a szám ami a azoknak a chunkoknak a számát adja meg, amit 1 mod betölthet. +forge.configgui.maximumTicketCount=Mod "ticket" limit +forge.configgui.playerTicketCount.tooltip=A maximum "ticket" szám, amit 1 playerhez köthet a mod. Ezek az összes mod között megosztva vannak és használhatják is azokat. +forge.configgui.playerTicketCount=Játékos "ticket" limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/it_IT.lang b/build/resources/patchedMc/assets/forge/lang/it_IT.lang new file mode 100644 index 0000000..14b5705 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/it_IT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Usa /forge . I subcomandi sono tps, track +commands.forge.usage.tracking=Usa /forge track . I tipi validi sono le entità piatte. La durata deve essere < 60. +commands.forge.tps.summary=%s \: Tempo medio dei tick\: %d ms. TPS medi\: %d + +commands.forge.tracking.te.enabled=Tracciamento delle entità piatte abilitata per %d secondi. +forge.texture.preload.warning=Attenzione\: La grafica %s non è pre-caricata, questo causerà errori nel rendering\! +forge.client.shutdown.internal=Spegnendo server interno.... +forge.update.newversion=Nuova versione di Forge è uscita\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Altri problemi possono sorgere, controlla prima di segnalare. + +forge.configgui.forgeConfigTitle=Configurazione Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Quì è dove puoi modificare le impostazioni contenute in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Impostazioni Generali +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Quì è dove puoi modificare le impostazioni contenute in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Impostazioni di Default +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Quì è dove puoi definire le impostazioni mod-specific che saranno utilizzate invece di quelle di default. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Sostituzioni Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Quì è dove puoi definire le impostazioni mod-specific che saranno utilizzate invece di quelle di default. Un valore pari a zero in qualuncue entrata disabiliterà tutte le capacità di ChunkLoading per quella mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Aggiungi Nuova Mod Sustitutiva +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controlla il gamma di Sky Blending per i cieli colorati nei biomi. +forge.configgui.biomeSkyBlendRange=Gamma Miscela Cielo del Bioma +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ja_JP.lang b/build/resources/patchedMc/assets/forge/lang/ja_JP.lang new file mode 100644 index 0000000..26e7ddb --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ja_JP.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge を使用しましょう。Subcommand(サブコマンド) は tps と track です。 +commands.forge.usage.tracking=/forge track を使用しましょう。有効な type(種類) は、te (TileEntities) です。 Duration(継続時間) は60より小さい値です。 +commands.forge.tps.summary=%s\: 1tickあたりの時間\: %d ms. 1秒あたりのtick数(TPS)\: %d + +commands.forge.tracking.te.enabled=タイルエンティティのトラッキングを %d 秒間有効にします。 +forge.texture.preload.warning=警告\: テクスチャである %s がプリロードされなかったので描画がおかしくなってしまいます! +forge.client.shutdown.internal=内部サーバーを終了中... +forge.update.newversion=新しいバージョンの Forge がリリースされています\: %s +forge.update.beta.1=%s警告\: %s Forge ベータ +forge.update.beta.2=主要な問題は、報告する前に検証してください。 + +forge.configgui.forgeConfigTitle=Minecraft Forge 設定 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=ここでは forge.cfg に含まれる設定を編集することができます。 +forge.configgui.ctgy.forgeGeneralConfig=一般設定 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=ここでは forgeChunkLoading.cfg に含まれる設定を編集することができます。 +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge チャンクローダー デフォルト設定 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=ここではデフォルトの代わりに使用するMod固有の優先設定を定義することができます。 +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod オーバーライド +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=デフォルトを上書きするMod固有の設定を定義することができます。いずれかの項目に0の値を設定すると、実際にそのModのチャンク読み込み機能を無効にします。 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ 新しいModオーバーライドを追加 +forge.configgui.ctgy.VersionCheckConfig=バージョンチェック設定 + +forge.configgui.biomeSkyBlendRange.tooltip=バイオームでの色のついた空の混合範囲を制御します。 +forge.configgui.biomeSkyBlendRange=バイオームの空の混合範囲 +forge.configgui.clumpingThreshold.tooltip=Packet51 が Packet52 よりも優先される数のしきい値を制御します。 +forge.configgui.clumpingThreshold=パケットクランピングのしきい値 +forge.configgui.disableVersionCheck.tooltip=Forgeのバージョンチェック機能を無効にする場合はtrueに設定します。Forgeは、バージョン情報を取得するためにサーバー上にある小さなjsonファイルを照会します。詳細については、githubのForgeVersionクラスをご覧ください。 +forge.configgui.disableVersionCheck=Forge のバージョンチェックを無効化 +forge.configgui.enableGlobalConfig=グローバル設定を有効化 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=複数のブロックが同じ流体にリンクしようとした場合に、強制的にクラッシュさせるにはtrueに設定します。 +forge.configgui.forceDuplicateFluidBlockCrash=液体ブロックのクラッシュの強制欺瞞 +forge.configgui.fullBoundingBoxLadders.tooltip=ブロックだけではなく、はしごのエンティティ全体の当たり判定をチェックするためにはこれをtrueに設定します。デフォルトではバニラの動作であるため、力学の顕著な差異を引き起こします。 +forge.configgui.fullBoundingBoxLadders=はしごの全体の当たり判定 +forge.configgui.removeErroringEntities.tooltip=サーバーを閉じてクラッシュログを報告する代わりに、エラーをその更新メソッドでスローさせてすべてのエンティティを削除するにはこれをtrueに設定します。注意\: これはすべてを台無しにする可能性があり、使用する際に警告が表示されますが、私達はゲームデータが破損しても一切責任を負いかねます。 +forge.configgui.removeErroringEntities=おかしなエンティティを削除 +forge.configgui.removeErroringTileEntities.tooltip=サーバーを閉じてクラッシュログを報告する代わりに、エラーをその更新メソッドでスローさせてすべてのTileEntityを削除するにはこれをtrueに設定します。注意\: これはすべてを台無しにする可能性があり、使用する際に警告が表示されますが、私達はゲームデータが破損しても一切責任を負いかねます。 +forge.configgui.removeErroringTileEntities=おかしなタイルエンティティを削除 +forge.configgui.sortRecipies.tooltip=Forgeのソーターを使用して、クラフトレシピのポスト初期のソートを有効にするには、trueに設定します。これは競合するレシピに同期ずれが発生する可能性があります。ConfigのGUIから変更した場合は、Minecraftを再起動する必要があります。 +forge.configgui.sortRecipies=レシピを並び替え +forge.configgui.zombieBabyChance.tooltip=ゾンビ(またはサブクラス)が赤ちゃんである確率。ゾンビのスポーン方法を変更することができます。 +forge.configgui.zombieBabyChance=赤ちゃんゾンビの確率 +forge.configgui.zombieBaseSummonChance.tooltip=通常のゾンビの召喚スポーン確率。ボーナスゾンビの召喚方法を変更することができます。 +forge.configgui.zombieBaseSummonChance=ゾンビの召喚確率 +forge.configgui.stencilbits=GL Stencil Bits を有効化 +forge.configgui.spawnfuzz=リスポーン位置の直径 + +forge.configgui.modID.tooltip=優先設定を定義した Mod の ID。 +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=アンロードされたチャンクの読み込み時間を速くするために、休止状態のキャッシュに保持することができます。ここでそのキャッシュのサイズ(チャンク)を指定します。 +forge.configgui.dormantChunkCacheSize=休止させるチャンクのキャッシュサイズ +forge.configgui.enableModOverrides.tooltip=Mod 毎に設定のカスタムを定義することを許可するにはこの設定を有効にします。 +forge.configgui.enableModOverrides=Mod オーバーライドを有効化 +forge.configgui.maximumChunksPerTicket.tooltip=これは、シングルチケットが強制することができるチャンクの最大数です。 +forge.configgui.maximumChunksPerTicket=チャンク毎のチケット最大数 +forge.configgui.maximumTicketCount.tooltip=これは、Mod を作成するために許可されているチャンクの読み込み要求数です。 +forge.configgui.maximumTicketCount=Mod チケット制限 +forge.configgui.playerTicketCount.tooltip=Mod の代わりにプレイヤーが割り当てることができるチケットの数。これは、すべての Mod の間で共有され、Mod が自由に使用することができます。 +forge.configgui.playerTicketCount=プレイヤーチケットの数 + +fml.config.sample.basicDouble.tooltip=定義されていない制限を持つ二重のプロパティです。 +fml.config.sample.basicDouble=制限無しの二重 +fml.config.sample.basicInteger.tooltip=定義されていない制限を持つ整数のプロパティです。 +fml.config.sample.basicInteger=制限無しの整数 +fml.config.sample.basicString.tooltip=基本的な文字列プロパティです。このテキストボックスに何か入力できます。 +fml.config.sample.basicString=基本的な文字列 +fml.config.sample.booleanList.tooltip=最大長ではないブーリアンリストは、延長または短縮することができます。 +fml.config.sample.booleanList=基本的なブーリアンリスト +fml.config.sample.booleanListFixed.tooltip=8の固定長のブーリアンリストです。 +fml.config.sample.booleanListFixed=固定長のブーリアンリスト +fml.config.sample.booleanListMax.tooltip=10の最大長のブーリアンリストです。 +fml.config.sample.booleanListMax=最大長のブーリアンリスト +fml.config.sample.boundedDouble.tooltip=定義された制限を持つ二重のプロパティです。 +fml.config.sample.boundedDouble=制限有りの二重 +fml.config.sample.boundedInteger.tooltip=定義されている制限を持つ整数のプロパティです。 +fml.config.sample.boundedInteger=制限有りの整数 +fml.config.sample.chatColorPicker.tooltip=フォントのカラーコードの選択が可能になる特別なプロパティです。 +fml.config.sample.chatColorPicker=チャットカラーピッカー +fml.config.sample.ctgy.lists.tooltip=プレイするたの様々な配列プロパティの制御を提供します。 +fml.config.sample.ctgy.lists=サンプルの配列制御 +fml.config.sample.ctgy.numbers.tooltip=調整するための数値制御のリストを提供します。 +fml.config.sample.ctgy.numbers=サンプルの数値制御 +fml.config.sample.ctgy.strings.tooltip=プレイするための異なる文字列タイプの制御のリストを提供します。 +fml.config.sample.ctgy.strings=サンプルの文字列制御 +fml.config.sample.cycleString.tooltip=切り替え可能な有効値のリストを定義している文字列のプロパティです。 +fml.config.sample.cycleString=値の文字列の切り替え +fml.config.sample.doubleList.tooltip=最大長ではない二重リストは、延長または短縮することができます。 +fml.config.sample.doubleList=基本的な二重リスト +fml.config.sample.doubleListBounded.tooltip=特定の上限値を持つ二重のリストです。 +fml.config.sample.doubleListBounded=上限値を持つ二重リスト +fml.config.sample.doubleListFixed.tooltip=10の固定長を持つ二重のリストです。 +fml.config.sample.doubleListFixed=固定長の二重リスト +fml.config.sample.doubleListMax.tooltip=15の最大長を持つ二重のリストです。 +fml.config.sample.doubleListMax=最大長の二重リスト +fml.config.sample.imABoolean.tooltip=かなりのものだ... 私はブーリアン制御器です。 +fml.config.sample.imABoolean=私はブーリアンです +fml.config.sample.imADouble.tooltip=私は2人います。確かではないですが、もしかしたらCIAとKGBの両方の役割を果たすかもしれません。 +fml.config.sample.imADouble=私は二重です +fml.config.sample.imAString.tooltip=ああ。私達はあなたの粉石けんがみんなに知りわたってもおかしくないと思うよ。 \n<*文字列じゃなくて、ですか?*> \n文字列と粉石けん... なにか違うかい?僕達はなんでも販売できるんだ。 \n<*そうなんですか。もしかして、文字列を大量に持っていて、それを他の人にも教えようと思っているんですか...?*> \nもちろんさ!全国規模でやるつもりだよ。便利だし、文字列に異常はないし。 \n<*えっと、それ大変だと思うんですが。全国というと122,000マイル、つまり3インチの長さですよね。便利ではないし、むしろかなり極悪な計画じゃないですか。*> \nいや、それは僕達からのセールスポイントさ!シンプソンさんのそれぞれの文字列だよ!切り取ればいいだけで、扱いやすいし、それにちょうどいい長さだからね!シンプソン様と呼んでもいいくらいだ! +fml.config.sample.imAString=私は文字列です +fml.config.sample.imAnInteger.tooltip=私は整数だと言いましたか?まあ、そういうことにしましょうか。 +fml.config.sample.imAnInteger=私は整数です +fml.config.sample.integerList.tooltip=最大長ではない整数のリストは、延長または短縮できます。 +fml.config.sample.integerList=基本的な整数リスト +fml.config.sample.integerListBounded.tooltip=特定の上限値を持つ整数のリストです。 +fml.config.sample.integerListBounded=上限値を持つ整数リスト +fml.config.sample.integerListFixed.tooltip=10の固定長を持つ整数のリストです。 +fml.config.sample.integerListFixed=固定長の整数リスト +fml.config.sample.integerListMax.tooltip=15の最大長を持つ整数のリストです。 +fml.config.sample.integerListMax=最大長の整数リスト +fml.config.sample.modIDSelector.tooltip=導入されているすべてのModからMod IDを選択することができる特別のプロパティです。これは、カスタムコードで使用することができる可能性が多いです。バイオームの選択、エンティティの選択、アイテムの選択、ブロックの選択など... +fml.config.sample.modIDSelector=Mod IDセレクター +fml.config.sample.patternString.tooltip=パターンオブジェクトを使用して検証された文字列のプロパティです。 +fml.config.sample.patternString=パターン検証済みの文字列 +fml.config.sample.sliderDouble.tooltip=スライダーコントロールを使用した、定義されている制限を持つ二重のプロパティです。 +fml.config.sample.sliderDouble=スライダー二重 +fml.config.sample.sliderInteger.tooltip=スライダーコントロールを使用した、定義されている制限を持つ整数のプロパティです。 +fml.config.sample.sliderInteger=スライダーの整数 +fml.config.sample.stringList.tooltip=検証していない基本的な文字列のリストです。 +fml.config.sample.stringList=基本的な文字列リスト +fml.config.sample.stringListFixed.tooltip=7の固定長を持つ文字列のリストです。 +fml.config.sample.stringListFixed=固定長の文字列リスト +fml.config.sample.stringListMax.tooltip=15の最大長を持つ文字列のリストです。 +fml.config.sample.stringListMax=最大長の文字列リスト +fml.config.sample.stringListPattern.tooltip=パターンオブジェクトを使用して、それぞれの値を検証する文字列です。 +fml.config.sample.stringListPattern=パターン検証済みの文字列リスト +fml.config.sample.title=これは、設定GUIの動作をプレイするためです。変更は保存されません。 + +fml.configgui.applyGlobally=グローバルに適応する +fml.configgui.confirmRestartMessage=解りました +fml.configgui.gameRestartRequired=1つ以上変更された設定は、有効にするためにMinecraftを再起動する必要があります。 +fml.configgui.gameRestartTitle=Minecraftの再起動が必要です +fml.configgui.sampletext=サンプルテキスト +fml.configgui.tooltip.addNewEntryAbove=上の新しいエントリーを追加する +fml.configgui.tooltip.applyGlobally=グローバルに変更の取り消しまたは初期値に戻すことを適応します。 +fml.configgui.tooltip.removeEntry=エントリーを削除する +fml.configgui.tooltip.resetAll=すべてをリセットします。「グローバルに適応する」のチェックボックスにチェックがある場合、小画面の値も元に戻ります。 +fml.configgui.tooltip.resetToDefault=初期値に戻す +fml.configgui.tooltip.undoAll=すべての変更を元に戻します。「グローバルに適応する」のチェックボックスにチェックがある場合、小画面への変更も元に戻ります。 +fml.configgui.tooltip.undoChanges=変更を元に戻す +fml.configgui.tooltip.default=[初期値\: %s] +fml.configgui.tooltip.defaultNumeric=[範囲\: %s~%s, 初期値\: %s] + +fml.menu.mods=Mod +fml.menu.mods.normal=ノーマル +fml.menu.mods.search=検索\: +fml.menu.modoptions=Mod設定... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ko_KR.lang b/build/resources/patchedMc/assets/forge/lang/ko_KR.lang new file mode 100644 index 0000000..5e7c2bc --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ko_KR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/Forge 를 사용하세요. 하위 명령은 tps 과 track 입니다 +commands.forge.usage.tracking=/forge track <유형><기간>을 사용하세요. 사용할 수 있는 유형들\: (Tile Entities). <기간>은 60 이하여야 합니다.  +commands.forge.tps.summary=%s \: 1틱당 평균 시간\: %d ms. 평균 TPS\: %d + +commands.forge.tracking.te.enabled=타일 엔터티 추적이 %d초 동안 활성화 되었습니다. +forge.texture.preload.warning=경고\: 텍스쳐 %s가 미리 로드되지 않았습니다, 렌더링 오류가 발생할 것입니다\! +forge.client.shutdown.internal=내부 서버를 종료합니다... +forge.update.newversion=사용 가능한 새로운 Forge 버전\: %s +forge.update.beta.1=%s주의\: %sForge 베타 +forge.update.beta.2=주요 문제가 발생할 수 있습니다, 보고하기 전에 확인해 주세요 + +forge.configgui.forgeConfigTitle=Minecraft Forge 구성 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=여기서 forge.cfg에 지정되어 있는 설정들을 편집할 수 있습니다. +forge.configgui.ctgy.forgeGeneralConfig=일반 설정 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=여기서 forgeChunkLoading.cfg에 지정되어 있는 컨피그 설정들을 편집할 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingConfig=포지 청크로더 기본 설정 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=여기서 기본값 대신에 사용할 모드 재정의 설정을 규정할 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingModConfig=모드 재정의 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=기본값을 대체할 청크로딩 관련 모드 재정의 설정을 규정할 수 있게 해 줍니다. 여기에 0의 값을 지정함으로서 해당모드가 청크를 로딩할 수 없게 만들 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=새로운 모드 재정의 추가 +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=바이옴의 하늘 색깔 혼합 범위를 조정 +forge.configgui.biomeSkyBlendRange=바이옴 하늘 혼합 범위 +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Forge 버전 확인 비활성화 +forge.configgui.enableGlobalConfig=전역 설정 활성화 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=오류가 나는 엔티티 제거 +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=제작법 분류 +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=좀비 소환 확률 +forge.configgui.stencilbits=GL 스텐실 비트 활성화 +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=모드 재정의 활성화 +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=티켓 당 청크 제한 +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=모드 티켓 제한 +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=플레이어 티켓 제한 + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/lt_LT.lang b/build/resources/patchedMc/assets/forge/lang/lt_LT.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/lt_LT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/nb_NO.lang b/build/resources/patchedMc/assets/forge/lang/nb_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/nb_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/nl_NL.lang b/build/resources/patchedMc/assets/forge/lang/nl_NL.lang new file mode 100644 index 0000000..b747856 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/nl_NL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Gebruik /forge . Subcommando's zijn tps, track +commands.forge.usage.tracking=Gebruik /forge track . Geldige soorten zijn te (Tile Entities). Tijd moet <60 zijn. +commands.forge.tps.summary=%s \: Gemiddelde tick tijd\: %d ms. Gemiddelde TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity volgen is ingeschakeld voor %d seconden. +forge.texture.preload.warning=Waarschuwing\: Texture %s is niet voorgeladen, zal render glitches veroorzaken\! +forge.client.shutdown.internal=Interne server wordt afgesloten... +forge.update.newversion=Nieuwe Forge versie beschikbaar\: %s +forge.update.beta.1=%sWAARSCHUWING\: %sForge Beta +forge.update.beta.2=Grote problemen kunnen bovenkomen, controleer voor te rapporteren. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuratie +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Hier kun je de instellingen uit forge.cfg aanpassen. +forge.configgui.ctgy.forgeGeneralConfig=Algemene Instellingen +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Hier kun je de instellingen uit forgeChunkLoading.cfg aanpassen. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Lader Standaard Instellingen +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dit is waar je mod-specifieke overschrijvende instellingen kan definiëren die gebruikt zullen worden in plaats van de standaardwaarden. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod overschrijvingen +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Staat je toe om mod-specifieke instellingen te definiëren die de standaardwaarden overschrijden. Een waarde van nul in eender item schakelt de chunkladermogelijkheden van die mod uit. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Voeg een nieuwe mod overschrijving toe +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Bestuur het bereik van de luchtmenging voor gekleurde luchten in biomes. +forge.configgui.biomeSkyBlendRange=Biome Luchtmenging Grootte +forge.configgui.clumpingThreshold.tooltip=Bepaalt de drempel waarbij Packet51 over Packet52 verkozen wordt. +forge.configgui.clumpingThreshold=Pakket Klonteren Limiet +forge.configgui.disableVersionCheck.tooltip=Zet op true om de versie controles van Forge uit te schakelen. Forge vraagt een klein json bestand op van onze server voor versie informatie. Voor meer info zie de ForgeVersion class in onze github. +forge.configgui.disableVersionCheck=Zet Forge's versie check uit +forge.configgui.enableGlobalConfig=Globale Configuratie Inschakelen +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Zet dit op true om een crash te forceren als meer dan één blok probeert te linken als dezelfde Vloeistof. +forge.configgui.forceDuplicateFluidBlockCrash=Forceer Duplicaat Vloeistof Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Zet dit op true om de hele entiteit botsingsdoos te controleren voor ladders in plaats van enkel de blok waar deze in is. Veroorzaakt opmerkelijke verschillen in mechaniek dus standaard is vanilla. +forge.configgui.fullBoundingBoxLadders=Volledige Botsingsdoos Ladders +forge.configgui.removeErroringEntities.tooltip=Zet dit op true om elke entiteit te verwijderen die een fout maakt in zijn update methode in plaats van de server te sluiten en een crash te rapporteren. LET OP DIT KAN ALLES VERKNOEIEN GEBRUIK ZELDEN WIJ ZIJN NIET VERANTWOORDELIJK VOOR SCHADE. +forge.configgui.removeErroringEntities=Verwijder Foutmeldende Entiteiten +forge.configgui.removeErroringTileEntities.tooltip=Zet dit op true om elke tegelentiteit te verwijderen die een fout maakt in zijn update methode in plaats van de server te sluiten en een crash te rapporteren. LET OP DIT KAN ALLES VERKNOEIEN GEBRUIK ZELDEN WIJ ZIJN NIET VERANTWOORDELIJK VOOR SCHADE. +forge.configgui.removeErroringTileEntities=Verwijder Crashende Tile Entities +forge.configgui.sortRecipies.tooltip=Zet dit op true om het post-initialisatie sorteren van vervaardigingsrecepten door Forge's sorteerder te activeren. Kan desynchronizatie veroorzaken op conflicterende recepten. MINECRAFT MOET OPNIEUW OPGESTART WORDEN INDIEN VERANDERD IN HET CONFIGURATIESCHERM. +forge.configgui.sortRecipies=Sorteer Recepten +forge.configgui.zombieBabyChance.tooltip=Kans dat een zombie (of een subclass ervan) een baby is. Laat wijzigingen in het zombie spawn systeem toe. +forge.configgui.zombieBabyChance=Zombie Baby Kans +forge.configgui.zombieBaseSummonChance.tooltip=Basis Zombie oproepingskans. Staat toe de bonus zombie oproepingsmechaniek te veranderen. +forge.configgui.zombieBaseSummonChance=Zombie Oproep Kans +forge.configgui.stencilbits=Schakel GL Stencil Bits in +forge.configgui.spawnfuzz=Respawn de Fuzz Diameter + +forge.configgui.modID.tooltip=Het Mod ID waar U overschrijfinstellingen voor wilt definiëren. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=ongeladen chunks kunnen eerst worden bewaard in een dormant cache voor snellere laadtijden. geef de grote van de cache in chucks. +forge.configgui.dormantChunkCacheSize=De Cache grote van een Dormant Chunk +forge.configgui.enableModOverrides.tooltip=Schakel deze instelling in om aangepaste instellingen voor individuele Mods te definiëren. +forge.configgui.enableModOverrides=sta Mod Overrides toe +forge.configgui.maximumChunksPerTicket.tooltip=Dit is de maximale aantal chunks dat een ticket kan forceren. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limiet +forge.configgui.maximumTicketCount.tooltip=Dit is het aantal aanvragen om een Chunk te laden dat een Mod is toegestaan te doen. +forge.configgui.maximumTicketCount=Mod Ticket limiet +forge.configgui.playerTicketCount.tooltip=Het aantal tickets dat een speler kan toewijzen in plaats van een mod. dit is van invloed op alle mods en het aan de mod zelf om het te gebruiken. +forge.configgui.playerTicketCount=Speler Ticket Limiet + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/nn_NO.lang b/build/resources/patchedMc/assets/forge/lang/nn_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/nn_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/no_NO.lang b/build/resources/patchedMc/assets/forge/lang/no_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/no_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/pl_PL.lang b/build/resources/patchedMc/assets/forge/lang/pl_PL.lang new file mode 100644 index 0000000..0063ab6 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/pl_PL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Użyj /forge . Podpolecenia to\: tps, track +commands.forge.usage.tracking=Użyj /forge track . Poprawne typy\: (Tile Entities). Czas trwania musi być mniejszy niż 60.  +commands.forge.tps.summary=%s \: Średni czas tick'u\: %d ms. Średni TPS\: %d + +commands.forge.tracking.te.enabled=Śledzenie Tile Entity włączone na %d sekund. +forge.texture.preload.warning=Uwaga\: Tekstura %s nie została wczytana, wystąpią błędy renderowania\! +forge.client.shutdown.internal=Zamykanie serwera wewnętrznego... +forge.update.newversion=Nowa wersja Forge\: %s +forge.update.beta.1=%sOstrzeżenie\: %sForge Beta +forge.update.beta.2=Mogą pojawić się poważne błędy. Wymagana jest dokładna weryfikacja przed dokonaniem zgłoszenia. + +forge.configgui.forgeConfigTitle=Konfiguracja Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Tutaj można edytować ustawienia z forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Główne ustawienia +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Tutaj można edytować ustawienia z forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Domyślne ustawienia Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Tutaj można zdefiniować ustawienia dla poszczególnych modyfikacji, które zostaną użyte zamiast domyślnych. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Modyfikacja zastępuje +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Pozwala zdefiniować ustawienia dla poszczególnych modyfikacji, które zastępują domyślne. Wartość zero w jakimkolwiek polu wyłącza możliwość wczytywania chunk'ów dla danej modyfikacji. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Dodaj nową modyfikację zastępująca +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Kontrola poziomu mieszania kolorów nieba w biomach. +forge.configgui.biomeSkyBlendRange=Poziom mieszania kolorów nieba w biomach +forge.configgui.clumpingThreshold.tooltip=Określa wartość progową, w której Packet51 jest mianowany przez Packet52. +forge.configgui.clumpingThreshold=Pakiet grupowania progu +forge.configgui.disableVersionCheck.tooltip=Ustaw na 'true' aby wyłączyć mechanizm sprawdzania wersji Forge, który odbywa się poprzez zapytanie o mały plik json na danym serwerze z informacją o wersji. Więcej szczegółów znajduje się w klasie ForgeVersion na oficjalnym GitGub'ie Minecraft Forge. +forge.configgui.disableVersionCheck=Wyłącz sprawdzanie wersji Minecraft Forge +forge.configgui.enableGlobalConfig=Włącz ustawienia globalne +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Ustaw na 'true', aby wymusić błąd, gdy więcej niż jeden blok odnosi się do tej samej cieczy. +forge.configgui.forceDuplicateFluidBlockCrash=Poziom błędu cieczy wywołujący awarię +forge.configgui.fullBoundingBoxLadders.tooltip=Ustaw na 'true', aby sprawdzać całe pole ograniczające entity dla drabinek, zamiast tylko bloku, w którym są. Powoduje zauważalne zmiany w mechanice gry, dlatego domyślnie jest wyłączone. +forge.configgui.fullBoundingBoxLadders=Pełny wymiar pola drabiny +forge.configgui.removeErroringEntities.tooltip=Ustaw na 'true', aby usunąć dowolny Entity, który zgłasza błąd w metodzie aktualizacji zamiast zamykania serwera oraz zgłasza awarię. UWAGA\! MOŻE TO POWAŻNIE USZKODZIĆ ZNACZNĄ CZĘŚĆ GRY\! MINECRAFT FORGE NIE BIERZE ODPOWIEDZIALNOŚCI ZA EWENTUALNE SZKODY. +forge.configgui.removeErroringEntities=Usuń wszystkie błędne entity +forge.configgui.removeErroringTileEntities.tooltip=Ustaw na 'true', aby usunąć dowolny TileEntity, który zgłasza błąd w metodzie aktualizacji zamiast zamykania serwera oraz zgłasza awarię. UWAGA\! MOŻE TO POWAŻNIE USZKODZIĆ ZNACZNĄ CZĘŚĆ GRY\! MINECRAFT FORGE NIE BIERZE ODPOWIEDZIALNOŚCI ZA EWENTUALNE SZKODY. +forge.configgui.removeErroringTileEntities=Usuń błędy Tile Entities +forge.configgui.sortRecipies.tooltip=Ustaw na 'true', aby włączyć automatyczne sortowanie receptur przez specjalne narzędzia Forge. Może spowodować utratę synchronizacji przy sprzecznych recepturach. WYMAGA PONOWNEGO URUCHOMIENIA GRY MINECRAFT, JEŻELI ZMIANA DOTYCZY RÓWNIEŻ KONFIGURACJI GUI. +forge.configgui.sortRecipies=Sortowanie receptur +forge.configgui.zombieBabyChance.tooltip=Szansa na stworzenie zombie (lub podklasy) jako dziecko. Pozwala na zmianę mechaniki powstawania zombie. +forge.configgui.zombieBabyChance=Szansa na zombie dziecko +forge.configgui.zombieBaseSummonChance.tooltip=Podstawowa szansa na tworzenie się zombie. Pozwala na zmianę dodatkowej mechaniki tworzenia się zombie. +forge.configgui.zombieBaseSummonChance=Szansa na tworzenie się zombie +forge.configgui.stencilbits=Włącz schemat GL bitów +forge.configgui.spawnfuzz=Odradzanie średniego rozmycia + +forge.configgui.modID.tooltip=ID modyfikacji, które chcesz zastosować, zastępuję ustawienia. +forge.configgui.modID=ID modyfikacji +forge.configgui.dormantChunkCacheSize.tooltip=Niezaładowane chunk'i mogą być pierwotnie przechowywane w zwolnionej pamięci podręcznej. Określ ilość chunk'ów, które mogą być przechowywane w ten sposób. +forge.configgui.dormantChunkCacheSize=Bezczynna pamięć podręczna chunk'u +forge.configgui.enableModOverrides.tooltip=Włącz, aby ustawić niestandardową konfigurację domyślą dla modyfikacji. +forge.configgui.enableModOverrides=Włącz tryb nadpisywania modyfikacji +forge.configgui.maximumChunksPerTicket.tooltip=Maksymalna liczba chunk'ów, którą może wymusić dany tick. +forge.configgui.maximumChunksPerTicket=Limit ticket'ów na chunk +forge.configgui.maximumTicketCount.tooltip=Jest to liczba załadowanych chunk'ów, które są dopuszczone do tworzenia przez modyfikację. +forge.configgui.maximumTicketCount=Limit ticket'ów modyfikacji +forge.configgui.playerTicketCount.tooltip=Liczba tick'ów, które gracz może mieć przyporządkowane zamiast modyfikacji. Jest to współużytkowanie przez wszystkie modyfikacje. +forge.configgui.playerTicketCount=Limit tick'ów określonych przez gracza + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/pt_BR.lang b/build/resources/patchedMc/assets/forge/lang/pt_BR.lang new file mode 100644 index 0000000..279fd53 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/pt_BR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcomandos são tps, track +commands.forge.usage.tracking=Use /forge track . Tipos válidos são\: te (Tile Entities). Duração é < 60. +commands.forge.tps.summary=%s \: Tempo médio por tick\: %d ms. TPS médio\: %d + +commands.forge.tracking.te.enabled=Rastreamento de Tile Entities habilitado por %d segundos. +forge.texture.preload.warning=Aviso\: A textura %s não foi pré-carregada, isso irá causar erros de renderização\! +forge.client.shutdown.internal=Desligando servidor interno... +forge.update.newversion=Nova versão do Forge está disponível\: %s +forge.update.beta.1=%sAVISO\: %sBeta do Forge +forge.update.beta.2=Problemas graves podem estar presentes, verifique-os antes de relatar. + +forge.configgui.forgeConfigTitle=Configuração do Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aqui é aonde você pode editar as opçoes contidas em forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Configurações Gerais +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aqui é aonde você pode editar as opçoes contidas em forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configurações Padrões do Carregador de Chunks do Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aqui é aonde você pode definir opções específicas de um mod que serão usadas ao invés das padrões. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Substituições de Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir configurações para mods específicos que irão substituir as padrão. Um valor de zero em qualquer entrada desativa a funcionalidade de chunkloading para esse mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adicionar Nova Substituição de Mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controle a gama de mistura do céu para céus coloridos em biomas. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controla o número limite em que o Packet51 é preferido sob o Packet52. +forge.configgui.clumpingThreshold=Limite de Aglutinação de Pacotes +forge.configgui.disableVersionCheck.tooltip=Defina como verdadeiro para desabilitar as mecânicas de verificação da versão do Forge. O Forge requer um pequeno arquivo json no nosso servidor para informação das versões. Para mais detalhes, veja a classe ForgeVersion no nosso github. +forge.configgui.disableVersionCheck=Desabilitar Checagem de Versão do Forge +forge.configgui.enableGlobalConfig=Habilitar a Configuração Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Marque para forçar um crash se mais de um bloco tentar referenciar o mesmo Fluido. +forge.configgui.forceDuplicateFluidBlockCrash=Forçar Crash para Blocos Fluidos Duplicados +forge.configgui.fullBoundingBoxLadders.tooltip=Marque para checar toda a caixa de colisão da entidade em escadas ao invés de apenas o bloco em que ela está. Causa diferenças visíveis nas mecânicas, por isso o comportamento padrão é o do Minecraft clássico. +forge.configgui.fullBoundingBoxLadders=Caixa de Colisão Completa para Escadas +forge.configgui.removeErroringEntities.tooltip=Marque para remover qualquer Entidade que lance um erro ao ser atualizada, ao invés em vez de encerrar o servidor e relatar o erro. NOTE QUE ISTO PODE QUEBRAR TUDO, USE COM MODERAÇÃO, NÓS NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringEntities=Remover Entidades com Erros +forge.configgui.removeErroringTileEntities.tooltip=Marque para remover qualquer TileEntity que lance um erro ao ser atualizada, ao invés em vez de encerrar o servidor e relatar o erro. NOTE QUE ISTO PODE QUEBRAR TUDO, USE COM MODERAÇÃO, NÓS NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringTileEntities=Remover Tile Entities com Erros +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ordenar Receitas +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Chance de Bebê Zumbi +forge.configgui.zombieBaseSummonChance.tooltip=Chance inicial de evocar zombies bebés. Permite alterar as mecânicas de evocação de zombies. +forge.configgui.zombieBaseSummonChance=Chance de Invocação de Zumbi +forge.configgui.stencilbits=Ativar GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=O ID do mod para que você quer definir as configurações de substituição. +forge.configgui.modID=ID do Mod +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Tamanho da Cache Dormente de Chunks +forge.configgui.enableModOverrides.tooltip=Habilite esta configuração para permitir configurações por mod personalizadas de serem definidas. +forge.configgui.enableModOverrides=Habilitar Substituições de Mod +forge.configgui.maximumChunksPerTicket.tooltip=Este é o máximo de chunks que um ticket pode forçar a ficarem carregados. +forge.configgui.maximumChunksPerTicket=Limite de Chunks por Ticket +forge.configgui.maximumTicketCount.tooltip=Este é o número das solicitações de carregamento de chunk que um mod pode fazer. +forge.configgui.maximumTicketCount=Limite de Tickets por Mod +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Limite de Tickets por Jogador + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/pt_PT.lang b/build/resources/patchedMc/assets/forge/lang/pt_PT.lang new file mode 100644 index 0000000..c346119 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/pt_PT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Usa /forge . Sub-comandos disponíveis são tps, track +commands.forge.usage.tracking=Usa /forge track . Tipos válidos são\: te (Tile Entities). Duração é < 60.  +commands.forge.tps.summary=%s \: Tempo por tick\: %d ms. TPS\: %d + +commands.forge.tracking.te.enabled=A monitorização de Tile Entities foi ativada por %d segundos. +forge.texture.preload.warning=Aviso\: A textura %s não foi previamente carregada, irá causar erros de renderização\! +forge.client.shutdown.internal=A encerrar o servidor interno... +forge.update.newversion=Uma nova versão do Forge está disponível\: %s +forge.update.beta.1=%sAVISO\: %sBeta do Forge +forge.update.beta.2=Erros podem estar presentes, verifica-os antes de os reportar. + +forge.configgui.forgeConfigTitle=Configurações do Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aqui podes editar as configurações do forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Confgurações Gerais +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aqui podes editar as configurações do forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configurações Padrão do Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aqui podes definir configurações específicas a mods que substituirão as padrão. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Substituições em Mods +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir configurações para mods específicos que irão substituir as padrão. Um valor de zero em qualquer entrada desativa a funcionalidade de chunkloading para esse mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adicionar Nova Substituição +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controla o número limite em que o Packet51 é preferido sob o Packet52. +forge.configgui.clumpingThreshold=Limite de Compressão de Pacotes +forge.configgui.disableVersionCheck.tooltip=Marca isto para desativar a verificação de novas versões do Forge. O Forge apenas pede um pequeno ficheiro json no nosso servidor para obter informação sobre a versão. Para mais informações, vê a classe ForgeVersion no nosso github. +forge.configgui.disableVersionCheck=Desativar Verificação de Versões do Forge +forge.configgui.enableGlobalConfig=Ativar Configuração Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Marca isto para forçar um crash se mais que um bloco tentar usar o mesmo Fluido. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Marca isto para marcar toda a área de colisão da entidade para as escadas, em vez de apenas o bloco onde elas estão. Esta opção bastantes diferenças nas mecânicas do jogo, por isso o padrão está definido para o vanilla. +forge.configgui.fullBoundingBoxLadders=Escadas com Maior Área de Colisão +forge.configgui.removeErroringEntities.tooltip=Marca isto para remover qualquer Entity que lance um erro ao ser atualizada, em vez de encerrar o servidor e reportar o erro. NOTA QUE ISTO PODE CORRER MUITO MAL, USA COM MODERAÇÃO. NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringEntities=Remover Entities Corrompidas +forge.configgui.removeErroringTileEntities.tooltip=Marca isto para remover qualquer TileEntity que lance um erro ao ser atualizada, em vez de encerrar o servidor e reportar o erro. NOTA QUE ISTO PODE CORRER MUITO MAL, USA COM MODERAÇÃO. NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringTileEntities=Remover Tile Entities Corrompidas +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ordenar Receitas +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Chance de Evocar Zombie Bebé +forge.configgui.zombieBaseSummonChance.tooltip=Chance inicial de evocar zombies bebés. Permite alterar as mecânicas de evocação de zombies. +forge.configgui.zombieBaseSummonChance=Chance de Evocar Zombie +forge.configgui.stencilbits=Ativar GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=ID do mod +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Tamanho da Cache Dormente de Chunks +forge.configgui.enableModOverrides.tooltip=Ativa esta opção para permitir configurações individuais para cada mod. +forge.configgui.enableModOverrides=Ativar Substituições para Mods +forge.configgui.maximumChunksPerTicket.tooltip=Este é o máximo de chunks que um ticket pode forçar a ficarem carregados. +forge.configgui.maximumChunksPerTicket=Limite de Chunks por Ticket +forge.configgui.maximumTicketCount.tooltip=Este é o número de pedidos para carregar chunks que um mod pode fazer. +forge.configgui.maximumTicketCount=Limite de Tickets por Mod +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Limite de Tickets por Jogador + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ro_RO.lang b/build/resources/patchedMc/assets/forge/lang/ro_RO.lang new file mode 100644 index 0000000..eeb95a1 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ro_RO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Folosește /forge . Subcomenzile sunt tps, track +commands.forge.usage.tracking=Folosește /forge track . Tipurile valide sunt te (Tile Entities). Durata este < 60. +commands.forge.tps.summary=%s \: Timp mediu pentru momente\: %d ms. TPS mediu\: %d + +commands.forge.tracking.te.enabled=Urmărirea pentru Tile Entities activată pentru %d secunde. +forge.texture.preload.warning=Atenție\: Textura %s nu este preîncărcată, va cauza erori de randare\! +forge.client.shutdown.internal=Se oprește serverul intern... +forge.update.newversion=Versiune nouă de Forge disponibilă\: %s +forge.update.beta.1=%sATENȚIE\: %sForge Beta +forge.update.beta.2=Se poate să apară probleme majore, verifică înainte de a semnala. + +forge.configgui.forgeConfigTitle=Configurare Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aici poți modifica setările aflate în forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Setări generale +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aici poți modifica setările aflate în forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Setări implicite Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aici poți defini setări de înlocuire specifice fiecărui mod care vor fi folosite în loc de cele implicite. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Înlocuiri de moduri +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Îți permite să definești setări specifice fiecărui mod care vor înlocui implicitele. O valoare de zero în oricare intrare dezactivează efectiv capacitățile de încărcare de chunkuri pentru acel mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adaugă o înlocuire nouă de moduri +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controlează distanța contopirii cerului pentru ceruri colorate în biomuri. +forge.configgui.biomeSkyBlendRange=Distanța contopirii cerurilor biomurilor +forge.configgui.clumpingThreshold.tooltip=Controlează pragul numeric la care Packet51 este preferat decât Packet52. +forge.configgui.clumpingThreshold=Pragul alipirii packetelor +forge.configgui.disableVersionCheck.tooltip=Setează la true pentru a dezactiva mecanica Forge de verificare a versiunii. Forge interoghează un fișier mic json pe serverul nostru pentru informații despre versiune. Pentru mai multe detalii vezi clasa ForgeVersion în github-ul nostru. +forge.configgui.disableVersionCheck=Dezactivează verificarea versiunii Forge +forge.configgui.enableGlobalConfig=Activează configurarea globală +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Setează la true pentru a forța un crash dacă mai mult de un bloc încearcă să lege înapoi la același Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Forțează crash la duplicarea blocului fluid +forge.configgui.fullBoundingBoxLadders.tooltip=Setează la true pentru a verifica coliziunea întregii cutii de încadrare a entității în loc de numai blocul pe care se află. Provoacă diferențe notabile de funcționare, deci comportamentul implicit este cel din vanilla. +forge.configgui.fullBoundingBoxLadders=Toată cutia de încadrare pentru scări +forge.configgui.removeErroringEntities.tooltip=Setează la true pentru a elimina orice entitate care aruncă o eroare în metoda sa de actualizare în loc de a închide serverul și de a semnala un crash log. ATENȚIE ACEST LUCRU AR PUTEA STRICA TOTUL FOLOSEȘTE CU MODERAȚIE NU SUNTEM RESPONSABILI PENTRU DAUNE. +forge.configgui.removeErroringEntities=Elimină entitățile cu erori +forge.configgui.removeErroringTileEntities.tooltip=Setează la true pentru a elimina orice entitate de bloc care aruncă o eroare în metoda sa de actualizare în loc de a închide serverul și de a semnala un crash log. ATENȚIE ACEST LUCRU AR PUTEA STRICA TOTUL FOLOSEȘTE CU MODERAȚIE NU SUNTEM RESPONSABILI PENTRU DAUNE. +forge.configgui.removeErroringTileEntities=Elimină entitățile de bloc cu erori +forge.configgui.sortRecipies.tooltip=Setează la true pentru a activa sortarea rețetelor de fabricare după inițializare folosind sortatorul Forge. Poate cauza desincronizare la rețete contradictorii. TREBUIE SĂ REPORNEȘTI MINECRAFT DACĂ SCHIMBI OPȚIUNEA DE LA INTERFAȚA DE CONFIGURARE. +forge.configgui.sortRecipies=Sortează rețetele +forge.configgui.zombieBabyChance.tooltip=Șansa ca un zombi (sau o subclasă) să fie copil. Permite schimbarea mecanicii de apariție a zombilor. +forge.configgui.zombieBabyChance=Șansă de copii zombi +forge.configgui.zombieBaseSummonChance.tooltip=Șansa de bază de apariție a zombilor invocați. Permite schimbarea mecanicii de invocare a zombilor bonus. +forge.configgui.zombieBaseSummonChance=Șansa de invocare a zombilor +forge.configgui.stencilbits=Activează GL Stencil Bits +forge.configgui.spawnfuzz=Diametrul variației la reapariție + +forge.configgui.modID.tooltip=ID-ul de mod pentru care vrei să definești setări de înlocuire. +forge.configgui.modID=ID de mod +forge.configgui.dormantChunkCacheSize.tooltip=Chunkurile descărcate pot fi păstrate la început într-un cache latent pentru încărcare mai rapidă. Specifică mărimea (în chunkuri) a acelui cache aici. +forge.configgui.dormantChunkCacheSize=Mărimea cache-ului pentru chunkuri latente +forge.configgui.enableModOverrides.tooltip=Activează această setare pentru a permite definirea setărilor personalizate pentru fiecare mod. +forge.configgui.enableModOverrides=Activează înlocuiri de moduri +forge.configgui.maximumChunksPerTicket.tooltip=Acesta este numărul maxim de chunkuri pe care le poate forța un singur bilet. +forge.configgui.maximumChunksPerTicket=Limita chunkurilor pe bilet +forge.configgui.maximumTicketCount.tooltip=Acesta este numărul de solicitări de încărcare de chunkuri pe care are voie să le facă un mod. +forge.configgui.maximumTicketCount=Limită de bilete pe mod +forge.configgui.playerTicketCount.tooltip=Numărul de bilete care pot fi atribuite unui jucător în loc de unui mod. Acesta este același pentru toate modurile și folosirea lui este la latitudinea modurilor. +forge.configgui.playerTicketCount=Limită de bilete pe jucător + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/ru_RU.lang b/build/resources/patchedMc/assets/forge/lang/ru_RU.lang new file mode 100644 index 0000000..2cab39a --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/ru_RU.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Используйте /forge <подкоманда>. Подкоманды\: tps, track +commands.forge.usage.tracking=Используйте /forge track <тип> <длительность>. Допустимые типы - TE (Tile Entities). Длительность < 60. +commands.forge.tps.summary=%s\: Cреднее время тика\: %d мс. Средний TPS\: %d + +commands.forge.tracking.te.enabled=Отслеживание Tile Entity включено на %d секунд. +forge.texture.preload.warning=Предупреждение\: Текстура %s не предзагружена, это может вызвать ошибки отображения\! +forge.client.shutdown.internal=Остановка внутренного сервера... +forge.update.newversion=Доступна новая версия Forge\: %s +forge.update.beta.1=%sПРЕДУПРЕЖДЕНИЕ\: %sForge Beta +forge.update.beta.2=Возможны серьёзные проблемы, проверьте их перед отправкой отчёта. + +forge.configgui.forgeConfigTitle=Конфигурация Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Здесь вы можете изменять настройки, хранимые в файле forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Общие настройки +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Здесь вы можете изменять настройки, хранимые в forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Настройки по умолчанию для загрузчика чанков Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Здесь вы можете устанавливать настройки модов, которые будут использоваться вместо параметров по умолчанию. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Переопределение настроек модов +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Позволяет установить настройки модов, переопределяющие параметры по умолчанию. Значение ноль в любом пункте отключит возможность загрузки чанков для этого мода. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Новое переопределение +forge.configgui.ctgy.VersionCheckConfig=Проверьте параметры версии + +forge.configgui.biomeSkyBlendRange.tooltip=Контролирует диапазон размытия цветного неба в биомах. +forge.configgui.biomeSkyBlendRange=Диапазон смешивания цветов неба +forge.configgui.clumpingThreshold.tooltip=Контролирует порог предпочтения пакета 51 перед пакетом 52. +forge.configgui.clumpingThreshold=Порог объединения пакетов +forge.configgui.disableVersionCheck.tooltip=Отметьте для отключения проверки версии Forge. Forge запрашивает маленький json файл с нашего сервера для получения информации о версии. Подробности можно найти в классе ForgeVersion на странице проекта на GitHub. +forge.configgui.disableVersionCheck=Отключить проверку обновлений Forge +forge.configgui.enableGlobalConfig=Включить глобальные настройки +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Отметьте это для принудительного выхода при попытки связать один тип жидкости с более чем одним блоком. +forge.configgui.forceDuplicateFluidBlockCrash=Принудительный выход при дубликатах блоков жидкости +forge.configgui.fullBoundingBoxLadders.tooltip=Установите значение true для полной проверки столкновений сущностей с лестницами вместо простой проверки на их нахождение в блоке. Вызывает значительные изменения в механике. +forge.configgui.fullBoundingBoxLadders=Полные области соприкосновения у лестниц +forge.configgui.removeErroringEntities.tooltip=Отметьте это для удаления любой сущности из мира, вызывающей ошибку, вместо полной остановки сервера. БУДЬТЕ ОСТОРОЖНЫ, ЭТО МОЖЕТ СЛОМАТЬ ВСЁ\! ИСПОЛЬЗУЙТЕ С УМОМ. МЫ НЕ НЕСЁМ ОТВЕТСТВЕННОСТИ ЗА УЩЕРБ. +forge.configgui.removeErroringEntities=Удаление сбойных сущностей +forge.configgui.removeErroringTileEntities.tooltip=Отметьте это для удаления любого блока из мира, вызывающего ошибку, вместо полной остановки сервера. БУДЬТЕ ОСТОРОЖНЫ, ЭТО МОЖЕТ СЛОМАТЬ ВСЁ\! ИСПОЛЬЗУЙТЕ С УМОМ. МЫ НЕ НЕСЁМ ОТВЕТСТВЕННОСТИ ЗА УЩЕРБ. +forge.configgui.removeErroringTileEntities=Удаление сбойных блоков +forge.configgui.sortRecipies.tooltip=Отметьте для включения сортировки рецептов крафта в фазе пост-инициализации. Может вызвать десинхронизацию у конфликтующих рецептов. НЕОБХОДИМО ПЕРЕЗАПУСТИТЬ MINECRAFT ЕСЛИ ЭТО БЫЛО ИЗМЕНЕНО ИЗ ИНТЕРФЕЙСА. +forge.configgui.sortRecipies=Отсортировать рецепты +forge.configgui.zombieBabyChance.tooltip=Шанс спавна ребёнка у зомби (или одного из его подкласса). Позволяет изменить механизм спавна зомби. +forge.configgui.zombieBabyChance=Шанс зомби-ребёнка +forge.configgui.zombieBaseSummonChance.tooltip=Базовый шанс спавна зомби. Позволяет изменить механику бонусного шанса при спавне зомби. +forge.configgui.zombieBaseSummonChance=Шанс спавна зомби +forge.configgui.stencilbits=Включить GL Stencil Bits +forge.configgui.spawnfuzz=Диаметр защиты точки респауна + +forge.configgui.modID.tooltip=ID мода, настройки которого Вы хотите переопределить. +forge.configgui.modID=ID мода +forge.configgui.dormantChunkCacheSize.tooltip=Выгруженные чанки могут быть помещены в кеш для ускорения будущих загрузок. Укажите размер (в чанках) для этого кеша. +forge.configgui.dormantChunkCacheSize=Размер кеша "спящих" чанков +forge.configgui.enableModOverrides.tooltip=Отметьте это для возможности определения настроек для модов в отдельности. +forge.configgui.enableModOverrides=Включить переопределение настроек модов +forge.configgui.maximumChunksPerTicket.tooltip=Максимальное количество чанков на один запрос, которые будут загружены по запросу модов. +forge.configgui.maximumChunksPerTicket=Лимит чанков на один запрос +forge.configgui.maximumTicketCount.tooltip=Количество запросов на поддержание чанков в загруженом состоянии, которое будет дозволен запросить мод. +forge.configgui.maximumTicketCount=Лимит запросов для мода +forge.configgui.playerTicketCount.tooltip=Количество запросов, которые будут присвоены игроку вместо мода. Этот лимит разделяется между всеми модами. +forge.configgui.playerTicketCount=Лимит запросов на игрока + +fml.config.sample.basicDouble.tooltip=Двойная собственность без каких-либо определенных границ. +fml.config.sample.basicDouble=Неограниченный Двойной +fml.config.sample.basicInteger.tooltip=Целочисленное свойство, без каких-либо определенных границ. +fml.config.sample.basicInteger=Безграничное Целое Число +fml.config.sample.basicString.tooltip=Основное свойство строки. Пользователь может ввести что-нибудь в этом текстовом поле. +fml.config.sample.basicString=Основная Строка +fml.config.sample.booleanList.tooltip=Логическое список нет макс. длины и может быть удлинена или укорочена. +fml.config.sample.booleanList=Основной Логический Список +fml.config.sample.booleanListFixed.tooltip=Логическое список, который имеет фиксированную длину 8. +fml.config.sample.booleanListFixed=Логическое список фиксированной длины +fml.config.sample.booleanListMax.tooltip=Логическое список, который имеет макс. длину 10. +fml.config.sample.booleanListMax=Макс. Длина Логического Списка +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/sl_SI.lang b/build/resources/patchedMc/assets/forge/lang/sl_SI.lang new file mode 100644 index 0000000..0cc46dd --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/sl_SI.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Uporabite /forge . Subcommande so tps, track +commands.forge.usage.tracking=Uporabite /forge tracj . Veljavni so Tile Entetiji. Dolžina je <60. +commands.forge.tps.summary=%s\: Dejanski tick čas\: %d ms. Dejanski TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity sledenje vklopljeno za %d sekund. +forge.texture.preload.warning=Pozor\: Grafika %s ni naložena v naprej, to zna povzročiti render težave\! +forge.client.shutdown.internal=Izklapljam notranji strežnik... +forge.update.newversion=Nova verzija Forge je navoljo\: %s +forge.update.beta.1=%sPozor\: %sForge Beta +forge.update.beta.2=Pojavijo se lahko večje težave, preverite preden poročate. + +forge.configgui.forgeConfigTitle=Minecraft Forge Nastavitve +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Tukaj lahko urejate nastavitve, ki se nahajajo v forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Globalne nastavitve +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Tukaj lahko urejate nastavitve, ki se nahajajo v forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Prevzete Nastavitve +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Tukaj lahko urejate nastavitve specifičnih modov. Te bodo uporabljene namesto prevzetih nastavitev. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Prepis Modov +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/sr_SP.lang b/build/resources/patchedMc/assets/forge/lang/sr_SP.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/sr_SP.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/sv_SE.lang b/build/resources/patchedMc/assets/forge/lang/sv_SE.lang new file mode 100644 index 0000000..2f56c19 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/sv_SE.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Använd /forge . Kommandon är tps, track +commands.forge.usage.tracking=Använd /forge track . Godkända typer är te (Tile Entities). Varaktighet ska vara < 60. +commands.forge.tps.summary=%s \: Medel uppdateringstid\: %d ms. Medel TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity spårning aktiverad i %d sekunder. +forge.texture.preload.warning=Varning\: Textur %s förladdades inte och kommer orsaka renderingsbuggar\! +forge.client.shutdown.internal=Stänger av intern server... +forge.update.newversion=Ny Forge version är tillgänglig\: %s +forge.update.beta.1=%sVarning\: %sForge Beta +forge.update.beta.2=Stora problem kan orsakas, vänligen verifiera innan du rapporterar. + +forge.configgui.forgeConfigTitle=Minecraft Forge konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Här kan du redigera de inställningar som finns i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Allmänna inställningar +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Här kan du redigera de inställningar som finns i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinställningar för Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Här kan du definiera mod-specifika inställningar som åsidosätter defaultinställningarna. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod-specifika åsidosättningar +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Här kan du definiera mod-specifika inställningar som åsidosätter defaultinställningarna. Värdet noll kommer att inaktivera chunk-loading för den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Lägg till ny åsidosättning för mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Styr omfånget av färgblandning för färgad himmel i biomer. +forge.configgui.biomeSkyBlendRange=Färgblandning för himmel +forge.configgui.clumpingThreshold.tooltip=Styr tröskelvärdet där Packet51 är att föredra framför Packet52. +forge.configgui.clumpingThreshold=Tröskelvärde för Packet Clumping +forge.configgui.disableVersionCheck.tooltip=Sätt till sant för att inaktivera Forge's versionscheckningsmekanik där Forge frågar efter en liten json fil. För mer information se klassen ForgeVersion i våran github. +forge.configgui.disableVersionCheck=Stäng av versionskoll +forge.configgui.enableGlobalConfig=Aktivera globala inställningar +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Sätt till sant för att skapa en krasch om mer än ett block försöker länka tillbaka till samma vätska. +forge.configgui.forceDuplicateFluidBlockCrash=Forcera Krasch för Multipla Vätskeblock +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/tr_TR.lang b/build/resources/patchedMc/assets/forge/lang/tr_TR.lang new file mode 100644 index 0000000..5912c6c --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/tr_TR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge 'ı kullanın. Alt komutlar tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Geçersiz Kılımları +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Hata veren blok-canlıları kaldır +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombi bebek şansı +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombi çağrılma şansı +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod kimliği +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Mod geçersiz kılmaları etkinleştir +forge.configgui.maximumChunksPerTicket.tooltip=Bu tek bir biletin yapabileceği maksimum chunk değeridir. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod bilet limiti +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Oyuncu bilet limiti + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=Anladım +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Örnek metin +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Varsayılana Geri Dön +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Değişiklikleri geri al +fml.configgui.tooltip.default=[Varsayılan\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Modlar +fml.menu.mods.normal=Normal +fml.menu.mods.search=Arama\: +fml.menu.modoptions=Mod seçenekleri... + + diff --git a/build/resources/patchedMc/assets/forge/lang/uk_UA.lang b/build/resources/patchedMc/assets/forge/lang/uk_UA.lang new file mode 100644 index 0000000..a9d6778 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/uk_UA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Використовуйте /forge <підкоманда>. Підкоманди такі як tps та track +commands.forge.usage.tracking=Використовуйте /forge track <тип> <тривалість>. Допустимі типи - TE (Tile Entities). Тривалість від < 60. +commands.forge.tps.summary=%s \: Середня тривалість тіку\: %d мс. Середнє TPS\: %d + +commands.forge.tracking.te.enabled=Відстеження Tile Entity увімкнено на %d секунд. +forge.texture.preload.warning=Застереження\: Текстура %s попередньо не завантажена, це може викликати помилки відображення\! +forge.client.shutdown.internal=Завершення роботи сервера... +forge.update.newversion=Доступна нова версія Forge\: %s +forge.update.beta.1=%sУвага\: %sForge Beta +forge.update.beta.2=Можуть виникнути серйозні проблеми. Переконайтеся у правильності ваших дій перед надсиланням звіту. + +forge.configgui.forgeConfigTitle=Конфігурації Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Звідси ви можете редагувати параметри, які знаходяться у forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Загальні налаштування +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Звідси ви можете редагувати параметри, які знаходяться у forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Стандартні налаштування провантажувача чанків Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Звідси ви можете зробити специфічні налаштування для модів, які будуть використовуватися замість стандартних налаштувань. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Перезапис моду +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Дозволяє робити специфічні налаштування для моду, які будуть використовуватися замість стандартних налаштувань. Нульове значення вимикає всі "chunkloading" для цього моду. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Додано новий перезапис моду +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Налаштування кольору неба у біомах. +forge.configgui.biomeSkyBlendRange=Діапазон кольору неба біому +forge.configgui.clumpingThreshold.tooltip=Контроль кількості порогів, при якому Packet51 є кращим, ніж Packet52. +forge.configgui.clumpingThreshold=Поріг для пакетного злипання +forge.configgui.disableVersionCheck.tooltip=Встановіть значення "true", щоб відключити перевірку версій Forge. Forge перевіряє наявність нових версій шукаючи невеликий json файл на нашому сервері. Для більшої інформації завітайте на проект у GitHub. +forge.configgui.disableVersionCheck=Вимкнути перевірку наявності нових версія Forge +forge.configgui.enableGlobalConfig=Увімкнути глобальні конфігурації +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Встановіть значення "true", для примусової зупинки клієнту при спробі об'єднати один тип рідини з більше ніж з одним блоком. +forge.configgui.forceDuplicateFluidBlockCrash=Примусова зупинка при дублювання блоків рідини +forge.configgui.fullBoundingBoxLadders.tooltip=Встановіть значення "true", для повної перевірки зіткнень об'єктів з драбинами, замість звичайної перевірки знаходження в блоці. Викликає значні відмінності в механіці гри. +forge.configgui.fullBoundingBoxLadders=Повні області зіткнень з драбинами +forge.configgui.removeErroringEntities.tooltip=Встановіть значення "true", для видалення будь-якого об'єкта, який спричиняє помилки у світі, замість повної зупинки серверу. БУДЬТЕ ОБЕРЕЖНИМИ З ЦІЄЮ ФУНКЦІЄЮ, МИ НЕ НЕСЕМО ВІДПОВІДАЛЬНОСТІ ЗА ЗЛАМАНИЙ СЕРВЕР. +forge.configgui.removeErroringEntities=Видаляє об'єкти, які викликають помилки +forge.configgui.removeErroringTileEntities.tooltip=Встановіть значення "true", для видалення будь-якого об'єкта, який спричиняє помилки у світі, замість повної зупинки серверу. БУДЬТЕ ОБЕРЕЖНИМИ З ЦІЄЮ ФУНКЦІЄЮ, МИ НЕ НЕСЕМО ВІДПОВІДАЛЬНОСТІ ЗА ЗЛАМАНИЙ СЕРВЕР. +forge.configgui.removeErroringTileEntities=Видаляє об'єкти, які спричиняють збої +forge.configgui.sortRecipies.tooltip=Встановіть значення "true", щоб увімкнути пост-ініціалізацію сортування для сортування рецептів використовуючи Forge сортувальник. Це може викликати десинхронізацію з деякими рецептами. НЕОБХІДНО ПЕРЕЗАВАНТАЖИТИ MINECRAFT, ЯКЩО ВИ НЕ РОБИТЕ ЗМІНИ З CONFIG GUI. +forge.configgui.sortRecipies=Сортування рецептів +forge.configgui.zombieBabyChance.tooltip=Ймовірність спавну зомбі дитини (або його підкласу). Дозволяє змінювати механіку спавну зомбі. +forge.configgui.zombieBabyChance=Ймовірність спавну дитя зомбі +forge.configgui.zombieBaseSummonChance.tooltip=Ймовірність автоматичного спавну зомбі. Дозволяє редагувати механіка вторинного спавну зомбі. +forge.configgui.zombieBaseSummonChance=Ймовірність спавну зомбі +forge.configgui.stencilbits=Увімкнути GL Stencil Bits +forge.configgui.spawnfuzz=Діаметр захисту респавну + +forge.configgui.modID.tooltip=ID моду, налаштування якого ви хочете перевизначити. +forge.configgui.modID=ID моду +forge.configgui.dormantChunkCacheSize.tooltip=Вивантажені чанки можуть бути збережені у неактивному кеші для швидкого завантаження. Вкажіть розмір (у чанках) для цього кешу. +forge.configgui.dormantChunkCacheSize=Розмір кешу для бездіяльних чанків +forge.configgui.enableModOverrides.tooltip=Увімкніть цей параметр, щоб дозволити визначати налаштування моду. +forge.configgui.enableModOverrides=Увімкнути перезапис модів +forge.configgui.maximumChunksPerTicket.tooltip=Максимальна кількість чанків, які будуть завантажені по запиту моду. +forge.configgui.maximumChunksPerTicket=Ліміт чанків на один запит +forge.configgui.maximumTicketCount.tooltip=Це кількість завантажених чаків, які роблять запит на мод. +forge.configgui.maximumTicketCount=Ліміт запитів на мод +forge.configgui.playerTicketCount.tooltip=Кількість запитів, які можуть бути призначені гравцю замість моду. Налаштування є загальним для всіх модів. +forge.configgui.playerTicketCount=Ліміт запитів на гравця + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/vi_VN.lang b/build/resources/patchedMc/assets/forge/lang/vi_VN.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/vi_VN.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/zh_CN.lang b/build/resources/patchedMc/assets/forge/lang/zh_CN.lang new file mode 100644 index 0000000..f1aa1b0 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/zh_CN.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge <子指令>. 用法说明\: 子指令有tps, track +commands.forge.usage.tracking=/forge track <类型> <持续时间>. 用法说明\: 有效类型有te (方块实体).有效持续时间要小于60. +commands.forge.tps.summary=%s \: 平均游戏刻耗时\: %d ms. 平均TPS\: %d + +commands.forge.tracking.te.enabled=实体附加值追踪已启用了 %d 秒. +forge.texture.preload.warning=警告\: %s 材质未被预加载, 将会导致渲染错误\! +forge.client.shutdown.internal=正在关闭内置服务端... +forge.update.newversion=新的Forge版本已可用\: %s +forge.update.beta.1=%s警告\: %sForge为Beta版 +forge.update.beta.2=可能会出现重要问题, 请在报告前进行确认. + +forge.configgui.forgeConfigTitle=Minecraft Forge配置 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=你可以在此编辑forge.cfg里的设置. +forge.configgui.ctgy.forgeGeneralConfig=通用设置 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=你可以在此编辑forgeChunkLoading.cfg里的设置. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge区块加载器默认设置 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=在这里你可以自定义会被优先采用的指定Mod的设置项以替代默认值. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod设置项覆盖 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=允许你自定义指定Mod中将会覆盖默认值的设置. 两项中任意一项取值为0会有效地禁用有关那个Mod的任何可能的区块加载. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ 添加新的Mod设置项覆盖 +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=控制不同生物群系中已着色天空之间的天空混色取值范围. +forge.configgui.biomeSkyBlendRange=生物群系天空混色取值范围 +forge.configgui.clumpingThreshold.tooltip=控制使Packet51优先于Packet52被选择的数字临界值. +forge.configgui.clumpingThreshold=Packet成簇临界值 +forge.configgui.disableVersionCheck.tooltip=设置为true会禁用Forge版本检测机制. Forge会在我们的服务器上对比查询一个比较小的json文件以获取版本信息. 想获取更多细节请参见在我们GitHub上的ForgeVersion类. +forge.configgui.disableVersionCheck=禁用Forge版本检测 +forge.configgui.enableGlobalConfig=启用全局配置 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=将该项设为true会在多于一个方块试图链接到同一流体时强制崩溃. +forge.configgui.forceDuplicateFluidBlockCrash=复制流体方块时强制崩溃 +forge.configgui.fullBoundingBoxLadders.tooltip=设置该项为true会检测整个实体是否碰到了梯子,而不仅仅是检测它们在梯子方块内. 会在机制上导致显著差别所以默认值为Minecraft原生行为. +forge.configgui.fullBoundingBoxLadders=对梯子的完全碰撞箱 +forge.configgui.removeErroringEntities.tooltip=设置该项为true时, 如果某个实体在更新时产生了错误, 它将会被移除, 而不是关闭服务端并记录一个崩溃日志. §o小心, 这可能会产生很严重的后果. 请谨慎使用, 我们不会对任何损失负责.§r§e +forge.configgui.removeErroringEntities=移除出现错误的实体 +forge.configgui.removeErroringTileEntities.tooltip=设置该项为true时, 如果某个方块实体在更新时产生了错误, 它将会被移除, 而不是关闭服务端并记录一个崩溃日志. §o小心, 这可能会产生很严重的后果. 请谨慎使用, 我们不会对任何损失负责.§r§e +forge.configgui.removeErroringTileEntities=移除出现错误的方块实体 +forge.configgui.sortRecipies.tooltip=设置为true会启用使用了Forge整理器的后初始化合成表整理. 可能会在冲突的合成表上造成不同步. §o如果是在Config GUI进行的更改那么必须重启Minecraft.§r§e +forge.configgui.sortRecipies=整理合成表 +forge.configgui.zombieBabyChance.tooltip=幼年僵尸在所有僵尸(包括僵尸的子类)中的出现概率. 更改此项可以修改僵尸生成机制. +forge.configgui.zombieBabyChance=幼年僵尸概率 +forge.configgui.zombieBaseSummonChance.tooltip=僵尸召唤的基础生成概率. 更改此项可以更改额外生成僵尸的机制. +forge.configgui.zombieBaseSummonChance=僵尸召唤概率 +forge.configgui.stencilbits=启用GL模版位元 +forge.configgui.spawnfuzz=重生点范围模糊半径 + +forge.configgui.modID.tooltip=你想要为其定义设置项覆盖的Mod的ID. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=未加载区块会被首先保留在一个未被使用的缓存内以使加载耗时更短. 请在这里明确其大小(单位为区块数). +forge.configgui.dormantChunkCacheSize=休眠区块缓存大小 +forge.configgui.enableModOverrides.tooltip=启用该项设置会允许自定义为每个Mod单独配置的设置. +forge.configgui.enableModOverrides=启用Mod设置项覆盖 +forge.configgui.maximumChunksPerTicket.tooltip=该项为单独一个标签可以影响的最大区块数目. +forge.configgui.maximumChunksPerTicket=每个标签内的区块数限制 +forge.configgui.maximumTicketCount.tooltip=该项为一个Mod的区块加载请求能够被允许提出的最大数量. +forge.configgui.maximumTicketCount=Mod标签数量限制 +forge.configgui.playerTicketCount.tooltip=可以分配给一个玩家而不是一个Mod的最大标签数量. 该项对所有Mod共享, 由使用它的Mod的不同而确定. +forge.configgui.playerTicketCount=玩家标签数量限制 + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/forge/lang/zh_TW.lang b/build/resources/patchedMc/assets/forge/lang/zh_TW.lang new file mode 100644 index 0000000..7509e30 --- /dev/null +++ b/build/resources/patchedMc/assets/forge/lang/zh_TW.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=使用 /forge 。subcommand 為 tps 和 track +commands.forge.usage.tracking=使用 /forge track 。有效的 type 為 te (實體附加值)。duration 小於 60。 +commands.forge.tps.summary=%s:平均一刻時間:%d ms。平均每秒刻數:%d + +commands.forge.tracking.te.enabled=已開啟實體附加值追蹤 %d 秒。 +forge.texture.preload.warning=警告:材質 %s 未被預載,可能會導致畫面異常! +forge.client.shutdown.internal=正在停止內部伺服器… +forge.update.newversion=已有新的Forge版本:%s +forge.update.beta.1=%s警告:%sForge為Beta版 +forge.update.beta.2=可能會出現重要問題,請在報告前進行確認。 + +forge.configgui.forgeConfigTitle=Minecraft Forge 設定 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=你可以在此編輯forge.cfg內的設定 +forge.configgui.ctgy.forgeGeneralConfig=通用設定 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=你可以在此編輯forgeChunkLoading.cfg內的設定。 +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge資料塊載入器預設設定 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=在此你可以針對個別Mod定義覆蓋預設值的設定。 +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod設定覆蓋 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=允許你定義可覆蓋Mod預設值的設定。任何值為零的設定將禁止該mod載入資料塊。 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=排序合成公式 +forge.configgui.zombieBabyChance.tooltip=殭屍(與衍生怪)是小殭屍的機率。 能更改殭屍出現的機制。 +forge.configgui.zombieBabyChance=招喚小殭屍機率 +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=招喚殭屍機率 +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=啟用這個選項能讓你定義個別mod的設定。 +forge.configgui.enableModOverrides=啟用Mod設定覆蓋 +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=每刻資料塊數上限 +forge.configgui.maximumTicketCount.tooltip=這是每個 mod 每刻最多可以要求多少個資料塊載入。 +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/resources/patchedMc/assets/minecraft/font/glyph_sizes.bin b/build/resources/patchedMc/assets/minecraft/font/glyph_sizes.bin new file mode 100644 index 0000000..69c857e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/font/glyph_sizes.bin differ diff --git a/build/resources/patchedMc/assets/minecraft/lang/en_US.lang b/build/resources/patchedMc/assets/minecraft/lang/en_US.lang new file mode 100644 index 0000000..628a2a6 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/lang/en_US.lang @@ -0,0 +1,1692 @@ + +language.name=English +language.region=US +language.code=en_US + +gui.done=Done +gui.cancel=Cancel +gui.back=Back +gui.toMenu=Back to title screen +gui.up=Up +gui.down=Down +gui.yes=Yes +gui.no=No + +translation.test.none=Hello, world! +translation.test.complex=Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again! +translation.test.escape=%%s %%%s %%%%s %%%%%s +translation.test.invalid=hi % +translation.test.invalid2=hi % s +translation.test.args=%s %s +translation.test.world=world + +menu.game=Game menu +menu.singleplayer=Singleplayer +menu.multiplayer=Multiplayer +menu.online=Minecraft Realms +menu.options=Options... +menu.quit=Quit Game +menu.returnToMenu=Save and Quit to Title +menu.disconnect=Disconnect +menu.returnToGame=Back to Game +menu.switchingLevel=Switching worlds +menu.generatingLevel=Generating world +menu.loadingLevel=Loading world +menu.generatingTerrain=Building terrain +menu.convertingLevel=Converting world +menu.simulating=Simulating the world for a bit +menu.respawning=Respawning +menu.shareToLan=Open to LAN + +selectWorld.title=Select World +selectWorld.empty=empty +selectWorld.world=World +selectWorld.select=Play Selected World +selectWorld.create=Create New World +selectWorld.recreate=Re-Create +selectWorld.createDemo=Play New Demo World +selectWorld.delete=Delete +selectWorld.rename=Rename +selectWorld.deleteQuestion=Are you sure you want to delete this world? +selectWorld.deleteWarning=will be lost forever! (A long time!) +selectWorld.deleteButton=Delete +selectWorld.renameButton=Rename +selectWorld.renameTitle=Rename World +selectWorld.conversion=Must be converted! +selectWorld.newWorld=New World +selectWorld.newWorld.copyOf=Copy of %s +selectWorld.enterName=World Name +selectWorld.resultFolder=Will be saved in: +selectWorld.enterSeed=Seed for the World Generator +selectWorld.seedInfo=Leave blank for a random seed +selectWorld.cheats=Cheats +selectWorld.customizeType=Customize + +createWorld.customize.presets=Presets +createWorld.customize.presets.title=Select a Preset +createWorld.customize.presets.select=Use Preset +createWorld.customize.presets.share=Want to share your preset with someone? Use the below box! +createWorld.customize.presets.list=Alternatively, here's some we made earlier! +createWorld.customize.flat.title=Superflat Customization +createWorld.customize.flat.tile=Layer Material +createWorld.customize.flat.height=Height +createWorld.customize.flat.addLayer=Add Layer +createWorld.customize.flat.editLayer=Edit Layer +createWorld.customize.flat.removeLayer=Remove Layer +createWorld.customize.flat.layer.top=Top - %d +createWorld.customize.flat.layer=%d +createWorld.customize.flat.layer.bottom=Bottom - %d + +gameMode.survival=Survival Mode +gameMode.creative=Creative Mode +gameMode.adventure=Adventure Mode +gameMode.hardcore=Hardcore Mode! +gameMode.changed=Your game mode has been updated + +selectWorld.gameMode=Game Mode +selectWorld.gameMode.survival=Survival +selectWorld.gameMode.survival.line1=Search for resources, crafting, gain +selectWorld.gameMode.survival.line2=levels, health and hunger +selectWorld.gameMode.creative=Creative +selectWorld.gameMode.creative.line1=Unlimited resources, free flying and +selectWorld.gameMode.creative.line2=destroy blocks instantly +selectWorld.gameMode.hardcore=Hardcore +selectWorld.gameMode.hardcore.line1=Same as survival mode, locked at hardest +selectWorld.gameMode.hardcore.line2=difficulty, and one life only +selectWorld.gameMode.adventure=Adventure +selectWorld.gameMode.adventure.line1=Same as survival mode, but blocks can't +selectWorld.gameMode.adventure.line2=be added or removed +selectWorld.moreWorldOptions=More World Options... +selectWorld.mapFeatures=Generate Structures: +selectWorld.mapFeatures.info=Villages, dungeons etc +selectWorld.mapType=World Type: +selectWorld.mapType.normal=Normal +selectWorld.allowCommands=Allow Cheats: +selectWorld.allowCommands.info=Commands like /gamemode, /xp +selectWorld.hardcoreMode=Hardcore: +selectWorld.hardcoreMode.info=World is deleted upon death +selectWorld.bonusItems=Bonus Chest: + +generator.default=Default +generator.flat=Superflat +generator.largeBiomes=Large Biomes +generator.amplified=Amplified + +generator.amplified.info=Notice: Just for fun, requires beefy computer + +selectServer.title=Select Server +selectServer.empty=empty +selectServer.select=Join Server +selectServer.direct=Direct Connect +selectServer.edit=Edit +selectServer.delete=Delete +selectServer.add=Add server +selectServer.defaultName=Minecraft Server +selectServer.deleteQuestion=Are you sure you want to remove this server? +selectServer.deleteWarning=will be lost forever! (A long time!) +selectServer.deleteButton=Delete +selectServer.refresh=Refresh +selectServer.hiddenAddress=(Hidden) +addServer.title=Edit Server Info +addServer.enterName=Server Name +addServer.enterIp=Server Address +addServer.add=Done +addServer.hideAddress=Hide Address +addServer.resourcePack=Server Resource Packs +addServer.resourcePack.enabled=Enabled +addServer.resourcePack.disabled=Disabled +addServer.resourcePack.prompt=Prompt +lanServer.title=LAN World +lanServer.scanning=Scanning for games on your local network +lanServer.start=Start LAN World +lanServer.otherPlayers=Settings for Other Players +mcoServer.title=Minecraft Online World + +multiplayer.title=Play Multiplayer +multiplayer.connect=Connect +multiplayer.info1=Minecraft Multiplayer is currently not finished, but there +multiplayer.info2=is some buggy early testing going on. +multiplayer.ipinfo=Enter the IP of a server to connect to it: +multiplayer.texturePrompt.line1=This server recommends the use of a custom resource pack. +multiplayer.texturePrompt.line2=Would you like to download and install it automagically? +multiplayer.downloadingTerrain=Downloading terrain +multiplayer.downloadingStats=Downloading statistics & achievements... +multiplayer.stopSleeping=Leave Bed +multiplayer.player.joined=%s joined the game +multiplayer.player.joined.renamed=%s (formerly known as %s) joined the game +multiplayer.player.left=%s left the game + +chat.cannotSend=Cannot send chat message +chat.type.text=<%s> %s +chat.type.emote=* %s %s +chat.type.announcement=[%s] %s +chat.type.admin=[%s: %s] +chat.type.achievement=%s has just earned the achievement %s +chat.link.confirm=Are you sure you want to open the following website? +chat.link.warning=Never open links from people that you don't trust! +chat.copy=Copy to Clipboard +chat.link.confirmTrusted=Do you want to open this link or copy it to your clipboard? +chat.link.open=Open in browser + +chat.stream.text=(%s) <%s> %s +chat.stream.emote=(%s) * %s %s + +menu.playdemo=Play Demo World +menu.resetdemo=Reset Demo World + +demo.day.1=This demo will last five game days, do your best! +demo.day.2=Day Two +demo.day.3=Day Three +demo.day.4=Day Four +demo.day.5=This is your last day! +demo.day.warning=Your time is almost up! +demo.day.6=You have passed your fifth day, use F2 to save a screenshot of your creation +demo.reminder=The demo time has expired, buy the game to continue or start a new world! +demo.remainingTime=Remaining time: %s +demo.demoExpired=Demo time's up! +demo.help.movement=Use %1$s, %2$s, %3$s, %4$s and the mouse to move around +demo.help.movementShort=Move by pressing %1$s, %2$s, %3$s, %4$s +demo.help.movementMouse=Look around using the mouse +demo.help.jump=Jump by pressing %1$s +demo.help.inventory=Use %1$s to open your inventory +demo.help.title=Minecraft Demo Mode +demo.help.fullWrapped=This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the achievements for hints! Have fun! +demo.help.buy=Purchase Now! +demo.help.later=Continue Playing! + +connect.connecting=Connecting to the server... +connect.authorizing=Logging in... +connect.failed=Failed to connect to the server + +disconnect.genericReason=%s +disconnect.disconnected=Disconnected by Server +disconnect.lost=Connection Lost +disconnect.kicked=Was kicked from the game +disconnect.timeout=Timed out +disconnect.closed=Connection closed +disconnect.loginFailed=Failed to login +disconnect.loginFailedInfo=Failed to login: %s +disconnect.loginFailedInfo.serversUnavailable=The authentication are currently down for maintenance. +disconnect.loginFailedInfo.invalidSession=Invalid session (Try restarting your game) +disconnect.quitting=Quitting +disconnect.endOfStream=End of stream +disconnect.overflow=Buffer overflow +disconnect.spam=Kicked for spamming + +soundCategory.master=Master Volume +soundCategory.music=Music +soundCategory.record=Jukebox/Noteblocks +soundCategory.weather=Weather +soundCategory.hostile=Hostile Creatures +soundCategory.neutral=Friendly Creatures +soundCategory.player=Players +soundCategory.block=Blocks +soundCategory.ambient=Ambient/Environment + +record.nowPlaying=Now playing: %s + +options.off=OFF +options.on=ON +options.visible=Shown +options.hidden=Hidden +options.title=Options +options.controls=Controls... +options.video=Video Settings... +options.language=Language... +options.stream=Broadcast Settings... +options.sounds=Music & Sounds... +options.sounds.title=Music & Sound Options +options.languageWarning=Language translations may not be 100%% accurate +options.videoTitle=Video Settings +options.music=Music +options.sound=Sound +options.invertMouse=Invert Mouse +options.fov=FOV +options.fov.min=Normal +options.fov.max=Quake Pro +options.saturation=Saturation +options.gamma=Brightness +options.gamma.min=Moody +options.gamma.max=Bright +options.sensitivity=Sensitivity +options.sensitivity.min=*yawn* +options.sensitivity.max=HYPERSPEED!!! +options.renderDistance=Render Distance +options.renderDistance.tiny=Tiny +options.renderDistance.short=Short +options.renderDistance.normal=Normal +options.renderDistance.far=Far +options.viewBobbing=View Bobbing +options.ao=Smooth Lighting +options.ao.off=OFF +options.ao.min=Minimum +options.ao.max=Maximum +options.anaglyph=3D Anaglyph +options.framerateLimit=Max Framerate +options.framerateLimit.max=Unlimited +options.difficulty=Difficulty +options.difficulty.peaceful=Peaceful +options.difficulty.easy=Easy +options.difficulty.normal=Normal +options.difficulty.hard=Hard +options.difficulty.hardcore=Hardcore +options.graphics=Graphics +options.graphics.fancy=Fancy +options.graphics.fast=Fast +options.guiScale=GUI Scale +options.guiScale.auto=Auto +options.guiScale.small=Small +options.guiScale.normal=Normal +options.guiScale.large=Large +options.advancedOpengl=Advanced OpenGL +options.fboEnable=Enable FBOs +options.postProcessEnable=Enable Post-Processing +options.aoDesc0=Enable faux ambient occlusion on blocks. +options.aoDesc1= +options.framerateLimitDesc0=Selects the maximum frame rate: +options.framerateLimitDesc1=35fps, 120fps, or 200+fps. +options.viewBobbingDesc0=Enables view-bob when moving. +options.viewBobbingDesc1= +options.renderCloudsDesc0=Enables the rendering of clouds. +options.renderCloudsDesc1= +options.graphicsDesc0='Fancy': Enables extra transparency. +options.graphicsDesc1='Fast': Suggested for lower-end hardware. +options.renderDistanceDesc0=Maximum render distance. Smaller values +options.renderDistanceDesc1=run better on lower-end hardware. +options.particlesDesc0=Selects the overall amount of particles. +options.particlesDesc1=On lower-end hardware, less is better. +options.advancedOpenglDesc0=Enables occlusion queries. On AMD and Intel +options.advancedOpenglDesc1=hardware, this may decrease performance. +options.fboEnableDesc0=Enables the use of Framebuffer Objects. +options.fboEnableDesc1=Necessary for certain Minecraft features. +options.postProcessEnableDesc0=Enables post-processing. Disabling will +options.postProcessEnableDesc1=result in reduction in Awesome Levels. +options.renderClouds=Clouds +options.qualityButton=Video Quality Settings... +options.qualityVideoTitle=Video Quality Settings +options.performanceButton=Video Performance Settings... +options.performanceVideoTitle=Video Performance Settings +options.advancedButton=Advanced Video Settings... +options.advancedVideoTitle=Advanced Video Settings +options.postButton=Post-Processing Settings... +options.postVideoTitle=Post-Processing Settings +options.farWarning1=A 64 bit Java installation is recommended +options.farWarning2=for 'Far' render distance (you have 32 bit) +options.particles=Particles +options.particles.all=All +options.particles.decreased=Decreased +options.particles.minimal=Minimal +options.multiplayer.title=Multiplayer Settings... +options.chat.title=Chat Settings... +options.chat.visibility=Chat +options.chat.visibility.full=Shown +options.chat.visibility.system=Commands Only +options.chat.visibility.hidden=Hidden +options.chat.color=Colors +options.chat.opacity=Opacity +options.chat.links=Web Links +options.chat.links.prompt=Prompt on Links +options.chat.scale=Scale +options.chat.width=Width +options.chat.height.focused=Focused Height +options.chat.height.unfocused=Unfocused Height +options.showCape=Show Cape +options.snooper=Allow Snooper +options.snooper.view=Snooper Settings... +options.snooper.title=Machine Specs Collection +options.snooper.desc=We want to collect information about your machine to help improve Minecraft by knowing what we can support and where the biggest problems are. All of this information is completely anonymous and viewable below. We promise we won't do anything bad with this data, but if you want to opt out then feel free to toggle it off! +options.resourcepack=Resource Packs... +options.fullscreen=Fullscreen +options.vsync=Use VSync +options.touchscreen=Touchscreen Mode + +options.mipmapLevels=Mipmap Levels +options.anisotropicFiltering=Anisotropic Filtering +options.forceUnicodeFont=Force Unicode Font + +options.stream.title=Twitch Broadcast Settings +options.stream.bytesPerPixel=Quality +options.stream.micVolumne=Mic Volume +options.stream.micToggleBehavior=Push To +options.stream.mic_toggle.mute=Mute +options.stream.mic_toggle.talk=Talk +options.stream.systemVolume=System Volume +options.stream.kbps=Bandwidth +options.stream.fps=Framerate +options.stream.sendMetadata=Send Metadata +options.stream.compression=Compression +options.stream.compression.low=Low +options.stream.compression.medium=Medium +options.stream.compression.high=High +options.stream.estimation=Estimated resolution: %dx%d +options.stream.changes=You may need to restart your stream for these changes to take place. +options.stream.ingestSelection=Broadcast Server List +options.stream.ingest.title=Twitch Broadcast Servers +options.stream.ingest.reset=Reset Preference +options.stream.chat.title=Twitch Chat Settings +options.stream.chat.enabled=Enable +options.stream.chat.enabled.streaming=Whilst Streaming +options.stream.chat.enabled.always=Always +options.stream.chat.enabled.never=Never +options.stream.chat.userFilter=User Filter +options.stream.chat.userFilter.all=All Viewers +options.stream.chat.userFilter.subs=Subscribers +options.stream.chat.userFilter.mods=Moderators + +title.oldgl1=Old graphics card detected; this may prevent you from +title.oldgl2=playing in the future as OpenGL 2.0 will be required. + +controls.title=Controls +controls.reset=Reset +controls.resetAll=Reset Keys + +key.sprint=Sprint +key.forward=Walk Forwards +key.left=Strafe Left +key.back=Walk Backwards +key.right=Strafe Right +key.jump=Jump +key.inventory=Inventory +key.drop=Drop Item +key.chat=Open Chat +key.sneak=Sneak +key.playerlist=List Players +key.attack=Attack/Destroy +key.use=Use Item/Place Block +key.pickItem=Pick Block +key.mouseButton=Button %1$s +key.command=Open Command +key.screenshot=Take Screenshot +key.togglePerspective=Toggle Perspective +key.smoothCamera=Toggle Cinematic Camera +key.fullscreen=Toggle Fullscreen +key.hotbar.1=Hotbar Slot 1 +key.hotbar.2=Hotbar Slot 2 +key.hotbar.3=Hotbar Slot 3 +key.hotbar.4=Hotbar Slot 4 +key.hotbar.5=Hotbar Slot 5 +key.hotbar.6=Hotbar Slot 6 +key.hotbar.7=Hotbar Slot 7 +key.hotbar.8=Hotbar Slot 8 +key.hotbar.9=Hotbar Slot 9 +key.streamStartStop=Start/Stop Stream +key.streamPauseUnpause=Pause/Unpause Stream +key.streamCommercial=Show Stream Commercials +key.streamToggleMic=Push To Talk/Mute + +key.categories.movement=Movement +key.categories.misc=Miscellaneous +key.categories.multiplayer=Multiplayer +key.categories.gameplay=Gameplay +key.categories.ui=Game Interface +key.categories.inventory=Inventory +key.categories.stream=Streaming + +resourcePack.openFolder=Open resource pack folder +resourcePack.title=Select Resource Packs +resourcePack.available.title=Available Resource Packs +resourcePack.selected.title=Selected Resource Packs +resourcePack.folderInfo=(Place resource pack files here) + +sign.edit=Edit sign message + +book.pageIndicator=Page %1$s of %2$s +book.byAuthor=by %1$s +book.signButton=Sign +book.editTitle=Enter Book Title: +book.finalizeButton=Sign and Close +book.finalizeWarning=Note! When you sign the book, it will no longer be editable. + +tile.stone.name=Stone +tile.hayBlock.name=Hay Bale +tile.grass.name=Grass Block +tile.dirt.default.name=Dirt +tile.dirt.podzol.name=Podzol +tile.stonebrick.name=Cobblestone +tile.wood.name=Wooden Planks +tile.wood.oak.name=Oak Wood Planks +tile.wood.spruce.name=Spruce Wood Planks +tile.wood.birch.name=Birch Wood Planks +tile.wood.jungle.name=Jungle Wood Planks +tile.wood.acacia.name=Acacia Wood Planks +tile.wood.big_oak.name=Dark Oak Wood Planks +tile.sapling.oak.name=Oak Sapling +tile.sapling.spruce.name=Spruce Sapling +tile.sapling.birch.name=Birch Sapling +tile.sapling.jungle.name=Jungle Sapling +tile.sapling.acacia.name=Acacia Sapling +tile.sapling.roofed_oak.name=Dark Oak Sapling +tile.deadbush.name=Dead Bush +tile.bedrock.name=Bedrock +tile.water.name=Water +tile.lava.name=Lava +tile.sand.default.name=Sand +tile.sand.red.name=Red Sand +tile.sandStone.name=Sandstone +tile.sandStone.default.name=Sandstone +tile.sandStone.chiseled.name=Chiseled Sandstone +tile.sandStone.smooth.name=Smooth Sandstone +tile.gravel.name=Gravel +tile.oreGold.name=Gold Ore +tile.oreIron.name=Iron Ore +tile.oreCoal.name=Coal Ore +tile.log.name=Wood +tile.log.oak.name=Oak Wood +tile.log.spruce.name=Spruce Wood +tile.log.birch.name=Birch Wood +tile.log.jungle.name=Jungle Wood +tile.log.acacia.name=Acacia Wood +tile.log.big_oak.name=Dark Oak Wood +tile.leaves.name=Leaves +tile.leaves.oak.name=Oak Leaves +tile.leaves.spruce.name=Spruce Leaves +tile.leaves.birch.name=Birch Leaves +tile.leaves.jungle.name=Jungle Leaves +tile.leaves.acacia.name=Acacia Leaves +tile.leaves.big_oak.name=Dark Oak Leaves +tile.tallgrass.name=Grass +tile.tallgrass.shrub.name=Shrub +tile.tallgrass.grass.name=Grass +tile.tallgrass.fern.name=Fern +tile.sponge.name=Sponge +tile.glass.name=Glass +tile.stainedGlass.name=Stained Glass +tile.stainedGlass.black.name=Black Stained Glass +tile.stainedGlass.red.name=Red Stained Glass +tile.stainedGlass.green.name=Green Stained Glass +tile.stainedGlass.brown.name=Brown Stained Glass +tile.stainedGlass.blue.name=Blue Stained Glass +tile.stainedGlass.purple.name=Purple Stained Glass +tile.stainedGlass.cyan.name=Cyan Stained Glass +tile.stainedGlass.silver.name=Light Gray Stained Glass +tile.stainedGlass.gray.name=Gray Stained Glass +tile.stainedGlass.pink.name=Pink Stained Glass +tile.stainedGlass.lime.name=Lime Stained Glass +tile.stainedGlass.yellow.name=Yellow Stained Glass +tile.stainedGlass.lightBlue.name=Light Blue Stained Glass +tile.stainedGlass.magenta.name=Magenta Stained Glass +tile.stainedGlass.orange.name=Orange Stained Glass +tile.stainedGlass.white.name=White Stained Glass +tile.thinStainedGlass.name=Stained Glass Pane +tile.thinStainedGlass.black.name=Black Stained Glass Pane +tile.thinStainedGlass.red.name=Red Stained Glass Pane +tile.thinStainedGlass.green.name=Green Stained Glass Pane +tile.thinStainedGlass.brown.name=Brown Stained Glass Pane +tile.thinStainedGlass.blue.name=Blue Stained Glass Pane +tile.thinStainedGlass.purple.name=Purple Stained Glass Pane +tile.thinStainedGlass.cyan.name=Cyan Stained Glass Pane +tile.thinStainedGlass.silver.name=Light Gray Stained Glass Pane +tile.thinStainedGlass.gray.name=Gray Stained Glass Pane +tile.thinStainedGlass.pink.name=Pink Stained Glass Pane +tile.thinStainedGlass.lime.name=Lime Stained Glass Pane +tile.thinStainedGlass.yellow.name=Yellow Stained Glass Pane +tile.thinStainedGlass.lightBlue.name=Light Blue Stained Glass Pane +tile.thinStainedGlass.magenta.name=Magenta Stained Glass Pane +tile.thinStainedGlass.orange.name=Orange Stained Glass Pane +tile.thinStainedGlass.white.name=White Stained Glass Pane +tile.thinGlass.name=Glass Pane +tile.cloth.name=Wool +tile.flower1.dandelion.name=Dandelion +tile.flower2.poppy.name=Poppy +tile.flower2.blueOrchid.name=Blue Orchid +tile.flower2.allium.name=Allium +tile.flower2.houstonia.name=Azure Bluet +tile.flower2.tulipRed.name=Red Tulip +tile.flower2.tulipOrange.name=Orange Tulip +tile.flower2.tulipWhite.name=White Tulip +tile.flower2.tulipPink.name=Pink Tulip +tile.flower2.oxeyeDaisy.name=Oxeye Daisy +tile.doublePlant.sunflower.name=Sunflower +tile.doublePlant.syringa.name=Lilac +tile.doublePlant.grass.name=Double Tallgrass +tile.doublePlant.fern.name=Large Fern +tile.doublePlant.rose.name=Rose Bush +tile.doublePlant.paeonia.name=Peony +tile.mushroom.name=Mushroom +tile.blockGold.name=Block of Gold +tile.blockIron.name=Block of Iron +tile.stoneSlab.stone.name=Stone Slab +tile.stoneSlab.sand.name=Sandstone Slab +tile.stoneSlab.wood.name=Wooden Slab +tile.stoneSlab.cobble.name=Cobblestone Slab +tile.stoneSlab.brick.name=Bricks Slab +tile.stoneSlab.smoothStoneBrick.name=Stone Bricks Slab +tile.stoneSlab.netherBrick.name=Nether Brick Slab +tile.stoneSlab.quartz.name=Quartz Slab +tile.woodSlab.oak.name=Oak Wood Slab +tile.woodSlab.spruce.name=Spruce Wood Slab +tile.woodSlab.birch.name=Birch Wood Slab +tile.woodSlab.jungle.name=Jungle Wood Slab +tile.woodSlab.acacia.name=Acacia Wood Slab +tile.woodSlab.big_oak.name=Dark Oak Wood Slab +tile.brick.name=Bricks +tile.tnt.name=TNT +tile.bookshelf.name=Bookshelf +tile.stoneMoss.name=Moss Stone +tile.obsidian.name=Obsidian +tile.torch.name=Torch +tile.fire.name=Fire +tile.mobSpawner.name=Monster Spawner +tile.stairsWood.name=Oak Wood Stairs +tile.stairsWoodSpruce.name=Spruce Wood Stairs +tile.stairsWoodBirch.name=Birch Wood Stairs +tile.stairsWoodJungle.name=Jungle Wood Stairs +tile.stairsWoodAcacia.name=Acacia Wood Stairs +tile.stairsWoodDarkOak.name=Dark Oak Wood Stairs +tile.chest.name=Chest +tile.chestTrap.name=Trapped Chest +tile.redstoneDust.name=Redstone Dust +tile.oreDiamond.name=Diamond Ore +tile.blockCoal.name=Block of Coal +tile.blockDiamond.name=Block of Diamond +tile.workbench.name=Crafting Table +tile.crops.name=Crops +tile.farmland.name=Farmland +tile.furnace.name=Furnace +tile.sign.name=Sign +tile.doorWood.name=Wooden Door +tile.ladder.name=Ladder +tile.rail.name=Rail +tile.goldenRail.name=Powered Rail +tile.activatorRail.name=Activator Rail +tile.detectorRail.name=Detector Rail +tile.stairsStone.name=Stone Stairs +tile.stairsSandStone.name=Sandstone Stairs +tile.lever.name=Lever +tile.pressurePlate.name=Pressure Plate +tile.weightedPlate_light.name=Weighted Pressure Plate (Light) +tile.weightedPlate_heavy.name=Weighted Pressure Plate (Heavy) +tile.doorIron.name=Iron Door +tile.oreRedstone.name=Redstone Ore +tile.notGate.name=Redstone Torch +tile.button.name=Button +tile.snow.name=Snow +tile.woolCarpet.black.name=Black Carpet +tile.woolCarpet.red.name=Red Carpet +tile.woolCarpet.green.name=Green Carpet +tile.woolCarpet.brown.name=Brown Carpet +tile.woolCarpet.blue.name=Blue Carpet +tile.woolCarpet.purple.name=Purple Carpet +tile.woolCarpet.cyan.name=Cyan Carpet +tile.woolCarpet.silver.name=Light Gray Carpet +tile.woolCarpet.gray.name=Gray Carpet +tile.woolCarpet.pink.name=Pink Carpet +tile.woolCarpet.lime.name=Lime Carpet +tile.woolCarpet.yellow.name=Yellow Carpet +tile.woolCarpet.lightBlue.name=Light Blue Carpet +tile.woolCarpet.magenta.name=Magenta Carpet +tile.woolCarpet.orange.name=Orange Carpet +tile.woolCarpet.white.name=Carpet +tile.ice.name=Ice +tile.icePacked.name=Packed Ice +tile.cactus.name=Cactus +tile.clay.name=Clay +tile.clayHardenedStained.black.name=Black Stained Clay +tile.clayHardenedStained.red.name=Red Stained Clay +tile.clayHardenedStained.green.name=Green Stained Clay +tile.clayHardenedStained.brown.name=Brown Stained Clay +tile.clayHardenedStained.blue.name=Blue Stained Clay +tile.clayHardenedStained.purple.name=Purple Stained Clay +tile.clayHardenedStained.cyan.name=Cyan Stained Clay +tile.clayHardenedStained.silver.name=Light Gray Stained Clay +tile.clayHardenedStained.gray.name=Gray Stained Clay +tile.clayHardenedStained.pink.name=Pink Stained Clay +tile.clayHardenedStained.lime.name=Lime Stained Clay +tile.clayHardenedStained.yellow.name=Yellow Stained Clay +tile.clayHardenedStained.lightBlue.name=Light Blue Stained Clay +tile.clayHardenedStained.magenta.name=Magenta Stained Clay +tile.clayHardenedStained.orange.name=Orange Stained Clay +tile.clayHardenedStained.white.name=White Stained Clay +tile.clayHardened.name=Hardened Clay +tile.reeds.name=Sugar cane +tile.jukebox.name=Jukebox +tile.fence.name=Fence +tile.fenceGate.name=Fence Gate +tile.pumpkin.name=Pumpkin +tile.litpumpkin.name=Jack o'Lantern +tile.hellrock.name=Netherrack +tile.hellsand.name=Soul Sand +tile.lightgem.name=Glowstone +tile.portal.name=Portal +tile.cloth.black.name=Black Wool +tile.cloth.red.name=Red Wool +tile.cloth.green.name=Green Wool +tile.cloth.brown.name=Brown Wool +tile.cloth.blue.name=Blue Wool +tile.cloth.purple.name=Purple Wool +tile.cloth.cyan.name=Cyan Wool +tile.cloth.silver.name=Light Gray Wool +tile.cloth.gray.name=Gray Wool +tile.cloth.pink.name=Pink Wool +tile.cloth.lime.name=Lime Wool +tile.cloth.yellow.name=Yellow Wool +tile.cloth.lightBlue.name=Light Blue Wool +tile.cloth.magenta.name=Magenta Wool +tile.cloth.orange.name=Orange Wool +tile.cloth.white.name=Wool +tile.oreLapis.name=Lapis Lazuli Ore +tile.blockLapis.name=Lapis Lazuli Block +tile.dispenser.name=Dispenser +tile.dropper.name=Dropper +tile.musicBlock.name=Note Block +tile.cake.name=Cake +tile.bed.name=Bed +tile.bed.occupied=This bed is occupied +tile.bed.noSleep=You can only sleep at night +tile.bed.notSafe=You may not rest now, there are monsters nearby +tile.bed.notValid=Your home bed was missing or obstructed +tile.lockedchest.name=Locked chest +tile.trapdoor.name=Trapdoor +tile.web.name=Cobweb +tile.stonebricksmooth.name=Stone Bricks +tile.stonebricksmooth.default.name=Stone Bricks +tile.stonebricksmooth.mossy.name=Mossy Stone Bricks +tile.stonebricksmooth.cracked.name=Cracked Stone Bricks +tile.stonebricksmooth.chiseled.name=Chiseled Stone Bricks +tile.monsterStoneEgg.stone.name=Stone Monster Egg +tile.monsterStoneEgg.cobble.name=Cobblestone Monster Egg +tile.monsterStoneEgg.brick.name=Stone Brick Monster Egg +tile.monsterStoneEgg.mossybrick.name=Mossy Stone Brick Monster Egg +tile.monsterStoneEgg.crackedbrick.name=Cracked Stone Brick Monster Egg +tile.monsterStoneEgg.chiseledbrick.name=Chiseled Stone Brick Monster Egg +tile.pistonBase.name=Piston +tile.pistonStickyBase.name=Sticky Piston +tile.fenceIron.name=Iron Bars +tile.melon.name=Melon +tile.stairsBrick.name=Brick Stairs +tile.stairsStoneBrickSmooth.name=Stone Brick Stairs +tile.vine.name=Vines +tile.netherBrick.name=Nether Brick +tile.netherFence.name=Nether Brick Fence +tile.stairsNetherBrick.name=Nether Brick Stairs +tile.netherStalk.name=Nether Wart +tile.cauldron.name=Cauldron +tile.enchantmentTable.name=Enchantment Table +tile.anvil.name=Anvil +tile.anvil.intact.name=Anvil +tile.anvil.slightlyDamaged.name=Slightly Damaged Anvil +tile.anvil.veryDamaged.name=Very Damaged Anvil +tile.whiteStone.name=End Stone +tile.endPortalFrame.name=End Portal +tile.mycel.name=Mycelium +tile.waterlily.name=Lily Pad +tile.dragonEgg.name=Dragon Egg +tile.redstoneLight.name=Redstone Lamp +tile.cocoa.name=Cocoa +tile.enderChest.name=Ender Chest +tile.oreRuby.name=Ruby Ore +tile.oreEmerald.name=Emerald Ore +tile.blockEmerald.name=Block of Emerald +tile.blockRedstone.name=Block of Redstone +tile.tripWire.name=Tripwire +tile.tripWireSource.name=Tripwire Hook +tile.commandBlock.name=Command Block +tile.beacon.name=Beacon +tile.beacon.primary=Primary Power +tile.beacon.secondary=Secondary Power +tile.cobbleWall.normal.name=Cobblestone Wall +tile.cobbleWall.mossy.name=Mossy Cobblestone Wall +tile.carrots.name=Carrots +tile.potatoes.name=Potatoes +tile.daylightDetector.name=Daylight Sensor +tile.netherquartz.name=Nether Quartz Ore +tile.hopper.name=Hopper +tile.quartzBlock.default.name=Block of Quartz +tile.quartzBlock.chiseled.name=Chiseled Quartz Block +tile.quartzBlock.lines.name=Pillar Quartz Block +tile.stairsQuartz.name=Quartz Stairs + +item.nameTag.name=Name Tag +item.leash.name=Lead +item.shovelIron.name=Iron Shovel +item.pickaxeIron.name=Iron Pickaxe +item.hatchetIron.name=Iron Axe +item.flintAndSteel.name=Flint and Steel +item.apple.name=Apple +item.cookie.name=Cookie +item.bow.name=Bow +item.arrow.name=Arrow +item.coal.name=Coal +item.charcoal.name=Charcoal +item.diamond.name=Diamond +item.emerald.name=Emerald +item.ingotIron.name=Iron Ingot +item.ingotGold.name=Gold Ingot +item.swordIron.name=Iron Sword +item.swordWood.name=Wooden Sword +item.shovelWood.name=Wooden Shovel +item.pickaxeWood.name=Wooden Pickaxe +item.hatchetWood.name=Wooden Axe +item.swordStone.name=Stone Sword +item.shovelStone.name=Stone Shovel +item.pickaxeStone.name=Stone Pickaxe +item.hatchetStone.name=Stone Axe +item.swordDiamond.name=Diamond Sword +item.shovelDiamond.name=Diamond Shovel +item.pickaxeDiamond.name=Diamond Pickaxe +item.hatchetDiamond.name=Diamond Axe +item.stick.name=Stick +item.bowl.name=Bowl +item.mushroomStew.name=Mushroom Stew +item.swordGold.name=Golden Sword +item.shovelGold.name=Golden Shovel +item.pickaxeGold.name=Golden Pickaxe +item.hatchetGold.name=Golden Axe +item.string.name=String +item.feather.name=Feather +item.sulphur.name=Gunpowder +item.hoeWood.name=Wooden Hoe +item.hoeStone.name=Stone Hoe +item.hoeIron.name=Iron Hoe +item.hoeDiamond.name=Diamond Hoe +item.hoeGold.name=Golden Hoe +item.seeds.name=Seeds +item.seeds_pumpkin.name=Pumpkin Seeds +item.seeds_melon.name=Melon Seeds +item.melon.name=Melon +item.wheat.name=Wheat +item.bread.name=Bread +item.helmetCloth.name=Leather Cap +item.chestplateCloth.name=Leather Tunic +item.leggingsCloth.name=Leather Pants +item.bootsCloth.name=Leather Boots +item.helmetChain.name=Chain Helmet +item.chestplateChain.name=Chain Chestplate +item.leggingsChain.name=Chain Leggings +item.bootsChain.name=Chain Boots +item.helmetIron.name=Iron Helmet +item.chestplateIron.name=Iron Chestplate +item.leggingsIron.name=Iron Leggings +item.bootsIron.name=Iron Boots +item.helmetDiamond.name=Diamond Helmet +item.chestplateDiamond.name=Diamond Chestplate +item.leggingsDiamond.name=Diamond Leggings +item.bootsDiamond.name=Diamond Boots +item.helmetGold.name=Golden Helmet +item.chestplateGold.name=Golden Chestplate +item.leggingsGold.name=Golden Leggings +item.bootsGold.name=Golden Boots +item.flint.name=Flint +item.porkchopRaw.name=Raw Porkchop +item.porkchopCooked.name=Cooked Porkchop +item.chickenRaw.name=Raw Chicken +item.chickenCooked.name=Cooked Chicken +item.beefRaw.name=Raw Beef +item.beefCooked.name=Steak +item.painting.name=Painting +item.frame.name=Item Frame +item.appleGold.name=Golden Apple +item.sign.name=Sign +item.doorWood.name=Wooden Door +item.bucket.name=Bucket +item.bucketWater.name=Water Bucket +item.bucketLava.name=Lava Bucket +item.minecart.name=Minecart +item.saddle.name=Saddle +item.doorIron.name=Iron Door +item.redstone.name=Redstone +item.snowball.name=Snowball +item.boat.name=Boat +item.leather.name=Leather +item.milk.name=Milk +item.brick.name=Brick +item.clay.name=Clay +item.reeds.name=Sugar Canes +item.paper.name=Paper +item.book.name=Book +item.slimeball.name=Slimeball +item.minecartChest.name=Minecart with Chest +item.minecartFurnace.name=Minecart with Furnace +item.minecartTnt.name=Minecart with TNT +item.minecartHopper.name=Minecart with Hopper +item.minecartCommandBlock.name=Minecart with Command Block +item.egg.name=Egg +item.compass.name=Compass +item.fishingRod.name=Fishing Rod +item.clock.name=Clock +item.yellowDust.name=Glowstone Dust +item.fish.cod.raw.name=Raw Fish +item.fish.salmon.raw.name=Raw Salmon +item.fish.pufferfish.raw.name=Pufferfish +item.fish.clownfish.raw.name=Clownfish +item.fish.cod.cooked.name=Cooked Fish +item.fish.salmon.cooked.name=Cooked Salmon +item.record.name=Music Disc +item.record.13.desc=C418 - 13 +item.record.cat.desc=C418 - cat +item.record.blocks.desc=C418 - blocks +item.record.chirp.desc=C418 - chirp +item.record.far.desc=C418 - far +item.record.mall.desc=C418 - mall +item.record.mellohi.desc=C418 - mellohi +item.record.stal.desc=C418 - stal +item.record.strad.desc=C418 - strad +item.record.ward.desc=C418 - ward +item.record.11.desc=C418 - 11 +item.record.wait.desc=C418 - wait +item.bone.name=Bone +item.dyePowder.black.name=Ink Sac +item.dyePowder.red.name=Rose Red +item.dyePowder.green.name=Cactus Green +item.dyePowder.brown.name=Cocoa Beans +item.dyePowder.blue.name=Lapis Lazuli +item.dyePowder.purple.name=Purple Dye +item.dyePowder.cyan.name=Cyan Dye +item.dyePowder.silver.name=Light Gray Dye +item.dyePowder.gray.name=Gray Dye +item.dyePowder.pink.name=Pink Dye +item.dyePowder.lime.name=Lime Dye +item.dyePowder.yellow.name=Dandelion Yellow +item.dyePowder.lightBlue.name=Light Blue Dye +item.dyePowder.magenta.name=Magenta Dye +item.dyePowder.orange.name=Orange Dye +item.dyePowder.white.name=Bone Meal +item.sugar.name=Sugar +item.cake.name=Cake +item.bed.name=Bed +item.diode.name=Redstone Repeater +item.comparator.name=Redstone Comparator +item.map.name=Map +item.leaves.name=Leaves +item.shears.name=Shears +item.rottenFlesh.name=Rotten Flesh +item.enderPearl.name=Ender Pearl +item.blazeRod.name=Blaze Rod +item.ghastTear.name=Ghast Tear +item.netherStalkSeeds.name=Nether Wart +item.potion.name=Potion +item.emptyPotion.name=Water Bottle +item.goldNugget.name=Gold Nugget +item.glassBottle.name=Glass Bottle +item.spiderEye.name=Spider Eye +item.fermentedSpiderEye.name=Fermented Spider Eye +item.blazePowder.name=Blaze Powder +item.magmaCream.name=Magma Cream +item.cauldron.name=Cauldron +item.brewingStand.name=Brewing Stand +item.eyeOfEnder.name=Eye of Ender +item.speckledMelon.name=Glistering Melon +item.monsterPlacer.name=Spawn +item.expBottle.name=Bottle o' Enchanting +item.fireball.name=Fire Charge +item.writingBook.name=Book and Quill +item.writtenBook.name=Written Book +item.ruby.name=Ruby +item.flowerPot.name=Flower Pot +item.emptyMap.name=Empty Map +item.carrots.name=Carrot +item.carrotGolden.name=Golden Carrot +item.potato.name=Potato +item.potatoBaked.name=Baked Potato +item.potatoPoisonous.name=Poisonous Potato +item.skull.skeleton.name=Skeleton Skull +item.skull.wither.name=Wither Skeleton Skull +item.skull.zombie.name=Zombie Head +item.skull.char.name=Head +item.skull.player.name=%s's Head +item.skull.creeper.name=Creeper Head +item.carrotOnAStick.name=Carrot on a Stick +item.netherStar.name=Nether Star +item.pumpkinPie.name=Pumpkin Pie +item.enchantedBook.name=Enchanted Book +item.fireworks.name=Firework Rocket +item.fireworks.flight=Flight Duration: +item.fireworksCharge.name=Firework Star +item.fireworksCharge.black=Black +item.fireworksCharge.red=Red +item.fireworksCharge.green=Green +item.fireworksCharge.brown=Brown +item.fireworksCharge.blue=Blue +item.fireworksCharge.purple=Purple +item.fireworksCharge.cyan=Cyan +item.fireworksCharge.silver=Light Gray +item.fireworksCharge.gray=Gray +item.fireworksCharge.pink=Pink +item.fireworksCharge.lime=Lime +item.fireworksCharge.yellow=Yellow +item.fireworksCharge.lightBlue=Light Blue +item.fireworksCharge.magenta=Magenta +item.fireworksCharge.orange=Orange +item.fireworksCharge.white=White +item.fireworksCharge.customColor=Custom +item.fireworksCharge.fadeTo=Fade to +item.fireworksCharge.flicker=Twinkle +item.fireworksCharge.trail=Trail +item.fireworksCharge.type.0=Small Ball +item.fireworksCharge.type.1=Large Ball +item.fireworksCharge.type.2=Star-shaped +item.fireworksCharge.type.3=Creeper-shaped +item.fireworksCharge.type.4=Burst +item.fireworksCharge.type=Unknown Shape +item.netherbrick.name=Nether Brick +item.netherquartz.name=Nether Quartz +item.horsearmormetal.name=Iron Horse Armor +item.horsearmorgold.name=Gold Horse Armor +item.horsearmordiamond.name=Diamond Horse Armor + +container.inventory=Inventory +container.hopper=Item Hopper +container.crafting=Crafting +container.dispenser=Dispenser +container.dropper=Dropper +container.furnace=Furnace +container.enchant=Enchant +container.repair=Repair & Name +container.repair.cost=Enchantment Cost: %1$d +container.repair.expensive=Too Expensive! +container.creative=Item Selection +container.brewing=Brewing Stand +container.chest=Chest +container.chestDouble=Large Chest +container.minecart=Minecart +container.enderchest=Ender Chest + +item.dyed=Dyed +item.unbreakable=Unbreakable + +entity.Item.name=Item +entity.XPOrb.name=Experience Orb +entity.SmallFireball.name=Small Fireball +entity.Fireball.name=Fireball + +entity.Arrow.name=Arrow +entity.Snowball.name=Snowball +entity.Painting.name=Painting + +entity.Mob.name=Mob +entity.Monster.name=Monster + +entity.Creeper.name=Creeper +entity.Skeleton.name=Skeleton +entity.Spider.name=Spider +entity.Giant.name=Giant +entity.Zombie.name=Zombie +entity.Slime.name=Slime +entity.Ghast.name=Ghast +entity.PigZombie.name=Zombie Pigman +entity.Enderman.name=Enderman +entity.Silverfish.name=Silverfish +entity.CaveSpider.name=Cave Spider +entity.Blaze.name=Blaze +entity.LavaSlime.name=Magma Cube +entity.MushroomCow.name=Mooshroom +entity.Villager.name=Villager +entity.VillagerGolem.name=Iron Golem +entity.SnowMan.name=Snow Golem +entity.EnderDragon.name=Ender Dragon +entity.WitherBoss.name=Wither +entity.Witch.name=Witch + +entity.Pig.name=Pig +entity.Sheep.name=Sheep +entity.Cow.name=Cow +entity.Chicken.name=Chicken +entity.Squid.name=Squid +entity.Wolf.name=Wolf +entity.Ozelot.name=Ocelot +entity.Cat.name=Cat +entity.Bat.name=Bat +entity.EntityHorse.name=Horse +entity.horse.name=Horse +entity.donkey.name=Donkey +entity.mule.name=Mule +entity.skeletonhorse.name=Skeleton Horse +entity.zombiehorse.name=Zombie Horse + +entity.PrimedTnt.name=Block of TNT +entity.FallingSand.name=Falling Block + +entity.Minecart.name=Minecart +entity.Boat.name=Boat + +entity.Arrow.name=arrow +entity.generic.name=unknown + +death.fell.accident.ladder=%1$s fell off a ladder +death.fell.accident.vines=%1$s fell off some vines +death.fell.accident.water=%1$s fell out of the water +death.fell.accident.generic=%1$s fell from a high place +death.fell.killer=%1$s was doomed to fall +death.fell.assist=%1$s was doomed to fall by %2$s +death.fell.assist.item=%1$s was doomed to fall by %2$s using %3$s +death.fell.finish=%1$s fell too far and was finished by %2$s +death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s + +death.attack.inFire=%1$s went up in flames +death.attack.inFire.player=%1$s walked into fire whilst fighting %2$s +death.attack.onFire=%1$s burned to death +death.attack.onFire.player=%1$s was burnt to a crisp whilst fighting %2$s +death.attack.lava=%1$s tried to swim in lava +death.attack.lava.player=%1$s tried to swim in lava to escape %2$s +death.attack.inWall=%1$s suffocated in a wall +death.attack.drown=%1$s drowned +death.attack.drown.player=%1$s drowned whilst trying to escape %2$s +death.attack.starve=%1$s starved to death +death.attack.cactus=%1$s was pricked to death +death.attack.cactus.player=%1$s walked into a cactus whilst trying to escape %2$s +death.attack.generic=%1$s died +death.attack.explosion=%1$s blew up +death.attack.explosion.player=%1$s was blown up by %2$s +death.attack.magic=%1$s was killed by magic +death.attack.wither=%1$s withered away +death.attack.anvil=%1$s was squashed by a falling anvil +death.attack.fallingBlock=%1$s was squashed by a falling block +death.attack.mob=%1$s was slain by %2$s +death.attack.player=%1$s was slain by %2$s +death.attack.player.item=%1$s was slain by %2$s using %3$s +death.attack.arrow=%1$s was shot by %2$s +death.attack.arrow.item=%1$s was shot by %2$s using %3$s +death.attack.fireball=%1$s was fireballed by %2$s +death.attack.fireball.item=%1$s was fireballed by %2$s using %3$s +death.attack.thrown=%1$s was pummeled by %2$s +death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s +death.attack.indirectMagic=%1$s was killed by %2$s using magic +death.attack.indirectMagic.item=%1$s was killed by %2$s using %3$s +death.attack.thorns=%1$s was killed trying to hurt %2$s +death.attack.fall=%1$s hit the ground too hard +death.attack.outOfWorld=%1$s fell out of the world + +deathScreen.respawn=Respawn +deathScreen.deleteWorld=Delete world +deathScreen.titleScreen=Title screen +deathScreen.score=Score +deathScreen.title.hardcore=Game over! +deathScreen.hardcoreInfo=You cannot respawn in hardcore mode! +deathScreen.title=You died! +deathScreen.leaveServer=Leave server +deathScreen.quit.confirm=Are you sure you want to quit? + +potion.effects.whenDrank=When Applied: +potion.empty=No Effects +potion.moveSpeed=Speed +potion.moveSlowdown=Slowness +potion.digSpeed=Haste +potion.digSlowDown=Mining Fatigue +potion.damageBoost=Strength +potion.weakness=Weakness +potion.heal=Instant Health +potion.harm=Instant Damage +potion.jump=Jump Boost +potion.confusion=Nausea +potion.regeneration=Regeneration +potion.resistance=Resistance +potion.fireResistance=Fire Resistance +potion.waterBreathing=Water Breathing +potion.invisibility=Invisibility +potion.blindness=Blindness +potion.nightVision=Night Vision +potion.hunger=Hunger +potion.poison=Poison +potion.wither=Wither +potion.healthBoost=Health Boost +potion.absorption=Absorption +potion.saturation=Saturation + +potion.moveSpeed.postfix=Potion of Swiftness +potion.moveSlowdown.postfix=Potion of Slowness +potion.digSpeed.postfix=Potion of Haste +potion.digSlowDown.postfix=Potion of Dullness +potion.damageBoost.postfix=Potion of Strength +potion.weakness.postfix=Potion of Weakness +potion.heal.postfix=Potion of Healing +potion.harm.postfix=Potion of Harming +potion.jump.postfix=Potion of Leaping +potion.confusion.postfix=Potion of Nausea +potion.regeneration.postfix=Potion of Regeneration +potion.resistance.postfix=Potion of Resistance +potion.fireResistance.postfix=Potion of Fire Resistance +potion.waterBreathing.postfix=Potion of Water Breathing +potion.invisibility.postfix=Potion of Invisibility +potion.blindness.postfix=Potion of Blindness +potion.nightVision.postfix=Potion of Night Vision +potion.hunger.postfix=Potion of Hunger +potion.poison.postfix=Potion of Poison +potion.wither.postfix=Potion of Decay +potion.healthBoost.postfix=Potion of Health Boost +potion.absorption.postfix=Potion of Absorption +potion.saturation.postfix=Potion of Saturation + +potion.potency.0= +potion.potency.1=II +potion.potency.2=III +potion.potency.3=IV + +potion.prefix.grenade=Splash +potion.prefix.mundane=Mundane +potion.prefix.uninteresting=Uninteresting +potion.prefix.bland=Bland +potion.prefix.clear=Clear +potion.prefix.milky=Milky +potion.prefix.diffuse=Diffuse +potion.prefix.artless=Artless +potion.prefix.thin=Thin +potion.prefix.awkward=Awkward +potion.prefix.flat=Flat +potion.prefix.bulky=Bulky +potion.prefix.bungling=Bungling +potion.prefix.buttered=Buttered +potion.prefix.smooth=Smooth +potion.prefix.suave=Suave +potion.prefix.debonair=Debonair +potion.prefix.thick=Thick +potion.prefix.elegant=Elegant +potion.prefix.fancy=Fancy +potion.prefix.charming=Charming +potion.prefix.dashing=Dashing +potion.prefix.refined=Refined +potion.prefix.cordial=Cordial +potion.prefix.sparkling=Sparkling +potion.prefix.potent=Potent +potion.prefix.foul=Foul +potion.prefix.odorless=Odorless +potion.prefix.rank=Rank +potion.prefix.harsh=Harsh +potion.prefix.acrid=Acrid +potion.prefix.gross=Gross +potion.prefix.stinky=Stinky + +enchantment.damage.all=Sharpness +enchantment.damage.undead=Smite +enchantment.damage.arthropods=Bane of Arthropods +enchantment.knockback=Knockback +enchantment.fire=Fire Aspect +enchantment.protect.all=Protection +enchantment.protect.fire=Fire Protection +enchantment.protect.fall=Feather Falling +enchantment.protect.explosion=Blast Protection +enchantment.protect.projectile=Projectile Protection +enchantment.oxygen=Respiration +enchantment.waterWorker=Aqua Affinity +enchantment.digging=Efficiency +enchantment.untouching=Silk Touch +enchantment.durability=Unbreaking +enchantment.lootBonus=Looting +enchantment.lootBonusDigger=Fortune +enchantment.lootBonusFishing=Luck of the Sea +enchantment.fishingSpeed=Lure +enchantment.arrowDamage=Power +enchantment.arrowFire=Flame +enchantment.arrowKnockback=Punch +enchantment.arrowInfinite=Infinity +enchantment.thorns=Thorns + +enchantment.level.1=I +enchantment.level.2=II +enchantment.level.3=III +enchantment.level.4=IV +enchantment.level.5=V +enchantment.level.6=VI +enchantment.level.7=VII +enchantment.level.8=VIII +enchantment.level.9=IX +enchantment.level.10=X + +gui.achievements=Achievements +gui.stats=Statistics + +stats.tooltip.type.achievement=Achievement +stats.tooltip.type.statistic=Statistic +stat.generalButton=General +stat.blocksButton=Blocks +stat.itemsButton=Items +stat.mobsButton=Mobs + +stat.used=Times Used +stat.mined=Times Mined +stat.depleted=Times Depleted +stat.crafted=Times Crafted +stat.entityKills=You killed %d %s +stat.entityKilledBy=%s killed you %d time(s) +stat.entityKills.none=You have never killed %s +stat.entityKilledBy.none=You have never been killed by %s + +stat.startGame=Times played +stat.createWorld=Worlds created +stat.loadWorld=Saves loaded +stat.joinMultiplayer=Multiplayer joins +stat.leaveGame=Games quit + +stat.playOneMinute=Minutes Played + +stat.walkOneCm=Distance Walked +stat.fallOneCm=Distance Fallen +stat.swimOneCm=Distance Swum +stat.flyOneCm=Distance Flown +stat.climbOneCm=Distance Climbed +stat.diveOneCm=Distance Dove +stat.minecartOneCm=Distance by Minecart +stat.boatOneCm=Distance by Boat +stat.pigOneCm=Distance by Pig +stat.horseOneCm=Distance by Horse +stat.jump=Jumps +stat.drop=Items Dropped + +stat.damageDealt=Damage Dealt +stat.damageTaken=Damage Taken +stat.deaths=Number of Deaths +stat.mobKills=Mob Kills +stat.animalsBred=Animals Bred +stat.playerKills=Player Kills +stat.fishCaught=Fish Caught +stat.treasureFished=Treasure Fished +stat.junkFished=Junk Fished + +stat.mineBlock=%1$s Mined +stat.craftItem=%1$s Crafted +stat.useItem=%1$s Used +stat.breakItem=%1$s Depleted + +achievement.get=Achievement get! + +achievement.taken=Taken! +achievement.unknown=??? + +achievement.requires=Requires '%1$s' +achievement.openInventory=Taking Inventory +achievement.openInventory.desc=Press '%1$s' to open your inventory. +achievement.mineWood=Getting Wood +achievement.mineWood.desc=Attack a tree until a block of wood pops out +achievement.buildWorkBench=Benchmarking +achievement.buildWorkBench.desc=Craft a workbench with four blocks of planks +achievement.buildPickaxe=Time to Mine! +achievement.buildPickaxe.desc=Use planks and sticks to make a pickaxe +achievement.buildFurnace=Hot Topic +achievement.buildFurnace.desc=Construct a furnace out of eight stone blocks +achievement.acquireIron=Acquire Hardware +achievement.acquireIron.desc=Smelt an iron ingot +achievement.buildHoe=Time to Farm! +achievement.buildHoe.desc=Use planks and sticks to make a hoe +achievement.makeBread=Bake Bread +achievement.makeBread.desc=Turn wheat into bread +achievement.bakeCake=The Lie +achievement.bakeCake.desc=Wheat, sugar, milk and eggs! +achievement.buildBetterPickaxe=Getting an Upgrade +achievement.buildBetterPickaxe.desc=Construct a better pickaxe +achievement.cookFish=Delicious Fish +achievement.cookFish.desc=Catch and cook fish! +achievement.onARail=On A Rail +achievement.onARail.desc=Travel by minecart at least 1 km from where you started +achievement.buildSword=Time to Strike! +achievement.buildSword.desc=Use planks and sticks to make a sword +achievement.killEnemy=Monster Hunter +achievement.killEnemy.desc=Attack and destroy a monster +achievement.killCow=Cow Tipper +achievement.killCow.desc=Harvest some leather +achievement.breedCow=Repopulation +achievement.breedCow.desc=Breed two cows with wheat +achievement.flyPig=When Pigs Fly +achievement.flyPig.desc=Fly a pig off a cliff +achievement.snipeSkeleton=Sniper Duel +achievement.snipeSkeleton.desc=Kill a skeleton with an arrow from more than 50 meters +achievement.diamonds=DIAMONDS! +achievement.diamonds.desc=Acquire diamonds with your iron tools +achievement.diamondsToYou=Diamonds to you! +achievement.diamondsToYou.desc=Throw diamonds at another player. +achievement.portal=We Need to Go Deeper +achievement.portal.desc=Build a portal to the Nether +achievement.ghast=Return to Sender +achievement.ghast.desc=Destroy a Ghast with a fireball +achievement.blazeRod=Into Fire +achievement.blazeRod.desc=Relieve a Blaze of its rod +achievement.potion=Local Brewery +achievement.potion.desc=Brew a potion +achievement.theEnd=The End? +achievement.theEnd.desc=Locate the End +achievement.theEnd2=The End. +achievement.theEnd2.desc=Defeat the Ender Dragon +achievement.spawnWither=The Beginning? +achievement.spawnWither.desc=Spawn the Wither +achievement.killWither=The Beginning. +achievement.killWither.desc=Kill the Wither +achievement.fullBeacon=Beaconator +achievement.fullBeacon.desc=Create a full beacon +achievement.exploreAllBiomes=Adventuring Time +achievement.exploreAllBiomes.desc=Discover all biomes +achievement.enchantments=Enchanter +achievement.enchantments.desc=Use a book, obsidian and diamonds to construct an enchantment table +achievement.overkill=Overkill +achievement.overkill.desc=Deal eight hearts of damage in a single hit +achievement.bookcase=Librarian +achievement.bookcase.desc=Build some bookshelves to improve your enchantment table + +commands.generic.exception=An unknown error occurred while attempting to perform this command +commands.generic.permission=You do not have permission to use this command +commands.generic.syntax=Invalid command syntax +commands.generic.player.notFound=That player cannot be found +commands.generic.notFound=Unknown command. Try /help for a list of commands +commands.generic.num.invalid='%s' is not a valid number +commands.generic.boolean.invalid='%s' is not true or false +commands.generic.num.tooSmall=The number you have entered (%d) is too small, it must be at least %d +commands.generic.num.tooBig=The number you have entered (%d) is too big, it must be at most %d +commands.generic.double.tooSmall=The number you have entered (%.2f) is too small, it must be at least %.2f +commands.generic.double.tooBig=The number you have entered (%.2f) is too big, it must be at most %.2f +commands.generic.usage=Usage: %s +commands.generic.deprecatedId=Warning: Using numeric IDs will not be supported in the future. Please use names, such as '%s' + +commands.setidletimeout.usage=/setidletimeout +commands.setidletimeout.success=Successfully set the idle timeout to %d minutes. +commands.xp.failure.widthdrawXp=Cannot give player negative experience points +commands.xp.success=Given %d experience to %s +commands.xp.success.levels=Given %d levels to %s +commands.xp.success.negative.levels=Taken %d levels from %s +commands.xp.usage=/xp [player] OR /xp L [player] +commands.playsound.usage=/playsound [x] [y] [z] [volume] [pitch] [minimumVolume] +commands.playsound.success=Played sound '%s' to %s +commands.playsound.playerTooFar=Player %s is too far away to hear the sound +commands.give.usage=/give [amount] [data] [dataTag] +commands.give.notFound=There is no such item with ID %d +commands.give.success=Given %s * %d to %s +commands.give.tagError=Data tag parsing failed: %s +commands.summon.usage=/summon [x] [y] [z] [dataTag] +commands.summon.success=Object successfully summoned +commands.summon.failed=Unable to summon object +commands.summon.tagError=Data tag parsing failed: %s +commands.summon.outOfWorld=Cannot summon the object out of the world +commands.testforblock.usage=/testforblock [dataValue] [dataTag] +commands.testforblock.failed.tile=The block at %d,%d,%d is %s (expected: %s). +commands.testforblock.failed.data=The block at %d,%d,%d had the data value of %s (expected: %s). +commands.testforblock.failed.nbt=The block at %d,%d,%d did not have the required NBT keys. +commands.testforblock.failed.tileEntity=The block at %d,%d,%d is not a tile entity and cannot support tag matching. +commands.testforblock.success=Successfully found the block at %d,%d,%d. +commands.testforblock.outOfWorld=Cannot test for block outside of the world +commands.setblock.usage=/setblock [dataValue] [oldBlockHandling] [dataTag] +commands.setblock.success=Block placed +commands.setblock.failed=Unable to place block +commands.setblock.tagError=Data tag parsing failed: %s +commands.setblock.outOfWorld=Cannot place block outside of the world +commands.setblock.notFound=There is no such block with ID/name %s +commands.setblock.noChange=The block couldn't be placed +commands.effect.usage=/effect [seconds] [amplifier] +commands.effect.notFound=There is no such mob effect with ID %d +commands.effect.success=Given %1$s (ID %2$d) * %3$d to %4$s for %5$d seconds +commands.effect.success.removed=Took %1$s from %2$s +commands.effect.success.removed.all=Took all effects from %s +commands.effect.failure.notActive=Couldn't take %1$s from %2$s as they do not have the effect +commands.effect.failure.notActive.all=Couldn't take any effects from %s as they do not have any +commands.enchant.usage=/enchant [level] +commands.enchant.notFound=There is no such enchantment with ID %d +commands.enchant.noItem=The target doesn't hold an item +commands.enchant.cantEnchant=The selected enchantment can't be added to the target item +commands.enchant.cantCombine=%1$s can't be combined with %2$s +commands.enchant.success=Enchanting succeeded +commands.clear.usage=/clear [item] [data] +commands.clear.success=Cleared the inventory of %s, removing %d items +commands.clear.failure=Could not clear the inventory of %s, no items to remove +commands.downfall.usage=/toggledownfall +commands.downfall.success=Toggled downfall +commands.time.usage=/time +commands.time.added=Added %d to the time +commands.time.set=Set the time to %d +commands.players.usage=/list +commands.players.list=There are %d/%d players online: +commands.banlist.ips=There are %d total banned IP addresses: +commands.banlist.players=There are %d total banned players: +commands.banlist.usage=/banlist [ips|players] +commands.kill.usage=/kill +commands.kill.success=Ouch! That looked like it hurt +commands.kick.success=Kicked %s from the game +commands.kick.success.reason=Kicked %s from the game: '%s' +commands.kick.usage=/kick [reason ...] +commands.op.success=Opped %s +commands.op.failed=Could not op %s +commands.op.usage=/op +commands.deop.success=De-opped %s +commands.deop.failed=Could not de-op %s +commands.deop.usage=/deop +commands.say.usage=/say +commands.ban.success=Banned player %s +commands.ban.failed=Could not ban player %s +commands.ban.usage=/ban [reason ...] +commands.unban.success=Unbanned player %s +commands.unban.failed=Could not unban player %s +commands.unban.usage=/pardon +commands.banip.invalid=You have entered an invalid IP address or a player that is not online +commands.banip.success=Banned IP address %s +commands.banip.success.players=Banned IP address %s belonging to %s +commands.banip.usage=/ban-ip [reason ...] +commands.unbanip.invalid=You have entered an invalid IP address +commands.unbanip.success=Unbanned IP address %s +commands.unbanip.usage=/pardon-ip
+commands.save.usage=/save-all +commands.save-on.alreadyOn=Saving is already turned on. +commands.save-on.usage=/save-on +commands.save-off.alreadyOff=Saving is already turned off. +commands.save-off.usage=/save-off +commands.save.enabled=Turned on world auto-saving +commands.save.disabled=Turned off world auto-saving +commands.save.start=Saving... +commands.save.success=Saved the world +commands.save.failed=Saving failed: %s +commands.stop.usage=/stop +commands.stop.start=Stopping the server +commands.tp.success=Teleported %s to %s +commands.tp.success.coordinates=Teleported %s to %.2f,%.2f,%.2f +commands.tp.usage=/tp [target player] OR /tp [target player] +commands.tp.notSameDimension=Unable to teleport because players are not in the same dimension +commands.whitelist.list=There are %d (out of %d seen) whitelisted players: +commands.whitelist.enabled=Turned on the whitelist +commands.whitelist.disabled=Turned off the whitelist +commands.whitelist.reloaded=Reloaded the whitelist +commands.whitelist.add.success=Added %s to the whitelist +commands.whitelist.add.failed=Could not add %s to the whitelist +commands.whitelist.add.usage=/whitelist add +commands.whitelist.remove.success=Removed %s from the whitelist +commands.whitelist.remove.failed=Could not remove %s from the whitelist +commands.whitelist.remove.usage=/whitelist remove +commands.whitelist.usage=/whitelist +commands.scoreboard.usage=/scoreboard +commands.scoreboard.teamNotFound=No team was found by the name '%s' +commands.scoreboard.objectiveNotFound=No objective was found by the name '%s' +commands.scoreboard.objectiveReadOnly=The objective '%s' is read-only and cannot be set +commands.scoreboard.objectives.usage=/scoreboard objectives +commands.scoreboard.objectives.setdisplay.usage=/scoreboard objectives setdisplay [objective] +commands.scoreboard.objectives.setdisplay.invalidSlot=No such display slot '%s' +commands.scoreboard.objectives.setdisplay.successCleared=Cleared objective display slot '%s' +commands.scoreboard.objectives.setdisplay.successSet=Set the display objective in slot '%s' to '%s' +commands.scoreboard.objectives.add.usage=/scoreboard objectives add [display name ...] +commands.scoreboard.objectives.add.wrongType=Invalid objective criteria type '%s' +commands.scoreboard.objectives.add.alreadyExists=An objective with the name '%s' already exists +commands.scoreboard.objectives.add.tooLong=The name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.displayTooLong=The display name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.success=Added new objective '%s' successfully +commands.scoreboard.objectives.remove.usage=/scoreboard objectives remove +commands.scoreboard.objectives.remove.success=Removed objective '%s' successfully +commands.scoreboard.objectives.list.count=Showing %d objective(s) on scoreboard: +commands.scoreboard.objectives.list.entry=- %s: displays as '%s' and is type '%s' +commands.scoreboard.objectives.list.empty=There are no objectives on the scoreboard +commands.scoreboard.players.usage=/scoreboard players +commands.scoreboard.players.set.success=Set score of %s for player %s to %d +commands.scoreboard.players.set.usage=/scoreboard players set +commands.scoreboard.players.add.usage=/scoreboard players add +commands.scoreboard.players.remove.usage=/scoreboard players remove +commands.scoreboard.players.reset.usage=/scoreboard players reset +commands.scoreboard.players.reset.success=Reset all scores of player %s +commands.scoreboard.players.list.usage=/scoreboard players list [name] +commands.scoreboard.players.list.count=Showing %d tracked players on the scoreboard: +commands.scoreboard.players.list.empty=There are no tracked players on the scoreboard +commands.scoreboard.players.list.player.count=Showing %d tracked objective(s) for %s: +commands.scoreboard.players.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.players.list.player.empty=Player %s has no scores recorded +commands.scoreboard.teams.usage=/scoreboard teams +commands.scoreboard.teams.add.usage=/scoreboard teams add [display name ...] +commands.scoreboard.teams.add.alreadyExists=A team with the name '%s' already exists +commands.scoreboard.teams.add.tooLong=The name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.displayTooLong=The display name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.success=Added new team '%s' successfully +commands.scoreboard.teams.list.usage=/scoreboard teams list [name] +commands.scoreboard.teams.list.count=Showing %d teams on the scoreboard: +commands.scoreboard.teams.list.entry=- %1$s: '%2$s' has %3$d players +commands.scoreboard.teams.list.empty=There are no teams registered on the scoreboard +commands.scoreboard.teams.list.player.count=Showing %d player(s) in team %s: +commands.scoreboard.teams.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.teams.list.player.empty=Team %s has no players +commands.scoreboard.teams.empty.usage=/scoreboard teams empty +commands.scoreboard.teams.empty.alreadyEmpty=Team %s is already empty, cannot remove nonexistant players +commands.scoreboard.teams.empty.success=Removed all %d player(s) from team %s +commands.scoreboard.teams.remove.usage=/scoreboard teams remove +commands.scoreboard.teams.remove.success=Removed team %s +commands.scoreboard.teams.join.usage=/scoreboard teams join [player] +commands.scoreboard.teams.join.success=Added %d player(s) to team %s: %s +commands.scoreboard.teams.join.failure=Could not add %d player(s) to team %s: %s +commands.scoreboard.teams.leave.usage=/scoreboard teams leave [player] +commands.scoreboard.teams.leave.success=Removed %d player(s) from their teams: %s +commands.scoreboard.teams.leave.failure=Could not remove %d player(s) from their teams: %s +commands.scoreboard.teams.leave.noTeam=You are not in a team +commands.scoreboard.teams.option.usage=/scoreboard teams option +commands.scoreboard.teams.option.noValue=Valid values for option %s are: %s +commands.scoreboard.teams.option.success=Set option %s for team %s to %s +commands.gamemode.success.self=Set own game mode to %s +commands.gamemode.success.other=Set %s's game mode to %s +commands.gamemode.usage=/gamemode [player] +commands.defaultgamemode.usage=/defaultgamemode +commands.defaultgamemode.success=The world's default game mode is now %s +commands.me.usage=/me +commands.help.header=--- Showing help page %d of %d (/help ) --- +commands.help.footer=Tip: Use the key while typing a command to auto-complete the command or its arguments +commands.help.usage=/help [page|command name] +commands.publish.usage=/publish +commands.publish.started=Local game hosted on port %s +commands.publish.failed=Unable to host local game +commands.debug.start=Started debug profiling +commands.debug.stop=Stopped debug profiling after %.2f seconds (%d ticks) +commands.debug.notStarted=Can't stop profiling when we haven't started yet! +commands.debug.usage=/debug +commands.tellraw.usage=/tellraw +commands.tellraw.jsonException=Invalid json: %s +commands.message.usage=/tell +commands.message.sameTarget=You can't send a private message to yourself! +commands.message.display.outgoing=You whisper to %s: %s +commands.message.display.incoming=%s whispers to you: %s +commands.difficulty.usage=/difficulty +commands.difficulty.success=Set game difficulty to %s +commands.spawnpoint.usage=/spawnpoint OR /spawnpoint OR /spawnpoint +commands.spawnpoint.success=Set %s's spawn point to (%d, %d, %d) +commands.setworldspawn.usage=/setworldspawn OR /setworldspawn +commands.setworldspawn.success=Set the world spawn point to (%d, %d, %d) +commands.gamerule.usage=/gamerule OR /gamerule +commands.gamerule.success=Game rule has been updated +commands.gamerule.norule=No game rule called '%s' is available +commands.weather.usage=/weather [duration in seconds] +commands.weather.clear=Changing to clear weather +commands.weather.rain=Changing to rainy weather +commands.weather.thunder=Changing to rain and thunder +commands.testfor.usage=/testfor +commands.testfor.failed=/testfor is only usable by commandblocks with analog output +commands.seed.usage=/seed +commands.seed.success=Seed: %s +commands.spreadplayers.usage=/spreadplayers +commands.spreadplayers.spreading.teams=Spreading %s teams %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.spreading.players=Spreading %s players %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.success.teams=Successfully spread %s teams around %s,%s +commands.spreadplayers.success.players=Successfully spread %s players around %s,%s +commands.spreadplayers.info.teams=(Average distance between teams is %s blocks apart after %s iterations) +commands.spreadplayers.info.players=(Average distance between players is %s blocks apart after %s iterations) +commands.spreadplayers.failure.teams=Could not spread %s teams around %s,%s (too many players for space - try using spread of at most %s) +commands.spreadplayers.failure.players=Could not spread %s players around %s,%s (too many players for space - try using spread of at most %s) +commands.achievement.usage=/achievement give [player] +commands.achievement.unknownAchievement=Unknown achievement or statistic '%s' +commands.achievement.give.success.all=Successfully given all achievements to %s +commands.achievement.give.success.one=Successfully given %s the stat %s +commands.achievement.statTooLow=Player %s does not have the stat %s + +itemGroup.buildingBlocks=Building Blocks +itemGroup.decorations=Decoration Blocks +itemGroup.redstone=Redstone +itemGroup.transportation=Transportation +itemGroup.misc=Miscellaneous +itemGroup.search=Search Items +itemGroup.food=Foodstuffs +itemGroup.tools=Tools +itemGroup.combat=Combat +itemGroup.brewing=Brewing +itemGroup.materials=Materials +itemGroup.inventory=Survival Inventory + +inventory.binSlot=Destroy Item + +advMode.setCommand=Set Console Command for Block +advMode.setCommand.success=Command set: %s +advMode.command=Console Command +advMode.nearestPlayer=Use "@p" to target nearest player +advMode.randomPlayer=Use "@r" to target random player +advMode.allPlayers=Use "@a" to target all players +advMode.previousOutput=Previous Output + +advMode.notEnabled=Command blocks are not enabled on this server +advMode.notAllowed=Must be an opped player in creative mode + +mount.onboard=Press %1$s to dismount + +build.tooHigh=Height limit for building is %s blocks + +attribute.modifier.plus.0=+%d %s +attribute.modifier.plus.1=+%d%% %s +attribute.modifier.plus.2=+%d%% %s +attribute.modifier.take.0=-%d %s +attribute.modifier.take.1=-%d%% %s +attribute.modifier.take.2=-%d%% %s + +attribute.name.horse.jumpStrength=Horse Jump Strength +attribute.name.zombie.spawnReinforcements=Zombie Reinforcements +attribute.name.generic.maxHealth=Max Health +attribute.name.generic.followRange=Mob Follow Range +attribute.name.generic.knockbackResistance=Knockback Resistance +attribute.name.generic.movementSpeed=Speed +attribute.name.generic.attackDamage=Attack Damage + +screenshot.success=Saved screenshot as %s +screenshot.failure=Couldn't save screenshot: %s + +stream.user.mode.moderator=Moderator +stream.user.mode.moderator.self=Moderator on your channel +stream.user.mode.moderator.other=Moderator on %s's channel +stream.user.mode.broadcaster=Broadcaster +stream.user.mode.broadcaster.self=Broadcaster (You!) +stream.user.mode.broadcaster.other=Broadcaster +stream.user.mode.administrator=Twitch Administrator +stream.user.mode.staff=Twitch Staff +stream.user.mode.banned=Banned +stream.user.mode.banned.self=Banned on your channel +stream.user.mode.banned.other=Banned on %s's channel +stream.user.subscription.subscriber=Subscriber +stream.user.subscription.subscriber.self=Subscriber to your channel +stream.user.subscription.subscriber.other=Subscriber to %s's channel +stream.user.subscription.turbo=Twitch Turbo + +stream.unavailable.title=Twitch Broadcasting Unavailable +stream.unavailable.report_to_mojang=Report to Mojang + +stream.confirm_start=Are you sure you want to start broadcasting? + +stream.unavailable.account_not_bound=Before you can broadcast Minecraft through Twitch, you will need to link your Twitch account on mojang.com. Would you like to do that now? +stream.unavailable.account_not_bound.okay=Link Accounts +stream.unavailable.account_not_migrated=Before you can broadcast Minecraft through Twitch, you will need to migrate your Minecraft account to a Mojang account. Would you like to do that now? +stream.unavailable.account_not_migrated.okay=Migrate Account +stream.unavailable.failed_auth=Authentication to Twitch failed. Please go to mojang.com and rebind your Twitch account. +stream.unavailable.failed_auth.okay=Rebind Accounts +stream.unavailable.failed_auth_error=Unable to authenticate to Twitch. Please try again later. +stream.unavailable.initialization_failure=Unable to initialize the Twitch SDK. +stream.unavailable.initialization_failure.extra=(Reason: %s) +stream.unavailable.library_arch_mismatch=The custom java version used to launch Minecraft has a different architecture than the one used to run the launcher. Please make sure these are the same, either 32-bit or 64-bit for both. +stream.unavailable.library_failure=Unable to load the libraries needed for the integrated Twitch broadcasting service. +stream.unavailable.no_fbo=Your video card needs to support at least OpenGL version 3.0 or support Framebuffer Objects via an extension to use the integrated Twitch broadcasting. +stream.unavailable.no_fbo.version=You are currently using: %s +stream.unavailable.no_fbo.blend=Separate blending support via EXT is: %s +stream.unavailable.no_fbo.arb=Framebuffer object support via ARB is: %s +stream.unavailable.no_fbo.ext=Framebuffer object support via EXT is: %s +stream.unavailable.not_supported.windows=Unfortunately the integrated Twitch broadcasting requires a newer version of Windows than you are on. You must have at least Windows Vista or newer. +stream.unavailable.not_supported.mac=Unfortunately the integrated Twitch broadcasting on Mac requires a version of OSX newer than the one you are on. You must use 10.7 (Mac OS X Lion) or newer to be able to use this service. Would you like to visit apple.com to learn about upgrading? +stream.unavailable.not_supported.mac.okay=Upgrade +stream.unavailable.not_supported.other=Unfortunately the integrated Twitch broadcasting service requires Windows (Vista or newer) or Mac OS X (10.7/Lion or newer) +stream.unavailable.unknown=Unfortunately you cannot broadcast to Twitch at this time. And we don't know why :'( +stream.unavailable.unknown.chat=Could not start stream: %s + +stream.unavailable.soundflower.chat=Soundflower is required to be able to stream on Mac. %s +stream.unavailable.soundflower.chat.link=Please click here to install it. + +stream.userinfo.chatTooltip=Click to manage user +stream.userinfo.timeout=Timeout +stream.userinfo.ban=Ban +stream.userinfo.unban=Unban +stream.userinfo.mod=Promote to Moderator +stream.userinfo.unmod=Demote from Moderator diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/antialias.json b/build/resources/patchedMc/assets/minecraft/shaders/post/antialias.json new file mode 100644 index 0000000..bc31af3 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/antialias.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "antialias", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/art.json b/build/resources/patchedMc/assets/minecraft/shaders/post/art.json new file mode 100644 index 0000000..6d6c7ec --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/art.json @@ -0,0 +1,64 @@ +{ + "targets": [ + "0", + "1" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "0" + }, + { + "name": "outline_watercolor", + "intarget": "0", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "1", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.8, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "1", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 0.8 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "outline_combine", + "intarget": "0", + "outtarget": "1", + "auxtargets": [ + { + "name": "OutlineSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "blit", + "intarget": "1", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/bits.json b/build/resources/patchedMc/assets/minecraft/shaders/post/bits.json new file mode 100644 index 0000000..7236746 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/bits.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bits", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/blobs.json b/build/resources/patchedMc/assets/minecraft/shaders/post/blobs.json new file mode 100644 index 0000000..d6260aa --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/blobs.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/blobs2.json b/build/resources/patchedMc/assets/minecraft/shaders/post/blobs2.json new file mode 100644 index 0000000..3464ae3 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/blobs2.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/blur.json b/build/resources/patchedMc/assets/minecraft/shaders/post/blur.json new file mode 100644 index 0000000..bca04d5 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/blur.json @@ -0,0 +1,37 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/bumpy.json b/build/resources/patchedMc/assets/minecraft/shaders/post/bumpy.json new file mode 100644 index 0000000..0870985 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/bumpy.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bumpy", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/color_convolve.json b/build/resources/patchedMc/assets/minecraft/shaders/post/color_convolve.json new file mode 100644 index 0000000..9f00212 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/color_convolve.json @@ -0,0 +1,20 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { "name": "Saturation", "values": [ 1.4 ] } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/deconverge.json b/build/resources/patchedMc/assets/minecraft/shaders/post/deconverge.json new file mode 100644 index 0000000..4eb2b8d --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/deconverge.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "deconverge", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/desaturate.json b/build/resources/patchedMc/assets/minecraft/shaders/post/desaturate.json new file mode 100644 index 0000000..675018f --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/desaturate.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "Saturation", + "values": [ 0.2 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/flip.json b/build/resources/patchedMc/assets/minecraft/shaders/post/flip.json new file mode 100644 index 0000000..e382435 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/flip.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "flip", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/fxaa.json b/build/resources/patchedMc/assets/minecraft/shaders/post/fxaa.json new file mode 100644 index 0000000..83292b7 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/fxaa.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/green.json b/build/resources/patchedMc/assets/minecraft/shaders/post/green.json new file mode 100644 index 0000000..5d0af6c --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/green.json @@ -0,0 +1,41 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "RedMatrix", + "values": [ 0.0, 0.0, 0.0 ] + }, + { + "name": "GreenMatrix", + "values": [ 0.3, 0.59, 0.11 ] + }, + { + "name": "BlueMatrix", + "values": [ 0.0, 0.0, 0.0 ] + } + ] + }, + { + "name": "bits", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/invert.json b/build/resources/patchedMc/assets/minecraft/shaders/post/invert.json new file mode 100644 index 0000000..2ab63fb --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/invert.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "invert", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "InverseAmount", + "values": [ 0.8 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/notch.json b/build/resources/patchedMc/assets/minecraft/shaders/post/notch.json new file mode 100644 index 0000000..164943c --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/notch.json @@ -0,0 +1,26 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "notch", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "DitherSampler", + "id": "dither", + "width": 4, + "height": 4, + "bilinear": false + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/ntsc.json b/build/resources/patchedMc/assets/minecraft/shaders/post/ntsc.json new file mode 100644 index 0000000..abc005b --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/ntsc.json @@ -0,0 +1,92 @@ +{ + "targets": [ + "swap", + "swap2", + "previous" + ], + "passes": [ + { + "name": "ntsc_encode", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "ntsc_decode", + "intarget": "swap", + "outtarget": "swap2", + "auxtargets": [ + { + "name": "BaseSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "color_convolve", + "intarget": "swap2", + "outtarget": "swap" + }, + { + "name": "deconverge", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "phosphor", + "intarget": "swap", + "outtarget": "minecraft:main", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.4, 0.4, 0.4 ] + } + ] + }, + { + "name": "blit", + "intarget": "minecraft:main", + "outtarget": "previous" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/outline.json b/build/resources/patchedMc/assets/minecraft/shaders/post/outline.json new file mode 100644 index 0000000..e299c0f --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/outline.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "outline", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/pencil.json b/build/resources/patchedMc/assets/minecraft/shaders/post/pencil.json new file mode 100644 index 0000000..1fc5b13 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/pencil.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "outline_soft", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/phosphor.json b/build/resources/patchedMc/assets/minecraft/shaders/post/phosphor.json new file mode 100644 index 0000000..0fa09c4 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/phosphor.json @@ -0,0 +1,35 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ + { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.95, 0.95, 0.95 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/scan_pincushion.json b/build/resources/patchedMc/assets/minecraft/shaders/post/scan_pincushion.json new file mode 100644 index 0000000..b5d0a3e --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/scan_pincushion.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/sobel.json b/build/resources/patchedMc/assets/minecraft/shaders/post/sobel.json new file mode 100644 index 0000000..5c390a4 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/sobel.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "sobel", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/post/wobble.json b/build/resources/patchedMc/assets/minecraft/shaders/post/wobble.json new file mode 100644 index 0000000..1fc4534 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/post/wobble.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "wobble", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.fsh new file mode 100644 index 0000000..44b4141 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D (DiffuseSampler, texCoord); + vec4 u1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y )); + vec4 u2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y * 2.0)); + vec4 d1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y )); + vec4 d2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y * 2.0)); + vec4 l1 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x, 0.0)); + vec4 l2 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x * 2.0, 0.0)); + vec4 r1 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x, 0.0)); + vec4 r2 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x * 2.0, 0.0)); + + vec4 v1 = mix (c, mix (l1, l2, 0.667), 0.75); + vec4 v2 = mix (c, mix (r1, r2, 0.667), 0.75); + vec4 v3 = mix (c, mix (u1, u2, 0.667), 0.75); + vec4 v4 = mix (c, mix (d1, d2, 0.667), 0.75); + + vec4 v5 = mix (v1, v2, 0.5); + vec4 v6 = mix (v3, v4, 0.5); + + vec4 color = mix (v5, v6, 0.5); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.json b/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.json new file mode 100644 index 0000000..6916fd9 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/antialias.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "antialias", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bits.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/bits.fsh new file mode 100644 index 0000000..96ef3cb --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bits.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Resolution = 4.0; +uniform float Saturation = 1.5; +uniform float MosaicSize = 8.0; + +void main() { + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + + baseTexel = baseTexel - fract(baseTexel * Resolution) / Resolution; + float luma = dot(baseTexel.rgb, vec3(0.3, 0.59, 0.11)); + vec3 chroma = (baseTexel.rgb - luma) * Saturation; + baseTexel = vec4(luma + chroma, baseTexel.a); + + gl_FragColor = baseTexel; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bits.json b/build/resources/patchedMc/assets/minecraft/shaders/program/bits.json new file mode 100644 index 0000000..c19239b --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bits.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "bits", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Resolution", "type": "float", "count": 1, "values": [ 4.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.5 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 8.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blit.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.fsh new file mode 100644 index 0000000..a0d5e79 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.fsh @@ -0,0 +1,9 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +void main(){ + gl_FragColor = texture2D(DiffuseSampler, texCoord); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blit.json b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.json new file mode 100644 index 0000000..a61043e --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.json @@ -0,0 +1,17 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blit.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.vsh new file mode 100644 index 0000000..01a16db --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blit.vsh @@ -0,0 +1,16 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.fsh new file mode 100644 index 0000000..82a1cc7 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.fsh @@ -0,0 +1,43 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 v1 = min(l, r); + vec4 v2 = min(u, d); + vec4 v3 = min(v1, v2); + + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 dr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 dl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + + vec4 v4 = min(ul, dr); + vec4 v5 = min(ur, dl); + vec4 v6 = min(v4, v5); + + vec4 v7 = min(v3, v6); + + vec4 uu = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y * 2.0)); + vec4 dd = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y * 2.0)); + vec4 ll = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x * 2.0, 0.0)); + vec4 rr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x * 2.0, 0.0)); + + vec4 v8 = min(uu, dd); + vec4 v9 = min(ll, rr); + vec4 v10 = min(v8, v9); + + vec4 v11 = min(v7, v10); + + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 color = min(c, v11); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.json b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.json new file mode 100644 index 0000000..6a5f245 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.fsh new file mode 100644 index 0000000..1fb217d --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.fsh @@ -0,0 +1,30 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float Radius; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 maxVal = c; + for(float u = 0.0; u <= Radius; u += 1.0) { + for(float v = 0.0; v <= Radius; v += 1.0) { + float weight = (((sqrt(u * u + v * v) / (Radius)) > 1.0) ? 0.0 : 1.0); + + vec4 s0 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, -v * oneTexel.y)); + vec4 s1 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, v * oneTexel.y)); + vec4 s2 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, v * oneTexel.y)); + vec4 s3 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, -v * oneTexel.y)); + + vec4 o0 = max(s0, s1); + vec4 o1 = max(s2, s3); + vec4 tempMax = max(o0, o1); + maxVal = mix(maxVal, max(maxVal, tempMax), weight); + } + } + + gl_FragColor = vec4(maxVal.rgb, c.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.json b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.json new file mode 100644 index 0000000..6df4594 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blobs2.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs2", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 7.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bloom.json b/build/resources/patchedMc/assets/minecraft/shaders/program/bloom.json new file mode 100644 index 0000000..4dd764f --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bloom.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "CycleSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blur.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/blur.fsh new file mode 100644 index 0000000..1178391 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blur.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + for(float r = -Radius; r <= Radius; r += 1.0) { + float strength = abs(1.0 - r / Radius); + strength = strength * strength; + totalStrength = totalStrength + strength; + blurred = blurred + texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir) * strength; + } + gl_FragColor = vec4(blurred.rgb / totalStrength, texture2D(DiffuseSampler, texCoord).a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/blur.json b/build/resources/patchedMc/assets/minecraft/shaders/program/blur.json new file mode 100644 index 0000000..51a2323 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/blur.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "blur", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.fsh new file mode 100644 index 0000000..56fd5a9 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.fsh @@ -0,0 +1,34 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 nc = normalize(c); + vec4 nu = normalize(u); + vec4 nd = normalize(d); + vec4 nl = normalize(l); + vec4 nr = normalize(r); + + float du = dot(nc, nu); + float dd = dot(nc, nd); + float dl = dot(nc, nl); + float dr = dot(nc, nr); + + float i = 64.0; + + float f = 1.0; + f += (du * i) - (dd * i); + f += (dr * i) - (dl * i); + + vec4 color = c * clamp(f, 0.5, 2); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.json b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.json new file mode 100644 index 0000000..59cae19 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "bumpy", + "fragment": "bumpy", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/bumpy.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.fsh new file mode 100644 index 0000000..bfc3de5 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.fsh @@ -0,0 +1,36 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Gray = vec3(0.3, 0.59, 0.11); +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); +uniform vec3 Offset = vec3(0.0, 0.0, 0.0); +uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0); +uniform float Saturation = 1.8; + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + // Color Matrix + float RedValue = dot(InTexel.rgb, RedMatrix); + float GreenValue = dot(InTexel.rgb, GreenMatrix); + float BlueValue = dot(InTexel.rgb, BlueMatrix); + vec3 OutColor = vec3(RedValue, GreenValue, BlueValue); + + // Offset & Scale + OutColor = (OutColor * ColorScale) + Offset; + + // Saturation + float Luma = dot(OutColor, Gray); + vec3 Chroma = OutColor - Luma; + OutColor = (Chroma * Saturation) + Luma; + + gl_FragColor = vec4(OutColor, InTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.json b/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.json new file mode 100644 index 0000000..e3a32c2 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/color_convolve.json @@ -0,0 +1,25 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "color_convolve", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Gray", "type": "float", "count": 3, "values": [ 0.3, 0.59, 0.11 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 0.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] }, + { "name": "Offset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] }, + { "name": "ColorScale", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.8 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.fsh new file mode 100644 index 0000000..6b5a207 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.fsh @@ -0,0 +1,28 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 ConvergeX = vec3(-1.0, 0.0, 0.5); +uniform vec3 ConvergeY = vec3( 0.0, -1.0, 0.5); +uniform vec3 RadialConvergeX = vec3(1.0, 1.0, 1.0); +uniform vec3 RadialConvergeY = vec3(1.0, 1.0, 1.0); + +void main() { + vec3 CoordX = texCoord.x * RadialConvergeX; + vec3 CoordY = texCoord.y * RadialConvergeY; + + CoordX += ConvergeX * oneTexel.x - (RadialConvergeX - 1.0) * 0.5; + CoordY += ConvergeY * oneTexel.y - (RadialConvergeY - 1.0) * 0.5; + + float RedValue = texture2D(DiffuseSampler, vec2(CoordX.x, CoordY.x)).r; + float GreenValue = texture2D(DiffuseSampler, vec2(CoordX.y, CoordY.y)).g; + float BlueValue = texture2D(DiffuseSampler, vec2(CoordX.z, CoordY.z)).b; + float AlphaValue = texture2D(DiffuseSampler, texCoord).a; + + gl_FragColor = vec4(RedValue, GreenValue, BlueValue, AlphaValue); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.json b/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.json new file mode 100644 index 0000000..e23e9c5 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/deconverge.json @@ -0,0 +1,22 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "deconverge", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ConvergeX", "type": "float", "count": 3, "values": [ -4.0, 0.0, 2.0 ] }, + { "name": "ConvergeY", "type": "float", "count": 3, "values": [ 0.0, -4.0, 2.0 ] }, + { "name": "RadialConvergeX", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "RadialConvergeY", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.fsh new file mode 100644 index 0000000..5502444 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.fsh @@ -0,0 +1,17 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +void main() { + vec3 Texel0 = texture2D(DiffuseSampler, texCoord).rgb; + vec3 Texel1 = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)).rgb; + vec3 Texel2 = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)).rgb; + vec3 Texel3 = texture2D(DiffuseSampler, texCoord + oneTexel).rgb; + + gl_FragColor = vec4((Texel0 + Texel1 + Texel2 + Texel3) * 0.25, Texel0.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.json b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.json new file mode 100644 index 0000000..9099ec1 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "downscale", + "fragment": "downscale", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.vsh new file mode 100644 index 0000000..ec09759 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/downscale.vsh @@ -0,0 +1,19 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/flip.json b/build/resources/patchedMc/assets/minecraft/shaders/program/flip.json new file mode 100644 index 0000000..de87ed0 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/flip.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "flip", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ScreenSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/flip.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/flip.vsh new file mode 100644 index 0000000..bd0a4d3 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/flip.vsh @@ -0,0 +1,22 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; +uniform vec2 ScreenSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 inOutRatio = OutSize / InSize; + vec2 inScreenRatio = ScreenSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * inOutRatio.x; + texCoord.y = texCoord.y * inOutRatio.y; + texCoord.y -= 1.0 - inScreenRatio.y; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.fsh new file mode 100644 index 0000000..6fd9f80 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.fsh @@ -0,0 +1,84 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. +{ + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max( + (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), + FXAA_REDUCE_MIN); + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2( SpanMax, SpanMax), + max(vec2(-SpanMax, -SpanMax), + dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) { + return rgbA; + } else { + return rgbB; + } +} + +void main() { + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), baseTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.json b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.json new file mode 100644 index 0000000..eb85073 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa", + "fragment": "fxaa", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, + { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, + { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.vsh new file mode 100644 index 0000000..9fe81ea --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/fxaa.vsh @@ -0,0 +1,21 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() { + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + posPos.xy = texCoord.xy; + posPos.zw = texCoord.xy - (1.0/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/invert.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.fsh new file mode 100644 index 0000000..ab2b43b --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.fsh @@ -0,0 +1,14 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +uniform float InverseAmount; + +void main(){ + vec4 diffuseColor = texture2D(DiffuseSampler, texCoord); + vec4 invertColor = 1.0 - diffuseColor; + vec4 outColor = mix(diffuseColor, invertColor, InverseAmount); + gl_FragColor = vec4(outColor.rgb, diffuseColor.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/invert.json b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.json new file mode 100644 index 0000000..f9ab649 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "invert", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "InverseAmount", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/invert.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.vsh new file mode 100644 index 0000000..5110ef5 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/invert.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 sizeRatio = OutSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * sizeRatio.x; + texCoord.y = texCoord.y * sizeRatio.y; + texCoord.y = sizeRatio.y - texCoord.y; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/notch.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/notch.fsh new file mode 100644 index 0000000..a732194 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/notch.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DitherSampler; + +varying vec2 texCoord; + +uniform vec2 InSize; + +void main() { + vec2 halfSize = InSize * 0.5; + + vec2 steppedCoord = texCoord; + steppedCoord.x = float(int(steppedCoord.x*halfSize.x)) / halfSize.x; + steppedCoord.y = float(int(steppedCoord.y*halfSize.y)) / halfSize.y; + + vec4 noise = texture2D(DitherSampler, steppedCoord * halfSize / 4.0); + vec4 col = texture2D(DiffuseSampler, steppedCoord) + noise * vec4(1.0/12.0, 1.0/12.0, 1.0/6.0, 1.0); + float r = float(int(col.r*8.0))/8.0; + float g = float(int(col.g*8.0))/8.0; + float b = float(int(col.b*4.0))/4.0; + gl_FragColor = vec4(r, g, b, col.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/notch.json b/build/resources/patchedMc/assets/minecraft/shaders/program/notch.json new file mode 100644 index 0000000..e6ff9a8 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/notch.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "notch", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DitherSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.fsh new file mode 100644 index 0000000..57d3dd5 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.fsh @@ -0,0 +1,132 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D BaseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 One = vec4(1.0); + +const float Pi = 3.1415926535; +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float NotchWidth = 2.0; +const float NotchUpperFrequency = 3.59754545 + NotchWidth; +const float NotchLowerFrequency = 3.59754545 - NotchWidth; +const float YFrequency = 6.0; +const float IFrequency = 1.2; +const float QFrequency = 0.6; +const float ScanTime = 52.6; +const vec3 YIQ2R = vec3(1.0, 0.956, 0.621); +const vec3 YIQ2G = vec3(1.0, -0.272, -0.647); +const vec3 YIQ2B = vec3(1.0, -1.106, 1.703); +const vec4 MinC = vec4(-1.1183); +const vec4 CRange = vec4(3.2366); +const float Pi2Length = Pi2 / 83.0; +const vec4 NotchOffset = vec4(0.0, 1.0, 2.0, 3.0); +const vec4 W = vec4(Pi2 * CCFrequency * ScanTime); + +void main() { + vec4 YAccum = Zero; + vec4 IAccum = Zero; + vec4 QAccum = Zero; + float QuadXSize = InSize.x * 4.0; + float TimePerSample = ScanTime / QuadXSize; + + // Frequency cutoffs for the individual portions of the signal that we extract. + // Y1 and Y2 are the positive and negative frequency limits of the notch filter on Y. + // Y3 is the center of the frequency response of the Y filter. + // I is the center of the frequency response of the I filter. + // Q is the center of the frequency response of the Q filter. + float Fc_y1 = NotchLowerFrequency * TimePerSample; + float Fc_y2 = NotchUpperFrequency * TimePerSample; + float Fc_y3 = YFrequency * TimePerSample; + float Fc_i = IFrequency * TimePerSample; + float Fc_q = QFrequency * TimePerSample; + float Pi2Fc_y1 = Fc_y1 * Pi2; + float Pi2Fc_y2 = Fc_y2 * Pi2; + float Pi2Fc_y3 = Fc_y3 * Pi2; + float Pi2Fc_i = Fc_i * Pi2; + float Pi2Fc_q = Fc_q * Pi2; + float Fc_y1_2 = Fc_y1 * 2.0; + float Fc_y2_2 = Fc_y2 * 2.0; + float Fc_y3_2 = Fc_y3 * 2.0; + float Fc_i_2 = Fc_i * 2.0; + float Fc_q_2 = Fc_q * 2.0; + vec4 CoordY = vec4(texCoord.y); + + vec4 BaseTexel = texture2D(DiffuseSampler, texCoord); + // 83 composite samples wide, 4 composite pixels per texel + for (float n = -41.0; n < 42.0; n += 4.0) + { + vec4 n4 = n + NotchOffset; + vec4 CoordX = texCoord.x + oneTexel.x * n4 * 0.25; + vec2 TexCoord = vec2(CoordX.x, CoordY.y); + vec4 C = texture2D(DiffuseSampler, TexCoord) * CRange + MinC; + vec4 WT = W * (CoordX + A2 * CoordY * InSize.y + B); + vec4 Cosine = 0.54 + 0.46 * cos(Pi2Length * n4); + + vec4 SincYIn1 = Pi2Fc_y1 * n4; + vec4 SincYIn2 = Pi2Fc_y2 * n4; + vec4 SincYIn3 = Pi2Fc_y3 * n4; + vec4 SincY1 = sin(SincYIn1) / SincYIn1; + vec4 SincY2 = sin(SincYIn2) / SincYIn2; + vec4 SincY3 = sin(SincYIn3) / SincYIn3; + + // These zero-checks could be made more efficient, but we are trying to support + // downlevel GLSL + if(SincYIn1.x == 0.0) SincY1.x = 1.0; + if(SincYIn1.y == 0.0) SincY1.y = 1.0; + if(SincYIn1.z == 0.0) SincY1.z = 1.0; + if(SincYIn1.w == 0.0) SincY1.w = 1.0; + if(SincYIn2.x == 0.0) SincY2.x = 1.0; + if(SincYIn2.y == 0.0) SincY2.y = 1.0; + if(SincYIn2.z == 0.0) SincY2.z = 1.0; + if(SincYIn2.w == 0.0) SincY2.w = 1.0; + if(SincYIn3.x == 0.0) SincY3.x = 1.0; + if(SincYIn3.y == 0.0) SincY3.y = 1.0; + if(SincYIn3.z == 0.0) SincY3.z = 1.0; + if(SincYIn3.w == 0.0) SincY3.w = 1.0; + vec4 IdealY = (Fc_y1_2 * SincY1 - Fc_y2_2 * SincY2) + Fc_y3_2 * SincY3; + vec4 FilterY = Cosine * IdealY; + + vec4 SincIIn = Pi2Fc_i * n4; + vec4 SincI = sin(SincIIn) / SincIIn; + if(SincIIn.x == 0.0) SincI.x = 1.0; + if(SincIIn.y == 0.0) SincI.y = 1.0; + if(SincIIn.z == 0.0) SincI.z = 1.0; + if(SincIIn.w == 0.0) SincI.w = 1.0; + vec4 IdealI = Fc_i_2 * SincI; + vec4 FilterI = Cosine * IdealI; + + vec4 SincQIn = Pi2Fc_q * n4; + vec4 SincQ = sin(SincQIn) / SincQIn; + if(SincQIn.x == 0.0) SincQ.x = 1.0; + if(SincQIn.y == 0.0) SincQ.y = 1.0; + if(SincQIn.z == 0.0) SincQ.z = 1.0; + if(SincQIn.w == 0.0) SincQ.w = 1.0; + vec4 IdealQ = Fc_q_2 * SincQ; + vec4 FilterQ = Cosine * IdealQ; + + YAccum += C * FilterY; + IAccum += C * cos(WT) * FilterI; + QAccum += C * sin(WT) * FilterQ; + } + + float Y = dot(YAccum, One); + float I = dot(IAccum, One) * 2.0; + float Q = dot(QAccum, One) * 2.0; + + vec3 YIQ = vec3(Y, I, Q); + vec3 OutRGB = vec3(dot(YIQ, YIQ2R), dot(YIQ, YIQ2G), dot(YIQ, YIQ2B)); + + gl_FragColor = vec4(OutRGB, BaseTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.json b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.json new file mode 100644 index 0000000..2870923 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_decode.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_decode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "BaseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.fsh new file mode 100644 index 0000000..450bc6d --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.fsh @@ -0,0 +1,50 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float ScanTime = 52.6; +const float Pi2ScanTime = Pi2 * ScanTime; +const vec4 YTransform = vec4(0.299, 0.587, 0.114, 0.0); +const vec4 ITransform = vec4(0.595716, -0.274453, -0.321263, 0.0); +const vec4 QTransform = vec4(0.211456, -0.522591, 0.31135, 0.0); +const vec4 MinC = vec4(-1.1183); +const vec4 InvCRange = vec4(1.0 / 3.2366); + +void main() { + vec2 InverseP = vec2(P, 0.0) * oneTexel; + + // UVs for four linearly-interpolated samples spread 0.25 texels apart + vec2 C0 = texCoord; + vec2 C1 = texCoord + InverseP * 0.25; + vec2 C2 = texCoord + InverseP * 0.50; + vec2 C3 = texCoord + InverseP * 0.75; + vec4 Cx = vec4(C0.x, C1.x, C2.x, C3.x); + vec4 Cy = vec4(C0.y, C1.y, C2.y, C3.y); + + vec4 Texel0 = texture2D(DiffuseSampler, C0); + vec4 Texel1 = texture2D(DiffuseSampler, C1); + vec4 Texel2 = texture2D(DiffuseSampler, C2); + vec4 Texel3 = texture2D(DiffuseSampler, C3); + + // Calculate the expected time of the sample. + vec4 T = A2 * Cy * vec4(InSize.y) + B + Cx; + vec4 W = vec4(Pi2ScanTime * CCFrequency); + vec4 TW = T * W; + vec4 Y = vec4(dot(Texel0, YTransform), dot(Texel1, YTransform), dot(Texel2, YTransform), dot(Texel3, YTransform)); + vec4 I = vec4(dot(Texel0, ITransform), dot(Texel1, ITransform), dot(Texel2, ITransform), dot(Texel3, ITransform)); + vec4 Q = vec4(dot(Texel0, QTransform), dot(Texel1, QTransform), dot(Texel2, QTransform), dot(Texel3, QTransform)); + + vec4 Encoded = Y + I * cos(TW) + Q * sin(TW); + gl_FragColor = (Encoded - MinC) * InvCRange; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.json b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.json new file mode 100644 index 0000000..2cda4df --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/ntsc_encode.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_encode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/outline.fsh new file mode 100644 index 0000000..6285820 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline.fsh @@ -0,0 +1,21 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 uDiff = center - up; + vec4 dDiff = center - down; + vec4 lDiff = center - left; + vec4 rDiff = center - right; + vec4 sum = uDiff + dDiff + lDiff + rDiff; + vec3 clamped = clamp(center.rgb - sum.rgb, 0.0, 1.0); + gl_FragColor = vec4(clamped, center.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline.json b/build/resources/patchedMc/assets/minecraft/shaders/program/outline.json new file mode 100644 index 0000000..7d41382 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.fsh new file mode 100644 index 0000000..d4b7682 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.fsh @@ -0,0 +1,13 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OutlineSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 diffuseTexel = texture2D(DiffuseSampler, texCoord); + vec4 outlineTexel = texture2D(OutlineSampler, texCoord); + gl_FragColor = vec4(diffuseTexel.rgb + diffuseTexel.rgb * outlineTexel.rgb * vec3(0.75), diffuseTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.json b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.json new file mode 100644 index 0000000..d52f4a3 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_combine.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_combine", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "OutlineSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.fsh new file mode 100644 index 0000000..92031c1 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.fsh @@ -0,0 +1,46 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; +uniform float LumaLevel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 uDiff = abs(center - up); + vec4 dDiff = abs(center - down); + vec4 lDiff = abs(center - left); + vec4 rDiff = abs(center - right); + vec4 u2Diff = abs(center - up2); + vec4 d2Diff = abs(center - down2); + vec4 l2Diff = abs(center - left2); + vec4 r2Diff = abs(center - right2); + vec4 sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff; + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float sumLuma = 1.0 - dot(clamp(sum, 0.0, 1.0), gray); + + // Get luminance of center pixel and adjust + float centerLuma = dot(center + (center - pow(center, vec4(LumaRamp))), gray); + + // Quantize the luma value + centerLuma = centerLuma - fract(centerLuma * LumaLevel) / LumaLevel; + + // Re-scale to full range + centerLuma = centerLuma * (LumaLevel / (LumaLevel - 1.0)); + + // Blend with outline + centerLuma = centerLuma * sumLuma; + + gl_FragColor = vec4(centerLuma, centerLuma, centerLuma, center.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.json b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.json new file mode 100644 index 0000000..c58bb5d --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_soft.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_soft", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] }, + { "name": "LumaLevel", "type": "float", "count": 1, "values": [ 4.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.fsh new file mode 100644 index 0000000..b7d47d2 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.fsh @@ -0,0 +1,41 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + vec4 bl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 br = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float uDiff = dot(abs(center - up), gray); + float dDiff = dot(abs(center - down), gray); + float lDiff = dot(abs(center - left), gray); + float rDiff = dot(abs(center - right), gray); + float u2Diff = dot(abs(center - up2), gray); + float d2Diff = dot(abs(center - down2), gray); + float l2Diff = dot(abs(center - left2), gray); + float r2Diff = dot(abs(center - right2), gray); + float ulDiff = dot(abs(center - ul), gray); + float urDiff = dot(abs(center - ur), gray); + float blDiff = dot(abs(center - bl), gray); + float brDiff = dot(abs(center - br), gray); + float sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff + ulDiff + urDiff + blDiff + brDiff; + float sumLuma = clamp(sum, 0.0, 1.0); + + gl_FragColor = vec4(sumLuma, sumLuma, sumLuma, center.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.json b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.json new file mode 100644 index 0000000..2954352 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/outline_watercolor.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_watercolor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.fsh new file mode 100644 index 0000000..311d26d --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OverlaySampler; + +uniform vec2 InSize; + +varying vec2 texCoord; + +uniform float MosaicSize = 1.0; +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); + +void main(){ + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + float red = dot(baseTexel.rgb, RedMatrix); + float green = dot(baseTexel.rgb, GreenMatrix); + float blue = dot(baseTexel.rgb, BlueMatrix); + + vec4 overlayTexel = texture2D(OverlaySampler, vec2(texCoord.x, 1.0 - texCoord.y)); + gl_FragColor = mix(vec4(red, green, blue, baseTexel.a), overlayTexel, overlayTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.json b/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.json new file mode 100644 index 0000000..ceb8d0f --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/overlay.json @@ -0,0 +1,23 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "overlay", + "attributes": [ "Position" ], + "samplers": [ + { "name": "OverlaySampler" }, + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 1.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.fsh new file mode 100644 index 0000000..7721436 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.fsh @@ -0,0 +1,19 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.7, 0.7); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + + gl_FragColor = vec4(max(PrevTexel.rgb * Phosphor, CurrTexel.rgb), CurrTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.json b/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.json new file mode 100644 index 0000000..c3a01f2 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/phosphor.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "PrevSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.fsh new file mode 100644 index 0000000..0911697 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.fsh @@ -0,0 +1,64 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 Half = vec4(0.5); +const vec4 One = vec4(1.0); +const vec4 Two = vec4(2.0); + +const float Pi = 3.1415926535; +const float PincushionAmount = 0.02; +const float CurvatureAmount = 0.02; +const float ScanlineAmount = 0.8; +const float ScanlineScale = 1.0; +const float ScanlineHeight = 1.0; +const float ScanlineBrightScale = 1.0; +const float ScanlineBrightOffset = 0.0; +const float ScanlineOffset = 0.0; +const vec3 Floor = vec3(0.05, 0.05, 0.05); +const vec3 Power = vec3(0.8, 0.8, 0.8); + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + vec2 PinUnitCoord = texCoord * Two.xy - One.xy; + float PincushionR2 = pow(length(PinUnitCoord), 2.0); + vec2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2; + vec2 ScanCoord = texCoord; + + ScanCoord *= One.xy - PincushionAmount * 0.2; + ScanCoord += PincushionAmount * 0.1; + ScanCoord += PincushionCurve; + + vec2 CurvatureClipCurve = PinUnitCoord * CurvatureAmount * PincushionR2; + vec2 ScreenClipCoord = texCoord; + ScreenClipCoord -= Half.xy; + ScreenClipCoord *= One.xy - CurvatureAmount * 0.2; + ScreenClipCoord += Half.xy; + ScreenClipCoord += CurvatureClipCurve; + + // -- Alpha Clipping -- + if (ScanCoord.x < 0.0) discard; + if (ScanCoord.y < 0.0) discard; + if (ScanCoord.x > 1.0) discard; + if (ScanCoord.y > 1.0) discard; + + // -- Scanline Simulation -- + float InnerSine = ScanCoord.y * InSize.y * ScanlineScale * 0.25; + float ScanBrightMod = sin(InnerSine * Pi + ScanlineOffset * InSize.y * 0.25); + float ScanBrightness = mix(1.0, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0) * 0.5, ScanlineAmount); + vec3 ScanlineTexel = InTexel.rgb * ScanBrightness; + + // -- Color Compression (increasing the floor of the signal without affecting the ceiling) -- + ScanlineTexel = Floor + (One.xyz - Floor) * ScanlineTexel; + + ScanlineTexel.rgb = pow(ScanlineTexel.rgb, Power); + + gl_FragColor = vec4(ScanlineTexel.rgb, InTexel.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.json b/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.json new file mode 100644 index 0000000..9c7f9a3 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/scan_pincushion.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "scan_pincushion", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.fsh new file mode 100644 index 0000000..b17c769 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.fsh @@ -0,0 +1,20 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)); + vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)); + vec4 leftDiff = center - left; + vec4 rightDiff = center - right; + vec4 upDiff = center - up; + vec4 downDiff = center - down; + vec4 total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0); + gl_FragColor = vec4(total.rgb, center.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.json b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.json new file mode 100644 index 0000000..dc2fc17 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "sobel", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.vsh b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.vsh new file mode 100644 index 0000000..21b1736 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/sobel.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.fsh b/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.fsh new file mode 100644 index 0000000..a124319 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.fsh @@ -0,0 +1,58 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Time; +uniform vec2 Frequency; +uniform vec2 WobbleAmount; + +vec3 hue(float h) +{ + float r = abs(h * 6.0 - 3.0) - 1.0; + float g = 2 - abs(h * 6.0 - 2.0); + float b = 2 - abs(h * 6.0 - 4.0); + return clamp(vec3(r,g,b), 0.0, 1.0); +} + +vec3 HSVtoRGB(vec3 hsv) { + return ((hue(hsv.x) - 1.0) * hsv.y + 1.0) * hsv.z; +} + +vec3 RGBtoHSV(vec3 rgb) { + vec3 hsv = vec3(0.0); + hsv.z = max(rgb.r, max(rgb.g, rgb.b)); + float min = min(rgb.r, min(rgb.g, rgb.b)); + float c = hsv.z - min; + + if (c != 0) + { + hsv.y = c / hsv.z; + vec3 delta = (hsv.z - rgb) / c; + delta.rgb -= delta.brg; + delta.rg += vec2(2.0, 4.0); + if (rgb.r >= hsv.z) { + hsv.x = delta.b; + } else if (rgb.g >= hsv.z) { + hsv.x = delta.r; + } else { + hsv.x = delta.g; + } + hsv.x = fract(hsv.x / 6.0); + } + return hsv; +} + +void main() { + float xOffset = sin(texCoord.y * Frequency.x + Time * 3.1415926535 * 2.0) * WobbleAmount.x; + float yOffset = cos(texCoord.x * Frequency.y + Time * 3.1415926535 * 2.0) * WobbleAmount.y; + vec2 offset = vec2(xOffset, yOffset); + vec4 rgb = texture2D(DiffuseSampler, texCoord + offset); + vec3 hsv = RGBtoHSV(rgb.rgb); + hsv.x = fract(hsv.x + Time); + gl_FragColor = vec4(HSVtoRGB(hsv), rgb.a); +} diff --git a/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.json b/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.json new file mode 100644 index 0000000..d8e9945 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/shaders/program/wobble.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "wobble", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, + { "name": "Frequency", "type": "float", "count": 2, "values": [ 512.0, 288.0 ] }, + { "name": "WobbleAmount", "type": "float", "count": 2, "values": [ 0.002, 0.002 ] } + ] +} diff --git a/build/resources/patchedMc/assets/minecraft/texts/credits.txt b/build/resources/patchedMc/assets/minecraft/texts/credits.txt new file mode 100644 index 0000000..7396a16 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/texts/credits.txt @@ -0,0 +1,66 @@ +[C]§f=============== +[C]§eMinecraft Credits +[C]§f=============== + +§7Created by: +§f Markus Persson + +§7Game design, programming and graphics: +§f Markus Persson +§f Jens Bergensten +§f Nathan Adams + +§7Programming: +§f Erik Broes + +§7Music and sound: +§f Daniel Rosenfeld + +§7Ingame artwork and paintings: +§f Kristoffer Zetterstrand + +§7End game narrative: +§f Julian Gough + +§7Website development: +§f Tobias Möllstam +§f Daniel Frisk +§f Leonard Axelsson +§f Jens Bergensten +§f Markus Persson + +§7Logo and promotional artwork: +§f Markus Toivonen + +§7Business and administration: +§f Carl Manneh +§f Daniel Kaplan + +§7Director of fun: +§f Lydia Winters + +§7Number crunching and statistics: +§f Patrick Geuder + +§7Additional programming: +§f Paul Spooner +§f Ryan 'Scaevolus' Hitchman +§f Elliot 'Hippoplatimus' Segal + +§7Developers of Mo' Creatures (horses etc): +§f John Olarte (DrZhark) +§f Kent Christian Jensen +§f Dan Roque + +§7Technologies used: +§f Java by Oracle +§f LWJGL by many talented people +§f "3d Sound System" by Paul Lamb +§f JOrbis by JCraft + + + + + + +§f"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." §7- Unknown \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/texts/end.txt b/build/resources/patchedMc/assets/minecraft/texts/end.txt new file mode 100644 index 0000000..7277524 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/texts/end.txt @@ -0,0 +1,151 @@ +§3I see the player you mean. + +§2PLAYERNAME? + +§3Yes. Take care. It has reached a higher level now. It can read our thoughts. + +§2That doesn't matter. It thinks we are part of the game. + +§3I like this player. It played well. It did not give up. + +§2It is reading our thoughts as though they were words on a screen. + +§3That is how it chooses to imagine many things, when it is deep in the dream of a game. + +§2Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. + +§3They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. + +§2What did this player dream? + +§3This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. + +§2Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? + +§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3. + +§2It cannot read that thought. + +§3No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. + +§2Does it know that we love it? That the universe is kind? + +§3Sometimes, through the noise of its thoughts, it hears the universe, yes. + +§2But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. + +§3To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. + +§2Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. + +§3It reads our thoughts. + +§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream. + +§3And yet they play the game. + +§2But it would be so easy to tell them... + +§3Too strong for this dream. To tell them how to live is to prevent them living. + +§2I will not tell the player how to live. + +§3The player is growing restless. + +§2I will tell the player a story. + +§3But not the truth. + +§2No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. + +§3Give it a body, again. + +§2Yes. Player... + +§3Use its name. + +§2PLAYERNAME. Player of games. + +§3Good. + +§2Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. + +§3Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. + +§2We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. + +§2Once upon a time, there was a player. + +§3The player was you, PLAYERNAME. + +§2Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. + +§2Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. + +§3Sometimes the player dreamed it was lost in a story. + +§2Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. + +§3Sometimes the player dreamed it watched words on a screen. + +§2Let's go back. + +§2The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. + +§2And the player awoke, from the warm, dark world of its mother's body, into the long dream. + +§2And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. + +§3You are the player. The story. The program. The human. Made from nothing but milk and love. + +§2Let's go further back. + +§2The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... + +§3Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". + +§2Sometimes it called them "planets" and "stars". + +§2Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. + +§3You are the player, reading words... + +§2Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive + +§3You. You. You are alive. + +§2and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees + +§3and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again + +§2and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream + +§3and the universe said I love you + +§2and the universe said you have played the game well + +§3and the universe said everything you need is within you + +§2and the universe said you are stronger than you know + +§3and the universe said you are the daylight + +§2and the universe said you are the night + +§3and the universe said the darkness you fight is within you + +§2and the universe said the light you seek is within you + +§3and the universe said you are not alone + +§2and the universe said you are not separate from every other thing + +§3and the universe said you are the universe tasting itself, talking to itself, reading its own code + +§2and the universe said I love you because you are love. + +§3And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. + +§3You are the player. + +§2Wake up. diff --git a/build/resources/patchedMc/assets/minecraft/texts/splashes.txt b/build/resources/patchedMc/assets/minecraft/texts/splashes.txt new file mode 100644 index 0000000..061ae98 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/texts/splashes.txt @@ -0,0 +1,322 @@ +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 1.2! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Notch <3 ez! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Cooler than Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Ryan also has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +This message will never appear on the splash screen, isn't that weird? +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Hobo humping slobo babe! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ハロー! +한국 안녕하세요! +Helo Cymru! +Cześć Polsko! +你好中国! +Привет Россия! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish! +Big Pointy Teeth! +Bekarton guards the gate! +Mmmph, mmph! +Don't feed avocados to parrots! +Swords for everyone! +Plz reply to my tweet! +.party()! +Take her pillow! +Put that cookie down! +Pretty scary! +I have a suggestion. +Now with extra hugs! +Now java 6! +Woah. +HURNERJSGER? +What's up, Doc? +Now contains 32 random daily cats! \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_base.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_base.png new file mode 100644 index 0000000..cfc1fc8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_base.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_0.png new file mode 100644 index 0000000..395dea4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_1.png new file mode 100644 index 0000000..eddc47f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_2.png new file mode 100644 index 0000000..6cade1f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/anvil_top_damaged_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/beacon.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/beacon.png new file mode 100644 index 0000000..a69e59d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/beacon.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_end.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_end.png new file mode 100644 index 0000000..6e1a4be Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_end.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_side.png new file mode 100644 index 0000000..3ce06f3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_top.png new file mode 100644 index 0000000..b96d357 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_feet_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_end.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_end.png new file mode 100644 index 0000000..b684c9a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_end.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_side.png new file mode 100644 index 0000000..3270b4a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_top.png new file mode 100644 index 0000000..2ab1090 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bed_head_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bedrock.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bedrock.png new file mode 100644 index 0000000..1643c99 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bedrock.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/bookshelf.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/bookshelf.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/bookshelf.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand.png new file mode 100644 index 0000000..60832aa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand_base.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand_base.png new file mode 100644 index 0000000..0742fbf Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/brewing_stand_base.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/brick.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/brick.png new file mode 100644 index 0000000..fd6959c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/brick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_bottom.png new file mode 100644 index 0000000..6f10bc0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_side.png new file mode 100644 index 0000000..9c55503 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_top.png new file mode 100644 index 0000000..f182e84 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cactus_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_bottom.png new file mode 100644 index 0000000..d93b15a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_inner.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_inner.png new file mode 100644 index 0000000..ce7ce69 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_inner.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_side.png new file mode 100644 index 0000000..343a023 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_top.png new file mode 100644 index 0000000..2947892 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cake_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_3.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_3.png new file mode 100644 index 0000000..2391be8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/carrots_stage_3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_bottom.png new file mode 100644 index 0000000..fb31385 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_inner.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_inner.png new file mode 100644 index 0000000..d5a30dd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_inner.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_side.png new file mode 100644 index 0000000..72b0e5a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cauldron_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/clay.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/clay.png new file mode 100644 index 0000000..c19e031 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/clay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_block.png new file mode 100644 index 0000000..024404b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_ore.png new file mode 100644 index 0000000..49486d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/coal_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone.png new file mode 100644 index 0000000..da3498c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone_mossy.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone_mossy.png new file mode 100644 index 0000000..29449e3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cobblestone_mossy.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_0.png new file mode 100644 index 0000000..25892eb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_1.png new file mode 100644 index 0000000..d0098ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_2.png new file mode 100644 index 0000000..db28c7b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/cocoa_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/command_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/command_block.png new file mode 100644 index 0000000..4459675 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/command_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_off.png new file mode 100644 index 0000000..c9527bc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_on.png new file mode 100644 index 0000000..2e4fb7a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/comparator_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_front.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_front.png new file mode 100644 index 0000000..11986a4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_front.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_side.png new file mode 100644 index 0000000..1c678b4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_top.png new file mode 100644 index 0000000..5cd53a5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/crafting_table_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_side.png new file mode 100644 index 0000000..ac273ea Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_top.png new file mode 100644 index 0000000..3bfb2da Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/daylight_detector_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/deadbush.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/deadbush.png new file mode 100644 index 0000000..c64e079 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/deadbush.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_0.png new file mode 100644 index 0000000..f65b7ed Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_1.png new file mode 100644 index 0000000..7c91596 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_2.png new file mode 100644 index 0000000..dadd6b0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_3.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_3.png new file mode 100644 index 0000000..52a40b6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_4.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_4.png new file mode 100644 index 0000000..e37c88a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_5.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_5.png new file mode 100644 index 0000000..9590d2f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_6.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_6.png new file mode 100644 index 0000000..8e490c0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_7.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_7.png new file mode 100644 index 0000000..0b40c78 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_8.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_8.png new file mode 100644 index 0000000..c0bf1de Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_8.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_9.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_9.png new file mode 100644 index 0000000..e3185f8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/destroy_stage_9.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_block.png new file mode 100644 index 0000000..f2e2e77 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_ore.png new file mode 100644 index 0000000..735ecda Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/diamond_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt.png new file mode 100644 index 0000000..617d353 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_side.png new file mode 100644 index 0000000..5921d37 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_top.png new file mode 100644 index 0000000..ebeda86 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dirt_podzol_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_horizontal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_horizontal.png new file mode 100644 index 0000000..3e09fde Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_horizontal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_vertical.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_vertical.png new file mode 100644 index 0000000..87a7837 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dispenser_front_vertical.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_lower.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_lower.png new file mode 100644 index 0000000..dbc33ab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_lower.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_upper.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_upper.png new file mode 100644 index 0000000..56878fe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_iron_upper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_lower.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_lower.png new file mode 100644 index 0000000..cc61731 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_lower.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_upper.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_upper.png new file mode 100644 index 0000000..93319d5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/door_wood_upper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_bottom.png new file mode 100644 index 0000000..6a5fa6a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_top.png new file mode 100644 index 0000000..393144c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_fern_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_bottom.png new file mode 100644 index 0000000..ec717f9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_top.png new file mode 100644 index 0000000..113d2b3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_grass_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png new file mode 100644 index 0000000..21285f5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_top.png new file mode 100644 index 0000000..bc68241 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_paeonia_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_bottom.png new file mode 100644 index 0000000..4d59f44 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_top.png new file mode 100644 index 0000000..028aa80 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_rose_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_back.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_back.png new file mode 100644 index 0000000..d488923 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_back.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png new file mode 100644 index 0000000..8a12ebe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_front.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_front.png new file mode 100644 index 0000000..699e34f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_front.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_top.png new file mode 100644 index 0000000..4d14203 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_sunflower_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png new file mode 100644 index 0000000..5b880b5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_top.png new file mode 100644 index 0000000..b00751f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/double_plant_syringa_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dragon_egg.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dragon_egg.png new file mode 100644 index 0000000..02af123 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dragon_egg.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_horizontal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_horizontal.png new file mode 100644 index 0000000..7d5f260 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_horizontal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_vertical.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_vertical.png new file mode 100644 index 0000000..68a56c8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/dropper_front_vertical.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_block.png new file mode 100644 index 0000000..dc214ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_ore.png new file mode 100644 index 0000000..a26c35f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/emerald_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_bottom.png new file mode 100644 index 0000000..0f492aa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_side.png new file mode 100644 index 0000000..f2f4614 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_top.png new file mode 100644 index 0000000..0d5f68f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/enchanting_table_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/end_stone.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/end_stone.png new file mode 100644 index 0000000..c2a91e3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/end_stone.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_eye.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_eye.png new file mode 100644 index 0000000..afa1d5d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_eye.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_side.png new file mode 100644 index 0000000..e6cb567 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_top.png new file mode 100644 index 0000000..35215a5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/endframe_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_dry.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_dry.png new file mode 100644 index 0000000..d03a0f4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_dry.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_wet.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_wet.png new file mode 100644 index 0000000..f8d460d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/farmland_wet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/fern.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/fern.png new file mode 100644 index 0000000..fd76950 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/fern.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png new file mode 100644 index 0000000..cf8910f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta new file mode 100644 index 0000000..7644671 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frames": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ] + } +} diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png new file mode 100644 index 0000000..6db92ac Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_allium.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_allium.png new file mode 100644 index 0000000..b7b5a45 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_allium.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_blue_orchid.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_blue_orchid.png new file mode 100644 index 0000000..51d7fd9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_blue_orchid.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_dandelion.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_dandelion.png new file mode 100644 index 0000000..873e3f5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_dandelion.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_houstonia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_houstonia.png new file mode 100644 index 0000000..2f9127d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_houstonia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_oxeye_daisy.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_oxeye_daisy.png new file mode 100644 index 0000000..6d48913 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_oxeye_daisy.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_paeonia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_paeonia.png new file mode 100644 index 0000000..01a92ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_paeonia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_pot.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_pot.png new file mode 100644 index 0000000..09c2523 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_pot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_rose.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_rose.png new file mode 100644 index 0000000..895d78f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_rose.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_orange.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_orange.png new file mode 100644 index 0000000..6715a62 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_pink.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_pink.png new file mode 100644 index 0000000..a757bf5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_red.png new file mode 100644 index 0000000..3048b63 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_white.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_white.png new file mode 100644 index 0000000..6aa12a9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/flower_tulip_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_off.png new file mode 100644 index 0000000..0570c3a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_on.png new file mode 100644 index 0000000..92c89f3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_front_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_side.png new file mode 100644 index 0000000..115f73d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_top.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/furnace_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_black.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_black.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_blue.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_brown.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_cyan.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_cyan.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_cyan.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_gray.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_gray.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_green.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_green.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_green.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_light_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_light_blue.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_light_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_lime.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_lime.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_lime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_magenta.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_magenta.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_magenta.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_orange.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_orange.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top.png new file mode 100644 index 0000000..02de587 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_black.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_black.png new file mode 100644 index 0000000..43d60c5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_blue.png new file mode 100644 index 0000000..55c614f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_brown.png new file mode 100644 index 0000000..cbd791a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_cyan.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_cyan.png new file mode 100644 index 0000000..9a34b84 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_cyan.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_gray.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_gray.png new file mode 100644 index 0000000..bb06114 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_green.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_green.png new file mode 100644 index 0000000..a7d9fc7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_green.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png new file mode 100644 index 0000000..6a0e661 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_lime.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_lime.png new file mode 100644 index 0000000..0607d75 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_lime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_magenta.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_magenta.png new file mode 100644 index 0000000..5419e52 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_magenta.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_orange.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_orange.png new file mode 100644 index 0000000..2866571 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_pink.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_pink.png new file mode 100644 index 0000000..6b6cd76 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_purple.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_purple.png new file mode 100644 index 0000000..23e208e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_purple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_red.png new file mode 100644 index 0000000..22b69db Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_silver.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_silver.png new file mode 100644 index 0000000..f226ecc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_silver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_white.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_white.png new file mode 100644 index 0000000..9a273c3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_yellow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_yellow.png new file mode 100644 index 0000000..1c8580f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pane_top_yellow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pink.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pink.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_purple.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_purple.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_purple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_red.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_silver.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_silver.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_silver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_white.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_white.png new file mode 100644 index 0000000..696c5aa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_yellow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_yellow.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glass_yellow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/glowstone.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/glowstone.png new file mode 100644 index 0000000..c7253b3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/glowstone.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_block.png new file mode 100644 index 0000000..174002e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_ore.png new file mode 100644 index 0000000..b1a7a55 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/gold_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side.png new file mode 100644 index 0000000..a4975e5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_overlay.png new file mode 100644 index 0000000..fc3fa9d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_snowed.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_snowed.png new file mode 100644 index 0000000..41f6197 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_side_snowed.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_top.png new file mode 100644 index 0000000..eaa7e45 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/grass_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/gravel.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/gravel.png new file mode 100644 index 0000000..388e5c5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/gravel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay.png new file mode 100644 index 0000000..2446380 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_black.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_black.png new file mode 100644 index 0000000..59da22c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png new file mode 100644 index 0000000..7e38e27 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png new file mode 100644 index 0000000..f81745f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png new file mode 100644 index 0000000..b05428c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png new file mode 100644 index 0000000..8f86904 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_green.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_green.png new file mode 100644 index 0000000..e89162e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_green.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png new file mode 100644 index 0000000..3d9ebea Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png new file mode 100644 index 0000000..b459a0b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png new file mode 100644 index 0000000..9663106 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png new file mode 100644 index 0000000..40929db Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png new file mode 100644 index 0000000..c21c0aa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png new file mode 100644 index 0000000..edece94 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_red.png new file mode 100644 index 0000000..6561d12 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png new file mode 100644 index 0000000..eae07f2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_white.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_white.png new file mode 100644 index 0000000..8066af0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png new file mode 100644 index 0000000..5da4687 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_side.png new file mode 100644 index 0000000..a2b32db Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_top.png new file mode 100644 index 0000000..1d35593 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hay_block_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_inside.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_inside.png new file mode 100644 index 0000000..24e8eae Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_inside.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_outside.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_outside.png new file mode 100644 index 0000000..50ed8d5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_outside.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/hopper_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/ice.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/ice.png new file mode 100644 index 0000000..ac946e9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/ice.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/ice_packed.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/ice_packed.png new file mode 100644 index 0000000..50f0f34 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/ice_packed.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_bars.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_bars.png new file mode 100644 index 0000000..732807f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_bars.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_block.png new file mode 100644 index 0000000..7816799 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_ore.png new file mode 100644 index 0000000..250d8bb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/iron_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/itemframe_background.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/itemframe_background.png new file mode 100644 index 0000000..b40ad65 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/itemframe_background.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_side.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_top.png new file mode 100644 index 0000000..92ddb15 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/jukebox_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/ladder.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/ladder.png new file mode 100644 index 0000000..e2ec5f2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/ladder.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_block.png new file mode 100644 index 0000000..0271489 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_ore.png new file mode 100644 index 0000000..6144236 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/lapis_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png new file mode 100644 index 0000000..af07f91 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png new file mode 100644 index 0000000..78bb29d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png.mcmeta new file mode 100644 index 0000000..7ceb363 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/lava_still.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_acacia_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_birch_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle.png new file mode 100644 index 0000000..e0cb935 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle_opaque.png new file mode 100644 index 0000000..110a618 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_jungle_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_oak_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce.png new file mode 100644 index 0000000..602eab8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce_opaque.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce_opaque.png new file mode 100644 index 0000000..2e5228e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/leaves_spruce_opaque.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/lever.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/lever.png new file mode 100644 index 0000000..051187f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/lever.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia.png new file mode 100644 index 0000000..d221210 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia_top.png new file mode 100644 index 0000000..3d44878 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_acacia_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak.png new file mode 100644 index 0000000..d4da03e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak_top.png new file mode 100644 index 0000000..99137b6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_big_oak_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch.png new file mode 100644 index 0000000..bfb209d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch_top.png new file mode 100644 index 0000000..f9b94f4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_birch_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle.png new file mode 100644 index 0000000..0b7120a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle_top.png new file mode 100644 index 0000000..26b0361 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_jungle_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak.png new file mode 100644 index 0000000..914cb5f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak_top.png new file mode 100644 index 0000000..7a44e77 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_oak_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce.png new file mode 100644 index 0000000..dc1aa2f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce_top.png new file mode 100644 index 0000000..280c64e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/log_spruce_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_side.png new file mode 100644 index 0000000..ec7b430 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_connected.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_connected.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_disconnected.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_stem_disconnected.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_top.png new file mode 100644 index 0000000..65cf169 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/melon_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mob_spawner.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mob_spawner.png new file mode 100644 index 0000000..7d55217 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mob_spawner.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_inside.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_inside.png new file mode 100644 index 0000000..f0e7a04 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_inside.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png new file mode 100644 index 0000000..1f52ba8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_red.png new file mode 100644 index 0000000..66cf12c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png new file mode 100644 index 0000000..83c0840 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_brown.png new file mode 100644 index 0000000..bf33d34 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_red.png new file mode 100644 index 0000000..1b332b7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mushroom_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_side.png new file mode 100644 index 0000000..5547425 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_top.png new file mode 100644 index 0000000..088a825 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/mycelium_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_brick.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_brick.png new file mode 100644 index 0000000..caaf66f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_brick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_0.png new file mode 100644 index 0000000..514a95b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_1.png new file mode 100644 index 0000000..b4ad0d1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_2.png new file mode 100644 index 0000000..b9b6743 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/nether_wart_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/netherrack.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/netherrack.png new file mode 100644 index 0000000..88129c4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/netherrack.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/noteblock.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/noteblock.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/noteblock.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/obsidian.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/obsidian.png new file mode 100644 index 0000000..ff0a683 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/obsidian.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_bottom.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_inner.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_inner.png new file mode 100644 index 0000000..1043929 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_inner.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_side.png new file mode 100644 index 0000000..634f54a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_normal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_normal.png new file mode 100644 index 0000000..eeaadab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_sticky.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_sticky.png new file mode 100644 index 0000000..6ddd4ad Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/piston_top_sticky.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_acacia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_acacia.png new file mode 100644 index 0000000..6858c51 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_acacia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_big_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_big_oak.png new file mode 100644 index 0000000..e3fd4ea Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_big_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_birch.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_birch.png new file mode 100644 index 0000000..b113e3a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_birch.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_jungle.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_jungle.png new file mode 100644 index 0000000..e3fe82d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_jungle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_oak.png new file mode 100644 index 0000000..346f77d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_spruce.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_spruce.png new file mode 100644 index 0000000..f45fa94 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/planks_spruce.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png new file mode 100644 index 0000000..96859e2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/portal.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_3.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_3.png new file mode 100644 index 0000000..d7e8185 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/potatoes_stage_3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_off.png new file mode 100644 index 0000000..ecef025 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_on.png new file mode 100644 index 0000000..907f499 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_face_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_side.png new file mode 100644 index 0000000..75dfc47 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_connected.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_connected.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_top.png new file mode 100644 index 0000000..297ce3c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/pumpkin_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_bottom.png new file mode 100644 index 0000000..7e16c7c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled.png new file mode 100644 index 0000000..80465a1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png new file mode 100644 index 0000000..44073e5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines.png new file mode 100644 index 0000000..184ecd2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines_top.png new file mode 100644 index 0000000..6d20379 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_lines_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_side.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_top.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_block_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_ore.png new file mode 100644 index 0000000..4d758c1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/quartz_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator.png new file mode 100644 index 0000000..ce115ba Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator_powered.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator_powered.png new file mode 100644 index 0000000..a3aaca9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_activator_powered.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector.png new file mode 100644 index 0000000..92c1466 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector_powered.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector_powered.png new file mode 100644 index 0000000..a1c6e6b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_detector_powered.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden.png new file mode 100644 index 0000000..1fc52c3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden_powered.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden_powered.png new file mode 100644 index 0000000..bd343be Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_golden_powered.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal.png new file mode 100644 index 0000000..d609236 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal_turned.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal_turned.png new file mode 100644 index 0000000..f394a23 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/rail_normal_turned.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/red_sand.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/red_sand.png new file mode 100644 index 0000000..b216a42 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/red_sand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_block.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_block.png new file mode 100644 index 0000000..fcf6b40 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross.png new file mode 100644 index 0000000..dcec893 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line.png new file mode 100644 index 0000000..ff0fb23 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_off.png new file mode 100644 index 0000000..522765b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_on.png new file mode 100644 index 0000000..9562ef3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_lamp_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_ore.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_ore.png new file mode 100644 index 0000000..575a488 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_ore.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_off.png new file mode 100644 index 0000000..635eabd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_on.png new file mode 100644 index 0000000..2983d6c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/redstone_torch_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/reeds.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/reeds.png new file mode 100644 index 0000000..64bbfe0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/reeds.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_off.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_off.png new file mode 100644 index 0000000..8634669 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_off.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_on.png new file mode 100644 index 0000000..d71d0d9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/repeater_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sand.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sand.png new file mode 100644 index 0000000..86b9654 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_bottom.png new file mode 100644 index 0000000..e102220 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_carved.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_carved.png new file mode 100644 index 0000000..9bd7fa1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_carved.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_normal.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_normal.png new file mode 100644 index 0000000..1b79145 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_smooth.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_smooth.png new file mode 100644 index 0000000..ef118bd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_smooth.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_top.png new file mode 100644 index 0000000..bb5b157 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sandstone_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_acacia.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_acacia.png new file mode 100644 index 0000000..a1215cb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_acacia.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_birch.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_birch.png new file mode 100644 index 0000000..b0dacc5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_birch.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_jungle.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_jungle.png new file mode 100644 index 0000000..4e10b35 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_jungle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_oak.png new file mode 100644 index 0000000..1bf1bfa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_roofed_oak.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_roofed_oak.png new file mode 100644 index 0000000..dcf5588 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_roofed_oak.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_spruce.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_spruce.png new file mode 100644 index 0000000..5767d48 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sapling_spruce.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/snow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/snow.png new file mode 100644 index 0000000..5c146cd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/snow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/soul_sand.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/soul_sand.png new file mode 100644 index 0000000..fca7e8f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/soul_sand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/sponge.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/sponge.png new file mode 100644 index 0000000..a850804 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/sponge.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stone.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone.png new file mode 100644 index 0000000..87e19ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_side.png new file mode 100644 index 0000000..fe2a204 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_top.png new file mode 100644 index 0000000..090657d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stone_slab_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick.png new file mode 100644 index 0000000..69138cf Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_carved.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_carved.png new file mode 100644 index 0000000..b7e88db Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_carved.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_cracked.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_cracked.png new file mode 100644 index 0000000..918a884 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_cracked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_mossy.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_mossy.png new file mode 100644 index 0000000..5b9fe37 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/stonebrick_mossy.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/tallgrass.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/tallgrass.png new file mode 100644 index 0000000..65209fa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/tallgrass.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_bottom.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_bottom.png new file mode 100644 index 0000000..cc2e586 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_bottom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_side.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_side.png new file mode 100644 index 0000000..21109fb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_side.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_top.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_top.png new file mode 100644 index 0000000..ceb44b6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/tnt_top.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/torch_on.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/torch_on.png new file mode 100644 index 0000000..a2ce41b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/torch_on.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/trapdoor.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/trapdoor.png new file mode 100644 index 0000000..a7dcccc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/trapdoor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire.png new file mode 100644 index 0000000..6a9a72b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire_source.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire_source.png new file mode 100644 index 0000000..fbd464d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/trip_wire_source.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/vine.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/vine.png new file mode 100644 index 0000000..df5e435 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/vine.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png new file mode 100644 index 0000000..e72280c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png new file mode 100644 index 0000000..c7e90b0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/blocks/water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/waterlily.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/waterlily.png new file mode 100644 index 0000000..f6c84f8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/waterlily.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/web.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/web.png new file mode 100644 index 0000000..7c097f1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/web.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_0.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_0.png new file mode 100644 index 0000000..185af6f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_1.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_1.png new file mode 100644 index 0000000..67588c1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_2.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_2.png new file mode 100644 index 0000000..3d33792 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_3.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_3.png new file mode 100644 index 0000000..4649f78 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_4.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_4.png new file mode 100644 index 0000000..ac04b52 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_5.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_5.png new file mode 100644 index 0000000..1ea81ac Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_6.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_6.png new file mode 100644 index 0000000..cb5f195 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_7.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_7.png new file mode 100644 index 0000000..7acafb3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wheat_stage_7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_black.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_black.png new file mode 100644 index 0000000..b74d5c9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_blue.png new file mode 100644 index 0000000..ce9515f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_brown.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_brown.png new file mode 100644 index 0000000..b4dc3c5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_cyan.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_cyan.png new file mode 100644 index 0000000..ca0800a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_cyan.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_gray.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_gray.png new file mode 100644 index 0000000..6409ff2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_green.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_green.png new file mode 100644 index 0000000..a7be6d7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_green.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_light_blue.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_light_blue.png new file mode 100644 index 0000000..72d9d9e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_light_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_lime.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_lime.png new file mode 100644 index 0000000..bf56389 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_lime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_magenta.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_magenta.png new file mode 100644 index 0000000..3af6747 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_magenta.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_orange.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_orange.png new file mode 100644 index 0000000..eefe6de Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_pink.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_pink.png new file mode 100644 index 0000000..c2785af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_purple.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_purple.png new file mode 100644 index 0000000..76f68d6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_purple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_red.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_red.png new file mode 100644 index 0000000..0cff7a9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_silver.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_silver.png new file mode 100644 index 0000000..756d9b0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_silver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_white.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_white.png new file mode 100644 index 0000000..abc7999 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_yellow.png b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_yellow.png new file mode 100644 index 0000000..4babaaa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/blocks/wool_colored_yellow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/colormap/foliage.png b/build/resources/patchedMc/assets/minecraft/textures/colormap/foliage.png new file mode 100644 index 0000000..dcc119e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/colormap/foliage.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/colormap/grass.png b/build/resources/patchedMc/assets/minecraft/textures/colormap/grass.png new file mode 100644 index 0000000..484a9a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/colormap/grass.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/effect/dither.png b/build/resources/patchedMc/assets/minecraft/textures/effect/dither.png new file mode 100644 index 0000000..19ba7e4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/effect/dither.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/arrow.png b/build/resources/patchedMc/assets/minecraft/textures/entity/arrow.png new file mode 100644 index 0000000..3afa604 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/arrow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/bat.png b/build/resources/patchedMc/assets/minecraft/textures/entity/bat.png new file mode 100644 index 0000000..803860e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/bat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/beacon_beam.png b/build/resources/patchedMc/assets/minecraft/textures/entity/beacon_beam.png new file mode 100644 index 0000000..67545b4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/beacon_beam.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/blaze.png b/build/resources/patchedMc/assets/minecraft/textures/entity/blaze.png new file mode 100644 index 0000000..19cdbb5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/blaze.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/boat.png b/build/resources/patchedMc/assets/minecraft/textures/entity/boat.png new file mode 100644 index 0000000..9b58965 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/boat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cat/black.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/black.png new file mode 100644 index 0000000..422908f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cat/ocelot.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/ocelot.png new file mode 100644 index 0000000..6b5064e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/ocelot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cat/red.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/red.png new file mode 100644 index 0000000..17b6de5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cat/siamese.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/siamese.png new file mode 100644 index 0000000..cfed948 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cat/siamese.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas.png new file mode 100644 index 0000000..4459112 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas_double.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas_double.png new file mode 100644 index 0000000..9e44eeb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/christmas_double.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/ender.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/ender.png new file mode 100644 index 0000000..3631d0d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/ender.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal.png new file mode 100644 index 0000000..2e3d7fd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal_double.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal_double.png new file mode 100644 index 0000000..0168338 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/normal_double.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped.png new file mode 100644 index 0000000..3aef190 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped_double.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped_double.png new file mode 100644 index 0000000..00eebe5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chest/trapped_double.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/chicken.png b/build/resources/patchedMc/assets/minecraft/textures/entity/chicken.png new file mode 100644 index 0000000..e24d550 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/chicken.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cow/cow.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cow/cow.png new file mode 100644 index 0000000..f1320c3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cow/cow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/cow/mooshroom.png b/build/resources/patchedMc/assets/minecraft/textures/entity/cow/mooshroom.png new file mode 100644 index 0000000..905f160 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/cow/mooshroom.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper.png b/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper.png new file mode 100644 index 0000000..abdb540 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper_armor.png b/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper_armor.png new file mode 100644 index 0000000..119f6ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/creeper/creeper_armor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enchanting_table_book.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enchanting_table_book.png new file mode 100644 index 0000000..619e7a5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enchanting_table_book.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/end_portal.png b/build/resources/patchedMc/assets/minecraft/textures/entity/end_portal.png new file mode 100644 index 0000000..d5d8569 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/end_portal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal.png b/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal.png new file mode 100644 index 0000000..8b3668a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png b/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png new file mode 100644 index 0000000..1259a5d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png new file mode 100644 index 0000000..ca5c949 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png new file mode 100644 index 0000000..147b303 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman.png new file mode 100644 index 0000000..ab23cb9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman_eyes.png b/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman_eyes.png new file mode 100644 index 0000000..0804402 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/enderman/enderman_eyes.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/experience_orb.png b/build/resources/patchedMc/assets/minecraft/textures/entity/experience_orb.png new file mode 100644 index 0000000..92f9d0f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/experience_orb.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/explosion.png b/build/resources/patchedMc/assets/minecraft/textures/entity/explosion.png new file mode 100644 index 0000000..c309409 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/explosion.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast.png b/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast.png new file mode 100644 index 0000000..dd63bc1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast_shooting.png b/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast_shooting.png new file mode 100644 index 0000000..5d9be29 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/ghast/ghast_shooting.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png new file mode 100644 index 0000000..39068f2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png new file mode 100644 index 0000000..4a0786d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png new file mode 100644 index 0000000..533b2dd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/donkey.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/donkey.png new file mode 100644 index 0000000..b94bc63 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/donkey.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_black.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_black.png new file mode 100644 index 0000000..dde716e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_brown.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_brown.png new file mode 100644 index 0000000..ec0158f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_chestnut.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_chestnut.png new file mode 100644 index 0000000..40322ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_chestnut.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_creamy.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_creamy.png new file mode 100644 index 0000000..bc42bcc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_creamy.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_darkbrown.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_darkbrown.png new file mode 100644 index 0000000..b38e914 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_darkbrown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_gray.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_gray.png new file mode 100644 index 0000000..4987532 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png new file mode 100644 index 0000000..7320648 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_white.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_white.png new file mode 100644 index 0000000..b1f0a69 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png new file mode 100644 index 0000000..20e1954 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png new file mode 100644 index 0000000..baa2c06 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_skeleton.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_skeleton.png new file mode 100644 index 0000000..29d4ed5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_skeleton.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_white.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_white.png new file mode 100644 index 0000000..e90e6e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_zombie.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_zombie.png new file mode 100644 index 0000000..22d55fa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/horse_zombie.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/horse/mule.png b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/mule.png new file mode 100644 index 0000000..241bdaa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/horse/mule.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/iron_golem.png b/build/resources/patchedMc/assets/minecraft/textures/entity/iron_golem.png new file mode 100644 index 0000000..f9f6465 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/iron_golem.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/lead_knot.png b/build/resources/patchedMc/assets/minecraft/textures/entity/lead_knot.png new file mode 100644 index 0000000..ab4d3b3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/lead_knot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/minecart.png b/build/resources/patchedMc/assets/minecraft/textures/entity/minecart.png new file mode 100644 index 0000000..7ad7b54 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/minecart.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig.png b/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig.png new file mode 100644 index 0000000..0a9532f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig_saddle.png b/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig_saddle.png new file mode 100644 index 0000000..640ea76 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/pig/pig_saddle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep.png b/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep.png new file mode 100644 index 0000000..d9fe93f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep_fur.png b/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep_fur.png new file mode 100644 index 0000000..623340b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/sheep/sheep_fur.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/sign.png b/build/resources/patchedMc/assets/minecraft/textures/entity/sign.png new file mode 100644 index 0000000..e22e2f7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/sign.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/silverfish.png b/build/resources/patchedMc/assets/minecraft/textures/entity/silverfish.png new file mode 100644 index 0000000..416fa16 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/silverfish.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/skeleton.png b/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/skeleton.png new file mode 100644 index 0000000..184b585 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/skeleton.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/wither_skeleton.png b/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/wither_skeleton.png new file mode 100644 index 0000000..b0db19d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/skeleton/wither_skeleton.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/slime/magmacube.png b/build/resources/patchedMc/assets/minecraft/textures/entity/slime/magmacube.png new file mode 100644 index 0000000..c1b397f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/slime/magmacube.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/slime/slime.png b/build/resources/patchedMc/assets/minecraft/textures/entity/slime/slime.png new file mode 100644 index 0000000..96edcf6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/slime/slime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/snowman.png b/build/resources/patchedMc/assets/minecraft/textures/entity/snowman.png new file mode 100644 index 0000000..568d5f6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/snowman.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/spider/cave_spider.png b/build/resources/patchedMc/assets/minecraft/textures/entity/spider/cave_spider.png new file mode 100644 index 0000000..934f1ea Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/spider/cave_spider.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/spider/spider.png b/build/resources/patchedMc/assets/minecraft/textures/entity/spider/spider.png new file mode 100644 index 0000000..3a8c779 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/spider/spider.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/spider_eyes.png b/build/resources/patchedMc/assets/minecraft/textures/entity/spider_eyes.png new file mode 100644 index 0000000..6b80a06 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/spider_eyes.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/squid.png b/build/resources/patchedMc/assets/minecraft/textures/entity/squid.png new file mode 100644 index 0000000..f285388 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/squid.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/steve.png b/build/resources/patchedMc/assets/minecraft/textures/entity/steve.png new file mode 100644 index 0000000..6650185 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/steve.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/butcher.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/butcher.png new file mode 100644 index 0000000..f1c07d4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/butcher.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/farmer.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/farmer.png new file mode 100644 index 0000000..970c179 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/farmer.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/librarian.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/librarian.png new file mode 100644 index 0000000..b071cd3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/librarian.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/priest.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/priest.png new file mode 100644 index 0000000..35054ce Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/priest.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/smith.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/smith.png new file mode 100644 index 0000000..965da7f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/smith.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/villager/villager.png b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/villager.png new file mode 100644 index 0000000..52de8e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/villager/villager.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/witch.png b/build/resources/patchedMc/assets/minecraft/textures/entity/witch.png new file mode 100644 index 0000000..2403570 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/witch.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither.png new file mode 100644 index 0000000..0882d05 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_armor.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_armor.png new file mode 100644 index 0000000..a6b5cf5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_armor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_invulnerable.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_invulnerable.png new file mode 100644 index 0000000..717750b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wither/wither_invulnerable.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf.png new file mode 100644 index 0000000..f37ef81 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_angry.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_angry.png new file mode 100644 index 0000000..7891ce9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_angry.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_collar.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_collar.png new file mode 100644 index 0000000..ae1c920 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_collar.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_tame.png b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_tame.png new file mode 100644 index 0000000..f1236d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/wolf/wolf_tame.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie.png b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie.png new file mode 100644 index 0000000..22ff8f9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie_villager.png b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie_villager.png new file mode 100644 index 0000000..349f9c2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie/zombie_villager.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/entity/zombie_pigman.png b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie_pigman.png new file mode 100644 index 0000000..e95cc4c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/entity/zombie_pigman.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/clouds.png b/build/resources/patchedMc/assets/minecraft/textures/environment/clouds.png new file mode 100644 index 0000000..a67c44d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/clouds.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/end_sky.png b/build/resources/patchedMc/assets/minecraft/textures/environment/end_sky.png new file mode 100644 index 0000000..094b309 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/end_sky.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/moon_phases.png b/build/resources/patchedMc/assets/minecraft/textures/environment/moon_phases.png new file mode 100644 index 0000000..cdba8d1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/moon_phases.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/rain.png b/build/resources/patchedMc/assets/minecraft/textures/environment/rain.png new file mode 100644 index 0000000..2dc4b1c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/rain.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/snow.png b/build/resources/patchedMc/assets/minecraft/textures/environment/snow.png new file mode 100644 index 0000000..1898903 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/snow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/environment/sun.png b/build/resources/patchedMc/assets/minecraft/textures/environment/sun.png new file mode 100644 index 0000000..08de644 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/environment/sun.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/ascii.png b/build/resources/patchedMc/assets/minecraft/textures/font/ascii.png new file mode 100644 index 0000000..587966d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/ascii.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/ascii_sga.png b/build/resources/patchedMc/assets/minecraft/textures/font/ascii_sga.png new file mode 100644 index 0000000..f443b4a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/ascii_sga.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_00.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_00.png new file mode 100644 index 0000000..44fd12f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_00.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_01.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_01.png new file mode 100644 index 0000000..ddac030 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_01.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_02.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_02.png new file mode 100644 index 0000000..dc1335a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_02.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_03.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_03.png new file mode 100644 index 0000000..6ff0257 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_03.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_04.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_04.png new file mode 100644 index 0000000..be3e833 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_04.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_05.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_05.png new file mode 100644 index 0000000..9b58804 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_05.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_06.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_06.png new file mode 100644 index 0000000..ed74e78 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_06.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_07.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_07.png new file mode 100644 index 0000000..b532177 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_07.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_09.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_09.png new file mode 100644 index 0000000..083b911 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_09.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0a.png new file mode 100644 index 0000000..0190c11 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0b.png new file mode 100644 index 0000000..4d0af48 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0c.png new file mode 100644 index 0000000..773297d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0d.png new file mode 100644 index 0000000..5f52231 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0e.png new file mode 100644 index 0000000..531ca7d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0f.png new file mode 100644 index 0000000..7b879fc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_0f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_10.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_10.png new file mode 100644 index 0000000..53f056c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_10.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_11.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_11.png new file mode 100644 index 0000000..a9d5c11 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_11.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_12.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_12.png new file mode 100644 index 0000000..d20a864 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_12.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_13.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_13.png new file mode 100644 index 0000000..bbb0641 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_13.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_14.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_14.png new file mode 100644 index 0000000..ffd8e42 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_14.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_15.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_15.png new file mode 100644 index 0000000..ccfcae6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_15.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_16.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_16.png new file mode 100644 index 0000000..d02c557 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_16.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_17.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_17.png new file mode 100644 index 0000000..fed5b6e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_17.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_18.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_18.png new file mode 100644 index 0000000..97394d0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_18.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_19.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_19.png new file mode 100644 index 0000000..6929413 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_19.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1a.png new file mode 100644 index 0000000..d3a1b98 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1b.png new file mode 100644 index 0000000..9e0adf7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1c.png new file mode 100644 index 0000000..14d4890 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1d.png new file mode 100644 index 0000000..1924226 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1e.png new file mode 100644 index 0000000..cce20e3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1f.png new file mode 100644 index 0000000..bdaf22f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_1f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_20.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_20.png new file mode 100644 index 0000000..ba948e9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_20.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_21.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_21.png new file mode 100644 index 0000000..998f2f9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_21.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_22.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_22.png new file mode 100644 index 0000000..c3fd5dd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_22.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_23.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_23.png new file mode 100644 index 0000000..9c2b2dc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_23.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_24.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_24.png new file mode 100644 index 0000000..d6cc8ae Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_24.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_25.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_25.png new file mode 100644 index 0000000..ee7535d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_25.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_26.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_26.png new file mode 100644 index 0000000..93aa960 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_26.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_27.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_27.png new file mode 100644 index 0000000..92f4501 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_27.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_28.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_28.png new file mode 100644 index 0000000..5f96e1b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_28.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_29.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_29.png new file mode 100644 index 0000000..4558220 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_29.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2a.png new file mode 100644 index 0000000..87e0e0c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2b.png new file mode 100644 index 0000000..722edf0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2c.png new file mode 100644 index 0000000..51830f7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2d.png new file mode 100644 index 0000000..dfafa53 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2e.png new file mode 100644 index 0000000..2aea04b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2f.png new file mode 100644 index 0000000..bff5f8e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_2f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_30.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_30.png new file mode 100644 index 0000000..5ccba75 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_30.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_31.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_31.png new file mode 100644 index 0000000..44fc5e5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_31.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_32.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_32.png new file mode 100644 index 0000000..4858d08 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_32.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_33.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_33.png new file mode 100644 index 0000000..ab67072 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_33.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_34.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_34.png new file mode 100644 index 0000000..fd8fca9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_34.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_35.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_35.png new file mode 100644 index 0000000..603dc02 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_35.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_36.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_36.png new file mode 100644 index 0000000..778c190 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_36.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_37.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_37.png new file mode 100644 index 0000000..3032a23 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_37.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_38.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_38.png new file mode 100644 index 0000000..9b637bd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_38.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_39.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_39.png new file mode 100644 index 0000000..2f93850 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_39.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3a.png new file mode 100644 index 0000000..cdf4944 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3b.png new file mode 100644 index 0000000..10e8502 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3c.png new file mode 100644 index 0000000..022fea5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3d.png new file mode 100644 index 0000000..01ea1d1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3e.png new file mode 100644 index 0000000..3bdf7f8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3f.png new file mode 100644 index 0000000..3fd5249 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_3f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_40.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_40.png new file mode 100644 index 0000000..544f89e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_40.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_41.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_41.png new file mode 100644 index 0000000..729fdaf Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_41.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_42.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_42.png new file mode 100644 index 0000000..755e546 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_42.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_43.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_43.png new file mode 100644 index 0000000..6069d0d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_43.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_44.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_44.png new file mode 100644 index 0000000..845c364 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_44.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_45.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_45.png new file mode 100644 index 0000000..294c78d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_45.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_46.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_46.png new file mode 100644 index 0000000..ee5e629 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_46.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_47.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_47.png new file mode 100644 index 0000000..55cb0c0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_47.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_48.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_48.png new file mode 100644 index 0000000..7652211 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_48.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_49.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_49.png new file mode 100644 index 0000000..b736232 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_49.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4a.png new file mode 100644 index 0000000..d3419bd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4b.png new file mode 100644 index 0000000..5e02ad3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4c.png new file mode 100644 index 0000000..11c6b31 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4d.png new file mode 100644 index 0000000..3eb224a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4e.png new file mode 100644 index 0000000..11a78ba Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4f.png new file mode 100644 index 0000000..b4c9fab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_4f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_50.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_50.png new file mode 100644 index 0000000..ff73d23 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_50.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_51.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_51.png new file mode 100644 index 0000000..6e0eae9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_51.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_52.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_52.png new file mode 100644 index 0000000..6f10fcb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_52.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_53.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_53.png new file mode 100644 index 0000000..60d478e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_53.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_54.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_54.png new file mode 100644 index 0000000..ac75bdd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_54.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_55.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_55.png new file mode 100644 index 0000000..3d122d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_55.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_56.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_56.png new file mode 100644 index 0000000..576d07f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_56.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_57.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_57.png new file mode 100644 index 0000000..545da73 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_57.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_58.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_58.png new file mode 100644 index 0000000..941542e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_58.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_59.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_59.png new file mode 100644 index 0000000..56f0102 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_59.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5a.png new file mode 100644 index 0000000..c14f1b1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5b.png new file mode 100644 index 0000000..f418e4c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5c.png new file mode 100644 index 0000000..e7efae6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5d.png new file mode 100644 index 0000000..7355fd3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5e.png new file mode 100644 index 0000000..abfd3af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5f.png new file mode 100644 index 0000000..5a64b50 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_5f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_60.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_60.png new file mode 100644 index 0000000..8166f15 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_60.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_61.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_61.png new file mode 100644 index 0000000..d11cd8a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_61.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_62.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_62.png new file mode 100644 index 0000000..f7b9a5b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_62.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_63.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_63.png new file mode 100644 index 0000000..5d4a8cc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_63.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_64.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_64.png new file mode 100644 index 0000000..bc43210 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_64.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_65.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_65.png new file mode 100644 index 0000000..42144c1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_65.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_66.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_66.png new file mode 100644 index 0000000..a65f25e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_66.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_67.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_67.png new file mode 100644 index 0000000..a115bb8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_67.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_68.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_68.png new file mode 100644 index 0000000..d47938b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_68.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_69.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_69.png new file mode 100644 index 0000000..c36e640 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_69.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6a.png new file mode 100644 index 0000000..5265d07 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6b.png new file mode 100644 index 0000000..6f207cc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6c.png new file mode 100644 index 0000000..6ffad7e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6d.png new file mode 100644 index 0000000..0fa88e3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6e.png new file mode 100644 index 0000000..301513e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6f.png new file mode 100644 index 0000000..a24cfff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_6f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_70.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_70.png new file mode 100644 index 0000000..2cec746 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_70.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_71.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_71.png new file mode 100644 index 0000000..1592ff4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_71.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_72.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_72.png new file mode 100644 index 0000000..856eedc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_72.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_73.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_73.png new file mode 100644 index 0000000..a7a2151 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_73.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_74.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_74.png new file mode 100644 index 0000000..a1b034a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_74.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_75.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_75.png new file mode 100644 index 0000000..512dc16 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_75.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_76.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_76.png new file mode 100644 index 0000000..12a45ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_76.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_77.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_77.png new file mode 100644 index 0000000..d763fba Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_77.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_78.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_78.png new file mode 100644 index 0000000..846c060 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_78.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_79.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_79.png new file mode 100644 index 0000000..f887cae Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_79.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7a.png new file mode 100644 index 0000000..90d5561 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7b.png new file mode 100644 index 0000000..2932cee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7c.png new file mode 100644 index 0000000..416a21b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7d.png new file mode 100644 index 0000000..2e12e13 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7e.png new file mode 100644 index 0000000..952bfab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7f.png new file mode 100644 index 0000000..d3d275c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_7f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_80.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_80.png new file mode 100644 index 0000000..044ac3e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_80.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_81.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_81.png new file mode 100644 index 0000000..913a4ca Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_81.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_82.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_82.png new file mode 100644 index 0000000..19b8ded Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_82.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_83.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_83.png new file mode 100644 index 0000000..ef2d794 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_83.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_84.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_84.png new file mode 100644 index 0000000..74a6a53 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_84.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_85.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_85.png new file mode 100644 index 0000000..73cb2f9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_85.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_86.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_86.png new file mode 100644 index 0000000..135d6fc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_86.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_87.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_87.png new file mode 100644 index 0000000..bef88db Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_87.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_88.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_88.png new file mode 100644 index 0000000..698ff80 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_88.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_89.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_89.png new file mode 100644 index 0000000..a3820ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_89.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8a.png new file mode 100644 index 0000000..beb9024 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8b.png new file mode 100644 index 0000000..7f978ab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8c.png new file mode 100644 index 0000000..3ed4594 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8d.png new file mode 100644 index 0000000..8d79123 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8e.png new file mode 100644 index 0000000..d82000b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8f.png new file mode 100644 index 0000000..b8c8328 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_8f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_90.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_90.png new file mode 100644 index 0000000..132974b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_90.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_91.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_91.png new file mode 100644 index 0000000..b8e09ae Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_91.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_92.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_92.png new file mode 100644 index 0000000..9244661 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_92.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_93.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_93.png new file mode 100644 index 0000000..f71d835 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_93.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_94.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_94.png new file mode 100644 index 0000000..fa68d81 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_94.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_95.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_95.png new file mode 100644 index 0000000..346bc36 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_95.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_96.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_96.png new file mode 100644 index 0000000..bbd1772 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_96.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_97.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_97.png new file mode 100644 index 0000000..2fd136b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_97.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_98.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_98.png new file mode 100644 index 0000000..9319c0b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_98.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_99.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_99.png new file mode 100644 index 0000000..2bb7f3e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_99.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9a.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9a.png new file mode 100644 index 0000000..cbdd91e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9a.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9b.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9b.png new file mode 100644 index 0000000..8a96209 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9b.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9c.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9c.png new file mode 100644 index 0000000..8e977ff Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9c.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9d.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9d.png new file mode 100644 index 0000000..5041d6a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9d.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9e.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9e.png new file mode 100644 index 0000000..1cb0a5b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9e.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9f.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9f.png new file mode 100644 index 0000000..d987326 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_9f.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a0.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a0.png new file mode 100644 index 0000000..8c47db0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a1.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a1.png new file mode 100644 index 0000000..5ede7e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a2.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a2.png new file mode 100644 index 0000000..a8c6ac1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a3.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a3.png new file mode 100644 index 0000000..7cc8448 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a4.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a4.png new file mode 100644 index 0000000..dc00e27 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a5.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a5.png new file mode 100644 index 0000000..eccfa47 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a6.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a6.png new file mode 100644 index 0000000..dcac87f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a7.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a7.png new file mode 100644 index 0000000..76c1ce2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a8.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a8.png new file mode 100644 index 0000000..a022390 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a8.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a9.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a9.png new file mode 100644 index 0000000..a35159a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_a9.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_aa.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_aa.png new file mode 100644 index 0000000..da1b615 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_aa.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ab.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ab.png new file mode 100644 index 0000000..0e45eae Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ab.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ac.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ac.png new file mode 100644 index 0000000..04d4d59 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ac.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ad.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ad.png new file mode 100644 index 0000000..3834337 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ad.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ae.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ae.png new file mode 100644 index 0000000..1445e68 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ae.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_af.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_af.png new file mode 100644 index 0000000..ea945dc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_af.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b0.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b0.png new file mode 100644 index 0000000..84b4885 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b1.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b1.png new file mode 100644 index 0000000..5f64672 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b2.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b2.png new file mode 100644 index 0000000..8551db8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b3.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b3.png new file mode 100644 index 0000000..b954159 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b4.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b4.png new file mode 100644 index 0000000..65991a4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b5.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b5.png new file mode 100644 index 0000000..3e6391b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b6.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b6.png new file mode 100644 index 0000000..df7c0f7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b7.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b7.png new file mode 100644 index 0000000..9142cad Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b8.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b8.png new file mode 100644 index 0000000..5b18d12 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b8.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b9.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b9.png new file mode 100644 index 0000000..0d212f0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_b9.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ba.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ba.png new file mode 100644 index 0000000..696cca9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ba.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bb.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bb.png new file mode 100644 index 0000000..5a2544c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bb.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bc.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bc.png new file mode 100644 index 0000000..df37526 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bc.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bd.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bd.png new file mode 100644 index 0000000..aed7803 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bd.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_be.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_be.png new file mode 100644 index 0000000..0da2254 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_be.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bf.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bf.png new file mode 100644 index 0000000..1f6a248 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_bf.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c0.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c0.png new file mode 100644 index 0000000..0610d67 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c1.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c1.png new file mode 100644 index 0000000..a95ca9b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c2.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c2.png new file mode 100644 index 0000000..f6a8961 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c3.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c3.png new file mode 100644 index 0000000..6470dd8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c4.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c4.png new file mode 100644 index 0000000..e8c3105 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c5.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c5.png new file mode 100644 index 0000000..d89f288 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c6.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c6.png new file mode 100644 index 0000000..004091d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c7.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c7.png new file mode 100644 index 0000000..f64f6b4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c8.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c8.png new file mode 100644 index 0000000..75f8a50 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c8.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c9.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c9.png new file mode 100644 index 0000000..fbd9435 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_c9.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ca.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ca.png new file mode 100644 index 0000000..112b9c6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ca.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cb.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cb.png new file mode 100644 index 0000000..c0549b5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cb.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cc.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cc.png new file mode 100644 index 0000000..0684431 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cc.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cd.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cd.png new file mode 100644 index 0000000..9fdc54d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cd.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ce.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ce.png new file mode 100644 index 0000000..958a96b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ce.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cf.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cf.png new file mode 100644 index 0000000..4106f1b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_cf.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d0.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d0.png new file mode 100644 index 0000000..546b014 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d1.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d1.png new file mode 100644 index 0000000..6d67bf1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d2.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d2.png new file mode 100644 index 0000000..c4ae511 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d3.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d3.png new file mode 100644 index 0000000..576c9ea Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d4.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d4.png new file mode 100644 index 0000000..14be6c7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d5.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d5.png new file mode 100644 index 0000000..3c41836 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d6.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d6.png new file mode 100644 index 0000000..27424b1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d6.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d7.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d7.png new file mode 100644 index 0000000..d8772d8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_d7.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_f9.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_f9.png new file mode 100644 index 0000000..e723235 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_f9.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fa.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fa.png new file mode 100644 index 0000000..d78dcfe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fa.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fb.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fb.png new file mode 100644 index 0000000..5423c86 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fb.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fc.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fc.png new file mode 100644 index 0000000..8034140 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fc.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fd.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fd.png new file mode 100644 index 0000000..c31bd6f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fd.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fe.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fe.png new file mode 100644 index 0000000..42ed33e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_fe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ff.png b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ff.png new file mode 100644 index 0000000..f0ff742 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/font/unicode_page_ff.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_background.png b/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_background.png new file mode 100644 index 0000000..921bce0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_background.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_icons.png b/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_icons.png new file mode 100644 index 0000000..8c4ae79 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/achievement/achievement_icons.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/book.png b/build/resources/patchedMc/assets/minecraft/textures/gui/book.png new file mode 100644 index 0000000..3e4ba4e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/book.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/anvil.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/anvil.png new file mode 100644 index 0000000..34e8f9f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/anvil.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/beacon.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/beacon.png new file mode 100644 index 0000000..f51a2ef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/beacon.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/brewing_stand.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/brewing_stand.png new file mode 100644 index 0000000..e7dc203 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/brewing_stand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/crafting_table.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/crafting_table.png new file mode 100644 index 0000000..254dacc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/crafting_table.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png new file mode 100644 index 0000000..c8d53a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png new file mode 100644 index 0000000..cc250e5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png new file mode 100644 index 0000000..38421f7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tabs.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tabs.png new file mode 100644 index 0000000..1c44093 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/creative_inventory/tabs.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/dispenser.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/dispenser.png new file mode 100644 index 0000000..0a6ebe7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/dispenser.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/enchanting_table.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/enchanting_table.png new file mode 100644 index 0000000..59aeb04 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/enchanting_table.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/furnace.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/furnace.png new file mode 100644 index 0000000..2255d0a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/furnace.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/generic_54.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/generic_54.png new file mode 100644 index 0000000..0b880ef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/generic_54.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/hopper.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/hopper.png new file mode 100644 index 0000000..3d00547 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/hopper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/horse.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/horse.png new file mode 100644 index 0000000..194cc6b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/horse.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/inventory.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/inventory.png new file mode 100644 index 0000000..d553c4f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/inventory.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/stats_icons.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/stats_icons.png new file mode 100644 index 0000000..f13323b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/stats_icons.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/container/villager.png b/build/resources/patchedMc/assets/minecraft/textures/gui/container/villager.png new file mode 100644 index 0000000..3211a7a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/container/villager.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/demo_background.png b/build/resources/patchedMc/assets/minecraft/textures/gui/demo_background.png new file mode 100644 index 0000000..a7fd8be Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/demo_background.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/icons.png b/build/resources/patchedMc/assets/minecraft/textures/gui/icons.png new file mode 100644 index 0000000..8aec716 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/icons.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/options_background.png b/build/resources/patchedMc/assets/minecraft/textures/gui/options_background.png new file mode 100644 index 0000000..cae5528 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/options_background.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/resource_packs.png b/build/resources/patchedMc/assets/minecraft/textures/gui/resource_packs.png new file mode 100644 index 0000000..15a80bd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/resource_packs.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/stream_indicator.png b/build/resources/patchedMc/assets/minecraft/textures/gui/stream_indicator.png new file mode 100644 index 0000000..b426b7e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/stream_indicator.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_0.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_0.png new file mode 100644 index 0000000..27f015d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_1.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_1.png new file mode 100644 index 0000000..c16841a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_2.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_2.png new file mode 100644 index 0000000..0436d77 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_3.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_3.png new file mode 100644 index 0000000..2c7ad77 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_3.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_4.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_4.png new file mode 100644 index 0000000..0390096 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_4.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_5.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_5.png new file mode 100644 index 0000000..0331ad4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/background/panorama_5.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/minecraft.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/minecraft.png new file mode 100644 index 0000000..b393bd9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/minecraft.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/title/mojang.png b/build/resources/patchedMc/assets/minecraft/textures/gui/title/mojang.png new file mode 100644 index 0000000..a82cf6c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/title/mojang.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/gui/widgets.png b/build/resources/patchedMc/assets/minecraft/textures/gui/widgets.png new file mode 100644 index 0000000..e1194d4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/gui/widgets.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/apple.png b/build/resources/patchedMc/assets/minecraft/textures/items/apple.png new file mode 100644 index 0000000..3e2ee59 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/apple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/apple_golden.png b/build/resources/patchedMc/assets/minecraft/textures/items/apple_golden.png new file mode 100644 index 0000000..6201989 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/apple_golden.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/arrow.png b/build/resources/patchedMc/assets/minecraft/textures/items/arrow.png new file mode 100644 index 0000000..4f748a0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/arrow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bed.png b/build/resources/patchedMc/assets/minecraft/textures/items/bed.png new file mode 100644 index 0000000..22a4cf0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bed.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/beef_cooked.png b/build/resources/patchedMc/assets/minecraft/textures/items/beef_cooked.png new file mode 100644 index 0000000..a1c765a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/beef_cooked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/beef_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/beef_raw.png new file mode 100644 index 0000000..82af4e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/beef_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/blaze_powder.png b/build/resources/patchedMc/assets/minecraft/textures/items/blaze_powder.png new file mode 100644 index 0000000..89c57d6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/blaze_powder.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/blaze_rod.png b/build/resources/patchedMc/assets/minecraft/textures/items/blaze_rod.png new file mode 100644 index 0000000..7050e10 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/blaze_rod.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/boat.png b/build/resources/patchedMc/assets/minecraft/textures/items/boat.png new file mode 100644 index 0000000..235e0a2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/boat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bone.png b/build/resources/patchedMc/assets/minecraft/textures/items/bone.png new file mode 100644 index 0000000..3faca89 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bone.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/book_enchanted.png b/build/resources/patchedMc/assets/minecraft/textures/items/book_enchanted.png new file mode 100644 index 0000000..44215f6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/book_enchanted.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/book_normal.png b/build/resources/patchedMc/assets/minecraft/textures/items/book_normal.png new file mode 100644 index 0000000..f791ae4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/book_normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/book_writable.png b/build/resources/patchedMc/assets/minecraft/textures/items/book_writable.png new file mode 100644 index 0000000..fa95246 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/book_writable.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/book_written.png b/build/resources/patchedMc/assets/minecraft/textures/items/book_written.png new file mode 100644 index 0000000..b2a2aa8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/book_written.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_0.png b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_0.png new file mode 100644 index 0000000..2022aab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_0.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_1.png b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_1.png new file mode 100644 index 0000000..a132079 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_2.png b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_2.png new file mode 100644 index 0000000..d459e68 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bow_pulling_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bow_standby.png b/build/resources/patchedMc/assets/minecraft/textures/items/bow_standby.png new file mode 100644 index 0000000..d709b9c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bow_standby.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bowl.png b/build/resources/patchedMc/assets/minecraft/textures/items/bowl.png new file mode 100644 index 0000000..63d16ad Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bowl.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bread.png b/build/resources/patchedMc/assets/minecraft/textures/items/bread.png new file mode 100644 index 0000000..c833604 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bread.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/brewing_stand.png b/build/resources/patchedMc/assets/minecraft/textures/items/brewing_stand.png new file mode 100644 index 0000000..97db9af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/brewing_stand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/brick.png b/build/resources/patchedMc/assets/minecraft/textures/items/brick.png new file mode 100644 index 0000000..11e74be Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/brick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bucket_empty.png b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_empty.png new file mode 100644 index 0000000..f8e5369 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_empty.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bucket_lava.png b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_lava.png new file mode 100644 index 0000000..13a1957 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_lava.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bucket_milk.png b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_milk.png new file mode 100644 index 0000000..c77d92c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_milk.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/bucket_water.png b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_water.png new file mode 100644 index 0000000..2f36acc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/bucket_water.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/cake.png b/build/resources/patchedMc/assets/minecraft/textures/items/cake.png new file mode 100644 index 0000000..46e94b8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/cake.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/carrot.png b/build/resources/patchedMc/assets/minecraft/textures/items/carrot.png new file mode 100644 index 0000000..2d08aab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/carrot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/carrot_golden.png b/build/resources/patchedMc/assets/minecraft/textures/items/carrot_golden.png new file mode 100644 index 0000000..e0f1ea6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/carrot_golden.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/carrot_on_a_stick.png b/build/resources/patchedMc/assets/minecraft/textures/items/carrot_on_a_stick.png new file mode 100644 index 0000000..9e88571 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/carrot_on_a_stick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/cauldron.png b/build/resources/patchedMc/assets/minecraft/textures/items/cauldron.png new file mode 100644 index 0000000..e3186eb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/cauldron.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_boots.png new file mode 100644 index 0000000..54a4a15 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_chestplate.png new file mode 100644 index 0000000..cd2115a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_helmet.png new file mode 100644 index 0000000..a143338 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_leggings.png new file mode 100644 index 0000000..dae4b26 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chainmail_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/charcoal.png b/build/resources/patchedMc/assets/minecraft/textures/items/charcoal.png new file mode 100644 index 0000000..20d5b25 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/charcoal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chicken_cooked.png b/build/resources/patchedMc/assets/minecraft/textures/items/chicken_cooked.png new file mode 100644 index 0000000..890b5b3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chicken_cooked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/chicken_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/chicken_raw.png new file mode 100644 index 0000000..6d25922 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/chicken_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/clay_ball.png b/build/resources/patchedMc/assets/minecraft/textures/items/clay_ball.png new file mode 100644 index 0000000..5103d6c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/clay_ball.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/clock.png b/build/resources/patchedMc/assets/minecraft/textures/items/clock.png new file mode 100644 index 0000000..069a0ab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/clock.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/clock.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/items/clock.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/items/clock.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/coal.png b/build/resources/patchedMc/assets/minecraft/textures/items/coal.png new file mode 100644 index 0000000..5563b6f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/coal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/comparator.png b/build/resources/patchedMc/assets/minecraft/textures/items/comparator.png new file mode 100644 index 0000000..28b8eec Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/comparator.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/compass.png b/build/resources/patchedMc/assets/minecraft/textures/items/compass.png new file mode 100644 index 0000000..9dcbdfe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/compass.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/compass.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/items/compass.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/items/compass.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/cookie.png b/build/resources/patchedMc/assets/minecraft/textures/items/cookie.png new file mode 100644 index 0000000..01fe56b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/cookie.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond.png new file mode 100644 index 0000000..10e70a0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_axe.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_axe.png new file mode 100644 index 0000000..7627f87 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_axe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_boots.png new file mode 100644 index 0000000..70d9e5f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_chestplate.png new file mode 100644 index 0000000..afdff93 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_helmet.png new file mode 100644 index 0000000..1c88592 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_hoe.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_hoe.png new file mode 100644 index 0000000..c9a97e0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_hoe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_horse_armor.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_horse_armor.png new file mode 100644 index 0000000..b281aad Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_horse_armor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_leggings.png new file mode 100644 index 0000000..a99c896 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_pickaxe.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_pickaxe.png new file mode 100644 index 0000000..c279828 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_pickaxe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_shovel.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_shovel.png new file mode 100644 index 0000000..e4a8992 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_shovel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/diamond_sword.png b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_sword.png new file mode 100644 index 0000000..2a1552d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/diamond_sword.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/door_iron.png b/build/resources/patchedMc/assets/minecraft/textures/items/door_iron.png new file mode 100644 index 0000000..67877ab Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/door_iron.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/door_wood.png b/build/resources/patchedMc/assets/minecraft/textures/items/door_wood.png new file mode 100644 index 0000000..750307f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/door_wood.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_black.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_black.png new file mode 100644 index 0000000..909bea5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_black.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_blue.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_blue.png new file mode 100644 index 0000000..4713983 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_brown.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_brown.png new file mode 100644 index 0000000..62eae8d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_brown.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_cyan.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_cyan.png new file mode 100644 index 0000000..7b10c11 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_cyan.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_gray.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_gray.png new file mode 100644 index 0000000..4fce7e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_gray.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_green.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_green.png new file mode 100644 index 0000000..009e058 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_green.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_light_blue.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_light_blue.png new file mode 100644 index 0000000..a8b45c9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_light_blue.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_lime.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_lime.png new file mode 100644 index 0000000..7a78764 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_lime.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_magenta.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_magenta.png new file mode 100644 index 0000000..ea7342a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_magenta.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_orange.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_orange.png new file mode 100644 index 0000000..677a1aa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_orange.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_pink.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_pink.png new file mode 100644 index 0000000..1acc483 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_pink.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_purple.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_purple.png new file mode 100644 index 0000000..7d201c2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_purple.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_red.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_red.png new file mode 100644 index 0000000..2d1a742 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_red.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_silver.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_silver.png new file mode 100644 index 0000000..fa9e501 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_silver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_white.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_white.png new file mode 100644 index 0000000..5b1833b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_white.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_yellow.png b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_yellow.png new file mode 100644 index 0000000..95e0673 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/dye_powder_yellow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/egg.png b/build/resources/patchedMc/assets/minecraft/textures/items/egg.png new file mode 100644 index 0000000..a6fe2bf Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/egg.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/emerald.png b/build/resources/patchedMc/assets/minecraft/textures/items/emerald.png new file mode 100644 index 0000000..98d953e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/emerald.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_boots.png new file mode 100644 index 0000000..fd7e05f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_chestplate.png new file mode 100644 index 0000000..6e632b9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_helmet.png new file mode 100644 index 0000000..3a455f3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_leggings.png new file mode 100644 index 0000000..28b2c49 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/empty_armor_slot_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/ender_eye.png b/build/resources/patchedMc/assets/minecraft/textures/items/ender_eye.png new file mode 100644 index 0000000..8c4ef4e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/ender_eye.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/ender_pearl.png b/build/resources/patchedMc/assets/minecraft/textures/items/ender_pearl.png new file mode 100644 index 0000000..4b752a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/ender_pearl.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/experience_bottle.png b/build/resources/patchedMc/assets/minecraft/textures/items/experience_bottle.png new file mode 100644 index 0000000..ae4214f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/experience_bottle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/feather.png b/build/resources/patchedMc/assets/minecraft/textures/items/feather.png new file mode 100644 index 0000000..d4c3be5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/feather.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fireball.png b/build/resources/patchedMc/assets/minecraft/textures/items/fireball.png new file mode 100644 index 0000000..d62a6f4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fireball.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fireworks.png b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks.png new file mode 100644 index 0000000..f1e07fd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge.png b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge.png new file mode 100644 index 0000000..43a4a21 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge_overlay.png new file mode 100644 index 0000000..d8b91a9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fireworks_charge_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_clownfish_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_clownfish_raw.png new file mode 100644 index 0000000..41df72f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_clownfish_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_cooked.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_cooked.png new file mode 100644 index 0000000..87564c7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_cooked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_raw.png new file mode 100644 index 0000000..32996bf Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_cod_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_pufferfish_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_pufferfish_raw.png new file mode 100644 index 0000000..aadbd88 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_pufferfish_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_cooked.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_cooked.png new file mode 100644 index 0000000..fb765ed Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_cooked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_raw.png new file mode 100644 index 0000000..68bcd69 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fish_salmon_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_cast.png b/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_cast.png new file mode 100644 index 0000000..a5ab378 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_cast.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_uncast.png b/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_uncast.png new file mode 100644 index 0000000..d4b53f0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/fishing_rod_uncast.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/flint.png b/build/resources/patchedMc/assets/minecraft/textures/items/flint.png new file mode 100644 index 0000000..5f51093 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/flint.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/flint_and_steel.png b/build/resources/patchedMc/assets/minecraft/textures/items/flint_and_steel.png new file mode 100644 index 0000000..77bc340 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/flint_and_steel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/flower_pot.png b/build/resources/patchedMc/assets/minecraft/textures/items/flower_pot.png new file mode 100644 index 0000000..c4f26d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/flower_pot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/ghast_tear.png b/build/resources/patchedMc/assets/minecraft/textures/items/ghast_tear.png new file mode 100644 index 0000000..e5c741f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/ghast_tear.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/glowstone_dust.png b/build/resources/patchedMc/assets/minecraft/textures/items/glowstone_dust.png new file mode 100644 index 0000000..edd93a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/glowstone_dust.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_axe.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_axe.png new file mode 100644 index 0000000..0f47b60 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_axe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_boots.png new file mode 100644 index 0000000..f6033d2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_chestplate.png new file mode 100644 index 0000000..e36076a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_helmet.png new file mode 100644 index 0000000..9eb89a0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_hoe.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_hoe.png new file mode 100644 index 0000000..1685d47 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_hoe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_horse_armor.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_horse_armor.png new file mode 100644 index 0000000..7c5c3a5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_horse_armor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_ingot.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_ingot.png new file mode 100644 index 0000000..ea781e7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_ingot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_leggings.png new file mode 100644 index 0000000..da23771 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_nugget.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_nugget.png new file mode 100644 index 0000000..3a9a2fe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_nugget.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_pickaxe.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_pickaxe.png new file mode 100644 index 0000000..ecccafe Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_pickaxe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_shovel.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_shovel.png new file mode 100644 index 0000000..150cbb9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_shovel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gold_sword.png b/build/resources/patchedMc/assets/minecraft/textures/items/gold_sword.png new file mode 100644 index 0000000..0ddef04 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gold_sword.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/gunpowder.png b/build/resources/patchedMc/assets/minecraft/textures/items/gunpowder.png new file mode 100644 index 0000000..73cadec Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/gunpowder.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/hopper.png b/build/resources/patchedMc/assets/minecraft/textures/items/hopper.png new file mode 100644 index 0000000..f8b244f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/hopper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_axe.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_axe.png new file mode 100644 index 0000000..8bf133e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_axe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_boots.png new file mode 100644 index 0000000..b69ca05 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_chestplate.png new file mode 100644 index 0000000..e7993ce Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_helmet.png new file mode 100644 index 0000000..65e64cc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_hoe.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_hoe.png new file mode 100644 index 0000000..28d4c36 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_hoe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_horse_armor.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_horse_armor.png new file mode 100644 index 0000000..5d697d1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_horse_armor.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_ingot.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_ingot.png new file mode 100644 index 0000000..3833fa0 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_ingot.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_leggings.png new file mode 100644 index 0000000..ad53673 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_pickaxe.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_pickaxe.png new file mode 100644 index 0000000..d21440b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_pickaxe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_shovel.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_shovel.png new file mode 100644 index 0000000..079b236 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_shovel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/iron_sword.png b/build/resources/patchedMc/assets/minecraft/textures/items/iron_sword.png new file mode 100644 index 0000000..4d49c5a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/iron_sword.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/item_frame.png b/build/resources/patchedMc/assets/minecraft/textures/items/item_frame.png new file mode 100644 index 0000000..261c98a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/item_frame.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/lead.png b/build/resources/patchedMc/assets/minecraft/textures/items/lead.png new file mode 100644 index 0000000..0ef5312 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/lead.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather.png new file mode 100644 index 0000000..13dc199 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots.png new file mode 100644 index 0000000..31c2132 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots_overlay.png new file mode 100644 index 0000000..b6896d8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_boots_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate.png new file mode 100644 index 0000000..e534aef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate_overlay.png new file mode 100644 index 0000000..125fd34 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_chestplate_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet.png new file mode 100644 index 0000000..da2cfa8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet_overlay.png new file mode 100644 index 0000000..8040d77 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_helmet_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings.png new file mode 100644 index 0000000..3ff24ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings_overlay.png new file mode 100644 index 0000000..813ba26 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/leather_leggings_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/magma_cream.png b/build/resources/patchedMc/assets/minecraft/textures/items/magma_cream.png new file mode 100644 index 0000000..b2be210 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/magma_cream.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/map_empty.png b/build/resources/patchedMc/assets/minecraft/textures/items/map_empty.png new file mode 100644 index 0000000..8dc6e58 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/map_empty.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/map_filled.png b/build/resources/patchedMc/assets/minecraft/textures/items/map_filled.png new file mode 100644 index 0000000..1381e21 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/map_filled.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/melon.png b/build/resources/patchedMc/assets/minecraft/textures/items/melon.png new file mode 100644 index 0000000..590f47a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/melon.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/melon_speckled.png b/build/resources/patchedMc/assets/minecraft/textures/items/melon_speckled.png new file mode 100644 index 0000000..dee1bf5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/melon_speckled.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_chest.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_chest.png new file mode 100644 index 0000000..78a3778 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_chest.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_command_block.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_command_block.png new file mode 100644 index 0000000..c597ee7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_command_block.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_furnace.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_furnace.png new file mode 100644 index 0000000..5478f25 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_furnace.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_hopper.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_hopper.png new file mode 100644 index 0000000..8a138fb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_hopper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_normal.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_normal.png new file mode 100644 index 0000000..2046f2b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_normal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/minecart_tnt.png b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_tnt.png new file mode 100644 index 0000000..561279b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/minecart_tnt.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/mushroom_stew.png b/build/resources/patchedMc/assets/minecraft/textures/items/mushroom_stew.png new file mode 100644 index 0000000..5598bc7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/mushroom_stew.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/name_tag.png b/build/resources/patchedMc/assets/minecraft/textures/items/name_tag.png new file mode 100644 index 0000000..a88f559 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/name_tag.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/nether_star.png b/build/resources/patchedMc/assets/minecraft/textures/items/nether_star.png new file mode 100644 index 0000000..6b848af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/nether_star.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/nether_wart.png b/build/resources/patchedMc/assets/minecraft/textures/items/nether_wart.png new file mode 100644 index 0000000..09da1e3 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/nether_wart.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/netherbrick.png b/build/resources/patchedMc/assets/minecraft/textures/items/netherbrick.png new file mode 100644 index 0000000..e9c14ed Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/netherbrick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/painting.png b/build/resources/patchedMc/assets/minecraft/textures/items/painting.png new file mode 100644 index 0000000..b394f30 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/painting.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/paper.png b/build/resources/patchedMc/assets/minecraft/textures/items/paper.png new file mode 100644 index 0000000..a1d9c7e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/paper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_cooked.png b/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_cooked.png new file mode 100644 index 0000000..605d3f5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_cooked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_raw.png b/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_raw.png new file mode 100644 index 0000000..7e83c1a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/porkchop_raw.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potato.png b/build/resources/patchedMc/assets/minecraft/textures/items/potato.png new file mode 100644 index 0000000..c1d8541 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potato.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potato_baked.png b/build/resources/patchedMc/assets/minecraft/textures/items/potato_baked.png new file mode 100644 index 0000000..e4d765b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potato_baked.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potato_poisonous.png b/build/resources/patchedMc/assets/minecraft/textures/items/potato_poisonous.png new file mode 100644 index 0000000..6f154af Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potato_poisonous.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_drinkable.png b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_drinkable.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_drinkable.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_empty.png b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_empty.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_empty.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_splash.png b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_splash.png new file mode 100644 index 0000000..03b1f90 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potion_bottle_splash.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/potion_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/potion_overlay.png new file mode 100644 index 0000000..1e6165e Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/potion_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/pumpkin_pie.png b/build/resources/patchedMc/assets/minecraft/textures/items/pumpkin_pie.png new file mode 100644 index 0000000..c21a032 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/pumpkin_pie.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/quartz.png b/build/resources/patchedMc/assets/minecraft/textures/items/quartz.png new file mode 100644 index 0000000..e403446 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/quartz.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/quiver.png b/build/resources/patchedMc/assets/minecraft/textures/items/quiver.png new file mode 100644 index 0000000..818f728 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/quiver.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_11.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_11.png new file mode 100644 index 0000000..07ac487 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_11.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_13.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_13.png new file mode 100644 index 0000000..ead0c61 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_13.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_blocks.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_blocks.png new file mode 100644 index 0000000..3732d6c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_blocks.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_cat.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_cat.png new file mode 100644 index 0000000..b3527ef Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_cat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_chirp.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_chirp.png new file mode 100644 index 0000000..1b24e11 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_chirp.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_far.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_far.png new file mode 100644 index 0000000..2320efd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_far.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_mall.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_mall.png new file mode 100644 index 0000000..811d046 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_mall.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_mellohi.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_mellohi.png new file mode 100644 index 0000000..879b6a4 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_mellohi.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_stal.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_stal.png new file mode 100644 index 0000000..c650d21 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_stal.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_strad.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_strad.png new file mode 100644 index 0000000..72d6e32 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_strad.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_wait.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_wait.png new file mode 100644 index 0000000..5306b51 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_wait.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/record_ward.png b/build/resources/patchedMc/assets/minecraft/textures/items/record_ward.png new file mode 100644 index 0000000..b33b93d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/record_ward.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/redstone_dust.png b/build/resources/patchedMc/assets/minecraft/textures/items/redstone_dust.png new file mode 100644 index 0000000..6da938b Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/redstone_dust.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/reeds.png b/build/resources/patchedMc/assets/minecraft/textures/items/reeds.png new file mode 100644 index 0000000..40872c6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/reeds.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/repeater.png b/build/resources/patchedMc/assets/minecraft/textures/items/repeater.png new file mode 100644 index 0000000..7a07381 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/repeater.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/rotten_flesh.png b/build/resources/patchedMc/assets/minecraft/textures/items/rotten_flesh.png new file mode 100644 index 0000000..3f39998 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/rotten_flesh.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/ruby.png b/build/resources/patchedMc/assets/minecraft/textures/items/ruby.png new file mode 100644 index 0000000..4f288d9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/ruby.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/saddle.png b/build/resources/patchedMc/assets/minecraft/textures/items/saddle.png new file mode 100644 index 0000000..b12eafa Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/saddle.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/seeds_melon.png b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_melon.png new file mode 100644 index 0000000..ef84499 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_melon.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/seeds_pumpkin.png b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_pumpkin.png new file mode 100644 index 0000000..8d8f076 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_pumpkin.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/seeds_wheat.png b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_wheat.png new file mode 100644 index 0000000..83d23a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/seeds_wheat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/shears.png b/build/resources/patchedMc/assets/minecraft/textures/items/shears.png new file mode 100644 index 0000000..f9c6de1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/shears.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/sign.png b/build/resources/patchedMc/assets/minecraft/textures/items/sign.png new file mode 100644 index 0000000..9b6e2ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/sign.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/skull_creeper.png b/build/resources/patchedMc/assets/minecraft/textures/items/skull_creeper.png new file mode 100644 index 0000000..c195fd5 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/skull_creeper.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/skull_skeleton.png b/build/resources/patchedMc/assets/minecraft/textures/items/skull_skeleton.png new file mode 100644 index 0000000..bf383fc Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/skull_skeleton.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/skull_steve.png b/build/resources/patchedMc/assets/minecraft/textures/items/skull_steve.png new file mode 100644 index 0000000..e56f406 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/skull_steve.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/skull_wither.png b/build/resources/patchedMc/assets/minecraft/textures/items/skull_wither.png new file mode 100644 index 0000000..3571603 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/skull_wither.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/skull_zombie.png b/build/resources/patchedMc/assets/minecraft/textures/items/skull_zombie.png new file mode 100644 index 0000000..67d1347 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/skull_zombie.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/slimeball.png b/build/resources/patchedMc/assets/minecraft/textures/items/slimeball.png new file mode 100644 index 0000000..46478ee Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/slimeball.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/snowball.png b/build/resources/patchedMc/assets/minecraft/textures/items/snowball.png new file mode 100644 index 0000000..340c639 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/snowball.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg.png b/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg.png new file mode 100644 index 0000000..23259c7 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg_overlay.png new file mode 100644 index 0000000..83ec78f Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/spawn_egg_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye.png b/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye.png new file mode 100644 index 0000000..35d8584 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye_fermented.png b/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye_fermented.png new file mode 100644 index 0000000..226ffb8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/spider_eye_fermented.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stick.png b/build/resources/patchedMc/assets/minecraft/textures/items/stick.png new file mode 100644 index 0000000..6f8ce13 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stick.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stone_axe.png b/build/resources/patchedMc/assets/minecraft/textures/items/stone_axe.png new file mode 100644 index 0000000..fb33584 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stone_axe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stone_hoe.png b/build/resources/patchedMc/assets/minecraft/textures/items/stone_hoe.png new file mode 100644 index 0000000..d46b272 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stone_hoe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stone_pickaxe.png b/build/resources/patchedMc/assets/minecraft/textures/items/stone_pickaxe.png new file mode 100644 index 0000000..19a8e50 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stone_pickaxe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stone_shovel.png b/build/resources/patchedMc/assets/minecraft/textures/items/stone_shovel.png new file mode 100644 index 0000000..8e1c0c2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stone_shovel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/stone_sword.png b/build/resources/patchedMc/assets/minecraft/textures/items/stone_sword.png new file mode 100644 index 0000000..5810dfd Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/stone_sword.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/string.png b/build/resources/patchedMc/assets/minecraft/textures/items/string.png new file mode 100644 index 0000000..0b04ddb Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/string.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/sugar.png b/build/resources/patchedMc/assets/minecraft/textures/items/sugar.png new file mode 100644 index 0000000..0864df9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/sugar.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wheat.png b/build/resources/patchedMc/assets/minecraft/textures/items/wheat.png new file mode 100644 index 0000000..bbd2fd9 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wheat.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wood_axe.png b/build/resources/patchedMc/assets/minecraft/textures/items/wood_axe.png new file mode 100644 index 0000000..3a19203 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wood_axe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wood_hoe.png b/build/resources/patchedMc/assets/minecraft/textures/items/wood_hoe.png new file mode 100644 index 0000000..de1c7a6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wood_hoe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wood_pickaxe.png b/build/resources/patchedMc/assets/minecraft/textures/items/wood_pickaxe.png new file mode 100644 index 0000000..ebc6756 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wood_pickaxe.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wood_shovel.png b/build/resources/patchedMc/assets/minecraft/textures/items/wood_shovel.png new file mode 100644 index 0000000..b057911 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wood_shovel.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/items/wood_sword.png b/build/resources/patchedMc/assets/minecraft/textures/items/wood_sword.png new file mode 100644 index 0000000..c04dc0a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/items/wood_sword.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/map/map_background.png b/build/resources/patchedMc/assets/minecraft/textures/map/map_background.png new file mode 100644 index 0000000..2783b50 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/map/map_background.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/map/map_icons.png b/build/resources/patchedMc/assets/minecraft/textures/map/map_icons.png new file mode 100644 index 0000000..c2f35b8 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/map/map_icons.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png b/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png new file mode 100644 index 0000000..f9ca97c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta new file mode 100644 index 0000000..e38a5ad --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta @@ -0,0 +1,5 @@ +{ + "texture": { + "blur": true + } +} diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png b/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png new file mode 100644 index 0000000..d9725ce Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png b/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png new file mode 100644 index 0000000..b09fd47 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png.mcmeta new file mode 100644 index 0000000..8c6c7d1 --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/misc/shadow.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "clamp": true + } +} + diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/underwater.png b/build/resources/patchedMc/assets/minecraft/textures/misc/underwater.png new file mode 100644 index 0000000..2fc23b1 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/underwater.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/unknown_pack.png b/build/resources/patchedMc/assets/minecraft/textures/misc/unknown_pack.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/unknown_pack.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png b/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png new file mode 100644 index 0000000..9c14e2d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png.mcmeta b/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/build/resources/patchedMc/assets/minecraft/textures/misc/vignette.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_1.png new file mode 100644 index 0000000..9f84c18 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_2.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_2.png new file mode 100644 index 0000000..117811c Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/chainmail_layer_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_1.png new file mode 100644 index 0000000..14fecf2 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_2.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_2.png new file mode 100644 index 0000000..2cca056 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/diamond_layer_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_1.png new file mode 100644 index 0000000..6802e06 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_2.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_2.png new file mode 100644 index 0000000..a7cf835 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/gold_layer_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_1.png new file mode 100644 index 0000000..6da6e84 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_2.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_2.png new file mode 100644 index 0000000..fab422a Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/iron_layer_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1.png new file mode 100644 index 0000000..ebcfc41 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png new file mode 100644 index 0000000..546397d Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2.png new file mode 100644 index 0000000..8d8bba6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png new file mode 100644 index 0000000..5655659 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png b/build/resources/patchedMc/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png new file mode 100644 index 0000000..d7df7f6 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/particle/footprint.png b/build/resources/patchedMc/assets/minecraft/textures/particle/footprint.png new file mode 100644 index 0000000..8d23f64 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/particle/footprint.png differ diff --git a/build/resources/patchedMc/assets/minecraft/textures/particle/particles.png b/build/resources/patchedMc/assets/minecraft/textures/particle/particles.png new file mode 100644 index 0000000..eec1f89 Binary files /dev/null and b/build/resources/patchedMc/assets/minecraft/textures/particle/particles.png differ diff --git a/build/resources/patchedMc/deobfuscation_data-1.7.10.lzma b/build/resources/patchedMc/deobfuscation_data-1.7.10.lzma new file mode 100644 index 0000000..c451403 Binary files /dev/null and b/build/resources/patchedMc/deobfuscation_data-1.7.10.lzma differ diff --git a/build/resources/patchedMc/fml_at.cfg b/build/resources/patchedMc/fml_at.cfg new file mode 100644 index 0000000..58fda4c --- /dev/null +++ b/build/resources/patchedMc/fml_at.cfg @@ -0,0 +1,118 @@ +#Main FML Access Transformer configuration file +# TileEntity addMapping +public net.minecraft.tileentity.TileEntity func_145826_a(Ljava/lang/Class;Ljava/lang/String;)V +# EntityList addMappings +public net.minecraft.entity.EntityList func_75618_a(Ljava/lang/Class;Ljava/lang/String;I)V +public net.minecraft.entity.EntityList func_75614_a(Ljava/lang/Class;Ljava/lang/String;III)V +public net.minecraft.entity.EntityList field_75625_b #nameToClassMap +public net.minecraft.entity.EntityList field_75626_c #classToNameMap +public net.minecraft.entity.EntityList field_75623_d #idToClassMap +## RenderManager +public net.minecraft.client.renderer.entity.RenderManager field_78729_o #renderers +## RenderBlocks - everything +public net.minecraft.client.renderer.RenderBlocks * # all fields +public net.minecraft.client.renderer.RenderBlocks *() # all methods +##RenderPlayer +##public-f bht.h #FD:RenderPlayer/field_77110_j #armorlist # -- MISSING MAPPING +##RenderBiped +public-f net.minecraft.client.renderer.entity.RenderBiped field_82424_k #armorlist +##StringTranslate +##public bp.b #FD:StringTranslate/field_74815_b # -- MISSING MAPPING +##public bp.e #FD:StringTranslate/field_74813_d # -- MISSING MAPPING +## TileEntityRendererDispatcher +public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher field_147559_m +## CraftingManager - make the add recipe methods public +public net.minecraft.item.crafting.CraftingManager func_92103_a(Lnet.minecraft.item.ItemStack;[Ljava/lang/Object;)Lnet.minecraft.item.crafting.ShapedRecipes; +public net.minecraft.item.crafting.CraftingManager func_77596_b(Lnet.minecraft.item.ItemStack;[Ljava/lang/Object;)V +## WeightedRandomItem +public net.minecraft.util.WeightedRandom$Item field_76292_a #probability +## ItemStack +##public+f tv.c #FD:ItemStack/field_77993_c #itemId +## StatBase +#public ku.a #FD:StatBase/field_75978_a #statName +## NetLoginHandler +#public jy.a(Ljy;Z)Z #MD:NetLoginHandler/func_72531_a #'complete connection' +#public jy.g #FD:NetLoginHandler/field_72543_h #userName +## EntityPlayerMP getNextWindowId +public net.minecraft.entity.player.EntityPlayerMP func_71117_bO()V +public net.minecraft.entity.player.EntityPlayerMP field_71139_cq +## EntityAITaskEntry +public net.minecraft.entity.ai.EntityAITasks$EntityAITaskEntry +## EntityAITasks +#public pt.a #FD:EntityAITasks/field_75782_a #taskList +## BlockChest +#public ank.m(Labw;III)Z #MD:BlockChest/func_72292_n #isOcelotBlockingChest +## EntityLiving +##public ng.aU #FD:EntityLiving/field_70736_aM #carryoverDamage # -- MISSING MAPPING +public net.minecraft.entity.EntityLiving field_70714_bg #tasks +public net.minecraft.entity.EntityLiving field_70715_bh #targetTasks +##public ng.bG #FD:EntityLiving/field_70703_bu #isJumping # -- MISSING MAPPING +## EntityAIOcelotSit +#protected qg.a(Labw;III)Z #MD:EntityAIOcelotSit/func_75398_a #nearestSittableBlock +#protected qg.f()Z #MD:EntityAIOcelotSit/func_75399_f #isblocksittable +## CallableMinecraftVersion - sanity check the MC version +#public c #CL:CallableMinecraftVersion +#public c.(Lb;)V #MD:CallableMinecraftVersion/(Lnet/minecraft/src/CrashReport;) #constructor +## EntityAnimal +#public rp.bp #FD:EntityAnimal/field_70881_d #inLove +## WorldType +#public acg.(ILjava/lang/String;)V #MD:WorldType/(ILjava/lang/String;) +#public acg.(ILjava/lang/String;I)V #MD:WorldType/(ILjava/lang/String;I) +## ComponentVillage +#public ajm #CL:ComponentVillage +## StructureStart +#public aiv.a #FD:StructureStart/field_75075_a +## EntityVillager - minmax lists +public net.minecraft.entity.passive.EntityVillager func_146091_a(Lnet/minecraft/village/MerchantRecipeList;Lnet/minecraft/item/Item;Ljava/util/Random;F)V # buy +public net.minecraft.entity.passive.EntityVillager func_146089_b(Lnet/minecraft/village/MerchantRecipeList;Lnet/minecraft/item/Item;Ljava/util/Random;F)V # sell +public net.minecraft.entity.passive.EntityVillager field_70958_bB +public net.minecraft.entity.passive.EntityVillager field_70960_bC +## GuiButtonMerchant +#public axx #CL:GuiButtonMerchant +# GuiScreen +public net.minecraft.client.gui.GuiScreen field_146297_k # minecraft instance - public because gui's outside access it +# Minecraft +#public atv.D #FD:Minecraft/field_71425_J #running +public net.minecraft.client.Minecraft field_71446_o # textureManager +public net.minecraft.client.Minecraft field_110450_ap # mcDefaultResourcePack +public net.minecraft.client.Minecraft func_71370_a(II)V # resize +public net.minecraft.client.Minecraft func_71357_I()V # loadScreen +## ItemBlock +public net.minecraft.item.ItemBlock field_150939_a +## DedicatedServer +public net.minecraft.server.dedicated.DedicatedServer field_71341_l # pendingCommandList +## SaveFormatOld +public net.minecraft.world.storage.SaveFormatOld field_75808_a # savesDirectory + +protected net.minecraft.util.ObjectIntIdentityMap field_148749_a # internal map +protected net.minecraft.util.ObjectIntIdentityMap field_148748_b # internal index list +protected-f net.minecraft.util.RegistryNamespaced field_148759_a # identitymap +protected net.minecraft.util.RegistryNamespaced func_148755_c(Ljava/lang/String;)Ljava/lang/String; # prefix if necessary + +# GuiButton +public net.minecraft.client.gui.GuiButton field_146120_f # width - needed for config GUI stuff +public net.minecraft.client.gui.GuiButton field_146121_g # height - needed for config GUI stuff +# GuiTextField +public-f net.minecraft.client.gui.GuiTextField field_146209_f # xPosition - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146210_g # yPosition - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146218_h # width - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146219_i # height - needed for config GUI stuff +# GuiSlot +public net.minecraft.client.gui.GuiSlot field_148149_f # slotHeight - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148151_d # right - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148152_e # left - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148153_b # top - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148154_c # bottom - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148155_a # width - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148158_l # height - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148160_j # headerPadding - needed for config GUI stuff + +# Font renderer +protected net.minecraft.client.gui.FontRenderer field_78288_b # FONT_HEIGHT +protected net.minecraft.client.gui.FontRenderer field_78286_d # charWidth +protected net.minecraft.client.gui.FontRenderer field_78287_e # glyphWidth +protected net.minecraft.client.gui.FontRenderer field_111273_g # locationFontTexture +protected net.minecraft.client.gui.FontRenderer field_78295_j # posX +protected net.minecraft.client.gui.FontRenderer field_78296_k # posY +protected net.minecraft.client.gui.FontRenderer func_78266_a(IZ)F # renderDefaultChar +protected net.minecraft.client.gui.FontRenderer func_78277_a(CZ)F # renderUnicodeChar diff --git a/build/resources/patchedMc/fml_marker.cfg b/build/resources/patchedMc/fml_marker.cfg new file mode 100644 index 0000000..bfd4e92 --- /dev/null +++ b/build/resources/patchedMc/fml_marker.cfg @@ -0,0 +1,3 @@ +# Marker interfaces to add to minecraft - helps in bukkit and client/server unification +# Only runs at runtime because it's not necessary at compile time +# has deobf and obf mappings so it runs OK in mcp diff --git a/build/resources/patchedMc/fmlversion.properties b/build/resources/patchedMc/fmlversion.properties new file mode 100644 index 0000000..fa4de18 --- /dev/null +++ b/build/resources/patchedMc/fmlversion.properties @@ -0,0 +1,6 @@ +fmlbuild.major.number=7 +fmlbuild.minor.number=99 +fmlbuild.revision.number=40 +fmlbuild.build.number=1614 +fmlbuild.mcversion=1.7.10 +fmlbuild.mcpversion=9.05 diff --git a/build/resources/patchedMc/forge_at.cfg b/build/resources/patchedMc/forge_at.cfg new file mode 100644 index 0000000..06028ee --- /dev/null +++ b/build/resources/patchedMc/forge_at.cfg @@ -0,0 +1,191 @@ +#Main Forge Access Transformer configuration file +# Tessellator +#public-f bfq.a #FD:Tessellator/field_78398_a #instance +#public bfq.u #FD:Tessellator/field_78409_u #drawMode +#public bfq.v #FD:Tessellator/field_78408_v #xOffset +#public bfq.w #FD:Tessellator/field_78407_w #yOffset +#public bfq.x #FD:Tessellator/field_78417_x #zOffset +#public bfq.z #FD:Tessellator/field_78415_z #isDrawing +# EntityFishHook +public net.minecraft.entity.projectile.EntityFishHook field_146041_e +public net.minecraft.entity.projectile.EntityFishHook field_146036_f +public net.minecraft.entity.projectile.EntityFishHook field_146039_d +# ItemPickaxe +public net.minecraft.item.ItemPickaxe (Lnet.minecraft.item.Item$ToolMaterial;) +public net.minecraft.item.ItemAxe (Lnet.minecraft.item.Item$ToolMaterial;) +public net.minecraft.item.ItemSpade (Lnet.minecraft.item.Item$ToolMaterial;) +# ItemTool +#public xj.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial +#public xj.d #FD:ItemTool/field_77865_bY #damageVsEntity +# EntityEnderman +#public tg.br #FD:EntityEnderman/field_70827_d #carriableBlocks +# RenderGlobal +#public bfl.k #FD:RenderGlobal/field_72769_h #theWorld +#public bfl.l #FD:RenderGlobal/field_72770_i #renderEngine +#public bfl.t #FD:RenderGlobal/field_72777_q #mc +#public bfl.u #FD:RenderGlobal/field_72776_r #globalRenderBlocks +#public bfl.H #FD:RenderGlobal/field_72738_E #damagedBlocks +# SoundManager +public net.minecraft.client.audio.SoundManager field_148622_c #sndHandler +# EntityMinecart +#protected st.* #FD:EntityMinecart/* # All private -> protected +# Block +public net.minecraft.block.Block (Lnet/minecraft/src/Material;)V +public net.minecraft.block.Block func_149658_d(Ljava/lang/String;)Lnet.minecraft.block.Block; #setIconName +public net.minecraft.block.Block func_149672_a(Lnet.minecraft.block.Block$SoundType;)Lnet.minecraft.block.Block; #setStepSound +public net.minecraft.block.Block func_149752_b(F)Lnet.minecraft.block.Block; #setResistance +public net.minecraft.block.Block func_149711_c(F)Lnet.minecraft.block.Block; #setHardness +public net.minecraft.block.Block func_149713_g(I)Lnet.minecraft.block.Block; #setLightOpacity +public net.minecraft.block.Block func_149715_a(F)Lnet.minecraft.block.Block; #setLightValue +public net.minecraft.block.Block func_149722_s()Lnet.minecraft.block.Block; #setBlockUnbreakable +public net.minecraft.block.Block func_149675_a(Z)Lnet.minecraft.block.Block; #setTickRandomly +public net.minecraft.block.Block func_149676_a(FFFFFF)V #setBlockBounds +public net.minecraft.block.Block func_149657_c(Lnet/minecraft/world/World;IIII)V # dropXpOnBlockBreak +# NetServerHandler +#public ka.f #FD:NetServerHandler/field_72572_g #playerInAirTime +# TileEntity +#public asp.k #FD:TileEntity/field_70331_k #worldObj +# BlockLeavesBase +#public arh.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel +# Item +public net.minecraft.item.Item func_77656_e(I)Lnet.minecraft.item.Item; #setMaxDamage +public-f net.minecraft.item.Item func_77650_f(Lnet.minecraft.item.ItemStack;)Lnet.minecraft.util.IIcon; #getIcon is Final for unknown reason +public net.minecraft.item.Item func_77627_a(Z)Lnet.minecraft.item.Item; #setHasSubtypes +public net.minecraft.item.Item func_77631_c(Ljava.lang.String;)Lnet.minecraft.item.Item; #setPotionEffect +public net.minecraft.item.Item func_111206_d(Ljava.lang.String;)Lnet.minecraft.item.Item; #setTextureName +# RailLogic +#public amz #CL:BlockBaseRailLogic +#public amz.a()I #MD:BlockBaseRailLogic/func_94505_a #getNAdjacentTiles +# EntityPlayer +public net.minecraft.entity.player.EntityPlayer func_71012_a(Lnet/minecraft/entity/item/EntityItem;)V #joinEntityItemWithWorld +public net.minecraft.client.entity.EntityClientPlayerMP func_71012_a(Lnet/minecraft/entity/item/EntityItem;)V #joinEntityItemWithWorld +public net.minecraft.entity.player.EntityPlayer func_71053_j()V #closeScreen +#public uf.b #FD:EntityPlayer/field_71076_b #sleepTimer +# World Gen Chests Related +public net.minecraft.util.WeightedRandomChestContent * +public net.minecraft.world.WorldServer field_73069_S +public net.minecraft.world.gen.structure.StructureMineshaftPieces field_78818_a +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$DesertPyramid field_74941_i +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$JunglePyramid field_74943_l +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$JunglePyramid field_74944_m +public net.minecraft.world.gen.structure.StructureStrongholdPieces$ChestCorridor field_75003_a +public net.minecraft.world.gen.structure.StructureStrongholdPieces$Library field_75007_b +public net.minecraft.world.gen.structure.StructureStrongholdPieces$RoomCrossing field_75014_c +public net.minecraft.world.gen.structure.StructureVillagePieces$House2 field_74918_a +public net.minecraft.world.gen.feature.WorldGenDungeons field_111189_a +# Save Location +public net.minecraft.world.chunk.storage.AnvilChunkLoader field_75825_d # chunkSaveLocation +public net.minecraft.world.gen.ChunkProviderServer field_73247_e # currentChunkLoader +# PlayerManager +#public jp.a(IIZ)Ljq; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher +# PlayerInstance +#public jq #CL:PlayerInstance +# World +public-f net.minecraft.world.World field_72982_D #villageCollectionObj +#public abw.G #FD:World/field_72993_I #activeChunkSet +# EntityLiving +#public og.b #FD:EntityLiving/field_70728_aV #experienceValue +#public og.d #FD:EntityLiving/field_70715_bh #targetTasks +# GuiFlatPresets +#public avz.a(Ljava/lang/String;ILacq;Ljava/util/List;[Lagd;)V #MD:GuiFlatPresets/func_82294_a +#public avz.a(Ljava/lang/String;ILacq;[Lagd;)V #MD:GuiFlatPresets/func_82297_a +# BiomeGenBase +public net.minecraft.world.biome.BiomeGenBase *() #Everything protected->public +public net.minecraft.world.biome.BiomeGenForest *() +public net.minecraft.world.biome.BiomeGenHills *() +public net.minecraft.world.biome.BiomeGenMesa *() +public net.minecraft.world.biome.BiomeGenPlains *() +public net.minecraft.world.biome.BiomeGenSavanna *() +public net.minecraft.world.biome.BiomeGenSnow *() +public net.minecraft.world.biome.BiomeGenTaiga *() +# Map Gen Biome Lists +public+f net.minecraft.world.gen.structure.MapGenStronghold field_151546_e +# MapGenVillage +public-f net.minecraft.world.gen.structure.MapGenVillage field_75055_e #villageSpawnBiomes +# ShapedRecipes +public+f net.minecraft.item.crafting.ShapedRecipes field_77574_d #recipeItems +public+f net.minecraft.item.crafting.ShapedRecipes field_77576_b #recipeWidth +public+f net.minecraft.item.crafting.ShapedRecipes field_77577_c #recipeHeight +# ShapelessRecipes +public net.minecraft.item.crafting.ShapelessRecipes field_77579_b #recipeItems +# GuiContainer +#protected awy.a(Lwe;)V #MD:GuiContainer/func_74192_a #drawSlotInventory +# ContainerPlayer +#protected vv.h #FD:ContainerPlayer/field_82862_h #player +# ContainerRepair +public net.minecraft.inventory.ContainerRepair field_82856_l #ContainerRepair/stackSizeToBeUsedInRepair +# BlockButton +#protected anf.n(Labw;III)V #MD:BlockButton/func_82535_o #checkActivation +#protected-f anf.a #FD:BlockButton/field_82537_a #sensible +# BiomeDecorator +public net.minecraft.world.biome.BiomeDecorator * +# CreativeTabs +public-f net.minecraft.creativetab.CreativeTabs field_78032_a # creativeTabArray non-final +# Packet +#public ey.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping +# SaveHandler +#public alq.b()Ljava/io/File; #MD:SaveHandler/func_75765_b +# World stuff +public net.minecraft.world.World field_73003_n #prevRainingStrength +public net.minecraft.world.World field_73004_o #rainingStrength +public net.minecraft.world.World field_73017_q #thunderingStrength +public net.minecraft.world.World field_73018_p #prevThunderingStrength +public net.minecraft.world.World func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.world.World func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +public net.minecraft.world.WorldServer func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.world.WorldServer func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +public net.minecraft.client.multiplayer.WorldClient func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.client.multiplayer.WorldClient func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +# WorldServer +#public js.N #FD:WorldServer/field_73068_P #allPlayersSleeping +# TextureMap +#public bik.g #FD:TextureMap/field_94255_a +#public bik.h #FD:TextureMap/field_94254_c +# Potion +#public ni.b(II)Lni; #MD:Potion/func_76399_b #setIconIndex +# PotionHelper +#public zp.m #FD:PotionHelper/field_77927_l #potionRequirements +#public zp.n #FD:PotionHelper/field_77928_m #potionAmplifiers +# PotionEffect +#public nj.b #FD:PotionEffect/field_76460_b #duration +# BlockFluid +#protected apc.a #FD:BlockFluid/field_94425_a #theIcon +# GuiIngame +protected net.minecraft.client.gui.GuiIngame * +protected net.minecraft.client.gui.GuiIngame *() +# ItemStack +default net.minecraft.item.ItemStack field_77991_e +# GuiSlot +#protected awg.b(IIII)V #MD:GuiSlot/func_77206_b #overlayBackground +# EntityPlayer +#public uf.bu #FD:EntityPlayer/field_71092_bJ #username +# MapGenStructureIO +public net.minecraft.world.gen.structure.MapGenStructureIO func_143034_b(Ljava/lang/Class;Ljava/lang/String;)V # registerStart +public net.minecraft.world.gen.structure.MapGenStructureIO func_143031_a(Ljava/lang/Class;Ljava/lang/String;)V # registerPiece +# Stronghold +public net.minecraft.world.gen.structure.StructureStrongholdPieces$Stronghold +# Packets +public net.minecraft.network.play.server.S23PacketBlockChange field_148883_d # Block +public net.minecraft.network.play.server.S23PacketBlockChange field_148884_e # Metadata +# WorldType +public-f net.minecraft.world.WorldType field_77139_a #worldTypes +# DamageSource +public net.minecraft.util.DamageSource *() #All methods public, most are already +# ItemBlock +public net.minecraft.item.ItemBlock field_150939_a # block +# EntityAITasks +public net.minecraft.entity.ai.EntityAITasks field_75782_a # taskEntries +# EntityXPOrb +public net.minecraft.entity.item.EntityXPOrb field_70530_e # xpValue +# Village +public net.minecraft.world.gen.structure.StructureVillagePieces$Village +# RenderPlayer +public net.minecraft.client.renderer.entity.RenderBiped field_77071_a #modelBipedMain +public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain +public net.minecraft.client.renderer.entity.RenderPlayer field_77108_b #modelArmorChestplate +public net.minecraft.client.renderer.entity.RenderPlayer field_77111_i #modelArmor +# ChunkProviderServer +public net.minecraft.world.gen.ChunkProviderServer field_73246_d # currentChunkProvider +public net.minecraft.world.gen.ChunkProviderServer field_73244_f # loadedChunkHashMap +public net.minecraft.world.gen.ChunkProviderServer field_73245_g # loadedChunks +public net.minecraft.world.gen.ChunkProviderServer field_73251_h # worldObj diff --git a/build/resources/patchedMc/forge_logo.png b/build/resources/patchedMc/forge_logo.png new file mode 100644 index 0000000..19a02ca Binary files /dev/null and b/build/resources/patchedMc/forge_logo.png differ diff --git a/build/resources/patchedMc/lgpl-3.0.txt b/build/resources/patchedMc/lgpl-3.0.txt new file mode 100644 index 0000000..02bbb60 --- /dev/null +++ b/build/resources/patchedMc/lgpl-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/build/resources/patchedMc/log4j2.xml b/build/resources/patchedMc/log4j2.xml new file mode 100644 index 0000000..482e65a --- /dev/null +++ b/build/resources/patchedMc/log4j2.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/resources/patchedMc/mcplogo.png b/build/resources/patchedMc/mcplogo.png new file mode 100644 index 0000000..8ebae88 Binary files /dev/null and b/build/resources/patchedMc/mcplogo.png differ diff --git a/build/resources/patchedMc/mcpmod.info b/build/resources/patchedMc/mcpmod.info new file mode 100644 index 0000000..5dc569b --- /dev/null +++ b/build/resources/patchedMc/mcpmod.info @@ -0,0 +1,17 @@ +[ +{ + "modid": "mcp", + "name": "Minecraft Coder Pack", + "description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.", + "version": "9.05", + "mcversion": "1.7.10", + "logoFile": "/mcplogo.png", + "url": "http://mcp.ocean-labs.de/", + "updateUrl": "", + "authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"], + "credits": "Made by the MCP team", + "parent": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/build/resources/patchedMc/pack.png b/build/resources/patchedMc/pack.png new file mode 100644 index 0000000..cfaa986 Binary files /dev/null and b/build/resources/patchedMc/pack.png differ diff --git a/build/resources/patchedMc/packaged.exc b/build/resources/patchedMc/packaged.exc new file mode 100644 index 0000000..2601f33 --- /dev/null +++ b/build/resources/patchedMc/packaged.exc @@ -0,0 +1,19 @@ +net/minecraft/client/particle/EntityDiggingFX.(Lnet/minecraft/world/World;DDDDDDLnet/minecraft/block/Block;II)V=|p_i1234_1_,p_i1234_2_,p_i1234_4_,p_i1234_6_,p_i1234_8_,p_i1234_10_,p_i1234_12_,p_i1234_14_,p_i1234_15_,side +net/minecraft/client/renderer/ItemRenderer.renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V=|p_78443_1_,p_78443_2_,p_78443_3_,type +net/minecraft/client/renderer/RenderGlobal.drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V=|p_72717_1_,p_72717_2_,p_72717_3_ +net/minecraft/client/renderer/entity/RenderItem.renderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V=|p_77020_1_,p_77020_2_,p_77020_3_,p_77020_4_,p_77020_5_,p_77020_6_,p_77020_7_,pass +net/minecraft/client/renderer/entity/RenderItem.renderItemIntoGUI(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;IIZ)V=|p_77015_1_,p_77015_2_,p_77015_3_,p_77015_4_,p_77015_5_,renderEffect +net/minecraft/server/management/ServerConfigurationManager.transferPlayerToDimension(Lnet/minecraft/entity/player/EntityPlayerMP;ILnet/minecraft/world/Teleporter;)V=|p_72356_1_,p_72356_2_,teleporter +net/minecraft/server/management/ServerConfigurationManager.transferEntityToWorld(Lnet/minecraft/entity/Entity;ILnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraft/world/Teleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter +net/minecraft/world/World.getBiomeGenForCoordsBody(II)Lnet/minecraft/world/biome/BiomeGenBase;=|p_72807_1_,p_72807_2_ +net/minecraft/world/World.getSunBrightnessFactor(F)F=|p_72967_1_ +net/minecraft/world/World.getSunBrightnessBody(F)F=|p_72971_1_ +net/minecraft/world/World.getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/Vec3;=|p_72833_1_,p_72833_2_ +net/minecraft/world/World.drawCloudsBody(F)Lnet/minecraft/util/Vec3;=|p_72824_1_ +net/minecraft/world/World.canBlockFreezeBody(IIIZ)Z=|p_72834_1_,p_72834_2_,p_72834_3_,p_72834_4_ +net/minecraft/world/biome/BiomeGenBase.(IZ)V=|p_i1971_1_,register +net/minecraft/world/chunk/storage/AnvilChunkLoader.loadChunk__Async(Lnet/minecraft/world/World;II)[Ljava/lang/Object;=|p_75815_1_,p_75815_2_,p_75815_3_ +net/minecraft/world/chunk/storage/AnvilChunkLoader.checkedReadChunkFromNBT__Async(Lnet/minecraft/world/World;IILnet/minecraft/nbt/NBTTagCompound;)[Ljava/lang/Object;=|p_75822_1_,p_75822_2_,p_75822_3_,p_75822_4_ +net/minecraft/world/chunk/storage/AnvilChunkLoader.loadEntities(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/chunk/Chunk;)V=|p_75823_1_,p_75823_2_,chunk +net/minecraft/world/gen/ChunkProviderServer.loadChunk(II;Ljava/lang/Runnable;)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1,p_73158_2,runnable +net/minecraft/world/gen/ChunkProviderServer.originalLoadChunk(II)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1_,p_73158_2_ diff --git a/build/resources/patchedMc/packaged.srg b/build/resources/patchedMc/packaged.srg new file mode 100644 index 0000000..e8eb7d4 --- /dev/null +++ b/build/resources/patchedMc/packaged.srg @@ -0,0 +1 @@ +MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V diff --git a/build/resources/patchedMc/yggdrasil_session_pubkey.der b/build/resources/patchedMc/yggdrasil_session_pubkey.der new file mode 100644 index 0000000..9c79a3a Binary files /dev/null and b/build/resources/patchedMc/yggdrasil_session_pubkey.der differ diff --git a/build/rfg/launcher-src/GradleStart.java b/build/rfg/launcher-src/GradleStart.java new file mode 100644 index 0000000..0cda5b5 --- /dev/null +++ b/build/rfg/launcher-src/GradleStart.java @@ -0,0 +1,210 @@ +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.math.BigInteger; +import java.net.Proxy; +import java.security.DigestInputStream; +import java.security.MessageDigest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraftforge.gradle.GradleStartCommon; + +import com.google.common.base.Strings; +import com.google.common.base.Throwables; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonIOException; +import com.google.gson.JsonSyntaxException; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; + +public class GradleStart extends GradleStartCommon { + + private static final Gson GSON; + + static { + GsonBuilder builder = new GsonBuilder(); + builder.enableComplexMapKeySerialization(); + builder.setPrettyPrinting(); + GSON = builder.create(); + } + + public static void main(String[] args) throws Throwable { + // launch + (new GradleStart()).launch(args); + } + + @Override + protected String getBounceClass() { + return "net.minecraft.launchwrapper.Launch"; + } + + @Override + protected String getTweakClass() { + return "cpw.mods.fml.common.launcher.FMLTweaker"; + } + + @Override + protected void setDefaultArguments(Map argMap) { + argMap.put("version", "1.7.10"); + argMap.put("assetIndex", "1.7.10"); + argMap.put("assetsDir", "/home/shinare/.gradle/caches/retro_futura_gradle/assets"); + argMap.put("accessToken", "FML"); + argMap.put("userProperties", "{}"); + argMap.put("username", null); + argMap.put("password", null); + } + + @Override + protected void preLaunch(Map argMap, List extras) { + if (!Strings.isNullOrEmpty(argMap.get("password"))) { + GradleStartCommon.LOGGER.info("Password found, attempting login"); + attemptLogin(argMap); + } + + if (!Strings.isNullOrEmpty(argMap.get("assetIndex"))) { + setupAssets(argMap); + } + } + + private void attemptLogin(Map argMap) { + YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) new YggdrasilAuthenticationService( + Proxy.NO_PROXY, + "1").createUserAuthentication(Agent.MINECRAFT); + auth.setUsername(argMap.get("username")); + auth.setPassword(argMap.get("password")); + argMap.put("password", null); + + try { + auth.logIn(); + } catch (AuthenticationException e) { + LOGGER.error("-- Login failed! " + e.getMessage()); + throw Throwables.propagate(e); + } + + LOGGER.info("Login Succesful!"); + argMap.put("accessToken", auth.getAuthenticatedToken()); + argMap.put("uuid", auth.getSelectedProfile().getId().toString().replace("-", "")); + argMap.put("username", auth.getSelectedProfile().getName()); + // @@USERTYPE@@ + // @@USERPROP@@ + } + + private void setupAssets(Map argMap) { + if (Strings.isNullOrEmpty(argMap.get("assetsDir"))) { + throw new IllegalArgumentException( + "assetsDir is null when assetIndex is not! THIS IS BAD COMMAND LINE ARGUMENTS, fix them"); + } + File assets = new File(argMap.get("assetsDir")); + File objects = new File(assets, "objects"); + File assetIndex = new File(new File(assets, "indexes"), argMap.get("assetIndex") + ".json"); + try { + AssetIndex index = loadAssetsIndex(assetIndex); + if (!index.virtual) return; + + File assetVirtual = new File(new File(assets, "virtual"), argMap.get("assetIndex")); + argMap.put("assetsDir", assetVirtual.getAbsolutePath()); + + GradleStartCommon.LOGGER.info("Setting up virtual assets in: " + assetVirtual.getAbsolutePath()); + + Map existing = gatherFiles(assetVirtual); + + for (Map.Entry e : index.objects.entrySet()) { + String key = e.getKey(); + String hash = e.getValue().hash.toLowerCase(); + File virtual = new File(assetVirtual, key); + File source = new File(new File(objects, hash.substring(0, 2)), hash); + + if (existing.containsKey(key)) { + if (existing.get(key).equals(hash)) { + existing.remove(key); + } else { + GradleStartCommon.LOGGER.info(" " + key + ": INVALID HASH"); + virtual.delete(); + } + } else { + if (!source.exists()) { + GradleStartCommon.LOGGER.info(" " + key + ": NEW MISSING " + hash); + } else { + GradleStartCommon.LOGGER.info(" " + key + ": NEW "); + File parent = virtual.getParentFile(); + if (!parent.exists()) parent.mkdirs(); + Files.copy(source, virtual); + } + } + } + + for (String key : existing.keySet()) { + GradleStartCommon.LOGGER.info(" " + key + ": REMOVED"); + File virtual = new File(assetVirtual, key); + virtual.delete(); + } + } catch (Throwable t) { + throw Throwables.propagate(t); + } + } + + private AssetIndex loadAssetsIndex(File json) throws JsonSyntaxException, JsonIOException, IOException { + FileReader reader = new FileReader(json); + AssetIndex a = GSON.fromJson(reader, AssetIndex.class); + reader.close(); + return a; + } + + private static class AssetIndex { + + public boolean virtual = false; // sane default + public Map objects; + + public static class AssetEntry { + + public String hash; + } + } + + private String getDigest(File file) { + DigestInputStream input = null; + try { + input = new DigestInputStream(new FileInputStream(file), MessageDigest.getInstance("SHA")); + byte[] buffer = new byte[65536]; + int read; + do { + read = input.read(buffer); + } while (read > 0); + } catch (Exception ignored) { + return null; + } finally { + if (input != null) { + try { + input.close(); + } catch (Exception e) {} + } + } + return String.format("%1$040x", new BigInteger(1, input.getMessageDigest().digest())); + } + + private Map gatherFiles(File base) { + Map ret = new HashMap(); + gatherDir(ret, base, base); + return ret; + } + + private void gatherDir(Map map, File base, File target) { + if (!target.exists() || !target.isDirectory()) return; + for (File f : target.listFiles()) { + if (f.isDirectory()) { + gatherDir(map, base, f); + } else { + String path = base.toURI().relativize(f.toURI()).getPath().replace("\\", "/"); + String checksum = getDigest(f).toLowerCase(); + map.put(path, checksum); + } + } + } +} diff --git a/build/rfg/launcher-src/GradleStartServer.java b/build/rfg/launcher-src/GradleStartServer.java new file mode 100644 index 0000000..5d36f46 --- /dev/null +++ b/build/rfg/launcher-src/GradleStartServer.java @@ -0,0 +1,27 @@ +import java.util.List; +import java.util.Map; + +import net.minecraftforge.gradle.GradleStartCommon; + +public class GradleStartServer extends GradleStartCommon { + + public static void main(String[] args) throws Throwable { + (new GradleStartServer()).launch(args); + } + + @Override + protected String getTweakClass() { + return "cpw.mods.fml.common.launcher.FMLServerTweaker"; + } + + @Override + protected String getBounceClass() { + return "net.minecraft.launchwrapper.Launch"; + } + + @Override + protected void preLaunch(Map argMap, List extras) {} + + @Override + protected void setDefaultArguments(Map argMap) {} +} diff --git a/build/rfg/launcher-src/net/minecraftforge/gradle/GradleStartCommon.java b/build/rfg/launcher-src/net/minecraftforge/gradle/GradleStartCommon.java new file mode 100644 index 0000000..fccd4fc --- /dev/null +++ b/build/rfg/launcher-src/net/minecraftforge/gradle/GradleStartCommon.java @@ -0,0 +1,376 @@ +package net.minecraftforge.gradle; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +import net.minecraft.launchwrapper.IClassTransformer; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.google.common.base.Charsets; +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.io.Files; + +import joptsimple.NonOptionArgumentSpec; +import joptsimple.OptionParser; +import joptsimple.OptionSet; + +public abstract class GradleStartCommon { + + protected static Logger LOGGER = LogManager.getLogger("GradleStart"); + private static final String NO_CORE_SEARCH = "noCoreSearch"; + + private Map argMap = Maps.newHashMap(); + private List extras = Lists.newArrayList(); + + private static final File SRG_DIR = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs"); + private static final File SRG_NOTCH_SRG = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs/notch-srg.srg"); + private static final File SRG_NOTCH_MCP = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs/notch-mcp.srg"); + private static final File SRG_SRG_MCP = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs/srg-mcp.srg"); + private static final File SRG_MCP_SRG = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs/mcp-srg.srg"); + private static final File SRG_MCP_NOTCH = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/srgs/mcp-notch.srg"); + private static final File CSV_DIR = new File("/home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/conf"); + + protected abstract void setDefaultArguments(Map argMap); + + protected abstract void preLaunch(Map argMap, List extras); + + protected abstract String getBounceClass(); + + protected abstract String getTweakClass(); + + protected void launch(String[] args) throws Throwable { + if (System.getProperty("retrofuturagradle.reobfDev", "false").equals("false")) { + // DEPRECATED, use the properties below instead! + System.setProperty("net.minecraftforge.gradle.GradleStart.srgDir", SRG_DIR.getCanonicalPath()); + + // set system vars for passwords + System.setProperty("net.minecraftforge.gradle.GradleStart.srg.notch-srg", SRG_NOTCH_SRG.getCanonicalPath()); + System.setProperty("net.minecraftforge.gradle.GradleStart.srg.notch-mcp", SRG_NOTCH_MCP.getCanonicalPath()); + System.setProperty("net.minecraftforge.gradle.GradleStart.srg.srg-mcp", SRG_SRG_MCP.getCanonicalPath()); + System.setProperty("net.minecraftforge.gradle.GradleStart.srg.mcp-srg", SRG_MCP_SRG.getCanonicalPath()); + System.setProperty("net.minecraftforge.gradle.GradleStart.srg.mcp-notch", SRG_MCP_NOTCH.getCanonicalPath()); + System.setProperty("net.minecraftforge.gradle.GradleStart.csvDir", CSV_DIR.getCanonicalPath()); + } + + // set defaults! + setDefaultArguments(argMap); + + // parse stuff + parseArgs(args); + + // now send it back for prelaunch + preLaunch(argMap, extras); + + // because its the dev env. + System.setProperty("fml.ignoreInvalidMinecraftCertificates", "true"); // cant hurt. set it now. + + // coremod searching. + if (argMap.get(NO_CORE_SEARCH) == null) searchCoremods(); + else LOGGER.info("GradleStart coremod searching disabled!"); + + // now the actual launch args. + args = getArgs(); + + // clear it out + argMap = null; + extras = null; + + // launch. + System.gc(); + String bounce = getBounceClass(); // marginally faster. And we need the launch wrapper anyways. + if (bounce.endsWith("launchwrapper.Launch")) Launch.main(args); + else Class.forName(getBounceClass()).getDeclaredMethod("main", String[].class) + .invoke(null, new Object[] { args }); + } + + private String[] getArgs() { + ArrayList list = new ArrayList(22); + + for (Map.Entry e : argMap.entrySet()) { + String val = e.getValue(); + if (!Strings.isNullOrEmpty(val)) { + list.add("--" + e.getKey()); + list.add(val); + } + } + + // grab tweakClass + if (!Strings.isNullOrEmpty(getTweakClass())) { + list.add("--tweakClass"); + list.add(getTweakClass()); + } + + if (extras != null) { + list.addAll(extras); + } + + String[] out = list.toArray(new String[0]); + + // final logging. + StringBuilder b = new StringBuilder(); + b.append('['); + for (int x = 0; x < out.length; x++) { + b.append(out[x]).append(", "); + if ("--accessToken".equalsIgnoreCase(out[x])) { + b.append("{REDACTED}, "); + x++; + } + } + b.replace(b.length() - 2, b.length(), ""); + b.append(']'); + GradleStartCommon.LOGGER.info("Running with arguments: " + b.toString()); + + return out; + } + + private void parseArgs(String[] args) { + final OptionParser parser = new OptionParser(); + parser.allowsUnrecognizedOptions(); + + for (String key : argMap.keySet()) { + parser.accepts(key).withRequiredArg().ofType(String.class); + } + // accept the noCoreSearch thing + parser.accepts(NO_CORE_SEARCH); + + final NonOptionArgumentSpec nonOption = parser.nonOptions(); + + final OptionSet options = parser.parse(args); + for (String key : argMap.keySet()) { + if (options.hasArgument(key)) { + String value = (String) options.valueOf(key); + argMap.put(key, value); + if (!"password".equalsIgnoreCase(key)) LOGGER.info(key + ": " + value); + } + } + + if (options.has(NO_CORE_SEARCH)) argMap.put(NO_CORE_SEARCH, ""); + + extras = Lists.newArrayList(nonOption.values(options)); + LOGGER.info("Extra: " + extras); + } + + /* ----------- REFLECTION HELPER --------- */ + + private static final String MC_VERSION = "1.7.10"; + private static final String FML_PACK_OLD = "cpw.mods"; + private static final String FML_PACK_NEW = "net.minecraftforge"; + + @SuppressWarnings("rawtypes") + protected static Class getFmlClass(String classname) throws ClassNotFoundException { + return getFmlClass(classname, GradleStartCommon.class.getClassLoader()); + } + + @SuppressWarnings("rawtypes") + public static Class getFmlClass(String classname, ClassLoader loader) throws ClassNotFoundException { + if (!classname.startsWith("fml")) // dummy check myself + throw new IllegalArgumentException("invalid FML classname"); + + if (MC_VERSION.startsWith("1.7")) classname = FML_PACK_OLD + "." + classname; + else classname = FML_PACK_NEW + "." + classname; + + return Class.forName(classname, true, loader); + } + + /* ----------- COREMOD AND AT HACK --------- */ + + // coremod hack + private static final String COREMOD_VAR = "fml.coreMods.load"; + private static final String COREMOD_MF = "FMLCorePlugin"; + private static final String TWEAKER_MF = "TweakClass"; + // AT hack + private static final String MOD_ATD_CLASS = "fml.common.asm.transformers.ModAccessTransformer"; + private static final String MOD_AT_METHOD = "addJar"; + + public static final Map coreMap = Maps.newHashMap(); + + @SuppressWarnings("unchecked") + private void searchCoremods() throws Exception { + // intialize AT hack Method + Method atRegistrar = null; + try { + atRegistrar = getFmlClass(MOD_ATD_CLASS).getDeclaredMethod(MOD_AT_METHOD, JarFile.class); + } catch (Throwable t) {} + + final String cpString = System.getProperty("java.class.path"); + final String[] cpEntries = cpString.split(File.pathSeparator); + final Set extraTweakers = new HashSet<>(); + for (String cpEntry : cpEntries) { + File coreMod = new File(cpEntry); + Manifest manifest = null; + + if (!coreMod.exists()) continue; + + if (coreMod.isDirectory()) { + File manifestMF = new File(coreMod, "META-INF/MANIFEST.MF"); + if (manifestMF.exists()) { + FileInputStream stream = new FileInputStream(manifestMF); + manifest = new Manifest(stream); + stream.close(); + } + } else if (coreMod.getName().endsWith("jar")) // its a jar + { + JarFile jar = new JarFile(coreMod); + manifest = jar.getManifest(); + if (atRegistrar != null && manifest != null) atRegistrar.invoke(null, jar); + jar.close(); + } + + // we got the manifest? use it. + if (manifest != null) { + String clazz = manifest.getMainAttributes().getValue(COREMOD_MF); + if (!Strings.isNullOrEmpty(clazz)) { + LOGGER.info("Found and added coremod: " + clazz); + coreMap.put(clazz, coreMod); + } + final String cascadingTweaker = manifest.getMainAttributes().getValue(TWEAKER_MF); + if (!Strings.isNullOrEmpty(cascadingTweaker) && extraTweakers.add(cascadingTweaker)) { + LOGGER.info("Found and added cascading tweaker: " + cascadingTweaker); + extras.add("--tweakClass"); + extras.add(cascadingTweaker); + } + } + } + + // set property. + Set coremodsSet = Sets.newHashSet(); + if (!Strings.isNullOrEmpty(System.getProperty(COREMOD_VAR))) + coremodsSet.addAll(Splitter.on(',').splitToList(System.getProperty(COREMOD_VAR))); + coremodsSet.addAll(coreMap.keySet()); + System.setProperty(COREMOD_VAR, Joiner.on(',').join(coremodsSet)); + + // ok.. tweaker hack now. + if (!Strings.isNullOrEmpty(getTweakClass())) { + extras.add("--tweakClass"); + extras.add("net.minecraftforge.gradle.tweakers.CoremodTweaker"); + } + } + + /* ----------- CUSTOM TWEAKER FOR COREMOD HACK --------- */ + + // here and not in the tweaker package because classloader hell + public static final class AccessTransformerTransformer implements IClassTransformer { + + public AccessTransformerTransformer() { + doStuff((LaunchClassLoader) getClass().getClassLoader()); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void doStuff(LaunchClassLoader classloader) { + // the class and instance of ModAccessTransformer + Class clazz = null; + IClassTransformer instance = null; + + // find the instance I want. AND grab the type too, since thats better than Class.forName() + for (IClassTransformer transformer : classloader.getTransformers()) { + if (transformer.getClass().getCanonicalName().endsWith(MOD_ATD_CLASS)) { + clazz = transformer.getClass(); + instance = transformer; + } + } + + // impossible! but i will ignore it. + if (clazz == null || instance == null) { + LOGGER.log(Level.ERROR, "ModAccessTransformer was somehow not found."); + return; + } + + // grab the list of Modifiers I wanna mess with + Collection modifiers = null; + try { + // super class of ModAccessTransformer is AccessTransformer + Field f = clazz.getSuperclass().getDeclaredFields()[1]; // its the modifiers map. Only non-static field + // there. + f.setAccessible(true); + + modifiers = ((com.google.common.collect.Multimap) f.get(instance)).values(); + } catch (Throwable t) { + LOGGER.log(Level.ERROR, "AccessTransformer.modifiers field was somehow not found..."); + return; + } + + if (modifiers.isEmpty()) { + return; // hell no am I gonna do stuff if its empty.. + } + + // grab the field I wanna hack + Field nameField = null; + try { + // get 1 from the collection + Object mod = null; + for (Object val : modifiers) { + mod = val; + break; + } // i wish this was cleaner + + nameField = mod.getClass().getFields()[0]; // first field. "name" + nameField.setAccessible(true); // its alreadypublic, but just in case + } catch (Throwable t) { + LOGGER.log(Level.ERROR, "AccessTransformer.Modifier.name field was somehow not found..."); + return; + } + + // read the field and method CSV files. + Map nameMap = Maps.newHashMap(); + try { + readCsv(new File(CSV_DIR, "fields.csv"), nameMap); + readCsv(new File(CSV_DIR, "methods.csv"), nameMap); + } catch (IOException e) { + // If I cant find these.. something is terribly wrong. + LOGGER.log(Level.ERROR, "Could not load CSV files!"); + e.printStackTrace(); + return; + } + + LOGGER.log(Level.INFO, "Remapping AccessTransformer rules..."); + + // finally hit the modifiers + for (Object modifier : modifiers) // these are instances of AccessTransformer.Modifier + { + String name; + try { + name = (String) nameField.get(modifier); + String newName = nameMap.get(name); + if (newName != null) { + nameField.set(modifier, newName); + } + } catch (Exception e) { + // impossible. It would have failed earlier if possible. + } + } + } + + private void readCsv(File file, Map map) throws IOException { + LOGGER.log(Level.DEBUG, "Reading CSV file: {}", file); + Splitter split = Splitter.on(',').trimResults().limit(3); + for (String line : Files.readLines(file, Charsets.UTF_8)) { + if (line.startsWith("searge")) // header line + continue; + + List splits = split.splitToList(line); + map.put(splits.get(0), splits.get(1)); + } + } + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + return basicClass; // nothing here + } + } +} diff --git a/build/rfg/launcher-src/net/minecraftforge/gradle/OldPropertyMapSerializer.java b/build/rfg/launcher-src/net/minecraftforge/gradle/OldPropertyMapSerializer.java new file mode 100644 index 0000000..38a131e --- /dev/null +++ b/build/rfg/launcher-src/net/minecraftforge/gradle/OldPropertyMapSerializer.java @@ -0,0 +1,23 @@ +package net.minecraftforge.gradle; + +import java.lang.reflect.Type; + +import com.google.gson.*; +import com.mojang.authlib.properties.Property; +import com.mojang.authlib.properties.PropertyMap; + +public class OldPropertyMapSerializer implements JsonSerializer { + + @Override + public JsonElement serialize(PropertyMap src, Type typeOfSrc, JsonSerializationContext context) { + JsonObject out = new JsonObject(); + for (String key : src.keySet()) { + JsonArray jsa = new JsonArray(); + for (Property p : src.get(key)) { + jsa.add(new JsonPrimitive(p.getValue())); + } + out.add(key, jsa); + } + return out; + } +} diff --git a/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.java b/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.java new file mode 100644 index 0000000..5e49dae --- /dev/null +++ b/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/AccessTransformerTweaker.java @@ -0,0 +1,31 @@ +package net.minecraftforge.gradle.tweakers; + +import java.io.File; +import java.util.List; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.LaunchClassLoader; + +public class AccessTransformerTweaker implements ITweaker { + + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) {} + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) { + // so I can get it in the right ClassLaoder + classLoader.registerTransformer("net.minecraftforge.gradle.GradleStartCommon$AccessTransformerTransformer"); + } + + @Override + public String getLaunchTarget() { + // if it gets here... something went terribly wrong.. + return null; + } + + @Override + public String[] getLaunchArguments() { + // if it gets here... something went terribly wrong. + return new String[0]; + } +} diff --git a/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/CoremodTweaker.java b/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/CoremodTweaker.java new file mode 100644 index 0000000..e183aff --- /dev/null +++ b/build/rfg/launcher-src/net/minecraftforge/gradle/tweakers/CoremodTweaker.java @@ -0,0 +1,105 @@ +package net.minecraftforge.gradle.tweakers; + +import java.io.File; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.util.List; +import java.util.Map; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; +import net.minecraftforge.gradle.GradleStartCommon; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CoremodTweaker implements ITweaker { + + protected static final Logger LOGGER = LogManager.getLogger("GradleStart"); + private static final String COREMOD_CLASS = "fml.relauncher.CoreModManager"; + private static final String TWEAKER_SORT_FIELD = "tweakSorting"; + + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) {} + + @SuppressWarnings("unchecked") + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) { + try { + Field coreModList = GradleStartCommon.getFmlClass("fml.relauncher.CoreModManager", classLoader) + .getDeclaredField("loadPlugins"); + coreModList.setAccessible(true); + + // grab constructor. + Class clazz = (Class) GradleStartCommon + .getFmlClass("fml.relauncher.CoreModManager$FMLPluginWrapper", classLoader); + Constructor construct = (Constructor) clazz.getConstructors()[0]; + construct.setAccessible(true); + + Field[] fields = clazz.getDeclaredFields(); + Field pluginField = fields[1]; // 1 + Field fileField = fields[3]; // 3 + Field listField = fields[2]; // 2 + + Field.setAccessible(clazz.getConstructors(), true); + Field.setAccessible(fields, true); + + List oldList = (List) coreModList.get(null); + + for (int i = 0; i < oldList.size(); i++) { + ITweaker tweaker = oldList.get(i); + + if (clazz.isInstance(tweaker)) { + Object coreMod = pluginField.get(tweaker); + Object oldFile = fileField.get(tweaker); + File newFile = GradleStartCommon.coreMap.get(coreMod.getClass().getCanonicalName()); + + LOGGER.info("Injecting location in coremod {}", coreMod.getClass().getCanonicalName()); + + if (newFile != null && oldFile == null) { + // build new tweaker. + oldList.set( + i, + construct.newInstance( + new Object[] { (String) fields[0].get(tweaker), // name + coreMod, // coremod + newFile, // location + fields[4].getInt(tweaker), // sort index? + ((List) listField.get(tweaker)).toArray(new String[0]) })); + } + } + } + } catch (Throwable t) { + LOGGER.log(Level.ERROR, "Something went wrong with the coremod adding."); + t.printStackTrace(); + } + + // inject the additional AT tweaker + String atTweaker = "net.minecraftforge.gradle.tweakers.AccessTransformerTweaker"; + ((List) Launch.blackboard.get("TweakClasses")).add(atTweaker); + + // make sure its after the deobf tweaker + try { + Field f = GradleStartCommon.getFmlClass(COREMOD_CLASS, classLoader).getDeclaredField(TWEAKER_SORT_FIELD); + f.setAccessible(true); + ((Map) f.get(null)).put(atTweaker, Integer.valueOf(1001)); + } catch (Throwable t) { + LOGGER.log(Level.ERROR, "Something went wrong with the adding the AT tweaker adding."); + t.printStackTrace(); + } + } + + @Override + public String getLaunchTarget() { + // if it gets here... something went terribly wrong.. + return null; + } + + @Override + public String[] getLaunchArguments() { + // if it gets here... something went terribly wrong. + return new String[0]; + } +} diff --git a/build/rfg/mclauncher-1.7.10.jar b/build/rfg/mclauncher-1.7.10.jar new file mode 100644 index 0000000..0487556 Binary files /dev/null and b/build/rfg/mclauncher-1.7.10.jar differ diff --git a/build/rfg/mcp_patched_minecraft-sources.jar b/build/rfg/mcp_patched_minecraft-sources.jar new file mode 100644 index 0000000..accb551 Binary files /dev/null and b/build/rfg/mcp_patched_minecraft-sources.jar differ diff --git a/build/rfg/mcp_patched_minecraft-sources.jar.inputs.sha256 b/build/rfg/mcp_patched_minecraft-sources.jar.inputs.sha256 new file mode 100644 index 0000000..bd30320 --- /dev/null +++ b/build/rfg/mcp_patched_minecraft-sources.jar.inputs.sha256 @@ -0,0 +1 @@ +dcf037e16c4bb45abea596751c393961fb361cc37818d3fd73f4b88d045e096c diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.java new file mode 100644 index 0000000..01fe620 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/CustomModLoadingErrorDisplayException.java @@ -0,0 +1,68 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiErrorScreen; +import cpw.mods.fml.common.EnhancedRuntimeException; +import cpw.mods.fml.common.IFMLHandledException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * If a mod throws this exception during loading, it will be called back to render + * the error screen through the methods below. This error will not be cleared, and will + * not allow the game to carry on, but might be useful if your mod wishes to report + * a fatal configuration error in a pretty way. + * + * Throw this through a proxy. It won't work on the dedicated server environment. + * @author cpw + * + */ +@SideOnly(Side.CLIENT) +public abstract class CustomModLoadingErrorDisplayException extends EnhancedRuntimeException implements IFMLHandledException +{ + public CustomModLoadingErrorDisplayException() { + } + + public CustomModLoadingErrorDisplayException(String message, Throwable cause) + { + super(message, cause); + } + + private static final long serialVersionUID = 1L; + + /** + * Called after the GUI is inited by the parent code. You can do extra stuff here, maybe? + * + * @param errorScreen The error screen we're painting + * @param fontRenderer A font renderer for you + */ + public abstract void initGui(GuiErrorScreen errorScreen, FontRenderer fontRenderer); + + /** + * Draw your error to the screen. + * + *
Warning: Minecraft is in a deep error state. All it can do is stop. + * Do not try and do anything involving complex user interaction here. + * + * @param errorScreen The error screen to draw to + * @param fontRenderer A font renderer for you + * @param mouseRelX Mouse X + * @param mouseRelY Mouse Y + * @param tickTime tick time + */ + public abstract void drawScreen(GuiErrorScreen errorScreen, FontRenderer fontRenderer, int mouseRelX, int mouseRelY, float tickTime); + + @Override public void printStackTrace(EnhancedRuntimeException.WrappedPrintStream s){}; // Do Nothing unless the modder wants to. +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/ExtendedServerListData.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/ExtendedServerListData.java new file mode 100644 index 0000000..cd23f0b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/ExtendedServerListData.java @@ -0,0 +1,18 @@ +package cpw.mods.fml.client; + +import java.util.Map; + +public class ExtendedServerListData { + public final String type; + public final boolean isCompatible; + public final Map modData; + public final boolean isBlocked; + + public ExtendedServerListData(String type, boolean isCompatible, Map modData, boolean isBlocked) + { + this.type = type; + this.isCompatible = isCompatible; + this.modData = modData; + this.isBlocked = isBlocked; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLClientHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLClientHandler.java new file mode 100644 index 0000000..a3127d2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLClientHandler.java @@ -0,0 +1,1023 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.client; + +import java.io.File; +import java.io.FileInputStream; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiIngameMenu; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.ServerListEntryNormal; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.OldServerPinger; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.AbstractResourcePack; +import net.minecraft.client.resources.FallbackResourceManager; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.SaveFormatOld; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLUtil; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Strings; +import com.google.common.base.Throwables; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Sets; +import com.google.common.collect.ImmutableMap.Builder; +import com.google.common.collect.Maps; +import com.google.common.collect.Table; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.DuplicateModsFoundException; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLContainerHolder; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.IFMLSidedHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.MetadataCollection; +import cpw.mods.fml.common.MissingModsException; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.common.WrongMinecraftVersionException; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.network.FMLNetworkEvent; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.common.toposort.ModSortingException; +import cpw.mods.fml.relauncher.Side; + + +/** + * Handles primary communication from hooked code into the system + * + * The FML entry point is {@link #beginMinecraftLoading(Minecraft, List)} called from + * {@link Minecraft} + * + * Obfuscated code should focus on this class and other members of the "server" + * (or "client") code + * + * The actual mod loading is handled at arms length by {@link Loader} + * + * It is expected that a similar class will exist for each target environment: + * Bukkit and Client side. + * + * It should not be directly modified. + * + * @author cpw + * + */ +public class FMLClientHandler implements IFMLSidedHandler +{ + /** + * The singleton + */ + private static final FMLClientHandler INSTANCE = new FMLClientHandler(); + + /** + * A reference to the server itself + */ + private Minecraft client; + + private DummyModContainer optifineContainer; + + @SuppressWarnings("unused") + private boolean guiLoaded; + + @SuppressWarnings("unused") + private boolean serverIsRunning; + + private MissingModsException modsMissing; + + private ModSortingException modSorting; + + private boolean loading = true; + + private WrongMinecraftVersionException wrongMC; + + private CustomModLoadingErrorDisplayException customError; + + private DuplicateModsFoundException dupesFound; + + private boolean serverShouldBeKilledQuietly; + + private List resourcePackList; + + @SuppressWarnings("unused") + private IReloadableResourceManager resourceManager; + + private Map resourcePackMap; + + private BiMap guiFactories; + + private Map extraServerListData; + private Map serverDataTag; + + private WeakReference currentPlayClient; + + /** + * Called to start the whole game off + * + * @param minecraft The minecraft instance being launched + * @param resourcePackList The resource pack list we will populate with mods + * @param resourceManager The resource manager + */ + @SuppressWarnings("unchecked") + public void beginMinecraftLoading(Minecraft minecraft, @SuppressWarnings("rawtypes") List resourcePackList, IReloadableResourceManager resourceManager) + { + detectOptifine(); + SplashProgress.start(); + client = minecraft; + this.resourcePackList = resourcePackList; + this.resourceManager = resourceManager; + this.resourcePackMap = Maps.newHashMap(); + if (minecraft.isDemo()) + { + FMLLog.severe("DEMO MODE DETECTED, FML will not work. Finishing now."); + haltGame("FML will not run in demo mode", new RuntimeException()); + return; + } + + FMLCommonHandler.instance().beginLoading(this); + try + { + Loader.instance().loadMods(); + } + catch (WrongMinecraftVersionException wrong) + { + wrongMC = wrong; + } + catch (DuplicateModsFoundException dupes) + { + dupesFound = dupes; + } + catch (MissingModsException missing) + { + modsMissing = missing; + } + catch (ModSortingException sorting) + { + modSorting = sorting; + } + catch (CustomModLoadingErrorDisplayException custom) + { + FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt"); + customError = custom; + } + catch (LoaderException le) + { + haltGame("There was a severe problem during mod loading that has caused the game to fail", le); + return; + } + finally + { + client.refreshResources(); + } + + try + { + Loader.instance().preinitializeMods(); + } + catch (CustomModLoadingErrorDisplayException custom) + { + FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt"); + customError = custom; + } + catch (LoaderException le) + { + haltGame("There was a severe problem during mod loading that has caused the game to fail", le); + return; + } + Map> sharedModList = (Map>) Launch.blackboard.get("modList"); + if (sharedModList == null) + { + sharedModList = Maps.newHashMap(); + Launch.blackboard.put("modList", sharedModList); + } + for (ModContainer mc : Loader.instance().getActiveModList()) + { + Map sharedModDescriptor = mc.getSharedModDescriptor(); + if (sharedModDescriptor != null) + { + String sharedModId = "fml:"+mc.getModId(); + sharedModList.put(sharedModId, sharedModDescriptor); + } + } + } + + private void detectOptifine() + { + try + { + Class optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader()); + String optifineVersion = (String) optifineConfig.getField("VERSION").get(null); + Map dummyOptifineMeta = ImmutableMap.builder().put("name", "Optifine").put("version", optifineVersion).build(); + ModMetadata optifineMetadata = MetadataCollection.from(getClass().getResourceAsStream("optifinemod.info"),"optifine").getMetadataForId("optifine", dummyOptifineMeta); + optifineContainer = new DummyModContainer(optifineMetadata); + FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features",optifineContainer.getVersion()); + } + catch (Exception e) + { + optifineContainer = null; + } + } + + @Override + public void haltGame(String message, Throwable t) + { + SplashProgress.finish(); + client.displayCrashReport(new CrashReport(message, t)); + throw Throwables.propagate(t); + } + /** + * Called a bit later on during initialization to finish loading mods + * Also initializes key bindings + * + */ + @SuppressWarnings({ "deprecation", "unchecked" }) + public void finishMinecraftLoading() + { + if (modsMissing != null || wrongMC != null || customError!=null || dupesFound!=null || modSorting!=null) + { + SplashProgress.finish(); + return; + } + try + { + Loader.instance().initializeMods(); + } + catch (CustomModLoadingErrorDisplayException custom) + { + FMLLog.log(Level.ERROR, custom, "A custom exception was thrown by a mod, the game will now halt"); + customError = custom; + SplashProgress.finish(); + return; + } + catch (LoaderException le) + { + haltGame("There was a severe problem during mod loading that has caused the game to fail", le); + return; + } + + // Reload resources + client.refreshResources(); + RenderingRegistry.instance().loadEntityRenderers((Map, Render>)RenderManager.instance.entityRenderMap); + guiFactories = HashBiMap.create(); + for (ModContainer mc : Loader.instance().getActiveModList()) + { + String className = mc.getGuiClassName(); + if (Strings.isNullOrEmpty(className)) + { + continue; + } + try + { + Class clazz = Class.forName(className, true, Loader.instance().getModClassLoader()); + Class guiClassFactory = clazz.asSubclass(IModGuiFactory.class); + IModGuiFactory guiFactory = guiClassFactory.newInstance(); + guiFactory.initialize(client); + guiFactories.put(mc, guiFactory); + } catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "A critical error occurred instantiating the gui factory for mod %s", mc.getModId()); + } + } + loading = false; + client.gameSettings.loadOptions(); //Reload options to load any mod added keybindings. + } + + @SuppressWarnings("unused") + public void extendModList() + { + @SuppressWarnings("unchecked") + Map> modList = (Map>) Launch.blackboard.get("modList"); + if (modList != null) + { + for (Entry> modEntry : modList.entrySet()) + { + String sharedModId = modEntry.getKey(); + String system = sharedModId.split(":")[0]; + if ("fml".equals(system)) + { + continue; + } + Map mod = modEntry.getValue(); + String modSystem = mod.get("modsystem"); // the modsystem (FML uses FML or ModLoader) + String modId = mod.get("id"); // unique ID + String modVersion = mod.get("version"); // version + String modName = mod.get("name"); // a human readable name + String modURL = mod.get("url"); // a URL for the mod (can be empty string) + String modAuthors = mod.get("authors"); // a csv of authors (can be empty string) + String modDescription = mod.get("description"); // a (potentially) multiline description (can be empty string) + } + } + + } + public void onInitializationComplete() + { + if (wrongMC != null) + { + showGuiScreen(new GuiWrongMinecraft(wrongMC)); + } + else if (modsMissing != null) + { + showGuiScreen(new GuiModsMissing(modsMissing)); + } + else if (dupesFound != null) + { + showGuiScreen(new GuiDupesFound(dupesFound)); + } + else if (modSorting != null) + { + showGuiScreen(new GuiSortingProblem(modSorting)); + } + else if (customError != null) + { + showGuiScreen(new GuiCustomModLoadingErrorScreen(customError)); + } + else + { + Loader.instance().loadingComplete(); + SplashProgress.finish(); + } + logMissingTextureErrors(); + } + /** + * Get the server instance + */ + public Minecraft getClient() + { + return client; + } + + /** + * @return the instance + */ + public static FMLClientHandler instance() + { + return INSTANCE; + } + + /** + * @param player + * @param gui + */ + public void displayGuiScreen(EntityPlayer player, GuiScreen gui) + { + if (client.thePlayer==player && gui != null) { + client.displayGuiScreen(gui); + } + } + + /** + * @param mods + */ + public void addSpecialModEntries(ArrayList mods) + { + if (optifineContainer!=null) { + mods.add(optifineContainer); + } + } + + @Override + public List getAdditionalBrandingInformation() + { + if (optifineContainer!=null) + { + return Arrays.asList(String.format("Optifine %s",optifineContainer.getVersion())); + } else { + return ImmutableList.of(); + } + } + + @Override + public Side getSide() + { + return Side.CLIENT; + } + + public boolean hasOptifine() + { + return optifineContainer!=null; + } + + @Override + public void showGuiScreen(Object clientGuiElement) + { + GuiScreen gui = (GuiScreen) clientGuiElement; + client.displayGuiScreen(gui); + } + + @Override + public void queryUser(StartupQuery query) throws InterruptedException + { + if (query.getResult() == null) + { + client.displayGuiScreen(new GuiNotification(query)); + } + else + { + client.displayGuiScreen(new GuiConfirmation(query)); + } + + if (query.isSynchronous()) + { + while (client.currentScreen instanceof GuiNotification) + { + if (Thread.interrupted()) throw new InterruptedException(); + + client.loadingScreen.resetProgresAndWorkingMessage(""); + + Thread.sleep(50); + } + + client.loadingScreen.resetProgresAndWorkingMessage(""); // make sure the blank screen is being drawn at the end + } + } + + public boolean handleLoadingScreen(ScaledResolution scaledResolution) + { + if (client.currentScreen instanceof GuiNotification) + { + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / client.displayWidth; + int mouseZ = height - Mouse.getY() * height / client.displayHeight - 1; + + client.currentScreen.drawScreen(mouseX, mouseZ, 0); + client.currentScreen.handleInput(); + + return true; + } + else + { + return false; + } + } + + public WorldClient getWorldClient() + { + return client.theWorld; + } + + public EntityClientPlayerMP getClientPlayerEntity() + { + return client.thePlayer; + } + + @Override + public void beginServerLoading(MinecraftServer server) + { + serverShouldBeKilledQuietly = false; + // NOOP + } + + @Override + public void finishServerLoading() + { + // NOOP + } + + @Override + public File getSavesDirectory() + { + return ((SaveFormatOld) client.getSaveLoader()).savesDirectory; + } + + @Override + public MinecraftServer getServer() + { + return client.getIntegratedServer(); + } + + public void displayMissingMods(Object modMissingPacket) + { +// showGuiScreen(new GuiModsMissingForServer(modMissingPacket)); + } + + /** + * If the client is in the midst of loading, we disable saving so that custom settings aren't wiped out + */ + public boolean isLoading() + { + return loading; + } + + @Override + public boolean shouldServerShouldBeKilledQuietly() + { + return serverShouldBeKilledQuietly; + } + + /** + * Is this GUI type open? + * + * @param gui The type of GUI to test for + * @return if a GUI of this type is open + */ + public boolean isGUIOpen(Class gui) + { + return client.currentScreen != null && client.currentScreen.getClass().equals(gui); + } + + + @Override + public void addModAsResource(ModContainer container) + { + LanguageRegistry.instance().loadLanguagesFor(container, Side.CLIENT); + Class resourcePackType = container.getCustomResourcePackClass(); + if (resourcePackType != null) + { + try + { + IResourcePack pack = (IResourcePack) resourcePackType.getConstructor(ModContainer.class).newInstance(container); + resourcePackList.add(pack); + resourcePackMap.put(container.getModId(), pack); + } + catch (NoSuchMethodException e) + { + FMLLog.log(Level.ERROR, "The container %s (type %s) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName()); + return; + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "An unexpected exception occurred constructing the custom resource pack for %s", container.getName()); + throw Throwables.propagate(e); + } + } + } + + public IResourcePack getResourcePackFor(String modId) + { + return resourcePackMap.get(modId); + } + + @Override + public String getCurrentLanguage() + { + return client.getLanguageManager().getCurrentLanguage().getLanguageCode(); + } + + @Override + public void serverStopped() + { + // If the server crashes during startup, it might hang the client- reset the client so it can abend properly. + MinecraftServer server = getServer(); + + if (server != null && !server.serverIsInRunLoop()) + { + ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, true, "field_71296"+"_Q","serverIs"+"Running"); + } + } + + @Override + public INetHandler getClientPlayHandler() + { + return this.currentPlayClient == null ? null : this.currentPlayClient.get(); + } + @Override + public NetworkManager getClientToServerNetworkManager() + { + return this.client.getNetHandler()!=null ? this.client.getNetHandler().getNetworkManager() : null; + } + + public void handleClientWorldClosing(WorldClient world) + { + NetworkManager client = getClientToServerNetworkManager(); + // ONLY revert a non-local connection + if (client != null && !client.isLocalChannel()) + { + GameData.revertToFrozen(); + } + } + + public void startIntegratedServer(String id, String name, WorldSettings settings) + { + playClientBlock = new CountDownLatch(1); + } + + public File getSavesDir() + { + return new File(client.mcDataDir, "saves"); + } + public void tryLoadExistingWorld(GuiSelectWorld selectWorldGUI, String dirName, String saveName) + { + File dir = new File(getSavesDir(), dirName); + NBTTagCompound leveldat; + try + { + leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat"))); + } + catch (Exception e) + { + try + { + leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat_old"))); + } + catch (Exception e1) + { + FMLLog.warning("There appears to be a problem loading the save %s, both level files are unreadable.", dirName); + return; + } + } + NBTTagCompound fmlData = leveldat.getCompoundTag("FML"); + if (fmlData.hasKey("ModItemData")) + { + showGuiScreen(new GuiOldSaveLoadConfirm(dirName, saveName, selectWorldGUI)); + } + else + { + try + { + client.launchIntegratedServer(dirName, saveName, (WorldSettings)null); + } + catch (StartupQuery.AbortedException e) + { + // ignore + } + } + } + + public void showInGameModOptions(GuiIngameMenu guiIngameMenu) + { + showGuiScreen(new GuiIngameModOptions(guiIngameMenu)); + } + + public IModGuiFactory getGuiFactoryFor(ModContainer selectedMod) + { + return guiFactories.get(selectedMod); + } + + + public void setupServerList() + { + extraServerListData = Collections.synchronizedMap(Maps.newHashMap()); + serverDataTag = Collections.synchronizedMap(Maps.newHashMap()); + } + + public void captureAdditionalData(ServerStatusResponse serverstatusresponse, JsonObject jsonobject) + { + if (jsonobject.has("modinfo")) + { + JsonObject fmlData = jsonobject.get("modinfo").getAsJsonObject(); + extraServerListData.put(serverstatusresponse, fmlData); + } + } + public void bindServerListData(ServerData data, ServerStatusResponse originalResponse) + { + if (extraServerListData.containsKey(originalResponse)) + { + JsonObject jsonData = extraServerListData.get(originalResponse); + String type = jsonData.get("type").getAsString(); + JsonArray modDataArray = jsonData.get("modList").getAsJsonArray(); + boolean moddedClientAllowed = jsonData.has("clientModsAllowed") ? jsonData.get("clientModsAllowed").getAsBoolean() : true; + Builder modListBldr = ImmutableMap.builder(); + for (JsonElement obj : modDataArray) + { + JsonObject modObj = obj.getAsJsonObject(); + modListBldr.put(modObj.get("modid").getAsString(), modObj.get("version").getAsString()); + } + + Map modListMap = modListBldr.build(); + serverDataTag.put(data, new ExtendedServerListData(type, FMLNetworkHandler.checkModList(modListMap, Side.SERVER) == null, modListMap, !moddedClientAllowed)); + } + else + { + String serverDescription = data.serverMOTD; + boolean moddedClientAllowed = true; + if (!Strings.isNullOrEmpty(serverDescription)) + { + moddedClientAllowed = !serverDescription.endsWith(":NOFML§r"); + } + serverDataTag.put(data, new ExtendedServerListData("VANILLA", false, ImmutableMap.of(), !moddedClientAllowed)); + } + startupConnectionData.countDown(); + } + + private static final ResourceLocation iconSheet = new ResourceLocation("fml:textures/gui/icons.png"); + private static final CountDownLatch startupConnectionData = new CountDownLatch(1); + + public String enhanceServerListEntry(ServerListEntryNormal serverListEntry, ServerData serverEntry, int x, int width, int y, int relativeMouseX, int relativeMouseY) + { + String tooltip; + int idx; + boolean blocked = false; + if (serverDataTag.containsKey(serverEntry)) + { + ExtendedServerListData extendedData = serverDataTag.get(serverEntry); + if ("FML".equals(extendedData.type) && extendedData.isCompatible) + { + idx = 0; + tooltip = String.format("Compatible FML modded server\n%d mods present", extendedData.modData.size()); + } + else if ("FML".equals(extendedData.type) && !extendedData.isCompatible) + { + idx = 16; + tooltip = String.format("Incompatible FML modded server\n%d mods present", extendedData.modData.size()); + } + else if ("BUKKIT".equals(extendedData.type)) + { + idx = 32; + tooltip = String.format("Bukkit modded server"); + } + else if ("VANILLA".equals(extendedData.type)) + { + idx = 48; + tooltip = String.format("Vanilla server"); + } + else + { + idx = 64; + tooltip = String.format("Unknown server data"); + } + blocked = extendedData.isBlocked; + } + else + { + return null; + } + this.client.getTextureManager().bindTexture(iconSheet); + Gui.func_146110_a(x + width - 18, y + 10, 0, (float)idx, 16, 16, 256.0f, 256.0f); + if (blocked) + { + Gui.func_146110_a(x + width - 18, y + 10, 0, 80, 16, 16, 256.0f, 256.0f); + } + + return relativeMouseX > width - 15 && relativeMouseX < width && relativeMouseY > 10 && relativeMouseY < 26 ? tooltip : null; + } + + public String fixDescription(String description) + { + return description.endsWith(":NOFML§r") ? description.substring(0, description.length() - 8)+"§r" : description; + } + + public void connectToServerAtStartup(String host, int port) + { + setupServerList(); + OldServerPinger osp = new OldServerPinger(); + ServerData serverData = new ServerData("Command Line", host+":"+port); + try + { + osp.func_147224_a(serverData); + startupConnectionData.await(30, TimeUnit.SECONDS); + } + catch (Exception e) + { + showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port)); + return; + } + connectToServer(new GuiMainMenu(), serverData); + } + + public void connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry) + { + ExtendedServerListData extendedData = serverDataTag.get(serverEntry); + if (extendedData != null && extendedData.isBlocked) + { + showGuiScreen(new GuiAccessDenied(guiMultiplayer, serverEntry)); + } + else + { + showGuiScreen(new GuiConnecting(guiMultiplayer, client, serverEntry)); + } + playClientBlock = new CountDownLatch(1); + } + + public void connectToRealmsServer(String host, int port) + { + playClientBlock = new CountDownLatch(1); + } + + private CountDownLatch playClientBlock; + + public void setPlayClient(NetHandlerPlayClient netHandlerPlayClient) + { + if (playClientBlock == null) + playClientBlock = new CountDownLatch(1); + playClientBlock.countDown(); + this.currentPlayClient = new WeakReference(netHandlerPlayClient); + } + + @Override + public void waitForPlayClient() + { + boolean gotIt = false; + try + { + gotIt = playClientBlock.await(5,TimeUnit.SECONDS); + } catch (InterruptedException e) + { + } + if (!gotIt) + { + throw new RuntimeException("Timeout waiting for client thread to catch up!"); + } + } + + @Override + public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set channelSet, String channel, Side side) + { + if (side == Side.CLIENT) + { + waitForPlayClient(); + bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent(manager, channelSet, channel, side, NetHandlerPlayClient.class)); + } + else + { + bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent(manager, channelSet, channel, side, NetHandlerPlayServer.class)); + } + } + + @Override + public boolean shouldAllowPlayerLogins() + { + return true; //Always true as the server has to be started before clicking 'Open to lan' + } + + @Override + public void allowLogins() { + // NOOP for integrated server + } + + + private SetMultimap missingTextures = HashMultimap.create(); + private Set badTextureDomains = Sets.newHashSet(); + private Table> brokenTextures = HashBasedTable.create(); + + public void trackMissingTexture(ResourceLocation resourceLocation) + { + badTextureDomains.add(resourceLocation.getResourceDomain()); + missingTextures.put(resourceLocation.getResourceDomain(),resourceLocation); + } + + public void trackBrokenTexture(ResourceLocation resourceLocation, String error) + { + badTextureDomains.add(resourceLocation.getResourceDomain()); + Set badType = brokenTextures.get(resourceLocation.getResourceDomain(), error); + if (badType == null) + { + badType = Sets.newHashSet(); + brokenTextures.put(resourceLocation.getResourceDomain(), error, badType); + } + badType.add(resourceLocation); + } + + public void logMissingTextureErrors() + { + if (missingTextures.isEmpty() && brokenTextures.isEmpty()) + { + return; + } + Logger logger = LogManager.getLogger("TEXTURE ERRORS"); + logger.error(Strings.repeat("+=", 25)); + logger.error("The following texture errors were found."); + Map resManagers = ObfuscationReflectionHelper.getPrivateValue(SimpleReloadableResourceManager.class, (SimpleReloadableResourceManager)Minecraft.getMinecraft().getResourceManager(), "domainResourceManagers", "field_110548"+"_a"); + for (String resourceDomain : missingTextures.keySet()) + { + Set missing = missingTextures.get(resourceDomain); + logger.error(Strings.repeat("=", 50)); + logger.error(" DOMAIN {}", resourceDomain); + logger.error(Strings.repeat("-", 50)); + logger.error(" domain {} is missing {} texture{}",resourceDomain, missing.size(),missing.size()!=1 ? "s" : ""); + FallbackResourceManager fallbackResourceManager = resManagers.get(resourceDomain); + if (fallbackResourceManager == null) + { + logger.error(" domain {} is missing a resource manager - it is probably a side-effect of automatic texture processing", resourceDomain); + } + else + { + List resPacks = ObfuscationReflectionHelper.getPrivateValue(FallbackResourceManager.class, fallbackResourceManager, "resourcePacks","field_110540"+"_a"); + logger.error(" domain {} has {} location{}:",resourceDomain, resPacks.size(), resPacks.size() != 1 ? "s" :""); + for (IResourcePack resPack : resPacks) + { + if (resPack instanceof FMLContainerHolder) { + FMLContainerHolder containerHolder = (FMLContainerHolder) resPack; + ModContainer fmlContainer = containerHolder.getFMLContainer(); + logger.error(" mod {} resources at {}", fmlContainer.getModId(), fmlContainer.getSource().getPath()); + } + else if (resPack instanceof AbstractResourcePack) + { + AbstractResourcePack resourcePack = (AbstractResourcePack) resPack; + File resPath = ObfuscationReflectionHelper.getPrivateValue(AbstractResourcePack.class, resourcePack, "resourcePackFile","field_110597"+"_b"); + logger.error(" resource pack at path {}",resPath.getPath()); + } + else + { + logger.error(" unknown resourcepack type {} : {}", resPack.getClass().getName(), resPack.getPackName()); + } + } + } + logger.error(Strings.repeat("-", 25)); + logger.error(" The missing resources for domain {} are:",resourceDomain); + for (ResourceLocation rl : missing) + { + logger.error(" {}",rl.getResourcePath()); + } + logger.error(Strings.repeat("-", 25)); + if (!brokenTextures.containsRow(resourceDomain)) + { + logger.error(" No other errors exist for domain {}", resourceDomain); + } + else + { + logger.error(" The following other errors were reported for domain {}:",resourceDomain); + Map> resourceErrs = brokenTextures.row(resourceDomain); + for (String error: resourceErrs.keySet()) + { + logger.error(Strings.repeat("-", 25)); + logger.error(" Problem: {}", error); + for (ResourceLocation rl : resourceErrs.get(error)) + { + logger.error(" {}",rl.getResourcePath()); + } + } + } + logger.error(Strings.repeat("=", 50)); + } + logger.error(Strings.repeat("+=", 25)); + } + + @Override + public void processWindowMessages() + { + // workaround for windows requiring messages being processed on the main thread + if (LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_WINDOWS) return; + // If we can't grab the mutex, the update call is blocked, probably in native code, just skip it and carry on + // We'll get another go next time + if (!SplashProgress.mutex.tryAcquire()) return; + Display.processMessages(); + SplashProgress.mutex.release(); + } + // From FontRenderer.renderCharAtPos + private static final String ALLOWED_CHARS = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000"; + @Override + public String stripSpecialChars(String message) + { + // We can't handle many unicode points in the splash renderer + return CharMatcher.anyOf(ALLOWED_CHARS).retainFrom(StringUtils.stripControlCodes(message)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLConfigGuiFactory.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLConfigGuiFactory.java new file mode 100644 index 0000000..4fbe53e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLConfigGuiFactory.java @@ -0,0 +1,140 @@ +package cpw.mods.fml.client; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; + +import com.google.common.collect.ImmutableSet; + +import cpw.mods.fml.client.config.ConfigGuiType; +import cpw.mods.fml.client.config.DummyConfigElement; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.GuiConfigEntries.NumberSliderEntry; +import cpw.mods.fml.client.config.IConfigElement; +import cpw.mods.fml.client.config.DummyConfigElement.DummyCategoryElement; +import cpw.mods.fml.client.config.DummyConfigElement.DummyListElement; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +public class FMLConfigGuiFactory implements IModGuiFactory +{ + public static class FMLConfigGuiScreen extends GuiConfig + { + + public FMLConfigGuiScreen(GuiScreen parent) + { + super(parent, getConfigElements(), "FML", false, false, I18n.format("fml.config.sample.title")); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private static List getConfigElements() + { + List list = new ArrayList(); + List listsList = new ArrayList(); + List stringsList = new ArrayList(); + List numbersList = new ArrayList(); + Pattern commaDelimitedPattern = Pattern.compile("([A-Za-z]+((,){1}( )*|$))+?"); + + // Top Level Settings + list.add(new DummyConfigElement("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true)); + list.add(new DummyConfigElement("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true)); + list.add(new DummyConfigElement("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true)); + list.add(new DummyConfigElement("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true)); + + // Lists category + listsList.add(new DummyListElement("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList")); + listsList.add(new DummyListElement("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true)); + listsList.add(new DummyListElement("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10)); + listsList.add(new DummyListElement("doubleList", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleList")); + listsList.add(new DummyListElement("doubleListFixed", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListFixed", true)); + listsList.add(new DummyListElement("doubleListMax", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListMax", 15)); + listsList.add(new DummyListElement("doubleListBounded", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListBounded", -1.0D, 10.0D)); + listsList.add(new DummyListElement("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList")); + listsList.add(new DummyListElement("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true)); + listsList.add(new DummyListElement("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15)); + listsList.add(new DummyListElement("integerListBounded", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListBounded", -1, 10)); + listsList.add(new DummyListElement("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList")); + listsList.add(new DummyListElement("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true)); + listsList.add(new DummyListElement("stringListMax", new String[] {"An", "array", "of", "string", "values", "with", "a", "max", "length", "of", "15"}, ConfigGuiType.STRING, "fml.config.sample.stringListMax", 15)); + listsList.add(new DummyListElement("stringListPattern", new String[] {"Valid", "Not Valid", "Is, Valid", "Comma, Separated, Value"}, ConfigGuiType.STRING, "fml.config.sample.stringListPattern", commaDelimitedPattern)); + + list.add(new DummyCategoryElement("lists", "fml.config.sample.ctgy.lists", listsList)); + + // Strings category + stringsList.add(new DummyConfigElement("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString")); + stringsList.add(new DummyConfigElement("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"})); + stringsList.add(new DummyConfigElement("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern)); + stringsList.add(new DummyConfigElement("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"})); + stringsList.add(new DummyConfigElement("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector")); + + list.add(new DummyCategoryElement("strings", "fml.config.sample.ctgy.strings", stringsList)); + + // Numbers category + numbersList.add((new DummyConfigElement("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger"))); + numbersList.add((new DummyConfigElement("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256))); + numbersList.add((new DummyConfigElement("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class)); + numbersList.add(new DummyConfigElement("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble")); + numbersList.add(new DummyConfigElement("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D)); + numbersList.add(new DummyConfigElement("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class)); + + list.add(new DummyCategoryElement("numbers", "fml.config.sample.ctgy.numbers", numbersList)); + + return list; + } + } + + @Override + public void initialize(Minecraft minecraftInstance) + { + } + + @Override + public Class mainConfigGuiClass() + { + return FMLConfigGuiScreen.class; + } + + private static final Set fmlCategories = ImmutableSet.of(new RuntimeOptionCategoryElement("HELP", "FML")); + + @Override + public Set runtimeGuiCategories() + { + return fmlCategories; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) + { + return new RuntimeOptionGuiHandler() { + @Override + public void paint(int x, int y, int w, int h) + { + // TODO Auto-generated method stub + + } + + @Override + public void close() + { + } + + @Override + public void addWidgets(List widgets, int x, int y, int w, int h) + { + widgets.add(new GuiButton(100, x+10, y+10, "HELLO")); + } + + @Override + public void actionCallback(int actionId) + { + // TODO Auto-generated method stub + + } + }; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFileResourcePack.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFileResourcePack.java new file mode 100644 index 0000000..f60803b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFileResourcePack.java @@ -0,0 +1,70 @@ +package cpw.mods.fml.client; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import org.apache.logging.log4j.Level; + +import javax.imageio.ImageIO; + +import net.minecraft.client.resources.FileResourcePack; + +import com.google.common.base.Charsets; + +import cpw.mods.fml.common.FMLContainerHolder; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.FMLModContainer; +import cpw.mods.fml.common.ModContainer; + +public class FMLFileResourcePack extends FileResourcePack implements FMLContainerHolder { + + private ModContainer container; + + public FMLFileResourcePack(ModContainer container) + { + super(container.getSource()); + this.container = container; + } + + @Override + public String getPackName() + { + return "FMLFileResourcePack:"+container.getName(); + } + @Override + protected InputStream getInputStreamByName(String resourceName) throws IOException + { + try + { + return super.getInputStreamByName(resourceName); + } + catch (IOException ioe) + { + if ("pack.mcmeta".equals(resourceName)) + { + FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName()); + return new ByteArrayInputStream(("{\n" + + " \"pack\": {\n"+ + " \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+ + " \"pack_format\": 1\n"+ + "}\n" + + "}").getBytes(Charsets.UTF_8)); + } + else throw ioe; + } + } + + @Override + public BufferedImage getPackImage() throws IOException + { + return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile)); + } + + @Override + public ModContainer getFMLContainer() + { + return container; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFolderResourcePack.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFolderResourcePack.java new file mode 100644 index 0000000..eb01520 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/FMLFolderResourcePack.java @@ -0,0 +1,76 @@ +package cpw.mods.fml.client; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +import org.apache.logging.log4j.Level; + +import javax.imageio.ImageIO; + +import net.minecraft.client.resources.FolderResourcePack; + +import com.google.common.base.Charsets; + +import cpw.mods.fml.common.FMLContainerHolder; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.FMLModContainer; +import cpw.mods.fml.common.ModContainer; + +public class FMLFolderResourcePack extends FolderResourcePack implements FMLContainerHolder { + + private ModContainer container; + + public FMLFolderResourcePack(ModContainer container) + { + super(container.getSource()); + this.container = container; + } + + @Override + protected boolean hasResourceName(String p_110593_1_) + { + return super.hasResourceName(p_110593_1_); + } + @Override + public String getPackName() + { + return "FMLFileResourcePack:"+container.getName(); + } + @Override + protected InputStream getInputStreamByName(String resourceName) throws IOException + { + try + { + return super.getInputStreamByName(resourceName); + } + catch (IOException ioe) + { + if ("pack.mcmeta".equals(resourceName)) + { + FMLLog.log(container.getName(), Level.DEBUG, "Mod %s is missing a pack.mcmeta file, substituting a dummy one", container.getName()); + return new ByteArrayInputStream(("{\n" + + " \"pack\": {\n"+ + " \"description\": \"dummy FML pack for "+container.getName()+"\",\n"+ + " \"pack_format\": 1\n"+ + "}\n" + + "}").getBytes(Charsets.UTF_8)); + } + else throw ioe; + } + } + + @Override + public BufferedImage getPackImage() throws IOException + { + return ImageIO.read(getInputStreamByName(container.getMetadata().logoFile)); + } + + @Override + public ModContainer getFMLContainer() + { + return container; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiAccessDenied.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiAccessDenied.java new file mode 100644 index 0000000..611c188 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiAccessDenied.java @@ -0,0 +1,61 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; + +public class GuiAccessDenied extends GuiScreen +{ + private GuiScreen parent; + private ServerData data; + public GuiAccessDenied(GuiScreen parent, ServerData data) + { + this.parent = parent; + this.data = data; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); + } + + @Override + protected void actionPerformed(GuiButton p_73875_1_) + { + if (p_73875_1_.enabled && p_73875_1_.id == 1) + { + FMLClientHandler.instance().showGuiScreen(parent); + } + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - 2 * 10, 10); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); + offset += 10; + this.drawCenteredString(this.fontRendererObj, String.format("The server %s has forbidden modded access", data.serverName), this.width / 2, offset, 0xFFFFFF); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiBackupFailed.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiBackupFailed.java new file mode 100644 index 0000000..cce1f5e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiBackupFailed.java @@ -0,0 +1,61 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import java.io.File; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +public class GuiBackupFailed extends GuiScreen +{ + private GuiScreen parent; + private File zipName; + public GuiBackupFailed(GuiScreen parent, File zipName) + { + this.parent = parent; + this.zipName = zipName; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); + } + + @Override + protected void actionPerformed(GuiButton p_73875_1_) + { + if (p_73875_1_.enabled && p_73875_1_.id == 1) + { + FMLClientHandler.instance().showGuiScreen(parent); + } + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - 2 * 10, 10); + this.drawCenteredString(this.fontRendererObj, String.format("There was an error saving the archive %s", zipName.getName()), this.width / 2, offset, 0xFFFFFF); + offset += 10; + this.drawCenteredString(this.fontRendererObj, String.format("Please fix the problem and try again"), this.width / 2, offset, 0xFFFFFF); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiConfirmation.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiConfirmation.java new file mode 100644 index 0000000..ae18add --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiConfirmation.java @@ -0,0 +1,36 @@ +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.resources.I18n; +import cpw.mods.fml.common.StartupQuery; + +public class GuiConfirmation extends GuiNotification +{ + public GuiConfirmation(StartupQuery query) + { + super(query); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height - 38, I18n.format("gui.yes"))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height - 38, I18n.format("gui.no"))); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.enabled && (button.id == 0 || button.id == 1)) + { + FMLClientHandler.instance().showGuiScreen(null); + query.setResult(button.id == 0); + query.finish(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java new file mode 100644 index 0000000..f43338f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiCustomModLoadingErrorScreen.java @@ -0,0 +1,44 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiErrorScreen; + +public class GuiCustomModLoadingErrorScreen extends GuiErrorScreen +{ + private CustomModLoadingErrorDisplayException customException; + public GuiCustomModLoadingErrorScreen(CustomModLoadingErrorDisplayException customException) + { + super(null,null); + this.customException = customException; + } + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + this.customException.initGui(this, fontRendererObj); + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.customException.drawScreen(this, fontRendererObj, mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiDupesFound.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiDupesFound.java new file mode 100644 index 0000000..e542ae8 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiDupesFound.java @@ -0,0 +1,62 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import java.io.File; +import java.util.Map.Entry; + +import net.minecraft.client.gui.GuiErrorScreen; +import cpw.mods.fml.common.DuplicateModsFoundException; +import cpw.mods.fml.common.ModContainer; + +public class GuiDupesFound extends GuiErrorScreen +{ + + private DuplicateModsFoundException dupes; + + public GuiDupesFound(DuplicateModsFoundException dupes) + { + super(null,null); + this.dupes = dupes; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - dupes.dupes.size() * 10, 10); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF); + offset+=5; + for (Entry mc : dupes.dupes.entries()) + { + offset+=10; + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiIngameModOptions.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiIngameModOptions.java new file mode 100644 index 0000000..ec2d03f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiIngameModOptions.java @@ -0,0 +1,61 @@ +package cpw.mods.fml.client; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; + +public class GuiIngameModOptions extends GuiScreen +{ + private final GuiScreen parentScreen; + protected String title = "Mod Options"; + private GuiModOptionList optionList; + + public GuiIngameModOptions(GuiScreen parentScreen) + { + this.parentScreen = parentScreen; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.optionList=new GuiModOptionList(this); + this.optionList.registerScrollButtons(this.buttonList, 7, 8); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + // force a non-transparent background + this.drawDefaultBackground(); + this.optionList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 15, 0xFFFFFF); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + FontRenderer getFontRenderer() { + return fontRendererObj; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModList.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModList.java new file mode 100644 index 0000000..8549d6d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModList.java @@ -0,0 +1,310 @@ +/* + * The FML Forge Mod Loader suite. + * Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package cpw.mods.fml.client; + +import java.awt.Dimension; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; + +import javax.imageio.ImageIO; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.util.ResourceLocation; + +import org.apache.logging.log4j.Level; +import org.lwjgl.opengl.GL11; + +import com.google.common.base.Strings; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModContainer.Disableable; + +/** + * @author cpw + * + */ +public class GuiModList extends GuiScreen +{ + private GuiScreen mainMenu; + private GuiSlotModList modList; + private int selected = -1; + private ModContainer selectedMod; + private int listWidth; + private ArrayList mods; + private GuiButton configModButton; + private GuiButton disableModButton; + private ResourceLocation cachedLogo; + private Dimension cachedLogoDimensions; + + /** + * @param mainMenu + */ + public GuiModList(GuiScreen mainMenu) + { + this.mainMenu=mainMenu; + this.mods=new ArrayList(); + FMLClientHandler.instance().addSpecialModEntries(mods); + for (ModContainer mod : Loader.instance().getModList()) { + if (mod.getMetadata()!=null && mod.getMetadata().parentMod==null && !Strings.isNullOrEmpty(mod.getMetadata().parent)) { + String parentMod = mod.getMetadata().parent; + ModContainer parentContainer = Loader.instance().getIndexedModList().get(parentMod); + if (parentContainer != null) + { + mod.getMetadata().parentMod = parentContainer; + parentContainer.getMetadata().childMods.add(mod); + continue; + } + } + else if (mod.getMetadata()!=null && mod.getMetadata().parentMod!=null) + { + continue; + } + mods.add(mod); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + for (ModContainer mod : mods) { + listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getName()) + 10); + listWidth=Math.max(listWidth,getFontRenderer().getStringWidth(mod.getVersion()) + 10); + } + listWidth=Math.min(listWidth, 150); + this.buttonList.add(new GuiButton(6, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); + configModButton = new GuiButton(20, 10, this.height - 60, this.listWidth, 20, "Config"); + disableModButton = new GuiButton(21, 10, this.height - 38, this.listWidth, 20, "Disable"); + this.buttonList.add(configModButton); + this.buttonList.add(disableModButton); + this.modList=new GuiSlotModList(this, mods, listWidth); + this.modList.registerScrollButtons(this.buttonList, 7, 8); + } + + @Override + protected void actionPerformed(GuiButton button) { + if (button.enabled) + { + switch (button.id) + { + case 6: + this.mc.displayGuiScreen(this.mainMenu); + return; + case 20: + try + { + IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod); + GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(this); + this.mc.displayGuiScreen(newScreen); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "There was a critical issue trying to build the config GUI for %s", selectedMod.getModId()); + } + return; + } + } + super.actionPerformed(button); + } + + public int drawLine(String line, int offset, int shifty) + { + this.fontRendererObj.drawString(line, offset, shifty, 0xd7edea); + return shifty + 10; + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int p_571_1_, int p_571_2_, float p_571_3_) + { + this.modList.drawScreen(p_571_1_, p_571_2_, p_571_3_); + this.drawCenteredString(this.fontRendererObj, "Mod List", this.width / 2, 16, 0xFFFFFF); + int offset = this.listWidth + 20; + if (selectedMod != null) { + GL11.glEnable(GL11.GL_BLEND); + if (!selectedMod.getMetadata().autogenerated) { + configModButton.visible = true; + disableModButton.visible = true; + disableModButton.packedFGColour = 0xFF3377; + configModButton.enabled = false; + int shifty = 35; + String logoFile = selectedMod.getMetadata().logoFile; + if (!logoFile.isEmpty()) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + TextureManager tm = mc.getTextureManager(); + IResourcePack pack = FMLClientHandler.instance().getResourcePackFor(selectedMod.getModId()); + try + { + if (cachedLogo == null) + { + BufferedImage logo = null; + if (pack!=null) + { + logo = pack.getPackImage(); + } + else + { + InputStream logoResource = getClass().getResourceAsStream(logoFile); + if (logoResource != null) + { + logo = ImageIO.read(logoResource); + } + } + if (logo != null) + { + cachedLogo = tm.getDynamicTextureLocation("modlogo", new DynamicTexture(logo)); + cachedLogoDimensions = new Dimension(logo.getWidth(), logo.getHeight()); + } + } + if (cachedLogo != null) + { + this.mc.renderEngine.bindTexture(cachedLogo); + double scaleX = cachedLogoDimensions.width / 200.0; + double scaleY = cachedLogoDimensions.height / 65.0; + double scale = 1.0; + if (scaleX > 1 || scaleY > 1) + { + scale = 1.0 / Math.max(scaleX, scaleY); + } + cachedLogoDimensions.width *= scale; + cachedLogoDimensions.height *= scale; + int top = 32; + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + tess.addVertexWithUV(offset, top + cachedLogoDimensions.height, zLevel, 0, 1); + tess.addVertexWithUV(offset + cachedLogoDimensions.width, top + cachedLogoDimensions.height, zLevel, 1, 1); + tess.addVertexWithUV(offset + cachedLogoDimensions.width, top, zLevel, 1, 0); + tess.addVertexWithUV(offset, top, zLevel, 0, 0); + tess.draw(); + + shifty += 65; + } + } + catch (IOException e) + { + ; + } + } + this.fontRendererObj.drawStringWithShadow(selectedMod.getMetadata().name, offset, shifty, 0xFFFFFF); + shifty += 12; + + shifty = drawLine(String.format("Version: %s (%s)", selectedMod.getDisplayVersion(), selectedMod.getVersion()), offset, shifty); + shifty = drawLine(String.format("Mod ID: '%s' Mod State: %s", selectedMod.getModId(), Loader.instance().getModState(selectedMod)), offset, shifty); + if (!selectedMod.getMetadata().credits.isEmpty()) { + shifty = drawLine(String.format("Credits: %s", selectedMod.getMetadata().credits), offset, shifty); + } + shifty = drawLine(String.format("Authors: %s", selectedMod.getMetadata().getAuthorList()), offset, shifty); + shifty = drawLine(String.format("URL: %s", selectedMod.getMetadata().url), offset, shifty); + shifty = drawLine(selectedMod.getMetadata().childMods.isEmpty() ? "No child mods for this mod" : String.format("Child mods: %s", selectedMod.getMetadata().getChildModList()), offset, shifty); + int rightSide = this.width - offset - 20; + if (rightSide > 20) + { + this.getFontRenderer().drawSplitString(selectedMod.getMetadata().description, offset, shifty + 10, rightSide, 0xDDDDDD); + } + Disableable disableable = selectedMod.canBeDisabled(); + if (disableable == Disableable.RESTART) + { + disableModButton.enabled = true; + disableModButton.visible = true; + disableModButton.packedFGColour = 0xFF3377; + } + else if (disableable == Disableable.YES) + { + disableModButton.enabled = true; + disableModButton.visible = true; + disableModButton.packedFGColour = 0; + } + else + { + disableModButton.packedFGColour = 0; + disableModButton.visible = true; + disableModButton.enabled = false; + } + IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(selectedMod); + if (guiFactory == null || guiFactory.mainConfigGuiClass() == null) + { + configModButton.visible = true; + configModButton.enabled = false; + } + else + { + configModButton.visible = true; + configModButton.enabled = true; + } + } else { + offset = ( this.listWidth + this.width ) / 2; + this.drawCenteredString(this.fontRendererObj, selectedMod.getName(), offset, 35, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("Version: %s",selectedMod.getVersion()), offset, 45, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, String.format("Mod State: %s",Loader.instance().getModState(selectedMod)), offset, 55, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "No mod information found", offset, 65, 0xDDDDDD); + this.drawCenteredString(this.fontRendererObj, "Ask your mod author to provide a mod mcmod.info file", offset, 75, 0xDDDDDD); + configModButton.visible = false; + disableModButton.visible = false; + } + GL11.glDisable(GL11.GL_BLEND); + } + else + { + configModButton.visible = false; + disableModButton.visible = false; + } + super.drawScreen(p_571_1_, p_571_2_, p_571_3_); + } + + Minecraft getMinecraftInstance() { + return mc; + } + + FontRenderer getFontRenderer() { + return fontRendererObj; + } + + /** + * @param var1 + */ + public void selectModIndex(int var1) + { + this.selected=var1; + if (var1>=0 && var1<=mods.size()) { + this.selectedMod=mods.get(selected); + } else { + this.selectedMod=null; + } + cachedLogo = null; + } + + public boolean modIndexSelected(int var1) + { + return var1==selected; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModOptionList.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModOptionList.java new file mode 100644 index 0000000..be6253c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModOptionList.java @@ -0,0 +1,47 @@ +package cpw.mods.fml.client; + +import net.minecraft.client.renderer.Tessellator; + +public class GuiModOptionList extends GuiScrollingList { + + private GuiIngameModOptions parent; + + public GuiModOptionList(GuiIngameModOptions parent) + { + super(parent.mc, 150, parent.height, 32, parent.height - 65 + 4, 10, 35); + this.parent = parent; + } + + @Override + protected int getSize() + { + return 1; + } + + @Override + protected void elementClicked(int index, boolean doubleClick) + { + // TODO Auto-generated method stub + + } + + @Override + protected boolean isSelected(int index) + { + return false; + } + + @Override + protected void drawBackground() + { + } + + @Override + protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) + { + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("Test 1", listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("TEST 2", listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissing.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissing.java new file mode 100644 index 0000000..2b1690a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissing.java @@ -0,0 +1,69 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiErrorScreen; +import cpw.mods.fml.common.MissingModsException; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; + +public class GuiModsMissing extends GuiErrorScreen +{ + + private MissingModsException modsMissing; + + public GuiModsMissing(MissingModsException modsMissing) + { + super(null,null); + this.modsMissing = modsMissing; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); + offset+=5; + for (ArtifactVersion v : modsMissing.missingMods) + { + offset+=10; + if (v instanceof DefaultArtifactVersion) + { + DefaultArtifactVersion dav = (DefaultArtifactVersion)v; + if (dav.getRange() != null && dav.getRange().isUnboundedAbove()) + { + this.drawCenteredString(this.fontRendererObj, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.width / 2, offset, 0xEEEEEE); + continue; + } + } + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); + } + offset+=20; + this.drawCenteredString(this.fontRendererObj, "The file 'logs/fml-client-latest.log' contains more information", this.width / 2, offset, 0xFFFFFF); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissingForServer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissingForServer.java new file mode 100644 index 0000000..d3ec2f9 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiModsMissingForServer.java @@ -0,0 +1,69 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import cpw.mods.fml.common.MissingModsException; +import cpw.mods.fml.common.versioning.ArtifactVersion; + +public class GuiModsMissingForServer extends GuiScreen +{ + private MissingModsException modsMissing; + + public GuiModsMissingForServer(MissingModsException modsMissing) + { + this.modsMissing = modsMissing; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 75, this.height - 38, I18n.format("gui.done"))); + } + + @Override + protected void actionPerformed(GuiButton p_73875_1_) + { + if (p_73875_1_.enabled && p_73875_1_.id == 1) + { + FMLClientHandler.instance().showGuiScreen(null); + } + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); + offset += 10; + this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); + offset += 10; + this.drawCenteredString(this.fontRendererObj, "They are required to play on this server", this.width / 2, offset, 0xFFFFFF); + offset += 5; + for (ArtifactVersion v : modsMissing.missingMods) + { + offset += 10; + this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); + } + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiNotification.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiNotification.java new file mode 100644 index 0000000..7012cf7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiNotification.java @@ -0,0 +1,68 @@ +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import cpw.mods.fml.common.StartupQuery; + +public class GuiNotification extends GuiScreen +{ + public GuiNotification(StartupQuery query) + { + this.query = query; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height - 38, I18n.format("gui.done"))); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.enabled && button.id == 0) + { + FMLClientHandler.instance().showGuiScreen(null); + query.finish(); + } + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + + String[] lines = query.getText().split("\n"); + + int spaceAvailable = this.height - 38 - 20; + int spaceRequired = Math.min(spaceAvailable, 10 + 10 * lines.length); + + int offset = 10 + (spaceAvailable - spaceRequired) / 2; // vertically centered + + for (String line : lines) + { + if (offset >= spaceAvailable) + { + this.drawCenteredString(this.fontRendererObj, "...", this.width / 2, offset, 0xFFFFFF); + break; + } + else + { + if (!line.isEmpty()) this.drawCenteredString(this.fontRendererObj, line, this.width / 2, offset, 0xFFFFFF); + offset += 10; + } + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected final StartupQuery query; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java new file mode 100644 index 0000000..9a56e4b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java @@ -0,0 +1,100 @@ +package cpw.mods.fml.client; + +import java.io.File; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiLabel; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSelectWorld; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.world.WorldSettings; + +import org.apache.logging.log4j.Level; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.common.ZipperUtil; + +public class GuiOldSaveLoadConfirm extends GuiYesNo implements GuiYesNoCallback { + + private String dirName; + private String saveName; + private File zip; + private GuiScreen parent; + public GuiOldSaveLoadConfirm(String dirName, String saveName, GuiScreen parent) + { + super(null, "", "", 0); + this.parent = parent; + this.dirName = dirName; + this.saveName = saveName; + this.zip = new File(FMLClientHandler.instance().getClient().mcDataDir,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", dirName, System.currentTimeMillis())); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, String.format("The world %s contains pre-update modding data", saveName), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("There may be problems updating it to this version"), this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("FML will save a zip to %s", zip.getName()), this.width / 2, 90, 16777215); + this.drawCenteredString(this.fontRendererObj, String.format("Do you wish to continue loading?"), this.width / 2, 110, 16777215); + int k; + + for (k = 0; k < this.buttonList.size(); ++k) + { + ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, mouseX, mouseY); + } + + for (k = 0; k < this.labelList.size(); ++k) + { + ((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, mouseX, mouseY); + } + } + @Override + protected void actionPerformed(GuiButton button) + { + if (button.id == 1) + { + ObfuscationReflectionHelper.setPrivateValue(GuiSelectWorld.class, (GuiSelectWorld)parentScreen, false, "field_"+"146634_i"); + FMLClientHandler.instance().showGuiScreen(parent); + } + else + { + FMLLog.info("Capturing current state of world %s into file %s", saveName, zip.getAbsolutePath()); + try + { + String skip = System.getProperty("fml.doNotBackup"); + if (skip == null || !"true".equals(skip)) + { + ZipperUtil.zip(new File(FMLClientHandler.instance().getSavesDir(), dirName), zip); + } + else + { + for (int x = 0; x < 10; x++) + FMLLog.severe("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!"); + } + } catch (IOException e) + { + FMLLog.log(Level.WARN, e, "There was a problem saving the backup %s. Please fix and try again", zip.getName()); + FMLClientHandler.instance().showGuiScreen(new GuiBackupFailed(parent, zip)); + return; + } + FMLClientHandler.instance().showGuiScreen(null); + + try + { + mc.launchIntegratedServer(dirName, saveName, (WorldSettings)null); + } + catch (StartupQuery.AbortedException e) + { + // ignore + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiScrollingList.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiScrollingList.java new file mode 100644 index 0000000..6fbbedd --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiScrollingList.java @@ -0,0 +1,454 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public abstract class GuiScrollingList +{ + private final Minecraft client; + protected final int listWidth; + protected final int listHeight; + protected final int top; + protected final int bottom; + private final int right; + protected final int left; + protected final int slotHeight; + private int scrollUpActionId; + private int scrollDownActionId; + protected int mouseX; + protected int mouseY; + private float initialMouseClickY = -2.0F; + private float scrollFactor; + private float scrollDistance; + private int selectedIndex = -1; + private long lastClickTime = 0L; + private boolean field_25123_p = true; + private boolean field_27262_q; + private int field_27261_r; + + public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) + { + this.client = client; + this.listWidth = width; + this.listHeight = height; + this.top = top; + this.bottom = bottom; + this.slotHeight = entryHeight; + this.left = left; + this.right = width + this.left; + } + + public void func_27258_a(boolean p_27258_1_) + { + this.field_25123_p = p_27258_1_; + } + + protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) + { + this.field_27262_q = p_27259_1_; + this.field_27261_r = p_27259_2_; + + if (!p_27259_1_) + { + this.field_27261_r = 0; + } + } + + protected abstract int getSize(); + + protected abstract void elementClicked(int index, boolean doubleClick); + + protected abstract boolean isSelected(int index); + + protected int getContentHeight() + { + return this.getSize() * this.slotHeight + this.field_27261_r; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); + + protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) {} + + protected void func_27255_a(int p_27255_1_, int p_27255_2_) {} + + protected void func_27257_b(int p_27257_1_, int p_27257_2_) {} + + public int func_27256_c(int p_27256_1_, int p_27256_2_) + + { + int var3 = this.left + 1; + int var4 = this.left + this.listWidth - 7; + int var5 = p_27256_2_ - this.top - this.field_27261_r + (int)this.scrollDistance - 4; + int var6 = var5 / this.slotHeight; + return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; + } + + public void registerScrollButtons(@SuppressWarnings("rawtypes") List p_22240_1_, int p_22240_2_, int p_22240_3_) + { + this.scrollUpActionId = p_22240_2_; + this.scrollDownActionId = p_22240_3_; + } + + private void applyScrollLimits() + { + int var1 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var1 < 0) + { + var1 /= 2; + } + + if (this.scrollDistance < 0.0F) + { + this.scrollDistance = 0.0F; + } + + if (this.scrollDistance > (float)var1) + { + this.scrollDistance = (float)var1; + } + } + + public void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == this.scrollUpActionId) + { + this.scrollDistance -= (float)(this.slotHeight * 2 / 3); + this.initialMouseClickY = -2.0F; + this.applyScrollLimits(); + } + else if (button.id == this.scrollDownActionId) + { + this.scrollDistance += (float)(this.slotHeight * 2 / 3); + this.initialMouseClickY = -2.0F; + this.applyScrollLimits(); + } + } + } + + public void drawScreen(int mouseX, int mouseY, float p_22243_3_) + { + this.mouseX = mouseX; + this.mouseY = mouseY; + this.drawBackground(); + int listLength = this.getSize(); + int scrollBarXStart = this.left + this.listWidth - 6; + int scrollBarXEnd = scrollBarXStart + 6; + int boxLeft = this.left; + int boxRight = scrollBarXStart-1; + int var10; + int var11; + int var13; + int var19; + + if (Mouse.isButtonDown(0)) + { + if (this.initialMouseClickY == -1.0F) + { + boolean var7 = true; + + if (mouseY >= this.top && mouseY <= this.bottom) + { + var10 = mouseY - this.top - this.field_27261_r + (int)this.scrollDistance - 4; + var11 = var10 / this.slotHeight; + + if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) + { + boolean var12 = var11 == this.selectedIndex && System.currentTimeMillis() - this.lastClickTime < 250L; + this.elementClicked(var11, var12); + this.selectedIndex = var11; + this.lastClickTime = System.currentTimeMillis(); + } + else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) + { + this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int)this.scrollDistance - 4); + var7 = false; + } + + if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) + { + this.scrollFactor = -1.0F; + var19 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var19 < 1) + { + var19 = 1; + } + + var13 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); + + if (var13 < 32) + { + var13 = 32; + } + + if (var13 > this.bottom - this.top - 8) + { + var13 = this.bottom - this.top - 8; + } + + this.scrollFactor /= (float)(this.bottom - this.top - var13) / (float)var19; + } + else + { + this.scrollFactor = 1.0F; + } + + if (var7) + { + this.initialMouseClickY = (float)mouseY; + } + else + { + this.initialMouseClickY = -2.0F; + } + } + else + { + this.initialMouseClickY = -2.0F; + } + } + else if (this.initialMouseClickY >= 0.0F) + { + this.scrollDistance -= ((float)mouseY - this.initialMouseClickY) * this.scrollFactor; + this.initialMouseClickY = (float)mouseY; + } + } + else + { + while (Mouse.next()) + { + int var16 = Mouse.getEventDWheel(); + + if (var16 != 0) + { + if (var16 > 0) + { + var16 = -1; + } + else if (var16 < 0) + { + var16 = 1; + } + + this.scrollDistance += (float)(var16 * this.slotHeight / 2); + } + } + + this.initialMouseClickY = -1.0F; + } + + this.applyScrollLimits(); + Tessellator var18 = Tessellator.instance; + if (this.client.theWorld != null) + { + this.drawGradientRect(this.left, this.top, this.right, this.bottom, -1072689136, -804253680); + } + else + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + this.client.renderEngine.bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var17 = 32.0F; + var18.startDrawingQuads(); + var18.setColorOpaque_I(2105376); + var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); + var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.scrollDistance) / var17)); + var18.draw(); + } + // boxRight = this.listWidth / 2 - 92 - 16; + var10 = this.top + 4 - (int)this.scrollDistance; + + if (this.field_27262_q) + { + this.func_27260_a(boxRight, var10, var18); + } + + int var14; + + for (var11 = 0; var11 < listLength; ++var11) + { + var19 = var10 + var11 * this.slotHeight + this.field_27261_r; + var13 = this.slotHeight - 4; + + if (var19 <= this.bottom && var19 + var13 >= this.top) + { + if (this.field_25123_p && this.isSelected(var11)) + { + var14 = boxLeft; + int var15 = boxRight; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorOpaque_I(8421504); + var18.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D); + var18.setColorOpaque_I(0); + var18.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D); + var18.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + this.drawSlot(var11, boxRight, var19, var13, var18); + } + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); + byte var20 = 4; + if (this.client.theWorld == null) + { + this.overlayBackground(0, this.top, 255, 255); + this.overlayBackground(this.bottom, this.listHeight, 255, 255); + } + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 0); + var18.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D); + var18.draw(); + var19 = this.getContentHeight() - (this.bottom - this.top - 4); + + if (var19 > 0) + { + var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); + + if (var13 < 32) + { + var13 = 32; + } + + if (var13 > this.bottom - this.top - 8) + { + var13 = this.bottom - this.top - 8; + } + + var14 = (int)this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; + + if (var14 < this.top) + { + var14 = this.top; + } + + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(8421504, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)scrollBarXEnd, (double)var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); + var18.draw(); + var18.startDrawingQuads(); + var18.setColorRGBA_I(12632256, 255); + var18.addVertexWithUV((double)scrollBarXStart, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double)(scrollBarXEnd - 1), (double)var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)scrollBarXStart, (double)var14, 0.0D, 0.0D, 0.0D); + var18.draw(); + } + + this.func_27257_b(mouseX, mouseY); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) + { + Tessellator var5 = Tessellator.instance; + this.client.renderEngine.bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var6 = 32.0F; + var5.startDrawingQuads(); + var5.setColorRGBA_I(4210752, p_22239_4_); + var5.addVertexWithUV(0.0D, (double)p_22239_2_, 0.0D, 0.0D, (double)((float)p_22239_2_ / var6)); + var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_2_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_2_ / var6)); + var5.setColorRGBA_I(4210752, p_22239_3_); + var5.addVertexWithUV((double)this.listWidth + 30, (double)p_22239_1_, 0.0D, (double)((float)(this.listWidth + 30) / var6), (double)((float)p_22239_1_ / var6)); + var5.addVertexWithUV(0.0D, (double)p_22239_1_, 0.0D, 0.0D, (double)((float)p_22239_1_ / var6)); + var5.draw(); + } + + protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) + { + float f = (float)(par5 >> 24 & 255) / 255.0F; + float f1 = (float)(par5 >> 16 & 255) / 255.0F; + float f2 = (float)(par5 >> 8 & 255) / 255.0F; + float f3 = (float)(par5 & 255) / 255.0F; + float f4 = (float)(par6 >> 24 & 255) / 255.0F; + float f5 = (float)(par6 >> 16 & 255) / 255.0F; + float f6 = (float)(par6 >> 8 & 255) / 255.0F; + float f7 = (float)(par6 & 255) / 255.0F; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(f1, f2, f3, f); + tessellator.addVertex((double)par3, (double)par2, 0.0D); + tessellator.addVertex((double)par1, (double)par2, 0.0D); + tessellator.setColorRGBA_F(f5, f6, f7, f4); + tessellator.addVertex((double)par1, (double)par4, 0.0D); + tessellator.addVertex((double)par3, (double)par4, 0.0D); + tessellator.draw(); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSlotModList.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSlotModList.java new file mode 100644 index 0000000..bc9e008 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSlotModList.java @@ -0,0 +1,87 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import java.util.ArrayList; + +import net.minecraft.client.renderer.Tessellator; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.common.ModContainer; + +/** + * @author cpw + * + */ +public class GuiSlotModList extends GuiScrollingList +{ + private GuiModList parent; + private ArrayList mods; + + public GuiSlotModList(GuiModList parent, ArrayList mods, int listWidth) + { + super(parent.getMinecraftInstance(), listWidth, parent.height, 32, parent.height - 66 + 4, 10, 35); + this.parent=parent; + this.mods=mods; + } + + @Override + protected int getSize() + { + return mods.size(); + } + + @Override + protected void elementClicked(int var1, boolean var2) + { + this.parent.selectModIndex(var1); + } + + @Override + protected boolean isSelected(int var1) + { + return this.parent.modIndexSelected(var1); + } + + @Override + protected void drawBackground() + { + this.parent.drawDefaultBackground(); + } + + @Override + protected int getContentHeight() + { + return (this.getSize()) * 35 + 1; + } + + @Override + protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator var5) + { + ModContainer mc=mods.get(listIndex); + if (Loader.instance().getModState(mc)==ModState.DISABLED) + { + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); + } + else + { + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC); + this.parent.getFontRenderer().drawString(this.parent.getFontRenderer().trimStringToWidth(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC); + } + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSortingProblem.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSortingProblem.java new file mode 100644 index 0000000..61756ee --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiSortingProblem.java @@ -0,0 +1,50 @@ +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiScreen; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.toposort.ModSortingException; +import cpw.mods.fml.common.toposort.ModSortingException.SortingExceptionData; + +public class GuiSortingProblem extends GuiScreen { + private SortingExceptionData failedList; + + public GuiSortingProblem(ModSortingException modSorting) + { + this.failedList = modSorting.getExceptionData(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = Math.max(85 - (failedList.getVisitedNodes().size() + 3) * 10, 10); + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, "A mod sorting cycle was detected and loading cannot continue", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, String.format("The first mod in the cycle is %s", failedList.getFirstBadNode()), this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, "The remainder of the cycle involves these mods", this.width / 2, offset, 0xFFFFFF); + offset+=5; + for (ModContainer mc : failedList.getVisitedNodes()) + { + offset+=10; + this.drawCenteredString(this.fontRendererObj, String.format("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()), this.width / 2, offset, 0xEEEEEE); + } + offset+=20; + this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiWrongMinecraft.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiWrongMinecraft.java new file mode 100644 index 0000000..97a54f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/GuiWrongMinecraft.java @@ -0,0 +1,53 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client; + +import net.minecraft.client.gui.GuiErrorScreen; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.WrongMinecraftVersionException; + +public class GuiWrongMinecraft extends GuiErrorScreen +{ + private WrongMinecraftVersionException wrongMC; + public GuiWrongMinecraft(WrongMinecraftVersionException wrongMC) + { + super(null,null); + this.wrongMC = wrongMC; + } + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + } + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int offset = 75; + this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); + offset+=10; + this.drawCenteredString(this.fontRendererObj, String.format("The mod listed below does not want to run in Minecraft version %s", Loader.instance().getMinecraftModContainer().getVersion()), this.width / 2, offset, 0xFFFFFF); + offset+=5; + offset+=10; + this.drawCenteredString(this.fontRendererObj, String.format("%s (%s) wants Minecraft %s", wrongMC.mod.getName(), wrongMC.mod.getModId(), wrongMC.mod.acceptableMinecraftVersionRange()), this.width / 2, offset, 0xEEEEEE); + offset+=20; + this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/IModGuiFactory.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/IModGuiFactory.java new file mode 100644 index 0000000..2523603 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/IModGuiFactory.java @@ -0,0 +1,129 @@ +package cpw.mods.fml.client; + +import java.util.List; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; + +public interface IModGuiFactory { + /** + * Called when instantiated to initialize with the active minecraft instance. + * + * @param minecraftInstance the instance + */ + public void initialize(Minecraft minecraftInstance); + /** + * Return the name of a class extending {@link GuiScreen}. This class will + * be instantiated when the "config" button is pressed in the mod list. It will + * have a single argument constructor - the "parent" screen, the same as all + * Minecraft GUIs. The expected behaviour is that this screen will replace the + * "mod list" screen completely, and will return to the mod list screen through + * the parent link, once the appropriate action is taken from the config screen. + * + * A null from this method indicates that the mod does not provide a "config" + * button GUI screen, and the config button will be hidden/disabled. + * + * This config GUI is anticipated to provide configuration to the mod in a friendly + * visual way. It should not be abused to set internals such as IDs (they're gonna + * keep disappearing anyway), but rather, interesting behaviours. This config GUI + * is never run when a server game is running, and should be used to configure + * desired behaviours that affect server state. Costs, mod game modes, stuff like that + * can be changed here. + * + * @return A class that will be instantiated on clicks on the config button + * or null if no GUI is desired. + */ + public Class mainConfigGuiClass(); + + + /** + * Return a list of the "runtime" categories this mod wishes to populate with + * GUI elements. + * + * Runtime categories are created on demand and organized in a 'lite' tree format. + * The parent represents the parent node in the tree. There is one special parent + * 'Help' that will always list first, and is generally meant to provide Help type + * content for mods. The remaining parents will sort alphabetically, though + * this may change if there is a lot of alphabetic abuse. "AAA" is probably never a valid + * category parent. + * + * Runtime configuration itself falls into two flavours: in-game help, which is + * generally non interactive except for the text it wishes to show, and client-only + * affecting behaviours. This would include things like toggling minimaps, or cheat modes + * or anything NOT affecting the behaviour of the server. Please don't abuse this to + * change the state of the server in any way, this is intended to behave identically + * when the server is local or remote. + * + * @return the set of options this mod wishes to have available, or empty if none + */ + public Set runtimeGuiCategories(); + + /** + * Return an instance of a {@link RuntimeOptionGuiHandler} that handles painting the + * right hand side option screen for the specified {@link RuntimeOptionCategoryElement}. + * + * @param element The element we wish to paint for + * @return The Handler for painting it + */ + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element); + + /** + * Represents an option category and entry in the runtime gui options list. + * + * @author cpw + * + */ + public static class RuntimeOptionCategoryElement { + public final String parent; + public final String child; + + public RuntimeOptionCategoryElement(String parent, String child) + { + this.parent = parent; + this.child = child; + } + } + + /** + * Responsible for painting the mod specific section of runtime options GUI for a particular category + * + * @author cpw + * + */ + public interface RuntimeOptionGuiHandler { + /** + * Called to add widgets to the screen, such as buttons. + * GUI identifier numbers should start at 100 and increase. + * The callback will be through {@link #actionCallback(int)} + * + * @param x X + * @param y Y + * @param w width + * @param h height + */ + public void addWidgets(List widgetList, int x, int y, int w, int h); + + /** + * Called to paint the rectangle specified. + * @param x X + * @param y Y + * @param w width + * @param h height + */ + public void paint(int x, int y, int w, int h); + + /** + * Called if a widget with id >= 100 is fired. + * + * @param actionId the actionId of the firing widget + */ + public void actionCallback(int actionId); + + /** + * Called when this handler is about to go away (probably replaced by another one, or closing the + * option screen) + */ + public void close(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/SplashProgress.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/SplashProgress.java new file mode 100644 index 0000000..d61e086 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/SplashProgress.java @@ -0,0 +1,769 @@ +package cpw.mods.fml.client; + +import static org.lwjgl.opengl.GL11.*; +import static org.lwjgl.opengl.GL12.*; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.lang.Thread.UncaughtExceptionHandler; +import java.nio.IntBuffer; +import java.util.Iterator; +import java.util.Properties; +import java.util.concurrent.Semaphore; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.FileResourcePack; +import net.minecraft.client.resources.FolderResourcePack; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.crash.CrashReport; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.util.ResourceLocation; + +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.Level; +import org.lwjgl.BufferUtils; +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.Drawable; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.SharedDrawable; +import org.lwjgl.util.glu.GLU; + +import cpw.mods.fml.common.EnhancedRuntimeException; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ICrashCallable; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ProgressManager; +import cpw.mods.fml.common.ProgressManager.ProgressBar; +import cpw.mods.fml.common.asm.FMLSanityChecker; + +/** + * @deprecated not a stable API, will break, don't use this yet + */ +@Deprecated +public class SplashProgress +{ + private static Drawable d; + private static volatile boolean pause = false; + private static volatile boolean done = false; + private static Thread thread; + private static volatile Throwable threadError; + private static int angle = 0; + private static final Lock lock = new ReentrantLock(true); + private static SplashFontRenderer fontRenderer; + + private static final IResourcePack mcPack = Minecraft.getMinecraft().mcDefaultResourcePack; + private static final IResourcePack fmlPack = createResourcePack(FMLSanityChecker.fmlLocation); + private static IResourcePack miscPack; + + private static Texture fontTexture; + private static Texture logoTexture; + private static Texture forgeTexture; + + private static Properties config; + + private static boolean enabled; + private static boolean rotate; + private static int logoOffset; + private static int backgroundColor; + private static int fontColor; + private static int barBorderColor; + private static int barColor; + private static int barBackgroundColor; + static final Semaphore mutex = new Semaphore(1); + + private static String getString(String name, String def) + { + String value = config.getProperty(name, def); + config.setProperty(name, value); + return value; + } + + private static boolean getBool(String name, boolean def) + { + return Boolean.parseBoolean(getString(name, Boolean.toString(def))); + } + + private static int getInt(String name, int def) + { + return Integer.decode(getString(name, Integer.toString(def))); + } + + private static int getHex(String name, int def) + { + return Integer.decode(getString(name, "0x" + Integer.toString(def, 16).toUpperCase())); + } + + public static void start() + { + File configFile = new File(Minecraft.getMinecraft().mcDataDir, "config/splash.properties"); + FileReader r = null; + config = new Properties(); + try + { + r = new FileReader(configFile); + config.load(r); + } + catch(IOException e) + { + FMLLog.info("Could not load splash.properties, will create a default one"); + } + finally + { + IOUtils.closeQuietly(r); + } + + // Enable if we have the flag, and there's either no optifine, or optifine has added a key to the blackboard ("optifine.ForgeSplashCompatible") + // Optifine authors - add this key to the blackboard if you feel your modifications are now compatible with this code. + enabled = getBool("enabled", true) && ( (!FMLClientHandler.instance().hasOptifine()) || Launch.blackboard.containsKey("optifine.ForgeSplashCompatible")); + rotate = getBool("rotate", false); + logoOffset = getInt("logoOffset", 0); + backgroundColor = getHex("background", 0xFFFFFF); + fontColor = getHex("font", 0x000000); + barBorderColor = getHex("barBorder", 0xC0C0C0); + barColor = getHex("bar", 0xCB3D35); + barBackgroundColor = getHex("barBackground", 0xFFFFFF); + + final ResourceLocation fontLoc = new ResourceLocation(getString("fontTexture", "textures/font/ascii.png")); + final ResourceLocation logoLoc = new ResourceLocation(getString("logoTexture", "textures/gui/title/mojang.png")); + final ResourceLocation forgeLoc = new ResourceLocation(getString("forgeTexture", "fml:textures/gui/forge.gif")); + + File miscPackFile = new File(Minecraft.getMinecraft().mcDataDir, getString("resourcePackPath", "resources")); + + FileWriter w = null; + try + { + w = new FileWriter(configFile); + config.store(w, "Splash screen properties"); + } + catch(IOException e) + { + FMLLog.log(Level.ERROR, e, "Could not save the splash.properties file"); + } + finally + { + IOUtils.closeQuietly(w); + } + + miscPack = createResourcePack(miscPackFile); + + if(!enabled) return; + // getting debug info out of the way, while we still can + FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable() + { + public String call() throws Exception + { + return "' Vendor: '" + glGetString(GL_VENDOR) + + "' Version: '" + glGetString(GL_VERSION) + + "' Renderer: '" + glGetString(GL_RENDERER) + + "'"; + } + + public String getLabel() + { + return "GL info"; + } + }); + CrashReport report = CrashReport.makeCrashReport(new Throwable() + { + @Override public String getMessage(){ return "This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR"; } + @Override public void printStackTrace(final PrintWriter s){ s.println(getMessage()); } + @Override public void printStackTrace(final PrintStream s) { s.println(getMessage()); } + }, "Loading screen debug info"); + System.out.println(report.getCompleteReport()); + + try + { + d = new SharedDrawable(Display.getDrawable()); + Display.getDrawable().releaseContext(); + d.makeCurrent(); + } + catch (LWJGLException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + Thread mainThread = Thread.currentThread(); + thread = new Thread(new Runnable() + { + private final int barWidth = 400; + private final int barHeight = 20; + private final int textHeight2 = 20; + private final int barOffset = 55; + + public void run() + { + setGL(); + fontTexture = new Texture(fontLoc); + logoTexture = new Texture(logoLoc); + forgeTexture = new Texture(forgeLoc); + glEnable(GL_TEXTURE_2D); + fontRenderer = new SplashFontRenderer(); + glDisable(GL_TEXTURE_2D); + while(!done) + { + ProgressBar first = null, penult = null, last = null; + Iterator i = ProgressManager.barIterator(); + while(i.hasNext()) + { + if(first == null) first = i.next(); + else + { + penult = last; + last = i.next(); + } + } + + glClear(GL_COLOR_BUFFER_BIT); + + // matrix setup + int w = Display.getWidth(); + int h = Display.getHeight(); + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(320 - w/2, 320 + w/2, 240 + h/2, 240 - h/2, -1, 1); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // mojang logo + setColor(backgroundColor); + glEnable(GL_TEXTURE_2D); + logoTexture.bind(); + glBegin(GL_QUADS); + logoTexture.texCoord(0, 0, 0); + glVertex2f(320 - 256, 240 - 256); + logoTexture.texCoord(0, 0, 1); + glVertex2f(320 - 256, 240 + 256); + logoTexture.texCoord(0, 1, 1); + glVertex2f(320 + 256, 240 + 256); + logoTexture.texCoord(0, 1, 0); + glVertex2f(320 + 256, 240 - 256); + glEnd(); + glDisable(GL_TEXTURE_2D); + + // bars + if(first != null) + { + glPushMatrix(); + glTranslatef(320 - (float)barWidth / 2, 310, 0); + drawBar(first); + if(penult != null) + { + glTranslatef(0, barOffset, 0); + drawBar(penult); + } + if(last != null) + { + glTranslatef(0, barOffset, 0); + drawBar(last); + } + glPopMatrix(); + } + + angle += 1; + + // forge logo + setColor(backgroundColor); + float fw = (float)forgeTexture.getWidth() / 2 / 2; + float fh = (float)forgeTexture.getHeight() / 2 / 2; + if(rotate) + { + float sh = Math.max(fw, fh); + glTranslatef(320 + w/2 - sh - logoOffset, 240 + h/2 - sh - logoOffset, 0); + glRotatef(angle, 0, 0, 1); + } + else + { + glTranslatef(320 + w/2 - fw - logoOffset, 240 + h/2 - fh - logoOffset, 0); + } + int f = (angle / 10) % forgeTexture.getFrames(); + glEnable(GL_TEXTURE_2D); + forgeTexture.bind(); + glBegin(GL_QUADS); + forgeTexture.texCoord(f, 0, 0); + glVertex2f(-fw, -fh); + forgeTexture.texCoord(f, 0, 1); + glVertex2f(-fw, fh); + forgeTexture.texCoord(f, 1, 1); + glVertex2f(fw, fh); + forgeTexture.texCoord(f, 1, 0); + glVertex2f(fw, -fh); + glEnd(); + glDisable(GL_TEXTURE_2D); + + // We use mutex to indicate safely to the main thread that we're taking the display global lock + // So the main thread can skip processing messages while we're updating. + // There are system setups where this call can pause for a while, because the GL implementation + // is trying to impose a framerate or other thing is occurring. Without the mutex, the main + // thread would delay waiting for the same global display lock + mutex.acquireUninterruptibly(); + Display.update(); + // As soon as we're done, we release the mutex. The other thread can now ping the processmessages + // call as often as it wants until we get get back here again + mutex.release(); + if(pause) + { + clearGL(); + setGL(); + } + Display.sync(100); + } + clearGL(); + } + + private void setColor(int color) + { + glColor3ub((byte)((color >> 16) & 0xFF), (byte)((color >> 8) & 0xFF), (byte)(color & 0xFF)); + } + + private void drawBox(int w, int h) + { + glBegin(GL_QUADS); + glVertex2f(0, 0); + glVertex2f(0, h); + glVertex2f(w, h); + glVertex2f(w, 0); + glEnd(); + } + + private void drawBar(ProgressBar b) + { + glPushMatrix(); + // title - message + setColor(fontColor); + glScalef(2, 2, 1); + glEnable(GL_TEXTURE_2D); + fontRenderer.drawString(b.getTitle() + " - " + b.getMessage(), 0, 0, 0x000000); + glDisable(GL_TEXTURE_2D); + glPopMatrix(); + // border + glPushMatrix(); + glTranslatef(0, textHeight2, 0); + setColor(barBorderColor); + drawBox(barWidth, barHeight); + // interior + setColor(barBackgroundColor); + glTranslatef(1, 1, 0); + drawBox(barWidth - 2, barHeight - 2); + // slidy part + setColor(barColor); + drawBox((barWidth - 2) * (b.getStep() + 1) / (b.getSteps() + 1), barHeight - 2); // Step can sometimes be 0. + // progress text + String progress = "" + b.getStep() + "/" + b.getSteps(); + glTranslatef(((float)barWidth - 2) / 2 - fontRenderer.getStringWidth(progress), 2, 0); + setColor(fontColor); + glScalef(2, 2, 1); + glEnable(GL_TEXTURE_2D); + fontRenderer.drawString(progress, 0, 0, 0x000000); + glPopMatrix(); + } + + private void setGL() + { + lock.lock(); + try + { + Display.getDrawable().makeCurrent(); + } + catch (LWJGLException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + glClearColor((float)((backgroundColor >> 16) & 0xFF) / 0xFF, (float)((backgroundColor >> 8) & 0xFF) / 0xFF, (float)(backgroundColor & 0xFF) / 0xFF, 1); + glDisable(GL_LIGHTING); + glDisable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + private void clearGL() + { + Minecraft mc = Minecraft.getMinecraft(); + mc.displayWidth = Display.getWidth(); + mc.displayHeight = Display.getHeight(); + mc.resize(mc.displayWidth, mc.displayHeight); + glClearColor(1, 1, 1, 1); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GREATER, .1f); + try + { + Display.getDrawable().releaseContext(); + } + catch (LWJGLException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + finally + { + lock.unlock(); + } + } + }); + thread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() + { + public void uncaughtException(Thread t, Throwable e) + { + FMLLog.log(Level.ERROR, e, "Splash thread Exception"); + threadError = e; + } + }); + thread.start(); + checkThreadState(); + } + + private static void checkThreadState() + { + if(thread.getState() == Thread.State.TERMINATED || threadError != null) + { + throw new IllegalStateException("Splash thread", threadError); + } + } + /** + * Call before you need to explicitly modify GL context state during loading. + * Resource loading doesn't usually require this call. + * Call {@link #resume()} when you're done. + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static void pause() + { + if(!enabled) return; + checkThreadState(); + pause = true; + lock.lock(); + try + { + d.releaseContext(); + Display.getDrawable().makeCurrent(); + } + catch (LWJGLException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + /** + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static void resume() + { + if(!enabled) return; + checkThreadState(); + pause = false; + try + { + Display.getDrawable().releaseContext(); + d.makeCurrent(); + } + catch (LWJGLException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + lock.unlock(); + } + + public static void finish() + { + if(!enabled) return; + try + { + checkThreadState(); + done = true; + thread.join(); + d.releaseContext(); + Display.getDrawable().makeCurrent(); + fontTexture.delete(); + logoTexture.delete(); + forgeTexture.delete(); + } + catch (Exception e) + { + e.printStackTrace(); + if (disableSplash()) + { + throw new EnhancedRuntimeException(e) + { + @Override + protected void printStackTrace(WrappedPrintStream stream) + { + stream.println("SplashProgress has detected a error loading Minecraft."); + stream.println("This can sometimes be caused by bad video drivers."); + stream.println("We have automatically disabeled the new Splash Screen in config/splash.properties."); + stream.println("Try reloading minecraft before reporting any errors."); + } + }; + } + else + { + throw new EnhancedRuntimeException(e) + { + @Override + protected void printStackTrace(WrappedPrintStream stream) + { + stream.println("SplashProgress has detected a error loading Minecraft."); + stream.println("This can sometimes be caused by bad video drivers."); + stream.println("Please try disabeling the new Splash Screen in config/splash.properties."); + stream.println("After doing so, try reloading minecraft before reporting any errors."); + } + }; + } + } + } + + private static boolean disableSplash() + { + File configFile = new File(Minecraft.getMinecraft().mcDataDir, "config/splash.properties"); + File parent = configFile.getParentFile(); + if (!parent.exists()) + parent.mkdirs(); + + FileReader r = null; + enabled = false; + config.setProperty("enabled", "false"); + + FileWriter w = null; + try + { + w = new FileWriter(configFile); + config.store(w, "Splash screen properties"); + } + catch(IOException e) + { + FMLLog.log(Level.ERROR, e, "Could not save the splash.properties file"); + return false; + } + finally + { + IOUtils.closeQuietly(w); + } + return true; + } + + private static IResourcePack createResourcePack(File file) + { + if(file.isDirectory()) + { + return new FolderResourcePack(file); + } + else + { + return new FileResourcePack(file); + } + } + + private static final IntBuffer buf = BufferUtils.createIntBuffer(4 * 1024 * 1024); + + private static class Texture + { + private final ResourceLocation location; + private final int name; + private final int width; + private final int height; + private final int frames; + private final int size; + + public Texture(ResourceLocation location) + { + InputStream s = null; + try + { + this.location = location; + s = open(location); + ImageInputStream stream = ImageIO.createImageInputStream(s); + Iterator readers = ImageIO.getImageReaders(stream); + if(!readers.hasNext()) throw new IOException("No suitable reader found for image" + location); + ImageReader reader = readers.next(); + reader.setInput(stream); + frames = reader.getNumImages(true); + BufferedImage[] images = new BufferedImage[frames]; + for(int i = 0; i < frames; i++) + { + images[i] = reader.read(i); + } + reader.dispose(); + int size = 1; + width = images[0].getWidth(); + height = images[0].getHeight(); + while((size / width) * (size / height) < frames) size *= 2; + this.size = size; + glEnable(GL_TEXTURE_2D); + synchronized(SplashProgress.class) + { + name = glGenTextures(); + glBindTexture(GL_TEXTURE_2D, name); + } + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); + checkGLError("Texture creation"); + for(int i = 0; i * (size / width) < frames; i++) + { + for(int j = 0; i * (size / width) + j < frames && j < size / width; j++) + { + buf.clear(); + BufferedImage image = images[i * (size / width) + j]; + for(int k = 0; k < height; k++) + { + for(int l = 0; l < width; l++) + { + buf.put(image.getRGB(l, k)); + } + } + buf.position(0).limit(width * height); + glTexSubImage2D(GL_TEXTURE_2D, 0, j * width, i * height, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buf); + checkGLError("Texture uploading"); + } + } + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + } + catch(IOException e) + { + e.printStackTrace(); + throw new RuntimeException(e); + } + finally + { + IOUtils.closeQuietly(s); + } + } + + public ResourceLocation getLocation() + { + return location; + } + + public int getName() + { + return name; + } + + public int getWidth() + { + return width; + } + + public int getHeight() + { + return height; + } + + public int getFrames() + { + return frames; + } + + public int getSize() + { + return size; + } + + public void bind() + { + glBindTexture(GL_TEXTURE_2D, name); + } + + public void delete() + { + glDeleteTextures(name); + } + + public float getU(int frame, float u) + { + return width * (frame % (size / width) + u) / size; + } + + public float getV(int frame, float v) + { + return height * (frame / (size / width) + v) / size; + } + + public void texCoord(int frame, float u, float v) + { + glTexCoord2f(getU(frame, u), getV(frame, v)); + } + } + + private static class SplashFontRenderer extends FontRenderer + { + public SplashFontRenderer() + { + super(Minecraft.getMinecraft().gameSettings, fontTexture.getLocation(), null, false); + super.onResourceManagerReload(null); + } + + @Override + protected void bindTexture(ResourceLocation location) + { + if(location != locationFontTexture) throw new IllegalArgumentException(); + fontTexture.bind(); + } + + @Override + protected InputStream getResourceInputStream(ResourceLocation location) throws IOException + { + return Minecraft.getMinecraft().mcDefaultResourcePack.getInputStream(location); + } + } + + public static void drawVanillaScreen() throws LWJGLException + { + if(!enabled) + { + Minecraft.getMinecraft().loadScreen(); + } + } + + public static void clearVanillaResources(TextureManager renderEngine, ResourceLocation mojangLogo) + { + if(!enabled) + { + renderEngine.deleteTexture(mojangLogo); + } + } + + public static void checkGLError(String where) + { + int err = GL11.glGetError(); + if (err != 0) + { + throw new IllegalStateException(where + ": " + GLU.gluErrorString(err)); + } + } + + private static InputStream open(ResourceLocation loc) throws IOException + { + if(miscPack.resourceExists(loc)) + { + return miscPack.getInputStream(loc); + } + else if(fmlPack.resourceExists(loc)) + { + return fmlPack.getInputStream(loc); + } + return mcPack.getInputStream(loc); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/ConfigGuiType.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/ConfigGuiType.java new file mode 100644 index 0000000..68d4712 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/ConfigGuiType.java @@ -0,0 +1,24 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +public enum ConfigGuiType +{ + STRING, + INTEGER, + BOOLEAN, + DOUBLE, + COLOR, + MOD_ID, + CONFIG_CATEGORY; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/DummyConfigElement.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/DummyConfigElement.java new file mode 100644 index 0000000..1f8078d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/DummyConfigElement.java @@ -0,0 +1,430 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.config.GuiEditArrayEntries.IArrayEntry; + +import net.minecraft.client.resources.I18n; + + +/** + * This class's main purpose is to provide the necessary objects for a sample Config GUI for FML, although + * there may be practical uses for the objects defined here such as using the DummyCategoryElement object as a + * wrapper for a custom IGuiConfigListEntry object that opens a special screen. + * + * @author bspkrs + */ +public class DummyConfigElement implements IConfigElement +{ + protected boolean isProperty = true; + protected boolean isList = false; + protected ConfigGuiType type; + protected String name; + protected String langKey; + protected Object value; + protected Object defaultValue; + protected T[] values; + protected T[] defaultValues; + protected String[] validValues; + protected Pattern validStringPattern; + protected T minValue; + protected T maxValue; + protected boolean requiresWorldRestart = false; + protected boolean requiresMcRestart = false; + protected boolean isListFixedLength = false; + protected int maxListLength = -1; + @SuppressWarnings("rawtypes") + protected List childElements; + @SuppressWarnings("rawtypes") + protected Class configEntryClass; + protected Class arrayEntryClass; + + /** + * This class provides a Dummy Category IConfigElement. It can be used to define a custom list of GUI entries that will + * appear on the child screen or to specify a custom IGuiConfigListEntryfor a special category. + */ + public static class DummyCategoryElement extends DummyConfigElement + { + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, List childElements) + { + this(name, langKey, childElements, (Class) null); + } + + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, Class customListEntryClass) + { + this(name, langKey, new ArrayList(), customListEntryClass); + } + + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, List childElements, Class customListEntryClass) + { + super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey); + this.childElements = childElements; + this.configEntryClass = customListEntryClass; + isProperty = false; + } + } + + /** + * This class provides a dummy array-type IConfigElement. + */ + public static class DummyListElement extends DummyConfigElement + { + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Pattern validStringPattern, T minValue, T maxValue) + { + super(name, (T) null, type, langKey, minValue, maxValue); + this.defaultValues = defaultValues; + this.values = defaultValues; + this.isListFixedLength = isListFixedLength; + this.maxListLength = maxListLength; + this.validStringPattern = validStringPattern; + isList = true; + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey) + { + this(name, defaultValues, type, langKey, false, -1, (Pattern) null, (T) null, (T) null); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength) + { + this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, (T) null, (T) null); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength) + { + this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, (T) null, (T) null); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, T minValue, T maxValue) + { + this(name, defaultValues, type, langKey, false, -1, (Pattern) null, minValue, maxValue); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, T minValue, T maxValue) + { + this(name, defaultValues, type, langKey, isListFixedLength, -1, (Pattern) null, minValue, maxValue); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, T minValue, T maxValue) + { + this(name, defaultValues, type, langKey, false, maxListLength, (Pattern) null, minValue, maxValue); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, T minValue, T maxValue) + { + this(name, defaultValues, type, langKey, isListFixedLength, maxListLength, (Pattern) null, minValue, maxValue); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, Pattern validStringPattern) + { + this(name, defaultValues, type, langKey, false, -1, validStringPattern, (T) null, (T) null); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, Pattern validStringPattern) + { + this(name, defaultValues, type, langKey, isListFixedLength, -1, validStringPattern, (T) null, (T) null); + } + + public DummyListElement(String name, T[] defaultValues, ConfigGuiType type, String langKey, int maxListLength, Pattern validStringPattern) + { + this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (T) null, (T) null); + } + + @SuppressWarnings("rawtypes") + public DummyListElement setCustomEditListEntryClass(Class clazz) + { + this.arrayEntryClass = clazz; + return this; + } + + @Override + public Object getDefault() + { + return Arrays.toString(this.defaultValues); + } + } + + @SuppressWarnings("unchecked") + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue) + { + this.name = name; + this.defaultValue = defaultValue; + this.value = defaultValue; + this.type = type; + this.langKey = langKey; + this.validValues = validValues; + this.validStringPattern = validStringPattern; + if (minValue == null) + { + if (type == ConfigGuiType.INTEGER) + this.minValue = (T) (Integer) Integer.MIN_VALUE; + else if (type == ConfigGuiType.DOUBLE) + this.minValue = (T) (Double) (-Double.MAX_VALUE); + } + else + this.minValue = minValue; + if (maxValue == null) + { + if (type == ConfigGuiType.INTEGER) + this.maxValue = (T) (Integer) Integer.MAX_VALUE; + else if (type == ConfigGuiType.DOUBLE) + this.maxValue = (T) (Double) Double.MAX_VALUE; + } + else + this.maxValue = maxValue; + } + + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, Pattern validStringPattern) + { + this(name, defaultValue, type, langKey, (String[]) null, validStringPattern, (T) null, (T) null); + } + + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues) + { + this(name, defaultValue, type, langKey, validValues, (Pattern) null, (T) null, (T) null); + } + + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey) + { + this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, (T) null, (T) null); + } + + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, T minValue, T maxValue) + { + this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, minValue, maxValue); + } + + @SuppressWarnings("rawtypes") + public DummyConfigElement setCustomListEntryClass(Class clazz) + { + this.configEntryClass = clazz; + return this; + } + + @Override + public boolean isProperty() + { + return isProperty; + } + + @SuppressWarnings("rawtypes") + public IConfigElement setConfigEntryClass(Class clazz) + { + this.configEntryClass = clazz; + return this; + } + + @SuppressWarnings("rawtypes") + @Override + public Class getConfigEntryClass() + { + return configEntryClass; + } + + @SuppressWarnings("rawtypes") + public IConfigElement setArrayEntryClass(Class clazz) + { + this.arrayEntryClass = clazz; + return this; + } + + @Override + public Class getArrayEntryClass() + { + return arrayEntryClass; + } + + @Override + public String getName() + { + return name; + } + + @Override + public String getQualifiedName() + { + return name; + } + + @Override + public String getLanguageKey() + { + return langKey; + } + + @Override + public String getComment() + { + return I18n.format(langKey + ".tooltip"); + } + + @SuppressWarnings("rawtypes") + @Override + public List getChildElements() + { + return childElements; + } + + @Override + public ConfigGuiType getType() + { + return type; + } + + @Override + public boolean isList() + { + return isList; + } + + @Override + public boolean isListLengthFixed() + { + return this.isListFixedLength; + } + + @Override + public int getMaxListLength() + { + return this.maxListLength; + } + + @Override + public boolean isDefault() + { + if (isProperty) + { + if (!isList) + { + if (value != null) + return value.equals(defaultValue); + else + return defaultValue == null; + } + else + { + return Arrays.deepEquals(values, defaultValues); + } + } + + return true; + } + + @Override + public Object getDefault() + { + return defaultValue; + } + + @Override + public T[] getDefaults() + { + return defaultValues; + } + + @Override + public void setToDefault() + { + if (isList) + this.values = Arrays.copyOf(this.defaultValues, this.defaultValues.length); + else + this.value = defaultValue; + } + + public IConfigElement setRequiresWorldRestart(boolean requiresWorldRestart) + { + this.requiresWorldRestart = requiresWorldRestart; + return this; + } + + @Override + public boolean requiresWorldRestart() + { + return requiresWorldRestart; + } + + @Override + public boolean showInGui() + { + return true; + } + + public IConfigElement setRequiresMcRestart(boolean requiresMcRestart) + { + this.requiresMcRestart = this.requiresWorldRestart = requiresMcRestart; + return this; + } + + @Override + public boolean requiresMcRestart() + { + return requiresMcRestart; + } + + @Override + public String[] getValidValues() + { + return validValues; + } + + @Override + public Pattern getValidationPattern() + { + return validStringPattern; + } + + @Override + public Object get() + { + return value; + } + + @Override + public T[] getList() + { + return values; + } + + @Override + public void set(T value) + { + defaultValue = value; + } + + @Override + public void set(T[] aVal) + { + defaultValues = aVal; + } + + @Override + public T getMinValue() + { + return minValue; + } + + @Override + public T getMaxValue() + { + return maxValue; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiButtonExt.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiButtonExt.java new file mode 100644 index 0000000..8163718 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiButtonExt.java @@ -0,0 +1,80 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +/** + * This class provides a button that fixes several bugs present in the vanilla GuiButton drawing code. + * The gist of it is that it allows buttons of any size without gaps in the graphics and with the + * borders drawn properly. It also prevents button text from extending out of the sides of the button by + * trimming the end of the string and adding an ellipsis.

+ * + * The code that handles drawing the button is in GuiUtils. + * + * @author bspkrs + */ +public class GuiButtonExt extends GuiButton +{ + public GuiButtonExt(int id, int xPos, int yPos, String displayString) + { + super(id, xPos, yPos, displayString); + } + + public GuiButtonExt(int id, int xPos, int yPos, int width, int height, String displayString) + { + super(id, xPos, yPos, width, height, displayString); + } + + /** + * Draws this button to the screen. + */ + /** + * Draws this button to the screen. + */ + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.field_146123_n); + GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); + this.mouseDragged(mc, mouseX, mouseY); + int color = 14737632; + + if (packedFGColour != 0) + { + color = packedFGColour; + } + else if (!this.enabled) + { + color = 10526880; + } + else if (this.field_146123_n) + { + color = 16777120; + } + + String buttonText = this.displayString; + int strWidth = mc.fontRenderer.getStringWidth(buttonText); + int ellipsisWidth = mc.fontRenderer.getStringWidth("..."); + + if (strWidth > width - 6 && strWidth > ellipsisWidth) + buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - ellipsisWidth).trim() + "..."; + + this.drawCenteredString(mc.fontRenderer, buttonText, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, color); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiCheckBox.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiCheckBox.java new file mode 100644 index 0000000..062868f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiCheckBox.java @@ -0,0 +1,91 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +/** + * This class provides a checkbox style control. + * + * @author bspkrs + */ +public class GuiCheckBox extends GuiButton +{ + private boolean isChecked; + private int boxWidth; + + public GuiCheckBox(int id, int xPos, int yPos, String displayString, boolean isChecked) + { + super(id, xPos, yPos, displayString); + this.isChecked = isChecked; + this.boxWidth = 11; + this.height = 11; + this.width = this.boxWidth + 2 + Minecraft.getMinecraft().fontRenderer.getStringWidth(displayString); + } + + /** + * Draws this button to the screen. + */ + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.boxWidth && mouseY < this.yPosition + this.height; + GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); + this.mouseDragged(mc, mouseX, mouseY); + int color = 14737632; + + if (packedFGColour != 0) + { + color = packedFGColour; + } + else if (!this.enabled) + { + color = 10526880; + } + + if (this.isChecked) + this.drawCenteredString(mc.fontRenderer, "x", this.xPosition + this.boxWidth / 2 + 1, this.yPosition + 1, 14737632); + + this.drawString(mc.fontRenderer, displayString, xPosition + this.boxWidth + 2, yPosition + 2, color); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + @Override + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height) + { + this.isChecked = !this.isChecked; + return true; + } + + return false; + } + + public boolean isChecked() + { + return this.isChecked; + } + + public void setIsChecked(boolean isChecked) + { + this.isChecked = isChecked; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfig.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfig.java new file mode 100644 index 0000000..e722fe5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfig.java @@ -0,0 +1,374 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; + +import org.lwjgl.input.Keyboard; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent; +import cpw.mods.fml.client.event.ConfigChangedEvent.PostConfigChangedEvent; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.Event.Result; + +/** + * This class is the base GuiScreen for all config GUI screens. It can be extended by mods to provide the top-level config screen + * that will be called when the Config button is clicked from the Main Menu Mods list. + * + * @author bspkrs + */ +public class GuiConfig extends GuiScreen +{ + /** + * A reference to the screen object that created this. Used for navigating between screens. + */ + public final GuiScreen parentScreen; + public String title = "Config GUI"; + public String titleLine2; + @SuppressWarnings("rawtypes") + public final List configElements; + @SuppressWarnings("rawtypes") + public final List initEntries; + public GuiConfigEntries entryList; + private GuiButtonExt btnDefaultAll; + private GuiButtonExt btnUndoAll; + private GuiCheckBox chkApplyGlobally; + public final String modID; + /** + * When set to a non-null value the OnConfigChanged and PostConfigChanged events will be posted when the Done button is pressed + * if any configElements were changed (includes child screens). If not defined, the events will be posted if the parent gui is null + * or if the parent gui is not an instance of GuiConfig. + */ + public final String configID; + public final boolean isWorldRunning; + public final boolean allRequireWorldRestart; + public final boolean allRequireMcRestart; + public boolean needsRefresh = true; + private HoverChecker undoHoverChecker; + private HoverChecker resetHoverChecker; + private HoverChecker checkBoxHoverChecker; + + /** + * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. If a non-null value is passed for configID, + * the OnConfigChanged and PostConfigChanged events will be posted when the Done button is pressed if any configElements were changed + * (includes child screens). If configID is not defined, the events will be posted if the parent gui is null or if the parent gui + * is not an instance of GuiConfig. + * + * @param parentScreen the parent GuiScreen object + * @param configElements a List of IConfigProperty objects + * @param modID the mod ID for the mod whose config settings will be edited + * @param configID an identifier that will be passed to the OnConfigChanged and PostConfigChanged events. Setting this value will force + * the save action to be called when the Done button is pressed on this screen if any configElements were changed. + * @param allRequireWorldRestart send true if all configElements on this screen require a world restart + * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted + * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being + * edited. + */ + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) + { + this(parentScreen, configElements, modID, configID, allRequireWorldRestart, allRequireMcRestart, title, null); + } + + /** + * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. This constructor passes null for configID. + * If configID is not defined, the events will be posted if the parent gui is null or if the parent gui is not an instance of GuiConfig. + * + * @param parentScreen the parent GuiScreen object + * @param configElements a List of IConfigProperty objects + * @param modID the mod ID for the mod whose config settings will be edited + * @param allRequireWorldRestart send true if all configElements on this screen require a world restart + * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted + * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being + * edited. + */ + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) + { + this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, null); + } + + /** + * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. This constructor passes null for configID. + * If configID is not defined, the events will be posted if the parent gui is null or if the parent gui is not an instance of GuiConfig. + * + * @param parentScreen the parent GuiScreen object + * @param configElements a List of IConfigProperty objects + * @param modID the mod ID for the mod whose config settings will be edited + * @param allRequireWorldRestart send true if all configElements on this screen require a world restart + * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted + * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being + * edited. + * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category + * currently being edited. + */ + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) + { + this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, titleLine2); + } + + /** + * GuiConfig constructor that will use ConfigChangedEvent when editing is concluded. titleLine2 is specified in this constructor. + * If a non-null value is passed for configID, the OnConfigChanged and PostConfigChanged events will be posted when the Done button is + * pressed if any configElements were changed (includes child screens). If configID is not defined, the events will be posted if the parent + * gui is null or if the parent gui is not an instance of GuiConfig. + * + * @param parentScreen the parent GuiScreen object + * @param configElements a List of IConfigProperty objects + * @param modID the mod ID for the mod whose config settings will be edited + * @param configID an identifier that will be passed to the OnConfigChanged and PostConfigChanged events + * @param allRequireWorldRestart send true if all configElements on this screen require a world restart + * @param allRequireMcRestart send true if all configElements on this screen require MC to be restarted + * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being + * edited. + * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category + * currently being edited. + */ + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) + { + this.mc = Minecraft.getMinecraft(); + this.parentScreen = parentScreen; + this.configElements = configElements; + this.entryList = new GuiConfigEntries(this, mc); + this.initEntries = new ArrayList(entryList.listEntries); + this.allRequireWorldRestart = allRequireWorldRestart; + this.allRequireMcRestart = allRequireMcRestart; + this.modID = modID; + this.configID = configID; + this.isWorldRunning = mc.theWorld != null; + if (title != null) + this.title = title; + this.titleLine2 = titleLine2; + if (this.titleLine2 != null && this.titleLine2.startsWith(" > ")) + this.titleLine2 = this.titleLine2.replaceFirst(" > ", ""); + } + + public static String getAbridgedConfigPath(String path) + { + Minecraft mc = Minecraft.getMinecraft(); + if (mc.mcDataDir.getAbsolutePath().endsWith(".")) + return path.replace("\\", "/").replace(mc.mcDataDir.getAbsolutePath().replace("\\", "/").substring(0, mc.mcDataDir.getAbsolutePath().length() - 1), "/.minecraft/"); + else + return path.replace("\\", "/").replace(mc.mcDataDir.getAbsolutePath().replace("\\", "/"), "/.minecraft"); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + Keyboard.enableRepeatEvents(true); + + if (this.entryList == null || this.needsRefresh) + { + this.entryList = new GuiConfigEntries(this, mc); + this.needsRefresh = false; + } + + int undoGlyphWidth = mc.fontRenderer.getStringWidth(UNDO_CHAR) * 2; + int resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2; + int doneWidth = Math.max(mc.fontRenderer.getStringWidth(I18n.format("gui.done")) + 20, 100); + int undoWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.undoChanges")) + undoGlyphWidth + 20; + int resetWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.resetToDefault")) + resetGlyphWidth + 20; + int checkWidth = mc.fontRenderer.getStringWidth(I18n.format("fml.configgui.applyGlobally")) + 13; + int buttonWidthHalf = (doneWidth + 5 + undoWidth + 5 + resetWidth + 5 + checkWidth) / 2; + this.buttonList.add(new GuiButtonExt(2000, this.width / 2 - buttonWidthHalf, this.height - 29, doneWidth, 20, I18n.format("gui.done"))); + this.buttonList.add(this.btnDefaultAll = new GuiUnicodeGlyphButton(2001, this.width / 2 - buttonWidthHalf + doneWidth + 5 + undoWidth + 5, + this.height - 29, resetWidth, 20, " " + I18n.format("fml.configgui.tooltip.resetToDefault"), RESET_CHAR, 2.0F)); + this.buttonList.add(btnUndoAll = new GuiUnicodeGlyphButton(2002, this.width / 2 - buttonWidthHalf + doneWidth + 5, + this.height - 29, undoWidth, 20, " " + I18n.format("fml.configgui.tooltip.undoChanges"), UNDO_CHAR, 2.0F)); + this.buttonList.add(chkApplyGlobally = new GuiCheckBox(2003, this.width / 2 - buttonWidthHalf + doneWidth + 5 + undoWidth + 5 + resetWidth + 5, + this.height - 24, I18n.format("fml.configgui.applyGlobally"), false)); + + this.undoHoverChecker = new HoverChecker(this.btnUndoAll, 800); + this.resetHoverChecker = new HoverChecker(this.btnDefaultAll, 800); + this.checkBoxHoverChecker = new HoverChecker(chkApplyGlobally, 800); + this.entryList.initGui(); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + @Override + public void onGuiClosed() + { + this.entryList.onGuiClosed(); + + if (this.configID != null && this.parentScreen instanceof GuiConfig) + { + GuiConfig parentGuiConfig = (GuiConfig) this.parentScreen; + parentGuiConfig.needsRefresh = true; + parentGuiConfig.initGui(); + } + + if (!(this.parentScreen instanceof GuiConfig)) + Keyboard.enableRepeatEvents(false); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.id == 2000) + { + boolean flag = true; + try + { + if ((configID != null || this.parentScreen == null || !(this.parentScreen instanceof GuiConfig)) + && (this.entryList.hasChangedEntry(true))) + { + boolean requiresMcRestart = this.entryList.saveConfigElements(); + + if (Loader.isModLoaded(modID)) + { + ConfigChangedEvent event = new OnConfigChangedEvent(modID, configID, isWorldRunning, requiresMcRestart); + FMLCommonHandler.instance().bus().post(event); + if (!event.getResult().equals(Result.DENY)) + FMLCommonHandler.instance().bus().post(new PostConfigChangedEvent(modID, configID, isWorldRunning, requiresMcRestart)); + + if (requiresMcRestart) + { + flag = false; + mc.displayGuiScreen(new GuiMessageDialog(parentScreen, "fml.configgui.gameRestartTitle", + new ChatComponentText(I18n.format("fml.configgui.gameRestartRequired")), "fml.configgui.confirmRestartMessage")); + } + + if (this.parentScreen instanceof GuiConfig) + ((GuiConfig) this.parentScreen).needsRefresh = true; + } + } + } + catch (Throwable e) + { + e.printStackTrace(); + } + + if (flag) + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 2001) + { + this.entryList.setAllToDefault(this.chkApplyGlobally.isChecked()); + } + else if (button.id == 2002) + { + this.entryList.undoAllChanges(this.chkApplyGlobally.isChecked()); + } + } + + /** + * Called when the mouse is clicked. + */ + @Override + protected void mouseClicked(int x, int y, int mouseEvent) + { + if (mouseEvent != 0 || !this.entryList.func_148179_a(x, y, mouseEvent)) + { + this.entryList.mouseClicked(x, y, mouseEvent); + super.mouseClicked(x, y, mouseEvent); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + @Override + protected void mouseMovedOrUp(int x, int y, int mouseEvent) + { + if (mouseEvent != 0 || !this.entryList.func_148181_b(x, y, mouseEvent)) + { + super.mouseMovedOrUp(x, y, mouseEvent); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + @Override + protected void keyTyped(char eventChar, int eventKey) + { + if (eventKey == Keyboard.KEY_ESCAPE) + this.mc.displayGuiScreen(parentScreen); + else + this.entryList.keyTyped(eventChar, eventKey); + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() + { + super.updateScreen(); + this.entryList.updateScreen(); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.entryList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 8, 16777215); + String title2 = this.titleLine2; + + if (title2 != null) + { + int strWidth = mc.fontRenderer.getStringWidth(title2); + int elipsisWidth = mc.fontRenderer.getStringWidth("..."); + if (strWidth > width - 6 && strWidth > elipsisWidth) + title2 = mc.fontRenderer.trimStringToWidth(title2, width - 6 - elipsisWidth).trim() + "..."; + this.drawCenteredString(this.fontRendererObj, title2, this.width / 2, 18, 16777215); + } + + this.btnUndoAll.enabled = this.entryList.areAnyEntriesEnabled(this.chkApplyGlobally.isChecked()) && this.entryList.hasChangedEntry(this.chkApplyGlobally.isChecked()); + this.btnDefaultAll.enabled = this.entryList.areAnyEntriesEnabled(this.chkApplyGlobally.isChecked()) && !this.entryList.areAllEntriesDefault(this.chkApplyGlobally.isChecked()); + super.drawScreen(mouseX, mouseY, partialTicks); + this.entryList.drawScreenPost(mouseX, mouseY, partialTicks); + if (this.undoHoverChecker.checkHover(mouseX, mouseY)) + this.drawToolTip(this.mc.fontRenderer.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.undoAll"), 300), mouseX, mouseY); + if (this.resetHoverChecker.checkHover(mouseX, mouseY)) + this.drawToolTip(this.mc.fontRenderer.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.resetAll"), 300), mouseX, mouseY); + if (this.checkBoxHoverChecker.checkHover(mouseX, mouseY)) + this.drawToolTip(this.mc.fontRenderer.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.applyGlobally"), 300), mouseX, mouseY); + } + + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) + { + this.func_146283_a(stringList, x, y); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfigEntries.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfigEntries.java new file mode 100644 index 0000000..c5b66f7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiConfigEntries.java @@ -0,0 +1,1822 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ +package cpw.mods.fml.client.config; + +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; + +/** + * This class implements the scrolling list functionality of the config GUI screens. It also provides all the default control handlers + * for the various property types. + * + * @author bspkrs + */ +public class GuiConfigEntries extends GuiListExtended +{ + public final GuiConfig owningScreen; + public final Minecraft mc; + @SuppressWarnings("rawtypes") + public List listEntries; + /** + * The max width of the label of all IConfigEntry objects. + */ + public int maxLabelTextWidth = 0; + /** + * The max x boundary of all IConfigEntry objects. + */ + public int maxEntryRightBound = 0; + /** + * The x position where the label should be drawn. + */ + public int labelX; + /** + * The x position where the control should be drawn. + */ + public int controlX; + /** + * The width of the control. + */ + public int controlWidth; + /** + * The minimum x position where the Undo/Default buttons will start + */ + public int resetX; + /** + * The x position of the scroll bar. + */ + public int scrollBarX; + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public GuiConfigEntries(GuiConfig parent, Minecraft mc) + { + super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20); + this.owningScreen = parent; + this.setShowSelectionBox(false); + this.mc = mc; + this.listEntries = new ArrayList(); +// int i = 0; +// String s = null; + + for (IConfigElement configElement : parent.configElements) + { + if (configElement != null) + { + if (configElement.isProperty() && configElement.showInGui()) // as opposed to being a child category entry + { + int length; + + // protects against language keys that are not defined in the .lang file + if (!I18n.format(configElement.getLanguageKey()).equals(configElement.getLanguageKey())) + length = mc.fontRenderer.getStringWidth(I18n.format(configElement.getLanguageKey())); + else + length = mc.fontRenderer.getStringWidth(configElement.getName()); + + if (length > this.maxLabelTextWidth) + this.maxLabelTextWidth = length; + } + } + } + + int viewWidth = this.maxLabelTextWidth + 8 + (width / 2); + labelX = (this.width / 2) - (viewWidth / 2); + controlX = labelX + maxLabelTextWidth + 8; + resetX = (this.width / 2) + (viewWidth / 2) - 45; + controlWidth = resetX - controlX - 5; + scrollBarX = this.width; + + for (IConfigElement configElement : parent.configElements) + { + if (configElement != null && configElement.showInGui()) + { + if (configElement.getConfigEntryClass() != null) + try + { + this.listEntries.add((IConfigEntry) configElement.getConfigEntryClass() + .getConstructor(GuiConfig.class, GuiConfigEntries.class, IConfigElement.class) + .newInstance(this.owningScreen, this, configElement)); + } + catch (Throwable e) + { + FMLLog.severe("There was a critical error instantiating the custom IConfigEntry for config element %s.", configElement.getName()); + e.printStackTrace(); + } + else if (configElement.isProperty()) + { + if (configElement.isList()) + this.listEntries.add(new GuiConfigEntries.ArrayEntry(this.owningScreen, this, configElement)); + else if (configElement.getType() == ConfigGuiType.BOOLEAN) + this.listEntries.add(new GuiConfigEntries.BooleanEntry(this.owningScreen, this, (IConfigElement) configElement)); + else if (configElement.getType() == ConfigGuiType.INTEGER) + this.listEntries.add(new GuiConfigEntries.IntegerEntry(this.owningScreen, this, (IConfigElement) configElement)); + else if (configElement.getType() == ConfigGuiType.DOUBLE) + this.listEntries.add(new GuiConfigEntries.DoubleEntry(this.owningScreen, this, (IConfigElement) configElement)); + else if (configElement.getType() == ConfigGuiType.COLOR) + { + if (configElement.getValidValues() != null && configElement.getValidValues().length > 0) + this.listEntries.add(new GuiConfigEntries.ChatColorEntry(this.owningScreen, this, (IConfigElement) configElement)); + else + this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, (IConfigElement) configElement)); + } + else if (configElement.getType() == ConfigGuiType.MOD_ID) + { + Map values = new TreeMap(); + for (ModContainer mod : Loader.instance().getActiveModList()) + values.put(mod.getModId(), mod.getName()); + values.put("minecraft", "Minecraft"); + this.listEntries.add(new SelectValueEntry(this.owningScreen, this, (IConfigElement) configElement, values)); + } + else if (configElement.getType() == ConfigGuiType.STRING) + { + if (configElement.getValidValues() != null && configElement.getValidValues().length > 0) + this.listEntries.add(new GuiConfigEntries.CycleValueEntry(this.owningScreen, this, (IConfigElement) configElement)); + else + this.listEntries.add(new GuiConfigEntries.StringEntry(this.owningScreen, this, (IConfigElement) configElement)); + } + } + else if (configElement.getType() == ConfigGuiType.CONFIG_CATEGORY) + this.listEntries.add(new CategoryEntry(this.owningScreen, this, configElement)); + } + } + } + + @SuppressWarnings("rawtypes") + protected void initGui() + { + this.width = owningScreen.width; + this.height = owningScreen.height; + + this.maxLabelTextWidth = 0; + for (IConfigEntry entry : this.listEntries) + if (entry.getLabelWidth() > this.maxLabelTextWidth) + this.maxLabelTextWidth = entry.getLabelWidth(); + + this.top = owningScreen.titleLine2 != null ? 33 : 23; + this.bottom = owningScreen.height - 32; + this.left = 0; + this.right = width; + int viewWidth = this.maxLabelTextWidth + 8 + (width / 2); + labelX = (this.width / 2) - (viewWidth / 2); + controlX = labelX + maxLabelTextWidth + 8; + resetX = (this.width / 2) + (viewWidth / 2) - 45; + + this.maxEntryRightBound = 0; + for (IConfigEntry entry : this.listEntries) + if (entry.getEntryRightBound() > this.maxEntryRightBound) + this.maxEntryRightBound = entry.getEntryRightBound(); + + scrollBarX = this.maxEntryRightBound + 5; + controlWidth = maxEntryRightBound - controlX - 45; + } + + @Override + public int getSize() + { + return this.listEntries.size(); + } + + /** + * Gets the IGuiListEntry object for the given index + */ + /** + * Gets the IGuiListEntry object for the given index + */ + @SuppressWarnings("rawtypes") + @Override + public IConfigEntry getListEntry(int index) + { + return this.listEntries.get(index); + } + + @Override + public int getScrollBarX() + { + return scrollBarX; + } + + /** + * Gets the width of the list + */ + /** + * Gets the width of the list + */ + @Override + public int getListWidth() + { + return owningScreen.width; + } + + /** + * This method is a pass-through for IConfigEntry objects that require keystrokes. Called from the parent GuiConfig screen. + */ + @SuppressWarnings("rawtypes") + public void keyTyped(char eventChar, int eventKey) + { + for (IConfigEntry entry : this.listEntries) + entry.keyTyped(eventChar, eventKey); + } + + /** + * This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig + * screen. + */ + @SuppressWarnings("rawtypes") + public void updateScreen() + { + for (IConfigEntry entry : this.listEntries) + entry.updateCursorCounter(); + } + + /** + * This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig + * screen. + */ + @SuppressWarnings("rawtypes") + public void mouseClicked(int mouseX, int mouseY, int mouseEvent) + { + for (IConfigEntry entry : this.listEntries) + entry.mouseClicked(mouseX, mouseY, mouseEvent); + } + + /** + * This method is a pass-through for IConfigListEntry objects that need to perform actions when the containing GUI is closed. + */ + @SuppressWarnings("rawtypes") + public void onGuiClosed() + { + for (IConfigEntry entry : this.listEntries) + entry.onGuiClosed(); + } + + /** + * Saves all properties on this screen / child screens. This method returns true if any elements were changed that require + * a restart for proper handling. + */ + @SuppressWarnings("rawtypes") + public boolean saveConfigElements() + { + boolean requiresRestart = false; + for (IConfigEntry entry : this.listEntries) + if (entry.saveConfigElement()) + requiresRestart = true; + + return requiresRestart; + } + + /** + * Returns true if all IConfigEntry objects on this screen are set to default. If includeChildren is true sub-category + * objects are checked as well. + */ + @SuppressWarnings("rawtypes") + public boolean areAllEntriesDefault(boolean includeChildren) + { + for (IConfigEntry entry : this.listEntries) + if ((includeChildren || !(entry instanceof CategoryEntry)) && !entry.isDefault()) + return false; + + return true; + } + + /** + * Sets all IConfigEntry objects on this screen to default. If includeChildren is true sub-category objects are set as + * well. + */ + @SuppressWarnings("rawtypes") + public void setAllToDefault(boolean includeChildren) + { + for (IConfigEntry entry : this.listEntries) + if ((includeChildren || !(entry instanceof CategoryEntry))) + entry.setToDefault(); + } + + /** + * Returns true if any IConfigEntry objects on this screen are changed. If includeChildren is true sub-category objects + * are checked as well. + */ + @SuppressWarnings("rawtypes") + public boolean hasChangedEntry(boolean includeChildren) + { + for (IConfigEntry entry : this.listEntries) + if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.isChanged()) + return true; + + return false; + } + + /** + * Returns true if any IConfigEntry objects on this screen are enabled. If includeChildren is true sub-category objects + * are checked as well. + */ + @SuppressWarnings("rawtypes") + public boolean areAnyEntriesEnabled(boolean includeChildren) + { + for (IConfigEntry entry : this.listEntries) + if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.enabled()) + return true; + + return false; + } + + /** + * Reverts changes to all IConfigEntry objects on this screen. If includeChildren is true sub-category objects are + * reverted as well. + */ + @SuppressWarnings("rawtypes") + public void undoAllChanges(boolean includeChildren) + { + for (IConfigEntry entry : this.listEntries) + if ((includeChildren || !(entry instanceof CategoryEntry))) + entry.undoChanges(); + } + + /** + * Calls the drawToolTip() method for all IConfigEntry objects on this screen. This is called from the parent GuiConfig screen + * after drawing all other elements. + */ + @SuppressWarnings("rawtypes") + public void drawScreenPost(int mouseX, int mouseY, float partialTicks) + { + for (IConfigEntry entry : this.listEntries) + entry.drawToolTip(mouseX, mouseY); + } + + /** + * BooleanPropEntry + * + * Provides a GuiButton that toggles between true and false. + */ + public static class BooleanEntry extends ButtonEntry + { + protected final boolean beforeValue; + protected boolean currentValue; + + private BooleanEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + this.beforeValue = Boolean.valueOf(configElement.get().toString()); + this.currentValue = beforeValue; + this.btnValue.enabled = enabled(); + updateValueButtonText(); + } + + @Override + public void updateValueButtonText() + { + this.btnValue.displayString = I18n.format(String.valueOf(currentValue)); + btnValue.packedFGColour = currentValue ? GuiUtils.getColorCode('2', true) : GuiUtils.getColorCode('4', true); + } + + @Override + public void valueButtonPressed(int slotIndex) + { + if (enabled()) + currentValue = !currentValue; + } + + @Override + public boolean isDefault() + { + return currentValue == Boolean.valueOf(configElement.getDefault().toString()); + } + + @Override + public void setToDefault() + { + if (enabled()) + { + currentValue = Boolean.valueOf(configElement.getDefault().toString()); + updateValueButtonText(); + } + } + + @Override + public boolean isChanged() + { + return currentValue != beforeValue; + } + + @Override + public void undoChanges() + { + if (enabled()) + { + currentValue = beforeValue; + updateValueButtonText(); + } + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled() && isChanged()) + { + configElement.set(currentValue); + return configElement.requiresMcRestart(); + } + return false; + } + + @Override + public Boolean getCurrentValue() + { + return currentValue; + } + + @Override + public Boolean[] getCurrentValues() + { + return new Boolean[] { getCurrentValue() }; + } + } + + /** + * CycleValueEntry + * + * Provides a GuiButton that cycles through the prop's validValues array. If the current prop value is not a valid value, the first + * entry replaces the current value. + */ + public static class CycleValueEntry extends ButtonEntry + { + protected final int beforeIndex; + protected final int defaultIndex; + protected int currentIndex; + + private CycleValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + beforeIndex = getIndex(configElement.get().toString()); + defaultIndex = getIndex(configElement.getDefault().toString()); + currentIndex = beforeIndex; + this.btnValue.enabled = enabled(); + updateValueButtonText(); + } + + private int getIndex(String s) + { + for (int i = 0; i < configElement.getValidValues().length; i++) + if (configElement.getValidValues()[i].equalsIgnoreCase(s)) + { + return i; + } + + return 0; + } + + @Override + public void updateValueButtonText() + { + this.btnValue.displayString = I18n.format(configElement.getValidValues()[currentIndex]); + } + + @Override + public void valueButtonPressed(int slotIndex) + { + if (enabled()) + { + if (++this.currentIndex >= configElement.getValidValues().length) + this.currentIndex = 0; + + updateValueButtonText(); + } + } + + @Override + public boolean isDefault() + { + return currentIndex == defaultIndex; + } + + @Override + public void setToDefault() + { + if (enabled()) + { + currentIndex = defaultIndex; + updateValueButtonText(); + } + } + + @Override + public boolean isChanged() + { + return currentIndex != beforeIndex; + } + + @Override + public void undoChanges() + { + if (enabled()) + { + currentIndex = beforeIndex; + updateValueButtonText(); + } + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled() && isChanged()) + { + configElement.set(configElement.getValidValues()[currentIndex]); + return configElement.requiresMcRestart(); + } + return false; + } + + @Override + public String getCurrentValue() + { + return configElement.getValidValues()[currentIndex]; + } + + @Override + public String[] getCurrentValues() + { + return new String[] { getCurrentValue() }; + } + } + + /** + * ChatColorEntry + * + * Provides a GuiButton that cycles through the list of chat color codes. + */ + public static class ChatColorEntry extends CycleValueEntry + { + ChatColorEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + this.btnValue.enabled = enabled(); + updateValueButtonText(); + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + this.btnValue.packedFGColour = GuiUtils.getColorCode(this.configElement.getValidValues()[currentIndex].charAt(0), true); + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + } + + @Override + public void updateValueButtonText() + { + this.btnValue.displayString = I18n.format(configElement.getValidValues()[currentIndex]) + " - " + I18n.format("fml.configgui.sampletext"); + } + } + + /** + * SelectValueEntry + * + * Provides a GuiButton with the current value as the displayString. Accepts a Map of selectable values with the signature where the key is the Object to be selected and the value is the String that will show on the selection list. EG: a map of Mod + * ID values where the key is the Mod ID and the value is the Mod Name. + */ + public static class SelectValueEntry extends ButtonEntry + { + protected final String beforeValue; + protected Object currentValue; + protected Map selectableValues; + + public SelectValueEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement, Map selectableValues) + { + super(owningScreen, owningEntryList, configElement); + beforeValue = configElement.get().toString(); + currentValue = configElement.get().toString(); + this.selectableValues = selectableValues; + updateValueButtonText(); + } + + @Override + public void updateValueButtonText() + { + this.btnValue.displayString = currentValue.toString(); + } + + @Override + public void valueButtonPressed(int slotIndex) + { + mc.displayGuiScreen(new GuiSelectString(this.owningScreen, configElement, slotIndex, selectableValues, currentValue, enabled())); + } + + public void setValueFromChildScreen(Object newValue) + { + if (enabled() && currentValue != null ? !currentValue.equals(newValue) : newValue != null) + { + currentValue = newValue; + updateValueButtonText(); + } + } + + @Override + public boolean isDefault() + { + if (configElement.getDefault() != null) + return configElement.getDefault().equals(currentValue); + else + return currentValue == null; + } + + @Override + public void setToDefault() + { + if (enabled()) + { + this.currentValue = configElement.getDefault().toString(); + updateValueButtonText(); + } + } + + @Override + public boolean isChanged() + { + if (beforeValue != null) + return !beforeValue.equals(currentValue); + else + return currentValue == null; + } + + @Override + public void undoChanges() + { + if (enabled()) + { + currentValue = beforeValue; + updateValueButtonText(); + } + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled() && isChanged()) + { + this.configElement.set(currentValue); + return configElement.requiresMcRestart(); + } + return false; + } + + @Override + public String getCurrentValue() + { + return this.currentValue.toString(); + } + + @Override + public String[] getCurrentValues() + { + return new String[] { getCurrentValue() }; + } + } + + /** + * ArrayEntry + * + * Provides a GuiButton with the list contents as the displayString. Clicking the button navigates to a screen where the list can be + * edited. + */ + public static class ArrayEntry extends ButtonEntry + { + protected final Object[] beforeValues; + protected Object[] currentValues; + + @SuppressWarnings("rawtypes") + public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + beforeValues = configElement.getList(); + currentValues = configElement.getList(); + updateValueButtonText(); + } + + @Override + public void updateValueButtonText() + { + this.btnValue.displayString = ""; + for (Object o : currentValues) + this.btnValue.displayString += ", [" + o + "]"; + + this.btnValue.displayString = this.btnValue.displayString.replaceFirst(", ", ""); + } + + @Override + public void valueButtonPressed(int slotIndex) + { + mc.displayGuiScreen(new GuiEditArray(this.owningScreen, configElement, slotIndex, currentValues, enabled())); + } + + public void setListFromChildScreen(Object[] newList) + { + if (enabled() && !Arrays.deepEquals(currentValues, newList)) + { + currentValues = newList; + updateValueButtonText(); + } + } + + @Override + public boolean isDefault() + { + return Arrays.deepEquals(configElement.getDefaults(), currentValues); + } + + @Override + public void setToDefault() + { + if (enabled()) + { + this.currentValues = configElement.getDefaults(); + updateValueButtonText(); + } + } + + @Override + public boolean isChanged() + { + return !Arrays.deepEquals(beforeValues, currentValues); + } + + @Override + public void undoChanges() + { + if (enabled()) + { + currentValues = beforeValues; + updateValueButtonText(); + } + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled() && isChanged()) + { + this.configElement.set(currentValues); + return configElement.requiresMcRestart(); + } + return false; + } + + @Override + public Object getCurrentValue() + { + return this.btnValue.displayString; + } + + @Override + public Object[] getCurrentValues() + { + return this.currentValues; + } + } + + /** + * NumberSliderEntry + * + * Provides a slider for numeric properties. + */ + public static class NumberSliderEntry extends ButtonEntry + { + protected final double beforeValue; + + public NumberSliderEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement, new GuiSlider(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18, + "", "", Double.valueOf(configElement.getMinValue().toString()), Double.valueOf(configElement.getMaxValue().toString()), + Double.valueOf(configElement.get().toString()), configElement.getType() == ConfigGuiType.DOUBLE, true)); + + if (configElement.getType() == ConfigGuiType.INTEGER) + this.beforeValue = Integer.valueOf(configElement.get().toString()); + else + this.beforeValue = Double.valueOf(configElement.get().toString()); + } + + @Override + public void updateValueButtonText() + { + ((GuiSlider) this.btnValue).updateSlider(); + } + + @Override + public void valueButtonPressed(int slotIndex) {} + + @Override + public boolean isDefault() + { + if (configElement.getType() == ConfigGuiType.INTEGER) + return ((GuiSlider) this.btnValue).getValueInt() == Integer.valueOf(configElement.getDefault().toString()); + else + return ((GuiSlider) this.btnValue).getValue() == Double.valueOf(configElement.getDefault().toString()); + } + + @Override + public void setToDefault() + { + if (this.enabled()) + { + ((GuiSlider) this.btnValue).setValue(Double.valueOf(configElement.getDefault().toString())); + ((GuiSlider) this.btnValue).updateSlider(); + } + } + + @Override + public boolean isChanged() + { + if (configElement.getType() == ConfigGuiType.INTEGER) + return ((GuiSlider) this.btnValue).getValueInt() != (int) Math.round(beforeValue); + else + return ((GuiSlider) this.btnValue).getValue() != beforeValue; + } + + @Override + public void undoChanges() + { + if (this.enabled()) + { + ((GuiSlider) this.btnValue).setValue(beforeValue); + ((GuiSlider) this.btnValue).updateSlider(); + } + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (this.enabled() && this.isChanged()) + { + if (configElement.getType() == ConfigGuiType.INTEGER) + configElement.set(((GuiSlider) this.btnValue).getValueInt()); + else + configElement.set(((GuiSlider) this.btnValue).getValue()); + return configElement.requiresMcRestart(); + } + return false; + } + + @Override + public Object getCurrentValue() + { + if (configElement.getType() == ConfigGuiType.INTEGER) + return ((GuiSlider) this.btnValue).getValueInt(); + else + return ((GuiSlider) this.btnValue).getValue(); + } + + @Override + public Object[] getCurrentValues() + { + return new Object[] { getCurrentValue() }; + } + } + + /** + * ButtonEntry + * + * Provides a basic GuiButton entry to be used as a base for other entries that require a button for the value. + */ + public static abstract class ButtonEntry extends ListEntryBase + { + protected final GuiButtonExt btnValue; + + public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + this(owningScreen, owningEntryList, configElement, new GuiButtonExt(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18, + configElement.get() != null ? I18n.format(String.valueOf(configElement.get())) : "")); + } + + public ButtonEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement, GuiButtonExt button) + { + super(owningScreen, owningEntryList, configElement); + this.btnValue = button; + } + + /** + * Updates the displayString of the value button. + */ + public abstract void updateValueButtonText(); + + /** + * Called when the value button has been clicked. + */ + public abstract void valueButtonPressed(int slotIndex); + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + this.btnValue.width = this.owningEntryList.controlWidth; + this.btnValue.xPosition = this.owningScreen.entryList.controlX; + this.btnValue.yPosition = y; + this.btnValue.enabled = enabled(); + this.btnValue.drawButton(this.mc, mouseX, mouseY); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.btnValue.mousePressed(this.mc, x, y)) + { + btnValue.func_146113_a(mc.getSoundHandler()); + valueButtonPressed(index); + updateValueButtonText(); + return true; + } + else + return super.mousePressed(index, x, y, mouseEvent, relativeX, relativeY); + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + super.mouseReleased(index, x, y, mouseEvent, relativeX, relativeY); + this.btnValue.mouseReleased(x, y); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + {} + + @Override + public void updateCursorCounter() + {} + + @Override + public void mouseClicked(int x, int y, int mouseEvent) + {} + } + + /** + * IntegerEntry + * + * Provides a GuiTextField for user input. Input is restricted to ensure the value can be parsed using Integer.parseInteger(). + */ + public static class IntegerEntry extends StringEntry + { + protected final int beforeValue; + + @SuppressWarnings("rawtypes") + public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + this.beforeValue = Integer.valueOf(configElement.get().toString()); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (enabled() || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + String validChars = "0123456789"; + String before = this.textFieldValue.getText(); + if (validChars.contains(String.valueOf(eventChar)) + || (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-') + || eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE + || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + this.textFieldValue.textboxKeyTyped((enabled() ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (!textFieldValue.getText().trim().isEmpty() && !textFieldValue.getText().trim().equals("-")) + { + try + { + long value = Long.parseLong(textFieldValue.getText().trim()); + if (value < Integer.valueOf(configElement.getMinValue().toString()) || value > Integer.valueOf(configElement.getMaxValue().toString())) + this.isValidValue = false; + else + this.isValidValue = true; + } + catch (Throwable e) + { + this.isValidValue = false; + } + } + else + this.isValidValue = false; + } + } + + @Override + public boolean isChanged() + { + try + { + return this.beforeValue != Integer.parseInt(textFieldValue.getText().trim()); + } + catch (Throwable e) + { + return true; + } + } + + @Override + public void undoChanges() + { + if (enabled()) + this.textFieldValue.setText(String.valueOf(beforeValue)); + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled()) + { + if (isChanged() && this.isValidValue) + try + { + int value = Integer.parseInt(textFieldValue.getText().trim()); + this.configElement.set(value); + return configElement.requiresMcRestart(); + } + catch (Throwable e) + { + this.configElement.setToDefault(); + } + else if (isChanged() && !this.isValidValue) + try + { + int value = Integer.parseInt(textFieldValue.getText().trim()); + if (value < Integer.valueOf(configElement.getMinValue().toString())) + this.configElement.set(configElement.getMinValue()); + else + this.configElement.set(configElement.getMaxValue()); + + } + catch (Throwable e) + { + this.configElement.setToDefault(); + } + + return configElement.requiresMcRestart() && beforeValue != Integer.parseInt(configElement.get().toString()); + } + return false; + } + } + + /** + * DoubleEntry + * + * Provides a GuiTextField for user input. Input is restricted to ensure the value can be parsed using Double.parseDouble(). + */ + public static class DoubleEntry extends StringEntry + { + protected final double beforeValue; + + @SuppressWarnings("rawtypes") + public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + this.beforeValue = Double.valueOf(configElement.get().toString()); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (enabled() || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + String validChars = "0123456789"; + String before = this.textFieldValue.getText(); + if (validChars.contains(String.valueOf(eventChar)) || + (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-') + || (!before.contains(".") && eventChar == '.') + || eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT + || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + this.textFieldValue.textboxKeyTyped((enabled() ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (!textFieldValue.getText().trim().isEmpty() && !textFieldValue.getText().trim().equals("-")) + { + try + { + double value = Double.parseDouble(textFieldValue.getText().trim()); + if (value < Double.valueOf(configElement.getMinValue().toString()) || value > Double.valueOf(configElement.getMaxValue().toString())) + this.isValidValue = false; + else + this.isValidValue = true; + } + catch (Throwable e) + { + this.isValidValue = false; + } + } + else + this.isValidValue = false; + } + } + + @Override + public boolean isChanged() + { + try + { + return this.beforeValue != Double.parseDouble(textFieldValue.getText().trim()); + } + catch (Throwable e) + { + return true; + } + } + + @Override + public void undoChanges() + { + if (enabled()) + this.textFieldValue.setText(String.valueOf(beforeValue)); + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled()) + { + if (isChanged() && this.isValidValue) + try + { + double value = Double.parseDouble(textFieldValue.getText().trim()); + this.configElement.set(value); + return configElement.requiresMcRestart(); + } + catch (Throwable e) + { + this.configElement.setToDefault(); + } + else if (isChanged() && !this.isValidValue) + try + { + double value = Double.parseDouble(textFieldValue.getText().trim()); + if (value < Double.valueOf(configElement.getMinValue().toString())) + this.configElement.set(configElement.getMinValue()); + else + this.configElement.set(configElement.getMaxValue()); + } + catch (Throwable e) + { + this.configElement.setToDefault(); + } + + return configElement.requiresMcRestart() && beforeValue != Double.parseDouble(configElement.get().toString()); + } + return false; + } + } + + /** + * StringEntry + * + * Provides a GuiTextField for user input. + */ + public static class StringEntry extends ListEntryBase + { + protected final GuiTextField textFieldValue; + protected final String beforeValue; + + public StringEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + beforeValue = configElement.get().toString(); + this.textFieldValue = new GuiTextField(this.mc.fontRenderer, this.owningEntryList.controlX + 1, 0, this.owningEntryList.controlWidth - 3, 16); + this.textFieldValue.setMaxStringLength(10000); + this.textFieldValue.setText(configElement.get().toString()); + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + this.textFieldValue.xPosition = this.owningEntryList.controlX + 2; + this.textFieldValue.yPosition = y + 1; + this.textFieldValue.width = this.owningEntryList.controlWidth - 4; + this.textFieldValue.setEnabled(enabled()); + this.textFieldValue.drawTextBox(); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (enabled() || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + this.textFieldValue.textboxKeyTyped((enabled() ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (configElement.getValidationPattern() != null) + { + if (configElement.getValidationPattern().matcher(this.textFieldValue.getText().trim()).matches()) + isValidValue = true; + else + isValidValue = false; + } + } + } + + @Override + public void updateCursorCounter() + { + this.textFieldValue.updateCursorCounter(); + } + + @Override + public void mouseClicked(int x, int y, int mouseEvent) + { + this.textFieldValue.mouseClicked(x, y, mouseEvent); + } + + @Override + public boolean isDefault() + { + return configElement.getDefault() != null ? configElement.getDefault().toString().equals(this.textFieldValue.getText()) : + this.textFieldValue.getText().trim().isEmpty(); + } + + @Override + public void setToDefault() + { + if (enabled()) + { + this.textFieldValue.setText(this.configElement.getDefault().toString()); + keyTyped((char) Keyboard.CHAR_NONE, Keyboard.KEY_HOME); + } + } + + @Override + public boolean isChanged() + { + return beforeValue != null ? !this.beforeValue.equals(textFieldValue.getText()) : this.textFieldValue.getText().trim().isEmpty(); + } + + @Override + public void undoChanges() + { + if (enabled()) + this.textFieldValue.setText(beforeValue); + } + + @SuppressWarnings("unchecked") + @Override + public boolean saveConfigElement() + { + if (enabled()) + { + if (isChanged() && this.isValidValue) + { + this.configElement.set(this.textFieldValue.getText()); + return configElement.requiresMcRestart(); + } + else if (isChanged() && !this.isValidValue) + { + this.configElement.setToDefault(); + return configElement.requiresMcRestart() + && beforeValue != null ? beforeValue.equals(configElement.getDefault()) : configElement.getDefault() == null; + } + } + return false; + } + + @Override + public Object getCurrentValue() + { + return this.textFieldValue.getText(); + } + + @Override + public Object[] getCurrentValues() + { + return new Object[] { getCurrentValue() }; + } + } + + /** + * CategoryEntry + * + * Provides an entry that consists of a GuiButton for navigating to the child category GuiConfig screen. + */ + public static class CategoryEntry extends ListEntryBase + { + protected GuiScreen childScreen; + protected final GuiButtonExt btnSelectCategory; + + @SuppressWarnings("rawtypes") + public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + + this.childScreen = this.buildChildScreen(); + + this.btnSelectCategory = new GuiButtonExt(0, 0, 0, 300, 18, I18n.format(name)); + this.tooltipHoverChecker = new HoverChecker(this.btnSelectCategory, 800); + + this.drawLabel = false; + } + + /** + * This method is called in the constructor and is used to set the childScreen field. + */ + @SuppressWarnings("unchecked") + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, this.configElement.getChildElements(), this.owningScreen.modID, + owningScreen.allRequireWorldRestart || this.configElement.requiresWorldRestart(), + owningScreen.allRequireMcRestart || this.configElement.requiresMcRestart(), this.owningScreen.title, + ((this.owningScreen.titleLine2 == null ? "" : this.owningScreen.titleLine2) + " > " + this.name)); + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + this.btnSelectCategory.xPosition = listWidth / 2 - 150; + this.btnSelectCategory.yPosition = y; + this.btnSelectCategory.enabled = enabled(); + this.btnSelectCategory.drawButton(this.mc, mouseX, mouseY); + + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + } + + @Override + public void drawToolTip(int mouseX, int mouseY) + { + boolean canHover = mouseY < this.owningScreen.entryList.bottom && mouseY > this.owningScreen.entryList.top; + + if (this.tooltipHoverChecker.checkHover(mouseX, mouseY, canHover)) + this.owningScreen.drawToolTip(toolTip, mouseX, mouseY); + + super.drawToolTip(mouseX, mouseY); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.btnSelectCategory.mousePressed(this.mc, x, y)) + { + btnSelectCategory.func_146113_a(mc.getSoundHandler()); + Minecraft.getMinecraft().displayGuiScreen(childScreen); + return true; + } + else + return super.mousePressed(index, x, y, mouseEvent, relativeX, relativeY); + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.btnSelectCategory.mouseReleased(x, y); + } + + @Override + public boolean isDefault() + { + if (childScreen instanceof GuiConfig && ((GuiConfig) childScreen).entryList != null) + return ((GuiConfig) childScreen).entryList.areAllEntriesDefault(true); + + return true; + } + + @Override + public void setToDefault() + { + if (childScreen instanceof GuiConfig && ((GuiConfig) childScreen).entryList != null) + ((GuiConfig) childScreen).entryList.setAllToDefault(true); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + {} + + @Override + public void updateCursorCounter() + {} + + @Override + public void mouseClicked(int x, int y, int mouseEvent) + {} + + @Override + public boolean saveConfigElement() + { + boolean requiresRestart = false; + + if (childScreen instanceof GuiConfig && ((GuiConfig) childScreen).entryList != null) + { + requiresRestart = configElement.requiresMcRestart() && ((GuiConfig) childScreen).entryList.hasChangedEntry(true); + + if (((GuiConfig) childScreen).entryList.saveConfigElements()) + requiresRestart = true; + } + + return requiresRestart; + } + + @Override + public boolean isChanged() + { + if (childScreen instanceof GuiConfig && ((GuiConfig) childScreen).entryList != null) + return ((GuiConfig) childScreen).entryList.hasChangedEntry(true); + else + return false; + } + + @Override + public void undoChanges() + { + if (childScreen instanceof GuiConfig && ((GuiConfig) childScreen).entryList != null) + ((GuiConfig) childScreen).entryList.undoAllChanges(true); + } + + @Override + public boolean enabled() + { + return true; + } + + @Override + public int getLabelWidth() + { + return 0; + } + + @Override + public int getEntryRightBound() + { + return this.owningEntryList.width / 2 + 155 + 22 + 18; + } + + @Override + public String getCurrentValue() + { + return ""; + } + + @Override + public String[] getCurrentValues() + { + return new String[] { getCurrentValue() }; + } + } + + /** + * ListEntryBase + * + * Provides a base entry for others to extend. Handles drawing the prop label (if drawLabel == true) and the Undo/Default buttons. + */ + @SuppressWarnings("rawtypes") + public static abstract class ListEntryBase implements IConfigEntry + { + protected final GuiConfig owningScreen; + protected final GuiConfigEntries owningEntryList; + protected final IConfigElement configElement; + protected final Minecraft mc; + protected final String name; + protected final GuiButtonExt btnUndoChanges; + protected final GuiButtonExt btnDefault; + protected List toolTip; + protected List undoToolTip; + protected List defaultToolTip; + protected boolean isValidValue = true; + protected HoverChecker tooltipHoverChecker; + protected HoverChecker undoHoverChecker; + protected HoverChecker defaultHoverChecker; + protected boolean drawLabel; + + @SuppressWarnings({ "unchecked" }) + public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + this.owningScreen = owningScreen; + this.owningEntryList = owningEntryList; + this.configElement = configElement; + this.mc = Minecraft.getMinecraft(); + String trans = I18n.format(configElement.getLanguageKey()); + if (!trans.equals(configElement.getLanguageKey())) + this.name = trans; + else + this.name = configElement.getName(); + this.btnUndoChanges = new GuiButtonExt(0, 0, 0, 18, 18, UNDO_CHAR); + this.btnDefault = new GuiButtonExt(0, 0, 0, 18, 18, RESET_CHAR); + + this.undoHoverChecker = new HoverChecker(this.btnUndoChanges, 800); + this.defaultHoverChecker = new HoverChecker(this.btnDefault, 800); + this.undoToolTip = Arrays.asList(new String[] { I18n.format("fml.configgui.tooltip.undoChanges") }); + this.defaultToolTip = Arrays.asList(new String[] { I18n.format("fml.configgui.tooltip.resetToDefault") }); + + this.drawLabel = true; + + String comment; + + comment = I18n.format(configElement.getLanguageKey() + ".tooltip").replace("\\n", "\n"); + + if (!comment.equals(configElement.getLanguageKey() + ".tooltip")) + toolTip = new ArrayList(this.mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + comment, 300)); + else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty()) + toolTip = new ArrayList(this.mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300)); + else + toolTip = new ArrayList(this.mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + name + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300)); + + if ((configElement.getType() == ConfigGuiType.INTEGER + && (Integer.valueOf(configElement.getMinValue().toString()) != Integer.MIN_VALUE || Integer.valueOf(configElement.getMaxValue().toString()) != Integer.MAX_VALUE)) + || (configElement.getType() == ConfigGuiType.DOUBLE + && (Double.valueOf(configElement.getMinValue().toString()) != -Double.MAX_VALUE || Double.valueOf(configElement.getMaxValue().toString()) != Double.MAX_VALUE))) + toolTip.addAll(this.mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.defaultNumeric", configElement.getMinValue(), configElement.getMaxValue(), configElement.getDefault()), 300)); + else if (configElement.getType() != ConfigGuiType.CONFIG_CATEGORY) + toolTip.addAll(this.mc.fontRenderer.listFormattedStringToWidth(EnumChatFormatting.AQUA + I18n.format("fml.configgui.tooltip.default", configElement.getDefault()),300)); + + if (configElement.requiresMcRestart() || owningScreen.allRequireMcRestart) + toolTip.add(EnumChatFormatting.RED + "[" + I18n.format("fml.configgui.gameRestartTitle") + "]"); + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + boolean isChanged = isChanged(); + + if (drawLabel) + { + String label = (!isValidValue ? EnumChatFormatting.RED.toString() : + (isChanged ? EnumChatFormatting.WHITE.toString() : EnumChatFormatting.GRAY.toString())) + + (isChanged ? EnumChatFormatting.ITALIC.toString() : "") + this.name; + this.mc.fontRenderer.drawString( + label, + this.owningScreen.entryList.labelX, + y + slotHeight / 2 - this.mc.fontRenderer.FONT_HEIGHT / 2, + 16777215); + } + + this.btnUndoChanges.xPosition = this.owningEntryList.scrollBarX - 44; + this.btnUndoChanges.yPosition = y; + this.btnUndoChanges.enabled = enabled() && isChanged; + this.btnUndoChanges.drawButton(this.mc, mouseX, mouseY); + + this.btnDefault.xPosition = this.owningEntryList.scrollBarX - 22; + this.btnDefault.yPosition = y; + this.btnDefault.enabled = enabled() && !isDefault(); + this.btnDefault.drawButton(this.mc, mouseX, mouseY); + + if (this.tooltipHoverChecker == null) + this.tooltipHoverChecker = new HoverChecker(y, y + slotHeight, x, this.owningScreen.entryList.controlX - 8, 800); + else + this.tooltipHoverChecker.updateBounds(y, y + slotHeight, x, this.owningScreen.entryList.controlX - 8); + } + + @Override + public void drawToolTip(int mouseX, int mouseY) + { + boolean canHover = mouseY < this.owningScreen.entryList.bottom && mouseY > this.owningScreen.entryList.top; + if (toolTip != null && this.tooltipHoverChecker != null) + { + if (this.tooltipHoverChecker.checkHover(mouseX, mouseY, canHover)) + this.owningScreen.drawToolTip(toolTip, mouseX, mouseY); + } + + if (this.undoHoverChecker.checkHover(mouseX, mouseY, canHover)) + this.owningScreen.drawToolTip(undoToolTip, mouseX, mouseY); + + if (this.defaultHoverChecker.checkHover(mouseX, mouseY, canHover)) + this.owningScreen.drawToolTip(defaultToolTip, mouseX, mouseY); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.btnDefault.mousePressed(this.mc, x, y)) + { + btnDefault.func_146113_a(mc.getSoundHandler()); + setToDefault(); + return true; + } + else if (this.btnUndoChanges.mousePressed(this.mc, x, y)) + { + btnUndoChanges.func_146113_a(mc.getSoundHandler()); + undoChanges(); + return true; + } + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.btnDefault.mouseReleased(x, y); + } + + @Override + public abstract boolean isDefault(); + + @Override + public abstract void setToDefault(); + + @Override + public abstract void keyTyped(char eventChar, int eventKey); + + @Override + public abstract void updateCursorCounter(); + + @Override + public abstract void mouseClicked(int x, int y, int mouseEvent); + + @Override + public abstract boolean isChanged(); + + @Override + public abstract void undoChanges(); + + @Override + public abstract boolean saveConfigElement(); + + @Override + public boolean enabled() + { + return owningScreen.isWorldRunning ? !owningScreen.allRequireWorldRestart && !configElement.requiresWorldRestart() : true; + } + + @Override + public int getLabelWidth() + { + return this.mc.fontRenderer.getStringWidth(this.name); + } + + @Override + public int getEntryRightBound() + { + return this.owningEntryList.resetX + 40; + } + + @Override + public IConfigElement getConfigElement() + { + return configElement; + } + + @Override + public String getName() + { + return configElement.getName(); + } + + @Override + public abstract Object getCurrentValue(); + + @Override + public abstract Object[] getCurrentValues(); + + @Override + public void onGuiClosed() + {} + } + + /** + * Provides an interface for defining GuiPropertyList.listEntry objects. + */ + public static interface IConfigEntry extends GuiListExtended.IGuiListEntry + { + /** + * Gets the IConfigElement object owned by this entry. + * @return + */ + @SuppressWarnings("rawtypes") + public IConfigElement getConfigElement(); + + /** + * Gets the name of the ConfigElement owned by this entry. + */ + public String getName(); + + /** + * Gets the current value of this entry as a String. + */ + public T getCurrentValue(); + + /** + * Gets the current values of this list entry as a String[]. + */ + public T[] getCurrentValues(); + + /** + * Is this list entry enabled? + * + * @return true if this entry's controls should be enabled, false otherwise. + */ + public boolean enabled(); + + /** + * Handles user keystrokes for any GuiTextField objects in this entry. Call {@code GuiTextField.keyTyped()} for any GuiTextField + * objects that should receive the input provided. + */ + public void keyTyped(char eventChar, int eventKey); + + /** + * Call {@code GuiTextField.updateCursorCounter()} for any GuiTextField objects in this entry. + */ + public void updateCursorCounter(); + + /** + * Call {@code GuiTextField.mouseClicked()} for and GuiTextField objects in this entry. + */ + public void mouseClicked(int x, int y, int mouseEvent); + + /** + * Is this entry's value equal to the default value? Generally true should be returned if this entry is not a property or category + * entry. + * + * @return true if this entry's value is equal to this entry's default value. + */ + public boolean isDefault(); + + /** + * Sets this entry's value to the default value. + */ + public void setToDefault(); + + /** + * Handles reverting any changes that have occurred to this entry. + */ + public void undoChanges(); + + /** + * Has the value of this entry changed? + * + * @return true if changes have been made to this entry's value, false otherwise. + */ + public boolean isChanged(); + + /** + * Handles saving any changes that have been made to this entry back to the underlying object. It is a good practice to check + * isChanged() before performing the save action. This method should return true if the element has changed AND REQUIRES A RESTART. + */ + public boolean saveConfigElement(); + + /** + * Handles drawing any tooltips that apply to this entry. This method is called after all other GUI elements have been drawn to the + * screen, so it could also be used to draw any GUI element that needs to be drawn after all entries have had drawEntry() called. + */ + public void drawToolTip(int mouseX, int mouseY); + + /** + * Gets this entry's label width. + */ + public int getLabelWidth(); + + /** + * Gets this entry's right-hand x boundary. This value is used to control where the scroll bar is placed. + */ + public int getEntryRightBound(); + + /** + * This method is called when the parent GUI is closed. Most handlers won't need this; it is provided for special cases. + */ + public void onGuiClosed(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArray.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArray.java new file mode 100644 index 0000000..97ae5b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArray.java @@ -0,0 +1,228 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + +import org.lwjgl.input.Keyboard; + +/** + * This class is the base screen used for editing an array-type property. It provides a list of array entries for the user to edit. + * This screen is invoked from a GuiConfig screen by controls that use the EditListPropEntry IGuiConfigListEntry object. + * + * @author bspkrs + */ +public class GuiEditArray extends GuiScreen +{ + protected GuiScreen parentScreen; + @SuppressWarnings("rawtypes") + protected IConfigElement configElement; + private GuiEditArrayEntries entryList; + private GuiButtonExt btnUndoChanges, btnDefault, btnDone; + private String title; + protected String titleLine2; + protected String titleLine3; + protected int slotIndex; + private final Object[] beforeValues; + private Object[] currentValues; + private HoverChecker tooltipHoverChecker; + @SuppressWarnings("rawtypes") + private List toolTip; + protected boolean enabled; + + @SuppressWarnings("rawtypes") + public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled) + { + this.mc = Minecraft.getMinecraft(); + this.parentScreen = parentScreen; + this.configElement = configElement; + this.slotIndex = slotIndex; + this.beforeValues = currentValues; + this.currentValues = currentValues; + this.toolTip = new ArrayList(); + this.enabled = enabled; + String propName = I18n.format(configElement.getLanguageKey()); + String comment; + + comment = I18n.format(configElement.getLanguageKey() + ".tooltip", + "\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue()); + + if (!comment.equals(configElement.getLanguageKey() + ".tooltip")) + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment, 300); + else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty()) + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300); + else + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300); + + if (parentScreen instanceof GuiConfig) + { + this.title = ((GuiConfig) parentScreen).title; + if (((GuiConfig) parentScreen).titleLine2 != null) + { + this.titleLine2 = ((GuiConfig) parentScreen).titleLine2; + this.titleLine3 = I18n.format(configElement.getLanguageKey()); + } + else + this.titleLine2 = I18n.format(configElement.getLanguageKey()); + this.tooltipHoverChecker = new HoverChecker(28, 37, 0, parentScreen.width, 800); + } + else + { + this.title = I18n.format(configElement.getLanguageKey()); + this.tooltipHoverChecker = new HoverChecker(8, 17, 0, parentScreen.width, 800); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); + + int undoGlyphWidth = mc.fontRenderer.getStringWidth(UNDO_CHAR) * 2; + int resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2; + int doneWidth = Math.max(mc.fontRenderer.getStringWidth(I18n.format("gui.done")) + 20, 100); + int undoWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.undoChanges")) + undoGlyphWidth + 20; + int resetWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.resetToDefault")) + resetGlyphWidth + 20; + int buttonWidthHalf = (doneWidth + 5 + undoWidth + 5 + resetWidth) / 2; + this.buttonList.add(btnDone = new GuiButtonExt(2000, this.width / 2 - buttonWidthHalf, this.height - 29, doneWidth, 20, I18n.format("gui.done"))); + this.buttonList.add(btnDefault = new GuiUnicodeGlyphButton(2001, this.width / 2 - buttonWidthHalf + doneWidth + 5 + undoWidth + 5, + this.height - 29, resetWidth, 20, " " + I18n.format("fml.configgui.tooltip.resetToDefault"), RESET_CHAR, 2.0F)); + this.buttonList.add(btnUndoChanges = new GuiUnicodeGlyphButton(2002, this.width / 2 - buttonWidthHalf + doneWidth + 5, + this.height - 29, undoWidth, 20, " " + I18n.format("fml.configgui.tooltip.undoChanges"), UNDO_CHAR, 2.0F)); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.id == 2000) + { + try + { + this.entryList.saveListChanges(); + } + catch (Throwable e) + { + e.printStackTrace(); + } + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 2001) + { + this.currentValues = configElement.getDefaults(); + this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); + } + else if (button.id == 2002) + { + this.currentValues = Arrays.copyOf(beforeValues, beforeValues.length); + this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); + } + } + + /** + * Called when the mouse is clicked. + */ + @Override + protected void mouseClicked(int x, int y, int mouseEvent) + { + if (mouseEvent != 0 || !this.entryList.func_148179_a(x, y, mouseEvent)) + { + this.entryList.mouseClicked(x, y, mouseEvent); + super.mouseClicked(x, y, mouseEvent); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + @Override + protected void mouseMovedOrUp(int x, int y, int mouseEvent) + { + if (mouseEvent != 0 || !this.entryList.func_148181_b(x, y, mouseEvent)) + { + super.mouseMovedOrUp(x, y, mouseEvent); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + @Override + protected void keyTyped(char eventChar, int eventKey) + { + if (eventKey == Keyboard.KEY_ESCAPE) + this.mc.displayGuiScreen(parentScreen); + else + this.entryList.keyTyped(eventChar, eventKey); + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() + { + super.updateScreen(); + this.entryList.updateScreen(); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int par1, int par2, float par3) + { + this.drawDefaultBackground(); + this.entryList.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 8, 16777215); + + if (this.titleLine2 != null) + this.drawCenteredString(this.fontRendererObj, this.titleLine2, this.width / 2, 18, 16777215); + + if (this.titleLine3 != null) + this.drawCenteredString(this.fontRendererObj, this.titleLine3, this.width / 2, 28, 16777215); + + this.btnDone.enabled = this.entryList.isListSavable(); + this.btnDefault.enabled = enabled && !this.entryList.isDefault(); + this.btnUndoChanges.enabled = enabled && this.entryList.isChanged(); + super.drawScreen(par1, par2, par3); + this.entryList.drawScreenPost(par1, par2, par3); + + if (this.tooltipHoverChecker != null && this.tooltipHoverChecker.checkHover(par1, par2)) + drawToolTip(this.toolTip, par1, par2); + } + + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) + { + this.func_146283_a(stringList, x, y); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java new file mode 100644 index 0000000..4ee65f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java @@ -0,0 +1,693 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.input.Keyboard; + +import static cpw.mods.fml.client.config.GuiUtils.INVALID; +import static cpw.mods.fml.client.config.GuiUtils.VALID; + +import cpw.mods.fml.client.config.GuiConfigEntries.ArrayEntry; +import cpw.mods.fml.common.FMLLog; + +/** + * This class implements the scrolling list functionality of the GuiEditList screen. It also provides all the default controls + * for editing array-type properties. + * + * @author bspkrs + */ +@SuppressWarnings("rawtypes") +public class GuiEditArrayEntries extends GuiListExtended +{ + private GuiEditArray owningGui; + public Minecraft mc; + public IConfigElement configElement; + public List listEntries; + public boolean isDefault; + public boolean isChanged; + public boolean canAddMoreEntries; + public final int controlWidth; + public final Object[] beforeValues; + public Object[] currentValues; + + @SuppressWarnings("unchecked") + public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues) + { + super(mc, parent.width, parent.height, parent.titleLine2 != null ? (parent.titleLine3 != null ? 43 : 33) : 23, parent.height - 32, 20); + this.owningGui = parent; + this.mc = mc; + this.configElement = configElement; + this.beforeValues = beforeValues; + this.currentValues = currentValues; + this.setShowSelectionBox(false); + this.isChanged = !Arrays.deepEquals(beforeValues, currentValues); + this.isDefault = Arrays.deepEquals(currentValues, configElement.getDefaults()); + this.canAddMoreEntries = !configElement.isListLengthFixed() && (configElement.getMaxListLength() == -1 || currentValues.length < configElement.getMaxListLength()); + + listEntries = new ArrayList(); + + controlWidth = (parent.width / 2) - (configElement.isListLengthFixed() ? 0 : 48); + + if (configElement.isList() && configElement.getArrayEntryClass() != null) + { + Class clazz = configElement.getArrayEntryClass(); + for (Object value : currentValues) + { + try + { + listEntries.add(clazz.getConstructor(GuiEditArray.class, GuiEditArrayEntries.class, IConfigElement.class, Object.class) + .newInstance(this.owningGui, this, configElement, value.toString())); + } + catch (Throwable e) + { + FMLLog.severe("There was a critical error instantiating the custom IGuiEditListEntry for property %s.", configElement.getName()); + e.printStackTrace(); + } + } + } + else if (configElement.isList() && configElement.getType().equals(ConfigGuiType.BOOLEAN)) + for (Object value : currentValues) + listEntries.add(new BooleanEntry(this.owningGui, this, configElement, Boolean.valueOf(value.toString()))); + else if (configElement.isList() && configElement.getType().equals(ConfigGuiType.INTEGER)) + for (Object value : currentValues) + listEntries.add(new IntegerEntry(this.owningGui, this, configElement, Integer.parseInt(value.toString()))); + else if (configElement.isList() && configElement.getType().equals(ConfigGuiType.DOUBLE)) + for (Object value : currentValues) + listEntries.add(new DoubleEntry(this.owningGui, this, configElement, Double.parseDouble(value.toString()))); + else if (configElement.isList()) + for (Object value : currentValues) + listEntries.add(new StringEntry(this.owningGui, this, configElement, value.toString())); + + if (!configElement.isListLengthFixed()) + listEntries.add(new BaseEntry(this.owningGui, this, configElement)); + + } + + @Override + protected int getScrollBarX() + { + return width - (width / 4); + } + + /** + * Gets the width of the list + */ + /** + * Gets the width of the list + */ + @Override + public int getListWidth() + { + return owningGui.width; + } + + /** + * Gets the IGuiListEntry object for the given index + */ + @Override + public IArrayEntry getListEntry(int index) + { + return listEntries.get(index); + } + + @Override + protected int getSize() + { + return listEntries.size(); + } + + public void addNewEntry(int index) + { + if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN) + listEntries.add(index, new BooleanEntry(this.owningGui, this, this.configElement, Boolean.valueOf(true))); + else if (configElement.isList() && configElement.getType() == ConfigGuiType.INTEGER) + listEntries.add(index, new IntegerEntry(this.owningGui, this, this.configElement, 0)); + else if (configElement.isList() && configElement.getType() == ConfigGuiType.DOUBLE) + listEntries.add(index, new DoubleEntry(this.owningGui, this, this.configElement, 0.0D)); + else if (configElement.isList()) + listEntries.add(index, new StringEntry(this.owningGui, this, this.configElement, "")); + this.canAddMoreEntries = !configElement.isListLengthFixed() + && (configElement.getMaxListLength() == -1 || this.listEntries.size() - 1 < configElement.getMaxListLength()); + keyTyped((char) Keyboard.CHAR_NONE, Keyboard.KEY_END); + } + + public void removeEntry(int index) + { + this.listEntries.remove(index); + this.canAddMoreEntries = !configElement.isListLengthFixed() + && (configElement.getMaxListLength() == -1 || this.listEntries.size() - 1 < configElement.getMaxListLength()); + keyTyped((char) Keyboard.CHAR_NONE, Keyboard.KEY_END); + } + + public boolean isChanged() + { + return isChanged; + } + + public boolean isDefault() + { + return isDefault; + } + + public void recalculateState() + { + isDefault = true; + isChanged = false; + + int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1; + + if (listLength != configElement.getDefaults().length) + { + isDefault = false; + } + + if (listLength != beforeValues.length) + { + isChanged = true; + } + + if (isDefault) + for (int i = 0; i < listLength; i++) + if (!configElement.getDefaults()[i].equals(listEntries.get(i).getValue())) + isDefault = false; + + if (!isChanged) + for (int i = 0; i < listLength; i++) + if (!beforeValues[i].equals(listEntries.get(i).getValue())) + isChanged = true; + } + + protected void keyTyped(char eventChar, int eventKey) + { + for (IArrayEntry entry : this.listEntries) + entry.keyTyped(eventChar, eventKey); + + recalculateState(); + } + + protected void updateScreen() + { + for (IArrayEntry entry : this.listEntries) + entry.updateCursorCounter(); + } + + protected void mouseClicked(int x, int y, int mouseEvent) + { + for (IArrayEntry entry : this.listEntries) + entry.mouseClicked(x, y, mouseEvent); + } + + protected boolean isListSavable() + { + for (IArrayEntry entry : this.listEntries) + if (!entry.isValueSavable()) + return false; + + return true; + } + + @SuppressWarnings("unchecked") + protected void saveListChanges() + { + int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1; + + if (owningGui.slotIndex != -1 && owningGui.parentScreen != null + && owningGui.parentScreen instanceof GuiConfig + && ((GuiConfig) owningGui.parentScreen).entryList.getListEntry(owningGui.slotIndex) instanceof ArrayEntry) + { + ArrayEntry entry = (ArrayEntry) ((GuiConfig) owningGui.parentScreen).entryList.getListEntry(owningGui.slotIndex); + + Object[] ao = new Object[listLength]; + for (int i = 0; i < listLength; i++) + ao[i] = listEntries.get(i).getValue(); + + entry.setListFromChildScreen(ao); + } + else + { + if (configElement.isList() && configElement.getType() == ConfigGuiType.BOOLEAN) + { + Boolean[] abol = new Boolean[listLength]; + for (int i = 0; i < listLength; i++) + abol[i] = Boolean.valueOf(listEntries.get(i).getValue().toString()); + + configElement.set(abol); + } + else if (configElement.isList() && configElement.getType() == ConfigGuiType.INTEGER) + { + Integer[] ai = new Integer[listLength]; + for (int i = 0; i < listLength; i++) + ai[i] = Integer.valueOf(listEntries.get(i).getValue().toString()); + + configElement.set(ai); + } + else if (configElement.isList() && configElement.getType() == ConfigGuiType.DOUBLE) + { + Double[] ad = new Double[listLength]; + for (int i = 0; i < listLength; i++) + ad[i] = Double.valueOf(listEntries.get(i).getValue().toString()); + + configElement.set(ad); + } + else if (configElement.isList()) + { + String[] as = new String[listLength]; + for (int i = 0; i < listLength; i++) + as[i] = listEntries.get(i).getValue().toString(); + + configElement.set(as); + } + } + } + + protected void drawScreenPost(int mouseX, int mouseY, float f) + { + for (IArrayEntry entry : this.listEntries) + entry.drawToolTip(mouseX, mouseY); + } + + /** + * IGuiListEntry Inner Classes + */ + + public static class DoubleEntry extends StringEntry + { + public DoubleEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement, Double value) + { + super(owningScreen, owningEntryList, configElement, value); + this.isValidated = true; + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (owningScreen.enabled || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT + || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + String validChars = "0123456789"; + String before = this.textFieldValue.getText(); + if (validChars.contains(String.valueOf(eventChar)) || + (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-') + || (!before.contains(".") && eventChar == '.') + || eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT + || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + this.textFieldValue.textboxKeyTyped((owningScreen.enabled ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (!textFieldValue.getText().trim().isEmpty() && !textFieldValue.getText().trim().equals("-")) + { + try + { + double value = Double.parseDouble(textFieldValue.getText().trim()); + if (value < Double.valueOf(configElement.getMinValue().toString()) || value > Double.valueOf(configElement.getMaxValue().toString())) + this.isValidValue = false; + else + this.isValidValue = true; + } + catch (Throwable e) + { + this.isValidValue = false; + } + } + else + this.isValidValue = false; + } + } + + @Override + public Double getValue() + { + try + { + return Double.valueOf(this.textFieldValue.getText().trim()); + } + catch (Throwable e) + { + return Double.MAX_VALUE; + } + } + } + + public static class IntegerEntry extends StringEntry + { + public IntegerEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement, Integer value) + { + super(owningScreen, owningEntryList, configElement, value); + this.isValidated = true; + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (owningScreen.enabled || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT + || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + String validChars = "0123456789"; + String before = this.textFieldValue.getText(); + if (validChars.contains(String.valueOf(eventChar)) + || (!before.startsWith("-") && this.textFieldValue.getCursorPosition() == 0 && eventChar == '-') + || eventKey == Keyboard.KEY_BACK || eventKey == Keyboard.KEY_DELETE + || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + this.textFieldValue.textboxKeyTyped((owningScreen.enabled ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (!textFieldValue.getText().trim().isEmpty() && !textFieldValue.getText().trim().equals("-")) + { + try + { + long value = Long.parseLong(textFieldValue.getText().trim()); + if (value < Integer.valueOf(configElement.getMinValue().toString()) || value > Integer.valueOf(configElement.getMaxValue().toString())) + this.isValidValue = false; + else + this.isValidValue = true; + } + catch (Throwable e) + { + this.isValidValue = false; + } + } + else + this.isValidValue = false; + } + } + + @Override + public Integer getValue() + { + try + { + return Integer.valueOf(this.textFieldValue.getText().trim()); + } + catch (Throwable e) + { + return Integer.MAX_VALUE; + } + } + } + + public static class StringEntry extends BaseEntry + { + protected final GuiTextField textFieldValue; + + public StringEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement, Object value) + { + super(owningScreen, owningEntryList, configElement); + this.textFieldValue = new GuiTextField(owningEntryList.mc.fontRenderer, owningEntryList.width / 4 + 1, 0, owningEntryList.controlWidth - 3, 16); + this.textFieldValue.setMaxStringLength(10000); + this.textFieldValue.setText(value.toString()); + this.isValidated = configElement.getValidationPattern() != null; + + if (configElement.getValidationPattern() != null) + { + if (configElement.getValidationPattern().matcher(this.textFieldValue.getText().trim()).matches()) + isValidValue = true; + else + isValidValue = false; + } + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + if (configElement.isListLengthFixed() || slotIndex != owningEntryList.listEntries.size() - 1) + { + this.textFieldValue.setVisible(true); + this.textFieldValue.yPosition = y + 1; + this.textFieldValue.drawTextBox(); + } + else + this.textFieldValue.setVisible(false); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + { + if (owningScreen.enabled || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT + || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END) + { + this.textFieldValue.textboxKeyTyped((owningScreen.enabled ? eventChar : Keyboard.CHAR_NONE), eventKey); + + if (configElement.getValidationPattern() != null) + { + if (configElement.getValidationPattern().matcher(this.textFieldValue.getText().trim()).matches()) + isValidValue = true; + else + isValidValue = false; + } + } + } + + @Override + public void updateCursorCounter() + { + this.textFieldValue.updateCursorCounter(); + } + + @Override + public void mouseClicked(int x, int y, int mouseEvent) + { + this.textFieldValue.mouseClicked(x, y, mouseEvent); + } + + @Override + public Object getValue() + { + return this.textFieldValue.getText().trim(); + } + + } + + public static class BooleanEntry extends BaseEntry + { + protected final GuiButtonExt btnValue; + private boolean value; + + public BooleanEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement, boolean value) + { + super(owningScreen, owningEntryList, configElement); + this.value = value; + this.btnValue = new GuiButtonExt(0, 0, 0, owningEntryList.controlWidth, 18, I18n.format(String.valueOf(value))); + this.btnValue.enabled = owningScreen.enabled; + this.isValidated = false; + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected); + this.btnValue.xPosition = listWidth / 4; + this.btnValue.yPosition = y; + + String trans = I18n.format(String.valueOf(value)); + if (!trans.equals(String.valueOf(value))) + this.btnValue.displayString = trans; + else + this.btnValue.displayString = String.valueOf(value); + btnValue.packedFGColour = value ? GuiUtils.getColorCode('2', true) : GuiUtils.getColorCode('4', true); + + this.btnValue.drawButton(owningEntryList.mc, mouseX, mouseY); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.btnValue.mousePressed(owningEntryList.mc, x, y)) + { + btnValue.func_146113_a(owningEntryList.mc.getSoundHandler()); + value = !value; + owningEntryList.recalculateState(); + return true; + } + + return super.mousePressed(index, x, y, mouseEvent, relativeX, relativeY); + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.btnValue.mouseReleased(x, y); + super.mouseReleased(index, x, y, mouseEvent, relativeX, relativeY); + } + + @Override + public Object getValue() + { + return Boolean.valueOf(value); + } + } + + public static class BaseEntry implements IArrayEntry + { + protected final GuiEditArray owningScreen; + protected final GuiEditArrayEntries owningEntryList; + protected final IConfigElement configElement; + protected final GuiButtonExt btnAddNewEntryAbove; + private final HoverChecker addNewEntryAboveHoverChecker; + protected final GuiButtonExt btnRemoveEntry; + private final HoverChecker removeEntryHoverChecker; + private List addNewToolTip, removeToolTip; + protected boolean isValidValue = true; + protected boolean isValidated = false; + + @SuppressWarnings({ "unchecked" }) + public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement) + { + this.owningScreen = owningScreen; + this.owningEntryList = owningEntryList; + this.configElement = configElement; + this.btnAddNewEntryAbove = new GuiButtonExt(0, 0, 0, 18, 18, "+"); + this.btnAddNewEntryAbove.packedFGColour = GuiUtils.getColorCode('2', true); + this.btnAddNewEntryAbove.enabled = owningScreen.enabled; + this.btnRemoveEntry = new GuiButtonExt(0, 0, 0, 18, 18, "x"); + this.btnRemoveEntry.packedFGColour = GuiUtils.getColorCode('c', true); + this.btnRemoveEntry.enabled = owningScreen.enabled; + this.addNewEntryAboveHoverChecker = new HoverChecker(this.btnAddNewEntryAbove, 800); + this.removeEntryHoverChecker = new HoverChecker(this.btnRemoveEntry, 800); + this.addNewToolTip = new ArrayList(); + this.removeToolTip = new ArrayList(); + addNewToolTip.add(I18n.format("fml.configgui.tooltip.addNewEntryAbove")); + removeToolTip.add(I18n.format("fml.configgui.tooltip.removeEntry")); + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + if (this.getValue() != null && this.isValidated) + owningEntryList.mc.fontRenderer.drawString( + isValidValue ? EnumChatFormatting.GREEN + VALID : EnumChatFormatting.RED + INVALID, + listWidth / 4 - owningEntryList.mc.fontRenderer.getStringWidth(VALID) - 2, + y + slotHeight / 2 - owningEntryList.mc.fontRenderer.FONT_HEIGHT / 2, + 16777215); + + int half = listWidth / 2; + if (owningEntryList.canAddMoreEntries) + { + this.btnAddNewEntryAbove.visible = true; + this.btnAddNewEntryAbove.xPosition = half + ((half / 2) - 44); + this.btnAddNewEntryAbove.yPosition = y; + this.btnAddNewEntryAbove.drawButton(owningEntryList.mc, mouseX, mouseY); + } + else + this.btnAddNewEntryAbove.visible = false; + + if (!configElement.isListLengthFixed() && slotIndex != owningEntryList.listEntries.size() - 1) + { + this.btnRemoveEntry.visible = true; + this.btnRemoveEntry.xPosition = half + ((half / 2) - 22); + this.btnRemoveEntry.yPosition = y; + this.btnRemoveEntry.drawButton(owningEntryList.mc, mouseX, mouseY); + } + else + this.btnRemoveEntry.visible = false; + } + + @Override + public void drawToolTip(int mouseX, int mouseY) + { + boolean canHover = mouseY < owningEntryList.bottom && mouseY > owningEntryList.top; + if (this.btnAddNewEntryAbove.visible && this.addNewEntryAboveHoverChecker.checkHover(mouseX, mouseY, canHover)) + owningScreen.drawToolTip(this.addNewToolTip, mouseX, mouseY); + if (this.btnRemoveEntry.visible && this.removeEntryHoverChecker.checkHover(mouseX, mouseY, canHover)) + owningScreen.drawToolTip(this.removeToolTip, mouseX, mouseY); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + if (this.btnAddNewEntryAbove.mousePressed(owningEntryList.mc, x, y)) + { + btnAddNewEntryAbove.func_146113_a(owningEntryList.mc.getSoundHandler()); + owningEntryList.addNewEntry(index); + owningEntryList.recalculateState(); + return true; + } + else if (this.btnRemoveEntry.mousePressed(owningEntryList.mc, x, y)) + { + btnRemoveEntry.func_146113_a(owningEntryList.mc.getSoundHandler()); + owningEntryList.removeEntry(index); + owningEntryList.recalculateState(); + return true; + } + + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + this.btnAddNewEntryAbove.mouseReleased(x, y); + this.btnRemoveEntry.mouseReleased(x, y); + } + + @Override + public void keyTyped(char eventChar, int eventKey) + {} + + @Override + public void updateCursorCounter() + {} + + @Override + public void mouseClicked(int x, int y, int mouseEvent) + {} + + @Override + public boolean isValueSavable() + { + return isValidValue; + } + + @Override + public Object getValue() + { + return null; + } + } + + public static interface IArrayEntry extends GuiListExtended.IGuiListEntry + { + public void keyTyped(char eventChar, int eventKey); + + public void updateCursorCounter(); + + public void mouseClicked(int x, int y, int mouseEvent); + + public void drawToolTip(int mouseX, int mouseY); + + public boolean isValueSavable(); + + public Object getValue(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiMessageDialog.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiMessageDialog.java new file mode 100644 index 0000000..093c167 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiMessageDialog.java @@ -0,0 +1,28 @@ +package cpw.mods.fml.client.config; + +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IChatComponent; + +public class GuiMessageDialog extends GuiDisconnected +{ + private String buttonText; + + public GuiMessageDialog(GuiScreen nextScreen, String title, IChatComponent message, String buttonText) + { + super(nextScreen, title, message); + this.buttonText = buttonText; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + ((GuiButton) buttonList.get(0)).displayString = I18n.format(buttonText); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectString.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectString.java new file mode 100644 index 0000000..ee10785 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectString.java @@ -0,0 +1,187 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; + +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + +/** + * This class provides a screen that allows the user to select a value from a list. + * + * @author bspkrs + */ +public class GuiSelectString extends GuiScreen +{ + protected GuiScreen parentScreen; + @SuppressWarnings("rawtypes") + protected IConfigElement configElement; + private GuiSelectStringEntries entriesList; + private GuiButtonExt btnUndoChanges, btnDefault, btnDone; + private String title; + protected String titleLine2; + protected String titleLine3; + protected int slotIndex; + private final Map selectableValues; + public final Object beforeValue; + public Object currentValue; + private HoverChecker tooltipHoverChecker; + @SuppressWarnings("rawtypes") + private List toolTip; + protected boolean enabled; + + @SuppressWarnings("rawtypes") + public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map selectableValues, Object currentValue, boolean enabled) + { + this.mc = Minecraft.getMinecraft(); + this.parentScreen = parentScreen; + this.configElement = configElement; + this.slotIndex = slotIndex; + this.selectableValues = selectableValues; + this.beforeValue = currentValue; + this.currentValue = currentValue; + this.toolTip = new ArrayList(); + this.enabled = enabled; + String propName = I18n.format(configElement.getLanguageKey()); + String comment; + + comment = I18n.format(configElement.getLanguageKey() + ".tooltip", + "\n" + EnumChatFormatting.AQUA, configElement.getDefault(), configElement.getMinValue(), configElement.getMaxValue()); + + if (!comment.equals(configElement.getLanguageKey() + ".tooltip")) + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + comment, 300); + else if (configElement.getComment() != null && !configElement.getComment().trim().isEmpty()) + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.YELLOW + configElement.getComment(), 300); + else + toolTip = mc.fontRenderer.listFormattedStringToWidth( + EnumChatFormatting.GREEN + propName + "\n" + EnumChatFormatting.RED + "No tooltip defined.", 300); + + if (parentScreen instanceof GuiConfig) + { + this.title = ((GuiConfig) parentScreen).title; + this.titleLine2 = ((GuiConfig) parentScreen).titleLine2; + this.titleLine3 = I18n.format(configElement.getLanguageKey()); + this.tooltipHoverChecker = new HoverChecker(28, 37, 0, parentScreen.width, 800); + + } + else + { + this.title = I18n.format(configElement.getLanguageKey()); + this.tooltipHoverChecker = new HoverChecker(8, 17, 0, parentScreen.width, 800); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues); + + int undoGlyphWidth = mc.fontRenderer.getStringWidth(UNDO_CHAR) * 2; + int resetGlyphWidth = mc.fontRenderer.getStringWidth(RESET_CHAR) * 2; + int doneWidth = Math.max(mc.fontRenderer.getStringWidth(I18n.format("gui.done")) + 20, 100); + int undoWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.undoChanges")) + undoGlyphWidth + 20; + int resetWidth = mc.fontRenderer.getStringWidth(" " + I18n.format("fml.configgui.tooltip.resetToDefault")) + resetGlyphWidth + 20; + int buttonWidthHalf = (doneWidth + 5 + undoWidth + 5 + resetWidth) / 2; + this.buttonList.add(btnDone = new GuiButtonExt(2000, this.width / 2 - buttonWidthHalf, this.height - 29, doneWidth, 20, I18n.format("gui.done"))); + this.buttonList.add(btnDefault = new GuiUnicodeGlyphButton(2001, this.width / 2 - buttonWidthHalf + doneWidth + 5 + undoWidth + 5, + this.height - 29, resetWidth, 20, " " + I18n.format("fml.configgui.tooltip.resetToDefault"), RESET_CHAR, 2.0F)); + this.buttonList.add(btnUndoChanges = new GuiUnicodeGlyphButton(2002, this.width / 2 - buttonWidthHalf + doneWidth + 5, + this.height - 29, undoWidth, 20, " " + I18n.format("fml.configgui.tooltip.undoChanges"), UNDO_CHAR, 2.0F)); + } + + @Override + protected void actionPerformed(GuiButton button) + { + if (button.id == 2000) + { + try + { + this.entriesList.saveChanges(); + } + catch (Throwable e) + { + e.printStackTrace(); + } + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 2001) + { + this.currentValue = configElement.getDefault(); + this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues); + } + else if (button.id == 2002) + { + this.currentValue = beforeValue; + this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + @Override + protected void mouseMovedOrUp(int x, int y, int mouseEvent) + { + if (mouseEvent != 0 || !this.entriesList.func_148181_b(x, y, mouseEvent)) + { + super.mouseMovedOrUp(x, y, mouseEvent); + } + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int par1, int par2, float par3) + { + this.drawDefaultBackground(); + this.entriesList.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 8, 16777215); + + if (this.titleLine2 != null) + this.drawCenteredString(this.fontRendererObj, this.titleLine2, this.width / 2, 18, 16777215); + + if (this.titleLine3 != null) + this.drawCenteredString(this.fontRendererObj, this.titleLine3, this.width / 2, 28, 16777215); + + this.btnDone.enabled = currentValue != null; + this.btnDefault.enabled = enabled && !this.entriesList.isDefault(); + this.btnUndoChanges.enabled = enabled && this.entriesList.isChanged(); + super.drawScreen(par1, par2, par3); + + if (this.tooltipHoverChecker != null && this.tooltipHoverChecker.checkHover(par1, par2)) + drawToolTip(this.toolTip, par1, par2); + } + + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) + { + this.func_146283_a(stringList, x, y); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java new file mode 100644 index 0000000..ea3e390 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java @@ -0,0 +1,217 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.renderer.Tessellator; +import cpw.mods.fml.client.config.GuiConfigEntries.SelectValueEntry; + +/** + * This class implements the scrolling list functionality of the GuiSelectString screen. + * + * @author bspkrs + */ +public class GuiSelectStringEntries extends GuiListExtended +{ + public GuiSelectString owningScreen; + public Minecraft mc; + @SuppressWarnings("rawtypes") + public IConfigElement configElement; + public List listEntries; + public final Map selectableValues; + public int selectedIndex = -1; + public int maxEntryWidth = 0; + + @SuppressWarnings("rawtypes") + public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map selectableValues) + { + super(mc, owningScreen.width, owningScreen.height, owningScreen.titleLine2 != null ? (owningScreen.titleLine3 != null ? 43 : 33) : 23, + owningScreen.height - 32, 11); + this.owningScreen = owningScreen; + this.mc = mc; + this.configElement = configElement; + this.selectableValues = selectableValues; + this.setShowSelectionBox(true); + + listEntries = new ArrayList(); + + int index = 0; + List> sortedList = new ArrayList>(selectableValues.entrySet()); + Collections.sort(sortedList, new EntryComparator()); + + for (Entry entry : sortedList) + { + listEntries.add(new ListEntry(this, entry)); + if (mc.fontRenderer.getStringWidth(entry.getValue()) > maxEntryWidth) + maxEntryWidth = mc.fontRenderer.getStringWidth(entry.getValue()); + + if (owningScreen.currentValue.equals(entry.getKey())) + { + this.selectedIndex = index; + } + + index++; + } + } + + public static class EntryComparator implements Comparator> + { + @Override + public int compare(Entry o1, Entry o2) + { + int compare = o1.getValue().toLowerCase(Locale.US).compareTo(o2.getValue().toLowerCase(Locale.US)); + + if (compare == 0) + compare = o1.getKey().toString().toLowerCase(Locale.US).compareTo(o2.getKey().toString().toLowerCase(Locale.US)); + + return compare; + } + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + @Override + protected void elementClicked(int index, boolean doubleClick, int mouseX, int mouseY) + { + selectedIndex = index; + owningScreen.currentValue = listEntries.get(index).getValue(); + } + + /** + * Returns true if the element passed in is currently selected + */ + /** + * Returns true if the element passed in is currently selected + */ + @Override + protected boolean isSelected(int index) + { + return index == selectedIndex; + } + + @Override + protected int getScrollBarX() + { + return width / 2 + this.maxEntryWidth / 2 + 5; + } + + /** + * Gets the width of the list + */ + /** + * Gets the width of the list + */ + @Override + public int getListWidth() + { + return maxEntryWidth + 5; + } + + /** + * Gets the IGuiListEntry object for the given index + */ + @Override + public IGuiSelectStringListEntry getListEntry(int index) + { + return listEntries.get(index); + } + + @Override + protected int getSize() + { + return listEntries.size(); + } + + public boolean isChanged() + { + return owningScreen.beforeValue != null ? !owningScreen.beforeValue.equals(owningScreen.currentValue) : owningScreen.currentValue != null; + } + + public boolean isDefault() + { + return owningScreen.currentValue != null ? owningScreen.currentValue.equals(configElement.getDefault()) : configElement.getDefault() == null; + } + + @SuppressWarnings("unchecked") + public void saveChanges() + { + if (owningScreen.slotIndex != -1 && owningScreen.parentScreen != null + && owningScreen.parentScreen instanceof GuiConfig + && ((GuiConfig) owningScreen.parentScreen).entryList.getListEntry(owningScreen.slotIndex) instanceof SelectValueEntry) + { + SelectValueEntry entry = (SelectValueEntry) ((GuiConfig) owningScreen.parentScreen).entryList.getListEntry(owningScreen.slotIndex); + + entry.setValueFromChildScreen(owningScreen.currentValue); + } + else + configElement.set(owningScreen.currentValue); + } + + public static class ListEntry implements IGuiSelectStringListEntry + { + protected final GuiSelectStringEntries owningList; + protected final Entry value; + + public ListEntry(GuiSelectStringEntries owningList, Entry value) + { + this.owningList = owningList; + this.value = value; + } + + @Override + public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isSelected) + { + owningList.mc.fontRenderer.drawString(value.getValue(), x + 1, y, slotIndex == owningList.selectedIndex ? 16777215 : 14737632); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + @Override + public boolean mousePressed(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + { + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + @Override + public void mouseReleased(int index, int x, int y, int mouseEvent, int relativeX, int relativeY) + {} + + @Override + public Object getValue() + { + return value.getKey(); + } + } + + public static interface IGuiSelectStringListEntry extends GuiListExtended.IGuiListEntry + { + public Object getValue(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSlider.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSlider.java new file mode 100644 index 0000000..92f2503 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiSlider.java @@ -0,0 +1,218 @@ +package cpw.mods.fml.client.config; + +import net.minecraft.client.Minecraft; + +import org.lwjgl.opengl.GL11; + +/** + * This class is blatantly stolen from iChunUtils with permission. + * + * @author iChun + */ +public class GuiSlider extends GuiButtonExt +{ + /** The value of this slider control. */ + public double sliderValue = 1.0F; + + public String dispString = ""; + + /** Is this slider control being dragged. */ + public boolean dragging = false; + public boolean showDecimal = true; + + public double minValue = 0.0D; + public double maxValue = 5.0D; + public int precision = 1; + + public ISlider parent = null; + + public String suffix = ""; + + public boolean drawString = true; + + public GuiSlider(int id, int xPos, int yPos, int width, int height, String prefix, String suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr) + { + this(id, xPos, yPos, width, height, prefix, suf, minVal, maxVal, currentVal, showDec, drawStr, null); + } + + public GuiSlider(int id, int xPos, int yPos, int width, int height, String prefix, String suf, double minVal, double maxVal, double currentVal, boolean showDec, boolean drawStr, ISlider par) + { + super(id, xPos, yPos, width, height, prefix); + minValue = minVal; + maxValue = maxVal; + sliderValue = (currentVal - minValue) / (maxValue - minValue); + dispString = prefix; + parent = par; + suffix = suf; + showDecimal = showDec; + String val; + + if (showDecimal) + { + val = Double.toString(sliderValue * (maxValue - minValue) + minValue); + precision = Math.min(val.substring(val.indexOf(".") + 1).length(), 4); + } + else + { + val = Integer.toString((int)Math.round(sliderValue * (maxValue - minValue) + minValue)); + precision = 0; + } + + displayString = dispString + val + suffix; + + drawString = drawStr; + if(!drawString) + { + displayString = ""; + } + } + + public GuiSlider(int id, int xPos, int yPos, String displayStr, double minVal, double maxVal, double currentVal, ISlider par) + { + this(id, xPos, yPos, 150, 20, displayStr, "", minVal, maxVal, currentVal, true, true, par); + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over + * this button. + */ + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over + * this button. + */ + @Override + public int getHoverState(boolean par1) + { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + @Override + protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) + { + if (this.visible) + { + if (this.dragging) + { + this.sliderValue = (par2 - (this.xPosition + 4)) / (float)(this.width - 8); + updateSlider(); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.sliderValue * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + @Override + public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) + { + if (super.mousePressed(par1Minecraft, par2, par3)) + { + this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); + updateSlider(); + this.dragging = true; + return true; + } + else + { + return false; + } + } + + public void updateSlider() + { + if (this.sliderValue < 0.0F) + { + this.sliderValue = 0.0F; + } + + if (this.sliderValue > 1.0F) + { + this.sliderValue = 1.0F; + } + + String val; + + if (showDecimal) + { + val = Double.toString(sliderValue * (maxValue - minValue) + minValue); + + if (val.substring(val.indexOf(".") + 1).length() > precision) + { + val = val.substring(0, val.indexOf(".") + precision + 1); + + if (val.endsWith(".")) + { + val = val.substring(0, val.indexOf(".") + precision); + } + } + else + { + while (val.substring(val.indexOf(".") + 1).length() < precision) + { + val = val + "0"; + } + } + } + else + { + val = Integer.toString((int)Math.round(sliderValue * (maxValue - minValue) + minValue)); + } + + if(drawString) + { + displayString = dispString + val + suffix; + } + + if (parent != null) + { + parent.onChangeSliderValue(this); + } + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + @Override + public void mouseReleased(int par1, int par2) + { + this.dragging = false; + } + + public int getValueInt() + { + return (int)Math.round(sliderValue * (maxValue - minValue) + minValue); + } + + public double getValue() + { + return sliderValue * (maxValue - minValue) + minValue; + } + + public void setValue(double d) + { + this.sliderValue = (d - minValue) / (maxValue - minValue); + } + + public static interface ISlider + { + void onChangeSliderValue(GuiSlider slider); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.java new file mode 100644 index 0000000..53d13db --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUnicodeGlyphButton.java @@ -0,0 +1,86 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import net.minecraft.client.Minecraft; + +import org.lwjgl.opengl.GL11; + +/** + * This class provides a button that shows a string glyph at the beginning. The glyph can be scaled using the glyphScale parameter. + * + * @author bspkrs + */ +public class GuiUnicodeGlyphButton extends GuiButtonExt +{ + public String glyph; + public float glyphScale; + + public GuiUnicodeGlyphButton(int id, int xPos, int yPos, int width, int height, String displayString, String glyph, float glyphScale) + { + super(id, xPos, yPos, width, height, displayString); + this.glyph = glyph; + this.glyphScale = glyphScale; + } + + /** + * Draws this button to the screen. + */ + @Override + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.field_146123_n); + GuiUtils.drawContinuousTexturedBox(buttonTextures, this.xPosition, this.yPosition, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.zLevel); + this.mouseDragged(mc, mouseX, mouseY); + int color = 14737632; + + if (packedFGColour != 0) + { + color = packedFGColour; + } + else if (!this.enabled) + { + color = 10526880; + } + else if (this.field_146123_n) + { + color = 16777120; + } + + String buttonText = this.displayString; + int glyphWidth = (int) (mc.fontRenderer.getStringWidth(glyph) * glyphScale); + int strWidth = mc.fontRenderer.getStringWidth(buttonText); + int elipsisWidth = mc.fontRenderer.getStringWidth("..."); + int totalWidth = strWidth + glyphWidth; + + if (totalWidth > width - 6 && totalWidth > elipsisWidth) + buttonText = mc.fontRenderer.trimStringToWidth(buttonText, width - 6 - elipsisWidth).trim() + "..."; + + strWidth = mc.fontRenderer.getStringWidth(buttonText); + totalWidth = glyphWidth + strWidth; + + GL11.glPushMatrix(); + GL11.glScalef(glyphScale, glyphScale, 1.0F); + this.drawCenteredString(mc.fontRenderer, glyph, + (int) (((this.xPosition + (this.width / 2) - (strWidth / 2)) / glyphScale) - (glyphWidth / (2 * glyphScale)) + 2), + (int) (((this.yPosition + ((this.height - 8) / glyphScale) / 2) - 1) / glyphScale), color); + GL11.glPopMatrix(); + + this.drawCenteredString(mc.fontRenderer, buttonText, (int) (this.xPosition + (this.width / 2) + (glyphWidth / glyphScale)), + this.yPosition + (this.height - 8) / 2, color); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUtils.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUtils.java new file mode 100644 index 0000000..eedf8dc --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/GuiUtils.java @@ -0,0 +1,194 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +/** + * This class provides several methods and constants used by the Config GUI classes. + * + * @author bspkrs + */ +public class GuiUtils +{ + public static final String UNDO_CHAR = "\u21B6"; + public static final String RESET_CHAR = "\u2604"; + public static final String VALID = "\u2714"; + public static final String INVALID = "\u2715"; + + private static int[] colorCodes = new int[] { 0, 170, 43520, 43690, 11141120, 11141290, 16755200, 11184810, 5592405, 5592575, 5635925, 5636095, 16733525, 16733695, 16777045, 16777215, + 0, 42, 10752, 10794, 2752512, 2752554, 2763264, 2763306, 1381653, 1381695, 1392405, 1392447, 4134165, 4134207, 4144917, 4144959 }; + + public static int getColorCode(char c, boolean isLighter) + { + return colorCodes[isLighter ? "0123456789abcdef".indexOf(c) : "0123456789abcdef".indexOf(c) + 16]; + } + /** + * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders + * and filler. It is assumed that the desired texture ResourceLocation object has been bound using + * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). + * + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image + * @param textureHeight the height of the box texture in the resource location image + * @param borderSize the size of the box's borders + * @param zLevel the zLevel to draw at + */ + public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, + int borderSize, float zLevel) + { + drawContinuousTexturedBox(x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel); + } + + /** + * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders + * and filler. The provided ResourceLocation object will be bound using + * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). + * + * @param res the ResourceLocation object that contains the desired image + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image + * @param textureHeight the height of the box texture in the resource location image + * @param borderSize the size of the box's borders + * @param zLevel the zLevel to draw at + */ + public static void drawContinuousTexturedBox(ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, + int borderSize, float zLevel) + { + drawContinuousTexturedBox(res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel); + } + + /** + * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders + * and filler. The provided ResourceLocation object will be bound using + * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). + * + * @param res the ResourceLocation object that contains the desired image + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image + * @param textureHeight the height of the box texture in the resource location image + * @param topBorder the size of the box's top border + * @param bottomBorder the size of the box's bottom border + * @param leftBorder the size of the box's left border + * @param rightBorder the size of the box's right border + * @param zLevel the zLevel to draw at + */ + public static void drawContinuousTexturedBox(ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, + int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) + { + Minecraft.getMinecraft().getTextureManager().bindTexture(res); + drawContinuousTexturedBox(x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel); + } + + /** + * Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders + * and filler. It is assumed that the desired texture ResourceLocation object has been bound using + * Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation). + * + * @param x x axis offset + * @param y y axis offset + * @param u bound resource location image x offset + * @param v bound resource location image y offset + * @param width the desired box width + * @param height the desired box height + * @param textureWidth the width of the box texture in the resource location image + * @param textureHeight the height of the box texture in the resource location image + * @param topBorder the size of the box's top border + * @param bottomBorder the size of the box's bottom border + * @param leftBorder the size of the box's left border + * @param rightBorder the size of the box's right border + * @param zLevel the zLevel to draw at + */ + public static void drawContinuousTexturedBox(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, + int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + int fillerWidth = textureWidth - leftBorder - rightBorder; + int fillerHeight = textureHeight - topBorder - bottomBorder; + int canvasWidth = width - leftBorder - rightBorder; + int canvasHeight = height - topBorder - bottomBorder; + int xPasses = canvasWidth / fillerWidth; + int remainderWidth = canvasWidth % fillerWidth; + int yPasses = canvasHeight / fillerHeight; + int remainderHeight = canvasHeight % fillerHeight; + + // Draw Border + // Top Left + drawTexturedModalRect(x, y, u, v, leftBorder, topBorder, zLevel); + // Top Right + drawTexturedModalRect(x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder, topBorder, zLevel); + // Bottom Left + drawTexturedModalRect(x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel); + // Bottom Right + drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel); + + for (int i = 0; i < xPasses + (remainderWidth > 0 ? 1 : 0); i++) + { + // Top Border + drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel); + // Bottom Border + drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel); + + // Throw in some filler for good measure + for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++) + drawTexturedModalRect(x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel); + } + + // Side Borders + for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++) + { + // Left Border + drawTexturedModalRect(x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel); + // Right Border + drawTexturedModalRect(x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel); + } + } + + public static void drawTexturedModalRect(int x, int y, int u, int v, int width, int height, float zLevel) + { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((x + 0), (y + height), zLevel, ((u + 0) * var7), ((v + height) * var8)); + tessellator.addVertexWithUV((x + width), (y + height), zLevel, ((u + width) * var7), ((v + height) * var8)); + tessellator.addVertexWithUV((x + width), (y + 0), zLevel, ((u + width) * var7), ((v + 0) * var8)); + tessellator.addVertexWithUV((x + 0), (y + 0), zLevel, ((u + 0) * var7), ((v + 0) * var8)); + tessellator.draw(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/HoverChecker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/HoverChecker.java new file mode 100644 index 0000000..ed816c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/HoverChecker.java @@ -0,0 +1,96 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import net.minecraft.client.gui.GuiButton; + +/** + * This class implements an easy way to check if the mouse has hovered within a certain region of the screen for a given + * period of time. The region can be defined manually or by supplying a GuiButton object. + * + * @author bspkrs + */ +public class HoverChecker +{ + private int top, bottom, left, right, threshold; + private GuiButton button; + private long hoverStart; + + public HoverChecker(int top, int bottom, int left, int right, int threshold) + { + this.top = top; + this.bottom = bottom; + this.left = left; + this.right = right; + this.threshold = threshold; + this.hoverStart = -1; + } + + public HoverChecker(GuiButton button, int threshold) + { + this.button = button; + this.threshold = threshold; + } + + /** + * Call this method if the intended region has changed such as if the region must follow a scrolling list. + * It is not necessary to call this method if a GuiButton defines the hover region. + */ + public void updateBounds(int top, int bottom, int left, int right) + { + this.top = top; + this.bottom = bottom; + this.left = left; + this.right = right; + } + + /** + * Checks if the mouse is in the hover region. If the specified time period has elapsed the method returns true. + * The hover timer is reset if the mouse is not within the region. + */ + public boolean checkHover(int mouseX, int mouseY) + { + return checkHover(mouseX, mouseY, true); + } + + /** + * Checks if the mouse is in the hover region. If the specified time period has elapsed the method returns true. + * The hover timer is reset if the mouse is not within the region. + */ + public boolean checkHover(int mouseX, int mouseY, boolean canHover) + { + if (this.button != null) + { + this.top = button.yPosition; + this.bottom = button.yPosition + button.height; + this.left = button.xPosition; + this.right = button.xPosition + button.width; + canHover = canHover && button.visible; + } + + if (canHover && hoverStart == -1 && mouseY >= top && mouseY <= bottom && mouseX >= left && mouseX <= right) + hoverStart = System.currentTimeMillis(); + else if (!canHover || mouseY < top || mouseY > bottom || mouseX < left || mouseX > right) + resetHoverTimer(); + + return canHover && hoverStart != -1 && System.currentTimeMillis() - hoverStart >= threshold; + } + + /** + * Manually resets the hover timer. + */ + public void resetHoverTimer() + { + hoverStart = -1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/IConfigElement.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/IConfigElement.java new file mode 100644 index 0000000..c1a792c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/config/IConfigElement.java @@ -0,0 +1,172 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.config; + +import java.util.List; +import java.util.regex.Pattern; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.config.GuiEditArrayEntries.IArrayEntry; + +/** + * This interface provides the information needed by GuiConfig and GuiConfigEntries to display config elements for editing. + * + * @author bspkrs + */ +public interface IConfigElement +{ + /** + * [Property, Category] Is this object a property object? + */ + public boolean isProperty(); + + /** + * This method returns a class that implements {@code IConfigEntry} or null. This class MUST + * provide a constructor with the following parameter types: {@code GuiConfig}, {@code GuiConfigEntries}, {@code IConfigElement} + */ + @SuppressWarnings("rawtypes") + public Class getConfigEntryClass(); + + /** + * This method returns a class that implements {@code IArrayEntry}. This class MUST provide a constructor with the + * following parameter types: {@code GuiEditArray}, {@code GuiEditArrayEntries}, {@code IConfigElement}, {@code Object} + */ + public Class getArrayEntryClass(); + + /** + * [Property, Category] Gets the name of this object. + */ + public String getName(); + + /** + * [Category] Gets the qualified name of this object. This is typically only used for category objects. + */ + public String getQualifiedName(); + + /** + * [Property, Category] Gets a language key for localization of config GUI entry names. If the same key is specified with .tooltip + * appended to the end, that key will return a localized tooltip when the mouse hovers over the property label/category button. + */ + public String getLanguageKey(); + + /** + * [Property, Category] Gets the comment for this object. Used for the tooltip if getLanguageKey() + ".tooltip" is not defined in the + * .lang file. + */ + public String getComment(); + + /** + * [Category] Gets this category's child categories/properties. + */ + @SuppressWarnings("rawtypes") + public List getChildElements(); + + /** + * [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a + * category object. + */ + public ConfigGuiType getType(); + + /** + * [Property] Is this property object a list? + */ + public boolean isList(); + + /** + * [Property] Does this list property have to remain a fixed length? + */ + public boolean isListLengthFixed(); + + /** + * [Property] Gets the max length of this list property, or -1 if the length is unlimited. + */ + public int getMaxListLength(); + + /** + * [Property] Is this property value equal to the default value? + */ + public boolean isDefault(); + + /** + * [Property] Gets this property's default value. If this element is an array, this method should return a String + * representation of that array using Arrays.toString() + */ + public Object getDefault(); + + /** + * [Property] Gets this property's default values. + */ + public Object[] getDefaults(); + + /** + * [Property] Sets this property's value to the default value. + */ + public void setToDefault(); + + /** + * [Property, Category] Whether or not this element is safe to modify while a world is running. For Categories return false if ANY properties + * in the category are modifiable while a world is running, true if all are not. + */ + public boolean requiresWorldRestart(); + + /** + * [Property, Category] Whether or not this element should be allowed to show on config GUIs. + */ + public boolean showInGui(); + + /** + * [Property, Category] Whether or not this element requires Minecraft to be restarted when changed. + */ + public boolean requiresMcRestart(); + + /** + * [Property] Gets this property value. + */ + public Object get(); + + /** + * [Property] Gets this property value as a list. Generally you should be sure of whether the property is a list before calling this. + */ + public Object[] getList(); + + /** + * [Property] Sets this property's value. + */ + public void set(T value); + + /** + * [Property] Sets this property's value to the specified array. + */ + public void set(T[] aVal); + + /** + * [Property] Gets a String array of valid values for this property. This is generally used for String properties to allow the user to + * select a value from a list of valid values. + */ + public String[] getValidValues(); + + /** + * [Property] Gets this property's minimum value. + */ + public T getMinValue(); + + /** + * [Property] Gets this property's maximum value. + */ + public T getMaxValue(); + + /** + * [Property] Gets a Pattern object used in String property input validation. + */ + public Pattern getValidationPattern(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/event/ConfigChangedEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/event/ConfigChangedEvent.java new file mode 100644 index 0000000..17ee691 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/event/ConfigChangedEvent.java @@ -0,0 +1,85 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2014 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors (this class): + * bspkrs - implementation + */ + +package cpw.mods.fml.client.event; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; + +/** + * These events are posted from the GuiConfig screen when the done button is pressed. The events are only posted + * if the parent screen is not an instance of GuiConfig or if the configID field has been set for + * the GuiConfig screen. + * + * Listeners for this event should use OnConfigChanged or PostConfigChanged and check for a specific mod ID. + * For best results the listener should refresh any objects/fields that are set based on the mod's config + * and should serialize the modified config. + * + * @author bspkrs + */ +@HasResult +public class ConfigChangedEvent extends Event +{ + /** + * The Mod ID of the mod whose configuration just changed. + */ + public final String modID; + /** + * Whether or not a world is currently running. + */ + public final boolean isWorldRunning; + /** + * Will be set to true if any elements were changed that require a restart of Minecraft. + */ + public final boolean requiresMcRestart; + /** + * A String identifier for this ConfigChangedEvent. + */ + public final String configID; + + public ConfigChangedEvent(String modID, String configID, boolean isWorldRunning, boolean requiresMcRestart) + { + this.modID = modID; + this.configID = configID; + this.isWorldRunning = isWorldRunning; + this.requiresMcRestart = requiresMcRestart; + } + + /** + * This event is intended to be consumed by the mod whose config has been changed. It fires when the Done button + * has been clicked on a GuiConfig screen and the following conditions are met:
+ * - at least one config element has been changed
+ * - one of these 2 conditions are met:
+ * 1) the parent screen is null or is not an instance of GuiConfig
+ * 2) the configID field has been set to a non-null value for the GuiConfig screen

+ * Modders should check the modID field of the event to ensure they are only acting on their own config screen's event! + */ + public static class OnConfigChangedEvent extends ConfigChangedEvent + { + public OnConfigChangedEvent(String modID, String configID, boolean isWorldRunning, boolean requiresMcRestart) + { + super(modID, configID, isWorldRunning, requiresMcRestart); + } + } + + /** + * This event is provided for mods to consume if they want to be able to check if other mods' configs have been changed. + * This event only fires if the OnConfigChangedEvent result is not DENY. + */ + public static class PostConfigChangedEvent extends ConfigChangedEvent + { + public PostConfigChangedEvent(String modID, String configID, boolean isWorldRunning, boolean requiresMcRestart) + { + super(modID, configID, isWorldRunning, requiresMcRestart); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ClientRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ClientRegistry.java new file mode 100644 index 0000000..4543d42 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ClientRegistry.java @@ -0,0 +1,51 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client.registry; + +import org.apache.commons.lang3.ArrayUtils; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.tileentity.TileEntity; + +public class ClientRegistry +{ + /** + * + * Utility method for registering a tile entity and it's renderer at once - generally you should register them separately + * + * @param tileEntityClass + * @param id + * @param specialRenderer + */ + public static void registerTileEntity(Class tileEntityClass, String id, TileEntitySpecialRenderer specialRenderer) + { + GameRegistry.registerTileEntity(tileEntityClass, id); + bindTileEntitySpecialRenderer(tileEntityClass, specialRenderer); + } + + @SuppressWarnings("unchecked") + public static void bindTileEntitySpecialRenderer(Class tileEntityClass, TileEntitySpecialRenderer specialRenderer) + { + TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(tileEntityClass, specialRenderer); + specialRenderer.func_147497_a(TileEntityRendererDispatcher.instance); + } + + public static void registerKeyBinding(KeyBinding key) + { + Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.add(Minecraft.getMinecraft().gameSettings.keyBindings, key); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.java new file mode 100644 index 0000000..1108a1c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/ISimpleBlockRenderingHandler.java @@ -0,0 +1,28 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client.registry; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; + +public interface ISimpleBlockRenderingHandler +{ + public abstract void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer); + + public abstract boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer); + + public abstract boolean shouldRender3DInInventory(int modelId); + + public abstract int getRenderId(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/RenderingRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/RenderingRegistry.java new file mode 100644 index 0000000..7100685 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/client/registry/RenderingRegistry.java @@ -0,0 +1,142 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.client.registry; + +import java.util.List; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.world.IBlockAccess; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.ObjectArrays; + +/** + * @author cpw + * + */ +public class RenderingRegistry +{ + private static final RenderingRegistry INSTANCE = new RenderingRegistry(); + + private int nextRenderId = 42; + + private Map blockRenderers = Maps.newHashMap(); + + private List entityRenderers = Lists.newArrayList(); + + /** + * Add a new armour prefix to the RenderPlayer + * + * @param armor + */ + public static int addNewArmourRendererPrefix(String armor) + { + RenderBiped.bipedArmorFilenamePrefix = ObjectArrays.concat(RenderBiped.bipedArmorFilenamePrefix, armor); + return RenderBiped.bipedArmorFilenamePrefix.length - 1; + } + + /** + * Register an entity rendering handler. This will, after mod initialization, be inserted into the main + * render map for entities + * + * @param entityClass + * @param renderer + */ + public static void registerEntityRenderingHandler(Class entityClass, Render renderer) + { + instance().entityRenderers.add(new EntityRendererInfo(entityClass, renderer)); + } + + /** + * Register a simple block rendering handler + * + * @param handler + */ + public static void registerBlockHandler(ISimpleBlockRenderingHandler handler) + { + instance().blockRenderers.put(handler.getRenderId(), handler); + } + + /** + * Register the simple block rendering handler + * This version will not call getRenderId on the passed in handler, instead using the supplied ID, so you + * can easily re-use the same rendering handler for multiple IDs + * + * @param renderId + * @param handler + */ + public static void registerBlockHandler(int renderId, ISimpleBlockRenderingHandler handler) + { + instance().blockRenderers.put(renderId, handler); + } + /** + * Get the next available renderId from the block render ID list + */ + public static int getNextAvailableRenderId() + { + return instance().nextRenderId++; + } + + + @Deprecated public static RenderingRegistry instance() + { + return INSTANCE; + } + + private static class EntityRendererInfo + { + public EntityRendererInfo(Class target, Render renderer) + { + this.target = target; + this.renderer = renderer; + } + private Class target; + private Render renderer; + } + + public boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId) + { + if (!blockRenderers.containsKey(modelId)) { return false; } + ISimpleBlockRenderingHandler bri = blockRenderers.get(modelId); + return bri.renderWorldBlock(world, x, y, z, block, modelId, renderer); + } + + public void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID) + { + if (!blockRenderers.containsKey(modelID)) { return; } + ISimpleBlockRenderingHandler bri = blockRenderers.get(modelID); + bri.renderInventoryBlock(block, metadata, modelID, renderer); + } + + public boolean renderItemAsFull3DBlock(int modelId) + { + ISimpleBlockRenderingHandler bri = blockRenderers.get(modelId); + return bri != null && bri.shouldRender3DInInventory(modelId); + } + + public void loadEntityRenderers(Map, Render> rendererMap) + { + for (EntityRendererInfo info : entityRenderers) + { + rendererMap.put(info.target, info.renderer); + info.renderer.setRenderManager(RenderManager.instance); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/API.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/API.java new file mode 100644 index 0000000..35b07d7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/API.java @@ -0,0 +1,14 @@ +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.PACKAGE) +public @interface API { + String owner(); + String provides(); + String apiVersion(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitPluginRef.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitPluginRef.java new file mode 100644 index 0000000..c4744fe --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitPluginRef.java @@ -0,0 +1,41 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Declare a variable to be populated by a Bukkit Plugin proxy instance if the bukkit coremod + * is available. It can only be applied to field typed as {@link BukkitProxy} + * Generally it should be used in conjunction with {@link Mod#bukkitPlugin()} specifying the + * plugin to load. + * + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface BukkitPluginRef +{ + /** + * A reference (possibly version specific) to a Bukkit Plugin by name, using the name@versionbound + * specification. If this is a bukkit enabled environment the field annotated by this + * will be populated with a {@link BukkitProxy} instance if possible. This proxy will be gotten by + * reflectively calling the "getModProxy" method on the bukkit plugin instance. + * @return The name of the plugin which we will inject into this field + */ + String value(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitProxy.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitProxy.java new file mode 100644 index 0000000..2b1235d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/BukkitProxy.java @@ -0,0 +1,24 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +/** + * A marker interface for retrieving a proxy to a bukkit plugin. + * Fields associated with {@link BukkitPluginRef} annotations should + * declare this type and cast down if the target is available (not null) + * @author cpw + * + */ +public interface BukkitProxy +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/CertificateHelper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/CertificateHelper.java new file mode 100644 index 0000000..755258e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/CertificateHelper.java @@ -0,0 +1,68 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.nio.ByteBuffer; +import java.security.MessageDigest; +import java.security.cert.Certificate; + +public class CertificateHelper { + + private static final String HEXES = "0123456789abcdef"; + + public static String getFingerprint(Certificate certificate) + { + if (certificate == null) + { + return "NO VALID CERTIFICATE FOUND"; + } + try + { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] der = certificate.getEncoded(); + md.update(der); + byte[] digest = md.digest(); + return hexify(digest); + } + catch (Exception e) + { + return null; + } + } + + public static String getFingerprint(ByteBuffer buffer) + { + try + { + MessageDigest digest = MessageDigest.getInstance("SHA-1"); + digest.update(buffer); + byte[] chksum = digest.digest(); + return hexify(chksum); + } + catch (Exception e) + { + return null; + } + } + + private static String hexify(byte[] chksum) + { + final StringBuilder hex = new StringBuilder( 2 * chksum.length ); + for ( final byte b : chksum ) { + hex.append(HEXES.charAt((b & 0xF0) >> 4)) + .append(HEXES.charAt((b & 0x0F))); + } + return hex.toString(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ClassNameUtils.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ClassNameUtils.java new file mode 100644 index 0000000..50c22ed --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ClassNameUtils.java @@ -0,0 +1,10 @@ +package cpw.mods.fml.common; + +public class ClassNameUtils +{ + public static String shortName(Class clz) + { + String nm = clz.getName(); + return nm.indexOf('.') > -1 ? nm.substring(nm.lastIndexOf('.')+1) : nm; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/DummyModContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/DummyModContainer.java new file mode 100644 index 0000000..9039b70 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/DummyModContainer.java @@ -0,0 +1,203 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.security.cert.Certificate; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.collect.ImmutableList; +import com.google.common.eventbus.EventBus; + +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import cpw.mods.fml.common.versioning.VersionRange; + +public class DummyModContainer implements ModContainer +{ + private ModMetadata md; + private ArtifactVersion processedVersion; + private String label; + + public DummyModContainer(ModMetadata md) + { + this.md = md; + } + + public DummyModContainer(String label) + { + this.label = label; + } + public DummyModContainer() + { + } + + @Override + public void bindMetadata(MetadataCollection mc) + { + } + + @Override + public List getDependants() + { + return Collections.emptyList(); + } + + @Override + public List getDependencies() + { + return Collections.emptyList(); + } + + @Override + public Set getRequirements() + { + return Collections.emptySet(); + } + + @Override + public ModMetadata getMetadata() + { + return md; + } + + @Override + public Object getMod() + { + return null; + } + + @Override + public String getModId() + { + return md.modId; + } + + @Override + public String getName() + { + return md.name; + } + + @Override + public String getSortingRules() + { + return ""; + } + + @Override + public File getSource() + { + return null; + } + + @Override + public String getVersion() + { + return md.version; + } + + @Override + public boolean matches(Object mod) + { + return false; + } + + @Override + public void setEnabledState(boolean enabled) + { + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) + { + return false; + } + + @Override + public ArtifactVersion getProcessedVersion() + { + if (processedVersion == null) + { + processedVersion = new DefaultArtifactVersion(getModId(), getVersion()); + } + return processedVersion; + } + + @Override + public boolean isImmutable() + { + return false; + } + + @Override + public String getDisplayVersion() + { + return md.version; + } + @Override + public VersionRange acceptableMinecraftVersionRange() + { + return Loader.instance().getMinecraftModContainer().getStaticVersionRange(); + } + + @Override + public Certificate getSigningCertificate() + { + return null; + } + + @Override + public String toString() + { + return md != null ? getModId() : "Dummy Container ("+label+") @" + System.identityHashCode(this); + } + + @Override + public Map getCustomModProperties() + { + return EMPTY_PROPERTIES; + } + @Override + public Class getCustomResourcePackClass() + { + return null; + } + + @Override + public Map getSharedModDescriptor() + { + return null; + } + + @Override + public Disableable canBeDisabled() + { + return Disableable.NEVER; + } + + @Override + public String getGuiClassName() + { + return null; + } + + @Override + public List getOwnedPackages() + { + return ImmutableList.of(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/DuplicateModsFoundException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/DuplicateModsFoundException.java new file mode 100644 index 0000000..47320ff --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/DuplicateModsFoundException.java @@ -0,0 +1,40 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.util.Map.Entry; + +import cpw.mods.fml.common.EnhancedRuntimeException.WrappedPrintStream; + +import com.google.common.collect.SetMultimap; + +public class DuplicateModsFoundException extends LoaderException { + private static final long serialVersionUID = 1L; + public SetMultimap dupes; + + public DuplicateModsFoundException(SetMultimap dupes) { + this.dupes = dupes; + } + + @Override + protected void printStackTrace(WrappedPrintStream stream) + { + stream.println("Duplicate Mods:"); + for (Entry e : dupes.entries()) + { + stream.println(String.format("\t%s : %s", e.getKey().getModId(), e.getValue().getAbsolutePath())); + } + stream.println(""); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/EnhancedRuntimeException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/EnhancedRuntimeException.java new file mode 100644 index 0000000..986e74e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/EnhancedRuntimeException.java @@ -0,0 +1,89 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2016 Forge Dev LLC. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + */ +package cpw.mods.fml.common; + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * RuntimeException that gives subclasses the simple opportunity to write extra data when printing the stack trace. + * Mainly a helper class as printsStackTrace has multiple signatures. + */ +public abstract class EnhancedRuntimeException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public EnhancedRuntimeException() { super(); } + public EnhancedRuntimeException(String message) { super(message); } + public EnhancedRuntimeException(String message, Throwable cause) { super(message, cause); } + public EnhancedRuntimeException(Throwable cause) { super(cause); } + + @Override + public String getMessage() + { + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + if (stack.length > 2 && stack[2].getClassName().startsWith("org.apache.logging.log4j.")) + { + // This is a bit of a hack to force ourselves to be able to give a extended description when log4j prints this out. + // Sadly this text is displayed AFTER the initial exception line, and before the stack trace. But as the intention + // is to print this to the end user this is what we need to do. + final StringWriter buf = new StringWriter(); + + String msg = super.getMessage(); + if (msg != null) + buf.append(msg); + + buf.append('\n'); + this.printStackTrace(new WrappedPrintStream() + { + @Override + public void println(String line) + { + buf.append(line).append('\n'); + } + }); + return buf.toString(); + } + return super.getMessage(); + } + + @Override + public void printStackTrace(final PrintWriter s) + { + printStackTrace(new WrappedPrintStream() + { + @Override + public void println(String line) + { + s.println(line); + } + }); + super.printStackTrace(s); + } + public void printStackTrace(final PrintStream s) + { + printStackTrace(new WrappedPrintStream() + { + @Override + public void println(String line) + { + s.println(line); + } + }); + super.printStackTrace(s); + } + + protected abstract void printStackTrace(WrappedPrintStream stream); + + public static abstract class WrappedPrintStream + { + public abstract void println(String line); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLCommonHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLCommonHandler.java new file mode 100644 index 0000000..94c7104 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLCommonHandler.java @@ -0,0 +1,640 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.lang.ref.WeakReference; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetworkManager; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.WorldInfo; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; + +import com.google.common.base.Joiner; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; +import com.google.common.collect.Lists; +import com.google.common.collect.MapMaker; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.gameevent.InputEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.server.FMLServerHandler; + + +/** + * The main class for non-obfuscated hook handling code + * + * Anything that doesn't require obfuscated or client/server specific code should + * go in this handler + * + * It also contains a reference to the sided handler instance that is valid + * allowing for common code to access specific properties from the obfuscated world + * without a direct dependency + * + * @author cpw + * + */ +public class FMLCommonHandler +{ + /** + * The singleton + */ + private static final FMLCommonHandler INSTANCE = new FMLCommonHandler(); + /** + * The delegate for side specific data and functions + */ + private IFMLSidedHandler sidedDelegate; + + private Class forge; + private boolean noForge; + private List brandings; + private List brandingsNoMC; + private List crashCallables = Lists.newArrayList(Loader.instance().getCallableCrashInformation()); + private Set handlerSet = Sets.newSetFromMap(new MapMaker().weakKeys().makeMap()); + private WeakReference handlerToCheck; + private EventBus eventBus = new EventBus(); + private volatile CountDownLatch exitLatch = null; + /** + * The FML event bus. Subscribe here for FML related events + * + * @return the event bus + */ + public EventBus bus() + { + return eventBus; + } + + public void beginLoading(IFMLSidedHandler handler) + { + sidedDelegate = handler; + FMLLog.log("MinecraftForge", Level.INFO, "Attempting early MinecraftForge initialization"); + callForgeMethod("initialize"); + callForgeMethod("registerCrashCallable"); + FMLLog.log("MinecraftForge", Level.INFO, "Completed early MinecraftForge initialization"); + } + + /** + * @return the instance + */ + public static FMLCommonHandler instance() + { + return INSTANCE; + } + /** + * Find the container that associates with the supplied mod object + * @param mod + */ + public ModContainer findContainerFor(Object mod) + { + if (mod instanceof String) + { + return Loader.instance().getIndexedModList().get(mod); + } + else + { + return Loader.instance().getReversedModObjectList().get(mod); + } + } + /** + * Get the forge mod loader logging instance (goes to the forgemodloader log file) + * @return The log instance for the FML log file + */ + public Logger getFMLLogger() + { + return FMLLog.getLogger(); + } + + public Side getSide() + { + return sidedDelegate.getSide(); + } + + /** + * Return the effective side for the context in the game. This is dependent + * on thread analysis to try and determine whether the code is running in the + * server or not. Use at your own risk + */ + public Side getEffectiveSide() + { + Thread thr = Thread.currentThread(); + if ((thr.getName().equals("Server thread"))) + { + return Side.SERVER; + } + + return Side.CLIENT; + } + /** + * Raise an exception + */ + public void raiseException(Throwable exception, String message, boolean stopGame) + { + FMLLog.log(Level.ERROR, exception, "Something raised an exception. The message was '%s'. 'stopGame' is %b", message, stopGame); + if (stopGame) + { + getSidedDelegate().haltGame(message,exception); + } + } + + + private Class findMinecraftForge() + { + if (forge==null && !noForge) + { + try { + forge = Class.forName("net.minecraftforge.common.MinecraftForge"); + } catch (Exception ex) { + noForge = true; + } + } + return forge; + } + + private Object callForgeMethod(String method) + { + if (noForge) + return null; + try + { + return findMinecraftForge().getMethod(method).invoke(null); + } + catch (Exception e) + { + // No Forge installation + return null; + } + } + + public void computeBranding() + { + if (brandings == null) + { + Builder brd = ImmutableList.builder(); + brd.add(Loader.instance().getMCVersionString()); + brd.add(Loader.instance().getMCPVersionString()); + brd.add("FML v"+Loader.instance().getFMLVersionString()); + String forgeBranding = (String) callForgeMethod("getBrandingVersion"); + if (!Strings.isNullOrEmpty(forgeBranding)) + { + brd.add(forgeBranding); + } + if (sidedDelegate!=null) + { + brd.addAll(sidedDelegate.getAdditionalBrandingInformation()); + } + if (Loader.instance().getFMLBrandingProperties().containsKey("fmlbranding")) + { + brd.add(Loader.instance().getFMLBrandingProperties().get("fmlbranding")); + } + int tModCount = Loader.instance().getModList().size(); + int aModCount = Loader.instance().getActiveModList().size(); + brd.add(String.format("%d mod%s loaded, %d mod%s active", tModCount, tModCount!=1 ? "s" :"", aModCount, aModCount!=1 ? "s" :"" )); + brandings = brd.build(); + brandingsNoMC = brandings.subList(1, brandings.size()); + } + } + public List getBrandings(boolean includeMC) + { + if (brandings == null) + { + computeBranding(); + } + return includeMC ? ImmutableList.copyOf(brandings) : ImmutableList.copyOf(brandingsNoMC); + } + + public IFMLSidedHandler getSidedDelegate() + { + return sidedDelegate; + } + + public void onPostServerTick() + { + bus().post(new TickEvent.ServerTickEvent(Phase.END)); + } + + /** + * Every tick just after world and other ticks occur + */ + public void onPostWorldTick(World world) + { + bus().post(new TickEvent.WorldTickEvent(Side.SERVER, Phase.END, world)); + } + + public void onPreServerTick() + { + bus().post(new TickEvent.ServerTickEvent(Phase.START)); + } + + /** + * Every tick just before world and other ticks occur + */ + public void onPreWorldTick(World world) + { + bus().post(new TickEvent.WorldTickEvent(Side.SERVER, Phase.START, world)); + } + + public boolean handleServerAboutToStart(MinecraftServer server) + { + return Loader.instance().serverAboutToStart(server); + } + + public boolean handleServerStarting(MinecraftServer server) + { + return Loader.instance().serverStarting(server); + } + + public void handleServerStarted() + { + Loader.instance().serverStarted(); + sidedDelegate.allowLogins(); + } + + public void handleServerStopping() + { + Loader.instance().serverStopping(); + } + + public File getSavesDirectory() { + return sidedDelegate.getSavesDirectory(); + } + + public MinecraftServer getMinecraftServerInstance() + { + return sidedDelegate.getServer(); + } + + public void showGuiScreen(Object clientGuiElement) + { + sidedDelegate.showGuiScreen(clientGuiElement); + } + + public void queryUser(StartupQuery query) throws InterruptedException + { + sidedDelegate.queryUser(query); + } + + public void onServerStart(MinecraftServer dedicatedServer) + { + FMLServerHandler.instance(); + sidedDelegate.beginServerLoading(dedicatedServer); + } + + public void onServerStarted() + { + sidedDelegate.finishServerLoading(); + } + + + public void onPreClientTick() + { + bus().post(new TickEvent.ClientTickEvent(Phase.START)); + } + + public void onPostClientTick() + { + bus().post(new TickEvent.ClientTickEvent(Phase.END)); + } + + public void onRenderTickStart(float timer) + { + bus().post(new TickEvent.RenderTickEvent(Phase.START, timer)); + } + + public void onRenderTickEnd(float timer) + { + bus().post(new TickEvent.RenderTickEvent(Phase.END, timer)); + } + + public void onPlayerPreTick(EntityPlayer player) + { + bus().post(new TickEvent.PlayerTickEvent(Phase.START, player)); + } + + public void onPlayerPostTick(EntityPlayer player) + { + bus().post(new TickEvent.PlayerTickEvent(Phase.END, player)); + } + + public void registerCrashCallable(ICrashCallable callable) + { + crashCallables.add(callable); + } + + public void enhanceCrashReport(CrashReport crashReport, CrashReportCategory category) + { + for (ICrashCallable call: crashCallables) + { + category.addCrashSectionCallable(call.getLabel(), call); + } + } + + public void handleWorldDataSave(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound) + { + for (ModContainer mc : Loader.instance().getModList()) + { + if (mc instanceof InjectedModContainer) + { + WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer(); + if (wac != null) + { + NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo); + tagCompound.setTag(mc.getModId(), dataForWriting); + } + } + } + } + + public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound) + { + if (getEffectiveSide()!=Side.SERVER) + { + return; + } + if (handlerSet.contains(handler)) + { + return; + } + handlerSet.add(handler); + handlerToCheck = new WeakReference(handler); // for confirmBackupLevelDatUse + Map additionalProperties = Maps.newHashMap(); + worldInfo.setAdditionalProperties(additionalProperties); + for (ModContainer mc : Loader.instance().getModList()) + { + if (mc instanceof InjectedModContainer) + { + WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer(); + if (wac != null) + { + wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId())); + } + } + } + } + + public void confirmBackupLevelDatUse(SaveHandler handler) + { + if (handlerToCheck == null || handlerToCheck.get() != handler) { + // only run if the save has been initially loaded + handlerToCheck = null; + return; + } + + String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" + + "This may happen due to a bug or corruption, continuing can damage\n" + + "your world beyond repair or lose data / progress.\n\n" + + "It's recommended to create a world backup before continuing."; + + boolean confirmed = StartupQuery.confirm(text); + if (!confirmed) StartupQuery.abort(); + } + + public boolean shouldServerBeKilledQuietly() + { + if (sidedDelegate == null) + { + return false; + } + return sidedDelegate.shouldServerShouldBeKilledQuietly(); + } + + /** + * Make handleExit() wait for handleServerStopped(). + * + * For internal use only! + */ + public void expectServerStopped() + { + exitLatch = new CountDownLatch(1); + } + + /** + * Delayed System.exit() until the server is actually stopped/done saving. + * + * For internal use only! + * + * @param retVal Exit code for System.exit() + */ + public void handleExit(int retVal) + { + CountDownLatch latch = exitLatch; + + if (latch != null) + { + try + { + FMLLog.info("Waiting for the server to terminate/save."); + if (!latch.await(10, TimeUnit.SECONDS)) + { + FMLLog.warning("The server didn't stop within 10 seconds, exiting anyway."); + } + else + { + FMLLog.info("Server terminated."); + } + } + catch (InterruptedException e) + { + FMLLog.warning("Interrupted wait, exiting."); + } + } + + System.exit(retVal); + } + + public void handleServerStopped() + { + sidedDelegate.serverStopped(); + MinecraftServer server = getMinecraftServerInstance(); + Loader.instance().serverStopped(); + // FORCE the internal server to stop: hello optifine workaround! + if (server!=null) ObfuscationReflectionHelper.setPrivateValue(MinecraftServer.class, server, false, "field_71316"+"_v", "u", "serverStopped"); + + // allow any pending exit to continue, clear exitLatch + CountDownLatch latch = exitLatch; + + if (latch != null) + { + latch.countDown(); + exitLatch = null; + } + } + + public String getModName() + { + List modNames = Lists.newArrayListWithExpectedSize(3); + modNames.add("fml"); + if (!noForge) + { + modNames.add("forge"); + } + + if (Loader.instance().getFMLBrandingProperties().containsKey("snooperbranding")) + { + modNames.add(Loader.instance().getFMLBrandingProperties().get("snooperbranding")); + } + return Joiner.on(',').join(modNames); + } + + public void addModToResourcePack(ModContainer container) + { + sidedDelegate.addModAsResource(container); + } + + public String getCurrentLanguage() + { + + return sidedDelegate.getCurrentLanguage(); + } + + public void bootstrap() + { + } + + public NetworkManager getClientToServerNetworkManager() + { + return sidedDelegate.getClientToServerNetworkManager(); + } + + public void fireMouseInput() + { + bus().post(new InputEvent.MouseInputEvent()); + } + + public void fireKeyInput() + { + bus().post(new InputEvent.KeyInputEvent()); + } + + public void firePlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim) + { + bus().post(new PlayerEvent.PlayerChangedDimensionEvent(player, fromDim, toDim)); + } + + public void firePlayerLoggedIn(EntityPlayer player) + { + bus().post(new PlayerEvent.PlayerLoggedInEvent(player)); + } + + public void firePlayerLoggedOut(EntityPlayer player) + { + bus().post(new PlayerEvent.PlayerLoggedOutEvent(player)); + } + + public void firePlayerRespawnEvent(EntityPlayer player) + { + bus().post(new PlayerEvent.PlayerRespawnEvent(player)); + } + + public void firePlayerItemPickupEvent(EntityPlayer player, EntityItem item) + { + bus().post(new PlayerEvent.ItemPickupEvent(player, item)); + } + + public void firePlayerCraftingEvent(EntityPlayer player, ItemStack crafted, IInventory craftMatrix) + { + bus().post(new PlayerEvent.ItemCraftedEvent(player, crafted, craftMatrix)); + } + + public void firePlayerSmeltedEvent(EntityPlayer player, ItemStack smelted) + { + bus().post(new PlayerEvent.ItemSmeltedEvent(player, smelted)); + } + + public INetHandler getClientPlayHandler() + { + return sidedDelegate.getClientPlayHandler(); + } + + public void waitForPlayClient() + { + sidedDelegate.waitForPlayClient(); + } + + public void fireNetRegistrationEvent(NetworkManager manager, Set channelSet, String channel, Side side) + { + sidedDelegate.fireNetRegistrationEvent(bus(), manager, channelSet, channel, side); + } + + public boolean shouldAllowPlayerLogins() + { + return sidedDelegate.shouldAllowPlayerLogins(); + } + + public void processWindowMessages() + { + if (sidedDelegate == null) return; + sidedDelegate.processWindowMessages(); + } + + /** + * Used to exit from java, with system exit preventions in place. Will be tidy about it and just log a message, + * unless debugging is enabled + * + * @param exitCode The exit code + * @param hardExit Perform a halt instead of an exit (only use when the world is unsavable) - read the warnings at {@link Runtime#halt(int)} + */ + public void exitJava(int exitCode, boolean hardExit) + { + FMLLog.log(Level.INFO, "Java has been asked to exit (code %d) by %s.", exitCode, Thread.currentThread().getStackTrace()[1]); + if (hardExit) + { + FMLLog.log(Level.INFO, "This is an abortive exit and could cause world corruption or other things"); + } + if (Boolean.parseBoolean(System.getProperty("fml.debugExit", "false"))) + { + FMLLog.log(Level.INFO, new Throwable(), "Exit trace"); + } + else + { + FMLLog.log(Level.INFO, "If this was an unexpected exit, use -Dfml.debugExit=true as a JVM argument to find out where it was called"); + } + if (hardExit) + { + Runtime.getRuntime().halt(exitCode); + } + else + { + Runtime.getRuntime().exit(exitCode); + } + } + + public String stripSpecialChars(String message) + { + return sidedDelegate != null ? sidedDelegate.stripSpecialChars(message) : message; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainer.java new file mode 100644 index 0000000..bf8af43 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainer.java @@ -0,0 +1,337 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.security.cert.Certificate; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.WorldInfo; + +import org.apache.logging.log4j.Level; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; + +import cpw.mods.fml.client.FMLFileResourcePack; +import cpw.mods.fml.client.FMLFolderResourcePack; +import cpw.mods.fml.common.asm.FMLSanityChecker; +import cpw.mods.fml.common.event.FMLConstructionEvent; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.relauncher.Side; + +/** + * @author cpw + * + */ +public class FMLContainer extends DummyModContainer implements WorldAccessContainer +{ + public FMLContainer() + { + super(new ModMetadata()); + ModMetadata meta = getMetadata(); + meta.modId="FML"; + meta.name="Forge Mod Loader"; + meta.version=Loader.instance().getFMLVersionString(); + meta.credits="Made possible with help from many people"; + meta.authorList=Arrays.asList("cpw", "LexManos", "Player"); + meta.description="The Forge Mod Loader provides the ability for systems to load mods " + + "from the file system. It also provides key capabilities for mods to be able " + + "to cooperate and provide a good modding environment. "; + meta.url="https://github.com/MinecraftForge/FML/wiki"; + meta.updateUrl="https://github.com/MinecraftForge/FML/wiki"; + meta.screenshots=new String[0]; + meta.logoFile=""; + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) + { + bus.register(this); + return true; + } + + @Subscribe + public void modConstruction(FMLConstructionEvent evt) + { + NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData()); + FMLNetworkHandler.registerChannel(this, evt.getSide()); + } + + @NetworkCheckHandler + public boolean checkModLists(Map modList, Side side) + { + return Loader.instance().checkRemoteModList(modList,side); + } + @Override + public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info) + { + NBTTagCompound fmlData = new NBTTagCompound(); + NBTTagList list = new NBTTagList(); + for (ModContainer mc : Loader.instance().getActiveModList()) + { + NBTTagCompound mod = new NBTTagCompound(); + mod.setString("ModId", mc.getModId()); + mod.setString("ModVersion", mc.getVersion()); + list.appendTag(mod); + } + fmlData.setTag("ModList", list); + // name <-> id mappings + NBTTagList dataList = new NBTTagList(); + FMLLog.fine("Gathering id map for writing to world save %s", info.getWorldName()); + GameData.GameDataSnapshot dataSnapshot = GameData.buildItemDataList(); + for (Entry item : dataSnapshot.idMap.entrySet()) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("K",item.getKey()); + tag.setInteger("V",item.getValue()); + dataList.appendTag(tag); + } + fmlData.setTag("ItemData", dataList); + // blocked ids + fmlData.setIntArray("BlockedItemIds", GameData.getBlockedIds()); + // block aliases + NBTTagList blockAliasList = new NBTTagList(); + for (Entry entry : GameData.getBlockRegistry().getAliases().entrySet()) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("K", entry.getKey()); + tag.setString("V", entry.getValue()); + blockAliasList.appendTag(tag); + } + fmlData.setTag("BlockAliases", blockAliasList); + NBTTagList blockSubstitutionsList = new NBTTagList(); + for (String entry : dataSnapshot.blockSubstitutions) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("K", entry); + blockSubstitutionsList.appendTag(tag); + } + fmlData.setTag("BlockSubstitutions", blockSubstitutionsList); + // item aliases + NBTTagList itemAliasList = new NBTTagList(); + for (Entry entry : GameData.getItemRegistry().getAliases().entrySet()) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("K", entry.getKey()); + tag.setString("V", entry.getValue()); + itemAliasList.appendTag(tag); + } + fmlData.setTag("ItemAliases", itemAliasList); + + NBTTagList itemSubstitutionsList = new NBTTagList(); + for (String entry : dataSnapshot.itemSubstitutions) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("K", entry); + itemSubstitutionsList.appendTag(tag); + } + fmlData.setTag("ItemSubstitutions", itemSubstitutionsList); + return fmlData; + } + + @Override + public void readData(SaveHandler handler, WorldInfo info, Map propertyMap, NBTTagCompound tag) + { + if (tag.hasKey("ModList")) + { + NBTTagList modList = tag.getTagList("ModList", (byte)10); + for (int i = 0; i < modList.tagCount(); i++) + { + NBTTagCompound mod = modList.getCompoundTagAt(i); + String modId = mod.getString("ModId"); + String modVersion = mod.getString("ModVersion"); + ModContainer container = Loader.instance().getIndexedModList().get(modId); + if (container == null) + { + FMLLog.log("fml.ModTracker", Level.ERROR, "This world was saved with mod %s which appears to be missing, things may not work well", modId); + continue; + } + if (!modVersion.equals(container.getVersion())) + { + FMLLog.log("fml.ModTracker", Level.INFO, "This world was saved with mod %s version %s and it is now at version %s, things may not work well", modId, modVersion, container.getVersion()); + } + } + } + + List failedElements = null; + + if (tag.hasKey("ModItemData")) + { + FMLLog.info("Attempting to convert old world data to new system. This may be trouble!"); + NBTTagList modList = tag.getTagList("ModItemData", (byte)10); + Map dataList = Maps.newLinkedHashMap(); + for (int i = 0; i < modList.tagCount(); i++) + { + NBTTagCompound itemTag = modList.getCompoundTagAt(i); + String modId = itemTag.getString("ModId"); + String itemType = itemTag.getString("ItemType"); + int itemId = itemTag.getInteger("ItemId"); + int ordinal = itemTag.getInteger("ordinal"); + String forcedModId = itemTag.hasKey("ForcedModId") ? itemTag.getString("ForcedModId") : null; + String forcedName = itemTag.hasKey("ForcedName") ? itemTag.getString("ForcedName") : null; + if (forcedName == null) + { + FMLLog.warning("Found unlabelled item in world save, this may cause problems. The item type %s:%d will not be present", itemType, ordinal); + } + else + { + // all entries are Items, blocks were only saved through their ItemBlock + String itemLabel = String.format("%c%s:%s", '\u0002', forcedModId != null ? forcedModId : modId, forcedName); + dataList.put(itemLabel, itemId); + } + } + failedElements = GameData.injectWorldIDMap(dataList, ImmutableSet.of(), ImmutableSet.of(), true, true); + + } + else if (tag.hasKey("ItemData")) + { + // name <-> id mappings + NBTTagList list = tag.getTagList("ItemData", 10); + Map dataList = Maps.newLinkedHashMap(); + for (int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound dataTag = list.getCompoundTagAt(i); + dataList.put(dataTag.getString("K"), dataTag.getInteger("V")); + } + + Set blockedIds = new HashSet(); + + if (!tag.hasKey("BlockedItemIds")) // no blocked id info -> old 1.7 save + { + // old early 1.7 save potentially affected by the registry mapping bug + // fix the ids the best we can... + GameData.fixBrokenIds(dataList, blockedIds); + } + + // blocked ids + for (int id : tag.getIntArray("BlockedItemIds")) + { + blockedIds.add(id); + } + // block aliases + Map blockAliases = new HashMap(); + list = tag.getTagList("BlockAliases", 10); + for (int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound dataTag = list.getCompoundTagAt(i); + blockAliases.put(dataTag.getString("K"), dataTag.getString("V")); + } + Set blockSubstitutions = Sets.newHashSet(); + if (tag.hasKey("BlockSubstitutions", 9)) + { + list = tag.getTagList("BlockSubstitutions", 10); + for (int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound dataTag = list.getCompoundTagAt(i); + blockSubstitutions.add(dataTag.getString("K")); + } + } + // item aliases + Map itemAliases = new HashMap(); + list = tag.getTagList("ItemAliases", 10); + for (int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound dataTag = list.getCompoundTagAt(i); + itemAliases.put(dataTag.getString("K"), dataTag.getString("V")); + } + + Set itemSubstitutions = Sets.newHashSet(); + if (tag.hasKey("ItemSubstitutions", 9)) + { + list = tag.getTagList("ItemSubstitutions", 10); + for (int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound dataTag = list.getCompoundTagAt(i); + itemSubstitutions.add(dataTag.getString("K")); + } + } + try + { + failedElements = GameData.injectWorldIDMap(dataList, blockedIds, blockAliases, itemAliases, blockSubstitutions, itemSubstitutions, true, true); + } catch (IllegalStateException ex) + { + // In the case of IllegalArgumentException the state map is utterly toast. We should immediately abort + String msg = "The world state is utterly corrupted and this save is NOT loadable\n\n" + + "There is a high probability that a mod has broken the\n" + + "ID map and there is\n" + + "NOTHING FML or Forge can do to recover this save.\n\n" + + "If you changed your mods, try reverting the change"; + FMLLog.log(Level.FATAL, ex, msg); + StartupQuery.notify(msg); + StartupQuery.abort(); + } + } + + if (failedElements != null && !failedElements.isEmpty()) + { + String text = "Forge Mod Loader could not load this save.\n\n" + + "There are "+failedElements.size()+" unassigned blocks and items in this save.\n" + + "You will not be able to load until they are present again.\n\n" + + "Missing Blocks/Items:\n"; + + for (String s : failedElements) text += s + "\n"; + + StartupQuery.notify(text); + StartupQuery.abort(); + } + } + + + @Override + public Certificate getSigningCertificate() + { + Certificate[] certificates = getClass().getProtectionDomain().getCodeSource().getCertificates(); + return certificates != null ? certificates[0] : null; + } + + @Override + public File getSource() + { + return FMLSanityChecker.fmlLocation; + } + + @Override + public Class getCustomResourcePackClass() + { + return getSource().isDirectory() ? FMLFolderResourcePack.class : FMLFileResourcePack.class; + } + + @Override + public String getGuiClassName() + { + return "cpw.mods.fml.client.FMLConfigGuiFactory"; + } + + @Override + public Object getMod() + { + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainerHolder.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainerHolder.java new file mode 100644 index 0000000..dd8fe41 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLContainerHolder.java @@ -0,0 +1,6 @@ +package cpw.mods.fml.common; + +public interface FMLContainerHolder +{ + ModContainer getFMLContainer(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLLog.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLLog.java new file mode 100644 index 0000000..288df3c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLLog.java @@ -0,0 +1,84 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.Logger; + +@SuppressWarnings("static-access") +public class FMLLog +{ + private static cpw.mods.fml.relauncher.FMLRelaunchLog coreLog = cpw.mods.fml.relauncher.FMLRelaunchLog.log; + + public static void log(String targetLog, Level level, String format, Object... data) + { + coreLog.log(targetLog, level, format, data); + } + + public static void log(Level level, String format, Object... data) + { + coreLog.log(level, format, data); + } + + public static void log(String targetLog, Level level, Throwable ex, String format, Object... data) + { + coreLog.log(targetLog, level, ex, format, data); + } + + public static void log(Level level, Throwable ex, String format, Object... data) + { + coreLog.log(level, ex, format, data); + } + + public static void severe(String format, Object... data) + { + log(Level.ERROR, format, data); + } + + public static void bigWarning(String format, Object... data) + { + StackTraceElement[] trace = Thread.currentThread().getStackTrace(); + log(Level.WARN, "****************************************"); + log(Level.WARN, "* "+format, data); + for (int i = 2; i < 8 && i < trace.length; i++) + { + log(Level.WARN, "* at %s%s", trace[i].toString(), i == 7 ? "..." : ""); + } + log(Level.WARN, "****************************************"); + } + + public static void warning(String format, Object... data) + { + log(Level.WARN, format, data); + } + + public static void info(String format, Object... data) + { + log(Level.INFO, format, data); + } + + public static void fine(String format, Object... data) + { + log(Level.DEBUG, format, data); + } + + public static void finer(String format, Object... data) + { + log(Level.TRACE, format, data); + } + + public static Logger getLogger() + { + return coreLog.getLogger(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLModContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLModContainer.java new file mode 100644 index 0000000..cf1fb72 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/FMLModContainer.java @@ -0,0 +1,629 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.common; + +import java.io.File; +import java.io.FileInputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.security.cert.Certificate; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import org.apache.logging.log4j.Level; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import com.google.common.base.Function; +import com.google.common.base.Strings; +import com.google.common.base.Throwables; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList.Builder; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Sets; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; + +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.Metadata; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.common.discovery.ModCandidate; +import cpw.mods.fml.common.event.FMLConstructionEvent; +import cpw.mods.fml.common.event.FMLEvent; +import cpw.mods.fml.common.event.FMLFingerprintViolationEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import cpw.mods.fml.common.versioning.VersionParser; +import cpw.mods.fml.common.versioning.VersionRange; + +public class FMLModContainer implements ModContainer +{ + private Object modInstance; + private File source; + private ModMetadata modMetadata; + private String className; + private Map descriptor; + private boolean enabled = true; + private String internalVersion; + private boolean overridesMetadata; + private EventBus eventBus; + private LoadController controller; + private DefaultArtifactVersion processedVersion; + + private String annotationDependencies; + private VersionRange minecraftAccepted; + private boolean fingerprintNotPresent; + private Set sourceFingerprints; + private Certificate certificate; + private String modLanguage; + private ILanguageAdapter languageAdapter; + private Disableable disableability; + private ListMultimap,Method> eventMethods; + private Map customModProperties; + private ModCandidate candidate; + + public FMLModContainer(String className, ModCandidate container, Map modDescriptor) + { + this.className = className; + this.source = container.getModContainer(); + this.candidate = container; + this.descriptor = modDescriptor; + this.eventMethods = ArrayListMultimap.create(); + + this.modLanguage = (String) modDescriptor.get("modLanguage"); + String languageAdapterType = (String)modDescriptor.get("modLanguageAdapter"); + if (Strings.isNullOrEmpty(languageAdapterType)) + { + this.languageAdapter = "scala".equals(modLanguage) ? new ILanguageAdapter.ScalaAdapter() : new ILanguageAdapter.JavaAdapter(); + } + else + { + try + { + this.languageAdapter = (ILanguageAdapter)Class.forName(languageAdapterType, true, Loader.instance().getModClassLoader()).newInstance(); + FMLLog.finer("Using custom language adapter %s (type %s) for %s (modid %s)", this.languageAdapter, languageAdapterType, this.className, getModId()); + } + catch (Exception ex) + { + FMLLog.log(Level.ERROR, ex, "Error constructing custom mod language adapter %s (referenced by %s) (modid: %s)", languageAdapterType, this.className, getModId()); + throw new LoaderException(ex); + } + } + } + + private ILanguageAdapter getLanguageAdapter() + { + return languageAdapter; + } + @Override + public String getModId() + { + return (String) descriptor.get("modid"); + } + + @Override + public String getName() + { + return modMetadata.name; + } + + @Override + public String getVersion() + { + return internalVersion; + } + + @Override + public File getSource() + { + return source; + } + + @Override + public ModMetadata getMetadata() + { + return modMetadata; + } + + @Override + public void bindMetadata(MetadataCollection mc) + { + modMetadata = mc.getMetadataForId(getModId(), descriptor); + + if (descriptor.containsKey("useMetadata")) + { + overridesMetadata = !((Boolean)descriptor.get("useMetadata")).booleanValue(); + } + + if (overridesMetadata || !modMetadata.useDependencyInformation) + { + Set requirements = Sets.newHashSet(); + List dependencies = Lists.newArrayList(); + List dependants = Lists.newArrayList(); + annotationDependencies = (String) descriptor.get("dependencies"); + Loader.instance().computeDependencies(annotationDependencies, requirements, dependencies, dependants); + dependants.addAll(Loader.instance().getInjectedBefore(getModId())); + dependencies.addAll(Loader.instance().getInjectedAfter(getModId())); + modMetadata.requiredMods = requirements; + modMetadata.dependencies = dependencies; + modMetadata.dependants = dependants; + FMLLog.log(getModId(), Level.TRACE, "Parsed dependency info : %s %s %s", requirements, dependencies, dependants); + } + else + { + FMLLog.log(getModId(), Level.TRACE, "Using mcmod dependency info : %s %s %s", modMetadata.requiredMods, modMetadata.dependencies, modMetadata.dependants); + } + if (Strings.isNullOrEmpty(modMetadata.name)) + { + FMLLog.log(getModId(), Level.INFO,"Mod %s is missing the required element 'name'. Substituting %s", getModId(), getModId()); + modMetadata.name = getModId(); + } + internalVersion = (String) descriptor.get("version"); + if (Strings.isNullOrEmpty(internalVersion)) + { + Properties versionProps = searchForVersionProperties(); + if (versionProps != null) + { + internalVersion = versionProps.getProperty(getModId()+".version"); + FMLLog.log(getModId(), Level.DEBUG, "Found version %s for mod %s in version.properties, using", internalVersion, getModId()); + } + + } + if (Strings.isNullOrEmpty(internalVersion) && !Strings.isNullOrEmpty(modMetadata.version)) + { + FMLLog.log(getModId(), Level.WARN, "Mod %s is missing the required element 'version' and a version.properties file could not be found. Falling back to metadata version %s", getModId(), modMetadata.version); + internalVersion = modMetadata.version; + } + if (Strings.isNullOrEmpty(internalVersion)) + { + FMLLog.log(getModId(), Level.WARN, "Mod %s is missing the required element 'version' and no fallback can be found. Substituting '1.0'.", getModId()); + modMetadata.version = internalVersion = "1.0"; + } + + String mcVersionString = (String) descriptor.get("acceptedMinecraftVersions"); + if (!Strings.isNullOrEmpty(mcVersionString)) + { + minecraftAccepted = VersionParser.parseRange(mcVersionString); + } + else + { + minecraftAccepted = Loader.instance().getMinecraftModContainer().getStaticVersionRange(); + } + } + + public Properties searchForVersionProperties() + { + try + { + FMLLog.log(getModId(), Level.DEBUG,"Attempting to load the file version.properties from %s to locate a version number for %s", getSource().getName(), getModId()); + Properties version = null; + if (getSource().isFile()) + { + ZipFile source = new ZipFile(getSource()); + ZipEntry versionFile = source.getEntry("version.properties"); + if (versionFile!=null) + { + version = new Properties(); + version.load(source.getInputStream(versionFile)); + } + source.close(); + } + else if (getSource().isDirectory()) + { + File propsFile = new File(getSource(),"version.properties"); + if (propsFile.exists() && propsFile.isFile()) + { + version = new Properties(); + FileInputStream fis = new FileInputStream(propsFile); + version.load(fis); + fis.close(); + } + } + return version; + } + catch (Exception e) + { + Throwables.propagateIfPossible(e); + FMLLog.log(getModId(), Level.TRACE, "Failed to find a usable version.properties file"); + return null; + } + } + + @Override + public void setEnabledState(boolean enabled) + { + this.enabled = enabled; + } + + @Override + public Set getRequirements() + { + return modMetadata.requiredMods; + } + + @Override + public List getDependencies() + { + return modMetadata.dependencies; + } + + @Override + public List getDependants() + { + return modMetadata.dependants; + } + + @Override + public String getSortingRules() + { + return ((overridesMetadata || !modMetadata.useDependencyInformation) ? Strings.nullToEmpty(annotationDependencies) : modMetadata.printableSortingRules()); + } + + @Override + public boolean matches(Object mod) + { + return mod == modInstance; + } + + @Override + public Object getMod() + { + return modInstance; + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) + { + if (this.enabled) + { + FMLLog.log(getModId(), Level.DEBUG, "Enabling mod %s", getModId()); + this.eventBus = bus; + this.controller = controller; + eventBus.register(this); + return true; + } + else + { + return false; + } + } + + @SuppressWarnings("unchecked") + private Method gatherAnnotations(Class clazz) throws Exception + { + Method factoryMethod = null; + for (Method m : clazz.getDeclaredMethods()) + { + for (Annotation a : m.getAnnotations()) + { + if (a.annotationType().equals(Mod.EventHandler.class)) + { + if (m.getParameterTypes().length == 1 && FMLEvent.class.isAssignableFrom(m.getParameterTypes()[0])) + { + m.setAccessible(true); + eventMethods.put((Class) m.getParameterTypes()[0],m); + } + else + { + FMLLog.log(getModId(), Level.ERROR,"The mod %s appears to have an invalid event annotation %s. This annotation can only apply to methods with recognized event arguments - it will not be called", getModId(), a.annotationType().getSimpleName()); + } + } + else if (a.annotationType().equals(Mod.InstanceFactory.class)) + { + if (Modifier.isStatic(m.getModifiers()) && m.getParameterTypes().length == 0 && factoryMethod == null) + { + m.setAccessible(true); + factoryMethod = m; + } + else if (!(Modifier.isStatic(m.getModifiers()) && m.getParameterTypes().length == 0)) + { + FMLLog.log(getModId(), Level.ERROR, "The InstanceFactory annotation can only apply to a static method, taking zero arguments - it will be ignored on %s(%s)", m.getName(), Arrays.asList(m.getParameterTypes())); + } + else if (factoryMethod != null) + { + FMLLog.log(getModId(), Level.ERROR, "The InstanceFactory annotation can only be used once, the application to %s(%s) will be ignored", m.getName(), Arrays.asList(m.getParameterTypes())); + } + } + } + } + return factoryMethod; + } + + private void processFieldAnnotations(ASMDataTable asmDataTable) throws Exception + { + SetMultimap annotations = asmDataTable.getAnnotationsFor(this); + + parseSimpleFieldAnnotation(annotations, Instance.class.getName(), new Function() + { + @Override + public Object apply(ModContainer mc) + { + return mc.getMod(); + } + }); + parseSimpleFieldAnnotation(annotations, Metadata.class.getName(), new Function() + { + @Override + public Object apply(ModContainer mc) + { + return mc.getMetadata(); + } + }); + } + + private void parseSimpleFieldAnnotation(SetMultimap annotations, String annotationClassName, Function retreiver) throws IllegalAccessException + { + String[] annName = annotationClassName.split("\\."); + String annotationName = annName[annName.length - 1]; + for (ASMData targets : annotations.get(annotationClassName)) + { + String targetMod = (String) targets.getAnnotationInfo().get("value"); + Field f = null; + Object injectedMod = null; + ModContainer mc = this; + boolean isStatic = false; + Class clz = modInstance.getClass(); + if (!Strings.isNullOrEmpty(targetMod)) + { + if (Loader.isModLoaded(targetMod)) + { + mc = Loader.instance().getIndexedModList().get(targetMod); + } + else + { + mc = null; + } + } + if (mc != null) + { + try + { + clz = Class.forName(targets.getClassName(), true, Loader.instance().getModClassLoader()); + f = clz.getDeclaredField(targets.getObjectName()); + f.setAccessible(true); + isStatic = Modifier.isStatic(f.getModifiers()); + injectedMod = retreiver.apply(mc); + } + catch (Exception e) + { + Throwables.propagateIfPossible(e); + FMLLog.log(getModId(), Level.WARN, e, "Attempting to load @%s in class %s for %s and failing", annotationName, targets.getClassName(), mc.getModId()); + } + } + if (f != null) + { + Object target = null; + if (!isStatic) + { + target = modInstance; + if (!modInstance.getClass().equals(clz)) + { + FMLLog.log(getModId(), Level.WARN, "Unable to inject @%s in non-static field %s.%s for %s as it is NOT the primary mod instance", annotationName, targets.getClassName(), targets.getObjectName(), mc.getModId()); + continue; + } + } + f.set(target, injectedMod); + } + } + } + + @Subscribe + public void constructMod(FMLConstructionEvent event) + { + try + { + ModClassLoader modClassLoader = event.getModClassLoader(); + modClassLoader.addFile(source); + modClassLoader.clearNegativeCacheFor(candidate.getClassList()); + Class clazz = Class.forName(className, true, modClassLoader); + + Certificate[] certificates = clazz.getProtectionDomain().getCodeSource().getCertificates(); + int len = 0; + if (certificates != null) + { + len = certificates.length; + } + Builder certBuilder = ImmutableList.builder(); + for (int i = 0; i < len; i++) + { + certBuilder.add(CertificateHelper.getFingerprint(certificates[i])); + } + + ImmutableList certList = certBuilder.build(); + sourceFingerprints = ImmutableSet.copyOf(certList); + + String expectedFingerprint = (String) descriptor.get("certificateFingerprint"); + + fingerprintNotPresent = true; + + if (expectedFingerprint != null && !expectedFingerprint.isEmpty()) + { + if (!sourceFingerprints.contains(expectedFingerprint)) + { + Level warnLevel = Level.ERROR; + if (source.isDirectory()) + { + warnLevel = Level.TRACE; + } + FMLLog.log(getModId(), warnLevel, "The mod %s is expecting signature %s for source %s, however there is no signature matching that description", getModId(), expectedFingerprint, source.getName()); + } + else + { + certificate = certificates[certList.indexOf(expectedFingerprint)]; + fingerprintNotPresent = false; + } + } + + @SuppressWarnings("unchecked") + List> props = (List>) descriptor.get("customProperties"); + if (props != null) + { + com.google.common.collect.ImmutableMap.Builder builder = ImmutableMap.builder(); + for (Map p : props) + { + builder.put((String)p.get("k"),(String)p.get("v")); + } + customModProperties = builder.build(); + } + else + { + customModProperties = EMPTY_PROPERTIES; + } + + Boolean hasDisableableFlag = (Boolean) descriptor.get("canBeDeactivated"); + boolean hasReverseDepends = !event.getReverseDependencies().get(getModId()).isEmpty(); + if (hasDisableableFlag != null && hasDisableableFlag) + { + disableability = hasReverseDepends ? Disableable.DEPENDENCIES : Disableable.YES; + } + else + { + disableability = hasReverseDepends ? Disableable.DEPENDENCIES : Disableable.RESTART; + } + Method factoryMethod = gatherAnnotations(clazz); + modInstance = getLanguageAdapter().getNewInstance(this,clazz, modClassLoader, factoryMethod); + NetworkRegistry.INSTANCE.register(this, clazz, (String)(descriptor.containsKey("acceptableRemoteVersions") ? descriptor.get("acceptableRemoteVersions") : null), event.getASMHarvestedData()); + if (fingerprintNotPresent) + { + eventBus.post(new FMLFingerprintViolationEvent(source.isDirectory(), source, ImmutableSet.copyOf(this.sourceFingerprints), expectedFingerprint)); + } + ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), getLanguageAdapter()); + processFieldAnnotations(event.getASMHarvestedData()); + } + catch (Throwable e) + { + controller.errorOccurred(this, e); + } + } + + @Subscribe + public void handleModStateEvent(FMLEvent event) + { + if (!eventMethods.containsKey(event.getClass())) + { + return; + } + try + { + for (Method m : eventMethods.get(event.getClass())) + { + m.invoke(modInstance, event); + } + } + catch (Throwable t) + { + controller.errorOccurred(this, t); + } + } + + @Override + public ArtifactVersion getProcessedVersion() + { + if (processedVersion == null) + { + processedVersion = new DefaultArtifactVersion(getModId(), getVersion()); + } + return processedVersion; + } + @Override + public boolean isImmutable() + { + return false; + } + + @Override + public String getDisplayVersion() + { + return modMetadata.version; + } + + @Override + public VersionRange acceptableMinecraftVersionRange() + { + return minecraftAccepted; + } + + @Override + public Certificate getSigningCertificate() + { + return certificate; + } + + @Override + public String toString() + { + return "FMLMod:"+getModId()+"{"+getVersion()+"}"; + } + + @Override + public Map getCustomModProperties() + { + return customModProperties; + } + + @Override + public Class getCustomResourcePackClass() + { + try + { + return getSource().isDirectory() ? Class.forName("cpw.mods.fml.client.FMLFolderResourcePack", true, getClass().getClassLoader()) : Class.forName("cpw.mods.fml.client.FMLFileResourcePack",true, getClass().getClassLoader()); + } + catch (ClassNotFoundException e) + { + return null; + } + } + @Override + public Map getSharedModDescriptor() + { + Map descriptor = Maps.newHashMap(); + descriptor.put("modsystem", "FML"); + descriptor.put("id", getModId()); + descriptor.put("version",getDisplayVersion()); + descriptor.put("name", getName()); + descriptor.put("url", modMetadata.url); + descriptor.put("authors", modMetadata.getAuthorList()); + descriptor.put("description", modMetadata.description); + return descriptor; + } + + @Override + public Disableable canBeDisabled() + { + return disableability; + } + + @Override + public String getGuiClassName() + { + return (String) descriptor.get("guiFactory"); + } + + @Override + public List getOwnedPackages() + { + return candidate.getContainedPackages(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/IASMHook.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IASMHook.java new file mode 100644 index 0000000..77b0256 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IASMHook.java @@ -0,0 +1,34 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import org.objectweb.asm.tree.ClassNode; + +public interface IASMHook { + /** + * Inject the {@link Mod} class node into this instance. This allows retrieval from custom + * attributes or other artifacts in your mod class + * + * @param modClassNode The mod class + * @return optionally some code generated classes that will be injected into the classloader + */ + ClassNode[] inject(ClassNode modClassNode); + /** + * Allow mods to manipulate classes loaded from this {@link Mod}'s jar file. The {@link Mod} + * class is always guaranteed to be called first. + * The node state should be changed in place. + * + * @param node The class being loaded + */ + void modifyClass(String className, ClassNode node); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ICrashCallable.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ICrashCallable.java new file mode 100644 index 0000000..0c1f506 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ICrashCallable.java @@ -0,0 +1,20 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.util.concurrent.Callable; + +public interface ICrashCallable extends Callable +{ + String getLabel(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLHandledException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLHandledException.java new file mode 100644 index 0000000..5061dfd --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLHandledException.java @@ -0,0 +1,18 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +public interface IFMLHandledException +{ + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLSidedHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLSidedHandler.java new file mode 100644 index 0000000..4d9cbae --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFMLSidedHandler.java @@ -0,0 +1,68 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.util.List; +import java.util.Set; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetworkManager; +import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.relauncher.Side; + +public interface IFMLSidedHandler +{ + List getAdditionalBrandingInformation(); + + Side getSide(); + + void haltGame(String message, Throwable exception); + + void showGuiScreen(Object clientGuiElement); + + void queryUser(StartupQuery query) throws InterruptedException; + + void beginServerLoading(MinecraftServer server); + + void finishServerLoading(); + + File getSavesDirectory(); + + MinecraftServer getServer(); + + boolean shouldServerShouldBeKilledQuietly(); + + void addModAsResource(ModContainer container); + + String getCurrentLanguage(); + + void serverStopped(); + + NetworkManager getClientToServerNetworkManager(); + + INetHandler getClientPlayHandler(); + + void waitForPlayClient(); + + void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set channelSet, String channel, Side side); + + boolean shouldAllowPlayerLogins(); + + void allowLogins(); + + void processWindowMessages(); + + String stripSpecialChars(String message); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFuelHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFuelHandler.java new file mode 100644 index 0000000..ea34805 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IFuelHandler.java @@ -0,0 +1,20 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import net.minecraft.item.ItemStack; + +public interface IFuelHandler +{ + int getBurnTime(ItemStack fuel); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ILanguageAdapter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ILanguageAdapter.java new file mode 100644 index 0000000..f2bb817 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ILanguageAdapter.java @@ -0,0 +1,196 @@ +package cpw.mods.fml.common; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import org.apache.logging.log4j.Level; + +import cpw.mods.fml.relauncher.Side; + +public interface ILanguageAdapter { + public Object getNewInstance(FMLModContainer container, Class objectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception; + public boolean supportsStatics(); + public void setProxy(Field target, Class proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException; + public void setInternalProxies(ModContainer mod, Side side, ClassLoader loader); + + public static class ScalaAdapter implements ILanguageAdapter { + @Override + public Object getNewInstance(FMLModContainer container, Class scalaObjectClass, ClassLoader classLoader, Method factoryMarkedAnnotation) throws Exception + { + Class sObjectClass = Class.forName(scalaObjectClass.getName()+"$",true,classLoader); + return sObjectClass.getField("MODULE$").get(null); + } + + @Override + public boolean supportsStatics() + { + return false; + } + + @Override + public void setProxy(Field target, Class proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException + { + try + { + // Get the actual singleton class. The two variants are from + // whether the @SidedProxy is declared in a the class block + // of the object directly, or in the object block, i.e. + // whether it's: + // class ModName { + // @SidedProxy ... + // } + // object ModName extends ModName {} + // which leads to us getting the outer class, or + // object ModName { + // @SidedProxy ... + // } + // which leads to us getting the inner class. + if (!proxyTarget.getName().endsWith("$")) + { + // Get internal class generated by Scala. + proxyTarget = Class.forName(proxyTarget.getName() + "$", true, proxyTarget.getClassLoader()); + } + } + catch (ClassNotFoundException e) + { + // Not a singleton, look for @Instance field as a fallback. + FMLLog.log(Level.INFO, e, "An error occured trying to load a proxy into %s.%s. Did you declare your mod as 'class' instead of 'object'?", proxyTarget.getSimpleName(), target.getName()); + return; + } + + // Get the instance via the MODULE$ field which is + // automatically generated by the Scala compiler for + // singletons. + Object targetInstance = proxyTarget.getField("MODULE$").get(null); + + try + { + // Find setter function. We do it this way because we can't + // necessarily use proxyTarget.getMethod(proxy.getClass()), as + // it might be a subclass and not the exact parameter type. + // All fields are private in Scala, wrapped by a getter and + // setter named and _$eq. To those + // familiar with scala.reflect.BeanProperty: these will always + // be there, set and get will always + // only be generated *additionally*. + final String setterName = target.getName() + "_$eq"; + for (Method setter : proxyTarget.getMethods()) + { + Class[] setterParameters = setter.getParameterTypes(); + if (setterName.equals(setter.getName()) && + // Some more validation. + setterParameters.length == 1 && + setterParameters[0].isAssignableFrom(proxy.getClass())) + { + // Here goes nothing... + setter.invoke(targetInstance, proxy); + return; + } + } + } + catch (InvocationTargetException e) + { + FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName()); + throw new LoaderException(e); + } + + // If we come here we could not find a setter for this proxy. + FMLLog.severe("Failed loading proxy into %s.%s, could not find setter function. Did you declare the field with 'val' instead of 'var'?", proxyTarget.getSimpleName(), target.getName()); + throw new LoaderException(String.format("Failed loading proxy into %s.%s, could not find setter function. Did you declare the field with 'val' instead of 'var'?", proxyTarget.getSimpleName(), target.getName())); + } + + @Override + public void setInternalProxies(ModContainer mod, Side side, ClassLoader loader) + { + // For Scala mods, we want to enable authors to write them like so: + // object ModName { + // @SidedProxy(...) + // var proxy: ModProxy = null + // } + // For this to work, we have to search inside the inner class Scala + // generates for singletons, which is in called ModName$. These are + // not automatically handled, because the mod discovery code ignores + // internal classes. + // Note that it is alternatively possible to write this like so: + // class ModName { + // @SidedProxy(...) + // var proxy: ModProxy = null + // } + // object ModName extends ModName { ... } + // which will fall back to the normal injection code which calls + // setProxy in turn. + + // Get the actual mod implementation, which will be the inner class + // if we have a singleton. + Class proxyTarget = mod.getMod().getClass(); + if (proxyTarget.getName().endsWith("$")) + { + // So we have a singleton class, check if there are targets. + for (Field target : proxyTarget.getDeclaredFields()) + { + // This will not turn up anything if the alternative + // approach was taken (manually declaring the class). + // So we don't initialize the field twice. + if (target.getAnnotation(SidedProxy.class) != null) + { + String targetType = side.isClient() ? target.getAnnotation(SidedProxy.class).clientSide() : target.getAnnotation(SidedProxy.class).serverSide(); + try + { + Object proxy = Class.forName(targetType, true, loader).newInstance(); + + if (!target.getType().isAssignableFrom(proxy.getClass())) + { + FMLLog.severe("Attempted to load a proxy type %s into %s.%s, but the types don't match", targetType, proxyTarget.getSimpleName(), target.getName()); + throw new LoaderException(String.format("Attempted to load a proxy type %s into %s.%s, but the types don't match", targetType, proxyTarget.getSimpleName(), target.getName())); + } + + setProxy(target, proxyTarget, proxy); + } + catch (Exception e) { + FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", proxyTarget.getSimpleName(), target.getName()); + throw new LoaderException(e); + } + } + } + } + else + { + FMLLog.finer("Mod does not appear to be a singleton."); + } + } + } + + public static class JavaAdapter implements ILanguageAdapter { + @Override + public Object getNewInstance(FMLModContainer container, Class objectClass, ClassLoader classLoader, Method factoryMarkedMethod) throws Exception + { + if (factoryMarkedMethod != null) + { + return factoryMarkedMethod.invoke(null); + } + else + { + return objectClass.newInstance(); + } + } + + @Override + public boolean supportsStatics() + { + return true; + } + + @Override + public void setProxy(Field target, Class proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, + SecurityException + { + target.set(null, proxy); + } + + @Override + public void setInternalProxies(ModContainer mod, Side side, ClassLoader loader) + { + // Nothing to do here. + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/IWorldGenerator.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IWorldGenerator.java new file mode 100644 index 0000000..ae8531b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/IWorldGenerator.java @@ -0,0 +1,41 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + + +/** + * This is called back during world generation. + * + * @author cpw + * + */ +public interface IWorldGenerator +{ + /** + * Generate some world + * + * @param random the chunk specific {@link Random}. + * @param chunkX the chunk X coordinate of this chunk. + * @param chunkZ the chunk Z coordinate of this chunk. + * @param world : additionalData[0] The minecraft {@link World} we're generating for. + * @param chunkGenerator : additionalData[1] The {@link IChunkProvider} that is generating. + * @param chunkProvider : additionalData[2] {@link IChunkProvider} that is requesting the world generation. + * + */ + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/InjectedModContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/InjectedModContainer.java new file mode 100644 index 0000000..1394cc2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/InjectedModContainer.java @@ -0,0 +1,204 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.security.cert.Certificate; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.eventbus.EventBus; + +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.VersionRange; + +public class InjectedModContainer implements ModContainer +{ + private File source; + public final ModContainer wrappedContainer; + + public InjectedModContainer(ModContainer mc, File source) + { + this.source = source != null ? source : new File("minecraft.jar"); + this.wrappedContainer = mc; + } + + @Override + public String getModId() + { + return wrappedContainer.getModId(); + } + + @Override + public String getName() + { + return wrappedContainer.getName(); + } + + @Override + public String getVersion() + { + return wrappedContainer.getVersion(); + } + + @Override + public File getSource() + { + return source; + } + + @Override + public ModMetadata getMetadata() + { + return wrappedContainer.getMetadata(); + } + + @Override + public void bindMetadata(MetadataCollection mc) + { + wrappedContainer.bindMetadata(mc); + } + + @Override + public void setEnabledState(boolean enabled) + { + wrappedContainer.setEnabledState(enabled); + } + + @Override + public Set getRequirements() + { + return wrappedContainer.getRequirements(); + } + + @Override + public List getDependencies() + { + return wrappedContainer.getDependencies(); + } + + @Override + public List getDependants() + { + return wrappedContainer.getDependants(); + } + + @Override + public String getSortingRules() + { + return wrappedContainer.getSortingRules(); + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) + { + return wrappedContainer.registerBus(bus, controller); + } + + @Override + public boolean matches(Object mod) + { + return wrappedContainer.matches(mod); + } + + @Override + public Object getMod() + { + return wrappedContainer.getMod(); + } + + @Override + public ArtifactVersion getProcessedVersion() + { + return wrappedContainer.getProcessedVersion(); + } + + @Override + public boolean isImmutable() + { + return true; + } + + @Override + public String getDisplayVersion() + { + return wrappedContainer.getDisplayVersion(); + } + + @Override + public VersionRange acceptableMinecraftVersionRange() + { + return wrappedContainer.acceptableMinecraftVersionRange(); + } + + public WorldAccessContainer getWrappedWorldAccessContainer() + { + if (wrappedContainer instanceof WorldAccessContainer) + { + return (WorldAccessContainer) wrappedContainer; + } + else + { + return null; + } + } + + @Override + public Certificate getSigningCertificate() + { + return wrappedContainer.getSigningCertificate(); + } + + @Override + public String toString() + { + return "Wrapped{"+wrappedContainer.toString()+"}"; + } + + @Override + public Map getCustomModProperties() + { + return wrappedContainer.getCustomModProperties(); + } + + @Override + public Class getCustomResourcePackClass() + { + return wrappedContainer.getCustomResourcePackClass(); + } + + @Override + public Map getSharedModDescriptor() + { + return wrappedContainer.getSharedModDescriptor(); + } + + @Override + public Disableable canBeDisabled() + { + return wrappedContainer.canBeDisabled(); + } + + @Override + public String getGuiClassName() + { + return wrappedContainer.getGuiClassName(); + } + + @Override + public List getOwnedPackages() + { + return wrappedContainer.getOwnedPackages(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoadController.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoadController.java new file mode 100644 index 0000000..b849e60 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoadController.java @@ -0,0 +1,367 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.lang.reflect.InvocationTargetException; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.ThreadContext; + +import com.google.common.base.Joiner; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.BiMap; +import com.google.common.collect.Collections2; +import com.google.common.collect.ImmutableBiMap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import com.google.common.collect.Iterables; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; + +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.common.ProgressManager.ProgressBar; +import cpw.mods.fml.common.event.FMLEvent; +import cpw.mods.fml.common.event.FMLLoadEvent; +import cpw.mods.fml.common.event.FMLModDisabledEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLStateEvent; +import cpw.mods.fml.common.functions.ArtifactVersionNameFunction; +import cpw.mods.fml.common.versioning.ArtifactVersion; + +public class LoadController +{ + private Loader loader; + private EventBus masterChannel; + private ImmutableMap eventChannels; + private LoaderState state; + private Multimap modStates = ArrayListMultimap.create(); + private Multimap errors = ArrayListMultimap.create(); + private List activeModList = Lists.newArrayList(); + private ModContainer activeContainer; + private BiMap modObjectList; + private ListMultimap packageOwners; + + public LoadController(Loader loader) + { + this.loader = loader; + this.masterChannel = new EventBus("FMLMainChannel"); + this.masterChannel.register(this); + + state = LoaderState.NOINIT; + packageOwners = ArrayListMultimap.create(); + + } + + void disableMod(ModContainer mod) + { + HashMap temporary = Maps.newHashMap(eventChannels); + String modId = mod.getModId(); + EventBus bus = temporary.remove(modId); + bus.post(new FMLModDisabledEvent()); + if (errors.get(modId).isEmpty()) + { + eventChannels = ImmutableMap.copyOf(temporary); + modStates.put(modId, ModState.DISABLED); + modObjectList.remove(mod); + activeModList.remove(mod); + } + } + @Subscribe + public void buildModList(FMLLoadEvent event) + { + Builder eventBus = ImmutableMap.builder(); + + for (ModContainer mod : loader.getModList()) + { + //Create mod logger, and make the EventBus logger a child of it. + EventBus bus = new EventBus(mod.getModId()); + boolean isActive = mod.registerBus(bus, this); + if (isActive) + { + activeModList.add(mod); + modStates.put(mod.getModId(), ModState.UNLOADED); + eventBus.put(mod.getModId(), bus); + FMLCommonHandler.instance().addModToResourcePack(mod); + } + else + { + FMLLog.log(mod.getModId(), Level.WARN, "Mod %s has been disabled through configuration", mod.getModId()); + modStates.put(mod.getModId(), ModState.UNLOADED); + modStates.put(mod.getModId(), ModState.DISABLED); + } + } + + eventChannels = eventBus.build(); + } + + public void distributeStateMessage(LoaderState state, Object... eventData) + { + if (state.hasEvent()) + { + masterChannel.post(state.getEvent(eventData)); + } + } + + public void transition(LoaderState desiredState, boolean forceState) + { + LoaderState oldState = state; + state = state.transition(!errors.isEmpty()); + if (state != desiredState && !forceState) + { + Throwable toThrow = null; + FMLLog.severe("Fatal errors were detected during the transition from %s to %s. Loading cannot continue", oldState, desiredState); + StringBuilder sb = new StringBuilder(); + printModStates(sb); + FMLLog.severe("%s", sb.toString()); + if (errors.size()>0) + { + FMLLog.severe("The following problems were captured during this phase"); + for (Entry error : errors.entries()) + { + FMLLog.log(Level.ERROR, error.getValue(), "Caught exception from %s", error.getKey()); + if (error.getValue() instanceof IFMLHandledException) + { + toThrow = error.getValue(); + } + else if (toThrow == null) + { + toThrow = error.getValue(); + } + } + } + else + { + FMLLog.severe("The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base class" + + "ForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside of" + + "ForgeModLoader, especially Optifine, to see if there are fixes available."); + throw new RuntimeException("The ForgeModLoader state engine is invalid"); + } + if (toThrow != null && toThrow instanceof RuntimeException) + { + throw (RuntimeException)toThrow; + } + else + { + throw new LoaderException(toThrow); + } + } + else if (state != desiredState && forceState) + { + FMLLog.info("The state engine was in incorrect state %s and forced into state %s. Errors may have been discarded.", state, desiredState); + forceState(desiredState); + } + + } + + public ModContainer activeContainer() + { + return activeContainer != null ? activeContainer : findActiveContainerFromStack(); + } + + @Subscribe + public void propogateStateMessage(FMLEvent stateEvent) + { + if (stateEvent instanceof FMLPreInitializationEvent) + { + modObjectList = buildModObjectList(); + } + ProgressBar bar = ProgressManager.push(stateEvent.description(), activeModList.size(), true); + for (ModContainer mc : activeModList) + { + bar.step(mc.getName()); + sendEventToModContainer(stateEvent, mc); + } + ProgressManager.pop(bar); + } + + private void sendEventToModContainer(FMLEvent stateEvent, ModContainer mc) + { + String modId = mc.getModId(); + Collection requirements = Collections2.transform(mc.getRequirements(),new ArtifactVersionNameFunction()); + for (ArtifactVersion av : mc.getDependencies()) + { + if (av.getLabel()!= null && requirements.contains(av.getLabel()) && modStates.containsEntry(av.getLabel(),ModState.ERRORED)) + { + FMLLog.log(modId, Level.ERROR, "Skipping event %s and marking errored mod %s since required dependency %s has errored", stateEvent.getEventType(), modId, av.getLabel()); + modStates.put(modId, ModState.ERRORED); + return; + } + } + activeContainer = mc; + stateEvent.applyModContainer(activeContainer()); + ThreadContext.put("mod", modId); + FMLLog.log(modId, Level.TRACE, "Sending event %s to mod %s", stateEvent.getEventType(), modId); + eventChannels.get(modId).post(stateEvent); + FMLLog.log(modId, Level.TRACE, "Sent event %s to mod %s", stateEvent.getEventType(), modId); + ThreadContext.remove("mod"); + activeContainer = null; + if (stateEvent instanceof FMLStateEvent) + { + if (!errors.containsKey(modId)) + { + modStates.put(modId, ((FMLStateEvent)stateEvent).getModState()); + } + else + { + modStates.put(modId, ModState.ERRORED); + } + } + } + + public ImmutableBiMap buildModObjectList() + { + ImmutableBiMap.Builder builder = ImmutableBiMap.builder(); + for (ModContainer mc : activeModList) + { + if (!mc.isImmutable() && mc.getMod()!=null) + { + builder.put(mc, mc.getMod()); + List packages = mc.getOwnedPackages(); + for (String pkg : packages) + { + packageOwners.put(pkg, mc); + } + } + if (mc.getMod()==null && !mc.isImmutable() && state!=LoaderState.CONSTRUCTING) + { + FMLLog.severe("There is a severe problem with %s - it appears not to have constructed correctly", mc.getModId()); + if (state != LoaderState.CONSTRUCTING) + { + this.errorOccurred(mc, new RuntimeException()); + } + } + } + return builder.build(); + } + + public void errorOccurred(ModContainer modContainer, Throwable exception) + { + if (exception instanceof InvocationTargetException) + { + errors.put(modContainer.getModId(), ((InvocationTargetException)exception).getCause()); + } + else + { + errors.put(modContainer.getModId(), exception); + } + } + + public void printModStates(StringBuilder ret) + { + ret.append("\n\tStates:"); + for (ModState state : ModState.values()) + ret.append(" '").append(state.getMarker()).append("' = ").append(state.toString()); + + for (ModContainer mc : loader.getModList()) + { + ret.append("\n\t"); + for (ModState state : modStates.get(mc.getModId())) + ret.append(state.getMarker()); + + ret.append("\t").append(mc.getModId()).append("{").append(mc.getVersion()).append("} [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") "); + } + } + + public List getActiveModList() + { + return activeModList; + } + + public ModState getModState(ModContainer selectedMod) + { + return Iterables.getLast(modStates.get(selectedMod.getModId()), ModState.AVAILABLE); + } + + public void distributeStateMessage(Class customEvent) + { + try + { + masterChannel.post(customEvent.newInstance()); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "An unexpected exception"); + throw new LoaderException(e); + } + } + + public BiMap getModObjectList() + { + if (modObjectList == null) + { + FMLLog.severe("Detected an attempt by a mod %s to perform game activity during mod construction. This is a serious programming error.", activeContainer); + return buildModObjectList(); + } + return ImmutableBiMap.copyOf(modObjectList); + } + + public boolean isInState(LoaderState state) + { + return this.state == state; + } + + boolean hasReachedState(LoaderState state) { + return this.state.ordinal()>=state.ordinal() && this.state!=LoaderState.ERRORED; + } + + void forceState(LoaderState newState) + { + this.state = newState; + } + + private ModContainer findActiveContainerFromStack() + { + for (Class c : getCallingStack()) + { + int idx = c.getName().lastIndexOf('.'); + if (idx == -1) + { + continue; + } + String pkg = c.getName().substring(0,idx); + if (packageOwners.containsKey(pkg)) + { + return packageOwners.get(pkg).get(0); + } + } + + return null; + } + private FMLSecurityManager accessibleManager = new FMLSecurityManager(); + + class FMLSecurityManager extends SecurityManager + { + Class[] getStackClasses() + { + return getClassContext(); + } + } + + Class[] getCallingStack() + { + return accessibleManager.getStackClasses(); + } + + LoaderState getState() + { + return state; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/Loader.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Loader.java new file mode 100644 index 0000000..8d8c7f0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Loader.java @@ -0,0 +1,1086 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultiset; +import com.google.common.collect.Iterables; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimaps; +import com.google.common.collect.Multiset.Entry; +import com.google.common.collect.Multisets; +import com.google.common.collect.Ordering; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Sets; +import com.google.common.collect.TreeMultimap; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonIOException; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; + +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.common.MetadataCollection.ArtifactVersionAdapter; +import cpw.mods.fml.common.ModContainer.Disableable; +import cpw.mods.fml.common.ProgressManager.ProgressBar; +import cpw.mods.fml.common.discovery.ModDiscoverer; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLLoadEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; +import cpw.mods.fml.common.event.FMLModIdMappingEvent; +import cpw.mods.fml.common.functions.ArtifactVersionNameFunction; +import cpw.mods.fml.common.functions.ModIdFunction; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry.Type; +import cpw.mods.fml.common.registry.ItemStackHolderInjector; +import cpw.mods.fml.common.registry.ObjectHolderRegistry; +import cpw.mods.fml.common.toposort.ModSorter; +import cpw.mods.fml.common.toposort.ModSortingException; +import cpw.mods.fml.common.toposort.ModSortingException.SortingExceptionData; +import cpw.mods.fml.common.toposort.TopologicalSort; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.VersionParser; +import cpw.mods.fml.relauncher.ModListHelper; +import cpw.mods.fml.relauncher.Side; + +/** + * The loader class performs the actual loading of the mod code from disk. + * + *

+ * There are several {@link LoaderState}s to mod loading, triggered in two + * different stages from the FML handler code's hooks into the minecraft code. + *

+ * + *
    + *
  1. LOADING. Scanning the filesystem for mod containers to load (zips, jars, + * directories), adding them to the {@link #modClassLoader} Scanning, the loaded + * containers for mod classes to load and registering them appropriately.
  2. + *
  3. PREINIT. The mod classes are configured, they are sorted into a load + * order, and instances of the mods are constructed.
  4. + *
  5. INIT. The mod instances are initialized. For BaseMod mods, this involves + * calling the load method.
  6. + *
  7. POSTINIT. The mod instances are post initialized. For BaseMod mods this + * involves calling the modsLoaded method.
  8. + *
  9. UP. The Loader is complete
  10. + *
  11. ERRORED. The loader encountered an error during the LOADING phase and + * dropped to this state instead. It will not complete loading from this state, + * but it attempts to continue loading before abandoning and giving a fatal + * error.
  12. + *
+ * + * Phase 1 code triggers the LOADING and PREINIT states. Phase 2 code triggers + * the INIT and POSTINIT states. + * + * @author cpw + * + */ +public class Loader +{ + public static final String MC_VERSION = "1.7.10"; + private static final Splitter DEPENDENCYPARTSPLITTER = Splitter.on(":").omitEmptyStrings().trimResults(); + private static final Splitter DEPENDENCYSPLITTER = Splitter.on(";").omitEmptyStrings().trimResults(); + /** + * The singleton instance + */ + private static Loader instance; + /** + * Build information for tracking purposes. + */ + private static String major; + private static String minor; + private static String rev; + private static String build; + private static String mccversion; + private static String mcpversion; + + /** + * The class loader we load the mods into. + */ + private ModClassLoader modClassLoader; + /** + * The sorted list of mods. + */ + private List mods; + /** + * A named list of mods + */ + private Map namedMods; + /** + * A reverse dependency graph for mods + */ + private ListMultimap reverseDependencies; + /** + * The canonical configuration directory + */ + private File canonicalConfigDir; + private File canonicalModsDir; + private LoadController modController; + private MinecraftDummyContainer minecraft; + private MCPDummyContainer mcp; + + private static File minecraftDir; + private static List injectedContainers; + private ImmutableMap fmlBrandingProperties; + private File forcedModFile; + private ModDiscoverer discoverer; + private ProgressBar progressBar; + + public static Loader instance() + { + if (instance == null) + { + instance = new Loader(); + } + + return instance; + } + + @SuppressWarnings("unchecked") + public static void injectData(Object... data) + { + major = (String) data[0]; + minor = (String) data[1]; + rev = (String) data[2]; + build = (String) data[3]; + mccversion = (String) data[4]; + mcpversion = (String) data[5]; + minecraftDir = (File) data[6]; + injectedContainers = (List)data[7]; + } + + private Loader() + { + modClassLoader = new ModClassLoader(getClass().getClassLoader()); + if (!mccversion.equals(MC_VERSION)) + { + FMLLog.severe("This version of FML is built for Minecraft %s, we have detected Minecraft %s in your minecraft jar file", mccversion, MC_VERSION); + throw new LoaderException(String.format("This version of FML is built for Minecraft %s, we have detected Minecraft %s in your minecraft jar file", mccversion, MC_VERSION)); + } + + minecraft = new MinecraftDummyContainer(MC_VERSION); + mcp = new MCPDummyContainer(MetadataCollection.from(getClass().getResourceAsStream("/mcpmod.info"), "MCP").getMetadataForId("mcp", null)); + } + + /** + * Sort the mods into a sorted list, using dependency information from the + * containers. The sorting is performed using a {@link TopologicalSort} + * based on the pre- and post- dependency information provided by the mods. + */ + private void sortModList() + { + FMLLog.finer("Verifying mod requirements are satisfied"); + try + { + BiMap modVersions = HashBiMap.create(); + for (ModContainer mod : Iterables.concat(getActiveModList(), ModAPIManager.INSTANCE.getAPIList())) + { + modVersions.put(mod.getModId(), mod.getProcessedVersion()); + } + + ArrayListMultimap reqList = ArrayListMultimap.create(); + for (ModContainer mod : getActiveModList()) + { + if (!mod.acceptableMinecraftVersionRange().containsVersion(minecraft.getProcessedVersion())) + { + FMLLog.severe("The mod %s does not wish to run in Minecraft version %s. You will have to remove it to play.", mod.getModId(), getMCVersionString()); + throw new WrongMinecraftVersionException(mod); + } + Map names = Maps.uniqueIndex(mod.getRequirements(), new ArtifactVersionNameFunction()); + Set versionMissingMods = Sets.newHashSet(); + + Set missingMods = Sets.difference(names.keySet(), modVersions.keySet()); + if (!missingMods.isEmpty()) + { + FMLLog.severe("The mod %s (%s) requires mods %s to be available", mod.getModId(), mod.getName(), missingMods); + for (String modid : missingMods) + { + versionMissingMods.add(names.get(modid)); + } + throw new MissingModsException(versionMissingMods); + } + reqList.putAll(mod.getModId(), names.keySet()); + ImmutableList allDeps = ImmutableList.builder().addAll(mod.getDependants()).addAll(mod.getDependencies()).build(); + for (ArtifactVersion v : allDeps) + { + if (modVersions.containsKey(v.getLabel())) + { + if (!v.containsVersion(modVersions.get(v.getLabel()))) + { + versionMissingMods.add(v); + } + } + } + if (!versionMissingMods.isEmpty()) + { + FMLLog.severe("The mod %s (%s) requires mod versions %s to be available", mod.getModId(), mod.getName(), versionMissingMods); + throw new MissingModsException(versionMissingMods); + } + } + + FMLLog.finer("All mod requirements are satisfied"); + + reverseDependencies = Multimaps.invertFrom(reqList, ArrayListMultimap.create()); + ModSorter sorter = new ModSorter(getActiveModList(), namedMods); + + try + { + FMLLog.finer("Sorting mods into an ordered list"); + List sortedMods = sorter.sort(); + // Reset active list to the sorted list + modController.getActiveModList().clear(); + modController.getActiveModList().addAll(sortedMods); + // And inject the sorted list into the overall list + mods.removeAll(sortedMods); + sortedMods.addAll(mods); + mods = sortedMods; + FMLLog.finer("Mod sorting completed successfully"); + } + catch (ModSortingException sortException) + { + FMLLog.severe("A dependency cycle was detected in the input mod set so an ordering cannot be determined"); + SortingExceptionData exceptionData = sortException.getExceptionData(); + FMLLog.severe("The first mod in the cycle is %s", exceptionData.getFirstBadNode()); + FMLLog.severe("The mod cycle involves"); + for (ModContainer mc : exceptionData.getVisitedNodes()) + { + FMLLog.severe("%s : before: %s, after: %s", mc.toString(), mc.getDependants(), mc.getDependencies()); + } + FMLLog.log(Level.ERROR, sortException, "The full error"); + throw sortException; + } + } + finally + { + FMLLog.fine("Mod sorting data"); + int unprintedMods = mods.size(); + for (ModContainer mod : getActiveModList()) + { + if (!mod.isImmutable()) + { + FMLLog.fine("\t%s(%s:%s): %s (%s)", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName(), mod.getSortingRules()); + unprintedMods--; + } + } + if (unprintedMods == mods.size()) + { + FMLLog.fine("No user mods found to sort"); + } + } + + } + + /** + * The primary loading code + * + * + * The found resources are first loaded into the {@link #modClassLoader} + * (always) then scanned for class resources matching the specification + * above. + * + * If they provide the {@link Mod} annotation, they will be loaded as + * "FML mods" + * + * Finally, if they are successfully loaded as classes, they are then added + * to the available mod list. + */ + private ModDiscoverer identifyMods() + { + FMLLog.fine("Building injected Mod Containers %s", injectedContainers); + // Add in the MCP mod container + mods.add(new InjectedModContainer(mcp,new File("minecraft.jar"))); + for (String cont : injectedContainers) + { + ModContainer mc; + try + { + mc = (ModContainer) Class.forName(cont,true,modClassLoader).newInstance(); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "A problem occured instantiating the injected mod container %s", cont); + throw new LoaderException(e); + } + mods.add(new InjectedModContainer(mc,mc.getSource())); + } + ModDiscoverer discoverer = new ModDiscoverer(); + FMLLog.fine("Attempting to load mods contained in the minecraft jar file and associated classes"); + discoverer.findClasspathMods(modClassLoader); + FMLLog.fine("Minecraft jar mods loaded successfully"); + + FMLLog.getLogger().log(Level.INFO, "Found {} mods from the command line. Injecting into mod discoverer",ModListHelper.additionalMods.size()); + FMLLog.info("Searching %s for mods", canonicalModsDir.getAbsolutePath()); + discoverer.findModDirMods(canonicalModsDir, ModListHelper.additionalMods.values().toArray(new File[0])); + File versionSpecificModsDir = new File(canonicalModsDir,mccversion); + if (versionSpecificModsDir.isDirectory()) + { + FMLLog.info("Also searching %s for mods", versionSpecificModsDir); + discoverer.findModDirMods(versionSpecificModsDir); + } + + mods.addAll(discoverer.identifyMods()); + identifyDuplicates(mods); + namedMods = Maps.uniqueIndex(mods, new ModIdFunction()); + FMLLog.info("Forge Mod Loader has identified %d mod%s to load", mods.size(), mods.size() != 1 ? "s" : ""); + return discoverer; + } + + private class ModIdComparator implements Comparator + { + @Override + public int compare(ModContainer o1, ModContainer o2) + { + return o1.getModId().compareTo(o2.getModId()); + } + } + + private void identifyDuplicates(List mods) + { + TreeMultimap dupsearch = TreeMultimap.create(new ModIdComparator(), Ordering.arbitrary()); + for (ModContainer mc : mods) + { + if (mc.getSource() != null) + { + dupsearch.put(mc, mc.getSource()); + } + } + + ImmutableMultiset duplist = Multisets.copyHighestCountFirst(dupsearch.keys()); + SetMultimap dupes = LinkedHashMultimap.create(); + for (Entry e : duplist.entrySet()) + { + if (e.getCount() > 1) + { + FMLLog.severe("Found a duplicate mod %s at %s", e.getElement().getModId(), dupsearch.get(e.getElement())); + dupes.putAll(e.getElement(),dupsearch.get(e.getElement())); + } + } + if (!dupes.isEmpty()) + { + throw new DuplicateModsFoundException(dupes); + } + } + + /** + * + */ + private void initializeLoader() + { + File modsDir = new File(minecraftDir, "mods"); + File configDir = new File(minecraftDir, "config"); + String canonicalModsPath; + String canonicalConfigPath; + + try + { + canonicalModsPath = modsDir.getCanonicalPath(); + canonicalConfigPath = configDir.getCanonicalPath(); + canonicalConfigDir = configDir.getCanonicalFile(); + canonicalModsDir = modsDir.getCanonicalFile(); + } + catch (IOException ioe) + { + FMLLog.log(Level.ERROR, ioe, "Failed to resolve loader directories: mods : %s ; config %s", canonicalModsDir.getAbsolutePath(), + configDir.getAbsolutePath()); + throw new LoaderException(ioe); + } + + if (!canonicalModsDir.exists()) + { + FMLLog.info("No mod directory found, creating one: %s", canonicalModsPath); + boolean dirMade = canonicalModsDir.mkdir(); + if (!dirMade) + { + FMLLog.severe("Unable to create the mod directory %s", canonicalModsPath); + throw new LoaderException(String.format("Unable to create the mod directory %s", canonicalModsPath)); + } + FMLLog.info("Mod directory created successfully"); + } + + if (!canonicalConfigDir.exists()) + { + FMLLog.fine("No config directory found, creating one: %s", canonicalConfigPath); + boolean dirMade = canonicalConfigDir.mkdir(); + if (!dirMade) + { + FMLLog.severe("Unable to create the config directory %s", canonicalConfigPath); + throw new LoaderException(); + } + FMLLog.info("Config directory created successfully"); + } + + if (!canonicalModsDir.isDirectory()) + { + FMLLog.severe("Attempting to load mods from %s, which is not a directory", canonicalModsPath); + throw new LoaderException(); + } + + if (!configDir.isDirectory()) + { + FMLLog.severe("Attempting to load configuration from %s, which is not a directory", canonicalConfigPath); + throw new LoaderException(); + } + + readInjectedDependencies(); + } + + public List getModList() + { + return instance().mods != null ? ImmutableList.copyOf(instance().mods) : ImmutableList.of(); + } + + /** + * Called from the hook to start mod loading. We trigger the + * {@link #identifyMods()} and Constructing, Preinitalization, and Initalization phases here. Finally, + * the mod list is frozen completely and is consider immutable from then on. + */ + public void loadMods() + { + progressBar = ProgressManager.push("Loading", 7); + progressBar.step("Constructing Mods"); + initializeLoader(); + mods = Lists.newArrayList(); + namedMods = Maps.newHashMap(); + modController = new LoadController(this); + modController.transition(LoaderState.LOADING, false); + discoverer = identifyMods(); + ModAPIManager.INSTANCE.manageAPI(modClassLoader, discoverer); + disableRequestedMods(); + modController.distributeStateMessage(FMLLoadEvent.class); + sortModList(); + ModAPIManager.INSTANCE.cleanupAPIContainers(modController.getActiveModList()); + ModAPIManager.INSTANCE.cleanupAPIContainers(mods); + mods = ImmutableList.copyOf(mods); + for (File nonMod : discoverer.getNonModLibs()) + { + if (nonMod.isFile()) + { + FMLLog.info("FML has found a non-mod file %s in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.", nonMod.getName()); + try + { + modClassLoader.addFile(nonMod); + } + catch (MalformedURLException e) + { + FMLLog.log(Level.ERROR, e, "Encountered a weird problem with non-mod file injection : %s", nonMod.getName()); + } + } + } + modController.transition(LoaderState.CONSTRUCTING, false); + modController.distributeStateMessage(LoaderState.CONSTRUCTING, modClassLoader, discoverer.getASMTable(), reverseDependencies); + + List mods = Lists.newArrayList(); + mods.addAll(getActiveModList()); + Collections.sort(mods, new Comparator() + { + @Override + public int compare(ModContainer o1, ModContainer o2) + { + return o1.getModId().compareTo(o2.getModId()); + } + }); + + FMLLog.fine("Mod signature data"); + FMLLog.fine(" \tValid Signatures:"); + for (ModContainer mod : getActiveModList()) + { + if (mod.getSigningCertificate() != null) + FMLLog.fine("\t\t(%s) %s\t(%s\t%s)\t%s", CertificateHelper.getFingerprint(mod.getSigningCertificate()), mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName()); + } + FMLLog.fine(" \tMissing Signatures:"); + for (ModContainer mod : getActiveModList()) + { + if (mod.getSigningCertificate() == null) + FMLLog.fine("\t\t%s\t(%s\t%s)\t%s", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName()); + } + if (getActiveModList().isEmpty()) + { + FMLLog.fine("No user mod signature data found"); + } + progressBar.step("Initializing mods Phase 1"); + modController.transition(LoaderState.PREINITIALIZATION, false); + } + + public void preinitializeMods() + { + if (!modController.isInState(LoaderState.PREINITIALIZATION)) + { + FMLLog.warning("There were errors previously. Not beginning mod initialization phase"); + return; + } + ObjectHolderRegistry.INSTANCE.findObjectHolders(discoverer.getASMTable()); + ItemStackHolderInjector.INSTANCE.findHolders(discoverer.getASMTable()); + modController.distributeStateMessage(LoaderState.PREINITIALIZATION, discoverer.getASMTable(), canonicalConfigDir); + ObjectHolderRegistry.INSTANCE.applyObjectHolders(); + ItemStackHolderInjector.INSTANCE.inject(); + modController.transition(LoaderState.INITIALIZATION, false); + progressBar.step("Initializing Minecraft Engine"); + } + + private void disableRequestedMods() + { + String forcedModList = System.getProperty("fml.modStates", ""); + FMLLog.finer("Received a system property request \'%s\'",forcedModList); + Map sysPropertyStateList = Splitter.on(CharMatcher.anyOf(";:")) + .omitEmptyStrings().trimResults().withKeyValueSeparator("=") + .split(forcedModList); + FMLLog.finer("System property request managing the state of %d mods", sysPropertyStateList.size()); + Map modStates = Maps.newHashMap(); + + forcedModFile = new File(canonicalConfigDir, "fmlModState.properties"); + Properties forcedModListProperties = new Properties(); + if (forcedModFile.exists() && forcedModFile.isFile()) + { + FMLLog.finer("Found a mod state file %s", forcedModFile.getName()); + try + { + forcedModListProperties.load(new FileReader(forcedModFile)); + FMLLog.finer("Loaded states for %d mods from file", forcedModListProperties.size()); + } + catch (Exception e) + { + FMLLog.log(Level.INFO, e, "An error occurred reading the fmlModState.properties file"); + } + } + modStates.putAll(Maps.fromProperties(forcedModListProperties)); + modStates.putAll(sysPropertyStateList); + FMLLog.fine("After merging, found state information for %d mods", modStates.size()); + + Map isEnabled = Maps.transformValues(modStates, new Function() + { + @Override + public Boolean apply(String input) + { + return Boolean.parseBoolean(input); + } + }); + + for (Map.Entry entry : isEnabled.entrySet()) + { + if (namedMods.containsKey(entry.getKey())) + { + FMLLog.info("Setting mod %s to enabled state %b", entry.getKey(), entry.getValue()); + namedMods.get(entry.getKey()).setEnabledState(entry.getValue()); + } + } + } + + /** + * Query if we know of a mod named modname + * + * @param modname + * @return If the mod is loaded + */ + public static boolean isModLoaded(String modname) + { + return instance().namedMods.containsKey(modname) && instance().modController.getModState(instance.namedMods.get(modname))!=ModState.DISABLED; + } + + public File getConfigDir() + { + return canonicalConfigDir; + } + + public String getCrashInformation() + { + // Handle being called before we've begun setup + if (modController == null) + { + return ""; + } + StringBuilder ret = new StringBuilder(); + List branding = FMLCommonHandler.instance().getBrandings(false); + + Joiner.on(' ').skipNulls().appendTo(ret, branding); + if (modController != null) + { + modController.printModStates(ret); + } + return ret.toString(); + } + + public String getFMLVersionString() + { + return "7.10.99.99"; + } + + public ClassLoader getModClassLoader() + { + return modClassLoader; + } + + public void computeDependencies(String dependencyString, Set requirements, List dependencies, List dependants) + { + if (dependencyString == null || dependencyString.length() == 0) + { + return; + } + + boolean parseFailure = false; + + for (String dep : DEPENDENCYSPLITTER.split(dependencyString)) + { + List depparts = Lists.newArrayList(DEPENDENCYPARTSPLITTER.split(dep)); + // Need two parts to the string + if (depparts.size() != 2) + { + parseFailure = true; + continue; + } + String instruction = depparts.get(0); + String target = depparts.get(1); + boolean targetIsAll = target.startsWith("*"); + + // Cannot have an "all" relationship with anything except pure * + if (targetIsAll && target.length() > 1) + { + parseFailure = true; + continue; + } + + // If this is a required element, add it to the required list + if ("required-before".equals(instruction) || "required-after".equals(instruction)) + { + // You can't require everything + if (!targetIsAll) + { + requirements.add(VersionParser.parseVersionReference(target)); + } + else + { + parseFailure = true; + continue; + } + } + + // You cannot have a versioned dependency on everything + if (targetIsAll && target.indexOf('@') > -1) + { + parseFailure = true; + continue; + } + // before elements are things we are loaded before (so they are our dependants) + if ("required-before".equals(instruction) || "before".equals(instruction)) + { + dependants.add(VersionParser.parseVersionReference(target)); + } + // after elements are things that load before we do (so they are out dependencies) + else if ("required-after".equals(instruction) || "after".equals(instruction)) + { + dependencies.add(VersionParser.parseVersionReference(target)); + } + else + { + parseFailure = true; + } + } + + if (parseFailure) + { + FMLLog.log(Level.WARN, "Unable to parse dependency string %s", dependencyString); + throw new LoaderException(String.format("Unable to parse dependency string %s", dependencyString)); + } + } + + public Map getIndexedModList() + { + return ImmutableMap.copyOf(namedMods); + } + + public void initializeMods() + { + progressBar.step("Initializing mods Phase 2"); + // Mod controller should be in the initialization state here + modController.distributeStateMessage(LoaderState.INITIALIZATION); + progressBar.step("Initializing mods Phase 3"); + modController.transition(LoaderState.POSTINITIALIZATION, false); + modController.distributeStateMessage(FMLInterModComms.IMCEvent.class); + ItemStackHolderInjector.INSTANCE.inject(); + modController.distributeStateMessage(LoaderState.POSTINITIALIZATION); + progressBar.step("Finishing up"); + modController.transition(LoaderState.AVAILABLE, false); + modController.distributeStateMessage(LoaderState.AVAILABLE); + GameData.freezeData(); + // Dump the custom registry data map, if necessary + GameData.dumpRegistry(minecraftDir); + FMLLog.info("Forge Mod Loader has successfully loaded %d mod%s", mods.size(), mods.size() == 1 ? "" : "s"); + progressBar.step("Completing Minecraft initialization"); + } + + public ICrashCallable getCallableCrashInformation() + { + return new ICrashCallable() { + @Override + public String call() throws Exception + { + return getCrashInformation(); + } + + @Override + public String getLabel() + { + return "FML"; + } + }; + } + + public List getActiveModList() + { + return modController != null ? modController.getActiveModList() : ImmutableList.of(); + } + + public ModState getModState(ModContainer selectedMod) + { + return modController.getModState(selectedMod); + } + + public String getMCVersionString() + { + return "Minecraft " + mccversion; + } + + public boolean serverStarting(Object server) + { + try + { + modController.distributeStateMessage(LoaderState.SERVER_STARTING, server); + modController.transition(LoaderState.SERVER_STARTING, false); + } + catch (Throwable t) + { + FMLLog.log(Level.ERROR, t, "A fatal exception occurred during the server starting event"); + return false; + } + return true; + } + + public void serverStarted() + { + modController.distributeStateMessage(LoaderState.SERVER_STARTED); + modController.transition(LoaderState.SERVER_STARTED, false); + } + + public void serverStopping() + { + modController.distributeStateMessage(LoaderState.SERVER_STOPPING); + modController.transition(LoaderState.SERVER_STOPPING, false); + } + + public BiMap getModObjectList() + { + return modController.getModObjectList(); + } + + public BiMap getReversedModObjectList() + { + return getModObjectList().inverse(); + } + + public ModContainer activeModContainer() + { + return modController != null ? modController.activeContainer() : null; + } + + public boolean isInState(LoaderState state) + { + return modController.isInState(state); + } + + public MinecraftDummyContainer getMinecraftModContainer() + { + return minecraft; + } + + public boolean hasReachedState(LoaderState state) + { + return modController != null ? modController.hasReachedState(state) : false; + } + + public String getMCPVersionString() + { + return String.format("MCP v%s", mcpversion); + } + + public void serverStopped() + { + GameData.revertToFrozen(); + modController.distributeStateMessage(LoaderState.SERVER_STOPPED); + modController.transition(LoaderState.SERVER_STOPPED, true); + modController.transition(LoaderState.AVAILABLE, true); + } + + public boolean serverAboutToStart(Object server) + { + try + { + modController.distributeStateMessage(LoaderState.SERVER_ABOUT_TO_START, server); + modController.transition(LoaderState.SERVER_ABOUT_TO_START, false); + } + catch (Throwable t) + { + FMLLog.log(Level.ERROR, t, "A fatal exception occurred during the server about to start event"); + return false; + } + return true; + } + + public Map getFMLBrandingProperties() + { + if (fmlBrandingProperties == null) + { + Properties loaded = new Properties(); + try + { + loaded.load(getClass().getClassLoader().getResourceAsStream("fmlbranding.properties")); + } + catch (Exception e) + { + // File not found - ignore + } + fmlBrandingProperties = Maps.fromProperties(loaded); + } + return fmlBrandingProperties; + } + + + public Map getCustomModProperties(String modId) + { + return getIndexedModList().get(modId).getCustomModProperties(); + } + + boolean checkRemoteModList(Map modList, Side side) + { + Set remoteModIds = modList.keySet(); + Set localModIds = namedMods.keySet(); + + Set difference = Sets.newLinkedHashSet(Sets.difference(localModIds, remoteModIds)); + for (Iterator iterator = difference.iterator(); iterator.hasNext();) + { + String missingRemotely = iterator.next(); + ModState modState = modController.getModState(namedMods.get(missingRemotely)); + if (modState == ModState.DISABLED) + { + iterator.remove(); + } + } + + FMLLog.info("Attempting connection with missing mods %s at %s", difference, side); + return true; + } + + /** + * Fire a FMLMissingMappingsEvent to let mods determine how blocks/items defined in the world + * save, but missing from the runtime, are to be handled. + * + * @param missing Map containing missing names with their associated id, blocks need to come before items for remapping. + * @param isLocalWorld Whether this is executing for a world load (local/server) or a client. + * @param gameData GameData instance where the new map's config is to be loaded into. + * @return List with the mapping results. + */ + public List fireMissingMappingEvent(LinkedHashMap missing, boolean isLocalWorld, GameData gameData, Map remaps) + { + if (missing.isEmpty()) // nothing to do + { + return ImmutableList.of(); + } + + FMLLog.fine("There are %d mappings missing - attempting a mod remap", missing.size()); + ArrayListMultimap missingMappings = ArrayListMultimap.create(); + + for (Map.Entry mapping : missing.entrySet()) + { + int id = mapping.getValue(); + MissingMapping m = new MissingMapping(mapping.getKey(), id); + missingMappings.put(m.name.substring(0, m.name.indexOf(':')), m); + } + + FMLMissingMappingsEvent missingEvent = new FMLMissingMappingsEvent(missingMappings); + modController.propogateStateMessage(missingEvent); + + if (isLocalWorld) // local world, warn about entries still being set to the default action + { + boolean didWarn = false; + + for (MissingMapping mapping : missingMappings.values()) + { + if (mapping.getAction() == FMLMissingMappingsEvent.Action.DEFAULT) + { + if (!didWarn) + { + FMLLog.severe("There are unidentified mappings in this world - we are going to attempt to process anyway"); + didWarn = true; + } + + FMLLog.severe("Unidentified %s: %s, id %d", mapping.type == Type.BLOCK ? "block" : "item", mapping.name, mapping.id); + } + } + } + else // remote world, fail on entries with the default action + { + List missedMapping = new ArrayList(); + + for (MissingMapping mapping : missingMappings.values()) + { + if (mapping.getAction() == FMLMissingMappingsEvent.Action.DEFAULT) + { + missedMapping.add(mapping.name); + } + } + + if (!missedMapping.isEmpty()) + { + return ImmutableList.copyOf(missedMapping); + } + } + + return GameData.processIdRematches(missingMappings.values(), isLocalWorld, gameData, remaps); + } + + public void fireRemapEvent(Map remaps) + { + modController.propogateStateMessage(new FMLModIdMappingEvent(remaps)); + } + + public void runtimeDisableMod(String modId) + { + ModContainer mc = namedMods.get(modId); + Disableable disableable = mc.canBeDisabled(); + if (disableable == Disableable.NEVER) + { + FMLLog.info("Cannot disable mod %s - it is never allowed to be disabled", modId); + return; + } + if (disableable == Disableable.DEPENDENCIES) + { + FMLLog.info("Cannot disable mod %s - there are dependent mods that require its presence", modId); + return; + } + if (disableable == Disableable.YES) + { + FMLLog.info("Runtime disabling mod %s", modId); + modController.disableMod(mc); + List localmods = Lists.newArrayList(mods); + localmods.remove(mc); + mods = ImmutableList.copyOf(localmods); + } + + try + { + Properties props = new Properties(); + props.load(new FileReader(forcedModFile)); + props.put(modId, "false"); + props.store(new FileWriter(forcedModFile), null); + } + catch (Exception e) + { + FMLLog.log(Level.INFO, e, "An error occurred writing the fml mod states file, your disabled change won't persist"); + } + } + + public void loadingComplete() + { + ProgressManager.pop(progressBar); + progressBar = null; + } + + private ListMultimap injectedBefore = ArrayListMultimap.create(); + private ListMultimap injectedAfter = ArrayListMultimap.create(); + + private void readInjectedDependencies() + { + File injectedDepFile = new File(getConfigDir(),"injectedDependencies.json"); + if (!injectedDepFile.exists()) + { + FMLLog.getLogger().log(Level.DEBUG, "File {} not found. No dependencies injected", injectedDepFile.getAbsolutePath()); + return; + } + JsonParser parser = new JsonParser(); + JsonElement injectedDeps; + try + { + injectedDeps = parser.parse(new FileReader(injectedDepFile)); + for (JsonElement el : injectedDeps.getAsJsonArray()) + { + JsonObject jo = el.getAsJsonObject(); + String modId = jo.get("modId").getAsString(); + JsonArray deps = jo.get("deps").getAsJsonArray(); + for (JsonElement dep : deps) + { + JsonObject depObj = dep.getAsJsonObject(); + String type = depObj.get("type").getAsString(); + if (type.equals("before")) { + injectedBefore.put(modId, VersionParser.parseVersionReference(depObj.get("target").getAsString())); + } else if (type.equals("after")) { + injectedAfter.put(modId, VersionParser.parseVersionReference(depObj.get("target").getAsString())); + } else { + FMLLog.getLogger().log(Level.ERROR, "Invalid dependency type {}", type); + throw new RuntimeException("Unable to parse type"); + } + } + } + } catch (Exception e) + { + FMLLog.getLogger().log(Level.ERROR, "Unable to parse {} - skipping", injectedDepFile); + FMLLog.getLogger().throwing(Level.ERROR, e); + return; + } + FMLLog.getLogger().log(Level.DEBUG, "Loaded {} injected dependencies on modIds: {}", injectedBefore.size(), injectedBefore.keySet()); + } + + List getInjectedBefore(String modId) + { + return injectedBefore.get(modId); + } + List getInjectedAfter(String modId) + { + return injectedAfter.get(modId); + } + + public final LoaderState getLoaderState() + { + return modController != null ? modController.getState() : LoaderState.NOINIT; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderException.java new file mode 100644 index 0000000..300cf93 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderException.java @@ -0,0 +1,36 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +public class LoaderException extends EnhancedRuntimeException +{ + /** + * + */ + private static final long serialVersionUID = -5675297950958861378L; + + public LoaderException(Throwable wrapped) + { + super(wrapped); + } + + public LoaderException() + { + } + public LoaderException(String message) + { + super(message); + } + + @Override protected void printStackTrace(WrappedPrintStream stream){} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderState.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderState.java new file mode 100644 index 0000000..999645e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/LoaderState.java @@ -0,0 +1,128 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.common.event.FMLConstructionEvent; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLLoadCompleteEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.FMLServerStoppedEvent; +import cpw.mods.fml.common.event.FMLServerStoppingEvent; +import cpw.mods.fml.common.event.FMLStateEvent; + +/** + * The state enum used to help track state progression for the loader + * @author cpw + * + */ +public enum LoaderState +{ + NOINIT("Uninitialized",null), + LOADING("Loading",null), + CONSTRUCTING("Constructing mods",FMLConstructionEvent.class), + PREINITIALIZATION("Pre-initializing mods", FMLPreInitializationEvent.class), + INITIALIZATION("Initializing mods", FMLInitializationEvent.class), + POSTINITIALIZATION("Post-initializing mods", FMLPostInitializationEvent.class), + AVAILABLE("Mod loading complete", FMLLoadCompleteEvent.class), + SERVER_ABOUT_TO_START("Server about to start", FMLServerAboutToStartEvent.class), + SERVER_STARTING("Server starting", FMLServerStartingEvent.class), + SERVER_STARTED("Server started", FMLServerStartedEvent.class), + SERVER_STOPPING("Server stopping", FMLServerStoppingEvent.class), + SERVER_STOPPED("Server stopped", FMLServerStoppedEvent.class), + ERRORED("Mod Loading errored",null); + + + private Class eventClass; + @SuppressWarnings("unused") + private String name; + + private LoaderState(String name, Class event) + { + this.name = name; + this.eventClass = event; + } + + public LoaderState transition(boolean errored) + { + if (errored) + { + return ERRORED; + } + // stopping -> available + if (this == SERVER_STOPPED) + { + return AVAILABLE; + } + return values()[ordinal() < values().length ? ordinal()+1 : ordinal()]; + } + + public boolean hasEvent() + { + return eventClass != null; + } + + public FMLStateEvent getEvent(Object... eventData) + { + try + { + return eventClass.getConstructor(Object[].class).newInstance((Object)eventData); + } + catch (Exception e) + { + throw Throwables.propagate(e); + } + } + public LoaderState requiredState() + { + if (this == NOINIT) return NOINIT; + return LoaderState.values()[this.ordinal()-1]; + } + public enum ModState + { + UNLOADED ("Unloaded", "U"), + LOADED ("Loaded", "L"), + CONSTRUCTED ("Constructed", "C"), + PREINITIALIZED ("Pre-initialized", "H"), + INITIALIZED ("Initialized", "I"), + POSTINITIALIZED("Post-initialized", "J"), + AVAILABLE ("Available", "A"), + DISABLED ("Disabled", "D"), + ERRORED ("Errored", "E"); + + private String label; + private String marker; + + private ModState(String label, String marker) + { + this.label = label; + this.marker = marker; + } + + @Override + public String toString() + { + return this.label; + } + + public String getMarker() + { + return this.marker; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/MCPDummyContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MCPDummyContainer.java new file mode 100644 index 0000000..ef57774 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MCPDummyContainer.java @@ -0,0 +1,32 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import com.google.common.eventbus.EventBus; + +public class MCPDummyContainer extends DummyModContainer { + public MCPDummyContainer(ModMetadata metadata) { + super(metadata); + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) { + return true; + } + + @Override + public Disableable canBeDisabled() + { + return Disableable.YES; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/MetadataCollection.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MetadataCollection.java new file mode 100644 index 0000000..d3d63c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MetadataCollection.java @@ -0,0 +1,124 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Map; +import org.apache.logging.log4j.Level; + +import com.google.common.base.Throwables; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.VersionParser; + +public class MetadataCollection +{ + @SuppressWarnings("unused") + private String modListVersion; + private ModMetadata[] modList; + private Map metadatas = Maps.newHashMap(); + + public static MetadataCollection from(InputStream inputStream, String sourceName) + { + if (inputStream == null) + { + return new MetadataCollection(); + } + + InputStreamReader reader = new InputStreamReader(inputStream); + try + { + MetadataCollection collection; + Gson gson = new GsonBuilder().registerTypeAdapter(ArtifactVersion.class, new ArtifactVersionAdapter()).create(); + JsonParser parser = new JsonParser(); + JsonElement rootElement = parser.parse(reader); + if (rootElement.isJsonArray()) + { + collection = new MetadataCollection(); + JsonArray jsonList = rootElement.getAsJsonArray(); + collection.modList = new ModMetadata[jsonList.size()]; + int i = 0; + for (JsonElement mod : jsonList) + { + collection.modList[i++]=gson.fromJson(mod, ModMetadata.class); + } + } + else + { + collection = gson.fromJson(rootElement, MetadataCollection.class); + } + collection.parseModMetadataList(); + return collection; + } + catch (JsonParseException e) + { + FMLLog.log(Level.ERROR, e, "The mcmod.info file in %s cannot be parsed as valid JSON. It will be ignored", sourceName); + return new MetadataCollection(); + } + catch (Exception e) + { + throw Throwables.propagate(e); + } + } + + + private void parseModMetadataList() + { + for (ModMetadata modMetadata : modList) + { + metadatas.put(modMetadata.modId, modMetadata); + } + } + + public ModMetadata getMetadataForId(String modId, Map extraData) + { + if (!metadatas.containsKey(modId)) + { + ModMetadata dummy = new ModMetadata(); + dummy.modId = modId; + dummy.name = (String) extraData.get("name"); + dummy.version = (String) extraData.get("version"); + dummy.autogenerated = true; + metadatas.put(modId, dummy); + } + return metadatas.get(modId); + } + + public static class ArtifactVersionAdapter extends TypeAdapter + { + + @Override + public void write(JsonWriter out, ArtifactVersion value) throws IOException + { + // no op - we never write these out + } + + @Override + public ArtifactVersion read(JsonReader in) throws IOException + { + return VersionParser.parseVersionReference(in.nextString()); + } + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/MinecraftDummyContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MinecraftDummyContainer.java new file mode 100644 index 0000000..e46ec67 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MinecraftDummyContainer.java @@ -0,0 +1,56 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.security.cert.Certificate; + +import cpw.mods.fml.common.versioning.VersionParser; +import cpw.mods.fml.common.versioning.VersionRange; +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.Side; + +public class MinecraftDummyContainer extends DummyModContainer +{ + + private VersionRange staticRange; + public MinecraftDummyContainer(String actualMCVersion) + { + super(new ModMetadata()); + getMetadata().modId = "Minecraft"; + getMetadata().name = "Minecraft"; + getMetadata().version = actualMCVersion; + staticRange = VersionParser.parseRange("["+actualMCVersion+"]"); + } + + + public VersionRange getStaticVersionRange() + { + return staticRange; + } + + @Override + public Certificate getSigningCertificate() + { + if (FMLLaunchHandler.side() != Side.CLIENT) + return null; + + try + { + Class cbr = Class.forName("net.minecraft.client.ClientBrandRetriever", false, getClass().getClassLoader()); + Certificate[] certificates = cbr.getProtectionDomain().getCodeSource().getCertificates(); + return certificates != null ? certificates[0] : null; + } + catch (Exception e){} // Errors don't matter just return null. + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/MissingModsException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MissingModsException.java new file mode 100644 index 0000000..af1d3e2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/MissingModsException.java @@ -0,0 +1,39 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.util.Set; + +import cpw.mods.fml.common.versioning.ArtifactVersion; + +public class MissingModsException extends EnhancedRuntimeException +{ + private static final long serialVersionUID = 1L; + public final Set missingMods; + + public MissingModsException(Set missingMods) + { + this.missingMods = missingMods; + } + + @Override + protected void printStackTrace(WrappedPrintStream stream) + { + stream.println("Missing Mods:"); + for (ArtifactVersion v : missingMods) + { + stream.println(String.format("\t%s : %s", v.getLabel(), v.getRangeString())); + } + stream.println(""); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/Mod.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Mod.java new file mode 100644 index 0000000..e27e2d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Mod.java @@ -0,0 +1,295 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import cpw.mods.fml.client.IModGuiFactory; +import cpw.mods.fml.common.event.FMLEvent; +import cpw.mods.fml.common.event.FMLFingerprintViolationEvent; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerAboutToStartEvent; +import cpw.mods.fml.common.event.FMLServerStartedEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.event.FMLServerStoppedEvent; +import cpw.mods.fml.common.event.FMLServerStoppingEvent; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.common.registry.GameRegistry; + +/** + * This defines a Mod to FML. + * Any class found with this annotation applied will be loaded as a Mod. The instance that is loaded will + * represent the mod to other Mods in the system. It will be sent various subclasses of {@link FMLEvent} + * at pre-defined times during the loading of the game, based on where you have applied the {@link EventHandler} + * annotation. + * + *

This is a simple example of a Mod. It has the modId of "MyModId", the name of "My example mod", it is + * version 1.0, and depends on FML being loaded. + *

{@code
+ * package mymod;
+ * // Declare that this is a mod with modId "MyModId", name "My example mod", version "1.0" and dependency on FML.
+ * {@literal @}Mod(modId="MyModId",name="My example mod",version="1.0",dependencies="required-after:FML")
+ * public class MyMod {
+ *      // Populate this field with the instance of the mod created by FML
+ *      {@literal @}Instance("MyModId")
+ *      public MyMod instance;
+ *
+ *      // Mark this method for receiving an {@link FMLEvent} (in this case, it's the {@link FMLPreInitializationEvent})
+ *      {@literal @}EventHandler public void preInit(FMLPreInitializationEvent event)
+ *      {
+ *          // Do stuff in pre-init phase (read config, create blocks and items, register them)
+ *      }
+ * }
+ * }
+ * 
+ * + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Mod +{ + /** + * The unique mod identifier for this mod + */ + String modid(); + /** + * A user friendly name for the mod + */ + String name() default ""; + /** + * A version string for this mod + */ + String version() default ""; + /** + * A simple dependency string for this mod (see modloader's "priorities" string specification) + */ + String dependencies() default ""; + /** + * Whether to use the mcmod.info metadata by default for this mod. + * If true, settings in the mcmod.info file will override settings in these annotations. + */ + boolean useMetadata() default false; + + /** + * The acceptable range of minecraft versions that this mod will load and run in + * The default ("empty string") indicates that only the current minecraft version is acceptable. + * FML will refuse to run with an error if the minecraft version is not in this range across all mods. + * @return A version range as specified by the maven version range specification or the empty string + */ + String acceptedMinecraftVersions() default ""; + /** + * A replacement for the no-longer-existing "versionRange" of NetworkMod. Specify a remote version range + * that this mod will accept as valid. Defaults to nothing, which is interpreted as "only this version". + * Another special value is '*' which means accept all versions. + * + * This is ignored if there is a {@link NetworkCheckHandler} annotation on a method in this class. + * + * @return A version range as specified by the maven version range specification or the empty string + */ + String acceptableRemoteVersions() default ""; + + /** + * A version range specifying compatible save version information. If your mod follows good version numbering + * practice Like this (http://semver.org/) then this should be sufficient. + * + * Advanced users can specify a {@link SaveInspectionHandler} instead. + * @return A version range as specified by the maven version range specification or the empty string + */ + String acceptableSaveVersions() default ""; + /** + * An optional bukkit plugin that will be injected into the bukkit plugin framework if + * this mod is loaded into the FML framework and the bukkit coremod is present. + * Instances of the bukkit plugin can be obtained via the {@link BukkitPluginRef} annotation on fields. + * + * This may be implemented by a bukkit integration. It is not provided with vanilla FML or MinecraftForge. + * + * @return The name of the plugin to load for this mod + */ + String bukkitPlugin() default ""; + /** + * Specifying this field allows for a mod to expect a signed jar with a fingerprint matching this value. + * The fingerprint should be SHA-1 encoded, lowercase with ':' removed. An empty value indicates that + * the mod is not expecting to be signed. + * + * Any incorrectness of the fingerprint, be it missing or wrong, will result in the {@link FMLFingerprintViolationEvent} + * event firing prior to any other event on the mod. + * + * @return A certificate fingerprint that is expected for this mod. + */ + String certificateFingerprint() default ""; + + /** + * The language the mod is authored in. This will be used to control certain compatibility behaviours for this mod. + * Valid values are currently "java", "scala" + * + * @return The language the mod is authored in + */ + String modLanguage() default "java"; + + /** + * The language adapter to be used to load this mod. This overrides the value of modLanguage. The class must have a + * public zero variable constructor and implement {@link ILanguageAdapter} just like the Java and Scala adapters. + * + * A class with an invalid constructor or that doesn't implement {@link ILanguageAdapter} will throw an exception and + * halt loading. + * + * @return The full class name of the language adapter + */ + String modLanguageAdapter() default ""; + + /** + * NOT YET IMPLEMENTED.
+ * An optional ASM hook class, that can be used to apply ASM to classes loaded from this mod. It is also given + * the ASM tree of the class declaring {@link Mod} to do with what it will. + * + * @return The name of a class to be loaded and executed. Must implement {@link IASMHook}. + */ + @Deprecated + String asmHookClass() default ""; + + /** + * If your mod doesn't have a runtime persistent effect on the state of the game, and can be disabled without side effects + * (minimap mods, graphical tweak mods) then you can set true here and receive the FMLDeactivationEvent to perform deactivation + * tasks. + * This does not affect administrative disabling through the system property fml.modStates or the config file fmlModState.properties. + * The mod will only be deactivated outside of a running game world - FML will never allow mod deactivation whilst a game server + * is running. + * + * @return if this mod can be deactivated whilst the game is open. + */ + boolean canBeDeactivated() default false; + + /** + * An optional GUI factory for this mod. This is the name of a class implementing {@link IModGuiFactory} that will be instantiated + * on the client side, and will have certain configuration/options guis requested from it. + * + * @return The name of a class implementing {@link IModGuiFactory} + */ + String guiFactory() default ""; + /** + * A list of custom properties for this mod. Completely up to the mod author if/when they + * want to put anything in here. + * @return an optional list of custom properties + */ + CustomProperty[] customProperties() default {}; + + /** + * A custom key => value property pair for use with {@link Mod#customProperties()} + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({}) + public @interface CustomProperty + { + /** + * A key. Should be unique. + * @return A key + */ + String k(); + /** + * A value. Can be anything. + * @return A value + */ + String v(); + } + /** + * Marks the associated method as handling an FML lifecycle event. + * The method must have a single parameter, one of the following types. This annotation + * replaces the multiple different annotations that previously were used. + * + * Current event classes. This first section is standard lifecycle events. They are dispatched + * at various phases as the game starts. Each event should have information useful to that + * phase of the lifecycle. They are fired in this order. + * + * These suggestions are mostly just suggestions on what to do in each event. + *
    + *
  • {@link FMLPreInitializationEvent} : Run before anything else. Read your config, create blocks, + * items, etc, and register them with the {@link GameRegistry}.
  • + *
  • {@link FMLInitializationEvent} : Do your mod setup. Build whatever data structures you care about. Register recipes, + * send {@link FMLInterModComms} messages to other mods.
  • + *
  • {@link FMLPostInitializationEvent} : Handle interaction with other mods, complete your setup based on this.
  • + *
+ *

These are the server lifecycle events. They are fired whenever a server is running, or about to run. Each time a server + * starts they will be fired in this sequence. + *

    + *
  • {@link FMLServerAboutToStartEvent} : Use if you need to handle something before the server has even been created.
  • + *
  • {@link FMLServerStartingEvent} : Do stuff you need to do to set up the server. register commands, tweak the server.
  • + *
  • {@link FMLServerStartedEvent} : Do what you need to with the running server.
  • + *
  • {@link FMLServerStoppingEvent} : Do what you need to before the server has started it's shutdown sequence.
  • + *
  • {@link FMLServerStoppedEvent} : Do whatever cleanup you need once the server has shutdown. Generally only useful + * on the integrated server.
  • + *
+ * The second set of events are more specialized, for receiving notification of specific + * information. + *
    + *
  • {@link FMLFingerprintViolationEvent} : Sent just before {@link FMLPreInitializationEvent} + * if something is wrong with your mod signature
  • + *
  • {@link IMCEvent} : Sent just after {@link FMLInitializationEvent} if you have IMC messages waiting + * from other mods
  • + *
+ * + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + public @interface EventHandler{} + + /** + * Populate the annotated field with the mod instance based on the specified ModId. This can be used + * to retrieve instances of other mods. + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + public @interface Instance { + /** + * The mod object to inject into this field + */ + String value() default ""; + } + /** + * Populate the annotated field with the mod's metadata. + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + public @interface Metadata { + /** + * The mod id specifying the metadata to load here + */ + String value() default ""; + } + + /** + * Mod instance factory method. Should return an instance of the mod. Applies only to static methods on the same class as {@link Mod}. + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + public @interface InstanceFactory { + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModAPIManager.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModAPIManager.java new file mode 100644 index 0000000..8af9972 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModAPIManager.java @@ -0,0 +1,233 @@ +package cpw.mods.fml.common; + +import java.io.File; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.asm.transformers.ModAPITransformer; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.common.discovery.ModCandidate; +import cpw.mods.fml.common.discovery.ModDiscoverer; +import cpw.mods.fml.common.functions.ModIdFunction; +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import cpw.mods.fml.common.versioning.VersionParser; + +public class ModAPIManager { + public static final ModAPIManager INSTANCE = new ModAPIManager(); + @SuppressWarnings("unused") + private ModAPITransformer transformer; + private ASMDataTable dataTable; + private Map apiContainers; + + private static class APIContainer extends DummyModContainer { + private List referredMods; + private ArtifactVersion ownerMod; + private ArtifactVersion ourVersion; + private String providedAPI; + private File source; + private String version; + private Set currentReferents; + private Set packages; + private boolean selfReferenced; + + public APIContainer(String providedAPI, String apiVersion, File source, ArtifactVersion ownerMod) + { + this.providedAPI = providedAPI; + this.version = apiVersion; + this.ownerMod = ownerMod; + this.ourVersion = new DefaultArtifactVersion(providedAPI, apiVersion); + this.referredMods = Lists.newArrayList(); + this.source = source; + this.currentReferents = Sets.newHashSet(); + this.packages = Sets.newHashSet(); + } + + @Override + public File getSource() + { + return source; + } + @Override + public String getVersion() + { + return version; + } + @Override + public String getName() + { + return "API: "+providedAPI; + } + @Override + public String getModId() + { + return providedAPI; + } + @Override + public List getDependants() + { + return referredMods; + } + + @Override + public List getDependencies() + { + return selfReferenced ? ImmutableList.of() : ImmutableList.of(ownerMod); + } + + @Override + public ArtifactVersion getProcessedVersion() + { + return ourVersion; + } + + public void validate(String providedAPI, String apiOwner, String apiVersion) + { + // TODO Compare this annotation data to the one we first found. Maybe barf if there is inconsistency? + } + + @Override + public String toString() + { + return "APIContainer{"+providedAPI+":"+version+"}"; + } + + public void addAPIReference(String embedded) + { + if (currentReferents.add(embedded)) + { + referredMods.add(VersionParser.parseVersionReference(embedded)); + } + } + + public void addOwnedPackage(String apiPackage) + { + packages.add(apiPackage); + } + + public void addAPIReferences(List candidateIds) + { + for (String modId : candidateIds) + { + addAPIReference(modId); + } + } + + void markSelfReferenced() + { + selfReferenced = true; + } + } + public void registerDataTableAndParseAPI(ASMDataTable dataTable) + { + this.dataTable = dataTable; + + Set apiList = dataTable.getAll("cpw.mods.fml.common.API"); + + apiContainers = Maps.newHashMap(); + + for (ASMData data : apiList) + { + Map annotationInfo = data.getAnnotationInfo(); + String apiPackage = data.getClassName().substring(0,data.getClassName().indexOf(".package-info")); + String providedAPI = (String) annotationInfo.get("provides"); + String apiOwner = (String) annotationInfo.get("owner"); + String apiVersion = (String) annotationInfo.get("apiVersion"); + APIContainer container = apiContainers.get(providedAPI); + if (container == null) + { + container = new APIContainer(providedAPI, apiVersion, data.getCandidate().getModContainer(), VersionParser.parseVersionReference(apiOwner)); + apiContainers.put(providedAPI, container); + } + else + { + container.validate(providedAPI, apiOwner, apiVersion); + } + container.addOwnedPackage(apiPackage); + for (ModContainer mc : data.getCandidate().getContainedMods()) + { + String embeddedIn = mc.getModId(); + if (container.currentReferents.contains(embeddedIn)) + { + continue; + } + FMLLog.fine("Found API %s (owned by %s providing %s) embedded in %s",apiPackage, apiOwner, providedAPI, embeddedIn); + if (!embeddedIn.equals(apiOwner)) + { + container.addAPIReference(embeddedIn); + } + } + } + + for (APIContainer container : apiContainers.values()) + { + for (String pkg : container.packages) + { + Set candidates = dataTable.getCandidatesFor(pkg); + for (ModCandidate candidate : candidates) + { + List candidateIds = Lists.transform(candidate.getContainedMods(), new ModIdFunction()); + if (!candidateIds.contains(container.ownerMod.getLabel()) && !container.currentReferents.containsAll(candidateIds)) + { + FMLLog.info("Found mod(s) %s containing declared API package %s (owned by %s) without associated API reference",candidateIds, pkg, container.ownerMod); + container.addAPIReferences(candidateIds); + } + } + } + if (apiContainers.containsKey(container.ownerMod.getLabel())) + { + ArtifactVersion owner = container.ownerMod; + do + { + APIContainer parent = apiContainers.get(owner.getLabel()); + if (parent == container) + { + FMLLog.finer("APIContainer %s is it's own parent. skipping", owner); + container.markSelfReferenced(); + break; + } + FMLLog.finer("Removing upstream parent %s from %s", parent.ownerMod.getLabel(), container); + container.currentReferents.remove(parent.ownerMod.getLabel()); + container.referredMods.remove(parent.ownerMod); + owner = parent.ownerMod; + } + while (apiContainers.containsKey(owner.getLabel())); + } + FMLLog.fine("Creating API container dummy for API %s: owner: %s, dependents: %s", container.providedAPI, container.ownerMod, container.referredMods); + } + } + + public void manageAPI(ModClassLoader modClassLoader, ModDiscoverer discoverer) + { + registerDataTableAndParseAPI(discoverer.getASMTable()); + transformer = modClassLoader.addModAPITransformer(dataTable); + } + + public void injectAPIModContainers(List mods, Map nameLookup) + { + mods.addAll(apiContainers.values()); + nameLookup.putAll(apiContainers); + } + + public void cleanupAPIContainers(List mods) + { + mods.removeAll(apiContainers.values()); + } + + public boolean hasAPI(String modId) + { + return apiContainers.containsKey(modId); + } + + public Iterable getAPIList() + { + return apiContainers.values(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModClassLoader.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModClassLoader.java new file mode 100644 index 0000000..1e60674 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModClassLoader.java @@ -0,0 +1,97 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.List; +import java.util.Set; +import org.apache.logging.log4j.Level; + +import net.minecraft.launchwrapper.IClassTransformer; +import net.minecraft.launchwrapper.LaunchClassLoader; + +import com.google.common.collect.ImmutableList; + +import cpw.mods.fml.common.asm.transformers.ModAPITransformer; +import cpw.mods.fml.common.discovery.ASMDataTable; + +/** + * A simple delegating class loader used to load mods into the system + * + * + * @author cpw + * + */ +public class ModClassLoader extends URLClassLoader +{ + private static final List STANDARD_LIBRARIES = ImmutableList.of("jinput.jar", "lwjgl.jar", "lwjgl_util.jar", "rt.jar"); + private LaunchClassLoader mainClassLoader; + + public ModClassLoader(ClassLoader parent) { + super(new URL[0], null); + this.mainClassLoader = (LaunchClassLoader)parent; + } + + public void addFile(File modFile) throws MalformedURLException + { + URL url = modFile.toURI().toURL(); + mainClassLoader.addURL(url); + } + + @Override + public Class loadClass(String name) throws ClassNotFoundException + { + return mainClassLoader.loadClass(name); + } + + public File[] getParentSources() { + List urls=mainClassLoader.getSources(); + File[] sources=new File[urls.size()]; + try + { + for (int i = 0; i getDefaultLibraries() + { + return STANDARD_LIBRARIES; + } + + public void clearNegativeCacheFor(Set classList) + { + mainClassLoader.clearNegativeEntries(classList); + } + + public ModAPITransformer addModAPITransformer(ASMDataTable dataTable) + { + mainClassLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.ModAPITransformer"); + List transformers = mainClassLoader.getTransformers(); + ModAPITransformer modAPI = (ModAPITransformer) transformers.get(transformers.size()-1); + modAPI.initTable(dataTable); + return modAPI; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainer.java new file mode 100644 index 0000000..d57a1be --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainer.java @@ -0,0 +1,150 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.security.cert.Certificate; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.collect.ImmutableMap; +import com.google.common.eventbus.EventBus; + +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.VersionRange; + +/** + * The container that wraps around mods in the system. + *

+ * The philosophy is that individual mod implementation technologies should not + * impact the actual loading and management of mod code. This interface provides + * a mechanism by which we can wrap actual mod code so that the loader and other + * facilities can treat mods at arms length. + *

+ * + * @author cpw + * + */ + +public interface ModContainer +{ + public static enum Disableable { + YES, RESTART, NEVER, DEPENDENCIES; + } + /** + * The globally unique modid for this mod + */ + String getModId(); + + /** + * A human readable name + */ + + String getName(); + + /** + * A human readable version identifier + */ + String getVersion(); + + /** + * The location on the file system which this mod came from + */ + File getSource(); + + /** + * The metadata for this mod + */ + ModMetadata getMetadata(); + + /** + * Attach this mod to it's metadata from the supplied metadata collection + */ + void bindMetadata(MetadataCollection mc); + + /** + * Set the enabled/disabled state of this mod + */ + void setEnabledState(boolean enabled); + + /** + * A list of the modids that this mod requires loaded prior to loading + */ + Set getRequirements(); + + /** + * A list of modids that should be loaded prior to this one. The special + * value * indicates to load after any other mod. + */ + List getDependencies(); + + /** + * A list of modids that should be loaded after this one. The + * special value * indicates to load before any + * other mod. + */ + List getDependants(); + + /** + * A representative string encapsulating the sorting preferences for this + * mod + */ + String getSortingRules(); + + /** + * Register the event bus for the mod and the controller for error handling + * Returns if this bus was successfully registered - disabled mods and other + * mods that don't need real events should return false and avoid further + * processing + * + * @param bus + * @param controller + */ + boolean registerBus(EventBus bus, LoadController controller); + + /** + * Does this mod match the supplied mod + * + * @param mod + */ + boolean matches(Object mod); + + /** + * Get the actual mod object + */ + Object getMod(); + + ArtifactVersion getProcessedVersion(); + + boolean isImmutable(); + + String getDisplayVersion(); + + VersionRange acceptableMinecraftVersionRange(); + + Certificate getSigningCertificate(); + + public static final Map EMPTY_PROPERTIES = ImmutableMap.of(); + Map getCustomModProperties(); + + public Class getCustomResourcePackClass(); + + Map getSharedModDescriptor(); + + Disableable canBeDisabled(); + + String getGuiClassName(); + + List getOwnedPackages(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainerFactory.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainerFactory.java new file mode 100644 index 0000000..34a7407 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModContainerFactory.java @@ -0,0 +1,89 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.io.File; +import java.lang.reflect.Constructor; +import java.util.Map; +import java.util.regex.Pattern; + +import org.apache.logging.log4j.Level; +import org.objectweb.asm.Type; + +import com.google.common.base.Throwables; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.discovery.ModCandidate; +import cpw.mods.fml.common.discovery.asm.ASMModParser; +import cpw.mods.fml.common.discovery.asm.ModAnnotation; + +public class ModContainerFactory +{ + public static Map> modTypes = Maps.newHashMap(); + private static Pattern modClass = Pattern.compile(".*(\\.|)(mod\\_[^\\s$]+)$"); + private static ModContainerFactory INSTANCE = new ModContainerFactory(); + + private ModContainerFactory() { + // We always know about Mod type + registerContainerType(Type.getType(Mod.class), FMLModContainer.class); + } + public static ModContainerFactory instance() { + return INSTANCE; + } + + public void registerContainerType(Type type, Class container) + { + try { + Constructor constructor = container.getConstructor(new Class[] { String.class, ModCandidate.class, Map.class }); + modTypes.put(type, constructor); + } catch (Exception e) { + FMLLog.log(Level.ERROR, e, "Critical error : cannot register mod container type %s, it has an invalid constructor"); + Throwables.propagate(e); + } + } + public ModContainer build(ASMModParser modParser, File modSource, ModCandidate container) + { + String className = modParser.getASMType().getClassName(); + if (modParser.isBaseMod(container.getRememberedBaseMods()) && modClass.matcher(className).find()) + { + FMLLog.severe("Found a BaseMod type mod %s", className); + FMLLog.severe("This will not be loaded and will be ignored. ModLoader mechanisms are no longer available."); + } + else if (modClass.matcher(className).find()) + { + FMLLog.fine("Identified a class %s following modloader naming convention but not directly a BaseMod or currently seen subclass", className); + container.rememberModCandidateType(modParser); + } + else if (modParser.isBaseMod(container.getRememberedBaseMods())) + { + FMLLog.fine("Found a basemod %s of non-standard naming format", className); + container.rememberBaseModType(className); + } + + for (ModAnnotation ann : modParser.getAnnotations()) + { + if (modTypes.containsKey(ann.getASMType())) + { + FMLLog.fine("Identified a mod of type %s (%s) - loading", ann.getASMType(), className); + try { + return modTypes.get(ann.getASMType()).newInstance(className, container, ann.getValues()); + } catch (Exception e) { + FMLLog.log(Level.ERROR, e, "Unable to construct %s container", ann.getASMType().getClassName()); + return null; + } + } + } + + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModMetadata.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModMetadata.java new file mode 100644 index 0000000..705fac3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ModMetadata.java @@ -0,0 +1,82 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.util.List; +import java.util.Set; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import com.google.gson.annotations.SerializedName; + +import cpw.mods.fml.common.functions.ModNameFunction; +import cpw.mods.fml.common.versioning.ArtifactVersion; + +/** + * @author cpw + * + */ +public class ModMetadata +{ + @SerializedName("modid") + public String modId; + public String name; + public String description = ""; + + public String url = ""; + public String updateUrl = ""; + + public String logoFile = ""; + public String version = ""; + public List authorList = Lists.newArrayList(); + public String credits = ""; + public String parent = ""; + public String[] screenshots; + + // this field is not for use in the json + public transient ModContainer parentMod; + // this field is not for use in the json + public transient List childMods = Lists.newArrayList(); + + public boolean useDependencyInformation; + public Set requiredMods = Sets.newHashSet(); + public List dependencies = Lists.newArrayList(); + public List dependants = Lists.newArrayList(); + // this field is not for use in the json + public transient boolean autogenerated; + + public ModMetadata() + { + } + + public String getChildModCountString() + { + return String.format("%d child mod%s", childMods.size(), childMods.size() != 1 ? "s" : ""); + } + + public String getAuthorList() + { + return Joiner.on(", ").join(authorList); + } + + public String getChildModList() + { + return Joiner.on(", ").join(Lists.transform(childMods, new ModNameFunction())); + } + + public String printableSortingRules() + { + return ""; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java new file mode 100644 index 0000000..c68e4d2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java @@ -0,0 +1,104 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.common; + +import java.util.Arrays; +import org.apache.logging.log4j.Level; + +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.ReflectionHelper.UnableToAccessFieldException; +import cpw.mods.fml.relauncher.ReflectionHelper.UnableToFindFieldException; + +/** + * Some reflection helper code. + * + * @author cpw + * + */ +public class ObfuscationReflectionHelper +{ + public static T getPrivateValue(Class classToAccess, E instance, int fieldIndex) + { + try + { + return ReflectionHelper.getPrivateValue(classToAccess, instance, fieldIndex); + } + catch (UnableToAccessFieldException e) + { + FMLLog.log(Level.ERROR, e, "There was a problem getting field index %d from %s", fieldIndex, classToAccess.getName()); + throw e; + } + } + + public static String[] remapFieldNames(String className, String... fieldNames) + { + String internalClassName = FMLDeobfuscatingRemapper.INSTANCE.unmap(className.replace('.', '/')); + String[] mappedNames = new String[fieldNames.length]; + int i = 0; + for (String fName : fieldNames) + { + mappedNames[i++] = FMLDeobfuscatingRemapper.INSTANCE.mapFieldName(internalClassName, fName, null); + } + return mappedNames; + } + + public static T getPrivateValue(Class classToAccess, E instance, String... fieldNames) + { + try + { + return ReflectionHelper.getPrivateValue(classToAccess, instance, remapFieldNames(classToAccess.getName(),fieldNames)); + } + catch (UnableToFindFieldException e) + { + FMLLog.log(Level.ERROR,e,"Unable to locate any field %s on type %s", Arrays.toString(fieldNames), classToAccess.getName()); + throw e; + } + catch (UnableToAccessFieldException e) + { + FMLLog.log(Level.ERROR, e, "Unable to access any field %s on type %s", Arrays.toString(fieldNames), classToAccess.getName()); + throw e; + } + } + + public static void setPrivateValue(Class classToAccess, T instance, E value, int fieldIndex) + { + try + { + ReflectionHelper.setPrivateValue(classToAccess, instance, value, fieldIndex); + } + catch (UnableToAccessFieldException e) + { + FMLLog.log(Level.ERROR, e, "There was a problem setting field index %d on type %s", fieldIndex, classToAccess.getName()); + throw e; + } + } + + public static void setPrivateValue(Class classToAccess, T instance, E value, String... fieldNames) + { + try + { + ReflectionHelper.setPrivateValue(classToAccess, instance, value, remapFieldNames(classToAccess.getName(), fieldNames)); + } + catch (UnableToFindFieldException e) + { + FMLLog.log(Level.ERROR, e, "Unable to locate any field %s on type %s", Arrays.toString(fieldNames), classToAccess.getName()); + throw e; + } + catch (UnableToAccessFieldException e) + { + FMLLog.log(Level.ERROR, e, "Unable to set any field %s on type %s", Arrays.toString(fieldNames), classToAccess.getName()); + throw e; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/Optional.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Optional.java new file mode 100644 index 0000000..31facb3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/Optional.java @@ -0,0 +1,76 @@ +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Classes annotated with this will have the named interface or method removed from the runtime definition of the class + * if the modid specified is missing. + * + * @author cpw + * + */ +public final class Optional { + /** + * Not constructable + */ + private Optional() {} + + /** + * Mark a list of interfaces as removable + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface InterfaceList { + /** + * Mark a list of interfaces for optional removal. + * @return + */ + public Interface[] value(); + } + /** + * Used to remove optional interfaces + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface Interface { + /** + * The fully qualified name of the interface to be stripped + * @return the interface name + */ + public String iface(); + + /** + * The modid that is required to be present for stripping NOT to occur + * @return the modid + */ + public String modid(); + + /** + * Strip references to this interface in method declarations? (Useful to kill synthetic methods from scala f.e.) + * + * @return if references should be stripped + */ + public boolean striprefs() default false; + } + /** + * Used to remove optional methods + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + public @interface Method { + /** + * The modid that is required to be present for stripping NOT to occur + * @return the modid + */ + public String modid(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProgressManager.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProgressManager.java new file mode 100644 index 0000000..9706304 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProgressManager.java @@ -0,0 +1,134 @@ +package cpw.mods.fml.common; + +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import com.google.common.base.Joiner; + +/** + * @deprecated not a stable API, will break, don't use this yet + */ +@Deprecated +public class ProgressManager +{ + private static final List bars = new CopyOnWriteArrayList(); + + /** + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static ProgressBar push(String title, int steps) + { + return push(title, steps, false); + } + /** + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static ProgressBar push(String title, int steps, boolean timeEachStep) + { + ProgressBar bar = new ProgressBar(title, steps); + bars.add(bar); + if (timeEachStep) + { + bar.timeEachStep(); + } + FMLCommonHandler.instance().processWindowMessages(); + return bar; + } + + /** + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static void pop(ProgressBar bar) + { + if(bar.getSteps() != bar.getStep()) throw new IllegalStateException("can't pop unfinished ProgressBar " + bar.getTitle()); + bars.remove(bar); + if (bar.getSteps() != 0) + { + long newTime = System.nanoTime(); + if (bar.timeEachStep) + FMLLog.fine("Bar Step: %s - %s took %.3fs", bar.getTitle(), bar.getMessage(), ((float)(newTime - bar.lastTime) / 1000000 / 1000)); + if (bar.getSteps() == 1) + FMLLog.fine("Bar Finished: %s - %s took %.3fs", bar.getTitle(), bar.getMessage(), ((float)(newTime - bar.startTime) / 1000000 / 1000)); + else + FMLLog.fine("Bar Finished: %s took %.3fs", bar.getTitle(), ((float)(newTime - bar.startTime) / 1000000 / 1000)); + } + FMLCommonHandler.instance().processWindowMessages(); + } + + /* + * Internal use only. + */ + public static Iterator barIterator() + { + return bars.iterator(); + } + + /** + * @deprecated not a stable API, will break, don't use this yet + */ + @Deprecated + public static class ProgressBar + { + private final String title; + private final int steps; + private volatile int step = 0; + private volatile String message = ""; + private boolean timeEachStep = false; + private long startTime = System.nanoTime(); + private long lastTime = startTime; + + private ProgressBar(String title, int steps) + { + this.title = title; + this.steps = steps; + } + + public void step(Class classToName, String... extra) + { + step(ClassNameUtils.shortName(classToName)+Joiner.on(' ').join(extra)); + } + + public void step(String message) + { + if(step >= steps) throw new IllegalStateException("too much steps for ProgressBar " + title); + if (timeEachStep && step != 0) + { + long newTime = System.nanoTime(); + FMLLog.fine("Bar Step: %s - %s took %.3fs", getTitle(), getMessage(), ((float)(newTime - lastTime) / 1000000 / 1000)); + lastTime = newTime; + } + step++; + this.message = FMLCommonHandler.instance().stripSpecialChars(message); + FMLCommonHandler.instance().processWindowMessages(); + } + + public String getTitle() + { + return title; + } + + public int getSteps() + { + return steps; + } + + public int getStep() + { + return step; + } + + public String getMessage() + { + return message; + } + + public void timeEachStep() + { + this.timeEachStep = true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProxyInjector.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProxyInjector.java new file mode 100644 index 0000000..a029169 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ProxyInjector.java @@ -0,0 +1,83 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Set; +import org.apache.logging.log4j.Level; + +import com.google.common.base.Strings; + +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.relauncher.Side; + +/** + * @author cpw + * + */ +public class ProxyInjector +{ + public static void inject(ModContainer mod, ASMDataTable data, Side side, ILanguageAdapter languageAdapter) + { + FMLLog.fine("Attempting to inject @SidedProxy classes into %s", mod.getModId()); + Set targets = data.getAnnotationsFor(mod).get(SidedProxy.class.getName()); + ClassLoader mcl = Loader.instance().getModClassLoader(); + + for (ASMData targ : targets) + { + try + { + Class proxyTarget = Class.forName(targ.getClassName(), true, mcl); + Field target = proxyTarget.getDeclaredField(targ.getObjectName()); + if (target == null) + { + // Impossible? + FMLLog.severe("Attempted to load a proxy type into %s.%s but the field was not found", targ.getClassName(), targ.getObjectName()); + throw new LoaderException(String.format("Attempted to load a proxy type into %s.%s but the field was not found", targ.getClassName(), targ.getObjectName())); + } + target.setAccessible(true); + + SidedProxy annotation = target.getAnnotation(SidedProxy.class); + if (!Strings.isNullOrEmpty(annotation.modId()) && !annotation.modId().equals(mod.getModId())) + { + FMLLog.fine("Skipping proxy injection for %s.%s since it is not for mod %s", targ.getClassName(), targ.getObjectName(), mod.getModId()); + continue; + } + String targetType = side.isClient() ? annotation.clientSide() : annotation.serverSide(); + Object proxy=Class.forName(targetType, true, mcl).newInstance(); + + if (languageAdapter.supportsStatics() && (target.getModifiers() & Modifier.STATIC) == 0 ) + { + FMLLog.severe("Attempted to load a proxy type %s into %s.%s, but the field is not static", targetType, targ.getClassName(), targ.getObjectName()); + throw new LoaderException(String.format("Attempted to load a proxy type %s into %s.%s, but the field is not static", targetType, targ.getClassName(), targ.getObjectName())); + } + if (!target.getType().isAssignableFrom(proxy.getClass())) + { + FMLLog.severe("Attempted to load a proxy type %s into %s.%s, but the types don't match", targetType, targ.getClassName(), targ.getObjectName()); + throw new LoaderException(String.format("Attempted to load a proxy type %s into %s.%s, but the types don't match", targetType, targ.getClassName(), targ.getObjectName())); + } + languageAdapter.setProxy(target, proxyTarget, proxy); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "An error occured trying to load a proxy into %s.%s", targ.getAnnotationInfo(), targ.getClassName(), targ.getObjectName()); + throw new LoaderException(e); + } + } + + // Allow language specific proxy injection. + languageAdapter.setInternalProxies(mod, side, mcl); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/SaveInspectionHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/SaveInspectionHandler.java new file mode 100644 index 0000000..44ec0b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/SaveInspectionHandler.java @@ -0,0 +1,20 @@ +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * A method annotated with this on the {@link Mod} will be called whenever a local save is listed in + * the save games list. + * + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface SaveInspectionHandler +{ + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/SidedProxy.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/SidedProxy.java new file mode 100644 index 0000000..41bdaaa --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/SidedProxy.java @@ -0,0 +1,68 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Sided proxies are loaded based on the specific environment they find themselves loaded into. + * They are used to ensure that client-specific code (such as GUIs) is only loaded into the game + * on the client side. + * It is applied to static fields of a class, anywhere in your mod code. FML will scan + * and load any classes with this annotation at mod construction time. + * + *

+ * This example will load a CommonProxy on the server side, and a ClientProxy on the client side. + * + *

{@code
+ *  public class MySidedProxyHolder {
+ *      {@literal @}SidedProxy(modId="MyModId",clientSide="mymod.ClientProxy", serverSide="mymod.CommonProxy")
+ *      public static CommonProxy proxy;
+ *  }
+ *
+ *  public class CommonProxy {
+ *      // Common or server stuff here that needs to be overridden on the client
+ *  }
+ *
+ *  public class ClientProxy extends CommonProxy {
+ *      // Override common stuff with client specific stuff here
+ *  }
+ * }
+ * 
+ * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface SidedProxy +{ + /** + * The name of the client side class to load and populate + */ + String clientSide() default ""; + + /** + * The name of the server side class to load and populate + */ + String serverSide() default ""; + + /** + * The (optional) name of a mod to load this proxy for. This will help ensure correct behaviour when loading a combined + * scala/java mod package. It is almost never going to be required, unless you ship both Scala and Java {@link Mod} content + * in a single jar. + */ + String modId() default ""; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/StartupQuery.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/StartupQuery.java new file mode 100644 index 0000000..d5490e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/StartupQuery.java @@ -0,0 +1,160 @@ +package cpw.mods.fml.common; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; + +import net.minecraft.server.MinecraftServer; + +public class StartupQuery { + // internal class/functionality, do not use + + public static boolean confirm(String text) + { + StartupQuery query = new StartupQuery(text, new AtomicBoolean()); + query.execute(); + return query.getResult(); + } + + public static void notify(String text) + { + StartupQuery query = new StartupQuery(text, null); + query.execute(); + } + + public static void abort() + { + MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance(); + if (server != null) server.initiateShutdown(); + + aborted = true; // to abort loading and go back to the main menu + throw new AbortedException(); // to halt the server + } + + + public static void reset() + { + pending = null; + aborted = false; + } + + public static boolean check() + { + if (pending != null) + { + try + { + FMLCommonHandler.instance().queryUser(pending); + } + catch (InterruptedException e) + { + FMLLog.warning("query interrupted"); + abort(); + } + + pending = null; + } + + return !aborted; + } + + private static volatile StartupQuery pending; + private static volatile boolean aborted = false; + + + private StartupQuery(String text, AtomicBoolean result) + { + this.text = text; + this.result = result; + } + + public Boolean getResult() + { + return result == null ? null : result.get(); + } + + public void setResult(boolean result) + { + this.result.set(result); + } + + public String getText() + { + return text; + } + + public boolean isSynchronous() + { + return synchronous; + } + + public void finish() + { + signal.countDown(); + } + + private void execute() + { + String prop = System.getProperty("fml.queryResult"); + + if (result != null && prop != null) + { + FMLLog.info("Using fml.queryResult %s to answer the following query:\n%s", prop, text); + + if (prop.equalsIgnoreCase("confirm")) + { + setResult(true); + return; + } + else if (prop.equalsIgnoreCase("cancel")) + { + setResult(false); + return; + } + + FMLLog.warning("Invalid value for fml.queryResult: %s, expected confirm or cancel", prop); + } + + synchronous = false; + pending = this; // let the other thread start the query + + // from the integrated server thread: the client will eventually check pending and execute the query + // from the client thread: synchronous execution + // dedicated server: command handling in mc is synchronous, execute the server-side query directly + if (FMLCommonHandler.instance().getSide().isServer() || + FMLCommonHandler.instance().getEffectiveSide().isClient()) + { + synchronous = true; + check(); + } + + try + { + signal.await(); + reset(); + } + catch (InterruptedException e) + { + FMLLog.warning("query interrupted"); + abort(); + } + } + + private String text; + private AtomicBoolean result; + private CountDownLatch signal = new CountDownLatch(1); + private volatile boolean synchronous; + + + /** + * Exception not being caught by the crash report generation logic. + */ + public static class AbortedException extends RuntimeException + { + private static final long serialVersionUID = -5933665223696833921L; + + private AbortedException() + { + super(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/TracingPrintStream.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/TracingPrintStream.java new file mode 100644 index 0000000..5974e51 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/TracingPrintStream.java @@ -0,0 +1,50 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + */ + +package cpw.mods.fml.common; + +import java.io.PrintStream; + +import org.apache.logging.log4j.Logger; + +/** + * PrintStream which redirects it's output to a given logger. + * + * @author Arkan + */ +public class TracingPrintStream extends PrintStream { + + private Logger logger; + private int BASE_DEPTH = 3; + + public TracingPrintStream(Logger logger, PrintStream original) { + super(original); + this.logger = logger; + } + + @Override + public void println(Object o) { + logger.info(getPrefix() + o); + } + + @Override + public void println(String s) { + logger.info(getPrefix() + s); + } + + private String getPrefix() { + StackTraceElement[] elems = Thread.currentThread().getStackTrace(); + StackTraceElement elem = elems[BASE_DEPTH]; // The caller is always at BASE_DEPTH, including this call. + if (elem.getClassName().startsWith("kotlin.io.")) { + elem = elems[BASE_DEPTH + 2]; // Kotlins IoPackage masks origins 2 deeper in the stack. + } + return "[" + elem.getClassName() + ":" + elem.getMethodName() + ":" + elem.getLineNumber() + "]: "; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/WorldAccessContainer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/WorldAccessContainer.java new file mode 100644 index 0000000..9c9e5a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/WorldAccessContainer.java @@ -0,0 +1,25 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +import java.util.Map; + +import net.minecraft.nbt.*; +import net.minecraft.world.storage.*; + + +public interface WorldAccessContainer +{ + public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info); + public void readData(SaveHandler handler, WorldInfo info, Map propertyMap, NBTTagCompound tag); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/WrongMinecraftVersionException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/WrongMinecraftVersionException.java new file mode 100644 index 0000000..b936d7b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/WrongMinecraftVersionException.java @@ -0,0 +1,25 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common; + +public class WrongMinecraftVersionException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + public ModContainer mod; + + public WrongMinecraftVersionException(ModContainer mod) + { + this.mod = mod; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/ZipperUtil.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ZipperUtil.java new file mode 100644 index 0000000..9c38c85 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/ZipperUtil.java @@ -0,0 +1,92 @@ +package cpw.mods.fml.common; + +import java.io.Closeable; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URI; +import java.util.Deque; +import java.util.LinkedList; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.apache.logging.log4j.Level; + +import com.google.common.io.Files; + +/** + * Copied from http://stackoverflow.com/questions/1399126/java-util-zip-recreating-directory-structure + * because the code looked very tidy and neat. Thanks, McDowell! + * + * @author McDowell + * + */ +public class ZipperUtil { + public static void zip(File directory, File zipfile) throws IOException + { + URI base = directory.toURI(); + Deque queue = new LinkedList(); + queue.push(directory); + OutputStream out = new FileOutputStream(zipfile); + Closeable res = null; + try + { + ZipOutputStream zout = new ZipOutputStream(out); + res = zout; + while (!queue.isEmpty()) + { + directory = queue.pop(); + for (File kid : directory.listFiles()) + { + String name = base.relativize(kid.toURI()).getPath(); + if (kid.isDirectory()) + { + queue.push(kid); + name = name.endsWith("/") ? name : name + "/"; + zout.putNextEntry(new ZipEntry(name)); + } else + { + zout.putNextEntry(new ZipEntry(name)); + Files.copy(kid, zout); + zout.closeEntry(); + } + } + } + } finally + { + res.close(); + } + } + + public static void backupWorld() throws IOException + { + String dirName = FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName(); + + backupWorld(dirName); + } + + @Deprecated + public static void backupWorld(String dirName, String saveName) throws IOException + { + backupWorld(dirName); + } + + public static void backupWorld(String dirName) throws IOException + { + File dstFolder = FMLCommonHandler.instance().getSavesDirectory(); + File zip = new File(dstFolder, String.format("%s-%2$tY%2$tm%2$td-%2$tH%2$tM%2$tS.zip", dirName, System.currentTimeMillis())); + + try + { + ZipperUtil.zip(new File(dstFolder, dirName), zip); + } + catch (IOException e) + { + FMLLog.log(Level.WARN, e, "World backup failed."); + throw e; + } + + FMLLog.info("World backup created at %s.", zip.getCanonicalPath()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/FMLSanityChecker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/FMLSanityChecker.java new file mode 100644 index 0000000..df08d6e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/FMLSanityChecker.java @@ -0,0 +1,185 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm; + +import java.io.File; +import java.io.IOException; +import java.net.URLDecoder; +import java.security.CodeSource; +import java.security.cert.Certificate; +import java.util.Map; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import org.apache.logging.log4j.Level; + +import net.minecraft.launchwrapper.LaunchClassLoader; + +import com.google.common.base.Charsets; +import com.google.common.io.ByteStreams; + +import cpw.mods.fml.common.CertificateHelper; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; +import cpw.mods.fml.common.patcher.ClassPatchManager; +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import cpw.mods.fml.relauncher.IFMLCallHook; +import cpw.mods.fml.relauncher.Side; + +public class FMLSanityChecker implements IFMLCallHook +{ + private static final String FMLFINGERPRINT = "51:0A:FB:4C:AF:A4:A0:F2:F5:CF:C5:0E:B4:CC:3C:30:24:4A:E3:8E".toLowerCase().replace(":", ""); + private static final String FORGEFINGERPRINT = "E3:C3:D5:0C:7C:98:6D:F7:4C:64:5C:0A:C5:46:39:74:1C:90:A5:57".toLowerCase().replace(":", ""); + private static final String MCFINGERPRINT = "CD:99:95:96:56:F7:53:DC:28:D8:63:B4:67:69:F7:F8:FB:AE:FC:FC".toLowerCase().replace(":", ""); + private LaunchClassLoader cl; + private boolean liveEnv; + public static File fmlLocation; + + @Override + public Void call() throws Exception + { + CodeSource codeSource = getClass().getProtectionDomain().getCodeSource(); + boolean goodFML = false; + boolean fmlIsJar = false; + if (codeSource.getLocation().getProtocol().equals("jar")) + { + fmlIsJar = true; + Certificate[] certificates = codeSource.getCertificates(); + if (certificates!=null) + { + + for (Certificate cert : certificates) + { + String fingerprint = CertificateHelper.getFingerprint(cert); + if (fingerprint.equals(FMLFINGERPRINT)) + { + FMLRelaunchLog.info("Found valid fingerprint for FML. Certificate fingerprint %s", fingerprint); + goodFML = true; + } + else if (fingerprint.equals(FORGEFINGERPRINT)) + { + FMLRelaunchLog.info("Found valid fingerprint for Minecraft Forge. Certificate fingerprint %s", fingerprint); + goodFML = true; + } + else + { + FMLRelaunchLog.severe("Found invalid fingerprint for FML: %s", fingerprint); + } + } + } + } + else + { + goodFML = true; + } + // Server is not signed, so assume it's good - a deobf env is dev time so it's good too + boolean goodMC = FMLLaunchHandler.side() == Side.SERVER || !liveEnv; + int certCount = 0; + try + { + Class cbr = Class.forName("net.minecraft.client.ClientBrandRetriever",false, cl); + codeSource = cbr.getProtectionDomain().getCodeSource(); + } + catch (Exception e) + { + // Probably a development environment, or the server (the server is not signed) + goodMC = true; + } + JarFile mcJarFile = null; + if (fmlIsJar && !goodMC && codeSource.getLocation().getProtocol().equals("jar")) + { + try + { + String mcPath = codeSource.getLocation().getPath().substring(5); + mcPath = mcPath.substring(0, mcPath.lastIndexOf('!')); + mcPath = URLDecoder.decode(mcPath, Charsets.UTF_8.name()); + mcJarFile = new JarFile(mcPath,true); + mcJarFile.getManifest(); + JarEntry cbrEntry = mcJarFile.getJarEntry("net/minecraft/client/ClientBrandRetriever.class"); + ByteStreams.toByteArray(mcJarFile.getInputStream(cbrEntry)); + Certificate[] certificates = cbrEntry.getCertificates(); + certCount = certificates != null ? certificates.length : 0; + if (certificates!=null) + { + + for (Certificate cert : certificates) + { + String fingerprint = CertificateHelper.getFingerprint(cert); + if (fingerprint.equals(MCFINGERPRINT)) + { + FMLRelaunchLog.info("Found valid fingerprint for Minecraft. Certificate fingerprint %s", fingerprint); + goodMC = true; + } + } + } + } + catch (Throwable e) + { + FMLRelaunchLog.log(Level.ERROR, e, "A critical error occurred trying to read the minecraft jar file"); + } + finally + { + if (mcJarFile != null) + { + try + { + mcJarFile.close(); + } + catch (IOException ioe) + { + // Noise + } + } + } + } + else + { + goodMC = true; + } + if (!goodMC) + { + FMLRelaunchLog.severe("The minecraft jar %s appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!",codeSource.getLocation().getFile()); + if (!Boolean.parseBoolean(System.getProperty("fml.ignoreInvalidMinecraftCertificates","false"))) + { + FMLRelaunchLog.severe("For your safety, FML will not launch minecraft. You will need to fetch a clean version of the minecraft jar file"); + FMLRelaunchLog.severe("Technical information: The class net.minecraft.client.ClientBrandRetriever should have been associated with the minecraft jar file, " + + "and should have returned us a valid, intact minecraft jar location. This did not work. Either you have modified the minecraft jar file (if so " + + "run the forge installer again), or you are using a base editing jar that is changing this class (and likely others too). If you REALLY " + + "want to run minecraft in this configuration, add the flag -Dfml.ignoreInvalidMinecraftCertificates=true to the 'JVM settings' in your launcher profile."); + FMLCommonHandler.instance().exitJava(1, false); + } + else + { + FMLRelaunchLog.severe("FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!"); + FMLRelaunchLog.severe("Technical information: ClientBrandRetriever was at %s, there were %d certificates for it", codeSource.getLocation(), certCount); + } + } + if (!goodFML) + { + FMLRelaunchLog.severe("FML appears to be missing any signature data. This is not a good thing"); + } + return null; + } + + @Override + public void injectData(Map data) + { + liveEnv = (Boolean)data.get("runtimeDeobfuscationEnabled"); + cl = (LaunchClassLoader) data.get("classLoader"); + File mcDir = (File)data.get("mcLocation"); + fmlLocation = (File)data.get("coremodLocation"); + ClassPatchManager.INSTANCE.setup(FMLLaunchHandler.side()); + FMLDeobfuscatingRemapper.INSTANCE.setup(mcDir, cl, (String) data.get("deobfuscationFileName")); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/ReobfuscationMarker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/ReobfuscationMarker.java new file mode 100644 index 0000000..2824486 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/ReobfuscationMarker.java @@ -0,0 +1,29 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used to force certain classes to reobfuscate + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface ReobfuscationMarker { + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java new file mode 100644 index 0000000..5357623 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java @@ -0,0 +1,497 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers; + +import static org.objectweb.asm.Opcodes.ACC_FINAL; +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import com.google.common.io.CharSource; +import com.google.common.io.LineProcessor; +import com.google.common.io.Resources; + +import cpw.mods.fml.relauncher.FMLRelaunchLog; + +public class AccessTransformer implements IClassTransformer +{ + private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugAccessTransformer", "false")); + class Modifier + { + public String name = ""; + public String desc = ""; + public int oldAccess = 0; + public int newAccess = 0; + public int targetAccess = 0; + public boolean changeFinal = false; + public boolean markFinal = false; + protected boolean modifyClassVisibility; + + private void setTargetAccess(String name) + { + if (name.startsWith("public")) targetAccess = ACC_PUBLIC; + else if (name.startsWith("private")) targetAccess = ACC_PRIVATE; + else if (name.startsWith("protected")) targetAccess = ACC_PROTECTED; + + if (name.endsWith("-f")) + { + changeFinal = true; + markFinal = false; + } + else if (name.endsWith("+f")) + { + changeFinal = true; + markFinal = true; + } + } + } + + private Multimap modifiers = ArrayListMultimap.create(); + + public AccessTransformer() throws IOException + { + this("fml_at.cfg"); + } + protected AccessTransformer(String rulesFile) throws IOException + { + readMapFile(rulesFile); + } + + AccessTransformer(Class dummyClazz) + { + // This is a noop + } + void readMapFile(String rulesFile) throws IOException + { + File file = new File(rulesFile); + URL rulesResource; + if (file.exists()) + { + rulesResource = file.toURI().toURL(); + } + else + { + rulesResource = Resources.getResource(rulesFile); + } + processATFile(Resources.asCharSource(rulesResource, Charsets.UTF_8)); + FMLRelaunchLog.fine("Loaded %d rules from AccessTransformer config file %s", modifiers.size(), rulesFile); + } + protected void processATFile(CharSource rulesResource) throws IOException + { + rulesResource.readLines(new LineProcessor() + { + @Override + public Void getResult() + { + return null; + } + + @Override + public boolean processLine(String input) throws IOException + { + String line = Iterables.getFirst(Splitter.on('#').limit(2).split(input), "").trim(); + if (line.length()==0) + { + return true; + } + List parts = Lists.newArrayList(Splitter.on(" ").trimResults().split(line)); + if (parts.size()>3) + { + throw new RuntimeException("Invalid config file line "+ input); + } + Modifier m = new Modifier(); + m.setTargetAccess(parts.get(0)); + + if (parts.size() == 2) + { + m.modifyClassVisibility = true; + } + else + { + String nameReference = parts.get(2); + int parenIdx = nameReference.indexOf('('); + if (parenIdx>0) + { + m.desc = nameReference.substring(parenIdx); + m.name = nameReference.substring(0,parenIdx); + } + else + { + m.name = nameReference; + } + } + String className = parts.get(1).replace('/', '.'); + modifiers.put(className, m); + if (DEBUG) System.out.printf("AT RULE: %s %s %s (type %s)\n", toBinary(m.targetAccess), m.name, m.desc, className); + return true; + } + }); + } + + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + if (bytes == null) { return null; } + + if (DEBUG) + { + FMLRelaunchLog.fine("Considering all methods and fields on %s (%s)\n", transformedName, name); + } + if (!modifiers.containsKey(transformedName)) { return bytes; } + + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + Collection mods = modifiers.get(transformedName); + for (Modifier m : mods) + { + if (m.modifyClassVisibility) + { + classNode.access = getFixedAccess(classNode.access, m); + if (DEBUG) + { + System.out.println(String.format("Class: %s %s -> %s", name, toBinary(m.oldAccess), toBinary(m.newAccess))); + } + continue; + } + if (m.desc.isEmpty()) + { + for (FieldNode n : classNode.fields) + { + if (n.name.equals(m.name) || m.name.equals("*")) + { + n.access = getFixedAccess(n.access, m); + if (DEBUG) + { + System.out.println(String.format("Field: %s.%s %s -> %s", name, n.name, toBinary(m.oldAccess), toBinary(m.newAccess))); + } + + if (!m.name.equals("*")) + { + break; + } + } + } + } + else + { + List nowOverridable = Lists.newArrayList(); + for (MethodNode n : classNode.methods) + { + if ((n.name.equals(m.name) && n.desc.equals(m.desc)) || m.name.equals("*")) + { + n.access = getFixedAccess(n.access, m); + + // constructors always use INVOKESPECIAL + if (!n.name.equals("")) + { + // if we changed from private to something else we need to replace all INVOKESPECIAL calls to this method with INVOKEVIRTUAL + // so that overridden methods will be called. Only need to scan this class, because obviously the method was private. + boolean wasPrivate = (m.oldAccess & ACC_PRIVATE) == ACC_PRIVATE; + boolean isNowPrivate = (m.newAccess & ACC_PRIVATE) == ACC_PRIVATE; + + if (wasPrivate && !isNowPrivate) + { + nowOverridable.add(n); + } + + } + + if (DEBUG) + { + System.out.println(String.format("Method: %s.%s%s %s -> %s", name, n.name, n.desc, toBinary(m.oldAccess), toBinary(m.newAccess))); + } + + if (!m.name.equals("*")) + { + break; + } + } + } + + replaceInvokeSpecial(classNode, nowOverridable); + } + } + + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + + private void replaceInvokeSpecial(ClassNode clazz, List toReplace) + { + for (MethodNode method : clazz.methods) + { + for (Iterator it = method.instructions.iterator(); it.hasNext();) + { + AbstractInsnNode insn = it.next(); + if (insn.getOpcode() == INVOKESPECIAL) + { + MethodInsnNode mInsn = (MethodInsnNode) insn; + for (MethodNode n : toReplace) + { + if (n.name.equals(mInsn.name) && n.desc.equals(mInsn.desc)) + { + mInsn.setOpcode(INVOKEVIRTUAL); + break; + } + } + } + } + } + } + + private String toBinary(int num) + { + return String.format("%16s", Integer.toBinaryString(num)).replace(' ', '0'); + } + + private int getFixedAccess(int access, Modifier target) + { + target.oldAccess = access; + int t = target.targetAccess; + int ret = (access & ~7); + + switch (access & 7) + { + case ACC_PRIVATE: + ret |= t; + break; + case 0: // default + ret |= (t != ACC_PRIVATE ? t : 0 /* default */); + break; + case ACC_PROTECTED: + ret |= (t != ACC_PRIVATE && t != 0 /* default */? t : ACC_PROTECTED); + break; + case ACC_PUBLIC: + ret |= (t != ACC_PRIVATE && t != 0 /* default */&& t != ACC_PROTECTED ? t : ACC_PUBLIC); + break; + default: + throw new RuntimeException("The fuck?"); + } + + // Clear the "final" marker on fields only if specified in control field + if (target.changeFinal) + { + if (target.markFinal) + { + ret |= ACC_FINAL; + } + else + { + ret &= ~ACC_FINAL; + } + } + target.newAccess = ret; + return ret; + } + + public static void main(String[] args) + { + if (args.length < 2) + { + System.out.println("Usage: AccessTransformer [MapFile2]... "); + System.exit(1); + } + + boolean hasTransformer = false; + AccessTransformer[] trans = new AccessTransformer[args.length - 1]; + for (int x = 1; x < args.length; x++) + { + try + { + trans[x - 1] = new AccessTransformer(args[x]); + hasTransformer = true; + } + catch (IOException e) + { + System.out.println("Could not read Transformer Map: " + args[x]); + e.printStackTrace(); + } + } + + if (!hasTransformer) + { + System.out.println("Culd not find a valid transformer to perform"); + System.exit(1); + } + + File orig = new File(args[0]); + File temp = new File(args[0] + ".ATBack"); + if (!orig.exists() && !temp.exists()) + { + System.out.println("Could not find target jar: " + orig); + System.exit(1); + } + + if (!orig.renameTo(temp)) + { + System.out.println("Could not rename file: " + orig + " -> " + temp); + System.exit(1); + } + + try + { + processJar(temp, orig, trans); + } + catch (IOException e) + { + e.printStackTrace(); + System.exit(1); + } + + if (!temp.delete()) + { + System.out.println("Could not delete temp file: " + temp); + } + } + + private static void processJar(File inFile, File outFile, AccessTransformer[] transformers) throws IOException + { + ZipInputStream inJar = null; + ZipOutputStream outJar = null; + + try + { + try + { + inJar = new ZipInputStream(new BufferedInputStream(new FileInputStream(inFile))); + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException("Could not open input file: " + e.getMessage()); + } + + try + { + outJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFile))); + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException("Could not open output file: " + e.getMessage()); + } + + ZipEntry entry; + while ((entry = inJar.getNextEntry()) != null) + { + if (entry.isDirectory()) + { + outJar.putNextEntry(entry); + continue; + } + + byte[] data = new byte[4096]; + ByteArrayOutputStream entryBuffer = new ByteArrayOutputStream(); + + int len; + do + { + len = inJar.read(data); + if (len > 0) + { + entryBuffer.write(data, 0, len); + } + } + while (len != -1); + + byte[] entryData = entryBuffer.toByteArray(); + + String entryName = entry.getName(); + + if (entryName.endsWith(".class") && !entryName.startsWith(".")) + { + ClassNode cls = new ClassNode(); + ClassReader rdr = new ClassReader(entryData); + rdr.accept(cls, 0); + String name = cls.name.replace('/', '.').replace('\\', '.'); + + for (AccessTransformer trans : transformers) + { + entryData = trans.transform(name, name, entryData); + } + } + + ZipEntry newEntry = new ZipEntry(entryName); + outJar.putNextEntry(newEntry); + outJar.write(entryData); + } + } + finally + { + if (outJar != null) + { + try + { + outJar.close(); + } + catch (IOException e) + { + } + } + + if (inJar != null) + { + try + { + inJar.close(); + } + catch (IOException e) + { + } + } + } + } + Multimap getModifiers() + { + return modifiers; + } + boolean isEmpty() + { + return modifiers.isEmpty(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.java new file mode 100644 index 0000000..83ca8de --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/DeobfuscationTransformer.java @@ -0,0 +1,53 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers; + +import net.minecraft.launchwrapper.IClassNameTransformer; +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.commons.RemappingClassAdapter; + +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; +import cpw.mods.fml.common.asm.transformers.deobf.FMLRemappingAdapter; + +public class DeobfuscationTransformer implements IClassTransformer, IClassNameTransformer { + + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + if (bytes == null) + { + return null; + } + ClassReader classReader = new ClassReader(bytes); + ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS); + RemappingClassAdapter remapAdapter = new FMLRemappingAdapter(classWriter); + classReader.accept(remapAdapter, ClassReader.EXPAND_FRAMES); + return classWriter.toByteArray(); + } + + @Override + public String remapClassName(String name) + { + return FMLDeobfuscatingRemapper.INSTANCE.map(name.replace('.','/')).replace('/', '.'); + } + + @Override + public String unmapClassName(String name) + { + return FMLDeobfuscatingRemapper.INSTANCE.unmap(name.replace('.', '/')).replace('/','.'); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.java new file mode 100644 index 0000000..86f8718 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/EventSubscriptionTransformer.java @@ -0,0 +1,226 @@ +package cpw.mods.fml.common.asm.transformers; + +import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES; +import static org.objectweb.asm.ClassWriter.COMPUTE_MAXS; +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.ACC_STATIC; +import static org.objectweb.asm.Opcodes.ALOAD; +import static org.objectweb.asm.Opcodes.ARETURN; +import static org.objectweb.asm.Opcodes.DUP; +import static org.objectweb.asm.Opcodes.F_SAME; +import static org.objectweb.asm.Opcodes.GETSTATIC; +import static org.objectweb.asm.Opcodes.IFNULL; +import static org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static org.objectweb.asm.Opcodes.NEW; +import static org.objectweb.asm.Opcodes.PUTSTATIC; +import static org.objectweb.asm.Opcodes.RETURN; +import static org.objectweb.asm.Opcodes.IRETURN; +import static org.objectweb.asm.Opcodes.ICONST_1; +import static org.objectweb.asm.Type.VOID_TYPE; +import static org.objectweb.asm.Type.BOOLEAN_TYPE; +import static org.objectweb.asm.Type.getMethodDescriptor; + +import java.util.List; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AnnotationNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.FrameNode; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.JumpInsnNode; +import org.objectweb.asm.tree.LabelNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.TypeInsnNode; +import org.objectweb.asm.tree.VarInsnNode; + +import cpw.mods.fml.common.eventhandler.Event; + +public class EventSubscriptionTransformer implements IClassTransformer +{ + public EventSubscriptionTransformer() + { + } + + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + if (bytes == null || name.equals("cpw.mods.fml.common.eventhandler.Event") || name.startsWith("net.minecraft.") || name.indexOf('.') == -1) + { + return bytes; + } + ClassReader cr = new ClassReader(bytes); + ClassNode classNode = new ClassNode(); + cr.accept(classNode, 0); + + try + { + if (buildEvents(classNode)) + { + ClassWriter cw = new ClassWriter(COMPUTE_FRAMES); + classNode.accept(cw); + return cw.toByteArray(); + } + return bytes; + } + catch (ClassNotFoundException ex) + { + // Discard silently- it's just noise + } + catch (Exception e) + { + e.printStackTrace(); + } + + return bytes; + } + + private boolean buildEvents(ClassNode classNode) throws Exception + { + // Yes, this recursively loads classes until we get this base class. THIS IS NOT A ISSUE. Coremods should handle re-entry just fine. + // If they do not this a COREMOD issue NOT a Forge/LaunchWrapper issue. + Class parent = this.getClass().getClassLoader().loadClass(classNode.superName.replace('/', '.')); + if (!Event.class.isAssignableFrom(parent)) + { + return false; + } + + //Class listenerListClazz = Class.forName("cpw.mods.fml.common.eventhandler.ListenerList", false, getClass().getClassLoader()); + Type tList = Type.getType("Lcpw/mods/fml/common/eventhandler/ListenerList;"); + + boolean edited = false; + boolean hasSetup = false; + boolean hasGetListenerList = false; + boolean hasDefaultCtr = false; + boolean hasCancelable = false; + boolean hasResult = false; + String voidDesc = Type.getMethodDescriptor(VOID_TYPE); + String boolDesc = Type.getMethodDescriptor(BOOLEAN_TYPE); + String listDesc = tList.getDescriptor(); + String listDescM = Type.getMethodDescriptor(tList); + + for (MethodNode method : (List)classNode.methods) + { + if (method.name.equals("setup") && method.desc.equals(voidDesc) && (method.access & ACC_PROTECTED) == ACC_PROTECTED) hasSetup = true; + if ((method.access & ACC_PUBLIC) == ACC_PUBLIC) + { + if (method.name.equals("getListenerList") && method.desc.equals(listDescM)) hasGetListenerList = true; + if (method.name.equals("isCancelable") && method.desc.equals(boolDesc)) hasCancelable = true; + if (method.name.equals("hasResult") && method.desc.equals(boolDesc)) hasResult = true; + } + if (method.name.equals("") && method.desc.equals(voidDesc)) hasDefaultCtr = true; + } + + if (classNode.visibleAnnotations != null) + { + for (AnnotationNode node : classNode.visibleAnnotations) + { + if (!hasResult && node.desc.equals("Lcpw/mods/fml/common/eventhandler/Event$HasResult;")) + { + /* Add: + * public boolean hasResult() + * { + * return true; + * } + */ + MethodNode method = new MethodNode(ACC_PUBLIC, "hasResult", boolDesc, null, null); + method.instructions.add(new InsnNode(ICONST_1)); + method.instructions.add(new InsnNode(IRETURN)); + classNode.methods.add(method); + edited = true; + } + else if (!hasCancelable && node.desc.equals("Lcpw/mods/fml/common/eventhandler/Cancelable;")) + { + /* Add: + * public boolean isCancelable() + * { + * return true; + * } + */ + MethodNode method = new MethodNode(ACC_PUBLIC, "isCancelable", boolDesc, null, null); + method.instructions.add(new InsnNode(ICONST_1)); + method.instructions.add(new InsnNode(IRETURN)); + classNode.methods.add(method); + edited = true; + } + } + } + + if (hasSetup) + { + if (!hasGetListenerList) + throw new RuntimeException("Event class defines setup() but does not define getListenerList! " + classNode.name); + else + return edited; + } + + Type tSuper = Type.getType(classNode.superName); + + //Add private static ListenerList LISTENER_LIST + classNode.fields.add(new FieldNode(ACC_PRIVATE | ACC_STATIC, "LISTENER_LIST", listDesc, null, null)); + + /*Add: + * public () + * { + * super(); + * } + */ + if (!hasDefaultCtr) + { + MethodNode method = new MethodNode(ACC_PUBLIC, "", voidDesc, null, null); + method.instructions.add(new VarInsnNode(ALOAD, 0)); + method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "", voidDesc, false)); + method.instructions.add(new InsnNode(RETURN)); + classNode.methods.add(method); + } + + /*Add: + * protected void setup() + * { + * super.setup(); + * if (LISTENER_LIST != NULL) + * { + * return; + * } + * LISTENER_LIST = new ListenerList(super.getListenerList()); + * } + */ + MethodNode method = new MethodNode(ACC_PROTECTED, "setup", voidDesc, null, null); + method.instructions.add(new VarInsnNode(ALOAD, 0)); + method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "setup", voidDesc, false)); + method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", listDesc)); + LabelNode initLisitener = new LabelNode(); + method.instructions.add(new JumpInsnNode(IFNULL, initLisitener)); + method.instructions.add(new InsnNode(RETURN)); + method.instructions.add(initLisitener); + method.instructions.add(new FrameNode(F_SAME, 0, null, 0, null)); + method.instructions.add(new TypeInsnNode(NEW, tList.getInternalName())); + method.instructions.add(new InsnNode(DUP)); + method.instructions.add(new VarInsnNode(ALOAD, 0)); + method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tSuper.getInternalName(), "getListenerList", listDescM, false)); + method.instructions.add(new MethodInsnNode(INVOKESPECIAL, tList.getInternalName(), "", getMethodDescriptor(VOID_TYPE, tList), false)); + method.instructions.add(new FieldInsnNode(PUTSTATIC, classNode.name, "LISTENER_LIST", listDesc)); + method.instructions.add(new InsnNode(RETURN)); + classNode.methods.add(method); + + /*Add: + * public ListenerList getListenerList() + * { + * return this.LISTENER_LIST; + * } + */ + method = new MethodNode(ACC_PUBLIC, "getListenerList", listDescM, null, null); + method.instructions.add(new FieldInsnNode(GETSTATIC, classNode.name, "LISTENER_LIST", listDesc)); + method.instructions.add(new InsnNode(ARETURN)); + classNode.methods.add(method); + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.java new file mode 100644 index 0000000..24d655f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ItemStackTransformer.java @@ -0,0 +1,85 @@ +package cpw.mods.fml.common.asm.transformers; + +import java.util.ListIterator; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +public class ItemStackTransformer implements IClassTransformer { + private static final String ITEM_TYPE = "Lnet/minecraft/item/Item;"; + private static final String GETITEM_DESC = "()"+ ITEM_TYPE; + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if (!"net.minecraft.item.ItemStack".equals(name)) + return basicClass; + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(basicClass); + classReader.accept(classNode, 0); + + FieldNode itemField = null; + for (FieldNode f : classNode.fields) + { + if (ITEM_TYPE.equals(f.desc) && itemField == null) + { + itemField = f; + } + else if (ITEM_TYPE.equals(f.desc)) + { + throw new RuntimeException("Error processing ItemStack - found a duplicate Item field"); + } + } + if (itemField == null) + { + throw new RuntimeException("Error processing ItemStack - no Item field declared (is the code somehow obfuscated?)"); + } + + MethodNode getItemMethod = null; + for (MethodNode m: classNode.methods) + { + if (GETITEM_DESC.equals(m.desc) && getItemMethod == null) + { + getItemMethod = m; + } + else if (GETITEM_DESC.equals(m.desc)) + { + throw new RuntimeException("Error processing ItemStack - duplicate getItem method found"); + } + } + if (getItemMethod == null) + { + throw new RuntimeException("Error processing ItemStack - no getItem method found (is the code somehow obfuscated?)"); + } + + for (MethodNode m: classNode.methods) + { + for (ListIterator it = m.instructions.iterator(); it.hasNext(); ) + { + AbstractInsnNode insnNode = it.next(); + if (insnNode.getType() == AbstractInsnNode.FIELD_INSN) + { + FieldInsnNode fi = (FieldInsnNode)insnNode; + if (itemField.name.equals(fi.name) && fi.getOpcode() == Opcodes.GETFIELD) + { + it.remove(); + MethodInsnNode replace = new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "net/minecraft/item/ItemStack",getItemMethod.name, getItemMethod.desc, false); + it.add(replace); + } + } + } + } + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/MarkerTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/MarkerTransformer.java new file mode 100644 index 0000000..88e90f9 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/MarkerTransformer.java @@ -0,0 +1,288 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.ClassNode; + +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Iterables; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.io.LineProcessor; +import com.google.common.io.Resources; + +public class MarkerTransformer implements IClassTransformer +{ + private ListMultimap markers = ArrayListMultimap.create(); + + public MarkerTransformer() throws IOException + { + this("fml_marker.cfg"); + } + protected MarkerTransformer(String rulesFile) throws IOException + { + readMapFile(rulesFile); + } + + private void readMapFile(String rulesFile) throws IOException + { + File file = new File(rulesFile); + URL rulesResource; + if (file.exists()) + { + rulesResource = file.toURI().toURL(); + } + else + { + rulesResource = Resources.getResource(rulesFile); + } + Resources.readLines(rulesResource, Charsets.UTF_8, new LineProcessor() + { + @Override + public Void getResult() + { + return null; + } + + @Override + public boolean processLine(String input) throws IOException + { + String line = Iterables.getFirst(Splitter.on('#').limit(2).split(input), "").trim(); + if (line.length()==0) + { + return true; + } + List parts = Lists.newArrayList(Splitter.on(" ").trimResults().split(line)); + if (parts.size()!=2) + { + throw new RuntimeException("Invalid config file line "+ input); + } + List markerInterfaces = Lists.newArrayList(Splitter.on(",").trimResults().split(parts.get(1))); + for (String marker : markerInterfaces) + { + markers.put(parts.get(0), marker); + } + return true; + } + }); + } + + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + if (bytes == null) { return null; } + if (!markers.containsKey(name)) { return bytes; } + + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + for (String marker : markers.get(name)) + { + classNode.interfaces.add(marker); + } + + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + + public static void main(String[] args) + { + if (args.length < 2) + { + System.out.println("Usage: MarkerTransformer [MapFile2]... "); + return; + } + + boolean hasTransformer = false; + MarkerTransformer[] trans = new MarkerTransformer[args.length - 1]; + for (int x = 1; x < args.length; x++) + { + try + { + trans[x - 1] = new MarkerTransformer(args[x]); + hasTransformer = true; + } + catch (IOException e) + { + System.out.println("Could not read Transformer Map: " + args[x]); + e.printStackTrace(); + } + } + + if (!hasTransformer) + { + System.out.println("Culd not find a valid transformer to perform"); + return; + } + + File orig = new File(args[0]); + File temp = new File(args[0] + ".ATBack"); + if (!orig.exists() && !temp.exists()) + { + System.out.println("Could not find target jar: " + orig); + return; + } +/* + if (temp.exists()) + { + if (orig.exists() && !orig.renameTo(new File(args[0] + (new SimpleDateFormat(".yyyy.MM.dd.HHmmss")).format(new Date())))) + { + System.out.println("Could not backup existing file: " + orig); + return; + } + if (!temp.renameTo(orig)) + { + System.out.println("Could not restore backup from previous run: " + temp); + return; + } + } +*/ + if (!orig.renameTo(temp)) + { + System.out.println("Could not rename file: " + orig + " -> " + temp); + return; + } + + try + { + processJar(temp, orig, trans); + } + catch (IOException e) + { + e.printStackTrace(); + } + + if (!temp.delete()) + { + System.out.println("Could not delete temp file: " + temp); + } + } + + private static void processJar(File inFile, File outFile, MarkerTransformer[] transformers) throws IOException + { + ZipInputStream inJar = null; + ZipOutputStream outJar = null; + + try + { + try + { + inJar = new ZipInputStream(new BufferedInputStream(new FileInputStream(inFile))); + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException("Could not open input file: " + e.getMessage()); + } + + try + { + outJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFile))); + } + catch (FileNotFoundException e) + { + throw new FileNotFoundException("Could not open output file: " + e.getMessage()); + } + + ZipEntry entry; + while ((entry = inJar.getNextEntry()) != null) + { + if (entry.isDirectory()) + { + outJar.putNextEntry(entry); + continue; + } + + byte[] data = new byte[4096]; + ByteArrayOutputStream entryBuffer = new ByteArrayOutputStream(); + + int len; + do + { + len = inJar.read(data); + if (len > 0) + { + entryBuffer.write(data, 0, len); + } + } + while (len != -1); + + byte[] entryData = entryBuffer.toByteArray(); + + String entryName = entry.getName(); + + if (entryName.endsWith(".class") && !entryName.startsWith(".")) + { + ClassNode cls = new ClassNode(); + ClassReader rdr = new ClassReader(entryData); + rdr.accept(cls, 0); + String name = cls.name.replace('/', '.').replace('\\', '.'); + + for (MarkerTransformer trans : transformers) + { + entryData = trans.transform(name, name, entryData); + } + } + + ZipEntry newEntry = new ZipEntry(entryName); + outJar.putNextEntry(newEntry); + outJar.write(entryData); + } + } + finally + { + if (outJar != null) + { + try + { + outJar.close(); + } + catch (IOException e) + { + } + } + + if (inJar != null) + { + try + { + inJar.close(); + } + catch (IOException e) + { + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAPITransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAPITransformer.java new file mode 100644 index 0000000..d79fdd4 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAPITransformer.java @@ -0,0 +1,161 @@ +package cpw.mods.fml.common.asm.transformers; + +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Set; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.MethodNode; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModAPIManager; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + +public class ModAPITransformer implements IClassTransformer { + + private static final boolean logDebugInfo = Boolean.valueOf(System.getProperty("fml.debugAPITransformer", "false")); + private ListMultimap optionals; + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) + { + String lookupName = name; + if(name.endsWith("$class")) + { + lookupName = name.substring(0, name.length() - 6); + } + if (optionals == null || !optionals.containsKey(lookupName)) + { + return basicClass; + } + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(basicClass); + classReader.accept(classNode, 0); + + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - found optionals for class %s - processing", name); + for (ASMData optional : optionals.get(lookupName)) + { + String modId = (String) optional.getAnnotationInfo().get("modid"); + + if (Loader.isModLoaded(modId) || ModAPIManager.INSTANCE.hasAPI(modId)) + { + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal skipped - mod present %s", modId); + continue; + } + if (logDebugInfo) FMLRelaunchLog.finer("Optional on %s triggered - mod missing %s", name, modId); + + if (optional.getAnnotationInfo().containsKey("iface")) + { + Boolean stripRefs = (Boolean)optional.getAnnotationInfo().get("striprefs"); + if (stripRefs == null) stripRefs = Boolean.FALSE; + stripInterface(classNode,(String)optional.getAnnotationInfo().get("iface"), stripRefs); + } + else + { + stripMethod(classNode, (String)optional.getObjectName()); + } + + } + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - class %s processed", name); + + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + + private void stripMethod(ClassNode classNode, String methodDescriptor) + { + if(classNode.name.endsWith("$class")) + { + String subName = classNode.name.substring(0, classNode.name.length() - 6); + int pos = methodDescriptor.indexOf('(') + 1; + methodDescriptor = methodDescriptor.substring(0, pos) + 'L' + subName + ';' + methodDescriptor.substring(pos); + } + for (ListIterator iterator = classNode.methods.listIterator(); iterator.hasNext();) + { + MethodNode method = iterator.next(); + if (methodDescriptor.equals(method.name+method.desc)) + { + iterator.remove(); + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - method %s removed", methodDescriptor); + return; + } + } + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - method %s NOT removed - not found", methodDescriptor); + } + + private void stripInterface(ClassNode classNode, String interfaceName, boolean stripRefs) + { + String ifaceName = interfaceName.replace('.', '/'); + boolean found = classNode.interfaces.remove(ifaceName); + if (found && logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s removed", interfaceName); + if (!found && logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s NOT removed - not found", interfaceName); + + if (found && stripRefs) + { + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s - stripping method signature references", interfaceName); + for (Iterator iterator = classNode.methods.iterator(); iterator.hasNext();) + { + MethodNode node = iterator.next(); + if (node.desc.contains(ifaceName)) + { + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s - stripping method containing reference %s", interfaceName, node.name); + iterator.remove(); + } + } + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s - all method signature references stripped", interfaceName); + } + else if (found) + { + if (logDebugInfo) FMLRelaunchLog.finer("Optional removal - interface %s - NOT stripping method signature references", interfaceName); + } + } + + public void initTable(ASMDataTable dataTable) + { + optionals = ArrayListMultimap.create(); + Set interfaceLists = dataTable.getAll("cpw.mods.fml.common.Optional$InterfaceList"); + addData(unpackInterfaces(interfaceLists)); + Set interfaces = dataTable.getAll("cpw.mods.fml.common.Optional$Interface"); + addData(interfaces); + Set methods = dataTable.getAll("cpw.mods.fml.common.Optional$Method"); + addData(methods); + } + + private Set unpackInterfaces(Set packedInterfaces) + { + Set result = Sets.newHashSet(); + for (ASMData data : packedInterfaces) + { + @SuppressWarnings("unchecked") + List> packedList = (List>) data.getAnnotationInfo().get("value"); + for (Map packed : packedList) + { + ASMData newData = data.copy(packed); + result.add(newData); + } + } + + return result; + } + private void addData(Set interfaces) + { + for (ASMData data : interfaces) + { + optionals.put(data.getClassName(),data); + } + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java new file mode 100644 index 0000000..303be59 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java @@ -0,0 +1,72 @@ +package cpw.mods.fml.common.asm.transformers; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.google.common.io.ByteSource; +import com.google.common.io.CharSource; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + +public class ModAccessTransformer extends AccessTransformer { + private static Map embedded = Maps.newHashMap(); //Needs to be primitive so that both classloaders get the same class. + @SuppressWarnings("unchecked") + public ModAccessTransformer() throws Exception + { + super(ModAccessTransformer.class); + //We are in the new ClassLoader here, so we need to get the static field from the other ClassLoader. + ClassLoader classLoader = this.getClass().getClassLoader().getClass().getClassLoader(); //Bit odd but it gets the class loader that loaded our current class loader yay java! + Class otherClazz = Class.forName(this.getClass().getName(), true, classLoader); + Field otherField = otherClazz.getDeclaredField("embedded"); + otherField.setAccessible(true); + embedded = (Map)otherField.get(null); + + for (Map.Entry e : embedded.entrySet()) + { + int old_count = getModifiers().size(); + processATFile(CharSource.wrap(e.getValue())); + int added = getModifiers().size() - old_count; + if (added > 0) + { + FMLRelaunchLog.fine("Loaded %d rules from AccessTransformer mod jar file %s\n", added, e.getKey()); + } + } + } + + public static void addJar(JarFile jar) throws IOException + { + Manifest manifest = jar.getManifest(); + String atList = manifest.getMainAttributes().getValue("FMLAT"); + if (atList == null) return; + for (String at : atList.split(" ")) + { + JarEntry jarEntry = jar.getJarEntry("META-INF/"+at); + if (jarEntry != null) + { + embedded.put(String.format("%s!META-INF/%s", jar.getName(), at), + new JarByteSource(jar,jarEntry).asCharSource(Charsets.UTF_8).read()); + } + } + } + + private static class JarByteSource extends ByteSource + { + private JarFile jar; + private JarEntry entry; + public JarByteSource(JarFile jar, JarEntry entry) + { + this.jar = jar; + this.entry = entry; + } + @Override + public InputStream openStream() throws IOException + { + return jar.getInputStream(entry); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/PatchingTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/PatchingTransformer.java new file mode 100644 index 0000000..ca195a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/PatchingTransformer.java @@ -0,0 +1,13 @@ +package cpw.mods.fml.common.asm.transformers; + +import net.minecraft.launchwrapper.IClassTransformer; +import cpw.mods.fml.common.patcher.ClassPatchManager; + +public class PatchingTransformer implements IClassTransformer { + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + return ClassPatchManager.INSTANCE.applyPatch(name, transformedName, bytes); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/SideTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/SideTransformer.java new file mode 100644 index 0000000..886f025 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/SideTransformer.java @@ -0,0 +1,117 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AnnotationNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodNode; + +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.SideOnly; + +public class SideTransformer implements IClassTransformer +{ + private static String SIDE = FMLLaunchHandler.side().name(); + private static final boolean DEBUG = false; + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + if (bytes == null) { return null; } + + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(bytes); + classReader.accept(classNode, 0); + + if (remove((List)classNode.visibleAnnotations, SIDE)) + { + if (DEBUG) + { + System.out.println(String.format("Attempted to load class %s for invalid side %s", classNode.name, SIDE)); + } + throw new RuntimeException(String.format("Attempted to load class %s for invalid side %s", classNode.name, SIDE)); + } + + Iterator fields = classNode.fields.iterator(); + while(fields.hasNext()) + { + FieldNode field = fields.next(); + if (remove((List)field.visibleAnnotations, SIDE)) + { + if (DEBUG) + { + System.out.println(String.format("Removing Field: %s.%s", classNode.name, field.name)); + } + fields.remove(); + } + } + Iterator methods = classNode.methods.iterator(); + while(methods.hasNext()) + { + MethodNode method = methods.next(); + if (remove((List)method.visibleAnnotations, SIDE)) + { + if (DEBUG) + { + System.out.println(String.format("Removing Method: %s.%s%s", classNode.name, method.name, method.desc)); + } + methods.remove(); + } + } + + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + + private boolean remove(List anns, String side) + { + if (anns == null) + { + return false; + } + for (AnnotationNode ann : anns) + { + if (ann.desc.equals(Type.getDescriptor(SideOnly.class))) + { + if (ann.values != null) + { + for (int x = 0; x < ann.values.size() - 1; x += 2) + { + Object key = ann.values.get(x); + Object value = ann.values.get(x+1); + if (key instanceof String && key.equals("value")) + { + if (value instanceof String[] ) + { + if (!((String[])value)[1].equals(side)) + { + return true; + } + } + } + } + } + } + } + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/TerminalTransformer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/TerminalTransformer.java new file mode 100644 index 0000000..c3604e2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/TerminalTransformer.java @@ -0,0 +1,142 @@ +package cpw.mods.fml.common.asm.transformers; + +import org.objectweb.asm.*; + +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import cpw.mods.fml.relauncher.FMLSecurityManager.ExitTrappedException; +import net.minecraft.launchwrapper.IClassTransformer; + +public class TerminalTransformer implements IClassTransformer +{ + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) + { + if (basicClass == null) return null; + ClassReader reader = new ClassReader(basicClass); + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + + ClassVisitor visitor = writer; + visitor = new ExitVisitor(visitor); + + reader.accept(visitor, 0); + return writer.toByteArray(); + } + + public static class ExitVisitor extends ClassVisitor + { + private String clsName = null; + private static final String callbackOwner = org.objectweb.asm.Type.getInternalName(ExitVisitor.class); + + private ExitVisitor(ClassVisitor cv) + { + super(Opcodes.ASM5, cv); + } + + @Override + public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) + { + super.visit(version, access, name, signature, superName, interfaces); + this.clsName = name; + } + + @Override + public MethodVisitor visitMethod(int mAccess, final String mName, final String mDesc, String mSignature, String[] mExceptions) + { + final boolean warn = !(clsName.equals("net/minecraft/client/Minecraft") || + clsName.equals("net/minecraft/server/dedicated/DedicatedServer") || + clsName.equals("cpw/mods/fml/common/FMLCommonHandler") || + clsName.startsWith("com/jcraft/jogg/") || + clsName.startsWith("scala/sys/") + ); + + return new MethodVisitor(Opcodes.ASM5, super.visitMethod(mAccess, mName, mDesc, mSignature, mExceptions)) + { + @Override + public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean isIntf) + { + if (opcode == Opcodes.INVOKESTATIC && owner.equals("java/lang/System") && name.equals("exit") && desc.equals("(I)V")) + { + if (warn) + { + FMLRelaunchLog.warning("============================================================="); + FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML!"); + FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc); + FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead"); + FMLRelaunchLog.warning("============================================================="); + } + owner = ExitVisitor.callbackOwner; + name = "systemExitCalled"; + } + else if (opcode == Opcodes.INVOKEVIRTUAL && owner.equals("java/lang/Runtime") && name.equals("exit") && desc.equals("(I)V")) + { + if (warn) + { + FMLRelaunchLog.warning("============================================================="); + FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE Runtime.exit() THIS IS NOT ALLOWED REROUTING TO FML!"); + FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc); + FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead"); + FMLRelaunchLog.warning("============================================================="); + } + opcode = Opcodes.INVOKESTATIC; + owner = ExitVisitor.callbackOwner; + name = "runtimeExitCalled"; + desc = "(Ljava/lang/Runtime;I)V"; + } + else if (opcode == Opcodes.INVOKEVIRTUAL && owner.equals("java/lang/Runtime") && name.equals("halt") && desc.equals("(I)V")) + { + if (warn) + { + FMLRelaunchLog.warning("============================================================="); + FMLRelaunchLog.warning("MOD HAS DIRECT REFERENCE Runtime.halt() THIS IS NOT ALLOWED REROUTING TO FML!"); + FMLRelaunchLog.warning("Offendor: %s.%s%s", ExitVisitor.this.clsName, mName, mDesc); + FMLRelaunchLog.warning("Use FMLCommonHandler.exitJava instead"); + FMLRelaunchLog.warning("============================================================="); + } + opcode = Opcodes.INVOKESTATIC; + owner = ExitVisitor.callbackOwner; + name = "runtimeHaltCalled"; + desc = "(Ljava/lang/Runtime;I)V"; + } + + super.visitMethodInsn(opcode, owner, name, desc, isIntf); + } + }; + } + + // Intercept System.exit, and check if the caller is allowed to use it, if not wrap it in a ExitTrappedException + public static void systemExitCalled(int status) + { + ExitVisitor.checkAccess(); + System.exit(status); + } + // Intercept Runtime.getRuntime().exit, and check if the caller is allowed to use it, if not wrap it in a ExitTrappedException + public static void runtimeExitCalled(Runtime runtime, int status) + { + ExitVisitor.checkAccess(); + runtime.exit(status); + } + + // Intercept Runtime.getRuntime().halt, and check if the caller is allowed to use it, if not wrap it in a ExitTrappedException + public static void runtimeHaltCalled(Runtime runtime, int status) + { + ExitVisitor.checkAccess(); + runtime.halt(status); + } + + private static void checkAccess() + { + StackTraceElement[] cause = Thread.currentThread().getStackTrace(); + + String callingClass = cause.length > 2 ? cause[3].getClassName() : "none"; + String callingParent = cause.length > 3 ? cause[4].getClassName() : "none"; + // FML is allowed to call system exit and the Minecraft applet (from the quit button), and the dedicated server (from itself) + if (!(callingClass.startsWith("cpw.mods.fml.") || + ("net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) || + ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent))) + ) + { + throw new ExitTrappedException(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java new file mode 100644 index 0000000..0e0b0b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLDeobfuscatingRemapper.java @@ -0,0 +1,425 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers.deobf; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import net.minecraft.launchwrapper.LaunchClassLoader; + +import org.apache.logging.log4j.Level; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.commons.Remapper; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.BiMap; +import com.google.common.collect.ImmutableBiMap; +import com.google.common.collect.ImmutableBiMap.Builder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.io.CharSource; + +import cpw.mods.fml.common.patcher.ClassPatchManager; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + +public class FMLDeobfuscatingRemapper extends Remapper { + public static final FMLDeobfuscatingRemapper INSTANCE = new FMLDeobfuscatingRemapper(); + + private BiMap classNameBiMap; + + private Map> rawFieldMaps; + private Map> rawMethodMaps; + + private Map> fieldNameMaps; + private Map> methodNameMaps; + + private LaunchClassLoader classLoader; + + + private static final boolean DEBUG_REMAPPING = Boolean.parseBoolean(System.getProperty("fml.remappingDebug", "false")); + private static final boolean DUMP_FIELD_MAPS = Boolean.parseBoolean(System.getProperty("fml.remappingDebug.dumpFieldMaps", "false")) && DEBUG_REMAPPING; + private static final boolean DUMP_METHOD_MAPS = Boolean.parseBoolean(System.getProperty("fml.remappingDebug.dumpMethodMaps", "false")) && DEBUG_REMAPPING; + + private FMLDeobfuscatingRemapper() + { + classNameBiMap=ImmutableBiMap.of(); + } + + public void setupLoadOnly(String deobfFileName, boolean loadAll) + { + try + { + File mapData = new File(deobfFileName); + LZMAInputSupplier zis = new LZMAInputSupplier(new FileInputStream(mapData)); + CharSource srgSource = zis.asCharSource(Charsets.UTF_8); + List srgList = srgSource.readLines(); + rawMethodMaps = Maps.newHashMap(); + rawFieldMaps = Maps.newHashMap(); + Builder builder = ImmutableBiMap.builder(); + Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults(); + for (String line : srgList) + { + String[] parts = Iterables.toArray(splitter.split(line),String.class); + String typ = parts[0]; + if ("CL".equals(typ)) + { + parseClass(builder, parts); + } + else if ("MD".equals(typ) && loadAll) + { + parseMethod(parts); + } + else if ("FD".equals(typ) && loadAll) + { + parseField(parts); + } + } + classNameBiMap = builder.build(); + } + catch (IOException ioe) + { + FMLRelaunchLog.log(Level.ERROR, "An error occurred loading the deobfuscation map data", ioe); + } + methodNameMaps = Maps.newHashMapWithExpectedSize(rawMethodMaps.size()); + fieldNameMaps = Maps.newHashMapWithExpectedSize(rawFieldMaps.size()); + + } + public void setup(File mcDir, LaunchClassLoader classLoader, String deobfFileName) + { + this.classLoader = classLoader; + try + { + InputStream classData = getClass().getResourceAsStream(deobfFileName); + LZMAInputSupplier zis = new LZMAInputSupplier(classData); + CharSource srgSource = zis.asCharSource(Charsets.UTF_8); + List srgList = srgSource.readLines(); + rawMethodMaps = Maps.newHashMap(); + rawFieldMaps = Maps.newHashMap(); + Builder builder = ImmutableBiMap.builder(); + Splitter splitter = Splitter.on(CharMatcher.anyOf(": ")).omitEmptyStrings().trimResults(); + for (String line : srgList) + { + String[] parts = Iterables.toArray(splitter.split(line),String.class); + String typ = parts[0]; + if ("CL".equals(typ)) + { + parseClass(builder, parts); + } + else if ("MD".equals(typ)) + { + parseMethod(parts); + } + else if ("FD".equals(typ)) + { + parseField(parts); + } + } + classNameBiMap = builder.build(); + } + catch (IOException ioe) + { + FMLRelaunchLog.log(Level.ERROR, ioe, "An error occurred loading the deobfuscation map data"); + } + methodNameMaps = Maps.newHashMapWithExpectedSize(rawMethodMaps.size()); + fieldNameMaps = Maps.newHashMapWithExpectedSize(rawFieldMaps.size()); + } + + public boolean isRemappedClass(String className) + { + return !map(className).equals(className); + } + + private void parseField(String[] parts) + { + String oldSrg = parts[1]; + int lastOld = oldSrg.lastIndexOf('/'); + String cl = oldSrg.substring(0,lastOld); + String oldName = oldSrg.substring(lastOld+1); + String newSrg = parts[2]; + int lastNew = newSrg.lastIndexOf('/'); + String newName = newSrg.substring(lastNew+1); + if (!rawFieldMaps.containsKey(cl)) + { + rawFieldMaps.put(cl, Maps.newHashMap()); + } + rawFieldMaps.get(cl).put(oldName + ":" + getFieldType(cl, oldName), newName); + rawFieldMaps.get(cl).put(oldName + ":null", newName); + } + + /* + * Cache the field descriptions for classes so we don't repeatedly reload the same data again and again + */ + private Map> fieldDescriptions = Maps.newHashMap(); + + // Cache null values so we don't waste time trying to recompute classes with no field or method maps + private Set negativeCacheMethods = Sets.newHashSet(); + private Set negativeCacheFields = Sets.newHashSet(); + + private String getFieldType(String owner, String name) + { + if (fieldDescriptions.containsKey(owner)) + { + return fieldDescriptions.get(owner).get(name); + } + synchronized (fieldDescriptions) + { + try + { + byte[] classBytes = ClassPatchManager.INSTANCE.getPatchedResource(owner, map(owner).replace('/', '.'), classLoader); + if (classBytes == null) + { + return null; + } + ClassReader cr = new ClassReader(classBytes); + ClassNode classNode = new ClassNode(); + cr.accept(classNode, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); + Map resMap = Maps.newHashMap(); + for (FieldNode fieldNode : (List) classNode.fields) { + resMap.put(fieldNode.name, fieldNode.desc); + } + fieldDescriptions.put(owner, resMap); + return resMap.get(name); + } + catch (IOException e) + { + FMLRelaunchLog.log(Level.ERROR,e, "A critical exception occured reading a class file %s", owner); + } + return null; + } + } + + private void parseClass(Builder builder, String[] parts) + { + builder.put(parts[1],parts[2]); + } + + private void parseMethod(String[] parts) + { + String oldSrg = parts[1]; + int lastOld = oldSrg.lastIndexOf('/'); + String cl = oldSrg.substring(0,lastOld); + String oldName = oldSrg.substring(lastOld+1); + String sig = parts[2]; + String newSrg = parts[3]; + int lastNew = newSrg.lastIndexOf('/'); + String newName = newSrg.substring(lastNew+1); + if (!rawMethodMaps.containsKey(cl)) + { + rawMethodMaps.put(cl, Maps.newHashMap()); + } + rawMethodMaps.get(cl).put(oldName+sig, newName); + } + + @Override + public String mapFieldName(String owner, String name, String desc) + { + if (classNameBiMap == null || classNameBiMap.isEmpty()) + { + return name; + } + Map fieldMap = getFieldMap(owner); + return fieldMap!=null && fieldMap.containsKey(name+":"+desc) ? fieldMap.get(name+":"+desc) : name; + } + + @Override + public String map(String typeName) + { + if (classNameBiMap == null || classNameBiMap.isEmpty()) + { + return typeName; + } + if (classNameBiMap.containsKey(typeName)) + { + return classNameBiMap.get(typeName); + } + int dollarIdx = typeName.lastIndexOf('$'); + if (dollarIdx > -1) + { + return map(typeName.substring(0, dollarIdx)) + "$" + typeName.substring(dollarIdx + 1); + } + return typeName; + } + + public String unmap(String typeName) + { + if (classNameBiMap == null || classNameBiMap.isEmpty()) + { + return typeName; + } + + if (classNameBiMap.containsValue(typeName)) + { + return classNameBiMap.inverse().get(typeName); + } + int dollarIdx = typeName.lastIndexOf('$'); + if (dollarIdx > -1) + { + return unmap(typeName.substring(0, dollarIdx)) + "$" + typeName.substring(dollarIdx + 1); + } + return typeName; + } + + + @Override + public String mapMethodName(String owner, String name, String desc) + { + if (classNameBiMap==null || classNameBiMap.isEmpty()) + { + return name; + } + Map methodMap = getMethodMap(owner); + String methodDescriptor = name+desc; + return methodMap!=null && methodMap.containsKey(methodDescriptor) ? methodMap.get(methodDescriptor) : name; + } + + private Map getFieldMap(String className) + { + if (!fieldNameMaps.containsKey(className) && !negativeCacheFields.contains(className)) + { + findAndMergeSuperMaps(className); + if (!fieldNameMaps.containsKey(className)) + { + negativeCacheFields.add(className); + } + + if (DUMP_FIELD_MAPS) + { + FMLRelaunchLog.finer("Field map for %s : %s", className, fieldNameMaps.get(className)); + } + } + return fieldNameMaps.get(className); + } + + private Map getMethodMap(String className) + { + if (!methodNameMaps.containsKey(className) && !negativeCacheMethods.contains(className)) + { + findAndMergeSuperMaps(className); + if (!methodNameMaps.containsKey(className)) + { + negativeCacheMethods.add(className); + } + if (DUMP_METHOD_MAPS) + { + FMLRelaunchLog.finer("Method map for %s : %s", className, methodNameMaps.get(className)); + } + + } + return methodNameMaps.get(className); + } + + private void findAndMergeSuperMaps(String name) + { + try + { + String superName = null; + String[] interfaces = new String[0]; + byte[] classBytes = ClassPatchManager.INSTANCE.getPatchedResource(name, map(name), classLoader); + if (classBytes != null) + { + ClassReader cr = new ClassReader(classBytes); + superName = cr.getSuperName(); + interfaces = cr.getInterfaces(); + } + mergeSuperMaps(name, superName, interfaces); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + public void mergeSuperMaps(String name, String superName, String[] interfaces) + { +// System.out.printf("Computing super maps for %s: %s %s\n", name, superName, Arrays.asList(interfaces)); + if (classNameBiMap == null || classNameBiMap.isEmpty()) + { + return; + } + // Skip Object + if (Strings.isNullOrEmpty(superName)) + { + return; + } + + List allParents = ImmutableList.builder().add(superName).addAll(Arrays.asList(interfaces)).build(); + // generate maps for all parent objects + for (String parentThing : allParents) + { + if (!methodNameMaps.containsKey(parentThing)) + { + findAndMergeSuperMaps(parentThing); + } + } + Map methodMap = Maps.newHashMap(); + Map fieldMap = Maps.newHashMap(); + for (String parentThing : allParents) + { + if (methodNameMaps.containsKey(parentThing)) + { + methodMap.putAll(methodNameMaps.get(parentThing)); + } + if (fieldNameMaps.containsKey(parentThing)) + { + fieldMap.putAll(fieldNameMaps.get(parentThing)); + } + } + if (rawMethodMaps.containsKey(name)) + { + methodMap.putAll(rawMethodMaps.get(name)); + } + if (rawFieldMaps.containsKey(name)) + { + fieldMap.putAll(rawFieldMaps.get(name)); + } + methodNameMaps.put(name, ImmutableMap.copyOf(methodMap)); + fieldNameMaps.put(name, ImmutableMap.copyOf(fieldMap)); +// System.out.printf("Maps: %s %s\n", name, methodMap); + } + + public Set getObfedClasses() + { + return ImmutableSet.copyOf(classNameBiMap.keySet()); + } + + public String getStaticFieldType(String oldType, String oldName, String newType, String newName) + { + String fType = getFieldType(oldType, oldName); + if (oldType.equals(newType)) + { + return fType; + } + Map newClassMap = fieldDescriptions.get(newType); + if (newClassMap == null) + { + newClassMap = Maps.newHashMap(); + fieldDescriptions.put(newType, newClassMap); + } + newClassMap.put(newName, fType); + return fType; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.java new file mode 100644 index 0000000..46eb0ca --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/FMLRemappingAdapter.java @@ -0,0 +1,75 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers.deobf; + +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.commons.Remapper; +import org.objectweb.asm.commons.RemappingClassAdapter; +import org.objectweb.asm.commons.RemappingMethodAdapter; + +public class FMLRemappingAdapter extends RemappingClassAdapter { + public FMLRemappingAdapter(ClassVisitor cv) + { + super(cv, FMLDeobfuscatingRemapper.INSTANCE); + } + + @Override + public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) + { + if (interfaces == null) + { + interfaces = new String[0]; + } + FMLDeobfuscatingRemapper.INSTANCE.mergeSuperMaps(name, superName, interfaces); + super.visit(version, access, name, signature, superName, interfaces); + } + + @Override + protected MethodVisitor createRemappingMethodAdapter(int access, String newDesc, MethodVisitor mv) + { + return new StaticFixingMethodVisitor(access, newDesc, mv, remapper); + } + + private static class StaticFixingMethodVisitor extends RemappingMethodAdapter + { + + public StaticFixingMethodVisitor(int access, String desc, MethodVisitor mv, Remapper remapper) + { + super(access, desc, mv, remapper); + } + + @Override + public void visitFieldInsn(int opcode, String originalType, String originalName, String desc) + { + // This method solves the problem of a static field reference changing type. In all probability it is a + // compatible change, however we need to fix up the desc to point at the new type + String type = remapper.mapType(originalType); + String fieldName = remapper.mapFieldName(originalType, originalName, desc); + String newDesc = remapper.mapDesc(desc); + if (opcode == Opcodes.GETSTATIC && type.startsWith("net/minecraft/") && newDesc.startsWith("Lnet/minecraft/")) + { + String replDesc = FMLDeobfuscatingRemapper.INSTANCE.getStaticFieldType(originalType, originalName, type, fieldName); + if (replDesc != null) + { + newDesc = remapper.mapDesc(replDesc); + } + } + // super.super + if (mv != null) { + mv.visitFieldInsn(opcode, type, fieldName, newDesc); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.java new file mode 100644 index 0000000..04b430a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/asm/transformers/deobf/LZMAInputSupplier.java @@ -0,0 +1,36 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.asm.transformers.deobf; + +import java.io.IOException; +import java.io.InputStream; + +import LZMA.LzmaInputStream; + +import com.google.common.io.ByteSource; + +public class LZMAInputSupplier extends ByteSource { + private InputStream compressedData; + + public LZMAInputSupplier(InputStream compressedData) + { + this.compressedData = compressedData; + } + + @Override + public InputStream openStream() throws IOException + { + return new LzmaInputStream(this.compressedData); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ASMDataTable.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ASMDataTable.java new file mode 100644 index 0000000..eb1e1b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ASMDataTable.java @@ -0,0 +1,141 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.base.Predicate; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import com.google.common.collect.Multimaps; +import com.google.common.collect.SetMultimap; + +import cpw.mods.fml.common.ModContainer; + +public class ASMDataTable +{ + public final static class ASMData implements Cloneable + { + private ModCandidate candidate; + private String annotationName; + private String className; + private String objectName; + private Map annotationInfo; + public ASMData(ModCandidate candidate, String annotationName, String className, String objectName, Map info) + { + this.candidate = candidate; + this.annotationName = annotationName; + this.className = className; + this.objectName = objectName; + this.annotationInfo = info; + } + public ModCandidate getCandidate() + { + return candidate; + } + public String getAnnotationName() + { + return annotationName; + } + public String getClassName() + { + return className; + } + public String getObjectName() + { + return objectName; + } + public Map getAnnotationInfo() + { + return annotationInfo; + } + + public ASMData copy(Map newAnnotationInfo) + { + try + { + ASMData clone = (ASMData) this.clone(); + clone.annotationInfo = newAnnotationInfo; + return clone; + } + catch (CloneNotSupportedException e) + { + throw new RuntimeException("Unpossible", e); + } + } + } + + private static class ModContainerPredicate implements Predicate + { + private ModContainer container; + public ModContainerPredicate(ModContainer container) + { + this.container = container; + } + @Override + public boolean apply(ASMData data) + { + return container.getSource().equals(data.candidate.getModContainer()); + } + } + private SetMultimap globalAnnotationData = HashMultimap.create(); + private Map> containerAnnotationData; + + private List containers = Lists.newArrayList(); + private SetMultimap packageMap = HashMultimap.create(); + + public SetMultimap getAnnotationsFor(ModContainer container) + { + if (containerAnnotationData == null) + { + ImmutableMap.Builder> mapBuilder = ImmutableMap.>builder(); + for (ModContainer cont : containers) + { + Multimap values = Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont)); + mapBuilder.put(cont, ImmutableSetMultimap.copyOf(values)); + } + containerAnnotationData = mapBuilder.build(); + } + return containerAnnotationData.get(container); + } + + public Set getAll(String annotation) + { + return globalAnnotationData.get(annotation); + } + + public void addASMData(ModCandidate candidate, String annotation, String className, String objectName, Map annotationInfo) + { + globalAnnotationData.put(annotation, new ASMData(candidate, annotation, className, objectName, annotationInfo)); + } + + public void addContainer(ModContainer container) + { + this.containers.add(container); + } + + public void registerPackage(ModCandidate modCandidate, String pkg) + { + this.packageMap.put(pkg,modCandidate); + } + + public Set getCandidatesFor(String pkg) + { + return this.packageMap.get(pkg); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ContainerType.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ContainerType.java new file mode 100644 index 0000000..7cc526b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ContainerType.java @@ -0,0 +1,44 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.util.List; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.common.ModContainer; + +public enum ContainerType +{ + JAR(JarDiscoverer.class), + DIR(DirectoryDiscoverer.class); + + private ITypeDiscoverer discoverer; + + private ContainerType(Class discovererClass) + { + try + { + this.discoverer = discovererClass.newInstance(); + } + catch (Exception e) + { + throw Throwables.propagate(e); + } + } + + public List findMods(ModCandidate candidate, ASMDataTable table) + { + return discoverer.discover(candidate, table); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/DirectoryDiscoverer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/DirectoryDiscoverer.java new file mode 100644 index 0000000..76a9dc5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/DirectoryDiscoverer.java @@ -0,0 +1,128 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.MetadataCollection; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModContainerFactory; +import cpw.mods.fml.common.discovery.asm.ASMModParser; + +public class DirectoryDiscoverer implements ITypeDiscoverer +{ + private class ClassFilter implements FileFilter + { + @Override + public boolean accept(File file) + { + return (file.isFile() && classFile.matcher(file.getName()).matches()) || file.isDirectory(); + } + } + + private ASMDataTable table; + + @Override + public List discover(ModCandidate candidate, ASMDataTable table) + { + this.table = table; + List found = Lists.newArrayList(); + FMLLog.fine("Examining directory %s for potential mods", candidate.getModContainer().getName()); + exploreFileSystem("", candidate.getModContainer(), found, candidate, null); + for (ModContainer mc : found) + { + table.addContainer(mc); + } + return found; + } + + public void exploreFileSystem(String path, File modDir, List harvestedMods, ModCandidate candidate, MetadataCollection mc) + { + if (path.length() == 0) + { + File metadata = new File(modDir, "mcmod.info"); + try + { + FileInputStream fis = new FileInputStream(metadata); + mc = MetadataCollection.from(fis,modDir.getName()); + fis.close(); + FMLLog.fine("Found an mcmod.info file in directory %s", modDir.getName()); + } + catch (Exception e) + { + mc = MetadataCollection.from(null,""); + FMLLog.fine("No mcmod.info file found in directory %s", modDir.getName()); + } + } + + File[] content = modDir.listFiles(new ClassFilter()); + + // Always sort our content + Arrays.sort(content); + for (File file : content) + { + if (file.isDirectory()) + { + FMLLog.finer("Recursing into package %s", path + file.getName()); + exploreFileSystem(path + file.getName() + ".", file, harvestedMods, candidate, mc); + continue; + } + Matcher match = classFile.matcher(file.getName()); + + if (match.matches()) + { + ASMModParser modParser = null; + try + { + FileInputStream fis = new FileInputStream(file); + modParser = new ASMModParser(fis); + fis.close(); + candidate.addClassEntry(path+file.getName()); + } + catch (LoaderException e) + { + FMLLog.log(Level.ERROR, e, "There was a problem reading the file %s - probably this is a corrupt file", file.getPath()); + throw e; + } + catch (Exception e) + { + Throwables.propagate(e); + } + + modParser.validate(); + modParser.sendToTable(table, candidate); + ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer(), candidate); + if (container!=null) + { + harvestedMods.add(container); + container.bindMetadata(mc); + } + } + + + } + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ITypeDiscoverer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ITypeDiscoverer.java new file mode 100644 index 0000000..4b4d431 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ITypeDiscoverer.java @@ -0,0 +1,26 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.util.List; +import java.util.regex.Pattern; + +import cpw.mods.fml.common.ModContainer; + +public interface ITypeDiscoverer +{ + // main class part, followed by an optional $ and an "inner class" part. $ cannot be last, otherwise scala breaks + public static Pattern classFile = Pattern.compile("[^\\s\\$]+(\\$[^\\s]+)?\\.class$"); + + public List discover(ModCandidate candidate, ASMDataTable table); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/JarDiscoverer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/JarDiscoverer.java new file mode 100644 index 0000000..d547487 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/JarDiscoverer.java @@ -0,0 +1,113 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.util.Collections; +import java.util.List; +import java.util.jar.JarFile; +import org.apache.logging.log4j.Level; +import java.util.regex.Matcher; +import java.util.zip.ZipEntry; + +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.MetadataCollection; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModContainerFactory; +import cpw.mods.fml.common.discovery.asm.ASMModParser; + +public class JarDiscoverer implements ITypeDiscoverer +{ + @Override + public List discover(ModCandidate candidate, ASMDataTable table) + { + List foundMods = Lists.newArrayList(); + FMLLog.fine("Examining file %s for potential mods", candidate.getModContainer().getName()); + JarFile jar = null; + try + { + jar = new JarFile(candidate.getModContainer()); + + if (jar.getManifest()!=null && (jar.getManifest().getMainAttributes().get("FMLCorePlugin") != null || jar.getManifest().getMainAttributes().get("TweakClass") != null)) + { + FMLLog.finer("Ignoring coremod or tweak system %s", candidate.getModContainer()); + return foundMods; + } + ZipEntry modInfo = jar.getEntry("mcmod.info"); + MetadataCollection mc = null; + if (modInfo != null) + { + FMLLog.finer("Located mcmod.info file in file %s", candidate.getModContainer().getName()); + mc = MetadataCollection.from(jar.getInputStream(modInfo), candidate.getModContainer().getName()); + } + else + { + FMLLog.fine("The mod container %s appears to be missing an mcmod.info file", candidate.getModContainer().getName()); + mc = MetadataCollection.from(null, ""); + } + for (ZipEntry ze : Collections.list(jar.entries())) + { + if (ze.getName()!=null && ze.getName().startsWith("__MACOSX")) + { + continue; + } + Matcher match = classFile.matcher(ze.getName()); + if (match.matches()) + { + ASMModParser modParser; + try + { + modParser = new ASMModParser(jar.getInputStream(ze)); + candidate.addClassEntry(ze.getName()); + } + catch (LoaderException e) + { + FMLLog.log(Level.ERROR, e, "There was a problem reading the entry %s in the jar %s - probably a corrupt zip", ze.getName(), candidate.getModContainer().getPath()); + jar.close(); + throw e; + } + modParser.validate(); + modParser.sendToTable(table, candidate); + ModContainer container = ModContainerFactory.instance().build(modParser, candidate.getModContainer(), candidate); + if (container!=null) + { + table.addContainer(container); + foundMods.add(container); + container.bindMetadata(mc); + } + } + } + } + catch (Exception e) + { + FMLLog.log(Level.WARN, e, "Zip file %s failed to read properly, it will be ignored", candidate.getModContainer().getName()); + } + finally + { + if (jar != null) + { + try + { + jar.close(); + } + catch (Exception e) + { + } + } + } + return foundMods; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModCandidate.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModCandidate.java new file mode 100644 index 0000000..6e4d8e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModCandidate.java @@ -0,0 +1,126 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.io.File; +import java.util.List; +import java.util.Set; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.discovery.asm.ASMModParser; + + +public class ModCandidate +{ + private File classPathRoot; + private File modContainer; + private ContainerType sourceType; + private boolean classpath; + private List baseModTypes = Lists.newArrayList(); + private boolean isMinecraft; + private List baseModCandidateTypes = Lists.newArrayListWithCapacity(1); + private Set foundClasses = Sets.newHashSet(); + private List mods; + private List packages = Lists.newArrayList(); + private ASMDataTable table; + + public ModCandidate(File classPathRoot, File modContainer, ContainerType sourceType) + { + this(classPathRoot, modContainer, sourceType, false, false); + } + public ModCandidate(File classPathRoot, File modContainer, ContainerType sourceType, boolean isMinecraft, boolean classpath) + { + this.classPathRoot = classPathRoot; + this.modContainer = modContainer; + this.sourceType = sourceType; + this.isMinecraft = isMinecraft; + this.classpath = classpath; + } + + public File getClassPathRoot() + { + return classPathRoot; + } + + public File getModContainer() + { + return modContainer; + } + + public ContainerType getSourceType() + { + return sourceType; + } + public List explore(ASMDataTable table) + { + this.table = table; + this.mods = sourceType.findMods(this, table); + if (!baseModCandidateTypes.isEmpty()) + { + FMLLog.info("Attempting to reparse the mod container %s", getModContainer().getName()); + this.mods = sourceType.findMods(this, table); + } + return this.mods; + } + + public void addClassEntry(String name) + { + String className = name.substring(0, name.lastIndexOf('.')); // strip the .class + foundClasses.add(className); + className = className.replace('/','.'); + int pkgIdx = className.lastIndexOf('.'); + if (pkgIdx > -1) + { + String pkg = className.substring(0,pkgIdx); + packages.add(pkg); + this.table.registerPackage(this,pkg); + } + } + + public boolean isClasspath() + { + return classpath; + } + public void rememberBaseModType(String className) + { + baseModTypes.add(className); + } + public List getRememberedBaseMods() + { + return baseModTypes; + } + public boolean isMinecraftJar() + { + return isMinecraft; + } + public void rememberModCandidateType(ASMModParser modParser) + { + baseModCandidateTypes.add(modParser); + } + public Set getClassList() + { + return foundClasses; + } + public List getContainedMods() + { + return mods; + } + public List getContainedPackages() + { + return packages; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModDiscoverer.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModDiscoverer.java new file mode 100644 index 0000000..da4088a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/ModDiscoverer.java @@ -0,0 +1,163 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery; + +import java.io.File; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.logging.log4j.Level; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.ObjectArrays; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.ModClassLoader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.relauncher.CoreModManager; +import cpw.mods.fml.relauncher.FileListHelper; +import cpw.mods.fml.relauncher.ModListHelper; + +public class ModDiscoverer +{ + private static Pattern zipJar = Pattern.compile("(.+).(zip|jar)$"); + + private List candidates = Lists.newArrayList(); + + private ASMDataTable dataTable = new ASMDataTable(); + + private List nonModLibs = Lists.newArrayList(); + + public void findClasspathMods(ModClassLoader modClassLoader) + { + List knownLibraries = ImmutableList.builder() + // skip default libs + .addAll(modClassLoader.getDefaultLibraries()) + // skip loaded coremods + .addAll(CoreModManager.getLoadedCoremods()) + // skip reparse coremods here + .addAll(CoreModManager.getReparseableCoremods()) + .build(); + File[] minecraftSources = modClassLoader.getParentSources(); + if (minecraftSources.length == 1 && minecraftSources[0].isFile()) + { + FMLLog.fine("Minecraft is a file at %s, loading", minecraftSources[0].getAbsolutePath()); + candidates.add(new ModCandidate(minecraftSources[0], minecraftSources[0], ContainerType.JAR, true, true)); + } + else + { + for (int i = 0; i < minecraftSources.length; i++) + { + if (minecraftSources[i].isFile()) + { + if (knownLibraries.contains(minecraftSources[i].getName())) + { + FMLLog.finer("Skipping known library file %s", minecraftSources[i].getAbsolutePath()); + } + else + { + FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath()); + candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i==0, true)); + } + } + else if (minecraftSources[i].isDirectory()) + { + FMLLog.fine("Found a minecraft related directory at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath()); + candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.DIR, i==0, true)); + } + } + } + + } + + public void findModDirMods(File modsDir) + { + findModDirMods(modsDir, new File[0]); + } + + public void findModDirMods(File modsDir, File[] supplementalModFileCandidates) + { + File[] modList = FileListHelper.sortFileList(modsDir, null); + modList = FileListHelper.sortFileList(ObjectArrays.concat(modList, supplementalModFileCandidates, File.class)); + for (File modFile : modList) + { + // skip loaded coremods + if (CoreModManager.getLoadedCoremods().contains(modFile.getName())) + { + FMLLog.finer("Skipping already parsed coremod or tweaker %s", modFile.getName()); + } + else if (modFile.isDirectory()) + { + FMLLog.fine("Found a candidate mod directory %s", modFile.getName()); + candidates.add(new ModCandidate(modFile, modFile, ContainerType.DIR)); + } + else + { + Matcher matcher = zipJar.matcher(modFile.getName()); + + if (matcher.matches()) + { + FMLLog.fine("Found a candidate zip or jar file %s", matcher.group(0)); + candidates.add(new ModCandidate(modFile, modFile, ContainerType.JAR)); + } + else + { + FMLLog.fine("Ignoring unknown file %s in mods directory", modFile.getName()); + } + } + } + } + + public List identifyMods() + { + List modList = Lists.newArrayList(); + + for (ModCandidate candidate : candidates) + { + try + { + List mods = candidate.explore(dataTable); + if (mods.isEmpty() && !candidate.isClasspath()) + { + nonModLibs.add(candidate.getModContainer()); + } + else + { + modList.addAll(mods); + } + } + catch (LoaderException le) + { + FMLLog.log(Level.WARN, le, "Identified a problem with the mod candidate %s, ignoring this source", candidate.getModContainer()); + } + catch (Throwable t) + { + Throwables.propagate(t); + } + } + + return modList; + } + + public ASMDataTable getASMTable() + { + return dataTable; + } + + public List getNonModLibs() + { + return nonModLibs; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ASMModParser.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ASMModParser.java new file mode 100644 index 0000000..38529da --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ASMModParser.java @@ -0,0 +1,186 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery.asm; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import org.apache.logging.log4j.Level; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.Type; + +import com.google.common.base.Objects; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ModCandidate; + +public class ASMModParser +{ + + private Type asmType; + private int classVersion; + private Type asmSuperType; + private LinkedList annotations = Lists.newLinkedList(); + private String baseModProperties; + + static enum AnnotationType + { + CLASS, FIELD, METHOD, SUBTYPE; + } + + public ASMModParser(InputStream stream) throws IOException + { + try + { + ClassReader reader = new ClassReader(stream); + reader.accept(new ModClassVisitor(this), 0); + } + catch (Exception ex) + { + FMLLog.log(Level.ERROR, ex, "Unable to read a class file correctly"); + throw new LoaderException(ex); + } + } + + public void beginNewTypeName(String typeQName, int classVersion, String superClassQName) + { + this.asmType = Type.getObjectType(typeQName); + this.classVersion = classVersion; + this.asmSuperType = !Strings.isNullOrEmpty(superClassQName) ? Type.getObjectType(superClassQName) : null; + } + + public void startClassAnnotation(String annotationName) + { + ModAnnotation ann = new ModAnnotation(AnnotationType.CLASS, Type.getType(annotationName), this.asmType.getClassName()); + annotations.addFirst(ann); + } + + public void addAnnotationProperty(String key, Object value) + { + annotations.getFirst().addProperty(key, value); + } + + public void startFieldAnnotation(String fieldName, String annotationName) + { + ModAnnotation ann = new ModAnnotation(AnnotationType.FIELD, Type.getType(annotationName), fieldName); + annotations.addFirst(ann); + } + + @Override + public String toString() + { + return Objects.toStringHelper("ASMAnnotationDiscoverer") + .add("className", asmType.getClassName()) + .add("classVersion", classVersion) + .add("superName", asmSuperType.getClassName()) + .add("annotations", annotations) + .add("isBaseMod", isBaseMod(Collections.emptyList())) + .add("baseModProperties", baseModProperties) + .toString(); + } + + public Type getASMType() + { + return asmType; + } + + public int getClassVersion() + { + return classVersion; + } + + public Type getASMSuperType() + { + return asmSuperType; + } + + public LinkedList getAnnotations() + { + return annotations; + } + + public void validate() + { +// if (classVersion > 50.0) +// { +// +// throw new LoaderException(new RuntimeException("Mod compiled for Java 7 detected")); +// } + } + + public boolean isBaseMod(List rememberedTypes) + { + return getASMSuperType().equals(Type.getType("LBaseMod;")) || getASMSuperType().equals(Type.getType("Lnet/minecraft/src/BaseMod;"))|| rememberedTypes.contains(getASMSuperType().getClassName()); + } + + public void setBaseModProperties(String foundProperties) + { + this.baseModProperties = foundProperties; + } + + public String getBaseModProperties() + { + return this.baseModProperties; + } + + public void sendToTable(ASMDataTable table, ModCandidate candidate) + { + for (ModAnnotation ma : annotations) + { + table.addASMData(candidate, ma.asmType.getClassName(), this.asmType.getClassName(), ma.member, ma.values); + } + } + + public void addAnnotationArray(String name) + { + annotations.getFirst().addArray(name); + } + + public void addAnnotationEnumProperty(String name, String desc, String value) + { + annotations.getFirst().addEnumProperty(name, desc, value); + + } + + public void endArray() + { + annotations.getFirst().endArray(); + + } + + public void addSubAnnotation(String name, String desc) + { + ModAnnotation ma = annotations.getFirst(); + annotations.addFirst(ma.addChildAnnotation(name, desc)); + } + + public void endSubAnnotation() + { + // take the child and stick it at the end + ModAnnotation child = annotations.removeFirst(); + annotations.addLast(child); + } + + public void startMethodAnnotation(String methodName, String methodDescriptor, String annotationName) + { + ModAnnotation ann = new ModAnnotation(AnnotationType.METHOD, Type.getType(annotationName), methodName+methodDescriptor); + annotations.addFirst(ann); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotation.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotation.java new file mode 100644 index 0000000..866cbc6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotation.java @@ -0,0 +1,122 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery.asm; + +import java.util.ArrayList; +import java.util.Map; + +import org.objectweb.asm.Type; + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.discovery.asm.ASMModParser.AnnotationType; + +public class ModAnnotation +{ + public class EnumHolder + { + @SuppressWarnings("unused") + private String desc; + @SuppressWarnings("unused") + private String value; + + public EnumHolder(String desc, String value) + { + this.desc = desc; + this.value = value; + } + + } + AnnotationType type; + Type asmType; + String member; + Map values = Maps.newHashMap(); + private ArrayList arrayList; + private String arrayName; + public ModAnnotation(AnnotationType type, Type asmType, String member) + { + this.type = type; + this.asmType = asmType; + this.member = member; + } + + public ModAnnotation(AnnotationType type, Type asmType, ModAnnotation parent) + { + this.type = type; + this.asmType = asmType; + } + @Override + public String toString() + { + return Objects.toStringHelper("Annotation") + .add("type",type) + .add("name",asmType.getClassName()) + .add("member",member) + .add("values", values) + .toString(); + } + public AnnotationType getType() + { + return type; + } + public Type getASMType() + { + return asmType; + } + public String getMember() + { + return member; + } + public Map getValues() + { + return values; + } + public void addArray(String name) + { + this.arrayList = Lists.newArrayList(); + this.arrayName = name; + } + public void addProperty(String key, Object value) + { + if (this.arrayList != null) + { + arrayList.add(value); + } + else + { + values.put(key, value); + } + } + + public void addEnumProperty(String key, String enumName, String value) + { + values.put(key, new EnumHolder(enumName, value)); + } + + public void endArray() + { + values.put(arrayName, arrayList); + arrayList = null; + } + public ModAnnotation addChildAnnotation(String name, String desc) + { + ModAnnotation child = new ModAnnotation(AnnotationType.SUBTYPE, Type.getType(desc), this); + if (arrayList != null) + { + arrayList.add(child.getValues()); + } + return child; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.java new file mode 100644 index 0000000..80b899d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModAnnotationVisitor.java @@ -0,0 +1,82 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery.asm; + +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Opcodes; + +public class ModAnnotationVisitor extends AnnotationVisitor +{ + private ASMModParser discoverer; + private boolean array; + @SuppressWarnings("unused") + private String name; + private boolean isSubAnnotation; + + public ModAnnotationVisitor(ASMModParser discoverer) + { + super(Opcodes.ASM5); + this.discoverer = discoverer; + } + + public ModAnnotationVisitor(ASMModParser discoverer, String name) + { + this(discoverer); + this.array = true; + this.name = name; + discoverer.addAnnotationArray(name); + } + + public ModAnnotationVisitor(ASMModParser discoverer, boolean isSubAnnotation) + { + this(discoverer); + this.isSubAnnotation = true; + } + + @Override + public void visit(String key, Object value) + { + discoverer.addAnnotationProperty(key, value); + } + + @Override + public void visitEnum(String name, String desc, String value) + { + discoverer.addAnnotationEnumProperty(name, desc, value); + } + + @Override + public AnnotationVisitor visitArray(String name) + { + return new ModAnnotationVisitor(discoverer, name); + } + @Override + public AnnotationVisitor visitAnnotation(String name, String desc) + { + discoverer.addSubAnnotation(name, desc); + return new ModAnnotationVisitor(discoverer, true); + } + @Override + public void visitEnd() + { + if (array) + { + discoverer.endArray(); + } + + if (isSubAnnotation) + { + discoverer.endSubAnnotation(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModClassVisitor.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModClassVisitor.java new file mode 100644 index 0000000..46ea450 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModClassVisitor.java @@ -0,0 +1,57 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery.asm; + +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +public class ModClassVisitor extends ClassVisitor +{ + private ASMModParser discoverer; + + public ModClassVisitor(ASMModParser discoverer) + { + super(Opcodes.ASM5); + this.discoverer = discoverer; + } + + + @Override + public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) + { + discoverer.beginNewTypeName(name, version, superName); + } + + @Override + public AnnotationVisitor visitAnnotation(String annotationName, boolean runtimeVisible) + { + discoverer.startClassAnnotation(annotationName); + return new ModAnnotationVisitor(discoverer); + } + + + @Override + public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) + { + return new ModFieldVisitor(name, discoverer); + } + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) + { + return new ModMethodVisitor(name, desc, discoverer); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.java new file mode 100644 index 0000000..b79b156 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModFieldVisitor.java @@ -0,0 +1,38 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.discovery.asm; + +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; + +public class ModFieldVisitor extends FieldVisitor +{ + + private String fieldName; + private ASMModParser discoverer; + + public ModFieldVisitor(String name, ASMModParser discoverer) + { + super(Opcodes.ASM5); + this.fieldName = name; + this.discoverer = discoverer; + } + + @Override + public AnnotationVisitor visitAnnotation(String annotationName, boolean runtimeVisible) + { + discoverer.startFieldAnnotation(fieldName, annotationName); + return new ModAnnotationVisitor(discoverer); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.java new file mode 100644 index 0000000..1ab5624 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/discovery/asm/ModMethodVisitor.java @@ -0,0 +1,28 @@ +package cpw.mods.fml.common.discovery.asm; + +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +public class ModMethodVisitor extends MethodVisitor { + + private String methodName; + private String methodDescriptor; + private ASMModParser discoverer; + + public ModMethodVisitor(String name, String desc, ASMModParser discoverer) + { + super(Opcodes.ASM5); + this.methodName = name; + this.methodDescriptor = desc; + this.discoverer = discoverer; + } + + @Override + public AnnotationVisitor visitAnnotation(String annotationName, boolean runtimeVisible) + { + discoverer.startMethodAnnotation(methodName, methodDescriptor, annotationName); + return new ModAnnotationVisitor(discoverer); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLConstructionEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLConstructionEvent.java new file mode 100644 index 0000000..51f5fe6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLConstructionEvent.java @@ -0,0 +1,55 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import com.google.common.collect.ListMultimap; + +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.common.ModClassLoader; +import cpw.mods.fml.common.discovery.ASMDataTable; + +public class FMLConstructionEvent extends FMLStateEvent +{ + private ModClassLoader modClassLoader; + private ASMDataTable asmData; + private ListMultimap reverseDependencies; + + @SuppressWarnings("unchecked") + public FMLConstructionEvent(Object... eventData) + { + this.modClassLoader = (ModClassLoader)eventData[0]; + this.asmData = (ASMDataTable) eventData[1]; + this.reverseDependencies = (ListMultimap) eventData[2]; + } + + public ModClassLoader getModClassLoader() + { + return modClassLoader; + } + + @Override + public ModState getModState() + { + return ModState.CONSTRUCTED; + } + + public ASMDataTable getASMHarvestedData() + { + return asmData; + } + + public ListMultimap getReverseDependencies() + { + return reverseDependencies; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLEvent.java new file mode 100644 index 0000000..100d52e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLEvent.java @@ -0,0 +1,31 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.ModContainer; + +public class FMLEvent +{ + public final String getEventType() + { + return getClass().getSimpleName(); + } + public final String description() + { + String cn = getClass().getName(); + return cn.substring(cn.lastIndexOf('.')+4,cn.length()-5); + } + public void applyModContainer(ModContainer activeContainer) { + // NO OP + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.java new file mode 100644 index 0000000..28f8f92 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLFingerprintViolationEvent.java @@ -0,0 +1,36 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import java.io.File; +import java.util.Set; + +import com.google.common.collect.ImmutableSet; + + +public class FMLFingerprintViolationEvent extends FMLEvent { + + public final boolean isDirectory; + public final Set fingerprints; + public final File source; + public final String expectedFingerprint; + + public FMLFingerprintViolationEvent(boolean isDirectory, File source, ImmutableSet fingerprints, String expectedFingerprint) + { + super(); + this.isDirectory = isDirectory; + this.source = source; + this.fingerprints = fingerprints; + this.expectedFingerprint = expectedFingerprint; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInitializationEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInitializationEvent.java new file mode 100644 index 0000000..79636d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInitializationEvent.java @@ -0,0 +1,31 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLInitializationEvent extends FMLStateEvent +{ + + public FMLInitializationEvent(Object... data) + { + super(data); + } + + @Override + public ModState getModState() + { + return ModState.INITIALIZED; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInterModComms.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInterModComms.java new file mode 100644 index 0000000..2a1fe4a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLInterModComms.java @@ -0,0 +1,219 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ImmutableList; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModContainer; + +/** + * Simple intermod communications to receive simple messages directed at you + * from other mods + * + * @author cpw + * + */ +public class FMLInterModComms { + private static final ImmutableList emptyIMCList = ImmutableList.of(); + private static ArrayListMultimap modMessages = ArrayListMultimap.create(); + + /** + * Subscribe to this event to receive your messages (they are sent between + * {@link Init} and {@link PostInit}) + * + * @author cpw + * + */ + public static class IMCEvent extends FMLEvent { + private ModContainer activeContainer; + + @Override + public void applyModContainer(ModContainer activeContainer) + { + this.activeContainer = activeContainer; + this.currentList = null; + FMLLog.finer("Attempting to deliver %d IMC messages to mod %s", modMessages.get(activeContainer.getModId()).size(), activeContainer.getModId()); + } + + private ImmutableList currentList; + + public ImmutableList getMessages() + { + if (currentList == null) + { + currentList = ImmutableList.copyOf(modMessages.removeAll(activeContainer.getModId())); + } + return currentList; + } + } + + /** + * You will receive an instance of this for each message sent + * + * @author cpw + * + */ + public static final class IMCMessage { + /** + * This is the modid of the mod that sent you the message + */ + private String sender; + /** + * This field, and {@link #value} are both at the mod's discretion + */ + public final String key; + /** + * This field, and {@link #key} are both at the mod's discretion + */ + private Object value; + + private IMCMessage(String key, Object value) + { + this.key = key; + this.value = value; + } + + @Override + public String toString() + { + return sender; + } + + public String getSender() + { + return this.sender; + } + + void setSender(ModContainer activeModContainer) + { + this.sender = activeModContainer.getModId(); + } + + public String getStringValue() + { + return (String) value; + } + + public NBTTagCompound getNBTValue() + { + return (NBTTagCompound) value; + } + + public ItemStack getItemStackValue() + { + return (ItemStack) value; + } + + public Class getMessageType() + { + return value.getClass(); + } + + public boolean isStringMessage() + { + return String.class.isAssignableFrom(getMessageType()); + } + + public boolean isItemStackMessage() + { + return ItemStack.class.isAssignableFrom(getMessageType()); + } + + public boolean isNBTMessage() + { + return NBTTagCompound.class.isAssignableFrom(getMessageType()); + } + } + + public static boolean sendMessage(String modId, String key, NBTTagCompound value) + { + return enqueueStartupMessage(modId, new IMCMessage(key, value)); + } + public static boolean sendMessage(String modId, String key, ItemStack value) + { + return enqueueStartupMessage(modId, new IMCMessage(key, value)); + } + public static boolean sendMessage(String modId, String key, String value) + { + return enqueueStartupMessage(modId, new IMCMessage(key, value)); + } + + public static void sendRuntimeMessage(Object sourceMod, String modId, String key, NBTTagCompound value) + { + enqueueMessage(sourceMod, modId, new IMCMessage(key, value)); + } + + public static void sendRuntimeMessage(Object sourceMod, String modId, String key, ItemStack value) + { + enqueueMessage(sourceMod, modId, new IMCMessage(key, value)); + } + + public static void sendRuntimeMessage(Object sourceMod, String modId, String key, String value) + { + enqueueMessage(sourceMod, modId, new IMCMessage(key, value)); + } + + private static boolean enqueueStartupMessage(String modTarget, IMCMessage message) + { + if (Loader.instance().activeModContainer() == null) + { + return false; + } + enqueueMessage(Loader.instance().activeModContainer(), modTarget, message); + return Loader.isModLoaded(modTarget) && !Loader.instance().hasReachedState(LoaderState.POSTINITIALIZATION); + + } + private static void enqueueMessage(Object sourceMod, String modTarget, IMCMessage message) + { + ModContainer mc; + if (sourceMod instanceof ModContainer) { + mc = (ModContainer) sourceMod; + } + else + { + mc = FMLCommonHandler.instance().findContainerFor(sourceMod); + } + if (mc != null && Loader.isModLoaded(modTarget)) + { + message.setSender(mc); + modMessages.put(modTarget, message); + } + } + + /** + * Retrieve any pending runtime messages for the mod + * @param forMod The {@link Instance} of the Mod to fetch messages for + * @return any messages - the collection will never be null + */ + public static ImmutableList fetchRuntimeMessages(Object forMod) + { + ModContainer mc = FMLCommonHandler.instance().findContainerFor(forMod); + if (mc != null) + { + return ImmutableList.copyOf(modMessages.removeAll(mc.getModId())); + } + else + { + return emptyIMCList; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadCompleteEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadCompleteEvent.java new file mode 100644 index 0000000..e71ccb3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadCompleteEvent.java @@ -0,0 +1,31 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLLoadCompleteEvent extends FMLStateEvent +{ + + public FMLLoadCompleteEvent(Object... data) + { + super(data); + } + + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadEvent.java new file mode 100644 index 0000000..14304d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLLoadEvent.java @@ -0,0 +1,18 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +public class FMLLoadEvent +{ + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java new file mode 100644 index 0000000..24fe35c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java @@ -0,0 +1,205 @@ +package cpw.mods.fml.common.event; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ListMultimap; + +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.common.registry.GameRegistry; + +/** + * This event is fired if a world is loaded that has block and item mappings referring the mod that are not + * in existence. + * These can be remapped to other existing objects, or simply discarded. + * Use get() and getAll() to process this event. + * + * @author cpw, Player + * + */ +public class FMLMissingMappingsEvent extends FMLEvent { + /** + * Actions you can take with this missing mapping. + *
    + *
  • {@link #IGNORE} means this missing mapping will be ignored. + *
  • {@link #WARN} means this missing mapping will generate a warning. + *
  • {@link #FAIL} means this missing mapping will prevent the world from loading. + *
+ * @author cpw + * + */ + public static enum Action { + /** + * Take the default action + */ + DEFAULT, + /** + * Ignore this missing mapping. This means the mapping will be abandoned + */ + IGNORE, + /** + * Generate a warning but allow loading to continue + */ + WARN, + /** + * Fail to load + */ + FAIL, + /** + * Remap this name to a new name (add a migration mapping) + */ + REMAP, + /** + * Allow a block to exist without itemblock anymore + */ + BLOCKONLY + } + public static class MissingMapping { + public final GameRegistry.Type type; + public final String name; + public final int id; + private Action action = Action.DEFAULT; + private Object target; + + public MissingMapping(String name, int id) + { + this.type = name.charAt(0) == '\u0001' ? GameRegistry.Type.BLOCK : GameRegistry.Type.ITEM; + this.name = name.substring(1); + this.id = id; + } + /** + * @deprecated use ignore(), warn(), fail() or remap() instead + */ + @Deprecated + public void setAction(Action target) + { + if (target == Action.DEFAULT || target == Action.REMAP || target == Action.BLOCKONLY) throw new IllegalArgumentException(); + + this.action = target; + } + + /** + * Ignore the missing item. + */ + public void ignore() + { + action = Action.IGNORE; + } + + /** + * Warn the user about the missing item. + */ + public void warn() + { + action = Action.WARN; + } + + /** + * Prevent the world from loading due to the missing item. + */ + public void fail() + { + action = Action.FAIL; + } + + /** + * Remap the missing item to the specified Block. + * + * Use this if you have renamed a Block, don't forget to handle the ItemBlock. + * Existing references using the old name will point to the new one. + * + * @param target Block to remap to. + */ + public void remap(Block target) + { + if (type != GameRegistry.Type.BLOCK) throw new IllegalArgumentException("Can't remap an item to a block."); + if (target == null) throw new NullPointerException("remap target is null"); + if (GameData.getBlockRegistry().getId(target) < 0) throw new IllegalArgumentException(String.format("The specified block %s hasn't been registered at startup.", target)); + + action = Action.REMAP; + this.target = target; + } + + /** + * Remap the missing item to the specified Item. + * + * Use this if you have renamed an Item. + * Existing references using the old name will point to the new one. + * + * @param target Item to remap to. + */ + public void remap(Item target) + { + if (type != GameRegistry.Type.ITEM) throw new IllegalArgumentException("Can't remap a block to an item."); + if (target == null) throw new NullPointerException("remap target is null"); + if (GameData.getItemRegistry().getId(target) < 0) throw new IllegalArgumentException(String.format("The specified item %s hasn't been registered at startup.", target)); + + action = Action.REMAP; + this.target = target; + } + + public void skipItemBlock() + { + if (type != GameRegistry.Type.ITEM) throw new IllegalArgumentException("Cannot skip an item that is a block"); + if (GameData.getBlockRegistry().getRaw(id) == null) throw new IllegalArgumentException("Cannot skip an ItemBlock that doesn't have a Block"); + action = Action.BLOCKONLY; + } + // internal + + public Action getAction() + { + return this.action; + } + + public Object getTarget() + { + return target; + } + } + private ListMultimap missing; + private ModContainer activeContainer; + + public FMLMissingMappingsEvent(ListMultimap missingMappings) + { + this.missing = missingMappings; + } + + @Override + public void applyModContainer(ModContainer activeContainer) + { + super.applyModContainer(activeContainer); + this.activeContainer = activeContainer; + } + + /** + * Get the list of missing mappings for the active mod. + * + * Process the list entries by calling ignore(), warn(), fail() or remap() on each entry. + * + * @return list of missing mappings + */ + public List get() + { + return ImmutableList.copyOf(missing.get(activeContainer.getModId())); + } + + /** + * Get the list of missing mappings for all mods. + * + * Only use this if you need to handle mod id changes, e.g. if you renamed your mod or + * split/merge into/from multiple mods. + * + * Process the list entries by calling ignore(), warn(), fail() or remap() on each entry you + * want to handle. + * + * @return list of missing mappings + */ + public List getAll() + { + return ImmutableList.copyOf(missing.values()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModDisabledEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModDisabledEvent.java new file mode 100644 index 0000000..54315d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModDisabledEvent.java @@ -0,0 +1,4 @@ +package cpw.mods.fml.common.event; + +public class FMLModDisabledEvent extends FMLEvent { +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModIdMappingEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModIdMappingEvent.java new file mode 100644 index 0000000..5f1b317 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLModIdMappingEvent.java @@ -0,0 +1,48 @@ +package cpw.mods.fml.common.event; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +public class FMLModIdMappingEvent extends FMLEvent { + public static enum RemapTarget { BLOCK, ITEM } + public class ModRemapping + { + public final int oldId; + public final int newId; + public final String tag; + public final RemapTarget remapTarget; + public ModRemapping(int oldId, int newId, String tag) + { + this.oldId = oldId; + this.newId = newId; + this.tag = tag.substring(1); + this.remapTarget = tag.charAt(0) == '\u0001' ? RemapTarget.BLOCK : RemapTarget.ITEM; + } + + } + public final ImmutableList remappedIds; + + public FMLModIdMappingEvent(Map mappings) + { + List remappings = Lists.newArrayList(); + for (Entry mapping : mappings.entrySet()) + { + remappings.add(new ModRemapping(mapping.getValue()[0], mapping.getValue()[1], mapping.getKey())); + } + + Collections.sort(remappings, new Comparator() { + @Override + public int compare(ModRemapping o1, ModRemapping o2) + { + return (o1.newId < o2.newId) ? -1 : ((o1.newId == o2.newId) ? 0 : 1); + } + }); + remappedIds = ImmutableList.copyOf(remappings); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPostInitializationEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPostInitializationEvent.java new file mode 100644 index 0000000..8f460ab --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPostInitializationEvent.java @@ -0,0 +1,50 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLPostInitializationEvent extends FMLStateEvent +{ + public FMLPostInitializationEvent(Object... data) + { + super(data); + } + + @Override + public ModState getModState() + { + return ModState.POSTINITIALIZED; + } + + public Object buildSoftDependProxy(String modId, String className) + { + if (Loader.isModLoaded(modId)) + { + try + { + Class clz = Class.forName(className,true,Loader.instance().getModClassLoader()); + return clz.newInstance(); + } + catch (Exception e) + { + Throwables.propagateIfPossible(e); + return null; + } + } + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPreInitializationEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPreInitializationEvent.java new file mode 100644 index 0000000..0d497b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLPreInitializationEvent.java @@ -0,0 +1,132 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import java.io.File; +import java.security.CodeSource; +import java.security.cert.Certificate; +import java.util.Properties; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.common.FMLModContainer; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.discovery.ASMDataTable; + +public class FMLPreInitializationEvent extends FMLStateEvent +{ + private ModMetadata modMetadata; + private File sourceFile; + private File configurationDir; + private File suggestedConfigFile; + private ASMDataTable asmData; + private ModContainer modContainer; + + public FMLPreInitializationEvent(Object... data) + { + super(data); + this.asmData = (ASMDataTable)data[0]; + this.configurationDir = (File)data[1]; + } + + @Override + public ModState getModState() + { + return ModState.PREINITIALIZED; + } + + @Override + public void applyModContainer(ModContainer activeContainer) + { + this.modContainer = activeContainer; + this.modMetadata = activeContainer.getMetadata(); + this.sourceFile = activeContainer.getSource(); + this.suggestedConfigFile = new File(configurationDir, activeContainer.getModId()+".cfg"); + } + + public File getSourceFile() + { + return sourceFile; + } + + public ModMetadata getModMetadata() + { + return modMetadata; + } + + public File getModConfigurationDirectory() + { + return configurationDir; + } + + public File getSuggestedConfigurationFile() + { + return suggestedConfigFile; + } + + public ASMDataTable getAsmData() + { + return asmData; + } + + public Properties getVersionProperties() + { + if (this.modContainer instanceof FMLModContainer) + { + return ((FMLModContainer)this.modContainer).searchForVersionProperties(); + } + + return null; + } + + /** + * Get a logger instance configured to write to the FML Log as a parent, identified by modid. Handy for mod logging! + * Configurations can be applied through the config/logging.properties file, specifying logging levels + * for your ModID. Use this! + * + * @return A logger + */ + public Logger getModLog() + { + Logger log = LogManager.getLogger(modContainer.getModId()); + return log; + } + + + /** + * Retrieve the FML signing certificates, if any. Validate these against the + * published FML certificates in your mod, if you wish. + * + * Deprecated because mods should NOT trust this code. Rather + * they should copy this, or something like this, into their own mods. + * + * @return Certificates used to sign FML and Forge + */ + @Deprecated + public Certificate[] getFMLSigningCertificates() + { + CodeSource codeSource = getClass().getClassLoader().getParent().getClass().getProtectionDomain().getCodeSource(); + Certificate[] certs = codeSource.getCertificates(); + if (certs == null) + { + return new Certificate[0]; + } + else + { + return certs; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.java new file mode 100644 index 0000000..d98e08d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerAboutToStartEvent.java @@ -0,0 +1,37 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLServerAboutToStartEvent extends FMLStateEvent { + + private MinecraftServer server; + + public FMLServerAboutToStartEvent(Object... data) + { + super(data); + this.server = (MinecraftServer) data[0]; + } + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + + public MinecraftServer getServer() + { + return server; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartedEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartedEvent.java new file mode 100644 index 0000000..e52bfd0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartedEvent.java @@ -0,0 +1,31 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLServerStartedEvent extends FMLStateEvent +{ + + public FMLServerStartedEvent(Object... data) + { + super(data); + } + + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java new file mode 100644 index 0000000..7999048 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStartingEvent.java @@ -0,0 +1,46 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import net.minecraft.command.CommandHandler; +import net.minecraft.command.ICommand; +import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLServerStartingEvent extends FMLStateEvent +{ + + private MinecraftServer server; + + public FMLServerStartingEvent(Object... data) + { + super(data); + this.server = (MinecraftServer) data[0]; + } + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + + public MinecraftServer getServer() + { + return server; + } + + public void registerServerCommand(ICommand command) + { + CommandHandler ch = (CommandHandler) getServer().getCommandManager(); + ch.registerCommand(command); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppedEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppedEvent.java new file mode 100644 index 0000000..a0f41f9 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppedEvent.java @@ -0,0 +1,29 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLServerStoppedEvent extends FMLStateEvent { + + public FMLServerStoppedEvent(Object... data) + { + super(data); + } + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppingEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppingEvent.java new file mode 100644 index 0000000..3c46faa --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLServerStoppingEvent.java @@ -0,0 +1,31 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.LoaderState.ModState; + +public class FMLServerStoppingEvent extends FMLStateEvent +{ + + public FMLServerStoppingEvent(Object... data) + { + super(data); + } + + @Override + public ModState getModState() + { + return ModState.AVAILABLE; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLStateEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLStateEvent.java new file mode 100644 index 0000000..7c33be1 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/event/FMLStateEvent.java @@ -0,0 +1,32 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.event; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.LoaderState.ModState; +import cpw.mods.fml.relauncher.Side; + +public abstract class FMLStateEvent extends FMLEvent +{ + public FMLStateEvent(Object... data) + { + + } + + public abstract ModState getModState(); + + public Side getSide() + { + return FMLCommonHandler.instance().getSide(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java new file mode 100644 index 0000000..568e2ba --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ASMEventHandler.java @@ -0,0 +1,151 @@ +package cpw.mods.fml.common.eventhandler; + +import static org.objectweb.asm.Opcodes.*; + +import java.lang.reflect.Method; +import java.util.HashMap; + +import org.apache.logging.log4j.ThreadContext; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Type; + +import com.google.common.collect.Maps; +import cpw.mods.fml.common.ModContainer; + + +public class ASMEventHandler implements IEventListener +{ + private static int IDs = 0; + private static final String HANDLER_DESC = Type.getInternalName(IEventListener.class); + private static final String HANDLER_FUNC_DESC = Type.getMethodDescriptor(IEventListener.class.getDeclaredMethods()[0]); + private static final ASMClassLoader LOADER = new ASMClassLoader(); + private static final HashMap> cache = Maps.newHashMap(); + private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false")); + + private final IEventListener handler; + private final SubscribeEvent subInfo; + private ModContainer owner; + private String readable; + + public ASMEventHandler(Object target, Method method, ModContainer owner) throws Exception + { + this.owner = owner; + handler = (IEventListener)createWrapper(method).getConstructor(Object.class).newInstance(target); + subInfo = method.getAnnotation(SubscribeEvent.class); + readable = "ASM: " + target + " " + method.getName() + Type.getMethodDescriptor(method); + } + + @Override + public void invoke(Event event) + { + if (owner != null && GETCONTEXT) + { + ThreadContext.put("mod", owner.getName()); + } + else if (GETCONTEXT) + { + ThreadContext.put("mod", ""); + } + if (handler != null) + { + if (!event.isCancelable() || !event.isCanceled() || subInfo.receiveCanceled()) + { + handler.invoke(event); + } + } + if (GETCONTEXT) + ThreadContext.remove("mod"); + } + + public EventPriority getPriority() + { + return subInfo.priority(); + } + + public Class createWrapper(Method callback) + { + if (cache.containsKey(callback)) + { + return cache.get(callback); + } + + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + String name = getUniqueName(callback); + String desc = name.replace('.', '/'); + String instType = Type.getInternalName(callback.getDeclaringClass()); + String eventType = Type.getInternalName(callback.getParameterTypes()[0]); + + /* + System.out.println("Name: " + name); + System.out.println("Desc: " + desc); + System.out.println("InstType: " + instType); + System.out.println("Callback: " + callback.getName() + Type.getMethodDescriptor(callback)); + System.out.println("Event: " + eventType); + */ + + cw.visit(V1_6, ACC_PUBLIC | ACC_SUPER, desc, null, "java/lang/Object", new String[]{ HANDLER_DESC }); + + cw.visitSource(".dynamic", null); + { + cw.visitField(ACC_PUBLIC, "instance", "Ljava/lang/Object;", null, null).visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "", "(Ljava/lang/Object;)V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false); + mv.visitVarInsn(ALOAD, 0); + mv.visitVarInsn(ALOAD, 1); + mv.visitFieldInsn(PUTFIELD, desc, "instance", "Ljava/lang/Object;"); + mv.visitInsn(RETURN); + mv.visitMaxs(2, 2); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "invoke", HANDLER_FUNC_DESC, null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitFieldInsn(GETFIELD, desc, "instance", "Ljava/lang/Object;"); + mv.visitTypeInsn(CHECKCAST, instType); + mv.visitVarInsn(ALOAD, 1); + mv.visitTypeInsn(CHECKCAST, eventType); + mv.visitMethodInsn(INVOKEVIRTUAL, instType, callback.getName(), Type.getMethodDescriptor(callback), false); + mv.visitInsn(RETURN); + mv.visitMaxs(2, 2); + mv.visitEnd(); + } + cw.visitEnd(); + Class ret = LOADER.define(name, cw.toByteArray()); + cache.put(callback, ret); + return ret; + } + + private String getUniqueName(Method callback) + { + return String.format("%s_%d_%s_%s_%s", getClass().getName(), IDs++, + callback.getDeclaringClass().getSimpleName(), + callback.getName(), + callback.getParameterTypes()[0].getSimpleName()); + } + + private static class ASMClassLoader extends ClassLoader + { + private ASMClassLoader() + { + super(ASMClassLoader.class.getClassLoader()); + } + + public Class define(String name, byte[] data) + { + return defineClass(name, data, 0, data.length); + } + } + + public String toString() + { + return readable; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Cancelable.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Cancelable.java new file mode 100644 index 0000000..d3f926e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Cancelable.java @@ -0,0 +1,11 @@ +package cpw.mods.fml.common.eventhandler; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +@Retention(value = RUNTIME) +@Target(value = TYPE) +public @interface Cancelable{} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Event.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Event.java new file mode 100644 index 0000000..ef7a92e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/Event.java @@ -0,0 +1,142 @@ +package cpw.mods.fml.common.eventhandler; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.google.common.base.Preconditions; + + +/** + * Base Event class that all other events are derived from + */ +public class Event +{ + @Retention(value = RUNTIME) + @Target(value = TYPE) + public @interface HasResult{} + + public enum Result + { + DENY, + DEFAULT, + ALLOW + } + + private boolean isCanceled = false; + private Result result = Result.DEFAULT; + private static ListenerList listeners = new ListenerList(); + private EventPriority phase = null; + + public Event() + { + setup(); + } + + /** + * Determine if this function is cancelable at all. + * @return If access to setCanceled should be allowed + * + * Note: + * Events with the Cancelable annotation will have this method automatically added to return true. + */ + public boolean isCancelable() + { + return false; + } + + /** + * Determine if this event is canceled and should stop executing. + * @return The current canceled state + */ + public boolean isCanceled() + { + return isCanceled; + } + + /** + * Sets the state of this event, not all events are cancelable, and any attempt to + * cancel a event that can't be will result in a IllegalArgumentException. + * + * The functionality of setting the canceled state is defined on a per-event bases. + * + * @param cancel The new canceled value + */ + public void setCanceled(boolean cancel) + { + if (!isCancelable()) + { + throw new IllegalArgumentException("Attempted to cancel a uncancelable event"); + } + isCanceled = cancel; + } + + /** + * Determines if this event expects a significant result value. + * + * Note: + * Events with the HasResult annotation will have this method automatically added to return true. + */ + public boolean hasResult() + { + return false; + } + + /** + * Returns the value set as the result of this event + */ + public Result getResult() + { + return result; + } + + /** + * Sets the result value for this event, not all events can have a result set, and any attempt to + * set a result for a event that isn't expecting it will result in a IllegalArgumentException. + * + * The functionality of setting the result is defined on a per-event bases. + * + * @param value The new result + */ + public void setResult(Result value) + { + result = value; + } + /** + * Called by the base constructor, this is used by ASM generated + * event classes to setup various functionality such as the listenerlist. + */ + protected void setup() + { + } + + /** + * Returns a ListenerList object that contains all listeners + * that are registered to this event. + * + * @return Listener List + */ + public ListenerList getListenerList() + { + return listeners; + } + + @Nullable + public EventPriority getPhase() + { + return this.phase; + } + + public void setPhase(@Nonnull EventPriority value) + { + Preconditions.checkArgument(value != null, "setPhase argument must not be null"); + int prev = phase == null ? -1 : phase.ordinal(); + Preconditions.checkArgument(prev < value.ordinal(), "Attempted to set event phase to %s when already %s", value, phase); + phase = value; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventBus.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventBus.java new file mode 100644 index 0000000..a15d266 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventBus.java @@ -0,0 +1,161 @@ +package cpw.mods.fml.common.eventhandler; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import javax.annotation.Nonnull; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import com.google.common.collect.MapMaker; +import com.google.common.reflect.TypeToken; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; + +public class EventBus implements IEventExceptionHandler +{ + private static int maxID = 0; + + private ConcurrentHashMap> listeners = new ConcurrentHashMap>(); + private Map listenerOwners = new MapMaker().weakKeys().weakValues().makeMap(); + private final int busID = maxID++; + private IEventExceptionHandler exceptionHandler; + + public EventBus() + { + ListenerList.resize(busID + 1); + exceptionHandler = this; + } + + public EventBus(@Nonnull IEventExceptionHandler handler) + { + this(); + Preconditions.checkArgument(handler != null, "EventBus exception handler can not be null"); + exceptionHandler = handler; + } + + public void register(Object target) + { + if (listeners.containsKey(target)) + { + return; + } + + ModContainer activeModContainer = Loader.instance().activeModContainer(); + if (activeModContainer == null) + { + FMLLog.log(Level.ERROR, new Throwable(), "Unable to determine registrant mod for %s. This is a critical error and should be impossible", target); + activeModContainer = Loader.instance().getMinecraftModContainer(); + } + listenerOwners.put(target, activeModContainer); + Set> supers = TypeToken.of(target.getClass()).getTypes().rawTypes(); + for (Method method : target.getClass().getMethods()) + { + for (Class cls : supers) + { + try + { + Method real = cls.getDeclaredMethod(method.getName(), method.getParameterTypes()); + if (real.isAnnotationPresent(SubscribeEvent.class)) + { + Class[] parameterTypes = method.getParameterTypes(); + if (parameterTypes.length != 1) + { + throw new IllegalArgumentException( + "Method " + method + " has @SubscribeEvent annotation, but requires " + parameterTypes.length + + " arguments. Event handler methods must require a single argument." + ); + } + + Class eventType = parameterTypes[0]; + + if (!Event.class.isAssignableFrom(eventType)) + { + throw new IllegalArgumentException("Method " + method + " has @SubscribeEvent annotation, but takes a argument that is not an Event " + eventType); + } + + register(eventType, target, method, activeModContainer); + break; + } + } + catch (NoSuchMethodException e) + { + ; + } + } + } + } + + private void register(Class eventType, Object target, Method method, ModContainer owner) + { + try + { + Constructor ctr = eventType.getConstructor(); + ctr.setAccessible(true); + Event event = (Event)ctr.newInstance(); + ASMEventHandler listener = new ASMEventHandler(target, method, owner); + event.getListenerList().register(busID, listener.getPriority(), listener); + + ArrayList others = listeners.get(target); + if (others == null) + { + others = new ArrayList(); + listeners.put(target, others); + } + others.add(listener); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + public void unregister(Object object) + { + ArrayList list = listeners.remove(object); + if (list == null) + return; + for (IEventListener listener : list) + { + ListenerList.unregisterAll(busID, listener); + } + } + + public boolean post(Event event) + { + IEventListener[] listeners = event.getListenerList().getListeners(busID); + int index = 0; + try + { + for (; index < listeners.length; index++) + { + listeners[index].invoke(event); + } + } + catch (Throwable throwable) + { + exceptionHandler.handleException(this, event, listeners, index, throwable); + Throwables.propagate(throwable); + } + return (event.isCancelable() ? event.isCanceled() : false); + } + + @Override + public void handleException(EventBus bus, Event event, IEventListener[] listeners, int index, Throwable throwable) + { + FMLLog.log(Level.ERROR, throwable, "Exception caught during firing event %s:", event); + FMLLog.log(Level.ERROR, "Index: %d Listeners:", index); + for (int x = 0; x < listeners.length; x++) + { + FMLLog.log(Level.ERROR, "%d: %s", x, listeners[x]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventPriority.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventPriority.java new file mode 100644 index 0000000..51d255b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/EventPriority.java @@ -0,0 +1,23 @@ +package cpw.mods.fml.common.eventhandler; + +public enum EventPriority implements IEventListener +{ + /*Priority of event listeners, listeners will be sorted with respect to this priority level. + * + * Note: + * Due to using a ArrayList in the ListenerList, + * these need to stay in a contiguous index starting at 0. {Default ordinal} + */ + HIGHEST, //First to execute + HIGH, + NORMAL, + LOW, + LOWEST //Last to execute +; + + @Override + public void invoke(Event event) + { + event.setPhase(this); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.java new file mode 100644 index 0000000..037d4d8 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventExceptionHandler.java @@ -0,0 +1,16 @@ +package cpw.mods.fml.common.eventhandler; + +public interface IEventExceptionHandler +{ + /** + * Fired when a EventListener throws an exception for the specified event on the event bus. + * After this function returns, the original Throwable will be propogated upwards. + * + * @param bus The bus the event is being fired on + * @param event The event that is being fired + * @param listeners All listeners that are listening for this event, in order + * @param index Index for the current listener being fired. + * @param throwable The throwable being thrown + */ + void handleException(EventBus bus, Event event, IEventListener[] listeners, int index, Throwable throwable); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventListener.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventListener.java new file mode 100644 index 0000000..8175006 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/IEventListener.java @@ -0,0 +1,8 @@ +package cpw.mods.fml.common.eventhandler; + + + +public interface IEventListener +{ + public void invoke(Event event); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ListenerList.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ListenerList.java new file mode 100644 index 0000000..a2231cc --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/ListenerList.java @@ -0,0 +1,233 @@ +package cpw.mods.fml.common.eventhandler; + +import java.util.*; +import com.google.common.collect.ImmutableList; + + +public class ListenerList +{ + private static ImmutableList allLists = ImmutableList.of(); + private static int maxSize = 0; + + private ListenerList parent; + private ListenerListInst[] lists = new ListenerListInst[0]; + + public ListenerList() + { + this(null); + } + + public ListenerList(ListenerList parent) + { + // parent needs to be set before resize ! + this.parent = parent; + extendMasterList(this); + resizeLists(maxSize); + } + + private synchronized static void extendMasterList(ListenerList inst) + { + ImmutableList.Builder builder = ImmutableList.builder(); + builder.addAll(allLists); + builder.add(inst); + allLists = builder.build(); + } + + public static void resize(int max) + { + if (max <= maxSize) + { + return; + } + for (ListenerList list : allLists) + { + list.resizeLists(max); + } + maxSize = max; + } + + public void resizeLists(int max) + { + if (parent != null) + { + parent.resizeLists(max); + } + + if (lists.length >= max) + { + return; + } + + ListenerListInst[] newList = new ListenerListInst[max]; + int x = 0; + for (; x < lists.length; x++) + { + newList[x] = lists[x]; + } + for(; x < max; x++) + { + if (parent != null) + { + newList[x] = new ListenerListInst(parent.getInstance(x)); + } + else + { + newList[x] = new ListenerListInst(); + } + } + lists = newList; + } + + public static void clearBusID(int id) + { + for (ListenerList list : allLists) + { + list.lists[id].dispose(); + } + } + + protected ListenerListInst getInstance(int id) + { + return lists[id]; + } + + public IEventListener[] getListeners(int id) + { + return lists[id].getListeners(); + } + + public void register(int id, EventPriority priority, IEventListener listener) + { + lists[id].register(priority, listener); + } + + public void unregister(int id, IEventListener listener) + { + lists[id].unregister(listener); + } + + public static void unregisterAll(int id, IEventListener listener) + { + for (ListenerList list : allLists) + { + list.unregister(id, listener); + } + } + + private class ListenerListInst + { + private boolean rebuild = true; + private IEventListener[] listeners; + private ArrayList> priorities; + private ListenerListInst parent; + + private ListenerListInst() + { + int count = EventPriority.values().length; + priorities = new ArrayList>(count); + + for (int x = 0; x < count; x++) + { + priorities.add(new ArrayList()); + } + } + + public void dispose() + { + for (ArrayList listeners : priorities) + { + listeners.clear(); + } + priorities.clear(); + parent = null; + listeners = null; + } + + private ListenerListInst(ListenerListInst parent) + { + this(); + this.parent = parent; + } + + /** + * Returns a ArrayList containing all listeners for this event, + * and all parent events for the specified priority. + * + * The list is returned with the listeners for the children events first. + * + * @param priority The Priority to get + * @return ArrayList containing listeners + */ + public ArrayList getListeners(EventPriority priority) + { + ArrayList ret = new ArrayList(priorities.get(priority.ordinal())); + if (parent != null) + { + ret.addAll(parent.getListeners(priority)); + } + return ret; + } + + /** + * Returns a full list of all listeners for all priority levels. + * Including all parent listeners. + * + * List is returned in proper priority order. + * + * Automatically rebuilds the internal Array cache if its information is out of date. + * + * @return Array containing listeners + */ + public IEventListener[] getListeners() + { + if (shouldRebuild()) buildCache(); + return listeners; + } + + protected boolean shouldRebuild() + { + return rebuild || (parent != null && parent.shouldRebuild()); + } + + /** + * Rebuild the local Array of listeners, returns early if there is no work to do. + */ + private void buildCache() + { + if(parent != null && parent.shouldRebuild()) + { + parent.buildCache(); + } + + ArrayList ret = new ArrayList(); + for (EventPriority value : EventPriority.values()) + { + List listeners = getListeners(value); + if (listeners.size() > 0) + { + ret.add(value); //Add the priority to notify the event of it's current phase. + ret.addAll(listeners); + } + } + listeners = ret.toArray(new IEventListener[ret.size()]); + rebuild = false; + } + + public void register(EventPriority priority, IEventListener listener) + { + priorities.get(priority.ordinal()).add(listener); + rebuild = true; + } + + public void unregister(IEventListener listener) + { + for(ArrayList list : priorities) + { + if (list.remove(listener)) + { + rebuild = true; + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/SubscribeEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/SubscribeEvent.java new file mode 100644 index 0000000..ab11ccb --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/eventhandler/SubscribeEvent.java @@ -0,0 +1,15 @@ +package cpw.mods.fml.common.eventhandler; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.RetentionPolicy.*; +import static java.lang.annotation.ElementType.*; + +@Retention(value = RUNTIME) +@Target(value = METHOD) +public @interface SubscribeEvent +{ + public EventPriority priority() default EventPriority.NORMAL; + public boolean receiveCanceled() default false; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java new file mode 100644 index 0000000..f718177 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ArtifactVersionNameFunction.java @@ -0,0 +1,13 @@ +package cpw.mods.fml.common.functions; + +import com.google.common.base.Function; + +import cpw.mods.fml.common.versioning.ArtifactVersion; + +public class ArtifactVersionNameFunction implements Function { + @Override + public String apply(ArtifactVersion v) + { + return v.getLabel(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/CollectionWrapperFactory.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/CollectionWrapperFactory.java new file mode 100644 index 0000000..9603c48 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/CollectionWrapperFactory.java @@ -0,0 +1,32 @@ +package cpw.mods.fml.common.functions; + +import java.util.Collection; +import java.util.List; +import com.google.common.collect.Collections2; +import com.google.common.collect.Lists; + +public class CollectionWrapperFactory { + /** + * Return a read only cast view of the supplied ungeneric collection, based on the element type given + * @param coll The collection to cast + * @param elementType the supertype contained in the collection + * @return a collection asserting that type relationship + */ + public static Collection wrap(@SuppressWarnings("rawtypes") Collection coll, Class elementType) + { + Collection asGeneric = coll; + return Collections2.transform(asGeneric, new TypeCastFunction(elementType)); + } + + /** + * Return a read only cast view of the supplied ungeneric list, based on the element type given + * @param list The list to cast + * @param elementType the supertype contained in the list + * @return a list asserting that type relationship + */ + public static List wrap(@SuppressWarnings("rawtypes") List list, Class elementType) + { + List asGeneric = list; + return Lists.transform(asGeneric, new TypeCastFunction(elementType)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/GenericIterableFactory.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/GenericIterableFactory.java new file mode 100644 index 0000000..0826aef --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/GenericIterableFactory.java @@ -0,0 +1,25 @@ +package cpw.mods.fml.common.functions; + +import java.util.Iterator; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Iterators; + +public class GenericIterableFactory { + public static Iterable newCastingIterable(final Iterator input, final Class type) + { + return new Iterable() + { + @Override + public Iterator iterator() + { + return Iterators.transform(input, new TypeCastFunction(type)); + } + }; + } + + public static Iterable newCastingIterable(Iterable input, Class type) + { + return Iterables.transform(input, new TypeCastFunction(type)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModIdFunction.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModIdFunction.java new file mode 100644 index 0000000..158e830 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModIdFunction.java @@ -0,0 +1,26 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.functions; + +import com.google.common.base.Function; + +import cpw.mods.fml.common.ModContainer; + +public final class ModIdFunction implements Function +{ + @Override + public String apply(ModContainer container) + { + return container.getModId(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModNameFunction.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModNameFunction.java new file mode 100644 index 0000000..7ec839a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/ModNameFunction.java @@ -0,0 +1,27 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.functions; + +import com.google.common.base.Function; + +import cpw.mods.fml.common.ModContainer; + +public class ModNameFunction implements Function +{ + @Override + public String apply(ModContainer input) + { + return input.getName(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/TypeCastFunction.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/TypeCastFunction.java new file mode 100644 index 0000000..07cebd6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/functions/TypeCastFunction.java @@ -0,0 +1,17 @@ +package cpw.mods.fml.common.functions; + +import com.google.common.base.Function; + +public class TypeCastFunction implements Function { + private Class type; + public TypeCastFunction(Class type) + { + this.type = type; + } + + @Override + public T apply(Object input) + { + return type.cast(input); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/InputEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/InputEvent.java new file mode 100644 index 0000000..20a1796 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/InputEvent.java @@ -0,0 +1,8 @@ +package cpw.mods.fml.common.gameevent; + +import cpw.mods.fml.common.eventhandler.Event; + +public class InputEvent extends Event { + public static class MouseInputEvent extends InputEvent {} + public static class KeyInputEvent extends InputEvent {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/PlayerEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/PlayerEvent.java new file mode 100644 index 0000000..6298fed --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/PlayerEvent.java @@ -0,0 +1,75 @@ +package cpw.mods.fml.common.gameevent; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Event; + +public class PlayerEvent extends Event { + public final EntityPlayer player; + private PlayerEvent(EntityPlayer player) + { + this.player = player; + } + + public static class ItemPickupEvent extends PlayerEvent { + public final EntityItem pickedUp; + public ItemPickupEvent(EntityPlayer player, EntityItem pickedUp) + { + super(player); + this.pickedUp = pickedUp; + } + } + + public static class ItemCraftedEvent extends PlayerEvent { + public final ItemStack crafting; + public final IInventory craftMatrix; + public ItemCraftedEvent(EntityPlayer player, ItemStack crafting, IInventory craftMatrix) + { + super(player); + this.crafting = crafting; + this.craftMatrix = craftMatrix; + } + } + public static class ItemSmeltedEvent extends PlayerEvent { + public final ItemStack smelting; + public ItemSmeltedEvent(EntityPlayer player, ItemStack crafting) + { + super(player); + this.smelting = crafting; + } + } + + public static class PlayerLoggedInEvent extends PlayerEvent { + public PlayerLoggedInEvent(EntityPlayer player) + { + super(player); + } + } + + public static class PlayerLoggedOutEvent extends PlayerEvent { + public PlayerLoggedOutEvent(EntityPlayer player) + { + super(player); + } + } + + public static class PlayerRespawnEvent extends PlayerEvent { + public PlayerRespawnEvent(EntityPlayer player) + { + super(player); + } + } + + public static class PlayerChangedDimensionEvent extends PlayerEvent { + public final int fromDim; + public final int toDim; + public PlayerChangedDimensionEvent(EntityPlayer player, int fromDim, int toDim) + { + super(player); + this.fromDim = fromDim; + this.toDim = toDim; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/TickEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/TickEvent.java new file mode 100644 index 0000000..71cdfff --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/gameevent/TickEvent.java @@ -0,0 +1,67 @@ +package cpw.mods.fml.common.gameevent; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.relauncher.Side; + +public class TickEvent extends Event { + public enum Type { + WORLD, PLAYER, CLIENT, SERVER, RENDER; + } + + public enum Phase { + START, END; + } + public final Type type; + public final Side side; + public final Phase phase; + public TickEvent(Type type, Side side, Phase phase) + { + this.type = type; + this.side = side; + this.phase = phase; + } + + public static class ServerTickEvent extends TickEvent { + public ServerTickEvent(Phase phase) + { + super(Type.SERVER, Side.SERVER, phase); + } + } + + public static class ClientTickEvent extends TickEvent { + public ClientTickEvent(Phase phase) + { + super(Type.CLIENT, Side.CLIENT, phase); + } + } + + public static class WorldTickEvent extends TickEvent { + public final World world; + public WorldTickEvent(Side side, Phase phase, World world) + { + super(Type.WORLD, side, phase); + this.world = world; + } + } + public static class PlayerTickEvent extends TickEvent { + public final EntityPlayer player; + + public PlayerTickEvent(Phase phase, EntityPlayer player) + { + super(Type.PLAYER, player instanceof EntityPlayerMP ? Side.SERVER : Side.CLIENT, phase); + this.player = player; + } + } + + public static class RenderTickEvent extends TickEvent { + public final float renderTickTime; + public RenderTickEvent(Phase phase, float renderTickTime) + { + super(Type.RENDER, Side.CLIENT, phase); + this.renderTickTime = renderTickTime; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLDeobfTweaker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLDeobfTweaker.java new file mode 100644 index 0000000..3f79c4d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLDeobfTweaker.java @@ -0,0 +1,66 @@ +package cpw.mods.fml.common.launcher; + +import java.io.File; +import java.lang.reflect.Method; +import java.util.List; + +import cpw.mods.fml.relauncher.CoreModManager; +import cpw.mods.fml.relauncher.FMLInjectionData; +import cpw.mods.fml.relauncher.FMLRelaunchLog; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + +public class FMLDeobfTweaker implements ITweaker { + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + } + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + // Deobfuscation transformer, always last, and the access transformer tweaker as well + if (!(Boolean)Launch.blackboard.get("fml.deobfuscatedEnvironment")) + { + classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer"); + } + // Add all the access transformers now as well + for (String transformer : CoreModManager.getAccessTransformers()) + { + classLoader.registerTransformer(transformer); + } + classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.ModAccessTransformer"); + classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.ItemStackTransformer"); + try + { + FMLRelaunchLog.fine("Validating minecraft"); + Class loaderClazz = Class.forName("cpw.mods.fml.common.Loader", true, classLoader); + Method m = loaderClazz.getMethod("injectData", Object[].class); + m.invoke(null, (Object)FMLInjectionData.data()); + m = loaderClazz.getMethod("instance"); + m.invoke(null); + FMLRelaunchLog.fine("Minecraft validated, launching..."); + } + catch (Exception e) + { + // Load in the Loader, make sure he's ready to roll - this will initialize most of the rest of minecraft here + System.out.println("A CRITICAL PROBLEM OCCURED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML"); + throw new RuntimeException(e); + } + } + + @Override + public String getLaunchTarget() + { + throw new RuntimeException("Invalid for use as a primary tweaker"); + } + + @Override + public String[] getLaunchArguments() + { + return new String[0]; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.java new file mode 100644 index 0000000..5a6de93 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLInjectionAndSortingTweaker.java @@ -0,0 +1,58 @@ +package cpw.mods.fml.common.launcher; + +import java.io.File; +import java.util.List; + +import cpw.mods.fml.relauncher.CoreModManager; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + +/** + * This class is to manage the injection of coremods as tweakers into the tweak framework. + * It has to inject the coremod tweaks during construction, because that is the only time + * the tweak list is writeable. + * @author cpw + * + */ +public class FMLInjectionAndSortingTweaker implements ITweaker { + private boolean run; + public FMLInjectionAndSortingTweaker() + { + CoreModManager.injectCoreModTweaks(this); + run = false; + } + + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + if (!run) + { + // We sort the tweak list here so that it obeys the tweakordering + CoreModManager.sortTweakList(); + @SuppressWarnings("unchecked") + List newTweaks = (List) Launch.blackboard.get("TweakClasses"); + newTweaks.add("cpw.mods.fml.common.launcher.TerminalTweaker"); + } + run = true; + } + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + } + + @Override + public String getLaunchTarget() + { + return ""; + } + + @Override + public String[] getLaunchArguments() + { + return new String[0]; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLServerTweaker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLServerTweaker.java new file mode 100644 index 0000000..8e95965 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLServerTweaker.java @@ -0,0 +1,26 @@ +package cpw.mods.fml.common.launcher; + +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import net.minecraft.launchwrapper.LaunchClassLoader; + +public class FMLServerTweaker extends FMLTweaker { + @Override + public String getLaunchTarget() + { + return "net.minecraft.server.MinecraftServer"; + } + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + // The mojang packages are excluded so the log4j2 queue is correctly visible from + // the obfuscated and deobfuscated parts of the code. Without, the UI won't show anything + classLoader.addClassLoaderExclusion("com.mojang."); + classLoader.addTransformerExclusion("cpw.mods.fml.repackage."); + classLoader.addTransformerExclusion("cpw.mods.fml.relauncher."); + classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers."); + classLoader.addClassLoaderExclusion("LZMA."); + FMLLaunchHandler.configureForServerLaunch(classLoader, this); + FMLLaunchHandler.appendCoreMods(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLTweaker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLTweaker.java new file mode 100644 index 0000000..cbcd1e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/FMLTweaker.java @@ -0,0 +1,173 @@ +package cpw.mods.fml.common.launcher; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; + +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.FMLSecurityManager; + +public class FMLTweaker implements ITweaker { + private File gameDir; + private Map launchArgs; + private List standaloneArgs; + private static URI jarLocation; + + public FMLTweaker() + { + System.setProperty("java.net.preferIPv4Stack", "true"); //Lets do this as early as possible. Vanilla does it in Main.main + try + { + System.setSecurityManager(new FMLSecurityManager()); + } + catch (SecurityException se) + { + throw new RuntimeException("FML was unable to install the security manager. The game will not start", se); + } + } + @SuppressWarnings("unchecked") + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + this.gameDir = (gameDir == null ? new File(".") : gameDir); + + this.launchArgs = (Map)Launch.blackboard.get("launchArgs"); + + this.standaloneArgs = Lists.newArrayList(); + if (this.launchArgs == null) + { + this.launchArgs = Maps.newHashMap(); + Launch.blackboard.put("launchArgs", this.launchArgs); + } + + String classifier = null; + + for (String arg : args) + { + if (arg.startsWith("-")) + { + if (classifier != null) + { + classifier = launchArgs.put(classifier, ""); + } + else if (arg.contains("=")) + { + classifier = launchArgs.put(arg.substring(0, arg.indexOf('=')), arg.substring(arg.indexOf('=') + 1)); + } + else + { + classifier = arg; + } + } + else + { + if (classifier != null) + { + classifier = launchArgs.put(classifier, arg); + } + else + { + this.standaloneArgs.add(arg); + } + } + } + + if (!this.launchArgs.containsKey("--version")) + { + launchArgs.put("--version", profile != null ? profile : "UnknownFMLProfile"); + } + + if (!this.launchArgs.containsKey("--gameDir") && gameDir != null) + { + launchArgs.put("--gameDir", gameDir.getAbsolutePath()); + } + + if (!this.launchArgs.containsKey("--assetsDir") && assetsDir != null) + { + launchArgs.put("--assetsDir", assetsDir.getAbsolutePath()); + } + + Yggdrasil.login(launchArgs); + + try + { + jarLocation = getClass().getProtectionDomain().getCodeSource().getLocation().toURI(); + } + catch (URISyntaxException e) + { + LogManager.getLogger("FMLTWEAK").log(Level.ERROR, "Missing URI information for FML tweak"); + throw Throwables.propagate(e); + } + } + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + classLoader.addClassLoaderExclusion("org.apache."); + classLoader.addClassLoaderExclusion("com.google.common."); + classLoader.addTransformerExclusion("cpw.mods.fml.repackage."); + classLoader.addTransformerExclusion("cpw.mods.fml.relauncher."); + classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers."); + classLoader.addClassLoaderExclusion("LZMA."); + FMLLaunchHandler.configureForClientLaunch(classLoader, this); + FMLLaunchHandler.appendCoreMods(); + } + + @Override + public String getLaunchTarget() + { + // Remove the extraneous mods and modListFile args + @SuppressWarnings("unchecked") + Map args = (Map) Launch.blackboard.get("launchArgs"); + args.remove("--modListFile"); + args.remove("--mods"); + return "net.minecraft.client.main.Main"; + } + + @Override + public String[] getLaunchArguments() + { + List args = Lists.newArrayList(); + args.addAll(standaloneArgs); + + for (Entry arg : launchArgs.entrySet()) + { + args.add(arg.getKey()); + args.add(arg.getValue()); + } + launchArgs.clear(); + + return args.toArray(new String[args.size()]); + } + + public File getGameDir() + { + return gameDir; + } + + public static URI getJarLocation() + { + return jarLocation; + } + + public void injectCascadingTweak(String tweakClassName) + { + @SuppressWarnings("unchecked") + List tweakClasses = (List) Launch.blackboard.get("TweakClasses"); + tweakClasses.add(tweakClassName); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/TerminalTweaker.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/TerminalTweaker.java new file mode 100644 index 0000000..66ea5dc --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/TerminalTweaker.java @@ -0,0 +1,32 @@ +package cpw.mods.fml.common.launcher; + +import java.io.File; +import java.util.List; +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.LaunchClassLoader; + +public final class TerminalTweaker implements ITweaker { + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.TerminalTransformer"); + } + + @Override + public String getLaunchTarget() + { + return null; + } + + @Override + public String[] getLaunchArguments() + { + return new String[0]; + } + + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/Yggdrasil.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/Yggdrasil.java new file mode 100644 index 0000000..d2e8d16 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/launcher/Yggdrasil.java @@ -0,0 +1,43 @@ +package cpw.mods.fml.common.launcher; + +import java.net.Proxy; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; + +import com.google.common.base.Throwables; +import com.mojang.authlib.Agent; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; + +/** + * Basic implementation of Mojang's 'Yggdrasil' login system, purely intended as a dev time bare bones login. + * Login errors are not handled. + */ +public class Yggdrasil +{ + public static void login(Map args) + { + if (!args.containsKey("--username") || !args.containsKey("--password")) return; + YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) new YggdrasilAuthenticationService(Proxy.NO_PROXY, "1").createUserAuthentication(Agent.MINECRAFT); + auth.setUsername(args.get("--username")); + auth.setPassword(args.remove("--password")); + + try + { + auth.logIn(); + } + catch (AuthenticationException e) + { + LogManager.getLogger("FMLTWEAK").error("-- Login failed! " + e.getMessage()); + Throwables.propagate(e); + return; // dont set other variables + } + + args.put("--username", auth.getSelectedProfile().getName()); + args.put("--uuid", auth.getSelectedProfile().getId().toString().replace("-", "")); + args.put("--accessToken", auth.getAuthenticatedToken()); + args.put("--userProperties", auth.getUserProperties().toString()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/ByteBufUtils.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/ByteBufUtils.java new file mode 100644 index 0000000..ca55ee0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/ByteBufUtils.java @@ -0,0 +1,283 @@ +package cpw.mods.fml.common.network; + +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import org.apache.commons.lang3.Validate; + +import com.google.common.base.Charsets; +import com.google.common.base.Throwables; + +import io.netty.buffer.ByteBuf; + +/** + * Utilities for interacting with {@link ByteBuf}. + * @author cpw + * + */ +public class ByteBufUtils { + /** + * The number of bytes to write the supplied int using the 7 bit varint encoding. + * + * @param toCount The number to analyse + * @return The number of bytes it will take to write it (maximum of 5) + */ + public static int varIntByteCount(int toCount) + { + return (toCount & 0xFFFFFF80) == 0 ? 1 : ((toCount & 0xFFFFC000) == 0 ? 2 : ((toCount & 0xFFE00000) == 0 ? 3 : ((toCount & 0xF0000000) == 0 ? 4 : 5))); + } + /** + * Read a varint from the supplied buffer. + * + * @param buf The buffer to read from + * @param maxSize The maximum length of bytes to read + * @return The integer + */ + public static int readVarInt(ByteBuf buf, int maxSize) + { + Validate.isTrue(maxSize < 6 && maxSize > 0, "Varint length is between 1 and 5, not %d", maxSize); + int i = 0; + int j = 0; + byte b0; + + do + { + b0 = buf.readByte(); + i |= (b0 & 127) << j++ * 7; + + if (j > maxSize) + { + throw new RuntimeException("VarInt too big"); + } + } + while ((b0 & 128) == 128); + + return i; + } + /** + * An extended length short. Used by custom payload packets to extend size. + * + * @param buf + * @return + */ + public static int readVarShort(ByteBuf buf) + { + int low = buf.readUnsignedShort(); + int high = 0; + if ((low & 0x8000) != 0) + { + low = low & 0x7FFF; + high = buf.readUnsignedByte(); + } + return ((high & 0xFF) << 15) | low; + } + + public static void writeVarShort(ByteBuf buf, int toWrite) + { + int low = toWrite & 0x7FFF; + int high = ( toWrite & 0x7F8000 ) >> 15; + if (high != 0) + { + low = low | 0x8000; + } + buf.writeShort(low); + if (high != 0) + { + buf.writeByte(high); + } + } + /** + * Write an integer to the buffer using variable length encoding. The maxSize constrains + * how many bytes (and therefore the maximum number) that will be written. + * + * @param to The buffer to write to + * @param toWrite The integer to write + * @param maxSize The maximum number of bytes to use + */ + public static void writeVarInt(ByteBuf to, int toWrite, int maxSize) + { + Validate.isTrue(varIntByteCount(toWrite) <= maxSize, "Integer is too big for %d bytes", maxSize); + while ((toWrite & -128) != 0) + { + to.writeByte(toWrite & 127 | 128); + toWrite >>>= 7; + } + + to.writeByte(toWrite); + } + /** + * Read a UTF8 string from the byte buffer. + * It is encoded as [] + * + * @param from The buffer to read from + * @return The string + */ + public static String readUTF8String(ByteBuf from) + { + int len = readVarInt(from,2); + String str = from.toString(from.readerIndex(), len, Charsets.UTF_8); + from.readerIndex(from.readerIndex() + len); + return str; + } + + /** + * Write a String with UTF8 byte encoding to the buffer. + * It is encoded as [] + * @param to the buffer to write to + * @param string The string to write + */ + public static void writeUTF8String(ByteBuf to, String string) + { + byte[] utf8Bytes = string.getBytes(Charsets.UTF_8); + Validate.isTrue(varIntByteCount(utf8Bytes.length) < 3, "The string is too long for this encoding."); + writeVarInt(to, utf8Bytes.length, 2); + to.writeBytes(utf8Bytes); + } + + /** + * Write an {@link ItemStack} using minecraft compatible encoding. + * + * @param to The buffer to write to + * @param stack The itemstack to write + */ + public static void writeItemStack(ByteBuf to, ItemStack stack) + { + PacketBuffer pb = new PacketBuffer(to); + try + { + pb.writeItemStackToBuffer(stack); + } catch (IOException e) + { + // Unpossible? + throw Throwables.propagate(e); + } + } + + /** + * Read an {@link ItemStack} from the byte buffer provided. It uses the minecraft encoding. + * + * @param from The buffer to read from + * @return The itemstack read + */ + public static ItemStack readItemStack(ByteBuf from) + { + PacketBuffer pb = new PacketBuffer(from); + try + { + return pb.readItemStackFromBuffer(); + } catch (IOException e) + { + // Unpossible? + throw Throwables.propagate(e); + } + } + + /** + * Write an {@link NBTTagCompound} to the byte buffer. It uses the minecraft encoding. + * + * @param to The buffer to write to + * @param tag The tag to write + */ + public static void writeTag(ByteBuf to, NBTTagCompound tag) + { + PacketBuffer pb = new PacketBuffer(to); + try + { + pb.writeNBTTagCompoundToBuffer(tag); + } catch (IOException e) + { + // Unpossible? + throw Throwables.propagate(e); + } + } + + /** + * Read an {@link NBTTagCompound} from the byte buffer. It uses the minecraft encoding. + * + * @param from The buffer to read from + * @return The read tag + */ + public static NBTTagCompound readTag(ByteBuf from) + { + PacketBuffer pb = new PacketBuffer(from); + try + { + return pb.readNBTTagCompoundFromBuffer(); + } catch (IOException e) + { + // Unpossible? + throw Throwables.propagate(e); + } + } + + public static String getContentDump(ByteBuf buffer) + { + int currentLength = buffer.readableBytes(); + StringBuffer returnString = new StringBuffer((currentLength * 3) + // The + // hex + (currentLength) + // The ascii + (currentLength / 4) + // The tabs/\n's + 30); // The text + + // returnString.append("Buffer contents:\n"); + int i, j; // Loop variables + for (i = 0; i < currentLength; i++) + { + if ((i != 0) && (i % 16 == 0)) + { + // If it's a multiple of 16 and i isn't null, show the ascii + returnString.append('\t'); + for (j = i - 16; j < i; j++) + { + if (buffer.getByte(j) < 0x20 || buffer.getByte(j) > 0x7F) + returnString.append('.'); + else + returnString.append((char) buffer.getByte(j)); + } + // Add a linefeed after the string + returnString.append("\n"); + } + + returnString.append(Integer.toString((buffer.getByte(i) & 0xF0) >> 4, 16) + Integer.toString((buffer.getByte(i) & 0x0F) >> 0, 16)); + returnString.append(' '); + } + + // Add padding spaces if it's not a multiple of 16 + if (i != 0 && i % 16 != 0) + { + for (j = 0; j < ((16 - (i % 16)) * 3); j++) + { + returnString.append(' '); + } + } + // Add the tab for alignment + returnString.append('\t'); + + // Add final chararacters at right, after padding + + // If it was at the end of a line, print out the full line + if (i > 0 && (i % 16) == 0) + { + j = i - 16; + } else + { + j = (i - (i % 16)); + } + + for (; i >= 0 && j < i; j++) + { + if (buffer.getByte(j) < 0x20 || buffer.getByte(j) > 0x7F) + returnString.append('.'); + else + returnString.append((char) buffer.getByte(j)); + } + + // Finally, tidy it all up with a newline + returnString.append('\n'); + returnString.append("Length: " + currentLength); + + return returnString.toString(); + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEmbeddedChannel.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEmbeddedChannel.java new file mode 100644 index 0000000..bff9cca --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEmbeddedChannel.java @@ -0,0 +1,67 @@ +package cpw.mods.fml.common.network; + +import io.netty.channel.ChannelHandler; +import io.netty.channel.embedded.EmbeddedChannel; +import java.util.Map.Entry; +import net.minecraft.network.Packet; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +/** + * Utility wrapper around {@link EmbeddedChannel}. Provides some convenience methods + * associated with the specific needs of FML network handling. + * + * @author cpw + * + */ +public class FMLEmbeddedChannel extends EmbeddedChannel { + public FMLEmbeddedChannel(String channelName, Side source, ChannelHandler... handlers) + { + this(Loader.instance().activeModContainer(), channelName, source, handlers); + } + public FMLEmbeddedChannel(ModContainer container, String channelName, Side source, ChannelHandler... handlers) + { + super(handlers); + this.attr(NetworkRegistry.FML_CHANNEL).set(channelName); + this.attr(NetworkRegistry.CHANNEL_SOURCE).set(source); + this.attr(NetworkRegistry.MOD_CONTAINER).setIfAbsent(container); + this.pipeline().addFirst("fml:outbound",new FMLOutboundHandler()); + } + + + /** + * Utility method to generate a regular packet from a custom packet. Basically, it writes the packet through the + * outbound side which should have a message to message codec present (such as {@link FMLIndexedMessageToMessageCodec}, + * transforming from mod packets to standard {@link FMLProxyPacket}s. + * + * This is mostly useful in cases where vanilla expects a packet, such as the TileEntity getDescriptionPacket. + * + * @param object The inbound packet + * @return A Packet suitable for passing to vanilla network code. + */ + public Packet generatePacketFrom(Object object) + { + OutboundTarget outboundTarget = attr(FMLOutboundHandler.FML_MESSAGETARGET).getAndSet(OutboundTarget.NOWHERE); + writeOutbound(object); + Packet pkt = (Packet) outboundMessages().poll(); + attr(FMLOutboundHandler.FML_MESSAGETARGET).set(outboundTarget); + return pkt; + } + + public String findChannelHandlerNameForType(Class type) + { + String targetName = null; + for (Entry entry : pipeline()) + { + if (type.isInstance(entry.getValue())) + { + targetName = entry.getKey(); + break; + } + } + return targetName; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEventChannel.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEventChannel.java new file mode 100644 index 0000000..4881642 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLEventChannel.java @@ -0,0 +1,175 @@ +package cpw.mods.fml.common.network; + +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import java.util.EnumMap; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetHandlerPlayServer; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +/** + * An event driven network channel, using {@link FMLNetworkEvent.CustomPacketEvent} and {@link FMLNetworkEvent.CustomNetworkEvent} + * to deliver messages to an event listener. There is one "bus" for each channel, due to the + * impossibility of filtering a bus for specific events. + * + * This event driven system completely wraps the netty code. Mod code deals with FMLProxyPackets directly. It is not + * possible to enhance the netty pipeline, and I would expect highly unexpected results if it were modified reflectively. + * Use a real ChannelHandler if you want to use netty. + * + * @author cpw + * + */ +public class FMLEventChannel { + private EnumMap channels; + private EventBus eventBus; + + /* + * This is done this way so that the CLIENT specific code in the factory only loads on the client + */ + private enum EventFactory + { + SERVER() + { + @Override + FMLNetworkEvent.CustomPacketEvent make(FMLProxyPacket msg) + { + FMLNetworkEvent.CustomPacketEvent event = null; + if (msg.handler() instanceof NetHandlerPlayServer) + { + NetHandlerPlayServer server = (NetHandlerPlayServer) msg.handler(); + event = new FMLNetworkEvent.ServerCustomPacketEvent(server.func_147362_b(), msg); + } + return event; + } + }, + CLIENT() + { + @Override + FMLNetworkEvent.CustomPacketEvent make(FMLProxyPacket msg) + { + FMLNetworkEvent.CustomPacketEvent event = null; + if (msg.handler() instanceof NetHandlerPlayClient) + { + NetHandlerPlayClient client = (NetHandlerPlayClient) msg.handler(); + event = new FMLNetworkEvent.ClientCustomPacketEvent(client.getNetworkManager(), msg); + } + else if (msg.handler() instanceof NetHandlerPlayServer) + { + NetHandlerPlayServer server = (NetHandlerPlayServer) msg.handler(); + event = new FMLNetworkEvent.ServerCustomPacketEvent(server.func_147362_b(), msg); + } + return event; + } + }; + abstract FMLNetworkEvent.CustomPacketEvent make(FMLProxyPacket msg); + } + + private static EventFactory factory = FMLCommonHandler.instance().getSide() == Side.CLIENT ? EventFactory.CLIENT : EventFactory.SERVER; + FMLEventChannel(String name) + { + this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this)); + this.eventBus = new EventBus(); + } + + /** + * Register an event listener with this channel and bus. See {@link SubscribeEvent} + * + * @param object + */ + public void register(Object object) + { + this.eventBus.register(object); + } + + /** + * Unregister an event listener from the bus. + * @param object + */ + public void unregister(Object object) + { + this.eventBus.unregister(object); + } + + void fireRead(FMLProxyPacket msg, ChannelHandlerContext ctx) + { + FMLNetworkEvent.CustomPacketEvent event = factory.make(msg); + if (event != null) + { + this.eventBus.post(event); + if (event.reply != null) + { + ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.REPLY); + ctx.writeAndFlush(event.reply).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + } + } + + public void fireUserEvent(Object evt, ChannelHandlerContext ctx) + { + FMLNetworkEvent.CustomNetworkEvent event = new FMLNetworkEvent.CustomNetworkEvent(evt); + this.eventBus.post(event); + } + + /** + * Send a packet to all on the server + * + * @param pkt + */ + public void sendToAll(FMLProxyPacket pkt) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); + channels.get(Side.SERVER).writeAndFlush(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send to a specific player + * + * @param pkt + * @param player + */ + public void sendTo(FMLProxyPacket pkt, EntityPlayerMP player) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); + channels.get(Side.SERVER).writeAndFlush(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send to all around a point + * @param pkt + * @param point + */ + public void sendToAllAround(FMLProxyPacket pkt, NetworkRegistry.TargetPoint point) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); + channels.get(Side.SERVER).writeAndFlush(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send to all in a dimension + * @param pkt + * @param dimensionId + */ + public void sendToDimension(FMLProxyPacket pkt, int dimensionId) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); + channels.get(Side.SERVER).writeAndFlush(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send to the server + * @param pkt + */ + public void sendToServer(FMLProxyPacket pkt) + { + channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + channels.get(Side.CLIENT).writeAndFlush(pkt).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.java new file mode 100644 index 0000000..530ba7e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLIndexedMessageToMessageCodec.java @@ -0,0 +1,96 @@ +package cpw.mods.fml.common.network; + +import gnu.trove.map.hash.TByteObjectHashMap; +import gnu.trove.map.hash.TObjectByteHashMap; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageCodec; +import io.netty.util.AttributeKey; +import java.lang.ref.WeakReference; +import java.util.List; +import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; + +@Sharable +public abstract class FMLIndexedMessageToMessageCodec extends MessageToMessageCodec { + private TByteObjectHashMap> discriminators = new TByteObjectHashMap>(); + private TObjectByteHashMap> types = new TObjectByteHashMap>(); + + /** + * Make this accessible to subclasses + */ + + public static final AttributeKey>> INBOUNDPACKETTRACKER = new AttributeKey>>("fml:inboundpacket"); + + @Override + public void handlerAdded(ChannelHandlerContext ctx) throws Exception + { + super.handlerAdded(ctx); + ctx.attr(INBOUNDPACKETTRACKER).set(new ThreadLocal>()); + } + + public FMLIndexedMessageToMessageCodec addDiscriminator(int discriminator, Class type) + { + discriminators.put((byte)discriminator, type); + types.put(type, (byte)discriminator); + return this; + } + + public abstract void encodeInto(ChannelHandlerContext ctx, A msg, ByteBuf target) throws Exception; + @Override + protected final void encode(ChannelHandlerContext ctx, A msg, List out) throws Exception + { + ByteBuf buffer = Unpooled.buffer(); + @SuppressWarnings("unchecked") // Stupid unnecessary cast I can't seem to kill + Class clazz = (Class) msg.getClass(); + byte discriminator = types.get(clazz); + buffer.writeByte(discriminator); + encodeInto(ctx, msg, buffer); + FMLProxyPacket proxy = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get()); + WeakReference ref = ctx.attr(INBOUNDPACKETTRACKER).get().get(); + FMLProxyPacket old = ref == null ? null : ref.get(); + if (old != null) + { + proxy.setDispatcher(old.getDispatcher()); + } + out.add(proxy); + } + + public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf source, A msg); + + @Override + protected final void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception + { + testMessageValidity(msg); + ByteBuf payload = msg.payload(); + byte discriminator = payload.readByte(); + Class clazz = discriminators.get(discriminator); + if(clazz == null) + { + throw new NullPointerException("Undefined message for discriminator " + discriminator + " in channel " + msg.channel()); + } + A newMsg = clazz.newInstance(); + ctx.attr(INBOUNDPACKETTRACKER).get().set(new WeakReference(msg)); + decodeInto(ctx, payload.slice(), newMsg); + out.add(newMsg); + } + + /** + * Called to verify the message received. This can be used to hard disconnect in case of an unexpected packet, + * say due to a weird protocol mismatch. Use with caution. + * @param msg + */ + protected void testMessageValidity(FMLProxyPacket msg) + { + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "FMLIndexedMessageCodec exception caught"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkEvent.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkEvent.java new file mode 100644 index 0000000..c86003a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkEvent.java @@ -0,0 +1,168 @@ +package cpw.mods.fml.common.network; + +import java.util.Set; +import com.google.common.collect.ImmutableSet; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.network.play.INetHandlerPlayServer; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +public class FMLNetworkEvent extends Event { + public final T handler; + public final NetworkManager manager; + @SuppressWarnings("unused") + private final Class type; + + FMLNetworkEvent(T thing, Class type, NetworkManager manager) + { + this.handler = thing; + this.type = type; + this.manager = manager; + } + /** + * Fired at the client when a client connects to a server + * @author cpw + * + */ + public static class ClientConnectedToServerEvent extends FMLNetworkEvent { + public final boolean isLocal; + public final String connectionType; + public ClientConnectedToServerEvent(NetworkManager manager, String connectionType) + { + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager); + this.isLocal = manager.isLocalChannel(); + this.connectionType = connectionType; + } + } + + /** + * Fired at the server when a client connects to the server. + * + * @author cpw + * + */ + public static class ServerConnectionFromClientEvent extends FMLNetworkEvent { + public final boolean isLocal; + public ServerConnectionFromClientEvent(NetworkManager manager) + { + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager); + this.isLocal = manager.isLocalChannel(); + } + } + /** + * Fired at the server when a client disconnects. + * + * @author cpw + * + */ + public static class ServerDisconnectionFromClientEvent extends FMLNetworkEvent { + public ServerDisconnectionFromClientEvent(NetworkManager manager) + { + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager); + } + } + /** + * Fired at the client when the client is disconnected from the server. + * + * @author cpw + * + */ + public static class ClientDisconnectionFromServerEvent extends FMLNetworkEvent { + public ClientDisconnectionFromServerEvent(NetworkManager manager) + { + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager); + } + } + + /** + * Fired when the REGISTER/UNREGISTER for custom channels is received. + * + * @author cpw + * + * @param The side + */ + public static class CustomPacketRegistrationEvent extends FMLNetworkEvent { + public final ImmutableSet registrations; + public final String operation; + public final Side side; + public CustomPacketRegistrationEvent(NetworkManager manager, Set registrations, String operation, Side side, Class type) + { + super(type.cast(manager.getNetHandler()), type, manager); + this.registrations = ImmutableSet.copyOf(registrations); + this.side = side; + this.operation = operation; + } + } + + public static abstract class CustomPacketEvent extends FMLNetworkEvent { + /** + * The packet that generated the event + */ + public final FMLProxyPacket packet; + + /** + * Set this packet to reply to the originator + */ + public FMLProxyPacket reply; + CustomPacketEvent(S thing, Class type, NetworkManager manager, FMLProxyPacket packet) + { + super(thing, type, manager); + this.packet = packet; + } + + public abstract Side side(); + } + + /** + * Fired when a custom packet is received on the client for the channel + * @author cpw + * + */ + public static class ClientCustomPacketEvent extends CustomPacketEvent { + public ClientCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet) + { + super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager, packet); + } + + @Override + public Side side() + { + return Side.CLIENT; + } + } + + /** + * Fired when a custom packet is received at the server for the channel + * @author cpw + * + */ + public static class ServerCustomPacketEvent extends CustomPacketEvent { + public ServerCustomPacketEvent(NetworkManager manager, FMLProxyPacket packet) + { + super((INetHandlerPlayServer) manager.getNetHandler(), INetHandlerPlayServer.class, manager, packet); + } + + @Override + public Side side() + { + return Side.SERVER; + } + } + + /** + * Fired when a custom event, such as {@link NetworkHandshakeEstablished} is fired for the channel + * + * @author cpw + * + */ + public static class CustomNetworkEvent extends Event { + public final Object wrappedEvent; + public CustomNetworkEvent(Object wrappedEvent) + { + this.wrappedEvent = wrappedEvent; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkException.java new file mode 100644 index 0000000..7acc922 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLNetworkException.java @@ -0,0 +1,32 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.network; + +public class FMLNetworkException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public FMLNetworkException(Exception e) + { + super(e); + } + + public FMLNetworkException() + { + } + + public FMLNetworkException(String string) + { + super(string); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLOutboundHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLOutboundHandler.java new file mode 100644 index 0000000..10ec350 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/FMLOutboundHandler.java @@ -0,0 +1,289 @@ +package cpw.mods.fml.common.network; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.util.AttributeKey; +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetworkManager; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter { + public static final AttributeKey FML_MESSAGETARGET = new AttributeKey("fml:outboundTarget"); + public static final AttributeKey FML_MESSAGETARGETARGS = new AttributeKey("fml:outboundTargetArgs"); + public enum OutboundTarget { + /** + * The packet is sent nowhere. It will be on the {@link EmbeddedChannel#outboundMessages()} Queue. + * + * @author cpw + * + */ + NOWHERE(Sets.immutableEnumSet(Side.CLIENT, Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + // NOOP + } + + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + return null; + } + + }, + /** + * The packet is sent to the {@link NetworkDispatcher} supplied as an argument. + * + * @author cpw + * + */ + DISPATCHER(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + if (!(args instanceof NetworkDispatcher)) + { + throw new RuntimeException("DISPATCHER expects a NetworkDispatcher"); + } + } + + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + return ImmutableList.of((NetworkDispatcher)args); + } + }, + /** + * The packet is sent to the originator of the packet. This requires the inbound packet + * to have it's originator information set. + * + * @author cpw + * + */ + REPLY(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + // NOOP + } + + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + return ImmutableList.of(packet.getDispatcher()); + } + }, + /** + * The packet is sent to the {@link EntityPlayerMP} supplied as an argument. + * + * @author cpw + * + */ + PLAYER(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + if (!(args instanceof EntityPlayerMP)) + { + throw new RuntimeException("PLAYER target expects a Player arg"); + } + } + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + EntityPlayerMP player = (EntityPlayerMP) args; + NetworkDispatcher dispatcher = player == null ? null : player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + return dispatcher == null ? ImmutableList.of() : ImmutableList.of(dispatcher); + } + }, + /** + * The packet is dispatched to all players connected to the server. + * @author cpw + * + */ + ALL(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + } + @SuppressWarnings("unchecked") + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + ImmutableList.Builder builder = ImmutableList.builder(); + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) + { + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + if (dispatcher != null) builder.add(dispatcher); + } + return builder.build(); + } + }, + /** + * The packet is sent to all players in the dimension identified by the integer argument. + * @author cpw + * + */ + DIMENSION(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + if (!(args instanceof Integer)) + { + throw new RuntimeException("DIMENSION expects an integer argument"); + } + } + @SuppressWarnings("unchecked") + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + int dimension = (Integer)args; + ImmutableList.Builder builder = ImmutableList.builder(); + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) + { + if (dimension == player.dimension) + { + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + // Null dispatchers may exist for fake players - skip them + if (dispatcher != null) builder.add(dispatcher); + } + } + return builder.build(); + } + }, + /** + * The packet is sent to all players within range of the {@link TargetPoint} argument supplied. + * + * @author cpw + * + */ + ALLAROUNDPOINT(Sets.immutableEnumSet(Side.SERVER)) + { + @Override + public void validateArgs(Object args) + { + if (!(args instanceof TargetPoint)) + { + throw new RuntimeException("ALLAROUNDPOINT expects a TargetPoint argument"); + } + } + + @SuppressWarnings("unchecked") + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + TargetPoint tp = (TargetPoint)args; + ImmutableList.Builder builder = ImmutableList.builder(); + for (EntityPlayerMP player : (List)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList) + { + if (player.dimension == tp.dimension) + { + double d4 = tp.x - player.posX; + double d5 = tp.y - player.posY; + double d6 = tp.z - player.posZ; + + if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range) + { + NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + if (dispatcher != null) builder.add(dispatcher); + } + } + } + return builder.build(); + } + }, + /** + * The packet is sent to the server this client is currently conversing with. + * @author cpw + * + */ + TOSERVER(Sets.immutableEnumSet(Side.CLIENT)) + { + @Override + public void validateArgs(Object args) + { + } + @Override + public List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet) + { + NetworkManager clientConnection = FMLCommonHandler.instance().getClientToServerNetworkManager(); + return clientConnection == null || clientConnection.channel().attr(NetworkDispatcher.FML_DISPATCHER).get() == null ? ImmutableList.of() : ImmutableList.of(clientConnection.channel().attr(NetworkDispatcher.FML_DISPATCHER).get()); + } + }; + + private OutboundTarget(ImmutableSet sides) + { + this.allowed = sides; + } + public final ImmutableSet allowed; + public abstract void validateArgs(Object args); + public abstract List selectNetworks(Object args, ChannelHandlerContext context, FMLProxyPacket packet); + } + + @Override + public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception + { + if (!(msg instanceof FMLProxyPacket)) + { + return; + } + FMLProxyPacket pkt = (FMLProxyPacket) msg; + OutboundTarget outboundTarget; + Object args = null; + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + // INTERNAL message callback - let it pass out + if (dispatcher != null) + { + ctx.write(msg, promise); + return; + } + + outboundTarget = ctx.channel().attr(FML_MESSAGETARGET).get(); + Side channelSide = ctx.channel().attr(NetworkRegistry.CHANNEL_SOURCE).get(); + if (outboundTarget != null && outboundTarget.allowed.contains(channelSide)) + { + args = ctx.channel().attr(FML_MESSAGETARGETARGS).get(); + outboundTarget.validateArgs(args); + } + else if (channelSide == Side.CLIENT) + { + outboundTarget = OutboundTarget.TOSERVER; + } + else + { + throw new FMLNetworkException("Packet arrived at the outbound handler without a valid target!"); + } + + List dispatchers = outboundTarget.selectNetworks(args, ctx, pkt); + + // This will drop the messages into the output queue at the embedded channel + if (dispatchers == null) + { + ctx.write(msg, promise); + promise.setSuccess(); + return; + } + for (NetworkDispatcher targetDispatcher : dispatchers) + { + targetDispatcher.sendProxy((FMLProxyPacket) msg); + } + promise.setSuccess(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/IGuiHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/IGuiHandler.java new file mode 100644 index 0000000..3d0f656 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/IGuiHandler.java @@ -0,0 +1,46 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.network; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public interface IGuiHandler +{ + /** + * Returns a Server side Container to be displayed to the user. + * + * @param ID The Gui ID Number + * @param player The player viewing the Gui + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return A GuiScreen/Container to be displayed to the user, null if none. + */ + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); + /** + * Returns a Container to be displayed to the user. On the client side, this + * needs to return a instance of GuiScreen On the server side, this needs to + * return a instance of Container + * + * @param ID The Gui ID Number + * @param player The player viewing the Gui + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return A GuiScreen/Container to be displayed to the user, null if none. + */ + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkCheckHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkCheckHandler.java new file mode 100644 index 0000000..a768871 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkCheckHandler.java @@ -0,0 +1,33 @@ +package cpw.mods.fml.common.network; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import cpw.mods.fml.relauncher.Side; + +/** + * A method annotated with this will be called when a remote network connection is offered. + * The method should have two parameters, of types {@link Map} and {@link Side}. It should return a boolean + * true indicating that the remote party is acceptable, or false if not. + * + *

+ * When the method is invoked, the map will contain String keys and values listing all mods and their versions present. + * The side represents the side of the remote party. So if you're on the server, it'll be CLIENT, and vice versa. + * + *

+ * This method will be invoked both when querying the status of the remote server, and when connecting to the remote server. + * + *

+ * NOTE: the server will not be setup at any point when this method is called. Do not try and interact with the server + * or the client in any way, except to accept or reject the list of mods. + * + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface NetworkCheckHandler +{ + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkEventFiringHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkEventFiringHandler.java new file mode 100644 index 0000000..0694f4a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkEventFiringHandler.java @@ -0,0 +1,44 @@ +package cpw.mods.fml.common.network; + +import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import io.netty.channel.ChannelHandler.Sharable; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +/** + * Use this handler as the only thing in your channel, to receive network events + * whenever your channel receives a message. + * Note: it will not forward on to other handlers. + * + * @author cpw + * + */ +@Sharable +public class NetworkEventFiringHandler extends SimpleChannelInboundHandler { + private FMLEventChannel eventChannel; + + NetworkEventFiringHandler(FMLEventChannel fmlEventChannel) + { + this.eventChannel = fmlEventChannel; + } + + @Override + protected void channelRead0(ChannelHandlerContext ctx, FMLProxyPacket msg) throws Exception + { + eventChannel.fireRead(msg,ctx); + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception + { + eventChannel.fireUserEvent(evt,ctx); + } + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "NetworkEventFiringHandler exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkHandshakeEstablished.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkHandshakeEstablished.java new file mode 100644 index 0000000..da7e595 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkHandshakeEstablished.java @@ -0,0 +1,28 @@ +package cpw.mods.fml.common.network; + +import net.minecraft.network.INetHandler; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.relauncher.Side; + +/** + * This message is sent through all channels affected by a currently occurring handshake. It is guaranteed to + * be able to send a custom payload packet, however, interaction with minecraft and world state is NOT assured + * as it is likely this is fired on a netty handler thread, not a world processing thread. + * + * If you wish to send an outbound message through your channel, bind the {@link FMLOutboundHandler#FML_MESSAGETARGET} + * property of your channel to the supplied dispatcher. + * @author cpw + * + */ +public class NetworkHandshakeEstablished { + public final NetworkDispatcher dispatcher; + public final Side side; + public final INetHandler netHandler; + + public NetworkHandshakeEstablished(NetworkDispatcher dispatcher, INetHandler netHandler, Side origin) + { + this.netHandler = netHandler; + this.dispatcher = dispatcher; + this.side = origin; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkRegistry.java new file mode 100644 index 0000000..2cc6460 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/NetworkRegistry.java @@ -0,0 +1,332 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.network; + +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageCodec; +import io.netty.util.AttributeKey; + +import java.util.EnumMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import org.apache.logging.log4j.Level; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; +import net.minecraft.network.INetHandler; +import net.minecraft.world.World; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.common.network.internal.NetworkModHolder; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.relauncher.Side; + +/** + * @author cpw + * + */ +public enum NetworkRegistry +{ + INSTANCE; + private EnumMap> channels = Maps.newEnumMap(Side.class); + private Map registry = Maps.newHashMap(); + private Map serverGuiHandlers = Maps.newHashMap(); + private Map clientGuiHandlers = Maps.newHashMap(); + + /** + * Set in the {@link ChannelHandlerContext} + */ + public static final AttributeKey FML_CHANNEL = new AttributeKey("fml:channelName"); + public static final AttributeKey CHANNEL_SOURCE = new AttributeKey("fml:channelSource"); + public static final AttributeKey MOD_CONTAINER = new AttributeKey("fml:modContainer"); + public static final AttributeKey NET_HANDLER = new AttributeKey("fml:netHandler"); + + // Version 1: ServerHello only contains this value as a byte + // Version 2: ServerHello additionally contains a 4 byte (int) dimension for the logging in client + public static final byte FML_PROTOCOL = 2; + + private NetworkRegistry() + { + channels.put(Side.CLIENT, Maps.newConcurrentMap()); + channels.put(Side.SERVER, Maps.newConcurrentMap()); + } + + /** + * Represents a target point for the ALLROUNDPOINT target. + * + * @author cpw + * + */ + public static class TargetPoint { + /** + * A target point + * @param dimension The dimension to target + * @param x The X coordinate + * @param y The Y coordinate + * @param z The Z coordinate + * @param range The range + */ + public TargetPoint(int dimension, double x, double y, double z, double range) + { + this.x = x; + this.y = y; + this.z = z; + this.range = range; + this.dimension = dimension; + } + public final double x; + public final double y; + public final double z; + public final double range; + public final int dimension; + } + /** + * Create a new synchronous message channel pair based on netty. + * + * There are two preconstructed models available: + *

    + *
  • {@link #newSimpleChannel(String)} provides {@link SimpleNetworkWrapper}, a simple implementation of a netty handler, suitable for those who don't + * wish to dive too deeply into netty. + *
  • {@link #newEventChannel(String)} provides {@link FMLEventChannel} an event driven implementation, with lower level + * access to the network data stream, for those with advanced bitbanging needs that don't wish to poke netty too hard. + *
  • Alternatively, simply use the netty features provided here and implement the full power of the netty stack. + *
+ * + * There are two channels created : one for each logical side (considered as the source of an outbound message) + * The returned map will contain a value for each logical side, though both will only be working in the + * integrated server case. + * + * The channel expects to read and write using {@link FMLProxyPacket}. All operation is synchronous, as the + * asynchronous behaviour occurs at a lower level in netty. + * + * The first handler in the pipeline is special and should not be removed or moved from the head - it transforms + * packets from the outbound of this pipeline into custom packets, based on the current {@link AttributeKey} value + * {@link NetworkRegistry#FML_MESSAGETARGET} and {@link NetworkRegistry#FML_MESSAGETARGETARGS} set on the channel. + * For the client to server channel (source side : CLIENT) this is fixed as "TOSERVER". For SERVER to CLIENT packets, + * several possible values exist. + * + * Mod Messages should be transformed using a something akin to a {@link MessageToMessageCodec}. FML provides + * a utility codec, {@link FMLIndexedMessageToMessageCodec} that transforms from {@link FMLProxyPacket} to a mod + * message using a message discriminator byte. This is optional, but highly recommended for use. + * + * Note also that the handlers supplied need to be {@link ChannelHandler.Shareable} - they are injected into two + * channels. + * + * @param name + * @param handlers + * @return + */ + public EnumMap newChannel(String name, ChannelHandler... handlers) + { + if (channels.containsKey(name) || name.startsWith("MC|") || name.startsWith("\u0001") || name.startsWith("FML")) + { + throw new RuntimeException("That channel is already registered"); + } + EnumMap result = Maps.newEnumMap(Side.class); + + for (Side side : Side.values()) + { + FMLEmbeddedChannel channel = new FMLEmbeddedChannel(name, side, handlers); + channels.get(side).put(name,channel); + result.put(side, channel); + } + return result; + } + + /** + * Construct a new {@link SimpleNetworkWrapper} for the channel. + * + * @param name The name of the channel + * @return A {@link SimpleNetworkWrapper} for handling this channel + */ + public SimpleNetworkWrapper newSimpleChannel(String name) + { + return new SimpleNetworkWrapper(name); + } + /** + * Construct a new {@link FMLEventChannel} for the channel. + * + * @param name The name of the channel + * @return An {@link FMLEventChannel} for handling this channel + */ + public FMLEventChannel newEventDrivenChannel(String name) + { + return new FMLEventChannel(name); + } + /** + * INTERNAL Create a new channel pair with the specified name and channel handlers. + * This is used internally in forge and FML + * + * @param container The container to associate the channel with + * @param name The name for the channel + * @param handlers Some {@link ChannelHandler} for the channel + * @return an {@link EnumMap} of the pair of channels. keys are {@link Side}. There will always be two entries. + */ + public EnumMap newChannel(ModContainer container, String name, ChannelHandler... handlers) + { + if (channels.containsKey(name) || name.startsWith("MC|") || name.startsWith("\u0001") || (name.startsWith("FML") && !("FML".equals(container.getModId())))) + { + throw new RuntimeException("That channel is already registered"); + } + EnumMap result = Maps.newEnumMap(Side.class); + + for (Side side : Side.values()) + { + FMLEmbeddedChannel channel = new FMLEmbeddedChannel(container, name, side, handlers); + channels.get(side).put(name,channel); + result.put(side, channel); + } + return result; + } + + public FMLEmbeddedChannel getChannel(String name, Side source) + { + return channels.get(source).get(name); + } + /** + * Register an {@link IGuiHandler} for the supplied mod object. + * + * @param mod The mod to handle GUIs for + * @param handler A handler for creating GUI related objects + */ + public void registerGuiHandler(Object mod, IGuiHandler handler) + { + ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod); + if (mc == null) + { + FMLLog.log(Level.ERROR, "Mod of type %s attempted to register a gui network handler during a construction phase", mod.getClass().getName()); + throw new RuntimeException("Invalid attempt to create a GUI during mod construction. Use an EventHandler instead"); + } + serverGuiHandlers.put(mc, handler); + clientGuiHandlers.put(mc, handler); + } + + /** + * INTERNAL method for accessing the Gui registry + * @param mc Mod Container + * @param player Player + * @param modGuiId guiId + * @param world World + * @param x X coord + * @param y Y coord + * @param z Z coord + * @return The server side GUI object (An instance of {@link Container}) + */ + public Container getRemoteGuiContainer(ModContainer mc, EntityPlayerMP player, int modGuiId, World world, int x, int y, int z) + { + IGuiHandler handler = serverGuiHandlers.get(mc); + + if (handler != null) + { + return (Container)handler.getServerGuiElement(modGuiId, player, world, x, y, z); + } + else + { + return null; + } + } + + /** + * INTERNAL method for accessing the Gui registry + * @param mc Mod Container + * @param player Player + * @param modGuiId guiId + * @param world World + * @param x X coord + * @param y Y coord + * @param z Z coord + * @return The client side GUI object (An instance of {@link GUI}) + */ + public Object getLocalGuiContainer(ModContainer mc, EntityPlayer player, int modGuiId, World world, int x, int y, int z) + { + IGuiHandler handler = clientGuiHandlers.get(mc); + return handler.getClientGuiElement(modGuiId, player, world, x, y, z); + } + + /** + * Is there a channel with this name on this side? + * @param channelName The name + * @param source the side + * @return if there's a channel + */ + public boolean hasChannel(String channelName, Side source) + { + return channels.get(source).containsKey(channelName); + } + + /** + * INTERNAL method for registering a mod as a network capable thing + * @param fmlModContainer The fml mod container + * @param clazz a class + * @param remoteVersionRange the acceptable remote range + * @param asmHarvestedData internal data + */ + public void register(ModContainer fmlModContainer, Class clazz, String remoteVersionRange, ASMDataTable asmHarvestedData) + { + NetworkModHolder networkModHolder = new NetworkModHolder(fmlModContainer, clazz, remoteVersionRange, asmHarvestedData); + registry.put(fmlModContainer, networkModHolder); + networkModHolder.testVanillaAcceptance(); + } + + public boolean isVanillaAccepted(Side from) + { + boolean result = true; + for (Entry e : registry.entrySet()) + { + result &= e.getValue().acceptsVanilla(from); + } + return result; + } + public Map registry() + { + return ImmutableMap.copyOf(registry); + } + + /** + * All the valid channel names for a side + * @param side the side + * @return the set of channel names + */ + public Set channelNamesFor(Side side) + { + return channels.get(side).keySet(); + } + + /** + * INTERNAL fire a handshake to all channels + * @param networkDispatcher The dispatcher firing + * @param origin which side the dispatcher is on + */ + public void fireNetworkHandshake(NetworkDispatcher networkDispatcher, Side origin) + { + NetworkHandshakeEstablished handshake = new NetworkHandshakeEstablished(networkDispatcher, networkDispatcher.getNetHandler(), origin); + for (Entry channel : channels.get(origin).entrySet()) + { + channel.getValue().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.DISPATCHER); + channel.getValue().attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(networkDispatcher); + channel.getValue().pipeline().fireUserEventTriggered(handshake); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.java new file mode 100644 index 0000000..39b1759 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/ChannelRegistrationHandler.java @@ -0,0 +1,42 @@ +package cpw.mods.fml.common.network.handshake; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import java.util.Set; +import net.minecraft.network.NetworkManager; +import org.apache.logging.log4j.Level; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableSet; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +public class ChannelRegistrationHandler extends SimpleChannelInboundHandler { + @Override + protected void channelRead0(ChannelHandlerContext ctx, FMLProxyPacket msg) throws Exception + { + Side side = msg.getTarget(); + NetworkManager manager = msg.getOrigin(); + if (msg.channel().equals("REGISTER") || msg.channel().equals("UNREGISTER")) + { + byte[] data = new byte[msg.payload().readableBytes()]; + msg.payload().readBytes(data); + String channels = new String(data,Charsets.UTF_8); + String[] split = channels.split("\0"); + Set channelSet = ImmutableSet.copyOf(split); + FMLCommonHandler.instance().fireNetRegistrationEvent(manager, channelSet, msg.channel(), side); + } + else + { + ctx.fireChannelRead(msg); + } + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "ChannelRegistrationHandler exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java new file mode 100644 index 0000000..70261b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeClientState.java @@ -0,0 +1,153 @@ +package cpw.mods.fml.common.network.handshake; + +import java.util.List; + +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.handshake.FMLHandshakeMessage.ServerHello; +import cpw.mods.fml.common.network.internal.FMLMessage; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.relauncher.Side; + +/** + * Packet handshake sequence manager- client side (responding to remote server) + * + * Flow: + * 1. Wait for server hello. (START). Move to HELLO state. + * 2. Receive Server Hello. Send customchannel registration. Send Client Hello. Send our modlist. Move to WAITINGFORSERVERDATA state. + * 3. Receive server modlist. Send ack if acceptable, else send nack and exit error. Receive server IDs. Move to COMPLETE state. Send ack. + * + * @author cpw + * + */ +enum FMLHandshakeClientState implements IHandshakeState +{ + START + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.clientListenForServerHandshake(); + return HELLO; + } + }, + HELLO + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + // write our custom packet registration, always + ctx.writeAndFlush(FMLHandshakeMessage.makeCustomChannelRegistration(NetworkRegistry.INSTANCE.channelNamesFor(Side.CLIENT))); + if (msg == null) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.abortClientHandshake("VANILLA"); + // VANILLA login + return DONE; + } + + ServerHello serverHelloPacket = (FMLHandshakeMessage.ServerHello)msg; + FMLLog.info("Server protocol version %x", serverHelloPacket.protocolVersion()); + if (serverHelloPacket.protocolVersion() > 1) + { + // Server sent us an extra dimension for the logging in player - stash it for retrieval later + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.setOverrideDimension(serverHelloPacket.overrideDim()); + } + ctx.writeAndFlush(new FMLHandshakeMessage.ClientHello()).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + ctx.writeAndFlush(new FMLHandshakeMessage.ModList(Loader.instance().getActiveModList())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + return WAITINGSERVERDATA; + } + }, + + WAITINGSERVERDATA + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + String result = FMLNetworkHandler.checkModList((FMLHandshakeMessage.ModList) msg, Side.SERVER); + if (result != null) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.rejectHandshake(result); + return ERROR; + } + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + if (!ctx.channel().attr(NetworkDispatcher.IS_LOCAL).get()) + { + return WAITINGSERVERCOMPLETE; + } + else + { + return PENDINGCOMPLETE; + } + } + }, + WAITINGSERVERCOMPLETE + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + FMLHandshakeMessage.ModIdData modIds = (FMLHandshakeMessage.ModIdData)msg; + List locallyMissing = GameData.injectWorldIDMap(modIds.dataList(), modIds.blockSubstitutions(), modIds.itemSubstitutions(), false, false); + if (!locallyMissing.isEmpty()) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.rejectHandshake("Fatally missing blocks and items"); + FMLLog.severe("Failed to connect to server: there are %d missing blocks and items", locallyMissing.size()); + FMLLog.fine("Missing list: %s", locallyMissing); + return ERROR; + } + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + return PENDINGCOMPLETE; + } + }, + PENDINGCOMPLETE + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + return COMPLETE; + } + }, + COMPLETE + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.completeClientHandshake(); + FMLMessage.CompleteHandshake complete = new FMLMessage.CompleteHandshake(Side.CLIENT); + ctx.fireChannelRead(complete); + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + return DONE; + } + }, + DONE + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + if (msg instanceof FMLHandshakeMessage.HandshakeReset) + { + GameData.revertToFrozen(); + return HELLO; + } + return this; + } + }, + ERROR + { + @Override + public FMLHandshakeClientState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + return this; + } + }; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.java new file mode 100644 index 0000000..08a830d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeCodec.java @@ -0,0 +1,28 @@ +package cpw.mods.fml.common.network.handshake; + +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; + +public class FMLHandshakeCodec extends FMLIndexedMessageToMessageCodec { + public FMLHandshakeCodec() + { + addDiscriminator((byte)0, FMLHandshakeMessage.ServerHello.class); + addDiscriminator((byte)1, FMLHandshakeMessage.ClientHello.class); + addDiscriminator((byte)2, FMLHandshakeMessage.ModList.class); + addDiscriminator((byte)3, FMLHandshakeMessage.ModIdData.class); + addDiscriminator((byte)-1, FMLHandshakeMessage.HandshakeAck.class); + addDiscriminator((byte)-2, FMLHandshakeMessage.HandshakeReset.class); + } + @Override + public void encodeInto(ChannelHandlerContext ctx, FMLHandshakeMessage msg, ByteBuf target) throws Exception + { + msg.toBytes(target); + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf source, FMLHandshakeMessage msg) + { + msg.fromBytes(source); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.java new file mode 100644 index 0000000..4ab83f5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeMessage.java @@ -0,0 +1,279 @@ +package cpw.mods.fml.common.network.handshake; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import com.google.common.base.Charsets; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.common.registry.GameData; + +public abstract class FMLHandshakeMessage { + public static FMLProxyPacket makeCustomChannelRegistration(Set channels) + { + String salutation = Joiner.on('\0').join(Iterables.concat(Arrays.asList("FML|HS","FML"),channels)); + FMLProxyPacket proxy = new FMLProxyPacket(Unpooled.wrappedBuffer(salutation.getBytes(Charsets.UTF_8)), "REGISTER"); + return proxy; + } + public static class ServerHello extends FMLHandshakeMessage { + private byte serverProtocolVersion; + private int overrideDimension; + public ServerHello() + { + // noargs for the proto + } + public ServerHello(int overrideDim) + { + this.overrideDimension = overrideDim; + } + + @Override + public void toBytes(ByteBuf buffer) + { + buffer.writeByte(NetworkRegistry.FML_PROTOCOL); + buffer.writeInt(overrideDimension); + } + + @Override + public void fromBytes(ByteBuf buffer) + { + serverProtocolVersion = buffer.readByte(); + // Extended dimension support during login + if (serverProtocolVersion > 1) + { + overrideDimension = buffer.readInt(); + FMLLog.fine("Server FML protocol version %d, 4 byte dimension received %d", serverProtocolVersion, overrideDimension); + } + else + { + FMLLog.info("Server FML protocol version %d, no additional data received", serverProtocolVersion); + } + } + + public byte protocolVersion() + { + return serverProtocolVersion; + } + + public int overrideDim() { + return overrideDimension; + } + } + public static class ClientHello extends FMLHandshakeMessage { + private byte serverProtocolVersion; + @Override + public void toBytes(ByteBuf buffer) + { + buffer.writeByte(NetworkRegistry.FML_PROTOCOL); + } + + @Override + public void fromBytes(ByteBuf buffer) + { + serverProtocolVersion = buffer.readByte(); + } + + public byte protocolVersion() + { + return serverProtocolVersion; + } + } + public static class ModList extends FMLHandshakeMessage { + public ModList() + { + + } + public ModList(List modList) + { + for (ModContainer mod : modList) + { + modTags.put(mod.getModId(), mod.getVersion()); + } + } + private Map modTags = Maps.newHashMap(); + + @Override + public void toBytes(ByteBuf buffer) + { + super.toBytes(buffer); + ByteBufUtils.writeVarInt(buffer, modTags.size(), 2); + for (Map.Entry modTag: modTags.entrySet()) + { + ByteBufUtils.writeUTF8String(buffer, modTag.getKey()); + ByteBufUtils.writeUTF8String(buffer, modTag.getValue()); + } + } + + @Override + public void fromBytes(ByteBuf buffer) + { + super.fromBytes(buffer); + int modCount = ByteBufUtils.readVarInt(buffer, 2); + for (int i = 0; i < modCount; i++) + { + modTags.put(ByteBufUtils.readUTF8String(buffer), ByteBufUtils.readUTF8String(buffer)); + } + } + + public String modListAsString() + { + return Joiner.on(',').withKeyValueSeparator("@").join(modTags); + } + + public int modListSize() + { + return modTags.size(); + } + public Map modList() + { + return modTags; + } + + @Override + public String toString(Class> side) + { + return super.toString(side)+":"+modTags.size()+" mods"; + } + } + + public static class ModIdData extends FMLHandshakeMessage { + public ModIdData() + { + + } + + public ModIdData(GameData.GameDataSnapshot snapshot) + { + this.modIds = snapshot.idMap; + this.blockSubstitutions = snapshot.blockSubstitutions; + this.itemSubstitutions = snapshot.itemSubstitutions; + } + + private Map modIds; + private Set blockSubstitutions; + private Set itemSubstitutions; + @Override + public void fromBytes(ByteBuf buffer) + { + int length = ByteBufUtils.readVarInt(buffer, 3); + modIds = Maps.newHashMap(); + blockSubstitutions = Sets.newHashSet(); + itemSubstitutions = Sets.newHashSet(); + + for (int i = 0; i < length; i++) + { + modIds.put(ByteBufUtils.readUTF8String(buffer),ByteBufUtils.readVarInt(buffer, 3)); + } + // we don't have any more data to read + if (!buffer.isReadable()) + { + return; + } + length = ByteBufUtils.readVarInt(buffer, 3); + for (int i = 0; i < length; i++) + { + blockSubstitutions.add(ByteBufUtils.readUTF8String(buffer)); + } + length = ByteBufUtils.readVarInt(buffer, 3); + for (int i = 0; i < length; i++) + { + itemSubstitutions.add(ByteBufUtils.readUTF8String(buffer)); + } + } + + @Override + public void toBytes(ByteBuf buffer) + { + ByteBufUtils.writeVarInt(buffer, modIds.size(), 3); + for (Entry entry: modIds.entrySet()) + { + ByteBufUtils.writeUTF8String(buffer, entry.getKey()); + ByteBufUtils.writeVarInt(buffer, entry.getValue(), 3); + } + + ByteBufUtils.writeVarInt(buffer, blockSubstitutions.size(), 3); + for (String entry: blockSubstitutions) + { + ByteBufUtils.writeUTF8String(buffer, entry); + } + ByteBufUtils.writeVarInt(buffer, blockSubstitutions.size(), 3); + + for (String entry: itemSubstitutions) + { + ByteBufUtils.writeUTF8String(buffer, entry); + } + } + + public Map dataList() + { + return modIds; + } + public Set blockSubstitutions() + { + return blockSubstitutions; + } + public Set itemSubstitutions() + { + return itemSubstitutions; + } + + @Override + public String toString(Class> side) + { + return super.toString(side) + ":"+modIds.size()+" mappings"; + } + } + public static class HandshakeAck extends FMLHandshakeMessage { + int phase; + public HandshakeAck() {} + HandshakeAck(int phase) + { + this.phase = phase; + } + @Override + public void fromBytes(ByteBuf buffer) + { + phase = buffer.readByte(); + } + + @Override + public void toBytes(ByteBuf buffer) + { + buffer.writeByte(phase); + } + @Override + public String toString(Class> side) + { + return super.toString(side) + ":{"+phase+"}"; + } + } + public static class HandshakeReset extends FMLHandshakeMessage { + public HandshakeReset() {} + } + public void fromBytes(ByteBuf buffer) + { + } + + public void toBytes(ByteBuf buffer) + { + } + + public String toString(Class> side) + { + return getClass().getName().substring(getClass().getName().lastIndexOf('$')); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java new file mode 100644 index 0000000..d8d545f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/FMLHandshakeServerState.java @@ -0,0 +1,94 @@ +package cpw.mods.fml.common.network.handshake; + +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLMessage; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.relauncher.Side; + +enum FMLHandshakeServerState implements IHandshakeState +{ + START + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + int overrideDim = dispatcher.serverInitiateHandshake(); + ctx.writeAndFlush(FMLHandshakeMessage.makeCustomChannelRegistration(NetworkRegistry.INSTANCE.channelNamesFor(Side.SERVER))).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + ctx.writeAndFlush(new FMLHandshakeMessage.ServerHello(overrideDim)).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + return HELLO; + } + }, + HELLO + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + // Hello packet first + if (msg instanceof FMLHandshakeMessage.ClientHello) + { + FMLLog.info("Client protocol version %x", ((FMLHandshakeMessage.ClientHello)msg).protocolVersion()); + return this; + } + + FMLHandshakeMessage.ModList client = (FMLHandshakeMessage.ModList)msg; + FMLLog.info("Client attempting to join with %d mods : %s", client.modListSize(), client.modListAsString()); + String result = FMLNetworkHandler.checkModList(client, Side.CLIENT); + if (result != null) + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(); + dispatcher.rejectHandshake(result); + return ERROR; + } + ctx.writeAndFlush(new FMLHandshakeMessage.ModList(Loader.instance().getActiveModList())); + return WAITINGCACK; + } + }, + WAITINGCACK + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + if (!ctx.channel().attr(NetworkDispatcher.IS_LOCAL).get()) + { + ctx.writeAndFlush(new FMLHandshakeMessage.ModIdData(GameData.buildItemDataList())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + NetworkRegistry.INSTANCE.fireNetworkHandshake(ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).get(), Side.SERVER); + return COMPLETE; + } + }, + COMPLETE + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + // Poke the client + ctx.writeAndFlush(new FMLHandshakeMessage.HandshakeAck(ordinal())).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + FMLMessage.CompleteHandshake complete = new FMLMessage.CompleteHandshake(Side.SERVER); + ctx.fireChannelRead(complete); + return DONE; + } + }, + DONE + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + return this; + } + }, + ERROR + { + @Override + public FMLHandshakeServerState accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg) + { + return this; + } + }; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeInjector.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeInjector.java new file mode 100644 index 0000000..3441f84 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeInjector.java @@ -0,0 +1,23 @@ +package cpw.mods.fml.common.network.handshake; + +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelOutboundHandlerAdapter; +import io.netty.channel.ChannelPromise; + +public class HandshakeInjector extends ChannelOutboundHandlerAdapter { + + private NetworkDispatcher dispatcher; + public HandshakeInjector(NetworkDispatcher networkDispatcher) + { + this.dispatcher = networkDispatcher; + } + @Override + public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception + { + if (msg instanceof FMLProxyPacket) + { + this.dispatcher.sendProxy((FMLProxyPacket) msg); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.java new file mode 100644 index 0000000..56fe6da --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/HandshakeMessageHandler.java @@ -0,0 +1,50 @@ +package cpw.mods.fml.common.network.handshake; + +import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.FMLLog; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.util.AttributeKey; + +public class HandshakeMessageHandler & IHandshakeState> extends SimpleChannelInboundHandler { + private static final AttributeKey> STATE = new AttributeKey>("fml:handshake-state"); + private final AttributeKey fmlHandshakeState; + private S initialState; + private Class stateType; + + @SuppressWarnings("unchecked") + public HandshakeMessageHandler(Class stateType) + { + fmlHandshakeState = (AttributeKey) ((Object)STATE); + initialState = Enum.valueOf(stateType, "START"); + this.stateType = stateType; + } + @Override + protected void channelRead0(ChannelHandlerContext ctx, FMLHandshakeMessage msg) throws Exception + { + S state = ctx.attr(fmlHandshakeState).get(); + FMLLog.finer(msg.toString(stateType) + "->" + state.getClass().getName().substring(state.getClass().getName().lastIndexOf('.')+1)+":"+state); + S newState = state.accept(ctx, msg); + ctx.attr(fmlHandshakeState).set(newState); + } + + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception + { + ctx.attr(fmlHandshakeState).set(initialState); + } + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception + { + S state = ctx.attr(fmlHandshakeState).get(); + S newState = state.accept(ctx, null); + ctx.attr(fmlHandshakeState).set(newState); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "HandshakeMessageHandler exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/IHandshakeState.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/IHandshakeState.java new file mode 100644 index 0000000..07897e5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/IHandshakeState.java @@ -0,0 +1,7 @@ +package cpw.mods.fml.common.network.handshake; + +import io.netty.channel.ChannelHandlerContext; + +public interface IHandshakeState { + S accept(ChannelHandlerContext ctx, FMLHandshakeMessage msg); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java new file mode 100644 index 0000000..f21392a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java @@ -0,0 +1,510 @@ +package cpw.mods.fml.common.network.handshake; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.channel.ChannelOutboundHandler; +import io.netty.channel.ChannelPromise; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.embedded.EmbeddedChannel; +import io.netty.util.AttributeKey; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import io.netty.util.concurrent.ScheduledFuture; + +import java.net.SocketAddress; +import java.nio.channels.ClosedChannelException; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; + +import org.apache.logging.log4j.Level; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.ChatComponentText; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.FMLNetworkEvent; +import cpw.mods.fml.common.network.FMLNetworkException; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.internal.FMLMessage; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; + +public class NetworkDispatcher extends SimpleChannelInboundHandler implements ChannelOutboundHandler { + private static enum ConnectionState { + OPENING, AWAITING_HANDSHAKE, HANDSHAKING, HANDSHAKECOMPLETE, CONNECTED; + } + + private static enum ConnectionType { + MODDED, BUKKIT, VANILLA; + } + + public static NetworkDispatcher get(NetworkManager manager) + { + return manager.channel().attr(FML_DISPATCHER).get(); + } + + public static NetworkDispatcher allocAndSet(NetworkManager manager) + { + NetworkDispatcher net = new NetworkDispatcher(manager); + manager.channel().attr(FML_DISPATCHER).getAndSet(net); + return net; + } + + public static NetworkDispatcher allocAndSet(NetworkManager manager, ServerConfigurationManager scm) + { + NetworkDispatcher net = new NetworkDispatcher(manager, scm); + manager.channel().attr(FML_DISPATCHER).getAndSet(net); + return net; + } + + public static final AttributeKey FML_DISPATCHER = new AttributeKey("fml:dispatcher"); + public static final AttributeKey IS_LOCAL = new AttributeKey("fml:isLocal"); + public final NetworkManager manager; + private final ServerConfigurationManager scm; + private EntityPlayerMP player; + private ConnectionState state; + private ConnectionType connectionType; + private final Side side; + private final EmbeddedChannel handshakeChannel; + private NetHandlerPlayServer serverHandler; + private INetHandler netHandler; + private int overrideLoginDim; + + public NetworkDispatcher(NetworkManager manager) + { + super(Packet.class, false); + this.manager = manager; + this.scm = null; + this.side = Side.CLIENT; + this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler(FMLHandshakeClientState.class)); + this.handshakeChannel.attr(FML_DISPATCHER).set(this); + this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.SERVER); + this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS"); + this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel()); + } + + public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm) + { + super(Packet.class, false); + this.manager = manager; + this.scm = scm; + this.side = Side.SERVER; + this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler(FMLHandshakeServerState.class)); + this.handshakeChannel.attr(FML_DISPATCHER).set(this); + this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT); + this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS"); + this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel()); + } + + public void serverToClientHandshake(EntityPlayerMP player) + { + this.player = player; + insertIntoChannel(); + } + + private void insertIntoChannel() + { + this.manager.channel().config().setAutoRead(false); + // Insert ourselves into the pipeline + this.manager.channel().pipeline().addBefore("packet_handler", "fml:packet_handler", this); + } + + public void clientToServerHandshake() + { + insertIntoChannel(); + } + + @Override + public void handlerAdded(ChannelHandlerContext ctx) throws Exception + { + this.state = ConnectionState.OPENING; + // send ourselves as a user event, to kick the pipeline active + this.handshakeChannel.pipeline().fireUserEventTriggered(this); + this.manager.channel().config().setAutoRead(true); + } + + int serverInitiateHandshake() + { + // Send mod salutation to the client + // This will be ignored by vanilla clients + this.state = ConnectionState.AWAITING_HANDSHAKE; + this.manager.channel().pipeline().addFirst("fml:vanilla_detector", new VanillaTimeoutWaiter()); + // Need to start the handler here, so we can send custompayload packets + serverHandler = new NetHandlerPlayServer(scm.getServerInstance(), manager, player); + this.netHandler = serverHandler; + // NULL the play server here - we restore it further on. If not, there are packets sent before the login + player.playerNetServerHandler = null; + // manually for the manager into the PLAY state, so we can send packets later + this.manager.setConnectionState(EnumConnectionState.PLAY); + + // Return the dimension the player is in, so it can be pre-sent to the client in the ServerHello v2 packet + // Requires some hackery to the serverconfigmanager and stuff for this to work + NBTTagCompound playerNBT = scm.getPlayerNBT(player); + if (playerNBT!=null) + { + return playerNBT.getInteger("Dimension"); + } + else + { + return 0; + } + } + + void clientListenForServerHandshake() + { + manager.setConnectionState(EnumConnectionState.PLAY); + FMLCommonHandler.instance().waitForPlayClient(); + this.netHandler = FMLCommonHandler.instance().getClientPlayHandler(); + this.state = ConnectionState.AWAITING_HANDSHAKE; + } + + private void completeClientSideConnection(ConnectionType type) + { + this.connectionType = type; + FMLLog.info("[%s] Client side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH)); + this.state = ConnectionState.CONNECTED; + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientConnectedToServerEvent(manager, this.connectionType.name())); + } + + private void completeServerSideConnection(ConnectionType type) + { + this.connectionType = type; + FMLLog.info("[%s] Server side %s connection established", Thread.currentThread().getName(), this.connectionType.name().toLowerCase(Locale.ENGLISH)); + this.state = ConnectionState.CONNECTED; + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerConnectionFromClientEvent(manager)); + scm.initializeConnectionToPlayer(manager, player, serverHandler); + } + @Override + protected void channelRead0(ChannelHandlerContext ctx, Packet msg) throws Exception + { + boolean handled = false; + if (msg instanceof C17PacketCustomPayload) + { + handled = handleServerSideCustomPacket((C17PacketCustomPayload) msg, ctx); + } + else if (msg instanceof S3FPacketCustomPayload) + { + handled = handleClientSideCustomPacket((S3FPacketCustomPayload)msg, ctx); + } + else if (state != ConnectionState.CONNECTED && state != ConnectionState.HANDSHAKECOMPLETE) + { + handled = handleVanilla(msg); + } + if (!handled) + { + ctx.fireChannelRead(msg); + } + } + + private boolean handleVanilla(Packet msg) + { + if (state == ConnectionState.AWAITING_HANDSHAKE && msg instanceof S01PacketJoinGame) + { + handshakeChannel.pipeline().fireUserEventTriggered(msg); + } + else + { + FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName()); + } + return false; + } + + public INetHandler getNetHandler() + { + return netHandler; + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception + { + if (evt instanceof ConnectionType && side == Side.SERVER) + { + FMLLog.info("Timeout occurred, assuming a vanilla client"); + kickVanilla(); + } + } + + private void kickVanilla() + { + kickWithMessage("This is modded. No modded response received. Bye!"); + } + private void kickWithMessage(String message) + { + final ChatComponentText chatcomponenttext = new ChatComponentText(message); + if (side == Side.CLIENT) + { + manager.closeChannel(chatcomponenttext); + } + else + { + manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener>() + { + @Override + public void operationComplete(Future result) + { + manager.closeChannel(chatcomponenttext); + } + }); + } + manager.channel().config().setAutoRead(false); + } + + private boolean handleClientSideCustomPacket(S3FPacketCustomPayload msg, ChannelHandlerContext context) + { + String channelName = msg.func_149169_c(); + if ("FML|HS".equals(channelName) || "REGISTER".equals(channelName) || "UNREGISTER".equals(channelName)) + { + FMLProxyPacket proxy = new FMLProxyPacket(msg); + proxy.setDispatcher(this); + handshakeChannel.writeInbound(proxy); + // forward any messages into the regular channel + for (Object push : handshakeChannel.inboundMessages()) + { + List messageResult = FMLNetworkHandler.forwardHandshake((FMLMessage.CompleteHandshake)push, this, Side.CLIENT); + for (FMLProxyPacket result: messageResult) + { + result.setTarget(Side.CLIENT); + result.payload().resetReaderIndex(); + context.fireChannelRead(result); + } + } + handshakeChannel.inboundMessages().clear(); + return true; + } + else if (NetworkRegistry.INSTANCE.hasChannel(channelName, Side.CLIENT)) + { + FMLProxyPacket proxy = new FMLProxyPacket(msg); + proxy.setDispatcher(this); + context.fireChannelRead(proxy); + return true; + } + return false; + } + + private boolean handleServerSideCustomPacket(C17PacketCustomPayload msg, ChannelHandlerContext context) + { + if (state == ConnectionState.AWAITING_HANDSHAKE) + { + this.manager.channel().pipeline().remove("fml:vanilla_detector"); + state = ConnectionState.HANDSHAKING; + } + String channelName = msg.func_149559_c(); + if ("FML|HS".equals(channelName) || "REGISTER".equals(channelName) || "UNREGISTER".equals(channelName)) + { + FMLProxyPacket proxy = new FMLProxyPacket(msg); + proxy.setDispatcher(this); + handshakeChannel.writeInbound(proxy); + for (Object push : handshakeChannel.inboundMessages()) + { + List messageResult = FMLNetworkHandler.forwardHandshake((FMLMessage.CompleteHandshake)push, this, Side.SERVER); + for (FMLProxyPacket result: messageResult) + { + result.setTarget(Side.SERVER); + result.payload().resetReaderIndex(); + context.fireChannelRead(result); + } + } + handshakeChannel.inboundMessages().clear(); + return true; + } + else if (NetworkRegistry.INSTANCE.hasChannel(channelName, Side.SERVER)) + { + FMLProxyPacket proxy = new FMLProxyPacket(msg); + proxy.setDispatcher(this); + context.fireChannelRead(proxy); + return true; + } + return false; + } + + private class VanillaTimeoutWaiter extends ChannelInboundHandlerAdapter + { + private ScheduledFuture future; + + @Override + public void handlerAdded(final ChannelHandlerContext ctx) throws Exception + { + future = ctx.executor().schedule(new Callable() { + @Override + public Void call() throws Exception + { + if (state != ConnectionState.CONNECTED) + { + FMLLog.info("Timeout occurred waiting for response, assuming vanilla connection"); + ctx.fireUserEventTriggered(ConnectionType.VANILLA); + } + return null; + } + }, 10, TimeUnit.HOURS); + } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) throws Exception + { + future.cancel(true); + } + } + + public void sendProxy(FMLProxyPacket msg) + { + manager.scheduleOutboundPacket(msg); + } + + public void rejectHandshake(String result) + { + kickWithMessage(result); + } + + @Override + public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception + { + ctx.bind(localAddress, promise); + } + + @Override + public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception + { + ctx.connect(remoteAddress, localAddress, promise); + } + + @Override + public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception + { + if (side == Side.CLIENT) + { + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager)); + } + else + { + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager)); + } + cleanAttributes(ctx); + ctx.disconnect(promise); + } + + @Override + public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception + { + if (side == Side.CLIENT) + { + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ClientDisconnectionFromServerEvent(manager)); + } + else + { + FMLCommonHandler.instance().bus().post(new FMLNetworkEvent.ServerDisconnectionFromClientEvent(manager)); + } + cleanAttributes(ctx); + ctx.close(promise); + } + + @Override + @Deprecated + public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception + { + ctx.deregister(promise); + } + + @Override + public void read(ChannelHandlerContext ctx) throws Exception + { + ctx.read(); + } + + @Override + public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception + { + if (msg instanceof FMLProxyPacket) + { + if (side == Side.CLIENT) + ctx.write(((FMLProxyPacket) msg).toC17Packet(), promise); + else + ctx.write(((FMLProxyPacket) msg).toS3FPacket(), promise); + } + else + { + ctx.write(msg, promise); + } + } + + @Override + public void flush(ChannelHandlerContext ctx) throws Exception + { + ctx.flush(); + } + + public void completeHandshake(Side target) + { + if (state == ConnectionState.CONNECTED) + { + FMLLog.severe("Attempt to double complete the network connection!"); + throw new FMLNetworkException("Attempt to double complete!"); + } + if (side == Side.CLIENT) + { + completeClientSideConnection(ConnectionType.MODDED); + } + else + { + completeServerSideConnection(ConnectionType.MODDED); + } + } + + public void completeClientHandshake() + { + state = ConnectionState.HANDSHAKECOMPLETE; + } + + public void abortClientHandshake(String type) + { + FMLLog.log(Level.INFO, "Aborting client handshake \"%s\"", type); + FMLCommonHandler.instance().waitForPlayClient(); + completeClientSideConnection(ConnectionType.valueOf(type)); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + // Stop the epic channel closed spam at close + if (!(cause instanceof ClosedChannelException)) + { + FMLLog.log(Level.ERROR, cause, "NetworkDispatcher exception"); + } + super.exceptionCaught(ctx, cause); + } + + // if we add any attributes, we should force removal of them here so that + //they do not hold references to the world and causes it to leak. + private void cleanAttributes(ChannelHandlerContext ctx) + { + ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).remove(); + ctx.channel().attr(NetworkRegistry.NET_HANDLER).remove(); + ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).remove(); + this.handshakeChannel.attr(FML_DISPATCHER).remove(); + this.manager.channel().attr(FML_DISPATCHER).remove(); + } + + public void setOverrideDimension(int overrideDim) { + this.overrideLoginDim = overrideDim; + FMLLog.fine("Received override dimension %d", overrideDim); + } + + public int getOverrideDimension(S01PacketJoinGame packetIn) { + FMLLog.fine("Overriding dimension: using %d", this.overrideLoginDim); + return this.overrideLoginDim != 0 ? this.overrideLoginDim : packetIn.func_149194_f(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java new file mode 100644 index 0000000..3d9cfa5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/EntitySpawnHandler.java @@ -0,0 +1,136 @@ +package cpw.mods.fml.common.network.internal; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +import java.util.List; +import org.apache.logging.log4j.Level; + +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.world.World; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.internal.FMLMessage.EntityAdjustMessage; +import cpw.mods.fml.common.network.internal.FMLMessage.EntityMessage; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import cpw.mods.fml.common.registry.IThrowableEntity; + +public class EntitySpawnHandler extends SimpleChannelInboundHandler { + @Override + protected void channelRead0(ChannelHandlerContext ctx, EntityMessage msg) throws Exception + { + if (msg.getClass().equals(FMLMessage.EntitySpawnMessage.class)) + { + spawnEntity((FMLMessage.EntitySpawnMessage)msg); + } + else if (msg.getClass().equals(FMLMessage.EntityAdjustMessage.class)) + { + adjustEntity((FMLMessage.EntityAdjustMessage)msg); + } + } + + private void adjustEntity(EntityAdjustMessage msg) + { + Entity ent = FMLClientHandler.instance().getWorldClient().getEntityByID(msg.entityId); + if (ent != null) + { + ent.serverPosX = msg.serverX; + ent.serverPosY = msg.serverY; + ent.serverPosZ = msg.serverZ; + } + else + { + FMLLog.fine("Attempted to adjust the position of entity %d which is not present on the client", msg.entityId); + } + + } + + private void spawnEntity(FMLMessage.EntitySpawnMessage spawnMsg) + { + ModContainer mc = Loader.instance().getIndexedModList().get(spawnMsg.modId); + EntityRegistration er = EntityRegistry.instance().lookupModSpawn(mc, spawnMsg.modEntityTypeId); + if (er == null) + { + throw new RuntimeException( "Could not spawn mod entity ModID: " + spawnMsg.modId + " EntityID: " + spawnMsg.modEntityTypeId + + " at ( " + spawnMsg.scaledX + "," + spawnMsg.scaledY + ", " + spawnMsg.scaledZ + ") Please contact mod author or server admin."); + } + WorldClient wc = FMLClientHandler.instance().getWorldClient(); + Class cls = er.getEntityClass(); + try + { + Entity entity; + if (er.hasCustomSpawning()) + { + entity = er.doCustomSpawning(spawnMsg); + } else + { + entity = (Entity) (cls.getConstructor(World.class).newInstance(wc)); + + int offset = spawnMsg.entityId - entity.getEntityId(); + entity.setEntityId(spawnMsg.entityId); + entity.setLocationAndAngles(spawnMsg.scaledX, spawnMsg.scaledY, spawnMsg.scaledZ, spawnMsg.scaledYaw, spawnMsg.scaledPitch); + if (entity instanceof EntityLiving) + { + ((EntityLiving) entity).rotationYawHead = spawnMsg.scaledHeadYaw; + } + + Entity parts[] = entity.getParts(); + if (parts != null) + { + for (int j = 0; j < parts.length; j++) + { + parts[j].setEntityId(parts[j].getEntityId() + offset); + } + } + } + + entity.serverPosX = spawnMsg.rawX; + entity.serverPosY = spawnMsg.rawY; + entity.serverPosZ = spawnMsg.rawZ; + + EntityClientPlayerMP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity(); + if (entity instanceof IThrowableEntity) + { + Entity thrower = clientPlayer.getEntityId() == spawnMsg.throwerId ? clientPlayer : wc.getEntityByID(spawnMsg.throwerId); + ((IThrowableEntity) entity).setThrower(thrower); + } + + if (spawnMsg.dataWatcherList != null) + { + entity.getDataWatcher().updateWatchedObjectsFromList((List) spawnMsg.dataWatcherList); + } + + if (spawnMsg.throwerId > 0) + { + entity.setVelocity(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ); + } + + if (entity instanceof IEntityAdditionalSpawnData) + { + ((IEntityAdditionalSpawnData) entity).readSpawnData(spawnMsg.dataStream); + } + wc.addEntityToWorld(spawnMsg.entityId, entity); + } catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "A severe problem occurred during the spawning of an entity at ( " + spawnMsg.scaledX + "," + spawnMsg.scaledY + ", " + spawnMsg.scaledZ +")"); + throw Throwables.propagate(e); + } + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "EntitySpawnHandler exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLMessage.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLMessage.java new file mode 100644 index 0000000..d781fde --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLMessage.java @@ -0,0 +1,270 @@ +package cpw.mods.fml.common.network.internal; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +import java.io.IOException; +import java.util.List; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Throwables; + +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.MathHelper; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import cpw.mods.fml.common.registry.IThrowableEntity; +import cpw.mods.fml.relauncher.Side; + +public abstract class FMLMessage { + public static class CompleteHandshake extends FMLMessage { + Side target; + public CompleteHandshake() { + } + public CompleteHandshake(Side target) + { + this.target = target; + } + @Override + void fromBytes(ByteBuf buf) + { + target = Side.values()[buf.readByte()]; + } + @Override + void toBytes(ByteBuf buf) + { + buf.writeByte(target.ordinal()); + } + } + public static class OpenGui extends FMLMessage { + int windowId; + String modId; + int modGuiId; + int x; + int y; + int z; + + public OpenGui() {} + OpenGui(int windowId, String modId, int modGuiId, int x, int y, int z) + { + this.windowId = windowId; + this.modId = modId; + this.modGuiId = modGuiId; + this.x = x; + this.y = y; + this.z = z; + } + + @Override + void toBytes(ByteBuf buf) + { + buf.writeInt(windowId); + ByteBufUtils.writeUTF8String(buf, modId); + buf.writeInt(modGuiId); + buf.writeInt(x); + buf.writeInt(y); + buf.writeInt(z); + } + + @Override + void fromBytes(ByteBuf buf) + { + windowId = buf.readInt(); + modId = ByteBufUtils.readUTF8String(buf); + modGuiId = buf.readInt(); + x = buf.readInt(); + y = buf.readInt(); + z = buf.readInt(); + } + } + + public abstract static class EntityMessage extends FMLMessage { + Entity entity; + int entityId; + public EntityMessage() + { + + } + EntityMessage(Entity entity) + { + this.entity = entity; + } + @Override + void toBytes(ByteBuf buf) + { + buf.writeInt(entity.getEntityId()); + } + + @Override + void fromBytes(ByteBuf buf) + { + entityId = buf.readInt(); + } + } + + public static class EntityAdjustMessage extends EntityMessage { + int serverX; + int serverY; + int serverZ; + + public EntityAdjustMessage() {} + public EntityAdjustMessage(Entity entity, int serverX, int serverY, int serverZ) + { + super(entity); + this.serverX = serverX; + this.serverY = serverY; + this.serverZ = serverZ; + } + + @Override + void toBytes(ByteBuf buf) + { + super.toBytes(buf); + buf.writeInt(serverX); + buf.writeInt(serverY); + buf.writeInt(serverZ); + } + + @Override + void fromBytes(ByteBuf buf) + { + super.fromBytes(buf); + serverX = buf.readInt(); + serverY = buf.readInt(); + serverZ = buf.readInt(); + } + } + public static class EntitySpawnMessage extends EntityMessage { + String modId; + int modEntityTypeId; + int rawX; + int rawY; + int rawZ; + double scaledX; + double scaledY; + double scaledZ; + float scaledYaw; + float scaledPitch; + float scaledHeadYaw; + int throwerId; + double speedScaledX; + double speedScaledY; + double speedScaledZ; + @SuppressWarnings("rawtypes") + List dataWatcherList; + ByteBuf dataStream; + + public EntitySpawnMessage() {} + public EntitySpawnMessage(EntityRegistration er, Entity entity, ModContainer modContainer) + { + super(entity); + modId = modContainer.getModId(); + modEntityTypeId = er.getModEntityId(); + } + @Override + void toBytes(ByteBuf buf) + { + super.toBytes(buf); + ByteBufUtils.writeUTF8String(buf, modId); + buf.writeInt(modEntityTypeId); + // posX, posY, posZ + buf.writeInt(MathHelper.floor_double(entity.posX * 32D)); + buf.writeInt(MathHelper.floor_double(entity.posY * 32D)); + buf.writeInt(MathHelper.floor_double(entity.posZ * 32D)); + // yaw, pitch + buf.writeByte((byte)(entity.rotationYaw * 256.0F / 360.0F)); + buf.writeByte((byte) (entity.rotationPitch * 256.0F / 360.0F)); + // head yaw + if (entity instanceof EntityLivingBase) + { + buf.writeByte((byte) (((EntityLivingBase)entity).rotationYawHead * 256.0F / 360.0F)); + } + else + { + buf.writeByte(0); + } + ByteBuf tmpBuf = Unpooled.buffer(); + PacketBuffer pb = new PacketBuffer(tmpBuf); + try + { + entity.getDataWatcher().func_151509_a(pb); + } catch (IOException e) + { + FMLLog.log(Level.FATAL,e,"Encountered fatal exception trying to send entity spawn data watchers"); + throw Throwables.propagate(e); + } + buf.writeBytes(tmpBuf); + + if (entity instanceof IThrowableEntity) + { + Entity owner = ((IThrowableEntity)entity).getThrower(); + buf.writeInt(owner == null ? entity.getEntityId() : owner.getEntityId()); + double maxVel = 3.9D; + double mX = entity.motionX; + double mY = entity.motionY; + double mZ = entity.motionZ; + if (mX < -maxVel) mX = -maxVel; + if (mY < -maxVel) mY = -maxVel; + if (mZ < -maxVel) mZ = -maxVel; + if (mX > maxVel) mX = maxVel; + if (mY > maxVel) mY = maxVel; + if (mZ > maxVel) mZ = maxVel; + buf.writeInt((int)(mX * 8000D)); + buf.writeInt((int)(mY * 8000D)); + buf.writeInt((int)(mZ * 8000D)); + } + else + { + buf.writeInt(0); + } + if (entity instanceof IEntityAdditionalSpawnData) + { + tmpBuf = Unpooled.buffer(); + ((IEntityAdditionalSpawnData)entity).writeSpawnData(tmpBuf); + buf.writeBytes(tmpBuf); + } + } + @Override + void fromBytes(ByteBuf dat) + { + super.fromBytes(dat); + modId = ByteBufUtils.readUTF8String(dat); + modEntityTypeId = dat.readInt(); + rawX = dat.readInt(); + rawY = dat.readInt(); + rawZ = dat.readInt(); + scaledX = rawX / 32D; + scaledY = rawY / 32D; + scaledZ = rawZ / 32D; + scaledYaw = dat.readByte() * 360F / 256F; + scaledPitch = dat.readByte() * 360F / 256F; + scaledHeadYaw = dat.readByte() * 360F / 256F; + try + { + dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat)); + } catch (IOException e) + { + FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity."); + throw Throwables.propagate(e); + } + + throwerId = dat.readInt(); + if (throwerId != 0) + { + speedScaledX = dat.readInt() / 8000D; + speedScaledY = dat.readInt() / 8000D; + speedScaledZ = dat.readInt() / 8000D; + } + this.dataStream = dat; + } + } + abstract void toBytes(ByteBuf buf); + abstract void fromBytes(ByteBuf buf); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java new file mode 100644 index 0000000..0b5ef6f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLNetworkHandler.java @@ -0,0 +1,203 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.network.internal; + +import io.netty.channel.ChannelPipeline; +import io.netty.channel.embedded.EmbeddedChannel; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.world.World; +import org.apache.logging.log4j.core.helpers.Integers; +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLContainer; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.handshake.FMLHandshakeMessage; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.common.network.internal.FMLMessage.CompleteHandshake; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class FMLNetworkHandler +{ + public static final int READ_TIMEOUT = Integers.parseInt(System.getProperty("fml.readTimeout","30"),30); + public static final int LOGIN_TIMEOUT = Integers.parseInt(System.getProperty("fml.loginTimeout","600"),600); + private static EnumMap channelPair; + + public static void fmlServerHandshake(ServerConfigurationManager scm, NetworkManager manager, EntityPlayerMP player) + { + NetworkDispatcher dispatcher = NetworkDispatcher.allocAndSet(manager, scm); + dispatcher.serverToClientHandshake(player); + } + + public static void fmlClientHandshake(NetworkManager field_147393_d) + { + NetworkDispatcher dispatcher = NetworkDispatcher.allocAndSet(field_147393_d); + dispatcher.clientToServerHandshake(); + } + + public static void openGui(EntityPlayer entityPlayer, Object mod, int modGuiId, World world, int x, int y, int z) + { + ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod); + if (entityPlayer instanceof EntityPlayerMP) + { + EntityPlayerMP entityPlayerMP = (EntityPlayerMP) entityPlayer; + Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z); + if (remoteGuiContainer != null) + { + entityPlayerMP.getNextWindowId(); + entityPlayerMP.closeContainer(); + int windowId = entityPlayerMP.currentWindowId; + FMLMessage.OpenGui openGui = new FMLMessage.OpenGui(windowId, mc.getModId(), modGuiId, x, y, z); + EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER); + embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER); + embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityPlayerMP); + embeddedChannel.writeOutbound(openGui); + entityPlayerMP.openContainer = remoteGuiContainer; + entityPlayerMP.openContainer.windowId = windowId; + entityPlayerMP.openContainer.addCraftingToCrafters(entityPlayerMP); + } + } + else if (FMLCommonHandler.instance().getSide().equals(Side.CLIENT)) + { + Object guiContainer = NetworkRegistry.INSTANCE.getLocalGuiContainer(mc, entityPlayer, modGuiId, world, x, y, z); + FMLCommonHandler.instance().showGuiScreen(guiContainer); + } + else + { + FMLLog.fine("Invalid attempt to open a local GUI on a dedicated server. This is likely a bug. GUIID: %s,%d", mc.getModId(), modGuiId); + } + + } + + public static void makeEntitySpawnAdjustment(Entity entity, EntityPlayerMP player, int serverX, int serverY, int serverZ) + { + EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER); + embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER); + embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); + embeddedChannel.writeOutbound(new FMLMessage.EntityAdjustMessage(entity, serverX, serverY, serverZ)); + } + + public static Packet getEntitySpawningPacket(Entity entity) + { + EntityRegistration er = EntityRegistry.instance().lookupModSpawn(entity.getClass(), false); + if (er == null) + { + return null; + } + if (er.usesVanillaSpawning()) + { + return null; + } + + return channelPair.get(Side.SERVER).generatePacketFrom(new FMLMessage.EntitySpawnMessage(er, entity, er.getContainer())); + } + + public static String checkModList(FMLHandshakeMessage.ModList modListPacket, Side side) + { + Map modList = modListPacket.modList(); + return checkModList(modList, side); + } + public static String checkModList(Map listData, Side side) + { + List rejects = Lists.newArrayList(); + for (Entry networkMod : NetworkRegistry.INSTANCE.registry().entrySet()) + { + boolean result = networkMod.getValue().check(listData, side); + if (!result) + { + rejects.add(networkMod.getKey()); + } + } + if (rejects.isEmpty()) + { + return null; + } + else + { + FMLLog.info("Rejecting connection %s: %s", side, rejects); + return String.format("Mod rejections %s",rejects); + } + } + + @SideOnly(Side.CLIENT) + private static void addClientHandlers() + { + ChannelPipeline pipeline = channelPair.get(Side.CLIENT).pipeline(); + String targetName = channelPair.get(Side.CLIENT).findChannelHandlerNameForType(FMLRuntimeCodec.class); + pipeline.addAfter(targetName, "GuiHandler", new OpenGuiHandler()); + pipeline.addAfter(targetName, "EntitySpawnHandler", new EntitySpawnHandler()); + } + public static void registerChannel(FMLContainer container, Side side) + { + channelPair = NetworkRegistry.INSTANCE.newChannel(container, "FML", new FMLRuntimeCodec(), new HandshakeCompletionHandler()); + EmbeddedChannel embeddedChannel = channelPair.get(Side.SERVER); + embeddedChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.NOWHERE); + + if (side == Side.CLIENT) + { + addClientHandlers(); + } + } + + public static List forwardHandshake(CompleteHandshake push, NetworkDispatcher target, Side side) + { + channelPair.get(side).attr(NetworkDispatcher.FML_DISPATCHER).set(target); + channelPair.get(side).writeOutbound(push); + + ArrayList list = new ArrayList(); + for (Object o: channelPair.get(side).outboundMessages()) + { + list.add((FMLProxyPacket)o); + } + channelPair.get(side).outboundMessages().clear(); + return list; + } + + + public static void enhanceStatusQuery(JsonObject jsonobject) + { + JsonObject fmlData = new JsonObject(); + fmlData.addProperty("type", "FML"); + JsonArray modList = new JsonArray(); + for (ModContainer mc : Loader.instance().getActiveModList()) + { + JsonObject modData = new JsonObject(); + modData.addProperty("modid", mc.getModId()); + modData.addProperty("version", mc.getVersion()); + modList.add(modData); + } + fmlData.add("modList", modList); + jsonobject.add("modinfo", fmlData); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java new file mode 100644 index 0000000..1bdf41f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLProxyPacket.java @@ -0,0 +1,161 @@ +package cpw.mods.fml.common.network.internal; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.embedded.EmbeddedChannel; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.core.helpers.Integers; +import com.google.common.collect.ConcurrentHashMultiset; +import com.google.common.collect.Multiset; +import com.google.common.collect.Multiset.Entry; +import com.google.common.collect.Multisets; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.FMLNetworkException; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.relauncher.Side; + +public class FMLProxyPacket extends Packet { + final String channel; + private Side target; + private final ByteBuf payload; + private INetHandler netHandler; + private NetworkDispatcher dispatcher; + private static Multiset badPackets = ConcurrentHashMultiset.create(); + private static int packetCountWarning = Integers.parseInt(System.getProperty("fml.badPacketCounter", "100"), 100); + private FMLProxyPacket(byte[] payload, String channel) + { + this(Unpooled.wrappedBuffer(payload), channel); + } + + public FMLProxyPacket(S3FPacketCustomPayload original) + { + this(original.func_149168_d(), original.func_149169_c()); + this.target = Side.CLIENT; + } + + public FMLProxyPacket(C17PacketCustomPayload original) + { + this(original.func_149558_e(), original.func_149559_c()); + this.target = Side.SERVER; + } + + public FMLProxyPacket(ByteBuf payload, String channel) + { + this.channel = channel; + this.payload = payload; + } + /** + * Reads the raw packet data from the data stream. + */ + @Override + public void readPacketData(PacketBuffer packetbuffer) throws IOException + { + // NOOP - we are not built this way + } + + /** + * Writes the raw packet data to the data stream. + */ + @Override + public void writePacketData(PacketBuffer packetbuffer) throws IOException + { + // NOOP - we are not built this way + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + @Override + public void processPacket(INetHandler inethandler) + { + this.netHandler = inethandler; + EmbeddedChannel internalChannel = NetworkRegistry.INSTANCE.getChannel(this.channel, this.target); + if (internalChannel != null) + { + internalChannel.attr(NetworkRegistry.NET_HANDLER).set(this.netHandler); + try + { + if (internalChannel.writeInbound(this)) + { + badPackets.add(this.channel); + if (badPackets.size() % packetCountWarning == 0) + { + FMLLog.severe("Detected ongoing potential memory leak. %d packets have leaked. Top offenders", badPackets.size()); + int i = 0; + for (Entry s : Multisets.copyHighestCountFirst(badPackets).entrySet()) + { + if (i++ > 10) break; + FMLLog.severe("\t %s : %d", s.getElement(), s.getCount()); + } + } + } + internalChannel.inboundMessages().clear(); + } + catch (FMLNetworkException ne) + { + FMLLog.log(Level.ERROR, ne, "There was a network exception handling a packet on channel %s", channel); + dispatcher.rejectHandshake(ne.getMessage()); + } + catch (Throwable t) + { + FMLLog.log(Level.ERROR, t, "There was a critical exception handling a packet on channel %s", channel); + dispatcher.rejectHandshake("A fatal error has occured, this connection is terminated"); + } + } + } + + public String channel() + { + return channel; + } + public ByteBuf payload() + { + return payload; + } + public INetHandler handler() + { + return netHandler; + } + public Packet toC17Packet() + { + return new C17PacketCustomPayload(channel, payload.array()); + } + + public Packet toS3FPacket() + { + return new S3FPacketCustomPayload(channel, payload.array()); + } + + public void setTarget(Side target) + { + this.target = target; + } + + public void setDispatcher(NetworkDispatcher networkDispatcher) + { + this.dispatcher = networkDispatcher; + } + + public NetworkManager getOrigin() + { + return this.dispatcher != null ? this.dispatcher.manager : null; + } + + public NetworkDispatcher getDispatcher() + { + return this.dispatcher; + } + + public Side getTarget() + { + return target; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.java new file mode 100644 index 0000000..b633777 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/FMLRuntimeCodec.java @@ -0,0 +1,44 @@ +package cpw.mods.fml.common.network.internal; + +import com.google.common.base.Splitter; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; +import cpw.mods.fml.common.network.FMLNetworkException; + +public class FMLRuntimeCodec extends FMLIndexedMessageToMessageCodec { + public FMLRuntimeCodec() + { + addDiscriminator(0,FMLMessage.CompleteHandshake.class); + addDiscriminator(1,FMLMessage.OpenGui.class); + addDiscriminator(2,FMLMessage.EntitySpawnMessage.class); + addDiscriminator(3,FMLMessage.EntityAdjustMessage.class); + } + @Override + public void encodeInto(ChannelHandlerContext ctx, FMLMessage msg, ByteBuf target) throws Exception + { + msg.toBytes(target); + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf source, FMLMessage msg) + { + msg.fromBytes(source); + } + + @Override + protected void testMessageValidity(FMLProxyPacket msg) + { + if (msg.payload().getByte(0) == 0 && msg.payload().readableBytes() > 2) + { + FMLLog.severe("The connection appears to have sent an invalid FML packet of type 0, this is likely because it think's it's talking to 1.6.4 FML"); + FMLLog.info("Bad data :"); + for (String l : Splitter.on('\n').split(ByteBufUtils.getContentDump(msg.payload()))) { + FMLLog.info("\t%s",l); + } + throw new FMLNetworkException("Invalid FML packet"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java new file mode 100644 index 0000000..e67bf1a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/HandshakeCompletionHandler.java @@ -0,0 +1,26 @@ +package cpw.mods.fml.common.network.internal; + +import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.common.network.internal.FMLMessage.CompleteHandshake; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.ChannelHandler.Sharable; + +@Sharable +public class HandshakeCompletionHandler extends SimpleChannelInboundHandler { + @Override + protected void channelRead0(ChannelHandlerContext ctx, CompleteHandshake msg) throws Exception + { + NetworkDispatcher dispatcher = ctx.channel().attr(NetworkDispatcher.FML_DISPATCHER).getAndRemove(); + dispatcher.completeHandshake(msg.target); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "HandshakeCompletionHandler exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/NetworkModHolder.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/NetworkModHolder.java new file mode 100644 index 0000000..9f3bbc2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/NetworkModHolder.java @@ -0,0 +1,245 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.network.internal; + +import java.lang.reflect.Method; +import java.util.Map; +import java.util.Set; +import org.apache.logging.log4j.Level; + +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.SetMultimap; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import cpw.mods.fml.common.versioning.InvalidVersionSpecificationException; +import cpw.mods.fml.common.versioning.VersionRange; +import cpw.mods.fml.relauncher.Side; + +public class NetworkModHolder +{ + public abstract class NetworkChecker { + public abstract boolean check(Map remoteVersions, Side side); + } + + private class IgnoredChecker extends NetworkChecker { + @Override + public boolean check(Map remoteVersions, Side side) + { + return true; + } + @Override + public String toString() + { + return "No network checking performed"; + } + } + private class DefaultNetworkChecker extends NetworkChecker { + @Override + public boolean check(Map remoteVersions, Side side) + { + return remoteVersions.containsKey(container.getModId()) ? acceptVersion(remoteVersions.get(container.getModId())) : side == Side.SERVER; + } + @Override + public String toString() + { + return acceptableRange != null ? String.format("Accepting range %s", acceptableRange) : String.format("Accepting version %s", container.getVersion()); + } + } + private class MethodNetworkChecker extends NetworkChecker { + @Override + public boolean check(Map remoteVersions, Side side) + { + try + { + return (Boolean) checkHandler.invoke(container.getMod(), remoteVersions, side); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "Error occurred invoking NetworkCheckHandler %s at %s", checkHandler.getName(), container); + return false; + } + } + @Override + public String toString() + { + return String.format("Invoking method %s", checkHandler.getName()); + } + } + private static int assignedIds = 1; + + private int localId; + private int networkId; + + private ModContainer container; + private Method checkHandler; + + private VersionRange acceptableRange; + + private NetworkChecker checker; + + private boolean acceptsVanillaClient; + private boolean acceptsVanillaServer; + + public NetworkModHolder(ModContainer container) + { + this.container = container; + this.localId = assignedIds++; + this.networkId = this.localId; + } + public NetworkModHolder(ModContainer container, NetworkChecker checker) + { + this(container); + this.checker = Preconditions.checkNotNull(checker); + FMLLog.fine("The mod %s is using a custom checker %s", container.getModId(), checker.getClass().getName()); + } + public NetworkModHolder(ModContainer container, Class modClass, String acceptableVersionRange, ASMDataTable table) + { + this(container); + SetMultimap annotationTable = table.getAnnotationsFor(container); + Set versionCheckHandlers; + if (annotationTable != null) + { + versionCheckHandlers = annotationTable.get(NetworkCheckHandler.class.getName()); + } + else + { + versionCheckHandlers = ImmutableSet.of(); + } + String networkCheckHandlerMethod = null; + for (ASMData vch : versionCheckHandlers) + { + if (vch.getClassName().equals(modClass.getName())) + { + networkCheckHandlerMethod = vch.getObjectName(); + networkCheckHandlerMethod = networkCheckHandlerMethod.substring(0,networkCheckHandlerMethod.indexOf('(')); + break; + } + } + if (versionCheckHandlers.isEmpty()) + { + for (Method m : modClass.getMethods()) + { + if (m.isAnnotationPresent(NetworkCheckHandler.class)) + { + if (m.getParameterTypes().length == 2 && m.getParameterTypes()[0].equals(Map.class) && m.getParameterTypes()[1].equals(Side.class)) + { + this.checkHandler = m; + break; + } + else + { + FMLLog.severe("Found unexpected method signature for annotation NetworkCheckHandler"); + } + } + } + } + if (networkCheckHandlerMethod != null) + { + try + { + Method checkHandlerMethod = modClass.getDeclaredMethod(networkCheckHandlerMethod, Map.class, Side.class); + if (checkHandlerMethod.isAnnotationPresent(NetworkCheckHandler.class)) + { + this.checkHandler = checkHandlerMethod; + } + } + catch (Exception e) + { + FMLLog.log(Level.WARN, e, "The declared version check handler method %s on network mod id %s is not accessible", networkCheckHandlerMethod, container.getModId()); + } + } + if (this.checkHandler != null) + { + this.checker = new MethodNetworkChecker(); + } + else if (!Strings.isNullOrEmpty(acceptableVersionRange) && acceptableVersionRange.equals("*")) + { + this.checker = new IgnoredChecker(); + } + else + { + try + { + this.acceptableRange = VersionRange.createFromVersionSpec(acceptableVersionRange); + } + catch (InvalidVersionSpecificationException e) + { + FMLLog.log(Level.WARN, e, "Invalid bounded range %s specified for network mod id %s", acceptableVersionRange, container.getModId()); + } + this.checker = new DefaultNetworkChecker(); + } + FMLLog.finer("Mod %s is using network checker : %s", container.getModId(), this.checker); + FMLLog.finer("Testing mod %s to verify it accepts its own version in a remote connection", container.getModId()); + boolean acceptsSelf = acceptVersion(container.getVersion()); + if (!acceptsSelf) + { + FMLLog.severe("The mod %s appears to reject its own version number (%s) in its version handling. This is likely a severe bug in the mod!", container.getModId(), container.getVersion()); + } + else + { + FMLLog.finer("The mod %s accepts its own version (%s)", container.getModId(), container.getVersion()); + } + } + + public boolean acceptVersion(String version) + { + if (acceptableRange!=null) + { + return acceptableRange.containsVersion(new DefaultArtifactVersion(version)); + } + + return container.getVersion().equals(version); + } + + public boolean check(Map data, Side side) + { + return checker.check(data, side); + } + + public int getLocalId() + { + return localId; + } + + public int getNetworkId() + { + return networkId; + } + + public ModContainer getContainer() + { + return container; + } + + public void setNetworkId(int value) + { + this.networkId = value; + } + + public void testVanillaAcceptance() { + acceptsVanillaClient = check(ImmutableMap.of(), Side.CLIENT); + acceptsVanillaServer = check(ImmutableMap.of(), Side.SERVER); + } + public boolean acceptsVanilla(Side from) { + return from == Side.CLIENT ? acceptsVanillaClient : acceptsVanillaServer; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java new file mode 100644 index 0000000..0de48ee --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/internal/OpenGuiHandler.java @@ -0,0 +1,27 @@ +package cpw.mods.fml.common.network.internal; + +import org.apache.logging.log4j.Level; +import net.minecraft.entity.player.EntityPlayer; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.internal.FMLMessage.OpenGui; + +public class OpenGuiHandler extends SimpleChannelInboundHandler { + @Override + protected void channelRead0(ChannelHandlerContext ctx, OpenGui msg) throws Exception + { + EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer; + player.openGui(msg.modId, msg.modGuiId, player.worldObj, msg.x, msg.y, msg.z); + player.openContainer.windowId = msg.windowId; + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "OpenGuiHandler exception"); + super.exceptionCaught(ctx, cause); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessage.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessage.java new file mode 100644 index 0000000..4571290 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessage.java @@ -0,0 +1,24 @@ +package cpw.mods.fml.common.network.simpleimpl; + +import io.netty.buffer.ByteBuf; + +/** + * Implement this interface for each message you wish to define. + * + * @author cpw + * + */ +public interface IMessage { + /** + * Convert from the supplied buffer into your specific message type + * + * @param buf + */ + public void fromBytes(ByteBuf buf); + + /** + * Deconstruct your message into the supplied byte buffer + * @param buf + */ + public void toBytes(ByteBuf buf); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.java new file mode 100644 index 0000000..c91672d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/IMessageHandler.java @@ -0,0 +1,24 @@ +package cpw.mods.fml.common.network.simpleimpl; + + +/** + * A message handler based on {@link IMessage}. Implement and override {@link #onMessage(IMessage)} to + * process your packet. Supply the class to {@link SimpleNetworkWrapper#registerMessage(Class, Class, byte, cpw.mods.fml.relauncher.Side)} + * to register both the message type and it's associated handler. + * + * @author cpw + * + * @param This is the request type - it is the message you expect to receive from remote. + * @param This is the reply type - it is the message you expect to send in reply. You can use IMessage as the type here + * if you don't anticipate sending a reply. + */ +public interface IMessageHandler { + /** + * Called when a message is received of the appropriate type. You can optionally return a reply message, or null if no reply + * is needed. + * + * @param message The message + * @return an optional return message + */ + public REPLY onMessage(REQ message, MessageContext ctx); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/MessageContext.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/MessageContext.java new file mode 100644 index 0000000..4021d2b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/MessageContext.java @@ -0,0 +1,43 @@ +package cpw.mods.fml.common.network.simpleimpl; + +import cpw.mods.fml.relauncher.Side; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetHandlerPlayServer; + +/** + * Context for the {@link IMessageHandler} + * + * @author cpw + * + */ +public class MessageContext { + /** + * The {@link INetHandler} for this message. It could be a client or server handler, depending + * on the {@link #side} recieved. + */ + public final INetHandler netHandler; + + /** + * The Side this message has been received on + */ + public final Side side; + /** + * @param netHandler + */ + MessageContext(INetHandler netHandler, Side side) + { + this.netHandler = netHandler; + this.side = side; + } + + public NetHandlerPlayServer getServerHandler() + { + return (NetHandlerPlayServer) netHandler; + } + + public NetHandlerPlayClient getClientHandler() + { + return (NetHandlerPlayClient) netHandler; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.java new file mode 100644 index 0000000..e68c075 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleChannelHandlerWrapper.java @@ -0,0 +1,51 @@ +package cpw.mods.fml.common.network.simpleimpl; + +import org.apache.logging.log4j.Level; + +import net.minecraft.network.INetHandler; + +import com.google.common.base.Preconditions; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +public class SimpleChannelHandlerWrapper extends SimpleChannelInboundHandler { + private final IMessageHandler messageHandler; + private final Side side; + + public SimpleChannelHandlerWrapper(Class> handler, Side side, Class requestType) + { + this(SimpleNetworkWrapper.instantiate(handler), side, requestType); + } + + public SimpleChannelHandlerWrapper(IMessageHandler handler, Side side, Class requestType) + { + super(requestType); + messageHandler = Preconditions.checkNotNull(handler, "IMessageHandler must not be null"); + this.side = side; + } + @Override + protected void channelRead0(ChannelHandlerContext ctx, REQ msg) throws Exception + { + INetHandler iNetHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); + MessageContext context = new MessageContext(iNetHandler, side); + REPLY result = messageHandler.onMessage(msg, context); + if (result != null) + { + ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.REPLY); + ctx.writeAndFlush(result).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "SimpleChannelHandlerWrapper exception"); + super.exceptionCaught(ctx, cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.java new file mode 100644 index 0000000..4aec9d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleIndexedCodec.java @@ -0,0 +1,20 @@ +package cpw.mods.fml.common.network.simpleimpl; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; + +public class SimpleIndexedCodec extends FMLIndexedMessageToMessageCodec { + @Override + public void encodeInto(ChannelHandlerContext ctx, IMessage msg, ByteBuf target) throws Exception + { + msg.toBytes(target); + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf source, IMessage msg) + { + msg.fromBytes(source); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.java new file mode 100644 index 0000000..9bfd196 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/network/simpleimpl/SimpleNetworkWrapper.java @@ -0,0 +1,238 @@ +package cpw.mods.fml.common.network.simpleimpl; + +import io.netty.channel.ChannelFutureListener; + +import java.util.EnumMap; + +import com.google.common.base.Throwables; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import cpw.mods.fml.relauncher.Side; + +/** + * This class is a simplified netty wrapper for those not wishing to deal with the full power of netty. + * It provides a simple message driven system, based on a discriminator byte over the custom packet channel. + * It assumes that you have a series of unique message types with each having a unique handler. Generally, context should be + * derived at message handling time. + * + * Usage is simple:
    + *
  • construct, and store, an instance of this class. It will automatically register and configure your underlying netty channel. + * + *
  • Then, call {@link #registerMessage(Class, Class, byte, Side)} for each message type you want to exchange + * providing an {@link IMessageHandler} implementation class as well as an {@link IMessage} implementation class. The side parameter + * to that method indicates which side (server or client) the message processing will occur on. The discriminator byte + * should be unique for this channelName - it is used to discriminate between different types of message that might + * occur on this channel (a simple form of message channel multiplexing, if you will). + *
  • To get a packet suitable for presenting to the rest of minecraft, you can call {@link #getPacketFrom(IMessage)}. The return result + * is suitable for returning from things like {@link TileEntity#getDescriptionPacket()} for example. + *
  • Finally, use the sendXXX to send unsolicited messages to various classes of recipients. + *
+ * + * Example + * + *
+ *  // Request message
+ *  public Message1 implements IMessage {
+ *  // message structure
+ *   public fromBytes(ByteBuf buf) {
+ *    // build message from byte array
+ *   }
+ *   public toBytes(ByteBuf buf) {
+ *    // put message content into byte array
+ *   }
+ *  }
+ *  // Reply message
+ *  public Message2 implements IMessage {
+ *   // stuff as before
+ *  }
+ *  // Message1Handler expects input of type Message1 and returns type Message2
+ *  public Message1Handler implements IMessageHandler {
+ *   public Message2 onMessage(Message1 message, MessageContext ctx) {
+ *    // do something and generate reply message
+ *    return aMessage2Object;
+ *   }
+ *  }
+ *  // Message2Handler expects input of type Message2 and returns no message (IMessage)
+ *  public Message2Handler implements IMessageHandler {
+ *   public IMessage onMessage(Message2 message, MessageContext ctx) {
+ *    // handle the message 2 response message at the other end
+ *    // no reply for this message - return null
+ *    return null;
+ *   }
+ *  }
+ *
+ *  // Code in a {@link FMLPreInitializationEvent} or {@link FMLInitializationEvent} handler
+ *  SimpleNetworkWrapper wrapper = NetworkRegistry.newSimpleChannel("MYCHANNEL");
+ *  // Message1 is handled by the Message1Handler class, it has discriminator id 1 and it's on the client
+ *  wrapper.registerMessage(Message1Handler.class, Message1.class, 1, Side.CLIENT);
+ *  // Message2 is handled by the Message2Handler class, it has discriminator id 2 and it's on the server
+ *  wrapper.registerMessage(Message2Handler.class, Message2.class, 2, Side.SERVER);
+ *  
+ *
+ * + * + * @author cpw + * + */ +public class SimpleNetworkWrapper { + private EnumMap channels; + private SimpleIndexedCodec packetCodec; + + public SimpleNetworkWrapper(String channelName) + { + packetCodec = new SimpleIndexedCodec(); + channels = NetworkRegistry.INSTANCE.newChannel(channelName, packetCodec); + } + + /** + * Register a message and it's associated handler. The message will have the supplied discriminator byte. The message handler will + * be registered on the supplied side (this is the side where you want the message to be processed and acted upon). + * + * @param messageHandler the message handler type + * @param requestMessageType the message type + * @param discriminator a discriminator byte + * @param side the side for the handler + */ + public void registerMessage(Class> messageHandler, Class requestMessageType, int discriminator, Side side) + { + registerMessage(instantiate(messageHandler), requestMessageType, discriminator, side); + } + + static IMessageHandler instantiate(Class> handler) + { + try + { + return handler.newInstance(); + } catch (Exception e) + { + throw Throwables.propagate(e); + } + } + + /** + * Register a message and it's associated handler. The message will have the supplied discriminator byte. The message handler will + * be registered on the supplied side (this is the side where you want the message to be processed and acted upon). + * + * @param messageHandler the message handler instance + * @param requestMessageType the message type + * @param discriminator a discriminator byte + * @param side the side for the handler + */ + public void registerMessage(IMessageHandler messageHandler, Class requestMessageType, int discriminator, Side side) + { + packetCodec.addDiscriminator(discriminator, requestMessageType); + FMLEmbeddedChannel channel = channels.get(side); + String type = channel.findChannelHandlerNameForType(SimpleIndexedCodec.class); + if (side == Side.SERVER) + { + addServerHandlerAfter(channel, type, messageHandler, requestMessageType); + } + else + { + addClientHandlerAfter(channel, type, messageHandler, requestMessageType); + } + } + + private void addServerHandlerAfter(FMLEmbeddedChannel channel, String type, IMessageHandler messageHandler, Class requestType) + { + SimpleChannelHandlerWrapper handler = getHandlerWrapper(messageHandler, Side.SERVER, requestType); + channel.pipeline().addAfter(type, messageHandler.getClass().getName(), handler); + } + + private void addClientHandlerAfter(FMLEmbeddedChannel channel, String type, IMessageHandler messageHandler, Class requestType) + { + SimpleChannelHandlerWrapper handler = getHandlerWrapper(messageHandler, Side.CLIENT, requestType); + channel.pipeline().addAfter(type, messageHandler.getClass().getName(), handler); + } + + private SimpleChannelHandlerWrapper getHandlerWrapper(IMessageHandler messageHandler, Side side, Class requestType) + { + return new SimpleChannelHandlerWrapper(messageHandler, side, requestType); + } + + /** + * Construct a minecraft packet from the supplied message. Can be used where minecraft packets are required, such as + * {@link TileEntity#getDescriptionPacket}. + * + * @param message The message to translate into packet form + * @return A minecraft {@link Packet} suitable for use in minecraft APIs + */ + public Packet getPacketFrom(IMessage message) + { + return channels.get(Side.SERVER).generatePacketFrom(message); + } + + /** + * Send this message to everyone. + * The {@link IMessageHandler} for this message type should be on the CLIENT side. + * + * @param message The message to send + */ + public void sendToAll(IMessage message) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); + channels.get(Side.SERVER).writeAndFlush(message).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send this message to the specified player. + * The {@link IMessageHandler} for this message type should be on the CLIENT side. + * + * @param message The message to send + * @param player The player to send it to + */ + public void sendTo(IMessage message, EntityPlayerMP player) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); + channels.get(Side.SERVER).writeAndFlush(message).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send this message to everyone within a certain range of a point. + * The {@link IMessageHandler} for this message type should be on the CLIENT side. + * + * @param message The message to send + * @param point The {@link TargetPoint} around which to send + */ + public void sendToAllAround(IMessage message, NetworkRegistry.TargetPoint point) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); + channels.get(Side.SERVER).writeAndFlush(message).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send this message to everyone within the supplied dimension. + * The {@link IMessageHandler} for this message type should be on the CLIENT side. + * + * @param message The message to send + * @param dimensionId The dimension id to target + */ + public void sendToDimension(IMessage message, int dimensionId) + { + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); + channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); + channels.get(Side.SERVER).writeAndFlush(message).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + + /** + * Send this message to the server. + * The {@link IMessageHandler} for this message type should be on the SERVER side. + * + * @param message The message to send + */ + public void sendToServer(IMessage message) + { + channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + channels.get(Side.CLIENT).writeAndFlush(message).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatch.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatch.java new file mode 100644 index 0000000..5f6be4e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatch.java @@ -0,0 +1,25 @@ +package cpw.mods.fml.common.patcher; + +public class ClassPatch { + public final String name; + public final String sourceClassName; + public final String targetClassName; + public final boolean existsAtTarget; + public final byte[] patch; + public final int inputChecksum; + public ClassPatch(String name, String sourceClassName, String targetClassName, boolean existsAtTarget, int inputChecksum, byte[] patch) + { + this.name = name; + this.sourceClassName = sourceClassName; + this.targetClassName = targetClassName; + this.existsAtTarget = existsAtTarget; + this.inputChecksum = inputChecksum; + this.patch = patch; + } + + @Override + public String toString() + { + return String.format("%s : %s => %s (%b) size %d", name, sourceClassName, targetClassName, existsAtTarget, patch.length); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatchManager.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatchManager.java new file mode 100644 index 0000000..8932828 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/ClassPatchManager.java @@ -0,0 +1,233 @@ +package cpw.mods.fml.common.patcher; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; +import java.util.regex.Pattern; + +import org.apache.logging.log4j.Level; + +import net.minecraft.launchwrapper.LaunchClassLoader; + +import LZMA.LzmaInputStream; + +import com.google.common.base.Joiner; +import com.google.common.base.Throwables; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Maps; +import com.google.common.hash.Hashing; +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteStreams; +import com.google.common.io.Files; + +import cpw.mods.fml.relauncher.FMLRelaunchLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.repackage.com.nothome.delta.GDiffPatcher; + +public class ClassPatchManager { + public static final ClassPatchManager INSTANCE = new ClassPatchManager(); + + public static final boolean dumpPatched = Boolean.parseBoolean(System.getProperty("fml.dumpPatchedClasses", "false")); + public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugClassPatchManager", "false")); + + private GDiffPatcher patcher = new GDiffPatcher(); + private ListMultimap patches; + + private Map patchedClasses = Maps.newHashMap(); + private File tempDir; + private ClassPatchManager() + { + if (dumpPatched) + { + tempDir = Files.createTempDir(); + FMLRelaunchLog.info("Dumping patched classes to %s",tempDir.getAbsolutePath()); + } + } + + + public byte[] getPatchedResource(String name, String mappedName, LaunchClassLoader loader) throws IOException + { + byte[] rawClassBytes = loader.getClassBytes(name); + return applyPatch(name, mappedName, rawClassBytes); + } + public byte[] applyPatch(String name, String mappedName, byte[] inputData) + { + if (patches == null) + { + return inputData; + } + if (patchedClasses.containsKey(name)) + { + return patchedClasses.get(name); + } + List list = patches.get(name); + if (list.isEmpty()) + { + return inputData; + } + boolean ignoredError = false; + if (DEBUG) + FMLRelaunchLog.fine("Runtime patching class %s (input size %d), found %d patch%s", mappedName, (inputData == null ? 0 : inputData.length), list.size(), list.size()!=1 ? "es" : ""); + for (ClassPatch patch: list) + { + if (!patch.targetClassName.equals(mappedName) && !patch.sourceClassName.equals(name)) + { + FMLRelaunchLog.warning("Binary patch found %s for wrong class %s", patch.targetClassName, mappedName); + } + if (!patch.existsAtTarget && (inputData == null || inputData.length == 0)) + { + inputData = new byte[0]; + } + else if (!patch.existsAtTarget) + { + FMLRelaunchLog.warning("Patcher expecting empty class data file for %s, but received non-empty", patch.targetClassName); + } + else + { + int inputChecksum = Hashing.adler32().hashBytes(inputData).asInt(); + if (patch.inputChecksum != inputChecksum) + { + FMLRelaunchLog.severe("There is a binary discrepency between the expected input class %s (%s) and the actual class. Checksum on disk is %x, in patch %x. Things are probably about to go very wrong. Did you put something into the jar file?", mappedName, name, inputChecksum, patch.inputChecksum); + if (!Boolean.parseBoolean(System.getProperty("fml.ignorePatchDiscrepancies","false"))) + { + FMLRelaunchLog.severe("The game is going to exit, because this is a critical error, and it is very improbable that the modded game will work, please obtain clean jar files."); + System.exit(1); + } + else + { + FMLRelaunchLog.severe("FML is going to ignore this error, note that the patch will not be applied, and there is likely to be a malfunctioning behaviour, including not running at all"); + ignoredError = true; + continue; + } + } + } + synchronized (patcher) + { + try + { + inputData = patcher.patch(inputData, patch.patch); + } + catch (IOException e) + { + FMLRelaunchLog.log(Level.ERROR, e, "Encountered problem runtime patching class %s", name); + continue; + } + } + } + if (!ignoredError && DEBUG) + { + FMLRelaunchLog.fine("Successfully applied runtime patches for %s (new size %d)", mappedName, inputData.length); + } + if (dumpPatched) + { + try + { + Files.write(inputData, new File(tempDir,mappedName)); + } + catch (IOException e) + { + FMLRelaunchLog.log(Level.ERROR, e, "Failed to write %s to %s", mappedName, tempDir.getAbsolutePath()); + } + } + patchedClasses.put(name,inputData); + return inputData; + } + + public void setup(Side side) + { + Pattern binpatchMatcher = Pattern.compile(String.format("binpatch/%s/.*.binpatch", side.toString().toLowerCase(Locale.ENGLISH))); + JarInputStream jis; + try + { + InputStream binpatchesCompressed = getClass().getResourceAsStream("/binpatches.pack.lzma"); + if (binpatchesCompressed==null) + { + FMLRelaunchLog.log(Level.ERROR, "The binary patch set is missing. Either you are in a development environment, or things are not going to work!"); + return; + } + LzmaInputStream binpatchesDecompressed = new LzmaInputStream(binpatchesCompressed); + ByteArrayOutputStream jarBytes = new ByteArrayOutputStream(); + JarOutputStream jos = new JarOutputStream(jarBytes); + Pack200.newUnpacker().unpack(binpatchesDecompressed, jos); + jis = new JarInputStream(new ByteArrayInputStream(jarBytes.toByteArray())); + } + catch (Exception e) + { + FMLRelaunchLog.log(Level.ERROR, e, "Error occurred reading binary patches. Expect severe problems!"); + throw Throwables.propagate(e); + } + + patches = ArrayListMultimap.create(); + + do + { + try + { + JarEntry entry = jis.getNextJarEntry(); + if (entry == null) + { + break; + } + if (binpatchMatcher.matcher(entry.getName()).matches()) + { + ClassPatch cp = readPatch(entry, jis); + if (cp != null) + { + patches.put(cp.sourceClassName, cp); + } + } + else + { + jis.closeEntry(); + } + } + catch (IOException e) + { + } + } while (true); + FMLRelaunchLog.fine("Read %d binary patches", patches.size()); + if (DEBUG) + FMLRelaunchLog.fine("Patch list :\n\t%s", Joiner.on("\t\n").join(patches.asMap().entrySet())); + patchedClasses.clear(); + } + + private ClassPatch readPatch(JarEntry patchEntry, JarInputStream jis) + { + if (DEBUG) + FMLRelaunchLog.finer("Reading patch data from %s", patchEntry.getName()); + ByteArrayDataInput input; + try + { + input = ByteStreams.newDataInput(ByteStreams.toByteArray(jis)); + } + catch (IOException e) + { + FMLRelaunchLog.log(Level.WARN, e, "Unable to read binpatch file %s - ignoring", patchEntry.getName()); + return null; + } + String name = input.readUTF(); + String sourceClassName = input.readUTF(); + String targetClassName = input.readUTF(); + boolean exists = input.readBoolean(); + int inputChecksum = 0; + if (exists) + { + inputChecksum = input.readInt(); + } + int patchLength = input.readInt(); + byte[] patchBytes = new byte[patchLength]; + input.readFully(patchBytes); + + return new ClassPatch(name, sourceClassName, targetClassName, exists, inputChecksum, patchBytes); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/GenDiffSet.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/GenDiffSet.java new file mode 100644 index 0000000..5eb56be --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/patcher/GenDiffSet.java @@ -0,0 +1,100 @@ +package cpw.mods.fml.common.patcher; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; + +import java.util.logging.Logger; + +import com.google.common.hash.Hashing; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; +import com.google.common.io.Files; + +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; +import cpw.mods.fml.repackage.com.nothome.delta.Delta; + +public class GenDiffSet { + + private static final List RESERVED_NAMES = Arrays.asList("CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"); + + public static void main(String[] args) throws IOException + { + String sourceJar = args[0]; //Clean Vanilla jar minecraft.jar or minecraft_server.jar + String targetDir = args[1]; //Directory containing obfed output classes, typically mcp/reobf/minecraft + String deobfData = args[2]; //Path to FML's deobfusication_data.lzma + String outputDir = args[3]; //Path to place generated .binpatch + String killTarget = args[4]; //"true" if we should destroy the target file if it generated a successful .binpatch + + LogManager.getLogger("GENDIFF").log(Level.INFO, String.format("Creating patches at %s for %s from %s", outputDir, sourceJar, targetDir)); + Delta delta = new Delta(); + FMLDeobfuscatingRemapper remapper = FMLDeobfuscatingRemapper.INSTANCE; + remapper.setupLoadOnly(deobfData, false); + JarFile sourceZip = new JarFile(sourceJar); + boolean kill = killTarget.equalsIgnoreCase("true"); + + File f = new File(outputDir); + f.mkdirs(); + + for (String name : remapper.getObfedClasses()) + { +// Logger.getLogger("GENDIFF").info(String.format("Evaluating path for data :%s",name)); + String fileName = name; + String jarName = name; + if (RESERVED_NAMES.contains(name.toUpperCase(Locale.ENGLISH))) + { + fileName = "_"+name; + } + File targetFile = new File(targetDir, fileName.replace('/', File.separatorChar) + ".class"); + jarName = jarName+".class"; + if (targetFile.exists()) + { + String sourceClassName = name.replace('/', '.'); + String targetClassName = remapper.map(name).replace('/', '.'); + JarEntry entry = sourceZip.getJarEntry(jarName); + + byte[] vanillaBytes = entry != null ? ByteStreams.toByteArray(sourceZip.getInputStream(entry)) : new byte[0]; + byte[] patchedBytes = Files.toByteArray(targetFile); + + byte[] diff = delta.compute(vanillaBytes, patchedBytes); + + + ByteArrayDataOutput diffOut = ByteStreams.newDataOutput(diff.length + 50); + // Original name + diffOut.writeUTF(name); + // Source name + diffOut.writeUTF(sourceClassName); + // Target name + diffOut.writeUTF(targetClassName); + // exists at original + diffOut.writeBoolean(entry != null); + if (entry != null) + { + diffOut.writeInt(Hashing.adler32().hashBytes(vanillaBytes).asInt()); + } + // length of patch + diffOut.writeInt(diff.length); + // patch + diffOut.write(diff); + + File target = new File(outputDir, targetClassName+".binpatch"); + target.getParentFile().mkdirs(); + Files.write(diffOut.toByteArray(), target); + Logger.getLogger("GENDIFF").info(String.format("Wrote patch for %s (%s) at %s",name, targetClassName, target.getAbsolutePath())); + if (kill) + { + targetFile.delete(); + Logger.getLogger("GENDIFF").info(String.format(" Deleted target: %s", targetFile.toString())); + } + } + } + sourceZip.close(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/EntityRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/EntityRegistry.java new file mode 100644 index 0000000..1293088 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/EntityRegistry.java @@ -0,0 +1,370 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import java.util.BitSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.logging.log4j.Level; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; + +import com.google.common.base.Function; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Maps; +import com.google.common.primitives.UnsignedBytes; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.internal.FMLMessage.EntitySpawnMessage; + +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +public class EntityRegistry +{ + public class EntityRegistration + { + private Class entityClass; + private ModContainer container; + private String entityName; + private int modId; + private int trackingRange; + private int updateFrequency; + private boolean sendsVelocityUpdates; + private Function customSpawnCallback; + private boolean usesVanillaSpawning; + public EntityRegistration(ModContainer mc, Class entityClass, String entityName, int id, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) + { + this.container = mc; + this.entityClass = entityClass; + this.entityName = entityName; + this.modId = id; + this.trackingRange = trackingRange; + this.updateFrequency = updateFrequency; + this.sendsVelocityUpdates = sendsVelocityUpdates; + } + public Class getEntityClass() + { + return entityClass; + } + public ModContainer getContainer() + { + return container; + } + public String getEntityName() + { + return entityName; + } + public int getModEntityId() + { + return modId; + } + public int getTrackingRange() + { + return trackingRange; + } + public int getUpdateFrequency() + { + return updateFrequency; + } + public boolean sendsVelocityUpdates() + { + return sendsVelocityUpdates; + } + + public boolean usesVanillaSpawning() + { + return usesVanillaSpawning; + } + public boolean hasCustomSpawning() + { + return customSpawnCallback != null; + } + public Entity doCustomSpawning(EntitySpawnMessage spawnMsg) throws Exception + { + return customSpawnCallback.apply(spawnMsg); + } + public void setCustomSpawning(Function callable, boolean usesVanillaSpawning) + { + this.customSpawnCallback = callable; + this.usesVanillaSpawning = usesVanillaSpawning; + } + } + + private static final EntityRegistry INSTANCE = new EntityRegistry(); + + private BitSet availableIndicies; + private ListMultimap entityRegistrations = ArrayListMultimap.create(); + private Map entityNames = Maps.newHashMap(); + private BiMap, EntityRegistration> entityClassRegistrations = HashBiMap.create(); + public static EntityRegistry instance() + { + return INSTANCE; + } + + private EntityRegistry() + { + availableIndicies = new BitSet(256); + availableIndicies.set(1,255); + for (Object id : EntityList.IDtoClassMapping.keySet()) + { + availableIndicies.clear((Integer)id); + } + } + + /** + * Register the mod entity type with FML + + * @param entityClass The entity class + * @param entityName A unique name for the entity + * @param id A mod specific ID for the entity + * @param mod The mod + * @param trackingRange The range at which MC will send tracking updates + * @param updateFrequency The frequency of tracking updates + * @param sendsVelocityUpdates Whether to send velocity information packets as well + */ + public static void registerModEntity(Class entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) + { + instance().doModEntityRegistration(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates); + } + + @SuppressWarnings("unchecked") + private void doModEntityRegistration(Class entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) + { + ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod); + EntityRegistration er = new EntityRegistration(mc, entityClass, entityName, id, trackingRange, updateFrequency, sendsVelocityUpdates); + try + { + entityClassRegistrations.put(entityClass, er); + entityNames.put(entityName, mc); + if (!EntityList.classToStringMapping.containsKey(entityClass)) + { + String entityModName = String.format("%s.%s", mc.getModId(), entityName); + EntityList.classToStringMapping.put(entityClass, entityModName); + EntityList.stringToClassMapping.put(entityModName, entityClass); + FMLLog.finer("Automatically registered mod %s entity %s as %s", mc.getModId(), entityName, entityModName); + } + else + { + FMLLog.fine("Skipping automatic mod %s entity registration for already registered class %s", mc.getModId(), entityClass.getName()); + } + } + catch (IllegalArgumentException e) + { + FMLLog.log(Level.WARN, e, "The mod %s tried to register the entity (name,class) (%s,%s) one or both of which are already registered", mc.getModId(), entityName, entityClass.getName()); + return; + } + entityRegistrations.put(mc, er); + } + + public static void registerGlobalEntityID(Class entityClass, String entityName, int id) + { + if (EntityList.classToStringMapping.containsKey(entityClass)) + { + ModContainer activeModContainer = Loader.instance().activeModContainer(); + String modId = "unknown"; + if (activeModContainer != null) + { + modId = activeModContainer.getModId(); + } + else + { + FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped."); + } + FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass); + return; + } + id = instance().validateAndClaimId(id); + EntityList.addMapping(entityClass, entityName, id); + } + + private int validateAndClaimId(int id) + { + // workaround for broken ML + int realId = id; + if (id < Byte.MIN_VALUE) + { + FMLLog.warning("Compensating for modloader out of range compensation by mod : entityId %d for mod %s is now %d", id, Loader.instance().activeModContainer().getModId(), realId); + realId += 3000; + } + + if (realId < 0) + { + realId += Byte.MAX_VALUE; + } + try + { + UnsignedBytes.checkedCast(realId); + } + catch (IllegalArgumentException e) + { + FMLLog.log(Level.ERROR, "The entity ID %d for mod %s is not an unsigned byte and may not work", id, Loader.instance().activeModContainer().getModId()); + } + + if (!availableIndicies.get(realId)) + { + FMLLog.severe("The mod %s has attempted to register an entity ID %d which is already reserved. This could cause severe problems", Loader.instance().activeModContainer().getModId(), id); + } + availableIndicies.clear(realId); + return realId; + } + + public static void registerGlobalEntityID(Class entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) + { + if (EntityList.classToStringMapping.containsKey(entityClass)) + { + ModContainer activeModContainer = Loader.instance().activeModContainer(); + String modId = "unknown"; + if (activeModContainer != null) + { + modId = activeModContainer.getModId(); + } + else + { + FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped."); + } + FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass); + return; + } + instance().validateAndClaimId(id); + EntityList.addMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour); + } + + public static void addSpawn(Class entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes) + { + for (BiomeGenBase biome : biomes) + { + @SuppressWarnings("unchecked") + List spawns = biome.getSpawnableList(typeOfCreature); + + for (SpawnListEntry entry : spawns) + { + //Adjusting an existing spawn entry + if (entry.entityClass == entityClass) + { + entry.itemWeight = weightedProb; + entry.minGroupCount = min; + entry.maxGroupCount = max; + break; + } + } + + spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max)); + } + } + + @SuppressWarnings("unchecked") + public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes) + { + Class entityClazz = (Class) EntityList.stringToClassMapping.get(entityName); + + if (EntityLiving.class.isAssignableFrom(entityClazz)) + { + addSpawn((Class ) entityClazz, weightedProb, min, max, spawnList, biomes); + } + } + + public static void removeSpawn(Class entityClass, EnumCreatureType typeOfCreature, BiomeGenBase... biomes) + { + for (BiomeGenBase biome : biomes) + { + @SuppressWarnings("unchecked") + Iterator spawns = biome.getSpawnableList(typeOfCreature).iterator(); + + while (spawns.hasNext()) + { + SpawnListEntry entry = spawns.next(); + if (entry.entityClass == entityClass) + { + spawns.remove(); + } + } + } + } + + @SuppressWarnings("unchecked") + public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes) + { + Class entityClazz = (Class) EntityList.stringToClassMapping.get(entityName); + + if (EntityLiving.class.isAssignableFrom(entityClazz)) + { + removeSpawn((Class ) entityClazz, spawnList, biomes); + } + } + + public static int findGlobalUniqueEntityId() + { + int res = instance().availableIndicies.nextSetBit(0); + if (res < 0) + { + throw new RuntimeException("No more entity indicies left"); + } + return res; + } + + public EntityRegistration lookupModSpawn(Class clazz, boolean keepLooking) + { + Class localClazz = clazz; + + do + { + EntityRegistration er = entityClassRegistrations.get(localClazz); + if (er != null) + { + return er; + } + localClazz = localClazz.getSuperclass(); + keepLooking = (!Object.class.equals(localClazz)); + } + while (keepLooking); + + return null; + } + + public EntityRegistration lookupModSpawn(ModContainer mc, int modEntityId) + { + for (EntityRegistration er : entityRegistrations.get(mc)) + { + if (er.getModEntityId() == modEntityId) + { + return er; + } + } + return null; + } + + public boolean tryTrackingEntity(EntityTracker entityTracker, Entity entity) + { + + EntityRegistration er = lookupModSpawn(entity.getClass(), true); + if (er != null) + { + entityTracker.addEntityToTracker(entity, er.getTrackingRange(), er.getUpdateFrequency(), er.sendsVelocityUpdates()); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ExistingSubstitutionException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ExistingSubstitutionException.java new file mode 100644 index 0000000..254641d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ExistingSubstitutionException.java @@ -0,0 +1,9 @@ +package cpw.mods.fml.common.registry; + +public class ExistingSubstitutionException extends Exception { + public ExistingSubstitutionException(String fromName, Object toReplace) { + } + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java new file mode 100644 index 0000000..23cc4e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java @@ -0,0 +1,575 @@ +package cpw.mods.fml.common.registry; + +import java.util.ArrayList; +import java.util.BitSet; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.util.ObjectIntIdentityMap; +import net.minecraft.util.RegistryNamespaced; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterators; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.functions.GenericIterableFactory; +import cpw.mods.fml.common.registry.RegistryDelegate.Delegate; + +public class FMLControlledNamespacedRegistry extends RegistryNamespaced { + public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false")); + private final Class superType; + private String optionalDefaultName; + private I optionalDefaultObject; + private int maxId; + private int minId; + private char discriminator; + // aliases redirecting legacy names to the actual name, may need recursive application to find the final name. + // these need to be registry specific, it's possible to only have a loosely linked item for a block which may get renamed by itself. + private final Map aliases = new HashMap(); + private BiMap persistentSubstitutions; + private BiMap activeSubstitutions = HashBiMap.create(); + + FMLControlledNamespacedRegistry(String optionalDefault, int maxIdValue, int minIdValue, Class type, char discriminator) + { + this.superType = type; + this.discriminator = discriminator; + this.optionalDefaultName = optionalDefault; + this.maxId = maxIdValue; + this.minId = minIdValue; + } + + void validateContent(int maxId, String type, BitSet availabilityMap, Set blockedIds, FMLControlledNamespacedRegistry iBlockRegistry) + { + for (I obj : typeSafeIterable()) + { + int id = getId(obj); + String name = getNameForObject(obj); + boolean isSubstituted = activeSubstitutions.containsKey(name); + + // id lookup failed -> obj is not in the obj<->id map + if (!isSubstituted && id < 0) throw new IllegalStateException(String.format("Registry entry for %s %s, name %s, doesn't yield an id.", type, obj, name)); + // id is too high + if (id > maxId) throw new IllegalStateException(String.format("Registry entry for %s %s, name %s uses the too large id %d.", type, obj, name)); + // name lookup failed -> obj is not in the obj<->name map + if (name == null) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, doesn't yield a name.", type, obj, id)); + // empty name + if (name.isEmpty()) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, yields an empty name.", type, obj, id)); + // non-prefixed name + if (name.indexOf(':') == -1) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, has the non-prefixed name %s.", type, obj, id, name)); + // the rest of the tests don't really work for substituted items or blocks + if (isSubstituted) continue; + // id -> obj lookup is inconsistent + if (getRaw(id) != obj) throw new IllegalStateException(String.format("Registry entry for id %d, name %s, doesn't yield the expected %s %s.", id, name, type, obj)); + // name -> obj lookup is inconsistent + if (getRaw(name) != obj) throw new IllegalStateException(String.format("Registry entry for name %s, id %d, doesn't yield the expected %s %s.", name, id, type, obj)); + // name -> id lookup is inconsistent + if (getId(name) != id) throw new IllegalStateException(String.format("Registry entry for name %s doesn't yield the expected id %d.", name, id)); + // id isn't marked as unavailable + if (!availabilityMap.get(id)) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, name %s, marked as empty.", type, obj, id, name)); + // entry is blocked, thus should be empty + if (blockedIds.contains(id)) throw new IllegalStateException(String.format("Registry entry for %s %s, id %d, name %s, marked as dangling.", type, obj, id, name)); + + if (obj instanceof ItemBlock) + { + Block block = ((ItemBlock) obj).field_150939_a; + + // verify matching block entry + if (iBlockRegistry.getId(block) != id) + { + throw new IllegalStateException(String.format("Registry entry for ItemBlock %s, id %d, is missing or uses the non-matching id %d.", obj, id, iBlockRegistry.getId(block))); + } + // verify id range + if (id > GameData.MAX_BLOCK_ID) throw new IllegalStateException(String.format("ItemBlock %s uses the id %d outside the block id range", name, id)); + } + } + + } + void set(FMLControlledNamespacedRegistry registry) + { + if (this.superType != registry.superType) throw new IllegalArgumentException("incompatible registry"); + + this.discriminator = registry.discriminator; + this.optionalDefaultName = registry.optionalDefaultName; + this.maxId = registry.maxId; + this.minId = registry.minId; + this.aliases.clear(); + this.aliases.putAll(registry.aliases); + this.activeSubstitutions.clear(); + + underlyingIntegerMap = new ObjectIntIdentityMap(); + registryObjects.clear(); + + for (I thing : registry.typeSafeIterable()) + { + int id = registry.getId(thing); + addObjectRaw(id, registry.getNameForObject(thing), thing); + } + this.activeSubstitutions.putAll(registry.activeSubstitutions); + } + + // public api + + /** + * Add an object to the registry, trying to use the specified id. + * + * @deprecated register through {@link GameRegistry} instead. + */ + /** + * Adds a new object to this registry, keyed by both the given integer ID and the given string. + */ + @Override + @Deprecated + public void addObject(int id, String name, Object thing) + { + GameData.getMain().register(thing, name, id); + } + + /** + * DANGEROUS! EVIL! DO NOT USE! + * + * @deprecated register through {@link GameRegistry} instead. + */ + /** + * Register an object on this registry. + */ + @Override + @Deprecated + public void putObject(Object objName, Object obj) + { + String name = (String) objName; + I thing = cast(obj); + + if (name == null) throw new NullPointerException("Can't use a null-name for the registry."); + if (name.isEmpty()) throw new IllegalArgumentException("Can't use an empty name for the registry."); + if (thing == null) throw new NullPointerException("Can't add null-object to the registry."); + + name = ensureNamespaced(name); + String existingName = getNameForObject(thing); + + if (existingName == null) + { + FMLLog.bigWarning("Ignoring putObject(%s, %s), not resolvable", name, thing); + } + else if (existingName.equals(name)) + { + FMLLog.bigWarning("Ignoring putObject(%s, %s), already added", name, thing); + } + else + { + FMLLog.bigWarning("Ignoring putObject(%s, %s), adding alias to %s instead", name, thing, existingName); + addAlias(name, existingName); + } + } + + /** + * Fetch the object identified by the specified name or the default object. + * + * For blocks the default object is the air block, for items it's null. + * + * @param name Unique name identifying the object. + * @return Registered object of the default object if it wasn't found- + */ + @Override + public I getObject(String name) + { + I object = getRaw(name); + return object == null ? this.optionalDefaultObject : object; + } + + /** + * Fetch the object identified by the specified id or the default object. + * + * For blocks the default object is the air block, for items it's null. + * + * @param id ID identifying the object. + * @return Registered object of the default object if it wasn't found- + */ + /** + * Gets the object identified by the given ID. + */ + @Override + public I getObjectById(int id) + { + I object = getRaw(id); + return object == null ? this.optionalDefaultObject : object; + } + + /** + * @deprecated use getObjectById instead + */ + @Deprecated + public I get(int id) + { + return getObjectById(id); + } + + /** + * @deprecated use getObject instead + */ + @Deprecated + public I get(String name) + { + return getObject(name); + } + + /** + * Get the id for the specified object. + * + * Don't hold onto the id across the world, it's being dynamically re-mapped as needed. + * + * Usually the name should be used instead of the id, if using the Block/Item object itself is + * not suitable for the task. + * + * @param thing Block/Item object. + * @return Block/Item id or -1 if it wasn't found. + */ + public int getId(I thing) + { + return getIDForObject(thing); + } + + /** + * Get the object identified by the specified id. + * + * @param id Block/Item id. + * @return Block/Item object or null if it wasn't found. + */ + public I getRaw(int id) + { + return cast(super.getObjectById(id)); + } + + /** + * superType.cast appears to be expensive. Skip it for speed? + * @param obj + * @return + */ + @SuppressWarnings("unchecked") + private I cast(Object obj) + { + return (I)(obj); + } + /** + * Get the object identified by the specified name. + * + * @param name Block/Item name. + * @return Block/Item object or null if it wasn't found. + */ + public I getRaw(String name) + { + I ret = cast(super.getObject(name)); + + if (ret == null) // no match, try aliases recursively + { + name = aliases.get(name); + + if (name != null) return getRaw(name); + } + + return ret; + } + + /** + * Determine if the registry has an entry for the specified name. + * + * Aliased names will be resolved as well. + * + * @param name Object name to check. + * @return true if a matching entry was found. + */ + /** + * Does this registry contain an entry for the given key? + */ + @Override + public boolean containsKey(String name) + { + boolean ret = super.containsKey(name); + + if (!ret) // no match, try aliases recursively + { + name = aliases.get(name); + + if (name != null) return containsKey(name); + } + + return ret; + } + + /** + * Get the id for the specified object. + * + * Don't hold onto the id across the world, it's being dynamically re-mapped as needed. + * + * Usually the name should be used instead of the id, if using the Block/Item object itself is + * not suitable for the task. + * + * @param itemName Block/Item registry name. + * @return Block/Item id or -1 if it wasn't found. + */ + public int getId(String itemName) + { + I obj = getRaw(itemName); + if (obj == null) return -1; + + return getId(obj); + } + + /** + * @deprecated use containsKey instead + */ + @Deprecated + public boolean contains(String itemName) + { + return containsKey(itemName); + } + + /* + * This iterator is used by FML to visit the actual block sets, it should use the super.iterator method instead + * Compare #iterator() + */ + public Iterable typeSafeIterable() + { + return GenericIterableFactory.newCastingIterable(super.iterator(), superType); + } + + // internal + + public void serializeInto(Map idMapping) // for saving + { + for (I thing : this.typeSafeIterable()) + { + idMapping.put(discriminator+getNameForObject(thing), getId(thing)); + } + } + + public Map getAliases() // for saving + { + return ImmutableMap.copyOf(aliases); + } + + /** + * Add the specified object to the registry. + * + * @param id ID to use if available, auto-assigned otherwise. + * @param name Name to use, prefixed by the mod id. + * @param thing Object to add. + * @param availabilityMap Map marking available IDs for auto assignment. + * @return ID eventually allocated. + */ + int add(int id, String name, I thing, BitSet availabilityMap) + { + if (name == null) throw new NullPointerException(String.format("Can't use a null-name for the registry, object %s.", thing)); + if (name.isEmpty()) throw new IllegalArgumentException(String.format("Can't use an empty name for the registry, object %s.", thing)); + if (name.indexOf(':') == -1) throw new IllegalArgumentException(String.format("Can't add the name (%s) without a prefix, object %s", name, thing)); + if (thing == null) throw new NullPointerException(String.format("Can't add null-object to the registry, name %s.", name)); + if (name.equals(optionalDefaultName) && this.optionalDefaultObject == null) + { + this.optionalDefaultObject = thing; + } + if (getPersistentSubstitutions().containsValue(thing)) + { + throw new IllegalArgumentException(String.format("The object %s (%s) cannot be added to the registry. It is already being used as a substitute for %s", thing.getClass(), name, getPersistentSubstitutions().inverse().get(thing))); + } + int idToUse = id; + if (idToUse < 0 || availabilityMap.get(idToUse)) + { + idToUse = availabilityMap.nextClearBit(minId); + } + if (idToUse > maxId) + { + throw new RuntimeException(String.format("Invalid id %d - maximum id range exceeded.", idToUse)); + } + + if (getRaw(name) == thing) // already registered, return prev registration's id + { + FMLLog.bigWarning("The object %s has been registered twice for the same name %s.", thing, name); + return getId(thing); + } + if (getRaw(name) != null) // duplicate name + { + throw new IllegalArgumentException(String.format("The name %s has been registered twice, for %s and %s.", name, getRaw(name), thing)); + } + if (getId(thing) >= 0) // duplicate object - but only if it's not being substituted + { + int foundId = getId(thing); + Object otherThing = getRaw(foundId); + throw new IllegalArgumentException(String.format("The object %s{%x} has been registered twice, using the names %s and %s. (Other object at this id is %s{%x})", thing, System.identityHashCode(thing), getNameForObject(thing), name, otherThing, System.identityHashCode(otherThing))); + } + if (GameData.isFrozen(this)) + { + FMLLog.bigWarning("The object %s (name %s) is being added too late.", thing, name); + } + + if (activeSubstitutions.containsKey(name)) + { + thing = activeSubstitutions.get(name); + } + addObjectRaw(idToUse, name, thing); + + if (DEBUG) + FMLLog.finer("Registry add: %s %d %s (req. id %d)", name, idToUse, thing, id); + return idToUse; + } + + void addAlias(String from, String to) + { + aliases.put(from, to); + if (DEBUG) + FMLLog.finer("Registry alias: %s -> %s", from, to); + } + + Map getEntriesNotIn(FMLControlledNamespacedRegistry registry) + { + Map ret = new HashMap(); + + for (I thing : this.typeSafeIterable()) + { + if (!registry.field_148758_b.containsKey(thing)) + { + if (!registry.activeSubstitutions.containsKey(getNameForObject(thing))) + { + ret.put(getNameForObject(thing), getId(thing)); + } + } + } + + return ret; + } + + void dump() + { + if (!DEBUG) + return; + + List ids = new ArrayList(); + + for (I thing : this.typeSafeIterable()) + { + ids.add(getId(thing)); + } + + // sort by id + Collections.sort(ids); + + for (int id : ids) + { + I thing = getRaw(id); + FMLLog.finer("Registry: %d %s %s", id, getNameForObject(thing), thing); + } + } + + /** + * Version of addObject not using the API restricting overrides. + */ + private void addObjectRaw(int id, String name, I thing) + { + if (name == null) throw new NullPointerException("The name to be added to the registry is null. This can only happen with a corrupted registry state. Reflection/ASM hackery? Registry bug?"); + if (thing == null) throw new NullPointerException("The object to be added to the registry is null. This can only happen with a corrupted registry state. Reflection/ASM hackery? Registry bug?"); + if (!superType.isInstance(thing)) throw new IllegalArgumentException("The object to be added to the registry is not of the right type. Reflection/ASM hackery? Registry bug?"); + + underlyingIntegerMap.func_148746_a(thing, id); // obj <-> id + super.putObject(name, thing); // name <-> obj + } + + public I getDefaultValue() + { + return optionalDefaultObject; + } + + public RegistryDelegate getDelegate(I thing, Class clazz) { + return GameData.buildDelegate(thing, clazz); + } + + void activateSubstitution(String nameToReplace) + { + if (getPersistentSubstitutions().containsKey(nameToReplace)) + { + I original = getRaw(nameToReplace); + if (superType == Item.class) { + Item sub = (Item) getPersistentSubstitutions().get(nameToReplace); + if (original == null) { + // When we're activated from the server side, we need to set the delegate on the original instance to + // point to us. Go to the "default state" registry to get it + original = (I)GameData.getItemRegistry().getRaw(nameToReplace); + } + FMLLog.log(Level.DEBUG, "Replacing %s with %s (name %s)", original, sub, nameToReplace); + Delegate delegate = (Delegate)((Item)original).delegate; + delegate.changeReference(sub); + ((Delegate)sub.delegate).setName(nameToReplace); + } + activeSubstitutions.put(nameToReplace, getPersistentSubstitutions().get(nameToReplace)); + } + } + + void addSubstitutionAlias(String modId, String nameToReplace, Object toReplace) throws ExistingSubstitutionException { + if (getPersistentSubstitutions().containsKey(nameToReplace) || getPersistentSubstitutions().containsValue(toReplace)) + { + FMLLog.severe("The substitution of %s has already occured. You cannot duplicate substitutions", nameToReplace); + throw new ExistingSubstitutionException(nameToReplace, toReplace); + } + I replacement = cast(toReplace); + I original = getRaw(nameToReplace); + if (original == null) + { + throw new NullPointerException("The replacement target is not present. This won't work"); + } + if (!original.getClass().isAssignableFrom(replacement.getClass())) + { + FMLLog.severe("The substitute %s for %s (type %s) is type incompatible. This won't work", replacement.getClass().getName(), nameToReplace, original.getClass().getName()); + throw new IncompatibleSubstitutionException(nameToReplace, replacement, original); + } + int existingId = getId(replacement); + if (existingId != -1) + { + FMLLog.severe("The substitute %s for %s is registered into the game independently. This won't work", replacement.getClass().getName(), nameToReplace); + throw new IllegalArgumentException("The object substitution is already registered. This won't work"); + } + FMLLog.log(Level.DEBUG, "Adding substitution %s with %s (name %s)", original, replacement, nameToReplace); + getPersistentSubstitutions().put(nameToReplace, replacement); + } + + public void serializeSubstitutions(Set blockSubs) + { + blockSubs.addAll(activeSubstitutions.keySet()); + } + + private BiMap getPersistentSubstitutions() + { + if (persistentSubstitutions == null) + { + persistentSubstitutions = GameData.getMain().getPersistentSubstitutionMap(superType); + } + return persistentSubstitutions; + } + + /* + * This iterator is used by some regular MC methods to visit all blocks, we need to include substitutions + * Compare #typeSafeIterable() + */ + @SuppressWarnings("unchecked") + @Override + public Iterator iterator() + { + return Iterators.concat(super.iterator(),getPersistentSubstitutions().values().iterator()); + } + + // ONLY CALLED ON ITEM registry + void resetSubstitutionDelegates() + { + for (I item: typeSafeIterable()) { + Delegate delegate = (Delegate)((Item)item).delegate; + delegate.changeReference((Item)item); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameData.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameData.java new file mode 100644 index 0000000..6156038 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameData.java @@ -0,0 +1,1039 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import java.io.File; +import java.io.IOException; +import java.util.BitSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Charsets; +import com.google.common.base.Joiner; +import com.google.common.base.Joiner.MapJoiner; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.collect.Table; +import com.google.common.io.Files; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.common.ZipperUtil; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; +import cpw.mods.fml.common.registry.GameRegistry.Type; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; + +public class GameData { + static final int MIN_BLOCK_ID = 0; + static final int MAX_BLOCK_ID = 4095; + static final int MIN_ITEM_ID = 4096; + static final int MAX_ITEM_ID = 31999; + + private static final GameData mainData = new GameData(); + + /** + * @deprecated use {@link #getBlockRegistry()} instead. + */ + @Deprecated + public static final FMLControlledNamespacedRegistry blockRegistry = getBlockRegistry(); + /** + * @deprecated use {@link #getItemRegistry()} instead. + */ + @Deprecated + public static final FMLControlledNamespacedRegistry itemRegistry = getItemRegistry(); + + private static Table customItemStacks = HashBasedTable.create(); + private static Map customOwners = Maps.newHashMap(); + private static GameData frozen; + + // public api + + /** + * Get the currently active block registry. + * + * @return Block Registry. + */ + public static FMLControlledNamespacedRegistry getBlockRegistry() { + return getMain().iBlockRegistry; + } + + /** + * Get the currently active item registry. + * + * @return Item Registry. + */ + public static FMLControlledNamespacedRegistry getItemRegistry() { + return getMain().iItemRegistry; + } + + /** + * @deprecated no replacement planned + */ + @Deprecated + public static ModContainer findModOwner(String string) + { + UniqueIdentifier ui = new UniqueIdentifier(string); + if (customOwners.containsKey(ui)) + { + return customOwners.get(ui); + } + return Loader.instance().getIndexedModList().get(ui.modId); + } + + // internal from here + + public static class GameDataSnapshot { + public final Map idMap; + public final Set blockSubstitutions; + public final Set itemSubstitutions; + public GameDataSnapshot(Map idMap, Set blockSubstitutions, Set itemSubstitutions) + { + this.idMap = idMap; + this.blockSubstitutions = blockSubstitutions; + this.itemSubstitutions = itemSubstitutions; + } + } + public static GameDataSnapshot buildItemDataList() + { + Map idMapping = Maps.newHashMap(); + getMain().iBlockRegistry.serializeInto(idMapping); + getMain().iItemRegistry.serializeInto(idMapping); + Set blockSubs = Sets.newHashSet(); + getMain().iBlockRegistry.serializeSubstitutions(blockSubs); + Set itemSubs = Sets.newHashSet(); + getMain().iItemRegistry.serializeSubstitutions(itemSubs); + return new GameDataSnapshot(idMapping, blockSubs, itemSubs); + } + + public static int[] getBlockedIds() + { + int[] ret = new int[getMain().blockedIds.size()]; + int index = 0; + + for (int id : getMain().blockedIds) + { + ret[index] = id; + index++; + } + + return ret; + } + + public static void dumpRegistry(File minecraftDir) + { + if (customItemStacks == null) + { + return; + } + if (Boolean.valueOf(System.getProperty("fml.dumpRegistry", "false")).booleanValue()) + { + ImmutableListMultimap.Builder builder = ImmutableListMultimap.builder(); + for (String modId : customItemStacks.rowKeySet()) + { + builder.putAll(modId, customItemStacks.row(modId).keySet()); + } + + File f = new File(minecraftDir, "itemStackRegistry.csv"); + MapJoiner mapJoiner = Joiner.on("\n").withKeyValueSeparator(","); + try + { + Files.write(mapJoiner.join(builder.build().entries()), f, Charsets.UTF_8); + FMLLog.log(Level.INFO, "Dumped item registry data to %s", f.getAbsolutePath()); + } + catch (IOException e) + { + FMLLog.log(Level.ERROR, e, "Failed to write registry data to %s", f.getAbsolutePath()); + } + } + } + + static Item findItem(String modId, String name) + { + return (Item) getMain().iItemRegistry.getObject(modId + ":" + name); + } + + static Block findBlock(String modId, String name) + { + String key = modId + ":" + name; + return getMain().iBlockRegistry.containsKey(key) ? getMain().iBlockRegistry.getObject(key) : null; + } + + static ItemStack findItemStack(String modId, String name) + { + ItemStack is = customItemStacks.get(modId, name); + if (is == null) + { + Item i = findItem(modId, name); + if (i != null) + { + is = new ItemStack(i, 0 ,0); + } + } + if (is == null) + { + Block b = findBlock(modId, name); + if (b != null) + { + is = new ItemStack(b, 0, Short.MAX_VALUE); + } + } + return is; + } + + static void registerCustomItemStack(String name, ItemStack itemStack) + { + customItemStacks.put(Loader.instance().activeModContainer().getModId(), name, itemStack); + } + + static UniqueIdentifier getUniqueName(Block block) + { + if (block == null) return null; + String name = getMain().iBlockRegistry.getNameForObject(block); + UniqueIdentifier ui = new UniqueIdentifier(name); + if (customItemStacks.contains(ui.modId, ui.name)) + { + return null; + } + + return ui; + } + + static UniqueIdentifier getUniqueName(Item item) + { + if (item == null) return null; + String name = getMain().iItemRegistry.getNameForObject(item); + UniqueIdentifier ui = new UniqueIdentifier(name); + if (customItemStacks.contains(ui.modId, ui.name)) + { + return null; + } + + return ui; + } + + /** + * Fix IDs improperly allocated by early versions of the registry, best-effort. + * + * Items sharing the same ID with a block, but not sharing the same registry name will be + * mapped to an unused id. Losing items instead of blocks should minimize the damage. + * + * @param dataList List containing the IDs to fix + */ + public static void fixBrokenIds(Map dataList, Set blockedIds) + { + BitSet availabilityMap = new BitSet(MAX_ITEM_ID + 1); + + // reserve all ids occupied by blocks + for (Entry entry : dataList.entrySet()) + { + String itemName = entry.getKey(); + @SuppressWarnings("unused") + String realName = itemName.substring(1); + + if (itemName.charAt(0) == '\u0001') // is a block + { + availabilityMap.set(entry.getValue()); + } + } + + Set newBlockedIds = new HashSet(); + Set itemsToRemove = new HashSet(); + Map itemsToRelocate = new HashMap(); + + // check all ids occupied by items + for (Entry entry : dataList.entrySet()) + { + String itemName = entry.getKey(); + + if (itemName.charAt(0) != '\u0001') // is an item + { + int oldId = entry.getValue(); + String realName = itemName.substring(1); + String blockName = '\u0001' + realName; + Item item = getMain().iItemRegistry.getRaw(realName); + boolean blockThisId = false; // block oldId unless it's used by a block + + if (item == null) // item no longer available + { + // can't fix items without reliably checking if they are ItemBlocks + FMLLog.warning("Item %s (old id %d) is no longer available and thus can't be fixed.", realName, oldId); + itemsToRemove.add(itemName); + blockThisId = true; + } + else if (item instanceof ItemBlock) + { + if (dataList.containsKey(blockName)) // the item was an ItemBlock before + { + int blockId = dataList.get(blockName); + + if (blockId != oldId) // mis-located ItemBlock + { + // relocate to the matching block + FMLLog.warning("ItemBlock %s (old id %d) doesn't have the same id as its block (%d).", realName, oldId, blockId); + itemsToRelocate.put(entry.getKey(), blockId); + blockThisId = true; + } + else // intact ItemBlock + { + availabilityMap.set(oldId); // occupy id + } + } + else // the item hasn't been an ItemBlock before, but it's now + { + // can't fix these, drop them + FMLLog.warning("Item %s (old id %d) has been migrated to an ItemBlock and can't be fixed.", realName, oldId); + itemsToRemove.add(itemName); + blockThisId = true; + } + } + else if (availabilityMap.get(oldId)) // normal item, id is already occupied + { + // remove the item mapping + FMLLog.warning("Item %s (old id %d) is conflicting with another block/item and can't be fixed.", realName, oldId); + itemsToRemove.add(itemName); + } + else // intact Item + { + availabilityMap.set(oldId); // occupy id + } + + // handle blocking the id from future use if possible (i.e. not used by a conflicting block) + // blockThisId requests don't modify availabilityMap, it could only be set by a block (or another item, which isn't being handled) + if (blockThisId && !availabilityMap.get(oldId)) + { + // there's no block occupying this id, thus block the id from future use + // as there may still be ItemStacks in the world referencing it + newBlockedIds.add(oldId); + availabilityMap.set(oldId); + } + } + } + + if (itemsToRemove.isEmpty() && itemsToRelocate.isEmpty()) return; // nothing to do + + // confirm + String text = "Forge Mod Loader detected that this save is damaged.\n\n" + + "It's likely that an automatic repair can successfully restore\n" + + "most of it, except some items which may get swapped with others.\n\n" + + "A world backup will be created as a zip file in your saves\n" + + "directory automatically.\n\n" + + itemsToRemove.size()+" items need to be removed.\n"+ + itemsToRelocate.size()+" items need to be relocated."; + + boolean confirmed = StartupQuery.confirm(text); + if (!confirmed) StartupQuery.abort(); + + // confirm missing mods causing item removal + Set modsMissing = new HashSet(); + + for (String itemName : itemsToRemove) + { + modsMissing.add(itemName.substring(1, itemName.indexOf(':'))); + } + + for (Iterator it = modsMissing.iterator(); it.hasNext(); ) + { + String mod = it.next(); + + if (mod.equals("minecraft") || Loader.isModLoaded(mod)) it.remove(); + } + + if (!modsMissing.isEmpty()) + { + text = "Forge Mod Loader detected that "+modsMissing.size()+" mods are missing.\n\n" + + "If you continue items previously provided by those mods will be\n" + + "removed while repairing this world save.\n\n" + + "Missing mods:\n"; + + for (String mod : modsMissing) text += mod+"\n"; + + confirmed = StartupQuery.confirm(text); + if (!confirmed) StartupQuery.abort(); + } + + // backup + try + { + String skip = System.getProperty("fml.doNotBackup"); + if (skip == null || !"true".equals(skip)) + { + ZipperUtil.backupWorld(); + } + else + { + for (int x = 0; x < 10; x++) + FMLLog.severe("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!"); + } + } + catch (IOException e) + { + StartupQuery.notify("The world backup couldn't be created.\n\n"+e); + StartupQuery.abort(); + } + + // apply fix + for (String itemName : itemsToRemove) + { + int id = dataList.remove(itemName); + + FMLLog.warning("Removed Item %s, old id %d.", itemName.substring(1), id); + } + + for (Map.Entry entry : itemsToRelocate.entrySet()) + { + String itemName = entry.getKey(); + int newId = entry.getValue(); + + int oldId = dataList.put(itemName, newId); + + FMLLog.warning("Remapped Item %s to id %d, old id %d.", itemName.substring(1), newId, oldId); + } + + blockedIds.addAll(newBlockedIds); + } + + public static List injectWorldIDMap(Map dataList, Set blockSubstitutions, Set itemSubstitutions, boolean injectFrozenData, boolean isLocalWorld) + { + return injectWorldIDMap(dataList, new HashSet(), new HashMap(), new HashMap(), blockSubstitutions, itemSubstitutions, injectFrozenData, isLocalWorld); + } + + public static List injectWorldIDMap(Map dataList, Set blockedIds, Map blockAliases, Map itemAliases, Set blockSubstitutions, Set itemSubstitutions, boolean injectFrozenData, boolean isLocalWorld) + { + FMLLog.info("Injecting existing block and item data into this %s instance", FMLCommonHandler.instance().getEffectiveSide().isServer() ? "server" : "client"); + Map remaps = Maps.newHashMap(); + LinkedHashMap missingMappings = new LinkedHashMap(); + getMain().testConsistency(); + getMain().iBlockRegistry.dump(); + getMain().iItemRegistry.dump(); + + getMain().iItemRegistry.resetSubstitutionDelegates(); + GameData newData = new GameData(); + + for (int id : blockedIds) + { + newData.block(id); + } + + for (Map.Entry entry : blockAliases.entrySet()) + { + newData.iBlockRegistry.addAlias(entry.getKey(), entry.getValue()); + } + + for (Map.Entry entry : itemAliases.entrySet()) + { + newData.iItemRegistry.addAlias(entry.getKey(), entry.getValue()); + } + + for (String entry : blockSubstitutions) + { + newData.iBlockRegistry.activateSubstitution(entry); + } + for (String entry : itemSubstitutions) + { + newData.iItemRegistry.activateSubstitution(entry); + } + if (injectFrozenData) + { + for (String newBlockSubstitution : getMain().blockSubstitutions.keySet()) + { + if (!blockSubstitutions.contains(newBlockSubstitution)) + { + newData.iBlockRegistry.activateSubstitution(newBlockSubstitution); + } + } + for (String newItemSubstitution : getMain().itemSubstitutions.keySet()) + { + if (!itemSubstitutions.contains(newItemSubstitution)) + { + newData.iItemRegistry.activateSubstitution(newItemSubstitution); + } + } + } + // process blocks and items in the world, blocks in the first pass, items in the second + // blocks need to be added first for proper ItemBlock handling + for (int pass = 0; pass < 2; pass++) + { + boolean isBlock = (pass == 0); + + for (Entry entry : dataList.entrySet()) + { + String itemName = entry.getKey(); + int newId = entry.getValue(); + + // names starting with 0x1 are blocks, skip if the type isn't handled by this pass + if ((itemName.charAt(0) == '\u0001') != isBlock) continue; + + itemName = itemName.substring(1); + int currId = isBlock ? getMain().iBlockRegistry.getId(itemName) : getMain().iItemRegistry.getId(itemName); + + if (currId == -1) + { + FMLLog.info("Found a missing id from the world %s", itemName); + missingMappings.put(entry.getKey(), newId); + continue; // no block/item -> nothing to add + } + else if (currId != newId) + { + FMLLog.fine("Fixed %s id mismatch %s: %d (init) -> %d (map).", isBlock ? "block" : "item", itemName, currId, newId); + remaps.put(itemName, new Integer[] { currId, newId }); + } + + // register + if (isBlock) + { + currId = newData.registerBlock(getMain().iBlockRegistry.getRaw(itemName), itemName, newId); + } + else + { + currId = newData.registerItem(getMain().iItemRegistry.getRaw(itemName), itemName, newId); + } + + if (currId != newId) + { + throw new IllegalStateException(String.format("Can't map %s %s to id %d (seen at: %d), already occupied by %s, blocked %b, ItemBlock %b", + isBlock ? "block" : "item", + itemName, + newId, + currId, + isBlock ? newData.iBlockRegistry.getRaw(newId) : newData.iItemRegistry.getRaw(newId), + newData.blockedIds.contains(newId), + isBlock ? false : (getMain().iItemRegistry.getRaw(currId) instanceof ItemBlock))); + } + } + } + + List missedMappings = Loader.instance().fireMissingMappingEvent(missingMappings, isLocalWorld, newData, remaps); + if (!missedMappings.isEmpty()) return missedMappings; + + if (injectFrozenData) // add blocks + items missing from the map + { + Map missingBlocks = frozen.iBlockRegistry.getEntriesNotIn(newData.iBlockRegistry); + Map missingItems = frozen.iItemRegistry.getEntriesNotIn(newData.iItemRegistry); + + if (!missingBlocks.isEmpty() || !missingItems.isEmpty()) + { + FMLLog.info("Injecting new block and item data into this server instance."); + + for (int pass = 0; pass < 2; pass++) + { + boolean isBlock = pass == 0; + Map missing = (pass == 0) ? missingBlocks : missingItems; + + for (Entry entry : missing.entrySet()) + { + String itemName = entry.getKey(); + int currId = entry.getValue(); + int newId; + + if (isBlock) + { + newId = newData.registerBlock(frozen.iBlockRegistry.getRaw(itemName), itemName, currId); + } + else + { + newId = newData.registerItem(frozen.iItemRegistry.getRaw(itemName), itemName, currId); + } + + FMLLog.info("Injected new block/item %s: %d (init) -> %d (map).", itemName, currId, newId); + + if (newId != currId) // a new id was assigned + { + remaps.put(itemName, new Integer[] { entry.getValue(), newId }); + } + } + } + } + } + + newData.testConsistency(); + getMain().set(newData); + + getMain().iBlockRegistry.dump(); + getMain().iItemRegistry.dump(); + Loader.instance().fireRemapEvent(remaps); + // The id map changed, ensure we apply object holders + ObjectHolderRegistry.INSTANCE.applyObjectHolders(); + return ImmutableList.of(); + } + + public static List processIdRematches(Iterable missedMappings, boolean isLocalWorld, GameData gameData, Map remaps) + { + List failed = Lists.newArrayList(); + List ignored = Lists.newArrayList(); + List warned = Lists.newArrayList(); + List defaulted = Lists.newArrayList(); + + for (MissingMapping remap : missedMappings) + { + FMLMissingMappingsEvent.Action action = remap.getAction(); + + if (action == FMLMissingMappingsEvent.Action.REMAP) + { + // block/item re-mapped, finish the registration with the new name/object, but the old id + int currId, newId; + String newName; + + if (remap.type == Type.BLOCK) + { + currId = getMain().iBlockRegistry.getId((Block) remap.getTarget()); + newName = getMain().iBlockRegistry.getNameForObject(remap.getTarget()); + FMLLog.fine("The Block %s is being remapped to %s.", remap.name, newName); + + newId = gameData.registerBlock((Block) remap.getTarget(), newName, remap.id); + gameData.iBlockRegistry.addAlias(remap.name, newName); + } + else + { + currId = getMain().iItemRegistry.getId((Item) remap.getTarget()); + newName = getMain().iItemRegistry.getNameForObject(remap.getTarget()); + FMLLog.fine("The Item %s is being remapped to %s.", remap.name, newName); + + newId = gameData.registerItem((Item) remap.getTarget(), newName, remap.id); + gameData.iItemRegistry.addAlias(remap.name, newName); + } + + if (newId != remap.id) throw new IllegalStateException(); + + if (currId != newId) + { + FMLLog.info("Fixed %s id mismatch %s: %d (init) -> %d (map).", remap.type == Type.BLOCK ? "block" : "item", newName, currId, newId); + remaps.put(newName, new Integer[] { currId, newId }); + } + } + else if (action == FMLMissingMappingsEvent.Action.BLOCKONLY) + { + // Pulled out specifically so the block doesn't get reassigned a new ID just because it's + // Item block has gone away + FMLLog.fine("The ItemBlock %s is no longer present in the game. The residual block will remain", remap.name); + } + else + { + // block item missing, warn as requested and block the id + if (action == FMLMissingMappingsEvent.Action.DEFAULT) + { + defaulted.add(remap.name); + } + else if (action == FMLMissingMappingsEvent.Action.IGNORE) + { + ignored.add(remap.name); + } + else if (action == FMLMissingMappingsEvent.Action.FAIL) + { + failed.add(remap.name); + } + else if (action == FMLMissingMappingsEvent.Action.WARN) + { + warned.add(remap.name); + } + + gameData.block(remap.id); // prevent the id from being reused later + } + } + + if (!defaulted.isEmpty()) + { + String text = "Forge Mod Loader detected missing blocks/items.\n\n" + + "There are "+defaulted.size()+" missing blocks and items in this save.\n" + + "If you continue the missing blocks/items will get removed.\n" + + "A world backup will be automatically created in your saves directory.\n\n" + + "Missing Blocks/Items:\n"; + + for (String s : defaulted) text += s + "\n"; + + boolean confirmed = StartupQuery.confirm(text); + if (!confirmed) StartupQuery.abort(); + + try + { + String skip = System.getProperty("fml.doNotBackup"); + if (skip == null || !"true".equals(skip)) + { + ZipperUtil.backupWorld(); + } + else + { + for (int x = 0; x < 10; x++) + FMLLog.severe("!!!!!!!!!! UPDATING WORLD WITHOUT DOING BACKUP !!!!!!!!!!!!!!!!"); + } + } + catch (IOException e) + { + StartupQuery.notify("The world backup couldn't be created.\n\n"+e); + StartupQuery.abort(); + } + + warned.addAll(defaulted); + } + if (!failed.isEmpty()) + { + FMLLog.severe("This world contains blocks and items that refuse to be remapped. The world will not be loaded"); + return failed; + } + if (!warned.isEmpty()) + { + FMLLog.severe("This world contains block and item mappings that may cause world breakage"); + return failed; + } + else if (!ignored.isEmpty()) + { + FMLLog.fine("There were %d missing mappings that have been ignored", ignored.size()); + } + return failed; + } + + public static void freezeData() + { + FMLLog.fine("Freezing block and item id maps"); + + getMain().testConsistency(); + frozen = new GameData(getMain()); + frozen.testConsistency(); + } + + public static void revertToFrozen() + { + if (frozen == null) + { + FMLLog.warning("Can't revert to frozen GameData state without freezing first."); + } + else + { + FMLLog.fine("Reverting to frozen data state."); + + getMain().set(frozen); + } + // the id mapping has reverted, fire remap events for those that care about id changes + Loader.instance().fireRemapEvent(ImmutableMap.of()); + // the id mapping has reverted, ensure we sync up the object holders + ObjectHolderRegistry.INSTANCE.applyObjectHolders(); + } + + protected static boolean isFrozen(FMLControlledNamespacedRegistry registry) + { + return frozen != null && (getMain().iBlockRegistry == registry || getMain().iItemRegistry == registry); + } + + protected static GameData getMain() + { + return mainData; + } + + // internal registry objects + private final FMLControlledNamespacedRegistry iBlockRegistry; + private final FMLControlledNamespacedRegistry iItemRegistry; + // bit set marking ids as occupied + private final BitSet availabilityMap; + // IDs previously allocated in a world, but now unmapped/dangling; prevents the IDs from being reused + private final Set blockedIds; + + private GameData() + { + iBlockRegistry = new FMLControlledNamespacedRegistry("minecraft:air", MAX_BLOCK_ID, MIN_BLOCK_ID, Block.class,'\u0001'); + iItemRegistry = new FMLControlledNamespacedRegistry(null, MAX_ITEM_ID, MIN_ITEM_ID, Item.class,'\u0002'); + availabilityMap = new BitSet(MAX_ITEM_ID + 1); + blockedIds = new HashSet(); + } + + private GameData(GameData data) + { + this(); + set(data); + } + + private void set(GameData data) + { + iBlockRegistry.set(data.iBlockRegistry); + iItemRegistry.set(data.iItemRegistry); + availabilityMap.clear(); + availabilityMap.or(data.availabilityMap); + blockedIds.clear(); + blockedIds.addAll(data.blockedIds); + } + + int register(Object obj, String name, int idHint) // from FMLControlledNamespacedRegistry.addObject + { + // tolerate extra name prefixes here since mc does it as well + name = addPrefix(name); + + if (obj instanceof Block) + { + return registerBlock((Block) obj, name, idHint); + } + else if (obj instanceof Item) + { + return registerItem((Item) obj, name, idHint); + } + else + { + throw new IllegalArgumentException("An invalid registry object is to be added, only instances of Block or Item are allowed."); + } + } + + int registerItem(Item item, String name) // from GameRegistry + { + int index = name.indexOf(':'); + if (name.indexOf(':') != -1) FMLLog.bigWarning("Illegal extra prefix %s for name %s, invalid registry invocation/invalid name?", name.substring(0, index), name); + + name = addPrefix(name); + return registerItem(item, name, -1); + } + + private int registerItem(Item item, String name, int idHint) + { + if (item instanceof ItemBlock) // ItemBlock, adjust id and clear the slot already occupied by the corresponding block + { + Block block = ((ItemBlock) item).field_150939_a; + if (idHint != -1 && getMain().blockSubstitutions.containsKey(name)) + { + block = getMain().blockSubstitutions.get(name); + } + int id = iBlockRegistry.getId(block); + + if (id == -1) // ItemBlock before its Block + { + if (idHint < 0 || availabilityMap.get(idHint) || idHint > MAX_BLOCK_ID) // non-suitable id, allocate one in the block id range, add would use the item id range otherwise + { + id = availabilityMap.nextClearBit(MIN_BLOCK_ID); // find suitable id here, iItemRegistry would search from MIN_ITEM_ID + if (id > MAX_BLOCK_ID) throw new RuntimeException(String.format("Invalid id %d - maximum id range exceeded.", id)); + FMLLog.fine("Allocated id %d for ItemBlock %s in the block id range, original id requested: %d.", id, name, idHint); + } + else // idHint is suitable without changes + { + id = idHint; + } + } + else // ItemBlock after its Block + { + if (FMLControlledNamespacedRegistry.DEBUG) + FMLLog.fine("Found matching Block %s for ItemBlock %s at id %d, original id requested: %d", block, item, id, idHint); + freeSlot(id, item); // temporarily free the slot occupied by the Block for the item registration + } + + idHint = id; + } + + int itemId = iItemRegistry.add(idHint, name, item, availabilityMap); + + if (item instanceof ItemBlock) // verify + { + if (itemId != idHint) throw new IllegalStateException(String.format("ItemBlock at block id %d insertion failed, got id %d.", idHint, itemId)); + verifyItemBlockName((ItemBlock) item); + } + + // block the Block Registry slot with the same id + useSlot(itemId); + ((RegistryDelegate.Delegate) item.delegate).setName(name); + return itemId; + } + + int registerBlock(Block block, String name) // from GameRegistry + { + int index = name.indexOf(':'); + if (name.indexOf(':') != -1) FMLLog.bigWarning("Illegal extra prefix %s for name %s, invalid registry invocation/invalid name?", name.substring(0, index), name); + + name = addPrefix(name); + return registerBlock(block, name, -1); + } + + private int registerBlock(Block block, String name, int idHint) + { + // handle ItemBlock-before-Block registrations + ItemBlock itemBlock = null; + + for (Item item : iItemRegistry.typeSafeIterable()) // find matching ItemBlock + { + if (item instanceof ItemBlock && ((ItemBlock) item).field_150939_a == block) + { + itemBlock = (ItemBlock) item; + break; + } + } + + if (itemBlock != null) // has ItemBlock, adjust id and clear the slot already occupied by the corresponding item + { + idHint = iItemRegistry.getId(itemBlock); + FMLLog.fine("Found matching ItemBlock %s for Block %s at id %d", itemBlock, block, idHint); + freeSlot(idHint, block); // temporarily free the slot occupied by the Item for the block registration + } + + // add + int blockId = iBlockRegistry.add(idHint, name, block, availabilityMap); + + if (itemBlock != null) // verify + { + if (blockId != idHint) throw new IllegalStateException(String.format("Block at itemblock id %d insertion failed, got id %d.", idHint, blockId)); + verifyItemBlockName(itemBlock); + } + + useSlot(blockId); + ((RegistryDelegate.Delegate) block.delegate).setName(name); + return blockId; + } + + /** + * Block the specified id from being reused. + */ + private void block(int id) + { + blockedIds.add(id); + useSlot(id); + } + + private void useSlot(int id) + { + availabilityMap.set(id); + } + + /** + * Free the specified slot. + * + * The slot must not be occupied by something else than the specified object within the same type. + * The same object is permitted for handling duplicate registrations. + * + * @param id id to free + * @param obj object allowed besides different types (block vs item) + */ + private void freeSlot(int id, Object obj) + { + FMLControlledNamespacedRegistry registry = (obj instanceof Block) ? iBlockRegistry : iItemRegistry; + Object thing = registry.getRaw(id); + + if (thing != null && thing != obj) + { + throw new IllegalStateException(String.format("Can't free registry slot %d occupied by %s", id, thing)); + } + + availabilityMap.clear(id); + } + + /** + * Prefix the supplied name with the current mod id. + * + * If no mod id can be determined, minecraft will be assumed. + * The prefix is separated with a colon. + * + * If there's already a prefix, it'll be prefixed again if the new prefix + * doesn't match the old prefix, as used by vanilla calls to addObject. + * + * @param name name to prefix. + * @return prefixed name. + */ + private String addPrefix(String name) + { + int index = name.lastIndexOf(':'); + String oldPrefix = index == -1 ? "" : name.substring(0, index); + String prefix; + ModContainer mc = Loader.instance().activeModContainer(); + + if (mc != null) + { + prefix = mc.getModId(); + } + else // no mod container, assume minecraft + { + prefix = "minecraft"; + } + + if (!oldPrefix.equals(prefix)) + { + name = prefix + ":" + name; + } + + return name; + } + + private void verifyItemBlockName(ItemBlock item) + { + String blockName = iBlockRegistry.getNameForObject(item.field_150939_a); + String itemName = iItemRegistry.getNameForObject(item); + + if (blockName != null && !blockName.equals(itemName)) + { + FMLLog.bigWarning("Block <-> ItemBlock name mismatch, block name %s, item name %s", blockName, itemName); + } + } + + private void testConsistency() { + // test if there's an entry for every set bit in availabilityMap + for (int i = availabilityMap.nextSetBit(0); i >= 0; i = availabilityMap.nextSetBit(i+1)) + { + if (iBlockRegistry.getRaw(i) == null && iItemRegistry.getRaw(i) == null && !blockedIds.contains(i)) + { + throw new IllegalStateException(String.format("availabilityMap references empty entries for id %d.", i)); + } + } + + for (int pass = 0; pass < 2; pass++) + { + boolean isBlock = pass == 0; + String type = isBlock ? "block" : "item"; + FMLControlledNamespacedRegistry registry = isBlock ? iBlockRegistry : iItemRegistry; + registry.validateContent((isBlock ? MAX_BLOCK_ID : MAX_ITEM_ID), type, availabilityMap, blockedIds, iBlockRegistry); + } + + FMLLog.fine("Registry consistency check successful"); + } + + void registerSubstitutionAlias(String nameToSubstitute, Type type, Object toReplace) throws ExistingSubstitutionException + { + type.getRegistry().addSubstitutionAlias(Loader.instance().activeModContainer().getModId(),nameToSubstitute, toReplace); + type.getRegistry().activateSubstitution(nameToSubstitute); + } + static RegistryDelegate buildDelegate(T referant, Class type) + { + return new RegistryDelegate.Delegate(referant, type); + } + + private BiMap itemSubstitutions = HashBiMap.create(); + private BiMap blockSubstitutions = HashBiMap.create(); + @SuppressWarnings("unchecked") + BiMap getPersistentSubstitutionMap(Class type) + { + if (type.equals(Item.class)) + { + return (BiMap) itemSubstitutions; + } + else if (type.equals(Block.class)) + { + return (BiMap) blockSubstitutions; + } + else + { + throw new RuntimeException("WHAT?"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameRegistry.java new file mode 100644 index 0000000..821bc75 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/GameRegistry.java @@ -0,0 +1,551 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Objects; +import com.google.common.base.Strings; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.ObjectArrays; +import com.google.common.collect.Sets; +import com.google.common.primitives.Ints; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.IFuelHandler; +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderException; +import cpw.mods.fml.common.LoaderState; +import cpw.mods.fml.common.ObfuscationReflectionHelper; + +public class GameRegistry +{ + private static Set worldGenerators = Sets.newHashSet(); + private static Map worldGeneratorIndex = Maps.newHashMap(); + private static List fuelHandlers = Lists.newArrayList(); + private static List sortedGeneratorList; + + /** + * Register a world generator - something that inserts new block types into the world + * + * @param generator the generator + * @param modGenerationWeight a weight to assign to this generator. Heavy weights tend to sink to the bottom of + * list of world generators (i.e. they run later) + */ + public static void registerWorldGenerator(IWorldGenerator generator, int modGenerationWeight) + { + worldGenerators.add(generator); + worldGeneratorIndex.put(generator, modGenerationWeight); + if (sortedGeneratorList != null) + { + sortedGeneratorList = null; + } + } + + /** + * Callback hook for world gen - if your mod wishes to add extra mod related generation to the world + * call this + * + * @param chunkX + * @param chunkZ + * @param world + * @param chunkGenerator + * @param chunkProvider + */ + public static void generateWorld(int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) + { + if (sortedGeneratorList == null) + { + computeSortedGeneratorList(); + } + long worldSeed = world.getSeed(); + Random fmlRandom = new Random(worldSeed); + long xSeed = fmlRandom.nextLong() >> 2 + 1L; + long zSeed = fmlRandom.nextLong() >> 2 + 1L; + long chunkSeed = (xSeed * chunkX + zSeed * chunkZ) ^ worldSeed; + + for (IWorldGenerator generator : sortedGeneratorList) + { + fmlRandom.setSeed(chunkSeed); + generator.generate(fmlRandom, chunkX, chunkZ, world, chunkGenerator, chunkProvider); + } + } + + private static void computeSortedGeneratorList() + { + ArrayList list = Lists.newArrayList(worldGenerators); + Collections.sort(list, new Comparator() { + @Override + public int compare(IWorldGenerator o1, IWorldGenerator o2) + { + return Ints.compare(worldGeneratorIndex.get(o1), worldGeneratorIndex.get(o2)); + } + }); + sortedGeneratorList = ImmutableList.copyOf(list); + } + + /** + * Register an item with the item registry with a custom name : this allows for easier server->client resolution + * + * @param item The item to register + * @param name The mod-unique name of the item + */ + public static void registerItem(net.minecraft.item.Item item, String name) + { + registerItem(item, name, null); + } + + /** + * Register the specified Item with a mod specific name : overrides the standard type based name + * @param item The item to register + * @param name The mod-unique name to register it as - null will remove a custom name + * @param modId deprecated, unused + * where one mod should "own" all the blocks of all the mods, null defaults to the active mod + */ + public static Item registerItem(Item item, String name, String modId) + { + GameData.getMain().registerItem(item, name); + return item; + } + + + /** + * Add a forced persistent substitution alias for the block or item to another block or item. This will have + * the effect of using the substituted block or item instead of the original, where ever it is + * referenced. + * + * @param nameToSubstitute The name to link to (this is the NEW block or item) + * @param type The type (Block or Item) + * @param object a NEW instance that is type compatible with the existing instance + * @throws ExistingSubstitutionException if someone else has already registered an alias either from or to one of the names + * @throws IncompatibleSubstitutionException if the substitution is incompatible + */ + public static void addSubstitutionAlias(String nameToSubstitute, GameRegistry.Type type, Object object) throws ExistingSubstitutionException + { + GameData.getMain().registerSubstitutionAlias(nameToSubstitute, type, object); + } + + /** + * Register a block with the specified mod specific name + * @param block The block to register + * @param name The mod-unique name to register it as, will get prefixed by your modid. + */ + public static Block registerBlock(Block block, String name) + { + return registerBlock(block, ItemBlock.class, name); + } + + /** + * Register a block with the world, with the specified item class and block name + * @param block The block to register + * @param itemclass The item type to register with it : null registers a block without associated item. + * @param name The mod-unique name to register it as, will get prefixed by your modid. + */ + public static Block registerBlock(Block block, Class itemclass, String name) + { + return registerBlock(block, itemclass, name, new Object[]{}); + } + + /** + * @deprecated Use the registerBlock version without the modId parameter instead. + */ + @Deprecated + public static Block registerBlock(Block block, Class itemclass, String name, String modId, Object... itemCtorArgs) + { + return registerBlock(block, itemclass, name, itemCtorArgs); + } + + /** + * Register a block with the world, with the specified item class, block name and owning modId + * @param block The block to register + * @param itemclass The item type to register with it : null registers a block without associated item. + * @param name The mod-unique name to register it as, will get prefixed by your modid. + * @param itemCtorArgs Arguments to pass (after the required {@code Block} parameter) to the ItemBlock constructor (optional). + */ + public static Block registerBlock(Block block, Class itemclass, String name, Object... itemCtorArgs) + { + if (Loader.instance().isInState(LoaderState.CONSTRUCTING)) + { + FMLLog.warning("The mod %s is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event.", Loader.instance().activeModContainer()); + } + try + { + assert block != null : "registerBlock: block cannot be null"; + ItemBlock i = null; + if (itemclass != null) + { + Class[] ctorArgClasses = new Class[itemCtorArgs.length + 1]; + ctorArgClasses[0] = Block.class; + for (int idx = 1; idx < ctorArgClasses.length; idx++) + { + ctorArgClasses[idx] = itemCtorArgs[idx-1].getClass(); + } + Constructor itemCtor = itemclass.getConstructor(ctorArgClasses); + i = itemCtor.newInstance(ObjectArrays.concat(block, itemCtorArgs)); + } + // block registration has to happen first + GameData.getMain().registerBlock(block, name); + if (i != null) + { + GameData.getMain().registerItem(i, name); + } + return block; + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "Caught an exception during block registration"); + throw new LoaderException(e); + } + } + + public static void addRecipe(ItemStack output, Object... params) + { + addShapedRecipe(output, params); + } + + public static IRecipe addShapedRecipe(ItemStack output, Object... params) + { + return CraftingManager.getInstance().addRecipe(output, params); + } + + public static void addShapelessRecipe(ItemStack output, Object... params) + { + CraftingManager.getInstance().addShapelessRecipe(output, params); + } + + @SuppressWarnings("unchecked") + public static void addRecipe(IRecipe recipe) + { + CraftingManager.getInstance().getRecipeList().add(recipe); + } + + public static void addSmelting(Block input, ItemStack output, float xp) + { + FurnaceRecipes.smelting().func_151393_a(input, output, xp); + } + + public static void addSmelting(Item input, ItemStack output, float xp) + { + FurnaceRecipes.smelting().func_151396_a(input, output, xp); + } + + public static void addSmelting(ItemStack input, ItemStack output, float xp) + { + FurnaceRecipes.smelting().func_151394_a(input, output, xp); + } + + public static void registerTileEntity(Class tileEntityClass, String id) + { + TileEntity.addMapping(tileEntityClass, id); + } + + /** + * Register a tile entity, with alternative TileEntity identifiers. Use with caution! + * This method allows for you to "rename" the 'id' of the tile entity. + * + * @param tileEntityClass The tileEntity class to register + * @param id The primary ID, this will be the ID that the tileentity saves as + * @param alternatives A list of alternative IDs that will also map to this class. These will never save, but they will load + */ + public static void registerTileEntityWithAlternatives(Class tileEntityClass, String id, String... alternatives) + { + TileEntity.addMapping(tileEntityClass, id); + Map> teMappings = ObfuscationReflectionHelper.getPrivateValue(TileEntity.class, null, "field_" + "145855_i", "nameToClassMap"); + for (String s: alternatives) + { + if (!teMappings.containsKey(s)) + { + teMappings.put(s, tileEntityClass); + } + } + } + + public static void registerFuelHandler(IFuelHandler handler) + { + fuelHandlers.add(handler); + } + public static int getFuelValue(ItemStack itemStack) + { + int fuelValue = 0; + for (IFuelHandler handler : fuelHandlers) + { + fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack)); + } + return fuelValue; + } + + /** + * Look up a mod block in the global "named item list" + * @param modId The modid owning the block + * @param name The name of the block itself + * @return The block or null if not found + */ + public static Block findBlock(String modId, String name) + { + return GameData.findBlock(modId, name); + } + + /** + * Look up a mod item in the global "named item list" + * @param modId The modid owning the item + * @param name The name of the item itself + * @return The item or null if not found + */ + public static Item findItem(String modId, String name) + { + return GameData.findItem(modId, name); + } + + /** + * Manually register a custom item stack with FML for later tracking. It is automatically scoped with the active modid + * + * @param name The name to register it under + * @param itemStack The itemstack to register + */ + public static void registerCustomItemStack(String name, ItemStack itemStack) + { + GameData.registerCustomItemStack(name, itemStack); + } + /** + * Lookup an itemstack based on mod and name. It will create "default" itemstacks from blocks and items if no + * explicit itemstack is found. + * + * If it is built from a block, the metadata is by default the "wildcard" value. + * + * Custom itemstacks can be dumped from minecraft by setting the system property fml.dumpRegistry to true + * (-Dfml.dumpRegistry=true on the command line will work) + * + * @param modId The modid of the stack owner + * @param name The name of the stack + * @param stackSize The size of the stack returned + * @return The custom itemstack or null if no such itemstack was found + */ + public static ItemStack findItemStack(String modId, String name, int stackSize) + { + ItemStack foundStack = GameData.findItemStack(modId, name); + if (foundStack != null) + { + ItemStack is = foundStack.copy(); + is.stackSize = Math.min(stackSize, is.getMaxStackSize()); + return is; + } + return null; + } + + public static final class UniqueIdentifier + { + public final String modId; + public final String name; + UniqueIdentifier(String modId, String name) + { + this.modId = modId; + this.name = name; + } + + public UniqueIdentifier(String string) + { + String[] parts = string.split(":"); + this.modId = parts[0]; + this.name = parts[1]; + } + + @Override + public boolean equals(Object obj) + { + if (obj == null) return false; + if (obj.getClass() != this.getClass()) return false; + final UniqueIdentifier other = (UniqueIdentifier) obj; + return Objects.equal(modId, other.modId) && Objects.equal(name, other.name); + } + + @Override + public int hashCode() + { + return Objects.hashCode(modId, name); + } + + @Override + public String toString() + { + return String.format("%s:%s", modId, name); + } + } + + public static enum Type { + BLOCK + { + @Override + public FMLControlledNamespacedRegistry getRegistry() { + return GameData.getBlockRegistry(); + } + }, + ITEM + { + @Override + public FMLControlledNamespacedRegistry getRegistry() { + return GameData.getItemRegistry(); + } + }; + + public abstract FMLControlledNamespacedRegistry getRegistry(); + } + /** + * Look up the mod identifier data for a block. + * Returns null if there is no mod specified mod identifier data, or it is part of a + * custom itemstack definition {@link #registerCustomItemStack} + * + * Note: uniqueness and persistence is only guaranteed by mods using the game registry + * correctly. + * + * @param block to lookup + * @return a {@link UniqueIdentifier} for the block or null + */ + public static UniqueIdentifier findUniqueIdentifierFor(Block block) + { + return GameData.getUniqueName(block); + } + /** + * Look up the mod identifier data for an item. + * Returns null if there is no mod specified mod identifier data, or it is part of a + * custom itemstack definition {@link #registerCustomItemStack} + * + * Note: uniqueness and persistence is only guaranteed by mods using the game registry + * correctly. + * + * @param item to lookup + * @return a {@link UniqueIdentifier} for the item or null + */ + public static UniqueIdentifier findUniqueIdentifierFor(Item item) + { + return GameData.getUniqueName(item); + } + + + + /** + * This will cause runtime injection of public static final fields to occur at various points + * where mod blocks and items could be subject to change. This allows for dynamic + * substitution to occur. + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.TYPE, ElementType.FIELD}) + public @interface ObjectHolder { + /** + * If used on a class, this represents a modid only. + * If used on a field, it represents a name, which can be abbreviated or complete. + * Abbreviated names derive their modid from an enclosing ObjectHolder at the class level. + * + * @return either a modid or a name based on the rules above + */ + String value(); + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + public @interface ItemStackHolder + { + /** + * The registry name of the item being looked up. + * @return The registry name + */ + public String value(); + + /** + * The metadata or damage value for the itemstack, defaults to 0. + * @return the metadata value + */ + public int meta() default 0; + + /** + * The string serialized nbt value for the itemstack. Defaults to empty for no nbt. + * + * @return a nbt string + */ + public String nbt() default ""; + } + + /** + * Makes an {@link ItemStack} based on the itemName reference, with supplied meta, stackSize and nbt, if possible + * + * Will return null if the item doesn't exist (because it's not from a loaded mod for example) + * Will throw a {@link RuntimeException} if the nbtString is invalid for use in an {@link ItemStack} + * + * @param itemName a registry name reference + * @param meta the meta + * @param stackSize the stack size + * @param nbtString an nbt stack as a string, will be processed by {@link JsonToNBT} + * @return a new itemstack + */ + public static ItemStack makeItemStack(String itemName, int meta, int stackSize, String nbtString) + { + if (itemName == null) throw new IllegalArgumentException("The itemName cannot be null"); + Item item = GameData.getItemRegistry().getObject(itemName); + if (item == null) { + FMLLog.getLogger().log(Level.TRACE, "Unable to find item with name {}", itemName); + return null; + } + ItemStack is = new ItemStack(item,1,meta); + if (!Strings.isNullOrEmpty(nbtString)) { + NBTBase nbttag = null; + try + { + nbttag = JsonToNBT.func_150315_a(nbtString); + } catch (NBTException e) + { + FMLLog.getLogger().log(Level.WARN, "Encountered an exception parsing ItemStack NBT string {}", nbtString, e); + throw Throwables.propagate(e); + } + if (!(nbttag instanceof NBTTagCompound)) { + FMLLog.getLogger().log(Level.WARN, "Unexpected NBT string - multiple values {}", nbtString); + throw new RuntimeException("Invalid NBT JSON"); + } else { + is.setTagCompound((NBTTagCompound) nbttag); + } + } + return is; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.java new file mode 100644 index 0000000..6b0eb91 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IEntityAdditionalSpawnData.java @@ -0,0 +1,38 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import io.netty.buffer.ByteBuf; + +/** + * A interface for Entities that need extra information to be communicated + * between the server and client when they are spawned. + */ +public interface IEntityAdditionalSpawnData +{ + /** + * Called by the server when constructing the spawn packet. + * Data should be added to the provided stream. + * + * @param buffer The packet data stream + */ + public void writeSpawnData(ByteBuf buffer); + + /** + * Called by the client when it receives a Entity spawn packet. + * Data should be read out of the stream in the same way as it was written. + * + * @param data The packet data stream + */ + public void readSpawnData(ByteBuf additionalData); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IThrowableEntity.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IThrowableEntity.java new file mode 100644 index 0000000..7878f35 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IThrowableEntity.java @@ -0,0 +1,34 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import net.minecraft.entity.Entity; + +/** + * This interface should be implemented by an Entity that can be 'thrown', like snowballs. + * This was created to mimic ModLoaderMP's 'owner' functionality. + */ +public interface IThrowableEntity +{ + /** + * Gets the entity that threw/created this entity. + * @return The owner instance, Null if none. + */ + public Entity getThrower(); + + /** + * Sets the entity that threw/created this entity. + * @param entity The new thrower/creator. + */ + public void setThrower(Entity entity); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.java new file mode 100644 index 0000000..640ff0e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/IncompatibleSubstitutionException.java @@ -0,0 +1,11 @@ +package cpw.mods.fml.common.registry; + +public class IncompatibleSubstitutionException extends RuntimeException { + public IncompatibleSubstitutionException(String fromName, Object replacement, Object original) + { + super(String.format("The substitute %s for %s (type %s) is type incompatible.", replacement.getClass().getName(), fromName, original.getClass().getName())); + } + + private static final long serialVersionUID = 1L; + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderInjector.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderInjector.java new file mode 100644 index 0000000..8d1867e --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderInjector.java @@ -0,0 +1,80 @@ +package cpw.mods.fml.common.registry; + +import java.lang.reflect.Field; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; + +public enum ItemStackHolderInjector +{ + INSTANCE; + + private List itemStackHolders = Lists.newArrayList(); + + public void inject() { + FMLLog.getLogger().log(Level.INFO, "Injecting itemstacks"); + for (ItemStackHolderRef ishr: itemStackHolders) { + ishr.apply(); + } + FMLLog.getLogger().log(Level.INFO, "Itemstack injection complete"); + } + + public void findHolders(ASMDataTable table) { + FMLLog.info("Identifying ItemStackHolder annotations"); + Set allItemStackHolders = table.getAll(GameRegistry.ItemStackHolder.class.getName()); + Map> classCache = Maps.newHashMap(); + for (ASMData data : allItemStackHolders) + { + String className = data.getClassName(); + String annotationTarget = data.getObjectName(); + String value = (String) data.getAnnotationInfo().get("value"); + int meta = data.getAnnotationInfo().containsKey("meta") ? (Integer) data.getAnnotationInfo().get("meta") : 0; + String nbt = data.getAnnotationInfo().containsKey("nbt") ? (String) data.getAnnotationInfo().get("nbt") : ""; + addHolder(classCache, className, annotationTarget, value, meta, nbt); + } + FMLLog.info("Found %d ItemStackHolder annotations", allItemStackHolders.size()); + + } + + private void addHolder(Map> classCache, String className, String annotationTarget, String value, Integer meta, String nbt) + { + Class clazz; + if (classCache.containsKey(className)) + { + clazz = classCache.get(className); + } + else + { + try + { + clazz = Class.forName(className, true, getClass().getClassLoader()); + classCache.put(className, clazz); + } + catch (Exception ex) + { + // unpossible? + throw Throwables.propagate(ex); + } + } + try + { + Field f = clazz.getField(annotationTarget); + itemStackHolders.add(new ItemStackHolderRef(f, value, meta, nbt)); + } + catch (Exception ex) + { + // unpossible? + throw Throwables.propagate(ex); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderRef.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderRef.java new file mode 100644 index 0000000..159f792 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ItemStackHolderRef.java @@ -0,0 +1,84 @@ +package cpw.mods.fml.common.registry; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import net.minecraft.item.ItemStack; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.registry.GameRegistry.ItemStackHolder; + + +/** + * Internal class used in tracking {@link ItemStackHolder} references + * + * @author cpw + * + */ +class ItemStackHolderRef { + private Field field; + private String itemName; + private int meta; + private String serializednbt; + + + ItemStackHolderRef(Field field, String itemName, int meta, String serializednbt) + { + this.field = field; + this.itemName = itemName; + this.meta = meta; + this.serializednbt = serializednbt; + makeWritable(field); + } + + private static Field modifiersField; + private static Object reflectionFactory; + private static Method newFieldAccessor; + private static Method fieldAccessorSet; + private static void makeWritable(Field f) + { + try + { + if (modifiersField == null) + { + Method getReflectionFactory = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("getReflectionFactory"); + reflectionFactory = getReflectionFactory.invoke(null); + newFieldAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newFieldAccessor", Field.class, boolean.class); + fieldAccessorSet = Class.forName("sun.reflect.FieldAccessor").getDeclaredMethod("set", Object.class, Object.class); + modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + } + modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL); + } catch (Exception e) + { + throw Throwables.propagate(e); + } + } + + public void apply() + { + ItemStack is; + try + { + is = GameRegistry.makeItemStack(itemName, meta, 1, serializednbt); + } catch (RuntimeException e) + { + FMLLog.getLogger().log(Level.ERROR, "Caught exception processing itemstack {},{},{} in annotation at {}.{}", itemName, meta, serializednbt,field.getClass().getName(),field.getName()); + throw e; + } + try + { + Object fieldAccessor = newFieldAccessor.invoke(reflectionFactory, field, false); + fieldAccessorSet.invoke(fieldAccessor, null, is); + } + catch (Exception e) + { + FMLLog.getLogger().log(Level.WARN, "Unable to set {} with value {},{},{}", this.field, this.itemName, this.meta, this.serializednbt); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/LanguageRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/LanguageRegistry.java new file mode 100644 index 0000000..21314b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/LanguageRegistry.java @@ -0,0 +1,324 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import org.apache.logging.log4j.Level; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StringTranslate; + +import com.google.common.base.Charsets; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.relauncher.Side; + +public class LanguageRegistry +{ + private static final LanguageRegistry INSTANCE = new LanguageRegistry(); + + private Map modLanguageData=new HashMap(); + + private static final Pattern assetENUSLang = Pattern.compile("assets/(.*)/lang/(?:.+/|)([\\w_-]+).lang"); + + public static LanguageRegistry instance() + { + return INSTANCE; + } + + public String getStringLocalization(String key) + { + return getStringLocalization(key, FMLCommonHandler.instance().getCurrentLanguage()); + } + + public String getStringLocalization(String key, String lang) + { + String localizedString = ""; + Properties langPack = modLanguageData.get(lang); + + if (langPack != null) { + if (langPack.getProperty(key) != null) { + localizedString = langPack.getProperty(key); + } + } + + return localizedString; + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void addStringLocalization(String key, String value) + { + addStringLocalization(key, "en_US", value); + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void addStringLocalization(String key, String lang, String value) + { + Properties langPack=modLanguageData.get(lang); + if (langPack==null) { + langPack=new Properties(); + modLanguageData.put(lang, langPack); + } + langPack.put(key,value); + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void addStringLocalization(Properties langPackAdditions) { + addStringLocalization(langPackAdditions, "en_US"); + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void addStringLocalization(Properties langPackAdditions, String lang) { + Properties langPack = modLanguageData.get(lang); + if (langPack == null) { + langPack = new Properties(); + modLanguageData.put(lang, langPack); + } + if (langPackAdditions != null) { + langPack.putAll(langPackAdditions); + } + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void addNameForObject(Object objectToName, String lang, String name) + { + String objectName; + if (objectToName instanceof Item) { + objectName=((Item)objectToName).getUnlocalizedName(); + } else if (objectToName instanceof Block) { + objectName=((Block)objectToName).getUnlocalizedName(); + } else if (objectToName instanceof ItemStack) { + objectName=((ItemStack)objectToName).getItem().getUnlocalizedName((ItemStack)objectToName); + } else { + throw new IllegalArgumentException(String.format("Illegal object for naming %s",objectToName)); + } + objectName+=".name"; + addStringLocalization(objectName, lang, name); + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public static void addName(Object objectToName, String name) + { + instance().addNameForObject(objectToName, "en_US", name); + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @SuppressWarnings("unchecked") + @Deprecated + public void mergeLanguageTable(@SuppressWarnings("rawtypes") Map field_135032_a, String lang) + { + Properties langPack=modLanguageData.get(lang); + if (langPack!=null) { + mergeWithoutOverwrite(langPack, field_135032_a); + } + Properties usPack=modLanguageData.get("en_US"); + if (usPack!=null) { + mergeWithoutOverwrite(usPack, field_135032_a); + } + } + + @Deprecated + private void mergeWithoutOverwrite(Map from, Map to) + { + for (Entry e : from.entrySet()) + { + if (!to.containsKey(e.getKey())) + { + to.put(e.getKey(),e.getValue()); + } + } + } + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void loadLocalization(String localizationFile, String lang, boolean isXML) + { + URL urlResource = this.getClass().getResource(localizationFile); + if (urlResource != null) + { + loadLocalization(urlResource, lang, isXML); + } + else + { + ModContainer activeModContainer = Loader.instance().activeModContainer(); + if (activeModContainer!=null) + { + FMLLog.log(activeModContainer.getModId(), Level.ERROR, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile); + } + else + { + FMLLog.log(Level.ERROR, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile); + } + } + } + + /** + * Deprecated for removal in 1.8. Use the assets lang system + */ + @Deprecated + public void loadLocalization(URL localizationFile, String lang, boolean isXML) + { + InputStream langStream = null; + Properties langPack = new Properties(); + + try { + langStream = localizationFile.openStream(); + + if (isXML) { + langPack.loadFromXML(langStream); + } + else { + langPack.load(new InputStreamReader(langStream,Charsets.UTF_8)); + } + + addStringLocalization(langPack, lang); + } + catch (IOException e) { + FMLLog.log(Level.ERROR, e, "Unable to load localization from file %s", localizationFile); + } + finally { + try { + if (langStream != null) { + langStream.close(); + } + } + catch (IOException ex) { + // HUSH + } + } + } + + public void injectLanguage(String language, HashMap parsedLangFile) + { + + Properties p = modLanguageData.get(language); + if (p == null) + { + p = new Properties(); + modLanguageData.put(language, p); + } + p.putAll(parsedLangFile); + } + + public void loadLanguagesFor(ModContainer container, Side side) + { + File source = container.getSource(); + try + { + if (source.isDirectory()) + { + searchDirForLanguages(source, "", side); + } + else + { + searchZipForLanguages(source, side); + } + } + catch (IOException ioe) + { + + } + } + + private void searchZipForLanguages(File source, Side side) throws IOException + { + ZipFile zf = new ZipFile(source); + List added = Lists.newArrayList(); + for (ZipEntry ze : Collections.list(zf.entries())) + { + Matcher matcher = assetENUSLang.matcher(ze.getName()); + if (matcher.matches()) + { + String lang = matcher.group(2); + //FMLLog.fine("Injecting found translation data for lang %s in zip file %s at %s into language system", lang, source.getName(), ze.getName()); + added.add(lang); + LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(zf.getInputStream(ze))); + // Ensure en_US is available to StringTranslate on the server + if ("en_US".equals(lang) && side == Side.SERVER) + { + StringTranslate.inject(zf.getInputStream(ze)); + } + } + } + if (added.size() > 0) + FMLLog.fine("Found translations in %s [%s]", source.getName(), Joiner.on(", ").join(added)); + zf.close(); + } + + private void searchDirForLanguages(File source, String path, Side side) throws IOException + { + for (File file : source.listFiles()) + { + String currPath = path+file.getName(); + if (file.isDirectory()) + { + searchDirForLanguages(file, currPath+'/', side); + } + Matcher matcher = assetENUSLang.matcher(currPath); + if (matcher.matches()) + { + String lang = matcher.group(2); + FMLLog.fine("Injecting found translation assets for lang %s at %s into language system", lang, currPath); + LanguageRegistry.instance().injectLanguage(lang, StringTranslate.parseLangFile(new FileInputStream(file))); + // Ensure en_US is available to StringTranslate on the server + if ("en_US".equals(lang) && side == Side.SERVER) + { + StringTranslate.inject(new FileInputStream(file)); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRef.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRef.java new file mode 100644 index 0000000..5a13341 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRef.java @@ -0,0 +1,132 @@ +package cpw.mods.fml.common.registry; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import org.apache.logging.log4j.Level; +import com.google.common.base.Throwables; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + + +/** + * Internal class used in tracking {@link ObjectHolder} references + * + * @author cpw + * + */ +class ObjectHolderRef { + private Field field; + private String injectedObject; + private boolean isBlock; + private boolean isItem; + + + ObjectHolderRef(Field field, String injectedObject, boolean extractFromExistingValues) + { + this.field = field; + this.isBlock = Block.class.isAssignableFrom(field.getType()); + this.isItem = Item.class.isAssignableFrom(field.getType()); + if (extractFromExistingValues) + { + try + { + Object existing = field.get(null); + // nothing is ever allowed to replace AIR + if (existing == null || existing == GameData.getBlockRegistry().getDefaultValue()) + { + this.injectedObject = null; + this.field = null; + this.isBlock = false; + this.isItem = false; + return; + } + else + { + this.injectedObject = isBlock ? GameData.getBlockRegistry().getNameForObject(existing) : + isItem ? GameData.getItemRegistry().getNameForObject(existing) : null; + } + } catch (Exception e) + { + throw Throwables.propagate(e); + } + } + else + { + this.injectedObject = injectedObject; + } + + if (this.injectedObject == null || !isValid()) + { + throw new IllegalStateException(String.format("The ObjectHolder annotation cannot apply to a field that is not an Item or Block (found : %s at %s.%s)", field.getType().getName(), field.getClass().getName(), field.getName())); + } + makeWritable(field); + } + + private static Field modifiersField; + private static Object reflectionFactory; + private static Method newFieldAccessor; + private static Method fieldAccessorSet; + private static void makeWritable(Field f) + { + try + { + if (modifiersField == null) + { + Method getReflectionFactory = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("getReflectionFactory"); + reflectionFactory = getReflectionFactory.invoke(null); + newFieldAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newFieldAccessor", Field.class, boolean.class); + fieldAccessorSet = Class.forName("sun.reflect.FieldAccessor").getDeclaredMethod("set", Object.class, Object.class); + modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + } + modifiersField.setInt(f, f.getModifiers() & ~Modifier.FINAL); + } catch (Exception e) + { + throw Throwables.propagate(e); + } + } + + public boolean isValid() + { + return isBlock || isItem; + } + public void apply() + { + Object thing; + if (isBlock) + { + thing = GameData.getBlockRegistry().getObject(injectedObject); + if (thing == Blocks.air) + { + thing = null; + } + } + else if (isItem) + { + thing = GameData.getItemRegistry().getObject(injectedObject); + } + else + { + thing = null; + } + + if (thing == null) + { + FMLLog.getLogger().log(Level.DEBUG, "Unable to lookup {} for {}. This means the object wasn't registered. It's likely just mod options.", injectedObject, field); + return; + } + try + { + Object fieldAccessor = newFieldAccessor.invoke(reflectionFactory, field, false); + fieldAccessorSet.invoke(fieldAccessor, null, thing); + } + catch (Exception e) + { + FMLLog.log(Level.WARN, e, "Unable to set %s with value %s (%s)", this.field, thing, this.injectedObject); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRegistry.java new file mode 100644 index 0000000..6fba500 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/ObjectHolderRegistry.java @@ -0,0 +1,141 @@ +package cpw.mods.fml.common.registry; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.List; +import java.util.Map; +import java.util.Set; +import com.google.common.base.Throwables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.discovery.ASMDataTable; +import cpw.mods.fml.common.discovery.ASMDataTable.ASMData; +import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; + +/** + * Internal registry for tracking {@link ObjectHolder} references + * @author cpw + * + */ +public enum ObjectHolderRegistry { + INSTANCE; + private List objectHolders = Lists.newArrayList(); + + public void findObjectHolders(ASMDataTable table) + { + FMLLog.info("Processing ObjectHolder annotations"); + Set allObjectHolders = table.getAll(GameRegistry.ObjectHolder.class.getName()); + Map classModIds = Maps.newHashMap(); + Map> classCache = Maps.newHashMap(); + for (ASMData data : allObjectHolders) + { + String className = data.getClassName(); + String annotationTarget = data.getObjectName(); + String value = (String) data.getAnnotationInfo().get("value"); + boolean isClass = className.equals(annotationTarget); + if (isClass) + { + scanTarget(classModIds, classCache, className, annotationTarget, value, isClass, false); + } + } + // double pass - get all the class level annotations first, then the field level annotations + for (ASMData data : allObjectHolders) + { + String className = data.getClassName(); + String annotationTarget = data.getObjectName(); + String value = (String) data.getAnnotationInfo().get("value"); + boolean isClass = className.equals(annotationTarget); + if (!isClass) + { + scanTarget(classModIds, classCache, className, annotationTarget, value, isClass, false); + } + } + scanTarget(classModIds, classCache, "net.minecraft.init.Blocks", null, "minecraft", true, true); + scanTarget(classModIds, classCache, "net.minecraft.init.Items", null, "minecraft", true, true); + FMLLog.info("Found %d ObjectHolder annotations", objectHolders.size()); + } + + private void scanTarget(Map classModIds, Map> classCache, String className, String annotationTarget, String value, boolean isClass, boolean extractFromValue) + { + Class clazz; + if (classCache.containsKey(className)) + { + clazz = classCache.get(className); + } + else + { + try + { + clazz = Class.forName(className, true, getClass().getClassLoader()); + classCache.put(className, clazz); + } + catch (Exception ex) + { + // unpossible? + throw Throwables.propagate(ex); + } + } + if (isClass) + { + scanClassForFields(classModIds, className, value, clazz, extractFromValue); + } + else + { + if (value.indexOf(':') == -1) + { + String prefix = classModIds.get(className); + if (prefix == null) + { + FMLLog.warning("Found an unqualified ObjectHolder annotation (%s) without a modid context at %s.%s, ignoring", value, className, annotationTarget); + throw new IllegalStateException("Unqualified reference to ObjectHolder"); + } + value = prefix + ":" + value; + } + try + { + Field f = clazz.getField(annotationTarget); + addHolderReference(new ObjectHolderRef(f, value, extractFromValue)); + } + catch (Exception ex) + { + // unpossible? + throw Throwables.propagate(ex); + } + } + } + + private void scanClassForFields(Map classModIds, String className, String value, Class clazz, boolean extractFromExistingValues) + { + classModIds.put(className, value); + for (Field f : clazz.getFields()) + { + int mods = f.getModifiers(); + boolean isMatch = Modifier.isPublic(mods) && Modifier.isStatic(mods) && Modifier.isFinal(mods); + if (!isMatch || f.isAnnotationPresent(ObjectHolder.class)) + { + continue; + } + addHolderReference(new ObjectHolderRef(f, value + ":"+ f.getName(), extractFromExistingValues)); + } + } + + private void addHolderReference(ObjectHolderRef ref) + { + if (ref.isValid()) + { + objectHolders.add(ref); + } + } + + public void applyObjectHolders() + { + FMLLog.info("Applying holder lookups"); + for (ObjectHolderRef ohr : objectHolders) + { + ohr.apply(); + } + FMLLog.info("Holder lookups applied"); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/RegistryDelegate.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/RegistryDelegate.java new file mode 100644 index 0000000..2f28b0d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/RegistryDelegate.java @@ -0,0 +1,94 @@ +package cpw.mods.fml.common.registry; + +import com.google.common.base.Objects; + + +/** + * A registry delegate for holding references to items or blocks + * These should be safe to use in things like lists though aliased items and blocks will not + * have object identity with respect to their delegate. + * + * @author cpw + * + * @param the type of thing we're holding onto + */ +public interface RegistryDelegate { + /** + * Get the referent pointed at by this delegate. This will be the currently active item or block, and will change + * as world saves come and go. Note that item.delegate.get() may NOT be the same object as item, due to item and + * block substitution. + * + * @return The referred object + */ + T get(); + + /** + * Get the name of this delegate. This is completely static after registration has completed and will never change. + * @return The name + */ + String name(); + + /** + * Get the delegate type. It will be Item or Block. + * @return The type of delegate + */ + Class type(); + + /* + * This is the internal implementation class of the delegate. + */ + final class Delegate implements RegistryDelegate + { + private T referant; + private String name; + private final Class type; + + public Delegate(T referant, Class type) { + this.referant = referant; + this.type = type; + } + + @Override + public T get() { + return referant; + } + + @Override + public String name() { + return name; + } + + @Override + public Class type() + { + return this.type; + } + + void changeReference(T newTarget) + { + this.referant = newTarget; + } + + void setName(String name) + { + this.name = name; + } + + @Override + public boolean equals(Object obj) + { + if (obj instanceof Delegate) + { + Delegate other = (Delegate) obj; + return Objects.equal(other.name, name); + } + return false; + } + + @Override + public int hashCode() + { + return Objects.hashCode(name); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/VillagerRegistry.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/VillagerRegistry.java new file mode 100644 index 0000000..f3c320a --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/registry/VillagerRegistry.java @@ -0,0 +1,250 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.registry; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Tuple; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Registry for villager trading control + * + * @author cpw + * + */ +public class VillagerRegistry +{ + private static final VillagerRegistry INSTANCE = new VillagerRegistry(); + + private Multimap tradeHandlers = ArrayListMultimap.create(); + private Map, IVillageCreationHandler> villageCreationHandlers = Maps.newHashMap(); + private List newVillagerIds = Lists.newArrayList(); + @SideOnly(Side.CLIENT) + private Map newVillagers; + + /** + * Allow access to the {@link net.minecraft.world.gen.structure.StructureVillagePieces} array controlling new village + * creation so you can insert your own new village pieces + * + * @author cpw + * + */ + public interface IVillageCreationHandler + { + /** + * Called when {@link net.minecraft.world.gen.structure.MapGenVillage} is creating a new village + * + * @param random + * @param i + */ + StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i); + + /** + * The class of the root structure component to add to the village + */ + Class getComponentClass(); + + + /** + * Build an instance of the village component {@link net.minecraft.world.gen.structure.StructureVillagePieces} + * @param villagePiece + * @param startPiece + * @param pieces + * @param random + * @param p1 + * @param p2 + * @param p3 + * @param p4 + * @param p5 + */ + Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random, int p1, + int p2, int p3, int p4, int p5); + } + + /** + * Allow access to the {@link MerchantRecipeList} for a villager type for manipulation + * + * @author cpw + * + */ + public interface IVillageTradeHandler + { + /** + * Called to allow changing the content of the {@link MerchantRecipeList} for the villager + * supplied during creation + * + * @param villager + * @param recipeList + */ + void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random); + } + + public static VillagerRegistry instance() + { + return INSTANCE; + } + + /** + * Register your villager id + * @param id + */ + public void registerVillagerId(int id) + { + if (newVillagerIds.contains(id)) + { + FMLLog.severe("Attempt to register duplicate villager id %d", id); + throw new RuntimeException(); + } + newVillagerIds.add(id); + } + /** + * Register a new skin for a villager type + * + * @param villagerId + * @param villagerSkin + */ + @SideOnly(Side.CLIENT) + public void registerVillagerSkin(int villagerId, ResourceLocation villagerSkin) + { + if (newVillagers == null) + { + newVillagers = Maps.newHashMap(); + } + newVillagers.put(villagerId, villagerSkin); + } + + /** + * Register a new village creation handler + * + * @param handler + */ + public void registerVillageCreationHandler(IVillageCreationHandler handler) + { + villageCreationHandlers.put(handler.getComponentClass(), handler); + } + + /** + * Register a new villager trading handler for the specified villager type + * + * @param villagerId + * @param handler + */ + public void registerVillageTradeHandler(int villagerId, IVillageTradeHandler handler) + { + tradeHandlers.put(villagerId, handler); + } + + /** + * Callback to setup new villager types + * + * @param villagerType + * @param defaultSkin + */ + @SideOnly(Side.CLIENT) + public static ResourceLocation getVillagerSkin(int villagerType, ResourceLocation defaultSkin) + { + if (instance().newVillagers != null && instance().newVillagers.containsKey(villagerType)) + { + return instance().newVillagers.get(villagerType); + } + return defaultSkin; + } + + /** + * Returns a list of all added villager types + * + * @return newVillagerIds + */ + public static Collection getRegisteredVillagers() + { + return Collections.unmodifiableCollection(instance().newVillagerIds); + } + /** + * Callback to handle trade setup for villagers + * + * @param recipeList + * @param villager + * @param villagerType + * @param random + */ + public static void manageVillagerTrades(MerchantRecipeList recipeList, EntityVillager villager, int villagerType, Random random) + { + for (IVillageTradeHandler handler : instance().tradeHandlers.get(villagerType)) + { + handler.manipulateTradesForVillager(villager, recipeList, random); + } + } + + public static void addExtraVillageComponents(@SuppressWarnings("rawtypes") ArrayList components, Random random, int i) + { + @SuppressWarnings("unchecked") + List parts = components; + for (IVillageCreationHandler handler : instance().villageCreationHandlers.values()) + { + parts.add(handler.getVillagePieceWeight(random, i)); + } + } + + public static Object getVillageComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, @SuppressWarnings("rawtypes") List pieces, Random random, + int p1, int p2, int p3, int p4, int p5) + { + return instance().villageCreationHandlers.get(villagePiece.villagePieceClass).buildComponent(villagePiece, startPiece, pieces, random, p1, p2, p3, p4, p5); + } + + + @SuppressWarnings("unchecked") + public static void addEmeraldBuyRecipe(EntityVillager villager, MerchantRecipeList list, Random random, Item item, float chance, int min, int max) + { + if (min > 0 && max > 0) + { + EntityVillager.villagersSellingList.put(item, new Tuple(min, max)); + } + EntityVillager.func_146091_a(list, item, random, chance); + } + + @SuppressWarnings("unchecked") + public static void addEmeraldSellRecipe(EntityVillager villager, MerchantRecipeList list, Random random, Item item, float chance, int min, int max) + { + if (min > 0 && max > 0) + { + EntityVillager.blacksmithSellingList.put(item, new Tuple(min, max)); + } + EntityVillager.func_146089_b(list, item, random, chance); + } + + public static void applyRandomTrade(EntityVillager villager, Random rand) + { + int extra = instance().newVillagerIds.size(); + int trade = rand.nextInt(5 + extra); + villager.setProfession(trade < 5 ? trade : instance().newVillagerIds.get(trade - 5)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSorter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSorter.java new file mode 100644 index 0000000..2b12da2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSorter.java @@ -0,0 +1,137 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.common.toposort; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModAPIManager; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.toposort.TopologicalSort.DirectedGraph; +import cpw.mods.fml.common.versioning.ArtifactVersion; + +/** + * @author cpw + * + */ +public class ModSorter +{ + private DirectedGraph modGraph; + + private ModContainer beforeAll = new DummyModContainer("BeforeAll"); + private ModContainer afterAll = new DummyModContainer("AfterAll"); + private ModContainer before = new DummyModContainer("Before"); + private ModContainer after = new DummyModContainer("After"); + + public ModSorter(List modList, Map nameLookup) + { + HashMap sortingNameLookup = Maps.newHashMap(nameLookup); + ModAPIManager.INSTANCE.injectAPIModContainers(modList, sortingNameLookup); + buildGraph(modList, sortingNameLookup); + } + + private void buildGraph(List modList, Map nameLookup) + { + modGraph = new DirectedGraph(); + modGraph.addNode(beforeAll); + modGraph.addNode(before); + modGraph.addNode(afterAll); + modGraph.addNode(after); + modGraph.addEdge(before, after); + modGraph.addEdge(beforeAll, before); + modGraph.addEdge(after, afterAll); + + for (ModContainer mod : modList) + { + modGraph.addNode(mod); + } + + for (ModContainer mod : modList) + { + if (mod.isImmutable()) + { + // Immutable mods are always before everything + modGraph.addEdge(beforeAll, mod); + modGraph.addEdge(mod, before); + continue; + } + boolean preDepAdded = false; + boolean postDepAdded = false; + + for (ArtifactVersion dep : mod.getDependencies()) + { + preDepAdded = true; + + String modid = dep.getLabel(); + if (modid.equals("*")) + { + // We are "after" everything + modGraph.addEdge(mod, afterAll); + modGraph.addEdge(after, mod); + postDepAdded = true; + } + else + { + modGraph.addEdge(before, mod); + if (nameLookup.containsKey(modid) || Loader.isModLoaded(modid)) { + modGraph.addEdge(nameLookup.get(modid), mod); + } + } + } + + for (ArtifactVersion dep : mod.getDependants()) + { + postDepAdded = true; + + String modid = dep.getLabel(); + if (modid.equals("*")) + { + // We are "before" everything + modGraph.addEdge(beforeAll, mod); + modGraph.addEdge(mod, before); + preDepAdded = true; + } + else + { + modGraph.addEdge(mod, after); + if (Loader.isModLoaded(modid)) { + modGraph.addEdge(mod, nameLookup.get(modid)); + } + } + } + + if (!preDepAdded) + { + modGraph.addEdge(before, mod); + } + + if (!postDepAdded) + { + modGraph.addEdge(mod, after); + } + } + } + + public List sort() + { + List sortedList = TopologicalSort.topologicalSort(modGraph); + sortedList.removeAll(Arrays.asList(new ModContainer[] {beforeAll, before, after, afterAll})); + return sortedList; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSortingException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSortingException.java new file mode 100644 index 0000000..00f621d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/ModSortingException.java @@ -0,0 +1,56 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.toposort; + +import java.util.Set; + +public class ModSortingException extends RuntimeException +{ + private static final long serialVersionUID = 1L; + + public class SortingExceptionData + { + public SortingExceptionData(T node, Set visitedNodes) + { + this.firstBadNode = node; + this.visitedNodes = visitedNodes; + } + + private T firstBadNode; + private Set visitedNodes; + + public T getFirstBadNode() + { + return firstBadNode; + } + public Set getVisitedNodes() + { + return visitedNodes; + } + } + + private SortingExceptionData sortingExceptionData; + + public ModSortingException(String string, T node, Set visitedNodes) + { + super(string); + this.sortingExceptionData = new SortingExceptionData(node, visitedNodes); + } + + @SuppressWarnings("unchecked") + public SortingExceptionData getExceptionData() + { + return (SortingExceptionData) sortingExceptionData; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/TopologicalSort.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/TopologicalSort.java new file mode 100644 index 0000000..16e9f13 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/toposort/TopologicalSort.java @@ -0,0 +1,207 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.toposort; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import com.google.common.collect.Sets; +import com.google.common.collect.Sets.SetView; + +import cpw.mods.fml.common.FMLLog; + +/** + * Topological sort for mod loading + * + * Based on a variety of sources, including http://keithschwarz.com/interesting/code/?dir=topological-sort + * @author cpw + * + */ +public class TopologicalSort +{ + public static class DirectedGraph implements Iterable + { + private final Map> graph = new HashMap>(); + private List orderedNodes = new ArrayList(); + + public boolean addNode(T node) + { + // Ignore nodes already added + if (graph.containsKey(node)) + { + return false; + } + + orderedNodes.add(node); + graph.put(node, new TreeSet(new Comparator() + { + @Override + public int compare(T o1, T o2) { + return orderedNodes.indexOf(o1)-orderedNodes.indexOf(o2); + } + })); + return true; + } + + public void addEdge(T from, T to) + { + if (!(graph.containsKey(from) && graph.containsKey(to))) + { + throw new NoSuchElementException("Missing nodes from graph"); + } + + graph.get(from).add(to); + } + + public void removeEdge(T from, T to) + { + if (!(graph.containsKey(from) && graph.containsKey(to))) + { + throw new NoSuchElementException("Missing nodes from graph"); + } + + graph.get(from).remove(to); + } + + public boolean edgeExists(T from, T to) + { + if (!(graph.containsKey(from) && graph.containsKey(to))) + { + throw new NoSuchElementException("Missing nodes from graph"); + } + + return graph.get(from).contains(to); + } + + public Set edgesFrom(T from) + { + if (!graph.containsKey(from)) + { + throw new NoSuchElementException("Missing node from graph"); + } + + return Collections.unmodifiableSortedSet(graph.get(from)); + } + @Override + public Iterator iterator() + { + return orderedNodes.iterator(); + } + + public int size() + { + return graph.size(); + } + + public boolean isEmpty() + { + return graph.isEmpty(); + } + + @Override + public String toString() + { + return graph.toString(); + } + } + + /** + * Sort the input graph into a topologically sorted list + * + * Uses the reverse depth first search as outlined in ... + * @param graph + * @return The sorted mods list. + */ + public static List topologicalSort(DirectedGraph graph) + { + DirectedGraph rGraph = reverse(graph); + List sortedResult = new ArrayList(); + Set visitedNodes = new HashSet(); + // A list of "fully explored" nodes. Leftovers in here indicate cycles in the graph + Set expandedNodes = new HashSet(); + + for (T node : rGraph) + { + explore(node, rGraph, sortedResult, visitedNodes, expandedNodes); + } + + return sortedResult; + } + + public static DirectedGraph reverse(DirectedGraph graph) + { + DirectedGraph result = new DirectedGraph(); + + for (T node : graph) + { + result.addNode(node); + } + + for (T from : graph) + { + for (T to : graph.edgesFrom(from)) + { + result.addEdge(to, from); + } + } + + return result; + } + + public static void explore(T node, DirectedGraph graph, List sortedResult, Set visitedNodes, Set expandedNodes) + { + // Have we been here before? + if (visitedNodes.contains(node)) + { + // And have completed this node before + if (expandedNodes.contains(node)) + { + // Then we're fine + return; + } + + FMLLog.severe("Mod Sorting failed."); + FMLLog.severe("Visting node %s", node); + FMLLog.severe("Current sorted list : %s", sortedResult); + FMLLog.severe("Visited set for this node : %s", visitedNodes); + FMLLog.severe("Explored node set : %s", expandedNodes); + SetView cycleList = Sets.difference(visitedNodes, expandedNodes); + FMLLog.severe("Likely cycle is in : %s", cycleList); + throw new ModSortingException("There was a cycle detected in the input graph, sorting is not possible", node, cycleList); + } + + // Visit this node + visitedNodes.add(node); + + // Recursively explore inbound edges + for (T inbound : graph.edgesFrom(node)) + { + explore(inbound, graph, sortedResult, visitedNodes, expandedNodes); + } + + // Add ourselves now + sortedResult.add(node); + // And mark ourselves as explored + expandedNodes.add(node); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ArtifactVersion.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ArtifactVersion.java new file mode 100644 index 0000000..c7e6172 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ArtifactVersion.java @@ -0,0 +1,50 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Describes an artifact version in terms of its components, converts it to/from a string and + * compares two versions. + * + * @author Brett Porter + */ +public interface ArtifactVersion + extends Comparable +{ + String getLabel(); + + String getVersionString(); + + boolean containsVersion(ArtifactVersion source); + + String getRangeString(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ComparableVersion.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ComparableVersion.java new file mode 100644 index 0000000..5bde83d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/ComparableVersion.java @@ -0,0 +1,500 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Locale; +import java.util.Properties; +import java.util.Stack; + +/** + * Generic implementation of version comparison. + * + *

Features: + *

    + *
  • mixing of '-' (dash) and '.' (dot) separators,
  • + *
  • transition between characters and digits also constitutes a separator: + * 1.0alpha1 => [1, 0, alpha, 1]
  • + *
  • unlimited number of version components,
  • + *
  • version components in the text can be digits or strings,
  • + *
  • strings are checked for well-known qualifiers and the qualifier ordering is used for version ordering. + * Well-known qualifiers (case insensitive) are:
      + *
    • snapshot
    • + *
    • alpha or a
    • + *
    • beta or b
    • + *
    • milestone or m
    • + *
    • rc or cr
    • + *
    • (the empty string) or ga or final
    • + *
    • sp
    • + *
    + * Unknown qualifiers are considered after known qualifiers, with lexical order (always case insensitive), + *
  • + *
  • a dash usually precedes a qualifier, and is always less important than something preceded with a dot.
  • + *

+ * + * @see "Versioning" on Maven Wiki + * @author Kenney Westerhof + * @author Hervé Boutemy + */ +public class ComparableVersion + implements Comparable +{ + private String value; + + private String canonical; + + private ListItem items; + + private interface Item + { + final int INTEGER_ITEM = 0; + final int STRING_ITEM = 1; + final int LIST_ITEM = 2; + + int compareTo( Item item ); + + int getType(); + + boolean isNull(); + } + + /** + * Represents a numeric item in the version item list. + */ + private static class IntegerItem + implements Item + { + private static final BigInteger BigInteger_ZERO = new BigInteger( "0" ); + + private final BigInteger value; + + public static final IntegerItem ZERO = new IntegerItem(); + + private IntegerItem() + { + this.value = BigInteger_ZERO; + } + + public IntegerItem( String str ) + { + this.value = new BigInteger( str ); + } + + @Override + public int getType() + { + return INTEGER_ITEM; + } + + @Override + public boolean isNull() + { + return BigInteger_ZERO.equals( value ); + } + + @Override + public int compareTo( Item item ) + { + if ( item == null ) + { + return BigInteger_ZERO.equals( value ) ? 0 : 1; // 1.0 == 1, 1.1 > 1 + } + + switch ( item.getType() ) + { + case INTEGER_ITEM: + return value.compareTo( ( (IntegerItem) item ).value ); + + case STRING_ITEM: + return 1; // 1.1 > 1-sp + + case LIST_ITEM: + return 1; // 1.1 > 1-1 + + default: + throw new RuntimeException( "invalid item: " + item.getClass() ); + } + } + + @Override + public String toString() + { + return value.toString(); + } + } + + /** + * Represents a string in the version item list, usually a qualifier. + */ + private static class StringItem + implements Item + { + private static final String[] QUALIFIERS = { "alpha", "beta", "milestone", "rc", "snapshot", "", "sp" }; + + private static final List _QUALIFIERS = Arrays.asList( QUALIFIERS ); + + private static final Properties ALIASES = new Properties(); + static + { + ALIASES.put( "ga", "" ); + ALIASES.put( "final", "" ); + ALIASES.put( "cr", "rc" ); + } + + /** + * A comparable value for the empty-string qualifier. This one is used to determine if a given qualifier makes + * the version older than one without a qualifier, or more recent. + */ + private static final String RELEASE_VERSION_INDEX = String.valueOf( _QUALIFIERS.indexOf( "" ) ); + + private String value; + + public StringItem( String value, boolean followedByDigit ) + { + if ( followedByDigit && value.length() == 1 ) + { + // a1 = alpha-1, b1 = beta-1, m1 = milestone-1 + switch ( value.charAt( 0 ) ) + { + case 'a': + value = "alpha"; + break; + case 'b': + value = "beta"; + break; + case 'm': + value = "milestone"; + break; + } + } + this.value = ALIASES.getProperty( value , value ); + } + + @Override + public int getType() + { + return STRING_ITEM; + } + + @Override + public boolean isNull() + { + return ( comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ) == 0 ); + } + + /** + * Returns a comparable value for a qualifier. + * + * This method takes into account the ordering of known qualifiers then unknown qualifiers with lexical ordering. + * + * just returning an Integer with the index here is faster, but requires a lot of if/then/else to check for -1 + * or QUALIFIERS.size and then resort to lexical ordering. Most comparisons are decided by the first character, + * so this is still fast. If more characters are needed then it requires a lexical sort anyway. + * + * @param qualifier + * @return an equivalent value that can be used with lexical comparison + */ + public static String comparableQualifier( String qualifier ) + { + int i = _QUALIFIERS.indexOf( qualifier ); + + return i == -1 ? ( _QUALIFIERS.size() + "-" + qualifier ) : String.valueOf( i ); + } + + @Override + public int compareTo( Item item ) + { + if ( item == null ) + { + // 1-rc < 1, 1-ga > 1 + return comparableQualifier( value ).compareTo( RELEASE_VERSION_INDEX ); + } + switch ( item.getType() ) + { + case INTEGER_ITEM: + return -1; // 1.any < 1.1 ? + + case STRING_ITEM: + return comparableQualifier( value ).compareTo( comparableQualifier( ( (StringItem) item ).value ) ); + + case LIST_ITEM: + return -1; // 1.any < 1-1 + + default: + throw new RuntimeException( "invalid item: " + item.getClass() ); + } + } + + @Override + public String toString() + { + return value; + } + } + + /** + * Represents a version list item. This class is used both for the global item list and for sub-lists (which start + * with '-(number)' in the version specification). + */ + private static class ListItem + extends ArrayList + implements Item + { + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public int getType() + { + return LIST_ITEM; + } + + @Override + public boolean isNull() + { + return ( size() == 0 ); + } + + void normalize() + { + for( ListIterator iterator = listIterator( size() ); iterator.hasPrevious(); ) + { + Item item = iterator.previous(); + if ( item.isNull() ) + { + iterator.remove(); // remove null trailing items: 0, "", empty list + } + else + { + break; + } + } + } + + @Override + public int compareTo( Item item ) + { + if ( item == null ) + { + if ( size() == 0 ) + { + return 0; // 1-0 = 1- (normalize) = 1 + } + Item first = get( 0 ); + return first.compareTo( null ); + } + switch ( item.getType() ) + { + case INTEGER_ITEM: + return -1; // 1-1 < 1.0.x + + case STRING_ITEM: + return 1; // 1-1 > 1-sp + + case LIST_ITEM: + Iterator left = iterator(); + Iterator right = ( (ListItem) item ).iterator(); + + while ( left.hasNext() || right.hasNext() ) + { + Item l = left.hasNext() ? left.next() : null; + Item r = right.hasNext() ? right.next() : null; + + // if this is shorter, then invert the compare and mul with -1 + int result = l == null ? -1 * r.compareTo( l ) : l.compareTo( r ); + + if ( result != 0 ) + { + return result; + } + } + + return 0; + + default: + throw new RuntimeException( "invalid item: " + item.getClass() ); + } + } + + @Override + public String toString() + { + StringBuilder buffer = new StringBuilder( "(" ); + for( Iterator iter = iterator(); iter.hasNext(); ) + { + buffer.append( iter.next() ); + if ( iter.hasNext() ) + { + buffer.append( ',' ); + } + } + buffer.append( ')' ); + return buffer.toString(); + } + } + + public ComparableVersion( String version ) + { + parseVersion( version ); + } + + public final void parseVersion( String version ) + { + this.value = version; + + items = new ListItem(); + + version = version.toLowerCase( Locale.ENGLISH ); + + ListItem list = items; + + Stack stack = new Stack(); + stack.push( list ); + + boolean isDigit = false; + + int startIndex = 0; + + for ( int i = 0; i < version.length(); i++ ) + { + char c = version.charAt( i ); + + if ( c == '.' ) + { + if ( i == startIndex ) + { + list.add( IntegerItem.ZERO ); + } + else + { + list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); + } + startIndex = i + 1; + } + else if ( c == '-' ) + { + if ( i == startIndex ) + { + list.add( IntegerItem.ZERO ); + } + else + { + list.add( parseItem( isDigit, version.substring( startIndex, i ) ) ); + } + startIndex = i + 1; + + if ( isDigit ) + { + list.normalize(); // 1.0-* = 1-* + + if ( ( i + 1 < version.length() ) && Character.isDigit( version.charAt( i + 1 ) ) ) + { + // new ListItem only if previous were digits and new char is a digit, + // ie need to differentiate only 1.1 from 1-1 + list.add( list = new ListItem() ); + + stack.push( list ); + } + } + } + else if ( Character.isDigit( c ) ) + { + if ( !isDigit && i > startIndex ) + { + list.add( new StringItem( version.substring( startIndex, i ), true ) ); + startIndex = i; + } + + isDigit = true; + } + else + { + if ( isDigit && i > startIndex ) + { + list.add( parseItem( true, version.substring( startIndex, i ) ) ); + startIndex = i; + } + + isDigit = false; + } + } + + if ( version.length() > startIndex ) + { + list.add( parseItem( isDigit, version.substring( startIndex ) ) ); + } + + while ( !stack.isEmpty() ) + { + list = (ListItem) stack.pop(); + list.normalize(); + } + + canonical = items.toString(); + } + + private static Item parseItem( boolean isDigit, String buf ) + { + return isDigit ? new IntegerItem( buf ) : new StringItem( buf, false ); + } + + @Override + public int compareTo( ComparableVersion o ) + { + return items.compareTo( o.items ); + } + + @Override + public String toString() + { + return value; + } + + @Override + public boolean equals( Object o ) + { + return ( o instanceof ComparableVersion ) && canonical.equals( ( (ComparableVersion) o ).canonical ); + } + + @Override + public int hashCode() + { + return canonical.hashCode(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/DefaultArtifactVersion.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/DefaultArtifactVersion.java new file mode 100644 index 0000000..65cb073 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/DefaultArtifactVersion.java @@ -0,0 +1,106 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +public class DefaultArtifactVersion implements ArtifactVersion +{ + + private ComparableVersion comparableVersion; + private String label; + private boolean unbounded; + private VersionRange range; + + public DefaultArtifactVersion(String versionNumber) + { + comparableVersion = new ComparableVersion(versionNumber); + range = VersionRange.createFromVersion(versionNumber, this); + } + + public DefaultArtifactVersion(String label, VersionRange range) + { + this.label = label; + this.range = range; + } + public DefaultArtifactVersion(String label, String version) + { + this(version); + this.label = label; + } + + public DefaultArtifactVersion(String string, boolean unbounded) + { + this.label = string; + this.unbounded = true; + } + + @Override + public boolean equals(Object obj) + { + return ((DefaultArtifactVersion)obj).containsVersion(this); + } + + @Override + public int compareTo(ArtifactVersion o) + { + return unbounded ? 0 : this.comparableVersion.compareTo(((DefaultArtifactVersion)o).comparableVersion); + } + + @Override + public String getLabel() + { + return label; + } + + @Override + public boolean containsVersion(ArtifactVersion source) + { + if (!source.getLabel().equals(getLabel())) + { + return false; + } + if (unbounded) + { + return true; + } + if (range != null) + { + return range.containsVersion(source); + } + else + { + return false; + } + } + + @Override + public String getVersionString() + { + return comparableVersion == null ? "unknown" : comparableVersion.toString(); + } + + @Override + public String getRangeString() + { + return range == null ? "any" : range.toString(); + } + @Override + public String toString() + { + return label == null ? comparableVersion.toString() : label + ( unbounded ? "" : "@" + range); + } + + public VersionRange getRange() + { + return range; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.java new file mode 100644 index 0000000..44ad01c --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/InvalidVersionSpecificationException.java @@ -0,0 +1,47 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Occurs when a version is invalid. + * + * @author Brett Porter + */ +public class InvalidVersionSpecificationException extends Exception +{ + private static final long serialVersionUID = 1L; + + public InvalidVersionSpecificationException( String message ) + { + super( message ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/Restriction.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/Restriction.java new file mode 100644 index 0000000..a99978d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/Restriction.java @@ -0,0 +1,212 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Describes a restriction in versioning. + * + * @author Brett Porter + */ +public class Restriction +{ + private final ArtifactVersion lowerBound; + + private final boolean lowerBoundInclusive; + + private final ArtifactVersion upperBound; + + private final boolean upperBoundInclusive; + + public static final Restriction EVERYTHING = new Restriction( null, false, null, false ); + + public Restriction( ArtifactVersion lowerBound, boolean lowerBoundInclusive, ArtifactVersion upperBound, + boolean upperBoundInclusive ) + { + this.lowerBound = lowerBound; + this.lowerBoundInclusive = lowerBoundInclusive; + this.upperBound = upperBound; + this.upperBoundInclusive = upperBoundInclusive; + } + + public ArtifactVersion getLowerBound() + { + return lowerBound; + } + + public boolean isLowerBoundInclusive() + { + return lowerBoundInclusive; + } + + public ArtifactVersion getUpperBound() + { + return upperBound; + } + + public boolean isUpperBoundInclusive() + { + return upperBoundInclusive; + } + + public boolean containsVersion( ArtifactVersion version ) + { + if ( lowerBound != null ) + { + int comparison = lowerBound.compareTo( version ); + + if ( ( comparison == 0 ) && !lowerBoundInclusive ) + { + return false; + } + if ( comparison > 0 ) + { + return false; + } + } + if ( upperBound != null ) + { + int comparison = upperBound.compareTo( version ); + + if ( ( comparison == 0 ) && !upperBoundInclusive ) + { + return false; + } + if ( comparison < 0 ) + { + return false; + } + } + + return true; + } + + @Override + public int hashCode() + { + int result = 13; + + if ( lowerBound == null ) + { + result += 1; + } + else + { + result += lowerBound.hashCode(); + } + + result *= lowerBoundInclusive ? 1 : 2; + + if ( upperBound == null ) + { + result -= 3; + } + else + { + result -= upperBound.hashCode(); + } + + result *= upperBoundInclusive ? 2 : 3; + + return result; + } + + @Override + public boolean equals( Object other ) + { + if ( this == other ) + { + return true; + } + + if ( !( other instanceof Restriction ) ) + { + return false; + } + + Restriction restriction = (Restriction) other; + if ( lowerBound != null ) + { + if ( !lowerBound.equals( restriction.lowerBound ) ) + { + return false; + } + } + else if ( restriction.lowerBound != null ) + { + return false; + } + + if ( lowerBoundInclusive != restriction.lowerBoundInclusive ) + { + return false; + } + + if ( upperBound != null ) + { + if ( !upperBound.equals( restriction.upperBound ) ) + { + return false; + } + } + else if ( restriction.upperBound != null ) + { + return false; + } + + if ( upperBoundInclusive != restriction.upperBoundInclusive ) + { + return false; + } + + return true; + } + + @Override + public String toString() + { + StringBuilder buf = new StringBuilder(); + + buf.append( isLowerBoundInclusive() ? "[" : "(" ); + if ( getLowerBound() != null ) + { + buf.append( getLowerBound().toString() ); + } + buf.append( "," ); + if ( getUpperBound() != null ) + { + buf.append( getUpperBound().toString() ); + } + buf.append( isUpperBoundInclusive() ? "]" : ")" ); + + return buf.toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionParser.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionParser.java new file mode 100644 index 0000000..06e70de --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionParser.java @@ -0,0 +1,75 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; + +import java.util.List; +import org.apache.logging.log4j.Level; + +import com.google.common.base.Splitter; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; + +/** + * Parses version strings according to the specification here: + * http://docs.codehaus.org/display/MAVEN/Versioning + * and allows for comparison of versions based on that document. + * Bounded version specifications are defined as + * http://maven.apache.org/plugins/maven-enforcer-plugin/rules/versionRanges.html + * + * Borrows heavily from maven version range management code + * + * @author cpw + * + */ +public class VersionParser +{ + private static final Splitter SEPARATOR = Splitter.on('@').omitEmptyStrings().trimResults(); + public static ArtifactVersion parseVersionReference(String labelledRef) + { + if (Strings.isNullOrEmpty(labelledRef)) + { + throw new RuntimeException(String.format("Empty reference %s", labelledRef)); + } + List parts = Lists.newArrayList(SEPARATOR.split(labelledRef)); + if (parts.size()>2) + { + throw new RuntimeException(String.format("Invalid versioned reference %s", labelledRef)); + } + if (parts.size()==1) + { + return new DefaultArtifactVersion(parts.get(0), true); + } + return new DefaultArtifactVersion(parts.get(0),parseRange(parts.get(1))); + } + + public static boolean satisfies(ArtifactVersion target, ArtifactVersion source) + { + return target.containsVersion(source); + } + + public static VersionRange parseRange(String range) + { + try + { + return VersionRange.createFromVersionSpec(range); + } + catch (InvalidVersionSpecificationException e) + { + FMLLog.log(Level.ERROR, e, "Unable to parse a version range specification successfully %s", range); + throw new LoaderException(e); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionRange.java b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionRange.java new file mode 100644 index 0000000..8e96ac7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/common/versioning/VersionRange.java @@ -0,0 +1,576 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.common.versioning; +/* + * Modifications by cpw under LGPL 2.1 or later + */ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import com.google.common.base.Joiner; + +/** + * Construct a version range from a specification. + * + * @author Brett Porter + */ +public class VersionRange +{ + private final ArtifactVersion recommendedVersion; + + private final List restrictions; + + private VersionRange( ArtifactVersion recommendedVersion, + List restrictions ) + { + this.recommendedVersion = recommendedVersion; + this.restrictions = restrictions; + } + + public ArtifactVersion getRecommendedVersion() + { + return recommendedVersion; + } + + public List getRestrictions() + { + return restrictions; + } + + public VersionRange cloneOf() + { + List copiedRestrictions = null; + + if ( restrictions != null ) + { + copiedRestrictions = new ArrayList(); + + if ( !restrictions.isEmpty() ) + { + copiedRestrictions.addAll( restrictions ); + } + } + + return new VersionRange( recommendedVersion, copiedRestrictions ); + } + + /** + * Factory method, for custom versioning schemes + * @param version version + * @param restrictions restriction list + * @return a new version range + */ + public static VersionRange newRange(ArtifactVersion version, List restrictions) + { + return new VersionRange(version, restrictions); + } + /** + * Create a version range from a string representation + *

+ * Some spec examples are + *

    + *
  • 1.0 Version 1.0
  • + *
  • [1.0,2.0) Versions 1.0 (included) to 2.0 (not included)
  • + *
  • [1.0,2.0] Versions 1.0 to 2.0 (both included)
  • + *
  • [1.5,) Versions 1.5 and higher
  • + *
  • (,1.0],[1.2,) Versions up to 1.0 (included) and 1.2 or higher
  • + *
+ * + * @param spec string representation of a version or version range + * @return a new {@link VersionRange} object that represents the spec + * @throws InvalidVersionSpecificationException + * + */ + public static VersionRange createFromVersionSpec( String spec ) + throws InvalidVersionSpecificationException + { + if ( spec == null ) + { + return null; + } + + List restrictions = new ArrayList(); + String process = spec; + ArtifactVersion version = null; + ArtifactVersion upperBound = null; + ArtifactVersion lowerBound = null; + + while ( process.startsWith( "[" ) || process.startsWith( "(" ) ) + { + int index1 = process.indexOf( ")" ); + int index2 = process.indexOf( "]" ); + + int index = index2; + if ( index2 < 0 || index1 < index2 ) + { + if ( index1 >= 0 ) + { + index = index1; + } + } + + if ( index < 0 ) + { + throw new InvalidVersionSpecificationException( "Unbounded range: " + spec ); + } + + Restriction restriction = parseRestriction( process.substring( 0, index + 1 ) ); + if ( lowerBound == null ) + { + lowerBound = restriction.getLowerBound(); + } + if ( upperBound != null ) + { + if ( restriction.getLowerBound() == null || restriction.getLowerBound().compareTo( upperBound ) < 0 ) + { + throw new InvalidVersionSpecificationException( "Ranges overlap: " + spec ); + } + } + restrictions.add( restriction ); + upperBound = restriction.getUpperBound(); + + process = process.substring( index + 1 ).trim(); + + if ( process.length() > 0 && process.startsWith( "," ) ) + { + process = process.substring( 1 ).trim(); + } + } + + if ( process.length() > 0 ) + { + if ( restrictions.size() > 0 ) + { + throw new InvalidVersionSpecificationException( + "Only fully-qualified sets allowed in multiple set scenario: " + spec ); + } + else + { + version = new DefaultArtifactVersion( process ); + restrictions.add( Restriction.EVERYTHING ); + } + } + + return new VersionRange( version, restrictions ); + } + + private static Restriction parseRestriction( String spec ) + throws InvalidVersionSpecificationException + { + boolean lowerBoundInclusive = spec.startsWith( "[" ); + boolean upperBoundInclusive = spec.endsWith( "]" ); + + String process = spec.substring( 1, spec.length() - 1 ).trim(); + + Restriction restriction; + + int index = process.indexOf( "," ); + + if ( index < 0 ) + { + if ( !lowerBoundInclusive || !upperBoundInclusive ) + { + throw new InvalidVersionSpecificationException( "Single version must be surrounded by []: " + spec ); + } + + ArtifactVersion version = new DefaultArtifactVersion( process ); + + restriction = new Restriction( version, lowerBoundInclusive, version, upperBoundInclusive ); + } + else + { + String lowerBound = process.substring( 0, index ).trim(); + String upperBound = process.substring( index + 1 ).trim(); + if ( lowerBound.equals( upperBound ) ) + { + throw new InvalidVersionSpecificationException( "Range cannot have identical boundaries: " + spec ); + } + + ArtifactVersion lowerVersion = null; + if ( lowerBound.length() > 0 ) + { + lowerVersion = new DefaultArtifactVersion( lowerBound ); + } + ArtifactVersion upperVersion = null; + if ( upperBound.length() > 0 ) + { + upperVersion = new DefaultArtifactVersion( upperBound ); + } + + if ( upperVersion != null && lowerVersion != null && upperVersion.compareTo( lowerVersion ) < 0 ) + { + throw new InvalidVersionSpecificationException( "Range defies version ordering: " + spec ); + } + + restriction = new Restriction( lowerVersion, lowerBoundInclusive, upperVersion, upperBoundInclusive ); + } + + return restriction; + } + + public static VersionRange createFromVersion( String version , ArtifactVersion existing) + { + List restrictions = Collections.emptyList(); + if (existing == null) + { + existing = new DefaultArtifactVersion( version ); + } + return new VersionRange(existing , restrictions ); + } + + /** + * Creates and returns a new VersionRange that is a restriction of this + * version range and the specified version range. + *

+ * Note: Precedence is given to the recommended version from this version range over the + * recommended version from the specified version range. + *

+ * + * @param restriction the VersionRange that will be used to restrict this version + * range. + * @return the VersionRange that is a restriction of this version range and the + * specified version range. + *

+ * The restrictions of the returned version range will be an intersection of the restrictions + * of this version range and the specified version range if both version ranges have + * restrictions. Otherwise, the restrictions on the returned range will be empty. + *

+ *

+ * The recommended version of the returned version range will be the recommended version of + * this version range, provided that ranges falls within the intersected restrictions. If + * the restrictions are empty, this version range's recommended version is used if it is not + * null. If it is null, the specified version range's recommended + * version is used (provided it is non-null). If no recommended version can be + * obtained, the returned version range's recommended version is set to null. + *

+ * @throws NullPointerException if the specified VersionRange is + * null. + */ + public VersionRange restrict( VersionRange restriction ) + { + List r1 = this.restrictions; + List r2 = restriction.restrictions; + List restrictions; + + if ( r1.isEmpty() || r2.isEmpty() ) + { + restrictions = Collections.emptyList(); + } + else + { + restrictions = intersection( r1, r2 ); + } + + ArtifactVersion version = null; + if ( restrictions.size() > 0 ) + { + for ( Restriction r : restrictions ) + { + if ( recommendedVersion != null && r.containsVersion( recommendedVersion ) ) + { + // if we find the original, use that + version = recommendedVersion; + break; + } + else if ( version == null && restriction.getRecommendedVersion() != null + && r.containsVersion( restriction.getRecommendedVersion() ) ) + { + // use this if we can, but prefer the original if possible + version = restriction.getRecommendedVersion(); + } + } + } + // Either the original or the specified version ranges have no restrictions + else if ( recommendedVersion != null ) + { + // Use the original recommended version since it exists + version = recommendedVersion; + } + else if ( restriction.recommendedVersion != null ) + { + // Use the recommended version from the specified VersionRange since there is no + // original recommended version + version = restriction.recommendedVersion; + } +/* TODO: should throw this immediately, but need artifact + else + { + throw new OverConstrainedVersionException( "Restricting incompatible version ranges" ); + } +*/ + + return new VersionRange( version, restrictions ); + } + + private List intersection( List r1, List r2 ) + { + List restrictions = new ArrayList( r1.size() + r2.size() ); + Iterator i1 = r1.iterator(); + Iterator i2 = r2.iterator(); + Restriction res1 = i1.next(); + Restriction res2 = i2.next(); + + boolean done = false; + while ( !done ) + { + if ( res1.getLowerBound() == null || res2.getUpperBound() == null + || res1.getLowerBound().compareTo( res2.getUpperBound() ) <= 0 ) + { + if ( res1.getUpperBound() == null || res2.getLowerBound() == null + || res1.getUpperBound().compareTo( res2.getLowerBound() ) >= 0 ) + { + ArtifactVersion lower; + ArtifactVersion upper; + boolean lowerInclusive; + boolean upperInclusive; + + // overlaps + if ( res1.getLowerBound() == null ) + { + lower = res2.getLowerBound(); + lowerInclusive = res2.isLowerBoundInclusive(); + } + else if ( res2.getLowerBound() == null ) + { + lower = res1.getLowerBound(); + lowerInclusive = res1.isLowerBoundInclusive(); + } + else + { + int comparison = res1.getLowerBound().compareTo( res2.getLowerBound() ); + if ( comparison < 0 ) + { + lower = res2.getLowerBound(); + lowerInclusive = res2.isLowerBoundInclusive(); + } + else if ( comparison == 0 ) + { + lower = res1.getLowerBound(); + lowerInclusive = res1.isLowerBoundInclusive() && res2.isLowerBoundInclusive(); + } + else + { + lower = res1.getLowerBound(); + lowerInclusive = res1.isLowerBoundInclusive(); + } + } + + if ( res1.getUpperBound() == null ) + { + upper = res2.getUpperBound(); + upperInclusive = res2.isUpperBoundInclusive(); + } + else if ( res2.getUpperBound() == null ) + { + upper = res1.getUpperBound(); + upperInclusive = res1.isUpperBoundInclusive(); + } + else + { + int comparison = res1.getUpperBound().compareTo( res2.getUpperBound() ); + if ( comparison < 0 ) + { + upper = res1.getUpperBound(); + upperInclusive = res1.isUpperBoundInclusive(); + } + else if ( comparison == 0 ) + { + upper = res1.getUpperBound(); + upperInclusive = res1.isUpperBoundInclusive() && res2.isUpperBoundInclusive(); + } + else + { + upper = res2.getUpperBound(); + upperInclusive = res2.isUpperBoundInclusive(); + } + } + + // don't add if they are equal and one is not inclusive + if ( lower == null || upper == null || lower.compareTo( upper ) != 0 ) + { + restrictions.add( new Restriction( lower, lowerInclusive, upper, upperInclusive ) ); + } + else if ( lowerInclusive && upperInclusive ) + { + restrictions.add( new Restriction( lower, lowerInclusive, upper, upperInclusive ) ); + } + + //noinspection ObjectEquality + if ( upper == res2.getUpperBound() ) + { + // advance res2 + if ( i2.hasNext() ) + { + res2 = i2.next(); + } + else + { + done = true; + } + } + else + { + // advance res1 + if ( i1.hasNext() ) + { + res1 = i1.next(); + } + else + { + done = true; + } + } + } + else + { + // move on to next in r1 + if ( i1.hasNext() ) + { + res1 = i1.next(); + } + else + { + done = true; + } + } + } + else + { + // move on to next in r2 + if ( i2.hasNext() ) + { + res2 = i2.next(); + } + else + { + done = true; + } + } + } + + return restrictions; + } + + @Override + public String toString() + { + if ( recommendedVersion != null ) + { + return recommendedVersion.toString(); + } + else + { + return Joiner.on(',').join(restrictions); + } + } + + public ArtifactVersion matchVersion( List versions ) + { + // TODO: could be more efficient by sorting the list and then moving along the restrictions in order? + + ArtifactVersion matched = null; + for ( ArtifactVersion version : versions ) + { + if ( containsVersion( version ) ) + { + // valid - check if it is greater than the currently matched version + if ( matched == null || version.compareTo( matched ) > 0 ) + { + matched = version; + } + } + } + return matched; + } + + public boolean containsVersion( ArtifactVersion version ) + { + for ( Restriction restriction : restrictions ) + { + if ( restriction.containsVersion( version ) ) + { + return true; + } + } + return false; + } + + public boolean hasRestrictions() + { + return !restrictions.isEmpty() && recommendedVersion == null; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( !( obj instanceof VersionRange ) ) + { + return false; + } + VersionRange other = (VersionRange) obj; + + boolean equals = + recommendedVersion == other.recommendedVersion + || ( ( recommendedVersion != null ) && recommendedVersion.equals( other.recommendedVersion ) ); + equals &= + restrictions == other.restrictions + || ( ( restrictions != null ) && restrictions.equals( other.restrictions ) ); + return equals; + } + + @Override + public int hashCode() + { + int hash = 7; + hash = 31 * hash + ( recommendedVersion == null ? 0 : recommendedVersion.hashCode() ); + hash = 31 * hash + ( restrictions == null ? 0 : restrictions.hashCode() ); + return hash; + } + + public boolean isUnboundedAbove() + { + return restrictions.size() == 1 && restrictions.get(0).getUpperBound() == null && !restrictions.get(0).isUpperBoundInclusive(); + } + + public String getLowerBoundString() + { + return restrictions.size() == 1 ? restrictions.get(0).getLowerBound().getVersionString() : ""; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/CoreModManager.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/CoreModManager.java new file mode 100644 index 0000000..7752c62 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/CoreModManager.java @@ -0,0 +1,653 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.io.File; +import java.io.FileFilter; +import java.io.FilenameFilter; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.jar.Attributes; +import java.util.jar.JarFile; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.launchwrapper.LaunchClassLoader; + +import org.apache.logging.log4j.Level; + +import com.google.common.base.Strings; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.ObjectArrays; +import com.google.common.primitives.Ints; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.asm.transformers.ModAccessTransformer; +import cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker; +import cpw.mods.fml.common.launcher.FMLTweaker; +import cpw.mods.fml.common.toposort.TopologicalSort; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.DependsOn; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; + +public class CoreModManager { + private static final Attributes.Name COREMODCONTAINSFMLMOD = new Attributes.Name("FMLCorePluginContainsFMLMod"); + private static final Attributes.Name MODTYPE = new Attributes.Name("ModType"); + private static final Attributes.Name MODSIDE = new Attributes.Name("ModSide"); + private static String[] rootPlugins = { "cpw.mods.fml.relauncher.FMLCorePlugin", "net.minecraftforge.classloading.FMLForgePlugin" }; + private static List loadedCoremods = Lists.newArrayList(); + private static List loadPlugins; + private static boolean deobfuscatedEnvironment; + private static FMLTweaker tweaker; + private static File mcDir; + private static List reparsedCoremods = Lists.newArrayList(); + private static List accessTransformers = Lists.newArrayList(); + + private static class FMLPluginWrapper implements ITweaker { + public final String name; + public final IFMLLoadingPlugin coreModInstance; + public final List predepends; + public final File location; + public final int sortIndex; + + public FMLPluginWrapper(String name, IFMLLoadingPlugin coreModInstance, File location, int sortIndex, String... predepends) + { + super(); + this.name = name; + this.coreModInstance = coreModInstance; + this.location = location; + this.sortIndex = sortIndex; + this.predepends = Lists.newArrayList(predepends); + } + + @Override + public String toString() + { + return String.format("%s {%s}", this.name, this.predepends); + } + + @Override + public void acceptOptions(List args, File gameDir, File assetsDir, String profile) + { + // NO OP + } + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) + { + FMLRelaunchLog.fine("Injecting coremod %s {%s} class transformers", name, coreModInstance.getClass().getName()); + if (coreModInstance.getASMTransformerClass() != null) for (String transformer : coreModInstance.getASMTransformerClass()) + { + FMLRelaunchLog.finer("Registering transformer %s", transformer); + classLoader.registerTransformer(transformer); + } + FMLRelaunchLog.fine("Injection complete"); + + FMLRelaunchLog.fine("Running coremod plugin for %s {%s}", name, coreModInstance.getClass().getName()); + Map data = new HashMap(); + data.put("mcLocation", mcDir); + data.put("coremodList", loadPlugins); + data.put("runtimeDeobfuscationEnabled", !deobfuscatedEnvironment); + FMLRelaunchLog.fine("Running coremod plugin %s", name); + data.put("coremodLocation", location); + coreModInstance.injectData(data); + String setupClass = coreModInstance.getSetupClass(); + if (setupClass != null) + { + try + { + IFMLCallHook call = (IFMLCallHook) Class.forName(setupClass, true, classLoader).newInstance(); + Map callData = new HashMap(); + callData.put("runtimeDeobfuscationEnabled", !deobfuscatedEnvironment); + callData.put("mcLocation", mcDir); + callData.put("classLoader", classLoader); + callData.put("coremodLocation", location); + callData.put("deobfuscationFileName", FMLInjectionData.debfuscationDataName()); + call.injectData(callData); + call.call(); + } + catch (Exception e) + { + throw new RuntimeException(e); + } + } + FMLRelaunchLog.fine("Coremod plugin class %s run successfully", coreModInstance.getClass().getSimpleName()); + + String modContainer = coreModInstance.getModContainerClass(); + if (modContainer != null) + { + FMLInjectionData.containers.add(modContainer); + } + } + + @Override + public String getLaunchTarget() + { + return ""; + } + + @Override + public String[] getLaunchArguments() + { + return new String[0]; + } + + } + + public static void handleLaunch(File mcDir, LaunchClassLoader classLoader, FMLTweaker tweaker) + { + CoreModManager.mcDir = mcDir; + CoreModManager.tweaker = tweaker; + try + { + // Are we in a 'decompiled' environment? + byte[] bs = classLoader.getClassBytes("net.minecraft.world.World"); + if (bs != null) + { + FMLRelaunchLog.info("Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation"); + deobfuscatedEnvironment = true; + } + } + catch (IOException e1) + { + } + + if (!deobfuscatedEnvironment) + { + FMLRelaunchLog.fine("Enabling runtime deobfuscation"); + } + + tweaker.injectCascadingTweak("cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker"); + try + { + classLoader.registerTransformer("cpw.mods.fml.common.asm.transformers.PatchingTransformer"); + } + catch (Exception e) + { + FMLRelaunchLog.log(Level.ERROR, e, "The patch transformer failed to load! This is critical, loading cannot continue!"); + throw Throwables.propagate(e); + } + + loadPlugins = new ArrayList(); + for (String rootPluginName : rootPlugins) + { + loadCoreMod(classLoader, rootPluginName, new File(FMLTweaker.getJarLocation())); + } + + if (loadPlugins.isEmpty()) + { + throw new RuntimeException("A fatal error has occured - no valid fml load plugin was found - this is a completely corrupt FML installation."); + } + + FMLRelaunchLog.fine("All fundamental core mods are successfully located"); + // Now that we have the root plugins loaded - lets see what else might + // be around + String commandLineCoremods = System.getProperty("fml.coreMods.load", ""); + for (String coreModClassName : commandLineCoremods.split(",")) + { + if (coreModClassName.isEmpty()) + { + continue; + } + FMLRelaunchLog.info("Found a command line coremod : %s", coreModClassName); + loadCoreMod(classLoader, coreModClassName, null); + } + discoverCoreMods(mcDir, classLoader); + + } + + private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader) + { + ModListHelper.parseModList(mcDir); + FMLRelaunchLog.fine("Discovering coremods"); + File coreMods = setupCoreModDir(mcDir); + FilenameFilter ff = new FilenameFilter() { + @Override + public boolean accept(File dir, String name) + { + return name.endsWith(".jar"); + } + }; + FilenameFilter derpfilter = new FilenameFilter() { + @Override + public boolean accept(File dir, String name) + { + return name.endsWith(".jar.zip"); + } + }; + File[] derplist = coreMods.listFiles(derpfilter); + if (derplist != null && derplist.length > 0) + { + FMLRelaunchLog.severe("FML has detected several badly downloaded jar files, which have been named as zip files. You probably need to download them again, or they may not work properly"); + for (File f : derplist) + { + FMLRelaunchLog.severe("Problem file : %s", f.getName()); + } + } + FileFilter derpdirfilter = new FileFilter() { + @Override + public boolean accept(File pathname) + { + return pathname.isDirectory() && new File(pathname,"META-INF").isDirectory(); + } + + }; + File[] derpdirlist = coreMods.listFiles(derpdirfilter); + if (derpdirlist != null && derpdirlist.length > 0) + { + FMLRelaunchLog.log.getLogger().log(Level.FATAL, "There appear to be jars extracted into the mods directory. This is VERY BAD and will almost NEVER WORK WELL"); + FMLRelaunchLog.log.getLogger().log(Level.FATAL, "You should place original jars only in the mods directory. NEVER extract them to the mods directory."); + FMLRelaunchLog.log.getLogger().log(Level.FATAL, "The directories below appear to be extracted jar files. Fix this before you continue."); + + for (File f : derpdirlist) + { + FMLRelaunchLog.log.getLogger().log(Level.FATAL, "Directory {} contains {}", f.getName(), Arrays.asList(new File(f,"META-INF").list())); + } + + RuntimeException re = new RuntimeException("Extracted mod jars found, loading will NOT continue"); + // We're generating a crash report for the launcher to show to the user here + try + { + Class crashreportclass = classLoader.loadClass("b"); + Object crashreport = crashreportclass.getMethod("a", Throwable.class, String.class).invoke(null, re, "FML has discovered extracted jar files in the mods directory.\nThis breaks mod loading functionality completely.\nRemove the directories and replace with the jar files originally provided."); + File crashreportfile = new File(new File(coreMods.getParentFile(),"crash-reports"),String.format("fml-crash-%1$tY-%1$tm-%1$td_%1$tT.txt",Calendar.getInstance())); + crashreportclass.getMethod("a",File.class).invoke(crashreport, crashreportfile); + System.out.println("#@!@# FML has crashed the game deliberately. Crash report saved to: #@!@# " + crashreportfile.getAbsolutePath()); + } catch (Exception e) + { + e.printStackTrace(); + // NOOP - hopefully + } + throw re; + } + File[] coreModList = coreMods.listFiles(ff); + File versionedModDir = new File(coreMods, FMLInjectionData.mccversion); + if (versionedModDir.isDirectory()) + { + File[] versionedCoreMods = versionedModDir.listFiles(ff); + coreModList = ObjectArrays.concat(coreModList, versionedCoreMods, File.class); + } + + coreModList = ObjectArrays.concat(coreModList, ModListHelper.additionalMods.values().toArray(new File[0]), File.class); + + coreModList = FileListHelper.sortFileList(coreModList); + + for (File coreMod : coreModList) + { + FMLRelaunchLog.fine("Examining for coremod candidacy %s", coreMod.getName()); + JarFile jar = null; + Attributes mfAttributes; + try + { + jar = new JarFile(coreMod); + if (jar.getManifest() == null) + { + // Not a coremod and no access transformer list + continue; + } + ModAccessTransformer.addJar(jar); + mfAttributes = jar.getManifest().getMainAttributes(); + } + catch (IOException ioe) + { + FMLRelaunchLog.log(Level.ERROR, ioe, "Unable to read the jar file %s - ignoring", coreMod.getName()); + continue; + } + finally + { + if (jar != null) + { + try + { + jar.close(); + } + catch (IOException e) + { + // Noise + } + } + } + String cascadedTweaker = mfAttributes.getValue("TweakClass"); + if (cascadedTweaker != null) + { + FMLRelaunchLog.info("Loading tweaker %s from %s", cascadedTweaker, coreMod.getName()); + Integer sortOrder = Ints.tryParse(Strings.nullToEmpty(mfAttributes.getValue("TweakOrder"))); + sortOrder = (sortOrder == null ? Integer.valueOf(0) : sortOrder); + handleCascadingTweak(coreMod, jar, cascadedTweaker, classLoader, sortOrder); + loadedCoremods.add(coreMod.getName()); + continue; + } + List modTypes = mfAttributes.containsKey(MODTYPE) ? Arrays.asList(mfAttributes.getValue(MODTYPE).split(",")) : ImmutableList.of("FML"); + + if (!modTypes.contains("FML")) + { + FMLRelaunchLog.fine("Adding %s to the list of things to skip. It is not an FML mod, it has types %s", coreMod.getName(), modTypes); + loadedCoremods.add(coreMod.getName()); + continue; + } + String modSide = mfAttributes.containsKey(MODSIDE) ? mfAttributes.getValue(MODSIDE) : "BOTH"; + if (! ("BOTH".equals(modSide) || FMLLaunchHandler.side.name().equals(modSide))) + { + FMLRelaunchLog.fine("Mod %s has ModSide meta-inf value %s, and we're %s. It will be ignored", coreMod.getName(), modSide, FMLLaunchHandler.side.name()); + loadedCoremods.add(coreMod.getName()); + continue; + } + String fmlCorePlugin = mfAttributes.getValue("FMLCorePlugin"); + if (fmlCorePlugin == null) + { + // Not a coremod + FMLRelaunchLog.fine("Not found coremod data in %s", coreMod.getName()); + continue; + } + // Support things that are mod jars, but not FML mod jars + try + { + classLoader.addURL(coreMod.toURI().toURL()); + if (!mfAttributes.containsKey(COREMODCONTAINSFMLMOD)) + { + FMLRelaunchLog.finer("Adding %s to the list of known coremods, it will not be examined again", coreMod.getName()); + loadedCoremods.add(coreMod.getName()); + } + else + { + FMLRelaunchLog.finer("Found FMLCorePluginContainsFMLMod marker in %s, it will be examined later for regular @Mod instances", + coreMod.getName()); + reparsedCoremods.add(coreMod.getName()); + } + } + catch (MalformedURLException e) + { + FMLRelaunchLog.log(Level.ERROR, e, "Unable to convert file into a URL. weird"); + continue; + } + loadCoreMod(classLoader, fmlCorePlugin, coreMod); + } + } + + private static Method ADDURL; + + private static void handleCascadingTweak(File coreMod, JarFile jar, String cascadedTweaker, LaunchClassLoader classLoader, Integer sortingOrder) + { + try + { + // Have to manually stuff the tweaker into the parent classloader + if (ADDURL == null) + { + ADDURL = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); + ADDURL.setAccessible(true); + } + ADDURL.invoke(classLoader.getClass().getClassLoader(), coreMod.toURI().toURL()); + classLoader.addURL(coreMod.toURI().toURL()); + CoreModManager.tweaker.injectCascadingTweak(cascadedTweaker); + tweakSorting.put(cascadedTweaker,sortingOrder); + } + catch (Exception e) + { + FMLRelaunchLog.log(Level.INFO, e, "There was a problem trying to load the mod dir tweaker %s", coreMod.getAbsolutePath()); + } + } + + /** + * @param mcDir + * the minecraft home directory + * @return the coremod directory + */ + private static File setupCoreModDir(File mcDir) + { + File coreModDir = new File(mcDir, "mods"); + try + { + coreModDir = coreModDir.getCanonicalFile(); + } + catch (IOException e) + { + throw new RuntimeException(String.format("Unable to canonicalize the coremod dir at %s", mcDir.getName()), e); + } + if (!coreModDir.exists()) + { + coreModDir.mkdir(); + } + else if (coreModDir.exists() && !coreModDir.isDirectory()) + { + throw new RuntimeException(String.format("Found a coremod file in %s that's not a directory", mcDir.getName())); + } + return coreModDir; + } + + public static List getLoadedCoremods() + { + return loadedCoremods; + } + + public static List getReparseableCoremods() + { + return reparsedCoremods; + } + + private static FMLPluginWrapper loadCoreMod(LaunchClassLoader classLoader, String coreModClass, File location) + { + String coreModName = coreModClass.substring(coreModClass.lastIndexOf('.') + 1); + try + { + FMLRelaunchLog.fine("Instantiating coremod class %s", coreModName); + classLoader.addTransformerExclusion(coreModClass); + Class coreModClazz = Class.forName(coreModClass, true, classLoader); + Name coreModNameAnn = coreModClazz.getAnnotation(IFMLLoadingPlugin.Name.class); + if (coreModNameAnn != null && !Strings.isNullOrEmpty(coreModNameAnn.value())) + { + coreModName = coreModNameAnn.value(); + FMLRelaunchLog.finer("coremod named %s is loading", coreModName); + } + MCVersion requiredMCVersion = coreModClazz.getAnnotation(IFMLLoadingPlugin.MCVersion.class); + if (!Arrays.asList(rootPlugins).contains(coreModClass) && (requiredMCVersion == null || Strings.isNullOrEmpty(requiredMCVersion.value()))) + { + FMLRelaunchLog.log(Level.WARN, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft", + coreModClass); + } + else if (requiredMCVersion != null && !FMLInjectionData.mccversion.equals(requiredMCVersion.value())) + { + FMLRelaunchLog.log(Level.ERROR, "The coremod %s is requesting minecraft version %s and minecraft is %s. It will be ignored.", coreModClass, + requiredMCVersion.value(), FMLInjectionData.mccversion); + return null; + } + else if (requiredMCVersion != null) + { + FMLRelaunchLog.log(Level.DEBUG, "The coremod %s requested minecraft version %s and minecraft is %s. It will be loaded.", coreModClass, + requiredMCVersion.value(), FMLInjectionData.mccversion); + } + TransformerExclusions trExclusions = coreModClazz.getAnnotation(IFMLLoadingPlugin.TransformerExclusions.class); + if (trExclusions != null) + { + for (String st : trExclusions.value()) + { + classLoader.addTransformerExclusion(st); + } + } + DependsOn deplist = coreModClazz.getAnnotation(IFMLLoadingPlugin.DependsOn.class); + String[] dependencies = new String[0]; + if (deplist != null) + { + dependencies = deplist.value(); + } + SortingIndex index = coreModClazz.getAnnotation(IFMLLoadingPlugin.SortingIndex.class); + int sortIndex = index != null ? index.value() : 0; + + IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClazz.newInstance(); + String accessTransformerClass = plugin.getAccessTransformerClass(); + if (accessTransformerClass != null) + { + FMLRelaunchLog.log(Level.DEBUG, "Added access transformer class %s to enqueued access transformers", accessTransformerClass); + accessTransformers.add(accessTransformerClass); + } + FMLPluginWrapper wrap = new FMLPluginWrapper(coreModName, plugin, location, sortIndex, dependencies); + loadPlugins.add(wrap); + FMLRelaunchLog.fine("Enqueued coremod %s", coreModName); + return wrap; + } + catch (ClassNotFoundException cnfe) + { + if (!Lists.newArrayList(rootPlugins).contains(coreModClass)) + FMLRelaunchLog.log(Level.ERROR, cnfe, "Coremod %s: Unable to class load the plugin %s", coreModName, coreModClass); + else + FMLRelaunchLog.fine("Skipping root plugin %s", coreModClass); + } + catch (ClassCastException cce) + { + FMLRelaunchLog.log(Level.ERROR, cce, "Coremod %s: The plugin %s is not an implementor of IFMLLoadingPlugin", coreModName, coreModClass); + } + catch (InstantiationException ie) + { + FMLRelaunchLog.log(Level.ERROR, ie, "Coremod %s: The plugin class %s was not instantiable", coreModName, coreModClass); + } + catch (IllegalAccessException iae) + { + FMLRelaunchLog.log(Level.ERROR, iae, "Coremod %s: The plugin class %s was not accessible", coreModName, coreModClass); + } + return null; + } + + @SuppressWarnings("unused") + private static void sortCoreMods() + { + TopologicalSort.DirectedGraph sortGraph = new TopologicalSort.DirectedGraph(); + Map pluginMap = Maps.newHashMap(); + for (FMLPluginWrapper plug : loadPlugins) + { + sortGraph.addNode(plug); + pluginMap.put(plug.name, plug); + } + + for (FMLPluginWrapper plug : loadPlugins) + { + for (String dep : plug.predepends) + { + if (!pluginMap.containsKey(dep)) + { + FMLRelaunchLog.log(Level.ERROR, "Missing coremod dependency - the coremod %s depends on coremod %s which isn't present.", plug.name, dep); + throw new RuntimeException(); + } + sortGraph.addEdge(plug, pluginMap.get(dep)); + } + } + try + { + loadPlugins = TopologicalSort.topologicalSort(sortGraph); + FMLRelaunchLog.fine("Sorted coremod list %s", loadPlugins); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, "There was a problem performing the coremod sort"); + throw Throwables.propagate(e); + } + } + + public static void injectTransformers(LaunchClassLoader classLoader) + { + + Launch.blackboard.put("fml.deobfuscatedEnvironment", deobfuscatedEnvironment); + tweaker.injectCascadingTweak("cpw.mods.fml.common.launcher.FMLDeobfTweaker"); + tweakSorting.put("cpw.mods.fml.common.launcher.FMLDeobfTweaker", Integer.valueOf(1000)); + } + + public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker) + { + @SuppressWarnings("unchecked") + List tweakers = (List) Launch.blackboard.get("Tweaks"); + // Add the sorting tweaker first- it'll appear twice in the list + tweakers.add(0, fmlInjectionAndSortingTweaker); + for (FMLPluginWrapper wrapper : loadPlugins) + { + tweakers.add(wrapper); + } + } + + private static Map tweakSorting = Maps.newHashMap(); + + public static void sortTweakList() + { + @SuppressWarnings("unchecked") + List tweakers = (List) Launch.blackboard.get("Tweaks"); + // Basically a copy of Collections.sort pre 8u20, optimized as we know we're an array list. + // Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636 + ITweaker[] toSort = tweakers.toArray(new ITweaker[tweakers.size()]); + Arrays.sort(toSort, new Comparator() { + @Override + public int compare(ITweaker o1, ITweaker o2) + { + Integer first = null; + Integer second = null; + if (o1 instanceof FMLInjectionAndSortingTweaker) + { + first = Integer.MIN_VALUE; + } + if (o2 instanceof FMLInjectionAndSortingTweaker) + { + second = Integer.MIN_VALUE; + } + + if (o1 instanceof FMLPluginWrapper) + { + first = ((FMLPluginWrapper) o1).sortIndex; + } + else if (first == null) + { + first = tweakSorting.get(o1.getClass().getName()); + } + if (o2 instanceof FMLPluginWrapper) + { + second = ((FMLPluginWrapper) o2).sortIndex; + } + else if (second == null) + { + second = tweakSorting.get(o2.getClass().getName()); + } + if (first == null) + { + first = 0; + } + if (second == null) + { + second = 0; + } + + return Ints.saturatedCast((long)first - (long)second); + } + }); + // Basically a copy of Collections.sort, optimized as we know we're an array list. + // Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636 + for (int j = 0; j < toSort.length; j++) { + tweakers.set(j, toSort[j]); + } + } + + public static List getAccessTransformers() + { + return accessTransformers; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLCorePlugin.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLCorePlugin.java new file mode 100644 index 0000000..32a98c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLCorePlugin.java @@ -0,0 +1,51 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.util.Map; + +public class FMLCorePlugin implements IFMLLoadingPlugin +{ + @Override + public String[] getASMTransformerClass() + { + return new String[] { + "cpw.mods.fml.common.asm.transformers.MarkerTransformer", + "cpw.mods.fml.common.asm.transformers.SideTransformer", + "cpw.mods.fml.common.asm.transformers.EventSubscriptionTransformer", + }; + } + + @Override + public String getAccessTransformerClass() + { + return "cpw.mods.fml.common.asm.transformers.AccessTransformer"; + } + @Override + public String getModContainerClass() + { + return "cpw.mods.fml.common.FMLContainer"; + } + + @Override + public String getSetupClass() + { + return "cpw.mods.fml.common.asm.FMLSanityChecker"; + } + + @Override + public void injectData(Map data) + { + // don't care about this data + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLInjectionData.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLInjectionData.java new file mode 100644 index 0000000..ffb8a38 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLInjectionData.java @@ -0,0 +1,73 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import org.apache.logging.log4j.Level; + +import net.minecraft.launchwrapper.LaunchClassLoader; + +public class FMLInjectionData +{ + static File minecraftHome; + static String major; + static String minor; + static String rev; + static String build; + static String mccversion; + static String mcpversion; + static String deobfuscationDataHash; + + public static List containers = new ArrayList(); + + static void build(File mcHome, LaunchClassLoader classLoader) + { + minecraftHome = mcHome; + InputStream stream = classLoader.getResourceAsStream("fmlversion.properties"); + Properties properties = new Properties(); + + if (stream != null) + { + try + { + properties.load(stream); + } + catch (IOException ex) + { + FMLRelaunchLog.log(Level.ERROR, ex, "Could not get FML version information - corrupted installation detected!"); + } + } + + major = properties.getProperty("fmlbuild.major.number", "missing"); + minor = properties.getProperty("fmlbuild.minor.number", "missing"); + rev = properties.getProperty("fmlbuild.revision.number", "missing"); + build = properties.getProperty("fmlbuild.build.number", "missing"); + mccversion = properties.getProperty("fmlbuild.mcversion", "missing"); + mcpversion = properties.getProperty("fmlbuild.mcpversion", "missing"); + deobfuscationDataHash = properties.getProperty("fmlbuild.deobfuscation.hash","deadbeef"); + } + + static String debfuscationDataName() + { + return "/deobfuscation_data-"+mccversion+".lzma"; + } + public static Object[] data() + { + return new Object[] { major, minor, rev, build, mccversion, mcpversion, minecraftHome, containers }; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLLaunchHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLLaunchHandler.java new file mode 100644 index 0000000..6853e6b --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLLaunchHandler.java @@ -0,0 +1,115 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.io.File; +import org.apache.logging.log4j.Level; + +import net.minecraft.launchwrapper.LaunchClassLoader; + +import com.google.common.base.Throwables; + +import cpw.mods.fml.common.launcher.FMLTweaker; + +public class FMLLaunchHandler +{ + private static FMLLaunchHandler INSTANCE; + static Side side; + private LaunchClassLoader classLoader; + private FMLTweaker tweaker; + private File minecraftHome; + + public static void configureForClientLaunch(LaunchClassLoader loader, FMLTweaker tweaker) + { + instance(loader, tweaker).setupClient(); + } + + public static void configureForServerLaunch(LaunchClassLoader loader, FMLTweaker tweaker) + { + instance(loader, tweaker).setupServer(); + } + + private static FMLLaunchHandler instance(LaunchClassLoader launchLoader, FMLTweaker tweaker) + { + if (INSTANCE == null) + { + INSTANCE = new FMLLaunchHandler(launchLoader, tweaker); + } + return INSTANCE; + + } + + private FMLLaunchHandler(LaunchClassLoader launchLoader, FMLTweaker tweaker) + { + this.classLoader = launchLoader; + this.tweaker = tweaker; + this.minecraftHome = tweaker.getGameDir(); + this.classLoader.addClassLoaderExclusion("cpw.mods.fml.relauncher."); + this.classLoader.addClassLoaderExclusion("net.minecraftforge.classloading."); + this.classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.deobf."); + this.classLoader.addTransformerExclusion("cpw.mods.fml.common.patcher."); + } + + private void setupClient() + { + FMLRelaunchLog.side = Side.CLIENT; + side = Side.CLIENT; + setupHome(); + } + + private void setupServer() + { + FMLRelaunchLog.side = Side.SERVER; + side = Side.SERVER; + setupHome(); + + } + + private void setupHome() + { + FMLInjectionData.build(minecraftHome, classLoader); + FMLRelaunchLog.minecraftHome = minecraftHome; + FMLRelaunchLog.info("Forge Mod Loader version %s.%s.%s.%s for Minecraft %s loading", FMLInjectionData.major, FMLInjectionData.minor, + FMLInjectionData.rev, FMLInjectionData.build, FMLInjectionData.mccversion, FMLInjectionData.mcpversion); + FMLRelaunchLog.info("Java is %s, version %s, running on %s:%s:%s, installed at %s", System.getProperty("java.vm.name"), System.getProperty("java.version"), System.getProperty("os.name"), System.getProperty("os.arch"), System.getProperty("os.version"), System.getProperty("java.home")); + FMLRelaunchLog.fine("Java classpath at launch is %s", System.getProperty("java.class.path")); + FMLRelaunchLog.fine("Java library path at launch is %s", System.getProperty("java.library.path")); + + try + { + CoreModManager.handleLaunch(minecraftHome, classLoader, tweaker); + } + catch (Throwable t) + { + t.printStackTrace(); + FMLRelaunchLog.log(Level.ERROR, t, "An error occurred trying to configure the minecraft home at %s for Forge Mod Loader", minecraftHome.getAbsolutePath()); + throw Throwables.propagate(t); + } + } + + public static Side side() + { + return side; + } + + + private void injectPostfixTransformers() + { + CoreModManager.injectTransformers(classLoader); + } + + public static void appendCoreMods() + { + INSTANCE.injectPostfixTransformers(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLRelaunchLog.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLRelaunchLog.java new file mode 100644 index 0000000..e17a706 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLRelaunchLog.java @@ -0,0 +1,115 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.io.File; +import java.util.Locale; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.ThreadContext; + +import cpw.mods.fml.common.TracingPrintStream; + +public class FMLRelaunchLog { + + /** + * Our special logger for logging issues to. We copy various assets from the + * Minecraft logger to achieve a similar appearance. + */ + public static FMLRelaunchLog log = new FMLRelaunchLog(); + + static File minecraftHome; + private static boolean configured; + + private Logger myLog; + + static Side side; + + private FMLRelaunchLog() + { + } + + /** + * Configure the FML logger and inject tracing printstreams. + */ + private static void configureLogging() + { + log.myLog = LogManager.getLogger("FML"); + ThreadContext.put("side", side.name().toLowerCase(Locale.ENGLISH)); + configured = true; + + FMLRelaunchLog.fine("Injecting tracing printstreams for STDOUT/STDERR."); + System.setOut(new TracingPrintStream(LogManager.getLogger("STDOUT"), System.out)); + System.setErr(new TracingPrintStream(LogManager.getLogger("STDERR"), System.err)); + } + + public static void log(String targetLog, Level level, String format, Object... data) + { + LogManager.getLogger(targetLog).log(level, String.format(format, data)); + } + + public static void log(Level level, String format, Object... data) + { + if (!configured) + { + configureLogging(); + } + log.myLog.log(level, String.format(format, data)); + } + + public static void log(String targetLog, Level level, Throwable ex, String format, Object... data) + { + LogManager.getLogger(targetLog).log(level, String.format(format, data), ex); + } + + public static void log(Level level, Throwable ex, String format, Object... data) + { + if (!configured) + { + configureLogging(); + } + log.myLog.log(level, String.format(format, data), ex); + } + + public static void severe(String format, Object... data) + { + log(Level.ERROR, format, data); + } + + public static void warning(String format, Object... data) + { + log(Level.WARN, format, data); + } + + public static void info(String format, Object... data) + { + log(Level.INFO, format, data); + } + + public static void fine(String format, Object... data) + { + log(Level.DEBUG, format, data); + } + + public static void finer(String format, Object... data) + { + log(Level.TRACE, format, data); + } + + public Logger getLogger() + { + return myLog; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLSecurityManager.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLSecurityManager.java new file mode 100644 index 0000000..fff0144 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FMLSecurityManager.java @@ -0,0 +1,38 @@ +package cpw.mods.fml.relauncher; + +import java.security.Permission; + +/** + * A custom security manager stopping certain events from happening + * unexpectedly. + * + * @author cpw + * + */ +public class FMLSecurityManager extends SecurityManager { + @Override + public void checkPermission(Permission perm) + { + String permName = perm.getName() != null ? perm.getName() : "missing"; + if (permName.startsWith("exitVM")) + { + Class[] classContexts = getClassContext(); + String callingClass = classContexts.length > 3 ? classContexts[4].getName() : "none"; + String callingParent = classContexts.length > 4 ? classContexts[5].getName() : "none"; + // FML is allowed to call system exit and the Minecraft applet (from the quit button) + if (!(callingClass.startsWith("cpw.mods.fml.") || ( "net.minecraft.client.Minecraft".equals(callingClass) && "net.minecraft.client.Minecraft".equals(callingParent)) || ("net.minecraft.server.dedicated.DedicatedServer".equals(callingClass) && "net.minecraft.server.MinecraftServer".equals(callingParent)))) + { + throw new ExitTrappedException(); + } + } + else if ("setSecurityManager".equals(permName)) + { + throw new SecurityException("Cannot replace the FML security manager"); + } + return; + } + + public static class ExitTrappedException extends SecurityException { + private static final long serialVersionUID = 1L; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FileListHelper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FileListHelper.java new file mode 100644 index 0000000..d5ff18f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/FileListHelper.java @@ -0,0 +1,29 @@ +package cpw.mods.fml.relauncher; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.Arrays; +import java.util.Comparator; + +public final class FileListHelper { + private static enum CaseInsensitiveFileComparator implements Comparator + { + INSTANCE; + @Override + public int compare(File o1, File o2) + { + return o1 != null && o2 != null ? o1.getName().compareToIgnoreCase(o2.getName()) : o1 == null ? -1 : 1; + } + + } + public static File[] sortFileList(File[] files) + { + Arrays.sort(files, CaseInsensitiveFileComparator.INSTANCE); + return files; + } + public static File[] sortFileList(File dir, FilenameFilter filter) + { + File[] files = dir.listFiles(filter); + return sortFileList(files); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLCallHook.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLCallHook.java new file mode 100644 index 0000000..97319d5 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLCallHook.java @@ -0,0 +1,34 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.util.Map; +import java.util.concurrent.Callable; + +/** + * This call hook allows for code to execute at the very early stages of + * minecraft initialization. FML uses it to validate that there is a + * safe environment for further loading of FML. + * + * @author cpw + * + */ +public interface IFMLCallHook extends Callable +{ + /** + * Injected with data from the FML environment: + * "classLoader" : The FML Class Loader + * @param data + */ + void injectData(Map data); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLLoadingPlugin.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLLoadingPlugin.java new file mode 100644 index 0000000..89fc746 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/IFMLLoadingPlugin.java @@ -0,0 +1,136 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Map; + +/** + * The base plugin that provides class name meta information to FML to + * enhance the classloading lifecycle for mods in FML + * + * @author cpw + * + */ +public interface IFMLLoadingPlugin +{ + /** + * Return a list of classes that implements the IClassTransformer interface + * @return a list of classes that implements the IClassTransformer interface + */ + String[] getASMTransformerClass(); + + /** + * Return a class name that implements "ModContainer" for injection into the mod list + * The "getName" function should return a name that other mods can, if need be, + * depend on. + * Trivially, this modcontainer will be loaded before all regular mod containers, + * which means it will be forced to be "immutable" - not susceptible to normal + * sorting behaviour. + * All other mod behaviours are available however- this container can receive and handle + * normal loading events + */ + String getModContainerClass(); + + /** + * Return the class name of an implementor of "IFMLCallHook", that will be run, in the + * main thread, to perform any additional setup this coremod may require. It will be + * run prior to Minecraft starting, so it CANNOT operate on minecraft + * itself. The game will deliberately crash if this code is detected to trigger a + * minecraft class loading (TODO: implement crash ;) ) + */ + String getSetupClass(); + + /** + * Inject coremod data into this coremod + * This data includes: + * "mcLocation" : the location of the minecraft directory, + * "coremodList" : the list of coremods + * "coremodLocation" : the file this coremod loaded from, + */ + void injectData(Map data); + + /** + * Return an optional access transformer class for this coremod. It will be injected post-deobf + * so ensure your ATs conform to the new srgnames scheme. + * @return the name of an access transformer class or null if none is provided + */ + String getAccessTransformerClass(); + + /** + * Annotate your load plugin with a list of package prefixes that will *not* be + * processed by the ASM transformation stack. + * + * Your plugin, and any transformers should *definitely* be in this list, because + * otherwise you can face problems with the classloader trying to transform classes + * with your transformer, whilst it is *loading* your transformer. Not pretty. + * + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface TransformerExclusions + { + public String[] value() default ""; + } + + /** + * Use this to target a specific minecraft version for your coremod. It will refuse to load with an error if + * minecraft is not this exact version. + * + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface MCVersion + { + public String value() default ""; + } + + /** + * Name this coremod something other than the "short class name" + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface Name + { + public String value() default ""; + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface DependsOn + { + public String[] value() default {}; + } + + /** + * A simple sorting index, interleaved with other tweakers from other sources, as well as FML + * @author cpw + * + */ + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.TYPE) + public @interface SortingIndex + { + public int value() default 0; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ModListHelper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ModListHelper.java new file mode 100644 index 0000000..0e66acc --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ModListHelper.java @@ -0,0 +1,128 @@ +package cpw.mods.fml.relauncher; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.launchwrapper.Launch; +import org.apache.logging.log4j.Level; +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; + +public class ModListHelper { + public static class JsonModList { + public String repositoryRoot; + public List modRef; + public String parentList; + } + private static File mcDirectory; + private static Set visitedFiles = Sets.newHashSet(); + public static final Map additionalMods = Maps.newLinkedHashMap(); + static void parseModList(File minecraftDirectory) + { + FMLRelaunchLog.fine("Attempting to load commandline specified mods, relative to %s", minecraftDirectory.getAbsolutePath()); + mcDirectory = minecraftDirectory; + @SuppressWarnings("unchecked") + Map args = (Map) Launch.blackboard.get("launchArgs"); + String listFile = args.get("--modListFile"); + if (listFile != null) + { + parseListFile(listFile); + } + String extraMods = args.get("--mods"); + if (extraMods != null) + { + String[] split = extraMods.split(","); + for (String modFile : split) + { + tryAddFile(modFile, null, modFile); + } + } + } + private static void parseListFile(String listFile) { + File f; + try + { + f = new File(mcDirectory, listFile).getCanonicalFile(); + } catch (IOException e2) + { + FMLRelaunchLog.log(Level.INFO, e2, "Unable to canonicalize path %s relative to %s", listFile, mcDirectory.getAbsolutePath()); + return; + } + if (!f.exists()) + { + FMLRelaunchLog.info("Failed to find modList file %s", f.getAbsolutePath()); + return; + } + if (visitedFiles.contains(f)) + { + FMLRelaunchLog.severe("There appears to be a loop in the modListFile hierarchy. You shouldn't do this!"); + throw new RuntimeException("Loop detected, impossible to load modlistfile"); + } + String json; + try { + json = Files.asCharSource(f, Charsets.UTF_8).read(); + } catch (IOException e1) { + FMLRelaunchLog.log(Level.INFO, e1, "Failed to read modList json file %s.", listFile); + return; + } + Gson gsonParser = new Gson(); + JsonModList modList; + try { + modList = gsonParser.fromJson(json, JsonModList.class); + } catch (JsonSyntaxException e) { + FMLRelaunchLog.log(Level.INFO, e, "Failed to parse modList json file %s.", listFile); + return; + } + visitedFiles.add(f); + // We visit parents before children, so the additionalMods list is sorted from parent to child + if (modList.parentList != null) + { + parseListFile(modList.parentList); + } + File repoRoot = new File(modList.repositoryRoot); + if (!repoRoot.exists()) + { + FMLRelaunchLog.info("Failed to find the specified repository root %s", modList.repositoryRoot); + return; + } + + for (String s : modList.modRef) + { + StringBuilder fileName = new StringBuilder(); + StringBuilder genericName = new StringBuilder(); + String[] parts = s.split(":"); + fileName.append(parts[0].replace('.', File.separatorChar)); + genericName.append(parts[0]); + fileName.append(File.separatorChar); + fileName.append(parts[1]).append(File.separatorChar); + genericName.append(":").append(parts[1]); + fileName.append(parts[2]).append(File.separatorChar); + fileName.append(parts[1]).append('-').append(parts[2]); + if (parts.length == 4) + { + fileName.append('-').append(parts[3]); + genericName.append(":").append(parts[3]); + } + fileName.append(".jar"); + tryAddFile(fileName.toString(), repoRoot, genericName.toString()); + } + } + private static void tryAddFile(String modFileName, File repoRoot, String descriptor) { + File modFile = repoRoot != null ? new File(repoRoot,modFileName) : new File(mcDirectory, modFileName); + if (!modFile.exists()) + { + FMLRelaunchLog.info("Failed to find mod file %s (%s)", descriptor, modFile.getAbsolutePath()); + } + else + { + FMLRelaunchLog.fine("Adding %s (%s) to the mod list", descriptor, modFile.getAbsolutePath()); + additionalMods.put(descriptor, modFile); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ReflectionHelper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ReflectionHelper.java new file mode 100644 index 0000000..7f2e62f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ReflectionHelper.java @@ -0,0 +1,189 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.relauncher; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +/** + * Some reflection helper code. + * + * @author cpw + * + */ +public class ReflectionHelper +{ + public static class UnableToFindMethodException extends RuntimeException + { + private static final long serialVersionUID = 1L; + @SuppressWarnings("unused") + private String[] methodNames; + + public UnableToFindMethodException(String[] methodNames, Exception failed) + { + super(failed); + this.methodNames = methodNames; + } + + } + + public static class UnableToFindClassException extends RuntimeException + { + private static final long serialVersionUID = 1L; + @SuppressWarnings("unused") + private String[] classNames; + + public UnableToFindClassException(String[] classNames, Exception err) + { + super(err); + this.classNames = classNames; + } + + } + + public static class UnableToAccessFieldException extends RuntimeException + { + private static final long serialVersionUID = 1L; + @SuppressWarnings("unused") + private String[] fieldNameList; + + public UnableToAccessFieldException(String[] fieldNames, Exception e) + { + super(e); + this.fieldNameList = fieldNames; + } + } + + public static class UnableToFindFieldException extends RuntimeException + { + private static final long serialVersionUID = 1L; + @SuppressWarnings("unused") + private String[] fieldNameList; + public UnableToFindFieldException(String[] fieldNameList, Exception e) + { + super(e); + this.fieldNameList = fieldNameList; + } + } + + public static Field findField(Class clazz, String... fieldNames) + { + Exception failed = null; + for (String fieldName : fieldNames) + { + try + { + Field f = clazz.getDeclaredField(fieldName); + f.setAccessible(true); + return f; + } + catch (Exception e) + { + failed = e; + } + } + throw new UnableToFindFieldException(fieldNames, failed); + } + + @SuppressWarnings("unchecked") + public static T getPrivateValue(Class classToAccess, E instance, int fieldIndex) + { + try + { + Field f = classToAccess.getDeclaredFields()[fieldIndex]; + f.setAccessible(true); + return (T) f.get(instance); + } + catch (Exception e) + { + throw new UnableToAccessFieldException(new String[0], e); + } + } + + @SuppressWarnings("unchecked") + public static T getPrivateValue(Class classToAccess, E instance, String... fieldNames) + { + try + { + return (T) findField(classToAccess, fieldNames).get(instance); + } + catch (Exception e) + { + throw new UnableToAccessFieldException(fieldNames, e); + } + } + + public static void setPrivateValue(Class classToAccess, T instance, E value, int fieldIndex) + { + try + { + Field f = classToAccess.getDeclaredFields()[fieldIndex]; + f.setAccessible(true); + f.set(instance, value); + } + catch (Exception e) + { + throw new UnableToAccessFieldException(new String[0] , e); + } + } + + public static void setPrivateValue(Class classToAccess, T instance, E value, String... fieldNames) + { + try + { + findField(classToAccess, fieldNames).set(instance, value); + } + catch (Exception e) + { + throw new UnableToAccessFieldException(fieldNames, e); + } + } + + @SuppressWarnings("unchecked") + public static Class getClass(ClassLoader loader, String... classNames) + { + Exception err = null; + for (String className : classNames) + { + try + { + return (Class) Class.forName(className, false, loader); + } + catch (Exception e) + { + err = e; + } + } + + throw new UnableToFindClassException(classNames, err); + } + + + public static Method findMethod(Class clazz, E instance, String[] methodNames, Class... methodTypes) + { + Exception failed = null; + for (String methodName : methodNames) + { + try + { + Method m = clazz.getDeclaredMethod(methodName, methodTypes); + m.setAccessible(true); + return m; + } + catch (Exception e) + { + failed = e; + } + } + throw new UnableToFindMethodException(methodNames, failed); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ServerLaunchWrapper.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ServerLaunchWrapper.java new file mode 100644 index 0000000..feccef2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/ServerLaunchWrapper.java @@ -0,0 +1,53 @@ +package cpw.mods.fml.relauncher; + +import java.lang.reflect.Method; + +public class ServerLaunchWrapper { + + /** + * @param args + */ + public static void main(String[] args) + { + new ServerLaunchWrapper().run(args); + } + + private ServerLaunchWrapper() + { + + } + + private void run(String[] args) + { + Class launchwrapper = null; + try + { + launchwrapper = Class.forName("net.minecraft.launchwrapper.Launch",true,getClass().getClassLoader()); + Class.forName("org.objectweb.asm.Type",true,getClass().getClassLoader()); + } + catch (Exception e) + { + System.err.printf("We appear to be missing one or more essential library files.\n" + + "You will need to add them to your server before FML and Forge will run successfully."); + e.printStackTrace(System.err); + System.exit(1); + } + + try + { + Method main = launchwrapper.getMethod("main", String[].class); + String[] allArgs = new String[args.length + 2]; + allArgs[0] = "--tweakClass"; + allArgs[1] = "cpw.mods.fml.common.launcher.FMLServerTweaker"; + System.arraycopy(args, 0, allArgs, 2, args.length); + main.invoke(null,(Object)allArgs); + } + catch (Exception e) + { + System.err.printf("A problem occurred running the Server launcher."); + e.printStackTrace(System.err); + System.exit(1); + } + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/Side.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/Side.java new file mode 100644 index 0000000..70cd077 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/Side.java @@ -0,0 +1,43 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +public enum Side { + + /** + * The client side. Specifically, an environment where rendering capability exists. + * Usually in the game client. + */ + CLIENT, + /** + * The server side. Specifically, an environment where NO rendering capability exists. + * Usually on the dedicated server. + */ + SERVER; + + /** + * @return If this is the server environment + */ + public boolean isServer() + { + return !isClient(); + } + + /** + * @return if this is the Client environment + */ + public boolean isClient() + { + return this == CLIENT; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/SideOnly.java b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/SideOnly.java new file mode 100644 index 0000000..6581a50 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/relauncher/SideOnly.java @@ -0,0 +1,41 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package cpw.mods.fml.relauncher; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import cpw.mods.fml.common.SidedProxy; + + +/** + * Marks the associated element as being only available on a certain {@link Side}. This is + * generally meant for internal Forge and FML use only and should only be used on mod classes + * when other more common mechanisms, such as using a {@link SidedProxy} fail to work. + * + * Note, this will only apply to the direct element marked. This code: + * @SideOnly public MyField field = new MyField(); will not work, as the initializer + * is a separate piece of code to the actual field declaration, and will not be able to find + * it's field on the wrong side. + * + * @author cpw + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) +public @interface SideOnly +{ + public Side value(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.java new file mode 100644 index 0000000..78410b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/ByteBufferSeekableSource.java @@ -0,0 +1,100 @@ +/* + * ByteArraySeekableSource.java + * + * Created on May 17, 2006, 12:41 PM + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.IOException; +import java.nio.ByteBuffer; + +/** + * Wraps a byte buffer as a source + */ +public class ByteBufferSeekableSource implements SeekableSource { + + private ByteBuffer bb; + private ByteBuffer cur; + + /** + * Constructs a new ByteArraySeekableSource. + */ + public ByteBufferSeekableSource(byte[] source) { + this(ByteBuffer.wrap(source)); + } + + /** + * Constructs a new ByteArraySeekableSource. + */ + public ByteBufferSeekableSource(ByteBuffer bb) { + if (bb == null) + throw new NullPointerException("bb"); + this.bb = bb; + bb.rewind(); + try { + seek(0); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void seek(long pos) throws IOException { + cur = bb.slice(); + if (pos > cur.limit()) + throw new IOException("pos " + pos + " cannot seek " + cur.limit()); + cur.position((int) pos); + } + + @Override + public int read(ByteBuffer dest) throws IOException { + if (!cur.hasRemaining()) + return -1; + int c = 0; + while (cur.hasRemaining() && dest.hasRemaining()) { + dest.put(cur.get()); + c++; + } + return c; + } + + @Override + public void close() throws IOException { + bb = null; + cur = null; + } + + /** + * Returns a debug String. + */ + @Override + public String toString() + { + return "BBSeekable" + + " bb=" + this.bb.position() + "-" + bb.limit() + + " cur=" + this.cur.position() + "-" + cur.limit() + + ""; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Checksum.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Checksum.java new file mode 100644 index 0000000..fbe83d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Checksum.java @@ -0,0 +1,162 @@ +/* + * + * Copyright (c) 2001 Torgeir Veimo + * Copyright (c) 2002 Nicolas PERIDONT + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Map; + +import com.google.common.collect.Maps; + +/** + * Checksum computation class. + */ +public class Checksum { + + static final boolean debug = false; + + private Map checksums = Maps.newHashMap(); + + private static final char single_hash[] = { + /* Random numbers generated using SLIB's pseudo-random number generator. */ + 0xbcd1, 0xbb65, 0x42c2, 0xdffe, 0x9666, 0x431b, 0x8504, 0xeb46, + 0x6379, 0xd460, 0xcf14, 0x53cf, 0xdb51, 0xdb08, 0x12c8, 0xf602, + 0xe766, 0x2394, 0x250d, 0xdcbb, 0xa678, 0x02af, 0xa5c6, 0x7ea6, + 0xb645, 0xcb4d, 0xc44b, 0xe5dc, 0x9fe6, 0x5b5c, 0x35f5, 0x701a, + 0x220f, 0x6c38, 0x1a56, 0x4ca3, 0xffc6, 0xb152, 0x8d61, 0x7a58, + 0x9025, 0x8b3d, 0xbf0f, 0x95a3, 0xe5f4, 0xc127, 0x3bed, 0x320b, + 0xb7f3, 0x6054, 0x333c, 0xd383, 0x8154, 0x5242, 0x4e0d, 0x0a94, + 0x7028, 0x8689, 0x3a22, 0x0980, 0x1847, 0xb0f1, 0x9b5c, 0x4176, + 0xb858, 0xd542, 0x1f6c, 0x2497, 0x6a5a, 0x9fa9, 0x8c5a, 0x7743, + 0xa8a9, 0x9a02, 0x4918, 0x438c, 0xc388, 0x9e2b, 0x4cad, 0x01b6, + 0xab19, 0xf777, 0x365f, 0x1eb2, 0x091e, 0x7bf8, 0x7a8e, 0x5227, + 0xeab1, 0x2074, 0x4523, 0xe781, 0x01a3, 0x163d, 0x3b2e, 0x287d, + 0x5e7f, 0xa063, 0xb134, 0x8fae, 0x5e8e, 0xb7b7, 0x4548, 0x1f5a, + 0xfa56, 0x7a24, 0x900f, 0x42dc, 0xcc69, 0x02a0, 0x0b22, 0xdb31, + 0x71fe, 0x0c7d, 0x1732, 0x1159, 0xcb09, 0xe1d2, 0x1351, 0x52e9, + 0xf536, 0x5a4f, 0xc316, 0x6bf9, 0x8994, 0xb774, 0x5f3e, 0xf6d6, + 0x3a61, 0xf82c, 0xcc22, 0x9d06, 0x299c, 0x09e5, 0x1eec, 0x514f, + 0x8d53, 0xa650, 0x5c6e, 0xc577, 0x7958, 0x71ac, 0x8916, 0x9b4f, + 0x2c09, 0x5211, 0xf6d8, 0xcaaa, 0xf7ef, 0x287f, 0x7a94, 0xab49, + 0xfa2c, 0x7222, 0xe457, 0xd71a, 0x00c3, 0x1a76, 0xe98c, 0xc037, + 0x8208, 0x5c2d, 0xdfda, 0xe5f5, 0x0b45, 0x15ce, 0x8a7e, 0xfcad, + 0xaa2d, 0x4b5c, 0xd42e, 0xb251, 0x907e, 0x9a47, 0xc9a6, 0xd93f, + 0x085e, 0x35ce, 0xa153, 0x7e7b, 0x9f0b, 0x25aa, 0x5d9f, 0xc04d, + 0x8a0e, 0x2875, 0x4a1c, 0x295f, 0x1393, 0xf760, 0x9178, 0x0f5b, + 0xfa7d, 0x83b4, 0x2082, 0x721d, 0x6462, 0x0368, 0x67e2, 0x8624, + 0x194d, 0x22f6, 0x78fb, 0x6791, 0xb238, 0xb332, 0x7276, 0xf272, + 0x47ec, 0x4504, 0xa961, 0x9fc8, 0x3fdc, 0xb413, 0x007a, 0x0806, + 0x7458, 0x95c6, 0xccaa, 0x18d6, 0xe2ae, 0x1b06, 0xf3f6, 0x5050, + 0xc8e8, 0xf4ac, 0xc04c, 0xf41c, 0x992f, 0xae44, 0x5f1b, 0x1113, + 0x1738, 0xd9a8, 0x19ea, 0x2d33, 0x9698, 0x2fe9, 0x323f, 0xcde2, + 0x6d71, 0xe37d, 0xb697, 0x2c4f, 0x4373, 0x9102, 0x075d, 0x8e25, + 0x1672, 0xec28, 0x6acb, 0x86cc, 0x186e, 0x9414, 0xd674, 0xd1a5 + }; + + /** + * Initialize checksums for source. The checksum for the chunkSize bytes at offset + * chunkSize * i is inserted into a hash map. + */ + public Checksum(SeekableSource source, int chunkSize) throws IOException { + ByteBuffer bb = ByteBuffer.allocate(chunkSize * 2); + int count = 0; + while (true) { + source.read(bb); + bb.flip(); + if (bb.remaining() < chunkSize) + break; + while (bb.remaining() >= chunkSize) { + long queryChecksum = queryChecksum0(bb, chunkSize); + checksums.put(queryChecksum, count++); + } + bb.compact(); + } + } + + /** + * Finds the checksum computed from the buffer. + * Marks, gets, then resets the buffer. + */ + public static long queryChecksum(ByteBuffer bb, int len) { + bb.mark(); + long sum = queryChecksum0(bb, len); + bb.reset(); + return sum; + } + + private static long queryChecksum0(ByteBuffer bb, int len) { + int high = 0; int low = 0; + for (int i = 0; i < len; i++) { + low += single_hash[bb.get()+128]; + high += low; + } + return ((high & 0xffff) << 16) | (low & 0xffff); + } + + /** + * Increments a checksum. + * @param checksum initial checksum + * @param out byte leaving view + * @param in byte entering view + * @param chunkSize size of chunks + * @return new checksum + */ + public static long incrementChecksum(long checksum, byte out, byte in, int chunkSize) { + char old_c = single_hash[out+128]; + char new_c = single_hash[in+128]; + int low = ((int)((checksum) & 0xffff) - old_c + new_c) & 0xffff; + int high = ((int)((checksum) >> 16) - (old_c * chunkSize) + low) & 0xffff; + return (high << 16) | (low & 0xffff); + } + + /** + * 256 random hash values. + */ + public static char[] getSingleHash() { + return single_hash; + } + + /** + * Finds the index of a checksum. + */ + public int findChecksumIndex(long hashf) { + if (!checksums.containsKey(hashf)) + return -1; + return checksums.get(hashf); + } + + /** + * Returns a debug String. + */ + @Override + public String toString() + { + return super.toString() + + " checksums=" + this.checksums; + } + + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.java new file mode 100644 index 0000000..3424bf2 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DebugDiffWriter.java @@ -0,0 +1,78 @@ +/* + * + * Copyright (c) 2001 Torgeir Veimo + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +/** + * For debugging patch generation. + */ +public class DebugDiffWriter implements DiffWriter { + + private ByteArrayOutputStream os = new ByteArrayOutputStream(); + + /** + * Constructs a new DebugDiffWriter. + */ + public DebugDiffWriter() {} + + @Override + public void addCopy(long offset, int length) throws IOException { + if (os.size() > 0) + writeBuf(); + System.err.println("COPY off: " + offset + ", len: " + length); + } + + @Override + public void addData(byte b) throws IOException { + os.write(b); + writeBuf(); + } + private void writeBuf() { + System.err.print("DATA: "); + byte[] ba = os.toByteArray(); + for (int ix = 0; ix < ba.length; ix++) { + if (ba[ix] == '\n') + System.err.print("\\n"); + else + System.err.print(String.valueOf((char)((char) ba[ix]))); + //System.err.print("0x" + Integer.toHexString(buf[ix]) + " "); // hex output + } + System.err.println(""); + os.reset(); + } + + @Override + public void flush() throws IOException { + System.err.println("FLUSH"); + } + @Override + public void close() throws IOException { + System.err.println("CLOSE"); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Delta.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Delta.java new file mode 100644 index 0000000..0caca41 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/Delta.java @@ -0,0 +1,447 @@ + /* + * + * Copyright (c) 2001 Torgeir Veimo + * Copyright (c) 2002 Nicolas PERIDONT + * Bug Fixes: Daniel Morrione dan@morrione.net + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Change Log: + * iiimmddyyn nnnnn Description + * ---------- ----- ------------------------------------------------------- + * gls100603a Fixes from Torgeir Veimo and Dan Morrione + * gls110603a Stream not being closed thus preventing a file from + * being subsequently deleted. + * gls031504a Error being written to stderr rather than throwing exception + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; + +/** + * Class for computing deltas against a source. + * The source file is read by blocks and a hash is computed per block. + * Then the target is scanned for matching blocks. + *

+ * This class is not thread safe. Use one instance per thread. + *

+ * This class should support files over 4GB in length, although you must + * use a larger checksum size, such as 1K, as all checksums use "int" indexing. + * Newer versions may eventually support paging in/out of checksums. + */ +public class Delta { + + /** + * Debug flag. + */ + final static boolean debug = false; + + /** + * Default size of 16. + * For "Lorem ipsum" text files (see the tests) the ideal size is about 14. + * Any smaller and the patch size becomes actually be larger. + *

+ * Use a size like 64 or 128 for large files. + */ + public static final int DEFAULT_CHUNK_SIZE = 1<<4; + + /** + * Chunk Size. + */ + private int S; + + private SourceState source; + private TargetState target; + private DiffWriter output; + + /** + * Constructs a new Delta. + * In the future, additional constructor arguments will set the algorithm details. + */ + public Delta() { + setChunkSize(DEFAULT_CHUNK_SIZE); + } + + /** + * Sets the chunk size used. + * Larger chunks are faster and use less memory, but create larger patches + * as well. + * + * @param size + */ + public void setChunkSize(int size) { + if (size <= 0) + throw new IllegalArgumentException("Invalid size"); + S = size; + } + + /** + * Compares the source bytes with target bytes, writing to output. + */ + public void compute(byte source[], byte target[], OutputStream output) + throws IOException { + compute(new ByteBufferSeekableSource(source), + new ByteArrayInputStream(target), + new GDiffWriter(output)); + } + + /** + * Compares the source bytes with target bytes, returning output. + */ + public byte[] compute(byte source[], byte target[]) + throws IOException { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + compute(source, target, os); + return os.toByteArray(); + } + + /** + * Compares the source bytes with target input, writing to output. + */ + public void compute(byte[] sourceBytes, InputStream inputStream, + DiffWriter diffWriter) throws IOException + { + compute(new ByteBufferSeekableSource(sourceBytes), + inputStream, diffWriter); + } + + /** + * Compares the source file with a target file, writing to output. + * + * @param output will be closed + */ + public void compute(File sourceFile, File targetFile, DiffWriter output) + throws IOException { + RandomAccessFileSeekableSource source = new RandomAccessFileSeekableSource(new RandomAccessFile(sourceFile, "r")); + InputStream is = new BufferedInputStream(new FileInputStream(targetFile)); + try { + compute(source, is, output); + } finally { + source.close(); + is.close(); + } + } + + /** + * Compares the source with a target, writing to output. + * + * @param output will be closed + */ + public void compute(SeekableSource seekSource, InputStream targetIS, DiffWriter output) + throws IOException { + + if (debug) { + debug("using match length S = " + S); + } + + source = new SourceState(seekSource); + target = new TargetState(targetIS); + this.output = output; + if (debug) + debug("checksums " + source.checksum); + + while (!target.eof()) { + debug("!target.eof()"); + int index = target.find(source); + if (index != -1) { + if (debug) + debug("found hash " + index); + long offset = (long)index * S; + source.seek(offset); + int match = target.longestMatch(source); + if (match >= S) { + if (debug) + debug("output.addCopy("+offset+","+match+")"); + output.addCopy(offset, match); + } else { + // move the position back according to how much we can't copy + target.tbuf.position(target.tbuf.position() - match); + addData(); + } + } else { + addData(); + } + } + output.close(); + } + + private void addData() throws IOException { + int i = target.read(); + if (debug) + debug("addData " + Integer.toHexString(i)); + if (i == -1) + return; + output.addData((byte)i); + } + + class SourceState { + + private Checksum checksum; + private SeekableSource source; + + public SourceState(SeekableSource source) throws IOException { + checksum = new Checksum(source, S); + this.source = source; + source.seek(0); + } + + public void seek(long index) throws IOException { + source.seek(index); + } + + /** + * Returns a debug String. + */ + @Override + public String toString() + { + return "Source"+ + " checksum=" + this.checksum + + " source=" + this.source + + ""; + } + + } + + class TargetState { + + private ReadableByteChannel c; + private ByteBuffer tbuf = ByteBuffer.allocate(blocksize()); + private ByteBuffer sbuf = ByteBuffer.allocate(blocksize()); + private long hash; + private boolean hashReset = true; + private boolean eof; + + TargetState(InputStream targetIS) throws IOException { + c = Channels.newChannel(targetIS); + tbuf.limit(0); + } + + private int blocksize() { + return Math.min(1024 * 16, S * 4); + } + + /** + * Returns the index of the next N bytes of the stream. + */ + public int find(SourceState source) throws IOException { + if (eof) + return -1; + sbuf.clear(); + sbuf.limit(0); + if (hashReset) { + debug("hashReset"); + while (tbuf.remaining() < S) { + tbuf.compact(); + int read = c.read(tbuf); + tbuf.flip(); + if (read == -1) { + debug("target ending"); + return -1; + } + } + hash = Checksum.queryChecksum(tbuf, S); + hashReset = false; + } + if (debug) + debug("hash " + hash + " " + dump()); + return source.checksum.findChecksumIndex(hash); + } + + public boolean eof() { + return eof; + } + + /** + * Reads a byte. + * @throws IOException + */ + public int read() throws IOException { + if (tbuf.remaining() <= S) { + readMore(); + if (!tbuf.hasRemaining()) { + eof = true; + return -1; + } + } + byte b = tbuf.get(); + if (tbuf.remaining() >= S) { + byte nchar = tbuf.get( tbuf.position() + S -1 ); + hash = Checksum.incrementChecksum(hash, b, nchar, S); + } else { + debug("out of char"); + } + return b & 0xFF; + } + + /** + * Returns the longest match length at the source location. + */ + public int longestMatch(SourceState source) throws IOException { + debug("longestMatch"); + int match = 0; + hashReset = true; + while (true) { + if (!sbuf.hasRemaining()) { + sbuf.clear(); + int read = source.source.read(sbuf); + sbuf.flip(); + if (read == -1) + return match; + } + if (!tbuf.hasRemaining()) { + readMore(); + if (!tbuf.hasRemaining()) { + debug("target ending"); + eof = true; + return match; + } + } + if (sbuf.get() != tbuf.get()) { + tbuf.position(tbuf.position() - 1); + return match; + } + match++; + } + } + + private void readMore() throws IOException { + if (debug) + debug("readMore " + tbuf); + tbuf.compact(); + c.read(tbuf); + tbuf.flip(); + } + + void hash() { + hash = Checksum.queryChecksum(tbuf, S); + } + + /** + * Returns a debug String. + */ + @Override + public String toString() + { + return "Target[" + + " targetBuff=" + dump() + // this.tbuf + + " sourceBuff=" + this.sbuf + + " hashf=" + this.hash + + " eof=" + this.eof + + "]"; + } + + private String dump() { return dump(tbuf); } + + private String dump(ByteBuffer bb) { + return getTextDump(bb); + } + + private void append(StringBuffer sb, int value) { + char b1 = (char)((value >> 4) & 0x0F); + char b2 = (char)((value) & 0x0F); + sb.append( Character.forDigit(b1, 16) ); + sb.append( Character.forDigit(b2, 16) ); + } + + public String getTextDump(ByteBuffer bb) + { + StringBuffer sb = new StringBuffer(bb.remaining() * 2); + bb.mark(); + while (bb.hasRemaining()) { + int val = bb.get(); + if (val > 32 && val < 127) + sb.append(" ").append((char)val); + else + append(sb, val); + } + bb.reset(); + return sb.toString(); + } + + } + + /** + * Creates a patch using file names. + */ + public static void main(String argv[]) throws Exception { + if (argv.length != 3) { + System.err.println("usage Delta [-d] source target [output]"); + System.err.println("either -d or an output filename must be specified."); + System.err.println("aborting.."); + return; + } + DiffWriter output = null; + File sourceFile = null; + File targetFile = null; + if (argv[0].equals("-d")) { + sourceFile = new File(argv[1]); + targetFile = new File(argv[2]); + output = new DebugDiffWriter(); + } else { + sourceFile = new File(argv[0]); + targetFile = new File(argv[1]); + output = + new GDiffWriter( + new DataOutputStream( + new BufferedOutputStream( + new FileOutputStream(new File(argv[2]))))); + } + + if (sourceFile.length() > Integer.MAX_VALUE + || targetFile.length() > Integer.MAX_VALUE) { + System.err.println( + "source or target is too large, max length is " + + Integer.MAX_VALUE); + System.err.println("aborting.."); + output.close(); + return; + } + + Delta d = new Delta(); + d.compute(sourceFile, targetFile, output); + + output.flush(); + output.close(); + if (debug) //gls031504a + System.out.println("finished generating delta"); + } + + private void debug(String s) { + if (debug) + System.err.println(s); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.java new file mode 100644 index 0000000..965c8d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/DiffWriter.java @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2001 Torgeir Veimo + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.Closeable; +import java.io.IOException; + +/** + * Interface for DIFF writers. + */ +public interface DiffWriter extends Closeable { + + /** + * Add a GDIFF copy instruction. + */ + public void addCopy(long offset, int length) throws IOException; + + /** + * Add a GDIFF data instruction. + * Implementors should buffer the data. + */ + public void addData(byte b) throws IOException; + + /** + * Flushes to output, e.g. any data added. + */ + public void flush() throws IOException; + + /** + * Closes this stream. + * Note that {@link DiffWriter} will invoke this method at the end. + */ + @Override + public void close() throws IOException; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.java new file mode 100644 index 0000000..a809de7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffPatcher.java @@ -0,0 +1,245 @@ +/* + * + * Copyright (c) 2001 Torgeir Veimo + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_INT_INT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_INT_UBYTE; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_INT_USHORT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_LONG_INT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_USHORT_INT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_USHORT_UBYTE; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.COPY_USHORT_USHORT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.DATA_INT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.DATA_MAX; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.DATA_USHORT; +import static cpw.mods.fml.repackage.com.nothome.delta.GDiffWriter.EOF; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.EOFException; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; + +/** + * This class patches an input file with a GDIFF patch file. + * + * The patch file follows the GDIFF file specification available at + * + * http://www.w3.org/TR/NOTE-gdiff-19970901.html. + */ +public class GDiffPatcher { + + private ByteBuffer buf = ByteBuffer.allocate(1024); + private byte buf2[] = buf.array(); + + /** + * Constructs a new GDiffPatcher. + */ + public GDiffPatcher() { + } + + /** + * Patches to an output file. + */ + public void patch(File sourceFile, File patchFile, File outputFile) + throws IOException + { + RandomAccessFileSeekableSource source =new RandomAccessFileSeekableSource(new RandomAccessFile(sourceFile, "r")); + InputStream patch = new FileInputStream(patchFile); + OutputStream output = new FileOutputStream(outputFile); + try { + patch(source, patch, output); + } catch (IOException e) { + throw e; + } finally { + source.close(); + patch.close(); + output.close(); + } + } + + /** + * Patches to an output stream. + */ + public void patch(byte[] source, InputStream patch, OutputStream output) throws IOException { + patch(new ByteBufferSeekableSource(source), patch, output); + } + + /** + * Patches in memory, returning the patch result. + */ + public byte[] patch(byte[] source, byte[] patch) throws IOException { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + patch(source, new ByteArrayInputStream(patch), os); + return os.toByteArray(); + } + + /** + * Patches to an output stream. + */ + public void patch(SeekableSource source, InputStream patch, OutputStream out) throws IOException { + + DataOutputStream outOS = new DataOutputStream(out); + DataInputStream patchIS = new DataInputStream(patch); + + // the magic string is 'd1 ff d1 ff' + the version number + if (patchIS.readUnsignedByte() != 0xd1 || + patchIS.readUnsignedByte() != 0xff || + patchIS.readUnsignedByte() != 0xd1 || + patchIS.readUnsignedByte() != 0xff || + patchIS.readUnsignedByte() != 0x04) { + + throw new PatchException("magic string not found, aborting!"); + } + + while (true) { + int command = patchIS.readUnsignedByte(); + if (command == EOF) + break; + int length; + int offset; + + if (command <= DATA_MAX) { + append(command, patchIS, outOS); + continue; + } + + switch (command) { + case DATA_USHORT: // ushort, n bytes following; append + length = patchIS.readUnsignedShort(); + append(length, patchIS, outOS); + break; + case DATA_INT: // int, n bytes following; append + length = patchIS.readInt(); + append(length, patchIS, outOS); + break; + case COPY_USHORT_UBYTE: + offset = patchIS.readUnsignedShort(); + length = patchIS.readUnsignedByte(); + copy(offset, length, source, outOS); + break; + case COPY_USHORT_USHORT: + offset = patchIS.readUnsignedShort(); + length = patchIS.readUnsignedShort(); + copy(offset, length, source, outOS); + break; + case COPY_USHORT_INT: + offset = patchIS.readUnsignedShort(); + length = patchIS.readInt(); + copy(offset, length, source, outOS); + break; + case COPY_INT_UBYTE: + offset = patchIS.readInt(); + length = patchIS.readUnsignedByte(); + copy(offset, length, source, outOS); + break; + case COPY_INT_USHORT: + offset = patchIS.readInt(); + length = patchIS.readUnsignedShort(); + copy(offset, length, source, outOS); + break; + case COPY_INT_INT: + offset = patchIS.readInt(); + length = patchIS.readInt(); + copy(offset, length, source, outOS); + break; + case COPY_LONG_INT: + long loffset = patchIS.readLong(); + length = patchIS.readInt(); + copy(loffset, length, source, outOS); + break; + default: + throw new IllegalStateException("command " + command); + } + } + outOS.flush(); + } + + private void copy(long offset, int length, SeekableSource source, OutputStream output) + throws IOException + { + source.seek(offset); + while (length > 0) { + int len = Math.min(buf.capacity(), length); + buf.clear().limit(len); + int res = source.read(buf); + if (res == -1) + throw new EOFException("in copy " + offset + " " + length); + output.write(buf.array(), 0, res); + length -= res; + } + } + + private void append(int length, InputStream patch, OutputStream output) throws IOException { + while (length > 0) { + int len = Math.min(buf2.length, length); + int res = patch.read(buf2, 0, len); + if (res == -1) + throw new EOFException("cannot read " + length); + output.write(buf2, 0, res); + length -= res; + } + } + + /** + * Simple command line tool to patch a file. + */ + public static void main(String argv[]) { + + if (argv.length != 3) { + System.err.println("usage GDiffPatch source patch output"); + System.err.println("aborting.."); + return; + } + try { + File sourceFile = new File(argv[0]); + File patchFile = new File(argv[1]); + File outputFile = new File(argv[2]); + + if (sourceFile.length() > Integer.MAX_VALUE || + patchFile.length() > Integer.MAX_VALUE) { + System.err.println("source or patch is too large, max length is " + Integer.MAX_VALUE); + System.err.println("aborting.."); + return; + } + GDiffPatcher patcher = new GDiffPatcher(); + patcher.patch(sourceFile, patchFile, outputFile); + + System.out.println("finished patching file"); + + } catch (Exception ioe) { //gls031504a + System.err.println("error while patching: " + ioe); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.java new file mode 100644 index 0000000..01730c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/GDiffWriter.java @@ -0,0 +1,177 @@ +/* + * + * Copyright (c) 2001 Torgeir Veimo + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +/** + * Outputs a diff following the GDIFF file specification available at + * http://www.w3.org/TR/NOTE-gdiff-19970901.html. + */ +public class GDiffWriter implements DiffWriter { + + /** + * Max length of a chunk. + */ + public static final int CHUNK_SIZE = Short.MAX_VALUE; + + public static final byte EOF = 0; + + /** + * Max length for single length data encode. + */ + public static final int DATA_MAX = 246; + + public static final int DATA_USHORT = 247; + public static final int DATA_INT = 248; + public static final int COPY_USHORT_UBYTE = 249; + public static final int COPY_USHORT_USHORT = 250; + public static final int COPY_USHORT_INT = 251; + public static final int COPY_INT_UBYTE = 252; + public static final int COPY_INT_USHORT = 253; + public static final int COPY_INT_INT = 254; + public static final int COPY_LONG_INT = 255; + + private ByteArrayOutputStream buf = new ByteArrayOutputStream(); + + private boolean debug = false; + + private DataOutputStream output = null; + + /** + * Constructs a new GDiffWriter. + */ + public GDiffWriter(DataOutputStream os) throws IOException { + this.output = os; + // write magic string "d1 ff d1 ff 04" + output.writeByte(0xd1); + output.writeByte(0xff); + output.writeByte(0xd1); + output.writeByte(0xff); + output.writeByte(0x04); + } + + /** + * Constructs a new GDiffWriter. + */ + public GDiffWriter(OutputStream output) throws IOException { + this(new DataOutputStream(output)); + } + + @Override + public void addCopy(long offset, int length) throws IOException { + writeBuf(); + + //output debug data + if (debug) + System.err.println("COPY off: " + offset + ", len: " + length); + + // output real data + if (offset > Integer.MAX_VALUE) { + // Actually, we don't support longer files than int.MAX_VALUE at the moment.. + output.writeByte(COPY_LONG_INT); + output.writeLong(offset); + output.writeInt(length); + } else if (offset < 65536) { + if (length < 256) { + output.writeByte(COPY_USHORT_UBYTE); + output.writeShort((int)offset); + output.writeByte(length); + } else if (length > 65535) { + output.writeByte(COPY_USHORT_INT); + output.writeShort((int)offset); + output.writeInt(length); + } else { + output.writeByte(COPY_USHORT_USHORT); + output.writeShort((int)offset); + output.writeShort(length); + } + } else { + if (length < 256) { + output.writeByte(COPY_INT_UBYTE); + output.writeInt((int)offset); + output.writeByte(length); + } else if (length > 65535) { + output.writeByte(COPY_INT_INT); + output.writeInt((int)offset); + output.writeInt(length); + } else { + output.writeByte(COPY_INT_USHORT); + output.writeInt((int)offset); + output.writeShort(length); + } + } + } + + /** + * Adds a data byte. + */ + @Override + public void addData(byte b) throws IOException { + buf.write(b); + if (buf.size() >= CHUNK_SIZE) + writeBuf(); + } + + private void writeBuf() throws IOException { + if (buf.size() > 0) { + if (buf.size() <= DATA_MAX) { + output.writeByte(buf.size()); + } else if (buf.size() <= 65535) { + output.writeByte(DATA_USHORT); + output.writeShort(buf.size()); + } else { + output.writeByte(DATA_INT); + output.writeInt(buf.size()); + } + buf.writeTo(output); + buf.reset(); + } + } + + /** + * Flushes accumulated data bytes, if any. + */ + @Override + public void flush() throws IOException + { + writeBuf(); + output.flush(); + } + + /** + * Writes the final EOF byte, closes the underlying stream. + */ + @Override + public void close() throws IOException { + this.flush(); + output.write((byte)EOF); + output.close(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/PatchException.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/PatchException.java new file mode 100644 index 0000000..13fcaf7 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/PatchException.java @@ -0,0 +1,51 @@ +/* + * PatchException.java + * + * Created on June 6, 2006, 9:34 PM + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.IOException; + +/** + * Thrown when a patch is invalid. + */ +public class PatchException extends IOException { + + private static final long serialVersionUID = 1; + + /** + * Creates a new instance of PatchException without detail message. + */ + public PatchException() { + } + + /** + * Constructs an instance of PatchException with the specified detail message. + * @param msg the detail message. + */ + public PatchException(String msg) { + super(msg); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.java new file mode 100644 index 0000000..097431d --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/RandomAccessFileSeekableSource.java @@ -0,0 +1,78 @@ +/* + * RandomAccessFileSeekableSource.java + * + * Created on May 17, 2006, 1:45 PM + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; + +/** + * Wraps a random access file. + */ +public class RandomAccessFileSeekableSource implements SeekableSource { + + private RandomAccessFile raf; + + /** + * Constructs a new RandomAccessFileSeekableSource. + * @param raf + */ + public RandomAccessFileSeekableSource(RandomAccessFile raf) { + if (raf == null) + throw new NullPointerException("raf"); + this.raf = raf; + } + + @Override + public void seek(long pos) throws IOException { + raf.seek(pos); + } + + public int read(byte[] b, int off, int len) throws IOException { + return raf.read(b, off, len); + } + + public long length() throws IOException { + return raf.length(); + } + + @Override + public void close() throws IOException { + raf.close(); + } + + @Override + public int read(ByteBuffer bb) throws IOException { + int c = raf.read(bb.array(), bb.position(), bb.remaining()); + if (c == -1) + return -1; + bb.position(bb.position() + c); + return c; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.java b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.java new file mode 100644 index 0000000..33058d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/repackage/com/nothome/delta/SeekableSource.java @@ -0,0 +1,51 @@ +/* + * SeekableSource.java + * + * Created on May 17, 2006, 12:33 PM + * Copyright (c) 2006 Heiko Klein + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +package cpw.mods.fml.repackage.com.nothome.delta; + +import java.io.Closeable; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; + +/** + * For sources of random-access data, such as {@link RandomAccessFile}. + */ +public interface SeekableSource extends Closeable { + + /** + * Sets the position for the next {@link #read(ByteBuffer)}. + */ + void seek(long pos) throws IOException ; + + /** + * Reads up to {@link ByteBuffer#remaining()} bytes from the source, + * returning the number of bytes read, or -1 if no bytes were read + * and EOF was reached. + */ + int read(ByteBuffer bb) throws IOException; + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/cpw/mods/fml/server/FMLServerHandler.java b/build/rfg/minecraft-src/java/cpw/mods/fml/server/FMLServerHandler.java new file mode 100644 index 0000000..747a38f --- /dev/null +++ b/build/rfg/minecraft-src/java/cpw/mods/fml/server/FMLServerHandler.java @@ -0,0 +1,279 @@ +/* + * The FML Forge Mod Loader suite. Copyright (C) 2012 cpw + * + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package cpw.mods.fml.server; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import net.minecraft.command.ServerCommand; +import net.minecraft.network.INetHandler; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.dedicated.DedicatedServer; +import net.minecraft.world.storage.SaveFormatOld; + +import com.google.common.collect.ImmutableList; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.IFMLSidedHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.common.functions.GenericIterableFactory; +import cpw.mods.fml.common.network.FMLNetworkEvent; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; + +/** + * Handles primary communication from hooked code into the system + * + * The FML entry point is {@link #beginServerLoading(MinecraftServer)} called from + * {@link net.minecraft.server.dedicated.DedicatedServer} + * + * Obfuscated code should focus on this class and other members of the "server" + * (or "client") code + * + * The actual mod loading is handled at arms length by {@link Loader} + * + * It is expected that a similar class will exist for each target environment: + * Bukkit and Client side. + * + * It should not be directly modified. + * + * @author cpw + * + */ +public class FMLServerHandler implements IFMLSidedHandler +{ + /** + * The singleton + */ + private static final FMLServerHandler INSTANCE = new FMLServerHandler(); + + /** + * A reference to the server itself + */ + private MinecraftServer server; + + private FMLServerHandler() + { + FMLCommonHandler.instance().beginLoading(this); + } + /** + * Called to start the whole game off from + * {@link MinecraftServer#startServer} + * + * @param minecraftServer + */ + @Override + public void beginServerLoading(MinecraftServer minecraftServer) + { + server = minecraftServer; + Loader.instance().loadMods(); + Loader.instance().preinitializeMods(); + } + + /** + * Called a bit later on during server initialization to finish loading mods + */ + @Override + public void finishServerLoading() + { + Loader.instance().initializeMods(); + } + + @Override + public void haltGame(String message, Throwable exception) + { + throw new RuntimeException(message, exception); + } + + @Override + public File getSavesDirectory() + { + return ((SaveFormatOld) server.getActiveAnvilConverter()).savesDirectory; + } + + /** + * Get the server instance + */ + @Override + public MinecraftServer getServer() + { + return server; + } + + /** + * @return the instance + */ + public static FMLServerHandler instance() + { + return INSTANCE; + } + + /* (non-Javadoc) + * @see cpw.mods.fml.common.IFMLSidedHandler#getAdditionalBrandingInformation() + */ + @Override + public List getAdditionalBrandingInformation() + { + return ImmutableList.of(); + } + + /* (non-Javadoc) + * @see cpw.mods.fml.common.IFMLSidedHandler#getSide() + */ + @Override + public Side getSide() + { + return Side.SERVER; + } + + @Override + public void showGuiScreen(Object clientGuiElement) + { + + } + + @Override + public void queryUser(StartupQuery query) throws InterruptedException + { + if (query.getResult() == null) + { + FMLLog.warning("%s", query.getText()); + query.finish(); + } + else + { + String text = query.getText() + + "\n\nRun the command /fml confirm or or /fml cancel to proceed." + + "\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer."; + FMLLog.warning("%s", text); + + if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever) + + boolean done = false; + + while (!done && server.isServerRunning()) + { + if (Thread.interrupted()) throw new InterruptedException(); + + DedicatedServer dedServer = (DedicatedServer) server; + + // rudimentary command processing, check for fml confirm/cancel and stop commands + synchronized (dedServer.pendingCommandList) + { + for (Iterator it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); ) + { + String cmd = it.next().command.trim().toLowerCase(); + + if (cmd.equals("/fml confirm")) + { + FMLLog.info("confirmed"); + query.setResult(true); + done = true; + it.remove(); + } + else if (cmd.equals("/fml cancel")) + { + FMLLog.info("cancelled"); + query.setResult(false); + done = true; + it.remove(); + } + else if (cmd.equals("/stop")) + { + StartupQuery.abort(); + } + } + } + + Thread.sleep(10L); + } + + query.finish(); + } + } + + @Override + public boolean shouldServerShouldBeKilledQuietly() + { + return false; + } + @Override + public void addModAsResource(ModContainer container) + { + LanguageRegistry.instance().loadLanguagesFor(container, Side.SERVER); + } + + @Override + public String getCurrentLanguage() + { + return "en_US"; + } + + @Override + public void serverStopped() + { + // NOOP + } + @Override + public NetworkManager getClientToServerNetworkManager() + { + throw new RuntimeException("Missing"); + } + @Override + public INetHandler getClientPlayHandler() + { + return null; + } + @Override + public void waitForPlayClient() + { + // NOOP + } + + @Override + public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set channelSet, String channel, Side side) + { + bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent(manager, channelSet, channel, side, NetHandlerPlayServer.class)); + } + + @Override + public boolean shouldAllowPlayerLogins() + { + return DedicatedServer.allowPlayerLogins; + } + + @Override + public void allowLogins() { + DedicatedServer.allowPlayerLogins = true; + } + + @Override + public void processWindowMessages() + { + // NOOP + } + + @Override + public String stripSpecialChars(String message) + { + return message; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Channel.java b/build/rfg/minecraft-src/java/ibxm/Channel.java new file mode 100644 index 0000000..a255bbc --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Channel.java @@ -0,0 +1,945 @@ + +package ibxm; + +public class Channel { + public int pattern_loop_row; + + private Module module; + private Instrument instrument; + private Sample sample; + private int[] global_volume, current_note; + private boolean linear_periods, fast_volume_slides, key_on, silent; + private int sample_idx, sample_frac, step, left_gain, right_gain; + private int volume, panning, fine_tune, period, porta_period, key_add; + private int tremolo_speed, tremolo_depth, tremolo_tick, tremolo_wave, tremolo_add; + private int vibrato_speed, vibrato_depth, vibrato_tick, vibrato_wave, vibrato_add; + private int volume_slide_param, portamento_param, retrig_param; + private int volume_envelope_tick, panning_envelope_tick; + private int effect_tick, trigger_tick, fade_out_volume, random_seed; + + private int log_2_sampling_rate; + private static final int LOG_2_29024 = LogTable.log_2( 29024 ); + private static final int LOG_2_8287 = LogTable.log_2( 8287 ); + private static final int LOG_2_8363 = LogTable.log_2( 8363 ); + private static final int LOG_2_1712 = LogTable.log_2( 1712 ); + + private static final int[] sine_table = new int[] { + 0, 24 , 49, 74, 97, 120, 141, 161, 180, 197, 212, 224, 235, 244, 250, 253, + 255, 253, 250, 244, 235, 224, 212, 197, 180, 161, 141, 120, 97, 74, 49, 24 + }; + + public Channel( Module mod, int sampling_rate, int[] global_vol ) { + module = mod; + global_volume = global_vol; + linear_periods = module.linear_periods; + fast_volume_slides = module.fast_volume_slides; + current_note = new int[ 5 ]; + log_2_sampling_rate = LogTable.log_2( sampling_rate ); + } + + public void reset() { + tremolo_speed = 0; + tremolo_depth = 0; + tremolo_wave = 0; + vibrato_speed = 0; + vibrato_depth = 0; + vibrato_wave = 0; + volume_slide_param = 0; + portamento_param = 0; + retrig_param = 0; + random_seed = 0xABC123; + instrument = module.get_instrument( 0 ); + row( 48, 256, 0, 0, 0 ); + } + + public void resample( int[] mixing_buffer, int frame_offset, int frames, int quality ) { + if( !silent ) { + switch( quality ) { + default: + sample.resample_nearest( sample_idx, sample_frac, step, left_gain, right_gain, mixing_buffer, frame_offset, frames ); + break; + case 1: + sample.resample_linear( sample_idx, sample_frac, step, left_gain, right_gain, mixing_buffer, frame_offset, frames ); + break; + case 2: + sample.resample_sinc( sample_idx, sample_frac, step, left_gain, right_gain, mixing_buffer, frame_offset, frames ); + break; + } + } + } + + public void update_sample_idx( int samples ) { + sample_frac += step * samples; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + + public void set_volume( int vol ) { + if( vol < 0 ) { + vol = 0; + } + if( vol > 64 ) { + vol = 64; + } + volume = vol; + } + + public void set_panning( int pan ) { + if( pan < 0 ) { + pan = 0; + } + if( pan > 255 ) { + pan = 255; + } + panning = pan; + } + + public void row( int key, int inst_idx, int volume_column, int effect, int effect_param ) { + effect = effect & 0xFF; + if( effect >= 0x30 ) { + /* Effects above 0x30 are internal.*/ + effect = 0; + } + if( effect == 0x00 && effect_param != 0 ) { + /* Arpeggio.*/ + effect = 0x40; + } + if( effect == 0x0E ) { + /* Renumber 0x0Ex effect command.*/ + effect = 0x30 + ( ( effect_param & 0xF0 ) >> 4 ); + effect_param = effect_param & 0x0F; + } + if( effect == 0x21 ) { + /* Renumber 0x21x effect command.*/ + effect = 0x40 + ( ( effect_param & 0xF0 ) >> 4 ); + effect_param = effect_param & 0x0F; + } + current_note[ 0 ] = key; + current_note[ 1 ] = inst_idx; + current_note[ 2 ] = volume_column; + current_note[ 3 ] = effect; + current_note[ 4 ] = effect_param; + effect_tick = 0; + trigger_tick += 1; + update_envelopes(); + key_add = 0; + vibrato_add = 0; + tremolo_add = 0; + if( ! ( effect == 0x3D && effect_param > 0 ) ) { + /* Not note delay.*/ + trigger( key, inst_idx, volume_column, effect ); + /* Handle volume column.*/ + switch( volume_column & 0xF0 ) { + case 0x00: + /* Do nothing.*/ + break; + case 0x60: + /* Volume slide down.*/ + break; + case 0x70: + /* Volume slide up.*/ + break; + case 0x80: + /* Fine volume slide down.*/ + set_volume( volume - ( volume_column & 0x0F ) ); + break; + case 0x90: + /* Fine volume slide up.*/ + set_volume( volume + ( volume_column & 0x0F ) ); + break; + case 0xA0: + /* Set vibrato speed.*/ + set_vibrato_speed( volume_column & 0x0F ); + break; + case 0xB0: + /* Vibrato.*/ + set_vibrato_depth( volume_column & 0x0F ); + vibrato(); + break; + case 0xC0: + /* Set panning.*/ + set_panning( ( volume_column & 0x0F ) << 4 ); + break; + case 0xD0: + /* Panning slide left.*/ + break; + case 0xE0: + /* Panning slide right.*/ + break; + case 0xF0: + /* Tone portamento.*/ + set_portamento_param( volume_column & 0x0F ); + break; + default: + /* Set volume.*/ + set_volume( volume_column - 0x10 ); + break; + } + } + if( instrument.vibrato_depth > 0 ) { + auto_vibrato(); + } + switch( effect ) { + case 0x01: + /* Portmento Up.*/ + set_portamento_param( effect_param ); + portamento_up(); + break; + case 0x02: + /* Portamento Down.*/ + set_portamento_param( effect_param ); + portamento_down(); + break; + case 0x03: + /* Tone Portamento.*/ + set_portamento_param( effect_param ); + break; + case 0x04: + /* Vibrato.*/ + set_vibrato_speed( ( effect_param & 0xF0 ) >> 4 ); + set_vibrato_depth( effect_param & 0x0F ); + vibrato(); + break; + case 0x05: + /* Tone Portamento + Volume Slide.*/ + set_volume_slide_param( effect_param ); + volume_slide(); + break; + case 0x06: + /* Vibrato + Volume Slide.*/ + set_volume_slide_param( effect_param ); + vibrato(); + volume_slide(); + break; + case 0x07: + /* Tremolo.*/ + set_tremolo_speed( ( effect_param & 0xF0 ) >> 4 ); + set_tremolo_depth( effect_param & 0x0F ); + tremolo(); + break; + case 0x08: + /* Set Panning.*/ + set_panning( effect_param ); + break; + case 0x09: + /* Set Sample Index.*/ + set_sample_index( effect_param << 8 ); + break; + case 0x0A: + /* Volume Slide.*/ + set_volume_slide_param( effect_param ); + volume_slide(); + break; + case 0x0B: + /* Pattern Jump.*/ + break; + case 0x0C: + /* Set volume.*/ + set_volume( effect_param ); + break; + case 0x0D: + /* Pattern Break.*/ + break; + case 0x0E: + /* Extended Commands (See 0x30-0x3F).*/ + break; + case 0x0F: + /* Set Speed/Tempo.*/ + break; + case 0x10: + /* Set Global Volume.*/ + set_global_volume( effect_param ); + break; + case 0x11: + /* global Volume Slide.*/ + set_volume_slide_param( effect_param ); + break; + case 0x14: + /* Key Off*/ + if( effect_param == 0 ) { + key_on = false; + } + break; + case 0x15: + /* Set Envelope Tick.*/ + set_envelope_tick( effect_param ); + break; + case 0x19: + /* Panning Slide.*/ + set_volume_slide_param( effect_param ); + break; + case 0x1B: + /* Retrig + Volume Slide.*/ + set_retrig_param( effect_param ); + retrig_volume_slide(); + break; + case 0x1D: + /* Tremor.*/ + set_retrig_param( effect_param ); + tremor(); + break; + case 0x24: + /* S3M Fine Vibrato.*/ + set_vibrato_speed( ( effect_param & 0xF0 ) >> 4 ); + set_vibrato_depth( effect_param & 0x0F ); + fine_vibrato(); + break; + case 0x25: + /* S3M Set Speed.*/ + break; + case 0x30: + /* Amiga Set Filter.*/ + break; + case 0x31: + /* Fine Portamento Up.*/ + set_portamento_param( 0xF0 | effect_param ); + portamento_up(); + break; + case 0x32: + /* Fine Portamento Down.*/ + set_portamento_param( 0xF0 | effect_param ); + portamento_down(); + break; + case 0x33: + /* Set Glissando Mode.*/ + break; + case 0x34: + /* Set Vibrato Waveform.*/ + set_vibrato_wave( effect_param ); + break; + case 0x35: + /* Set Fine Tune.*/ + break; + case 0x36: + /* Pattern Loop.*/ + break; + case 0x37: + /* Set Tremolo Waveform.*/ + set_tremolo_wave( effect_param ); + break; + case 0x38: + /* Set Panning(Obsolete).*/ + break; + case 0x39: + /* Retrig.*/ + set_retrig_param( effect_param ); + break; + case 0x3A: + /* Fine Volume Slide Up.*/ + set_volume_slide_param( ( effect_param << 4 ) | 0x0F ); + volume_slide(); + break; + case 0x3B: + /* Fine Volume Slide Down.*/ + set_volume_slide_param( 0xF0 | effect_param ); + volume_slide(); + break; + case 0x3C: + /* Note Cut.*/ + if( effect_param == 0 ) { + set_volume( 0 ); + } + break; + case 0x3D: + /* Note Delay.*/ + break; + case 0x3E: + /* Pattern Delay.*/ + break; + case 0x3F: + /* Invert Loop.*/ + break; + case 0x40: + /* Arpeggio.*/ + break; + case 0x41: + /* Extra Fine Porta Up.*/ + set_portamento_param( 0xE0 | effect_param ); + portamento_up(); + break; + case 0x42: + /* Extra Fine Porta Down.*/ + set_portamento_param( 0xE0 | effect_param ); + portamento_down(); + break; + } + calculate_amplitude(); + calculate_frequency(); + } + + public void tick() { + int volume_column, effect, effect_param; + volume_column = current_note[ 2 ]; + effect = current_note[ 3 ]; + effect_param = current_note[ 4 ]; + effect_tick += 1; + if( effect == 0x3D && effect_param == effect_tick ) { + /* Note delay.*/ + row( current_note[ 0 ], current_note[ 1 ], volume_column, 0, 0 ); + } else { + trigger_tick += 1; + vibrato_tick += 1; + tremolo_tick += 1; + update_envelopes(); + key_add = 0; + vibrato_add = 0; + tremolo_add = 0; + if( instrument.vibrato_depth > 0 ) { + auto_vibrato(); + } + switch( volume_column & 0xF0 ) { + case 0x60: + /* Volume Slide Down.*/ + set_volume( volume - ( volume_column & 0x0F ) ); + break; + case 0x70: + /* Volume Slide Up.*/ + set_volume( volume + ( volume_column & 0x0F ) ); + break; + case 0xB0: + /* Vibrato.*/ + vibrato(); + break; + case 0xD0: + /* Panning Slide Left.*/ + set_panning( panning - ( volume_column & 0x0F ) ); + break; + case 0xE0: + /* Panning Slide Right.*/ + set_panning( panning + ( volume_column & 0x0F ) ); + break; + case 0xF0: + /* Tone Portamento.*/ + tone_portamento(); + break; + } + switch( effect ) { + case 0x01: + /* Portamento Up.*/ + portamento_up(); + break; + case 0x02: + /* Portamento Down.*/ + portamento_down(); + break; + case 0x03: + /* Tone Portamento.*/ + tone_portamento(); + break; + case 0x04: + /* Vibrato.*/ + vibrato(); + break; + case 0x05: + /* Tone Portamento + Volume Slide.*/ + tone_portamento(); + volume_slide(); + break; + case 0x06: + /* Vibrato + Volume Slide */ + vibrato(); + volume_slide(); + break; + case 0x07: + /* Tremolo.*/ + tremolo(); + break; + case 0x0A: + /* Volume Slide.*/ + volume_slide(); + break; + case 0x11: + /* Global Volume Slide.*/ + global_volume_slide(); + break; + case 0x14: + /* Key off.*/ + if( effect_tick == effect_param ) { + key_on = false; + } + break; + case 0x19: + /* Panning Slide.*/ + panning_slide(); + break; + case 0x1B: + /* Retrig + Volume Slide.*/ + retrig_volume_slide(); + break; + case 0x1D: + /* Tremor.*/ + tremor(); + break; + case 0x24: + /* S3M Fine Vibrato.*/ + fine_vibrato(); + break; + case 0x39: + /* Retrig.*/ + retrig_volume_slide(); + break; + case 0x3C: + /* Note Cut.*/ + if( effect_tick == effect_param ) { + set_volume( 0 ); + } + break; + case 0x40: + /* Arpeggio.*/ + switch( effect_tick % 3 ) { + case 1: + key_add = ( effect_param & 0xF0 ) >> 4; + break; + case 2: + key_add = effect_param & 0x0F; + break; + } + break; + } + } + calculate_amplitude(); + calculate_frequency(); + } + + private void set_vibrato_speed( int speed ) { + if( speed > 0 ) { + vibrato_speed = speed; + } + } + + private void set_vibrato_depth( int depth ) { + if( depth > 0 ) { + vibrato_depth = depth; + } + } + + private void set_vibrato_wave( int wave ) { + if( wave < 0 || wave > 7 ) { + wave = 0; + } + vibrato_wave = wave; + } + + private void set_tremolo_speed( int speed ) { + if( speed > 0 ) { + tremolo_speed = speed; + } + } + + private void set_tremolo_depth( int depth ) { + if( depth > 0 ) { + tremolo_depth = depth; + } + } + + private void set_tremolo_wave( int wave ) { + if( wave < 0 || wave > 7 ) { + wave = 0; + } + tremolo_wave = wave; + } + + private void vibrato() { + int vibrato_phase; + vibrato_phase = vibrato_tick * vibrato_speed; + vibrato_add += waveform( vibrato_phase, vibrato_wave ) * vibrato_depth >> 5; + } + + private void fine_vibrato() { + int vibrato_phase; + vibrato_phase = vibrato_tick * vibrato_speed; + vibrato_add += waveform( vibrato_phase, vibrato_wave ) * vibrato_depth >> 7; + } + + private void tremolo() { + int tremolo_phase; + tremolo_phase = tremolo_tick * tremolo_speed; + tremolo_add += waveform( tremolo_phase, tremolo_wave ) * tremolo_depth >> 6; + } + + private void set_portamento_param( int param ) { + if( param != 0 ) { + portamento_param = param; + } + } + + private void tone_portamento() { + int new_period; + if( porta_period < period ) { + new_period = period - ( portamento_param << 2 ); + if( new_period < porta_period ) { + new_period = porta_period; + } + set_period( new_period ); + } + if( porta_period > period ) { + new_period = period + ( portamento_param << 2 ); + if( new_period > porta_period ) { + new_period = porta_period; + } + set_period( new_period ); + } + } + + private void portamento_up() { + if( ( portamento_param & 0xF0 ) == 0xE0 ) { + /* Extra-fine porta.*/ + if( effect_tick == 0 ) { + set_period( period - ( portamento_param & 0x0F ) ); + } + } else if( ( portamento_param & 0xF0 ) == 0xF0 ) { + /* Fine porta.*/ + if( effect_tick == 0 ) { + set_period( period - ( ( portamento_param & 0x0F ) << 2 ) ); + } + } else { + /* Normal porta.*/ + if( effect_tick > 0 ) { + set_period( period - ( portamento_param << 2 ) ); + } + } + } + + private void portamento_down() { + if( ( portamento_param & 0xF0 ) == 0xE0 ) { + /* Extra-fine porta.*/ + if( effect_tick == 0 ) { + set_period( period + ( portamento_param & 0x0F ) ); + } + } else if( ( portamento_param & 0xF0 ) == 0xF0 ) { + /* Fine porta.*/ + if( effect_tick == 0 ) { + set_period( period + ( ( portamento_param & 0x0F ) << 2 ) ); + } + } else { + /* Normal porta.*/ + if( effect_tick > 0 ) { + set_period( period + ( portamento_param << 2 ) ); + } + } + } + + private void set_period( int p ) { + if( p < 32 ) { + p = 32; + } + if( p > 32768 ) { + p = 32768; + } + period = p; + } + + private void set_global_volume( int vol ) { + if( vol < 0 ) { + vol = 0; + } + if( vol > 64 ) { + vol = 64; + } + global_volume[ 0 ] = vol; + } + + private void set_volume_slide_param( int param ) { + if( param != 0 ) { + volume_slide_param = param; + } + } + + private void global_volume_slide() { + int up, down; + up = ( volume_slide_param & 0xF0 ) >> 4; + down = volume_slide_param & 0x0F; + set_global_volume( global_volume[ 0 ] + up - down ); + } + + private void volume_slide() { + int up, down; + up = ( volume_slide_param & 0xF0 ) >> 4; + down = volume_slide_param & 0x0F; + if( down == 0x0F && up > 0 ) { + /* Fine slide up.*/ + if( effect_tick == 0 ) { + set_volume( volume + up ); + } + } else if( up == 0x0F && down > 0 ) { + /* Fine slide down.*/ + if( effect_tick == 0 ) { + set_volume( volume - down ); + } + } else { + /* Normal slide.*/ + if( effect_tick > 0 || fast_volume_slides ) { + set_volume( volume + up - down ); + } + } + } + + private void panning_slide() { + int left, right; + left = ( volume_slide_param & 0xF0 ) >> 4; + right = volume_slide_param & 0x0F; + set_panning( panning - left + right ); + } + + private void set_retrig_param( int param ) { + if( param != 0 ) { + retrig_param = param; + } + } + + private void tremor() { + int on_ticks, cycle_length, cycle_index; + on_ticks = ( ( retrig_param & 0xF0 ) >> 4 ) + 1; + cycle_length = on_ticks + ( retrig_param & 0x0F ) + 1; + cycle_index = trigger_tick % cycle_length; + if( cycle_index >= on_ticks ) { + tremolo_add = -64; + } + } + + private void retrig_volume_slide() { + int retrig_volume, retrig_tick; + retrig_volume = ( retrig_param & 0xF0 ) >> 4; + retrig_tick = retrig_param & 0x0F; + if( retrig_tick > 0 && ( trigger_tick % retrig_tick ) == 0 ) { + set_sample_index( 0 ); + switch( retrig_volume ) { + case 0x01: + set_volume( volume - 1 ); + break; + case 0x02: + set_volume( volume - 2 ); + break; + case 0x03: + set_volume( volume - 4 ); + break; + case 0x04: + set_volume( volume - 8 ); + break; + case 0x05: + set_volume( volume - 16 ); + break; + case 0x06: + set_volume( volume - volume / 3 ); + break; + case 0x07: + set_volume( volume / 2 ); + break; + case 0x09: + set_volume( volume + 1 ); + break; + case 0x0A: + set_volume( volume + 2 ); + break; + case 0x0B: + set_volume( volume + 4 ); + break; + case 0x0C: + set_volume( volume + 8 ); + break; + case 0x0D: + set_volume( volume + 16 ); + break; + case 0x0E: + set_volume( volume + volume / 2 ); + break; + case 0x0F: + set_volume( volume * 2 ); + break; + } + } + } + + private void set_sample_index( int index ) { + if( index < 0 ) { + index = 0; + } + sample_idx = index; + sample_frac = 0; + } + + private void set_envelope_tick( int tick ) { + volume_envelope_tick = tick; + panning_envelope_tick = tick; + } + + private void trigger( int key, int instrument_idx, int volume_column, int effect ) { + if( instrument_idx > 0 ) { + instrument = module.get_instrument( instrument_idx ); + sample = instrument.get_sample_from_key( key ); + set_volume( sample.volume ); + if( sample.set_panning ) { + set_panning( sample.panning ); + } + set_envelope_tick( 0 ); + fade_out_volume = 32768; + key_on = true; + } + if( key > 0 ) { + if( key < 97 ) { + porta_period = key_to_period( key ); + if( effect != 0x03 && effect != 0x05 ) { + if( ( volume_column & 0xF0 ) != 0xF0 ) { + /* Not portamento.*/ + trigger_tick = 0; + if( vibrato_wave < 4 ) { + vibrato_tick = 0; + } + if( tremolo_wave < 4 ) { + tremolo_tick = 0; + } + set_period( porta_period ); + set_sample_index( 0 ); + } + } + } else { + /* Key off.*/ + key_on = false; + } + } + } + + private void update_envelopes() { + Envelope envelope; + if( instrument.volume_envelope_active ) { + if( !key_on ) { + fade_out_volume -= instrument.volume_fade_out & 0xFFFF; + if( fade_out_volume < 0 ) { + fade_out_volume = 0; + } + } + envelope = instrument.get_volume_envelope(); + volume_envelope_tick = envelope.next_tick( volume_envelope_tick, key_on ); + } + if( instrument.panning_envelope_active ) { + envelope = instrument.get_panning_envelope(); + panning_envelope_tick = envelope.next_tick( panning_envelope_tick, key_on ); + } + } + + private void auto_vibrato() { + int sweep, depth, rate; + sweep = instrument.vibrato_sweep & 0xFF; + depth = instrument.vibrato_depth & 0x0F; + rate = instrument.vibrato_rate & 0x3F; + if( trigger_tick < sweep ) { + depth = depth * trigger_tick / sweep; + } + vibrato_add += waveform( trigger_tick * rate, 0 ) * depth >> 9; + } + + private int waveform( int phase, int wform ) { + int amplitude; + amplitude = 0; + switch( wform & 0x3 ) { + case 0: + /* Sine. */ + if( ( phase & 0x20 ) == 0 ) { + amplitude = sine_table[ phase & 0x1F ]; + } else { + amplitude = -sine_table[ phase & 0x1F ]; + } + break; + case 1: + /* Saw. */ + if( ( phase & 0x20 ) == 0 ) { + amplitude = ( phase & 0x1F ) << 3; + } else { + amplitude = ( ( phase & 0x1F ) << 3 ) - 255; + } + break; + case 2: + /* Square. */ + if( ( phase & 0x20 ) == 0 ) { + amplitude = 255; + } else { + amplitude = -255; + } + break; + case 3: + /* Random. */ + amplitude = ( random_seed >> 15 ) - 255; + random_seed = ( random_seed * 65 + 17 ) & 0xFFFFFF; + break; + } + return amplitude; + } + + private int key_to_period( int key ) { + int octave, log_2_period, period_out; + octave = ( key << IBXM.FP_SHIFT ) / 12 + sample.transpose; + if( linear_periods ) { + period_out = 7744 - ( octave * 768 >> IBXM.FP_SHIFT ); + } else { + log_2_period = LOG_2_29024 - octave; + period_out = LogTable.raise_2( log_2_period ); + period_out = period_out >> ( IBXM.FP_SHIFT - 1 ); + period_out = ( period_out >> 1 ) + ( period_out & 1 ); + } + return period_out; + } + + private void calculate_amplitude() { + int envelope_volume, tremolo_volume, amplitude; + int envelope_panning, mixer_panning, panning_range; + Envelope envelope; + envelope_volume = 0; + if( instrument.volume_envelope_active ) { + envelope = instrument.get_volume_envelope(); + envelope_volume = envelope.calculate_ampl( volume_envelope_tick ); + } else { + if( key_on ) { + envelope_volume = 64; + } + } + tremolo_volume = volume + tremolo_add; + if( tremolo_volume < 0 ) { + tremolo_volume = 0; + } + if( tremolo_volume > 64 ) { + tremolo_volume = 64; + } + amplitude = tremolo_volume << IBXM.FP_SHIFT - 6; + amplitude = amplitude * envelope_volume >> 6; + amplitude = amplitude * fade_out_volume >> 15; + amplitude = amplitude * global_volume[ 0 ] >> 6; + amplitude = amplitude * module.channel_gain >> IBXM.FP_SHIFT; + silent = sample.has_finished( sample_idx ); + if( amplitude <= 0 ) { + silent = true; + } else { + envelope_panning = 32; + if( instrument.panning_envelope_active ) { + envelope = instrument.get_panning_envelope(); + envelope_panning = envelope.calculate_ampl( panning_envelope_tick ); + } + mixer_panning = ( panning & 0xFF ) << IBXM.FP_SHIFT - 8; + panning_range = IBXM.FP_ONE - mixer_panning; + if( panning_range > mixer_panning ) { + panning_range = mixer_panning; + } + mixer_panning = mixer_panning + ( panning_range * ( envelope_panning - 32 ) >> 5 ); + left_gain = amplitude * ( IBXM.FP_ONE - mixer_panning ) >> IBXM.FP_SHIFT; + right_gain = amplitude * mixer_panning >> IBXM.FP_SHIFT; + } + } + + private void calculate_frequency() { + int vibrato_period, log_2_freq; + vibrato_period = period + vibrato_add; + if( vibrato_period < 32 ) { + vibrato_period = 32; + } + if( vibrato_period > 32768 ) { + vibrato_period = 32768; + } + if( linear_periods ) { + log_2_freq = LOG_2_8363 + ( 4608 - vibrato_period << IBXM.FP_SHIFT ) / 768; + } else { + log_2_freq = module.pal ? LOG_2_8287 : LOG_2_8363; + log_2_freq = log_2_freq + LOG_2_1712 - LogTable.log_2( vibrato_period ); + } + log_2_freq += ( key_add << IBXM.FP_SHIFT ) / 12; + step = LogTable.raise_2( log_2_freq - log_2_sampling_rate ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Envelope.java b/build/rfg/minecraft-src/java/ibxm/Envelope.java new file mode 100644 index 0000000..d53e9a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Envelope.java @@ -0,0 +1,110 @@ + +package ibxm; + +public class Envelope { + public boolean sustain, looped; + private int sustain_tick, loop_start_tick, loop_end_tick; + private int[] ticks, ampls; + + public Envelope() { + set_num_points( 1 ); + } + + public void set_num_points( int num_points ) { + int point; + if( num_points <= 0 ) { + num_points = 1; + } + ticks = new int[ num_points ]; + ampls = new int[ num_points ]; + set_point( 0, 0, 0, false ); + } + + /* When you set a point, all subsequent points are reset. */ + public void set_point( int point, int tick, int ampl, boolean delta ) { + if( point >= 0 && point < ticks.length ) { + if( point == 0 ) { + tick = 0; + } + if( point > 0 ) { + if( delta ) tick += ticks[ point - 1 ]; + if( tick <= ticks[ point - 1 ] ) { + System.out.println( "Envelope: Point not valid (" + tick + " <= " + ticks[ point - 1 ] + ")"); + tick = ticks[ point - 1 ] + 1; + } + } + ticks[ point ] = tick; + ampls[ point ] = ampl; + point += 1; + while( point < ticks.length ) { + ticks[ point ] = ticks[ point - 1 ] + 1; + ampls[ point ] = 0; + point += 1; + } + } + } + + public void set_sustain_point( int point ) { + if( point < 0 ) { + point = 0; + } + if( point >= ticks.length ) { + point = ticks.length - 1; + } + sustain_tick = ticks[ point ]; + } + + public void set_loop_points( int start, int end ) { + if( start < 0 ) { + start = 0; + } + if( start >= ticks.length ) { + start = ticks.length - 1; + } + if( end < start || end >= ticks.length ) { + end = start; + } + loop_start_tick = ticks[ start ]; + loop_end_tick = ticks[ end ]; + } + + public int next_tick( int tick, boolean key_on ) { + tick = tick + 1; + if( looped && tick >= loop_end_tick ) { + tick = loop_start_tick; + } + if( sustain && key_on && tick >= sustain_tick ) { + tick = sustain_tick; + } + return tick; + } + + public int calculate_ampl( int tick ) { + int idx, point, delta_t, delta_a, ampl; + ampl = ampls[ ticks.length - 1 ]; + if( tick < ticks[ ticks.length - 1 ] ) { + point = 0; + for( idx = 1; idx < ticks.length; idx++ ) { + if( ticks[ idx ] <= tick ) { + point = idx; + } + } + delta_t = ticks[ point + 1 ] - ticks[ point ]; + delta_a = ampls[ point + 1 ] - ampls[ point ]; + ampl = ( delta_a << IBXM.FP_SHIFT ) / delta_t; + ampl = ampl * ( tick - ticks[ point ] ) >> IBXM.FP_SHIFT; + ampl = ampl + ampls[ point ]; + } + return ampl; + } + + public void dump() { + int idx, tick; + for( idx = 0; idx < ticks.length; idx++ ) { + System.out.println( ticks[ idx ] + ", " + ampls[ idx ] ); + } + for( tick = 0; tick < 222; tick++ ) { + System.out.print( calculate_ampl( tick ) + ", " ); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/FastTracker2.java b/build/rfg/minecraft-src/java/ibxm/FastTracker2.java new file mode 100644 index 0000000..105b1eb --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/FastTracker2.java @@ -0,0 +1,255 @@ + +package ibxm; + +import java.io.*; + +public class FastTracker2 { + public static boolean is_xm( byte[] header_60_bytes ) { + String xm_identifier; + xm_identifier = ascii_text( header_60_bytes, 0, 17 ); + return xm_identifier.equals( "Extended Module: " ); + } + + public static Module load_xm( byte[] header_60_bytes, DataInput data_input ) throws IOException { + int xm_version, song_header_length, sequence_length; + int num_channels, num_patterns, num_instruments, xm_flags, idx; + byte[] structure_header, song_header; + boolean delta_env; + String tracker_name; + Instrument instrument; + Module module; + if( !is_xm( header_60_bytes ) ) { + throw new IllegalArgumentException( "Not an XM file!" ); + } + xm_version = unsigned_short_le( header_60_bytes, 58 ); + if( xm_version != 0x0104 ) { + throw new IllegalArgumentException( "Sorry, XM version " + xm_version + " is not supported!" ); + } + module = new Module(); + module.song_title = ascii_text( header_60_bytes, 17, 20 ); + tracker_name = ascii_text( header_60_bytes, 38, 20 ); + delta_env = tracker_name.startsWith( "DigiBooster Pro" ); + structure_header = new byte[ 4 ]; + data_input.readFully( structure_header ); + song_header_length = int_le( structure_header, 0 ); + song_header = new byte[ song_header_length ]; + data_input.readFully( song_header, 4, song_header_length - 4 ); + sequence_length = unsigned_short_le( song_header, 4 ); + module.restart_sequence_index = unsigned_short_le( song_header, 6 ); + num_channels = unsigned_short_le( song_header, 8 ); + num_patterns = unsigned_short_le( song_header, 10 ); + num_instruments = unsigned_short_le( song_header, 12 ); + xm_flags = unsigned_short_le( song_header, 14 ); + module.linear_periods = ( xm_flags & 0x1 ) == 0x1; + module.global_volume = 64; + module.channel_gain = IBXM.FP_ONE * 3 / 8; + module.default_speed = unsigned_short_le( song_header, 16 ); + module.default_tempo = unsigned_short_le( song_header, 18 ); + module.set_num_channels( num_channels ); + for( idx = 0; idx < num_channels; idx++ ) { + module.set_initial_panning( idx, 128 ); + } + module.set_sequence_length( sequence_length ); + for( idx = 0; idx < sequence_length; idx++ ) { + module.set_sequence( idx, song_header[ 20 + idx ] & 0xFF ); + } + module.set_num_patterns( num_patterns ); + for( idx = 0; idx < num_patterns; idx++ ) { + module.set_pattern( idx, read_xm_pattern( data_input, num_channels ) ); + } + module.set_num_instruments( num_instruments ); + for( idx = 1; idx <= num_instruments; idx++ ) { + try { + instrument = read_xm_instrument( data_input, delta_env ); + module.set_instrument( idx, instrument ); + } catch( EOFException e ) { + System.out.println( "Instrument " + idx + " is missing!" ); + } + } + return module; + } + + private static Pattern read_xm_pattern( DataInput data_input, int num_channels ) throws IOException { + int pattern_header_length, packing_type, num_rows, pattern_data_length; + byte[] structure_header, pattern_header, pattern_data; + Pattern pattern; + structure_header = new byte[ 4 ]; + data_input.readFully( structure_header ); + pattern_header_length = int_le( structure_header, 0 ); + pattern_header = new byte[ pattern_header_length ]; + data_input.readFully( pattern_header, 4, pattern_header_length - 4 ); + packing_type = pattern_header[ 4 ]; + if( packing_type != 0 ) { + throw new IllegalArgumentException( "Pattern packing type " + packing_type + " is not supported!" ); + } + pattern = new Pattern(); + pattern.num_rows = unsigned_short_le( pattern_header, 5 ); + pattern_data_length = unsigned_short_le( pattern_header, 7 ); + pattern_data = new byte[ pattern_data_length ]; + data_input.readFully( pattern_data ); + pattern.set_pattern_data( pattern_data ); + return pattern; + } + + private static Instrument read_xm_instrument( DataInput data_input, boolean delta_env ) throws IOException { + int instrument_header_length, num_samples, idx; + int env_tick, env_ampl, env_num_points, flags; + byte[] structure_header, instrument_header, sample_headers; + Instrument instrument; + Envelope envelope; + structure_header = new byte[ 4 ]; + data_input.readFully( structure_header ); + instrument_header_length = int_le( structure_header, 0 ); + instrument_header = new byte[ instrument_header_length ]; + data_input.readFully( instrument_header, 4, instrument_header_length - 4 ); + instrument = new Instrument(); + instrument.name = ascii_text( instrument_header, 4, 22 ); + num_samples = unsigned_short_le( instrument_header, 27 ); + if( num_samples > 0 ) { + instrument.set_num_samples( num_samples ); + for( idx = 0; idx < 96; idx++ ) { + instrument.set_key_to_sample( idx + 1, instrument_header[ 33 + idx ] & 0xFF ); + } + envelope = new Envelope(); + env_num_points = instrument_header[ 225 ] & 0xFF; + envelope.set_num_points( env_num_points ); + for( idx = 0; idx < env_num_points; idx++ ) { + env_tick = unsigned_short_le( instrument_header, 129 + idx * 4 ); + env_ampl = unsigned_short_le( instrument_header, 131 + idx * 4 ); + envelope.set_point( idx, env_tick, env_ampl, delta_env ); + } + envelope.set_sustain_point( instrument_header[ 227 ] & 0xFF ); + envelope.set_loop_points( instrument_header[ 228 ] & 0xFF, instrument_header[ 229 ] & 0xFF ); + flags = instrument_header[ 233 ] & 0xFF; + instrument.volume_envelope_active = ( flags & 0x1 ) == 0x1; + envelope.sustain = ( flags & 0x2 ) == 0x2; + envelope.looped = ( flags & 0x4 ) == 0x4; + instrument.set_volume_envelope( envelope ); + envelope = new Envelope(); + env_num_points = instrument_header[ 226 ] & 0xFF; + envelope.set_num_points( env_num_points ); + for( idx = 0; idx < env_num_points; idx++ ) { + env_tick = unsigned_short_le( instrument_header, 177 + idx * 4 ); + env_ampl = unsigned_short_le( instrument_header, 179 + idx * 4 ); + envelope.set_point( idx, env_tick, env_ampl, delta_env ); + } + envelope.set_sustain_point( instrument_header[ 230 ] & 0xFF ); + envelope.set_loop_points( instrument_header[ 231 ] & 0xFF, instrument_header[ 232 ] & 0xFF ); + flags = instrument_header[ 234 ] & 0xFF; + instrument.panning_envelope_active = ( flags & 0x1 ) == 0x1; + envelope.sustain = ( flags & 0x2 ) == 0x2; + envelope.looped = ( flags & 0x4 ) == 0x4; + instrument.set_panning_envelope( envelope ); + instrument.vibrato_type = instrument_header[ 235 ] & 0xFF; + instrument.vibrato_sweep = instrument_header[ 236 ] & 0xFF; + instrument.vibrato_depth = instrument_header[ 237 ] & 0xFF; + instrument.vibrato_rate = instrument_header[ 238 ] & 0xFF; + instrument.volume_fade_out = unsigned_short_le( instrument_header, 239 ); + sample_headers = new byte[ num_samples * 40 ]; + data_input.readFully( sample_headers ); + for( idx = 0; idx < num_samples; idx++ ) { + instrument.set_sample( idx, read_xm_sample( sample_headers, idx, data_input ) ); + } + } + return instrument; + } + + private static Sample read_xm_sample( byte[] sample_headers, int sample_idx, DataInput data_input ) throws IOException { + int header_offset, sample_length, loop_start, loop_length; + int flags, in_idx, out_idx, sam, last_sam; + int fine_tune, relative_note; + boolean sixteen_bit, ping_pong; + byte[] raw_sample_data; + short[] decoded_sample_data; + Sample sample; + header_offset = sample_idx * 40; + sample = new Sample(); + sample_length = int_le( sample_headers, header_offset ); + loop_start = int_le( sample_headers, header_offset + 4 ); + loop_length = int_le( sample_headers, header_offset + 8 ); + sample.volume = sample_headers[ header_offset + 12 ] & 0xFF; + fine_tune = sample_headers[ header_offset + 13 ]; + fine_tune = ( fine_tune << IBXM.FP_SHIFT ) / 1536; + sample.set_panning = true; + flags = sample_headers[ header_offset + 14 ] & 0xFF; + if( ( flags & 0x03 ) == 0 ) { + loop_length = 0; + } + ping_pong = ( flags & 0x02 ) == 0x02; + sixteen_bit = ( flags & 0x10 ) == 0x10; + sample.panning = sample_headers[ header_offset + 15 ] & 0xFF; + relative_note = sample_headers[ header_offset + 16 ]; + relative_note = ( relative_note << IBXM.FP_SHIFT ) / 12; + sample.transpose = relative_note + fine_tune; + sample.name = ascii_text( sample_headers, header_offset + 18, 22 ); + raw_sample_data = new byte[ sample_length ]; + try { + data_input.readFully( raw_sample_data ); + } catch( EOFException e ) { + System.out.println( "Sample has been truncated!" ); + } + in_idx = 0; + out_idx = 0; + sam = 0; + last_sam = 0; + if( sixteen_bit ) { + decoded_sample_data = new short[ sample_length >> 1 ]; + while( in_idx < raw_sample_data.length ) { + sam = raw_sample_data[ in_idx ] & 0xFF; + sam = sam | ( ( raw_sample_data[ in_idx + 1 ] & 0xFF ) << 8 ); + last_sam = last_sam + sam; + decoded_sample_data[ out_idx ] = ( short ) last_sam; + in_idx += 2; + out_idx += 1; + } + sample.set_sample_data( decoded_sample_data, loop_start >> 1, loop_length >> 1, ping_pong ); + } else { + decoded_sample_data = new short[ sample_length ]; + while( in_idx < raw_sample_data.length ) { + sam = raw_sample_data[ in_idx ] & 0xFF; + last_sam = last_sam + sam; + decoded_sample_data[ out_idx ] = ( short ) ( last_sam << 8 ); + in_idx += 1; + out_idx += 1; + } + sample.set_sample_data( decoded_sample_data, loop_start, loop_length, ping_pong ); + } + return sample; + } + + private static int unsigned_short_le( byte[] buffer, int offset ) { + int value; + value = buffer[ offset ] & 0xFF; + value = value | ( ( buffer[ offset + 1 ] & 0xFF ) << 8 ); + return value; + } + + private static int int_le( byte[] buffer, int offset ) { + int value; + value = buffer[ offset ] & 0xFF; + value = value | ( ( buffer[ offset + 1 ] & 0xFF ) << 8 ); + value = value | ( ( buffer[ offset + 2 ] & 0xFF ) << 16 ); + value = value | ( ( buffer[ offset + 3 ] & 0x7F ) << 24 ); + return value; + } + + private static String ascii_text( byte[] buffer, int offset, int length ) { + int idx, chr; + byte[] string_buffer; + String string; + string_buffer = new byte[ length ]; + for( idx = 0; idx < length; idx++ ) { + chr = buffer[ offset + idx ]; + if( chr < 32 ) { + chr = 32; + } + string_buffer[ idx ] = ( byte ) chr; + } + try { + string = new String( string_buffer, 0, length, "ISO-8859-1" ); + } catch( UnsupportedEncodingException e ) { + string = ""; + } + return string; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/IBXM.java b/build/rfg/minecraft-src/java/ibxm/IBXM.java new file mode 100644 index 0000000..fcd7885 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/IBXM.java @@ -0,0 +1,342 @@ + +package ibxm; + +public class IBXM { + public static final String VERSION = "ibxm alpha 51 (c)2008 mumart@gmail.com"; + + public static final int FP_SHIFT = 15; + public static final int FP_ONE = 1 << FP_SHIFT; + public static final int FP_MASK = FP_ONE - 1; + + private int sampling_rate, resampling_quality, volume_ramp_length; + private int tick_length_samples, current_tick_samples; + private int[] mixing_buffer, volume_ramp_buffer; + + private Module module; + private Channel[] channels; + private int[] global_volume, note; + private int current_sequence_index, next_sequence_index; + private int current_row, next_row; + private int tick_counter, ticks_per_row; + private int pattern_loop_count, pattern_loop_channel; + + public IBXM( int sample_rate ) { + +/** MODIFIED 13 Oct 2009 by Paul Lamb **/ +// System.out.println( VERSION ); +/***************************************/ + + if( sample_rate < 8000 ) { + sample_rate = 8000; + } + sampling_rate = sample_rate; + volume_ramp_length = sampling_rate >> 10; + volume_ramp_buffer = new int[ volume_ramp_length * 2 ]; + mixing_buffer = new int[ sampling_rate / 6 ]; + global_volume = new int[ 1 ]; + note = new int[ 5 ]; + set_module( new Module() ); + set_resampling_quality( 1 ); + } + + public void set_module( Module m ) { + int channel_idx; + module = m; + channels = new Channel[ module.get_num_channels() ]; + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + channels[ channel_idx ] = new Channel( module, sampling_rate, global_volume ); + } + set_sequence_index( 0, 0 ); + } + + public void set_resampling_quality( int quality ) { + resampling_quality = quality; + } + + public int calculate_song_duration() { + int song_duration; + set_sequence_index( 0, 0 ); + next_tick(); + song_duration = tick_length_samples; + while( !next_tick() ) { + song_duration += tick_length_samples; + } + set_sequence_index( 0, 0 ); + return song_duration; + } + + public void set_sequence_index( int sequence_index, int row ) { + int channel_idx; + global_volume[ 0 ] = 64; + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + channels[ channel_idx ].reset(); + channels[ channel_idx ].set_panning( module.get_initial_panning( channel_idx ) ); + } + set_global_volume( module.global_volume ); + set_speed( 6 ); + set_speed( module.default_speed ); + set_tempo( 125 ); + set_tempo( module.default_tempo ); + pattern_loop_count = -1; + next_sequence_index = sequence_index; + next_row = row; + tick_counter = 0; + current_tick_samples = tick_length_samples; + clear_vol_ramp_buffer(); + } + + public void seek( int sample_position ) { + int idx; + set_sequence_index( 0, 0 ); + next_tick(); + while( sample_position > tick_length_samples ) { + sample_position -= tick_length_samples; + next_tick(); + } + mix_tick(); + current_tick_samples = sample_position; + } + + public void get_audio( byte[] output_buffer, int frames ) { + int output_idx, mix_idx, mix_end, count, amplitude; + output_idx = 0; + while( frames > 0 ) { + count = tick_length_samples - current_tick_samples; + if( count > frames ) { + count = frames; + } + mix_idx = current_tick_samples << 1; + mix_end = mix_idx + ( count << 1 ) - 1; + while( mix_idx <= mix_end ) { + amplitude = mixing_buffer[ mix_idx ]; + if( amplitude > 32767 ) { + amplitude = 32767; + } + if( amplitude < -32768 ) { + amplitude = -32768; + } + output_buffer[ output_idx ] = ( byte ) ( amplitude >> 8 ); + output_buffer[ output_idx + 1 ] = ( byte ) ( amplitude & 0xFF ); + output_idx += 2; + mix_idx += 1; + } + current_tick_samples = mix_idx >> 1; + frames -= count; + if( frames > 0 ) { + next_tick(); + mix_tick(); + current_tick_samples = 0; + } + } + } + + private void mix_tick() { + int channel_idx, mix_idx, mix_len; + mix_idx = 0; + mix_len = tick_length_samples + volume_ramp_length << 1; + while( mix_idx < mix_len ) { + mixing_buffer[ mix_idx ] = 0; + mix_idx += 1; + } + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + mix_len = tick_length_samples + volume_ramp_length; + channels[ channel_idx ].resample( mixing_buffer, 0, mix_len, resampling_quality ); + } + volume_ramp(); + } + + private boolean next_tick() { + int channel_idx; + boolean song_end; + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + channels[ channel_idx ].update_sample_idx( tick_length_samples ); + } + tick_counter -= 1; + if( tick_counter <= 0 ) { + tick_counter = ticks_per_row; + song_end = next_row(); + } else { + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + channels[ channel_idx ].tick(); + } + song_end = false; + } + return song_end; + } + + private boolean next_row() { + int channel_idx, effect, effect_param; + boolean song_end; + Pattern pattern; + song_end = false; + if( next_sequence_index < 0 ) { + /* Bad next sequence index.*/ + next_sequence_index = 0; + next_row = 0; + } + if( next_sequence_index >= module.get_sequence_length() ) { + /* End of sequence.*/ + song_end = true; + next_sequence_index = module.restart_sequence_index; + if( next_sequence_index < 0 ) { + next_sequence_index = 0; + } + if( next_sequence_index >= module.get_sequence_length() ) { + next_sequence_index = 0; + } + next_row = 0; + } + if( next_sequence_index < current_sequence_index ) { + /* Jump to previous pattern. */ + song_end = true; + } + if( next_sequence_index == current_sequence_index ) { + if( next_row <= current_row ) { + if( pattern_loop_count < 0 ) { + /* Jump to previous row in the same pattern, but not a pattern loop. */ + song_end = true; + } + } + } + current_sequence_index = next_sequence_index; + pattern = module.get_pattern_from_sequence( current_sequence_index ); + if( next_row < 0 || next_row >= pattern.num_rows ) { + /* Bad next row.*/ + next_row = 0; + } + current_row = next_row; + next_row = current_row + 1; + if( next_row >= pattern.num_rows ) { + next_sequence_index = current_sequence_index + 1; + next_row = 0; + } + for( channel_idx = 0; channel_idx < channels.length; channel_idx++ ) { + pattern.get_note( note, current_row * channels.length + channel_idx ); + effect = note[ 3 ]; + effect_param = note[ 4 ]; + channels[ channel_idx ].row( note[ 0 ], note[ 1 ], note[ 2 ], effect, effect_param ); + switch( effect ) { + case 0x0B: + /* Pattern Jump.*/ + if( pattern_loop_count < 0 ) { + next_sequence_index = effect_param; + next_row = 0; + } + break; + case 0x0D: + /* Pattern Break.*/ + if( pattern_loop_count < 0 ) { + next_sequence_index = current_sequence_index + 1; + next_row = ( effect_param >> 4 ) * 10 + ( effect_param & 0x0F ); + } + break; + case 0x0E: + /* Extended.*/ + switch( effect_param & 0xF0 ) { + case 0x60: + /* Pattern loop.*/ + if( ( effect_param & 0x0F ) == 0 ) { + /* Set loop marker on this channel. */ + channels[ channel_idx ].pattern_loop_row = current_row; + } + if( channels[ channel_idx ].pattern_loop_row < current_row ) { + /* Marker and parameter are valid. Begin looping. */ + if( pattern_loop_count < 0 ) { + /* Not already looping, begin. */ + pattern_loop_count = effect_param & 0x0F; + pattern_loop_channel = channel_idx; + } + if( pattern_loop_channel == channel_idx ) { + /* Loop in progress on this channel. Next iteration. */ + if( pattern_loop_count == 0 ) { + /* Loop finished. */ + /* Invalidate current marker. */ + channels[ channel_idx ].pattern_loop_row = current_row + 1; + } else { + /* Count must be higher than zero. */ + /* Loop and cancel any breaks on this row. */ + next_row = channels[ channel_idx ].pattern_loop_row; + next_sequence_index = current_sequence_index; + } + pattern_loop_count -= 1; + } + } + break; + case 0xE0: + /* Pattern delay.*/ + tick_counter += ticks_per_row * ( effect_param & 0x0F ); + break; + } + break; + case 0x0F: + /* Set Speed/Tempo.*/ + if( effect_param < 32 ) { + set_speed( effect_param ); + tick_counter = ticks_per_row; + } else { + set_tempo( effect_param ); + } + break; + case 0x25: + /* S3M Set Speed.*/ + set_speed( effect_param ); + tick_counter = ticks_per_row; + break; + } + } + return song_end; + } + + private void set_global_volume( int volume ) { + if( volume < 0 ) { + volume = 0; + } + if( volume > 64 ) { + volume = 64; + } + global_volume[ 0 ] = volume; + } + + private void set_speed( int speed ) { + if( speed > 0 && speed < 256 ) { + ticks_per_row = speed; + } + } + + private void set_tempo( int bpm ) { + if( bpm > 31 && bpm < 256 ) { + tick_length_samples = ( sampling_rate * 5 ) / ( bpm * 2 ); + } + } + + private void volume_ramp() { + int ramp_idx, next_idx, ramp_end; + int volume_ramp_delta, volume, sample; + sample = 0; + volume_ramp_delta = FP_ONE / volume_ramp_length; + volume = 0; + ramp_idx = 0; + next_idx = 2 * tick_length_samples; + ramp_end = volume_ramp_length * 2 - 1; + while( ramp_idx <= ramp_end ) { + sample = volume_ramp_buffer[ ramp_idx ] * ( FP_ONE - volume ) >> FP_SHIFT; + mixing_buffer[ ramp_idx ] = sample + ( mixing_buffer[ ramp_idx ] * volume >> FP_SHIFT ); + volume_ramp_buffer[ ramp_idx ] = mixing_buffer[ next_idx + ramp_idx ]; + sample = volume_ramp_buffer[ ramp_idx + 1 ] * ( FP_ONE - volume ) >> FP_SHIFT; + mixing_buffer[ ramp_idx + 1 ] = sample + ( mixing_buffer[ ramp_idx + 1 ] * volume >> FP_SHIFT ); + volume_ramp_buffer[ ramp_idx + 1 ] = mixing_buffer[ next_idx + ramp_idx + 1 ]; + volume += volume_ramp_delta; + ramp_idx += 2; + } + } + + private void clear_vol_ramp_buffer() { + int ramp_idx, ramp_end; + ramp_idx = 0; + ramp_end = volume_ramp_length * 2 - 1; + while( ramp_idx <= ramp_end ) { + volume_ramp_buffer[ ramp_idx ] = 0; + ramp_idx += 1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Instrument.java b/build/rfg/minecraft-src/java/ibxm/Instrument.java new file mode 100644 index 0000000..6e960ea --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Instrument.java @@ -0,0 +1,90 @@ + +package ibxm; + +public class Instrument { + public String name; + public int vibrato_type, vibrato_sweep; + public int vibrato_depth, vibrato_rate; + public boolean volume_envelope_active, panning_envelope_active; + public int volume_fade_out; + + private Envelope volume_envelope, panning_envelope; + private int[] key_to_sample; + private Sample[] samples; + + public Instrument() { + name = ""; + set_volume_envelope( new Envelope() ); + set_panning_envelope( new Envelope() ); + key_to_sample = new int[ 96 ]; + set_num_samples( 1 ); + } + + public Envelope get_volume_envelope() { + return volume_envelope; + } + + public void set_volume_envelope( Envelope envelope ) { + if( envelope != null ) { + volume_envelope = envelope; + } + } + + public Envelope get_panning_envelope() { + return panning_envelope; + } + + public void set_panning_envelope( Envelope envelope ) { + if( envelope != null ) { + panning_envelope = envelope; + } + } + + public Sample get_sample_from_key( int key ) { + int sample_idx; + sample_idx = 0; + if( key > 0 && key <= key_to_sample.length ) { + sample_idx = key_to_sample[ key - 1 ]; + } + return get_sample( sample_idx ); + } + + public void set_key_to_sample( int key, int sample ) { + if( key > 0 && key <= key_to_sample.length ) { + key_to_sample[ key - 1 ] = sample; + } + } + + public int get_num_samples() { + return samples.length; + } + + public void set_num_samples( int num_samples ) { + if( num_samples < 1 ) { + num_samples = 1; + } + samples = new Sample[ num_samples ]; + set_sample( 0, null ); + } + + public Sample get_sample( int sample_index ) { + Sample sample; + sample = null; + if( sample_index >= 0 && sample_index < samples.length ) { + sample = samples[ sample_index ]; + } + if( sample == null ) { + sample = samples[ 0 ]; + } + return sample; + } + + public void set_sample( int sample_index, Sample sample ) { + if( sample_index >= 0 && sample_index < samples.length ) { + samples[ sample_index ] = sample; + } + if( samples[ 0 ] == null ) { + samples[ 0 ] = new Sample(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/LogTable.java b/build/rfg/minecraft-src/java/ibxm/LogTable.java new file mode 100644 index 0000000..39fb3d2 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/LogTable.java @@ -0,0 +1,90 @@ + +package ibxm; + +/* + Base-2 Log and Exp functions, using linear-interpolated tables. +*/ +public class LogTable { + private static final int TABLE_SHIFT = 7; // 128 points (+1 for interp) + private static final int INTERP_SHIFT = IBXM.FP_SHIFT - TABLE_SHIFT; + private static final int INTERP_MASK = ( 1 << INTERP_SHIFT ) - 1; + + private static final int[] exp_2_table = { + 32768, 32945, 33124, 33304, 33485, 33667, 33850, 34033, + 34218, 34404, 34591, 34779, 34968, 35157, 35348, 35540, + 35733, 35927, 36122, 36319, 36516, 36714, 36913, 37114, + 37315, 37518, 37722, 37926, 38132, 38339, 38548, 38757, + 38967, 39179, 39392, 39606, 39821, 40037, 40254, 40473, + 40693, 40914, 41136, 41359, 41584, 41810, 42037, 42265, + 42494, 42725, 42957, 43190, 43425, 43661, 43898, 44136, + 44376, 44617, 44859, 45103, 45347, 45594, 45841, 46090, + 46340, 46592, 46845, 47099, 47355, 47612, 47871, 48131, + 48392, 48655, 48919, 49185, 49452, 49720, 49990, 50262, + 50535, 50809, 51085, 51362, 51641, 51922, 52204, 52487, + 52772, 53059, 53347, 53636, 53928, 54220, 54515, 54811, + 55108, 55408, 55709, 56011, 56315, 56621, 56928, 57238, + 57548, 57861, 58175, 58491, 58809, 59128, 59449, 59772, + 60096, 60423, 60751, 61081, 61412, 61746, 62081, 62418, + 62757, 63098, 63440, 63785, 64131, 64479, 64830, 65182, + 65536 + }; + + private static final int[] log_2_table = { + 0, 367, 732, 1095, 1454, 1811, 2165, 2517, + 2865, 3212, 3556, 3897, 4236, 4572, 4906, 5238, + 5568, 5895, 6220, 6542, 6863, 7181, 7497, 7812, + 8124, 8434, 8742, 9048, 9352, 9654, 9954, 10252, + 10548, 10843, 11136, 11427, 11716, 12003, 12289, 12573, + 12855, 13136, 13414, 13692, 13967, 14241, 14514, 14785, + 15054, 15322, 15588, 15853, 16117, 16378, 16639, 16898, + 17156, 17412, 17667, 17920, 18172, 18423, 18673, 18921, + 19168, 19413, 19657, 19900, 20142, 20383, 20622, 20860, + 21097, 21333, 21568, 21801, 22034, 22265, 22495, 22724, + 22952, 23178, 23404, 23628, 23852, 24074, 24296, 24516, + 24736, 24954, 25171, 25388, 25603, 25817, 26031, 26243, + 26455, 26665, 26875, 27084, 27292, 27499, 27705, 27910, + 28114, 28317, 28520, 28721, 28922, 29122, 29321, 29519, + 29716, 29913, 30109, 30304, 30498, 30691, 30884, 31076, + 31267, 31457, 31646, 31835, 32023, 32210, 32397, 32582, + 32768 + }; + + /* + Calculate log-base-2 of x (non-fixed-point). + A fixed point value is returned. + */ + public static int log_2( int x ) { + int shift; + /* Scale x to range 1.0 <= x < 2.0 */ + shift = IBXM.FP_SHIFT; + while( x < IBXM.FP_ONE ) { + x <<= 1; + shift--; + } + while( x >= ( IBXM.FP_ONE << 1 ) ) { + x >>= 1; + shift++; + } + return ( IBXM.FP_ONE * shift ) + eval_table( log_2_table, x - IBXM.FP_ONE ); + } + + /* + Raise 2 to the power x (fixed point). + A fixed point value is returned. + */ + public static int raise_2( int x ) { + int y; + y = eval_table( exp_2_table, x & IBXM.FP_MASK ) << IBXM.FP_SHIFT; + return y >> IBXM.FP_SHIFT - ( x >> IBXM.FP_SHIFT ); + } + + private static int eval_table( int[] table, int x ) { + int table_idx, table_frac, c, m, y; + table_idx = x >> INTERP_SHIFT; + table_frac = x & INTERP_MASK; + c = table[ table_idx ]; + m = table[ table_idx + 1 ] - c; + y = ( m * table_frac >> INTERP_SHIFT ) + c; + return y >> 15 - IBXM.FP_SHIFT; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Module.java b/build/rfg/minecraft-src/java/ibxm/Module.java new file mode 100644 index 0000000..e42d7ff --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Module.java @@ -0,0 +1,137 @@ + +package ibxm; + +public class Module { + public String song_title; + public boolean linear_periods, fast_volume_slides, pal; + public int global_volume, channel_gain; + public int default_speed, default_tempo; + public int restart_sequence_index; + + private int[] initial_panning, sequence; + private Pattern[] patterns; + private Instrument[] instruments; + + private Pattern default_pattern; + private Instrument default_instrument; + + public Module() { + song_title = IBXM.VERSION; + set_num_channels( 1 ); + set_sequence_length( 1 ); + set_num_patterns( 0 ); + set_num_instruments( 0 ); + default_pattern = new Pattern(); + default_instrument = new Instrument(); + } + + public int get_num_channels() { + return initial_panning.length; + } + + public void set_num_channels( int num_channels ) { + if( num_channels < 1 ) { + num_channels = 1; + } + initial_panning = new int[ num_channels ]; + } + + public int get_initial_panning( int channel ) { + int panning; + panning = 128; + if( channel >= 0 && channel < initial_panning.length ) { + panning = initial_panning[ channel ]; + } + return panning; + } + + public void set_initial_panning( int channel, int panning ) { + if( channel >= 0 && channel < initial_panning.length ) { + initial_panning[ channel ] = panning; + } + } + + public int get_sequence_length() { + return sequence.length; + } + + public void set_sequence_length( int sequence_length ) { + if( sequence_length < 0 ) { + sequence_length = 0; + } + sequence = new int[ sequence_length ]; + } + + public void set_sequence( int sequence_index, int pattern_index ) { + if( sequence_index >= 0 && sequence_index < sequence.length ) { + sequence[ sequence_index ] = pattern_index; + } + } + + public int get_num_patterns() { + return patterns.length; + } + + public void set_num_patterns( int num_patterns ) { + if( num_patterns < 0 ) { + num_patterns = 0; + } + patterns = new Pattern[ num_patterns ]; + } + + public Pattern get_pattern_from_sequence( int sequence_index ) { + Pattern pattern; + pattern = default_pattern; + if( sequence_index >= 0 && sequence_index < sequence.length ) { + pattern = get_pattern( sequence[ sequence_index ] ); + } + return pattern; + } + + public Pattern get_pattern( int pattern_index ) { + Pattern pattern; + pattern = null; + if( pattern_index >= 0 && pattern_index < patterns.length ) { + pattern = patterns[ pattern_index ]; + } + if( pattern == null ) { + pattern = default_pattern; + } + return pattern; + } + + public void set_pattern( int pattern_index, Pattern pattern ) { + if( pattern_index >= 0 && pattern_index < patterns.length ) { + patterns[ pattern_index ] = pattern; + } + } + + public int get_num_instruments() { + return instruments.length; + } + + public void set_num_instruments( int num_instruments ) { + if( num_instruments < 0 ) { + num_instruments = 0; + } + instruments = new Instrument[ num_instruments ]; + } + + public Instrument get_instrument( int instrument_index ) { + Instrument instrument; + instrument = null; + if( instrument_index > 0 && instrument_index <= instruments.length ) { + instrument = instruments[ instrument_index - 1 ]; + } + if( instrument == null ) { + instrument = default_instrument; + } + return instrument; + } + + public void set_instrument( int instrument_index, Instrument instrument ) { + if( instrument_index > 0 && instrument_index <= instruments.length ) { + instruments[ instrument_index - 1 ] = instrument; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Pattern.java b/build/rfg/minecraft-src/java/ibxm/Pattern.java new file mode 100644 index 0000000..4ec184e --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Pattern.java @@ -0,0 +1,60 @@ + +package ibxm; + +public class Pattern { + public int num_rows; + + private int data_offset, note_index; + private byte[] pattern_data; + + public Pattern() { + num_rows = 1; + set_pattern_data( new byte[ 0 ] ); + } + + public void set_pattern_data( byte[] data ) { + if( data != null ) { + pattern_data = data; + } + data_offset = 0; + note_index = 0; + } + + public void get_note( int[] note, int index ) { + if( index < note_index ) { + note_index = 0; + data_offset = 0; + } + while( note_index <= index ) { + data_offset = next_note( data_offset, note ); + note_index += 1; + } + } + + public int next_note( int data_offset, int[] note ) { + int bitmask, field; + if( data_offset < 0 ) { + data_offset = pattern_data.length; + } + bitmask = 0x80; + if( data_offset < pattern_data.length ) { + bitmask = pattern_data[ data_offset ] & 0xFF; + } + if( ( bitmask & 0x80 ) == 0x80 ) { + data_offset += 1; + } else { + bitmask = 0x1F; + } + for( field = 0; field < 5; field++ ) { + note[ field ] = 0; + if( ( bitmask & 0x01 ) == 0x01 ) { + if( data_offset < pattern_data.length ) { + note[ field ] = pattern_data[ data_offset ] & 0xFF; + data_offset += 1; + } + } + bitmask = bitmask >> 1; + } + return data_offset; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Player.java b/build/rfg/minecraft-src/java/ibxm/Player.java new file mode 100644 index 0000000..0e18307 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Player.java @@ -0,0 +1,133 @@ + +package ibxm; + +import java.io.*; +import javax.sound.sampled.*; + +public class Player { + private Thread play_thread; + private IBXM ibxm; + private Module module; + private int song_duration, play_position; + private boolean running, loop; + private byte[] output_buffer; + private SourceDataLine output_line; + + /** + Simple command-line test player. + */ + public static void main( String[] args ) throws Exception { + if( args.length < 1 ) { + System.err.println( "Usage: java ibxm.Player " ); + System.exit( 0 ); + } + FileInputStream file_input_stream = new FileInputStream( args[ 0 ] ); + Player player = new Player(); + player.set_module( Player.load_module( file_input_stream ) ); + file_input_stream.close(); + player.play(); + } + + /** + Decode the data in the specified InputStream into a Module instance. + @param input an InputStream containing the module file to be decoded. + @throws IllegalArgumentException if the data is not recognised as a module file. + */ + public static Module load_module( InputStream input ) throws IllegalArgumentException, IOException { + DataInputStream data_input_stream = new DataInputStream( input ); + /* Check if data is in XM format.*/ + byte[] xm_header = new byte[ 60 ]; + data_input_stream.readFully( xm_header ); + if( FastTracker2.is_xm( xm_header ) ) + return FastTracker2.load_xm( xm_header, data_input_stream ); + /* Check if data is in ScreamTracker 3 format.*/ + byte[] s3m_header = new byte[ 96 ]; + System.arraycopy( xm_header, 0, s3m_header, 0, 60 ); + data_input_stream.readFully( s3m_header, 60, 36 ); + if( ScreamTracker3.is_s3m( s3m_header ) ) + return ScreamTracker3.load_s3m( s3m_header, data_input_stream ); + /* Check if data is in ProTracker format.*/ + byte[] mod_header = new byte[ 1084 ]; + System.arraycopy( s3m_header, 0, mod_header, 0, 96 ); + data_input_stream.readFully( mod_header, 96, 988 ); + return ProTracker.load_mod( mod_header, data_input_stream ); + } + + /** + Instantiate a new Player. + */ + public Player() throws LineUnavailableException { + ibxm = new IBXM( 48000 ); + set_loop( true ); + output_line = AudioSystem.getSourceDataLine( new AudioFormat( 48000, 16, 2, true, true ) ); + output_buffer = new byte[ 1024 * 4 ]; + } + + /** + Set the Module instance to be played. + */ + public void set_module( Module m ) { + if( m != null ) module = m; + stop(); + ibxm.set_module( module ); + song_duration = ibxm.calculate_song_duration(); + } + + /** + If loop is true, playback will continue indefinitely, + otherwise the module will play through once and stop. + */ + public void set_loop( boolean loop ) { + this.loop = loop; + } + + /** + Open the audio device and begin playback. + If a module is already playing it will be restarted. + */ + public void play() { + stop(); + play_thread = new Thread( new Driver() ); + play_thread.start(); + } + + /** + Stop playback and close the audio device. + */ + public void stop() { + running = false; + if( play_thread != null ) { + try { + play_thread.join(); + } catch( InterruptedException ie ) {} + } + } + + private class Driver implements Runnable { + @Override + public void run() { + if( running ) return; + try { + output_line.open(); + output_line.start(); + play_position = 0; + running = true; + while( running ) { + int frames = song_duration - play_position; + if( frames > 1024 ) frames = 1024; + ibxm.get_audio( output_buffer, frames ); + output_line.write( output_buffer, 0, frames * 4 ); + play_position += frames; + if( play_position >= song_duration ) { + play_position = 0; + if( !loop ) running = false; + } + } + output_line.drain(); + output_line.close(); + } catch( LineUnavailableException lue ) { + lue.printStackTrace(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/ProTracker.java b/build/rfg/minecraft-src/java/ibxm/ProTracker.java new file mode 100644 index 0000000..92f6736 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/ProTracker.java @@ -0,0 +1,233 @@ +package ibxm; + +import java.io.*; + +public class ProTracker { + public static boolean is_mod( byte[] header_1084_bytes ) { + boolean is_mod; + is_mod = false; + if( calculate_num_channels( header_1084_bytes ) > 0 ) { + is_mod = true; + } + return is_mod; + } + + public static Module load_mod( byte[] header_1084_bytes, DataInput data_input ) throws IOException { + int num_channels, channel_idx, panning; + int sequence_length, restart_idx, sequence_idx; + int num_patterns, pattern_idx, instrument_idx; + Module module; + num_channels = calculate_num_channels( header_1084_bytes ); + if( num_channels < 1 ) { + throw new IllegalArgumentException( "ProTracker: Unrecognised module format!" ); + } + module = new Module(); + module.song_title = ascii_text( header_1084_bytes, 0, 20 ); + module.pal = ( num_channels == 4 ); + module.global_volume = 64; + module.channel_gain = IBXM.FP_ONE * 3 / 8; + module.default_speed = 6; + module.default_tempo = 125; + module.set_num_channels( num_channels ); + for( channel_idx = 0; channel_idx < num_channels; channel_idx++ ) { + panning = 64; + if( ( channel_idx & 0x03 ) == 0x01 || ( channel_idx & 0x03 ) == 0x02 ) { + panning = 192; + } + module.set_initial_panning( channel_idx, panning ); + } + sequence_length = header_1084_bytes[ 950 ] & 0x7F; + restart_idx = header_1084_bytes[ 951 ] & 0x7F; + if( restart_idx >= sequence_length ) { + restart_idx = 0; + } + module.restart_sequence_index = restart_idx; + module.set_sequence_length( sequence_length ); + for( sequence_idx = 0; sequence_idx < sequence_length; sequence_idx++ ) { + module.set_sequence( sequence_idx, header_1084_bytes[ 952 + sequence_idx ] & 0x7F ); + } + num_patterns = calculate_num_patterns( header_1084_bytes ); + module.set_num_patterns( num_patterns ); + for( pattern_idx = 0; pattern_idx < num_patterns; pattern_idx++ ) { + module.set_pattern( pattern_idx, read_mod_pattern( data_input, num_channels ) ); + } + module.set_num_instruments( 31 ); + for( instrument_idx = 1; instrument_idx <= 31; instrument_idx++ ) { + module.set_instrument( instrument_idx, read_mod_instrument( header_1084_bytes, instrument_idx, data_input ) ); + } + return module; + } + + private static int calculate_num_patterns( byte[] module_header ) { + int num_patterns, order_entry, pattern_idx; + num_patterns = 0; + for( pattern_idx = 0; pattern_idx < 128; pattern_idx++ ) { + order_entry = module_header[ 952 + pattern_idx ] & 0x7F; + if( order_entry >= num_patterns ) { + num_patterns = order_entry + 1; + } + } + return num_patterns; + } + + private static int calculate_num_channels( byte[] module_header ) { + int num_channels; + switch( ( module_header[ 1082 ] << 8 ) | module_header[ 1083 ] ) { + case 0x4b2e: /* M.K. */ + case 0x4b21: /* M!K! */ + case 0x542e: /* N.T. */ + case 0x5434: /* FLT4 */ + num_channels = 4; + break; + case 0x484e: /* xCHN */ + num_channels = module_header[ 1080 ] - 48; + break; + case 0x4348: /* xxCH */ + num_channels = ( ( module_header[ 1080 ] - 48 ) * 10 ) + ( module_header[ 1081 ] - 48 ); + break; + default: + /* Not recognised. */ + num_channels = 0; + break; + } + return num_channels; + } + + private static Pattern read_mod_pattern( DataInput data_input, int num_channels ) throws IOException { + int input_idx, output_idx; + int period, instrument, effect, effect_param; + Pattern pattern; + byte[] input_pattern_data, output_pattern_data; + pattern = new Pattern(); + pattern.num_rows = 64; + input_pattern_data = new byte[ 64 * num_channels * 4 ]; + output_pattern_data = new byte[ 64 * num_channels * 5 ]; + data_input.readFully( input_pattern_data ); + input_idx = 0; + output_idx = 0; + while( input_idx < input_pattern_data.length ) { + period = ( input_pattern_data[ input_idx ] & 0x0F ) << 8; + period = period | ( input_pattern_data[ input_idx + 1 ] & 0xFF ); + output_pattern_data[ output_idx ] = to_key( period ); + instrument = input_pattern_data[ input_idx ] & 0x10; + instrument = instrument | ( ( input_pattern_data[ input_idx + 2 ] & 0xF0 ) >> 4 ); + output_pattern_data[ output_idx + 1 ] = ( byte ) instrument; + effect = input_pattern_data[ input_idx + 2 ] & 0x0F; + effect_param = input_pattern_data[ input_idx + 3 ] & 0xFF; + if( effect == 0x01 && effect_param == 0 ) { + /* Portamento up of zero has no effect. */ + effect = 0; + } + if( effect == 0x02 && effect_param == 0 ) { + /* Portamento down of zero has no effect. */ + effect = 0; + } + if( effect == 0x08 && num_channels == 4 ) { + /* Some Amiga mods use effect 0x08 for reasons other than panning.*/ + effect = 0; + effect_param = 0; + } + if( effect == 0x0A && effect_param == 0 ) { + /* Volume slide of zero has no effect.*/ + effect = 0; + } + if( effect == 0x05 && effect_param == 0 ) { + /* Porta + Volume slide of zero has no effect.*/ + effect = 0x03; + } + if( effect == 0x06 && effect_param == 0 ) { + /* Vibrato + Volume slide of zero has no effect.*/ + effect = 0x04; + } + output_pattern_data[ output_idx + 3 ] = ( byte ) effect; + output_pattern_data[ output_idx + 4 ] = ( byte ) effect_param; + input_idx += 4; + output_idx += 5; + } + pattern.set_pattern_data( output_pattern_data ); + return pattern; + } + + private static Instrument read_mod_instrument( byte[] mod_header, int idx, DataInput data_input ) throws IOException { + int header_offset, sample_data_length; + int loop_start, loop_length, sample_idx, fine_tune; + Instrument instrument; + Sample sample; + byte[] raw_sample_data; + short[] sample_data; + header_offset = ( idx - 1 ) * 30 + 20; + instrument = new Instrument(); + instrument.name = ascii_text( mod_header, header_offset, 22 ); + sample = new Sample(); + sample_data_length = unsigned_short_be( mod_header, header_offset + 22 ) << 1; + fine_tune = mod_header[ header_offset + 24 ] & 0x0F; + if( fine_tune > 7 ) { + fine_tune -= 16; + } + sample.transpose = ( fine_tune << IBXM.FP_SHIFT ) / 96; + sample.volume = mod_header[ header_offset + 25 ] & 0x7F; + loop_start = unsigned_short_be( mod_header, header_offset + 26 ) << 1; + loop_length = unsigned_short_be( mod_header, header_offset + 28 ) << 1; + if( loop_length < 4 ) { + loop_length = 0; + } + raw_sample_data = new byte[ sample_data_length ]; + sample_data = new short[ sample_data_length ]; + try { + data_input.readFully( raw_sample_data ); + } catch( EOFException e ) { + System.out.println( "ProTracker: Instrument " + idx + " has samples missing." ); + } + for( sample_idx = 0; sample_idx < raw_sample_data.length; sample_idx++ ) { + sample_data[ sample_idx ] = ( short ) ( raw_sample_data[ sample_idx ] << 8 ); + } + sample.set_sample_data( sample_data, loop_start, loop_length, false ); + instrument.set_num_samples( 1 ); + instrument.set_sample( 0, sample ); + return instrument; + } + + private static byte to_key( int period ) { + int oct, key; + if( period < 32 ) { + key = 0; + } else { + oct = LogTable.log_2( 7256 ) - LogTable.log_2( period ); + if( oct < 0 ) { + key = 0; + } else { + key = oct * 12; + key = key >> ( IBXM.FP_SHIFT - 1 ); + key = ( key >> 1 ) + ( key & 1 ); + } + } + return ( byte ) key; + } + + private static int unsigned_short_be( byte[] buf, int offset ) { + int value; + value = ( buf[ offset ] & 0xFF ) << 8; + value = value | ( buf[ offset + 1 ] & 0xFF ); + return value; + } + + private static String ascii_text( byte[] buffer, int offset, int length ) { + int idx, chr; + byte[] string_buffer; + String string; + string_buffer = new byte[ length ]; + for( idx = 0; idx < length; idx++ ) { + chr = buffer[ offset + idx ]; + if( chr < 32 ) { + chr = 32; + } + string_buffer[ idx ] = ( byte ) chr; + } + try { + string = new String( string_buffer, 0, length, "ISO-8859-1" ); + } catch( UnsupportedEncodingException e ) { + string = ""; + } + return string; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/Sample.java b/build/rfg/minecraft-src/java/ibxm/Sample.java new file mode 100644 index 0000000..2a2dba8 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/Sample.java @@ -0,0 +1,239 @@ + +package ibxm; + +public class Sample { + public String name; + public boolean set_panning; + public int volume, panning; + public int transpose; + + private int loop_start, loop_length; + private short[] sample_data; + + /* For the sinc interpolator.*/ + private static final int POINT_SHIFT = 4; + private static final int POINTS = 1 << POINT_SHIFT; + private static final int OVERLAP = POINTS >> 1; + private static final int INTERP_SHIFT = IBXM.FP_SHIFT - 4; + private static final int INTERP_BITMASK = ( 1 << INTERP_SHIFT ) - 1; + private static final short[] sinc_table = { + 0, -7, 27, -71, 142, -227, 299, 32439, 299, -227, 142, -71, 27, -7, 0, 0, + 0, 0, -5, 36, -142, 450, -1439, 32224, 2302, -974, 455, -190, 64, -15, 2, 0, + 0, 6, -33, 128, -391, 1042, -2894, 31584, 4540, -1765, 786, -318, 105, -25, 3, 0, + 0, 10, -55, 204, -597, 1533, -4056, 30535, 6977, -2573, 1121, -449, 148, -36, 5, 0, + -1, 13, -71, 261, -757, 1916, -4922, 29105, 9568, -3366, 1448, -578, 191, -47, 7, 0, + -1, 15, -81, 300, -870, 2185, -5498, 27328, 12263, -4109, 1749, -698, 232, -58, 9, 0, + -1, 15, -86, 322, -936, 2343, -5800, 25249, 15006, -4765, 2011, -802, 269, -68, 10, 0, + -1, 15, -87, 328, -957, 2394, -5849, 22920, 17738, -5298, 2215, -885, 299, -77, 12, 0, + 0, 14, -83, 319, -938, 2347, -5671, 20396, 20396, -5671, 2347, -938, 319, -83, 14, 0, + 0, 12, -77, 299, -885, 2215, -5298, 17738, 22920, -5849, 2394, -957, 328, -87, 15, -1, + 0, 10, -68, 269, -802, 2011, -4765, 15006, 25249, -5800, 2343, -936, 322, -86, 15, -1, + 0, 9, -58, 232, -698, 1749, -4109, 12263, 27328, -5498, 2185, -870, 300, -81, 15, -1, + 0, 7, -47, 191, -578, 1448, -3366, 9568, 29105, -4922, 1916, -757, 261, -71, 13, -1, + 0, 5, -36, 148, -449, 1121, -2573, 6977, 30535, -4056, 1533, -597, 204, -55, 10, 0, + 0, 3, -25, 105, -318, 786, -1765, 4540, 31584, -2894, 1042, -391, 128, -33, 6, 0, + 0, 2, -15, 64, -190, 455, -974, 2302, 32224, -1439, 450, -142, 36, -5, 0, 0, + 0, 0, -7, 27, -71, 142, -227, 299, 32439, 299, -227, 142, -71, 27, -7, 0 + }; + + public Sample() { + name = ""; + set_sample_data( new short[ 0 ], 0, 0, false ); + } + + public void set_sample_data( short[] data, int loop_start, int loop_length, boolean ping_pong ) { + int offset; + short sample; + if( loop_start < 0 ) { + loop_start = 0; + } + if( loop_start >= data.length ) { + loop_start = data.length - 1; + } + if( loop_start + loop_length > data.length ) { + loop_length = data.length - loop_start; + } + if( loop_length <= 1 ) { + sample_data = new short[ OVERLAP + data.length + OVERLAP * 3 ]; + System.arraycopy( data, 0, sample_data, OVERLAP, data.length ); + offset = 0; + while( offset < OVERLAP ) { + sample = sample_data[ OVERLAP + data.length - 1 ]; + sample = ( short ) ( sample * ( OVERLAP - offset ) / OVERLAP ); + sample_data[ OVERLAP + data.length + offset ] = sample; + offset += 1; + } + loop_start = OVERLAP + data.length + OVERLAP; + loop_length = 1; + } else { + if( ping_pong ) { + sample_data = new short[ OVERLAP + loop_start + loop_length * 2 + OVERLAP * 2 ]; + System.arraycopy( data, 0, sample_data, OVERLAP, loop_start + loop_length ); + offset = 0; + while( offset < loop_length ) { + sample = data[ loop_start + loop_length - offset - 1 ]; + sample_data[ OVERLAP + loop_start + loop_length + offset ] = sample; + offset += 1; + } + loop_start = loop_start + OVERLAP; + loop_length = loop_length * 2; + } else { + sample_data = new short[ OVERLAP + loop_start + loop_length + OVERLAP * 2 ]; + System.arraycopy( data, 0, sample_data, OVERLAP, loop_start + loop_length ); + loop_start = loop_start + OVERLAP; + } + offset = 0; + while( offset < OVERLAP * 2 ) { + sample = sample_data[ loop_start + offset ]; + sample_data[ loop_start + loop_length + offset ] = sample; + offset += 1; + } + } + this.loop_start = loop_start; + this.loop_length = loop_length; + } + + public void resample_nearest( + int sample_idx, int sample_frac, int step, int left_gain, int right_gain, + int[] mix_buffer, int frame_offset, int frames ) { + int loop_end, offset, end, max_sample_idx; + sample_idx += OVERLAP; + loop_end = loop_start + loop_length - 1; + offset = frame_offset << 1; + end = ( frame_offset + frames - 1 ) << 1; + while( frames > 0 ) { + if( sample_idx > loop_end ) { + if( loop_length <= 1 ) { + break; + } + sample_idx = loop_start + ( sample_idx - loop_start ) % loop_length; + } + max_sample_idx = sample_idx + ( ( sample_frac + ( frames - 1 ) * step ) >> IBXM.FP_SHIFT ); + if( max_sample_idx > loop_end ) { + while( sample_idx <= loop_end ) { + mix_buffer[ offset++ ] += sample_data[ sample_idx ] * left_gain >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += sample_data[ sample_idx ] * right_gain >> IBXM.FP_SHIFT; + sample_frac += step; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + } else { + while( offset <= end ) { + mix_buffer[ offset++ ] += sample_data[ sample_idx ] * left_gain >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += sample_data[ sample_idx ] * right_gain >> IBXM.FP_SHIFT; + sample_frac += step; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + } + frames = ( end - offset + 2 ) >> 1; + } + } + + public void resample_linear( + int sample_idx, int sample_frac, int step, int left_gain, int right_gain, + int[] mix_buffer, int frame_offset, int frames ) { + int loop_end, offset, end, max_sample_idx, amplitude; + sample_idx += OVERLAP; + loop_end = loop_start + loop_length - 1; + offset = frame_offset << 1; + end = ( frame_offset + frames - 1 ) << 1; + while( frames > 0 ) { + if( sample_idx > loop_end ) { + if( loop_length <= 1 ) { + break; + } + sample_idx = loop_start + ( sample_idx - loop_start ) % loop_length; + } + max_sample_idx = sample_idx + ( ( sample_frac + ( frames - 1 ) * step ) >> IBXM.FP_SHIFT ); + if( max_sample_idx > loop_end ) { + while( sample_idx <= loop_end ) { + amplitude = sample_data[ sample_idx ]; + amplitude += ( sample_data[ sample_idx + 1 ] - amplitude ) * sample_frac >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += amplitude * left_gain >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += amplitude * right_gain >> IBXM.FP_SHIFT; + sample_frac += step; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + } else { + while( offset <= end ) { + amplitude = sample_data[ sample_idx ]; + amplitude += ( sample_data[ sample_idx + 1 ] - amplitude ) * sample_frac >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += amplitude * left_gain >> IBXM.FP_SHIFT; + mix_buffer[ offset++ ] += amplitude * right_gain >> IBXM.FP_SHIFT; + sample_frac += step; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + } + frames = ( end - offset + 2 ) >> 1; + } + } + + public void resample_sinc( + int sample_idx, int sample_frac, int step, int left_gain, int right_gain, + int[] mix_buffer, int frame_offset, int frames ) { + int offset, end, loop_end, table_idx, a1, a2, amplitude; + loop_end = loop_start + loop_length - 1; + offset = frame_offset << 1; + end = ( frame_offset + frames - 1 ) << 1; + while( offset <= end ) { + if( sample_idx > loop_end ) { + if( loop_length <= 1 ) { + break; + } + sample_idx = loop_start + ( sample_idx - loop_start ) % loop_length; + } + table_idx = ( sample_frac >> INTERP_SHIFT ) << POINT_SHIFT; + a1 = sinc_table[ table_idx + 0 ] * sample_data[ sample_idx + 0 ] >> 15; + a1 += sinc_table[ table_idx + 1 ] * sample_data[ sample_idx + 1 ] >> 15; + a1 += sinc_table[ table_idx + 2 ] * sample_data[ sample_idx + 2 ] >> 15; + a1 += sinc_table[ table_idx + 3 ] * sample_data[ sample_idx + 3 ] >> 15; + a1 += sinc_table[ table_idx + 4 ] * sample_data[ sample_idx + 4 ] >> 15; + a1 += sinc_table[ table_idx + 5 ] * sample_data[ sample_idx + 5 ] >> 15; + a1 += sinc_table[ table_idx + 6 ] * sample_data[ sample_idx + 6 ] >> 15; + a1 += sinc_table[ table_idx + 7 ] * sample_data[ sample_idx + 7 ] >> 15; + a1 += sinc_table[ table_idx + 8 ] * sample_data[ sample_idx + 8 ] >> 15; + a1 += sinc_table[ table_idx + 9 ] * sample_data[ sample_idx + 9 ] >> 15; + a1 += sinc_table[ table_idx + 10 ] * sample_data[ sample_idx + 10 ] >> 15; + a1 += sinc_table[ table_idx + 11 ] * sample_data[ sample_idx + 11 ] >> 15; + a1 += sinc_table[ table_idx + 12 ] * sample_data[ sample_idx + 12 ] >> 15; + a1 += sinc_table[ table_idx + 13 ] * sample_data[ sample_idx + 13 ] >> 15; + a1 += sinc_table[ table_idx + 14 ] * sample_data[ sample_idx + 14 ] >> 15; + a1 += sinc_table[ table_idx + 15 ] * sample_data[ sample_idx + 15 ] >> 15; + a2 = sinc_table[ table_idx + 16 ] * sample_data[ sample_idx + 0 ] >> 15; + a2 += sinc_table[ table_idx + 17 ] * sample_data[ sample_idx + 1 ] >> 15; + a2 += sinc_table[ table_idx + 18 ] * sample_data[ sample_idx + 2 ] >> 15; + a2 += sinc_table[ table_idx + 19 ] * sample_data[ sample_idx + 3 ] >> 15; + a2 += sinc_table[ table_idx + 20 ] * sample_data[ sample_idx + 4 ] >> 15; + a2 += sinc_table[ table_idx + 21 ] * sample_data[ sample_idx + 5 ] >> 15; + a2 += sinc_table[ table_idx + 22 ] * sample_data[ sample_idx + 6 ] >> 15; + a2 += sinc_table[ table_idx + 23 ] * sample_data[ sample_idx + 7 ] >> 15; + a2 += sinc_table[ table_idx + 24 ] * sample_data[ sample_idx + 8 ] >> 15; + a2 += sinc_table[ table_idx + 25 ] * sample_data[ sample_idx + 9 ] >> 15; + a2 += sinc_table[ table_idx + 26 ] * sample_data[ sample_idx + 10 ] >> 15; + a2 += sinc_table[ table_idx + 27 ] * sample_data[ sample_idx + 11 ] >> 15; + a2 += sinc_table[ table_idx + 28 ] * sample_data[ sample_idx + 12 ] >> 15; + a2 += sinc_table[ table_idx + 29 ] * sample_data[ sample_idx + 13 ] >> 15; + a2 += sinc_table[ table_idx + 30 ] * sample_data[ sample_idx + 14 ] >> 15; + a2 += sinc_table[ table_idx + 31 ] * sample_data[ sample_idx + 15 ] >> 15; + amplitude = a1 + ( ( a2 - a1 ) * ( sample_frac & INTERP_BITMASK ) >> INTERP_SHIFT ); + mix_buffer[ offset ] += amplitude * left_gain >> IBXM.FP_SHIFT; + mix_buffer[ offset + 1 ] += amplitude * right_gain >> IBXM.FP_SHIFT; + offset += 2; + sample_frac += step; + sample_idx += sample_frac >> IBXM.FP_SHIFT; + sample_frac &= IBXM.FP_MASK; + } + } + + public boolean has_finished( int sample_idx ) { + boolean finished; + finished = false; + if( loop_length <= 1 && sample_idx > loop_start ) { + finished = true; + } + return finished; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/ibxm/ScreamTracker3.java b/build/rfg/minecraft-src/java/ibxm/ScreamTracker3.java new file mode 100644 index 0000000..c10c3b7 --- /dev/null +++ b/build/rfg/minecraft-src/java/ibxm/ScreamTracker3.java @@ -0,0 +1,488 @@ + +package ibxm; + +import java.io.*; + +public class ScreamTracker3 { + private static final int[] effect_map = new int[] { + 0xFF, + 0x25, /* A: Set Speed.*/ + 0x0B, /* B: Pattern Jump.*/ + 0x0D, /* C: Pattern Break.*/ + 0x0A, /* D: Volume Slide.*/ + 0x02, /* E: Portamento Down.*/ + 0x01, /* F: Portamento Up.*/ + 0x03, /* G: Tone Portamento.*/ + 0x04, /* H: Vibrato.*/ + 0x1D, /* I: Tremor.*/ + 0x00, /* J: Arpeggio.*/ + 0x06, /* K: Vibrato + Volume Slide.*/ + 0x05, /* L: Tone Portamento + Volume Slide.*/ + 0xFF, /* M: */ + 0xFF, /* N: */ + 0x09, /* O: Sample Offset.*/ + 0xFF, /* P: */ + 0x1B, /* Q: Retrig + Volume Slide.*/ + 0x07, /* R: Tremolo.*/ + 0x0E, /* S: Extended Effects.*/ + 0x0F, /* T: Set Tempo.*/ + 0x24, /* U: Fine Vibrato.*/ + 0x10, /* V: Set Global Volume. */ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF + }; + + private static final int[] effect_s_map = new int[] { + 0x00, /* 0: Set Filter.*/ + 0x03, /* 1: Glissando.*/ + 0x05, /* 2: Set Fine Tune.*/ + 0x04, /* 3: Set Vibrato Waveform.*/ + 0x07, /* 4: Set Tremolo Waveform.*/ + 0xFF, /* 5: */ + 0xFF, /* 6: */ + 0xFF, /* 7: */ + 0x08, /* 8: Set Panning.*/ + 0xFF, /* 9: */ + 0x09, /* A: Stereo Control.*/ + 0x06, /* B: Pattern Loop.*/ + 0x0C, /* C: Note Cut.*/ + 0x0D, /* D: Note Delay.*/ + 0x0E, /* E: Pattern Delay.*/ + 0x0F /* F: Invert Loop.*/ + }; + + public static boolean is_s3m( byte[] header_96_bytes ) { + String s3m_identifier; + s3m_identifier = ascii_text( header_96_bytes, 44, 4 ); + return s3m_identifier.equals( "SCRM" ); + } + + public static Module load_s3m( byte[] header_96_bytes, DataInput data_input ) throws IOException { + int num_pattern_orders, num_instruments, num_patterns, num_channels; + int flags, tracker_version, master_volume, panning, channel_config, sequence_length; + int instrument_idx, pattern_idx, channel_idx, order_idx, panning_offset; + boolean signed_samples, stereo_mode, default_panning; + int[] channel_map, sequence; + byte[] s3m_file; + Module module; + Instrument instrument; + s3m_file = read_s3m_file( header_96_bytes, data_input ); + module = new Module(); + module.song_title = ascii_text( s3m_file, 0, 28 ); + num_pattern_orders = get_num_pattern_orders( s3m_file ); + num_instruments = get_num_instruments( s3m_file ); + num_patterns = get_num_patterns( s3m_file ); + flags = unsigned_short_le( s3m_file, 38 ); + tracker_version = unsigned_short_le( s3m_file, 40 ); + if( ( flags & 0x40 ) == 0x40 || tracker_version == 0x1300 ) { + module.fast_volume_slides = true; + } + signed_samples = false; + if( unsigned_short_le( s3m_file, 42 ) == 0x01 ) { + signed_samples = true; + } + module.global_volume = s3m_file[ 48 ] & 0xFF; + module.default_speed = s3m_file[ 49 ] & 0xFF; + module.default_tempo = s3m_file[ 50 ] & 0xFF; + master_volume = s3m_file[ 51 ] & 0x7F; + module.channel_gain = ( master_volume << IBXM.FP_SHIFT ) >> 7; + stereo_mode = ( s3m_file[ 51 ] & 0x80 ) == 0x80; + default_panning = ( s3m_file[ 53 ] & 0xFF ) == 0xFC; + channel_map = new int[ 32 ]; + num_channels = 0; + for( channel_idx = 0; channel_idx < 32; channel_idx++ ) { + channel_config = s3m_file[ 64 + channel_idx ] & 0xFF; + channel_map[ channel_idx ] = -1; + if( channel_config < 16 ) { + channel_map[ channel_idx ] = num_channels; + num_channels += 1; + } + } + module.set_num_channels( num_channels ); + panning_offset = 96 + num_pattern_orders + num_instruments * 2 + num_patterns * 2; + for( channel_idx = 0; channel_idx < 32; channel_idx++ ) { + if( channel_map[ channel_idx ] < 0 ) continue; + panning = 7; + if( stereo_mode ) { + panning = 12; + if( ( s3m_file[ 64 + channel_idx ] & 0xFF ) < 8 ) { + panning = 3; + } + } + if( default_panning ) { + flags = s3m_file[ panning_offset + channel_idx ] & 0xFF; + if( ( flags & 0x20 ) == 0x20 ) { + panning = flags & 0xF; + } + } + module.set_initial_panning( channel_map[ channel_idx ], panning * 17 ); + } + sequence = read_s3m_sequence( s3m_file ); + module.set_sequence_length( sequence.length ); + for( order_idx = 0; order_idx < sequence.length; order_idx++ ) { + module.set_sequence( order_idx, sequence[ order_idx ] ); + } + module.set_num_instruments( num_instruments ); + for( instrument_idx = 0; instrument_idx < num_instruments; instrument_idx++ ) { + instrument = read_s3m_instrument( s3m_file, instrument_idx, signed_samples ); + module.set_instrument( instrument_idx + 1, instrument ); + } + module.set_num_patterns( num_patterns ); + for( pattern_idx = 0; pattern_idx < num_patterns; pattern_idx++ ) { + module.set_pattern( pattern_idx, read_s3m_pattern( s3m_file, pattern_idx, channel_map ) ); + } + return module; + } + + private static int[] read_s3m_sequence( byte[] s3m_file ) { + int num_pattern_orders, sequence_length; + int sequence_idx, order_idx, pattern_order; + int[] sequence; + num_pattern_orders = get_num_pattern_orders( s3m_file ); + sequence_length = 0; + for( order_idx = 0; order_idx < num_pattern_orders; order_idx++ ) { + pattern_order = s3m_file[ 96 + order_idx ] & 0xFF; + if( pattern_order == 255 ) { + break; + } else if( pattern_order < 254 ) { + sequence_length += 1; + } + } + sequence = new int[ sequence_length ]; + sequence_idx = 0; + for( order_idx = 0; order_idx < num_pattern_orders; order_idx++ ) { + pattern_order = s3m_file[ 96 + order_idx ] & 0xFF; + if( pattern_order == 255 ) { + break; + } else if( pattern_order < 254 ) { + sequence[ sequence_idx ] = pattern_order; + sequence_idx += 1; + } + } + return sequence; + } + + private static Instrument read_s3m_instrument( byte[] s3m_file, int instrument_idx, boolean signed_samples ) { + int instrument_offset; + int sample_data_offset, sample_data_length; + int loop_start, loop_length, c2_rate, sample_idx, amplitude; + boolean sixteen_bit; + Instrument instrument; + Sample sample; + short[] sample_data; + instrument_offset = get_instrument_offset( s3m_file, instrument_idx ); + instrument = new Instrument(); + instrument.name = ascii_text( s3m_file, instrument_offset + 48, 28 ); + sample = new Sample(); + if( s3m_file[ instrument_offset ] == 1 ) { + sample_data_length = get_sample_data_length( s3m_file, instrument_offset ); + loop_start = unsigned_short_le( s3m_file, instrument_offset + 20 ); + loop_length = unsigned_short_le( s3m_file, instrument_offset + 24 ) - loop_start; + sample.volume = s3m_file[ instrument_offset + 28 ] & 0xFF; + if( s3m_file[ instrument_offset + 30 ] != 0 ) { + throw new IllegalArgumentException( "ScreamTracker3: Packed samples not supported!" ); + } + if( ( s3m_file[ instrument_offset + 31 ] & 0x01 ) == 0 ) { + loop_length = 0; + } + if( ( s3m_file[ instrument_offset + 31 ] & 0x02 ) != 0 ) { + throw new IllegalArgumentException( "ScreamTracker3: Stereo samples not supported!" ); + } + sixteen_bit = ( s3m_file[ instrument_offset + 31 ] & 0x04 ) != 0; + c2_rate = unsigned_short_le( s3m_file, instrument_offset + 32 ); + sample.transpose = LogTable.log_2( c2_rate ) - LogTable.log_2( 8363 ); + sample_data_offset = get_sample_data_offset( s3m_file, instrument_offset ); + if( sixteen_bit ) { + if( signed_samples ) { + throw new IllegalArgumentException( "ScreamTracker3: Signed 16-bit samples not supported!" ); + } + sample_data_length >>= 1; + sample_data = new short[ sample_data_length ]; + for( sample_idx = 0; sample_idx < sample_data_length; sample_idx++ ) { + amplitude = s3m_file[ sample_data_offset + sample_idx * 2 ] & 0xFF; + amplitude |= ( s3m_file[ sample_data_offset + sample_idx * 2 + 1 ] & 0xFF ) << 8; + sample_data[ sample_idx ] = ( short ) ( amplitude - 32768 ); + } + } else { + sample_data = new short[ sample_data_length ]; + if( signed_samples ) { + for( sample_idx = 0; sample_idx < sample_data_length; sample_idx++ ) { + amplitude = s3m_file[ sample_data_offset + sample_idx ] << 8; + sample_data[ sample_idx ] = ( short ) amplitude; + } + } else { + for( sample_idx = 0; sample_idx < sample_data_length; sample_idx++ ) { + amplitude = ( s3m_file[ sample_data_offset + sample_idx ] & 0xFF ) << 8; + sample_data[ sample_idx ] = ( short ) ( amplitude - 32768 ); + } + } + } + sample.set_sample_data( sample_data, loop_start, loop_length, false ); + } + instrument.set_num_samples( 1 ); + instrument.set_sample( 0, sample ); + return instrument; + } + + private static Pattern read_s3m_pattern( byte[] s3m_file, int pattern_idx, int[] channel_map ) { + int pattern_offset; + int num_channels, num_notes; + int row_idx, channel_idx, note_idx; + int token, key, volume_column, effect, effect_param; + byte[] pattern_data; + Pattern pattern; + num_channels = 0; + for( channel_idx = 0; channel_idx < 32; channel_idx++ ) { + if( channel_map[ channel_idx ] >= num_channels ) { + num_channels = channel_idx + 1; + } + } + num_notes = num_channels * 64; + pattern_data = new byte[ num_notes * 5 ]; + row_idx = 0; + pattern_offset = get_pattern_offset( s3m_file, pattern_idx ) + 2; + while( row_idx < 64 ) { + token = s3m_file[ pattern_offset ] & 0xFF; + pattern_offset += 1; + if( token > 0 ) { + channel_idx = channel_map[ token & 0x1F ]; + note_idx = ( num_channels * row_idx + channel_idx ) * 5; + if( ( token & 0x20 ) == 0x20 ) { + /* Key + Instrument.*/ + if( channel_idx >= 0 ) { + key = s3m_file[ pattern_offset ] & 0xFF; + if( key == 255 ) { + key = 0; + } else if( key == 254 ) { + key = 97; + } else { + key = ( ( key & 0xF0 ) >> 4 ) * 12 + ( key & 0x0F ) + 1; + while( key > 96 ) { + key = key - 12; + } + } + pattern_data[ note_idx ] = ( byte ) key; + pattern_data[ note_idx + 1 ] = s3m_file[ pattern_offset + 1 ]; + } + pattern_offset += 2; + } + if( ( token & 0x40 ) == 0x40 ) { + /* Volume.*/ + if( channel_idx >= 0 ) { + volume_column = ( s3m_file[ pattern_offset ] & 0xFF ) + 0x10; + pattern_data[ note_idx + 2 ] = ( byte ) volume_column; + } + pattern_offset += 1; + } + if( ( token & 0x80 ) == 0x80 ) { + /* Effect + Param.*/ + if( channel_idx >= 0 ) { + effect = s3m_file[ pattern_offset ] & 0xFF; + effect_param = s3m_file[ pattern_offset + 1 ] & 0xFF; + effect = effect_map[ effect & 0x1F ]; + if( effect == 0xFF ) { + effect = 0; + effect_param = 0; + } + if( effect == 0x0E ) { + effect = effect_s_map[ ( effect_param & 0xF0 ) >> 4 ]; + effect_param = effect_param & 0x0F; + switch( effect ) { + case 0x08: + effect = 0x08; + effect_param = effect_param * 17; + break; + case 0x09: + effect = 0x08; + if( effect_param > 7 ) { + effect_param -= 8; + } else { + effect_param += 8; + } + effect_param = effect_param * 17; + break; + case 0xFF: + effect = 0; + effect_param = 0; + break; + default: + effect_param = ( ( effect & 0x0F ) << 4 ) | ( effect_param & 0x0F ); + effect = 0x0E; + break; + } + } + pattern_data[ note_idx + 3 ] = ( byte ) effect; + pattern_data[ note_idx + 4 ] = ( byte ) effect_param; + } + pattern_offset += 2; + } + } else { + row_idx += 1; + } + } + pattern = new Pattern(); + pattern.num_rows = 64; + pattern.set_pattern_data( pattern_data ); + return pattern; + } + + private static byte[] read_s3m_file( byte[] header_96_bytes, DataInput data_input ) throws IOException { + int s3m_file_length; + int num_pattern_orders, num_instruments, num_patterns; + int instrument_idx, pattern_idx; + int instrument_offset, sample_data_offset, pattern_offset; + byte[] s3m_file; + if( !is_s3m( header_96_bytes ) ) { + throw new IllegalArgumentException( "ScreamTracker3: Not an S3M file!" ); + } + s3m_file = header_96_bytes; + s3m_file_length = header_96_bytes.length; + num_pattern_orders = get_num_pattern_orders( s3m_file ); + num_instruments = get_num_instruments( s3m_file ); + num_patterns = get_num_patterns( s3m_file ); + s3m_file_length += num_pattern_orders; + s3m_file_length += num_instruments * 2; + s3m_file_length += num_patterns * 2; + /* Read enough of file to calculate the length.*/ + s3m_file = read_more( s3m_file, s3m_file_length, data_input ); + for( instrument_idx = 0; instrument_idx < num_instruments; instrument_idx++ ) { + instrument_offset = get_instrument_offset( s3m_file, instrument_idx ); + instrument_offset += 80; + if( instrument_offset > s3m_file_length ) { + s3m_file_length = instrument_offset; + } + } + for( pattern_idx = 0; pattern_idx < num_patterns; pattern_idx++ ) { + pattern_offset = get_pattern_offset( s3m_file, pattern_idx ); + pattern_offset += 2; + if( pattern_offset > s3m_file_length ) { + s3m_file_length = pattern_offset; + } + } + s3m_file = read_more( s3m_file, s3m_file_length, data_input ); + /* Read rest of file.*/ + for( instrument_idx = 0; instrument_idx < num_instruments; instrument_idx++ ) { + instrument_offset = get_instrument_offset( s3m_file, instrument_idx ); + sample_data_offset = get_sample_data_offset( s3m_file, instrument_offset ); + sample_data_offset += get_sample_data_length( s3m_file, instrument_offset ); + if( sample_data_offset > s3m_file_length ) { + s3m_file_length = sample_data_offset; + } + } + for( pattern_idx = 0; pattern_idx < num_patterns; pattern_idx++ ) { + pattern_offset = get_pattern_offset( s3m_file, pattern_idx ); + pattern_offset += get_pattern_length( s3m_file, pattern_offset ); + pattern_offset += 2; + if( pattern_offset > s3m_file_length ) { + s3m_file_length = pattern_offset; + } + } + s3m_file = read_more( s3m_file, s3m_file_length, data_input ); + return s3m_file; + } + + private static int get_num_pattern_orders( byte[] s3m_file ) { + int num_pattern_orders; + num_pattern_orders = unsigned_short_le( s3m_file, 32 ); + return num_pattern_orders; + } + + private static int get_num_instruments( byte[] s3m_file ) { + int num_instruments; + num_instruments = unsigned_short_le( s3m_file, 34 ); + return num_instruments; + } + + private static int get_num_patterns( byte[] s3m_file ) { + int num_patterns; + num_patterns = unsigned_short_le( s3m_file, 36 ); + return num_patterns; + } + + private static int get_instrument_offset( byte[] s3m_file, int instrument_idx ) { + int instrument_offset, pointer_offset; + pointer_offset = 96 + get_num_pattern_orders( s3m_file ); + instrument_offset = unsigned_short_le( s3m_file, pointer_offset + instrument_idx * 2 ) << 4; + return instrument_offset; + } + + private static int get_sample_data_offset( byte[] s3m_file, int instrument_offset ) { + int sample_data_offset; + sample_data_offset = 0; + if( s3m_file[ instrument_offset ] == 1 ) { + sample_data_offset = ( s3m_file[ instrument_offset + 13 ] & 0xFF ) << 20; + sample_data_offset |= unsigned_short_le( s3m_file, instrument_offset + 14 ) << 4; + } + return sample_data_offset; + } + + private static int get_sample_data_length( byte[] s3m_file, int instrument_offset ) { + int sample_data_length; + boolean sixteen_bit; + sample_data_length = 0; + if( s3m_file[ instrument_offset ] == 1 ) { + sample_data_length = unsigned_short_le( s3m_file, instrument_offset + 16 ); + sixteen_bit = ( s3m_file[ instrument_offset + 31 ] & 0x04 ) != 0; + if( sixteen_bit ) { + sample_data_length <<= 1; + } + } + return sample_data_length; + } + + private static int get_pattern_offset( byte[] s3m_file, int pattern_idx ) { + int pattern_offset, pointer_offset; + pointer_offset = 96 + get_num_pattern_orders( s3m_file ); + pointer_offset += get_num_instruments( s3m_file ) * 2; + pattern_offset = unsigned_short_le( s3m_file, pointer_offset + pattern_idx * 2 ) << 4; + return pattern_offset; + } + + private static int get_pattern_length( byte[] s3m_file, int pattern_offset ) { + int pattern_length; + pattern_length = unsigned_short_le( s3m_file, pattern_offset ); + return pattern_length; + } + + private static byte[] read_more( byte[] old_data, int new_length, DataInput data_input ) throws IOException { + byte[] new_data; + new_data = old_data; + if( new_length > old_data.length ) { + new_data = new byte[ new_length ]; + System.arraycopy( old_data, 0, new_data, 0, old_data.length ); + try { + data_input.readFully( new_data, old_data.length, new_data.length - old_data.length ); + } catch( EOFException e ) { + System.out.println( "ScreamTracker3: Module has been truncated!" ); + } + } + return new_data; + } + + private static int unsigned_short_le( byte[] buffer, int offset ) { + int value; + value = buffer[ offset ] & 0xFF; + value = value | ( ( buffer[ offset + 1 ] & 0xFF ) << 8 ); + return value; + } + + private static String ascii_text( byte[] buffer, int offset, int length ) { + int idx, chr; + byte[] string_buffer; + String string; + string_buffer = new byte[ length ]; + for( idx = 0; idx < length; idx++ ) { + chr = buffer[ offset + idx ]; + if( chr < 32 ) { + chr = 32; + } + string_buffer[ idx ] = ( byte ) chr; + } + try { + string = new String( string_buffer, 0, length, "ISO-8859-1" ); + } catch( UnsupportedEncodingException e ) { + string = ""; + } + return string; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/Block.java b/build/rfg/minecraft-src/java/net/minecraft/block/Block.java new file mode 100644 index 0000000..9ac3f1f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/Block.java @@ -0,0 +1,2624 @@ +package net.minecraft.block; + +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.RegistryNamespaced; +import net.minecraft.util.RegistryNamespacedDefaultedByKey; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.util.RotationHelper; +import net.minecraftforge.event.ForgeEventFactory; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class Block +{ + public static final RegistryNamespaced blockRegistry = GameData.getBlockRegistry(); + private CreativeTabs displayOnCreativeTab; + protected String textureName; + public static final Block.SoundType soundTypeStone = new Block.SoundType("stone", 1.0F, 1.0F); + /** the wood sound type */ + public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F); + /** the gravel sound type */ + public static final Block.SoundType soundTypeGravel = new Block.SoundType("gravel", 1.0F, 1.0F); + public static final Block.SoundType soundTypeGrass = new Block.SoundType("grass", 1.0F, 1.0F); + /** The piston step sound */ + public static final Block.SoundType soundTypePiston = new Block.SoundType("stone", 1.0F, 1.0F); + /** The metal sound type */ + public static final Block.SoundType soundTypeMetal = new Block.SoundType("stone", 1.0F, 1.5F); + /** Glass footsteps */ + public static final Block.SoundType soundTypeGlass = new Block.SoundType("stone", 1.0F, 1.0F) + { + private static final String __OBFID = "CL_00000200"; + /** + * Used when a block breaks, e.g.: Player break, Sheep eating grass, etc.. + */ + public String getBreakSound() + { + return "dig.glass"; + } + public String func_150496_b() + { + return "step.stone"; + } + }; + /** Sound for cloth and carpets */ + public static final Block.SoundType soundTypeCloth = new Block.SoundType("cloth", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSand = new Block.SoundType("sand", 1.0F, 1.0F); + public static final Block.SoundType soundTypeSnow = new Block.SoundType("snow", 1.0F, 1.0F); + /** The ladder sound type */ + public static final Block.SoundType soundTypeLadder = new Block.SoundType("ladder", 1.0F, 1.0F) + { + private static final String __OBFID = "CL_00000201"; + /** + * Used when a block breaks, e.g.: Player break, Sheep eating grass, etc.. + */ + public String getBreakSound() + { + return "dig.wood"; + } + }; + /** The anvil sound type */ + public static final Block.SoundType soundTypeAnvil = new Block.SoundType("anvil", 0.3F, 1.0F) + { + private static final String __OBFID = "CL_00000202"; + /** + * Used when a block breaks, e.g.: Player break, Sheep eating grass, etc.. + */ + public String getBreakSound() + { + return "dig.stone"; + } + public String func_150496_b() + { + return "random.anvil_land"; + } + }; + protected boolean opaque; + /** How much light is subtracted for going through this block */ + protected int lightOpacity; + protected boolean canBlockGrass; + /** Amount of light emitted */ + protected int lightValue; + /** Flag if block should use the brightest neighbor light value as its own */ + protected boolean useNeighborBrightness; + /** Indicates how many hits it takes to break a block. */ + protected float blockHardness; + /** Indicates the block's resistance to explosions. */ + protected float blockResistance; + protected boolean blockConstructorCalled = true; + /** If this field is true, the block is counted for statistics (mined or placed) */ + protected boolean enableStats = true; + /** + * Flags whether or not this block is of a type that needs random ticking. Ref-counted by ExtendedBlockStorage in + * order to broadly cull a chunk from the random chunk update list for efficiency's sake. + */ + protected boolean needsRandomTick; + /** true if the Block contains a Tile Entity */ + protected boolean isBlockContainer; + protected double minX; + protected double minY; + protected double minZ; + protected double maxX; + protected double maxY; + protected double maxZ; + /** Sound of stepping on the block */ + public Block.SoundType stepSound; + public float blockParticleGravity; + /** Block material definition. */ + protected final Material blockMaterial; + /** Determines how much velocity is maintained while moving on top of this block */ + public float slipperiness; + private String unlocalizedName; + @SideOnly(Side.CLIENT) + protected IIcon blockIcon; + private static final String __OBFID = "CL_00000199"; + + public final cpw.mods.fml.common.registry.RegistryDelegate delegate = + ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)blockRegistry).getDelegate(this, Block.class); + public static int getIdFromBlock(Block blockIn) + { + return blockRegistry.getIDForObject(blockIn); + } + + public static Block getBlockById(int id) + { + Block ret = (Block)blockRegistry.getObjectById(id); + return ret == null ? Blocks.air : ret; + } + + public static Block getBlockFromItem(Item itemIn) + { + return getBlockById(Item.getIdFromItem(itemIn)); + } + + public static Block getBlockFromName(String name) + { + if (blockRegistry.containsKey(name)) + { + return (Block)blockRegistry.getObject(name); + } + else + { + try + { + return (Block)blockRegistry.getObjectById(Integer.parseInt(name)); + } + catch (NumberFormatException numberformatexception) + { + return null; + } + } + } + + public boolean func_149730_j() + { + return this.opaque; + } + + public int getLightOpacity() + { + return this.lightOpacity; + } + + @SideOnly(Side.CLIENT) + public boolean getCanBlockGrass() + { + return this.canBlockGrass; + } + + /** + * Gets the light value of the specified block coords. Args: x, y, z + */ + public int getLightValue() + { + return this.lightValue; + } + + /** + * Should block use the brightest neighbor light value as its own + */ + public boolean getUseNeighborBrightness() + { + return this.useNeighborBrightness; + } + + public Material getMaterial() + { + return this.blockMaterial; + } + + public MapColor getMapColor(int meta) + { + return this.getMaterial().getMaterialMapColor(); + } + + public static void registerBlocks() + { + blockRegistry.addObject(0, "air", (new BlockAir()).setBlockName("air")); + blockRegistry.addObject(1, "stone", (new BlockStone()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stone").setBlockTextureName("stone")); + blockRegistry.addObject(2, "grass", (new BlockGrass()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("grass").setBlockTextureName("grass")); + blockRegistry.addObject(3, "dirt", (new BlockDirt()).setHardness(0.5F).setStepSound(soundTypeGravel).setBlockName("dirt").setBlockTextureName("dirt")); + Block block = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stonebrick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("cobblestone"); + blockRegistry.addObject(4, "cobblestone", block); + Block block1 = (new BlockWood()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("wood").setBlockTextureName("planks"); + blockRegistry.addObject(5, "planks", block1); + blockRegistry.addObject(6, "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("sapling").setBlockTextureName("sapling")); + blockRegistry.addObject(7, "bedrock", (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston).setBlockName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("bedrock")); + blockRegistry.addObject(8, "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setBlockName("water").disableStats().setBlockTextureName("water_flow")); + blockRegistry.addObject(9, "water", (new BlockStaticLiquid(Material.water)).setHardness(100.0F).setLightOpacity(3).setBlockName("water").disableStats().setBlockTextureName("water_still")); + blockRegistry.addObject(10, "flowing_lava", (new BlockDynamicLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setBlockName("lava").disableStats().setBlockTextureName("lava_flow")); + blockRegistry.addObject(11, "lava", (new BlockStaticLiquid(Material.lava)).setHardness(100.0F).setLightLevel(1.0F).setBlockName("lava").disableStats().setBlockTextureName("lava_still")); + blockRegistry.addObject(12, "sand", (new BlockSand()).setHardness(0.5F).setStepSound(soundTypeSand).setBlockName("sand").setBlockTextureName("sand")); + blockRegistry.addObject(13, "gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("gravel").setBlockTextureName("gravel")); + blockRegistry.addObject(14, "gold_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreGold").setBlockTextureName("gold_ore")); + blockRegistry.addObject(15, "iron_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreIron").setBlockTextureName("iron_ore")); + blockRegistry.addObject(16, "coal_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreCoal").setBlockTextureName("coal_ore")); + blockRegistry.addObject(17, "log", (new BlockOldLog()).setBlockName("log").setBlockTextureName("log")); + blockRegistry.addObject(18, "leaves", (new BlockOldLeaf()).setBlockName("leaves").setBlockTextureName("leaves")); + blockRegistry.addObject(19, "sponge", (new BlockSponge()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("sponge").setBlockTextureName("sponge")); + blockRegistry.addObject(20, "glass", (new BlockGlass(Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("glass").setBlockTextureName("glass")); + blockRegistry.addObject(21, "lapis_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreLapis").setBlockTextureName("lapis_ore")); + blockRegistry.addObject(22, "lapis_block", (new BlockCompressed(MapColor.lapisColor)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("blockLapis").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("lapis_block")); + blockRegistry.addObject(23, "dispenser", (new BlockDispenser()).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("dispenser").setBlockTextureName("dispenser")); + Block block2 = (new BlockSandStone()).setStepSound(soundTypePiston).setHardness(0.8F).setBlockName("sandStone").setBlockTextureName("sandstone"); + blockRegistry.addObject(24, "sandstone", block2); + blockRegistry.addObject(25, "noteblock", (new BlockNote()).setHardness(0.8F).setBlockName("musicBlock").setBlockTextureName("noteblock")); + blockRegistry.addObject(26, "bed", (new BlockBed()).setHardness(0.2F).setBlockName("bed").disableStats().setBlockTextureName("bed")); + blockRegistry.addObject(27, "golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("goldenRail").setBlockTextureName("rail_golden")); + blockRegistry.addObject(28, "detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("detectorRail").setBlockTextureName("rail_detector")); + blockRegistry.addObject(29, "sticky_piston", (new BlockPistonBase(true)).setBlockName("pistonStickyBase")); + blockRegistry.addObject(30, "web", (new BlockWeb()).setLightOpacity(1).setHardness(4.0F).setBlockName("web").setBlockTextureName("web")); + blockRegistry.addObject(31, "tallgrass", (new BlockTallGrass()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("tallgrass")); + blockRegistry.addObject(32, "deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("deadbush").setBlockTextureName("deadbush")); + blockRegistry.addObject(33, "piston", (new BlockPistonBase(false)).setBlockName("pistonBase")); + blockRegistry.addObject(34, "piston_head", new BlockPistonExtension()); + blockRegistry.addObject(35, "wool", (new BlockColored(Material.cloth)).setHardness(0.8F).setStepSound(soundTypeCloth).setBlockName("cloth").setBlockTextureName("wool_colored")); + blockRegistry.addObject(36, "piston_extension", new BlockPistonMoving()); + blockRegistry.addObject(37, "yellow_flower", (new BlockFlower(0)).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("flower1").setBlockTextureName("flower_dandelion")); + blockRegistry.addObject(38, "red_flower", (new BlockFlower(1)).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("flower2").setBlockTextureName("flower_rose")); + blockRegistry.addObject(39, "brown_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setLightLevel(0.125F).setBlockName("mushroom").setBlockTextureName("mushroom_brown")); + blockRegistry.addObject(40, "red_mushroom", (new BlockMushroom()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("mushroom").setBlockTextureName("mushroom_red")); + blockRegistry.addObject(41, "gold_block", (new BlockCompressed(MapColor.goldColor)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockGold").setBlockTextureName("gold_block")); + blockRegistry.addObject(42, "iron_block", (new BlockCompressed(MapColor.ironColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockIron").setBlockTextureName("iron_block")); + blockRegistry.addObject(43, "double_stone_slab", (new BlockStoneSlab(true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneSlab")); + blockRegistry.addObject(44, "stone_slab", (new BlockStoneSlab(false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneSlab")); + Block block3 = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("brick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("brick"); + blockRegistry.addObject(45, "brick_block", block3); + blockRegistry.addObject(46, "tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("tnt").setBlockTextureName("tnt")); + blockRegistry.addObject(47, "bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(soundTypeWood).setBlockName("bookshelf").setBlockTextureName("bookshelf")); + blockRegistry.addObject(48, "mossy_cobblestone", (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneMoss").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("cobblestone_mossy")); + blockRegistry.addObject(49, "obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(soundTypePiston).setBlockName("obsidian").setBlockTextureName("obsidian")); + blockRegistry.addObject(50, "torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(soundTypeWood).setBlockName("torch").setBlockTextureName("torch_on")); + blockRegistry.addObject(51, "fire", (new BlockFire()).setHardness(0.0F).setLightLevel(1.0F).setStepSound(soundTypeWood).setBlockName("fire").disableStats().setBlockTextureName("fire")); + blockRegistry.addObject(52, "mob_spawner", (new BlockMobSpawner()).setHardness(5.0F).setStepSound(soundTypeMetal).setBlockName("mobSpawner").disableStats().setBlockTextureName("mob_spawner")); + blockRegistry.addObject(53, "oak_stairs", (new BlockStairs(block1, 0)).setBlockName("stairsWood")); + blockRegistry.addObject(54, "chest", (new BlockChest(0)).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("chest")); + blockRegistry.addObject(55, "redstone_wire", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(soundTypeStone).setBlockName("redstoneDust").disableStats().setBlockTextureName("redstone_dust")); + blockRegistry.addObject(56, "diamond_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreDiamond").setBlockTextureName("diamond_ore")); + blockRegistry.addObject(57, "diamond_block", (new BlockCompressed(MapColor.diamondColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockDiamond").setBlockTextureName("diamond_block")); + blockRegistry.addObject(58, "crafting_table", (new BlockWorkbench()).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("workbench").setBlockTextureName("crafting_table")); + blockRegistry.addObject(59, "wheat", (new BlockCrops()).setBlockName("crops").setBlockTextureName("wheat")); + Block block4 = (new BlockFarmland()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("farmland").setBlockTextureName("farmland"); + blockRegistry.addObject(60, "farmland", block4); + blockRegistry.addObject(61, "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("furnace").setCreativeTab(CreativeTabs.tabDecorations)); + blockRegistry.addObject(62, "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(soundTypePiston).setLightLevel(0.875F).setBlockName("furnace")); + blockRegistry.addObject(63, "standing_sign", (new BlockSign(TileEntitySign.class, true)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("sign").disableStats()); + blockRegistry.addObject(64, "wooden_door", (new BlockDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setBlockName("doorWood").disableStats().setBlockTextureName("door_wood")); + blockRegistry.addObject(65, "ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(soundTypeLadder).setBlockName("ladder").setBlockTextureName("ladder")); + blockRegistry.addObject(66, "rail", (new BlockRail()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("rail").setBlockTextureName("rail_normal")); + blockRegistry.addObject(67, "stone_stairs", (new BlockStairs(block, 0)).setBlockName("stairsStone")); + blockRegistry.addObject(68, "wall_sign", (new BlockSign(TileEntitySign.class, false)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("sign").disableStats()); + blockRegistry.addObject(69, "lever", (new BlockLever()).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("lever").setBlockTextureName("lever")); + blockRegistry.addObject(70, "stone_pressure_plate", (new BlockPressurePlate("stone", Material.rock, BlockPressurePlate.Sensitivity.mobs)).setHardness(0.5F).setStepSound(soundTypePiston).setBlockName("pressurePlate")); + blockRegistry.addObject(71, "iron_door", (new BlockDoor(Material.iron)).setHardness(5.0F).setStepSound(soundTypeMetal).setBlockName("doorIron").disableStats().setBlockTextureName("door_iron")); + blockRegistry.addObject(72, "wooden_pressure_plate", (new BlockPressurePlate("planks_oak", Material.wood, BlockPressurePlate.Sensitivity.everything)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("pressurePlate")); + blockRegistry.addObject(73, "redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreRedstone").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("redstone_ore")); + blockRegistry.addObject(74, "lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreRedstone").setBlockTextureName("redstone_ore")); + blockRegistry.addObject(75, "unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("notGate").setBlockTextureName("redstone_torch_off")); + blockRegistry.addObject(76, "redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(soundTypeWood).setBlockName("notGate").setCreativeTab(CreativeTabs.tabRedstone).setBlockTextureName("redstone_torch_on")); + blockRegistry.addObject(77, "stone_button", (new BlockButtonStone()).setHardness(0.5F).setStepSound(soundTypePiston).setBlockName("button")); + blockRegistry.addObject(78, "snow_layer", (new BlockSnow()).setHardness(0.1F).setStepSound(soundTypeSnow).setBlockName("snow").setLightOpacity(0).setBlockTextureName("snow")); + blockRegistry.addObject(79, "ice", (new BlockIce()).setHardness(0.5F).setLightOpacity(3).setStepSound(soundTypeGlass).setBlockName("ice").setBlockTextureName("ice")); + blockRegistry.addObject(80, "snow", (new BlockSnowBlock()).setHardness(0.2F).setStepSound(soundTypeSnow).setBlockName("snow").setBlockTextureName("snow")); + blockRegistry.addObject(81, "cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(soundTypeCloth).setBlockName("cactus").setBlockTextureName("cactus")); + blockRegistry.addObject(82, "clay", (new BlockClay()).setHardness(0.6F).setStepSound(soundTypeGravel).setBlockName("clay").setBlockTextureName("clay")); + blockRegistry.addObject(83, "reeds", (new BlockReed()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("reeds").disableStats().setBlockTextureName("reeds")); + blockRegistry.addObject(84, "jukebox", (new BlockJukebox()).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("jukebox").setBlockTextureName("jukebox")); + blockRegistry.addObject(85, "fence", (new BlockFence("planks_oak", Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("fence")); + Block block5 = (new BlockPumpkin(false)).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("pumpkin").setBlockTextureName("pumpkin"); + blockRegistry.addObject(86, "pumpkin", block5); + blockRegistry.addObject(87, "netherrack", (new BlockNetherrack()).setHardness(0.4F).setStepSound(soundTypePiston).setBlockName("hellrock").setBlockTextureName("netherrack")); + blockRegistry.addObject(88, "soul_sand", (new BlockSoulSand()).setHardness(0.5F).setStepSound(soundTypeSand).setBlockName("hellsand").setBlockTextureName("soul_sand")); + blockRegistry.addObject(89, "glowstone", (new BlockGlowstone(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setLightLevel(1.0F).setBlockName("lightgem").setBlockTextureName("glowstone")); + blockRegistry.addObject(90, "portal", (new BlockPortal()).setHardness(-1.0F).setStepSound(soundTypeGlass).setLightLevel(0.75F).setBlockName("portal").setBlockTextureName("portal")); + blockRegistry.addObject(91, "lit_pumpkin", (new BlockPumpkin(true)).setHardness(1.0F).setStepSound(soundTypeWood).setLightLevel(1.0F).setBlockName("litpumpkin").setBlockTextureName("pumpkin")); + blockRegistry.addObject(92, "cake", (new BlockCake()).setHardness(0.5F).setStepSound(soundTypeCloth).setBlockName("cake").disableStats().setBlockTextureName("cake")); + blockRegistry.addObject(93, "unpowered_repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("diode").disableStats().setBlockTextureName("repeater_off")); + blockRegistry.addObject(94, "powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setLightLevel(0.625F).setStepSound(soundTypeWood).setBlockName("diode").disableStats().setBlockTextureName("repeater_on")); + blockRegistry.addObject(95, "stained_glass", (new BlockStainedGlass(Material.glass)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("stainedGlass").setBlockTextureName("glass")); + blockRegistry.addObject(96, "trapdoor", (new BlockTrapDoor(Material.wood)).setHardness(3.0F).setStepSound(soundTypeWood).setBlockName("trapdoor").disableStats().setBlockTextureName("trapdoor")); + blockRegistry.addObject(97, "monster_egg", (new BlockSilverfish()).setHardness(0.75F).setBlockName("monsterStoneEgg")); + Block block6 = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stonebricksmooth").setBlockTextureName("stonebrick"); + blockRegistry.addObject(98, "stonebrick", block6); + blockRegistry.addObject(99, "brown_mushroom_block", (new BlockHugeMushroom(Material.wood, 0)).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("mushroom").setBlockTextureName("mushroom_block")); + blockRegistry.addObject(100, "red_mushroom_block", (new BlockHugeMushroom(Material.wood, 1)).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("mushroom").setBlockTextureName("mushroom_block")); + blockRegistry.addObject(101, "iron_bars", (new BlockPane("iron_bars", "iron_bars", Material.iron, true)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("fenceIron")); + blockRegistry.addObject(102, "glass_pane", (new BlockPane("glass", "glass_pane_top", Material.glass, false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("thinGlass")); + Block block7 = (new BlockMelon()).setHardness(1.0F).setStepSound(soundTypeWood).setBlockName("melon").setBlockTextureName("melon"); + blockRegistry.addObject(103, "melon_block", block7); + blockRegistry.addObject(104, "pumpkin_stem", (new BlockStem(block5)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("pumpkinStem").setBlockTextureName("pumpkin_stem")); + blockRegistry.addObject(105, "melon_stem", (new BlockStem(block7)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("pumpkinStem").setBlockTextureName("melon_stem")); + blockRegistry.addObject(106, "vine", (new BlockVine()).setHardness(0.2F).setStepSound(soundTypeGrass).setBlockName("vine").setBlockTextureName("vine")); + blockRegistry.addObject(107, "fence_gate", (new BlockFenceGate()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("fenceGate")); + blockRegistry.addObject(108, "brick_stairs", (new BlockStairs(block3, 0)).setBlockName("stairsBrick")); + blockRegistry.addObject(109, "stone_brick_stairs", (new BlockStairs(block6, 0)).setBlockName("stairsStoneBrickSmooth")); + blockRegistry.addObject(110, "mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(soundTypeGrass).setBlockName("mycel").setBlockTextureName("mycelium")); + blockRegistry.addObject(111, "waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(soundTypeGrass).setBlockName("waterlily").setBlockTextureName("waterlily")); + Block block8 = (new Block(Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("netherBrick").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("nether_brick"); + blockRegistry.addObject(112, "nether_brick", block8); + blockRegistry.addObject(113, "nether_brick_fence", (new BlockFence("nether_brick", Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("netherFence")); + blockRegistry.addObject(114, "nether_brick_stairs", (new BlockStairs(block8, 0)).setBlockName("stairsNetherBrick")); + blockRegistry.addObject(115, "nether_wart", (new BlockNetherWart()).setBlockName("netherStalk").setBlockTextureName("nether_wart")); + blockRegistry.addObject(116, "enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setBlockName("enchantmentTable").setBlockTextureName("enchanting_table")); + blockRegistry.addObject(117, "brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setBlockName("brewingStand").setBlockTextureName("brewing_stand")); + blockRegistry.addObject(118, "cauldron", (new BlockCauldron()).setHardness(2.0F).setBlockName("cauldron").setBlockTextureName("cauldron")); + blockRegistry.addObject(119, "end_portal", (new BlockEndPortal(Material.portal)).setHardness(-1.0F).setResistance(6000000.0F)); + blockRegistry.addObject(120, "end_portal_frame", (new BlockEndPortalFrame()).setStepSound(soundTypeGlass).setLightLevel(0.125F).setHardness(-1.0F).setBlockName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setBlockTextureName("endframe")); + blockRegistry.addObject(121, "end_stone", (new Block(Material.rock)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setBlockName("whiteStone").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("end_stone")); + blockRegistry.addObject(122, "dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(soundTypePiston).setLightLevel(0.125F).setBlockName("dragonEgg").setBlockTextureName("dragon_egg")); + blockRegistry.addObject(123, "redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone).setBlockTextureName("redstone_lamp_off")); + blockRegistry.addObject(124, "lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("redstoneLight").setBlockTextureName("redstone_lamp_on")); + blockRegistry.addObject(125, "double_wooden_slab", (new BlockWoodSlab(true)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("woodSlab")); + blockRegistry.addObject(126, "wooden_slab", (new BlockWoodSlab(false)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("woodSlab")); + blockRegistry.addObject(127, "cocoa", (new BlockCocoa()).setHardness(0.2F).setResistance(5.0F).setStepSound(soundTypeWood).setBlockName("cocoa").setBlockTextureName("cocoa")); + blockRegistry.addObject(128, "sandstone_stairs", (new BlockStairs(block2, 0)).setBlockName("stairsSandStone")); + blockRegistry.addObject(129, "emerald_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("oreEmerald").setBlockTextureName("emerald_ore")); + blockRegistry.addObject(130, "ender_chest", (new BlockEnderChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(soundTypePiston).setBlockName("enderChest").setLightLevel(0.5F)); + blockRegistry.addObject(131, "tripwire_hook", (new BlockTripWireHook()).setBlockName("tripWireSource").setBlockTextureName("trip_wire_source")); + blockRegistry.addObject(132, "tripwire", (new BlockTripWire()).setBlockName("tripWire").setBlockTextureName("trip_wire")); + blockRegistry.addObject(133, "emerald_block", (new BlockCompressed(MapColor.emeraldColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockEmerald").setBlockTextureName("emerald_block")); + blockRegistry.addObject(134, "spruce_stairs", (new BlockStairs(block1, 1)).setBlockName("stairsWoodSpruce")); + blockRegistry.addObject(135, "birch_stairs", (new BlockStairs(block1, 2)).setBlockName("stairsWoodBirch")); + blockRegistry.addObject(136, "jungle_stairs", (new BlockStairs(block1, 3)).setBlockName("stairsWoodJungle")); + blockRegistry.addObject(137, "command_block", (new BlockCommandBlock()).setBlockUnbreakable().setResistance(6000000.0F).setBlockName("commandBlock").setBlockTextureName("command_block")); + blockRegistry.addObject(138, "beacon", (new BlockBeacon()).setBlockName("beacon").setLightLevel(1.0F).setBlockTextureName("beacon")); + blockRegistry.addObject(139, "cobblestone_wall", (new BlockWall(block)).setBlockName("cobbleWall")); + blockRegistry.addObject(140, "flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(soundTypeStone).setBlockName("flowerPot").setBlockTextureName("flower_pot")); + blockRegistry.addObject(141, "carrots", (new BlockCarrot()).setBlockName("carrots").setBlockTextureName("carrots")); + blockRegistry.addObject(142, "potatoes", (new BlockPotato()).setBlockName("potatoes").setBlockTextureName("potatoes")); + blockRegistry.addObject(143, "wooden_button", (new BlockButtonWood()).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("button")); + blockRegistry.addObject(144, "skull", (new BlockSkull()).setHardness(1.0F).setStepSound(soundTypePiston).setBlockName("skull").setBlockTextureName("skull")); + blockRegistry.addObject(145, "anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(soundTypeAnvil).setResistance(2000.0F).setBlockName("anvil")); + blockRegistry.addObject(146, "trapped_chest", (new BlockChest(1)).setHardness(2.5F).setStepSound(soundTypeWood).setBlockName("chestTrap")); + blockRegistry.addObject(147, "light_weighted_pressure_plate", (new BlockPressurePlateWeighted("gold_block", Material.iron, 15)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("weightedPlate_light")); + blockRegistry.addObject(148, "heavy_weighted_pressure_plate", (new BlockPressurePlateWeighted("iron_block", Material.iron, 150)).setHardness(0.5F).setStepSound(soundTypeWood).setBlockName("weightedPlate_heavy")); + blockRegistry.addObject(149, "unpowered_comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(soundTypeWood).setBlockName("comparator").disableStats().setBlockTextureName("comparator_off")); + blockRegistry.addObject(150, "powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F).setStepSound(soundTypeWood).setBlockName("comparator").disableStats().setBlockTextureName("comparator_on")); + blockRegistry.addObject(151, "daylight_detector", (new BlockDaylightDetector()).setHardness(0.2F).setStepSound(soundTypeWood).setBlockName("daylightDetector").setBlockTextureName("daylight_detector")); + blockRegistry.addObject(152, "redstone_block", (new BlockCompressedPowered(MapColor.tntColor)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypeMetal).setBlockName("blockRedstone").setBlockTextureName("redstone_block")); + blockRegistry.addObject(153, "quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(soundTypePiston).setBlockName("netherquartz").setBlockTextureName("quartz_ore")); + blockRegistry.addObject(154, "hopper", (new BlockHopper()).setHardness(3.0F).setResistance(8.0F).setStepSound(soundTypeWood).setBlockName("hopper").setBlockTextureName("hopper")); + Block block9 = (new BlockQuartz()).setStepSound(soundTypePiston).setHardness(0.8F).setBlockName("quartzBlock").setBlockTextureName("quartz_block"); + blockRegistry.addObject(155, "quartz_block", block9); + blockRegistry.addObject(156, "quartz_stairs", (new BlockStairs(block9, 0)).setBlockName("stairsQuartz")); + blockRegistry.addObject(157, "activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(soundTypeMetal).setBlockName("activatorRail").setBlockTextureName("rail_activator")); + blockRegistry.addObject(158, "dropper", (new BlockDropper()).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("dropper").setBlockTextureName("dropper")); + blockRegistry.addObject(159, "stained_hardened_clay", (new BlockColored(Material.rock)).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setBlockName("clayHardenedStained").setBlockTextureName("hardened_clay_stained")); + blockRegistry.addObject(160, "stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(soundTypeGlass).setBlockName("thinStainedGlass").setBlockTextureName("glass")); + blockRegistry.addObject(161, "leaves2", (new BlockNewLeaf()).setBlockName("leaves").setBlockTextureName("leaves")); + blockRegistry.addObject(162, "log2", (new BlockNewLog()).setBlockName("log").setBlockTextureName("log")); + blockRegistry.addObject(163, "acacia_stairs", (new BlockStairs(block1, 4)).setBlockName("stairsWoodAcacia")); + blockRegistry.addObject(164, "dark_oak_stairs", (new BlockStairs(block1, 5)).setBlockName("stairsWoodDarkOak")); + blockRegistry.addObject(170, "hay_block", (new BlockHay()).setHardness(0.5F).setStepSound(soundTypeGrass).setBlockName("hayBlock").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("hay_block")); + blockRegistry.addObject(171, "carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(soundTypeCloth).setBlockName("woolCarpet").setLightOpacity(0)); + blockRegistry.addObject(172, "hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(soundTypePiston).setBlockName("clayHardened").setBlockTextureName("hardened_clay")); + blockRegistry.addObject(173, "coal_block", (new Block(Material.rock)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("blockCoal").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName("coal_block")); + blockRegistry.addObject(174, "packed_ice", (new BlockPackedIce()).setHardness(0.5F).setStepSound(soundTypeGlass).setBlockName("icePacked").setBlockTextureName("ice_packed")); + blockRegistry.addObject(175, "double_plant", new BlockDoublePlant()); + Iterator iterator = blockRegistry.iterator(); + + while (iterator.hasNext()) + { + Block block10 = (Block)iterator.next(); + + if (block10.blockMaterial == Material.air) + { + block10.useNeighborBrightness = false; + } + else + { + boolean flag = false; + boolean flag1 = block10.getRenderType() == 10; + boolean flag2 = block10 instanceof BlockSlab; + boolean flag3 = block10 == block4; + boolean flag4 = block10.canBlockGrass; + boolean flag5 = block10.lightOpacity == 0; + + if (flag1 || flag2 || flag3 || flag4 || flag5) + { + flag = true; + } + + block10.useNeighborBrightness = flag; + } + } + } + + protected Block(Material materialIn) + { + this.stepSound = soundTypeStone; + this.blockParticleGravity = 1.0F; + this.slipperiness = 0.6F; + this.blockMaterial = materialIn; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.opaque = this.isOpaqueCube(); + this.lightOpacity = this.isOpaqueCube() ? 255 : 0; + this.canBlockGrass = !materialIn.getCanBlockGrass(); + } + + /** + * Sets the footstep sound for the block. Returns the object for convenience in constructing. + */ + public Block setStepSound(Block.SoundType sound) + { + this.stepSound = sound; + return this; + } + + /** + * Sets how much light is blocked going through this block. Returns the object for convenience in constructing. + */ + public Block setLightOpacity(int opacity) + { + this.lightOpacity = opacity; + return this; + } + + /** + * Sets the light value that the block emits. Returns resulting block instance for constructing convenience. Args: + * level + */ + public Block setLightLevel(float value) + { + this.lightValue = (int)(15.0F * value); + return this; + } + + /** + * Sets the the blocks resistance to explosions. Returns the object for convenience in constructing. + */ + public Block setResistance(float resistance) + { + this.blockResistance = resistance * 3.0F; + return this; + } + + /** + * Indicate if a material is a normal solid opaque cube + */ + @SideOnly(Side.CLIENT) + public boolean isBlockNormalCube() + { + return this.blockMaterial.blocksMovement() && this.renderAsNormalBlock(); + } + + public boolean isNormalCube() + { + return this.blockMaterial.isOpaque() && this.renderAsNormalBlock() && !this.canProvidePower(); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return true; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return !this.blockMaterial.blocksMovement(); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 0; + } + + /** + * Sets how many hits it takes to break a block. + */ + public Block setHardness(float hardness) + { + this.blockHardness = hardness; + + if (this.blockResistance < hardness * 5.0F) + { + this.blockResistance = hardness * 5.0F; + } + + return this; + } + + /** + * This method will set the hardness of the block to -1, making it indestructible + */ + public Block setBlockUnbreakable() + { + this.setHardness(-1.0F); + return this; + } + + /** + * Returns the block hardness at a location. Args: world, x, y, z + */ + public float getBlockHardness(World worldIn, int x, int y, int z) + { + return this.blockHardness; + } + + /** + * Sets whether this block type will receive random update ticks + */ + public Block setTickRandomly(boolean shouldTick) + { + this.needsRandomTick = shouldTick; + return this; + } + + /** + * Returns whether or not this block is of a type that needs random ticking. Called for ref-counting purposes by + * ExtendedBlockStorage in order to broadly cull a chunk from the random chunk update list for efficiency's sake. + */ + public boolean getTickRandomly() + { + return this.needsRandomTick; + } + + @Deprecated //Forge: New Metadata sensitive version. + public boolean hasTileEntity() + { + return hasTileEntity(0); + } + + /** + * Sets the bounds of the block. minX, minY, minZ, maxX, maxY, maxZ + */ + public final void setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) + { + this.minX = (double)minX; + this.minY = (double)minY; + this.minZ = (double)minZ; + this.maxX = (double)maxX; + this.maxY = (double)maxY; + this.maxZ = (double)maxZ; + } + + /** + * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z + */ + @SideOnly(Side.CLIENT) + public int getMixedBrightnessForBlock(IBlockAccess worldIn, int x, int y, int z) + { + Block block = worldIn.getBlock(x, y, z); + int l = worldIn.getLightBrightnessForSkyBlocks(x, y, z, block.getLightValue(worldIn, x, y, z)); + + if (l == 0 && block instanceof BlockSlab) + { + --y; + block = worldIn.getBlock(x, y, z); + return worldIn.getLightBrightnessForSkyBlocks(x, y, z, block.getLightValue(worldIn, x, y, z)); + } + else + { + return l; + } + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 0 && this.minY > 0.0D ? true : (side == 1 && this.maxY < 1.0D ? true : (side == 2 && this.minZ > 0.0D ? true : (side == 3 && this.maxZ < 1.0D ? true : (side == 4 && this.minX > 0.0D ? true : (side == 5 && this.maxX < 1.0D ? true : !worldIn.getBlock(x, y, z).isOpaqueCube()))))); + } + + /** + * Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent + * block is at the given coordinates. Args: blockAccess, x, y, z, side + */ + public boolean isBlockSolid(IBlockAccess worldIn, int x, int y, int z, int side) + { + return worldIn.getBlock(x, y, z).getMaterial().isSolid(); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) + { + return this.getIcon(side, worldIn.getBlockMetadata(x, y, z)); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.blockIcon; + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + + if (axisalignedbb1 != null && mask.intersectsWith(axisalignedbb1)) + { + list.add(axisalignedbb1); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ); + } + + /** + * Returns the block texture based on the side being looked at. Args: side + */ + @SideOnly(Side.CLIENT) + public final IIcon getBlockTextureFromSide(int side) + { + return this.getIcon(side, 0); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return true; + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int meta, boolean includeLiquid) + { + return this.isCollidable(); + } + + /** + * Returns if this block is collidable (only used by Fire). Args: x, y, z + */ + public boolean isCollidable() + { + return true; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) {} + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) {} + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World worldIn, int x, int y, int z, int meta) {} + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) {} + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 10; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) {} + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if (hasTileEntity(meta) && !(this instanceof BlockContainer)) + { + worldIn.removeTileEntity(x, y, z); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(this); + } + + /** + * Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given + * EntityPlayer. + */ + public float getPlayerRelativeBlockHardness(EntityPlayer player, World worldIn, int x, int y, int z) + { + return ForgeHooks.blockStrength(this, player, worldIn, x, y, z); + } + + /** + * Drops the specified block items + */ + public final void dropBlockAsItem(World worldIn, int x, int y, int z, int meta, int fortune) + { + this.dropBlockAsItemWithChance(worldIn, x, y, z, meta, 1.0F, fortune); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + if (!worldIn.isRemote && !worldIn.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe + { + ArrayList items = getDrops(worldIn, x, y, z, meta, fortune); + chance = ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, fortune, chance, false, harvesters.get()); + + for (ItemStack item : items) + { + if (worldIn.rand.nextFloat() <= chance) + { + this.dropBlockAsItem(worldIn, x, y, z, item); + } + } + } + } + + /** + * Spawns EntityItem in the world for the given ItemStack if the world is not remote. + */ + protected void dropBlockAsItem(World worldIn, int x, int y, int z, ItemStack itemIn) + { + if (!worldIn.isRemote && worldIn.getGameRules().getGameRuleBooleanValue("doTileDrops") && !worldIn.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe + { + if (captureDrops.get()) + { + capturedDrops.get().add(itemIn); + return; + } + float f = 0.7F; + double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(worldIn, (double)x + d0, (double)y + d1, (double)z + d2, itemIn); + entityitem.delayBeforeCanPickup = 10; + worldIn.spawnEntityInWorld(entityitem); + } + } + + /** + * called by spawner, ore, redstoneOre blocks + */ + public void dropXpOnBlockBreak(World worldIn, int x, int y, int z, int amount) + { + if (!worldIn.isRemote) + { + while (amount > 0) + { + int i1 = EntityXPOrb.getXPSplit(amount); + amount -= i1; + worldIn.spawnEntityInWorld(new EntityXPOrb(worldIn, (double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, i1)); + } + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return 0; + } + + /** + * Returns how much this block can resist explosions from the passed in entity. + */ + public float getExplosionResistance(Entity exploder) + { + return this.blockResistance / 5.0F; + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + startVec = startVec.addVector((double)(-x), (double)(-y), (double)(-z)); + endVec = endVec.addVector((double)(-x), (double)(-y), (double)(-z)); + Vec3 vec32 = startVec.getIntermediateWithXValue(endVec, this.minX); + Vec3 vec33 = startVec.getIntermediateWithXValue(endVec, this.maxX); + Vec3 vec34 = startVec.getIntermediateWithYValue(endVec, this.minY); + Vec3 vec35 = startVec.getIntermediateWithYValue(endVec, this.maxY); + Vec3 vec36 = startVec.getIntermediateWithZValue(endVec, this.minZ); + Vec3 vec37 = startVec.getIntermediateWithZValue(endVec, this.maxZ); + + if (!this.isVecInsideYZBounds(vec32)) + { + vec32 = null; + } + + if (!this.isVecInsideYZBounds(vec33)) + { + vec33 = null; + } + + if (!this.isVecInsideXZBounds(vec34)) + { + vec34 = null; + } + + if (!this.isVecInsideXZBounds(vec35)) + { + vec35 = null; + } + + if (!this.isVecInsideXYBounds(vec36)) + { + vec36 = null; + } + + if (!this.isVecInsideXYBounds(vec37)) + { + vec37 = null; + } + + Vec3 vec38 = null; + + if (vec32 != null && (vec38 == null || startVec.squareDistanceTo(vec32) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec32; + } + + if (vec33 != null && (vec38 == null || startVec.squareDistanceTo(vec33) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec33; + } + + if (vec34 != null && (vec38 == null || startVec.squareDistanceTo(vec34) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec34; + } + + if (vec35 != null && (vec38 == null || startVec.squareDistanceTo(vec35) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec35; + } + + if (vec36 != null && (vec38 == null || startVec.squareDistanceTo(vec36) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec36; + } + + if (vec37 != null && (vec38 == null || startVec.squareDistanceTo(vec37) < startVec.squareDistanceTo(vec38))) + { + vec38 = vec37; + } + + if (vec38 == null) + { + return null; + } + else + { + byte b0 = -1; + + if (vec38 == vec32) + { + b0 = 4; + } + + if (vec38 == vec33) + { + b0 = 5; + } + + if (vec38 == vec34) + { + b0 = 0; + } + + if (vec38 == vec35) + { + b0 = 1; + } + + if (vec38 == vec36) + { + b0 = 2; + } + + if (vec38 == vec37) + { + b0 = 3; + } + + return new MovingObjectPosition(x, y, z, b0, vec38.addVector((double)x, (double)y, (double)z)); + } + } + + /** + * Checks if a vector is within the Y and Z bounds of the block. + */ + private boolean isVecInsideYZBounds(Vec3 point) + { + return point == null ? false : point.yCoord >= this.minY && point.yCoord <= this.maxY && point.zCoord >= this.minZ && point.zCoord <= this.maxZ; + } + + /** + * Checks if a vector is within the X and Z bounds of the block. + */ + private boolean isVecInsideXZBounds(Vec3 point) + { + return point == null ? false : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.zCoord >= this.minZ && point.zCoord <= this.maxZ; + } + + /** + * Checks if a vector is within the X and Y bounds of the block. + */ + private boolean isVecInsideXYBounds(Vec3 point) + { + return point == null ? false : point.xCoord >= this.minX && point.xCoord <= this.maxX && point.yCoord >= this.minY && point.yCoord <= this.maxY; + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World worldIn, int x, int y, int z, Explosion explosionIn) {} + + public boolean canReplace(World worldIn, int x, int y, int z, int side, ItemStack itemIn) + { + return this.canPlaceBlockOnSide(worldIn, x, y, z, side); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 0; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + return this.canPlaceBlockAt(worldIn, x, y, z); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.getBlock(x, y, z).isReplaceable(worldIn, x, y, z); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + return false; + } + + /** + * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity + */ + public void onEntityWalking(World worldIn, int x, int y, int z, Entity entityIn) {} + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + return meta; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) {} + + /** + * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d + */ + public void velocityToAddToEntity(World worldIn, int x, int y, int z, Entity entityIn, Vec3 velocity) {} + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) {} + + /** + * returns the block bounderies minX value + */ + public final double getBlockBoundsMinX() + { + return this.minX; + } + + /** + * returns the block bounderies maxX value + */ + public final double getBlockBoundsMaxX() + { + return this.maxX; + } + + /** + * returns the block bounderies minY value + */ + public final double getBlockBoundsMinY() + { + return this.minY; + } + + /** + * returns the block bounderies maxY value + */ + public final double getBlockBoundsMaxY() + { + return this.maxY; + } + + /** + * returns the block bounderies minZ value + */ + public final double getBlockBoundsMinZ() + { + return this.minZ; + } + + /** + * returns the block bounderies maxZ value + */ + public final double getBlockBoundsMaxZ() + { + return this.maxZ; + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return 16777215; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return 16777215; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return 16777215; + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return false; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) {} + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return 0; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() {} + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + player.addStat(StatList.mineBlockStatArray[getIdFromBlock(this)], 1); + player.addExhaustion(0.025F); + + if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player)) + { + ArrayList items = new ArrayList(); + ItemStack itemstack = this.createStackedBlock(meta); + + if (itemstack != null) + { + items.add(itemstack); + } + + ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player); + for (ItemStack is : items) + { + this.dropBlockAsItem(worldIn, x, y, z, is); + } + } + else + { + harvesters.set(player); + int i1 = EnchantmentHelper.getFortuneModifier(player); + this.dropBlockAsItem(worldIn, x, y, z, meta, i1); + harvesters.set(null); + } + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + Integer meta = silk_check_meta.get(); + return this.renderAsNormalBlock() && !this.hasTileEntity(meta == null ? 0 : meta); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + int j = 0; + Item item = Item.getItemFromBlock(this); + + if (item != null && item.getHasSubtypes()) + { + j = meta; + } + + return new ItemStack(item, 1, j); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + return this.quantityDropped(random); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) {} + + /** + * Called after a block is placed + */ + public void onPostBlockPlaced(World worldIn, int x, int y, int z, int meta) {} + + /** + * Sets the mod-specific block name + */ + public Block setBlockName(String name) + { + this.unlocalizedName = name; + return this; + } + + /** + * Gets the localized name of this block. Used for the statistics page. + */ + public String getLocalizedName() + { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + + /** + * Returns the unlocalized name of the block with "tile." appended to the front. + */ + public String getUnlocalizedName() + { + return "tile." + this.unlocalizedName; + } + + public boolean onBlockEventReceived(World worldIn, int x, int y, int z, int eventId, int eventData) + { + return false; + } + + /** + * Return the state of blocks statistics flags - if the block is counted for mined and placed. + */ + public boolean getEnableStats() + { + return this.enableStats; + } + + /** + * Disable statistics for the block, the block will not count for mined or placed. + */ + protected Block disableStats() + { + this.enableStats = false; + return this; + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return this.blockMaterial.getMaterialMobility(); + } + + /** + * Returns the default ambient occlusion value based on block opacity + */ + @SideOnly(Side.CLIENT) + public float getAmbientOcclusionLightValue() + { + return this.isBlockNormalCube() ? 0.2F : 1.0F; + } + + /** + * Block's chance to react to an entity falling on it. + */ + public void onFallenUpon(World worldIn, int x, int y, int z, Entity entityIn, float fallDistance) {} + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemFromBlock(this); + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return this.damageDropped(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + } + + public Block setCreativeTab(CreativeTabs tab) + { + this.displayOnCreativeTab = tab; + return this; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) {} + + /** + * Returns the CreativeTab to display the given block on. + */ + @SideOnly(Side.CLIENT) + public CreativeTabs getCreativeTabToDisplayOn() + { + return this.displayOnCreativeTab; + } + + /** + * Called on server worlds only when the block is about to be replaced by a different block or the same block with a + * different metadata value. Args: world, x, y, z, old metadata + */ + public void onBlockPreDestroy(World worldIn, int x, int y, int z, int meta) {} + + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + public void fillWithRain(World worldIn, int x, int y, int z) {} + + /** + * Returns true only if block is flowerPot + */ + @SideOnly(Side.CLIENT) + public boolean isFlowerPot() + { + return false; + } + + public boolean func_149698_L() + { + return true; + } + + /** + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion explosionIn) + { + return true; + } + + public boolean isAssociatedBlock(Block other) + { + return this == other; + } + + public static boolean isEqualTo(Block blockIn, Block other) + { + return blockIn != null && other != null ? (blockIn == other ? true : blockIn.isAssociatedBlock(other)) : false; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return false; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return 0; + } + + public Block setBlockTextureName(String textureName) + { + this.textureName = textureName; + return this; + } + + @SideOnly(Side.CLIENT) + protected String getTextureName() + { + return this.textureName == null ? "MISSING_ICON_BLOCK_" + getIdFromBlock(this) + "_" + this.unlocalizedName : this.textureName; + } + + @SideOnly(Side.CLIENT) + public IIcon func_149735_b(int side, int meta) + { + return this.getIcon(side, meta); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName()); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return null; + } + + /* ======================================== FORGE START =====================================*/ + //For ForgeInternal use Only! + protected ThreadLocal harvesters = new ThreadLocal(); + private ThreadLocal silk_check_meta = new ThreadLocal(); + /** + * Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15 + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return The light value + */ + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + if (block != this) + { + return block.getLightValue(world, x, y, z); + } + return getLightValue(); + } + + /** + * Checks if a player or entity can use this block to 'climb' like a ladder. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @param entity The entity trying to use the ladder, CAN be null. + * @return True if the block should act like a ladder + */ + public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) + { + return false; + } + + /** + * Return true if the block is a normal, solid cube. This + * determines indirect power state, entity ejection from blocks, and a few + * others. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return True if the block is a full cube + */ + public boolean isNormalCube(IBlockAccess world, int x, int y, int z) + { + return getMaterial().isOpaque() && renderAsNormalBlock() && !canProvidePower(); + } + + /** + * Checks if the block is a solid face on the given side, used by placement logic. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @param side The side to check + * @return True if the block is solid on the specified side. + */ + public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) + { + int meta = world.getBlockMetadata(x, y, z); + + if (this instanceof BlockSlab) + { + return (((meta & 8) == 8 && (side == UP)) || func_149730_j()); + } + else if (this instanceof BlockFarmland) + { + return (side != DOWN && side != UP); + } + else if (this instanceof BlockStairs) + { + boolean flipped = ((meta & 4) != 0); + return ((meta & 3) + side.ordinal() == 5) || (side == UP && flipped); + } + else if (this instanceof BlockSnow) + { + return (meta & 7) == 7; + } + else if (this instanceof BlockHopper && side == UP) + { + return true; + } + else if (this instanceof BlockCompressedPowered) + { + return true; + } + return isNormalCube(world, x, y, z); + } + + /** + * Determines if a new block can be replace the space occupied by this one, + * Used in the player's placement code to make the block act like water, and lava. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return True if the block is replaceable by another block + */ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + return blockMaterial.isReplaceable(); + } + + /** + * Determines if this block should set fire and deal fire damage + * to entities coming into contact with it. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return True if the block should deal damage + */ + public boolean isBurning(IBlockAccess world, int x, int y, int z) + { + return false; + } + + /** + * Determines this block should be treated as an air block + * by the rest of the code. This method is primarily + * useful for creating pure logic-blocks that will be invisible + * to the player and otherwise interact as air would. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return True if the block considered air + */ + public boolean isAir(IBlockAccess world, int x, int y, int z) + { + return getMaterial() == Material.air; + } + + /** + * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed. + * + * @param player The player damaging the block, may be null + * @param meta The block's current metadata + * @return True to spawn the drops + */ + public boolean canHarvestBlock(EntityPlayer player, int meta) + { + return ForgeHooks.canHarvestBlock(this, player, meta); + } + + /** + * Called when a player removes a block. This is responsible for + * actually destroying the block, and the block is intact at time of call. + * This is called regardless of whether the player can harvest the block or + * not. + * + * Return true if the block is actually destroyed. + * + * Note: When used in multiplayer, this is called on both client and + * server sides! + * + * @param world The current world + * @param player The player damaging the block, may be null + * @param x X Position + * @param y Y position + * @param z Z position + * @param willHarvest True if Block.harvestBlock will be called after this, if the return in true. + * Can be useful to delay the destruction of tile entities till after harvestBlock + * @return True if the block is actually destroyed. + */ + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) + { + return removedByPlayer(world, player, x, y, z); + } + + @Deprecated + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) + { + return world.setBlockToAir(x, y, z); + } + + /** + * Chance that fire will spread and consume this block. + * 300 being a 100% chance, 0, being a 0% chance. + * + * @param world The current world + * @param x The blocks X position + * @param y The blocks Y position + * @param z The blocks Z position + * @param face The face that the fire is coming from + * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire + */ + public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return Blocks.fire.getFlammability(this); + } + + /** + * Called when fire is updating, checks if a block face can catch fire. + * + * + * @param world The current world + * @param x The blocks X position + * @param y The blocks Y position + * @param z The blocks Z position + * @param face The face that the fire is coming from + * @return True if the face can be on fire, false otherwise. + */ + public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return getFlammability(world, x, y, z, face) > 0; + } + + /** + * Called when fire is updating on a neighbor block. + * The higher the number returned, the faster fire will spread around this block. + * + * @param world The current world + * @param x The blocks X position + * @param y The blocks Y position + * @param z The blocks Z position + * @param face The face that the fire is coming from + * @return A number that is used to determine the speed of fire growth around the block + */ + public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return Blocks.fire.getEncouragement(this); + } + + /** + * Currently only called by fire when it is on top of this block. + * Returning true will prevent the fire from naturally dying during updating. + * Also prevents firing from dying from rain. + * + * @param world The current world + * @param x The blocks X position + * @param y The blocks Y position + * @param z The blocks Z position + * @param metadata The blocks current metadata + * @param side The face that the fire is coming from + * @return True if this block sustains fire, meaning it will never go out. + */ + public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) + { + if (this == Blocks.netherrack && side == UP) + { + return true; + } + if ((world.provider instanceof WorldProviderEnd) && this == Blocks.bedrock && side == UP) + { + return true; + } + return false; + } + + private boolean isTileProvider = this instanceof ITileEntityProvider; + /** + * Called throughout the code as a replacement for block instanceof BlockContainer + * Moving this to the Block base class allows for mods that wish to extend vanilla + * blocks, and also want to have a tile entity on that block, may. + * + * Return true from this function to specify this block has a tile entity. + * + * @param metadata Metadata of the current block + * @return True if block has a tile entity, false otherwise + */ + public boolean hasTileEntity(int metadata) + { + return isTileProvider; + } + + /** + * Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity + * Return the same thing you would from that function. + * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider + * + * @param metadata The Metadata of the current block + * @return A instance of a class extending TileEntity + */ + public TileEntity createTileEntity(World world, int metadata) + { + if (isTileProvider) + { + return ((ITileEntityProvider)this).createNewTileEntity(world, metadata); + } + return null; + } + + /** + * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) + * version in 1.1. + * + * @param meta Blocks Metadata + * @param fortune Current item fortune level + * @param random Random number generator + * @return The number of items to drop + */ + public int quantityDropped(int meta, int fortune, Random random) + { + return quantityDroppedWithBonus(fortune, random); + } + + /** + * This returns a complete list of items dropped from this block. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param metadata Current metadata + * @param fortune Breakers fortune level + * @return A ArrayList containing all items this block drops + */ + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + int count = quantityDropped(metadata, fortune, world.rand); + for(int i = 0; i < count; i++) + { + Item item = getItemDropped(metadata, world.rand, fortune); + if (item != null) + { + ret.add(new ItemStack(item, 1, damageDropped(metadata))); + } + } + return ret; + } + + /** + * Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops. + * + * @param world The world + * @param player The player doing the harvesting + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param metadata The metadata + * @return True if the block can be directly harvested using silk touch + */ + public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) + { + silk_check_meta.set(metadata);; + boolean ret = this.canSilkHarvest(); + silk_check_meta.set(null); + return ret; + } + + /** + * Determines if a specified mob type can spawn on this block, returning false will + * prevent any mob from spawning on the block. + * + * @param type The Mob Category Type + * @param world The current world + * @param x The X Position + * @param y The Y Position + * @param z The Z Position + * @return True to allow a mob of the specified category to spawn, false to prevent it. + */ + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (this instanceof BlockSlab) + { + return (((meta & 8) == 8) || func_149730_j()); + } + else if (this instanceof BlockStairs) + { + return ((meta & 4) != 0); + } + return isSideSolid(world, x, y, z, UP); + } + + /** + * Determines if this block is classified as a Bed, Allowing + * players to sleep in it, though the block has to specifically + * perform the sleeping functionality in it's activated event. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param player The player or camera entity, null in some cases. + * @return True to treat this as a bed + */ + public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player) + { + return this == Blocks.bed; + } + + /** + * Returns the position that the player is moved to upon + * waking up, or respawning at the bed. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param player The player or camera entity, null in some cases. + * @return The spawn position + */ + public ChunkCoordinates getBedSpawnPosition(IBlockAccess world, int x, int y, int z, EntityPlayer player) + { + if (world instanceof World) + return BlockBed.func_149977_a((World)world, x, y, z, 0); + return null; + } + + /** + * Called when a user either starts or stops sleeping in the bed. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param player The player or camera entity, null in some cases. + * @param occupied True if we are occupying the bed, or false if they are stopping use of the bed + */ + public void setBedOccupied(IBlockAccess world, int x, int y, int z, EntityPlayer player, boolean occupied) + { + if (world instanceof World) + BlockBed.func_149979_a((World)world, x, y, z, occupied); + } + + /** + * Returns the direction of the block. Same values that + * are returned by BlockDirectional + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return Bed direction + */ + public int getBedDirection(IBlockAccess world, int x, int y, int z) + { + return BlockBed.getDirection(world.getBlockMetadata(x, y, z)); + } + + /** + * Determines if the current block is the foot half of the bed. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return True if the current block is the foot side of a bed. + */ + public boolean isBedFoot(IBlockAccess world, int x, int y, int z) + { + return BlockBed.isBlockHeadOfBed(world.getBlockMetadata(x, y, z)); + } + + /** + * Called when a leaf should start its decay process. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + */ + public void beginLeavesDecay(World world, int x, int y, int z){} + + /** + * Determines if this block can prevent leaves connected to it from decaying. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return true if the presence this block can prevent leaves from decaying. + */ + public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) + { + return false; + } + + /** + * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return true if this block is considered leaves. + */ + public boolean isLeaves(IBlockAccess world, int x, int y, int z) + { + return getMaterial() == Material.leaves; + } + + /** + * Used during tree growth to determine if newly generated leaves can replace this block. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return true if this block can be replaced by growing leaves. + */ + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) + { + return !func_149730_j(); + } + + /** + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return true if the block is wood (logs) + */ + public boolean isWood(IBlockAccess world, int x, int y, int z) + { + return false; + } + + /** + * Determines if the current block is replaceable by Ore veins during world generation. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param target The generic target block the gen is looking for, Standards define stone + * for overworld generation, and neatherack for the nether. + * @return True to allow this block to be replaced by a ore + */ + public boolean isReplaceableOreGen(World world, int x, int y, int z, Block target) + { + return this == target; + } + + /** + * Location sensitive version of getExplosionRestance + * + * @param par1Entity The entity that caused the explosion + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param explosionX Explosion source X Position + * @param explosionY Explosion source X Position + * @param explosionZ Explosion source X Position + * @return The amount of the explosion absorbed. + */ + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + return getExplosionResistance(par1Entity); + } + + /** + * Called when the block is destroyed by an explosion. + * Useful for allowing the block to take into account tile entities, + * metadata, etc. when exploded, before it is removed. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param Explosion The explosion instance affecting the block + */ + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) + { + world.setBlockToAir(x, y, z); + onBlockDestroyedByExplosion(world, x, y, z, explosion); + } + + /** + * Determine if this block can make a redstone connection on the side provided, + * Useful to control which sides are inputs and outputs for redstone wires. + * + * Side: + * -1: UP + * 0: NORTH + * 1: EAST + * 2: SOUTH + * 3: WEST + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param side The side that is trying to make the connection + * @return True to make the connection + */ + public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + { + return canProvidePower() && side != -1; + } + + /** + * Determines if a torch can be placed on the top surface of this block. + * Useful for creating your own block that torches can be on, such as fences. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return True to allow the torch to be placed + */ + public boolean canPlaceTorchOnTop(World world, int x, int y, int z) + { + if (isSideSolid(world, x, y, z, UP)) + { + return true; + } + else + { + return this == Blocks.fence || this == Blocks.nether_brick_fence || this == Blocks.glass || this == Blocks.cobblestone_wall; + } + } + + /** + * Determines if this block should render in this pass. + * + * @param pass The pass in question + * @return True to render + */ + public boolean canRenderInPass(int pass) + { + return pass == getRenderBlockPass(); + } + + /** + * Called when a user uses the creative pick block button on this block + * + * @param target The full target the player is looking at + * @return A ItemStack to add to the player's inventory, Null if nothing should be added. + */ + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) + { + return getPickBlock(target, world, x, y, z); + } + @Deprecated + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + Item item = getItem(world, x, y, z); + + if (item == null) + { + return null; + } + + Block block = item instanceof ItemBlock && !isFlowerPot() ? Block.getBlockFromItem(item) : this; + return new ItemStack(item, 1, block.getDamageValue(world, x, y, z)); + } + + /** + * Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc + * Also used to determine if the player can spawn on this block. + * + * @return False to disallow spawning + */ + public boolean isFoliage(IBlockAccess world, int x, int y, int z) + { + return false; + } + + /** + * Spawn a digging particle effect in the world, this is a wrapper + * around EffectRenderer.addBlockHitEffects to allow the block more + * control over the particles. Useful when you have entirely different + * texture sheets for different sides/locations in the world. + * + * @param world The current world + * @param target The target the player is looking at {x/y/z/side/sub} + * @param effectRenderer A reference to the current effect renderer. + * @return True to prevent vanilla digging particles form spawning. + */ + @SideOnly(Side.CLIENT) + public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) + { + return false; + } + + /** + * Spawn particles for when the block is destroyed. Due to the nature + * of how this is invoked, the x/y/z locations are not always guaranteed + * to host your block. So be sure to do proper sanity checks before assuming + * that the location is this block. + * + * @param world The current world + * @param x X position to spawn the particle + * @param y Y position to spawn the particle + * @param z Z position to spawn the particle + * @param meta The metadata for the block before it was destroyed. + * @param effectRenderer A reference to the current effect renderer. + * @return True to prevent vanilla break particles from spawning. + */ + @SideOnly(Side.CLIENT) + public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) + { + return false; + } + + /** + * Determines if this block can support the passed in plant, allowing it to be planted and grow. + * Some examples: + * Reeds check if its a reed, or if its sand/dirt/grass and adjacent to water + * Cacti checks if its a cacti, or if its sand + * Nether types check for soul sand + * Crops check for tilled soil + * Caves check if it's a solid surface + * Plains check if its grass or dirt + * Water check if its still water + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z position + * @param direction The direction relative to the given position the plant wants to be, typically its UP + * @param plantable The plant that wants to check + * @return True to allow the plant to be planted/stay. + */ + public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) + { + Block plant = plantable.getPlant(world, x, y + 1, z); + EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z); + + if (plant == Blocks.cactus && this == Blocks.cactus) + { + return true; + } + + if (plant == Blocks.reeds && this == Blocks.reeds) + { + return true; + } + + if (plantable instanceof BlockBush && ((BlockBush)plantable).canPlaceBlockOn(this)) + { + return true; + } + + switch (plantType) + { + case Desert: return this == Blocks.sand; + case Nether: return this == Blocks.soul_sand; + case Crop: return this == Blocks.farmland; + case Cave: return isSideSolid(world, x, y, z, UP); + case Plains: return this == Blocks.grass || this == Blocks.dirt || this == Blocks.farmland; + case Water: return world.getBlock(x, y, z).getMaterial() == Material.water && world.getBlockMetadata(x, y, z) == 0; + case Beach: + boolean isBeach = this == Blocks.grass || this == Blocks.dirt || this == Blocks.sand; + boolean hasWater = (world.getBlock(x - 1, y, z ).getMaterial() == Material.water || + world.getBlock(x + 1, y, z ).getMaterial() == Material.water || + world.getBlock(x, y, z - 1).getMaterial() == Material.water || + world.getBlock(x, y, z + 1).getMaterial() == Material.water); + return isBeach && hasWater; + } + + return false; + } + + /** + * Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now. + * Modder may implement this for custom plants. + * This does not use ForgeDirection, because large/huge trees can be located in non-representable direction, + * so the source location is specified. + * Currently this just changes the block to dirt if it was grass. + * + * Note: This happens DURING the generation, the generation may not be complete when this is called. + * + * @param world Current world + * @param x Soil X + * @param y Soil Y + * @param z Soil Z + * @param sourceX Plant growth location X + * @param sourceY Plant growth location Y + * @param sourceZ Plant growth location Z + */ + public void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { + if (this == Blocks.grass || this == Blocks.farmland) + { + world.setBlock(x, y, z, Blocks.dirt, 0, 2); + } + } + + /** + * Checks if this soil is fertile, typically this means that growth rates + * of plants on this soil will be slightly sped up. + * Only vanilla case is tilledField when it is within range of water. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z position + * @return True if the soil should be considered fertile. + */ + public boolean isFertile(World world, int x, int y, int z) + { + if (this == Blocks.farmland) + { + return world.getBlockMetadata(x, y, z) > 0; + } + + return false; + } + + /** + * Location aware and overrideable version of the lightOpacity array, + * return the number to subtract from the light value when it passes through this block. + * + * This is not guaranteed to have the tile entity in place before this is called, so it is + * Recommended that you have your tile entity call relight after being placed if you + * rely on it for light info. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z position + * @return The amount of light to block, 0 for air, 255 for fully opaque. + */ + public int getLightOpacity(IBlockAccess world, int x, int y, int z) + { + return getLightOpacity(); + } + + /** + * Determines if this block is can be destroyed by the specified entities normal behavior. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z position + * @return True to allow the ender dragon to destroy this block + */ + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) + { + if (entity instanceof EntityWither) + { + return this != Blocks.bedrock && this != Blocks.end_portal && this != Blocks.end_portal_frame && this != Blocks.command_block; + } + else if (entity instanceof EntityDragon) + { + return this != Blocks.obsidian && this != Blocks.end_stone && this != Blocks.bedrock; + } + + return true; + } + + /** + * Determines if this block can be used as the base of a beacon. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z position + * @param beaconX Beacons X Position + * @param beaconY Beacons Y Position + * @param beaconZ Beacons Z Position + * @return True, to support the beacon, and make it active with this block. + */ + public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) + { + return this == Blocks.emerald_block || this == Blocks.gold_block || this == Blocks.diamond_block || this == Blocks.iron_block; + } + + /** + * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit). + * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the + * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations. + * The method should return true if the rotation was successful though. + * + * @param worldObj The world + * @param x X position + * @param y Y position + * @param z Z position + * @param axis The axis to rotate around + * @return True if the rotation was successful, False if the rotation failed, or is not possible + */ + public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) + { + return RotationHelper.rotateVanillaBlock(this, worldObj, x, y, z, axis); + } + + /** + * Get the rotations that can apply to the block at the specified coordinates. Null means no rotations are possible. + * Note, this is up to the block to decide. It may not be accurate or representative. + * @param worldObj The world + * @param x X position + * @param y Y position + * @param z Z position + * @return An array of valid axes to rotate around, or null for none or unknown + */ + public ForgeDirection[] getValidRotations(World worldObj, int x, int y, int z) + { + return RotationHelper.getValidVanillaBlockRotations(this); + } + + /** + * Determines the amount of enchanting power this block can provide to an enchanting table. + * @param world The World + * @param x X position + * @param y Y position + * @param z Z position + * @return The amount of enchanting power this block produces. + */ + public float getEnchantPowerBonus(World world, int x, int y, int z) + { + return this == Blocks.bookshelf ? 1 : 0; + } + + /** + * Common way to recolour a block with an external tool + * @param world The world + * @param x X + * @param y Y + * @param z Z + * @param side The side hit with the colouring tool + * @param colour The colour to change to + * @return If the recolouring was successful + */ + public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) + { + if (this == Blocks.wool) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta != colour) + { + world.setBlockMetadataWithNotify(x, y, z, colour, 3); + return true; + } + } + return false; + } + + /** + * Gathers how much experience this block drops when broken. + * + * @param world The world + * @param metadata + * @param fortune + * @return Amount of XP from breaking this block. + */ + public int getExpDrop(IBlockAccess world, int metadata, int fortune) + { + return 0; + } + + /** + * Called when a tile entity on a side of this block changes is created or is destroyed. + * @param world The world + * @param x The x position of this block instance + * @param y The y position of this block instance + * @param z The z position of this block instance + * @param tileX The x position of the tile that changed + * @param tileY The y position of the tile that changed + * @param tileZ The z position of the tile that changed + */ + public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) + { + } + + /** + * Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules. + * @param world The world + * @param x The x position of this block instance + * @param y The y position of this block instance + * @param z The z position of this block instance + * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side + * @return Whether Block#isProvidingWeakPower should be called when determining indirect power + */ + public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) + { + return isNormalCube(); + } + + /** + * If this block should be notified of weak changes. + * Weak changes are changes 1 block away through a solid block. + * Similar to comparators. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @param side The side to check + * @return true To be notified of changes + */ + public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) + { + return false; + } + + private String[] harvestTool = new String[16]; + private int[] harvestLevel = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; + /** + * Sets or removes the tool and level required to harvest this block. + * + * @param toolClass Class + * @param level Harvest level: + * Wood: 0 + * Stone: 1 + * Iron: 2 + * Diamond: 3 + * Gold: 0 + */ + public void setHarvestLevel(String toolClass, int level) + { + for (int m = 0; m < 16; m++) + { + setHarvestLevel(toolClass, level, m); + } + } + + /** + * Sets or removes the tool and level required to harvest this block. + * + * @param toolClass Class + * @param level Harvest level: + * Wood: 0 + * Stone: 1 + * Iron: 2 + * Diamond: 3 + * Gold: 0 + * @param metadata The specific metadata to set + */ + public void setHarvestLevel(String toolClass, int level, int metadata) + { + this.harvestTool[metadata] = toolClass; + this.harvestLevel[metadata] = level; + } + + /** + * Queries the class of tool required to harvest this block, if null is returned + * we assume that anything can harvest this block. + * + * @param metadata + * @return + */ + public String getHarvestTool(int metadata) + { + return harvestTool[metadata]; + } + + /** + * Queries the harvest level of this item stack for the specifred tool class, + * Returns -1 if this tool is not of the specified type + * + * @param stack This item stack instance + * @return Harvest level, or -1 if not the specified tool type. + */ + public int getHarvestLevel(int metadata) + { + return harvestLevel[metadata]; + } + + /** + * Checks if the specified tool type is efficient on this block, + * meaning that it digs at full speed. + * + * @param type + * @param metadata + * @return + */ + public boolean isToolEffective(String type, int metadata) + { + if ("pickaxe".equals(type) && (this == Blocks.redstone_ore || this == Blocks.lit_redstone_ore || this == Blocks.obsidian)) + return false; + if (harvestTool[metadata] == null) return false; + return harvestTool[metadata].equals(type); + } + + + // For Inernal use only to capture droped items inside getDrops + protected ThreadLocal captureDrops = new ThreadLocal() + { + @Override protected Boolean initialValue() { return false; } + }; + protected ThreadLocal> capturedDrops = new ThreadLocal>() + { + @Override protected List initialValue() { return new ArrayList(); } + }; + protected List captureDrops(boolean start) + { + if (start) + { + captureDrops.set(true); + capturedDrops.get().clear(); + return null; + } + else + { + captureDrops.set(false); + return capturedDrops.get(); + } + } + /* ========================================= FORGE END ======================================*/ + + public static class SoundType + { + public final String soundName; + public final float volume; + public final float frequency; + private static final String __OBFID = "CL_00000203"; + + public SoundType(String name, float volume, float frequency) + { + this.soundName = name; + this.volume = volume; + this.frequency = frequency; + } + + public float getVolume() + { + return this.volume; + } + + public float getPitch() + { + return this.frequency; + } + + /** + * Used when a block breaks, e.g.: Player break, Sheep eating grass, etc.. + */ + public String getBreakSound() + { + return "dig." + this.soundName; + } + + public String getStepResourcePath() + { + return "step." + this.soundName; + } + + public String func_150496_b() + { + return this.getBreakSound(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockAir.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockAir.java new file mode 100644 index 0000000..4537da8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockAir.java @@ -0,0 +1,56 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockAir extends Block +{ + private static final String __OBFID = "CL_00000190"; + + protected BlockAir() + { + super(Material.air); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int meta, boolean includeLiquid) + { + return false; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockAnvil.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockAnvil.java new file mode 100644 index 0000000..d034920 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockAnvil.java @@ -0,0 +1,192 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockAnvil extends BlockFalling +{ + public static final String[] anvilDamageNames = new String[] {"intact", "slightlyDamaged", "veryDamaged"}; + private static final String[] anvilIconNames = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; + @SideOnly(Side.CLIENT) + public int anvilRenderSide; + @SideOnly(Side.CLIENT) + private IIcon[] anvilIcons; + private static final String __OBFID = "CL_00000192"; + + protected BlockAnvil() + { + super(Material.anvil); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (this.anvilRenderSide == 3 && side == 1) + { + int k = (meta >> 2) % this.anvilIcons.length; + return this.anvilIcons[k]; + } + else + { + return this.blockIcon; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("anvil_base"); + this.anvilIcons = new IIcon[anvilIconNames.length]; + + for (int i = 0; i < this.anvilIcons.length; ++i) + { + this.anvilIcons[i] = reg.registerIcon(anvilIconNames[i]); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int i1 = worldIn.getBlockMetadata(x, y, z) >> 2; + ++l; + l %= 4; + + if (l == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 2 | i1 << 2, 2); + } + + if (l == 1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 3 | i1 << 2, 2); + } + + if (l == 2) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 0 | i1 << 2, 2); + } + + if (l == 3) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 1 | i1 << 2, 2); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + player.displayGUIAnvil(x, y, z); + return true; + } + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 35; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta >> 2; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z) & 3; + + if (l != 3 && l != 1) + { + this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + } + + protected void func_149829_a(EntityFallingBlock p_149829_1_) + { + p_149829_1_.func_145806_a(true); + } + + public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) + { + p_149828_1_.playAuxSFX(1022, p_149828_2_, p_149828_3_, p_149828_4_, 0); + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBasePressurePlate.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBasePressurePlate.java new file mode 100644 index 0000000..866a0c5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBasePressurePlate.java @@ -0,0 +1,249 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockBasePressurePlate extends Block +{ + private String field_150067_a; + private static final String __OBFID = "CL_00000194"; + + protected BlockBasePressurePlate(String name, Material materialIn) + { + super(materialIn); + this.field_150067_a = name; + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + this.func_150063_b(this.func_150066_d(15)); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_150063_b(worldIn.getBlockMetadata(x, y, z)); + } + + protected void func_150063_b(int meta) + { + boolean flag = this.func_150060_c(meta) > 0; + float f = 0.0625F; + + if (flag) + { + this.setBlockBounds(f, 0.0F, f, 1.0F - f, 0.03125F, 1.0F - f); + } + else + { + this.setBlockBounds(f, 0.0F, f, 1.0F - f, 0.0625F, 1.0F - f); + } + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 20; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return true; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) || BlockFence.func_149825_a(worldIn.getBlock(x, y - 1, z)); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + boolean flag = false; + + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && !BlockFence.func_149825_a(worldIn.getBlock(x, y - 1, z))) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + int l = this.func_150060_c(worldIn.getBlockMetadata(x, y, z)); + + if (l > 0) + { + this.func_150062_a(worldIn, x, y, z, l); + } + } + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (!worldIn.isRemote) + { + int l = this.func_150060_c(worldIn.getBlockMetadata(x, y, z)); + + if (l == 0) + { + this.func_150062_a(worldIn, x, y, z, l); + } + } + } + + protected void func_150062_a(World worldIn, int x, int y, int z, int power) + { + int i1 = this.func_150065_e(worldIn, x, y, z); + boolean flag = power > 0; + boolean flag1 = i1 > 0; + + if (power != i1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, this.func_150066_d(i1), 2); + this.func_150064_a_(worldIn, x, y, z); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + } + + if (!flag1 && flag) + { + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.1D, (double)z + 0.5D, "random.click", 0.3F, 0.5F); + } + else if (flag1 && !flag) + { + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.1D, (double)z + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (flag1) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + } + + protected AxisAlignedBB func_150061_a(int x, int y, int z) + { + float f = 0.125F; + return AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)y + 0.25D, (double)((float)(z + 1) - f)); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if (this.func_150060_c(meta) > 0) + { + this.func_150064_a_(worldIn, x, y, z); + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + protected void func_150064_a_(World worldIn, int x, int y, int z) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return this.func_150060_c(worldIn.getBlockMetadata(x, y, z)); + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 1 ? this.func_150060_c(worldIn.getBlockMetadata(x, y, z)) : 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.5F; + float f1 = 0.125F; + float f2 = 0.5F; + this.setBlockBounds(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2); + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return 1; + } + + protected abstract int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_); + + protected abstract int func_150060_c(int p_150060_1_); + + protected abstract int func_150066_d(int p_150066_1_); + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.field_150067_a); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBeacon.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBeacon.java new file mode 100644 index 0000000..ec93308 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBeacon.java @@ -0,0 +1,99 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.world.World; + +public class BlockBeacon extends BlockContainer +{ + private static final String __OBFID = "CL_00000197"; + + public BlockBeacon() + { + super(Material.glass); + this.setHardness(3.0F); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityBeacon(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityBeacon tileentitybeacon = (TileEntityBeacon)worldIn.getTileEntity(x, y, z); + + if (tileentitybeacon != null) + { + player.func_146104_a(tileentitybeacon); + } + + return true; + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 34; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + super.onBlockPlacedBy(worldIn, x, y, z, placer, itemIn); + + if (itemIn.hasDisplayName()) + { + ((TileEntityBeacon)worldIn.getTileEntity(x, y, z)).func_145999_a(itemIn.getDisplayName()); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBed.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBed.java new file mode 100644 index 0000000..d46ea8a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBed.java @@ -0,0 +1,346 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class BlockBed extends BlockDirectional +{ + public static final int[][] field_149981_a = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; + @SideOnly(Side.CLIENT) + private IIcon[] field_149980_b; + @SideOnly(Side.CLIENT) + private IIcon[] field_149982_M; + @SideOnly(Side.CLIENT) + private IIcon[] field_149983_N; + private static final String __OBFID = "CL_00000198"; + + public BlockBed() + { + super(Material.cloth); + this.func_149978_e(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (!isBlockHeadOfBed(i1)) + { + int j1 = getDirection(i1); + x += field_149981_a[j1][0]; + z += field_149981_a[j1][1]; + + if (worldIn.getBlock(x, y, z) != this) + { + return true; + } + + i1 = worldIn.getBlockMetadata(x, y, z); + } + + if (worldIn.provider.canRespawnHere() && worldIn.getBiomeGenForCoords(x, z) != BiomeGenBase.hell) + { + if (func_149976_c(i1)) + { + EntityPlayer entityplayer1 = null; + Iterator iterator = worldIn.playerEntities.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer2 = (EntityPlayer)iterator.next(); + + if (entityplayer2.isPlayerSleeping()) + { + ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation; + + if (chunkcoordinates.posX == x && chunkcoordinates.posY == y && chunkcoordinates.posZ == z) + { + entityplayer1 = entityplayer2; + } + } + } + + if (entityplayer1 != null) + { + player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0])); + return true; + } + + func_149979_a(worldIn, x, y, z, false); + } + + EntityPlayer.EnumStatus enumstatus = player.sleepInBedAt(x, y, z); + + if (enumstatus == EntityPlayer.EnumStatus.OK) + { + func_149979_a(worldIn, x, y, z, true); + return true; + } + else + { + if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) + { + player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0])); + } + else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) + { + player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0])); + } + + return true; + } + } + else + { + double d2 = (double)x + 0.5D; + double d0 = (double)y + 0.5D; + double d1 = (double)z + 0.5D; + worldIn.setBlockToAir(x, y, z); + int k1 = getDirection(i1); + x += field_149981_a[k1][0]; + z += field_149981_a[k1][1]; + + if (worldIn.getBlock(x, y, z) == this) + { + worldIn.setBlockToAir(x, y, z); + d2 = (d2 + (double)x + 0.5D) / 2.0D; + d0 = (d0 + (double)y + 0.5D) / 2.0D; + d1 = (d1 + (double)z + 0.5D) / 2.0D; + } + + worldIn.newExplosion((Entity)null, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), 5.0F, true, true); + return true; + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (side == 0) + { + return Blocks.planks.getBlockTextureFromSide(side); + } + else + { + int k = getDirection(meta); + int l = Direction.bedDirection[k][side]; + int i1 = isBlockHeadOfBed(meta) ? 1 : 0; + return (i1 != 1 || l != 2) && (i1 != 0 || l != 3) ? (l != 5 && l != 4 ? this.field_149983_N[i1] : this.field_149982_M[i1]) : this.field_149980_b[i1]; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149983_N = new IIcon[] {reg.registerIcon(this.getTextureName() + "_feet_top"), reg.registerIcon(this.getTextureName() + "_head_top")}; + this.field_149980_b = new IIcon[] {reg.registerIcon(this.getTextureName() + "_feet_end"), reg.registerIcon(this.getTextureName() + "_head_end")}; + this.field_149982_M = new IIcon[] {reg.registerIcon(this.getTextureName() + "_feet_side"), reg.registerIcon(this.getTextureName() + "_head_side")}; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 14; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_149978_e(); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = getDirection(l); + + if (isBlockHeadOfBed(l)) + { + if (worldIn.getBlock(x - field_149981_a[i1][0], y, z - field_149981_a[i1][1]) != this) + { + worldIn.setBlockToAir(x, y, z); + } + } + else if (worldIn.getBlock(x + field_149981_a[i1][0], y, z + field_149981_a[i1][1]) != this) + { + worldIn.setBlockToAir(x, y, z); + + if (!worldIn.isRemote) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return isBlockHeadOfBed(meta) ? Item.getItemById(0) : Items.bed; + } + + private void func_149978_e() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); + } + + /** + * Returns whether or not this bed block is the head of the bed. + */ + public static boolean isBlockHeadOfBed(int meta) + { + return (meta & 8) != 0; + } + + public static boolean func_149976_c(int meta) + { + return (meta & 4) != 0; + } + + public static void func_149979_a(World worldIn, int x, int y, int z, boolean occupied) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (occupied) + { + l |= 4; + } + else + { + l &= -5; + } + + worldIn.setBlockMetadataWithNotify(x, y, z, l, 4); + } + + public static ChunkCoordinates func_149977_a(World worldIn, int x, int y, int z, int safeIndex) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + int j1 = BlockDirectional.getDirection(i1); + + for (int k1 = 0; k1 <= 1; ++k1) + { + int l1 = x - field_149981_a[j1][0] * k1 - 1; + int i2 = z - field_149981_a[j1][1] * k1 - 1; + int j2 = l1 + 2; + int k2 = i2 + 2; + + for (int l2 = l1; l2 <= j2; ++l2) + { + for (int i3 = i2; i3 <= k2; ++i3) + { + if (World.doesBlockHaveSolidTopSurface(worldIn, l2, y - 1, i3) && !worldIn.getBlock(l2, y, i3).getMaterial().isOpaque() && !worldIn.getBlock(l2, y + 1, i3).getMaterial().isOpaque()) + { + if (safeIndex <= 0) + { + return new ChunkCoordinates(l2, y, i3); + } + + --safeIndex; + } + } + } + } + + return null; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + if (!isBlockHeadOfBed(meta)) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, 0); + } + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.bed; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (player.capabilities.isCreativeMode && isBlockHeadOfBed(meta)) + { + int i1 = getDirection(meta); + x -= field_149981_a[i1][0]; + z -= field_149981_a[i1][1]; + + if (worldIn.getBlock(x, y, z) == this) + { + worldIn.setBlockToAir(x, y, z); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBookshelf.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBookshelf.java new file mode 100644 index 0000000..5b63641 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBookshelf.java @@ -0,0 +1,44 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockBookshelf extends Block +{ + private static final String __OBFID = "CL_00000206"; + + public BlockBookshelf() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side != 1 && side != 0 ? super.getIcon(side, meta) : Blocks.planks.getBlockTextureFromSide(side); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 3; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.book; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBreakable.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBreakable.java new file mode 100644 index 0000000..fa40818 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBreakable.java @@ -0,0 +1,63 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; + +public class BlockBreakable extends Block +{ + private boolean field_149996_a; + private String field_149995_b; + private static final String __OBFID = "CL_00000254"; + + protected BlockBreakable(String name, Material materialIn, boolean ignoreSimilarity) + { + super(materialIn); + this.field_149996_a = ignoreSimilarity; + this.field_149995_b = name; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + Block block = worldIn.getBlock(x, y, z); + + if (this == Blocks.glass || this == Blocks.stained_glass) + { + if (worldIn.getBlockMetadata(x, y, z) != worldIn.getBlockMetadata(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z - Facing.offsetsZForSide[side])) + { + return true; + } + + if (block == this) + { + return false; + } + } + + return !this.field_149996_a && block == this ? false : super.shouldSideBeRendered(worldIn, x, y, z, side); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.field_149995_b); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBrewingStand.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBrewingStand.java new file mode 100644 index 0000000..b3cb164 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBrewingStand.java @@ -0,0 +1,220 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockBrewingStand extends BlockContainer +{ + private Random field_149961_a = new Random(); + @SideOnly(Side.CLIENT) + private IIcon iconBrewingStandBase; + private static final String __OBFID = "CL_00000207"; + + public BlockBrewingStand() + { + super(Material.iron); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 25; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityBrewingStand(); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBoundsForItemRender(); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityBrewingStand tileentitybrewingstand = (TileEntityBrewingStand)worldIn.getTileEntity(x, y, z); + + if (tileentitybrewingstand != null) + { + player.func_146098_a(tileentitybrewingstand); + } + + return true; + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + if (itemIn.hasDisplayName()) + { + ((TileEntityBrewingStand)worldIn.getTileEntity(x, y, z)).func_145937_a(itemIn.getDisplayName()); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + + if (tileentity instanceof TileEntityBrewingStand) + { + TileEntityBrewingStand tileentitybrewingstand = (TileEntityBrewingStand)tileentity; + + for (int i1 = 0; i1 < tileentitybrewingstand.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentitybrewingstand.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149961_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149961_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.field_149961_a.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.field_149961_a.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.field_149961_a.nextGaussian() * f3); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.brewing_stand; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + double d0 = (double)((float)x + 0.4F + random.nextFloat() * 0.2F); + double d1 = (double)((float)y + 0.7F + random.nextFloat() * 0.3F); + double d2 = (double)((float)z + 0.4F + random.nextFloat() * 0.2F); + worldIn.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.brewing_stand; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return Container.calcRedstoneFromInventory((IInventory)worldIn.getTileEntity(x, y, z)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + this.iconBrewingStandBase = reg.registerIcon(this.getTextureName() + "_base"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconBrewingStandBase() + { + return this.iconBrewingStandBase; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockBush.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBush.java new file mode 100644 index 0000000..d20c731 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockBush.java @@ -0,0 +1,153 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.IPlantable; +import static net.minecraftforge.common.EnumPlantType.*; + +public class BlockBush extends Block implements IPlantable +{ + private static final String __OBFID = "CL_00000208"; + + protected BlockBush(Material materialIn) + { + super(materialIn); + this.setTickRandomly(true); + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + protected BlockBush() + { + this(Material.plants); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return super.canPlaceBlockAt(worldIn, x, y, z) && this.canBlockStay(worldIn, x, y, z); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.grass || ground == Blocks.dirt || ground == Blocks.farmland; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + this.checkAndDropBlock(worldIn, x, y, z); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + this.checkAndDropBlock(worldIn, x, y, z); + } + + /** + * checks if the block can stay, if not drop as item + */ + protected void checkAndDropBlock(World worldIn, int x, int y, int z) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlock(x, y, z, getBlockById(0), 0, 2); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return worldIn.getBlock(x, y - 1, z).canSustainPlant(worldIn, x, y - 1, z, ForgeDirection.UP, this); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 1; + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { + if (this == Blocks.wheat) return Crop; + if (this == Blocks.carrots) return Crop; + if (this == Blocks.potatoes) return Crop; + if (this == Blocks.melon_stem) return Crop; + if (this == Blocks.pumpkin_stem) return Crop; + if (this == Blocks.deadbush) return Desert; + if (this == Blocks.waterlily) return Water; + if (this == Blocks.red_mushroom) return Cave; + if (this == Blocks.brown_mushroom) return Cave; + if (this == Blocks.nether_wart) return Nether; + if (this == Blocks.sapling) return Plains; + if (this == Blocks.tallgrass) return Plains; + if (this == Blocks.double_plant) return Plains; + if (this == Blocks.red_flower) return Plains; + if (this == Blocks.yellow_flower) return Plains; + return Plains; + } + + @Override + public Block getPlant(IBlockAccess world, int x, int y, int z) + { + return this; + } + + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { + return world.getBlockMetadata(x, y, z); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockButton.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButton.java new file mode 100644 index 0000000..bfee0c8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButton.java @@ -0,0 +1,410 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public abstract class BlockButton extends Block +{ + private final boolean field_150047_a; + private static final String __OBFID = "CL_00000209"; + + protected BlockButton(boolean wooden) + { + super(Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.field_150047_a = wooden; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return this.field_150047_a ? 30 : 20; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + ForgeDirection dir = ForgeDirection.getOrientation(side); + return (dir == NORTH && worldIn.isSideSolid(x, y, z + 1, NORTH)) || + (dir == SOUTH && worldIn.isSideSolid(x, y, z - 1, SOUTH)) || + (dir == WEST && worldIn.isSideSolid(x + 1, y, z, WEST)) || + (dir == EAST && worldIn.isSideSolid(x - 1, y, z, EAST)); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return (worldIn.isSideSolid(x - 1, y, z, EAST)) || + (worldIn.isSideSolid(x + 1, y, z, WEST)) || + (worldIn.isSideSolid(x, y, z - 1, SOUTH)) || + (worldIn.isSideSolid(x, y, z + 1, NORTH)); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = worldIn.getBlockMetadata(x, y, z); + int k1 = j1 & 8; + j1 &= 7; + + ForgeDirection dir = ForgeDirection.getOrientation(side); + + if (dir == NORTH && worldIn.isSideSolid(x, y, z + 1, NORTH)) + { + j1 = 4; + } + else if (dir == SOUTH && worldIn.isSideSolid(x, y, z - 1, SOUTH)) + { + j1 = 3; + } + else if (dir == WEST && worldIn.isSideSolid(x + 1, y, z, WEST)) + { + j1 = 2; + } + else if (dir == EAST && worldIn.isSideSolid(x - 1, y, z, EAST)) + { + j1 = 1; + } + else + { + j1 = this.func_150045_e(worldIn, x, y, z); + } + + return j1 + k1; + } + + private int func_150045_e(World worldIn, int x, int y, int z) + { + if (worldIn.isSideSolid(x - 1, y, z, EAST)) return 1; + if (worldIn.isSideSolid(x + 1, y, z, WEST)) return 2; + if (worldIn.isSideSolid(x, y, z - 1, SOUTH)) return 3; + if (worldIn.isSideSolid(x, y, z + 1, NORTH)) return 4; + return 1; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (this.func_150044_m(worldIn, x, y, z)) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + boolean flag = false; + + if (!worldIn.isSideSolid(x - 1, y, z, EAST) && l == 1) + { + flag = true; + } + + if (!worldIn.isSideSolid(x + 1, y, z, WEST) && l == 2) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z - 1, SOUTH) && l == 3) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z + 1, NORTH) && l == 4) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } + } + + private boolean func_150044_m(World worldIn, int x, int y, int z) + { + if (!this.canPlaceBlockAt(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + return false; + } + else + { + return true; + } + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + this.func_150043_b(l); + } + + private void func_150043_b(int meta) + { + int j = meta & 7; + boolean flag = (meta & 8) > 0; + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.1875F; + float f3 = 0.125F; + + if (flag) + { + f3 = 0.0625F; + } + + if (j == 1) + { + this.setBlockBounds(0.0F, f, 0.5F - f2, f3, f1, 0.5F + f2); + } + else if (j == 2) + { + this.setBlockBounds(1.0F - f3, f, 0.5F - f2, 1.0F, f1, 0.5F + f2); + } + else if (j == 3) + { + this.setBlockBounds(0.5F - f2, f, 0.0F, 0.5F + f2, f1, f3); + } + else if (j == 4) + { + this.setBlockBounds(0.5F - f2, f, 1.0F - f3, 0.5F + f2, f1, 1.0F); + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + int j1 = i1 & 7; + int k1 = 8 - (i1 & 8); + + if (k1 == 0) + { + return true; + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, j1 + k1, 3); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, 0.6F); + this.func_150042_a(worldIn, x, y, z, j1); + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + return true; + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if ((meta & 8) > 0) + { + int i1 = meta & 7; + this.func_150042_a(worldIn, x, y, z, i1); + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return (worldIn.getBlockMetadata(x, y, z) & 8) > 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if ((i1 & 8) == 0) + { + return 0; + } + else + { + int j1 = i1 & 7; + return j1 == 5 && side == 1 ? 15 : (j1 == 4 && side == 2 ? 15 : (j1 == 3 && side == 3 ? 15 : (j1 == 2 && side == 4 ? 15 : (j1 == 1 && side == 5 ? 15 : 0)))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if ((l & 8) != 0) + { + if (this.field_150047_a) + { + this.func_150046_n(worldIn, x, y, z); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, l & 7, 3); + int i1 = l & 7; + this.func_150042_a(worldIn, x, y, z, i1); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, 0.5F); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + } + } + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.1875F; + float f1 = 0.125F; + float f2 = 0.125F; + this.setBlockBounds(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2); + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (!worldIn.isRemote) + { + if (this.field_150047_a) + { + if ((worldIn.getBlockMetadata(x, y, z) & 8) == 0) + { + this.func_150046_n(worldIn, x, y, z); + } + } + } + } + + private void func_150046_n(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = l & 7; + boolean flag = (l & 8) != 0; + this.func_150043_b(l); + List list = worldIn.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ)); + boolean flag1 = !list.isEmpty(); + + if (flag1 && !flag) + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1 | 8, 3); + this.func_150042_a(worldIn, x, y, z, i1); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, 0.6F); + } + + if (!flag1 && flag) + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1, 3); + this.func_150042_a(worldIn, x, y, z, i1); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, 0.5F); + } + + if (flag1) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + } + + private void func_150042_a(World worldIn, int x, int y, int z, int p_150042_5_) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + + if (p_150042_5_ == 1) + { + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + } + else if (p_150042_5_ == 2) + { + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + } + else if (p_150042_5_ == 3) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + } + else if (p_150042_5_ == 4) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + else + { + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonStone.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonStone.java new file mode 100644 index 0000000..9588abe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonStone.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + +public class BlockButtonStone extends BlockButton +{ + private static final String __OBFID = "CL_00000319"; + + protected BlockButtonStone() + { + super(false); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.stone.getBlockTextureFromSide(1); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonWood.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonWood.java new file mode 100644 index 0000000..8b53c39 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockButtonWood.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; + +public class BlockButtonWood extends BlockButton +{ + private static final String __OBFID = "CL_00000336"; + + protected BlockButtonWood() + { + super(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.planks.getBlockTextureFromSide(1); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCactus.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCactus.java new file mode 100644 index 0000000..0dae624 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCactus.java @@ -0,0 +1,202 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.IPlantable; + +public class BlockCactus extends Block implements IPlantable +{ + @SideOnly(Side.CLIENT) + private IIcon field_150041_a; + @SideOnly(Side.CLIENT) + private IIcon field_150040_b; + private static final String __OBFID = "CL_00000210"; + + protected BlockCactus() + { + super(Material.cactus); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.isAirBlock(x, y + 1, z)) + { + int l; + + for (l = 1; worldIn.getBlock(x, y - l, z) == this; ++l) + { + ; + } + + if (l < 3) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (i1 == 15) + { + worldIn.setBlock(x, y + 1, z, this); + worldIn.setBlockMetadataWithNotify(x, y, z, 0, 4); + this.onNeighborBlockChange(worldIn, x, y + 1, z, this); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1 + 1, 4); + } + } + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + float f = 0.0625F; + return AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f)); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + float f = 0.0625F; + return AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)(y + 1), (double)((float)(z + 1) - f)); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_150041_a : (side == 0 ? this.field_150040_b : this.blockIcon); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 13; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return !super.canPlaceBlockAt(worldIn, x, y, z) ? false : this.canBlockStay(worldIn, x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + worldIn.func_147480_a(x, y, z, true); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + if (worldIn.getBlock(x - 1, y, z).getMaterial().isSolid()) + { + return false; + } + else if (worldIn.getBlock(x + 1, y, z).getMaterial().isSolid()) + { + return false; + } + else if (worldIn.getBlock(x, y, z - 1).getMaterial().isSolid()) + { + return false; + } + else if (worldIn.getBlock(x, y, z + 1).getMaterial().isSolid()) + { + return false; + } + else + { + Block block = worldIn.getBlock(x, y - 1, z); + return block.canSustainPlant(worldIn, x, y - 1, z, ForgeDirection.UP, this); + } + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + entityIn.attackEntityFrom(DamageSource.cactus, 1.0F); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150041_a = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150040_b = reg.registerIcon(this.getTextureName() + "_bottom"); + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { + return EnumPlantType.Desert; + } + + @Override + public Block getPlant(IBlockAccess world, int x, int y, int z) + { + return this; + } + + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { + return -1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCake.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCake.java new file mode 100644 index 0000000..f84876a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCake.java @@ -0,0 +1,199 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCake extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150038_a; + @SideOnly(Side.CLIENT) + private IIcon field_150037_b; + @SideOnly(Side.CLIENT) + private IIcon field_150039_M; + private static final String __OBFID = "CL_00000211"; + + protected BlockCake() + { + super(Material.cake); + this.setTickRandomly(true); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.0625F; + float f1 = (float)(1 + l * 2) / 16.0F; + float f2 = 0.5F; + this.setBlockBounds(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.0625F; + float f1 = 0.5F; + this.setBlockBounds(f, 0.0F, f, 1.0F - f, f1, 1.0F - f); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.0625F; + float f1 = (float)(1 + l * 2) / 16.0F; + float f2 = 0.5F; + return AxisAlignedBB.getBoundingBox((double)((float)x + f1), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)y + f2 - f), (double)((float)(z + 1) - f)); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.0625F; + float f1 = (float)(1 + l * 2) / 16.0F; + float f2 = 0.5F; + return AxisAlignedBB.getBoundingBox((double)((float)x + f1), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)y + f2), (double)((float)(z + 1) - f)); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_150038_a : (side == 0 ? this.field_150037_b : (meta > 0 && side == 4 ? this.field_150039_M : this.blockIcon)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150039_M = reg.registerIcon(this.getTextureName() + "_inner"); + this.field_150038_a = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150037_b = reg.registerIcon(this.getTextureName() + "_bottom"); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + this.func_150036_b(worldIn, x, y, z, player); + return true; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) + { + this.func_150036_b(worldIn, x, y, z, player); + } + + private void func_150036_b(World p_150036_1_, int p_150036_2_, int p_150036_3_, int p_150036_4_, EntityPlayer p_150036_5_) + { + if (p_150036_5_.canEat(false)) + { + p_150036_5_.getFoodStats().addStats(2, 0.1F); + int l = p_150036_1_.getBlockMetadata(p_150036_2_, p_150036_3_, p_150036_4_) + 1; + + if (l >= 6) + { + p_150036_1_.setBlockToAir(p_150036_2_, p_150036_3_, p_150036_4_); + } + else + { + p_150036_1_.setBlockMetadataWithNotify(p_150036_2_, p_150036_3_, p_150036_4_, l, 2); + } + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return !super.canPlaceBlockAt(worldIn, x, y, z) ? false : this.canBlockStay(worldIn, x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return worldIn.getBlock(x, y - 1, z).getMaterial().isSolid(); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.cake; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarpet.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarpet.java new file mode 100644 index 0000000..1e9d994 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarpet.java @@ -0,0 +1,161 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCarpet extends Block +{ + private static final String __OBFID = "CL_00000338"; + + protected BlockCarpet() + { + super(Material.carpet); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_150089_b(0); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.wool.getIcon(side, meta); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + byte b0 = 0; + float f = 0.0625F; + return AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)((float)y + (float)b0 * f), (double)z + this.maxZ); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.func_150089_b(0); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_150089_b(worldIn.getBlockMetadata(x, y, z)); + } + + protected void func_150089_b(int meta) + { + byte b0 = 0; + float f = (float)(1 * (1 + b0)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return super.canPlaceBlockAt(worldIn, x, y, z) && this.canBlockStay(worldIn, x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_150090_e(worldIn, x, y, z); + } + + private boolean func_150090_e(World p_150090_1_, int p_150090_2_, int p_150090_3_, int p_150090_4_) + { + if (!this.canBlockStay(p_150090_1_, p_150090_2_, p_150090_3_, p_150090_4_)) + { + this.dropBlockAsItem(p_150090_1_, p_150090_2_, p_150090_3_, p_150090_4_, p_150090_1_.getBlockMetadata(p_150090_2_, p_150090_3_, p_150090_4_), 0); + p_150090_1_.setBlockToAir(p_150090_2_, p_150090_3_, p_150090_4_); + return false; + } + else + { + return true; + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return !worldIn.isAirBlock(x, y - 1, z); + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 1 ? true : super.shouldSideBeRendered(worldIn, x, y, z, side); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < 16; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarrot.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarrot.java new file mode 100644 index 0000000..8aefee5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCarrot.java @@ -0,0 +1,57 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockCarrot extends BlockCrops +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149868_a; + private static final String __OBFID = "CL_00000212"; + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta < 7) + { + if (meta == 6) + { + meta = 5; + } + + return this.field_149868_a[meta >> 1]; + } + else + { + return this.field_149868_a[3]; + } + } + + protected Item func_149866_i() + { + return Items.carrot; + } + + protected Item func_149865_P() + { + return Items.carrot; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149868_a = new IIcon[4]; + + for (int i = 0; i < this.field_149868_a.length; ++i) + { + this.field_149868_a[i] = reg.registerIcon(this.getTextureName() + "_stage_" + i); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCauldron.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCauldron.java new file mode 100644 index 0000000..f7d11ba --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCauldron.java @@ -0,0 +1,276 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockCauldron extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150029_a; + @SideOnly(Side.CLIENT) + private IIcon field_150028_b; + @SideOnly(Side.CLIENT) + private IIcon field_150030_M; + private static final String __OBFID = "CL_00000213"; + + public BlockCauldron() + { + super(Material.iron); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_150028_b : (side == 0 ? this.field_150030_M : this.blockIcon); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150029_a = reg.registerIcon(this.getTextureName() + "_" + "inner"); + this.field_150028_b = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150030_M = reg.registerIcon(this.getTextureName() + "_" + "bottom"); + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBoundsForItemRender(); + } + + @SideOnly(Side.CLIENT) + public static IIcon getCauldronIcon(String iconName) + { + return iconName.equals("inner") ? Blocks.cauldron.field_150029_a : (iconName.equals("bottom") ? Blocks.cauldron.field_150030_M : null); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 24; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + int l = func_150027_b(worldIn.getBlockMetadata(x, y, z)); + float f = (float)y + (6.0F + (float)(3 * l)) / 16.0F; + + if (!worldIn.isRemote && entityIn.isBurning() && l > 0 && entityIn.boundingBox.minY <= (double)f) + { + entityIn.extinguish(); + this.func_150024_a(worldIn, x, y, z, l - 1); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack == null) + { + return true; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + int j1 = func_150027_b(i1); + + if (itemstack.getItem() == Items.water_bucket) + { + if (j1 < 3) + { + if (!player.capabilities.isCreativeMode) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(Items.bucket)); + } + + this.func_150024_a(worldIn, x, y, z, 3); + } + + return true; + } + else + { + if (itemstack.getItem() == Items.glass_bottle) + { + if (j1 > 0) + { + if (!player.capabilities.isCreativeMode) + { + ItemStack itemstack1 = new ItemStack(Items.potionitem, 1, 0); + + if (!player.inventory.addItemStackToInventory(itemstack1)) + { + worldIn.spawnEntityInWorld(new EntityItem(worldIn, (double)x + 0.5D, (double)y + 1.5D, (double)z + 0.5D, itemstack1)); + } + else if (player instanceof EntityPlayerMP) + { + ((EntityPlayerMP)player).sendContainerToPlayer(player.inventoryContainer); + } + + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + + this.func_150024_a(worldIn, x, y, z, j1 - 1); + } + } + else if (j1 > 0 && itemstack.getItem() instanceof ItemArmor && ((ItemArmor)itemstack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) + { + ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); + itemarmor.removeColor(itemstack); + this.func_150024_a(worldIn, x, y, z, j1 - 1); + return true; + } + + return false; + } + } + } + } + + public void func_150024_a(World worldIn, int x, int y, int z, int level) + { + worldIn.setBlockMetadataWithNotify(x, y, z, MathHelper.clamp_int(level, 0, 3), 2); + worldIn.func_147453_f(x, y, z, this); + } + + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + public void fillWithRain(World worldIn, int x, int y, int z) + { + if (worldIn.rand.nextInt(20) == 1) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l < 3) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l + 1, 2); + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.cauldron; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.cauldron; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + return func_150027_b(i1); + } + + public static int func_150027_b(int meta) + { + return meta; + } + + @SideOnly(Side.CLIENT) + public static float getRenderLiquidLevel(int meta) + { + int j = MathHelper.clamp_int(meta, 0, 3); + return (float)(6 + 3 * j) / 16.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockChest.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockChest.java new file mode 100644 index 0000000..7895974 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockChest.java @@ -0,0 +1,570 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockChest extends BlockContainer +{ + private final Random field_149955_b = new Random(); + public final int field_149956_a; + private static final String __OBFID = "CL_00000214"; + + protected BlockChest(int type) + { + super(Material.wood); + this.field_149956_a = type; + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 22; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + if (worldIn.getBlock(x, y, z - 1) == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); + } + else if (worldIn.getBlock(x, y, z + 1) == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); + } + else if (worldIn.getBlock(x - 1, y, z) == this) + { + this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + else if (worldIn.getBlock(x + 1, y, z) == this) + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); + } + else + { + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + this.func_149954_e(worldIn, x, y, z); + Block block = worldIn.getBlock(x, y, z - 1); + Block block1 = worldIn.getBlock(x, y, z + 1); + Block block2 = worldIn.getBlock(x - 1, y, z); + Block block3 = worldIn.getBlock(x + 1, y, z); + + if (block == this) + { + this.func_149954_e(worldIn, x, y, z - 1); + } + + if (block1 == this) + { + this.func_149954_e(worldIn, x, y, z + 1); + } + + if (block2 == this) + { + this.func_149954_e(worldIn, x - 1, y, z); + } + + if (block3 == this) + { + this.func_149954_e(worldIn, x + 1, y, z); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + Block block = worldIn.getBlock(x, y, z - 1); + Block block1 = worldIn.getBlock(x, y, z + 1); + Block block2 = worldIn.getBlock(x - 1, y, z); + Block block3 = worldIn.getBlock(x + 1, y, z); + byte b0 = 0; + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (l == 0) + { + b0 = 2; + } + + if (l == 1) + { + b0 = 5; + } + + if (l == 2) + { + b0 = 3; + } + + if (l == 3) + { + b0 = 4; + } + + if (block != this && block1 != this && block2 != this && block3 != this) + { + worldIn.setBlockMetadataWithNotify(x, y, z, b0, 3); + } + else + { + if ((block == this || block1 == this) && (b0 == 4 || b0 == 5)) + { + if (block == this) + { + worldIn.setBlockMetadataWithNotify(x, y, z - 1, b0, 3); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z + 1, b0, 3); + } + + worldIn.setBlockMetadataWithNotify(x, y, z, b0, 3); + } + + if ((block2 == this || block3 == this) && (b0 == 2 || b0 == 3)) + { + if (block2 == this) + { + worldIn.setBlockMetadataWithNotify(x - 1, y, z, b0, 3); + } + else + { + worldIn.setBlockMetadataWithNotify(x + 1, y, z, b0, 3); + } + + worldIn.setBlockMetadataWithNotify(x, y, z, b0, 3); + } + } + + if (itemIn.hasDisplayName()) + { + ((TileEntityChest)worldIn.getTileEntity(x, y, z)).func_145976_a(itemIn.getDisplayName()); + } + } + + public void func_149954_e(World p_149954_1_, int p_149954_2_, int p_149954_3_, int p_149954_4_) + { + if (!p_149954_1_.isRemote) + { + Block block = p_149954_1_.getBlock(p_149954_2_, p_149954_3_, p_149954_4_ - 1); + Block block1 = p_149954_1_.getBlock(p_149954_2_, p_149954_3_, p_149954_4_ + 1); + Block block2 = p_149954_1_.getBlock(p_149954_2_ - 1, p_149954_3_, p_149954_4_); + Block block3 = p_149954_1_.getBlock(p_149954_2_ + 1, p_149954_3_, p_149954_4_); + boolean flag = true; + int l; + Block block4; + int i1; + Block block5; + boolean flag1; + byte b0; + int j1; + + if (block != this && block1 != this) + { + if (block2 != this && block3 != this) + { + b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + } + else + { + l = block2 == this ? p_149954_2_ - 1 : p_149954_2_ + 1; + block4 = p_149954_1_.getBlock(l, p_149954_3_, p_149954_4_ - 1); + i1 = block2 == this ? p_149954_2_ - 1 : p_149954_2_ + 1; + block5 = p_149954_1_.getBlock(i1, p_149954_3_, p_149954_4_ + 1); + b0 = 3; + flag1 = true; + + if (block2 == this) + { + j1 = p_149954_1_.getBlockMetadata(p_149954_2_ - 1, p_149954_3_, p_149954_4_); + } + else + { + j1 = p_149954_1_.getBlockMetadata(p_149954_2_ + 1, p_149954_3_, p_149954_4_); + } + + if (j1 == 2) + { + b0 = 2; + } + + if ((block.func_149730_j() || block4.func_149730_j()) && !block1.func_149730_j() && !block5.func_149730_j()) + { + b0 = 3; + } + + if ((block1.func_149730_j() || block5.func_149730_j()) && !block.func_149730_j() && !block4.func_149730_j()) + { + b0 = 2; + } + } + } + else + { + l = block == this ? p_149954_4_ - 1 : p_149954_4_ + 1; + block4 = p_149954_1_.getBlock(p_149954_2_ - 1, p_149954_3_, l); + i1 = block == this ? p_149954_4_ - 1 : p_149954_4_ + 1; + block5 = p_149954_1_.getBlock(p_149954_2_ + 1, p_149954_3_, i1); + b0 = 5; + flag1 = true; + + if (block == this) + { + j1 = p_149954_1_.getBlockMetadata(p_149954_2_, p_149954_3_, p_149954_4_ - 1); + } + else + { + j1 = p_149954_1_.getBlockMetadata(p_149954_2_, p_149954_3_, p_149954_4_ + 1); + } + + if (j1 == 4) + { + b0 = 4; + } + + if ((block2.func_149730_j() || block4.func_149730_j()) && !block3.func_149730_j() && !block5.func_149730_j()) + { + b0 = 5; + } + + if ((block3.func_149730_j() || block5.func_149730_j()) && !block2.func_149730_j() && !block4.func_149730_j()) + { + b0 = 4; + } + } + + p_149954_1_.setBlockMetadataWithNotify(p_149954_2_, p_149954_3_, p_149954_4_, b0, 3); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + int l = 0; + + if (worldIn.getBlock(x - 1, y, z) == this) + { + ++l; + } + + if (worldIn.getBlock(x + 1, y, z) == this) + { + ++l; + } + + if (worldIn.getBlock(x, y, z - 1) == this) + { + ++l; + } + + if (worldIn.getBlock(x, y, z + 1) == this) + { + ++l; + } + + return l > 1 ? false : (this.func_149952_n(worldIn, x - 1, y, z) ? false : (this.func_149952_n(worldIn, x + 1, y, z) ? false : (this.func_149952_n(worldIn, x, y, z - 1) ? false : !this.func_149952_n(worldIn, x, y, z + 1)))); + } + + private boolean func_149952_n(World worldIn, int x, int y, int z) + { + return worldIn.getBlock(x, y, z) != this ? false : (worldIn.getBlock(x - 1, y, z) == this ? true : (worldIn.getBlock(x + 1, y, z) == this ? true : (worldIn.getBlock(x, y, z - 1) == this ? true : worldIn.getBlock(x, y, z + 1) == this))); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + TileEntityChest tileentitychest = (TileEntityChest)worldIn.getTileEntity(x, y, z); + + if (tileentitychest != null) + { + tileentitychest.updateContainingBlockInfo(); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + TileEntityChest tileentitychest = (TileEntityChest)worldIn.getTileEntity(x, y, z); + + if (tileentitychest != null) + { + for (int i1 = 0; i1 < tileentitychest.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentitychest.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149955_b.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; + EntityItem entityitem; + + for (float f2 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; worldIn.spawnEntityInWorld(entityitem)) + { + int j1 = this.field_149955_b.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.field_149955_b.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.field_149955_b.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.field_149955_b.nextGaussian() * f3); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + } + } + } + + worldIn.func_147453_f(x, y, z, blockBroken); + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + IInventory iinventory = this.func_149951_m(worldIn, x, y, z); + + if (iinventory != null) + { + player.displayGUIChest(iinventory); + } + + return true; + } + } + + public IInventory func_149951_m(World p_149951_1_, int p_149951_2_, int p_149951_3_, int p_149951_4_) + { + Object object = (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_); + + if (object == null) + { + return null; + } + else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN)) + { + return null; + } + else if (func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_)) + { + return null; + } + else if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) + { + return null; + } + else if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) + { + return null; + } + else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) + { + return null; + } + else if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) + { + return null; + } + else + { + if (p_149951_1_.getBlock(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this) + { + object = new InventoryLargeChest("container.chestDouble", (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_ - 1, p_149951_3_, p_149951_4_), (IInventory)object); + } + + if (p_149951_1_.getBlock(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this) + { + object = new InventoryLargeChest("container.chestDouble", (IInventory)object, (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_ + 1, p_149951_3_, p_149951_4_)); + } + + if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this) + { + object = new InventoryLargeChest("container.chestDouble", (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_ - 1), (IInventory)object); + } + + if (p_149951_1_.getBlock(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this) + { + object = new InventoryLargeChest("container.chestDouble", (IInventory)object, (TileEntityChest)p_149951_1_.getTileEntity(p_149951_2_, p_149951_3_, p_149951_4_ + 1)); + } + + return (IInventory)object; + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + TileEntityChest tileentitychest = new TileEntityChest(); + return tileentitychest; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return this.field_149956_a == 1; + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (!this.canProvidePower()) + { + return 0; + } + else + { + int i1 = ((TileEntityChest)worldIn.getTileEntity(x, y, z)).numPlayersUsing; + return MathHelper.clamp_int(i1, 0, 15); + } + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 1 ? this.isProvidingWeakPower(worldIn, x, y, z, side) : 0; + } + + private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_) + { + Iterator iterator = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox((double)p_149953_1_, (double)(p_149953_2_ + 1), (double)p_149953_3_, (double)(p_149953_1_ + 1), (double)(p_149953_2_ + 2), (double)(p_149953_3_ + 1))).iterator(); + EntityOcelot entityocelot; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + Entity entity = (Entity)iterator.next(); + entityocelot = (EntityOcelot)entity; + } + while (!entityocelot.isSitting()); + + return true; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return Container.calcRedstoneFromInventory(this.func_149951_m(worldIn, x, y, z)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("planks_oak"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockClay.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockClay.java new file mode 100644 index 0000000..427fbb5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockClay.java @@ -0,0 +1,31 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockClay extends Block +{ + private static final String __OBFID = "CL_00000215"; + + public BlockClay() + { + super(Material.clay); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.clay_ball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 4; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCocoa.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCocoa.java new file mode 100644 index 0000000..291aba4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCocoa.java @@ -0,0 +1,282 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockCocoa extends BlockDirectional implements IGrowable +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149989_a; + private static final String __OBFID = "CL_00000216"; + + public BlockCocoa() + { + super(Material.plants); + this.setTickRandomly(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.field_149989_a[2]; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlock(x, y, z, getBlockById(0), 0, 2); + } + else if (worldIn.rand.nextInt(5) == 0) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = func_149987_c(l); + + if (i1 < 2) + { + ++i1; + worldIn.setBlockMetadataWithNotify(x, y, z, i1 << 2 | getDirection(l), 2); + } + } + } + + @SideOnly(Side.CLIENT) + public IIcon getCocoaIcon(int p_149988_1_) + { + if (p_149988_1_ < 0 || p_149988_1_ >= this.field_149989_a.length) + { + p_149988_1_ = this.field_149989_a.length - 1; + } + + return this.field_149989_a[p_149988_1_]; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + int l = getDirection(worldIn.getBlockMetadata(x, y, z)); + x += Direction.offsetX[l]; + z += Direction.offsetZ[l]; + Block block = worldIn.getBlock(x, y, z); + return block == Blocks.log && BlockLog.func_150165_c(worldIn.getBlockMetadata(x, y, z)) == 3; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 28; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = getDirection(l); + int j1 = func_149987_c(l); + int k1 = 4 + j1 * 2; + int l1 = 5 + j1 * 2; + float f = (float)k1 / 2.0F; + + switch (i1) + { + case 0: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)l1) / 16.0F, (15.0F - (float)k1) / 16.0F, (8.0F + f) / 16.0F, 0.75F, 0.9375F); + break; + case 1: + this.setBlockBounds(0.0625F, (12.0F - (float)l1) / 16.0F, (8.0F - f) / 16.0F, (1.0F + (float)k1) / 16.0F, 0.75F, (8.0F + f) / 16.0F); + break; + case 2: + this.setBlockBounds((8.0F - f) / 16.0F, (12.0F - (float)l1) / 16.0F, 0.0625F, (8.0F + f) / 16.0F, 0.75F, (1.0F + (float)k1) / 16.0F); + break; + case 3: + this.setBlockBounds((15.0F - (float)k1) / 16.0F, (12.0F - (float)l1) / 16.0F, (8.0F - f) / 16.0F, 0.9375F, 0.75F, (8.0F + f) / 16.0F); + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + if (side == 1 || side == 0) + { + side = 2; + } + + return Direction.rotateOpposite[Direction.facingToDirection[side]]; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlock(x, y, z, getBlockById(0), 0, 2); + } + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + public static int func_149987_c(int p_149987_0_) + { + return (p_149987_0_ & 12) >> 2; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList dropped = super.getDrops(world, x, y, z, meta, fortune); + int j1 = func_149987_c(meta); + byte b0 = 1; + + if (j1 >= 2) + { + b0 = 3; + } + + for (int k1 = 0; k1 < b0; ++k1) + { + dropped.add(new ItemStack(Items.dye, 1, 3)); + } + return dropped; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.dye; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return 3; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149989_a = new IIcon[3]; + + for (int i = 0; i < this.field_149989_a.length; ++i) + { + this.field_149989_a[i] = reg.registerIcon(this.getTextureName() + "_stage_" + i); + } + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = func_149987_c(l); + return i1 < 2; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = BlockDirectional.getDirection(l); + int j1 = func_149987_c(l); + ++j1; + worldIn.setBlockMetadataWithNotify(x, y, z, j1 << 2 | i1, 2); + } + + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockColored.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockColored.java new file mode 100644 index 0000000..7550054 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockColored.java @@ -0,0 +1,81 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockColored extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_150033_a; + private static final String __OBFID = "CL_00000217"; + + public BlockColored(Material p_i45398_1_) + { + super(p_i45398_1_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.field_150033_a[meta % this.field_150033_a.length]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + public static int func_150032_b(int p_150032_0_) + { + return func_150031_c(p_150032_0_); + } + + public static int func_150031_c(int p_150031_0_) + { + return ~p_150031_0_ & 15; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < 16; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150033_a = new IIcon[16]; + + for (int i = 0; i < this.field_150033_a.length; ++i) + { + this.field_150033_a[i] = reg.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150031_c(i)]); + } + } + + public MapColor getMapColor(int meta) + { + return MapColor.getMapColorForBlockColored(meta); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCommandBlock.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCommandBlock.java new file mode 100644 index 0000000..c6de0eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCommandBlock.java @@ -0,0 +1,131 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.world.World; + +public class BlockCommandBlock extends BlockContainer +{ + private static final String __OBFID = "CL_00000219"; + + public BlockCommandBlock() + { + super(Material.iron); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityCommandBlock(); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + boolean flag = worldIn.isBlockIndirectlyGettingPowered(x, y, z); + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag1 = (l & 1) != 0; + + if (flag && !flag1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l | 1, 4); + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + else if (!flag && flag1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l & -2, 4); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + + if (tileentity != null && tileentity instanceof TileEntityCommandBlock) + { + CommandBlockLogic commandblocklogic = ((TileEntityCommandBlock)tileentity).func_145993_a(); + commandblocklogic.func_145755_a(worldIn); + worldIn.func_147453_f(x, y, z, this); + } + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 1; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + TileEntityCommandBlock tileentitycommandblock = (TileEntityCommandBlock)worldIn.getTileEntity(x, y, z); + + if (tileentitycommandblock != null) + { + player.func_146100_a(tileentitycommandblock); + } + + return true; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + return tileentity != null && tileentity instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)tileentity).func_145993_a().func_145760_g() : 0; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + TileEntityCommandBlock tileentitycommandblock = (TileEntityCommandBlock)worldIn.getTileEntity(x, y, z); + + if (itemIn.hasDisplayName()) + { + tileentitycommandblock.func_145993_a().func_145754_b(itemIn.getDisplayName()); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressed.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressed.java new file mode 100644 index 0000000..d4cdf16 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressed.java @@ -0,0 +1,23 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockCompressed extends Block +{ + private final MapColor field_150202_a; + private static final String __OBFID = "CL_00000268"; + + public BlockCompressed(MapColor p_i45414_1_) + { + super(Material.iron); + this.field_150202_a = p_i45414_1_; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int meta) + { + return this.field_150202_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressedPowered.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressedPowered.java new file mode 100644 index 0000000..6892cf6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCompressedPowered.java @@ -0,0 +1,29 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.world.IBlockAccess; + +public class BlockCompressedPowered extends BlockCompressed +{ + private static final String __OBFID = "CL_00000287"; + + public BlockCompressedPowered(MapColor p_i45416_1_) + { + super(p_i45416_1_); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return 15; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockContainer.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockContainer.java new file mode 100644 index 0000000..76b3b2c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockContainer.java @@ -0,0 +1,37 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public abstract class BlockContainer extends Block implements ITileEntityProvider +{ + private static final String __OBFID = "CL_00000193"; + + protected BlockContainer(Material p_i45386_1_) + { + super(p_i45386_1_); + this.isBlockContainer = true; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + worldIn.removeTileEntity(x, y, z); + } + + public boolean onBlockEventReceived(World worldIn, int x, int y, int z, int eventId, int eventData) + { + super.onBlockEventReceived(worldIn, x, y, z, eventId, eventData); + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + return tileentity != null ? tileentity.receiveClientEvent(eventId, eventData) : false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockCrops.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCrops.java new file mode 100644 index 0000000..94299a3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockCrops.java @@ -0,0 +1,233 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockCrops extends BlockBush implements IGrowable +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149867_a; + private static final String __OBFID = "CL_00000222"; + + protected BlockCrops() + { + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.disableStats(); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.farmland; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + super.updateTick(worldIn, x, y, z, random); + + if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l < 7) + { + float f = this.func_149864_n(worldIn, x, y, z); + + if (random.nextInt((int)(25.0F / f) + 1) == 0) + { + ++l; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + } + } + } + + public void func_149863_m(World p_149863_1_, int p_149863_2_, int p_149863_3_, int p_149863_4_) + { + int l = p_149863_1_.getBlockMetadata(p_149863_2_, p_149863_3_, p_149863_4_) + MathHelper.getRandomIntegerInRange(p_149863_1_.rand, 2, 5); + + if (l > 7) + { + l = 7; + } + + p_149863_1_.setBlockMetadataWithNotify(p_149863_2_, p_149863_3_, p_149863_4_, l, 2); + } + + private float func_149864_n(World p_149864_1_, int p_149864_2_, int p_149864_3_, int p_149864_4_) + { + float f = 1.0F; + Block block = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ - 1); + Block block1 = p_149864_1_.getBlock(p_149864_2_, p_149864_3_, p_149864_4_ + 1); + Block block2 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_); + Block block3 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_); + Block block4 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ - 1); + Block block5 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ - 1); + Block block6 = p_149864_1_.getBlock(p_149864_2_ + 1, p_149864_3_, p_149864_4_ + 1); + Block block7 = p_149864_1_.getBlock(p_149864_2_ - 1, p_149864_3_, p_149864_4_ + 1); + boolean flag = block2 == this || block3 == this; + boolean flag1 = block == this || block1 == this; + boolean flag2 = block4 == this || block5 == this || block6 == this || block7 == this; + + for (int l = p_149864_2_ - 1; l <= p_149864_2_ + 1; ++l) + { + for (int i1 = p_149864_4_ - 1; i1 <= p_149864_4_ + 1; ++i1) + { + float f1 = 0.0F; + + if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) + { + f1 = 1.0F; + + if (p_149864_1_.getBlock(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) + { + f1 = 3.0F; + } + } + + if (l != p_149864_2_ || i1 != p_149864_4_) + { + f1 /= 4.0F; + } + + f += f1; + } + } + + if (flag2 || flag && flag1) + { + f /= 2.0F; + } + + return f; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta < 0 || meta > 7) + { + meta = 7; + } + + return this.field_149867_a[meta]; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 6; + } + + protected Item func_149866_i() + { + return Items.wheat_seeds; + } + + protected Item func_149865_P() + { + return Items.wheat; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, 0); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return meta == 7 ? this.func_149865_P() : this.func_149866_i(); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + return worldIn.getBlockMetadata(x, y, z) != 7; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return this.func_149866_i(); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149867_a = new IIcon[8]; + + for (int i = 0; i < this.field_149867_a.length; ++i) + { + this.field_149867_a[i] = reg.registerIcon(this.getTextureName() + "_stage_" + i); + } + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + this.func_149863_m(worldIn, x, y, z); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); + + if (metadata >= 7) + { + for (int i = 0; i < 3 + fortune; ++i) + { + if (world.rand.nextInt(15) <= metadata) + { + ret.add(new ItemStack(this.func_149866_i(), 1, 0)); + } + } + } + + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDaylightDetector.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDaylightDetector.java new file mode 100644 index 0000000..72c8c61 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDaylightDetector.java @@ -0,0 +1,142 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDaylightDetector; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDaylightDetector extends BlockContainer +{ + private IIcon[] field_149958_a = new IIcon[2]; + private static final String __OBFID = "CL_00000223"; + + public BlockDaylightDetector() + { + super(Material.wood); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return worldIn.getBlockMetadata(x, y, z); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) {} + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) {} + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) {} + + public void func_149957_e(World p_149957_1_, int p_149957_2_, int p_149957_3_, int p_149957_4_) + { + if (!p_149957_1_.provider.hasNoSky) + { + int l = p_149957_1_.getBlockMetadata(p_149957_2_, p_149957_3_, p_149957_4_); + int i1 = p_149957_1_.getSavedLightValue(EnumSkyBlock.Sky, p_149957_2_, p_149957_3_, p_149957_4_) - p_149957_1_.skylightSubtracted; + float f = p_149957_1_.getCelestialAngleRadians(1.0F); + + if (f < (float)Math.PI) + { + f += (0.0F - f) * 0.2F; + } + else + { + f += (((float)Math.PI * 2F) - f) * 0.2F; + } + + i1 = Math.round((float)i1 * MathHelper.cos(f)); + + if (i1 < 0) + { + i1 = 0; + } + + if (i1 > 15) + { + i1 = 15; + } + + if (l != i1) + { + p_149957_1_.setBlockMetadataWithNotify(p_149957_2_, p_149957_3_, p_149957_4_, i1, 3); + } + } + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDaylightDetector(); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149958_a[0] : this.field_149958_a[1]; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149958_a[0] = reg.registerIcon(this.getTextureName() + "_top"); + this.field_149958_a[1] = reg.registerIcon(this.getTextureName() + "_side"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDeadBush.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDeadBush.java new file mode 100644 index 0000000..d5fd8a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDeadBush.java @@ -0,0 +1,58 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public class BlockDeadBush extends BlockBush implements IShearable +{ + private static final String __OBFID = "CL_00000224"; + + protected BlockDeadBush() + { + super(Material.vine); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.sand || ground == Blocks.hardened_clay || ground == Blocks.stained_hardened_clay || ground == Blocks.dirt; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + { + super.harvestBlock(worldIn, player, x, y, z, meta); + } + } + + @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; } + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + return new ArrayList(Arrays.asList(new ItemStack(Blocks.deadbush, 1, world.getBlockMetadata(x, y, z)))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirectional.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirectional.java new file mode 100644 index 0000000..28dba8b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirectional.java @@ -0,0 +1,18 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; + +public abstract class BlockDirectional extends Block +{ + private static final String __OBFID = "CL_00000227"; + + protected BlockDirectional(Material p_i45401_1_) + { + super(p_i45401_1_); + } + + public static int getDirection(int p_149895_0_) + { + return p_149895_0_ & 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirt.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirt.java new file mode 100644 index 0000000..ba3986d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDirt.java @@ -0,0 +1,140 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDirt extends Block +{ + public static final String[] field_150009_a = new String[] {"default", "default", "podzol"}; + @SideOnly(Side.CLIENT) + private IIcon field_150008_b; + @SideOnly(Side.CLIENT) + private IIcon field_150010_M; + private static final String __OBFID = "CL_00000228"; + + protected BlockDirt() + { + super(Material.ground); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta == 2) + { + if (side == 1) + { + return this.field_150008_b; + } + + if (side != 0) + { + return this.field_150010_M; + } + } + + return this.blockIcon; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return 0; + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (i1 == 2) + { + if (side == 1) + { + return this.field_150008_b; + } + + if (side != 0) + { + Material material = worldIn.getBlock(x, y + 1, z).getMaterial(); + + if (material == Material.snow || material == Material.craftedSnow) + { + return Blocks.grass.getIcon(worldIn, x, y, z, side); + } + + Block block = worldIn.getBlock(x, y + 1, z); + + if (block != Blocks.dirt && block != Blocks.grass) + { + return this.field_150010_M; + } + } + } + + return this.blockIcon; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + if (meta == 1) + { + meta = 0; + } + + return super.createStackedBlock(meta); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(this, 1, 0)); + list.add(new ItemStack(this, 1, 2)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + this.field_150008_b = reg.registerIcon(this.getTextureName() + "_" + "podzol_top"); + this.field_150010_M = reg.registerIcon(this.getTextureName() + "_" + "podzol_side"); + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l == 1) + { + l = 0; + } + + return l; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDispenser.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDispenser.java new file mode 100644 index 0000000..ea4e9da --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDispenser.java @@ -0,0 +1,305 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.dispenser.PositionImpl; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistryDefaulted; +import net.minecraft.world.World; + +public class BlockDispenser extends BlockContainer +{ + /** Registry for all dispense behaviors. */ + public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); + protected Random field_149942_b = new Random(); + @SideOnly(Side.CLIENT) + protected IIcon field_149944_M; + @SideOnly(Side.CLIENT) + protected IIcon field_149945_N; + @SideOnly(Side.CLIENT) + protected IIcon field_149946_O; + private static final String __OBFID = "CL_00000229"; + + protected BlockDispenser() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 4; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + this.func_149938_m(worldIn, x, y, z); + } + + private void func_149938_m(World p_149938_1_, int p_149938_2_, int p_149938_3_, int p_149938_4_) + { + if (!p_149938_1_.isRemote) + { + Block block = p_149938_1_.getBlock(p_149938_2_, p_149938_3_, p_149938_4_ - 1); + Block block1 = p_149938_1_.getBlock(p_149938_2_, p_149938_3_, p_149938_4_ + 1); + Block block2 = p_149938_1_.getBlock(p_149938_2_ - 1, p_149938_3_, p_149938_4_); + Block block3 = p_149938_1_.getBlock(p_149938_2_ + 1, p_149938_3_, p_149938_4_); + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + p_149938_1_.setBlockMetadataWithNotify(p_149938_2_, p_149938_3_, p_149938_4_, b0, 2); + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + int k = meta & 7; + return side == k ? (k != 1 && k != 0 ? this.field_149945_N : this.field_149946_O) : (k != 1 && k != 0 ? (side != 1 && side != 0 ? this.blockIcon : this.field_149944_M) : this.field_149944_M); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("furnace_side"); + this.field_149944_M = reg.registerIcon("furnace_top"); + this.field_149945_N = reg.registerIcon(this.getTextureName() + "_front_horizontal"); + this.field_149946_O = reg.registerIcon(this.getTextureName() + "_front_vertical"); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)worldIn.getTileEntity(x, y, z); + + if (tileentitydispenser != null) + { + player.func_146102_a(tileentitydispenser); + } + + return true; + } + } + + protected void func_149941_e(World p_149941_1_, int p_149941_2_, int p_149941_3_, int p_149941_4_) + { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(p_149941_1_, p_149941_2_, p_149941_3_, p_149941_4_); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)blocksourceimpl.getBlockTileEntity(); + + if (tileentitydispenser != null) + { + int l = tileentitydispenser.func_146017_i(); + + if (l < 0) + { + p_149941_1_.playAuxSFX(1001, p_149941_2_, p_149941_3_, p_149941_4_, 0); + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(l); + IBehaviorDispenseItem ibehaviordispenseitem = this.func_149940_a(itemstack); + + if (ibehaviordispenseitem != IBehaviorDispenseItem.itemDispenseBehaviorProvider) + { + ItemStack itemstack1 = ibehaviordispenseitem.dispense(blocksourceimpl, itemstack); + tileentitydispenser.setInventorySlotContents(l, itemstack1.stackSize == 0 ? null : itemstack1); + } + } + } + } + + protected IBehaviorDispenseItem func_149940_a(ItemStack p_149940_1_) + { + return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(p_149940_1_.getItem()); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + boolean flag = worldIn.isBlockIndirectlyGettingPowered(x, y, z) || worldIn.isBlockIndirectlyGettingPowered(x, y + 1, z); + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag1 = (l & 8) != 0; + + if (flag && !flag1) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + worldIn.setBlockMetadataWithNotify(x, y, z, l | 8, 4); + } + else if (!flag && flag1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l & -9, 4); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + this.func_149941_e(worldIn, x, y, z); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDispenser(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = BlockPistonBase.determineOrientation(worldIn, x, y, z, placer); + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + + if (itemIn.hasDisplayName()) + { + ((TileEntityDispenser)worldIn.getTileEntity(x, y, z)).func_146018_a(itemIn.getDisplayName()); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)worldIn.getTileEntity(x, y, z); + + if (tileentitydispenser != null) + { + for (int i1 = 0; i1 < tileentitydispenser.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149942_b.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149942_b.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.field_149942_b.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.field_149942_b.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.field_149942_b.nextGaussian() * f3); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + + worldIn.func_147453_f(x, y, z, blockBroken); + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + public static IPosition func_149939_a(IBlockSource p_149939_0_) + { + EnumFacing enumfacing = func_149937_b(p_149939_0_.getBlockMetadata()); + double d0 = p_149939_0_.getX() + 0.7D * (double)enumfacing.getFrontOffsetX(); + double d1 = p_149939_0_.getY() + 0.7D * (double)enumfacing.getFrontOffsetY(); + double d2 = p_149939_0_.getZ() + 0.7D * (double)enumfacing.getFrontOffsetZ(); + return new PositionImpl(d0, d1, d2); + } + + public static EnumFacing func_149937_b(int p_149937_0_) + { + return EnumFacing.getFront(p_149937_0_ & 7); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return Container.calcRedstoneFromInventory((IInventory)worldIn.getTileEntity(x, y, z)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoor.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoor.java new file mode 100644 index 0000000..9d446f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoor.java @@ -0,0 +1,463 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.IconFlipped; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDoor extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_150017_a; + @SideOnly(Side.CLIENT) + private IIcon[] field_150016_b; + private static final String __OBFID = "CL_00000230"; + + protected BlockDoor(Material p_i45402_1_) + { + super(p_i45402_1_); + float f = 0.5F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.field_150016_b[0]; + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (side != 1 && side != 0) + { + int i1 = this.func_150012_g(worldIn, x, y, z); + int j1 = i1 & 3; + boolean flag = (i1 & 4) != 0; + boolean flag1 = false; + boolean flag2 = (i1 & 8) != 0; + + if (flag) + { + if (j1 == 0 && side == 2) + { + flag1 = !flag1; + } + else if (j1 == 1 && side == 5) + { + flag1 = !flag1; + } + else if (j1 == 2 && side == 3) + { + flag1 = !flag1; + } + else if (j1 == 3 && side == 4) + { + flag1 = !flag1; + } + } + else + { + if (j1 == 0 && side == 5) + { + flag1 = !flag1; + } + else if (j1 == 1 && side == 3) + { + flag1 = !flag1; + } + else if (j1 == 2 && side == 4) + { + flag1 = !flag1; + } + else if (j1 == 3 && side == 2) + { + flag1 = !flag1; + } + + if ((i1 & 16) != 0) + { + flag1 = !flag1; + } + } + + return flag2 ? this.field_150017_a[flag1?1:0] : this.field_150016_b[flag1?1:0]; + } + else + { + return this.field_150016_b[0]; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150017_a = new IIcon[2]; + this.field_150016_b = new IIcon[2]; + this.field_150017_a[0] = reg.registerIcon(this.getTextureName() + "_upper"); + this.field_150016_b[0] = reg.registerIcon(this.getTextureName() + "_lower"); + this.field_150017_a[1] = new IconFlipped(this.field_150017_a[0], true, false); + this.field_150016_b[1] = new IconFlipped(this.field_150016_b[0], true, false); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + int l = this.func_150012_g(worldIn, x, y, z); + return (l & 4) != 0; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 7; + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_150011_b(this.func_150012_g(worldIn, x, y, z)); + } + + public int func_150013_e(IBlockAccess p_150013_1_, int p_150013_2_, int p_150013_3_, int p_150013_4_) + { + return this.func_150012_g(p_150013_1_, p_150013_2_, p_150013_3_, p_150013_4_) & 3; + } + + public boolean func_150015_f(IBlockAccess p_150015_1_, int p_150015_2_, int p_150015_3_, int p_150015_4_) + { + return (this.func_150012_g(p_150015_1_, p_150015_2_, p_150015_3_, p_150015_4_) & 4) != 0; + } + + private void func_150011_b(int p_150011_1_) + { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); + int j = p_150011_1_ & 3; + boolean flag = (p_150011_1_ & 4) != 0; + boolean flag1 = (p_150011_1_ & 16) != 0; + + if (j == 0) + { + if (flag) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + else if (j == 1) + { + if (flag) + { + if (!flag1) + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + } + else if (j == 2) + { + if (flag) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + } + else + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + else if (j == 3) + { + if (flag) + { + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (this.blockMaterial == Material.iron) + { + return false; //Allow items to interact with the door + } + else + { + int i1 = this.func_150012_g(worldIn, x, y, z); + int j1 = i1 & 7; + j1 ^= 4; + + if ((i1 & 8) == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, j1, 2); + worldIn.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y - 1, z, j1, 2); + worldIn.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); + } + + worldIn.playAuxSFXAtEntity(player, 1003, x, y, z, 0); + return true; + } + } + + public void func_150014_a(World p_150014_1_, int p_150014_2_, int p_150014_3_, int p_150014_4_, boolean p_150014_5_) + { + int l = this.func_150012_g(p_150014_1_, p_150014_2_, p_150014_3_, p_150014_4_); + boolean flag1 = (l & 4) != 0; + + if (flag1 != p_150014_5_) + { + int i1 = l & 7; + i1 ^= 4; + + if ((l & 8) == 0) + { + p_150014_1_.setBlockMetadataWithNotify(p_150014_2_, p_150014_3_, p_150014_4_, i1, 2); + p_150014_1_.markBlockRangeForRenderUpdate(p_150014_2_, p_150014_3_, p_150014_4_, p_150014_2_, p_150014_3_, p_150014_4_); + } + else + { + p_150014_1_.setBlockMetadataWithNotify(p_150014_2_, p_150014_3_ - 1, p_150014_4_, i1, 2); + p_150014_1_.markBlockRangeForRenderUpdate(p_150014_2_, p_150014_3_ - 1, p_150014_4_, p_150014_2_, p_150014_3_, p_150014_4_); + } + + p_150014_1_.playAuxSFXAtEntity((EntityPlayer)null, 1003, p_150014_2_, p_150014_3_, p_150014_4_, 0); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if ((l & 8) == 0) + { + boolean flag = false; + + if (worldIn.getBlock(x, y + 1, z) != this) + { + worldIn.setBlockToAir(x, y, z); + flag = true; + } + + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z)) + { + worldIn.setBlockToAir(x, y, z); + flag = true; + + if (worldIn.getBlock(x, y + 1, z) == this) + { + worldIn.setBlockToAir(x, y + 1, z); + } + } + + if (flag) + { + if (!worldIn.isRemote) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + } + } + else + { + boolean flag1 = worldIn.isBlockIndirectlyGettingPowered(x, y, z) || worldIn.isBlockIndirectlyGettingPowered(x, y + 1, z); + + if ((flag1 || neighbor.canProvidePower()) && neighbor != this) + { + this.func_150014_a(worldIn, x, y, z, flag1); + } + } + } + else + { + if (worldIn.getBlock(x, y - 1, z) != this) + { + worldIn.setBlockToAir(x, y, z); + } + + if (neighbor != this) + { + this.onNeighborBlockChange(worldIn, x, y - 1, z, neighbor); + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return (meta & 8) != 0 ? null : (this.blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door); + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.collisionRayTrace(worldIn, x, y, z, startVec, endVec); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return y >= worldIn.getHeight() - 1 ? false : World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && super.canPlaceBlockAt(worldIn, x, y, z) && super.canPlaceBlockAt(worldIn, x, y + 1, z); + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return 1; + } + + public int func_150012_g(IBlockAccess p_150012_1_, int p_150012_2_, int p_150012_3_, int p_150012_4_) + { + int l = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_, p_150012_4_); + boolean flag = (l & 8) != 0; + int i1; + int j1; + + if (flag) + { + i1 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ - 1, p_150012_4_); + j1 = l; + } + else + { + i1 = l; + j1 = p_150012_1_.getBlockMetadata(p_150012_2_, p_150012_3_ + 1, p_150012_4_); + } + + boolean flag1 = (j1 & 1) != 0; + return i1 & 7 | (flag ? 8 : 0) | (flag1 ? 16 : 0); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return this.blockMaterial == Material.iron ? Items.iron_door : Items.wooden_door; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (player.capabilities.isCreativeMode && (meta & 8) != 0 && worldIn.getBlock(x, y - 1, z) == this) + { + worldIn.setBlockToAir(x, y - 1, z); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoublePlant.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoublePlant.java new file mode 100644 index 0000000..fc98b00 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDoublePlant.java @@ -0,0 +1,327 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable +{ + public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"}; + @SideOnly(Side.CLIENT) + private IIcon[] doublePlantBottomIcons; + @SideOnly(Side.CLIENT) + private IIcon[] doublePlantTopIcons; + @SideOnly(Side.CLIENT) + public IIcon[] sunflowerIcons; + private static final String __OBFID = "CL_00000231"; + + public BlockDoublePlant() + { + super(Material.plants); + this.setHardness(0.0F); + this.setStepSound(soundTypeGrass); + this.setBlockName("doublePlant"); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 40; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public int func_149885_e(IBlockAccess p_149885_1_, int p_149885_2_, int p_149885_3_, int p_149885_4_) + { + int l = p_149885_1_.getBlockMetadata(p_149885_2_, p_149885_3_, p_149885_4_); + return !func_149887_c(l) ? l & 7 : p_149885_1_.getBlockMetadata(p_149885_2_, p_149885_3_ - 1, p_149885_4_) & 7; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return super.canPlaceBlockAt(worldIn, x, y, z) && worldIn.isAirBlock(x, y + 1, z); + } + + /** + * checks if the block can stay, if not drop as item + */ + protected void checkAndDropBlock(World worldIn, int x, int y, int z) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (!func_149887_c(l)) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + + if (worldIn.getBlock(x, y + 1, z) == this) + { + worldIn.setBlock(x, y + 1, z, Blocks.air, 0, 2); + } + } + + worldIn.setBlock(x, y, z, Blocks.air, 0, 2); + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + if (worldIn.getBlock(x, y, z) != this) return super.canBlockStay(worldIn, x, y, z); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. + int l = worldIn.getBlockMetadata(x, y, z); + return func_149887_c(l) ? worldIn.getBlock(x, y - 1, z) == this : worldIn.getBlock(x, y + 1, z) == this && super.canBlockStay(worldIn, x, y, z); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + if (func_149887_c(meta)) + { + return null; + } + else + { + int k = func_149890_d(meta); + return k != 3 && k != 2 ? Item.getItemFromBlock(this) : null; + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return func_149887_c(meta) ? 0 : meta & 7; + } + + public static boolean func_149887_c(int p_149887_0_) + { + return (p_149887_0_ & 8) != 0; + } + + public static int func_149890_d(int p_149890_0_) + { + return p_149890_0_ & 7; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return func_149887_c(meta) ? this.doublePlantBottomIcons[0] : this.doublePlantBottomIcons[meta & 7]; + } + + @SideOnly(Side.CLIENT) + public IIcon func_149888_a(boolean p_149888_1_, int p_149888_2_) + { + return p_149888_1_ ? this.doublePlantTopIcons[p_149888_2_] : this.doublePlantBottomIcons[p_149888_2_]; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + int l = this.func_149885_e(worldIn, x, y, z); + return l != 2 && l != 3 ? 16777215 : worldIn.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z); + } + + public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) + { + p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_); + p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, 8, p_149889_6_); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + worldIn.setBlock(x, y + 1, z, this, 8 | l, 2); + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + if (worldIn.isRemote || player.getCurrentEquippedItem() == null || player.getCurrentEquippedItem().getItem() != Items.shears || func_149887_c(meta) || !this.func_149886_b(worldIn, x, y, z, meta, player)) + { + super.harvestBlock(worldIn, player, x, y, z, meta); + } + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (func_149887_c(meta)) + { + if (worldIn.getBlock(x, y - 1, z) == this) + { + if (!player.capabilities.isCreativeMode) + { + int i1 = worldIn.getBlockMetadata(x, y - 1, z); + int j1 = func_149890_d(i1); + + if (j1 != 3 && j1 != 2) + { + worldIn.func_147480_a(x, y - 1, z, true); + } + else + { + if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + this.func_149886_b(worldIn, x, y, z, i1, player); + } + + worldIn.setBlockToAir(x, y - 1, z); + } + } + else + { + worldIn.setBlockToAir(x, y - 1, z); + } + } + } + else if (player.capabilities.isCreativeMode && worldIn.getBlock(x, y + 1, z) == this) + { + worldIn.setBlock(x, y + 1, z, Blocks.air, 0, 2); + } + + super.onBlockHarvested(worldIn, x, y, z, meta, player); + } + + private boolean func_149886_b(World p_149886_1_, int p_149886_2_, int p_149886_3_, int p_149886_4_, int p_149886_5_, EntityPlayer p_149886_6_) + { + int i1 = func_149890_d(p_149886_5_); + + if (i1 != 3 && i1 != 2) + { + return false; + } + else + { + p_149886_6_.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + byte b0 = 1; + + if (i1 == 3) + { + b0 = 2; + } + + this.dropBlockAsItem(p_149886_1_, p_149886_2_, p_149886_3_, p_149886_4_, new ItemStack(Blocks.tallgrass, 2, b0)); + return true; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.doublePlantBottomIcons = new IIcon[field_149892_a.length]; + this.doublePlantTopIcons = new IIcon[field_149892_a.length]; + + for (int i = 0; i < this.doublePlantBottomIcons.length; ++i) + { + this.doublePlantBottomIcons[i] = reg.registerIcon("double_plant_" + field_149892_a[i] + "_bottom"); + this.doublePlantTopIcons[i] = reg.registerIcon("double_plant_" + field_149892_a[i] + "_top"); + } + + this.sunflowerIcons = new IIcon[2]; + this.sunflowerIcons[0] = reg.registerIcon("double_plant_sunflower_front"); + this.sunflowerIcons[1] = reg.registerIcon("double_plant_sunflower_back"); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < this.doublePlantBottomIcons.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + return func_149887_c(l) ? func_149890_d(worldIn.getBlockMetadata(x, y - 1, z)) : func_149890_d(l); + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + int l = this.func_149885_e(worldIn, x, y, z); + return l != 2 && l != 3; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + int l = this.func_149885_e(worldIn, x, y, z); + this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(this, 1, l)); + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + int type = func_149890_d(metadata); + return func_149887_c(metadata) && (type == 3 || type == 4); + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + int type = func_149890_d(world.getBlockMetadata(x, y, z)); + if (type == 3 || type == 2) + ret.add(new ItemStack(Blocks.tallgrass, 2, type == 3 ? 2 : 1)); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDragonEgg.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDragonEgg.java new file mode 100644 index 0000000..679a4ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDragonEgg.java @@ -0,0 +1,184 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockDragonEgg extends Block +{ + private static final String __OBFID = "CL_00000232"; + + public BlockDragonEgg() + { + super(Material.dragonEgg); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + this.func_150018_e(worldIn, x, y, z); + } + + private void func_150018_e(World p_150018_1_, int p_150018_2_, int p_150018_3_, int p_150018_4_) + { + if (BlockFalling.func_149831_e(p_150018_1_, p_150018_2_, p_150018_3_ - 1, p_150018_4_) && p_150018_3_ >= 0) + { + byte b0 = 32; + + if (!BlockFalling.fallInstantly && p_150018_1_.checkChunksExist(p_150018_2_ - b0, p_150018_3_ - b0, p_150018_4_ - b0, p_150018_2_ + b0, p_150018_3_ + b0, p_150018_4_ + b0)) + { + EntityFallingBlock entityfallingblock = new EntityFallingBlock(p_150018_1_, (double)((float)p_150018_2_ + 0.5F), (double)((float)p_150018_3_ + 0.5F), (double)((float)p_150018_4_ + 0.5F), this); + p_150018_1_.spawnEntityInWorld(entityfallingblock); + } + else + { + p_150018_1_.setBlockToAir(p_150018_2_, p_150018_3_, p_150018_4_); + + while (BlockFalling.func_149831_e(p_150018_1_, p_150018_2_, p_150018_3_ - 1, p_150018_4_) && p_150018_3_ > 0) + { + --p_150018_3_; + } + + if (p_150018_3_ > 0) + { + p_150018_1_.setBlock(p_150018_2_, p_150018_3_, p_150018_4_, this, 0, 2); + } + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + this.func_150019_m(worldIn, x, y, z); + return true; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) + { + this.func_150019_m(worldIn, x, y, z); + } + + private void func_150019_m(World p_150019_1_, int p_150019_2_, int p_150019_3_, int p_150019_4_) + { + if (p_150019_1_.getBlock(p_150019_2_, p_150019_3_, p_150019_4_) == this) + { + for (int l = 0; l < 1000; ++l) + { + int i1 = p_150019_2_ + p_150019_1_.rand.nextInt(16) - p_150019_1_.rand.nextInt(16); + int j1 = p_150019_3_ + p_150019_1_.rand.nextInt(8) - p_150019_1_.rand.nextInt(8); + int k1 = p_150019_4_ + p_150019_1_.rand.nextInt(16) - p_150019_1_.rand.nextInt(16); + + if (p_150019_1_.getBlock(i1, j1, k1).blockMaterial == Material.air) + { + if (!p_150019_1_.isRemote) + { + p_150019_1_.setBlock(i1, j1, k1, this, p_150019_1_.getBlockMetadata(p_150019_2_, p_150019_3_, p_150019_4_), 2); + p_150019_1_.setBlockToAir(p_150019_2_, p_150019_3_, p_150019_4_); + } + else + { + short short1 = 128; + + for (int l1 = 0; l1 < short1; ++l1) + { + double d0 = p_150019_1_.rand.nextDouble(); + float f = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (p_150019_1_.rand.nextFloat() - 0.5F) * 0.2F; + double d1 = (double)i1 + (double)(p_150019_2_ - i1) * d0 + (p_150019_1_.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + double d2 = (double)j1 + (double)(p_150019_3_ - j1) * d0 + p_150019_1_.rand.nextDouble() * 1.0D - 0.5D; + double d3 = (double)k1 + (double)(p_150019_4_ - k1) * d0 + (p_150019_1_.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; + p_150019_1_.spawnParticle("portal", d1, d2, d3, (double)f, (double)f1, (double)f2); + } + } + + return; + } + } + } + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 5; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return true; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 27; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(0); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDropper.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDropper.java new file mode 100644 index 0000000..9878140 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDropper.java @@ -0,0 +1,96 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.Facing; +import net.minecraft.world.World; + +public class BlockDropper extends BlockDispenser +{ + private final IBehaviorDispenseItem field_149947_P = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00000233"; + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("furnace_side"); + this.field_149944_M = reg.registerIcon("furnace_top"); + this.field_149945_N = reg.registerIcon(this.getTextureName() + "_front_horizontal"); + this.field_149946_O = reg.registerIcon(this.getTextureName() + "_front_vertical"); + } + + protected IBehaviorDispenseItem func_149940_a(ItemStack p_149940_1_) + { + return this.field_149947_P; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityDropper(); + } + + protected void func_149941_e(World p_149941_1_, int p_149941_2_, int p_149941_3_, int p_149941_4_) + { + BlockSourceImpl blocksourceimpl = new BlockSourceImpl(p_149941_1_, p_149941_2_, p_149941_3_, p_149941_4_); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)blocksourceimpl.getBlockTileEntity(); + + if (tileentitydispenser != null) + { + int l = tileentitydispenser.func_146017_i(); + + if (l < 0) + { + p_149941_1_.playAuxSFX(1001, p_149941_2_, p_149941_3_, p_149941_4_, 0); + } + else + { + ItemStack itemstack = tileentitydispenser.getStackInSlot(l); + int i1 = p_149941_1_.getBlockMetadata(p_149941_2_, p_149941_3_, p_149941_4_) & 7; + IInventory iinventory = TileEntityHopper.func_145893_b(p_149941_1_, (double)(p_149941_2_ + Facing.offsetsXForSide[i1]), (double)(p_149941_3_ + Facing.offsetsYForSide[i1]), (double)(p_149941_4_ + Facing.offsetsZForSide[i1])); + ItemStack itemstack1; + + if (iinventory != null) + { + itemstack1 = TileEntityHopper.func_145889_a(iinventory, itemstack.copy().splitStack(1), Facing.oppositeSide[i1]); + + if (itemstack1 == null) + { + itemstack1 = itemstack.copy(); + + if (--itemstack1.stackSize == 0) + { + itemstack1 = null; + } + } + else + { + itemstack1 = itemstack.copy(); + } + } + else + { + itemstack1 = this.field_149947_P.dispense(blocksourceimpl, itemstack); + + if (itemstack1 != null && itemstack1.stackSize == 0) + { + itemstack1 = null; + } + } + + tileentitydispenser.setInventorySlotContents(l, itemstack1); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockDynamicLiquid.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDynamicLiquid.java new file mode 100644 index 0000000..e2d1753 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockDynamicLiquid.java @@ -0,0 +1,360 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockDynamicLiquid extends BlockLiquid +{ + int field_149815_a; + boolean[] field_149814_b = new boolean[4]; + int[] field_149816_M = new int[4]; + private static final String __OBFID = "CL_00000234"; + + protected BlockDynamicLiquid(Material p_i45403_1_) + { + super(p_i45403_1_); + } + + private void func_149811_n(World p_149811_1_, int p_149811_2_, int p_149811_3_, int p_149811_4_) + { + int l = p_149811_1_.getBlockMetadata(p_149811_2_, p_149811_3_, p_149811_4_); + p_149811_1_.setBlock(p_149811_2_, p_149811_3_, p_149811_4_, Block.getBlockById(Block.getIdFromBlock(this) + 1), l, 2); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + int l = this.func_149804_e(worldIn, x, y, z); + byte b0 = 1; + + if (this.blockMaterial == Material.lava && !worldIn.provider.isHellWorld) + { + b0 = 2; + } + + boolean flag = true; + int i1 = this.tickRate(worldIn); + int j1; + + if (l > 0) + { + byte b1 = -100; + this.field_149815_a = 0; + int l1 = this.func_149810_a(worldIn, x - 1, y, z, b1); + l1 = this.func_149810_a(worldIn, x + 1, y, z, l1); + l1 = this.func_149810_a(worldIn, x, y, z - 1, l1); + l1 = this.func_149810_a(worldIn, x, y, z + 1, l1); + j1 = l1 + b0; + + if (j1 >= 8 || l1 < 0) + { + j1 = -1; + } + + if (this.func_149804_e(worldIn, x, y + 1, z) >= 0) + { + int k1 = this.func_149804_e(worldIn, x, y + 1, z); + + if (k1 >= 8) + { + j1 = k1; + } + else + { + j1 = k1 + 8; + } + } + + if (this.field_149815_a >= 2 && this.blockMaterial == Material.water) + { + if (worldIn.getBlock(x, y - 1, z).getMaterial().isSolid()) + { + j1 = 0; + } + else if (worldIn.getBlock(x, y - 1, z).getMaterial() == this.blockMaterial && worldIn.getBlockMetadata(x, y - 1, z) == 0) + { + j1 = 0; + } + } + + if (this.blockMaterial == Material.lava && l < 8 && j1 < 8 && j1 > l && random.nextInt(4) != 0) + { + i1 *= 4; + } + + if (j1 == l) + { + if (flag) + { + this.func_149811_n(worldIn, x, y, z); + } + } + else + { + l = j1; + + if (j1 < 0) + { + worldIn.setBlockToAir(x, y, z); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, j1, 2); + worldIn.scheduleBlockUpdate(x, y, z, this, i1); + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + } + } + } + else + { + this.func_149811_n(worldIn, x, y, z); + } + + if (this.func_149809_q(worldIn, x, y - 1, z)) + { + if (this.blockMaterial == Material.lava && worldIn.getBlock(x, y - 1, z).getMaterial() == Material.water) + { + worldIn.setBlock(x, y - 1, z, Blocks.stone); + this.func_149799_m(worldIn, x, y - 1, z); + return; + } + + if (l >= 8) + { + this.func_149813_h(worldIn, x, y - 1, z, l); + } + else + { + this.func_149813_h(worldIn, x, y - 1, z, l + 8); + } + } + else if (l >= 0 && (l == 0 || this.func_149807_p(worldIn, x, y - 1, z))) + { + boolean[] aboolean = this.func_149808_o(worldIn, x, y, z); + j1 = l + b0; + + if (l >= 8) + { + j1 = 1; + } + + if (j1 >= 8) + { + return; + } + + if (aboolean[0]) + { + this.func_149813_h(worldIn, x - 1, y, z, j1); + } + + if (aboolean[1]) + { + this.func_149813_h(worldIn, x + 1, y, z, j1); + } + + if (aboolean[2]) + { + this.func_149813_h(worldIn, x, y, z - 1, j1); + } + + if (aboolean[3]) + { + this.func_149813_h(worldIn, x, y, z + 1, j1); + } + } + } + + private void func_149813_h(World p_149813_1_, int p_149813_2_, int p_149813_3_, int p_149813_4_, int p_149813_5_) + { + if (this.func_149809_q(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_)) + { + Block block = p_149813_1_.getBlock(p_149813_2_, p_149813_3_, p_149813_4_); + + if (this.blockMaterial == Material.lava) + { + this.func_149799_m(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_); + } + else + { + block.dropBlockAsItem(p_149813_1_, p_149813_2_, p_149813_3_, p_149813_4_, p_149813_1_.getBlockMetadata(p_149813_2_, p_149813_3_, p_149813_4_), 0); + } + + p_149813_1_.setBlock(p_149813_2_, p_149813_3_, p_149813_4_, this, p_149813_5_, 3); + } + } + + private int func_149812_c(World p_149812_1_, int p_149812_2_, int p_149812_3_, int p_149812_4_, int p_149812_5_, int p_149812_6_) + { + int j1 = 1000; + + for (int k1 = 0; k1 < 4; ++k1) + { + if ((k1 != 0 || p_149812_6_ != 1) && (k1 != 1 || p_149812_6_ != 0) && (k1 != 2 || p_149812_6_ != 3) && (k1 != 3 || p_149812_6_ != 2)) + { + int l1 = p_149812_2_; + int i2 = p_149812_4_; + + if (k1 == 0) + { + l1 = p_149812_2_ - 1; + } + + if (k1 == 1) + { + ++l1; + } + + if (k1 == 2) + { + i2 = p_149812_4_ - 1; + } + + if (k1 == 3) + { + ++i2; + } + + if (!this.func_149807_p(p_149812_1_, l1, p_149812_3_, i2) && (p_149812_1_.getBlock(l1, p_149812_3_, i2).getMaterial() != this.blockMaterial || p_149812_1_.getBlockMetadata(l1, p_149812_3_, i2) != 0)) + { + if (!this.func_149807_p(p_149812_1_, l1, p_149812_3_ - 1, i2)) + { + return p_149812_5_; + } + + if (p_149812_5_ < 4) + { + int j2 = this.func_149812_c(p_149812_1_, l1, p_149812_3_, i2, p_149812_5_ + 1, k1); + + if (j2 < j1) + { + j1 = j2; + } + } + } + } + } + + return j1; + } + + private boolean[] func_149808_o(World p_149808_1_, int p_149808_2_, int p_149808_3_, int p_149808_4_) + { + int l; + int i1; + + for (l = 0; l < 4; ++l) + { + this.field_149816_M[l] = 1000; + i1 = p_149808_2_; + int j1 = p_149808_4_; + + if (l == 0) + { + i1 = p_149808_2_ - 1; + } + + if (l == 1) + { + ++i1; + } + + if (l == 2) + { + j1 = p_149808_4_ - 1; + } + + if (l == 3) + { + ++j1; + } + + if (!this.func_149807_p(p_149808_1_, i1, p_149808_3_, j1) && (p_149808_1_.getBlock(i1, p_149808_3_, j1).getMaterial() != this.blockMaterial || p_149808_1_.getBlockMetadata(i1, p_149808_3_, j1) != 0)) + { + if (this.func_149807_p(p_149808_1_, i1, p_149808_3_ - 1, j1)) + { + this.field_149816_M[l] = this.func_149812_c(p_149808_1_, i1, p_149808_3_, j1, 1, l); + } + else + { + this.field_149816_M[l] = 0; + } + } + } + + l = this.field_149816_M[0]; + + for (i1 = 1; i1 < 4; ++i1) + { + if (this.field_149816_M[i1] < l) + { + l = this.field_149816_M[i1]; + } + } + + for (i1 = 0; i1 < 4; ++i1) + { + this.field_149814_b[i1] = this.field_149816_M[i1] == l; + } + + return this.field_149814_b; + } + + private boolean func_149807_p(World p_149807_1_, int p_149807_2_, int p_149807_3_, int p_149807_4_) + { + Block block = p_149807_1_.getBlock(p_149807_2_, p_149807_3_, p_149807_4_); + return block != Blocks.wooden_door && block != Blocks.iron_door && block != Blocks.standing_sign && block != Blocks.ladder && block != Blocks.reeds ? (block.blockMaterial == Material.portal ? true : block.blockMaterial.blocksMovement()) : true; + } + + protected int func_149810_a(World p_149810_1_, int p_149810_2_, int p_149810_3_, int p_149810_4_, int p_149810_5_) + { + int i1 = this.func_149804_e(p_149810_1_, p_149810_2_, p_149810_3_, p_149810_4_); + + if (i1 < 0) + { + return p_149810_5_; + } + else + { + if (i1 == 0) + { + ++this.field_149815_a; + } + + if (i1 >= 8) + { + i1 = 0; + } + + return p_149810_5_ >= 0 && i1 >= p_149810_5_ ? p_149810_5_ : i1; + } + } + + private boolean func_149809_q(World p_149809_1_, int p_149809_2_, int p_149809_3_, int p_149809_4_) + { + Material material = p_149809_1_.getBlock(p_149809_2_, p_149809_3_, p_149809_4_).getMaterial(); + return material == this.blockMaterial ? false : (material == Material.lava ? false : !this.func_149807_p(p_149809_1_, p_149809_2_, p_149809_3_, p_149809_4_)); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + + if (worldIn.getBlock(x, y, z) == this) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + } + + public boolean func_149698_L() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnchantmentTable.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnchantmentTable.java new file mode 100644 index 0000000..7670bc2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnchantmentTable.java @@ -0,0 +1,141 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockEnchantmentTable extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private IIcon field_149950_a; + @SideOnly(Side.CLIENT) + private IIcon field_149949_b; + private static final String __OBFID = "CL_00000235"; + + protected BlockEnchantmentTable() + { + super(Material.rock); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + super.randomDisplayTick(worldIn, x, y, z, random); + + for (int l = x - 2; l <= x + 2; ++l) + { + for (int i1 = z - 2; i1 <= z + 2; ++i1) + { + if (l > x - 2 && l < x + 2 && i1 == z - 1) + { + i1 = z + 2; + } + + if (random.nextInt(16) == 0) + { + for (int j1 = y; j1 <= y + 1; ++j1) + { + if (worldIn.getBlock(l, j1, i1) == Blocks.bookshelf) + { + if (!worldIn.isAirBlock((l - x) / 2 + x, j1, (i1 - z) / 2 + z)) + { + break; + } + + worldIn.spawnParticle("enchantmenttable", (double)x + 0.5D, (double)y + 2.0D, (double)z + 0.5D, (double)((float)(l - x) + random.nextFloat()) - 0.5D, (double)((float)(j1 - y) - random.nextFloat() - 1.0F), (double)((float)(i1 - z) + random.nextFloat()) - 0.5D); + } + } + } + } + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 0 ? this.field_149949_b : (side == 1 ? this.field_149950_a : this.blockIcon); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEnchantmentTable(); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityEnchantmentTable tileentityenchantmenttable = (TileEntityEnchantmentTable)worldIn.getTileEntity(x, y, z); + player.displayGUIEnchantment(x, y, z, tileentityenchantmenttable.func_145921_b() ? tileentityenchantmenttable.func_145919_a() : null); + return true; + } + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + super.onBlockPlacedBy(worldIn, x, y, z, placer, itemIn); + + if (itemIn.hasDisplayName()) + { + ((TileEntityEnchantmentTable)worldIn.getTileEntity(x, y, z)).func_145920_a(itemIn.getDisplayName()); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_" + "side"); + this.field_149950_a = reg.registerIcon(this.getTextureName() + "_" + "top"); + this.field_149949_b = reg.registerIcon(this.getTextureName() + "_" + "bottom"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortal.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortal.java new file mode 100644 index 0000000..c36e4c5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortal.java @@ -0,0 +1,154 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockEndPortal extends BlockContainer +{ + public static boolean field_149948_a; + private static final String __OBFID = "CL_00000236"; + + protected BlockEndPortal(Material p_i45404_1_) + { + super(p_i45404_1_); + this.setLightLevel(1.0F); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEndPortal(); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + float f = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side != 0 ? false : super.shouldSideBeRendered(worldIn, x, y, z, side); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) {} + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null && !worldIn.isRemote) + { + entityIn.travelToDimension(1); + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + double d0 = (double)((float)x + random.nextFloat()); + double d1 = (double)((float)y + 0.8F); + double d2 = (double)((float)z + random.nextFloat()); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + worldIn.spawnParticle("smoke", d0, d1, d2, d3, d4, d5); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (!field_149948_a) + { + if (worldIn.provider.dimensionId != 0) + { + worldIn.setBlockToAir(x, y, z); + } + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(0); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("portal"); + } + + public MapColor getMapColor(int meta) + { + return MapColor.obsidianColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortalFrame.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortalFrame.java new file mode 100644 index 0000000..f4b1c8d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEndPortalFrame.java @@ -0,0 +1,139 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockEndPortalFrame extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon iconEndPortalFrameTop; + @SideOnly(Side.CLIENT) + private IIcon iconEndPortalFrameEye; + private static final String __OBFID = "CL_00000237"; + + public BlockEndPortalFrame() + { + super(Material.rock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.iconEndPortalFrameTop : (side == 0 ? Blocks.end_stone.getBlockTextureFromSide(side) : this.blockIcon); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.iconEndPortalFrameTop = reg.registerIcon(this.getTextureName() + "_top"); + this.iconEndPortalFrameEye = reg.registerIcon(this.getTextureName() + "_eye"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIconEndPortalFrameEye() + { + return this.iconEndPortalFrameEye; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 26; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + int l = worldIn.getBlockMetadata(x, y, z); + + if (isEnderEyeInserted(l)) + { + this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + this.setBlockBoundsForItemRender(); + } + + /** + * checks if an ender eye has been inserted into the frame block. parameters: metadata + */ + public static boolean isEnderEyeInserted(int p_150020_0_) + { + return (p_150020_0_ & 4) != 0; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + return isEnderEyeInserted(i1) ? 15 : 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnderChest.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnderChest.java new file mode 100644 index 0000000..ffd3fa4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEnderChest.java @@ -0,0 +1,179 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockEnderChest extends BlockContainer +{ + private static final String __OBFID = "CL_00000238"; + + protected BlockEnderChest() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 22; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.obsidian); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 8; + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + byte b0 = 0; + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (l == 0) + { + b0 = 2; + } + + if (l == 1) + { + b0 = 5; + } + + if (l == 2) + { + b0 = 3; + } + + if (l == 3) + { + b0 = 4; + } + + worldIn.setBlockMetadataWithNotify(x, y, z, b0, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + InventoryEnderChest inventoryenderchest = player.getInventoryEnderChest(); + TileEntityEnderChest tileentityenderchest = (TileEntityEnderChest)worldIn.getTileEntity(x, y, z); + + if (inventoryenderchest != null && tileentityenderchest != null) + { + if (worldIn.getBlock(x, y + 1, z).isNormalCube()) + { + return true; + } + else if (worldIn.isRemote) + { + return true; + } + else + { + inventoryenderchest.func_146031_a(tileentityenderchest); + player.displayGUIChest(inventoryenderchest); + return true; + } + } + else + { + return true; + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityEnderChest(); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + for (int l = 0; l < 3; ++l) + { + double d6 = (double)((float)x + random.nextFloat()); + double d1 = (double)((float)y + random.nextFloat()); + d6 = (double)((float)z + random.nextFloat()); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + int i1 = random.nextInt(2) * 2 - 1; + int j1 = random.nextInt(2) * 2 - 1; + d3 = ((double)random.nextFloat() - 0.5D) * 0.125D; + d4 = ((double)random.nextFloat() - 0.5D) * 0.125D; + d5 = ((double)random.nextFloat() - 0.5D) * 0.125D; + double d2 = (double)z + 0.5D + 0.25D * (double)j1; + d5 = (double)(random.nextFloat() * 1.0F * (float)j1); + double d0 = (double)x + 0.5D + 0.25D * (double)i1; + d3 = (double)(random.nextFloat() * 1.0F * (float)i1); + worldIn.spawnParticle("portal", d0, d1, d2, d3, d4, d5); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("obsidian"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockEventData.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEventData.java new file mode 100644 index 0000000..e8f13e1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockEventData.java @@ -0,0 +1,78 @@ +package net.minecraft.block; + +public class BlockEventData +{ + private int coordX; + private int coordY; + private int coordZ; + private Block field_151344_d; + /** Different for each blockID */ + private int eventID; + /** Different for each blockID, eventID */ + private int eventParameter; + private static final String __OBFID = "CL_00000131"; + + public BlockEventData(int p_i45362_1_, int p_i45362_2_, int p_i45362_3_, Block p_i45362_4_, int p_i45362_5_, int p_i45362_6_) + { + this.coordX = p_i45362_1_; + this.coordY = p_i45362_2_; + this.coordZ = p_i45362_3_; + this.eventID = p_i45362_5_; + this.eventParameter = p_i45362_6_; + this.field_151344_d = p_i45362_4_; + } + + public int func_151340_a() + { + return this.coordX; + } + + public int func_151342_b() + { + return this.coordY; + } + + public int func_151341_c() + { + return this.coordZ; + } + + /** + * Get the Event ID (different for each BlockID) + */ + public int getEventID() + { + return this.eventID; + } + + /** + * Get the Event Parameter (different for each Block,EventID) + */ + public int getEventParameter() + { + return this.eventParameter; + } + + public Block getBlock() + { + return this.field_151344_d; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof BlockEventData)) + { + return false; + } + else + { + BlockEventData blockeventdata = (BlockEventData)p_equals_1_; + return this.coordX == blockeventdata.coordX && this.coordY == blockeventdata.coordY && this.coordZ == blockeventdata.coordZ && this.eventID == blockeventdata.eventID && this.eventParameter == blockeventdata.eventParameter && this.field_151344_d == blockeventdata.field_151344_d; + } + } + + public String toString() + { + return "TE(" + this.coordX + "," + this.coordY + "," + this.coordZ + ")," + this.eventID + "," + this.eventParameter + "," + this.field_151344_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFalling.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFalling.java new file mode 100644 index 0000000..3e578b9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFalling.java @@ -0,0 +1,117 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockFalling extends Block +{ + public static boolean fallInstantly; + private static final String __OBFID = "CL_00000240"; + + public BlockFalling() + { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public BlockFalling(Material p_i45405_1_) + { + super(p_i45405_1_); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + this.func_149830_m(worldIn, x, y, z); + } + } + + private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_) + { + if (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ >= 0) + { + byte b0 = 32; + + if (!fallInstantly && p_149830_1_.checkChunksExist(p_149830_2_ - b0, p_149830_3_ - b0, p_149830_4_ - b0, p_149830_2_ + b0, p_149830_3_ + b0, p_149830_4_ + b0)) + { + if (!p_149830_1_.isRemote) + { + EntityFallingBlock entityfallingblock = new EntityFallingBlock(p_149830_1_, (double)((float)p_149830_2_ + 0.5F), (double)((float)p_149830_3_ + 0.5F), (double)((float)p_149830_4_ + 0.5F), this, p_149830_1_.getBlockMetadata(p_149830_2_, p_149830_3_, p_149830_4_)); + this.func_149829_a(entityfallingblock); + p_149830_1_.spawnEntityInWorld(entityfallingblock); + } + } + else + { + p_149830_1_.setBlockToAir(p_149830_2_, p_149830_3_, p_149830_4_); + + while (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ > 0) + { + --p_149830_3_; + } + + if (p_149830_3_ > 0) + { + p_149830_1_.setBlock(p_149830_2_, p_149830_3_, p_149830_4_, this); + } + } + } + } + + protected void func_149829_a(EntityFallingBlock p_149829_1_) {} + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 2; + } + + public static boolean func_149831_e(World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_) + { + Block block = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_); + + if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_)) + { + return true; + } + else if (block == Blocks.fire) + { + return true; + } + else + { + //TODO: King, take a look here when doing liquids! + Material material = block.blockMaterial; + return material == Material.water ? true : material == Material.lava; + } + } + + public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFarmland.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFarmland.java new file mode 100644 index 0000000..a6dee02 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFarmland.java @@ -0,0 +1,183 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockFarmland extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_149824_a; + @SideOnly(Side.CLIENT) + private IIcon field_149823_b; + private static final String __OBFID = "CL_00000241"; + + protected BlockFarmland() + { + super(Material.ground); + this.setTickRandomly(true); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); + this.setLightOpacity(255); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox((double)(x + 0), (double)(y + 0), (double)(z + 0), (double)(x + 1), (double)(y + 1), (double)(z + 1)); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? (meta > 0 ? this.field_149824_a : this.field_149823_b) : Blocks.dirt.getBlockTextureFromSide(side); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!this.func_149821_m(worldIn, x, y, z) && !worldIn.canLightningStrikeAt(x, y + 1, z)) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l > 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l - 1, 2); + } + else if (!this.func_149822_e(worldIn, x, y, z)) + { + worldIn.setBlock(x, y, z, Blocks.dirt); + } + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, 7, 2); + } + } + + /** + * Block's chance to react to an entity falling on it. + */ + public void onFallenUpon(World worldIn, int x, int y, int z, Entity entityIn, float fallDistance) + { + if (!worldIn.isRemote && worldIn.rand.nextFloat() < fallDistance - 0.5F) + { + if (!(entityIn instanceof EntityPlayer) && !worldIn.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + return; + } + + worldIn.setBlock(x, y, z, Blocks.dirt); + } + } + + private boolean func_149822_e(World p_149822_1_, int p_149822_2_, int p_149822_3_, int p_149822_4_) + { + byte b0 = 0; + + for (int l = p_149822_2_ - b0; l <= p_149822_2_ + b0; ++l) + { + for (int i1 = p_149822_4_ - b0; i1 <= p_149822_4_ + b0; ++i1) + { + Block block = p_149822_1_.getBlock(l, p_149822_3_ + 1, i1); + + if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block)) + { + return true; + } + } + } + + return false; + } + + private boolean func_149821_m(World p_149821_1_, int p_149821_2_, int p_149821_3_, int p_149821_4_) + { + for (int l = p_149821_2_ - 4; l <= p_149821_2_ + 4; ++l) + { + for (int i1 = p_149821_3_; i1 <= p_149821_3_ + 1; ++i1) + { + for (int j1 = p_149821_4_ - 4; j1 <= p_149821_4_ + 4; ++j1) + { + if (p_149821_1_.getBlock(l, i1, j1).getMaterial() == Material.water) + { + return true; + } + } + } + } + + return false; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + Material material = worldIn.getBlock(x, y + 1, z).getMaterial(); + + if (material.isSolid()) + { + worldIn.setBlock(x, y, z, Blocks.dirt); + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Blocks.dirt.getItemDropped(0, random, fortune); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemFromBlock(Blocks.dirt); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149824_a = reg.registerIcon(this.getTextureName() + "_wet"); + this.field_149823_b = reg.registerIcon(this.getTextureName() + "_dry"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFence.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFence.java new file mode 100644 index 0000000..bc3fc41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFence.java @@ -0,0 +1,196 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemLead; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFence extends Block +{ + private final String field_149827_a; + private static final String __OBFID = "CL_00000242"; + + public BlockFence(String p_i45406_1_, Material p_i45406_2_) + { + super(p_i45406_2_); + this.field_149827_a = p_i45406_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + boolean flag = this.canConnectFenceTo(worldIn, x, y, z - 1); + boolean flag1 = this.canConnectFenceTo(worldIn, x, y, z + 1); + boolean flag2 = this.canConnectFenceTo(worldIn, x - 1, y, z); + boolean flag3 = this.canConnectFenceTo(worldIn, x + 1, y, z); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag || flag1) + { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + f2 = 0.375F; + f3 = 0.625F; + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + if (flag2 || flag3 || !flag && !flag1) + { + this.setBlockBounds(f, 0.0F, f2, f1, 1.5F, f3); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + boolean flag = this.canConnectFenceTo(worldIn, x, y, z - 1); + boolean flag1 = this.canConnectFenceTo(worldIn, x, y, z + 1); + boolean flag2 = this.canConnectFenceTo(worldIn, x - 1, y, z); + boolean flag3 = this.canConnectFenceTo(worldIn, x + 1, y, z); + float f = 0.375F; + float f1 = 0.625F; + float f2 = 0.375F; + float f3 = 0.625F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 11; + } + + /** + * Returns true if the specified block can be connected by a fence + */ + public boolean canConnectFenceTo(IBlockAccess p_149826_1_, int p_149826_2_, int p_149826_3_, int p_149826_4_) + { + Block block = p_149826_1_.getBlock(p_149826_2_, p_149826_3_, p_149826_4_); + return block != this && block != Blocks.fence_gate ? (block.blockMaterial.isOpaque() && block.renderAsNormalBlock() ? block.blockMaterial != Material.gourd : false) : true; + } + + public static boolean func_149825_a(Block p_149825_0_) + { + return p_149825_0_ == Blocks.fence || p_149825_0_ == Blocks.nether_brick_fence; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return true; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.field_149827_a); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + return worldIn.isRemote ? true : ItemLead.func_150909_a(player, worldIn, x, y, z); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFenceGate.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFenceGate.java new file mode 100644 index 0000000..673cafd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFenceGate.java @@ -0,0 +1,186 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockFenceGate extends BlockDirectional +{ + private static final String __OBFID = "CL_00000243"; + + public BlockFenceGate() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.planks.getBlockTextureFromSide(side); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return !worldIn.getBlock(x, y - 1, z).getMaterial().isSolid() ? false : super.canPlaceBlockAt(worldIn, x, y, z); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + return isFenceGateOpen(l) ? null : (l != 2 && l != 0 ? AxisAlignedBB.getBoundingBox((double)((float)x + 0.375F), (double)y, (double)z, (double)((float)x + 0.625F), (double)((float)y + 1.5F), (double)(z + 1)) : AxisAlignedBB.getBoundingBox((double)x, (double)y, (double)((float)z + 0.375F), (double)(x + 1), (double)((float)y + 1.5F), (double)((float)z + 0.625F))); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = getDirection(worldIn.getBlockMetadata(x, y, z)); + + if (l != 2 && l != 0) + { + this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return isFenceGateOpen(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 21; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = (MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (isFenceGateOpen(i1)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1 & -5, 2); + } + else + { + int j1 = (MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + int k1 = getDirection(i1); + + if (k1 == (j1 + 2) % 4) + { + i1 = j1; + } + + worldIn.setBlockMetadataWithNotify(x, y, z, i1 | 4, 2); + } + + worldIn.playAuxSFXAtEntity(player, 1003, x, y, z, 0); + return true; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag = worldIn.isBlockIndirectlyGettingPowered(x, y, z); + + if (flag || neighbor.canProvidePower()) + { + if (flag && !isFenceGateOpen(l)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l | 4, 2); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1003, x, y, z, 0); + } + else if (!flag && isFenceGateOpen(l)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l & -5, 2); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1003, x, y, z, 0); + } + } + } + } + + /** + * Returns if the fence gate is open according to its metadata. + */ + public static boolean isFenceGateOpen(int p_149896_0_) + { + return (p_149896_0_ & 4) != 0; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return true; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFire.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFire.java new file mode 100644 index 0000000..1451285 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFire.java @@ -0,0 +1,574 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.IdentityHashMap; +import java.util.Map.Entry; +import java.util.Random; +import com.google.common.collect.Maps; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockFire extends Block +{ + @Deprecated + private int[] field_149849_a = new int[4096]; + @Deprecated + private int[] field_149848_b = new int[4096]; + @SideOnly(Side.CLIENT) + private IIcon[] field_149850_M; + private static final String __OBFID = "CL_00000245"; + + protected BlockFire() + { + super(Material.fire); + this.setTickRandomly(true); + } + + public static void func_149843_e() + { + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.planks), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.double_wooden_slab), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.wooden_slab), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.fence), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.oak_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.birch_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.spruce_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.jungle_stairs), 5, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.log), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.log2), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.leaves), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.leaves2), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.bookshelf), 30, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.tnt), 15, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.tallgrass), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.double_plant), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.yellow_flower), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.red_flower), 60, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.wool), 30, 60); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.vine), 15, 100); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.coal_block), 5, 5); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.hay_block), 60, 20); + Blocks.fire.func_149842_a(getIdFromBlock(Blocks.carpet), 60, 20); + } + + @Deprecated // Use setFireInfo + public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_) + { + this.setFireInfo((Block)Block.blockRegistry.getObjectById(p_149842_1_), p_149842_2_, p_149842_3_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 3; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 30; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.getGameRules().getGameRuleBooleanValue("doFireTick")) + { + boolean flag = worldIn.getBlock(x, y - 1, z).isFireSource(worldIn, x, y - 1, z, UP); + + if (!this.canPlaceBlockAt(worldIn, x, y, z)) + { + worldIn.setBlockToAir(x, y, z); + } + + if (!flag && worldIn.isRaining() && (worldIn.canLightningStrikeAt(x, y, z) || worldIn.canLightningStrikeAt(x - 1, y, z) || worldIn.canLightningStrikeAt(x + 1, y, z) || worldIn.canLightningStrikeAt(x, y, z - 1) || worldIn.canLightningStrikeAt(x, y, z + 1))) + { + worldIn.setBlockToAir(x, y, z); + } + else + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l < 15) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l + random.nextInt(3) / 2, 4); + } + + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn) + random.nextInt(10)); + + if (!flag && !this.canNeighborBurn(worldIn, x, y, z)) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) || l > 3) + { + worldIn.setBlockToAir(x, y, z); + } + } + else if (!flag && !this.canCatchFire(worldIn, x, y - 1, z, UP) && l == 15 && random.nextInt(4) == 0) + { + worldIn.setBlockToAir(x, y, z); + } + else + { + boolean flag1 = worldIn.isBlockHighHumidity(x, y, z); + byte b0 = 0; + + if (flag1) + { + b0 = -50; + } + + this.tryCatchFire(worldIn, x + 1, y, z, 300 + b0, random, l, WEST ); + this.tryCatchFire(worldIn, x - 1, y, z, 300 + b0, random, l, EAST ); + this.tryCatchFire(worldIn, x, y - 1, z, 250 + b0, random, l, UP ); + this.tryCatchFire(worldIn, x, y + 1, z, 250 + b0, random, l, DOWN ); + this.tryCatchFire(worldIn, x, y, z - 1, 300 + b0, random, l, SOUTH); + this.tryCatchFire(worldIn, x, y, z + 1, 300 + b0, random, l, NORTH); + + for (int i1 = x - 1; i1 <= x + 1; ++i1) + { + for (int j1 = z - 1; j1 <= z + 1; ++j1) + { + for (int k1 = y - 1; k1 <= y + 4; ++k1) + { + if (i1 != x || k1 != y || j1 != z) + { + int l1 = 100; + + if (k1 > y + 1) + { + l1 += (k1 - (y + 1)) * 100; + } + + int i2 = this.getChanceOfNeighborsEncouragingFire(worldIn, i1, k1, j1); + + if (i2 > 0) + { + int j2 = (i2 + 40 + worldIn.difficultySetting.getDifficultyId() * 7) / (l + 30); + + if (flag1) + { + j2 /= 2; + } + + if (j2 > 0 && random.nextInt(l1) <= j2 && (!worldIn.isRaining() || !worldIn.canLightningStrikeAt(i1, k1, j1)) && !worldIn.canLightningStrikeAt(i1 - 1, k1, z) && !worldIn.canLightningStrikeAt(i1 + 1, k1, j1) && !worldIn.canLightningStrikeAt(i1, k1, j1 - 1) && !worldIn.canLightningStrikeAt(i1, k1, j1 + 1)) + { + int k2 = l + random.nextInt(5) / 4; + + if (k2 > 15) + { + k2 = 15; + } + + worldIn.setBlock(i1, k1, j1, this, k2, 3); + } + } + } + } + } + } + } + } + } + } + + public boolean func_149698_L() + { + return false; + } + + /** + * Tries to set block on fire. Deprecated in favour of side-sensitive version. + */ + @Deprecated + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) + { + this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP); + } + + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face) + { + int j1 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); + + if (p_149841_6_.nextInt(p_149841_5_) < j1) + { + boolean flag = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; + + if (p_149841_6_.nextInt(p_149841_7_ + 10) < 5 && !p_149841_1_.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) + { + int k1 = p_149841_7_ + p_149841_6_.nextInt(5) / 4; + + if (k1 > 15) + { + k1 = 15; + } + + p_149841_1_.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, this, k1, 3); + } + else + { + p_149841_1_.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_); + } + + if (flag) + { + Blocks.tnt.onBlockDestroyedByPlayer(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, 1); + } + } + } + + /** + * Returns true if at least one block next to this one can burn. + */ + private boolean canNeighborBurn(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) + { + return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) || + this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH); + } + + /** + * Gets the highest chance of a neighbor block encouraging this block to catch fire + */ + private int getChanceOfNeighborsEncouragingFire(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) + { + byte b0 = 0; + + if (!p_149845_1_.isAirBlock(p_149845_2_, p_149845_3_, p_149845_4_)) + { + return 0; + } + else + { + int l = b0; + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH); + return l; + } + } + + /** + * Returns if this block is collidable (only used by Fire). Args: x, y, z + */ + public boolean isCollidable() + { + return false; + } + + /** + * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z + */ + @Deprecated + public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) + { + return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP); + } + + @Deprecated + public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) + { + return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) || this.canNeighborBurn(worldIn, x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && !this.canNeighborBurn(worldIn, x, y, z)) + { + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (worldIn.provider.dimensionId > 0 || !Blocks.portal.func_150000_e(worldIn, x, y, z)) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && !this.canNeighborBurn(worldIn, x, y, z)) + { + worldIn.setBlockToAir(x, y, z); + } + else + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn) + worldIn.rand.nextInt(10)); + } + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (random.nextInt(24) == 0) + { + worldIn.playSound((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), "fire.fire", 1.0F + random.nextFloat(), random.nextFloat() * 0.7F + 0.3F, false); + } + + int l; + float f; + float f1; + float f2; + + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && !Blocks.fire.canCatchFire(worldIn, x, y - 1, z, UP)) + { + if (Blocks.fire.canCatchFire(worldIn, x - 1, y, z, EAST)) + { + for (l = 0; l < 2; ++l) + { + f = (float)x + random.nextFloat() * 0.1F; + f1 = (float)y + random.nextFloat(); + f2 = (float)z + random.nextFloat(); + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.canCatchFire(worldIn, x + 1, y, z, WEST)) + { + for (l = 0; l < 2; ++l) + { + f = (float)(x + 1) - random.nextFloat() * 0.1F; + f1 = (float)y + random.nextFloat(); + f2 = (float)z + random.nextFloat(); + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.canCatchFire(worldIn, x, y, z - 1, SOUTH)) + { + for (l = 0; l < 2; ++l) + { + f = (float)x + random.nextFloat(); + f1 = (float)y + random.nextFloat(); + f2 = (float)z + random.nextFloat() * 0.1F; + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.canCatchFire(worldIn, x, y, z + 1, NORTH)) + { + for (l = 0; l < 2; ++l) + { + f = (float)x + random.nextFloat(); + f1 = (float)y + random.nextFloat(); + f2 = (float)(z + 1) - random.nextFloat() * 0.1F; + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + + if (Blocks.fire.canCatchFire(worldIn, x, y + 1, z, DOWN)) + { + for (l = 0; l < 2; ++l) + { + f = (float)x + random.nextFloat(); + f1 = (float)(y + 1) - random.nextFloat() * 0.1F; + f2 = (float)z + random.nextFloat(); + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + } + else + { + for (l = 0; l < 3; ++l) + { + f = (float)x + random.nextFloat(); + f1 = (float)y + random.nextFloat() * 0.5F + 0.5F; + f2 = (float)z + random.nextFloat(); + worldIn.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + } + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149850_M = new IIcon[] {reg.registerIcon(this.getTextureName() + "_layer_0"), reg.registerIcon(this.getTextureName() + "_layer_1")}; + } + + @SideOnly(Side.CLIENT) + public IIcon getFireIcon(int p_149840_1_) + { + return this.field_149850_M[p_149840_1_]; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.field_149850_M[0]; + } + + public MapColor getMapColor(int meta) + { + return MapColor.tntColor; + } + + /*================================= Forge Start ======================================*/ + private static class FireInfo + { + private int encouragement = 0; + private int flammibility = 0; + } + private IdentityHashMap blockInfo = Maps.newIdentityHashMap(); + + public void setFireInfo(Block block, int encouragement, int flammibility) + { + if (block == Blocks.air) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); + int id = Block.getIdFromBlock(block); + this.field_149849_a[id] = encouragement; + this.field_149848_b[id] = flammibility; + + FireInfo info = getInfo(block, true); + info.encouragement = encouragement; + info.flammibility = flammibility; + } + + private FireInfo getInfo(Block block, boolean garentee) + { + FireInfo ret = blockInfo.get(block); + if (ret == null && garentee) + { + ret = new FireInfo(); + blockInfo.put(block, ret); + } + return ret; + } + + public void rebuildFireInfo() + { + for (int x = 0; x < 4096; x++) + { + //If we care.. we could detect changes in here and make sure we keep them, however + //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them. + field_149849_a[x] = 0; + field_149848_b[x] = 0; + } + + for (Entry e : blockInfo.entrySet()) + { + int id = Block.getIdFromBlock(e.getKey()); + if (id >= 0 && id < 4096) + { + field_149849_a[id] = e.getValue().encouragement; + field_149848_b[id] = e.getValue().flammibility; + } + } + } + + public int getFlammability(Block block) + { + int id = Block.getIdFromBlock(block); + return id >= 0 && id < 4096 ? field_149848_b[id] : 0; + } + + public int getEncouragement(Block block) + { + int id = Block.getIdFromBlock(block); + return id >= 0 && id < 4096 ? field_149849_a[id] : 0; + } + + /** + * Side sensitive version that calls the block function. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param face The side the fire is coming from + * @return True if the face can catch fire. + */ + public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) + { + return world.getBlock(x, y, z).isFlammable(world, x, y, z, face); + } + + /** + * Side sensitive version that calls the block function. + * + * @param world The current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @param oldChance The previous maximum chance. + * @param face The side the fire is coming from + * @return The chance of the block catching fire, or oldChance if it is higher + */ + public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) + { + int newChance = world.getBlock(x, y, z).getFireSpreadSpeed(world, x, y, z, face); + return (newChance > oldChance ? newChance : oldChance); + } + /*================================= Forge Start ======================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlower.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlower.java new file mode 100644 index 0000000..b175416 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlower.java @@ -0,0 +1,130 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockFlower extends BlockBush +{ + private static final String[][] field_149860_M = new String[][] {{"flower_dandelion"}, {"flower_rose", "flower_blue_orchid", "flower_allium", "flower_houstonia", "flower_tulip_red", "flower_tulip_orange", "flower_tulip_white", "flower_tulip_pink", "flower_oxeye_daisy"}}; + public static final String[] field_149859_a = new String[] {"poppy", "blueOrchid", "allium", "houstonia", "tulipRed", "tulipOrange", "tulipWhite", "tulipPink", "oxeyeDaisy"}; + public static final String[] field_149858_b = new String[] {"dandelion"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_149861_N; + private int field_149862_O; + private static final String __OBFID = "CL_00000246"; + + protected BlockFlower(int p_i2173_1_) + { + super(Material.plants); + this.field_149862_O = p_i2173_1_; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta >= this.field_149861_N.length) + { + meta = 0; + } + + return this.field_149861_N[meta]; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149861_N = new IIcon[field_149860_M[this.field_149862_O].length]; + + for (int i = 0; i < this.field_149861_N.length; ++i) + { + this.field_149861_N[i] = reg.registerIcon(field_149860_M[this.field_149862_O][i]); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < this.field_149861_N.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + public static BlockFlower func_149857_e(String p_149857_0_) + { + String[] astring = field_149858_b; + int i = astring.length; + int j; + String s1; + + for (j = 0; j < i; ++j) + { + s1 = astring[j]; + + if (s1.equals(p_149857_0_)) + { + return Blocks.yellow_flower; + } + } + + astring = field_149859_a; + i = astring.length; + + for (j = 0; j < i; ++j) + { + s1 = astring[j]; + + if (s1.equals(p_149857_0_)) + { + return Blocks.red_flower; + } + } + + return null; + } + + public static int func_149856_f(String p_149856_0_) + { + int i; + + for (i = 0; i < field_149858_b.length; ++i) + { + if (field_149858_b[i].equals(p_149856_0_)) + { + return i; + } + } + + for (i = 0; i < field_149859_a.length; ++i) + { + if (field_149859_a[i].equals(p_149856_0_)) + { + return i; + } + } + + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlowerPot.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlowerPot.java new file mode 100644 index 0000000..b391246 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFlowerPot.java @@ -0,0 +1,294 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.world.World; + +public class BlockFlowerPot extends BlockContainer +{ + private static final String __OBFID = "CL_00000247"; + + public BlockFlowerPot() + { + super(Material.circuits); + this.setBlockBoundsForItemRender(); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.375F; + float f1 = f / 2.0F; + this.setBlockBounds(0.5F - f1, 0.0F, 0.5F - f1, 0.5F + f1, f, 0.5F + f1); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 33; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() instanceof ItemBlock) + { + TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(worldIn, x, y, z); + + if (tileentityflowerpot != null) + { + if (tileentityflowerpot.getFlowerPotItem() != null) + { + return false; + } + else + { + Block block = Block.getBlockFromItem(itemstack.getItem()); + + if (!this.func_149928_a(block, itemstack.getItemDamage())) + { + return false; + } + else + { + tileentityflowerpot.func_145964_a(itemstack.getItem(), itemstack.getItemDamage()); + tileentityflowerpot.markDirty(); + + if (!worldIn.setBlockMetadataWithNotify(x, y, z, itemstack.getItemDamage(), 2)) + { + worldIn.markBlockForUpdate(x, y, z); + } + + if (!player.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + private boolean func_149928_a(Block p_149928_1_, int p_149928_2_) + { + return p_149928_1_ != Blocks.yellow_flower && p_149928_1_ != Blocks.red_flower && p_149928_1_ != Blocks.cactus && p_149928_1_ != Blocks.brown_mushroom && p_149928_1_ != Blocks.red_mushroom && p_149928_1_ != Blocks.sapling && p_149928_1_ != Blocks.deadbush ? p_149928_1_ == Blocks.tallgrass && p_149928_2_ == 2 : true; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(worldIn, x, y, z); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotItem() : Items.flower_pot; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(worldIn, x, y, z); + return tileentityflowerpot != null && tileentityflowerpot.getFlowerPotItem() != null ? tileentityflowerpot.getFlowerPotData() : 0; + } + + /** + * Returns true only if block is flowerPot + */ + @SideOnly(Side.CLIENT) + public boolean isFlowerPot() + { + return true; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return super.canPlaceBlockAt(worldIn, x, y, z) && World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + super.onBlockHarvested(worldIn, x, y, z, meta, player); + + if (player.capabilities.isCreativeMode) + { + TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(worldIn, x, y, z); + + if (tileentityflowerpot != null) + { + tileentityflowerpot.func_145964_a(Item.getItemById(0), 0); + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.flower_pot; + } + + private TileEntityFlowerPot func_149929_e(World p_149929_1_, int p_149929_2_, int p_149929_3_, int p_149929_4_) + { + TileEntity tileentity = p_149929_1_.getTileEntity(p_149929_2_, p_149929_3_, p_149929_4_); + return tileentity != null && tileentity instanceof TileEntityFlowerPot ? (TileEntityFlowerPot)tileentity : null; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + Object object = null; + byte b0 = 0; + + switch (meta) + { + case 1: + object = Blocks.red_flower; + b0 = 0; + break; + case 2: + object = Blocks.yellow_flower; + break; + case 3: + object = Blocks.sapling; + b0 = 0; + break; + case 4: + object = Blocks.sapling; + b0 = 1; + break; + case 5: + object = Blocks.sapling; + b0 = 2; + break; + case 6: + object = Blocks.sapling; + b0 = 3; + break; + case 7: + object = Blocks.red_mushroom; + break; + case 8: + object = Blocks.brown_mushroom; + break; + case 9: + object = Blocks.cactus; + break; + case 10: + object = Blocks.deadbush; + break; + case 11: + object = Blocks.tallgrass; + b0 = 2; + break; + case 12: + object = Blocks.sapling; + b0 = 4; + break; + case 13: + object = Blocks.sapling; + b0 = 5; + } + + return new TileEntityFlowerPot(Item.getItemFromBlock((Block)object), b0); + } + + /*============================FORGE START=====================================*/ + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); + TileEntityFlowerPot te = this.func_149929_e(world, x, y, z); + if (te != null && te.getFlowerPotItem() != null) + ret.add(new ItemStack(te.getFlowerPotItem(), 1, te.getFlowerPotData())); + return ret; + } + @Override + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) + { + if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops + return super.removedByPlayer(world, player, x, y, z, willHarvest); + } + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + @Override + public void harvestBlock(World world, EntityPlayer player, int x, int y, int z, int meta) + { + super.harvestBlock(world, player, x, y, z, meta); + world.setBlockToAir(x, y, z); + } + /*===========================FORGE END==========================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFurnace.java new file mode 100644 index 0000000..8cd40df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockFurnace.java @@ -0,0 +1,311 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockFurnace extends BlockContainer +{ + private final Random field_149933_a = new Random(); + private final boolean field_149932_b; + private static boolean field_149934_M; + @SideOnly(Side.CLIENT) + private IIcon field_149935_N; + @SideOnly(Side.CLIENT) + private IIcon field_149936_O; + private static final String __OBFID = "CL_00000248"; + + protected BlockFurnace(boolean p_i45407_1_) + { + super(Material.rock); + this.field_149932_b = p_i45407_1_; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.furnace); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + this.func_149930_e(worldIn, x, y, z); + } + + private void func_149930_e(World p_149930_1_, int p_149930_2_, int p_149930_3_, int p_149930_4_) + { + if (!p_149930_1_.isRemote) + { + Block block = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ - 1); + Block block1 = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ + 1); + Block block2 = p_149930_1_.getBlock(p_149930_2_ - 1, p_149930_3_, p_149930_4_); + Block block3 = p_149930_1_.getBlock(p_149930_2_ + 1, p_149930_3_, p_149930_4_); + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + p_149930_1_.setBlockMetadataWithNotify(p_149930_2_, p_149930_3_, p_149930_4_, b0, 2); + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149935_N : (side == 0 ? this.field_149935_N : (side != meta ? this.blockIcon : this.field_149936_O)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("furnace_side"); + this.field_149936_O = reg.registerIcon(this.field_149932_b ? "furnace_front_on" : "furnace_front_off"); + this.field_149935_N = reg.registerIcon("furnace_top"); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityFurnace tileentityfurnace = (TileEntityFurnace)worldIn.getTileEntity(x, y, z); + + if (tileentityfurnace != null) + { + player.func_146101_a(tileentityfurnace); + } + + return true; + } + } + + /** + * Update which block the furnace is using depending on whether or not it is burning + */ + public static void updateFurnaceBlockState(boolean p_149931_0_, World p_149931_1_, int p_149931_2_, int p_149931_3_, int p_149931_4_) + { + int l = p_149931_1_.getBlockMetadata(p_149931_2_, p_149931_3_, p_149931_4_); + TileEntity tileentity = p_149931_1_.getTileEntity(p_149931_2_, p_149931_3_, p_149931_4_); + field_149934_M = true; + + if (p_149931_0_) + { + p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.lit_furnace); + } + else + { + p_149931_1_.setBlock(p_149931_2_, p_149931_3_, p_149931_4_, Blocks.furnace); + } + + field_149934_M = false; + p_149931_1_.setBlockMetadataWithNotify(p_149931_2_, p_149931_3_, p_149931_4_, l, 2); + + if (tileentity != null) + { + tileentity.validate(); + p_149931_1_.setTileEntity(p_149931_2_, p_149931_3_, p_149931_4_, tileentity); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityFurnace(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (l == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 2, 2); + } + + if (l == 1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 5, 2); + } + + if (l == 2) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 3, 2); + } + + if (l == 3) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 4, 2); + } + + if (itemIn.hasDisplayName()) + { + ((TileEntityFurnace)worldIn.getTileEntity(x, y, z)).func_145951_a(itemIn.getDisplayName()); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if (!field_149934_M) + { + TileEntityFurnace tileentityfurnace = (TileEntityFurnace)worldIn.getTileEntity(x, y, z); + + if (tileentityfurnace != null) + { + for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149933_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.field_149933_a.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.field_149933_a.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.field_149933_a.nextGaussian() * f3); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + + worldIn.func_147453_f(x, y, z, blockBroken); + } + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (this.field_149932_b) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = (float)x + 0.5F; + float f1 = (float)y + 0.0F + random.nextFloat() * 6.0F / 16.0F; + float f2 = (float)z + 0.5F; + float f3 = 0.52F; + float f4 = random.nextFloat() * 0.6F - 0.3F; + + if (l == 4) + { + worldIn.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 5) + { + worldIn.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + worldIn.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + worldIn.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return Container.calcRedstoneFromInventory((IInventory)worldIn.getTileEntity(x, y, z)); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemFromBlock(Blocks.furnace); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlass.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlass.java new file mode 100644 index 0000000..252022c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlass.java @@ -0,0 +1,51 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockGlass extends BlockBreakable +{ + private static final String __OBFID = "CL_00000249"; + + public BlockGlass(Material p_i45408_1_, boolean p_i45408_2_) + { + super("glass", p_i45408_1_, p_i45408_2_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 0; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlowstone.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlowstone.java new file mode 100644 index 0000000..23ae28e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGlowstone.java @@ -0,0 +1,46 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; + +public class BlockGlowstone extends Block +{ + private static final String __OBFID = "CL_00000250"; + + public BlockGlowstone(Material p_i45409_1_) + { + super(p_i45409_1_); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + return MathHelper.clamp_int(this.quantityDropped(random) + random.nextInt(maxBonus + 1), 1, 4); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 2 + random.nextInt(3); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.glowstone_dust; + } + + public MapColor getMapColor(int meta) + { + return MapColor.sandColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockGrass.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGrass.java new file mode 100644 index 0000000..22ec0b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGrass.java @@ -0,0 +1,209 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class BlockGrass extends Block implements IGrowable +{ + private static final Logger logger = LogManager.getLogger(); + @SideOnly(Side.CLIENT) + private IIcon field_149991_b; + @SideOnly(Side.CLIENT) + private IIcon field_149993_M; + @SideOnly(Side.CLIENT) + private IIcon field_149994_N; + private static final String __OBFID = "CL_00000251"; + + protected BlockGrass() + { + super(Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149991_b : (side == 0 ? Blocks.dirt.getBlockTextureFromSide(side) : this.blockIcon); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2) + { + worldIn.setBlock(x, y, z, Blocks.dirt); + } + else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) + { + for (int l = 0; l < 4; ++l) + { + int i1 = x + random.nextInt(3) - 1; + int j1 = y + random.nextInt(5) - 3; + int k1 = z + random.nextInt(3) - 1; + Block block = worldIn.getBlock(i1, j1 + 1, k1); + + if (worldIn.getBlock(i1, j1, k1) == Blocks.dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) + { + worldIn.setBlock(i1, j1, k1, Blocks.grass); + } + } + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Blocks.dirt.getItemDropped(0, random, fortune); + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + return true; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (side == 1) + { + return this.field_149991_b; + } + else if (side == 0) + { + return Blocks.dirt.getBlockTextureFromSide(side); + } + else + { + Material material = worldIn.getBlock(x, y + 1, z).getMaterial(); + return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.field_149993_M; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_149991_b = reg.registerIcon(this.getTextureName() + "_top"); + this.field_149993_M = reg.registerIcon(this.getTextureName() + "_side_snowed"); + this.field_149994_N = reg.registerIcon(this.getTextureName() + "_side_overlay"); + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + double d0 = 0.5D; + double d1 = 1.0D; + return ColorizerGrass.getGrassColor(d0, d1); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return this.getBlockColor(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = -1; k1 <= 1; ++k1) + { + for (int l1 = -1; l1 <= 1; ++l1) + { + int i2 = worldIn.getBiomeGenForCoords(x + l1, z + k1).getBiomeGrassColor(x + l1, y, z + k1); + l += (i2 & 16711680) >> 16; + i1 += (i2 & 65280) >> 8; + j1 += i2 & 255; + } + } + + return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; + } + + @SideOnly(Side.CLIENT) + public static IIcon getIconSideOverlay() + { + return Blocks.grass.field_149994_N; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + int l = 0; + + while (l < 128) + { + int i1 = x; + int j1 = y + 1; + int k1 = z; + int l1 = 0; + + while (true) + { + if (l1 < l / 16) + { + i1 += random.nextInt(3) - 1; + j1 += (random.nextInt(3) - 1) * random.nextInt(3) / 2; + k1 += random.nextInt(3) - 1; + + if (worldIn.getBlock(i1, j1 - 1, k1) == Blocks.grass && !worldIn.getBlock(i1, j1, k1).isNormalCube()) + { + ++l1; + continue; + } + } + else if (worldIn.getBlock(i1, j1, k1).blockMaterial == Material.air) + { + if (random.nextInt(8) != 0) + { + if (Blocks.tallgrass.canBlockStay(worldIn, i1, j1, k1)) + { + worldIn.setBlock(i1, j1, k1, Blocks.tallgrass, 1, 3); + } + } + else + { + worldIn.getBiomeGenForCoords(i1, k1).plantFlower(worldIn, random, i1, j1, k1); + } + } + + ++l; + break; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockGravel.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGravel.java new file mode 100644 index 0000000..8654b32 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockGravel.java @@ -0,0 +1,20 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +public class BlockGravel extends BlockFalling +{ + private static final String __OBFID = "CL_00000252"; + + public Item getItemDropped(int meta, Random random, int fortune) + { + if (fortune > 3) + { + fortune = 3; + } + + return random.nextInt(10 - fortune * 3) == 0 ? Items.flint : Item.getItemFromBlock(this); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockHardenedClay.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHardenedClay.java new file mode 100644 index 0000000..6bc2594 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHardenedClay.java @@ -0,0 +1,21 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockHardenedClay extends Block +{ + private static final String __OBFID = "CL_00000255"; + + public BlockHardenedClay() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int meta) + { + return MapColor.adobeColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockHay.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHay.java new file mode 100644 index 0000000..f0f54d5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHay.java @@ -0,0 +1,32 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; + +public class BlockHay extends BlockRotatedPillar +{ + private static final String __OBFID = "CL_00000256"; + + public BlockHay() + { + super(Material.grass); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + @SideOnly(Side.CLIENT) + protected IIcon getSideIcon(int p_150163_1_) + { + return this.blockIcon; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150164_N = reg.registerIcon(this.getTextureName() + "_top"); + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockHopper.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHopper.java new file mode 100644 index 0000000..33925a2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHopper.java @@ -0,0 +1,309 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockHopper extends BlockContainer +{ + private final Random field_149922_a = new Random(); + @SideOnly(Side.CLIENT) + private IIcon field_149921_b; + @SideOnly(Side.CLIENT) + private IIcon field_149923_M; + @SideOnly(Side.CLIENT) + private IIcon field_149924_N; + private static final String __OBFID = "CL_00000257"; + + public BlockHopper() + { + super(Material.iron); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = Facing.oppositeSide[side]; + + if (j1 == 1) + { + j1 = 0; + } + + return j1; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityHopper(); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + super.onBlockPlacedBy(worldIn, x, y, z, placer, itemIn); + + if (itemIn.hasDisplayName()) + { + TileEntityHopper tileentityhopper = func_149920_e(worldIn, x, y, z); + tileentityhopper.func_145886_a(itemIn.getDisplayName()); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + this.func_149919_e(worldIn, x, y, z); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityHopper tileentityhopper = func_149920_e(worldIn, x, y, z); + + if (tileentityhopper != null) + { + player.func_146093_a(tileentityhopper); + } + + return true; + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_149919_e(worldIn, x, y, z); + } + + private void func_149919_e(World p_149919_1_, int p_149919_2_, int p_149919_3_, int p_149919_4_) + { + int l = p_149919_1_.getBlockMetadata(p_149919_2_, p_149919_3_, p_149919_4_); + int i1 = getDirectionFromMetadata(l); + boolean flag = !p_149919_1_.isBlockIndirectlyGettingPowered(p_149919_2_, p_149919_3_, p_149919_4_); + boolean flag1 = func_149917_c(l); + + if (flag != flag1) + { + p_149919_1_.setBlockMetadataWithNotify(p_149919_2_, p_149919_3_, p_149919_4_, i1 | (flag ? 0 : 8), 4); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + TileEntityHopper tileentityhopper = (TileEntityHopper)worldIn.getTileEntity(x, y, z); + + if (tileentityhopper != null) + { + for (int i1 = 0; i1 < tileentityhopper.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityhopper.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149922_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149922_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.field_149922_a.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.field_149922_a.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.field_149922_a.nextGaussian() * f3); + worldIn.spawnEntityInWorld(entityitem); + } + } + } + + worldIn.func_147453_f(x, y, z, blockBroken); + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 38; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return true; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149923_M : this.field_149921_b; + } + + public static int getDirectionFromMetadata(int p_149918_0_) + { + return p_149918_0_ & 7; + } + + public static boolean func_149917_c(int p_149917_0_) + { + return (p_149917_0_ & 8) != 8; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + return Container.calcRedstoneFromInventory(func_149920_e(worldIn, x, y, z)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149921_b = reg.registerIcon("hopper_outside"); + this.field_149923_M = reg.registerIcon("hopper_top"); + this.field_149924_N = reg.registerIcon("hopper_inside"); + } + + @SideOnly(Side.CLIENT) + public static IIcon getHopperIcon(String p_149916_0_) + { + return p_149916_0_.equals("hopper_outside") ? Blocks.hopper.field_149921_b : (p_149916_0_.equals("hopper_inside") ? Blocks.hopper.field_149924_N : null); + } + + public static TileEntityHopper func_149920_e(IBlockAccess p_149920_0_, int p_149920_1_, int p_149920_2_, int p_149920_3_) + { + return (TileEntityHopper)p_149920_0_.getTileEntity(p_149920_1_, p_149920_2_, p_149920_3_); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return "hopper"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockHugeMushroom.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHugeMushroom.java new file mode 100644 index 0000000..ed53643 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockHugeMushroom.java @@ -0,0 +1,82 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockHugeMushroom extends Block +{ + private static final String[] field_149793_a = new String[] {"skin_brown", "skin_red"}; + private final int field_149792_b; + @SideOnly(Side.CLIENT) + private IIcon[] field_149794_M; + @SideOnly(Side.CLIENT) + private IIcon field_149795_N; + @SideOnly(Side.CLIENT) + private IIcon field_149796_O; + private static final String __OBFID = "CL_00000258"; + + public BlockHugeMushroom(Material p_i45412_1_, int p_i45412_2_) + { + super(p_i45412_1_); + this.field_149792_b = p_i45412_2_; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return meta == 10 && side > 1 ? this.field_149795_N : (meta >= 1 && meta <= 9 && side == 1 ? this.field_149794_M[this.field_149792_b] : (meta >= 1 && meta <= 3 && side == 2 ? this.field_149794_M[this.field_149792_b] : (meta >= 7 && meta <= 9 && side == 3 ? this.field_149794_M[this.field_149792_b] : ((meta == 1 || meta == 4 || meta == 7) && side == 4 ? this.field_149794_M[this.field_149792_b] : ((meta == 3 || meta == 6 || meta == 9) && side == 5 ? this.field_149794_M[this.field_149792_b] : (meta == 14 ? this.field_149794_M[this.field_149792_b] : (meta == 15 ? this.field_149795_N : this.field_149796_O))))))); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + int i = random.nextInt(10) - 7; + + if (i < 0) + { + i = 0; + } + + return i; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemById(Block.getIdFromBlock(Blocks.brown_mushroom) + this.field_149792_b); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(Block.getIdFromBlock(Blocks.brown_mushroom) + this.field_149792_b); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149794_M = new IIcon[field_149793_a.length]; + + for (int i = 0; i < this.field_149794_M.length; ++i) + { + this.field_149794_M[i] = reg.registerIcon(this.getTextureName() + "_" + field_149793_a[i]); + } + + this.field_149796_O = reg.registerIcon(this.getTextureName() + "_" + "inside"); + this.field_149795_N = reg.registerIcon(this.getTextureName() + "_" + "skin_stem"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockIce.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockIce.java new file mode 100644 index 0000000..aa59b3f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockIce.java @@ -0,0 +1,125 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.event.ForgeEventFactory; + +public class BlockIce extends BlockBreakable +{ + private static final String __OBFID = "CL_00000259"; + + public BlockIce() + { + super("ice", Material.ice, false); + this.slipperiness = 0.98F; + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return super.shouldSideBeRendered(worldIn, x, y, z, 1 - side); + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); + player.addExhaustion(0.025F); + + if (this.canSilkHarvest(worldIn, player, x, y, z, meta) && EnchantmentHelper.getSilkTouchModifier(player)) + { + ArrayList items = new ArrayList(); + ItemStack itemstack = this.createStackedBlock(meta); + + if (itemstack != null) items.add(itemstack); + + ForgeEventFactory.fireBlockHarvesting(items, worldIn, this, x, y, z, meta, 0, 1.0f, true, player); + for (ItemStack is : items) + this.dropBlockAsItem(worldIn, x, y, z, is); + } + else + { + if (worldIn.provider.isHellWorld) + { + worldIn.setBlockToAir(x, y, z); + return; + } + + int i1 = EnchantmentHelper.getFortuneModifier(player); + harvesters.set(player); + this.dropBlockAsItem(worldIn, x, y, z, meta, i1); + harvesters.set(null); + Material material = worldIn.getBlock(x, y - 1, z).getMaterial(); + + if (material.blocksMovement() || material.isLiquid()) + { + worldIn.setBlock(x, y, z, Blocks.flowing_water); + } + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.getSavedLightValue(EnumSkyBlock.Block, x, y, z) > 11 - this.getLightOpacity()) + { + if (worldIn.provider.isHellWorld) + { + worldIn.setBlockToAir(x, y, z); + return; + } + + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlock(x, y, z, Blocks.water); + } + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockJukebox.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockJukebox.java new file mode 100644 index 0000000..0653949 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockJukebox.java @@ -0,0 +1,190 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockJukebox extends BlockContainer +{ + @SideOnly(Side.CLIENT) + private IIcon field_149927_a; + private static final String __OBFID = "CL_00000260"; + + protected BlockJukebox() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149927_a : this.blockIcon; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.getBlockMetadata(x, y, z) == 0) + { + return false; + } + else + { + this.func_149925_e(worldIn, x, y, z); + return true; + } + } + + public void func_149926_b(World p_149926_1_, int p_149926_2_, int p_149926_3_, int p_149926_4_, ItemStack p_149926_5_) + { + if (!p_149926_1_.isRemote) + { + BlockJukebox.TileEntityJukebox tileentityjukebox = (BlockJukebox.TileEntityJukebox)p_149926_1_.getTileEntity(p_149926_2_, p_149926_3_, p_149926_4_); + + if (tileentityjukebox != null) + { + tileentityjukebox.func_145857_a(p_149926_5_.copy()); + p_149926_1_.setBlockMetadataWithNotify(p_149926_2_, p_149926_3_, p_149926_4_, 1, 2); + } + } + } + + public void func_149925_e(World p_149925_1_, int p_149925_2_, int p_149925_3_, int p_149925_4_) + { + if (!p_149925_1_.isRemote) + { + BlockJukebox.TileEntityJukebox tileentityjukebox = (BlockJukebox.TileEntityJukebox)p_149925_1_.getTileEntity(p_149925_2_, p_149925_3_, p_149925_4_); + + if (tileentityjukebox != null) + { + ItemStack itemstack = tileentityjukebox.func_145856_a(); + + if (itemstack != null) + { + p_149925_1_.playAuxSFX(1005, p_149925_2_, p_149925_3_, p_149925_4_, 0); + p_149925_1_.playRecord((String)null, p_149925_2_, p_149925_3_, p_149925_4_); + tileentityjukebox.func_145857_a((ItemStack)null); + p_149925_1_.setBlockMetadataWithNotify(p_149925_2_, p_149925_3_, p_149925_4_, 0, 2); + float f = 0.7F; + double d0 = (double)(p_149925_1_.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(p_149925_1_.rand.nextFloat() * f) + (double)(1.0F - f) * 0.2D + 0.6D; + double d2 = (double)(p_149925_1_.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + ItemStack itemstack1 = itemstack.copy(); + EntityItem entityitem = new EntityItem(p_149925_1_, (double)p_149925_2_ + d0, (double)p_149925_3_ + d1, (double)p_149925_4_ + d2, itemstack1); + entityitem.delayBeforeCanPickup = 10; + p_149925_1_.spawnEntityInWorld(entityitem); + } + } + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + this.func_149925_e(worldIn, x, y, z); + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + if (!worldIn.isRemote) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, 0); + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new BlockJukebox.TileEntityJukebox(); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_149927_a = reg.registerIcon(this.getTextureName() + "_top"); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + ItemStack itemstack = ((BlockJukebox.TileEntityJukebox)worldIn.getTileEntity(x, y, z)).func_145856_a(); + return itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem()) + 1 - Item.getIdFromItem(Items.record_13); + } + + public static class TileEntityJukebox extends TileEntity + { + private ItemStack field_145858_a; + private static final String __OBFID = "CL_00000261"; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + if (compound.hasKey("RecordItem", 10)) + { + this.func_145857_a(ItemStack.loadItemStackFromNBT(compound.getCompoundTag("RecordItem"))); + } + else if (compound.getInteger("Record") > 0) + { + this.func_145857_a(new ItemStack(Item.getItemById(compound.getInteger("Record")), 1, 0)); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + if (this.func_145856_a() != null) + { + compound.setTag("RecordItem", this.func_145856_a().writeToNBT(new NBTTagCompound())); + compound.setInteger("Record", Item.getIdFromItem(this.func_145856_a().getItem())); + } + } + + public ItemStack func_145856_a() + { + return this.field_145858_a; + } + + public void func_145857_a(ItemStack p_145857_1_) + { + this.field_145858_a = p_145857_1_; + this.markDirty(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLadder.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLadder.java new file mode 100644 index 0000000..9361723 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLadder.java @@ -0,0 +1,196 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockLadder extends Block +{ + private static final String __OBFID = "CL_00000262"; + + protected BlockLadder() + { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_149797_b(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + public void func_149797_b(int p_149797_1_) + { + float f = 0.125F; + + if (p_149797_1_ == 2) + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + + if (p_149797_1_ == 3) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + + if (p_149797_1_ == 4) + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if (p_149797_1_ == 5) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 8; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.isSideSolid(x - 1, y, z, EAST ) || + worldIn.isSideSolid(x + 1, y, z, WEST ) || + worldIn.isSideSolid(x, y, z - 1, SOUTH) || + worldIn.isSideSolid(x, y, z + 1, NORTH); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = meta; + + if ((meta == 0 || side == 2) && worldIn.isSideSolid(x, y, z + 1, NORTH)) + { + j1 = 2; + } + + if ((j1 == 0 || side == 3) && worldIn.isSideSolid(x, y, z - 1, SOUTH)) + { + j1 = 3; + } + + if ((j1 == 0 || side == 4) && worldIn.isSideSolid(x + 1, y, z, WEST)) + { + j1 = 4; + } + + if ((j1 == 0 || side == 5) && worldIn.isSideSolid(x - 1, y, z, EAST)) + { + j1 = 5; + } + + return j1; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag = false; + + if (l == 2 && worldIn.isSideSolid(x, y, z + 1, NORTH)) + { + flag = true; + } + + if (l == 3 && worldIn.isSideSolid(x, y, z - 1, SOUTH)) + { + flag = true; + } + + if (l == 4 && worldIn.isSideSolid(x + 1, y, z, WEST)) + { + flag = true; + } + + if (l == 5 && worldIn.isSideSolid(x - 1, y, z, EAST)) + { + flag = true; + } + + if (!flag) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + worldIn.setBlockToAir(x, y, z); + } + + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + @Override + public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeaves.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeaves.java new file mode 100644 index 0000000..5719490 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeaves.java @@ -0,0 +1,387 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public abstract class BlockLeaves extends BlockLeavesBase implements IShearable +{ + int[] field_150128_a; + @SideOnly(Side.CLIENT) + protected int field_150127_b; + protected IIcon[][] field_150129_M = new IIcon[2][]; + private static final String __OBFID = "CL_00000263"; + + public BlockLeaves() + { + super(Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setHardness(0.2F); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + double d0 = 0.5D; + double d1 = 1.0D; + return ColorizerFoliage.getFoliageColor(d0, d1); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = -1; k1 <= 1; ++k1) + { + for (int l1 = -1; l1 <= 1; ++l1) + { + int i2 = worldIn.getBiomeGenForCoords(x + l1, z + k1).getBiomeFoliageColor(x + l1, y, z + k1); + l += (i2 & 16711680) >> 16; + i1 += (i2 & 65280) >> 8; + j1 += i2 & 255; + } + } + + return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + byte b0 = 1; + int i1 = b0 + 1; + + if (worldIn.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1)) + { + for (int j1 = -b0; j1 <= b0; ++j1) + { + for (int k1 = -b0; k1 <= b0; ++k1) + { + for (int l1 = -b0; l1 <= b0; ++l1) + { + Block block = worldIn.getBlock(x + j1, y + k1, z + l1); + if (block.isLeaves(worldIn, x + j1, y + k1, z + l1)) + { + block.beginLeavesDecay(worldIn, x + j1, y + k1, z + l1); + } + } + } + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if ((l & 8) != 0 && (l & 4) == 0) + { + byte b0 = 4; + int i1 = b0 + 1; + byte b1 = 32; + int j1 = b1 * b1; + int k1 = b1 / 2; + + if (this.field_150128_a == null) + { + this.field_150128_a = new int[b1 * b1 * b1]; + } + + int l1; + + if (worldIn.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1)) + { + int i2; + int j2; + + for (l1 = -b0; l1 <= b0; ++l1) + { + for (i2 = -b0; i2 <= b0; ++i2) + { + for (j2 = -b0; j2 <= b0; ++j2) + { + Block block = worldIn.getBlock(x + l1, y + i2, z + j2); + + if (!block.canSustainLeaves(worldIn, x + l1, y + i2, z + j2)) + { + if (block.isLeaves(worldIn, x + l1, y + i2, z + j2)) + { + this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; + } + else + { + this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -1; + } + } + else + { + this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = 0; + } + } + } + } + + for (l1 = 1; l1 <= 4; ++l1) + { + for (i2 = -b0; i2 <= b0; ++i2) + { + for (j2 = -b0; j2 <= b0; ++j2) + { + for (int k2 = -b0; k2 <= b0; ++k2) + { + if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1] == l1 - 1) + { + if (this.field_150128_a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) + { + this.field_150128_a[(i2 + k1 - 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; + } + + if (this.field_150128_a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] == -2) + { + this.field_150128_a[(i2 + k1 + 1) * j1 + (j2 + k1) * b1 + k2 + k1] = l1; + } + + if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] == -2) + { + this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 - 1) * b1 + k2 + k1] = l1; + } + + if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] == -2) + { + this.field_150128_a[(i2 + k1) * j1 + (j2 + k1 + 1) * b1 + k2 + k1] = l1; + } + + if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] == -2) + { + this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + (k2 + k1 - 1)] = l1; + } + + if (this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] == -2) + { + this.field_150128_a[(i2 + k1) * j1 + (j2 + k1) * b1 + k2 + k1 + 1] = l1; + } + } + } + } + } + } + } + + l1 = this.field_150128_a[k1 * j1 + k1 * b1 + k1]; + + if (l1 >= 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, l & -9, 4); + } + else + { + this.removeLeaves(worldIn, x, y, z); + } + } + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.canLightningStrikeAt(x, y + 1, z) && !World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && random.nextInt(15) == 1) + { + double d0 = (double)((float)x + random.nextFloat()); + double d1 = (double)y - 0.05D; + double d2 = (double)((float)z + random.nextFloat()); + worldIn.spawnParticle("dripWater", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + } + + private void removeLeaves(World p_150126_1_, int p_150126_2_, int p_150126_3_, int p_150126_4_) + { + this.dropBlockAsItem(p_150126_1_, p_150126_2_, p_150126_3_, p_150126_4_, p_150126_1_.getBlockMetadata(p_150126_2_, p_150126_3_, p_150126_4_), 0); + p_150126_1_.setBlockToAir(p_150126_2_, p_150126_3_, p_150126_4_); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return random.nextInt(20) == 0 ? 1 : 0; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.sapling); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, 1.0f, fortune); + } + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {} + + protected int func_150123_b(int p_150123_1_) + { + return 20; + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + { + super.harvestBlock(worldIn, player, x, y, z, meta); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta & 3; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return !this.field_150121_P; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public abstract IIcon getIcon(int side, int meta); + + /** + * Pass true to draw this block using fancy graphics, or false for fast graphics. + */ + @SideOnly(Side.CLIENT) + public void setGraphicsLevel(boolean p_150122_1_) + { + this.field_150121_P = p_150122_1_; + this.field_150127_b = p_150122_1_ ? 0 : 1; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Item.getItemFromBlock(this), 1, meta & 3); + } + + public abstract String[] func_150125_e(); + + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); + return ret; + } + + @Override + public void beginLeavesDecay(World world, int x, int y, int z) + { + + int i2 = world.getBlockMetadata(x, y, z); + + if ((i2 & 8) == 0) + { + world.setBlockMetadataWithNotify(x, y, z, i2 | 8, 4); + } + world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 4); + } + + @Override + public boolean isLeaves(IBlockAccess world, int x, int y, int z) + { + return true; + } + + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + int chance = this.func_150123_b(metadata); + + if (fortune > 0) + { + chance -= 2 << fortune; + if (chance < 10) chance = 10; + } + + if (world.rand.nextInt(chance) == 0) + ret.add(new ItemStack(this.getItemDropped(metadata, world.rand, fortune), 1, this.damageDropped(metadata))); + + chance = 200; + if (fortune > 0) + { + chance -= 10 << fortune; + if (chance < 40) chance = 40; + } + + this.captureDrops(true); + this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang + ret.addAll(this.captureDrops(false)); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeavesBase.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeavesBase.java new file mode 100644 index 0000000..1a65342 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLeavesBase.java @@ -0,0 +1,38 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.world.IBlockAccess; + +public class BlockLeavesBase extends Block +{ + protected boolean field_150121_P; + private static final String __OBFID = "CL_00000326"; + + protected BlockLeavesBase(Material p_i45433_1_, boolean p_i45433_2_) + { + super(p_i45433_1_); + this.field_150121_P = p_i45433_2_; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + Block block = worldIn.getBlock(x, y, z); + return !this.field_150121_P && block == this ? false : super.shouldSideBeRendered(worldIn, x, y, z, side); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLever.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLever.java new file mode 100644 index 0000000..e17d084 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLever.java @@ -0,0 +1,411 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockLever extends Block +{ + private static final String __OBFID = "CL_00000264"; + + protected BlockLever() + { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 12; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + ForgeDirection dir = ForgeDirection.getOrientation(side); + return (dir == DOWN && worldIn.isSideSolid(x, y + 1, z, DOWN )) || + (dir == UP && worldIn.isSideSolid(x, y - 1, z, UP )) || + (dir == NORTH && worldIn.isSideSolid(x, y, z + 1, NORTH)) || + (dir == SOUTH && worldIn.isSideSolid(x, y, z - 1, SOUTH)) || + (dir == WEST && worldIn.isSideSolid(x + 1, y, z, WEST )) || + (dir == EAST && worldIn.isSideSolid(x - 1, y, z, EAST )); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.isSideSolid(x - 1, y, z, EAST ) || + worldIn.isSideSolid(x + 1, y, z, WEST ) || + worldIn.isSideSolid(x, y, z - 1, SOUTH) || + worldIn.isSideSolid(x, y, z + 1, NORTH) || + worldIn.isSideSolid(x, y - 1, z, UP ) || + worldIn.isSideSolid(x, y + 1, z, DOWN ); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int k1 = meta & 8; + int j1 = meta & 7; + byte b0 = -1; + + if (side == 0 && worldIn.isSideSolid(x, y + 1, z, DOWN)) + { + b0 = 0; + } + + if (side == 1 && worldIn.isSideSolid(x, y - 1, z, UP)) + { + b0 = 5; + } + + if (side == 2 && worldIn.isSideSolid(x, y, z + 1, NORTH)) + { + b0 = 4; + } + + if (side == 3 && worldIn.isSideSolid(x, y, z - 1, SOUTH)) + { + b0 = 3; + } + + if (side == 4 && worldIn.isSideSolid(x + 1, y, z, WEST)) + { + b0 = 2; + } + + if (side == 5 && worldIn.isSideSolid(x - 1, y, z, EAST)) + { + b0 = 1; + } + + return b0 + k1; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = l & 7; + int j1 = l & 8; + + if (i1 == invertMetadata(1)) + { + if ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 5 | j1, 2); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, 6 | j1, 2); + } + } + else if (i1 == invertMetadata(0)) + { + if ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 7 | j1, 2); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, 0 | j1, 2); + } + } + } + + public static int invertMetadata(int p_149819_0_) + { + switch (p_149819_0_) + { + case 0: + return 0; + case 1: + return 5; + case 2: + return 4; + case 3: + return 3; + case 4: + return 2; + case 5: + return 1; + default: + return -1; + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (this.func_149820_e(worldIn, x, y, z)) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + boolean flag = false; + + if (!worldIn.isSideSolid(x - 1, y, z, EAST) && l == 1) + { + flag = true; + } + + if (!worldIn.isSideSolid(x + 1, y, z, WEST) && l == 2) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z - 1, SOUTH) && l == 3) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z + 1, NORTH) && l == 4) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y - 1, z, UP) && l == 5) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y - 1, z, UP) && l == 6) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y + 1, z, DOWN) && l == 0) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y + 1, z, DOWN) && l == 7) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } + } + + private boolean func_149820_e(World p_149820_1_, int p_149820_2_, int p_149820_3_, int p_149820_4_) + { + if (!this.canPlaceBlockAt(p_149820_1_, p_149820_2_, p_149820_3_, p_149820_4_)) + { + this.dropBlockAsItem(p_149820_1_, p_149820_2_, p_149820_3_, p_149820_4_, p_149820_1_.getBlockMetadata(p_149820_2_, p_149820_3_, p_149820_4_), 0); + p_149820_1_.setBlockToAir(p_149820_2_, p_149820_3_, p_149820_4_); + return false; + } + else + { + return true; + } + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + float f = 0.1875F; + + if (l == 1) + { + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + } + else if (l == 2) + { + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + } + else if (l == 3) + { + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + } + else if (l == 4) + { + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + else if (l != 5 && l != 6) + { + if (l == 0 || l == 7) + { + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.4F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + } + } + else + { + f = 0.25F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + int j1 = i1 & 7; + int k1 = 8 - (i1 & 8); + worldIn.setBlockMetadataWithNotify(x, y, z, j1 + k1, 3); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, k1 > 0 ? 0.6F : 0.5F); + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + + if (j1 == 1) + { + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + } + else if (j1 == 2) + { + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + } + else if (j1 == 3) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + } + else if (j1 == 4) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + else if (j1 != 5 && j1 != 6) + { + if (j1 == 0 || j1 == 7) + { + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + } + } + else + { + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + } + + return true; + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if ((meta & 8) > 0) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + int i1 = meta & 7; + + if (i1 == 1) + { + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + } + else if (i1 == 2) + { + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + } + else if (i1 == 3) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + } + else if (i1 == 4) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + else if (i1 != 5 && i1 != 6) + { + if (i1 == 0 || i1 == 7) + { + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + } + } + else + { + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + } + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return (worldIn.getBlockMetadata(x, y, z) & 8) > 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if ((i1 & 8) == 0) + { + return 0; + } + else + { + int j1 = i1 & 7; + return j1 == 0 && side == 0 ? 15 : (j1 == 7 && side == 0 ? 15 : (j1 == 6 && side == 1 ? 15 : (j1 == 5 && side == 1 ? 15 : (j1 == 4 && side == 2 ? 15 : (j1 == 3 && side == 3 ? 15 : (j1 == 2 && side == 4 ? 15 : (j1 == 1 && side == 5 ? 15 : 0))))))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLilyPad.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLilyPad.java new file mode 100644 index 0000000..57cd49c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLilyPad.java @@ -0,0 +1,96 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockLilyPad extends BlockBush +{ + private static final String __OBFID = "CL_00000332"; + + protected BlockLilyPad() + { + float f = 0.5F; + float f1 = 0.015625F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 23; + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + if (collider == null || !(collider instanceof EntityBoat)) + { + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)y + this.maxY, (double)z + this.maxZ); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.water; + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return 2129968; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return 2129968; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return 2129968; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return y >= 0 && y < 256 ? worldIn.getBlock(x, y - 1, z).getMaterial() == Material.water && worldIn.getBlockMetadata(x, y - 1, z) == 0 : false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLiquid.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLiquid.java new file mode 100644 index 0000000..f68f21d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLiquid.java @@ -0,0 +1,623 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockLiquid extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149806_a; + private static final String __OBFID = "CL_00000265"; + + protected BlockLiquid(Material p_i45413_1_) + { + super(p_i45413_1_); + float f = 0.0F; + float f1 = 0.0F; + this.setBlockBounds(0.0F + f1, 0.0F + f, 0.0F + f1, 1.0F + f1, 1.0F + f, 1.0F + f1); + this.setTickRandomly(true); + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return this.blockMaterial != Material.lava; + } + + /** + * Returns the percentage of the liquid block that is air, based on the given flow decay of the liquid + */ + public static float getLiquidHeightPercent(int p_149801_0_) + { + if (p_149801_0_ >= 8) + { + p_149801_0_ = 0; + } + + return (float)(p_149801_0_ + 1) / 9.0F; + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return 16777215; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + if (this.blockMaterial != Material.water) + { + return 16777215; + } + else + { + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = -1; k1 <= 1; ++k1) + { + for (int l1 = -1; l1 <= 1; ++l1) + { + int i2 = worldIn.getBiomeGenForCoords(x + l1, z + k1).getWaterColorMultiplier(); + l += (i2 & 16711680) >> 16; + i1 += (i2 & 65280) >> 8; + j1 += i2 & 255; + } + } + + return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side != 0 && side != 1 ? this.field_149806_a[1] : this.field_149806_a[0]; + } + + protected int func_149804_e(World p_149804_1_, int p_149804_2_, int p_149804_3_, int p_149804_4_) + { + return p_149804_1_.getBlock(p_149804_2_, p_149804_3_, p_149804_4_).getMaterial() == this.blockMaterial ? p_149804_1_.getBlockMetadata(p_149804_2_, p_149804_3_, p_149804_4_) : -1; + } + + /** + * Returns the flow decay but converts values indicating falling liquid (values >=8) to their effective source block + * value of zero + */ + protected int getEffectiveFlowDecay(IBlockAccess p_149798_1_, int p_149798_2_, int p_149798_3_, int p_149798_4_) + { + if (p_149798_1_.getBlock(p_149798_2_, p_149798_3_, p_149798_4_).getMaterial() != this.blockMaterial) + { + return -1; + } + else + { + int l = p_149798_1_.getBlockMetadata(p_149798_2_, p_149798_3_, p_149798_4_); + + if (l >= 8) + { + l = 0; + } + + return l; + } + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int meta, boolean includeLiquid) + { + return includeLiquid && meta == 0; + } + + /** + * Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent + * block is at the given coordinates. Args: blockAccess, x, y, z, side + */ + public boolean isBlockSolid(IBlockAccess worldIn, int x, int y, int z, int side) + { + Material material = worldIn.getBlock(x, y, z).getMaterial(); + return material == this.blockMaterial ? false : (side == 1 ? true : (material == Material.ice ? false : super.isBlockSolid(worldIn, x, y, z, side))); + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + Material material = worldIn.getBlock(x, y, z).getMaterial(); + return material == this.blockMaterial ? false : (side == 1 ? true : super.shouldSideBeRendered(worldIn, x, y, z, side)); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 4; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Returns a vector indicating the direction and intensity of liquid flow + */ + private Vec3 getFlowVector(IBlockAccess p_149800_1_, int p_149800_2_, int p_149800_3_, int p_149800_4_) + { + Vec3 vec3 = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + int l = this.getEffectiveFlowDecay(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_); + + for (int i1 = 0; i1 < 4; ++i1) + { + int j1 = p_149800_2_; + int k1 = p_149800_4_; + + if (i1 == 0) + { + j1 = p_149800_2_ - 1; + } + + if (i1 == 1) + { + k1 = p_149800_4_ - 1; + } + + if (i1 == 2) + { + ++j1; + } + + if (i1 == 3) + { + ++k1; + } + + int l1 = this.getEffectiveFlowDecay(p_149800_1_, j1, p_149800_3_, k1); + int i2; + + if (l1 < 0) + { + if (!p_149800_1_.getBlock(j1, p_149800_3_, k1).getMaterial().blocksMovement()) + { + l1 = this.getEffectiveFlowDecay(p_149800_1_, j1, p_149800_3_ - 1, k1); + + if (l1 >= 0) + { + i2 = l1 - (l - 8); + vec3 = vec3.addVector((double)((j1 - p_149800_2_) * i2), (double)((p_149800_3_ - p_149800_3_) * i2), (double)((k1 - p_149800_4_) * i2)); + } + } + } + else if (l1 >= 0) + { + i2 = l1 - l; + vec3 = vec3.addVector((double)((j1 - p_149800_2_) * i2), (double)((p_149800_3_ - p_149800_3_) * i2), (double)((k1 - p_149800_4_) * i2)); + } + } + + if (p_149800_1_.getBlockMetadata(p_149800_2_, p_149800_3_, p_149800_4_) >= 8) + { + boolean flag = false; + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_ - 1, 2)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_, p_149800_4_ + 1, 3)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_ - 1, p_149800_3_, p_149800_4_, 4)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_ + 1, p_149800_3_, p_149800_4_, 5)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_ + 1, p_149800_4_ - 1, 2)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_, p_149800_3_ + 1, p_149800_4_ + 1, 3)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_ - 1, p_149800_3_ + 1, p_149800_4_, 4)) + { + flag = true; + } + + if (flag || this.isBlockSolid(p_149800_1_, p_149800_2_ + 1, p_149800_3_ + 1, p_149800_4_, 5)) + { + flag = true; + } + + if (flag) + { + vec3 = vec3.normalize().addVector(0.0D, -6.0D, 0.0D); + } + } + + vec3 = vec3.normalize(); + return vec3; + } + + /** + * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d + */ + public void velocityToAddToEntity(World worldIn, int x, int y, int z, Entity entityIn, Vec3 velocity) + { + Vec3 vec31 = this.getFlowVector(worldIn, x, y, z); + velocity.xCoord += vec31.xCoord; + velocity.yCoord += vec31.yCoord; + velocity.zCoord += vec31.zCoord; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (worldIn.provider.hasNoSky ? 10 : 30) : 0); + } + + /** + * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z + */ + @SideOnly(Side.CLIENT) + public int getMixedBrightnessForBlock(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getLightBrightnessForSkyBlocks(x, y, z, 0); + int i1 = worldIn.getLightBrightnessForSkyBlocks(x, y + 1, z, 0); + int j1 = l & 255; + int k1 = i1 & 255; + int l1 = l >> 16 & 255; + int i2 = i1 >> 16 & 255; + return (j1 > k1 ? j1 : k1) | (l1 > i2 ? l1 : i2) << 16; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return this.blockMaterial == Material.water ? 1 : 0; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + int l; + + if (this.blockMaterial == Material.water) + { + if (random.nextInt(10) == 0) + { + l = worldIn.getBlockMetadata(x, y, z); + + if (l <= 0 || l >= 8) + { + worldIn.spawnParticle("suspended", (double)((float)x + random.nextFloat()), (double)((float)y + random.nextFloat()), (double)((float)z + random.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } + + for (l = 0; l < 0; ++l) + { + int i1 = random.nextInt(4); + int j1 = x; + int k1 = z; + + if (i1 == 0) + { + j1 = x - 1; + } + + if (i1 == 1) + { + ++j1; + } + + if (i1 == 2) + { + k1 = z - 1; + } + + if (i1 == 3) + { + ++k1; + } + + if (worldIn.getBlock(j1, y, k1).getMaterial() == Material.air && (worldIn.getBlock(j1, y - 1, k1).getMaterial().blocksMovement() || worldIn.getBlock(j1, y - 1, k1).getMaterial().isLiquid())) + { + float f = 0.0625F; + double d0 = (double)((float)x + random.nextFloat()); + double d1 = (double)((float)y + random.nextFloat()); + double d2 = (double)((float)z + random.nextFloat()); + + if (i1 == 0) + { + d0 = (double)((float)x - f); + } + + if (i1 == 1) + { + d0 = (double)((float)(x + 1) + f); + } + + if (i1 == 2) + { + d2 = (double)((float)z - f); + } + + if (i1 == 3) + { + d2 = (double)((float)(z + 1) + f); + } + + double d3 = 0.0D; + double d4 = 0.0D; + + if (i1 == 0) + { + d3 = (double)(-f); + } + + if (i1 == 1) + { + d3 = (double)f; + } + + if (i1 == 2) + { + d4 = (double)(-f); + } + + if (i1 == 3) + { + d4 = (double)f; + } + + worldIn.spawnParticle("splash", d0, d1, d2, d3, 0.0D, d4); + } + } + } + + if (this.blockMaterial == Material.water && random.nextInt(64) == 0) + { + l = worldIn.getBlockMetadata(x, y, z); + + if (l > 0 && l < 8) + { + worldIn.playSound((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), "liquid.water", random.nextFloat() * 0.25F + 0.75F, random.nextFloat() * 1.0F + 0.5F, false); + } + } + + double d5; + double d6; + double d7; + + if (this.blockMaterial == Material.lava && worldIn.getBlock(x, y + 1, z).getMaterial() == Material.air && !worldIn.getBlock(x, y + 1, z).isOpaqueCube()) + { + if (random.nextInt(100) == 0) + { + d5 = (double)((float)x + random.nextFloat()); + d6 = (double)y + this.maxY; + d7 = (double)((float)z + random.nextFloat()); + worldIn.spawnParticle("lava", d5, d6, d7, 0.0D, 0.0D, 0.0D); + worldIn.playSound(d5, d6, d7, "liquid.lavapop", 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false); + } + + if (random.nextInt(200) == 0) + { + worldIn.playSound((double)x, (double)y, (double)z, "liquid.lava", 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false); + } + } + + if (random.nextInt(10) == 0 && World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) && !worldIn.getBlock(x, y - 2, z).getMaterial().blocksMovement()) + { + d5 = (double)((float)x + random.nextFloat()); + d6 = (double)y - 1.05D; + d7 = (double)((float)z + random.nextFloat()); + + if (this.blockMaterial == Material.water) + { + worldIn.spawnParticle("dripWater", d5, d6, d7, 0.0D, 0.0D, 0.0D); + } + else + { + worldIn.spawnParticle("dripLava", d5, d6, d7, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + this.func_149805_n(worldIn, x, y, z); + } + + /** + * the sin and cos of this number determine the surface gradient of the flowing block. + */ + @SideOnly(Side.CLIENT) + public static double getFlowDirection(IBlockAccess p_149802_0_, int p_149802_1_, int p_149802_2_, int p_149802_3_, Material p_149802_4_) + { + Vec3 vec3 = null; + + if (p_149802_4_ == Material.water) + { + vec3 = Blocks.flowing_water.getFlowVector(p_149802_0_, p_149802_1_, p_149802_2_, p_149802_3_); + } + + if (p_149802_4_ == Material.lava) + { + vec3 = Blocks.flowing_lava.getFlowVector(p_149802_0_, p_149802_1_, p_149802_2_, p_149802_3_); + } + + return vec3.xCoord == 0.0D && vec3.zCoord == 0.0D ? -1000.0D : Math.atan2(vec3.zCoord, vec3.xCoord) - (Math.PI / 2D); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_149805_n(worldIn, x, y, z); + } + + private void func_149805_n(World p_149805_1_, int p_149805_2_, int p_149805_3_, int p_149805_4_) + { + if (p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_) == this) + { + if (this.blockMaterial == Material.lava) + { + boolean flag = false; + + if (flag || p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_ - 1).getMaterial() == Material.water) + { + flag = true; + } + + if (flag || p_149805_1_.getBlock(p_149805_2_, p_149805_3_, p_149805_4_ + 1).getMaterial() == Material.water) + { + flag = true; + } + + if (flag || p_149805_1_.getBlock(p_149805_2_ - 1, p_149805_3_, p_149805_4_).getMaterial() == Material.water) + { + flag = true; + } + + if (flag || p_149805_1_.getBlock(p_149805_2_ + 1, p_149805_3_, p_149805_4_).getMaterial() == Material.water) + { + flag = true; + } + + if (flag || p_149805_1_.getBlock(p_149805_2_, p_149805_3_ + 1, p_149805_4_).getMaterial() == Material.water) + { + flag = true; + } + + if (flag) + { + int l = p_149805_1_.getBlockMetadata(p_149805_2_, p_149805_3_, p_149805_4_); + + if (l == 0) + { + p_149805_1_.setBlock(p_149805_2_, p_149805_3_, p_149805_4_, Blocks.obsidian); + } + else if (l <= 4) + { + p_149805_1_.setBlock(p_149805_2_, p_149805_3_, p_149805_4_, Blocks.cobblestone); + } + + this.func_149799_m(p_149805_1_, p_149805_2_, p_149805_3_, p_149805_4_); + } + } + } + } + + protected void func_149799_m(World p_149799_1_, int p_149799_2_, int p_149799_3_, int p_149799_4_) + { + p_149799_1_.playSoundEffect((double)((float)p_149799_2_ + 0.5F), (double)((float)p_149799_3_ + 0.5F), (double)((float)p_149799_4_ + 0.5F), "random.fizz", 0.5F, 2.6F + (p_149799_1_.rand.nextFloat() - p_149799_1_.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 8; ++l) + { + p_149799_1_.spawnParticle("largesmoke", (double)p_149799_2_ + Math.random(), (double)p_149799_3_ + 1.2D, (double)p_149799_4_ + Math.random(), 0.0D, 0.0D, 0.0D); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + if (this.blockMaterial == Material.lava) + { + this.field_149806_a = new IIcon[] {reg.registerIcon("lava_still"), reg.registerIcon("lava_flow")}; + } + else + { + this.field_149806_a = new IIcon[] {reg.registerIcon("water_still"), reg.registerIcon("water_flow")}; + } + } + + @SideOnly(Side.CLIENT) + public static IIcon getLiquidIcon(String p_149803_0_) + { + return p_149803_0_ == "water_still" ? Blocks.flowing_water.field_149806_a[0] : (p_149803_0_ == "water_flow" ? Blocks.flowing_water.field_149806_a[1] : (p_149803_0_ == "lava_still" ? Blocks.flowing_lava.field_149806_a[0] : (p_149803_0_ == "lava_flow" ? Blocks.flowing_lava.field_149806_a[1] : null))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockLog.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLog.java new file mode 100644 index 0000000..deed4a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockLog.java @@ -0,0 +1,94 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockLog extends BlockRotatedPillar +{ + @SideOnly(Side.CLIENT) + protected IIcon[] field_150167_a; + @SideOnly(Side.CLIENT) + protected IIcon[] field_150166_b; + private static final String __OBFID = "CL_00000266"; + + public BlockLog() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + this.setHardness(2.0F); + this.setStepSound(soundTypeWood); + } + + public static int func_150165_c(int p_150165_0_) + { + return p_150165_0_ & 3; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(this); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + byte b0 = 4; + int i1 = b0 + 1; + + if (worldIn.checkChunksExist(x - i1, y - i1, z - i1, x + i1, y + i1, z + i1)) + { + for (int j1 = -b0; j1 <= b0; ++j1) + { + for (int k1 = -b0; k1 <= b0; ++k1) + { + for (int l1 = -b0; l1 <= b0; ++l1) + { + Block block = worldIn.getBlock(x + j1, y + k1, z + l1); + if (block.isLeaves(worldIn, x + j1, y + k1, z + l1)) + { + block.beginLeavesDecay(worldIn, x + j1, y + k1, z + l1); + } + } + } + } + } + } + + @SideOnly(Side.CLIENT) + protected IIcon getSideIcon(int p_150163_1_) + { + return this.field_150167_a[p_150163_1_ % this.field_150167_a.length]; + } + + @SideOnly(Side.CLIENT) + protected IIcon getTopIcon(int p_150161_1_) + { + return this.field_150166_b[p_150161_1_ % this.field_150166_b.length]; + } + + @Override + public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public boolean isWood(IBlockAccess world, int x, int y, int z) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockMelon.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMelon.java new file mode 100644 index 0000000..4b3dc14 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMelon.java @@ -0,0 +1,68 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; + +public class BlockMelon extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150201_a; + private static final String __OBFID = "CL_00000267"; + + protected BlockMelon() + { + super(Material.gourd); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side != 1 && side != 0 ? this.blockIcon : this.field_150201_a; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.melon; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 3 + random.nextInt(5); + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + int j = this.quantityDropped(random) + random.nextInt(1 + maxBonus); + + if (j > 9) + { + j = 9; + } + + return j; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150201_a = reg.registerIcon(this.getTextureName() + "_top"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockMobSpawner.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMobSpawner.java new file mode 100644 index 0000000..d3f577e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMobSpawner.java @@ -0,0 +1,75 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockMobSpawner extends BlockContainer +{ + private static final String __OBFID = "CL_00000269"; + + protected BlockMobSpawner() + { + super(Material.rock); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityMobSpawner(); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + private Random rand = new Random(); + @Override + public int getExpDrop(IBlockAccess world, int metadata, int fortune) + { + return 15 + rand.nextInt(15) + rand.nextInt(15); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(0); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockMushroom.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMushroom.java new file mode 100644 index 0000000..49fefd8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMushroom.java @@ -0,0 +1,149 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockMushroom extends BlockBush implements IGrowable +{ + private static final String __OBFID = "CL_00000272"; + + protected BlockMushroom() + { + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (random.nextInt(25) == 0) + { + byte b0 = 4; + int l = 5; + int i1; + int j1; + int k1; + + for (i1 = x - b0; i1 <= x + b0; ++i1) + { + for (j1 = z - b0; j1 <= z + b0; ++j1) + { + for (k1 = y - 1; k1 <= y + 1; ++k1) + { + if (worldIn.getBlock(i1, k1, j1) == this) + { + --l; + + if (l <= 0) + { + return; + } + } + } + } + } + + i1 = x + random.nextInt(3) - 1; + j1 = y + random.nextInt(2) - random.nextInt(2); + k1 = z + random.nextInt(3) - 1; + + for (int l1 = 0; l1 < 4; ++l1) + { + if (worldIn.isAirBlock(i1, j1, k1) && this.canBlockStay(worldIn, i1, j1, k1)) + { + x = i1; + y = j1; + z = k1; + } + + i1 = x + random.nextInt(3) - 1; + j1 = y + random.nextInt(2) - random.nextInt(2); + k1 = z + random.nextInt(3) - 1; + } + + if (worldIn.isAirBlock(i1, j1, k1) && this.canBlockStay(worldIn, i1, j1, k1)) + { + worldIn.setBlock(i1, j1, k1, this, 0, 2); + } + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return super.canPlaceBlockAt(worldIn, x, y, z) && this.canBlockStay(worldIn, x, y, z); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground.func_149730_j(); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + if (y >= 0 && y < 256) + { + Block block = worldIn.getBlock(x, y - 1, z); + return block == Blocks.mycelium || block == Blocks.dirt && worldIn.getBlockMetadata(x, y - 1, z) == 2 || worldIn.getFullBlockLightValue(x, y, z) < 13 && block.canSustainPlant(worldIn, x, y - 1, z, ForgeDirection.UP, this); + } + else + { + return false; + } + } + + public boolean func_149884_c(World p_149884_1_, int p_149884_2_, int p_149884_3_, int p_149884_4_, Random p_149884_5_) + { + int l = p_149884_1_.getBlockMetadata(p_149884_2_, p_149884_3_, p_149884_4_); + p_149884_1_.setBlockToAir(p_149884_2_, p_149884_3_, p_149884_4_); + WorldGenBigMushroom worldgenbigmushroom = null; + + if (this == Blocks.brown_mushroom) + { + worldgenbigmushroom = new WorldGenBigMushroom(0); + } + else if (this == Blocks.red_mushroom) + { + worldgenbigmushroom = new WorldGenBigMushroom(1); + } + + if (worldgenbigmushroom != null && worldgenbigmushroom.generate(p_149884_1_, p_149884_5_, p_149884_2_, p_149884_3_, p_149884_4_)) + { + return true; + } + else + { + p_149884_1_.setBlock(p_149884_2_, p_149884_3_, p_149884_4_, this, l, 3); + return false; + } + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + return true; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return (double)random.nextFloat() < 0.4D; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + this.func_149884_c(worldIn, x, y, z, random); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockMycelium.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMycelium.java new file mode 100644 index 0000000..2aea1bf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockMycelium.java @@ -0,0 +1,112 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockMycelium extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150200_a; + @SideOnly(Side.CLIENT) + private IIcon field_150199_b; + private static final String __OBFID = "CL_00000273"; + + protected BlockMycelium() + { + super(Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_150200_a : (side == 0 ? Blocks.dirt.getBlockTextureFromSide(side) : this.blockIcon); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + if (worldIn.getBlockLightValue(x, y + 1, z) < 4 && worldIn.getBlockLightOpacity(x, y + 1, z) > 2) + { + worldIn.setBlock(x, y, z, Blocks.dirt); + } + else if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) + { + for (int l = 0; l < 4; ++l) + { + int i1 = x + random.nextInt(3) - 1; + int j1 = y + random.nextInt(5) - 3; + int k1 = z + random.nextInt(3) - 1; + Block block = worldIn.getBlock(i1, j1 + 1, k1); + + if (worldIn.getBlock(i1, j1, k1) == Blocks.dirt && worldIn.getBlockMetadata(i1, j1, k1) == 0 && worldIn.getBlockLightValue(i1, j1 + 1, k1) >= 4 && worldIn.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) + { + worldIn.setBlock(i1, j1, k1, this); + } + } + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Blocks.dirt.getItemDropped(0, random, fortune); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (side == 1) + { + return this.field_150200_a; + } + else if (side == 0) + { + return Blocks.dirt.getBlockTextureFromSide(side); + } + else + { + Material material = worldIn.getBlock(x, y + 1, z).getMaterial(); + return material != Material.snow && material != Material.craftedSnow ? this.blockIcon : this.field_150199_b; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150200_a = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150199_b = reg.registerIcon("grass_side_snowed"); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + super.randomDisplayTick(worldIn, x, y, z, random); + + if (random.nextInt(10) == 0) + { + worldIn.spawnParticle("townaura", (double)((float)x + random.nextFloat()), (double)((float)y + 1.1F), (double)((float)z + random.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherWart.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherWart.java new file mode 100644 index 0000000..18a3844 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherWart.java @@ -0,0 +1,160 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockNetherWart extends BlockBush +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149883_a; + private static final String __OBFID = "CL_00000274"; + + protected BlockNetherWart() + { + this.setTickRandomly(true); + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.soul_sand; + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return super.canBlockStay(worldIn, x, y, z); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l < 3 && random.nextInt(10) == 0) + { + ++l; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + super.updateTick(worldIn, x, y, z, random); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return meta >= 3 ? this.field_149883_a[2] : (meta > 0 ? this.field_149883_a[1] : this.field_149883_a[0]); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 6; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + @SuppressWarnings("unused") + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + + if (false && !worldIn.isRemote) + { + int j1 = 1; + + if (meta >= 3) + { + j1 = 2 + worldIn.rand.nextInt(3); + + if (fortune > 0) + { + j1 += worldIn.rand.nextInt(fortune + 1); + } + } + + for (int k1 = 0; k1 < j1; ++k1) + { + this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(Items.nether_wart)); + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.nether_wart; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149883_a = new IIcon[3]; + + for (int i = 0; i < this.field_149883_a.length; ++i) + { + this.field_149883_a[i] = reg.registerIcon(this.getTextureName() + "_stage_" + i); + } + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + int count = 1; + + if (metadata >= 3) + { + count = 2 + world.rand.nextInt(3) + (fortune > 0 ? world.rand.nextInt(fortune + 1) : 0); + } + + for (int i = 0; i < count; i++) + { + ret.add(new ItemStack(Items.nether_wart)); + } + + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherrack.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherrack.java new file mode 100644 index 0000000..15355ca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNetherrack.java @@ -0,0 +1,21 @@ +package net.minecraft.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockNetherrack extends Block +{ + private static final String __OBFID = "CL_00000275"; + + public BlockNetherrack() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public MapColor getMapColor(int meta) + { + return MapColor.netherrackColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLeaf.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLeaf.java new file mode 100644 index 0000000..e3530a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLeaf.java @@ -0,0 +1,81 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockNewLeaf extends BlockLeaves +{ + public static final String[][] field_150132_N = new String[][] {{"leaves_acacia", "leaves_big_oak"}, {"leaves_acacia_opaque", "leaves_big_oak_opaque"}}; + public static final String[] field_150133_O = new String[] {"acacia", "big_oak"}; + private static final String __OBFID = "CL_00000276"; + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) + { + if ((p_150124_5_ & 3) == 1 && p_150124_1_.rand.nextInt(p_150124_6_) == 0) + { + this.dropBlockAsItem(p_150124_1_, p_150124_2_, p_150124_3_, p_150124_4_, new ItemStack(Items.apple, 1, 0)); + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return super.damageDropped(meta) + 4; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return worldIn.getBlockMetadata(x, y, z) & 3; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return (meta & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : this.field_150129_M[this.field_150127_b][0]; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + for (int i = 0; i < field_150132_N.length; ++i) + { + this.field_150129_M[i] = new IIcon[field_150132_N[i].length]; + + for (int j = 0; j < field_150132_N[i].length; ++j) + { + this.field_150129_M[i][j] = reg.registerIcon(field_150132_N[i][j]); + } + } + } + + public String[] func_150125_e() + { + return field_150133_O; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLog.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLog.java new file mode 100644 index 0000000..3b56ed7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNewLog.java @@ -0,0 +1,39 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockNewLog extends BlockLog +{ + public static final String[] field_150169_M = new String[] {"acacia", "big_oak"}; + private static final String __OBFID = "CL_00000277"; + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150167_a = new IIcon[field_150169_M.length]; + this.field_150166_b = new IIcon[field_150169_M.length]; + + for (int i = 0; i < this.field_150167_a.length; ++i) + { + this.field_150167_a[i] = reg.registerIcon(this.getTextureName() + "_" + field_150169_M[i]); + this.field_150166_b[i] = reg.registerIcon(this.getTextureName() + "_" + field_150169_M[i] + "_top"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockNote.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNote.java new file mode 100644 index 0000000..2c6bc5b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockNote.java @@ -0,0 +1,123 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityNote; +import net.minecraft.world.World; + +public class BlockNote extends BlockContainer +{ + private static final String __OBFID = "CL_00000278"; + + public BlockNote() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + boolean flag = worldIn.isBlockIndirectlyGettingPowered(x, y, z); + TileEntityNote tileentitynote = (TileEntityNote)worldIn.getTileEntity(x, y, z); + + if (tileentitynote != null && tileentitynote.previousRedstoneState != flag) + { + if (flag) + { + tileentitynote.triggerNote(worldIn, x, y, z); + } + + tileentitynote.previousRedstoneState = flag; + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + TileEntityNote tileentitynote = (TileEntityNote)worldIn.getTileEntity(x, y, z); + + if (tileentitynote != null) + { + int old = tileentitynote.note; + tileentitynote.changePitch(); + if (old == tileentitynote.note) return false; + tileentitynote.triggerNote(worldIn, x, y, z); + } + + return true; + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) + { + if (!worldIn.isRemote) + { + TileEntityNote tileentitynote = (TileEntityNote)worldIn.getTileEntity(x, y, z); + + if (tileentitynote != null) + { + tileentitynote.triggerNote(worldIn, x, y, z); + } + } + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityNote(); + } + + public boolean onBlockEventReceived(World worldIn, int x, int y, int z, int eventId, int eventData) + { + int meta = worldIn.getBlockMetadata(x, y, z); + net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(worldIn, x, y, z, meta, eventData, eventId); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; + eventId = e.instrument.ordinal(); + eventData = e.getVanillaNoteId(); + float f = (float)Math.pow(2.0D, (double)(eventData - 12) / 12.0D); + String s = "harp"; + + if (eventId == 1) + { + s = "bd"; + } + + if (eventId == 2) + { + s = "snare"; + } + + if (eventId == 3) + { + s = "hat"; + } + + if (eventId == 4) + { + s = "bassattack"; + } + + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "note." + s, 3.0F, f); + worldIn.spawnParticle("note", (double)x + 0.5D, (double)y + 1.2D, (double)z + 0.5D, (double)eventData / 24.0D, 0.0D, 0.0D); + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockObsidian.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockObsidian.java new file mode 100644 index 0000000..af842e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockObsidian.java @@ -0,0 +1,29 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + +public class BlockObsidian extends BlockStone +{ + private static final String __OBFID = "CL_00000279"; + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.obsidian); + } + + public MapColor getMapColor(int meta) + { + return MapColor.obsidianColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLeaf.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLeaf.java new file mode 100644 index 0000000..676f2fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLeaf.java @@ -0,0 +1,101 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockOldLeaf extends BlockLeaves +{ + public static final String[][] field_150130_N = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; + public static final String[] field_150131_O = new String[] {"oak", "spruce", "birch", "jungle"}; + private static final String __OBFID = "CL_00000280"; + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return (meta & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((meta & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : super.getRenderColor(meta)); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + return (l & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((l & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : super.colorMultiplier(worldIn, x, y, z)); + } + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) + { + if ((p_150124_5_ & 3) == 0 && p_150124_1_.rand.nextInt(p_150124_6_) == 0) + { + this.dropBlockAsItem(p_150124_1_, p_150124_2_, p_150124_3_, p_150124_4_, new ItemStack(Items.apple, 1, 0)); + } + } + + protected int func_150123_b(int p_150123_1_) + { + int j = super.func_150123_b(p_150123_1_); + + if ((p_150123_1_ & 3) == 3) + { + j = 40; + } + + return j; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return (meta & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : ((meta & 3) == 3 ? this.field_150129_M[this.field_150127_b][3] : ((meta & 3) == 2 ? this.field_150129_M[this.field_150127_b][2] : this.field_150129_M[this.field_150127_b][0])); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + list.add(new ItemStack(itemIn, 1, 3)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + for (int i = 0; i < field_150130_N.length; ++i) + { + this.field_150129_M[i] = new IIcon[field_150130_N[i].length]; + + for (int j = 0; j < field_150130_N[i].length; ++j) + { + this.field_150129_M[i][j] = reg.registerIcon(field_150130_N[i][j]); + } + } + } + + public String[] func_150125_e() + { + return field_150131_O; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLog.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLog.java new file mode 100644 index 0000000..878af33 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOldLog.java @@ -0,0 +1,41 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockOldLog extends BlockLog +{ + public static final String[] field_150168_M = new String[] {"oak", "spruce", "birch", "jungle"}; + private static final String __OBFID = "CL_00000281"; + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + list.add(new ItemStack(itemIn, 1, 3)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150167_a = new IIcon[field_150168_M.length]; + this.field_150166_b = new IIcon[field_150168_M.length]; + + for (int i = 0; i < this.field_150167_a.length; ++i) + { + this.field_150167_a[i] = reg.registerIcon(this.getTextureName() + "_" + field_150168_M[i]); + this.field_150166_b[i] = reg.registerIcon(this.getTextureName() + "_" + field_150168_M[i] + "_top"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockOre.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOre.java new file mode 100644 index 0000000..6287635 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockOre.java @@ -0,0 +1,107 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockOre extends Block +{ + private static final String __OBFID = "CL_00000282"; + + public BlockOre() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this))))); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return this == Blocks.lapis_ore ? 4 + random.nextInt(5) : 1; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + if (maxBonus > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, random, maxBonus)) + { + int j = random.nextInt(maxBonus + 2) - 1; + + if (j < 0) + { + j = 0; + } + + return this.quantityDropped(random) * (j + 1); + } + else + { + return this.quantityDropped(random); + } + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + private Random rand = new Random(); + @Override + public int getExpDrop(IBlockAccess worldIn, int meta, int fortune) + { + if (this.getItemDropped(meta, rand, fortune) != Item.getItemFromBlock(this)) + { + int j1 = 0; + + if (this == Blocks.coal_ore) + { + j1 = MathHelper.getRandomIntegerInRange(rand, 0, 2); + } + else if (this == Blocks.diamond_ore) + { + j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7); + } + else if (this == Blocks.emerald_ore) + { + j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7); + } + else if (this == Blocks.lapis_ore) + { + j1 = MathHelper.getRandomIntegerInRange(rand, 2, 5); + } + else if (this == Blocks.quartz_ore) + { + j1 = MathHelper.getRandomIntegerInRange(rand, 2, 5); + } + + return j1; + } + return 0; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return this == Blocks.lapis_ore ? 4 : 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPackedIce.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPackedIce.java new file mode 100644 index 0000000..b9d7077 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPackedIce.java @@ -0,0 +1,25 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockPackedIce extends Block +{ + private static final String __OBFID = "CL_00000283"; + + public BlockPackedIce() + { + super(Material.packedIce); + this.slipperiness = 0.98F; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPane.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPane.java new file mode 100644 index 0000000..ca477ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPane.java @@ -0,0 +1,228 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockPane extends Block +{ + private final String field_150100_a; + private final boolean field_150099_b; + private final String field_150101_M; + @SideOnly(Side.CLIENT) + private IIcon field_150102_N; + private static final String __OBFID = "CL_00000322"; + + protected BlockPane(String p_i45432_1_, String p_i45432_2_, Material p_i45432_3_, boolean p_i45432_4_) + { + super(p_i45432_3_); + this.field_150100_a = p_i45432_2_; + this.field_150099_b = p_i45432_4_; + this.field_150101_M = p_i45432_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return !this.field_150099_b ? null : super.getItemDropped(meta, random, fortune); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return this.blockMaterial == Material.glass ? 41 : 18; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return worldIn.getBlock(x, y, z) == this ? false : super.shouldSideBeRendered(worldIn, x, y, z, side); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + boolean flag = this.canPaneConnectTo(worldIn, x, y, z - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(worldIn, x, y, z + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(worldIn, x - 1, y, z, WEST ); + boolean flag3 = this.canPaneConnectTo(worldIn, x + 1, y, z, EAST ); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { + if (flag2 && !flag3) + { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + else if (!flag2 && flag3) + { + this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) + { + if (flag && !flag1) + { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + else if (!flag && flag1) + { + this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + } + else + { + this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + float f = 0.4375F; + float f1 = 0.5625F; + float f2 = 0.4375F; + float f3 = 0.5625F; + boolean flag = this.canPaneConnectTo(worldIn, x, y, z - 1, NORTH); + boolean flag1 = this.canPaneConnectTo(worldIn, x, y, z + 1, SOUTH); + boolean flag2 = this.canPaneConnectTo(worldIn, x - 1, y, z, WEST ); + boolean flag3 = this.canPaneConnectTo(worldIn, x + 1, y, z, EAST ); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { + if (flag2 && !flag3) + { + f = 0.0F; + } + else if (!flag2 && flag3) + { + f1 = 1.0F; + } + } + else + { + f = 0.0F; + f1 = 1.0F; + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) + { + if (flag && !flag1) + { + f2 = 0.0F; + } + else if (!flag && flag1) + { + f3 = 1.0F; + } + } + else + { + f2 = 0.0F; + f3 = 1.0F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3); + } + + public final boolean canPaneConnectToBlock(Block p_150098_1_) + { + return p_150098_1_.func_149730_j() || p_150098_1_ == this || p_150098_1_ == Blocks.glass || p_150098_1_ == Blocks.stained_glass || p_150098_1_ == Blocks.stained_glass_pane || p_150098_1_ instanceof BlockPane; + } + + @SideOnly(Side.CLIENT) + public IIcon func_150097_e() + { + return this.field_150102_N; + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + return true; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Item.getItemFromBlock(this), 1, meta); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.field_150101_M); + this.field_150102_N = reg.registerIcon(this.field_150100_a); + } + + public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) + { + return canPaneConnectToBlock(world.getBlock(x, y, z)) || + world.isSideSolid(x, y, z, dir.getOpposite(), false); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonBase.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonBase.java new file mode 100644 index 0000000..9b1f545 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonBase.java @@ -0,0 +1,572 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonBase extends Block +{ + /** This piston is the sticky one? */ + private final boolean isSticky; + /** Only visible when piston is extended */ + @SideOnly(Side.CLIENT) + private IIcon innerTopIcon; + /** Bottom side texture */ + @SideOnly(Side.CLIENT) + private IIcon bottomIcon; + /** Top icon of piston depends on (either sticky or normal) */ + @SideOnly(Side.CLIENT) + private IIcon topIcon; + private static final String __OBFID = "CL_00000366"; + + public BlockPistonBase(boolean p_i45443_1_) + { + super(Material.piston); + this.isSticky = p_i45443_1_; + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + @SideOnly(Side.CLIENT) + public IIcon getPistonExtensionTexture() + { + return this.topIcon; + } + + @SideOnly(Side.CLIENT) + public void func_150070_b(float p_150070_1_, float p_150070_2_, float p_150070_3_, float p_150070_4_, float p_150070_5_, float p_150070_6_) + { + this.setBlockBounds(p_150070_1_, p_150070_2_, p_150070_3_, p_150070_4_, p_150070_5_, p_150070_6_); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 16; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + int k = getPistonOrientation(meta); + return k > 5 ? this.topIcon : (side == k ? (!isExtended(meta) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (side == Facing.oppositeSide[k] ? this.bottomIcon : this.blockIcon)); + } + + @SideOnly(Side.CLIENT) + public static IIcon getPistonBaseIcon(String p_150074_0_) + { + return p_150074_0_ == "piston_side" ? Blocks.piston.blockIcon : (p_150074_0_ == "piston_top_normal" ? Blocks.piston.topIcon : (p_150074_0_ == "piston_top_sticky" ? Blocks.sticky_piston.topIcon : (p_150074_0_ == "piston_inner" ? Blocks.piston.innerTopIcon : null))); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("piston_side"); + this.topIcon = reg.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); + this.innerTopIcon = reg.registerIcon("piston_inner"); + this.bottomIcon = reg.registerIcon("piston_bottom"); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + return false; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = determineOrientation(worldIn, x, y, z, placer); + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + + if (!worldIn.isRemote) + { + this.updatePistonState(worldIn, x, y, z); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + this.updatePistonState(worldIn, x, y, z); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (!worldIn.isRemote && worldIn.getTileEntity(x, y, z) == null) + { + this.updatePistonState(worldIn, x, y, z); + } + } + + /** + * handles attempts to extend or retract the piston. + */ + private void updatePistonState(World p_150078_1_, int p_150078_2_, int p_150078_3_, int p_150078_4_) + { + int l = p_150078_1_.getBlockMetadata(p_150078_2_, p_150078_3_, p_150078_4_); + int i1 = getPistonOrientation(l); + + if (i1 != 7) + { + boolean flag = this.isIndirectlyPowered(p_150078_1_, p_150078_2_, p_150078_3_, p_150078_4_, i1); + + if (flag && !isExtended(l)) + { + if (canExtend(p_150078_1_, p_150078_2_, p_150078_3_, p_150078_4_, i1)) + { + p_150078_1_.addBlockEvent(p_150078_2_, p_150078_3_, p_150078_4_, this, 0, i1); + } + } + else if (!flag && isExtended(l)) + { + p_150078_1_.setBlockMetadataWithNotify(p_150078_2_, p_150078_3_, p_150078_4_, i1, 2); + p_150078_1_.addBlockEvent(p_150078_2_, p_150078_3_, p_150078_4_, this, 1, i1); + } + } + } + + private boolean isIndirectlyPowered(World p_150072_1_, int p_150072_2_, int p_150072_3_, int p_150072_4_, int p_150072_5_) + { + return p_150072_5_ != 0 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ - 1, p_150072_4_, 0) ? true : (p_150072_5_ != 1 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_, 1) ? true : (p_150072_5_ != 2 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_ - 1, 2) ? true : (p_150072_5_ != 3 && p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_ + 1, 3) ? true : (p_150072_5_ != 5 && p_150072_1_.getIndirectPowerOutput(p_150072_2_ + 1, p_150072_3_, p_150072_4_, 5) ? true : (p_150072_5_ != 4 && p_150072_1_.getIndirectPowerOutput(p_150072_2_ - 1, p_150072_3_, p_150072_4_, 4) ? true : (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_, p_150072_4_, 0) ? true : (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 2, p_150072_4_, 1) ? true : (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_ - 1, 2) ? true : (p_150072_1_.getIndirectPowerOutput(p_150072_2_, p_150072_3_ + 1, p_150072_4_ + 1, 3) ? true : (p_150072_1_.getIndirectPowerOutput(p_150072_2_ - 1, p_150072_3_ + 1, p_150072_4_, 4) ? true : p_150072_1_.getIndirectPowerOutput(p_150072_2_ + 1, p_150072_3_ + 1, p_150072_4_, 5))))))))))); + } + + public boolean onBlockEventReceived(World worldIn, int x, int y, int z, int eventId, int eventData) + { + if (!worldIn.isRemote) + { + boolean flag = this.isIndirectlyPowered(worldIn, x, y, z, eventData); + + if (flag && eventId == 1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, eventData | 8, 2); + return false; + } + + if (!flag && eventId == 0) + { + return false; + } + } + + if (eventId == 0) + { + if (!this.tryExtend(worldIn, x, y, z, eventData)) + { + return false; + } + + worldIn.setBlockMetadataWithNotify(x, y, z, eventData | 8, 2); + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "tile.piston.out", 0.5F, worldIn.rand.nextFloat() * 0.25F + 0.6F); + } + else if (eventId == 1) + { + TileEntity tileentity1 = worldIn.getTileEntity(x + Facing.offsetsXForSide[eventData], y + Facing.offsetsYForSide[eventData], z + Facing.offsetsZForSide[eventData]); + + if (tileentity1 instanceof TileEntityPiston) + { + ((TileEntityPiston)tileentity1).clearPistonTileEntity(); + } + + worldIn.setBlock(x, y, z, Blocks.piston_extension, eventData, 3); + worldIn.setTileEntity(x, y, z, BlockPistonMoving.getTileEntity(this, eventData, eventData, false, true)); + + if (this.isSticky) + { + int j1 = x + Facing.offsetsXForSide[eventData] * 2; + int k1 = y + Facing.offsetsYForSide[eventData] * 2; + int l1 = z + Facing.offsetsZForSide[eventData] * 2; + Block block = worldIn.getBlock(j1, k1, l1); + int i2 = worldIn.getBlockMetadata(j1, k1, l1); + boolean flag1 = false; + + if (block == Blocks.piston_extension) + { + TileEntity tileentity = worldIn.getTileEntity(j1, k1, l1); + + if (tileentity instanceof TileEntityPiston) + { + TileEntityPiston tileentitypiston = (TileEntityPiston)tileentity; + + if (tileentitypiston.getPistonOrientation() == eventData && tileentitypiston.isExtending()) + { + tileentitypiston.clearPistonTileEntity(); + block = tileentitypiston.getStoredBlockID(); + i2 = tileentitypiston.getBlockMetadata(); + flag1 = true; + } + } + } + + if (!flag1 && block.getMaterial() != Material.air && canPushBlock(block, worldIn, j1, k1, l1, false) && (block.getMobilityFlag() == 0 || block == Blocks.piston || block == Blocks.sticky_piston)) + { + x += Facing.offsetsXForSide[eventData]; + y += Facing.offsetsYForSide[eventData]; + z += Facing.offsetsZForSide[eventData]; + worldIn.setBlock(x, y, z, Blocks.piston_extension, i2, 3); + worldIn.setTileEntity(x, y, z, BlockPistonMoving.getTileEntity(block, i2, eventData, false, false)); + worldIn.setBlockToAir(j1, k1, l1); + } + else if (!flag1) + { + worldIn.setBlockToAir(x + Facing.offsetsXForSide[eventData], y + Facing.offsetsYForSide[eventData], z + Facing.offsetsZForSide[eventData]); + } + } + else + { + worldIn.setBlockToAir(x + Facing.offsetsXForSide[eventData], y + Facing.offsetsYForSide[eventData], z + Facing.offsetsZForSide[eventData]); + } + + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "tile.piston.in", 0.5F, worldIn.rand.nextFloat() * 0.15F + 0.6F); + } + + return true; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (isExtended(l)) + { + float f = 0.25F; + + switch (getPistonOrientation(l)) + { + case 0: + this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case 1: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + break; + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); + break; + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); + break; + case 4: + this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case 5: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); + } + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public static int getPistonOrientation(int p_150076_0_) + { + return p_150076_0_ & 7; + } + + /** + * Determine if the metadata is related to something powered. + */ + public static boolean isExtended(int p_150075_0_) + { + return (p_150075_0_ & 8) != 0; + } + + /** + * gets the way this piston should face for that entity that placed it. + */ + public static int determineOrientation(World p_150071_0_, int p_150071_1_, int p_150071_2_, int p_150071_3_, EntityLivingBase p_150071_4_) + { + if (MathHelper.abs((float)p_150071_4_.posX - (float)p_150071_1_) < 2.0F && MathHelper.abs((float)p_150071_4_.posZ - (float)p_150071_3_) < 2.0F) + { + double d0 = p_150071_4_.posY + 1.82D - (double)p_150071_4_.yOffset; + + if (d0 - (double)p_150071_2_ > 2.0D) + { + return 1; + } + + if ((double)p_150071_2_ - d0 > 0.0D) + { + return 0; + } + } + + int l = MathHelper.floor_double((double)(p_150071_4_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + return l == 0 ? 2 : (l == 1 ? 5 : (l == 2 ? 3 : (l == 3 ? 4 : 0))); + } + + /** + * returns true if the piston can push the specified block + */ + private static boolean canPushBlock(Block p_150080_0_, World p_150080_1_, int p_150080_2_, int p_150080_3_, int p_150080_4_, boolean p_150080_5_) + { + if (p_150080_0_ == Blocks.obsidian) + { + return false; + } + else + { + if (p_150080_0_ != Blocks.piston && p_150080_0_ != Blocks.sticky_piston) + { + if (p_150080_0_.getBlockHardness(p_150080_1_, p_150080_2_, p_150080_3_, p_150080_4_) == -1.0F) + { + return false; + } + + if (p_150080_0_.getMobilityFlag() == 2) + { + return false; + } + + if (p_150080_0_.getMobilityFlag() == 1) + { + if (!p_150080_5_) + { + return false; + } + + return true; + } + } + else if (isExtended(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))) + { + return false; + } + + return !(p_150080_1_.getBlock(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.getBlockMetadata(p_150080_2_, p_150080_3_, p_150080_4_))); + + } + } + + /** + * checks to see if this piston could push the blocks in front of it. + */ + private static boolean canExtend(World p_150077_0_, int p_150077_1_, int p_150077_2_, int p_150077_3_, int p_150077_4_) + { + int i1 = p_150077_1_ + Facing.offsetsXForSide[p_150077_4_]; + int j1 = p_150077_2_ + Facing.offsetsYForSide[p_150077_4_]; + int k1 = p_150077_3_ + Facing.offsetsZForSide[p_150077_4_]; + int l1 = 0; + + while (true) + { + if (l1 < 13) + { + if (j1 <= 0 || j1 >= p_150077_0_.getHeight()) + { + return false; + } + + Block block = p_150077_0_.getBlock(i1, j1, k1); + + if (!block.isAir(p_150077_0_, i1, j1, k1)) + { + if (!canPushBlock(block, p_150077_0_, i1, j1, k1, true)) + { + return false; + } + + if (block.getMobilityFlag() != 1) + { + if (l1 == 12) + { + return false; + } + + i1 += Facing.offsetsXForSide[p_150077_4_]; + j1 += Facing.offsetsYForSide[p_150077_4_]; + k1 += Facing.offsetsZForSide[p_150077_4_]; + ++l1; + continue; + } + } + } + + return true; + } + } + + /** + * attempts to extend the piston. returns false if impossible. + */ + private boolean tryExtend(World p_150079_1_, int p_150079_2_, int p_150079_3_, int p_150079_4_, int p_150079_5_) + { + int i1 = p_150079_2_ + Facing.offsetsXForSide[p_150079_5_]; + int j1 = p_150079_3_ + Facing.offsetsYForSide[p_150079_5_]; + int k1 = p_150079_4_ + Facing.offsetsZForSide[p_150079_5_]; + int l1 = 0; + + while (true) + { + if (l1 < 13) + { + if (j1 <= 0 || j1 >= p_150079_1_.getHeight()) + { + return false; + } + + Block block = p_150079_1_.getBlock(i1, j1, k1); + + if (!block.isAir(p_150079_1_, i1, j1, k1)) + { + if (!canPushBlock(block, p_150079_1_, i1, j1, k1, true)) + { + return false; + } + + if (block.getMobilityFlag() != 1) + { + if (l1 == 12) + { + return false; + } + + i1 += Facing.offsetsXForSide[p_150079_5_]; + j1 += Facing.offsetsYForSide[p_150079_5_]; + k1 += Facing.offsetsZForSide[p_150079_5_]; + ++l1; + continue; + } + + //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. + float chance = block instanceof BlockSnow ? -1.0f : 1.0f; + block.dropBlockAsItemWithChance(p_150079_1_, i1, j1, k1, p_150079_1_.getBlockMetadata(i1, j1, k1), chance, 0); + p_150079_1_.setBlockToAir(i1, j1, k1); + } + } + + l1 = i1; + int k3 = j1; + int i2 = k1; + int j2 = 0; + Block[] ablock; + int k2; + int l2; + int i3; + + for (ablock = new Block[13]; i1 != p_150079_2_ || j1 != p_150079_3_ || k1 != p_150079_4_; k1 = i3) + { + k2 = i1 - Facing.offsetsXForSide[p_150079_5_]; + l2 = j1 - Facing.offsetsYForSide[p_150079_5_]; + i3 = k1 - Facing.offsetsZForSide[p_150079_5_]; + Block block1 = p_150079_1_.getBlock(k2, l2, i3); + int j3 = p_150079_1_.getBlockMetadata(k2, l2, i3); + + if (block1 == this && k2 == p_150079_2_ && l2 == p_150079_3_ && i3 == p_150079_4_) + { + p_150079_1_.setBlock(i1, j1, k1, Blocks.piston_extension, p_150079_5_ | (this.isSticky ? 8 : 0), 4); + p_150079_1_.setTileEntity(i1, j1, k1, BlockPistonMoving.getTileEntity(Blocks.piston_head, p_150079_5_ | (this.isSticky ? 8 : 0), p_150079_5_, true, false)); + } + else + { + p_150079_1_.setBlock(i1, j1, k1, Blocks.piston_extension, j3, 4); + p_150079_1_.setTileEntity(i1, j1, k1, BlockPistonMoving.getTileEntity(block1, j3, p_150079_5_, true, false)); + } + + ablock[j2++] = block1; + i1 = k2; + j1 = l2; + } + + i1 = l1; + j1 = k3; + k1 = i2; + + for (j2 = 0; i1 != p_150079_2_ || j1 != p_150079_3_ || k1 != p_150079_4_; k1 = i3) + { + k2 = i1 - Facing.offsetsXForSide[p_150079_5_]; + l2 = j1 - Facing.offsetsYForSide[p_150079_5_]; + i3 = k1 - Facing.offsetsZForSide[p_150079_5_]; + p_150079_1_.notifyBlocksOfNeighborChange(k2, l2, i3, ablock[j2++]); + i1 = k2; + j1 = l2; + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonExtension.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonExtension.java new file mode 100644 index 0000000..ce1a10b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonExtension.java @@ -0,0 +1,265 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonExtension extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150088_a; + private static final String __OBFID = "CL_00000367"; + + public BlockPistonExtension() + { + super(Material.piston); + this.setStepSound(soundTypePiston); + this.setHardness(0.5F); + } + + @SideOnly(Side.CLIENT) + public void func_150086_a(IIcon p_150086_1_) + { + this.field_150088_a = p_150086_1_; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (player.capabilities.isCreativeMode) + { + int i1 = getDirectionMeta(meta); + Block block = worldIn.getBlock(x - Facing.offsetsXForSide[i1], y - Facing.offsetsYForSide[i1], z - Facing.offsetsZForSide[i1]); + + if (block == Blocks.piston || block == Blocks.sticky_piston) + { + worldIn.setBlockToAir(x - Facing.offsetsXForSide[i1], y - Facing.offsetsYForSide[i1], z - Facing.offsetsZForSide[i1]); + } + } + + super.onBlockHarvested(worldIn, x, y, z, meta, player); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + int i1 = Facing.oppositeSide[getDirectionMeta(meta)]; + x += Facing.offsetsXForSide[i1]; + y += Facing.offsetsYForSide[i1]; + z += Facing.offsetsZForSide[i1]; + Block block1 = worldIn.getBlock(x, y, z); + + if (block1 == Blocks.piston || block1 == Blocks.sticky_piston) + { + meta = worldIn.getBlockMetadata(x, y, z); + + if (BlockPistonBase.isExtended(meta)) + { + block1.dropBlockAsItem(worldIn, x, y, z, meta, 0); + worldIn.setBlockToAir(x, y, z); + } + } + } + + @SideOnly(Side.CLIENT) + public void func_150087_e() + { + this.field_150088_a = null; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + int k = getDirectionMeta(meta); + return side == k ? (this.field_150088_a != null ? this.field_150088_a : ((meta & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (k < 6 && side == Facing.oppositeSide[k] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 17; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + return false; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.25F; + float f1 = 0.375F; + float f2 = 0.625F; + float f3 = 0.25F; + float f4 = 0.75F; + + switch (getDirectionMeta(l)) + { + case 0: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + break; + case 1: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + break; + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + break; + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + break; + case 4: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + break; + case 5: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.25F; + + switch (getDirectionMeta(l)) + { + case 0: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); + break; + case 1: + this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + break; + case 2: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); + break; + case 3: + this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); + break; + case 4: + this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); + break; + case 5: + this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = getDirectionMeta(worldIn.getBlockMetadata(x, y, z)); + Block block1 = worldIn.getBlock(x - Facing.offsetsXForSide[l], y - Facing.offsetsYForSide[l], z - Facing.offsetsZForSide[l]); + + if (block1 != Blocks.piston && block1 != Blocks.sticky_piston) + { + worldIn.setBlockToAir(x, y, z); + } + else + { + block1.onNeighborBlockChange(worldIn, x - Facing.offsetsXForSide[l], y - Facing.offsetsYForSide[l], z - Facing.offsetsZForSide[l], neighbor); + } + } + + public static int getDirectionMeta(int p_150085_0_) + { + return MathHelper.clamp_int(p_150085_0_ & 7, 0, Facing.offsetsXForSide.length - 1); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + return (l & 8) != 0 ? Item.getItemFromBlock(Blocks.sticky_piston) : Item.getItemFromBlock(Blocks.piston); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonMoving.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonMoving.java new file mode 100644 index 0000000..69895d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPistonMoving.java @@ -0,0 +1,279 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPistonMoving extends BlockContainer +{ + private static final String __OBFID = "CL_00000368"; + + public BlockPistonMoving() + { + super(Material.piston); + this.setHardness(-1.0F); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return null; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) {} + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + + if (tileentity instanceof TileEntityPiston) + { + ((TileEntityPiston)tileentity).clearPistonTileEntity(); + } + else + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return false; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (!worldIn.isRemote && worldIn.getTileEntity(x, y, z) == null) + { + worldIn.setBlockToAir(x, y, z); + return true; + } + else + { + return false; + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + worldIn.getTileEntity(x, y, z); + } + } + + public static TileEntity getTileEntity(Block p_149962_0_, int p_149962_1_, int p_149962_2_, boolean p_149962_3_, boolean p_149962_4_) + { + return new TileEntityPiston(p_149962_0_, p_149962_1_, p_149962_2_, p_149962_3_, p_149962_4_); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + TileEntityPiston tileentitypiston = this.func_149963_e(worldIn, x, y, z); + + if (tileentitypiston == null) + { + return null; + } + else + { + float f = tileentitypiston.func_145860_a(0.0F); + + if (tileentitypiston.isExtending()) + { + f = 1.0F - f; + } + + return this.func_149964_a(worldIn, x, y, z, tileentitypiston.getStoredBlockID(), f, tileentitypiston.getPistonOrientation()); + } + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + TileEntityPiston tileentitypiston = this.func_149963_e(worldIn, x, y, z); + + if (tileentitypiston != null) + { + Block block = tileentitypiston.getStoredBlockID(); + + if (block == this || block.getMaterial() == Material.air) + { + return; + } + + block.setBlockBoundsBasedOnState(worldIn, x, y, z); + float f = tileentitypiston.func_145860_a(0.0F); + + if (tileentitypiston.isExtending()) + { + f = 1.0F - f; + } + + int l = tileentitypiston.getPistonOrientation(); + this.minX = block.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[l] * f); + this.minY = block.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[l] * f); + this.minZ = block.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[l] * f); + this.maxX = block.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[l] * f); + this.maxY = block.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[l] * f); + this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[l] * f); + } + } + + public AxisAlignedBB func_149964_a(World p_149964_1_, int p_149964_2_, int p_149964_3_, int p_149964_4_, Block p_149964_5_, float p_149964_6_, int p_149964_7_) + { + if (p_149964_5_ != this && p_149964_5_.getMaterial() != Material.air) + { + AxisAlignedBB axisalignedbb = p_149964_5_.getCollisionBoundingBoxFromPool(p_149964_1_, p_149964_2_, p_149964_3_, p_149964_4_); + + if (axisalignedbb == null) + { + return null; + } + else + { + if (Facing.offsetsXForSide[p_149964_7_] < 0) + { + axisalignedbb.minX -= (double)((float)Facing.offsetsXForSide[p_149964_7_] * p_149964_6_); + } + else + { + axisalignedbb.maxX -= (double)((float)Facing.offsetsXForSide[p_149964_7_] * p_149964_6_); + } + + if (Facing.offsetsYForSide[p_149964_7_] < 0) + { + axisalignedbb.minY -= (double)((float)Facing.offsetsYForSide[p_149964_7_] * p_149964_6_); + } + else + { + axisalignedbb.maxY -= (double)((float)Facing.offsetsYForSide[p_149964_7_] * p_149964_6_); + } + + if (Facing.offsetsZForSide[p_149964_7_] < 0) + { + axisalignedbb.minZ -= (double)((float)Facing.offsetsZForSide[p_149964_7_] * p_149964_6_); + } + else + { + axisalignedbb.maxZ -= (double)((float)Facing.offsetsZForSide[p_149964_7_] * p_149964_6_); + } + + return axisalignedbb; + } + } + else + { + return null; + } + } + + private TileEntityPiston func_149963_e(IBlockAccess p_149963_1_, int p_149963_2_, int p_149963_3_, int p_149963_4_) + { + TileEntity tileentity = p_149963_1_.getTileEntity(p_149963_2_, p_149963_3_, p_149963_4_); + return tileentity instanceof TileEntityPiston ? (TileEntityPiston)tileentity : null; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(0); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("piston_top_normal"); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + TileEntityPiston te = this.func_149963_e(world, x, y, z); + if (te != null) + return te.getStoredBlockID().getDrops(world, x, y, z, te.getBlockMetadata(), 0); + return new ArrayList(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPortal.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPortal.java new file mode 100644 index 0000000..b98d40a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPortal.java @@ -0,0 +1,449 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockPortal extends BlockBreakable +{ + public static final int[][] field_150001_a = new int[][] {new int[0], {3, 1}, {2, 0}}; + private static final String __OBFID = "CL_00000284"; + + public BlockPortal() + { + super("portal", Material.portal, false); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + super.updateTick(worldIn, x, y, z, random); + + if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getGameRuleBooleanValue("doMobSpawning") && random.nextInt(2000) < worldIn.difficultySetting.getDifficultyId()) + { + int l; + + for (l = y; !World.doesBlockHaveSolidTopSurface(worldIn, x, l, z) && l > 0; --l) + { + ; + } + + if (l > 0 && !worldIn.getBlock(x, l + 1, z).isNormalCube()) + { + Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, 57, (double)x + 0.5D, (double)l + 1.1D, (double)z + 0.5D); + + if (entity != null) + { + entity.timeUntilPortal = entity.getPortalCooldown(); + } + } + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = func_149999_b(worldIn.getBlockMetadata(x, y, z)); + + if (l == 0) + { + if (worldIn.getBlock(x - 1, y, z) != this && worldIn.getBlock(x + 1, y, z) != this) + { + l = 2; + } + else + { + l = 1; + } + + if (worldIn instanceof World && !((World)worldIn).isRemote) + { + ((World)worldIn).setBlockMetadataWithNotify(x, y, z, l, 2); + } + } + + float f = 0.125F; + float f1 = 0.125F; + + if (l == 1) + { + f = 0.5F; + } + + if (l == 2) + { + f1 = 0.5F; + } + + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean func_150000_e(World p_150000_1_, int p_150000_2_, int p_150000_3_, int p_150000_4_) + { + BlockPortal.Size size = new BlockPortal.Size(p_150000_1_, p_150000_2_, p_150000_3_, p_150000_4_, 1); + BlockPortal.Size size1 = new BlockPortal.Size(p_150000_1_, p_150000_2_, p_150000_3_, p_150000_4_, 2); + + if (size.func_150860_b() && size.field_150864_e == 0) + { + size.func_150859_c(); + return true; + } + else if (size1.func_150860_b() && size1.field_150864_e == 0) + { + size1.func_150859_c(); + return true; + } + else + { + return false; + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = func_149999_b(worldIn.getBlockMetadata(x, y, z)); + BlockPortal.Size size = new BlockPortal.Size(worldIn, x, y, z, 1); + BlockPortal.Size size1 = new BlockPortal.Size(worldIn, x, y, z, 2); + + if (l == 1 && (!size.func_150860_b() || size.field_150864_e < size.field_150868_h * size.field_150862_g)) + { + worldIn.setBlock(x, y, z, Blocks.air); + } + else if (l == 2 && (!size1.func_150860_b() || size1.field_150864_e < size1.field_150868_h * size1.field_150862_g)) + { + worldIn.setBlock(x, y, z, Blocks.air); + } + else if (l == 0 && !size.func_150860_b() && !size1.func_150860_b()) + { + worldIn.setBlock(x, y, z, Blocks.air); + } + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = 0; + + if (worldIn.getBlock(x, y, z) == this) + { + i1 = func_149999_b(worldIn.getBlockMetadata(x, y, z)); + + if (i1 == 0) + { + return false; + } + + if (i1 == 2 && side != 5 && side != 4) + { + return false; + } + + if (i1 == 1 && side != 3 && side != 2) + { + return false; + } + } + + boolean flag = worldIn.getBlock(x - 1, y, z) == this && worldIn.getBlock(x - 2, y, z) != this; + boolean flag1 = worldIn.getBlock(x + 1, y, z) == this && worldIn.getBlock(x + 2, y, z) != this; + boolean flag2 = worldIn.getBlock(x, y, z - 1) == this && worldIn.getBlock(x, y, z - 2) != this; + boolean flag3 = worldIn.getBlock(x, y, z + 1) == this && worldIn.getBlock(x, y, z + 2) != this; + boolean flag4 = flag || flag1 || i1 == 1; + boolean flag5 = flag2 || flag3 || i1 == 2; + return flag4 && side == 4 ? true : (flag4 && side == 5 ? true : (flag5 && side == 2 ? true : flag5 && side == 3)); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (entityIn.ridingEntity == null && entityIn.riddenByEntity == null) + { + entityIn.setInPortal(); + } + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (random.nextInt(100) == 0) + { + worldIn.playSound((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "portal.portal", 0.5F, random.nextFloat() * 0.4F + 0.8F, false); + } + + for (int l = 0; l < 4; ++l) + { + double d0 = (double)((float)x + random.nextFloat()); + double d1 = (double)((float)y + random.nextFloat()); + double d2 = (double)((float)z + random.nextFloat()); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + int i1 = random.nextInt(2) * 2 - 1; + d3 = ((double)random.nextFloat() - 0.5D) * 0.5D; + d4 = ((double)random.nextFloat() - 0.5D) * 0.5D; + d5 = ((double)random.nextFloat() - 0.5D) * 0.5D; + + if (worldIn.getBlock(x - 1, y, z) != this && worldIn.getBlock(x + 1, y, z) != this) + { + d0 = (double)x + 0.5D + 0.25D * (double)i1; + d3 = (double)(random.nextFloat() * 2.0F * (float)i1); + } + else + { + d2 = (double)z + 0.5D + 0.25D * (double)i1; + d5 = (double)(random.nextFloat() * 2.0F * (float)i1); + } + + worldIn.spawnParticle("portal", d0, d1, d2, d3, d4, d5); + } + } + + public static int func_149999_b(int p_149999_0_) + { + return p_149999_0_ & 3; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemById(0); + } + + public static class Size + { + private final World field_150867_a; + private final int field_150865_b; + private final int field_150866_c; + private final int field_150863_d; + private int field_150864_e = 0; + private ChunkCoordinates field_150861_f; + private int field_150862_g; + private int field_150868_h; + private static final String __OBFID = "CL_00000285"; + + public Size(World p_i45415_1_, int p_i45415_2_, int p_i45415_3_, int p_i45415_4_, int p_i45415_5_) + { + this.field_150867_a = p_i45415_1_; + this.field_150865_b = p_i45415_5_; + this.field_150863_d = BlockPortal.field_150001_a[p_i45415_5_][0]; + this.field_150866_c = BlockPortal.field_150001_a[p_i45415_5_][1]; + + for (int i1 = p_i45415_3_; p_i45415_3_ > i1 - 21 && p_i45415_3_ > 0 && this.func_150857_a(p_i45415_1_.getBlock(p_i45415_2_, p_i45415_3_ - 1, p_i45415_4_)); --p_i45415_3_) + { + ; + } + + int j1 = this.func_150853_a(p_i45415_2_, p_i45415_3_, p_i45415_4_, this.field_150863_d) - 1; + + if (j1 >= 0) + { + this.field_150861_f = new ChunkCoordinates(p_i45415_2_ + j1 * Direction.offsetX[this.field_150863_d], p_i45415_3_, p_i45415_4_ + j1 * Direction.offsetZ[this.field_150863_d]); + this.field_150868_h = this.func_150853_a(this.field_150861_f.posX, this.field_150861_f.posY, this.field_150861_f.posZ, this.field_150866_c); + + if (this.field_150868_h < 2 || this.field_150868_h > 21) + { + this.field_150861_f = null; + this.field_150868_h = 0; + } + } + + if (this.field_150861_f != null) + { + this.field_150862_g = this.func_150858_a(); + } + } + + protected int func_150853_a(int p_150853_1_, int p_150853_2_, int p_150853_3_, int p_150853_4_) + { + int j1 = Direction.offsetX[p_150853_4_]; + int k1 = Direction.offsetZ[p_150853_4_]; + int i1; + Block block; + + for (i1 = 0; i1 < 22; ++i1) + { + block = this.field_150867_a.getBlock(p_150853_1_ + j1 * i1, p_150853_2_, p_150853_3_ + k1 * i1); + + if (!this.func_150857_a(block)) + { + break; + } + + Block block1 = this.field_150867_a.getBlock(p_150853_1_ + j1 * i1, p_150853_2_ - 1, p_150853_3_ + k1 * i1); + + if (block1 != Blocks.obsidian) + { + break; + } + } + + block = this.field_150867_a.getBlock(p_150853_1_ + j1 * i1, p_150853_2_, p_150853_3_ + k1 * i1); + return block == Blocks.obsidian ? i1 : 0; + } + + protected int func_150858_a() + { + int i; + int j; + int k; + int l; + label56: + + for (this.field_150862_g = 0; this.field_150862_g < 21; ++this.field_150862_g) + { + i = this.field_150861_f.posY + this.field_150862_g; + + for (j = 0; j < this.field_150868_h; ++j) + { + k = this.field_150861_f.posX + j * Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]]; + l = this.field_150861_f.posZ + j * Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]; + Block block = this.field_150867_a.getBlock(k, i, l); + + if (!this.func_150857_a(block)) + { + break label56; + } + + if (block == Blocks.portal) + { + ++this.field_150864_e; + } + + if (j == 0) + { + block = this.field_150867_a.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][0]], i, l + Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][0]]); + + if (block != Blocks.obsidian) + { + break label56; + } + } + else if (j == this.field_150868_h - 1) + { + block = this.field_150867_a.getBlock(k + Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]], i, l + Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]); + + if (block != Blocks.obsidian) + { + break label56; + } + } + } + } + + for (i = 0; i < this.field_150868_h; ++i) + { + j = this.field_150861_f.posX + i * Direction.offsetX[BlockPortal.field_150001_a[this.field_150865_b][1]]; + k = this.field_150861_f.posY + this.field_150862_g; + l = this.field_150861_f.posZ + i * Direction.offsetZ[BlockPortal.field_150001_a[this.field_150865_b][1]]; + + if (this.field_150867_a.getBlock(j, k, l) != Blocks.obsidian) + { + this.field_150862_g = 0; + break; + } + } + + if (this.field_150862_g <= 21 && this.field_150862_g >= 3) + { + return this.field_150862_g; + } + else + { + this.field_150861_f = null; + this.field_150868_h = 0; + this.field_150862_g = 0; + return 0; + } + } + + protected boolean func_150857_a(Block p_150857_1_) + { + return p_150857_1_.blockMaterial == Material.air || p_150857_1_ == Blocks.fire || p_150857_1_ == Blocks.portal; + } + + public boolean func_150860_b() + { + return this.field_150861_f != null && this.field_150868_h >= 2 && this.field_150868_h <= 21 && this.field_150862_g >= 3 && this.field_150862_g <= 21; + } + + public void func_150859_c() + { + for (int i = 0; i < this.field_150868_h; ++i) + { + int j = this.field_150861_f.posX + Direction.offsetX[this.field_150866_c] * i; + int k = this.field_150861_f.posZ + Direction.offsetZ[this.field_150866_c] * i; + + for (int l = 0; l < this.field_150862_g; ++l) + { + int i1 = this.field_150861_f.posY + l; + this.field_150867_a.setBlock(j, i1, k, Blocks.portal, this.field_150865_b, 2); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPotato.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPotato.java new file mode 100644 index 0000000..dbd3909 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPotato.java @@ -0,0 +1,77 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockPotato extends BlockCrops +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_149869_a; + private static final String __OBFID = "CL_00000286"; + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta < 7) + { + if (meta == 6) + { + meta = 5; + } + + return this.field_149869_a[meta >> 1]; + } + else + { + return this.field_149869_a[3]; + } + } + + protected Item func_149866_i() + { + return Items.potato; + } + + protected Item func_149865_P() + { + return Items.potato; + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); + if (metadata >= 7 && world.rand.nextInt(50) == 0) + ret.add(new ItemStack(Items.poisonous_potato)); + return ret; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149869_a = new IIcon[4]; + + for (int i = 0; i < this.field_149869_a.length; ++i) + { + this.field_149869_a[i] = reg.registerIcon(this.getTextureName() + "_stage_" + i); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlate.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlate.java new file mode 100644 index 0000000..0f6f285 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlate.java @@ -0,0 +1,77 @@ +package net.minecraft.block; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class BlockPressurePlate extends BlockBasePressurePlate +{ + private BlockPressurePlate.Sensitivity field_150069_a; + private static final String __OBFID = "CL_00000289"; + + protected BlockPressurePlate(String p_i45418_1_, Material p_i45418_2_, BlockPressurePlate.Sensitivity p_i45418_3_) + { + super(p_i45418_1_, p_i45418_2_); + this.field_150069_a = p_i45418_3_; + } + + protected int func_150066_d(int p_150066_1_) + { + return p_150066_1_ > 0 ? 1 : 0; + } + + protected int func_150060_c(int p_150060_1_) + { + return p_150060_1_ == 1 ? 15 : 0; + } + + protected int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_) + { + List list = null; + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.everything) + { + list = p_150065_1_.getEntitiesWithinAABBExcludingEntity((Entity)null, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.mobs) + { + list = p_150065_1_.getEntitiesWithinAABB(EntityLivingBase.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (this.field_150069_a == BlockPressurePlate.Sensitivity.players) + { + list = p_150065_1_.getEntitiesWithinAABB(EntityPlayer.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)); + } + + if (list != null && !list.isEmpty()) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + + if (!entity.doesEntityNotTriggerPressurePlate()) + { + return 15; + } + } + } + + return 0; + } + + public static enum Sensitivity + { + everything, + mobs, + players; + + private static final String __OBFID = "CL_00000290"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlateWeighted.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlateWeighted.java new file mode 100644 index 0000000..7dc83ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPressurePlateWeighted.java @@ -0,0 +1,51 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockPressurePlateWeighted extends BlockBasePressurePlate +{ + private final int field_150068_a; + private static final String __OBFID = "CL_00000334"; + + protected BlockPressurePlateWeighted(String p_i45436_1_, Material p_i45436_2_, int p_i45436_3_) + { + super(p_i45436_1_, p_i45436_2_); + this.field_150068_a = p_i45436_3_; + } + + protected int func_150065_e(World p_150065_1_, int p_150065_2_, int p_150065_3_, int p_150065_4_) + { + int l = Math.min(p_150065_1_.getEntitiesWithinAABB(Entity.class, this.func_150061_a(p_150065_2_, p_150065_3_, p_150065_4_)).size(), this.field_150068_a); + + if (l <= 0) + { + return 0; + } + else + { + float f = (float)Math.min(this.field_150068_a, l) / (float)this.field_150068_a; + return MathHelper.ceiling_float_int(f * 15.0F); + } + } + + protected int func_150060_c(int p_150060_1_) + { + return p_150060_1_; + } + + protected int func_150066_d(int p_150066_1_) + { + return p_150066_1_; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 10; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockPumpkin.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPumpkin.java new file mode 100644 index 0000000..cbc43df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockPumpkin.java @@ -0,0 +1,144 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlockPumpkin extends BlockDirectional +{ + private boolean field_149985_a; + @SideOnly(Side.CLIENT) + private IIcon field_149984_b; + @SideOnly(Side.CLIENT) + private IIcon field_149986_M; + private static final String __OBFID = "CL_00000291"; + + protected BlockPumpkin(boolean p_i45419_1_) + { + super(Material.gourd); + this.setTickRandomly(true); + this.field_149985_a = p_i45419_1_; + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_149984_b : (side == 0 ? this.field_149984_b : (meta == 2 && side == 2 ? this.field_149986_M : (meta == 3 && side == 5 ? this.field_149986_M : (meta == 0 && side == 3 ? this.field_149986_M : (meta == 1 && side == 4 ? this.field_149986_M : this.blockIcon))))); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + + if (worldIn.getBlock(x, y - 1, z) == Blocks.snow && worldIn.getBlock(x, y - 2, z) == Blocks.snow) + { + if (!worldIn.isRemote) + { + worldIn.setBlock(x, y, z, getBlockById(0), 0, 2); + worldIn.setBlock(x, y - 1, z, getBlockById(0), 0, 2); + worldIn.setBlock(x, y - 2, z, getBlockById(0), 0, 2); + EntitySnowman entitysnowman = new EntitySnowman(worldIn); + entitysnowman.setLocationAndAngles((double)x + 0.5D, (double)y - 1.95D, (double)z + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysnowman); + worldIn.notifyBlockChange(x, y, z, getBlockById(0)); + worldIn.notifyBlockChange(x, y - 1, z, getBlockById(0)); + worldIn.notifyBlockChange(x, y - 2, z, getBlockById(0)); + } + + for (int i1 = 0; i1 < 120; ++i1) + { + worldIn.spawnParticle("snowshovel", (double)x + worldIn.rand.nextDouble(), (double)(y - 2) + worldIn.rand.nextDouble() * 2.5D, (double)z + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + } + else if (worldIn.getBlock(x, y - 1, z) == Blocks.iron_block && worldIn.getBlock(x, y - 2, z) == Blocks.iron_block) + { + boolean flag = worldIn.getBlock(x - 1, y - 1, z) == Blocks.iron_block && worldIn.getBlock(x + 1, y - 1, z) == Blocks.iron_block; + boolean flag1 = worldIn.getBlock(x, y - 1, z - 1) == Blocks.iron_block && worldIn.getBlock(x, y - 1, z + 1) == Blocks.iron_block; + + if (flag || flag1) + { + worldIn.setBlock(x, y, z, getBlockById(0), 0, 2); + worldIn.setBlock(x, y - 1, z, getBlockById(0), 0, 2); + worldIn.setBlock(x, y - 2, z, getBlockById(0), 0, 2); + + if (flag) + { + worldIn.setBlock(x - 1, y - 1, z, getBlockById(0), 0, 2); + worldIn.setBlock(x + 1, y - 1, z, getBlockById(0), 0, 2); + } + else + { + worldIn.setBlock(x, y - 1, z - 1, getBlockById(0), 0, 2); + worldIn.setBlock(x, y - 1, z + 1, getBlockById(0), 0, 2); + } + + EntityIronGolem entityirongolem = new EntityIronGolem(worldIn); + entityirongolem.setPlayerCreated(true); + entityirongolem.setLocationAndAngles((double)x + 0.5D, (double)y - 1.95D, (double)z + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entityirongolem); + + for (int l = 0; l < 120; ++l) + { + worldIn.spawnParticle("snowballpoof", (double)x + worldIn.rand.nextDouble(), (double)(y - 2) + worldIn.rand.nextDouble() * 3.9D, (double)z + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + worldIn.notifyBlockChange(x, y, z, getBlockById(0)); + worldIn.notifyBlockChange(x, y - 1, z, getBlockById(0)); + worldIn.notifyBlockChange(x, y - 2, z, getBlockById(0)); + + if (flag) + { + worldIn.notifyBlockChange(x - 1, y - 1, z, getBlockById(0)); + worldIn.notifyBlockChange(x + 1, y - 1, z, getBlockById(0)); + } + else + { + worldIn.notifyBlockChange(x, y - 1, z - 1, getBlockById(0)); + worldIn.notifyBlockChange(x, y - 1, z + 1, getBlockById(0)); + } + } + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.getBlock(x, y, z).isReplaceable(worldIn, x, y, z) && World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149986_M = reg.registerIcon(this.getTextureName() + "_face_" + (this.field_149985_a ? "on" : "off")); + this.field_149984_b = reg.registerIcon(this.getTextureName() + "_top"); + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockQuartz.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockQuartz.java new file mode 100644 index 0000000..965176c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockQuartz.java @@ -0,0 +1,161 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockQuartz extends Block +{ + public static final String[] field_150191_a = new String[] {"default", "chiseled", "lines"}; + private static final String[] field_150189_b = new String[] {"side", "chiseled", "lines", null, null}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150192_M; + @SideOnly(Side.CLIENT) + private IIcon field_150193_N; + @SideOnly(Side.CLIENT) + private IIcon field_150194_O; + @SideOnly(Side.CLIENT) + private IIcon field_150190_P; + @SideOnly(Side.CLIENT) + private IIcon field_150188_Q; + private static final String __OBFID = "CL_00000292"; + + public BlockQuartz() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta != 2 && meta != 3 && meta != 4) + { + if (side != 1 && (side != 0 || meta != 1)) + { + if (side == 0) + { + return this.field_150188_Q; + } + else + { + if (meta < 0 || meta >= this.field_150192_M.length) + { + meta = 0; + } + + return this.field_150192_M[meta]; + } + } + else + { + return meta == 1 ? this.field_150193_N : this.field_150190_P; + } + } + else + { + return meta == 2 && (side == 1 || side == 0) ? this.field_150194_O : (meta == 3 && (side == 5 || side == 4) ? this.field_150194_O : (meta == 4 && (side == 2 || side == 3) ? this.field_150194_O : this.field_150192_M[meta])); + } + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + if (meta == 2) + { + switch (side) + { + case 0: + case 1: + meta = 2; + break; + case 2: + case 3: + meta = 4; + break; + case 4: + case 5: + meta = 3; + } + } + + return meta; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta != 3 && meta != 4 ? meta : 2; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return meta != 3 && meta != 4 ? super.createStackedBlock(meta) : new ItemStack(Item.getItemFromBlock(this), 1, 2); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 39; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150192_M = new IIcon[field_150189_b.length]; + + for (int i = 0; i < this.field_150192_M.length; ++i) + { + if (field_150189_b[i] == null) + { + this.field_150192_M[i] = this.field_150192_M[i - 1]; + } + else + { + this.field_150192_M[i] = reg.registerIcon(this.getTextureName() + "_" + field_150189_b[i]); + } + } + + this.field_150190_P = reg.registerIcon(this.getTextureName() + "_" + "top"); + this.field_150193_N = reg.registerIcon(this.getTextureName() + "_" + "chiseled_top"); + this.field_150194_O = reg.registerIcon(this.getTextureName() + "_" + "lines_top"); + this.field_150188_Q = reg.registerIcon(this.getTextureName() + "_" + "bottom"); + } + + public MapColor getMapColor(int meta) + { + return MapColor.quartzColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRail.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRail.java new file mode 100644 index 0000000..bd4a8b4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRail.java @@ -0,0 +1,43 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockRail extends BlockRailBase +{ + @SideOnly(Side.CLIENT) + private IIcon field_150056_b; + private static final String __OBFID = "CL_00000293"; + + protected BlockRail() + { + super(false); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return meta >= 6 ? this.field_150056_b : this.blockIcon; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + this.field_150056_b = reg.registerIcon(this.getTextureName() + "_turned"); + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) + { + if (p_150048_7_.canProvidePower() && (new BlockRailBase.Rail(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_)).func_150650_a() == 3) + { + this.func_150052_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, false); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailBase.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailBase.java new file mode 100644 index 0000000..3f9d8fc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailBase.java @@ -0,0 +1,772 @@ +package net.minecraft.block; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRailBase extends Block +{ + protected final boolean field_150053_a; + private static final String __OBFID = "CL_00000195"; + + public static final boolean func_150049_b_(World p_150049_0_, int p_150049_1_, int p_150049_2_, int p_150049_3_) + { + return func_150051_a(p_150049_0_.getBlock(p_150049_1_, p_150049_2_, p_150049_3_)); + } + + public static final boolean func_150051_a(Block p_150051_0_) + { + return p_150051_0_ instanceof BlockRailBase; + } + + protected BlockRailBase(boolean p_i45389_1_) + { + super(Material.circuits); + this.field_150053_a = p_i45389_1_; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /** + * Returns true if the block is power related rail. + */ + public boolean isPowered() + { + return this.field_150053_a; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.collisionRayTrace(worldIn, x, y, z, startVec, endVec); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l >= 2 && l <= 5) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return renderType; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (!worldIn.isRemote) + { + this.func_150052_a(worldIn, x, y, z, true); + + if (this.field_150053_a) + { + this.onNeighborBlockChange(worldIn, x, y, z, this); + } + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = l; + + if (this.field_150053_a) + { + i1 = l & 7; + } + + boolean flag = false; + + if (!World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z)) + { + flag = true; + } + + if (i1 == 2 && !World.doesBlockHaveSolidTopSurface(worldIn, x + 1, y, z)) + { + flag = true; + } + + if (i1 == 3 && !World.doesBlockHaveSolidTopSurface(worldIn, x - 1, y, z)) + { + flag = true; + } + + if (i1 == 4 && !World.doesBlockHaveSolidTopSurface(worldIn, x, y, z - 1)) + { + flag = true; + } + + if (i1 == 5 && !World.doesBlockHaveSolidTopSurface(worldIn, x, y, z + 1)) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + else + { + this.func_150048_a(worldIn, x, y, z, l, i1, neighbor); + } + } + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) {} + + protected void func_150052_a(World p_150052_1_, int p_150052_2_, int p_150052_3_, int p_150052_4_, boolean p_150052_5_) + { + if (!p_150052_1_.isRemote) + { + (new BlockRailBase.Rail(p_150052_1_, p_150052_2_, p_150052_3_, p_150052_4_)).func_150655_a(p_150052_1_.isBlockIndirectlyGettingPowered(p_150052_2_, p_150052_3_, p_150052_4_), p_150052_5_); + } + } + + /** + * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility + * and stop pistons + */ + public int getMobilityFlag() + { + return 0; + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + int i1 = meta; + + if (this.field_150053_a) + { + i1 = meta & 7; + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + + if (i1 == 2 || i1 == 3 || i1 == 4 || i1 == 5) + { + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, blockBroken); + } + + if (this.field_150053_a) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z, blockBroken); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, blockBroken); + } + } + + /* ======================================== FORGE START =====================================*/ + /** + * Return true if the rail can make corners. + * Used by placement logic. + * @param world The world. + * @param x The rail X coordinate. + * @param y The rail Y coordinate. + * @param z The rail Z coordinate. + * @return True if the rail can make corners. + */ + public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z) + { + return !isPowered(); + } + + /** + * Returns true if the rail can make up and down slopes. + * Used by placement logic. + * @param world The world. + * @param x The rail X coordinate. + * @param y The rail Y coordinate. + * @param z The rail Z coordinate. + * @return True if the rail can make slopes. + */ + public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z) + { + return true; + } + + /** + * Return the rail's metadata (without the power bit if the rail uses one). + * Can be used to make the cart think the rail something other than it is, + * for example when making diamond junctions or switches. + * The cart parameter will often be null unless it it called from EntityMinecart. + * + * Valid rail metadata is defined as follows: + * 0x0: flat track going North-South + * 0x1: flat track going West-East + * 0x2: track ascending to the East + * 0x3: track ascending to the West + * 0x4: track ascending to the North + * 0x5: track ascending to the South + * 0x6: WestNorth corner (connecting East and South) + * 0x7: EastNorth corner (connecting West and South) + * 0x8: EastSouth corner (connecting West and North) + * 0x9: WestSouth corner (connecting East and North) + * + * @param world The world. + * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. + * @param y The rail X coordinate. + * @param x The rail Y coordinate. + * @param z The rail Z coordinate. + * @return The metadata. + */ + public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if(isPowered()) + { + meta = meta & 7; + } + return meta; + } + + /** + * Returns the max speed of the rail at the specified position. + * @param world The world. + * @param cart The cart on the rail, may be null. + * @param x The rail X coordinate. + * @param y The rail Y coordinate. + * @param z The rail Z coordinate. + * @return The max speed of the current rail. + */ + public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) + { + return 0.4f; + } + + /** + * This function is called by any minecart that passes over this rail. + * It is called once per update tick that the minecart is on the rail. + * @param world The world. + * @param cart The cart on the rail. + * @param y The rail X coordinate. + * @param x The rail Y coordinate. + * @param z The rail Z coordinate. + */ + public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z) + { + } + + /** + * Forge: Moved render type to a field and a setter. + * This allows for a mod to change the render type + * for vanilla rails, and any mod rails that extend + * this class. + */ + private int renderType = 9; + + public void setRenderType(int value) + { + renderType = value; + } + /* ======================================== FORGE END =====================================*/ + + public class Rail + { + private World field_150660_b; + private int field_150661_c; + private int field_150658_d; + private int field_150659_e; + private final boolean field_150656_f; + private List field_150657_g = new ArrayList(); + private static final String __OBFID = "CL_00000196"; + private final boolean canMakeSlopes; + + public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_) + { + this.field_150660_b = p_i45388_2_; + this.field_150661_c = p_i45388_3_; + this.field_150658_d = p_i45388_4_; + this.field_150659_e = p_i45388_5_; + BlockRailBase block = (BlockRailBase)p_i45388_2_.getBlock(p_i45388_3_, p_i45388_4_, p_i45388_5_); + int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_); + this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); + canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); + this.func_150648_a(l); + } + + private void func_150648_a(int p_150648_1_) + { + this.field_150657_g.clear(); + + if (p_150648_1_ == 0) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } + else if (p_150648_1_ == 1) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + } + else if (p_150648_1_ == 2) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)); + } + else if (p_150648_1_ == 3) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + } + else if (p_150648_1_ == 4) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } + else if (p_150648_1_ == 5) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)); + } + else if (p_150648_1_ == 6) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } + else if (p_150648_1_ == 7) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)); + } + else if (p_150648_1_ == 8) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + } + else if (p_150648_1_ == 9) + { + this.field_150657_g.add(new ChunkPosition(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)); + this.field_150657_g.add(new ChunkPosition(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)); + } + } + + private void func_150651_b() + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + BlockRailBase.Rail rail = this.func_150654_a((ChunkPosition)this.field_150657_g.get(i)); + + if (rail != null && rail.func_150653_a(this)) + { + this.field_150657_g.set(i, new ChunkPosition(rail.field_150661_c, rail.field_150658_d, rail.field_150659_e)); + } + else + { + this.field_150657_g.remove(i--); + } + } + } + + private boolean func_150646_a(int p_150646_1_, int p_150646_2_, int p_150646_3_) + { + return BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_, p_150646_3_) ? true : (BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_ + 1, p_150646_3_) ? true : BlockRailBase.func_150049_b_(this.field_150660_b, p_150646_1_, p_150646_2_ - 1, p_150646_3_)); + } + + private BlockRailBase.Rail func_150654_a(ChunkPosition p_150654_1_) + { + return BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY, p_150654_1_.chunkPosZ) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY, p_150654_1_.chunkPosZ) : (BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY + 1, p_150654_1_.chunkPosZ) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY + 1, p_150654_1_.chunkPosZ) : (BlockRailBase.func_150049_b_(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY - 1, p_150654_1_.chunkPosZ) ? BlockRailBase.this.new Rail(this.field_150660_b, p_150654_1_.chunkPosX, p_150654_1_.chunkPosY - 1, p_150654_1_.chunkPosZ) : null)); + } + + private boolean func_150653_a(BlockRailBase.Rail p_150653_1_) + { + for (int i = 0; i < this.field_150657_g.size(); ++i) + { + ChunkPosition chunkposition = (ChunkPosition)this.field_150657_g.get(i); + + if (chunkposition.chunkPosX == p_150653_1_.field_150661_c && chunkposition.chunkPosZ == p_150653_1_.field_150659_e) + { + return true; + } + } + + return false; + } + + private boolean func_150652_b(int p_150652_1_, int p_150652_2_, int p_150652_3_) + { + for (int l = 0; l < this.field_150657_g.size(); ++l) + { + ChunkPosition chunkposition = (ChunkPosition)this.field_150657_g.get(l); + + if (chunkposition.chunkPosX == p_150652_1_ && chunkposition.chunkPosZ == p_150652_3_) + { + return true; + } + } + + return false; + } + + protected int func_150650_a() + { + int i = 0; + + if (this.func_150646_a(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1)) + { + ++i; + } + + if (this.func_150646_a(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1)) + { + ++i; + } + + if (this.func_150646_a(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e)) + { + ++i; + } + + if (this.func_150646_a(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e)) + { + ++i; + } + + return i; + } + + private boolean func_150649_b(BlockRailBase.Rail p_150649_1_) + { + return this.func_150653_a(p_150649_1_) ? true : (this.field_150657_g.size() == 2 ? false : (this.field_150657_g.isEmpty() ? true : true)); + } + + private void func_150645_c(BlockRailBase.Rail p_150645_1_) + { + this.field_150657_g.add(new ChunkPosition(p_150645_1_.field_150661_c, p_150645_1_.field_150658_d, p_150645_1_.field_150659_e)); + boolean flag = this.func_150652_b(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1); + boolean flag1 = this.func_150652_b(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1); + boolean flag2 = this.func_150652_b(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e); + boolean flag3 = this.func_150652_b(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e); + byte b0 = -1; + + if (flag || flag1) + { + b0 = 0; + } + + if (flag2 || flag3) + { + b0 = 1; + } + + if (!this.field_150656_f) + { + if (flag1 && flag3 && !flag && !flag2) + { + b0 = 6; + } + + if (flag1 && flag2 && !flag && !flag3) + { + b0 = 7; + } + + if (flag && flag2 && !flag1 && !flag3) + { + b0 = 8; + } + + if (flag && flag3 && !flag1 && !flag2) + { + b0 = 9; + } + } + + if (b0 == 0 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) + { + b0 = 4; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)) + { + b0 = 5; + } + } + + if (b0 == 1 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) + { + b0 = 2; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)) + { + b0 = 3; + } + } + + if (b0 < 0) + { + b0 = 0; + } + + int i = b0; + + if (this.field_150656_f) + { + i = this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) & 8 | b0; + } + + this.field_150660_b.setBlockMetadataWithNotify(this.field_150661_c, this.field_150658_d, this.field_150659_e, i, 3); + } + + private boolean func_150647_c(int p_150647_1_, int p_150647_2_, int p_150647_3_) + { + BlockRailBase.Rail rail = this.func_150654_a(new ChunkPosition(p_150647_1_, p_150647_2_, p_150647_3_)); + + if (rail == null) + { + return false; + } + else + { + rail.func_150651_b(); + return rail.func_150649_b(this); + } + } + + public void func_150655_a(boolean p_150655_1_, boolean p_150655_2_) + { + boolean flag2 = this.func_150647_c(this.field_150661_c, this.field_150658_d, this.field_150659_e - 1); + boolean flag3 = this.func_150647_c(this.field_150661_c, this.field_150658_d, this.field_150659_e + 1); + boolean flag4 = this.func_150647_c(this.field_150661_c - 1, this.field_150658_d, this.field_150659_e); + boolean flag5 = this.func_150647_c(this.field_150661_c + 1, this.field_150658_d, this.field_150659_e); + byte b0 = -1; + + if ((flag2 || flag3) && !flag4 && !flag5) + { + b0 = 0; + } + + if ((flag4 || flag5) && !flag2 && !flag3) + { + b0 = 1; + } + + if (!this.field_150656_f) + { + if (flag3 && flag5 && !flag2 && !flag4) + { + b0 = 6; + } + + if (flag3 && flag4 && !flag2 && !flag5) + { + b0 = 7; + } + + if (flag2 && flag4 && !flag3 && !flag5) + { + b0 = 8; + } + + if (flag2 && flag5 && !flag3 && !flag4) + { + b0 = 9; + } + } + + if (b0 == -1) + { + if (flag2 || flag3) + { + b0 = 0; + } + + if (flag4 || flag5) + { + b0 = 1; + } + + if (!this.field_150656_f) + { + if (p_150655_1_) + { + if (flag3 && flag5) + { + b0 = 6; + } + + if (flag4 && flag3) + { + b0 = 7; + } + + if (flag5 && flag2) + { + b0 = 9; + } + + if (flag2 && flag4) + { + b0 = 8; + } + } + else + { + if (flag2 && flag4) + { + b0 = 8; + } + + if (flag5 && flag2) + { + b0 = 9; + } + + if (flag4 && flag3) + { + b0 = 7; + } + + if (flag3 && flag5) + { + b0 = 6; + } + } + } + } + + if (b0 == 0 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) + { + b0 = 4; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e + 1)) + { + b0 = 5; + } + } + + if (b0 == 1 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) + { + b0 = 2; + } + + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c - 1, this.field_150658_d + 1, this.field_150659_e)) + { + b0 = 3; + } + } + + if (b0 < 0) + { + b0 = 0; + } + + this.func_150648_a(b0); + int i = b0; + + if (this.field_150656_f) + { + i = this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) & 8 | b0; + } + + if (p_150655_2_ || this.field_150660_b.getBlockMetadata(this.field_150661_c, this.field_150658_d, this.field_150659_e) != i) + { + this.field_150660_b.setBlockMetadataWithNotify(this.field_150661_c, this.field_150658_d, this.field_150659_e, i, 3); + + for (int j = 0; j < this.field_150657_g.size(); ++j) + { + BlockRailBase.Rail rail = this.func_150654_a((ChunkPosition)this.field_150657_g.get(j)); + + if (rail != null) + { + rail.func_150651_b(); + + if (rail.func_150649_b(this)) + { + rail.func_150645_c(this); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailDetector.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailDetector.java new file mode 100644 index 0000000..d1fc5f9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailDetector.java @@ -0,0 +1,186 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRailDetector extends BlockRailBase +{ + @SideOnly(Side.CLIENT) + private IIcon[] field_150055_b; + private static final String __OBFID = "CL_00000225"; + + public BlockRailDetector() + { + super(true); + this.setTickRandomly(true); + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 20; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if ((l & 8) == 0) + { + this.func_150054_a(worldIn, x, y, z, l); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if ((l & 8) != 0) + { + this.func_150054_a(worldIn, x, y, z, l); + } + } + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return (worldIn.getBlockMetadata(x, y, z) & 8) != 0 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return (worldIn.getBlockMetadata(x, y, z) & 8) == 0 ? 0 : (side == 1 ? 15 : 0); + } + + private void func_150054_a(World p_150054_1_, int p_150054_2_, int p_150054_3_, int p_150054_4_, int p_150054_5_) + { + boolean flag = (p_150054_5_ & 8) != 0; + boolean flag1 = false; + float f = 0.125F; + List list = p_150054_1_.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)p_150054_2_ + f), (double)p_150054_3_, (double)((float)p_150054_4_ + f), (double)((float)(p_150054_2_ + 1) - f), (double)((float)(p_150054_3_ + 1) - f), (double)((float)(p_150054_4_ + 1) - f))); + + if (!list.isEmpty()) + { + flag1 = true; + } + + if (flag1 && !flag) + { + p_150054_1_.setBlockMetadataWithNotify(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_5_ | 8, 3); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_, p_150054_4_, this); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_ - 1, p_150054_4_, this); + p_150054_1_.markBlockRangeForRenderUpdate(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_2_, p_150054_3_, p_150054_4_); + } + + if (!flag1 && flag) + { + p_150054_1_.setBlockMetadataWithNotify(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_5_ & 7, 3); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_, p_150054_4_, this); + p_150054_1_.notifyBlocksOfNeighborChange(p_150054_2_, p_150054_3_ - 1, p_150054_4_, this); + p_150054_1_.markBlockRangeForRenderUpdate(p_150054_2_, p_150054_3_, p_150054_4_, p_150054_2_, p_150054_3_, p_150054_4_); + } + + if (flag1) + { + p_150054_1_.scheduleBlockUpdate(p_150054_2_, p_150054_3_, p_150054_4_, this, this.tickRate(p_150054_1_)); + } + + p_150054_1_.func_147453_f(p_150054_2_, p_150054_3_, p_150054_4_, this); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + this.func_150054_a(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z)); + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + public int getComparatorInputOverride(World worldIn, int x, int y, int z, int side) + { + if ((worldIn.getBlockMetadata(x, y, z) & 8) > 0) + { + float f = 0.125F; + List list = worldIn.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f))); + + if (list.size() > 0) + { + return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g(); + } + + List list1 = worldIn.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f)), IEntitySelector.selectInventories); + + if (list1.size() > 0) + { + return Container.calcRedstoneFromInventory((IInventory)list1.get(0)); + } + } + + return 0; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150055_b = new IIcon[2]; + this.field_150055_b[0] = reg.registerIcon(this.getTextureName()); + this.field_150055_b[1] = reg.registerIcon(this.getTextureName() + "_powered"); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return (meta & 8) != 0 ? this.field_150055_b[1] : this.field_150055_b[0]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailPowered.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailPowered.java new file mode 100644 index 0000000..7c9b1d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRailPowered.java @@ -0,0 +1,192 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockRailPowered extends BlockRailBase +{ + @SideOnly(Side.CLIENT) + protected IIcon field_150059_b; + private static final String __OBFID = "CL_00000288"; + + protected BlockRailPowered() + { + super(true); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return (meta & 8) == 0 ? this.blockIcon : this.field_150059_b; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + this.field_150059_b = reg.registerIcon(this.getTextureName() + "_powered"); + } + + protected boolean func_150058_a(World p_150058_1_, int p_150058_2_, int p_150058_3_, int p_150058_4_, int p_150058_5_, boolean p_150058_6_, int p_150058_7_) + { + if (p_150058_7_ >= 8) + { + return false; + } + else + { + int j1 = p_150058_5_ & 7; + boolean flag1 = true; + + switch (j1) + { + case 0: + if (p_150058_6_) + { + ++p_150058_4_; + } + else + { + --p_150058_4_; + } + + break; + case 1: + if (p_150058_6_) + { + --p_150058_2_; + } + else + { + ++p_150058_2_; + } + + break; + case 2: + if (p_150058_6_) + { + --p_150058_2_; + } + else + { + ++p_150058_2_; + ++p_150058_3_; + flag1 = false; + } + + j1 = 1; + break; + case 3: + if (p_150058_6_) + { + --p_150058_2_; + ++p_150058_3_; + flag1 = false; + } + else + { + ++p_150058_2_; + } + + j1 = 1; + break; + case 4: + if (p_150058_6_) + { + ++p_150058_4_; + } + else + { + --p_150058_4_; + ++p_150058_3_; + flag1 = false; + } + + j1 = 0; + break; + case 5: + if (p_150058_6_) + { + ++p_150058_4_; + ++p_150058_3_; + flag1 = false; + } + else + { + --p_150058_4_; + } + + j1 = 0; + } + + return this.func_150057_a(p_150058_1_, p_150058_2_, p_150058_3_, p_150058_4_, p_150058_6_, p_150058_7_, j1) ? true : flag1 && this.func_150057_a(p_150058_1_, p_150058_2_, p_150058_3_ - 1, p_150058_4_, p_150058_6_, p_150058_7_, j1); + } + } + + protected boolean func_150057_a(World p_150057_1_, int p_150057_2_, int p_150057_3_, int p_150057_4_, boolean p_150057_5_, int p_150057_6_, int p_150057_7_) + { + Block block = p_150057_1_.getBlock(p_150057_2_, p_150057_3_, p_150057_4_); + + if (block == this) + { + int j1 = p_150057_1_.getBlockMetadata(p_150057_2_, p_150057_3_, p_150057_4_); + int k1 = j1 & 7; + + if (p_150057_7_ == 1 && (k1 == 0 || k1 == 4 || k1 == 5)) + { + return false; + } + + if (p_150057_7_ == 0 && (k1 == 1 || k1 == 2 || k1 == 3)) + { + return false; + } + + if ((j1 & 8) != 0) + { + if (p_150057_1_.isBlockIndirectlyGettingPowered(p_150057_2_, p_150057_3_, p_150057_4_)) + { + return true; + } + + return this.func_150058_a(p_150057_1_, p_150057_2_, p_150057_3_, p_150057_4_, j1, p_150057_5_, p_150057_6_ + 1); + } + } + + return false; + } + + protected void func_150048_a(World p_150048_1_, int p_150048_2_, int p_150048_3_, int p_150048_4_, int p_150048_5_, int p_150048_6_, Block p_150048_7_) + { + boolean flag = p_150048_1_.isBlockIndirectlyGettingPowered(p_150048_2_, p_150048_3_, p_150048_4_); + flag = flag || this.func_150058_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, p_150048_5_, true, 0) || this.func_150058_a(p_150048_1_, p_150048_2_, p_150048_3_, p_150048_4_, p_150048_5_, false, 0); + boolean flag1 = false; + + if (flag && (p_150048_5_ & 8) == 0) + { + p_150048_1_.setBlockMetadataWithNotify(p_150048_2_, p_150048_3_, p_150048_4_, p_150048_6_ | 8, 3); + flag1 = true; + } + else if (!flag && (p_150048_5_ & 8) != 0) + { + p_150048_1_.setBlockMetadataWithNotify(p_150048_2_, p_150048_3_, p_150048_4_, p_150048_6_, 3); + flag1 = true; + } + + if (flag1) + { + p_150048_1_.notifyBlocksOfNeighborChange(p_150048_2_, p_150048_3_ - 1, p_150048_4_, this); + + if (p_150048_6_ == 2 || p_150048_6_ == 3 || p_150048_6_ == 4 || p_150048_6_ == 5) + { + p_150048_1_.notifyBlocksOfNeighborChange(p_150048_2_, p_150048_3_ + 1, p_150048_4_, this); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneComparator.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneComparator.java new file mode 100644 index 0000000..46642b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneComparator.java @@ -0,0 +1,273 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityComparator; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider +{ + private static final String __OBFID = "CL_00000220"; + + public BlockRedstoneComparator(boolean p_i45399_1_) + { + super(p_i45399_1_); + this.isBlockContainer = true; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.comparator; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.comparator; + } + + protected int func_149901_b(int p_149901_1_) + { + return 2; + } + + protected BlockRedstoneDiode getBlockPowered() + { + return Blocks.powered_comparator; + } + + protected BlockRedstoneDiode getBlockUnpowered() + { + return Blocks.unpowered_comparator; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 37; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + boolean flag = this.isRepeaterPowered || (meta & 8) != 0; + return side == 0 ? (flag ? Blocks.redstone_torch.getBlockTextureFromSide(side) : Blocks.unlit_redstone_torch.getBlockTextureFromSide(side)) : (side == 1 ? (flag ? Blocks.powered_comparator.blockIcon : this.blockIcon) : Blocks.double_stone_slab.getBlockTextureFromSide(1)); + } + + protected boolean func_149905_c(int p_149905_1_) + { + return this.isRepeaterPowered || (p_149905_1_ & 8) != 0; + } + + protected int func_149904_f(IBlockAccess p_149904_1_, int p_149904_2_, int p_149904_3_, int p_149904_4_, int p_149904_5_) + { + return this.getTileEntityComparator(p_149904_1_, p_149904_2_, p_149904_3_, p_149904_4_).getOutputSignal(); + } + + private int getOutputStrength(World p_149970_1_, int p_149970_2_, int p_149970_3_, int p_149970_4_, int p_149970_5_) + { + return !this.func_149969_d(p_149970_5_) ? this.getInputStrength(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_) : Math.max(this.getInputStrength(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_) - this.func_149902_h(p_149970_1_, p_149970_2_, p_149970_3_, p_149970_4_, p_149970_5_), 0); + } + + public boolean func_149969_d(int p_149969_1_) + { + return (p_149969_1_ & 4) == 4; + } + + protected boolean isGettingInput(World p_149900_1_, int p_149900_2_, int p_149900_3_, int p_149900_4_, int p_149900_5_) + { + int i1 = this.getInputStrength(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_); + + if (i1 >= 15) + { + return true; + } + else if (i1 == 0) + { + return false; + } + else + { + int j1 = this.func_149902_h(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_); + return j1 == 0 ? true : i1 >= j1; + } + } + + /** + * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side + */ + protected int getInputStrength(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_) + { + int i1 = super.getInputStrength(p_149903_1_, p_149903_2_, p_149903_3_, p_149903_4_, p_149903_5_); + int j1 = getDirection(p_149903_5_); + int k1 = p_149903_2_ + Direction.offsetX[j1]; + int l1 = p_149903_4_ + Direction.offsetZ[j1]; + Block block = p_149903_1_.getBlock(k1, p_149903_3_, l1); + + if (block.hasComparatorInputOverride()) + { + i1 = block.getComparatorInputOverride(p_149903_1_, k1, p_149903_3_, l1, Direction.rotateOpposite[j1]); + } + else if (i1 < 15 && block.isNormalCube()) + { + k1 += Direction.offsetX[j1]; + l1 += Direction.offsetZ[j1]; + block = p_149903_1_.getBlock(k1, p_149903_3_, l1); + + if (block.hasComparatorInputOverride()) + { + i1 = block.getComparatorInputOverride(p_149903_1_, k1, p_149903_3_, l1, Direction.rotateOpposite[j1]); + } + } + + return i1; + } + + /** + * Returns the blockTileEntity at given coordinates. + */ + public TileEntityComparator getTileEntityComparator(IBlockAccess p_149971_1_, int p_149971_2_, int p_149971_3_, int p_149971_4_) + { + return (TileEntityComparator)p_149971_1_.getTileEntity(p_149971_2_, p_149971_3_, p_149971_4_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + boolean flag = this.isRepeaterPowered | (i1 & 8) != 0; + boolean flag1 = !this.func_149969_d(i1); + int j1 = flag1 ? 4 : 0; + j1 |= flag ? 8 : 0; + worldIn.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.click", 0.3F, flag1 ? 0.55F : 0.5F); + worldIn.setBlockMetadataWithNotify(x, y, z, j1 | i1 & 3, 2); + this.func_149972_c(worldIn, x, y, z, worldIn.rand); + return true; + } + + protected void func_149897_b(World p_149897_1_, int p_149897_2_, int p_149897_3_, int p_149897_4_, Block p_149897_5_) + { + if (!p_149897_1_.isBlockTickScheduledThisTick(p_149897_2_, p_149897_3_, p_149897_4_, this)) + { + int l = p_149897_1_.getBlockMetadata(p_149897_2_, p_149897_3_, p_149897_4_); + int i1 = this.getOutputStrength(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l); + int j1 = this.getTileEntityComparator(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_).getOutputSignal(); + + if (i1 != j1 || this.func_149905_c(l) != this.isGettingInput(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l)) + { + if (this.func_149912_i(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l)) + { + p_149897_1_.scheduleBlockUpdateWithPriority(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(0), -1); + } + else + { + p_149897_1_.scheduleBlockUpdateWithPriority(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(0), 0); + } + } + } + } + + private void func_149972_c(World p_149972_1_, int p_149972_2_, int p_149972_3_, int p_149972_4_, Random p_149972_5_) + { + int l = p_149972_1_.getBlockMetadata(p_149972_2_, p_149972_3_, p_149972_4_); + int i1 = this.getOutputStrength(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_, l); + int j1 = this.getTileEntityComparator(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_).getOutputSignal(); + this.getTileEntityComparator(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_).setOutputSignal(i1); + + if (j1 != i1 || !this.func_149969_d(l)) + { + boolean flag = this.isGettingInput(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_, l); + boolean flag1 = this.isRepeaterPowered || (l & 8) != 0; + + if (flag1 && !flag) + { + p_149972_1_.setBlockMetadataWithNotify(p_149972_2_, p_149972_3_, p_149972_4_, l & -9, 2); + } + else if (!flag1 && flag) + { + p_149972_1_.setBlockMetadataWithNotify(p_149972_2_, p_149972_3_, p_149972_4_, l | 8, 2); + } + + this.func_149911_e(p_149972_1_, p_149972_2_, p_149972_3_, p_149972_4_); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (this.isRepeaterPowered) + { + int l = worldIn.getBlockMetadata(x, y, z); + worldIn.setBlock(x, y, z, this.getBlockUnpowered(), l | 8, 4); + } + + this.func_149972_c(worldIn, x, y, z, random); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + worldIn.setTileEntity(x, y, z, this.createNewTileEntity(worldIn, 0)); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + worldIn.removeTileEntity(x, y, z); + this.func_149911_e(worldIn, x, y, z); + } + + public boolean onBlockEventReceived(World worldIn, int x, int y, int z, int eventId, int eventData) + { + super.onBlockEventReceived(worldIn, x, y, z, eventId, eventData); + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + return tileentity != null ? tileentity.receiveClientEvent(eventId, eventData) : false; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntityComparator(); + } + + @Override + public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) + { + if (y == tileY && world instanceof World) + { + onNeighborBlockChange((World)world, x, y, z, world.getBlock(tileX, tileY, tileZ)); + } + } + + @Override + public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneDiode.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneDiode.java new file mode 100644 index 0000000..6d756ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneDiode.java @@ -0,0 +1,364 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockRedstoneDiode extends BlockDirectional +{ + /** Tells whether the repeater is powered or not */ + protected final boolean isRepeaterPowered; + private static final String __OBFID = "CL_00000226"; + + protected BlockRedstoneDiode(boolean p_i45400_1_) + { + super(Material.circuits); + this.isRepeaterPowered = p_i45400_1_; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return !World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) ? false : super.canPlaceBlockAt(worldIn, x, y, z); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return !World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) ? false : super.canBlockStay(worldIn, x, y, z); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (!this.func_149910_g(worldIn, x, y, z, l)) + { + boolean flag = this.isGettingInput(worldIn, x, y, z, l); + + if (this.isRepeaterPowered && !flag) + { + worldIn.setBlock(x, y, z, this.getBlockUnpowered(), l, 2); + } + else if (!this.isRepeaterPowered) + { + worldIn.setBlock(x, y, z, this.getBlockPowered(), l, 2); + + if (!flag) + { + worldIn.scheduleBlockUpdateWithPriority(x, y, z, this.getBlockPowered(), this.func_149899_k(l), -1); + } + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 0 ? (this.isRepeaterPowered ? Blocks.redstone_torch.getBlockTextureFromSide(side) : Blocks.unlit_redstone_torch.getBlockTextureFromSide(side)) : (side == 1 ? this.blockIcon : Blocks.double_stone_slab.getBlockTextureFromSide(1)); + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side != 0 && side != 1; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 36; + } + + protected boolean func_149905_c(int p_149905_1_) + { + return this.isRepeaterPowered; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return this.isProvidingWeakPower(worldIn, x, y, z, side); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (!this.func_149905_c(i1)) + { + return 0; + } + else + { + int j1 = getDirection(i1); + return j1 == 0 && side == 3 ? this.func_149904_f(worldIn, x, y, z, i1) : (j1 == 1 && side == 4 ? this.func_149904_f(worldIn, x, y, z, i1) : (j1 == 2 && side == 2 ? this.func_149904_f(worldIn, x, y, z, i1) : (j1 == 3 && side == 5 ? this.func_149904_f(worldIn, x, y, z, i1) : 0))); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!this.canBlockStay(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + } + else + { + this.func_149897_b(worldIn, x, y, z, neighbor); + } + } + + protected void func_149897_b(World p_149897_1_, int p_149897_2_, int p_149897_3_, int p_149897_4_, Block p_149897_5_) + { + int l = p_149897_1_.getBlockMetadata(p_149897_2_, p_149897_3_, p_149897_4_); + + if (!this.func_149910_g(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l)) + { + boolean flag = this.isGettingInput(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l); + + if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && !p_149897_1_.isBlockTickScheduledThisTick(p_149897_2_, p_149897_3_, p_149897_4_, this)) + { + byte b0 = -1; + + if (this.func_149912_i(p_149897_1_, p_149897_2_, p_149897_3_, p_149897_4_, l)) + { + b0 = -3; + } + else if (this.isRepeaterPowered) + { + b0 = -2; + } + + p_149897_1_.scheduleBlockUpdateWithPriority(p_149897_2_, p_149897_3_, p_149897_4_, this, this.func_149901_b(l), b0); + } + } + } + + public boolean func_149910_g(IBlockAccess p_149910_1_, int p_149910_2_, int p_149910_3_, int p_149910_4_, int p_149910_5_) + { + return false; + } + + protected boolean isGettingInput(World p_149900_1_, int p_149900_2_, int p_149900_3_, int p_149900_4_, int p_149900_5_) + { + return this.getInputStrength(p_149900_1_, p_149900_2_, p_149900_3_, p_149900_4_, p_149900_5_) > 0; + } + + /** + * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side + */ + protected int getInputStrength(World p_149903_1_, int p_149903_2_, int p_149903_3_, int p_149903_4_, int p_149903_5_) + { + int i1 = getDirection(p_149903_5_); + int j1 = p_149903_2_ + Direction.offsetX[i1]; + int k1 = p_149903_4_ + Direction.offsetZ[i1]; + int l1 = p_149903_1_.getIndirectPowerLevelTo(j1, p_149903_3_, k1, Direction.directionToFacing[i1]); + return l1 >= 15 ? l1 : Math.max(l1, p_149903_1_.getBlock(j1, p_149903_3_, k1) == Blocks.redstone_wire ? p_149903_1_.getBlockMetadata(j1, p_149903_3_, k1) : 0); + } + + protected int func_149902_h(IBlockAccess p_149902_1_, int p_149902_2_, int p_149902_3_, int p_149902_4_, int p_149902_5_) + { + int i1 = getDirection(p_149902_5_); + + switch (i1) + { + case 0: + case 2: + return Math.max(this.func_149913_i(p_149902_1_, p_149902_2_ - 1, p_149902_3_, p_149902_4_, 4), this.func_149913_i(p_149902_1_, p_149902_2_ + 1, p_149902_3_, p_149902_4_, 5)); + case 1: + case 3: + return Math.max(this.func_149913_i(p_149902_1_, p_149902_2_, p_149902_3_, p_149902_4_ + 1, 3), this.func_149913_i(p_149902_1_, p_149902_2_, p_149902_3_, p_149902_4_ - 1, 2)); + default: + return 0; + } + } + + protected int func_149913_i(IBlockAccess p_149913_1_, int p_149913_2_, int p_149913_3_, int p_149913_4_, int p_149913_5_) + { + Block block = p_149913_1_.getBlock(p_149913_2_, p_149913_3_, p_149913_4_); + return this.func_149908_a(block) ? (block == Blocks.redstone_wire ? p_149913_1_.getBlockMetadata(p_149913_2_, p_149913_3_, p_149913_4_) : p_149913_1_.isBlockProvidingPowerTo(p_149913_2_, p_149913_3_, p_149913_4_, p_149913_5_)) : 0; + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = ((MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 3); + boolean flag = this.isGettingInput(worldIn, x, y, z, l); + + if (flag) + { + worldIn.scheduleBlockUpdate(x, y, z, this, 1); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + this.func_149911_e(worldIn, x, y, z); + } + + protected void func_149911_e(World p_149911_1_, int p_149911_2_, int p_149911_3_, int p_149911_4_) + { + int l = getDirection(p_149911_1_.getBlockMetadata(p_149911_2_, p_149911_3_, p_149911_4_)); + + if (l == 1) + { + p_149911_1_.notifyBlockOfNeighborChange(p_149911_2_ + 1, p_149911_3_, p_149911_4_, this); + p_149911_1_.notifyBlocksOfNeighborChange(p_149911_2_ + 1, p_149911_3_, p_149911_4_, this, 4); + } + + if (l == 3) + { + p_149911_1_.notifyBlockOfNeighborChange(p_149911_2_ - 1, p_149911_3_, p_149911_4_, this); + p_149911_1_.notifyBlocksOfNeighborChange(p_149911_2_ - 1, p_149911_3_, p_149911_4_, this, 5); + } + + if (l == 2) + { + p_149911_1_.notifyBlockOfNeighborChange(p_149911_2_, p_149911_3_, p_149911_4_ + 1, this); + p_149911_1_.notifyBlocksOfNeighborChange(p_149911_2_, p_149911_3_, p_149911_4_ + 1, this, 2); + } + + if (l == 0) + { + p_149911_1_.notifyBlockOfNeighborChange(p_149911_2_, p_149911_3_, p_149911_4_ - 1, this); + p_149911_1_.notifyBlocksOfNeighborChange(p_149911_2_, p_149911_3_, p_149911_4_ - 1, this, 3); + } + } + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World worldIn, int x, int y, int z, int meta) + { + if (this.isRepeaterPowered) + { + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + } + + super.onBlockDestroyedByPlayer(worldIn, x, y, z, meta); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + protected boolean func_149908_a(Block p_149908_1_) + { + return p_149908_1_.canProvidePower(); + } + + protected int func_149904_f(IBlockAccess p_149904_1_, int p_149904_2_, int p_149904_3_, int p_149904_4_, int p_149904_5_) + { + return 15; + } + + public static boolean isRedstoneRepeaterBlockID(Block p_149909_0_) + { + return Blocks.unpowered_repeater.func_149907_e(p_149909_0_) || Blocks.unpowered_comparator.func_149907_e(p_149909_0_); + } + + public boolean func_149907_e(Block p_149907_1_) + { + return p_149907_1_ == this.getBlockPowered() || p_149907_1_ == this.getBlockUnpowered(); + } + + public boolean func_149912_i(World p_149912_1_, int p_149912_2_, int p_149912_3_, int p_149912_4_, int p_149912_5_) + { + int i1 = getDirection(p_149912_5_); + + if (isRedstoneRepeaterBlockID(p_149912_1_.getBlock(p_149912_2_ - Direction.offsetX[i1], p_149912_3_, p_149912_4_ - Direction.offsetZ[i1]))) + { + int j1 = p_149912_1_.getBlockMetadata(p_149912_2_ - Direction.offsetX[i1], p_149912_3_, p_149912_4_ - Direction.offsetZ[i1]); + int k1 = getDirection(j1); + return k1 != i1; + } + else + { + return false; + } + } + + protected int func_149899_k(int p_149899_1_) + { + return this.func_149901_b(p_149899_1_); + } + + protected abstract int func_149901_b(int p_149901_1_); + + protected abstract BlockRedstoneDiode getBlockPowered(); + + protected abstract BlockRedstoneDiode getBlockUnpowered(); + + public boolean isAssociatedBlock(Block other) + { + return this.func_149907_e(other); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneLight.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneLight.java new file mode 100644 index 0000000..3b64b36 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneLight.java @@ -0,0 +1,98 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BlockRedstoneLight extends Block +{ + private final boolean field_150171_a; + private static final String __OBFID = "CL_00000297"; + + public BlockRedstoneLight(boolean p_i45421_1_) + { + super(Material.redstoneLight); + this.field_150171_a = p_i45421_1_; + + if (p_i45421_1_) + { + this.setLightLevel(1.0F); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (!worldIn.isRemote) + { + if (this.field_150171_a && !worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + worldIn.scheduleBlockUpdate(x, y, z, this, 4); + } + else if (!this.field_150171_a && worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + worldIn.setBlock(x, y, z, Blocks.lit_redstone_lamp, 0, 2); + } + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + if (this.field_150171_a && !worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + worldIn.scheduleBlockUpdate(x, y, z, this, 4); + } + else if (!this.field_150171_a && worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + worldIn.setBlock(x, y, z, Blocks.lit_redstone_lamp, 0, 2); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote && this.field_150171_a && !worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + worldIn.setBlock(x, y, z, Blocks.redstone_lamp, 0, 2); + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemFromBlock(Blocks.redstone_lamp); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Blocks.redstone_lamp); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneOre.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneOre.java new file mode 100644 index 0000000..b9c2735 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneOre.java @@ -0,0 +1,197 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneOre extends Block +{ + private boolean field_150187_a; + private static final String __OBFID = "CL_00000294"; + + public BlockRedstoneOre(boolean p_i45420_1_) + { + super(Material.rock); + + if (p_i45420_1_) + { + this.setTickRandomly(true); + } + + this.field_150187_a = p_i45420_1_; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 30; + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) + { + this.func_150185_e(worldIn, x, y, z); + super.onBlockClicked(worldIn, x, y, z, player); + } + + /** + * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity + */ + public void onEntityWalking(World worldIn, int x, int y, int z, Entity entityIn) + { + this.func_150185_e(worldIn, x, y, z); + super.onEntityWalking(worldIn, x, y, z, entityIn); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + this.func_150185_e(worldIn, x, y, z); + return super.onBlockActivated(worldIn, x, y, z, player, side, subX, subY, subZ); + } + + private void func_150185_e(World p_150185_1_, int p_150185_2_, int p_150185_3_, int p_150185_4_) + { + this.func_150186_m(p_150185_1_, p_150185_2_, p_150185_3_, p_150185_4_); + + if (this == Blocks.redstone_ore) + { + p_150185_1_.setBlock(p_150185_2_, p_150185_3_, p_150185_4_, Blocks.lit_redstone_ore); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (this == Blocks.lit_redstone_ore) + { + worldIn.setBlock(x, y, z, Blocks.redstone_ore); + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.redstone; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + return this.quantityDropped(random) + random.nextInt(maxBonus + 1); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 4 + random.nextInt(2); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + } + + private Random rand = new Random(); + @Override // World, meta, fortune + public int getExpDrop(IBlockAccess worldIn, int meta, int fortune) + { + if (this.getItemDropped(meta, rand, fortune) != Item.getItemFromBlock(this)) + { + return 1 + rand.nextInt(5); + } + return 0; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (this.field_150187_a) + { + this.func_150186_m(worldIn, x, y, z); + } + } + + private void func_150186_m(World p_150186_1_, int p_150186_2_, int p_150186_3_, int p_150186_4_) + { + Random random = p_150186_1_.rand; + double d0 = 0.0625D; + + for (int l = 0; l < 6; ++l) + { + double d1 = (double)((float)p_150186_2_ + random.nextFloat()); + double d2 = (double)((float)p_150186_3_ + random.nextFloat()); + double d3 = (double)((float)p_150186_4_ + random.nextFloat()); + + if (l == 0 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_ + 1, p_150186_4_).isOpaqueCube()) + { + d2 = (double)(p_150186_3_ + 1) + d0; + } + + if (l == 1 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_ - 1, p_150186_4_).isOpaqueCube()) + { + d2 = (double)(p_150186_3_ + 0) - d0; + } + + if (l == 2 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_, p_150186_4_ + 1).isOpaqueCube()) + { + d3 = (double)(p_150186_4_ + 1) + d0; + } + + if (l == 3 && !p_150186_1_.getBlock(p_150186_2_, p_150186_3_, p_150186_4_ - 1).isOpaqueCube()) + { + d3 = (double)(p_150186_4_ + 0) - d0; + } + + if (l == 4 && !p_150186_1_.getBlock(p_150186_2_ + 1, p_150186_3_, p_150186_4_).isOpaqueCube()) + { + d1 = (double)(p_150186_2_ + 1) + d0; + } + + if (l == 5 && !p_150186_1_.getBlock(p_150186_2_ - 1, p_150186_3_, p_150186_4_).isOpaqueCube()) + { + d1 = (double)(p_150186_2_ + 0) - d0; + } + + if (d1 < (double)p_150186_2_ || d1 > (double)(p_150186_2_ + 1) || d2 < 0.0D || d2 > (double)(p_150186_3_ + 1) || d3 < (double)p_150186_4_ || d3 > (double)(p_150186_4_ + 1)) + { + p_150186_1_.spawnParticle("reddust", d1, d2, d3, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Blocks.redstone_ore); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneRepeater.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneRepeater.java new file mode 100644 index 0000000..181a8a8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneRepeater.java @@ -0,0 +1,147 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneRepeater extends BlockRedstoneDiode +{ + /** The offsets for the two torches in redstone repeater blocks. */ + public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; + /** The states in which the redstone repeater blocks can be. */ + private static final int[] repeaterState = new int[] {1, 2, 3, 4}; + private static final String __OBFID = "CL_00000301"; + + protected BlockRedstoneRepeater(boolean p_i45424_1_) + { + super(p_i45424_1_); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + int j1 = (i1 & 12) >> 2; + j1 = j1 + 1 << 2 & 12; + worldIn.setBlockMetadataWithNotify(x, y, z, j1 | i1 & 3, 3); + return true; + } + + protected int func_149901_b(int p_149901_1_) + { + return repeaterState[(p_149901_1_ & 12) >> 2] * 2; + } + + protected BlockRedstoneDiode getBlockPowered() + { + return Blocks.powered_repeater; + } + + protected BlockRedstoneDiode getBlockUnpowered() + { + return Blocks.unpowered_repeater; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.repeater; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.repeater; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 15; + } + + public boolean func_149910_g(IBlockAccess p_149910_1_, int p_149910_2_, int p_149910_3_, int p_149910_4_, int p_149910_5_) + { + return this.func_149902_h(p_149910_1_, p_149910_2_, p_149910_3_, p_149910_4_, p_149910_5_) > 0; + } + + protected boolean func_149908_a(Block p_149908_1_) + { + return isRedstoneRepeaterBlockID(p_149908_1_); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + this.func_149911_e(worldIn, x, y, z); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (this.isRepeaterPowered) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = getDirection(l); + double d0 = (double)((float)x + 0.5F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d1 = (double)((float)y + 0.4F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d2 = (double)((float)z + 0.5F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d3 = 0.0D; + double d4 = 0.0D; + + if (random.nextInt(2) == 0) + { + switch (i1) + { + case 0: + d4 = -0.3125D; + break; + case 1: + d3 = 0.3125D; + break; + case 2: + d4 = 0.3125D; + break; + case 3: + d3 = -0.3125D; + } + } + else + { + int j1 = (l & 12) >> 2; + + switch (i1) + { + case 0: + d4 = repeaterTorchOffset[j1]; + break; + case 1: + d3 = -repeaterTorchOffset[j1]; + break; + case 2: + d4 = -repeaterTorchOffset[j1]; + break; + case 3: + d3 = repeaterTorchOffset[j1]; + } + } + + worldIn.spawnParticle("reddust", d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneTorch.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneTorch.java new file mode 100644 index 0000000..0fb3845 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneTorch.java @@ -0,0 +1,266 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneTorch extends BlockTorch +{ + private boolean field_150113_a; + private static Map field_150112_b = new HashMap(); + private static final String __OBFID = "CL_00000298"; + + private boolean func_150111_a(World p_150111_1_, int p_150111_2_, int p_150111_3_, int p_150111_4_, boolean p_150111_5_) + { + if (!field_150112_b.containsKey(p_150111_1_)) + { + field_150112_b.put(p_150111_1_, new ArrayList()); + } + + List list = (List)field_150112_b.get(p_150111_1_); + + if (p_150111_5_) + { + list.add(new BlockRedstoneTorch.Toggle(p_150111_2_, p_150111_3_, p_150111_4_, p_150111_1_.getTotalWorldTime())); + } + + int l = 0; + + for (int i1 = 0; i1 < list.size(); ++i1) + { + BlockRedstoneTorch.Toggle toggle = (BlockRedstoneTorch.Toggle)list.get(i1); + + if (toggle.field_150847_a == p_150111_2_ && toggle.field_150845_b == p_150111_3_ && toggle.field_150846_c == p_150111_4_) + { + ++l; + + if (l >= 8) + { + return true; + } + } + } + + return false; + } + + protected BlockRedstoneTorch(boolean p_i45423_1_) + { + this.field_150113_a = p_i45423_1_; + this.setTickRandomly(true); + this.setCreativeTab((CreativeTabs)null); + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 2; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (worldIn.getBlockMetadata(x, y, z) == 0) + { + super.onBlockAdded(worldIn, x, y, z); + } + + if (this.field_150113_a) + { + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + if (this.field_150113_a) + { + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (!this.field_150113_a) + { + return 0; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + return i1 == 5 && side == 1 ? 0 : (i1 == 3 && side == 3 ? 0 : (i1 == 4 && side == 2 ? 0 : (i1 == 1 && side == 5 ? 0 : (i1 == 2 && side == 4 ? 0 : 15)))); + } + } + + private boolean func_150110_m(World p_150110_1_, int p_150110_2_, int p_150110_3_, int p_150110_4_) + { + int l = p_150110_1_.getBlockMetadata(p_150110_2_, p_150110_3_, p_150110_4_); + return l == 5 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_ - 1, p_150110_4_, 0) ? true : (l == 3 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_, p_150110_4_ - 1, 2) ? true : (l == 4 && p_150110_1_.getIndirectPowerOutput(p_150110_2_, p_150110_3_, p_150110_4_ + 1, 3) ? true : (l == 1 && p_150110_1_.getIndirectPowerOutput(p_150110_2_ - 1, p_150110_3_, p_150110_4_, 4) ? true : l == 2 && p_150110_1_.getIndirectPowerOutput(p_150110_2_ + 1, p_150110_3_, p_150110_4_, 5)))); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + boolean flag = this.func_150110_m(worldIn, x, y, z); + List list = (List)field_150112_b.get(worldIn); + + while (list != null && !list.isEmpty() && worldIn.getTotalWorldTime() - ((BlockRedstoneTorch.Toggle)list.get(0)).field_150844_d > 60L) + { + list.remove(0); + } + + if (this.field_150113_a) + { + if (flag) + { + worldIn.setBlock(x, y, z, Blocks.unlit_redstone_torch, worldIn.getBlockMetadata(x, y, z), 3); + + if (this.func_150111_a(worldIn, x, y, z, true)) + { + worldIn.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), "random.fizz", 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 5; ++l) + { + double d0 = (double)x + random.nextDouble() * 0.6D + 0.2D; + double d1 = (double)y + random.nextDouble() * 0.6D + 0.2D; + double d2 = (double)z + random.nextDouble() * 0.6D + 0.2D; + worldIn.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + } + } + } + else if (!flag && !this.func_150111_a(worldIn, x, y, z, false)) + { + worldIn.setBlock(x, y, z, Blocks.redstone_torch, worldIn.getBlockMetadata(x, y, z), 3); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!this.func_150108_b(worldIn, x, y, z, neighbor)) + { + boolean flag = this.func_150110_m(worldIn, x, y, z); + + if (this.field_150113_a && flag || !this.field_150113_a && !flag) + { + worldIn.scheduleBlockUpdate(x, y, z, this, this.tickRate(worldIn)); + } + } + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 0 ? this.isProvidingWeakPower(worldIn, x, y, z, side) : 0; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + if (this.field_150113_a) + { + int l = worldIn.getBlockMetadata(x, y, z); + double d0 = (double)((float)x + 0.5F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d1 = (double)((float)y + 0.7F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d2 = (double)((float)z + 0.5F) + (double)(random.nextFloat() - 0.5F) * 0.2D; + double d3 = 0.2199999988079071D; + double d4 = 0.27000001072883606D; + + if (l == 1) + { + worldIn.spawnParticle("reddust", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + worldIn.spawnParticle("reddust", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + worldIn.spawnParticle("reddust", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); + } + else if (l == 4) + { + worldIn.spawnParticle("reddust", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); + } + else + { + worldIn.spawnParticle("reddust", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Item.getItemFromBlock(Blocks.redstone_torch); + } + + public boolean isAssociatedBlock(Block other) + { + return other == Blocks.unlit_redstone_torch || other == Blocks.redstone_torch; + } + + static class Toggle + { + int field_150847_a; + int field_150845_b; + int field_150846_c; + long field_150844_d; + private static final String __OBFID = "CL_00000299"; + + public Toggle(int p_i45422_1_, int p_i45422_2_, int p_i45422_3_, long p_i45422_4_) + { + this.field_150847_a = p_i45422_1_; + this.field_150845_b = p_i45422_2_; + this.field_150846_c = p_i45422_3_; + this.field_150844_d = p_i45422_4_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneWire.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneWire.java new file mode 100644 index 0000000..babf9d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRedstoneWire.java @@ -0,0 +1,531 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockRedstoneWire extends Block +{ + private boolean field_150181_a = true; + private Set field_150179_b = new HashSet(); + @SideOnly(Side.CLIENT) + private IIcon field_150182_M; + @SideOnly(Side.CLIENT) + private IIcon field_150183_N; + @SideOnly(Side.CLIENT) + private IIcon field_150184_O; + @SideOnly(Side.CLIENT) + private IIcon field_150180_P; + private static final String __OBFID = "CL_00000295"; + + public BlockRedstoneWire() + { + super(Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 5; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return 8388608; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) || worldIn.getBlock(x, y - 1, z) == Blocks.glowstone; + } + + private void func_150177_e(World p_150177_1_, int p_150177_2_, int p_150177_3_, int p_150177_4_) + { + this.func_150175_a(p_150177_1_, p_150177_2_, p_150177_3_, p_150177_4_, p_150177_2_, p_150177_3_, p_150177_4_); + ArrayList arraylist = new ArrayList(this.field_150179_b); + this.field_150179_b.clear(); + + for (int l = 0; l < arraylist.size(); ++l) + { + ChunkPosition chunkposition = (ChunkPosition)arraylist.get(l); + p_150177_1_.notifyBlocksOfNeighborChange(chunkposition.chunkPosX, chunkposition.chunkPosY, chunkposition.chunkPosZ, this); + } + } + + private void func_150175_a(World p_150175_1_, int p_150175_2_, int p_150175_3_, int p_150175_4_, int p_150175_5_, int p_150175_6_, int p_150175_7_) + { + int k1 = p_150175_1_.getBlockMetadata(p_150175_2_, p_150175_3_, p_150175_4_); + byte b0 = 0; + int i3 = this.func_150178_a(p_150175_1_, p_150175_5_, p_150175_6_, p_150175_7_, b0); + this.field_150181_a = false; + int l1 = p_150175_1_.getStrongestIndirectPower(p_150175_2_, p_150175_3_, p_150175_4_); + this.field_150181_a = true; + + if (l1 > 0 && l1 > i3 - 1) + { + i3 = l1; + } + + int i2 = 0; + + for (int j2 = 0; j2 < 4; ++j2) + { + int k2 = p_150175_2_; + int l2 = p_150175_4_; + + if (j2 == 0) + { + k2 = p_150175_2_ - 1; + } + + if (j2 == 1) + { + ++k2; + } + + if (j2 == 2) + { + l2 = p_150175_4_ - 1; + } + + if (j2 == 3) + { + ++l2; + } + + if (k2 != p_150175_5_ || l2 != p_150175_7_) + { + i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_, l2, i2); + } + + if (p_150175_1_.getBlock(k2, p_150175_3_, l2).isNormalCube() && !p_150175_1_.getBlock(p_150175_2_, p_150175_3_ + 1, p_150175_4_).isNormalCube()) + { + if ((k2 != p_150175_5_ || l2 != p_150175_7_) && p_150175_3_ >= p_150175_6_) + { + i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_ + 1, l2, i2); + } + } + else if (!p_150175_1_.getBlock(k2, p_150175_3_, l2).isNormalCube() && (k2 != p_150175_5_ || l2 != p_150175_7_) && p_150175_3_ <= p_150175_6_) + { + i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_ - 1, l2, i2); + } + } + + if (i2 > i3) + { + i3 = i2 - 1; + } + else if (i3 > 0) + { + --i3; + } + else + { + i3 = 0; + } + + if (l1 > i3 - 1) + { + i3 = l1; + } + + if (k1 != i3) + { + p_150175_1_.setBlockMetadataWithNotify(p_150175_2_, p_150175_3_, p_150175_4_, i3, 2); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_ - 1, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_ + 1, p_150175_3_, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ - 1, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ + 1, p_150175_4_)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ - 1)); + this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ + 1)); + } + } + + private void func_150172_m(World p_150172_1_, int p_150172_2_, int p_150172_3_, int p_150172_4_) + { + if (p_150172_1_.getBlock(p_150172_2_, p_150172_3_, p_150172_4_) == this) + { + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_ - 1, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_ + 1, p_150172_3_, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_ - 1, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_, p_150172_4_ + 1, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_ - 1, p_150172_4_, this); + p_150172_1_.notifyBlocksOfNeighborChange(p_150172_2_, p_150172_3_ + 1, p_150172_4_, this); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + + if (!worldIn.isRemote) + { + this.func_150177_e(worldIn, x, y, z); + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + this.func_150172_m(worldIn, x - 1, y, z); + this.func_150172_m(worldIn, x + 1, y, z); + this.func_150172_m(worldIn, x, y, z - 1); + this.func_150172_m(worldIn, x, y, z + 1); + + if (worldIn.getBlock(x - 1, y, z).isNormalCube()) + { + this.func_150172_m(worldIn, x - 1, y + 1, z); + } + else + { + this.func_150172_m(worldIn, x - 1, y - 1, z); + } + + if (worldIn.getBlock(x + 1, y, z).isNormalCube()) + { + this.func_150172_m(worldIn, x + 1, y + 1, z); + } + else + { + this.func_150172_m(worldIn, x + 1, y - 1, z); + } + + if (worldIn.getBlock(x, y, z - 1).isNormalCube()) + { + this.func_150172_m(worldIn, x, y + 1, z - 1); + } + else + { + this.func_150172_m(worldIn, x, y - 1, z - 1); + } + + if (worldIn.getBlock(x, y, z + 1).isNormalCube()) + { + this.func_150172_m(worldIn, x, y + 1, z + 1); + } + else + { + this.func_150172_m(worldIn, x, y - 1, z + 1); + } + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + + if (!worldIn.isRemote) + { + worldIn.notifyBlocksOfNeighborChange(x, y + 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y - 1, z, this); + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + this.func_150177_e(worldIn, x, y, z); + this.func_150172_m(worldIn, x - 1, y, z); + this.func_150172_m(worldIn, x + 1, y, z); + this.func_150172_m(worldIn, x, y, z - 1); + this.func_150172_m(worldIn, x, y, z + 1); + + if (worldIn.getBlock(x - 1, y, z).isNormalCube()) + { + this.func_150172_m(worldIn, x - 1, y + 1, z); + } + else + { + this.func_150172_m(worldIn, x - 1, y - 1, z); + } + + if (worldIn.getBlock(x + 1, y, z).isNormalCube()) + { + this.func_150172_m(worldIn, x + 1, y + 1, z); + } + else + { + this.func_150172_m(worldIn, x + 1, y - 1, z); + } + + if (worldIn.getBlock(x, y, z - 1).isNormalCube()) + { + this.func_150172_m(worldIn, x, y + 1, z - 1); + } + else + { + this.func_150172_m(worldIn, x, y - 1, z - 1); + } + + if (worldIn.getBlock(x, y, z + 1).isNormalCube()) + { + this.func_150172_m(worldIn, x, y + 1, z + 1); + } + else + { + this.func_150172_m(worldIn, x, y - 1, z + 1); + } + } + } + + private int func_150178_a(World p_150178_1_, int p_150178_2_, int p_150178_3_, int p_150178_4_, int p_150178_5_) + { + if (p_150178_1_.getBlock(p_150178_2_, p_150178_3_, p_150178_4_) != this) + { + return p_150178_5_; + } + else + { + int i1 = p_150178_1_.getBlockMetadata(p_150178_2_, p_150178_3_, p_150178_4_); + return i1 > p_150178_5_ ? i1 : p_150178_5_; + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + boolean flag = this.canPlaceBlockAt(worldIn, x, y, z); + + if (flag) + { + this.func_150177_e(worldIn, x, y, z); + } + else + { + this.dropBlockAsItem(worldIn, x, y, z, 0, 0); + worldIn.setBlockToAir(x, y, z); + } + + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.redstone; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return !this.field_150181_a ? 0 : this.isProvidingWeakPower(worldIn, x, y, z, side); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (!this.field_150181_a) + { + return 0; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (i1 == 0) + { + return 0; + } + else if (side == 1) + { + return i1; + } + else + { + boolean flag = func_150176_g(worldIn, x - 1, y, z, 1) || !worldIn.getBlock(x - 1, y, z).isNormalCube() && func_150176_g(worldIn, x - 1, y - 1, z, -1); + boolean flag1 = func_150176_g(worldIn, x + 1, y, z, 3) || !worldIn.getBlock(x + 1, y, z).isNormalCube() && func_150176_g(worldIn, x + 1, y - 1, z, -1); + boolean flag2 = func_150176_g(worldIn, x, y, z - 1, 2) || !worldIn.getBlock(x, y, z - 1).isNormalCube() && func_150176_g(worldIn, x, y - 1, z - 1, -1); + boolean flag3 = func_150176_g(worldIn, x, y, z + 1, 0) || !worldIn.getBlock(x, y, z + 1).isNormalCube() && func_150176_g(worldIn, x, y - 1, z + 1, -1); + + if (!worldIn.getBlock(x, y + 1, z).isNormalCube()) + { + if (worldIn.getBlock(x - 1, y, z).isNormalCube() && func_150176_g(worldIn, x - 1, y + 1, z, -1)) + { + flag = true; + } + + if (worldIn.getBlock(x + 1, y, z).isNormalCube() && func_150176_g(worldIn, x + 1, y + 1, z, -1)) + { + flag1 = true; + } + + if (worldIn.getBlock(x, y, z - 1).isNormalCube() && func_150176_g(worldIn, x, y + 1, z - 1, -1)) + { + flag2 = true; + } + + if (worldIn.getBlock(x, y, z + 1).isNormalCube() && func_150176_g(worldIn, x, y + 1, z + 1, -1)) + { + flag3 = true; + } + } + + return !flag2 && !flag1 && !flag && !flag3 && side >= 2 && side <= 5 ? i1 : (side == 2 && flag2 && !flag && !flag1 ? i1 : (side == 3 && flag3 && !flag && !flag1 ? i1 : (side == 4 && flag && !flag2 && !flag3 ? i1 : (side == 5 && flag1 && !flag2 && !flag3 ? i1 : 0)))); + } + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return this.field_150181_a; + } + + /** + * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal + * notch-side, this can be 0, 1, 2, 3 or -1) + */ + public static boolean isPowerProviderOrWire(IBlockAccess p_150174_0_, int p_150174_1_, int p_150174_2_, int p_150174_3_, int p_150174_4_) + { + Block block = p_150174_0_.getBlock(p_150174_1_, p_150174_2_, p_150174_3_); + + if (block == Blocks.redstone_wire) + { + return true; + } + else if (!Blocks.unpowered_repeater.func_149907_e(block)) + { + return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_); + } + else + { + int i1 = p_150174_0_.getBlockMetadata(p_150174_1_, p_150174_2_, p_150174_3_); + return p_150174_4_ == (i1 & 3) || p_150174_4_ == Direction.rotateOpposite[i1 & 3]; + } + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l > 0) + { + double d0 = (double)x + 0.5D + ((double)random.nextFloat() - 0.5D) * 0.2D; + double d1 = (double)((float)y + 0.0625F); + double d2 = (double)z + 0.5D + ((double)random.nextFloat() - 0.5D) * 0.2D; + float f = (float)l / 15.0F; + float f1 = f * 0.6F + 0.4F; + + if (l == 0) + { + f1 = 0.0F; + } + + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + worldIn.spawnParticle("reddust", d0, d1, d2, (double)f1, (double)f2, (double)f3); + } + } + + public static boolean func_150176_g(IBlockAccess p_150176_0_, int p_150176_1_, int p_150176_2_, int p_150176_3_, int p_150176_4_) + { + if (isPowerProviderOrWire(p_150176_0_, p_150176_1_, p_150176_2_, p_150176_3_, p_150176_4_)) + { + return true; + } + else if (p_150176_0_.getBlock(p_150176_1_, p_150176_2_, p_150176_3_) == Blocks.powered_repeater) + { + int i1 = p_150176_0_.getBlockMetadata(p_150176_1_, p_150176_2_, p_150176_3_); + return p_150176_4_ == (i1 & 3); + } + else + { + return false; + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.redstone; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150182_M = reg.registerIcon(this.getTextureName() + "_" + "cross"); + this.field_150183_N = reg.registerIcon(this.getTextureName() + "_" + "line"); + this.field_150184_O = reg.registerIcon(this.getTextureName() + "_" + "cross_overlay"); + this.field_150180_P = reg.registerIcon(this.getTextureName() + "_" + "line_overlay"); + this.blockIcon = this.field_150182_M; + } + + @SideOnly(Side.CLIENT) + public static IIcon getRedstoneWireIcon(String p_150173_0_) + { + return p_150173_0_.equals("cross") ? Blocks.redstone_wire.field_150182_M : (p_150173_0_.equals("line") ? Blocks.redstone_wire.field_150183_N : (p_150173_0_.equals("cross_overlay") ? Blocks.redstone_wire.field_150184_O : (p_150173_0_.equals("line_overlay") ? Blocks.redstone_wire.field_150180_P : null))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockReed.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockReed.java new file mode 100644 index 0000000..3e4ab31 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockReed.java @@ -0,0 +1,179 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.IPlantable; + +public class BlockReed extends Block implements IPlantable +{ + private static final String __OBFID = "CL_00000300"; + + protected BlockReed() + { + super(Material.plants); + float f = 0.375F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 1.0F, 0.5F + f); + this.setTickRandomly(true); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.getBlock(x, y - 1, z) == Blocks.reeds || this.func_150170_e(worldIn, x, y, z)) + { + if (worldIn.isAirBlock(x, y + 1, z)) + { + int l; + + for (l = 1; worldIn.getBlock(x, y - l, z) == this; ++l) + { + ; + } + + if (l < 3) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if (i1 == 15) + { + worldIn.setBlock(x, y + 1, z, this); + worldIn.setBlockMetadataWithNotify(x, y, z, 0, 4); + } + else + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1 + 1, 4); + } + } + } + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + Block block = worldIn.getBlock(x, y - 1, z); + return block.canSustainPlant(worldIn, x, y - 1, z, ForgeDirection.UP, this); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_150170_e(worldIn, x, y, z); + } + + protected final boolean func_150170_e(World p_150170_1_, int p_150170_2_, int p_150170_3_, int p_150170_4_) + { + if (!this.canBlockStay(p_150170_1_, p_150170_2_, p_150170_3_, p_150170_4_)) + { + this.dropBlockAsItem(p_150170_1_, p_150170_2_, p_150170_3_, p_150170_4_, p_150170_1_.getBlockMetadata(p_150170_2_, p_150170_3_, p_150170_4_), 0); + p_150170_1_.setBlockToAir(p_150170_2_, p_150170_3_, p_150170_4_); + return false; + } + else + { + return true; + } + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return this.canPlaceBlockAt(worldIn, x, y, z); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.reeds; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 1; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.reeds; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return worldIn.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z); + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { + return EnumPlantType.Beach; + } + + @Override + public Block getPlant(IBlockAccess world, int x, int y, int z) + { + return this; + } + + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { + return world.getBlockMetadata(x, y, z); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockRotatedPillar.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRotatedPillar.java new file mode 100644 index 0000000..015b833 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockRotatedPillar.java @@ -0,0 +1,97 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public abstract class BlockRotatedPillar extends Block +{ + @SideOnly(Side.CLIENT) + protected IIcon field_150164_N; + private static final String __OBFID = "CL_00000302"; + + protected BlockRotatedPillar(Material p_i45425_1_) + { + super(p_i45425_1_); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 31; + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = meta & 3; + byte b0 = 0; + + switch (side) + { + case 0: + case 1: + b0 = 0; + break; + case 2: + case 3: + b0 = 8; + break; + case 4: + case 5: + b0 = 4; + } + + return j1 | b0; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + int k = meta & 12; + int l = meta & 3; + return k == 0 && (side == 1 || side == 0) ? this.getTopIcon(l) : (k == 4 && (side == 5 || side == 4) ? this.getTopIcon(l) : (k == 8 && (side == 2 || side == 3) ? this.getTopIcon(l) : this.getSideIcon(l))); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta & 3; + } + + @SideOnly(Side.CLIENT) + protected abstract IIcon getSideIcon(int p_150163_1_); + + @SideOnly(Side.CLIENT) + protected IIcon getTopIcon(int p_150161_1_) + { + return this.field_150164_N; + } + + public int func_150162_k(int p_150162_1_) + { + return p_150162_1_ & 3; + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Item.getItemFromBlock(this), 1, this.func_150162_k(meta)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSand.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSand.java new file mode 100644 index 0000000..b69103e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSand.java @@ -0,0 +1,60 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockSand extends BlockFalling +{ + public static final String[] field_149838_a = new String[] {"default", "red"}; + @SideOnly(Side.CLIENT) + private static IIcon field_149837_b; + @SideOnly(Side.CLIENT) + private static IIcon field_149839_N; + private static final String __OBFID = "CL_00000303"; + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return meta == 1 ? field_149839_N : field_149837_b; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + field_149837_b = reg.registerIcon("sand"); + field_149839_N = reg.registerIcon("red_sand"); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + public MapColor getMapColor(int meta) + { + return meta == 1 ? MapColor.dirtColor : MapColor.sandColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSandStone.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSandStone.java new file mode 100644 index 0000000..db0b29f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSandStone.java @@ -0,0 +1,91 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockSandStone extends Block +{ + public static final String[] field_150157_a = new String[] {"default", "chiseled", "smooth"}; + private static final String[] field_150156_b = new String[] {"normal", "carved", "smooth"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150158_M; + @SideOnly(Side.CLIENT) + private IIcon field_150159_N; + @SideOnly(Side.CLIENT) + private IIcon field_150160_O; + private static final String __OBFID = "CL_00000304"; + + public BlockSandStone() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (side != 1 && (side != 0 || meta != 1 && meta != 2)) + { + if (side == 0) + { + return this.field_150160_O; + } + else + { + if (meta < 0 || meta >= this.field_150158_M.length) + { + meta = 0; + } + + return this.field_150158_M[meta]; + } + } + else + { + return this.field_150159_N; + } + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150158_M = new IIcon[field_150156_b.length]; + + for (int i = 0; i < this.field_150158_M.length; ++i) + { + this.field_150158_M[i] = reg.registerIcon(this.getTextureName() + "_" + field_150156_b[i]); + } + + this.field_150159_N = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150160_O = reg.registerIcon(this.getTextureName() + "_bottom"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSapling.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSapling.java new file mode 100644 index 0000000..35ca1c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSapling.java @@ -0,0 +1,248 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BlockSapling extends BlockBush implements IGrowable +{ + public static final String[] field_149882_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "roofed_oak"}; + private static final IIcon[] field_149881_b = new IIcon[field_149882_a.length]; + private static final String __OBFID = "CL_00000305"; + + protected BlockSapling() + { + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + super.updateTick(worldIn, x, y, z, random); + + if (worldIn.getBlockLightValue(x, y + 1, z) >= 9 && random.nextInt(7) == 0) + { + this.func_149879_c(worldIn, x, y, z, random); + } + } + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + meta &= 7; + return field_149881_b[MathHelper.clamp_int(meta, 0, 5)]; + } + + public void func_149879_c(World p_149879_1_, int p_149879_2_, int p_149879_3_, int p_149879_4_, Random p_149879_5_) + { + int l = p_149879_1_.getBlockMetadata(p_149879_2_, p_149879_3_, p_149879_4_); + + if ((l & 8) == 0) + { + p_149879_1_.setBlockMetadataWithNotify(p_149879_2_, p_149879_3_, p_149879_4_, l | 8, 4); + } + else + { + this.func_149878_d(p_149879_1_, p_149879_2_, p_149879_3_, p_149879_4_, p_149879_5_); + } + } + + public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_) + { + if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return; + int l = p_149878_1_.getBlockMetadata(p_149878_2_, p_149878_3_, p_149878_4_) & 7; + Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + int i1 = 0; + int j1 = 0; + boolean flag = false; + + switch (l) + { + case 0: + default: + break; + case 1: + label78: + + for (i1 = 0; i1 >= -1; --i1) + { + for (j1 = 0; j1 >= -1; --j1) + { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, 1) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, 1)) + { + object = new WorldGenMegaPineTree(false, p_149878_5_.nextBoolean()); + flag = true; + break label78; + } + } + } + + if (!flag) + { + j1 = 0; + i1 = 0; + object = new WorldGenTaiga2(true); + } + + break; + case 2: + object = new WorldGenForest(true, false); + break; + case 3: + label93: + + for (i1 = 0; i1 >= -1; --i1) + { + for (j1 = 0; j1 >= -1; --j1) + { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, 3) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, 3)) + { + object = new WorldGenMegaJungle(true, 10, 20, 3, 3); + flag = true; + break label93; + } + } + } + + if (!flag) + { + j1 = 0; + i1 = 0; + object = new WorldGenTrees(true, 4 + p_149878_5_.nextInt(7), 3, 3, false); + } + + break; + case 4: + object = new WorldGenSavannaTree(true); + break; + case 5: + label108: + + for (i1 = 0; i1 >= -1; --i1) + { + for (j1 = 0; j1 >= -1; --j1) + { + if (this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, 5) && this.func_149880_a(p_149878_1_, p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, 5)) + { + object = new WorldGenCanopyTree(true); + flag = true; + break label108; + } + } + } + + if (!flag) + { + return; + } + } + + Block block = Blocks.air; + + if (flag) + { + p_149878_1_.setBlock(p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, block, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, block, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, block, 0, 4); + p_149878_1_.setBlock(p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, block, 0, 4); + } + else + { + p_149878_1_.setBlock(p_149878_2_, p_149878_3_, p_149878_4_, block, 0, 4); + } + + if (!((WorldGenerator)object).generate(p_149878_1_, p_149878_5_, p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1)) + { + if (flag) + { + p_149878_1_.setBlock(p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1, this, l, 4); + p_149878_1_.setBlock(p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1, this, l, 4); + p_149878_1_.setBlock(p_149878_2_ + i1, p_149878_3_, p_149878_4_ + j1 + 1, this, l, 4); + p_149878_1_.setBlock(p_149878_2_ + i1 + 1, p_149878_3_, p_149878_4_ + j1 + 1, this, l, 4); + } + else + { + p_149878_1_.setBlock(p_149878_2_, p_149878_3_, p_149878_4_, this, l, 4); + } + } + } + + public boolean func_149880_a(World p_149880_1_, int p_149880_2_, int p_149880_3_, int p_149880_4_, int p_149880_5_) + { + return p_149880_1_.getBlock(p_149880_2_, p_149880_3_, p_149880_4_) == this && (p_149880_1_.getBlockMetadata(p_149880_2_, p_149880_3_, p_149880_4_) & 7) == p_149880_5_; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return MathHelper.clamp_int(meta & 7, 0, 5); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + list.add(new ItemStack(itemIn, 1, 3)); + list.add(new ItemStack(itemIn, 1, 4)); + list.add(new ItemStack(itemIn, 1, 5)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + for (int i = 0; i < field_149881_b.length; ++i) + { + field_149881_b[i] = reg.registerIcon(this.getTextureName() + "_" + field_149882_a[i]); + } + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + return true; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return (double)worldIn.rand.nextFloat() < 0.45D; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + this.func_149879_c(worldIn, x, y, z, random); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSign.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSign.java new file mode 100644 index 0000000..949bf64 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSign.java @@ -0,0 +1,209 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSign extends BlockContainer +{ + private Class field_149968_a; + private boolean field_149967_b; + private static final String __OBFID = "CL_00000306"; + + protected BlockSign(Class p_i45426_1_, boolean p_i45426_2_) + { + super(Material.wood); + this.field_149967_b = p_i45426_2_; + this.field_149968_a = p_i45426_1_; + float f = 0.25F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.planks.getBlockTextureFromSide(side); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + if (!this.field_149967_b) + { + int l = worldIn.getBlockMetadata(x, y, z); + float f = 0.28125F; + float f1 = 0.78125F; + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + + if (l == 2) + { + this.setBlockBounds(f2, f, 1.0F - f4, f3, f1, 1.0F); + } + + if (l == 3) + { + this.setBlockBounds(f2, f, 0.0F, f3, f1, f4); + } + + if (l == 4) + { + this.setBlockBounds(1.0F - f4, f, f2, 1.0F, f1, f3); + } + + if (l == 5) + { + this.setBlockBounds(0.0F, f, f2, f4, f1, f3); + } + } + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return true; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + try + { + return (TileEntity)this.field_149968_a.newInstance(); + } + catch (Exception exception) + { + throw new RuntimeException(exception); + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.sign; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + boolean flag = false; + + if (this.field_149967_b) + { + if (!worldIn.getBlock(x, y - 1, z).getMaterial().isSolid()) + { + flag = true; + } + } + else + { + int l = worldIn.getBlockMetadata(x, y, z); + flag = true; + + if (l == 2 && worldIn.getBlock(x, y, z + 1).getMaterial().isSolid()) + { + flag = false; + } + + if (l == 3 && worldIn.getBlock(x, y, z - 1).getMaterial().isSolid()) + { + flag = false; + } + + if (l == 4 && worldIn.getBlock(x + 1, y, z).getMaterial().isSolid()) + { + flag = false; + } + + if (l == 5 && worldIn.getBlock(x - 1, y, z).getMaterial().isSolid()) + { + flag = false; + } + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.sign; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSilverfish.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSilverfish.java new file mode 100644 index 0000000..f323524 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSilverfish.java @@ -0,0 +1,190 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import org.apache.commons.lang3.tuple.ImmutablePair; + +public class BlockSilverfish extends Block +{ + public static final String[] field_150198_a = new String[] {"stone", "cobble", "brick", "mossybrick", "crackedbrick", "chiseledbrick"}; + private static final String __OBFID = "CL_00000271"; + + public BlockSilverfish() + { + super(Material.clay); + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + switch (meta) + { + case 1: + return Blocks.cobblestone.getBlockTextureFromSide(side); + case 2: + return Blocks.stonebrick.getBlockTextureFromSide(side); + case 3: + return Blocks.stonebrick.getIcon(side, 1); + case 4: + return Blocks.stonebrick.getIcon(side, 2); + case 5: + return Blocks.stonebrick.getIcon(side, 3); + default: + return Blocks.stone.getBlockTextureFromSide(side); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World worldIn, int x, int y, int z, int meta) + { + if (!worldIn.isRemote) + { + EntitySilverfish entitysilverfish = new EntitySilverfish(worldIn); + entitysilverfish.setLocationAndAngles((double)x + 0.5D, (double)y, (double)z + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysilverfish); + entitysilverfish.spawnExplosionParticle(); + } + + super.onBlockDestroyedByPlayer(worldIn, x, y, z, meta); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + public static boolean func_150196_a(Block p_150196_0_) + { + return p_150196_0_ == Blocks.stone || p_150196_0_ == Blocks.cobblestone || p_150196_0_ == Blocks.stonebrick; + } + + public static int func_150195_a(Block p_150195_0_, int p_150195_1_) + { + if (p_150195_1_ == 0) + { + if (p_150195_0_ == Blocks.cobblestone) + { + return 1; + } + + if (p_150195_0_ == Blocks.stonebrick) + { + return 2; + } + } + else if (p_150195_0_ == Blocks.stonebrick) + { + switch (p_150195_1_) + { + case 1: + return 3; + case 2: + return 4; + case 3: + return 5; + } + } + + return 0; + } + + public static ImmutablePair func_150197_b(int p_150197_0_) + { + switch (p_150197_0_) + { + case 1: + return new ImmutablePair(Blocks.cobblestone, Integer.valueOf(0)); + case 2: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(0)); + case 3: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(1)); + case 4: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(2)); + case 5: + return new ImmutablePair(Blocks.stonebrick, Integer.valueOf(3)); + default: + return new ImmutablePair(Blocks.stone, Integer.valueOf(0)); + } + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + switch (meta) + { + case 1: + return new ItemStack(Blocks.cobblestone); + case 2: + return new ItemStack(Blocks.stonebrick); + case 3: + return new ItemStack(Blocks.stonebrick, 1, 1); + case 4: + return new ItemStack(Blocks.stonebrick, 1, 2); + case 5: + return new ItemStack(Blocks.stonebrick, 1, 3); + default: + return new ItemStack(Blocks.stone); + } + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + if (!worldIn.isRemote) + { + EntitySilverfish entitysilverfish = new EntitySilverfish(worldIn); + entitysilverfish.setLocationAndAngles((double)x + 0.5D, (double)y, (double)z + 0.5D, 0.0F, 0.0F); + worldIn.spawnEntityInWorld(entitysilverfish); + entitysilverfish.spawnExplosionParticle(); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return worldIn.getBlockMetadata(x, y, z); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < field_150198_a.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSkull.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSkull.java new file mode 100644 index 0000000..eb36a40 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSkull.java @@ -0,0 +1,344 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSkull extends BlockContainer +{ + private static final String __OBFID = "CL_00000307"; + + protected BlockSkull() + { + super(Material.circuits); + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return -1; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + + switch (l) + { + case 1: + default: + this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + break; + case 2: + this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); + break; + case 3: + this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); + break; + case 4: + this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); + break; + case 5: + this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); + } + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileEntitySkull(); + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.skull; + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + TileEntity tileentity = worldIn.getTileEntity(x, y, z); + return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() : super.getDamageValue(worldIn, x, y, z); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (player.capabilities.isCreativeMode) + { + meta |= 8; + worldIn.setBlockMetadataWithNotify(x, y, z, meta, 4); + } + this.dropBlockAsItem(worldIn, x, y, z, meta, 0); + + super.onBlockHarvested(worldIn, x, y, z, meta, player); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + @Override + public ArrayList getDrops(World worldIn, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); + { + if ((meta & 8) == 0) + { + ItemStack itemstack = new ItemStack(Items.skull, 1, this.getDamageValue(worldIn, x, y, z)); + TileEntitySkull tileentityskull = (TileEntitySkull)worldIn.getTileEntity(x, y, z); + + if (tileentityskull == null) return ret; + + if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) + { + itemstack.setTagCompound(new NBTTagCompound()); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTUtil.func_152460_a(nbttagcompound, tileentityskull.func_152108_a()); + itemstack.getTagCompound().setTag("SkullOwner", nbttagcompound); + } + + ret.add(itemstack); + } + } + return ret; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.skull; + } + + public void func_149965_a(World p_149965_1_, int p_149965_2_, int p_149965_3_, int p_149965_4_, TileEntitySkull p_149965_5_) + { + if (p_149965_5_.func_145904_a() == 1 && p_149965_3_ >= 2 && p_149965_1_.difficultySetting != EnumDifficulty.PEACEFUL && !p_149965_1_.isRemote) + { + int l; + EntityWither entitywither; + Iterator iterator; + EntityPlayer entityplayer; + int i1; + + for (l = -2; l <= 0; ++l) + { + if (p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 1) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + l + 1) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 2) == Blocks.soul_sand && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + l, 1) && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + l + 1, 1) && this.func_149966_a(p_149965_1_, p_149965_2_, p_149965_3_, p_149965_4_ + l + 2, 1)) + { + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + l, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + l + 1, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_, p_149965_3_, p_149965_4_ + l + 2, 8, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + l, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + l + 1, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_, p_149965_4_ + l + 2, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 1, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 2, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + l + 1, getBlockById(0), 0, 2); + + if (!p_149965_1_.isRemote) + { + entitywither = new EntityWither(p_149965_1_); + entitywither.setLocationAndAngles((double)p_149965_2_ + 0.5D, (double)p_149965_3_ - 1.45D, (double)(p_149965_4_ + l) + 1.5D, 90.0F, 0.0F); + entitywither.renderYawOffset = 90.0F; + entitywither.func_82206_m(); + + if (!p_149965_1_.isRemote) + { + iterator = p_149965_1_.getEntitiesWithinAABB(EntityPlayer.class, entitywither.boundingBox.expand(50.0D, 50.0D, 50.0D)).iterator(); + + while (iterator.hasNext()) + { + entityplayer = (EntityPlayer)iterator.next(); + entityplayer.triggerAchievement(AchievementList.field_150963_I); + } + } + + p_149965_1_.spawnEntityInWorld(entitywither); + } + + for (i1 = 0; i1 < 120; ++i1) + { + p_149965_1_.spawnParticle("snowballpoof", (double)p_149965_2_ + p_149965_1_.rand.nextDouble(), (double)(p_149965_3_ - 2) + p_149965_1_.rand.nextDouble() * 3.9D, (double)(p_149965_4_ + l + 1) + p_149965_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + l, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + l + 1, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_, p_149965_4_ + l + 2, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 1, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 1, p_149965_4_ + l + 2, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_, p_149965_3_ - 2, p_149965_4_ + l + 1, getBlockById(0)); + return; + } + } + + for (l = -2; l <= 0; ++l) + { + if (p_149965_1_.getBlock(p_149965_2_ + l, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + l + 1, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + l + 1, p_149965_3_ - 2, p_149965_4_) == Blocks.soul_sand && p_149965_1_.getBlock(p_149965_2_ + l + 2, p_149965_3_ - 1, p_149965_4_) == Blocks.soul_sand && this.func_149966_a(p_149965_1_, p_149965_2_ + l, p_149965_3_, p_149965_4_, 1) && this.func_149966_a(p_149965_1_, p_149965_2_ + l + 1, p_149965_3_, p_149965_4_, 1) && this.func_149966_a(p_149965_1_, p_149965_2_ + l + 2, p_149965_3_, p_149965_4_, 1)) + { + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + l, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + l + 1, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlockMetadataWithNotify(p_149965_2_ + l + 2, p_149965_3_, p_149965_4_, 8, 2); + p_149965_1_.setBlock(p_149965_2_ + l, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l + 1, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l + 2, p_149965_3_, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l + 1, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l + 2, p_149965_3_ - 1, p_149965_4_, getBlockById(0), 0, 2); + p_149965_1_.setBlock(p_149965_2_ + l + 1, p_149965_3_ - 2, p_149965_4_, getBlockById(0), 0, 2); + + if (!p_149965_1_.isRemote) + { + entitywither = new EntityWither(p_149965_1_); + entitywither.setLocationAndAngles((double)(p_149965_2_ + l) + 1.5D, (double)p_149965_3_ - 1.45D, (double)p_149965_4_ + 0.5D, 0.0F, 0.0F); + entitywither.func_82206_m(); + + if (!p_149965_1_.isRemote) + { + iterator = p_149965_1_.getEntitiesWithinAABB(EntityPlayer.class, entitywither.boundingBox.expand(50.0D, 50.0D, 50.0D)).iterator(); + + while (iterator.hasNext()) + { + entityplayer = (EntityPlayer)iterator.next(); + entityplayer.triggerAchievement(AchievementList.field_150963_I); + } + } + + p_149965_1_.spawnEntityInWorld(entitywither); + } + + for (i1 = 0; i1 < 120; ++i1) + { + p_149965_1_.spawnParticle("snowballpoof", (double)(p_149965_2_ + l + 1) + p_149965_1_.rand.nextDouble(), (double)(p_149965_3_ - 2) + p_149965_1_.rand.nextDouble() * 3.9D, (double)p_149965_4_ + p_149965_1_.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + + p_149965_1_.notifyBlockChange(p_149965_2_ + l, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l + 1, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l + 2, p_149965_3_, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l + 1, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l + 2, p_149965_3_ - 1, p_149965_4_, getBlockById(0)); + p_149965_1_.notifyBlockChange(p_149965_2_ + l + 1, p_149965_3_ - 2, p_149965_4_, getBlockById(0)); + return; + } + } + } + } + + private boolean func_149966_a(World p_149966_1_, int p_149966_2_, int p_149966_3_, int p_149966_4_, int p_149966_5_) + { + if (p_149966_1_.getBlock(p_149966_2_, p_149966_3_, p_149966_4_) != this) + { + return false; + } + else + { + TileEntity tileentity = p_149966_1_.getTileEntity(p_149966_2_, p_149966_3_, p_149966_4_); + return tileentity != null && tileentity instanceof TileEntitySkull ? ((TileEntitySkull)tileentity).func_145904_a() == p_149966_5_ : false; + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.soul_sand.getBlockTextureFromSide(side); + } + + /** + * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. + */ + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return this.getTextureName() + "_" + ItemSkull.field_94587_a[0]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSlab.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSlab.java new file mode 100644 index 0000000..ede4c08 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSlab.java @@ -0,0 +1,177 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class BlockSlab extends Block +{ + protected final boolean field_150004_a; + private static final String __OBFID = "CL_00000253"; + + public BlockSlab(boolean p_i45410_1_, Material p_i45410_2_) + { + super(p_i45410_2_); + this.field_150004_a = p_i45410_1_; + + if (p_i45410_1_) + { + this.opaque = true; + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + + this.setLightOpacity(255); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + if (this.field_150004_a) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + boolean flag = (worldIn.getBlockMetadata(x, y, z) & 8) != 0; + + if (flag) + { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + if (this.field_150004_a) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return this.field_150004_a; + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + return this.field_150004_a ? meta : (side != 0 && (side == 1 || (double)subY <= 0.5D) ? meta : meta | 8); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return this.field_150004_a ? 2 : 1; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta & 7; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return this.field_150004_a; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + if (this.field_150004_a) + { + return super.shouldSideBeRendered(worldIn, x, y, z, side); + } + else if (side != 1 && side != 0 && !super.shouldSideBeRendered(worldIn, x, y, z, side)) + { + return false; + } + else + { + int i1 = x + Facing.offsetsXForSide[Facing.oppositeSide[side]]; + int j1 = y + Facing.offsetsYForSide[Facing.oppositeSide[side]]; + int k1 = z + Facing.offsetsZForSide[Facing.oppositeSide[side]]; + boolean flag = (worldIn.getBlockMetadata(i1, j1, k1) & 8) != 0; + return flag ? (side == 0 ? true : (side == 1 && super.shouldSideBeRendered(worldIn, x, y, z, side) ? true : !func_150003_a(worldIn.getBlock(x, y, z)) || (worldIn.getBlockMetadata(x, y, z) & 8) == 0)) : (side == 1 ? true : (side == 0 && super.shouldSideBeRendered(worldIn, x, y, z, side) ? true : !func_150003_a(worldIn.getBlock(x, y, z)) || (worldIn.getBlockMetadata(x, y, z) & 8) != 0)); + } + } + + @SideOnly(Side.CLIENT) + private static boolean func_150003_a(Block p_150003_0_) + { + return p_150003_0_ == Blocks.stone_slab || p_150003_0_ == Blocks.wooden_slab; + } + + public abstract String func_150002_b(int p_150002_1_); + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return super.getDamageValue(worldIn, x, y, z) & 7; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return func_150003_a(this) ? Item.getItemFromBlock(this) : (this == Blocks.double_stone_slab ? Item.getItemFromBlock(Blocks.stone_slab) : (this == Blocks.double_wooden_slab ? Item.getItemFromBlock(Blocks.wooden_slab) : Item.getItemFromBlock(Blocks.stone_slab))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnow.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnow.java new file mode 100644 index 0000000..fdc9c74 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnow.java @@ -0,0 +1,194 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockSnow extends Block +{ + private static final String __OBFID = "CL_00000309"; + + protected BlockSnow() + { + super(Material.snow); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_150154_b(0); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("snow"); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + float f = 0.125F; + return AxisAlignedBB.getBoundingBox((double)x + this.minX, (double)y + this.minY, (double)z + this.minZ, (double)x + this.maxX, (double)((float)y + (float)l * f), (double)z + this.maxZ); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.func_150154_b(0); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_150154_b(worldIn.getBlockMetadata(x, y, z)); + } + + protected void func_150154_b(int p_150154_1_) + { + int j = p_150154_1_ & 7; + float f = (float)(2 * (1 + j)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + Block block = worldIn.getBlock(x, y - 1, z); + return block != Blocks.ice && block != Blocks.packed_ice ? (block.isLeaves(worldIn, x, y - 1, z) ? true : (block == this && (worldIn.getBlockMetadata(x, y - 1, z) & 7) == 7 ? true : block.isOpaqueCube() && block.blockMaterial.blocksMovement())) : false; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_150155_m(worldIn, x, y, z); + } + + private boolean func_150155_m(World p_150155_1_, int p_150155_2_, int p_150155_3_, int p_150155_4_) + { + if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) + { + p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_); + return false; + } + else + { + return true; + } + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + super.harvestBlock(worldIn, player, x, y, z, meta); + worldIn.setBlockToAir(x, y, z); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.snowball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.getSavedLightValue(EnumSkyBlock.Block, x, y, z) > 11) + { + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 1 ? true : super.shouldSideBeRendered(worldIn, x, y, z, side); + } + + /** + * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) + * version in 1.1. + * + * @param meta Blocks Metadata + * @param fortune Current item fortune level + * @param random Random number generator + * @return The number of items to drop + */ + public int quantityDropped(int meta, int fortune, Random random) + { + return (meta & 7) + 1; + } + + /** + * Determines if a new block can be replace the space occupied by this one, + * Used in the player's placement code to make the block act like water, and lava. + * + * @param world The current world + * @param x X Position + * @param y Y position + * @param z Z position + * @return True if the block is replaceable by another block + */ + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + return meta >= 7 ? false : blockMaterial.isReplaceable(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnowBlock.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnowBlock.java new file mode 100644 index 0000000..0123e6c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSnowBlock.java @@ -0,0 +1,46 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class BlockSnowBlock extends Block +{ + private static final String __OBFID = "CL_00000308"; + + protected BlockSnowBlock() + { + super(Material.craftedSnow); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.snowball; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 4; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (worldIn.getSavedLightValue(EnumSkyBlock.Block, x, y, z) > 11) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSoulSand.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSoulSand.java new file mode 100644 index 0000000..e35363a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSoulSand.java @@ -0,0 +1,37 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockSoulSand extends Block +{ + private static final String __OBFID = "CL_00000310"; + + public BlockSoulSand() + { + super(Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + float f = 0.125F; + return AxisAlignedBB.getBoundingBox((double)x, (double)y, (double)z, (double)(x + 1), (double)((float)(y + 1) - f), (double)(z + 1)); + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + entityIn.motionX *= 0.4D; + entityIn.motionZ *= 0.4D; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSourceImpl.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSourceImpl.java new file mode 100644 index 0000000..2c7aecd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSourceImpl.java @@ -0,0 +1,67 @@ +package net.minecraft.block; + +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockSourceImpl implements IBlockSource +{ + private final World worldObj; + private final int xPos; + private final int yPos; + private final int zPos; + private static final String __OBFID = "CL_00001194"; + + public BlockSourceImpl(World p_i1365_1_, int p_i1365_2_, int p_i1365_3_, int p_i1365_4_) + { + this.worldObj = p_i1365_1_; + this.xPos = p_i1365_2_; + this.yPos = p_i1365_3_; + this.zPos = p_i1365_4_; + } + + public World getWorld() + { + return this.worldObj; + } + + public double getX() + { + return (double)this.xPos + 0.5D; + } + + public double getY() + { + return (double)this.yPos + 0.5D; + } + + public double getZ() + { + return (double)this.zPos + 0.5D; + } + + public int getXInt() + { + return this.xPos; + } + + public int getYInt() + { + return this.yPos; + } + + public int getZInt() + { + return this.zPos; + } + + public int getBlockMetadata() + { + return this.worldObj.getBlockMetadata(this.xPos, this.yPos, this.zPos); + } + + public TileEntity getBlockTileEntity() + { + return this.worldObj.getTileEntity(this.xPos, this.yPos, this.zPos); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockSponge.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSponge.java new file mode 100644 index 0000000..ab51314 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockSponge.java @@ -0,0 +1,15 @@ +package net.minecraft.block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class BlockSponge extends Block +{ + private static final String __OBFID = "CL_00000311"; + + protected BlockSponge() + { + super(Material.sponge); + this.setCreativeTab(CreativeTabs.tabBlock); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlass.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlass.java new file mode 100644 index 0000000..73e7f05 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlass.java @@ -0,0 +1,102 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStainedGlass extends BlockBreakable +{ + private static final IIcon[] field_149998_a = new IIcon[16]; + private static final String __OBFID = "CL_00000312"; + + public BlockStainedGlass(Material p_i45427_1_) + { + super("glass", p_i45427_1_, false); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return field_149998_a[meta % field_149998_a.length]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + @SideOnly(Side.CLIENT) + public static int func_149997_b(int p_149997_0_) + { + return ~p_149997_0_ & 15; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < field_149998_a.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + for (int i = 0; i < field_149998_a.length; ++i) + { + field_149998_a[i] = reg.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_149997_b(i)]); + } + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + return true; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlassPane.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlassPane.java new file mode 100644 index 0000000..3783818 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStainedGlassPane.java @@ -0,0 +1,93 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStainedGlassPane extends BlockPane +{ + private static final IIcon[] field_150106_a = new IIcon[16]; + private static final IIcon[] field_150105_b = new IIcon[16]; + private static final String __OBFID = "CL_00000313"; + + public BlockStainedGlassPane() + { + super("glass", "glass_pane_top", Material.glass, false); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + @SideOnly(Side.CLIENT) + public IIcon func_149735_b(int side, int meta) + { + return field_150106_a[meta % field_150106_a.length]; + } + + @SideOnly(Side.CLIENT) + public IIcon func_150104_b(int p_150104_1_) + { + return field_150105_b[~p_150104_1_ & 15]; + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.func_149735_b(side, ~meta & 15); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + @SideOnly(Side.CLIENT) + public static int func_150103_c(int p_150103_0_) + { + return p_150103_0_ & 15; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < field_150106_a.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + super.registerBlockIcons(reg); + + for (int i = 0; i < field_150106_a.length; ++i) + { + field_150106_a[i] = reg.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150103_c(i)]); + field_150105_b[i] = reg.registerIcon(this.getTextureName() + "_pane_top_" + ItemDye.field_150921_b[func_150103_c(i)]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStairs.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStairs.java new file mode 100644 index 0000000..d65f5d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStairs.java @@ -0,0 +1,638 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockStairs extends Block +{ + private static final int[][] field_150150_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; + private final Block field_150149_b; + private final int field_150151_M; + private boolean field_150152_N; + private int field_150153_O; + private static final String __OBFID = "CL_00000314"; + + protected BlockStairs(Block p_i45428_1_, int p_i45428_2_) + { + super(p_i45428_1_.blockMaterial); + this.field_150149_b = p_i45428_1_; + this.field_150151_M = p_i45428_2_; + this.setHardness(p_i45428_1_.blockHardness); + this.setResistance(p_i45428_1_.blockResistance / 3.0F); + this.setStepSound(p_i45428_1_.stepSound); + this.setLightOpacity(255); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + if (this.field_150152_N) + { + this.setBlockBounds(0.5F * (float)(this.field_150153_O % 2), 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F * (float)(this.field_150153_O / 4 % 2), 0.5F + 0.5F * (float)(this.field_150153_O % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 4 % 2)); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 10; + } + + public void func_150147_e(IBlockAccess p_150147_1_, int p_150147_2_, int p_150147_3_, int p_150147_4_) + { + int l = p_150147_1_.getBlockMetadata(p_150147_2_, p_150147_3_, p_150147_4_); + + if ((l & 4) != 0) + { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } + + public static boolean func_150148_a(Block p_150148_0_) + { + return p_150148_0_ instanceof BlockStairs; + } + + private boolean func_150146_f(IBlockAccess p_150146_1_, int p_150146_2_, int p_150146_3_, int p_150146_4_, int p_150146_5_) + { + Block block = p_150146_1_.getBlock(p_150146_2_, p_150146_3_, p_150146_4_); + return func_150148_a(block) && p_150146_1_.getBlockMetadata(p_150146_2_, p_150146_3_, p_150146_4_) == p_150146_5_; + } + + public boolean func_150145_f(IBlockAccess p_150145_1_, int p_150145_2_, int p_150145_3_, int p_150145_4_) + { + int l = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_); + int i1 = l & 3; + float f = 0.5F; + float f1 = 1.0F; + + if ((l & 4) != 0) + { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.5F; + boolean flag = true; + Block block; + int j1; + int k1; + + if (i1 == 0) + { + f2 = 0.5F; + f5 = 1.0F; + block = p_150145_1_.getBlock(p_150145_2_ + 1, p_150145_3_, p_150145_4_); + j1 = p_150145_1_.getBlockMetadata(p_150145_2_ + 1, p_150145_3_, p_150145_4_); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 3 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ + 1, l)) + { + f5 = 0.5F; + flag = false; + } + else if (k1 == 2 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ - 1, l)) + { + f4 = 0.5F; + flag = false; + } + } + } + else if (i1 == 1) + { + f3 = 0.5F; + f5 = 1.0F; + block = p_150145_1_.getBlock(p_150145_2_ - 1, p_150145_3_, p_150145_4_); + j1 = p_150145_1_.getBlockMetadata(p_150145_2_ - 1, p_150145_3_, p_150145_4_); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 3 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ + 1, l)) + { + f5 = 0.5F; + flag = false; + } + else if (k1 == 2 && !this.func_150146_f(p_150145_1_, p_150145_2_, p_150145_3_, p_150145_4_ - 1, l)) + { + f4 = 0.5F; + flag = false; + } + } + } + else if (i1 == 2) + { + f4 = 0.5F; + f5 = 1.0F; + block = p_150145_1_.getBlock(p_150145_2_, p_150145_3_, p_150145_4_ + 1); + j1 = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_ + 1); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 1 && !this.func_150146_f(p_150145_1_, p_150145_2_ + 1, p_150145_3_, p_150145_4_, l)) + { + f3 = 0.5F; + flag = false; + } + else if (k1 == 0 && !this.func_150146_f(p_150145_1_, p_150145_2_ - 1, p_150145_3_, p_150145_4_, l)) + { + f2 = 0.5F; + flag = false; + } + } + } + else if (i1 == 3) + { + block = p_150145_1_.getBlock(p_150145_2_, p_150145_3_, p_150145_4_ - 1); + j1 = p_150145_1_.getBlockMetadata(p_150145_2_, p_150145_3_, p_150145_4_ - 1); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 1 && !this.func_150146_f(p_150145_1_, p_150145_2_ + 1, p_150145_3_, p_150145_4_, l)) + { + f3 = 0.5F; + flag = false; + } + else if (k1 == 0 && !this.func_150146_f(p_150145_1_, p_150145_2_ - 1, p_150145_3_, p_150145_4_, l)) + { + f2 = 0.5F; + flag = false; + } + } + } + + this.setBlockBounds(f2, f, f4, f3, f1, f5); + return flag; + } + + public boolean func_150144_g(IBlockAccess p_150144_1_, int p_150144_2_, int p_150144_3_, int p_150144_4_) + { + int l = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_); + int i1 = l & 3; + float f = 0.5F; + float f1 = 1.0F; + + if ((l & 4) != 0) + { + f = 0.0F; + f1 = 0.5F; + } + + float f2 = 0.0F; + float f3 = 0.5F; + float f4 = 0.5F; + float f5 = 1.0F; + boolean flag = false; + Block block; + int j1; + int k1; + + if (i1 == 0) + { + block = p_150144_1_.getBlock(p_150144_2_ - 1, p_150144_3_, p_150144_4_); + j1 = p_150144_1_.getBlockMetadata(p_150144_2_ - 1, p_150144_3_, p_150144_4_); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 3 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ - 1, l)) + { + f4 = 0.0F; + f5 = 0.5F; + flag = true; + } + else if (k1 == 2 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ + 1, l)) + { + f4 = 0.5F; + f5 = 1.0F; + flag = true; + } + } + } + else if (i1 == 1) + { + block = p_150144_1_.getBlock(p_150144_2_ + 1, p_150144_3_, p_150144_4_); + j1 = p_150144_1_.getBlockMetadata(p_150144_2_ + 1, p_150144_3_, p_150144_4_); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + f2 = 0.5F; + f3 = 1.0F; + k1 = j1 & 3; + + if (k1 == 3 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ - 1, l)) + { + f4 = 0.0F; + f5 = 0.5F; + flag = true; + } + else if (k1 == 2 && !this.func_150146_f(p_150144_1_, p_150144_2_, p_150144_3_, p_150144_4_ + 1, l)) + { + f4 = 0.5F; + f5 = 1.0F; + flag = true; + } + } + } + else if (i1 == 2) + { + block = p_150144_1_.getBlock(p_150144_2_, p_150144_3_, p_150144_4_ - 1); + j1 = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_ - 1); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + f4 = 0.0F; + f5 = 0.5F; + k1 = j1 & 3; + + if (k1 == 1 && !this.func_150146_f(p_150144_1_, p_150144_2_ - 1, p_150144_3_, p_150144_4_, l)) + { + flag = true; + } + else if (k1 == 0 && !this.func_150146_f(p_150144_1_, p_150144_2_ + 1, p_150144_3_, p_150144_4_, l)) + { + f2 = 0.5F; + f3 = 1.0F; + flag = true; + } + } + } + else if (i1 == 3) + { + block = p_150144_1_.getBlock(p_150144_2_, p_150144_3_, p_150144_4_ + 1); + j1 = p_150144_1_.getBlockMetadata(p_150144_2_, p_150144_3_, p_150144_4_ + 1); + + if (func_150148_a(block) && (l & 4) == (j1 & 4)) + { + k1 = j1 & 3; + + if (k1 == 1 && !this.func_150146_f(p_150144_1_, p_150144_2_ - 1, p_150144_3_, p_150144_4_, l)) + { + flag = true; + } + else if (k1 == 0 && !this.func_150146_f(p_150144_1_, p_150144_2_ + 1, p_150144_3_, p_150144_4_, l)) + { + f2 = 0.5F; + f3 = 1.0F; + flag = true; + } + } + } + + if (flag) + { + this.setBlockBounds(f2, f, f4, f3, f1, f5); + } + + return flag; + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + public void addCollisionBoxesToList(World worldIn, int x, int y, int z, AxisAlignedBB mask, List list, Entity collider) + { + this.func_150147_e(worldIn, x, y, z); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + boolean flag = this.func_150145_f(worldIn, x, y, z); + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + + if (flag && this.func_150144_g(worldIn, x, y, z)) + { + super.addCollisionBoxesToList(worldIn, x, y, z, mask, list, collider); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) + { + this.field_150149_b.onBlockClicked(worldIn, x, y, z, player); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + this.field_150149_b.randomDisplayTick(worldIn, x, y, z, random); + } + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World worldIn, int x, int y, int z, int meta) + { + this.field_150149_b.onBlockDestroyedByPlayer(worldIn, x, y, z, meta); + } + + /** + * Returns how much this block can resist explosions from the passed in entity. + */ + public float getExplosionResistance(Entity exploder) + { + return this.field_150149_b.getExplosionResistance(exploder); + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return this.field_150149_b.tickRate(worldIn); + } + + /** + * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d + */ + public void velocityToAddToEntity(World worldIn, int x, int y, int z, Entity entityIn, Vec3 velocity) + { + this.field_150149_b.velocityToAddToEntity(worldIn, x, y, z, entityIn, velocity); + } + + /** + * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z + */ + @SideOnly(Side.CLIENT) + public int getMixedBrightnessForBlock(IBlockAccess worldIn, int x, int y, int z) + { + return this.field_150149_b.getMixedBrightnessForBlock(worldIn, x, y, z); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return this.field_150149_b.getRenderBlockPass(); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return this.field_150149_b.getIcon(side, this.field_150151_M); + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return this.field_150149_b.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Returns if this block is collidable (only used by Fire). Args: x, y, z + */ + public boolean isCollidable() + { + return this.field_150149_b.isCollidable(); + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + public boolean canCollideCheck(int meta, boolean includeLiquid) + { + return this.field_150149_b.canCollideCheck(meta, includeLiquid); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return this.field_150149_b.canPlaceBlockAt(worldIn, x, y, z); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + this.onNeighborBlockChange(worldIn, x, y, z, Blocks.air); + this.field_150149_b.onBlockAdded(worldIn, x, y, z); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + this.field_150149_b.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + /** + * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity + */ + public void onEntityWalking(World worldIn, int x, int y, int z, Entity entityIn) + { + this.field_150149_b.onEntityWalking(worldIn, x, y, z, entityIn); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + this.field_150149_b.updateTick(worldIn, x, y, z, random); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + return this.field_150149_b.onBlockActivated(worldIn, x, y, z, player, 0, 0.0F, 0.0F, 0.0F); + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World worldIn, int x, int y, int z, Explosion explosionIn) + { + this.field_150149_b.onBlockDestroyedByExplosion(worldIn, x, y, z, explosionIn); + } + + public MapColor getMapColor(int meta) + { + return this.field_150149_b.getMapColor(this.field_150151_M); + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World worldIn, int x, int y, int z, EntityLivingBase placer, ItemStack itemIn) + { + int l = MathHelper.floor_double((double)(placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int i1 = worldIn.getBlockMetadata(x, y, z) & 4; + + if (l == 0) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 2 | i1, 2); + } + + if (l == 1) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 1 | i1, 2); + } + + if (l == 2) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 3 | i1, 2); + } + + if (l == 3) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 0 | i1, 2); + } + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + return side != 0 && (side == 1 || (double)subY <= 0.5D) ? meta : meta | 4; + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + MovingObjectPosition[] amovingobjectposition = new MovingObjectPosition[8]; + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = l & 3; + boolean flag = (l & 4) == 4; + int[] aint = field_150150_a[i1 + (flag?4:0)]; + this.field_150152_N = true; + int k1; + int l1; + int i2; + + for (int j1 = 0; j1 < 8; ++j1) + { + this.field_150153_O = j1; + int[] aint1 = aint; + k1 = aint.length; + + for (l1 = 0; l1 < k1; ++l1) + { + i2 = aint1[l1]; + + if (i2 == j1) + { + ; + } + } + + amovingobjectposition[j1] = super.collisionRayTrace(worldIn, x, y, z, startVec, endVec); + } + + int[] aint2 = aint; + int k2 = aint.length; + + for (k1 = 0; k1 < k2; ++k1) + { + l1 = aint2[k1]; + amovingobjectposition[l1] = null; + } + + MovingObjectPosition movingobjectposition1 = null; + double d1 = 0.0D; + MovingObjectPosition[] amovingobjectposition1 = amovingobjectposition; + i2 = amovingobjectposition.length; + + for (int j2 = 0; j2 < i2; ++j2) + { + MovingObjectPosition movingobjectposition = amovingobjectposition1[j2]; + + if (movingobjectposition != null) + { + double d0 = movingobjectposition.hitVec.squareDistanceTo(endVec); + + if (d0 > d1) + { + movingobjectposition1 = movingobjectposition; + d1 = d0; + } + } + } + + return movingobjectposition1; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStaticLiquid.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStaticLiquid.java new file mode 100644 index 0000000..24a25d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStaticLiquid.java @@ -0,0 +1,104 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BlockStaticLiquid extends BlockLiquid +{ + private static final String __OBFID = "CL_00000315"; + + protected BlockStaticLiquid(Material p_i45429_1_) + { + super(p_i45429_1_); + this.setTickRandomly(false); + + if (p_i45429_1_ == Material.lava) + { + this.setTickRandomly(true); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + super.onNeighborBlockChange(worldIn, x, y, z, neighbor); + + if (worldIn.getBlock(x, y, z) == this) + { + this.setNotStationary(worldIn, x, y, z); + } + } + + /** + * Changes the block ID to that of an updating fluid. + */ + private void setNotStationary(World p_149818_1_, int p_149818_2_, int p_149818_3_, int p_149818_4_) + { + int l = p_149818_1_.getBlockMetadata(p_149818_2_, p_149818_3_, p_149818_4_); + p_149818_1_.setBlock(p_149818_2_, p_149818_3_, p_149818_4_, Block.getBlockById(Block.getIdFromBlock(this) - 1), l, 2); + p_149818_1_.scheduleBlockUpdate(p_149818_2_, p_149818_3_, p_149818_4_, Block.getBlockById(Block.getIdFromBlock(this) - 1), this.tickRate(p_149818_1_)); + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (this.blockMaterial == Material.lava) + { + int l = random.nextInt(3); + int i1; + + for (i1 = 0; i1 < l; ++i1) + { + x += random.nextInt(3) - 1; + ++y; + z += random.nextInt(3) - 1; + Block block = worldIn.getBlock(x, y, z); + + if (block.blockMaterial == Material.air) + { + if (this.isFlammable(worldIn, x - 1, y, z) || this.isFlammable(worldIn, x + 1, y, z) || this.isFlammable(worldIn, x, y, z - 1) || this.isFlammable(worldIn, x, y, z + 1) || this.isFlammable(worldIn, x, y - 1, z) || this.isFlammable(worldIn, x, y + 1, z)) + { + worldIn.setBlock(x, y, z, Blocks.fire); + return; + } + } + else if (block.blockMaterial.blocksMovement()) + { + return; + } + } + + if (l == 0) + { + i1 = x; + int k1 = z; + + for (int j1 = 0; j1 < 3; ++j1) + { + x = i1 + random.nextInt(3) - 1; + z = k1 + random.nextInt(3) - 1; + + if (worldIn.isAirBlock(x, y + 1, z) && this.isFlammable(worldIn, x, y, z)) + { + worldIn.setBlock(x, y + 1, z, Blocks.fire); + } + } + } + } + } + + /** + * Checks to see if the block is flammable. + */ + private boolean isFlammable(World p_149817_1_, int p_149817_2_, int p_149817_3_, int p_149817_4_) + { + return p_149817_1_.getBlock(p_149817_2_, p_149817_3_, p_149817_4_).getMaterial().getCanBurn(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStem.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStem.java new file mode 100644 index 0000000..ca7e38d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStem.java @@ -0,0 +1,342 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockStem extends BlockBush implements IGrowable +{ + private final Block field_149877_a; + @SideOnly(Side.CLIENT) + private IIcon field_149876_b; + private static final String __OBFID = "CL_00000316"; + + protected BlockStem(Block p_i45430_1_) + { + this.field_149877_a = p_i45430_1_; + this.setTickRandomly(true); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + this.setCreativeTab((CreativeTabs)null); + } + + /** + * is the block grass, dirt or farmland + */ + protected boolean canPlaceBlockOn(Block ground) + { + return ground == Blocks.farmland; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + super.updateTick(worldIn, x, y, z, random); + + if (worldIn.getBlockLightValue(x, y + 1, z) >= 9) + { + float f = this.func_149875_n(worldIn, x, y, z); + + if (random.nextInt((int)(25.0F / f) + 1) == 0) + { + int l = worldIn.getBlockMetadata(x, y, z); + + if (l < 7) + { + ++l; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 2); + } + else + { + if (worldIn.getBlock(x - 1, y, z) == this.field_149877_a) + { + return; + } + + if (worldIn.getBlock(x + 1, y, z) == this.field_149877_a) + { + return; + } + + if (worldIn.getBlock(x, y, z - 1) == this.field_149877_a) + { + return; + } + + if (worldIn.getBlock(x, y, z + 1) == this.field_149877_a) + { + return; + } + + int i1 = random.nextInt(4); + int j1 = x; + int k1 = z; + + if (i1 == 0) + { + j1 = x - 1; + } + + if (i1 == 1) + { + ++j1; + } + + if (i1 == 2) + { + k1 = z - 1; + } + + if (i1 == 3) + { + ++k1; + } + + Block block = worldIn.getBlock(j1, y - 1, k1); + + if (worldIn.isAirBlock(j1, y, k1) && (block.canSustainPlant(worldIn, j1, y - 1, k1, UP, this) || block == Blocks.dirt || block == Blocks.grass)) + { + worldIn.setBlock(j1, y, k1, this.field_149877_a); + } + } + } + } + } + + public void func_149874_m(World p_149874_1_, int p_149874_2_, int p_149874_3_, int p_149874_4_) + { + int l = p_149874_1_.getBlockMetadata(p_149874_2_, p_149874_3_, p_149874_4_) + MathHelper.getRandomIntegerInRange(p_149874_1_.rand, 2, 5); + + if (l > 7) + { + l = 7; + } + + p_149874_1_.setBlockMetadataWithNotify(p_149874_2_, p_149874_3_, p_149874_4_, l, 2); + } + + private float func_149875_n(World p_149875_1_, int p_149875_2_, int p_149875_3_, int p_149875_4_) + { + float f = 1.0F; + Block block = p_149875_1_.getBlock(p_149875_2_, p_149875_3_, p_149875_4_ - 1); + Block block1 = p_149875_1_.getBlock(p_149875_2_, p_149875_3_, p_149875_4_ + 1); + Block block2 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_); + Block block3 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_); + Block block4 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_ - 1); + Block block5 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_ - 1); + Block block6 = p_149875_1_.getBlock(p_149875_2_ + 1, p_149875_3_, p_149875_4_ + 1); + Block block7 = p_149875_1_.getBlock(p_149875_2_ - 1, p_149875_3_, p_149875_4_ + 1); + boolean flag = block2 == this || block3 == this; + boolean flag1 = block == this || block1 == this; + boolean flag2 = block4 == this || block5 == this || block6 == this || block7 == this; + + for (int l = p_149875_2_ - 1; l <= p_149875_2_ + 1; ++l) + { + for (int i1 = p_149875_4_ - 1; i1 <= p_149875_4_ + 1; ++i1) + { + Block block8 = p_149875_1_.getBlock(l, p_149875_3_ - 1, i1); + float f1 = 0.0F; + + if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this)) + { + f1 = 1.0F; + + if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1)) + { + f1 = 3.0F; + } + } + + if (l != p_149875_2_ || i1 != p_149875_4_) + { + f1 /= 4.0F; + } + + f += f1; + } + } + + if (flag2 || flag && flag1) + { + f /= 2.0F; + } + + return f; + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + int j = meta * 32; + int k = 255 - meta * 8; + int l = meta * 4; + return j << 16 | k << 8 | l; + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return this.getRenderColor(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.maxY = (double)((float)(worldIn.getBlockMetadata(x, y, z) * 2 + 2) / 16.0F); + float f = 0.125F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, (float)this.maxY, 0.5F + f); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 19; + } + + /** + * Returns the current state of the stem. Returns -1 if the stem is not fully grown, or a value between 0 and 3 + * based on the direction the stem is facing. + */ + @SideOnly(Side.CLIENT) + public int getState(IBlockAccess p_149873_1_, int p_149873_2_, int p_149873_3_, int p_149873_4_) + { + int l = p_149873_1_.getBlockMetadata(p_149873_2_, p_149873_3_, p_149873_4_); + return l < 7 ? -1 : (p_149873_1_.getBlock(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.getBlock(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.getBlock(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.getBlock(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1)))); + } + + /** + * Drops the block items with a specified chance of dropping the specified items + */ + @SuppressWarnings("unused") + public void dropBlockAsItemWithChance(World worldIn, int x, int y, int z, int meta, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, x, y, z, meta, chance, fortune); + + if (false && !worldIn.isRemote) + { + Item item = null; + + if (this.field_149877_a == Blocks.pumpkin) + { + item = Items.pumpkin_seeds; + } + + if (this.field_149877_a == Blocks.melon_block) + { + item = Items.melon_seeds; + } + + for (int j1 = 0; j1 < 3; ++j1) + { + if (worldIn.rand.nextInt(15) <= meta) + { + this.dropBlockAsItem(worldIn, x, y, z, new ItemStack(item)); + } + } + } + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + return worldIn.getBlockMetadata(x, y, z) != 7; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return this.field_149877_a == Blocks.pumpkin ? Items.pumpkin_seeds : (this.field_149877_a == Blocks.melon_block ? Items.melon_seeds : Item.getItemById(0)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_disconnected"); + this.field_149876_b = reg.registerIcon(this.getTextureName() + "_connected"); + } + + @SideOnly(Side.CLIENT) + public IIcon getStemIcon() + { + return this.field_149876_b; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + this.func_149874_m(worldIn, x, y, z); + } + + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); + + Item item = null; + item = field_149877_a == Blocks.pumpkin ? Items.pumpkin_seeds : item; + item = field_149877_a == Blocks.melon_block ? Items.melon_seeds : item; + + for (int i = 0; item != null && i < 3; i++) + { + if (world.rand.nextInt(15) <= meta) + ret.add(new ItemStack(item)); + } + + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStone.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStone.java new file mode 100644 index 0000000..f59cf87 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStone.java @@ -0,0 +1,23 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; + +public class BlockStone extends Block +{ + private static final String __OBFID = "CL_00000317"; + + public BlockStone() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.cobblestone); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneBrick.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneBrick.java new file mode 100644 index 0000000..2ebc108 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneBrick.java @@ -0,0 +1,78 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStoneBrick extends Block +{ + public static final String[] field_150142_a = new String[] {"default", "mossy", "cracked", "chiseled"}; + public static final String[] field_150141_b = new String[] {null, "mossy", "cracked", "carved"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150143_M; + private static final String __OBFID = "CL_00000318"; + + public BlockStoneBrick() + { + super(Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta < 0 || meta >= field_150141_b.length) + { + meta = 0; + } + + return this.field_150143_M[meta]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 0; i < 4; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150143_M = new IIcon[field_150141_b.length]; + + for (int i = 0; i < this.field_150143_M.length; ++i) + { + String s = this.getTextureName(); + + if (field_150141_b[i] != null) + { + s = s + "_" + field_150141_b[i]; + } + + this.field_150143_M[i] = reg.registerIcon(s); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneSlab.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneSlab.java new file mode 100644 index 0000000..081b8d2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockStoneSlab.java @@ -0,0 +1,92 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockStoneSlab extends BlockSlab +{ + public static final String[] field_150006_b = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; + @SideOnly(Side.CLIENT) + private IIcon field_150007_M; + private static final String __OBFID = "CL_00000320"; + + public BlockStoneSlab(boolean p_i45431_1_) + { + super(p_i45431_1_, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + int k = meta & 7; + + if (this.field_150004_a && (meta & 8) != 0) + { + side = 1; + } + + return k == 0 ? (side != 1 && side != 0 ? this.field_150007_M : this.blockIcon) : (k == 1 ? Blocks.sandstone.getBlockTextureFromSide(side) : (k == 2 ? Blocks.planks.getBlockTextureFromSide(side) : (k == 3 ? Blocks.cobblestone.getBlockTextureFromSide(side) : (k == 4 ? Blocks.brick_block.getBlockTextureFromSide(side) : (k == 5 ? Blocks.stonebrick.getIcon(side, 0) : (k == 6 ? Blocks.nether_brick.getBlockTextureFromSide(1) : (k == 7 ? Blocks.quartz_block.getBlockTextureFromSide(side) : this.blockIcon))))))); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon("stone_slab_top"); + this.field_150007_M = reg.registerIcon("stone_slab_side"); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.stone_slab); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Item.getItemFromBlock(Blocks.stone_slab), 2, meta & 7); + } + + public String func_150002_b(int p_150002_1_) + { + if (p_150002_1_ < 0 || p_150002_1_ >= field_150006_b.length) + { + p_150002_1_ = 0; + } + + return super.getUnlocalizedName() + "." + field_150006_b[p_150002_1_]; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (itemIn != Item.getItemFromBlock(Blocks.double_stone_slab)) + { + for (int i = 0; i <= 7; ++i) + { + if (i != 2) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTNT.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTNT.java new file mode 100644 index 0000000..7c3baff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTNT.java @@ -0,0 +1,161 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class BlockTNT extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150116_a; + @SideOnly(Side.CLIENT) + private IIcon field_150115_b; + private static final String __OBFID = "CL_00000324"; + + public BlockTNT() + { + super(Material.tnt); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 0 ? this.field_150115_b : (side == 1 ? this.field_150116_a : this.blockIcon); + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + super.onBlockAdded(worldIn, x, y, z); + + if (worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + this.onBlockDestroyedByPlayer(worldIn, x, y, z, 1); + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (worldIn.isBlockIndirectlyGettingPowered(x, y, z)) + { + this.onBlockDestroyedByPlayer(worldIn, x, y, z, 1); + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 1; + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World worldIn, int x, int y, int z, Explosion explosionIn) + { + if (!worldIn.isRemote) + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), explosionIn.getExplosivePlacedBy()); + entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8; + worldIn.spawnEntityInWorld(entitytntprimed); + } + } + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World worldIn, int x, int y, int z, int meta) + { + this.func_150114_a(worldIn, x, y, z, meta, (EntityLivingBase)null); + } + + public void func_150114_a(World p_150114_1_, int p_150114_2_, int p_150114_3_, int p_150114_4_, int p_150114_5_, EntityLivingBase p_150114_6_) + { + if (!p_150114_1_.isRemote) + { + if ((p_150114_5_ & 1) == 1) + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(p_150114_1_, (double)((float)p_150114_2_ + 0.5F), (double)((float)p_150114_3_ + 0.5F), (double)((float)p_150114_4_ + 0.5F), p_150114_6_); + p_150114_1_.spawnEntityInWorld(entitytntprimed); + p_150114_1_.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F); + } + } + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) + { + this.func_150114_a(worldIn, x, y, z, 1, player); + worldIn.setBlockToAir(x, y, z); + player.getCurrentEquippedItem().damageItem(1, player); + return true; + } + else + { + return super.onBlockActivated(worldIn, x, y, z, player, side, subX, subY, subZ); + } + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (entityIn instanceof EntityArrow && !worldIn.isRemote) + { + EntityArrow entityarrow = (EntityArrow)entityIn; + + if (entityarrow.isBurning()) + { + this.func_150114_a(worldIn, x, y, z, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)entityarrow.shootingEntity : null); + worldIn.setBlockToAir(x, y, z); + } + } + } + + /** + * Return whether this block can drop from an explosion. + */ + public boolean canDropFromExplosion(Explosion explosionIn) + { + return false; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150116_a = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150115_b = reg.registerIcon(this.getTextureName() + "_bottom"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTallGrass.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTallGrass.java new file mode 100644 index 0000000..e916c47 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTallGrass.java @@ -0,0 +1,193 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.IShearable; + +public class BlockTallGrass extends BlockBush implements IGrowable, IShearable +{ + private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_149870_b; + private static final String __OBFID = "CL_00000321"; + + protected BlockTallGrass() + { + super(Material.vine); + float f = 0.4F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.8F, 0.5F + f); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta >= this.field_149870_b.length) + { + meta = 0; + } + + return this.field_149870_b[meta]; + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + double d0 = 0.5D; + double d1 = 1.0D; + return ColorizerGrass.getGrassColor(d0, d1); + } + + /** + * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. + */ + public boolean canBlockStay(World worldIn, int x, int y, int z) + { + return super.canBlockStay(worldIn, x, y, z); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return meta == 0 ? 16777215 : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + return l == 0 ? 16777215 : worldIn.getBiomeGenForCoords(x, z).getBiomeGrassColor(x, y, z); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). + */ + public int quantityDroppedWithBonus(int maxBonus, Random random) + { + return 1 + random.nextInt(maxBonus * 2 + 1); + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + { + super.harvestBlock(worldIn, player, x, y, z, meta); + } + } + + /** + * Get the block's damage value (for use with pick block). + */ + public int getDamageValue(World worldIn, int x, int y, int z) + { + return worldIn.getBlockMetadata(x, y, z); + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + for (int i = 1; i < 3; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_149870_b = new IIcon[field_149871_a.length]; + + for (int i = 0; i < this.field_149870_b.length; ++i) + { + this.field_149870_b[i] = reg.registerIcon(field_149871_a[i]); + } + } + + public boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient) + { + int l = worldIn.getBlockMetadata(x, y, z); + return l != 0; + } + + public boolean func_149852_a(World worldIn, Random random, int x, int y, int z) + { + return true; + } + + public void func_149853_b(World worldIn, Random random, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + byte b0 = 2; + + if (l == 2) + { + b0 = 3; + } + + if (Blocks.double_plant.canPlaceBlockAt(worldIn, x, y, z)) + { + Blocks.double_plant.func_149889_c(worldIn, x, y, z, b0, 2); + } + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); + if (world.rand.nextInt(8) != 0) return ret; + ItemStack seed = ForgeHooks.getGrassSeed(world); + if (seed != null) ret.add(seed); + return ret; + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTorch.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTorch.java new file mode 100644 index 0000000..ad727d5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTorch.java @@ -0,0 +1,314 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockTorch extends Block +{ + private static final String __OBFID = "CL_00000325"; + + protected BlockTorch() + { + super(Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 2; + } + + private boolean func_150107_m(World p_150107_1_, int p_150107_2_, int p_150107_3_, int p_150107_4_) + { + if (World.doesBlockHaveSolidTopSurface(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_)) + { + return true; + } + else + { + Block block = p_150107_1_.getBlock(p_150107_2_, p_150107_3_, p_150107_4_); + return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_); + } + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.isSideSolid(x - 1, y, z, EAST, true) || + worldIn.isSideSolid(x + 1, y, z, WEST, true) || + worldIn.isSideSolid(x, y, z - 1, SOUTH, true) || + worldIn.isSideSolid(x, y, z + 1, NORTH, true) || + func_150107_m(worldIn, x, y - 1, z); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = meta; + + if (side == 1 && this.func_150107_m(worldIn, x, y - 1, z)) + { + j1 = 5; + } + + if (side == 2 && worldIn.isSideSolid(x, y, z + 1, NORTH, true)) + { + j1 = 4; + } + + if (side == 3 && worldIn.isSideSolid(x, y, z - 1, SOUTH, true)) + { + j1 = 3; + } + + if (side == 4 && worldIn.isSideSolid(x + 1, y, z, WEST, true)) + { + j1 = 2; + } + + if (side == 5 && worldIn.isSideSolid(x - 1, y, z, EAST, true)) + { + j1 = 1; + } + + return j1; + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + super.updateTick(worldIn, x, y, z, random); + + if (worldIn.getBlockMetadata(x, y, z) == 0) + { + this.onBlockAdded(worldIn, x, y, z); + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + if (worldIn.getBlockMetadata(x, y, z) == 0) + { + if (worldIn.isSideSolid(x - 1, y, z, EAST, true)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 1, 2); + } + else if (worldIn.isSideSolid(x + 1, y, z, WEST, true)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 2, 2); + } + else if (worldIn.isSideSolid(x, y, z - 1, SOUTH, true)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 3, 2); + } + else if (worldIn.isSideSolid(x, y, z + 1, NORTH, true)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 4, 2); + } + else if (this.func_150107_m(worldIn, x, y - 1, z)) + { + worldIn.setBlockMetadataWithNotify(x, y, z, 5, 2); + } + } + + this.func_150109_e(worldIn, x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + this.func_150108_b(worldIn, x, y, z, neighbor); + } + + protected boolean func_150108_b(World p_150108_1_, int p_150108_2_, int p_150108_3_, int p_150108_4_, Block p_150108_5_) + { + if (this.func_150109_e(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_)) + { + int l = p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_); + boolean flag = false; + + if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1) + { + flag = true; + } + + if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2) + { + flag = true; + } + + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3) + { + flag = true; + } + + if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4) + { + flag = true; + } + + if (!this.func_150107_m(p_150108_1_, p_150108_2_, p_150108_3_ - 1, p_150108_4_) && l == 5) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_, p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_), 0); + p_150108_1_.setBlockToAir(p_150108_2_, p_150108_3_, p_150108_4_); + return true; + } + else + { + return false; + } + } + else + { + return true; + } + } + + protected boolean func_150109_e(World p_150109_1_, int p_150109_2_, int p_150109_3_, int p_150109_4_) + { + if (!this.canPlaceBlockAt(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_)) + { + if (p_150109_1_.getBlock(p_150109_2_, p_150109_3_, p_150109_4_) == this) + { + this.dropBlockAsItem(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_, p_150109_1_.getBlockMetadata(p_150109_2_, p_150109_3_, p_150109_4_), 0); + p_150109_1_.setBlockToAir(p_150109_2_, p_150109_3_, p_150109_4_); + } + + return false; + } + else + { + return true; + } + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + int l = worldIn.getBlockMetadata(x, y, z) & 7; + float f = 0.15F; + + if (l == 1) + { + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + } + else if (l == 2) + { + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + } + else if (l == 3) + { + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + } + else if (l == 4) + { + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + else + { + f = 0.1F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f); + } + + return super.collisionRayTrace(worldIn, x, y, z, startVec, endVec); + } + + /** + * A randomly called display update to be able to add particles or other items for display + */ + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, int x, int y, int z, Random random) + { + int l = worldIn.getBlockMetadata(x, y, z); + double d0 = (double)((float)x + 0.5F); + double d1 = (double)((float)y + 0.7F); + double d2 = (double)((float)z + 0.5F); + double d3 = 0.2199999988079071D; + double d4 = 0.27000001072883606D; + + if (l == 1) + { + worldIn.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + worldIn.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + worldIn.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D); + } + else if (l == 4) + { + worldIn.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D); + } + else + { + worldIn.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); + worldIn.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTrapDoor.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTrapDoor.java new file mode 100644 index 0000000..8d1f81a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTrapDoor.java @@ -0,0 +1,312 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockTrapDoor extends Block +{ + /** Set this to allow trapdoors to remain free-floating */ + public static boolean disableValidation = false; + private static final String __OBFID = "CL_00000327"; + + protected BlockTrapDoor(Material p_i45434_1_) + { + super(p_i45434_1_); + float f = 0.5F; + float f1 = 1.0F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return !func_150118_d(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 0; + } + + /** + * Returns the bounding box of the wired rectangular prism to render. + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getSelectedBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + this.func_150117_b(worldIn.getBlockMetadata(x, y, z)); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + float f = 0.1875F; + this.setBlockBounds(0.0F, 0.5F - f / 2.0F, 0.0F, 1.0F, 0.5F + f / 2.0F, 1.0F); + } + + public void func_150117_b(int p_150117_1_) + { + float f = 0.1875F; + + if ((p_150117_1_ & 8) != 0) + { + this.setBlockBounds(0.0F, 1.0F - f, 0.0F, 1.0F, 1.0F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); + } + + if (func_150118_d(p_150117_1_)) + { + if ((p_150117_1_ & 3) == 0) + { + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + } + + if ((p_150117_1_ & 3) == 1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + } + + if ((p_150117_1_ & 3) == 2) + { + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + if ((p_150117_1_ & 3) == 3) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + } + } + } + + /** + * Called when a player hits the block. Args: world, x, y, z, player + */ + public void onBlockClicked(World worldIn, int x, int y, int z, EntityPlayer player) {} + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (this.blockMaterial == Material.iron) + { + return true; + } + else + { + int i1 = worldIn.getBlockMetadata(x, y, z); + worldIn.setBlockMetadataWithNotify(x, y, z, i1 ^ 4, 2); + worldIn.playAuxSFXAtEntity(player, 1003, x, y, z, 0); + return true; + } + } + + public void func_150120_a(World p_150120_1_, int p_150120_2_, int p_150120_3_, int p_150120_4_, boolean p_150120_5_) + { + int l = p_150120_1_.getBlockMetadata(p_150120_2_, p_150120_3_, p_150120_4_); + boolean flag1 = (l & 4) > 0; + + if (flag1 != p_150120_5_) + { + p_150120_1_.setBlockMetadataWithNotify(p_150120_2_, p_150120_3_, p_150120_4_, l ^ 4, 2); + p_150120_1_.playAuxSFXAtEntity((EntityPlayer)null, 1003, p_150120_2_, p_150120_3_, p_150120_4_, 0); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = x; + int j1 = z; + + if ((l & 3) == 0) + { + j1 = z + 1; + } + + if ((l & 3) == 1) + { + --j1; + } + + if ((l & 3) == 2) + { + i1 = x + 1; + } + + if ((l & 3) == 3) + { + --i1; + } + + if (!(func_150119_a(worldIn.getBlock(i1, y, j1)) || worldIn.isSideSolid(i1, y, j1, ForgeDirection.getOrientation((l & 3) + 2)))) + { + worldIn.setBlockToAir(x, y, z); + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + } + + boolean flag = worldIn.isBlockIndirectlyGettingPowered(x, y, z); + + if (flag || neighbor.canProvidePower()) + { + this.func_150120_a(worldIn, x, y, z, flag); + } + } + } + + /** + * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, + * x, y, z, startVec, endVec + */ + public MovingObjectPosition collisionRayTrace(World worldIn, int x, int y, int z, Vec3 startVec, Vec3 endVec) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + return super.collisionRayTrace(worldIn, x, y, z, startVec, endVec); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + int j1 = 0; + + if (side == 2) + { + j1 = 0; + } + + if (side == 3) + { + j1 = 1; + } + + if (side == 4) + { + j1 = 2; + } + + if (side == 5) + { + j1 = 3; + } + + if (side != 1 && side != 0 && subY > 0.5F) + { + j1 |= 8; + } + + return j1; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + if (disableValidation) return true; + if (side == 0) + { + return false; + } + else if (side == 1) + { + return false; + } + else + { + if (side == 2) + { + ++z; + } + + if (side == 3) + { + --z; + } + + if (side == 4) + { + ++x; + } + + if (side == 5) + { + --x; + } + + return func_150119_a(worldIn.getBlock(x, y, z)) || worldIn.isSideSolid(x, y, z, ForgeDirection.UP); + } + } + + public static boolean func_150118_d(int p_150118_0_) + { + return (p_150118_0_ & 4) != 0; + } + + private static boolean func_150119_a(Block p_150119_0_) + { + if (disableValidation) return true; + return p_150119_0_.blockMaterial.isOpaque() && p_150119_0_.renderAsNormalBlock() || p_150119_0_ == Blocks.glowstone || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWire.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWire.java new file mode 100644 index 0000000..831ca48 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWire.java @@ -0,0 +1,301 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockTripWire extends Block +{ + private static final String __OBFID = "CL_00000328"; + + public BlockTripWire() + { + super(Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); + this.setTickRandomly(true); + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 10; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 1; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 30; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.string; + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag = (l & 2) == 2; + boolean flag1 = !World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z); + + if (flag != flag1) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z); + boolean flag = (l & 4) == 4; + boolean flag1 = (l & 2) == 2; + + if (!flag1) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); + } + else if (!flag) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + else + { + this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); + } + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @SideOnly(Side.CLIENT) + public Item getItem(World worldIn, int x, int y, int z) + { + return Items.string; + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World worldIn, int x, int y, int z) + { + int l = World.doesBlockHaveSolidTopSurface(worldIn, x, y - 1, z) ? 0 : 2; + worldIn.setBlockMetadataWithNotify(x, y, z, l, 3); + this.func_150138_a(worldIn, x, y, z, l); + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + this.func_150138_a(worldIn, x, y, z, meta | 1); + } + + /** + * Called when the block is attempted to be harvested + */ + public void onBlockHarvested(World worldIn, int x, int y, int z, int meta, EntityPlayer player) + { + if (!worldIn.isRemote) + { + if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) + { + worldIn.setBlockMetadataWithNotify(x, y, z, meta | 8, 4); + } + } + } + + private void func_150138_a(World p_150138_1_, int p_150138_2_, int p_150138_3_, int p_150138_4_, int p_150138_5_) + { + int i1 = 0; + + while (i1 < 2) + { + int j1 = 1; + + while (true) + { + if (j1 < 42) + { + int k1 = p_150138_2_ + Direction.offsetX[i1] * j1; + int l1 = p_150138_4_ + Direction.offsetZ[i1] * j1; + Block block = p_150138_1_.getBlock(k1, p_150138_3_, l1); + + if (block == Blocks.tripwire_hook) + { + int i2 = p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1) & 3; + + if (i2 == Direction.rotateOpposite[i1]) + { + Blocks.tripwire_hook.func_150136_a(p_150138_1_, k1, p_150138_3_, l1, false, p_150138_1_.getBlockMetadata(k1, p_150138_3_, l1), true, j1, p_150138_5_); + } + } + else if (block == Blocks.tripwire) + { + ++j1; + continue; + } + } + + ++i1; + break; + } + } + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + if (!worldIn.isRemote) + { + if ((worldIn.getBlockMetadata(x, y, z) & 1) != 1) + { + this.func_150140_e(worldIn, x, y, z); + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote) + { + if ((worldIn.getBlockMetadata(x, y, z) & 1) == 1) + { + this.func_150140_e(worldIn, x, y, z); + } + } + } + + private void func_150140_e(World p_150140_1_, int p_150140_2_, int p_150140_3_, int p_150140_4_) + { + int l = p_150140_1_.getBlockMetadata(p_150140_2_, p_150140_3_, p_150140_4_); + boolean flag = (l & 1) == 1; + boolean flag1 = false; + List list = p_150140_1_.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox((double)p_150140_2_ + this.minX, (double)p_150140_3_ + this.minY, (double)p_150140_4_ + this.minZ, (double)p_150140_2_ + this.maxX, (double)p_150140_3_ + this.maxY, (double)p_150140_4_ + this.maxZ)); + + if (!list.isEmpty()) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + + if (!entity.doesEntityNotTriggerPressurePlate()) + { + flag1 = true; + break; + } + } + } + + if (flag1 && !flag) + { + l |= 1; + } + + if (!flag1 && flag) + { + l &= -2; + } + + if (flag1 != flag) + { + p_150140_1_.setBlockMetadataWithNotify(p_150140_2_, p_150140_3_, p_150140_4_, l, 3); + this.func_150138_a(p_150140_1_, p_150140_2_, p_150140_3_, p_150140_4_, l); + } + + if (flag1) + { + p_150140_1_.scheduleBlockUpdate(p_150140_2_, p_150140_3_, p_150140_4_, this, this.tickRate(p_150140_1_)); + } + } + + @SideOnly(Side.CLIENT) + public static boolean func_150139_a(IBlockAccess p_150139_0_, int p_150139_1_, int p_150139_2_, int p_150139_3_, int p_150139_4_, int p_150139_5_) + { + int j1 = p_150139_1_ + Direction.offsetX[p_150139_5_]; + int k1 = p_150139_3_ + Direction.offsetZ[p_150139_5_]; + Block block = p_150139_0_.getBlock(j1, p_150139_2_, k1); + boolean flag = (p_150139_4_ & 2) == 2; + int l1; + + if (block == Blocks.tripwire_hook) + { + l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1); + int i2 = l1 & 3; + return i2 == Direction.rotateOpposite[p_150139_5_]; + } + else if (block == Blocks.tripwire) + { + l1 = p_150139_0_.getBlockMetadata(j1, p_150139_2_, k1); + boolean flag1 = (l1 & 2) == 2; + return flag == flag1; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWireHook.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWireHook.java new file mode 100644 index 0000000..32d7854 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockTripWireHook.java @@ -0,0 +1,436 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; +import static net.minecraftforge.common.util.ForgeDirection.*; + +public class BlockTripWireHook extends Block +{ + private static final String __OBFID = "CL_00000329"; + + public BlockTripWireHook() + { + super(Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 29; + } + + /** + * How many world ticks before ticking + */ + public int tickRate(World worldIn) + { + return 10; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + ForgeDirection dir = ForgeDirection.getOrientation(side); + return (dir == NORTH && worldIn.isSideSolid(x, y, z + 1, NORTH)) || + (dir == SOUTH && worldIn.isSideSolid(x, y, z - 1, SOUTH)) || + (dir == WEST && worldIn.isSideSolid(x + 1, y, z, WEST )) || + (dir == EAST && worldIn.isSideSolid(x - 1, y, z, EAST )); + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + public boolean canPlaceBlockAt(World worldIn, int x, int y, int z) + { + return worldIn.isSideSolid(x - 1, y, z, EAST ) || + worldIn.isSideSolid(x + 1, y, z, WEST ) || + worldIn.isSideSolid(x, y, z - 1, SOUTH) || + worldIn.isSideSolid(x, y, z + 1, NORTH); + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + byte b0 = 0; + + if (side == 2 && worldIn.isSideSolid(x, y, z + 1, NORTH, true)) + { + b0 = 2; + } + + if (side == 3 && worldIn.isSideSolid(x, y, z - 1, SOUTH, true)) + { + b0 = 0; + } + + if (side == 4 && worldIn.isSideSolid(x + 1, y, z, WEST, true)) + { + b0 = 1; + } + + if (side == 5 && worldIn.isSideSolid(x - 1, y, z, EAST, true)) + { + b0 = 3; + } + + return b0; + } + + /** + * Called after a block is placed + */ + public void onPostBlockPlaced(World worldIn, int x, int y, int z, int meta) + { + this.func_150136_a(worldIn, x, y, z, false, meta, false, -1, 0); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (neighbor != this) + { + if (this.func_150137_e(worldIn, x, y, z)) + { + int l = worldIn.getBlockMetadata(x, y, z); + int i1 = l & 3; + boolean flag = false; + + if (!worldIn.isSideSolid(x - 1, y, z, EAST) && i1 == 3) + { + flag = true; + } + + if (!worldIn.isSideSolid(x + 1, y, z, WEST) && i1 == 1) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z - 1, SOUTH) && i1 == 0) + { + flag = true; + } + + if (!worldIn.isSideSolid(x, y, z + 1, NORTH) && i1 == 2) + { + flag = true; + } + + if (flag) + { + this.dropBlockAsItem(worldIn, x, y, z, l, 0); + worldIn.setBlockToAir(x, y, z); + } + } + } + } + + public void func_150136_a(World p_150136_1_, int p_150136_2_, int p_150136_3_, int p_150136_4_, boolean p_150136_5_, int p_150136_6_, boolean p_150136_7_, int p_150136_8_, int p_150136_9_) + { + int k1 = p_150136_6_ & 3; + boolean flag2 = (p_150136_6_ & 4) == 4; + boolean flag3 = (p_150136_6_ & 8) == 8; + boolean flag4 = !p_150136_5_; + boolean flag5 = false; + boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP); + int l1 = Direction.offsetX[k1]; + int i2 = Direction.offsetZ[k1]; + int j2 = 0; + int[] aint = new int[42]; + int k2; + int l2; + int i3; + int j3; + + for (k2 = 1; k2 < 42; ++k2) + { + l2 = p_150136_2_ + l1 * k2; + i3 = p_150136_4_ + i2 * k2; + Block block = p_150136_1_.getBlock(l2, p_150136_3_, i3); + + if (block == Blocks.tripwire_hook) + { + j3 = p_150136_1_.getBlockMetadata(l2, p_150136_3_, i3); + + if ((j3 & 3) == Direction.rotateOpposite[k1]) + { + j2 = k2; + } + + break; + } + + if (block != Blocks.tripwire && k2 != p_150136_8_) + { + aint[k2] = -1; + flag4 = false; + } + else + { + j3 = k2 == p_150136_8_ ? p_150136_9_ : p_150136_1_.getBlockMetadata(l2, p_150136_3_, i3); + boolean flag7 = (j3 & 8) != 8; + boolean flag8 = (j3 & 1) == 1; + boolean flag9 = (j3 & 2) == 2; + flag4 &= flag9 == flag6; + flag5 |= flag7 && flag8; + aint[k2] = j3; + + if (k2 == p_150136_8_) + { + p_150136_1_.scheduleBlockUpdate(p_150136_2_, p_150136_3_, p_150136_4_, this, this.tickRate(p_150136_1_)); + flag4 &= flag7; + } + } + } + + flag4 &= j2 > 1; + flag5 &= flag4; + k2 = (flag4 ? 4 : 0) | (flag5 ? 8 : 0); + p_150136_6_ = k1 | k2; + int k3; + + if (j2 > 0) + { + l2 = p_150136_2_ + l1 * j2; + i3 = p_150136_4_ + i2 * j2; + k3 = Direction.rotateOpposite[k1]; + p_150136_1_.setBlockMetadataWithNotify(l2, p_150136_3_, i3, k3 | k2, 3); + this.func_150134_a(p_150136_1_, l2, p_150136_3_, i3, k3); + this.func_150135_a(p_150136_1_, l2, p_150136_3_, i3, flag4, flag5, flag2, flag3); + } + + this.func_150135_a(p_150136_1_, p_150136_2_, p_150136_3_, p_150136_4_, flag4, flag5, flag2, flag3); + + if (!p_150136_5_) + { + p_150136_1_.setBlockMetadataWithNotify(p_150136_2_, p_150136_3_, p_150136_4_, p_150136_6_, 3); + + if (p_150136_7_) + { + this.func_150134_a(p_150136_1_, p_150136_2_, p_150136_3_, p_150136_4_, k1); + } + } + + if (flag2 != flag4) + { + for (l2 = 1; l2 < j2; ++l2) + { + i3 = p_150136_2_ + l1 * l2; + k3 = p_150136_4_ + i2 * l2; + j3 = aint[l2]; + + if (j3 >= 0) + { + if (flag4) + { + j3 |= 4; + } + else + { + j3 &= -5; + } + + p_150136_1_.setBlockMetadataWithNotify(i3, p_150136_3_, k3, j3, 3); + } + } + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + this.func_150136_a(worldIn, x, y, z, false, worldIn.getBlockMetadata(x, y, z), true, -1, 0); + } + + private void func_150135_a(World p_150135_1_, int p_150135_2_, int p_150135_3_, int p_150135_4_, boolean p_150135_5_, boolean p_150135_6_, boolean p_150135_7_, boolean p_150135_8_) + { + if (p_150135_6_ && !p_150135_8_) + { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.6F); + } + else if (!p_150135_6_ && p_150135_8_) + { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.5F); + } + else if (p_150135_5_ && !p_150135_7_) + { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.click", 0.4F, 0.7F); + } + else if (!p_150135_5_ && p_150135_7_) + { + p_150135_1_.playSoundEffect((double)p_150135_2_ + 0.5D, (double)p_150135_3_ + 0.1D, (double)p_150135_4_ + 0.5D, "random.bowhit", 0.4F, 1.2F / (p_150135_1_.rand.nextFloat() * 0.2F + 0.9F)); + } + } + + private void func_150134_a(World p_150134_1_, int p_150134_2_, int p_150134_3_, int p_150134_4_, int p_150134_5_) + { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_, this); + + if (p_150134_5_ == 3) + { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_ - 1, p_150134_3_, p_150134_4_, this); + } + else if (p_150134_5_ == 1) + { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_ + 1, p_150134_3_, p_150134_4_, this); + } + else if (p_150134_5_ == 0) + { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_ - 1, this); + } + else if (p_150134_5_ == 2) + { + p_150134_1_.notifyBlocksOfNeighborChange(p_150134_2_, p_150134_3_, p_150134_4_ + 1, this); + } + } + + private boolean func_150137_e(World p_150137_1_, int p_150137_2_, int p_150137_3_, int p_150137_4_) + { + if (!this.canPlaceBlockAt(p_150137_1_, p_150137_2_, p_150137_3_, p_150137_4_)) + { + this.dropBlockAsItem(p_150137_1_, p_150137_2_, p_150137_3_, p_150137_4_, p_150137_1_.getBlockMetadata(p_150137_2_, p_150137_3_, p_150137_4_), 0); + p_150137_1_.setBlockToAir(p_150137_2_, p_150137_3_, p_150137_4_); + return false; + } + else + { + return true; + } + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + int l = worldIn.getBlockMetadata(x, y, z) & 3; + float f = 0.1875F; + + if (l == 3) + { + this.setBlockBounds(0.0F, 0.2F, 0.5F - f, f * 2.0F, 0.8F, 0.5F + f); + } + else if (l == 1) + { + this.setBlockBounds(1.0F - f * 2.0F, 0.2F, 0.5F - f, 1.0F, 0.8F, 0.5F + f); + } + else if (l == 0) + { + this.setBlockBounds(0.5F - f, 0.2F, 0.0F, 0.5F + f, 0.8F, f * 2.0F); + } + else if (l == 2) + { + this.setBlockBounds(0.5F - f, 0.2F, 1.0F - f * 2.0F, 0.5F + f, 0.8F, 1.0F); + } + } + + public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta) + { + boolean flag = (meta & 4) == 4; + boolean flag1 = (meta & 8) == 8; + + if (flag || flag1) + { + this.func_150136_a(worldIn, x, y, z, true, meta, false, -1, 0); + } + + if (flag1) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z, this); + int i1 = meta & 3; + + if (i1 == 3) + { + worldIn.notifyBlocksOfNeighborChange(x - 1, y, z, this); + } + else if (i1 == 1) + { + worldIn.notifyBlocksOfNeighborChange(x + 1, y, z, this); + } + else if (i1 == 0) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z - 1, this); + } + else if (i1 == 2) + { + worldIn.notifyBlocksOfNeighborChange(x, y, z + 1, this); + } + } + + super.breakBlock(worldIn, x, y, z, blockBroken, meta); + } + + public int isProvidingWeakPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + return (worldIn.getBlockMetadata(x, y, z) & 8) == 8 ? 15 : 0; + } + + public int isProvidingStrongPower(IBlockAccess worldIn, int x, int y, int z, int side) + { + int i1 = worldIn.getBlockMetadata(x, y, z); + + if ((i1 & 8) != 8) + { + return 0; + } + else + { + int j1 = i1 & 3; + return j1 == 2 && side == 2 ? 15 : (j1 == 0 && side == 3 ? 15 : (j1 == 1 && side == 4 ? 15 : (j1 == 3 && side == 5 ? 15 : 0))); + } + } + + /** + * Can this block provide power. Only wire currently seems to have this change based on its state. + */ + public boolean canProvidePower() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockVine.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockVine.java new file mode 100644 index 0000000..387a658 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockVine.java @@ -0,0 +1,453 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Direction; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.IShearable; + +public class BlockVine extends Block implements IShearable +{ + private static final String __OBFID = "CL_00000330"; + + public BlockVine() + { + super(Material.vine); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 20; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + float f = 0.0625F; + int l = worldIn.getBlockMetadata(x, y, z); + float f1 = 1.0F; + float f2 = 1.0F; + float f3 = 1.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + boolean flag = l > 0; + + if ((l & 2) != 0) + { + f4 = Math.max(f4, 0.0625F); + f1 = 0.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if ((l & 8) != 0) + { + f1 = Math.min(f1, 0.9375F); + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + flag = true; + } + + if ((l & 4) != 0) + { + f6 = Math.max(f6, 0.0625F); + f3 = 0.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if ((l & 1) != 0) + { + f3 = Math.min(f3, 0.9375F); + f6 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f2 = 0.0F; + f5 = 1.0F; + flag = true; + } + + if (!flag && this.func_150093_a(worldIn.getBlock(x, y + 1, z))) + { + f2 = Math.min(f2, 0.9375F); + f5 = 1.0F; + f1 = 0.0F; + f4 = 1.0F; + f3 = 0.0F; + f6 = 1.0F; + } + + this.setBlockBounds(f1, f2, f3, f4, f5, f6); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides + */ + public boolean canPlaceBlockOnSide(World worldIn, int x, int y, int z, int side) + { + switch (side) + { + case 1: + return this.func_150093_a(worldIn.getBlock(x, y + 1, z)); + case 2: + return this.func_150093_a(worldIn.getBlock(x, y, z + 1)); + case 3: + return this.func_150093_a(worldIn.getBlock(x, y, z - 1)); + case 4: + return this.func_150093_a(worldIn.getBlock(x + 1, y, z)); + case 5: + return this.func_150093_a(worldIn.getBlock(x - 1, y, z)); + default: + return false; + } + } + + private boolean func_150093_a(Block p_150093_1_) + { + return p_150093_1_.renderAsNormalBlock() && p_150093_1_.blockMaterial.blocksMovement(); + } + + private boolean func_150094_e(World p_150094_1_, int p_150094_2_, int p_150094_3_, int p_150094_4_) + { + int l = p_150094_1_.getBlockMetadata(p_150094_2_, p_150094_3_, p_150094_4_); + int i1 = l; + + if (l > 0) + { + for (int j1 = 0; j1 <= 3; ++j1) + { + int k1 = 1 << j1; + + if ((l & k1) != 0 && !this.func_150093_a(p_150094_1_.getBlock(p_150094_2_ + Direction.offsetX[j1], p_150094_3_, p_150094_4_ + Direction.offsetZ[j1])) && (p_150094_1_.getBlock(p_150094_2_, p_150094_3_ + 1, p_150094_4_) != this || (p_150094_1_.getBlockMetadata(p_150094_2_, p_150094_3_ + 1, p_150094_4_) & k1) == 0)) + { + i1 &= ~k1; + } + } + } + + if (i1 == 0 && !this.func_150093_a(p_150094_1_.getBlock(p_150094_2_, p_150094_3_ + 1, p_150094_4_))) + { + return false; + } + else + { + if (i1 != l) + { + p_150094_1_.setBlockMetadataWithNotify(p_150094_2_, p_150094_3_, p_150094_4_, i1, 2); + } + + return true; + } + } + + @SideOnly(Side.CLIENT) + public int getBlockColor() + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns the color this block should be rendered. Used by leaves. + */ + @SideOnly(Side.CLIENT) + public int getRenderColor(int meta) + { + return ColorizerFoliage.getFoliageColorBasic(); + } + + /** + * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called + * when first determining what to render. + */ + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess worldIn, int x, int y, int z) + { + return worldIn.getBiomeGenForCoords(x, z).getBiomeFoliageColor(x, y, z); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + public void onNeighborBlockChange(World worldIn, int x, int y, int z, Block neighbor) + { + if (!worldIn.isRemote && !this.func_150094_e(worldIn, x, y, z)) + { + this.dropBlockAsItem(worldIn, x, y, z, worldIn.getBlockMetadata(x, y, z), 0); + worldIn.setBlockToAir(x, y, z); + } + } + + /** + * Ticks the block if it's been scheduled + */ + public void updateTick(World worldIn, int x, int y, int z, Random random) + { + if (!worldIn.isRemote && worldIn.rand.nextInt(4) == 0) + { + byte b0 = 4; + int l = 5; + boolean flag = false; + int i1; + int j1; + int k1; + label134: + + for (i1 = x - b0; i1 <= x + b0; ++i1) + { + for (j1 = z - b0; j1 <= z + b0; ++j1) + { + for (k1 = y - 1; k1 <= y + 1; ++k1) + { + if (worldIn.getBlock(i1, k1, j1) == this) + { + --l; + + if (l <= 0) + { + flag = true; + break label134; + } + } + } + } + } + + i1 = worldIn.getBlockMetadata(x, y, z); + j1 = worldIn.rand.nextInt(6); + k1 = Direction.facingToDirection[j1]; + int l1; + + if (j1 == 1 && y < 255 && worldIn.isAirBlock(x, y + 1, z)) + { + if (flag) + { + return; + } + + int j2 = worldIn.rand.nextInt(16) & i1; + + if (j2 > 0) + { + for (l1 = 0; l1 <= 3; ++l1) + { + if (!this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[l1], y + 1, z + Direction.offsetZ[l1]))) + { + j2 &= ~(1 << l1); + } + } + + if (j2 > 0) + { + worldIn.setBlock(x, y + 1, z, this, j2, 2); + } + } + } + else + { + Block block; + int i2; + + if (j1 >= 2 && j1 <= 5 && (i1 & 1 << k1) == 0) + { + if (flag) + { + return; + } + + block = worldIn.getBlock(x + Direction.offsetX[k1], y, z + Direction.offsetZ[k1]); + + if (block.blockMaterial == Material.air) + { + l1 = k1 + 1 & 3; + i2 = k1 + 3 & 3; + + if ((i1 & 1 << l1) != 0 && this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[k1] + Direction.offsetX[l1], y, z + Direction.offsetZ[k1] + Direction.offsetZ[l1]))) + { + worldIn.setBlock(x + Direction.offsetX[k1], y, z + Direction.offsetZ[k1], this, 1 << l1, 2); + } + else if ((i1 & 1 << i2) != 0 && this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[k1] + Direction.offsetX[i2], y, z + Direction.offsetZ[k1] + Direction.offsetZ[i2]))) + { + worldIn.setBlock(x + Direction.offsetX[k1], y, z + Direction.offsetZ[k1], this, 1 << i2, 2); + } + else if ((i1 & 1 << l1) != 0 && worldIn.isAirBlock(x + Direction.offsetX[k1] + Direction.offsetX[l1], y, z + Direction.offsetZ[k1] + Direction.offsetZ[l1]) && this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[l1], y, z + Direction.offsetZ[l1]))) + { + worldIn.setBlock(x + Direction.offsetX[k1] + Direction.offsetX[l1], y, z + Direction.offsetZ[k1] + Direction.offsetZ[l1], this, 1 << (k1 + 2 & 3), 2); + } + else if ((i1 & 1 << i2) != 0 && worldIn.isAirBlock(x + Direction.offsetX[k1] + Direction.offsetX[i2], y, z + Direction.offsetZ[k1] + Direction.offsetZ[i2]) && this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[i2], y, z + Direction.offsetZ[i2]))) + { + worldIn.setBlock(x + Direction.offsetX[k1] + Direction.offsetX[i2], y, z + Direction.offsetZ[k1] + Direction.offsetZ[i2], this, 1 << (k1 + 2 & 3), 2); + } + else if (this.func_150093_a(worldIn.getBlock(x + Direction.offsetX[k1], y + 1, z + Direction.offsetZ[k1]))) + { + worldIn.setBlock(x + Direction.offsetX[k1], y, z + Direction.offsetZ[k1], this, 0, 2); + } + } + else if (block.blockMaterial.isOpaque() && block.renderAsNormalBlock()) + { + worldIn.setBlockMetadataWithNotify(x, y, z, i1 | 1 << k1, 2); + } + } + else if (y > 1) + { + block = worldIn.getBlock(x, y - 1, z); + + if (block.blockMaterial == Material.air) + { + l1 = worldIn.rand.nextInt(16) & i1; + + if (l1 > 0) + { + worldIn.setBlock(x, y - 1, z, this, l1, 2); + } + } + else if (block == this) + { + l1 = worldIn.rand.nextInt(16) & i1; + i2 = worldIn.getBlockMetadata(x, y - 1, z); + + if (i2 != (i2 | l1)) + { + worldIn.setBlockMetadataWithNotify(x, y - 1, z, i2 | l1, 2); + } + } + } + } + } + } + + /** + * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata + */ + public int onBlockPlaced(World worldIn, int x, int y, int z, int side, float subX, float subY, float subZ, int meta) + { + byte b0 = 0; + + switch (side) + { + case 2: + b0 = 1; + break; + case 3: + b0 = 4; + break; + case 4: + b0 = 8; + break; + case 5: + b0 = 2; + } + + return b0 != 0 ? b0 : meta; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random random) + { + return 0; + } + + /** + * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the + * block and l is the block's subtype/damage. + */ + public void harvestBlock(World worldIn, EntityPlayer player, int x, int y, int z, int meta) + { + { + super.harvestBlock(worldIn, player, x, y, z, meta); + } + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(this, 1)); + return ret; + } + + @Override + public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockWall.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWall.java new file mode 100644 index 0000000..6b2c442 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWall.java @@ -0,0 +1,171 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class BlockWall extends Block +{ + public static final String[] field_150092_a = new String[] {"normal", "mossy"}; + private static final String __OBFID = "CL_00000331"; + + public BlockWall(Block p_i45435_1_) + { + super(p_i45435_1_.blockMaterial); + this.setHardness(p_i45435_1_.blockHardness); + this.setResistance(p_i45435_1_.blockResistance / 3.0F); + this.setStepSound(p_i45435_1_.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return meta == 1 ? Blocks.mossy_cobblestone.getBlockTextureFromSide(side) : Blocks.cobblestone.getBlockTextureFromSide(side); + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 32; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean getBlocksMovement(IBlockAccess worldIn, int x, int y, int z) + { + return false; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Updates the blocks bounds based on its current state. Args: world, x, y, z + */ + public void setBlockBoundsBasedOnState(IBlockAccess worldIn, int x, int y, int z) + { + boolean flag = this.canConnectWallTo(worldIn, x, y, z - 1); + boolean flag1 = this.canConnectWallTo(worldIn, x, y, z + 1); + boolean flag2 = this.canConnectWallTo(worldIn, x - 1, y, z); + boolean flag3 = this.canConnectWallTo(worldIn, x + 1, y, z); + float f = 0.25F; + float f1 = 0.75F; + float f2 = 0.25F; + float f3 = 0.75F; + float f4 = 1.0F; + + if (flag) + { + f2 = 0.0F; + } + + if (flag1) + { + f3 = 1.0F; + } + + if (flag2) + { + f = 0.0F; + } + + if (flag3) + { + f1 = 1.0F; + } + + if (flag && flag1 && !flag2 && !flag3) + { + f4 = 0.8125F; + f = 0.3125F; + f1 = 0.6875F; + } + else if (!flag && !flag1 && flag2 && flag3) + { + f4 = 0.8125F; + f2 = 0.3125F; + f3 = 0.6875F; + } + + this.setBlockBounds(f, 0.0F, f2, f1, f4, f3); + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + this.setBlockBoundsBasedOnState(worldIn, x, y, z); + this.maxY = 1.5D; + return super.getCollisionBoundingBoxFromPool(worldIn, x, y, z); + } + + /** + * Return whether an adjacent block can connect to a wall. + */ + public boolean canConnectWallTo(IBlockAccess p_150091_1_, int p_150091_2_, int p_150091_3_, int p_150091_4_) + { + Block block = p_150091_1_.getBlock(p_150091_2_, p_150091_3_, p_150091_4_); + return block != this && block != Blocks.fence_gate ? (block.blockMaterial.isOpaque() && block.renderAsNormalBlock() ? block.blockMaterial != Material.gourd : false) : true; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) + { + return side == 0 ? super.shouldSideBeRendered(worldIn, x, y, z, side) : true; + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockWeb.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWeb.java new file mode 100644 index 0000000..ea42935 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWeb.java @@ -0,0 +1,76 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlockWeb extends Block +{ + private static final String __OBFID = "CL_00000333"; + + public BlockWeb() + { + super(Material.web); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + public void onEntityCollidedWithBlock(World worldIn, int x, int y, int z, Entity entityIn) + { + entityIn.setInWeb(); + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + public boolean isOpaqueCube() + { + return false; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + public AxisAlignedBB getCollisionBoundingBoxFromPool(World worldIn, int x, int y, int z) + { + return null; + } + + /** + * The type of render function that is called for this block + */ + public int getRenderType() + { + return 1; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + public boolean renderAsNormalBlock() + { + return false; + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Items.string; + } + + /** + * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. + */ + protected boolean canSilkHarvest() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockWood.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWood.java new file mode 100644 index 0000000..fccf8d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWood.java @@ -0,0 +1,72 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockWood extends Block +{ + public static final String[] field_150096_a = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "big_oak"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150095_b; + private static final String __OBFID = "CL_00000335"; + + public BlockWood() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + if (meta < 0 || meta >= this.field_150095_b.length) + { + meta = 0; + } + + return this.field_150095_b[meta]; + } + + /** + * Determines the damage on the item the block drops. Used in cloth and wood. + */ + public int damageDropped(int meta) + { + return meta; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + list.add(new ItemStack(itemIn, 1, 1)); + list.add(new ItemStack(itemIn, 1, 2)); + list.add(new ItemStack(itemIn, 1, 3)); + list.add(new ItemStack(itemIn, 1, 4)); + list.add(new ItemStack(itemIn, 1, 5)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150095_b = new IIcon[field_150096_a.length]; + + for (int i = 0; i < this.field_150095_b.length; ++i) + { + this.field_150095_b[i] = reg.registerIcon(this.getTextureName() + "_" + field_150096_a[i]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockWoodSlab.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWoodSlab.java new file mode 100644 index 0000000..44a488d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWoodSlab.java @@ -0,0 +1,76 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class BlockWoodSlab extends BlockSlab +{ + public static final String[] field_150005_b = new String[] {"oak", "spruce", "birch", "jungle", "acacia", "big_oak"}; + private static final String __OBFID = "CL_00000337"; + + public BlockWoodSlab(boolean p_i45437_1_) + { + super(p_i45437_1_, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return Blocks.planks.getIcon(side, meta & 7); + } + + public Item getItemDropped(int meta, Random random, int fortune) + { + return Item.getItemFromBlock(Blocks.wooden_slab); + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(Item.getItemFromBlock(Blocks.wooden_slab), 2, meta & 7); + } + + public String func_150002_b(int p_150002_1_) + { + if (p_150002_1_ < 0 || p_150002_1_ >= field_150005_b.length) + { + p_150002_1_ = 0; + } + + return super.getUnlocalizedName() + "." + field_150005_b[p_150002_1_]; + } + + /** + * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) + */ + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + if (itemIn != Item.getItemFromBlock(Blocks.double_wooden_slab)) + { + for (int i = 0; i < field_150005_b.length; ++i) + { + list.add(new ItemStack(itemIn, 1, i)); + } + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/BlockWorkbench.java b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWorkbench.java new file mode 100644 index 0000000..4a77d6a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/BlockWorkbench.java @@ -0,0 +1,59 @@ +package net.minecraft.block; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class BlockWorkbench extends Block +{ + @SideOnly(Side.CLIENT) + private IIcon field_150035_a; + @SideOnly(Side.CLIENT) + private IIcon field_150034_b; + private static final String __OBFID = "CL_00000221"; + + protected BlockWorkbench() + { + super(Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) + { + return side == 1 ? this.field_150035_a : (side == 0 ? Blocks.planks.getBlockTextureFromSide(side) : (side != 2 && side != 4 ? this.blockIcon : this.field_150034_b)); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.blockIcon = reg.registerIcon(this.getTextureName() + "_side"); + this.field_150035_a = reg.registerIcon(this.getTextureName() + "_top"); + this.field_150034_b = reg.registerIcon(this.getTextureName() + "_front"); + } + + /** + * Called upon block activation (right click on the block.) + */ + public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer player, int side, float subX, float subY, float subZ) + { + if (worldIn.isRemote) + { + return true; + } + else + { + player.displayGUIWorkbench(x, y, z); + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/IGrowable.java b/build/rfg/minecraft-src/java/net/minecraft/block/IGrowable.java new file mode 100644 index 0000000..a86a867 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/IGrowable.java @@ -0,0 +1,13 @@ +package net.minecraft.block; + +import java.util.Random; +import net.minecraft.world.World; + +public interface IGrowable +{ + boolean func_149851_a(World worldIn, int x, int y, int z, boolean isClient); + + boolean func_149852_a(World worldIn, Random random, int x, int y, int z); + + void func_149853_b(World worldIn, Random random, int x, int y, int z); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/ITileEntityProvider.java b/build/rfg/minecraft-src/java/net/minecraft/block/ITileEntityProvider.java new file mode 100644 index 0000000..7ae8af9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/ITileEntityProvider.java @@ -0,0 +1,12 @@ +package net.minecraft.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public interface ITileEntityProvider +{ + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + TileEntity createNewTileEntity(World worldIn, int meta); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/MapColor.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/MapColor.java new file mode 100644 index 0000000..942eef7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/MapColor.java @@ -0,0 +1,138 @@ +package net.minecraft.block.material; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockColored; + +public class MapColor +{ + /** Holds all the 16 colors used on maps, very similar of a pallete system. */ + public static final MapColor[] mapColorArray = new MapColor[64]; + public static final MapColor airColor = new MapColor(0, 0); + public static final MapColor grassColor = new MapColor(1, 8368696); + public static final MapColor sandColor = new MapColor(2, 16247203); + public static final MapColor clothColor = new MapColor(3, 10987431); + public static final MapColor tntColor = new MapColor(4, 16711680); + public static final MapColor iceColor = new MapColor(5, 10526975); + public static final MapColor ironColor = new MapColor(6, 10987431); + public static final MapColor foliageColor = new MapColor(7, 31744); + public static final MapColor snowColor = new MapColor(8, 16777215); + public static final MapColor clayColor = new MapColor(9, 10791096); + public static final MapColor dirtColor = new MapColor(10, 12020271); + public static final MapColor stoneColor = new MapColor(11, 7368816); + public static final MapColor waterColor = new MapColor(12, 4210943); + public static final MapColor woodColor = new MapColor(13, 6837042); + public static final MapColor quartzColor = new MapColor(14, 16776437); + public static final MapColor adobeColor = new MapColor(15, 14188339); + public static final MapColor magentaColor = new MapColor(16, 11685080); + public static final MapColor lightBlueColor = new MapColor(17, 6724056); + public static final MapColor yellowColor = new MapColor(18, 15066419); + public static final MapColor limeColor = new MapColor(19, 8375321); + public static final MapColor pinkColor = new MapColor(20, 15892389); + public static final MapColor grayColor = new MapColor(21, 5000268); + public static final MapColor silverColor = new MapColor(22, 10066329); + public static final MapColor cyanColor = new MapColor(23, 5013401); + public static final MapColor purpleColor = new MapColor(24, 8339378); + public static final MapColor blueColor = new MapColor(25, 3361970); + public static final MapColor brownColor = new MapColor(26, 6704179); + public static final MapColor greenColor = new MapColor(27, 6717235); + public static final MapColor redColor = new MapColor(28, 10040115); + public static final MapColor blackColor = new MapColor(29, 1644825); + public static final MapColor goldColor = new MapColor(30, 16445005); + public static final MapColor diamondColor = new MapColor(31, 6085589); + public static final MapColor lapisColor = new MapColor(32, 4882687); + public static final MapColor emeraldColor = new MapColor(33, 55610); + public static final MapColor obsidianColor = new MapColor(34, 1381407); + public static final MapColor netherrackColor = new MapColor(35, 7340544); + /** Holds the color in RGB value that will be rendered on maps. */ + public final int colorValue; + /** Holds the index of the color used on map. */ + public final int colorIndex; + private static final String __OBFID = "CL_00000544"; + + private MapColor(int p_i2117_1_, int p_i2117_2_) + { + if (p_i2117_1_ >= 0 && p_i2117_1_ <= 63) + { + this.colorIndex = p_i2117_1_; + this.colorValue = p_i2117_2_; + mapColorArray[p_i2117_1_] = this; + } + else + { + throw new IndexOutOfBoundsException("Map colour ID must be between 0 and 63 (inclusive)"); + } + } + + public static MapColor getMapColorForBlockColored(int p_151644_0_) + { + switch (BlockColored.func_150031_c(p_151644_0_)) + { + case 0: + return blackColor; + case 1: + return redColor; + case 2: + return greenColor; + case 3: + return brownColor; + case 4: + return blueColor; + case 5: + return purpleColor; + case 6: + return cyanColor; + case 7: + return silverColor; + case 8: + return grayColor; + case 9: + return pinkColor; + case 10: + return limeColor; + case 11: + return yellowColor; + case 12: + return lightBlueColor; + case 13: + return magentaColor; + case 14: + return adobeColor; + case 15: + return snowColor; + default: + return airColor; + } + } + + @SideOnly(Side.CLIENT) + public int func_151643_b(int p_151643_1_) + { + short short1 = 220; + + if (p_151643_1_ == 3) + { + short1 = 135; + } + + if (p_151643_1_ == 2) + { + short1 = 255; + } + + if (p_151643_1_ == 1) + { + short1 = 220; + } + + if (p_151643_1_ == 0) + { + short1 = 180; + } + + int j = (this.colorValue >> 16 & 255) * short1 / 255; + int k = (this.colorValue >> 8 & 255) * short1 / 255; + int l = (this.colorValue & 255) * short1 / 255; + return -16777216 | j << 16 | k << 8 | l; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/Material.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/Material.java new file mode 100644 index 0000000..495aef3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/Material.java @@ -0,0 +1,222 @@ +package net.minecraft.block.material; + +public class Material +{ + public static final Material air = new MaterialTransparent(MapColor.airColor); + public static final Material grass = new Material(MapColor.grassColor); + public static final Material ground = new Material(MapColor.dirtColor); + public static final Material wood = (new Material(MapColor.woodColor)).setBurning(); + public static final Material rock = (new Material(MapColor.stoneColor)).setRequiresTool(); + public static final Material iron = (new Material(MapColor.ironColor)).setRequiresTool(); + public static final Material anvil = (new Material(MapColor.ironColor)).setRequiresTool().setImmovableMobility(); + public static final Material water = (new MaterialLiquid(MapColor.waterColor)).setNoPushMobility(); + public static final Material lava = (new MaterialLiquid(MapColor.tntColor)).setNoPushMobility(); + public static final Material leaves = (new Material(MapColor.foliageColor)).setBurning().setTranslucent().setNoPushMobility(); + public static final Material plants = (new MaterialLogic(MapColor.foliageColor)).setNoPushMobility(); + public static final Material vine = (new MaterialLogic(MapColor.foliageColor)).setBurning().setNoPushMobility().setReplaceable(); + public static final Material sponge = new Material(MapColor.clothColor); + public static final Material cloth = (new Material(MapColor.clothColor)).setBurning(); + public static final Material fire = (new MaterialTransparent(MapColor.airColor)).setNoPushMobility(); + public static final Material sand = new Material(MapColor.sandColor); + public static final Material circuits = (new MaterialLogic(MapColor.airColor)).setNoPushMobility(); + public static final Material carpet = (new MaterialLogic(MapColor.clothColor)).setBurning(); + public static final Material glass = (new Material(MapColor.airColor)).setTranslucent().setAdventureModeExempt(); + public static final Material redstoneLight = (new Material(MapColor.airColor)).setAdventureModeExempt(); + public static final Material tnt = (new Material(MapColor.tntColor)).setBurning().setTranslucent(); + public static final Material coral = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material ice = (new Material(MapColor.iceColor)).setTranslucent().setAdventureModeExempt(); + public static final Material packedIce = (new Material(MapColor.iceColor)).setAdventureModeExempt(); + public static final Material snow = (new MaterialLogic(MapColor.snowColor)).setReplaceable().setTranslucent().setRequiresTool().setNoPushMobility(); + /** The material for crafted snow. */ + public static final Material craftedSnow = (new Material(MapColor.snowColor)).setRequiresTool(); + public static final Material cactus = (new Material(MapColor.foliageColor)).setTranslucent().setNoPushMobility(); + public static final Material clay = new Material(MapColor.clayColor); + public static final Material gourd = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material dragonEgg = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material portal = (new MaterialPortal(MapColor.airColor)).setImmovableMobility(); + public static final Material cake = (new Material(MapColor.airColor)).setNoPushMobility(); + public static final Material web = (new Material(MapColor.clothColor) + { + private static final String __OBFID = "CL_00000543"; + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return false; + } + }).setRequiresTool().setNoPushMobility(); + /** Pistons' material. */ + public static final Material piston = (new Material(MapColor.stoneColor)).setImmovableMobility(); + /** Bool defining if the block can burn or not. */ + private boolean canBurn; + /** + * Determines whether blocks with this material can be "overwritten" by other blocks when placed - eg snow, vines + * and tall grass. + */ + private boolean replaceable; + /** Indicates if the material is translucent */ + private boolean isTranslucent; + /** The color index used to draw the blocks of this material on maps. */ + private final MapColor materialMapColor; + /** Determines if the material can be harvested without a tool (or with the wrong tool) */ + private boolean requiresNoTool = true; + /** + * Mobility information flag. 0 indicates that this block is normal, 1 indicates that it can't push other blocks, 2 + * indicates that it can't be pushed. + */ + private int mobilityFlag; + private boolean isAdventureModeExempt; + private static final String __OBFID = "CL_00000542"; + + public Material(MapColor p_i2116_1_) + { + this.materialMapColor = p_i2116_1_; + } + + /** + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() + { + return false; + } + + public boolean isSolid() + { + return true; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() + { + return true; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return true; + } + + /** + * Marks the material as translucent + */ + private Material setTranslucent() + { + this.isTranslucent = true; + return this; + } + + /** + * Makes blocks with this material require the correct tool to be harvested. + */ + protected Material setRequiresTool() + { + this.requiresNoTool = false; + return this; + } + + /** + * Set the canBurn bool to True and return the current object. + */ + protected Material setBurning() + { + this.canBurn = true; + return this; + } + + /** + * Returns if the block can burn or not. + */ + public boolean getCanBurn() + { + return this.canBurn; + } + + /** + * Sets {@link #replaceable} to true. + */ + public Material setReplaceable() + { + this.replaceable = true; + return this; + } + + /** + * Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass. + */ + public boolean isReplaceable() + { + return this.replaceable; + } + + /** + * Indicate if the material is opaque + */ + public boolean isOpaque() + { + return this.isTranslucent ? false : this.blocksMovement(); + } + + /** + * Returns true if the material can be harvested without a tool (or with the wrong tool) + */ + public boolean isToolNotRequired() + { + return this.requiresNoTool; + } + + /** + * Returns the mobility information of the material, 0 = free, 1 = can't push but can move over, 2 = total + * immobility and stop pistons. + */ + public int getMaterialMobility() + { + return this.mobilityFlag; + } + + /** + * This type of material can't be pushed, but pistons can move over it. + */ + protected Material setNoPushMobility() + { + this.mobilityFlag = 1; + return this; + } + + /** + * This type of material can't be pushed, and pistons are blocked to move. + */ + protected Material setImmovableMobility() + { + this.mobilityFlag = 2; + return this; + } + + /** + * @see #isAdventureModeExempt() + */ + protected Material setAdventureModeExempt() + { + this.isAdventureModeExempt = true; + return this; + } + + /** + * Returns true if blocks with this material can always be mined in adventure mode. + */ + public boolean isAdventureModeExempt() + { + return this.isAdventureModeExempt; + } + + public MapColor getMaterialMapColor() + { + return this.materialMapColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLiquid.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLiquid.java new file mode 100644 index 0000000..d2de071 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLiquid.java @@ -0,0 +1,34 @@ +package net.minecraft.block.material; + +public class MaterialLiquid extends Material +{ + private static final String __OBFID = "CL_00000541"; + + public MaterialLiquid(MapColor p_i2114_1_) + { + super(p_i2114_1_); + this.setReplaceable(); + this.setNoPushMobility(); + } + + /** + * Returns if blocks of these materials are liquids. + */ + public boolean isLiquid() + { + return true; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return false; + } + + public boolean isSolid() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLogic.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLogic.java new file mode 100644 index 0000000..737d96a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialLogic.java @@ -0,0 +1,33 @@ +package net.minecraft.block.material; + +public class MaterialLogic extends Material +{ + private static final String __OBFID = "CL_00000539"; + + public MaterialLogic(MapColor p_i2112_1_) + { + super(p_i2112_1_); + this.setAdventureModeExempt(); + } + + public boolean isSolid() + { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() + { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialPortal.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialPortal.java new file mode 100644 index 0000000..b31e9eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialPortal.java @@ -0,0 +1,32 @@ +package net.minecraft.block.material; + +public class MaterialPortal extends Material +{ + private static final String __OBFID = "CL_00000545"; + + public MaterialPortal(MapColor p_i2118_1_) + { + super(p_i2118_1_); + } + + public boolean isSolid() + { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() + { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialTransparent.java b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialTransparent.java new file mode 100644 index 0000000..c2e66b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/block/material/MaterialTransparent.java @@ -0,0 +1,33 @@ +package net.minecraft.block.material; + +public class MaterialTransparent extends Material +{ + private static final String __OBFID = "CL_00000540"; + + public MaterialTransparent(MapColor p_i2113_1_) + { + super(p_i2113_1_); + this.setReplaceable(); + } + + public boolean isSolid() + { + return false; + } + + /** + * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true + */ + public boolean getCanBlockGrass() + { + return false; + } + + /** + * Returns if this material is considered solid or not + */ + public boolean blocksMovement() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/AnvilConverterException.java b/build/rfg/minecraft-src/java/net/minecraft/client/AnvilConverterException.java new file mode 100644 index 0000000..c9cca79 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/AnvilConverterException.java @@ -0,0 +1,15 @@ +package net.minecraft.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class AnvilConverterException extends Exception +{ + private static final String __OBFID = "CL_00000599"; + + public AnvilConverterException(String p_i2160_1_) + { + super(p_i2160_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/ClientBrandRetriever.java b/build/rfg/minecraft-src/java/net/minecraft/client/ClientBrandRetriever.java new file mode 100644 index 0000000..31d403d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/ClientBrandRetriever.java @@ -0,0 +1,16 @@ +package net.minecraft.client; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ClientBrandRetriever +{ + private static final String __OBFID = "CL_00001460"; + + public static String getClientModName() + { + return FMLCommonHandler.instance().getModName(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/LoadingScreenRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/LoadingScreenRenderer.java new file mode 100644 index 0000000..2969ebf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/LoadingScreenRenderer.java @@ -0,0 +1,219 @@ +package net.minecraft.client; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MinecraftError; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class LoadingScreenRenderer implements IProgressUpdate +{ + private String field_73727_a = ""; + /** A reference to the Minecraft object. */ + private Minecraft mc; + /** The text currently displayed (i.e. the argument to the last call to printText or func_73722_d) */ + private String currentlyDisplayedText = ""; + private long field_73723_d = Minecraft.getSystemTime(); + private boolean field_73724_e; + private ScaledResolution field_146587_f; + private Framebuffer field_146588_g; + private static final String __OBFID = "CL_00000655"; + + public LoadingScreenRenderer(Minecraft p_i1017_1_) + { + this.mc = p_i1017_1_; + this.field_146587_f = new ScaledResolution(p_i1017_1_, p_i1017_1_.displayWidth, p_i1017_1_.displayHeight); + this.field_146588_g = new Framebuffer(p_i1017_1_.displayWidth, p_i1017_1_.displayHeight, false); + this.field_146588_g.setFramebufferFilter(9728); + } + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + public void resetProgressAndMessage(String p_73721_1_) + { + this.field_73724_e = false; + this.func_73722_d(p_73721_1_); + } + + /** + * "Saving level", or the loading,or downloading equivelent + */ + public void displayProgressMessage(String p_73720_1_) + { + this.field_73724_e = true; + this.func_73722_d(p_73720_1_); + } + + public void func_73722_d(String p_73722_1_) + { + this.currentlyDisplayedText = p_73722_1_; + + if (!this.mc.running) + { + if (!this.field_73724_e) + { + throw new MinecraftError(); + } + } + else + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + int i = this.field_146587_f.getScaleFactor(); + GL11.glOrtho(0.0D, (double)(this.field_146587_f.getScaledWidth() * i), (double)(this.field_146587_f.getScaledHeight() * i), 0.0D, 100.0D, 300.0D); + } + else + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -200.0F); + } + } + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + public void resetProgresAndWorkingMessage(String p_73719_1_) + { + if (!this.mc.running) + { + if (!this.field_73724_e) + { + throw new MinecraftError(); + } + } + else + { + this.field_73723_d = 0L; + this.field_73727_a = p_73719_1_; + this.setLoadingProgress(-1); + this.field_73723_d = 0L; + } + } + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int p_73718_1_) + { + if (!this.mc.running) + { + if (!this.field_73724_e) + { + throw new MinecraftError(); + } + } + else + { + long j = Minecraft.getSystemTime(); + + if (j - this.field_73723_d >= 100L) + { + this.field_73723_d = j; + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int k = scaledresolution.getScaleFactor(); + int l = scaledresolution.getScaledWidth(); + int i1 = scaledresolution.getScaledHeight(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + this.field_146588_g.framebufferClear(); + } + else + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + } + + this.field_146588_g.bindFramebuffer(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -200.0F); + + if (!OpenGlHelper.isFramebufferEnabled()) + { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + } + + if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) + { + Tessellator tessellator = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + float f = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(4210752); + tessellator.addVertexWithUV(0.0D, (double)i1, 0.0D, 0.0D, (double)((float)i1 / f)); + tessellator.addVertexWithUV((double)l, (double)i1, 0.0D, (double)((float)l / f), (double)((float)i1 / f)); + tessellator.addVertexWithUV((double)l, 0.0D, 0.0D, (double)((float)l / f), 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + + if (p_73718_1_ >= 0) + { + byte b0 = 100; + byte b1 = 2; + int j1 = l / 2 - b0 / 2; + int k1 = i1 / 2 + 16; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(8421504); + tessellator.addVertex((double)j1, (double)k1, 0.0D); + tessellator.addVertex((double)j1, (double)(k1 + b1), 0.0D); + tessellator.addVertex((double)(j1 + b0), (double)(k1 + b1), 0.0D); + tessellator.addVertex((double)(j1 + b0), (double)k1, 0.0D); + tessellator.setColorOpaque_I(8454016); + tessellator.addVertex((double)j1, (double)k1, 0.0D); + tessellator.addVertex((double)j1, (double)(k1 + b1), 0.0D); + tessellator.addVertex((double)(j1 + p_73718_1_), (double)(k1 + b1), 0.0D); + tessellator.addVertex((double)(j1 + p_73718_1_), (double)k1, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (l - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, i1 / 2 - 4 - 16, 16777215); + this.mc.fontRenderer.drawStringWithShadow(this.field_73727_a, (l - this.mc.fontRenderer.getStringWidth(this.field_73727_a)) / 2, i1 / 2 - 4 + 8, 16777215); + } + this.field_146588_g.unbindFramebuffer(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + this.field_146588_g.framebufferRender(l * k, i1 * k); + } + + this.mc.func_147120_f(); + + try + { + Thread.yield(); + } + catch (Exception exception) + { + ; + } + } + } + } + + public void func_146586_a() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/Minecraft.java b/build/rfg/minecraft-src/java/net/minecraft/client/Minecraft.java new file mode 100644 index 0000000..e329130 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/Minecraft.java @@ -0,0 +1,3055 @@ +package net.minecraft.client; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListenableFutureTask; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.util.concurrent.GenericFutureListener; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.Proxy; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Queue; +import java.util.UUID; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.audio.MusicTicker; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiControls; +import net.minecraft.client.gui.GuiGameOver; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.GuiIngameMenu; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiMemoryErrorScreen; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSleepMP; +import net.minecraft.client.gui.GuiWinGame; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.achievement.GuiAchievement; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.gui.stream.GuiStreamUnavailable; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.DefaultResourcePack; +import net.minecraft.client.resources.FoliageColorReloadListener; +import net.minecraft.client.resources.GrassColorReloadListener; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.LanguageManager; +import net.minecraft.client.resources.ResourceIndex; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.client.resources.SimpleReloadableResourceManager; +import net.minecraft.client.resources.SkinManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.AnimationMetadataSectionSerializer; +import net.minecraft.client.resources.data.FontMetadataSection; +import net.minecraft.client.resources.data.FontMetadataSectionSerializer; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.client.resources.data.LanguageMetadataSectionSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.resources.data.PackMetadataSectionSerializer; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSectionSerializer; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.stream.IStream; +import net.minecraft.client.stream.NullStream; +import net.minecraft.client.stream.TwitchStream; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Bootstrap; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.integrated.IntegratedServer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.IStatStringFormat; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MinecraftError; +import net.minecraft.util.MouseHelper; +import net.minecraft.util.MovementInputFromOptions; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.ScreenShotHelper; +import net.minecraft.util.Session; +import net.minecraft.util.Timer; +import net.minecraft.util.Util; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.ContextCapabilities; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.OpenGLException; +import org.lwjgl.opengl.PixelFormat; +import org.lwjgl.util.glu.GLU; + +import com.google.common.collect.MapDifference; + +@SideOnly(Side.CLIENT) +public class Minecraft implements IPlayerUsage +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); + public static final boolean isRunningOnMac = Util.getOSType() == Util.EnumOS.OSX; + /** A 10MiB preallocation to ensure the heap is reasonably sized. */ + public static byte[] memoryReserve = new byte[10485760]; + private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); + private final File fileResourcepacks; + private final Multimap field_152356_J; + private ServerData currentServerData; + /** The RenderEngine instance used by Minecraft */ + public TextureManager renderEngine; + /** Set to 'this' in Minecraft constructor; used by some settings get methods */ + private static Minecraft theMinecraft; + public PlayerControllerMP playerController; + private boolean fullscreen; + private boolean hasCrashed; + /** Instance of CrashReport. */ + private CrashReport crashReporter; + public int displayWidth; + public int displayHeight; + private Timer timer = new Timer(20.0F); + /** Instance of PlayerUsageSnooper. */ + private PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getSystemTimeMillis()); + public WorldClient theWorld; + public RenderGlobal renderGlobal; + public EntityClientPlayerMP thePlayer; + /** + * The Entity from which the renderer determines the render viewpoint. Currently is always the parent Minecraft + * class's 'thePlayer' instance. Modification of its location, rotation, or other settings at render time will + * modify the camera likewise, with the caveat of triggering chunk rebuilds as it moves, making it unsuitable for + * changing the viewpoint mid-render. + */ + public EntityLivingBase renderViewEntity; + public Entity pointedEntity; + public EffectRenderer effectRenderer; + private final Session session; + private boolean isGamePaused; + /** The font renderer used for displaying and measuring text. */ + public FontRenderer fontRenderer; + public FontRenderer standardGalacticFontRenderer; + /** The GuiScreen that's being displayed at the moment. */ + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; + /** Mouse left click counter */ + private int leftClickCounter; + /** Display width */ + private int tempDisplayWidth; + /** Display height */ + private int tempDisplayHeight; + /** Instance of IntegratedServer. */ + private IntegratedServer theIntegratedServer; + /** Gui achievement */ + public GuiAchievement guiAchievement; + public GuiIngame ingameGUI; + /** Skip render world */ + public boolean skipRenderWorld; + /** The ray trace hit that the mouse is over. */ + public MovingObjectPosition objectMouseOver; + /** The game settings that currently hold effect. */ + public GameSettings gameSettings; + /** Mouse helper instance. */ + public MouseHelper mouseHelper; + public final File mcDataDir; + private final File fileAssets; + private final String launchedVersion; + private final Proxy proxy; + private ISaveFormat saveLoader; + /** + * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of + * the usage snooping. + */ + private static int debugFPS; + /** When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. */ + private int rightClickDelayTimer; + /** Checked in Minecraft's while(running) loop, if true it's set to false and the textures refreshed. */ + private boolean refreshTexturePacksScheduled; + private String serverName; + private int serverPort; + /** Does the actual gameplay have focus. If so then mouse and keys will effect the player instead of menus. */ + public boolean inGameHasFocus; + long systemTime = getSystemTime(); + /** Join player counter */ + private int joinPlayerCounter; + private final boolean jvm64bit; + private final boolean isDemo; + private NetworkManager myNetworkManager; + private boolean integratedServerIsRunning; + /** The profiler instance */ + public final Profiler mcProfiler = new Profiler(); + private long field_83002_am = -1L; + private IReloadableResourceManager mcResourceManager; + private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); + private List defaultResourcePacks = Lists.newArrayList(); + public DefaultResourcePack mcDefaultResourcePack; + private ResourcePackRepository mcResourcePackRepository; + private LanguageManager mcLanguageManager; + private IStream field_152353_at; + private Framebuffer framebufferMc; + private TextureMap textureMapBlocks; + private SoundHandler mcSoundHandler; + private MusicTicker mcMusicTicker; + private ResourceLocation field_152354_ay; + private final MinecraftSessionService field_152355_az; + private SkinManager field_152350_aA; + private final Queue field_152351_aB = Queues.newArrayDeque(); + private final Thread field_152352_aC = Thread.currentThread(); + /** Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly. */ + volatile boolean running = true; + /** String that shows the debug information */ + public String debug = ""; + /** Approximate time (in ms) of last update to debug string */ + long debugUpdateTime = getSystemTime(); + /** holds the current fps */ + int fpsCounter; + long prevFrameTime = -1L; + /** Profiler currently displayed in the debug screen pie chart */ + private String debugProfilerName = "root"; + private static final String __OBFID = "CL_00000631"; + + public Minecraft(Session sessionIn, int displayWidth, int displayHeight, boolean fullscreen, boolean isDemo, File dataDir, File assetsDir, File resourcePackDir, Proxy proxy, String version, Multimap twitchDetails, String assetsJsonVersion) + { + theMinecraft = this; + this.mcDataDir = dataDir; + this.fileAssets = assetsDir; + this.fileResourcepacks = resourcePackDir; + this.launchedVersion = version; + this.field_152356_J = twitchDetails; + this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(assetsDir, assetsJsonVersion)).func_152782_a()); + this.addDefaultResourcePack(); + this.proxy = proxy == null ? Proxy.NO_PROXY : proxy; + this.field_152355_az = (new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); + this.startTimerHackThread(); + this.session = sessionIn; + logger.info("Setting user: " + sessionIn.getUsername()); + this.isDemo = isDemo; + this.displayWidth = displayWidth; + this.displayHeight = displayHeight; + this.tempDisplayWidth = displayWidth; + this.tempDisplayHeight = displayHeight; + this.fullscreen = fullscreen; + this.jvm64bit = isJvm64bit(); + ImageIO.setUseCache(false); + Bootstrap.func_151354_b(); + } + + private static boolean isJvm64bit() + { + String[] astring = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + String[] astring1 = astring; + int i = astring.length; + + for (int j = 0; j < i; ++j) + { + String s = astring1[j]; + String s1 = System.getProperty(s); + + if (s1 != null && s1.contains("64")) + { + return true; + } + } + + return false; + } + + public Framebuffer getFramebuffer() + { + return this.framebufferMc; + } + + private void startTimerHackThread() + { + Thread thread = new Thread("Timer hack thread") + { + private static final String __OBFID = "CL_00000632"; + public void run() + { + while (Minecraft.this.running) + { + try + { + Thread.sleep(2147483647L); + } + catch (InterruptedException interruptedexception) + { + ; + } + } + } + }; + thread.setDaemon(true); + thread.start(); + } + + public void crashed(CrashReport crash) + { + this.hasCrashed = true; + this.crashReporter = crash; + } + + /** + * Wrapper around displayCrashReportInternal + */ + public void displayCrashReport(CrashReport crashReportIn) + { + File file1 = new File(getMinecraft().mcDataDir, "crash-reports"); + File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); + System.out.println(crashReportIn.getCompleteReport()); + + int retVal; + if (crashReportIn.getFile() != null) + { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + crashReportIn.getFile()); + retVal = -1; + } + else if (crashReportIn.saveToFile(file2)) + { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); + retVal = -1; + } + else + { + System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); + retVal = -2; + } + FMLCommonHandler.instance().handleExit(retVal); + } + + public void setServer(String serverHostname, int serverPort) + { + this.serverName = serverHostname; + this.serverPort = serverPort; + } + + /** + * Starts the game: initializes the canvas, the title, the settings, etcetera. + */ + private void startGame() throws LWJGLException + { + this.gameSettings = new GameSettings(this, this.mcDataDir); + + if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) + { + this.displayWidth = this.gameSettings.overrideWidth; + this.displayHeight = this.gameSettings.overrideHeight; + } + + if (this.fullscreen) + { + Display.setFullscreen(true); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); + + if (this.displayWidth <= 0) + { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) + { + this.displayHeight = 1; + } + } + else + { + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } + + Display.setResizable(true); + Display.setTitle("Minecraft 1.7.10"); + logger.info("LWJGL Version: " + Sys.getVersion()); + Util.EnumOS enumos = Util.getOSType(); + + if (enumos != Util.EnumOS.OSX) + { + try + { + InputStream inputstream = this.mcDefaultResourcePack.func_152780_c(new ResourceLocation("icons/icon_16x16.png")); + InputStream inputstream1 = this.mcDefaultResourcePack.func_152780_c(new ResourceLocation("icons/icon_32x32.png")); + + if (inputstream != null && inputstream1 != null) + { + Display.setIcon(new ByteBuffer[] {this.func_152340_a(inputstream), this.func_152340_a(inputstream1)}); + } + } + catch (IOException ioexception) + { + logger.error("Couldn\'t set icon", ioexception); + } + } + + try + { + net.minecraftforge.client.ForgeHooksClient.createDisplay(); + } + catch (LWJGLException lwjglexception) + { + logger.error("Couldn\'t set pixel format", lwjglexception); + + try + { + Thread.sleep(1000L); + } + catch (InterruptedException interruptedexception) + { + ; + } + + if (this.fullscreen) + { + this.updateDisplayMode(); + } + + Display.create(); + } + + OpenGlHelper.initializeTextures(); + + try + { + this.field_152353_at = new TwitchStream(this, (String)Iterables.getFirst(this.field_152356_J.get("twitch_access_token"), (Object)null)); + } + catch (Throwable throwable) + { + this.field_152353_at = new NullStream(throwable); + logger.error("Couldn\'t initialize twitch stream"); + } + + this.framebufferMc = new Framebuffer(this.displayWidth, this.displayHeight, true); + this.framebufferMc.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.guiAchievement = new GuiAchievement(this); + this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new FontMetadataSectionSerializer(), FontMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); + this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); + this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, new File(this.mcDataDir, "server-resource-packs"), this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); + this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); + this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); + this.mcResourceManager.registerReloadListener(this.mcLanguageManager); + FMLClientHandler.instance().beginMinecraftLoading(this, this.defaultResourcePacks, this.mcResourceManager); + this.renderEngine = new TextureManager(this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.renderEngine); + this.field_152350_aA = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.field_152355_az); + cpw.mods.fml.client.SplashProgress.drawVanillaScreen(); + this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings); + this.mcResourceManager.registerReloadListener(this.mcSoundHandler); + this.mcMusicTicker = new MusicTicker(this); + this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); + + if (this.gameSettings.language != null) + { + this.fontRenderer.setUnicodeFlag(this.func_152349_b()); + this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + } + + this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false); + this.mcResourceManager.registerReloadListener(this.fontRenderer); + this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer); + this.mcResourceManager.registerReloadListener(new GrassColorReloadListener()); + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + cpw.mods.fml.common.ProgressManager.ProgressBar bar= cpw.mods.fml.common.ProgressManager.push("Rendering Setup", 9, true); + bar.step("Loading Render Manager"); + RenderManager.instance.itemRenderer = new ItemRenderer(this); + bar.step("Loading Entity Renderer"); + this.entityRenderer = new EntityRenderer(this, this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.entityRenderer); + AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat() + { + private static final String __OBFID = "CL_00000639"; + /** + * Formats the strings based on 'IStatStringFormat' interface. + */ + public String formatString(String p_74535_1_) + { + try + { + return String.format(p_74535_1_, new Object[] {GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode())}); + } + catch (Exception exception) + { + return "Error: " + exception.getLocalizedMessage(); + } + } + }); + bar.step("Loading GL properties"); + this.mouseHelper = new MouseHelper(); + this.checkGLError("Pre startup"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glClearDepth(1.0D); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glCullFace(GL11.GL_BACK); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.checkGLError("Startup"); + bar.step("Render Global instance"); + this.renderGlobal = new RenderGlobal(this); + bar.step("Building Blocks Texture"); + this.textureMapBlocks = new TextureMap(0, "textures/blocks", true); + bar.step("Anisotropy and Mipmaps"); + this.textureMapBlocks.setAnisotropicFiltering(this.gameSettings.anisotropicFiltering); + this.textureMapBlocks.setMipmapLevels(this.gameSettings.mipmapLevels); + bar.step("Loading Blocks Texture"); + this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, this.textureMapBlocks); + bar.step("Loading Items Texture"); + this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items", true)); + bar.step("Viewport"); + GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + cpw.mods.fml.common.ProgressManager.pop(bar); + FMLClientHandler.instance().finishMinecraftLoading(); + this.checkGLError("Post startup"); + this.ingameGUI = new net.minecraftforge.client.GuiIngameForge(this); + + if (this.serverName != null) + { + FMLClientHandler.instance().connectToServerAtStartup(this.serverName, this.serverPort); + } + else + { + this.displayGuiScreen(new GuiMainMenu()); + } + + cpw.mods.fml.client.SplashProgress.clearVanillaResources(renderEngine, field_152354_ay); + this.field_152354_ay = null; + this.loadingScreen = new LoadingScreenRenderer(this); + + FMLClientHandler.instance().onInitializationComplete(); + if (this.gameSettings.fullScreen && !this.fullscreen) + { + this.toggleFullscreen(); + } + + try + { + Display.setVSyncEnabled(this.gameSettings.enableVsync); + } + catch (OpenGLException openglexception) + { + this.gameSettings.enableVsync = false; + this.gameSettings.saveOptions(); + } + } + + public boolean func_152349_b() + { + return this.mcLanguageManager.isCurrentLocaleUnicode() || this.gameSettings.forceUnicodeFont; + } + + public void refreshResources() + { + ArrayList arraylist = Lists.newArrayList(this.defaultResourcePacks); + Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator(); + + while (iterator.hasNext()) + { + ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next(); + arraylist.add(entry.getResourcePack()); + } + + if (this.mcResourcePackRepository.func_148530_e() != null) + { + arraylist.add(this.mcResourcePackRepository.func_148530_e()); + } + + try + { + this.mcResourceManager.reloadResources(arraylist); + } + catch (RuntimeException runtimeexception) + { + logger.info("Caught error stitching, removing all assigned resourcepacks", runtimeexception); + arraylist.clear(); + arraylist.addAll(this.defaultResourcePacks); + this.mcResourcePackRepository.func_148527_a(Collections.emptyList()); + this.mcResourceManager.reloadResources(arraylist); + this.gameSettings.resourcePacks.clear(); + this.gameSettings.saveOptions(); + } + + this.mcLanguageManager.parseLanguageMetadata(arraylist); + + if (this.renderGlobal != null) + { + this.renderGlobal.loadRenderers(); + } + } + + private void addDefaultResourcePack() + { + this.defaultResourcePacks.add(this.mcDefaultResourcePack); + } + + private ByteBuffer func_152340_a(InputStream imageStream) throws IOException + { + BufferedImage bufferedimage = ImageIO.read(imageStream); + int[] aint = bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), (int[])null, 0, bufferedimage.getWidth()); + ByteBuffer bytebuffer = ByteBuffer.allocate(4 * aint.length); + int[] aint1 = aint; + int i = aint.length; + + for (int j = 0; j < i; ++j) + { + int k = aint1[j]; + bytebuffer.putInt(k << 8 | k >> 24 & 255); + } + + bytebuffer.flip(); + return bytebuffer; + } + + private void updateDisplayMode() throws LWJGLException + { + HashSet hashset = new HashSet(); + Collections.addAll(hashset, Display.getAvailableDisplayModes()); + DisplayMode displaymode = Display.getDesktopDisplayMode(); + + if (!hashset.contains(displaymode) && Util.getOSType() == Util.EnumOS.OSX) + { + Iterator iterator = macDisplayModes.iterator(); + + while (iterator.hasNext()) + { + DisplayMode displaymode1 = (DisplayMode)iterator.next(); + boolean flag = true; + Iterator iterator1 = hashset.iterator(); + DisplayMode displaymode2; + + while (iterator1.hasNext()) + { + displaymode2 = (DisplayMode)iterator1.next(); + + if (displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() && displaymode2.getHeight() == displaymode1.getHeight()) + { + flag = false; + break; + } + } + + if (!flag) + { + iterator1 = hashset.iterator(); + + while (iterator1.hasNext()) + { + displaymode2 = (DisplayMode)iterator1.next(); + + if (displaymode2.getBitsPerPixel() == 32 && displaymode2.getWidth() == displaymode1.getWidth() / 2 && displaymode2.getHeight() == displaymode1.getHeight() / 2) + { + displaymode = displaymode2; + break; + } + } + } + } + } + + Display.setDisplayMode(displaymode); + this.displayWidth = displaymode.getWidth(); + this.displayHeight = displaymode.getHeight(); + } + + /** + * Displays a new screen. + */ + public void loadScreen() throws LWJGLException + { + ScaledResolution scaledresolution = new ScaledResolution(this, this.displayWidth, this.displayHeight); + int i = scaledresolution.getScaleFactor(); + Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true); + framebuffer.bindFramebuffer(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + try + { + this.field_152354_ay = this.renderEngine.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(this.mcDefaultResourcePack.getInputStream(locationMojangPng)))); + this.renderEngine.bindTexture(this.field_152354_ay); + } + catch (IOException ioexception) + { + logger.error("Unable to load logo: " + locationMojangPng, ioexception); + } + + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(16777215); + tessellator.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); + tessellator.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); + tessellator.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + tessellator.setColorOpaque_I(16777215); + short short1 = 256; + short short2 = 256; + this.scaledTessellator((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + framebuffer.unbindFramebuffer(); + framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glFlush(); + this.func_147120_f(); + } + + /** + * Loads Tessellator with a scaled resolution + */ + public void scaledTessellator(int width, int height, int width2, int height2, int stdTextureWidth, int stdTextureHeight) + { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(width + 0), (double)(height + stdTextureHeight), 0.0D, (double)((float)(width2 + 0) * f), (double)((float)(height2 + stdTextureHeight) * f1)); + tessellator.addVertexWithUV((double)(width + stdTextureWidth), (double)(height + stdTextureHeight), 0.0D, (double)((float)(width2 + stdTextureWidth) * f), (double)((float)(height2 + stdTextureHeight) * f1)); + tessellator.addVertexWithUV((double)(width + stdTextureWidth), (double)(height + 0), 0.0D, (double)((float)(width2 + stdTextureWidth) * f), (double)((float)(height2 + 0) * f1)); + tessellator.addVertexWithUV((double)(width + 0), (double)(height + 0), 0.0D, (double)((float)(width2 + 0) * f), (double)((float)(height2 + 0) * f1)); + tessellator.draw(); + } + + /** + * Returns the save loader that is currently being used + */ + public ISaveFormat getSaveLoader() + { + return this.saveLoader; + } + + /** + * Sets the argument GuiScreen as the main (topmost visible) screen. + */ + public void displayGuiScreen(GuiScreen guiScreenIn) + { + if (guiScreenIn == null && this.theWorld == null) + { + guiScreenIn = new GuiMainMenu(); + } + else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) + { + guiScreenIn = new GuiGameOver(); + } + + GuiScreen old = this.currentScreen; + net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(guiScreenIn); + + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + + guiScreenIn = event.gui; + if (old != null && guiScreenIn != old) + { + old.onGuiClosed(); + } + + if (guiScreenIn instanceof GuiMainMenu) + { + this.gameSettings.showDebugInfo = false; + this.ingameGUI.getChatGUI().clearChatMessages(); + } + + this.currentScreen = (GuiScreen)guiScreenIn; + + if (guiScreenIn != null) + { + this.setIngameNotInFocus(); + ScaledResolution scaledresolution = new ScaledResolution(this, this.displayWidth, this.displayHeight); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + ((GuiScreen)guiScreenIn).setWorldAndResolution(this, i, j); + this.skipRenderWorld = false; + } + else + { + this.mcSoundHandler.resumeSounds(); + this.setIngameFocus(); + } + } + + /** + * Checks for an OpenGL error. If there is one, prints the error ID and error string. + */ + private void checkGLError(String message) + { + int i = GL11.glGetError(); + + if (i != 0) + { + String s1 = GLU.gluErrorString(i); + logger.error("########## GL ERROR ##########"); + logger.error("@ " + message); + logger.error(i + ": " + s1); + } + } + + /** + * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the + * application (or web page) is exited. + */ + public void shutdownMinecraftApplet() + { + try + { + this.field_152353_at.func_152923_i(); + logger.info("Stopping!"); + + try + { + this.loadWorld((WorldClient)null); + } + catch (Throwable throwable1) + { + ; + } + + try + { + GLAllocation.deleteTexturesAndDisplayLists(); + } + catch (Throwable throwable) + { + ; + } + + this.mcSoundHandler.unloadSounds(); + } + finally + { + Display.destroy(); + + if (!this.hasCrashed) + { + System.exit(0); + } + } + + System.gc(); + } + + public void run() + { + this.running = true; + CrashReport crashreport; + + try + { + this.startGame(); + } + catch (Throwable throwable) + { + crashreport = CrashReport.makeCrashReport(throwable, "Initializing game"); + crashreport.makeCategory("Initialization"); + this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(crashreport)); + return; + } + + while (true) + { + try + { + while (this.running) + { + if (!this.hasCrashed || this.crashReporter == null) + { + try + { + this.runGameLoop(); + } + catch (OutOfMemoryError outofmemoryerror) + { + this.freeMemory(); + this.displayGuiScreen(new GuiMemoryErrorScreen()); + System.gc(); + } + + continue; + } + + this.displayCrashReport(this.crashReporter); + return; + } + } + catch (MinecraftError minecrafterror) + { + ; + } + catch (ReportedException reportedexception) + { + this.addGraphicsAndWorldToCrashReport(reportedexception.getCrashReport()); + this.freeMemory(); + logger.fatal("Reported exception thrown!", reportedexception); + this.displayCrashReport(reportedexception.getCrashReport()); + } + catch (Throwable throwable1) + { + crashreport = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", throwable1)); + this.freeMemory(); + logger.fatal("Unreported exception thrown!", throwable1); + this.displayCrashReport(crashreport); + } + finally + { + this.shutdownMinecraftApplet(); + } + + return; + } + } + + /** + * Called repeatedly from run() + */ + private void runGameLoop() + { + this.mcProfiler.startSection("root"); + + if (Display.isCreated() && Display.isCloseRequested()) + { + this.shutdown(); + } + + if (this.isGamePaused && this.theWorld != null) + { + float f = this.timer.renderPartialTicks; + this.timer.updateTimer(); + this.timer.renderPartialTicks = f; + } + else + { + this.timer.updateTimer(); + } + + if ((this.theWorld == null || this.currentScreen == null) && this.refreshTexturePacksScheduled) + { + this.refreshTexturePacksScheduled = false; + this.refreshResources(); + } + + long j = System.nanoTime(); + this.mcProfiler.startSection("tick"); + + for (int i = 0; i < this.timer.elapsedTicks; ++i) + { + this.runTick(); + } + + this.mcProfiler.endStartSection("preRenderErrors"); + long k = System.nanoTime() - j; + this.checkGLError("Pre render"); + RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; + this.mcProfiler.endStartSection("sound"); + this.mcSoundHandler.setListener(this.thePlayer, this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + this.mcProfiler.startSection("render"); + GL11.glPushMatrix(); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + this.framebufferMc.bindFramebuffer(true); + this.mcProfiler.startSection("display"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + + if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) + { + this.gameSettings.thirdPersonView = 0; + } + + this.mcProfiler.endSection(); + + if (!this.skipRenderWorld) + { + FMLCommonHandler.instance().onRenderTickStart(this.timer.renderPartialTicks); + this.mcProfiler.endStartSection("gameRenderer"); + this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); + this.mcProfiler.endSection(); + FMLCommonHandler.instance().onRenderTickEnd(this.timer.renderPartialTicks); + } + + GL11.glFlush(); + this.mcProfiler.endSection(); + + if (!Display.isActive() && this.fullscreen) + { + this.toggleFullscreen(); + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) + { + if (!this.mcProfiler.profilingEnabled) + { + this.mcProfiler.clearProfiling(); + } + + this.mcProfiler.profilingEnabled = true; + this.displayDebugInfo(k); + } + else + { + this.mcProfiler.profilingEnabled = false; + this.prevFrameTime = System.nanoTime(); + } + + this.guiAchievement.func_146254_a(); + this.framebufferMc.unbindFramebuffer(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + this.framebufferMc.framebufferRender(this.displayWidth, this.displayHeight); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + this.entityRenderer.func_152430_c(this.timer.renderPartialTicks); + GL11.glPopMatrix(); + this.mcProfiler.startSection("root"); + this.func_147120_f(); + Thread.yield(); + this.mcProfiler.startSection("stream"); + this.mcProfiler.startSection("update"); + this.field_152353_at.func_152935_j(); + this.mcProfiler.endStartSection("submit"); + this.field_152353_at.func_152922_k(); + this.mcProfiler.endSection(); + this.mcProfiler.endSection(); + this.checkGLError("Post render"); + ++this.fpsCounter; + this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); + + while (getSystemTime() >= this.debugUpdateTime + 1000L) + { + debugFPS = this.fpsCounter; + this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; + WorldRenderer.chunksUpdated = 0; + this.debugUpdateTime += 1000L; + this.fpsCounter = 0; + this.usageSnooper.addMemoryStatsToSnooper(); + + if (!this.usageSnooper.isSnooperRunning()) + { + this.usageSnooper.startSnooper(); + } + } + + this.mcProfiler.endSection(); + + if (this.isFramerateLimitBelowMax()) + { + Display.sync(this.getLimitFramerate()); + } + } + + public void func_147120_f() + { + Display.update(); + + if (!this.fullscreen && Display.wasResized()) + { + int i = this.displayWidth; + int j = this.displayHeight; + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); + + if (this.displayWidth != i || this.displayHeight != j) + { + if (this.displayWidth <= 0) + { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) + { + this.displayHeight = 1; + } + + this.resize(this.displayWidth, this.displayHeight); + } + } + } + + public int getLimitFramerate() + { + return this.theWorld == null && this.currentScreen != null ? 30 : this.gameSettings.limitFramerate; + } + + public boolean isFramerateLimitBelowMax() + { + return (float)this.getLimitFramerate() < GameSettings.Options.FRAMERATE_LIMIT.getValueMax(); + } + + public void freeMemory() + { + try + { + memoryReserve = new byte[0]; + this.renderGlobal.deleteAllDisplayLists(); + } + catch (Throwable throwable2) + { + ; + } + + try + { + System.gc(); + } + catch (Throwable throwable1) + { + ; + } + + try + { + System.gc(); + this.loadWorld((WorldClient)null); + } + catch (Throwable throwable) + { + ; + } + + System.gc(); + } + + /** + * Update debugProfilerName in response to number keys in debug screen + */ + private void updateDebugProfilerName(int keyCount) + { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + + if (list != null && !list.isEmpty()) + { + Profiler.Result result = (Profiler.Result)list.remove(0); + + if (keyCount == 0) + { + if (result.field_76331_c.length() > 0) + { + int j = this.debugProfilerName.lastIndexOf("."); + + if (j >= 0) + { + this.debugProfilerName = this.debugProfilerName.substring(0, j); + } + } + } + else + { + --keyCount; + + if (keyCount < list.size() && !((Profiler.Result)list.get(keyCount)).field_76331_c.equals("unspecified")) + { + if (this.debugProfilerName.length() > 0) + { + this.debugProfilerName = this.debugProfilerName + "."; + } + + this.debugProfilerName = this.debugProfilerName + ((Profiler.Result)list.get(keyCount)).field_76331_c; + } + } + } + } + + private void displayDebugInfo(long elapsedTicksTime) + { + if (this.mcProfiler.profilingEnabled) + { + List list = this.mcProfiler.getProfilingData(this.debugProfilerName); + Profiler.Result result = (Profiler.Result)list.remove(0); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)this.displayWidth, (double)this.displayHeight, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glLineWidth(1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator tessellator = Tessellator.instance; + short short1 = 160; + int j = this.displayWidth - short1 - 10; + int k = this.displayHeight - short1 * 2; + GL11.glEnable(GL11.GL_BLEND); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(0, 200); + tessellator.addVertex((double)((float)j - (float)short1 * 1.1F), (double)((float)k - (float)short1 * 0.6F - 16.0F), 0.0D); + tessellator.addVertex((double)((float)j - (float)short1 * 1.1F), (double)(k + short1 * 2), 0.0D); + tessellator.addVertex((double)((float)j + (float)short1 * 1.1F), (double)(k + short1 * 2), 0.0D); + tessellator.addVertex((double)((float)j + (float)short1 * 1.1F), (double)((float)k - (float)short1 * 0.6F - 16.0F), 0.0D); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + double d0 = 0.0D; + int i1; + + for (int l = 0; l < list.size(); ++l) + { + Profiler.Result result1 = (Profiler.Result)list.get(l); + i1 = MathHelper.floor_double(result1.field_76332_a / 4.0D) + 1; + tessellator.startDrawing(6); + tessellator.setColorOpaque_I(result1.func_76329_a()); + tessellator.addVertex((double)j, (double)k, 0.0D); + int j1; + float f; + float f1; + float f2; + + for (j1 = i1; j1 >= 0; --j1) + { + f = (float)((d0 + result1.field_76332_a * (double)j1 / (double)i1) * Math.PI * 2.0D / 100.0D); + f1 = MathHelper.sin(f) * (float)short1; + f2 = MathHelper.cos(f) * (float)short1 * 0.5F; + tessellator.addVertex((double)((float)j + f1), (double)((float)k - f2), 0.0D); + } + + tessellator.draw(); + tessellator.startDrawing(5); + tessellator.setColorOpaque_I((result1.func_76329_a() & 16711422) >> 1); + + for (j1 = i1; j1 >= 0; --j1) + { + f = (float)((d0 + result1.field_76332_a * (double)j1 / (double)i1) * Math.PI * 2.0D / 100.0D); + f1 = MathHelper.sin(f) * (float)short1; + f2 = MathHelper.cos(f) * (float)short1 * 0.5F; + tessellator.addVertex((double)((float)j + f1), (double)((float)k - f2), 0.0D); + tessellator.addVertex((double)((float)j + f1), (double)((float)k - f2 + 10.0F), 0.0D); + } + + tessellator.draw(); + d0 += result1.field_76332_a; + } + + DecimalFormat decimalformat = new DecimalFormat("##0.00"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + String s = ""; + + if (!result.field_76331_c.equals("unspecified")) + { + s = s + "[0] "; + } + + if (result.field_76331_c.length() == 0) + { + s = s + "ROOT "; + } + else + { + s = s + result.field_76331_c + " "; + } + + i1 = 16777215; + this.fontRenderer.drawStringWithShadow(s, j - short1, k - short1 / 2 - 16, i1); + this.fontRenderer.drawStringWithShadow(s = decimalformat.format(result.field_76330_b) + "%", j + short1 - this.fontRenderer.getStringWidth(s), k - short1 / 2 - 16, i1); + + for (int k1 = 0; k1 < list.size(); ++k1) + { + Profiler.Result result2 = (Profiler.Result)list.get(k1); + String s1 = ""; + + if (result2.field_76331_c.equals("unspecified")) + { + s1 = s1 + "[?] "; + } + else + { + s1 = s1 + "[" + (k1 + 1) + "] "; + } + + s1 = s1 + result2.field_76331_c; + this.fontRenderer.drawStringWithShadow(s1, j - short1, k + short1 / 2 + k1 * 8 + 20, result2.func_76329_a()); + this.fontRenderer.drawStringWithShadow(s1 = decimalformat.format(result2.field_76332_a) + "%", j + short1 - 50 - this.fontRenderer.getStringWidth(s1), k + short1 / 2 + k1 * 8 + 20, result2.func_76329_a()); + this.fontRenderer.drawStringWithShadow(s1 = decimalformat.format(result2.field_76330_b) + "%", j + short1 - this.fontRenderer.getStringWidth(s1), k + short1 / 2 + k1 * 8 + 20, result2.func_76329_a()); + } + } + } + + /** + * Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly. + */ + public void shutdown() + { + this.running = false; + } + + /** + * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen + * currently displayed + */ + public void setIngameFocus() + { + if (Display.isActive()) + { + if (!this.inGameHasFocus) + { + this.inGameHasFocus = true; + this.mouseHelper.grabMouseCursor(); + this.displayGuiScreen((GuiScreen)null); + this.leftClickCounter = 10000; + } + } + } + + /** + * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. + */ + public void setIngameNotInFocus() + { + if (this.inGameHasFocus) + { + KeyBinding.unPressAllKeys(); + this.inGameHasFocus = false; + this.mouseHelper.ungrabMouseCursor(); + } + } + + /** + * Displays the ingame menu + */ + public void displayInGameMenu() + { + if (this.currentScreen == null) + { + this.displayGuiScreen(new GuiIngameMenu()); + + if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) + { + this.mcSoundHandler.pauseSounds(); + } + } + } + + private void func_147115_a(boolean leftClick) + { + if (!leftClick) + { + this.leftClickCounter = 0; + } + + if (this.leftClickCounter <= 0) + { + if (leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = this.objectMouseOver.blockX; + int j = this.objectMouseOver.blockY; + int k = this.objectMouseOver.blockZ; + + if (this.theWorld.getBlock(i, j, k).getMaterial() != Material.air) + { + this.playerController.onPlayerDamageBlock(i, j, k, this.objectMouseOver.sideHit); + + if (this.thePlayer.isCurrentToolAdventureModeExempt(i, j, k)) + { + this.effectRenderer.addBlockHitEffects(i, j, k, this.objectMouseOver); + this.thePlayer.swingItem(); + } + } + } + else + { + this.playerController.resetBlockRemoving(); + } + } + } + + private void func_147116_af() + { + if (this.leftClickCounter <= 0) + { + this.thePlayer.swingItem(); + + if (this.objectMouseOver == null) + { + logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); + + if (this.playerController.isNotCreative()) + { + this.leftClickCounter = 10; + } + } + else + { + switch (Minecraft.SwitchMovingObjectType.field_152390_a[this.objectMouseOver.typeOfHit.ordinal()]) + { + case 1: + this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); + break; + case 2: + int i = this.objectMouseOver.blockX; + int j = this.objectMouseOver.blockY; + int k = this.objectMouseOver.blockZ; + + if (this.theWorld.getBlock(i, j, k).getMaterial() == Material.air) + { + if (this.playerController.isNotCreative()) + { + this.leftClickCounter = 10; + } + } + else + { + this.playerController.clickBlock(i, j, k, this.objectMouseOver.sideHit); + } + } + } + } + } + + private void func_147121_ag() + { + this.rightClickDelayTimer = 4; + boolean flag = true; + ItemStack itemstack = this.thePlayer.inventory.getCurrentItem(); + + if (this.objectMouseOver == null) + { + logger.warn("Null returned as \'hitResult\', this shouldn\'t happen!"); + } + else + { + switch (Minecraft.SwitchMovingObjectType.field_152390_a[this.objectMouseOver.typeOfHit.ordinal()]) + { + case 1: + if (this.playerController.interactWithEntitySendPacket(this.thePlayer, this.objectMouseOver.entityHit)) + { + flag = false; + } + + break; + case 2: + int i = this.objectMouseOver.blockX; + int j = this.objectMouseOver.blockY; + int k = this.objectMouseOver.blockZ; + + if (!this.theWorld.getBlock(i, j, k).isAir(theWorld, i, j, k)) + { + int l = itemstack != null ? itemstack.stackSize : 0; + + boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, i, j, k, this.objectMouseOver.sideHit, this.theWorld).isCanceled(); + if (result && this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, itemstack, i, j, k, this.objectMouseOver.sideHit, this.objectMouseOver.hitVec)) + { + flag = false; + this.thePlayer.swingItem(); + } + + if (itemstack == null) + { + return; + } + + if (itemstack.stackSize == 0) + { + this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; + } + else if (itemstack.stackSize != l || this.playerController.isInCreativeMode()) + { + this.entityRenderer.itemRenderer.resetEquippedProgress(); + } + } + } + } + + if (flag) + { + ItemStack itemstack1 = this.thePlayer.inventory.getCurrentItem(); + + boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(thePlayer, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, this.theWorld).isCanceled(); + if (result && itemstack1 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, itemstack1)) + { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } + } + } + + /** + * Toggles fullscreen mode. + */ + public void toggleFullscreen() + { + try + { + this.fullscreen = !this.fullscreen; + + if (this.fullscreen) + { + this.updateDisplayMode(); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); + + if (this.displayWidth <= 0) + { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) + { + this.displayHeight = 1; + } + } + else + { + Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); + this.displayWidth = this.tempDisplayWidth; + this.displayHeight = this.tempDisplayHeight; + + if (this.displayWidth <= 0) + { + this.displayWidth = 1; + } + + if (this.displayHeight <= 0) + { + this.displayHeight = 1; + } + } + + if (this.currentScreen != null) + { + this.resize(this.displayWidth, this.displayHeight); + } + else + { + this.updateFramebufferSize(); + } + + Display.setFullscreen(this.fullscreen); + Display.setVSyncEnabled(this.gameSettings.enableVsync); + this.func_147120_f(); + } + catch (Exception exception) + { + logger.error("Couldn\'t toggle fullscreen", exception); + } + } + + /** + * Called to resize the current screen. + */ + public void resize(int width, int height) + { + this.displayWidth = width <= 0 ? 1 : width; + this.displayHeight = height <= 0 ? 1 : height; + + if (this.currentScreen != null) + { + ScaledResolution scaledresolution = new ScaledResolution(this, width, height); + int k = scaledresolution.getScaledWidth(); + int l = scaledresolution.getScaledHeight(); + this.currentScreen.setWorldAndResolution(this, k, l); + } + + this.loadingScreen = new LoadingScreenRenderer(this); + this.updateFramebufferSize(); + } + + private void updateFramebufferSize() + { + this.framebufferMc.createBindFramebuffer(this.displayWidth, this.displayHeight); + + if (this.entityRenderer != null) + { + this.entityRenderer.updateShaderGroupSize(this.displayWidth, this.displayHeight); + } + } + + /** + * Runs the current tick. + */ + public void runTick() + { + this.mcProfiler.startSection("scheduledExecutables"); + Queue queue = this.field_152351_aB; + + synchronized (this.field_152351_aB) + { + while (!this.field_152351_aB.isEmpty()) + { + ((FutureTask)this.field_152351_aB.poll()).run(); + } + } + + this.mcProfiler.endSection(); + + if (this.rightClickDelayTimer > 0) + { + --this.rightClickDelayTimer; + } + + FMLCommonHandler.instance().onPreClientTick(); + + this.mcProfiler.startSection("gui"); + + if (!this.isGamePaused) + { + this.ingameGUI.updateTick(); + } + + this.mcProfiler.endStartSection("pick"); + this.entityRenderer.getMouseOver(1.0F); + this.mcProfiler.endStartSection("gameMode"); + + if (!this.isGamePaused && this.theWorld != null) + { + this.playerController.updateController(); + } + + this.mcProfiler.endStartSection("textures"); + + if (!this.isGamePaused) + { + this.renderEngine.tick(); + } + + if (this.currentScreen == null && this.thePlayer != null) + { + if (this.thePlayer.getHealth() <= 0.0F) + { + this.displayGuiScreen((GuiScreen)null); + } + else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) + { + this.displayGuiScreen(new GuiSleepMP()); + } + } + else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) + { + this.displayGuiScreen((GuiScreen)null); + } + + if (this.currentScreen != null) + { + this.leftClickCounter = 10000; + } + + CrashReport crashreport; + CrashReportCategory crashreportcategory; + + if (this.currentScreen != null) + { + try + { + this.currentScreen.handleInput(); + } + catch (Throwable throwable1) + { + crashreport = CrashReport.makeCrashReport(throwable1, "Updating screen events"); + crashreportcategory = crashreport.makeCategory("Affected screen"); + crashreportcategory.addCrashSectionCallable("Screen name", new Callable() + { + private static final String __OBFID = "CL_00000640"; + public String call() + { + return Minecraft.this.currentScreen.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + + if (this.currentScreen != null) + { + try + { + this.currentScreen.updateScreen(); + } + catch (Throwable throwable) + { + crashreport = CrashReport.makeCrashReport(throwable, "Ticking screen"); + crashreportcategory = crashreport.makeCategory("Affected screen"); + crashreportcategory.addCrashSectionCallable("Screen name", new Callable() + { + private static final String __OBFID = "CL_00000642"; + public String call() + { + return Minecraft.this.currentScreen.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + if (this.currentScreen == null || this.currentScreen.allowUserInput) + { + this.mcProfiler.endStartSection("mouse"); + int j; + + while (Mouse.next()) + { + if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; + + j = Mouse.getEventButton(); + KeyBinding.setKeyBindState(j - 100, Mouse.getEventButtonState()); + + if (Mouse.getEventButtonState()) + { + KeyBinding.onTick(j - 100); + } + + long k = getSystemTime() - this.systemTime; + + if (k <= 200L) + { + int i = Mouse.getEventDWheel(); + + if (i != 0) + { + this.thePlayer.inventory.changeCurrentItem(i); + + if (this.gameSettings.noclip) + { + if (i > 0) + { + i = 1; + } + + if (i < 0) + { + i = -1; + } + + this.gameSettings.noclipRate += (float)i * 0.25F; + } + } + + if (this.currentScreen == null) + { + if (!this.inGameHasFocus && Mouse.getEventButtonState()) + { + this.setIngameFocus(); + } + } + else if (this.currentScreen != null) + { + this.currentScreen.handleMouseInput(); + } + } + FMLCommonHandler.instance().fireMouseInput(); + } + + if (this.leftClickCounter > 0) + { + --this.leftClickCounter; + } + + this.mcProfiler.endStartSection("keyboard"); + boolean flag; + + while (Keyboard.next()) + { + KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); + + if (Keyboard.getEventKeyState()) + { + KeyBinding.onTick(Keyboard.getEventKey()); + } + + if (this.field_83002_am > 0L) + { + if (getSystemTime() - this.field_83002_am >= 6000L) + { + throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); + } + + if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) + { + this.field_83002_am = -1L; + } + } + else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) + { + this.field_83002_am = getSystemTime(); + } + + this.func_152348_aa(); + + if (Keyboard.getEventKeyState()) + { + if (Keyboard.getEventKey() == 62 && this.entityRenderer != null) + { + this.entityRenderer.deactivateShader(); + } + + if (this.currentScreen != null) + { + this.currentScreen.handleKeyboardInput(); + } + else + { + if (Keyboard.getEventKey() == 1) + { + this.displayInGameMenu(); + } + + if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) + { + this.refreshResources(); + } + + if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61)) + { + this.refreshResources(); + } + + if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61)) + { + flag = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54); + this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, flag ? -1 : 1); + } + + if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61)) + { + this.renderGlobal.loadRenderers(); + } + + if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61)) + { + this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; + this.gameSettings.saveOptions(); + } + + if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61)) + { + RenderManager.debugBoundingBox = !RenderManager.debugBoundingBox; + } + + if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61)) + { + this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; + this.gameSettings.saveOptions(); + } + + if (Keyboard.getEventKey() == 59) + { + this.gameSettings.hideGUI = !this.gameSettings.hideGUI; + } + + if (Keyboard.getEventKey() == 61) + { + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + } + + if (this.gameSettings.keyBindTogglePerspective.isPressed()) + { + ++this.gameSettings.thirdPersonView; + + if (this.gameSettings.thirdPersonView > 2) + { + this.gameSettings.thirdPersonView = 0; + } + } + + if (this.gameSettings.keyBindSmoothCamera.isPressed()) + { + this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; + } + } + + if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) + { + if (Keyboard.getEventKey() == 11) + { + this.updateDebugProfilerName(0); + } + + for (j = 0; j < 9; ++j) + { + if (Keyboard.getEventKey() == 2 + j) + { + this.updateDebugProfilerName(j + 1); + } + } + } + } + FMLCommonHandler.instance().fireKeyInput(); + } + + for (j = 0; j < 9; ++j) + { + if (this.gameSettings.keyBindsHotbar[j].isPressed()) + { + this.thePlayer.inventory.currentItem = j; + } + } + + flag = this.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN; + + while (this.gameSettings.keyBindInventory.isPressed()) + { + if (this.playerController.func_110738_j()) + { + this.thePlayer.func_110322_i(); + } + else + { + this.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); + this.displayGuiScreen(new GuiInventory(this.thePlayer)); + } + } + + while (this.gameSettings.keyBindDrop.isPressed()) + { + this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); + } + + while (this.gameSettings.keyBindChat.isPressed() && flag) + { + this.displayGuiScreen(new GuiChat()); + } + + if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && flag) + { + this.displayGuiScreen(new GuiChat("/")); + } + + if (this.thePlayer.isUsingItem()) + { + if (!this.gameSettings.keyBindUseItem.getIsKeyPressed()) + { + this.playerController.onStoppedUsingItem(this.thePlayer); + } + + label391: + + while (true) + { + if (!this.gameSettings.keyBindAttack.isPressed()) + { + while (this.gameSettings.keyBindUseItem.isPressed()) + { + ; + } + + while (true) + { + if (this.gameSettings.keyBindPickBlock.isPressed()) + { + continue; + } + + break label391; + } + } + } + } + else + { + while (this.gameSettings.keyBindAttack.isPressed()) + { + this.func_147116_af(); + } + + while (this.gameSettings.keyBindUseItem.isPressed()) + { + this.func_147121_ag(); + } + + while (this.gameSettings.keyBindPickBlock.isPressed()) + { + this.func_147112_ai(); + } + } + + if (this.gameSettings.keyBindUseItem.getIsKeyPressed() && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) + { + this.func_147121_ag(); + } + + this.func_147115_a(this.currentScreen == null && this.gameSettings.keyBindAttack.getIsKeyPressed() && this.inGameHasFocus); + } + + if (this.theWorld != null) + { + if (this.thePlayer != null) + { + ++this.joinPlayerCounter; + + if (this.joinPlayerCounter == 30) + { + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); + } + } + + this.mcProfiler.endStartSection("gameRenderer"); + + if (!this.isGamePaused) + { + this.entityRenderer.updateRenderer(); + } + + this.mcProfiler.endStartSection("levelRenderer"); + + if (!this.isGamePaused) + { + this.renderGlobal.updateClouds(); + } + + this.mcProfiler.endStartSection("level"); + + if (!this.isGamePaused) + { + if (this.theWorld.lastLightningBolt > 0) + { + --this.theWorld.lastLightningBolt; + } + + this.theWorld.updateEntities(); + } + } + + if (!this.isGamePaused) + { + this.mcMusicTicker.update(); + this.mcSoundHandler.update(); + } + + if (this.theWorld != null) + { + if (!this.isGamePaused) + { + this.theWorld.setAllowedSpawnTypes(this.theWorld.difficultySetting != EnumDifficulty.PEACEFUL, true); + + try + { + this.theWorld.tick(); + } + catch (Throwable throwable2) + { + crashreport = CrashReport.makeCrashReport(throwable2, "Exception in world tick"); + + if (this.theWorld == null) + { + crashreportcategory = crashreport.makeCategory("Affected level"); + crashreportcategory.addCrashSection("Problem", "Level is null!"); + } + else + { + this.theWorld.addWorldInfoToCrashReport(crashreport); + } + + throw new ReportedException(crashreport); + } + } + + this.mcProfiler.endStartSection("animateTick"); + + if (!this.isGamePaused && this.theWorld != null) + { + this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); + } + + this.mcProfiler.endStartSection("particles"); + + if (!this.isGamePaused) + { + this.effectRenderer.updateEffects(); + } + } + else if (this.myNetworkManager != null) + { + this.mcProfiler.endStartSection("pendingConnection"); + this.myNetworkManager.processReceivedPackets(); + } + + FMLCommonHandler.instance().onPostClientTick(); + + this.mcProfiler.endSection(); + this.systemTime = getSystemTime(); + } + + /** + * Arguments: World foldername, World ingame name, WorldSettings + */ + public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) + { + FMLClientHandler.instance().startIntegratedServer(folderName, worldName, worldSettingsIn); + this.loadWorld((WorldClient)null); + System.gc(); + ISaveHandler isavehandler = this.saveLoader.getSaveLoader(folderName, false); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + + if (worldinfo == null && worldSettingsIn != null) + { + worldinfo = new WorldInfo(worldSettingsIn, folderName); + isavehandler.saveWorldInfo(worldinfo); + } + + if (worldSettingsIn == null) + { + worldSettingsIn = new WorldSettings(worldinfo); + } + + try + { + this.theIntegratedServer = new IntegratedServer(this, folderName, worldName, worldSettingsIn); + this.theIntegratedServer.startServerThread(); + this.integratedServerIsRunning = true; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Starting integrated server"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Starting integrated server"); + crashreportcategory.addCrashSection("Level ID", folderName); + crashreportcategory.addCrashSection("Level Name", worldName); + throw new ReportedException(crashreport); + } + + this.loadingScreen.displayProgressMessage(I18n.format("menu.loadingLevel", new Object[0])); + + while (!this.theIntegratedServer.serverIsInRunLoop()) + { + if (!StartupQuery.check()) + { + loadWorld(null); + displayGuiScreen(null); + return; + } + String s2 = this.theIntegratedServer.getUserMessage(); + + if (s2 != null) + { + this.loadingScreen.resetProgresAndWorkingMessage(I18n.format(s2, new Object[0])); + } + else + { + this.loadingScreen.resetProgresAndWorkingMessage(""); + } + + try + { + Thread.sleep(200L); + } + catch (InterruptedException interruptedexception) + { + ; + } + } + + this.displayGuiScreen((GuiScreen)null); + SocketAddress socketaddress = this.theIntegratedServer.func_147137_ag().addLocalEndpoint(); + NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress); + networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null)); + networkmanager.scheduleOutboundPacket(new C00Handshake(5, socketaddress.toString(), 0, EnumConnectionState.LOGIN), new GenericFutureListener[0]); + networkmanager.scheduleOutboundPacket(new C00PacketLoginStart(this.getSession().func_148256_e()), new GenericFutureListener[0]); + this.myNetworkManager = networkmanager; + } + + /** + * unloads the current world first + */ + public void loadWorld(WorldClient worldClientIn) + { + this.loadWorld(worldClientIn, ""); + } + + /** + * par2Str is displayed on the loading screen to the user unloads the current world first + */ + public void loadWorld(WorldClient worldClientIn, String loadingMessage) + { + if (theWorld != null) + { + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(theWorld)); + } + + if (worldClientIn == null) + { + NetHandlerPlayClient nethandlerplayclient = this.getNetHandler(); + + if (nethandlerplayclient != null) + { + nethandlerplayclient.cleanup(); + } + + if (this.theIntegratedServer != null) + { + this.theIntegratedServer.initiateShutdown(); + if (loadingScreen != null) + { + this.loadingScreen.resetProgresAndWorkingMessage(I18n.format("forge.client.shutdown.internal")); + } + while (!theIntegratedServer.isServerStopped()) + { + try + { + Thread.sleep(10); + } + catch (InterruptedException ie) {} + } + } + + this.theIntegratedServer = null; + this.guiAchievement.func_146257_b(); + this.entityRenderer.getMapItemRenderer().func_148249_a(); + } + + this.renderViewEntity = null; + this.myNetworkManager = null; + + if (this.loadingScreen != null) + { + this.loadingScreen.resetProgressAndMessage(loadingMessage); + this.loadingScreen.resetProgresAndWorkingMessage(""); + } + + if (worldClientIn == null && this.theWorld != null) + { + if (this.mcResourcePackRepository.func_148530_e() != null) + { + this.scheduleResourcesRefresh(); + } + + this.mcResourcePackRepository.func_148529_f(); + this.setServerData((ServerData)null); + this.integratedServerIsRunning = false; + FMLClientHandler.instance().handleClientWorldClosing(this.theWorld); + } + + this.mcSoundHandler.stopSounds(); + this.theWorld = worldClientIn; + + if (worldClientIn != null) + { + if (this.renderGlobal != null) + { + this.renderGlobal.setWorldAndLoadRenderers(worldClientIn); + } + + if (this.effectRenderer != null) + { + this.effectRenderer.clearEffects(worldClientIn); + } + + if (this.thePlayer == null) + { + this.thePlayer = this.playerController.func_147493_a(worldClientIn, new StatFileWriter()); + this.playerController.flipPlayer(this.thePlayer); + } + + this.thePlayer.preparePlayerToSpawn(); + worldClientIn.spawnEntityInWorld(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.renderViewEntity = this.thePlayer; + } + else + { + this.saveLoader.flushCache(); + this.thePlayer = null; + } + + System.gc(); + this.systemTime = 0L; + } + + /** + * A String of renderGlobal.getDebugInfoRenders + */ + public String debugInfoRenders() + { + return this.renderGlobal.getDebugInfoRenders(); + } + + /** + * Gets the information in the F3 menu about how many entities are infront/around you + */ + public String getEntityDebug() + { + return this.renderGlobal.getDebugInfoEntities(); + } + + /** + * Gets the name of the world's current chunk provider + */ + public String getWorldProviderName() + { + return this.theWorld.getProviderName(); + } + + /** + * A String of how many entities are in the world + */ + public String debugInfoEntities() + { + return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities(); + } + + public void setDimensionAndSpawnPlayer(int dimension) + { + this.theWorld.setSpawnLocation(); + this.theWorld.removeAllEntities(); + int j = 0; + String s = null; + + if (this.thePlayer != null) + { + j = this.thePlayer.getEntityId(); + this.theWorld.removeEntity(this.thePlayer); + s = this.thePlayer.func_142021_k(); + } + + this.renderViewEntity = null; + this.thePlayer = this.playerController.func_147493_a(this.theWorld, this.thePlayer == null ? new StatFileWriter() : this.thePlayer.getStatFileWriter()); + this.thePlayer.dimension = dimension; + this.renderViewEntity = this.thePlayer; + this.thePlayer.preparePlayerToSpawn(); + this.thePlayer.func_142020_c(s); + this.theWorld.spawnEntityInWorld(this.thePlayer); + this.playerController.flipPlayer(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.thePlayer.setEntityId(j); + this.playerController.setPlayerCapabilities(this.thePlayer); + + if (this.currentScreen instanceof GuiGameOver) + { + this.displayGuiScreen((GuiScreen)null); + } + } + + /** + * Gets whether this is a demo or not. + */ + public final boolean isDemo() + { + return this.isDemo; + } + + public NetHandlerPlayClient getNetHandler() + { + return this.thePlayer != null ? this.thePlayer.sendQueue : null; + } + + public static boolean isGuiEnabled() + { + return theMinecraft == null || !theMinecraft.gameSettings.hideGUI; + } + + public static boolean isFancyGraphicsEnabled() + { + return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; + } + + /** + * Returns if ambient occlusion is enabled + */ + public static boolean isAmbientOcclusionEnabled() + { + return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; + } + + private void func_147112_ai() + { + if (this.objectMouseOver != null) + { + boolean flag = this.thePlayer.capabilities.isCreativeMode; + int j; + + if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.objectMouseOver, this.thePlayer, this.theWorld)) return; + // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions + if (flag) + { + j = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; + this.playerController.sendSlotPacket(this.thePlayer.inventory.getStackInSlot(this.thePlayer.inventory.currentItem), j); + } + } + } + + /** + * adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report + */ + public CrashReport addGraphicsAndWorldToCrashReport(CrashReport theCrash) + { + theCrash.getCategory().addCrashSectionCallable("Launched Version", new Callable() + { + private static final String __OBFID = "CL_00000643"; + public String call() + { + return Minecraft.this.launchedVersion; + } + }); + theCrash.getCategory().addCrashSectionCallable("LWJGL", new Callable() + { + private static final String __OBFID = "CL_00000644"; + public String call() + { + return Sys.getVersion(); + } + }); + theCrash.getCategory().addCrashSectionCallable("OpenGL", new Callable() + { + private static final String __OBFID = "CL_00000645"; + public String call() + { + return GL11.glGetString(GL11.GL_RENDERER) + " GL version " + GL11.glGetString(GL11.GL_VERSION) + ", " + GL11.glGetString(GL11.GL_VENDOR); + } + }); + theCrash.getCategory().addCrashSectionCallable("GL Caps", new Callable() + { + private static final String __OBFID = "CL_00000646"; + public String call() + { + return OpenGlHelper.func_153172_c(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Is Modded", new Callable() + { + private static final String __OBFID = "CL_00000647"; + public String call() + { + String s = ClientBrandRetriever.getClientModName(); + return !s.equals("vanilla") ? "Definitely; Client brand changed to \'" + s + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and client brand is untouched."); + } + }); + theCrash.getCategory().addCrashSectionCallable("Type", new Callable() + { + private static final String __OBFID = "CL_00000633"; + public String call() + { + return "Client (map_client.txt)"; + } + }); + theCrash.getCategory().addCrashSectionCallable("Resource Packs", new Callable() + { + private static final String __OBFID = "CL_00000634"; + public String call() + { + return Minecraft.this.gameSettings.resourcePacks.toString(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Current Language", new Callable() + { + private static final String __OBFID = "CL_00000635"; + public String call() + { + return Minecraft.this.mcLanguageManager.getCurrentLanguage().toString(); + } + }); + theCrash.getCategory().addCrashSectionCallable("Profiler Position", new Callable() + { + private static final String __OBFID = "CL_00000636"; + public String call() + { + return Minecraft.this.mcProfiler.profilingEnabled ? Minecraft.this.mcProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + theCrash.getCategory().addCrashSectionCallable("Vec3 Pool Size", new Callable() + { + private static final String __OBFID = "CL_00000637"; + public String call() + { + byte b0 = 0; + int i = 56 * b0; + int j = i / 1024 / 1024; + byte b1 = 0; + int k = 56 * b1; + int l = k / 1024 / 1024; + return b0 + " (" + i + " bytes; " + j + " MB) allocated, " + b1 + " (" + k + " bytes; " + l + " MB) used"; + } + }); + theCrash.getCategory().addCrashSectionCallable("Anisotropic Filtering", new Callable() + { + private static final String __OBFID = "CL_00001853"; + public String func_152388_a() + { + return Minecraft.this.gameSettings.anisotropicFiltering == 1 ? "Off (1)" : "On (" + Minecraft.this.gameSettings.anisotropicFiltering + ")"; + } + public Object call() + { + return this.func_152388_a(); + } + }); + + if (this.theWorld != null) + { + this.theWorld.addWorldInfoToCrashReport(theCrash); + } + + return theCrash; + } + + /** + * Return the singleton Minecraft instance for the game + */ + public static Minecraft getMinecraft() + { + return theMinecraft; + } + + public void scheduleResourcesRefresh() + { + this.refreshTexturePacksScheduled = true; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.func_152768_a("fps", Integer.valueOf(debugFPS)); + playerSnooper.func_152768_a("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); + playerSnooper.func_152768_a("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); + playerSnooper.func_152768_a("display_type", this.fullscreen ? "fullscreen" : "windowed"); + playerSnooper.func_152768_a("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L)); + playerSnooper.func_152768_a("resource_packs", Integer.valueOf(this.mcResourcePackRepository.getRepositoryEntries().size())); + int i = 0; + Iterator iterator = this.mcResourcePackRepository.getRepositoryEntries().iterator(); + + while (iterator.hasNext()) + { + ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next(); + playerSnooper.func_152768_a("resource_pack[" + i++ + "]", entry.getResourcePackName()); + } + + if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) + { + playerSnooper.func_152768_a("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); + } + } + + public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.func_152767_b("opengl_version", GL11.glGetString(GL11.GL_VERSION)); + playerSnooper.func_152767_b("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); + playerSnooper.func_152767_b("client_brand", ClientBrandRetriever.getClientModName()); + playerSnooper.func_152767_b("launched_version", this.launchedVersion); + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); + playerSnooper.func_152767_b("gl_caps[ARB_arrays_of_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_arrays_of_arrays)); + playerSnooper.func_152767_b("gl_caps[ARB_base_instance]", Boolean.valueOf(contextcapabilities.GL_ARB_base_instance)); + playerSnooper.func_152767_b("gl_caps[ARB_blend_func_extended]", Boolean.valueOf(contextcapabilities.GL_ARB_blend_func_extended)); + playerSnooper.func_152767_b("gl_caps[ARB_clear_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_clear_buffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_color_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_color_buffer_float)); + playerSnooper.func_152767_b("gl_caps[ARB_compatibility]", Boolean.valueOf(contextcapabilities.GL_ARB_compatibility)); + playerSnooper.func_152767_b("gl_caps[ARB_compressed_texture_pixel_storage]", Boolean.valueOf(contextcapabilities.GL_ARB_compressed_texture_pixel_storage)); + playerSnooper.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader)); + playerSnooper.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer)); + playerSnooper.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image)); + playerSnooper.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float)); + playerSnooper.func_152767_b("gl_caps[ARB_compute_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_compute_shader)); + playerSnooper.func_152767_b("gl_caps[ARB_copy_buffer]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_buffer)); + playerSnooper.func_152767_b("gl_caps[ARB_copy_image]", Boolean.valueOf(contextcapabilities.GL_ARB_copy_image)); + playerSnooper.func_152767_b("gl_caps[ARB_depth_buffer_float]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_buffer_float)); + playerSnooper.func_152767_b("gl_caps[ARB_depth_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_clamp)); + playerSnooper.func_152767_b("gl_caps[ARB_depth_texture]", Boolean.valueOf(contextcapabilities.GL_ARB_depth_texture)); + playerSnooper.func_152767_b("gl_caps[ARB_draw_buffers]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers)); + playerSnooper.func_152767_b("gl_caps[ARB_draw_buffers_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_buffers_blend)); + playerSnooper.func_152767_b("gl_caps[ARB_draw_elements_base_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_elements_base_vertex)); + playerSnooper.func_152767_b("gl_caps[ARB_draw_indirect]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_indirect)); + playerSnooper.func_152767_b("gl_caps[ARB_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_ARB_draw_instanced)); + playerSnooper.func_152767_b("gl_caps[ARB_explicit_attrib_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_attrib_location)); + playerSnooper.func_152767_b("gl_caps[ARB_explicit_uniform_location]", Boolean.valueOf(contextcapabilities.GL_ARB_explicit_uniform_location)); + playerSnooper.func_152767_b("gl_caps[ARB_fragment_layer_viewport]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_layer_viewport)); + playerSnooper.func_152767_b("gl_caps[ARB_fragment_program]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program)); + playerSnooper.func_152767_b("gl_caps[ARB_fragment_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_shader)); + playerSnooper.func_152767_b("gl_caps[ARB_fragment_program_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_fragment_program_shadow)); + playerSnooper.func_152767_b("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_ARB_framebuffer_sRGB)); + playerSnooper.func_152767_b("gl_caps[ARB_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_ARB_geometry_shader4)); + playerSnooper.func_152767_b("gl_caps[ARB_gpu_shader5]", Boolean.valueOf(contextcapabilities.GL_ARB_gpu_shader5)); + playerSnooper.func_152767_b("gl_caps[ARB_half_float_pixel]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_pixel)); + playerSnooper.func_152767_b("gl_caps[ARB_half_float_vertex]", Boolean.valueOf(contextcapabilities.GL_ARB_half_float_vertex)); + playerSnooper.func_152767_b("gl_caps[ARB_instanced_arrays]", Boolean.valueOf(contextcapabilities.GL_ARB_instanced_arrays)); + playerSnooper.func_152767_b("gl_caps[ARB_map_buffer_alignment]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_alignment)); + playerSnooper.func_152767_b("gl_caps[ARB_map_buffer_range]", Boolean.valueOf(contextcapabilities.GL_ARB_map_buffer_range)); + playerSnooper.func_152767_b("gl_caps[ARB_multisample]", Boolean.valueOf(contextcapabilities.GL_ARB_multisample)); + playerSnooper.func_152767_b("gl_caps[ARB_multitexture]", Boolean.valueOf(contextcapabilities.GL_ARB_multitexture)); + playerSnooper.func_152767_b("gl_caps[ARB_occlusion_query2]", Boolean.valueOf(contextcapabilities.GL_ARB_occlusion_query2)); + playerSnooper.func_152767_b("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_pixel_buffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_seamless_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_seamless_cube_map)); + playerSnooper.func_152767_b("gl_caps[ARB_shader_objects]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_objects)); + playerSnooper.func_152767_b("gl_caps[ARB_shader_stencil_export]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_stencil_export)); + playerSnooper.func_152767_b("gl_caps[ARB_shader_texture_lod]", Boolean.valueOf(contextcapabilities.GL_ARB_shader_texture_lod)); + playerSnooper.func_152767_b("gl_caps[ARB_shadow]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow)); + playerSnooper.func_152767_b("gl_caps[ARB_shadow_ambient]", Boolean.valueOf(contextcapabilities.GL_ARB_shadow_ambient)); + playerSnooper.func_152767_b("gl_caps[ARB_stencil_texturing]", Boolean.valueOf(contextcapabilities.GL_ARB_stencil_texturing)); + playerSnooper.func_152767_b("gl_caps[ARB_sync]", Boolean.valueOf(contextcapabilities.GL_ARB_sync)); + playerSnooper.func_152767_b("gl_caps[ARB_tessellation_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_tessellation_shader)); + playerSnooper.func_152767_b("gl_caps[ARB_texture_border_clamp]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_border_clamp)); + playerSnooper.func_152767_b("gl_caps[ARB_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_buffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map)); + playerSnooper.func_152767_b("gl_caps[ARB_texture_cube_map_array]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_cube_map_array)); + playerSnooper.func_152767_b("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(contextcapabilities.GL_ARB_texture_non_power_of_two)); + playerSnooper.func_152767_b("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_uniform_buffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_vertex_blend]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_blend)); + playerSnooper.func_152767_b("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_buffer_object)); + playerSnooper.func_152767_b("gl_caps[ARB_vertex_program]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_program)); + playerSnooper.func_152767_b("gl_caps[ARB_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_ARB_vertex_shader)); + playerSnooper.func_152767_b("gl_caps[EXT_bindable_uniform]", Boolean.valueOf(contextcapabilities.GL_EXT_bindable_uniform)); + playerSnooper.func_152767_b("gl_caps[EXT_blend_equation_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_equation_separate)); + playerSnooper.func_152767_b("gl_caps[EXT_blend_func_separate]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_func_separate)); + playerSnooper.func_152767_b("gl_caps[EXT_blend_minmax]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_minmax)); + playerSnooper.func_152767_b("gl_caps[EXT_blend_subtract]", Boolean.valueOf(contextcapabilities.GL_EXT_blend_subtract)); + playerSnooper.func_152767_b("gl_caps[EXT_draw_instanced]", Boolean.valueOf(contextcapabilities.GL_EXT_draw_instanced)); + playerSnooper.func_152767_b("gl_caps[EXT_framebuffer_multisample]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_multisample)); + playerSnooper.func_152767_b("gl_caps[EXT_framebuffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_object)); + playerSnooper.func_152767_b("gl_caps[EXT_framebuffer_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_framebuffer_sRGB)); + playerSnooper.func_152767_b("gl_caps[EXT_geometry_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_geometry_shader4)); + playerSnooper.func_152767_b("gl_caps[EXT_gpu_program_parameters]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_program_parameters)); + playerSnooper.func_152767_b("gl_caps[EXT_gpu_shader4]", Boolean.valueOf(contextcapabilities.GL_EXT_gpu_shader4)); + playerSnooper.func_152767_b("gl_caps[EXT_multi_draw_arrays]", Boolean.valueOf(contextcapabilities.GL_EXT_multi_draw_arrays)); + playerSnooper.func_152767_b("gl_caps[EXT_packed_depth_stencil]", Boolean.valueOf(contextcapabilities.GL_EXT_packed_depth_stencil)); + playerSnooper.func_152767_b("gl_caps[EXT_paletted_texture]", Boolean.valueOf(contextcapabilities.GL_EXT_paletted_texture)); + playerSnooper.func_152767_b("gl_caps[EXT_rescale_normal]", Boolean.valueOf(contextcapabilities.GL_EXT_rescale_normal)); + playerSnooper.func_152767_b("gl_caps[EXT_separate_shader_objects]", Boolean.valueOf(contextcapabilities.GL_EXT_separate_shader_objects)); + playerSnooper.func_152767_b("gl_caps[EXT_shader_image_load_store]", Boolean.valueOf(contextcapabilities.GL_EXT_shader_image_load_store)); + playerSnooper.func_152767_b("gl_caps[EXT_shadow_funcs]", Boolean.valueOf(contextcapabilities.GL_EXT_shadow_funcs)); + playerSnooper.func_152767_b("gl_caps[EXT_shared_texture_palette]", Boolean.valueOf(contextcapabilities.GL_EXT_shared_texture_palette)); + playerSnooper.func_152767_b("gl_caps[EXT_stencil_clear_tag]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_clear_tag)); + playerSnooper.func_152767_b("gl_caps[EXT_stencil_two_side]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_two_side)); + playerSnooper.func_152767_b("gl_caps[EXT_stencil_wrap]", Boolean.valueOf(contextcapabilities.GL_EXT_stencil_wrap)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_3d]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_3d)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_array]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_array)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_buffer_object]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_buffer_object)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_filter_anisotropic]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_filter_anisotropic)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_integer]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_integer)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_lod_bias]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_lod_bias)); + playerSnooper.func_152767_b("gl_caps[EXT_texture_sRGB]", Boolean.valueOf(contextcapabilities.GL_EXT_texture_sRGB)); + playerSnooper.func_152767_b("gl_caps[EXT_vertex_shader]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_shader)); + playerSnooper.func_152767_b("gl_caps[EXT_vertex_weighting]", Boolean.valueOf(contextcapabilities.GL_EXT_vertex_weighting)); + playerSnooper.func_152767_b("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_caps[gl_max_vertex_attribs]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_ATTRIBS))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_caps[gl_max_vertex_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_TEXTURE_IMAGE_UNITS))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_caps[gl_max_texture_image_units]", Integer.valueOf(GL11.glGetInteger(35071))); + GL11.glGetError(); + playerSnooper.func_152767_b("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); + } + + //Forge: Adds a optimization to the getGLMaximumTextureSize, only calculate it once. + private static int max_texture_size = -1; + /** + * Used in the usage snooper. + */ + public static int getGLMaximumTextureSize() + { + if (max_texture_size != -1) + { + return max_texture_size; + } + + for (int i = 16384; i > 0; i >>= 1) + { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); + int j = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); + + if (j != 0) + { + max_texture_size = i; + return i; + } + } + + return -1; + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() + { + return this.gameSettings.snooperEnabled; + } + + /** + * Set the current ServerData instance. + */ + public void setServerData(ServerData serverDataIn) + { + this.currentServerData = serverDataIn; + } + + public ServerData func_147104_D() + { + return this.currentServerData; + } + + public boolean isIntegratedServerRunning() + { + return this.integratedServerIsRunning; + } + + /** + * Returns true if there is only one player playing, and the current server is the integrated one. + */ + public boolean isSingleplayer() + { + return this.integratedServerIsRunning && this.theIntegratedServer != null; + } + + /** + * Returns the currently running integrated server + */ + public IntegratedServer getIntegratedServer() + { + return this.theIntegratedServer; + } + + public static void stopIntegratedServer() + { + if (theMinecraft != null) + { + IntegratedServer integratedserver = theMinecraft.getIntegratedServer(); + + if (integratedserver != null) + { + integratedserver.stopServer(); + } + } + } + + /** + * Returns the PlayerUsageSnooper instance. + */ + public PlayerUsageSnooper getPlayerUsageSnooper() + { + return this.usageSnooper; + } + + /** + * Gets the system time in milliseconds. + */ + public static long getSystemTime() + { + return Sys.getTime() * 1000L / Sys.getTimerResolution(); + } + + /** + * Returns whether we're in full screen or not. + */ + public boolean isFullScreen() + { + return this.fullscreen; + } + + public Session getSession() + { + return this.session; + } + + public Multimap func_152341_N() + { + return this.field_152356_J; + } + + public Proxy getProxy() + { + return this.proxy; + } + + public TextureManager getTextureManager() + { + return this.renderEngine; + } + + public IResourceManager getResourceManager() + { + return this.mcResourceManager; + } + + public ResourcePackRepository getResourcePackRepository() + { + return this.mcResourcePackRepository; + } + + public LanguageManager getLanguageManager() + { + return this.mcLanguageManager; + } + + public TextureMap getTextureMapBlocks() + { + return this.textureMapBlocks; + } + + public boolean isJava64bit() + { + return this.jvm64bit; + } + + public boolean isGamePaused() + { + return this.isGamePaused; + } + + public SoundHandler getSoundHandler() + { + return this.mcSoundHandler; + } + + public MusicTicker.MusicType func_147109_W() + { + return this.currentScreen instanceof GuiWinGame ? MusicTicker.MusicType.CREDITS : (this.thePlayer != null ? (this.thePlayer.worldObj.provider instanceof WorldProviderHell ? MusicTicker.MusicType.NETHER : (this.thePlayer.worldObj.provider instanceof WorldProviderEnd ? (BossStatus.bossName != null && BossStatus.statusBarTime > 0 ? MusicTicker.MusicType.END_BOSS : MusicTicker.MusicType.END) : (this.thePlayer.capabilities.isCreativeMode && this.thePlayer.capabilities.allowFlying ? MusicTicker.MusicType.CREATIVE : MusicTicker.MusicType.GAME))) : MusicTicker.MusicType.MENU); + } + + public IStream func_152346_Z() + { + return this.field_152353_at; + } + + public void func_152348_aa() + { + int i = Keyboard.getEventKey(); + + if (i != 0 && !Keyboard.isRepeatEvent()) + { + if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).field_152177_g <= getSystemTime() - 20L) + { + if (Keyboard.getEventKeyState()) + { + if (i == this.gameSettings.field_152396_an.getKeyCode()) + { + if (this.func_152346_Z().func_152934_n()) + { + this.func_152346_Z().func_152914_u(); + } + else if (this.func_152346_Z().func_152924_m()) + { + this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() + { + private static final String __OBFID = "CL_00001852"; + public void confirmClicked(boolean result, int id) + { + if (result) + { + Minecraft.this.func_152346_Z().func_152930_t(); + } + + Minecraft.this.displayGuiScreen((GuiScreen)null); + } + }, I18n.format("stream.confirm_start", new Object[0]), "", 0)); + } + else if (this.func_152346_Z().func_152928_D() && this.func_152346_Z().func_152936_l()) + { + if (this.theWorld != null) + { + this.ingameGUI.getChatGUI().printChatMessage(new ChatComponentText("Not ready to start streaming yet!")); + } + } + else + { + GuiStreamUnavailable.func_152321_a(this.currentScreen); + } + } + else if (i == this.gameSettings.field_152397_ao.getKeyCode()) + { + if (this.func_152346_Z().func_152934_n()) + { + if (this.func_152346_Z().func_152919_o()) + { + this.func_152346_Z().func_152933_r(); + } + else + { + this.func_152346_Z().func_152916_q(); + } + } + } + else if (i == this.gameSettings.field_152398_ap.getKeyCode()) + { + if (this.func_152346_Z().func_152934_n()) + { + this.func_152346_Z().func_152931_p(); + } + } + else if (i == this.gameSettings.field_152399_aq.getKeyCode()) + { + this.field_152353_at.func_152910_a(true); + } + else if (i == this.gameSettings.field_152395_am.getKeyCode()) + { + this.toggleFullscreen(); + } + else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) + { + this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc)); + } + } + else if (i == this.gameSettings.field_152399_aq.getKeyCode()) + { + this.field_152353_at.func_152910_a(false); + } + } + } + } + + public ListenableFuture func_152343_a(Callable callableToSchedule) + { + Validate.notNull(callableToSchedule); + + if (!this.func_152345_ab()) + { + ListenableFutureTask listenablefuturetask = ListenableFutureTask.create(callableToSchedule); + Queue queue = this.field_152351_aB; + + synchronized (this.field_152351_aB) + { + this.field_152351_aB.add(listenablefuturetask); + return listenablefuturetask; + } + } + else + { + try + { + return Futures.immediateFuture(callableToSchedule.call()); + } + catch (Exception exception) + { + return Futures.immediateFailedCheckedFuture(exception); + } + } + } + + public ListenableFuture func_152344_a(Runnable runnableToSchedule) + { + Validate.notNull(runnableToSchedule); + return this.func_152343_a(Executors.callable(runnableToSchedule)); + } + + public boolean func_152345_ab() + { + return Thread.currentThread() == this.field_152352_aC; + } + + public MinecraftSessionService func_152347_ac() + { + return this.field_152355_az; + } + + public SkinManager func_152342_ad() + { + return this.field_152350_aA; + } + + @SideOnly(Side.CLIENT) + + static final class SwitchMovingObjectType + { + static final int[] field_152390_a = new int[MovingObjectPosition.MovingObjectType.values().length]; + private static final String __OBFID = "CL_00000638"; + + static + { + try + { + field_152390_a[MovingObjectPosition.MovingObjectType.ENTITY.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_152390_a[MovingObjectPosition.MovingObjectType.BLOCK.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISound.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISound.java new file mode 100644 index 0000000..709d8c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISound.java @@ -0,0 +1,47 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public interface ISound +{ + ResourceLocation getPositionedSoundLocation(); + + boolean canRepeat(); + + int getRepeatDelay(); + + float getVolume(); + + float getPitch(); + + float getXPosF(); + + float getYPosF(); + + float getZPosF(); + + ISound.AttenuationType getAttenuationType(); + + @SideOnly(Side.CLIENT) + public static enum AttenuationType + { + NONE(0), + LINEAR(2); + private final int field_148589_c; + + private static final String __OBFID = "CL_00001126"; + + private AttenuationType(int p_i45110_3_) + { + this.field_148589_c = p_i45110_3_; + } + + public int getTypeInt() + { + return this.field_148589_c; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISoundEventAccessor.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISoundEventAccessor.java new file mode 100644 index 0000000..4d829e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ISoundEventAccessor.java @@ -0,0 +1,12 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface ISoundEventAccessor +{ + int func_148721_a(); + + Object func_148720_g(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/ITickableSound.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ITickableSound.java new file mode 100644 index 0000000..1b0ca41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/ITickableSound.java @@ -0,0 +1,11 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.server.gui.IUpdatePlayerListBox; + +@SideOnly(Side.CLIENT) +public interface ITickableSound extends ISound, IUpdatePlayerListBox +{ + boolean isDonePlaying(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSound.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSound.java new file mode 100644 index 0000000..cad5761 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSound.java @@ -0,0 +1,22 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public abstract class MovingSound extends PositionedSound implements ITickableSound +{ + protected boolean donePlaying = false; + private static final String __OBFID = "CL_00001117"; + + protected MovingSound(ResourceLocation p_i45104_1_) + { + super(p_i45104_1_); + } + + public boolean isDonePlaying() + { + return this.donePlaying; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecart.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecart.java new file mode 100644 index 0000000..33ddd4e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecart.java @@ -0,0 +1,52 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class MovingSoundMinecart extends MovingSound +{ + private final EntityMinecart field_147670_k; + private float field_147669_l = 0.0F; + private static final String __OBFID = "CL_00001118"; + + public MovingSoundMinecart(EntityMinecart p_i45105_1_) + { + super(new ResourceLocation("minecraft:minecart.base")); + this.field_147670_k = p_i45105_1_; + this.repeat = true; + this.field_147665_h = 0; + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + if (this.field_147670_k.isDead) + { + this.donePlaying = true; + } + else + { + this.xPosF = (float)this.field_147670_k.posX; + this.yPosF = (float)this.field_147670_k.posY; + this.zPosF = (float)this.field_147670_k.posZ; + float f = MathHelper.sqrt_double(this.field_147670_k.motionX * this.field_147670_k.motionX + this.field_147670_k.motionZ * this.field_147670_k.motionZ); + + if ((double)f >= 0.01D) + { + this.field_147669_l = MathHelper.clamp_float(this.field_147669_l + 0.0025F, 0.0F, 1.0F); + this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 0.5F) * 0.7F; + } + else + { + this.field_147669_l = 0.0F; + this.volume = 0.0F; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java new file mode 100644 index 0000000..0655808 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MovingSoundMinecartRiding.java @@ -0,0 +1,50 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class MovingSoundMinecartRiding extends MovingSound +{ + private final EntityPlayer field_147672_k; + private final EntityMinecart field_147671_l; + private static final String __OBFID = "CL_00001119"; + + public MovingSoundMinecartRiding(EntityPlayer p_i45106_1_, EntityMinecart p_i45106_2_) + { + super(new ResourceLocation("minecraft:minecart.inside")); + this.field_147672_k = p_i45106_1_; + this.field_147671_l = p_i45106_2_; + this.field_147666_i = ISound.AttenuationType.NONE; + this.repeat = true; + this.field_147665_h = 0; + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + if (!this.field_147671_l.isDead && this.field_147672_k.isRiding() && this.field_147672_k.ridingEntity == this.field_147671_l) + { + float f = MathHelper.sqrt_double(this.field_147671_l.motionX * this.field_147671_l.motionX + this.field_147671_l.motionZ * this.field_147671_l.motionZ); + + if ((double)f >= 0.01D) + { + this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 1.0F) * 0.75F; + } + else + { + this.volume = 0.0F; + } + } + else + { + this.donePlaying = true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/MusicTicker.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MusicTicker.java new file mode 100644 index 0000000..9ad0459 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/MusicTicker.java @@ -0,0 +1,93 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class MusicTicker implements IUpdatePlayerListBox +{ + private final Random field_147679_a = new Random(); + private final Minecraft field_147677_b; + private ISound field_147678_c; + private int field_147676_d = 100; + private static final String __OBFID = "CL_00001138"; + + public MusicTicker(Minecraft p_i45112_1_) + { + this.field_147677_b = p_i45112_1_; + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + MusicTicker.MusicType musictype = this.field_147677_b.func_147109_W(); + + if (this.field_147678_c != null) + { + if (!musictype.getMusicTickerLocation().equals(this.field_147678_c.getPositionedSoundLocation())) + { + this.field_147677_b.getSoundHandler().stopSound(this.field_147678_c); + this.field_147676_d = MathHelper.getRandomIntegerInRange(this.field_147679_a, 0, musictype.func_148634_b() / 2); + } + + if (!this.field_147677_b.getSoundHandler().isSoundPlaying(this.field_147678_c)) + { + this.field_147678_c = null; + this.field_147676_d = Math.min(MathHelper.getRandomIntegerInRange(this.field_147679_a, musictype.func_148634_b(), musictype.func_148633_c()), this.field_147676_d); + } + } + + if (this.field_147678_c == null && this.field_147676_d-- <= 0) + { + this.field_147678_c = PositionedSoundRecord.func_147673_a(musictype.getMusicTickerLocation()); + this.field_147677_b.getSoundHandler().playSound(this.field_147678_c); + this.field_147676_d = Integer.MAX_VALUE; + } + } + + @SideOnly(Side.CLIENT) + public static enum MusicType + { + MENU(new ResourceLocation("minecraft:music.menu"), 20, 600), + GAME(new ResourceLocation("minecraft:music.game"), 12000, 24000), + CREATIVE(new ResourceLocation("minecraft:music.game.creative"), 1200, 3600), + CREDITS(new ResourceLocation("minecraft:music.game.end.credits"), Integer.MAX_VALUE, Integer.MAX_VALUE), + NETHER(new ResourceLocation("minecraft:music.game.nether"), 1200, 3600), + END_BOSS(new ResourceLocation("minecraft:music.game.end.dragon"), 0, 0), + END(new ResourceLocation("minecraft:music.game.end"), 6000, 24000); + private final ResourceLocation field_148645_h; + private final int field_148646_i; + private final int field_148643_j; + + private static final String __OBFID = "CL_00001139"; + + private MusicType(ResourceLocation p_i45111_3_, int p_i45111_4_, int p_i45111_5_) + { + this.field_148645_h = p_i45111_3_; + this.field_148646_i = p_i45111_4_; + this.field_148643_j = p_i45111_5_; + } + + public ResourceLocation getMusicTickerLocation() + { + return this.field_148645_h; + } + + public int func_148634_b() + { + return this.field_148646_i; + } + + public int func_148633_c() + { + return this.field_148643_j; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSound.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSound.java new file mode 100644 index 0000000..a8368ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSound.java @@ -0,0 +1,71 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public abstract class PositionedSound implements ISound +{ + protected final ResourceLocation field_147664_a; + protected float volume = 1.0F; + protected float field_147663_c = 1.0F; + protected float xPosF; + protected float yPosF; + protected float zPosF; + protected boolean repeat = false; + protected int field_147665_h = 0; + protected ISound.AttenuationType field_147666_i; + private static final String __OBFID = "CL_00001116"; + + protected PositionedSound(ResourceLocation soundResource) + { + this.field_147666_i = ISound.AttenuationType.LINEAR; + this.field_147664_a = soundResource; + } + + public ResourceLocation getPositionedSoundLocation() + { + return this.field_147664_a; + } + + public boolean canRepeat() + { + return this.repeat; + } + + public int getRepeatDelay() + { + return this.field_147665_h; + } + + public float getVolume() + { + return this.volume; + } + + public float getPitch() + { + return this.field_147663_c; + } + + public float getXPosF() + { + return this.xPosF; + } + + public float getYPosF() + { + return this.yPosF; + } + + public float getZPosF() + { + return this.zPosF; + } + + public ISound.AttenuationType getAttenuationType() + { + return this.field_147666_i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSoundRecord.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSoundRecord.java new file mode 100644 index 0000000..74a3508 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/PositionedSoundRecord.java @@ -0,0 +1,44 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class PositionedSoundRecord extends PositionedSound +{ + private static final String __OBFID = "CL_00001120"; + + public static PositionedSoundRecord func_147674_a(ResourceLocation soundResource, float pitch) + { + return new PositionedSoundRecord(soundResource, 0.25F, pitch, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord func_147673_a(ResourceLocation soundResource) + { + return new PositionedSoundRecord(soundResource, 1.0F, 1.0F, false, 0, ISound.AttenuationType.NONE, 0.0F, 0.0F, 0.0F); + } + + public static PositionedSoundRecord func_147675_a(ResourceLocation soundResource, float xPosition, float yPosition, float zPosition) + { + return new PositionedSoundRecord(soundResource, 4.0F, 1.0F, false, 0, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition); + } + + public PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, float xPosition, float yPosition, float zPosition) + { + this(soundResource, volume, pitch, false, 0, ISound.AttenuationType.LINEAR, xPosition, yPosition, zPosition); + } + + private PositionedSoundRecord(ResourceLocation soundResource, float volume, float pitch, boolean repeat, int repeatDelay, ISound.AttenuationType attenuationType, float xPosition, float yPosition, float zPosition) + { + super(soundResource); + this.volume = volume; + this.field_147663_c = pitch; + this.xPosF = xPosition; + this.yPosF = yPosition; + this.zPosF = zPosition; + this.repeat = repeat; + this.field_147665_h = repeatDelay; + this.field_147666_i = attenuationType; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundCategory.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundCategory.java new file mode 100644 index 0000000..df469d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundCategory.java @@ -0,0 +1,66 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; + +@SideOnly(Side.CLIENT) +public enum SoundCategory +{ + MASTER("master", 0), + MUSIC("music", 1), + RECORDS("record", 2), + WEATHER("weather", 3), + BLOCKS("block", 4), + MOBS("hostile", 5), + ANIMALS("neutral", 6), + PLAYERS("player", 7), + AMBIENT("ambient", 8); + private static final Map field_147168_j = Maps.newHashMap(); + private static final Map field_147169_k = Maps.newHashMap(); + private final String categoryName; + private final int categoryId; + + private static final String __OBFID = "CL_00001686"; + + private SoundCategory(String p_i45126_3_, int p_i45126_4_) + { + this.categoryName = p_i45126_3_; + this.categoryId = p_i45126_4_; + } + + public String getCategoryName() + { + return this.categoryName; + } + + public int getCategoryId() + { + return this.categoryId; + } + + public static SoundCategory func_147154_a(String p_147154_0_) + { + return (SoundCategory)field_147168_j.get(p_147154_0_); + } + + static + { + SoundCategory[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + SoundCategory var3 = var0[var2]; + + if (field_147168_j.containsKey(var3.getCategoryName()) || field_147169_k.containsKey(Integer.valueOf(var3.getCategoryId()))) + { + throw new Error("Clash in Sound Category ID & Name pools! Cannot insert " + var3); + } + + field_147168_j.put(var3.getCategoryName(), var3); + field_147169_k.put(Integer.valueOf(var3.getCategoryId()), var3); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessor.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessor.java new file mode 100644 index 0000000..bc54361 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessor.java @@ -0,0 +1,28 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class SoundEventAccessor implements ISoundEventAccessor +{ + private final SoundPoolEntry field_148739_a; + private final int field_148738_b; + private static final String __OBFID = "CL_00001153"; + + SoundEventAccessor(SoundPoolEntry p_i45123_1_, int p_i45123_2_) + { + this.field_148739_a = p_i45123_1_; + this.field_148738_b = p_i45123_2_; + } + + public int func_148721_a() + { + return this.field_148738_b; + } + + public SoundPoolEntry func_148720_g() + { + return new SoundPoolEntry(this.field_148739_a); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessorComposite.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessorComposite.java new file mode 100644 index 0000000..b521853 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundEventAccessorComposite.java @@ -0,0 +1,91 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class SoundEventAccessorComposite implements ISoundEventAccessor +{ + /** A composite (List) of ISoundEventAccessors */ + private final List soundPool = Lists.newArrayList(); + private final Random rnd = new Random(); + private final ResourceLocation field_148735_c; + private final SoundCategory field_148732_d; + private double eventPitch; + private double eventVolume; + private static final String __OBFID = "CL_00001146"; + + public SoundEventAccessorComposite(ResourceLocation p_i45120_1_, double p_i45120_2_, double p_i45120_4_, SoundCategory p_i45120_6_) + { + this.field_148735_c = p_i45120_1_; + this.eventVolume = p_i45120_4_; + this.eventPitch = p_i45120_2_; + this.field_148732_d = p_i45120_6_; + } + + public int func_148721_a() + { + int i = 0; + ISoundEventAccessor isoundeventaccessor; + + for (Iterator iterator = this.soundPool.iterator(); iterator.hasNext(); i += isoundeventaccessor.func_148721_a()) + { + isoundeventaccessor = (ISoundEventAccessor)iterator.next(); + } + + return i; + } + + public SoundPoolEntry func_148720_g() + { + int i = this.func_148721_a(); + + if (!this.soundPool.isEmpty() && i != 0) + { + int j = this.rnd.nextInt(i); + Iterator iterator = this.soundPool.iterator(); + ISoundEventAccessor isoundeventaccessor; + + do + { + if (!iterator.hasNext()) + { + return SoundHandler.missing_sound; + } + + isoundeventaccessor = (ISoundEventAccessor)iterator.next(); + j -= isoundeventaccessor.func_148721_a(); + } + while (j >= 0); + + SoundPoolEntry soundpoolentry = (SoundPoolEntry)isoundeventaccessor.func_148720_g(); + soundpoolentry.setPitch(soundpoolentry.getPitch() * this.eventPitch); + soundpoolentry.setVolume(soundpoolentry.getVolume() * this.eventVolume); + return soundpoolentry; + } + else + { + return SoundHandler.missing_sound; + } + } + + public void addSoundToEventPool(ISoundEventAccessor p_148727_1_) + { + this.soundPool.add(p_148727_1_); + } + + public ResourceLocation getSoundEventLocation() + { + return this.field_148735_c; + } + + public SoundCategory getSoundCategory() + { + return this.field_148732_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundHandler.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundHandler.java new file mode 100644 index 0000000..e16a879 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundHandler.java @@ -0,0 +1,309 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class SoundHandler implements IResourceManagerReloadListener, IUpdatePlayerListBox +{ + private static final Logger logger = LogManager.getLogger(); + private static final Gson field_147699_c = (new GsonBuilder()).registerTypeAdapter(SoundList.class, new SoundListSerializer()).create(); + private static final ParameterizedType field_147696_d = new ParameterizedType() + { + private static final String __OBFID = "CL_00001148"; + public Type[] getActualTypeArguments() + { + return new Type[] {String.class, SoundList.class}; + } + public Type getRawType() + { + return Map.class; + } + public Type getOwnerType() + { + return null; + } + }; + public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"), 0.0D, 0.0D, false); + private final SoundRegistry sndRegistry = new SoundRegistry(); + private final SoundManager sndManager; + private final IResourceManager mcResourceManager; + private static final String __OBFID = "CL_00001147"; + + public SoundHandler(IResourceManager p_i45122_1_, GameSettings p_i45122_2_) + { + this.mcResourceManager = p_i45122_1_; + this.sndManager = new SoundManager(this, p_i45122_2_); + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + this.sndManager.reloadSoundSystem(); + this.sndRegistry.func_148763_c(); + Iterator iterator = p_110549_1_.getResourceDomains().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + try + { + List list = p_110549_1_.getAllResources(new ResourceLocation(s, "sounds.json")); + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + IResource iresource = (IResource)iterator1.next(); + + try + { + Map map = (Map)field_147699_c.fromJson(new InputStreamReader(iresource.getInputStream()), field_147696_d); + Iterator iterator2 = map.entrySet().iterator(); + + while (iterator2.hasNext()) + { + Entry entry = (Entry)iterator2.next(); + this.loadSoundResource(new ResourceLocation(s, (String)entry.getKey()), (SoundList)entry.getValue()); + } + } + catch (RuntimeException runtimeexception) + { + logger.warn("Invalid sounds.json", runtimeexception); + } + } + } + catch (IOException ioexception) + { + ; + } + } + } + + private void loadSoundResource(ResourceLocation p_147693_1_, SoundList p_147693_2_) + { + SoundEventAccessorComposite soundeventaccessorcomposite; + + if (this.sndRegistry.containsKey(p_147693_1_) && !p_147693_2_.canReplaceExisting()) + { + soundeventaccessorcomposite = (SoundEventAccessorComposite)this.sndRegistry.getObject(p_147693_1_); + } + else + { + logger.debug("Registered/replaced new sound event location {}", new Object[] {p_147693_1_}); + soundeventaccessorcomposite = new SoundEventAccessorComposite(p_147693_1_, 1.0D, 1.0D, p_147693_2_.getSoundCategory()); + this.sndRegistry.registerSound(soundeventaccessorcomposite); + } + + Iterator iterator = p_147693_2_.getSoundList().iterator(); + + while (iterator.hasNext()) + { + final SoundList.SoundEntry soundentry = (SoundList.SoundEntry)iterator.next(); + String s = soundentry.getSoundEntryName(); + ResourceLocation resourcelocation1 = new ResourceLocation(s); + final String s1 = s.contains(":") ? resourcelocation1.getResourceDomain() : p_147693_1_.getResourceDomain(); + Object object; + + switch (SoundHandler.SwitchType.field_148765_a[soundentry.getSoundEntryType().ordinal()]) + { + case 1: + ResourceLocation resourcelocation2 = new ResourceLocation(s1, "sounds/" + resourcelocation1.getResourcePath() + ".ogg"); + + try + { + this.mcResourceManager.getResource(resourcelocation2); + } + catch (FileNotFoundException filenotfoundexception) + { + logger.warn("File {} does not exist, cannot add it to event {}", new Object[] {resourcelocation2, p_147693_1_}); + continue; + } + catch (IOException ioexception) + { + logger.warn("Could not load sound file " + resourcelocation2 + ", cannot add it to event " + p_147693_1_, ioexception); + continue; + } + + object = new SoundEventAccessor(new SoundPoolEntry(resourcelocation2, (double)soundentry.getSoundEntryPitch(), (double)soundentry.getSoundEntryVolume(), soundentry.isStreaming()), soundentry.getSoundEntryWeight()); + break; + case 2: + object = new ISoundEventAccessor() + { + final ResourceLocation field_148726_a = new ResourceLocation(s1, soundentry.getSoundEntryName()); + private static final String __OBFID = "CL_00001149"; + public int func_148721_a() + { + SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a); + return soundeventaccessorcomposite1 == null ? 0 : soundeventaccessorcomposite1.func_148721_a(); + } + public SoundPoolEntry func_148720_g() + { + SoundEventAccessorComposite soundeventaccessorcomposite1 = (SoundEventAccessorComposite)SoundHandler.this.sndRegistry.getObject(this.field_148726_a); + return soundeventaccessorcomposite1 == null ? SoundHandler.missing_sound : soundeventaccessorcomposite1.func_148720_g(); + } + }; + break; + default: + throw new IllegalStateException("IN YOU FACE"); + } + + soundeventaccessorcomposite.addSoundToEventPool((ISoundEventAccessor)object); + } + } + + public SoundEventAccessorComposite getSound(ResourceLocation p_147680_1_) + { + return (SoundEventAccessorComposite)this.sndRegistry.getObject(p_147680_1_); + } + + /** + * Play a sound + */ + public void playSound(ISound p_147682_1_) + { + this.sndManager.playSound(p_147682_1_); + } + + /** + * Plays the sound in n ticks + */ + public void playDelayedSound(ISound p_147681_1_, int p_147681_2_) + { + this.sndManager.addDelayedSound(p_147681_1_, p_147681_2_); + } + + public void setListener(EntityPlayer p_147691_1_, float p_147691_2_) + { + this.sndManager.setListener(p_147691_1_, p_147691_2_); + } + + public void pauseSounds() + { + this.sndManager.pauseAllSounds(); + } + + public void stopSounds() + { + this.sndManager.stopAllSounds(); + } + + public void unloadSounds() + { + this.sndManager.unloadSoundSystem(); + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + this.sndManager.updateAllSounds(); + } + + public void resumeSounds() + { + this.sndManager.resumeAllSounds(); + } + + public void setSoundLevel(SoundCategory p_147684_1_, float p_147684_2_) + { + if (p_147684_1_ == SoundCategory.MASTER && p_147684_2_ <= 0.0F) + { + this.stopSounds(); + } + + this.sndManager.setSoundCategoryVolume(p_147684_1_, p_147684_2_); + } + + public void stopSound(ISound p_147683_1_) + { + this.sndManager.stopSound(p_147683_1_); + } + + /** + * Returns a random sound from one or more categories + */ + public SoundEventAccessorComposite getRandomSoundFromCategories(SoundCategory ... p_147686_1_) + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.sndRegistry.getKeys().iterator(); + + while (iterator.hasNext()) + { + ResourceLocation resourcelocation = (ResourceLocation)iterator.next(); + SoundEventAccessorComposite soundeventaccessorcomposite = (SoundEventAccessorComposite)this.sndRegistry.getObject(resourcelocation); + + if (ArrayUtils.contains(p_147686_1_, soundeventaccessorcomposite.getSoundCategory())) + { + arraylist.add(soundeventaccessorcomposite); + } + } + + if (arraylist.isEmpty()) + { + return null; + } + else + { + return (SoundEventAccessorComposite)arraylist.get((new Random()).nextInt(arraylist.size())); + } + } + + public boolean isSoundPlaying(ISound p_147692_1_) + { + return this.sndManager.isSoundPlaying(p_147692_1_); + } + + @SideOnly(Side.CLIENT) + + static final class SwitchType + { + static final int[] field_148765_a = new int[SoundList.SoundEntry.Type.values().length]; + private static final String __OBFID = "CL_00001150"; + + static + { + try + { + field_148765_a[SoundList.SoundEntry.Type.FILE.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_148765_a[SoundList.SoundEntry.Type.SOUND_EVENT.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundList.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundList.java new file mode 100644 index 0000000..5a8578b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundList.java @@ -0,0 +1,152 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; + +@SideOnly(Side.CLIENT) +public class SoundList +{ + private final List field_148577_a = Lists.newArrayList(); + /** if true it will override all the sounds from the resourcepacks loaded before */ + private boolean replaceExisting; + private SoundCategory field_148576_c; + private static final String __OBFID = "CL_00001121"; + + public List getSoundList() + { + return this.field_148577_a; + } + + public boolean canReplaceExisting() + { + return this.replaceExisting; + } + + public void setReplaceExisting(boolean p_148572_1_) + { + this.replaceExisting = p_148572_1_; + } + + public SoundCategory getSoundCategory() + { + return this.field_148576_c; + } + + public void setSoundCategory(SoundCategory p_148571_1_) + { + this.field_148576_c = p_148571_1_; + } + + @SideOnly(Side.CLIENT) + public static class SoundEntry + { + private String field_148569_a; + private float field_148567_b = 1.0F; + private float field_148568_c = 1.0F; + private int field_148565_d = 1; + private SoundList.SoundEntry.Type field_148566_e; + private boolean field_148564_f; + private static final String __OBFID = "CL_00001122"; + + public SoundEntry() + { + this.field_148566_e = SoundList.SoundEntry.Type.FILE; + this.field_148564_f = false; + } + + public String getSoundEntryName() + { + return this.field_148569_a; + } + + public void setSoundEntryName(String p_148561_1_) + { + this.field_148569_a = p_148561_1_; + } + + public float getSoundEntryVolume() + { + return this.field_148567_b; + } + + public void setSoundEntryVolume(float p_148553_1_) + { + this.field_148567_b = p_148553_1_; + } + + public float getSoundEntryPitch() + { + return this.field_148568_c; + } + + public void setSoundEntryPitch(float p_148559_1_) + { + this.field_148568_c = p_148559_1_; + } + + public int getSoundEntryWeight() + { + return this.field_148565_d; + } + + public void setSoundEntryWeight(int p_148554_1_) + { + this.field_148565_d = p_148554_1_; + } + + public SoundList.SoundEntry.Type getSoundEntryType() + { + return this.field_148566_e; + } + + public void setSoundEntryType(SoundList.SoundEntry.Type p_148562_1_) + { + this.field_148566_e = p_148562_1_; + } + + public boolean isStreaming() + { + return this.field_148564_f; + } + + public void setStreaming(boolean p_148557_1_) + { + this.field_148564_f = p_148557_1_; + } + + @SideOnly(Side.CLIENT) + public static enum Type + { + FILE("file"), + SOUND_EVENT("event"); + private final String field_148583_c; + + private static final String __OBFID = "CL_00001123"; + + private Type(String p_i45109_3_) + { + this.field_148583_c = p_i45109_3_; + } + + public static SoundList.SoundEntry.Type getType(String p_148580_0_) + { + SoundList.SoundEntry.Type[] atype = values(); + int i = atype.length; + + for (int j = 0; j < i; ++j) + { + SoundList.SoundEntry.Type type = atype[j]; + + if (type.field_148583_c.equals(p_148580_0_)) + { + return type; + } + } + + return null; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundListSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundListSerializer.java new file mode 100644 index 0000000..fc99056 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundListSerializer.java @@ -0,0 +1,88 @@ +package net.minecraft.client.audio; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +@SideOnly(Side.CLIENT) +public class SoundListSerializer implements JsonDeserializer +{ + private static final String __OBFID = "CL_00001124"; + + public SoundList deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "entry"); + SoundList soundlist = new SoundList(); + soundlist.setReplaceExisting(JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject, "replace", false)); + SoundCategory soundcategory = SoundCategory.func_147154_a(JsonUtils.getJsonObjectStringFieldValueOrDefault(jsonobject, "category", SoundCategory.MASTER.getCategoryName())); + soundlist.setSoundCategory(soundcategory); + Validate.notNull(soundcategory, "Invalid category", new Object[0]); + + if (jsonobject.has("sounds")) + { + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "sounds"); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonElement jsonelement1 = jsonarray.get(i); + SoundList.SoundEntry soundentry = new SoundList.SoundEntry(); + + if (JsonUtils.jsonElementTypeIsString(jsonelement1)) + { + soundentry.setSoundEntryName(JsonUtils.getJsonElementStringValue(jsonelement1, "sound")); + } + else + { + JsonObject jsonobject1 = JsonUtils.getJsonElementAsJsonObject(jsonelement1, "sound"); + soundentry.setSoundEntryName(JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "name")); + + if (jsonobject1.has("type")) + { + SoundList.SoundEntry.Type type1 = SoundList.SoundEntry.Type.getType(JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "type")); + Validate.notNull(type1, "Invalid type", new Object[0]); + soundentry.setSoundEntryType(type1); + } + + float f; + + if (jsonobject1.has("volume")) + { + f = JsonUtils.getJsonObjectFloatFieldValue(jsonobject1, "volume"); + Validate.isTrue(f > 0.0F, "Invalid volume", new Object[0]); + soundentry.setSoundEntryVolume(f); + } + + if (jsonobject1.has("pitch")) + { + f = JsonUtils.getJsonObjectFloatFieldValue(jsonobject1, "pitch"); + Validate.isTrue(f > 0.0F, "Invalid pitch", new Object[0]); + soundentry.setSoundEntryPitch(f); + } + + if (jsonobject1.has("weight")) + { + int j = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject1, "weight"); + Validate.isTrue(j > 0, "Invalid weight", new Object[0]); + soundentry.setSoundEntryWeight(j); + } + + if (jsonobject1.has("stream")) + { + soundentry.setStreaming(JsonUtils.getJsonObjectBooleanFieldValue(jsonobject1, "stream")); + } + } + + soundlist.getSoundList().add(soundentry); + } + } + + return soundlist; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundManager.java new file mode 100644 index 0000000..9031311 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundManager.java @@ -0,0 +1,558 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLStreamHandler; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import paulscode.sound.SoundSystem; +import paulscode.sound.SoundSystemConfig; +import paulscode.sound.SoundSystemException; +import paulscode.sound.Source; +import paulscode.sound.codecs.CodecJOrbis; +import paulscode.sound.libraries.LibraryLWJGLOpenAL; + +import net.minecraftforge.client.*; +import net.minecraftforge.client.event.sound.*; +import net.minecraftforge.common.MinecraftForge; + +@SideOnly(Side.CLIENT) +public class SoundManager +{ + private static final Marker field_148623_a = MarkerManager.getMarker("SOUNDS"); + private static final Logger logger = LogManager.getLogger(); + /** A reference to the sound handler. */ + public final SoundHandler sndHandler; + /** Reference to the GameSettings object. */ + private final GameSettings options; + /** A reference to the sound system. */ + private SoundManager.SoundSystemStarterThread sndSystem; + /** Set to true when the SoundManager has been initialised. */ + private boolean loaded; + /** A counter for how long the sound manager has been running */ + private int playTime = 0; + /** Identifiers of all currently playing sounds. Type: HashBiMap */ + private final Map playingSounds = HashBiMap.create(); + /** Inverse map of currently playing sounds, automatically mirroring changes in original map */ + private final Map invPlayingSounds; + /** A HashMap of the playing sounds. */ + private Map playingSoundPoolEntries; + /** Contains sounds mapped by category. Type: Multimap */ + private final Multimap categorySounds; + /** A subset of playingSounds, this contains only ITickableSounds */ + private final List tickableSounds; + /** Contains sounds to play in n ticks. Type: HashMap */ + private final Map delayedSounds; + /** The future time in which to stop this sound. Type: HashMap */ + private final Map playingSoundsStopTime; + private static final String __OBFID = "CL_00001141"; + + public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_) + { + this.invPlayingSounds = ((BiMap)this.playingSounds).inverse(); + this.playingSoundPoolEntries = Maps.newHashMap(); + this.categorySounds = HashMultimap.create(); + this.tickableSounds = Lists.newArrayList(); + this.delayedSounds = Maps.newHashMap(); + this.playingSoundsStopTime = Maps.newHashMap(); + this.sndHandler = p_i45119_1_; + this.options = p_i45119_2_; + + try + { + SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); + SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); + MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this)); + } + catch (SoundSystemException soundsystemexception) + { + logger.error(field_148623_a, "Error linking with the LibraryJavaSound plug-in", soundsystemexception); + } + } + + public void reloadSoundSystem() + { + this.unloadSoundSystem(); + this.loadSoundSystem(); + MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this)); + } + + /** + * Tries to add the paulscode library and the relevant codecs. If it fails, the master volume will be set to zero. + */ + private synchronized void loadSoundSystem() + { + if (!this.loaded) + { + try + { + (new Thread(new Runnable() + { + private static final String __OBFID = "CL_00001142"; + public void run() + { + SoundManager.this.sndSystem = SoundManager.this.new SoundSystemStarterThread(null); + SoundManager.this.loaded = true; + SoundManager.this.sndSystem.setMasterVolume(SoundManager.this.options.getSoundLevel(SoundCategory.MASTER)); + SoundManager.logger.info(SoundManager.field_148623_a, "Sound engine started"); + } + }, "Sound Library Loader")).start(); + } + catch (RuntimeException runtimeexception) + { + logger.error(field_148623_a, "Error starting SoundSystem. Turning off sounds & music", runtimeexception); + this.options.setSoundLevel(SoundCategory.MASTER, 0.0F); + this.options.saveOptions(); + } + } + } + + /** + * Returns the sound level (between 0.0 and 1.0) for a category, but 1.0 for the master sound category + */ + private float getSoundCategoryVolume(SoundCategory p_148595_1_) + { + return p_148595_1_ != null && p_148595_1_ != SoundCategory.MASTER ? this.options.getSoundLevel(p_148595_1_) : 1.0F; + } + + /** + * Adjusts volume for currently playing sounds in this category + */ + public void setSoundCategoryVolume(SoundCategory p_148601_1_, float p_148601_2_) + { + if (this.loaded) + { + if (p_148601_1_ == SoundCategory.MASTER) + { + this.sndSystem.setMasterVolume(p_148601_2_); + } + else + { + Iterator iterator = this.categorySounds.get(p_148601_1_).iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + ISound isound = (ISound)this.playingSounds.get(s); + float f1 = this.getNormalizedVolume(isound, (SoundPoolEntry)this.playingSoundPoolEntries.get(isound), p_148601_1_); + + if (f1 <= 0.0F) + { + this.stopSound(isound); + } + else + { + this.sndSystem.setVolume(s, f1); + } + } + } + } + } + + /** + * Cleans up the Sound System + */ + public void unloadSoundSystem() + { + if (this.loaded) + { + this.stopAllSounds(); + this.sndSystem.cleanup(); + this.loaded = false; + } + } + + /** + * Stops all currently playing sounds + */ + public void stopAllSounds() + { + if (this.loaded) + { + Iterator iterator = this.playingSounds.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + this.sndSystem.stop(s); + } + + this.playingSounds.clear(); + this.delayedSounds.clear(); + this.tickableSounds.clear(); + this.categorySounds.clear(); + this.playingSoundPoolEntries.clear(); + this.playingSoundsStopTime.clear(); + } + } + + public void updateAllSounds() + { + ++this.playTime; + Iterator iterator = this.tickableSounds.iterator(); + String s; + + while (iterator.hasNext()) + { + ITickableSound itickablesound = (ITickableSound)iterator.next(); + itickablesound.update(); + + if (itickablesound.isDonePlaying()) + { + this.stopSound(itickablesound); + } + else + { + s = (String)this.invPlayingSounds.get(itickablesound); + this.sndSystem.setVolume(s, this.getNormalizedVolume(itickablesound, (SoundPoolEntry)this.playingSoundPoolEntries.get(itickablesound), this.sndHandler.getSound(itickablesound.getPositionedSoundLocation()).getSoundCategory())); + this.sndSystem.setPitch(s, this.getNormalizedPitch(itickablesound, (SoundPoolEntry)this.playingSoundPoolEntries.get(itickablesound))); + this.sndSystem.setPosition(s, itickablesound.getXPosF(), itickablesound.getYPosF(), itickablesound.getZPosF()); + } + } + + iterator = this.playingSounds.entrySet().iterator(); + ISound isound; + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + s = (String)entry.getKey(); + isound = (ISound)entry.getValue(); + + if (!this.sndSystem.playing(s)) + { + int i = ((Integer)this.playingSoundsStopTime.get(s)).intValue(); + + if (i <= this.playTime) + { + int j = isound.getRepeatDelay(); + + if (isound.canRepeat() && j > 0) + { + this.delayedSounds.put(isound, Integer.valueOf(this.playTime + j)); + } + + iterator.remove(); + logger.debug(field_148623_a, "Removed channel {} because it\'s not playing anymore", new Object[] {s}); + this.sndSystem.removeSource(s); + this.playingSoundsStopTime.remove(s); + this.playingSoundPoolEntries.remove(isound); + + try + { + this.categorySounds.remove(this.sndHandler.getSound(isound.getPositionedSoundLocation()).getSoundCategory(), s); + } + catch (RuntimeException runtimeexception) + { + ; + } + + if (isound instanceof ITickableSound) + { + this.tickableSounds.remove(isound); + } + } + } + } + + Iterator iterator1 = this.delayedSounds.entrySet().iterator(); + + while (iterator1.hasNext()) + { + Entry entry1 = (Entry)iterator1.next(); + + if (this.playTime >= ((Integer)entry1.getValue()).intValue()) + { + isound = (ISound)entry1.getKey(); + + if (isound instanceof ITickableSound) + { + ((ITickableSound)isound).update(); + } + + this.playSound(isound); + iterator1.remove(); + } + } + } + + /** + * Returns true if the sound is playing or still within time + */ + public boolean isSoundPlaying(ISound p_148597_1_) + { + if (!this.loaded) + { + return false; + } + else + { + String s = (String)this.invPlayingSounds.get(p_148597_1_); + return s == null ? false : this.sndSystem.playing(s) || this.playingSoundsStopTime.containsKey(s) && ((Integer)this.playingSoundsStopTime.get(s)).intValue() <= this.playTime; + } + } + + public void stopSound(ISound p_148602_1_) + { + if (this.loaded) + { + String s = (String)this.invPlayingSounds.get(p_148602_1_); + + if (s != null) + { + this.sndSystem.stop(s); + } + } + } + + public void playSound(ISound p_148611_1_) + { + if (this.loaded) + { + if (this.sndSystem.getMasterVolume() <= 0.0F) + { + logger.debug(field_148623_a, "Skipped playing soundEvent: {}, master volume was zero", new Object[] {p_148611_1_.getPositionedSoundLocation()}); + } + else + { + p_148611_1_ = ForgeHooksClient.playSound(this, p_148611_1_); + if (p_148611_1_ == null) return; + + SoundEventAccessorComposite soundeventaccessorcomposite = this.sndHandler.getSound(p_148611_1_.getPositionedSoundLocation()); + + if (soundeventaccessorcomposite == null) + { + logger.warn(field_148623_a, "Unable to play unknown soundEvent: {}", new Object[] {p_148611_1_.getPositionedSoundLocation()}); + } + else + { + SoundPoolEntry soundpoolentry = soundeventaccessorcomposite.func_148720_g(); + + if (soundpoolentry == SoundHandler.missing_sound) + { + logger.warn(field_148623_a, "Unable to play empty soundEvent: {}", new Object[] {soundeventaccessorcomposite.getSoundEventLocation()}); + } + else + { + float f = p_148611_1_.getVolume(); + float f1 = 16.0F; + + if (f > 1.0F) + { + f1 *= f; + } + + SoundCategory soundcategory = soundeventaccessorcomposite.getSoundCategory(); + float f2 = this.getNormalizedVolume(p_148611_1_, soundpoolentry, soundcategory); + double d0 = (double)this.getNormalizedPitch(p_148611_1_, soundpoolentry); + ResourceLocation resourcelocation = soundpoolentry.getSoundPoolEntryLocation(); + + if (f2 == 0.0F) + { + logger.debug(field_148623_a, "Skipped playing sound {}, volume was zero.", new Object[] {resourcelocation}); + } + else + { + boolean flag = p_148611_1_.canRepeat() && p_148611_1_.getRepeatDelay() == 0; + String s = UUID.randomUUID().toString(); + + if (soundpoolentry.func_148648_d()) + { + this.sndSystem.newStreamingSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.getXPosF(), p_148611_1_.getYPosF(), p_148611_1_.getZPosF(), p_148611_1_.getAttenuationType().getTypeInt(), f1); + MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, p_148611_1_, s)); + } + else + { + this.sndSystem.newSource(false, s, getURLForSoundResource(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.getXPosF(), p_148611_1_.getYPosF(), p_148611_1_.getZPosF(), p_148611_1_.getAttenuationType().getTypeInt(), f1); + MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, p_148611_1_, s)); + } + + logger.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.getSoundPoolEntryLocation(), soundeventaccessorcomposite.getSoundEventLocation(), s}); + this.sndSystem.setPitch(s, (float)d0); + this.sndSystem.setVolume(s, f2); + this.sndSystem.play(s); + this.playingSoundsStopTime.put(s, Integer.valueOf(this.playTime + 20)); + this.playingSounds.put(s, p_148611_1_); + this.playingSoundPoolEntries.put(p_148611_1_, soundpoolentry); + + if (soundcategory != SoundCategory.MASTER) + { + this.categorySounds.put(soundcategory, s); + } + + if (p_148611_1_ instanceof ITickableSound) + { + this.tickableSounds.add((ITickableSound)p_148611_1_); + } + } + } + } + } + } + } + + /** + * Normalizes pitch from parameters and clamps to [0.5, 2.0] + */ + private float getNormalizedPitch(ISound p_148606_1_, SoundPoolEntry p_148606_2_) + { + return (float)MathHelper.clamp_double((double)p_148606_1_.getPitch() * p_148606_2_.getPitch(), 0.5D, 2.0D); + } + + /** + * Normalizes volume level from parameters. Range [0.0, 1.0] + */ + private float getNormalizedVolume(ISound p_148594_1_, SoundPoolEntry p_148594_2_, SoundCategory p_148594_3_) + { + return (float)MathHelper.clamp_double((double)p_148594_1_.getVolume() * p_148594_2_.getVolume() * (double)this.getSoundCategoryVolume(p_148594_3_), 0.0D, 1.0D); + } + + /** + * Pauses all currently playing sounds + */ + public void pauseAllSounds() + { + Iterator iterator = this.playingSounds.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + logger.debug(field_148623_a, "Pausing channel {}", new Object[] {s}); + this.sndSystem.pause(s); + } + } + + /** + * Resumes playing all currently playing sounds (after pauseAllSounds) + */ + public void resumeAllSounds() + { + Iterator iterator = this.playingSounds.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + logger.debug(field_148623_a, "Resuming channel {}", new Object[] {s}); + this.sndSystem.play(s); + } + } + + /** + * Adds a sound to play in n tick + */ + public void addDelayedSound(ISound p_148599_1_, int p_148599_2_) + { + this.delayedSounds.put(p_148599_1_, Integer.valueOf(this.playTime + p_148599_2_)); + } + + private static URL getURLForSoundResource(final ResourceLocation p_148612_0_) + { + String s = String.format("%s:%s:%s", new Object[] {"mcsounddomain", p_148612_0_.getResourceDomain(), p_148612_0_.getResourcePath()}); + URLStreamHandler urlstreamhandler = new URLStreamHandler() + { + private static final String __OBFID = "CL_00001143"; + protected URLConnection openConnection(final URL p_openConnection_1_) + { + return new URLConnection(p_openConnection_1_) + { + private static final String __OBFID = "CL_00001144"; + public void connect() {} + public InputStream getInputStream() throws IOException + { + return Minecraft.getMinecraft().getResourceManager().getResource(p_148612_0_).getInputStream(); + } + }; + } + }; + + try + { + return new URL((URL)null, s, urlstreamhandler); + } + catch (MalformedURLException malformedurlexception) + { + throw new Error("TODO: Sanely handle url exception! :D"); + } + } + + /** + * Sets the listener of sounds + */ + public void setListener(EntityPlayer p_148615_1_, float p_148615_2_) + { + if (this.loaded && p_148615_1_ != null) + { + float f1 = p_148615_1_.prevRotationPitch + (p_148615_1_.rotationPitch - p_148615_1_.prevRotationPitch) * p_148615_2_; + float f2 = p_148615_1_.prevRotationYaw + (p_148615_1_.rotationYaw - p_148615_1_.prevRotationYaw) * p_148615_2_; + double d0 = p_148615_1_.prevPosX + (p_148615_1_.posX - p_148615_1_.prevPosX) * (double)p_148615_2_; + double d1 = p_148615_1_.prevPosY + (p_148615_1_.posY - p_148615_1_.prevPosY) * (double)p_148615_2_; + double d2 = p_148615_1_.prevPosZ + (p_148615_1_.posZ - p_148615_1_.prevPosZ) * (double)p_148615_2_; + float f3 = MathHelper.cos((f2 + 90.0F) * 0.017453292F); + float f4 = MathHelper.sin((f2 + 90.0F) * 0.017453292F); + float f5 = MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = MathHelper.cos((-f1 + 90.0F) * 0.017453292F); + float f8 = MathHelper.sin((-f1 + 90.0F) * 0.017453292F); + float f9 = f3 * f5; + float f10 = f4 * f5; + float f11 = f3 * f7; + float f12 = f4 * f7; + this.sndSystem.setListenerPosition((float)d0, (float)d1, (float)d2); + this.sndSystem.setListenerOrientation(f9, f6, f10, f11, f8, f12); + } + } + + @SideOnly(Side.CLIENT) + class SoundSystemStarterThread extends SoundSystem + { + private static final String __OBFID = "CL_00001145"; + + private SoundSystemStarterThread() {} + + public boolean playing(String p_playing_1_) + { + Object object = SoundSystemConfig.THREAD_SYNC; + + synchronized (SoundSystemConfig.THREAD_SYNC) + { + if (this.soundLibrary == null) + { + return false; + } + else + { + Source source = (Source)this.soundLibrary.getSources().get(p_playing_1_); + return source == null ? false : source.playing() || source.paused() || source.preLoad; + } + } + } + + SoundSystemStarterThread(Object p_i45118_2_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundPoolEntry.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundPoolEntry.java new file mode 100644 index 0000000..a5e60f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundPoolEntry.java @@ -0,0 +1,61 @@ +package net.minecraft.client.audio; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class SoundPoolEntry +{ + private final ResourceLocation field_148656_a; + private final boolean field_148654_b; + private double field_148655_c; + private double field_148653_d; + private static final String __OBFID = "CL_00001140"; + + public SoundPoolEntry(ResourceLocation p_i45113_1_, double p_i45113_2_, double p_i45113_4_, boolean p_i45113_6_) + { + this.field_148656_a = p_i45113_1_; + this.field_148655_c = p_i45113_2_; + this.field_148653_d = p_i45113_4_; + this.field_148654_b = p_i45113_6_; + } + + public SoundPoolEntry(SoundPoolEntry p_i45114_1_) + { + this.field_148656_a = p_i45114_1_.field_148656_a; + this.field_148655_c = p_i45114_1_.field_148655_c; + this.field_148653_d = p_i45114_1_.field_148653_d; + this.field_148654_b = p_i45114_1_.field_148654_b; + } + + public ResourceLocation getSoundPoolEntryLocation() + { + return this.field_148656_a; + } + + public double getPitch() + { + return this.field_148655_c; + } + + public void setPitch(double p_148651_1_) + { + this.field_148655_c = p_148651_1_; + } + + public double getVolume() + { + return this.field_148653_d; + } + + public void setVolume(double p_148647_1_) + { + this.field_148653_d = p_148647_1_; + } + + public boolean func_148648_d() + { + return this.field_148654_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundRegistry.java b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundRegistry.java new file mode 100644 index 0000000..a4c4ff0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/audio/SoundRegistry.java @@ -0,0 +1,33 @@ +package net.minecraft.client.audio; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; +import net.minecraft.util.RegistrySimple; + +@SideOnly(Side.CLIENT) +public class SoundRegistry extends RegistrySimple +{ + private Map field_148764_a; + private static final String __OBFID = "CL_00001151"; + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() + { + this.field_148764_a = Maps.newHashMap(); + return this.field_148764_a; + } + + public void registerSound(SoundEventAccessorComposite p_148762_1_) + { + this.putObject(p_148762_1_.getSoundEventLocation(), p_148762_1_); + } + + public void func_148763_c() + { + this.field_148764_a.clear(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/entity/AbstractClientPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/client/entity/AbstractClientPlayer.java new file mode 100644 index 0000000..e799c0f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/entity/AbstractClientPlayer.java @@ -0,0 +1,118 @@ +package net.minecraft.client.entity; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.SkinManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public abstract class AbstractClientPlayer extends EntityPlayer implements SkinManager.SkinAvailableCallback +{ + public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png"); + private ResourceLocation locationSkin; + private ResourceLocation locationCape; + private static final String __OBFID = "CL_00000935"; + + public AbstractClientPlayer(World p_i45074_1_, GameProfile p_i45074_2_) + { + super(p_i45074_1_, p_i45074_2_); + String s = this.getCommandSenderName(); + + if (!s.isEmpty()) + { + SkinManager skinmanager = Minecraft.getMinecraft().func_152342_ad(); + skinmanager.func_152790_a(p_i45074_2_, this, true); + } + } + + public boolean func_152122_n() + { + return this.locationCape != null; + } + + public boolean func_152123_o() + { + return this.locationSkin != null; + } + + public ResourceLocation getLocationSkin() + { + return this.locationSkin == null ? locationStevePng : this.locationSkin; + } + + public ResourceLocation getLocationCape() + { + return this.locationCape; + } + + public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username) + { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + Object object = texturemanager.getTexture(resourceLocationIn); + + if (object == null) + { + object = new ThreadDownloadImageData((File)null, String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(username)}), locationStevePng, new ImageBufferDownload()); + texturemanager.loadTexture(resourceLocationIn, (ITextureObject)object); + } + + return (ThreadDownloadImageData)object; + } + + public static ResourceLocation getLocationSkin(String username) + { + return new ResourceLocation("skins/" + StringUtils.stripControlCodes(username)); + } + + public void func_152121_a(Type skinPart, ResourceLocation skinLoc) + { + switch (AbstractClientPlayer.SwitchType.field_152630_a[skinPart.ordinal()]) + { + case 1: + this.locationSkin = skinLoc; + break; + case 2: + this.locationCape = skinLoc; + } + } + + @SideOnly(Side.CLIENT) + + static final class SwitchType + { + static final int[] field_152630_a = new int[Type.values().length]; + private static final String __OBFID = "CL_00001832"; + + static + { + try + { + field_152630_a[Type.SKIN.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_152630_a[Type.CAPE.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityClientPlayerMP.java b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityClientPlayerMP.java new file mode 100644 index 0000000..3fa3e52 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityClientPlayerMP.java @@ -0,0 +1,326 @@ +package net.minecraft.client.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecartRiding; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Session; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityClientPlayerMP extends EntityPlayerSP +{ + public final NetHandlerPlayClient sendQueue; + private final StatFileWriter field_146108_bO; + private double oldPosX; + /** Old Minimum Y of the bounding box */ + private double oldMinY; + private double oldPosY; + private double oldPosZ; + private float oldRotationYaw; + private float oldRotationPitch; + /** Check if was on ground last update */ + private boolean wasOnGround; + /** Used to check if the player has started or stopped sneaking and needs to tell the server. */ + private boolean wasSneaking; + /** Used to check if the player has started or stopped sprinting and needs to tell the server. */ + private boolean wasSprinting; + /** + * Counter used to ensure that the server sends a move packet (Packet11, 12 or 13) to the client at least once a + * second. + */ + private int ticksSinceMovePacket; + /** has the client player's health been set? */ + private boolean hasSetHealth; + private String field_142022_ce; + private static final String __OBFID = "CL_00000887"; + + public EntityClientPlayerMP(Minecraft p_i45064_1_, World p_i45064_2_, Session p_i45064_3_, NetHandlerPlayClient p_i45064_4_, StatFileWriter p_i45064_5_) + { + super(p_i45064_1_, p_i45064_2_, p_i45064_3_, 0); + this.sendQueue = p_i45064_4_; + this.field_146108_bO = p_i45064_5_; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } + + /** + * Heal living entity (param: amount of half-hearts) + */ + public void heal(float p_70691_1_) {} + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity entityIn) + { + super.mountEntity(entityIn); + + if (entityIn instanceof EntityMinecart) + { + this.mc.getSoundHandler().playSound(new MovingSoundMinecartRiding(this, (EntityMinecart)entityIn)); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) + { + super.onUpdate(); + + if (this.isRiding()) + { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); + } + else + { + this.sendMotionUpdates(); + } + } + } + + /** + * Send updated motion and position information to the server + */ + public void sendMotionUpdates() + { + boolean flag = this.isSprinting(); + + if (flag != this.wasSprinting) + { + if (flag) + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 4)); + } + else + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 5)); + } + + this.wasSprinting = flag; + } + + boolean flag1 = this.isSneaking(); + + if (flag1 != this.wasSneaking) + { + if (flag1) + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 1)); + } + else + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 2)); + } + + this.wasSneaking = flag1; + } + + double d0 = this.posX - this.oldPosX; + double d1 = this.boundingBox.minY - this.oldMinY; + double d2 = this.posZ - this.oldPosZ; + double d3 = (double)(this.rotationYaw - this.oldRotationYaw); + double d4 = (double)(this.rotationPitch - this.oldRotationPitch); + boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 > 9.0E-4D || this.ticksSinceMovePacket >= 20; + boolean flag3 = d3 != 0.0D || d4 != 0.0D; + + if (this.ridingEntity != null) + { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); + flag2 = false; + } + else if (flag2 && flag3) + { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); + } + else if (flag2) + { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.onGround)); + } + else if (flag3) + { + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + } + else + { + this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround)); + } + + ++this.ticksSinceMovePacket; + this.wasOnGround = this.onGround; + + if (flag2) + { + this.oldPosX = this.posX; + this.oldMinY = this.boundingBox.minY; + this.oldPosY = this.posY; + this.oldPosZ = this.posZ; + this.ticksSinceMovePacket = 0; + } + + if (flag3) + { + this.oldRotationYaw = this.rotationYaw; + this.oldRotationPitch = this.rotationPitch; + } + } + + /** + * Called when player presses the drop item key + */ + public EntityItem dropOneItem(boolean p_71040_1_) + { + int i = p_71040_1_ ? 3 : 4; + this.sendQueue.addToSendQueue(new C07PacketPlayerDigging(i, 0, 0, 0, 0)); + return null; + } + + /** + * Joins the passed in entity item with the world. Args: entityItem + */ + public void joinEntityItemWithWorld(EntityItem p_71012_1_) {} + + /** + * Sends a chat message from the player. Args: chatMessage + */ + public void sendChatMessage(String p_71165_1_) + { + this.sendQueue.addToSendQueue(new C01PacketChatMessage(p_71165_1_)); + } + + /** + * Swings the item the player is holding. + */ + public void swingItem() + { + super.swingItem(); + this.sendQueue.addToSendQueue(new C0APacketAnimation(this, 1)); + } + + public void respawnPlayer() + { + this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) + { + if (!this.isEntityInvulnerable()) + { + this.setHealth(this.getHealth() - p_70665_2_); + } + } + + /** + * sets current screen to null (used on escape buttons of GUIs); sets current crafting inventory back to the 2x2 + * square + */ + public void closeScreen() + { + this.sendQueue.addToSendQueue(new C0DPacketCloseWindow(this.openContainer.windowId)); + this.closeScreenNoPacket(); + } + + /** + * Closes the GUI screen without sending a packet to the server + */ + public void closeScreenNoPacket() + { + this.inventory.setItemStack((ItemStack)null); + super.closeScreen(); + } + + /** + * Updates health locally. + */ + public void setPlayerSPHealth(float p_71150_1_) + { + if (this.hasSetHealth) + { + super.setPlayerSPHealth(p_71150_1_); + } + else + { + this.setHealth(p_71150_1_); + this.hasSetHealth = true; + } + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) + { + if (p_71064_1_ != null) + { + if (p_71064_1_.isIndependent) + { + super.addStat(p_71064_1_, p_71064_2_); + } + } + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() + { + this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities)); + } + + protected void func_110318_g() + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int)(this.getHorseJumpPower() * 100.0F))); + } + + public void func_110322_i() + { + this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 7)); + } + + public void func_142020_c(String brand) + { + this.field_142022_ce = brand; + } + + public String func_142021_k() + { + return this.field_142022_ce; + } + + public StatFileWriter getStatFileWriter() + { + return this.field_146108_bO; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityOtherPlayerMP.java b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityOtherPlayerMP.java new file mode 100644 index 0000000..ae0a9b4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityOtherPlayerMP.java @@ -0,0 +1,206 @@ +package net.minecraft.client.entity; + +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityOtherPlayerMP extends AbstractClientPlayer +{ + private boolean isItemInUse; + private int otherPlayerMPPosRotationIncrements; + private double otherPlayerMPX; + private double otherPlayerMPY; + private double otherPlayerMPZ; + private double otherPlayerMPYaw; + private double otherPlayerMPPitch; + private static final String __OBFID = "CL_00000939"; + + public EntityOtherPlayerMP(World p_i45075_1_, GameProfile p_i45075_2_) + { + super(p_i45075_1_, p_i45075_2_); + this.yOffset = 0.0F; + this.stepHeight = 0.0F; + this.noClip = true; + this.field_71082_cx = 0.25F; + this.renderDistanceWeight = 10.0D; + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() + { + this.yOffset = 0.0F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return true; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.otherPlayerMPX = x; + this.otherPlayerMPY = y; + this.otherPlayerMPZ = z; + this.otherPlayerMPYaw = (double)yaw; + this.otherPlayerMPPitch = (double)pitch; + this.otherPlayerMPPosRotationIncrements = rotationIncrements; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.field_71082_cx = 0.0F; + super.onUpdate(); + this.prevLimbSwingAmount = this.limbSwingAmount; + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; + + if (f > 1.0F) + { + f = 1.0F; + } + + this.limbSwingAmount += (f - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + + if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) + { + ItemStack itemstack = this.inventory.mainInventory[this.inventory.currentItem]; + this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], itemstack.getItem().getMaxItemUseDuration(itemstack)); + this.isItemInUse = true; + } + else if (this.isItemInUse && !this.isEating()) + { + this.clearItemInUse(); + this.isItemInUse = false; + } + } + + public float getShadowSize() + { + return 0.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.updateEntityActionState(); + + if (this.otherPlayerMPPosRotationIncrements > 0) + { + double d0 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; + double d1 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; + double d2 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; + double d3; + + for (d3 = this.otherPlayerMPYaw - (double)this.rotationYaw; d3 < -180.0D; d3 += 360.0D) + { + ; + } + + while (d3 >= 180.0D) + { + d3 -= 360.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.otherPlayerMPPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.otherPlayerMPPitch - (double)this.rotationPitch) / (double)this.otherPlayerMPPosRotationIncrements); + --this.otherPlayerMPPosRotationIncrements; + this.setPosition(d0, d1, d2); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + + this.prevCameraYaw = this.cameraYaw; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; + + if (f1 > 0.1F) + { + f1 = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) + { + f1 = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) + { + f = 0.0F; + } + + this.cameraYaw += (f1 - this.cameraYaw) * 0.4F; + this.cameraPitch += (f - this.cameraPitch) * 0.8F; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn) + { + if (slotIn == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = itemStackIn; + } + else + { + this.inventory.armorInventory[slotIn - 1] = itemStackIn; + } + } + + @Override + public float getDefaultEyeHeight() + { + return 1.82F; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(message); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + return false; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityPlayerSP.java b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityPlayerSP.java new file mode 100644 index 0000000..5089f46 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -0,0 +1,696 @@ +package net.minecraft.client.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiCommandBlock; +import net.minecraft.client.gui.GuiEnchantment; +import net.minecraft.client.gui.GuiHopper; +import net.minecraft.client.gui.GuiMerchant; +import net.minecraft.client.gui.GuiRepair; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiScreenBook; +import net.minecraft.client.gui.inventory.GuiBeacon; +import net.minecraft.client.gui.inventory.GuiBrewingStand; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.client.gui.inventory.GuiDispenser; +import net.minecraft.client.gui.inventory.GuiEditSign; +import net.minecraft.client.gui.inventory.GuiFurnace; +import net.minecraft.client.gui.inventory.GuiScreenHorseInventory; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.client.particle.EntityPickupFX; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MouseFilter; +import net.minecraft.util.MovementInput; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Session; +import net.minecraft.world.World; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.PlaySoundAtEntityEvent; + +@SideOnly(Side.CLIENT) +public class EntityPlayerSP extends AbstractClientPlayer +{ + public MovementInput movementInput; + protected Minecraft mc; + /** + * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to + * sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable + * sprinting. + */ + protected int sprintToggleTimer; + /** Ticks left before sprinting is disabled. */ + public int sprintingTicksLeft; + public float renderArmYaw; + public float renderArmPitch; + public float prevRenderArmYaw; + public float prevRenderArmPitch; + private int horseJumpPowerCounter; + private float horseJumpPower; + private MouseFilter field_71162_ch = new MouseFilter(); + private MouseFilter field_71160_ci = new MouseFilter(); + private MouseFilter field_71161_cj = new MouseFilter(); + /** The amount of time an entity has been in a Portal */ + public float timeInPortal; + /** The amount of time an entity has been in a Portal the previous tick */ + public float prevTimeInPortal; + private static final String __OBFID = "CL_00000938"; + + public EntityPlayerSP(Minecraft p_i1238_1_, World p_i1238_2_, Session p_i1238_3_, int p_i1238_4_) + { + super(p_i1238_2_, p_i1238_3_.func_148256_e()); + this.mc = p_i1238_1_; + this.dimension = p_i1238_4_; + } + + public void updateEntityActionState() + { + super.updateEntityActionState(); + this.moveStrafing = this.movementInput.moveStrafe; + this.moveForward = this.movementInput.moveForward; + this.isJumping = this.movementInput.jump; + this.prevRenderArmYaw = this.renderArmYaw; + this.prevRenderArmPitch = this.renderArmPitch; + this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotationPitch - this.renderArmPitch) * 0.5D); + this.renderArmYaw = (float)((double)this.renderArmYaw + (double)(this.rotationYaw - this.renderArmYaw) * 0.5D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.sprintingTicksLeft > 0) + { + --this.sprintingTicksLeft; + + if (this.sprintingTicksLeft == 0) + { + this.setSprinting(false); + } + } + + if (this.sprintToggleTimer > 0) + { + --this.sprintToggleTimer; + } + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + this.posX = this.posZ = 0.5D; + this.posX = 0.0D; + this.posZ = 0.0D; + this.rotationYaw = (float)this.ticksExisted / 12.0F; + this.rotationPitch = 10.0F; + this.posY = 68.5D; + } + else + { + this.prevTimeInPortal = this.timeInPortal; + + if (this.inPortal) + { + if (this.mc.currentScreen != null) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + + if (this.timeInPortal == 0.0F) + { + this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F)); + } + + this.timeInPortal += 0.0125F; + + if (this.timeInPortal >= 1.0F) + { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; + } + else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) + { + this.timeInPortal += 0.006666667F; + + if (this.timeInPortal > 1.0F) + { + this.timeInPortal = 1.0F; + } + } + else + { + if (this.timeInPortal > 0.0F) + { + this.timeInPortal -= 0.05F; + } + + if (this.timeInPortal < 0.0F) + { + this.timeInPortal = 0.0F; + } + } + + if (this.timeUntilPortal > 0) + { + --this.timeUntilPortal; + } + + boolean flag = this.movementInput.jump; + float f = 0.8F; + boolean flag1 = this.movementInput.moveForward >= f; + this.movementInput.updatePlayerMoveState(); + + if (this.isUsingItem() && !this.isRiding()) + { + this.movementInput.moveStrafe *= 0.2F; + this.movementInput.moveForward *= 0.2F; + this.sprintToggleTimer = 0; + } + + if (this.movementInput.sneak && this.ySize < 0.2F) + { + this.ySize = 0.2F; + } + + this.func_145771_j(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); + this.func_145771_j(this.posX - (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); + this.func_145771_j(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); + this.func_145771_j(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); + boolean flag2 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; + + if (this.onGround && !flag1 && this.movementInput.moveForward >= f && !this.isSprinting() && flag2 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) + { + if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) + { + this.sprintToggleTimer = 7; + } + else + { + this.setSprinting(true); + } + } + + if (!this.isSprinting() && this.movementInput.moveForward >= f && flag2 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness) && this.mc.gameSettings.keyBindSprint.getIsKeyPressed()) + { + this.setSprinting(true); + } + + if (this.isSprinting() && (this.movementInput.moveForward < f || this.isCollidedHorizontally || !flag2)) + { + this.setSprinting(false); + } + + if (this.capabilities.allowFlying && !flag && this.movementInput.jump) + { + if (this.flyToggleTimer == 0) + { + this.flyToggleTimer = 7; + } + else + { + this.capabilities.isFlying = !this.capabilities.isFlying; + this.sendPlayerAbilities(); + this.flyToggleTimer = 0; + } + } + + if (this.capabilities.isFlying) + { + if (this.movementInput.sneak) + { + this.motionY -= 0.15D; + } + + if (this.movementInput.jump) + { + this.motionY += 0.15D; + } + } + + if (this.isRidingHorse()) + { + if (this.horseJumpPowerCounter < 0) + { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter == 0) + { + this.horseJumpPower = 0.0F; + } + } + + if (flag && !this.movementInput.jump) + { + this.horseJumpPowerCounter = -10; + this.func_110318_g(); + } + else if (!flag && this.movementInput.jump) + { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; + } + else if (flag) + { + ++this.horseJumpPowerCounter; + + if (this.horseJumpPowerCounter < 10) + { + this.horseJumpPower = (float)this.horseJumpPowerCounter * 0.1F; + } + else + { + this.horseJumpPower = 0.8F + 2.0F / (float)(this.horseJumpPowerCounter - 9) * 0.1F; + } + } + } + else + { + this.horseJumpPower = 0.0F; + } + + super.onLivingUpdate(); + + if (this.onGround && this.capabilities.isFlying) + { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } + } + } + + /** + * Gets the player's field of view multiplier. (ex. when flying) + */ + public float getFOVMultiplier() + { + float f = 1.0F; + + if (this.capabilities.isFlying) + { + f *= 1.1F; + } + + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + f = (float)((double)f * ((iattributeinstance.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); + + if (this.capabilities.getWalkSpeed() == 0.0F || Float.isNaN(f) || Float.isInfinite(f)) + { + f = 1.0F; + } + + if (this.isUsingItem() && this.getItemInUse().getItem() == Items.bow) + { + int i = this.getItemInUseDuration(); + float f1 = (float)i / 20.0F; + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + else + { + f1 *= f1; + } + + f *= 1.0F - f1 * 0.15F; + } + + return ForgeHooksClient.getOffsetFOV(this, f); + } + + /** + * sets current screen to null (used on escape buttons of GUIs); sets current crafting inventory back to the 2x2 + * square + */ + public void closeScreen() + { + super.closeScreen(); + this.mc.displayGuiScreen((GuiScreen)null); + } + + public void func_146100_a(TileEntity p_146100_1_) + { + if (p_146100_1_ instanceof TileEntitySign) + { + this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)p_146100_1_)); + } + else if (p_146100_1_ instanceof TileEntityCommandBlock) + { + this.mc.displayGuiScreen(new GuiCommandBlock(((TileEntityCommandBlock)p_146100_1_).func_145993_a())); + } + } + + public void func_146095_a(CommandBlockLogic p_146095_1_) + { + this.mc.displayGuiScreen(new GuiCommandBlock(p_146095_1_)); + } + + /** + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack p_71048_1_) + { + Item item = p_71048_1_.getItem(); + + if (item == Items.written_book) + { + this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, false)); + } + else if (item == Items.writable_book) + { + this.mc.displayGuiScreen(new GuiScreenBook(this, p_71048_1_, true)); + } + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) + { + this.mc.displayGuiScreen(new GuiChest(this.inventory, p_71007_1_)); + } + + public void func_146093_a(TileEntityHopper p_146093_1_) + { + this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_146093_1_)); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) + { + this.mc.displayGuiScreen(new GuiHopper(this.inventory, p_96125_1_)); + } + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) + { + this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, p_110298_2_, p_110298_1_)); + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) + { + this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, p_71058_1_, p_71058_2_, p_71058_3_)); + } + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) + { + this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, p_71002_1_, p_71002_2_, p_71002_3_, p_71002_4_)); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) + { + this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_)); + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) + { + this.mc.displayGuiScreen(new GuiFurnace(this.inventory, p_146101_1_)); + } + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) + { + this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, p_146098_1_)); + } + + public void func_146104_a(TileEntityBeacon p_146104_1_) + { + this.mc.displayGuiScreen(new GuiBeacon(this.inventory, p_146104_1_)); + } + + public void func_146102_a(TileEntityDispenser p_146102_1_) + { + this.mc.displayGuiScreen(new GuiDispenser(this.inventory, p_146102_1_)); + } + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) + { + this.mc.displayGuiScreen(new GuiMerchant(this.inventory, p_71030_1_, this.worldObj, p_71030_2_)); + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) + { + this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, p_71009_1_)); + } + + public void onEnchantmentCritical(Entity p_71047_1_) + { + EntityCrit2FX entitycrit2fx = new EntityCrit2FX(this.mc.theWorld, p_71047_1_, "magicCrit"); + this.mc.effectRenderer.addEffect(entitycrit2fx); + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) + { + this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, p_71001_1_, this, -0.5F)); + } + + /** + * Returns if this entity is sneaking. + */ + public boolean isSneaking() + { + return this.movementInput.sneak && !this.sleeping; + } + + /** + * Updates health locally. + */ + public void setPlayerSPHealth(float p_71150_1_) + { + float f1 = this.getHealth() - p_71150_1_; + + if (f1 <= 0.0F) + { + this.setHealth(p_71150_1_); + + if (f1 < 0.0F) + { + this.hurtResistantTime = this.maxHurtResistantTime / 2; + } + } + else + { + this.lastDamage = f1; + this.setHealth(this.getHealth()); + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(DamageSource.generic, f1); + this.hurtTime = this.maxHurtTime = 10; + } + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) + { + this.mc.ingameGUI.getChatGUI().printChatMessage(p_146105_1_); + } + + private boolean isBlockTranslucent(int p_71153_1_, int p_71153_2_, int p_71153_3_) + { + return this.worldObj.getBlock(p_71153_1_, p_71153_2_, p_71153_3_).isNormalCube(); + } + + private boolean isHeadspaceFree(int x, int y, int z, int height) + { + for (int i1 = 0; i1 < height; i1++) + { + if (isBlockTranslucent(x, y + i1, z + 1)) return false; + } + return true; + } + + protected boolean func_145771_j(double x, double y, double z) + { + if (this.noClip) + { + return false; + } + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + double d3 = x - (double)i; + double d4 = z - (double)k; + + int entHeight = Math.max(Math.round(this.height), 1); + + boolean inTranslucentBlock = true; + + for (int i1 = 0; i1 < entHeight; i1++) + { + if (!this.isBlockTranslucent(i, j + i1, k)) + { + inTranslucentBlock = false; + } + } + + if (inTranslucentBlock) + { + boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight); + boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight); + boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight); + boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight); + byte b0 = -1; + double d5 = 9999.0D; + + if (flag && d3 < d5) + { + d5 = d3; + b0 = 0; + } + + if (flag1 && 1.0D - d3 < d5) + { + d5 = 1.0D - d3; + b0 = 1; + } + + if (flag2 && d4 < d5) + { + d5 = d4; + b0 = 4; + } + + if (flag3 && 1.0D - d4 < d5) + { + d5 = 1.0D - d4; + b0 = 5; + } + + float f = 0.1F; + + if (b0 == 0) + { + this.motionX = (double)(-f); + } + + if (b0 == 1) + { + this.motionX = (double)f; + } + + if (b0 == 4) + { + this.motionZ = (double)(-f); + } + + if (b0 == 5) + { + this.motionZ = (double)f; + } + } + + return false; + } + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean sprinting) + { + super.setSprinting(sprinting); + this.sprintingTicksLeft = sprinting ? 600 : 0; + } + + /** + * Sets the current XP, total XP, and level number. + */ + public void setXPStats(float p_71152_1_, int p_71152_2_, int p_71152_3_) + { + this.experience = p_71152_1_; + this.experienceTotal = p_71152_2_; + this.experienceLevel = p_71152_3_; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + this.mc.ingameGUI.getChatGUI().printChatMessage(message); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + return permissionLevel <= 0; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } + + public void playSound(String name, float volume, float pitch) + { + PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, name, volume, pitch); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + name = event.name; + this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, name, volume, pitch, false); + } + + /** + * Returns whether the entity is in a local (client) world + */ + public boolean isClientWorld() + { + return true; + } + + public boolean isRidingHorse() + { + return this.ridingEntity != null && this.ridingEntity instanceof EntityHorse; + } + + public float getHorseJumpPower() + { + return this.horseJumpPower; + } + + protected void func_110318_g() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ChatLine.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ChatLine.java new file mode 100644 index 0000000..2333601 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ChatLine.java @@ -0,0 +1,38 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.IChatComponent; + +@SideOnly(Side.CLIENT) +public class ChatLine +{ + /** GUI Update Counter value this Line was created at */ + private final int updateCounterCreated; + private final IChatComponent lineString; + /** int value to refer to existing Chat Lines, can be 0 which means unreferrable */ + private final int chatLineID; + private static final String __OBFID = "CL_00000627"; + + public ChatLine(int p_i45000_1_, IChatComponent p_i45000_2_, int p_i45000_3_) + { + this.lineString = p_i45000_2_; + this.updateCounterCreated = p_i45000_1_; + this.chatLineID = p_i45000_3_; + } + + public IChatComponent func_151461_a() + { + return this.lineString; + } + + public int getUpdatedCounter() + { + return this.updateCounterCreated; + } + + public int getChatLineID() + { + return this.chatLineID; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/FontRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/FontRenderer.java new file mode 100644 index 0000000..e7e567d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/FontRenderer.java @@ -0,0 +1,976 @@ +package net.minecraft.client.gui; + +import com.ibm.icu.text.ArabicShaping; +import com.ibm.icu.text.ArabicShapingException; +import com.ibm.icu.text.Bidi; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class FontRenderer implements IResourceManagerReloadListener +{ + private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; + /** Array of width of all the characters in default.png */ + protected int[] charWidth = new int[256]; + /** the height in pixels of default text */ + public int FONT_HEIGHT = 9; + public Random fontRandom = new Random(); + /** Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory. */ + protected byte[] glyphWidth = new byte[65536]; + /** + * Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for + * drop shadows. + */ + private int[] colorCode = new int[32]; + protected final ResourceLocation locationFontTexture; + /** The RenderEngine used to load and setup glyph textures. */ + private final TextureManager renderEngine; + /** Current X coordinate at which to draw the next character. */ + protected float posX; + /** Current Y coordinate at which to draw the next character. */ + protected float posY; + /** If true, strings should be rendered with Unicode fonts instead of the default.png font */ + private boolean unicodeFlag; + /** If true, the Unicode Bidirectional Algorithm should be run before rendering any string. */ + private boolean bidiFlag; + /** Used to specify new red value for the current color. */ + private float red; + /** Used to specify new blue value for the current color. */ + private float blue; + /** Used to specify new green value for the current color. */ + private float green; + /** Used to speify new alpha value for the current color. */ + private float alpha; + /** Text color of the currently rendering string. */ + private int textColor; + /** Set if the "k" style (random) is active in currently rendering string */ + private boolean randomStyle; + /** Set if the "l" style (bold) is active in currently rendering string */ + private boolean boldStyle; + /** Set if the "o" style (italic) is active in currently rendering string */ + private boolean italicStyle; + /** Set if the "n" style (underlined) is active in currently rendering string */ + private boolean underlineStyle; + /** Set if the "m" style (strikethrough) is active in currently rendering string */ + private boolean strikethroughStyle; + private static final String __OBFID = "CL_00000660"; + + public FontRenderer(GameSettings p_i1035_1_, ResourceLocation p_i1035_2_, TextureManager p_i1035_3_, boolean p_i1035_4_) + { + this.locationFontTexture = p_i1035_2_; + this.renderEngine = p_i1035_3_; + this.unicodeFlag = p_i1035_4_; + bindTexture(this.locationFontTexture); + + for (int i = 0; i < 32; ++i) + { + int j = (i >> 3 & 1) * 85; + int k = (i >> 2 & 1) * 170 + j; + int l = (i >> 1 & 1) * 170 + j; + int i1 = (i >> 0 & 1) * 170 + j; + + if (i == 6) + { + k += 85; + } + + if (p_i1035_1_.anaglyph) + { + int j1 = (k * 30 + l * 59 + i1 * 11) / 100; + int k1 = (k * 30 + l * 70) / 100; + int l1 = (k * 30 + i1 * 70) / 100; + k = j1; + l = k1; + i1 = l1; + } + + if (i >= 16) + { + k /= 4; + l /= 4; + i1 /= 4; + } + + this.colorCode[i] = (k & 255) << 16 | (l & 255) << 8 | i1 & 255; + } + + this.readGlyphSizes(); + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + this.readFontTexture(); + } + + private void readFontTexture() + { + BufferedImage bufferedimage; + + try + { + bufferedimage = ImageIO.read(getResourceInputStream(this.locationFontTexture)); + } + catch (IOException ioexception) + { + throw new RuntimeException(ioexception); + } + + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int[] aint = new int[i * j]; + bufferedimage.getRGB(0, 0, i, j, aint, 0, i); + int k = j / 16; + int l = i / 16; + byte b0 = 1; + float f = 8.0F / (float)l; + int i1 = 0; + + while (i1 < 256) + { + int j1 = i1 % 16; + int k1 = i1 / 16; + + if (i1 == 32) + { + this.charWidth[i1] = 3 + b0; + } + + int l1 = l - 1; + + while (true) + { + if (l1 >= 0) + { + int i2 = j1 * l + l1; + boolean flag = true; + + for (int j2 = 0; j2 < k && flag; ++j2) + { + int k2 = (k1 * l + j2) * i; + + if ((aint[i2 + k2] >> 24 & 255) != 0) + { + flag = false; + } + } + + if (flag) + { + --l1; + continue; + } + } + + ++l1; + this.charWidth[i1] = (int)(0.5D + (double)((float)l1 * f)) + b0; + ++i1; + break; + } + } + } + + private void readGlyphSizes() + { + try + { + InputStream inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + inputstream.read(this.glyphWidth); + } + catch (IOException ioexception) + { + throw new RuntimeException(ioexception); + } + } + + /** + * Pick how to render a single character and return the width used. + */ + private float renderCharAtPos(int p_78278_1_, char p_78278_2_, boolean p_78278_3_) + { + return p_78278_2_ == 32 ? 4.0F : ("\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(p_78278_2_) != -1 && !this.unicodeFlag ? this.renderDefaultChar(p_78278_1_, p_78278_3_) : this.renderUnicodeChar(p_78278_2_, p_78278_3_)); + } + + /** + * Render a single character with the default.png font at current (posX,posY) location... + */ + protected float renderDefaultChar(int p_78266_1_, boolean p_78266_2_) + { + float f = (float)(p_78266_1_ % 16 * 8); + float f1 = (float)(p_78266_1_ / 16 * 8); + float f2 = p_78266_2_ ? 1.0F : 0.0F; + bindTexture(this.locationFontTexture); + float f3 = (float)this.charWidth[p_78266_1_] - 0.01F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(f / 128.0F, f1 / 128.0F); + GL11.glVertex3f(this.posX + f2, this.posY, 0.0F); + GL11.glTexCoord2f(f / 128.0F, (f1 + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX - f2, this.posY + 7.99F, 0.0F); + GL11.glTexCoord2f((f + f3 - 1.0F) / 128.0F, f1 / 128.0F); + GL11.glVertex3f(this.posX + f3 - 1.0F + f2, this.posY, 0.0F); + GL11.glTexCoord2f((f + f3 - 1.0F) / 128.0F, (f1 + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX + f3 - 1.0F - f2, this.posY + 7.99F, 0.0F); + GL11.glEnd(); + return (float)this.charWidth[p_78266_1_]; + } + + private ResourceLocation getUnicodePageLocation(int p_111271_1_) + { + if (unicodePageLocations[p_111271_1_] == null) + { + unicodePageLocations[p_111271_1_] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(p_111271_1_)})); + } + + return unicodePageLocations[p_111271_1_]; + } + + /** + * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. + */ + private void loadGlyphTexture(int p_78257_1_) + { + bindTexture(this.getUnicodePageLocation(p_78257_1_)); + } + + /** + * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... + */ + protected float renderUnicodeChar(char p_78277_1_, boolean p_78277_2_) + { + if (this.glyphWidth[p_78277_1_] == 0) + { + return 0.0F; + } + else + { + int i = p_78277_1_ / 256; + this.loadGlyphTexture(i); + int j = this.glyphWidth[p_78277_1_] >>> 4; + int k = this.glyphWidth[p_78277_1_] & 15; + float f = (float)j; + float f1 = (float)(k + 1); + float f2 = (float)(p_78277_1_ % 16 * 16) + f; + float f3 = (float)((p_78277_1_ & 255) / 16 * 16); + float f4 = f1 - f - 0.02F; + float f5 = p_78277_2_ ? 1.0F : 0.0F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(f2 / 256.0F, f3 / 256.0F); + GL11.glVertex3f(this.posX + f5, this.posY, 0.0F); + GL11.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F); + GL11.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F); + GL11.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F); + GL11.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F); + GL11.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F); + GL11.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F); + GL11.glEnd(); + return (f1 - f) / 2.0F + 1.0F; + } + } + + /** + * Draws the specified string with a shadow. + */ + public int drawStringWithShadow(String text, int x, int y, int color) + { + return this.drawString(text, x, y, color, true); + } + + /** + * Draws the specified string. + */ + public int drawString(String text, int x, int y, int color) + { + return this.drawString(text, x, y, color, false); + } + + /** + * Draws the specified string. Args: string, x, y, color, dropShadow + */ + public int drawString(String text, int x, int y, int color, boolean dropShadow) + { + enableAlpha(); + this.resetStyles(); + int l; + + if (dropShadow) + { + l = this.renderString(text, x + 1, y + 1, color, true); + l = Math.max(l, this.renderString(text, x, y, color, false)); + } + else + { + l = this.renderString(text, x, y, color, false); + } + + return l; + } + + /** + * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. + */ + private String bidiReorder(String p_147647_1_) + { + try + { + Bidi bidi = new Bidi((new ArabicShaping(8)).shape(p_147647_1_), 127); + bidi.setReorderingMode(0); + return bidi.writeReordered(2); + } + catch (ArabicShapingException arabicshapingexception) + { + return p_147647_1_; + } + } + + /** + * Reset all style flag fields in the class to false; called at the start of string rendering + */ + private void resetStyles() + { + this.randomStyle = false; + this.boldStyle = false; + this.italicStyle = false; + this.underlineStyle = false; + this.strikethroughStyle = false; + } + + /** + * Render a single line string at the current (posX,posY) and update posX + */ + private void renderStringAtPos(String p_78255_1_, boolean p_78255_2_) + { + for (int i = 0; i < p_78255_1_.length(); ++i) + { + char c0 = p_78255_1_.charAt(i); + int j; + int k; + + if (c0 == 167 && i + 1 < p_78255_1_.length()) + { + j = "0123456789abcdefklmnor".indexOf(p_78255_1_.toLowerCase().charAt(i + 1)); + + if (j < 16) + { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + + if (j < 0 || j > 15) + { + j = 15; + } + + if (p_78255_2_) + { + j += 16; + } + + k = this.colorCode[j]; + this.textColor = k; + setColor((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha); + } + else if (j == 16) + { + this.randomStyle = true; + } + else if (j == 17) + { + this.boldStyle = true; + } + else if (j == 18) + { + this.strikethroughStyle = true; + } + else if (j == 19) + { + this.underlineStyle = true; + } + else if (j == 20) + { + this.italicStyle = true; + } + else if (j == 21) + { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; + setColor(this.red, this.blue, this.green, this.alpha); + } + + ++i; + } + else + { + j = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(c0); + + if (this.randomStyle && j != -1) + { + do + { + k = this.fontRandom.nextInt(this.charWidth.length); + } + while (this.charWidth[j] != this.charWidth[k]); + + j = k; + } + + float f1 = this.unicodeFlag ? 0.5F : 1.0F; + boolean flag1 = (c0 == 0 || j == -1 || this.unicodeFlag) && p_78255_2_; + + if (flag1) + { + this.posX -= f1; + this.posY -= f1; + } + + float f = this.renderCharAtPos(j, c0, this.italicStyle); + + if (flag1) + { + this.posX += f1; + this.posY += f1; + } + + if (this.boldStyle) + { + this.posX += f1; + + if (flag1) + { + this.posX -= f1; + this.posY -= f1; + } + + this.renderCharAtPos(j, c0, this.italicStyle); + this.posX -= f1; + + if (flag1) + { + this.posX += f1; + this.posY += f1; + } + + ++f; + } + + doDraw(f); + } + } + } + + protected void doDraw(float f) + { + { + { + Tessellator tessellator; + + if (this.strikethroughStyle) + { + tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double)(this.posX + f), (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double)(this.posX + f), (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + if (this.underlineStyle) + { + tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + int l = this.underlineStyle ? -1 : 0; + tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double)(this.posX + f), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double)(this.posX + f), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + this.posX += (float)((int)f); + } + } + } + + /** + * Render string either left or right aligned depending on bidiFlag + */ + private int renderStringAligned(String p_78274_1_, int p_78274_2_, int p_78274_3_, int p_78274_4_, int p_78274_5_, boolean p_78274_6_) + { + if (this.bidiFlag) + { + int i1 = this.getStringWidth(this.bidiReorder(p_78274_1_)); + p_78274_2_ = p_78274_2_ + p_78274_4_ - i1; + } + + return this.renderString(p_78274_1_, p_78274_2_, p_78274_3_, p_78274_5_, p_78274_6_); + } + + /** + * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() + */ + private int renderString(String p_78258_1_, int p_78258_2_, int p_78258_3_, int p_78258_4_, boolean p_78258_5_) + { + if (p_78258_1_ == null) + { + return 0; + } + else + { + if (this.bidiFlag) + { + p_78258_1_ = this.bidiReorder(p_78258_1_); + } + + if ((p_78258_4_ & -67108864) == 0) + { + p_78258_4_ |= -16777216; + } + + if (p_78258_5_) + { + p_78258_4_ = (p_78258_4_ & 16579836) >> 2 | p_78258_4_ & -16777216; + } + + this.red = (float)(p_78258_4_ >> 16 & 255) / 255.0F; + this.blue = (float)(p_78258_4_ >> 8 & 255) / 255.0F; + this.green = (float)(p_78258_4_ & 255) / 255.0F; + this.alpha = (float)(p_78258_4_ >> 24 & 255) / 255.0F; + setColor(this.red, this.blue, this.green, this.alpha); + this.posX = (float)p_78258_2_; + this.posY = (float)p_78258_3_; + this.renderStringAtPos(p_78258_1_, p_78258_5_); + return (int)this.posX; + } + } + + /** + * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). + */ + public int getStringWidth(String p_78256_1_) + { + if (p_78256_1_ == null) + { + return 0; + } + else + { + int i = 0; + boolean flag = false; + + for (int j = 0; j < p_78256_1_.length(); ++j) + { + char c0 = p_78256_1_.charAt(j); + int k = this.getCharWidth(c0); + + if (k < 0 && j < p_78256_1_.length() - 1) + { + ++j; + c0 = p_78256_1_.charAt(j); + + if (c0 != 108 && c0 != 76) + { + if (c0 == 114 || c0 == 82) + { + flag = false; + } + } + else + { + flag = true; + } + + k = 0; + } + + i += k; + + if (flag && k > 0) + { + ++i; + } + } + + return i; + } + } + + /** + * Returns the width of this character as rendered. + */ + public int getCharWidth(char p_78263_1_) + { + if (p_78263_1_ == 167) + { + return -1; + } + else if (p_78263_1_ == 32) + { + return 4; + } + else + { + int i = "\u00c0\u00c1\u00c2\u00c8\u00ca\u00cb\u00cd\u00d3\u00d4\u00d5\u00da\u00df\u00e3\u00f5\u011f\u0130\u0131\u0152\u0153\u015e\u015f\u0174\u0175\u017e\u0207\u0000\u0000\u0000\u0000\u0000\u0000\u0000 !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0000\u00c7\u00fc\u00e9\u00e2\u00e4\u00e0\u00e5\u00e7\u00ea\u00eb\u00e8\u00ef\u00ee\u00ec\u00c4\u00c5\u00c9\u00e6\u00c6\u00f4\u00f6\u00f2\u00fb\u00f9\u00ff\u00d6\u00dc\u00f8\u00a3\u00d8\u00d7\u0192\u00e1\u00ed\u00f3\u00fa\u00f1\u00d1\u00aa\u00ba\u00bf\u00ae\u00ac\u00bd\u00bc\u00a1\u00ab\u00bb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\u03b2\u0393\u03c0\u03a3\u03c3\u03bc\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u2205\u2208\u2229\u2261\u00b1\u2265\u2264\u2320\u2321\u00f7\u2248\u00b0\u2219\u00b7\u221a\u207f\u00b2\u25a0\u0000".indexOf(p_78263_1_); + + if (p_78263_1_ > 0 && i != -1 && !this.unicodeFlag) + { + return this.charWidth[i]; + } + else if (this.glyphWidth[p_78263_1_] != 0) + { + int j = this.glyphWidth[p_78263_1_] >>> 4; + int k = this.glyphWidth[p_78263_1_] & 15; + + if (k > 7) + { + k = 15; + j = 0; + } + + ++k; + return (k - j) / 2 + 1; + } + else + { + return 0; + } + } + } + + /** + * Trims a string to fit a specified Width. + */ + public String trimStringToWidth(String p_78269_1_, int p_78269_2_) + { + return this.trimStringToWidth(p_78269_1_, p_78269_2_, false); + } + + /** + * Trims a string to a specified width, and will reverse it if par3 is set. + */ + public String trimStringToWidth(String p_78262_1_, int p_78262_2_, boolean p_78262_3_) + { + StringBuilder stringbuilder = new StringBuilder(); + int j = 0; + int k = p_78262_3_ ? p_78262_1_.length() - 1 : 0; + int l = p_78262_3_ ? -1 : 1; + boolean flag1 = false; + boolean flag2 = false; + + for (int i1 = k; i1 >= 0 && i1 < p_78262_1_.length() && j < p_78262_2_; i1 += l) + { + char c0 = p_78262_1_.charAt(i1); + int j1 = this.getCharWidth(c0); + + if (flag1) + { + flag1 = false; + + if (c0 != 108 && c0 != 76) + { + if (c0 == 114 || c0 == 82) + { + flag2 = false; + } + } + else + { + flag2 = true; + } + } + else if (j1 < 0) + { + flag1 = true; + } + else + { + j += j1; + + if (flag2) + { + ++j; + } + } + + if (j > p_78262_2_) + { + break; + } + + if (p_78262_3_) + { + stringbuilder.insert(0, c0); + } + else + { + stringbuilder.append(c0); + } + } + + return stringbuilder.toString(); + } + + /** + * Remove all newline characters from the end of the string + */ + private String trimStringNewline(String p_78273_1_) + { + while (p_78273_1_ != null && p_78273_1_.endsWith("\n")) + { + p_78273_1_ = p_78273_1_.substring(0, p_78273_1_.length() - 1); + } + + return p_78273_1_; + } + + /** + * Splits and draws a String with wordwrap (maximum length is parameter k) + */ + public void drawSplitString(String str, int x, int y, int wrapWidth, int textColor) + { + this.resetStyles(); + this.textColor = textColor; + str = this.trimStringNewline(str); + this.renderSplitString(str, x, y, wrapWidth, false); + } + + /** + * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is + * set + */ + private void renderSplitString(String str, int x, int y, int wrapWidth, boolean addShadow) + { + List list = this.listFormattedStringToWidth(str, wrapWidth); + + for (Iterator iterator = list.iterator(); iterator.hasNext(); y += this.FONT_HEIGHT) + { + String s1 = (String)iterator.next(); + this.renderStringAligned(s1, x, y, wrapWidth, this.textColor, addShadow); + } + } + + /** + * Returns the width of the wordwrapped String (maximum length is parameter k) + */ + public int splitStringWidth(String p_78267_1_, int p_78267_2_) + { + return this.FONT_HEIGHT * this.listFormattedStringToWidth(p_78267_1_, p_78267_2_).size(); + } + + /** + * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png + * font. + */ + public void setUnicodeFlag(boolean p_78264_1_) + { + this.unicodeFlag = p_78264_1_; + } + + /** + * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png + * font. + */ + public boolean getUnicodeFlag() + { + return this.unicodeFlag; + } + + /** + * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. + */ + public void setBidiFlag(boolean p_78275_1_) + { + this.bidiFlag = p_78275_1_; + } + + /** + * Breaks a string into a list of pieces that will fit a specified width. + */ + public List listFormattedStringToWidth(String str, int wrapWidth) + { + return Arrays.asList(this.wrapFormattedStringToWidth(str, wrapWidth).split("\n")); + } + + /** + * Inserts newline and formatting into a string to wrap it within the specified width. + */ + String wrapFormattedStringToWidth(String str, int wrapWidth) + { + int j = this.sizeStringToWidth(str, wrapWidth); + + if (str.length() <= j) + { + return str; + } + else + { + String s1 = str.substring(0, j); + char c0 = str.charAt(j); + boolean flag = c0 == 32 || c0 == 10; + String s2 = getFormatFromString(s1) + str.substring(j + (flag ? 1 : 0)); + return s1 + "\n" + this.wrapFormattedStringToWidth(s2, wrapWidth); + } + } + + /** + * Determines how many characters from the string will fit into the specified width. + */ + private int sizeStringToWidth(String str, int wrapWidth) + { + int j = str.length(); + int k = 0; + int l = 0; + int i1 = -1; + + for (boolean flag = false; l < j; ++l) + { + char c0 = str.charAt(l); + + switch (c0) + { + case 10: + --l; + break; + case 167: + if (l < j - 1) + { + ++l; + char c1 = str.charAt(l); + + if (c1 != 108 && c1 != 76) + { + if (c1 == 114 || c1 == 82 || isFormatColor(c1)) + { + flag = false; + } + } + else + { + flag = true; + } + } + + break; + case 32: + i1 = l; + default: + k += this.getCharWidth(c0); + + if (flag) + { + ++k; + } + } + + if (c0 == 10) + { + ++l; + i1 = l; + break; + } + + if (k > wrapWidth) + { + break; + } + } + + return l != j && i1 != -1 && i1 < l ? i1 : l; + } + + /** + * Checks if the char code is a hexadecimal character, used to set colour. + */ + private static boolean isFormatColor(char colorChar) + { + return colorChar >= 48 && colorChar <= 57 || colorChar >= 97 && colorChar <= 102 || colorChar >= 65 && colorChar <= 70; + } + + /** + * Checks if the char code is O-K...lLrRk-o... used to set special formatting. + */ + private static boolean isFormatSpecial(char formatChar) + { + return formatChar >= 107 && formatChar <= 111 || formatChar >= 75 && formatChar <= 79 || formatChar == 114 || formatChar == 82; + } + + /** + * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. + */ + private static String getFormatFromString(String p_78282_0_) + { + String s1 = ""; + int i = -1; + int j = p_78282_0_.length(); + + while ((i = p_78282_0_.indexOf(167, i + 1)) != -1) + { + if (i < j - 1) + { + char c0 = p_78282_0_.charAt(i + 1); + + if (isFormatColor(c0)) + { + s1 = "\u00a7" + c0; + } + else if (isFormatSpecial(c0)) + { + s1 = s1 + "\u00a7" + c0; + } + } + } + + return s1; + } + + /** + * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string + */ + public boolean getBidiFlag() + { + return this.bidiFlag; + } + + protected void setColor(float r, float g, float b, float a) + { + GL11.glColor4f(r, g, b, a); + } + + protected void enableAlpha() + { + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + protected void bindTexture(ResourceLocation location) + { + renderEngine.bindTexture(location); + } + + protected InputStream getResourceInputStream(ResourceLocation location) throws IOException + { + return Minecraft.getMinecraft().getResourceManager().getResource(location).getInputStream(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/Gui.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/Gui.java new file mode 100644 index 0000000..bd849b8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/Gui.java @@ -0,0 +1,185 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class Gui +{ + public static final ResourceLocation optionsBackground = new ResourceLocation("textures/gui/options_background.png"); + public static final ResourceLocation statIcons = new ResourceLocation("textures/gui/container/stats_icons.png"); + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + protected float zLevel; + private static final String __OBFID = "CL_00000662"; + + protected void drawHorizontalLine(int startX, int endX, int y, int color) + { + if (endX < startX) + { + int i1 = startX; + startX = endX; + endX = i1; + } + + drawRect(startX, y, endX + 1, y + 1, color); + } + + protected void drawVerticalLine(int x, int startY, int endY, int color) + { + if (endY < startY) + { + int i1 = startY; + startY = endY; + endY = i1; + } + + drawRect(x, startY + 1, x + 1, endY, color); + } + + /** + * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color + */ + public static void drawRect(int left, int top, int right, int bottom, int color) + { + int j1; + + if (left < right) + { + j1 = left; + left = right; + right = j1; + } + + if (top < bottom) + { + j1 = top; + top = bottom; + bottom = j1; + } + + float f3 = (float)(color >> 24 & 255) / 255.0F; + float f = (float)(color >> 16 & 255) / 255.0F; + float f1 = (float)(color >> 8 & 255) / 255.0F; + float f2 = (float)(color & 255) / 255.0F; + Tessellator tessellator = Tessellator.instance; + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(f, f1, f2, f3); + tessellator.startDrawingQuads(); + tessellator.addVertex((double)left, (double)bottom, 0.0D); + tessellator.addVertex((double)right, (double)bottom, 0.0D); + tessellator.addVertex((double)right, (double)top, 0.0D); + tessellator.addVertex((double)left, (double)top, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * Draws a rectangle with a vertical gradient between the specified colors. + */ + protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) + { + float f = (float)(startColor >> 24 & 255) / 255.0F; + float f1 = (float)(startColor >> 16 & 255) / 255.0F; + float f2 = (float)(startColor >> 8 & 255) / 255.0F; + float f3 = (float)(startColor & 255) / 255.0F; + float f4 = (float)(endColor >> 24 & 255) / 255.0F; + float f5 = (float)(endColor >> 16 & 255) / 255.0F; + float f6 = (float)(endColor >> 8 & 255) / 255.0F; + float f7 = (float)(endColor & 255) / 255.0F; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(f1, f2, f3, f); + tessellator.addVertex((double)right, (double)top, (double)this.zLevel); + tessellator.addVertex((double)left, (double)top, (double)this.zLevel); + tessellator.setColorRGBA_F(f5, f6, f7, f4); + tessellator.addVertex((double)left, (double)bottom, (double)this.zLevel); + tessellator.addVertex((double)right, (double)bottom, (double)this.zLevel); + tessellator.draw(); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Renders the specified text to the screen, center-aligned. + */ + public void drawCenteredString(FontRenderer fontRendererIn, String text, int x, int y, int color) + { + fontRendererIn.drawStringWithShadow(text, x - fontRendererIn.getStringWidth(text) / 2, y, color); + } + + /** + * Renders the specified text to the screen. + */ + public void drawString(FontRenderer fontRendererIn, String text, int x, int y, int color) + { + fontRendererIn.drawStringWithShadow(text, x, y, color); + } + + /** + * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height + */ + public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) + { + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)this.zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1)); + tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)this.zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1)); + tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)this.zLevel, (double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1)); + tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)this.zLevel, (double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1)); + tessellator.draw(); + } + + public void drawTexturedModelRectFromIcon(int x, int y, IIcon icon, int width, int height) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)this.zLevel, (double)icon.getMinU(), (double)icon.getMaxV()); + tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)this.zLevel, (double)icon.getMaxU(), (double)icon.getMaxV()); + tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)this.zLevel, (double)icon.getMaxU(), (double)icon.getMinV()); + tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)this.zLevel, (double)icon.getMinU(), (double)icon.getMinV()); + tessellator.draw(); + } + + public static void func_146110_a(int x, int y, float u, float v, int width, int height, float textureWidth, float textureHeight) + { + float f4 = 1.0F / textureWidth; + float f5 = 1.0F / textureHeight; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)x, (double)(y + height), 0.0D, (double)(u * f4), (double)((v + (float)height) * f5)); + tessellator.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, (double)((u + (float)width) * f4), (double)((v + (float)height) * f5)); + tessellator.addVertexWithUV((double)(x + width), (double)y, 0.0D, (double)((u + (float)width) * f4), (double)(v * f5)); + tessellator.addVertexWithUV((double)x, (double)y, 0.0D, (double)(u * f4), (double)(v * f5)); + tessellator.draw(); + } + + public static void func_152125_a(int x, int y, float u, float v, int uWidth, int vHeight, int width, int height, float tileWidth, float tileHeight) + { + float f4 = 1.0F / tileWidth; + float f5 = 1.0F / tileHeight; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)x, (double)(y + height), 0.0D, (double)(u * f4), (double)((v + (float)vHeight) * f5)); + tessellator.addVertexWithUV((double)(x + width), (double)(y + height), 0.0D, (double)((u + (float)uWidth) * f4), (double)((v + (float)vHeight) * f5)); + tessellator.addVertexWithUV((double)(x + width), (double)y, 0.0D, (double)((u + (float)uWidth) * f4), (double)(v * f5)); + tessellator.addVertexWithUV((double)x, (double)y, 0.0D, (double)(u * f4), (double)(v * f5)); + tessellator.draw(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButton.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButton.java new file mode 100644 index 0000000..1b6f872 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButton.java @@ -0,0 +1,151 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiButton extends Gui +{ + protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); + /** Button width in pixels */ + public int width; + /** Button height in pixels */ + public int height; + /** The x position of this control. */ + public int xPosition; + /** The y position of this control. */ + public int yPosition; + /** The string displayed on this control. */ + public String displayString; + public int id; + /** True if this control is enabled, false to disable. */ + public boolean enabled; + /** Hides the button completely if false. */ + public boolean visible; + protected boolean field_146123_n; + private static final String __OBFID = "CL_00000668"; + public int packedFGColour; + + public GuiButton(int buttonId, int x, int y, String buttonText) + { + this(buttonId, x, y, 200, 20, buttonText); + } + + public GuiButton(int stateName, int id, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) + { + this.width = 200; + this.height = 20; + this.enabled = true; + this.visible = true; + this.id = stateName; + this.xPosition = id; + this.yPosition = p_i1021_3_; + this.width = p_i1021_4_; + this.height = p_i1021_5_; + this.displayString = p_i1021_6_; + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over + * this button. + */ + public int getHoverState(boolean mouseOver) + { + byte b0 = 1; + + if (!this.enabled) + { + b0 = 0; + } + else if (mouseOver) + { + b0 = 2; + } + + return b0; + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + FontRenderer fontrenderer = mc.fontRenderer; + mc.getTextureManager().bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.field_146123_n); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); + this.mouseDragged(mc, mouseX, mouseY); + int l = 14737632; + + if (packedFGColour != 0) + { + l = packedFGColour; + } + else if (!this.enabled) + { + l = 10526880; + } + else if (this.field_146123_n) + { + l = 16777120; + } + + this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l); + } + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) {} + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int mouseX, int mouseY) {} + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + return this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + } + + public boolean func_146115_a() + { + return this.field_146123_n; + } + + public void func_146111_b(int mouseX, int mouseY) {} + + public void func_146113_a(SoundHandler soundHandlerIn) + { + soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + + public int getButtonWidth() + { + return this.width; + } + + public int func_154310_c() + { + return this.height; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonLanguage.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonLanguage.java new file mode 100644 index 0000000..1703e2b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonLanguage.java @@ -0,0 +1,38 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiButtonLanguage extends GuiButton +{ + private static final String __OBFID = "CL_00000672"; + + public GuiButtonLanguage(int p_i1041_1_, int p_i1041_2_, int p_i1041_3_) + { + super(p_i1041_1_, p_i1041_2_, p_i1041_3_, 20, 20, ""); + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiButton.buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = 106; + + if (flag) + { + k += this.height; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, k, this.width, this.height); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java new file mode 100644 index 0000000..36a1b2d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiButtonRealmsProxy.java @@ -0,0 +1,104 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.realms.RealmsButton; + +@SideOnly(Side.CLIENT) +public class GuiButtonRealmsProxy extends GuiButton +{ + private RealmsButton field_154318_o; + private static final String __OBFID = "CL_00001848"; + + public GuiButtonRealmsProxy(RealmsButton p_i1089_1_, int p_i1089_2_, int p_i1089_3_, int p_i1089_4_, String p_i1089_5_) + { + super(p_i1089_2_, p_i1089_3_, p_i1089_4_, p_i1089_5_); + this.field_154318_o = p_i1089_1_; + } + + public GuiButtonRealmsProxy(RealmsButton p_i1090_1_, int p_i1090_2_, int p_i1090_3_, int p_i1090_4_, String p_i1090_5_, int p_i1090_6_, int p_i1090_7_) + { + super(p_i1090_2_, p_i1090_3_, p_i1090_4_, p_i1090_6_, p_i1090_7_, p_i1090_5_); + this.field_154318_o = p_i1090_1_; + } + + public int func_154314_d() + { + return super.id; + } + + public boolean func_154315_e() + { + return super.enabled; + } + + public void func_154313_b(boolean p_154313_1_) + { + super.enabled = p_154313_1_; + } + + public void func_154311_a(String p_154311_1_) + { + super.displayString = p_154311_1_; + } + + public int getButtonWidth() + { + return super.getButtonWidth(); + } + + public int func_154316_f() + { + return super.yPosition; + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.field_154318_o.clicked(mouseX, mouseY); + } + + return super.mousePressed(mc, mouseX, mouseY); + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int mouseX, int mouseY) + { + this.field_154318_o.released(mouseX, mouseY); + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + public void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + this.field_154318_o.renderBg(mouseX, mouseY); + } + + public RealmsButton func_154317_g() + { + return this.field_154318_o; + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over + * this button. + */ + public int getHoverState(boolean mouseOver) + { + return this.field_154318_o.getYImage(mouseOver); + } + + public int func_154312_c(boolean p_154312_1_) + { + return super.getHoverState(p_154312_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiChat.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiChat.java new file mode 100644 index 0000000..9c8d31b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiChat.java @@ -0,0 +1,535 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.client.gui.stream.GuiTwitchUserMode; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import tv.twitch.chat.ChatUserInfo; + +@SideOnly(Side.CLIENT) +public class GuiChat extends GuiScreen implements GuiYesNoCallback +{ + private static final Set field_152175_f = Sets.newHashSet(new String[] {"http", "https"}); + private static final Logger logger = LogManager.getLogger(); + private String field_146410_g = ""; + /** + * keeps position of which chat message you will select when you press up, (does not increase for duplicated + * messages sent immediately after each other) + */ + private int sentHistoryCursor = -1; + private boolean field_146417_i; + private boolean field_146414_r; + private int field_146413_s; + private List field_146412_t = new ArrayList(); + /** used to pass around the URI to various dialogues and to the host os */ + private URI clickedURI; + /** Chat entry field */ + protected GuiTextField inputField; + /** is the text that appears when you press the chat key and the input box appears pre-filled */ + private String defaultInputFieldText = ""; + private static final String __OBFID = "CL_00000682"; + + public GuiChat() {} + + public GuiChat(String p_i1024_1_) + { + this.defaultInputFieldText = p_i1024_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); + this.inputField = new GuiTextField(this.fontRendererObj, 4, this.height - 12, this.width - 4, 12); + this.inputField.setMaxStringLength(100); + this.inputField.setEnableBackgroundDrawing(false); + this.inputField.setFocused(true); + this.inputField.setText(this.defaultInputFieldText); + this.inputField.setCanLoseFocus(false); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.inputField.updateCursorCounter(); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + this.field_146414_r = false; + + if (keyCode == 15) + { + this.func_146404_p_(); + } + else + { + this.field_146417_i = false; + } + + if (keyCode == 1) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (keyCode != 28 && keyCode != 156) + { + if (keyCode == 200) + { + this.getSentHistory(-1); + } + else if (keyCode == 208) + { + this.getSentHistory(1); + } + else if (keyCode == 201) + { + this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().func_146232_i() - 1); + } + else if (keyCode == 209) + { + this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().func_146232_i() + 1); + } + else + { + this.inputField.textboxKeyTyped(typedChar, keyCode); + } + } + else + { + String s = this.inputField.getText().trim(); + + if (s.length() > 0) + { + this.func_146403_a(s); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + public void func_146403_a(String p_146403_1_) + { + this.mc.ingameGUI.getChatGUI().addToSentMessages(p_146403_1_); + if (net.minecraftforge.client.ClientCommandHandler.instance.executeCommand(mc.thePlayer, p_146403_1_) != 0) return; + this.mc.thePlayer.sendChatMessage(p_146403_1_); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() + { + super.handleMouseInput(); + int i = Mouse.getEventDWheel(); + + if (i != 0) + { + if (i > 1) + { + i = 1; + } + + if (i < -1) + { + i = -1; + } + + if (!isShiftKeyDown()) + { + i *= 7; + } + + this.mc.ingameGUI.getChatGUI().scroll(i); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + if (mouseButton == 0 && this.mc.gameSettings.chatLinks) + { + IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().func_146236_a(Mouse.getX(), Mouse.getY()); + + if (ichatcomponent != null) + { + ClickEvent clickevent = ichatcomponent.getChatStyle().getChatClickEvent(); + + if (clickevent != null) + { + if (isShiftKeyDown()) + { + this.inputField.writeText(ichatcomponent.getUnformattedTextForChat()); + } + else + { + URI uri; + + if (clickevent.getAction() == ClickEvent.Action.OPEN_URL) + { + try + { + uri = new URI(clickevent.getValue()); + + if (!field_152175_f.contains(uri.getScheme().toLowerCase())) + { + throw new URISyntaxException(clickevent.getValue(), "Unsupported protocol: " + uri.getScheme().toLowerCase()); + } + + if (this.mc.gameSettings.chatLinksPrompt) + { + this.clickedURI = uri; + this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, clickevent.getValue(), 0, false)); + } + else + { + this.func_146407_a(uri); + } + } + catch (URISyntaxException urisyntaxexception) + { + logger.error("Can\'t open url for " + clickevent, urisyntaxexception); + } + } + else if (clickevent.getAction() == ClickEvent.Action.OPEN_FILE) + { + uri = (new File(clickevent.getValue())).toURI(); + this.func_146407_a(uri); + } + else if (clickevent.getAction() == ClickEvent.Action.SUGGEST_COMMAND) + { + this.inputField.setText(clickevent.getValue()); + } + else if (clickevent.getAction() == ClickEvent.Action.RUN_COMMAND) + { + this.func_146403_a(clickevent.getValue()); + } + else if (clickevent.getAction() == ClickEvent.Action.TWITCH_USER_INFO) + { + ChatUserInfo chatuserinfo = this.mc.func_152346_Z().func_152926_a(clickevent.getValue()); + + if (chatuserinfo != null) + { + this.mc.displayGuiScreen(new GuiTwitchUserMode(this.mc.func_152346_Z(), chatuserinfo)); + } + else + { + logger.error("Tried to handle twitch user but couldn\'t find them!"); + } + } + else + { + logger.error("Don\'t know how to handle " + clickevent); + } + } + + return; + } + } + } + + this.inputField.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + public void confirmClicked(boolean result, int id) + { + if (id == 0) + { + if (result) + { + this.func_146407_a(this.clickedURI); + } + + this.clickedURI = null; + this.mc.displayGuiScreen(this); + } + } + + private void func_146407_a(URI p_146407_1_) + { + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {p_146407_1_}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + } + } + + public void func_146404_p_() + { + String s1; + + if (this.field_146417_i) + { + this.inputField.deleteFromCursor(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); + + if (this.field_146413_s >= this.field_146412_t.size()) + { + this.field_146413_s = 0; + } + } + else + { + int i = this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false); + this.field_146412_t.clear(); + this.field_146413_s = 0; + String s = this.inputField.getText().substring(i).toLowerCase(); + s1 = this.inputField.getText().substring(0, this.inputField.getCursorPosition()); + this.func_146405_a(s1, s); + + if (this.field_146412_t.isEmpty()) + { + return; + } + + this.field_146417_i = true; + this.inputField.deleteFromCursor(i - this.inputField.getCursorPosition()); + } + + if (this.field_146412_t.size() > 1) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (Iterator iterator = this.field_146412_t.iterator(); iterator.hasNext(); stringbuilder.append(s1)) + { + s1 = (String)iterator.next(); + + if (stringbuilder.length() > 0) + { + stringbuilder.append(", "); + } + } + + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText(stringbuilder.toString()), 1); + } + + this.inputField.writeText(EnumChatFormatting.getTextWithoutFormattingCodes((String)this.field_146412_t.get(this.field_146413_s++))); + } + + private void func_146405_a(String p_146405_1_, String p_146405_2_) + { + if (p_146405_1_.length() >= 1) + { + net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); + this.mc.thePlayer.sendQueue.addToSendQueue(new C14PacketTabComplete(p_146405_1_)); + this.field_146414_r = true; + } + } + + /** + * input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next + * message from the current cursor position + */ + public void getSentHistory(int p_146402_1_) + { + int j = this.sentHistoryCursor + p_146402_1_; + int k = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); + + if (j < 0) + { + j = 0; + } + + if (j > k) + { + j = k; + } + + if (j != this.sentHistoryCursor) + { + if (j == k) + { + this.sentHistoryCursor = k; + this.inputField.setText(this.field_146410_g); + } + else + { + if (this.sentHistoryCursor == k) + { + this.field_146410_g = this.inputField.getText(); + } + + this.inputField.setText((String)this.mc.ingameGUI.getChatGUI().getSentMessages().get(j)); + this.sentHistoryCursor = j; + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); + this.inputField.drawTextBox(); + IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().func_146236_a(Mouse.getX(), Mouse.getY()); + + if (ichatcomponent != null && ichatcomponent.getChatStyle().getChatHoverEvent() != null) + { + HoverEvent hoverevent = ichatcomponent.getChatStyle().getChatHoverEvent(); + + if (hoverevent.getAction() == HoverEvent.Action.SHOW_ITEM) + { + ItemStack itemstack = null; + + try + { + NBTBase nbtbase = JsonToNBT.func_150315_a(hoverevent.getValue().getUnformattedText()); + + if (nbtbase != null && nbtbase instanceof NBTTagCompound) + { + itemstack = ItemStack.loadItemStackFromNBT((NBTTagCompound)nbtbase); + } + } + catch (NBTException nbtexception) + { + ; + } + + if (itemstack != null) + { + this.renderToolTip(itemstack, mouseX, mouseY); + } + else + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid Item!", mouseX, mouseY); + } + } + else if (hoverevent.getAction() == HoverEvent.Action.SHOW_TEXT) + { + this.func_146283_a(Splitter.on("\n").splitToList(hoverevent.getValue().getFormattedText()), mouseX, mouseY); + } + else if (hoverevent.getAction() == HoverEvent.Action.SHOW_ACHIEVEMENT) + { + StatBase statbase = StatList.func_151177_a(hoverevent.getValue().getUnformattedText()); + + if (statbase != null) + { + IChatComponent ichatcomponent1 = statbase.func_150951_e(); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("stats.tooltip.type." + (statbase.isAchievement() ? "achievement" : "statistic"), new Object[0]); + chatcomponenttranslation.getChatStyle().setItalic(Boolean.valueOf(true)); + String s = statbase instanceof Achievement ? ((Achievement)statbase).getDescription() : null; + ArrayList arraylist = Lists.newArrayList(new String[] {ichatcomponent1.getFormattedText(), chatcomponenttranslation.getFormattedText()}); + + if (s != null) + { + arraylist.addAll(this.fontRendererObj.listFormattedStringToWidth(s, 150)); + } + + this.func_146283_a(arraylist, mouseX, mouseY); + } + else + { + this.drawCreativeTabHoveringText(EnumChatFormatting.RED + "Invalid statistic/achievement!", mouseX, mouseY); + } + } + + GL11.glDisable(GL11.GL_LIGHTING); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void func_146406_a(String[] p_146406_1_) + { + if (this.field_146414_r) + { + this.field_146417_i = false; + this.field_146412_t.clear(); + String[] astring1 = p_146406_1_; + int i = p_146406_1_.length; + + String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; + if (complete != null) + { + astring1 = com.google.common.collect.ObjectArrays.concat(complete, astring1, String.class); + i = astring1.length; + } + + for (int j = 0; j < i; ++j) + { + String s = astring1[j]; + + if (s.length() > 0) + { + this.field_146412_t.add(s); + } + } + + String s1 = this.inputField.getText().substring(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false)); + String s2 = StringUtils.getCommonPrefix(p_146406_1_); + + if (s2.length() > 0 && !s1.equalsIgnoreCase(s2)) + { + this.inputField.deleteFromCursor(this.inputField.func_146197_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); + this.inputField.writeText(s2); + } + else if (this.field_146412_t.size() > 0) + { + this.field_146417_i = true; + this.func_146404_p_(); + } + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCommandBlock.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCommandBlock.java new file mode 100644 index 0000000..aaace2d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCommandBlock.java @@ -0,0 +1,168 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.Unpooled; +import net.minecraft.client.resources.I18n; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiCommandBlock extends GuiScreen +{ + private static final Logger field_146488_a = LogManager.getLogger(); + /** Text field containing the command block's command. */ + private GuiTextField commandTextField; + private GuiTextField field_146486_g; + /** Command block being edited. */ + private final CommandBlockLogic localCommandBlock; + /** "Done" button for the GUI. */ + private GuiButton doneBtn; + private GuiButton cancelBtn; + private static final String __OBFID = "CL_00000748"; + + public GuiCommandBlock(CommandBlockLogic p_i45032_1_) + { + this.localCommandBlock = p_i45032_1_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.commandTextField.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 4 - 150, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 + 4, this.height / 4 + 120 + 12, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.commandTextField = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 50, 300, 20); + this.commandTextField.setMaxStringLength(32767); + this.commandTextField.setFocused(true); + this.commandTextField.setText(this.localCommandBlock.func_145753_i()); + this.field_146486_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 135, 300, 20); + this.field_146486_g.setMaxStringLength(32767); + this.field_146486_g.setEnabled(false); + this.field_146486_g.setText(this.localCommandBlock.func_145753_i()); + + if (this.localCommandBlock.func_145749_h() != null) + { + this.field_146486_g.setText(this.localCommandBlock.func_145749_h().getUnformattedText()); + } + + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == 0) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + + try + { + packetbuffer.writeByte(this.localCommandBlock.func_145751_f()); + this.localCommandBlock.func_145757_a(packetbuffer); + packetbuffer.writeStringToBuffer(this.commandTextField.getText()); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|AdvCdm", packetbuffer)); + } + catch (Exception exception) + { + field_146488_a.error("Couldn\'t send command block info", exception); + } + finally + { + packetbuffer.release(); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + this.commandTextField.textboxKeyTyped(typedChar, keyCode); + this.field_146486_g.textboxKeyTyped(typedChar, keyCode); + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; + + if (keyCode != 28 && keyCode != 156) + { + if (keyCode == 1) + { + this.actionPerformed(this.cancelBtn); + } + } + else + { + this.actionPerformed(this.doneBtn); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.commandTextField.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146486_g.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("advMode.setCommand", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("advMode.command", new Object[0]), this.width / 2 - 150, 37, 10526880); + this.commandTextField.drawTextBox(); + byte b0 = 75; + byte b1 = 0; + FontRenderer fontrenderer = this.fontRendererObj; + String s = I18n.format("advMode.nearestPlayer", new Object[0]); + int i1 = this.width / 2 - 150; + int l = b1 + 1; + this.drawString(fontrenderer, s, i1, b0 + b1 * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.randomPlayer", new Object[0]), this.width / 2 - 150, b0 + l++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + this.drawString(this.fontRendererObj, I18n.format("advMode.allPlayers", new Object[0]), this.width / 2 - 150, b0 + l++ * this.fontRendererObj.FONT_HEIGHT, 10526880); + + if (this.field_146486_g.getText().length() > 0) + { + int k = b0 + l * this.fontRendererObj.FONT_HEIGHT + 20; + this.drawString(this.fontRendererObj, I18n.format("advMode.previousOutput", new Object[0]), this.width / 2 - 150, k, 10526880); + this.field_146486_g.drawTextBox(); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiConfirmOpenLink.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiConfirmOpenLink.java new file mode 100644 index 0000000..63b6812 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiConfirmOpenLink.java @@ -0,0 +1,73 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiConfirmOpenLink extends GuiYesNo +{ + /** Text to warn players from opening unsafe links. */ + private final String openLinkWarning; + /** Label for the Copy to Clipboard button. */ + private final String copyLinkButtonText; + private final String field_146361_t; + private boolean field_146360_u = true; + private static final String __OBFID = "CL_00000683"; + + public GuiConfirmOpenLink(GuiYesNoCallback p_i1084_1_, String p_i1084_2_, int p_i1084_3_, boolean p_i1084_4_) + { + super(p_i1084_1_, I18n.format(p_i1084_4_ ? "chat.link.confirmTrusted" : "chat.link.confirm", new Object[0]), p_i1084_2_, p_i1084_3_); + this.confirmButtonText = I18n.format(p_i1084_4_ ? "chat.link.open" : "gui.yes", new Object[0]); + this.cancelButtonText = I18n.format(p_i1084_4_ ? "gui.cancel" : "gui.no", new Object[0]); + this.copyLinkButtonText = I18n.format("chat.copy", new Object[0]); + this.openLinkWarning = I18n.format("chat.link.warning", new Object[0]); + this.field_146361_t = p_i1084_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.confirmButtonText)); + this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText)); + this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.cancelButtonText)); + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 2) + { + this.copyLinkToClipboard(); + } + + this.parentScreen.confirmClicked(button.id == 0, this.field_146357_i); + } + + /** + * Copies the link to the system clipboard. + */ + public void copyLinkToClipboard() + { + setClipboardString(this.field_146361_t); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.field_146360_u) + { + this.drawCenteredString(this.fontRendererObj, this.openLinkWarning, this.width / 2, 110, 16764108); + } + } + + public void func_146358_g() + { + this.field_146360_u = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiControls.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiControls.java new file mode 100644 index 0000000..59fa981 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiControls.java @@ -0,0 +1,169 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; + +@SideOnly(Side.CLIENT) +public class GuiControls extends GuiScreen +{ + private static final GameSettings.Options[] field_146492_g = new GameSettings.Options[] {GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN}; + /** A reference to the screen object that created this. Used for navigating between screens. */ + private GuiScreen parentScreen; + protected String field_146495_a = "Controls"; + /** Reference to the GameSettings object. */ + private GameSettings options; + /** The ID of the button that has been pressed. */ + public KeyBinding buttonId = null; + public long field_152177_g; + private GuiKeyBindingList keyBindingList; + private GuiButton field_146493_s; + private static final String __OBFID = "CL_00000736"; + + public GuiControls(GuiScreen p_i1027_1_, GameSettings p_i1027_2_) + { + this.parentScreen = p_i1027_1_; + this.options = p_i1027_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.keyBindingList = new GuiKeyBindingList(this, this.mc); + this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height - 29, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.field_146493_s = new GuiButton(201, this.width / 2 - 155 + 160, this.height - 29, 150, 20, I18n.format("controls.resetAll", new Object[0]))); + this.field_146495_a = I18n.format("controls.title", new Object[0]); + int i = 0; + GameSettings.Options[] aoptions = field_146492_g; + int j = aoptions.length; + + for (int k = 0; k < j; ++k) + { + GameSettings.Options options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), options)); + } + else + { + this.buttonList.add(new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), options, this.options.getKeyBinding(options))); + } + + ++i; + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 200) + { + this.mc.displayGuiScreen(this.parentScreen); + } + else if (button.id == 201) + { + KeyBinding[] akeybinding = this.mc.gameSettings.keyBindings; + int i = akeybinding.length; + + for (int j = 0; j < i; ++j) + { + KeyBinding keybinding = akeybinding[j]; + keybinding.setKeyCode(keybinding.getKeyCodeDefault()); + } + + KeyBinding.resetKeyBindingArrayAndHash(); + } + else if (button.id < 100 && button instanceof GuiOptionButton) + { + this.options.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + if (this.buttonId != null) + { + this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton); + this.buttonId = null; + KeyBinding.resetKeyBindingArrayAndHash(); + } + else if (mouseButton != 0 || !this.keyBindingList.func_148179_a(mouseX, mouseY, mouseButton)) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + if (state != 0 || !this.keyBindingList.func_148181_b(mouseX, mouseY, state)) + { + super.mouseMovedOrUp(mouseX, mouseY, state); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (this.buttonId != null) + { + if (keyCode == 1) + { + this.options.setOptionKeyBinding(this.buttonId, 0); + } + else + { + this.options.setOptionKeyBinding(this.buttonId, keyCode); + } + + this.buttonId = null; + this.field_152177_g = Minecraft.getSystemTime(); + KeyBinding.resetKeyBindingArrayAndHash(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.keyBindingList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146495_a, this.width / 2, 8, 16777215); + boolean flag = true; + KeyBinding[] akeybinding = this.options.keyBindings; + int k = akeybinding.length; + + for (int l = 0; l < k; ++l) + { + KeyBinding keybinding = akeybinding[l]; + + if (keybinding.getKeyCode() != keybinding.getKeyCodeDefault()) + { + flag = false; + break; + } + } + + this.field_146493_s.enabled = !flag; + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateFlatWorld.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateFlatWorld.java new file mode 100644 index 0000000..f1a3b9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateFlatWorld.java @@ -0,0 +1,227 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiCreateFlatWorld extends GuiScreen +{ + private static RenderItem field_146392_a = new RenderItem(); + private final GuiCreateWorld createWorldGui; + private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); + private String field_146393_h; + private String field_146394_i; + private String field_146391_r; + private GuiCreateFlatWorld.Details createFlatWorldListSlotGui; + private GuiButton field_146389_t; + private GuiButton field_146388_u; + private GuiButton field_146386_v; + private static final String __OBFID = "CL_00000687"; + + public GuiCreateFlatWorld(GuiCreateWorld p_i1029_1_, String p_i1029_2_) + { + this.createWorldGui = p_i1029_1_; + this.func_146383_a(p_i1029_2_); + } + + public String func_146384_e() + { + return this.theFlatGeneratorInfo.toString(); + } + + public void func_146383_a(String p_146383_1_) + { + this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_146383_1_); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + this.field_146393_h = I18n.format("createWorld.customize.flat.title", new Object[0]); + this.field_146394_i = I18n.format("createWorld.customize.flat.tile", new Object[0]); + this.field_146391_r = I18n.format("createWorld.customize.flat.height", new Object[0]); + this.createFlatWorldListSlotGui = new GuiCreateFlatWorld.Details(); + this.buttonList.add(this.field_146389_t = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.addLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146388_u = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("createWorld.customize.flat.editLayer", new Object[0]) + " (NYI)")); + this.buttonList.add(this.field_146386_v = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.format("createWorld.customize.flat.removeLayer", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.format("createWorld.customize.presets", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.field_146389_t.visible = this.field_146388_u.visible = false; + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + protected void actionPerformed(GuiButton button) + { + int i = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_148228_k - 1; + + if (button.id == 1) + { + this.mc.displayGuiScreen(this.createWorldGui); + } + else if (button.id == 0) + { + this.createWorldGui.field_146334_a = this.func_146384_e(); + this.mc.displayGuiScreen(this.createWorldGui); + } + else if (button.id == 5) + { + this.mc.displayGuiScreen(new GuiFlatPresets(this)); + } + else if (button.id == 4 && this.func_146382_i()) + { + this.theFlatGeneratorInfo.getFlatLayers().remove(i); + this.createFlatWorldListSlotGui.field_148228_k = Math.min(this.createFlatWorldListSlotGui.field_148228_k, this.theFlatGeneratorInfo.getFlatLayers().size() - 1); + } + + this.theFlatGeneratorInfo.func_82645_d(); + this.func_146375_g(); + } + + public void func_146375_g() + { + boolean flag = this.func_146382_i(); + this.field_146386_v.enabled = flag; + this.field_146388_u.enabled = flag; + this.field_146388_u.enabled = false; + this.field_146389_t.enabled = false; + } + + private boolean func_146382_i() + { + return this.createFlatWorldListSlotGui.field_148228_k > -1 && this.createFlatWorldListSlotGui.field_148228_k < this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.createFlatWorldListSlotGui.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146393_h, this.width / 2, 8, 16777215); + int k = this.width / 2 - 92 - 16; + this.drawString(this.fontRendererObj, this.field_146394_i, k, 32, 16777215); + this.drawString(this.fontRendererObj, this.field_146391_r, k + 2 + 213 - this.fontRendererObj.getStringWidth(this.field_146391_r), 32, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SideOnly(Side.CLIENT) + class Details extends GuiSlot + { + public int field_148228_k = -1; + private static final String __OBFID = "CL_00000688"; + + public Details() + { + super(GuiCreateFlatWorld.this.mc, GuiCreateFlatWorld.this.width, GuiCreateFlatWorld.this.height, 43, GuiCreateFlatWorld.this.height - 60, 24); + } + + private void func_148225_a(int p_148225_1_, int p_148225_2_, ItemStack p_148225_3_) + { + this.func_148226_e(p_148225_1_ + 1, p_148225_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + + if (p_148225_3_ != null) + { + RenderHelper.enableGUIStandardItemLighting(); + GuiCreateFlatWorld.field_146392_a.renderItemIntoGUI(GuiCreateFlatWorld.this.fontRendererObj, GuiCreateFlatWorld.this.mc.getTextureManager(), p_148225_3_, p_148225_1_ + 2, p_148225_2_ + 2); + RenderHelper.disableStandardItemLighting(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private void func_148226_e(int p_148226_1_, int p_148226_2_) + { + this.func_148224_c(p_148226_1_, p_148226_2_, 0, 0); + } + + private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiCreateFlatWorld.this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel, (double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel, (double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel, (double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel, (double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)); + tessellator.draw(); + } + + protected int getSize() + { + return GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + this.field_148228_k = p_148144_1_; + GuiCreateFlatWorld.this.func_146375_g(); + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return p_148131_1_ == this.field_148228_k; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + FlatLayerInfo flatlayerinfo = (FlatLayerInfo)GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - p_148126_1_ - 1); + Item item = Item.getItemFromBlock(flatlayerinfo.func_151536_b()); + ItemStack itemstack = flatlayerinfo.func_151536_b() == Blocks.air ? null : new ItemStack(item, 1, flatlayerinfo.getFillBlockMeta()); + String s = itemstack != null && item != null ? item.getItemStackDisplayName(itemstack) : "Air"; + this.func_148225_a(p_148126_2_, p_148126_3_, itemstack); + GuiCreateFlatWorld.this.fontRendererObj.drawString(s, p_148126_2_ + 18 + 5, p_148126_3_ + 3, 16777215); + String s1; + + if (p_148126_1_ == 0) + { + s1 = I18n.format("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + else if (p_148126_1_ == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1) + { + s1 = I18n.format("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + else + { + s1 = I18n.format("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())}); + } + + GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, p_148126_2_ + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), p_148126_3_ + 3, 16777215); + } + + protected int getScrollBarX() + { + return this.width - 70; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateWorld.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateWorld.java new file mode 100644 index 0000000..9897afe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiCreateWorld.java @@ -0,0 +1,459 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiCreateWorld extends GuiScreen +{ + private GuiScreen field_146332_f; + private GuiTextField field_146333_g; + private GuiTextField field_146335_h; + private String field_146336_i; + private String field_146342_r = "survival"; + private boolean field_146341_s = true; + private boolean field_146340_t; + private boolean field_146339_u; + private boolean field_146338_v; + private boolean field_146337_w; + private boolean field_146345_x; + private boolean field_146344_y; + private GuiButton field_146343_z; + private GuiButton field_146324_A; + private GuiButton field_146325_B; + private GuiButton field_146326_C; + private GuiButton field_146320_D; + private GuiButton field_146321_E; + private GuiButton field_146322_F; + private String field_146323_G; + private String field_146328_H; + private String field_146329_I; + private String field_146330_J; + private int field_146331_K; + public String field_146334_a = ""; + private static final String[] field_146327_L = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; + private static final String __OBFID = "CL_00000689"; + + public GuiCreateWorld(GuiScreen p_i1030_1_) + { + this.field_146332_f = p_i1030_1_; + this.field_146329_I = ""; + this.field_146330_J = I18n.format("selectWorld.newWorld", new Object[0]); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_146333_g.updateCursorCounter(); + this.field_146335_h.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.field_146343_z = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.format("selectWorld.gameMode", new Object[0]))); + this.buttonList.add(this.field_146324_A = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.format("selectWorld.moreWorldOptions", new Object[0]))); + this.buttonList.add(this.field_146325_B = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.mapFeatures", new Object[0]))); + this.field_146325_B.visible = false; + this.buttonList.add(this.field_146326_C = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.format("selectWorld.bonusItems", new Object[0]))); + this.field_146326_C.visible = false; + this.buttonList.add(this.field_146320_D = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.mapType", new Object[0]))); + this.field_146320_D.visible = false; + this.buttonList.add(this.field_146321_E = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.format("selectWorld.allowCommands", new Object[0]))); + this.field_146321_E.visible = false; + this.buttonList.add(this.field_146322_F = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.format("selectWorld.customizeType", new Object[0]))); + this.field_146322_F.visible = false; + this.field_146333_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146333_g.setFocused(true); + this.field_146333_g.setText(this.field_146330_J); + this.field_146335_h = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146335_h.setText(this.field_146329_I); + this.func_146316_a(this.field_146344_y); + this.func_146314_g(); + this.func_146319_h(); + } + + private void func_146314_g() + { + this.field_146336_i = this.field_146333_g.getText().trim(); + char[] achar = ChatAllowedCharacters.allowedCharacters; + int i = achar.length; + + for (int j = 0; j < i; ++j) + { + char c0 = achar[j]; + this.field_146336_i = this.field_146336_i.replace(c0, '_'); + } + + if (MathHelper.stringNullOrLengthZero(this.field_146336_i)) + { + this.field_146336_i = "World"; + } + + this.field_146336_i = func_146317_a(this.mc.getSaveLoader(), this.field_146336_i); + } + + private void func_146319_h() + { + this.field_146343_z.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + " " + I18n.format("selectWorld.gameMode." + this.field_146342_r, new Object[0]); + this.field_146323_G = I18n.format("selectWorld.gameMode." + this.field_146342_r + ".line1", new Object[0]); + this.field_146328_H = I18n.format("selectWorld.gameMode." + this.field_146342_r + ".line2", new Object[0]); + this.field_146325_B.displayString = I18n.format("selectWorld.mapFeatures", new Object[0]) + " "; + + if (this.field_146341_s) + { + this.field_146325_B.displayString = this.field_146325_B.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.field_146325_B.displayString = this.field_146325_B.displayString + I18n.format("options.off", new Object[0]); + } + + this.field_146326_C.displayString = I18n.format("selectWorld.bonusItems", new Object[0]) + " "; + + if (this.field_146338_v && !this.field_146337_w) + { + this.field_146326_C.displayString = this.field_146326_C.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.field_146326_C.displayString = this.field_146326_C.displayString + I18n.format("options.off", new Object[0]); + } + + this.field_146320_D.displayString = I18n.format("selectWorld.mapType", new Object[0]) + " " + I18n.format(WorldType.worldTypes[this.field_146331_K].getTranslateName(), new Object[0]); + this.field_146321_E.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " "; + + if (this.field_146340_t && !this.field_146337_w) + { + this.field_146321_E.displayString = this.field_146321_E.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.field_146321_E.displayString = this.field_146321_E.displayString + I18n.format("options.off", new Object[0]); + } + } + + public static String func_146317_a(ISaveFormat p_146317_0_, String p_146317_1_) + { + p_146317_1_ = p_146317_1_.replaceAll("[\\./\"]", "_"); + String[] astring = field_146327_L; + int i = astring.length; + + for (int j = 0; j < i; ++j) + { + String s1 = astring[j]; + + if (p_146317_1_.equalsIgnoreCase(s1)) + { + p_146317_1_ = "_" + p_146317_1_ + "_"; + } + } + + while (p_146317_0_.getWorldInfo(p_146317_1_) != null) + { + p_146317_1_ = p_146317_1_ + "-"; + } + + return p_146317_1_; + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_146332_f); + } + else if (button.id == 0) + { + this.mc.displayGuiScreen((GuiScreen)null); + + if (this.field_146345_x) + { + return; + } + + this.field_146345_x = true; + long i = (new Random()).nextLong(); + String s = this.field_146335_h.getText(); + + if (!MathHelper.stringNullOrLengthZero(s)) + { + try + { + long j = Long.parseLong(s); + + if (j != 0L) + { + i = j; + } + } + catch (NumberFormatException numberformatexception) + { + i = (long)s.hashCode(); + } + } + + WorldType.worldTypes[this.field_146331_K].onGUICreateWorldPress(); + + WorldSettings.GameType gametype = WorldSettings.GameType.getByName(this.field_146342_r); + WorldSettings worldsettings = new WorldSettings(i, gametype, this.field_146341_s, this.field_146337_w, WorldType.worldTypes[this.field_146331_K]); + worldsettings.func_82750_a(this.field_146334_a); + + if (this.field_146338_v && !this.field_146337_w) + { + worldsettings.enableBonusChest(); + } + + if (this.field_146340_t && !this.field_146337_w) + { + worldsettings.enableCommands(); + } + + this.mc.launchIntegratedServer(this.field_146336_i, this.field_146333_g.getText().trim(), worldsettings); + } + else if (button.id == 3) + { + this.func_146315_i(); + } + else if (button.id == 2) + { + if (this.field_146342_r.equals("survival")) + { + if (!this.field_146339_u) + { + this.field_146340_t = false; + } + + this.field_146337_w = false; + this.field_146342_r = "hardcore"; + this.field_146337_w = true; + this.field_146321_E.enabled = false; + this.field_146326_C.enabled = false; + this.func_146319_h(); + } + else if (this.field_146342_r.equals("hardcore")) + { + if (!this.field_146339_u) + { + this.field_146340_t = true; + } + + this.field_146337_w = false; + this.field_146342_r = "creative"; + this.func_146319_h(); + this.field_146337_w = false; + this.field_146321_E.enabled = true; + this.field_146326_C.enabled = true; + } + else + { + if (!this.field_146339_u) + { + this.field_146340_t = false; + } + + this.field_146342_r = "survival"; + this.func_146319_h(); + this.field_146321_E.enabled = true; + this.field_146326_C.enabled = true; + this.field_146337_w = false; + } + + this.func_146319_h(); + } + else if (button.id == 4) + { + this.field_146341_s = !this.field_146341_s; + this.func_146319_h(); + } + else if (button.id == 7) + { + this.field_146338_v = !this.field_146338_v; + this.func_146319_h(); + } + else if (button.id == 5) + { + ++this.field_146331_K; + + if (this.field_146331_K >= WorldType.worldTypes.length) + { + this.field_146331_K = 0; + } + + while (WorldType.worldTypes[this.field_146331_K] == null || !WorldType.worldTypes[this.field_146331_K].getCanBeCreated()) + { + ++this.field_146331_K; + + if (this.field_146331_K >= WorldType.worldTypes.length) + { + this.field_146331_K = 0; + } + } + + this.field_146334_a = ""; + this.func_146319_h(); + this.func_146316_a(this.field_146344_y); + } + else if (button.id == 6) + { + this.field_146339_u = true; + this.field_146340_t = !this.field_146340_t; + this.func_146319_h(); + } + else if (button.id == 8) + { + WorldType.worldTypes[field_146331_K].onCustomizeButton(mc, this); + } + } + } + + private void func_146315_i() + { + this.func_146316_a(!this.field_146344_y); + } + + private void func_146316_a(boolean p_146316_1_) + { + this.field_146344_y = p_146316_1_; + this.field_146343_z.visible = !this.field_146344_y; + this.field_146325_B.visible = this.field_146344_y; + this.field_146326_C.visible = this.field_146344_y; + this.field_146320_D.visible = this.field_146344_y; + this.field_146321_E.visible = this.field_146344_y; + this.field_146322_F.visible = this.field_146344_y && WorldType.worldTypes[this.field_146331_K].isCustomizable(); + + if (this.field_146344_y) + { + this.field_146324_A.displayString = I18n.format("gui.done", new Object[0]); + } + else + { + this.field_146324_A.displayString = I18n.format("selectWorld.moreWorldOptions", new Object[0]); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (this.field_146333_g.isFocused() && !this.field_146344_y) + { + this.field_146333_g.textboxKeyTyped(typedChar, keyCode); + this.field_146330_J = this.field_146333_g.getText(); + } + else if (this.field_146335_h.isFocused() && this.field_146344_y) + { + this.field_146335_h.textboxKeyTyped(typedChar, keyCode); + this.field_146329_I = this.field_146335_h.getText(); + } + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146333_g.getText().length() > 0; + this.func_146314_g(); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + + if (this.field_146344_y) + { + this.field_146335_h.mouseClicked(mouseX, mouseY, mouseButton); + } + else + { + this.field_146333_g.mouseClicked(mouseX, mouseY, mouseButton); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.create", new Object[0]), this.width / 2, 20, -1); + + if (this.field_146344_y) + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterSeed", new Object[0]), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.seedInfo", new Object[0]), this.width / 2 - 100, 85, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.mapFeatures.info", new Object[0]), this.width / 2 - 150, 122, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.allowCommands.info", new Object[0]), this.width / 2 - 150, 172, -6250336); + this.field_146335_h.drawTextBox(); + + if (WorldType.worldTypes[this.field_146331_K].showWorldInfoNotice()) + { + this.fontRendererObj.drawSplitString(I18n.format(WorldType.worldTypes[this.field_146331_K].func_151359_c(), new Object[0]), this.field_146320_D.xPosition + 2, this.field_146320_D.yPosition + 22, this.field_146320_D.getButtonWidth(), 10526880); + } + } + else + { + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, -6250336); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.resultFolder", new Object[0]) + " " + this.field_146336_i, this.width / 2 - 100, 85, -6250336); + this.field_146333_g.drawTextBox(); + this.drawString(this.fontRendererObj, this.field_146323_G, this.width / 2 - 100, 137, -6250336); + this.drawString(this.fontRendererObj, this.field_146328_H, this.width / 2 - 100, 149, -6250336); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void func_146318_a(WorldInfo p_146318_1_) + { + this.field_146330_J = I18n.format("selectWorld.newWorld.copyOf", new Object[] {p_146318_1_.getWorldName()}); + this.field_146329_I = p_146318_1_.getSeed() + ""; + this.field_146331_K = p_146318_1_.getTerrainType().getWorldTypeID(); + this.field_146334_a = p_146318_1_.getGeneratorOptions(); + this.field_146341_s = p_146318_1_.isMapFeaturesEnabled(); + this.field_146340_t = p_146318_1_.areCommandsAllowed(); + + if (p_146318_1_.isHardcoreModeEnabled()) + { + this.field_146342_r = "hardcore"; + } + else if (p_146318_1_.getGameType().isSurvivalOrAdventure()) + { + this.field_146342_r = "survival"; + } + else if (p_146318_1_.getGameType().isCreative()) + { + this.field_146342_r = "creative"; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDisconnected.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDisconnected.java new file mode 100644 index 0000000..21b240e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDisconnected.java @@ -0,0 +1,69 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IChatComponent; + +@SideOnly(Side.CLIENT) +public class GuiDisconnected extends GuiScreen +{ + private String field_146306_a; + private IChatComponent field_146304_f; + private List field_146305_g; + private final GuiScreen field_146307_h; + private static final String __OBFID = "CL_00000693"; + + public GuiDisconnected(GuiScreen p_i45020_1_, String p_i45020_2_, IChatComponent p_i45020_3_) + { + this.field_146307_h = p_i45020_1_; + this.field_146306_a = I18n.format(p_i45020_2_, new Object[0]); + this.field_146304_f = p_i45020_3_; + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.toMenu", new Object[0]))); + this.field_146305_g = this.fontRendererObj.listFormattedStringToWidth(this.field_146304_f.getFormattedText(), this.width - 50); + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(this.field_146307_h); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146306_a, this.width / 2, this.height / 2 - 50, 11184810); + int k = this.height / 2 - 30; + + if (this.field_146305_g != null) + { + for (Iterator iterator = this.field_146305_g.iterator(); iterator.hasNext(); k += this.fontRendererObj.FONT_HEIGHT) + { + String s = (String)iterator.next(); + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 16777215); + } + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDownloadTerrain.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDownloadTerrain.java new file mode 100644 index 0000000..5319eb7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiDownloadTerrain.java @@ -0,0 +1,69 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C00PacketKeepAlive; + +@SideOnly(Side.CLIENT) +public class GuiDownloadTerrain extends GuiScreen +{ + private NetHandlerPlayClient field_146594_a; + private int field_146593_f; + private static final String __OBFID = "CL_00000708"; + + public GuiDownloadTerrain(NetHandlerPlayClient p_i45023_1_) + { + this.field_146594_a = p_i45023_1_; + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + ++this.field_146593_f; + + if (this.field_146593_f % 20 == 0) + { + this.field_146594_a.addToSendQueue(new C00PacketKeepAlive()); + } + + if (this.field_146594_a != null) + { + this.field_146594_a.onNetworkTick(); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawBackground(0); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiEnchantment.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiEnchantment.java new file mode 100644 index 0000000..e2450d0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiEnchantment.java @@ -0,0 +1,268 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnchantmentNameParts; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.util.glu.Project; + +@SideOnly(Side.CLIENT) +public class GuiEnchantment extends GuiContainer +{ + private static final ResourceLocation field_147078_C = new ResourceLocation("textures/gui/container/enchanting_table.png"); + private static final ResourceLocation field_147070_D = new ResourceLocation("textures/entity/enchanting_table_book.png"); + private static final ModelBook field_147072_E = new ModelBook(); + private Random field_147074_F = new Random(); + private ContainerEnchantment field_147075_G; + public int field_147073_u; + public float field_147071_v; + public float field_147069_w; + public float field_147082_x; + public float field_147081_y; + public float field_147080_z; + public float field_147076_A; + ItemStack field_147077_B; + private String field_147079_H; + private static final String __OBFID = "CL_00000757"; + + public GuiEnchantment(InventoryPlayer p_i1090_1_, World p_i1090_2_, int p_i1090_3_, int p_i1090_4_, int p_i1090_5_, String p_i1090_6_) + { + super(new ContainerEnchantment(p_i1090_1_, p_i1090_2_, p_i1090_3_, p_i1090_4_, p_i1090_5_)); + this.field_147075_G = (ContainerEnchantment)this.inventorySlots; + this.field_147079_H = p_i1090_6_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.field_147079_H == null ? I18n.format("container.enchant", new Object[0]) : this.field_147079_H, 12, 5, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + this.func_147068_g(); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + int l = (this.width - this.xSize) / 2; + int i1 = (this.height - this.ySize) / 2; + + for (int j1 = 0; j1 < 3; ++j1) + { + int k1 = mouseX - (l + 60); + int l1 = mouseY - (i1 + 14 + 19 * j1); + + if (k1 >= 0 && l1 >= 0 && k1 < 108 && l1 < 19 && this.field_147075_G.enchantItem(this.mc.thePlayer, j1)) + { + this.mc.playerController.sendEnchantPacket(this.field_147075_G.windowId, j1); + } + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147078_C); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glViewport((scaledresolution.getScaledWidth() - 320) / 2 * scaledresolution.getScaleFactor(), (scaledresolution.getScaledHeight() - 240) / 2 * scaledresolution.getScaleFactor(), 320 * scaledresolution.getScaleFactor(), 240 * scaledresolution.getScaleFactor()); + GL11.glTranslatef(-0.34F, 0.23F, 0.0F); + Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + float f1 = 1.0F; + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + RenderHelper.enableStandardItemLighting(); + GL11.glTranslatef(0.0F, 3.3F, -16.0F); + GL11.glScalef(f1, f1, f1); + float f2 = 5.0F; + GL11.glScalef(f2, f2, f2); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147070_D); + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + float f3 = this.field_147076_A + (this.field_147080_z - this.field_147076_A) * partialTicks; + GL11.glTranslatef((1.0F - f3) * 0.2F, (1.0F - f3) * 0.1F, (1.0F - f3) * 0.25F); + GL11.glRotatef(-(1.0F - f3) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + float f4 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.25F; + float f5 = this.field_147069_w + (this.field_147071_v - this.field_147069_w) * partialTicks + 0.75F; + f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F; + f5 = (f5 - (float)MathHelper.truncateDoubleToInt((double)f5)) * 1.6F - 0.3F; + + if (f4 < 0.0F) + { + f4 = 0.0F; + } + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + if (f5 > 1.0F) + { + f5 = 1.0F; + } + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + field_147072_E.render((Entity)null, 0.0F, f4, f5, f3, 0.0F, 0.0625F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + EnchantmentNameParts.instance.reseedRandomGenerator(this.field_147075_G.nameSeed); + + for (int i1 = 0; i1 < 3; ++i1) + { + String s = EnchantmentNameParts.instance.generateNewRandomName(); + this.zLevel = 0.0F; + this.mc.getTextureManager().bindTexture(field_147078_C); + int j1 = this.field_147075_G.enchantLevels[i1]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (j1 == 0) + { + this.drawTexturedModalRect(k + 60, l + 14 + 19 * i1, 0, 185, 108, 19); + } + else + { + String s1 = "" + j1; + FontRenderer fontrenderer = this.mc.standardGalacticFontRenderer; + int k1 = 6839882; + + if (this.mc.thePlayer.experienceLevel < j1 && !this.mc.thePlayer.capabilities.isCreativeMode) + { + this.drawTexturedModalRect(k + 60, l + 14 + 19 * i1, 0, 185, 108, 19); + fontrenderer.drawSplitString(s, k + 62, l + 16 + 19 * i1, 104, (k1 & 16711422) >> 1); + fontrenderer = this.mc.fontRenderer; + k1 = 4226832; + fontrenderer.drawStringWithShadow(s1, k + 62 + 104 - fontrenderer.getStringWidth(s1), l + 16 + 19 * i1 + 7, k1); + } + else + { + int l1 = mouseX - (k + 60); + int i2 = mouseY - (l + 14 + 19 * i1); + + if (l1 >= 0 && i2 >= 0 && l1 < 108 && i2 < 19) + { + this.drawTexturedModalRect(k + 60, l + 14 + 19 * i1, 0, 204, 108, 19); + k1 = 16777088; + } + else + { + this.drawTexturedModalRect(k + 60, l + 14 + 19 * i1, 0, 166, 108, 19); + } + + fontrenderer.drawSplitString(s, k + 62, l + 16 + 19 * i1, 104, k1); + fontrenderer = this.mc.fontRenderer; + k1 = 8453920; + fontrenderer.drawStringWithShadow(s1, k + 62 + 104 - fontrenderer.getStringWidth(s1), l + 16 + 19 * i1 + 7, k1); + } + } + } + } + + public void func_147068_g() + { + ItemStack itemstack = this.inventorySlots.getSlot(0).getStack(); + + if (!ItemStack.areItemStacksEqual(itemstack, this.field_147077_B)) + { + this.field_147077_B = itemstack; + + do + { + this.field_147082_x += (float)(this.field_147074_F.nextInt(4) - this.field_147074_F.nextInt(4)); + } + while (this.field_147071_v <= this.field_147082_x + 1.0F && this.field_147071_v >= this.field_147082_x - 1.0F); + } + + ++this.field_147073_u; + this.field_147069_w = this.field_147071_v; + this.field_147076_A = this.field_147080_z; + boolean flag = false; + + for (int i = 0; i < 3; ++i) + { + if (this.field_147075_G.enchantLevels[i] != 0) + { + flag = true; + } + } + + if (flag) + { + this.field_147080_z += 0.2F; + } + else + { + this.field_147080_z -= 0.2F; + } + + if (this.field_147080_z < 0.0F) + { + this.field_147080_z = 0.0F; + } + + if (this.field_147080_z > 1.0F) + { + this.field_147080_z = 1.0F; + } + + float f1 = (this.field_147082_x - this.field_147071_v) * 0.4F; + float f = 0.2F; + + if (f1 < -f) + { + f1 = -f; + } + + if (f1 > f) + { + f1 = f; + } + + this.field_147081_y += (f1 - this.field_147081_y) * 0.9F; + this.field_147071_v += this.field_147081_y; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiErrorScreen.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiErrorScreen.java new file mode 100644 index 0000000..511b6d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiErrorScreen.java @@ -0,0 +1,49 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiErrorScreen extends GuiScreen +{ + private String field_146313_a; + private String field_146312_f; + private static final String __OBFID = "CL_00000696"; + + public GuiErrorScreen(String p_i1034_1_, String p_i1034_2_) + { + this.field_146313_a = p_i1034_1_; + this.field_146312_f = p_i1034_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.format("gui.cancel", new Object[0]))); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); + this.drawCenteredString(this.fontRendererObj, this.field_146313_a, this.width / 2, 90, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146312_f, this.width / 2, 110, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + protected void actionPerformed(GuiButton button) + { + this.mc.displayGuiScreen((GuiScreen)null); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiFlatPresets.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiFlatPresets.java new file mode 100644 index 0000000..238b5fc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiFlatPresets.java @@ -0,0 +1,272 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.FlatLayerInfo; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiFlatPresets extends GuiScreen +{ + private static RenderItem field_146437_a = new RenderItem(); + private static final List field_146431_f = new ArrayList(); + private final GuiCreateFlatWorld field_146432_g; + private String field_146438_h; + private String field_146439_i; + private String field_146436_r; + private GuiFlatPresets.ListSlot field_146435_s; + private GuiButton field_146434_t; + private GuiTextField field_146433_u; + private static final String __OBFID = "CL_00000704"; + + public GuiFlatPresets(GuiCreateFlatWorld p_i1049_1_) + { + this.field_146432_g = p_i1049_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.field_146438_h = I18n.format("createWorld.customize.presets.title", new Object[0]); + this.field_146439_i = I18n.format("createWorld.customize.presets.share", new Object[0]); + this.field_146436_r = I18n.format("createWorld.customize.presets.list", new Object[0]); + this.field_146433_u = new GuiTextField(this.fontRendererObj, 50, 40, this.width - 100, 20); + this.field_146435_s = new GuiFlatPresets.ListSlot(); + this.field_146433_u.setMaxStringLength(1230); + this.field_146433_u.setText(this.field_146432_g.func_146384_e()); + this.buttonList.add(this.field_146434_t = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("createWorld.customize.presets.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.func_146426_g(); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + this.field_146433_u.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (!this.field_146433_u.textboxKeyTyped(typedChar, keyCode)) + { + super.keyTyped(typedChar, keyCode); + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0 && this.func_146430_p()) + { + this.field_146432_g.func_146383_a(this.field_146433_u.getText()); + this.mc.displayGuiScreen(this.field_146432_g); + } + else if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_146432_g); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_146435_s.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146438_h, this.width / 2, 8, 16777215); + this.drawString(this.fontRendererObj, this.field_146439_i, 50, 30, 10526880); + this.drawString(this.fontRendererObj, this.field_146436_r, 50, 70, 10526880); + this.field_146433_u.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_146433_u.updateCursorCounter(); + super.updateScreen(); + } + + public void func_146426_g() + { + boolean flag = this.func_146430_p(); + this.field_146434_t.enabled = flag; + } + + private boolean func_146430_p() + { + return this.field_146435_s.field_148175_k > -1 && this.field_146435_s.field_148175_k < field_146431_f.size() || this.field_146433_u.getText().length() > 1; + } + + private static void func_146425_a(String p_146425_0_, Item p_146425_1_, BiomeGenBase p_146425_2_, FlatLayerInfo ... p_146425_3_) + { + func_146421_a(p_146425_0_, p_146425_1_, p_146425_2_, (List)null, p_146425_3_); + } + + private static void func_146421_a(String p_146421_0_, Item p_146421_1_, BiomeGenBase p_146421_2_, List p_146421_3_, FlatLayerInfo ... p_146421_4_) + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + + for (int i = p_146421_4_.length - 1; i >= 0; --i) + { + flatgeneratorinfo.getFlatLayers().add(p_146421_4_[i]); + } + + flatgeneratorinfo.setBiome(p_146421_2_.biomeID); + flatgeneratorinfo.func_82645_d(); + + if (p_146421_3_ != null) + { + Iterator iterator = p_146421_3_.iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + flatgeneratorinfo.getWorldFeatures().put(s1, new HashMap()); + } + } + + field_146431_f.add(new GuiFlatPresets.LayerItem(p_146421_1_, p_146421_0_, flatgeneratorinfo.toString())); + } + + static + { + func_146421_a("Classic Flat", Item.getItemFromBlock(Blocks.grass), BiomeGenBase.plains, Arrays.asList(new String[] {"village"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(2, Blocks.dirt), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Tunnelers\' Dream", Item.getItemFromBlock(Blocks.stone), BiomeGenBase.extremeHills, Arrays.asList(new String[] {"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(230, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Water World", Item.getItemFromBlock(Blocks.flowing_water), BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(90, Blocks.water), new FlatLayerInfo(5, Blocks.sand), new FlatLayerInfo(5, Blocks.dirt), new FlatLayerInfo(5, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Overworld", Item.getItemFromBlock(Blocks.tallgrass), BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Snowy Kingdom", Item.getItemFromBlock(Blocks.snow_layer), BiomeGenBase.icePlains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.snow_layer), new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(59, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146421_a("Bottomless Pit", Items.feather, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Blocks.grass), new FlatLayerInfo(3, Blocks.dirt), new FlatLayerInfo(2, Blocks.cobblestone)}); + func_146421_a("Desert", Item.getItemFromBlock(Blocks.sand), BiomeGenBase.desert, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[] {new FlatLayerInfo(8, Blocks.sand), new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + func_146425_a("Redstone Ready", Items.redstone, BiomeGenBase.desert, new FlatLayerInfo[] {new FlatLayerInfo(52, Blocks.sandstone), new FlatLayerInfo(3, Blocks.stone), new FlatLayerInfo(1, Blocks.bedrock)}); + } + + @SideOnly(Side.CLIENT) + static class LayerItem + { + public Item field_148234_a; + public String field_148232_b; + public String field_148233_c; + private static final String __OBFID = "CL_00000705"; + + public LayerItem(Item p_i45022_1_, String p_i45022_2_, String p_i45022_3_) + { + this.field_148234_a = p_i45022_1_; + this.field_148232_b = p_i45022_2_; + this.field_148233_c = p_i45022_3_; + } + } + + @SideOnly(Side.CLIENT) + class ListSlot extends GuiSlot + { + public int field_148175_k = -1; + private static final String __OBFID = "CL_00000706"; + + public ListSlot() + { + super(GuiFlatPresets.this.mc, GuiFlatPresets.this.width, GuiFlatPresets.this.height, 80, GuiFlatPresets.this.height - 37, 24); + } + + private void func_148172_a(int p_148172_1_, int p_148172_2_, Item p_148172_3_) + { + this.func_148173_e(p_148172_1_ + 1, p_148172_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + GuiFlatPresets.field_146437_a.renderItemIntoGUI(GuiFlatPresets.this.fontRendererObj, GuiFlatPresets.this.mc.getTextureManager(), new ItemStack(p_148172_3_, 1, 0), p_148172_1_ + 2, p_148172_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private void func_148173_e(int p_148173_1_, int p_148173_2_) + { + this.func_148171_c(p_148173_1_, p_148173_2_, 0, 0); + } + + private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiFlatPresets.this.mc.getTextureManager().bindTexture(Gui.statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel, (double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel, (double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel, (double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel, (double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)); + tessellator.draw(); + } + + protected int getSize() + { + return GuiFlatPresets.field_146431_f.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + this.field_148175_k = p_148144_1_; + GuiFlatPresets.this.func_146426_g(); + GuiFlatPresets.this.field_146433_u.setText(((GuiFlatPresets.LayerItem)GuiFlatPresets.field_146431_f.get(GuiFlatPresets.this.field_146435_s.field_148175_k)).field_148233_c); + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return p_148131_1_ == this.field_148175_k; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + GuiFlatPresets.LayerItem layeritem = (GuiFlatPresets.LayerItem)GuiFlatPresets.field_146431_f.get(p_148126_1_); + this.func_148172_a(p_148126_2_, p_148126_3_, layeritem.field_148234_a); + GuiFlatPresets.this.fontRendererObj.drawString(layeritem.field_148232_b, p_148126_2_ + 18 + 5, p_148126_3_ + 6, 16777215); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiGameOver.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiGameOver.java new file mode 100644 index 0000000..852031d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiGameOver.java @@ -0,0 +1,137 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiGameOver extends GuiScreen implements GuiYesNoCallback +{ + private int field_146347_a; + private boolean field_146346_f = false; + private static final String __OBFID = "CL_00000690"; + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + if (this.mc.isIntegratedServerRunning()) + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.deleteWorld", new Object[0]))); + } + else + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.leaveServer", new Object[0]))); + } + } + else + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 72, I18n.format("deathScreen.respawn", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.format("deathScreen.titleScreen", new Object[0]))); + + if (this.mc.getSession() == null) + { + ((GuiButton)this.buttonList.get(1)).enabled = false; + } + } + + GuiButton guibutton; + + for (Iterator iterator = this.buttonList.iterator(); iterator.hasNext(); guibutton.enabled = false) + { + guibutton = (GuiButton)iterator.next(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + protected void actionPerformed(GuiButton button) + { + switch (button.id) + { + case 0: + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen((GuiScreen)null); + break; + case 1: + GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("deathScreen.quit.confirm", new Object[0]), "", I18n.format("deathScreen.titleScreen", new Object[0]), I18n.format("deathScreen.respawn", new Object[0]), 0); + this.mc.displayGuiScreen(guiyesno); + guiyesno.func_146350_a(20); + } + } + + public void confirmClicked(boolean result, int id) + { + if (result) + { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient)null); + this.mc.displayGuiScreen(new GuiMainMenu()); + } + else + { + this.mc.thePlayer.respawnPlayer(); + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); + boolean flag = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(); + String s = flag ? I18n.format("deathScreen.title.hardcore", new Object[0]) : I18n.format("deathScreen.title", new Object[0]); + this.drawCenteredString(this.fontRendererObj, s, this.width / 2 / 2, 30, 16777215); + GL11.glPopMatrix(); + + if (flag) + { + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.hardcoreInfo", new Object[0]), this.width / 2, 144, 16777215); + } + + this.drawCenteredString(this.fontRendererObj, I18n.format("deathScreen.score", new Object[0]) + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + ++this.field_146347_a; + GuiButton guibutton; + + if (this.field_146347_a == 20) + { + for (Iterator iterator = this.buttonList.iterator(); iterator.hasNext(); guibutton.enabled = true) + { + guibutton = (GuiButton)iterator.next(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiHopper.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiHopper.java new file mode 100644 index 0000000..d4584b9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiHopper.java @@ -0,0 +1,47 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiHopper extends GuiContainer +{ + private static final ResourceLocation field_147085_u = new ResourceLocation("textures/gui/container/hopper.png"); + private IInventory field_147084_v; + private IInventory field_147083_w; + private static final String __OBFID = "CL_00000759"; + + public GuiHopper(InventoryPlayer p_i1092_1_, IInventory p_i1092_2_) + { + super(new ContainerHopper(p_i1092_1_, p_i1092_2_)); + this.field_147084_v = p_i1092_1_; + this.field_147083_w = p_i1092_2_; + this.allowUserInput = false; + this.ySize = 133; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.field_147083_w.hasCustomInventoryName() ? this.field_147083_w.getInventoryName() : I18n.format(this.field_147083_w.getInventoryName(), new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147084_v.hasCustomInventoryName() ? this.field_147084_v.getInventoryName() : I18n.format(this.field_147084_v.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147085_u); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngame.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngame.java new file mode 100644 index 0000000..34300fd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngame.java @@ -0,0 +1,1045 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.Color; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.Direction; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.FoodStats; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiIngame extends Gui +{ + protected static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); + protected static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); + protected static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); + protected static final RenderItem itemRenderer = new RenderItem(); + protected final Random rand = new Random(); + protected final Minecraft mc; + /** ChatGUI instance that retains all previous chat data */ + protected final GuiNewChat persistantChatGUI; + protected final GuiStreamIndicator field_152127_m; + protected int updateCounter; + /** The string specifying which record music is playing */ + protected String recordPlaying = ""; + /** How many ticks the record playing message will be displayed */ + protected int recordPlayingUpFor; + protected boolean recordIsPlaying; + /** Previous frame vignette brightness (slowly changes by 1% each frame) */ + public float prevVignetteBrightness = 1.0F; + /** Remaining ticks the item highlight should be visible */ + protected int remainingHighlightTicks; + /** The ItemStack that is currently being highlighted */ + protected ItemStack highlightingItemStack; + private static final String __OBFID = "CL_00000661"; + + public GuiIngame(Minecraft p_i1036_1_) + { + this.mc = p_i1036_1_; + this.persistantChatGUI = new GuiNewChat(p_i1036_1_); + this.field_152127_m = new GuiStreamIndicator(this.mc); + } + + /** + * Render the ingame overlay with quick icon bar, ... + */ + public void renderGameOverlay(float p_73830_1_, boolean p_73830_2_, int p_73830_3_, int p_73830_4_) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int k = scaledresolution.getScaledWidth(); + int l = scaledresolution.getScaledHeight(); + FontRenderer fontrenderer = this.mc.fontRenderer; + this.mc.entityRenderer.setupOverlayRendering(); + GL11.glEnable(GL11.GL_BLEND); + + if (Minecraft.isFancyGraphicsEnabled()) + { + this.renderVignette(this.mc.thePlayer.getBrightness(p_73830_1_), k, l); + } + else + { + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); + + if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) + { + this.renderPumpkinBlur(k, l); + } + + if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) + { + float f1 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * p_73830_1_; + + if (f1 > 0.0F) + { + this.func_130015_b(f1, k, l); + } + } + + int i1; + int j1; + int k1; + + if (!this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(widgetsTexPath); + InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; + this.zLevel = -90.0F; + this.drawTexturedModalRect(k / 2 - 91, l - 22, 0, 0, 182, 22); + this.drawTexturedModalRect(k / 2 - 91 - 1 + inventoryplayer.currentItem * 20, l - 22 - 1, 0, 22, 24, 22); + this.mc.getTextureManager().bindTexture(icons); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(775, 769, 1, 0); + this.drawTexturedModalRect(k / 2 - 7, l / 2 - 7, 0, 0, 16, 16); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + this.mc.mcProfiler.startSection("bossHealth"); + this.renderBossHealth(); + this.mc.mcProfiler.endSection(); + + if (this.mc.playerController.shouldDrawHUD()) + { + this.func_110327_a(k, l); + } + + this.mc.mcProfiler.startSection("actionBar"); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + + for (i1 = 0; i1 < 9; ++i1) + { + j1 = k / 2 - 90 + i1 * 20 + 2; + k1 = l - 16 - 3; + this.renderInventorySlot(i1, j1, k1, p_73830_1_); + } + + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + this.mc.mcProfiler.endSection(); + GL11.glDisable(GL11.GL_BLEND); + } + + int l4; + + if (this.mc.thePlayer.getSleepTimer() > 0) + { + this.mc.mcProfiler.startSection("sleep"); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_ALPHA_TEST); + l4 = this.mc.thePlayer.getSleepTimer(); + float f2 = (float)l4 / 100.0F; + + if (f2 > 1.0F) + { + f2 = 1.0F - (float)(l4 - 100) / 10.0F; + } + + j1 = (int)(220.0F * f2) << 24 | 1052704; + drawRect(0, 0, k, l, j1); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_DEPTH_TEST); + this.mc.mcProfiler.endSection(); + } + + l4 = 16777215; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + i1 = k / 2 - 91; + int l1; + int i2; + int j2; + int k2; + float f3; + short short1; + + if (this.mc.thePlayer.isRidingHorse()) + { + this.mc.mcProfiler.startSection("jumpBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + f3 = this.mc.thePlayer.getHorseJumpPower(); + short1 = 182; + l1 = (int)(f3 * (float)(short1 + 1)); + i2 = l - 32 + 3; + this.drawTexturedModalRect(i1, i2, 0, 84, short1, 5); + + if (l1 > 0) + { + this.drawTexturedModalRect(i1, i2, 0, 89, l1, 5); + } + + this.mc.mcProfiler.endSection(); + } + else if (this.mc.playerController.gameIsSurvivalOrAdventure()) + { + this.mc.mcProfiler.startSection("expBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + j1 = this.mc.thePlayer.xpBarCap(); + + if (j1 > 0) + { + short1 = 182; + l1 = (int)(this.mc.thePlayer.experience * (float)(short1 + 1)); + i2 = l - 32 + 3; + this.drawTexturedModalRect(i1, i2, 0, 64, short1, 5); + + if (l1 > 0) + { + this.drawTexturedModalRect(i1, i2, 0, 69, l1, 5); + } + } + + this.mc.mcProfiler.endSection(); + + if (this.mc.thePlayer.experienceLevel > 0) + { + this.mc.mcProfiler.startSection("expLevel"); + boolean flag2 = false; + l1 = flag2 ? 16777215 : 8453920; + String s3 = "" + this.mc.thePlayer.experienceLevel; + j2 = (k - fontrenderer.getStringWidth(s3)) / 2; + k2 = l - 31 - 4; + boolean flag1 = false; + fontrenderer.drawString(s3, j2 + 1, k2, 0); + fontrenderer.drawString(s3, j2 - 1, k2, 0); + fontrenderer.drawString(s3, j2, k2 + 1, 0); + fontrenderer.drawString(s3, j2, k2 - 1, 0); + fontrenderer.drawString(s3, j2, k2, l1); + this.mc.mcProfiler.endSection(); + } + } + + String s2; + + if (this.mc.gameSettings.heldItemTooltips) + { + this.mc.mcProfiler.startSection("toolHighlight"); + + if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) + { + s2 = this.highlightingItemStack.getDisplayName(); + k1 = (k - fontrenderer.getStringWidth(s2)) / 2; + l1 = l - 59; + + if (!this.mc.playerController.shouldDrawHUD()) + { + l1 += 14; + } + + i2 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); + + if (i2 > 255) + { + i2 = 255; + } + + if (i2 > 0) + { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + fontrenderer.drawStringWithShadow(s2, k1, l1, 16777215 + (i2 << 24)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + this.mc.mcProfiler.endSection(); + } + + if (this.mc.isDemo()) + { + this.mc.mcProfiler.startSection("demo"); + s2 = ""; + + if (this.mc.theWorld.getTotalWorldTime() >= 120500L) + { + s2 = I18n.format("demo.demoExpired", new Object[0]); + } + else + { + s2 = I18n.format("demo.remainingTime", new Object[] {StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))}); + } + + k1 = fontrenderer.getStringWidth(s2); + fontrenderer.drawStringWithShadow(s2, k - k1 - 10, 5, 16777215); + this.mc.mcProfiler.endSection(); + } + + int i3; + int j3; + int k3; + + if (this.mc.gameSettings.showDebugInfo) + { + this.mc.mcProfiler.startSection("debug"); + GL11.glPushMatrix(); + fontrenderer.drawStringWithShadow("Minecraft 1.7.10 (" + this.mc.debug + ")", 2, 2, 16777215); + fontrenderer.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); + fontrenderer.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); + fontrenderer.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); + fontrenderer.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); + long i5 = Runtime.getRuntime().maxMemory(); + long j5 = Runtime.getRuntime().totalMemory(); + long k5 = Runtime.getRuntime().freeMemory(); + long l5 = j5 - k5; + String s = "Used memory: " + l5 * 100L / i5 + "% (" + l5 / 1024L / 1024L + "MB) of " + i5 / 1024L / 1024L + "MB"; + i3 = 14737632; + this.drawString(fontrenderer, s, k - fontrenderer.getStringWidth(s) - 2, 2, 14737632); + s = "Allocated memory: " + j5 * 100L / i5 + "% (" + j5 / 1024L / 1024L + "MB)"; + this.drawString(fontrenderer, s, k - fontrenderer.getStringWidth(s) - 2, 12, 14737632); + int offset = 22; + for (String brd : FMLCommonHandler.instance().getBrandings(false)) + { + this.drawString(fontrenderer, brd, k - fontrenderer.getStringWidth(brd) - 2, offset+=10, 14737632); + } + j3 = MathHelper.floor_double(this.mc.thePlayer.posX); + k3 = MathHelper.floor_double(this.mc.thePlayer.posY); + int l3 = MathHelper.floor_double(this.mc.thePlayer.posZ); + this.drawString(fontrenderer, String.format("x: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(j3), Integer.valueOf(j3 >> 4), Integer.valueOf(j3 & 15)}), 2, 64, 14737632); + this.drawString(fontrenderer, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[] {Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); + this.drawString(fontrenderer, String.format("z: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(l3), Integer.valueOf(l3 >> 4), Integer.valueOf(l3 & 15)}), 2, 80, 14737632); + int i4 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + this.drawString(fontrenderer, "f: " + i4 + " (" + Direction.directions[i4] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); + + if (this.mc.theWorld != null && this.mc.theWorld.blockExists(j3, k3, l3)) + { + Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(j3, l3); + this.drawString(fontrenderer, "lc: " + (chunk.getTopFilledSegment() + 15) + " b: " + chunk.getBiomeGenForWorldCoords(j3 & 15, l3 & 15, this.mc.theWorld.getWorldChunkManager()).biomeName + " bl: " + chunk.getSavedLightValue(EnumSkyBlock.Block, j3 & 15, k3, l3 & 15) + " sl: " + chunk.getSavedLightValue(EnumSkyBlock.Sky, j3 & 15, k3, l3 & 15) + " rl: " + chunk.getBlockLightValue(j3 & 15, k3, l3 & 15, 0), 2, 96, 14737632); + } + + this.drawString(fontrenderer, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[] {Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(j3, l3))}), 2, 104, 14737632); + + if (this.mc.entityRenderer != null && this.mc.entityRenderer.isShaderActive()) + { + this.drawString(fontrenderer, String.format("shader: %s", new Object[] {this.mc.entityRenderer.getShaderGroup().getShaderGroupName()}), 2, 112, 14737632); + } + + GL11.glPopMatrix(); + this.mc.mcProfiler.endSection(); + } + + if (this.recordPlayingUpFor > 0) + { + this.mc.mcProfiler.startSection("overlayMessage"); + f3 = (float)this.recordPlayingUpFor - p_73830_1_; + k1 = (int)(f3 * 255.0F / 20.0F); + + if (k1 > 255) + { + k1 = 255; + } + + if (k1 > 8) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)(k / 2), (float)(l - 68), 0.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + l1 = 16777215; + + if (this.recordIsPlaying) + { + l1 = Color.HSBtoRGB(f3 / 50.0F, 0.7F, 0.6F) & 16777215; + } + + fontrenderer.drawString(this.recordPlaying, -fontrenderer.getStringWidth(this.recordPlaying) / 2, -4, l1 + (k1 << 24 & -16777216)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + this.mc.mcProfiler.endSection(); + } + + ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(1); + + if (scoreobjective != null) + { + this.func_96136_a(scoreobjective, l, k, fontrenderer); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, (float)(l - 48), 0.0F); + this.mc.mcProfiler.startSection("chat"); + this.persistantChatGUI.drawChat(this.updateCounter); + this.mc.mcProfiler.endSection(); + GL11.glPopMatrix(); + scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0); + + if (this.mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1 || scoreobjective != null)) + { + this.mc.mcProfiler.startSection("playerList"); + NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue; + List list = nethandlerplayclient.playerInfoList; + i2 = nethandlerplayclient.currentServerMaxPlayers; + j2 = i2; + + for (k2 = 1; j2 > 20; j2 = (i2 + k2 - 1) / k2) + { + ++k2; + } + + int i6 = 300 / k2; + + if (i6 > 150) + { + i6 = 150; + } + + int l2 = (k - k2 * i6) / 2; + byte b0 = 10; + drawRect(l2 - 1, b0 - 1, l2 + i6 * k2, b0 + 9 * j2, Integer.MIN_VALUE); + + for (i3 = 0; i3 < i2; ++i3) + { + j3 = l2 + i3 % k2 * i6; + k3 = b0 + i3 / k2 * 9; + drawRect(j3, k3, j3 + i6 - 1, k3 + 8, 553648127); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (i3 < list.size()) + { + GuiPlayerInfo guiplayerinfo = (GuiPlayerInfo)list.get(i3); + ScorePlayerTeam scoreplayerteam = this.mc.theWorld.getScoreboard().getPlayersTeam(guiplayerinfo.name); + String s4 = ScorePlayerTeam.formatPlayerName(scoreplayerteam, guiplayerinfo.name); + fontrenderer.drawStringWithShadow(s4, j3, k3, 16777215); + + if (scoreobjective != null) + { + int j4 = j3 + fontrenderer.getStringWidth(s4) + 5; + int k4 = j3 + i6 - 12 - 5; + + if (k4 - j4 > 5) + { + Score score = scoreobjective.getScoreboard().func_96529_a(guiplayerinfo.name, scoreobjective); + String s1 = EnumChatFormatting.YELLOW + "" + score.getScorePoints(); + fontrenderer.drawStringWithShadow(s1, k4 - fontrenderer.getStringWidth(s1), k3, 16777215); + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + byte b1 = 0; + boolean flag3 = false; + byte b2; + + if (guiplayerinfo.responseTime < 0) + { + b2 = 5; + } + else if (guiplayerinfo.responseTime < 150) + { + b2 = 0; + } + else if (guiplayerinfo.responseTime < 300) + { + b2 = 1; + } + else if (guiplayerinfo.responseTime < 600) + { + b2 = 2; + } + else if (guiplayerinfo.responseTime < 1000) + { + b2 = 3; + } + else + { + b2 = 4; + } + + this.zLevel += 100.0F; + this.drawTexturedModalRect(j3 + i6 - 12, k3, 0 + b1 * 10, 176 + b2 * 8, 10, 8); + this.zLevel -= 100.0F; + } + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + public void func_152126_a(float p_152126_1_, float p_152126_2_) + { + this.field_152127_m.func_152437_a((int)(p_152126_1_ - 10.0F), 10); + } + + protected void func_96136_a(ScoreObjective p_96136_1_, int p_96136_2_, int p_96136_3_, FontRenderer p_96136_4_) + { + Scoreboard scoreboard = p_96136_1_.getScoreboard(); + Collection collection = scoreboard.func_96534_i(p_96136_1_); + + if (collection.size() <= 15) + { + int k = p_96136_4_.getStringWidth(p_96136_1_.getDisplayName()); + String s; + + for (Iterator iterator = collection.iterator(); iterator.hasNext(); k = Math.max(k, p_96136_4_.getStringWidth(s))) + { + Score score = (Score)iterator.next(); + ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName()); + s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": " + EnumChatFormatting.RED + score.getScorePoints(); + } + + int k1 = collection.size() * p_96136_4_.FONT_HEIGHT; + int l1 = p_96136_2_ / 2 + k1 / 3; + byte b0 = 3; + int i2 = p_96136_3_ - k - b0; + int l = 0; + Iterator iterator1 = collection.iterator(); + + while (iterator1.hasNext()) + { + Score score1 = (Score)iterator1.next(); + ++l; + ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName()); + String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName()); + String s2 = EnumChatFormatting.RED + "" + score1.getScorePoints(); + int i1 = l1 - l * p_96136_4_.FONT_HEIGHT; + int j1 = p_96136_3_ - b0 + 2; + drawRect(i2 - 2, i1, j1, i1 + p_96136_4_.FONT_HEIGHT, 1342177280); + p_96136_4_.drawString(s1, i2, i1, 553648127); + p_96136_4_.drawString(s2, j1 - p_96136_4_.getStringWidth(s2), i1, 553648127); + + if (l == collection.size()) + { + String s3 = p_96136_1_.getDisplayName(); + drawRect(i2 - 2, i1 - p_96136_4_.FONT_HEIGHT - 1, j1, i1 - 1, 1610612736); + drawRect(i2 - 2, i1 - 1, j1, i1, 1342177280); + p_96136_4_.drawString(s3, i2 + k / 2 - p_96136_4_.getStringWidth(s3) / 2, i1 - p_96136_4_.FONT_HEIGHT, 553648127); + } + } + } + } + + protected void func_110327_a(int p_110327_1_, int p_110327_2_) + { + boolean flag = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; + + if (this.mc.thePlayer.hurtResistantTime < 10) + { + flag = false; + } + + int k = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth()); + int l = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth); + this.rand.setSeed((long)(this.updateCounter * 312871)); + boolean flag1 = false; + FoodStats foodstats = this.mc.thePlayer.getFoodStats(); + int i1 = foodstats.getFoodLevel(); + int j1 = foodstats.getPrevFoodLevel(); + IAttributeInstance iattributeinstance = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); + int k1 = p_110327_1_ / 2 - 91; + int l1 = p_110327_1_ / 2 + 91; + int i2 = p_110327_2_ - 39; + float f = (float)iattributeinstance.getAttributeValue(); + float f1 = this.mc.thePlayer.getAbsorptionAmount(); + int j2 = MathHelper.ceiling_float_int((f + f1) / 2.0F / 10.0F); + int k2 = Math.max(10 - (j2 - 2), 3); + int l2 = i2 - (j2 - 1) * k2 - 10; + float f2 = f1; + int i3 = this.mc.thePlayer.getTotalArmorValue(); + int j3 = -1; + + if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) + { + j3 = this.updateCounter % MathHelper.ceiling_float_int(f + 5.0F); + } + + this.mc.mcProfiler.startSection("armor"); + int k3; + int l3; + + for (k3 = 0; k3 < 10; ++k3) + { + if (i3 > 0) + { + l3 = k1 + k3 * 8; + + if (k3 * 2 + 1 < i3) + { + this.drawTexturedModalRect(l3, l2, 34, 9, 9, 9); + } + + if (k3 * 2 + 1 == i3) + { + this.drawTexturedModalRect(l3, l2, 25, 9, 9, 9); + } + + if (k3 * 2 + 1 > i3) + { + this.drawTexturedModalRect(l3, l2, 16, 9, 9, 9); + } + } + } + + this.mc.mcProfiler.endStartSection("health"); + int i4; + int j4; + int k4; + + for (k3 = MathHelper.ceiling_float_int((f + f1) / 2.0F) - 1; k3 >= 0; --k3) + { + l3 = 16; + + if (this.mc.thePlayer.isPotionActive(Potion.poison)) + { + l3 += 36; + } + else if (this.mc.thePlayer.isPotionActive(Potion.wither)) + { + l3 += 72; + } + + byte b0 = 0; + + if (flag) + { + b0 = 1; + } + + i4 = MathHelper.ceiling_float_int((float)(k3 + 1) / 10.0F) - 1; + j4 = k1 + k3 % 10 * 8; + k4 = i2 - i4 * k2; + + if (k <= 4) + { + k4 += this.rand.nextInt(2); + } + + if (k3 == j3) + { + k4 -= 2; + } + + byte b1 = 0; + + if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + b1 = 5; + } + + this.drawTexturedModalRect(j4, k4, 16 + b0 * 9, 9 * b1, 9, 9); + + if (flag) + { + if (k3 * 2 + 1 < l) + { + this.drawTexturedModalRect(j4, k4, l3 + 54, 9 * b1, 9, 9); + } + + if (k3 * 2 + 1 == l) + { + this.drawTexturedModalRect(j4, k4, l3 + 63, 9 * b1, 9, 9); + } + } + + if (f2 > 0.0F) + { + if (f2 == f1 && f1 % 2.0F == 1.0F) + { + this.drawTexturedModalRect(j4, k4, l3 + 153, 9 * b1, 9, 9); + } + else + { + this.drawTexturedModalRect(j4, k4, l3 + 144, 9 * b1, 9, 9); + } + + f2 -= 2.0F; + } + else + { + if (k3 * 2 + 1 < k) + { + this.drawTexturedModalRect(j4, k4, l3 + 36, 9 * b1, 9, 9); + } + + if (k3 * 2 + 1 == k) + { + this.drawTexturedModalRect(j4, k4, l3 + 45, 9 * b1, 9, 9); + } + } + } + + Entity entity = this.mc.thePlayer.ridingEntity; + int k5; + + if (entity == null) + { + this.mc.mcProfiler.endStartSection("food"); + + for (l3 = 0; l3 < 10; ++l3) + { + k5 = i2; + i4 = 16; + byte b4 = 0; + + if (this.mc.thePlayer.isPotionActive(Potion.hunger)) + { + i4 += 36; + b4 = 13; + } + + if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (i1 * 3 + 1) == 0) + { + k5 = i2 + (this.rand.nextInt(3) - 1); + } + + if (flag1) + { + b4 = 1; + } + + k4 = l1 - l3 * 8 - 9; + this.drawTexturedModalRect(k4, k5, 16 + b4 * 9, 27, 9, 9); + + if (flag1) + { + if (l3 * 2 + 1 < j1) + { + this.drawTexturedModalRect(k4, k5, i4 + 54, 27, 9, 9); + } + + if (l3 * 2 + 1 == j1) + { + this.drawTexturedModalRect(k4, k5, i4 + 63, 27, 9, 9); + } + } + + if (l3 * 2 + 1 < i1) + { + this.drawTexturedModalRect(k4, k5, i4 + 36, 27, 9, 9); + } + + if (l3 * 2 + 1 == i1) + { + this.drawTexturedModalRect(k4, k5, i4 + 45, 27, 9, 9); + } + } + } + else if (entity instanceof EntityLivingBase) + { + this.mc.mcProfiler.endStartSection("mountHealth"); + EntityLivingBase entitylivingbase = (EntityLivingBase)entity; + k5 = (int)Math.ceil((double)entitylivingbase.getHealth()); + float f3 = entitylivingbase.getMaxHealth(); + j4 = (int)(f3 + 0.5F) / 2; + + if (j4 > 30) + { + j4 = 30; + } + + k4 = i2; + + for (int l5 = 0; j4 > 0; l5 += 20) + { + int l4 = Math.min(j4, 10); + j4 -= l4; + + for (int i5 = 0; i5 < l4; ++i5) + { + byte b2 = 52; + byte b3 = 0; + + if (flag1) + { + b3 = 1; + } + + int j5 = l1 - i5 * 8 - 9; + this.drawTexturedModalRect(j5, k4, b2 + b3 * 9, 9, 9, 9); + + if (i5 * 2 + 1 + l5 < k5) + { + this.drawTexturedModalRect(j5, k4, b2 + 36, 9, 9, 9); + } + + if (i5 * 2 + 1 + l5 == k5) + { + this.drawTexturedModalRect(j5, k4, b2 + 45, 9, 9, 9); + } + } + + k4 -= 10; + } + } + + this.mc.mcProfiler.endStartSection("air"); + + if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) + { + l3 = this.mc.thePlayer.getAir(); + k5 = MathHelper.ceiling_double_int((double)(l3 - 2) * 10.0D / 300.0D); + i4 = MathHelper.ceiling_double_int((double)l3 * 10.0D / 300.0D) - k5; + + for (j4 = 0; j4 < k5 + i4; ++j4) + { + if (j4 < k5) + { + this.drawTexturedModalRect(l1 - j4 * 8 - 9, l2, 16, 18, 9, 9); + } + else + { + this.drawTexturedModalRect(l1 - j4 * 8 - 9, l2, 25, 18, 9, 9); + } + } + } + + this.mc.mcProfiler.endSection(); + } + + /** + * Renders dragon's (boss) health on the HUD + */ + protected void renderBossHealth() + { + if (BossStatus.bossName != null && BossStatus.statusBarTime > 0) + { + --BossStatus.statusBarTime; + FontRenderer fontrenderer = this.mc.fontRenderer; + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i = scaledresolution.getScaledWidth(); + short short1 = 182; + int j = i / 2 - short1 / 2; + int k = (int)(BossStatus.healthScale * (float)(short1 + 1)); + byte b0 = 12; + this.drawTexturedModalRect(j, b0, 0, 74, short1, 5); + this.drawTexturedModalRect(j, b0, 0, 74, short1, 5); + + if (k > 0) + { + this.drawTexturedModalRect(j, b0, 0, 79, k, 5); + } + + String s = BossStatus.bossName; + fontrenderer.drawStringWithShadow(s, i / 2 - fontrenderer.getStringWidth(s) / 2, b0 - 10, 16777215); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + } + } + + protected void renderPumpkinBlur(int p_73836_1_, int p_73836_2_) + { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(0.0D, (double)p_73836_2_, -90.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)p_73836_1_, (double)p_73836_2_, -90.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)p_73836_1_, 0.0D, -90.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders the vignette. Args: vignetteBrightness, width, height + */ + protected void renderVignette(float p_73829_1_, int p_73829_2_, int p_73829_3_) + { + p_73829_1_ = 1.0F - p_73829_1_; + + if (p_73829_1_ < 0.0F) + { + p_73829_1_ = 0.0F; + } + + if (p_73829_1_ > 1.0F) + { + p_73829_1_ = 1.0F; + } + + this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(p_73829_1_ - this.prevVignetteBrightness) * 0.01D); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(0, 769, 1, 0); + GL11.glColor4f(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F); + this.mc.getTextureManager().bindTexture(vignetteTexPath); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(0.0D, (double)p_73829_3_, -90.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)p_73829_2_, (double)p_73829_3_, -90.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)p_73829_2_, 0.0D, -90.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + protected void func_130015_b(float p_130015_1_, int p_130015_2_, int p_130015_3_) + { + if (p_130015_1_ < 1.0F) + { + p_130015_1_ *= p_130015_1_; + p_130015_1_ *= p_130015_1_; + p_130015_1_ = p_130015_1_ * 0.8F + 0.2F; + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(1.0F, 1.0F, 1.0F, p_130015_1_); + IIcon iicon = Blocks.portal.getBlockTextureFromSide(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + float f1 = iicon.getMinU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxU(); + float f4 = iicon.getMaxV(); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(0.0D, (double)p_130015_3_, -90.0D, (double)f1, (double)f4); + tessellator.addVertexWithUV((double)p_130015_2_, (double)p_130015_3_, -90.0D, (double)f3, (double)f4); + tessellator.addVertexWithUV((double)p_130015_2_, 0.0D, -90.0D, (double)f3, (double)f2); + tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, (double)f1, (double)f2); + tessellator.draw(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick + */ + protected void renderInventorySlot(int p_73832_1_, int p_73832_2_, int p_73832_3_, float p_73832_4_) + { + ItemStack itemstack = this.mc.thePlayer.inventory.mainInventory[p_73832_1_]; + + if (itemstack != null) + { + float f1 = (float)itemstack.animationsToGo - p_73832_4_; + + if (f1 > 0.0F) + { + GL11.glPushMatrix(); + float f2 = 1.0F + f1 / 5.0F; + GL11.glTranslatef((float)(p_73832_2_ + 8), (float)(p_73832_3_ + 12), 0.0F); + GL11.glScalef(1.0F / f2, (f2 + 1.0F) / 2.0F, 1.0F); + GL11.glTranslatef((float)(-(p_73832_2_ + 8)), (float)(-(p_73832_3_ + 12)), 0.0F); + } + + itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_); + + if (f1 > 0.0F) + { + GL11.glPopMatrix(); + } + + itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), itemstack, p_73832_2_, p_73832_3_); + } + } + + /** + * The update tick for the ingame UI + */ + public void updateTick() + { + if (this.recordPlayingUpFor > 0) + { + --this.recordPlayingUpFor; + } + + ++this.updateCounter; + this.field_152127_m.func_152439_a(); + + if (this.mc.thePlayer != null) + { + ItemStack itemstack = this.mc.thePlayer.inventory.getCurrentItem(); + + if (itemstack == null) + { + this.remainingHighlightTicks = 0; + } + else if (this.highlightingItemStack != null && itemstack.getItem() == this.highlightingItemStack.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.highlightingItemStack) && (itemstack.isItemStackDamageable() || itemstack.getItemDamage() == this.highlightingItemStack.getItemDamage())) + { + if (this.remainingHighlightTicks > 0) + { + --this.remainingHighlightTicks; + } + } + else + { + this.remainingHighlightTicks = 40; + } + + this.highlightingItemStack = itemstack; + } + } + + public void setRecordPlayingMessage(String p_73833_1_) + { + this.func_110326_a(I18n.format("record.nowPlaying", new Object[] {p_73833_1_}), true); + } + + public void func_110326_a(String p_110326_1_, boolean p_110326_2_) + { + this.recordPlaying = p_110326_1_; + this.recordPlayingUpFor = 60; + this.recordIsPlaying = p_110326_2_; + } + + /** + * returns a pointer to the persistant Chat GUI, containing all previous chat messages and such + */ + public GuiNewChat getChatGUI() + { + return this.persistantChatGUI; + } + + public int getUpdateCounter() + { + return this.updateCounter; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngameMenu.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngameMenu.java new file mode 100644 index 0000000..344e654 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiIngameMenu.java @@ -0,0 +1,99 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiIngameMenu extends GuiScreen +{ + private int field_146445_a; + private int field_146444_f; + private static final String __OBFID = "CL_00000703"; + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_146445_a = 0; + this.buttonList.clear(); + byte b0 = -16; + boolean flag = true; + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + b0, I18n.format("menu.returnToMenu", new Object[0]))); + + if (!this.mc.isIntegratedServerRunning()) + { + ((GuiButton)this.buttonList.get(0)).displayString = I18n.format("menu.disconnect", new Object[0]); + } + + this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + b0, I18n.format("menu.returnToGame", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.options", new Object[0]))); + this.buttonList.add(new GuiButton(12, this.width / 2 + 2, this.height / 4 + 96 + b0, 98, 20, "Mod Options...")); + GuiButton guibutton; + this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 100, this.height / 4 + 72 + b0, 200, 20, I18n.format("menu.shareToLan", new Object[0]))); + this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.achievements", new Object[0]))); + this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + b0, 98, 20, I18n.format("gui.stats", new Object[0]))); + guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); + } + + protected void actionPerformed(GuiButton button) + { + switch (button.id) + { + case 0: + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + break; + case 1: + button.enabled = false; + this.mc.theWorld.sendQuittingDisconnectingPacket(); + this.mc.loadWorld((WorldClient)null); + this.mc.displayGuiScreen(new GuiMainMenu()); + case 2: + case 3: + default: + break; + case 4: + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + break; + case 5: + if (this.mc.thePlayer != null) + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + break; + case 6: + if (this.mc.thePlayer != null) + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + break; + case 7: + this.mc.displayGuiScreen(new GuiShareToLan(this)); + break; + case 12: + FMLClientHandler.instance().showInGameModOptions(this); + break; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + ++this.field_146444_f; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("menu.game", new Object[0]), this.width / 2, 40, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiKeyBindingList.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiKeyBindingList.java new file mode 100644 index 0000000..976062b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiKeyBindingList.java @@ -0,0 +1,211 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Arrays; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.util.EnumChatFormatting; +import org.apache.commons.lang3.ArrayUtils; + +@SideOnly(Side.CLIENT) +public class GuiKeyBindingList extends GuiListExtended +{ + private final GuiControls field_148191_k; + private final Minecraft mc; + private final GuiListExtended.IGuiListEntry[] field_148190_m; + private int field_148188_n = 0; + private static final String __OBFID = "CL_00000732"; + + public GuiKeyBindingList(GuiControls p_i45031_1_, Minecraft p_i45031_2_) + { + super(p_i45031_2_, p_i45031_1_.width, p_i45031_1_.height, 63, p_i45031_1_.height - 32, 20); + this.field_148191_k = p_i45031_1_; + this.mc = p_i45031_2_; + KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(p_i45031_2_.gameSettings.keyBindings); + this.field_148190_m = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()]; + Arrays.sort(akeybinding); + int i = 0; + String s = null; + KeyBinding[] akeybinding1 = akeybinding; + int j = akeybinding.length; + + for (int k = 0; k < j; ++k) + { + KeyBinding keybinding = akeybinding1[k]; + String s1 = keybinding.getKeyCategory(); + + if (!s1.equals(s)) + { + s = s1; + this.field_148190_m[i++] = new GuiKeyBindingList.CategoryEntry(s1); + } + + int l = p_i45031_2_.fontRenderer.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0])); + + if (l > this.field_148188_n) + { + this.field_148188_n = l; + } + + this.field_148190_m[i++] = new GuiKeyBindingList.KeyEntry(keybinding, null); + } + } + + protected int getSize() + { + return this.field_148190_m.length; + } + + /** + * Gets the IGuiListEntry object for the given index + */ + public GuiListExtended.IGuiListEntry getListEntry(int p_148180_1_) + { + return this.field_148190_m[p_148180_1_]; + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 15; + } + + /** + * Gets the width of the list + */ + public int getListWidth() + { + return super.getListWidth() + 32; + } + + @SideOnly(Side.CLIENT) + public class CategoryEntry implements GuiListExtended.IGuiListEntry + { + private final String field_148285_b; + private final int field_148286_c; + private static final String __OBFID = "CL_00000734"; + + public CategoryEntry(String p_i45028_2_) + { + this.field_148285_b = I18n.format(p_i45028_2_, new Object[0]); + this.field_148286_c = GuiKeyBindingList.this.mc.fontRenderer.getStringWidth(this.field_148285_b); + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + GuiKeyBindingList.this.mc.fontRenderer.drawString(this.field_148285_b, GuiKeyBindingList.this.mc.currentScreen.width / 2 - this.field_148286_c / 2, p_148279_3_ + p_148279_5_ - GuiKeyBindingList.this.mc.fontRenderer.FONT_HEIGHT - 1, 16777215); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + } + + @SideOnly(Side.CLIENT) + public class KeyEntry implements GuiListExtended.IGuiListEntry + { + private final KeyBinding field_148282_b; + private final String field_148283_c; + private final GuiButton btnChangeKeyBinding; + private final GuiButton btnReset; + private static final String __OBFID = "CL_00000735"; + + private KeyEntry(KeyBinding p_i45029_2_) + { + this.field_148282_b = p_i45029_2_; + this.field_148283_c = I18n.format(p_i45029_2_.getKeyDescription(), new Object[0]); + this.btnChangeKeyBinding = new GuiButton(0, 0, 0, 75, 18, I18n.format(p_i45029_2_.getKeyDescription(), new Object[0])); + this.btnReset = new GuiButton(0, 0, 0, 50, 18, I18n.format("controls.reset", new Object[0])); + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + boolean flag1 = GuiKeyBindingList.this.field_148191_k.buttonId == this.field_148282_b; + GuiKeyBindingList.this.mc.fontRenderer.drawString(this.field_148283_c, p_148279_2_ + 90 - GuiKeyBindingList.this.field_148188_n, p_148279_3_ + p_148279_5_ / 2 - GuiKeyBindingList.this.mc.fontRenderer.FONT_HEIGHT / 2, 16777215); + this.btnReset.xPosition = p_148279_2_ + 190; + this.btnReset.yPosition = p_148279_3_; + this.btnReset.enabled = this.field_148282_b.getKeyCode() != this.field_148282_b.getKeyCodeDefault(); + this.btnReset.drawButton(GuiKeyBindingList.this.mc, p_148279_7_, p_148279_8_); + this.btnChangeKeyBinding.xPosition = p_148279_2_ + 105; + this.btnChangeKeyBinding.yPosition = p_148279_3_; + this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.field_148282_b.getKeyCode()); + boolean flag2 = false; + + if (this.field_148282_b.getKeyCode() != 0) + { + KeyBinding[] akeybinding = GuiKeyBindingList.this.mc.gameSettings.keyBindings; + int l1 = akeybinding.length; + + for (int i2 = 0; i2 < l1; ++i2) + { + KeyBinding keybinding = akeybinding[i2]; + + if (keybinding != this.field_148282_b && keybinding.getKeyCode() == this.field_148282_b.getKeyCode()) + { + flag2 = true; + break; + } + } + } + + if (flag1) + { + this.btnChangeKeyBinding.displayString = EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + this.btnChangeKeyBinding.displayString + EnumChatFormatting.WHITE + " <"; + } + else if (flag2) + { + this.btnChangeKeyBinding.displayString = EnumChatFormatting.RED + this.btnChangeKeyBinding.displayString; + } + + this.btnChangeKeyBinding.drawButton(GuiKeyBindingList.this.mc, p_148279_7_, p_148279_8_); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.btnChangeKeyBinding.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_)) + { + GuiKeyBindingList.this.field_148191_k.buttonId = this.field_148282_b; + return true; + } + else if (this.btnReset.mousePressed(GuiKeyBindingList.this.mc, p_148278_2_, p_148278_3_)) + { + GuiKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.field_148282_b, this.field_148282_b.getKeyCodeDefault()); + KeyBinding.resetKeyBindingArrayAndHash(); + return true; + } + else + { + return false; + } + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) + { + this.btnChangeKeyBinding.mouseReleased(p_148277_2_, p_148277_3_); + this.btnReset.mouseReleased(p_148277_2_, p_148277_3_); + } + + KeyEntry(KeyBinding p_i45030_2_, Object p_i45030_3_) + { + this(p_i45030_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLabel.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLabel.java new file mode 100644 index 0000000..d47d378 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLabel.java @@ -0,0 +1,69 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiLabel extends Gui +{ + protected int field_146167_a; + protected int field_146161_f; + public int field_146162_g; + public int field_146174_h; + private ArrayList field_146173_k; + private boolean field_146170_l; + public boolean field_146172_j; + private boolean field_146171_m; + private int field_146168_n; + private int field_146169_o; + private int field_146166_p; + private int field_146165_q; + private FontRenderer field_146164_r; + private int field_146163_s; + private static final String __OBFID = "CL_00000671"; + + public void func_146159_a(Minecraft mc, int mouseX, int mouseY) + { + if (this.field_146172_j) + { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.func_146160_b(mc, mouseX, mouseY); + int k = this.field_146174_h + this.field_146161_f / 2 + this.field_146163_s / 2; + int l = k - this.field_146173_k.size() * 10 / 2; + + for (int i1 = 0; i1 < this.field_146173_k.size(); ++i1) + { + if (this.field_146170_l) + { + this.drawCenteredString(this.field_146164_r, (String)this.field_146173_k.get(i1), this.field_146162_g + this.field_146167_a / 2, l + i1 * 10, this.field_146168_n); + } + else + { + this.drawString(this.field_146164_r, (String)this.field_146173_k.get(i1), this.field_146162_g, l + i1 * 10, this.field_146168_n); + } + } + } + } + + protected void func_146160_b(Minecraft p_146160_1_, int p_146160_2_, int p_146160_3_) + { + if (this.field_146171_m) + { + int k = this.field_146167_a + this.field_146163_s * 2; + int l = this.field_146161_f + this.field_146163_s * 2; + int i1 = this.field_146162_g - this.field_146163_s; + int j1 = this.field_146174_h - this.field_146163_s; + drawRect(i1, j1, i1 + k, j1 + l, this.field_146169_o); + this.drawHorizontalLine(i1, i1 + k, j1, this.field_146166_p); + this.drawHorizontalLine(i1, i1 + k, j1 + l, this.field_146165_q); + this.drawVerticalLine(i1, j1, j1 + l, this.field_146166_p); + this.drawVerticalLine(i1 + k, j1, j1 + l, this.field_146165_q); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLanguage.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLanguage.java new file mode 100644 index 0000000..5d91814 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiLanguage.java @@ -0,0 +1,160 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.Language; +import net.minecraft.client.resources.LanguageManager; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class GuiLanguage extends GuiScreen +{ + protected GuiScreen field_146453_a; + private GuiLanguage.List field_146450_f; + private final GameSettings field_146451_g; + private final LanguageManager field_146454_h; + private GuiOptionButton field_146455_i; + private GuiOptionButton field_146452_r; + private static final String __OBFID = "CL_00000698"; + + public GuiLanguage(GuiScreen p_i1043_1_, GameSettings p_i1043_2_, LanguageManager p_i1043_3_) + { + this.field_146453_a = p_i1043_1_; + this.field_146451_g = p_i1043_2_; + this.field_146454_h = p_i1043_3_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + boolean flag = false; + + if (this.field_146455_i != null) + { + ; + } + + this.buttonList.add(this.field_146455_i = new GuiOptionButton(100, this.width / 2 - 155, this.height - 38, GameSettings.Options.FORCE_UNICODE_FONT, this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT))); + this.buttonList.add(this.field_146452_r = new GuiOptionButton(6, this.width / 2 - 155 + 160, this.height - 38, I18n.format("gui.done", new Object[0]))); + this.field_146450_f = new GuiLanguage.List(); + this.field_146450_f.registerScrollButtons(7, 8); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + switch (button.id) + { + case 5: + break; + case 6: + this.mc.displayGuiScreen(this.field_146453_a); + break; + case 100: + if (button instanceof GuiOptionButton) + { + this.field_146451_g.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + this.setWorldAndResolution(this.mc, i, j); + } + + break; + default: + this.field_146450_f.actionPerformed(button); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_146450_f.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("options.language", new Object[0]), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, "(" + I18n.format("options.languageWarning", new Object[0]) + ")", this.width / 2, this.height - 56, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SideOnly(Side.CLIENT) + class List extends GuiSlot + { + private final java.util.List field_148176_l = Lists.newArrayList(); + private final Map field_148177_m = Maps.newHashMap(); + private static final String __OBFID = "CL_00000699"; + + public List() + { + super(GuiLanguage.this.mc, GuiLanguage.this.width, GuiLanguage.this.height, 32, GuiLanguage.this.height - 65 + 4, 18); + Iterator iterator = GuiLanguage.this.field_146454_h.getLanguages().iterator(); + + while (iterator.hasNext()) + { + Language language = (Language)iterator.next(); + this.field_148177_m.put(language.getLanguageCode(), language); + this.field_148176_l.add(language.getLanguageCode()); + } + } + + protected int getSize() + { + return this.field_148176_l.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + Language language = (Language)this.field_148177_m.get(this.field_148176_l.get(p_148144_1_)); + GuiLanguage.this.field_146454_h.setCurrentLanguage(language); + GuiLanguage.this.field_146451_g.language = language.getLanguageCode(); + GuiLanguage.this.mc.refreshResources(); + GuiLanguage.this.fontRendererObj.setUnicodeFlag(GuiLanguage.this.field_146454_h.isCurrentLocaleUnicode() || GuiLanguage.this.field_146451_g.forceUnicodeFont); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.isCurrentLanguageBidirectional()); + GuiLanguage.this.field_146452_r.displayString = I18n.format("gui.done", new Object[0]); + GuiLanguage.this.field_146455_i.displayString = GuiLanguage.this.field_146451_g.getKeyBinding(GameSettings.Options.FORCE_UNICODE_FONT); + GuiLanguage.this.field_146451_g.saveOptions(); + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return ((String)this.field_148176_l.get(p_148131_1_)).equals(GuiLanguage.this.field_146454_h.getCurrentLanguage().getLanguageCode()); + } + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return this.getSize() * 18; + } + + protected void drawBackground() + { + GuiLanguage.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + GuiLanguage.this.fontRendererObj.setBidiFlag(true); + GuiLanguage.this.drawCenteredString(GuiLanguage.this.fontRendererObj, ((Language)this.field_148177_m.get(this.field_148176_l.get(p_148126_1_))).toString(), this.width / 2, p_148126_3_ + 1, 16777215); + GuiLanguage.this.fontRendererObj.setBidiFlag(GuiLanguage.this.field_146454_h.getCurrentLanguage().isBidirectional()); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiListExtended.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiListExtended.java new file mode 100644 index 0000000..84f843f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiListExtended.java @@ -0,0 +1,97 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; + +@SideOnly(Side.CLIENT) +public abstract class GuiListExtended extends GuiSlot +{ + private static final String __OBFID = "CL_00000674"; + + public GuiListExtended(Minecraft p_i45010_1_, int p_i45010_2_, int p_i45010_3_, int p_i45010_4_, int p_i45010_5_, int p_i45010_6_) + { + super(p_i45010_1_, p_i45010_2_, p_i45010_3_, p_i45010_4_, p_i45010_5_, p_i45010_6_); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return false; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + this.getListEntry(p_148126_1_).drawEntry(p_148126_1_, p_148126_2_, p_148126_3_, this.getListWidth(), p_148126_4_, p_148126_5_, p_148126_6_, p_148126_7_, this.func_148124_c(p_148126_6_, p_148126_7_) == p_148126_1_); + } + + public boolean func_148179_a(int p_148179_1_, int p_148179_2_, int p_148179_3_) + { + if (this.func_148141_e(p_148179_2_)) + { + int l = this.func_148124_c(p_148179_1_, p_148179_2_); + + if (l >= 0) + { + int i1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int j1 = this.top + 4 - this.getAmountScrolled() + l * this.slotHeight + this.headerPadding; + int k1 = p_148179_1_ - i1; + int l1 = p_148179_2_ - j1; + + if (this.getListEntry(l).mousePressed(l, p_148179_1_, p_148179_2_, p_148179_3_, k1, l1)) + { + this.func_148143_b(false); + return true; + } + } + } + + return false; + } + + public boolean func_148181_b(int p_148181_1_, int p_148181_2_, int p_148181_3_) + { + for (int l = 0; l < this.getSize(); ++l) + { + int i1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + int j1 = this.top + 4 - this.getAmountScrolled() + l * this.slotHeight + this.headerPadding; + int k1 = p_148181_1_ - i1; + int l1 = p_148181_2_ - j1; + this.getListEntry(l).mouseReleased(l, p_148181_1_, p_148181_2_, p_148181_3_, k1, l1); + } + + this.func_148143_b(true); + return false; + } + + /** + * Gets the IGuiListEntry object for the given index + */ + public abstract GuiListExtended.IGuiListEntry getListEntry(int p_148180_1_); + + @SideOnly(Side.CLIENT) + public interface IGuiListEntry + { + void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_); + + /** + * Returns true if the mouse has been pressed on this control. + */ + boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_); + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMainMenu.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMainMenu.java new file mode 100644 index 0000000..dee40dd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMainMenu.java @@ -0,0 +1,579 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.client.GuiModList; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.resources.I18n; +import net.minecraft.realms.RealmsBridge; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.client.ForgeHooksClient; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; + +import com.google.common.base.Strings; +import com.google.common.collect.Lists; + +@SideOnly(Side.CLIENT) +public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback +{ + private static final Logger logger = LogManager.getLogger(); + /** The RNG used by the Main Menu Screen. */ + private static final Random rand = new Random(); + /** Counts the number of screen updates. */ + private float updateCounter; + /** The splash message. */ + private String splashText; + private GuiButton buttonResetDemo; + /** Timer used to rotate the panorama, increases every tick. */ + private int panoramaTimer; + /** Texture allocated for the current viewport of the main menu's panorama background. */ + private DynamicTexture viewportTexture; + private final Object field_104025_t = new Object(); + private String field_92025_p; + private String field_146972_A; + private String field_104024_v; + private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); + private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); + /** An array of all the paths to the panorama pictures. */ + private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; + public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; + private int field_92021_u; + private int field_92020_v; + private int field_92019_w; + private ResourceLocation field_110351_G; + private static final String __OBFID = "CL_00001154"; + + public GuiMainMenu() + { + this.field_146972_A = field_96138_a; + this.splashText = "missingno"; + BufferedReader bufferedreader = null; + + try + { + ArrayList arraylist = new ArrayList(); + bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + String s; + + while ((s = bufferedreader.readLine()) != null) + { + s = s.trim(); + + if (!s.isEmpty()) + { + arraylist.add(s); + } + } + + if (!arraylist.isEmpty()) + { + do + { + this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size())); + } + while (this.splashText.hashCode() == 125780783); + } + } + catch (IOException ioexception1) + { + ; + } + finally + { + if (bufferedreader != null) + { + try + { + bufferedreader.close(); + } + catch (IOException ioexception) + { + ; + } + } + } + + this.updateCounter = rand.nextFloat(); + this.field_92025_p = ""; + + if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b()) + { + this.field_92025_p = I18n.format("title.oldgl1", new Object[0]); + this.field_146972_A = I18n.format("title.oldgl2", new Object[0]); + this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game"; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + ++this.panoramaTimer; + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return false; + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.viewportTexture = new DynamicTexture(256, 256); + this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + + if (calendar.get(2) + 1 == 11 && calendar.get(5) == 9) + { + this.splashText = "Happy birthday, ez!"; + } + else if (calendar.get(2) + 1 == 6 && calendar.get(5) == 1) + { + this.splashText = "Happy birthday, Notch!"; + } + else if (calendar.get(2) + 1 == 12 && calendar.get(5) == 24) + { + this.splashText = "Merry X-mas!"; + } + else if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1) + { + this.splashText = "Happy new year!"; + } + else if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31) + { + this.splashText = "OOoooOOOoooo! Spooky!"; + } + + boolean flag = true; + int i = this.height / 4 + 48; + + if (this.mc.isDemo()) + { + this.addDemoButtons(i, 24); + } + else + { + this.addSingleplayerMultiplayerButtons(i, 24); + } + + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.format("menu.options", new Object[0]))); + this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.format("menu.quit", new Object[0]))); + this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, i + 72 + 12)); + Object object = this.field_104025_t; + + synchronized (this.field_104025_t) + { + this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p); + this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A); + int j = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - j) / 2; + this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24; + this.field_92020_v = this.field_92022_t + j; + this.field_92019_w = this.field_92021_u + 24; + } + } + + /** + * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. + */ + private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_) + { + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0]))); + this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0]))); + GuiButton realmsButton = new GuiButton(14, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("menu.online", new Object[0])); + GuiButton fmlModButton = new GuiButton(6, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, "Mods"); + fmlModButton.xPosition = this.width / 2 + 2; + realmsButton.width = 98; + fmlModButton.width = 98; + this.buttonList.add(realmsButton); + this.buttonList.add(fmlModButton); + } + + /** + * Adds Demo buttons on Main Menu for players who are playing Demo. + */ + private void addDemoButtons(int p_73972_1_, int p_73972_2_) + { + this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0]))); + this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0]))); + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); + + if (worldinfo == null) + { + this.buttonResetDemo.enabled = false; + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + + if (button.id == 5) + { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + + if (button.id == 1) + { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + + if (button.id == 2) + { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + + if (button.id == 14) + { + this.func_140005_i(); + } + + if (button.id == 4) + { + this.mc.shutdown(); + } + + if (button.id == 6) + { + this.mc.displayGuiScreen(new GuiModList(this)); + } + + if (button.id == 11) + { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + + if (button.id == 12) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); + + if (worldinfo != null) + { + GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12); + this.mc.displayGuiScreen(guiyesno); + } + } + } + + private void func_140005_i() + { + RealmsBridge realmsbridge = new RealmsBridge(); + realmsbridge.switchToRealms(this); + } + + public void confirmClicked(boolean result, int id) + { + if (result && id == 12) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.flushCache(); + isaveformat.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); + } + else if (id == 13) + { + if (result) + { + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(this.field_104024_v)}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + } + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Draws the main menu panorama + */ + private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) + { + Tessellator tessellator = Tessellator.instance; + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + byte b0 = 8; + + for (int k = 0; k < b0 * b0; ++k) + { + GL11.glPushMatrix(); + float f1 = ((float)(k % b0) / (float)b0 - 0.5F) / 64.0F; + float f2 = ((float)(k / b0) / (float)b0 - 0.5F) / 64.0F; + float f3 = 0.0F; + GL11.glTranslatef(f1, f2, f3); + GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-((float)this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); + + for (int l = 0; l < 6; ++l) + { + GL11.glPushMatrix(); + + if (l == 1) + { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 2) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 3) + { + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if (l == 4) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (l == 5) + { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + + this.mc.getTextureManager().bindTexture(titlePanoramaPaths[l]); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(16777215, 255 / (k + 1)); + float f4 = 0.0F; + tessellator.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + f4), (double)(0.0F + f4)); + tessellator.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - f4), (double)(0.0F + f4)); + tessellator.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - f4), (double)(1.0F - f4)); + tessellator.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + f4), (double)(1.0F - f4)); + tessellator.draw(); + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + GL11.glColorMask(true, true, true, false); + } + + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + GL11.glColorMask(true, true, true, true); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + /** + * Rotate and blurs the skybox view in the main menu + */ + private void rotateAndBlurSkybox(float p_73968_1_) + { + this.mc.getTextureManager().bindTexture(this.field_110351_G); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColorMask(true, true, true, false); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + GL11.glDisable(GL11.GL_ALPHA_TEST); + byte b0 = 3; + + for (int i = 0; i < b0; ++i) + { + tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(i + 1)); + int j = this.width; + int k = this.height; + float f1 = (float)(i - b0 / 2) / 256.0F; + tessellator.addVertexWithUV((double)j, (double)k, (double)this.zLevel, (double)(0.0F + f1), 1.0D); + tessellator.addVertexWithUV((double)j, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 1.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 0.0D); + tessellator.addVertexWithUV(0.0D, (double)k, (double)this.zLevel, (double)(0.0F + f1), 0.0D); + } + + tessellator.draw(); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glColorMask(true, true, true, true); + } + + /** + * Renders the skybox in the main menu + */ + private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_) + { + this.mc.getFramebuffer().unbindFramebuffer(); + GL11.glViewport(0, 0, 256, 256); + this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.rotateAndBlurSkybox(p_73971_3_); + this.mc.getFramebuffer().bindFramebuffer(true); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + float f1 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height; + float f2 = (float)this.height * f1 / 256.0F; + float f3 = (float)this.width * f1 / 256.0F; + tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + int k = this.width; + int l = this.height; + tessellator.addVertexWithUV(0.0D, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F + f3)); + tessellator.addVertexWithUV((double)k, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F - f3)); + tessellator.addVertexWithUV((double)k, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F - f3)); + tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F + f3)); + tessellator.draw(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.renderSkybox(mouseX, mouseY, partialTicks); + GL11.glEnable(GL11.GL_ALPHA_TEST); + Tessellator tessellator = Tessellator.instance; + short short1 = 274; + int k = this.width / 2 - short1 / 2; + byte b0 = 30; + this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215); + this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); + this.mc.getTextureManager().bindTexture(minecraftTitleTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if ((double)this.updateCounter < 1.0E-4D) + { + this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44); + this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44); + this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44); + this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44); + this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44); + } + else + { + this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44); + this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44); + } + + tessellator.setColorOpaque_I(-1); + GL11.glPushMatrix(); + GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F); + GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); + float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F); + f1 = f1 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32); + GL11.glScalef(f1, f1, f1); + this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256); + GL11.glPopMatrix(); + String s = "Minecraft 1.7.10"; + + if (this.mc.isDemo()) + { + s = s + " Demo"; + } + + List brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true)); + for (int i = 0; i < brandings.size(); i++) + { + String brd = brandings.get(i); + if (!Strings.isNullOrEmpty(brd)) + { + this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215); + } + } + ForgeHooksClient.renderMainMenu(this, fontRendererObj, width, height); + String s1 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1); + + if (this.field_92025_p != null && this.field_92025_p.length() > 0) + { + drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); + this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1); + this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + Object object = this.field_104025_t; + + synchronized (this.field_104025_t) + { + if (this.field_92025_p.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w) + { + GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); + guiconfirmopenlink.func_146358_g(); + this.mc.displayGuiScreen(guiconfirmopenlink); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java new file mode 100644 index 0000000..81e994b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMemoryErrorScreen.java @@ -0,0 +1,56 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiMemoryErrorScreen extends GuiScreen +{ + private static final String __OBFID = "CL_00000702"; + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.format("gui.toMenu", new Object[0]))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.format("menu.quit", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiMainMenu()); + } + else if (button.id == 1) + { + this.mc.shutdown(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRendererObj, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); + this.drawString(this.fontRendererObj, "This could be caused by a bug in the game or by the", this.width / 2 - 140, this.height / 4 - 60 + 60 + 18, 10526880); + this.drawString(this.fontRendererObj, "Java Virtual Machine not being allocated enough", this.width / 2 - 140, this.height / 4 - 60 + 60 + 27, 10526880); + this.drawString(this.fontRendererObj, "memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 36, 10526880); + this.drawString(this.fontRendererObj, "To prevent level corruption, the current game has quit.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 54, 10526880); + this.drawString(this.fontRendererObj, "We\'ve tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 63, 10526880); + this.drawString(this.fontRendererObj, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 72, 10526880); + this.drawString(this.fontRendererObj, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMerchant.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMerchant.java new file mode 100644 index 0000000..b0e05f6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMerchant.java @@ -0,0 +1,249 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiMerchant extends GuiContainer +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_147038_v = new ResourceLocation("textures/gui/container/villager.png"); + private IMerchant field_147037_w; + private GuiMerchant.MerchantButton field_147043_x; + private GuiMerchant.MerchantButton field_147042_y; + private int field_147041_z; + private String field_147040_A; + private static final String __OBFID = "CL_00000762"; + + public GuiMerchant(InventoryPlayer p_i1096_1_, IMerchant p_i1096_2_, World p_i1096_3_, String p_i1096_4_) + { + super(new ContainerMerchant(p_i1096_1_, p_i1096_2_, p_i1096_3_)); + this.field_147037_w = p_i1096_2_; + this.field_147040_A = p_i1096_4_ != null && p_i1096_4_.length() >= 1 ? p_i1096_4_ : I18n.format("entity.Villager.name", new Object[0]); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.buttonList.add(this.field_147043_x = new GuiMerchant.MerchantButton(1, i + 120 + 27, j + 24 - 1, true)); + this.buttonList.add(this.field_147042_y = new GuiMerchant.MerchantButton(2, i + 36 - 19, j + 24 - 1, false)); + this.field_147043_x.enabled = false; + this.field_147042_y.enabled = false; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.field_147040_A, this.xSize / 2 - this.fontRendererObj.getStringWidth(this.field_147040_A) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + MerchantRecipeList merchantrecipelist = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null) + { + this.field_147043_x.enabled = this.field_147041_z < merchantrecipelist.size() - 1; + this.field_147042_y.enabled = this.field_147041_z > 0; + } + } + + protected void actionPerformed(GuiButton button) + { + boolean flag = false; + + if (button == this.field_147043_x) + { + ++this.field_147041_z; + flag = true; + } + else if (button == this.field_147042_y) + { + --this.field_147041_z; + flag = true; + } + + if (flag) + { + ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.field_147041_z); + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + bytebuf.writeInt(this.field_147041_z); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload("MC|TrSel", bytebuf)); + } + catch (Exception exception) + { + logger.error("Couldn\'t send trade info", exception); + } + finally + { + bytebuf.release(); + } + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147038_v); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + MerchantRecipeList merchantrecipelist = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null && !merchantrecipelist.isEmpty()) + { + int i1 = this.field_147041_z; + MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(i1); + + if (merchantrecipe.isRecipeDisabled()) + { + this.mc.getTextureManager().bindTexture(field_147038_v); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 21, 212, 0, 28, 21); + this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + MerchantRecipeList merchantrecipelist = this.field_147037_w.getRecipes(this.mc.thePlayer); + + if (merchantrecipelist != null && !merchantrecipelist.isEmpty()) + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + int i1 = this.field_147041_z; + MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(i1); + GL11.glPushMatrix(); + ItemStack itemstack = merchantrecipe.getItemToBuy(); + ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy(); + ItemStack itemstack2 = merchantrecipe.getItemToSell(); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); + itemRender.zLevel = 100.0F; + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, k + 36, l + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, k + 36, l + 24); + + if (itemstack1 != null) + { + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack1, k + 62, l + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack1, k + 62, l + 24); + } + + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack2, k + 120, l + 24); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack2, k + 120, l + 24); + itemRender.zLevel = 0.0F; + GL11.glDisable(GL11.GL_LIGHTING); + + if (this.func_146978_c(36, 24, 16, 16, mouseX, mouseY)) + { + this.renderToolTip(itemstack, mouseX, mouseY); + } + else if (itemstack1 != null && this.func_146978_c(62, 24, 16, 16, mouseX, mouseY)) + { + this.renderToolTip(itemstack1, mouseX, mouseY); + } + else if (this.func_146978_c(120, 24, 16, 16, mouseX, mouseY)) + { + this.renderToolTip(itemstack2, mouseX, mouseY); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + } + + public IMerchant func_147035_g() + { + return this.field_147037_w; + } + + @SideOnly(Side.CLIENT) + static class MerchantButton extends GuiButton + { + private final boolean field_146157_o; + private static final String __OBFID = "CL_00000763"; + + public MerchantButton(int p_i1095_1_, int p_i1095_2_, int p_i1095_3_, boolean p_i1095_4_) + { + super(p_i1095_1_, p_i1095_2_, p_i1095_3_, 12, 19, ""); + this.field_146157_o = p_i1095_4_; + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiMerchant.field_147038_v); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = 0; + int l = 176; + + if (!this.enabled) + { + l += this.width * 2; + } + else if (flag) + { + l += this.width; + } + + if (!this.field_146157_o) + { + k += this.height; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, l, k, this.width, this.height); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMultiplayer.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMultiplayer.java new file mode 100644 index 0000000..ef6c581 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiMultiplayer.java @@ -0,0 +1,442 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.multiplayer.GuiConnecting; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.network.OldServerPinger; +import net.minecraft.client.resources.I18n; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback +{ + private static final Logger logger = LogManager.getLogger(); + private final OldServerPinger field_146797_f = new OldServerPinger(); + private GuiScreen field_146798_g; + private ServerSelectionList field_146803_h; + private ServerList field_146804_i; + private GuiButton field_146810_r; + private GuiButton field_146809_s; + private GuiButton field_146808_t; + private boolean field_146807_u; + private boolean field_146806_v; + private boolean field_146805_w; + private boolean field_146813_x; + private String field_146812_y; + private ServerData field_146811_z; + private LanServerDetector.LanServerList field_146799_A; + private LanServerDetector.ThreadLanServerFind field_146800_B; + private boolean field_146801_C; + private static final String __OBFID = "CL_00000814"; + + public GuiMultiplayer(GuiScreen parentScreen) + { + this.field_146798_g = parentScreen; + FMLClientHandler.instance().setupServerList(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + + if (!this.field_146801_C) + { + this.field_146801_C = true; + this.field_146804_i = new ServerList(this.mc); + this.field_146804_i.loadServerList(); + this.field_146799_A = new LanServerDetector.LanServerList(); + + try + { + this.field_146800_B = new LanServerDetector.ThreadLanServerFind(this.field_146799_A); + this.field_146800_B.start(); + } + catch (Exception exception) + { + logger.warn("Unable to start LAN server detection: " + exception.getMessage()); + } + + this.field_146803_h = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + else + { + this.field_146803_h.func_148122_a(this.width, this.height, 32, this.height - 64); + } + + this.func_146794_g(); + } + + public void func_146794_g() + { + this.buttonList.add(this.field_146810_r = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.format("selectServer.edit", new Object[0]))); + this.buttonList.add(this.field_146808_t = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.format("selectServer.delete", new Object[0]))); + this.buttonList.add(this.field_146809_s = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.format("selectServer.select", new Object[0]))); + this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.format("selectServer.direct", new Object[0]))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.format("selectServer.add", new Object[0]))); + this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.format("selectServer.refresh", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.format("gui.cancel", new Object[0]))); + this.func_146790_a(this.field_146803_h.func_148193_k()); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + + if (this.field_146799_A.getWasUpdated()) + { + List list = this.field_146799_A.getLanServers(); + this.field_146799_A.setWasNotUpdated(); + this.field_146803_h.func_148194_a(list); + } + + this.field_146797_f.func_147223_a(); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + + if (this.field_146800_B != null) + { + this.field_146800_B.interrupt(); + this.field_146800_B = null; + } + + this.field_146797_f.func_147226_b(); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + GuiListExtended.IGuiListEntry iguilistentry = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.getListEntry(this.field_146803_h.func_148193_k()); + + if (button.id == 2 && iguilistentry instanceof ServerListEntryNormal) + { + String s4 = ((ServerListEntryNormal)iguilistentry).func_148296_a().serverName; + + if (s4 != null) + { + this.field_146807_u = true; + String s = I18n.format("selectServer.deleteQuestion", new Object[0]); + String s1 = "\'" + s4 + "\' " + I18n.format("selectServer.deleteWarning", new Object[0]); + String s2 = I18n.format("selectServer.deleteButton", new Object[0]); + String s3 = I18n.format("gui.cancel", new Object[0]); + GuiYesNo guiyesno = new GuiYesNo(this, s, s1, s2, s3, this.field_146803_h.func_148193_k()); + this.mc.displayGuiScreen(guiyesno); + } + } + else if (button.id == 1) + { + this.func_146796_h(); + } + else if (button.id == 4) + { + this.field_146813_x = true; + this.mc.displayGuiScreen(new GuiScreenServerList(this, this.field_146811_z = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), ""))); + } + else if (button.id == 3) + { + this.field_146806_v = true; + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.field_146811_z = new ServerData(I18n.format("selectServer.defaultName", new Object[0]), ""))); + } + else if (button.id == 7 && iguilistentry instanceof ServerListEntryNormal) + { + this.field_146805_w = true; + ServerData serverdata = ((ServerListEntryNormal)iguilistentry).func_148296_a(); + this.field_146811_z = new ServerData(serverdata.serverName, serverdata.serverIP); + this.field_146811_z.func_152583_a(serverdata); + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.field_146811_z)); + } + else if (button.id == 0) + { + this.mc.displayGuiScreen(this.field_146798_g); + } + else if (button.id == 8) + { + this.func_146792_q(); + } + } + } + + private void func_146792_q() + { + this.mc.displayGuiScreen(new GuiMultiplayer(this.field_146798_g)); + } + + public void confirmClicked(boolean result, int id) + { + GuiListExtended.IGuiListEntry iguilistentry = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.getListEntry(this.field_146803_h.func_148193_k()); + + if (this.field_146807_u) + { + this.field_146807_u = false; + + if (result && iguilistentry instanceof ServerListEntryNormal) + { + this.field_146804_i.removeServerData(this.field_146803_h.func_148193_k()); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148192_c(-1); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } + else if (this.field_146813_x) + { + this.field_146813_x = false; + + if (result) + { + this.func_146791_a(this.field_146811_z); + } + else + { + this.mc.displayGuiScreen(this); + } + } + else if (this.field_146806_v) + { + this.field_146806_v = false; + + if (result) + { + this.field_146804_i.addServerData(this.field_146811_z); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148192_c(-1); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } + else if (this.field_146805_w) + { + this.field_146805_w = false; + + if (result && iguilistentry instanceof ServerListEntryNormal) + { + ServerData serverdata = ((ServerListEntryNormal)iguilistentry).func_148296_a(); + serverdata.serverName = this.field_146811_z.serverName; + serverdata.serverIP = this.field_146811_z.serverIP; + serverdata.func_152583_a(this.field_146811_z); + this.field_146804_i.saveServerList(); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + int j = this.field_146803_h.func_148193_k(); + GuiListExtended.IGuiListEntry iguilistentry = j < 0 ? null : this.field_146803_h.getListEntry(j); + + if (keyCode == 63) + { + this.func_146792_q(); + } + else + { + if (j >= 0) + { + if (keyCode == 200) + { + if (isShiftKeyDown()) + { + if (j > 0 && iguilistentry instanceof ServerListEntryNormal) + { + this.field_146804_i.swapServers(j, j - 1); + this.func_146790_a(this.field_146803_h.func_148193_k() - 1); + this.field_146803_h.scrollBy(-this.field_146803_h.getSlotHeight()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } + else if (j > 0) + { + this.func_146790_a(this.field_146803_h.func_148193_k() - 1); + this.field_146803_h.scrollBy(-this.field_146803_h.getSlotHeight()); + + if (this.field_146803_h.getListEntry(this.field_146803_h.func_148193_k()) instanceof ServerListEntryLanScan) + { + if (this.field_146803_h.func_148193_k() > 0) + { + this.func_146790_a(this.field_146803_h.getSize() - 1); + this.field_146803_h.scrollBy(-this.field_146803_h.getSlotHeight()); + } + else + { + this.func_146790_a(-1); + } + } + } + else + { + this.func_146790_a(-1); + } + } + else if (keyCode == 208) + { + if (isShiftKeyDown()) + { + if (j < this.field_146804_i.countServers() - 1) + { + this.field_146804_i.swapServers(j, j + 1); + this.func_146790_a(j + 1); + this.field_146803_h.scrollBy(this.field_146803_h.getSlotHeight()); + this.field_146803_h.func_148195_a(this.field_146804_i); + } + } + else if (j < this.field_146803_h.getSize()) + { + this.func_146790_a(this.field_146803_h.func_148193_k() + 1); + this.field_146803_h.scrollBy(this.field_146803_h.getSlotHeight()); + + if (this.field_146803_h.getListEntry(this.field_146803_h.func_148193_k()) instanceof ServerListEntryLanScan) + { + if (this.field_146803_h.func_148193_k() < this.field_146803_h.getSize() - 1) + { + this.func_146790_a(this.field_146803_h.getSize() + 1); + this.field_146803_h.scrollBy(this.field_146803_h.getSlotHeight()); + } + else + { + this.func_146790_a(-1); + } + } + } + else + { + this.func_146790_a(-1); + } + } + else if (keyCode != 28 && keyCode != 156) + { + super.keyTyped(typedChar, keyCode); + } + else + { + this.actionPerformed((GuiButton)this.buttonList.get(2)); + } + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_146812_y = null; + this.drawDefaultBackground(); + this.field_146803_h.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title", new Object[0]), this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.field_146812_y != null) + { + this.func_146283_a(Lists.newArrayList(Splitter.on("\n").split(this.field_146812_y)), mouseX, mouseY); + } + } + + public void func_146796_h() + { + GuiListExtended.IGuiListEntry iguilistentry = this.field_146803_h.func_148193_k() < 0 ? null : this.field_146803_h.getListEntry(this.field_146803_h.func_148193_k()); + + if (iguilistentry instanceof ServerListEntryNormal) + { + this.func_146791_a(((ServerListEntryNormal)iguilistentry).func_148296_a()); + } + else if (iguilistentry instanceof ServerListEntryLanDetected) + { + LanServerDetector.LanServer lanserver = ((ServerListEntryLanDetected)iguilistentry).func_148289_a(); + this.func_146791_a(new ServerData(lanserver.getServerMotd(), lanserver.getServerIpPort(), true)); + } + } + + private void func_146791_a(ServerData server) + { + FMLClientHandler.instance().connectToServer(this, server); + } + + public void func_146790_a(int index) + { + this.field_146803_h.func_148192_c(index); + GuiListExtended.IGuiListEntry iguilistentry = index < 0 ? null : this.field_146803_h.getListEntry(index); + this.field_146809_s.enabled = false; + this.field_146810_r.enabled = false; + this.field_146808_t.enabled = false; + + if (iguilistentry != null && !(iguilistentry instanceof ServerListEntryLanScan)) + { + this.field_146809_s.enabled = true; + + if (iguilistentry instanceof ServerListEntryNormal) + { + this.field_146810_r.enabled = true; + this.field_146808_t.enabled = true; + } + } + } + + public OldServerPinger func_146789_i() + { + return this.field_146797_f; + } + + public void func_146793_a(String p_146793_1_) + { + this.field_146812_y = p_146793_1_; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146803_h.func_148179_a(mouseX, mouseY, mouseButton); + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + super.mouseMovedOrUp(mouseX, mouseY, state); + this.field_146803_h.func_148181_b(mouseX, mouseY, state); + } + + public ServerList func_146795_p() + { + return this.field_146804_i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiNewChat.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiNewChat.java new file mode 100644 index 0000000..c00b1fd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiNewChat.java @@ -0,0 +1,455 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiNewChat extends Gui +{ + private static final Logger logger = LogManager.getLogger(); + private final Minecraft mc; + /** A list of messages previously sent through the chat GUI */ + private final List sentMessages = new ArrayList(); + /** Chat lines to be displayed in the chat box */ + private final List chatLines = new ArrayList(); + private final List field_146253_i = new ArrayList(); + private int field_146250_j; + private boolean field_146251_k; + private static final String __OBFID = "CL_00000669"; + + public GuiNewChat(Minecraft p_i1022_1_) + { + this.mc = p_i1022_1_; + } + + public void drawChat(int p_146230_1_) + { + if (this.mc.gameSettings.chatVisibility != EntityPlayer.EnumChatVisibility.HIDDEN) + { + int j = this.func_146232_i(); + boolean flag = false; + int k = 0; + int l = this.field_146253_i.size(); + float f = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; + + if (l > 0) + { + if (this.getChatOpen()) + { + flag = true; + } + + float f1 = this.func_146244_h(); + int i1 = MathHelper.ceiling_float_int((float)this.func_146228_f() / f1); + GL11.glPushMatrix(); + GL11.glTranslatef(2.0F, 20.0F, 0.0F); + GL11.glScalef(f1, f1, 1.0F); + int j1; + int k1; + int i2; + + for (j1 = 0; j1 + this.field_146250_j < this.field_146253_i.size() && j1 < j; ++j1) + { + ChatLine chatline = (ChatLine)this.field_146253_i.get(j1 + this.field_146250_j); + + if (chatline != null) + { + k1 = p_146230_1_ - chatline.getUpdatedCounter(); + + if (k1 < 200 || flag) + { + double d0 = (double)k1 / 200.0D; + d0 = 1.0D - d0; + d0 *= 10.0D; + + if (d0 < 0.0D) + { + d0 = 0.0D; + } + + if (d0 > 1.0D) + { + d0 = 1.0D; + } + + d0 *= d0; + i2 = (int)(255.0D * d0); + + if (flag) + { + i2 = 255; + } + + i2 = (int)((float)i2 * f); + ++k; + + if (i2 > 3) + { + byte b0 = 0; + int j2 = -j1 * 9; + drawRect(b0, j2 - 9, b0 + i1 + 4, j2, i2 / 2 << 24); + GL11.glEnable(GL11.GL_BLEND); // FORGE: BugFix MC-36812 Chat Opacity Broken in 1.7.x + String s = chatline.func_151461_a().getFormattedText(); + this.mc.fontRenderer.drawStringWithShadow(s, b0, j2 - 8, 16777215 + (i2 << 24)); + GL11.glDisable(GL11.GL_ALPHA_TEST); + } + } + } + } + + if (flag) + { + j1 = this.mc.fontRenderer.FONT_HEIGHT; + GL11.glTranslatef(-3.0F, 0.0F, 0.0F); + int k2 = l * j1 + l; + k1 = k * j1 + k; + int l2 = this.field_146250_j * k1 / l; + int l1 = k1 * k1 / k2; + + if (k2 != k1) + { + i2 = l2 > 0 ? 170 : 96; + int i3 = this.field_146251_k ? 13382451 : 3355562; + drawRect(0, -l2, 2, -l2 - l1, i3 + (i2 << 24)); + drawRect(2, -l2, 1, -l2 - l1, 13421772 + (i2 << 24)); + } + } + + GL11.glPopMatrix(); + } + } + } + + /** + * Clears the chat. + */ + public void clearChatMessages() + { + this.field_146253_i.clear(); + this.chatLines.clear(); + this.sentMessages.clear(); + } + + public void printChatMessage(IChatComponent p_146227_1_) + { + this.printChatMessageWithOptionalDeletion(p_146227_1_, 0); + } + + /** + * prints the ChatComponent to Chat. If the ID is not 0, deletes an existing Chat Line of that ID from the GUI + */ + public void printChatMessageWithOptionalDeletion(IChatComponent p_146234_1_, int p_146234_2_) + { + this.func_146237_a(p_146234_1_, p_146234_2_, this.mc.ingameGUI.getUpdateCounter(), false); + logger.info("[CHAT] " + p_146234_1_.getUnformattedText()); + } + + private String func_146235_b(String p_146235_1_) + { + return Minecraft.getMinecraft().gameSettings.chatColours ? p_146235_1_ : EnumChatFormatting.getTextWithoutFormattingCodes(p_146235_1_); + } + + private void func_146237_a(IChatComponent p_146237_1_, int p_146237_2_, int p_146237_3_, boolean p_146237_4_) + { + if (p_146237_2_ != 0) + { + this.deleteChatLine(p_146237_2_); + } + + int k = MathHelper.floor_float((float)this.func_146228_f() / this.func_146244_h()); + int l = 0; + ChatComponentText chatcomponenttext = new ChatComponentText(""); + ArrayList arraylist = Lists.newArrayList(); + ArrayList arraylist1 = Lists.newArrayList(p_146237_1_); + + for (int i1 = 0; i1 < arraylist1.size(); ++i1) + { + IChatComponent ichatcomponent1 = (IChatComponent)arraylist1.get(i1); + String s = this.func_146235_b(ichatcomponent1.getChatStyle().getFormattingCode() + ichatcomponent1.getUnformattedTextForChat()); + int j1 = this.mc.fontRenderer.getStringWidth(s); + ChatComponentText chatcomponenttext1 = new ChatComponentText(s); + chatcomponenttext1.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + boolean flag1 = false; + + if (l + j1 > k) + { + String s1 = this.mc.fontRenderer.trimStringToWidth(s, k - l, false); + String s2 = s1.length() < s.length() ? s.substring(s1.length()) : null; + + if (s2 != null && s2.length() > 0) + { + int k1 = s1.lastIndexOf(" "); + + if (k1 >= 0 && this.mc.fontRenderer.getStringWidth(s.substring(0, k1)) > 0) + { + s1 = s.substring(0, k1); + s2 = s.substring(k1); + } + + ChatComponentText chatcomponenttext2 = new ChatComponentText(s2); + chatcomponenttext2.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + arraylist1.add(i1 + 1, chatcomponenttext2); + } + + j1 = this.mc.fontRenderer.getStringWidth(s1); + chatcomponenttext1 = new ChatComponentText(s1); + chatcomponenttext1.setChatStyle(ichatcomponent1.getChatStyle().createShallowCopy()); + flag1 = true; + } + + if (l + j1 <= k) + { + l += j1; + chatcomponenttext.appendSibling(chatcomponenttext1); + } + else + { + flag1 = true; + } + + if (flag1) + { + arraylist.add(chatcomponenttext); + l = 0; + chatcomponenttext = new ChatComponentText(""); + } + } + + arraylist.add(chatcomponenttext); + boolean flag2 = this.getChatOpen(); + IChatComponent ichatcomponent2; + + for (Iterator iterator = arraylist.iterator(); iterator.hasNext(); this.field_146253_i.add(0, new ChatLine(p_146237_3_, ichatcomponent2, p_146237_2_))) + { + ichatcomponent2 = (IChatComponent)iterator.next(); + + if (flag2 && this.field_146250_j > 0) + { + this.field_146251_k = true; + this.scroll(1); + } + } + + while (this.field_146253_i.size() > 100) + { + this.field_146253_i.remove(this.field_146253_i.size() - 1); + } + + if (!p_146237_4_) + { + this.chatLines.add(0, new ChatLine(p_146237_3_, p_146237_1_, p_146237_2_)); + + while (this.chatLines.size() > 100) + { + this.chatLines.remove(this.chatLines.size() - 1); + } + } + } + + public void refreshChat() + { + this.field_146253_i.clear(); + this.resetScroll(); + + for (int i = this.chatLines.size() - 1; i >= 0; --i) + { + ChatLine chatline = (ChatLine)this.chatLines.get(i); + this.func_146237_a(chatline.func_151461_a(), chatline.getChatLineID(), chatline.getUpdatedCounter(), true); + } + } + + /** + * Gets the list of messages previously sent through the chat GUI + */ + public List getSentMessages() + { + return this.sentMessages; + } + + /** + * Adds this string to the list of sent messages, for recall using the up/down arrow keys + */ + public void addToSentMessages(String p_146239_1_) + { + if (this.sentMessages.isEmpty() || !((String)this.sentMessages.get(this.sentMessages.size() - 1)).equals(p_146239_1_)) + { + this.sentMessages.add(p_146239_1_); + } + } + + /** + * Resets the chat scroll (executed when the GUI is closed, among others) + */ + public void resetScroll() + { + this.field_146250_j = 0; + this.field_146251_k = false; + } + + /** + * Scrolls the chat by the given number of lines. + */ + public void scroll(int p_146229_1_) + { + this.field_146250_j += p_146229_1_; + int j = this.field_146253_i.size(); + + if (this.field_146250_j > j - this.func_146232_i()) + { + this.field_146250_j = j - this.func_146232_i(); + } + + if (this.field_146250_j <= 0) + { + this.field_146250_j = 0; + this.field_146251_k = false; + } + } + + public IChatComponent func_146236_a(int p_146236_1_, int p_146236_2_) + { + if (!this.getChatOpen()) + { + return null; + } + else + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int k = scaledresolution.getScaleFactor(); + float f = this.func_146244_h(); + int l = p_146236_1_ / k - 3; + int i1 = p_146236_2_ / k - 27; + l = MathHelper.floor_float((float)l / f); + i1 = MathHelper.floor_float((float)i1 / f); + + if (l >= 0 && i1 >= 0) + { + int j1 = Math.min(this.func_146232_i(), this.field_146253_i.size()); + + if (l <= MathHelper.floor_float((float)this.func_146228_f() / this.func_146244_h()) && i1 < this.mc.fontRenderer.FONT_HEIGHT * j1 + j1) + { + int k1 = i1 / this.mc.fontRenderer.FONT_HEIGHT + this.field_146250_j; + + if (k1 >= 0 && k1 < this.field_146253_i.size()) + { + ChatLine chatline = (ChatLine)this.field_146253_i.get(k1); + int l1 = 0; + Iterator iterator = chatline.func_151461_a().iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + + if (ichatcomponent instanceof ChatComponentText) + { + l1 += this.mc.fontRenderer.getStringWidth(this.func_146235_b(((ChatComponentText)ichatcomponent).getChatComponentText_TextValue())); + + if (l1 > l) + { + return ichatcomponent; + } + } + } + } + + return null; + } + else + { + return null; + } + } + else + { + return null; + } + } + } + + /** + * Returns true if the chat GUI is open + */ + public boolean getChatOpen() + { + return this.mc.currentScreen instanceof GuiChat; + } + + /** + * finds and deletes a Chat line by ID + */ + public void deleteChatLine(int p_146242_1_) + { + Iterator iterator = this.field_146253_i.iterator(); + ChatLine chatline; + + while (iterator.hasNext()) + { + chatline = (ChatLine)iterator.next(); + + if (chatline.getChatLineID() == p_146242_1_) + { + iterator.remove(); + } + } + + iterator = this.chatLines.iterator(); + + while (iterator.hasNext()) + { + chatline = (ChatLine)iterator.next(); + + if (chatline.getChatLineID() == p_146242_1_) + { + iterator.remove(); + break; + } + } + } + + public int func_146228_f() + { + return func_146233_a(this.mc.gameSettings.chatWidth); + } + + public int func_146246_g() + { + return func_146243_b(this.getChatOpen() ? this.mc.gameSettings.chatHeightFocused : this.mc.gameSettings.chatHeightUnfocused); + } + + public float func_146244_h() + { + return this.mc.gameSettings.chatScale; + } + + public static int func_146233_a(float p_146233_0_) + { + short short1 = 320; + byte b0 = 40; + return MathHelper.floor_float(p_146233_0_ * (float)(short1 - b0) + (float)b0); + } + + public static int func_146243_b(float p_146243_0_) + { + short short1 = 180; + byte b0 = 20; + return MathHelper.floor_float(p_146243_0_ * (float)(short1 - b0) + (float)b0); + } + + public int func_146232_i() + { + return this.func_146246_g() / 9; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionButton.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionButton.java new file mode 100644 index 0000000..0910c58 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionButton.java @@ -0,0 +1,34 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class GuiOptionButton extends GuiButton +{ + private final GameSettings.Options enumOptions; + private static final String __OBFID = "CL_00000676"; + + public GuiOptionButton(int p_i45011_1_, int p_i45011_2_, int p_i45011_3_, String p_i45011_4_) + { + this(p_i45011_1_, p_i45011_2_, p_i45011_3_, (GameSettings.Options)null, p_i45011_4_); + } + + public GuiOptionButton(int p_i45012_1_, int p_i45012_2_, int p_i45012_3_, int p_i45012_4_, int p_i45012_5_, String p_i45012_6_) + { + super(p_i45012_1_, p_i45012_2_, p_i45012_3_, p_i45012_4_, p_i45012_5_, p_i45012_6_); + this.enumOptions = null; + } + + public GuiOptionButton(int p_i45013_1_, int p_i45013_2_, int p_i45013_3_, GameSettings.Options p_i45013_4_, String p_i45013_5_) + { + super(p_i45013_1_, p_i45013_2_, p_i45013_3_, 150, 20, p_i45013_5_); + this.enumOptions = p_i45013_4_; + } + + public GameSettings.Options returnEnumOptions() + { + return this.enumOptions; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionSlider.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionSlider.java new file mode 100644 index 0000000..01377e1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionSlider.java @@ -0,0 +1,116 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiOptionSlider extends GuiButton +{ + private float field_146134_p; + public boolean field_146135_o; + private GameSettings.Options field_146133_q; + private final float field_146132_r; + private final float field_146131_s; + private static final String __OBFID = "CL_00000680"; + + public GuiOptionSlider(int p_i45016_1_, int p_i45016_2_, int p_i45016_3_, GameSettings.Options p_i45016_4_) + { + this(p_i45016_1_, p_i45016_2_, p_i45016_3_, p_i45016_4_, 0.0F, 1.0F); + } + + public GuiOptionSlider(int p_i45017_1_, int p_i45017_2_, int p_i45017_3_, GameSettings.Options p_i45017_4_, float p_i45017_5_, float p_i45017_6_) + { + super(p_i45017_1_, p_i45017_2_, p_i45017_3_, 150, 20, ""); + this.field_146134_p = 1.0F; + this.field_146133_q = p_i45017_4_; + this.field_146132_r = p_i45017_5_; + this.field_146131_s = p_i45017_6_; + Minecraft minecraft = Minecraft.getMinecraft(); + this.field_146134_p = p_i45017_4_.normalizeValue(minecraft.gameSettings.getOptionFloatValue(p_i45017_4_)); + this.displayString = minecraft.gameSettings.getKeyBinding(p_i45017_4_); + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over + * this button. + */ + public int getHoverState(boolean mouseOver) + { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.field_146135_o) + { + this.field_146134_p = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.field_146134_p < 0.0F) + { + this.field_146134_p = 0.0F; + } + + if (this.field_146134_p > 1.0F) + { + this.field_146134_p = 1.0F; + } + + float f = this.field_146133_q.denormalizeValue(this.field_146134_p); + mc.gameSettings.setOptionFloatValue(this.field_146133_q, f); + this.field_146134_p = this.field_146133_q.normalizeValue(f); + this.displayString = mc.gameSettings.getKeyBinding(this.field_146133_q); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146134_p * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146134_p * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent + * e). + */ + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.field_146134_p = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.field_146134_p < 0.0F) + { + this.field_146134_p = 0.0F; + } + + if (this.field_146134_p > 1.0F) + { + this.field_146134_p = 1.0F; + } + + mc.gameSettings.setOptionFloatValue(this.field_146133_q, this.field_146133_q.denormalizeValue(this.field_146134_p)); + this.displayString = mc.gameSettings.getKeyBinding(this.field_146133_q); + this.field_146135_o = true; + return true; + } + else + { + return false; + } + } + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int mouseX, int mouseY) + { + this.field_146135_o = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptions.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptions.java new file mode 100644 index 0000000..763f4ab --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptions.java @@ -0,0 +1,177 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundEventAccessorComposite; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.gui.stream.GuiStreamOptions; +import net.minecraft.client.gui.stream.GuiStreamUnavailable; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.stream.IStream; + +@SideOnly(Side.CLIENT) +public class GuiOptions extends GuiScreen implements GuiYesNoCallback +{ + private static final GameSettings.Options[] field_146440_f = new GameSettings.Options[] {GameSettings.Options.FOV, GameSettings.Options.DIFFICULTY}; + private final GuiScreen field_146441_g; + private final GameSettings field_146443_h; + protected String field_146442_a = "Options"; + private static final String __OBFID = "CL_00000700"; + + public GuiOptions(GuiScreen p_i1046_1_, GameSettings p_i1046_2_) + { + this.field_146441_g = p_i1046_1_; + this.field_146443_h = p_i1046_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + int i = 0; + this.field_146442_a = I18n.format("options.title", new Object[0]); + GameSettings.Options[] aoptions = field_146440_f; + int j = aoptions.length; + + for (int k = 0; k < j; ++k) + { + GameSettings.Options options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), options)); + } + else + { + GuiOptionButton guioptionbutton = new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), options, this.field_146443_h.getKeyBinding(options)); + + if (options == GameSettings.Options.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) + { + guioptionbutton.enabled = false; + guioptionbutton.displayString = I18n.format("options.difficulty", new Object[0]) + ": " + I18n.format("options.difficulty.hardcore", new Object[0]); + } + + this.buttonList.add(guioptionbutton); + } + + ++i; + } + + this.buttonList.add(new GuiButton(8675309, this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, "Super Secret Settings...") + { + private static final String __OBFID = "CL_00000701"; + public void func_146113_a(SoundHandler soundHandlerIn) + { + SoundEventAccessorComposite soundeventaccessorcomposite = soundHandlerIn.getRandomSoundFromCategories(new SoundCategory[] {SoundCategory.ANIMALS, SoundCategory.BLOCKS, SoundCategory.MOBS, SoundCategory.PLAYERS, SoundCategory.WEATHER}); + + if (soundeventaccessorcomposite != null) + { + soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(soundeventaccessorcomposite.getSoundEventLocation(), 0.5F)); + } + } + }); + this.buttonList.add(new GuiButton(106, this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.sounds", new Object[0]))); + this.buttonList.add(new GuiButton(107, this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, I18n.format("options.stream", new Object[0]))); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.video", new Object[0]))); + this.buttonList.add(new GuiButton(100, this.width / 2 + 5, this.height / 6 + 96 - 6, 150, 20, I18n.format("options.controls", new Object[0]))); + this.buttonList.add(new GuiButton(102, this.width / 2 - 155, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.language", new Object[0]))); + this.buttonList.add(new GuiButton(103, this.width / 2 + 5, this.height / 6 + 120 - 6, 150, 20, I18n.format("options.multiplayer.title", new Object[0]))); + this.buttonList.add(new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20, I18n.format("options.resourcepack", new Object[0]))); + this.buttonList.add(new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20, I18n.format("options.snooper.view", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + this.field_146443_h.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.field_146443_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + + if (button.id == 8675309) + { + this.mc.entityRenderer.activateNextShader(); + } + + if (button.id == 101) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiVideoSettings(this, this.field_146443_h)); + } + + if (button.id == 100) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiControls(this, this.field_146443_h)); + } + + if (button.id == 102) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiLanguage(this, this.field_146443_h, this.mc.getLanguageManager())); + } + + if (button.id == 103) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new ScreenChatOptions(this, this.field_146443_h)); + } + + if (button.id == 104) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiSnooper(this, this.field_146443_h)); + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146441_g); + } + + if (button.id == 105) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenResourcePacks(this)); + } + + if (button.id == 106) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenOptionsSounds(this, this.field_146443_h)); + } + + if (button.id == 107) + { + this.mc.gameSettings.saveOptions(); + IStream istream = this.mc.func_152346_Z(); + + if (istream.func_152936_l() && istream.func_152928_D()) + { + this.mc.displayGuiScreen(new GuiStreamOptions(this, this.field_146443_h)); + } + else + { + GuiStreamUnavailable.func_152321_a(this); + } + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146442_a, this.width / 2, 15, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionsRowList.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionsRowList.java new file mode 100644 index 0000000..2d9e7a6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiOptionsRowList.java @@ -0,0 +1,147 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class GuiOptionsRowList extends GuiListExtended +{ + private final List field_148184_k = Lists.newArrayList(); + private static final String __OBFID = "CL_00000677"; + + public GuiOptionsRowList(Minecraft p_i45015_1_, int p_i45015_2_, int p_i45015_3_, int p_i45015_4_, int p_i45015_5_, int p_i45015_6_, GameSettings.Options ... p_i45015_7_) + { + super(p_i45015_1_, p_i45015_2_, p_i45015_3_, p_i45015_4_, p_i45015_5_, p_i45015_6_); + this.field_148163_i = false; + + for (int j1 = 0; j1 < p_i45015_7_.length; j1 += 2) + { + GameSettings.Options options = p_i45015_7_[j1]; + GameSettings.Options options1 = j1 < p_i45015_7_.length - 1 ? p_i45015_7_[j1 + 1] : null; + GuiButton guibutton = this.func_148182_a(p_i45015_1_, p_i45015_2_ / 2 - 155, 0, options); + GuiButton guibutton1 = this.func_148182_a(p_i45015_1_, p_i45015_2_ / 2 - 155 + 160, 0, options1); + this.field_148184_k.add(new GuiOptionsRowList.Row(guibutton, guibutton1)); + } + } + + private GuiButton func_148182_a(Minecraft p_148182_1_, int p_148182_2_, int p_148182_3_, GameSettings.Options p_148182_4_) + { + if (p_148182_4_ == null) + { + return null; + } + else + { + int k = p_148182_4_.returnEnumOrdinal(); + return (GuiButton)(p_148182_4_.getEnumFloat() ? new GuiOptionSlider(k, p_148182_2_, p_148182_3_, p_148182_4_) : new GuiOptionButton(k, p_148182_2_, p_148182_3_, p_148182_4_, p_148182_1_.gameSettings.getKeyBinding(p_148182_4_))); + } + } + + /** + * Gets the IGuiListEntry object for the given index + */ + public GuiOptionsRowList.Row getListEntry(int p_148180_1_) + { + return (GuiOptionsRowList.Row)this.field_148184_k.get(p_148180_1_); + } + + protected int getSize() + { + return this.field_148184_k.size(); + } + + /** + * Gets the width of the list + */ + public int getListWidth() + { + return 400; + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 32; + } + + @SideOnly(Side.CLIENT) + public static class Row implements GuiListExtended.IGuiListEntry + { + private final Minecraft field_148325_a = Minecraft.getMinecraft(); + private final GuiButton field_148323_b; + private final GuiButton field_148324_c; + private static final String __OBFID = "CL_00000678"; + + public Row(GuiButton p_i45014_1_, GuiButton p_i45014_2_) + { + this.field_148323_b = p_i45014_1_; + this.field_148324_c = p_i45014_2_; + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + if (this.field_148323_b != null) + { + this.field_148323_b.yPosition = p_148279_3_; + this.field_148323_b.drawButton(this.field_148325_a, p_148279_7_, p_148279_8_); + } + + if (this.field_148324_c != null) + { + this.field_148324_c.yPosition = p_148279_3_; + this.field_148324_c.drawButton(this.field_148325_a, p_148279_7_, p_148279_8_); + } + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.field_148323_b.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) + { + if (this.field_148323_b instanceof GuiOptionButton) + { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148323_b).returnEnumOptions(), 1); + this.field_148323_b.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148323_b.id)); + } + + return true; + } + else if (this.field_148324_c != null && this.field_148324_c.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) + { + if (this.field_148324_c instanceof GuiOptionButton) + { + this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton)this.field_148324_c).returnEnumOptions(), 1); + this.field_148324_c.displayString = this.field_148325_a.gameSettings.getKeyBinding(GameSettings.Options.getEnumOptions(this.field_148324_c.id)); + } + + return true; + } + else + { + return false; + } + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) + { + if (this.field_148323_b != null) + { + this.field_148323_b.mouseReleased(p_148277_2_, p_148277_3_); + } + + if (this.field_148324_c != null) + { + this.field_148324_c.mouseReleased(p_148277_2_, p_148277_3_); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiPlayerInfo.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiPlayerInfo.java new file mode 100644 index 0000000..acbbadb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiPlayerInfo.java @@ -0,0 +1,22 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiPlayerInfo +{ + /** The string value of the object */ + public final String name; + /** Player name in lowercase. */ + private final String nameinLowerCase; + /** Player response time to server in milliseconds */ + public int responseTime; + private static final String __OBFID = "CL_00000888"; + + public GuiPlayerInfo(String p_i1190_1_) + { + this.name = p_i1190_1_; + this.nameinLowerCase = p_i1190_1_.toLowerCase(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRenameWorld.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRenameWorld.java new file mode 100644 index 0000000..2d00458 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRenameWorld.java @@ -0,0 +1,108 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.WorldInfo; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiRenameWorld extends GuiScreen +{ + private GuiScreen field_146585_a; + private GuiTextField field_146583_f; + private final String field_146584_g; + private static final String __OBFID = "CL_00000709"; + + public GuiRenameWorld(GuiScreen p_i1050_1_, String p_i1050_2_) + { + this.field_146585_a = p_i1050_1_; + this.field_146584_g = p_i1050_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_146583_f.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.renameButton", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0]))); + ISaveFormat isaveformat = this.mc.getSaveLoader(); + WorldInfo worldinfo = isaveformat.getWorldInfo(this.field_146584_g); + String s = worldinfo.getWorldName(); + this.field_146583_f = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); + this.field_146583_f.setFocused(true); + this.field_146583_f.setText(s); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_146585_a); + } + else if (button.id == 0) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.renameWorld(this.field_146584_g, this.field_146583_f.getText().trim()); + this.mc.displayGuiScreen(this.field_146585_a); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + this.field_146583_f.textboxKeyTyped(typedChar, keyCode); + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146583_f.getText().trim().length() > 0; + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146583_f.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectWorld.renameTitle", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("selectWorld.enterName", new Object[0]), this.width / 2 - 100, 47, 10526880); + this.field_146583_f.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRepair.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRepair.java new file mode 100644 index 0000000..67680df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiRepair.java @@ -0,0 +1,213 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.apache.commons.io.Charsets; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiRepair extends GuiContainer implements ICrafting +{ + private static final ResourceLocation field_147093_u = new ResourceLocation("textures/gui/container/anvil.png"); + private ContainerRepair field_147092_v; + private GuiTextField field_147091_w; + private InventoryPlayer field_147094_x; + private static final String __OBFID = "CL_00000738"; + + public GuiRepair(InventoryPlayer p_i1073_1_, World p_i1073_2_, int p_i1073_3_, int p_i1073_4_, int p_i1073_5_) + { + super(new ContainerRepair(p_i1073_1_, p_i1073_2_, p_i1073_3_, p_i1073_4_, p_i1073_5_, Minecraft.getMinecraft().thePlayer)); + this.field_147094_x = p_i1073_1_; + this.field_147092_v = (ContainerRepair)this.inventorySlots; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + Keyboard.enableRepeatEvents(true); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.field_147091_w = new GuiTextField(this.fontRendererObj, i + 62, j + 24, 103, 12); + this.field_147091_w.setTextColor(-1); + this.field_147091_w.setDisabledTextColour(-1); + this.field_147091_w.setEnableBackgroundDrawing(false); + this.field_147091_w.setMaxStringLength(40); + this.inventorySlots.removeCraftingFromCrafters(this); + this.inventorySlots.addCraftingToCrafters(this); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + super.onGuiClosed(); + Keyboard.enableRepeatEvents(false); + this.inventorySlots.removeCraftingFromCrafters(this); + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.fontRendererObj.drawString(I18n.format("container.repair", new Object[0]), 60, 6, 4210752); + + if (this.field_147092_v.maximumCost > 0) + { + int k = 8453920; + boolean flag = true; + String s = I18n.format("container.repair.cost", new Object[] {Integer.valueOf(this.field_147092_v.maximumCost)}); + + if (this.field_147092_v.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) + { + s = I18n.format("container.repair.expensive", new Object[0]); + k = 16736352; + } + else if (!this.field_147092_v.getSlot(2).getHasStack()) + { + flag = false; + } + else if (!this.field_147092_v.getSlot(2).canTakeStack(this.field_147094_x.player)) + { + k = 16736352; + } + + if (flag) + { + int l = -16777216 | (k & 16579836) >> 2 | k & -16777216; + int i1 = this.xSize - 8 - this.fontRendererObj.getStringWidth(s); + byte b0 = 67; + + if (this.fontRendererObj.getUnicodeFlag()) + { + drawRect(i1 - 3, b0 - 2, this.xSize - 7, b0 + 10, -16777216); + drawRect(i1 - 2, b0 - 1, this.xSize - 8, b0 + 9, -12895429); + } + else + { + this.fontRendererObj.drawString(s, i1, b0 + 1, l); + this.fontRendererObj.drawString(s, i1 + 1, b0, l); + this.fontRendererObj.drawString(s, i1 + 1, b0 + 1, l); + } + + this.fontRendererObj.drawString(s, i1, b0, k); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (this.field_147091_w.textboxKeyTyped(typedChar, keyCode)) + { + this.func_147090_g(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + private void func_147090_g() + { + String s = this.field_147091_w.getText(); + Slot slot = this.field_147092_v.getSlot(0); + + if (slot != null && slot.getHasStack() && !slot.getStack().hasDisplayName() && s.equals(slot.getStack().getDisplayName())) + { + s = ""; + } + + this.field_147092_v.updateItemName(s); + this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", s.getBytes(Charsets.UTF_8))); + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_147091_w.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.field_147091_w.drawTextBox(); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147093_u); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(k + 59, l + 20, 0, this.ySize + (this.field_147092_v.getSlot(0).getHasStack() ? 0 : 16), 110, 16); + + if ((this.field_147092_v.getSlot(0).getHasStack() || this.field_147092_v.getSlot(1).getHasStack()) && !this.field_147092_v.getSlot(2).getHasStack()) + { + this.drawTexturedModalRect(k + 99, l + 45, this.xSize, 0, 28, 21); + } + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) + { + this.sendSlotContents(p_71110_1_, 0, p_71110_1_.getSlot(0).getStack()); + } + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) + { + if (p_71111_2_ == 0) + { + this.field_147091_w.setText(p_71111_3_ == null ? "" : p_71111_3_.getDisplayName()); + this.field_147091_w.setEnabled(p_71111_3_ != null); + + if (p_71111_3_ != null) + { + this.func_147090_g(); + } + } + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackAvailable.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackAvailable.java new file mode 100644 index 0000000..c25f3b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackAvailable.java @@ -0,0 +1,23 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiResourcePackAvailable extends GuiResourcePackList +{ + private static final String __OBFID = "CL_00000824"; + + public GuiResourcePackAvailable(Minecraft p_i45054_1_, int p_i45054_2_, int p_i45054_3_, List p_i45054_4_) + { + super(p_i45054_1_, p_i45054_2_, p_i45054_3_, p_i45054_4_); + } + + protected String func_148202_k() + { + return I18n.format("resourcePack.available.title", new Object[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackList.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackList.java new file mode 100644 index 0000000..85e09ef --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackList.java @@ -0,0 +1,68 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.ResourcePackListEntry; +import net.minecraft.util.EnumChatFormatting; + +@SideOnly(Side.CLIENT) +public abstract class GuiResourcePackList extends GuiListExtended +{ + protected final Minecraft field_148205_k; + protected final List field_148204_l; + private static final String __OBFID = "CL_00000825"; + + public GuiResourcePackList(Minecraft p_i45055_1_, int p_i45055_2_, int p_i45055_3_, List p_i45055_4_) + { + super(p_i45055_1_, p_i45055_2_, p_i45055_3_, 32, p_i45055_3_ - 55 + 4, 36); + this.field_148205_k = p_i45055_1_; + this.field_148204_l = p_i45055_4_; + this.field_148163_i = false; + this.setHasListHeader(true, (int)((float)p_i45055_1_.fontRenderer.FONT_HEIGHT * 1.5F)); + } + + /** + * Handles drawing a list's header row. + */ + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + String s = EnumChatFormatting.UNDERLINE + "" + EnumChatFormatting.BOLD + this.func_148202_k(); + this.field_148205_k.fontRenderer.drawString(s, p_148129_1_ + this.width / 2 - this.field_148205_k.fontRenderer.getStringWidth(s) / 2, Math.min(this.top + 3, p_148129_2_), 16777215); + } + + protected abstract String func_148202_k(); + + public List func_148201_l() + { + return this.field_148204_l; + } + + protected int getSize() + { + return this.func_148201_l().size(); + } + + /** + * Gets the IGuiListEntry object for the given index + */ + public ResourcePackListEntry getListEntry(int p_148180_1_) + { + return (ResourcePackListEntry)this.func_148201_l().get(p_148180_1_); + } + + /** + * Gets the width of the list + */ + public int getListWidth() + { + return this.width; + } + + protected int getScrollBarX() + { + return this.right - 6; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackSelected.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackSelected.java new file mode 100644 index 0000000..d5e393e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiResourcePackSelected.java @@ -0,0 +1,23 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiResourcePackSelected extends GuiResourcePackList +{ + private static final String __OBFID = "CL_00000827"; + + public GuiResourcePackSelected(Minecraft p_i45056_1_, int p_i45056_2_, int p_i45056_3_, List p_i45056_4_) + { + super(p_i45056_1_, p_i45056_2_, p_i45056_3_, p_i45056_4_); + } + + protected String func_148202_k() + { + return I18n.format("resourcePack.selected.title", new Object[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreen.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreen.java new file mode 100644 index 0000000..8165635 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreen.java @@ -0,0 +1,451 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.Toolkit; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; +import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent; +import net.minecraftforge.common.MinecraftForge; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiScreen extends Gui +{ + /** Holds a instance of RenderItem, used to draw the achievement icons on screen (is based on ItemStack) */ + protected static RenderItem itemRender = new RenderItem(); + /** Reference to the Minecraft object. */ + public Minecraft mc; + /** The width of the screen object. */ + public int width; + /** The height of the screen object. */ + public int height; + /** A list of all the buttons in this container. */ + protected List buttonList = new ArrayList(); + /** A list of all the labels in this container. */ + protected List labelList = new ArrayList(); + public boolean allowUserInput; + /** The FontRenderer used by GuiScreen */ + protected FontRenderer fontRendererObj; + /** The button that was just pressed. */ + private GuiButton selectedButton; + private int eventButton; + private long lastMouseEvent; + private int field_146298_h; + private static final String __OBFID = "CL_00000710"; + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + int k; + + for (k = 0; k < this.buttonList.size(); ++k) + { + ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, mouseX, mouseY); + } + + for (k = 0; k < this.labelList.size(); ++k) + { + ((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, mouseX, mouseY); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == 1) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + } + + /** + * Returns a string stored in the system clipboard. + */ + public static String getClipboardString() + { + try + { + Transferable transferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null); + + if (transferable != null && transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) + { + return (String)transferable.getTransferData(DataFlavor.stringFlavor); + } + } + catch (Exception exception) + { + ; + } + + return ""; + } + + /** + * Stores the given string in the system clipboard + */ + public static void setClipboardString(String copyText) + { + try + { + StringSelection stringselection = new StringSelection(copyText); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringselection, (ClipboardOwner)null); + } + catch (Exception exception) + { + ; + } + } + + protected void renderToolTip(ItemStack itemIn, int x, int y) + { + List list = itemIn.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + + for (int k = 0; k < list.size(); ++k) + { + if (k == 0) + { + list.set(k, itemIn.getRarity().rarityColor + (String)list.get(k)); + } + else + { + list.set(k, EnumChatFormatting.GRAY + (String)list.get(k)); + } + } + + FontRenderer font = itemIn.getItem().getFontRenderer(itemIn); + drawHoveringText(list, x, y, (font == null ? fontRendererObj : font)); + } + + /** + * Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current + * mouse x position, current mouse y position. + */ + protected void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) + { + this.func_146283_a(Arrays.asList(new String[] {tabName}), mouseX, mouseY); + } + + protected void func_146283_a(List textLines, int x, int y) + { + drawHoveringText(textLines, x, y, fontRendererObj); + } + + protected void drawHoveringText(List textLines, int x, int y, FontRenderer font) + { + if (!textLines.isEmpty()) + { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int k = 0; + Iterator iterator = textLines.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + int l = font.getStringWidth(s); + + if (l > k) + { + k = l; + } + } + + int j2 = x + 12; + int k2 = y - 12; + int i1 = 8; + + if (textLines.size() > 1) + { + i1 += 2 + (textLines.size() - 1) * 10; + } + + if (j2 + k > this.width) + { + j2 -= 28 + k; + } + + if (k2 + i1 + 6 > this.height) + { + k2 = this.height - i1 - 6; + } + + this.zLevel = 300.0F; + itemRender.zLevel = 300.0F; + int j1 = -267386864; + this.drawGradientRect(j2 - 3, k2 - 4, j2 + k + 3, k2 - 3, j1, j1); + this.drawGradientRect(j2 - 3, k2 + i1 + 3, j2 + k + 3, k2 + i1 + 4, j1, j1); + this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 + i1 + 3, j1, j1); + this.drawGradientRect(j2 - 4, k2 - 3, j2 - 3, k2 + i1 + 3, j1, j1); + this.drawGradientRect(j2 + k + 3, k2 - 3, j2 + k + 4, k2 + i1 + 3, j1, j1); + int k1 = 1347420415; + int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; + this.drawGradientRect(j2 - 3, k2 - 3 + 1, j2 - 3 + 1, k2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(j2 + k + 2, k2 - 3 + 1, j2 + k + 3, k2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 - 3 + 1, k1, k1); + this.drawGradientRect(j2 - 3, k2 + i1 + 2, j2 + k + 3, k2 + i1 + 3, l1, l1); + + for (int i2 = 0; i2 < textLines.size(); ++i2) + { + String s1 = (String)textLines.get(i2); + font.drawStringWithShadow(s1, j2, k2, -1); + + if (i2 == 0) + { + k2 += 2; + } + + k2 += 10; + } + + this.zLevel = 0.0F; + itemRender.zLevel = 0.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + if (mouseButton == 0) + { + for (int l = 0; l < this.buttonList.size(); ++l) + { + GuiButton guibutton = (GuiButton)this.buttonList.get(l); + + if (guibutton.mousePressed(this.mc, mouseX, mouseY)) + { + ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.buttonList); + if (MinecraftForge.EVENT_BUS.post(event)) + break; + this.selectedButton = event.button; + event.button.func_146113_a(this.mc.getSoundHandler()); + this.actionPerformed(event.button); + if (this.equals(this.mc.currentScreen)) + MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.button, this.buttonList)); + } + } + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + if (this.selectedButton != null && state == 0) + { + this.selectedButton.mouseReleased(mouseX, mouseY); + this.selectedButton = null; + } + } + + /** + * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, + * lastButtonClicked & timeSinceMouseClick. + */ + protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {} + + protected void actionPerformed(GuiButton button) {} + + /** + * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call + * Container.validate() + */ + public void setWorldAndResolution(Minecraft mc, int width, int height) + { + this.mc = mc; + this.fontRendererObj = mc.fontRenderer; + this.width = width; + this.height = height; + if (!MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Pre(this, this.buttonList))) + { + this.buttonList.clear(); + this.initGui(); + } + MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Post(this, this.buttonList)); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() {} + + /** + * Delegates mouse and keyboard input. + */ + public void handleInput() + { + if (Mouse.isCreated()) + { + while (Mouse.next()) + { + this.handleMouseInput(); + } + } + + if (Keyboard.isCreated()) + { + while (Keyboard.next()) + { + this.handleKeyboardInput(); + } + } + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() + { + int i = Mouse.getEventX() * this.width / this.mc.displayWidth; + int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + int k = Mouse.getEventButton(); + + if (Mouse.getEventButtonState()) + { + if (this.mc.gameSettings.touchscreen && this.field_146298_h++ > 0) + { + return; + } + + this.eventButton = k; + this.lastMouseEvent = Minecraft.getSystemTime(); + this.mouseClicked(i, j, this.eventButton); + } + else if (k != -1) + { + if (this.mc.gameSettings.touchscreen && --this.field_146298_h > 0) + { + return; + } + + this.eventButton = -1; + this.mouseMovedOrUp(i, j, k); + } + else if (this.eventButton != -1 && this.lastMouseEvent > 0L) + { + long l = Minecraft.getSystemTime() - this.lastMouseEvent; + this.mouseClickMove(i, j, this.eventButton, l); + } + } + + /** + * Handles keyboard input. + */ + public void handleKeyboardInput() + { + if (Keyboard.getEventKeyState()) + { + this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); + } + + this.mc.func_152348_aa(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() {} + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() {} + + /** + * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png + */ + public void drawDefaultBackground() + { + this.drawWorldBackground(0); + } + + public void drawWorldBackground(int tint) + { + if (this.mc.theWorld != null) + { + this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); + } + else + { + this.drawBackground(tint); + } + } + + /** + * Draws the background (i is always 0 as of 1.2.2) + */ + public void drawBackground(int tint) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator tessellator = Tessellator.instance; + this.mc.getTextureManager().bindTexture(optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(4210752); + tessellator.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / f + (float)tint)); + tessellator.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / f), (double)((float)this.height / f + (float)tint)); + tessellator.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / f), (double)tint); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)tint); + tessellator.draw(); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return true; + } + + public void confirmClicked(boolean result, int id) {} + + /** + * Returns true if either windows ctrl key is down or if either mac meta key is down + */ + public static boolean isCtrlKeyDown() + { + return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); + } + + /** + * Returns true if either shift key is down + */ + public static boolean isShiftKeyDown() + { + return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenAddServer.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenAddServer.java new file mode 100644 index 0000000..1c563cb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenAddServer.java @@ -0,0 +1,128 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiScreenAddServer extends GuiScreen +{ + private final GuiScreen field_146310_a; + private final ServerData field_146311_h; + private GuiTextField field_146308_f; + private GuiTextField field_146309_g; + private GuiButton field_152176_i; + private static final String __OBFID = "CL_00000695"; + + public GuiScreenAddServer(GuiScreen p_i1033_1_, ServerData p_i1033_2_) + { + this.field_146310_a = p_i1033_1_; + this.field_146311_h = p_i1033_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_146309_g.updateCursorCounter(); + this.field_146308_f.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 18, I18n.format("addServer.add", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 18, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.field_152176_i = new GuiButton(2, this.width / 2 - 100, this.height / 4 + 72, I18n.format("addServer.resourcePack", new Object[0]) + ": " + this.field_146311_h.func_152586_b().func_152589_a().getFormattedText())); + this.field_146309_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 66, 200, 20); + this.field_146309_g.setFocused(true); + this.field_146309_g.setText(this.field_146311_h.serverName); + this.field_146308_f = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 106, 200, 20); + this.field_146308_f.setMaxStringLength(128); + this.field_146308_f.setText(this.field_146311_h.serverIP); + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146308_f.getText().length() > 0 && this.field_146308_f.getText().split(":").length > 0 && this.field_146309_g.getText().length() > 0; + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 2) + { + this.field_146311_h.func_152584_a(ServerData.ServerResourceMode.values()[(this.field_146311_h.func_152586_b().ordinal() + 1) % ServerData.ServerResourceMode.values().length]); + this.field_152176_i.displayString = I18n.format("addServer.resourcePack", new Object[0]) + ": " + this.field_146311_h.func_152586_b().func_152589_a().getFormattedText(); + } + else if (button.id == 1) + { + this.field_146310_a.confirmClicked(false, 0); + } + else if (button.id == 0) + { + this.field_146311_h.serverName = this.field_146309_g.getText(); + this.field_146311_h.serverIP = this.field_146308_f.getText(); + this.field_146310_a.confirmClicked(true, 0); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + this.field_146309_g.textboxKeyTyped(typedChar, keyCode); + this.field_146308_f.textboxKeyTyped(typedChar, keyCode); + + if (keyCode == 15) + { + this.field_146309_g.setFocused(!this.field_146309_g.isFocused()); + this.field_146308_f.setFocused(!this.field_146308_f.isFocused()); + } + + if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146308_f.getText().length() > 0 && this.field_146308_f.getText().split(":").length > 0 && this.field_146309_g.getText().length() > 0; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146308_f.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146309_g.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("addServer.title", new Object[0]), this.width / 2, 17, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterName", new Object[0]), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp", new Object[0]), this.width / 2 - 100, 94, 10526880); + this.field_146309_g.drawTextBox(); + this.field_146308_f.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenBook.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenBook.java new file mode 100644 index 0000000..9b89867 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenBook.java @@ -0,0 +1,489 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiScreenBook extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); + /** The player editing the book */ + private final EntityPlayer editingPlayer; + private final ItemStack bookObj; + /** Whether the book is signed or can still be edited */ + private final boolean bookIsUnsigned; + private boolean field_146481_r; + private boolean field_146480_s; + /** Update ticks since the gui was opened */ + private int updateCount; + private int bookImageWidth = 192; + private int bookImageHeight = 192; + private int bookTotalPages = 1; + private int currPage; + private NBTTagList bookPages; + private String bookTitle = ""; + private GuiScreenBook.NextPageButton buttonNextPage; + private GuiScreenBook.NextPageButton buttonPreviousPage; + private GuiButton buttonDone; + /** The GuiButton to sign this book. */ + private GuiButton buttonSign; + private GuiButton buttonFinalize; + private GuiButton buttonCancel; + private static final String __OBFID = "CL_00000744"; + + public GuiScreenBook(EntityPlayer p_i1080_1_, ItemStack p_i1080_2_, boolean p_i1080_3_) + { + this.editingPlayer = p_i1080_1_; + this.bookObj = p_i1080_2_; + this.bookIsUnsigned = p_i1080_3_; + + if (p_i1080_2_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_i1080_2_.getTagCompound(); + this.bookPages = nbttagcompound.getTagList("pages", 8); + + if (this.bookPages != null) + { + this.bookPages = (NBTTagList)this.bookPages.copy(); + this.bookTotalPages = this.bookPages.tagCount(); + + if (this.bookTotalPages < 1) + { + this.bookTotalPages = 1; + } + } + } + + if (this.bookPages == null && p_i1080_3_) + { + this.bookPages = new NBTTagList(); + this.bookPages.appendTag(new NBTTagString("")); + this.bookTotalPages = 1; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + ++this.updateCount; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + + if (this.bookIsUnsigned) + { + this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.format("book.signButton", new Object[0]))); + this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.format("book.finalizeButton", new Object[0]))); + this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.format("gui.cancel", new Object[0]))); + } + else + { + this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.format("gui.done", new Object[0]))); + } + + int i = (this.width - this.bookImageWidth) / 2; + byte b0 = 2; + this.buttonList.add(this.buttonNextPage = new GuiScreenBook.NextPageButton(1, i + 120, b0 + 154, true)); + this.buttonList.add(this.buttonPreviousPage = new GuiScreenBook.NextPageButton(2, i + 38, b0 + 154, false)); + this.updateButtons(); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + } + + private void updateButtons() + { + this.buttonNextPage.visible = !this.field_146480_s && (this.currPage < this.bookTotalPages - 1 || this.bookIsUnsigned); + this.buttonPreviousPage.visible = !this.field_146480_s && this.currPage > 0; + this.buttonDone.visible = !this.bookIsUnsigned || !this.field_146480_s; + + if (this.bookIsUnsigned) + { + this.buttonSign.visible = !this.field_146480_s; + this.buttonCancel.visible = this.field_146480_s; + this.buttonFinalize.visible = this.field_146480_s; + this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; + } + } + + private void sendBookToServer(boolean p_146462_1_) + { + if (this.bookIsUnsigned && this.field_146481_r) + { + if (this.bookPages != null) + { + String s; + + while (this.bookPages.tagCount() > 1) + { + s = this.bookPages.getStringTagAt(this.bookPages.tagCount() - 1); + + if (s.length() != 0) + { + break; + } + + this.bookPages.removeTag(this.bookPages.tagCount() - 1); + } + + if (this.bookObj.hasTagCompound()) + { + NBTTagCompound nbttagcompound = this.bookObj.getTagCompound(); + nbttagcompound.setTag("pages", this.bookPages); + } + else + { + this.bookObj.setTagInfo("pages", this.bookPages); + } + + s = "MC|BEdit"; + + if (p_146462_1_) + { + s = "MC|BSign"; + this.bookObj.setTagInfo("author", new NBTTagString(this.editingPlayer.getCommandSenderName())); + this.bookObj.setTagInfo("title", new NBTTagString(this.bookTitle.trim())); + this.bookObj.func_150996_a(Items.written_book); + } + + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + (new PacketBuffer(bytebuf)).writeItemStackToBuffer(this.bookObj); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf)); + } + catch (Exception exception) + { + logger.error("Couldn\'t send book info", exception); + } + finally + { + bytebuf.release(); + } + } + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 0) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.sendBookToServer(false); + } + else if (button.id == 3 && this.bookIsUnsigned) + { + this.field_146480_s = true; + } + else if (button.id == 1) + { + if (this.currPage < this.bookTotalPages - 1) + { + ++this.currPage; + } + else if (this.bookIsUnsigned) + { + this.addNewPage(); + + if (this.currPage < this.bookTotalPages - 1) + { + ++this.currPage; + } + } + } + else if (button.id == 2) + { + if (this.currPage > 0) + { + --this.currPage; + } + } + else if (button.id == 5 && this.field_146480_s) + { + this.sendBookToServer(true); + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == 4 && this.field_146480_s) + { + this.field_146480_s = false; + } + + this.updateButtons(); + } + } + + private void addNewPage() + { + if (this.bookPages != null && this.bookPages.tagCount() < 50) + { + this.bookPages.appendTag(new NBTTagString("")); + ++this.bookTotalPages; + this.field_146481_r = true; + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + super.keyTyped(typedChar, keyCode); + + if (this.bookIsUnsigned) + { + if (this.field_146480_s) + { + this.func_146460_c(typedChar, keyCode); + } + else + { + this.keyTypedInBook(typedChar, keyCode); + } + } + } + + /** + * Processes keystrokes when editing the text of a book + */ + private void keyTypedInBook(char p_146463_1_, int p_146463_2_) + { + switch (p_146463_1_) + { + case 22: + this.func_146459_b(GuiScreen.getClipboardString()); + return; + default: + switch (p_146463_2_) + { + case 14: + String s = this.func_146456_p(); + + if (s.length() > 0) + { + this.func_146457_a(s.substring(0, s.length() - 1)); + } + + return; + case 28: + case 156: + this.func_146459_b("\n"); + return; + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_146463_1_)) + { + this.func_146459_b(Character.toString(p_146463_1_)); + } + } + } + } + + private void func_146460_c(char p_146460_1_, int p_146460_2_) + { + switch (p_146460_2_) + { + case 14: + if (!this.bookTitle.isEmpty()) + { + this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); + this.updateButtons(); + } + + return; + case 28: + case 156: + if (!this.bookTitle.isEmpty()) + { + this.sendBookToServer(true); + this.mc.displayGuiScreen((GuiScreen)null); + } + + return; + default: + if (this.bookTitle.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(p_146460_1_)) + { + this.bookTitle = this.bookTitle + Character.toString(p_146460_1_); + this.updateButtons(); + this.field_146481_r = true; + } + } + } + + private String func_146456_p() + { + return this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount() ? this.bookPages.getStringTagAt(this.currPage) : ""; + } + + private void func_146457_a(String p_146457_1_) + { + if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) + { + this.bookPages.func_150304_a(this.currPage, new NBTTagString(p_146457_1_)); + this.field_146481_r = true; + } + } + + private void func_146459_b(String p_146459_1_) + { + String s1 = this.func_146456_p(); + String s2 = s1 + p_146459_1_; + int i = this.fontRendererObj.splitStringWidth(s2 + "" + EnumChatFormatting.BLACK + "_", 118); + + if (i <= 118 && s2.length() < 256) + { + this.func_146457_a(s2); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(bookGuiTextures); + int k = (this.width - this.bookImageWidth) / 2; + byte b0 = 2; + this.drawTexturedModalRect(k, b0, 0, 0, this.bookImageWidth, this.bookImageHeight); + String s; + String s1; + int l; + + if (this.field_146480_s) + { + s = this.bookTitle; + + if (this.bookIsUnsigned) + { + if (this.updateCount / 6 % 2 == 0) + { + s = s + "" + EnumChatFormatting.BLACK + "_"; + } + else + { + s = s + "" + EnumChatFormatting.GRAY + "_"; + } + } + + s1 = I18n.format("book.editTitle", new Object[0]); + l = this.fontRendererObj.getStringWidth(s1); + this.fontRendererObj.drawString(s1, k + 36 + (116 - l) / 2, b0 + 16 + 16, 0); + int i1 = this.fontRendererObj.getStringWidth(s); + this.fontRendererObj.drawString(s, k + 36 + (116 - i1) / 2, b0 + 48, 0); + String s2 = I18n.format("book.byAuthor", new Object[] {this.editingPlayer.getCommandSenderName()}); + int j1 = this.fontRendererObj.getStringWidth(s2); + this.fontRendererObj.drawString(EnumChatFormatting.DARK_GRAY + s2, k + 36 + (116 - j1) / 2, b0 + 48 + 10, 0); + String s3 = I18n.format("book.finalizeWarning", new Object[0]); + this.fontRendererObj.drawSplitString(s3, k + 36, b0 + 80, 116, 0); + } + else + { + s = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); + s1 = ""; + + if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) + { + s1 = this.bookPages.getStringTagAt(this.currPage); + } + + if (this.bookIsUnsigned) + { + if (this.fontRendererObj.getBidiFlag()) + { + s1 = s1 + "_"; + } + else if (this.updateCount / 6 % 2 == 0) + { + s1 = s1 + "" + EnumChatFormatting.BLACK + "_"; + } + else + { + s1 = s1 + "" + EnumChatFormatting.GRAY + "_"; + } + } + + l = this.fontRendererObj.getStringWidth(s); + this.fontRendererObj.drawString(s, k - l + this.bookImageWidth - 44, b0 + 16, 0); + this.fontRendererObj.drawSplitString(s1, k + 36, b0 + 16 + 16, 116, 0); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SideOnly(Side.CLIENT) + static class NextPageButton extends GuiButton + { + private final boolean field_146151_o; + private static final String __OBFID = "CL_00000745"; + + public NextPageButton(int p_i1079_1_, int p_i1079_2_, int p_i1079_3_, boolean p_i1079_4_) + { + super(p_i1079_1_, p_i1079_2_, p_i1079_3_, 23, 13, ""); + this.field_146151_o = p_i1079_4_; + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(GuiScreenBook.bookGuiTextures); + int k = 0; + int l = 192; + + if (flag) + { + k += 23; + } + + if (!this.field_146151_o) + { + l += 13; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, k, l, 23, 13); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenDemo.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenDemo.java new file mode 100644 index 0000000..80b6f53 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenDemo.java @@ -0,0 +1,95 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.net.URI; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiScreenDemo extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146348_f = new ResourceLocation("textures/gui/demo_background.png"); + private static final String __OBFID = "CL_00000691"; + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + byte b0 = -16; + this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + b0, 114, 20, I18n.format("demo.help.buy", new Object[0]))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + b0, 114, 20, I18n.format("demo.help.later", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + switch (button.id) + { + case 1: + button.enabled = false; + + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://www.minecraft.net/store?source=demo")}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + } + + break; + case 2: + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + } + + /** + * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png + */ + public void drawDefaultBackground() + { + super.drawDefaultBackground(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146348_f); + int i = (this.width - 248) / 2; + int j = (this.height - 166) / 2; + this.drawTexturedModalRect(i, j, 0, 0, 248, 166); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int k = (this.width - 248) / 2 + 10; + int l = (this.height - 166) / 2 + 8; + this.fontRendererObj.drawString(I18n.format("demo.help.title", new Object[0]), k, l, 2039583); + l += 12; + GameSettings gamesettings = this.mc.gameSettings; + this.fontRendererObj.drawString(I18n.format("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}), k, l, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.movementMouse", new Object[0]), k, l + 12, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}), k, l + 24, 5197647); + this.fontRendererObj.drawString(I18n.format("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}), k, l + 36, 5197647); + this.fontRendererObj.drawSplitString(I18n.format("demo.help.fullWrapped", new Object[0]), k, l + 68, 218, 2039583); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java new file mode 100644 index 0000000..8035d3d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenOptionsSounds.java @@ -0,0 +1,199 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiScreenOptionsSounds extends GuiScreen +{ + private final GuiScreen field_146505_f; + private final GameSettings field_146506_g; + protected String field_146507_a = "Options"; + private String field_146508_h; + private static final String __OBFID = "CL_00000716"; + + public GuiScreenOptionsSounds(GuiScreen p_i45025_1_, GameSettings p_i45025_2_) + { + this.field_146505_f = p_i45025_1_; + this.field_146506_g = p_i45025_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + byte b0 = 0; + this.field_146507_a = I18n.format("options.sounds.title", new Object[0]); + this.field_146508_h = I18n.format("options.off", new Object[0]); + this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.getCategoryId(), this.width / 2 - 155 + b0 % 2 * 160, this.height / 6 - 12 + 24 * (b0 >> 1), SoundCategory.MASTER, true)); + int k = b0 + 2; + SoundCategory[] asoundcategory = SoundCategory.values(); + int i = asoundcategory.length; + + for (int j = 0; j < i; ++j) + { + SoundCategory soundcategory = asoundcategory[j]; + + if (soundcategory != SoundCategory.MASTER) + { + this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.getCategoryId(), this.width / 2 - 155 + k % 2 * 160, this.height / 6 - 12 + 24 * (k >> 1), soundcategory, false)); + ++k; + } + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146505_f); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146507_a, this.width / 2, 15, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected String func_146504_a(SoundCategory p_146504_1_) + { + float f = this.field_146506_g.getSoundLevel(p_146504_1_); + return f == 0.0F ? this.field_146508_h : (int)(f * 100.0F) + "%"; + } + + @SideOnly(Side.CLIENT) + class Button extends GuiButton + { + private final SoundCategory field_146153_r; + private final String field_146152_s; + public float field_146156_o = 1.0F; + public boolean field_146155_p; + private static final String __OBFID = "CL_00000717"; + + public Button(int p_i45024_2_, int p_i45024_3_, int p_i45024_4_, SoundCategory p_i45024_5_, boolean p_i45024_6_) + { + super(p_i45024_2_, p_i45024_3_, p_i45024_4_, p_i45024_6_ ? 310 : 150, 20, ""); + this.field_146153_r = p_i45024_5_; + this.field_146152_s = I18n.format("soundCategory." + p_i45024_5_.getCategoryName(), new Object[0]); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(p_i45024_5_); + this.field_146156_o = GuiScreenOptionsSounds.this.field_146506_g.getSoundLevel(p_i45024_5_); + } + + /** + * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering + * over this button. + */ + public int getHoverState(boolean mouseOver) + { + return 0; + } + + /** + * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). + */ + protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + if (this.field_146155_p) + { + this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.field_146156_o < 0.0F) + { + this.field_146156_o = 0.0F; + } + + if (this.field_146156_o > 1.0F) + { + this.field_146156_o = 1.0F; + } + + mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + mc.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(this.field_146153_r); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20); + this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20); + } + } + + /** + * Returns true if the mouse has been pressed on this control. Equivalent of + * MouseListener.mousePressed(MouseEvent e). + */ + public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + { + if (super.mousePressed(mc, mouseX, mouseY)) + { + this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8); + + if (this.field_146156_o < 0.0F) + { + this.field_146156_o = 0.0F; + } + + if (this.field_146156_o > 1.0F) + { + this.field_146156_o = 1.0F; + } + + mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o); + mc.gameSettings.saveOptions(); + this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.func_146504_a(this.field_146153_r); + this.field_146155_p = true; + return true; + } + else + { + return false; + } + } + + public void func_146113_a(SoundHandler soundHandlerIn) {} + + /** + * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). + */ + public void mouseReleased(int mouseX, int mouseY) + { + if (this.field_146155_p) + { + if (this.field_146153_r == SoundCategory.MASTER) + { + float f = 1.0F; + } + else + { + GuiScreenOptionsSounds.this.field_146506_g.getSoundLevel(this.field_146153_r); + } + + GuiScreenOptionsSounds.this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + + this.field_146155_p = false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java new file mode 100644 index 0000000..54863c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenRealmsProxy.java @@ -0,0 +1,243 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.realms.RealmsButton; +import net.minecraft.realms.RealmsScreen; + +@SideOnly(Side.CLIENT) +public class GuiScreenRealmsProxy extends GuiScreen +{ + private RealmsScreen field_154330_a; + private static final String __OBFID = "CL_00001847"; + + public GuiScreenRealmsProxy(RealmsScreen p_i1087_1_) + { + this.field_154330_a = p_i1087_1_; + super.buttonList = Collections.synchronizedList(new ArrayList()); + } + + public RealmsScreen func_154321_a() + { + return this.field_154330_a; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_154330_a.init(); + super.initGui(); + } + + public void func_154325_a(String p_154325_1_, int p_154325_2_, int p_154325_3_, int p_154325_4_) + { + super.drawCenteredString(this.fontRendererObj, p_154325_1_, p_154325_2_, p_154325_3_, p_154325_4_); + } + + public void func_154322_b(String p_154322_1_, int p_154322_2_, int p_154322_3_, int p_154322_4_) + { + super.drawString(this.fontRendererObj, p_154322_1_, p_154322_2_, p_154322_3_, p_154322_4_); + } + + /** + * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height + */ + public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) + { + this.field_154330_a.blit(x, y, textureX, textureY, width, height); + super.drawTexturedModalRect(x, y, textureX, textureY, width, height); + } + + /** + * Draws a rectangle with a vertical gradient between the specified colors. + */ + public void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) + { + super.drawGradientRect(left, top, right, bottom, startColor, endColor); + } + + /** + * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png + */ + public void drawDefaultBackground() + { + super.drawDefaultBackground(); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return super.doesGuiPauseGame(); + } + + public void drawWorldBackground(int tint) + { + super.drawWorldBackground(tint); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_154330_a.render(mouseX, mouseY, partialTicks); + } + + public void renderToolTip(ItemStack itemIn, int x, int y) + { + super.renderToolTip(itemIn, x, y); + } + + /** + * Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current + * mouse x position, current mouse y position. + */ + public void drawCreativeTabHoveringText(String tabName, int mouseX, int mouseY) + { + super.drawCreativeTabHoveringText(tabName, mouseX, mouseY); + } + + public void func_146283_a(List textLines, int x, int y) + { + super.func_146283_a(textLines, x, y); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_154330_a.tick(); + super.updateScreen(); + } + + public int func_154329_h() + { + return this.fontRendererObj.FONT_HEIGHT; + } + + public int func_154326_c(String p_154326_1_) + { + return this.fontRendererObj.getStringWidth(p_154326_1_); + } + + public void func_154319_c(String p_154319_1_, int p_154319_2_, int p_154319_3_, int p_154319_4_) + { + this.fontRendererObj.drawStringWithShadow(p_154319_1_, p_154319_2_, p_154319_3_, p_154319_4_); + } + + public List func_154323_a(String p_154323_1_, int p_154323_2_) + { + return this.fontRendererObj.listFormattedStringToWidth(p_154323_1_, p_154323_2_); + } + + public final void actionPerformed(GuiButton button) + { + this.field_154330_a.buttonClicked(((GuiButtonRealmsProxy)button).func_154317_g()); + } + + public void func_154324_i() + { + super.buttonList.clear(); + } + + public void func_154327_a(RealmsButton p_154327_1_) + { + super.buttonList.add(p_154327_1_.getProxy()); + } + + public List func_154320_j() + { + ArrayList arraylist = new ArrayList(super.buttonList.size()); + Iterator iterator = super.buttonList.iterator(); + + while (iterator.hasNext()) + { + GuiButton guibutton = (GuiButton)iterator.next(); + arraylist.add(((GuiButtonRealmsProxy)guibutton).func_154317_g()); + } + + return arraylist; + } + + public void func_154328_b(RealmsButton p_154328_1_) + { + super.buttonList.remove(p_154328_1_); + } + + /** + * Called when the mouse is clicked. + */ + public void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + this.field_154330_a.mouseClicked(mouseX, mouseY, mouseButton); + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() + { + this.field_154330_a.mouseEvent(); + super.handleMouseInput(); + } + + /** + * Handles keyboard input. + */ + public void handleKeyboardInput() + { + this.field_154330_a.keyboardEvent(); + super.handleKeyboardInput(); + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + public void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + this.field_154330_a.mouseReleased(mouseX, mouseY, state); + } + + /** + * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, + * lastButtonClicked & timeSinceMouseClick. + */ + public void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) + { + this.field_154330_a.mouseDragged(mouseX, mouseY, clickedMouseButton, timeSinceLastClick); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + public void keyTyped(char typedChar, int keyCode) + { + this.field_154330_a.keyPressed(typedChar, keyCode); + } + + public void confirmClicked(boolean result, int id) + { + this.field_154330_a.confirmResult(result, id); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + this.field_154330_a.removed(); + super.onGuiClosed(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenResourcePacks.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenResourcePacks.java new file mode 100644 index 0000000..1a3f8e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenResourcePacks.java @@ -0,0 +1,219 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.resources.ResourcePackListEntry; +import net.minecraft.client.resources.ResourcePackListEntryDefault; +import net.minecraft.client.resources.ResourcePackListEntryFound; +import net.minecraft.client.resources.ResourcePackRepository; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.Sys; + +@SideOnly(Side.CLIENT) +public class GuiScreenResourcePacks extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private GuiScreen field_146965_f; + private List field_146966_g; + private List field_146969_h; + private GuiResourcePackAvailable field_146970_i; + private GuiResourcePackSelected field_146967_r; + private static final String __OBFID = "CL_00000820"; + + public GuiScreenResourcePacks(GuiScreen p_i45050_1_) + { + this.field_146965_f = p_i45050_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48, I18n.format("resourcePack.openFolder", new Object[0]))); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0]))); + this.field_146966_g = new ArrayList(); + this.field_146969_h = new ArrayList(); + ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository(); + resourcepackrepository.updateRepositoryEntriesAll(); + ArrayList arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll()); + arraylist.removeAll(resourcepackrepository.getRepositoryEntries()); + Iterator iterator = arraylist.iterator(); + ResourcePackRepository.Entry entry; + + while (iterator.hasNext()) + { + entry = (ResourcePackRepository.Entry)iterator.next(); + this.field_146966_g.add(new ResourcePackListEntryFound(this, entry)); + } + + iterator = Lists.reverse(resourcepackrepository.getRepositoryEntries()).iterator(); + + while (iterator.hasNext()) + { + entry = (ResourcePackRepository.Entry)iterator.next(); + this.field_146969_h.add(new ResourcePackListEntryFound(this, entry)); + } + + this.field_146969_h.add(new ResourcePackListEntryDefault(this)); + this.field_146970_i = new GuiResourcePackAvailable(this.mc, 200, this.height, this.field_146966_g); + this.field_146970_i.setSlotXBoundsFromLeft(this.width / 2 - 4 - 200); + this.field_146970_i.registerScrollButtons(7, 8); + this.field_146967_r = new GuiResourcePackSelected(this.mc, 200, this.height, this.field_146969_h); + this.field_146967_r.setSlotXBoundsFromLeft(this.width / 2 + 4); + this.field_146967_r.registerScrollButtons(7, 8); + } + + public boolean func_146961_a(ResourcePackListEntry p_146961_1_) + { + return this.field_146969_h.contains(p_146961_1_); + } + + public List func_146962_b(ResourcePackListEntry p_146962_1_) + { + return this.func_146961_a(p_146962_1_) ? this.field_146969_h : this.field_146966_g; + } + + public List func_146964_g() + { + return this.field_146966_g; + } + + public List func_146963_h() + { + return this.field_146969_h; + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 2) + { + File file1 = this.mc.getResourcePackRepository().getDirResourcepacks(); + String s = file1.getAbsolutePath(); + + if (Util.getOSType() == Util.EnumOS.OSX) + { + try + { + logger.info(s); + Runtime.getRuntime().exec(new String[] {"/usr/bin/open", s}); + return; + } + catch (IOException ioexception1) + { + logger.error("Couldn\'t open file", ioexception1); + } + } + else if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {s}); + + try + { + Runtime.getRuntime().exec(s1); + return; + } + catch (IOException ioexception) + { + logger.error("Couldn\'t open file", ioexception); + } + } + + boolean flag = false; + + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {file1.toURI()}); + } + catch (Throwable throwable) + { + logger.error("Couldn\'t open link", throwable); + flag = true; + } + + if (flag) + { + logger.info("Opening via system class!"); + Sys.openURL("file://" + s); + } + } + else if (button.id == 1) + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.field_146969_h.iterator(); + + while (iterator.hasNext()) + { + ResourcePackListEntry resourcepacklistentry = (ResourcePackListEntry)iterator.next(); + + if (resourcepacklistentry instanceof ResourcePackListEntryFound) + { + arraylist.add(((ResourcePackListEntryFound)resourcepacklistentry).func_148318_i()); + } + } + + Collections.reverse(arraylist); + this.mc.getResourcePackRepository().func_148527_a(arraylist); + this.mc.gameSettings.resourcePacks.clear(); + iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator.next(); + this.mc.gameSettings.resourcePacks.add(entry.getResourcePackName()); + } + + this.mc.gameSettings.saveOptions(); + this.mc.refreshResources(); + this.mc.displayGuiScreen(this.field_146965_f); + } + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146970_i.func_148179_a(mouseX, mouseY, mouseButton); + this.field_146967_r.func_148179_a(mouseX, mouseY, mouseButton); + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + super.mouseMovedOrUp(mouseX, mouseY, state); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawBackground(0); + this.field_146970_i.drawScreen(mouseX, mouseY, partialTicks); + this.field_146967_r.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.title", new Object[0]), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("resourcePack.folderInfo", new Object[0]), this.width / 2 - 77, this.height - 26, 8421504); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenServerList.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenServerList.java new file mode 100644 index 0000000..47bffd8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenServerList.java @@ -0,0 +1,108 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.resources.I18n; +import org.lwjgl.input.Keyboard; + +@SideOnly(Side.CLIENT) +public class GuiScreenServerList extends GuiScreen +{ + private final GuiScreen field_146303_a; + private final ServerData field_146301_f; + private GuiTextField field_146302_g; + private static final String __OBFID = "CL_00000692"; + + public GuiScreenServerList(GuiScreen p_i1031_1_, ServerData p_i1031_2_) + { + this.field_146303_a = p_i1031_1_; + this.field_146301_f = p_i1031_2_; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + this.field_146302_g.updateCursorCounter(); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectServer.select", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0]))); + this.field_146302_g = new GuiTextField(this.fontRendererObj, this.width / 2 - 100, 116, 200, 20); + this.field_146302_g.setMaxStringLength(128); + this.field_146302_g.setFocused(true); + this.field_146302_g.setText(this.mc.gameSettings.lastServer); + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + this.mc.gameSettings.lastServer = this.field_146302_g.getText(); + this.mc.gameSettings.saveOptions(); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + this.field_146303_a.confirmClicked(false, 0); + } + else if (button.id == 0) + { + this.field_146301_f.serverIP = this.field_146302_g.getText(); + this.field_146303_a.confirmClicked(true, 0); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (this.field_146302_g.textboxKeyTyped(typedChar, keyCode)) + { + ((GuiButton)this.buttonList.get(0)).enabled = this.field_146302_g.getText().length() > 0 && this.field_146302_g.getText().split(":").length > 0; + } + else if (keyCode == 28 || keyCode == 156) + { + this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + this.field_146302_g.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("selectServer.direct", new Object[0]), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("addServer.enterIp", new Object[0]), this.width / 2 - 100, 100, 10526880); + this.field_146302_g.drawTextBox(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenWorking.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenWorking.java new file mode 100644 index 0000000..2fec2a2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiScreenWorking.java @@ -0,0 +1,73 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.IProgressUpdate; + +@SideOnly(Side.CLIENT) +public class GuiScreenWorking extends GuiScreen implements IProgressUpdate +{ + private String field_146591_a = ""; + private String field_146589_f = ""; + private int field_146590_g; + private boolean field_146592_h; + private static final String __OBFID = "CL_00000707"; + + /** + * "Saving level", or the loading,or downloading equivelent + */ + public void displayProgressMessage(String p_73720_1_) + { + this.resetProgressAndMessage(p_73720_1_); + } + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + public void resetProgressAndMessage(String p_73721_1_) + { + this.field_146591_a = p_73721_1_; + this.resetProgresAndWorkingMessage("Working..."); + } + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + public void resetProgresAndWorkingMessage(String p_73719_1_) + { + this.field_146589_f = p_73719_1_; + this.setLoadingProgress(0); + } + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int p_73718_1_) + { + this.field_146590_g = p_73718_1_; + } + + public void func_146586_a() + { + this.field_146592_h = true; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.field_146592_h) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146591_a, this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146589_f + " " + this.field_146590_g + "%", this.width / 2, 90, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSelectWorld.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSelectWorld.java new file mode 100644 index 0000000..9f37ca4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSelectWorld.java @@ -0,0 +1,330 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback +{ + private static final Logger logger = LogManager.getLogger(); + private final DateFormat field_146633_h = new SimpleDateFormat(); + protected GuiScreen field_146632_a; + protected String field_146628_f = "Select world"; + private boolean field_146634_i; + private int field_146640_r; + private java.util.List field_146639_s; + private GuiSelectWorld.List field_146638_t; + private String field_146637_u; + private String field_146636_v; + private String[] field_146635_w = new String[3]; + private boolean field_146643_x; + private GuiButton field_146642_y; + private GuiButton field_146641_z; + private GuiButton field_146630_A; + private GuiButton field_146631_B; + private static final String __OBFID = "CL_00000711"; + + public GuiSelectWorld(GuiScreen p_i1054_1_) + { + this.field_146632_a = p_i1054_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_146628_f = I18n.format("selectWorld.title", new Object[0]); + + try + { + this.func_146627_h(); + } + catch (AnvilConverterException anvilconverterexception) + { + logger.error("Couldn\'t load level list", anvilconverterexception); + this.mc.displayGuiScreen(new GuiErrorScreen("Unable to load worlds", anvilconverterexception.getMessage())); + return; + } + + this.field_146637_u = I18n.format("selectWorld.world", new Object[0]); + this.field_146636_v = I18n.format("selectWorld.conversion", new Object[0]); + this.field_146635_w[WorldSettings.GameType.SURVIVAL.getID()] = I18n.format("gameMode.survival", new Object[0]); + this.field_146635_w[WorldSettings.GameType.CREATIVE.getID()] = I18n.format("gameMode.creative", new Object[0]); + this.field_146635_w[WorldSettings.GameType.ADVENTURE.getID()] = I18n.format("gameMode.adventure", new Object[0]); + this.field_146638_t = new GuiSelectWorld.List(); + this.field_146638_t.registerScrollButtons(4, 5); + this.func_146618_g(); + } + + private void func_146627_h() throws AnvilConverterException + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + this.field_146639_s = isaveformat.getSaveList(); + Collections.sort(this.field_146639_s); + this.field_146640_r = -1; + } + + protected String func_146621_a(int p_146621_1_) + { + return ((SaveFormatComparator)this.field_146639_s.get(p_146621_1_)).getFileName(); + } + + protected String func_146614_d(int p_146614_1_) + { + String s = ((SaveFormatComparator)this.field_146639_s.get(p_146614_1_)).getDisplayName(); + + if (s == null || MathHelper.stringNullOrLengthZero(s)) + { + s = I18n.format("selectWorld.world", new Object[0]) + " " + (p_146614_1_ + 1); + } + + return s; + } + + public void func_146618_g() + { + this.buttonList.add(this.field_146641_z = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.format("selectWorld.select", new Object[0]))); + this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.format("selectWorld.create", new Object[0]))); + this.buttonList.add(this.field_146630_A = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.format("selectWorld.rename", new Object[0]))); + this.buttonList.add(this.field_146642_y = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.format("selectWorld.delete", new Object[0]))); + this.buttonList.add(this.field_146631_B = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.format("selectWorld.recreate", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.format("gui.cancel", new Object[0]))); + this.field_146641_z.enabled = false; + this.field_146642_y.enabled = false; + this.field_146630_A.enabled = false; + this.field_146631_B.enabled = false; + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 2) + { + String s = this.func_146614_d(this.field_146640_r); + + if (s != null) + { + this.field_146643_x = true; + GuiYesNo guiyesno = func_152129_a(this, s, this.field_146640_r); + this.mc.displayGuiScreen(guiyesno); + } + } + else if (button.id == 1) + { + this.func_146615_e(this.field_146640_r); + } + else if (button.id == 3) + { + this.mc.displayGuiScreen(new GuiCreateWorld(this)); + } + else if (button.id == 6) + { + this.mc.displayGuiScreen(new GuiRenameWorld(this, this.func_146621_a(this.field_146640_r))); + } + else if (button.id == 0) + { + this.mc.displayGuiScreen(this.field_146632_a); + } + else if (button.id == 7) + { + GuiCreateWorld guicreateworld = new GuiCreateWorld(this); + ISaveHandler isavehandler = this.mc.getSaveLoader().getSaveLoader(this.func_146621_a(this.field_146640_r), false); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + isavehandler.flush(); + guicreateworld.func_146318_a(worldinfo); + this.mc.displayGuiScreen(guicreateworld); + } + else + { + this.field_146638_t.actionPerformed(button); + } + } + } + + public void func_146615_e(int p_146615_1_) + { + this.mc.displayGuiScreen((GuiScreen)null); + + if (!this.field_146634_i) + { + this.field_146634_i = true; + String s = this.func_146621_a(p_146615_1_); + + if (s == null) + { + s = "World" + p_146615_1_; + } + + String s1 = this.func_146614_d(p_146615_1_); + + if (s1 == null) + { + s1 = "World" + p_146615_1_; + } + + if (this.mc.getSaveLoader().canLoadWorld(s)) + { + FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); + } + } + } + + public void confirmClicked(boolean result, int id) + { + if (this.field_146643_x) + { + this.field_146643_x = false; + + if (result) + { + ISaveFormat isaveformat = this.mc.getSaveLoader(); + isaveformat.flushCache(); + isaveformat.deleteWorldDirectory(this.func_146621_a(id)); + + try + { + this.func_146627_h(); + } + catch (AnvilConverterException anvilconverterexception) + { + logger.error("Couldn\'t load level list", anvilconverterexception); + } + } + + this.mc.displayGuiScreen(this); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_146638_t.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146628_f, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public static GuiYesNo func_152129_a(GuiYesNoCallback p_152129_0_, String p_152129_1_, int p_152129_2_) + { + String s1 = I18n.format("selectWorld.deleteQuestion", new Object[0]); + String s2 = "\'" + p_152129_1_ + "\' " + I18n.format("selectWorld.deleteWarning", new Object[0]); + String s3 = I18n.format("selectWorld.deleteButton", new Object[0]); + String s4 = I18n.format("gui.cancel", new Object[0]); + GuiYesNo guiyesno = new GuiYesNo(p_152129_0_, s1, s2, s3, s4, p_152129_2_); + return guiyesno; + } + + @SideOnly(Side.CLIENT) + class List extends GuiSlot + { + private static final String __OBFID = "CL_00000712"; + + public List() + { + super(GuiSelectWorld.this.mc, GuiSelectWorld.this.width, GuiSelectWorld.this.height, 32, GuiSelectWorld.this.height - 64, 36); + } + + protected int getSize() + { + return GuiSelectWorld.this.field_146639_s.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + GuiSelectWorld.this.field_146640_r = p_148144_1_; + boolean flag1 = GuiSelectWorld.this.field_146640_r >= 0 && GuiSelectWorld.this.field_146640_r < this.getSize(); + GuiSelectWorld.this.field_146641_z.enabled = flag1; + GuiSelectWorld.this.field_146642_y.enabled = flag1; + GuiSelectWorld.this.field_146630_A.enabled = flag1; + GuiSelectWorld.this.field_146631_B.enabled = flag1; + + if (p_148144_2_ && flag1) + { + GuiSelectWorld.this.func_146615_e(p_148144_1_); + } + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return p_148131_1_ == GuiSelectWorld.this.field_146640_r; + } + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return GuiSelectWorld.this.field_146639_s.size() * 36; + } + + protected void drawBackground() + { + GuiSelectWorld.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + SaveFormatComparator saveformatcomparator = (SaveFormatComparator)GuiSelectWorld.this.field_146639_s.get(p_148126_1_); + String s = saveformatcomparator.getDisplayName(); + + if (s == null || MathHelper.stringNullOrLengthZero(s)) + { + s = GuiSelectWorld.this.field_146637_u + " " + (p_148126_1_ + 1); + } + + String s1 = saveformatcomparator.getFileName(); + s1 = s1 + " (" + GuiSelectWorld.this.field_146633_h.format(new Date(saveformatcomparator.getLastTimePlayed())); + s1 = s1 + ")"; + String s2 = ""; + + if (saveformatcomparator.requiresConversion()) + { + s2 = GuiSelectWorld.this.field_146636_v + " " + s2; + } + else + { + s2 = GuiSelectWorld.this.field_146635_w[saveformatcomparator.getEnumGameType().getID()]; + + if (saveformatcomparator.isHardcoreModeEnabled()) + { + s2 = EnumChatFormatting.DARK_RED + I18n.format("gameMode.hardcore", new Object[0]) + EnumChatFormatting.RESET; + } + + if (saveformatcomparator.getCheatsEnabled()) + { + s2 = s2 + ", " + I18n.format("selectWorld.cheats", new Object[0]); + } + } + + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s, p_148126_2_ + 2, p_148126_3_ + 1, 16777215); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s1, p_148126_2_ + 2, p_148126_3_ + 12, 8421504); + GuiSelectWorld.this.drawString(GuiSelectWorld.this.fontRendererObj, s2, p_148126_2_ + 2, p_148126_3_ + 12 + 10, 8421504); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiShareToLan.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiShareToLan.java new file mode 100644 index 0000000..3859295 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiShareToLan.java @@ -0,0 +1,111 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.WorldSettings; + +@SideOnly(Side.CLIENT) +public class GuiShareToLan extends GuiScreen +{ + private final GuiScreen field_146598_a; + private GuiButton field_146596_f; + private GuiButton field_146597_g; + private String field_146599_h = "survival"; + private boolean field_146600_i; + private static final String __OBFID = "CL_00000713"; + + public GuiShareToLan(GuiScreen p_i1055_1_) + { + this.field_146598_a = p_i1055_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.format("lanServer.start", new Object[0]))); + this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(this.field_146597_g = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.format("selectWorld.gameMode", new Object[0]))); + this.buttonList.add(this.field_146596_f = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.format("selectWorld.allowCommands", new Object[0]))); + this.func_146595_g(); + } + + private void func_146595_g() + { + this.field_146597_g.displayString = I18n.format("selectWorld.gameMode", new Object[0]) + " " + I18n.format("selectWorld.gameMode." + this.field_146599_h, new Object[0]); + this.field_146596_f.displayString = I18n.format("selectWorld.allowCommands", new Object[0]) + " "; + + if (this.field_146600_i) + { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.on", new Object[0]); + } + else + { + this.field_146596_f.displayString = this.field_146596_f.displayString + I18n.format("options.off", new Object[0]); + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 102) + { + this.mc.displayGuiScreen(this.field_146598_a); + } + else if (button.id == 104) + { + if (this.field_146599_h.equals("survival")) + { + this.field_146599_h = "creative"; + } + else if (this.field_146599_h.equals("creative")) + { + this.field_146599_h = "adventure"; + } + else + { + this.field_146599_h = "survival"; + } + + this.func_146595_g(); + } + else if (button.id == 103) + { + this.field_146600_i = !this.field_146600_i; + this.func_146595_g(); + } + else if (button.id == 101) + { + this.mc.displayGuiScreen((GuiScreen)null); + String s = this.mc.getIntegratedServer().shareToLAN(WorldSettings.GameType.getByName(this.field_146599_h), this.field_146600_i); + Object object; + + if (s != null) + { + object = new ChatComponentTranslation("commands.publish.started", new Object[] {s}); + } + else + { + object = new ChatComponentText("commands.publish.failed"); + } + + this.mc.ingameGUI.getChatGUI().printChatMessage((IChatComponent)object); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.title", new Object[0]), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("lanServer.otherPlayers", new Object[0]), this.width / 2, 82, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSleepMP.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSleepMP.java new file mode 100644 index 0000000..2fa9cfa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSleepMP.java @@ -0,0 +1,67 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.play.client.C0BPacketEntityAction; + +@SideOnly(Side.CLIENT) +public class GuiSleepMP extends GuiChat +{ + private static final String __OBFID = "CL_00000697"; + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.format("multiplayer.stopSleeping", new Object[0]))); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == 1) + { + this.func_146418_g(); + } + else if (keyCode != 28 && keyCode != 156) + { + super.keyTyped(typedChar, keyCode); + } + else + { + String s = this.inputField.getText().trim(); + + if (!s.isEmpty()) + { + this.func_146403_a(s); // Forge: fix vanilla not adding messages to the sent list while sleeping + } + + this.inputField.setText(""); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 1) + { + this.func_146418_g(); + } + else + { + super.actionPerformed(button); + } + } + + private void func_146418_g() + { + NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue; + nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlot.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlot.java new file mode 100644 index 0000000..4253280 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlot.java @@ -0,0 +1,537 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public abstract class GuiSlot +{ + private final Minecraft mc; + public int width; + public int height; + /** The top of the slot container. Affects the overlays and scrolling. */ + public int top; + /** The bottom of the slot container. Affects the overlays and scrolling. */ + public int bottom; + public int right; + public int left; + /** The height of a slot. */ + public final int slotHeight; + /** The buttonID of the button used to scroll up */ + private int scrollUpButtonID; + /** The buttonID of the button used to scroll down */ + private int scrollDownButtonID; + protected int mouseX; + protected int mouseY; + protected boolean field_148163_i = true; + /** Where the mouse was in the window when you first clicked to scroll */ + private float initialClickY = -2.0F; + /** + * What to multiply the amount you moved your mouse by (used for slowing down scrolling when over the items and not + * on the scroll bar) + */ + private float scrollMultiplier; + /** How far down this slot has been scrolled */ + private float amountScrolled; + /** The element in the list that was selected */ + private int selectedElement = -1; + /** The time when this button was last clicked. */ + private long lastClicked; + /** Set to true if a selected element in this gui will show an outline box */ + private boolean showSelectionBox = true; + private boolean hasListHeader; + public int headerPadding; + private boolean field_148164_v = true; + private static final String __OBFID = "CL_00000679"; + + public GuiSlot(Minecraft p_i1052_1_, int width, int height, int p_i1052_4_, int p_i1052_5_, int p_i1052_6_) + { + this.mc = p_i1052_1_; + this.width = width; + this.height = height; + this.top = p_i1052_4_; + this.bottom = p_i1052_5_; + this.slotHeight = p_i1052_6_; + this.left = 0; + this.right = width; + } + + public void func_148122_a(int p_148122_1_, int p_148122_2_, int p_148122_3_, int p_148122_4_) + { + this.width = p_148122_1_; + this.height = p_148122_2_; + this.top = p_148122_3_; + this.bottom = p_148122_4_; + this.left = 0; + this.right = p_148122_1_; + } + + public void setShowSelectionBox(boolean p_148130_1_) + { + this.showSelectionBox = p_148130_1_; + } + + /** + * Sets hasListHeader and headerHeight. Params: hasListHeader, headerHeight. If hasListHeader is false headerHeight + * is set to 0. + */ + protected void setHasListHeader(boolean p_148133_1_, int p_148133_2_) + { + this.hasListHeader = p_148133_1_; + this.headerPadding = p_148133_2_; + + if (!p_148133_1_) + { + this.headerPadding = 0; + } + } + + protected abstract int getSize(); + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected abstract void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_); + + /** + * Returns true if the element passed in is currently selected + */ + protected abstract boolean isSelected(int p_148131_1_); + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return this.getSize() * this.slotHeight + this.headerPadding; + } + + protected abstract void drawBackground(); + + protected abstract void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_); + + /** + * Handles drawing a list's header row. + */ + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) {} + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) {} + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) {} + + public int func_148124_c(int p_148124_1_, int p_148124_2_) + { + int k = this.left + this.width / 2 - this.getListWidth() / 2; + int l = this.left + this.width / 2 + this.getListWidth() / 2; + int i1 = p_148124_2_ - this.top - this.headerPadding + (int)this.amountScrolled - 4; + int j1 = i1 / this.slotHeight; + return p_148124_1_ < this.getScrollBarX() && p_148124_1_ >= k && p_148124_1_ <= l && j1 >= 0 && i1 >= 0 && j1 < this.getSize() ? j1 : -1; + } + + /** + * Registers the IDs that can be used for the scrollbar's up/down buttons. + */ + public void registerScrollButtons(int p_148134_1_, int p_148134_2_) + { + this.scrollUpButtonID = p_148134_1_; + this.scrollDownButtonID = p_148134_2_; + } + + /** + * Stop the thing from scrolling out of bounds + */ + private void bindAmountScrolled() + { + int i = this.func_148135_f(); + + if (i < 0) + { + i /= 2; + } + + if (!this.field_148163_i && i < 0) + { + i = 0; + } + + if (this.amountScrolled < 0.0F) + { + this.amountScrolled = 0.0F; + } + + if (this.amountScrolled > (float)i) + { + this.amountScrolled = (float)i; + } + } + + public int func_148135_f() + { + return this.getContentHeight() - (this.bottom - this.top - 4); + } + + /** + * Returns the amountScrolled field as an integer. + */ + public int getAmountScrolled() + { + return (int)this.amountScrolled; + } + + public boolean func_148141_e(int p_148141_1_) + { + return p_148141_1_ >= this.top && p_148141_1_ <= this.bottom; + } + + /** + * Scrolls the slot by the given amount. A positive value scrolls down, and a negative value scrolls up. + */ + public void scrollBy(int p_148145_1_) + { + this.amountScrolled += (float)p_148145_1_; + this.bindAmountScrolled(); + this.initialClickY = -2.0F; + } + + public void actionPerformed(GuiButton p_148147_1_) + { + if (p_148147_1_.enabled) + { + if (p_148147_1_.id == this.scrollUpButtonID) + { + this.amountScrolled -= (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2.0F; + this.bindAmountScrolled(); + } + else if (p_148147_1_.id == this.scrollDownButtonID) + { + this.amountScrolled += (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2.0F; + this.bindAmountScrolled(); + } + } + } + + public void drawScreen(int p_148128_1_, int p_148128_2_, float p_148128_3_) + { + this.mouseX = p_148128_1_; + this.mouseY = p_148128_2_; + this.drawBackground(); + int k = this.getSize(); + int l = this.getScrollBarX(); + int i1 = l + 6; + int l1; + int i2; + int k2; + int i3; + + if (p_148128_1_ > this.left && p_148128_1_ < this.right && p_148128_2_ > this.top && p_148128_2_ < this.bottom) + { + if (Mouse.isButtonDown(0) && this.func_148125_i()) + { + if (this.initialClickY == -1.0F) + { + boolean flag1 = true; + + if (p_148128_2_ >= this.top && p_148128_2_ <= this.bottom) + { + int k1 = this.width / 2 - this.getListWidth() / 2; + l1 = this.width / 2 + this.getListWidth() / 2; + i2 = p_148128_2_ - this.top - this.headerPadding + (int)this.amountScrolled - 4; + int j2 = i2 / this.slotHeight; + + if (p_148128_1_ >= k1 && p_148128_1_ <= l1 && j2 >= 0 && i2 >= 0 && j2 < k) + { + boolean flag = j2 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; + this.elementClicked(j2, flag, p_148128_1_, p_148128_2_); + this.selectedElement = j2; + this.lastClicked = Minecraft.getSystemTime(); + } + else if (p_148128_1_ >= k1 && p_148128_1_ <= l1 && i2 < 0) + { + this.func_148132_a(p_148128_1_ - k1, p_148128_2_ - this.top + (int)this.amountScrolled - 4); + flag1 = false; + } + + if (p_148128_1_ >= l && p_148128_1_ <= i1) + { + this.scrollMultiplier = -1.0F; + i3 = this.func_148135_f(); + + if (i3 < 1) + { + i3 = 1; + } + + k2 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); + + if (k2 < 32) + { + k2 = 32; + } + + if (k2 > this.bottom - this.top - 8) + { + k2 = this.bottom - this.top - 8; + } + + this.scrollMultiplier /= (float)(this.bottom - this.top - k2) / (float)i3; + } + else + { + this.scrollMultiplier = 1.0F; + } + + if (flag1) + { + this.initialClickY = (float)p_148128_2_; + } + else + { + this.initialClickY = -2.0F; + } + } + else + { + this.initialClickY = -2.0F; + } + } + else if (this.initialClickY >= 0.0F) + { + this.amountScrolled -= ((float)p_148128_2_ - this.initialClickY) * this.scrollMultiplier; + this.initialClickY = (float)p_148128_2_; + } + } + else + { + for (; !this.mc.gameSettings.touchscreen && Mouse.next(); this.mc.currentScreen.handleMouseInput()) + { + int j1 = Mouse.getEventDWheel(); + + if (j1 != 0) + { + if (j1 > 0) + { + j1 = -1; + } + else if (j1 < 0) + { + j1 = 1; + } + + this.amountScrolled += (float)(j1 * this.slotHeight / 2); + } + } + + this.initialClickY = -1.0F; + } + } + + this.bindAmountScrolled(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator tessellator = Tessellator.instance; + drawContainerBackground(tessellator); + l1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2; + i2 = this.top + 4 - (int)this.amountScrolled; + + if (this.hasListHeader) + { + this.drawListHeader(l1, i2, tessellator); + } + + this.drawSelectionBox(l1, i2, p_148128_1_, p_148128_2_); + GL11.glDisable(GL11.GL_DEPTH_TEST); + byte b0 = 4; + this.overlayBackground(0, this.top, 255, 255); + this.overlayBackground(this.bottom, this.height, 255, 255); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 0, 1); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(0, 0); + tessellator.addVertexWithUV((double)this.left, (double)(this.top + b0), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)this.right, (double)(this.top + b0), 0.0D, 1.0D, 1.0D); + tessellator.setColorRGBA_I(0, 255); + tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(0, 255); + tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); + tessellator.setColorRGBA_I(0, 0); + tessellator.addVertexWithUV((double)this.right, (double)(this.bottom - b0), 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)this.left, (double)(this.bottom - b0), 0.0D, 0.0D, 0.0D); + tessellator.draw(); + i3 = this.func_148135_f(); + + if (i3 > 0) + { + k2 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); + + if (k2 < 32) + { + k2 = 32; + } + + if (k2 > this.bottom - this.top - 8) + { + k2 = this.bottom - this.top - 8; + } + + int l2 = (int)this.amountScrolled * (this.bottom - this.top - k2) / i3 + this.top; + + if (l2 < this.top) + { + l2 = this.top; + } + + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(0, 255); + tessellator.addVertexWithUV((double)l, (double)this.bottom, 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)i1, (double)this.bottom, 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)i1, (double)this.top, 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)l, (double)this.top, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(8421504, 255); + tessellator.addVertexWithUV((double)l, (double)(l2 + k2), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)i1, (double)(l2 + k2), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)i1, (double)l2, 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)l, (double)l2, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(12632256, 255); + tessellator.addVertexWithUV((double)l, (double)(l2 + k2 - 1), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)(i1 - 1), (double)(l2 + k2 - 1), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)(i1 - 1), (double)l2, 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)l, (double)l2, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + } + + this.func_148142_b(p_148128_1_, p_148128_2_); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + } + + public void func_148143_b(boolean p_148143_1_) + { + this.field_148164_v = p_148143_1_; + } + + public boolean func_148125_i() + { + return this.field_148164_v; + } + + /** + * Gets the width of the list + */ + public int getListWidth() + { + return 220; + } + + /** + * Draws the selection box around the selected slot element. + */ + protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int p_148120_3_, int p_148120_4_) + { + int i1 = this.getSize(); + Tessellator tessellator = Tessellator.instance; + + for (int j1 = 0; j1 < i1; ++j1) + { + int k1 = p_148120_2_ + j1 * this.slotHeight + this.headerPadding; + int l1 = this.slotHeight - 4; + + if (k1 <= this.bottom && k1 + l1 >= this.top) + { + if (this.showSelectionBox && this.isSelected(j1)) + { + int i2 = this.left + (this.width / 2 - this.getListWidth() / 2); + int j2 = this.left + this.width / 2 + this.getListWidth() / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(8421504); + tessellator.addVertexWithUV((double)i2, (double)(k1 + l1 + 2), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)j2, (double)(k1 + l1 + 2), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)j2, (double)(k1 - 2), 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)i2, (double)(k1 - 2), 0.0D, 0.0D, 0.0D); + tessellator.setColorOpaque_I(0); + tessellator.addVertexWithUV((double)(i2 + 1), (double)(k1 + l1 + 1), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)(j2 - 1), (double)(k1 + l1 + 1), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)(j2 - 1), (double)(k1 - 1), 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)(i2 + 1), (double)(k1 - 1), 0.0D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + this.drawSlot(j1, p_148120_1_, k1, l1, tessellator, p_148120_3_, p_148120_4_); + } + } + } + + protected int getScrollBarX() + { + return this.width / 2 + 124; + } + + /** + * Overlays the background to hide scrolled items + */ + private void overlayBackground(int p_148136_1_, int p_148136_2_, int p_148136_3_, int p_148136_4_) + { + Tessellator tessellator = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_I(4210752, p_148136_4_); + tessellator.addVertexWithUV((double)this.left, (double)p_148136_2_, 0.0D, 0.0D, (double)((float)p_148136_2_ / f)); + tessellator.addVertexWithUV((double)(this.left + this.width), (double)p_148136_2_, 0.0D, (double)((float)this.width / f), (double)((float)p_148136_2_ / f)); + tessellator.setColorRGBA_I(4210752, p_148136_3_); + tessellator.addVertexWithUV((double)(this.left + this.width), (double)p_148136_1_, 0.0D, (double)((float)this.width / f), (double)((float)p_148136_1_ / f)); + tessellator.addVertexWithUV((double)this.left, (double)p_148136_1_, 0.0D, 0.0D, (double)((float)p_148136_1_ / f)); + tessellator.draw(); + } + + /** + * Sets the left and right bounds of the slot. Param is the left bound, right is calculated as left + width. + */ + public void setSlotXBoundsFromLeft(int p_148140_1_) + { + this.left = p_148140_1_; + this.right = p_148140_1_ + this.width; + } + + public int getSlotHeight() + { + return this.slotHeight; + } + + protected void drawContainerBackground(Tessellator tessellator) + { + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f1 = 32.0F; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(2105376); + tessellator.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); + tessellator.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / f1), (double)((float)(this.bottom + (int)this.amountScrolled) / f1)); + tessellator.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); + tessellator.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / f1), (double)((float)(this.top + (int)this.amountScrolled) / f1)); + tessellator.draw(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java new file mode 100644 index 0000000..73bf644 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSlotRealmsProxy.java @@ -0,0 +1,79 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.realms.RealmsScrolledSelectionList; + +@SideOnly(Side.CLIENT) +public class GuiSlotRealmsProxy extends GuiSlot +{ + private final RealmsScrolledSelectionList field_154340_k; + private static final String __OBFID = "CL_00001846"; + + public GuiSlotRealmsProxy(RealmsScrolledSelectionList selectionListIn, int p_i1085_2_, int p_i1085_3_, int p_i1085_4_, int p_i1085_5_, int p_i1085_6_) + { + super(Minecraft.getMinecraft(), p_i1085_2_, p_i1085_3_, p_i1085_4_, p_i1085_5_, p_i1085_6_); + this.field_154340_k = selectionListIn; + } + + protected int getSize() + { + return this.field_154340_k.getItemCount(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + this.field_154340_k.selectItem(p_148144_1_, p_148144_2_, p_148144_3_, p_148144_4_); + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return this.field_154340_k.isSelectedItem(p_148131_1_); + } + + protected void drawBackground() + { + this.field_154340_k.renderBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + this.field_154340_k.renderItem(p_148126_1_, p_148126_2_, p_148126_3_, p_148126_4_, p_148126_6_, p_148126_7_); + } + + public int func_154338_k() + { + return super.width; + } + + public int func_154339_l() + { + return super.mouseY; + } + + public int func_154337_m() + { + return super.mouseX; + } + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return this.field_154340_k.getMaxPosition(); + } + + protected int getScrollBarX() + { + return this.field_154340_k.getScrollbarPosition(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSnooper.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSnooper.java new file mode 100644 index 0000000..3375df3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiSnooper.java @@ -0,0 +1,161 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.TreeMap; +import java.util.Map.Entry; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class GuiSnooper extends GuiScreen +{ + private final GuiScreen field_146608_a; + private final GameSettings field_146603_f; + private final java.util.List field_146604_g = new ArrayList(); + private final java.util.List field_146609_h = new ArrayList(); + private String field_146610_i; + private String[] field_146607_r; + private GuiSnooper.List field_146606_s; + private GuiButton field_146605_t; + private static final String __OBFID = "CL_00000714"; + + public GuiSnooper(GuiScreen p_i1061_1_, GameSettings p_i1061_2_) + { + this.field_146608_a = p_i1061_1_; + this.field_146603_f = p_i1061_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_146610_i = I18n.format("options.snooper.title", new Object[0]); + String s = I18n.format("options.snooper.desc", new Object[0]); + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30).iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + arraylist.add(s1); + } + + this.field_146607_r = (String[])arraylist.toArray(new String[0]); + this.field_146604_g.clear(); + this.field_146609_h.clear(); + this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.field_146603_f.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done", new Object[0]))); + boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; + Iterator iterator1 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); + Entry entry; + + while (iterator1.hasNext()) + { + entry = (Entry)iterator1.next(); + this.field_146604_g.add((flag ? "C " : "") + (String)entry.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); + } + + if (flag) + { + iterator1 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); + + while (iterator1.hasNext()) + { + entry = (Entry)iterator1.next(); + this.field_146604_g.add("S " + (String)entry.getKey()); + this.field_146609_h.add(this.fontRendererObj.trimStringToWidth((String)entry.getValue(), this.width - 220)); + } + } + + this.field_146606_s = new GuiSnooper.List(); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 2) + { + this.field_146603_f.saveOptions(); + this.field_146603_f.saveOptions(); + this.mc.displayGuiScreen(this.field_146608_a); + } + + if (button.id == 1) + { + this.field_146603_f.setOptionValue(GameSettings.Options.SNOOPER_ENABLED, 1); + this.field_146605_t.displayString = this.field_146603_f.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_146606_s.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146610_i, this.width / 2, 8, 16777215); + int k = 22; + String[] astring = this.field_146607_r; + int l = astring.length; + + for (int i1 = 0; i1 < l; ++i1) + { + String s = astring[i1]; + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 8421504); + k += this.fontRendererObj.FONT_HEIGHT; + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SideOnly(Side.CLIENT) + class List extends GuiSlot + { + private static final String __OBFID = "CL_00000715"; + + public List() + { + super(GuiSnooper.this.mc, GuiSnooper.this.width, GuiSnooper.this.height, 80, GuiSnooper.this.height - 40, GuiSnooper.this.fontRendererObj.FONT_HEIGHT + 1); + } + + protected int getSize() + { + return GuiSnooper.this.field_146604_g.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return false; + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146604_g.get(p_148126_1_), 10, p_148126_3_, 16777215); + GuiSnooper.this.fontRendererObj.drawString((String)GuiSnooper.this.field_146609_h.get(p_148126_1_), 230, p_148126_3_, 16777215); + } + + protected int getScrollBarX() + { + return this.width - 10; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiStreamIndicator.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiStreamIndicator.java new file mode 100644 index 0000000..57682a1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiStreamIndicator.java @@ -0,0 +1,109 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiStreamIndicator +{ + private static final ResourceLocation field_152441_a = new ResourceLocation("textures/gui/stream_indicator.png"); + private final Minecraft field_152442_b; + private float field_152443_c = 1.0F; + private int field_152444_d = 1; + private static final String __OBFID = "CL_00001849"; + + public GuiStreamIndicator(Minecraft p_i1092_1_) + { + this.field_152442_b = p_i1092_1_; + } + + public void func_152437_a(int p_152437_1_, int p_152437_2_) + { + if (this.field_152442_b.func_152346_Z().func_152934_n()) + { + GL11.glEnable(GL11.GL_BLEND); + int k = this.field_152442_b.func_152346_Z().func_152920_A(); + + if (k > 0) + { + String s = "" + k; + int l = this.field_152442_b.fontRenderer.getStringWidth(s); + boolean flag = true; + int i1 = p_152437_1_ - l - 1; + int j1 = p_152437_2_ + 20 - 1; + int k1 = p_152437_2_ + 20 + this.field_152442_b.fontRenderer.FONT_HEIGHT - 1; + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 0.0F, (0.65F + 0.35000002F * this.field_152443_c) / 2.0F); + tessellator.startDrawingQuads(); + tessellator.addVertex((double)i1, (double)k1, 0.0D); + tessellator.addVertex((double)p_152437_1_, (double)k1, 0.0D); + tessellator.addVertex((double)p_152437_1_, (double)j1, 0.0D); + tessellator.addVertex((double)i1, (double)j1, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + this.field_152442_b.fontRenderer.drawString(s, p_152437_1_ - l, p_152437_2_ + 20, 16777215); + } + + this.func_152436_a(p_152437_1_, p_152437_2_, this.func_152440_b(), 0); + this.func_152436_a(p_152437_1_, p_152437_2_, this.func_152438_c(), 17); + } + } + + private void func_152436_a(int p_152436_1_, int p_152436_2_, int p_152436_3_, int p_152436_4_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.65F + 0.35000002F * this.field_152443_c); + this.field_152442_b.getTextureManager().bindTexture(field_152441_a); + float f = 150.0F; + float f1 = 0.0F; + float f2 = (float)p_152436_3_ * 0.015625F; + float f3 = 1.0F; + float f4 = (float)(p_152436_3_ + 16) * 0.015625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 16), (double)f, (double)f1, (double)f4); + tessellator.addVertexWithUV((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 16), (double)f, (double)f3, (double)f4); + tessellator.addVertexWithUV((double)(p_152436_1_ - p_152436_4_), (double)(p_152436_2_ + 0), (double)f, (double)f3, (double)f2); + tessellator.addVertexWithUV((double)(p_152436_1_ - 16 - p_152436_4_), (double)(p_152436_2_ + 0), (double)f, (double)f1, (double)f2); + tessellator.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + private int func_152440_b() + { + return this.field_152442_b.func_152346_Z().func_152919_o() ? 16 : 0; + } + + private int func_152438_c() + { + return this.field_152442_b.func_152346_Z().func_152929_G() ? 48 : 32; + } + + public void func_152439_a() + { + if (this.field_152442_b.func_152346_Z().func_152934_n()) + { + this.field_152443_c += 0.025F * (float)this.field_152444_d; + + if (this.field_152443_c < 0.0F) + { + this.field_152444_d *= -1; + this.field_152443_c = 0.0F; + } + else if (this.field_152443_c > 1.0F) + { + this.field_152444_d *= -1; + this.field_152443_c = 1.0F; + } + } + else + { + this.field_152443_c = 1.0F; + this.field_152444_d = 1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiTextField.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiTextField.java new file mode 100644 index 0000000..86f556c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiTextField.java @@ -0,0 +1,763 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiTextField extends Gui +{ + private final FontRenderer field_146211_a; + public int xPosition; + public int yPosition; + /** The width of this text field. */ + public int width; + public int height; + /** Has the current text being edited on the textbox. */ + private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; + /** if true the textbox can lose focus by clicking elsewhere on the screen */ + private boolean canLoseFocus = true; + /** If this value is true along with isEnabled, keyTyped will process the keys. */ + private boolean isFocused; + /** If this value is true along with isFocused, keyTyped will process the keys. */ + private boolean isEnabled = true; + /** The current character index that should be used as start of the rendered text. */ + private int lineScrollOffset; + private int cursorPosition; + /** other selection position, maybe the same as the cursor */ + private int selectionEnd; + private int enabledColor = 14737632; + private int disabledColor = 7368816; + /** True if this textbox is visible */ + private boolean visible = true; + private static final String __OBFID = "CL_00000670"; + + public GuiTextField(FontRenderer p_i1032_1_, int p_i1032_2_, int p_i1032_3_, int p_i1032_4_, int p_i1032_5_) + { + this.field_146211_a = p_i1032_1_; + this.xPosition = p_i1032_2_; + this.yPosition = p_i1032_3_; + this.width = p_i1032_4_; + this.height = p_i1032_5_; + } + + /** + * Increments the cursor counter + */ + public void updateCursorCounter() + { + ++this.cursorCounter; + } + + /** + * Sets the text of the textbox + */ + public void setText(String p_146180_1_) + { + if (p_146180_1_.length() > this.maxStringLength) + { + this.text = p_146180_1_.substring(0, this.maxStringLength); + } + else + { + this.text = p_146180_1_; + } + + this.setCursorPositionEnd(); + } + + /** + * Returns the contents of the textbox + */ + public String getText() + { + return this.text; + } + + /** + * returns the text between the cursor and selectionEnd + */ + public String getSelectedText() + { + int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + return this.text.substring(i, j); + } + + /** + * replaces selected text, or inserts text at the position on the cursor + */ + public void writeText(String p_146191_1_) + { + String s1 = ""; + String s2 = ChatAllowedCharacters.filerAllowedCharacters(p_146191_1_); + int i = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int j = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; + int k = this.maxStringLength - this.text.length() - (i - this.selectionEnd); + boolean flag = false; + + if (this.text.length() > 0) + { + s1 = s1 + this.text.substring(0, i); + } + + int l; + + if (k < s2.length()) + { + s1 = s1 + s2.substring(0, k); + l = k; + } + else + { + s1 = s1 + s2; + l = s2.length(); + } + + if (this.text.length() > 0 && j < this.text.length()) + { + s1 = s1 + this.text.substring(j); + } + + this.text = s1; + this.moveCursorBy(i - this.selectionEnd + l); + } + + /** + * Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of + * the cursor. + */ + public void deleteWords(int p_146177_1_) + { + if (this.text.length() != 0) + { + if (this.selectionEnd != this.cursorPosition) + { + this.writeText(""); + } + else + { + this.deleteFromCursor(this.getNthWordFromCursor(p_146177_1_) - this.cursorPosition); + } + } + } + + /** + * delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num + */ + public void deleteFromCursor(int p_146175_1_) + { + if (this.text.length() != 0) + { + if (this.selectionEnd != this.cursorPosition) + { + this.writeText(""); + } + else + { + boolean flag = p_146175_1_ < 0; + int j = flag ? this.cursorPosition + p_146175_1_ : this.cursorPosition; + int k = flag ? this.cursorPosition : this.cursorPosition + p_146175_1_; + String s = ""; + + if (j >= 0) + { + s = this.text.substring(0, j); + } + + if (k < this.text.length()) + { + s = s + this.text.substring(k); + } + + this.text = s; + + if (flag) + { + this.moveCursorBy(p_146175_1_); + } + } + } + } + + /** + * see @getNthNextWordFromPos() params: N, position + */ + public int getNthWordFromCursor(int p_146187_1_) + { + return this.getNthWordFromPos(p_146187_1_, this.getCursorPosition()); + } + + /** + * gets the position of the nth word. N may be negative, then it looks backwards. params: N, position + */ + public int getNthWordFromPos(int p_146183_1_, int p_146183_2_) + { + return this.func_146197_a(p_146183_1_, this.getCursorPosition(), true); + } + + public int func_146197_a(int p_146197_1_, int p_146197_2_, boolean p_146197_3_) + { + int k = p_146197_2_; + boolean flag1 = p_146197_1_ < 0; + int l = Math.abs(p_146197_1_); + + for (int i1 = 0; i1 < l; ++i1) + { + if (flag1) + { + while (p_146197_3_ && k > 0 && this.text.charAt(k - 1) == 32) + { + --k; + } + + while (k > 0 && this.text.charAt(k - 1) != 32) + { + --k; + } + } + else + { + int j1 = this.text.length(); + k = this.text.indexOf(32, k); + + if (k == -1) + { + k = j1; + } + else + { + while (p_146197_3_ && k < j1 && this.text.charAt(k) == 32) + { + ++k; + } + } + } + } + + return k; + } + + /** + * Moves the text cursor by a specified number of characters and clears the selection + */ + public void moveCursorBy(int p_146182_1_) + { + this.setCursorPosition(this.selectionEnd + p_146182_1_); + } + + /** + * sets the position of the cursor to the provided index + */ + public void setCursorPosition(int p_146190_1_) + { + this.cursorPosition = p_146190_1_; + int j = this.text.length(); + + if (this.cursorPosition < 0) + { + this.cursorPosition = 0; + } + + if (this.cursorPosition > j) + { + this.cursorPosition = j; + } + + this.setSelectionPos(this.cursorPosition); + } + + /** + * sets the cursors position to the beginning + */ + public void setCursorPositionZero() + { + this.setCursorPosition(0); + } + + /** + * sets the cursors position to after the text + */ + public void setCursorPositionEnd() + { + this.setCursorPosition(this.text.length()); + } + + /** + * Call this method from your GuiScreen to process the keys into the textbox + */ + public boolean textboxKeyTyped(char p_146201_1_, int p_146201_2_) + { + if (!this.isFocused) + { + return false; + } + else + { + switch (p_146201_1_) + { + case 1: + this.setCursorPositionEnd(); + this.setSelectionPos(0); + return true; + case 3: + GuiScreen.setClipboardString(this.getSelectedText()); + return true; + case 22: + if (this.isEnabled) + { + this.writeText(GuiScreen.getClipboardString()); + } + + return true; + case 24: + GuiScreen.setClipboardString(this.getSelectedText()); + + if (this.isEnabled) + { + this.writeText(""); + } + + return true; + default: + switch (p_146201_2_) + { + case 14: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEnabled) + { + this.deleteWords(-1); + } + } + else if (this.isEnabled) + { + this.deleteFromCursor(-1); + } + + return true; + case 199: + if (GuiScreen.isShiftKeyDown()) + { + this.setSelectionPos(0); + } + else + { + this.setCursorPositionZero(); + } + + return true; + case 203: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); + } + else + { + this.setSelectionPos(this.getSelectionEnd() - 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.setCursorPosition(this.getNthWordFromCursor(-1)); + } + else + { + this.moveCursorBy(-1); + } + + return true; + case 205: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); + } + else + { + this.setSelectionPos(this.getSelectionEnd() + 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.setCursorPosition(this.getNthWordFromCursor(1)); + } + else + { + this.moveCursorBy(1); + } + + return true; + case 207: + if (GuiScreen.isShiftKeyDown()) + { + this.setSelectionPos(this.text.length()); + } + else + { + this.setCursorPositionEnd(); + } + + return true; + case 211: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEnabled) + { + this.deleteWords(1); + } + } + else if (this.isEnabled) + { + this.deleteFromCursor(1); + } + + return true; + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_146201_1_)) + { + if (this.isEnabled) + { + this.writeText(Character.toString(p_146201_1_)); + } + + return true; + } + else + { + return false; + } + } + } + } + } + + /** + * Args: x, y, buttonClicked + */ + public void mouseClicked(int p_146192_1_, int p_146192_2_, int p_146192_3_) + { + boolean flag = p_146192_1_ >= this.xPosition && p_146192_1_ < this.xPosition + this.width && p_146192_2_ >= this.yPosition && p_146192_2_ < this.yPosition + this.height; + + if (this.canLoseFocus) + { + this.setFocused(flag); + } + + if (this.isFocused && p_146192_3_ == 0) + { + int l = p_146192_1_ - this.xPosition; + + if (this.enableBackgroundDrawing) + { + l -= 4; + } + + String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + this.setCursorPosition(this.field_146211_a.trimStringToWidth(s, l).length() + this.lineScrollOffset); + } + } + + /** + * Draws the textbox + */ + public void drawTextBox() + { + if (this.getVisible()) + { + if (this.getEnableBackgroundDrawing()) + { + drawRect(this.xPosition - 1, this.yPosition - 1, this.xPosition + this.width + 1, this.yPosition + this.height + 1, -6250336); + drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, -16777216); + } + + int i = this.isEnabled ? this.enabledColor : this.disabledColor; + int j = this.cursorPosition - this.lineScrollOffset; + int k = this.selectionEnd - this.lineScrollOffset; + String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + boolean flag = j >= 0 && j <= s.length(); + boolean flag1 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && flag; + int l = this.enableBackgroundDrawing ? this.xPosition + 4 : this.xPosition; + int i1 = this.enableBackgroundDrawing ? this.yPosition + (this.height - 8) / 2 : this.yPosition; + int j1 = l; + + if (k > s.length()) + { + k = s.length(); + } + + if (s.length() > 0) + { + String s1 = flag ? s.substring(0, j) : s; + j1 = this.field_146211_a.drawStringWithShadow(s1, l, i1, i); + } + + boolean flag2 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + int k1 = j1; + + if (!flag) + { + k1 = j > 0 ? l + this.width : l; + } + else if (flag2) + { + k1 = j1 - 1; + --j1; + } + + if (s.length() > 0 && flag && j < s.length()) + { + this.field_146211_a.drawStringWithShadow(s.substring(j), j1, i1, i); + } + + if (flag1) + { + if (flag2) + { + Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.field_146211_a.FONT_HEIGHT, -3092272); + } + else + { + this.field_146211_a.drawStringWithShadow("_", k1, i1, i); + } + } + + if (k != j) + { + int l1 = l + this.field_146211_a.getStringWidth(s.substring(0, k)); + this.drawCursorVertical(k1, i1 - 1, l1 - 1, i1 + 1 + this.field_146211_a.FONT_HEIGHT); + } + } + } + + /** + * draws the vertical line cursor in the textbox + */ + private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) + { + int i1; + + if (p_146188_1_ < p_146188_3_) + { + i1 = p_146188_1_; + p_146188_1_ = p_146188_3_; + p_146188_3_ = i1; + } + + if (p_146188_2_ < p_146188_4_) + { + i1 = p_146188_2_; + p_146188_2_ = p_146188_4_; + p_146188_4_ = i1; + } + + if (p_146188_3_ > this.xPosition + this.width) + { + p_146188_3_ = this.xPosition + this.width; + } + + if (p_146188_1_ > this.xPosition + this.width) + { + p_146188_1_ = this.xPosition + this.width; + } + + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + tessellator.startDrawingQuads(); + tessellator.addVertex((double)p_146188_1_, (double)p_146188_4_, 0.0D); + tessellator.addVertex((double)p_146188_3_, (double)p_146188_4_, 0.0D); + tessellator.addVertex((double)p_146188_3_, (double)p_146188_2_, 0.0D); + tessellator.addVertex((double)p_146188_1_, (double)p_146188_2_, 0.0D); + tessellator.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public void setMaxStringLength(int p_146203_1_) + { + this.maxStringLength = p_146203_1_; + + if (this.text.length() > p_146203_1_) + { + this.text = this.text.substring(0, p_146203_1_); + } + } + + /** + * returns the maximum number of character that can be contained in this textbox + */ + public int getMaxStringLength() + { + return this.maxStringLength; + } + + /** + * returns the current position of the cursor + */ + public int getCursorPosition() + { + return this.cursorPosition; + } + + /** + * get enable drawing background and outline + */ + public boolean getEnableBackgroundDrawing() + { + return this.enableBackgroundDrawing; + } + + /** + * enable drawing background and outline + */ + public void setEnableBackgroundDrawing(boolean p_146185_1_) + { + this.enableBackgroundDrawing = p_146185_1_; + } + + /** + * Sets the text colour for this textbox (disabled text will not use this colour) + */ + public void setTextColor(int p_146193_1_) + { + this.enabledColor = p_146193_1_; + } + + public void setDisabledTextColour(int p_146204_1_) + { + this.disabledColor = p_146204_1_; + } + + /** + * Sets focus to this gui element + */ + public void setFocused(boolean p_146195_1_) + { + if (p_146195_1_ && !this.isFocused) + { + this.cursorCounter = 0; + } + + this.isFocused = p_146195_1_; + } + + /** + * Getter for the focused field + */ + public boolean isFocused() + { + return this.isFocused; + } + + public void setEnabled(boolean p_146184_1_) + { + this.isEnabled = p_146184_1_; + } + + /** + * the side of the selection that is not the cursor, may be the same as the cursor + */ + public int getSelectionEnd() + { + return this.selectionEnd; + } + + /** + * returns the width of the textbox depending on if background drawing is enabled + */ + public int getWidth() + { + return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; + } + + /** + * Sets the position of the selection anchor (i.e. position the selection was started at) + */ + public void setSelectionPos(int p_146199_1_) + { + int j = this.text.length(); + + if (p_146199_1_ > j) + { + p_146199_1_ = j; + } + + if (p_146199_1_ < 0) + { + p_146199_1_ = 0; + } + + this.selectionEnd = p_146199_1_; + + if (this.field_146211_a != null) + { + if (this.lineScrollOffset > j) + { + this.lineScrollOffset = j; + } + + int k = this.getWidth(); + String s = this.field_146211_a.trimStringToWidth(this.text.substring(this.lineScrollOffset), k); + int l = s.length() + this.lineScrollOffset; + + if (p_146199_1_ == this.lineScrollOffset) + { + this.lineScrollOffset -= this.field_146211_a.trimStringToWidth(this.text, k, true).length(); + } + + if (p_146199_1_ > l) + { + this.lineScrollOffset += p_146199_1_ - l; + } + else if (p_146199_1_ <= this.lineScrollOffset) + { + this.lineScrollOffset -= this.lineScrollOffset - p_146199_1_; + } + + if (this.lineScrollOffset < 0) + { + this.lineScrollOffset = 0; + } + + if (this.lineScrollOffset > j) + { + this.lineScrollOffset = j; + } + } + } + + /** + * if true the textbox can lose focus by clicking elsewhere on the screen + */ + public void setCanLoseFocus(boolean p_146205_1_) + { + this.canLoseFocus = p_146205_1_; + } + + /** + * returns true if this textbox is visible + */ + public boolean getVisible() + { + return this.visible; + } + + /** + * Sets whether or not this textbox is visible + */ + public void setVisible(boolean p_146189_1_) + { + this.visible = p_146189_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiVideoSettings.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiVideoSettings.java new file mode 100644 index 0000000..8caa3de --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiVideoSettings.java @@ -0,0 +1,120 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class GuiVideoSettings extends GuiScreen +{ + private GuiScreen parentGuiScreen; + protected String screenTitle = "Video Settings"; + private GameSettings guiGameSettings; + private GuiListExtended optionsRowList; + /** An array of all of GameSettings.Options's video options. */ + private static final GameSettings.Options[] videoOptions = new GameSettings.Options[] {GameSettings.Options.GRAPHICS, GameSettings.Options.RENDER_DISTANCE, GameSettings.Options.AMBIENT_OCCLUSION, GameSettings.Options.FRAMERATE_LIMIT, GameSettings.Options.ANAGLYPH, GameSettings.Options.VIEW_BOBBING, GameSettings.Options.GUI_SCALE, GameSettings.Options.ADVANCED_OPENGL, GameSettings.Options.GAMMA, GameSettings.Options.RENDER_CLOUDS, GameSettings.Options.PARTICLES, GameSettings.Options.USE_FULLSCREEN, GameSettings.Options.ENABLE_VSYNC, GameSettings.Options.MIPMAP_LEVELS, GameSettings.Options.ANISOTROPIC_FILTERING}; + private static final String __OBFID = "CL_00000718"; + + public GuiVideoSettings(GuiScreen p_i1062_1_, GameSettings p_i1062_2_) + { + this.parentGuiScreen = p_i1062_1_; + this.guiGameSettings = p_i1062_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.screenTitle = I18n.format("options.videoTitle", new Object[0]); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done", new Object[0]))); + + if (OpenGlHelper.field_153197_d) + { + this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, videoOptions); + } + else + { + GameSettings.Options[] aoptions = new GameSettings.Options[videoOptions.length - 1]; + int i = 0; + GameSettings.Options[] aoptions1 = videoOptions; + int j = aoptions1.length; + + for (int k = 0; k < j; ++k) + { + GameSettings.Options options = aoptions1[k]; + + if (options != GameSettings.Options.ADVANCED_OPENGL) + { + aoptions[i] = options; + ++i; + } + } + + this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25, aoptions); + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentGuiScreen); + } + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + int l = this.guiGameSettings.guiScale; + super.mouseClicked(mouseX, mouseY, mouseButton); + this.optionsRowList.func_148179_a(mouseX, mouseY, mouseButton); + + if (this.guiGameSettings.guiScale != l) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i1 = scaledresolution.getScaledWidth(); + int j1 = scaledresolution.getScaledHeight(); + this.setWorldAndResolution(this.mc, i1, j1); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + int l = this.guiGameSettings.guiScale; + super.mouseMovedOrUp(mouseX, mouseY, state); + this.optionsRowList.func_148181_b(mouseX, mouseY, state); + + if (this.guiGameSettings.guiScale != l) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i1 = scaledresolution.getScaledWidth(); + int j1 = scaledresolution.getScaledHeight(); + this.setWorldAndResolution(this.mc, i1, j1); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.optionsRowList.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 5, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiWinGame.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiWinGame.java new file mode 100644 index 0000000..f30384f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiWinGame.java @@ -0,0 +1,229 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiWinGame extends GuiScreen +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation field_146576_f = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation field_146577_g = new ResourceLocation("textures/misc/vignette.png"); + private int field_146581_h; + private List field_146582_i; + private int field_146579_r; + private float field_146578_s = 0.5F; + private static final String __OBFID = "CL_00000719"; + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + ++this.field_146581_h; + float f = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + + if ((float)this.field_146581_h > f) + { + this.func_146574_g(); + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == 1) + { + this.func_146574_g(); + } + } + + private void func_146574_g() + { + this.mc.thePlayer.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN)); + this.mc.displayGuiScreen((GuiScreen)null); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return true; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + if (this.field_146582_i == null) + { + this.field_146582_i = new ArrayList(); + + try + { + String s = ""; + String s1 = "" + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + EnumChatFormatting.GREEN + EnumChatFormatting.AQUA; + short short1 = 274; + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8)); + Random random = new Random(8124371L); + int i; + + while ((s = bufferedreader.readLine()) != null) + { + String s2; + String s3; + + for (s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); s.contains(s1); s = s2 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, random.nextInt(4) + 3) + s3) + { + i = s.indexOf(s1); + s2 = s.substring(0, i); + s3 = s.substring(i + s1.length()); + } + + this.field_146582_i.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s, short1)); + this.field_146582_i.add(""); + } + + for (i = 0; i < 8; ++i) + { + this.field_146582_i.add(""); + } + + bufferedreader = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); + + while ((s = bufferedreader.readLine()) != null) + { + s = s.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); + s = s.replaceAll("\t", " "); + this.field_146582_i.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s, short1)); + this.field_146582_i.add(""); + } + + this.field_146579_r = this.field_146582_i.size() * 12; + } + catch (Exception exception) + { + logger.error("Couldn\'t load credits", exception); + } + } + } + + private void func_146575_b(int p_146575_1_, int p_146575_2_, float p_146575_3_) + { + Tessellator tessellator = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + int k = this.width; + float f1 = 0.0F - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f2 = (float)this.height - ((float)this.field_146581_h + p_146575_3_) * 0.5F * this.field_146578_s; + float f3 = 0.015625F; + float f4 = ((float)this.field_146581_h + p_146575_3_ - 0.0F) * 0.02F; + float f5 = (float)(this.field_146579_r + this.height + this.height + 24) / this.field_146578_s; + float f6 = (f5 - 20.0F - ((float)this.field_146581_h + p_146575_3_)) * 0.005F; + + if (f6 < f4) + { + f4 = f6; + } + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + f4 *= f4; + f4 = f4 * 96.0F / 255.0F; + tessellator.setColorOpaque_F(f4, f4, f4); + tessellator.addVertexWithUV(0.0D, (double)this.height, (double)this.zLevel, 0.0D, (double)(f1 * f3)); + tessellator.addVertexWithUV((double)k, (double)this.height, (double)this.zLevel, (double)((float)k * f3), (double)(f1 * f3)); + tessellator.addVertexWithUV((double)k, 0.0D, (double)this.zLevel, (double)((float)k * f3), (double)(f2 * f3)); + tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, (double)(f2 * f3)); + tessellator.draw(); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.func_146575_b(mouseX, mouseY, partialTicks); + Tessellator tessellator = Tessellator.instance; + short short1 = 274; + int k = this.width / 2 - short1 / 2; + int l = this.height + 50; + float f1 = -((float)this.field_146581_h + partialTicks) * this.field_146578_s; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, f1, 0.0F); + this.mc.getTextureManager().bindTexture(field_146576_f); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(k, l, 0, 0, 155, 44); + this.drawTexturedModalRect(k + 155, l, 0, 45, 155, 44); + tessellator.setColorOpaque_I(16777215); + int i1 = l + 200; + int j1; + + for (j1 = 0; j1 < this.field_146582_i.size(); ++j1) + { + if (j1 == this.field_146582_i.size() - 1) + { + float f2 = (float)i1 + f1 - (float)(this.height / 2 - 6); + + if (f2 < 0.0F) + { + GL11.glTranslatef(0.0F, -f2, 0.0F); + } + } + + if ((float)i1 + f1 + 12.0F + 8.0F > 0.0F && (float)i1 + f1 < (float)this.height) + { + String s = (String)this.field_146582_i.get(j1); + + if (s.startsWith("[C]")) + { + this.fontRendererObj.drawStringWithShadow(s.substring(3), k + (short1 - this.fontRendererObj.getStringWidth(s.substring(3))) / 2, i1, 16777215); + } + else + { + this.fontRendererObj.fontRandom.setSeed((long)j1 * 4238972211L + (long)(this.field_146581_h / 4)); + this.fontRendererObj.drawStringWithShadow(s, k, i1, 16777215); + } + } + + i1 += 12; + } + + GL11.glPopMatrix(); + this.mc.getTextureManager().bindTexture(field_146577_g); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + j1 = this.width; + int k1 = this.height; + tessellator.addVertexWithUV(0.0D, (double)k1, (double)this.zLevel, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)j1, (double)k1, (double)this.zLevel, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)j1, 0.0D, (double)this.zLevel, 1.0D, 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, 0.0D); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNo.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNo.java new file mode 100644 index 0000000..fa36836 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNo.java @@ -0,0 +1,95 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class GuiYesNo extends GuiScreen +{ + /** A reference to the screen object that created this. Used for navigating between screens. */ + protected GuiYesNoCallback parentScreen; + protected String field_146351_f; + private String field_146354_r; + /** The text shown for the first button in GuiYesNo */ + protected String confirmButtonText; + /** The text shown for the second button in GuiYesNo */ + protected String cancelButtonText; + protected int field_146357_i; + private int field_146353_s; + private static final String __OBFID = "CL_00000684"; + + public GuiYesNo(GuiYesNoCallback p_i1082_1_, String p_i1082_2_, String p_i1082_3_, int p_i1082_4_) + { + this.parentScreen = p_i1082_1_; + this.field_146351_f = p_i1082_2_; + this.field_146354_r = p_i1082_3_; + this.field_146357_i = p_i1082_4_; + this.confirmButtonText = I18n.format("gui.yes", new Object[0]); + this.cancelButtonText = I18n.format("gui.no", new Object[0]); + } + + public GuiYesNo(GuiYesNoCallback p_i1083_1_, String p_i1083_2_, String p_i1083_3_, String p_i1083_4_, String p_i1083_5_, int p_i1083_6_) + { + this.parentScreen = p_i1083_1_; + this.field_146351_f = p_i1083_2_; + this.field_146354_r = p_i1083_3_; + this.confirmButtonText = p_i1083_4_; + this.cancelButtonText = p_i1083_5_; + this.field_146357_i = p_i1083_6_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 155, this.height / 6 + 96, this.confirmButtonText)); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.cancelButtonText)); + } + + protected void actionPerformed(GuiButton button) + { + this.parentScreen.confirmClicked(button.id == 0, this.field_146357_i); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146351_f, this.width / 2, 70, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146354_r, this.width / 2, 90, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + public void func_146350_a(int p_146350_1_) + { + this.field_146353_s = p_146350_1_; + GuiButton guibutton; + + for (Iterator iterator = this.buttonList.iterator(); iterator.hasNext(); guibutton.enabled = false) + { + guibutton = (GuiButton)iterator.next(); + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + GuiButton guibutton; + + if (--this.field_146353_s == 0) + { + for (Iterator iterator = this.buttonList.iterator(); iterator.hasNext(); guibutton.enabled = true) + { + guibutton = (GuiButton)iterator.next(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNoCallback.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNoCallback.java new file mode 100644 index 0000000..6b5ada4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/GuiYesNoCallback.java @@ -0,0 +1,10 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface GuiYesNoCallback +{ + void confirmClicked(boolean result, int id); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/IProgressMeter.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/IProgressMeter.java new file mode 100644 index 0000000..43fd3cb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/IProgressMeter.java @@ -0,0 +1,12 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IProgressMeter +{ + String[] field_146510_b_ = new String[] {"oooooo", "Oooooo", "oOoooo", "ooOooo", "oooOoo", "ooooOo", "oooooO"}; + + void func_146509_g(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/MapItemRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/MapItemRenderer.java new file mode 100644 index 0000000..70d63cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/MapItemRenderer.java @@ -0,0 +1,166 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.block.material.MapColor; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class MapItemRenderer +{ + private static final ResourceLocation field_148253_a = new ResourceLocation("textures/map/map_icons.png"); + private final TextureManager field_148251_b; + private final Map field_148252_c = Maps.newHashMap(); + private static final String __OBFID = "CL_00000663"; + + public MapItemRenderer(TextureManager p_i45009_1_) + { + this.field_148251_b = p_i45009_1_; + } + + public void func_148246_a(MapData p_148246_1_) + { + this.func_148248_b(p_148246_1_).func_148236_a(); + } + + public void func_148250_a(MapData p_148250_1_, boolean p_148250_2_) + { + this.func_148248_b(p_148250_1_).func_148237_a(p_148250_2_); + } + + private MapItemRenderer.Instance func_148248_b(MapData p_148248_1_) + { + MapItemRenderer.Instance instance = (MapItemRenderer.Instance)this.field_148252_c.get(p_148248_1_.mapName); + + if (instance == null) + { + instance = new MapItemRenderer.Instance(p_148248_1_, null); + this.field_148252_c.put(p_148248_1_.mapName, instance); + } + + return instance; + } + + public void func_148249_a() + { + Iterator iterator = this.field_148252_c.values().iterator(); + + while (iterator.hasNext()) + { + MapItemRenderer.Instance instance = (MapItemRenderer.Instance)iterator.next(); + this.field_148251_b.deleteTexture(instance.field_148240_d); + } + + this.field_148252_c.clear(); + } + + @SideOnly(Side.CLIENT) + class Instance + { + private final MapData field_148242_b; + private final DynamicTexture field_148243_c; + private final ResourceLocation field_148240_d; + private final int[] field_148241_e; + private static final String __OBFID = "CL_00000665"; + + private Instance(MapData p_i45007_2_) + { + this.field_148242_b = p_i45007_2_; + this.field_148243_c = new DynamicTexture(128, 128); + this.field_148241_e = this.field_148243_c.getTextureData(); + this.field_148240_d = MapItemRenderer.this.field_148251_b.getDynamicTextureLocation("map/" + p_i45007_2_.mapName, this.field_148243_c); + + for (int i = 0; i < this.field_148241_e.length; ++i) + { + this.field_148241_e[i] = 0; + } + } + + private void func_148236_a() + { + for (int i = 0; i < 16384; ++i) + { + int j = this.field_148242_b.colors[i] & 255; + + if (j / 4 == 0) + { + this.field_148241_e[i] = (i + i / 128 & 1) * 8 + 16 << 24; + } + else + { + this.field_148241_e[i] = MapColor.mapColorArray[j / 4].func_151643_b(j & 3); + } + } + + this.field_148243_c.updateDynamicTexture(); + } + + private void func_148237_a(boolean p_148237_1_) + { + byte b0 = 0; + byte b1 = 0; + Tessellator tessellator = Tessellator.instance; + float f = 0.0F; + MapItemRenderer.this.field_148251_b.bindTexture(this.field_148240_d); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(1, 771, 0, 1); + GL11.glDisable(GL11.GL_ALPHA_TEST); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + MapItemRenderer.this.field_148251_b.bindTexture(MapItemRenderer.field_148253_a); + int i = 0; + Iterator iterator = this.field_148242_b.playersVisibleOnMap.values().iterator(); + + while (iterator.hasNext()) + { + MapData.MapCoord mapcoord = (MapData.MapCoord)iterator.next(); + + if (!p_148237_1_ || mapcoord.iconSize == 1) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)b0 + (float)mapcoord.centerX / 2.0F + 64.0F, (float)b1 + (float)mapcoord.centerZ / 2.0F + 64.0F, -0.02F); + GL11.glRotatef((float)(mapcoord.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + GL11.glScalef(4.0F, 4.0F, 3.0F); + GL11.glTranslatef(-0.125F, 0.125F, 0.0F); + float f1 = (float)(mapcoord.iconSize % 4 + 0) / 4.0F; + float f2 = (float)(mapcoord.iconSize / 4 + 0) / 4.0F; + float f3 = (float)(mapcoord.iconSize % 4 + 1) / 4.0F; + float f4 = (float)(mapcoord.iconSize / 4 + 1) / 4.0F; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-1.0D, 1.0D, (double)((float)i * 0.001F), (double)f1, (double)f2); + tessellator.addVertexWithUV(1.0D, 1.0D, (double)((float)i * 0.001F), (double)f3, (double)f2); + tessellator.addVertexWithUV(1.0D, -1.0D, (double)((float)i * 0.001F), (double)f3, (double)f4); + tessellator.addVertexWithUV(-1.0D, -1.0D, (double)((float)i * 0.001F), (double)f1, (double)f4); + tessellator.draw(); + GL11.glPopMatrix(); + ++i; + } + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.0F, -0.04F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + Instance(MapData p_i45008_2_, Object p_i45008_3_) + { + this(p_i45008_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScaledResolution.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScaledResolution.java new file mode 100644 index 0000000..1e9c855 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScaledResolution.java @@ -0,0 +1,71 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ScaledResolution +{ + private int scaledWidth; + private int scaledHeight; + private double scaledWidthD; + private double scaledHeightD; + private int scaleFactor; + private static final String __OBFID = "CL_00000666"; + + public ScaledResolution(Minecraft p_i1094_1_, int p_i1094_2_, int p_i1094_3_) + { + this.scaledWidth = p_i1094_2_; + this.scaledHeight = p_i1094_3_; + this.scaleFactor = 1; + boolean flag = p_i1094_1_.func_152349_b(); + int k = p_i1094_1_.gameSettings.guiScale; + + if (k == 0) + { + k = 1000; + } + + while (this.scaleFactor < k && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) + { + ++this.scaleFactor; + } + + if (flag && this.scaleFactor % 2 != 0 && this.scaleFactor != 1) + { + --this.scaleFactor; + } + + this.scaledWidthD = (double)this.scaledWidth / (double)this.scaleFactor; + this.scaledHeightD = (double)this.scaledHeight / (double)this.scaleFactor; + this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD); + this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD); + } + + public int getScaledWidth() + { + return this.scaledWidth; + } + + public int getScaledHeight() + { + return this.scaledHeight; + } + + public double getScaledWidth_double() + { + return this.scaledWidthD; + } + + public double getScaledHeight_double() + { + return this.scaledHeightD; + } + + public int getScaleFactor() + { + return this.scaleFactor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScreenChatOptions.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScreenChatOptions.java new file mode 100644 index 0000000..4c9247c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ScreenChatOptions.java @@ -0,0 +1,112 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class ScreenChatOptions extends GuiScreen +{ + private static final GameSettings.Options[] field_146399_a = new GameSettings.Options[] {GameSettings.Options.CHAT_VISIBILITY, GameSettings.Options.CHAT_COLOR, GameSettings.Options.CHAT_LINKS, GameSettings.Options.CHAT_OPACITY, GameSettings.Options.CHAT_LINKS_PROMPT, GameSettings.Options.CHAT_SCALE, GameSettings.Options.CHAT_HEIGHT_FOCUSED, GameSettings.Options.CHAT_HEIGHT_UNFOCUSED, GameSettings.Options.CHAT_WIDTH}; + private static final GameSettings.Options[] field_146395_f = new GameSettings.Options[] {GameSettings.Options.SHOW_CAPE}; + private final GuiScreen field_146396_g; + private final GameSettings field_146400_h; + private String field_146401_i; + private String field_146398_r; + private int field_146397_s; + private static final String __OBFID = "CL_00000681"; + + public ScreenChatOptions(GuiScreen p_i1023_1_, GameSettings p_i1023_2_) + { + this.field_146396_g = p_i1023_1_; + this.field_146400_h = p_i1023_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + int i = 0; + this.field_146401_i = I18n.format("options.chat.title", new Object[0]); + this.field_146398_r = I18n.format("options.multiplayer.title", new Object[0]); + GameSettings.Options[] aoptions = field_146399_a; + int j = aoptions.length; + int k; + GameSettings.Options options; + + for (k = 0; k < j; ++k) + { + options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); + } + else + { + this.buttonList.add(new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_146400_h.getKeyBinding(options))); + } + + ++i; + } + + if (i % 2 == 1) + { + ++i; + } + + this.field_146397_s = this.height / 6 + 24 * (i >> 1); + i += 2; + aoptions = field_146395_f; + j = aoptions.length; + + for (k = 0; k < j; ++k) + { + options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); + } + else + { + this.buttonList.add(new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_146400_h.getKeyBinding(options))); + } + + ++i; + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + this.field_146400_h.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1); + button.displayString = this.field_146400_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_146396_g); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_146401_i, this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_146398_r, this.width / 2, this.field_146397_s + 7, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanDetected.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanDetected.java new file mode 100644 index 0000000..0bb58d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanDetected.java @@ -0,0 +1,66 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.LanServerDetector; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class ServerListEntryLanDetected implements GuiListExtended.IGuiListEntry +{ + private final GuiMultiplayer field_148292_c; + protected final Minecraft field_148293_a; + protected final LanServerDetector.LanServer field_148291_b; + private long field_148290_d = 0L; + private static final String __OBFID = "CL_00000816"; + + protected ServerListEntryLanDetected(GuiMultiplayer p_i45046_1_, LanServerDetector.LanServer p_i45046_2_) + { + this.field_148292_c = p_i45046_1_; + this.field_148291_b = p_i45046_2_; + this.field_148293_a = Minecraft.getMinecraft(); + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + this.field_148293_a.fontRenderer.drawString(I18n.format("lanServer.title", new Object[0]), p_148279_2_ + 32 + 3, p_148279_3_ + 1, 16777215); + this.field_148293_a.fontRenderer.drawString(this.field_148291_b.getServerMotd(), p_148279_2_ + 32 + 3, p_148279_3_ + 12, 8421504); + + if (this.field_148293_a.gameSettings.hideServerAddress) + { + this.field_148293_a.fontRenderer.drawString(I18n.format("selectServer.hiddenAddress", new Object[0]), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + 11, 3158064); + } + else + { + this.field_148293_a.fontRenderer.drawString(this.field_148291_b.getServerIpPort(), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + 11, 3158064); + } + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + this.field_148292_c.func_146790_a(p_148278_1_); + + if (Minecraft.getSystemTime() - this.field_148290_d < 250L) + { + this.field_148292_c.func_146796_h(); + } + + this.field_148290_d = Minecraft.getSystemTime(); + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + + public LanServerDetector.LanServer func_148289_a() + { + return this.field_148291_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanScan.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanScan.java new file mode 100644 index 0000000..75b0b00 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryLanScan.java @@ -0,0 +1,50 @@ +package net.minecraft.client.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; + +@SideOnly(Side.CLIENT) +public class ServerListEntryLanScan implements GuiListExtended.IGuiListEntry +{ + private final Minecraft field_148288_a = Minecraft.getMinecraft(); + private static final String __OBFID = "CL_00000815"; + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + int l1 = p_148279_3_ + p_148279_5_ / 2 - this.field_148288_a.fontRenderer.FONT_HEIGHT / 2; + this.field_148288_a.fontRenderer.drawString(I18n.format("lanServer.scanning", new Object[0]), this.field_148288_a.currentScreen.width / 2 - this.field_148288_a.fontRenderer.getStringWidth(I18n.format("lanServer.scanning", new Object[0])) / 2, l1, 16777215); + String s; + + switch ((int)(Minecraft.getSystemTime() / 300L % 4L)) + { + case 0: + default: + s = "O o o"; + break; + case 1: + case 3: + s = "o O o"; + break; + case 2: + s = "o o O"; + } + + this.field_148288_a.fontRenderer.drawString(s, this.field_148288_a.currentScreen.width / 2 - this.field_148288_a.fontRenderer.getStringWidth(s) / 2, l1 + this.field_148288_a.fontRenderer.FONT_HEIGHT, 8421504); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryNormal.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryNormal.java new file mode 100644 index 0000000..0603e99 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerListEntryNormal.java @@ -0,0 +1,264 @@ +package net.minecraft.client.gui; + +import com.google.common.base.Charsets; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.image.BufferedImage; +import java.net.UnknownHostException; +import java.util.List; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadPoolExecutor; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ServerListEntryNormal implements GuiListExtended.IGuiListEntry +{ + private static final Logger logger = LogManager.getLogger(); + private static final ThreadPoolExecutor field_148302_b = new ScheduledThreadPoolExecutor(5, (new ThreadFactoryBuilder()).setNameFormat("Server Pinger #%d").setDaemon(true).build()); + private final GuiMultiplayer field_148303_c; + private final Minecraft field_148300_d; + private final ServerData field_148301_e; + private long field_148298_f; + private String field_148299_g; + private DynamicTexture field_148305_h; + private ResourceLocation field_148306_i; + private static final String __OBFID = "CL_00000817"; + + protected ServerListEntryNormal(GuiMultiplayer p_i45048_1_, ServerData p_i45048_2_) + { + this.field_148303_c = p_i45048_1_; + this.field_148301_e = p_i45048_2_; + this.field_148300_d = Minecraft.getMinecraft(); + this.field_148306_i = new ResourceLocation("servers/" + p_i45048_2_.serverIP + "/icon"); + this.field_148305_h = (DynamicTexture)this.field_148300_d.getTextureManager().getTexture(this.field_148306_i); + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + if (!this.field_148301_e.field_78841_f) + { + this.field_148301_e.field_78841_f = true; + this.field_148301_e.pingToServer = -2L; + this.field_148301_e.serverMOTD = ""; + this.field_148301_e.populationInfo = ""; + field_148302_b.submit(new Runnable() + { + private static final String __OBFID = "CL_00000818"; + public void run() + { + try + { + ServerListEntryNormal.this.field_148303_c.func_146789_i().func_147224_a(ServerListEntryNormal.this.field_148301_e); + } + catch (UnknownHostException unknownhostexception) + { + ServerListEntryNormal.this.field_148301_e.pingToServer = -1L; + ServerListEntryNormal.this.field_148301_e.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t resolve hostname"; + } + catch (Exception exception) + { + ServerListEntryNormal.this.field_148301_e.pingToServer = -1L; + ServerListEntryNormal.this.field_148301_e.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t connect to server."; + } + } + }); + } + + boolean flag1 = this.field_148301_e.field_82821_f > 5; + boolean flag2 = this.field_148301_e.field_82821_f < 5; + boolean flag3 = flag1 || flag2; + this.field_148300_d.fontRenderer.drawString(this.field_148301_e.serverName, p_148279_2_ + 32 + 3, p_148279_3_ + 1, 16777215); + List list = this.field_148300_d.fontRenderer.listFormattedStringToWidth(FMLClientHandler.instance().fixDescription(this.field_148301_e.serverMOTD), p_148279_4_ - 48 - 2); + + for (int l1 = 0; l1 < Math.min(list.size(), 2); ++l1) + { + this.field_148300_d.fontRenderer.drawString((String)list.get(l1), p_148279_2_ + 32 + 3, p_148279_3_ + 12 + this.field_148300_d.fontRenderer.FONT_HEIGHT * l1, 8421504); + } + + String s2 = flag3 ? EnumChatFormatting.DARK_RED + this.field_148301_e.gameVersion : this.field_148301_e.populationInfo; + int i2 = this.field_148300_d.fontRenderer.getStringWidth(s2); + this.field_148300_d.fontRenderer.drawString(s2, p_148279_2_ + p_148279_4_ - i2 - 15 - 2, p_148279_3_ + 1, 8421504); + byte b0 = 0; + String s = null; + int j2; + String s1; + + if (flag3) + { + j2 = 5; + s1 = flag1 ? "Client out of date!" : "Server out of date!"; + s = this.field_148301_e.field_147412_i; + } + else if (this.field_148301_e.field_78841_f && this.field_148301_e.pingToServer != -2L) + { + if (this.field_148301_e.pingToServer < 0L) + { + j2 = 5; + } + else if (this.field_148301_e.pingToServer < 150L) + { + j2 = 0; + } + else if (this.field_148301_e.pingToServer < 300L) + { + j2 = 1; + } + else if (this.field_148301_e.pingToServer < 600L) + { + j2 = 2; + } + else if (this.field_148301_e.pingToServer < 1000L) + { + j2 = 3; + } + else + { + j2 = 4; + } + + if (this.field_148301_e.pingToServer < 0L) + { + s1 = "(no connection)"; + } + else + { + s1 = this.field_148301_e.pingToServer + "ms"; + s = this.field_148301_e.field_147412_i; + } + } + else + { + b0 = 1; + j2 = (int)(Minecraft.getSystemTime() / 100L + (long)(p_148279_1_ * 2) & 7L); + + if (j2 > 4) + { + j2 = 8 - j2; + } + + s1 = "Pinging..."; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_148300_d.getTextureManager().bindTexture(Gui.icons); + Gui.func_146110_a(p_148279_2_ + p_148279_4_ - 15, p_148279_3_, (float)(b0 * 10), (float)(176 + j2 * 8), 10, 8, 256.0F, 256.0F); + + if (this.field_148301_e.getBase64EncodedIconData() != null && !this.field_148301_e.getBase64EncodedIconData().equals(this.field_148299_g)) + { + this.field_148299_g = this.field_148301_e.getBase64EncodedIconData(); + this.func_148297_b(); + this.field_148303_c.func_146795_p().saveServerList(); + } + + if (this.field_148305_h != null) + { + this.field_148300_d.getTextureManager().bindTexture(this.field_148306_i); + Gui.func_146110_a(p_148279_2_, p_148279_3_, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + } + + int k2 = p_148279_7_ - p_148279_2_; + int l2 = p_148279_8_ - p_148279_3_; + + String tooltip = FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_148279_2_, p_148279_4_, p_148279_3_, k2, l2); + if (tooltip != null) + { + this.field_148303_c.func_146793_a(tooltip); + } else + if (k2 >= p_148279_4_ - 15 && k2 <= p_148279_4_ - 5 && l2 >= 0 && l2 <= 8) + { + this.field_148303_c.func_146793_a(s1); + } + else if (k2 >= p_148279_4_ - i2 - 15 - 2 && k2 <= p_148279_4_ - 15 - 2 && l2 >= 0 && l2 <= 8) + { + this.field_148303_c.func_146793_a(s); + } + } + + private void func_148297_b() + { + if (this.field_148301_e.getBase64EncodedIconData() == null) + { + this.field_148300_d.getTextureManager().deleteTexture(this.field_148306_i); + this.field_148305_h = null; + } + else + { + ByteBuf bytebuf = Unpooled.copiedBuffer(this.field_148301_e.getBase64EncodedIconData(), Charsets.UTF_8); + ByteBuf bytebuf1 = Base64.decode(bytebuf); + BufferedImage bufferedimage; + label74: + { + try + { + bufferedimage = ImageIO.read(new ByteBufInputStream(bytebuf1)); + Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + break label74; + } + catch (Exception exception) + { + logger.error("Invalid icon for server " + this.field_148301_e.serverName + " (" + this.field_148301_e.serverIP + ")", exception); + this.field_148301_e.func_147407_a((String)null); + } + finally + { + bytebuf.release(); + bytebuf1.release(); + } + + return; + } + + if (this.field_148305_h == null) + { + this.field_148305_h = new DynamicTexture(bufferedimage.getWidth(), bufferedimage.getHeight()); + this.field_148300_d.getTextureManager().loadTexture(this.field_148306_i, this.field_148305_h); + } + + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), this.field_148305_h.getTextureData(), 0, bufferedimage.getWidth()); + this.field_148305_h.updateDynamicTexture(); + } + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + this.field_148303_c.func_146790_a(p_148278_1_); + + if (Minecraft.getSystemTime() - this.field_148298_f < 250L) + { + this.field_148303_c.func_146796_h(); + } + + this.field_148298_f = Minecraft.getSystemTime(); + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} + + public ServerData func_148296_a() + { + return this.field_148301_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerSelectionList.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerSelectionList.java new file mode 100644 index 0000000..25a5270 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/ServerSelectionList.java @@ -0,0 +1,110 @@ +package net.minecraft.client.gui; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.network.LanServerDetector; + +@SideOnly(Side.CLIENT) +public class ServerSelectionList extends GuiListExtended +{ + private final GuiMultiplayer field_148200_k; + private final List field_148198_l = Lists.newArrayList(); + private final List field_148199_m = Lists.newArrayList(); + private final GuiListExtended.IGuiListEntry field_148196_n = new ServerListEntryLanScan(); + private int field_148197_o = -1; + private static final String __OBFID = "CL_00000819"; + + public ServerSelectionList(GuiMultiplayer p_i45049_1_, Minecraft p_i45049_2_, int p_i45049_3_, int p_i45049_4_, int p_i45049_5_, int p_i45049_6_, int p_i45049_7_) + { + super(p_i45049_2_, p_i45049_3_, p_i45049_4_, p_i45049_5_, p_i45049_6_, p_i45049_7_); + this.field_148200_k = p_i45049_1_; + } + + /** + * Gets the IGuiListEntry object for the given index + */ + public GuiListExtended.IGuiListEntry getListEntry(int p_148180_1_) + { + if (p_148180_1_ < this.field_148198_l.size()) + { + return (GuiListExtended.IGuiListEntry)this.field_148198_l.get(p_148180_1_); + } + else + { + p_148180_1_ -= this.field_148198_l.size(); + + if (p_148180_1_ == 0) + { + return this.field_148196_n; + } + else + { + --p_148180_1_; + return (GuiListExtended.IGuiListEntry)this.field_148199_m.get(p_148180_1_); + } + } + } + + protected int getSize() + { + return this.field_148198_l.size() + 1 + this.field_148199_m.size(); + } + + public void func_148192_c(int p_148192_1_) + { + this.field_148197_o = p_148192_1_; + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return p_148131_1_ == this.field_148197_o; + } + + public int func_148193_k() + { + return this.field_148197_o; + } + + public void func_148195_a(ServerList p_148195_1_) + { + this.field_148198_l.clear(); + + for (int i = 0; i < p_148195_1_.countServers(); ++i) + { + this.field_148198_l.add(new ServerListEntryNormal(this.field_148200_k, p_148195_1_.getServerData(i))); + } + } + + public void func_148194_a(List p_148194_1_) + { + this.field_148199_m.clear(); + Iterator iterator = p_148194_1_.iterator(); + + while (iterator.hasNext()) + { + LanServerDetector.LanServer lanserver = (LanServerDetector.LanServer)iterator.next(); + this.field_148199_m.add(new ServerListEntryLanDetected(this.field_148200_k, lanserver)); + } + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 30; + } + + /** + * Gets the width of the list + */ + public int getListWidth() + { + return super.getListWidth() + 85; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievement.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievement.java new file mode 100644 index 0000000..6be6db5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievement.java @@ -0,0 +1,150 @@ +package net.minecraft.client.gui.achievement; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.stats.Achievement; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiAchievement extends Gui +{ + private static final ResourceLocation field_146261_a = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + private Minecraft field_146259_f; + private int field_146260_g; + private int field_146267_h; + private String field_146268_i; + private String field_146265_j; + private Achievement field_146266_k; + private long field_146263_l; + private RenderItem field_146264_m; + private boolean field_146262_n; + private static final String __OBFID = "CL_00000721"; + + public GuiAchievement(Minecraft mc) + { + this.field_146259_f = mc; + this.field_146264_m = new RenderItem(); + } + + public void func_146256_a(Achievement p_146256_1_) + { + this.field_146268_i = I18n.format("achievement.get", new Object[0]); + this.field_146265_j = p_146256_1_.func_150951_e().getUnformattedText(); + this.field_146263_l = Minecraft.getSystemTime(); + this.field_146266_k = p_146256_1_; + this.field_146262_n = false; + } + + public void func_146255_b(Achievement p_146255_1_) + { + this.field_146268_i = p_146255_1_.func_150951_e().getUnformattedText(); + this.field_146265_j = p_146255_1_.getDescription(); + this.field_146263_l = Minecraft.getSystemTime() + 2500L; + this.field_146266_k = p_146255_1_; + this.field_146262_n = true; + } + + private void func_146258_c() + { + GL11.glViewport(0, 0, this.field_146259_f.displayWidth, this.field_146259_f.displayHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + this.field_146260_g = this.field_146259_f.displayWidth; + this.field_146267_h = this.field_146259_f.displayHeight; + ScaledResolution scaledresolution = new ScaledResolution(this.field_146259_f, this.field_146259_f.displayWidth, this.field_146259_f.displayHeight); + this.field_146260_g = scaledresolution.getScaledWidth(); + this.field_146267_h = scaledresolution.getScaledHeight(); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)this.field_146260_g, (double)this.field_146267_h, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + + public void func_146254_a() + { + if (this.field_146266_k != null && this.field_146263_l != 0L && Minecraft.getMinecraft().thePlayer != null) + { + double d0 = (double)(Minecraft.getSystemTime() - this.field_146263_l) / 3000.0D; + + if (!this.field_146262_n) + { + if (d0 < 0.0D || d0 > 1.0D) + { + this.field_146263_l = 0L; + return; + } + } + else if (d0 > 0.5D) + { + d0 = 0.5D; + } + + this.func_146258_c(); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + double d1 = d0 * 2.0D; + + if (d1 > 1.0D) + { + d1 = 2.0D - d1; + } + + d1 *= 4.0D; + d1 = 1.0D - d1; + + if (d1 < 0.0D) + { + d1 = 0.0D; + } + + d1 *= d1; + d1 *= d1; + int i = this.field_146260_g - 160; + int j = 0 - (int)(d1 * 36.0D); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + this.field_146259_f.getTextureManager().bindTexture(field_146261_a); + GL11.glDisable(GL11.GL_LIGHTING); + this.drawTexturedModalRect(i, j, 96, 202, 160, 32); + + if (this.field_146262_n) + { + this.field_146259_f.fontRenderer.drawSplitString(this.field_146265_j, i + 30, j + 7, 120, -1); + } + else + { + this.field_146259_f.fontRenderer.drawString(this.field_146268_i, i + 30, j + 7, -256); + this.field_146259_f.fontRenderer.drawString(this.field_146265_j, i + 30, j + 18, -1); + } + + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); + this.field_146264_m.renderItemAndEffectIntoGUI(this.field_146259_f.fontRenderer, this.field_146259_f.getTextureManager(), this.field_146266_k.theItemStack, i + 8, j + 8); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + public void func_146257_b() + { + this.field_146266_k = null; + this.field_146263_l = 0L; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievements.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievements.java new file mode 100644 index 0000000..fcc51e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiAchievements.java @@ -0,0 +1,610 @@ +package net.minecraft.client.gui.achievement; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import java.util.LinkedList; +import java.util.List; +import net.minecraftforge.common.AchievementPage; + +@SideOnly(Side.CLIENT) +public class GuiAchievements extends GuiScreen implements IProgressMeter +{ + private static final int field_146572_y = AchievementList.minDisplayColumn * 24 - 112; + private static final int field_146571_z = AchievementList.minDisplayRow * 24 - 112; + private static final int field_146559_A = AchievementList.maxDisplayColumn * 24 - 77; + private static final int field_146560_B = AchievementList.maxDisplayRow * 24 - 77; + private static final ResourceLocation field_146561_C = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + protected GuiScreen field_146562_a; + protected int field_146555_f = 256; + protected int field_146557_g = 202; + protected int field_146563_h; + protected int field_146564_i; + protected float field_146570_r = 1.0F; + protected double field_146569_s; + protected double field_146568_t; + protected double field_146567_u; + protected double field_146566_v; + protected double field_146565_w; + protected double field_146573_x; + private int field_146554_D; + private StatFileWriter field_146556_E; + private boolean field_146558_F = true; + private static final String __OBFID = "CL_00000722"; + + private int currentPage = -1; + private GuiButton button; + private LinkedList minecraftAchievements = new LinkedList(); + + public GuiAchievements(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) + { + this.field_146562_a = p_i45026_1_; + this.field_146556_E = p_i45026_2_; + short short1 = 141; + short short2 = 141; + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2); + minecraftAchievements.clear(); + for (Object achievement : AchievementList.achievementList) + { + if (!AchievementPage.isAchievementInPages((Achievement)achievement)) + { + minecraftAchievements.add((Achievement)achievement); + } + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); + } + + protected void actionPerformed(GuiButton button) + { + if (!this.field_146558_F) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_146562_a); + } + + if (button.id == 2) + { + currentPage++; + if (currentPage >= AchievementPage.getAchievementPages().size()) + { + currentPage = -1; + } + button.displayString = AchievementPage.getTitle(currentPage); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode()) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.field_146558_F) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats", new Object[0]), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, field_146510_b_[(int)(Minecraft.getSystemTime() / 150L % (long)field_146510_b_.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } + else + { + int k; + + if (Mouse.isButtonDown(0)) + { + k = (this.width - this.field_146555_f) / 2; + int l = (this.height - this.field_146557_g) / 2; + int i1 = k + 8; + int j1 = l + 17; + + if ((this.field_146554_D == 0 || this.field_146554_D == 1) && mouseX >= i1 && mouseX < i1 + 224 && mouseY >= j1 && mouseY < j1 + 155) + { + if (this.field_146554_D == 0) + { + this.field_146554_D = 1; + } + else + { + this.field_146567_u -= (double)((float)(mouseX - this.field_146563_h) * this.field_146570_r); + this.field_146566_v -= (double)((float)(mouseY - this.field_146564_i) * this.field_146570_r); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + this.field_146563_h = mouseX; + this.field_146564_i = mouseY; + } + } + else + { + this.field_146554_D = 0; + } + + k = Mouse.getDWheel(); + float f4 = this.field_146570_r; + + if (k < 0) + { + this.field_146570_r += 0.25F; + } + else if (k > 0) + { + this.field_146570_r -= 0.25F; + } + + this.field_146570_r = MathHelper.clamp_float(this.field_146570_r, 1.0F, 2.0F); + + if (this.field_146570_r != f4) + { + float f6 = f4 - this.field_146570_r; + float f5 = f4 * (float)this.field_146555_f; + float f1 = f4 * (float)this.field_146557_g; + float f2 = this.field_146570_r * (float)this.field_146555_f; + float f3 = this.field_146570_r * (float)this.field_146557_g; + this.field_146567_u -= (double)((f2 - f5) * 0.5F); + this.field_146566_v -= (double)((f3 - f1) * 0.5F); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + if (this.field_146565_w < (double)field_146572_y) + { + this.field_146565_w = (double)field_146572_y; + } + + if (this.field_146573_x < (double)field_146571_z) + { + this.field_146573_x = (double)field_146571_z; + } + + if (this.field_146565_w >= (double)field_146559_A) + { + this.field_146565_w = (double)(field_146559_A - 1); + } + + if (this.field_146573_x >= (double)field_146560_B) + { + this.field_146573_x = (double)(field_146560_B - 1); + } + + this.drawDefaultBackground(); + this.func_146552_b(mouseX, mouseY, partialTicks); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + this.func_146553_h(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + public void func_146509_g() + { + if (this.field_146558_F) + { + this.field_146558_F = false; + } + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + if (!this.field_146558_F) + { + this.field_146569_s = this.field_146567_u; + this.field_146568_t = this.field_146566_v; + double d0 = this.field_146565_w - this.field_146567_u; + double d1 = this.field_146573_x - this.field_146566_v; + + if (d0 * d0 + d1 * d1 < 4.0D) + { + this.field_146567_u += d0; + this.field_146566_v += d1; + } + else + { + this.field_146567_u += d0 * 0.85D; + this.field_146566_v += d1 * 0.85D; + } + } + } + + protected void func_146553_h() + { + int i = (this.width - this.field_146555_f) / 2; + int j = (this.height - this.field_146557_g) / 2; + this.fontRendererObj.drawString(I18n.format("gui.achievements", new Object[0]), i + 15, j + 5, 4210752); + } + + protected void func_146552_b(int p_146552_1_, int p_146552_2_, float p_146552_3_) + { + int k = MathHelper.floor_double(this.field_146569_s + (this.field_146567_u - this.field_146569_s) * (double)p_146552_3_); + int l = MathHelper.floor_double(this.field_146568_t + (this.field_146566_v - this.field_146568_t) * (double)p_146552_3_); + + if (k < field_146572_y) + { + k = field_146572_y; + } + + if (l < field_146571_z) + { + l = field_146571_z; + } + + if (k >= field_146559_A) + { + k = field_146559_A - 1; + } + + if (l >= field_146560_B) + { + l = field_146560_B - 1; + } + + int i1 = (this.width - this.field_146555_f) / 2; + int j1 = (this.height - this.field_146557_g) / 2; + int k1 = i1 + 16; + int l1 = j1 + 17; + this.zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_GEQUAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)k1, (float)l1, -200.0F); + // FIXES models rendering weirdly in the acheivements pane + // see https://github.com/MinecraftForge/MinecraftForge/commit/1b7ce7592caafb760ec93066184182ae0711e793#commitcomment-10512284 + GL11.glScalef(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int i2 = k + 288 >> 4; + int j2 = l + 288 >> 4; + int k2 = (k + 288) % 16; + int l2 = (l + 288) % 16; + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + boolean flag4 = true; + Random random = new Random(); + float f1 = 16.0F / this.field_146570_r; + float f2 = 16.0F / this.field_146570_r; + int i3; + int j3; + int k3; + + for (i3 = 0; (float)i3 * f1 - (float)l2 < 155.0F; ++i3) + { + float f3 = 0.6F - (float)(j2 + i3) / 25.0F * 0.3F; + GL11.glColor4f(f3, f3, f3, 1.0F); + + for (j3 = 0; (float)j3 * f2 - (float)k2 < 224.0F; ++j3) + { + random.setSeed((long)(this.mc.getSession().getPlayerID().hashCode() + i2 + j3 + (j2 + i3) * 16)); + k3 = random.nextInt(1 + j2 + i3) + (j2 + i3) / 2; + IIcon iicon = Blocks.sand.getIcon(0, 0); + + if (k3 <= 37 && j2 + i3 != 35) + { + if (k3 == 22) + { + if (random.nextInt(2) == 0) + { + iicon = Blocks.diamond_ore.getIcon(0, 0); + } + else + { + iicon = Blocks.redstone_ore.getIcon(0, 0); + } + } + else if (k3 == 10) + { + iicon = Blocks.iron_ore.getIcon(0, 0); + } + else if (k3 == 8) + { + iicon = Blocks.coal_ore.getIcon(0, 0); + } + else if (k3 > 4) + { + iicon = Blocks.stone.getIcon(0, 0); + } + else if (k3 > 0) + { + iicon = Blocks.dirt.getIcon(0, 0); + } + } + else + { + iicon = Blocks.bedrock.getIcon(0, 0); + } + + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.drawTexturedModelRectFromIcon(j3 * 16 - k2, i3 * 16 - l2, iicon, 16, 16); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + this.mc.getTextureManager().bindTexture(field_146561_C); + int i4; + int j4; + int l4; + + List achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (i3 = 0; i3 < achievementList.size(); ++i3) + { + Achievement achievement1 = achievementList.get(i3); + + if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) + { + j3 = achievement1.displayColumn * 24 - k + 11; + k3 = achievement1.displayRow * 24 - l + 11; + l4 = achievement1.parentAchievement.displayColumn * 24 - k + 11; + int l3 = achievement1.parentAchievement.displayRow * 24 - l + 11; + boolean flag5 = this.field_146556_E.hasAchievementUnlocked(achievement1); + boolean flag6 = this.field_146556_E.canUnlockAchievement(achievement1); + i4 = this.field_146556_E.func_150874_c(achievement1); + + if (i4 <= 4) + { + j4 = -16777216; + + if (flag5) + { + j4 = -6250336; + } + else if (flag6) + { + j4 = -16711936; + } + + this.drawHorizontalLine(j3, l4, k3, j4); + this.drawVerticalLine(l4, k3, l3, j4); + + if (j3 > l4) + { + this.drawTexturedModalRect(j3 - 11 - 7, k3 - 5, 114, 234, 7, 11); + } + else if (j3 < l4) + { + this.drawTexturedModalRect(j3 + 11, k3 - 5, 107, 234, 7, 11); + } + else if (k3 > l3) + { + this.drawTexturedModalRect(j3 - 5, k3 - 11 - 7, 96, 234, 11, 7); + } + else if (k3 < l3) + { + this.drawTexturedModalRect(j3 - 5, k3 + 11, 96, 241, 11, 7); + } + } + } + } + + Achievement achievement = null; + RenderItem renderitem = new RenderItem(); + float f4 = (float)(p_146552_1_ - k1) * this.field_146570_r; + float f5 = (float)(p_146552_2_ - l1) * this.field_146570_r; + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int i5; + int j5; + + for (l4 = 0; l4 < achievementList.size(); ++l4) + { + Achievement achievement2 = (Achievement)achievementList.get(l4); + i5 = achievement2.displayColumn * 24 - k; + j5 = achievement2.displayRow * 24 - l; + + if (i5 >= -24 && j5 >= -24 && (float)i5 <= 224.0F * this.field_146570_r && (float)j5 <= 155.0F * this.field_146570_r) + { + i4 = this.field_146556_E.func_150874_c(achievement2); + float f6; + + if (this.field_146556_E.hasAchievementUnlocked(achievement2)) + { + f6 = 0.75F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (this.field_146556_E.canUnlockAchievement(achievement2)) + { + f6 = 1.0F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (i4 < 3) + { + f6 = 0.3F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (i4 == 3) + { + f6 = 0.2F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else + { + if (i4 != 4) + { + continue; + } + + f6 = 0.1F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + + this.mc.getTextureManager().bindTexture(field_146561_C); + + GL11.glEnable(GL11.GL_BLEND);// Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it. + if (achievement2.getSpecial()) + { + this.drawTexturedModalRect(i5 - 2, j5 - 2, 26, 202, 26, 26); + } + else + { + this.drawTexturedModalRect(i5 - 2, j5 - 2, 0, 202, 26, 26); + } + GL11.glDisable(GL11.GL_BLEND); //Forge: Cleanup states we set. + + if (!this.field_146556_E.canUnlockAchievement(achievement2)) + { + f6 = 0.1F; + GL11.glColor4f(f6, f6, f6, 1.0F); + renderitem.renderWithColor = false; + } + + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure Lighting is disabled. Fixes MC-33065 + GL11.glEnable(GL11.GL_CULL_FACE); + renderitem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), achievement2.theItemStack, i5 + 3, j5 + 3); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_LIGHTING); + + if (!this.field_146556_E.canUnlockAchievement(achievement2)) + { + renderitem.renderWithColor = true; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (f4 >= (float)i5 && f4 <= (float)(i5 + 22) && f5 >= (float)j5 && f5 <= (float)(j5 + 22)) + { + achievement = achievement2; + } + } + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146561_C); + this.drawTexturedModalRect(i1, j1, 0, 0, this.field_146555_f, this.field_146557_g); + this.zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + super.drawScreen(p_146552_1_, p_146552_2_, p_146552_3_); + + if (achievement != null) + { + String s1 = achievement.func_150951_e().getUnformattedText(); + String s2 = achievement.getDescription(); + i5 = p_146552_1_ + 12; + j5 = p_146552_2_ - 4; + i4 = this.field_146556_E.func_150874_c(achievement); + + if (!this.field_146556_E.canUnlockAchievement(achievement)) + { + String s; + int k4; + + if (i4 == 3) + { + s1 = I18n.format("achievement.unknown", new Object[0]); + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + s = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.func_150951_e()})).getUnformattedText(); + k4 = this.fontRendererObj.splitStringWidth(s, j4); + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k4 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s, i5, j5 + 12, j4, -9416624); + } + else if (i4 < 3) + { + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + s = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.func_150951_e()})).getUnformattedText(); + k4 = this.fontRendererObj.splitStringWidth(s, j4); + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k4 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s, i5, j5 + 12, j4, -9416624); + } + else + { + s1 = null; + } + } + else + { + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + int k5 = this.fontRendererObj.splitStringWidth(s2, j4); + + if (this.field_146556_E.hasAchievementUnlocked(achievement)) + { + k5 += 12; + } + + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k5 + 3 + 12, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s2, i5, j5 + 12, j4, -6250336); + + if (this.field_146556_E.hasAchievementUnlocked(achievement)) + { + this.fontRendererObj.drawStringWithShadow(I18n.format("achievement.taken", new Object[0]), i5, j5 + k5 + 4, -7302913); + } + } + + if (s1 != null) + { + this.fontRendererObj.drawStringWithShadow(s1, i5, j5, this.field_146556_E.canUnlockAchievement(achievement) ? (achievement.getSpecial() ? -128 : -1) : (achievement.getSpecial() ? -8355776 : -8355712)); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return !this.field_146558_F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiStats.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiStats.java new file mode 100644 index 0000000..984b0ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/achievement/GuiStats.java @@ -0,0 +1,859 @@ +package net.minecraft.client.gui.achievement; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityList; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatCrafting; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.stats.StatList; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiStats extends GuiScreen implements IProgressMeter +{ + private static RenderItem field_146544_g = new RenderItem(); + protected GuiScreen field_146549_a; + protected String field_146542_f = "Select world"; + private GuiStats.StatsGeneral field_146550_h; + private GuiStats.StatsItem field_146551_i; + private GuiStats.StatsBlock field_146548_r; + private GuiStats.StatsMobsList field_146547_s; + private StatFileWriter field_146546_t; + private GuiSlot field_146545_u; + /** When true, the game will be paused when the gui is shown */ + private boolean doesGuiPauseGame = true; + private static final String __OBFID = "CL_00000723"; + + public GuiStats(GuiScreen p_i1071_1_, StatFileWriter p_i1071_2_) + { + this.field_146549_a = p_i1071_1_; + this.field_146546_t = p_i1071_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_146542_f = I18n.format("gui.stats", new Object[0]); + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + } + + public void func_146541_h() + { + this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 160, this.height - 52, 80, 20, I18n.format("stat.generalButton", new Object[0]))); + GuiButton guibutton; + GuiButton guibutton1; + GuiButton guibutton2; + this.buttonList.add(guibutton = new GuiButton(2, this.width / 2 - 80, this.height - 52, 80, 20, I18n.format("stat.blocksButton", new Object[0]))); + this.buttonList.add(guibutton1 = new GuiButton(3, this.width / 2, this.height - 52, 80, 20, I18n.format("stat.itemsButton", new Object[0]))); + this.buttonList.add(guibutton2 = new GuiButton(4, this.width / 2 + 80, this.height - 52, 80, 20, I18n.format("stat.mobsButton", new Object[0]))); + + if (this.field_146548_r.getSize() == 0) + { + guibutton.enabled = false; + } + + if (this.field_146551_i.getSize() == 0) + { + guibutton1.enabled = false; + } + + if (this.field_146547_s.getSize() == 0) + { + guibutton2.enabled = false; + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(this.field_146549_a); + } + else if (button.id == 1) + { + this.field_146545_u = this.field_146550_h; + } + else if (button.id == 3) + { + this.field_146545_u = this.field_146551_i; + } + else if (button.id == 2) + { + this.field_146545_u = this.field_146548_r; + } + else if (button.id == 4) + { + this.field_146545_u = this.field_146547_s; + } + else + { + this.field_146545_u.actionPerformed(button); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + if (this.doesGuiPauseGame) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats", new Object[0]), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, field_146510_b_[(int)(Minecraft.getSystemTime() / 150L % (long)field_146510_b_.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } + else + { + this.field_146545_u.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_146542_f, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + } + + public void func_146509_g() + { + if (this.doesGuiPauseGame) + { + this.field_146550_h = new GuiStats.StatsGeneral(); + this.field_146550_h.registerScrollButtons(1, 1); + this.field_146551_i = new GuiStats.StatsItem(); + this.field_146551_i.registerScrollButtons(1, 1); + this.field_146548_r = new GuiStats.StatsBlock(); + this.field_146548_r.registerScrollButtons(1, 1); + this.field_146547_s = new GuiStats.StatsMobsList(); + this.field_146547_s.registerScrollButtons(1, 1); + this.field_146545_u = this.field_146550_h; + this.func_146541_h(); + this.doesGuiPauseGame = false; + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return !this.doesGuiPauseGame; + } + + private void func_146521_a(int p_146521_1_, int p_146521_2_, Item p_146521_3_) + { + this.drawButtonBackground(p_146521_1_ + 1, p_146521_2_ + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + field_146544_g.renderItemIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(p_146521_3_, 1, 0), p_146521_1_ + 2, p_146521_2_ + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + /** + * Draws a gray box that serves as a button background. + */ + private void drawButtonBackground(int p_146531_1_, int p_146531_2_) + { + this.drawSprite(p_146531_1_, p_146531_2_, 0, 0); + } + + /** + * Draws a sprite from assets/textures/gui/container/stats_icons.png + */ + private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(statIcons); + float f = 0.0078125F; + float f1 = 0.0078125F; + boolean flag = true; + boolean flag1 = true; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel, (double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel, (double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel, (double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)); + tessellator.addVertexWithUV((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel, (double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)); + tessellator.draw(); + } + + @SideOnly(Side.CLIENT) + abstract class Stats extends GuiSlot + { + protected int field_148218_l = -1; + protected List field_148219_m; + protected Comparator field_148216_n; + protected int field_148217_o = -1; + protected int field_148215_p; + private static final String __OBFID = "CL_00000730"; + + protected Stats() + { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 20); + this.setShowSelectionBox(false); + this.setHasListHeader(true, 20); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return false; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + /** + * Handles drawing a list's header row. + */ + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + if (!Mouse.isButtonDown(0)) + { + this.field_148218_l = -1; + } + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 0); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 0, 18); + } + + if (this.field_148217_o != -1) + { + short short1 = 79; + byte b0 = 18; + + if (this.field_148217_o == 1) + { + short1 = 129; + } + else if (this.field_148217_o == 2) + { + short1 = 179; + } + + if (this.field_148215_p == 1) + { + b0 = 36; + } + + GuiStats.this.drawSprite(p_148129_1_ + short1, p_148129_2_ + 1, b0, 0); + } + } + + protected void func_148132_a(int p_148132_1_, int p_148132_2_) + { + this.field_148218_l = -1; + + if (p_148132_1_ >= 79 && p_148132_1_ < 115) + { + this.field_148218_l = 0; + } + else if (p_148132_1_ >= 129 && p_148132_1_ < 165) + { + this.field_148218_l = 1; + } + else if (p_148132_1_ >= 179 && p_148132_1_ < 215) + { + this.field_148218_l = 2; + } + + if (this.field_148218_l >= 0) + { + this.func_148212_h(this.field_148218_l); + GuiStats.this.mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + } + } + + protected final int getSize() + { + return this.field_148219_m.size(); + } + + protected final StatCrafting func_148211_c(int p_148211_1_) + { + return (StatCrafting)this.field_148219_m.get(p_148211_1_); + } + + protected abstract String func_148210_b(int p_148210_1_); + + protected void func_148209_a(StatBase p_148209_1_, int p_148209_2_, int p_148209_3_, boolean p_148209_4_) + { + String s; + + if (p_148209_1_ != null) + { + s = p_148209_1_.func_75968_a(GuiStats.this.field_146546_t.writeStat(p_148209_1_)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(s), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } + else + { + s = "-"; + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_148209_2_ - GuiStats.this.fontRendererObj.getStringWidth(s), p_148209_3_ + 5, p_148209_4_ ? 16777215 : 9474192); + } + } + + protected void func_148142_b(int p_148142_1_, int p_148142_2_) + { + if (p_148142_2_ >= this.top && p_148142_2_ <= this.bottom) + { + int k = this.func_148124_c(p_148142_1_, p_148142_2_); + int l = this.width / 2 - 92 - 16; + + if (k >= 0) + { + if (p_148142_1_ < l + 40 || p_148142_1_ > l + 40 + 20) + { + return; + } + + StatCrafting statcrafting = this.func_148211_c(k); + this.func_148213_a(statcrafting, p_148142_1_, p_148142_2_); + } + else + { + String s = ""; + + if (p_148142_1_ >= l + 115 - 18 && p_148142_1_ <= l + 115) + { + s = this.func_148210_b(0); + } + else if (p_148142_1_ >= l + 165 - 18 && p_148142_1_ <= l + 165) + { + s = this.func_148210_b(1); + } + else + { + if (p_148142_1_ < l + 215 - 18 || p_148142_1_ > l + 215) + { + return; + } + + s = this.func_148210_b(2); + } + + s = ("" + I18n.format(s, new Object[0])).trim(); + + if (s.length() > 0) + { + int i1 = p_148142_1_ + 12; + int j1 = p_148142_2_ - 12; + int k1 = GuiStats.this.fontRendererObj.getStringWidth(s); + GuiStats.this.drawGradientRect(i1 - 3, j1 - 3, i1 + k1 + 3, j1 + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(s, i1, j1, -1); + } + } + } + } + + protected void func_148213_a(StatCrafting p_148213_1_, int p_148213_2_, int p_148213_3_) + { + if (p_148213_1_ != null) + { + Item item = p_148213_1_.func_150959_a(); + String s = ("" + I18n.format(item.getUnlocalizedName() + ".name", new Object[0])).trim(); + + if (s.length() > 0) + { + int k = p_148213_2_ + 12; + int l = p_148213_3_ - 12; + int i1 = GuiStats.this.fontRendererObj.getStringWidth(s); + GuiStats.this.drawGradientRect(k - 3, l - 3, k + i1 + 3, l + 8 + 3, -1073741824, -1073741824); + GuiStats.this.fontRendererObj.drawStringWithShadow(s, k, l, -1); + } + } + } + + protected void func_148212_h(int p_148212_1_) + { + if (p_148212_1_ != this.field_148217_o) + { + this.field_148217_o = p_148212_1_; + this.field_148215_p = -1; + } + else if (this.field_148215_p == -1) + { + this.field_148215_p = 1; + } + else + { + this.field_148217_o = -1; + this.field_148215_p = 0; + } + + Collections.sort(this.field_148219_m, this.field_148216_n); + } + } + + @SideOnly(Side.CLIENT) + class StatsBlock extends GuiStats.Stats + { + private static final String __OBFID = "CL_00000724"; + + public StatsBlock() + { + this.field_148219_m = new ArrayList(); + Iterator iterator = StatList.objectMineStats.iterator(); + + while (iterator.hasNext()) + { + StatCrafting statcrafting = (StatCrafting)iterator.next(); + boolean flag = false; + int i = Item.getIdFromItem(statcrafting.func_150959_a()); + + if (GuiStats.this.field_146546_t.writeStat(statcrafting) > 0) + { + flag = true; + } + else if (StatList.objectUseStats[i] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectUseStats[i]) > 0) + { + flag = true; + } + else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectCraftStats[i]) > 0) + { + flag = true; + } + + if (flag) + { + this.field_148219_m.add(statcrafting); + } + } + + this.field_148216_n = new Comparator() + { + private static final String __OBFID = "CL_00000725"; + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) + { + int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase statbase = null; + StatBase statbase1 = null; + + if (StatsBlock.this.field_148217_o == 2) + { + statbase = StatList.mineBlockStatArray[j]; + statbase1 = StatList.mineBlockStatArray[k]; + } + else if (StatsBlock.this.field_148217_o == 0) + { + statbase = StatList.objectCraftStats[j]; + statbase1 = StatList.objectCraftStats[k]; + } + else if (StatsBlock.this.field_148217_o == 1) + { + statbase = StatList.objectUseStats[j]; + statbase1 = StatList.objectUseStats[k]; + } + + if (statbase != null || statbase1 != null) + { + if (statbase == null) + { + return 1; + } + + if (statbase1 == null) + { + return -1; + } + + int l = GuiStats.this.field_146546_t.writeStat(statbase); + int i1 = GuiStats.this.field_146546_t.writeStat(statbase1); + + if (l != i1) + { + return (l - i1) * StatsBlock.this.field_148215_p; + } + } + + return j - k; + } + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((StatCrafting)p_compare_1_, (StatCrafting)p_compare_2_); + } + }; + } + + /** + * Handles drawing a list's header row. + */ + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + super.drawListHeader(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 36, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 54, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 54, 18); + } + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + StatCrafting statcrafting = this.func_148211_c(p_148126_1_); + Item item = statcrafting.func_150959_a(); + GuiStats.this.func_146521_a(p_148126_2_ + 40, p_148126_3_, item); + int k1 = Item.getIdFromItem(item); + this.func_148209_a(StatList.objectCraftStats[k1], p_148126_2_ + 115, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(StatList.objectUseStats[k1], p_148126_2_ + 165, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(statcrafting, p_148126_2_ + 215, p_148126_3_, p_148126_1_ % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) + { + return p_148210_1_ == 0 ? "stat.crafted" : (p_148210_1_ == 1 ? "stat.used" : "stat.mined"); + } + } + + @SideOnly(Side.CLIENT) + class StatsGeneral extends GuiSlot + { + private static final String __OBFID = "CL_00000726"; + + public StatsGeneral() + { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, 10); + this.setShowSelectionBox(false); + } + + protected int getSize() + { + return StatList.generalStats.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return false; + } + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return this.getSize() * 10; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + StatBase statbase = (StatBase)StatList.generalStats.get(p_148126_1_); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, statbase.func_150951_e().getUnformattedText(), p_148126_2_ + 2, p_148126_3_ + 1, p_148126_1_ % 2 == 0 ? 16777215 : 9474192); + String s = statbase.func_75968_a(GuiStats.this.field_146546_t.writeStat(statbase)); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_148126_2_ + 2 + 213 - GuiStats.this.fontRendererObj.getStringWidth(s), p_148126_3_ + 1, p_148126_1_ % 2 == 0 ? 16777215 : 9474192); + } + } + + @SideOnly(Side.CLIENT) + class StatsItem extends GuiStats.Stats + { + private static final String __OBFID = "CL_00000727"; + + public StatsItem() + { + this.field_148219_m = new ArrayList(); + Iterator iterator = StatList.itemStats.iterator(); + + while (iterator.hasNext()) + { + StatCrafting statcrafting = (StatCrafting)iterator.next(); + boolean flag = false; + int i = Item.getIdFromItem(statcrafting.func_150959_a()); + + if (GuiStats.this.field_146546_t.writeStat(statcrafting) > 0) + { + flag = true; + } + else if (StatList.objectBreakStats[i] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectBreakStats[i]) > 0) + { + flag = true; + } + else if (StatList.objectCraftStats[i] != null && GuiStats.this.field_146546_t.writeStat(StatList.objectCraftStats[i]) > 0) + { + flag = true; + } + + if (flag) + { + this.field_148219_m.add(statcrafting); + } + } + + this.field_148216_n = new Comparator() + { + private static final String __OBFID = "CL_00000728"; + public int compare(StatCrafting p_compare_1_, StatCrafting p_compare_2_) + { + int j = Item.getIdFromItem(p_compare_1_.func_150959_a()); + int k = Item.getIdFromItem(p_compare_2_.func_150959_a()); + StatBase statbase = null; + StatBase statbase1 = null; + + if (StatsItem.this.field_148217_o == 0) + { + statbase = StatList.objectBreakStats[j]; + statbase1 = StatList.objectBreakStats[k]; + } + else if (StatsItem.this.field_148217_o == 1) + { + statbase = StatList.objectCraftStats[j]; + statbase1 = StatList.objectCraftStats[k]; + } + else if (StatsItem.this.field_148217_o == 2) + { + statbase = StatList.objectUseStats[j]; + statbase1 = StatList.objectUseStats[k]; + } + + if (statbase != null || statbase1 != null) + { + if (statbase == null) + { + return 1; + } + + if (statbase1 == null) + { + return -1; + } + + int l = GuiStats.this.field_146546_t.writeStat(statbase); + int i1 = GuiStats.this.field_146546_t.writeStat(statbase1); + + if (l != i1) + { + return (l - i1) * StatsItem.this.field_148215_p; + } + } + + return j - k; + } + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((StatCrafting)p_compare_1_, (StatCrafting)p_compare_2_); + } + }; + } + + /** + * Handles drawing a list's header row. + */ + protected void drawListHeader(int p_148129_1_, int p_148129_2_, Tessellator p_148129_3_) + { + super.drawListHeader(p_148129_1_, p_148129_2_, p_148129_3_); + + if (this.field_148218_l == 0) + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18 + 1, p_148129_2_ + 1 + 1, 72, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 115 - 18, p_148129_2_ + 1, 72, 18); + } + + if (this.field_148218_l == 1) + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18 + 1, p_148129_2_ + 1 + 1, 18, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 165 - 18, p_148129_2_ + 1, 18, 18); + } + + if (this.field_148218_l == 2) + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18 + 1, p_148129_2_ + 1 + 1, 36, 18); + } + else + { + GuiStats.this.drawSprite(p_148129_1_ + 215 - 18, p_148129_2_ + 1, 36, 18); + } + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + StatCrafting statcrafting = this.func_148211_c(p_148126_1_); + Item item = statcrafting.func_150959_a(); + GuiStats.this.func_146521_a(p_148126_2_ + 40, p_148126_3_, item); + int k1 = Item.getIdFromItem(item); + this.func_148209_a(StatList.objectBreakStats[k1], p_148126_2_ + 115, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(StatList.objectCraftStats[k1], p_148126_2_ + 165, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(statcrafting, p_148126_2_ + 215, p_148126_3_, p_148126_1_ % 2 == 0); + } + + protected String func_148210_b(int p_148210_1_) + { + return p_148210_1_ == 1 ? "stat.crafted" : (p_148210_1_ == 2 ? "stat.used" : "stat.depleted"); + } + } + + @SideOnly(Side.CLIENT) + class StatsMobsList extends GuiSlot + { + private final List field_148222_l = new ArrayList(); + private static final String __OBFID = "CL_00000729"; + + public StatsMobsList() + { + super(GuiStats.this.mc, GuiStats.this.width, GuiStats.this.height, 32, GuiStats.this.height - 64, GuiStats.this.fontRendererObj.FONT_HEIGHT * 4); + this.setShowSelectionBox(false); + Iterator iterator = EntityList.entityEggs.values().iterator(); + + while (iterator.hasNext()) + { + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)iterator.next(); + + if (GuiStats.this.field_146546_t.writeStat(entityegginfo.field_151512_d) > 0 || GuiStats.this.field_146546_t.writeStat(entityegginfo.field_151513_e) > 0) + { + this.field_148222_l.add(entityegginfo); + } + } + } + + protected int getSize() + { + return this.field_148222_l.size(); + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) {} + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return false; + } + + /** + * Return the height of the content being scrolled + */ + protected int getContentHeight() + { + return this.getSize() * GuiStats.this.fontRendererObj.FONT_HEIGHT * 4; + } + + protected void drawBackground() + { + GuiStats.this.drawDefaultBackground(); + } + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)this.field_148222_l.get(p_148126_1_); + String s = I18n.format("entity." + EntityList.getStringFromID(entityegginfo.spawnedID) + ".name", new Object[0]); + int k1 = GuiStats.this.field_146546_t.writeStat(entityegginfo.field_151512_d); + int l1 = GuiStats.this.field_146546_t.writeStat(entityegginfo.field_151513_e); + String s1 = I18n.format("stat.entityKills", new Object[] {Integer.valueOf(k1), s}); + String s2 = I18n.format("stat.entityKilledBy", new Object[] {s, Integer.valueOf(l1)}); + + if (k1 == 0) + { + s1 = I18n.format("stat.entityKills.none", new Object[] {s}); + } + + if (l1 == 0) + { + s2 = I18n.format("stat.entityKilledBy.none", new Object[] {s}); + } + + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s, p_148126_2_ + 2 - 10, p_148126_3_ + 1, 16777215); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s1, p_148126_2_ + 2, p_148126_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT, k1 == 0 ? 6316128 : 9474192); + GuiStats.this.drawString(GuiStats.this.fontRendererObj, s2, p_148126_2_ + 2, p_148126_3_ + 1 + GuiStats.this.fontRendererObj.FONT_HEIGHT * 2, l1 == 0 ? 6316128 : 9474192); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/CreativeCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/CreativeCrafting.java new file mode 100644 index 0000000..6875ddf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/CreativeCrafting.java @@ -0,0 +1,39 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.item.ItemStack; + +@SideOnly(Side.CLIENT) +public class CreativeCrafting implements ICrafting +{ + private final Minecraft field_146109_a; + private static final String __OBFID = "CL_00000751"; + + public CreativeCrafting(Minecraft selectionListIn) + { + this.field_146109_a = selectionListIn; + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) {} + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) + { + this.field_146109_a.playerController.sendSlotPacket(p_71111_3_, p_71111_2_); + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBeacon.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBeacon.java new file mode 100644 index 0000000..3769c59 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBeacon.java @@ -0,0 +1,348 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import java.util.Iterator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.potion.Potion; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiBeacon extends GuiContainer +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation beaconGuiTextures = new ResourceLocation("textures/gui/container/beacon.png"); + private TileEntityBeacon tileBeacon; + private GuiBeacon.ConfirmButton beaconConfirmButton; + private boolean buttonsNotDrawn; + private static final String __OBFID = "CL_00000739"; + + public GuiBeacon(InventoryPlayer p_i1078_1_, TileEntityBeacon p_i1078_2_) + { + super(new ContainerBeacon(p_i1078_1_, p_i1078_2_)); + this.tileBeacon = p_i1078_2_; + this.xSize = 230; + this.ySize = 219; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + this.buttonList.add(this.beaconConfirmButton = new GuiBeacon.ConfirmButton(-1, this.guiLeft + 164, this.guiTop + 107)); + this.buttonList.add(new GuiBeacon.CancelButton(-2, this.guiLeft + 190, this.guiTop + 107)); + this.buttonsNotDrawn = true; + this.beaconConfirmButton.enabled = false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + + if (this.buttonsNotDrawn && this.tileBeacon.getLevels() >= 0) + { + this.buttonsNotDrawn = false; + int j; + int k; + int l; + int i1; + GuiBeacon.PowerButton powerbutton; + + for (int i = 0; i <= 2; ++i) + { + j = TileEntityBeacon.effectsList[i].length; + k = j * 22 + (j - 1) * 2; + + for (l = 0; l < j; ++l) + { + i1 = TileEntityBeacon.effectsList[i][l].id; + powerbutton = new GuiBeacon.PowerButton(i << 8 | i1, this.guiLeft + 76 + l * 24 - k / 2, this.guiTop + 22 + i * 25, i1, i); + this.buttonList.add(powerbutton); + + if (i >= this.tileBeacon.getLevels()) + { + powerbutton.enabled = false; + } + else if (i1 == this.tileBeacon.getPrimaryEffect()) + { + powerbutton.func_146140_b(true); + } + } + } + + byte b0 = 3; + j = TileEntityBeacon.effectsList[b0].length + 1; + k = j * 22 + (j - 1) * 2; + + for (l = 0; l < j - 1; ++l) + { + i1 = TileEntityBeacon.effectsList[b0][l].id; + powerbutton = new GuiBeacon.PowerButton(b0 << 8 | i1, this.guiLeft + 167 + l * 24 - k / 2, this.guiTop + 47, i1, b0); + this.buttonList.add(powerbutton); + + if (b0 >= this.tileBeacon.getLevels()) + { + powerbutton.enabled = false; + } + else if (i1 == this.tileBeacon.getSecondaryEffect()) + { + powerbutton.func_146140_b(true); + } + } + + if (this.tileBeacon.getPrimaryEffect() > 0) + { + GuiBeacon.PowerButton powerbutton1 = new GuiBeacon.PowerButton(b0 << 8 | this.tileBeacon.getPrimaryEffect(), this.guiLeft + 167 + (j - 1) * 24 - k / 2, this.guiTop + 47, this.tileBeacon.getPrimaryEffect(), b0); + this.buttonList.add(powerbutton1); + + if (b0 >= this.tileBeacon.getLevels()) + { + powerbutton1.enabled = false; + } + else if (this.tileBeacon.getPrimaryEffect() == this.tileBeacon.getSecondaryEffect()) + { + powerbutton1.func_146140_b(true); + } + } + } + + this.beaconConfirmButton.enabled = this.tileBeacon.getStackInSlot(0) != null && this.tileBeacon.getPrimaryEffect() > 0; + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == -2) + { + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button.id == -1) + { + String s = "MC|Beacon"; + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + bytebuf.writeInt(this.tileBeacon.getPrimaryEffect()); + bytebuf.writeInt(this.tileBeacon.getSecondaryEffect()); + this.mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(s, bytebuf)); + } + catch (Exception exception) + { + logger.error("Couldn\'t send beacon info", exception); + } + finally + { + bytebuf.release(); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + else if (button instanceof GuiBeacon.PowerButton) + { + if (((GuiBeacon.PowerButton)button).func_146141_c()) + { + return; + } + + int j = button.id; + int k = j & 255; + int i = j >> 8; + + if (i < 3) + { + this.tileBeacon.setPrimaryEffect(k); + } + else + { + this.tileBeacon.setSecondaryEffect(k); + } + + this.buttonList.clear(); + this.initGui(); + this.updateScreen(); + } + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + RenderHelper.disableStandardItemLighting(); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.primary", new Object[0]), 62, 10, 14737632); + this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10, 14737632); + Iterator iterator = this.buttonList.iterator(); + + while (iterator.hasNext()) + { + GuiButton guibutton = (GuiButton)iterator.next(); + + if (guibutton.func_146115_a()) + { + guibutton.func_146111_b(mouseX - this.guiLeft, mouseY - this.guiTop); + break; + } + } + + RenderHelper.enableGUIStandardItemLighting(); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(beaconGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + itemRender.zLevel = 100.0F; + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.emerald), k + 42, l + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.diamond), k + 42 + 22, l + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.gold_ingot), k + 42 + 44, l + 109); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), new ItemStack(Items.iron_ingot), k + 42 + 66, l + 109); + itemRender.zLevel = 0.0F; + } + + @SideOnly(Side.CLIENT) + static class Button extends GuiButton + { + private final ResourceLocation field_146145_o; + private final int field_146144_p; + private final int field_146143_q; + private boolean field_146142_r; + private static final String __OBFID = "CL_00000743"; + + protected Button(int p_i1077_1_, int p_i1077_2_, int p_i1077_3_, ResourceLocation p_i1077_4_, int p_i1077_5_, int p_i1077_6_) + { + super(p_i1077_1_, p_i1077_2_, p_i1077_3_, 22, 22, ""); + this.field_146145_o = p_i1077_4_; + this.field_146144_p = p_i1077_5_; + this.field_146143_q = p_i1077_6_; + } + + /** + * Draws this button to the screen. + */ + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + mc.getTextureManager().bindTexture(GuiBeacon.beaconGuiTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + short short1 = 219; + int k = 0; + + if (!this.enabled) + { + k += this.width * 2; + } + else if (this.field_146142_r) + { + k += this.width * 1; + } + else if (this.field_146123_n) + { + k += this.width * 3; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, k, short1, this.width, this.height); + + if (!GuiBeacon.beaconGuiTextures.equals(this.field_146145_o)) + { + mc.getTextureManager().bindTexture(this.field_146145_o); + } + + this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_146144_p, this.field_146143_q, 18, 18); + } + } + + public boolean func_146141_c() + { + return this.field_146142_r; + } + + public void func_146140_b(boolean p_146140_1_) + { + this.field_146142_r = p_146140_1_; + } + } + + @SideOnly(Side.CLIENT) + class CancelButton extends GuiBeacon.Button + { + private static final String __OBFID = "CL_00000740"; + + public CancelButton(int p_i1074_2_, int p_i1074_3_, int p_i1074_4_) + { + super(p_i1074_2_, p_i1074_3_, p_i1074_4_, GuiBeacon.beaconGuiTextures, 112, 220); + } + + public void func_146111_b(int mouseX, int mouseY) + { + GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.cancel", new Object[0]), mouseX, mouseY); + } + } + + @SideOnly(Side.CLIENT) + class ConfirmButton extends GuiBeacon.Button + { + private static final String __OBFID = "CL_00000741"; + + public ConfirmButton(int p_i1075_2_, int p_i1075_3_, int p_i1075_4_) + { + super(p_i1075_2_, p_i1075_3_, p_i1075_4_, GuiBeacon.beaconGuiTextures, 90, 220); + } + + public void func_146111_b(int mouseX, int mouseY) + { + GuiBeacon.this.drawCreativeTabHoveringText(I18n.format("gui.done", new Object[0]), mouseX, mouseY); + } + } + + @SideOnly(Side.CLIENT) + class PowerButton extends GuiBeacon.Button + { + private final int field_146149_p; + private final int field_146148_q; + private static final String __OBFID = "CL_00000742"; + + public PowerButton(int p_i1076_2_, int p_i1076_3_, int p_i1076_4_, int p_i1076_5_, int p_i1076_6_) + { + super(p_i1076_2_, p_i1076_3_, p_i1076_4_, GuiContainer.field_147001_a, 0 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[p_i1076_5_].getStatusIconIndex() / 8 * 18); + this.field_146149_p = p_i1076_5_; + this.field_146148_q = p_i1076_6_; + } + + public void func_146111_b(int mouseX, int mouseY) + { + String s = I18n.format(Potion.potionTypes[this.field_146149_p].getName(), new Object[0]); + + if (this.field_146148_q >= 3 && this.field_146149_p != Potion.regeneration.id) + { + s = s + " II"; + } + + GuiBeacon.this.drawCreativeTabHoveringText(s, mouseX, mouseY); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java new file mode 100644 index 0000000..4a96819 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java @@ -0,0 +1,85 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiBrewingStand extends GuiContainer +{ + private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); + private TileEntityBrewingStand tileBrewingStand; + private static final String __OBFID = "CL_00000746"; + + public GuiBrewingStand(InventoryPlayer p_i1081_1_, TileEntityBrewingStand p_i1081_2_) + { + super(new ContainerBrewingStand(p_i1081_1_, p_i1081_2_)); + this.tileBrewingStand = p_i1081_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.tileBrewingStand.hasCustomInventoryName() ? this.tileBrewingStand.getInventoryName() : I18n.format(this.tileBrewingStand.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + int i1 = this.tileBrewingStand.getBrewTime(); + + if (i1 > 0) + { + int j1 = (int)(28.0F * (1.0F - (float)i1 / 400.0F)); + + if (j1 > 0) + { + this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); + } + + int k1 = i1 / 2 % 7; + + switch (k1) + { + case 0: + j1 = 29; + break; + case 1: + j1 = 24; + break; + case 2: + j1 = 20; + break; + case 3: + j1 = 16; + break; + case 4: + j1 = 11; + break; + case 5: + j1 = 6; + break; + case 6: + j1 = 0; + } + + if (j1 > 0) + { + this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiChest.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiChest.java new file mode 100644 index 0000000..9d209c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiChest.java @@ -0,0 +1,51 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiChest extends GuiContainer +{ + private static final ResourceLocation field_147017_u = new ResourceLocation("textures/gui/container/generic_54.png"); + private IInventory upperChestInventory; + private IInventory lowerChestInventory; + /** window height is calculated with these values; the more rows, the heigher */ + private int inventoryRows; + private static final String __OBFID = "CL_00000749"; + + public GuiChest(IInventory p_i1083_1_, IInventory p_i1083_2_) + { + super(new ContainerChest(p_i1083_1_, p_i1083_2_)); + this.upperChestInventory = p_i1083_1_; + this.lowerChestInventory = p_i1083_2_; + this.allowUserInput = false; + short short1 = 222; + int i = short1 - 108; + this.inventoryRows = p_i1083_2_.getSizeInventory() / 9; + this.ySize = i + this.inventoryRows * 18; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.lowerChestInventory.hasCustomInventoryName() ? this.lowerChestInventory.getInventoryName() : I18n.format(this.lowerChestInventory.getInventoryName(), new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(this.upperChestInventory.hasCustomInventoryName() ? this.upperChestInventory.getInventoryName() : I18n.format(this.upperChestInventory.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147017_u); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.inventoryRows * 18 + 17); + this.drawTexturedModalRect(k, l + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainer.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainer.java new file mode 100644 index 0000000..c9eedd5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainer.java @@ -0,0 +1,755 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public abstract class GuiContainer extends GuiScreen +{ + protected static final ResourceLocation field_147001_a = new ResourceLocation("textures/gui/container/inventory.png"); + /** The X size of the inventory window in pixels. */ + protected int xSize = 176; + /** The Y size of the inventory window in pixels. */ + protected int ySize = 166; + /** A list of the players inventory slots */ + public Container inventorySlots; + /** Starting X position for the Gui. Inconsistent use for Gui backgrounds. */ + protected int guiLeft; + /** Starting Y position for the Gui. Inconsistent use for Gui backgrounds. */ + protected int guiTop; + private Slot theSlot; + /** Used when touchscreen is enabled. */ + private Slot clickedSlot; + /** Used when touchscreen is enabled. */ + private boolean isRightMouseClick; + /** Used when touchscreen is enabled */ + private ItemStack draggedStack; + private int field_147011_y; + private int field_147010_z; + private Slot returningStackDestSlot; + private long returningStackTime; + /** Used when touchscreen is enabled */ + private ItemStack returningStack; + private Slot field_146985_D; + private long field_146986_E; + protected final Set field_147008_s = new HashSet(); + protected boolean field_147007_t; + private int field_146987_F; + private int field_146988_G; + private boolean field_146995_H; + private int field_146996_I; + private long field_146997_J; + private Slot field_146998_K; + private int field_146992_L; + private boolean field_146993_M; + private ItemStack field_146994_N; + private static final String __OBFID = "CL_00000737"; + + public GuiContainer(Container p_i1072_1_) + { + this.inventorySlots = p_i1072_1_; + this.field_146995_H = true; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + this.mc.thePlayer.openContainer = this.inventorySlots; + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int k = this.guiLeft; + int l = this.guiTop; + this.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + super.drawScreen(mouseX, mouseY, partialTicks); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)k, (float)l, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.theSlot = null; + short short1 = 240; + short short2 = 240; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)short1 / 1.0F, (float)short2 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int k1; + + for (int i1 = 0; i1 < this.inventorySlots.inventorySlots.size(); ++i1) + { + Slot slot = (Slot)this.inventorySlots.inventorySlots.get(i1); + this.func_146977_a(slot); + + if (this.isMouseOverSlot(slot, mouseX, mouseY) && slot.func_111238_b()) + { + this.theSlot = slot; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int j1 = slot.xDisplayPosition; + k1 = slot.yDisplayPosition; + GL11.glColorMask(true, true, true, false); + this.drawGradientRect(j1, k1, j1 + 16, k1 + 16, -2130706433, -2130706433); + GL11.glColorMask(true, true, true, true); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + //Forge: Force lighting to be disabled as there are some issue where lighting would + //incorrectly be applied based on items that are in the inventory. + GL11.glDisable(GL11.GL_LIGHTING); + this.drawGuiContainerForegroundLayer(mouseX, mouseY); + GL11.glEnable(GL11.GL_LIGHTING); + InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory; + ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack; + + if (itemstack != null) + { + byte b0 = 8; + k1 = this.draggedStack == null ? 8 : 16; + String s = null; + + if (this.draggedStack != null && this.isRightMouseClick) + { + itemstack = itemstack.copy(); + itemstack.stackSize = MathHelper.ceiling_float_int((float)itemstack.stackSize / 2.0F); + } + else if (this.field_147007_t && this.field_147008_s.size() > 1) + { + itemstack = itemstack.copy(); + itemstack.stackSize = this.field_146996_I; + + if (itemstack.stackSize == 0) + { + s = "" + EnumChatFormatting.YELLOW + "0"; + } + } + + this.drawItemStack(itemstack, mouseX - k - b0, mouseY - l - k1, s); + } + + if (this.returningStack != null) + { + float f1 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; + + if (f1 >= 1.0F) + { + f1 = 1.0F; + this.returningStack = null; + } + + k1 = this.returningStackDestSlot.xDisplayPosition - this.field_147011_y; + int j2 = this.returningStackDestSlot.yDisplayPosition - this.field_147010_z; + int l1 = this.field_147011_y + (int)((float)k1 * f1); + int i2 = this.field_147010_z + (int)((float)j2 * f1); + this.drawItemStack(this.returningStack, l1, i2, (String)null); + } + + GL11.glPopMatrix(); + + if (inventoryplayer.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) + { + ItemStack itemstack1 = this.theSlot.getStack(); + this.renderToolTip(itemstack1, mouseX, mouseY); + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + + private void drawItemStack(ItemStack stack, int x, int y, String altText) + { + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + this.zLevel = 200.0F; + itemRender.zLevel = 200.0F; + FontRenderer font = null; + if (stack != null) font = stack.getItem().getFontRenderer(stack); + if (font == null) font = fontRendererObj; + itemRender.renderItemAndEffectIntoGUI(font, this.mc.getTextureManager(), stack, x, y); + itemRender.renderItemOverlayIntoGUI(font, this.mc.getTextureManager(), stack, x, y - (this.draggedStack == null ? 0 : 8), altText); + this.zLevel = 0.0F; + itemRender.zLevel = 0.0F; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {} + + protected abstract void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY); + + private void func_146977_a(Slot slotIn) + { + int i = slotIn.xDisplayPosition; + int j = slotIn.yDisplayPosition; + ItemStack itemstack = slotIn.getStack(); + boolean flag = false; + boolean flag1 = slotIn == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; + ItemStack itemstack1 = this.mc.thePlayer.inventory.getItemStack(); + String s = null; + + if (slotIn == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && itemstack != null) + { + itemstack = itemstack.copy(); + itemstack.stackSize /= 2; + } + else if (this.field_147007_t && this.field_147008_s.contains(slotIn) && itemstack1 != null) + { + if (this.field_147008_s.size() == 1) + { + return; + } + + if (Container.func_94527_a(slotIn, itemstack1, true) && this.inventorySlots.canDragIntoSlot(slotIn)) + { + itemstack = itemstack1.copy(); + flag = true; + Container.func_94525_a(this.field_147008_s, this.field_146987_F, itemstack, slotIn.getStack() == null ? 0 : slotIn.getStack().stackSize); + + if (itemstack.stackSize > itemstack.getMaxStackSize()) + { + s = EnumChatFormatting.YELLOW + "" + itemstack.getMaxStackSize(); + itemstack.stackSize = itemstack.getMaxStackSize(); + } + + if (itemstack.stackSize > slotIn.getSlotStackLimit()) + { + s = EnumChatFormatting.YELLOW + "" + slotIn.getSlotStackLimit(); + itemstack.stackSize = slotIn.getSlotStackLimit(); + } + } + else + { + this.field_147008_s.remove(slotIn); + this.func_146980_g(); + } + } + + this.zLevel = 100.0F; + itemRender.zLevel = 100.0F; + + if (itemstack == null) + { + IIcon iicon = slotIn.getBackgroundIconIndex(); + + if (iicon != null) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this. + this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); + this.drawTexturedModelRectFromIcon(i, j, iicon, 16, 16); + GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up + GL11.glEnable(GL11.GL_LIGHTING); + flag1 = true; + } + } + + if (!flag1) + { + if (flag) + { + drawRect(i, j, i + 16, j + 16, -2130706433); + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, i, j); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, i, j, s); + } + + itemRender.zLevel = 0.0F; + this.zLevel = 0.0F; + } + + private void func_146980_g() + { + ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + + if (itemstack != null && this.field_147007_t) + { + this.field_146996_I = itemstack.stackSize; + ItemStack itemstack1; + int i; + + for (Iterator iterator = this.field_147008_s.iterator(); iterator.hasNext(); this.field_146996_I -= itemstack1.stackSize - i) + { + Slot slot = (Slot)iterator.next(); + itemstack1 = itemstack.copy(); + i = slot.getStack() == null ? 0 : slot.getStack().stackSize; + Container.func_94525_a(this.field_147008_s, this.field_146987_F, itemstack1, i); + + if (itemstack1.stackSize > itemstack1.getMaxStackSize()) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + + if (itemstack1.stackSize > slot.getSlotStackLimit()) + { + itemstack1.stackSize = slot.getSlotStackLimit(); + } + } + } + } + + /** + * Returns the slot at the given coordinates or null if there is none. + */ + private Slot getSlotAtPosition(int x, int y) + { + for (int k = 0; k < this.inventorySlots.inventorySlots.size(); ++k) + { + Slot slot = (Slot)this.inventorySlots.inventorySlots.get(k); + + if (this.isMouseOverSlot(slot, x, y)) + { + return slot; + } + } + + return null; + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + super.mouseClicked(mouseX, mouseY, mouseButton); + boolean flag = mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100; + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + long l = Minecraft.getSystemTime(); + this.field_146993_M = this.field_146998_K == slot && l - this.field_146997_J < 250L && this.field_146992_L == mouseButton; + this.field_146995_H = false; + + if (mouseButton == 0 || mouseButton == 1 || flag) + { + int i1 = this.guiLeft; + int j1 = this.guiTop; + boolean flag1 = mouseX < i1 || mouseY < j1 || mouseX >= i1 + this.xSize || mouseY >= j1 + this.ySize; + int k1 = -1; + + if (slot != null) + { + k1 = slot.slotNumber; + } + + if (flag1) + { + k1 = -999; + } + + if (this.mc.gameSettings.touchscreen && flag1 && this.mc.thePlayer.inventory.getItemStack() == null) + { + this.mc.displayGuiScreen((GuiScreen)null); + return; + } + + if (k1 != -1) + { + if (this.mc.gameSettings.touchscreen) + { + if (slot != null && slot.getHasStack()) + { + this.clickedSlot = slot; + this.draggedStack = null; + this.isRightMouseClick = mouseButton == 1; + } + else + { + this.clickedSlot = null; + } + } + else if (!this.field_147007_t) + { + if (this.mc.thePlayer.inventory.getItemStack() == null) + { + if (mouseButton == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) + { + this.handleMouseClick(slot, k1, mouseButton, 3); + } + else + { + boolean flag2 = k1 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + byte b0 = 0; + + if (flag2) + { + this.field_146994_N = slot != null && slot.getHasStack() ? slot.getStack() : null; + b0 = 1; + } + else if (k1 == -999) + { + b0 = 4; + } + + this.handleMouseClick(slot, k1, mouseButton, b0); + } + + this.field_146995_H = true; + } + else + { + this.field_147007_t = true; + this.field_146988_G = mouseButton; + this.field_147008_s.clear(); + + if (mouseButton == 0) + { + this.field_146987_F = 0; + } + else if (mouseButton == 1) + { + this.field_146987_F = 1; + } + } + } + } + } + + this.field_146998_K = slot; + this.field_146997_J = l; + this.field_146992_L = mouseButton; + } + + /** + * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, + * lastButtonClicked & timeSinceMouseClick. + */ + protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) + { + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + ItemStack itemstack = this.mc.thePlayer.inventory.getItemStack(); + + if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) + { + if (clickedMouseButton == 0 || clickedMouseButton == 1) + { + if (this.draggedStack == null) + { + if (slot != this.clickedSlot) + { + this.draggedStack = this.clickedSlot.getStack().copy(); + } + } + else if (this.draggedStack.stackSize > 1 && slot != null && Container.func_94527_a(slot, this.draggedStack, false)) + { + long i1 = Minecraft.getSystemTime(); + + if (this.field_146985_D == slot) + { + if (i1 - this.field_146986_E > 500L) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); + this.handleMouseClick(slot, slot.slotNumber, 1, 0); + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); + this.field_146986_E = i1 + 750L; + --this.draggedStack.stackSize; + } + } + else + { + this.field_146985_D = slot; + this.field_146986_E = i1; + } + } + } + } + else if (this.field_147007_t && slot != null && itemstack != null && itemstack.stackSize > this.field_147008_s.size() && Container.func_94527_a(slot, itemstack, true) && slot.isItemValid(itemstack) && this.inventorySlots.canDragIntoSlot(slot)) + { + this.field_147008_s.add(slot); + this.func_146980_g(); + } + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + super.mouseMovedOrUp(mouseX, mouseY, state); //Forge, Call parent to release buttons + Slot slot = this.getSlotAtPosition(mouseX, mouseY); + int l = this.guiLeft; + int i1 = this.guiTop; + boolean flag = mouseX < l || mouseY < i1 || mouseX >= l + this.xSize || mouseY >= i1 + this.ySize; + int j1 = -1; + + if (slot != null) + { + j1 = slot.slotNumber; + } + + if (flag) + { + j1 = -999; + } + + Slot slot1; + Iterator iterator; + + if (this.field_146993_M && slot != null && state == 0 && this.inventorySlots.func_94530_a((ItemStack)null, slot)) + { + if (isShiftKeyDown()) + { + if (slot != null && slot.inventory != null && this.field_146994_N != null) + { + iterator = this.inventorySlots.inventorySlots.iterator(); + + while (iterator.hasNext()) + { + slot1 = (Slot)iterator.next(); + + if (slot1 != null && slot1.canTakeStack(this.mc.thePlayer) && slot1.getHasStack() && slot1.inventory == slot.inventory && Container.func_94527_a(slot1, this.field_146994_N, true)) + { + this.handleMouseClick(slot1, slot1.slotNumber, state, 1); + } + } + } + } + else + { + this.handleMouseClick(slot, j1, state, 6); + } + + this.field_146993_M = false; + this.field_146997_J = 0L; + } + else + { + if (this.field_147007_t && this.field_146988_G != state) + { + this.field_147007_t = false; + this.field_147008_s.clear(); + this.field_146995_H = true; + return; + } + + if (this.field_146995_H) + { + this.field_146995_H = false; + return; + } + + boolean flag1; + + if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) + { + if (state == 0 || state == 1) + { + if (this.draggedStack == null && slot != this.clickedSlot) + { + this.draggedStack = this.clickedSlot.getStack(); + } + + flag1 = Container.func_94527_a(slot, this.draggedStack, false); + + if (j1 != -1 && this.draggedStack != null && flag1) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, state, 0); + this.handleMouseClick(slot, j1, 0, 0); + + if (this.mc.thePlayer.inventory.getItemStack() != null) + { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, state, 0); + this.field_147011_y = mouseX - l; + this.field_147010_z = mouseY - i1; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); + } + else + { + this.returningStack = null; + } + } + else if (this.draggedStack != null) + { + this.field_147011_y = mouseX - l; + this.field_147010_z = mouseY - i1; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); + } + + this.draggedStack = null; + this.clickedSlot = null; + } + } + else if (this.field_147007_t && !this.field_147008_s.isEmpty()) + { + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(0, this.field_146987_F), 5); + iterator = this.field_147008_s.iterator(); + + while (iterator.hasNext()) + { + slot1 = (Slot)iterator.next(); + this.handleMouseClick(slot1, slot1.slotNumber, Container.func_94534_d(1, this.field_146987_F), 5); + } + + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(2, this.field_146987_F), 5); + } + else if (this.mc.thePlayer.inventory.getItemStack() != null) + { + if (state == this.mc.gameSettings.keyBindPickBlock.getKeyCode() + 100) + { + this.handleMouseClick(slot, j1, state, 3); + } + else + { + flag1 = j1 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); + + if (flag1) + { + this.field_146994_N = slot != null && slot.getHasStack() ? slot.getStack() : null; + } + + this.handleMouseClick(slot, j1, state, flag1 ? 1 : 0); + } + } + } + + if (this.mc.thePlayer.inventory.getItemStack() == null) + { + this.field_146997_J = 0L; + } + + this.field_147007_t = false; + } + + /** + * Returns if the passed mouse position is over the specified slot. + */ + private boolean isMouseOverSlot(Slot slotIn, int mouseX, int mouseY) + { + return this.func_146978_c(slotIn.xDisplayPosition, slotIn.yDisplayPosition, 16, 16, mouseX, mouseY); + } + + protected boolean func_146978_c(int left, int top, int right, int bottom, int pointX, int pointY) + { + int k1 = this.guiLeft; + int l1 = this.guiTop; + pointX -= k1; + pointY -= l1; + return pointX >= left - 1 && pointX < left + right + 1 && pointY >= top - 1 && pointY < top + bottom + 1; + } + + protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) + { + if (slotIn != null) + { + slotId = slotIn.slotNumber; + } + + this.mc.playerController.windowClick(this.inventorySlots.windowId, slotId, clickedButton, clickType, this.mc.thePlayer); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == 1 || keyCode == this.mc.gameSettings.keyBindInventory.getKeyCode()) + { + this.mc.thePlayer.closeScreen(); + } + + this.checkHotbarKeys(keyCode); + + if (this.theSlot != null && this.theSlot.getHasStack()) + { + if (keyCode == this.mc.gameSettings.keyBindPickBlock.getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3); + } + else if (keyCode == this.mc.gameSettings.keyBindDrop.getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); + } + } + } + + /** + * This function is what controls the hotbar shortcut check when you press a number key when hovering a stack. + */ + protected boolean checkHotbarKeys(int keyCode) + { + if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) + { + for (int j = 0; j < 9; ++j) + { + if (keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode()) + { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, j, 2); + return true; + } + } + } + + return false; + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + if (this.mc.thePlayer != null) + { + this.inventorySlots.onContainerClosed(this.mc.thePlayer); + } + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return false; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + super.updateScreen(); + + if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) + { + this.mc.thePlayer.closeScreen(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java new file mode 100644 index 0000000..6eff825 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiContainerCreative.java @@ -0,0 +1,1198 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiContainerCreative extends InventoryEffectRenderer +{ + private static final ResourceLocation field_147061_u = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + private static InventoryBasic field_147060_v = new InventoryBasic("tmp", true, 45); + /** Currently selected creative inventory tab index. */ + private static int selectedTabIndex = CreativeTabs.tabBlock.getTabIndex(); + /** Amount scrolled in Creative mode inventory (0 = top, 1 = bottom) */ + private float currentScroll; + /** True if the scrollbar is being dragged */ + private boolean isScrolling; + /** True if the left mouse button was held down last time drawScreen was called. */ + private boolean wasClicking; + private GuiTextField searchField; + private List field_147063_B; + private Slot field_147064_C; + private boolean field_147057_D; + private CreativeCrafting field_147059_E; + private static final String __OBFID = "CL_00000752"; + private static int tabPage = 0; + private int maxPages = 0; + + public GuiContainerCreative(EntityPlayer p_i1088_1_) + { + super(new GuiContainerCreative.ContainerCreative(p_i1088_1_)); + p_i1088_1_.openContainer = this.inventorySlots; + this.allowUserInput = true; + this.ySize = 136; + this.xSize = 195; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + if (!this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + } + + protected void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) + { + this.field_147057_D = true; + boolean flag = clickType == 1; + clickType = slotId == -999 && clickType == 0 ? 4 : clickType; + ItemStack itemstack1; + InventoryPlayer inventoryplayer; + + if (slotIn == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && clickType != 5) + { + inventoryplayer = this.mc.thePlayer.inventory; + + if (inventoryplayer.getItemStack() != null) + { + if (clickedButton == 0) + { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(inventoryplayer.getItemStack()); + inventoryplayer.setItemStack((ItemStack)null); + } + + if (clickedButton == 1) + { + itemstack1 = inventoryplayer.getItemStack().splitStack(1); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack1, true); + this.mc.playerController.sendPacketDropItem(itemstack1); + + if (inventoryplayer.getItemStack().stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + } + } + else + { + int l; + + if (slotIn == this.field_147064_C && flag) + { + for (l = 0; l < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++l) + { + this.mc.playerController.sendSlotPacket((ItemStack)null, l); + } + } + else + { + ItemStack itemstack; + + if (selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) + { + if (slotIn == this.field_147064_C) + { + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); + } + else if (clickType == 4 && slotIn != null && slotIn.getHasStack()) + { + itemstack = slotIn.decrStackSize(clickedButton == 0 ? 1 : slotIn.getStack().getMaxStackSize()); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack, true); + this.mc.playerController.sendPacketDropItem(itemstack); + } + else if (clickType == 4 && this.mc.thePlayer.inventory.getItemStack() != null) + { + this.mc.thePlayer.dropPlayerItemWithRandomChoice(this.mc.thePlayer.inventory.getItemStack(), true); + this.mc.playerController.sendPacketDropItem(this.mc.thePlayer.inventory.getItemStack()); + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); + } + else + { + this.mc.thePlayer.inventoryContainer.slotClick(slotIn == null ? slotId : ((GuiContainerCreative.CreativeSlot)slotIn).field_148332_b.slotNumber, clickedButton, clickType, this.mc.thePlayer); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + } + else if (clickType != 5 && slotIn.inventory == field_147060_v) + { + inventoryplayer = this.mc.thePlayer.inventory; + itemstack1 = inventoryplayer.getItemStack(); + ItemStack itemstack2 = slotIn.getStack(); + ItemStack itemstack3; + + if (clickType == 2) + { + if (itemstack2 != null && clickedButton >= 0 && clickedButton < 9) + { + itemstack3 = itemstack2.copy(); + itemstack3.stackSize = itemstack3.getMaxStackSize(); + this.mc.thePlayer.inventory.setInventorySlotContents(clickedButton, itemstack3); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + + return; + } + + if (clickType == 3) + { + if (inventoryplayer.getItemStack() == null && slotIn.getHasStack()) + { + itemstack3 = slotIn.getStack().copy(); + itemstack3.stackSize = itemstack3.getMaxStackSize(); + inventoryplayer.setItemStack(itemstack3); + } + + return; + } + + if (clickType == 4) + { + if (itemstack2 != null) + { + itemstack3 = itemstack2.copy(); + itemstack3.stackSize = clickedButton == 0 ? 1 : itemstack3.getMaxStackSize(); + this.mc.thePlayer.dropPlayerItemWithRandomChoice(itemstack3, true); + this.mc.playerController.sendPacketDropItem(itemstack3); + } + + return; + } + + if (itemstack1 != null && itemstack2 != null && itemstack1.isItemEqual(itemstack2) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 + { + if (clickedButton == 0) + { + if (flag) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + else if (itemstack1.stackSize < itemstack1.getMaxStackSize()) + { + ++itemstack1.stackSize; + } + } + else if (itemstack1.stackSize <= 1) + { + inventoryplayer.setItemStack((ItemStack)null); + } + else + { + --itemstack1.stackSize; + } + } + else if (itemstack2 != null && itemstack1 == null) + { + inventoryplayer.setItemStack(ItemStack.copyItemStack(itemstack2)); + itemstack1 = inventoryplayer.getItemStack(); + + if (flag) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + } + else + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + else + { + this.inventorySlots.slotClick(slotIn == null ? slotId : slotIn.slotNumber, clickedButton, clickType, this.mc.thePlayer); + + if (Container.func_94532_c(clickedButton) == 2) + { + for (l = 0; l < 9; ++l) + { + this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + l).getStack(), 36 + l); + } + } + else if (slotIn != null) + { + itemstack = this.inventorySlots.getSlot(slotIn.slotNumber).getStack(); + this.mc.playerController.sendSlotPacket(itemstack, slotIn.slotNumber - this.inventorySlots.inventorySlots.size() + 9 + 36); + } + } + } + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + if (this.mc.playerController.isInCreativeMode()) + { + super.initGui(); + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.searchField = new GuiTextField(this.fontRendererObj, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRendererObj.FONT_HEIGHT); + this.searchField.setMaxStringLength(15); + this.searchField.setEnableBackgroundDrawing(false); + this.searchField.setVisible(false); + this.searchField.setTextColor(16777215); + int i = selectedTabIndex; + selectedTabIndex = -1; + this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[i]); + this.field_147059_E = new CreativeCrafting(this.mc); + this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_147059_E); + int tabCount = CreativeTabs.creativeTabArray.length; + if (tabCount > 12) + { + buttonList.add(new GuiButton(101, guiLeft, guiTop - 50, 20, 20, "<")); + buttonList.add(new GuiButton(102, guiLeft + xSize - 20, guiTop - 50, 20, 20, ">")); + maxPages = ((tabCount - 12) / 10) + 1; + } + } + else + { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + super.onGuiClosed(); + + if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) + { + this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_147059_E); + } + + Keyboard.enableRepeatEvents(false); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (!CreativeTabs.creativeTabArray[selectedTabIndex].hasSearchBar()) + { + if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) + { + this.setCurrentCreativeTab(CreativeTabs.tabAllSearch); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + else + { + if (this.field_147057_D) + { + this.field_147057_D = false; + this.searchField.setText(""); + } + + if (!this.checkHotbarKeys(keyCode)) + { + if (this.searchField.textboxKeyTyped(typedChar, keyCode)) + { + this.updateCreativeSearch(); + } + else + { + super.keyTyped(typedChar, keyCode); + } + } + } + } + + private void updateCreativeSearch() + { + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + containercreative.itemList.clear(); + + CreativeTabs tab = CreativeTabs.creativeTabArray[selectedTabIndex]; + if (tab.hasSearchBar() && tab != CreativeTabs.tabAllSearch) + { + tab.displayAllReleventItems(containercreative.itemList); + updateFilteredItems(containercreative); + return; + } + + Iterator iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item != null && item.getCreativeTab() != null) + { + item.getSubItems(item, (CreativeTabs)null, containercreative.itemList); + } + } + updateFilteredItems(containercreative); + } + + //split from above for custom search tabs + private void updateFilteredItems(GuiContainerCreative.ContainerCreative containercreative) + { + Iterator iterator; + Enchantment[] aenchantment = Enchantment.enchantmentsList; + int j = aenchantment.length; + + if (CreativeTabs.creativeTabArray[selectedTabIndex] != CreativeTabs.tabAllSearch) j = 0; //Forge: Don't add enchants to custom tabs. + for (int i = 0; i < j; ++i) + { + Enchantment enchantment = aenchantment[i]; + + if (enchantment != null && enchantment.type != null) + { + Items.enchanted_book.func_92113_a(enchantment, containercreative.itemList); + } + } + + iterator = containercreative.itemList.iterator(); + String s1 = this.searchField.getText().toLowerCase(); + + while (iterator.hasNext()) + { + ItemStack itemstack = (ItemStack)iterator.next(); + boolean flag = false; + Iterator iterator1 = itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); + + while (true) + { + if (iterator1.hasNext()) + { + String s = (String)iterator1.next(); + + if (!s.toLowerCase().contains(s1)) + { + continue; + } + + flag = true; + } + + if (!flag) + { + iterator.remove(); + } + + break; + } + } + + this.currentScroll = 0.0F; + containercreative.scrollTo(0.0F); + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + + if (creativetabs != null && creativetabs.drawInForegroundOfTab()) + { + GL11.glDisable(GL11.GL_BLEND); + this.fontRendererObj.drawString(I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0]), 8, 6, 4210752); + } + } + + /** + * Called when the mouse is clicked. + */ + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) + { + if (mouseButton == 0) + { + int l = mouseX - this.guiLeft; + int i1 = mouseY - this.guiTop; + CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + int j1 = acreativetabs.length; + + for (int k1 = 0; k1 < j1; ++k1) + { + CreativeTabs creativetabs = acreativetabs[k1]; + + if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) + { + return; + } + } + } + + super.mouseClicked(mouseX, mouseY, mouseButton); + } + + /** + * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is + * mouseMove, which==0 or which==1 is mouseUp + */ + protected void mouseMovedOrUp(int mouseX, int mouseY, int state) + { + if (state == 0) + { + int l = mouseX - this.guiLeft; + int i1 = mouseY - this.guiTop; + CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + int j1 = acreativetabs.length; + + for (int k1 = 0; k1 < j1; ++k1) + { + CreativeTabs creativetabs = acreativetabs[k1]; + + if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) + { + this.setCurrentCreativeTab(creativetabs); + return; + } + } + } + + super.mouseMovedOrUp(mouseX, mouseY, state); + } + + /** + * returns (if you are not on the inventoryTab) and (the flag isn't set) and (you have more than 1 page of items) + */ + private boolean needsScrollBars() + { + if (CreativeTabs.creativeTabArray[selectedTabIndex] == null) return false; + return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((GuiContainerCreative.ContainerCreative)this.inventorySlots).func_148328_e(); + } + + private void setCurrentCreativeTab(CreativeTabs p_147050_1_) + { + if (p_147050_1_ == null) return; + int i = selectedTabIndex; + selectedTabIndex = p_147050_1_.getTabIndex(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.inventorySlots; + this.field_147008_s.clear(); + containercreative.itemList.clear(); + p_147050_1_.displayAllReleventItems(containercreative.itemList); + + if (p_147050_1_ == CreativeTabs.tabInventory) + { + Container container = this.mc.thePlayer.inventoryContainer; + + if (this.field_147063_B == null) + { + this.field_147063_B = containercreative.inventorySlots; + } + + containercreative.inventorySlots = new ArrayList(); + + for (int j = 0; j < container.inventorySlots.size(); ++j) + { + GuiContainerCreative.CreativeSlot creativeslot = new GuiContainerCreative.CreativeSlot((Slot)container.inventorySlots.get(j), j); + containercreative.inventorySlots.add(creativeslot); + int k; + int l; + int i1; + + if (j >= 5 && j < 9) + { + k = j - 5; + l = k / 2; + i1 = k % 2; + creativeslot.xDisplayPosition = 9 + l * 54; + creativeslot.yDisplayPosition = 6 + i1 * 27; + } + else if (j >= 0 && j < 5) + { + creativeslot.yDisplayPosition = -2000; + creativeslot.xDisplayPosition = -2000; + } + else if (j < container.inventorySlots.size()) + { + k = j - 9; + l = k % 9; + i1 = k / 9; + creativeslot.xDisplayPosition = 9 + l * 18; + + if (j >= 36) + { + creativeslot.yDisplayPosition = 112; + } + else + { + creativeslot.yDisplayPosition = 54 + i1 * 18; + } + } + } + + this.field_147064_C = new Slot(field_147060_v, 0, 173, 112); + containercreative.inventorySlots.add(this.field_147064_C); + } + else if (i == CreativeTabs.tabInventory.getTabIndex()) + { + containercreative.inventorySlots = this.field_147063_B; + this.field_147063_B = null; + } + + if (this.searchField != null) + { + if (p_147050_1_.hasSearchBar()) + { + this.searchField.setVisible(true); + this.searchField.setCanLoseFocus(false); + this.searchField.setFocused(true); + this.searchField.setText(""); + this.searchField.width = p_147050_1_.getSearchbarWidth(); + this.searchField.xPosition = this.guiLeft + (82 /*default left*/ + 89 /*default width*/) - this.searchField.width; + this.updateCreativeSearch(); + } + else + { + this.searchField.setVisible(false); + this.searchField.setCanLoseFocus(true); + this.searchField.setFocused(false); + } + } + + this.currentScroll = 0.0F; + containercreative.scrollTo(0.0F); + } + + /** + * Handles mouse input. + */ + public void handleMouseInput() + { + super.handleMouseInput(); + int i = Mouse.getEventDWheel(); + + if (i != 0 && this.needsScrollBars()) + { + int j = ((GuiContainerCreative.ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5 + 1; + + if (i > 0) + { + i = 1; + } + + if (i < 0) + { + i = -1; + } + + this.currentScroll = (float)((double)this.currentScroll - (double)i / (double)j); + + if (this.currentScroll < 0.0F) + { + this.currentScroll = 0.0F; + } + + if (this.currentScroll > 1.0F) + { + this.currentScroll = 1.0F; + } + + ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + boolean flag = Mouse.isButtonDown(0); + int k = this.guiLeft; + int l = this.guiTop; + int i1 = k + 175; + int j1 = l + 18; + int k1 = i1 + 14; + int l1 = j1 + 112; + + if (!this.wasClicking && flag && mouseX >= i1 && mouseY >= j1 && mouseX < k1 && mouseY < l1) + { + this.isScrolling = this.needsScrollBars(); + } + + if (!flag) + { + this.isScrolling = false; + } + + this.wasClicking = flag; + + if (this.isScrolling) + { + this.currentScroll = ((float)(mouseY - j1) - 7.5F) / ((float)(l1 - j1) - 15.0F); + + if (this.currentScroll < 0.0F) + { + this.currentScroll = 0.0F; + } + + if (this.currentScroll > 1.0F) + { + this.currentScroll = 1.0F; + } + + ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + int start = tabPage * 10; + int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2); + if (tabPage != 0) start += 2; + boolean rendered = false; + + for (int j2 = start; j2 < i2; ++j2) + { + CreativeTabs creativetabs = acreativetabs[j2]; + + if (creativetabs == null) continue; + if (this.renderCreativeInventoryHoveringText(creativetabs, mouseX, mouseY)) + { + rendered = true; + break; + } + } + + if (!rendered && renderCreativeInventoryHoveringText(CreativeTabs.tabAllSearch, mouseX, mouseY)) + { + renderCreativeInventoryHoveringText(CreativeTabs.tabInventory, mouseX, mouseY); + } + + if (this.field_147064_C != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.func_146978_c(this.field_147064_C.xDisplayPosition, this.field_147064_C.yDisplayPosition, 16, 16, mouseX, mouseY)) + { + this.drawCreativeTabHoveringText(I18n.format("inventory.binSlot", new Object[0]), mouseX, mouseY); + } + + if (maxPages != 0) + { + String page = String.format("%d / %d", tabPage + 1, maxPages + 1); + int width = fontRendererObj.getStringWidth(page); + GL11.glDisable(GL11.GL_LIGHTING); + this.zLevel = 300.0F; + itemRender.zLevel = 300.0F; + fontRendererObj.drawString(page, guiLeft + (xSize / 2) - (width / 2), guiTop - 44, -1); + this.zLevel = 0.0F; + itemRender.zLevel = 0.0F; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + } + + protected void renderToolTip(ItemStack itemIn, int x, int y) + { + if (selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) + { + List list = itemIn.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + CreativeTabs creativetabs = itemIn.getItem().getCreativeTab(); + + if (creativetabs == null && itemIn.getItem() == Items.enchanted_book) + { + Map map = EnchantmentHelper.getEnchantments(itemIn); + + if (map.size() == 1) + { + Enchantment enchantment = Enchantment.enchantmentsList[((Integer)map.keySet().iterator().next()).intValue()]; + CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + int k = acreativetabs.length; + + for (int l = 0; l < k; ++l) + { + CreativeTabs creativetabs1 = acreativetabs[l]; + + if (creativetabs1.func_111226_a(enchantment.type)) + { + creativetabs = creativetabs1; + break; + } + } + } + } + + if (creativetabs != null) + { + list.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.format(creativetabs.getTranslatedTabLabel(), new Object[0])); + } + + for (int i1 = 0; i1 < list.size(); ++i1) + { + if (i1 == 0) + { + list.set(i1, itemIn.getRarity().rarityColor + (String)list.get(i1)); + } + else + { + list.set(i1, EnumChatFormatting.GRAY + (String)list.get(i1)); + } + } + + this.func_146283_a(list, x, y); + } + else + { + super.renderToolTip(itemIn, x, y); + } + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.enableGUIStandardItemLighting(); + CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex]; + CreativeTabs[] acreativetabs = CreativeTabs.creativeTabArray; + int k = acreativetabs.length; + int l; + + int start = tabPage * 10; + k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2)); + if (tabPage != 0) start += 2; + + for (l = start; l < k; ++l) + { + CreativeTabs creativetabs1 = acreativetabs[l]; + this.mc.getTextureManager().bindTexture(field_147061_u); + + if (creativetabs1 == null) continue; + + if (creativetabs1.getTabIndex() != selectedTabIndex) + { + this.func_147051_a(creativetabs1); + } + } + + if (tabPage != 0) + { + if (creativetabs != CreativeTabs.tabAllSearch) + { + this.mc.getTextureManager().bindTexture(field_147061_u); + func_147051_a(CreativeTabs.tabAllSearch); + } + if (creativetabs != CreativeTabs.tabInventory) + { + this.mc.getTextureManager().bindTexture(field_147061_u); + func_147051_a(CreativeTabs.tabInventory); + } + } + + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.getBackgroundImageName())); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); + this.searchField.drawTextBox(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int i1 = this.guiLeft + 175; + k = this.guiTop + 18; + l = k + 112; + this.mc.getTextureManager().bindTexture(field_147061_u); + + if (creativetabs.shouldHidePlayerInventory()) + { + this.drawTexturedModalRect(i1, k + (int)((float)(l - k - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); + } + + if (creativetabs == null || creativetabs.getTabPage() != tabPage) + { + if (creativetabs != CreativeTabs.tabAllSearch && creativetabs != CreativeTabs.tabInventory) + { + return; + } + } + + this.func_147051_a(creativetabs); + + if (creativetabs == CreativeTabs.tabInventory) + { + GuiInventory.func_147046_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - mouseX), (float)(this.guiTop + 45 - 30 - mouseY), this.mc.thePlayer); + } + } + + protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) + { + if (p_147049_1_.getTabPage() != tabPage) + { + if (p_147049_1_ != CreativeTabs.tabAllSearch && + p_147049_1_ != CreativeTabs.tabInventory) + { + return false; + } + } + + int k = p_147049_1_.getTabColumn(); + int l = 28 * k; + byte b0 = 0; + + if (k == 5) + { + l = this.xSize - 28 + 2; + } + else if (k > 0) + { + l += k; + } + + int i1; + + if (p_147049_1_.isTabInFirstRow()) + { + i1 = b0 - 32; + } + else + { + i1 = b0 + this.ySize; + } + + return p_147049_2_ >= l && p_147049_2_ <= l + 28 && p_147049_3_ >= i1 && p_147049_3_ <= i1 + 32; + } + + /** + * Renders the creative inventory hovering text if mouse is over it. Returns true if did render or false otherwise. + * Params: current creative tab to be checked, current mouse x position, current mouse y position. + */ + protected boolean renderCreativeInventoryHoveringText(CreativeTabs p_147052_1_, int p_147052_2_, int p_147052_3_) + { + int k = p_147052_1_.getTabColumn(); + int l = 28 * k; + byte b0 = 0; + + if (k == 5) + { + l = this.xSize - 28 + 2; + } + else if (k > 0) + { + l += k; + } + + int i1; + + if (p_147052_1_.isTabInFirstRow()) + { + i1 = b0 - 32; + } + else + { + i1 = b0 + this.ySize; + } + + if (this.func_146978_c(l + 3, i1 + 3, 23, 27, p_147052_2_, p_147052_3_)) + { + this.drawCreativeTabHoveringText(I18n.format(p_147052_1_.getTranslatedTabLabel(), new Object[0]), p_147052_2_, p_147052_3_); + return true; + } + else + { + return false; + } + } + + protected void func_147051_a(CreativeTabs p_147051_1_) + { + boolean flag = p_147051_1_.getTabIndex() == selectedTabIndex; + boolean flag1 = p_147051_1_.isTabInFirstRow(); + int i = p_147051_1_.getTabColumn(); + int j = i * 28; + int k = 0; + int l = this.guiLeft + 28 * i; + int i1 = this.guiTop; + byte b0 = 32; + + if (flag) + { + k += 32; + } + + if (i == 5) + { + l = this.guiLeft + this.xSize - 28; + } + else if (i > 0) + { + l += i; + } + + if (flag1) + { + i1 -= 28; + } + else + { + k += 64; + i1 += this.ySize - 4; + } + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. + GL11.glEnable(GL11.GL_BLEND); //Forge: Make sure blend is enabled else tabs show a white border. + this.drawTexturedModalRect(l, i1, j, k, 28, b0); + this.zLevel = 100.0F; + itemRender.zLevel = 100.0F; + l += 6; + i1 += 8 + (flag1 ? 1 : -1); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + ItemStack itemstack = p_147051_1_.getIconItemStack(); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, l, i1); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, l, i1); + GL11.glDisable(GL11.GL_LIGHTING); + itemRender.zLevel = 0.0F; + this.zLevel = 0.0F; + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (button.id == 1) + { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (button.id == 101) + { + tabPage = Math.max(tabPage - 1, 0); + } + else if (button.id == 102) + { + tabPage = Math.min(tabPage + 1, maxPages); + } + } + + public int func_147056_g() + { + return selectedTabIndex; + } + + @SideOnly(Side.CLIENT) + static class ContainerCreative extends Container + { + /** the list of items in this container */ + public List itemList = new ArrayList(); + private static final String __OBFID = "CL_00000753"; + + public ContainerCreative(EntityPlayer p_i1086_1_) + { + InventoryPlayer inventoryplayer = p_i1086_1_.inventory; + int i; + + for (i = 0; i < 5; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(GuiContainerCreative.field_147060_v, i * 9 + j, 9 + j * 18, 18 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(inventoryplayer, i, 9 + i * 18, 112)); + } + + this.scrollTo(0.0F); + } + + public boolean canInteractWith(EntityPlayer player) + { + return true; + } + + /** + * Updates the gui slots ItemStack's based on scroll position. + */ + public void scrollTo(float p_148329_1_) + { + int i = this.itemList.size() / 9 - 5 + 1; + int j = (int)((double)(p_148329_1_ * (float)i) + 0.5D); + + if (j < 0) + { + j = 0; + } + + for (int k = 0; k < 5; ++k) + { + for (int l = 0; l < 9; ++l) + { + int i1 = l + (k + j) * 9; + + if (i1 >= 0 && i1 < this.itemList.size()) + { + GuiContainerCreative.field_147060_v.setInventorySlotContents(l + k * 9, (ItemStack)this.itemList.get(i1)); + } + else + { + GuiContainerCreative.field_147060_v.setInventorySlotContents(l + k * 9, (ItemStack)null); + } + } + } + } + + public boolean func_148328_e() + { + return this.itemList.size() > 45; + } + + protected void retrySlotClick(int p_75133_1_, int p_75133_2_, boolean p_75133_3_, EntityPlayer p_75133_4_) {} + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does + * that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + if (index >= this.inventorySlots.size() - 9 && index < this.inventorySlots.size()) + { + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + slot.putStack((ItemStack)null); + } + } + + return null; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) + { + return p_94530_2_.yDisplayPosition > 90; + } + + /** + * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to + * check if the slot can be added to a list of Slots to split the held ItemStack across. + */ + public boolean canDragIntoSlot(Slot p_94531_1_) + { + return p_94531_1_.inventory instanceof InventoryPlayer || p_94531_1_.yDisplayPosition > 90 && p_94531_1_.xDisplayPosition <= 162; + } + } + + @SideOnly(Side.CLIENT) + class CreativeSlot extends Slot + { + private final Slot field_148332_b; + private static final String __OBFID = "CL_00000754"; + + public CreativeSlot(Slot p_i1087_2_, int p_i1087_3_) + { + super(p_i1087_2_.inventory, p_i1087_3_, 0, 0); + this.field_148332_b = p_i1087_2_; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + this.field_148332_b.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return this.field_148332_b.isItemValid(stack); + } + + /** + * Helper fnct to get the stack in the slot. + */ + public ItemStack getStack() + { + return this.field_148332_b.getStack(); + } + + /** + * Returns if this slot contains a stack. + */ + public boolean getHasStack() + { + return this.field_148332_b.getHasStack(); + } + + /** + * Helper method to put a stack in the slot. + */ + public void putStack(ItemStack p_75215_1_) + { + this.field_148332_b.putStack(p_75215_1_); + } + + /** + * Called when the stack in a Slot changes + */ + public void onSlotChanged() + { + this.field_148332_b.onSlotChanged(); + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the + * case of armor slots) + */ + public int getSlotStackLimit() + { + return this.field_148332_b.getSlotStackLimit(); + } + + /** + * Returns the icon index on items.png that is used as background image of the slot. + */ + public IIcon getBackgroundIconIndex() + { + return this.field_148332_b.getBackgroundIconIndex(); + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) + { + return this.field_148332_b.decrStackSize(p_75209_1_); + } + + /** + * returns true if this slot is in par2 of par1 + */ + public boolean isSlotInInventory(IInventory p_75217_1_, int p_75217_2_) + { + return this.field_148332_b.isSlotInInventory(p_75217_1_, p_75217_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiCrafting.java new file mode 100644 index 0000000..15890c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiCrafting.java @@ -0,0 +1,40 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiCrafting extends GuiContainer +{ + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); + private static final String __OBFID = "CL_00000750"; + + public GuiCrafting(InventoryPlayer p_i1084_1_, World p_i1084_2_, int p_i1084_3_, int p_i1084_4_, int p_i1084_5_) + { + super(new ContainerWorkbench(p_i1084_1_, p_i1084_2_, p_i1084_3_, p_i1084_4_, p_i1084_5_)); + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiDispenser.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiDispenser.java new file mode 100644 index 0000000..388e12f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiDispenser.java @@ -0,0 +1,43 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiDispenser extends GuiContainer +{ + private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); + public TileEntityDispenser tileDispenser; + private static final String __OBFID = "CL_00000765"; + + public GuiDispenser(InventoryPlayer p_i1098_1_, TileEntityDispenser p_i1098_2_) + { + super(new ContainerDispenser(p_i1098_1_, p_i1098_2_)); + this.tileDispenser = p_i1098_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.tileDispenser.hasCustomInventoryName() ? this.tileDispenser.getInventoryName() : I18n.format(this.tileDispenser.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(dispenserGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiEditSign.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiEditSign.java new file mode 100644 index 0000000..54e31b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiEditSign.java @@ -0,0 +1,168 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiEditSign extends GuiScreen +{ + /** Reference to the sign object. */ + private TileEntitySign tileSign; + /** Counts the number of screen updates. */ + private int updateCounter; + /** The index of the line that is being edited. */ + private int editLine; + /** "Done" button for the GUI. */ + private GuiButton doneBtn; + private static final String __OBFID = "CL_00000764"; + + public GuiEditSign(TileEntitySign p_i1097_1_) + { + this.tileSign = p_i1097_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, I18n.format("gui.done", new Object[0]))); + this.tileSign.setEditable(false); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + Keyboard.enableRepeatEvents(false); + NetHandlerPlayClient nethandlerplayclient = this.mc.getNetHandler(); + + if (nethandlerplayclient != null) + { + nethandlerplayclient.addToSendQueue(new C12PacketUpdateSign(this.tileSign.xCoord, this.tileSign.yCoord, this.tileSign.zCoord, this.tileSign.signText)); + } + + this.tileSign.setEditable(true); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + ++this.updateCounter; + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 0) + { + this.tileSign.markDirty(); + this.mc.displayGuiScreen((GuiScreen)null); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) + { + if (keyCode == 200) + { + this.editLine = this.editLine - 1 & 3; + } + + if (keyCode == 208 || keyCode == 28 || keyCode == 156) + { + this.editLine = this.editLine + 1 & 3; + } + + if (keyCode == 14 && this.tileSign.signText[this.editLine].length() > 0) + { + this.tileSign.signText[this.editLine] = this.tileSign.signText[this.editLine].substring(0, this.tileSign.signText[this.editLine].length() - 1); + } + + if (ChatAllowedCharacters.isAllowedCharacter(typedChar) && this.tileSign.signText[this.editLine].length() < 15) + { + this.tileSign.signText[this.editLine] = this.tileSign.signText[this.editLine] + typedChar; + } + + if (keyCode == 1) + { + this.actionPerformed(this.doneBtn); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("sign.edit", new Object[0]), this.width / 2, 40, 16777215); + GL11.glPushMatrix(); + GL11.glTranslatef((float)(this.width / 2), 0.0F, 50.0F); + float f1 = 93.75F; + GL11.glScalef(-f1, -f1, -f1); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + Block block = this.tileSign.getBlockType(); + + if (block == Blocks.standing_sign) + { + float f2 = (float)(this.tileSign.getBlockMetadata() * 360) / 16.0F; + GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } + else + { + int k = this.tileSign.getBlockMetadata(); + float f3 = 0.0F; + + if (k == 2) + { + f3 = 180.0F; + } + + if (k == 4) + { + f3 = 90.0F; + } + + if (k == 5) + { + f3 = -90.0F; + } + + GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } + + if (this.updateCounter / 6 % 2 == 0) + { + this.tileSign.lineBeingEdited = this.editLine; + } + + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.tileSign, -0.5D, -0.75D, -0.5D, 0.0F); + this.tileSign.lineBeingEdited = -1; + GL11.glPopMatrix(); + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiFurnace.java new file mode 100644 index 0000000..af22565 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiFurnace.java @@ -0,0 +1,51 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiFurnace extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); + private TileEntityFurnace tileFurnace; + private static final String __OBFID = "CL_00000758"; + + public GuiFurnace(InventoryPlayer p_i1091_1_, TileEntityFurnace p_i1091_2_) + { + super(new ContainerFurnace(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.tileFurnace.isBurning()) + { + int i1 = this.tileFurnace.getBurnTimeRemainingScaled(13); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); + i1 = this.tileFurnace.getCookProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiInventory.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiInventory.java new file mode 100644 index 0000000..ba43cf2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiInventory.java @@ -0,0 +1,138 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class GuiInventory extends InventoryEffectRenderer +{ + /** x size of the inventory window in pixels. Defined as float, passed as int */ + private float xSizeFloat; + /** y size of the inventory window in pixels. Defined as float, passed as int. */ + private float ySizeFloat; + private static final String __OBFID = "CL_00000761"; + + public GuiInventory(EntityPlayer p_i1094_1_) + { + super(p_i1094_1_.inventoryContainer); + this.allowUserInput = true; + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + if (this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + + if (this.mc.playerController.isInCreativeMode()) + { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + else + { + super.initGui(); + } + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 86, 16, 4210752); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + this.xSizeFloat = (float)mouseX; + this.ySizeFloat = (float)mouseY; + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147001_a); + int k = this.guiLeft; + int l = this.guiTop; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + func_147046_a(k + 51, l + 75, 30, (float)(k + 51) - this.xSizeFloat, (float)(l + 75 - 50) - this.ySizeFloat, this.mc.thePlayer); + } + + public static void func_147046_a(int p_147046_0_, int p_147046_1_, int p_147046_2_, float p_147046_3_, float p_147046_4_, EntityLivingBase p_147046_5_) + { + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147046_0_, (float)p_147046_1_, 50.0F); + GL11.glScalef((float)(-p_147046_2_), (float)p_147046_2_, (float)p_147046_2_); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + float f2 = p_147046_5_.renderYawOffset; + float f3 = p_147046_5_.rotationYaw; + float f4 = p_147046_5_.rotationPitch; + float f5 = p_147046_5_.prevRotationYawHead; + float f6 = p_147046_5_.rotationYawHead; + GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-((float)Math.atan((double)(p_147046_4_ / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); + p_147046_5_.renderYawOffset = (float)Math.atan((double)(p_147046_3_ / 40.0F)) * 20.0F; + p_147046_5_.rotationYaw = (float)Math.atan((double)(p_147046_3_ / 40.0F)) * 40.0F; + p_147046_5_.rotationPitch = -((float)Math.atan((double)(p_147046_4_ / 40.0F))) * 20.0F; + p_147046_5_.rotationYawHead = p_147046_5_.rotationYaw; + p_147046_5_.prevRotationYawHead = p_147046_5_.rotationYaw; + GL11.glTranslatef(0.0F, p_147046_5_.yOffset, 0.0F); + RenderManager.instance.playerViewY = 180.0F; + RenderManager.instance.renderEntityWithPosYaw(p_147046_5_, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); + p_147046_5_.renderYawOffset = f2; + p_147046_5_.rotationYaw = f3; + p_147046_5_.rotationPitch = f4; + p_147046_5_.prevRotationYawHead = f5; + p_147046_5_.rotationYawHead = f6; + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (button.id == 1) + { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java new file mode 100644 index 0000000..f1dc758 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/inventory/GuiScreenHorseInventory.java @@ -0,0 +1,71 @@ +package net.minecraft.client.gui.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GuiScreenHorseInventory extends GuiContainer +{ + private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); + private IInventory field_147030_v; + private IInventory field_147029_w; + private EntityHorse field_147034_x; + private float field_147033_y; + private float field_147032_z; + private static final String __OBFID = "CL_00000760"; + + public GuiScreenHorseInventory(IInventory p_i1093_1_, IInventory p_i1093_2_, EntityHorse p_i1093_3_) + { + super(new ContainerHorseInventory(p_i1093_1_, p_i1093_2_, p_i1093_3_)); + this.field_147030_v = p_i1093_1_; + this.field_147029_w = p_i1093_2_; + this.field_147034_x = p_i1093_3_; + this.allowUserInput = false; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString(this.field_147029_w.hasCustomInventoryName() ? this.field_147029_w.getInventoryName() : I18n.format(this.field_147029_w.getInventoryName(), new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147030_v.hasCustomInventoryName() ? this.field_147030_v.getInventoryName() : I18n.format(this.field_147030_v.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(horseGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.field_147034_x.isChested()) + { + this.drawTexturedModalRect(k + 79, l + 17, 0, this.ySize, 90, 54); + } + + if (this.field_147034_x.func_110259_cr()) + { + this.drawTexturedModalRect(k + 7, l + 35, 0, this.ySize + 54, 18, 18); + } + + GuiInventory.func_147046_a(k + 51, l + 60, 17, (float)(k + 51) - this.field_147033_y, (float)(l + 75 - 50) - this.field_147032_z, this.field_147034_x); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.field_147033_y = (float)mouseX; + this.field_147032_z = (float)mouseY; + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiIngestServers.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiIngestServers.java new file mode 100644 index 0000000..2e638f5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiIngestServers.java @@ -0,0 +1,175 @@ +package net.minecraft.client.gui.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiSlot; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IngestServerTester; +import net.minecraft.util.EnumChatFormatting; +import tv.twitch.broadcast.IngestServer; + +@SideOnly(Side.CLIENT) +public class GuiIngestServers extends GuiScreen +{ + private final GuiScreen field_152309_a; + private String field_152310_f; + private GuiIngestServers.ServerList field_152311_g; + private static final String __OBFID = "CL_00001843"; + + public GuiIngestServers(GuiScreen p_i1077_1_) + { + this.field_152309_a = p_i1077_1_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.field_152310_f = I18n.format("options.stream.ingest.title", new Object[0]); + this.field_152311_g = new GuiIngestServers.ServerList(); + + if (!this.mc.func_152346_Z().func_152908_z()) + { + this.mc.func_152346_Z().func_152909_x(); + } + + this.buttonList.add(new GuiButton(1, this.width / 2 - 155, this.height - 24 - 6, 150, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height - 24 - 6, 150, 20, I18n.format("options.stream.ingest.reset", new Object[0]))); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() + { + if (this.mc.func_152346_Z().func_152908_z()) + { + this.mc.func_152346_Z().func_152932_y().func_153039_l(); + } + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + this.mc.displayGuiScreen(this.field_152309_a); + } + else + { + this.mc.gameSettings.field_152407_Q = ""; + this.mc.gameSettings.saveOptions(); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.field_152311_g.drawScreen(mouseX, mouseY, partialTicks); + this.drawCenteredString(this.fontRendererObj, this.field_152310_f, this.width / 2, 20, 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + @SideOnly(Side.CLIENT) + class ServerList extends GuiSlot + { + private static final String __OBFID = "CL_00001842"; + + public ServerList() + { + super(GuiIngestServers.this.mc, GuiIngestServers.this.width, GuiIngestServers.this.height, 32, GuiIngestServers.this.height - 35, (int)((double)GuiIngestServers.this.mc.fontRenderer.FONT_HEIGHT * 3.5D)); + this.setShowSelectionBox(false); + } + + protected int getSize() + { + return GuiIngestServers.this.mc.func_152346_Z().func_152925_v().length; + } + + /** + * The element in the slot that was clicked, boolean for whether it was double clicked or not + */ + protected void elementClicked(int p_148144_1_, boolean p_148144_2_, int p_148144_3_, int p_148144_4_) + { + GuiIngestServers.this.mc.gameSettings.field_152407_Q = GuiIngestServers.this.mc.func_152346_Z().func_152925_v()[p_148144_1_].serverUrl; + GuiIngestServers.this.mc.gameSettings.saveOptions(); + } + + /** + * Returns true if the element passed in is currently selected + */ + protected boolean isSelected(int p_148131_1_) + { + return GuiIngestServers.this.mc.func_152346_Z().func_152925_v()[p_148131_1_].serverUrl.equals(GuiIngestServers.this.mc.gameSettings.field_152407_Q); + } + + protected void drawBackground() {} + + protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p_148126_4_, Tessellator p_148126_5_, int p_148126_6_, int p_148126_7_) + { + IngestServer ingestserver = GuiIngestServers.this.mc.func_152346_Z().func_152925_v()[p_148126_1_]; + String s = ingestserver.serverUrl.replaceAll("\\{stream_key\\}", ""); + String s1 = (int)ingestserver.bitrateKbps + " kbps"; + String s2 = null; + IngestServerTester ingestservertester = GuiIngestServers.this.mc.func_152346_Z().func_152932_y(); + + if (ingestservertester != null) + { + if (ingestserver == ingestservertester.func_153040_c()) + { + s = EnumChatFormatting.GREEN + s; + s1 = (int)(ingestservertester.func_153030_h() * 100.0F) + "%"; + } + else if (p_148126_1_ < ingestservertester.func_153028_p()) + { + if (ingestserver.bitrateKbps == 0.0F) + { + s1 = EnumChatFormatting.RED + "Down!"; + } + } + else + { + s1 = EnumChatFormatting.OBFUSCATED + "1234" + EnumChatFormatting.RESET + " kbps"; + } + } + else if (ingestserver.bitrateKbps == 0.0F) + { + s1 = EnumChatFormatting.RED + "Down!"; + } + + p_148126_2_ -= 15; + + if (this.isSelected(p_148126_1_)) + { + s2 = EnumChatFormatting.BLUE + "(Preferred)"; + } + else if (ingestserver.defaultServer) + { + s2 = EnumChatFormatting.GREEN + "(Default)"; + } + + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, ingestserver.serverName, p_148126_2_ + 2, p_148126_3_ + 5, 16777215); + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s, p_148126_2_ + 2, p_148126_3_ + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT + 5 + 3, 3158064); + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s1, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s1), p_148126_3_ + 5, 8421504); + + if (s2 != null) + { + GuiIngestServers.this.drawString(GuiIngestServers.this.fontRendererObj, s2, this.getScrollBarX() - 5 - GuiIngestServers.this.fontRendererObj.getStringWidth(s2), p_148126_3_ + 5 + 3 + GuiIngestServers.this.fontRendererObj.FONT_HEIGHT, 8421504); + } + } + + protected int getScrollBarX() + { + return super.getScrollBarX() + 15; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamOptions.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamOptions.java new file mode 100644 index 0000000..271ac99 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamOptions.java @@ -0,0 +1,153 @@ +package net.minecraft.client.gui.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiOptionSlider; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; + +@SideOnly(Side.CLIENT) +public class GuiStreamOptions extends GuiScreen +{ + private static final GameSettings.Options[] field_152312_a = new GameSettings.Options[] {GameSettings.Options.STREAM_BYTES_PER_PIXEL, GameSettings.Options.STREAM_FPS, GameSettings.Options.STREAM_KBPS, GameSettings.Options.STREAM_SEND_METADATA, GameSettings.Options.STREAM_VOLUME_MIC, GameSettings.Options.STREAM_VOLUME_SYSTEM, GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR, GameSettings.Options.STREAM_COMPRESSION}; + private static final GameSettings.Options[] field_152316_f = new GameSettings.Options[] {GameSettings.Options.STREAM_CHAT_ENABLED, GameSettings.Options.STREAM_CHAT_USER_FILTER}; + private final GuiScreen field_152317_g; + private final GameSettings field_152318_h; + private String field_152319_i; + private String field_152313_r; + private int field_152314_s; + private boolean field_152315_t = false; + private static final String __OBFID = "CL_00001841"; + + public GuiStreamOptions(GuiScreen p_i1073_1_, GameSettings p_i1073_2_) + { + this.field_152317_g = p_i1073_1_; + this.field_152318_h = p_i1073_2_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + int i = 0; + this.field_152319_i = I18n.format("options.stream.title", new Object[0]); + this.field_152313_r = I18n.format("options.stream.chat.title", new Object[0]); + GameSettings.Options[] aoptions = field_152312_a; + int j = aoptions.length; + int k; + GameSettings.Options options; + + for (k = 0; k < j; ++k) + { + options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); + } + else + { + this.buttonList.add(new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_152318_h.getKeyBinding(options))); + } + + ++i; + } + + if (i % 2 == 1) + { + ++i; + } + + this.field_152314_s = this.height / 6 + 24 * (i >> 1) + 6; + i += 2; + aoptions = field_152316_f; + j = aoptions.length; + + for (k = 0; k < j; ++k) + { + options = aoptions[k]; + + if (options.getEnumFloat()) + { + this.buttonList.add(new GuiOptionSlider(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); + } + else + { + this.buttonList.add(new GuiOptionButton(options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_152318_h.getKeyBinding(options))); + } + + ++i; + } + + this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height / 6 + 168, 150, 20, I18n.format("gui.done", new Object[0]))); + GuiButton guibutton = new GuiButton(201, this.width / 2 + 5, this.height / 6 + 168, 150, 20, I18n.format("options.stream.ingestSelection", new Object[0])); + guibutton.enabled = this.mc.func_152346_Z().func_152924_m() && this.mc.func_152346_Z().func_152925_v().length > 0 || this.mc.func_152346_Z().func_152908_z(); + this.buttonList.add(guibutton); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id < 100 && button instanceof GuiOptionButton) + { + GameSettings.Options options = ((GuiOptionButton)button).returnEnumOptions(); + this.field_152318_h.setOptionValue(options, 1); + button.displayString = this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); + + if (this.mc.func_152346_Z().func_152934_n() && options != GameSettings.Options.STREAM_CHAT_ENABLED && options != GameSettings.Options.STREAM_CHAT_USER_FILTER) + { + this.field_152315_t = true; + } + } + else if (button instanceof GuiOptionSlider) + { + if (button.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) + { + this.mc.func_152346_Z().func_152915_s(); + } + else if (button.id == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) + { + this.mc.func_152346_Z().func_152915_s(); + } + else if (this.mc.func_152346_Z().func_152934_n()) + { + this.field_152315_t = true; + } + } + + if (button.id == 200) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.field_152317_g); + } + else if (button.id == 201) + { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiIngestServers(this)); + } + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_152319_i, this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, this.field_152313_r, this.width / 2, this.field_152314_s, 16777215); + + if (this.field_152315_t) + { + this.drawCenteredString(this.fontRendererObj, EnumChatFormatting.RED + I18n.format("options.stream.changes", new Object[0]), this.width / 2, 20 + this.fontRendererObj.FONT_HEIGHT, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java new file mode 100644 index 0000000..8d5f4f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiStreamUnavailable.java @@ -0,0 +1,384 @@ +package net.minecraft.client.gui.stream; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IStream; +import net.minecraft.client.stream.NullStream; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Session; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import tv.twitch.ErrorCode; + +@SideOnly(Side.CLIENT) +public class GuiStreamUnavailable extends GuiScreen +{ + private static final Logger field_152322_a = LogManager.getLogger(); + private final IChatComponent field_152324_f; + private final GuiScreen field_152325_g; + private final GuiStreamUnavailable.Reason field_152326_h; + private final List field_152327_i; + private final List field_152323_r; + private static final String __OBFID = "CL_00001840"; + + public GuiStreamUnavailable(GuiScreen p_i1070_1_, GuiStreamUnavailable.Reason p_i1070_2_) + { + this(p_i1070_1_, p_i1070_2_, (List)null); + } + + public GuiStreamUnavailable(GuiScreen p_i1071_1_, GuiStreamUnavailable.Reason p_i1071_2_, List p_i1071_3_) + { + this.field_152324_f = new ChatComponentTranslation("stream.unavailable.title", new Object[0]); + this.field_152323_r = Lists.newArrayList(); + this.field_152325_g = p_i1071_1_; + this.field_152326_h = p_i1071_2_; + this.field_152327_i = p_i1071_3_; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + if (this.field_152323_r.isEmpty()) + { + this.field_152323_r.addAll(this.fontRendererObj.listFormattedStringToWidth(this.field_152326_h.func_152561_a().getFormattedText(), (int)((float)this.width * 0.75F))); + + if (this.field_152327_i != null) + { + this.field_152323_r.add(""); + Iterator iterator = this.field_152327_i.iterator(); + + while (iterator.hasNext()) + { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation)iterator.next(); + this.field_152323_r.add(chatcomponenttranslation.getUnformattedTextForChat()); + } + } + } + + if (this.field_152326_h.func_152559_b() != null) + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 50, 150, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 155 + 160, this.height - 50, 150, 20, I18n.format(this.field_152326_h.func_152559_b().getFormattedText(), new Object[0]))); + } + else + { + this.buttonList.add(new GuiButton(0, this.width / 2 - 75, this.height - 50, 150, 20, I18n.format("gui.cancel", new Object[0]))); + } + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + public void onGuiClosed() {} + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + int k = Math.max((int)((double)this.height * 0.85D / 2.0D - (double)((float)(this.field_152323_r.size() * this.fontRendererObj.FONT_HEIGHT) / 2.0F)), 50); + this.drawCenteredString(this.fontRendererObj, this.field_152324_f.getFormattedText(), this.width / 2, k - this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + + for (Iterator iterator = this.field_152323_r.iterator(); iterator.hasNext(); k += this.fontRendererObj.FONT_HEIGHT) + { + String s = (String)iterator.next(); + this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 10526880); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 1) + { + switch (GuiStreamUnavailable.SwitchReason.field_152577_a[this.field_152326_h.ordinal()]) + { + case 1: + case 2: + this.func_152320_a("https://account.mojang.com/me/settings"); + break; + case 3: + this.func_152320_a("https://account.mojang.com/migrate"); + break; + case 4: + this.func_152320_a("http://www.apple.com/osx/"); + break; + case 5: + case 6: + case 7: + this.func_152320_a("http://bugs.mojang.com/browse/MC"); + } + } + + this.mc.displayGuiScreen(this.field_152325_g); + } + } + + private void func_152320_a(String p_152320_1_) + { + try + { + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); + oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(p_152320_1_)}); + } + catch (Throwable throwable) + { + field_152322_a.error("Couldn\'t open link", throwable); + } + } + + public static void func_152321_a(GuiScreen p_152321_0_) + { + Minecraft minecraft = Minecraft.getMinecraft(); + IStream istream = minecraft.func_152346_Z(); + + if (!OpenGlHelper.framebufferSupported) + { + ArrayList arraylist = Lists.newArrayList(); + arraylist.add(new ChatComponentTranslation("stream.unavailable.no_fbo.version", new Object[] {GL11.glGetString(GL11.GL_VERSION)})); + arraylist.add(new ChatComponentTranslation("stream.unavailable.no_fbo.blend", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_blend_func_separate)})); + arraylist.add(new ChatComponentTranslation("stream.unavailable.no_fbo.arb", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_ARB_framebuffer_object)})); + arraylist.add(new ChatComponentTranslation("stream.unavailable.no_fbo.ext", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_framebuffer_object)})); + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.NO_FBO, arraylist)); + } + else if (istream instanceof NullStream) + { + if (((NullStream)istream).func_152937_a().getMessage().contains("Can\'t load AMD 64-bit .dll on a IA 32-bit platform")) + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_ARCH_MISMATCH)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_FAILURE)); + } + } + else if (!istream.func_152928_D() && istream.func_152912_E() == ErrorCode.TTV_EC_OS_TOO_OLD) + { + switch (GuiStreamUnavailable.SwitchReason.field_152578_b[Util.getOSType().ordinal()]) + { + case 1: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_WINDOWS)); + break; + case 2: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_MAC)); + break; + default: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_OTHER)); + } + } + else if (!minecraft.func_152341_N().containsKey("twitch_access_token")) + { + if (minecraft.getSession().func_152428_f() == Session.Type.LEGACY) + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_MIGRATED)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_BOUND)); + } + } + else if (!istream.func_152913_F()) + { + switch (GuiStreamUnavailable.SwitchReason.field_152579_c[istream.func_152918_H().ordinal()]) + { + case 1: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH)); + break; + case 2: + default: + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH_ERROR)); + } + } + else if (istream.func_152912_E() != null) + { + List list = Arrays.asList(new ChatComponentTranslation[] {new ChatComponentTranslation("stream.unavailable.initialization_failure.extra", new Object[]{ErrorCode.getString(istream.func_152912_E())})}); + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.INITIALIZATION_FAILURE, list)); + } + else + { + minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNKNOWN)); + } + } + + @SideOnly(Side.CLIENT) + public static enum Reason + { + NO_FBO(new ChatComponentTranslation("stream.unavailable.no_fbo", new Object[0])), + LIBRARY_ARCH_MISMATCH(new ChatComponentTranslation("stream.unavailable.library_arch_mismatch", new Object[0])), + LIBRARY_FAILURE(new ChatComponentTranslation("stream.unavailable.library_failure", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])), + UNSUPPORTED_OS_WINDOWS(new ChatComponentTranslation("stream.unavailable.not_supported.windows", new Object[0])), + UNSUPPORTED_OS_MAC(new ChatComponentTranslation("stream.unavailable.not_supported.mac", new Object[0]), new ChatComponentTranslation("stream.unavailable.not_supported.mac.okay", new Object[0])), + UNSUPPORTED_OS_OTHER(new ChatComponentTranslation("stream.unavailable.not_supported.other", new Object[0])), + ACCOUNT_NOT_MIGRATED(new ChatComponentTranslation("stream.unavailable.account_not_migrated", new Object[0]), new ChatComponentTranslation("stream.unavailable.account_not_migrated.okay", new Object[0])), + ACCOUNT_NOT_BOUND(new ChatComponentTranslation("stream.unavailable.account_not_bound", new Object[0]), new ChatComponentTranslation("stream.unavailable.account_not_bound.okay", new Object[0])), + FAILED_TWITCH_AUTH(new ChatComponentTranslation("stream.unavailable.failed_auth", new Object[0]), new ChatComponentTranslation("stream.unavailable.failed_auth.okay", new Object[0])), + FAILED_TWITCH_AUTH_ERROR(new ChatComponentTranslation("stream.unavailable.failed_auth_error", new Object[0])), + INITIALIZATION_FAILURE(new ChatComponentTranslation("stream.unavailable.initialization_failure", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])), + UNKNOWN(new ChatComponentTranslation("stream.unavailable.unknown", new Object[0]), new ChatComponentTranslation("stream.unavailable.report_to_mojang", new Object[0])); + private final IChatComponent field_152574_m; + private final IChatComponent field_152575_n; + + private static final String __OBFID = "CL_00001838"; + + private Reason(IChatComponent p_i1066_3_) + { + this(p_i1066_3_, (IChatComponent)null); + } + + private Reason(IChatComponent p_i1067_3_, IChatComponent p_i1067_4_) + { + this.field_152574_m = p_i1067_3_; + this.field_152575_n = p_i1067_4_; + } + + public IChatComponent func_152561_a() + { + return this.field_152574_m; + } + + public IChatComponent func_152559_b() + { + return this.field_152575_n; + } + } + + @SideOnly(Side.CLIENT) + + static final class SwitchReason + { + static final int[] field_152577_a; + + static final int[] field_152578_b; + + static final int[] field_152579_c = new int[IStream.AuthFailureReason.values().length]; + private static final String __OBFID = "CL_00001839"; + + static + { + try + { + field_152579_c[IStream.AuthFailureReason.INVALID_TOKEN.ordinal()] = 1; + } + catch (NoSuchFieldError var11) + { + ; + } + + try + { + field_152579_c[IStream.AuthFailureReason.ERROR.ordinal()] = 2; + } + catch (NoSuchFieldError var10) + { + ; + } + + field_152578_b = new int[Util.EnumOS.values().length]; + + try + { + field_152578_b[Util.EnumOS.WINDOWS.ordinal()] = 1; + } + catch (NoSuchFieldError var9) + { + ; + } + + try + { + field_152578_b[Util.EnumOS.OSX.ordinal()] = 2; + } + catch (NoSuchFieldError var8) + { + ; + } + + field_152577_a = new int[GuiStreamUnavailable.Reason.values().length]; + + try + { + field_152577_a[GuiStreamUnavailable.Reason.ACCOUNT_NOT_BOUND.ordinal()] = 1; + } + catch (NoSuchFieldError var7) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH.ordinal()] = 2; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.ACCOUNT_NOT_MIGRATED.ordinal()] = 3; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.UNSUPPORTED_OS_MAC.ordinal()] = 4; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.UNKNOWN.ordinal()] = 5; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.LIBRARY_FAILURE.ordinal()] = 6; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_152577_a[GuiStreamUnavailable.Reason.INITIALIZATION_FAILURE.ordinal()] = 7; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java new file mode 100644 index 0000000..58e5202 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/gui/stream/GuiTwitchUserMode.java @@ -0,0 +1,252 @@ +package net.minecraft.client.gui.stream; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.IStream; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import tv.twitch.chat.ChatUserInfo; +import tv.twitch.chat.ChatUserMode; +import tv.twitch.chat.ChatUserSubscription; + +@SideOnly(Side.CLIENT) +public class GuiTwitchUserMode extends GuiScreen +{ + private static final EnumChatFormatting field_152331_a = EnumChatFormatting.DARK_GREEN; + private static final EnumChatFormatting field_152335_f = EnumChatFormatting.RED; + private static final EnumChatFormatting field_152336_g = EnumChatFormatting.DARK_PURPLE; + private final ChatUserInfo field_152337_h; + private final IChatComponent field_152338_i; + private final List field_152332_r = Lists.newArrayList(); + private final IStream field_152333_s; + private int field_152334_t; + private static final String __OBFID = "CL_00001837"; + + public GuiTwitchUserMode(IStream p_i1064_1_, ChatUserInfo p_i1064_2_) + { + this.field_152333_s = p_i1064_1_; + this.field_152337_h = p_i1064_2_; + this.field_152338_i = new ChatComponentText(p_i1064_2_.displayName); + this.field_152332_r.addAll(func_152328_a(p_i1064_2_.modes, p_i1064_2_.subscriptions, p_i1064_1_)); + } + + public static List func_152328_a(Set p_152328_0_, Set p_152328_1_, IStream p_152328_2_) + { + String s = p_152328_2_ == null ? null : p_152328_2_.func_152921_C(); + boolean flag = p_152328_2_ != null && p_152328_2_.func_152927_B(); + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = p_152328_0_.iterator(); + IChatComponent ichatcomponent; + ChatComponentText chatcomponenttext; + + while (iterator.hasNext()) + { + ChatUserMode chatusermode = (ChatUserMode)iterator.next(); + ichatcomponent = func_152329_a(chatusermode, s, flag); + + if (ichatcomponent != null) + { + chatcomponenttext = new ChatComponentText("- "); + chatcomponenttext.appendSibling(ichatcomponent); + arraylist.add(chatcomponenttext); + } + } + + iterator = p_152328_1_.iterator(); + + while (iterator.hasNext()) + { + ChatUserSubscription chatusersubscription = (ChatUserSubscription)iterator.next(); + ichatcomponent = func_152330_a(chatusersubscription, s, flag); + + if (ichatcomponent != null) + { + chatcomponenttext = new ChatComponentText("- "); + chatcomponenttext.appendSibling(ichatcomponent); + arraylist.add(chatcomponenttext); + } + } + + return arraylist; + } + + public static IChatComponent func_152330_a(ChatUserSubscription p_152330_0_, String p_152330_1_, boolean p_152330_2_) + { + ChatComponentTranslation chatcomponenttranslation = null; + + if (p_152330_0_ == ChatUserSubscription.TTV_CHAT_USERSUB_SUBSCRIBER) + { + if (p_152330_1_ == null) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.subscription.subscriber", new Object[0]); + } + else if (p_152330_2_) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.subscription.subscriber.self", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.subscription.subscriber.other", new Object[] {p_152330_1_}); + } + + chatcomponenttranslation.getChatStyle().setColor(field_152331_a); + } + else if (p_152330_0_ == ChatUserSubscription.TTV_CHAT_USERSUB_TURBO) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.subscription.turbo", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(field_152336_g); + } + + return chatcomponenttranslation; + } + + public static IChatComponent func_152329_a(ChatUserMode p_152329_0_, String p_152329_1_, boolean p_152329_2_) + { + ChatComponentTranslation chatcomponenttranslation = null; + + if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_ADMINSTRATOR) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.administrator", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(field_152336_g); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_BANNED) + { + if (p_152329_1_ == null) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.banned", new Object[0]); + } + else if (p_152329_2_) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.banned.self", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.banned.other", new Object[] {p_152329_1_}); + } + + chatcomponenttranslation.getChatStyle().setColor(field_152335_f); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_BROADCASTER) + { + if (p_152329_1_ == null) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.broadcaster", new Object[0]); + } + else if (p_152329_2_) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.broadcaster.self", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.broadcaster.other", new Object[0]); + } + + chatcomponenttranslation.getChatStyle().setColor(field_152331_a); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_MODERATOR) + { + if (p_152329_1_ == null) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.moderator", new Object[0]); + } + else if (p_152329_2_) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.moderator.self", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.moderator.other", new Object[] {p_152329_1_}); + } + + chatcomponenttranslation.getChatStyle().setColor(field_152331_a); + } + else if (p_152329_0_ == ChatUserMode.TTV_CHAT_USERMODE_STAFF) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.user.mode.staff", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(field_152336_g); + } + + return chatcomponenttranslation; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + int i = this.width / 3; + int j = i - 130; + this.buttonList.add(new GuiButton(1, i * 0 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.timeout", new Object[0]))); + this.buttonList.add(new GuiButton(0, i * 1 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.ban", new Object[0]))); + this.buttonList.add(new GuiButton(2, i * 2 + j / 2, this.height - 70, 130, 20, I18n.format("stream.userinfo.mod", new Object[0]))); + this.buttonList.add(new GuiButton(5, i * 0 + j / 2, this.height - 45, 130, 20, I18n.format("gui.cancel", new Object[0]))); + this.buttonList.add(new GuiButton(3, i * 1 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unban", new Object[0]))); + this.buttonList.add(new GuiButton(4, i * 2 + j / 2, this.height - 45, 130, 20, I18n.format("stream.userinfo.unmod", new Object[0]))); + int k = 0; + IChatComponent ichatcomponent; + + for (Iterator iterator = this.field_152332_r.iterator(); iterator.hasNext(); k = Math.max(k, this.fontRendererObj.getStringWidth(ichatcomponent.getFormattedText()))) + { + ichatcomponent = (IChatComponent)iterator.next(); + } + + this.field_152334_t = this.width / 2 - k / 2; + } + + protected void actionPerformed(GuiButton button) + { + if (button.enabled) + { + if (button.id == 0) + { + this.field_152333_s.func_152917_b("/ban " + this.field_152337_h.displayName); + } + else if (button.id == 3) + { + this.field_152333_s.func_152917_b("/unban " + this.field_152337_h.displayName); + } + else if (button.id == 2) + { + this.field_152333_s.func_152917_b("/mod " + this.field_152337_h.displayName); + } + else if (button.id == 4) + { + this.field_152333_s.func_152917_b("/unmod " + this.field_152337_h.displayName); + } + else if (button.id == 1) + { + this.field_152333_s.func_152917_b("/timeout " + this.field_152337_h.displayName); + } + + this.mc.displayGuiScreen((GuiScreen)null); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, this.field_152338_i.getUnformattedText(), this.width / 2, 70, 16777215); + int k = 80; + + for (Iterator iterator = this.field_152332_r.iterator(); iterator.hasNext(); k += this.fontRendererObj.FONT_HEIGHT) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + this.drawString(this.fontRendererObj, ichatcomponent.getFormattedText(), this.field_152334_t, k, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/main/Main.java b/build/rfg/minecraft-src/java/net/minecraft/client/main/Main.java new file mode 100644 index 0000000..2248008 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/main/Main.java @@ -0,0 +1,171 @@ +package net.minecraft.client.main; + +import com.google.common.collect.HashMultimap; +import com.google.gson.Gson; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.lang.reflect.ParameterizedType; +import java.net.Authenticator; +import java.net.InetSocketAddress; +import java.net.PasswordAuthentication; +import java.net.Proxy; +import java.net.Proxy.Type; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import joptsimple.ArgumentAcceptingOptionSpec; +import joptsimple.NonOptionArgumentSpec; +import joptsimple.OptionParser; +import joptsimple.OptionSet; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +@SideOnly(Side.CLIENT) +public class Main +{ + private static final java.lang.reflect.Type field_152370_a = new ParameterizedType() + { + private static final String __OBFID = "CL_00000828"; + public java.lang.reflect.Type[] getActualTypeArguments() + { + return new java.lang.reflect.Type[] {String.class, new ParameterizedType() + { + private static final String __OBFID = "CL_00001836"; + public java.lang.reflect.Type[] getActualTypeArguments() + { + return new java.lang.reflect.Type[] {String.class}; + } + public java.lang.reflect.Type getRawType() + { + return Collection.class; + } + public java.lang.reflect.Type getOwnerType() + { + return null; + } + } + }; + } + public java.lang.reflect.Type getRawType() + { + return Map.class; + } + public java.lang.reflect.Type getOwnerType() + { + return null; + } + }; + private static final String __OBFID = "CL_00001461"; + + public static void main(String[] p_main_0_) + { + System.setProperty("java.net.preferIPv4Stack", "true"); + OptionParser optionparser = new OptionParser(); + optionparser.allowsUnrecognizedOptions(); + optionparser.accepts("demo"); + optionparser.accepts("fullscreen"); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec = optionparser.accepts("server").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec1 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(25565), new Integer[0]); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec2 = optionparser.accepts("gameDir").withRequiredArg().ofType(File.class).defaultsTo(new File("."), new File[0]); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec3 = optionparser.accepts("assetsDir").withRequiredArg().ofType(File.class); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec4 = optionparser.accepts("resourcePackDir").withRequiredArg().ofType(File.class); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec5 = optionparser.accepts("proxyHost").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec6 = optionparser.accepts("proxyPort").withRequiredArg().defaultsTo("8080", new String[0]).ofType(Integer.class); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec7 = optionparser.accepts("proxyUser").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec8 = optionparser.accepts("proxyPass").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec9 = optionparser.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec10 = optionparser.accepts("uuid").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec11 = optionparser.accepts("accessToken").withRequiredArg().required(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec12 = optionparser.accepts("version").withRequiredArg().required(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec13 = optionparser.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec14 = optionparser.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec15 = optionparser.accepts("userProperties").withRequiredArg().required(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec16 = optionparser.accepts("assetIndex").withRequiredArg(); + ArgumentAcceptingOptionSpec argumentacceptingoptionspec17 = optionparser.accepts("userType").withRequiredArg().defaultsTo("legacy", new String[0]); + NonOptionArgumentSpec nonoptionargumentspec = optionparser.nonOptions(); + OptionSet optionset = optionparser.parse(p_main_0_); + List list = optionset.valuesOf(nonoptionargumentspec); + String s = (String)optionset.valueOf(argumentacceptingoptionspec5); + Proxy proxy = Proxy.NO_PROXY; + + if (s != null) + { + try + { + proxy = new Proxy(Type.SOCKS, new InetSocketAddress(s, ((Integer)optionset.valueOf(argumentacceptingoptionspec6)).intValue())); + } + catch (Exception exception) + { + ; + } + } + + final String s1 = (String)optionset.valueOf(argumentacceptingoptionspec7); + final String s2 = (String)optionset.valueOf(argumentacceptingoptionspec8); + + if (!proxy.equals(Proxy.NO_PROXY) && func_110121_a(s1) && func_110121_a(s2)) + { + Authenticator.setDefault(new Authenticator() + { + private static final String __OBFID = "CL_00000829"; + protected PasswordAuthentication getPasswordAuthentication() + { + return new PasswordAuthentication(s1, s2.toCharArray()); + } + }); + } + + int i = ((Integer)optionset.valueOf(argumentacceptingoptionspec13)).intValue(); + int j = ((Integer)optionset.valueOf(argumentacceptingoptionspec14)).intValue(); + boolean flag = optionset.has("fullscreen"); + boolean flag1 = optionset.has("demo"); + String s3 = (String)optionset.valueOf(argumentacceptingoptionspec12); + HashMultimap hashmultimap = HashMultimap.create(); + Iterator iterator = ((Map)(new Gson()).fromJson((String)optionset.valueOf(argumentacceptingoptionspec15), field_152370_a)).entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + hashmultimap.putAll(entry.getKey(), (Iterable)entry.getValue()); + } + + File file2 = (File)optionset.valueOf(argumentacceptingoptionspec2); + File file3 = optionset.has(argumentacceptingoptionspec3) ? (File)optionset.valueOf(argumentacceptingoptionspec3) : new File(file2, "assets/"); + File file1 = optionset.has(argumentacceptingoptionspec4) ? (File)optionset.valueOf(argumentacceptingoptionspec4) : new File(file2, "resourcepacks/"); + String s4 = optionset.has(argumentacceptingoptionspec10) ? (String)argumentacceptingoptionspec10.value(optionset) : (String)argumentacceptingoptionspec9.value(optionset); + String s5 = optionset.has(argumentacceptingoptionspec16) ? (String)argumentacceptingoptionspec16.value(optionset) : null; + Session session = new Session((String)argumentacceptingoptionspec9.value(optionset), s4, (String)argumentacceptingoptionspec11.value(optionset), (String)argumentacceptingoptionspec17.value(optionset)); + Minecraft minecraft = new Minecraft(session, i, j, flag, flag1, file2, file3, file1, proxy, s3, hashmultimap, s5); + String s6 = (String)optionset.valueOf(argumentacceptingoptionspec); + + if (s6 != null) + { + minecraft.setServer(s6, ((Integer)optionset.valueOf(argumentacceptingoptionspec1)).intValue()); + } + + Runtime.getRuntime().addShutdownHook(new Thread("Client Shutdown Thread") + { + private static final String __OBFID = "CL_00001835"; + public void run() + { + Minecraft.stopIntegratedServer(); + } + }); + + if (!list.isEmpty()) + { + System.out.println("Completely ignored arguments: " + list); + } + + Thread.currentThread().setName("Client thread"); + minecraft.run(); + } + + private static boolean func_110121_a(String p_110121_0_) + { + return p_110121_0_ != null && !p_110121_0_.isEmpty(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBase.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBase.java new file mode 100644 index 0000000..c2ab870 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBase.java @@ -0,0 +1,58 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; + +public abstract class ModelBase +{ + public float onGround; + public boolean isRiding; + /** This is a list of all the boxes (ModelRenderer.class) in the current model. */ + public List boxList = new ArrayList(); + public boolean isChild = true; + /** A mapping for all texture offsets */ + private Map modelTextureMap = new HashMap(); + public int textureWidth = 64; + public int textureHeight = 32; + private static final String __OBFID = "CL_00000845"; + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {} + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {} + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {} + + public ModelRenderer getRandomModelBox(Random p_85181_1_) + { + return (ModelRenderer)this.boxList.get(p_85181_1_.nextInt(this.boxList.size())); + } + + protected void setTextureOffset(String p_78085_1_, int p_78085_2_, int p_78085_3_) + { + this.modelTextureMap.put(p_78085_1_, new TextureOffset(p_78085_2_, p_78085_3_)); + } + + public TextureOffset getTextureOffset(String p_78084_1_) + { + return (TextureOffset)this.modelTextureMap.get(p_78084_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBat.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBat.java new file mode 100644 index 0000000..ef976dd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBat.java @@ -0,0 +1,113 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelBat extends ModelBase +{ + private ModelRenderer batHead; + /** The body box of the bat model. */ + private ModelRenderer batBody; + /** The inner right wing box of the bat model. */ + private ModelRenderer batRightWing; + /** The inner left wing box of the bat model. */ + private ModelRenderer batLeftWing; + /** The outer right wing box of the bat model. */ + private ModelRenderer batOuterRightWing; + /** The outer left wing box of the bat model. */ + private ModelRenderer batOuterLeftWing; + private static final String __OBFID = "CL_00000830"; + + public ModelBat() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.batHead = new ModelRenderer(this, 0, 0); + this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); + ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); + modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer); + ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0); + modelrenderer1.mirror = true; + modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer1); + this.batBody = new ModelRenderer(this, 0, 16); + this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); + this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); + this.batRightWing = new ModelRenderer(this, 42, 0); + this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterRightWing = new ModelRenderer(this, 24, 16); + this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); + this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); + this.batLeftWing = new ModelRenderer(this, 42, 0); + this.batLeftWing.mirror = true; + this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterLeftWing = new ModelRenderer(this, 24, 16); + this.batOuterLeftWing.mirror = true; + this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); + this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); + this.batBody.addChild(this.batRightWing); + this.batBody.addChild(this.batLeftWing); + this.batRightWing.addChild(this.batOuterRightWing); + this.batLeftWing.addChild(this.batOuterLeftWing); + } + + /** + * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and + * it seems a good match for a bats size + */ + public int getBatSize() + { + return 36; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + EntityBat entitybat = (EntityBat)p_78088_1_; + float f6; + + if (entitybat.getIsBatHanging()) + { + f6 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = (float)Math.PI - p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = (float)Math.PI; + this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); + this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); + this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); + this.batBody.rotateAngleX = (float)Math.PI; + this.batRightWing.rotateAngleX = -0.15707964F; + this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); + this.batOuterRightWing.rotateAngleY = -1.7278761F; + this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; + } + else + { + f6 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = 0.0F; + this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; + this.batBody.rotateAngleY = 0.0F; + this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float)Math.PI * 0.25F; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; + this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; + } + + this.batHead.render(p_78088_7_); + this.batBody.render(p_78088_7_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBiped.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBiped.java new file mode 100644 index 0000000..bc2d88c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBiped.java @@ -0,0 +1,244 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelBiped extends ModelBase +{ + public ModelRenderer bipedHead; + public ModelRenderer bipedHeadwear; + public ModelRenderer bipedBody; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedLeftArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftLeg; + public ModelRenderer bipedEars; + public ModelRenderer bipedCloak; + /** Records whether the model should be rendered holding an item in the left hand, and if that item is a block. */ + public int heldItemLeft; + /** Records whether the model should be rendered holding an item in the right hand, and if that item is a block. */ + public int heldItemRight; + public boolean isSneak; + /** Records whether the model should be rendered aiming a bow. */ + public boolean aimedBow; + private static final String __OBFID = "CL_00000840"; + + public ModelBiped() + { + this(0.0F); + } + + public ModelBiped(float p_i1148_1_) + { + this(p_i1148_1_, 0.0F, 64, 32); + } + + public ModelBiped(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) + { + this.textureWidth = p_i1149_3_; + this.textureHeight = p_i1149_4_; + this.bipedCloak = new ModelRenderer(this, 0, 0); + this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, p_i1149_1_); + this.bipedEars = new ModelRenderer(this, 24, 0); + this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, p_i1149_1_); + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedHeadwear = new ModelRenderer(this, 32, 0); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedBody = new ModelRenderer(this, 16, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6); + GL11.glTranslatef(0.0F, 16.0F * p_78088_7_, 0.0F); + this.bipedHead.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.bipedBody.render(p_78088_7_); + this.bipedRightArm.render(p_78088_7_); + this.bipedLeftArm.render(p_78088_7_); + this.bipedRightLeg.render(p_78088_7_); + this.bipedLeftLeg.render(p_78088_7_); + this.bipedHeadwear.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.bipedHead.render(p_78088_7_); + this.bipedBody.render(p_78088_7_); + this.bipedRightArm.render(p_78088_7_); + this.bipedLeftArm.render(p_78088_7_); + this.bipedRightLeg.render(p_78088_7_); + this.bipedLeftLeg.render(p_78088_7_); + this.bipedHeadwear.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F; + this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; + + if (this.isRiding) + { + this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); + this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); + } + + if (this.heldItemLeft != 0) + { + this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; + } + + if (this.heldItemRight != 0) + { + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedLeftArm.rotateAngleY = 0.0F; + float f6; + float f7; + + if (this.onGround > -9990.0F) + { + f6 = this.onGround; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; + f6 = 1.0F - this.onGround; + f6 *= f6; + f6 *= f6; + f6 = 1.0F - f6; + f7 = MathHelper.sin(f6 * (float)Math.PI); + float f8 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; + } + + if (this.isSneak) + { + this.bipedBody.rotateAngleX = 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; + this.bipedRightLeg.rotationPointZ = 4.0F; + this.bipedLeftLeg.rotationPointZ = 4.0F; + this.bipedRightLeg.rotationPointY = 9.0F; + this.bipedLeftLeg.rotationPointY = 9.0F; + this.bipedHead.rotationPointY = 1.0F; + this.bipedHeadwear.rotationPointY = 1.0F; + } + else + { + this.bipedBody.rotateAngleX = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.1F; + this.bipedLeftLeg.rotationPointZ = 0.1F; + this.bipedRightLeg.rotationPointY = 12.0F; + this.bipedLeftLeg.rotationPointY = 12.0F; + this.bipedHead.rotationPointY = 0.0F; + this.bipedHeadwear.rotationPointY = 0.0F; + } + + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + + if (this.aimedBow) + { + f6 = 0.0F; + f7 = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY; + this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } + } + + /** + * renders the ears (specifically, deadmau5's) + */ + public void renderEars(float p_78110_1_) + { + this.bipedEars.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedEars.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedEars.rotationPointX = 0.0F; + this.bipedEars.rotationPointY = 0.0F; + this.bipedEars.render(p_78110_1_); + } + + /** + * Renders the cloak of the current biped (in most cases, it's a player) + */ + public void renderCloak(float p_78111_1_) + { + this.bipedCloak.render(p_78111_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBlaze.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBlaze.java new file mode 100644 index 0000000..732bd19 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBlaze.java @@ -0,0 +1,88 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelBlaze extends ModelBase +{ + /** The sticks that fly around the Blaze. */ + private ModelRenderer[] blazeSticks = new ModelRenderer[12]; + private ModelRenderer blazeHead; + private static final String __OBFID = "CL_00000831"; + + public ModelBlaze() + { + for (int i = 0; i < this.blazeSticks.length; ++i) + { + this.blazeSticks[i] = new ModelRenderer(this, 0, 16); + this.blazeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); + } + + this.blazeHead = new ModelRenderer(this, 0, 0); + this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + } + + public int func_78104_a() + { + return 8; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.blazeHead.render(p_78088_7_); + + for (int i = 0; i < this.blazeSticks.length; ++i) + { + this.blazeSticks[i].render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + float f6 = p_78087_3_ * (float)Math.PI * -0.1F; + int i; + + for (i = 0; i < 4; ++i) + { + this.blazeSticks[i].rotationPointY = -2.0F + MathHelper.cos(((float)(i * 2) + p_78087_3_) * 0.25F); + this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 9.0F; + this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 9.0F; + ++f6; + } + + f6 = ((float)Math.PI / 4F) + p_78087_3_ * (float)Math.PI * 0.03F; + + for (i = 4; i < 8; ++i) + { + this.blazeSticks[i].rotationPointY = 2.0F + MathHelper.cos(((float)(i * 2) + p_78087_3_) * 0.25F); + this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 7.0F; + this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 7.0F; + ++f6; + } + + f6 = 0.47123894F + p_78087_3_ * (float)Math.PI * -0.05F; + + for (i = 8; i < 12; ++i) + { + this.blazeSticks[i].rotationPointY = 11.0F + MathHelper.cos(((float)i * 1.5F + p_78087_3_) * 0.5F); + this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 5.0F; + this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 5.0F; + ++f6; + } + + this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBoat.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBoat.java new file mode 100644 index 0000000..1bf9b6e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBoat.java @@ -0,0 +1,50 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelBoat extends ModelBase +{ + public ModelRenderer[] boatSides = new ModelRenderer[5]; + private static final String __OBFID = "CL_00000832"; + + public ModelBoat() + { + this.boatSides[0] = new ModelRenderer(this, 0, 8); + this.boatSides[1] = new ModelRenderer(this, 0, 0); + this.boatSides[2] = new ModelRenderer(this, 0, 0); + this.boatSides[3] = new ModelRenderer(this, 0, 0); + this.boatSides[4] = new ModelRenderer(this, 0, 0); + byte b0 = 24; + byte b1 = 6; + byte b2 = 20; + byte b3 = 4; + this.boatSides[0].addBox((float)(-b0 / 2), (float)(-b2 / 2 + 2), -3.0F, b0, b2 - 4, 4, 0.0F); + this.boatSides[0].setRotationPoint(0.0F, (float)b3, 0.0F); + this.boatSides[1].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[1].setRotationPoint((float)(-b0 / 2 + 1), (float)b3, 0.0F); + this.boatSides[2].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[2].setRotationPoint((float)(b0 / 2 - 1), (float)b3, 0.0F); + this.boatSides[3].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[3].setRotationPoint(0.0F, (float)b3, (float)(-b2 / 2 + 1)); + this.boatSides[4].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[4].setRotationPoint(0.0F, (float)b3, (float)(b2 / 2 - 1)); + this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); + this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); + this.boatSides[3].rotateAngleY = (float)Math.PI; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + for (int i = 0; i < 5; ++i) + { + this.boatSides[i].render(p_78088_7_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBook.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBook.java new file mode 100644 index 0000000..1ac2f9c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBook.java @@ -0,0 +1,68 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelBook extends ModelBase +{ + /** Right cover renderer (when facing the book) */ + public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); + /** Left cover renderer (when facing the book) */ + public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); + /** The right pages renderer (when facing the book) */ + public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); + /** The left pages renderer (when facing the book) */ + public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); + /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); + /** The renderer of spine of the book */ + public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); + private static final String __OBFID = "CL_00000833"; + + public ModelBook() + { + this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); + this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); + this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.coverRight.render(p_78088_7_); + this.coverLeft.render(p_78088_7_); + this.bookSpine.render(p_78088_7_); + this.pagesRight.render(p_78088_7_); + this.pagesLeft.render(p_78088_7_); + this.flippingPageRight.render(p_78088_7_); + this.flippingPageLeft.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + float f6 = (MathHelper.sin(p_78087_1_ * 0.02F) * 0.1F + 1.25F) * p_78087_4_; + this.coverRight.rotateAngleY = (float)Math.PI + f6; + this.coverLeft.rotateAngleY = -f6; + this.pagesRight.rotateAngleY = f6; + this.pagesLeft.rotateAngleY = -f6; + this.flippingPageRight.rotateAngleY = f6 - f6 * 2.0F * p_78087_2_; + this.flippingPageLeft.rotateAngleY = f6 - f6 * 2.0F * p_78087_3_; + this.pagesRight.rotationPointX = MathHelper.sin(f6); + this.pagesLeft.rotationPointX = MathHelper.sin(f6); + this.flippingPageRight.rotationPointX = MathHelper.sin(f6); + this.flippingPageLeft.rotationPointX = MathHelper.sin(f6); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBox.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBox.java new file mode 100644 index 0000000..14343ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelBox.java @@ -0,0 +1,104 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; + +public class ModelBox +{ + /** The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube */ + private PositionTextureVertex[] vertexPositions; + /** An array of 6 TexturedQuads, one for each face of a cube */ + private TexturedQuad[] quadList; + /** X vertex coordinate of lower box corner */ + public final float posX1; + /** Y vertex coordinate of lower box corner */ + public final float posY1; + /** Z vertex coordinate of lower box corner */ + public final float posZ1; + /** X vertex coordinate of upper box corner */ + public final float posX2; + /** Y vertex coordinate of upper box corner */ + public final float posY2; + /** Z vertex coordinate of upper box corner */ + public final float posZ2; + public String field_78247_g; + private static final String __OBFID = "CL_00000872"; + + public ModelBox(ModelRenderer p_i1171_1_, int p_i1171_2_, int p_i1171_3_, float p_i1171_4_, float p_i1171_5_, float p_i1171_6_, int p_i1171_7_, int p_i1171_8_, int p_i1171_9_, float p_i1171_10_) + { + this.posX1 = p_i1171_4_; + this.posY1 = p_i1171_5_; + this.posZ1 = p_i1171_6_; + this.posX2 = p_i1171_4_ + (float)p_i1171_7_; + this.posY2 = p_i1171_5_ + (float)p_i1171_8_; + this.posZ2 = p_i1171_6_ + (float)p_i1171_9_; + this.vertexPositions = new PositionTextureVertex[8]; + this.quadList = new TexturedQuad[6]; + float f4 = p_i1171_4_ + (float)p_i1171_7_; + float f5 = p_i1171_5_ + (float)p_i1171_8_; + float f6 = p_i1171_6_ + (float)p_i1171_9_; + p_i1171_4_ -= p_i1171_10_; + p_i1171_5_ -= p_i1171_10_; + p_i1171_6_ -= p_i1171_10_; + f4 += p_i1171_10_; + f5 += p_i1171_10_; + f6 += p_i1171_10_; + + if (p_i1171_1_.mirror) + { + float f7 = f4; + f4 = p_i1171_4_; + p_i1171_4_ = f7; + } + + PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(p_i1171_4_, p_i1171_5_, p_i1171_6_, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f4, p_i1171_5_, p_i1171_6_, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f4, f5, p_i1171_6_, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(p_i1171_4_, f5, p_i1171_6_, 8.0F, 0.0F); + PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(p_i1171_4_, p_i1171_5_, f6, 0.0F, 0.0F); + PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f4, p_i1171_5_, f6, 0.0F, 8.0F); + PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f4, f5, f6, 8.0F, 8.0F); + PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(p_i1171_4_, f5, f6, 8.0F, 0.0F); + this.vertexPositions[0] = positiontexturevertex7; + this.vertexPositions[1] = positiontexturevertex; + this.vertexPositions[2] = positiontexturevertex1; + this.vertexPositions[3] = positiontexturevertex2; + this.vertexPositions[4] = positiontexturevertex3; + this.vertexPositions[5] = positiontexturevertex4; + this.vertexPositions[6] = positiontexturevertex5; + this.vertexPositions[7] = positiontexturevertex6; + this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, p_i1171_2_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, p_i1171_2_ + p_i1171_9_, p_i1171_3_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_7_, p_i1171_3_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, p_i1171_2_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.textureWidth, p_i1171_1_.textureHeight); + + if (p_i1171_1_.mirror) + { + for (int j1 = 0; j1 < this.quadList.length; ++j1) + { + this.quadList[j1].flipFace(); + } + } + } + + /** + * Draw the six sided box defined by this ModelBox + */ + @SideOnly(Side.CLIENT) + public void render(Tessellator p_78245_1_, float p_78245_2_) + { + for (int i = 0; i < this.quadList.length; ++i) + { + this.quadList[i].draw(p_78245_1_, p_78245_2_); + } + } + + public ModelBox func_78244_a(String p_78244_1_) + { + this.field_78247_g = p_78244_1_; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChest.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChest.java new file mode 100644 index 0000000..f16ca8d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChest.java @@ -0,0 +1,45 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelChest extends ModelBase +{ + /** The chest lid in the chest's model. */ + public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + /** The model of the bottom of the chest. */ + public ModelRenderer chestBelow; + /** The chest's knob in the chest model. */ + public ModelRenderer chestKnob; + private static final String __OBFID = "CL_00000834"; + + public ModelChest() + { + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 8.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } + + /** + * This method renders out all parts of the chest model. + */ + public void renderAll() + { + this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; + this.chestLid.render(0.0625F); + this.chestKnob.render(0.0625F); + this.chestBelow.render(0.0625F); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChicken.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChicken.java new file mode 100644 index 0000000..dc4733d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelChicken.java @@ -0,0 +1,109 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelChicken extends ModelBase +{ + public ModelRenderer head; + public ModelRenderer body; + public ModelRenderer rightLeg; + public ModelRenderer leftLeg; + public ModelRenderer rightWing; + public ModelRenderer leftWing; + public ModelRenderer bill; + public ModelRenderer chin; + private static final String __OBFID = "CL_00000835"; + + public ModelChicken() + { + byte b0 = 16; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); + this.head.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.bill = new ModelRenderer(this, 14, 0); + this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); + this.bill.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.chin = new ModelRenderer(this, 14, 4); + this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); + this.chin.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.body = new ModelRenderer(this, 0, 9); + this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); + this.body.setRotationPoint(0.0F, (float)b0, 0.0F); + this.rightLeg = new ModelRenderer(this, 26, 0); + this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.rightLeg.setRotationPoint(-2.0F, (float)(3 + b0), 1.0F); + this.leftLeg = new ModelRenderer(this, 26, 0); + this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); + this.leftLeg.setRotationPoint(1.0F, (float)(3 + b0), 1.0F); + this.rightWing = new ModelRenderer(this, 24, 13); + this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); + this.rightWing.setRotationPoint(-4.0F, (float)(-3 + b0), 0.0F); + this.leftWing = new ModelRenderer(this, 24, 13); + this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); + this.leftWing.setRotationPoint(4.0F, (float)(-3 + b0), 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_); + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.head.render(p_78088_7_); + this.bill.render(p_78088_7_); + this.chin.render(p_78088_7_); + this.body.render(p_78088_7_); + this.rightLeg.render(p_78088_7_); + this.leftLeg.render(p_78088_7_); + this.rightWing.render(p_78088_7_); + this.leftWing.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bill.rotateAngleX = this.head.rotateAngleX; + this.bill.rotateAngleY = this.head.rotateAngleY; + this.chin.rotateAngleX = this.head.rotateAngleX; + this.chin.rotateAngleY = this.head.rotateAngleY; + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.rightWing.rotateAngleZ = p_78087_3_; + this.leftWing.rotateAngleZ = -p_78087_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCow.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCow.java new file mode 100644 index 0000000..32891b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCow.java @@ -0,0 +1,33 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelCow extends ModelQuadruped +{ + private static final String __OBFID = "CL_00000836"; + + public ModelCow() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -4.0F, -6.0F, 8, 8, 6, 0.0F); + this.head.setRotationPoint(0.0F, 4.0F, -8.0F); + this.head.setTextureOffset(22, 0).addBox(-5.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.head.setTextureOffset(22, 0).addBox(4.0F, -5.0F, -4.0F, 1, 3, 1, 0.0F); + this.body = new ModelRenderer(this, 18, 4); + this.body.addBox(-6.0F, -10.0F, -7.0F, 12, 18, 10, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + this.body.setTextureOffset(52, 0).addBox(-2.0F, 2.0F, -8.0F, 4, 6, 1); + --this.leg1.rotationPointX; + ++this.leg2.rotationPointX; + this.leg1.rotationPointZ += 0.0F; + this.leg2.rotationPointZ += 0.0F; + --this.leg3.rotationPointX; + ++this.leg4.rotationPointX; + --this.leg3.rotationPointZ; + --this.leg4.rotationPointZ; + this.field_78151_h += 2.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCreeper.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCreeper.java new file mode 100644 index 0000000..c79e5e6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelCreeper.java @@ -0,0 +1,79 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelCreeper extends ModelBase +{ + public ModelRenderer head; + public ModelRenderer field_78133_b; + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + private static final String __OBFID = "CL_00000837"; + + public ModelCreeper() + { + this(0.0F); + } + + public ModelCreeper(float p_i1147_1_) + { + byte b0 = 4; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1147_1_); + this.head.setRotationPoint(0.0F, (float)b0, 0.0F); + this.field_78133_b = new ModelRenderer(this, 32, 0); + this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1147_1_ + 0.5F); + this.field_78133_b.setRotationPoint(0.0F, (float)b0, 0.0F); + this.body = new ModelRenderer(this, 16, 16); + this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1147_1_); + this.body.setRotationPoint(0.0F, (float)b0, 0.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i1147_1_); + this.leg1.setRotationPoint(-2.0F, (float)(12 + b0), 4.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i1147_1_); + this.leg2.setRotationPoint(2.0F, (float)(12 + b0), 4.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i1147_1_); + this.leg3.setRotationPoint(-2.0F, (float)(12 + b0), -4.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, p_i1147_1_); + this.leg4.setRotationPoint(2.0F, (float)(12 + b0), -4.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.head.render(p_78088_7_); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelDragon.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelDragon.java new file mode 100644 index 0000000..30da1f3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelDragon.java @@ -0,0 +1,256 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityDragon; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelDragon extends ModelBase +{ + /** The head Model renderer of the dragon */ + private ModelRenderer head; + /** The spine Model renderer of the dragon */ + private ModelRenderer spine; + /** The jaw Model renderer of the dragon */ + private ModelRenderer jaw; + /** The body Model renderer of the dragon */ + private ModelRenderer body; + /** The rear leg Model renderer of the dragon */ + private ModelRenderer rearLeg; + /** The front leg Model renderer of the dragon */ + private ModelRenderer frontLeg; + /** The rear leg tip Model renderer of the dragon */ + private ModelRenderer rearLegTip; + /** The front leg tip Model renderer of the dragon */ + private ModelRenderer frontLegTip; + /** The rear foot Model renderer of the dragon */ + private ModelRenderer rearFoot; + /** The front foot Model renderer of the dragon */ + private ModelRenderer frontFoot; + /** The wing Model renderer of the dragon */ + private ModelRenderer wing; + /** The wing tip Model renderer of the dragon */ + private ModelRenderer wingTip; + private float partialTicks; + private static final String __OBFID = "CL_00000870"; + + public ModelDragon(float p_i1169_1_) + { + this.textureWidth = 256; + this.textureHeight = 256; + this.setTextureOffset("body.body", 0, 0); + this.setTextureOffset("wing.skin", -56, 88); + this.setTextureOffset("wingtip.skin", -56, 144); + this.setTextureOffset("rearleg.main", 0, 0); + this.setTextureOffset("rearfoot.main", 112, 0); + this.setTextureOffset("rearlegtip.main", 196, 0); + this.setTextureOffset("head.upperhead", 112, 30); + this.setTextureOffset("wing.bone", 112, 88); + this.setTextureOffset("head.upperlip", 176, 44); + this.setTextureOffset("jaw.jaw", 176, 65); + this.setTextureOffset("frontleg.main", 112, 104); + this.setTextureOffset("wingtip.bone", 112, 136); + this.setTextureOffset("frontfoot.main", 144, 104); + this.setTextureOffset("neck.box", 192, 104); + this.setTextureOffset("frontlegtip.main", 226, 138); + this.setTextureOffset("body.scale", 220, 53); + this.setTextureOffset("head.scale", 0, 0); + this.setTextureOffset("neck.scale", 48, 0); + this.setTextureOffset("head.nostril", 112, 0); + float f1 = -16.0F; + this.head = new ModelRenderer(this, "head"); + this.head.addBox("upperlip", -6.0F, -1.0F, -8.0F + f1, 12, 5, 16); + this.head.addBox("upperhead", -8.0F, -8.0F, 6.0F + f1, 16, 16, 16); + this.head.mirror = true; + this.head.addBox("scale", -5.0F, -12.0F, 12.0F + f1, 2, 4, 6); + this.head.addBox("nostril", -5.0F, -3.0F, -6.0F + f1, 2, 2, 4); + this.head.mirror = false; + this.head.addBox("scale", 3.0F, -12.0F, 12.0F + f1, 2, 4, 6); + this.head.addBox("nostril", 3.0F, -3.0F, -6.0F + f1, 2, 2, 4); + this.jaw = new ModelRenderer(this, "jaw"); + this.jaw.setRotationPoint(0.0F, 4.0F, 8.0F + f1); + this.jaw.addBox("jaw", -6.0F, 0.0F, -16.0F, 12, 4, 16); + this.head.addChild(this.jaw); + this.spine = new ModelRenderer(this, "neck"); + this.spine.addBox("box", -5.0F, -5.0F, -5.0F, 10, 10, 10); + this.spine.addBox("scale", -1.0F, -9.0F, -3.0F, 2, 4, 6); + this.body = new ModelRenderer(this, "body"); + this.body.setRotationPoint(0.0F, 4.0F, 8.0F); + this.body.addBox("body", -12.0F, 0.0F, -16.0F, 24, 24, 64); + this.body.addBox("scale", -1.0F, -6.0F, -10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 10.0F, 2, 6, 12); + this.body.addBox("scale", -1.0F, -6.0F, 30.0F, 2, 6, 12); + this.wing = new ModelRenderer(this, "wing"); + this.wing.setRotationPoint(-12.0F, 5.0F, 2.0F); + this.wing.addBox("bone", -56.0F, -4.0F, -4.0F, 56, 8, 8); + this.wing.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wingTip = new ModelRenderer(this, "wingtip"); + this.wingTip.setRotationPoint(-56.0F, 0.0F, 0.0F); + this.wingTip.addBox("bone", -56.0F, -2.0F, -2.0F, 56, 4, 4); + this.wingTip.addBox("skin", -56.0F, 0.0F, 2.0F, 56, 0, 56); + this.wing.addChild(this.wingTip); + this.frontLeg = new ModelRenderer(this, "frontleg"); + this.frontLeg.setRotationPoint(-12.0F, 20.0F, 2.0F); + this.frontLeg.addBox("main", -4.0F, -4.0F, -4.0F, 8, 24, 8); + this.frontLegTip = new ModelRenderer(this, "frontlegtip"); + this.frontLegTip.setRotationPoint(0.0F, 20.0F, -1.0F); + this.frontLegTip.addBox("main", -3.0F, -1.0F, -3.0F, 6, 24, 6); + this.frontLeg.addChild(this.frontLegTip); + this.frontFoot = new ModelRenderer(this, "frontfoot"); + this.frontFoot.setRotationPoint(0.0F, 23.0F, 0.0F); + this.frontFoot.addBox("main", -4.0F, 0.0F, -12.0F, 8, 4, 16); + this.frontLegTip.addChild(this.frontFoot); + this.rearLeg = new ModelRenderer(this, "rearleg"); + this.rearLeg.setRotationPoint(-16.0F, 16.0F, 42.0F); + this.rearLeg.addBox("main", -8.0F, -4.0F, -8.0F, 16, 32, 16); + this.rearLegTip = new ModelRenderer(this, "rearlegtip"); + this.rearLegTip.setRotationPoint(0.0F, 32.0F, -4.0F); + this.rearLegTip.addBox("main", -6.0F, -2.0F, 0.0F, 12, 32, 12); + this.rearLeg.addChild(this.rearLegTip); + this.rearFoot = new ModelRenderer(this, "rearfoot"); + this.rearFoot.setRotationPoint(0.0F, 31.0F, 4.0F); + this.rearFoot.addBox("main", -9.0F, 0.0F, -20.0F, 18, 6, 24); + this.rearLegTip.addChild(this.rearFoot); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + this.partialTicks = p_78086_4_; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + GL11.glPushMatrix(); + EntityDragon entitydragon = (EntityDragon)p_78088_1_; + float f6 = entitydragon.prevAnimTime + (entitydragon.animTime - entitydragon.prevAnimTime) * this.partialTicks; + this.jaw.rotateAngleX = (float)(Math.sin((double)(f6 * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; + float f7 = (float)(Math.sin((double)(f6 * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); + f7 = (f7 * f7 * 1.0F + f7 * 2.0F) * 0.05F; + GL11.glTranslatef(0.0F, f7 - 2.0F, -3.0F); + GL11.glRotatef(f7 * 2.0F, 1.0F, 0.0F, 0.0F); + float f8 = -30.0F; + float f10 = 0.0F; + float f11 = 1.5F; + double[] adouble = entitydragon.getMovementOffsets(6, this.partialTicks); + float f12 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] - entitydragon.getMovementOffsets(10, this.partialTicks)[0]); + float f13 = this.updateRotations(entitydragon.getMovementOffsets(5, this.partialTicks)[0] + (double)(f12 / 2.0F)); + f8 += 2.0F; + float f14 = f6 * (float)Math.PI * 2.0F; + f8 = 20.0F; + float f9 = -12.0F; + float f15; + + for (int i = 0; i < 5; ++i) + { + double[] adouble1 = entitydragon.getMovementOffsets(5 - i, this.partialTicks); + f15 = (float)Math.cos((double)((float)i * 0.45F + f14)) * 0.15F; + this.spine.rotateAngleY = this.updateRotations(adouble1[0] - adouble[0]) * (float)Math.PI / 180.0F * f11; + this.spine.rotateAngleX = f15 + (float)(adouble1[1] - adouble[1]) * (float)Math.PI / 180.0F * f11 * 5.0F; + this.spine.rotateAngleZ = -this.updateRotations(adouble1[0] - (double)f13) * (float)Math.PI / 180.0F * f11; + this.spine.rotationPointY = f8; + this.spine.rotationPointZ = f9; + this.spine.rotationPointX = f10; + f8 = (float)((double)f8 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + f9 = (float)((double)f9 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + f10 = (float)((double)f10 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + this.spine.render(p_78088_7_); + } + + this.head.rotationPointY = f8; + this.head.rotationPointZ = f9; + this.head.rotationPointX = f10; + double[] adouble2 = entitydragon.getMovementOffsets(0, this.partialTicks); + this.head.rotateAngleY = this.updateRotations(adouble2[0] - adouble[0]) * (float)Math.PI / 180.0F * 1.0F; + this.head.rotateAngleZ = -this.updateRotations(adouble2[0] - (double)f13) * (float)Math.PI / 180.0F * 1.0F; + this.head.render(p_78088_7_); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f12 * f11 * 1.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -1.0F, 0.0F); + this.body.rotateAngleZ = 0.0F; + this.body.render(p_78088_7_); + + for (int j = 0; j < 2; ++j) + { + GL11.glEnable(GL11.GL_CULL_FACE); + f15 = f6 * (float)Math.PI * 2.0F; + this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)f15) * 0.2F; + this.wing.rotateAngleY = 0.25F; + this.wing.rotateAngleZ = (float)(Math.sin((double)f15) + 0.125D) * 0.8F; + this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(f15 + 2.0F)) + 0.5D)) * 0.75F; + this.rearLeg.rotateAngleX = 1.0F + f7 * 0.1F; + this.rearLegTip.rotateAngleX = 0.5F + f7 * 0.1F; + this.rearFoot.rotateAngleX = 0.75F + f7 * 0.1F; + this.frontLeg.rotateAngleX = 1.3F + f7 * 0.1F; + this.frontLegTip.rotateAngleX = -0.5F - f7 * 0.1F; + this.frontFoot.rotateAngleX = 0.75F + f7 * 0.1F; + this.wing.render(p_78088_7_); + this.frontLeg.render(p_78088_7_); + this.rearLeg.render(p_78088_7_); + GL11.glScalef(-1.0F, 1.0F, 1.0F); + + if (j == 0) + { + GL11.glCullFace(GL11.GL_FRONT); + } + } + + GL11.glPopMatrix(); + GL11.glCullFace(GL11.GL_BACK); + GL11.glDisable(GL11.GL_CULL_FACE); + float f16 = -((float)Math.sin((double)(f6 * (float)Math.PI * 2.0F))) * 0.0F; + f14 = f6 * (float)Math.PI * 2.0F; + f8 = 10.0F; + f9 = 60.0F; + f10 = 0.0F; + adouble = entitydragon.getMovementOffsets(11, this.partialTicks); + + for (int k = 0; k < 12; ++k) + { + adouble2 = entitydragon.getMovementOffsets(12 + k, this.partialTicks); + f16 = (float)((double)f16 + Math.sin((double)((float)k * 0.45F + f14)) * 0.05000000074505806D); + this.spine.rotateAngleY = (this.updateRotations(adouble2[0] - adouble[0]) * f11 + 180.0F) * (float)Math.PI / 180.0F; + this.spine.rotateAngleX = f16 + (float)(adouble2[1] - adouble[1]) * (float)Math.PI / 180.0F * f11 * 5.0F; + this.spine.rotateAngleZ = this.updateRotations(adouble2[0] - (double)f13) * (float)Math.PI / 180.0F * f11; + this.spine.rotationPointY = f8; + this.spine.rotationPointZ = f9; + this.spine.rotationPointX = f10; + f8 = (float)((double)f8 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + f9 = (float)((double)f9 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + f10 = (float)((double)f10 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + this.spine.render(p_78088_7_); + } + + GL11.glPopMatrix(); + } + + /** + * Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds + * or subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range - + * 180 to 180 + */ + private float updateRotations(double p_78214_1_) + { + while (p_78214_1_ >= 180.0D) + { + p_78214_1_ -= 360.0D; + } + + while (p_78214_1_ < -180.0D) + { + p_78214_1_ += 360.0D; + } + + return (float)p_78214_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderCrystal.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderCrystal.java new file mode 100644 index 0000000..5c471cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderCrystal.java @@ -0,0 +1,61 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelEnderCrystal extends ModelBase +{ + /** The cube model for the Ender Crystal. */ + private ModelRenderer cube; + /** The glass model for the Ender Crystal. */ + private ModelRenderer glass = new ModelRenderer(this, "glass"); + /** The base model for the Ender Crystal. */ + private ModelRenderer base; + private static final String __OBFID = "CL_00000871"; + + public ModelEnderCrystal(float p_i1170_1_, boolean p_i1170_2_) + { + this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.cube = new ModelRenderer(this, "cube"); + this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + + if (p_i1170_2_) + { + this.base = new ModelRenderer(this, "base"); + this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); + + if (this.base != null) + { + this.base.render(p_78088_7_); + } + + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.8F + p_78088_4_, 0.0F); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + this.glass.render(p_78088_7_); + float f6 = 0.875F; + GL11.glScalef(f6, f6, f6); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.glass.render(p_78088_7_); + GL11.glScalef(f6, f6, f6); + GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); + GL11.glRotatef(p_78088_3_, 0.0F, 1.0F, 0.0F); + this.cube.render(p_78088_7_); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderman.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderman.java new file mode 100644 index 0000000..d5fa75a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelEnderman.java @@ -0,0 +1,133 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelEnderman extends ModelBiped +{ + /** Is the enderman carrying a block? */ + public boolean isCarrying; + /** Is the enderman attacking an entity? */ + public boolean isAttacking; + private static final String __OBFID = "CL_00000838"; + + public ModelEnderman() + { + super(0.0F, -14.0F, 64, 32); + float f = -14.0F; + float f1 = 0.0F; + this.bipedHeadwear = new ModelRenderer(this, 0, 16); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, f1 - 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.bipedBody = new ModelRenderer(this, 32, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, f1); + this.bipedBody.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 56, 0); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, f1); + this.bipedRightArm.setRotationPoint(-3.0F, 2.0F + f, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 56, 0); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 30, 2, f1); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + f, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 56, 0); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, f1); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F + f, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 56, 0); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 30, 2, f1); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + f, 0.0F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.bipedHead.showModel = true; + float f6 = -14.0F; + this.bipedBody.rotateAngleX = 0.0F; + this.bipedBody.rotationPointY = f6; + this.bipedBody.rotationPointZ = -0.0F; + this.bipedRightLeg.rotateAngleX -= 0.0F; + this.bipedLeftLeg.rotateAngleX -= 0.0F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX * 0.5D); + this.bipedLeftArm.rotateAngleX = (float)((double)this.bipedLeftArm.rotateAngleX * 0.5D); + this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); + this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); + float f7 = 0.4F; + + if (this.bipedRightArm.rotateAngleX > f7) + { + this.bipedRightArm.rotateAngleX = f7; + } + + if (this.bipedLeftArm.rotateAngleX > f7) + { + this.bipedLeftArm.rotateAngleX = f7; + } + + if (this.bipedRightArm.rotateAngleX < -f7) + { + this.bipedRightArm.rotateAngleX = -f7; + } + + if (this.bipedLeftArm.rotateAngleX < -f7) + { + this.bipedLeftArm.rotateAngleX = -f7; + } + + if (this.bipedRightLeg.rotateAngleX > f7) + { + this.bipedRightLeg.rotateAngleX = f7; + } + + if (this.bipedLeftLeg.rotateAngleX > f7) + { + this.bipedLeftLeg.rotateAngleX = f7; + } + + if (this.bipedRightLeg.rotateAngleX < -f7) + { + this.bipedRightLeg.rotateAngleX = -f7; + } + + if (this.bipedLeftLeg.rotateAngleX < -f7) + { + this.bipedLeftLeg.rotateAngleX = -f7; + } + + if (this.isCarrying) + { + this.bipedRightArm.rotateAngleX = -0.5F; + this.bipedLeftArm.rotateAngleX = -0.5F; + this.bipedRightArm.rotateAngleZ = 0.05F; + this.bipedLeftArm.rotateAngleZ = -0.05F; + } + + this.bipedRightArm.rotationPointZ = 0.0F; + this.bipedLeftArm.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.0F; + this.bipedLeftLeg.rotationPointZ = 0.0F; + this.bipedRightLeg.rotationPointY = 9.0F + f6; + this.bipedLeftLeg.rotationPointY = 9.0F + f6; + this.bipedHead.rotationPointZ = -0.0F; + this.bipedHead.rotationPointY = f6 + 1.0F; + this.bipedHeadwear.rotationPointX = this.bipedHead.rotationPointX; + this.bipedHeadwear.rotationPointY = this.bipedHead.rotationPointY; + this.bipedHeadwear.rotationPointZ = this.bipedHead.rotationPointZ; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; + + if (this.isAttacking) + { + float f8 = 1.0F; + this.bipedHead.rotationPointY -= f8 * 5.0F; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelGhast.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelGhast.java new file mode 100644 index 0000000..6760442 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelGhast.java @@ -0,0 +1,71 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelGhast extends ModelBase +{ + ModelRenderer body; + ModelRenderer[] tentacles = new ModelRenderer[9]; + private static final String __OBFID = "CL_00000839"; + + public ModelGhast() + { + byte b0 = -16; + this.body = new ModelRenderer(this, 0, 0); + this.body.addBox(-8.0F, -8.0F, -8.0F, 16, 16, 16); + this.body.rotationPointY += (float)(24 + b0); + Random random = new Random(1660L); + + for (int i = 0; i < this.tentacles.length; ++i) + { + this.tentacles[i] = new ModelRenderer(this, 0, 0); + float f = (((float)(i % 3) - (float)(i / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; + float f1 = ((float)(i / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; + int j = random.nextInt(7) + 8; + this.tentacles[i].addBox(-1.0F, 0.0F, -1.0F, 2, j, 2); + this.tentacles[i].rotationPointX = f; + this.tentacles[i].rotationPointZ = f1; + this.tentacles[i].rotationPointY = (float)(31 + b0); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + for (int i = 0; i < this.tentacles.length; ++i) + { + this.tentacles[i].rotateAngleX = 0.2F * MathHelper.sin(p_78087_3_ * 0.3F + (float)i) + 0.4F; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.6F, 0.0F); + this.body.render(p_78088_7_); + ModelRenderer[] amodelrenderer = this.tentacles; + int i = amodelrenderer.length; + + for (int j = 0; j < i; ++j) + { + ModelRenderer modelrenderer = amodelrenderer[j]; + modelrenderer.render(p_78088_7_); + } + + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelHorse.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelHorse.java new file mode 100644 index 0000000..cec8a71 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelHorse.java @@ -0,0 +1,570 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelHorse extends ModelBase +{ + private ModelRenderer head; + private ModelRenderer mouthTop; + private ModelRenderer mouthBottom; + private ModelRenderer horseLeftEar; + private ModelRenderer horseRightEar; + /** The left ear box for the mule model. */ + private ModelRenderer muleLeftEar; + /** The right ear box for the mule model. */ + private ModelRenderer muleRightEar; + private ModelRenderer neck; + /** The box for the horse's ropes on its face. */ + private ModelRenderer horseFaceRopes; + private ModelRenderer mane; + private ModelRenderer body; + private ModelRenderer tailBase; + private ModelRenderer tailMiddle; + private ModelRenderer tailTip; + private ModelRenderer backLeftLeg; + private ModelRenderer backLeftShin; + private ModelRenderer backLeftHoof; + private ModelRenderer backRightLeg; + private ModelRenderer backRightShin; + private ModelRenderer backRightHoof; + private ModelRenderer frontLeftLeg; + private ModelRenderer frontLeftShin; + private ModelRenderer frontLeftHoof; + private ModelRenderer frontRightLeg; + private ModelRenderer frontRightShin; + private ModelRenderer frontRightHoof; + /** The left chest box on the mule model. */ + private ModelRenderer muleLeftChest; + /** The right chest box on the mule model. */ + private ModelRenderer muleRightChest; + private ModelRenderer horseSaddleBottom; + private ModelRenderer horseSaddleFront; + private ModelRenderer horseSaddleBack; + private ModelRenderer horseLeftSaddleRope; + private ModelRenderer horseLeftSaddleMetal; + private ModelRenderer horseRightSaddleRope; + private ModelRenderer horseRightSaddleMetal; + /** The left metal connected to the horse's face ropes. */ + private ModelRenderer horseLeftFaceMetal; + /** The right metal connected to the horse's face ropes. */ + private ModelRenderer horseRightFaceMetal; + private ModelRenderer horseLeftRein; + private ModelRenderer horseRightRein; + private static final String __OBFID = "CL_00000846"; + + public ModelHorse() + { + this.textureWidth = 128; + this.textureHeight = 128; + this.body = new ModelRenderer(this, 0, 34); + this.body.addBox(-5.0F, -8.0F, -19.0F, 10, 10, 24); + this.body.setRotationPoint(0.0F, 11.0F, 9.0F); + this.tailBase = new ModelRenderer(this, 44, 0); + this.tailBase.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 3); + this.tailBase.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailBase, -1.134464F, 0.0F, 0.0F); + this.tailMiddle = new ModelRenderer(this, 38, 7); + this.tailMiddle.addBox(-1.5F, -2.0F, 3.0F, 3, 4, 7); + this.tailMiddle.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailMiddle, -1.134464F, 0.0F, 0.0F); + this.tailTip = new ModelRenderer(this, 24, 3); + this.tailTip.addBox(-1.5F, -4.5F, 9.0F, 3, 4, 7); + this.tailTip.setRotationPoint(0.0F, 3.0F, 14.0F); + this.setBoxRotation(this.tailTip, -1.40215F, 0.0F, 0.0F); + this.backLeftLeg = new ModelRenderer(this, 78, 29); + this.backLeftLeg.addBox(-2.5F, -2.0F, -2.5F, 4, 9, 5); + this.backLeftLeg.setRotationPoint(4.0F, 9.0F, 11.0F); + this.backLeftShin = new ModelRenderer(this, 78, 43); + this.backLeftShin.addBox(-2.0F, 0.0F, -1.5F, 3, 5, 3); + this.backLeftShin.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backLeftHoof = new ModelRenderer(this, 78, 51); + this.backLeftHoof.addBox(-2.5F, 5.1F, -2.0F, 4, 3, 4); + this.backLeftHoof.setRotationPoint(4.0F, 16.0F, 11.0F); + this.backRightLeg = new ModelRenderer(this, 96, 29); + this.backRightLeg.addBox(-1.5F, -2.0F, -2.5F, 4, 9, 5); + this.backRightLeg.setRotationPoint(-4.0F, 9.0F, 11.0F); + this.backRightShin = new ModelRenderer(this, 96, 43); + this.backRightShin.addBox(-1.0F, 0.0F, -1.5F, 3, 5, 3); + this.backRightShin.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.backRightHoof = new ModelRenderer(this, 96, 51); + this.backRightHoof.addBox(-1.5F, 5.1F, -2.0F, 4, 3, 4); + this.backRightHoof.setRotationPoint(-4.0F, 16.0F, 11.0F); + this.frontLeftLeg = new ModelRenderer(this, 44, 29); + this.frontLeftLeg.addBox(-1.9F, -1.0F, -2.1F, 3, 8, 4); + this.frontLeftLeg.setRotationPoint(4.0F, 9.0F, -8.0F); + this.frontLeftShin = new ModelRenderer(this, 44, 41); + this.frontLeftShin.addBox(-1.9F, 0.0F, -1.6F, 3, 5, 3); + this.frontLeftShin.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontLeftHoof = new ModelRenderer(this, 44, 51); + this.frontLeftHoof.addBox(-2.4F, 5.1F, -2.1F, 4, 3, 4); + this.frontLeftHoof.setRotationPoint(4.0F, 16.0F, -8.0F); + this.frontRightLeg = new ModelRenderer(this, 60, 29); + this.frontRightLeg.addBox(-1.1F, -1.0F, -2.1F, 3, 8, 4); + this.frontRightLeg.setRotationPoint(-4.0F, 9.0F, -8.0F); + this.frontRightShin = new ModelRenderer(this, 60, 41); + this.frontRightShin.addBox(-1.1F, 0.0F, -1.6F, 3, 5, 3); + this.frontRightShin.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.frontRightHoof = new ModelRenderer(this, 60, 51); + this.frontRightHoof.addBox(-1.6F, 5.1F, -2.1F, 4, 3, 4); + this.frontRightHoof.setRotationPoint(-4.0F, 16.0F, -8.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-2.5F, -10.0F, -1.5F, 5, 5, 7); + this.head.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.head, 0.5235988F, 0.0F, 0.0F); + this.mouthTop = new ModelRenderer(this, 24, 18); + this.mouthTop.addBox(-2.0F, -10.0F, -7.0F, 4, 3, 6); + this.mouthTop.setRotationPoint(0.0F, 3.95F, -10.0F); + this.setBoxRotation(this.mouthTop, 0.5235988F, 0.0F, 0.0F); + this.mouthBottom = new ModelRenderer(this, 24, 27); + this.mouthBottom.addBox(-2.0F, -7.0F, -6.5F, 4, 2, 5); + this.mouthBottom.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.mouthBottom, 0.5235988F, 0.0F, 0.0F); + this.head.addChild(this.mouthTop); + this.head.addChild(this.mouthBottom); + this.horseLeftEar = new ModelRenderer(this, 0, 0); + this.horseLeftEar.addBox(0.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftEar, 0.5235988F, 0.0F, 0.0F); + this.horseRightEar = new ModelRenderer(this, 0, 0); + this.horseRightEar.addBox(-2.45F, -12.0F, 4.0F, 2, 3, 1); + this.horseRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightEar, 0.5235988F, 0.0F, 0.0F); + this.muleLeftEar = new ModelRenderer(this, 0, 12); + this.muleLeftEar.addBox(-2.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleLeftEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleLeftEar, 0.5235988F, 0.0F, 0.2617994F); + this.muleRightEar = new ModelRenderer(this, 0, 12); + this.muleRightEar.addBox(0.0F, -16.0F, 4.0F, 2, 7, 1); + this.muleRightEar.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.muleRightEar, 0.5235988F, 0.0F, -0.2617994F); + this.neck = new ModelRenderer(this, 0, 12); + this.neck.addBox(-2.05F, -9.8F, -2.0F, 4, 14, 8); + this.neck.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.neck, 0.5235988F, 0.0F, 0.0F); + this.muleLeftChest = new ModelRenderer(this, 0, 34); + this.muleLeftChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleLeftChest.setRotationPoint(-7.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleLeftChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.muleRightChest = new ModelRenderer(this, 0, 47); + this.muleRightChest.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.muleRightChest.setRotationPoint(4.5F, 3.0F, 10.0F); + this.setBoxRotation(this.muleRightChest, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.horseSaddleBottom = new ModelRenderer(this, 80, 0); + this.horseSaddleBottom.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); + this.horseSaddleBottom.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleFront = new ModelRenderer(this, 106, 9); + this.horseSaddleFront.addBox(-1.5F, -1.0F, -3.0F, 3, 1, 2); + this.horseSaddleFront.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseSaddleBack = new ModelRenderer(this, 80, 9); + this.horseSaddleBack.addBox(-4.0F, -1.0F, 3.0F, 8, 1, 2); + this.horseSaddleBack.setRotationPoint(0.0F, 2.0F, 2.0F); + this.horseLeftSaddleMetal = new ModelRenderer(this, 74, 0); + this.horseLeftSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseLeftSaddleMetal.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseLeftSaddleRope = new ModelRenderer(this, 70, 0); + this.horseLeftSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseLeftSaddleRope.setRotationPoint(5.0F, 3.0F, 2.0F); + this.horseRightSaddleMetal = new ModelRenderer(this, 74, 4); + this.horseRightSaddleMetal.addBox(-0.5F, 6.0F, -1.0F, 1, 2, 2); + this.horseRightSaddleMetal.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseRightSaddleRope = new ModelRenderer(this, 80, 0); + this.horseRightSaddleRope.addBox(-0.5F, 0.0F, -0.5F, 1, 6, 1); + this.horseRightSaddleRope.setRotationPoint(-5.0F, 3.0F, 2.0F); + this.horseLeftFaceMetal = new ModelRenderer(this, 74, 13); + this.horseLeftFaceMetal.addBox(1.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseLeftFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseLeftFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseRightFaceMetal = new ModelRenderer(this, 74, 13); + this.horseRightFaceMetal.addBox(-2.5F, -8.0F, -4.0F, 1, 2, 2); + this.horseRightFaceMetal.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseRightFaceMetal, 0.5235988F, 0.0F, 0.0F); + this.horseLeftRein = new ModelRenderer(this, 44, 10); + this.horseLeftRein.addBox(2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseLeftRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.horseRightRein = new ModelRenderer(this, 44, 5); + this.horseRightRein.addBox(-2.6F, -6.0F, -6.0F, 0, 3, 16); + this.horseRightRein.setRotationPoint(0.0F, 4.0F, -10.0F); + this.mane = new ModelRenderer(this, 58, 0); + this.mane.addBox(-1.0F, -11.5F, 5.0F, 2, 16, 4); + this.mane.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.mane, 0.5235988F, 0.0F, 0.0F); + this.horseFaceRopes = new ModelRenderer(this, 80, 12); + this.horseFaceRopes.addBox(-2.5F, -10.1F, -7.0F, 5, 5, 12, 0.2F); + this.horseFaceRopes.setRotationPoint(0.0F, 4.0F, -10.0F); + this.setBoxRotation(this.horseFaceRopes, 0.5235988F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + EntityHorse entityhorse = (EntityHorse)p_78088_1_; + int i = entityhorse.getHorseType(); + float f6 = entityhorse.getGrassEatingAmount(0.0F); + boolean flag = entityhorse.isAdultHorse(); + boolean flag1 = flag && entityhorse.isHorseSaddled(); + boolean flag2 = flag && entityhorse.isChested(); + boolean flag3 = i == 1 || i == 2; + float f7 = entityhorse.getHorseSize(); + boolean flag4 = entityhorse.riddenByEntity != null; + + if (flag1) + { + this.horseFaceRopes.render(p_78088_7_); + this.horseSaddleBottom.render(p_78088_7_); + this.horseSaddleFront.render(p_78088_7_); + this.horseSaddleBack.render(p_78088_7_); + this.horseLeftSaddleRope.render(p_78088_7_); + this.horseLeftSaddleMetal.render(p_78088_7_); + this.horseRightSaddleRope.render(p_78088_7_); + this.horseRightSaddleMetal.render(p_78088_7_); + this.horseLeftFaceMetal.render(p_78088_7_); + this.horseRightFaceMetal.render(p_78088_7_); + + if (flag4) + { + this.horseLeftRein.render(p_78088_7_); + this.horseRightRein.render(p_78088_7_); + } + } + + if (!flag) + { + GL11.glPushMatrix(); + GL11.glScalef(f7, 0.5F + f7 * 0.5F, f7); + GL11.glTranslatef(0.0F, 0.95F * (1.0F - f7), 0.0F); + } + + this.backLeftLeg.render(p_78088_7_); + this.backLeftShin.render(p_78088_7_); + this.backLeftHoof.render(p_78088_7_); + this.backRightLeg.render(p_78088_7_); + this.backRightShin.render(p_78088_7_); + this.backRightHoof.render(p_78088_7_); + this.frontLeftLeg.render(p_78088_7_); + this.frontLeftShin.render(p_78088_7_); + this.frontLeftHoof.render(p_78088_7_); + this.frontRightLeg.render(p_78088_7_); + this.frontRightShin.render(p_78088_7_); + this.frontRightHoof.render(p_78088_7_); + + if (!flag) + { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f7, f7, f7); + GL11.glTranslatef(0.0F, 1.35F * (1.0F - f7), 0.0F); + } + + this.body.render(p_78088_7_); + this.tailBase.render(p_78088_7_); + this.tailMiddle.render(p_78088_7_); + this.tailTip.render(p_78088_7_); + this.neck.render(p_78088_7_); + this.mane.render(p_78088_7_); + + if (!flag) + { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + float f8 = 0.5F + f7 * f7 * 0.5F; + GL11.glScalef(f8, f8, f8); + + if (f6 <= 0.0F) + { + GL11.glTranslatef(0.0F, 1.35F * (1.0F - f7), 0.0F); + } + else + { + GL11.glTranslatef(0.0F, 0.9F * (1.0F - f7) * f6 + 1.35F * (1.0F - f7) * (1.0F - f6), 0.15F * (1.0F - f7) * f6); + } + } + + if (flag3) + { + this.muleLeftEar.render(p_78088_7_); + this.muleRightEar.render(p_78088_7_); + } + else + { + this.horseLeftEar.render(p_78088_7_); + this.horseRightEar.render(p_78088_7_); + } + + this.head.render(p_78088_7_); + + if (!flag) + { + GL11.glPopMatrix(); + } + + if (flag2) + { + this.muleLeftChest.render(p_78088_7_); + this.muleRightChest.render(p_78088_7_); + } + } + + /** + * Sets the rotations for a ModelRenderer in the ModelHorse class. + */ + private void setBoxRotation(ModelRenderer p_110682_1_, float p_110682_2_, float p_110682_3_, float p_110682_4_) + { + p_110682_1_.rotateAngleX = p_110682_2_; + p_110682_1_.rotateAngleY = p_110682_3_; + p_110682_1_.rotateAngleZ = p_110682_4_; + } + + /** + * Fixes and offsets a rotation in the ModelHorse class. + */ + private float updateHorseRotation(float p_110683_1_, float p_110683_2_, float p_110683_3_) + { + float f3; + + for (f3 = p_110683_2_ - p_110683_1_; f3 < -180.0F; f3 += 360.0F) + { + ; + } + + while (f3 >= 180.0F) + { + f3 -= 360.0F; + } + + return p_110683_1_ + p_110683_3_ * f3; + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + float f3 = this.updateHorseRotation(p_78086_1_.prevRenderYawOffset, p_78086_1_.renderYawOffset, p_78086_4_); + float f4 = this.updateHorseRotation(p_78086_1_.prevRotationYawHead, p_78086_1_.rotationYawHead, p_78086_4_); + float f5 = p_78086_1_.prevRotationPitch + (p_78086_1_.rotationPitch - p_78086_1_.prevRotationPitch) * p_78086_4_; + float f6 = f4 - f3; + float f7 = f5 / (180F / (float)Math.PI); + + if (f6 > 20.0F) + { + f6 = 20.0F; + } + + if (f6 < -20.0F) + { + f6 = -20.0F; + } + + if (p_78086_3_ > 0.2F) + { + f7 += MathHelper.cos(p_78086_2_ * 0.4F) * 0.15F * p_78086_3_; + } + + EntityHorse entityhorse = (EntityHorse)p_78086_1_; + float f8 = entityhorse.getGrassEatingAmount(p_78086_4_); + float f9 = entityhorse.getRearingAmount(p_78086_4_); + float f10 = 1.0F - f9; + float f11 = entityhorse.func_110201_q(p_78086_4_); + boolean flag = entityhorse.field_110278_bp != 0; + boolean flag1 = entityhorse.isHorseSaddled(); + boolean flag2 = entityhorse.riddenByEntity != null; + float f12 = (float)p_78086_1_.ticksExisted + p_78086_4_; + float f13 = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI); + float f14 = f13 * 0.8F * p_78086_3_; + this.head.rotationPointY = 4.0F; + this.head.rotationPointZ = -10.0F; + this.tailBase.rotationPointY = 3.0F; + this.tailMiddle.rotationPointZ = 14.0F; + this.muleRightChest.rotationPointY = 3.0F; + this.muleRightChest.rotationPointZ = 10.0F; + this.body.rotateAngleX = 0.0F; + this.head.rotateAngleX = 0.5235988F + f7; + this.head.rotateAngleY = f6 / (180F / (float)Math.PI); + this.head.rotateAngleX = f9 * (0.2617994F + f7) + f8 * 2.18166F + (1.0F - Math.max(f9, f8)) * this.head.rotateAngleX; + this.head.rotateAngleY = f9 * (f6 / (180F / (float)Math.PI)) + (1.0F - Math.max(f9, f8)) * this.head.rotateAngleY; + this.head.rotationPointY = f9 * -6.0F + f8 * 11.0F + (1.0F - Math.max(f9, f8)) * this.head.rotationPointY; + this.head.rotationPointZ = f9 * -1.0F + f8 * -10.0F + (1.0F - Math.max(f9, f8)) * this.head.rotationPointZ; + this.tailBase.rotationPointY = f9 * 9.0F + f10 * this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = f9 * 18.0F + f10 * this.tailMiddle.rotationPointZ; + this.muleRightChest.rotationPointY = f9 * 5.5F + f10 * this.muleRightChest.rotationPointY; + this.muleRightChest.rotationPointZ = f9 * 15.0F + f10 * this.muleRightChest.rotationPointZ; + this.body.rotateAngleX = f9 * -((float)Math.PI / 4F) + f10 * this.body.rotateAngleX; + this.horseLeftEar.rotationPointY = this.head.rotationPointY; + this.horseRightEar.rotationPointY = this.head.rotationPointY; + this.muleLeftEar.rotationPointY = this.head.rotationPointY; + this.muleRightEar.rotationPointY = this.head.rotationPointY; + this.neck.rotationPointY = this.head.rotationPointY; + this.mouthTop.rotationPointY = 0.02F; + this.mouthBottom.rotationPointY = 0.0F; + this.mane.rotationPointY = this.head.rotationPointY; + this.horseLeftEar.rotationPointZ = this.head.rotationPointZ; + this.horseRightEar.rotationPointZ = this.head.rotationPointZ; + this.muleLeftEar.rotationPointZ = this.head.rotationPointZ; + this.muleRightEar.rotationPointZ = this.head.rotationPointZ; + this.neck.rotationPointZ = this.head.rotationPointZ; + this.mouthTop.rotationPointZ = 0.02F - f11 * 1.0F; + this.mouthBottom.rotationPointZ = 0.0F + f11 * 1.0F; + this.mane.rotationPointZ = this.head.rotationPointZ; + this.horseLeftEar.rotateAngleX = this.head.rotateAngleX; + this.horseRightEar.rotateAngleX = this.head.rotateAngleX; + this.muleLeftEar.rotateAngleX = this.head.rotateAngleX; + this.muleRightEar.rotateAngleX = this.head.rotateAngleX; + this.neck.rotateAngleX = this.head.rotateAngleX; + this.mouthTop.rotateAngleX = 0.0F - 0.09424778F * f11; + this.mouthBottom.rotateAngleX = 0.0F + 0.15707964F * f11; + this.mane.rotateAngleX = this.head.rotateAngleX; + this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; + this.horseRightEar.rotateAngleY = this.head.rotateAngleY; + this.muleLeftEar.rotateAngleY = this.head.rotateAngleY; + this.muleRightEar.rotateAngleY = this.head.rotateAngleY; + this.neck.rotateAngleY = this.head.rotateAngleY; + this.mouthTop.rotateAngleY = 0.0F; + this.mouthBottom.rotateAngleY = 0.0F; + this.mane.rotateAngleY = this.head.rotateAngleY; + this.muleLeftChest.rotateAngleX = f14 / 5.0F; + this.muleRightChest.rotateAngleX = -f14 / 5.0F; + float f15 = ((float)Math.PI / 2F); + float f16 = ((float)Math.PI * 3F / 2F); + float f17 = -1.0471976F; + float f18 = 0.2617994F * f9; + float f19 = MathHelper.cos(f12 * 0.6F + (float)Math.PI); + this.frontLeftLeg.rotationPointY = -2.0F * f9 + 9.0F * f10; + this.frontLeftLeg.rotationPointZ = -2.0F * f9 + -8.0F * f10; + this.frontRightLeg.rotationPointY = this.frontLeftLeg.rotationPointY; + this.frontRightLeg.rotationPointZ = this.frontLeftLeg.rotationPointZ; + this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f18 + f10 * -f13 * 0.5F * p_78086_3_) * 7.0F; + this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f18 + f10 * -f13 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f18 + f10 * f13 * 0.5F * p_78086_3_) * 7.0F; + this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f18 + f10 * f13 * 0.5F * p_78086_3_) * 7.0F; + float f20 = (-1.0471976F + f19) * f9 + f14 * f10; + float f21 = (-1.0471976F + -f19) * f9 + -f14 * f10; + this.frontLeftShin.rotationPointY = this.frontLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f20) * 7.0F; + this.frontLeftShin.rotationPointZ = this.frontLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f20) * 7.0F; + this.frontRightShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + f21) * 7.0F; + this.frontRightShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + f21) * 7.0F; + this.backLeftLeg.rotateAngleX = f18 + -f13 * 0.5F * p_78086_3_ * f10; + this.backLeftShin.rotateAngleX = -0.08726646F * f9 + (-f13 * 0.5F * p_78086_3_ - Math.max(0.0F, f13 * 0.5F * p_78086_3_)) * f10; + this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; + this.backRightLeg.rotateAngleX = f18 + f13 * 0.5F * p_78086_3_ * f10; + this.backRightShin.rotateAngleX = -0.08726646F * f9 + (f13 * 0.5F * p_78086_3_ - Math.max(0.0F, -f13 * 0.5F * p_78086_3_)) * f10; + this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; + this.frontLeftLeg.rotateAngleX = f20; + this.frontLeftShin.rotateAngleX = (this.frontLeftLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + f19 * 0.2F)) * f9 + (f14 + Math.max(0.0F, f13 * 0.5F * p_78086_3_)) * f10; + this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; + this.frontRightLeg.rotateAngleX = f21; + this.frontRightShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - f19 * 0.2F)) * f9 + (-f14 + Math.max(0.0F, -f13 * 0.5F * p_78086_3_)) * f10; + this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; + this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; + this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; + this.backRightHoof.rotationPointY = this.backRightShin.rotationPointY; + this.backRightHoof.rotationPointZ = this.backRightShin.rotationPointZ; + this.frontLeftHoof.rotationPointY = this.frontLeftShin.rotationPointY; + this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; + this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; + this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; + + if (flag1) + { + this.horseSaddleBottom.rotationPointY = f9 * 0.5F + f10 * 2.0F; + this.horseSaddleBottom.rotationPointZ = f9 * 11.0F + f10 * 2.0F; + this.horseSaddleFront.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseSaddleBack.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleRope.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseLeftSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.horseRightSaddleMetal.rotationPointY = this.horseSaddleBottom.rotationPointY; + this.muleLeftChest.rotationPointY = this.muleRightChest.rotationPointY; + this.horseSaddleFront.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseSaddleBack.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleRope.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseLeftSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.horseRightSaddleMetal.rotationPointZ = this.horseSaddleBottom.rotationPointZ; + this.muleLeftChest.rotationPointZ = this.muleRightChest.rotationPointZ; + this.horseSaddleBottom.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleFront.rotateAngleX = this.body.rotateAngleX; + this.horseSaddleBack.rotateAngleX = this.body.rotateAngleX; + this.horseLeftRein.rotationPointY = this.head.rotationPointY; + this.horseRightRein.rotationPointY = this.head.rotationPointY; + this.horseFaceRopes.rotationPointY = this.head.rotationPointY; + this.horseLeftFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseRightFaceMetal.rotationPointY = this.head.rotationPointY; + this.horseLeftRein.rotationPointZ = this.head.rotationPointZ; + this.horseRightRein.rotationPointZ = this.head.rotationPointZ; + this.horseFaceRopes.rotationPointZ = this.head.rotationPointZ; + this.horseLeftFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseRightFaceMetal.rotationPointZ = this.head.rotationPointZ; + this.horseLeftRein.rotateAngleX = f7; + this.horseRightRein.rotateAngleX = f7; + this.horseFaceRopes.rotateAngleX = this.head.rotateAngleX; + this.horseLeftFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseRightFaceMetal.rotateAngleX = this.head.rotateAngleX; + this.horseFaceRopes.rotateAngleY = this.head.rotateAngleY; + this.horseLeftFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseLeftRein.rotateAngleY = this.head.rotateAngleY; + this.horseRightFaceMetal.rotateAngleY = this.head.rotateAngleY; + this.horseRightRein.rotateAngleY = this.head.rotateAngleY; + + if (flag2) + { + this.horseLeftSaddleRope.rotateAngleX = -1.0471976F; + this.horseLeftSaddleMetal.rotateAngleX = -1.0471976F; + this.horseRightSaddleRope.rotateAngleX = -1.0471976F; + this.horseRightSaddleMetal.rotateAngleX = -1.0471976F; + this.horseLeftSaddleRope.rotateAngleZ = 0.0F; + this.horseLeftSaddleMetal.rotateAngleZ = 0.0F; + this.horseRightSaddleRope.rotateAngleZ = 0.0F; + this.horseRightSaddleMetal.rotateAngleZ = 0.0F; + } + else + { + this.horseLeftSaddleRope.rotateAngleX = f14 / 3.0F; + this.horseLeftSaddleMetal.rotateAngleX = f14 / 3.0F; + this.horseRightSaddleRope.rotateAngleX = f14 / 3.0F; + this.horseRightSaddleMetal.rotateAngleX = f14 / 3.0F; + this.horseLeftSaddleRope.rotateAngleZ = f14 / 5.0F; + this.horseLeftSaddleMetal.rotateAngleZ = f14 / 5.0F; + this.horseRightSaddleRope.rotateAngleZ = -f14 / 5.0F; + this.horseRightSaddleMetal.rotateAngleZ = -f14 / 5.0F; + } + } + + f15 = -1.3089F + p_78086_3_ * 1.5F; + + if (f15 > 0.0F) + { + f15 = 0.0F; + } + + if (flag) + { + this.tailBase.rotateAngleY = MathHelper.cos(f12 * 0.7F); + f15 = 0.0F; + } + else + { + this.tailBase.rotateAngleY = 0.0F; + } + + this.tailMiddle.rotateAngleY = this.tailBase.rotateAngleY; + this.tailTip.rotateAngleY = this.tailBase.rotateAngleY; + this.tailMiddle.rotationPointY = this.tailBase.rotationPointY; + this.tailTip.rotationPointY = this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = this.tailBase.rotationPointZ; + this.tailTip.rotationPointZ = this.tailBase.rotationPointZ; + this.tailBase.rotateAngleX = f15; + this.tailMiddle.rotateAngleX = f15; + this.tailTip.rotateAngleX = -0.2618F + f15; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelIronGolem.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelIronGolem.java new file mode 100644 index 0000000..3af1c1f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelIronGolem.java @@ -0,0 +1,127 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; + +@SideOnly(Side.CLIENT) +public class ModelIronGolem extends ModelBase +{ + /** The head model for the iron golem. */ + public ModelRenderer ironGolemHead; + /** The body model for the iron golem. */ + public ModelRenderer ironGolemBody; + /** The right arm model for the iron golem. */ + public ModelRenderer ironGolemRightArm; + /** The left arm model for the iron golem. */ + public ModelRenderer ironGolemLeftArm; + /** The left leg model for the Iron Golem. */ + public ModelRenderer ironGolemLeftLeg; + /** The right leg model for the Iron Golem. */ + public ModelRenderer ironGolemRightLeg; + private static final String __OBFID = "CL_00000863"; + + public ModelIronGolem() + { + this(0.0F); + } + + public ModelIronGolem(float p_i1161_1_) + { + this(p_i1161_1_, -7.0F); + } + + public ModelIronGolem(float p_i1162_1_, float p_i1162_2_) + { + short short1 = 128; + short short2 = 128; + this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(short1, short2); + this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i1162_2_, -2.0F); + this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i1162_1_); + this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i1162_1_); + this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(short1, short2); + this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i1162_2_, 0.0F); + this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i1162_1_); + this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i1162_1_ + 0.5F); + this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(short1, short2); + this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i1162_1_); + this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(short1, short2); + this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); + this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i1162_1_); + this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2); + this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i1162_2_, 0.0F); + this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i1162_1_); + this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2); + this.ironGolemRightLeg.mirror = true; + this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + p_i1162_2_, 0.0F); + this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i1162_1_); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.ironGolemHead.render(p_78088_7_); + this.ironGolemBody.render(p_78088_7_); + this.ironGolemLeftLeg.render(p_78088_7_); + this.ironGolemRightLeg.render(p_78088_7_); + this.ironGolemRightArm.render(p_78088_7_); + this.ironGolemLeftArm.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_; + this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_; + this.ironGolemLeftLeg.rotateAngleY = 0.0F; + this.ironGolemRightLeg.rotateAngleY = 0.0F; + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + EntityIronGolem entityirongolem = (EntityIronGolem)p_78086_1_; + int i = entityirongolem.getAttackTimer(); + + if (i > 0) + { + this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - p_78086_4_, 10.0F); + this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - p_78086_4_, 10.0F); + } + else + { + int j = entityirongolem.getHoldRoseTick(); + + if (j > 0) + { + this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)j, 70.0F); + this.ironGolemLeftArm.rotateAngleX = 0.0F; + } + else + { + this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_; + } + } + } + + private float func_78172_a(float p_78172_1_, float p_78172_2_) + { + return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLargeChest.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLargeChest.java new file mode 100644 index 0000000..3b6658a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLargeChest.java @@ -0,0 +1,29 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLargeChest extends ModelChest +{ + private static final String __OBFID = "CL_00000841"; + + public ModelLargeChest() + { + this.chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestLid.addBox(0.0F, -5.0F, -14.0F, 30, 5, 14, 0.0F); + this.chestLid.rotationPointX = 1.0F; + this.chestLid.rotationPointY = 7.0F; + this.chestLid.rotationPointZ = 15.0F; + this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(128, 64); + this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F); + this.chestKnob.rotationPointX = 16.0F; + this.chestKnob.rotationPointY = 7.0F; + this.chestKnob.rotationPointZ = 15.0F; + this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(128, 64); + this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 30, 10, 14, 0.0F); + this.chestBelow.rotationPointX = 1.0F; + this.chestBelow.rotationPointY = 6.0F; + this.chestBelow.rotationPointZ = 1.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLeashKnot.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLeashKnot.java new file mode 100644 index 0000000..934bd20 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelLeashKnot.java @@ -0,0 +1,47 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelLeashKnot extends ModelBase +{ + public ModelRenderer field_110723_a; + private static final String __OBFID = "CL_00000843"; + + public ModelLeashKnot() + { + this(0, 0, 32, 32); + } + + public ModelLeashKnot(int p_i1150_1_, int p_i1150_2_, int p_i1150_3_, int p_i1150_4_) + { + this.textureWidth = p_i1150_3_; + this.textureHeight = p_i1150_4_; + this.field_110723_a = new ModelRenderer(this, p_i1150_1_, p_i1150_2_); + this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); + this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.field_110723_a.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.field_110723_a.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.field_110723_a.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMagmaCube.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMagmaCube.java new file mode 100644 index 0000000..9861bf0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMagmaCube.java @@ -0,0 +1,75 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityMagmaCube; + +@SideOnly(Side.CLIENT) +public class ModelMagmaCube extends ModelBase +{ + ModelRenderer[] field_78109_a = new ModelRenderer[8]; + ModelRenderer field_78108_b; + private static final String __OBFID = "CL_00000842"; + + public ModelMagmaCube() + { + for (int i = 0; i < this.field_78109_a.length; ++i) + { + byte b0 = 0; + int j = i; + + if (i == 2) + { + b0 = 24; + j = 10; + } + else if (i == 3) + { + b0 = 24; + j = 19; + } + + this.field_78109_a[i] = new ModelRenderer(this, b0, j); + this.field_78109_a[i].addBox(-4.0F, (float)(16 + i), -4.0F, 8, 1, 8); + } + + this.field_78108_b = new ModelRenderer(this, 0, 16); + this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + EntityMagmaCube entitymagmacube = (EntityMagmaCube)p_78086_1_; + float f3 = entitymagmacube.prevSquishFactor + (entitymagmacube.squishFactor - entitymagmacube.prevSquishFactor) * p_78086_4_; + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + for (int i = 0; i < this.field_78109_a.length; ++i) + { + this.field_78109_a[i].rotationPointY = (float)(-(4 - i)) * f3 * 1.7F; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.field_78108_b.render(p_78088_7_); + + for (int i = 0; i < this.field_78109_a.length; ++i) + { + this.field_78109_a[i].render(p_78088_7_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMinecart.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMinecart.java new file mode 100644 index 0000000..d3e9ce1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelMinecart.java @@ -0,0 +1,56 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelMinecart extends ModelBase +{ + public ModelRenderer[] sideModels = new ModelRenderer[7]; + private static final String __OBFID = "CL_00000844"; + + public ModelMinecart() + { + this.sideModels[0] = new ModelRenderer(this, 0, 10); + this.sideModels[1] = new ModelRenderer(this, 0, 0); + this.sideModels[2] = new ModelRenderer(this, 0, 0); + this.sideModels[3] = new ModelRenderer(this, 0, 0); + this.sideModels[4] = new ModelRenderer(this, 0, 0); + this.sideModels[5] = new ModelRenderer(this, 44, 10); + byte b0 = 20; + byte b1 = 8; + byte b2 = 16; + byte b3 = 4; + this.sideModels[0].addBox((float)(-b0 / 2), (float)(-b2 / 2), -1.0F, b0, b2, 2, 0.0F); + this.sideModels[0].setRotationPoint(0.0F, (float)b3, 0.0F); + this.sideModels[5].addBox((float)(-b0 / 2 + 1), (float)(-b2 / 2 + 1), -1.0F, b0 - 2, b2 - 2, 1, 0.0F); + this.sideModels[5].setRotationPoint(0.0F, (float)b3, 0.0F); + this.sideModels[1].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.sideModels[1].setRotationPoint((float)(-b0 / 2 + 1), (float)b3, 0.0F); + this.sideModels[2].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.sideModels[2].setRotationPoint((float)(b0 / 2 - 1), (float)b3, 0.0F); + this.sideModels[3].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.sideModels[3].setRotationPoint(0.0F, (float)b3, (float)(-b2 / 2 + 1)); + this.sideModels[4].addBox((float)(-b0 / 2 + 2), (float)(-b1 - 1), -1.0F, b0 - 4, b1, 2, 0.0F); + this.sideModels[4].setRotationPoint(0.0F, (float)b3, (float)(b2 / 2 - 1)); + this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); + this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); + this.sideModels[3].rotateAngleY = (float)Math.PI; + this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.sideModels[5].rotationPointY = 4.0F - p_78088_4_; + + for (int i = 0; i < 6; ++i) + { + this.sideModels[i].render(p_78088_7_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelOcelot.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelOcelot.java new file mode 100644 index 0000000..6b4bed3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelOcelot.java @@ -0,0 +1,216 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelOcelot extends ModelBase +{ + /** The back left leg model for the Ocelot. */ + ModelRenderer ocelotBackLeftLeg; + /** The back right leg model for the Ocelot. */ + ModelRenderer ocelotBackRightLeg; + /** The front left leg model for the Ocelot. */ + ModelRenderer ocelotFrontLeftLeg; + /** The front right leg model for the Ocelot. */ + ModelRenderer ocelotFrontRightLeg; + /** The tail model for the Ocelot. */ + ModelRenderer ocelotTail; + /** The second part of tail model for the Ocelot. */ + ModelRenderer ocelotTail2; + /** The head model for the Ocelot. */ + ModelRenderer ocelotHead; + /** The body model for the Ocelot. */ + ModelRenderer ocelotBody; + int field_78163_i = 1; + private static final String __OBFID = "CL_00000848"; + + public ModelOcelot() + { + this.setTextureOffset("head.main", 0, 0); + this.setTextureOffset("head.nose", 0, 24); + this.setTextureOffset("head.ear1", 0, 10); + this.setTextureOffset("head.ear2", 6, 10); + this.ocelotHead = new ModelRenderer(this, "head"); + this.ocelotHead.addBox("main", -2.5F, -2.0F, -3.0F, 5, 4, 5); + this.ocelotHead.addBox("nose", -1.5F, 0.0F, -4.0F, 3, 2, 2); + this.ocelotHead.addBox("ear1", -2.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.addBox("ear2", 1.0F, -3.0F, 0.0F, 1, 1, 2); + this.ocelotHead.setRotationPoint(0.0F, 15.0F, -9.0F); + this.ocelotBody = new ModelRenderer(this, 20, 0); + this.ocelotBody.addBox(-2.0F, 3.0F, -8.0F, 4, 16, 6, 0.0F); + this.ocelotBody.setRotationPoint(0.0F, 12.0F, -10.0F); + this.ocelotTail = new ModelRenderer(this, 0, 15); + this.ocelotTail.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail.rotateAngleX = 0.9F; + this.ocelotTail.setRotationPoint(0.0F, 15.0F, 8.0F); + this.ocelotTail2 = new ModelRenderer(this, 4, 15); + this.ocelotTail2.addBox(-0.5F, 0.0F, 0.0F, 1, 8, 1); + this.ocelotTail2.setRotationPoint(0.0F, 20.0F, 14.0F); + this.ocelotBackLeftLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackLeftLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackLeftLeg.setRotationPoint(1.1F, 18.0F, 5.0F); + this.ocelotBackRightLeg = new ModelRenderer(this, 8, 13); + this.ocelotBackRightLeg.addBox(-1.0F, 0.0F, 1.0F, 2, 6, 2); + this.ocelotBackRightLeg.setRotationPoint(-1.1F, 18.0F, 5.0F); + this.ocelotFrontLeftLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontLeftLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontLeftLeg.setRotationPoint(1.2F, 13.8F, -5.0F); + this.ocelotFrontRightLeg = new ModelRenderer(this, 40, 0); + this.ocelotFrontRightLeg.addBox(-1.0F, 0.0F, 0.0F, 2, 10, 2); + this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6); + GL11.glTranslatef(0.0F, 10.0F * p_78088_7_, 4.0F * p_78088_7_); + this.ocelotHead.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.ocelotBody.render(p_78088_7_); + this.ocelotBackLeftLeg.render(p_78088_7_); + this.ocelotBackRightLeg.render(p_78088_7_); + this.ocelotFrontLeftLeg.render(p_78088_7_); + this.ocelotFrontRightLeg.render(p_78088_7_); + this.ocelotTail.render(p_78088_7_); + this.ocelotTail2.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.ocelotHead.render(p_78088_7_); + this.ocelotBody.render(p_78088_7_); + this.ocelotTail.render(p_78088_7_); + this.ocelotTail2.render(p_78088_7_); + this.ocelotBackLeftLeg.render(p_78088_7_); + this.ocelotBackRightLeg.render(p_78088_7_); + this.ocelotFrontLeftLeg.render(p_78088_7_); + this.ocelotFrontRightLeg.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.ocelotHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.ocelotHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + + if (this.field_78163_i != 3) + { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); + + if (this.field_78163_i == 2) + { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + 0.3F) * 1.0F * p_78087_2_; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * p_78087_2_; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(p_78087_1_) * p_78087_2_; + } + else + { + this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.0F * p_78087_2_; + this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.0F * p_78087_2_; + + if (this.field_78163_i == 1) + { + this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(p_78087_1_) * p_78087_2_; + } + else + { + this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(p_78087_1_) * p_78087_2_; + } + } + } + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + EntityOcelot entityocelot = (EntityOcelot)p_78086_1_; + this.ocelotBody.rotationPointY = 12.0F; + this.ocelotBody.rotationPointZ = -10.0F; + this.ocelotHead.rotationPointY = 15.0F; + this.ocelotHead.rotationPointZ = -9.0F; + this.ocelotTail.rotationPointY = 15.0F; + this.ocelotTail.rotationPointZ = 8.0F; + this.ocelotTail2.rotationPointY = 20.0F; + this.ocelotTail2.rotationPointZ = 14.0F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 13.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -5.0F; + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; + this.ocelotTail.rotateAngleX = 0.9F; + + if (entityocelot.isSneaking()) + { + ++this.ocelotBody.rotationPointY; + this.ocelotHead.rotationPointY += 2.0F; + ++this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointY += -4.0F; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 0; + } + else if (entityocelot.isSprinting()) + { + this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointZ += 2.0F; + this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); + this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 2; + } + else if (entityocelot.isSitting()) + { + this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); + this.ocelotBody.rotationPointY += -4.0F; + this.ocelotBody.rotationPointZ += 5.0F; + this.ocelotHead.rotationPointY += -3.3F; + ++this.ocelotHead.rotationPointZ; + this.ocelotTail.rotationPointY += 8.0F; + this.ocelotTail.rotationPointZ += -2.0F; + this.ocelotTail2.rotationPointY += 2.0F; + this.ocelotTail2.rotationPointZ += -0.8F; + this.ocelotTail.rotateAngleX = 1.7278761F; + this.ocelotTail2.rotateAngleX = 2.670354F; + this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; + this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; + this.field_78163_i = 3; + } + else + { + this.field_78163_i = 1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelPig.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelPig.java new file mode 100644 index 0000000..ac49bf4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelPig.java @@ -0,0 +1,22 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelPig extends ModelQuadruped +{ + private static final String __OBFID = "CL_00000849"; + + public ModelPig() + { + this(0.0F); + } + + public ModelPig(float p_i1151_1_) + { + super(6, p_i1151_1_); + this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, p_i1151_1_); + this.field_78145_g = 4.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelQuadruped.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelQuadruped.java new file mode 100644 index 0000000..82f2249 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelQuadruped.java @@ -0,0 +1,94 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelQuadruped extends ModelBase +{ + public ModelRenderer head = new ModelRenderer(this, 0, 0); + public ModelRenderer body; + public ModelRenderer leg1; + public ModelRenderer leg2; + public ModelRenderer leg3; + public ModelRenderer leg4; + protected float field_78145_g = 8.0F; + protected float field_78151_h = 4.0F; + private static final String __OBFID = "CL_00000851"; + + public ModelQuadruped(int p_i1154_1_, float p_i1154_2_) + { + this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, p_i1154_2_); + this.head.setRotationPoint(0.0F, (float)(18 - p_i1154_1_), -6.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, p_i1154_2_); + this.body.setRotationPoint(0.0F, (float)(17 - p_i1154_1_), 2.0F); + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg1.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg2.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg3.setRotationPoint(-3.0F, (float)(24 - p_i1154_1_), -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, p_i1154_1_, 4, p_i1154_2_); + this.leg4.setRotationPoint(3.0F, (float)(24 - p_i1154_1_), -5.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, this.field_78145_g * p_78088_7_, this.field_78151_h * p_78088_7_); + this.head.render(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.head.render(p_78088_7_); + this.body.render(p_78088_7_); + this.leg1.render(p_78088_7_); + this.leg2.render(p_78088_7_); + this.leg3.render(p_78088_7_); + this.leg4.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + float f6 = (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.leg1.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leg2.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg3.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leg4.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelRenderer.java new file mode 100644 index 0000000..2fb94fb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelRenderer.java @@ -0,0 +1,308 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import org.lwjgl.opengl.GL11; + +public class ModelRenderer +{ + /** The size of the texture file's width in pixels. */ + public float textureWidth; + /** The size of the texture file's height in pixels. */ + public float textureHeight; + /** The X offset into the texture used for displaying this model */ + private int textureOffsetX; + /** The Y offset into the texture used for displaying this model */ + private int textureOffsetY; + public float rotationPointX; + public float rotationPointY; + public float rotationPointZ; + public float rotateAngleX; + public float rotateAngleY; + public float rotateAngleZ; + private boolean compiled; + /** The GL display list rendered by the Tessellator for this model */ + private int displayList; + public boolean mirror; + public boolean showModel; + /** Hides the model. */ + public boolean isHidden; + public List cubeList; + public List childModels; + public final String boxName; + private ModelBase baseModel; + public float offsetX; + public float offsetY; + public float offsetZ; + private static final String __OBFID = "CL_00000874"; + + public ModelRenderer(ModelBase p_i1172_1_, String p_i1172_2_) + { + this.textureWidth = 64.0F; + this.textureHeight = 32.0F; + this.showModel = true; + this.cubeList = new ArrayList(); + this.baseModel = p_i1172_1_; + p_i1172_1_.boxList.add(this); + this.boxName = p_i1172_2_; + this.setTextureSize(p_i1172_1_.textureWidth, p_i1172_1_.textureHeight); + } + + public ModelRenderer(ModelBase p_i1173_1_) + { + this(p_i1173_1_, (String)null); + } + + public ModelRenderer(ModelBase p_i1174_1_, int p_i1174_2_, int p_i1174_3_) + { + this(p_i1174_1_); + this.setTextureOffset(p_i1174_2_, p_i1174_3_); + } + + /** + * Sets the current box's rotation points and rotation angles to another box. + */ + public void addChild(ModelRenderer p_78792_1_) + { + if (this.childModels == null) + { + this.childModels = new ArrayList(); + } + + this.childModels.add(p_78792_1_); + } + + public ModelRenderer setTextureOffset(int p_78784_1_, int p_78784_2_) + { + this.textureOffsetX = p_78784_1_; + this.textureOffsetY = p_78784_2_; + return this; + } + + public ModelRenderer addBox(String p_78786_1_, float p_78786_2_, float p_78786_3_, float p_78786_4_, int p_78786_5_, int p_78786_6_, int p_78786_7_) + { + p_78786_1_ = this.boxName + "." + p_78786_1_; + TextureOffset textureoffset = this.baseModel.getTextureOffset(p_78786_1_); + this.setTextureOffset(textureoffset.textureOffsetX, textureoffset.textureOffsetY); + this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, p_78786_2_, p_78786_3_, p_78786_4_, p_78786_5_, p_78786_6_, p_78786_7_, 0.0F)).func_78244_a(p_78786_1_)); + return this; + } + + public ModelRenderer addBox(float p_78789_1_, float p_78789_2_, float p_78789_3_, int p_78789_4_, int p_78789_5_, int p_78789_6_) + { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, p_78789_1_, p_78789_2_, p_78789_3_, p_78789_4_, p_78789_5_, p_78789_6_, 0.0F)); + return this; + } + + /** + * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. + */ + public void addBox(float p_78790_1_, float p_78790_2_, float p_78790_3_, int p_78790_4_, int p_78790_5_, int p_78790_6_, float p_78790_7_) + { + this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, p_78790_1_, p_78790_2_, p_78790_3_, p_78790_4_, p_78790_5_, p_78790_6_, p_78790_7_)); + } + + public void setRotationPoint(float p_78793_1_, float p_78793_2_, float p_78793_3_) + { + this.rotationPointX = p_78793_1_; + this.rotationPointY = p_78793_2_; + this.rotationPointZ = p_78793_3_; + } + + @SideOnly(Side.CLIENT) + public void render(float p_78785_1_) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(p_78785_1_); + } + + GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); + int i; + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) + { + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (i = 0; i < this.childModels.size(); ++i) + { + ((ModelRenderer)this.childModels.get(i)).render(p_78785_1_); + } + } + } + else + { + GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (i = 0; i < this.childModels.size(); ++i) + { + ((ModelRenderer)this.childModels.get(i)).render(p_78785_1_); + } + } + + GL11.glTranslatef(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_); + } + } + else + { + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_); + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + GL11.glCallList(this.displayList); + + if (this.childModels != null) + { + for (i = 0; i < this.childModels.size(); ++i) + { + ((ModelRenderer)this.childModels.get(i)).render(p_78785_1_); + } + } + + GL11.glPopMatrix(); + } + + GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ); + } + } + } + + @SideOnly(Side.CLIENT) + public void renderWithRotation(float p_78791_1_) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(p_78791_1_); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_); + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glCallList(this.displayList); + GL11.glPopMatrix(); + } + } + } + + /** + * Allows the changing of Angles after a box has been rendered + */ + @SideOnly(Side.CLIENT) + public void postRender(float p_78794_1_) + { + if (!this.isHidden) + { + if (this.showModel) + { + if (!this.compiled) + { + this.compileDisplayList(p_78794_1_); + } + + if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) + { + if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) + { + GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_); + } + } + else + { + GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_); + + if (this.rotateAngleZ != 0.0F) + { + GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + if (this.rotateAngleY != 0.0F) + { + GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (this.rotateAngleX != 0.0F) + { + GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + } + } + } + } + + /** + * Compiles a GL display list for this model + */ + @SideOnly(Side.CLIENT) + private void compileDisplayList(float p_78788_1_) + { + this.displayList = GLAllocation.generateDisplayLists(1); + GL11.glNewList(this.displayList, GL11.GL_COMPILE); + Tessellator tessellator = Tessellator.instance; + + for (int i = 0; i < this.cubeList.size(); ++i) + { + ((ModelBox)this.cubeList.get(i)).render(tessellator, p_78788_1_); + } + + GL11.glEndList(); + this.compiled = true; + } + + /** + * Returns the model renderer with the new texture parameters. + */ + public ModelRenderer setTextureSize(int p_78787_1_, int p_78787_2_) + { + this.textureWidth = (float)p_78787_1_; + this.textureHeight = (float)p_78787_2_; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep1.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep1.java new file mode 100644 index 0000000..48e8ac8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep1.java @@ -0,0 +1,60 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +@SideOnly(Side.CLIENT) +public class ModelSheep1 extends ModelQuadruped +{ + private float field_78152_i; + private static final String __OBFID = "CL_00000852"; + + public ModelSheep1() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -4.0F, 6, 6, 6, 0.6F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 1.75F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + float f = 0.5F; + this.leg1 = new ModelRenderer(this, 0, 16); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg1.setRotationPoint(-3.0F, 12.0F, 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg2.setRotationPoint(3.0F, 12.0F, 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg3.setRotationPoint(-3.0F, 12.0F, -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, f); + this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + this.head.rotationPointY = 6.0F + ((EntitySheep)p_78086_1_).func_70894_j(p_78086_4_) * 9.0F; + this.field_78152_i = ((EntitySheep)p_78086_1_).func_70890_k(p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleX = this.field_78152_i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep2.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep2.java new file mode 100644 index 0000000..7f33644 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSheep2.java @@ -0,0 +1,47 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; + +@SideOnly(Side.CLIENT) +public class ModelSheep2 extends ModelQuadruped +{ + private float field_78153_i; + private static final String __OBFID = "CL_00000853"; + + public ModelSheep2() + { + super(12, 0.0F); + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.0F, -4.0F, -6.0F, 6, 6, 8, 0.0F); + this.head.setRotationPoint(0.0F, 6.0F, -8.0F); + this.body = new ModelRenderer(this, 28, 8); + this.body.addBox(-4.0F, -10.0F, -7.0F, 8, 16, 6, 0.0F); + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + this.head.rotationPointY = 6.0F + ((EntitySheep)p_78086_1_).func_70894_j(p_78086_4_) * 9.0F; + this.field_78153_i = ((EntitySheep)p_78086_1_).func_70890_k(p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleX = this.field_78153_i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSign.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSign.java new file mode 100644 index 0000000..53c2339 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSign.java @@ -0,0 +1,30 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelSign extends ModelBase +{ + /** The board on a sign that has the writing on it. */ + public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); + /** The stick a sign stands on. */ + public ModelRenderer signStick; + private static final String __OBFID = "CL_00000854"; + + public ModelSign() + { + this.signBoard.addBox(-12.0F, -14.0F, -1.0F, 24, 12, 2, 0.0F); + this.signStick = new ModelRenderer(this, 0, 14); + this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); + } + + /** + * Renders the sign model through TileEntitySignRenderer + */ + public void renderSign() + { + this.signBoard.render(0.0625F); + this.signStick.render(0.0625F); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSilverfish.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSilverfish.java new file mode 100644 index 0000000..a2b233a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSilverfish.java @@ -0,0 +1,89 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelSilverfish extends ModelBase +{ + /** The body parts of the silverfish's model. */ + private ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; + /** The wings (dust-looking sprites) on the silverfish's model. */ + private ModelRenderer[] silverfishWings; + private float[] field_78170_c = new float[7]; + /** The widths, heights, and lengths for the silverfish model boxes. */ + private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; + /** The texture positions for the silverfish's model's boxes. */ + private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; + private static final String __OBFID = "CL_00000855"; + + public ModelSilverfish() + { + float f = -3.5F; + + for (int i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i] = new ModelRenderer(this, silverfishTexturePositions[i][0], silverfishTexturePositions[i][1]); + this.silverfishBodyParts[i].addBox((float)silverfishBoxLength[i][0] * -0.5F, 0.0F, (float)silverfishBoxLength[i][2] * -0.5F, silverfishBoxLength[i][0], silverfishBoxLength[i][1], silverfishBoxLength[i][2]); + this.silverfishBodyParts[i].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[i][1]), f); + this.field_78170_c[i] = f; + + if (i < this.silverfishBodyParts.length - 1) + { + f += (float)(silverfishBoxLength[i][2] + silverfishBoxLength[i + 1][2]) * 0.5F; + } + } + + this.silverfishWings = new ModelRenderer[3]; + this.silverfishWings[0] = new ModelRenderer(this, 20, 0); + this.silverfishWings[0].addBox(-5.0F, 0.0F, (float)silverfishBoxLength[2][2] * -0.5F, 10, 8, silverfishBoxLength[2][2]); + this.silverfishWings[0].setRotationPoint(0.0F, 16.0F, this.field_78170_c[2]); + this.silverfishWings[1] = new ModelRenderer(this, 20, 11); + this.silverfishWings[1].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 4, silverfishBoxLength[4][2]); + this.silverfishWings[1].setRotationPoint(0.0F, 20.0F, this.field_78170_c[4]); + this.silverfishWings[2] = new ModelRenderer(this, 20, 18); + this.silverfishWings[2].addBox(-3.0F, 0.0F, (float)silverfishBoxLength[4][2] * -0.5F, 6, 5, silverfishBoxLength[1][2]); + this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + int i; + + for (i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i].render(p_78088_7_); + } + + for (i = 0; i < this.silverfishWings.length; ++i) + { + this.silverfishWings[i].render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + for (int i = 0; i < this.silverfishBodyParts.length; ++i) + { + this.silverfishBodyParts[i].rotateAngleY = MathHelper.cos(p_78087_3_ * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(i - 2)); + this.silverfishBodyParts[i].rotationPointX = MathHelper.sin(p_78087_3_ * 0.9F + (float)i * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(i - 2); + } + + this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; + this.silverfishWings[1].rotateAngleY = this.silverfishBodyParts[4].rotateAngleY; + this.silverfishWings[1].rotationPointX = this.silverfishBodyParts[4].rotationPointX; + this.silverfishWings[2].rotateAngleY = this.silverfishBodyParts[1].rotateAngleY; + this.silverfishWings[2].rotationPointX = this.silverfishBodyParts[1].rotationPointX; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeleton.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeleton.java new file mode 100644 index 0000000..4fbf4ca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeleton.java @@ -0,0 +1,57 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySkeleton; + +@SideOnly(Side.CLIENT) +public class ModelSkeleton extends ModelZombie +{ + private static final String __OBFID = "CL_00000857"; + + public ModelSkeleton() + { + this(0.0F); + } + + public ModelSkeleton(float p_i1156_1_) + { + super(p_i1156_1_, 0.0F, 64, 32); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1156_1_); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + this.aimedBow = ((EntitySkeleton)p_78086_1_).getSkeletonType() == 1; + super.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeletonHead.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeletonHead.java new file mode 100644 index 0000000..d6476da --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSkeletonHead.java @@ -0,0 +1,47 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelSkeletonHead extends ModelBase +{ + public ModelRenderer skeletonHead; + private static final String __OBFID = "CL_00000856"; + + public ModelSkeletonHead() + { + this(0, 35, 64, 64); + } + + public ModelSkeletonHead(int p_i1155_1_, int p_i1155_2_, int p_i1155_3_, int p_i1155_4_) + { + this.textureWidth = p_i1155_3_; + this.textureHeight = p_i1155_4_; + this.skeletonHead = new ModelRenderer(this, p_i1155_1_, p_i1155_2_); + this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.skeletonHead.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.skeletonHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.skeletonHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSlime.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSlime.java new file mode 100644 index 0000000..4548d9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSlime.java @@ -0,0 +1,53 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelSlime extends ModelBase +{ + /** The slime's bodies, both the inside box and the outside box */ + ModelRenderer slimeBodies; + /** The slime's right eye */ + ModelRenderer slimeRightEye; + /** The slime's left eye */ + ModelRenderer slimeLeftEye; + /** The slime's mouth */ + ModelRenderer slimeMouth; + private static final String __OBFID = "CL_00000858"; + + public ModelSlime(int p_i1157_1_) + { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); + + if (p_i1157_1_ > 0) + { + this.slimeBodies = new ModelRenderer(this, 0, p_i1157_1_); + this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); + this.slimeRightEye = new ModelRenderer(this, 32, 0); + this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeLeftEye = new ModelRenderer(this, 32, 4); + this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeMouth = new ModelRenderer(this, 32, 8); + this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.slimeBodies.render(p_78088_7_); + + if (this.slimeRightEye != null) + { + this.slimeRightEye.render(p_78088_7_); + this.slimeLeftEye.render(p_78088_7_); + this.slimeMouth.render(p_78088_7_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSnowMan.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSnowMan.java new file mode 100644 index 0000000..672cd2f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSnowMan.java @@ -0,0 +1,74 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelSnowMan extends ModelBase +{ + public ModelRenderer body; + public ModelRenderer bottomBody; + public ModelRenderer head; + public ModelRenderer rightHand; + public ModelRenderer leftHand; + private static final String __OBFID = "CL_00000859"; + + public ModelSnowMan() + { + float f = 4.0F; + float f1 = 0.0F; + this.head = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); + this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, f1 - 0.5F); + this.head.setRotationPoint(0.0F, 0.0F + f, 0.0F); + this.rightHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.rightHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, f1 - 0.5F); + this.rightHand.setRotationPoint(0.0F, 0.0F + f + 9.0F - 7.0F, 0.0F); + this.leftHand = (new ModelRenderer(this, 32, 0)).setTextureSize(64, 64); + this.leftHand.addBox(-1.0F, 0.0F, -1.0F, 12, 2, 2, f1 - 0.5F); + this.leftHand.setRotationPoint(0.0F, 0.0F + f + 9.0F - 7.0F, 0.0F); + this.body = (new ModelRenderer(this, 0, 16)).setTextureSize(64, 64); + this.body.addBox(-5.0F, -10.0F, -5.0F, 10, 10, 10, f1 - 0.5F); + this.body.setRotationPoint(0.0F, 0.0F + f + 9.0F, 0.0F); + this.bottomBody = (new ModelRenderer(this, 0, 36)).setTextureSize(64, 64); + this.bottomBody.addBox(-6.0F, -12.0F, -6.0F, 12, 12, 12, f1 - 0.5F); + this.bottomBody.setRotationPoint(0.0F, 0.0F + f + 20.0F, 0.0F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.body.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI) * 0.25F; + float f6 = MathHelper.sin(this.body.rotateAngleY); + float f7 = MathHelper.cos(this.body.rotateAngleY); + this.rightHand.rotateAngleZ = 1.0F; + this.leftHand.rotateAngleZ = -1.0F; + this.rightHand.rotateAngleY = 0.0F + this.body.rotateAngleY; + this.leftHand.rotateAngleY = (float)Math.PI + this.body.rotateAngleY; + this.rightHand.rotationPointX = f7 * 5.0F; + this.rightHand.rotationPointZ = -f6 * 5.0F; + this.leftHand.rotationPointX = -f7 * 5.0F; + this.leftHand.rotationPointZ = f6 * 5.0F; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.body.render(p_78088_7_); + this.bottomBody.render(p_78088_7_); + this.head.render(p_78088_7_); + this.rightHand.render(p_78088_7_); + this.leftHand.render(p_78088_7_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSpider.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSpider.java new file mode 100644 index 0000000..bebd5d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSpider.java @@ -0,0 +1,146 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelSpider extends ModelBase +{ + /** The spider's head box */ + public ModelRenderer spiderHead; + /** The spider's neck box */ + public ModelRenderer spiderNeck; + /** The spider's body box */ + public ModelRenderer spiderBody; + /** Spider's first leg */ + public ModelRenderer spiderLeg1; + /** Spider's second leg */ + public ModelRenderer spiderLeg2; + /** Spider's third leg */ + public ModelRenderer spiderLeg3; + /** Spider's fourth leg */ + public ModelRenderer spiderLeg4; + /** Spider's fifth leg */ + public ModelRenderer spiderLeg5; + /** Spider's sixth leg */ + public ModelRenderer spiderLeg6; + /** Spider's seventh leg */ + public ModelRenderer spiderLeg7; + /** Spider's eight leg */ + public ModelRenderer spiderLeg8; + private static final String __OBFID = "CL_00000860"; + + public ModelSpider() + { + float f = 0.0F; + byte b0 = 15; + this.spiderHead = new ModelRenderer(this, 32, 4); + this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, f); + this.spiderHead.setRotationPoint(0.0F, (float)b0, -3.0F); + this.spiderNeck = new ModelRenderer(this, 0, 0); + this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, f); + this.spiderNeck.setRotationPoint(0.0F, (float)b0, 0.0F); + this.spiderBody = new ModelRenderer(this, 0, 12); + this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, f); + this.spiderBody.setRotationPoint(0.0F, (float)b0, 9.0F); + this.spiderLeg1 = new ModelRenderer(this, 18, 0); + this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg1.setRotationPoint(-4.0F, (float)b0, 2.0F); + this.spiderLeg2 = new ModelRenderer(this, 18, 0); + this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg2.setRotationPoint(4.0F, (float)b0, 2.0F); + this.spiderLeg3 = new ModelRenderer(this, 18, 0); + this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg3.setRotationPoint(-4.0F, (float)b0, 1.0F); + this.spiderLeg4 = new ModelRenderer(this, 18, 0); + this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg4.setRotationPoint(4.0F, (float)b0, 1.0F); + this.spiderLeg5 = new ModelRenderer(this, 18, 0); + this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg5.setRotationPoint(-4.0F, (float)b0, 0.0F); + this.spiderLeg6 = new ModelRenderer(this, 18, 0); + this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg6.setRotationPoint(4.0F, (float)b0, 0.0F); + this.spiderLeg7 = new ModelRenderer(this, 18, 0); + this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg7.setRotationPoint(-4.0F, (float)b0, -1.0F); + this.spiderLeg8 = new ModelRenderer(this, 18, 0); + this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, f); + this.spiderLeg8.setRotationPoint(4.0F, (float)b0, -1.0F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.spiderHead.render(p_78088_7_); + this.spiderNeck.render(p_78088_7_); + this.spiderBody.render(p_78088_7_); + this.spiderLeg1.render(p_78088_7_); + this.spiderLeg2.render(p_78088_7_); + this.spiderLeg3.render(p_78088_7_); + this.spiderLeg4.render(p_78088_7_); + this.spiderLeg5.render(p_78088_7_); + this.spiderLeg6.render(p_78088_7_); + this.spiderLeg7.render(p_78088_7_); + this.spiderLeg8.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.spiderHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.spiderHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + float f6 = ((float)Math.PI / 4F); + this.spiderLeg1.rotateAngleZ = -f6; + this.spiderLeg2.rotateAngleZ = f6; + this.spiderLeg3.rotateAngleZ = -f6 * 0.74F; + this.spiderLeg4.rotateAngleZ = f6 * 0.74F; + this.spiderLeg5.rotateAngleZ = -f6 * 0.74F; + this.spiderLeg6.rotateAngleZ = f6 * 0.74F; + this.spiderLeg7.rotateAngleZ = -f6; + this.spiderLeg8.rotateAngleZ = f6; + float f7 = -0.0F; + float f8 = 0.3926991F; + this.spiderLeg1.rotateAngleY = f8 * 2.0F + f7; + this.spiderLeg2.rotateAngleY = -f8 * 2.0F - f7; + this.spiderLeg3.rotateAngleY = f8 * 1.0F + f7; + this.spiderLeg4.rotateAngleY = -f8 * 1.0F - f7; + this.spiderLeg5.rotateAngleY = -f8 * 1.0F + f7; + this.spiderLeg6.rotateAngleY = f8 * 1.0F - f7; + this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7; + this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7; + float f9 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + 0.0F) * 0.4F) * p_78087_2_; + float f10 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * p_78087_2_; + float f11 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * p_78087_2_; + float f12 = -(MathHelper.cos(p_78087_1_ * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_; + float f13 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + 0.0F) * 0.4F) * p_78087_2_; + float f14 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + (float)Math.PI) * 0.4F) * p_78087_2_; + float f15 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * p_78087_2_; + float f16 = Math.abs(MathHelper.sin(p_78087_1_ * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * p_78087_2_; + this.spiderLeg1.rotateAngleY += f9; + this.spiderLeg2.rotateAngleY += -f9; + this.spiderLeg3.rotateAngleY += f10; + this.spiderLeg4.rotateAngleY += -f10; + this.spiderLeg5.rotateAngleY += f11; + this.spiderLeg6.rotateAngleY += -f11; + this.spiderLeg7.rotateAngleY += f12; + this.spiderLeg8.rotateAngleY += -f12; + this.spiderLeg1.rotateAngleZ += f13; + this.spiderLeg2.rotateAngleZ += -f13; + this.spiderLeg3.rotateAngleZ += f14; + this.spiderLeg4.rotateAngleZ += -f14; + this.spiderLeg5.rotateAngleZ += f15; + this.spiderLeg6.rotateAngleZ += -f15; + this.spiderLeg7.rotateAngleZ += f16; + this.spiderLeg8.rotateAngleZ += -f16; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSquid.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSquid.java new file mode 100644 index 0000000..d905804 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelSquid.java @@ -0,0 +1,68 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class ModelSquid extends ModelBase +{ + /** The squid's body */ + ModelRenderer squidBody; + /** The squid's tentacles */ + ModelRenderer[] squidTentacles = new ModelRenderer[8]; + private static final String __OBFID = "CL_00000861"; + + public ModelSquid() + { + byte b0 = -16; + this.squidBody = new ModelRenderer(this, 0, 0); + this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); + this.squidBody.rotationPointY += (float)(24 + b0); + + for (int i = 0; i < this.squidTentacles.length; ++i) + { + this.squidTentacles[i] = new ModelRenderer(this, 48, 0); + double d0 = (double)i * Math.PI * 2.0D / (double)this.squidTentacles.length; + float f = (float)Math.cos(d0) * 5.0F; + float f1 = (float)Math.sin(d0) * 5.0F; + this.squidTentacles[i].addBox(-1.0F, 0.0F, -1.0F, 2, 18, 2); + this.squidTentacles[i].rotationPointX = f; + this.squidTentacles[i].rotationPointZ = f1; + this.squidTentacles[i].rotationPointY = (float)(31 + b0); + d0 = (double)i * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); + this.squidTentacles[i].rotateAngleY = (float)d0; + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + ModelRenderer[] amodelrenderer = this.squidTentacles; + int i = amodelrenderer.length; + + for (int j = 0; j < i; ++j) + { + ModelRenderer modelrenderer = amodelrenderer[j]; + modelrenderer.rotateAngleX = p_78087_3_; + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.squidBody.render(p_78088_7_); + + for (int i = 0; i < this.squidTentacles.length; ++i) + { + this.squidTentacles[i].render(p_78088_7_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelVillager.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelVillager.java new file mode 100644 index 0000000..7c9d472 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelVillager.java @@ -0,0 +1,86 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelVillager extends ModelBase +{ + /** The head box of the VillagerModel */ + public ModelRenderer villagerHead; + /** The body of the VillagerModel */ + public ModelRenderer villagerBody; + /** The arms of the VillagerModel */ + public ModelRenderer villagerArms; + /** The right leg of the VillagerModel */ + public ModelRenderer rightVillagerLeg; + /** The left leg of the VillagerModel */ + public ModelRenderer leftVillagerLeg; + public ModelRenderer villagerNose; + private static final String __OBFID = "CL_00000864"; + + public ModelVillager(float p_i1163_1_) + { + this(p_i1163_1_, 0.0F, 64, 64); + } + + public ModelVillager(float p_i1164_1_, float p_i1164_2_, int p_i1164_3_, int p_i1164_4_) + { + this.villagerHead = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerHead.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1164_1_); + this.villagerNose = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerNose.setRotationPoint(0.0F, p_i1164_2_ - 2.0F, 0.0F); + this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, p_i1164_1_); + this.villagerHead.addChild(this.villagerNose); + this.villagerBody = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerBody.setRotationPoint(0.0F, 0.0F + p_i1164_2_, 0.0F); + this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, p_i1164_1_); + this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, p_i1164_1_ + 0.5F); + this.villagerArms = (new ModelRenderer(this)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.villagerArms.setRotationPoint(0.0F, 0.0F + p_i1164_2_ + 2.0F, 0.0F); + this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, p_i1164_1_); + this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, p_i1164_1_); + this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + p_i1164_2_, 0.0F); + this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(p_i1164_3_, p_i1164_4_); + this.leftVillagerLeg.mirror = true; + this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + p_i1164_2_, 0.0F); + this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1164_1_); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + this.villagerHead.render(p_78088_7_); + this.villagerBody.render(p_78088_7_); + this.rightVillagerLeg.render(p_78088_7_); + this.leftVillagerLeg.render(p_78088_7_); + this.villagerArms.render(p_78088_7_); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.villagerHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.villagerHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.villagerArms.rotationPointY = 3.0F; + this.villagerArms.rotationPointZ = -1.0F; + this.villagerArms.rotateAngleX = -0.75F; + this.rightVillagerLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_ * 0.5F; + this.leftVillagerLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_ * 0.5F; + this.rightVillagerLeg.rotateAngleY = 0.0F; + this.leftVillagerLeg.rotateAngleY = 0.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWitch.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWitch.java new file mode 100644 index 0000000..d793afc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWitch.java @@ -0,0 +1,67 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelWitch extends ModelVillager +{ + public boolean field_82900_g; + private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); + private ModelRenderer witchHat; + private static final String __OBFID = "CL_00000866"; + + public ModelWitch(float p_i1166_1_) + { + super(p_i1166_1_, 0.0F, 64, 128); + this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); + this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); + this.villagerNose.addChild(this.field_82901_h); + this.witchHat = (new ModelRenderer(this)).setTextureSize(64, 128); + this.witchHat.setRotationPoint(-5.0F, -10.03125F, -5.0F); + this.witchHat.setTextureOffset(0, 64).addBox(0.0F, 0.0F, 0.0F, 10, 2, 10); + this.villagerHead.addChild(this.witchHat); + ModelRenderer modelrenderer = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer.setRotationPoint(1.75F, -4.0F, 2.0F); + modelrenderer.setTextureOffset(0, 76).addBox(0.0F, 0.0F, 0.0F, 7, 4, 7); + modelrenderer.rotateAngleX = -0.05235988F; + modelrenderer.rotateAngleZ = 0.02617994F; + this.witchHat.addChild(modelrenderer); + ModelRenderer modelrenderer1 = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer1.setRotationPoint(1.75F, -4.0F, 2.0F); + modelrenderer1.setTextureOffset(0, 87).addBox(0.0F, 0.0F, 0.0F, 4, 4, 4); + modelrenderer1.rotateAngleX = -0.10471976F; + modelrenderer1.rotateAngleZ = 0.05235988F; + modelrenderer.addChild(modelrenderer1); + ModelRenderer modelrenderer2 = (new ModelRenderer(this)).setTextureSize(64, 128); + modelrenderer2.setRotationPoint(1.75F, -2.0F, 2.0F); + modelrenderer2.setTextureOffset(0, 95).addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.25F); + modelrenderer2.rotateAngleX = -0.20943952F; + modelrenderer2.rotateAngleZ = 0.10471976F; + modelrenderer1.addChild(modelrenderer2); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; + float f6 = 0.01F * (float)(p_78087_7_.getEntityId() % 10); + this.villagerNose.rotateAngleX = MathHelper.sin((float)p_78087_7_.ticksExisted * f6) * 4.5F * (float)Math.PI / 180.0F; + this.villagerNose.rotateAngleY = 0.0F; + this.villagerNose.rotateAngleZ = MathHelper.cos((float)p_78087_7_.ticksExisted * f6) * 2.5F * (float)Math.PI / 180.0F; + + if (this.field_82900_g) + { + this.villagerNose.rotateAngleX = -0.9F; + this.villagerNose.offsetZ = -0.09375F; + this.villagerNose.offsetY = 0.1875F; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWither.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWither.java new file mode 100644 index 0000000..7bb7da3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWither.java @@ -0,0 +1,106 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelWither extends ModelBase +{ + private ModelRenderer[] field_82905_a; + private ModelRenderer[] field_82904_b; + private static final String __OBFID = "CL_00000867"; + + public ModelWither() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.field_82905_a = new ModelRenderer[3]; + this.field_82905_a[0] = new ModelRenderer(this, 0, 16); + this.field_82905_a[0].addBox(-10.0F, 3.9F, -0.5F, 20, 3, 3); + this.field_82905_a[1] = (new ModelRenderer(this)).setTextureSize(this.textureWidth, this.textureHeight); + this.field_82905_a[1].setRotationPoint(-2.0F, 6.9F, -0.5F); + this.field_82905_a[1].setTextureOffset(0, 22).addBox(0.0F, 0.0F, 0.0F, 3, 10, 3); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 1.5F, 0.5F, 11, 2, 2); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 4.0F, 0.5F, 11, 2, 2); + this.field_82905_a[1].setTextureOffset(24, 22).addBox(-4.0F, 6.5F, 0.5F, 11, 2, 2); + this.field_82905_a[2] = new ModelRenderer(this, 12, 22); + this.field_82905_a[2].addBox(0.0F, 0.0F, 0.0F, 3, 6, 3); + this.field_82904_b = new ModelRenderer[3]; + this.field_82904_b[0] = new ModelRenderer(this, 0, 0); + this.field_82904_b[0].addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.field_82904_b[1] = new ModelRenderer(this, 32, 0); + this.field_82904_b[1].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); + this.field_82904_b[1].rotationPointX = -8.0F; + this.field_82904_b[1].rotationPointY = 4.0F; + this.field_82904_b[2] = new ModelRenderer(this, 32, 0); + this.field_82904_b[2].addBox(-4.0F, -4.0F, -4.0F, 6, 6, 6); + this.field_82904_b[2].rotationPointX = 10.0F; + this.field_82904_b[2].rotationPointY = 4.0F; + } + + public int func_82903_a() + { + return 32; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + ModelRenderer[] amodelrenderer = this.field_82904_b; + int i = amodelrenderer.length; + int j; + ModelRenderer modelrenderer; + + for (j = 0; j < i; ++j) + { + modelrenderer = amodelrenderer[j]; + modelrenderer.render(p_78088_7_); + } + + amodelrenderer = this.field_82905_a; + i = amodelrenderer.length; + + for (j = 0; j < i; ++j) + { + modelrenderer = amodelrenderer[j]; + modelrenderer.render(p_78088_7_); + } + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + float f6 = MathHelper.cos(p_78087_3_ * 0.1F); + this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * f6) * (float)Math.PI; + this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); + this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * f6) * (float)Math.PI; + this.field_82904_b[0].rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.field_82904_b[0].rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + EntityWither entitywither = (EntityWither)p_78086_1_; + + for (int i = 1; i < 3; ++i) + { + this.field_82904_b[i].rotateAngleY = (entitywither.func_82207_a(i - 1) - p_78086_1_.renderYawOffset) / (180F / (float)Math.PI); + this.field_82904_b[i].rotateAngleX = entitywither.func_82210_r(i - 1) / (180F / (float)Math.PI); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWolf.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWolf.java new file mode 100644 index 0000000..f51a540 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelWolf.java @@ -0,0 +1,174 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ModelWolf extends ModelBase +{ + /** main box for the wolf head */ + public ModelRenderer wolfHeadMain; + /** The wolf's body */ + public ModelRenderer wolfBody; + /** Wolf'se first leg */ + public ModelRenderer wolfLeg1; + /** Wolf's second leg */ + public ModelRenderer wolfLeg2; + /** Wolf's third leg */ + public ModelRenderer wolfLeg3; + /** Wolf's fourth leg */ + public ModelRenderer wolfLeg4; + /** The wolf's tail */ + ModelRenderer wolfTail; + /** The wolf's mane */ + ModelRenderer wolfMane; + private static final String __OBFID = "CL_00000868"; + + public ModelWolf() + { + float f = 0.0F; + float f1 = 13.5F; + this.wolfHeadMain = new ModelRenderer(this, 0, 0); + this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f); + this.wolfHeadMain.setRotationPoint(-1.0F, f1, -7.0F); + this.wolfBody = new ModelRenderer(this, 18, 14); + this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f); + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfMane = new ModelRenderer(this, 21, 0); + this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F); + this.wolfLeg1 = new ModelRenderer(this, 0, 18); + this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2 = new ModelRenderer(this, 0, 18); + this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3 = new ModelRenderer(this, 0, 18); + this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4 = new ModelRenderer(this, 0, 18); + this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfTail = new ModelRenderer(this, 9, 18); + this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + if (this.isChild) + { + float f6 = 2.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 5.0F * p_78088_7_, 2.0F * p_78088_7_); + this.wolfHeadMain.renderWithRotation(p_78088_7_); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6); + GL11.glTranslatef(0.0F, 24.0F * p_78088_7_, 0.0F); + this.wolfBody.render(p_78088_7_); + this.wolfLeg1.render(p_78088_7_); + this.wolfLeg2.render(p_78088_7_); + this.wolfLeg3.render(p_78088_7_); + this.wolfLeg4.render(p_78088_7_); + this.wolfTail.renderWithRotation(p_78088_7_); + this.wolfMane.render(p_78088_7_); + GL11.glPopMatrix(); + } + else + { + this.wolfHeadMain.renderWithRotation(p_78088_7_); + this.wolfBody.render(p_78088_7_); + this.wolfLeg1.render(p_78088_7_); + this.wolfLeg2.render(p_78088_7_); + this.wolfLeg3.render(p_78088_7_); + this.wolfLeg4.render(p_78088_7_); + this.wolfTail.renderWithRotation(p_78088_7_); + this.wolfMane.render(p_78088_7_); + } + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + EntityWolf entitywolf = (EntityWolf)p_78086_1_; + + if (entitywolf.isAngry()) + { + this.wolfTail.rotateAngleY = 0.0F; + } + else + { + this.wolfTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + if (entitywolf.isSitting()) + { + this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); + this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); + this.wolfMane.rotateAngleY = 0.0F; + this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); + this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); + this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); + this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg3.rotateAngleX = 5.811947F; + this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); + this.wolfLeg4.rotateAngleX = 5.811947F; + this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); + } + else + { + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); + this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + this.wolfLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + } + + this.wolfHeadMain.rotateAngleZ = entitywolf.getInterestedAngle(p_78086_4_) + entitywolf.getShakeAngle(p_78086_4_, 0.0F); + this.wolfMane.rotateAngleZ = entitywolf.getShakeAngle(p_78086_4_, -0.08F); + this.wolfBody.rotateAngleZ = entitywolf.getShakeAngle(p_78086_4_, -0.16F); + this.wolfTail.rotateAngleZ = entitywolf.getShakeAngle(p_78086_4_, -0.2F); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.wolfHeadMain.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.wolfHeadMain.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.wolfTail.rotateAngleX = p_78087_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombie.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombie.java new file mode 100644 index 0000000..6bae0d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombie.java @@ -0,0 +1,51 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelZombie extends ModelBiped +{ + private static final String __OBFID = "CL_00000869"; + + public ModelZombie() + { + this(0.0F, false); + } + + protected ModelZombie(float p_i1167_1_, float p_i1167_2_, int p_i1167_3_, int p_i1167_4_) + { + super(p_i1167_1_, p_i1167_2_, p_i1167_3_, p_i1167_4_); + } + + public ModelZombie(float p_i1168_1_, boolean p_i1168_2_) + { + super(p_i1168_1_, 0.0F, 64, p_i1168_2_ ? 32 : 64); + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + float f6 = MathHelper.sin(this.onGround * (float)Math.PI); + float f7 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombieVillager.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombieVillager.java new file mode 100644 index 0000000..c6ed8b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/ModelZombieVillager.java @@ -0,0 +1,65 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class ModelZombieVillager extends ModelBiped +{ + private static final String __OBFID = "CL_00000865"; + + public ModelZombieVillager() + { + this(0.0F, 0.0F, false); + } + + public ModelZombieVillager(float p_i1165_1_, float p_i1165_2_, boolean p_i1165_3_) + { + super(p_i1165_1_, 0.0F, 64, p_i1165_3_ ? 32 : 64); + + if (p_i1165_3_) + { + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, p_i1165_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + } + else + { + this.bipedHead = new ModelRenderer(this); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1165_2_, 0.0F); + this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, p_i1165_1_); + this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, p_i1165_1_); + } + } + + public int func_82897_a() + { + return 10; + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + float f6 = MathHelper.sin(this.onGround * (float)Math.PI); + float f7 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/PositionTextureVertex.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/PositionTextureVertex.java new file mode 100644 index 0000000..9420661 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/PositionTextureVertex.java @@ -0,0 +1,35 @@ +package net.minecraft.client.model; + +import net.minecraft.util.Vec3; + +public class PositionTextureVertex +{ + public Vec3 vector3D; + public float texturePositionX; + public float texturePositionY; + private static final String __OBFID = "CL_00000862"; + + public PositionTextureVertex(float p_i1158_1_, float p_i1158_2_, float p_i1158_3_, float p_i1158_4_, float p_i1158_5_) + { + this(Vec3.createVectorHelper((double)p_i1158_1_, (double)p_i1158_2_, (double)p_i1158_3_), p_i1158_4_, p_i1158_5_); + } + + public PositionTextureVertex setTexturePosition(float p_78240_1_, float p_78240_2_) + { + return new PositionTextureVertex(this, p_78240_1_, p_78240_2_); + } + + public PositionTextureVertex(PositionTextureVertex p_i1159_1_, float p_i1159_2_, float p_i1159_3_) + { + this.vector3D = p_i1159_1_.vector3D; + this.texturePositionX = p_i1159_2_; + this.texturePositionY = p_i1159_3_; + } + + public PositionTextureVertex(Vec3 p_i1160_1_, float p_i1160_2_, float p_i1160_3_) + { + this.vector3D = p_i1160_1_; + this.texturePositionX = p_i1160_2_; + this.texturePositionY = p_i1160_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/TextureOffset.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/TextureOffset.java new file mode 100644 index 0000000..f65c00c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/TextureOffset.java @@ -0,0 +1,20 @@ +package net.minecraft.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class TextureOffset +{ + /** The x coordinate offset of the texture */ + public final int textureOffsetX; + /** The y coordinate offset of the texture */ + public final int textureOffsetY; + private static final String __OBFID = "CL_00000875"; + + public TextureOffset(int p_i1175_1_, int p_i1175_2_) + { + this.textureOffsetX = p_i1175_1_; + this.textureOffsetY = p_i1175_2_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/model/TexturedQuad.java b/build/rfg/minecraft-src/java/net/minecraft/client/model/TexturedQuad.java new file mode 100644 index 0000000..6f7f7cf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/model/TexturedQuad.java @@ -0,0 +1,66 @@ +package net.minecraft.client.model; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.Vec3; + +public class TexturedQuad +{ + public PositionTextureVertex[] vertexPositions; + public int nVertices; + private boolean invertNormal; + private static final String __OBFID = "CL_00000850"; + + public TexturedQuad(PositionTextureVertex[] p_i1152_1_) + { + this.vertexPositions = p_i1152_1_; + this.nVertices = p_i1152_1_.length; + } + + public TexturedQuad(PositionTextureVertex[] p_i1153_1_, int p_i1153_2_, int p_i1153_3_, int p_i1153_4_, int p_i1153_5_, float p_i1153_6_, float p_i1153_7_) + { + this(p_i1153_1_); + float f2 = 0.0F / p_i1153_6_; + float f3 = 0.0F / p_i1153_7_; + p_i1153_1_[0] = p_i1153_1_[0].setTexturePosition((float)p_i1153_4_ / p_i1153_6_ - f2, (float)p_i1153_3_ / p_i1153_7_ + f3); + p_i1153_1_[1] = p_i1153_1_[1].setTexturePosition((float)p_i1153_2_ / p_i1153_6_ + f2, (float)p_i1153_3_ / p_i1153_7_ + f3); + p_i1153_1_[2] = p_i1153_1_[2].setTexturePosition((float)p_i1153_2_ / p_i1153_6_ + f2, (float)p_i1153_5_ / p_i1153_7_ - f3); + p_i1153_1_[3] = p_i1153_1_[3].setTexturePosition((float)p_i1153_4_ / p_i1153_6_ - f2, (float)p_i1153_5_ / p_i1153_7_ - f3); + } + + public void flipFace() + { + PositionTextureVertex[] apositiontexturevertex = new PositionTextureVertex[this.vertexPositions.length]; + + for (int i = 0; i < this.vertexPositions.length; ++i) + { + apositiontexturevertex[i] = this.vertexPositions[this.vertexPositions.length - i - 1]; + } + + this.vertexPositions = apositiontexturevertex; + } + + public void draw(Tessellator p_78236_1_, float p_78236_2_) + { + Vec3 vec3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D); + Vec3 vec31 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D); + Vec3 vec32 = vec31.crossProduct(vec3).normalize(); + p_78236_1_.startDrawingQuads(); + + if (this.invertNormal) + { + p_78236_1_.setNormal(-((float)vec32.xCoord), -((float)vec32.yCoord), -((float)vec32.zCoord)); + } + else + { + p_78236_1_.setNormal((float)vec32.xCoord, (float)vec32.yCoord, (float)vec32.zCoord); + } + + for (int i = 0; i < 4; ++i) + { + PositionTextureVertex positiontexturevertex = this.vertexPositions[i]; + p_78236_1_.addVertexWithUV((double)((float)positiontexturevertex.vector3D.xCoord * p_78236_2_), (double)((float)positiontexturevertex.vector3D.yCoord * p_78236_2_), (double)((float)positiontexturevertex.vector3D.zCoord * p_78236_2_), (double)positiontexturevertex.texturePositionX, (double)positiontexturevertex.texturePositionY); + } + + p_78236_1_.draw(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ChunkProviderClient.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ChunkProviderClient.java new file mode 100644 index 0000000..73d03e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ChunkProviderClient.java @@ -0,0 +1,171 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ChunkProviderClient implements IChunkProvider +{ + private static final Logger logger = LogManager.getLogger(); + /** + * The completely empty chunk used by ChunkProviderClient when field_73236_b doesn't contain the requested + * coordinates. + */ + private Chunk blankChunk; + /** The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains. */ + private LongHashMap chunkMapping = new LongHashMap(); + /** + * This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache), + * with identical contents to chunkMapping's values. However it is never actually added to. + */ + private List chunkListing = new ArrayList(); + /** Reference to the World object. */ + private World worldObj; + private static final String __OBFID = "CL_00000880"; + + public ChunkProviderClient(World p_i1184_1_) + { + this.blankChunk = new EmptyChunk(p_i1184_1_, 0, 0); + this.worldObj = p_i1184_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return true; + } + + /** + * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set + * to false + */ + public void unloadChunk(int p_73234_1_, int p_73234_2_) + { + Chunk chunk = this.provideChunk(p_73234_1_, p_73234_2_); + + if (!chunk.isEmpty()) + { + chunk.onChunkUnload(); + } + + this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(p_73234_1_, p_73234_2_)); + this.chunkListing.remove(chunk); + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_); + this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk); + this.chunkListing.add(chunk); + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); + chunk.isChunkLoaded = true; + return chunk; + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + Chunk chunk = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_)); + return chunk == null ? this.blankChunk : chunk; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + long i = System.currentTimeMillis(); + Iterator iterator = this.chunkListing.iterator(); + + while (iterator.hasNext()) + { + Chunk chunk = (Chunk)iterator.next(); + chunk.func_150804_b(System.currentTimeMillis() - i > 5L); + } + + if (System.currentTimeMillis() - i > 100L) + { + logger.info("Warning: Clientside chunk ticking took {} ms", new Object[] {Long.valueOf(System.currentTimeMillis() - i)}); + } + + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return false; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) {} + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements() + ", " + this.chunkListing.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + return null; + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + return null; + } + + public int getLoadedChunkCount() + { + return this.chunkListing.size(); + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/GuiConnecting.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/GuiConnecting.java new file mode 100644 index 0000000..35720b4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/GuiConnecting.java @@ -0,0 +1,172 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.util.concurrent.GenericFutureListener; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.client.resources.I18n; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class GuiConnecting extends GuiScreen +{ + private static final AtomicInteger field_146372_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private NetworkManager field_146371_g; + private boolean field_146373_h; + private final GuiScreen field_146374_i; + private static final String __OBFID = "CL_00000685"; + + public GuiConnecting(GuiScreen p_i1181_1_, Minecraft p_i1181_2_, ServerData p_i1181_3_) + { + this.mc = p_i1181_2_; + this.field_146374_i = p_i1181_1_; + ServerAddress serveraddress = ServerAddress.func_78860_a(p_i1181_3_.serverIP); + p_i1181_2_.loadWorld((WorldClient)null); + p_i1181_2_.setServerData(p_i1181_3_); + this.func_146367_a(serveraddress.getIP(), serveraddress.getPort()); + } + + public GuiConnecting(GuiScreen p_i1182_1_, Minecraft p_i1182_2_, String p_i1182_3_, int p_i1182_4_) + { + this.mc = p_i1182_2_; + this.field_146374_i = p_i1182_1_; + p_i1182_2_.loadWorld((WorldClient)null); + this.func_146367_a(p_i1182_3_, p_i1182_4_); + } + + private void func_146367_a(final String ip, final int port) + { + logger.info("Connecting to " + ip + ", " + port); + (new Thread("Server Connector #" + field_146372_a.incrementAndGet()) + { + private static final String __OBFID = "CL_00000686"; + public void run() + { + InetAddress inetaddress = null; + + try + { + if (GuiConnecting.this.field_146373_h) + { + return; + } + + inetaddress = InetAddress.getByName(ip); + GuiConnecting.this.field_146371_g = NetworkManager.provideLanClient(inetaddress, port); + GuiConnecting.this.field_146371_g.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.field_146371_g, GuiConnecting.this.mc, GuiConnecting.this.field_146374_i)); + GuiConnecting.this.field_146371_g.scheduleOutboundPacket(new C00Handshake(5, ip, port, EnumConnectionState.LOGIN), new GenericFutureListener[0]); + GuiConnecting.this.field_146371_g.scheduleOutboundPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().func_148256_e()), new GenericFutureListener[0]); + } + catch (UnknownHostException unknownhostexception) + { + if (GuiConnecting.this.field_146373_h) + { + return; + } + + GuiConnecting.logger.error("Couldn\'t connect to server", unknownhostexception); + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.field_146374_i, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Unknown host"}))); + } + catch (Exception exception) + { + if (GuiConnecting.this.field_146373_h) + { + return; + } + + GuiConnecting.logger.error("Couldn\'t connect to server", exception); + String s = exception.toString(); + + if (inetaddress != null) + { + String s1 = inetaddress.toString() + ":" + port; + s = s.replaceAll(s1, ""); + } + + GuiConnecting.this.mc.displayGuiScreen(new GuiDisconnected(GuiConnecting.this.field_146374_i, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {s}))); + } + } + }).start(); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() + { + if (this.field_146371_g != null) + { + if (this.field_146371_g.isChannelOpen()) + { + this.field_146371_g.processReceivedPackets(); + } + else if (this.field_146371_g.getExitMessage() != null) + { + this.field_146371_g.getNetHandler().onDisconnect(this.field_146371_g.getExitMessage()); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + protected void keyTyped(char typedChar, int keyCode) {} + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 + 50, I18n.format("gui.cancel", new Object[0]))); + } + + protected void actionPerformed(GuiButton button) + { + if (button.id == 0) + { + this.field_146373_h = true; + + if (this.field_146371_g != null) + { + this.field_146371_g.closeChannel(new ChatComponentText("Aborted")); + } + + this.mc.displayGuiScreen(this.field_146374_i); + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + this.drawDefaultBackground(); + + if (this.field_146371_g == null) + { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.connecting", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + } + else + { + this.drawCenteredString(this.fontRendererObj, I18n.format("connect.authorizing", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/PlayerControllerMP.java new file mode 100644 index 0000000..ad5246a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -0,0 +1,554 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; + +@SideOnly(Side.CLIENT) +public class PlayerControllerMP +{ + /** The Minecraft instance. */ + private final Minecraft mc; + private final NetHandlerPlayClient netClientHandler; + /** PosX of the current block being destroyed */ + private int currentBlockX = -1; + /** PosY of the current block being destroyed */ + private int currentBlockY = -1; + /** PosZ of the current block being destroyed */ + private int currentblockZ = -1; + /** The Item currently being used to destroy a block */ + private ItemStack currentItemHittingBlock; + /** Current block damage (MP) */ + private float curBlockDamageMP; + /** Tick counter, when it hits 4 it resets back to 0 and plays the step sound */ + private float stepSoundTickCounter; + /** Delays the first damage on the block after the first click on the block */ + private int blockHitDelay; + /** Tells if the player is hitting a block */ + private boolean isHittingBlock; + /** Current game type for the player */ + private WorldSettings.GameType currentGameType; + /** Index of the current item held by the player in the inventory hotbar */ + private int currentPlayerItem; + private static final String __OBFID = "CL_00000881"; + + public PlayerControllerMP(Minecraft p_i45062_1_, NetHandlerPlayClient p_i45062_2_) + { + this.currentGameType = WorldSettings.GameType.SURVIVAL; + this.mc = p_i45062_1_; + this.netClientHandler = p_i45062_2_; + } + + /** + * Block dig operation in creative mode (instantly digs the block). + */ + public static void clickBlockCreative(Minecraft minecraftIn, PlayerControllerMP playerController, int x, int y, int z, int side) + { + if (!minecraftIn.theWorld.extinguishFire(minecraftIn.thePlayer, x, y, z, side)) + { + playerController.onPlayerDestroyBlock(x, y, z, side); + } + } + + /** + * Sets player capabilities depending on current gametype. params: player + */ + public void setPlayerCapabilities(EntityPlayer p_78748_1_) + { + this.currentGameType.configurePlayerCapabilities(p_78748_1_.capabilities); + } + + /** + * If modified to return true, the player spins around slowly around (0, 68.5, 0). The GUI is disabled, the view is + * set to first person, and both chat and menu are disabled. Unless the server is modified to ignore illegal + * stances, attempting to enter a world at all will result in an immediate kick due to an illegal stance. Appears to + * be left-over debug, or demo code. + */ + public boolean enableEverythingIsScrewedUpMode() + { + return false; + } + + /** + * Sets the game type for the player. + */ + public void setGameType(WorldSettings.GameType p_78746_1_) + { + this.currentGameType = p_78746_1_; + this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); + } + + /** + * Flips the player around. Args: player + */ + public void flipPlayer(EntityPlayer player) + { + player.rotationYaw = -180.0F; + } + + public boolean shouldDrawHUD() + { + return this.currentGameType.isSurvivalOrAdventure(); + } + + /** + * Called when a player completes the destruction of a block + */ + public boolean onPlayerDestroyBlock(int x, int y, int z, int side) + { + ItemStack stack = mc.thePlayer.getCurrentEquippedItem(); + if (stack != null && stack.getItem() != null && stack.getItem().onBlockStartBreak(stack, x, y, z, mc.thePlayer)) + { + return false; + } + + if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(x, y, z)) + { + return false; + } + else if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) + { + return false; + } + else + { + WorldClient worldclient = this.mc.theWorld; + Block block = worldclient.getBlock(x, y, z); + + if (block.getMaterial() == Material.air) + { + return false; + } + else + { + worldclient.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (worldclient.getBlockMetadata(x, y, z) << 12)); + int i1 = worldclient.getBlockMetadata(x, y, z); + boolean flag = block.removedByPlayer(worldclient, mc.thePlayer, x, y, z); + + if (flag) + { + block.onBlockDestroyedByPlayer(worldclient, x, y, z, i1); + } + + this.currentBlockY = -1; + + if (!this.currentGameType.isCreative()) + { + ItemStack itemstack = this.mc.thePlayer.getCurrentEquippedItem(); + + if (itemstack != null) + { + itemstack.func_150999_a(worldclient, block, x, y, z, this.mc.thePlayer); + + if (itemstack.stackSize == 0) + { + this.mc.thePlayer.destroyCurrentEquippedItem(); + } + } + } + + return flag; + } + } + } + + /** + * Called by Minecraft class when the player is hitting a block with an item. Args: x, y, z, side + */ + public void clickBlock(int x, int y, int z, int side) + { + if (!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(x, y, z)) + { + if (this.currentGameType.isCreative()) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, side)); + clickBlockCreative(this.mc, this, x, y, z, side); + this.blockHitDelay = 5; + } + else if (!this.isHittingBlock || !this.sameToolAndBlock(x, y, z)) + { + if (this.isHittingBlock) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, side)); + } + + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, side)); + Block block = this.mc.theWorld.getBlock(x, y, z); + boolean flag = block.getMaterial() != Material.air; + + if (flag && this.curBlockDamageMP == 0.0F) + { + block.onBlockClicked(this.mc.theWorld, x, y, z, this.mc.thePlayer); + } + + if (flag && block.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, x, y, z) >= 1.0F) + { + this.onPlayerDestroyBlock(x, y, z, side); + } + else + { + this.isHittingBlock = true; + this.currentBlockX = x; + this.currentBlockY = y; + this.currentblockZ = z; + this.currentItemHittingBlock = this.mc.thePlayer.getHeldItem(); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } + } + } + } + + /** + * Resets current block damage and field_78778_j + */ + public void resetBlockRemoving() + { + if (this.isHittingBlock) + { + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1)); + } + + this.isHittingBlock = false; + this.curBlockDamageMP = 0.0F; + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, -1); + } + + /** + * Called when a player damages a block and updates damage counters + */ + public void onPlayerDamageBlock(int x, int y, int z, int side) + { + this.syncCurrentPlayItem(); + + if (this.blockHitDelay > 0) + { + --this.blockHitDelay; + } + else if (this.currentGameType.isCreative()) + { + this.blockHitDelay = 5; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, side)); + clickBlockCreative(this.mc, this, x, y, z, side); + } + else + { + if (this.sameToolAndBlock(x, y, z)) + { + Block block = this.mc.theWorld.getBlock(x, y, z); + + if (block.getMaterial() == Material.air) + { + this.isHittingBlock = false; + return; + } + + this.curBlockDamageMP += block.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, x, y, z); + + if (this.stepSoundTickCounter % 4.0F == 0.0F) + { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(block.stepSound.getStepResourcePath()), (block.stepSound.getVolume() + 1.0F) / 8.0F, block.stepSound.getPitch() * 0.5F, (float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F)); + } + + ++this.stepSoundTickCounter; + + if (this.curBlockDamageMP >= 1.0F) + { + this.isHittingBlock = false; + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, side)); + this.onPlayerDestroyBlock(x, y, z, side); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.blockHitDelay = 5; + } + + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.getEntityId(), this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } + else + { + this.clickBlock(x, y, z, side); + } + } + } + + /** + * player reach distance = 4F + */ + public float getBlockReachDistance() + { + return this.currentGameType.isCreative() ? 5.0F : 4.5F; + } + + public void updateController() + { + this.syncCurrentPlayItem(); + + if (this.netClientHandler.getNetworkManager().isChannelOpen()) + { + this.netClientHandler.getNetworkManager().processReceivedPackets(); + } + else if (this.netClientHandler.getNetworkManager().getExitMessage() != null) + { + this.netClientHandler.getNetworkManager().getNetHandler().onDisconnect(this.netClientHandler.getNetworkManager().getExitMessage()); + } + else + { + this.netClientHandler.getNetworkManager().getNetHandler().onDisconnect(new ChatComponentText("Disconnected from server")); + } + } + + private boolean sameToolAndBlock(int x, int y, int z) + { + ItemStack itemstack = this.mc.thePlayer.getHeldItem(); + boolean flag = this.currentItemHittingBlock == null && itemstack == null; + + if (this.currentItemHittingBlock != null && itemstack != null) + { + flag = itemstack.getItem() == this.currentItemHittingBlock.getItem() && ItemStack.areItemStackTagsEqual(itemstack, this.currentItemHittingBlock) && (itemstack.isItemStackDamageable() || itemstack.getItemDamage() == this.currentItemHittingBlock.getItemDamage()); + } + + return x == this.currentBlockX && y == this.currentBlockY && z == this.currentblockZ && flag; + } + + /** + * Syncs the current player item with the server + */ + private void syncCurrentPlayItem() + { + int i = this.mc.thePlayer.inventory.currentItem; + + if (i != this.currentPlayerItem) + { + this.currentPlayerItem = i; + this.netClientHandler.addToSendQueue(new C09PacketHeldItemChange(this.currentPlayerItem)); + } + } + + /** + * Handles a players right click. Args: player, world, x, y, z, side, hitVec + */ + public boolean onPlayerRightClick(EntityPlayer player, World worldIn, ItemStack itemStackIn, int x, int y, int z, int side, Vec3 hitVector) + { + this.syncCurrentPlayItem(); + float f = (float)hitVector.xCoord - (float)x; + float f1 = (float)hitVector.yCoord - (float)y; + float f2 = (float)hitVector.zCoord - (float)z; + boolean flag = false; + + if (itemStackIn != null && + itemStackIn.getItem() != null && + itemStackIn.getItem().onItemUseFirst(itemStackIn, player, worldIn, x, y, z, side, f, f1, f2)) + { + return true; + } + + if (!player.isSneaking() || player.getHeldItem() == null || player.getHeldItem().getItem().doesSneakBypassUse(worldIn, x, y, z, player)) + { + flag = worldIn.getBlock(x, y, z).onBlockActivated(worldIn, x, y, z, player, side, f, f1, f2); + } + + if (!flag && itemStackIn != null && itemStackIn.getItem() instanceof ItemBlock) + { + ItemBlock itemblock = (ItemBlock)itemStackIn.getItem(); + + if (!itemblock.func_150936_a(worldIn, x, y, z, side, player, itemStackIn)) + { + return false; + } + } + + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(x, y, z, side, player.inventory.getCurrentItem(), f, f1, f2)); + + if (flag) + { + return true; + } + else if (itemStackIn == null) + { + return false; + } + else if (this.currentGameType.isCreative()) + { + int j1 = itemStackIn.getItemDamage(); + int i1 = itemStackIn.stackSize; + boolean flag1 = itemStackIn.tryPlaceItemIntoWorld(player, worldIn, x, y, z, side, f, f1, f2); + itemStackIn.setItemDamage(j1); + itemStackIn.stackSize = i1; + return flag1; + } + else + { + if (!itemStackIn.tryPlaceItemIntoWorld(player, worldIn, x, y, z, side, f, f1, f2)) + { + return false; + } + if (itemStackIn.stackSize <= 0) + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, itemStackIn)); + } + return true; + } + } + + /** + * Notifies the server of things like consuming food, etc... + */ + public boolean sendUseItem(EntityPlayer player, World worldIn, ItemStack itemStackIn) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(-1, -1, -1, 255, player.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); + int i = itemStackIn.stackSize; + ItemStack itemstack1 = itemStackIn.useItemRightClick(worldIn, player); + + if (itemstack1 == itemStackIn && (itemstack1 == null || itemstack1.stackSize == i)) + { + return false; + } + else + { + player.inventory.mainInventory[player.inventory.currentItem] = itemstack1; + + if (itemstack1.stackSize <= 0) + { + player.inventory.mainInventory[player.inventory.currentItem] = null; + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, itemstack1)); + } + + return true; + } + } + + public EntityClientPlayerMP func_147493_a(World worldIn, StatFileWriter stats) + { + return new EntityClientPlayerMP(this.mc, worldIn, this.mc.getSession(), this.netClientHandler, stats); + } + + /** + * Attacks an entity + */ + public void attackEntity(EntityPlayer player, Entity targetEntity) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK)); + player.attackTargetEntityWithCurrentItem(targetEntity); + } + + /** + * Send packet to server - player is interacting with another entity (left click) + */ + public boolean interactWithEntitySendPacket(EntityPlayer player, Entity targetEntity) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.INTERACT)); + return player.interactWith(targetEntity); + } + + public ItemStack windowClick(int windowId, int slotId, int p_78753_3_, int p_78753_4_, EntityPlayer player) + { + short short1 = player.openContainer.getNextTransactionID(player.inventory); + ItemStack itemstack = player.openContainer.slotClick(slotId, p_78753_3_, p_78753_4_, player); + this.netClientHandler.addToSendQueue(new C0EPacketClickWindow(windowId, slotId, p_78753_3_, p_78753_4_, itemstack, short1)); + return itemstack; + } + + /** + * GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the + * enchantment action the player has taken. + */ + public void sendEnchantPacket(int p_78756_1_, int p_78756_2_) + { + this.netClientHandler.addToSendQueue(new C11PacketEnchantItem(p_78756_1_, p_78756_2_)); + } + + /** + * Used in PlayerControllerMP to update the server with an ItemStack in a slot. + */ + public void sendSlotPacket(ItemStack itemStackIn, int slotId) + { + if (this.currentGameType.isCreative()) + { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(slotId, itemStackIn)); + } + } + + /** + * Sends a Packet107 to the server to drop the item on the ground + */ + public void sendPacketDropItem(ItemStack itemStackIn) + { + if (this.currentGameType.isCreative() && itemStackIn != null) + { + this.netClientHandler.addToSendQueue(new C10PacketCreativeInventoryAction(-1, itemStackIn)); + } + } + + public void onStoppedUsingItem(EntityPlayer player) + { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new C07PacketPlayerDigging(5, 0, 0, 0, 255)); + player.stopUsingItem(); + } + + public boolean gameIsSurvivalOrAdventure() + { + return this.currentGameType.isSurvivalOrAdventure(); + } + + /** + * Checks if the player is not creative, used for checking if it should break a block instantly + */ + public boolean isNotCreative() + { + return !this.currentGameType.isCreative(); + } + + /** + * returns true if player is in creative mode + */ + public boolean isInCreativeMode() + { + return this.currentGameType.isCreative(); + } + + /** + * true for hitting entities far away. + */ + public boolean extendedReach() + { + return this.currentGameType.isCreative(); + } + + public boolean func_110738_j() + { + return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerAddress.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerAddress.java new file mode 100644 index 0000000..e34c25c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerAddress.java @@ -0,0 +1,117 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Hashtable; +import javax.naming.directory.Attributes; +import javax.naming.directory.InitialDirContext; + +@SideOnly(Side.CLIENT) +public class ServerAddress +{ + private final String ipAddress; + private final int serverPort; + private static final String __OBFID = "CL_00000889"; + + protected ServerAddress(String p_i1192_1_, int p_i1192_2_) + { + this.ipAddress = p_i1192_1_; + this.serverPort = p_i1192_2_; + } + + public String getIP() + { + return this.ipAddress; + } + + public int getPort() + { + return this.serverPort; + } + + public static ServerAddress func_78860_a(String p_78860_0_) + { + if (p_78860_0_ == null) + { + return null; + } + else + { + String[] astring = p_78860_0_.split(":"); + + if (p_78860_0_.startsWith("[")) + { + int i = p_78860_0_.indexOf("]"); + + if (i > 0) + { + String s1 = p_78860_0_.substring(1, i); + String s2 = p_78860_0_.substring(i + 1).trim(); + + if (s2.startsWith(":") && s2.length() > 0) + { + s2 = s2.substring(1); + astring = new String[] {s1, s2}; + } + else + { + astring = new String[] {s1}; + } + } + } + + if (astring.length > 2) + { + astring = new String[] {p_78860_0_}; + } + + String s3 = astring[0]; + int j = astring.length > 1 ? parseIntWithDefault(astring[1], 25565) : 25565; + + if (j == 25565) + { + String[] astring1 = getServerAddress(s3); + s3 = astring1[0]; + j = parseIntWithDefault(astring1[1], 25565); + } + + return new ServerAddress(s3, j); + } + } + + /** + * Returns a server's address and port for the specified hostname, looking up the SRV record if possible + */ + private static String[] getServerAddress(String p_78863_0_) + { + try + { + String s1 = "com.sun.jndi.dns.DnsContextFactory"; + Class.forName("com.sun.jndi.dns.DnsContextFactory"); + Hashtable hashtable = new Hashtable(); + hashtable.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + hashtable.put("java.naming.provider.url", "dns:"); + hashtable.put("com.sun.jndi.dns.timeout.retries", "1"); + InitialDirContext initialdircontext = new InitialDirContext(hashtable); + Attributes attributes = initialdircontext.getAttributes("_minecraft._tcp." + p_78863_0_, new String[] {"SRV"}); + String[] astring = attributes.get("srv").get().toString().split(" ", 4); + return new String[] {astring[3], astring[2]}; + } + catch (Throwable throwable) + { + return new String[] {p_78863_0_, Integer.toString(25565)}; + } + } + + private static int parseIntWithDefault(String p_78862_0_, int p_78862_1_) + { + try + { + return Integer.parseInt(p_78862_0_.trim()); + } + catch (Exception exception) + { + return p_78862_1_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerData.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerData.java new file mode 100644 index 0000000..466bdbb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerData.java @@ -0,0 +1,164 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +@SideOnly(Side.CLIENT) +public class ServerData +{ + public String serverName; + public String serverIP; + /** + * the string indicating number of players on and capacity of the server that is shown on the server browser (i.e. + * "5/20" meaning 5 slots used out of 20 slots total) + */ + public String populationInfo; + /** + * (better variable name would be 'hostname') server name as displayed in the server browser's second line (grey + * text) + */ + public String serverMOTD; + /** last server ping that showed up in the server browser */ + public long pingToServer; + public int field_82821_f; + /** Game version for this server. */ + public String gameVersion; + public boolean field_78841_f; + public String field_147412_i; + private ServerData.ServerResourceMode field_152587_j; + private String field_147411_m; + private boolean field_152588_l; + private static final String __OBFID = "CL_00000890"; + + public ServerData(String p_i1193_1_, String p_i1193_2_) + { + this.field_82821_f = 5; + this.gameVersion = "1.7.10"; + this.field_152587_j = ServerData.ServerResourceMode.PROMPT; + this.serverName = p_i1193_1_; + this.serverIP = p_i1193_2_; + } + + public ServerData(String p_i1055_1_, String p_i1055_2_, boolean p_i1055_3_) + { + this(p_i1055_1_, p_i1055_2_); + this.field_152588_l = p_i1055_3_; + } + + /** + * Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures. + */ + public NBTTagCompound getNBTCompound() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("name", this.serverName); + nbttagcompound.setString("ip", this.serverIP); + + if (this.field_147411_m != null) + { + nbttagcompound.setString("icon", this.field_147411_m); + } + + if (this.field_152587_j == ServerData.ServerResourceMode.ENABLED) + { + nbttagcompound.setBoolean("acceptTextures", true); + } + else if (this.field_152587_j == ServerData.ServerResourceMode.DISABLED) + { + nbttagcompound.setBoolean("acceptTextures", false); + } + + return nbttagcompound; + } + + public ServerData.ServerResourceMode func_152586_b() + { + return this.field_152587_j; + } + + public void func_152584_a(ServerData.ServerResourceMode mode) + { + this.field_152587_j = mode; + } + + /** + * Takes an NBTTagCompound with 'name' and 'ip' keys, returns a ServerData instance. + */ + public static ServerData getServerDataFromNBTCompound(NBTTagCompound nbtCompound) + { + ServerData serverdata = new ServerData(nbtCompound.getString("name"), nbtCompound.getString("ip")); + + if (nbtCompound.hasKey("icon", 8)) + { + serverdata.func_147407_a(nbtCompound.getString("icon")); + } + + if (nbtCompound.hasKey("acceptTextures", 1)) + { + if (nbtCompound.getBoolean("acceptTextures")) + { + serverdata.func_152584_a(ServerData.ServerResourceMode.ENABLED); + } + else + { + serverdata.func_152584_a(ServerData.ServerResourceMode.DISABLED); + } + } + else + { + serverdata.func_152584_a(ServerData.ServerResourceMode.PROMPT); + } + + return serverdata; + } + + /** + * Returns the base-64 encoded representation of the server's icon, or null if not available + */ + public String getBase64EncodedIconData() + { + return this.field_147411_m; + } + + public void func_147407_a(String icon) + { + this.field_147411_m = icon; + } + + public void func_152583_a(ServerData serverDataIn) + { + this.serverIP = serverDataIn.serverIP; + this.serverName = serverDataIn.serverName; + this.func_152584_a(serverDataIn.func_152586_b()); + this.field_147411_m = serverDataIn.field_147411_m; + } + + public boolean func_152585_d() + { + return this.field_152588_l; + } + + @SideOnly(Side.CLIENT) + public static enum ServerResourceMode + { + ENABLED("enabled"), + DISABLED("disabled"), + PROMPT("prompt"); + private final IChatComponent field_152594_d; + + private static final String __OBFID = "CL_00001833"; + + private ServerResourceMode(String p_i1053_3_) + { + this.field_152594_d = new ChatComponentTranslation("addServer.resourcePack." + p_i1053_3_, new Object[0]); + } + + public IChatComponent func_152589_a() + { + return this.field_152594_d; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerList.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerList.java new file mode 100644 index 0000000..94c9468 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ServerList.java @@ -0,0 +1,154 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ServerList +{ + private static final Logger logger = LogManager.getLogger(); + /** The Minecraft instance. */ + private final Minecraft mc; + /** List of ServerData instances. */ + private final List servers = new ArrayList(); + private static final String __OBFID = "CL_00000891"; + + public ServerList(Minecraft p_i1194_1_) + { + this.mc = p_i1194_1_; + this.loadServerList(); + } + + /** + * Loads a list of servers from servers.dat, by running ServerData.getServerDataFromNBTCompound on each NBT compound + * found in the "servers" tag list. + */ + public void loadServerList() + { + try + { + this.servers.clear(); + NBTTagCompound nbttagcompound = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat")); + + if (nbttagcompound == null) + { + return; + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("servers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.servers.add(ServerData.getServerDataFromNBTCompound(nbttaglist.getCompoundTagAt(i))); + } + } + catch (Exception exception) + { + logger.error("Couldn\'t load server list", exception); + } + } + + /** + * Runs getNBTCompound on each ServerData instance, puts everything into a "servers" NBT list and writes it to + * servers.dat. + */ + public void saveServerList() + { + try + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.servers.iterator(); + + while (iterator.hasNext()) + { + ServerData serverdata = (ServerData)iterator.next(); + nbttaglist.appendTag(serverdata.getNBTCompound()); + } + + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("servers", nbttaglist); + CompressedStreamTools.safeWrite(nbttagcompound, new File(this.mc.mcDataDir, "servers.dat")); + } + catch (Exception exception) + { + logger.error("Couldn\'t save server list", exception); + } + } + + /** + * Gets the ServerData instance stored for the given index in the list. + */ + public ServerData getServerData(int p_78850_1_) + { + return (ServerData)this.servers.get(p_78850_1_); + } + + /** + * Removes the ServerData instance stored for the given index in the list. + */ + public void removeServerData(int p_78851_1_) + { + this.servers.remove(p_78851_1_); + } + + /** + * Adds the given ServerData instance to the list. + */ + public void addServerData(ServerData p_78849_1_) + { + this.servers.add(p_78849_1_); + } + + /** + * Counts the number of ServerData instances in the list. + */ + public int countServers() + { + return this.servers.size(); + } + + /** + * Takes two list indexes, and swaps their order around. + */ + public void swapServers(int p_78857_1_, int p_78857_2_) + { + ServerData serverdata = this.getServerData(p_78857_1_); + this.servers.set(p_78857_1_, this.getServerData(p_78857_2_)); + this.servers.set(p_78857_2_, serverdata); + this.saveServerList(); + } + + public void func_147413_a(int p_147413_1_, ServerData p_147413_2_) + { + this.servers.set(p_147413_1_, p_147413_2_); + } + + public static void func_147414_b(ServerData p_147414_0_) + { + ServerList serverlist = new ServerList(Minecraft.getMinecraft()); + serverlist.loadServerList(); + + for (int i = 0; i < serverlist.countServers(); ++i) + { + ServerData serverdata1 = serverlist.getServerData(i); + + if (serverdata1.serverName.equals(p_147414_0_.serverName) && serverdata1.serverIP.equals(p_147414_0_.serverIP)) + { + serverlist.func_147413_a(i, p_147414_0_); + break; + } + } + + serverlist.saveServerList(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java new file mode 100644 index 0000000..68b8c14 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/ThreadLanServerPing.java @@ -0,0 +1,122 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ThreadLanServerPing extends Thread +{ + private static final AtomicInteger field_148658_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private final String motd; + /** The socket we're using to send packets on. */ + private final DatagramSocket socket; + private boolean isStopping = true; + private final String address; + private static final String __OBFID = "CL_00001137"; + + public ThreadLanServerPing(String p_i1321_1_, String p_i1321_2_) throws IOException + { + super("LanServerPinger #" + field_148658_a.incrementAndGet()); + this.motd = p_i1321_1_; + this.address = p_i1321_2_; + this.setDaemon(true); + this.socket = new DatagramSocket(); + } + + public void run() + { + String s = getPingResponse(this.motd, this.address); + byte[] abyte = s.getBytes(); + + while (!this.isInterrupted() && this.isStopping) + { + try + { + InetAddress inetaddress = InetAddress.getByName("224.0.2.60"); + DatagramPacket datagrampacket = new DatagramPacket(abyte, abyte.length, inetaddress, 4445); + this.socket.send(datagrampacket); + } + catch (IOException ioexception) + { + logger.warn("LanServerPinger: " + ioexception.getMessage()); + break; + } + + try + { + sleep(1500L); + } + catch (InterruptedException interruptedexception) + { + ; + } + } + } + + public void interrupt() + { + super.interrupt(); + this.isStopping = false; + } + + public static String getPingResponse(String p_77525_0_, String p_77525_1_) + { + return "[MOTD]" + p_77525_0_ + "[/MOTD][AD]" + p_77525_1_ + "[/AD]"; + } + + public static String getMotdFromPingResponse(String p_77524_0_) + { + int i = p_77524_0_.indexOf("[MOTD]"); + + if (i < 0) + { + return "missing no"; + } + else + { + int j = p_77524_0_.indexOf("[/MOTD]", i + "[MOTD]".length()); + return j < i ? "missing no" : p_77524_0_.substring(i + "[MOTD]".length(), j); + } + } + + public static String getAdFromPingResponse(String p_77523_0_) + { + int i = p_77523_0_.indexOf("[/MOTD]"); + + if (i < 0) + { + return null; + } + else + { + int j = p_77523_0_.indexOf("[/MOTD]", i + "[/MOTD]".length()); + + if (j >= 0) + { + return null; + } + else + { + int k = p_77523_0_.indexOf("[AD]", i + "[/MOTD]".length()); + + if (k < 0) + { + return null; + } + else + { + int l = p_77523_0_.indexOf("[/AD]", k + "[AD]".length()); + return l < k ? null : p_77523_0_.substring(k + "[AD]".length(), l); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/WorldClient.java b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/WorldClient.java new file mode 100644 index 0000000..dce09c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/multiplayer/WorldClient.java @@ -0,0 +1,497 @@ +package net.minecraft.client.multiplayer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.MovingSoundMinecart; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.particle.EntityFireworkStarterFX; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.storage.SaveHandlerMP; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; + +@SideOnly(Side.CLIENT) +public class WorldClient extends World +{ + /** The packets that need to be sent to the server. */ + private NetHandlerPlayClient sendQueue; + /** The ChunkProviderClient instance */ + private ChunkProviderClient clientChunkProvider; + /** The hash set of entities handled by this client. Uses the entity's ID as the hash set's key. */ + private IntHashMap entityHashSet = new IntHashMap(); + /** Contains all entities for this client, both spawned and non-spawned. */ + private Set entityList = new HashSet(); + /** + * Contains all entities for this client that were not spawned due to a non-present chunk. The game will attempt to + * spawn up to 10 pending entities with each subsequent tick until the spawn queue is empty. + */ + private Set entitySpawnQueue = new HashSet(); + private final Minecraft mc = Minecraft.getMinecraft(); + private final Set previousActiveChunkSet = new HashSet(); + private static final String __OBFID = "CL_00000882"; + + public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_) + { + super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_2_, p_i45063_5_); + this.sendQueue = p_i45063_1_; + this.difficultySetting = p_i45063_4_; + this.mapStorage = p_i45063_1_.mapStorageOrigin; + this.isRemote = true; + this.finishSetup(); + this.setSpawnLocation(8, 64, 8); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this)); + } + + /** + * Runs a single tick for the world + */ + public void tick() + { + super.tick(); + this.func_82738_a(this.getTotalWorldTime() + 1L); + + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) + { + this.setWorldTime(this.getWorldTime() + 1L); + } + + this.theProfiler.startSection("reEntryProcessing"); + + for (int i = 0; i < 10 && !this.entitySpawnQueue.isEmpty(); ++i) + { + Entity entity = (Entity)this.entitySpawnQueue.iterator().next(); + this.entitySpawnQueue.remove(entity); + + if (!this.loadedEntityList.contains(entity)) + { + this.spawnEntityInWorld(entity); + } + } + + this.theProfiler.endStartSection("connection"); + this.sendQueue.onNetworkTick(); + this.theProfiler.endStartSection("chunkCache"); + this.clientChunkProvider.unloadQueuedChunks(); + this.theProfiler.endStartSection("blocks"); + this.func_147456_g(); + this.theProfiler.endSection(); + } + + /** + * Invalidates an AABB region of blocks from the receive queue, in the event that the block has been modified + * client-side in the intervening 80 receive ticks. + */ + public void invalidateBlockReceiveRegion(int p_73031_1_, int p_73031_2_, int p_73031_3_, int p_73031_4_, int p_73031_5_, int p_73031_6_) {} + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected IChunkProvider createChunkProvider() + { + this.clientChunkProvider = new ChunkProviderClient(this); + return this.clientChunkProvider; + } + + protected void func_147456_g() + { + super.func_147456_g(); + this.previousActiveChunkSet.retainAll(this.activeChunkSet); + + if (this.previousActiveChunkSet.size() == this.activeChunkSet.size()) + { + this.previousActiveChunkSet.clear(); + } + + int i = 0; + Iterator iterator = this.activeChunkSet.iterator(); + + while (iterator.hasNext()) + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator.next(); + + if (!this.previousActiveChunkSet.contains(chunkcoordintpair)) + { + int j = chunkcoordintpair.chunkXPos * 16; + int k = chunkcoordintpair.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + this.func_147467_a(j, k, chunk); + this.theProfiler.endSection(); + this.previousActiveChunkSet.add(chunkcoordintpair); + ++i; + + if (i >= 10) + { + return; + } + } + } + } + + public void doPreChunk(int p_73025_1_, int p_73025_2_, boolean p_73025_3_) + { + if (p_73025_3_) + { + this.clientChunkProvider.loadChunk(p_73025_1_, p_73025_2_); + } + else + { + this.clientChunkProvider.unloadChunk(p_73025_1_, p_73025_2_); + } + + if (!p_73025_3_) + { + this.markBlockRangeForRenderUpdate(p_73025_1_ * 16, 0, p_73025_2_ * 16, p_73025_1_ * 16 + 15, 256, p_73025_2_ * 16 + 15); + } + } + + /** + * Called to place all entities as part of a world + */ + public boolean spawnEntityInWorld(Entity p_72838_1_) + { + boolean flag = super.spawnEntityInWorld(p_72838_1_); + this.entityList.add(p_72838_1_); + + if (!flag) + { + this.entitySpawnQueue.add(p_72838_1_); + } + else if (p_72838_1_ instanceof EntityMinecart) + { + this.mc.getSoundHandler().playSound(new MovingSoundMinecart((EntityMinecart)p_72838_1_)); + } + + return flag; + } + + /** + * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. + */ + public void removeEntity(Entity p_72900_1_) + { + super.removeEntity(p_72900_1_); + this.entityList.remove(p_72900_1_); + } + + public void onEntityAdded(Entity p_72923_1_) + { + super.onEntityAdded(p_72923_1_); + + if (this.entitySpawnQueue.contains(p_72923_1_)) + { + this.entitySpawnQueue.remove(p_72923_1_); + } + } + + public void onEntityRemoved(Entity p_72847_1_) + { + super.onEntityRemoved(p_72847_1_); + boolean flag = false; + + if (this.entityList.contains(p_72847_1_)) + { + if (p_72847_1_.isEntityAlive()) + { + this.entitySpawnQueue.add(p_72847_1_); + flag = true; + } + else + { + this.entityList.remove(p_72847_1_); + } + } + + if (RenderManager.instance.getEntityRenderObject(p_72847_1_).isStaticEntity() && !flag) + { + this.mc.renderGlobal.onStaticEntitiesChanged(); + } + } + + /** + * Add an ID to Entity mapping to entityHashSet + */ + public void addEntityToWorld(int p_73027_1_, Entity p_73027_2_) + { + Entity entity1 = this.getEntityByID(p_73027_1_); + + if (entity1 != null) + { + this.removeEntity(entity1); + } + + this.entityList.add(p_73027_2_); + p_73027_2_.setEntityId(p_73027_1_); + + if (!this.spawnEntityInWorld(p_73027_2_)) + { + this.entitySpawnQueue.add(p_73027_2_); + } + + this.entityHashSet.addKey(p_73027_1_, p_73027_2_); + + if (RenderManager.instance.getEntityRenderObject(p_73027_2_).isStaticEntity()) + { + this.mc.renderGlobal.onStaticEntitiesChanged(); + } + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public Entity getEntityByID(int p_73045_1_) + { + return (Entity)(p_73045_1_ == this.mc.thePlayer.getEntityId() ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(p_73045_1_)); + } + + public Entity removeEntityFromWorld(int p_73028_1_) + { + Entity entity = (Entity)this.entityHashSet.removeObject(p_73028_1_); + + if (entity != null) + { + this.entityList.remove(entity); + this.removeEntity(entity); + } + + return entity; + } + + public boolean func_147492_c(int p_147492_1_, int p_147492_2_, int p_147492_3_, Block p_147492_4_, int p_147492_5_) + { + this.invalidateBlockReceiveRegion(p_147492_1_, p_147492_2_, p_147492_3_, p_147492_1_, p_147492_2_, p_147492_3_); + return super.setBlock(p_147492_1_, p_147492_2_, p_147492_3_, p_147492_4_, p_147492_5_, 3); + } + + /** + * If on MP, sends a quitting packet. + */ + public void sendQuittingDisconnectingPacket() + { + this.sendQueue.getNetworkManager().closeChannel(new ChatComponentText("Quitting")); + } + + /** + * Updates all weather states. + */ + protected void updateWeather() + { + super.updateWeather(); + } + + @Override + public void updateWeatherBody() + { + if (!this.provider.hasNoSky) + { + ; + } + } + + protected int func_152379_p() + { + return this.mc.gameSettings.renderDistanceChunks; + } + + public void doVoidFogParticles(int p_73029_1_, int p_73029_2_, int p_73029_3_) + { + byte b0 = 16; + Random random = new Random(); + + for (int l = 0; l < 1000; ++l) + { + int i1 = p_73029_1_ + this.rand.nextInt(b0) - this.rand.nextInt(b0); + int j1 = p_73029_2_ + this.rand.nextInt(b0) - this.rand.nextInt(b0); + int k1 = p_73029_3_ + this.rand.nextInt(b0) - this.rand.nextInt(b0); + Block block = this.getBlock(i1, j1, k1); + + if (block.getMaterial() == Material.air) + { + if (this.rand.nextInt(8) > j1 && this.provider.getWorldHasVoidParticles()) + { + this.spawnParticle("depthsuspend", (double)((float)i1 + this.rand.nextFloat()), (double)((float)j1 + this.rand.nextFloat()), (double)((float)k1 + this.rand.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } + else + { + block.randomDisplayTick(this, i1, j1, k1, random); + } + } + } + + /** + * also releases skins. + */ + public void removeAllEntities() + { + this.loadedEntityList.removeAll(this.unloadedEntityList); + int i; + Entity entity; + int j; + int k; + + for (i = 0; i < this.unloadedEntityList.size(); ++i) + { + entity = (Entity)this.unloadedEntityList.get(i); + j = entity.chunkCoordX; + k = entity.chunkCoordZ; + + if (entity.addedToChunk && this.chunkExists(j, k)) + { + this.getChunkFromChunkCoords(j, k).removeEntity(entity); + } + } + + for (i = 0; i < this.unloadedEntityList.size(); ++i) + { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(i)); + } + + this.unloadedEntityList.clear(); + + for (i = 0; i < this.loadedEntityList.size(); ++i) + { + entity = (Entity)this.loadedEntityList.get(i); + + if (entity.ridingEntity != null) + { + if (!entity.ridingEntity.isDead && entity.ridingEntity.riddenByEntity == entity) + { + continue; + } + + entity.ridingEntity.riddenByEntity = null; + entity.ridingEntity = null; + } + + if (entity.isDead) + { + j = entity.chunkCoordX; + k = entity.chunkCoordZ; + + if (entity.addedToChunk && this.chunkExists(j, k)) + { + this.getChunkFromChunkCoords(j, k).removeEntity(entity); + } + + this.loadedEntityList.remove(i--); + this.onEntityRemoved(entity); + } + } + } + + /** + * Adds some basic stats of the world to the given crash report. + */ + public CrashReportCategory addWorldInfoToCrashReport(CrashReport report) + { + CrashReportCategory crashreportcategory = super.addWorldInfoToCrashReport(report); + crashreportcategory.addCrashSectionCallable("Forced entities", new Callable() + { + private static final String __OBFID = "CL_00000883"; + public String call() + { + return WorldClient.this.entityList.size() + " total; " + WorldClient.this.entityList.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Retry entities", new Callable() + { + private static final String __OBFID = "CL_00000884"; + public String call() + { + return WorldClient.this.entitySpawnQueue.size() + " total; " + WorldClient.this.entitySpawnQueue.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Server brand", new Callable() + { + private static final String __OBFID = "CL_00000885"; + public String call() + { + return WorldClient.this.mc.thePlayer.func_142021_k(); + } + }); + crashreportcategory.addCrashSectionCallable("Server type", new Callable() + { + private static final String __OBFID = "CL_00000886"; + public String call() + { + return WorldClient.this.mc.getIntegratedServer() == null ? "Non-integrated multiplayer server" : "Integrated singleplayer server"; + } + }); + return crashreportcategory; + } + + /** + * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound + */ + public void playSound(double x, double y, double z, String soundName, float volume, float pitch, boolean distanceDelay) + { + double d3 = this.mc.renderViewEntity.getDistanceSq(x, y, z); + PositionedSoundRecord positionedsoundrecord = new PositionedSoundRecord(new ResourceLocation(soundName), volume, pitch, (float)x, (float)y, (float)z); + + if (distanceDelay && d3 > 100.0D) + { + double d4 = Math.sqrt(d3) / 40.0D; + this.mc.getSoundHandler().playDelayedSound(positionedsoundrecord, (int)(d4 * 20.0D)); + } + else + { + this.mc.getSoundHandler().playSound(positionedsoundrecord); + } + } + + public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) + { + this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, x, y, z, motionX, motionY, motionZ, this.mc.effectRenderer, compund)); + } + + public void setWorldScoreboard(Scoreboard p_96443_1_) + { + this.worldScoreboard = p_96443_1_; + } + + /** + * Sets the world time. + */ + public void setWorldTime(long time) + { + if (time < 0L) + { + time = -time; + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); + } + else + { + this.getGameRules().setOrCreateGameRule("doDaylightCycle", "true"); + } + + super.setWorldTime(time); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/network/LanServerDetector.java b/build/rfg/minecraft-src/java/net/minecraft/client/network/LanServerDetector.java new file mode 100644 index 0000000..4f13064 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/network/LanServerDetector.java @@ -0,0 +1,177 @@ +package net.minecraft.client.network; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.InetAddress; +import java.net.MulticastSocket; +import java.net.SocketTimeoutException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class LanServerDetector +{ + private static final AtomicInteger field_148551_a = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final String __OBFID = "CL_00001133"; + + @SideOnly(Side.CLIENT) + public static class LanServer + { + private String lanServerMotd; + private String lanServerIpPort; + /** Last time this LanServer was seen. */ + private long timeLastSeen; + private static final String __OBFID = "CL_00001134"; + + public LanServer(String p_i1319_1_, String p_i1319_2_) + { + this.lanServerMotd = p_i1319_1_; + this.lanServerIpPort = p_i1319_2_; + this.timeLastSeen = Minecraft.getSystemTime(); + } + + public String getServerMotd() + { + return this.lanServerMotd; + } + + public String getServerIpPort() + { + return this.lanServerIpPort; + } + + /** + * Updates the time this LanServer was last seen. + */ + public void updateLastSeen() + { + this.timeLastSeen = Minecraft.getSystemTime(); + } + } + + @SideOnly(Side.CLIENT) + public static class LanServerList + { + private ArrayList listOfLanServers = new ArrayList(); + boolean wasUpdated; + private static final String __OBFID = "CL_00001136"; + + public synchronized boolean getWasUpdated() + { + return this.wasUpdated; + } + + public synchronized void setWasNotUpdated() + { + this.wasUpdated = false; + } + + public synchronized List getLanServers() + { + return Collections.unmodifiableList(this.listOfLanServers); + } + + public synchronized void func_77551_a(String p_77551_1_, InetAddress p_77551_2_) + { + String s1 = ThreadLanServerPing.getMotdFromPingResponse(p_77551_1_); + String s2 = ThreadLanServerPing.getAdFromPingResponse(p_77551_1_); + + if (s2 != null) + { + s2 = p_77551_2_.getHostAddress() + ":" + s2; + boolean flag = false; + Iterator iterator = this.listOfLanServers.iterator(); + + while (iterator.hasNext()) + { + LanServerDetector.LanServer lanserver = (LanServerDetector.LanServer)iterator.next(); + + if (lanserver.getServerIpPort().equals(s2)) + { + lanserver.updateLastSeen(); + flag = true; + break; + } + } + + if (!flag) + { + this.listOfLanServers.add(new LanServerDetector.LanServer(s1, s2)); + this.wasUpdated = true; + } + } + } + } + + @SideOnly(Side.CLIENT) + public static class ThreadLanServerFind extends Thread + { + /** The LanServerList */ + private final LanServerDetector.LanServerList localServerList; + /** InetAddress for 224.0.2.60 */ + private final InetAddress broadcastAddress; + /** The socket we're using to receive packets on. */ + private final MulticastSocket socket; + private static final String __OBFID = "CL_00001135"; + + public ThreadLanServerFind(LanServerDetector.LanServerList p_i1320_1_) throws IOException + { + super("LanServerDetector #" + LanServerDetector.field_148551_a.incrementAndGet()); + this.localServerList = p_i1320_1_; + this.setDaemon(true); + this.socket = new MulticastSocket(4445); + this.broadcastAddress = InetAddress.getByName("224.0.2.60"); + this.socket.setSoTimeout(5000); + this.socket.joinGroup(this.broadcastAddress); + } + + public void run() + { + byte[] abyte = new byte[1024]; + + while (!this.isInterrupted()) + { + DatagramPacket datagrampacket = new DatagramPacket(abyte, abyte.length); + + try + { + this.socket.receive(datagrampacket); + } + catch (SocketTimeoutException sockettimeoutexception) + { + continue; + } + catch (IOException ioexception1) + { + LanServerDetector.logger.error("Couldn\'t ping server", ioexception1); + break; + } + + String s = new String(datagrampacket.getData(), datagrampacket.getOffset(), datagrampacket.getLength()); + LanServerDetector.logger.debug(datagrampacket.getAddress() + ": " + s); + this.localServerList.func_77551_a(s, datagrampacket.getAddress()); + } + + try + { + this.socket.leaveGroup(this.broadcastAddress); + } + catch (IOException ioexception) + { + ; + } + + this.socket.close(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java new file mode 100644 index 0000000..b38feeb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerHandshakeMemory.java @@ -0,0 +1,95 @@ +package net.minecraft.client.network; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerLoginServer; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.Validate; + +@SideOnly(Side.CLIENT) +public class NetHandlerHandshakeMemory implements INetHandlerHandshakeServer +{ + private final MinecraftServer field_147385_a; + private final NetworkManager field_147384_b; + private static final String __OBFID = "CL_00001445"; + + public NetHandlerHandshakeMemory(MinecraftServer p_i45287_1_, NetworkManager p_i45287_2_) + { + this.field_147385_a = p_i45287_1_; + this.field_147384_b = p_i45287_2_; + } + + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + public void processHandshake(C00Handshake packetIn) + { + this.field_147384_b.setConnectionState(packetIn.func_149594_c()); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + Validate.validState(newState == EnumConnectionState.LOGIN || newState == EnumConnectionState.STATUS, "Unexpected protocol " + newState, new Object[0]); + + switch (NetHandlerHandshakeMemory.SwitchEnumConnectionState.field_151263_a[newState.ordinal()]) + { + case 1: + this.field_147384_b.setNetHandler(new NetHandlerLoginServer(this.field_147385_a, this.field_147384_b)); + break; + case 2: + throw new UnsupportedOperationException("NYI"); + default: + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + @SideOnly(Side.CLIENT) + + static final class SwitchEnumConnectionState + { + static final int[] field_151263_a = new int[EnumConnectionState.values().length]; + private static final String __OBFID = "CL_00001446"; + + static + { + try + { + field_151263_a[EnumConnectionState.LOGIN.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_151263_a[EnumConnectionState.STATUS.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerLoginClient.java b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerLoginClient.java new file mode 100644 index 0000000..6b9e756 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerLoginClient.java @@ -0,0 +1,145 @@ +package net.minecraft.client.network; + +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; +import com.mojang.authlib.exceptions.InvalidCredentialsException; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PublicKey; +import java.util.UUID; +import javax.crypto.SecretKey; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class NetHandlerLoginClient implements INetHandlerLoginClient +{ + private static final Logger logger = LogManager.getLogger(); + private final Minecraft field_147394_b; + private final GuiScreen field_147395_c; + private final NetworkManager field_147393_d; + private static final String __OBFID = "CL_00000876"; + + public NetHandlerLoginClient(NetworkManager p_i45059_1_, Minecraft p_i45059_2_, GuiScreen p_i45059_3_) + { + this.field_147393_d = p_i45059_1_; + this.field_147394_b = p_i45059_2_; + this.field_147395_c = p_i45059_3_; + } + + public void handleEncryptionRequest(S01PacketEncryptionRequest packetIn) + { + final SecretKey secretkey = CryptManager.createNewSharedKey(); + String s = packetIn.func_149609_c(); + PublicKey publickey = packetIn.func_149608_d(); + String s1 = (new BigInteger(CryptManager.getServerIdHash(s, publickey, secretkey))).toString(16); + boolean flag = this.field_147394_b.func_147104_D() == null || !this.field_147394_b.func_147104_D().func_152585_d(); + + try + { + this.func_147391_c().joinServer(this.field_147394_b.getSession().func_148256_e(), this.field_147394_b.getSession().getToken(), s1); + } + catch (AuthenticationUnavailableException authenticationunavailableexception) + { + if (flag) + { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {new ChatComponentTranslation("disconnect.loginFailedInfo.serversUnavailable", new Object[0])})); + return; + } + } + catch (InvalidCredentialsException invalidcredentialsexception) + { + if (flag) + { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {new ChatComponentTranslation("disconnect.loginFailedInfo.invalidSession", new Object[0])})); + return; + } + } + catch (AuthenticationException authenticationexception) + { + if (flag) + { + this.field_147393_d.closeChannel(new ChatComponentTranslation("disconnect.loginFailedInfo", new Object[] {authenticationexception.getMessage()})); + return; + } + } + + this.field_147393_d.scheduleOutboundPacket(new C01PacketEncryptionResponse(secretkey, publickey, packetIn.func_149607_e()), new GenericFutureListener[] {new GenericFutureListener() + { + private static final String __OBFID = "CL_00000877"; + public void operationComplete(Future p_operationComplete_1_) + { + NetHandlerLoginClient.this.field_147393_d.enableEncryption(secretkey); + } + } + }); + } + + private MinecraftSessionService func_147391_c() + { + return (new YggdrasilAuthenticationService(this.field_147394_b.getProxy(), UUID.randomUUID().toString())).createMinecraftSessionService(); + } + + public void handleLoginSuccess(S02PacketLoginSuccess packetIn) + { + FMLNetworkHandler.fmlClientHandshake(this.field_147393_d); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + this.field_147394_b.displayGuiScreen(new GuiDisconnected(this.field_147395_c, "connect.failed", reason)); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + logger.debug("Switching protocol from " + oldState + " to " + newState); + + if (newState == EnumConnectionState.PLAY) + { + NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d); + this.field_147393_d.setNetHandler(nhpc); + FMLClientHandler.instance().setPlayClient(nhpc); + + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + public void handleDisconnect(S00PacketDisconnect packetIn) + { + this.field_147393_d.closeChannel(packetIn.func_149603_c()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerPlayClient.java b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerPlayClient.java new file mode 100644 index 0000000..3c91da4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -0,0 +1,1869 @@ +package net.minecraft.client.network; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.common.network.handshake.NetworkDispatcher; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityOtherPlayerMP; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.GuiDisconnected; +import net.minecraft.client.gui.GuiDownloadTerrain; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiMerchant; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.gui.GuiPlayerInfo; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiScreenDemo; +import net.minecraft.client.gui.GuiScreenRealmsProxy; +import net.minecraft.client.gui.GuiWinGame; +import net.minecraft.client.gui.GuiYesNo; +import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.client.multiplayer.ServerList; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityCrit2FX; +import net.minecraft.client.particle.EntityPickupFX; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.stream.MetadataAchievement; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.NpcMerchant; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.potion.PotionEffect; +import net.minecraft.realms.DisconnectedOnlineScreen; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.Explosion; +import net.minecraft.world.WorldProviderSurface; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapData; +import net.minecraft.world.storage.MapStorage; +import net.minecraftforge.client.event.ClientChatReceivedEvent; +import net.minecraftforge.common.MinecraftForge; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class NetHandlerPlayClient implements INetHandlerPlayClient +{ + private static final Logger logger = LogManager.getLogger(); + /** + * The NetworkManager instance used to communicate with the server (used only by handlePlayerPosLook to update + * positioning and handleJoinGame to inform the server of the client distribution/mods) + */ + private final NetworkManager netManager; + /** Reference to the Minecraft instance, which many handler methods operate on */ + private Minecraft gameController; + /** Reference to the current ClientWorld instance, which many handler methods operate on */ + private WorldClient clientWorldController; + /** + * True if the client has finished downloading terrain and may spawn. Set upon receipt of S08PacketPlayerPosLook, + * reset upon respawning + */ + private boolean doneLoadingTerrain; + /** Origin of the central MapStorage serving as a public reference for WorldClient. Not used in this class */ + public MapStorage mapStorageOrigin = new MapStorage((ISaveHandler)null); + /** A mapping from player names to their respective GuiPlayerInfo (specifies the clients response time to the server) */ + private Map playerInfoMap = new HashMap(); + /** An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the current server) */ + public List playerInfoList = new ArrayList(); + public int currentServerMaxPlayers = 20; + /** + * Seems to be either null (integrated server) or an instance of either GuiMultiplayer (when connecting to a server) + * or GuiScreenReamlsTOS (when connecting to MCO server) + */ + private GuiScreen guiScreenServer; + private boolean field_147308_k = false; + /** + * Just an ordinary random number generator, used to randomize audio pitch of item/orb pickup and randomize both + * particlespawn offset and velocity + */ + private Random avRandomizer = new Random(); + private static final String __OBFID = "CL_00000878"; + + public NetHandlerPlayClient(Minecraft p_i45061_1_, GuiScreen p_i45061_2_, NetworkManager p_i45061_3_) + { + this.gameController = p_i45061_1_; + this.guiScreenServer = p_i45061_2_; + this.netManager = p_i45061_3_; + } + + /** + * Clears the WorldClient instance associated with this NetHandlerPlayClient + */ + public void cleanup() + { + this.clientWorldController = null; + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + /** + * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new + * WorldClient and sets the player initial dimension + */ + public void handleJoinGame(S01PacketJoinGame packetIn) + { + this.gameController.playerController = new PlayerControllerMP(this.gameController, this); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.func_149198_e(), false, packetIn.func_149195_d(), packetIn.func_149196_i()), NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.func_149192_g(), this.gameController.mcProfiler); + this.clientWorldController.isRemote = true; + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = packetIn.func_149194_f(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + this.gameController.thePlayer.setEntityId(packetIn.func_149197_c()); + this.currentServerMaxPlayers = packetIn.func_149193_h(); + this.gameController.playerController.setGameType(packetIn.func_149198_e()); + this.gameController.gameSettings.sendSettingsToServer(); + this.netManager.scheduleOutboundPacket(new C17PacketCustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8)), new GenericFutureListener[0]); + } + + /** + * Spawns an instance of the objecttype indicated by the packet and sets its position and momentum + */ + public void handleSpawnObject(S0EPacketSpawnObject packetIn) + { + double d0 = (double)packetIn.func_148997_d() / 32.0D; + double d1 = (double)packetIn.func_148998_e() / 32.0D; + double d2 = (double)packetIn.func_148994_f() / 32.0D; + Object object = null; + + if (packetIn.func_148993_l() == 10) + { + object = EntityMinecart.createMinecart(this.clientWorldController, d0, d1, d2, packetIn.func_149009_m()); + } + else if (packetIn.func_148993_l() == 90) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149009_m()); + + if (entity instanceof EntityPlayer) + { + object = new EntityFishHook(this.clientWorldController, d0, d1, d2, (EntityPlayer)entity); + } + + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 60) + { + object = new EntityArrow(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 61) + { + object = new EntitySnowball(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 71) + { + object = new EntityItemFrame(this.clientWorldController, (int)d0, (int)d1, (int)d2, packetIn.func_149009_m()); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 77) + { + object = new EntityLeashKnot(this.clientWorldController, (int)d0, (int)d1, (int)d2); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 65) + { + object = new EntityEnderPearl(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 72) + { + object = new EntityEnderEye(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 76) + { + object = new EntityFireworkRocket(this.clientWorldController, d0, d1, d2, (ItemStack)null); + } + else if (packetIn.func_148993_l() == 63) + { + object = new EntityLargeFireball(this.clientWorldController, d0, d1, d2, (double)packetIn.func_149010_g() / 8000.0D, (double)packetIn.func_149004_h() / 8000.0D, (double)packetIn.func_148999_i() / 8000.0D); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 64) + { + object = new EntitySmallFireball(this.clientWorldController, d0, d1, d2, (double)packetIn.func_149010_g() / 8000.0D, (double)packetIn.func_149004_h() / 8000.0D, (double)packetIn.func_148999_i() / 8000.0D); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 66) + { + object = new EntityWitherSkull(this.clientWorldController, d0, d1, d2, (double)packetIn.func_149010_g() / 8000.0D, (double)packetIn.func_149004_h() / 8000.0D, (double)packetIn.func_148999_i() / 8000.0D); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 62) + { + object = new EntityEgg(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 73) + { + object = new EntityPotion(this.clientWorldController, d0, d1, d2, packetIn.func_149009_m()); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 75) + { + object = new EntityExpBottle(this.clientWorldController, d0, d1, d2); + packetIn.func_149002_g(0); + } + else if (packetIn.func_148993_l() == 1) + { + object = new EntityBoat(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 50) + { + object = new EntityTNTPrimed(this.clientWorldController, d0, d1, d2, (EntityLivingBase)null); + } + else if (packetIn.func_148993_l() == 51) + { + object = new EntityEnderCrystal(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 2) + { + object = new EntityItem(this.clientWorldController, d0, d1, d2); + } + else if (packetIn.func_148993_l() == 70) + { + object = new EntityFallingBlock(this.clientWorldController, d0, d1, d2, Block.getBlockById(packetIn.func_149009_m() & 65535), packetIn.func_149009_m() >> 16); + packetIn.func_149002_g(0); + } + + if (object != null) + { + ((Entity)object).serverPosX = packetIn.func_148997_d(); + ((Entity)object).serverPosY = packetIn.func_148998_e(); + ((Entity)object).serverPosZ = packetIn.func_148994_f(); + ((Entity)object).rotationPitch = (float)(packetIn.func_149008_j() * 360) / 256.0F; + ((Entity)object).rotationYaw = (float)(packetIn.func_149006_k() * 360) / 256.0F; + Entity[] aentity = ((Entity)object).getParts(); + + if (aentity != null) + { + int i = packetIn.func_149001_c() - ((Entity)object).getEntityId(); + + for (int j = 0; j < aentity.length; ++j) + { + aentity[j].setEntityId(aentity[j].getEntityId() + i); + } + } + + ((Entity)object).setEntityId(packetIn.func_149001_c()); + this.clientWorldController.addEntityToWorld(packetIn.func_149001_c(), (Entity)object); + + if (packetIn.func_149009_m() > 0) + { + if (packetIn.func_148993_l() == 60) + { + Entity entity1 = this.clientWorldController.getEntityByID(packetIn.func_149009_m()); + + if (entity1 instanceof EntityLivingBase) + { + EntityArrow entityarrow = (EntityArrow)object; + entityarrow.shootingEntity = entity1; + } + } + + ((Entity)object).setVelocity((double)packetIn.func_149010_g() / 8000.0D, (double)packetIn.func_149004_h() / 8000.0D, (double)packetIn.func_148999_i() / 8000.0D); + } + } + } + + /** + * Spawns an experience orb and sets its value (amount of XP) + */ + public void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn) + { + EntityXPOrb entityxporb = new EntityXPOrb(this.clientWorldController, (double)packetIn.func_148984_d() / 32.0D, (double)packetIn.func_148983_e() / 32.0D, (double)packetIn.func_148982_f() / 32.0D, packetIn.func_148986_g()); + // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position + entityxporb.serverPosX = packetIn.func_148984_d(); + entityxporb.serverPosY = packetIn.func_148983_e(); + entityxporb.serverPosZ = packetIn.func_148982_f(); + entityxporb.rotationYaw = 0.0F; + entityxporb.rotationPitch = 0.0F; + entityxporb.setEntityId(packetIn.func_148985_c()); + this.clientWorldController.addEntityToWorld(packetIn.func_148985_c(), entityxporb); + } + + /** + * Handles globally visible entities. Used in vanilla for lightning bolts + */ + public void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn) + { + double d0 = (double)packetIn.func_149051_d() / 32.0D; + double d1 = (double)packetIn.func_149050_e() / 32.0D; + double d2 = (double)packetIn.func_149049_f() / 32.0D; + EntityLightningBolt entitylightningbolt = null; + + if (packetIn.func_149053_g() == 1) + { + entitylightningbolt = new EntityLightningBolt(this.clientWorldController, d0, d1, d2); + } + + if (entitylightningbolt != null) + { + entitylightningbolt.serverPosX = packetIn.func_149051_d(); + entitylightningbolt.serverPosY = packetIn.func_149050_e(); + entitylightningbolt.serverPosZ = packetIn.func_149049_f(); + entitylightningbolt.rotationYaw = 0.0F; + entitylightningbolt.rotationPitch = 0.0F; + entitylightningbolt.setEntityId(packetIn.func_149052_c()); + this.clientWorldController.addWeatherEffect(entitylightningbolt); + } + } + + /** + * Handles the spawning of a painting object + */ + public void handleSpawnPainting(S10PacketSpawnPainting packetIn) + { + EntityPainting entitypainting = new EntityPainting(this.clientWorldController, packetIn.func_148964_d(), packetIn.func_148963_e(), packetIn.func_148962_f(), packetIn.func_148966_g(), packetIn.func_148961_h()); + this.clientWorldController.addEntityToWorld(packetIn.func_148965_c(), entitypainting); + } + + /** + * Sets the velocity of the specified entity to the specified value + */ + public void handleEntityVelocity(S12PacketEntityVelocity packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149412_c()); + + if (entity != null) + { + entity.setVelocity((double)packetIn.func_149411_d() / 8000.0D, (double)packetIn.func_149410_e() / 8000.0D, (double)packetIn.func_149409_f() / 8000.0D); + } + } + + /** + * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have + * changed -> Registers any changes locally + */ + public void handleEntityMetadata(S1CPacketEntityMetadata packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149375_d()); + + if (entity != null && packetIn.func_149376_c() != null) + { + entity.getDataWatcher().updateWatchedObjectsFromList(packetIn.func_149376_c()); + } + } + + /** + * Handles the creation of a nearby player entity, sets the position and held item + */ + public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn) + { + double d0 = (double)packetIn.func_148942_f() / 32.0D; + double d1 = (double)packetIn.func_148949_g() / 32.0D; + double d2 = (double)packetIn.func_148946_h() / 32.0D; + float f = (float)(packetIn.func_148941_i() * 360) / 256.0F; + float f1 = (float)(packetIn.func_148945_j() * 360) / 256.0F; + GameProfile gameprofile = packetIn.func_148948_e(); + EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, packetIn.func_148948_e()); + entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.func_148942_f()); + entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.func_148949_g()); + entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.func_148946_h()); + int i = packetIn.func_148947_k(); + + if (i == 0) + { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null; + } + else + { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0); + } + + entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1); + this.clientWorldController.addEntityToWorld(packetIn.func_148943_d(), entityotherplayermp); + List list = packetIn.func_148944_c(); + + if (list != null) + { + entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list); + } + } + + /** + * Updates an entity's position and rotation as specified by the packet + */ + public void handleEntityTeleport(S18PacketEntityTeleport packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149451_c()); + + if (entity != null) + { + entity.serverPosX = packetIn.func_149449_d(); + entity.serverPosY = packetIn.func_149448_e(); + entity.serverPosZ = packetIn.func_149446_f(); + double d0 = (double)entity.serverPosX / 32.0D; + double d1 = (double)entity.serverPosY / 32.0D + 0.015625D; + double d2 = (double)entity.serverPosZ / 32.0D; + float f = (float)(packetIn.func_149450_g() * 360) / 256.0F; + float f1 = (float)(packetIn.func_149447_h() * 360) / 256.0F; + entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3); + } + } + + /** + * Updates which hotbar slot of the player is currently selected + */ + public void handleHeldItemChange(S09PacketHeldItemChange packetIn) + { + if (packetIn.func_149385_c() >= 0 && packetIn.func_149385_c() < InventoryPlayer.getHotbarSize()) + { + this.gameController.thePlayer.inventory.currentItem = packetIn.func_149385_c(); + } + } + + /** + * Updates the specified entity's position by the specified relative moment and absolute rotation. Note that + * subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs. + * rotation or both). + */ + public void handleEntityMovement(S14PacketEntity packetIn) + { + Entity entity = packetIn.func_149065_a(this.clientWorldController); + + if (entity != null) + { + entity.serverPosX += packetIn.func_149062_c(); + entity.serverPosY += packetIn.func_149061_d(); + entity.serverPosZ += packetIn.func_149064_e(); + double d0 = (double)entity.serverPosX / 32.0D; + double d1 = (double)entity.serverPosY / 32.0D; + double d2 = (double)entity.serverPosZ / 32.0D; + float f = packetIn.func_149060_h() ? (float)(packetIn.func_149066_f() * 360) / 256.0F : entity.rotationYaw; + float f1 = packetIn.func_149060_h() ? (float)(packetIn.func_149063_g() * 360) / 256.0F : entity.rotationPitch; + entity.setPositionAndRotation2(d0, d1, d2, f, f1, 3); + } + } + + /** + * Updates the direction in which the specified entity is looking, normally this head rotation is independent of the + * rotation of the entity itself + */ + public void handleEntityHeadLook(S19PacketEntityHeadLook packetIn) + { + Entity entity = packetIn.func_149381_a(this.clientWorldController); + + if (entity != null) + { + float f = (float)(packetIn.func_149380_c() * 360) / 256.0F; + entity.setRotationYawHead(f); + } + } + + /** + * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no + * longer registered as required to monitor them. The latter happens when distance between the player and item + * increases beyond a certain treshold (typically the viewing distance) + */ + public void handleDestroyEntities(S13PacketDestroyEntities packetIn) + { + for (int i = 0; i < packetIn.func_149098_c().length; ++i) + { + this.clientWorldController.removeEntityFromWorld(packetIn.func_149098_c()[i]); + } + } + + /** + * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, + * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the + * player positioning + */ + public void handlePlayerPosLook(S08PacketPlayerPosLook packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + double d0 = packetIn.func_148932_c(); + double d1 = packetIn.func_148928_d(); + double d2 = packetIn.func_148933_e(); + float f = packetIn.func_148931_f(); + float f1 = packetIn.func_148930_g(); + entityclientplayermp.ySize = 0.0F; + entityclientplayermp.motionX = entityclientplayermp.motionY = entityclientplayermp.motionZ = 0.0D; + entityclientplayermp.setPositionAndRotation(d0, d1, d2, f, f1); + this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityclientplayermp.posX, entityclientplayermp.boundingBox.minY, entityclientplayermp.posY, entityclientplayermp.posZ, packetIn.func_148931_f(), packetIn.func_148930_g(), packetIn.func_148929_h()), new GenericFutureListener[0]); + + if (!this.doneLoadingTerrain) + { + this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX; + this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY; + this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ; + this.doneLoadingTerrain = true; + this.gameController.displayGuiScreen((GuiScreen)null); + } + } + + /** + * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block + * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends + * S21PacketChunkData + */ + public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) + { + int i = packetIn.func_148920_c().chunkXPos * 16; + int j = packetIn.func_148920_c().chunkZPos * 16; + + if (packetIn.func_148921_d() != null) + { + DataInputStream datainputstream = new DataInputStream(new ByteArrayInputStream(packetIn.func_148921_d())); + + try + { + for (int k = 0; k < packetIn.func_148922_e(); ++k) + { + short short1 = datainputstream.readShort(); + short short2 = datainputstream.readShort(); + int l = short2 >> 4 & 4095; + int i1 = short2 & 15; + int j1 = short1 >> 12 & 15; + int k1 = short1 >> 8 & 15; + int l1 = short1 & 255; + this.clientWorldController.func_147492_c(j1 + i, l1, k1 + j, Block.getBlockById(l), i1); + } + } + catch (IOException ioexception) + { + ; + } + } + } + + /** + * Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation + */ + public void handleChunkData(S21PacketChunkData packetIn) + { + if (packetIn.func_149274_i()) + { + if (packetIn.func_149276_g() == 0) + { + this.clientWorldController.doPreChunk(packetIn.func_149273_e(), packetIn.func_149271_f(), false); + return; + } + + this.clientWorldController.doPreChunk(packetIn.func_149273_e(), packetIn.func_149271_f(), true); + } + + this.clientWorldController.invalidateBlockReceiveRegion(packetIn.func_149273_e() << 4, 0, packetIn.func_149271_f() << 4, (packetIn.func_149273_e() << 4) + 15, 256, (packetIn.func_149271_f() << 4) + 15); + Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(packetIn.func_149273_e(), packetIn.func_149271_f()); + chunk.fillChunk(packetIn.func_149272_d(), packetIn.func_149276_g(), packetIn.func_149270_h(), packetIn.func_149274_i()); + this.clientWorldController.markBlockRangeForRenderUpdate(packetIn.func_149273_e() << 4, 0, packetIn.func_149271_f() << 4, (packetIn.func_149273_e() << 4) + 15, 256, (packetIn.func_149271_f() << 4) + 15); + + if (!packetIn.func_149274_i() || !(this.clientWorldController.provider instanceof WorldProviderSurface)) + { + chunk.resetRelightChecks(); + } + } + + /** + * Updates the block and metadata and generates a blockupdate (and notify the clients) + */ + public void handleBlockChange(S23PacketBlockChange packetIn) + { + this.clientWorldController.func_147492_c(packetIn.func_148879_d(), packetIn.func_148878_e(), packetIn.func_148877_f(), packetIn.func_148880_c(), packetIn.func_148881_g()); + } + + /** + * Closes the network channel + */ + public void handleDisconnect(S40PacketDisconnect packetIn) + { + this.netManager.closeChannel(packetIn.func_149165_c()); + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + this.gameController.loadWorld((WorldClient)null); + + if (this.guiScreenServer != null) + { + if (this.guiScreenServer instanceof GuiScreenRealmsProxy) + { + this.gameController.displayGuiScreen((new DisconnectedOnlineScreen(((GuiScreenRealmsProxy)this.guiScreenServer).func_154321_a(), "disconnect.lost", reason)).getProxy()); + } + else + { + this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason)); + } + } + else + { + this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason)); + } + } + + public void addToSendQueue(Packet p_147297_1_) + { + this.netManager.scheduleOutboundPacket(p_147297_1_, new GenericFutureListener[0]); + } + + public void handleCollectItem(S0DPacketCollectItem packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149354_c()); + Object object = (EntityLivingBase)this.clientWorldController.getEntityByID(packetIn.func_149353_d()); + + if (object == null) + { + object = this.gameController.thePlayer; + } + + if (entity != null) + { + if (entity instanceof EntityXPOrb) + { + this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + else + { + this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.gameController.theWorld, entity, (Entity)object, -0.5F)); + this.clientWorldController.removeEntityFromWorld(packetIn.func_149354_c()); + } + } + + /** + * Prints a chatmessage in the chat GUI + */ + public void handleChat(S02PacketChat packetIn) + { + ClientChatReceivedEvent event = new ClientChatReceivedEvent(packetIn.func_148915_c()); + if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null) + { + this.gameController.ingameGUI.getChatGUI().printChatMessage(event.message); + } + } + + /** + * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt + * or receiving a critical hit by normal or magical means + */ + public void handleAnimation(S0BPacketAnimation packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_148978_c()); + + if (entity != null) + { + if (packetIn.func_148977_d() == 0) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)entity; + entitylivingbase.swingItem(); + } + else if (packetIn.func_148977_d() == 1) + { + entity.performHurtAnimation(); + } + else if (packetIn.func_148977_d() == 2) + { + EntityPlayer entityplayer = (EntityPlayer)entity; + entityplayer.wakeUpPlayer(false, false, false); + } + else if (packetIn.func_148977_d() == 4) + { + this.gameController.effectRenderer.addEffect(new EntityCrit2FX(this.gameController.theWorld, entity)); + } + else if (packetIn.func_148977_d() == 5) + { + EntityCrit2FX entitycrit2fx = new EntityCrit2FX(this.gameController.theWorld, entity, "magicCrit"); + this.gameController.effectRenderer.addEffect(entitycrit2fx); + } + } + } + + /** + * Retrieves the player identified by the packet, puts him to sleep if possible (and flags whether all players are + * asleep) + */ + public void handleUseBed(S0APacketUseBed packetIn) + { + packetIn.func_149091_a(this.clientWorldController).sleepInBedAt(packetIn.func_149092_c(), packetIn.func_149090_d(), packetIn.func_149089_e()); + } + + /** + * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the + * entities Datawatchers with the entity metadata specified in the packet + */ + public void handleSpawnMob(S0FPacketSpawnMob packetIn) + { + double d0 = (double)packetIn.func_149023_f() / 32.0D; + double d1 = (double)packetIn.func_149034_g() / 32.0D; + double d2 = (double)packetIn.func_149029_h() / 32.0D; + float f = (float)(packetIn.func_149028_l() * 360) / 256.0F; + float f1 = (float)(packetIn.func_149030_m() * 360) / 256.0F; + EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.func_149025_e(), this.gameController.theWorld); + if (entitylivingbase == null) + { + cpw.mods.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", packetIn.func_149025_e(), d0, d1, d2); + return; + } + entitylivingbase.serverPosX = packetIn.func_149023_f(); + entitylivingbase.serverPosY = packetIn.func_149034_g(); + entitylivingbase.serverPosZ = packetIn.func_149029_h(); + entitylivingbase.rotationYawHead = (float)(packetIn.func_149032_n() * 360) / 256.0F; + Entity[] aentity = entitylivingbase.getParts(); + + if (aentity != null) + { + int i = packetIn.func_149024_d() - entitylivingbase.getEntityId(); + + for (int j = 0; j < aentity.length; ++j) + { + aentity[j].setEntityId(aentity[j].getEntityId() + i); + } + } + + entitylivingbase.setEntityId(packetIn.func_149024_d()); + entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1); + entitylivingbase.motionX = (double)((float)packetIn.func_149026_i() / 8000.0F); + entitylivingbase.motionY = (double)((float)packetIn.func_149033_j() / 8000.0F); + entitylivingbase.motionZ = (double)((float)packetIn.func_149031_k() / 8000.0F); + this.clientWorldController.addEntityToWorld(packetIn.func_149024_d(), entitylivingbase); + List list = packetIn.func_149027_c(); + + if (list != null) + { + entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list); + } + } + + public void handleTimeUpdate(S03PacketTimeUpdate packetIn) + { + this.gameController.theWorld.func_82738_a(packetIn.func_149366_c()); + this.gameController.theWorld.setWorldTime(packetIn.func_149365_d()); + } + + public void handleSpawnPosition(S05PacketSpawnPosition packetIn) + { + this.gameController.thePlayer.setSpawnChunk(new ChunkCoordinates(packetIn.func_149360_c(), packetIn.func_149359_d(), packetIn.func_149358_e()), true); + this.gameController.theWorld.getWorldInfo().setSpawnPosition(packetIn.func_149360_c(), packetIn.func_149359_d(), packetIn.func_149358_e()); + } + + public void handleEntityAttach(S1BPacketEntityAttach packetIn) + { + Object object = this.clientWorldController.getEntityByID(packetIn.func_149403_d()); + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149402_e()); + + if (packetIn.func_149404_c() == 0) + { + boolean flag = false; + + if (packetIn.func_149403_d() == this.gameController.thePlayer.getEntityId()) + { + object = this.gameController.thePlayer; + + if (entity instanceof EntityBoat) + { + ((EntityBoat)entity).setIsBoatEmpty(false); + } + + flag = ((Entity)object).ridingEntity == null && entity != null; + } + else if (entity instanceof EntityBoat) + { + ((EntityBoat)entity).setIsBoatEmpty(true); + } + + if (object == null) + { + return; + } + + ((Entity)object).mountEntity(entity); + + if (flag) + { + GameSettings gamesettings = this.gameController.gameSettings; + this.gameController.ingameGUI.func_110326_a(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())}), false); + } + } + else if (packetIn.func_149404_c() == 1 && object != null && object instanceof EntityLiving) + { + if (entity != null) + { + ((EntityLiving)object).setLeashedToEntity(entity, false); + } + else + { + ((EntityLiving)object).clearLeashed(false, false); + } + } + } + + /** + * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), + * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch + * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke + * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) + */ + public void handleEntityStatus(S19PacketEntityStatus packetIn) + { + Entity entity = packetIn.func_149161_a(this.clientWorldController); + + if (entity != null) + { + entity.handleHealthUpdate(packetIn.func_149160_c()); + } + } + + /** + * Recieves player health from the server and then proceeds to set it locally on the client. + */ + public void handleUpdateHealth(S06PacketUpdateHealth packetIn) + { + this.gameController.thePlayer.setPlayerSPHealth(packetIn.func_149332_c()); + this.gameController.thePlayer.getFoodStats().setFoodLevel(packetIn.func_149330_d()); + this.gameController.thePlayer.getFoodStats().setFoodSaturationLevel(packetIn.func_149331_e()); + } + + public void handleSetExperience(S1FPacketSetExperience packetIn) + { + this.gameController.thePlayer.setXPStats(packetIn.func_149397_c(), packetIn.func_149396_d(), packetIn.func_149395_e()); + } + + /** + * respawns the player + */ + public void handleRespawn(S07PacketRespawn packetIn) + { + if (packetIn.func_149082_c() != this.gameController.thePlayer.dimension) + { + this.doneLoadingTerrain = false; + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.func_149083_e(), false, this.gameController.theWorld.getWorldInfo().isHardcoreModeEnabled(), packetIn.func_149080_f()), packetIn.func_149082_c(), packetIn.func_149081_d(), this.gameController.mcProfiler); + this.clientWorldController.setWorldScoreboard(scoreboard); + this.clientWorldController.isRemote = true; + this.gameController.loadWorld(this.clientWorldController); + this.gameController.thePlayer.dimension = packetIn.func_149082_c(); + this.gameController.displayGuiScreen(new GuiDownloadTerrain(this)); + } + + this.gameController.setDimensionAndSpawnPlayer(packetIn.func_149082_c()); + this.gameController.playerController.setGameType(packetIn.func_149083_e()); + } + + /** + * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. + */ + public void handleExplosion(S27PacketExplosion packetIn) + { + Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.func_149148_f(), packetIn.func_149143_g(), packetIn.func_149145_h(), packetIn.func_149146_i()); + explosion.affectedBlockPositions = packetIn.func_149150_j(); + explosion.doExplosionB(true); + this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c(); + this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d(); + this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e(); + } + + /** + * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, + * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse + */ + public void handleOpenWindow(S2DPacketOpenWindow packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + + switch (packetIn.func_148899_d()) + { + case 0: + entityclientplayermp.displayGUIChest(new InventoryBasic(packetIn.func_148902_e(), packetIn.func_148900_g(), packetIn.func_148898_f())); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 1: + entityclientplayermp.displayGUIWorkbench(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ)); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 2: + TileEntityFurnace tileentityfurnace = new TileEntityFurnace(); + + if (packetIn.func_148900_g()) + { + tileentityfurnace.func_145951_a(packetIn.func_148902_e()); + } + + entityclientplayermp.func_146101_a(tileentityfurnace); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 3: + TileEntityDispenser tileentitydispenser = new TileEntityDispenser(); + + if (packetIn.func_148900_g()) + { + tileentitydispenser.func_146018_a(packetIn.func_148902_e()); + } + + entityclientplayermp.func_146102_a(tileentitydispenser); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 4: + entityclientplayermp.displayGUIEnchantment(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ), packetIn.func_148900_g() ? packetIn.func_148902_e() : null); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 5: + TileEntityBrewingStand tileentitybrewingstand = new TileEntityBrewingStand(); + + if (packetIn.func_148900_g()) + { + tileentitybrewingstand.func_145937_a(packetIn.func_148902_e()); + } + + entityclientplayermp.func_146098_a(tileentitybrewingstand); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 6: + entityclientplayermp.displayGUIMerchant(new NpcMerchant(entityclientplayermp), packetIn.func_148900_g() ? packetIn.func_148902_e() : null); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 7: + TileEntityBeacon tileentitybeacon = new TileEntityBeacon(); + entityclientplayermp.func_146104_a(tileentitybeacon); + + if (packetIn.func_148900_g()) + { + tileentitybeacon.func_145999_a(packetIn.func_148902_e()); + } + + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 8: + entityclientplayermp.displayGUIAnvil(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ)); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 9: + TileEntityHopper tileentityhopper = new TileEntityHopper(); + + if (packetIn.func_148900_g()) + { + tileentityhopper.func_145886_a(packetIn.func_148902_e()); + } + + entityclientplayermp.func_146093_a(tileentityhopper); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 10: + TileEntityDropper tileentitydropper = new TileEntityDropper(); + + if (packetIn.func_148900_g()) + { + tileentitydropper.func_146018_a(packetIn.func_148902_e()); + } + + entityclientplayermp.func_146102_a(tileentitydropper); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + break; + case 11: + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_148897_h()); + + if (entity != null && entity instanceof EntityHorse) + { + entityclientplayermp.displayGUIHorse((EntityHorse)entity, new AnimalChest(packetIn.func_148902_e(), packetIn.func_148900_g(), packetIn.func_148898_f())); + entityclientplayermp.openContainer.windowId = packetIn.func_148901_c(); + } + } + } + + /** + * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container + */ + public void handleSetSlot(S2FPacketSetSlot packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + + if (packetIn.func_149175_c() == -1) + { + entityclientplayermp.inventory.setItemStack(packetIn.func_149174_e()); + } + else + { + boolean flag = false; + + if (this.gameController.currentScreen instanceof GuiContainerCreative) + { + GuiContainerCreative guicontainercreative = (GuiContainerCreative)this.gameController.currentScreen; + flag = guicontainercreative.func_147056_g() != CreativeTabs.tabInventory.getTabIndex(); + } + + if (packetIn.func_149175_c() == 0 && packetIn.func_149173_d() >= 36 && packetIn.func_149173_d() < 45) + { + ItemStack itemstack = entityclientplayermp.inventoryContainer.getSlot(packetIn.func_149173_d()).getStack(); + + if (packetIn.func_149174_e() != null && (itemstack == null || itemstack.stackSize < packetIn.func_149174_e().stackSize)) + { + packetIn.func_149174_e().animationsToGo = 5; + } + + entityclientplayermp.inventoryContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); + } + else if (packetIn.func_149175_c() == entityclientplayermp.openContainer.windowId && (packetIn.func_149175_c() != 0 || !flag)) + { + entityclientplayermp.openContainer.putStackInSlot(packetIn.func_149173_d(), packetIn.func_149174_e()); + } + } + } + + /** + * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player + * and confirms if it is the case. + */ + public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn) + { + Container container = null; + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + + if (packetIn.func_148889_c() == 0) + { + container = entityclientplayermp.inventoryContainer; + } + else if (packetIn.func_148889_c() == entityclientplayermp.openContainer.windowId) + { + container = entityclientplayermp.openContainer; + } + + if (container != null && !packetIn.func_148888_e()) + { + this.addToSendQueue(new C0FPacketConfirmTransaction(packetIn.func_148889_c(), packetIn.func_148890_d(), true)); + } + } + + /** + * Handles the placement of a specified ItemStack in a specified container/inventory slot + */ + public void handleWindowItems(S30PacketWindowItems packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + + if (packetIn.func_148911_c() == 0) + { + entityclientplayermp.inventoryContainer.putStacksInSlots(packetIn.func_148910_d()); + } + else if (packetIn.func_148911_c() == entityclientplayermp.openContainer.windowId) + { + entityclientplayermp.openContainer.putStacksInSlots(packetIn.func_148910_d()); + } + } + + /** + * Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text + */ + public void handleSignEditorOpen(S36PacketSignEditorOpen packetIn) + { + Object object = this.clientWorldController.getTileEntity(packetIn.func_149129_c(), packetIn.func_149128_d(), packetIn.func_149127_e()); + + if (object == null) + { + object = new TileEntitySign(); + ((TileEntity)object).setWorldObj(this.clientWorldController); + ((TileEntity)object).xCoord = packetIn.func_149129_c(); + ((TileEntity)object).yCoord = packetIn.func_149128_d(); + ((TileEntity)object).zCoord = packetIn.func_149127_e(); + } + + this.gameController.thePlayer.func_146100_a((TileEntity)object); + } + + /** + * Updates a specified sign with the specified text lines + */ + public void handleUpdateSign(S33PacketUpdateSign packetIn) + { + boolean flag = false; + + if (this.gameController.theWorld.blockExists(packetIn.func_149346_c(), packetIn.func_149345_d(), packetIn.func_149344_e())) + { + TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.func_149346_c(), packetIn.func_149345_d(), packetIn.func_149344_e()); + + if (tileentity instanceof TileEntitySign) + { + TileEntitySign tileentitysign = (TileEntitySign)tileentity; + + if (tileentitysign.func_145914_a()) + { + for (int i = 0; i < 4; ++i) + { + tileentitysign.signText[i] = packetIn.func_149347_f()[i]; + } + + tileentitysign.markDirty(); + } + + flag = true; + } + } + + if (!flag && this.gameController.thePlayer != null) + { + this.gameController.thePlayer.addChatMessage(new ChatComponentText("Unable to locate sign at " + packetIn.func_149346_c() + ", " + packetIn.func_149345_d() + ", " + packetIn.func_149344_e())); + } + } + + /** + * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks, + * beacons, skulls, flowerpot + */ + public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) + { + if (this.gameController.theWorld.blockExists(packetIn.func_148856_c(), packetIn.func_148855_d(), packetIn.func_148854_e())) + { + TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.func_148856_c(), packetIn.func_148855_d(), packetIn.func_148854_e()); + + if (tileentity != null) + { + if (packetIn.func_148853_f() == 1 && tileentity instanceof TileEntityMobSpawner) + { + tileentity.readFromNBT(packetIn.func_148857_g()); + } + else if (packetIn.func_148853_f() == 2 && tileentity instanceof TileEntityCommandBlock) + { + tileentity.readFromNBT(packetIn.func_148857_g()); + } + else if (packetIn.func_148853_f() == 3 && tileentity instanceof TileEntityBeacon) + { + tileentity.readFromNBT(packetIn.func_148857_g()); + } + else if (packetIn.func_148853_f() == 4 && tileentity instanceof TileEntitySkull) + { + tileentity.readFromNBT(packetIn.func_148857_g()); + } + else if (packetIn.func_148853_f() == 5 && tileentity instanceof TileEntityFlowerPot) + { + tileentity.readFromNBT(packetIn.func_148857_g()); + } + else + { + tileentity.onDataPacket(netManager, packetIn); + } + } + } + } + + /** + * Sets the progressbar of the opened window to the specified value + */ + public void handleWindowProperty(S31PacketWindowProperty packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + + if (entityclientplayermp.openContainer != null && entityclientplayermp.openContainer.windowId == packetIn.func_149182_c()) + { + entityclientplayermp.openContainer.updateProgressBar(packetIn.func_149181_d(), packetIn.func_149180_e()); + } + } + + public void handleEntityEquipment(S04PacketEntityEquipment packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149389_d()); + + if (entity != null) + { + entity.setCurrentItemOrArmor(packetIn.func_149388_e(), packetIn.func_149390_c()); + } + } + + /** + * Resets the ItemStack held in hand and closes the window that is opened + */ + public void handleCloseWindow(S2EPacketCloseWindow packetIn) + { + this.gameController.thePlayer.closeScreenNoPacket(); + } + + /** + * Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote + * for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players + * accessing a (Ender)Chest + */ + public void handleBlockAction(S24PacketBlockAction packetIn) + { + this.gameController.theWorld.addBlockEvent(packetIn.func_148867_d(), packetIn.func_148866_e(), packetIn.func_148865_f(), packetIn.func_148868_c(), packetIn.func_148869_g(), packetIn.func_148864_h()); + } + + /** + * Updates all registered IWorldAccess instances with destroyBlockInWorldPartially + */ + public void handleBlockBreakAnim(S25PacketBlockBreakAnim packetIn) + { + this.gameController.theWorld.destroyBlockInWorldPartially(packetIn.func_148845_c(), packetIn.func_148844_d(), packetIn.func_148843_e(), packetIn.func_148842_f(), packetIn.func_148846_g()); + } + + public void handleMapChunkBulk(S26PacketMapChunkBulk packetIn) + { + for (int i = 0; i < packetIn.func_149254_d(); ++i) + { + int j = packetIn.func_149255_a(i); + int k = packetIn.func_149253_b(i); + this.clientWorldController.doPreChunk(j, k, true); + this.clientWorldController.invalidateBlockReceiveRegion(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15); + Chunk chunk = this.clientWorldController.getChunkFromChunkCoords(j, k); + chunk.fillChunk(packetIn.func_149256_c(i), packetIn.func_149252_e()[i], packetIn.func_149257_f()[i], true); + this.clientWorldController.markBlockRangeForRenderUpdate(j << 4, 0, k << 4, (j << 4) + 15, 256, (k << 4) + 15); + + if (!(this.clientWorldController.provider instanceof WorldProviderSurface)) + { + chunk.resetRelightChecks(); + } + } + } + + public void handleChangeGameState(S2BPacketChangeGameState packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + int i = packetIn.func_149138_c(); + float f = packetIn.func_149137_d(); + int j = MathHelper.floor_float(f + 0.5F); + + if (i >= 0 && i < S2BPacketChangeGameState.field_149142_a.length && S2BPacketChangeGameState.field_149142_a[i] != null) + { + entityclientplayermp.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.field_149142_a[i], new Object[0])); + } + + if (i == 1) + { + this.clientWorldController.getWorldInfo().setRaining(true); + this.clientWorldController.setRainStrength(0.0F); + } + else if (i == 2) + { + this.clientWorldController.getWorldInfo().setRaining(false); + this.clientWorldController.setRainStrength(1.0F); + } + else if (i == 3) + { + this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j)); + } + else if (i == 4) + { + this.gameController.displayGuiScreen(new GuiWinGame()); + } + else if (i == 5) + { + GameSettings gamesettings = this.gameController.gameSettings; + + if (f == 0.0F) + { + this.gameController.displayGuiScreen(new GuiScreenDemo()); + } + else if (f == 101.0F) + { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())})); + } + else if (f == 102.0F) + { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())})); + } + else if (f == 103.0F) + { + this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())})); + } + } + else if (i == 6) + { + this.clientWorldController.playSound(entityclientplayermp.posX, entityclientplayermp.posY + (double)entityclientplayermp.getEyeHeight(), entityclientplayermp.posZ, "random.successful_hit", 0.18F, 0.45F, false); + } + else if (i == 7) + { + this.clientWorldController.setRainStrength(f); + } + else if (i == 8) + { + this.clientWorldController.setThunderStrength(f); + } + } + + /** + * Updates the worlds MapStorage with the specified MapData for the specified map-identifier and invokes a + * MapItemRenderer for it + */ + public void handleMaps(S34PacketMaps packetIn) + { + MapData mapdata = ItemMap.func_150912_a(packetIn.func_149188_c(), this.gameController.theWorld); + mapdata.updateMPMapData(packetIn.func_149187_d()); + this.gameController.entityRenderer.getMapItemRenderer().func_148246_a(mapdata); + } + + public void handleEffect(S28PacketEffect packetIn) + { + if (packetIn.func_149244_c()) + { + this.gameController.theWorld.playBroadcastSound(packetIn.func_149242_d(), packetIn.func_149240_f(), packetIn.func_149243_g(), packetIn.func_149239_h(), packetIn.func_149241_e()); + } + else + { + this.gameController.theWorld.playAuxSFX(packetIn.func_149242_d(), packetIn.func_149240_f(), packetIn.func_149243_g(), packetIn.func_149239_h(), packetIn.func_149241_e()); + } + } + + /** + * Updates the players statistics or achievements + */ + public void handleStatistics(S37PacketStatistics packetIn) + { + boolean flag = false; + StatBase statbase; + int i; + + for (Iterator iterator = packetIn.func_148974_c().entrySet().iterator(); iterator.hasNext(); this.gameController.thePlayer.getStatFileWriter().func_150873_a(this.gameController.thePlayer, statbase, i)) + { + Entry entry = (Entry)iterator.next(); + statbase = (StatBase)entry.getKey(); + i = ((Integer)entry.getValue()).intValue(); + + if (statbase.isAchievement() && i > 0) + { + if (this.field_147308_k && this.gameController.thePlayer.getStatFileWriter().writeStat(statbase) == 0) + { + Achievement achievement = (Achievement)statbase; + this.gameController.guiAchievement.func_146256_a(achievement); + this.gameController.func_152346_Z().func_152911_a(new MetadataAchievement(achievement), 0L); + + if (statbase == AchievementList.openInventory) + { + this.gameController.gameSettings.showInventoryAchievementHint = false; + this.gameController.gameSettings.saveOptions(); + } + } + + flag = true; + } + } + + if (!this.field_147308_k && !flag && this.gameController.gameSettings.showInventoryAchievementHint) + { + this.gameController.guiAchievement.func_146255_b(AchievementList.openInventory); + } + + this.field_147308_k = true; + + if (this.gameController.currentScreen instanceof IProgressMeter) + { + ((IProgressMeter)this.gameController.currentScreen).func_146509_g(); + } + } + + public void handleEntityEffect(S1DPacketEntityEffect packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149426_d()); + + if (entity instanceof EntityLivingBase) + { + PotionEffect potioneffect = new PotionEffect(packetIn.func_149427_e(), packetIn.func_149425_g(), packetIn.func_149428_f()); + potioneffect.setPotionDurationMax(packetIn.func_149429_c()); + ((EntityLivingBase)entity).addPotionEffect(potioneffect); + } + } + + /** + * Handle a remove entity effect packet. + */ + public void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149076_c()); + + if (entity instanceof EntityLivingBase) + { + ((EntityLivingBase)entity).removePotionEffectClient(packetIn.func_149075_d()); + } + } + + public void handlePlayerListItem(S38PacketPlayerListItem packetIn) + { + GuiPlayerInfo guiplayerinfo = (GuiPlayerInfo)this.playerInfoMap.get(packetIn.func_149122_c()); + + if (guiplayerinfo == null && packetIn.func_149121_d()) + { + guiplayerinfo = new GuiPlayerInfo(packetIn.func_149122_c()); + this.playerInfoMap.put(packetIn.func_149122_c(), guiplayerinfo); + this.playerInfoList.add(guiplayerinfo); + } + + if (guiplayerinfo != null && !packetIn.func_149121_d()) + { + this.playerInfoMap.remove(packetIn.func_149122_c()); + this.playerInfoList.remove(guiplayerinfo); + } + + if (guiplayerinfo != null && packetIn.func_149121_d()) + { + guiplayerinfo.responseTime = packetIn.func_149120_e(); + } + } + + public void handleKeepAlive(S00PacketKeepAlive packetIn) + { + this.addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c())); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + throw new IllegalStateException("Unexpected protocol change!"); + } + + public void handlePlayerAbilities(S39PacketPlayerAbilities packetIn) + { + EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; + entityclientplayermp.capabilities.isFlying = packetIn.func_149106_d(); + entityclientplayermp.capabilities.isCreativeMode = packetIn.func_149103_f(); + entityclientplayermp.capabilities.disableDamage = packetIn.func_149112_c(); + entityclientplayermp.capabilities.allowFlying = packetIn.func_149105_e(); + entityclientplayermp.capabilities.setFlySpeed(packetIn.func_149101_g()); + entityclientplayermp.capabilities.setPlayerWalkSpeed(packetIn.func_149107_h()); + } + + /** + * Displays the available command-completion options the server knows of + */ + public void handleTabComplete(S3APacketTabComplete packetIn) + { + String[] astring = packetIn.func_149630_c(); + + if (this.gameController.currentScreen instanceof GuiChat) + { + GuiChat guichat = (GuiChat)this.gameController.currentScreen; + guichat.func_146406_a(astring); + } + } + + public void handleSoundEffect(S29PacketSoundEffect packetIn) + { + this.gameController.theWorld.playSound(packetIn.func_149207_d(), packetIn.func_149211_e(), packetIn.func_149210_f(), packetIn.func_149212_c(), packetIn.func_149208_g(), packetIn.func_149209_h(), false); + } + + /** + * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to + * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the + * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server + * resourcepack for the client to load. + */ + public void handleCustomPayload(S3FPacketCustomPayload packetIn) + { + if ("MC|TrList".equals(packetIn.func_149169_c())) + { + ByteBuf bytebuf = Unpooled.wrappedBuffer(packetIn.func_149168_d()); + + try + { + int i = bytebuf.readInt(); + GuiScreen guiscreen = this.gameController.currentScreen; + + if (guiscreen != null && guiscreen instanceof GuiMerchant && i == this.gameController.thePlayer.openContainer.windowId) + { + IMerchant imerchant = ((GuiMerchant)guiscreen).func_147035_g(); + MerchantRecipeList merchantrecipelist = MerchantRecipeList.func_151390_b(new PacketBuffer(bytebuf)); + imerchant.setRecipes(merchantrecipelist); + } + } + catch (IOException ioexception) + { + logger.error("Couldn\'t load trade info", ioexception); + } + finally + { + bytebuf.release(); + } + } + else if ("MC|Brand".equals(packetIn.func_149169_c())) + { + this.gameController.thePlayer.func_142020_c(new String(packetIn.func_149168_d(), Charsets.UTF_8)); + } + else if ("MC|RPack".equals(packetIn.func_149169_c())) + { + final String s = new String(packetIn.func_149168_d(), Charsets.UTF_8); + + if (this.gameController.func_147104_D() != null && this.gameController.func_147104_D().func_152586_b() == ServerData.ServerResourceMode.ENABLED) + { + this.gameController.getResourcePackRepository().func_148526_a(s); + } + else if (this.gameController.func_147104_D() == null || this.gameController.func_147104_D().func_152586_b() == ServerData.ServerResourceMode.PROMPT) + { + this.gameController.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() + { + private static final String __OBFID = "CL_00000879"; + public void confirmClicked(boolean result, int id) + { + NetHandlerPlayClient.this.gameController = Minecraft.getMinecraft(); + + if (NetHandlerPlayClient.this.gameController.func_147104_D() != null) + { + NetHandlerPlayClient.this.gameController.func_147104_D().func_152584_a(ServerData.ServerResourceMode.ENABLED); + ServerList.func_147414_b(NetHandlerPlayClient.this.gameController.func_147104_D()); + } + + if (result) + { + NetHandlerPlayClient.this.gameController.getResourcePackRepository().func_148526_a(s); + } + + NetHandlerPlayClient.this.gameController.displayGuiScreen((GuiScreen)null); + } + }, I18n.format("multiplayer.texturePrompt.line1", new Object[0]), I18n.format("multiplayer.texturePrompt.line2", new Object[0]), 0)); + } + } + } + + /** + * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname + */ + public void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn) + { + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + ScoreObjective scoreobjective; + + if (packetIn.func_149338_e() == 0) + { + scoreobjective = scoreboard.addScoreObjective(packetIn.func_149339_c(), IScoreObjectiveCriteria.field_96641_b); + scoreobjective.setDisplayName(packetIn.func_149337_d()); + } + else + { + scoreobjective = scoreboard.getObjective(packetIn.func_149339_c()); + + if (packetIn.func_149338_e() == 1) + { + scoreboard.func_96519_k(scoreobjective); + } + else if (packetIn.func_149338_e() == 2) + { + scoreobjective.setDisplayName(packetIn.func_149337_d()); + } + } + } + + /** + * Either updates the score with a specified value or removes the score for an objective + */ + public void handleUpdateScore(S3CPacketUpdateScore packetIn) + { + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149321_d()); + + if (packetIn.func_149322_f() == 0) + { + Score score = scoreboard.func_96529_a(packetIn.func_149324_c(), scoreobjective); + score.setScorePoints(packetIn.func_149323_e()); + } + else if (packetIn.func_149322_f() == 1) + { + scoreboard.func_96515_c(packetIn.func_149324_c()); + } + } + + /** + * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below + * name) + */ + public void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn) + { + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + + if (packetIn.func_149370_d().length() == 0) + { + scoreboard.func_96530_a(packetIn.func_149371_c(), (ScoreObjective)null); + } + else + { + ScoreObjective scoreobjective = scoreboard.getObjective(packetIn.func_149370_d()); + scoreboard.func_96530_a(packetIn.func_149371_c(), scoreobjective); + } + } + + /** + * Updates a team managed by the scoreboard: Create/Remove the team registration, Register/Remove the player-team- + * memberships, Set team displayname/prefix/suffix and/or whether friendly fire is enabled + */ + public void handleTeams(S3EPacketTeams packetIn) + { + Scoreboard scoreboard = this.clientWorldController.getScoreboard(); + ScorePlayerTeam scoreplayerteam; + + if (packetIn.func_149307_h() == 0) + { + scoreplayerteam = scoreboard.createTeam(packetIn.func_149312_c()); + } + else + { + scoreplayerteam = scoreboard.getTeam(packetIn.func_149312_c()); + } + + if (packetIn.func_149307_h() == 0 || packetIn.func_149307_h() == 2) + { + scoreplayerteam.setTeamName(packetIn.func_149306_d()); + scoreplayerteam.setNamePrefix(packetIn.func_149311_e()); + scoreplayerteam.setNameSuffix(packetIn.func_149309_f()); + scoreplayerteam.func_98298_a(packetIn.func_149308_i()); + } + + Iterator iterator; + String s; + + if (packetIn.func_149307_h() == 0 || packetIn.func_149307_h() == 3) + { + iterator = packetIn.func_149310_g().iterator(); + + while (iterator.hasNext()) + { + s = (String)iterator.next(); + scoreboard.func_151392_a(s, packetIn.func_149312_c()); + } + } + + if (packetIn.func_149307_h() == 4) + { + iterator = packetIn.func_149310_g().iterator(); + + while (iterator.hasNext()) + { + s = (String)iterator.next(); + scoreboard.removePlayerFromTeam(s, scoreplayerteam); + } + } + + if (packetIn.func_149307_h() == 1) + { + scoreboard.removeTeam(scoreplayerteam); + } + } + + /** + * Spawns a specified number of particles at the specified location with a randomized displacement according to + * specified bounds + */ + public void handleParticles(S2APacketParticles packetIn) + { + if (packetIn.func_149222_k() == 0) + { + double d0 = (double)(packetIn.func_149227_j() * packetIn.func_149221_g()); + double d2 = (double)(packetIn.func_149227_j() * packetIn.func_149224_h()); + double d4 = (double)(packetIn.func_149227_j() * packetIn.func_149223_i()); + this.clientWorldController.spawnParticle(packetIn.func_149228_c(), packetIn.func_149220_d(), packetIn.func_149226_e(), packetIn.func_149225_f(), d0, d2, d4); + } + else + { + for (int i = 0; i < packetIn.func_149222_k(); ++i) + { + double d1 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149221_g(); + double d3 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149224_h(); + double d5 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149223_i(); + double d6 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149227_j(); + double d7 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149227_j(); + double d8 = this.avRandomizer.nextGaussian() * (double)packetIn.func_149227_j(); + this.clientWorldController.spawnParticle(packetIn.func_149228_c(), packetIn.func_149220_d() + d1, packetIn.func_149226_e() + d3, packetIn.func_149225_f() + d5, d6, d7, d8); + } + } + } + + /** + * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player + * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie + * maxHealth and knockback resistance as well as reinforcement spawning chance. + */ + public void handleEntityProperties(S20PacketEntityProperties packetIn) + { + Entity entity = this.clientWorldController.getEntityByID(packetIn.func_149442_c()); + + if (entity != null) + { + if (!(entity instanceof EntityLivingBase)) + { + throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")"); + } + else + { + BaseAttributeMap baseattributemap = ((EntityLivingBase)entity).getAttributeMap(); + Iterator iterator = packetIn.func_149441_d().iterator(); + + while (iterator.hasNext()) + { + S20PacketEntityProperties.Snapshot snapshot = (S20PacketEntityProperties.Snapshot)iterator.next(); + IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(snapshot.func_151409_a()); + + if (iattributeinstance == null) + { + iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); + } + + iattributeinstance.setBaseValue(snapshot.func_151410_b()); + iattributeinstance.removeAllModifiers(); + Iterator iterator1 = snapshot.func_151408_c().iterator(); + + while (iterator1.hasNext()) + { + AttributeModifier attributemodifier = (AttributeModifier)iterator1.next(); + iattributeinstance.applyModifier(attributemodifier); + } + } + } + } + } + + /** + * Returns this the NetworkManager instance registered with this NetworkHandlerPlayClient + */ + public NetworkManager getNetworkManager() + { + return this.netManager; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/network/OldServerPinger.java b/build/rfg/minecraft-src/java/net/minecraft/client/network/OldServerPinger.java new file mode 100644 index 0000000..fc463e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/network/OldServerPinger.java @@ -0,0 +1,365 @@ +package net.minecraft.client.network; + +import com.google.common.base.Charsets; +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.bootstrap.Bootstrap; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.util.concurrent.GenericFutureListener; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerAddress; +import net.minecraft.client.multiplayer.ServerData; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class OldServerPinger +{ + private static final Splitter field_147230_a = Splitter.on('\u0000').limit(6); + private static final Logger logger = LogManager.getLogger(); + private final List field_147229_c = Collections.synchronizedList(new ArrayList()); + private static final String __OBFID = "CL_00000892"; + + public void func_147224_a(final ServerData server) throws UnknownHostException + { + ServerAddress serveraddress = ServerAddress.func_78860_a(server.serverIP); + final NetworkManager networkmanager = NetworkManager.provideLanClient(InetAddress.getByName(serveraddress.getIP()), serveraddress.getPort()); + this.field_147229_c.add(networkmanager); + server.serverMOTD = "Pinging..."; + server.pingToServer = -1L; + server.field_147412_i = null; + networkmanager.setNetHandler(new INetHandlerStatusClient() + { + private boolean field_147403_d = false; + private static final String __OBFID = "CL_00000893"; + public void handleServerInfo(S00PacketServerInfo packetIn) + { + ServerStatusResponse serverstatusresponse = packetIn.func_149294_c(); + + if (serverstatusresponse.func_151317_a() != null) + { + server.serverMOTD = serverstatusresponse.func_151317_a().getFormattedText(); + } + else + { + server.serverMOTD = ""; + } + + if (serverstatusresponse.func_151322_c() != null) + { + server.gameVersion = serverstatusresponse.func_151322_c().func_151303_a(); + server.field_82821_f = serverstatusresponse.func_151322_c().func_151304_b(); + } + else + { + server.gameVersion = "Old"; + server.field_82821_f = 0; + } + + if (serverstatusresponse.func_151318_b() != null) + { + server.populationInfo = EnumChatFormatting.GRAY + "" + serverstatusresponse.func_151318_b().func_151333_b() + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + serverstatusresponse.func_151318_b().func_151332_a(); + + if (ArrayUtils.isNotEmpty(serverstatusresponse.func_151318_b().func_151331_c())) + { + StringBuilder stringbuilder = new StringBuilder(); + GameProfile[] agameprofile = serverstatusresponse.func_151318_b().func_151331_c(); + int i = agameprofile.length; + + for (int j = 0; j < i; ++j) + { + GameProfile gameprofile = agameprofile[j]; + + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append(gameprofile.getName()); + } + + if (serverstatusresponse.func_151318_b().func_151331_c().length < serverstatusresponse.func_151318_b().func_151333_b()) + { + if (stringbuilder.length() > 0) + { + stringbuilder.append("\n"); + } + + stringbuilder.append("... and ").append(serverstatusresponse.func_151318_b().func_151333_b() - serverstatusresponse.func_151318_b().func_151331_c().length).append(" more ..."); + } + + server.field_147412_i = stringbuilder.toString(); + } + } + else + { + server.populationInfo = EnumChatFormatting.DARK_GRAY + "???"; + } + + if (serverstatusresponse.func_151316_d() != null) + { + String s = serverstatusresponse.func_151316_d(); + + if (s.startsWith("data:image/png;base64,")) + { + server.func_147407_a(s.substring("data:image/png;base64,".length())); + } + else + { + OldServerPinger.logger.error("Invalid server icon (unknown format)"); + } + } + else + { + server.func_147407_a((String)null); + } + + FMLClientHandler.instance().bindServerListData(server, serverstatusresponse); + networkmanager.scheduleOutboundPacket(new C01PacketPing(Minecraft.getSystemTime()), new GenericFutureListener[0]); + this.field_147403_d = true; + } + public void handlePong(S01PacketPong packetIn) + { + long i = packetIn.func_149292_c(); + long j = Minecraft.getSystemTime(); + server.pingToServer = j - i; + networkmanager.closeChannel(new ChatComponentText("Finished")); + } + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + if (!this.field_147403_d) + { + OldServerPinger.logger.error("Can\'t ping " + server.serverIP + ": " + reason.getUnformattedText()); + server.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t connect to server."; + server.populationInfo = ""; + OldServerPinger.this.func_147225_b(server); + } + } + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically + * throws IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + if (newState != EnumConnectionState.STATUS) + { + throw new UnsupportedOperationException("Unexpected change in protocol to " + newState); + } + } + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in + * NetHandlerLoginServer for a login-timeout + */ + public void onNetworkTick() {} + }); + + try + { + networkmanager.scheduleOutboundPacket(new C00Handshake(5, serveraddress.getIP(), serveraddress.getPort(), EnumConnectionState.STATUS), new GenericFutureListener[0]); + networkmanager.scheduleOutboundPacket(new C00PacketServerQuery(), new GenericFutureListener[0]); + } + catch (Throwable throwable) + { + logger.error(throwable); + } + } + + private void func_147225_b(final ServerData server) + { + final ServerAddress serveraddress = ServerAddress.func_78860_a(server.serverIP); + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group(NetworkManager.eventLoops)).handler(new ChannelInitializer() + { + private static final String __OBFID = "CL_00000894"; + protected void initChannel(Channel p_initChannel_1_) + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, Integer.valueOf(24)); + } + catch (ChannelException channelexception1) + { + ; + } + + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(false)); + } + catch (ChannelException channelexception) + { + ; + } + + p_initChannel_1_.pipeline().addLast(new ChannelHandler[] {new SimpleChannelInboundHandler() + { + private static final String __OBFID = "CL_00000895"; + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception + { + super.channelActive(p_channelActive_1_); + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + bytebuf.writeByte(254); + bytebuf.writeByte(1); + bytebuf.writeByte(250); + char[] achar = "MC|PingHost".toCharArray(); + bytebuf.writeShort(achar.length); + char[] achar1 = achar; + int i = achar.length; + int j; + char c0; + + for (j = 0; j < i; ++j) + { + c0 = achar1[j]; + bytebuf.writeChar(c0); + } + + bytebuf.writeShort(7 + 2 * serveraddress.getIP().length()); + bytebuf.writeByte(127); + achar = serveraddress.getIP().toCharArray(); + bytebuf.writeShort(achar.length); + achar1 = achar; + i = achar.length; + + for (j = 0; j < i; ++j) + { + c0 = achar1[j]; + bytebuf.writeChar(c0); + } + + bytebuf.writeInt(serveraddress.getPort()); + p_channelActive_1_.channel().writeAndFlush(bytebuf).addListener(ChannelFutureListener.CLOSE_ON_FAILURE); + } + finally + { + bytebuf.release(); + } + } + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, ByteBuf p_channelRead0_2_) + { + short short1 = p_channelRead0_2_.readUnsignedByte(); + + if (short1 == 255) + { + String s = new String(p_channelRead0_2_.readBytes(p_channelRead0_2_.readShort() * 2).array(), Charsets.UTF_16BE); + String[] astring = (String[])Iterables.toArray(OldServerPinger.field_147230_a.split(s), String.class); + + if ("\u00a71".equals(astring[0])) + { + int i = MathHelper.parseIntWithDefault(astring[1], 0); + String s1 = astring[2]; + String s2 = astring[3]; + int j = MathHelper.parseIntWithDefault(astring[4], -1); + int k = MathHelper.parseIntWithDefault(astring[5], -1); + server.field_82821_f = -1; + server.gameVersion = s1; + server.serverMOTD = s2; + server.populationInfo = EnumChatFormatting.GRAY + "" + j + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + k; + } + } + + p_channelRead0_1_.close(); + } + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) + { + p_exceptionCaught_1_.close(); + } + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Object p_channelRead0_2_) + { + this.channelRead0(p_channelRead0_1_, (ByteBuf)p_channelRead0_2_); + } + } + }); + } + })).channel(NioSocketChannel.class)).connect(serveraddress.getIP(), serveraddress.getPort()); + } + + public void func_147223_a() + { + List list = this.field_147229_c; + + synchronized (this.field_147229_c) + { + Iterator iterator = this.field_147229_c.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + networkmanager.processReceivedPackets(); + } + else + { + iterator.remove(); + + if (networkmanager.getExitMessage() != null) + { + networkmanager.getNetHandler().onDisconnect(networkmanager.getExitMessage()); + } + } + } + } + } + + public void func_147226_b() + { + List list = this.field_147229_c; + + synchronized (this.field_147229_c) + { + Iterator iterator = this.field_147229_c.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + iterator.remove(); + networkmanager.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EffectRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EffectRenderer.java new file mode 100644 index 0000000..44b8b97 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EffectRenderer.java @@ -0,0 +1,314 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class EffectRenderer +{ + private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); + /** Reference to the World object. */ + protected World worldObj; + private List[] fxLayers = new List[4]; + private TextureManager renderer; + /** RNG. */ + private Random rand = new Random(); + private static final String __OBFID = "CL_00000915"; + + public EffectRenderer(World p_i1220_1_, TextureManager p_i1220_2_) + { + if (p_i1220_1_ != null) + { + this.worldObj = p_i1220_1_; + } + + this.renderer = p_i1220_2_; + + for (int i = 0; i < 4; ++i) + { + this.fxLayers[i] = new ArrayList(); + } + } + + public void addEffect(EntityFX p_78873_1_) + { + int i = p_78873_1_.getFXLayer(); + + if (this.fxLayers[i].size() >= 4000) + { + this.fxLayers[i].remove(0); + } + + this.fxLayers[i].add(p_78873_1_); + } + + public void updateEffects() + { + for (int k = 0; k < 4; ++k) + { + final int i = k; + + for (int j = 0; j < this.fxLayers[i].size(); ++j) + { + final EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j); + + try + { + if (entityfx != null) + { + entityfx.onUpdate(); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being ticked"); + crashreportcategory.addCrashSectionCallable("Particle", new Callable() + { + private static final String __OBFID = "CL_00000916"; + public String call() + { + return entityfx.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Particle Type", new Callable() + { + private static final String __OBFID = "CL_00000917"; + public String call() + { + return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 2 ? "ITEM_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i))); + } + }); + throw new ReportedException(crashreport); + } + + if (entityfx == null || entityfx.isDead) + { + this.fxLayers[i].remove(j--); + } + } + } + } + + /** + * Renders all current particles. Args player, partialTickTime + */ + public void renderParticles(Entity p_78874_1_, float p_78874_2_) + { + float f1 = ActiveRenderInfo.rotationX; + float f2 = ActiveRenderInfo.rotationZ; + float f3 = ActiveRenderInfo.rotationYZ; + float f4 = ActiveRenderInfo.rotationXY; + float f5 = ActiveRenderInfo.rotationXZ; + EntityFX.interpPosX = p_78874_1_.lastTickPosX + (p_78874_1_.posX - p_78874_1_.lastTickPosX) * (double)p_78874_2_; + EntityFX.interpPosY = p_78874_1_.lastTickPosY + (p_78874_1_.posY - p_78874_1_.lastTickPosY) * (double)p_78874_2_; + EntityFX.interpPosZ = p_78874_1_.lastTickPosZ + (p_78874_1_.posZ - p_78874_1_.lastTickPosZ) * (double)p_78874_2_; + + for (int k = 0; k < 3; ++k) + { + final int i = k; + + if (!this.fxLayers[i].isEmpty()) + { + switch (i) + { + case 0: + default: + this.renderer.bindTexture(particleTextures); + break; + case 1: + this.renderer.bindTexture(TextureMap.locationBlocksTexture); + break; + case 2: + this.renderer.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + + for (int j = 0; j < this.fxLayers[i].size(); ++j) + { + final EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j); + if (entityfx == null) continue; + tessellator.setBrightness(entityfx.getBrightnessForRender(p_78874_2_)); + + try + { + entityfx.renderParticle(tessellator, p_78874_2_, f1, f5, f2, f3, f4); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being rendered"); + crashreportcategory.addCrashSectionCallable("Particle", new Callable() + { + private static final String __OBFID = "CL_00000918"; + public String call() + { + return entityfx.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Particle Type", new Callable() + { + private static final String __OBFID = "CL_00000919"; + public String call() + { + return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 2 ? "ITEM_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i))); + } + }); + throw new ReportedException(crashreport); + } + } + + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + } + } + } + + public void renderLitParticles(Entity p_78872_1_, float p_78872_2_) + { + float f1 = 0.017453292F; + float f2 = MathHelper.cos(p_78872_1_.rotationYaw * 0.017453292F); + float f3 = MathHelper.sin(p_78872_1_.rotationYaw * 0.017453292F); + float f4 = -f3 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); + float f5 = f2 * MathHelper.sin(p_78872_1_.rotationPitch * 0.017453292F); + float f6 = MathHelper.cos(p_78872_1_.rotationPitch * 0.017453292F); + byte b0 = 3; + List list = this.fxLayers[b0]; + + if (!list.isEmpty()) + { + Tessellator tessellator = Tessellator.instance; + + for (int i = 0; i < list.size(); ++i) + { + EntityFX entityfx = (EntityFX)list.get(i); + if (entityfx == null) continue; + tessellator.setBrightness(entityfx.getBrightnessForRender(p_78872_2_)); + entityfx.renderParticle(tessellator, p_78872_2_, f2, f6, f3, f4, f5); + } + } + } + + public void clearEffects(World p_78870_1_) + { + this.worldObj = p_78870_1_; + + for (int i = 0; i < 4; ++i) + { + this.fxLayers[i].clear(); + } + } + + public void addBlockDestroyEffects(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) + { + if (!p_147215_4_.isAir(worldObj, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(worldObj, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this)) + { + byte b0 = 4; + + for (int i1 = 0; i1 < b0; ++i1) + { + for (int j1 = 0; j1 < b0; ++j1) + { + for (int k1 = 0; k1 < b0; ++k1) + { + double d0 = (double)p_147215_1_ + ((double)i1 + 0.5D) / (double)b0; + double d1 = (double)p_147215_2_ + ((double)j1 + 0.5D) / (double)b0; + double d2 = (double)p_147215_3_ + ((double)k1 + 0.5D) / (double)b0; + this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, d0 - (double)p_147215_1_ - 0.5D, d1 - (double)p_147215_2_ - 0.5D, d2 - (double)p_147215_3_ - 0.5D, p_147215_4_, p_147215_5_)).applyColourMultiplier(p_147215_1_, p_147215_2_, p_147215_3_)); + } + } + } + } + } + + /** + * Adds block hit particles for the specified block. Args: x, y, z, sideHit + */ + public void addBlockHitEffects(int p_78867_1_, int p_78867_2_, int p_78867_3_, int p_78867_4_) + { + Block block = this.worldObj.getBlock(p_78867_1_, p_78867_2_, p_78867_3_); + + if (block.getMaterial() != Material.air) + { + float f = 0.1F; + double d0 = (double)p_78867_1_ + this.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinX(); + double d1 = (double)p_78867_2_ + this.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinY(); + double d2 = (double)p_78867_3_ + this.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinZ(); + + if (p_78867_4_ == 0) + { + d1 = (double)p_78867_2_ + block.getBlockBoundsMinY() - (double)f; + } + + if (p_78867_4_ == 1) + { + d1 = (double)p_78867_2_ + block.getBlockBoundsMaxY() + (double)f; + } + + if (p_78867_4_ == 2) + { + d2 = (double)p_78867_3_ + block.getBlockBoundsMinZ() - (double)f; + } + + if (p_78867_4_ == 3) + { + d2 = (double)p_78867_3_ + block.getBlockBoundsMaxZ() + (double)f; + } + + if (p_78867_4_ == 4) + { + d0 = (double)p_78867_1_ + block.getBlockBoundsMinX() - (double)f; + } + + if (p_78867_4_ == 5) + { + d0 = (double)p_78867_1_ + block.getBlockBoundsMaxX() + (double)f; + } + + this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, this.worldObj.getBlockMetadata(p_78867_1_, p_78867_2_, p_78867_3_))).applyColourMultiplier(p_78867_1_, p_78867_2_, p_78867_3_).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + } + } + + public String getStatistics() + { + return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); + } + + public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target) + { + Block block = worldObj.getBlock(x, y, z); + if (block != null && !block.addHitEffects(worldObj, target, this)) + { + addBlockHitEffects(x, y, z, target.sideHit); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityAuraFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityAuraFX.java new file mode 100644 index 0000000..a8d0844 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityAuraFX.java @@ -0,0 +1,47 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityAuraFX extends EntityFX +{ + private static final String __OBFID = "CL_00000929"; + + public EntityAuraFX(World p_i1232_1_, double p_i1232_2_, double p_i1232_4_, double p_i1232_6_, double p_i1232_8_, double p_i1232_10_, double p_i1232_12_) + { + super(p_i1232_1_, p_i1232_2_, p_i1232_4_, p_i1232_6_, p_i1232_8_, p_i1232_10_, p_i1232_12_); + float f = this.rand.nextFloat() * 0.1F + 0.2F; + this.particleRed = f; + this.particleGreen = f; + this.particleBlue = f; + this.setParticleTextureIndex(0); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; + this.motionX *= 0.019999999552965164D; + this.motionY *= 0.019999999552965164D; + this.motionZ *= 0.019999999552965164D; + this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = true; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.99D; + this.motionY *= 0.99D; + this.motionZ *= 0.99D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBlockDustFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBlockDustFX.java new file mode 100644 index 0000000..72ffedf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBlockDustFX.java @@ -0,0 +1,20 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityBlockDustFX extends EntityDiggingFX +{ + private static final String __OBFID = "CL_00000931"; + + public EntityBlockDustFX(World p_i45072_1_, double p_i45072_2_, double p_i45072_4_, double p_i45072_6_, double p_i45072_8_, double p_i45072_10_, double p_i45072_12_, Block p_i45072_14_, int p_i45072_15_) + { + super(p_i45072_1_, p_i45072_2_, p_i45072_4_, p_i45072_6_, p_i45072_8_, p_i45072_10_, p_i45072_12_, p_i45072_14_, p_i45072_15_); + this.motionX = p_i45072_8_; + this.motionY = p_i45072_10_; + this.motionZ = p_i45072_12_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBreakingFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBreakingFX.java new file mode 100644 index 0000000..ae6c4b7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBreakingFX.java @@ -0,0 +1,70 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityBreakingFX extends EntityFX +{ + private static final String __OBFID = "CL_00000897"; + + public EntityBreakingFX(World p_i1195_1_, double p_i1195_2_, double p_i1195_4_, double p_i1195_6_, Item p_i1195_8_) + { + this(p_i1195_1_, p_i1195_2_, p_i1195_4_, p_i1195_6_, p_i1195_8_, 0); + } + + public EntityBreakingFX(World p_i1196_1_, double p_i1196_2_, double p_i1196_4_, double p_i1196_6_, Item p_i1196_8_, int p_i1196_9_) + { + super(p_i1196_1_, p_i1196_2_, p_i1196_4_, p_i1196_6_, 0.0D, 0.0D, 0.0D); + this.setParticleIcon(p_i1196_8_.getIconFromDamage(p_i1196_9_)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleGravity = Blocks.snow.blockParticleGravity; + this.particleScale /= 2.0F; + } + + public EntityBreakingFX(World p_i1197_1_, double p_i1197_2_, double p_i1197_4_, double p_i1197_6_, double p_i1197_8_, double p_i1197_10_, double p_i1197_12_, Item p_i1197_14_, int p_i1197_15_) + { + this(p_i1197_1_, p_i1197_2_, p_i1197_4_, p_i1197_6_, p_i1197_14_, p_i1197_15_); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1197_8_; + this.motionY += p_i1197_10_; + this.motionZ += p_i1197_12_; + } + + public int getFXLayer() + { + return 2; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f7 = f6 + 0.015609375F; + float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f9 = f8 + 0.015609375F; + float f10 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f6 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f7 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f8 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f9 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } + + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double)f6, (double)f9); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double)f6, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double)f7, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double)f7, (double)f9); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBubbleFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBubbleFX.java new file mode 100644 index 0000000..d72dda1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityBubbleFX.java @@ -0,0 +1,53 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityBubbleFX extends EntityFX +{ + private static final String __OBFID = "CL_00000898"; + + public EntityBubbleFX(World p_i1198_1_, double p_i1198_2_, double p_i1198_4_, double p_i1198_6_, double p_i1198_8_, double p_i1198_10_, double p_i1198_12_) + { + super(p_i1198_1_, p_i1198_2_, p_i1198_4_, p_i1198_6_, p_i1198_8_, p_i1198_10_, p_i1198_12_); + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(32); + this.setSize(0.02F, 0.02F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = p_i1198_8_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.motionY = p_i1198_10_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.motionZ = p_i1198_12_ * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY += 0.002D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8500000238418579D; + this.motionY *= 0.8500000238418579D; + this.motionZ *= 0.8500000238418579D; + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() != Material.water) + { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCloudFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCloudFX.java new file mode 100644 index 0000000..40d64ea --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCloudFX.java @@ -0,0 +1,86 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityCloudFX extends EntityFX +{ + float field_70569_a; + private static final String __OBFID = "CL_00000920"; + + public EntityCloudFX(World p_i1221_1_, double p_i1221_2_, double p_i1221_4_, double p_i1221_6_, double p_i1221_8_, double p_i1221_10_, double p_i1221_12_) + { + super(p_i1221_1_, p_i1221_2_, p_i1221_4_, p_i1221_6_, 0.0D, 0.0D, 0.0D); + float f = 2.5F; + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1221_8_; + this.motionY += p_i1221_10_; + this.motionZ += p_i1221_12_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= f; + this.field_70569_a = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * f); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.field_70569_a * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 2.0D); + + if (entityplayer != null && this.posY > entityplayer.boundingBox.minY) + { + this.posY += (entityplayer.boundingBox.minY - this.posY) * 0.2D; + this.motionY += (entityplayer.motionY - this.motionY) * 0.2D; + this.setPosition(this.posX, this.posY, this.posZ); + } + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCrit2FX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCrit2FX.java new file mode 100644 index 0000000..d5738a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCrit2FX.java @@ -0,0 +1,67 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityCrit2FX extends EntityFX +{ + /** Entity that had been hit and done the Critical hit on. */ + private Entity theEntity; + private int currentLife; + private int maximumLife; + private String particleName; + private static final String __OBFID = "CL_00000899"; + + public EntityCrit2FX(World p_i1199_1_, Entity p_i1199_2_) + { + this(p_i1199_1_, p_i1199_2_, "crit"); + } + + public EntityCrit2FX(World p_i1200_1_, Entity p_i1200_2_, String p_i1200_3_) + { + super(p_i1200_1_, p_i1200_2_.posX, p_i1200_2_.boundingBox.minY + (double)(p_i1200_2_.height / 2.0F), p_i1200_2_.posZ, p_i1200_2_.motionX, p_i1200_2_.motionY, p_i1200_2_.motionZ); + this.theEntity = p_i1200_2_; + this.maximumLife = 3; + this.particleName = p_i1200_3_; + this.onUpdate(); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + for (int i = 0; i < 16; ++i) + { + double d0 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); + double d1 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); + double d2 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); + + if (d0 * d0 + d1 * d1 + d2 * d2 <= 1.0D) + { + double d3 = this.theEntity.posX + d0 * (double)this.theEntity.width / 4.0D; + double d4 = this.theEntity.boundingBox.minY + (double)(this.theEntity.height / 2.0F) + d1 * (double)this.theEntity.height / 4.0D; + double d5 = this.theEntity.posZ + d2 * (double)this.theEntity.width / 4.0D; + this.worldObj.spawnParticle(this.particleName, d3, d4, d5, d0, d1 + 0.2D, d2); + } + } + + ++this.currentLife; + + if (this.currentLife >= this.maximumLife) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCritFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCritFX.java new file mode 100644 index 0000000..52a0a73 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityCritFX.java @@ -0,0 +1,85 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityCritFX extends EntityFX +{ + float initialParticleScale; + private static final String __OBFID = "CL_00000900"; + + public EntityCritFX(World p_i1201_1_, double p_i1201_2_, double p_i1201_4_, double p_i1201_6_, double p_i1201_8_, double p_i1201_10_, double p_i1201_12_) + { + this(p_i1201_1_, p_i1201_2_, p_i1201_4_, p_i1201_6_, p_i1201_8_, p_i1201_10_, p_i1201_12_, 1.0F); + } + + public EntityCritFX(World p_i1202_1_, double p_i1202_2_, double p_i1202_4_, double p_i1202_6_, double p_i1202_8_, double p_i1202_10_, double p_i1202_12_, float p_i1202_14_) + { + super(p_i1202_1_, p_i1202_2_, p_i1202_4_, p_i1202_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1202_8_ * 0.4D; + this.motionY += p_i1202_10_ * 0.4D; + this.motionZ += p_i1202_12_ * 0.4D; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1202_14_; + this.initialParticleScale = this.particleScale; + this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1202_14_); + this.noClip = false; + this.setParticleTextureIndex(65); + this.onUpdate(); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.initialParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.particleGreen = (float)((double)this.particleGreen * 0.96D); + this.particleBlue = (float)((double)this.particleBlue * 0.9D); + this.motionX *= 0.699999988079071D; + this.motionY *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY -= 0.019999999552965164D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDiggingFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDiggingFX.java new file mode 100644 index 0000000..a70babb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDiggingFX.java @@ -0,0 +1,101 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityDiggingFX extends EntityFX +{ + private Block field_145784_a; + private static final String __OBFID = "CL_00000932"; + private int side; + + public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_) + { + this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.rand.nextInt(6)); + } + + public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_, int side) + { + super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_); + this.field_145784_a = p_i1234_14_; + this.setParticleIcon(p_i1234_14_.getIcon(side, p_i1234_15_)); + this.particleGravity = p_i1234_14_.blockParticleGravity; + this.particleRed = this.particleGreen = this.particleBlue = 0.6F; + this.particleScale /= 2.0F; + this.side = side; + } + + /** + * If the block has a colour multiplier, copies it to this particle and returns this particle. + */ + public EntityDiggingFX applyColourMultiplier(int p_70596_1_, int p_70596_2_, int p_70596_3_) + { + if (this.field_145784_a == Blocks.grass && this.side != 1) + { + return this; + } + else + { + int l = this.field_145784_a.colorMultiplier(this.worldObj, p_70596_1_, p_70596_2_, p_70596_3_); + this.particleRed *= (float)(l >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(l >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(l & 255) / 255.0F; + return this; + } + } + + /** + * Creates a new EntityDiggingFX with the block render color applied to the base particle color + */ + public EntityDiggingFX applyRenderColor(int p_90019_1_) + { + if (this.field_145784_a == Blocks.grass) + { + return this; + } + else + { + int j = this.field_145784_a.getRenderColor(p_90019_1_); + this.particleRed *= (float)(j >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(j >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(j & 255) / 255.0F; + return this; + } + } + + public int getFXLayer() + { + return 1; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f7 = f6 + 0.015609375F; + float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f9 = f8 + 0.015609375F; + float f10 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f6 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f7 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f8 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f9 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } + + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorOpaque_F(this.particleRed, this.particleGreen, this.particleBlue); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double)f6, (double)f9); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double)f6, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double)f7, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double)f7, (double)f9); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDropParticleFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDropParticleFX.java new file mode 100644 index 0000000..c815848 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityDropParticleFX.java @@ -0,0 +1,133 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityDropParticleFX extends EntityFX +{ + /** the material type for dropped items/blocks */ + private Material materialType; + /** The height of the current bob */ + private int bobTimer; + private static final String __OBFID = "CL_00000901"; + + public EntityDropParticleFX(World worldIn, double p_i1203_2_, double p_i1203_4_, double p_i1203_6_, Material p_i1203_8_) + { + super(worldIn, p_i1203_2_, p_i1203_4_, p_i1203_6_, 0.0D, 0.0D, 0.0D); + this.motionX = this.motionY = this.motionZ = 0.0D; + + if (p_i1203_8_ == Material.water) + { + this.particleRed = 0.0F; + this.particleGreen = 0.0F; + this.particleBlue = 1.0F; + } + else + { + this.particleRed = 1.0F; + this.particleGreen = 0.0F; + this.particleBlue = 0.0F; + } + + this.setParticleTextureIndex(113); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.materialType = p_i1203_8_; + this.bobTimer = 40; + this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); + this.motionX = this.motionY = this.motionZ = 0.0D; + } + + public int getBrightnessForRender(float p_70070_1_) + { + return this.materialType == Material.water ? super.getBrightnessForRender(p_70070_1_) : 257; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return this.materialType == Material.water ? super.getBrightness(p_70013_1_) : 1.0F; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.materialType == Material.water) + { + this.particleRed = 0.2F; + this.particleGreen = 0.3F; + this.particleBlue = 1.0F; + } + else + { + this.particleRed = 1.0F; + this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); + this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); + } + + this.motionY -= (double)this.particleGravity; + + if (this.bobTimer-- > 0) + { + this.motionX *= 0.02D; + this.motionY *= 0.02D; + this.motionZ *= 0.02D; + this.setParticleTextureIndex(113); + } + else + { + this.setParticleTextureIndex(112); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + + if (this.onGround) + { + if (this.materialType == Material.water) + { + this.setDead(); + this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + else + { + this.setParticleTextureIndex(114); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial(); + + if (material.isLiquid() || material.isSolid()) + { + double d0 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); + + if (this.posY < d0) + { + this.setDead(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java new file mode 100644 index 0000000..c05b2cc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityEnchantmentTableParticleFX.java @@ -0,0 +1,87 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityEnchantmentTableParticleFX extends EntityFX +{ + private float field_70565_a; + private double field_70568_aq; + private double field_70567_ar; + private double field_70566_as; + private static final String __OBFID = "CL_00000902"; + + public EntityEnchantmentTableParticleFX(World p_i1204_1_, double p_i1204_2_, double p_i1204_4_, double p_i1204_6_, double p_i1204_8_, double p_i1204_10_, double p_i1204_12_) + { + super(p_i1204_1_, p_i1204_2_, p_i1204_4_, p_i1204_6_, p_i1204_8_, p_i1204_10_, p_i1204_12_); + this.motionX = p_i1204_8_; + this.motionY = p_i1204_10_; + this.motionZ = p_i1204_12_; + this.field_70568_aq = this.posX = p_i1204_2_; + this.field_70567_ar = this.posY = p_i1204_4_; + this.field_70566_as = this.posZ = p_i1204_6_; + float f = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f; + this.particleGreen *= 0.9F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 30; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); + } + + public int getBrightnessForRender(float p_70070_1_) + { + int i = super.getBrightnessForRender(p_70070_1_); + float f1 = (float)this.particleAge / (float)this.particleMaxAge; + f1 *= f1; + f1 *= f1; + int j = i & 255; + int k = i >> 16 & 255; + k += (int)(f1 * 15.0F * 16.0F); + + if (k > 240) + { + k = 240; + } + + return j | k << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + float f1 = super.getBrightness(p_70013_1_); + float f2 = (float)this.particleAge / (float)this.particleMaxAge; + f2 *= f2; + f2 *= f2; + return f1 * (1.0F - f2) + f2; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float f = (float)this.particleAge / (float)this.particleMaxAge; + f = 1.0F - f; + float f1 = 1.0F - f; + f1 *= f1; + f1 *= f1; + this.posX = this.field_70568_aq + this.motionX * (double)f; + this.posY = this.field_70567_ar + this.motionY * (double)f - (double)(f1 * 1.2F); + this.posZ = this.field_70566_as + this.motionZ * (double)f; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityExplodeFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityExplodeFX.java new file mode 100644 index 0000000..54c1d7a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityExplodeFX.java @@ -0,0 +1,50 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityExplodeFX extends EntityFX +{ + private static final String __OBFID = "CL_00000903"; + + public EntityExplodeFX(World p_i1205_1_, double p_i1205_2_, double p_i1205_4_, double p_i1205_6_, double p_i1205_8_, double p_i1205_10_, double p_i1205_12_) + { + super(p_i1205_1_, p_i1205_2_, p_i1205_4_, p_i1205_6_, p_i1205_8_, p_i1205_10_, p_i1205_12_); + this.motionX = p_i1205_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionY = p_i1205_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.motionZ = p_i1205_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; + this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; + this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.8999999761581421D; + this.motionY *= 0.8999999761581421D; + this.motionZ *= 0.8999999761581421D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFX.java new file mode 100644 index 0000000..3e4b826 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFX.java @@ -0,0 +1,243 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFX extends Entity +{ + protected int particleTextureIndexX; + protected int particleTextureIndexY; + protected float particleTextureJitterX; + protected float particleTextureJitterY; + protected int particleAge; + protected int particleMaxAge; + protected float particleScale; + protected float particleGravity; + /** The red amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ + protected float particleRed; + /** The green amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ + protected float particleGreen; + /** The blue amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ + protected float particleBlue; + /** Particle alpha */ + protected float particleAlpha; + /** The icon field from which the given particle pulls its texture. */ + protected IIcon particleIcon; + public static double interpPosX; + public static double interpPosY; + public static double interpPosZ; + private static final String __OBFID = "CL_00000914"; + + protected EntityFX(World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_) + { + super(p_i1218_1_); + this.particleAlpha = 1.0F; + this.setSize(0.2F, 0.2F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i1218_2_, p_i1218_4_, p_i1218_6_); + this.lastTickPosX = p_i1218_2_; + this.lastTickPosY = p_i1218_4_; + this.lastTickPosZ = p_i1218_6_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; + this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; + this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; + this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); + this.particleAge = 0; + } + + public EntityFX(World p_i1219_1_, double p_i1219_2_, double p_i1219_4_, double p_i1219_6_, double p_i1219_8_, double p_i1219_10_, double p_i1219_12_) + { + this(p_i1219_1_, p_i1219_2_, p_i1219_4_, p_i1219_6_); + this.motionX = p_i1219_8_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + this.motionY = p_i1219_10_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + this.motionZ = p_i1219_12_ + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + float f = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.motionX = this.motionX / (double)f1 * (double)f * 0.4000000059604645D; + this.motionY = this.motionY / (double)f1 * (double)f * 0.4000000059604645D + 0.10000000149011612D; + this.motionZ = this.motionZ / (double)f1 * (double)f * 0.4000000059604645D; + } + + public EntityFX multiplyVelocity(float p_70543_1_) + { + this.motionX *= (double)p_70543_1_; + this.motionY = (this.motionY - 0.10000000149011612D) * (double)p_70543_1_ + 0.10000000149011612D; + this.motionZ *= (double)p_70543_1_; + return this; + } + + public EntityFX multipleParticleScaleBy(float p_70541_1_) + { + this.setSize(0.2F * p_70541_1_, 0.2F * p_70541_1_); + this.particleScale *= p_70541_1_; + return this; + } + + public void setRBGColorF(float p_70538_1_, float p_70538_2_, float p_70538_3_) + { + this.particleRed = p_70538_1_; + this.particleGreen = p_70538_2_; + this.particleBlue = p_70538_3_; + } + + /** + * Sets the particle alpha (float) + */ + public void setAlphaF(float p_82338_1_) + { + this.particleAlpha = p_82338_1_; + } + + public float getRedColorF() + { + return this.particleRed; + } + + public float getGreenColorF() + { + return this.particleGreen; + } + + public float getBlueColorF() + { + return this.particleBlue; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.motionY -= 0.04D * (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = (float)this.particleTextureIndexX / 16.0F; + float f7 = f6 + 0.0624375F; + float f8 = (float)this.particleTextureIndexY / 16.0F; + float f9 = f8 + 0.0624375F; + float f10 = 0.1F * this.particleScale; + + if (this.particleIcon != null) + { + f6 = this.particleIcon.getMinU(); + f7 = this.particleIcon.getMaxU(); + f8 = this.particleIcon.getMinV(); + f9 = this.particleIcon.getMaxV(); + } + + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double)f7, (double)f9); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double)f7, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double)f6, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double)f6, (double)f9); + } + + public int getFXLayer() + { + return 0; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) {} + + public void setParticleIcon(IIcon p_110125_1_) + { + if (this.getFXLayer() == 1) + { + this.particleIcon = p_110125_1_; + } + else + { + if (this.getFXLayer() != 2) + { + throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); + } + + this.particleIcon = p_110125_1_; + } + } + + /** + * Public method to set private field particleTextureIndex. + */ + public void setParticleTextureIndex(int p_70536_1_) + { + if (this.getFXLayer() != 0) + { + throw new RuntimeException("Invalid call to Particle.setMiscTex"); + } + else + { + this.particleTextureIndexX = p_70536_1_ % 16; + this.particleTextureIndexY = p_70536_1_ / 16; + } + } + + public void nextTextureIndexX() + { + ++this.particleTextureIndexX; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } + + public String toString() + { + return this.getClass().getSimpleName() + ", Pos (" + this.posX + "," + this.posY + "," + this.posZ + "), RGBA (" + this.particleRed + "," + this.particleGreen + "," + this.particleBlue + "," + this.particleAlpha + "), Age " + this.particleAge; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java new file mode 100644 index 0000000..42db6d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkOverlayFX.java @@ -0,0 +1,37 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFireworkOverlayFX extends EntityFX +{ + private static final String __OBFID = "CL_00000904"; + + protected EntityFireworkOverlayFX(World message, double cause, double p_i1206_4_, double p_i1206_6_) + { + super(message, cause, p_i1206_4_, p_i1206_6_); + this.particleMaxAge = 4; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = 0.25F; + float f7 = f6 + 0.25F; + float f8 = 0.125F; + float f9 = f8 + 0.25F; + float f10 = 7.1F * MathHelper.sin(((float)this.particleAge + p_70539_2_ - 1.0F) * 0.25F * (float)Math.PI); + this.particleAlpha = 0.6F - ((float)this.particleAge + p_70539_2_ - 1.0F) * 0.25F * 0.5F; + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double)f7, (double)f9); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double)f7, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double)f6, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double)f6, (double)f9); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkSparkFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkSparkFX.java new file mode 100644 index 0000000..1c81ee9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkSparkFX.java @@ -0,0 +1,155 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFireworkSparkFX extends EntityFX +{ + private int baseTextureIndex = 160; + private boolean field_92054_ax; + private boolean field_92048_ay; + private final EffectRenderer field_92047_az; + private float fadeColourRed; + private float fadeColourGreen; + private float fadeColourBlue; + private boolean hasFadeColour; + private static final String __OBFID = "CL_00000905"; + + public EntityFireworkSparkFX(World message, double p_i1207_2_, double p_i1207_4_, double p_i1207_6_, double p_i1207_8_, double p_i1207_10_, double p_i1207_12_, EffectRenderer p_i1207_14_) + { + super(message, p_i1207_2_, p_i1207_4_, p_i1207_6_); + this.motionX = p_i1207_8_; + this.motionY = p_i1207_10_; + this.motionZ = p_i1207_12_; + this.field_92047_az = p_i1207_14_; + this.particleScale *= 0.75F; + this.particleMaxAge = 48 + this.rand.nextInt(12); + this.noClip = false; + } + + public void setTrail(boolean p_92045_1_) + { + this.field_92054_ax = p_92045_1_; + } + + public void setTwinkle(boolean p_92043_1_) + { + this.field_92048_ay = p_92043_1_; + } + + public void setColour(int p_92044_1_) + { + float f = (float)((p_92044_1_ & 16711680) >> 16) / 255.0F; + float f1 = (float)((p_92044_1_ & 65280) >> 8) / 255.0F; + float f2 = (float)((p_92044_1_ & 255) >> 0) / 255.0F; + float f3 = 1.0F; + this.setRBGColorF(f * f3, f1 * f3, f2 * f3); + } + + public void setFadeColour(int p_92046_1_) + { + this.fadeColourRed = (float)((p_92046_1_ & 16711680) >> 16) / 255.0F; + this.fadeColourGreen = (float)((p_92046_1_ & 65280) >> 8) / 255.0F; + this.fadeColourBlue = (float)((p_92046_1_ & 255) >> 0) / 255.0F; + this.hasFadeColour = true; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() + { + return null; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) + { + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + if (this.particleAge > this.particleMaxAge / 2) + { + this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); + + if (this.hasFadeColour) + { + this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; + this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; + this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; + } + } + + this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY -= 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9100000262260437D; + this.motionY *= 0.9100000262260437D; + this.motionZ *= 0.9100000262260437D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) + { + EntityFireworkSparkFX entityfireworksparkfx = new EntityFireworkSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); + entityfireworksparkfx.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); + entityfireworksparkfx.particleAge = entityfireworksparkfx.particleMaxAge / 2; + + if (this.hasFadeColour) + { + entityfireworksparkfx.hasFadeColour = true; + entityfireworksparkfx.fadeColourRed = this.fadeColourRed; + entityfireworksparkfx.fadeColourGreen = this.fadeColourGreen; + entityfireworksparkfx.fadeColourBlue = this.fadeColourBlue; + } + + entityfireworksparkfx.field_92048_ay = this.field_92048_ay; + this.field_92047_az.addEffect(entityfireworksparkfx); + } + } + + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkStarterFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkStarterFX.java new file mode 100644 index 0000000..466652b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFireworkStarterFX.java @@ -0,0 +1,268 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFireworkStarterFX extends EntityFX +{ + private int fireworkAge; + private final EffectRenderer theEffectRenderer; + private NBTTagList fireworkExplosions; + boolean twinkle; + private static final String __OBFID = "CL_00000906"; + + public EntityFireworkStarterFX(World p_i1208_1_, double p_i1208_2_, double p_i1208_4_, double p_i1208_6_, double p_i1208_8_, double p_i1208_10_, double p_i1208_12_, EffectRenderer p_i1208_14_, NBTTagCompound p_i1208_15_) + { + super(p_i1208_1_, p_i1208_2_, p_i1208_4_, p_i1208_6_, 0.0D, 0.0D, 0.0D); + this.motionX = p_i1208_8_; + this.motionY = p_i1208_10_; + this.motionZ = p_i1208_12_; + this.theEffectRenderer = p_i1208_14_; + this.particleMaxAge = 8; + + if (p_i1208_15_ != null) + { + this.fireworkExplosions = p_i1208_15_.getTagList("Explosions", 10); + + if (this.fireworkExplosions.tagCount() == 0) + { + this.fireworkExplosions = null; + } + else + { + this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; + + for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = this.fireworkExplosions.getCompoundTagAt(i); + + if (nbttagcompound1.getBoolean("Flicker")) + { + this.twinkle = true; + this.particleMaxAge += 15; + break; + } + } + } + } + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + boolean flag; + + if (this.fireworkAge == 0 && this.fireworkExplosions != null) + { + flag = this.func_92037_i(); + boolean flag1 = false; + + if (this.fireworkExplosions.tagCount() >= 3) + { + flag1 = true; + } + else + { + for (int i = 0; i < this.fireworkExplosions.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = this.fireworkExplosions.getCompoundTagAt(i); + + if (nbttagcompound.getByte("Type") == 1) + { + flag1 = true; + break; + } + } + } + + String s1 = "fireworks." + (flag1 ? "largeBlast" : "blast") + (flag ? "_far" : ""); + this.worldObj.playSound(this.posX, this.posY, this.posZ, s1, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); + } + + if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) + { + int k = this.fireworkAge / 2; + NBTTagCompound nbttagcompound1 = this.fireworkExplosions.getCompoundTagAt(k); + byte b0 = nbttagcompound1.getByte("Type"); + boolean flag3 = nbttagcompound1.getBoolean("Trail"); + boolean flag2 = nbttagcompound1.getBoolean("Flicker"); + int[] aint = nbttagcompound1.getIntArray("Colors"); + int[] aint1 = nbttagcompound1.getIntArray("FadeColors"); + + if (b0 == 1) + { + this.createBall(0.5D, 4, aint, aint1, flag3, flag2); + } + else if (b0 == 2) + { + this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, aint, aint1, flag3, flag2, false); + } + else if (b0 == 3) + { + this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, aint, aint1, flag3, flag2, true); + } + else if (b0 == 4) + { + this.createBurst(aint, aint1, flag3, flag2); + } + else + { + this.createBall(0.25D, 2, aint, aint1, flag3, flag2); + } + + int j = aint[0]; + float f = (float)((j & 16711680) >> 16) / 255.0F; + float f1 = (float)((j & 65280) >> 8) / 255.0F; + float f2 = (float)((j & 255) >> 0) / 255.0F; + EntityFireworkOverlayFX entityfireworkoverlayfx = new EntityFireworkOverlayFX(this.worldObj, this.posX, this.posY, this.posZ); + entityfireworkoverlayfx.setRBGColorF(f, f1, f2); + this.theEffectRenderer.addEffect(entityfireworkoverlayfx); + } + + ++this.fireworkAge; + + if (this.fireworkAge > this.particleMaxAge) + { + if (this.twinkle) + { + flag = this.func_92037_i(); + String s = "fireworks." + (flag ? "twinkle_far" : "twinkle"); + this.worldObj.playSound(this.posX, this.posY, this.posZ, s, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); + } + + this.setDead(); + } + } + + private boolean func_92037_i() + { + Minecraft minecraft = Minecraft.getMinecraft(); + return minecraft == null || minecraft.renderViewEntity == null || minecraft.renderViewEntity.getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; + } + + /** + * Creates a single particle. Args: x, y, z, x velocity, y velocity, z velocity, colours, fade colours, whether to + * trail, whether to twinkle + */ + private void createParticle(double p_92034_1_, double p_92034_3_, double p_92034_5_, double p_92034_7_, double p_92034_9_, double p_92034_11_, int[] p_92034_13_, int[] p_92034_14_, boolean p_92034_15_, boolean p_92034_16_) + { + EntityFireworkSparkFX entityfireworksparkfx = new EntityFireworkSparkFX(this.worldObj, p_92034_1_, p_92034_3_, p_92034_5_, p_92034_7_, p_92034_9_, p_92034_11_, this.theEffectRenderer); + entityfireworksparkfx.setTrail(p_92034_15_); + entityfireworksparkfx.setTwinkle(p_92034_16_); + int i = this.rand.nextInt(p_92034_13_.length); + entityfireworksparkfx.setColour(p_92034_13_[i]); + + if (p_92034_14_ != null && p_92034_14_.length > 0) + { + entityfireworksparkfx.setFadeColour(p_92034_14_[this.rand.nextInt(p_92034_14_.length)]); + } + + this.theEffectRenderer.addEffect(entityfireworksparkfx); + } + + /** + * Creates a small ball or large ball type explosion. Args: particle speed, size, colours, fade colours, whether to + * trail, whether to flicker + */ + private void createBall(double p_92035_1_, int p_92035_3_, int[] p_92035_4_, int[] p_92035_5_, boolean p_92035_6_, boolean p_92035_7_) + { + double d1 = this.posX; + double d2 = this.posY; + double d3 = this.posZ; + + for (int j = -p_92035_3_; j <= p_92035_3_; ++j) + { + for (int k = -p_92035_3_; k <= p_92035_3_; ++k) + { + for (int l = -p_92035_3_; l <= p_92035_3_; ++l) + { + double d4 = (double)k + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d5 = (double)j + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d6 = (double)l + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; + double d7 = (double)MathHelper.sqrt_double(d4 * d4 + d5 * d5 + d6 * d6) / p_92035_1_ + this.rand.nextGaussian() * 0.05D; + this.createParticle(d1, d2, d3, d4 / d7, d5 / d7, d6 / d7, p_92035_4_, p_92035_5_, p_92035_6_, p_92035_7_); + + if (j != -p_92035_3_ && j != p_92035_3_ && k != -p_92035_3_ && k != p_92035_3_) + { + l += p_92035_3_ * 2 - 1; + } + } + } + } + } + + /** + * Creates a creeper-shaped or star-shaped explosion. Args: particle speed, shape, colours, fade colours, whether to + * trail, whether to flicker, unknown + */ + private void createShaped(double p_92038_1_, double[][] p_92038_3_, int[] p_92038_4_, int[] p_92038_5_, boolean p_92038_6_, boolean p_92038_7_, boolean p_92038_8_) + { + double d1 = p_92038_3_[0][0]; + double d2 = p_92038_3_[0][1]; + this.createParticle(this.posX, this.posY, this.posZ, d1 * p_92038_1_, d2 * p_92038_1_, 0.0D, p_92038_4_, p_92038_5_, p_92038_6_, p_92038_7_); + float f = this.rand.nextFloat() * (float)Math.PI; + double d3 = p_92038_8_ ? 0.034D : 0.34D; + + for (int i = 0; i < 3; ++i) + { + double d4 = (double)f + (double)((float)i * (float)Math.PI) * d3; + double d5 = d1; + double d6 = d2; + + for (int j = 1; j < p_92038_3_.length; ++j) + { + double d7 = p_92038_3_[j][0]; + double d8 = p_92038_3_[j][1]; + + for (double d9 = 0.25D; d9 <= 1.0D; d9 += 0.25D) + { + double d10 = (d5 + (d7 - d5) * d9) * p_92038_1_; + double d11 = (d6 + (d8 - d6) * d9) * p_92038_1_; + double d12 = d10 * Math.sin(d4); + d10 *= Math.cos(d4); + + for (double d13 = -1.0D; d13 <= 1.0D; d13 += 2.0D) + { + this.createParticle(this.posX, this.posY, this.posZ, d10 * d13, d11, d12 * d13, p_92038_4_, p_92038_5_, p_92038_6_, p_92038_7_); + } + } + + d5 = d7; + d6 = d8; + } + } + } + + /** + * Creates a burst type explosion. Args: colours, fade colours, whether to trail, whether to flicker + */ + private void createBurst(int[] p_92036_1_, int[] p_92036_2_, boolean p_92036_3_, boolean p_92036_4_) + { + double d0 = this.rand.nextGaussian() * 0.05D; + double d1 = this.rand.nextGaussian() * 0.05D; + + for (int i = 0; i < 70; ++i) + { + double d2 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + d0; + double d3 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + d1; + double d4 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; + this.createParticle(this.posX, this.posY, this.posZ, d2, d4, d3, p_92036_1_, p_92036_2_, p_92036_3_, p_92036_4_); + } + } + + public int getFXLayer() + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFishWakeFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFishWakeFX.java new file mode 100644 index 0000000..f54227c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFishWakeFX.java @@ -0,0 +1,53 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFishWakeFX extends EntityFX +{ + private static final String __OBFID = "CL_00000933"; + + public EntityFishWakeFX(World p_i45073_1_, double p_i45073_2_, double p_i45073_4_, double p_i45073_6_, double p_i45073_8_, double p_i45073_10_, double p_i45073_12_) + { + super(p_i45073_1_, p_i45073_2_, p_i45073_4_, p_i45073_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19); + this.setSize(0.01F, 0.01F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleGravity = 0.0F; + this.motionX = p_i45073_8_; + this.motionY = p_i45073_10_; + this.motionZ = p_i45073_12_; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + int i = 60 - this.particleMaxAge; + float f = (float)i * 0.001F; + this.setSize(f, f); + this.setParticleTextureIndex(19 + i % 4); + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFlameFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFlameFX.java new file mode 100644 index 0000000..bb21200 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFlameFX.java @@ -0,0 +1,111 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityFlameFX extends EntityFX +{ + /** the scale of the flame FX */ + private float flameScale; + private static final String __OBFID = "CL_00000907"; + + public EntityFlameFX(World p_i1209_1_, double p_i1209_2_, double p_i1209_4_, double p_i1209_6_, double p_i1209_8_, double p_i1209_10_, double p_i1209_12_) + { + super(p_i1209_1_, p_i1209_2_, p_i1209_4_, p_i1209_6_, p_i1209_8_, p_i1209_10_, p_i1209_12_); + this.motionX = this.motionX * 0.009999999776482582D + p_i1209_8_; + this.motionY = this.motionY * 0.009999999776482582D + p_i1209_10_; + this.motionZ = this.motionZ * 0.009999999776482582D + p_i1209_12_; + double d6 = p_i1209_2_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + d6 = p_i1209_4_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + d6 = p_i1209_6_ + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.flameScale = this.particleScale; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4; + this.noClip = true; + this.setParticleTextureIndex(48); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + this.particleScale = this.flameScale * (1.0F - f6 * f6 * 0.5F); + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + public int getBrightnessForRender(float p_70070_1_) + { + float f1 = ((float)this.particleAge + p_70070_1_) / (float)this.particleMaxAge; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + int i = super.getBrightnessForRender(p_70070_1_); + int j = i & 255; + int k = i >> 16 & 255; + j += (int)(f1 * 15.0F * 16.0F); + + if (j > 240) + { + j = 240; + } + + return j | k << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + float f1 = ((float)this.particleAge + p_70013_1_) / (float)this.particleMaxAge; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + float f2 = super.getBrightness(p_70013_1_); + return f2 * f1 + (1.0F - f1); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFootStepFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFootStepFX.java new file mode 100644 index 0000000..5b0b1c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityFootStepFX.java @@ -0,0 +1,78 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class EntityFootStepFX extends EntityFX +{ + private static final ResourceLocation field_110126_a = new ResourceLocation("textures/particle/footprint.png"); + private int footstepAge; + private int footstepMaxAge; + private TextureManager currentFootSteps; + private static final String __OBFID = "CL_00000908"; + + public EntityFootStepFX(TextureManager p_i1210_1_, World p_i1210_2_, double p_i1210_3_, double p_i1210_5_, double p_i1210_7_) + { + super(p_i1210_2_, p_i1210_3_, p_i1210_5_, p_i1210_7_, 0.0D, 0.0D, 0.0D); + this.currentFootSteps = p_i1210_1_; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.footstepMaxAge = 200; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.footstepAge + p_70539_2_) / (float)this.footstepMaxAge; + f6 *= f6; + float f7 = 2.0F - f6 * 2.0F; + + if (f7 > 1.0F) + { + f7 = 1.0F; + } + + f7 *= 0.2F; + GL11.glDisable(GL11.GL_LIGHTING); + float f8 = 0.125F; + float f9 = (float)(this.posX - interpPosX); + float f10 = (float)(this.posY - interpPosY); + float f11 = (float)(this.posZ - interpPosZ); + float f12 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.currentFootSteps.bindTexture(field_110126_a); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + p_70539_1_.startDrawingQuads(); + p_70539_1_.setColorRGBA_F(f12, f12, f12, f7); + p_70539_1_.addVertexWithUV((double)(f9 - f8), (double)f10, (double)(f11 + f8), 0.0D, 1.0D); + p_70539_1_.addVertexWithUV((double)(f9 + f8), (double)f10, (double)(f11 + f8), 1.0D, 1.0D); + p_70539_1_.addVertexWithUV((double)(f9 + f8), (double)f10, (double)(f11 - f8), 1.0D, 0.0D); + p_70539_1_.addVertexWithUV((double)(f9 - f8), (double)f10, (double)(f11 - f8), 0.0D, 0.0D); + p_70539_1_.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + ++this.footstepAge; + + if (this.footstepAge == this.footstepMaxAge) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHeartFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHeartFX.java new file mode 100644 index 0000000..71ce7ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHeartFX.java @@ -0,0 +1,84 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityHeartFX extends EntityFX +{ + float particleScaleOverTime; + private static final String __OBFID = "CL_00000909"; + + public EntityHeartFX(World p_i1211_1_, double p_i1211_2_, double p_i1211_4_, double p_i1211_6_, double p_i1211_8_, double p_i1211_10_, double p_i1211_12_) + { + this(p_i1211_1_, p_i1211_2_, p_i1211_4_, p_i1211_6_, p_i1211_8_, p_i1211_10_, p_i1211_12_, 2.0F); + } + + public EntityHeartFX(World p_i1212_1_, double p_i1212_2_, double p_i1212_4_, double p_i1212_6_, double p_i1212_8_, double p_i1212_10_, double p_i1212_12_, float p_i1212_14_) + { + super(p_i1212_1_, p_i1212_2_, p_i1212_4_, p_i1212_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.1D; + this.particleScale *= 0.75F; + this.particleScale *= p_i1212_14_; + this.particleScaleOverTime = this.particleScale; + this.particleMaxAge = 16; + this.noClip = false; + this.setParticleTextureIndex(80); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.particleScaleOverTime * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.8600000143051147D; + this.motionY *= 0.8600000143051147D; + this.motionZ *= 0.8600000143051147D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHugeExplodeFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHugeExplodeFX.java new file mode 100644 index 0000000..434a4d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityHugeExplodeFX.java @@ -0,0 +1,48 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityHugeExplodeFX extends EntityFX +{ + private int timeSinceStart; + /** the maximum time for the explosion */ + private int maximumTime = 8; + private static final String __OBFID = "CL_00000911"; + + public EntityHugeExplodeFX(World p_i1214_1_, double p_i1214_2_, double p_i1214_4_, double p_i1214_6_, double p_i1214_8_, double p_i1214_10_, double p_i1214_12_) + { + super(p_i1214_1_, p_i1214_2_, p_i1214_4_, p_i1214_6_, 0.0D, 0.0D, 0.0D); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) {} + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + for (int i = 0; i < 6; ++i) + { + double d0 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double d1 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + double d2 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + this.worldObj.spawnParticle("largeexplode", d0, d1, d2, (double)((float)this.timeSinceStart / (float)this.maximumTime), 0.0D, 0.0D); + } + + ++this.timeSinceStart; + + if (this.timeSinceStart == this.maximumTime) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLargeExplodeFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLargeExplodeFX.java new file mode 100644 index 0000000..37c17eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLargeExplodeFX.java @@ -0,0 +1,89 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class EntityLargeExplodeFX extends EntityFX +{ + private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); + private int field_70581_a; + private int field_70584_aq; + /** The Rendering Engine. */ + private TextureManager theRenderEngine; + private float field_70582_as; + private static final String __OBFID = "CL_00000910"; + + public EntityLargeExplodeFX(TextureManager p_i1213_1_, World p_i1213_2_, double p_i1213_3_, double p_i1213_5_, double p_i1213_7_, double p_i1213_9_, double p_i1213_11_, double p_i1213_13_) + { + super(p_i1213_2_, p_i1213_3_, p_i1213_5_, p_i1213_7_, 0.0D, 0.0D, 0.0D); + this.theRenderEngine = p_i1213_1_; + this.field_70584_aq = 6 + this.rand.nextInt(4); + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; + this.field_70582_as = 1.0F - (float)p_i1213_9_ * 0.5F; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + int i = (int)(((float)this.field_70581_a + p_70539_2_) * 15.0F / (float)this.field_70584_aq); + + if (i <= 15) + { + this.theRenderEngine.bindTexture(field_110127_a); + float f6 = (float)(i % 4) / 4.0F; + float f7 = f6 + 0.24975F; + float f8 = (float)(i / 4) / 4.0F; + float f9 = f8 + 0.24975F; + float f10 = 2.0F * this.field_70582_as; + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)p_70539_2_ - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)p_70539_2_ - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70539_2_ - interpPosZ); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); + p_70539_1_.startDrawingQuads(); + p_70539_1_.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); + p_70539_1_.setNormal(0.0F, 1.0F, 0.0F); + p_70539_1_.setBrightness(240); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 - p_70539_7_ * f10), (double)f7, (double)f9); + p_70539_1_.addVertexWithUV((double)(f11 - p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 - p_70539_5_ * f10 + p_70539_7_ * f10), (double)f7, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 + p_70539_6_ * f10), (double)(f12 + p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 + p_70539_7_ * f10), (double)f6, (double)f8); + p_70539_1_.addVertexWithUV((double)(f11 + p_70539_3_ * f10 - p_70539_6_ * f10), (double)(f12 - p_70539_4_ * f10), (double)(f13 + p_70539_5_ * f10 - p_70539_7_ * f10), (double)f6, (double)f9); + p_70539_1_.draw(); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + + public int getBrightnessForRender(float p_70070_1_) + { + return 61680; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_70581_a; + + if (this.field_70581_a == this.field_70584_aq) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLavaFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLavaFX.java new file mode 100644 index 0000000..50fc2b8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityLavaFX.java @@ -0,0 +1,97 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityLavaFX extends EntityFX +{ + private float lavaParticleScale; + private static final String __OBFID = "CL_00000912"; + + public EntityLavaFX(World p_i1215_1_, double p_i1215_2_, double p_i1215_4_, double p_i1215_6_) + { + super(p_i1215_1_, p_i1215_2_, p_i1215_4_, p_i1215_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + this.motionY = (double)(this.rand.nextFloat() * 0.4F + 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; + this.lavaParticleScale = this.particleScale; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + this.setParticleTextureIndex(49); + } + + public int getBrightnessForRender(float p_70070_1_) + { + float f1 = ((float)this.particleAge + p_70070_1_) / (float)this.particleMaxAge; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + int i = super.getBrightnessForRender(p_70070_1_); + short short1 = 240; + int j = i >> 16 & 255; + return short1 | j << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + this.particleScale = this.lavaParticleScale * (1.0F - f6 * f6); + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + float f = (float)this.particleAge / (float)this.particleMaxAge; + + if (this.rand.nextFloat() > f) + { + this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); + } + + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9990000128746033D; + this.motionY *= 0.9990000128746033D; + this.motionZ *= 0.9990000128746033D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityNoteFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityNoteFX.java new file mode 100644 index 0000000..a964da0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityNoteFX.java @@ -0,0 +1,88 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityNoteFX extends EntityFX +{ + float noteParticleScale; + private static final String __OBFID = "CL_00000913"; + + public EntityNoteFX(World p_i1216_1_, double p_i1216_2_, double p_i1216_4_, double p_i1216_6_, double p_i1216_8_, double p_i1216_10_, double p_i1216_12_) + { + this(p_i1216_1_, p_i1216_2_, p_i1216_4_, p_i1216_6_, p_i1216_8_, p_i1216_10_, p_i1216_12_, 2.0F); + } + + public EntityNoteFX(World p_i1217_1_, double p_i1217_2_, double p_i1217_4_, double p_i1217_6_, double p_i1217_8_, double p_i1217_10_, double p_i1217_12_, float p_i1217_14_) + { + super(p_i1217_1_, p_i1217_2_, p_i1217_4_, p_i1217_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.009999999776482582D; + this.motionY *= 0.009999999776482582D; + this.motionZ *= 0.009999999776482582D; + this.motionY += 0.2D; + this.particleRed = MathHelper.sin(((float)p_i1217_8_ + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleGreen = MathHelper.sin(((float)p_i1217_8_ + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleBlue = MathHelper.sin(((float)p_i1217_8_ + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; + this.particleScale *= 0.75F; + this.particleScale *= p_i1217_14_; + this.noteParticleScale = this.particleScale; + this.particleMaxAge = 6; + this.noClip = false; + this.setParticleTextureIndex(64); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.noteParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.6600000262260437D; + this.motionY *= 0.6600000262260437D; + this.motionZ *= 0.6600000262260437D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPickupFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPickupFX.java new file mode 100644 index 0000000..d1c3b32 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPickupFX.java @@ -0,0 +1,73 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class EntityPickupFX extends EntityFX +{ + private Entity entityToPickUp; + private Entity entityPickingUp; + private int age; + private int maxAge; + /** renamed from yOffset to fix shadowing Entity.yOffset */ + private float yOffs; + private static final String __OBFID = "CL_00000930"; + + public EntityPickupFX(World p_i1233_1_, Entity p_i1233_2_, Entity p_i1233_3_, float p_i1233_4_) + { + super(p_i1233_1_, p_i1233_2_.posX, p_i1233_2_.posY, p_i1233_2_.posZ, p_i1233_2_.motionX, p_i1233_2_.motionY, p_i1233_2_.motionZ); + this.entityToPickUp = p_i1233_2_; + this.entityPickingUp = p_i1233_3_; + this.maxAge = 3; + this.yOffs = p_i1233_4_; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.age + p_70539_2_) / (float)this.maxAge; + f6 *= f6; + double d0 = this.entityToPickUp.posX; + double d1 = this.entityToPickUp.posY; + double d2 = this.entityToPickUp.posZ; + double d3 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)p_70539_2_; + double d4 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)p_70539_2_ + (double)this.yOffs; + double d5 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)p_70539_2_; + double d6 = d0 + (d3 - d0) * (double)f6; + double d7 = d1 + (d4 - d1) * (double)f6; + double d8 = d2 + (d5 - d2) * (double)f6; + int i = this.getBrightnessForRender(p_70539_2_); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + d6 -= interpPosX; + d7 -= interpPosY; + d8 -= interpPosZ; + RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.entityToPickUp.rotationYaw, p_70539_2_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + ++this.age; + + if (this.age == this.maxAge) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPortalFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPortalFX.java new file mode 100644 index 0000000..2372fba --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityPortalFX.java @@ -0,0 +1,96 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityPortalFX extends EntityFX +{ + private float portalParticleScale; + private double portalPosX; + private double portalPosY; + private double portalPosZ; + private static final String __OBFID = "CL_00000921"; + + public EntityPortalFX(World p_i1222_1_, double p_i1222_2_, double p_i1222_4_, double p_i1222_6_, double p_i1222_8_, double p_i1222_10_, double p_i1222_12_) + { + super(p_i1222_1_, p_i1222_2_, p_i1222_4_, p_i1222_6_, p_i1222_8_, p_i1222_10_, p_i1222_12_); + this.motionX = p_i1222_8_; + this.motionY = p_i1222_10_; + this.motionZ = p_i1222_12_; + this.portalPosX = this.posX = p_i1222_2_; + this.portalPosY = this.posY = p_i1222_4_; + this.portalPosZ = this.posZ = p_i1222_6_; + float f = this.rand.nextFloat() * 0.6F + 0.4F; + this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * f; + this.particleGreen *= 0.3F; + this.particleRed *= 0.9F; + this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 8.0D)); + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge; + f6 = 1.0F - f6; + f6 *= f6; + f6 = 1.0F - f6; + this.particleScale = this.portalParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + public int getBrightnessForRender(float p_70070_1_) + { + int i = super.getBrightnessForRender(p_70070_1_); + float f1 = (float)this.particleAge / (float)this.particleMaxAge; + f1 *= f1; + f1 *= f1; + int j = i & 255; + int k = i >> 16 & 255; + k += (int)(f1 * 15.0F * 16.0F); + + if (k > 240) + { + k = 240; + } + + return j | k << 16; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + float f1 = super.getBrightness(p_70013_1_); + float f2 = (float)this.particleAge / (float)this.particleMaxAge; + f2 = f2 * f2 * f2 * f2; + return f1 * (1.0F - f2) + f2; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + float f = (float)this.particleAge / (float)this.particleMaxAge; + float f1 = f; + f = -f + f * f * 2.0F; + f = 1.0F - f; + this.posX = this.portalPosX + this.motionX * (double)f; + this.posY = this.portalPosY + this.motionY * (double)f + (double)(1.0F - f1); + this.posZ = this.portalPosZ + this.motionZ * (double)f; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityRainFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityRainFX.java new file mode 100644 index 0000000..91d8cf6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityRainFX.java @@ -0,0 +1,72 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityRainFX extends EntityFX +{ + private static final String __OBFID = "CL_00000934"; + + public EntityRainFX(World p_i1235_1_, double p_i1235_2_, double p_i1235_4_, double p_i1235_6_) + { + super(p_i1235_1_, p_i1235_2_, p_i1235_4_, p_i1235_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.30000001192092896D; + this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); + this.motionZ *= 0.30000001192092896D; + this.particleRed = 1.0F; + this.particleGreen = 1.0F; + this.particleBlue = 1.0F; + this.setParticleTextureIndex(19 + this.rand.nextInt(4)); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + + if (this.onGround) + { + if (Math.random() < 0.5D) + { + this.setDead(); + } + + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + + Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial(); + + if (material.isLiquid() || material.isSolid()) + { + double d0 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); + + if (this.posY < d0) + { + this.setDead(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityReddustFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityReddustFX.java new file mode 100644 index 0000000..3dad4c5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntityReddustFX.java @@ -0,0 +1,94 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntityReddustFX extends EntityFX +{ + float reddustParticleScale; + private static final String __OBFID = "CL_00000923"; + + public EntityReddustFX(World p_i1223_1_, double p_i1223_2_, double p_i1223_4_, double p_i1223_6_, float p_i1223_8_, float p_i1223_9_, float p_i1223_10_) + { + this(p_i1223_1_, p_i1223_2_, p_i1223_4_, p_i1223_6_, 1.0F, p_i1223_8_, p_i1223_9_, p_i1223_10_); + } + + public EntityReddustFX(World p_i1224_1_, double p_i1224_2_, double p_i1224_4_, double p_i1224_6_, float p_i1224_8_, float p_i1224_9_, float p_i1224_10_, float p_i1224_11_) + { + super(p_i1224_1_, p_i1224_2_, p_i1224_4_, p_i1224_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + + if (p_i1224_9_ == 0.0F) + { + p_i1224_9_ = 1.0F; + } + + float f4 = (float)Math.random() * 0.4F + 0.6F; + this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i1224_9_ * f4; + this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i1224_10_ * f4; + this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * p_i1224_11_ * f4; + this.particleScale *= 0.75F; + this.particleScale *= p_i1224_8_; + this.reddustParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1224_8_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.reddustParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySmokeFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySmokeFX.java new file mode 100644 index 0000000..f09ca96 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySmokeFX.java @@ -0,0 +1,89 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntitySmokeFX extends EntityFX +{ + float smokeParticleScale; + private static final String __OBFID = "CL_00000924"; + + public EntitySmokeFX(World p_i1225_1_, double p_i1225_2_, double p_i1225_4_, double p_i1225_6_, double p_i1225_8_, double p_i1225_10_, double p_i1225_12_) + { + this(p_i1225_1_, p_i1225_2_, p_i1225_4_, p_i1225_6_, p_i1225_8_, p_i1225_10_, p_i1225_12_, 1.0F); + } + + public EntitySmokeFX(World p_i1226_1_, double p_i1226_2_, double p_i1226_4_, double p_i1226_6_, double p_i1226_8_, double p_i1226_10_, double p_i1226_12_, float p_i1226_14_) + { + super(p_i1226_1_, p_i1226_2_, p_i1226_4_, p_i1226_6_, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1226_8_; + this.motionY += p_i1226_10_; + this.motionZ += p_i1226_12_; + this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1226_14_; + this.smokeParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1226_14_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.smokeParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySnowShovelFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySnowShovelFX.java new file mode 100644 index 0000000..51d92f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySnowShovelFX.java @@ -0,0 +1,82 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntitySnowShovelFX extends EntityFX +{ + float snowDigParticleScale; + private static final String __OBFID = "CL_00000925"; + + public EntitySnowShovelFX(World p_i1227_1_, double p_i1227_2_, double p_i1227_4_, double p_i1227_6_, double p_i1227_8_, double p_i1227_10_, double p_i1227_12_) + { + this(p_i1227_1_, p_i1227_2_, p_i1227_4_, p_i1227_6_, p_i1227_8_, p_i1227_10_, p_i1227_12_, 1.0F); + } + + public EntitySnowShovelFX(World p_i1228_1_, double p_i1228_2_, double p_i1228_4_, double p_i1228_6_, double p_i1228_8_, double p_i1228_10_, double p_i1228_12_, float p_i1228_14_) + { + super(p_i1228_1_, p_i1228_2_, p_i1228_4_, p_i1228_6_, p_i1228_8_, p_i1228_10_, p_i1228_12_); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += p_i1228_8_; + this.motionY += p_i1228_10_; + this.motionZ += p_i1228_12_; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= p_i1228_14_; + this.snowDigParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int)((float)this.particleMaxAge * p_i1228_14_); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.particleScale = this.snowDigParticleScale * f6; + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.9900000095367432D; + this.motionZ *= 0.9900000095367432D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySpellParticleFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySpellParticleFX.java new file mode 100644 index 0000000..1b6ce65 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySpellParticleFX.java @@ -0,0 +1,90 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntitySpellParticleFX extends EntityFX +{ + /** Base spell texture index */ + private int baseSpellTextureIndex = 128; + private static final String __OBFID = "CL_00000926"; + + public EntitySpellParticleFX(World p_i1229_1_, double p_i1229_2_, double p_i1229_4_, double p_i1229_6_, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_) + { + super(p_i1229_1_, p_i1229_2_, p_i1229_4_, p_i1229_6_, p_i1229_8_, p_i1229_10_, p_i1229_12_); + this.motionY *= 0.20000000298023224D; + + if (p_i1229_8_ == 0.0D && p_i1229_12_ == 0.0D) + { + this.motionX *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + } + + this.particleScale *= 0.75F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + } + + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) + { + float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + + this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + /** + * Sets the base spell texture index + */ + public void setBaseSpellTextureIndex(int p_70589_1_) + { + this.baseSpellTextureIndex = p_70589_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySplashFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySplashFX.java new file mode 100644 index 0000000..21e3ad1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySplashFX.java @@ -0,0 +1,25 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntitySplashFX extends EntityRainFX +{ + private static final String __OBFID = "CL_00000927"; + + public EntitySplashFX(World p_i1230_1_, double p_i1230_2_, double p_i1230_4_, double p_i1230_6_, double p_i1230_8_, double p_i1230_10_, double p_i1230_12_) + { + super(p_i1230_1_, p_i1230_2_, p_i1230_4_, p_i1230_6_); + this.particleGravity = 0.04F; + this.nextTextureIndexX(); + + if (p_i1230_10_ == 0.0D && (p_i1230_8_ != 0.0D || p_i1230_12_ != 0.0D)) + { + this.motionX = p_i1230_8_; + this.motionY = p_i1230_10_ + 0.1D; + this.motionZ = p_i1230_12_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySuspendFX.java b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySuspendFX.java new file mode 100644 index 0000000..9557a32 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/particle/EntitySuspendFX.java @@ -0,0 +1,49 @@ +package net.minecraft.client.particle; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class EntitySuspendFX extends EntityFX +{ + private static final String __OBFID = "CL_00000928"; + + public EntitySuspendFX(World p_i1231_1_, double p_i1231_2_, double p_i1231_4_, double p_i1231_6_, double p_i1231_8_, double p_i1231_10_, double p_i1231_12_) + { + super(p_i1231_1_, p_i1231_2_, p_i1231_4_ - 0.125D, p_i1231_6_, p_i1231_8_, p_i1231_10_, p_i1231_12_); + this.particleRed = 0.4F; + this.particleGreen = 0.4F; + this.particleBlue = 0.7F; + this.setParticleTextureIndex(0); + this.setSize(0.01F, 0.01F); + this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; + this.motionX = p_i1231_8_ * 0.0D; + this.motionY = p_i1231_10_ * 0.0D; + this.motionZ = p_i1231_12_ * 0.0D; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() != Material.water) + { + this.setDead(); + } + + if (this.particleMaxAge-- <= 0) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ActiveRenderInfo.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ActiveRenderInfo.java new file mode 100644 index 0000000..c2ad98d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ActiveRenderInfo.java @@ -0,0 +1,104 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.GLU; + +@SideOnly(Side.CLIENT) +public class ActiveRenderInfo +{ + /** The calculated view object X coordinate */ + public static float objectX; + /** The calculated view object Y coordinate */ + public static float objectY; + /** The calculated view object Z coordinate */ + public static float objectZ; + /** The current GL viewport */ + private static IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); + /** The current GL modelview matrix */ + private static FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); + /** The current GL projection matrix */ + private static FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); + /** The computed view object coordinates */ + private static FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); + /** The X component of the entity's yaw rotation */ + public static float rotationX; + /** The combined X and Z components of the entity's pitch rotation */ + public static float rotationXZ; + /** The Z component of the entity's yaw rotation */ + public static float rotationZ; + /** The Y component (scaled along the Z axis) of the entity's pitch rotation */ + public static float rotationYZ; + /** The Y component (scaled along the X axis) of the entity's pitch rotation */ + public static float rotationXY; + private static final String __OBFID = "CL_00000626"; + + /** + * Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode + */ + public static void updateRenderInfo(EntityPlayer p_74583_0_, boolean p_74583_1_) + { + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); + GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); + float f = (float)((viewport.get(0) + viewport.get(2)) / 2); + float f1 = (float)((viewport.get(1) + viewport.get(3)) / 2); + GLU.gluUnProject(f, f1, 0.0F, modelview, projection, viewport, objectCoords); + objectX = objectCoords.get(0); + objectY = objectCoords.get(1); + objectZ = objectCoords.get(2); + int i = p_74583_1_ ? 1 : 0; + float f2 = p_74583_0_.rotationPitch; + float f3 = p_74583_0_.rotationYaw; + rotationX = MathHelper.cos(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationZ = MathHelper.sin(f3 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationYZ = -rotationZ * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationXY = rotationX * MathHelper.sin(f2 * (float)Math.PI / 180.0F) * (float)(1 - i * 2); + rotationXZ = MathHelper.cos(f2 * (float)Math.PI / 180.0F); + } + + /** + * Returns a vector representing the projection along the given entity's view for the given distance + */ + public static Vec3 projectViewFromEntity(EntityLivingBase p_74585_0_, double p_74585_1_) + { + double d1 = p_74585_0_.prevPosX + (p_74585_0_.posX - p_74585_0_.prevPosX) * p_74585_1_; + double d2 = p_74585_0_.prevPosY + (p_74585_0_.posY - p_74585_0_.prevPosY) * p_74585_1_ + (double)p_74585_0_.getEyeHeight(); + double d3 = p_74585_0_.prevPosZ + (p_74585_0_.posZ - p_74585_0_.prevPosZ) * p_74585_1_; + double d4 = d1 + (double)(objectX * 1.0F); + double d5 = d2 + (double)(objectY * 1.0F); + double d6 = d3 + (double)(objectZ * 1.0F); + return Vec3.createVectorHelper(d4, d5, d6); + } + + public static Block getBlockAtEntityViewpoint(World p_151460_0_, EntityLivingBase p_151460_1_, float p_151460_2_) + { + Vec3 vec3 = projectViewFromEntity(p_151460_1_, (double)p_151460_2_); + ChunkPosition chunkposition = new ChunkPosition(vec3); + Block block = p_151460_0_.getBlock(chunkposition.chunkPosX, chunkposition.chunkPosY, chunkposition.chunkPosZ); + + if (block.getMaterial().isLiquid()) + { + float f1 = BlockLiquid.getLiquidHeightPercent(p_151460_0_.getBlockMetadata(chunkposition.chunkPosX, chunkposition.chunkPosY, chunkposition.chunkPosZ)) - 0.11111111F; + float f2 = (float)(chunkposition.chunkPosY + 1) - f1; + + if (vec3.yCoord >= (double)f2) + { + block = p_151460_0_.getBlock(chunkposition.chunkPosX, chunkposition.chunkPosY + 1, chunkposition.chunkPosZ); + } + } + + return block; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/DestroyBlockProgress.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/DestroyBlockProgress.java new file mode 100644 index 0000000..35c7234 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/DestroyBlockProgress.java @@ -0,0 +1,80 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class DestroyBlockProgress +{ + /** + * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the client + * Renderer, max 1 per player on a server + */ + private final int miningPlayerEntId; + private final int partialBlockX; + private final int partialBlockY; + private final int partialBlockZ; + /** damage ranges from 1 to 10. -1 causes the client to delete the partial block renderer. */ + private int partialBlockProgress; + /** keeps track of how many ticks this PartiallyDestroyedBlock already exists */ + private int createdAtCloudUpdateTick; + private static final String __OBFID = "CL_00001427"; + + public DestroyBlockProgress(int p_i1511_1_, int p_i1511_2_, int p_i1511_3_, int p_i1511_4_) + { + this.miningPlayerEntId = p_i1511_1_; + this.partialBlockX = p_i1511_2_; + this.partialBlockY = p_i1511_3_; + this.partialBlockZ = p_i1511_4_; + } + + public int getPartialBlockX() + { + return this.partialBlockX; + } + + public int getPartialBlockY() + { + return this.partialBlockY; + } + + public int getPartialBlockZ() + { + return this.partialBlockZ; + } + + /** + * inserts damage value into this partially destroyed Block. -1 causes client renderer to delete it, otherwise + * ranges from 1 to 10 + */ + public void setPartialBlockDamage(int damage) + { + if (damage > 10) + { + damage = 10; + } + + this.partialBlockProgress = damage; + } + + public int getPartialBlockDamage() + { + return this.partialBlockProgress; + } + + /** + * saves the current Cloud update tick into the PartiallyDestroyedBlock + */ + public void setCloudUpdateTick(int p_82744_1_) + { + this.createdAtCloudUpdateTick = p_82744_1_; + } + + /** + * retrieves the 'date' at which the PartiallyDestroyedBlock was created + */ + public int getCreationCloudUpdateTick() + { + return this.createdAtCloudUpdateTick; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntityRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntityRenderer.java new file mode 100644 index 0000000..7b2af9a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntityRenderer.java @@ -0,0 +1,2098 @@ +package net.minecraft.client.renderer; + +import com.google.gson.JsonSyntaxException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.nio.FloatBuffer; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.MapItemRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.particle.EntityRainFX; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.renderer.culling.ClippingHelperImpl; +import net.minecraft.client.renderer.culling.Frustrum; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.client.shader.ShaderLinkHelper; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MouseFilter; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.util.glu.Project; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IRenderHandler; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.common.MinecraftForge; + +@SideOnly(Side.CLIENT) +public class EntityRenderer implements IResourceManagerReloadListener +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; + /** Anaglyph field (0=R, 1=GB) */ + public static int anaglyphField; + /** A reference to the Minecraft object. */ + private Minecraft mc; + private float farPlaneDistance; + public final ItemRenderer itemRenderer; + private final MapItemRenderer theMapItemRenderer; + /** Entity renderer update count */ + private int rendererUpdateCount; + /** Pointed entity */ + private Entity pointedEntity; + private MouseFilter mouseFilterXAxis = new MouseFilter(); + private MouseFilter mouseFilterYAxis = new MouseFilter(); + /** Mouse filter dummy 1 */ + private MouseFilter mouseFilterDummy1 = new MouseFilter(); + /** Mouse filter dummy 2 */ + private MouseFilter mouseFilterDummy2 = new MouseFilter(); + /** Mouse filter dummy 3 */ + private MouseFilter mouseFilterDummy3 = new MouseFilter(); + /** Mouse filter dummy 4 */ + private MouseFilter mouseFilterDummy4 = new MouseFilter(); + private float thirdPersonDistance = 4.0F; + /** Third person distance temp */ + private float thirdPersonDistanceTemp = 4.0F; + private float debugCamYaw; + private float prevDebugCamYaw; + private float debugCamPitch; + private float prevDebugCamPitch; + /** Smooth cam yaw */ + private float smoothCamYaw; + /** Smooth cam pitch */ + private float smoothCamPitch; + /** Smooth cam filter X */ + private float smoothCamFilterX; + /** Smooth cam filter Y */ + private float smoothCamFilterY; + /** Smooth cam partial ticks */ + private float smoothCamPartialTicks; + private float debugCamFOV; + private float prevDebugCamFOV; + private float camRoll; + private float prevCamRoll; + /** The texture id of the blocklight/skylight texture used for lighting effects */ + private final DynamicTexture lightmapTexture; + /** Colors computed in updateLightmap() and loaded into the lightmap emptyTexture */ + private final int[] lightmapColors; + private final ResourceLocation locationLightMap; + /** FOV modifier hand */ + private float fovModifierHand; + /** FOV modifier hand prev */ + private float fovModifierHandPrev; + /** FOV multiplier temp */ + private float fovMultiplierTemp; + private float bossColorModifier; + private float bossColorModifierPrev; + /** Cloud fog mode */ + private boolean cloudFog; + private final IResourceManager resourceManager; + public ShaderGroup theShaderGroup; + private static final ResourceLocation[] shaderResourceLocations = new ResourceLocation[] {new ResourceLocation("shaders/post/notch.json"), new ResourceLocation("shaders/post/fxaa.json"), new ResourceLocation("shaders/post/art.json"), new ResourceLocation("shaders/post/bumpy.json"), new ResourceLocation("shaders/post/blobs2.json"), new ResourceLocation("shaders/post/pencil.json"), new ResourceLocation("shaders/post/color_convolve.json"), new ResourceLocation("shaders/post/deconverge.json"), new ResourceLocation("shaders/post/flip.json"), new ResourceLocation("shaders/post/invert.json"), new ResourceLocation("shaders/post/ntsc.json"), new ResourceLocation("shaders/post/outline.json"), new ResourceLocation("shaders/post/phosphor.json"), new ResourceLocation("shaders/post/scan_pincushion.json"), new ResourceLocation("shaders/post/sobel.json"), new ResourceLocation("shaders/post/bits.json"), new ResourceLocation("shaders/post/desaturate.json"), new ResourceLocation("shaders/post/green.json"), new ResourceLocation("shaders/post/blur.json"), new ResourceLocation("shaders/post/wobble.json"), new ResourceLocation("shaders/post/blobs.json"), new ResourceLocation("shaders/post/antialias.json")}; + public static final int shaderCount = shaderResourceLocations.length; + private int shaderIndex; + private double cameraZoom; + private double cameraYaw; + private double cameraPitch; + /** Previous frame time in milliseconds */ + private long prevFrameTime; + /** End time of last render (ns) */ + private long renderEndNanoTime; + /** Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() */ + private boolean lightmapUpdateNeeded; + /** Torch flicker X */ + float torchFlickerX; + /** Torch flicker DX */ + float torchFlickerDX; + /** Torch flicker Y */ + float torchFlickerY; + /** Torch flicker DY */ + float torchFlickerDY; + private Random random; + /** Rain sound counter */ + private int rainSoundCounter; + /** Rain X coords */ + float[] rainXCoords; + /** Rain Y coords */ + float[] rainYCoords; + /** Fog color buffer */ + FloatBuffer fogColorBuffer; + /** red component of the fog color */ + float fogColorRed; + /** green component of the fog color */ + float fogColorGreen; + /** blue component of the fog color */ + float fogColorBlue; + /** Fog color 2 */ + private float fogColor2; + /** Fog color 1 */ + private float fogColor1; + /** Debug view direction (0=OFF, 1=Front, 2=Right, 3=Back, 4=Left, 5=TiltLeft, 6=TiltRight) */ + public int debugViewDirection; + private static final String __OBFID = "CL_00000947"; + + public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_) + { + this.shaderIndex = shaderCount; + this.cameraZoom = 1.0D; + this.prevFrameTime = Minecraft.getSystemTime(); + this.random = new Random(); + this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); + this.mc = p_i45076_1_; + this.resourceManager = p_i45076_2_; + this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager()); + this.itemRenderer = new ItemRenderer(p_i45076_1_); + this.lightmapTexture = new DynamicTexture(16, 16); + this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); + this.lightmapColors = this.lightmapTexture.getTextureData(); + this.theShaderGroup = null; + } + + public boolean isShaderActive() + { + return OpenGlHelper.shadersSupported && this.theShaderGroup != null; + } + + public void deactivateShader() + { + if (this.theShaderGroup != null) + { + this.theShaderGroup.deleteShaderGroup(); + } + + this.theShaderGroup = null; + this.shaderIndex = shaderCount; + } + + public void activateNextShader() + { + if (OpenGlHelper.shadersSupported) + { + if (this.theShaderGroup != null) + { + this.theShaderGroup.deleteShaderGroup(); + } + + this.shaderIndex = (this.shaderIndex + 1) % (shaderResourceLocations.length + 1); + + if (this.shaderIndex != shaderCount) + { + try + { + logger.info("Selecting effect " + shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), this.resourceManager, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } + catch (IOException ioexception) + { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], ioexception); + this.shaderIndex = shaderCount; + } + catch (JsonSyntaxException jsonsyntaxexception) + { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], jsonsyntaxexception); + this.shaderIndex = shaderCount; + } + } + else + { + this.theShaderGroup = null; + logger.info("No effect selected"); + } + } + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + if (this.theShaderGroup != null) + { + this.theShaderGroup.deleteShaderGroup(); + } + + if (this.shaderIndex != shaderCount) + { + try + { + this.theShaderGroup = new ShaderGroup(this.mc.getTextureManager(), p_110549_1_, this.mc.getFramebuffer(), shaderResourceLocations[this.shaderIndex]); + this.theShaderGroup.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); + } + catch (IOException ioexception) + { + logger.warn("Failed to load shader: " + shaderResourceLocations[this.shaderIndex], ioexception); + this.shaderIndex = shaderCount; + } + } + } + + /** + * Updates the entity renderer + */ + public void updateRenderer() + { + if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) + { + ShaderLinkHelper.setNewStaticShaderLinkHelper(); + } + + this.updateFovModifierHand(); + this.updateTorchFlicker(); + this.fogColor2 = this.fogColor1; + this.thirdPersonDistanceTemp = this.thirdPersonDistance; + this.prevDebugCamYaw = this.debugCamYaw; + this.prevDebugCamPitch = this.debugCamPitch; + this.prevDebugCamFOV = this.debugCamFOV; + this.prevCamRoll = this.camRoll; + float f; + float f1; + + if (this.mc.gameSettings.smoothCamera) + { + f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + f1 = f * f * f * 8.0F; + this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); + this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); + this.smoothCamPartialTicks = 0.0F; + this.smoothCamYaw = 0.0F; + this.smoothCamPitch = 0.0F; + } + + if (this.mc.renderViewEntity == null) + { + this.mc.renderViewEntity = this.mc.thePlayer; + } + + f = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ)); + f1 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; + float f2 = f * (1.0F - f1) + f1; + this.fogColor1 += (f2 - this.fogColor1) * 0.1F; + ++this.rendererUpdateCount; + this.itemRenderer.updateEquippedItem(); + this.addRainParticles(); + this.bossColorModifierPrev = this.bossColorModifier; + + if (BossStatus.hasColorModifier) + { + this.bossColorModifier += 0.05F; + + if (this.bossColorModifier > 1.0F) + { + this.bossColorModifier = 1.0F; + } + + BossStatus.hasColorModifier = false; + } + else if (this.bossColorModifier > 0.0F) + { + this.bossColorModifier -= 0.0125F; + } + } + + public ShaderGroup getShaderGroup() + { + return this.theShaderGroup; + } + + public void updateShaderGroupSize(int p_147704_1_, int p_147704_2_) + { + if (OpenGlHelper.shadersSupported) + { + if (this.theShaderGroup != null) + { + this.theShaderGroup.createBindFramebuffers(p_147704_1_, p_147704_2_); + } + } + } + + /** + * Finds what block or object the mouse is over at the specified partial tick time. Args: partialTickTime + */ + public void getMouseOver(float p_78473_1_) + { + if (this.mc.renderViewEntity != null) + { + if (this.mc.theWorld != null) + { + this.mc.pointedEntity = null; + double d0 = (double)this.mc.playerController.getBlockReachDistance(); + this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(d0, p_78473_1_); + double d1 = d0; + Vec3 vec3 = this.mc.renderViewEntity.getPosition(p_78473_1_); + + if (this.mc.playerController.extendedReach()) + { + d0 = 6.0D; + d1 = 6.0D; + } + else + { + if (d0 > 3.0D) + { + d1 = 3.0D; + } + + d0 = d1; + } + + if (this.mc.objectMouseOver != null) + { + d1 = this.mc.objectMouseOver.hitVec.distanceTo(vec3); + } + + Vec3 vec31 = this.mc.renderViewEntity.getLook(p_78473_1_); + Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0); + this.pointedEntity = null; + Vec3 vec33 = null; + float f1 = 1.0F; + List list = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand((double)f1, (double)f1, (double)f1)); + double d2 = d1; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (entity.canBeCollidedWith()) + { + float f2 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f2, (double)f2, (double)f2); + MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); + + if (axisalignedbb.isVecInside(vec3)) + { + if (0.0D < d2 || d2 == 0.0D) + { + this.pointedEntity = entity; + vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec; + d2 = 0.0D; + } + } + else if (movingobjectposition != null) + { + double d3 = vec3.distanceTo(movingobjectposition.hitVec); + + if (d3 < d2 || d2 == 0.0D) + { + if (entity == this.mc.renderViewEntity.ridingEntity && !entity.canRiderInteract()) + { + if (d2 == 0.0D) + { + this.pointedEntity = entity; + vec33 = movingobjectposition.hitVec; + } + } + else + { + this.pointedEntity = entity; + vec33 = movingobjectposition.hitVec; + d2 = d3; + } + } + } + } + } + + if (this.pointedEntity != null && (d2 < d1 || this.mc.objectMouseOver == null)) + { + this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity, vec33); + + if (this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) + { + this.mc.pointedEntity = this.pointedEntity; + } + } + } + } + } + + /** + * Update FOV modifier hand + */ + private void updateFovModifierHand() + { + if (mc.renderViewEntity instanceof EntityPlayerSP) + { + EntityPlayerSP entityplayersp = (EntityPlayerSP)this.mc.renderViewEntity; + this.fovMultiplierTemp = entityplayersp.getFOVMultiplier(); + } + else + { + this.fovMultiplierTemp = mc.thePlayer.getFOVMultiplier(); + } + this.fovModifierHandPrev = this.fovModifierHand; + this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; + + if (this.fovModifierHand > 1.5F) + { + this.fovModifierHand = 1.5F; + } + + if (this.fovModifierHand < 0.1F) + { + this.fovModifierHand = 0.1F; + } + } + + /** + * Changes the field of view of the player depending on if they are underwater or not + */ + private float getFOVModifier(float p_78481_1_, boolean p_78481_2_) + { + if (this.debugViewDirection > 0) + { + return 90.0F; + } + else + { + EntityLivingBase entityplayer = (EntityLivingBase)this.mc.renderViewEntity; + float f1 = 70.0F; + + if (p_78481_2_) + { + f1 = this.mc.gameSettings.fovSetting; + f1 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * p_78481_1_; + } + + if (entityplayer.getHealth() <= 0.0F) + { + float f2 = (float)entityplayer.deathTime + p_78481_1_; + f1 /= (1.0F - 500.0F / (f2 + 500.0F)) * 2.0F + 1.0F; + } + + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entityplayer, p_78481_1_); + + if (block.getMaterial() == Material.water) + { + f1 = f1 * 60.0F / 70.0F; + } + + return f1 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * p_78481_1_; + } + } + + private void hurtCameraEffect(float p_78482_1_) + { + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + float f1 = (float)entitylivingbase.hurtTime - p_78482_1_; + float f2; + + if (entitylivingbase.getHealth() <= 0.0F) + { + f2 = (float)entitylivingbase.deathTime + p_78482_1_; + GL11.glRotatef(40.0F - 8000.0F / (f2 + 200.0F), 0.0F, 0.0F, 1.0F); + } + + if (f1 >= 0.0F) + { + f1 /= (float)entitylivingbase.maxHurtTime; + f1 = MathHelper.sin(f1 * f1 * f1 * f1 * (float)Math.PI); + f2 = entitylivingbase.attackedAtYaw; + GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f1 * 14.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(f2, 0.0F, 1.0F, 0.0F); + } + } + + /** + * Setups all the GL settings for view bobbing. Args: partialTickTime + */ + private void setupViewBobbing(float p_78475_1_) + { + if (this.mc.renderViewEntity instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)this.mc.renderViewEntity; + float f1 = entityplayer.distanceWalkedModified - entityplayer.prevDistanceWalkedModified; + float f2 = -(entityplayer.distanceWalkedModified + f1 * p_78475_1_); + float f3 = entityplayer.prevCameraYaw + (entityplayer.cameraYaw - entityplayer.prevCameraYaw) * p_78475_1_; + float f4 = entityplayer.prevCameraPitch + (entityplayer.cameraPitch - entityplayer.prevCameraPitch) * p_78475_1_; + GL11.glTranslatef(MathHelper.sin(f2 * (float)Math.PI) * f3 * 0.5F, -Math.abs(MathHelper.cos(f2 * (float)Math.PI) * f3), 0.0F); + GL11.glRotatef(MathHelper.sin(f2 * (float)Math.PI) * f3 * 3.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(Math.abs(MathHelper.cos(f2 * (float)Math.PI - 0.2F) * f3) * 5.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(f4, 1.0F, 0.0F, 0.0F); + } + } + + /** + * sets up player's eye (or camera in third person mode) + */ + private void orientCamera(float p_78467_1_) + { + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + float f1 = entitylivingbase.yOffset - 1.62F; + double d0 = entitylivingbase.prevPosX + (entitylivingbase.posX - entitylivingbase.prevPosX) * (double)p_78467_1_; + double d1 = entitylivingbase.prevPosY + (entitylivingbase.posY - entitylivingbase.prevPosY) * (double)p_78467_1_ - (double)f1; + double d2 = entitylivingbase.prevPosZ + (entitylivingbase.posZ - entitylivingbase.prevPosZ) * (double)p_78467_1_; + GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * p_78467_1_, 0.0F, 0.0F, 1.0F); + + if (entitylivingbase.isPlayerSleeping()) + { + f1 = (float)((double)f1 + 1.0D); + GL11.glTranslatef(0.0F, 0.3F, 0.0F); + + if (!this.mc.gameSettings.debugCamEnable) + { + ForgeHooksClient.orientBedCamera(mc, entitylivingbase); + GL11.glRotatef(entitylivingbase.prevRotationYaw + (entitylivingbase.rotationYaw - entitylivingbase.prevRotationYaw) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GL11.glRotatef(entitylivingbase.prevRotationPitch + (entitylivingbase.rotationPitch - entitylivingbase.prevRotationPitch) * p_78467_1_, -1.0F, 0.0F, 0.0F); + } + } + else if (this.mc.gameSettings.thirdPersonView > 0) + { + double d7 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * p_78467_1_); + float f2; + float f6; + + if (this.mc.gameSettings.debugCamEnable) + { + f6 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * p_78467_1_; + f2 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * p_78467_1_; + GL11.glTranslatef(0.0F, 0.0F, (float)(-d7)); + GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(f6, 0.0F, 1.0F, 0.0F); + } + else + { + f6 = entitylivingbase.rotationYaw; + f2 = entitylivingbase.rotationPitch; + + if (this.mc.gameSettings.thirdPersonView == 2) + { + f2 += 180.0F; + } + + double d3 = (double)(-MathHelper.sin(f6 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d7; + double d4 = (double)(MathHelper.cos(f6 / 180.0F * (float)Math.PI) * MathHelper.cos(f2 / 180.0F * (float)Math.PI)) * d7; + double d5 = (double)(-MathHelper.sin(f2 / 180.0F * (float)Math.PI)) * d7; + + for (int k = 0; k < 8; ++k) + { + float f3 = (float)((k & 1) * 2 - 1); + float f4 = (float)((k >> 1 & 1) * 2 - 1); + float f5 = (float)((k >> 2 & 1) * 2 - 1); + f3 *= 0.1F; + f4 *= 0.1F; + f5 *= 0.1F; + MovingObjectPosition movingobjectposition = this.mc.theWorld.rayTraceBlocks(Vec3.createVectorHelper(d0 + (double)f3, d1 + (double)f4, d2 + (double)f5), Vec3.createVectorHelper(d0 - d3 + (double)f3 + (double)f5, d1 - d5 + (double)f4, d2 - d4 + (double)f5)); + + if (movingobjectposition != null) + { + double d6 = movingobjectposition.hitVec.distanceTo(Vec3.createVectorHelper(d0, d1, d2)); + + if (d6 < d7) + { + d7 = d6; + } + } + } + + if (this.mc.gameSettings.thirdPersonView == 2) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + GL11.glRotatef(entitylivingbase.rotationPitch - f2, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(entitylivingbase.rotationYaw - f6, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, (float)(-d7)); + GL11.glRotatef(f6 - entitylivingbase.rotationYaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f2 - entitylivingbase.rotationPitch, 1.0F, 0.0F, 0.0F); + } + } + else + { + GL11.glTranslatef(0.0F, 0.0F, -0.1F); + } + + if (!this.mc.gameSettings.debugCamEnable) + { + GL11.glRotatef(entitylivingbase.prevRotationPitch + (entitylivingbase.rotationPitch - entitylivingbase.prevRotationPitch) * p_78467_1_, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(entitylivingbase.prevRotationYaw + (entitylivingbase.rotationYaw - entitylivingbase.prevRotationYaw) * p_78467_1_ + 180.0F, 0.0F, 1.0F, 0.0F); + } + + GL11.glTranslatef(0.0F, f1, 0.0F); + d0 = entitylivingbase.prevPosX + (entitylivingbase.posX - entitylivingbase.prevPosX) * (double)p_78467_1_; + d1 = entitylivingbase.prevPosY + (entitylivingbase.posY - entitylivingbase.prevPosY) * (double)p_78467_1_ - (double)f1; + d2 = entitylivingbase.prevPosZ + (entitylivingbase.posZ - entitylivingbase.prevPosZ) * (double)p_78467_1_; + this.cloudFog = this.mc.renderGlobal.hasCloudFog(d0, d1, d2, p_78467_1_); + } + + /** + * sets up projection, view effects, camera position/rotation + */ + private void setupCameraTransform(float p_78479_1_, int p_78479_2_) + { + this.farPlaneDistance = (float)(this.mc.gameSettings.renderDistanceChunks * 16); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float f1 = 0.07F; + + if (this.mc.gameSettings.anaglyph) + { + GL11.glTranslatef((float)(-(p_78479_2_ * 2 - 1)) * f1, 0.0F, 0.0F); + } + + if (this.cameraZoom != 1.0D) + { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + + Project.gluPerspective(this.getFOVModifier(p_78479_1_, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + float f2; + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + f2 = 0.6666667F; + GL11.glScalef(1.0F, f2, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GL11.glTranslatef((float)(p_78479_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + this.hurtCameraEffect(p_78479_1_); + + if (this.mc.gameSettings.viewBobbing) + { + this.setupViewBobbing(p_78479_1_); + } + + f2 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * p_78479_1_; + + if (f2 > 0.0F) + { + byte b0 = 20; + + if (this.mc.thePlayer.isPotionActive(Potion.confusion)) + { + b0 = 7; + } + + float f3 = 5.0F / (f2 * f2 + 5.0F) - f2 * 0.04F; + f3 *= f3; + GL11.glRotatef(((float)this.rendererUpdateCount + p_78479_1_) * (float)b0, 0.0F, 1.0F, 1.0F); + GL11.glScalef(1.0F / f3, 1.0F, 1.0F); + GL11.glRotatef(-((float)this.rendererUpdateCount + p_78479_1_) * (float)b0, 0.0F, 1.0F, 1.0F); + } + + this.orientCamera(p_78479_1_); + + if (this.debugViewDirection > 0) + { + int j = this.debugViewDirection - 1; + + if (j == 1) + { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } + + if (j == 2) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (j == 3) + { + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if (j == 4) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (j == 5) + { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + } + } + + /** + * Render player hand + */ + private void renderHand(float p_78476_1_, int p_78476_2_) + { + if (this.debugViewDirection <= 0) + { + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float f1 = 0.07F; + + if (this.mc.gameSettings.anaglyph) + { + GL11.glTranslatef((float)(-(p_78476_2_ * 2 - 1)) * f1, 0.0F, 0.0F); + } + + if (this.cameraZoom != 1.0D) + { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + + Project.gluPerspective(this.getFOVModifier(p_78476_1_, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + float f2 = 0.6666667F; + GL11.glScalef(1.0F, f2, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + + if (this.mc.gameSettings.anaglyph) + { + GL11.glTranslatef((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + GL11.glPushMatrix(); + this.hurtCameraEffect(p_78476_1_); + + if (this.mc.gameSettings.viewBobbing) + { + this.setupViewBobbing(p_78476_1_); + } + + if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) + { + this.enableLightmap((double)p_78476_1_); + this.itemRenderer.renderItemInFirstPerson(p_78476_1_); + this.disableLightmap((double)p_78476_1_); + } + + GL11.glPopMatrix(); + + if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) + { + this.itemRenderer.renderOverlays(p_78476_1_); + this.hurtCameraEffect(p_78476_1_); + } + + if (this.mc.gameSettings.viewBobbing) + { + this.setupViewBobbing(p_78476_1_); + } + } + } + + /** + * Disable secondary texture unit used by lightmap + */ + public void disableLightmap(double p_78483_1_) + { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + /** + * Enable lightmap in secondary texture unit + */ + public void enableLightmap(double p_78463_1_) + { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f = 0.00390625F; + GL11.glScalef(f, f, f); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.mc.getTextureManager().bindTexture(this.locationLightMap); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + /** + * Recompute a random value that is applied to block color in updateLightmap() + */ + private void updateTorchFlicker() + { + this.torchFlickerDX = (float)((double)this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDY = (float)((double)this.torchFlickerDY + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDX = (float)((double)this.torchFlickerDX * 0.9D); + this.torchFlickerDY = (float)((double)this.torchFlickerDY * 0.9D); + this.torchFlickerX += (this.torchFlickerDX - this.torchFlickerX) * 1.0F; + this.torchFlickerY += (this.torchFlickerDY - this.torchFlickerY) * 1.0F; + this.lightmapUpdateNeeded = true; + } + + private void updateLightmap(float p_78472_1_) + { + WorldClient worldclient = this.mc.theWorld; + + if (worldclient != null) + { + for (int i = 0; i < 256; ++i) + { + float f1 = worldclient.getSunBrightness(1.0F) * 0.95F + 0.05F; + float f2 = worldclient.provider.lightBrightnessTable[i / 16] * f1; + float f3 = worldclient.provider.lightBrightnessTable[i % 16] * (this.torchFlickerX * 0.1F + 1.5F); + + if (worldclient.lastLightningBolt > 0) + { + f2 = worldclient.provider.lightBrightnessTable[i / 16]; + } + + float f4 = f2 * (worldclient.getSunBrightness(1.0F) * 0.65F + 0.35F); + float f5 = f2 * (worldclient.getSunBrightness(1.0F) * 0.65F + 0.35F); + float f6 = f3 * ((f3 * 0.6F + 0.4F) * 0.6F + 0.4F); + float f7 = f3 * (f3 * f3 * 0.6F + 0.4F); + float f8 = f4 + f3; + float f9 = f5 + f6; + float f10 = f2 + f7; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + float f11; + + if (this.bossColorModifier > 0.0F) + { + f11 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * p_78472_1_; + f8 = f8 * (1.0F - f11) + f8 * 0.7F * f11; + f9 = f9 * (1.0F - f11) + f9 * 0.6F * f11; + f10 = f10 * (1.0F - f11) + f10 * 0.6F * f11; + } + + if (worldclient.provider.dimensionId == 1) + { + f8 = 0.22F + f3 * 0.75F; + f9 = 0.28F + f6 * 0.75F; + f10 = 0.25F + f7 * 0.75F; + } + + float f12; + + if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) + { + f11 = this.getNightVisionBrightness(this.mc.thePlayer, p_78472_1_); + f12 = 1.0F / f8; + + if (f12 > 1.0F / f9) + { + f12 = 1.0F / f9; + } + + if (f12 > 1.0F / f10) + { + f12 = 1.0F / f10; + } + + f8 = f8 * (1.0F - f11) + f8 * f12 * f11; + f9 = f9 * (1.0F - f11) + f9 * f12 * f11; + f10 = f10 * (1.0F - f11) + f10 * f12 * f11; + } + + if (f8 > 1.0F) + { + f8 = 1.0F; + } + + if (f9 > 1.0F) + { + f9 = 1.0F; + } + + if (f10 > 1.0F) + { + f10 = 1.0F; + } + + f11 = this.mc.gameSettings.gammaSetting; + f12 = 1.0F - f8; + float f13 = 1.0F - f9; + float f14 = 1.0F - f10; + f12 = 1.0F - f12 * f12 * f12 * f12; + f13 = 1.0F - f13 * f13 * f13 * f13; + f14 = 1.0F - f14 * f14 * f14 * f14; + f8 = f8 * (1.0F - f11) + f12 * f11; + f9 = f9 * (1.0F - f11) + f13 * f11; + f10 = f10 * (1.0F - f11) + f14 * f11; + f8 = f8 * 0.96F + 0.03F; + f9 = f9 * 0.96F + 0.03F; + f10 = f10 * 0.96F + 0.03F; + + if (f8 > 1.0F) + { + f8 = 1.0F; + } + + if (f9 > 1.0F) + { + f9 = 1.0F; + } + + if (f10 > 1.0F) + { + f10 = 1.0F; + } + + if (f8 < 0.0F) + { + f8 = 0.0F; + } + + if (f9 < 0.0F) + { + f9 = 0.0F; + } + + if (f10 < 0.0F) + { + f10 = 0.0F; + } + + short short1 = 255; + int j = (int)(f8 * 255.0F); + int k = (int)(f9 * 255.0F); + int l = (int)(f10 * 255.0F); + this.lightmapColors[i] = short1 << 24 | j << 16 | k << 8 | l; + } + + this.lightmapTexture.updateDynamicTexture(); + this.lightmapUpdateNeeded = false; + } + } + + /** + * Gets the night vision brightness + */ + private float getNightVisionBrightness(EntityPlayer p_82830_1_, float p_82830_2_) + { + int i = p_82830_1_.getActivePotionEffect(Potion.nightVision).getDuration(); + return i > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)i - p_82830_2_) * (float)Math.PI * 0.2F) * 0.3F; + } + + /** + * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI + */ + public void updateCameraAndRender(float p_78480_1_) + { + this.mc.mcProfiler.startSection("lightTex"); + + if (this.lightmapUpdateNeeded) + { + this.updateLightmap(p_78480_1_); + } + + this.mc.mcProfiler.endSection(); + boolean flag = Display.isActive(); + + if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) + { + if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) + { + this.mc.displayInGameMenu(); + } + } + else + { + this.prevFrameTime = Minecraft.getSystemTime(); + } + + this.mc.mcProfiler.startSection("mouse"); + + if (this.mc.inGameHasFocus && flag) + { + this.mc.mouseHelper.mouseXYChange(); + float f1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float f2 = f1 * f1 * f1 * 8.0F; + float f3 = (float)this.mc.mouseHelper.deltaX * f2; + float f4 = (float)this.mc.mouseHelper.deltaY * f2; + byte b0 = 1; + + if (this.mc.gameSettings.invertMouse) + { + b0 = -1; + } + + if (this.mc.gameSettings.smoothCamera) + { + this.smoothCamYaw += f3; + this.smoothCamPitch += f4; + float f5 = p_78480_1_ - this.smoothCamPartialTicks; + this.smoothCamPartialTicks = p_78480_1_; + f3 = this.smoothCamFilterX * f5; + f4 = this.smoothCamFilterY * f5; + this.mc.thePlayer.setAngles(f3, f4 * (float)b0); + } + else + { + this.mc.thePlayer.setAngles(f3, f4 * (float)b0); + } + } + + this.mc.mcProfiler.endSection(); + + if (!this.mc.skipRenderWorld) + { + anaglyphEnable = this.mc.gameSettings.anaglyph; + final ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + final int k = Mouse.getX() * i / this.mc.displayWidth; + final int l = j - Mouse.getY() * j / this.mc.displayHeight - 1; + int i1 = this.mc.gameSettings.limitFramerate; + + if (this.mc.theWorld != null) + { + this.mc.mcProfiler.startSection("level"); + + if (this.mc.isFramerateLimitBelowMax()) + { + this.renderWorld(p_78480_1_, this.renderEndNanoTime + (long)(1000000000 / i1)); + } + else + { + this.renderWorld(p_78480_1_, 0L); + } + + if (OpenGlHelper.shadersSupported) + { + if (this.theShaderGroup != null) + { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + this.theShaderGroup.loadShaderGroup(p_78480_1_); + GL11.glPopMatrix(); + } + + this.mc.getFramebuffer().bindFramebuffer(true); + } + + this.renderEndNanoTime = System.nanoTime(); + this.mc.mcProfiler.endStartSection("gui"); + + if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + this.mc.ingameGUI.renderGameOverlay(p_78480_1_, this.mc.currentScreen != null, k, l); + } + + this.mc.mcProfiler.endSection(); + } + else + { + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + this.setupOverlayRendering(); + this.renderEndNanoTime = System.nanoTime(); + } + + if (this.mc.currentScreen != null) + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + + try + { + if (!MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Pre(this.mc.currentScreen, k, l, p_78480_1_))) + this.mc.currentScreen.drawScreen(k, l, p_78480_1_); + MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Post(this.mc.currentScreen, k, l, p_78480_1_)); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details"); + crashreportcategory.addCrashSectionCallable("Screen name", new Callable() + { + private static final String __OBFID = "CL_00000948"; + public String call() + { + return EntityRenderer.this.mc.currentScreen.getClass().getCanonicalName(); + } + }); + crashreportcategory.addCrashSectionCallable("Mouse location", new Callable() + { + private static final String __OBFID = "CL_00000950"; + public String call() + { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(k), Integer.valueOf(l), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); + } + }); + crashreportcategory.addCrashSectionCallable("Screen size", new Callable() + { + private static final String __OBFID = "CL_00000951"; + public String call() + { + return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(scaledresolution.getScaledWidth()), Integer.valueOf(scaledresolution.getScaledHeight()), Integer.valueOf(EntityRenderer.this.mc.displayWidth), Integer.valueOf(EntityRenderer.this.mc.displayHeight), Integer.valueOf(scaledresolution.getScaleFactor())}); + } + }); + throw new ReportedException(crashreport); + } + } + } + } + + public void func_152430_c(float p_152430_1_) + { + this.setupOverlayRendering(); + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + int i = scaledresolution.getScaledWidth(); + int j = scaledresolution.getScaledHeight(); + this.mc.ingameGUI.func_152126_a((float)i, (float)j); + } + + public void renderWorld(float p_78471_1_, long p_78471_2_) + { + this.mc.mcProfiler.startSection("lightTex"); + + if (this.lightmapUpdateNeeded) + { + this.updateLightmap(p_78471_1_); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); + + if (this.mc.renderViewEntity == null) + { + this.mc.renderViewEntity = this.mc.thePlayer; + } + + this.mc.mcProfiler.endStartSection("pick"); + this.getMouseOver(p_78471_1_); + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + RenderGlobal renderglobal = this.mc.renderGlobal; + EffectRenderer effectrenderer = this.mc.effectRenderer; + double d0 = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)p_78471_1_; + double d1 = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)p_78471_1_; + double d2 = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)p_78471_1_; + this.mc.mcProfiler.endStartSection("center"); + + for (int j = 0; j < 2; ++j) + { + if (this.mc.gameSettings.anaglyph) + { + anaglyphField = j; + + if (anaglyphField == 0) + { + GL11.glColorMask(false, true, true, false); + } + else + { + GL11.glColorMask(true, false, false, false); + } + } + + this.mc.mcProfiler.endStartSection("clear"); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + this.updateFogColor(p_78471_1_); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + this.mc.mcProfiler.endStartSection("camera"); + this.setupCameraTransform(p_78471_1_, j); + ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); + this.mc.mcProfiler.endStartSection("frustrum"); + ClippingHelperImpl.getInstance(); + + if (this.mc.gameSettings.renderDistanceChunks >= 4) + { + this.setupFog(-1, p_78471_1_); + this.mc.mcProfiler.endStartSection("sky"); + renderglobal.renderSky(p_78471_1_); + } + + GL11.glEnable(GL11.GL_FOG); + this.setupFog(1, p_78471_1_); + + if (this.mc.gameSettings.ambientOcclusion != 0) + { + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + this.mc.mcProfiler.endStartSection("culling"); + Frustrum frustrum = new Frustrum(); + frustrum.setPosition(d0, d1, d2); + this.mc.renderGlobal.clipRenderersByFrustum(frustrum, p_78471_1_); + + if (j == 0) + { + this.mc.mcProfiler.endStartSection("updatechunks"); + + while (!this.mc.renderGlobal.updateRenderers(entitylivingbase, false) && p_78471_2_ != 0L) + { + long k = p_78471_2_ - System.nanoTime(); + + if (k < 0L || k > 1000000000L) + { + break; + } + } + } + + if (entitylivingbase.posY < 128.0D) + { + this.renderCloudsCheck(renderglobal, p_78471_1_); + } + + this.mc.mcProfiler.endStartSection("prepareterrain"); + this.setupFog(0, p_78471_1_); + GL11.glEnable(GL11.GL_FOG); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("terrain"); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + renderglobal.sortAndRender(entitylivingbase, 0, (double)p_78471_1_); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + EntityPlayer entityplayer; + + if (this.debugViewDirection == 0) + { + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + renderglobal.renderEntities(entitylivingbase, frustrum, p_78471_1_); + net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + //ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water} + RenderHelper.disableStandardItemLighting(); + this.disableLightmap((double)p_78471_1_); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + + if (this.mc.objectMouseOver != null && entitylivingbase.isInsideOfMaterial(Material.water) && entitylivingbase instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) + { + entityplayer = (EntityPlayer)entitylivingbase; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); + if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), p_78471_1_)) + { + renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, p_78471_1_); + } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + + if (this.cameraZoom == 1.0D && entitylivingbase instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !entitylivingbase.isInsideOfMaterial(Material.water)) + { + entityplayer = (EntityPlayer)entitylivingbase; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); + if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), p_78471_1_)) + { + renderglobal.drawSelectionBox(entityplayer, this.mc.objectMouseOver, 0, p_78471_1_); + } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + this.mc.mcProfiler.endStartSection("destroyProgress"); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + renderglobal.drawBlockDamageTexture(Tessellator.instance, entitylivingbase, p_78471_1_); + GL11.glDisable(GL11.GL_BLEND); + + if (this.debugViewDirection == 0) + { + this.enableLightmap((double)p_78471_1_); + this.mc.mcProfiler.endStartSection("litParticles"); + effectrenderer.renderLitParticles(entitylivingbase, p_78471_1_); + RenderHelper.disableStandardItemLighting(); + this.setupFog(0, p_78471_1_); + this.mc.mcProfiler.endStartSection("particles"); + effectrenderer.renderParticles(entitylivingbase, p_78471_1_); + this.disableLightmap((double)p_78471_1_); + } + + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_CULL_FACE); + this.mc.mcProfiler.endStartSection("weather"); + this.renderRainSnow(p_78471_1_); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + this.setupFog(0, p_78471_1_); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDepthMask(false); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + + if (this.mc.gameSettings.fancyGraphics) + { + this.mc.mcProfiler.endStartSection("water"); + + if (this.mc.gameSettings.ambientOcclusion != 0) + { + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + + if (this.mc.gameSettings.anaglyph) + { + if (anaglyphField == 0) + { + GL11.glColorMask(false, true, true, true); + } + else + { + GL11.glColorMask(true, false, false, true); + } + + renderglobal.sortAndRender(entitylivingbase, 1, (double)p_78471_1_); + } + else + { + renderglobal.sortAndRender(entitylivingbase, 1, (double)p_78471_1_); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glShadeModel(GL11.GL_FLAT); + } + else + { + this.mc.mcProfiler.endStartSection("water"); + renderglobal.sortAndRender(entitylivingbase, 1, (double)p_78471_1_); + } + + if (this.debugViewDirection == 0) //Only render if render pass 0 happens as well. + { + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); + ForgeHooksClient.setRenderPass(1); + renderglobal.renderEntities(entitylivingbase, frustrum, p_78471_1_); + ForgeHooksClient.setRenderPass(-1); + RenderHelper.disableStandardItemLighting(); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_FOG); + + if (entitylivingbase.posY >= 128.0D) + { + this.mc.mcProfiler.endStartSection("aboveClouds"); + this.renderCloudsCheck(renderglobal, p_78471_1_); + } + + this.mc.mcProfiler.endStartSection("FRenderLast"); + ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_); + + this.mc.mcProfiler.endStartSection("hand"); + + if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.cameraZoom == 1.0D) + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + this.renderHand(p_78471_1_, j); + } + + if (!this.mc.gameSettings.anaglyph) + { + this.mc.mcProfiler.endSection(); + return; + } + } + + GL11.glColorMask(true, true, true, false); + this.mc.mcProfiler.endSection(); + } + + /** + * Render clouds if enabled + */ + private void renderCloudsCheck(RenderGlobal p_82829_1_, float p_82829_2_) + { + if (this.mc.gameSettings.shouldRenderClouds()) + { + this.mc.mcProfiler.endStartSection("clouds"); + GL11.glPushMatrix(); + this.setupFog(0, p_82829_2_); + GL11.glEnable(GL11.GL_FOG); + p_82829_1_.renderClouds(p_82829_2_); + GL11.glDisable(GL11.GL_FOG); + this.setupFog(1, p_82829_2_); + GL11.glPopMatrix(); + } + } + + private void addRainParticles() + { + float f = this.mc.theWorld.getRainStrength(1.0F); + + if (!this.mc.gameSettings.fancyGraphics) + { + f /= 2.0F; + } + + if (f != 0.0F) + { + this.random.setSeed((long)this.rendererUpdateCount * 312987231L); + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + WorldClient worldclient = this.mc.theWorld; + int i = MathHelper.floor_double(entitylivingbase.posX); + int j = MathHelper.floor_double(entitylivingbase.posY); + int k = MathHelper.floor_double(entitylivingbase.posZ); + byte b0 = 10; + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + int l = 0; + int i1 = (int)(100.0F * f * f); + + if (this.mc.gameSettings.particleSetting == 1) + { + i1 >>= 1; + } + else if (this.mc.gameSettings.particleSetting == 2) + { + i1 = 0; + } + + for (int j1 = 0; j1 < i1; ++j1) + { + int k1 = i + this.random.nextInt(b0) - this.random.nextInt(b0); + int l1 = k + this.random.nextInt(b0) - this.random.nextInt(b0); + int i2 = worldclient.getPrecipitationHeight(k1, l1); + Block block = worldclient.getBlock(k1, i2 - 1, l1); + BiomeGenBase biomegenbase = worldclient.getBiomeGenForCoords(k1, l1); + + if (i2 <= j + b0 && i2 >= j - b0 && biomegenbase.canSpawnLightningBolt() && biomegenbase.getFloatTemperature(k1, i2, l1) >= 0.15F) + { + float f1 = this.random.nextFloat(); + float f2 = this.random.nextFloat(); + + if (block.getMaterial() == Material.lava) + { + this.mc.effectRenderer.addEffect(new EntitySmokeFX(worldclient, (double)((float)k1 + f1), (double)((float)i2 + 0.1F) - block.getBlockBoundsMinY(), (double)((float)l1 + f2), 0.0D, 0.0D, 0.0D)); + } + else if (block.getMaterial() != Material.air) + { + ++l; + + if (this.random.nextInt(l) == 0) + { + d0 = (double)((float)k1 + f1); + d1 = (double)((float)i2 + 0.1F) - block.getBlockBoundsMinY(); + d2 = (double)((float)l1 + f2); + } + + this.mc.effectRenderer.addEffect(new EntityRainFX(worldclient, (double)((float)k1 + f1), (double)((float)i2 + 0.1F) - block.getBlockBoundsMinY(), (double)((float)l1 + f2))); + } + } + } + + if (l > 0 && this.random.nextInt(3) < this.rainSoundCounter++) + { + this.rainSoundCounter = 0; + + if (d1 > entitylivingbase.posY + 1.0D && worldclient.getPrecipitationHeight(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posZ)) > MathHelper.floor_double(entitylivingbase.posY)) + { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.1F, 0.5F, false); + } + else + { + this.mc.theWorld.playSound(d0, d1, d2, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } + } + } + + /** + * Render rain and snow + */ + protected void renderRainSnow(float p_78474_1_) + { + IRenderHandler renderer = null; + if ((renderer = this.mc.theWorld.provider.getWeatherRenderer()) != null) + { + renderer.render(p_78474_1_, this.mc.theWorld, mc); + return; + } + + float f1 = this.mc.theWorld.getRainStrength(p_78474_1_); + + if (f1 > 0.0F) + { + this.enableLightmap((double)p_78474_1_); + + if (this.rainXCoords == null) + { + this.rainXCoords = new float[1024]; + this.rainYCoords = new float[1024]; + + for (int i = 0; i < 32; ++i) + { + for (int j = 0; j < 32; ++j) + { + float f2 = (float)(j - 16); + float f3 = (float)(i - 16); + float f4 = MathHelper.sqrt_float(f2 * f2 + f3 * f3); + this.rainXCoords[i << 5 | j] = -f3 / f4; + this.rainYCoords[i << 5 | j] = f2 / f4; + } + } + } + + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + WorldClient worldclient = this.mc.theWorld; + int k2 = MathHelper.floor_double(entitylivingbase.posX); + int l2 = MathHelper.floor_double(entitylivingbase.posY); + int i3 = MathHelper.floor_double(entitylivingbase.posZ); + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + double d0 = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * (double)p_78474_1_; + double d1 = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)p_78474_1_; + double d2 = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)p_78474_1_; + int k = MathHelper.floor_double(d1); + byte b0 = 5; + + if (this.mc.gameSettings.fancyGraphics) + { + b0 = 10; + } + + boolean flag = false; + byte b1 = -1; + float f5 = (float)this.rendererUpdateCount + p_78474_1_; + + if (this.mc.gameSettings.fancyGraphics) + { + b0 = 10; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + flag = false; + + for (int l = i3 - b0; l <= i3 + b0; ++l) + { + for (int i1 = k2 - b0; i1 <= k2 + b0; ++i1) + { + int j1 = (l - i3 + 16) * 32 + i1 - k2 + 16; + float f6 = this.rainXCoords[j1] * 0.5F; + float f7 = this.rainYCoords[j1] * 0.5F; + BiomeGenBase biomegenbase = worldclient.getBiomeGenForCoords(i1, l); + + if (biomegenbase.canSpawnLightningBolt() || biomegenbase.getEnableSnow()) + { + int k1 = worldclient.getPrecipitationHeight(i1, l); + int l1 = l2 - b0; + int i2 = l2 + b0; + + if (l1 < k1) + { + l1 = k1; + } + + if (i2 < k1) + { + i2 = k1; + } + + float f8 = 1.0F; + int j2 = k1; + + if (k1 < k) + { + j2 = k; + } + + if (l1 != i2) + { + this.random.setSeed((long)(i1 * i1 * 3121 + i1 * 45238971 ^ l * l * 418711 + l * 13761)); + float f9 = biomegenbase.getFloatTemperature(i1, l1, l); + float f10; + double d4; + + if (worldclient.getWorldChunkManager().getTemperatureAtHeight(f9, k1) >= 0.15F) + { + if (b1 != 0) + { + if (b1 >= 0) + { + tessellator.draw(); + } + + b1 = 0; + this.mc.getTextureManager().bindTexture(locationRainPng); + tessellator.startDrawingQuads(); + } + + f10 = ((float)(this.rendererUpdateCount + i1 * i1 * 3121 + i1 * 45238971 + l * l * 418711 + l * 13761 & 31) + p_78474_1_) / 32.0F * (3.0F + this.random.nextFloat()); + double d3 = (double)((float)i1 + 0.5F) - entitylivingbase.posX; + d4 = (double)((float)l + 0.5F) - entitylivingbase.posZ; + float f12 = MathHelper.sqrt_double(d3 * d3 + d4 * d4) / (float)b0; + float f13 = 1.0F; + tessellator.setBrightness(worldclient.getLightBrightnessForSkyBlocks(i1, j2, l, 0)); + tessellator.setColorRGBA_F(f13, f13, f13, ((1.0F - f12 * f12) * 0.5F + 0.5F) * f1); + tessellator.setTranslation(-d0 * 1.0D, -d1 * 1.0D, -d2 * 1.0D); + tessellator.addVertexWithUV((double)((float)i1 - f6) + 0.5D, (double)l1, (double)((float)l - f7) + 0.5D, (double)(0.0F * f8), (double)((float)l1 * f8 / 4.0F + f10 * f8)); + tessellator.addVertexWithUV((double)((float)i1 + f6) + 0.5D, (double)l1, (double)((float)l + f7) + 0.5D, (double)(1.0F * f8), (double)((float)l1 * f8 / 4.0F + f10 * f8)); + tessellator.addVertexWithUV((double)((float)i1 + f6) + 0.5D, (double)i2, (double)((float)l + f7) + 0.5D, (double)(1.0F * f8), (double)((float)i2 * f8 / 4.0F + f10 * f8)); + tessellator.addVertexWithUV((double)((float)i1 - f6) + 0.5D, (double)i2, (double)((float)l - f7) + 0.5D, (double)(0.0F * f8), (double)((float)i2 * f8 / 4.0F + f10 * f8)); + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + } + else + { + if (b1 != 1) + { + if (b1 >= 0) + { + tessellator.draw(); + } + + b1 = 1; + this.mc.getTextureManager().bindTexture(locationSnowPng); + tessellator.startDrawingQuads(); + } + + f10 = ((float)(this.rendererUpdateCount & 511) + p_78474_1_) / 512.0F; + float f16 = this.random.nextFloat() + f5 * 0.01F * (float)this.random.nextGaussian(); + float f11 = this.random.nextFloat() + f5 * (float)this.random.nextGaussian() * 0.001F; + d4 = (double)((float)i1 + 0.5F) - entitylivingbase.posX; + double d5 = (double)((float)l + 0.5F) - entitylivingbase.posZ; + float f14 = MathHelper.sqrt_double(d4 * d4 + d5 * d5) / (float)b0; + float f15 = 1.0F; + tessellator.setBrightness((worldclient.getLightBrightnessForSkyBlocks(i1, j2, l, 0) * 3 + 15728880) / 4); + tessellator.setColorRGBA_F(f15, f15, f15, ((1.0F - f14 * f14) * 0.3F + 0.5F) * f1); + tessellator.setTranslation(-d0 * 1.0D, -d1 * 1.0D, -d2 * 1.0D); + tessellator.addVertexWithUV((double)((float)i1 - f6) + 0.5D, (double)l1, (double)((float)l - f7) + 0.5D, (double)(0.0F * f8 + f16), (double)((float)l1 * f8 / 4.0F + f10 * f8 + f11)); + tessellator.addVertexWithUV((double)((float)i1 + f6) + 0.5D, (double)l1, (double)((float)l + f7) + 0.5D, (double)(1.0F * f8 + f16), (double)((float)l1 * f8 / 4.0F + f10 * f8 + f11)); + tessellator.addVertexWithUV((double)((float)i1 + f6) + 0.5D, (double)i2, (double)((float)l + f7) + 0.5D, (double)(1.0F * f8 + f16), (double)((float)i2 * f8 / 4.0F + f10 * f8 + f11)); + tessellator.addVertexWithUV((double)((float)i1 - f6) + 0.5D, (double)i2, (double)((float)l - f7) + 0.5D, (double)(0.0F * f8 + f16), (double)((float)i2 * f8 / 4.0F + f10 * f8 + f11)); + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + } + } + } + } + } + + if (b1 >= 0) + { + tessellator.draw(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + this.disableLightmap((double)p_78474_1_); + } + } + + /** + * Setup orthogonal projection for rendering GUI screen overlays + */ + public void setupOverlayRendering() + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + + /** + * calculates fog and calls glClearColor + */ + private void updateFogColor(float p_78466_1_) + { + WorldClient worldclient = this.mc.theWorld; + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + float f1 = 0.25F + 0.75F * (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; + f1 = 1.0F - (float)Math.pow((double)f1, 0.25D); + Vec3 vec3 = worldclient.getSkyColor(this.mc.renderViewEntity, p_78466_1_); + float f2 = (float)vec3.xCoord; + float f3 = (float)vec3.yCoord; + float f4 = (float)vec3.zCoord; + Vec3 vec31 = worldclient.getFogColor(p_78466_1_); + this.fogColorRed = (float)vec31.xCoord; + this.fogColorGreen = (float)vec31.yCoord; + this.fogColorBlue = (float)vec31.zCoord; + float f5; + + if (this.mc.gameSettings.renderDistanceChunks >= 4) + { + Vec3 vec32 = MathHelper.sin(worldclient.getCelestialAngleRadians(p_78466_1_)) > 0.0F ? Vec3.createVectorHelper(-1.0D, 0.0D, 0.0D) : Vec3.createVectorHelper(1.0D, 0.0D, 0.0D); + f5 = (float)entitylivingbase.getLook(p_78466_1_).dotProduct(vec32); + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f5 > 0.0F) + { + float[] afloat = worldclient.provider.calcSunriseSunsetColors(worldclient.getCelestialAngle(p_78466_1_), p_78466_1_); + + if (afloat != null) + { + f5 *= afloat[3]; + this.fogColorRed = this.fogColorRed * (1.0F - f5) + afloat[0] * f5; + this.fogColorGreen = this.fogColorGreen * (1.0F - f5) + afloat[1] * f5; + this.fogColorBlue = this.fogColorBlue * (1.0F - f5) + afloat[2] * f5; + } + } + } + + this.fogColorRed += (f2 - this.fogColorRed) * f1; + this.fogColorGreen += (f3 - this.fogColorGreen) * f1; + this.fogColorBlue += (f4 - this.fogColorBlue) * f1; + float f8 = worldclient.getRainStrength(p_78466_1_); + float f9; + + if (f8 > 0.0F) + { + f5 = 1.0F - f8 * 0.5F; + f9 = 1.0F - f8 * 0.4F; + this.fogColorRed *= f5; + this.fogColorGreen *= f5; + this.fogColorBlue *= f9; + } + + f5 = worldclient.getWeightedThunderStrength(p_78466_1_); + + if (f5 > 0.0F) + { + f9 = 1.0F - f5 * 0.5F; + this.fogColorRed *= f9; + this.fogColorGreen *= f9; + this.fogColorBlue *= f9; + } + + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entitylivingbase, p_78466_1_); + float f10; + + if (this.cloudFog) + { + Vec3 vec33 = worldclient.getCloudColour(p_78466_1_); + this.fogColorRed = (float)vec33.xCoord; + this.fogColorGreen = (float)vec33.yCoord; + this.fogColorBlue = (float)vec33.zCoord; + } + else if (block.getMaterial() == Material.water) + { + f10 = (float)EnchantmentHelper.getRespiration(entitylivingbase) * 0.2F; + this.fogColorRed = 0.02F + f10; + this.fogColorGreen = 0.02F + f10; + this.fogColorBlue = 0.2F + f10; + } + else if (block.getMaterial() == Material.lava) + { + this.fogColorRed = 0.6F; + this.fogColorGreen = 0.1F; + this.fogColorBlue = 0.0F; + } + + f10 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * p_78466_1_; + this.fogColorRed *= f10; + this.fogColorGreen *= f10; + this.fogColorBlue *= f10; + double d0 = (entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)p_78466_1_) * worldclient.provider.getVoidFogYFactor(); + + if (entitylivingbase.isPotionActive(Potion.blindness)) + { + int i = entitylivingbase.getActivePotionEffect(Potion.blindness).getDuration(); + + if (i < 20) + { + d0 *= (double)(1.0F - (float)i / 20.0F); + } + else + { + d0 = 0.0D; + } + } + + if (d0 < 1.0D) + { + if (d0 < 0.0D) + { + d0 = 0.0D; + } + + d0 *= d0; + this.fogColorRed = (float)((double)this.fogColorRed * d0); + this.fogColorGreen = (float)((double)this.fogColorGreen * d0); + this.fogColorBlue = (float)((double)this.fogColorBlue * d0); + } + + float f11; + + if (this.bossColorModifier > 0.0F) + { + f11 = this.bossColorModifierPrev + (this.bossColorModifier - this.bossColorModifierPrev) * p_78466_1_; + this.fogColorRed = this.fogColorRed * (1.0F - f11) + this.fogColorRed * 0.7F * f11; + this.fogColorGreen = this.fogColorGreen * (1.0F - f11) + this.fogColorGreen * 0.6F * f11; + this.fogColorBlue = this.fogColorBlue * (1.0F - f11) + this.fogColorBlue * 0.6F * f11; + } + + float f6; + + if (entitylivingbase.isPotionActive(Potion.nightVision)) + { + f11 = this.getNightVisionBrightness(this.mc.thePlayer, p_78466_1_); + f6 = 1.0F / this.fogColorRed; + + if (f6 > 1.0F / this.fogColorGreen) + { + f6 = 1.0F / this.fogColorGreen; + } + + if (f6 > 1.0F / this.fogColorBlue) + { + f6 = 1.0F / this.fogColorBlue; + } + + this.fogColorRed = this.fogColorRed * (1.0F - f11) + this.fogColorRed * f6 * f11; + this.fogColorGreen = this.fogColorGreen * (1.0F - f11) + this.fogColorGreen * f6 * f11; + this.fogColorBlue = this.fogColorBlue * (1.0F - f11) + this.fogColorBlue * f6 * f11; + } + + if (this.mc.gameSettings.anaglyph) + { + f11 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; + f6 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; + float f7 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; + this.fogColorRed = f11; + this.fogColorGreen = f6; + this.fogColorBlue = f7; + } + + net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.fogColorRed, this.fogColorGreen, this.fogColorBlue); + MinecraftForge.EVENT_BUS.post(event); + + this.fogColorRed = event.red; + this.fogColorBlue = event.blue; + this.fogColorGreen = event.green; + + GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } + + /** + * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane + * distance and is used for sky rendering. + */ + private void setupFog(int p_78468_1_, float p_78468_2_) + { + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + boolean flag = false; + + if (entitylivingbase instanceof EntityPlayer) + { + flag = ((EntityPlayer)entitylivingbase).capabilities.isCreativeMode; + } + + if (p_78468_1_ == 999) + { + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, 8.0F); + + if (GLContext.getCapabilities().GL_NV_fog_distance) + { + GL11.glFogi(34138, 34139); + } + + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + } + else + { + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Block block = ActiveRenderInfo.getBlockAtEntityViewpoint(this.mc.theWorld, entitylivingbase, p_78468_2_); + float f1; + + net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, p_78468_2_, 0.1F); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + GL11.glFogf(GL11.GL_FOG_DENSITY, event.density); + } + else + if (entitylivingbase.isPotionActive(Potion.blindness)) + { + f1 = 5.0F; + int j = entitylivingbase.getActivePotionEffect(Potion.blindness).getDuration(); + + if (j < 20) + { + f1 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)j / 20.0F); + } + + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + + if (p_78468_1_ < 0) + { + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, f1 * 0.8F); + } + else + { + GL11.glFogf(GL11.GL_FOG_START, f1 * 0.25F); + GL11.glFogf(GL11.GL_FOG_END, f1); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) + { + GL11.glFogi(34138, 34139); + } + } + else if (this.cloudFog) + { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); + } + else if (block.getMaterial() == Material.water) + { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + + if (entitylivingbase.isPotionActive(Potion.waterBreathing)) + { + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); + } + else + { + GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(entitylivingbase) * 0.03F); + } + } + else if (block.getMaterial() == Material.lava) + { + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); + GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); + } + else + { + f1 = this.farPlaneDistance; + + if (this.mc.theWorld.provider.getWorldHasVoidParticles() && !flag) + { + double d0 = (double)((entitylivingbase.getBrightnessForRender(p_78468_2_) & 15728640) >> 20) / 16.0D + (entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)p_78468_2_ + 4.0D) / 32.0D; + + if (d0 < 1.0D) + { + if (d0 < 0.0D) + { + d0 = 0.0D; + } + + d0 *= d0; + float f2 = 100.0F * (float)d0; + + if (f2 < 5.0F) + { + f2 = 5.0F; + } + + if (f1 > f2) + { + f1 = f2; + } + } + } + + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + + if (p_78468_1_ < 0) + { + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, f1); + } + else + { + GL11.glFogf(GL11.GL_FOG_START, f1 * 0.75F); + GL11.glFogf(GL11.GL_FOG_END, f1); + } + + if (GLContext.getCapabilities().GL_NV_fog_distance) + { + GL11.glFogi(34138, 34139); + } + + if (this.mc.theWorld.provider.doesXZShowFog((int)entitylivingbase.posX, (int)entitylivingbase.posZ)) + { + GL11.glFogf(GL11.GL_FOG_START, f1 * 0.05F); + GL11.glFogf(GL11.GL_FOG_END, Math.min(f1, 192.0F) * 0.5F); + } + MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent(this, entitylivingbase, block, p_78468_2_, p_78468_1_, f1)); + } + + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT); + } + } + + /** + * Update and return fogColorBuffer with the RGBA values passed as arguments + */ + private FloatBuffer setFogColorBuffer(float p_78469_1_, float p_78469_2_, float p_78469_3_, float p_78469_4_) + { + this.fogColorBuffer.clear(); + this.fogColorBuffer.put(p_78469_1_).put(p_78469_2_).put(p_78469_3_).put(p_78469_4_); + this.fogColorBuffer.flip(); + return this.fogColorBuffer; + } + + public MapItemRenderer getMapItemRenderer() + { + return this.theMapItemRenderer; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntitySorter.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntitySorter.java new file mode 100644 index 0000000..2503e61 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/EntitySorter.java @@ -0,0 +1,41 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Comparator; +import net.minecraft.entity.Entity; + +@SideOnly(Side.CLIENT) +public class EntitySorter implements Comparator +{ + /** Entity position X */ + private double entityPosX; + /** Entity position Y */ + private double entityPosY; + /** Entity position Z */ + private double entityPosZ; + private static final String __OBFID = "CL_00000944"; + + public EntitySorter(Entity p_i1242_1_) + { + this.entityPosX = -p_i1242_1_.posX; + this.entityPosY = -p_i1242_1_.posY; + this.entityPosZ = -p_i1242_1_.posZ; + } + + public int compare(WorldRenderer p_compare_1_, WorldRenderer p_compare_2_) + { + double d0 = (double)p_compare_1_.posXPlus + this.entityPosX; + double d1 = (double)p_compare_1_.posYPlus + this.entityPosY; + double d2 = (double)p_compare_1_.posZPlus + this.entityPosZ; + double d3 = (double)p_compare_2_.posXPlus + this.entityPosX; + double d4 = (double)p_compare_2_.posYPlus + this.entityPosY; + double d5 = (double)p_compare_2_.posZPlus + this.entityPosZ; + return (int)((d0 * d0 + d1 * d1 + d2 * d2 - (d3 * d3 + d4 * d4 + d5 * d5)) * 1024.0D); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((WorldRenderer)p_compare_1_, (WorldRenderer)p_compare_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/GLAllocation.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/GLAllocation.java new file mode 100644 index 0000000..4784ebf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/GLAllocation.java @@ -0,0 +1,79 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class GLAllocation +{ + private static final Map mapDisplayLists = new HashMap(); + private static final List listDummy = new ArrayList(); + private static final String __OBFID = "CL_00000630"; + + /** + * Generates the specified number of display lists and returns the first index. + */ + public static synchronized int generateDisplayLists(int p_74526_0_) + { + int j = GL11.glGenLists(p_74526_0_); + mapDisplayLists.put(Integer.valueOf(j), Integer.valueOf(p_74526_0_)); + return j; + } + + public static synchronized void deleteDisplayLists(int p_74523_0_) + { + GL11.glDeleteLists(p_74523_0_, ((Integer)mapDisplayLists.remove(Integer.valueOf(p_74523_0_))).intValue()); + } + + /** + * Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. + */ + public static synchronized void deleteTexturesAndDisplayLists() + { + Iterator iterator = mapDisplayLists.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + GL11.glDeleteLists(((Integer)entry.getKey()).intValue(), ((Integer)entry.getValue()).intValue()); + } + + mapDisplayLists.clear(); + } + + /** + * Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. + */ + public static synchronized ByteBuffer createDirectByteBuffer(int p_74524_0_) + { + return ByteBuffer.allocateDirect(p_74524_0_).order(ByteOrder.nativeOrder()); + } + + /** + * Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. + */ + public static IntBuffer createDirectIntBuffer(int p_74527_0_) + { + return createDirectByteBuffer(p_74527_0_ << 2).asIntBuffer(); + } + + /** + * Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up + * access. + */ + public static FloatBuffer createDirectFloatBuffer(int p_74529_0_) + { + return createDirectByteBuffer(p_74529_0_ << 2).asFloatBuffer(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IImageBuffer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IImageBuffer.java new file mode 100644 index 0000000..51f44fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IImageBuffer.java @@ -0,0 +1,13 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; + +@SideOnly(Side.CLIENT) +public interface IImageBuffer +{ + BufferedImage parseUserSkin(BufferedImage p_78432_1_); + + void func_152634_a(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IconFlipped.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IconFlipped.java new file mode 100644 index 0000000..ba8659f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/IconFlipped.java @@ -0,0 +1,92 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.IIcon; + +@SideOnly(Side.CLIENT) +public class IconFlipped implements IIcon +{ + private final IIcon baseIcon; + private final boolean flipU; + private final boolean flipV; + private static final String __OBFID = "CL_00001511"; + + public IconFlipped(IIcon p_i1560_1_, boolean p_i1560_2_, boolean p_i1560_3_) + { + this.baseIcon = p_i1560_1_; + this.flipU = p_i1560_2_; + this.flipV = p_i1560_3_; + } + + /** + * Returns the width of the icon, in pixels. + */ + public int getIconWidth() + { + return this.baseIcon.getIconWidth(); + } + + /** + * Returns the height of the icon, in pixels. + */ + public int getIconHeight() + { + return this.baseIcon.getIconHeight(); + } + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + public float getMinU() + { + return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); + } + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + public float getMaxU() + { + return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); + } + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + public float getInterpolatedU(double p_94214_1_) + { + float f = this.getMaxU() - this.getMinU(); + return this.getMinU() + f * ((float)p_94214_1_ / 16.0F); + } + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + public float getMinV() + { + return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMinV(); + } + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + public float getMaxV() + { + return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); + } + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + public float getInterpolatedV(double p_94207_1_) + { + float f = this.getMaxV() - this.getMinV(); + return this.getMinV() + f * ((float)p_94207_1_ / 16.0F); + } + + public String getIconName() + { + return this.baseIcon.getIconName(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ImageBufferDownload.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ImageBufferDownload.java new file mode 100644 index 0000000..0718a34 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ImageBufferDownload.java @@ -0,0 +1,95 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; +import java.awt.image.ImageObserver; + +@SideOnly(Side.CLIENT) +public class ImageBufferDownload implements IImageBuffer +{ + private int[] imageData; + private int imageWidth; + private int imageHeight; + private static final String __OBFID = "CL_00000956"; + + public BufferedImage parseUserSkin(BufferedImage p_78432_1_) + { + if (p_78432_1_ == null) + { + return null; + } + else + { + this.imageWidth = 64; + this.imageHeight = 32; + BufferedImage bufferedimage1 = new BufferedImage(this.imageWidth, this.imageHeight, 2); + Graphics graphics = bufferedimage1.getGraphics(); + graphics.drawImage(p_78432_1_, 0, 0, (ImageObserver)null); + graphics.dispose(); + this.imageData = ((DataBufferInt)bufferedimage1.getRaster().getDataBuffer()).getData(); + this.setAreaOpaque(0, 0, 32, 16); + this.setAreaTransparent(32, 0, 64, 32); + this.setAreaOpaque(0, 16, 64, 32); + return bufferedimage1; + } + } + + public void func_152634_a() {} + + /** + * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer + * layer of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin + * maker is just using an image editor without an alpha channel) + */ + private void setAreaTransparent(int p_78434_1_, int p_78434_2_, int p_78434_3_, int p_78434_4_) + { + if (!this.hasTransparency(p_78434_1_, p_78434_2_, p_78434_3_, p_78434_4_)) + { + for (int i1 = p_78434_1_; i1 < p_78434_3_; ++i1) + { + for (int j1 = p_78434_2_; j1 < p_78434_4_; ++j1) + { + this.imageData[i1 + j1 * this.imageWidth] &= 16777215; + } + } + } + } + + /** + * Makes the given area of the image opaque + */ + private void setAreaOpaque(int p_78433_1_, int p_78433_2_, int p_78433_3_, int p_78433_4_) + { + for (int i1 = p_78433_1_; i1 < p_78433_3_; ++i1) + { + for (int j1 = p_78433_2_; j1 < p_78433_4_; ++j1) + { + this.imageData[i1 + j1 * this.imageWidth] |= -16777216; + } + } + } + + /** + * Returns true if the given area of the image contains transparent pixels + */ + private boolean hasTransparency(int p_78435_1_, int p_78435_2_, int p_78435_3_, int p_78435_4_) + { + for (int i1 = p_78435_1_; i1 < p_78435_3_; ++i1) + { + for (int j1 = p_78435_2_; j1 < p_78435_4_; ++j1) + { + int k1 = this.imageData[i1 + j1 * this.imageWidth]; + + if ((k1 >> 24 & 255) < 128) + { + return true; + } + } + } + + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/InventoryEffectRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/InventoryEffectRenderer.java new file mode 100644 index 0000000..4a22ab4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/InventoryEffectRenderer.java @@ -0,0 +1,107 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.inventory.Container; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public abstract class InventoryEffectRenderer extends GuiContainer +{ + private boolean field_147045_u; + private static final String __OBFID = "CL_00000755"; + + public InventoryEffectRenderer(Container p_i1089_1_) + { + super(p_i1089_1_); + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + public void initGui() + { + super.initGui(); + + if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) + { + this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; + this.field_147045_u = true; + } + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + super.drawScreen(mouseX, mouseY, partialTicks); + + if (this.field_147045_u) + { + this.func_147044_g(); + } + } + + private void func_147044_g() + { + int i = this.guiLeft - 124; + int j = this.guiTop; + boolean flag = true; + Collection collection = this.mc.thePlayer.getActivePotionEffects(); + + if (!collection.isEmpty()) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + int k = 33; + + if (collection.size() > 5) + { + k = 132 / (collection.size() - 1); + } + + for (Iterator iterator = this.mc.thePlayer.getActivePotionEffects().iterator(); iterator.hasNext(); j += k) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147001_a); + this.drawTexturedModalRect(i, j, 0, 166, 140, 32); + + if (potion.hasStatusIcon()) + { + int l = potion.getStatusIconIndex(); + this.drawTexturedModalRect(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18); + } + + potion.renderInventoryEffect(i, j, potioneffect, mc); + if (!potion.shouldRenderInvText(potioneffect)) continue; + String s1 = I18n.format(potion.getName(), new Object[0]); + + if (potioneffect.getAmplifier() == 1) + { + s1 = s1 + " " + I18n.format("enchantment.level.2", new Object[0]); + } + else if (potioneffect.getAmplifier() == 2) + { + s1 = s1 + " " + I18n.format("enchantment.level.3", new Object[0]); + } + else if (potioneffect.getAmplifier() == 3) + { + s1 = s1 + " " + I18n.format("enchantment.level.4", new Object[0]); + } + + this.fontRendererObj.drawStringWithShadow(s1, i + 10 + 18, j + 6, 16777215); + String s = Potion.getDurationString(potioneffect); + this.fontRendererObj.drawStringWithShadow(s, i + 10 + 18, j + 6 + 10, 8355711); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ItemRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ItemRenderer.java new file mode 100644 index 0000000..01790b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ItemRenderer.java @@ -0,0 +1,776 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.MinecraftForgeClient; +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; + +@SideOnly(Side.CLIENT) +public class ItemRenderer +{ + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); + private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); + /** A reference to the Minecraft object. */ + private Minecraft mc; + private ItemStack itemToRender; + /** How far the current item has been equipped (0 disequipped and 1 fully up) */ + private float equippedProgress; + private float prevEquippedProgress; + private RenderBlocks renderBlocksIr = new RenderBlocks(); + /** The index of the currently held item (0-8, or -1 if not yet updated) */ + private int equippedItemSlot = -1; + private static final String __OBFID = "CL_00000953"; + + public ItemRenderer(Minecraft p_i1247_1_) + { + this.mc = p_i1247_1_; + } + + /** + * Renders the item stack for being in an entity's hand Args: itemStack + */ + public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_) + { + this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED); + } + + public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type) + { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = p_78443_2_.getItem(); + Block block = Block.getBlockFromItem(item); + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type); + if (customRenderer != null) + { + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, p_78443_1_, p_78443_2_); + } + else + if (p_78443_2_.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) + { + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) + { + GL11.glDepthMask(false); + this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + } + else + { + this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F); + } + } + else + { + IIcon iicon = p_78443_1_.getItemIcon(p_78443_2_, p_78443_3_); + + if (iicon == null) + { + GL11.glPopMatrix(); + return; + } + + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glTranslatef(-f4, -f5, 0.0F); + float f6 = 1.5F; + GL11.glScalef(f6, f6, f6); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); + + if (p_78443_2_.hasEffect(p_78443_3_)) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + float f7 = 0.76F; + GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.125F; + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(f9, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) + { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + } + + /** + * Renders an item held in hand as a 2D texture with thickness + */ + public static void renderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_) + { + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, 1.0F); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, -1.0F); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.draw(); + float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_; + float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_; + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F); + int k; + float f7; + float f8; + + for (k = 0; k < p_78439_5_; ++k) + { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + p_78439_0_.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(1.0F, 0.0F, 0.0F); + float f9; + + for (k = 0; k < p_78439_5_; ++k) + { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + f9 = f7 + 1.0F / (float)p_78439_5_; + p_78439_0_.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) + { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + f9 = f7 + 1.0F / (float)p_78439_6_; + p_78439_0_.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, -1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) + { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + p_78439_0_.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + } + + p_78439_0_.draw(); + } + + /** + * Renders the active item in the player's hand when in first person mode. Args: partialTickTime + */ + public void renderItemInFirstPerson(float p_78440_1_) + { + float f1 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_; + EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer; + float f2 = entityclientplayermp.prevRotationPitch + (entityclientplayermp.rotationPitch - entityclientplayermp.prevRotationPitch) * p_78440_1_; + GL11.glPushMatrix(); + GL11.glRotatef(f2, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(entityclientplayermp.prevRotationYaw + (entityclientplayermp.rotationYaw - entityclientplayermp.prevRotationYaw) * p_78440_1_, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + EntityPlayerSP entityplayersp = (EntityPlayerSP)entityclientplayermp; + float f3 = entityplayersp.prevRenderArmPitch + (entityplayersp.renderArmPitch - entityplayersp.prevRenderArmPitch) * p_78440_1_; + float f4 = entityplayersp.prevRenderArmYaw + (entityplayersp.renderArmYaw - entityplayersp.prevRenderArmYaw) * p_78440_1_; + GL11.glRotatef((entityclientplayermp.rotationPitch - f3) * 0.1F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef((entityclientplayermp.rotationYaw - f4) * 0.1F, 0.0F, 1.0F, 0.0F); + ItemStack itemstack = this.itemToRender; + + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + int i = this.mc.theWorld.getLightBrightnessForSkyBlocks(MathHelper.floor_double(entityclientplayermp.posX), MathHelper.floor_double(entityclientplayermp.posY), MathHelper.floor_double(entityclientplayermp.posZ), 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float f5; + float f6; + float f7; + + if (itemstack != null) + { + int l = itemstack.getItem().getColorFromItemStack(itemstack, 0); + f5 = (float)(l >> 16 & 255) / 255.0F; + f6 = (float)(l >> 8 & 255) / 255.0F; + f7 = (float)(l & 255) / 255.0F; + GL11.glColor4f(f5, f6, f7, 1.0F); + } + else + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + float f8; + float f9; + float f10; + float f13; + Render render; + RenderPlayer renderplayer; + + if (itemstack != null && itemstack.getItem() instanceof ItemMap) + { + GL11.glPushMatrix(); + f13 = 0.8F; + f5 = entityclientplayermp.getSwingProgress(p_78440_1_); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); + f5 = 1.0F - f2 / 45.0F + 0.1F; + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f5 > 1.0F) + { + f5 = 1.0F; + } + + f5 = -MathHelper.cos(f5 * (float)Math.PI) * 0.5F + 0.5F; + GL11.glTranslatef(0.0F, 0.0F * f13 - (1.0F - f1) * 1.2F - f5 * 0.5F + 0.04F, -0.9F * f13); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f5 * -85.0F, 0.0F, 0.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); + + for (int i1 = 0; i1 < 2; ++i1) + { + int j1 = i1 * 2 - 1; + GL11.glPushMatrix(); + GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)j1); + GL11.glRotatef((float)(-45 * j1), 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef((float)(-65 * j1), 0.0F, 1.0F, 0.0F); + render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); + renderplayer = (RenderPlayer)render; + f10 = 1.0F; + GL11.glScalef(f10, f10, f10); + renderplayer.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + + f6 = entityclientplayermp.getSwingProgress(p_78440_1_); + f7 = MathHelper.sin(f6 * f6 * (float)Math.PI); + f8 = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI); + GL11.glRotatef(-f7 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f8 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-f8 * 80.0F, 1.0F, 0.0F, 0.0F); + f9 = 0.38F; + GL11.glScalef(f9, f9, f9); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-1.0F, -1.0F, 0.0F); + f10 = 0.015625F; + GL11.glScalef(f10, f10, f10); + this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); + Tessellator tessellator = Tessellator.instance; + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + tessellator.startDrawingQuads(); + byte b0 = 7; + tessellator.addVertexWithUV((double)(0 - b0), (double)(128 + b0), 0.0D, 0.0D, 1.0D); + tessellator.addVertexWithUV((double)(128 + b0), (double)(128 + b0), 0.0D, 1.0D, 1.0D); + tessellator.addVertexWithUV((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); + tessellator.addVertexWithUV((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); + tessellator.draw(); + + IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); + MapData mapdata = ((ItemMap)itemstack.getItem()).getMapData(itemstack, this.mc.theWorld); + + if (custom == null) + { + if (mapdata != null) + { + this.mc.entityRenderer.getMapItemRenderer().func_148250_a(mapdata, false); + } + } + else + { + custom.renderItem(FIRST_PERSON_MAP, itemstack, mc.thePlayer, mc.getTextureManager(), mapdata); + } + + GL11.glPopMatrix(); + } + else if (itemstack != null) + { + GL11.glPushMatrix(); + f13 = 0.8F; + + if (entityclientplayermp.getItemInUseCount() > 0) + { + EnumAction enumaction = itemstack.getItemUseAction(); + + if (enumaction == EnumAction.eat || enumaction == EnumAction.drink) + { + f6 = (float)entityclientplayermp.getItemInUseCount() - p_78440_1_ + 1.0F; + f7 = 1.0F - f6 / (float)itemstack.getMaxItemUseDuration(); + f8 = 1.0F - f7; + f8 = f8 * f8 * f8; + f8 = f8 * f8 * f8; + f8 = f8 * f8 * f8; + f9 = 1.0F - f8; + GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(f6 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)f7 > 0.2D ? 1 : 0), 0.0F); + GL11.glTranslatef(f9 * 0.6F, -f9 * 0.5F, 0.0F); + GL11.glRotatef(f9 * 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f9 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(f9 * 30.0F, 0.0F, 0.0F, 1.0F); + } + } + else + { + f5 = entityclientplayermp.getSwingProgress(p_78440_1_); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.2F, -f6 * 0.2F); + } + + GL11.glTranslatef(0.7F * f13, -0.65F * f13 - (1.0F - f1) * 0.6F, -0.9F * f13); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + f5 = entityclientplayermp.getSwingProgress(p_78440_1_); + f6 = MathHelper.sin(f5 * f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glRotatef(-f6 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f7 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-f7 * 80.0F, 1.0F, 0.0F, 0.0F); + f8 = 0.4F; + GL11.glScalef(f8, f8, f8); + float f11; + float f12; + + if (entityclientplayermp.getItemInUseCount() > 0) + { + EnumAction enumaction1 = itemstack.getItemUseAction(); + + if (enumaction1 == EnumAction.block) + { + GL11.glTranslatef(-0.5F, 0.2F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); + } + else if (enumaction1 == EnumAction.bow) + { + GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.9F, 0.2F, 0.0F); + f10 = (float)itemstack.getMaxItemUseDuration() - ((float)entityclientplayermp.getItemInUseCount() - p_78440_1_ + 1.0F); + f11 = f10 / 20.0F; + f11 = (f11 * f11 + f11 * 2.0F) / 3.0F; + + if (f11 > 1.0F) + { + f11 = 1.0F; + } + + if (f11 > 0.1F) + { + GL11.glTranslatef(0.0F, MathHelper.sin((f10 - 0.1F) * 1.3F) * 0.01F * (f11 - 0.1F), 0.0F); + } + + GL11.glTranslatef(0.0F, 0.0F, f11 * 0.1F); + GL11.glRotatef(-335.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.5F, 0.0F); + f12 = 1.0F + f11 * 0.2F; + GL11.glScalef(1.0F, 1.0F, f12); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + } + } + + if (itemstack.getItem().shouldRotateAroundWhenRendering()) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + + if (itemstack.getItem().requiresMultipleRenderPasses()) + { + this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); + for (int x = 1; x < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); x++) + { + int k1 = itemstack.getItem().getColorFromItemStack(itemstack, x); + f10 = (float)(k1 >> 16 & 255) / 255.0F; + f11 = (float)(k1 >> 8 & 255) / 255.0F; + f12 = (float)(k1 & 255) / 255.0F; + GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F); + this.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON); + } + } + else + { + this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); + } + + GL11.glPopMatrix(); + } + else if (!entityclientplayermp.isInvisible()) + { + GL11.glPushMatrix(); + f13 = 0.8F; + f5 = entityclientplayermp.getSwingProgress(p_78440_1_); + f6 = MathHelper.sin(f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glTranslatef(-f7 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI * 2.0F) * 0.4F, -f6 * 0.4F); + GL11.glTranslatef(0.8F * f13, -0.75F * f13 - (1.0F - f1) * 0.6F, -0.9F * f13); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + f5 = entityclientplayermp.getSwingProgress(p_78440_1_); + f6 = MathHelper.sin(f5 * f5 * (float)Math.PI); + f7 = MathHelper.sin(MathHelper.sqrt_float(f5) * (float)Math.PI); + GL11.glRotatef(f7 * 70.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f6 * 20.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(entityclientplayermp.getLocationSkin()); + GL11.glTranslatef(-1.0F, 3.6F, 3.5F); + GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glTranslatef(5.6F, 0.0F, 0.0F); + render = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); + renderplayer = (RenderPlayer)render; + f10 = 1.0F; + GL11.glScalef(f10, f10, f10); + renderplayer.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + } + + /** + * Renders all the overlays that are in first person mode. Args: partialTickTime + */ + public void renderOverlays(float p_78447_1_) + { + GL11.glDisable(GL11.GL_ALPHA_TEST); + + if (this.mc.thePlayer.isBurning()) + { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.FIRE, Blocks.fire, MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ)))) + this.renderFireInFirstPerson(p_78447_1_); + } + + if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) + { + int i = MathHelper.floor_double(this.mc.thePlayer.posX); + int j = MathHelper.floor_double(this.mc.thePlayer.posY); + int k = MathHelper.floor_double(this.mc.thePlayer.posZ); + Block block = this.mc.theWorld.getBlock(i, j, k); + int block2_X = i, block2_Y = j, block2_Z = k; + + if (this.mc.theWorld.getBlock(i, j, k).isNormalCube()) + { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, i, j, k))) + this.renderInsideOfBlock(p_78447_1_, block.getBlockTextureFromSide(2)); + } + else + { + for (int l = 0; l < 8; ++l) + { + float f1 = ((float)((l >> 0) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + float f2 = ((float)((l >> 1) % 2) - 0.5F) * this.mc.thePlayer.height * 0.2F; + float f3 = ((float)((l >> 2) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + int i1 = MathHelper.floor_float((float)i + f1); + int j1 = MathHelper.floor_float((float)j + f2); + int k1 = MathHelper.floor_float((float)k + f3); + + if (this.mc.theWorld.getBlock(i1, j1, k1).isNormalCube()) + { + block = this.mc.theWorld.getBlock(i1, j1, k1); + block2_X = i; + block2_Y = j; + block2_Z = k; + } + } + } + + if (block.getMaterial() != Material.air) + { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, block2_X, block2_Y, block2_Z))) + this.renderInsideOfBlock(p_78447_1_, block.getBlockTextureFromSide(2)); + } + } + + if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) + { + if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.mc.thePlayer, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.WATER, Blocks.water, MathHelper.floor_double(this.mc.thePlayer.posX), MathHelper.floor_double(this.mc.thePlayer.posY), MathHelper.floor_double(this.mc.thePlayer.posZ)))) + this.renderWarpedTextureOverlay(p_78447_1_); + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + /** + * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex + */ + private void renderInsideOfBlock(float p_78446_1_, IIcon p_78446_2_) + { + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Tessellator tessellator = Tessellator.instance; + float f1 = 0.1F; + GL11.glColor4f(f1, f1, f1, 0.5F); + GL11.glPushMatrix(); + float f2 = -1.0F; + float f3 = 1.0F; + float f4 = -1.0F; + float f5 = 1.0F; + float f6 = -0.5F; + float f7 = p_78446_2_.getMinU(); + float f8 = p_78446_2_.getMaxU(); + float f9 = p_78446_2_.getMinV(); + float f10 = p_78446_2_.getMaxV(); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)f2, (double)f4, (double)f6, (double)f8, (double)f10); + tessellator.addVertexWithUV((double)f3, (double)f4, (double)f6, (double)f7, (double)f10); + tessellator.addVertexWithUV((double)f3, (double)f5, (double)f6, (double)f7, (double)f9); + tessellator.addVertexWithUV((double)f2, (double)f5, (double)f6, (double)f8, (double)f9); + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * Renders a texture that warps around based on the direction the player is looking. Texture needs to be bound + * before being called. Used for the water overlay. Args: parialTickTime + */ + private void renderWarpedTextureOverlay(float p_78448_1_) + { + this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); + Tessellator tessellator = Tessellator.instance; + float f1 = this.mc.thePlayer.getBrightness(p_78448_1_); + GL11.glColor4f(f1, f1, f1, 0.5F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glPushMatrix(); + float f2 = 4.0F; + float f3 = -1.0F; + float f4 = 1.0F; + float f5 = -1.0F; + float f6 = 1.0F; + float f7 = -0.5F; + float f8 = -this.mc.thePlayer.rotationYaw / 64.0F; + float f9 = this.mc.thePlayer.rotationPitch / 64.0F; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)f3, (double)f5, (double)f7, (double)(f2 + f8), (double)(f2 + f9)); + tessellator.addVertexWithUV((double)f4, (double)f5, (double)f7, (double)(0.0F + f8), (double)(f2 + f9)); + tessellator.addVertexWithUV((double)f4, (double)f6, (double)f7, (double)(0.0F + f8), (double)(0.0F + f9)); + tessellator.addVertexWithUV((double)f3, (double)f6, (double)f7, (double)(f2 + f8), (double)(0.0F + f9)); + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + } + + /** + * Renders the fire on the screen for first person mode. Arg: partialTickTime + */ + private void renderFireInFirstPerson(float p_78442_1_) + { + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + float f1 = 1.0F; + + for (int i = 0; i < 2; ++i) + { + GL11.glPushMatrix(); + IIcon iicon = Blocks.fire.getFireIcon(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + float f2 = iicon.getMinU(); + float f3 = iicon.getMaxU(); + float f4 = iicon.getMinV(); + float f5 = iicon.getMaxV(); + float f6 = (0.0F - f1) / 2.0F; + float f7 = f6 + f1; + float f8 = 0.0F - f1 / 2.0F; + float f9 = f8 + f1; + float f10 = -0.5F; + GL11.glTranslatef((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F); + GL11.glRotatef((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)f6, (double)f8, (double)f10, (double)f3, (double)f5); + tessellator.addVertexWithUV((double)f7, (double)f8, (double)f10, (double)f2, (double)f5); + tessellator.addVertexWithUV((double)f7, (double)f9, (double)f10, (double)f2, (double)f4); + tessellator.addVertexWithUV((double)f6, (double)f9, (double)f10, (double)f3, (double)f4); + tessellator.draw(); + GL11.glPopMatrix(); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + } + + public void updateEquippedItem() + { + this.prevEquippedProgress = this.equippedProgress; + EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer; + ItemStack itemstack = entityclientplayermp.inventory.getCurrentItem(); + boolean flag = this.equippedItemSlot == entityclientplayermp.inventory.currentItem && itemstack == this.itemToRender; + + if (this.itemToRender == null && itemstack == null) + { + flag = true; + } + + if (itemstack != null && this.itemToRender != null && itemstack != this.itemToRender && itemstack.getItem() == this.itemToRender.getItem() && itemstack.getItemDamage() == this.itemToRender.getItemDamage()) + { + this.itemToRender = itemstack; + flag = true; + } + + float f = 0.4F; + float f1 = flag ? 1.0F : 0.0F; + float f2 = f1 - this.equippedProgress; + + if (f2 < -f) + { + f2 = -f; + } + + if (f2 > f) + { + f2 = f; + } + + this.equippedProgress += f2; + + if (this.equippedProgress < 0.1F) + { + this.itemToRender = itemstack; + this.equippedItemSlot = entityclientplayermp.inventory.currentItem; + } + } + + /** + * Resets equippedProgress + */ + public void resetEquippedProgress() + { + this.equippedProgress = 0.0F; + } + + /** + * Resets equippedProgress + */ + public void resetEquippedProgress2() + { + this.equippedProgress = 0.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlCapsChecker.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlCapsChecker.java new file mode 100644 index 0000000..15811ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlCapsChecker.java @@ -0,0 +1,19 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import org.lwjgl.opengl.GLContext; + +@SideOnly(Side.CLIENT) +public class OpenGlCapsChecker +{ + private static final String __OBFID = "CL_00000649"; + + /** + * Checks if we support OpenGL occlusion. + */ + public static boolean checkARBOcclusion() + { + return GLContext.getCapabilities().GL_ARB_occlusion_query; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlHelper.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlHelper.java new file mode 100644 index 0000000..e5653cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/OpenGlHelper.java @@ -0,0 +1,746 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import org.lwjgl.opengl.ARBFramebufferObject; +import org.lwjgl.opengl.ARBMultitexture; +import org.lwjgl.opengl.ARBShaderObjects; +import org.lwjgl.opengl.ARBVertexShader; +import org.lwjgl.opengl.ContextCapabilities; +import org.lwjgl.opengl.EXTBlendFuncSeparate; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL20; +import org.lwjgl.opengl.GL30; +import org.lwjgl.opengl.GLContext; + +@SideOnly(Side.CLIENT) +public class OpenGlHelper +{ + public static boolean openGL21; + /** + * An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture + * units. + */ + public static int defaultTexUnit; + /** + * An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture + * units. + */ + public static int lightmapTexUnit; + public static boolean field_153197_d; + public static int field_153198_e; + public static int field_153199_f; + public static int field_153200_g; + public static int field_153201_h; + public static int field_153202_i; + public static int field_153203_j; + public static int field_153204_k; + public static int field_153205_l; + public static int field_153206_m; + private static int field_153212_w; + public static boolean framebufferSupported; + private static boolean field_153213_x; + private static boolean field_153214_y; + public static int field_153207_o; + public static int field_153208_p; + public static int field_153209_q; + public static int field_153210_r; + public static boolean anisotropicFilteringSupported; + public static int anisotropicFilteringMax; + private static boolean field_153215_z; + private static boolean openGL14; + public static boolean field_153211_u; + public static boolean shadersSupported; + private static String field_153196_B = ""; + private static final String __OBFID = "CL_00001179"; + + /* Stores the last values sent into setLightmapTextureCoords */ + public static float lastBrightnessX = 0.0f; + public static float lastBrightnessY = 0.0f; + + /** + * Initializes the texture constants to be used when rendering lightmap values + */ + public static void initializeTextures() + { + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); + field_153215_z = contextcapabilities.GL_ARB_multitexture && !contextcapabilities.OpenGL13; + + if (field_153215_z) + { + field_153196_B = field_153196_B + "Using multitexturing ARB.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + } + else + { + field_153196_B = field_153196_B + "Using GL 1.3 multitexturing.\n"; + defaultTexUnit = 33984; + lightmapTexUnit = 33985; + } + + field_153211_u = contextcapabilities.GL_EXT_blend_func_separate && !contextcapabilities.OpenGL14; + openGL14 = contextcapabilities.OpenGL14 || contextcapabilities.GL_EXT_blend_func_separate; + framebufferSupported = openGL14 && (contextcapabilities.GL_ARB_framebuffer_object || contextcapabilities.GL_EXT_framebuffer_object || contextcapabilities.OpenGL30); + + if (framebufferSupported) + { + field_153196_B = field_153196_B + "Using framebuffer objects because "; + + if (contextcapabilities.OpenGL30) + { + field_153196_B = field_153196_B + "OpenGL 3.0 is supported and separate blending is supported.\n"; + field_153212_w = 0; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153203_j = 36054; + field_153204_k = 36055; + field_153205_l = 36059; + field_153206_m = 36060; + } + else if (contextcapabilities.GL_ARB_framebuffer_object) + { + field_153196_B = field_153196_B + "ARB_framebuffer_object is supported and separate blending is supported.\n"; + field_153212_w = 1; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153204_k = 36055; + field_153203_j = 36054; + field_153205_l = 36059; + field_153206_m = 36060; + } + else if (contextcapabilities.GL_EXT_framebuffer_object) + { + field_153196_B = field_153196_B + "EXT_framebuffer_object is supported.\n"; + field_153212_w = 2; + field_153198_e = 36160; + field_153199_f = 36161; + field_153200_g = 36064; + field_153201_h = 36096; + field_153202_i = 36053; + field_153204_k = 36055; + field_153203_j = 36054; + field_153205_l = 36059; + field_153206_m = 36060; + } + } + else + { + field_153196_B = field_153196_B + "Not using framebuffer objects because "; + field_153196_B = field_153196_B + "OpenGL 1.4 is " + (contextcapabilities.OpenGL14 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "EXT_blend_func_separate is " + (contextcapabilities.GL_EXT_blend_func_separate ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "OpenGL 3.0 is " + (contextcapabilities.OpenGL30 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_framebuffer_object is " + (contextcapabilities.GL_ARB_framebuffer_object ? "" : "not ") + "supported, and "; + field_153196_B = field_153196_B + "EXT_framebuffer_object is " + (contextcapabilities.GL_EXT_framebuffer_object ? "" : "not ") + "supported.\n"; + } + + anisotropicFilteringSupported = contextcapabilities.GL_EXT_texture_filter_anisotropic; + anisotropicFilteringMax = (int)(anisotropicFilteringSupported ? GL11.glGetFloat(34047) : 0.0F); + field_153196_B = field_153196_B + "Anisotropic filtering is " + (anisotropicFilteringSupported ? "" : "not ") + "supported"; + + if (anisotropicFilteringSupported) + { + field_153196_B = field_153196_B + " and maximum anisotropy is " + anisotropicFilteringMax + ".\n"; + } + else + { + field_153196_B = field_153196_B + ".\n"; + } + + GameSettings.Options.ANISOTROPIC_FILTERING.setValueMax((float)anisotropicFilteringMax); + openGL21 = contextcapabilities.OpenGL21; + field_153213_x = openGL21 || contextcapabilities.GL_ARB_vertex_shader && contextcapabilities.GL_ARB_fragment_shader && contextcapabilities.GL_ARB_shader_objects; + field_153196_B = field_153196_B + "Shaders are " + (field_153213_x ? "" : "not ") + "available because "; + + if (field_153213_x) + { + if (contextcapabilities.OpenGL21) + { + field_153196_B = field_153196_B + "OpenGL 2.1 is supported.\n"; + field_153214_y = false; + field_153207_o = 35714; + field_153208_p = 35713; + field_153209_q = 35633; + field_153210_r = 35632; + } + else + { + field_153196_B = field_153196_B + "ARB_shader_objects, ARB_vertex_shader, and ARB_fragment_shader are supported.\n"; + field_153214_y = true; + field_153207_o = 35714; + field_153208_p = 35713; + field_153209_q = 35633; + field_153210_r = 35632; + } + } + else + { + field_153196_B = field_153196_B + "OpenGL 2.1 is " + (contextcapabilities.OpenGL21 ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_shader_objects is " + (contextcapabilities.GL_ARB_shader_objects ? "" : "not ") + "supported, "; + field_153196_B = field_153196_B + "ARB_vertex_shader is " + (contextcapabilities.GL_ARB_vertex_shader ? "" : "not ") + "supported, and "; + field_153196_B = field_153196_B + "ARB_fragment_shader is " + (contextcapabilities.GL_ARB_fragment_shader ? "" : "not ") + "supported.\n"; + } + + shadersSupported = framebufferSupported && field_153213_x; + field_153197_d = GL11.glGetString(GL11.GL_VENDOR).toLowerCase().contains("nvidia"); + } + + public static boolean func_153193_b() + { + return shadersSupported; + } + + public static String func_153172_c() + { + return field_153196_B; + } + + public static int func_153175_a(int p_153175_0_, int p_153175_1_) + { + return field_153214_y ? ARBShaderObjects.glGetObjectParameteriARB(p_153175_0_, p_153175_1_) : GL20.glGetProgrami(p_153175_0_, p_153175_1_); + } + + public static void func_153178_b(int p_153178_0_, int p_153178_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glAttachObjectARB(p_153178_0_, p_153178_1_); + } + else + { + GL20.glAttachShader(p_153178_0_, p_153178_1_); + } + } + + public static void func_153180_a(int p_153180_0_) + { + if (field_153214_y) + { + ARBShaderObjects.glDeleteObjectARB(p_153180_0_); + } + else + { + GL20.glDeleteShader(p_153180_0_); + } + } + + public static int func_153195_b(int p_153195_0_) + { + return field_153214_y ? ARBShaderObjects.glCreateShaderObjectARB(p_153195_0_) : GL20.glCreateShader(p_153195_0_); + } + + public static void func_153169_a(int p_153169_0_, ByteBuffer p_153169_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glShaderSourceARB(p_153169_0_, p_153169_1_); + } + else + { + GL20.glShaderSource(p_153169_0_, p_153169_1_); + } + } + + public static void func_153170_c(int p_153170_0_) + { + if (field_153214_y) + { + ARBShaderObjects.glCompileShaderARB(p_153170_0_); + } + else + { + GL20.glCompileShader(p_153170_0_); + } + } + + public static int func_153157_c(int p_153157_0_, int p_153157_1_) + { + return field_153214_y ? ARBShaderObjects.glGetObjectParameteriARB(p_153157_0_, p_153157_1_) : GL20.glGetShaderi(p_153157_0_, p_153157_1_); + } + + public static String func_153158_d(int p_153158_0_, int p_153158_1_) + { + return field_153214_y ? ARBShaderObjects.glGetInfoLogARB(p_153158_0_, p_153158_1_) : GL20.glGetShaderInfoLog(p_153158_0_, p_153158_1_); + } + + public static String func_153166_e(int p_153166_0_, int p_153166_1_) + { + return field_153214_y ? ARBShaderObjects.glGetInfoLogARB(p_153166_0_, p_153166_1_) : GL20.glGetProgramInfoLog(p_153166_0_, p_153166_1_); + } + + public static void func_153161_d(int p_153161_0_) + { + if (field_153214_y) + { + ARBShaderObjects.glUseProgramObjectARB(p_153161_0_); + } + else + { + GL20.glUseProgram(p_153161_0_); + } + } + + public static int func_153183_d() + { + return field_153214_y ? ARBShaderObjects.glCreateProgramObjectARB() : GL20.glCreateProgram(); + } + + public static void func_153187_e(int p_153187_0_) + { + if (field_153214_y) + { + ARBShaderObjects.glDeleteObjectARB(p_153187_0_); + } + else + { + GL20.glDeleteProgram(p_153187_0_); + } + } + + public static void func_153179_f(int p_153179_0_) + { + if (field_153214_y) + { + ARBShaderObjects.glLinkProgramARB(p_153179_0_); + } + else + { + GL20.glLinkProgram(p_153179_0_); + } + } + + public static int func_153194_a(int p_153194_0_, CharSequence p_153194_1_) + { + return field_153214_y ? ARBShaderObjects.glGetUniformLocationARB(p_153194_0_, p_153194_1_) : GL20.glGetUniformLocation(p_153194_0_, p_153194_1_); + } + + public static void func_153181_a(int p_153181_0_, IntBuffer p_153181_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform1ARB(p_153181_0_, p_153181_1_); + } + else + { + GL20.glUniform1(p_153181_0_, p_153181_1_); + } + } + + public static void func_153163_f(int p_153163_0_, int p_153163_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform1iARB(p_153163_0_, p_153163_1_); + } + else + { + GL20.glUniform1i(p_153163_0_, p_153163_1_); + } + } + + public static void func_153168_a(int p_153168_0_, FloatBuffer p_153168_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform1ARB(p_153168_0_, p_153168_1_); + } + else + { + GL20.glUniform1(p_153168_0_, p_153168_1_); + } + } + + public static void func_153182_b(int p_153182_0_, IntBuffer p_153182_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform2ARB(p_153182_0_, p_153182_1_); + } + else + { + GL20.glUniform2(p_153182_0_, p_153182_1_); + } + } + + public static void func_153177_b(int p_153177_0_, FloatBuffer p_153177_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform2ARB(p_153177_0_, p_153177_1_); + } + else + { + GL20.glUniform2(p_153177_0_, p_153177_1_); + } + } + + public static void func_153192_c(int p_153192_0_, IntBuffer p_153192_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform3ARB(p_153192_0_, p_153192_1_); + } + else + { + GL20.glUniform3(p_153192_0_, p_153192_1_); + } + } + + public static void func_153191_c(int p_153191_0_, FloatBuffer p_153191_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform3ARB(p_153191_0_, p_153191_1_); + } + else + { + GL20.glUniform3(p_153191_0_, p_153191_1_); + } + } + + public static void func_153162_d(int p_153162_0_, IntBuffer p_153162_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform4ARB(p_153162_0_, p_153162_1_); + } + else + { + GL20.glUniform4(p_153162_0_, p_153162_1_); + } + } + + public static void func_153159_d(int p_153159_0_, FloatBuffer p_153159_1_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniform4ARB(p_153159_0_, p_153159_1_); + } + else + { + GL20.glUniform4(p_153159_0_, p_153159_1_); + } + } + + public static void func_153173_a(int p_153173_0_, boolean p_153173_1_, FloatBuffer p_153173_2_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniformMatrix2ARB(p_153173_0_, p_153173_1_, p_153173_2_); + } + else + { + GL20.glUniformMatrix2(p_153173_0_, p_153173_1_, p_153173_2_); + } + } + + public static void func_153189_b(int p_153189_0_, boolean p_153189_1_, FloatBuffer p_153189_2_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniformMatrix3ARB(p_153189_0_, p_153189_1_, p_153189_2_); + } + else + { + GL20.glUniformMatrix3(p_153189_0_, p_153189_1_, p_153189_2_); + } + } + + public static void func_153160_c(int p_153160_0_, boolean p_153160_1_, FloatBuffer p_153160_2_) + { + if (field_153214_y) + { + ARBShaderObjects.glUniformMatrix4ARB(p_153160_0_, p_153160_1_, p_153160_2_); + } + else + { + GL20.glUniformMatrix4(p_153160_0_, p_153160_1_, p_153160_2_); + } + } + + public static int func_153164_b(int p_153164_0_, CharSequence p_153164_1_) + { + return field_153214_y ? ARBVertexShader.glGetAttribLocationARB(p_153164_0_, p_153164_1_) : GL20.glGetAttribLocation(p_153164_0_, p_153164_1_); + } + + public static void func_153171_g(int p_153171_0_, int p_153171_1_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glBindFramebuffer(p_153171_0_, p_153171_1_); + break; + case 1: + ARBFramebufferObject.glBindFramebuffer(p_153171_0_, p_153171_1_); + break; + case 2: + EXTFramebufferObject.glBindFramebufferEXT(p_153171_0_, p_153171_1_); + } + } + } + + public static void func_153176_h(int p_153176_0_, int p_153176_1_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glBindRenderbuffer(p_153176_0_, p_153176_1_); + break; + case 1: + ARBFramebufferObject.glBindRenderbuffer(p_153176_0_, p_153176_1_); + break; + case 2: + EXTFramebufferObject.glBindRenderbufferEXT(p_153176_0_, p_153176_1_); + } + } + } + + public static void func_153184_g(int p_153184_0_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glDeleteRenderbuffers(p_153184_0_); + break; + case 1: + ARBFramebufferObject.glDeleteRenderbuffers(p_153184_0_); + break; + case 2: + EXTFramebufferObject.glDeleteRenderbuffersEXT(p_153184_0_); + } + } + } + + public static void func_153174_h(int p_153174_0_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glDeleteFramebuffers(p_153174_0_); + break; + case 1: + ARBFramebufferObject.glDeleteFramebuffers(p_153174_0_); + break; + case 2: + EXTFramebufferObject.glDeleteFramebuffersEXT(p_153174_0_); + } + } + } + + public static int func_153165_e() + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (field_153212_w) + { + case 0: + return GL30.glGenFramebuffers(); + case 1: + return ARBFramebufferObject.glGenFramebuffers(); + case 2: + return EXTFramebufferObject.glGenFramebuffersEXT(); + default: + return -1; + } + } + } + + public static int func_153185_f() + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (field_153212_w) + { + case 0: + return GL30.glGenRenderbuffers(); + case 1: + return ARBFramebufferObject.glGenRenderbuffers(); + case 2: + return EXTFramebufferObject.glGenRenderbuffersEXT(); + default: + return -1; + } + } + } + + public static void func_153186_a(int p_153186_0_, int p_153186_1_, int p_153186_2_, int p_153186_3_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glRenderbufferStorage(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + break; + case 1: + ARBFramebufferObject.glRenderbufferStorage(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + break; + case 2: + EXTFramebufferObject.glRenderbufferStorageEXT(p_153186_0_, p_153186_1_, p_153186_2_, p_153186_3_); + } + } + } + + public static void func_153190_b(int p_153190_0_, int p_153190_1_, int p_153190_2_, int p_153190_3_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glFramebufferRenderbuffer(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + break; + case 1: + ARBFramebufferObject.glFramebufferRenderbuffer(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + break; + case 2: + EXTFramebufferObject.glFramebufferRenderbufferEXT(p_153190_0_, p_153190_1_, p_153190_2_, p_153190_3_); + } + } + } + + public static int func_153167_i(int p_153167_0_) + { + if (!framebufferSupported) + { + return -1; + } + else + { + switch (field_153212_w) + { + case 0: + return GL30.glCheckFramebufferStatus(p_153167_0_); + case 1: + return ARBFramebufferObject.glCheckFramebufferStatus(p_153167_0_); + case 2: + return EXTFramebufferObject.glCheckFramebufferStatusEXT(p_153167_0_); + default: + return -1; + } + } + } + + public static void func_153188_a(int p_153188_0_, int p_153188_1_, int p_153188_2_, int p_153188_3_, int p_153188_4_) + { + if (framebufferSupported) + { + switch (field_153212_w) + { + case 0: + GL30.glFramebufferTexture2D(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + break; + case 1: + ARBFramebufferObject.glFramebufferTexture2D(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + break; + case 2: + EXTFramebufferObject.glFramebufferTexture2DEXT(p_153188_0_, p_153188_1_, p_153188_2_, p_153188_3_, p_153188_4_); + } + } + } + + /** + * Sets the current lightmap texture to the specified OpenGL constant + */ + public static void setActiveTexture(int p_77473_0_) + { + if (field_153215_z) + { + ARBMultitexture.glActiveTextureARB(p_77473_0_); + } + else + { + GL13.glActiveTexture(p_77473_0_); + } + } + + /** + * Sets the current lightmap texture to the specified OpenGL constant + */ + public static void setClientActiveTexture(int p_77472_0_) + { + if (field_153215_z) + { + ARBMultitexture.glClientActiveTextureARB(p_77472_0_); + } + else + { + GL13.glClientActiveTexture(p_77472_0_); + } + } + + /** + * Sets the current coordinates of the given lightmap texture + */ + public static void setLightmapTextureCoords(int p_77475_0_, float p_77475_1_, float p_77475_2_) + { + if (field_153215_z) + { + ARBMultitexture.glMultiTexCoord2fARB(p_77475_0_, p_77475_1_, p_77475_2_); + } + else + { + GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); + } + + if (p_77475_0_ == lightmapTexUnit) + { + lastBrightnessX = p_77475_1_; + lastBrightnessY = p_77475_2_; + } + } + + public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) + { + if (openGL14) + { + if (field_153211_u) + { + EXTBlendFuncSeparate.glBlendFuncSeparateEXT(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_); + } + else + { + GL14.glBlendFuncSeparate(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_); + } + } + else + { + GL11.glBlendFunc(p_148821_0_, p_148821_1_); + } + } + + public static boolean isFramebufferEnabled() + { + return framebufferSupported && Minecraft.getMinecraft().gameSettings.fboEnable; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderBlocks.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderBlocks.java new file mode 100644 index 0000000..369f20e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderBlocks.java @@ -0,0 +1,8487 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockBeacon; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockBrewingStand; +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockDragonEgg; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockPane; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneDiode; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockStem; +import net.minecraft.block.BlockTripWire; +import net.minecraft.block.BlockWall; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererChestHelper; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.src.FMLRenderAccessLibrary; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.util.Direction; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import static net.minecraftforge.common.util.ForgeDirection.*; + +@SideOnly(Side.CLIENT) +public class RenderBlocks +{ + /** The IBlockAccess used by this instance of RenderBlocks */ + public IBlockAccess blockAccess; + /** If set to >=0, all block faces will be rendered using this texture index */ + public IIcon overrideBlockTexture; + /** Set to true if the texture should be flipped horizontally during render*Face */ + public boolean flipTexture; + public boolean field_152631_f; + /** If true, renders all faces on all blocks rather than using the logic in Block.shouldSideBeRendered. */ + public boolean renderAllFaces; + /** Fancy grass side matching biome */ + public static boolean fancyGrass = true; + public boolean useInventoryTint = true; + public boolean renderFromInside = false; + /** The minimum X value for rendering (default 0.0). */ + public double renderMinX; + /** The maximum X value for rendering (default 1.0). */ + public double renderMaxX; + /** The minimum Y value for rendering (default 0.0). */ + public double renderMinY; + /** The maximum Y value for rendering (default 1.0). */ + public double renderMaxY; + /** The minimum Z value for rendering (default 0.0). */ + public double renderMinZ; + /** The maximum Z value for rendering (default 1.0). */ + public double renderMaxZ; + public boolean lockBlockBounds; + public boolean partialRenderBounds; + public final Minecraft minecraftRB; + public int uvRotateEast; + public int uvRotateWest; + public int uvRotateSouth; + public int uvRotateNorth; + public int uvRotateTop; + public int uvRotateBottom; + /** Whether ambient occlusion is enabled or not */ + public boolean enableAO; + /** Used as a scratch variable for ambient occlusion on the north/bottom/east corner. */ + public float aoLightValueScratchXYZNNN; + /** Used as a scratch variable for ambient occlusion between the bottom face and the north face. */ + public float aoLightValueScratchXYNN; + /** Used as a scratch variable for ambient occlusion on the north/bottom/west corner. */ + public float aoLightValueScratchXYZNNP; + /** Used as a scratch variable for ambient occlusion between the bottom face and the east face. */ + public float aoLightValueScratchYZNN; + /** Used as a scratch variable for ambient occlusion between the bottom face and the west face. */ + public float aoLightValueScratchYZNP; + /** Used as a scratch variable for ambient occlusion on the south/bottom/east corner. */ + public float aoLightValueScratchXYZPNN; + /** Used as a scratch variable for ambient occlusion between the bottom face and the south face. */ + public float aoLightValueScratchXYPN; + /** Used as a scratch variable for ambient occlusion on the south/bottom/west corner. */ + public float aoLightValueScratchXYZPNP; + /** Used as a scratch variable for ambient occlusion on the north/top/east corner. */ + public float aoLightValueScratchXYZNPN; + /** Used as a scratch variable for ambient occlusion between the top face and the north face. */ + public float aoLightValueScratchXYNP; + /** Used as a scratch variable for ambient occlusion on the north/top/west corner. */ + public float aoLightValueScratchXYZNPP; + /** Used as a scratch variable for ambient occlusion between the top face and the east face. */ + public float aoLightValueScratchYZPN; + /** Used as a scratch variable for ambient occlusion on the south/top/east corner. */ + public float aoLightValueScratchXYZPPN; + /** Used as a scratch variable for ambient occlusion between the top face and the south face. */ + public float aoLightValueScratchXYPP; + /** Used as a scratch variable for ambient occlusion between the top face and the west face. */ + public float aoLightValueScratchYZPP; + /** Used as a scratch variable for ambient occlusion on the south/top/west corner. */ + public float aoLightValueScratchXYZPPP; + /** Used as a scratch variable for ambient occlusion between the north face and the east face. */ + public float aoLightValueScratchXZNN; + /** Used as a scratch variable for ambient occlusion between the south face and the east face. */ + public float aoLightValueScratchXZPN; + /** Used as a scratch variable for ambient occlusion between the north face and the west face. */ + public float aoLightValueScratchXZNP; + /** Used as a scratch variable for ambient occlusion between the south face and the west face. */ + public float aoLightValueScratchXZPP; + /** Ambient occlusion brightness XYZNNN */ + public int aoBrightnessXYZNNN; + /** Ambient occlusion brightness XYNN */ + public int aoBrightnessXYNN; + /** Ambient occlusion brightness XYZNNP */ + public int aoBrightnessXYZNNP; + /** Ambient occlusion brightness YZNN */ + public int aoBrightnessYZNN; + /** Ambient occlusion brightness YZNP */ + public int aoBrightnessYZNP; + /** Ambient occlusion brightness XYZPNN */ + public int aoBrightnessXYZPNN; + /** Ambient occlusion brightness XYPN */ + public int aoBrightnessXYPN; + /** Ambient occlusion brightness XYZPNP */ + public int aoBrightnessXYZPNP; + /** Ambient occlusion brightness XYZNPN */ + public int aoBrightnessXYZNPN; + /** Ambient occlusion brightness XYNP */ + public int aoBrightnessXYNP; + /** Ambient occlusion brightness XYZNPP */ + public int aoBrightnessXYZNPP; + /** Ambient occlusion brightness YZPN */ + public int aoBrightnessYZPN; + /** Ambient occlusion brightness XYZPPN */ + public int aoBrightnessXYZPPN; + /** Ambient occlusion brightness XYPP */ + public int aoBrightnessXYPP; + /** Ambient occlusion brightness YZPP */ + public int aoBrightnessYZPP; + /** Ambient occlusion brightness XYZPPP */ + public int aoBrightnessXYZPPP; + /** Ambient occlusion brightness XZNN */ + public int aoBrightnessXZNN; + /** Ambient occlusion brightness XZPN */ + public int aoBrightnessXZPN; + /** Ambient occlusion brightness XZNP */ + public int aoBrightnessXZNP; + /** Ambient occlusion brightness XZPP */ + public int aoBrightnessXZPP; + /** Brightness top left */ + public int brightnessTopLeft; + /** Brightness bottom left */ + public int brightnessBottomLeft; + /** Brightness bottom right */ + public int brightnessBottomRight; + /** Brightness top right */ + public int brightnessTopRight; + /** Red color value for the top left corner */ + public float colorRedTopLeft; + /** Red color value for the bottom left corner */ + public float colorRedBottomLeft; + /** Red color value for the bottom right corner */ + public float colorRedBottomRight; + /** Red color value for the top right corner */ + public float colorRedTopRight; + /** Green color value for the top left corner */ + public float colorGreenTopLeft; + /** Green color value for the bottom left corner */ + public float colorGreenBottomLeft; + /** Green color value for the bottom right corner */ + public float colorGreenBottomRight; + /** Green color value for the top right corner */ + public float colorGreenTopRight; + /** Blue color value for the top left corner */ + public float colorBlueTopLeft; + /** Blue color value for the bottom left corner */ + public float colorBlueBottomLeft; + /** Blue color value for the bottom right corner */ + public float colorBlueBottomRight; + /** Blue color value for the top right corner */ + public float colorBlueTopRight; + private static final String __OBFID = "CL_00000940"; + + public RenderBlocks(IBlockAccess p_i1251_1_) + { + this.blockAccess = p_i1251_1_; + this.field_152631_f = false; + this.flipTexture = false; + this.minecraftRB = Minecraft.getMinecraft(); + } + + public RenderBlocks() + { + this.minecraftRB = Minecraft.getMinecraft(); + } + + /** + * Sets overrideBlockTexture + */ + public void setOverrideBlockTexture(IIcon p_147757_1_) + { + this.overrideBlockTexture = p_147757_1_; + } + + /** + * Clear override block texture + */ + public void clearOverrideBlockTexture() + { + this.overrideBlockTexture = null; + } + + public boolean hasOverrideBlockTexture() + { + return this.overrideBlockTexture != null; + } + + public void setRenderFromInside(boolean p_147786_1_) + { + this.renderFromInside = p_147786_1_; + } + + public void setRenderAllFaces(boolean p_147753_1_) + { + this.renderAllFaces = p_147753_1_; + } + + public void setRenderBounds(double p_147782_1_, double p_147782_3_, double p_147782_5_, double p_147782_7_, double p_147782_9_, double p_147782_11_) + { + if (!this.lockBlockBounds) + { + this.renderMinX = p_147782_1_; + this.renderMaxX = p_147782_7_; + this.renderMinY = p_147782_3_; + this.renderMaxY = p_147782_9_; + this.renderMinZ = p_147782_5_; + this.renderMaxZ = p_147782_11_; + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + } + + /** + * Like setRenderBounds, but automatically pulling the bounds from the given Block. + */ + public void setRenderBoundsFromBlock(Block p_147775_1_) + { + if (!this.lockBlockBounds) + { + this.renderMinX = p_147775_1_.getBlockBoundsMinX(); + this.renderMaxX = p_147775_1_.getBlockBoundsMaxX(); + this.renderMinY = p_147775_1_.getBlockBoundsMinY(); + this.renderMaxY = p_147775_1_.getBlockBoundsMaxY(); + this.renderMinZ = p_147775_1_.getBlockBoundsMinZ(); + this.renderMaxZ = p_147775_1_.getBlockBoundsMaxZ(); + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + } + + /** + * Like setRenderBounds, but locks the values so that RenderBlocks won't change them. If you use this, you must + * call unlockBlockBounds after you finish rendering! + */ + public void overrideBlockBounds(double p_147770_1_, double p_147770_3_, double p_147770_5_, double p_147770_7_, double p_147770_9_, double p_147770_11_) + { + this.renderMinX = p_147770_1_; + this.renderMaxX = p_147770_7_; + this.renderMinY = p_147770_3_; + this.renderMaxY = p_147770_9_; + this.renderMinZ = p_147770_5_; + this.renderMaxZ = p_147770_11_; + this.lockBlockBounds = true; + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + + /** + * Unlocks the visual bounding box so that RenderBlocks can change it again. + */ + public void unlockBlockBounds() + { + this.lockBlockBounds = false; + } + + /** + * Renders a block using the given texture instead of the block's own default texture + */ + public void renderBlockUsingTexture(Block p_147792_1_, int p_147792_2_, int p_147792_3_, int p_147792_4_, IIcon p_147792_5_) + { + this.setOverrideBlockTexture(p_147792_5_); + this.renderBlockByRenderType(p_147792_1_, p_147792_2_, p_147792_3_, p_147792_4_); + this.clearOverrideBlockTexture(); + } + + /** + * Render all faces of a block + */ + public void renderBlockAllFaces(Block p_147769_1_, int p_147769_2_, int p_147769_3_, int p_147769_4_) + { + this.renderAllFaces = true; + this.renderBlockByRenderType(p_147769_1_, p_147769_2_, p_147769_3_, p_147769_4_); + this.renderAllFaces = false; + } + + /** + * Renders the block at the given coordinates using the block's rendering type + */ + public boolean renderBlockByRenderType(Block p_147805_1_, int p_147805_2_, int p_147805_3_, int p_147805_4_) + { + int l = p_147805_1_.getRenderType(); + + if (l == -1) + { + return false; + } + else + { + p_147805_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147805_2_, p_147805_3_, p_147805_4_); + this.setRenderBoundsFromBlock(p_147805_1_); + + switch (l) + { + //regex: ' : \(l == ([\d]+) \?' replace: ';\ncase \1: return' ::: IMPORTANT: REMEMBER THIS ON FIRST line! + case 0 : return this.renderStandardBlock(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 4: return this.renderBlockLiquid(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 31: return this.renderBlockLog(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 1: return this.renderCrossedSquares(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 40: return this.renderBlockDoublePlant((BlockDoublePlant)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 2: return this.renderBlockTorch(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 20: return this.renderBlockVine(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 11: return this.renderBlockFence((BlockFence)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 39: return this.renderBlockQuartz(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 5: return this.renderBlockRedstoneWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 13: return this.renderBlockCactus(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 9: return this.renderBlockMinecartTrack((BlockRailBase)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 19: return this.renderBlockStem(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 23: return this.renderBlockLilyPad(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 6: return this.renderBlockCrops(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 3: return this.renderBlockFire((BlockFire)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 8: return this.renderBlockLadder(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 7: return this.renderBlockDoor(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 10: return this.renderBlockStairs((BlockStairs)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 27: return this.renderBlockDragonEgg((BlockDragonEgg)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 32: return this.renderBlockWall((BlockWall)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 12: return this.renderBlockLever(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 29: return this.renderBlockTripWireSource(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 30: return this.renderBlockTripWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 14: return this.renderBlockBed(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 15: return this.renderBlockRepeater((BlockRedstoneRepeater)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 36: return this.renderBlockRedstoneDiode((BlockRedstoneDiode)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 37: return this.renderBlockRedstoneComparator((BlockRedstoneComparator)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 16: return this.renderPistonBase(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, false) ; + case 17: return this.renderPistonExtension(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, true) ; + case 18: return this.renderBlockPane((BlockPane)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 41: return this.renderBlockStainedGlassPane(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 21: return this.renderBlockFenceGate((BlockFenceGate)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 24: return this.renderBlockCauldron((BlockCauldron)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 33: return this.renderBlockFlowerpot((BlockFlowerPot)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 35: return this.renderBlockAnvil((BlockAnvil)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 25: return this.renderBlockBrewingStand((BlockBrewingStand)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 26: return this.renderBlockEndPortalFrame((BlockEndPortalFrame)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 28: return this.renderBlockCocoa((BlockCocoa)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 34: return this.renderBlockBeacon((BlockBeacon)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; + case 38: return this.renderBlockHopper((BlockHopper)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_); + default: return FMLRenderAccessLibrary.renderWorldBlock(this, blockAccess, p_147805_2_, p_147805_3_, p_147805_4_, p_147805_1_, l); + } + } + } + + /** + * Render BlockEndPortalFrame + */ + public boolean renderBlockEndPortalFrame(BlockEndPortalFrame p_147743_1_, int p_147743_2_, int p_147743_3_, int p_147743_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147743_2_, p_147743_3_, p_147743_4_); + int i1 = l & 3; + + if (i1 == 0) + { + this.uvRotateTop = 3; + } + else if (i1 == 3) + { + this.uvRotateTop = 1; + } + else if (i1 == 1) + { + this.uvRotateTop = 2; + } + + if (!BlockEndPortalFrame.isEnderEyeInserted(l)) + { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.uvRotateTop = 0; + return true; + } + else + { + this.renderAllFaces = true; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.setOverrideBlockTexture(p_147743_1_.getIconEndPortalFrameEye()); + this.setRenderBounds(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); + this.renderStandardBlock(p_147743_1_, p_147743_2_, p_147743_3_, p_147743_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + this.uvRotateTop = 0; + return true; + } + } + + /** + * render a bed at the given coordinates + */ + public boolean renderBlockBed(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) + { + Tessellator tessellator = Tessellator.instance; + Block bed = this.blockAccess.getBlock(p_147773_2_, p_147773_3_, p_147773_4_); + int i1 = bed.getBedDirection(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); + boolean flag = bed.isBedFoot(blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); + float f = 0.5F; + float f1 = 1.0F; + float f2 = 0.8F; + float f3 = 0.6F; + int j1 = p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_); + tessellator.setBrightness(j1); + tessellator.setColorOpaque_F(f, f, f); + IIcon iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 0); + if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMaxU(); + double d2 = (double)iicon.getMinV(); + double d3 = (double)iicon.getMaxV(); + double d4 = (double)p_147773_2_ + this.renderMinX; + double d5 = (double)p_147773_2_ + this.renderMaxX; + double d6 = (double)p_147773_3_ + this.renderMinY + 0.1875D; + double d7 = (double)p_147773_4_ + this.renderMinZ; + double d8 = (double)p_147773_4_ + this.renderMaxZ; + tessellator.addVertexWithUV(d4, d6, d8, d0, d3); + tessellator.addVertexWithUV(d4, d6, d7, d0, d2); + tessellator.addVertexWithUV(d5, d6, d7, d1, d2); + tessellator.addVertexWithUV(d5, d6, d8, d1, d3); + tessellator.setBrightness(p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); + tessellator.setColorOpaque_F(f1, f1, f1); + iicon = this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 1); + if (hasOverrideBlockTexture()) iicon = overrideBlockTexture; //BugFix Proper breaking texture on underside + d0 = (double)iicon.getMinU(); + d1 = (double)iicon.getMaxU(); + d2 = (double)iicon.getMinV(); + d3 = (double)iicon.getMaxV(); + d4 = d0; + d5 = d1; + d6 = d2; + d7 = d2; + d8 = d0; + double d9 = d1; + double d10 = d3; + double d11 = d3; + + if (i1 == 0) + { + d5 = d0; + d6 = d3; + d8 = d1; + d11 = d2; + } + else if (i1 == 2) + { + d4 = d1; + d7 = d3; + d9 = d0; + d10 = d2; + } + else if (i1 == 3) + { + d4 = d1; + d7 = d3; + d9 = d0; + d10 = d2; + d5 = d0; + d6 = d3; + d8 = d1; + d11 = d2; + } + + double d12 = (double)p_147773_2_ + this.renderMinX; + double d13 = (double)p_147773_2_ + this.renderMaxX; + double d14 = (double)p_147773_3_ + this.renderMaxY; + double d15 = (double)p_147773_4_ + this.renderMinZ; + double d16 = (double)p_147773_4_ + this.renderMaxZ; + tessellator.addVertexWithUV(d13, d14, d16, d8, d10); + tessellator.addVertexWithUV(d13, d14, d15, d4, d6); + tessellator.addVertexWithUV(d12, d14, d15, d5, d7); + tessellator.addVertexWithUV(d12, d14, d16, d9, d11); + int k1 = Direction.directionToFacing[i1]; + + if (flag) + { + k1 = Direction.directionToFacing[Direction.rotateOpposite[i1]]; + } + + byte b0 = 4; + + switch (i1) + { + case 0: + b0 = 5; + break; + case 1: + b0 = 3; + case 2: + default: + break; + case 3: + b0 = 2; + } + + if (k1 != 2 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ - 1, 2))) + { + tessellator.setBrightness(this.renderMinZ > 0.0D ? j1 : p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ - 1)); + tessellator.setColorOpaque_F(f2, f2, f2); + this.flipTexture = b0 == 2; + this.renderFaceZNeg(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 2)); + } + + if (k1 != 3 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ + 1, 3))) + { + tessellator.setBrightness(this.renderMaxZ < 1.0D ? j1 : p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_ + 1)); + tessellator.setColorOpaque_F(f2, f2, f2); + this.flipTexture = b0 == 3; + this.renderFaceZPos(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 3)); + } + + if (k1 != 4 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_ - 1, p_147773_3_, p_147773_4_, 4))) + { + tessellator.setBrightness(this.renderMinZ > 0.0D ? j1 : p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_ - 1, p_147773_3_, p_147773_4_)); + tessellator.setColorOpaque_F(f3, f3, f3); + this.flipTexture = b0 == 4; + this.renderFaceXNeg(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 4)); + } + + if (k1 != 5 && (this.renderAllFaces || p_147773_1_.shouldSideBeRendered(this.blockAccess, p_147773_2_ + 1, p_147773_3_, p_147773_4_, 5))) + { + tessellator.setBrightness(this.renderMaxZ < 1.0D ? j1 : p_147773_1_.getMixedBrightnessForBlock(this.blockAccess, p_147773_2_ + 1, p_147773_3_, p_147773_4_)); + tessellator.setColorOpaque_F(f3, f3, f3); + this.flipTexture = b0 == 5; + this.renderFaceXPos(p_147773_1_, (double)p_147773_2_, (double)p_147773_3_, (double)p_147773_4_, this.getBlockIcon(p_147773_1_, this.blockAccess, p_147773_2_, p_147773_3_, p_147773_4_, 5)); + } + + this.flipTexture = false; + return true; + } + + /** + * Render BlockBrewingStand + */ + public boolean renderBlockBrewingStand(BlockBrewingStand p_147741_1_, int p_147741_2_, int p_147741_3_, int p_147741_4_) + { + this.setRenderBounds(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setOverrideBlockTexture(p_147741_1_.getIconBrewingStandBase()); + this.renderAllFaces = true; + this.setRenderBounds(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setRenderBounds(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.setRenderBounds(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); + this.renderStandardBlock(p_147741_1_, p_147741_2_, p_147741_3_, p_147741_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147741_1_.getMixedBrightnessForBlock(this.blockAccess, p_147741_2_, p_147741_3_, p_147741_4_)); + int l = p_147741_1_.colorMultiplier(this.blockAccess, p_147741_2_, p_147741_3_, p_147741_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147741_1_, 0, 0); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d8 = (double)iicon.getMinV(); + double d0 = (double)iicon.getMaxV(); + int i1 = this.blockAccess.getBlockMetadata(p_147741_2_, p_147741_3_, p_147741_4_); + + for (int j1 = 0; j1 < 3; ++j1) + { + double d1 = (double)j1 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D); + double d2 = (double)iicon.getInterpolatedU(8.0D); + double d3 = (double)iicon.getMaxU(); + + if ((i1 & 1 << j1) != 0) + { + d3 = (double)iicon.getMinU(); + } + + double d4 = (double)p_147741_2_ + 0.5D; + double d5 = (double)p_147741_2_ + 0.5D + Math.sin(d1) * 8.0D / 16.0D; + double d6 = (double)p_147741_4_ + 0.5D; + double d7 = (double)p_147741_4_ + 0.5D + Math.cos(d1) * 8.0D / 16.0D; + tessellator.addVertexWithUV(d4, (double)(p_147741_3_ + 1), d6, d2, d8); + tessellator.addVertexWithUV(d4, (double)(p_147741_3_ + 0), d6, d2, d0); + tessellator.addVertexWithUV(d5, (double)(p_147741_3_ + 0), d7, d3, d0); + tessellator.addVertexWithUV(d5, (double)(p_147741_3_ + 1), d7, d3, d8); + tessellator.addVertexWithUV(d5, (double)(p_147741_3_ + 1), d7, d3, d8); + tessellator.addVertexWithUV(d5, (double)(p_147741_3_ + 0), d7, d3, d0); + tessellator.addVertexWithUV(d4, (double)(p_147741_3_ + 0), d6, d2, d0); + tessellator.addVertexWithUV(d4, (double)(p_147741_3_ + 1), d6, d2, d8); + } + + p_147741_1_.setBlockBoundsForItemRender(); + return true; + } + + /** + * Render block cauldron + */ + public boolean renderBlockCauldron(BlockCauldron p_147785_1_, int p_147785_2_, int p_147785_3_, int p_147785_4_) + { + this.renderStandardBlock(p_147785_1_, p_147785_2_, p_147785_3_, p_147785_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147785_1_.getMixedBrightnessForBlock(this.blockAccess, p_147785_2_, p_147785_3_, p_147785_4_)); + int l = p_147785_1_.colorMultiplier(this.blockAccess, p_147785_2_, p_147785_3_, p_147785_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + float f4; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + IIcon iicon1 = p_147785_1_.getBlockTextureFromSide(2); + f4 = 0.125F; + this.renderFaceXPos(p_147785_1_, (double)((float)p_147785_2_ - 1.0F + f4), (double)p_147785_3_, (double)p_147785_4_, iicon1); + this.renderFaceXNeg(p_147785_1_, (double)((float)p_147785_2_ + 1.0F - f4), (double)p_147785_3_, (double)p_147785_4_, iicon1); + this.renderFaceZPos(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ - 1.0F + f4), iicon1); + this.renderFaceZNeg(p_147785_1_, (double)p_147785_2_, (double)p_147785_3_, (double)((float)p_147785_4_ + 1.0F - f4), iicon1); + IIcon iicon2 = BlockCauldron.getCauldronIcon("inner"); + this.renderFaceYPos(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + 0.25F), (double)p_147785_4_, iicon2); + this.renderFaceYNeg(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ + 1.0F - 0.75F), (double)p_147785_4_, iicon2); + int i1 = this.blockAccess.getBlockMetadata(p_147785_2_, p_147785_3_, p_147785_4_); + + if (i1 > 0) + { + IIcon iicon = BlockLiquid.getLiquidIcon("water_still"); + this.renderFaceYPos(p_147785_1_, (double)p_147785_2_, (double)((float)p_147785_3_ - 1.0F + BlockCauldron.getRenderLiquidLevel(i1)), (double)p_147785_4_, iicon); + } + + return true; + } + + /** + * Renders flower pot + */ + public boolean renderBlockFlowerpot(BlockFlowerPot p_147752_1_, int p_147752_2_, int p_147752_3_, int p_147752_4_) + { + this.renderStandardBlock(p_147752_1_, p_147752_2_, p_147752_3_, p_147752_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147752_1_.getMixedBrightnessForBlock(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_)); + int l = p_147752_1_.colorMultiplier(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_); + IIcon iicon = this.getBlockIconFromSide(p_147752_1_, 0); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + float f3; + + if (EntityRenderer.anaglyphEnable) + { + f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + f3 = 0.1865F; + this.renderFaceXPos(p_147752_1_, (double)((float)p_147752_2_ - 0.5F + f3), (double)p_147752_3_, (double)p_147752_4_, iicon); + this.renderFaceXNeg(p_147752_1_, (double)((float)p_147752_2_ + 0.5F - f3), (double)p_147752_3_, (double)p_147752_4_, iicon); + this.renderFaceZPos(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ - 0.5F + f3), iicon); + this.renderFaceZNeg(p_147752_1_, (double)p_147752_2_, (double)p_147752_3_, (double)((float)p_147752_4_ + 0.5F - f3), iicon); + this.renderFaceYPos(p_147752_1_, (double)p_147752_2_, (double)((float)p_147752_3_ - 0.5F + f3 + 0.1875F), (double)p_147752_4_, this.getBlockIcon(Blocks.dirt)); + TileEntity tileentity = this.blockAccess.getTileEntity(p_147752_2_, p_147752_3_, p_147752_4_); + + if (tileentity != null && tileentity instanceof TileEntityFlowerPot) + { + Item item = ((TileEntityFlowerPot)tileentity).getFlowerPotItem(); + int i1 = ((TileEntityFlowerPot)tileentity).getFlowerPotData(); + + if (item instanceof ItemBlock) + { + Block block = Block.getBlockFromItem(item); + int j1 = block.getRenderType(); + float f6 = 0.0F; + float f7 = 4.0F; + float f8 = 0.0F; + tessellator.addTranslation(f6 / 16.0F, f7 / 16.0F, f8 / 16.0F); + l = block.colorMultiplier(this.blockAccess, p_147752_2_, p_147752_3_, p_147752_4_); + + if (l != 16777215) + { + f = (float)(l >> 16 & 255) / 255.0F; + f1 = (float)(l >> 8 & 255) / 255.0F; + f2 = (float)(l & 255) / 255.0F; + tessellator.setColorOpaque_F(f, f1, f2); + } + + if (j1 == 1) + { + this.drawCrossedSquares(this.getBlockIconFromSideAndMetadata(block, 0, i1), (double)p_147752_2_, (double)p_147752_3_, (double)p_147752_4_, 0.75F); + } + else if (j1 == 13) + { + this.renderAllFaces = true; + float f9 = 0.125F; + this.setRenderBounds((double)(0.5F - f9), 0.0D, (double)(0.5F - f9), (double)(0.5F + f9), 0.25D, (double)(0.5F + f9)); + this.renderStandardBlock(block, p_147752_2_, p_147752_3_, p_147752_4_); + this.setRenderBounds((double)(0.5F - f9), 0.25D, (double)(0.5F - f9), (double)(0.5F + f9), 0.5D, (double)(0.5F + f9)); + this.renderStandardBlock(block, p_147752_2_, p_147752_3_, p_147752_4_); + this.setRenderBounds((double)(0.5F - f9), 0.5D, (double)(0.5F - f9), (double)(0.5F + f9), 0.75D, (double)(0.5F + f9)); + this.renderStandardBlock(block, p_147752_2_, p_147752_3_, p_147752_4_); + this.renderAllFaces = false; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + + tessellator.addTranslation(-f6 / 16.0F, -f7 / 16.0F, -f8 / 16.0F); + } + } + + return true; + } + + /** + * Renders anvil + */ + public boolean renderBlockAnvil(BlockAnvil p_147725_1_, int p_147725_2_, int p_147725_3_, int p_147725_4_) + { + return this.renderBlockAnvilMetadata(p_147725_1_, p_147725_2_, p_147725_3_, p_147725_4_, this.blockAccess.getBlockMetadata(p_147725_2_, p_147725_3_, p_147725_4_)); + } + + /** + * Renders anvil block with metadata + */ + public boolean renderBlockAnvilMetadata(BlockAnvil p_147780_1_, int p_147780_2_, int p_147780_3_, int p_147780_4_, int p_147780_5_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147780_1_.getMixedBrightnessForBlock(this.blockAccess, p_147780_2_, p_147780_3_, p_147780_4_)); + int i1 = p_147780_1_.colorMultiplier(this.blockAccess, p_147780_2_, p_147780_3_, p_147780_4_); + float f = (float)(i1 >> 16 & 255) / 255.0F; + float f1 = (float)(i1 >> 8 & 255) / 255.0F; + float f2 = (float)(i1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + return this.renderBlockAnvilOrient(p_147780_1_, p_147780_2_, p_147780_3_, p_147780_4_, p_147780_5_, false); + } + + /** + * Renders anvil block with orientation + */ + public boolean renderBlockAnvilOrient(BlockAnvil p_147728_1_, int p_147728_2_, int p_147728_3_, int p_147728_4_, int p_147728_5_, boolean p_147728_6_) + { + int i1 = p_147728_6_ ? 0 : p_147728_5_ & 3; + boolean flag1 = false; + float f = 0.0F; + + switch (i1) + { + case 0: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + break; + case 1: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + flag1 = true; + break; + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + break; + case 3: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + flag1 = true; + } + + f = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 0, f, 0.75F, 0.25F, 0.75F, flag1, p_147728_6_, p_147728_5_); + f = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 1, f, 0.5F, 0.0625F, 0.625F, flag1, p_147728_6_, p_147728_5_); + f = this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 2, f, 0.25F, 0.3125F, 0.5F, flag1, p_147728_6_, p_147728_5_); + this.renderBlockAnvilRotate(p_147728_1_, p_147728_2_, p_147728_3_, p_147728_4_, 3, f, 0.625F, 0.375F, 1.0F, flag1, p_147728_6_, p_147728_5_); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return true; + } + + /** + * Renders anvil block with rotation + */ + public float renderBlockAnvilRotate(BlockAnvil p_147737_1_, int p_147737_2_, int p_147737_3_, int p_147737_4_, int p_147737_5_, float p_147737_6_, float p_147737_7_, float p_147737_8_, float p_147737_9_, boolean p_147737_10_, boolean p_147737_11_, int p_147737_12_) + { + if (p_147737_10_) + { + float f4 = p_147737_7_; + p_147737_7_ = p_147737_9_; + p_147737_9_ = f4; + } + + p_147737_7_ /= 2.0F; + p_147737_9_ /= 2.0F; + p_147737_1_.anvilRenderSide = p_147737_5_; + this.setRenderBounds((double)(0.5F - p_147737_7_), (double)p_147737_6_, (double)(0.5F - p_147737_9_), (double)(0.5F + p_147737_7_), (double)(p_147737_6_ + p_147737_8_), (double)(0.5F + p_147737_9_)); + + if (p_147737_11_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 0, p_147737_12_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 1, p_147737_12_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 2, p_147737_12_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 3, p_147737_12_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 4, p_147737_12_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147737_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147737_1_, 5, p_147737_12_)); + tessellator.draw(); + } + else + { + this.renderStandardBlock(p_147737_1_, p_147737_2_, p_147737_3_, p_147737_4_); + } + + return p_147737_6_ + p_147737_8_; + } + + /** + * Renders a torch block at the given coordinates + */ + public boolean renderBlockTorch(Block p_147791_1_, int p_147791_2_, int p_147791_3_, int p_147791_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147791_2_, p_147791_3_, p_147791_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147791_1_.getMixedBrightnessForBlock(this.blockAccess, p_147791_2_, p_147791_3_, p_147791_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = 0.4000000059604645D; + double d1 = 0.5D - d0; + double d2 = 0.20000000298023224D; + + if (l == 1) + { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_ - d1, (double)p_147791_3_ + d2, (double)p_147791_4_, -d0, 0.0D, 0); + } + else if (l == 2) + { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_ + d1, (double)p_147791_3_ + d2, (double)p_147791_4_, d0, 0.0D, 0); + } + else if (l == 3) + { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + d2, (double)p_147791_4_ - d1, 0.0D, -d0, 0); + } + else if (l == 4) + { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_ + d2, (double)p_147791_4_ + d1, 0.0D, d0, 0); + } + else + { + this.renderTorchAtAngle(p_147791_1_, (double)p_147791_2_, (double)p_147791_3_, (double)p_147791_4_, 0.0D, 0.0D, 0); + } + + return true; + } + + /** + * render a redstone repeater at the given coordinates + */ + public boolean renderBlockRepeater(BlockRedstoneRepeater p_147759_1_, int p_147759_2_, int p_147759_3_, int p_147759_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147759_2_, p_147759_3_, p_147759_4_); + int i1 = l & 3; + int j1 = (l & 12) >> 2; + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147759_1_.getMixedBrightnessForBlock(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = -0.1875D; + boolean flag = p_147759_1_.func_149910_g(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_, l); + double d1 = 0.0D; + double d2 = 0.0D; + double d3 = 0.0D; + double d4 = 0.0D; + + switch (i1) + { + case 0: + d4 = -0.3125D; + d2 = BlockRedstoneRepeater.repeaterTorchOffset[j1]; + break; + case 1: + d3 = 0.3125D; + d1 = -BlockRedstoneRepeater.repeaterTorchOffset[j1]; + break; + case 2: + d4 = 0.3125D; + d2 = -BlockRedstoneRepeater.repeaterTorchOffset[j1]; + break; + case 3: + d3 = -0.3125D; + d1 = BlockRedstoneRepeater.repeaterTorchOffset[j1]; + } + + if (!flag) + { + this.renderTorchAtAngle(p_147759_1_, (double)p_147759_2_ + d1, (double)p_147759_3_ + d0, (double)p_147759_4_ + d2, 0.0D, 0.0D, 0); + } + else + { + IIcon iicon = this.getBlockIcon(Blocks.bedrock); + this.setOverrideBlockTexture(iicon); + float f = 2.0F; + float f1 = 14.0F; + float f2 = 7.0F; + float f3 = 9.0F; + + switch (i1) + { + case 1: + case 3: + f = 7.0F; + f1 = 9.0F; + f2 = 2.0F; + f3 = 14.0F; + case 0: + case 2: + default: + this.setRenderBounds((double)(f / 16.0F + (float)d1), 0.125D, (double)(f2 / 16.0F + (float)d2), (double)(f1 / 16.0F + (float)d1), 0.25D, (double)(f3 / 16.0F + (float)d2)); + double d5 = (double)iicon.getInterpolatedU((double)f); + double d6 = (double)iicon.getInterpolatedV((double)f2); + double d7 = (double)iicon.getInterpolatedU((double)f1); + double d8 = (double)iicon.getInterpolatedV((double)f3); + tessellator.addVertexWithUV((double)((float)p_147759_2_ + f / 16.0F) + d1, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + f2 / 16.0F) + d2, d5, d6); + tessellator.addVertexWithUV((double)((float)p_147759_2_ + f / 16.0F) + d1, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + f3 / 16.0F) + d2, d5, d8); + tessellator.addVertexWithUV((double)((float)p_147759_2_ + f1 / 16.0F) + d1, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + f3 / 16.0F) + d2, d7, d8); + tessellator.addVertexWithUV((double)((float)p_147759_2_ + f1 / 16.0F) + d1, (double)((float)p_147759_3_ + 0.25F), (double)((float)p_147759_4_ + f2 / 16.0F) + d2, d7, d6); + this.renderStandardBlock(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); + this.clearOverrideBlockTexture(); + } + } + + tessellator.setBrightness(p_147759_1_.getMixedBrightnessForBlock(this.blockAccess, p_147759_2_, p_147759_3_, p_147759_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + this.renderTorchAtAngle(p_147759_1_, (double)p_147759_2_ + d3, (double)p_147759_3_ + d0, (double)p_147759_4_ + d4, 0.0D, 0.0D, 0); + this.renderBlockRedstoneDiode(p_147759_1_, p_147759_2_, p_147759_3_, p_147759_4_); + return true; + } + + public boolean renderBlockRedstoneComparator(BlockRedstoneComparator p_147781_1_, int p_147781_2_, int p_147781_3_, int p_147781_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147781_1_.getMixedBrightnessForBlock(this.blockAccess, p_147781_2_, p_147781_3_, p_147781_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int l = this.blockAccess.getBlockMetadata(p_147781_2_, p_147781_3_, p_147781_4_); + int i1 = l & 3; + double d0 = 0.0D; + double d1 = -0.1875D; + double d2 = 0.0D; + double d3 = 0.0D; + double d4 = 0.0D; + IIcon iicon; + + if (p_147781_1_.func_149969_d(l)) + { + iicon = Blocks.redstone_torch.getBlockTextureFromSide(0); + } + else + { + d1 -= 0.1875D; + iicon = Blocks.unlit_redstone_torch.getBlockTextureFromSide(0); + } + + switch (i1) + { + case 0: + d2 = -0.3125D; + d4 = 1.0D; + break; + case 1: + d0 = 0.3125D; + d3 = -1.0D; + break; + case 2: + d2 = 0.3125D; + d4 = -1.0D; + break; + case 3: + d0 = -0.3125D; + d3 = 1.0D; + } + + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + 0.25D * d3 + 0.1875D * d4, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * d4 + 0.1875D * d3, 0.0D, 0.0D, l); + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + 0.25D * d3 + -0.1875D * d4, (double)((float)p_147781_3_ - 0.1875F), (double)p_147781_4_ + 0.25D * d4 + -0.1875D * d3, 0.0D, 0.0D, l); + this.setOverrideBlockTexture(iicon); + this.renderTorchAtAngle(p_147781_1_, (double)p_147781_2_ + d0, (double)p_147781_3_ + d1, (double)p_147781_4_ + d2, 0.0D, 0.0D, l); + this.clearOverrideBlockTexture(); + this.renderBlockRedstoneDiodeMetadata(p_147781_1_, p_147781_2_, p_147781_3_, p_147781_4_, i1); + return true; + } + + public boolean renderBlockRedstoneDiode(BlockRedstoneDiode p_147748_1_, int p_147748_2_, int p_147748_3_, int p_147748_4_) + { + Tessellator tessellator = Tessellator.instance; + this.renderBlockRedstoneDiodeMetadata(p_147748_1_, p_147748_2_, p_147748_3_, p_147748_4_, this.blockAccess.getBlockMetadata(p_147748_2_, p_147748_3_, p_147748_4_) & 3); + return true; + } + + public void renderBlockRedstoneDiodeMetadata(BlockRedstoneDiode p_147732_1_, int p_147732_2_, int p_147732_3_, int p_147732_4_, int p_147732_5_) + { + this.renderStandardBlock(p_147732_1_, p_147732_2_, p_147732_3_, p_147732_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147732_1_.getMixedBrightnessForBlock(this.blockAccess, p_147732_2_, p_147732_3_, p_147732_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int i1 = this.blockAccess.getBlockMetadata(p_147732_2_, p_147732_3_, p_147732_4_); + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147732_1_, 1, i1); + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMaxU(); + double d2 = (double)iicon.getMinV(); + double d3 = (double)iicon.getMaxV(); + double d4 = 0.125D; + double d5 = (double)(p_147732_2_ + 1); + double d6 = (double)(p_147732_2_ + 1); + double d7 = (double)(p_147732_2_ + 0); + double d8 = (double)(p_147732_2_ + 0); + double d9 = (double)(p_147732_4_ + 0); + double d10 = (double)(p_147732_4_ + 1); + double d11 = (double)(p_147732_4_ + 1); + double d12 = (double)(p_147732_4_ + 0); + double d13 = (double)p_147732_3_ + d4; + + if (p_147732_5_ == 2) + { + d5 = d6 = (double)(p_147732_2_ + 0); + d7 = d8 = (double)(p_147732_2_ + 1); + d9 = d12 = (double)(p_147732_4_ + 1); + d10 = d11 = (double)(p_147732_4_ + 0); + } + else if (p_147732_5_ == 3) + { + d5 = d8 = (double)(p_147732_2_ + 0); + d6 = d7 = (double)(p_147732_2_ + 1); + d9 = d10 = (double)(p_147732_4_ + 0); + d11 = d12 = (double)(p_147732_4_ + 1); + } + else if (p_147732_5_ == 1) + { + d5 = d8 = (double)(p_147732_2_ + 1); + d6 = d7 = (double)(p_147732_2_ + 0); + d9 = d10 = (double)(p_147732_4_ + 1); + d11 = d12 = (double)(p_147732_4_ + 0); + } + + tessellator.addVertexWithUV(d8, d13, d12, d0, d2); + tessellator.addVertexWithUV(d7, d13, d11, d0, d3); + tessellator.addVertexWithUV(d6, d13, d10, d1, d3); + tessellator.addVertexWithUV(d5, d13, d9, d1, d2); + } + + /** + * Render all faces of the piston base + */ + public void renderPistonBaseAllFaces(Block p_147804_1_, int p_147804_2_, int p_147804_3_, int p_147804_4_) + { + this.renderAllFaces = true; + this.renderPistonBase(p_147804_1_, p_147804_2_, p_147804_3_, p_147804_4_, true); + this.renderAllFaces = false; + } + + /** + * renders a block as a piston base + */ + public boolean renderPistonBase(Block p_147731_1_, int p_147731_2_, int p_147731_3_, int p_147731_4_, boolean p_147731_5_) + { + int l = this.blockAccess.getBlockMetadata(p_147731_2_, p_147731_3_, p_147731_4_); + boolean flag1 = p_147731_5_ || (l & 8) != 0; + int i1 = BlockPistonBase.getPistonOrientation(l); + float f = 0.25F; + + if (flag1) + { + switch (i1) + { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + case 1: + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); + break; + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); + break; + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); + break; + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + break; + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); + } + + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); + this.renderStandardBlock(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + ((BlockPistonBase)p_147731_1_).func_150070_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); + } + else + { + switch (i1) + { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + case 1: + default: + break; + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + break; + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + break; + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + break; + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + } + + this.renderStandardBlock(p_147731_1_, p_147731_2_, p_147731_3_, p_147731_4_); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + } + + return true; + } + + /** + * Render piston rod up/down + */ + public void renderPistonRodUD(double p_147763_1_, double p_147763_3_, double p_147763_5_, double p_147763_7_, double p_147763_9_, double p_147763_11_, float p_147763_13_, double p_147763_14_) + { + IIcon iicon = BlockPistonBase.getPistonBaseIcon("piston_side"); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + Tessellator tessellator = Tessellator.instance; + double d7 = (double)iicon.getMinU(); + double d8 = (double)iicon.getMinV(); + double d9 = (double)iicon.getInterpolatedU(p_147763_14_); + double d10 = (double)iicon.getInterpolatedV(4.0D); + tessellator.setColorOpaque_F(p_147763_13_, p_147763_13_, p_147763_13_); + tessellator.addVertexWithUV(p_147763_1_, p_147763_7_, p_147763_9_, d9, d8); + tessellator.addVertexWithUV(p_147763_1_, p_147763_5_, p_147763_9_, d7, d8); + tessellator.addVertexWithUV(p_147763_3_, p_147763_5_, p_147763_11_, d7, d10); + tessellator.addVertexWithUV(p_147763_3_, p_147763_7_, p_147763_11_, d9, d10); + } + + /** + * Render piston rod south/north + */ + public void renderPistonRodSN(double p_147789_1_, double p_147789_3_, double p_147789_5_, double p_147789_7_, double p_147789_9_, double p_147789_11_, float p_147789_13_, double p_147789_14_) + { + IIcon iicon = BlockPistonBase.getPistonBaseIcon("piston_side"); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + Tessellator tessellator = Tessellator.instance; + double d7 = (double)iicon.getMinU(); + double d8 = (double)iicon.getMinV(); + double d9 = (double)iicon.getInterpolatedU(p_147789_14_); + double d10 = (double)iicon.getInterpolatedV(4.0D); + tessellator.setColorOpaque_F(p_147789_13_, p_147789_13_, p_147789_13_); + tessellator.addVertexWithUV(p_147789_1_, p_147789_5_, p_147789_11_, d9, d8); + tessellator.addVertexWithUV(p_147789_1_, p_147789_5_, p_147789_9_, d7, d8); + tessellator.addVertexWithUV(p_147789_3_, p_147789_7_, p_147789_9_, d7, d10); + tessellator.addVertexWithUV(p_147789_3_, p_147789_7_, p_147789_11_, d9, d10); + } + + /** + * Render piston rod east/west + */ + public void renderPistonRodEW(double p_147738_1_, double p_147738_3_, double p_147738_5_, double p_147738_7_, double p_147738_9_, double p_147738_11_, float p_147738_13_, double p_147738_14_) + { + IIcon iicon = BlockPistonBase.getPistonBaseIcon("piston_side"); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + Tessellator tessellator = Tessellator.instance; + double d7 = (double)iicon.getMinU(); + double d8 = (double)iicon.getMinV(); + double d9 = (double)iicon.getInterpolatedU(p_147738_14_); + double d10 = (double)iicon.getInterpolatedV(4.0D); + tessellator.setColorOpaque_F(p_147738_13_, p_147738_13_, p_147738_13_); + tessellator.addVertexWithUV(p_147738_3_, p_147738_5_, p_147738_9_, d9, d8); + tessellator.addVertexWithUV(p_147738_1_, p_147738_5_, p_147738_9_, d7, d8); + tessellator.addVertexWithUV(p_147738_1_, p_147738_7_, p_147738_11_, d7, d10); + tessellator.addVertexWithUV(p_147738_3_, p_147738_7_, p_147738_11_, d9, d10); + } + + /** + * Render all faces of the piston extension + */ + public void renderPistonExtensionAllFaces(Block p_147750_1_, int p_147750_2_, int p_147750_3_, int p_147750_4_, boolean p_147750_5_) + { + this.renderAllFaces = true; + this.renderPistonExtension(p_147750_1_, p_147750_2_, p_147750_3_, p_147750_4_, p_147750_5_); + this.renderAllFaces = false; + } + + /** + * renders the pushing part of a piston + */ + public boolean renderPistonExtension(Block p_147809_1_, int p_147809_2_, int p_147809_3_, int p_147809_4_, boolean p_147809_5_) + { + int l = this.blockAccess.getBlockMetadata(p_147809_2_, p_147809_3_, p_147809_4_); + int i1 = BlockPistonExtension.getDirectionMeta(l); + float f = 0.25F; + float f1 = 0.375F; + float f2 = 0.625F; + float f3 = p_147809_5_ ? 1.0F : 0.5F; + double d0 = p_147809_5_ ? 16.0D : 8.0D; + + switch (i1) + { + case 0: + this.uvRotateEast = 3; + this.uvRotateWest = 3; + this.uvRotateSouth = 3; + this.uvRotateNorth = 3; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + f3), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.8F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + f3), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.8F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + f3), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 0.6F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.25F), (double)((float)p_147809_3_ + 0.25F + f3), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.6F, d0); + break; + case 1: + this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - f3), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.8F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - f3), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.8F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ - 0.25F + 1.0F - f3), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 0.6F, d0); + this.renderPistonRodUD((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ - 0.25F + 1.0F - f3), (double)((float)p_147809_3_ - 0.25F + 1.0F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.6F, d0); + break; + case 2: + this.uvRotateSouth = 1; + this.uvRotateNorth = 2; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + f3), 0.6F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + f3), 0.6F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + f3), 0.5F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.25F), (double)((float)p_147809_4_ + 0.25F + f3), 1.0F, d0); + break; + case 3: + this.uvRotateSouth = 2; + this.uvRotateNorth = 1; + this.uvRotateTop = 3; + this.uvRotateBottom = 3; + this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - f3), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.6F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - f3), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.6F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ - 0.25F + 1.0F - f3), (double)((float)p_147809_4_ - 0.25F + 1.0F), 0.5F, d0); + this.renderPistonRodSN((double)((float)p_147809_2_ + 0.625F), (double)((float)p_147809_2_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ - 0.25F + 1.0F - f3), (double)((float)p_147809_4_ - 0.25F + 1.0F), 1.0F, d0); + break; + case 4: + this.uvRotateEast = 1; + this.uvRotateWest = 2; + this.uvRotateTop = 2; + this.uvRotateBottom = 1; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + f3), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.5F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + f3), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + f3), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.6F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ + 0.25F), (double)((float)p_147809_2_ + 0.25F + f3), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.6F, d0); + break; + case 5: + this.uvRotateEast = 2; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 2; + this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147809_1_, p_147809_2_, p_147809_3_, p_147809_4_); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - f3), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), 0.5F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - f3), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), 1.0F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - f3), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_4_ + 0.375F), (double)((float)p_147809_4_ + 0.375F), 0.6F, d0); + this.renderPistonRodEW((double)((float)p_147809_2_ - 0.25F + 1.0F - f3), (double)((float)p_147809_2_ - 0.25F + 1.0F), (double)((float)p_147809_3_ + 0.625F), (double)((float)p_147809_3_ + 0.375F), (double)((float)p_147809_4_ + 0.625F), (double)((float)p_147809_4_ + 0.625F), 0.6F, d0); + } + + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return true; + } + + /** + * Renders a lever block at the given coordinates + */ + public boolean renderBlockLever(Block p_147790_1_, int p_147790_2_, int p_147790_3_, int p_147790_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147790_2_, p_147790_3_, p_147790_4_); + int i1 = l & 7; + boolean flag = (l & 8) > 0; + Tessellator tessellator = Tessellator.instance; + boolean flag1 = this.hasOverrideBlockTexture(); + + if (!flag1) + { + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.cobblestone)); + } + + float f = 0.25F; + float f1 = 0.1875F; + float f2 = 0.1875F; + + if (i1 == 5) + { + this.setRenderBounds((double)(0.5F - f1), 0.0D, (double)(0.5F - f), (double)(0.5F + f1), (double)f2, (double)(0.5F + f)); + } + else if (i1 == 6) + { + this.setRenderBounds((double)(0.5F - f), 0.0D, (double)(0.5F - f1), (double)(0.5F + f), (double)f2, (double)(0.5F + f1)); + } + else if (i1 == 4) + { + this.setRenderBounds((double)(0.5F - f1), (double)(0.5F - f), (double)(1.0F - f2), (double)(0.5F + f1), (double)(0.5F + f), 1.0D); + } + else if (i1 == 3) + { + this.setRenderBounds((double)(0.5F - f1), (double)(0.5F - f), 0.0D, (double)(0.5F + f1), (double)(0.5F + f), (double)f2); + } + else if (i1 == 2) + { + this.setRenderBounds((double)(1.0F - f2), (double)(0.5F - f), (double)(0.5F - f1), 1.0D, (double)(0.5F + f), (double)(0.5F + f1)); + } + else if (i1 == 1) + { + this.setRenderBounds(0.0D, (double)(0.5F - f), (double)(0.5F - f1), (double)f2, (double)(0.5F + f), (double)(0.5F + f1)); + } + else if (i1 == 0) + { + this.setRenderBounds((double)(0.5F - f), (double)(1.0F - f2), (double)(0.5F - f1), (double)(0.5F + f), 1.0D, (double)(0.5F + f1)); + } + else if (i1 == 7) + { + this.setRenderBounds((double)(0.5F - f1), (double)(1.0F - f2), (double)(0.5F - f), (double)(0.5F + f1), 1.0D, (double)(0.5F + f)); + } + + this.renderStandardBlock(p_147790_1_, p_147790_2_, p_147790_3_, p_147790_4_); + + if (!flag1) + { + this.clearOverrideBlockTexture(); + } + + tessellator.setBrightness(p_147790_1_.getMixedBrightnessForBlock(this.blockAccess, p_147790_2_, p_147790_3_, p_147790_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + IIcon iicon = this.getBlockIconFromSide(p_147790_1_, 0); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMinV(); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMaxV(); + Vec3[] avec3 = new Vec3[8]; + float f3 = 0.0625F; + float f4 = 0.0625F; + float f5 = 0.625F; + avec3[0] = Vec3.createVectorHelper((double)(-f3), 0.0D, (double)(-f4)); + avec3[1] = Vec3.createVectorHelper((double)f3, 0.0D, (double)(-f4)); + avec3[2] = Vec3.createVectorHelper((double)f3, 0.0D, (double)f4); + avec3[3] = Vec3.createVectorHelper((double)(-f3), 0.0D, (double)f4); + avec3[4] = Vec3.createVectorHelper((double)(-f3), (double)f5, (double)(-f4)); + avec3[5] = Vec3.createVectorHelper((double)f3, (double)f5, (double)(-f4)); + avec3[6] = Vec3.createVectorHelper((double)f3, (double)f5, (double)f4); + avec3[7] = Vec3.createVectorHelper((double)(-f3), (double)f5, (double)f4); + + for (int j1 = 0; j1 < 8; ++j1) + { + if (flag) + { + avec3[j1].zCoord -= 0.0625D; + avec3[j1].rotateAroundX(((float)Math.PI * 2F / 9F)); + } + else + { + avec3[j1].zCoord += 0.0625D; + avec3[j1].rotateAroundX(-((float)Math.PI * 2F / 9F)); + } + + if (i1 == 0 || i1 == 7) + { + avec3[j1].rotateAroundZ((float)Math.PI); + } + + if (i1 == 6 || i1 == 0) + { + avec3[j1].rotateAroundY(((float)Math.PI / 2F)); + } + + if (i1 > 0 && i1 < 5) + { + avec3[j1].yCoord -= 0.375D; + avec3[j1].rotateAroundX(((float)Math.PI / 2F)); + + if (i1 == 4) + { + avec3[j1].rotateAroundY(0.0F); + } + + if (i1 == 3) + { + avec3[j1].rotateAroundY((float)Math.PI); + } + + if (i1 == 2) + { + avec3[j1].rotateAroundY(((float)Math.PI / 2F)); + } + + if (i1 == 1) + { + avec3[j1].rotateAroundY(-((float)Math.PI / 2F)); + } + + avec3[j1].xCoord += (double)p_147790_2_ + 0.5D; + avec3[j1].yCoord += (double)((float)p_147790_3_ + 0.5F); + avec3[j1].zCoord += (double)p_147790_4_ + 0.5D; + } + else if (i1 != 0 && i1 != 7) + { + avec3[j1].xCoord += (double)p_147790_2_ + 0.5D; + avec3[j1].yCoord += (double)((float)p_147790_3_ + 0.125F); + avec3[j1].zCoord += (double)p_147790_4_ + 0.5D; + } + else + { + avec3[j1].xCoord += (double)p_147790_2_ + 0.5D; + avec3[j1].yCoord += (double)((float)p_147790_3_ + 0.875F); + avec3[j1].zCoord += (double)p_147790_4_ + 0.5D; + } + } + + Vec3 vec33 = null; + Vec3 vec3 = null; + Vec3 vec31 = null; + Vec3 vec32 = null; + + for (int k1 = 0; k1 < 6; ++k1) + { + if (k1 == 0) + { + d0 = (double)iicon.getInterpolatedU(7.0D); + d1 = (double)iicon.getInterpolatedV(6.0D); + d2 = (double)iicon.getInterpolatedU(9.0D); + d3 = (double)iicon.getInterpolatedV(8.0D); + } + else if (k1 == 2) + { + d0 = (double)iicon.getInterpolatedU(7.0D); + d1 = (double)iicon.getInterpolatedV(6.0D); + d2 = (double)iicon.getInterpolatedU(9.0D); + d3 = (double)iicon.getMaxV(); + } + + if (k1 == 0) + { + vec33 = avec3[0]; + vec3 = avec3[1]; + vec31 = avec3[2]; + vec32 = avec3[3]; + } + else if (k1 == 1) + { + vec33 = avec3[7]; + vec3 = avec3[6]; + vec31 = avec3[5]; + vec32 = avec3[4]; + } + else if (k1 == 2) + { + vec33 = avec3[1]; + vec3 = avec3[0]; + vec31 = avec3[4]; + vec32 = avec3[5]; + } + else if (k1 == 3) + { + vec33 = avec3[2]; + vec3 = avec3[1]; + vec31 = avec3[5]; + vec32 = avec3[6]; + } + else if (k1 == 4) + { + vec33 = avec3[3]; + vec3 = avec3[2]; + vec31 = avec3[6]; + vec32 = avec3[7]; + } + else if (k1 == 5) + { + vec33 = avec3[0]; + vec3 = avec3[3]; + vec31 = avec3[7]; + vec32 = avec3[4]; + } + + tessellator.addVertexWithUV(vec33.xCoord, vec33.yCoord, vec33.zCoord, d0, d3); + tessellator.addVertexWithUV(vec3.xCoord, vec3.yCoord, vec3.zCoord, d2, d3); + tessellator.addVertexWithUV(vec31.xCoord, vec31.yCoord, vec31.zCoord, d2, d1); + tessellator.addVertexWithUV(vec32.xCoord, vec32.yCoord, vec32.zCoord, d0, d1); + } + + return true; + } + + /** + * Renders a trip wire source block at the given coordinates + */ + public boolean renderBlockTripWireSource(Block p_147723_1_, int p_147723_2_, int p_147723_3_, int p_147723_4_) + { + Tessellator tessellator = Tessellator.instance; + int l = this.blockAccess.getBlockMetadata(p_147723_2_, p_147723_3_, p_147723_4_); + int i1 = l & 3; + boolean flag = (l & 4) == 4; + boolean flag1 = (l & 8) == 8; + boolean flag2 = !World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147723_2_, p_147723_3_ - 1, p_147723_4_); + boolean flag3 = this.hasOverrideBlockTexture(); + + if (!flag3) + { + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.planks)); + } + + float f = 0.25F; + float f1 = 0.125F; + float f2 = 0.125F; + float f3 = 0.3F - f; + float f4 = 0.3F + f; + + if (i1 == 2) + { + this.setRenderBounds((double)(0.5F - f1), (double)f3, (double)(1.0F - f2), (double)(0.5F + f1), (double)f4, 1.0D); + } + else if (i1 == 0) + { + this.setRenderBounds((double)(0.5F - f1), (double)f3, 0.0D, (double)(0.5F + f1), (double)f4, (double)f2); + } + else if (i1 == 1) + { + this.setRenderBounds((double)(1.0F - f2), (double)f3, (double)(0.5F - f1), 1.0D, (double)f4, (double)(0.5F + f1)); + } + else if (i1 == 3) + { + this.setRenderBounds(0.0D, (double)f3, (double)(0.5F - f1), (double)f2, (double)f4, (double)(0.5F + f1)); + } + + this.renderStandardBlock(p_147723_1_, p_147723_2_, p_147723_3_, p_147723_4_); + + if (!flag3) + { + this.clearOverrideBlockTexture(); + } + + tessellator.setBrightness(p_147723_1_.getMixedBrightnessForBlock(this.blockAccess, p_147723_2_, p_147723_3_, p_147723_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + IIcon iicon = this.getBlockIconFromSide(p_147723_1_, 0); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMinV(); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMaxV(); + Vec3[] avec3 = new Vec3[8]; + float f5 = 0.046875F; + float f6 = 0.046875F; + float f7 = 0.3125F; + avec3[0] = Vec3.createVectorHelper((double)(-f5), 0.0D, (double)(-f6)); + avec3[1] = Vec3.createVectorHelper((double)f5, 0.0D, (double)(-f6)); + avec3[2] = Vec3.createVectorHelper((double)f5, 0.0D, (double)f6); + avec3[3] = Vec3.createVectorHelper((double)(-f5), 0.0D, (double)f6); + avec3[4] = Vec3.createVectorHelper((double)(-f5), (double)f7, (double)(-f6)); + avec3[5] = Vec3.createVectorHelper((double)f5, (double)f7, (double)(-f6)); + avec3[6] = Vec3.createVectorHelper((double)f5, (double)f7, (double)f6); + avec3[7] = Vec3.createVectorHelper((double)(-f5), (double)f7, (double)f6); + + for (int j1 = 0; j1 < 8; ++j1) + { + avec3[j1].zCoord += 0.0625D; + + if (flag1) + { + avec3[j1].rotateAroundX(0.5235988F); + avec3[j1].yCoord -= 0.4375D; + } + else if (flag) + { + avec3[j1].rotateAroundX(0.08726647F); + avec3[j1].yCoord -= 0.4375D; + } + else + { + avec3[j1].rotateAroundX(-((float)Math.PI * 2F / 9F)); + avec3[j1].yCoord -= 0.375D; + } + + avec3[j1].rotateAroundX(((float)Math.PI / 2F)); + + if (i1 == 2) + { + avec3[j1].rotateAroundY(0.0F); + } + + if (i1 == 0) + { + avec3[j1].rotateAroundY((float)Math.PI); + } + + if (i1 == 1) + { + avec3[j1].rotateAroundY(((float)Math.PI / 2F)); + } + + if (i1 == 3) + { + avec3[j1].rotateAroundY(-((float)Math.PI / 2F)); + } + + avec3[j1].xCoord += (double)p_147723_2_ + 0.5D; + avec3[j1].yCoord += (double)((float)p_147723_3_ + 0.3125F); + avec3[j1].zCoord += (double)p_147723_4_ + 0.5D; + } + + Vec3 vec33 = null; + Vec3 vec3 = null; + Vec3 vec31 = null; + Vec3 vec32 = null; + byte b0 = 7; + byte b1 = 9; + byte b2 = 9; + byte b3 = 16; + + for (int k1 = 0; k1 < 6; ++k1) + { + if (k1 == 0) + { + vec33 = avec3[0]; + vec3 = avec3[1]; + vec31 = avec3[2]; + vec32 = avec3[3]; + d0 = (double)iicon.getInterpolatedU((double)b0); + d1 = (double)iicon.getInterpolatedV((double)b2); + d2 = (double)iicon.getInterpolatedU((double)b1); + d3 = (double)iicon.getInterpolatedV((double)(b2 + 2)); + } + else if (k1 == 1) + { + vec33 = avec3[7]; + vec3 = avec3[6]; + vec31 = avec3[5]; + vec32 = avec3[4]; + } + else if (k1 == 2) + { + vec33 = avec3[1]; + vec3 = avec3[0]; + vec31 = avec3[4]; + vec32 = avec3[5]; + d0 = (double)iicon.getInterpolatedU((double)b0); + d1 = (double)iicon.getInterpolatedV((double)b2); + d2 = (double)iicon.getInterpolatedU((double)b1); + d3 = (double)iicon.getInterpolatedV((double)b3); + } + else if (k1 == 3) + { + vec33 = avec3[2]; + vec3 = avec3[1]; + vec31 = avec3[5]; + vec32 = avec3[6]; + } + else if (k1 == 4) + { + vec33 = avec3[3]; + vec3 = avec3[2]; + vec31 = avec3[6]; + vec32 = avec3[7]; + } + else if (k1 == 5) + { + vec33 = avec3[0]; + vec3 = avec3[3]; + vec31 = avec3[7]; + vec32 = avec3[4]; + } + + tessellator.addVertexWithUV(vec33.xCoord, vec33.yCoord, vec33.zCoord, d0, d3); + tessellator.addVertexWithUV(vec3.xCoord, vec3.yCoord, vec3.zCoord, d2, d3); + tessellator.addVertexWithUV(vec31.xCoord, vec31.yCoord, vec31.zCoord, d2, d1); + tessellator.addVertexWithUV(vec32.xCoord, vec32.yCoord, vec32.zCoord, d0, d1); + } + + float f13 = 0.09375F; + float f8 = 0.09375F; + float f9 = 0.03125F; + avec3[0] = Vec3.createVectorHelper((double)(-f13), 0.0D, (double)(-f8)); + avec3[1] = Vec3.createVectorHelper((double)f13, 0.0D, (double)(-f8)); + avec3[2] = Vec3.createVectorHelper((double)f13, 0.0D, (double)f8); + avec3[3] = Vec3.createVectorHelper((double)(-f13), 0.0D, (double)f8); + avec3[4] = Vec3.createVectorHelper((double)(-f13), (double)f9, (double)(-f8)); + avec3[5] = Vec3.createVectorHelper((double)f13, (double)f9, (double)(-f8)); + avec3[6] = Vec3.createVectorHelper((double)f13, (double)f9, (double)f8); + avec3[7] = Vec3.createVectorHelper((double)(-f13), (double)f9, (double)f8); + + for (int l1 = 0; l1 < 8; ++l1) + { + avec3[l1].zCoord += 0.21875D; + + if (flag1) + { + avec3[l1].yCoord -= 0.09375D; + avec3[l1].zCoord -= 0.1625D; + avec3[l1].rotateAroundX(0.0F); + } + else if (flag) + { + avec3[l1].yCoord += 0.015625D; + avec3[l1].zCoord -= 0.171875D; + avec3[l1].rotateAroundX(0.17453294F); + } + else + { + avec3[l1].rotateAroundX(0.87266463F); + } + + if (i1 == 2) + { + avec3[l1].rotateAroundY(0.0F); + } + + if (i1 == 0) + { + avec3[l1].rotateAroundY((float)Math.PI); + } + + if (i1 == 1) + { + avec3[l1].rotateAroundY(((float)Math.PI / 2F)); + } + + if (i1 == 3) + { + avec3[l1].rotateAroundY(-((float)Math.PI / 2F)); + } + + avec3[l1].xCoord += (double)p_147723_2_ + 0.5D; + avec3[l1].yCoord += (double)((float)p_147723_3_ + 0.3125F); + avec3[l1].zCoord += (double)p_147723_4_ + 0.5D; + } + + byte b7 = 5; + byte b4 = 11; + byte b5 = 3; + byte b6 = 9; + + for (int i2 = 0; i2 < 6; ++i2) + { + if (i2 == 0) + { + vec33 = avec3[0]; + vec3 = avec3[1]; + vec31 = avec3[2]; + vec32 = avec3[3]; + d0 = (double)iicon.getInterpolatedU((double)b7); + d1 = (double)iicon.getInterpolatedV((double)b5); + d2 = (double)iicon.getInterpolatedU((double)b4); + d3 = (double)iicon.getInterpolatedV((double)b6); + } + else if (i2 == 1) + { + vec33 = avec3[7]; + vec3 = avec3[6]; + vec31 = avec3[5]; + vec32 = avec3[4]; + } + else if (i2 == 2) + { + vec33 = avec3[1]; + vec3 = avec3[0]; + vec31 = avec3[4]; + vec32 = avec3[5]; + d0 = (double)iicon.getInterpolatedU((double)b7); + d1 = (double)iicon.getInterpolatedV((double)b5); + d2 = (double)iicon.getInterpolatedU((double)b4); + d3 = (double)iicon.getInterpolatedV((double)(b5 + 2)); + } + else if (i2 == 3) + { + vec33 = avec3[2]; + vec3 = avec3[1]; + vec31 = avec3[5]; + vec32 = avec3[6]; + } + else if (i2 == 4) + { + vec33 = avec3[3]; + vec3 = avec3[2]; + vec31 = avec3[6]; + vec32 = avec3[7]; + } + else if (i2 == 5) + { + vec33 = avec3[0]; + vec3 = avec3[3]; + vec31 = avec3[7]; + vec32 = avec3[4]; + } + + tessellator.addVertexWithUV(vec33.xCoord, vec33.yCoord, vec33.zCoord, d0, d3); + tessellator.addVertexWithUV(vec3.xCoord, vec3.yCoord, vec3.zCoord, d2, d3); + tessellator.addVertexWithUV(vec31.xCoord, vec31.yCoord, vec31.zCoord, d2, d1); + tessellator.addVertexWithUV(vec32.xCoord, vec32.yCoord, vec32.zCoord, d0, d1); + } + + if (flag) + { + double d9 = avec3[0].yCoord; + float f10 = 0.03125F; + float f11 = 0.5F - f10 / 2.0F; + float f12 = f11 + f10; + double d4 = (double)iicon.getMinU(); + double d5 = (double)iicon.getInterpolatedV(flag ? 2.0D : 0.0D); + double d6 = (double)iicon.getMaxU(); + double d7 = (double)iicon.getInterpolatedV(flag ? 4.0D : 2.0D); + double d8 = (double)(flag2 ? 3.5F : 1.5F) / 16.0D; + tessellator.setColorOpaque_F(0.75F, 0.75F, 0.75F); + + if (i1 == 2) + { + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.25D, d4, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.25D, d4, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)p_147723_4_, d6, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)p_147723_4_, d6, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), d9, (double)p_147723_4_ + 0.5D, d4, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), d9, (double)p_147723_4_ + 0.5D, d4, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.25D, d6, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.25D, d6, d5); + } + else if (i1 == 0) + { + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.75D, d4, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.75D, d4, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), d9, (double)p_147723_4_ + 0.5D, d6, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), d9, (double)p_147723_4_ + 0.5D, d6, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)(p_147723_4_ + 1), d4, d5); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)(p_147723_4_ + 1), d4, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f12), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.75D, d6, d7); + tessellator.addVertexWithUV((double)((float)p_147723_2_ + f11), (double)p_147723_3_ + d8, (double)p_147723_4_ + 0.75D, d6, d5); + } + else if (i1 == 1) + { + tessellator.addVertexWithUV((double)p_147723_2_, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d4, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d6, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d6, d5); + tessellator.addVertexWithUV((double)p_147723_2_, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d4, d5); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d4, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.5D, d9, (double)((float)p_147723_4_ + f12), d6, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.5D, d9, (double)((float)p_147723_4_ + f11), d6, d5); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.25D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d4, d5); + } + else + { + tessellator.addVertexWithUV((double)p_147723_2_ + 0.5D, d9, (double)((float)p_147723_4_ + f12), d4, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d6, d7); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d6, d5); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.5D, d9, (double)((float)p_147723_4_ + f11), d4, d5); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d4, d7); + tessellator.addVertexWithUV((double)(p_147723_2_ + 1), (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f12), d6, d7); + tessellator.addVertexWithUV((double)(p_147723_2_ + 1), (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d6, d5); + tessellator.addVertexWithUV((double)p_147723_2_ + 0.75D, (double)p_147723_3_ + d8, (double)((float)p_147723_4_ + f11), d4, d5); + } + } + + return true; + } + + /** + * Renders a trip wire block at the given coordinates + */ + public boolean renderBlockTripWire(Block p_147756_1_, int p_147756_2_, int p_147756_3_, int p_147756_4_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSide(p_147756_1_, 0); + int l = this.blockAccess.getBlockMetadata(p_147756_2_, p_147756_3_, p_147756_4_); + boolean flag = (l & 4) == 4; + boolean flag1 = (l & 2) == 2; + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + tessellator.setBrightness(p_147756_1_.getMixedBrightnessForBlock(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getInterpolatedV(flag ? 2.0D : 0.0D); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getInterpolatedV(flag ? 4.0D : 2.0D); + double d4 = (double)(flag1 ? 3.5F : 1.5F) / 16.0D; + boolean flag2 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, l, 1); + boolean flag3 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, l, 3); + boolean flag4 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, l, 2); + boolean flag5 = BlockTripWire.func_150139_a(this.blockAccess, p_147756_2_, p_147756_3_, p_147756_4_, l, 0); + float f = 0.03125F; + float f1 = 0.5F - f / 2.0F; + float f2 = f1 + f; + + if (!flag4 && !flag3 && !flag5 && !flag2) + { + flag4 = true; + flag5 = true; + } + + if (flag4) + { + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d0, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d0, d1); + } + + if (flag4 || flag5 && !flag3 && !flag2) + { + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d0, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.25D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d0, d1); + } + + if (flag5 || flag4 && !flag3 && !flag2) + { + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d0, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.5D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d0, d1); + } + + if (flag5) + { + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)(p_147756_4_ + 1), d0, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)(p_147756_4_ + 1), d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d2, d1); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)p_147756_4_ + 0.75D, d2, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f2), (double)p_147756_3_ + d4, (double)(p_147756_4_ + 1), d0, d3); + tessellator.addVertexWithUV((double)((float)p_147756_2_ + f1), (double)p_147756_3_ + d4, (double)(p_147756_4_ + 1), d0, d1); + } + + if (flag2) + { + tessellator.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + } + + if (flag2 || flag3 && !flag4 && !flag5) + { + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.25D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + } + + if (flag3 || flag2 && !flag4 && !flag5) + { + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.5D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + } + + if (flag3) + { + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + tessellator.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d0, d1); + tessellator.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f1), d2, d1); + tessellator.addVertexWithUV((double)(p_147756_2_ + 1), (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d2, d3); + tessellator.addVertexWithUV((double)p_147756_2_ + 0.75D, (double)p_147756_3_ + d4, (double)((float)p_147756_4_ + f2), d0, d3); + } + + return true; + } + + /** + * Renders a fire block at the given coordinates + */ + public boolean renderBlockFire(BlockFire p_147801_1_, int p_147801_2_, int p_147801_3_, int p_147801_4_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = p_147801_1_.getFireIcon(0); + IIcon iicon1 = p_147801_1_.getFireIcon(1); + IIcon iicon2 = iicon; + + if (this.hasOverrideBlockTexture()) + { + iicon2 = this.overrideBlockTexture; + } + + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.setBrightness(p_147801_1_.getMixedBrightnessForBlock(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_)); + double d0 = (double)iicon2.getMinU(); + double d1 = (double)iicon2.getMinV(); + double d2 = (double)iicon2.getMaxU(); + double d3 = (double)iicon2.getMaxV(); + float f = 1.4F; + double d5; + double d6; + double d7; + double d8; + double d9; + double d10; + double d11; + + if (!World.doesBlockHaveSolidTopSurface(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) + { + float f2 = 0.2F; + float f1 = 0.0625F; + + if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 1) + { + d0 = (double)iicon1.getMinU(); + d1 = (double)iicon1.getMinV(); + d2 = (double)iicon1.getMaxU(); + d3 = (double)iicon1.getMaxV(); + } + + if ((p_147801_2_ / 2 + p_147801_3_ / 2 + p_147801_4_ / 2 & 1) == 1) + { + d5 = d2; + d2 = d0; + d0 = d5; + } + + if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) + { + tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + } + + if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) + { + tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + } + + if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) + { + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + } + + if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) + { + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + } + + if (Blocks.fire.canCatchFire(this.blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) + { + d5 = (double)p_147801_2_ + 0.5D + 0.5D; + d6 = (double)p_147801_2_ + 0.5D - 0.5D; + d7 = (double)p_147801_4_ + 0.5D + 0.5D; + d8 = (double)p_147801_4_ + 0.5D - 0.5D; + d9 = (double)p_147801_2_ + 0.5D - 0.5D; + d10 = (double)p_147801_2_ + 0.5D + 0.5D; + d11 = (double)p_147801_4_ + 0.5D - 0.5D; + double d12 = (double)p_147801_4_ + 0.5D + 0.5D; + d0 = (double)iicon.getMinU(); + d1 = (double)iicon.getMinV(); + d2 = (double)iicon.getMaxU(); + d3 = (double)iicon.getMaxV(); + ++p_147801_3_; + f = -0.2F; + + if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 0) + { + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d2, d1); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d2, d3); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d0, d3); + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d0, d1); + d0 = (double)iicon1.getMinU(); + d1 = (double)iicon1.getMinV(); + d2 = (double)iicon1.getMaxU(); + d3 = (double)iicon1.getMaxV(); + tessellator.addVertexWithUV(d10, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV(d6, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV(d6, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV(d10, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d0, d1); + } + else + { + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d12, d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d8, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d8, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d12, d0, d1); + d0 = (double)iicon1.getMinU(); + d1 = (double)iicon1.getMinV(); + d2 = (double)iicon1.getMaxU(); + d3 = (double)iicon1.getMaxV(); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d11, d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d7, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d7, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d11, d0, d1); + } + } + } + else + { + double d4 = (double)p_147801_2_ + 0.5D + 0.2D; + d5 = (double)p_147801_2_ + 0.5D - 0.2D; + d6 = (double)p_147801_4_ + 0.5D + 0.2D; + d7 = (double)p_147801_4_ + 0.5D - 0.2D; + d8 = (double)p_147801_2_ + 0.5D - 0.3D; + d9 = (double)p_147801_2_ + 0.5D + 0.3D; + d10 = (double)p_147801_4_ + 0.5D - 0.3D; + d11 = (double)p_147801_4_ + 0.5D + 0.3D; + tessellator.addVertexWithUV(d8, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV(d4, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV(d4, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV(d8, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d0, d1); + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d2, d1); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d2, d3); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d0, d3); + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d0, d1); + d0 = (double)iicon1.getMinU(); + d1 = (double)iicon1.getMinV(); + d2 = (double)iicon1.getMaxU(); + d3 = (double)iicon1.getMaxV(); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d11, d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d7, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d7, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d11, d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d10, d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d6, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d6, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d10, d0, d1); + d4 = (double)p_147801_2_ + 0.5D - 0.5D; + d5 = (double)p_147801_2_ + 0.5D + 0.5D; + d6 = (double)p_147801_4_ + 0.5D - 0.5D; + d7 = (double)p_147801_4_ + 0.5D + 0.5D; + d8 = (double)p_147801_2_ + 0.5D - 0.4D; + d9 = (double)p_147801_2_ + 0.5D + 0.4D; + d10 = (double)p_147801_4_ + 0.5D - 0.4D; + d11 = (double)p_147801_4_ + 0.5D + 0.4D; + tessellator.addVertexWithUV(d8, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d0, d1); + tessellator.addVertexWithUV(d4, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d0, d3); + tessellator.addVertexWithUV(d4, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d2, d3); + tessellator.addVertexWithUV(d8, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d2, d1); + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 1), d0, d1); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 1), d0, d3); + tessellator.addVertexWithUV(d5, (double)(p_147801_3_ + 0), (double)(p_147801_4_ + 0), d2, d3); + tessellator.addVertexWithUV(d9, (double)((float)p_147801_3_ + f), (double)(p_147801_4_ + 0), d2, d1); + d0 = (double)iicon.getMinU(); + d1 = (double)iicon.getMinV(); + d2 = (double)iicon.getMaxU(); + d3 = (double)iicon.getMaxV(); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d11, d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d7, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d7, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d11, d2, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f), d10, d0, d1); + tessellator.addVertexWithUV((double)(p_147801_2_ + 1), (double)(p_147801_3_ + 0), d6, d0, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)(p_147801_3_ + 0), d6, d2, d3); + tessellator.addVertexWithUV((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f), d10, d2, d1); + } + + return true; + } + + /** + * Renders a redstone wire block at the given coordinates + */ + public boolean renderBlockRedstoneWire(Block p_147788_1_, int p_147788_2_, int p_147788_3_, int p_147788_4_) + { + Tessellator tessellator = Tessellator.instance; + int l = this.blockAccess.getBlockMetadata(p_147788_2_, p_147788_3_, p_147788_4_); + IIcon iicon = BlockRedstoneWire.getRedstoneWireIcon("cross"); + IIcon iicon1 = BlockRedstoneWire.getRedstoneWireIcon("line"); + IIcon iicon2 = BlockRedstoneWire.getRedstoneWireIcon("cross_overlay"); + IIcon iicon3 = BlockRedstoneWire.getRedstoneWireIcon("line_overlay"); + tessellator.setBrightness(p_147788_1_.getMixedBrightnessForBlock(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_)); + float f = (float)l / 15.0F; + float f1 = f * 0.6F + 0.4F; + + if (l == 0) + { + f1 = 0.3F; + } + + float f2 = f * f * 0.7F - 0.5F; + float f3 = f * f * 0.6F - 0.7F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + tessellator.setColorOpaque_F(f1, f2, f3); + double d0 = 0.015625D; + double d1 = 0.015625D; + boolean flag = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ - 1, p_147788_3_, p_147788_4_, 1) || !this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ - 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean flag1 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ + 1, p_147788_3_, p_147788_4_, 3) || !this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ + 1, p_147788_3_ - 1, p_147788_4_, -1); + boolean flag2 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_ - 1, 2) || !this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_ - 1, p_147788_4_ - 1, -1); + boolean flag3 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_, p_147788_4_ + 1, 0) || !this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_ - 1, p_147788_4_ + 1, -1); + + if (!this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_).isBlockNormalCube()) + { + if (this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_, -1)) + { + flag = true; + } + + if (this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_, -1)) + { + flag1 = true; + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1, -1)) + { + flag2 = true; + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1, -1)) + { + flag3 = true; + } + } + + float f4 = (float)(p_147788_2_ + 0); + float f5 = (float)(p_147788_2_ + 1); + float f6 = (float)(p_147788_4_ + 0); + float f7 = (float)(p_147788_4_ + 1); + int i1 = 0; + + if ((flag || flag1) && !flag2 && !flag3) + { + i1 = 1; + } + + if ((flag2 || flag3) && !flag1 && !flag) + { + i1 = 2; + } + + if (i1 == 0) + { + int j1 = 0; + int k1 = 0; + int l1 = 16; + int i2 = 16; + boolean flag4 = true; + + if (!flag) + { + f4 += 0.3125F; + } + + if (!flag) + { + j1 += 5; + } + + if (!flag1) + { + f5 -= 0.3125F; + } + + if (!flag1) + { + l1 -= 5; + } + + if (!flag2) + { + f6 += 0.3125F; + } + + if (!flag2) + { + k1 += 5; + } + + if (!flag3) + { + f7 -= 0.3125F; + } + + if (!flag3) + { + i2 -= 5; + } + + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon.getInterpolatedU((double)l1), (double)iicon.getInterpolatedV((double)i2)); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon.getInterpolatedU((double)l1), (double)iicon.getInterpolatedV((double)k1)); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon.getInterpolatedU((double)j1), (double)iicon.getInterpolatedV((double)k1)); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon.getInterpolatedU((double)j1), (double)iicon.getInterpolatedV((double)i2)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon2.getInterpolatedU((double)l1), (double)iicon2.getInterpolatedV((double)i2)); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon2.getInterpolatedU((double)l1), (double)iicon2.getInterpolatedV((double)k1)); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon2.getInterpolatedU((double)j1), (double)iicon2.getInterpolatedV((double)k1)); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon2.getInterpolatedU((double)j1), (double)iicon2.getInterpolatedV((double)i2)); + } + else if (i1 == 1) + { + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon3.getMinU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + } + else + { + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)f5, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f6, (double)iicon3.getMinU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)f4, (double)p_147788_3_ + 0.015625D, (double)f7, (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + } + + if (!this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_).isBlockNormalCube()) + { + float f8 = 0.021875F; + + if (this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_ - 1, p_147788_3_ + 1, p_147788_4_) == Blocks.redstone_wire) + { + tessellator.setColorOpaque_F(f1, f2, f3); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)iicon3.getMinU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)p_147788_2_ + 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + } + + if (this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_, p_147788_4_).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_ + 1, p_147788_3_ + 1, p_147788_4_) == Blocks.redstone_wire) + { + tessellator.setColorOpaque_F(f1, f2, f3); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1), (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1), (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 0), (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1) - 0.015625D, (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 0), (double)iicon3.getMinU(), (double)iicon3.getMinV()); + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ - 1).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_ - 1) == Blocks.redstone_wire) + { + tessellator.setColorOpaque_F(f1, f2, f3); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)p_147788_4_ + 0.015625D, (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)p_147788_4_ + 0.015625D, (double)iicon3.getMinU(), (double)iicon3.getMinV()); + } + + if (this.blockAccess.getBlock(p_147788_2_, p_147788_3_, p_147788_4_ + 1).isBlockNormalCube() && this.blockAccess.getBlock(p_147788_2_, p_147788_3_ + 1, p_147788_4_ + 1) == Blocks.redstone_wire) + { + tessellator.setColorOpaque_F(f1, f2, f3); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon1.getMaxU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon1.getMinU(), (double)iicon1.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon1.getMinU(), (double)iicon1.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon1.getMaxU(), (double)iicon1.getMaxV()); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon3.getMaxU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 1), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon3.getMinU(), (double)iicon3.getMinV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)(p_147788_3_ + 0), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon3.getMinU(), (double)iicon3.getMaxV()); + tessellator.addVertexWithUV((double)(p_147788_2_ + 0), (double)((float)(p_147788_3_ + 1) + 0.021875F), (double)(p_147788_4_ + 1) - 0.015625D, (double)iicon3.getMaxU(), (double)iicon3.getMaxV()); + } + } + + return true; + } + + public boolean renderBlockMinecartTrack(BlockRailBase p_147766_1_, int p_147766_2_, int p_147766_3_, int p_147766_4_) + { + Tessellator tessellator = Tessellator.instance; + int l = this.blockAccess.getBlockMetadata(p_147766_2_, p_147766_3_, p_147766_4_); + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147766_1_, 0, l); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + if (p_147766_1_.isPowered()) + { + l &= 7; + } + + tessellator.setBrightness(p_147766_1_.getMixedBrightnessForBlock(this.blockAccess, p_147766_2_, p_147766_3_, p_147766_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMinV(); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMaxV(); + double d4 = 0.0625D; + double d5 = (double)(p_147766_2_ + 1); + double d6 = (double)(p_147766_2_ + 1); + double d7 = (double)(p_147766_2_ + 0); + double d8 = (double)(p_147766_2_ + 0); + double d9 = (double)(p_147766_4_ + 0); + double d10 = (double)(p_147766_4_ + 1); + double d11 = (double)(p_147766_4_ + 1); + double d12 = (double)(p_147766_4_ + 0); + double d13 = (double)p_147766_3_ + d4; + double d14 = (double)p_147766_3_ + d4; + double d15 = (double)p_147766_3_ + d4; + double d16 = (double)p_147766_3_ + d4; + + if (l != 1 && l != 2 && l != 3 && l != 7) + { + if (l == 8) + { + d5 = d6 = (double)(p_147766_2_ + 0); + d7 = d8 = (double)(p_147766_2_ + 1); + d9 = d12 = (double)(p_147766_4_ + 1); + d10 = d11 = (double)(p_147766_4_ + 0); + } + else if (l == 9) + { + d5 = d8 = (double)(p_147766_2_ + 0); + d6 = d7 = (double)(p_147766_2_ + 1); + d9 = d10 = (double)(p_147766_4_ + 0); + d11 = d12 = (double)(p_147766_4_ + 1); + } + } + else + { + d5 = d8 = (double)(p_147766_2_ + 1); + d6 = d7 = (double)(p_147766_2_ + 0); + d9 = d10 = (double)(p_147766_4_ + 1); + d11 = d12 = (double)(p_147766_4_ + 0); + } + + if (l != 2 && l != 4) + { + if (l == 3 || l == 5) + { + ++d14; + ++d15; + } + } + else + { + ++d13; + ++d16; + } + + tessellator.addVertexWithUV(d5, d13, d9, d2, d1); + tessellator.addVertexWithUV(d6, d14, d10, d2, d3); + tessellator.addVertexWithUV(d7, d15, d11, d0, d3); + tessellator.addVertexWithUV(d8, d16, d12, d0, d1); + tessellator.addVertexWithUV(d8, d16, d12, d0, d1); + tessellator.addVertexWithUV(d7, d15, d11, d0, d3); + tessellator.addVertexWithUV(d6, d14, d10, d2, d3); + tessellator.addVertexWithUV(d5, d13, d9, d2, d1); + return true; + } + + public boolean renderBlockLadder(Block p_147794_1_, int p_147794_2_, int p_147794_3_, int p_147794_4_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSide(p_147794_1_, 0); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + tessellator.setBrightness(p_147794_1_.getMixedBrightnessForBlock(this.blockAccess, p_147794_2_, p_147794_3_, p_147794_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMinV(); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMaxV(); + int l = this.blockAccess.getBlockMetadata(p_147794_2_, p_147794_3_, p_147794_4_); + double d4 = 0.0D; + double d5 = 0.05000000074505806D; + + if (l == 5) + { + tessellator.addVertexWithUV((double)p_147794_2_ + d5, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 1) + d4, d0, d1); + tessellator.addVertexWithUV((double)p_147794_2_ + d5, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 1) + d4, d0, d3); + tessellator.addVertexWithUV((double)p_147794_2_ + d5, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 0) - d4, d2, d3); + tessellator.addVertexWithUV((double)p_147794_2_ + d5, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 0) - d4, d2, d1); + } + + if (l == 4) + { + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) - d5, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 1) + d4, d2, d3); + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) - d5, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 1) + d4, d2, d1); + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) - d5, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 0) - d4, d0, d1); + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) - d5, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 0) - d4, d0, d3); + } + + if (l == 3) + { + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) + d4, (double)(p_147794_3_ + 0) - d4, (double)p_147794_4_ + d5, d2, d3); + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) + d4, (double)(p_147794_3_ + 1) + d4, (double)p_147794_4_ + d5, d2, d1); + tessellator.addVertexWithUV((double)(p_147794_2_ + 0) - d4, (double)(p_147794_3_ + 1) + d4, (double)p_147794_4_ + d5, d0, d1); + tessellator.addVertexWithUV((double)(p_147794_2_ + 0) - d4, (double)(p_147794_3_ + 0) - d4, (double)p_147794_4_ + d5, d0, d3); + } + + if (l == 2) + { + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) + d4, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 1) - d5, d0, d1); + tessellator.addVertexWithUV((double)(p_147794_2_ + 1) + d4, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 1) - d5, d0, d3); + tessellator.addVertexWithUV((double)(p_147794_2_ + 0) - d4, (double)(p_147794_3_ + 0) - d4, (double)(p_147794_4_ + 1) - d5, d2, d3); + tessellator.addVertexWithUV((double)(p_147794_2_ + 0) - d4, (double)(p_147794_3_ + 1) + d4, (double)(p_147794_4_ + 1) - d5, d2, d1); + } + + return true; + } + + public boolean renderBlockVine(Block p_147726_1_, int p_147726_2_, int p_147726_3_, int p_147726_4_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSide(p_147726_1_, 0); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + tessellator.setBrightness(p_147726_1_.getMixedBrightnessForBlock(this.blockAccess, p_147726_2_, p_147726_3_, p_147726_4_)); + int l = p_147726_1_.colorMultiplier(this.blockAccess, p_147726_2_, p_147726_3_, p_147726_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + tessellator.setColorOpaque_F(f, f1, f2); + double d3 = (double)iicon.getMinU(); + double d4 = (double)iicon.getMinV(); + double d0 = (double)iicon.getMaxU(); + double d1 = (double)iicon.getMaxV(); + double d2 = 0.05000000074505806D; + int i1 = this.blockAccess.getBlockMetadata(p_147726_2_, p_147726_3_, p_147726_4_); + + if ((i1 & 2) != 0) + { + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), d3, d4); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), d3, d1); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), d0, d1); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), d0, d4); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), d0, d4); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), d0, d1); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), d3, d1); + tessellator.addVertexWithUV((double)p_147726_2_ + d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), d3, d4); + } + + if ((i1 & 8) != 0) + { + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), d0, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 0), d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 0), d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1), d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1) - d2, (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1), d0, d1); + } + + if ((i1 & 4) != 0) + { + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + d2, d0, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + d2, d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + d2, d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + d2, d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)p_147726_4_ + d2, d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)p_147726_4_ + d2, d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)p_147726_4_ + d2, d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)p_147726_4_ + d2, d0, d1); + } + + if ((i1 & 1) != 0) + { + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - d2, d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - d2, d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - d2, d0, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - d2, d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - d2, d0, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - d2, d0, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 0), (double)(p_147726_4_ + 1) - d2, d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1), (double)(p_147726_4_ + 1) - d2, d3, d4); + } + + if (this.blockAccess.getBlock(p_147726_2_, p_147726_3_ + 1, p_147726_4_).isBlockNormalCube()) + { + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - d2, (double)(p_147726_4_ + 0), d3, d4); + tessellator.addVertexWithUV((double)(p_147726_2_ + 1), (double)(p_147726_3_ + 1) - d2, (double)(p_147726_4_ + 1), d3, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - d2, (double)(p_147726_4_ + 1), d0, d1); + tessellator.addVertexWithUV((double)(p_147726_2_ + 0), (double)(p_147726_3_ + 1) - d2, (double)(p_147726_4_ + 0), d0, d4); + } + + return true; + } + + public boolean renderBlockStainedGlassPane(Block p_147733_1_, int p_147733_2_, int p_147733_3_, int p_147733_4_) + { + int l = this.blockAccess.getHeight(); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147733_1_.getMixedBrightnessForBlock(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_)); + int i1 = p_147733_1_.colorMultiplier(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_); + float f = (float)(i1 >> 16 & 255) / 255.0F; + float f1 = (float)(i1 >> 8 & 255) / 255.0F; + float f2 = (float)(i1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + boolean flag5 = p_147733_1_ instanceof BlockStainedGlassPane; + IIcon iicon; + IIcon iicon1; + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + iicon1 = this.overrideBlockTexture; + } + else + { + int j1 = this.blockAccess.getBlockMetadata(p_147733_2_, p_147733_3_, p_147733_4_); + iicon = this.getBlockIconFromSideAndMetadata(p_147733_1_, 0, j1); + iicon1 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).func_150104_b(j1) : ((BlockPane)p_147733_1_).func_150097_e(); + } + + double d22 = (double)iicon.getMinU(); + double d0 = (double)iicon.getInterpolatedU(7.0D); + double d1 = (double)iicon.getInterpolatedU(9.0D); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMinV(); + double d4 = (double)iicon.getMaxV(); + double d5 = (double)iicon1.getInterpolatedU(7.0D); + double d6 = (double)iicon1.getInterpolatedU(9.0D); + double d7 = (double)iicon1.getMinV(); + double d8 = (double)iicon1.getMaxV(); + double d9 = (double)iicon1.getInterpolatedV(7.0D); + double d10 = (double)iicon1.getInterpolatedV(9.0D); + double d11 = (double)p_147733_2_; + double d12 = (double)(p_147733_2_ + 1); + double d13 = (double)p_147733_4_; + double d14 = (double)(p_147733_4_ + 1); + double d15 = (double)p_147733_2_ + 0.5D - 0.0625D; + double d16 = (double)p_147733_2_ + 0.5D + 0.0625D; + double d17 = (double)p_147733_4_ + 0.5D - 0.0625D; + double d18 = (double)p_147733_4_ + 0.5D + 0.0625D; + boolean flag = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_ - 1, NORTH); + boolean flag1 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_, p_147733_3_, p_147733_4_ + 1, SOUTH); + boolean flag2 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_ - 1, p_147733_3_, p_147733_4_, WEST ); + boolean flag3 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.blockAccess, p_147733_2_ + 1, p_147733_3_, p_147733_4_, EAST ); + double d19 = 0.001D; + double d20 = 0.999D; + double d21 = 0.001D; + boolean flag4 = !flag && !flag1 && !flag2 && !flag3; + + if (!flag2 && !flag4) + { + if (!flag && !flag1) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + } + else if (flag2 && flag3) + { + if (!flag) + { + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d2, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d2, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d22, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d22, d3); + } + else + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d22, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d22, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d2, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d1, d3); + } + + if (!flag1) + { + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d22, d3); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d22, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d2, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d2, d3); + } + else + { + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d22, d3); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d0, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d2, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d2, d3); + } + + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d6, d7); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d6, d8); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d5, d8); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d5, d7); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d5, d8); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d6, d7); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d6, d8); + } + else + { + if (!flag && !flag4) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d22, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d22, d3); + } + else + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d22, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d22, d3); + } + + if (!flag1 && !flag4) + { + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d22, d3); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d22, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + else + { + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d22, d3); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d0, d3); + } + + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d6, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d6, d9); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d5, d9); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d5, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d5, d9); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d6, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d6, d9); + } + + if ((flag3 || flag4) && !flag2) + { + if (!flag1 && !flag4) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d2, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d2, d3); + } + else + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d2, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d2, d3); + } + + if (!flag && !flag4) + { + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d2, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d2, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + } + else + { + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d2, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d1, d3); + } + + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d6, d10); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d6, d7); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d5, d10); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d5, d10); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d6, d10); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d6, d8); + } + else if (!flag3 && !flag && !flag1) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d0, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d1, d3); + } + + if (!flag && !flag4) + { + if (!flag3 && !flag2) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + } + } + else if (flag && flag1) + { + if (!flag2) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d22, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d2, d3); + } + else + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d22, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d2, d3); + } + + if (!flag3) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d2, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d22, d3); + } + else + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d22, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d2, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d6, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d6, d8); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d6, d7); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d6, d8); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d5, d8); + } + else + { + if (!flag2 && !flag4) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d22, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + else + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d22, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + } + + if (!flag3 && !flag4) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d22, d3); + } + else + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d22, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d22, d3); + } + + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d6, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d5, d9); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d6, d9); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d6, d7); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d6, d9); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d5, d9); + } + + if ((flag1 || flag4) && !flag) + { + if (!flag2 && !flag4) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d2, d3); + } + else + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d2, d3); + } + + if (!flag3 && !flag4) + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d2, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d0, d3); + } + else + { + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d2, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d2, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d6, d10); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d5, d10); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d6, d8); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d5, d10); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d6, d10); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d6, d8); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d5, d8); + } + else if (!flag1 && !flag3 && !flag2) + { + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d1, d3); + } + + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d17, d6, d9); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d17, d5, d9); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d18, d5, d10); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d18, d6, d10); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d17, d5, d9); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d17, d6, d9); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d18, d6, d10); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d18, d5, d10); + + if (flag4) + { + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d17, d0, d3); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d17, d0, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.001D, d18, d1, d4); + tessellator.addVertexWithUV(d11, (double)p_147733_3_ + 0.999D, d18, d1, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d18, d0, d3); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d18, d0, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.001D, d17, d1, d4); + tessellator.addVertexWithUV(d12, (double)p_147733_3_ + 0.999D, d17, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d13, d1, d3); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d13, d1, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d13, d0, d4); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d13, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.999D, d14, d0, d3); + tessellator.addVertexWithUV(d15, (double)p_147733_3_ + 0.001D, d14, d0, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.001D, d14, d1, d4); + tessellator.addVertexWithUV(d16, (double)p_147733_3_ + 0.999D, d14, d1, d3); + } + + return true; + } + + public boolean renderBlockPane(BlockPane p_147767_1_, int p_147767_2_, int p_147767_3_, int p_147767_4_) + { + int l = this.blockAccess.getHeight(); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147767_1_.getMixedBrightnessForBlock(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_)); + int i1 = p_147767_1_.colorMultiplier(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_); + float f = (float)(i1 >> 16 & 255) / 255.0F; + float f1 = (float)(i1 >> 8 & 255) / 255.0F; + float f2 = (float)(i1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + IIcon iicon; + IIcon iicon1; + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + iicon1 = this.overrideBlockTexture; + } + else + { + int j1 = this.blockAccess.getBlockMetadata(p_147767_2_, p_147767_3_, p_147767_4_); + iicon = this.getBlockIconFromSideAndMetadata(p_147767_1_, 0, j1); + iicon1 = p_147767_1_.func_150097_e(); + } + + double d21 = (double)iicon.getMinU(); + double d0 = (double)iicon.getInterpolatedU(8.0D); + double d1 = (double)iicon.getMaxU(); + double d2 = (double)iicon.getMinV(); + double d3 = (double)iicon.getMaxV(); + double d4 = (double)iicon1.getInterpolatedU(7.0D); + double d5 = (double)iicon1.getInterpolatedU(9.0D); + double d6 = (double)iicon1.getMinV(); + double d7 = (double)iicon1.getInterpolatedV(8.0D); + double d8 = (double)iicon1.getMaxV(); + double d9 = (double)p_147767_2_; + double d10 = (double)p_147767_2_ + 0.5D; + double d11 = (double)(p_147767_2_ + 1); + double d12 = (double)p_147767_4_; + double d13 = (double)p_147767_4_ + 0.5D; + double d14 = (double)(p_147767_4_ + 1); + double d15 = (double)p_147767_2_ + 0.5D - 0.0625D; + double d16 = (double)p_147767_2_ + 0.5D + 0.0625D; + double d17 = (double)p_147767_4_ + 0.5D - 0.0625D; + double d18 = (double)p_147767_4_ + 0.5D + 0.0625D; + boolean flag = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); + boolean flag1 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); + boolean flag2 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); + boolean flag3 = p_147767_1_.canPaneConnectTo(this.blockAccess, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); + boolean flag4 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean flag5 = p_147767_1_.shouldSideBeRendered(this.blockAccess, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); + double d19 = 0.01D; + double d20 = 0.005D; + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { + if (flag2 && !flag3) + { + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1), d13, d21, d2); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 0), d13, d21, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d0, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d21, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d21, d3); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1), d13, d0, d2); + + if (!flag1 && !flag) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d18, d4, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d18, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d17, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d17, d5, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d17, d4, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d18, d5, d6); + } + + if (flag4 || p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + } + + if (flag5 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d7); + } + } + else if (!flag2 && flag3) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d0, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 0), d13, d1, d3); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1), d13, d1, d2); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1), d13, d0, d2); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d1, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d1, d2); + + if (!flag1 && !flag) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d17, d4, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d18, d5, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d18, d4, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d18, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d17, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d17, d5, d6); + } + + if (flag4 || p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + } + + if (flag5 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d6); + } + } + } + else + { + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1), d13, d21, d2); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 0), d13, d21, d3); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 0), d13, d1, d3); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1), d13, d1, d2); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1), d13, d21, d2); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 0), d13, d21, d3); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 0), d13, d1, d3); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1), d13, d1, d2); + + if (flag4) + { + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + } + else + { + if (p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ + 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + } + + if (p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ + 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d11, (double)(p_147767_3_ + 1) + 0.01D, d17, d4, d6); + } + } + + if (flag5) + { + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d8); + } + else + { + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ - 1, p_147767_3_ - 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d18, d5, d8); + tessellator.addVertexWithUV(d9, (double)p_147767_3_ - 0.01D, d17, d4, d8); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d7); + } + + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_ + 1, p_147767_3_ - 1, p_147767_4_)) + { + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d6); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d18, d5, d6); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d18, d5, d7); + tessellator.addVertexWithUV(d10, (double)p_147767_3_ - 0.01D, d17, d4, d7); + tessellator.addVertexWithUV(d11, (double)p_147767_3_ - 0.01D, d17, d4, d6); + } + } + } + + if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1)) + { + if (flag && !flag1) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d12, d21, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d12, d21, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d0, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d21, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d21, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d12, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d12, d0, d2); + + if (!flag3 && !flag2) + { + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1), d13, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 0), d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 0), d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1), d13, d5, d6); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1), d13, d4, d6); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 0), d13, d4, d8); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 0), d13, d5, d8); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1), d13, d5, d6); + } + + if (flag4 || p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) + { + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d6); + } + + if (flag5 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) + { + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d4, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d4, d6); + } + } + else if (!flag && flag1) + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d0, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d14, d1, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d14, d1, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d14, d0, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d14, d0, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d13, d1, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d13, d1, d2); + + if (!flag3 && !flag2) + { + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1), d13, d4, d6); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 0), d13, d4, d8); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 0), d13, d5, d8); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1), d13, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1), d13, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 0), d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 0), d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1), d13, d5, d6); + } + + if (flag4 || p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) + { + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d7); + } + + if (flag5 || p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) + { + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d7); + } + } + } + else + { + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d14, d21, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d14, d21, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d12, d1, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d12, d1, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d12, d21, d2); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d12, d21, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 0), d14, d1, d3); + tessellator.addVertexWithUV(d10, (double)(p_147767_3_ + 1), d14, d1, d2); + + if (flag4) + { + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d8); + } + else + { + if (p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ - 1)) + { + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d6); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d12, d5, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d12, d4, d7); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d6); + } + + if (p_147767_3_ < l - 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ + 1, p_147767_4_ + 1)) + { + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d14, d4, d7); + tessellator.addVertexWithUV(d15, (double)(p_147767_3_ + 1) + 0.005D, d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)(p_147767_3_ + 1) + 0.005D, d14, d5, d7); + } + } + + if (flag5) + { + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d4, d8); + } + else + { + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ - 1)) + { + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d4, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d5, d6); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d12, d5, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d12, d4, d7); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d4, d6); + } + + if (p_147767_3_ > 1 && this.blockAccess.isAirBlock(p_147767_2_, p_147767_3_ - 1, p_147767_4_ + 1)) + { + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d4, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d5, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d14, d4, d7); + tessellator.addVertexWithUV(d15, (double)p_147767_3_ - 0.005D, d13, d4, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d13, d5, d8); + tessellator.addVertexWithUV(d16, (double)p_147767_3_ - 0.005D, d14, d5, d7); + } + } + } + + return true; + } + + /** + * Renders any block requiring crossed squares such as reeds, flowers, and mushrooms + */ + public boolean renderCrossedSquares(Block p_147746_1_, int p_147746_2_, int p_147746_3_, int p_147746_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147746_1_.getMixedBrightnessForBlock(this.blockAccess, p_147746_2_, p_147746_3_, p_147746_4_)); + int l = p_147746_1_.colorMultiplier(this.blockAccess, p_147746_2_, p_147746_3_, p_147746_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + double d1 = (double)p_147746_2_; + double d2 = (double)p_147746_3_; + double d0 = (double)p_147746_4_; + long i1; + + if (p_147746_1_ == Blocks.tallgrass) + { + i1 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + i1 = i1 * i1 * 42317861L + i1 * 11L; + d1 += ((double)((float)(i1 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + d2 += ((double)((float)(i1 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + d0 += ((double)((float)(i1 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + } + else if (p_147746_1_ == Blocks.red_flower || p_147746_1_ == Blocks.yellow_flower) + { + i1 = (long)(p_147746_2_ * 3129871) ^ (long)p_147746_4_ * 116129781L ^ (long)p_147746_3_; + i1 = i1 * i1 * 42317861L + i1 * 11L; + d1 += ((double)((float)(i1 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + d0 += ((double)((float)(i1 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + } + + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147746_1_, 0, this.blockAccess.getBlockMetadata(p_147746_2_, p_147746_3_, p_147746_4_)); + this.drawCrossedSquares(iicon, d1, d2, d0, 1.0F); + return true; + } + + public boolean renderBlockDoublePlant(BlockDoublePlant p_147774_1_, int p_147774_2_, int p_147774_3_, int p_147774_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147774_1_.getMixedBrightnessForBlock(this.blockAccess, p_147774_2_, p_147774_3_, p_147774_4_)); + int l = p_147774_1_.colorMultiplier(this.blockAccess, p_147774_2_, p_147774_3_, p_147774_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + long j1 = (long)(p_147774_2_ * 3129871) ^ (long)p_147774_4_ * 116129781L; + j1 = j1 * j1 * 42317861L + j1 * 11L; + double d19 = (double)p_147774_2_; + double d0 = (double)p_147774_3_; + double d1 = (double)p_147774_4_; + d19 += ((double)((float)(j1 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D; + d1 += ((double)((float)(j1 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D; + int i1 = this.blockAccess.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_); + boolean flag = false; + boolean flag1 = BlockDoublePlant.func_149887_c(i1); + int k1; + + if (flag1) + { + if (this.blockAccess.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_) + { + return false; + } + + k1 = BlockDoublePlant.func_149890_d(this.blockAccess.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_)); + } + else + { + k1 = BlockDoublePlant.func_149890_d(i1); + } + + IIcon iicon = p_147774_1_.func_149888_a(flag1, k1); + this.drawCrossedSquares(iicon, d19, d0, d1, 1.0F); + + if (flag1 && k1 == 0) + { + IIcon iicon1 = p_147774_1_.sunflowerIcons[0]; + double d2 = Math.cos((double)j1 * 0.8D) * Math.PI * 0.1D; + double d3 = Math.cos(d2); + double d4 = Math.sin(d2); + double d5 = (double)iicon1.getMinU(); + double d6 = (double)iicon1.getMinV(); + double d7 = (double)iicon1.getMaxU(); + double d8 = (double)iicon1.getMaxV(); + double d9 = 0.3D; + double d10 = -0.05D; + double d11 = 0.5D + 0.3D * d3 - 0.5D * d4; + double d12 = 0.5D + 0.5D * d3 + 0.3D * d4; + double d13 = 0.5D + 0.3D * d3 + 0.5D * d4; + double d14 = 0.5D + -0.5D * d3 + 0.3D * d4; + double d15 = 0.5D + -0.05D * d3 + 0.5D * d4; + double d16 = 0.5D + -0.5D * d3 + -0.05D * d4; + double d17 = 0.5D + -0.05D * d3 - 0.5D * d4; + double d18 = 0.5D + 0.5D * d3 + -0.05D * d4; + tessellator.addVertexWithUV(d19 + d15, d0 + 1.0D, d1 + d16, d5, d8); + tessellator.addVertexWithUV(d19 + d17, d0 + 1.0D, d1 + d18, d7, d8); + tessellator.addVertexWithUV(d19 + d11, d0 + 0.0D, d1 + d12, d7, d6); + tessellator.addVertexWithUV(d19 + d13, d0 + 0.0D, d1 + d14, d5, d6); + IIcon iicon2 = p_147774_1_.sunflowerIcons[1]; + d5 = (double)iicon2.getMinU(); + d6 = (double)iicon2.getMinV(); + d7 = (double)iicon2.getMaxU(); + d8 = (double)iicon2.getMaxV(); + tessellator.addVertexWithUV(d19 + d17, d0 + 1.0D, d1 + d18, d5, d8); + tessellator.addVertexWithUV(d19 + d15, d0 + 1.0D, d1 + d16, d7, d8); + tessellator.addVertexWithUV(d19 + d13, d0 + 0.0D, d1 + d14, d7, d6); + tessellator.addVertexWithUV(d19 + d11, d0 + 0.0D, d1 + d12, d5, d6); + } + + return true; + } + + public boolean renderBlockStem(Block p_147724_1_, int p_147724_2_, int p_147724_3_, int p_147724_4_) + { + BlockStem blockstem = (BlockStem)p_147724_1_; + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(blockstem.getMixedBrightnessForBlock(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_)); + int l = blockstem.colorMultiplier(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + blockstem.setBlockBoundsBasedOnState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + int i1 = blockstem.getState(this.blockAccess, p_147724_2_, p_147724_3_, p_147724_4_); + + if (i1 < 0) + { + this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } + else + { + this.renderBlockStemSmall(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), 0.5D, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + this.renderBlockStemBig(blockstem, this.blockAccess.getBlockMetadata(p_147724_2_, p_147724_3_, p_147724_4_), i1, this.renderMaxY, (double)p_147724_2_, (double)((float)p_147724_3_ - 0.0625F), (double)p_147724_4_); + } + + return true; + } + + public boolean renderBlockCrops(Block p_147796_1_, int p_147796_2_, int p_147796_3_, int p_147796_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147796_1_.getMixedBrightnessForBlock(this.blockAccess, p_147796_2_, p_147796_3_, p_147796_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + this.renderBlockCropsImpl(p_147796_1_, this.blockAccess.getBlockMetadata(p_147796_2_, p_147796_3_, p_147796_4_), (double)p_147796_2_, (double)((float)p_147796_3_ - 0.0625F), (double)p_147796_4_); + return true; + } + + /** + * Renders a torch at the given coordinates, with the base slanting at the given delta + */ + public void renderTorchAtAngle(Block p_147747_1_, double p_147747_2_, double p_147747_4_, double p_147747_6_, double p_147747_8_, double p_147747_10_, int p_147747_12_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147747_1_, 0, p_147747_12_); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d5 = (double)iicon.getMinU(); + double d6 = (double)iicon.getMinV(); + double d7 = (double)iicon.getMaxU(); + double d8 = (double)iicon.getMaxV(); + double d9 = (double)iicon.getInterpolatedU(7.0D); + double d10 = (double)iicon.getInterpolatedV(6.0D); + double d11 = (double)iicon.getInterpolatedU(9.0D); + double d12 = (double)iicon.getInterpolatedV(8.0D); + double d13 = (double)iicon.getInterpolatedU(7.0D); + double d14 = (double)iicon.getInterpolatedV(13.0D); + double d15 = (double)iicon.getInterpolatedU(9.0D); + double d16 = (double)iicon.getInterpolatedV(15.0D); + p_147747_2_ += 0.5D; + p_147747_6_ += 0.5D; + double d17 = p_147747_2_ - 0.5D; + double d18 = p_147747_2_ + 0.5D; + double d19 = p_147747_6_ - 0.5D; + double d20 = p_147747_6_ + 0.5D; + double d21 = 0.0625D; + double d22 = 0.625D; + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - d22) - d21, p_147747_4_ + d22, p_147747_6_ + p_147747_10_ * (1.0D - d22) - d21, d9, d10); + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - d22) - d21, p_147747_4_ + d22, p_147747_6_ + p_147747_10_ * (1.0D - d22) + d21, d9, d12); + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - d22) + d21, p_147747_4_ + d22, p_147747_6_ + p_147747_10_ * (1.0D - d22) + d21, d11, d12); + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ * (1.0D - d22) + d21, p_147747_4_ + d22, p_147747_6_ + p_147747_10_ * (1.0D - d22) - d21, d11, d10); + tessellator.addVertexWithUV(p_147747_2_ + d21 + p_147747_8_, p_147747_4_, p_147747_6_ - d21 + p_147747_10_, d15, d14); + tessellator.addVertexWithUV(p_147747_2_ + d21 + p_147747_8_, p_147747_4_, p_147747_6_ + d21 + p_147747_10_, d15, d16); + tessellator.addVertexWithUV(p_147747_2_ - d21 + p_147747_8_, p_147747_4_, p_147747_6_ + d21 + p_147747_10_, d13, d16); + tessellator.addVertexWithUV(p_147747_2_ - d21 + p_147747_8_, p_147747_4_, p_147747_6_ - d21 + p_147747_10_, d13, d14); + tessellator.addVertexWithUV(p_147747_2_ - d21, p_147747_4_ + 1.0D, d19, d5, d6); + tessellator.addVertexWithUV(p_147747_2_ - d21 + p_147747_8_, p_147747_4_ + 0.0D, d19 + p_147747_10_, d5, d8); + tessellator.addVertexWithUV(p_147747_2_ - d21 + p_147747_8_, p_147747_4_ + 0.0D, d20 + p_147747_10_, d7, d8); + tessellator.addVertexWithUV(p_147747_2_ - d21, p_147747_4_ + 1.0D, d20, d7, d6); + tessellator.addVertexWithUV(p_147747_2_ + d21, p_147747_4_ + 1.0D, d20, d5, d6); + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ + d21, p_147747_4_ + 0.0D, d20 + p_147747_10_, d5, d8); + tessellator.addVertexWithUV(p_147747_2_ + p_147747_8_ + d21, p_147747_4_ + 0.0D, d19 + p_147747_10_, d7, d8); + tessellator.addVertexWithUV(p_147747_2_ + d21, p_147747_4_ + 1.0D, d19, d7, d6); + tessellator.addVertexWithUV(d17, p_147747_4_ + 1.0D, p_147747_6_ + d21, d5, d6); + tessellator.addVertexWithUV(d17 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + d21 + p_147747_10_, d5, d8); + tessellator.addVertexWithUV(d18 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ + d21 + p_147747_10_, d7, d8); + tessellator.addVertexWithUV(d18, p_147747_4_ + 1.0D, p_147747_6_ + d21, d7, d6); + tessellator.addVertexWithUV(d18, p_147747_4_ + 1.0D, p_147747_6_ - d21, d5, d6); + tessellator.addVertexWithUV(d18 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - d21 + p_147747_10_, d5, d8); + tessellator.addVertexWithUV(d17 + p_147747_8_, p_147747_4_ + 0.0D, p_147747_6_ - d21 + p_147747_10_, d7, d8); + tessellator.addVertexWithUV(d17, p_147747_4_ + 1.0D, p_147747_6_ - d21, d7, d6); + } + + /** + * Utility function to draw crossed swuares + */ + public void drawCrossedSquares(IIcon p_147765_1_, double p_147765_2_, double p_147765_4_, double p_147765_6_, float p_147765_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147765_1_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147765_1_.getMinU(); + double d4 = (double)p_147765_1_.getMinV(); + double d5 = (double)p_147765_1_.getMaxU(); + double d6 = (double)p_147765_1_.getMaxV(); + double d7 = 0.45D * (double)p_147765_8_; + double d8 = p_147765_2_ + 0.5D - d7; + double d9 = p_147765_2_ + 0.5D + d7; + double d10 = p_147765_6_ + 0.5D - d7; + double d11 = p_147765_6_ + 0.5D + d7; + tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, d3, d4); + tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, d5, d6); + tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, d5, d4); + tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, d3, d4); + tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, d3, d6); + tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, d5, d4); + tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, d3, d4); + tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, d3, d6); + tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, d5, d4); + tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, d3, d4); + tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, d5, d6); + tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, d5, d4); + } + + public void renderBlockStemSmall(Block p_147730_1_, int p_147730_2_, double p_147730_3_, double p_147730_5_, double p_147730_7_, double p_147730_9_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147730_1_, 0, p_147730_2_); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d4 = (double)iicon.getMinU(); + double d5 = (double)iicon.getMinV(); + double d6 = (double)iicon.getMaxU(); + double d7 = (double)iicon.getInterpolatedV(p_147730_3_ * 16.0D); + double d8 = p_147730_5_ + 0.5D - 0.44999998807907104D; + double d9 = p_147730_5_ + 0.5D + 0.44999998807907104D; + double d10 = p_147730_9_ + 0.5D - 0.44999998807907104D; + double d11 = p_147730_9_ + 0.5D + 0.44999998807907104D; + tessellator.addVertexWithUV(d8, p_147730_7_ + p_147730_3_, d10, d4, d5); + tessellator.addVertexWithUV(d8, p_147730_7_ + 0.0D, d10, d4, d7); + tessellator.addVertexWithUV(d9, p_147730_7_ + 0.0D, d11, d6, d7); + tessellator.addVertexWithUV(d9, p_147730_7_ + p_147730_3_, d11, d6, d5); + tessellator.addVertexWithUV(d9, p_147730_7_ + p_147730_3_, d11, d6, d5); + tessellator.addVertexWithUV(d9, p_147730_7_ + 0.0D, d11, d6, d7); + tessellator.addVertexWithUV(d8, p_147730_7_ + 0.0D, d10, d4, d7); + tessellator.addVertexWithUV(d8, p_147730_7_ + p_147730_3_, d10, d4, d5); + tessellator.addVertexWithUV(d8, p_147730_7_ + p_147730_3_, d11, d4, d5); + tessellator.addVertexWithUV(d8, p_147730_7_ + 0.0D, d11, d4, d7); + tessellator.addVertexWithUV(d9, p_147730_7_ + 0.0D, d10, d6, d7); + tessellator.addVertexWithUV(d9, p_147730_7_ + p_147730_3_, d10, d6, d5); + tessellator.addVertexWithUV(d9, p_147730_7_ + p_147730_3_, d10, d6, d5); + tessellator.addVertexWithUV(d9, p_147730_7_ + 0.0D, d10, d6, d7); + tessellator.addVertexWithUV(d8, p_147730_7_ + 0.0D, d11, d4, d7); + tessellator.addVertexWithUV(d8, p_147730_7_ + p_147730_3_, d11, d4, d5); + } + + public boolean renderBlockLilyPad(Block p_147783_1_, int p_147783_2_, int p_147783_3_, int p_147783_4_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSide(p_147783_1_, 1); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + float f = 0.015625F; + double d0 = (double)iicon.getMinU(); + double d1 = (double)iicon.getMinV(); + double d2 = (double)iicon.getMaxU(); + double d3 = (double)iicon.getMaxV(); + long l = (long)(p_147783_2_ * 3129871) ^ (long)p_147783_4_ * 116129781L ^ (long)p_147783_3_; + l = l * l * 42317861L + l * 11L; + int i1 = (int)(l >> 16 & 3L); + tessellator.setBrightness(p_147783_1_.getMixedBrightnessForBlock(this.blockAccess, p_147783_2_, p_147783_3_, p_147783_4_)); + float f1 = (float)p_147783_2_ + 0.5F; + float f2 = (float)p_147783_4_ + 0.5F; + float f3 = (float)(i1 & 1) * 0.5F * (float)(1 - i1 / 2 % 2 * 2); + float f4 = (float)(i1 + 1 & 1) * 0.5F * (float)(1 - (i1 + 1) / 2 % 2 * 2); + tessellator.setColorOpaque_I(p_147783_1_.getBlockColor()); + tessellator.addVertexWithUV((double)(f1 + f3 - f4), (double)((float)p_147783_3_ + f), (double)(f2 + f3 + f4), d0, d1); + tessellator.addVertexWithUV((double)(f1 + f3 + f4), (double)((float)p_147783_3_ + f), (double)(f2 - f3 + f4), d2, d1); + tessellator.addVertexWithUV((double)(f1 - f3 + f4), (double)((float)p_147783_3_ + f), (double)(f2 - f3 - f4), d2, d3); + tessellator.addVertexWithUV((double)(f1 - f3 - f4), (double)((float)p_147783_3_ + f), (double)(f2 + f3 - f4), d0, d3); + tessellator.setColorOpaque_I((p_147783_1_.getBlockColor() & 16711422) >> 1); + tessellator.addVertexWithUV((double)(f1 - f3 - f4), (double)((float)p_147783_3_ + f), (double)(f2 + f3 - f4), d0, d3); + tessellator.addVertexWithUV((double)(f1 - f3 + f4), (double)((float)p_147783_3_ + f), (double)(f2 - f3 - f4), d2, d3); + tessellator.addVertexWithUV((double)(f1 + f3 + f4), (double)((float)p_147783_3_ + f), (double)(f2 - f3 + f4), d2, d1); + tessellator.addVertexWithUV((double)(f1 + f3 - f4), (double)((float)p_147783_3_ + f), (double)(f2 + f3 + f4), d0, d1); + return true; + } + + public void renderBlockStemBig(BlockStem p_147740_1_, int p_147740_2_, int p_147740_3_, double p_147740_4_, double p_147740_6_, double p_147740_8_, double p_147740_10_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = p_147740_1_.getStemIcon(); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d4 = (double)iicon.getMinU(); + double d5 = (double)iicon.getMinV(); + double d6 = (double)iicon.getMaxU(); + double d7 = (double)iicon.getMaxV(); + double d8 = p_147740_6_ + 0.5D - 0.5D; + double d9 = p_147740_6_ + 0.5D + 0.5D; + double d10 = p_147740_10_ + 0.5D - 0.5D; + double d11 = p_147740_10_ + 0.5D + 0.5D; + double d12 = p_147740_6_ + 0.5D; + double d13 = p_147740_10_ + 0.5D; + + if ((p_147740_3_ + 1) / 2 % 2 == 1) + { + double d14 = d6; + d6 = d4; + d4 = d14; + } + + if (p_147740_3_ < 2) + { + tessellator.addVertexWithUV(d8, p_147740_8_ + p_147740_4_, d13, d4, d5); + tessellator.addVertexWithUV(d8, p_147740_8_ + 0.0D, d13, d4, d7); + tessellator.addVertexWithUV(d9, p_147740_8_ + 0.0D, d13, d6, d7); + tessellator.addVertexWithUV(d9, p_147740_8_ + p_147740_4_, d13, d6, d5); + tessellator.addVertexWithUV(d9, p_147740_8_ + p_147740_4_, d13, d6, d5); + tessellator.addVertexWithUV(d9, p_147740_8_ + 0.0D, d13, d6, d7); + tessellator.addVertexWithUV(d8, p_147740_8_ + 0.0D, d13, d4, d7); + tessellator.addVertexWithUV(d8, p_147740_8_ + p_147740_4_, d13, d4, d5); + } + else + { + tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d11, d4, d5); + tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d11, d4, d7); + tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d10, d6, d7); + tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d10, d6, d5); + tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d10, d6, d5); + tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d10, d6, d7); + tessellator.addVertexWithUV(d12, p_147740_8_ + 0.0D, d11, d4, d7); + tessellator.addVertexWithUV(d12, p_147740_8_ + p_147740_4_, d11, d4, d5); + } + } + + /** + * Render block crops implementation + */ + public void renderBlockCropsImpl(Block p_147795_1_, int p_147795_2_, double p_147795_3_, double p_147795_5_, double p_147795_7_) + { + Tessellator tessellator = Tessellator.instance; + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147795_1_, 0, p_147795_2_); + + if (this.hasOverrideBlockTexture()) + { + iicon = this.overrideBlockTexture; + } + + double d3 = (double)iicon.getMinU(); + double d4 = (double)iicon.getMinV(); + double d5 = (double)iicon.getMaxU(); + double d6 = (double)iicon.getMaxV(); + double d7 = p_147795_3_ + 0.5D - 0.25D; + double d8 = p_147795_3_ + 0.5D + 0.25D; + double d9 = p_147795_7_ + 0.5D - 0.5D; + double d10 = p_147795_7_ + 0.5D + 0.5D; + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d9, d3, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d9, d3, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d10, d5, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d10, d3, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d9, d5, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d9, d5, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d10, d3, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d9, d5, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d9, d5, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d9, d3, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d9, d3, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d10, d5, d4); + d7 = p_147795_3_ + 0.5D - 0.5D; + d8 = p_147795_3_ + 0.5D + 0.5D; + d9 = p_147795_7_ + 0.5D - 0.25D; + d10 = p_147795_7_ + 0.5D + 0.25D; + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d9, d3, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d9, d3, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d9, d5, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d9, d5, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d9, d3, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d9, d3, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d9, d5, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d9, d5, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d10, d3, d4); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d10, d5, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 1.0D, d10, d3, d4); + tessellator.addVertexWithUV(d7, p_147795_5_ + 0.0D, d10, d3, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 0.0D, d10, d5, d6); + tessellator.addVertexWithUV(d8, p_147795_5_ + 1.0D, d10, d5, d4); + } + + /** + * Renders a block based on the BlockLiquid class at the given coordinates + */ + public boolean renderBlockLiquid(Block p_147721_1_, int p_147721_2_, int p_147721_3_, int p_147721_4_) + { + Tessellator tessellator = Tessellator.instance; + int l = p_147721_1_.colorMultiplier(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + boolean flag = p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_ + 1, p_147721_4_, 1); + boolean flag1 = p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_ - 1, p_147721_4_, 0); + boolean[] aboolean = new boolean[] {p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_ - 1, 2), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_ + 1, 3), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_ - 1, p_147721_3_, p_147721_4_, 4), p_147721_1_.shouldSideBeRendered(this.blockAccess, p_147721_2_ + 1, p_147721_3_, p_147721_4_, 5)}; + + if (!flag && !flag1 && !aboolean[0] && !aboolean[1] && !aboolean[2] && !aboolean[3]) + { + return false; + } + else + { + boolean flag2 = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + double d0 = 0.0D; + double d1 = 1.0D; + Material material = p_147721_1_.getMaterial(); + int i1 = this.blockAccess.getBlockMetadata(p_147721_2_, p_147721_3_, p_147721_4_); + double d2 = (double)this.getLiquidHeight(p_147721_2_, p_147721_3_, p_147721_4_, material); + double d3 = (double)this.getLiquidHeight(p_147721_2_, p_147721_3_, p_147721_4_ + 1, material); + double d4 = (double)this.getLiquidHeight(p_147721_2_ + 1, p_147721_3_, p_147721_4_ + 1, material); + double d5 = (double)this.getLiquidHeight(p_147721_2_ + 1, p_147721_3_, p_147721_4_, material); + double d6 = 0.0010000000474974513D; + float f9; + float f10; + float f11; + + if (this.renderAllFaces || flag) + { + flag2 = true; + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147721_1_, 1, i1); + float f7 = (float)BlockLiquid.getFlowDirection(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_, material); + + if (f7 > -999.0F) + { + iicon = this.getBlockIconFromSideAndMetadata(p_147721_1_, 2, i1); + } + + d2 -= d6; + d3 -= d6; + d4 -= d6; + d5 -= d6; + double d7; + double d8; + double d10; + double d12; + double d14; + double d16; + double d18; + double d20; + + if (f7 < -999.0F) + { + d7 = (double)iicon.getInterpolatedU(0.0D); + d14 = (double)iicon.getInterpolatedV(0.0D); + d8 = d7; + d16 = (double)iicon.getInterpolatedV(16.0D); + d10 = (double)iicon.getInterpolatedU(16.0D); + d18 = d16; + d12 = d10; + d20 = d14; + } + else + { + f9 = MathHelper.sin(f7) * 0.25F; + f10 = MathHelper.cos(f7) * 0.25F; + f11 = 8.0F; + d7 = (double)iicon.getInterpolatedU((double)(8.0F + (-f10 - f9) * 16.0F)); + d14 = (double)iicon.getInterpolatedV((double)(8.0F + (-f10 + f9) * 16.0F)); + d8 = (double)iicon.getInterpolatedU((double)(8.0F + (-f10 + f9) * 16.0F)); + d16 = (double)iicon.getInterpolatedV((double)(8.0F + (f10 + f9) * 16.0F)); + d10 = (double)iicon.getInterpolatedU((double)(8.0F + (f10 + f9) * 16.0F)); + d18 = (double)iicon.getInterpolatedV((double)(8.0F + (f10 - f9) * 16.0F)); + d12 = (double)iicon.getInterpolatedU((double)(8.0F + (f10 - f9) * 16.0F)); + d20 = (double)iicon.getInterpolatedV((double)(8.0F + (-f10 - f9) * 16.0F)); + } + + tessellator.setBrightness(p_147721_1_.getMixedBrightnessForBlock(this.blockAccess, p_147721_2_, p_147721_3_, p_147721_4_)); + tessellator.setColorOpaque_F(f4 * f, f4 * f1, f4 * f2); + tessellator.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + d2, (double)(p_147721_4_ + 0), d7, d14); + tessellator.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + d3, (double)(p_147721_4_ + 1), d8, d16); + tessellator.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + d4, (double)(p_147721_4_ + 1), d10, d18); + tessellator.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + d5, (double)(p_147721_4_ + 0), d12, d20); + tessellator.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + d2, (double)(p_147721_4_ + 0), d7, d14); + tessellator.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + d5, (double)(p_147721_4_ + 0), d12, d20); + tessellator.addVertexWithUV((double)(p_147721_2_ + 1), (double)p_147721_3_ + d4, (double)(p_147721_4_ + 1), d10, d18); + tessellator.addVertexWithUV((double)(p_147721_2_ + 0), (double)p_147721_3_ + d3, (double)(p_147721_4_ + 1), d8, d16); + } + + if (this.renderAllFaces || flag1) + { + tessellator.setBrightness(p_147721_1_.getMixedBrightnessForBlock(this.blockAccess, p_147721_2_, p_147721_3_ - 1, p_147721_4_)); + tessellator.setColorOpaque_F(f3, f3, f3); + this.renderFaceYNeg(p_147721_1_, (double)p_147721_2_, (double)p_147721_3_ + d6, (double)p_147721_4_, this.getBlockIconFromSide(p_147721_1_, 0)); + flag2 = true; + } + + for (int k1 = 0; k1 < 4; ++k1) + { + int l1 = p_147721_2_; + int j1 = p_147721_4_; + + if (k1 == 0) + { + j1 = p_147721_4_ - 1; + } + + if (k1 == 1) + { + ++j1; + } + + if (k1 == 2) + { + l1 = p_147721_2_ - 1; + } + + if (k1 == 3) + { + ++l1; + } + + IIcon iicon1 = this.getBlockIconFromSideAndMetadata(p_147721_1_, k1 + 2, i1); + + if (this.renderAllFaces || aboolean[k1]) + { + double d9; + double d11; + double d13; + double d15; + double d17; + double d19; + + if (k1 == 0) + { + d9 = d2; + d11 = d5; + d13 = (double)p_147721_2_; + d17 = (double)(p_147721_2_ + 1); + d15 = (double)p_147721_4_ + d6; + d19 = (double)p_147721_4_ + d6; + } + else if (k1 == 1) + { + d9 = d4; + d11 = d3; + d13 = (double)(p_147721_2_ + 1); + d17 = (double)p_147721_2_; + d15 = (double)(p_147721_4_ + 1) - d6; + d19 = (double)(p_147721_4_ + 1) - d6; + } + else if (k1 == 2) + { + d9 = d3; + d11 = d2; + d13 = (double)p_147721_2_ + d6; + d17 = (double)p_147721_2_ + d6; + d15 = (double)(p_147721_4_ + 1); + d19 = (double)p_147721_4_; + } + else + { + d9 = d5; + d11 = d4; + d13 = (double)(p_147721_2_ + 1) - d6; + d17 = (double)(p_147721_2_ + 1) - d6; + d15 = (double)p_147721_4_; + d19 = (double)(p_147721_4_ + 1); + } + + flag2 = true; + float f8 = iicon1.getInterpolatedU(0.0D); + f9 = iicon1.getInterpolatedU(8.0D); + f10 = iicon1.getInterpolatedV((1.0D - d9) * 16.0D * 0.5D); + f11 = iicon1.getInterpolatedV((1.0D - d11) * 16.0D * 0.5D); + float f12 = iicon1.getInterpolatedV(8.0D); + tessellator.setBrightness(p_147721_1_.getMixedBrightnessForBlock(this.blockAccess, l1, p_147721_3_, j1)); + float f13 = 1.0F; + f13 *= k1 < 2 ? f5 : f6; + tessellator.setColorOpaque_F(f4 * f13 * f, f4 * f13 * f1, f4 * f13 * f2); + tessellator.addVertexWithUV(d13, (double)p_147721_3_ + d9, d15, (double)f8, (double)f10); + tessellator.addVertexWithUV(d17, (double)p_147721_3_ + d11, d19, (double)f9, (double)f11); + tessellator.addVertexWithUV(d17, (double)(p_147721_3_ + 0), d19, (double)f9, (double)f12); + tessellator.addVertexWithUV(d13, (double)(p_147721_3_ + 0), d15, (double)f8, (double)f12); + tessellator.addVertexWithUV(d13, (double)(p_147721_3_ + 0), d15, (double)f8, (double)f12); + tessellator.addVertexWithUV(d17, (double)(p_147721_3_ + 0), d19, (double)f9, (double)f12); + tessellator.addVertexWithUV(d17, (double)p_147721_3_ + d11, d19, (double)f9, (double)f11); + tessellator.addVertexWithUV(d13, (double)p_147721_3_ + d9, d15, (double)f8, (double)f10); + } + } + + this.renderMinY = d0; + this.renderMaxY = d1; + return flag2; + } + } + + public float getLiquidHeight(int p_147729_1_, int p_147729_2_, int p_147729_3_, Material p_147729_4_) + { + int l = 0; + float f = 0.0F; + + for (int i1 = 0; i1 < 4; ++i1) + { + int j1 = p_147729_1_ - (i1 & 1); + int k1 = p_147729_3_ - (i1 >> 1 & 1); + + if (this.blockAccess.getBlock(j1, p_147729_2_ + 1, k1).getMaterial() == p_147729_4_) + { + return 1.0F; + } + + Material material1 = this.blockAccess.getBlock(j1, p_147729_2_, k1).getMaterial(); + + if (material1 == p_147729_4_) + { + int l1 = this.blockAccess.getBlockMetadata(j1, p_147729_2_, k1); + + if (l1 >= 8 || l1 == 0) + { + f += BlockLiquid.getLiquidHeightPercent(l1) * 10.0F; + l += 10; + } + + f += BlockLiquid.getLiquidHeightPercent(l1); + ++l; + } + else if (!material1.isSolid()) + { + ++f; + ++l; + } + } + + return 1.0F - f / (float)l; + } + + public void renderBlockSandFalling(Block p_147749_1_, World p_147749_2_, int p_147749_3_, int p_147749_4_, int p_147749_5_, int p_147749_6_) + { + float f = 0.5F; + float f1 = 1.0F; + float f2 = 0.8F; + float f3 = 0.6F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setBrightness(p_147749_1_.getMixedBrightnessForBlock(p_147749_2_, p_147749_3_, p_147749_4_, p_147749_5_)); + tessellator.setColorOpaque_F(f, f, f); + this.renderFaceYNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 0, p_147749_6_)); + tessellator.setColorOpaque_F(f1, f1, f1); + this.renderFaceYPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 1, p_147749_6_)); + tessellator.setColorOpaque_F(f2, f2, f2); + this.renderFaceZNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 2, p_147749_6_)); + tessellator.setColorOpaque_F(f2, f2, f2); + this.renderFaceZPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 3, p_147749_6_)); + tessellator.setColorOpaque_F(f3, f3, f3); + this.renderFaceXNeg(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 4, p_147749_6_)); + tessellator.setColorOpaque_F(f3, f3, f3); + this.renderFaceXPos(p_147749_1_, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(p_147749_1_, 5, p_147749_6_)); + tessellator.draw(); + } + + /** + * Renders a standard cube block at the given coordinates + */ + public boolean renderStandardBlock(Block blockType, int blockX, int blockY, int blockZ) + { + int l = blockType.colorMultiplier(this.blockAccess, blockX, blockY, blockZ); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + return Minecraft.isAmbientOcclusionEnabled() && blockType.getLightValue() == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(blockType, blockX, blockY, blockZ, f, f1, f2) : this.renderStandardBlockWithAmbientOcclusion(blockType, blockX, blockY, blockZ, f, f1, f2)) : this.renderStandardBlockWithColorMultiplier(blockType, blockX, blockY, blockZ, f, f1, f2); + } + + public boolean renderBlockLog(Block p_147742_1_, int p_147742_2_, int p_147742_3_, int p_147742_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147742_2_, p_147742_3_, p_147742_4_); + int i1 = l & 12; + + if (i1 == 4) + { + this.uvRotateEast = 1; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 1; + } + else if (i1 == 8) + { + this.uvRotateSouth = 1; + this.uvRotateNorth = 1; + } + + boolean flag = this.renderStandardBlock(p_147742_1_, p_147742_2_, p_147742_3_, p_147742_4_); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return flag; + } + + public boolean renderBlockQuartz(Block p_147779_1_, int p_147779_2_, int p_147779_3_, int p_147779_4_) + { + int l = this.blockAccess.getBlockMetadata(p_147779_2_, p_147779_3_, p_147779_4_); + + if (l == 3) + { + this.uvRotateEast = 1; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 1; + } + else if (l == 4) + { + this.uvRotateSouth = 1; + this.uvRotateNorth = 1; + } + + boolean flag = this.renderStandardBlock(p_147779_1_, p_147779_2_, p_147779_3_, p_147779_4_); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateNorth = 0; + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + return flag; + } + + public boolean renderStandardBlockWithAmbientOcclusion(Block p_147751_1_, int p_147751_2_, int p_147751_3_, int p_147751_4_, float p_147751_5_, float p_147751_6_, float p_147751_7_) + { + this.enableAO = true; + boolean flag = false; + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + boolean flag1 = true; + int l = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(983055); + + if (this.getBlockIcon(p_147751_1_).getIconName().equals("grass_top")) + { + flag1 = false; + } + else if (this.hasOverrideBlockTexture()) + { + flag1 = false; + } + + boolean flag2; + boolean flag3; + boolean flag4; + boolean flag5; + int i1; + float f7; + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_, 0)) + { + if (this.renderMinY <= 0.0D) + { + --p_147751_3_; + } + + this.aoBrightnessXYNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessYZNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoLightValueScratchXYNN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + flag2 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if (this.renderMinY <= 0.0D) + { + ++p_147751_3_; + } + + i1 = l; + + if (this.renderMinY <= 0.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + } + + f7 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7) / 4.0F; + f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; + f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * 0.5F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * 0.5F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * 0.5F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + this.renderFaceYNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 0)); + flag = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_, 1)) + { + if (this.renderMaxY >= 1.0D) + { + ++p_147751_3_; + } + + this.aoBrightnessXYNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessXYPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessYZPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoLightValueScratchXYNP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + flag2 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1); + } + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1); + } + + if (this.renderMaxY >= 1.0D) + { + --p_147751_3_; + } + + i1 = l; + + if (this.renderMaxY >= 1.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + } + + f7 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7) / 4.0F; + f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1); + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_; + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + this.renderFaceYPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 1)); + flag = true; + } + + IIcon iicon; + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1, 2)) + { + if (this.renderMinZ <= 0.0D) + { + --p_147751_4_; + } + + this.aoLightValueScratchXZNN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXZNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessYZPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + this.aoBrightnessXZPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + flag2 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if (this.renderMinZ <= 0.0D) + { + ++p_147751_4_; + } + + i1 = l; + + if (this.renderMinZ <= 0.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + } + + f7 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + f3 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F; + f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; + f6 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * 0.8F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 2); + this.renderFaceZNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceZNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1, 3)) + { + if (this.renderMaxZ >= 1.0D) + { + ++p_147751_4_; + } + + this.aoLightValueScratchXZNP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXZNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + this.aoBrightnessXZPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + this.aoBrightnessYZNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessYZPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + flag2 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_); + } + + if (this.renderMaxZ >= 1.0D) + { + --p_147751_4_; + } + + i1 = l; + + if (this.renderMaxZ >= 1.0D || !this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + } + + f7 = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + f3 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP) / 4.0F; + f6 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + f5 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; + f4 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * 0.8F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 3); + this.renderFaceZPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 3)); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceZPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_, 4)) + { + if (this.renderMinX <= 0.0D) + { + --p_147751_2_; + } + + this.aoLightValueScratchXYNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXZNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXZNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + flag2 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if (this.renderMinX <= 0.0D) + { + ++p_147751_2_; + } + + i1 = l; + + if (this.renderMinX <= 0.0D || !this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ - 1, p_147751_3_, p_147751_4_); + } + + f7 = this.blockAccess.getBlock(p_147751_2_ - 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + f6 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP) / 4.0F; + f3 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + f4 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; + f5 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * 0.6F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 4); + this.renderFaceXNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceXNeg(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147751_1_.shouldSideBeRendered(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_, 5)) + { + if (this.renderMaxX >= 1.0D) + { + ++p_147751_2_; + } + + this.aoLightValueScratchXYPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_); + this.aoBrightnessXZPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ - 1); + this.aoBrightnessXZPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_ + 1); + this.aoBrightnessXYPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_); + flag2 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ + 1, p_147751_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_ - 1, p_147751_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_ - 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ - 1); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ - 1, p_147751_4_ + 1); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ - 1); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_, p_147751_3_ + 1, p_147751_4_ + 1); + } + + if (this.renderMaxX >= 1.0D) + { + --p_147751_2_; + } + + i1 = l; + + if (this.renderMaxX >= 1.0D || !this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).isOpaqueCube()) + { + i1 = p_147751_1_.getMixedBrightnessForBlock(this.blockAccess, p_147751_2_ + 1, p_147751_3_, p_147751_4_); + } + + f7 = this.blockAccess.getBlock(p_147751_2_ + 1, p_147751_3_, p_147751_4_).getAmbientOcclusionLightValue(); + f3 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP) / 4.0F; + f4 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7) / 4.0F; + f5 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; + f6 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147751_5_ * 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147751_6_ * 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147751_7_ * 0.6F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147751_1_, this.blockAccess, p_147751_2_, p_147751_3_, p_147751_4_, 5); + this.renderFaceXPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147751_5_; + this.colorRedBottomLeft *= p_147751_5_; + this.colorRedBottomRight *= p_147751_5_; + this.colorRedTopRight *= p_147751_5_; + this.colorGreenTopLeft *= p_147751_6_; + this.colorGreenBottomLeft *= p_147751_6_; + this.colorGreenBottomRight *= p_147751_6_; + this.colorGreenTopRight *= p_147751_6_; + this.colorBlueTopLeft *= p_147751_7_; + this.colorBlueBottomLeft *= p_147751_7_; + this.colorBlueBottomRight *= p_147751_7_; + this.colorBlueTopRight *= p_147751_7_; + this.renderFaceXPos(p_147751_1_, (double)p_147751_2_, (double)p_147751_3_, (double)p_147751_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + this.enableAO = false; + return flag; + } + + /** + * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting) + */ + public boolean renderStandardBlockWithAmbientOcclusionPartial(Block p_147808_1_, int p_147808_2_, int p_147808_3_, int p_147808_4_, float p_147808_5_, float p_147808_6_, float p_147808_7_) + { + this.enableAO = true; + boolean flag = false; + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + boolean flag1 = true; + int l = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_); + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(983055); + + if (this.getBlockIcon(p_147808_1_).getIconName().equals("grass_top")) + { + flag1 = false; + } + else if (this.hasOverrideBlockTexture()) + { + flag1 = false; + } + + boolean flag2; + boolean flag3; + boolean flag4; + boolean flag5; + int i1; + float f7; + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_, 0)) + { + if (this.renderMinY <= 0.0D) + { + --p_147808_3_; + } + + this.aoBrightnessXYNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessYZNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoLightValueScratchXYNN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + flag2 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if (this.renderMinY <= 0.0D) + { + ++p_147808_3_; + } + + i1 = l; + + if (this.renderMinY <= 0.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + } + + f7 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7) / 4.0F; + f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; + f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN) / 4.0F; + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * 0.5F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * 0.5F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * 0.5F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + this.renderFaceYNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 0)); + flag = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_, 1)) + { + if (this.renderMaxY >= 1.0D) + { + ++p_147808_3_; + } + + this.aoBrightnessXYNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessXYPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessYZPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoLightValueScratchXYNP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + flag2 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1); + } + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1); + } + + if (this.renderMaxY >= 1.0D) + { + --p_147808_3_; + } + + i1 = l; + + if (this.renderMaxY >= 1.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + } + + f7 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7) / 4.0F; + f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F; + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1); + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1); + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_; + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + this.renderFaceYPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 1)); + flag = true; + } + + float f8; + float f9; + float f10; + float f11; + int j1; + int k1; + int l1; + int i2; + IIcon iicon; + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1, 2)) + { + if (this.renderMinZ <= 0.0D) + { + --p_147808_4_; + } + + this.aoLightValueScratchXZNN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXZNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessYZPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + this.aoBrightnessXZPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + flag2 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if (this.renderMinZ <= 0.0D) + { + ++p_147808_4_; + } + + i1 = l; + + if (this.renderMinZ <= 0.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + } + + f7 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + f8 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN) / 4.0F; + f9 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + f10 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; + f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7) / 4.0F; + f3 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMinX) + (double)f9 * this.renderMaxY * this.renderMinX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMinX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + f4 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMaxY * this.renderMaxX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + f5 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMinY * this.renderMaxX + (double)f10 * (1.0D - this.renderMinY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + f6 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMinX) + (double)f9 * this.renderMinY * this.renderMinX + (double)f10 * (1.0D - this.renderMinY) * this.renderMinX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + j1 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1); + k1 = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1); + l1 = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1); + i2 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1); + this.brightnessTopLeft = this.mixAoBrightness(j1, k1, l1, i2, this.renderMaxY * (1.0D - this.renderMinX), this.renderMaxY * this.renderMinX, (1.0D - this.renderMaxY) * this.renderMinX, (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + this.brightnessBottomLeft = this.mixAoBrightness(j1, k1, l1, i2, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + this.brightnessBottomRight = this.mixAoBrightness(j1, k1, l1, i2, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + this.brightnessTopRight = this.mixAoBrightness(j1, k1, l1, i2, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * 0.8F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 2); + this.renderFaceZNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceZNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1, 3)) + { + if (this.renderMaxZ >= 1.0D) + { + ++p_147808_4_; + } + + this.aoLightValueScratchXZNP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchYZPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXZNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + this.aoBrightnessXZPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + this.aoBrightnessYZNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessYZPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + flag2 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_); + } + + if (this.renderMaxZ >= 1.0D) + { + --p_147808_4_; + } + + i1 = l; + + if (this.renderMaxZ >= 1.0D || !this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + } + + f7 = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + f8 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP) / 4.0F; + f9 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + f10 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; + f11 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7) / 4.0F; + f3 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMinX) + (double)f9 * this.renderMaxY * this.renderMinX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMinX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX)); + f4 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMinX) + (double)f9 * this.renderMinY * this.renderMinX + (double)f10 * (1.0D - this.renderMinY) * this.renderMinX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); + f5 = (float)((double)f8 * this.renderMinY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMinY * this.renderMaxX + (double)f10 * (1.0D - this.renderMinY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + f6 = (float)((double)f8 * this.renderMaxY * (1.0D - this.renderMaxX) + (double)f9 * this.renderMaxY * this.renderMaxX + (double)f10 * (1.0D - this.renderMaxY) * this.renderMaxX + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + j1 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1); + k1 = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1); + l1 = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1); + i2 = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1); + this.brightnessTopLeft = this.mixAoBrightness(j1, i2, l1, k1, this.renderMaxY * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * (1.0D - this.renderMinX), (1.0D - this.renderMaxY) * this.renderMinX, this.renderMaxY * this.renderMinX); + this.brightnessBottomLeft = this.mixAoBrightness(j1, i2, l1, k1, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX); + this.brightnessBottomRight = this.mixAoBrightness(j1, i2, l1, k1, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX); + this.brightnessTopRight = this.mixAoBrightness(j1, i2, l1, k1, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * 0.8F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 3); + this.renderFaceZPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceZPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_, 4)) + { + if (this.renderMinX <= 0.0D) + { + --p_147808_2_; + } + + this.aoLightValueScratchXYNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXZNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXZNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + flag2 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + + if (!flag4 && !flag3) + { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if (!flag5 && !flag3) + { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if (!flag4 && !flag2) + { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } + else + { + this.aoLightValueScratchXYZNPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if (!flag5 && !flag2) + { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } + else + { + this.aoLightValueScratchXYZNPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZNPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if (this.renderMinX <= 0.0D) + { + ++p_147808_2_; + } + + i1 = l; + + if (this.renderMinX <= 0.0D || !this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ - 1, p_147808_3_, p_147808_4_); + } + + f7 = this.blockAccess.getBlock(p_147808_2_ - 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + f8 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP) / 4.0F; + f9 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + f10 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; + f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7) / 4.0F; + f3 = (float)((double)f9 * this.renderMaxY * this.renderMaxZ + (double)f10 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)f8 * (1.0D - this.renderMaxY) * this.renderMaxZ); + f4 = (float)((double)f9 * this.renderMaxY * this.renderMinZ + (double)f10 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)f8 * (1.0D - this.renderMaxY) * this.renderMinZ); + f5 = (float)((double)f9 * this.renderMinY * this.renderMinZ + (double)f10 * this.renderMinY * (1.0D - this.renderMinZ) + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)f8 * (1.0D - this.renderMinY) * this.renderMinZ); + f6 = (float)((double)f9 * this.renderMinY * this.renderMaxZ + (double)f10 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)f8 * (1.0D - this.renderMinY) * this.renderMaxZ); + j1 = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1); + k1 = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1); + l1 = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1); + i2 = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1); + this.brightnessTopLeft = this.mixAoBrightness(k1, l1, i2, j1, this.renderMaxY * this.renderMaxZ, this.renderMaxY * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMaxY) * this.renderMaxZ); + this.brightnessBottomLeft = this.mixAoBrightness(k1, l1, i2, j1, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(k1, l1, i2, j1, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(k1, l1, i2, j1, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * 0.6F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 4); + this.renderFaceXNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceXNeg(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147808_1_.shouldSideBeRendered(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_, 5)) + { + if (this.renderMaxX >= 1.0D) + { + ++p_147808_2_; + } + + this.aoLightValueScratchXYPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXZPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoLightValueScratchXYPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_).getAmbientOcclusionLightValue(); + this.aoBrightnessXYPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_); + this.aoBrightnessXZPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ - 1); + this.aoBrightnessXZPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_ + 1); + this.aoBrightnessXYPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_); + flag2 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ + 1, p_147808_4_).getCanBlockGrass(); + flag3 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_ - 1, p_147808_4_).getCanBlockGrass(); + flag4 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ + 1).getCanBlockGrass(); + flag5 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_ - 1).getCanBlockGrass(); + + if (!flag3 && !flag5) + { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPNN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ - 1); + } + + if (!flag3 && !flag4) + { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPNP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPNP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ - 1, p_147808_4_ + 1); + } + + if (!flag2 && !flag5) + { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } + else + { + this.aoLightValueScratchXYZPPN = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPN = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ - 1); + } + + if (!flag2 && !flag4) + { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } + else + { + this.aoLightValueScratchXYZPPP = this.blockAccess.getBlock(p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1).getAmbientOcclusionLightValue(); + this.aoBrightnessXYZPPP = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_, p_147808_3_ + 1, p_147808_4_ + 1); + } + + if (this.renderMaxX >= 1.0D) + { + --p_147808_2_; + } + + i1 = l; + + if (this.renderMaxX >= 1.0D || !this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).isOpaqueCube()) + { + i1 = p_147808_1_.getMixedBrightnessForBlock(this.blockAccess, p_147808_2_ + 1, p_147808_3_, p_147808_4_); + } + + f7 = this.blockAccess.getBlock(p_147808_2_ + 1, p_147808_3_, p_147808_4_).getAmbientOcclusionLightValue(); + f8 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP) / 4.0F; + f9 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7) / 4.0F; + f10 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; + f11 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F; + f3 = (float)((double)f8 * (1.0D - this.renderMinY) * this.renderMaxZ + (double)f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ) + (double)f10 * this.renderMinY * (1.0D - this.renderMaxZ) + (double)f11 * this.renderMinY * this.renderMaxZ); + f4 = (float)((double)f8 * (1.0D - this.renderMinY) * this.renderMinZ + (double)f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ) + (double)f10 * this.renderMinY * (1.0D - this.renderMinZ) + (double)f11 * this.renderMinY * this.renderMinZ); + f5 = (float)((double)f8 * (1.0D - this.renderMaxY) * this.renderMinZ + (double)f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ) + (double)f10 * this.renderMaxY * (1.0D - this.renderMinZ) + (double)f11 * this.renderMaxY * this.renderMinZ); + f6 = (float)((double)f8 * (1.0D - this.renderMaxY) * this.renderMaxZ + (double)f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ) + (double)f10 * this.renderMaxY * (1.0D - this.renderMaxZ) + (double)f11 * this.renderMaxY * this.renderMaxZ); + j1 = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1); + k1 = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1); + l1 = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1); + i2 = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1); + this.brightnessTopLeft = this.mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMinY) * this.renderMaxZ, (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), this.renderMinY * (1.0D - this.renderMaxZ), this.renderMinY * this.renderMaxZ); + this.brightnessBottomLeft = this.mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(j1, i2, l1, k1, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ); + + if (flag1) + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = p_147808_5_ * 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = p_147808_6_ * 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = p_147808_7_ * 0.6F; + } + else + { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; + this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; + } + + this.colorRedTopLeft *= f3; + this.colorGreenTopLeft *= f3; + this.colorBlueTopLeft *= f3; + this.colorRedBottomLeft *= f4; + this.colorGreenBottomLeft *= f4; + this.colorBlueBottomLeft *= f4; + this.colorRedBottomRight *= f5; + this.colorGreenBottomRight *= f5; + this.colorBlueBottomRight *= f5; + this.colorRedTopRight *= f6; + this.colorGreenTopRight *= f6; + this.colorBlueTopRight *= f6; + iicon = this.getBlockIcon(p_147808_1_, this.blockAccess, p_147808_2_, p_147808_3_, p_147808_4_, 5); + this.renderFaceXPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + this.colorRedTopLeft *= p_147808_5_; + this.colorRedBottomLeft *= p_147808_5_; + this.colorRedBottomRight *= p_147808_5_; + this.colorRedTopRight *= p_147808_5_; + this.colorGreenTopLeft *= p_147808_6_; + this.colorGreenBottomLeft *= p_147808_6_; + this.colorGreenBottomRight *= p_147808_6_; + this.colorGreenTopRight *= p_147808_6_; + this.colorBlueTopLeft *= p_147808_7_; + this.colorBlueBottomLeft *= p_147808_7_; + this.colorBlueBottomRight *= p_147808_7_; + this.colorBlueTopRight *= p_147808_7_; + this.renderFaceXPos(p_147808_1_, (double)p_147808_2_, (double)p_147808_3_, (double)p_147808_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + this.enableAO = false; + return flag; + } + + /** + * Get ambient occlusion brightness + */ + public int getAoBrightness(int p_147778_1_, int p_147778_2_, int p_147778_3_, int p_147778_4_) + { + if (p_147778_1_ == 0) + { + p_147778_1_ = p_147778_4_; + } + + if (p_147778_2_ == 0) + { + p_147778_2_ = p_147778_4_; + } + + if (p_147778_3_ == 0) + { + p_147778_3_ = p_147778_4_; + } + + return p_147778_1_ + p_147778_2_ + p_147778_3_ + p_147778_4_ >> 2 & 16711935; + } + + public int mixAoBrightness(int p_147727_1_, int p_147727_2_, int p_147727_3_, int p_147727_4_, double p_147727_5_, double p_147727_7_, double p_147727_9_, double p_147727_11_) + { + int i1 = (int)((double)(p_147727_1_ >> 16 & 255) * p_147727_5_ + (double)(p_147727_2_ >> 16 & 255) * p_147727_7_ + (double)(p_147727_3_ >> 16 & 255) * p_147727_9_ + (double)(p_147727_4_ >> 16 & 255) * p_147727_11_) & 255; + int j1 = (int)((double)(p_147727_1_ & 255) * p_147727_5_ + (double)(p_147727_2_ & 255) * p_147727_7_ + (double)(p_147727_3_ & 255) * p_147727_9_ + (double)(p_147727_4_ & 255) * p_147727_11_) & 255; + return i1 << 16 | j1; + } + + /** + * Renders a standard cube block at the given coordinates, with a given color ratio. Args: block, x, y, z, r, g, b + */ + public boolean renderStandardBlockWithColorMultiplier(Block p_147736_1_, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_) + { + this.enableAO = false; + Tessellator tessellator = Tessellator.instance; + boolean flag = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + float f7 = f4 * p_147736_5_; + float f8 = f4 * p_147736_6_; + float f9 = f4 * p_147736_7_; + float f10 = f3; + float f11 = f5; + float f12 = f6; + float f13 = f3; + float f14 = f5; + float f15 = f6; + float f16 = f3; + float f17 = f5; + float f18 = f6; + + if (p_147736_1_ != Blocks.grass) + { + f10 = f3 * p_147736_5_; + f11 = f5 * p_147736_5_; + f12 = f6 * p_147736_5_; + f13 = f3 * p_147736_6_; + f14 = f5 * p_147736_6_; + f15 = f6 * p_147736_6_; + f16 = f3 * p_147736_7_; + f17 = f5 * p_147736_7_; + f18 = f6 * p_147736_7_; + } + + int l = p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_, 0)) + { + tessellator.setBrightness(this.renderMinY > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_)); + tessellator.setColorOpaque_F(f10, f13, f16); + this.renderFaceYNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 0)); + flag = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_, 1)) + { + tessellator.setBrightness(this.renderMaxY < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_)); + tessellator.setColorOpaque_F(f7, f8, f9); + this.renderFaceYPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 1)); + flag = true; + } + + IIcon iicon; + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1, 2)) + { + tessellator.setBrightness(this.renderMinZ > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1)); + tessellator.setColorOpaque_F(f11, f14, f17); + iicon = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2); + this.renderFaceZNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + tessellator.setColorOpaque_F(f11 * p_147736_5_, f14 * p_147736_6_, f17 * p_147736_7_); + this.renderFaceZNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1, 3)) + { + tessellator.setBrightness(this.renderMaxZ < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1)); + tessellator.setColorOpaque_F(f11, f14, f17); + iicon = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3); + this.renderFaceZPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + tessellator.setColorOpaque_F(f11 * p_147736_5_, f14 * p_147736_6_, f17 * p_147736_7_); + this.renderFaceZPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_, 4)) + { + tessellator.setBrightness(this.renderMinX > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_)); + tessellator.setColorOpaque_F(f12, f15, f18); + iicon = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4); + this.renderFaceXNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + tessellator.setColorOpaque_F(f12 * p_147736_5_, f15 * p_147736_6_, f18 * p_147736_7_); + this.renderFaceXNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + if (this.renderAllFaces || p_147736_1_.shouldSideBeRendered(this.blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_, 5)) + { + tessellator.setBrightness(this.renderMaxX < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(this.blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_)); + tessellator.setColorOpaque_F(f12, f15, f18); + iicon = this.getBlockIcon(p_147736_1_, this.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5); + this.renderFaceXPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); + + if (fancyGrass && iicon.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) + { + tessellator.setColorOpaque_F(f12 * p_147736_5_, f15 * p_147736_6_, f18 * p_147736_7_); + this.renderFaceXPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, BlockGrass.getIconSideOverlay()); + } + + flag = true; + } + + return flag; + } + + public boolean renderBlockCocoa(BlockCocoa p_147772_1_, int p_147772_2_, int p_147772_3_, int p_147772_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147772_1_.getMixedBrightnessForBlock(this.blockAccess, p_147772_2_, p_147772_3_, p_147772_4_)); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + int l = this.blockAccess.getBlockMetadata(p_147772_2_, p_147772_3_, p_147772_4_); + int i1 = BlockDirectional.getDirection(l); + int j1 = BlockCocoa.func_149987_c(l); + IIcon iicon = p_147772_1_.getCocoaIcon(j1); + int k1 = 4 + j1 * 2; + int l1 = 5 + j1 * 2; + double d0 = 15.0D - (double)k1; + double d1 = 15.0D; + double d2 = 4.0D; + double d3 = 4.0D + (double)l1; + double d4 = (double)iicon.getInterpolatedU(d0); + double d5 = (double)iicon.getInterpolatedU(d1); + double d6 = (double)iicon.getInterpolatedV(d2); + double d7 = (double)iicon.getInterpolatedV(d3); + double d8 = 0.0D; + double d9 = 0.0D; + + switch (i1) + { + case 0: + d8 = 8.0D - (double)(k1 / 2); + d9 = 15.0D - (double)k1; + break; + case 1: + d8 = 1.0D; + d9 = 8.0D - (double)(k1 / 2); + break; + case 2: + d8 = 8.0D - (double)(k1 / 2); + d9 = 1.0D; + break; + case 3: + d8 = 15.0D - (double)k1; + d9 = 8.0D - (double)(k1 / 2); + } + + double d10 = (double)p_147772_2_ + d8 / 16.0D; + double d11 = (double)p_147772_2_ + (d8 + (double)k1) / 16.0D; + double d12 = (double)p_147772_3_ + (12.0D - (double)l1) / 16.0D; + double d13 = (double)p_147772_3_ + 0.75D; + double d14 = (double)p_147772_4_ + d9 / 16.0D; + double d15 = (double)p_147772_4_ + (d9 + (double)k1) / 16.0D; + tessellator.addVertexWithUV(d10, d12, d14, d4, d7); + tessellator.addVertexWithUV(d10, d12, d15, d5, d7); + tessellator.addVertexWithUV(d10, d13, d15, d5, d6); + tessellator.addVertexWithUV(d10, d13, d14, d4, d6); + tessellator.addVertexWithUV(d11, d12, d15, d4, d7); + tessellator.addVertexWithUV(d11, d12, d14, d5, d7); + tessellator.addVertexWithUV(d11, d13, d14, d5, d6); + tessellator.addVertexWithUV(d11, d13, d15, d4, d6); + tessellator.addVertexWithUV(d11, d12, d14, d4, d7); + tessellator.addVertexWithUV(d10, d12, d14, d5, d7); + tessellator.addVertexWithUV(d10, d13, d14, d5, d6); + tessellator.addVertexWithUV(d11, d13, d14, d4, d6); + tessellator.addVertexWithUV(d10, d12, d15, d4, d7); + tessellator.addVertexWithUV(d11, d12, d15, d5, d7); + tessellator.addVertexWithUV(d11, d13, d15, d5, d6); + tessellator.addVertexWithUV(d10, d13, d15, d4, d6); + int i2 = k1; + + if (j1 >= 2) + { + i2 = k1 - 1; + } + + d4 = (double)iicon.getMinU(); + d5 = (double)iicon.getInterpolatedU((double)i2); + d6 = (double)iicon.getMinV(); + d7 = (double)iicon.getInterpolatedV((double)i2); + tessellator.addVertexWithUV(d10, d13, d15, d4, d7); + tessellator.addVertexWithUV(d11, d13, d15, d5, d7); + tessellator.addVertexWithUV(d11, d13, d14, d5, d6); + tessellator.addVertexWithUV(d10, d13, d14, d4, d6); + tessellator.addVertexWithUV(d10, d12, d14, d4, d6); + tessellator.addVertexWithUV(d11, d12, d14, d5, d6); + tessellator.addVertexWithUV(d11, d12, d15, d5, d7); + tessellator.addVertexWithUV(d10, d12, d15, d4, d7); + d4 = (double)iicon.getInterpolatedU(12.0D); + d5 = (double)iicon.getMaxU(); + d6 = (double)iicon.getMinV(); + d7 = (double)iicon.getInterpolatedV(4.0D); + d8 = 8.0D; + d9 = 0.0D; + double d16; + + switch (i1) + { + case 0: + d8 = 8.0D; + d9 = 12.0D; + d16 = d4; + d4 = d5; + d5 = d16; + break; + case 1: + d8 = 0.0D; + d9 = 8.0D; + break; + case 2: + d8 = 8.0D; + d9 = 0.0D; + break; + case 3: + d8 = 12.0D; + d9 = 8.0D; + d16 = d4; + d4 = d5; + d5 = d16; + } + + d10 = (double)p_147772_2_ + d8 / 16.0D; + d11 = (double)p_147772_2_ + (d8 + 4.0D) / 16.0D; + d12 = (double)p_147772_3_ + 0.75D; + d13 = (double)p_147772_3_ + 1.0D; + d14 = (double)p_147772_4_ + d9 / 16.0D; + d15 = (double)p_147772_4_ + (d9 + 4.0D) / 16.0D; + + if (i1 != 2 && i1 != 0) + { + if (i1 == 1 || i1 == 3) + { + tessellator.addVertexWithUV(d11, d12, d14, d4, d7); + tessellator.addVertexWithUV(d10, d12, d14, d5, d7); + tessellator.addVertexWithUV(d10, d13, d14, d5, d6); + tessellator.addVertexWithUV(d11, d13, d14, d4, d6); + tessellator.addVertexWithUV(d10, d12, d14, d5, d7); + tessellator.addVertexWithUV(d11, d12, d14, d4, d7); + tessellator.addVertexWithUV(d11, d13, d14, d4, d6); + tessellator.addVertexWithUV(d10, d13, d14, d5, d6); + } + } + else + { + tessellator.addVertexWithUV(d10, d12, d14, d5, d7); + tessellator.addVertexWithUV(d10, d12, d15, d4, d7); + tessellator.addVertexWithUV(d10, d13, d15, d4, d6); + tessellator.addVertexWithUV(d10, d13, d14, d5, d6); + tessellator.addVertexWithUV(d10, d12, d15, d4, d7); + tessellator.addVertexWithUV(d10, d12, d14, d5, d7); + tessellator.addVertexWithUV(d10, d13, d14, d5, d6); + tessellator.addVertexWithUV(d10, d13, d15, d4, d6); + } + + return true; + } + + public boolean renderBlockBeacon(BlockBeacon p_147797_1_, int p_147797_2_, int p_147797_3_, int p_147797_4_) + { + float f = 0.1875F; + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.glass)); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.renderAllFaces = true; + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.obsidian)); + this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)f, 0.875D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.beacon)); + this.setRenderBounds(0.1875D, (double)f, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.renderStandardBlock(p_147797_1_, p_147797_2_, p_147797_3_, p_147797_4_); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + return true; + } + + public boolean renderBlockCactus(Block p_147755_1_, int p_147755_2_, int p_147755_3_, int p_147755_4_) + { + int l = p_147755_1_.colorMultiplier(this.blockAccess, p_147755_2_, p_147755_3_, p_147755_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + return this.renderBlockCactusImpl(p_147755_1_, p_147755_2_, p_147755_3_, p_147755_4_, f, f1, f2); + } + + /** + * Render block cactus implementation + */ + public boolean renderBlockCactusImpl(Block p_147754_1_, int p_147754_2_, int p_147754_3_, int p_147754_4_, float p_147754_5_, float p_147754_6_, float p_147754_7_) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + float f7 = f3 * p_147754_5_; + float f8 = f4 * p_147754_5_; + float f9 = f5 * p_147754_5_; + float f10 = f6 * p_147754_5_; + float f11 = f3 * p_147754_6_; + float f12 = f4 * p_147754_6_; + float f13 = f5 * p_147754_6_; + float f14 = f6 * p_147754_6_; + float f15 = f3 * p_147754_7_; + float f16 = f4 * p_147754_7_; + float f17 = f5 * p_147754_7_; + float f18 = f6 * p_147754_7_; + float f19 = 0.0625F; + int l = p_147754_1_.getMixedBrightnessForBlock(this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_); + + if (this.renderAllFaces || p_147754_1_.shouldSideBeRendered(this.blockAccess, p_147754_2_, p_147754_3_ - 1, p_147754_4_, 0)) + { + tessellator.setBrightness(this.renderMinY > 0.0D ? l : p_147754_1_.getMixedBrightnessForBlock(this.blockAccess, p_147754_2_, p_147754_3_ - 1, p_147754_4_)); + tessellator.setColorOpaque_F(f7, f11, f15); + this.renderFaceYNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 0)); + } + + if (this.renderAllFaces || p_147754_1_.shouldSideBeRendered(this.blockAccess, p_147754_2_, p_147754_3_ + 1, p_147754_4_, 1)) + { + tessellator.setBrightness(this.renderMaxY < 1.0D ? l : p_147754_1_.getMixedBrightnessForBlock(this.blockAccess, p_147754_2_, p_147754_3_ + 1, p_147754_4_)); + tessellator.setColorOpaque_F(f8, f12, f16); + this.renderFaceYPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 1)); + } + + tessellator.setBrightness(l); + tessellator.setColorOpaque_F(f9, f13, f17); + tessellator.addTranslation(0.0F, 0.0F, f19); + this.renderFaceZNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f19); + tessellator.addTranslation(0.0F, 0.0F, -f19); + this.renderFaceZPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 3)); + tessellator.addTranslation(0.0F, 0.0F, f19); + tessellator.setColorOpaque_F(f10, f14, f18); + tessellator.addTranslation(f19, 0.0F, 0.0F); + this.renderFaceXNeg(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 4)); + tessellator.addTranslation(-f19, 0.0F, 0.0F); + tessellator.addTranslation(-f19, 0.0F, 0.0F); + this.renderFaceXPos(p_147754_1_, (double)p_147754_2_, (double)p_147754_3_, (double)p_147754_4_, this.getBlockIcon(p_147754_1_, this.blockAccess, p_147754_2_, p_147754_3_, p_147754_4_, 5)); + tessellator.addTranslation(f19, 0.0F, 0.0F); + return true; + } + + public boolean renderBlockFence(BlockFence p_147735_1_, int p_147735_2_, int p_147735_3_, int p_147735_4_) + { + boolean flag = false; + float f = 0.375F; + float f1 = 0.625F; + this.setRenderBounds((double)f, 0.0D, (double)f, (double)f1, 1.0D, (double)f1); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + flag = true; + boolean flag1 = false; + boolean flag2 = false; + + if (p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_ - 1, p_147735_3_, p_147735_4_) || p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_ + 1, p_147735_3_, p_147735_4_)) + { + flag1 = true; + } + + if (p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ - 1) || p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ + 1)) + { + flag2 = true; + } + + boolean flag3 = p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_ - 1, p_147735_3_, p_147735_4_); + boolean flag4 = p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_ + 1, p_147735_3_, p_147735_4_); + boolean flag5 = p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ - 1); + boolean flag6 = p_147735_1_.canConnectFenceTo(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_ + 1); + + if (!flag1 && !flag2) + { + flag1 = true; + } + + f = 0.4375F; + f1 = 0.5625F; + float f2 = 0.75F; + float f3 = 0.9375F; + float f4 = flag3 ? 0.0F : f; + float f5 = flag4 ? 1.0F : f1; + float f6 = flag5 ? 0.0F : f; + float f7 = flag6 ? 1.0F : f1; + this.field_152631_f = true; + + if (flag1) + { + this.setRenderBounds((double)f4, (double)f2, (double)f, (double)f5, (double)f3, (double)f1); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + flag = true; + } + + if (flag2) + { + this.setRenderBounds((double)f, (double)f2, (double)f6, (double)f1, (double)f3, (double)f7); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + flag = true; + } + + f2 = 0.375F; + f3 = 0.5625F; + + if (flag1) + { + this.setRenderBounds((double)f4, (double)f2, (double)f, (double)f5, (double)f3, (double)f1); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + flag = true; + } + + if (flag2) + { + this.setRenderBounds((double)f, (double)f2, (double)f6, (double)f1, (double)f3, (double)f7); + this.renderStandardBlock(p_147735_1_, p_147735_2_, p_147735_3_, p_147735_4_); + flag = true; + } + + this.field_152631_f = false; + p_147735_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147735_2_, p_147735_3_, p_147735_4_); + return flag; + } + + public boolean renderBlockWall(BlockWall p_147807_1_, int p_147807_2_, int p_147807_3_, int p_147807_4_) + { + boolean flag = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_ - 1, p_147807_3_, p_147807_4_); + boolean flag1 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_ + 1, p_147807_3_, p_147807_4_); + boolean flag2 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ - 1); + boolean flag3 = p_147807_1_.canConnectWallTo(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_ + 1); + boolean flag4 = flag2 && flag3 && !flag && !flag1; + boolean flag5 = !flag2 && !flag3 && flag && flag1; + boolean flag6 = this.blockAccess.isAirBlock(p_147807_2_, p_147807_3_ + 1, p_147807_4_); + + if ((flag4 || flag5) && flag6) + { + if (flag4) + { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + else + { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } + else + { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + + if (flag) + { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (flag1) + { + this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (flag2) + { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + + if (flag3) + { + this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); + this.renderStandardBlock(p_147807_1_, p_147807_2_, p_147807_3_, p_147807_4_); + } + } + + p_147807_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147807_2_, p_147807_3_, p_147807_4_); + return true; + } + + public boolean renderBlockDragonEgg(BlockDragonEgg p_147802_1_, int p_147802_2_, int p_147802_3_, int p_147802_4_) + { + boolean flag = false; + int l = 0; + + for (int i1 = 0; i1 < 8; ++i1) + { + byte b0 = 0; + byte b1 = 1; + + if (i1 == 0) + { + b0 = 2; + } + + if (i1 == 1) + { + b0 = 3; + } + + if (i1 == 2) + { + b0 = 4; + } + + if (i1 == 3) + { + b0 = 5; + b1 = 2; + } + + if (i1 == 4) + { + b0 = 6; + b1 = 3; + } + + if (i1 == 5) + { + b0 = 7; + b1 = 5; + } + + if (i1 == 6) + { + b0 = 6; + b1 = 2; + } + + if (i1 == 7) + { + b0 = 3; + } + + float f = (float)b0 / 16.0F; + float f1 = 1.0F - (float)l / 16.0F; + float f2 = 1.0F - (float)(l + b1) / 16.0F; + l += b1; + this.setRenderBounds((double)(0.5F - f), (double)f2, (double)(0.5F - f), (double)(0.5F + f), (double)f1, (double)(0.5F + f)); + this.renderStandardBlock(p_147802_1_, p_147802_2_, p_147802_3_, p_147802_4_); + } + + flag = true; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return flag; + } + + public boolean renderBlockFenceGate(BlockFenceGate p_147776_1_, int p_147776_2_, int p_147776_3_, int p_147776_4_) + { + boolean flag = true; + int l = this.blockAccess.getBlockMetadata(p_147776_2_, p_147776_3_, p_147776_4_); + boolean flag1 = BlockFenceGate.isFenceGateOpen(l); + int i1 = BlockDirectional.getDirection(l); + float f = 0.375F; + float f1 = 0.5625F; + float f2 = 0.75F; + float f3 = 0.9375F; + float f4 = 0.3125F; + float f5 = 1.0F; + + if ((i1 == 2 || i1 == 0) && this.blockAccess.getBlock(p_147776_2_ - 1, p_147776_3_, p_147776_4_) == Blocks.cobblestone_wall && this.blockAccess.getBlock(p_147776_2_ + 1, p_147776_3_, p_147776_4_) == Blocks.cobblestone_wall || (i1 == 3 || i1 == 1) && this.blockAccess.getBlock(p_147776_2_, p_147776_3_, p_147776_4_ - 1) == Blocks.cobblestone_wall && this.blockAccess.getBlock(p_147776_2_, p_147776_3_, p_147776_4_ + 1) == Blocks.cobblestone_wall) + { + f -= 0.1875F; + f1 -= 0.1875F; + f2 -= 0.1875F; + f3 -= 0.1875F; + f4 -= 0.1875F; + f5 -= 0.1875F; + } + + this.renderAllFaces = true; + float f6; + float f7; + float f8; + float f9; + + if (i1 != 3 && i1 != 1) + { + f6 = 0.0F; + f7 = 0.125F; + f8 = 0.4375F; + f9 = 0.5625F; + this.setRenderBounds((double)f6, (double)f4, (double)f8, (double)f7, (double)f5, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f6 = 0.875F; + f7 = 1.0F; + this.setRenderBounds((double)f6, (double)f4, (double)f8, (double)f7, (double)f5, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + else + { + this.uvRotateTop = 1; + f6 = 0.4375F; + f7 = 0.5625F; + f8 = 0.0F; + f9 = 0.125F; + this.setRenderBounds((double)f6, (double)f4, (double)f8, (double)f7, (double)f5, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f8 = 0.875F; + f9 = 1.0F; + this.setRenderBounds((double)f6, (double)f4, (double)f8, (double)f7, (double)f5, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.uvRotateTop = 0; + } + + if (flag1) + { + if (i1 == 2 || i1 == 0) + { + this.uvRotateTop = 1; + } + + float f10; + float f11; + float f12; + + if (i1 == 3) + { + f6 = 0.0F; + f7 = 0.125F; + f8 = 0.875F; + f9 = 1.0F; + f10 = 0.5625F; + f11 = 0.8125F; + f12 = 0.9375F; + this.setRenderBounds(0.8125D, (double)f, 0.0D, 0.9375D, (double)f3, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.8125D, (double)f, 0.875D, 0.9375D, (double)f3, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)f, 0.0D, 0.8125D, (double)f1, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)f, 0.875D, 0.8125D, (double)f1, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)f2, 0.0D, 0.8125D, (double)f3, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.5625D, (double)f2, 0.875D, 0.8125D, (double)f3, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + else if (i1 == 1) + { + f6 = 0.0F; + f7 = 0.125F; + f8 = 0.875F; + f9 = 1.0F; + f10 = 0.0625F; + f11 = 0.1875F; + f12 = 0.4375F; + this.setRenderBounds(0.0625D, (double)f, 0.0D, 0.1875D, (double)f3, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0625D, (double)f, 0.875D, 0.1875D, (double)f3, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)f, 0.0D, 0.4375D, (double)f1, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)f, 0.875D, 0.4375D, (double)f1, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)f2, 0.0D, 0.4375D, (double)f3, 0.125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.1875D, (double)f2, 0.875D, 0.4375D, (double)f3, 1.0D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + else if (i1 == 0) + { + f6 = 0.0F; + f7 = 0.125F; + f8 = 0.875F; + f9 = 1.0F; + f10 = 0.5625F; + f11 = 0.8125F; + f12 = 0.9375F; + this.setRenderBounds(0.0D, (double)f, 0.8125D, 0.125D, (double)f3, 0.9375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f, 0.8125D, 1.0D, (double)f3, 0.9375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)f, 0.5625D, 0.125D, (double)f1, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f, 0.5625D, 1.0D, (double)f1, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)f2, 0.5625D, 0.125D, (double)f3, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f2, 0.5625D, 1.0D, (double)f3, 0.8125D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + else if (i1 == 2) + { + f6 = 0.0F; + f7 = 0.125F; + f8 = 0.875F; + f9 = 1.0F; + f10 = 0.0625F; + f11 = 0.1875F; + f12 = 0.4375F; + this.setRenderBounds(0.0D, (double)f, 0.0625D, 0.125D, (double)f3, 0.1875D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f, 0.0625D, 1.0D, (double)f3, 0.1875D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)f, 0.1875D, 0.125D, (double)f1, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f, 0.1875D, 1.0D, (double)f1, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.0D, (double)f2, 0.1875D, 0.125D, (double)f3, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds(0.875D, (double)f2, 0.1875D, 1.0D, (double)f3, 0.4375D); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + } + else if (i1 != 3 && i1 != 1) + { + f6 = 0.375F; + f7 = 0.5F; + f8 = 0.4375F; + f9 = 0.5625F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f6 = 0.5F; + f7 = 0.625F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f6 = 0.625F; + f7 = 0.875F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f1, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)f6, (double)f2, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f6 = 0.125F; + f7 = 0.375F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f1, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)f6, (double)f2, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + else + { + this.uvRotateTop = 1; + f6 = 0.4375F; + f7 = 0.5625F; + f8 = 0.375F; + f9 = 0.5F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f8 = 0.5F; + f9 = 0.625F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f8 = 0.625F; + f9 = 0.875F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f1, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)f6, (double)f2, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + f8 = 0.125F; + f9 = 0.375F; + this.setRenderBounds((double)f6, (double)f, (double)f8, (double)f7, (double)f1, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + this.setRenderBounds((double)f6, (double)f2, (double)f8, (double)f7, (double)f3, (double)f9); + this.renderStandardBlock(p_147776_1_, p_147776_2_, p_147776_3_, p_147776_4_); + } + + this.renderAllFaces = false; + this.uvRotateTop = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + return flag; + } + + public boolean renderBlockHopper(BlockHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147803_1_.getMixedBrightnessForBlock(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_)); + int l = p_147803_1_.colorMultiplier(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + return this.renderBlockHopperMetadata(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, this.blockAccess.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false); + } + + public boolean renderBlockHopperMetadata(BlockHopper p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_) + { + Tessellator tessellator = Tessellator.instance; + int i1 = BlockHopper.getDirectionFromMetadata(p_147799_5_); + double d0 = 0.625D; + this.setRenderBounds(0.0D, d0, 0.0D, 1.0D, 1.0D, 1.0D); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 0, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 1, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 2, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 3, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 4, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147799_1_, 5, p_147799_5_)); + tessellator.draw(); + } + else + { + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + float f1; + + if (!p_147799_6_) + { + tessellator.setBrightness(p_147799_1_.getMixedBrightnessForBlock(this.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_)); + int j1 = p_147799_1_.colorMultiplier(this.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_); + float f = (float)(j1 >> 16 & 255) / 255.0F; + f1 = (float)(j1 >> 8 & 255) / 255.0F; + float f2 = (float)(j1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + } + + IIcon iicon = BlockHopper.getHopperIcon("hopper_outside"); + IIcon iicon1 = BlockHopper.getHopperIcon("hopper_inside"); + f1 = 0.125F; + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, (double)(-1.0F + f1), 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, (double)(1.0F - f1), 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, (double)(-1.0F + f1), iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, (double)(1.0F - f1), iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, -1.0D + d0, 0.0D, iicon1); + tessellator.draw(); + } + else + { + this.renderFaceXPos(p_147799_1_, (double)((float)p_147799_2_ - 1.0F + f1), (double)p_147799_3_, (double)p_147799_4_, iicon); + this.renderFaceXNeg(p_147799_1_, (double)((float)p_147799_2_ + 1.0F - f1), (double)p_147799_3_, (double)p_147799_4_, iicon); + this.renderFaceZPos(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ - 1.0F + f1), iicon); + this.renderFaceZNeg(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ + 1.0F - f1), iicon); + this.renderFaceYPos(p_147799_1_, (double)p_147799_2_, (double)((float)p_147799_3_ - 1.0F) + d0, (double)p_147799_4_, iicon1); + } + + this.setOverrideBlockTexture(iicon); + double d3 = 0.25D; + double d4 = 0.25D; + this.setRenderBounds(d3, d4, d3, 1.0D - d3, d0 - 0.002D, 1.0D - d3); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + } + else + { + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (!p_147799_6_) + { + double d1 = 0.375D; + double d2 = 0.25D; + this.setOverrideBlockTexture(iicon); + + if (i1 == 0) + { + this.setRenderBounds(d1, 0.0D, d1, 1.0D - d1, 0.25D, 1.0D - d1); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 2) + { + this.setRenderBounds(d1, d4, 0.0D, 1.0D - d1, d4 + d2, d3); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 3) + { + this.setRenderBounds(d1, d4, 1.0D - d3, 1.0D - d1, d4 + d2, 1.0D); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 4) + { + this.setRenderBounds(0.0D, d4, d1, d3, d4 + d2, 1.0D - d1); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 5) + { + this.setRenderBounds(1.0D - d3, d4, d1, 1.0D, d4 + d2, 1.0D - d1); + this.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + } + + this.clearOverrideBlockTexture(); + return true; + } + + /** + * Renders a stair block at the given coordinates + */ + public boolean renderBlockStairs(BlockStairs p_147722_1_, int p_147722_2_, int p_147722_3_, int p_147722_4_) + { + p_147722_1_.func_150147_e(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_); + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + this.field_152631_f = true; + boolean flag = p_147722_1_.func_150145_f(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_); + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + + if (flag && p_147722_1_.func_150144_g(this.blockAccess, p_147722_2_, p_147722_3_, p_147722_4_)) + { + this.setRenderBoundsFromBlock(p_147722_1_); + this.renderStandardBlock(p_147722_1_, p_147722_2_, p_147722_3_, p_147722_4_); + } + + this.field_152631_f = false; + return true; + } + + public boolean renderBlockDoor(Block p_147760_1_, int p_147760_2_, int p_147760_3_, int p_147760_4_) + { + Tessellator tessellator = Tessellator.instance; + int l = this.blockAccess.getBlockMetadata(p_147760_2_, p_147760_3_, p_147760_4_); + + if ((l & 8) != 0) + { + if (this.blockAccess.getBlock(p_147760_2_, p_147760_3_ - 1, p_147760_4_) != p_147760_1_) + { + return false; + } + } + else if (this.blockAccess.getBlock(p_147760_2_, p_147760_3_ + 1, p_147760_4_) != p_147760_1_) + { + return false; + } + + boolean flag = false; + float f = 0.5F; + float f1 = 1.0F; + float f2 = 0.8F; + float f3 = 0.6F; + int i1 = p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_); + tessellator.setBrightness(this.renderMinY > 0.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_, p_147760_3_ - 1, p_147760_4_)); + tessellator.setColorOpaque_F(f, f, f); + this.renderFaceYNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 0)); + flag = true; + tessellator.setBrightness(this.renderMaxY < 1.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_, p_147760_3_ + 1, p_147760_4_)); + tessellator.setColorOpaque_F(f1, f1, f1); + this.renderFaceYPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 1)); + flag = true; + tessellator.setBrightness(this.renderMinZ > 0.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_ - 1)); + tessellator.setColorOpaque_F(f2, f2, f2); + IIcon iicon = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 2); + this.renderFaceZNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, iicon); + flag = true; + this.flipTexture = false; + tessellator.setBrightness(this.renderMaxZ < 1.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_ + 1)); + tessellator.setColorOpaque_F(f2, f2, f2); + iicon = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 3); + this.renderFaceZPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, iicon); + flag = true; + this.flipTexture = false; + tessellator.setBrightness(this.renderMinX > 0.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_ - 1, p_147760_3_, p_147760_4_)); + tessellator.setColorOpaque_F(f3, f3, f3); + iicon = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 4); + this.renderFaceXNeg(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, iicon); + flag = true; + this.flipTexture = false; + tessellator.setBrightness(this.renderMaxX < 1.0D ? i1 : p_147760_1_.getMixedBrightnessForBlock(this.blockAccess, p_147760_2_ + 1, p_147760_3_, p_147760_4_)); + tessellator.setColorOpaque_F(f3, f3, f3); + iicon = this.getBlockIcon(p_147760_1_, this.blockAccess, p_147760_2_, p_147760_3_, p_147760_4_, 5); + this.renderFaceXPos(p_147760_1_, (double)p_147760_2_, (double)p_147760_3_, (double)p_147760_4_, iicon); + flag = true; + this.flipTexture = false; + return flag; + } + + /** + * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture + */ + public void renderFaceYNeg(Block p_147768_1_, double p_147768_2_, double p_147768_4_, double p_147768_6_, IIcon p_147768_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147768_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147768_8_.getInterpolatedU(this.renderMinX * 16.0D); + double d4 = (double)p_147768_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double d5 = (double)p_147768_8_.getInterpolatedV(this.renderMinZ * 16.0D); + double d6 = (double)p_147768_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) + { + d3 = (double)p_147768_8_.getMinU(); + d4 = (double)p_147768_8_.getMaxU(); + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) + { + d5 = (double)p_147768_8_.getMinV(); + d6 = (double)p_147768_8_.getMaxV(); + } + + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateBottom == 2) + { + d3 = (double)p_147768_8_.getInterpolatedU(this.renderMinZ * 16.0D); + d5 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + d4 = (double)p_147768_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + d6 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateBottom == 1) + { + d3 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + d5 = (double)p_147768_8_.getInterpolatedV(this.renderMinX * 16.0D); + d4 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + d6 = (double)p_147768_8_.getInterpolatedV(this.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateBottom == 3) + { + d3 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + d4 = (double)p_147768_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + d5 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + d6 = (double)p_147768_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147768_2_ + this.renderMinX; + double d12 = p_147768_2_ + this.renderMaxX; + double d13 = p_147768_4_ + this.renderMinY; + double d14 = p_147768_6_ + this.renderMinZ; + double d15 = p_147768_6_ + this.renderMaxZ; + + if (this.renderFromInside) + { + d11 = p_147768_2_ + this.renderMaxX; + d12 = p_147768_2_ + this.renderMinX; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } + else + { + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + } + } + + /** + * Renders the given texture to the top face of the block. Args: block, x, y, z, texture + */ + public void renderFaceYPos(Block p_147806_1_, double p_147806_2_, double p_147806_4_, double p_147806_6_, IIcon p_147806_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147806_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147806_8_.getInterpolatedU(this.renderMinX * 16.0D); + double d4 = (double)p_147806_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double d5 = (double)p_147806_8_.getInterpolatedV(this.renderMinZ * 16.0D); + double d6 = (double)p_147806_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) + { + d3 = (double)p_147806_8_.getMinU(); + d4 = (double)p_147806_8_.getMaxU(); + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) + { + d5 = (double)p_147806_8_.getMinV(); + d6 = (double)p_147806_8_.getMaxV(); + } + + double d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateTop == 1) + { + d3 = (double)p_147806_8_.getInterpolatedU(this.renderMinZ * 16.0D); + d5 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + d4 = (double)p_147806_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + d6 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateTop == 2) + { + d3 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + d5 = (double)p_147806_8_.getInterpolatedV(this.renderMinX * 16.0D); + d4 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + d6 = (double)p_147806_8_.getInterpolatedV(this.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateTop == 3) + { + d3 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + d4 = (double)p_147806_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + d5 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + d6 = (double)p_147806_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147806_2_ + this.renderMinX; + double d12 = p_147806_2_ + this.renderMaxX; + double d13 = p_147806_4_ + this.renderMaxY; + double d14 = p_147806_6_ + this.renderMinZ; + double d15 = p_147806_6_ + this.renderMaxZ; + + if (this.renderFromInside) + { + d11 = p_147806_2_ + this.renderMaxX; + d12 = p_147806_2_ + this.renderMinX; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } + else + { + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d13, d14, d7, d9); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + } + } + + /** + * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceZNeg(Block p_147761_1_, double p_147761_2_, double p_147761_4_, double p_147761_6_, IIcon p_147761_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147761_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147761_8_.getInterpolatedU(this.renderMinX * 16.0D); + double d4 = (double)p_147761_8_.getInterpolatedU(this.renderMaxX * 16.0D); + + if (this.field_152631_f) + { + d4 = (double)p_147761_8_.getInterpolatedU((1.0D - this.renderMinX) * 16.0D); + d3 = (double)p_147761_8_.getInterpolatedU((1.0D - this.renderMaxX) * 16.0D); + } + + double d5 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double d6 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double d7; + + if (this.flipTexture) + { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) + { + d3 = (double)p_147761_8_.getMinU(); + d4 = (double)p_147761_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) + { + d5 = (double)p_147761_8_.getMinV(); + d6 = (double)p_147761_8_.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateEast == 2) + { + d3 = (double)p_147761_8_.getInterpolatedU(this.renderMinY * 16.0D); + d4 = (double)p_147761_8_.getInterpolatedU(this.renderMaxY * 16.0D); + d5 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + d6 = (double)p_147761_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateEast == 1) + { + d3 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + d4 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + d5 = (double)p_147761_8_.getInterpolatedV(this.renderMaxX * 16.0D); + d6 = (double)p_147761_8_.getInterpolatedV(this.renderMinX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateEast == 3) + { + d3 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + d4 = (double)p_147761_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + d5 = (double)p_147761_8_.getInterpolatedV(this.renderMaxY * 16.0D); + d6 = (double)p_147761_8_.getInterpolatedV(this.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147761_2_ + this.renderMinX; + double d12 = p_147761_2_ + this.renderMaxX; + double d13 = p_147761_4_ + this.renderMinY; + double d14 = p_147761_4_ + this.renderMaxY; + double d15 = p_147761_6_ + this.renderMinZ; + + if (this.renderFromInside) + { + d11 = p_147761_2_ + this.renderMaxX; + d12 = p_147761_2_ + this.renderMinX; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d14, d15, d7, d9); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d15, d8, d10); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d4, d6); + } + else + { + tessellator.addVertexWithUV(d11, d14, d15, d7, d9); + tessellator.addVertexWithUV(d12, d14, d15, d3, d5); + tessellator.addVertexWithUV(d12, d13, d15, d8, d10); + tessellator.addVertexWithUV(d11, d13, d15, d4, d6); + } + } + + /** + * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceZPos(Block p_147734_1_, double p_147734_2_, double p_147734_4_, double p_147734_6_, IIcon p_147734_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147734_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147734_8_.getInterpolatedU(this.renderMinX * 16.0D); + double d4 = (double)p_147734_8_.getInterpolatedU(this.renderMaxX * 16.0D); + double d5 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double d6 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double d7; + + if (this.flipTexture) + { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) + { + d3 = (double)p_147734_8_.getMinU(); + d4 = (double)p_147734_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) + { + d5 = (double)p_147734_8_.getMinV(); + d6 = (double)p_147734_8_.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateWest == 1) + { + d3 = (double)p_147734_8_.getInterpolatedU(this.renderMinY * 16.0D); + d6 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMinX * 16.0D); + d4 = (double)p_147734_8_.getInterpolatedU(this.renderMaxY * 16.0D); + d5 = (double)p_147734_8_.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateWest == 2) + { + d3 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + d5 = (double)p_147734_8_.getInterpolatedV(this.renderMinX * 16.0D); + d4 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + d6 = (double)p_147734_8_.getInterpolatedV(this.renderMaxX * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateWest == 3) + { + d3 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMinX * 16.0D); + d4 = (double)p_147734_8_.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); + d5 = (double)p_147734_8_.getInterpolatedV(this.renderMaxY * 16.0D); + d6 = (double)p_147734_8_.getInterpolatedV(this.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147734_2_ + this.renderMinX; + double d12 = p_147734_2_ + this.renderMaxX; + double d13 = p_147734_4_ + this.renderMinY; + double d14 = p_147734_4_ + this.renderMaxY; + double d15 = p_147734_6_ + this.renderMaxZ; + + if (this.renderFromInside) + { + d11 = p_147734_2_ + this.renderMaxX; + d12 = p_147734_2_ + this.renderMinX; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d14, d15, d3, d5); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d12, d14, d15, d7, d9); + } + else + { + tessellator.addVertexWithUV(d11, d14, d15, d3, d5); + tessellator.addVertexWithUV(d11, d13, d15, d8, d10); + tessellator.addVertexWithUV(d12, d13, d15, d4, d6); + tessellator.addVertexWithUV(d12, d14, d15, d7, d9); + } + } + + /** + * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceXNeg(Block p_147798_1_, double p_147798_2_, double p_147798_4_, double p_147798_6_, IIcon p_147798_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147798_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147798_8_.getInterpolatedU(this.renderMinZ * 16.0D); + double d4 = (double)p_147798_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + double d5 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double d6 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double d7; + + if (this.flipTexture) + { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) + { + d3 = (double)p_147798_8_.getMinU(); + d4 = (double)p_147798_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) + { + d5 = (double)p_147798_8_.getMinV(); + d6 = (double)p_147798_8_.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateNorth == 1) + { + d3 = (double)p_147798_8_.getInterpolatedU(this.renderMinY * 16.0D); + d5 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + d4 = (double)p_147798_8_.getInterpolatedU(this.renderMaxY * 16.0D); + d6 = (double)p_147798_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateNorth == 2) + { + d3 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + d5 = (double)p_147798_8_.getInterpolatedV(this.renderMinZ * 16.0D); + d4 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + d6 = (double)p_147798_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateNorth == 3) + { + d3 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + d4 = (double)p_147798_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + d5 = (double)p_147798_8_.getInterpolatedV(this.renderMaxY * 16.0D); + d6 = (double)p_147798_8_.getInterpolatedV(this.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147798_2_ + this.renderMinX; + double d12 = p_147798_4_ + this.renderMinY; + double d13 = p_147798_4_ + this.renderMaxY; + double d14 = p_147798_6_ + this.renderMinZ; + double d15 = p_147798_6_ + this.renderMaxZ; + + if (this.renderFromInside) + { + d14 = p_147798_6_ + this.renderMaxZ; + d15 = p_147798_6_ + this.renderMinZ; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d13, d15, d7, d9); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d12, d14, d8, d10); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d11, d12, d15, d4, d6); + } + else + { + tessellator.addVertexWithUV(d11, d13, d15, d7, d9); + tessellator.addVertexWithUV(d11, d13, d14, d3, d5); + tessellator.addVertexWithUV(d11, d12, d14, d8, d10); + tessellator.addVertexWithUV(d11, d12, d15, d4, d6); + } + } + + /** + * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture + */ + public void renderFaceXPos(Block p_147764_1_, double p_147764_2_, double p_147764_4_, double p_147764_6_, IIcon p_147764_8_) + { + Tessellator tessellator = Tessellator.instance; + + if (this.hasOverrideBlockTexture()) + { + p_147764_8_ = this.overrideBlockTexture; + } + + double d3 = (double)p_147764_8_.getInterpolatedU(this.renderMinZ * 16.0D); + double d4 = (double)p_147764_8_.getInterpolatedU(this.renderMaxZ * 16.0D); + + if (this.field_152631_f) + { + d4 = (double)p_147764_8_.getInterpolatedU((1.0D - this.renderMinZ) * 16.0D); + d3 = (double)p_147764_8_.getInterpolatedU((1.0D - this.renderMaxZ) * 16.0D); + } + + double d5 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); + double d6 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMinY * 16.0D); + double d7; + + if (this.flipTexture) + { + d7 = d3; + d3 = d4; + d4 = d7; + } + + if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) + { + d3 = (double)p_147764_8_.getMinU(); + d4 = (double)p_147764_8_.getMaxU(); + } + + if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) + { + d5 = (double)p_147764_8_.getMinV(); + d6 = (double)p_147764_8_.getMaxV(); + } + + d7 = d4; + double d8 = d3; + double d9 = d5; + double d10 = d6; + + if (this.uvRotateSouth == 2) + { + d3 = (double)p_147764_8_.getInterpolatedU(this.renderMinY * 16.0D); + d5 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); + d4 = (double)p_147764_8_.getInterpolatedU(this.renderMaxY * 16.0D); + d6 = (double)p_147764_8_.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); + d9 = d5; + d10 = d6; + d7 = d3; + d8 = d4; + d5 = d6; + d6 = d9; + } + else if (this.uvRotateSouth == 1) + { + d3 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); + d5 = (double)p_147764_8_.getInterpolatedV(this.renderMaxZ * 16.0D); + d4 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMinY * 16.0D); + d6 = (double)p_147764_8_.getInterpolatedV(this.renderMinZ * 16.0D); + d7 = d4; + d8 = d3; + d3 = d4; + d4 = d8; + d9 = d6; + d10 = d5; + } + else if (this.uvRotateSouth == 3) + { + d3 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); + d4 = (double)p_147764_8_.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); + d5 = (double)p_147764_8_.getInterpolatedV(this.renderMaxY * 16.0D); + d6 = (double)p_147764_8_.getInterpolatedV(this.renderMinY * 16.0D); + d7 = d4; + d8 = d3; + d9 = d5; + d10 = d6; + } + + double d11 = p_147764_2_ + this.renderMaxX; + double d12 = p_147764_4_ + this.renderMinY; + double d13 = p_147764_4_ + this.renderMaxY; + double d14 = p_147764_6_ + this.renderMinZ; + double d15 = p_147764_6_ + this.renderMaxZ; + + if (this.renderFromInside) + { + d14 = p_147764_6_ + this.renderMaxZ; + d15 = p_147764_6_ + this.renderMinZ; + } + + if (this.enableAO) + { + tessellator.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); + tessellator.setBrightness(this.brightnessTopLeft); + tessellator.addVertexWithUV(d11, d12, d15, d8, d10); + tessellator.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); + tessellator.setBrightness(this.brightnessBottomLeft); + tessellator.addVertexWithUV(d11, d12, d14, d4, d6); + tessellator.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); + tessellator.setBrightness(this.brightnessBottomRight); + tessellator.addVertexWithUV(d11, d13, d14, d7, d9); + tessellator.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); + tessellator.setBrightness(this.brightnessTopRight); + tessellator.addVertexWithUV(d11, d13, d15, d3, d5); + } + else + { + tessellator.addVertexWithUV(d11, d12, d15, d8, d10); + tessellator.addVertexWithUV(d11, d12, d14, d4, d6); + tessellator.addVertexWithUV(d11, d13, d14, d7, d9); + tessellator.addVertexWithUV(d11, d13, d15, d3, d5); + } + } + + /** + * Is called to render the image of a block on an inventory, as a held item, or as a an item on the ground + */ + public void renderBlockAsItem(Block p_147800_1_, int p_147800_2_, float p_147800_3_) + { + Tessellator tessellator = Tessellator.instance; + boolean flag = p_147800_1_ == Blocks.grass; + + if (p_147800_1_ == Blocks.dispenser || p_147800_1_ == Blocks.dropper || p_147800_1_ == Blocks.furnace) + { + p_147800_2_ = 3; + } + + int j; + float f1; + float f2; + float f3; + + if (this.useInventoryTint) + { + j = p_147800_1_.getRenderColor(p_147800_2_); + + if (flag) + { + j = 16777215; + } + + f1 = (float)(j >> 16 & 255) / 255.0F; + f2 = (float)(j >> 8 & 255) / 255.0F; + f3 = (float)(j & 255) / 255.0F; + GL11.glColor4f(f1 * p_147800_3_, f2 * p_147800_3_, f3 * p_147800_3_, 1.0F); + } + + j = p_147800_1_.getRenderType(); + this.setRenderBoundsFromBlock(p_147800_1_); + int k; + + if (j != 0 && j != 31 && j != 39 && j != 16 && j != 26) + { + if (j == 1) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_); + this.drawCrossedSquares(iicon, -0.5D, -0.5D, -0.5D, 1.0F); + tessellator.draw(); + } + else if (j == 19) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + p_147800_1_.setBlockBoundsForItemRender(); + this.renderBlockStemSmall(p_147800_1_, p_147800_2_, this.renderMaxY, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + } + else if (j == 23) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + p_147800_1_.setBlockBoundsForItemRender(); + tessellator.draw(); + } + else if (j == 13) + { + p_147800_1_.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + f1 = 0.0625F; + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addTranslation(0.0F, 0.0F, f1); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + tessellator.addTranslation(0.0F, 0.0F, -f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addTranslation(0.0F, 0.0F, -f1); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + tessellator.addTranslation(0.0F, 0.0F, f1); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addTranslation(f1, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addTranslation(-f1, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + tessellator.addTranslation(f1, 0.0F, 0.0F); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + else if (j == 22) + { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + TileEntityRendererChestHelper.instance.renderChest(p_147800_1_, p_147800_2_, p_147800_3_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + else if (j == 6) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderBlockCropsImpl(p_147800_1_, p_147800_2_, -0.5D, -0.5D, -0.5D); + tessellator.draw(); + } + else if (j == 2) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderTorchAtAngle(p_147800_1_, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); + tessellator.draw(); + } + else if (j == 10) + { + for (k = 0; k < 2; ++k) + { + if (k == 0) + { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + + if (k == 1) + { + this.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } + else if (j == 27) + { + k = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + + for (int l = 0; l < 8; ++l) + { + byte b0 = 0; + byte b1 = 1; + + if (l == 0) + { + b0 = 2; + } + + if (l == 1) + { + b0 = 3; + } + + if (l == 2) + { + b0 = 4; + } + + if (l == 3) + { + b0 = 5; + b1 = 2; + } + + if (l == 4) + { + b0 = 6; + b1 = 3; + } + + if (l == 5) + { + b0 = 7; + b1 = 5; + } + + if (l == 6) + { + b0 = 6; + b1 = 2; + } + + if (l == 7) + { + b0 = 3; + } + + float f5 = (float)b0 / 16.0F; + float f6 = 1.0F - (float)k / 16.0F; + float f7 = 1.0F - (float)(k + b1) / 16.0F; + k += b1; + this.setRenderBounds((double)(0.5F - f5), (double)f7, (double)(0.5F - f5), (double)(0.5F + f5), (double)f6, (double)(0.5F + f5)); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + } + + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + else if (j == 11) + { + for (k = 0; k < 4; ++k) + { + f2 = 0.125F; + + if (k == 0) + { + this.setRenderBounds((double)(0.5F - f2), 0.0D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + + if (k == 1) + { + this.setRenderBounds((double)(0.5F - f2), 0.0D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + + f2 = 0.0625F; + + if (k == 2) + { + this.setRenderBounds((double)(0.5F - f2), (double)(1.0F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(1.0F - f2), (double)(1.0F + f2 * 2.0F)); + } + + if (k == 3) + { + this.setRenderBounds((double)(0.5F - f2), (double)(0.5F - f2 * 3.0F), (double)(-f2 * 2.0F), (double)(0.5F + f2), (double)(0.5F - f2), (double)(1.0F + f2 * 2.0F)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + else if (j == 21) + { + for (k = 0; k < 3; ++k) + { + f2 = 0.0625F; + + if (k == 0) + { + this.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, 0.0D, (double)(0.5F + f2), 1.0D, (double)(f2 * 2.0F)); + } + + if (k == 1) + { + this.setRenderBounds((double)(0.5F - f2), 0.30000001192092896D, (double)(1.0F - f2 * 2.0F), (double)(0.5F + f2), 1.0D, 1.0D); + } + + f2 = 0.0625F; + + if (k == 2) + { + this.setRenderBounds((double)(0.5F - f2), 0.5D, 0.0D, (double)(0.5F + f2), (double)(1.0F - f2), 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 0)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 1)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 2)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 3)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 4)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(p_147800_1_, 5)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } + else if (j == 32) + { + for (k = 0; k < 2; ++k) + { + if (k == 0) + { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + + if (k == 1) + { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + } + else if (j == 35) + { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.renderBlockAnvilOrient((BlockAnvil)p_147800_1_, 0, 0, 0, p_147800_2_ << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + else if (j == 34) + { + for (k = 0; k < 3; ++k) + { + if (k == 0) + { + this.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.obsidian)); + } + else if (k == 1) + { + this.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.beacon)); + } + else if (k == 2) + { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.setOverrideBlockTexture(this.getBlockIcon(Blocks.glass)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.clearOverrideBlockTexture(); + } + else if (j == 38) + { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + this.renderBlockHopperMetadata((BlockHopper)p_147800_1_, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + else + { + FMLRenderAccessLibrary.renderInventoryBlock(this, p_147800_1_, p_147800_2_, j); + } + } + else + { + if (j == 16) + { + p_147800_2_ = 1; + } + + p_147800_1_.setBlockBoundsForItemRender(); + this.setRenderBoundsFromBlock(p_147800_1_); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + this.renderFaceYNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 0, p_147800_2_)); + tessellator.draw(); + + if (flag && this.useInventoryTint) + { + k = p_147800_1_.getRenderColor(p_147800_2_); + f2 = (float)(k >> 16 & 255) / 255.0F; + f3 = (float)(k >> 8 & 255) / 255.0F; + float f4 = (float)(k & 255) / 255.0F; + GL11.glColor4f(f2 * p_147800_3_, f3 * p_147800_3_, f4 * p_147800_3_, 1.0F); + } + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + this.renderFaceYPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 1, p_147800_2_)); + tessellator.draw(); + + if (flag && this.useInventoryTint) + { + GL11.glColor4f(p_147800_3_, p_147800_3_, p_147800_3_, 1.0F); + } + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + this.renderFaceZNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 2, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + this.renderFaceZPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 3, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + this.renderFaceXNeg(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 4, p_147800_2_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + this.renderFaceXPos(p_147800_1_, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(p_147800_1_, 5, p_147800_2_)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } + + /** + * Checks to see if the item's render type indicates that it should be rendered as a regular block or not. + */ + public static boolean renderItemIn3d(int p_147739_0_) + { + switch (p_147739_0_) + { + case 0 : return true ; + case 31: return true ; + case 39: return true ; + case 13: return true ; + case 10: return true ; + case 11: return true ; + case 27: return true ; + case 22: return true ; + case 21: return true ; + case 16: return true ; + case 26: return true ; + case 32: return true ; + case 34: return true ; + case 35: return true ; + default: return FMLRenderAccessLibrary.renderItemAsFull3DBlock(p_147739_0_); + } + } + + public IIcon getBlockIcon(Block p_147793_1_, IBlockAccess p_147793_2_, int p_147793_3_, int p_147793_4_, int p_147793_5_, int p_147793_6_) + { + return this.getIconSafe(p_147793_1_.getIcon(p_147793_2_, p_147793_3_, p_147793_4_, p_147793_5_, p_147793_6_)); + } + + public IIcon getBlockIconFromSideAndMetadata(Block p_147787_1_, int p_147787_2_, int p_147787_3_) + { + return this.getIconSafe(p_147787_1_.getIcon(p_147787_2_, p_147787_3_)); + } + + public IIcon getBlockIconFromSide(Block p_147777_1_, int p_147777_2_) + { + return this.getIconSafe(p_147777_1_.getBlockTextureFromSide(p_147777_2_)); + } + + public IIcon getBlockIcon(Block p_147745_1_) + { + return this.getIconSafe(p_147745_1_.getBlockTextureFromSide(1)); + } + + public IIcon getIconSafe(IIcon p_147758_1_) + { + if (p_147758_1_ == null) + { + p_147758_1_ = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } + + return (IIcon)p_147758_1_; + } + + /*==================================== FORGE START ===========================================*/ + private static RenderBlocks instance; + /** + * Returns a single lazy loaded instance of RenderBlocks, for use in mods who + * don't care about the interaction of other objects on the current state of the RenderBlocks they are using. + * @return A global instance of RenderBlocks + */ + public static RenderBlocks getInstance() + { + if (instance == null) instance = new RenderBlocks(); + return instance; + } + /*==================================== FORGE END =============================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderGlobal.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderGlobal.java new file mode 100644 index 0000000..37cb868 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderGlobal.java @@ -0,0 +1,2563 @@ +package net.minecraft.client.renderer; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.particle.EntityAuraFX; +import net.minecraft.client.particle.EntityBlockDustFX; +import net.minecraft.client.particle.EntityBreakingFX; +import net.minecraft.client.particle.EntityBubbleFX; +import net.minecraft.client.particle.EntityCloudFX; +import net.minecraft.client.particle.EntityCritFX; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityDropParticleFX; +import net.minecraft.client.particle.EntityEnchantmentTableParticleFX; +import net.minecraft.client.particle.EntityExplodeFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntityFireworkSparkFX; +import net.minecraft.client.particle.EntityFishWakeFX; +import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.particle.EntityFootStepFX; +import net.minecraft.client.particle.EntityHeartFX; +import net.minecraft.client.particle.EntityHugeExplodeFX; +import net.minecraft.client.particle.EntityLargeExplodeFX; +import net.minecraft.client.particle.EntityLavaFX; +import net.minecraft.client.particle.EntityNoteFX; +import net.minecraft.client.particle.EntityPortalFX; +import net.minecraft.client.particle.EntityReddustFX; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.client.particle.EntitySnowShovelFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.client.particle.EntitySplashFX; +import net.minecraft.client.particle.EntitySuspendFX; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.util.RenderDistanceSorter; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemRecord; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.IWorldAccess; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.ARBOcclusionQuery; +import org.lwjgl.opengl.GL11; + +import net.minecraftforge.client.IRenderHandler; +import net.minecraftforge.client.MinecraftForgeClient; + +@SideOnly(Side.CLIENT) +public class RenderGlobal implements IWorldAccess +{ + private static final Logger logger = LogManager.getLogger(); + private static final ResourceLocation locationMoonPhasesPng = new ResourceLocation("textures/environment/moon_phases.png"); + private static final ResourceLocation locationSunPng = new ResourceLocation("textures/environment/sun.png"); + private static final ResourceLocation locationCloudsPng = new ResourceLocation("textures/environment/clouds.png"); + private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png"); + public List tileEntities = new ArrayList(); + private WorldClient theWorld; + /** The RenderEngine instance used by RenderGlobal */ + private final TextureManager renderEngine; + private List worldRenderersToUpdate = new ArrayList(); + private WorldRenderer[] sortedWorldRenderers; + private WorldRenderer[] worldRenderers; + private int renderChunksWide; + private int renderChunksTall; + private int renderChunksDeep; + /** OpenGL render lists base */ + private int glRenderListBase; + /** A reference to the Minecraft object. */ + private Minecraft mc; + private RenderBlocks renderBlocksRg; + /** OpenGL occlusion query base */ + private IntBuffer glOcclusionQueryBase; + /** Is occlusion testing enabled */ + private boolean occlusionEnabled; + /** counts the cloud render updates. Used with mod to stagger some updates */ + private int cloudTickCounter; + /** The star GL Call list */ + private int starGLCallList; + /** OpenGL sky list */ + private int glSkyList; + /** OpenGL sky list 2 */ + private int glSkyList2; + /** Minimum block X */ + private int minBlockX; + /** Minimum block Y */ + private int minBlockY; + /** Minimum block Z */ + private int minBlockZ; + /** Maximum block X */ + private int maxBlockX; + /** Maximum block Y */ + private int maxBlockY; + /** Maximum block Z */ + private int maxBlockZ; + /** + * Stores blocks currently being broken. Key is entity ID of the thing doing the breaking. Value is a + * DestroyBlockProgress + */ + private final Map damagedBlocks = new HashMap(); + /** Currently playing sounds. Type: HashMap */ + private final Map mapSoundPositions = Maps.newHashMap(); + private IIcon[] destroyBlockIcons; + private boolean displayListEntitiesDirty; + private int displayListEntities; + private int renderDistanceChunks = -1; + /** Render entities startup counter (init value=2) */ + private int renderEntitiesStartupCounter = 2; + /** Count entities total */ + private int countEntitiesTotal; + /** Count entities rendered */ + private int countEntitiesRendered; + /** Count entities hidden */ + private int countEntitiesHidden; + /** Occlusion query result */ + IntBuffer occlusionResult = GLAllocation.createDirectIntBuffer(64); + /** How many renderers are loaded this frame that try to be rendered */ + private int renderersLoaded; + /** How many renderers are being clipped by the frustrum this frame */ + private int renderersBeingClipped; + /** How many renderers are being occluded this frame */ + private int renderersBeingOccluded; + /** How many renderers are actually being rendered this frame */ + private int renderersBeingRendered; + /** How many renderers are skipping rendering due to not having a render pass this frame */ + private int renderersSkippingRenderPass; + /** Dummy render int */ + private int dummyRenderInt; + /** World renderers check index */ + private int worldRenderersCheckIndex; + /** List of OpenGL lists for the current render pass */ + private List glRenderLists = new ArrayList(); + /** All render lists (fixed length 4) */ + private RenderList[] allRenderLists = new RenderList[] {new RenderList(), new RenderList(), new RenderList(), new RenderList()}; + /** + * Previous x position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortX = -9999.0D; + /** + * Previous y position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortY = -9999.0D; + /** + * Previous Z position when the renderers were sorted. (Once the distance moves more than 4 units they will be + * resorted) + */ + double prevSortZ = -9999.0D; + double prevRenderSortX = -9999.0D; + double prevRenderSortY = -9999.0D; + double prevRenderSortZ = -9999.0D; + int prevChunkSortX = -999; + int prevChunkSortY = -999; + int prevChunkSortZ = -999; + /** The offset used to determine if a renderer is one of the sixteenth that are being updated this frame */ + int frustumCheckOffset; + private static final String __OBFID = "CL_00000954"; + + public RenderGlobal(Minecraft p_i1249_1_) + { + this.mc = p_i1249_1_; + this.renderEngine = p_i1249_1_.getTextureManager(); + byte b0 = 34; + byte b1 = 16; + this.glRenderListBase = GLAllocation.generateDisplayLists(b0 * b0 * b1 * 3); + this.displayListEntitiesDirty = false; + this.displayListEntities = GLAllocation.generateDisplayLists(1); + this.occlusionEnabled = OpenGlCapsChecker.checkARBOcclusion(); + + if (this.occlusionEnabled) + { + this.occlusionResult.clear(); + this.glOcclusionQueryBase = GLAllocation.createDirectIntBuffer(b0 * b0 * b1); + this.glOcclusionQueryBase.clear(); + this.glOcclusionQueryBase.position(0); + this.glOcclusionQueryBase.limit(b0 * b0 * b1); + ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase); + } + + this.starGLCallList = GLAllocation.generateDisplayLists(3); + GL11.glPushMatrix(); + GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE); + this.renderStars(); + GL11.glEndList(); + GL11.glPopMatrix(); + Tessellator tessellator = Tessellator.instance; + this.glSkyList = this.starGLCallList + 1; + GL11.glNewList(this.glSkyList, GL11.GL_COMPILE); + byte b2 = 64; + int i = 256 / b2 + 2; + float f = 16.0F; + int j; + int k; + + for (j = -b2 * i; j <= b2 * i; j += b2) + { + for (k = -b2 * i; k <= b2 * i; k += b2) + { + tessellator.startDrawingQuads(); + tessellator.addVertex((double)(j + 0), (double)f, (double)(k + 0)); + tessellator.addVertex((double)(j + b2), (double)f, (double)(k + 0)); + tessellator.addVertex((double)(j + b2), (double)f, (double)(k + b2)); + tessellator.addVertex((double)(j + 0), (double)f, (double)(k + b2)); + tessellator.draw(); + } + } + + GL11.glEndList(); + this.glSkyList2 = this.starGLCallList + 2; + GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE); + f = -16.0F; + tessellator.startDrawingQuads(); + + for (j = -b2 * i; j <= b2 * i; j += b2) + { + for (k = -b2 * i; k <= b2 * i; k += b2) + { + tessellator.addVertex((double)(j + b2), (double)f, (double)(k + 0)); + tessellator.addVertex((double)(j + 0), (double)f, (double)(k + 0)); + tessellator.addVertex((double)(j + 0), (double)f, (double)(k + b2)); + tessellator.addVertex((double)(j + b2), (double)f, (double)(k + b2)); + } + } + + tessellator.draw(); + GL11.glEndList(); + } + + private void renderStars() + { + Random random = new Random(10842L); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + + for (int i = 0; i < 1500; ++i) + { + double d0 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d1 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d2 = (double)(random.nextFloat() * 2.0F - 1.0F); + double d3 = (double)(0.15F + random.nextFloat() * 0.1F); + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d4 < 1.0D && d4 > 0.01D) + { + d4 = 1.0D / Math.sqrt(d4); + d0 *= d4; + d1 *= d4; + d2 *= d4; + double d5 = d0 * 100.0D; + double d6 = d1 * 100.0D; + double d7 = d2 * 100.0D; + double d8 = Math.atan2(d0, d2); + double d9 = Math.sin(d8); + double d10 = Math.cos(d8); + double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1); + double d12 = Math.sin(d11); + double d13 = Math.cos(d11); + double d14 = random.nextDouble() * Math.PI * 2.0D; + double d15 = Math.sin(d14); + double d16 = Math.cos(d14); + + for (int j = 0; j < 4; ++j) + { + double d17 = 0.0D; + double d18 = (double)((j & 2) - 1) * d3; + double d19 = (double)((j + 1 & 2) - 1) * d3; + double d20 = d18 * d16 - d19 * d15; + double d21 = d19 * d16 + d18 * d15; + double d22 = d20 * d12 + d17 * d13; + double d23 = d17 * d12 - d20 * d13; + double d24 = d23 * d9 - d21 * d10; + double d25 = d21 * d9 + d23 * d10; + tessellator.addVertex(d5 + d24, d6 + d22, d7 + d25); + } + } + } + + tessellator.draw(); + } + + /** + * set null to clear + */ + public void setWorldAndLoadRenderers(WorldClient p_72732_1_) + { + if (this.theWorld != null) + { + this.theWorld.removeWorldAccess(this); + } + + this.prevSortX = -9999.0D; + this.prevSortY = -9999.0D; + this.prevSortZ = -9999.0D; + this.prevRenderSortX = -9999.0D; + this.prevRenderSortY = -9999.0D; + this.prevRenderSortZ = -9999.0D; + this.prevChunkSortX = -9999; + this.prevChunkSortY = -9999; + this.prevChunkSortZ = -9999; + RenderManager.instance.set(p_72732_1_); + this.theWorld = p_72732_1_; + this.renderBlocksRg = new RenderBlocks(p_72732_1_); + + if (p_72732_1_ != null) + { + p_72732_1_.addWorldAccess(this); + this.loadRenderers(); + } + } + + /** + * Loads all the renderers and sets up the basic settings usage + */ + public void loadRenderers() + { + if (this.theWorld != null) + { + Blocks.leaves.setGraphicsLevel(this.mc.gameSettings.fancyGraphics); + Blocks.leaves2.setGraphicsLevel(this.mc.gameSettings.fancyGraphics); + this.renderDistanceChunks = this.mc.gameSettings.renderDistanceChunks; + int i; + + if (this.worldRenderers != null) + { + for (i = 0; i < this.worldRenderers.length; ++i) + { + this.worldRenderers[i].stopRendering(); + } + } + + i = this.renderDistanceChunks * 2 + 1; + this.renderChunksWide = i; + this.renderChunksTall = 16; + this.renderChunksDeep = i; + this.worldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; + this.sortedWorldRenderers = new WorldRenderer[this.renderChunksWide * this.renderChunksTall * this.renderChunksDeep]; + int j = 0; + int k = 0; + this.minBlockX = 0; + this.minBlockY = 0; + this.minBlockZ = 0; + this.maxBlockX = this.renderChunksWide; + this.maxBlockY = this.renderChunksTall; + this.maxBlockZ = this.renderChunksDeep; + int l; + + for (l = 0; l < this.worldRenderersToUpdate.size(); ++l) + { + ((WorldRenderer)this.worldRenderersToUpdate.get(l)).needsUpdate = false; + } + + this.worldRenderersToUpdate.clear(); + this.tileEntities.clear(); + this.onStaticEntitiesChanged(); + + for (l = 0; l < this.renderChunksWide; ++l) + { + for (int i1 = 0; i1 < this.renderChunksTall; ++i1) + { + for (int j1 = 0; j1 < this.renderChunksDeep; ++j1) + { + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l] = new WorldRenderer(this.theWorld, this.tileEntities, l * 16, i1 * 16, j1 * 16, this.glRenderListBase + j); + + if (this.occlusionEnabled) + { + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].glOcclusionQuery = this.glOcclusionQueryBase.get(k); + } + + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].isWaitingOnOcclusionQuery = false; + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].isVisible = true; + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].isInFrustum = true; + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].chunkIndex = k++; + this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l].markDirty(); + this.sortedWorldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l] = this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l]; + this.worldRenderersToUpdate.add(this.worldRenderers[(j1 * this.renderChunksTall + i1) * this.renderChunksWide + l]); + j += 3; + } + } + } + + if (this.theWorld != null) + { + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + + if (entitylivingbase != null) + { + this.markRenderersForNewPosition(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)); + Arrays.sort(this.sortedWorldRenderers, new EntitySorter(entitylivingbase)); + } + } + + this.renderEntitiesStartupCounter = 2; + } + } + + /** + * Renders all entities within range and within the frustrum. Args: pos, frustrum, partialTickTime + */ + public void renderEntities(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) + { + int pass = MinecraftForgeClient.getRenderPass(); + if (this.renderEntitiesStartupCounter > 0) + { + if (pass > 0) return; + --this.renderEntitiesStartupCounter; + } + else + { + double d0 = p_147589_1_.prevPosX + (p_147589_1_.posX - p_147589_1_.prevPosX) * (double)p_147589_3_; + double d1 = p_147589_1_.prevPosY + (p_147589_1_.posY - p_147589_1_.prevPosY) * (double)p_147589_3_; + double d2 = p_147589_1_.prevPosZ + (p_147589_1_.posZ - p_147589_1_.prevPosZ) * (double)p_147589_3_; + this.theWorld.theProfiler.startSection("prepare"); + TileEntityRendererDispatcher.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, p_147589_3_); + RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntity, this.mc.gameSettings, p_147589_3_); + if (pass == 0) // no indentation to shrink patch + { + this.countEntitiesTotal = 0; + this.countEntitiesRendered = 0; + this.countEntitiesHidden = 0; + } + EntityLivingBase entitylivingbase1 = this.mc.renderViewEntity; + double d3 = entitylivingbase1.lastTickPosX + (entitylivingbase1.posX - entitylivingbase1.lastTickPosX) * (double)p_147589_3_; + double d4 = entitylivingbase1.lastTickPosY + (entitylivingbase1.posY - entitylivingbase1.lastTickPosY) * (double)p_147589_3_; + double d5 = entitylivingbase1.lastTickPosZ + (entitylivingbase1.posZ - entitylivingbase1.lastTickPosZ) * (double)p_147589_3_; + TileEntityRendererDispatcher.staticPlayerX = d3; + TileEntityRendererDispatcher.staticPlayerY = d4; + TileEntityRendererDispatcher.staticPlayerZ = d5; + this.theWorld.theProfiler.endStartSection("staticentities"); + + if (this.displayListEntitiesDirty) + { + RenderManager.renderPosX = 0.0D; + RenderManager.renderPosY = 0.0D; + RenderManager.renderPosZ = 0.0D; + this.rebuildDisplayListEntities(); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glTranslated(-d3, -d4, -d5); + GL11.glCallList(this.displayListEntities); + GL11.glPopMatrix(); + RenderManager.renderPosX = d3; + RenderManager.renderPosY = d4; + RenderManager.renderPosZ = d5; + this.mc.entityRenderer.enableLightmap((double)p_147589_3_); + this.theWorld.theProfiler.endStartSection("global"); + List list = this.theWorld.getLoadedEntityList(); + if (pass == 0) // no indentation for smaller patch size + { + this.countEntitiesTotal = list.size(); + } + int i; + Entity entity; + + for (i = 0; i < this.theWorld.weatherEffects.size(); ++i) + { + entity = (Entity)this.theWorld.weatherEffects.get(i); + if (!entity.shouldRenderInPass(pass)) continue; + ++this.countEntitiesRendered; + + if (entity.isInRangeToRender3d(d0, d1, d2)) + { + RenderManager.instance.renderEntitySimple(entity, p_147589_3_); + } + } + + this.theWorld.theProfiler.endStartSection("entities"); + + for (i = 0; i < list.size(); ++i) + { + entity = (Entity)list.get(i); + if (!entity.shouldRenderInPass(pass)) continue; + boolean flag = entity.isInRangeToRender3d(d0, d1, d2) && (entity.ignoreFrustumCheck || p_147589_2_.isBoundingBoxInFrustum(entity.boundingBox) || entity.riddenByEntity == this.mc.thePlayer); + + if (!flag && entity instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)entity; + + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() != null) + { + Entity entity1 = entityliving.getLeashedToEntity(); + flag = p_147589_2_.isBoundingBoxInFrustum(entity1.boundingBox); + } + } + + if (flag && (entity != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(entity.posX), 0, MathHelper.floor_double(entity.posZ))) + { + ++this.countEntitiesRendered; + RenderManager.instance.renderEntitySimple(entity, p_147589_3_); + } + } + + this.theWorld.theProfiler.endStartSection("blockentities"); + RenderHelper.enableStandardItemLighting(); + + for (i = 0; i < this.tileEntities.size(); ++i) + { + TileEntity tile = (TileEntity)this.tileEntities.get(i); + if (tile.shouldRenderInPass(pass) && p_147589_2_.isBoundingBoxInFrustum(tile.getRenderBoundingBox())) + { + TileEntityRendererDispatcher.instance.renderTileEntity(tile, p_147589_3_); + } + } + + this.mc.entityRenderer.disableLightmap((double)p_147589_3_); + this.theWorld.theProfiler.endSection(); + } + } + + /** + * Gets the render info for use on the Debug screen + */ + public String getDebugInfoRenders() + { + return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ". F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass; + } + + /** + * Gets the entities info for use on the Debug screen + */ + public String getDebugInfoEntities() + { + return "E: " + this.countEntitiesRendered + "/" + this.countEntitiesTotal + ". B: " + this.countEntitiesHidden + ", I: " + (this.countEntitiesTotal - this.countEntitiesHidden - this.countEntitiesRendered); + } + + public void onStaticEntitiesChanged() + { + this.displayListEntitiesDirty = true; + } + + public void rebuildDisplayListEntities() + { + this.theWorld.theProfiler.startSection("staticentityrebuild"); + GL11.glPushMatrix(); + GL11.glNewList(this.displayListEntities, GL11.GL_COMPILE); + List list = this.theWorld.getLoadedEntityList(); + this.displayListEntitiesDirty = false; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (RenderManager.instance.getEntityRenderObject(entity).isStaticEntity()) + { + this.displayListEntitiesDirty = this.displayListEntitiesDirty || !RenderManager.instance.renderEntityStatic(entity, 0.0F, true); + } + } + + GL11.glEndList(); + GL11.glPopMatrix(); + this.theWorld.theProfiler.endSection(); + } + + /** + * Goes through all the renderers setting new positions on them and those that have their position changed are + * adding to be updated + */ + private void markRenderersForNewPosition(int p_72722_1_, int p_72722_2_, int p_72722_3_) + { + p_72722_1_ -= 8; + p_72722_2_ -= 8; + p_72722_3_ -= 8; + this.minBlockX = Integer.MAX_VALUE; + this.minBlockY = Integer.MAX_VALUE; + this.minBlockZ = Integer.MAX_VALUE; + this.maxBlockX = Integer.MIN_VALUE; + this.maxBlockY = Integer.MIN_VALUE; + this.maxBlockZ = Integer.MIN_VALUE; + int l = this.renderChunksWide * 16; + int i1 = l / 2; + + for (int j1 = 0; j1 < this.renderChunksWide; ++j1) + { + int k1 = j1 * 16; + int l1 = k1 + i1 - p_72722_1_; + + if (l1 < 0) + { + l1 -= l - 1; + } + + l1 /= l; + k1 -= l1 * l; + + if (k1 < this.minBlockX) + { + this.minBlockX = k1; + } + + if (k1 > this.maxBlockX) + { + this.maxBlockX = k1; + } + + for (int i2 = 0; i2 < this.renderChunksDeep; ++i2) + { + int j2 = i2 * 16; + int k2 = j2 + i1 - p_72722_3_; + + if (k2 < 0) + { + k2 -= l - 1; + } + + k2 /= l; + j2 -= k2 * l; + + if (j2 < this.minBlockZ) + { + this.minBlockZ = j2; + } + + if (j2 > this.maxBlockZ) + { + this.maxBlockZ = j2; + } + + for (int l2 = 0; l2 < this.renderChunksTall; ++l2) + { + int i3 = l2 * 16; + + if (i3 < this.minBlockY) + { + this.minBlockY = i3; + } + + if (i3 > this.maxBlockY) + { + this.maxBlockY = i3; + } + + WorldRenderer worldrenderer = this.worldRenderers[(i2 * this.renderChunksTall + l2) * this.renderChunksWide + j1]; + boolean flag = worldrenderer.needsUpdate; + worldrenderer.setPosition(k1, i3, j2); + + if (!flag && worldrenderer.needsUpdate) + { + this.worldRenderersToUpdate.add(worldrenderer); + } + } + } + } + } + + /** + * Sorts all renderers based on the passed in entity. Args: entityLiving, renderPass, partialTickTime + */ + public int sortAndRender(EntityLivingBase p_72719_1_, int p_72719_2_, double p_72719_3_) + { + this.theWorld.theProfiler.startSection("sortchunks"); + + for (int j = 0; j < 10; ++j) + { + this.worldRenderersCheckIndex = (this.worldRenderersCheckIndex + 1) % this.worldRenderers.length; + WorldRenderer worldrenderer = this.worldRenderers[this.worldRenderersCheckIndex]; + + if (worldrenderer.needsUpdate && !this.worldRenderersToUpdate.contains(worldrenderer)) + { + this.worldRenderersToUpdate.add(worldrenderer); + } + } + + if (this.mc.gameSettings.renderDistanceChunks != this.renderDistanceChunks) + { + this.loadRenderers(); + } + + if (p_72719_2_ == 0) + { + this.renderersLoaded = 0; + this.dummyRenderInt = 0; + this.renderersBeingClipped = 0; + this.renderersBeingOccluded = 0; + this.renderersBeingRendered = 0; + this.renderersSkippingRenderPass = 0; + } + + double d9 = p_72719_1_.lastTickPosX + (p_72719_1_.posX - p_72719_1_.lastTickPosX) * p_72719_3_; + double d1 = p_72719_1_.lastTickPosY + (p_72719_1_.posY - p_72719_1_.lastTickPosY) * p_72719_3_; + double d2 = p_72719_1_.lastTickPosZ + (p_72719_1_.posZ - p_72719_1_.lastTickPosZ) * p_72719_3_; + double d3 = p_72719_1_.posX - this.prevSortX; + double d4 = p_72719_1_.posY - this.prevSortY; + double d5 = p_72719_1_.posZ - this.prevSortZ; + + if (this.prevChunkSortX != p_72719_1_.chunkCoordX || this.prevChunkSortY != p_72719_1_.chunkCoordY || this.prevChunkSortZ != p_72719_1_.chunkCoordZ || d3 * d3 + d4 * d4 + d5 * d5 > 16.0D) + { + this.prevSortX = p_72719_1_.posX; + this.prevSortY = p_72719_1_.posY; + this.prevSortZ = p_72719_1_.posZ; + this.prevChunkSortX = p_72719_1_.chunkCoordX; + this.prevChunkSortY = p_72719_1_.chunkCoordY; + this.prevChunkSortZ = p_72719_1_.chunkCoordZ; + this.markRenderersForNewPosition(MathHelper.floor_double(p_72719_1_.posX), MathHelper.floor_double(p_72719_1_.posY), MathHelper.floor_double(p_72719_1_.posZ)); + Arrays.sort(this.sortedWorldRenderers, new EntitySorter(p_72719_1_)); + } + + double d6 = p_72719_1_.posX - this.prevRenderSortX; + double d7 = p_72719_1_.posY - this.prevRenderSortY; + double d8 = p_72719_1_.posZ - this.prevRenderSortZ; + int k; + + if (d6 * d6 + d7 * d7 + d8 * d8 > 1.0D) + { + this.prevRenderSortX = p_72719_1_.posX; + this.prevRenderSortY = p_72719_1_.posY; + this.prevRenderSortZ = p_72719_1_.posZ; + + for (k = 0; k < 27; ++k) + { + this.sortedWorldRenderers[k].updateRendererSort(p_72719_1_); + } + } + + RenderHelper.disableStandardItemLighting(); + byte b1 = 0; + + if (this.occlusionEnabled && this.mc.gameSettings.advancedOpengl && !this.mc.gameSettings.anaglyph && p_72719_2_ == 0) + { + byte b0 = 0; + int l = 16; + this.checkOcclusionQueryResult(b0, l); + + for (int i1 = b0; i1 < l; ++i1) + { + this.sortedWorldRenderers[i1].isVisible = true; + } + + this.theWorld.theProfiler.endStartSection("render"); + k = b1 + this.renderSortedRenderers(b0, l, p_72719_2_, p_72719_3_); + + do + { + this.theWorld.theProfiler.endStartSection("occ"); + int l1 = l; + l *= 2; + + if (l > this.sortedWorldRenderers.length) + { + l = this.sortedWorldRenderers.length; + } + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_FOG); + GL11.glColorMask(false, false, false, false); + GL11.glDepthMask(false); + this.theWorld.theProfiler.startSection("check"); + this.checkOcclusionQueryResult(l1, l); + this.theWorld.theProfiler.endSection(); + GL11.glPushMatrix(); + float f9 = 0.0F; + float f = 0.0F; + float f1 = 0.0F; + + for (int j1 = l1; j1 < l; ++j1) + { + if (this.sortedWorldRenderers[j1].skipAllRenderPasses()) + { + this.sortedWorldRenderers[j1].isInFrustum = false; + } + else + { + if (!this.sortedWorldRenderers[j1].isInFrustum) + { + this.sortedWorldRenderers[j1].isVisible = true; + } + + if (this.sortedWorldRenderers[j1].isInFrustum && !this.sortedWorldRenderers[j1].isWaitingOnOcclusionQuery) + { + float f2 = MathHelper.sqrt_float(this.sortedWorldRenderers[j1].distanceToEntitySquared(p_72719_1_)); + int k1 = (int)(1.0F + f2 / 128.0F); + + if (this.cloudTickCounter % k1 == j1 % k1) + { + WorldRenderer worldrenderer1 = this.sortedWorldRenderers[j1]; + float f3 = (float)((double)worldrenderer1.posXMinus - d9); + float f4 = (float)((double)worldrenderer1.posYMinus - d1); + float f5 = (float)((double)worldrenderer1.posZMinus - d2); + float f6 = f3 - f9; + float f7 = f4 - f; + float f8 = f5 - f1; + + if (f6 != 0.0F || f7 != 0.0F || f8 != 0.0F) + { + GL11.glTranslatef(f6, f7, f8); + f9 += f6; + f += f7; + f1 += f8; + } + + this.theWorld.theProfiler.startSection("bb"); + ARBOcclusionQuery.glBeginQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB, this.sortedWorldRenderers[j1].glOcclusionQuery); + this.sortedWorldRenderers[j1].callOcclusionQueryList(); + ARBOcclusionQuery.glEndQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB); + this.theWorld.theProfiler.endSection(); + this.sortedWorldRenderers[j1].isWaitingOnOcclusionQuery = true; + } + } + } + } + + GL11.glPopMatrix(); + + if (this.mc.gameSettings.anaglyph) + { + if (EntityRenderer.anaglyphField == 0) + { + GL11.glColorMask(false, true, true, true); + } + else + { + GL11.glColorMask(true, false, false, true); + } + } + else + { + GL11.glColorMask(true, true, true, true); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + this.theWorld.theProfiler.endStartSection("render"); + k += this.renderSortedRenderers(l1, l, p_72719_2_, p_72719_3_); + } + while (l < this.sortedWorldRenderers.length); + } + else + { + this.theWorld.theProfiler.endStartSection("render"); + k = b1 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, p_72719_2_, p_72719_3_); + } + + this.theWorld.theProfiler.endSection(); + return k; + } + + private void checkOcclusionQueryResult(int p_72720_1_, int p_72720_2_) + { + for (int k = p_72720_1_; k < p_72720_2_; ++k) + { + if (this.sortedWorldRenderers[k].isWaitingOnOcclusionQuery) + { + this.occlusionResult.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[k].glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_AVAILABLE_ARB, this.occlusionResult); + + if (this.occlusionResult.get(0) != 0) + { + this.sortedWorldRenderers[k].isWaitingOnOcclusionQuery = false; + this.occlusionResult.clear(); + ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[k].glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_ARB, this.occlusionResult); + this.sortedWorldRenderers[k].isVisible = this.occlusionResult.get(0) != 0; + } + } + } + } + + /** + * Renders the sorted renders for the specified render pass. Args: startRenderer, numRenderers, renderPass, + * partialTickTime + */ + private int renderSortedRenderers(int p_72724_1_, int p_72724_2_, int p_72724_3_, double p_72724_4_) + { + this.glRenderLists.clear(); + int l = 0; + int i1 = p_72724_1_; + int j1 = p_72724_2_; + byte b0 = 1; + + if (p_72724_3_ == 1) + { + i1 = this.sortedWorldRenderers.length - 1 - p_72724_1_; + j1 = this.sortedWorldRenderers.length - 1 - p_72724_2_; + b0 = -1; + } + + for (int k1 = i1; k1 != j1; k1 += b0) + { + if (p_72724_3_ == 0) + { + ++this.renderersLoaded; + + if (this.sortedWorldRenderers[k1].skipRenderPass[p_72724_3_]) + { + ++this.renderersSkippingRenderPass; + } + else if (!this.sortedWorldRenderers[k1].isInFrustum) + { + ++this.renderersBeingClipped; + } + else if (this.occlusionEnabled && !this.sortedWorldRenderers[k1].isVisible) + { + ++this.renderersBeingOccluded; + } + else + { + ++this.renderersBeingRendered; + } + } + + if (!this.sortedWorldRenderers[k1].skipRenderPass[p_72724_3_] && this.sortedWorldRenderers[k1].isInFrustum && (!this.occlusionEnabled || this.sortedWorldRenderers[k1].isVisible)) + { + int l1 = this.sortedWorldRenderers[k1].getGLCallListForPass(p_72724_3_); + + if (l1 >= 0) + { + this.glRenderLists.add(this.sortedWorldRenderers[k1]); + ++l; + } + } + } + + EntityLivingBase entitylivingbase = this.mc.renderViewEntity; + double d3 = entitylivingbase.lastTickPosX + (entitylivingbase.posX - entitylivingbase.lastTickPosX) * p_72724_4_; + double d1 = entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * p_72724_4_; + double d2 = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * p_72724_4_; + int i2 = 0; + int j2; + + for (j2 = 0; j2 < this.allRenderLists.length; ++j2) + { + this.allRenderLists[j2].resetList(); + } + + int k2; + int l2; + + for (j2 = 0; j2 < this.glRenderLists.size(); ++j2) + { + WorldRenderer worldrenderer = (WorldRenderer)this.glRenderLists.get(j2); + k2 = -1; + + for (l2 = 0; l2 < i2; ++l2) + { + if (this.allRenderLists[l2].rendersChunk(worldrenderer.posXMinus, worldrenderer.posYMinus, worldrenderer.posZMinus)) + { + k2 = l2; + } + } + + if (k2 < 0) + { + k2 = i2++; + this.allRenderLists[k2].setupRenderList(worldrenderer.posXMinus, worldrenderer.posYMinus, worldrenderer.posZMinus, d3, d1, d2); + } + + this.allRenderLists[k2].addGLRenderList(worldrenderer.getGLCallListForPass(p_72724_3_)); + } + + j2 = MathHelper.floor_double(d3); + int i3 = MathHelper.floor_double(d2); + k2 = j2 - (j2 & 1023); + l2 = i3 - (i3 & 1023); + Arrays.sort(this.allRenderLists, new RenderDistanceSorter(k2, l2)); + this.renderAllRenderLists(p_72724_3_, p_72724_4_); + return l; + } + + /** + * Render all render lists + */ + public void renderAllRenderLists(int p_72733_1_, double p_72733_2_) + { + this.mc.entityRenderer.enableLightmap(p_72733_2_); + + for (int j = 0; j < this.allRenderLists.length; ++j) + { + this.allRenderLists[j].callLists(); + } + + this.mc.entityRenderer.disableLightmap(p_72733_2_); + } + + public void updateClouds() + { + ++this.cloudTickCounter; + + if (this.cloudTickCounter % 20 == 0) + { + Iterator iterator = this.damagedBlocks.values().iterator(); + + while (iterator.hasNext()) + { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next(); + int i = destroyblockprogress.getCreationCloudUpdateTick(); + + if (this.cloudTickCounter - i > 400) + { + iterator.remove(); + } + } + } + } + + /** + * Renders the sky with the partial tick time. Args: partialTickTime + */ + public void renderSky(float p_72714_1_) + { + IRenderHandler skyProvider = null; + if ((skyProvider = this.mc.theWorld.provider.getSkyRenderer()) != null) + { + skyProvider.render(p_72714_1_, this.theWorld, mc); + return; + } + if (this.mc.theWorld.provider.dimensionId == 1) + { + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + GL11.glDepthMask(false); + this.renderEngine.bindTexture(locationEndSkyPng); + Tessellator tessellator = Tessellator.instance; + + for (int i = 0; i < 6; ++i) + { + GL11.glPushMatrix(); + + if (i == 1) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 2) + { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 3) + { + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + } + + if (i == 4) + { + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + } + + if (i == 5) + { + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + } + + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(2631720); + tessellator.addVertexWithUV(-100.0D, -100.0D, -100.0D, 0.0D, 0.0D); + tessellator.addVertexWithUV(-100.0D, -100.0D, 100.0D, 0.0D, 16.0D); + tessellator.addVertexWithUV(100.0D, -100.0D, 100.0D, 16.0D, 16.0D); + tessellator.addVertexWithUV(100.0D, -100.0D, -100.0D, 16.0D, 0.0D); + tessellator.draw(); + GL11.glPopMatrix(); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + else if (this.mc.theWorld.provider.isSurfaceWorld()) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + Vec3 vec3 = this.theWorld.getSkyColor(this.mc.renderViewEntity, p_72714_1_); + float f1 = (float)vec3.xCoord; + float f2 = (float)vec3.yCoord; + float f3 = (float)vec3.zCoord; + float f6; + + if (this.mc.gameSettings.anaglyph) + { + float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; + float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; + f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; + f1 = f4; + f2 = f5; + f3 = f6; + } + + GL11.glColor3f(f1, f2, f3); + Tessellator tessellator1 = Tessellator.instance; + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_FOG); + GL11.glColor3f(f1, f2, f3); + GL11.glCallList(this.glSkyList); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + RenderHelper.disableStandardItemLighting(); + float[] afloat = this.theWorld.provider.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(p_72714_1_), p_72714_1_); + float f7; + float f8; + float f9; + float f10; + + if (afloat != null) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glPushMatrix(); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.sin(this.theWorld.getCelestialAngleRadians(p_72714_1_)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + f6 = afloat[0]; + f7 = afloat[1]; + f8 = afloat[2]; + float f11; + + if (this.mc.gameSettings.anaglyph) + { + f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; + f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; + f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; + f6 = f9; + f7 = f10; + f8 = f11; + } + + tessellator1.startDrawing(6); + tessellator1.setColorRGBA_F(f6, f7, f8, afloat[3]); + tessellator1.addVertex(0.0D, 100.0D, 0.0D); + byte b0 = 16; + tessellator1.setColorRGBA_F(afloat[0], afloat[1], afloat[2], 0.0F); + + for (int j = 0; j <= b0; ++j) + { + f11 = (float)j * (float)Math.PI * 2.0F / (float)b0; + float f12 = MathHelper.sin(f11); + float f13 = MathHelper.cos(f11); + tessellator1.addVertex((double)(f12 * 120.0F), (double)(f13 * 120.0F), (double)(-f13 * 40.0F * afloat[3])); + } + + tessellator1.draw(); + GL11.glPopMatrix(); + GL11.glShadeModel(GL11.GL_FLAT); + } + + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + GL11.glPushMatrix(); + f6 = 1.0F - this.theWorld.getRainStrength(p_72714_1_); + f7 = 0.0F; + f8 = 0.0F; + f9 = 0.0F; + GL11.glColor4f(1.0F, 1.0F, 1.0F, f6); + GL11.glTranslatef(f7, f8, f9); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.theWorld.getCelestialAngle(p_72714_1_) * 360.0F, 1.0F, 0.0F, 0.0F); + f10 = 30.0F; + this.renderEngine.bindTexture(locationSunPng); + tessellator1.startDrawingQuads(); + tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); + tessellator1.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); + tessellator1.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); + tessellator1.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); + tessellator1.draw(); + f10 = 20.0F; + this.renderEngine.bindTexture(locationMoonPhasesPng); + int k = this.theWorld.getMoonPhase(); + int l = k % 4; + int i1 = k / 4 % 2; + float f14 = (float)(l + 0) / 4.0F; + float f15 = (float)(i1 + 0) / 2.0F; + float f16 = (float)(l + 1) / 4.0F; + float f17 = (float)(i1 + 1) / 2.0F; + tessellator1.startDrawingQuads(); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)f10, (double)f16, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)f10, (double)f14, (double)f17); + tessellator1.addVertexWithUV((double)f10, -100.0D, (double)(-f10), (double)f14, (double)f15); + tessellator1.addVertexWithUV((double)(-f10), -100.0D, (double)(-f10), (double)f16, (double)f15); + tessellator1.draw(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + float f18 = this.theWorld.getStarBrightness(p_72714_1_) * f6; + + if (f18 > 0.0F) + { + GL11.glColor4f(f18, f18, f18, f18); + GL11.glCallList(this.starGLCallList); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_FOG); + GL11.glPopMatrix(); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glColor3f(0.0F, 0.0F, 0.0F); + double d0 = this.mc.thePlayer.getPosition(p_72714_1_).yCoord - this.theWorld.getHorizon(); + + if (d0 < 0.0D) + { + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 12.0F, 0.0F); + GL11.glCallList(this.glSkyList2); + GL11.glPopMatrix(); + f8 = 1.0F; + f9 = -((float)(d0 + 65.0D)); + f10 = -f8; + tessellator1.startDrawingQuads(); + tessellator1.setColorRGBA_I(0, 255); + tessellator1.addVertex((double)(-f8), (double)f9, (double)f8); + tessellator1.addVertex((double)f8, (double)f9, (double)f8); + tessellator1.addVertex((double)f8, (double)f10, (double)f8); + tessellator1.addVertex((double)(-f8), (double)f10, (double)f8); + tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8)); + tessellator1.addVertex((double)f8, (double)f10, (double)(-f8)); + tessellator1.addVertex((double)f8, (double)f9, (double)(-f8)); + tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8)); + tessellator1.addVertex((double)f8, (double)f10, (double)(-f8)); + tessellator1.addVertex((double)f8, (double)f10, (double)f8); + tessellator1.addVertex((double)f8, (double)f9, (double)f8); + tessellator1.addVertex((double)f8, (double)f9, (double)(-f8)); + tessellator1.addVertex((double)(-f8), (double)f9, (double)(-f8)); + tessellator1.addVertex((double)(-f8), (double)f9, (double)f8); + tessellator1.addVertex((double)(-f8), (double)f10, (double)f8); + tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8)); + tessellator1.addVertex((double)(-f8), (double)f10, (double)(-f8)); + tessellator1.addVertex((double)(-f8), (double)f10, (double)f8); + tessellator1.addVertex((double)f8, (double)f10, (double)f8); + tessellator1.addVertex((double)f8, (double)f10, (double)(-f8)); + tessellator1.draw(); + } + + if (this.theWorld.provider.isSkyColored()) + { + GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F); + } + else + { + GL11.glColor3f(f1, f2, f3); + } + + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -((float)(d0 - 16.0D)), 0.0F); + GL11.glCallList(this.glSkyList2); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + } + } + + public void renderClouds(float p_72718_1_) + { + IRenderHandler renderer = null; + if ((renderer = theWorld.provider.getCloudRenderer()) != null) + { + renderer.render(p_72718_1_, theWorld, mc); + return; + } + if (this.mc.theWorld.provider.isSurfaceWorld()) + { + if (this.mc.gameSettings.fancyGraphics) + { + this.renderCloudsFancy(p_72718_1_); + } + else + { + GL11.glDisable(GL11.GL_CULL_FACE); + float f1 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)p_72718_1_); + byte b0 = 32; + int i = 256 / b0; + Tessellator tessellator = Tessellator.instance; + this.renderEngine.bindTexture(locationCloudsPng); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Vec3 vec3 = this.theWorld.getCloudColour(p_72718_1_); + float f2 = (float)vec3.xCoord; + float f3 = (float)vec3.yCoord; + float f4 = (float)vec3.zCoord; + float f5; + + if (this.mc.gameSettings.anaglyph) + { + f5 = (f2 * 30.0F + f3 * 59.0F + f4 * 11.0F) / 100.0F; + float f6 = (f2 * 30.0F + f3 * 70.0F) / 100.0F; + float f7 = (f2 * 30.0F + f4 * 70.0F) / 100.0F; + f2 = f5; + f3 = f6; + f4 = f7; + } + + f5 = 4.8828125E-4F; + double d2 = (double)((float)this.cloudTickCounter + p_72718_1_); + double d0 = this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)p_72718_1_ + d2 * 0.029999999329447746D; + double d1 = this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)p_72718_1_; + int j = MathHelper.floor_double(d0 / 2048.0D); + int k = MathHelper.floor_double(d1 / 2048.0D); + d0 -= (double)(j * 2048); + d1 -= (double)(k * 2048); + float f8 = this.theWorld.provider.getCloudHeight() - f1 + 0.33F; + float f9 = (float)(d0 * (double)f5); + float f10 = (float)(d1 * (double)f5); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(f2, f3, f4, 0.8F); + + for (int l = -b0 * i; l < b0 * i; l += b0) + { + for (int i1 = -b0 * i; i1 < b0 * i; i1 += b0) + { + tessellator.addVertexWithUV((double)(l + 0), (double)f8, (double)(i1 + b0), (double)((float)(l + 0) * f5 + f9), (double)((float)(i1 + b0) * f5 + f10)); + tessellator.addVertexWithUV((double)(l + b0), (double)f8, (double)(i1 + b0), (double)((float)(l + b0) * f5 + f9), (double)((float)(i1 + b0) * f5 + f10)); + tessellator.addVertexWithUV((double)(l + b0), (double)f8, (double)(i1 + 0), (double)((float)(l + b0) * f5 + f9), (double)((float)(i1 + 0) * f5 + f10)); + tessellator.addVertexWithUV((double)(l + 0), (double)f8, (double)(i1 + 0), (double)((float)(l + 0) * f5 + f9), (double)((float)(i1 + 0) * f5 + f10)); + } + } + + tessellator.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + } + } + } + + /** + * Checks if the given position is to be rendered with cloud fog + */ + public boolean hasCloudFog(double p_72721_1_, double p_72721_3_, double p_72721_5_, float p_72721_7_) + { + return false; + } + + /** + * Renders the 3d fancy clouds + */ + public void renderCloudsFancy(float p_72736_1_) + { + GL11.glDisable(GL11.GL_CULL_FACE); + float f1 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)p_72736_1_); + Tessellator tessellator = Tessellator.instance; + float f2 = 12.0F; + float f3 = 4.0F; + double d0 = (double)((float)this.cloudTickCounter + p_72736_1_); + double d1 = (this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)p_72736_1_ + d0 * 0.029999999329447746D) / (double)f2; + double d2 = (this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)p_72736_1_) / (double)f2 + 0.33000001311302185D; + float f4 = this.theWorld.provider.getCloudHeight() - f1 + 0.33F; + int i = MathHelper.floor_double(d1 / 2048.0D); + int j = MathHelper.floor_double(d2 / 2048.0D); + d1 -= (double)(i * 2048); + d2 -= (double)(j * 2048); + this.renderEngine.bindTexture(locationCloudsPng); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Vec3 vec3 = this.theWorld.getCloudColour(p_72736_1_); + float f5 = (float)vec3.xCoord; + float f6 = (float)vec3.yCoord; + float f7 = (float)vec3.zCoord; + float f8; + float f9; + float f10; + + if (this.mc.gameSettings.anaglyph) + { + f8 = (f5 * 30.0F + f6 * 59.0F + f7 * 11.0F) / 100.0F; + f9 = (f5 * 30.0F + f6 * 70.0F) / 100.0F; + f10 = (f5 * 30.0F + f7 * 70.0F) / 100.0F; + f5 = f8; + f6 = f9; + f7 = f10; + } + + f8 = (float)(d1 * 0.0D); + f9 = (float)(d2 * 0.0D); + f10 = 0.00390625F; + f8 = (float)MathHelper.floor_double(d1) * f10; + f9 = (float)MathHelper.floor_double(d2) * f10; + float f11 = (float)(d1 - (double)MathHelper.floor_double(d1)); + float f12 = (float)(d2 - (double)MathHelper.floor_double(d2)); + byte b0 = 8; + byte b1 = 4; + float f13 = 9.765625E-4F; + GL11.glScalef(f2, 1.0F, f2); + + for (int k = 0; k < 2; ++k) + { + if (k == 0) + { + GL11.glColorMask(false, false, false, false); + } + else if (this.mc.gameSettings.anaglyph) + { + if (EntityRenderer.anaglyphField == 0) + { + GL11.glColorMask(false, true, true, true); + } + else + { + GL11.glColorMask(true, false, false, true); + } + } + else + { + GL11.glColorMask(true, true, true, true); + } + + for (int l = -b1 + 1; l <= b1; ++l) + { + for (int i1 = -b1 + 1; i1 <= b1; ++i1) + { + tessellator.startDrawingQuads(); + float f14 = (float)(l * b0); + float f15 = (float)(i1 * b0); + float f16 = f14 - f11; + float f17 = f15 - f12; + + if (f4 > -f3 - 1.0F) + { + tessellator.setColorRGBA_F(f5 * 0.7F, f6 * 0.7F, f7 * 0.7F, 0.8F); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + (float)b0), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + 0.0F), (double)(f17 + (float)b0), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + 0.0F), (double)(f17 + 0.0F), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + 0.0F), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + } + + if (f4 <= f3 + 1.0F) + { + tessellator.setColorRGBA_F(f5, f6, f7, 0.8F); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + f3 - f13), (double)(f17 + (float)b0), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + f3 - f13), (double)(f17 + (float)b0), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + f3 - f13), (double)(f17 + 0.0F), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + f3 - f13), (double)(f17 + 0.0F), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + } + + tessellator.setColorRGBA_F(f5 * 0.9F, f6 * 0.9F, f7 * 0.9F, 0.8F); + int j1; + + if (l > -1) + { + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + + for (j1 = 0; j1 < b0; ++j1) + { + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + (float)b0), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 0.0F), (double)(f4 + f3), (double)(f17 + (float)b0), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 0.0F), (double)(f4 + f3), (double)(f17 + 0.0F), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + 0.0F), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + } + } + + if (l <= 1) + { + tessellator.setNormal(1.0F, 0.0F, 0.0F); + + for (j1 = 0; j1 < b0; ++j1) + { + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 1.0F - f13), (double)(f4 + 0.0F), (double)(f17 + (float)b0), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 1.0F - f13), (double)(f4 + f3), (double)(f17 + (float)b0), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + (float)b0) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 1.0F - f13), (double)(f4 + f3), (double)(f17 + 0.0F), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)j1 + 1.0F - f13), (double)(f4 + 0.0F), (double)(f17 + 0.0F), (double)((f14 + (float)j1 + 0.5F) * f10 + f8), (double)((f15 + 0.0F) * f10 + f9)); + } + } + + tessellator.setColorRGBA_F(f5 * 0.8F, f6 * 0.8F, f7 * 0.8F, 0.8F); + + if (i1 > -1) + { + tessellator.setNormal(0.0F, 0.0F, -1.0F); + + for (j1 = 0; j1 < b0; ++j1) + { + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + f3), (double)(f17 + (float)j1 + 0.0F), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + f3), (double)(f17 + (float)j1 + 0.0F), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + 0.0F), (double)(f17 + (float)j1 + 0.0F), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + (float)j1 + 0.0F), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + } + } + + if (i1 <= 1) + { + tessellator.setNormal(0.0F, 0.0F, 1.0F); + + for (j1 = 0; j1 < b0; ++j1) + { + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + f3), (double)(f17 + (float)j1 + 1.0F - f13), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + f3), (double)(f17 + (float)j1 + 1.0F - f13), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + (float)b0), (double)(f4 + 0.0F), (double)(f17 + (float)j1 + 1.0F - f13), (double)((f14 + (float)b0) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + tessellator.addVertexWithUV((double)(f16 + 0.0F), (double)(f4 + 0.0F), (double)(f17 + (float)j1 + 1.0F - f13), (double)((f14 + 0.0F) * f10 + f8), (double)((f15 + (float)j1 + 0.5F) * f10 + f9)); + } + } + + tessellator.draw(); + } + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + } + + /** + * Updates some of the renderers sorted by distance from the player + */ + public boolean updateRenderers(EntityLivingBase p_72716_1_, boolean p_72716_2_) + { + byte b0 = 2; + RenderSorter rendersorter = new RenderSorter(p_72716_1_); + WorldRenderer[] aworldrenderer = new WorldRenderer[b0]; + ArrayList arraylist = null; + int i = this.worldRenderersToUpdate.size(); + int j = 0; + this.theWorld.theProfiler.startSection("nearChunksSearch"); + int k; + WorldRenderer worldrenderer; + int l; + int i1; + label136: + + for (k = 0; k < i; ++k) + { + worldrenderer = (WorldRenderer)this.worldRenderersToUpdate.get(k); + + if (worldrenderer != null) + { + if (!p_72716_2_) + { + if (worldrenderer.distanceToEntitySquared(p_72716_1_) > 272.0F) + { + for (l = 0; l < b0 && (aworldrenderer[l] == null || rendersorter.compare(aworldrenderer[l], worldrenderer) <= 0); ++l) + { + ; + } + + --l; + + if (l > 0) + { + i1 = l; + + while (true) + { + --i1; + + if (i1 == 0) + { + aworldrenderer[l] = worldrenderer; + continue label136; + } + + aworldrenderer[i1 - 1] = aworldrenderer[i1]; + } + } + + continue; + } + } + else if (!worldrenderer.isInFrustum) + { + continue; + } + + if (arraylist == null) + { + arraylist = new ArrayList(); + } + + ++j; + arraylist.add(worldrenderer); + this.worldRenderersToUpdate.set(k, (Object)null); + } + } + + this.theWorld.theProfiler.endSection(); + this.theWorld.theProfiler.startSection("sort"); + + if (arraylist != null) + { + if (arraylist.size() > 1) + { + Collections.sort(arraylist, rendersorter); + } + + for (k = arraylist.size() - 1; k >= 0; --k) + { + worldrenderer = (WorldRenderer)arraylist.get(k); + worldrenderer.updateRenderer(p_72716_1_); + worldrenderer.needsUpdate = false; + } + } + + this.theWorld.theProfiler.endSection(); + k = 0; + this.theWorld.theProfiler.startSection("rebuild"); + int k1; + + for (k1 = b0 - 1; k1 >= 0; --k1) + { + WorldRenderer worldrenderer2 = aworldrenderer[k1]; + + if (worldrenderer2 != null) + { + if (!worldrenderer2.isInFrustum && k1 != b0 - 1) + { + aworldrenderer[k1] = null; + aworldrenderer[0] = null; + break; + } + + aworldrenderer[k1].updateRenderer(p_72716_1_); + aworldrenderer[k1].needsUpdate = false; + ++k; + } + } + + this.theWorld.theProfiler.endSection(); + this.theWorld.theProfiler.startSection("cleanup"); + k1 = 0; + l = 0; + + for (i1 = this.worldRenderersToUpdate.size(); k1 != i1; ++k1) + { + WorldRenderer worldrenderer1 = (WorldRenderer)this.worldRenderersToUpdate.get(k1); + + if (worldrenderer1 != null) + { + boolean flag1 = false; + + for (int j1 = 0; j1 < b0 && !flag1; ++j1) + { + if (worldrenderer1 == aworldrenderer[j1]) + { + flag1 = true; + } + } + + if (!flag1) + { + if (l != k1) + { + this.worldRenderersToUpdate.set(l, worldrenderer1); + } + + ++l; + } + } + } + + this.theWorld.theProfiler.endSection(); + this.theWorld.theProfiler.startSection("trim"); + + while (true) + { + --k1; + + if (k1 < l) + { + this.theWorld.theProfiler.endSection(); + return i == j + k; + } + + this.worldRenderersToUpdate.remove(k1); + } + } + + public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_) + { + drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_); + } + + public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityLivingBase p_72717_2_, float p_72717_3_) + { + double d0 = p_72717_2_.lastTickPosX + (p_72717_2_.posX - p_72717_2_.lastTickPosX) * (double)p_72717_3_; + double d1 = p_72717_2_.lastTickPosY + (p_72717_2_.posY - p_72717_2_.lastTickPosY) * (double)p_72717_3_; + double d2 = p_72717_2_.lastTickPosZ + (p_72717_2_.posZ - p_72717_2_.lastTickPosZ) * (double)p_72717_3_; + + if (!this.damagedBlocks.isEmpty()) + { + OpenGlHelper.glBlendFunc(774, 768, 1, 0); + this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); + GL11.glPushMatrix(); + GL11.glPolygonOffset(-3.0F, -3.0F); + GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + p_72717_1_.startDrawingQuads(); + p_72717_1_.setTranslation(-d0, -d1, -d2); + p_72717_1_.disableColor(); + Iterator iterator = this.damagedBlocks.values().iterator(); + + while (iterator.hasNext()) + { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next(); + double d3 = (double)destroyblockprogress.getPartialBlockX() - d0; + double d4 = (double)destroyblockprogress.getPartialBlockY() - d1; + double d5 = (double)destroyblockprogress.getPartialBlockZ() - d2; + + if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D) + { + iterator.remove(); + } + else + { + Block block = this.theWorld.getBlock(destroyblockprogress.getPartialBlockX(), destroyblockprogress.getPartialBlockY(), destroyblockprogress.getPartialBlockZ()); + + if (block.getMaterial() != Material.air) + { + this.renderBlocksRg.renderBlockUsingTexture(block, destroyblockprogress.getPartialBlockX(), destroyblockprogress.getPartialBlockY(), destroyblockprogress.getPartialBlockZ(), this.destroyBlockIcons[destroyblockprogress.getPartialBlockDamage()]); + } + } + } + + p_72717_1_.draw(); + p_72717_1_.setTranslation(0.0D, 0.0D, 0.0D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + } + } + + /** + * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime + */ + public void drawSelectionBox(EntityPlayer p_72731_1_, MovingObjectPosition p_72731_2_, int p_72731_3_, float p_72731_4_) + { + if (p_72731_3_ == 0 && p_72731_2_.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(false); + float f1 = 0.002F; + Block block = this.theWorld.getBlock(p_72731_2_.blockX, p_72731_2_.blockY, p_72731_2_.blockZ); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(this.theWorld, p_72731_2_.blockX, p_72731_2_.blockY, p_72731_2_.blockZ); + double d0 = p_72731_1_.lastTickPosX + (p_72731_1_.posX - p_72731_1_.lastTickPosX) * (double)p_72731_4_; + double d1 = p_72731_1_.lastTickPosY + (p_72731_1_.posY - p_72731_1_.lastTickPosY) * (double)p_72731_4_; + double d2 = p_72731_1_.lastTickPosZ + (p_72731_1_.posZ - p_72731_1_.lastTickPosZ) * (double)p_72731_4_; + drawOutlinedBoundingBox(block.getSelectedBoundingBoxFromPool(this.theWorld, p_72731_2_.blockX, p_72731_2_.blockY, p_72731_2_.blockZ).expand((double)f1, (double)f1, (double)f1).getOffsetBoundingBox(-d0, -d1, -d2), -1); + } + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + } + } + + /** + * Draws lines for the edges of the bounding box. + */ + public static void drawOutlinedBoundingBox(AxisAlignedBB p_147590_0_, int p_147590_1_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(3); + + if (p_147590_1_ != -1) + { + tessellator.setColorOpaque_I(p_147590_1_); + } + + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + tessellator.draw(); + tessellator.startDrawing(3); + + if (p_147590_1_ != -1) + { + tessellator.setColorOpaque_I(p_147590_1_); + } + + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + tessellator.draw(); + tessellator.startDrawing(1); + + if (p_147590_1_ != -1) + { + tessellator.setColorOpaque_I(p_147590_1_); + } + + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.minZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.minY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.maxX, p_147590_0_.maxY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.minY, p_147590_0_.maxZ); + tessellator.addVertex(p_147590_0_.minX, p_147590_0_.maxY, p_147590_0_.maxZ); + tessellator.draw(); + } + + /** + * Marks the blocks in the given range for update + */ + public void markBlocksForUpdate(int p_72725_1_, int p_72725_2_, int p_72725_3_, int p_72725_4_, int p_72725_5_, int p_72725_6_) + { + int k1 = MathHelper.bucketInt(p_72725_1_, 16); + int l1 = MathHelper.bucketInt(p_72725_2_, 16); + int i2 = MathHelper.bucketInt(p_72725_3_, 16); + int j2 = MathHelper.bucketInt(p_72725_4_, 16); + int k2 = MathHelper.bucketInt(p_72725_5_, 16); + int l2 = MathHelper.bucketInt(p_72725_6_, 16); + + for (int i3 = k1; i3 <= j2; ++i3) + { + int j3 = i3 % this.renderChunksWide; + + if (j3 < 0) + { + j3 += this.renderChunksWide; + } + + for (int k3 = l1; k3 <= k2; ++k3) + { + int l3 = k3 % this.renderChunksTall; + + if (l3 < 0) + { + l3 += this.renderChunksTall; + } + + for (int i4 = i2; i4 <= l2; ++i4) + { + int j4 = i4 % this.renderChunksDeep; + + if (j4 < 0) + { + j4 += this.renderChunksDeep; + } + + int k4 = (j4 * this.renderChunksTall + l3) * this.renderChunksWide + j3; + WorldRenderer worldrenderer = this.worldRenderers[k4]; + + if (worldrenderer != null && !worldrenderer.needsUpdate) + { + this.worldRenderersToUpdate.add(worldrenderer); + worldrenderer.markDirty(); + } + } + } + } + } + + /** + * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + public void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_) + { + this.markBlocksForUpdate(p_147586_1_ - 1, p_147586_2_ - 1, p_147586_3_ - 1, p_147586_1_ + 1, p_147586_2_ + 1, p_147586_3_ + 1); + } + + /** + * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + public void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_) + { + this.markBlocksForUpdate(p_147588_1_ - 1, p_147588_2_ - 1, p_147588_3_ - 1, p_147588_1_ + 1, p_147588_2_ + 1, p_147588_3_ + 1); + } + + /** + * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + public void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) + { + this.markBlocksForUpdate(p_147585_1_ - 1, p_147585_2_ - 1, p_147585_3_ - 1, p_147585_4_ + 1, p_147585_5_ + 1, p_147585_6_ + 1); + } + + /** + * Checks all renderers that previously weren't in the frustum and 1/16th of those that previously were in the + * frustum for frustum clipping Args: frustum, partialTickTime + */ + public void clipRenderersByFrustum(ICamera p_72729_1_, float p_72729_2_) + { + for (int i = 0; i < this.worldRenderers.length; ++i) + { + if (!this.worldRenderers[i].skipAllRenderPasses() && (!this.worldRenderers[i].isInFrustum || (i + this.frustumCheckOffset & 15) == 0)) + { + this.worldRenderers[i].updateInFrustum(p_72729_1_); + } + } + + ++this.frustumCheckOffset; + } + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + public void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_) + { + ChunkCoordinates chunkcoordinates = new ChunkCoordinates(p_72702_2_, p_72702_3_, p_72702_4_); + ISound isound = (ISound)this.mapSoundPositions.get(chunkcoordinates); + + if (isound != null) + { + this.mc.getSoundHandler().stopSound(isound); + this.mapSoundPositions.remove(chunkcoordinates); + } + + if (p_72702_1_ != null) + { + ItemRecord itemrecord = ItemRecord.getRecord(p_72702_1_); + + ResourceLocation resource = null; + if (itemrecord != null) + { + this.mc.ingameGUI.setRecordPlayingMessage(itemrecord.getRecordNameLocal()); + resource = itemrecord.getRecordResource(p_72702_1_); + } + + if (resource == null) resource = new ResourceLocation(p_72702_1_); + PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_); + this.mapSoundPositions.put(chunkcoordinates, positionedsoundrecord); + this.mc.getSoundHandler().playSound(positionedsoundrecord); + } + } + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + public void playSound(String soundName, double x, double y, double z, float volume, float pitch) {} + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_) {} + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String p_72708_1_, final double p_72708_2_, final double p_72708_4_, final double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_) + { + try + { + this.doSpawnParticle(p_72708_1_, p_72708_2_, p_72708_4_, p_72708_6_, p_72708_8_, p_72708_10_, p_72708_12_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception while adding particle"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being added"); + crashreportcategory.addCrashSection("Name", p_72708_1_); + crashreportcategory.addCrashSectionCallable("Position", new Callable() + { + private static final String __OBFID = "CL_00000955"; + public String call() + { + return CrashReportCategory.func_85074_a(p_72708_2_, p_72708_4_, p_72708_6_); + } + }); + throw new ReportedException(crashreport); + } + } + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public EntityFX doSpawnParticle(String p_72726_1_, double p_72726_2_, double p_72726_4_, double p_72726_6_, double p_72726_8_, double p_72726_10_, double p_72726_12_) + { + if (this.mc != null && this.mc.renderViewEntity != null && this.mc.effectRenderer != null) + { + int i = this.mc.gameSettings.particleSetting; + + if (i == 1 && this.theWorld.rand.nextInt(3) == 0) + { + i = 2; + } + + double d6 = this.mc.renderViewEntity.posX - p_72726_2_; + double d7 = this.mc.renderViewEntity.posY - p_72726_4_; + double d8 = this.mc.renderViewEntity.posZ - p_72726_6_; + EntityFX entityfx = null; + + if (p_72726_1_.equals("hugeexplosion")) + { + this.mc.effectRenderer.addEffect(entityfx = new EntityHugeExplodeFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_)); + } + else if (p_72726_1_.equals("largeexplode")) + { + this.mc.effectRenderer.addEffect(entityfx = new EntityLargeExplodeFX(this.renderEngine, this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_)); + } + else if (p_72726_1_.equals("fireworksSpark")) + { + this.mc.effectRenderer.addEffect(entityfx = new EntityFireworkSparkFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, this.mc.effectRenderer)); + } + + if (entityfx != null) + { + return (EntityFX)entityfx; + } + else + { + double d9 = 16.0D; + + if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9) + { + return null; + } + else if (i > 1) + { + return null; + } + else + { + if (p_72726_1_.equals("bubble")) + { + entityfx = new EntityBubbleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("suspended")) + { + entityfx = new EntitySuspendFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("depthsuspend")) + { + entityfx = new EntityAuraFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("townaura")) + { + entityfx = new EntityAuraFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("crit")) + { + entityfx = new EntityCritFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("magicCrit")) + { + entityfx = new EntityCritFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + ((EntityFX)entityfx).setRBGColorF(((EntityFX)entityfx).getRedColorF() * 0.3F, ((EntityFX)entityfx).getGreenColorF() * 0.8F, ((EntityFX)entityfx).getBlueColorF()); + ((EntityFX)entityfx).nextTextureIndexX(); + } + else if (p_72726_1_.equals("smoke")) + { + entityfx = new EntitySmokeFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("mobSpell")) + { + entityfx = new EntitySpellParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, 0.0D, 0.0D, 0.0D); + ((EntityFX)entityfx).setRBGColorF((float)p_72726_8_, (float)p_72726_10_, (float)p_72726_12_); + } + else if (p_72726_1_.equals("mobSpellAmbient")) + { + entityfx = new EntitySpellParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, 0.0D, 0.0D, 0.0D); + ((EntityFX)entityfx).setAlphaF(0.15F); + ((EntityFX)entityfx).setRBGColorF((float)p_72726_8_, (float)p_72726_10_, (float)p_72726_12_); + } + else if (p_72726_1_.equals("spell")) + { + entityfx = new EntitySpellParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("instantSpell")) + { + entityfx = new EntitySpellParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + } + else if (p_72726_1_.equals("witchMagic")) + { + entityfx = new EntitySpellParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + float f = this.theWorld.rand.nextFloat() * 0.5F + 0.35F; + ((EntityFX)entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); + } + else if (p_72726_1_.equals("note")) + { + entityfx = new EntityNoteFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("portal")) + { + entityfx = new EntityPortalFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("enchantmenttable")) + { + entityfx = new EntityEnchantmentTableParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("explode")) + { + entityfx = new EntityExplodeFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("flame")) + { + entityfx = new EntityFlameFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("lava")) + { + entityfx = new EntityLavaFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_); + } + else if (p_72726_1_.equals("footstep")) + { + entityfx = new EntityFootStepFX(this.renderEngine, this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_); + } + else if (p_72726_1_.equals("splash")) + { + entityfx = new EntitySplashFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("wake")) + { + entityfx = new EntityFishWakeFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("largesmoke")) + { + entityfx = new EntitySmokeFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, 2.5F); + } + else if (p_72726_1_.equals("cloud")) + { + entityfx = new EntityCloudFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("reddust")) + { + entityfx = new EntityReddustFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, (float)p_72726_8_, (float)p_72726_10_, (float)p_72726_12_); + } + else if (p_72726_1_.equals("snowballpoof")) + { + entityfx = new EntityBreakingFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, Items.snowball); + } + else if (p_72726_1_.equals("dripWater")) + { + entityfx = new EntityDropParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, Material.water); + } + else if (p_72726_1_.equals("dripLava")) + { + entityfx = new EntityDropParticleFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, Material.lava); + } + else if (p_72726_1_.equals("snowshovel")) + { + entityfx = new EntitySnowShovelFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("slime")) + { + entityfx = new EntityBreakingFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, Items.slime_ball); + } + else if (p_72726_1_.equals("heart")) + { + entityfx = new EntityHeartFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + } + else if (p_72726_1_.equals("angryVillager")) + { + entityfx = new EntityHeartFX(this.theWorld, p_72726_2_, p_72726_4_ + 0.5D, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + ((EntityFX)entityfx).setParticleTextureIndex(81); + ((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + } + else if (p_72726_1_.equals("happyVillager")) + { + entityfx = new EntityAuraFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_); + ((EntityFX)entityfx).setParticleTextureIndex(82); + ((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + } + else + { + int k; + String[] astring; + + if (p_72726_1_.startsWith("iconcrack_")) + { + astring = p_72726_1_.split("_", 3); + int j = Integer.parseInt(astring[1]); + + if (astring.length > 2) + { + k = Integer.parseInt(astring[2]); + entityfx = new EntityBreakingFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, Item.getItemById(j), k); + } + else + { + entityfx = new EntityBreakingFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, Item.getItemById(j), 0); + } + } + else + { + Block block; + + if (p_72726_1_.startsWith("blockcrack_")) + { + astring = p_72726_1_.split("_", 3); + block = Block.getBlockById(Integer.parseInt(astring[1])); + k = Integer.parseInt(astring[2]); + entityfx = (new EntityDiggingFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, block, k)).applyRenderColor(k); + } + else if (p_72726_1_.startsWith("blockdust_")) + { + astring = p_72726_1_.split("_", 3); + block = Block.getBlockById(Integer.parseInt(astring[1])); + k = Integer.parseInt(astring[2]); + entityfx = (new EntityBlockDustFX(this.theWorld, p_72726_2_, p_72726_4_, p_72726_6_, p_72726_8_, p_72726_10_, p_72726_12_, block, k)).applyRenderColor(k); + } + } + } + + if (entityfx != null) + { + this.mc.effectRenderer.addEffect((EntityFX)entityfx); + } + + return (EntityFX)entityfx; + } + } + } + else + { + return null; + } + } + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + public void onEntityCreate(Entity p_72703_1_) {} + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + public void onEntityDestroy(Entity p_72709_1_) {} + + /** + * Deletes all display lists + */ + public void deleteAllDisplayLists() + { + GLAllocation.deleteDisplayLists(this.glRenderListBase); + } + + public void broadcastSound(int p_82746_1_, int p_82746_2_, int p_82746_3_, int p_82746_4_, int p_82746_5_) + { + Random random = this.theWorld.rand; + + switch (p_82746_1_) + { + case 1013: + case 1018: + if (this.mc.renderViewEntity != null) + { + double d0 = (double)p_82746_2_ - this.mc.renderViewEntity.posX; + double d1 = (double)p_82746_3_ - this.mc.renderViewEntity.posY; + double d2 = (double)p_82746_4_ - this.mc.renderViewEntity.posZ; + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + double d4 = this.mc.renderViewEntity.posX; + double d5 = this.mc.renderViewEntity.posY; + double d6 = this.mc.renderViewEntity.posZ; + + if (d3 > 0.0D) + { + d4 += d0 / d3 * 2.0D; + d5 += d1 / d3 * 2.0D; + d6 += d2 / d3 * 2.0D; + } + + if (p_82746_1_ == 1013) + { + this.theWorld.playSound(d4, d5, d6, "mob.wither.spawn", 1.0F, 1.0F, false); + } + else if (p_82746_1_ == 1018) + { + this.theWorld.playSound(d4, d5, d6, "mob.enderdragon.end", 5.0F, 1.0F, false); + } + } + default: + } + } + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + public void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_) + { + Random random = this.theWorld.rand; + Block block = null; + double d0; + double d1; + double d2; + String s; + int k1; + double d4; + double d5; + double d6; + double d7; + int l2; + double d13; + + switch (p_72706_2_) + { + case 1000: + this.theWorld.playSound((double)p_72706_3_, (double)p_72706_4_, (double)p_72706_5_, "random.click", 1.0F, 1.0F, false); + break; + case 1001: + this.theWorld.playSound((double)p_72706_3_, (double)p_72706_4_, (double)p_72706_5_, "random.click", 1.0F, 1.2F, false); + break; + case 1002: + this.theWorld.playSound((double)p_72706_3_, (double)p_72706_4_, (double)p_72706_5_, "random.bow", 1.0F, 1.2F, false); + break; + case 1003: + if (Math.random() < 0.5D) + { + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "random.door_open", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + } + else + { + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "random.door_close", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + } + + break; + case 1004: + this.theWorld.playSound((double)((float)p_72706_3_ + 0.5F), (double)((float)p_72706_4_ + 0.5F), (double)((float)p_72706_5_ + 0.5F), "random.fizz", 0.5F, 2.6F + (random.nextFloat() - random.nextFloat()) * 0.8F, false); + break; + case 1005: + if (Item.getItemById(p_72706_6_) instanceof ItemRecord) + { + this.theWorld.playRecord("records." + ((ItemRecord)Item.getItemById(p_72706_6_)).recordName, p_72706_3_, p_72706_4_, p_72706_5_); + } + else + { + this.theWorld.playRecord((String)null, p_72706_3_, p_72706_4_, p_72706_5_); + } + + break; + case 1007: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.ghast.charge", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1008: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.ghast.fireball", 10.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1009: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.ghast.fireball", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1010: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.zombie.wood", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1011: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.zombie.metal", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1012: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.zombie.woodbreak", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1014: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.wither.shoot", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1015: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.bat.takeoff", 0.05F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1016: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.zombie.infect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1017: + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "mob.zombie.unfect", 2.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F, false); + break; + case 1020: + this.theWorld.playSound((double)((float)p_72706_3_ + 0.5F), (double)((float)p_72706_4_ + 0.5F), (double)((float)p_72706_5_ + 0.5F), "random.anvil_break", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1021: + this.theWorld.playSound((double)((float)p_72706_3_ + 0.5F), (double)((float)p_72706_4_ + 0.5F), (double)((float)p_72706_5_ + 0.5F), "random.anvil_use", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 1022: + this.theWorld.playSound((double)((float)p_72706_3_ + 0.5F), (double)((float)p_72706_4_ + 0.5F), (double)((float)p_72706_5_ + 0.5F), "random.anvil_land", 0.3F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 2000: + int j2 = p_72706_6_ % 3 - 1; + int j1 = p_72706_6_ / 3 % 3 - 1; + d1 = (double)p_72706_3_ + (double)j2 * 0.6D + 0.5D; + d2 = (double)p_72706_4_ + 0.5D; + double d9 = (double)p_72706_5_ + (double)j1 * 0.6D + 0.5D; + + for (int k2 = 0; k2 < 10; ++k2) + { + double d11 = random.nextDouble() * 0.2D + 0.01D; + double d12 = d1 + (double)j2 * 0.01D + (random.nextDouble() - 0.5D) * (double)j1 * 0.5D; + d4 = d2 + (random.nextDouble() - 0.5D) * 0.5D; + d13 = d9 + (double)j1 * 0.01D + (random.nextDouble() - 0.5D) * (double)j2 * 0.5D; + d5 = (double)j2 * d11 + random.nextGaussian() * 0.01D; + d6 = -0.03D + random.nextGaussian() * 0.01D; + d7 = (double)j1 * d11 + random.nextGaussian() * 0.01D; + this.spawnParticle("smoke", d12, d4, d13, d5, d6, d7); + } + + return; + case 2001: + block = Block.getBlockById(p_72706_6_ & 4095); + + if (block.getMaterial() != Material.air) + { + this.mc.getSoundHandler().playSound(new PositionedSoundRecord(new ResourceLocation(block.stepSound.getBreakSound()), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F, (float)p_72706_3_ + 0.5F, (float)p_72706_4_ + 0.5F, (float)p_72706_5_ + 0.5F)); + } + + this.mc.effectRenderer.addBlockDestroyEffects(p_72706_3_, p_72706_4_, p_72706_5_, block, p_72706_6_ >> 12 & 255); + break; + case 2002: + d0 = (double)p_72706_3_; + d1 = (double)p_72706_4_; + d2 = (double)p_72706_5_; + s = "iconcrack_" + Item.getIdFromItem(Items.potionitem) + "_" + p_72706_6_; + + for (k1 = 0; k1 < 8; ++k1) + { + this.spawnParticle(s, d0, d1, d2, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D); + } + + k1 = Items.potionitem.getColorFromDamage(p_72706_6_); + float f = (float)(k1 >> 16 & 255) / 255.0F; + float f1 = (float)(k1 >> 8 & 255) / 255.0F; + float f2 = (float)(k1 >> 0 & 255) / 255.0F; + String s1 = "spell"; + + if (Items.potionitem.isEffectInstant(p_72706_6_)) + { + s1 = "instantSpell"; + } + + for (l2 = 0; l2 < 100; ++l2) + { + d4 = random.nextDouble() * 4.0D; + d13 = random.nextDouble() * Math.PI * 2.0D; + d5 = Math.cos(d13) * d4; + d6 = 0.01D + random.nextDouble() * 0.5D; + d7 = Math.sin(d13) * d4; + EntityFX entityfx = this.doSpawnParticle(s1, d0 + d5 * 0.1D, d1 + 0.3D, d2 + d7 * 0.1D, d5, d6, d7); + + if (entityfx != null) + { + float f4 = 0.75F + random.nextFloat() * 0.25F; + entityfx.setRBGColorF(f * f4, f1 * f4, f2 * f4); + entityfx.multiplyVelocity((float)d4); + } + } + + this.theWorld.playSound((double)p_72706_3_ + 0.5D, (double)p_72706_4_ + 0.5D, (double)p_72706_5_ + 0.5D, "game.potion.smash", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); + break; + case 2003: + d0 = (double)p_72706_3_ + 0.5D; + d1 = (double)p_72706_4_; + d2 = (double)p_72706_5_ + 0.5D; + s = "iconcrack_" + Item.getIdFromItem(Items.ender_eye); + + for (k1 = 0; k1 < 8; ++k1) + { + this.spawnParticle(s, d0, d1, d2, random.nextGaussian() * 0.15D, random.nextDouble() * 0.2D, random.nextGaussian() * 0.15D); + } + + for (double d10 = 0.0D; d10 < (Math.PI * 2D); d10 += 0.15707963267948966D) + { + this.spawnParticle("portal", d0 + Math.cos(d10) * 5.0D, d1 - 0.4D, d2 + Math.sin(d10) * 5.0D, Math.cos(d10) * -5.0D, 0.0D, Math.sin(d10) * -5.0D); + this.spawnParticle("portal", d0 + Math.cos(d10) * 5.0D, d1 - 0.4D, d2 + Math.sin(d10) * 5.0D, Math.cos(d10) * -7.0D, 0.0D, Math.sin(d10) * -7.0D); + } + + return; + case 2004: + for (l2 = 0; l2 < 20; ++l2) + { + d4 = (double)p_72706_3_ + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + d13 = (double)p_72706_4_ + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + d5 = (double)p_72706_5_ + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; + this.theWorld.spawnParticle("smoke", d4, d13, d5, 0.0D, 0.0D, 0.0D); + this.theWorld.spawnParticle("flame", d4, d13, d5, 0.0D, 0.0D, 0.0D); + } + + return; + case 2005: + ItemDye.func_150918_a(this.theWorld, p_72706_3_, p_72706_4_, p_72706_5_, p_72706_6_); + break; + case 2006: + block = this.theWorld.getBlock(p_72706_3_, p_72706_4_, p_72706_5_); + + if (block.getMaterial() != Material.air) + { + double d3 = (double)Math.min(0.2F + (float)p_72706_6_ / 15.0F, 10.0F); + + if (d3 > 2.5D) + { + d3 = 2.5D; + } + + int l1 = (int)(150.0D * d3); + + for (int i2 = 0; i2 < l1; ++i2) + { + float f3 = MathHelper.randomFloatClamp(random, 0.0F, ((float)Math.PI * 2F)); + d5 = (double)MathHelper.randomFloatClamp(random, 0.75F, 1.0F); + d6 = 0.20000000298023224D + d3 / 100.0D; + d7 = (double)(MathHelper.cos(f3) * 0.2F) * d5 * d5 * (d3 + 0.2D); + double d8 = (double)(MathHelper.sin(f3) * 0.2F) * d5 * d5 * (d3 + 0.2D); + this.theWorld.spawnParticle("blockdust_" + Block.getIdFromBlock(block) + "_" + this.theWorld.getBlockMetadata(p_72706_3_, p_72706_4_, p_72706_5_), (double)((float)p_72706_3_ + 0.5F), (double)((float)p_72706_4_ + 1.0F), (double)((float)p_72706_5_ + 0.5F), d7, d6, d8); + } + } + } + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + public void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_) + { + if (p_147587_5_ >= 0 && p_147587_5_ < 10) + { + DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)this.damagedBlocks.get(Integer.valueOf(p_147587_1_)); + + if (destroyblockprogress == null || destroyblockprogress.getPartialBlockX() != p_147587_2_ || destroyblockprogress.getPartialBlockY() != p_147587_3_ || destroyblockprogress.getPartialBlockZ() != p_147587_4_) + { + destroyblockprogress = new DestroyBlockProgress(p_147587_1_, p_147587_2_, p_147587_3_, p_147587_4_); + this.damagedBlocks.put(Integer.valueOf(p_147587_1_), destroyblockprogress); + } + + destroyblockprogress.setPartialBlockDamage(p_147587_5_); + destroyblockprogress.setCloudUpdateTick(this.cloudTickCounter); + } + else + { + this.damagedBlocks.remove(Integer.valueOf(p_147587_1_)); + } + } + + public void registerDestroyBlockIcons(IIconRegister p_94140_1_) + { + this.destroyBlockIcons = new IIcon[10]; + + for (int i = 0; i < this.destroyBlockIcons.length; ++i) + { + this.destroyBlockIcons[i] = p_94140_1_.registerIcon("destroy_stage_" + i); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderHelper.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderHelper.java new file mode 100644 index 0000000..3df25b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderHelper.java @@ -0,0 +1,84 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.FloatBuffer; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderHelper +{ + /** Float buffer used to set OpenGL material colors */ + private static FloatBuffer colorBuffer = GLAllocation.createDirectFloatBuffer(16); + private static final Vec3 field_82884_b = Vec3.createVectorHelper(0.20000000298023224D, 1.0D, -0.699999988079071D).normalize(); + private static final Vec3 field_82885_c = Vec3.createVectorHelper(-0.20000000298023224D, 1.0D, 0.699999988079071D).normalize(); + private static final String __OBFID = "CL_00000629"; + + /** + * Disables the OpenGL lighting properties enabled by enableStandardItemLighting + */ + public static void disableStandardItemLighting() + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_LIGHT0); + GL11.glDisable(GL11.GL_LIGHT1); + GL11.glDisable(GL11.GL_COLOR_MATERIAL); + } + + /** + * Sets the OpenGL lighting properties to the values used when rendering blocks as items + */ + public static void enableStandardItemLighting() + { + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_LIGHT1); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE); + float f = 0.4F; + float f1 = 0.6F; + float f2 = 0.0F; + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer(field_82884_b.xCoord, field_82884_b.yCoord, field_82884_b.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION, setColorBuffer(field_82885_c.xCoord, field_82885_c.yCoord, field_82885_c.zCoord, 0.0D)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, setColorBuffer(f1, f1, f1, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glLight(GL11.GL_LIGHT1, GL11.GL_SPECULAR, setColorBuffer(f2, f2, f2, 1.0F)); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(f, f, f, 1.0F)); + } + + /** + * Update and return colorBuffer with the RGBA values passed as arguments + */ + private static FloatBuffer setColorBuffer(double p_74517_0_, double p_74517_2_, double p_74517_4_, double p_74517_6_) + { + return setColorBuffer((float)p_74517_0_, (float)p_74517_2_, (float)p_74517_4_, (float)p_74517_6_); + } + + /** + * Update and return colorBuffer with the RGBA values passed as arguments + */ + private static FloatBuffer setColorBuffer(float p_74521_0_, float p_74521_1_, float p_74521_2_, float p_74521_3_) + { + colorBuffer.clear(); + colorBuffer.put(p_74521_0_).put(p_74521_1_).put(p_74521_2_).put(p_74521_3_); + colorBuffer.flip(); + return colorBuffer; + } + + /** + * Sets OpenGL lighting for rendering blocks as items inside GUI screens (such as containers). + */ + public static void enableGUIStandardItemLighting() + { + GL11.glPushMatrix(); + GL11.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(165.0F, 1.0F, 0.0F, 0.0F); + enableStandardItemLighting(); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderList.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderList.java new file mode 100644 index 0000000..84fc1ca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderList.java @@ -0,0 +1,82 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.IntBuffer; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderList +{ + /** The location of the 16x16x16 render chunk rendered by this RenderList. */ + public int renderChunkX; + public int renderChunkY; + public int renderChunkZ; + /** The in-world location of the camera, used to translate the world into the proper position for rendering. */ + private double cameraX; + private double cameraY; + private double cameraZ; + /** A list of OpenGL render list IDs rendered by this RenderList. */ + private IntBuffer glLists = GLAllocation.createDirectIntBuffer(65536); + /** Does this RenderList contain properly-initialized and current data for rendering? */ + private boolean valid; + /** Has glLists been flipped to make it ready for reading yet? */ + private boolean bufferFlipped; + private static final String __OBFID = "CL_00000957"; + + public void setupRenderList(int p_78422_1_, int p_78422_2_, int p_78422_3_, double p_78422_4_, double p_78422_6_, double p_78422_8_) + { + this.valid = true; + this.glLists.clear(); + this.renderChunkX = p_78422_1_; + this.renderChunkY = p_78422_2_; + this.renderChunkZ = p_78422_3_; + this.cameraX = p_78422_4_; + this.cameraY = p_78422_6_; + this.cameraZ = p_78422_8_; + } + + public boolean rendersChunk(int p_78418_1_, int p_78418_2_, int p_78418_3_) + { + return !this.valid ? false : p_78418_1_ == this.renderChunkX && p_78418_2_ == this.renderChunkY && p_78418_3_ == this.renderChunkZ; + } + + public void addGLRenderList(int p_78420_1_) + { + this.glLists.put(p_78420_1_); + + if (this.glLists.remaining() == 0) + { + this.callLists(); + } + } + + public void callLists() + { + if (this.valid) + { + if (!this.bufferFlipped) + { + this.glLists.flip(); + this.bufferFlipped = true; + } + + if (this.glLists.remaining() > 0) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)((double)this.renderChunkX - this.cameraX), (float)((double)this.renderChunkY - this.cameraY), (float)((double)this.renderChunkZ - this.cameraZ)); + GL11.glCallLists(this.glLists); + GL11.glPopMatrix(); + } + } + } + + /** + * Resets this RenderList to an uninitialized state. + */ + public void resetList() + { + this.valid = false; + this.bufferFlipped = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderSorter.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderSorter.java new file mode 100644 index 0000000..9540d48 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/RenderSorter.java @@ -0,0 +1,42 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Comparator; +import net.minecraft.entity.EntityLivingBase; + +@SideOnly(Side.CLIENT) +public class RenderSorter implements Comparator +{ + /** The entity (usually the player) that the camera is inside. */ + private EntityLivingBase baseEntity; + private static final String __OBFID = "CL_00000943"; + + public RenderSorter(EntityLivingBase p_i1241_1_) + { + this.baseEntity = p_i1241_1_; + } + + public int compare(WorldRenderer p_compare_1_, WorldRenderer p_compare_2_) + { + if (p_compare_1_.isInFrustum && !p_compare_2_.isInFrustum) + { + return 1; + } + else if (p_compare_2_.isInFrustum && !p_compare_1_.isInFrustum) + { + return -1; + } + else + { + double d0 = (double)p_compare_1_.distanceToEntitySquared(this.baseEntity); + double d1 = (double)p_compare_2_.distanceToEntitySquared(this.baseEntity); + return d0 < d1 ? 1 : (d0 > d1 ? -1 : (p_compare_1_.chunkIndex < p_compare_2_.chunkIndex ? 1 : -1)); + } + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((WorldRenderer)p_compare_1_, (WorldRenderer)p_compare_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/StitcherException.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/StitcherException.java new file mode 100644 index 0000000..cbbbad0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/StitcherException.java @@ -0,0 +1,18 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.Stitcher; + +@SideOnly(Side.CLIENT) +public class StitcherException extends RuntimeException +{ + private final Stitcher.Holder field_98149_a; + private static final String __OBFID = "CL_00001057"; + + public StitcherException(Stitcher.Holder p_i2344_1_, String p_i2344_2_) + { + super(p_i2344_2_); + this.field_98149_a = p_i2344_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/Tessellator.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/Tessellator.java new file mode 100644 index 0000000..1e34435 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/Tessellator.java @@ -0,0 +1,496 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; +import java.util.Arrays; +import java.util.PriorityQueue; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.client.util.QuadComparator; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class Tessellator +{ + private static int nativeBufferSize = 0x200000; + private static int trivertsInBuffer = (nativeBufferSize / 48) * 6; + public static boolean renderingWorldRenderer = false; + public boolean defaultTexture = false; + private int rawBufferSize = 0; + public int textureID = 0; + + /** The byte buffer used for GL allocation. */ + private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); + /** The same memory as byteBuffer, but referenced as an integer buffer. */ + private static IntBuffer intBuffer = byteBuffer.asIntBuffer(); + /** The same memory as byteBuffer, but referenced as an float buffer. */ + private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); + /** The same memory as byteBuffer, but referenced as an short buffer. */ + private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); + /** Raw integer array. */ + private int[] rawBuffer; + /** The number of vertices to be drawn in the next draw call. Reset to 0 between draw calls. */ + private int vertexCount; + /** The first coordinate to be used for the texture. */ + private double textureU; + /** The second coordinate to be used for the texture. */ + private double textureV; + private int brightness; + /** The color (RGBA) value to be used for the following draw call. */ + private int color; + /** Whether the current draw object for this tessellator has color values. */ + private boolean hasColor; + /** Whether the current draw object for this tessellator has texture coordinates. */ + private boolean hasTexture; + private boolean hasBrightness; + /** Whether the current draw object for this tessellator has normal values. */ + private boolean hasNormals; + /** The index into the raw buffer to be used for the next data. */ + private int rawBufferIndex; + /** + * The number of vertices manually added to the given draw call. This differs from vertexCount because it adds extra + * vertices when converting quads to triangles. + */ + private int addedVertices; + /** Disables all color information for the following draw call. */ + private boolean isColorDisabled; + /** The draw mode currently being used by the tessellator. */ + private int drawMode; + /** An offset to be applied along the x-axis for all vertices in this draw call. */ + private double xOffset; + /** An offset to be applied along the y-axis for all vertices in this draw call. */ + private double yOffset; + /** An offset to be applied along the z-axis for all vertices in this draw call. */ + private double zOffset; + /** The normal to be applied to the face being drawn. */ + private int normal; + /** The static instance of the Tessellator. */ + public static final Tessellator instance = new Tessellator(2097152); + /** Whether this tessellator is currently in draw mode. */ + private boolean isDrawing; + /** The size of the buffers used (in integers). */ + private int bufferSize; + private static final String __OBFID = "CL_00000960"; + + private Tessellator(int p_i1250_1_) + { + } + + public Tessellator() + { + } + + static + { + instance.defaultTexture = true; + } + + /** + * Draws the data set up in this tessellator and resets the state to prepare for new drawing. + */ + public int draw() + { + if (!this.isDrawing) + { + throw new IllegalStateException("Not tesselating!"); + } + else + { + this.isDrawing = false; + + int offs = 0; + while (offs < vertexCount) + { + int vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5); + this.intBuffer.clear(); + this.intBuffer.put(this.rawBuffer, offs * 8, vtc * 8); + this.byteBuffer.position(0); + this.byteBuffer.limit(vtc * 32); + offs += vtc; + + if (this.hasTexture) + { + this.floatBuffer.position(3); + GL11.glTexCoordPointer(2, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) + { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + this.shortBuffer.position(14); + GL11.glTexCoordPointer(2, 32, this.shortBuffer); + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) + { + this.byteBuffer.position(20); + GL11.glColorPointer(4, true, 32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) + { + this.byteBuffer.position(24); + GL11.glNormalPointer(32, this.byteBuffer); + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + + this.floatBuffer.position(0); + GL11.glVertexPointer(3, 32, this.floatBuffer); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + GL11.glDrawArrays(this.drawMode, 0, vtc); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.hasTexture) + { + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) + { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) + { + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) + { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + } + + if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) + { + rawBufferSize = 0x10000; + rawBuffer = new int[rawBufferSize]; + } + + int i = this.rawBufferIndex * 4; + this.reset(); + return i; + } + } + + public TesselatorVertexState getVertexState(float p_147564_1_, float p_147564_2_, float p_147564_3_) + { + int[] aint = new int[this.rawBufferIndex]; + PriorityQueue priorityqueue = new PriorityQueue(this.rawBufferIndex, new QuadComparator(this.rawBuffer, p_147564_1_ + (float)this.xOffset, p_147564_2_ + (float)this.yOffset, p_147564_3_ + (float)this.zOffset)); + byte b0 = 32; + int i; + + for (i = 0; i < this.rawBufferIndex; i += b0) + { + priorityqueue.add(Integer.valueOf(i)); + } + + for (i = 0; !priorityqueue.isEmpty(); i += b0) + { + int j = ((Integer)priorityqueue.remove()).intValue(); + + for (int k = 0; k < b0; ++k) + { + aint[i + k] = this.rawBuffer[j + k]; + } + } + + System.arraycopy(aint, 0, this.rawBuffer, 0, aint.length); + return new TesselatorVertexState(aint, this.rawBufferIndex, this.vertexCount, this.hasTexture, this.hasBrightness, this.hasNormals, this.hasColor); + } + + public void setVertexState(TesselatorVertexState p_147565_1_) + { + while (p_147565_1_.getRawBuffer().length > rawBufferSize && rawBufferSize > 0) + { + rawBufferSize <<= 1; + } + if (rawBufferSize > rawBuffer.length) + { + rawBuffer = new int[rawBufferSize]; + } + System.arraycopy(p_147565_1_.getRawBuffer(), 0, this.rawBuffer, 0, p_147565_1_.getRawBuffer().length); + this.rawBufferIndex = p_147565_1_.getRawBufferIndex(); + this.vertexCount = p_147565_1_.getVertexCount(); + this.hasTexture = p_147565_1_.getHasTexture(); + this.hasBrightness = p_147565_1_.getHasBrightness(); + this.hasColor = p_147565_1_.getHasColor(); + this.hasNormals = p_147565_1_.getHasNormals(); + } + + /** + * Clears the tessellator state in preparation for new drawing. + */ + private void reset() + { + this.vertexCount = 0; + this.byteBuffer.clear(); + this.rawBufferIndex = 0; + this.addedVertices = 0; + } + + /** + * Sets draw mode in the tessellator to draw quads. + */ + public void startDrawingQuads() + { + this.startDrawing(7); + } + + /** + * Resets tessellator state and prepares for drawing (with the specified draw mode). + */ + public void startDrawing(int p_78371_1_) + { + if (this.isDrawing) + { + throw new IllegalStateException("Already tesselating!"); + } + else + { + this.isDrawing = true; + this.reset(); + this.drawMode = p_78371_1_; + this.hasNormals = false; + this.hasColor = false; + this.hasTexture = false; + this.hasBrightness = false; + this.isColorDisabled = false; + } + } + + /** + * Sets the texture coordinates. + */ + public void setTextureUV(double p_78385_1_, double p_78385_3_) + { + this.hasTexture = true; + this.textureU = p_78385_1_; + this.textureV = p_78385_3_; + } + + public void setBrightness(int p_78380_1_) + { + this.hasBrightness = true; + this.brightness = p_78380_1_; + } + + /** + * Sets the RGB values as specified, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorOpaque_F(float p_78386_1_, float p_78386_2_, float p_78386_3_) + { + this.setColorOpaque((int)(p_78386_1_ * 255.0F), (int)(p_78386_2_ * 255.0F), (int)(p_78386_3_ * 255.0F)); + } + + /** + * Sets the RGBA values for the color, converting from floats between 0 and 1 to integers from 0-255. + */ + public void setColorRGBA_F(float p_78369_1_, float p_78369_2_, float p_78369_3_, float p_78369_4_) + { + this.setColorRGBA((int)(p_78369_1_ * 255.0F), (int)(p_78369_2_ * 255.0F), (int)(p_78369_3_ * 255.0F), (int)(p_78369_4_ * 255.0F)); + } + + /** + * Sets the RGB values as specified, and sets alpha to opaque. + */ + public void setColorOpaque(int p_78376_1_, int p_78376_2_, int p_78376_3_) + { + this.setColorRGBA(p_78376_1_, p_78376_2_, p_78376_3_, 255); + } + + /** + * Sets the RGBA values for the color. Also clamps them to 0-255. + */ + public void setColorRGBA(int red, int green, int blue, int alpha) + { + if (!this.isColorDisabled) + { + if (red > 255) + { + red = 255; + } + + if (green > 255) + { + green = 255; + } + + if (blue > 255) + { + blue = 255; + } + + if (alpha > 255) + { + alpha = 255; + } + + if (red < 0) + { + red = 0; + } + + if (green < 0) + { + green = 0; + } + + if (blue < 0) + { + blue = 0; + } + + if (alpha < 0) + { + alpha = 0; + } + + this.hasColor = true; + + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + this.color = alpha << 24 | blue << 16 | green << 8 | red; + } + else + { + this.color = red << 24 | green << 16 | blue << 8 | alpha; + } + } + } + + public void func_154352_a(byte p_154352_1_, byte p_154352_2_, byte p_154352_3_) + { + this.setColorOpaque(p_154352_1_ & 255, p_154352_2_ & 255, p_154352_3_ & 255); + } + + /** + * Adds a vertex specifying both x,y,z and the texture u,v for it. + */ + public void addVertexWithUV(double p_78374_1_, double p_78374_3_, double p_78374_5_, double p_78374_7_, double p_78374_9_) + { + this.setTextureUV(p_78374_7_, p_78374_9_); + this.addVertex(p_78374_1_, p_78374_3_, p_78374_5_); + } + + /** + * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if the buffer gets + * full. + */ + public void addVertex(double p_78377_1_, double p_78377_3_, double p_78377_5_) + { + if (rawBufferIndex >= rawBufferSize - 32) + { + if (rawBufferSize == 0) + { + rawBufferSize = 0x10000; + rawBuffer = new int[rawBufferSize]; + } + else + { + rawBufferSize *= 2; + rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize); + } + } + ++this.addedVertices; + + if (this.hasTexture) + { + this.rawBuffer[this.rawBufferIndex + 3] = Float.floatToRawIntBits((float)this.textureU); + this.rawBuffer[this.rawBufferIndex + 4] = Float.floatToRawIntBits((float)this.textureV); + } + + if (this.hasBrightness) + { + this.rawBuffer[this.rawBufferIndex + 7] = this.brightness; + } + + if (this.hasColor) + { + this.rawBuffer[this.rawBufferIndex + 5] = this.color; + } + + if (this.hasNormals) + { + this.rawBuffer[this.rawBufferIndex + 6] = this.normal; + } + + this.rawBuffer[this.rawBufferIndex + 0] = Float.floatToRawIntBits((float)(p_78377_1_ + this.xOffset)); + this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float)(p_78377_3_ + this.yOffset)); + this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.zOffset)); + this.rawBufferIndex += 8; + ++this.vertexCount; + } + + /** + * Sets the color to the given opaque value (stored as byte values packed in an integer). + */ + public void setColorOpaque_I(int p_78378_1_) + { + int j = p_78378_1_ >> 16 & 255; + int k = p_78378_1_ >> 8 & 255; + int l = p_78378_1_ & 255; + this.setColorOpaque(j, k, l); + } + + /** + * Sets the color to the given color (packed as bytes in integer) and alpha values. + */ + public void setColorRGBA_I(int p_78384_1_, int p_78384_2_) + { + int k = p_78384_1_ >> 16 & 255; + int l = p_78384_1_ >> 8 & 255; + int i1 = p_78384_1_ & 255; + this.setColorRGBA(k, l, i1, p_78384_2_); + } + + /** + * Disables colors for the current draw call. + */ + public void disableColor() + { + this.isColorDisabled = true; + } + + /** + * Sets the normal for the current draw call. + */ + public void setNormal(float p_78375_1_, float p_78375_2_, float p_78375_3_) + { + this.hasNormals = true; + byte b0 = (byte)((int)(p_78375_1_ * 127.0F)); + byte b1 = (byte)((int)(p_78375_2_ * 127.0F)); + byte b2 = (byte)((int)(p_78375_3_ * 127.0F)); + this.normal = b0 & 255 | (b1 & 255) << 8 | (b2 & 255) << 16; + } + + /** + * Sets the translation for all vertices in the current draw call. + */ + public void setTranslation(double p_78373_1_, double p_78373_3_, double p_78373_5_) + { + this.xOffset = p_78373_1_; + this.yOffset = p_78373_3_; + this.zOffset = p_78373_5_; + } + + /** + * Offsets the translation for all vertices in the current draw call. + */ + public void addTranslation(float p_78372_1_, float p_78372_2_, float p_78372_3_) + { + this.xOffset += (double)p_78372_1_; + this.yOffset += (double)p_78372_2_; + this.zOffset += (double)p_78372_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ThreadDownloadImageData.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ThreadDownloadImageData.java new file mode 100644 index 0000000..82d3293 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/ThreadDownloadImageData.java @@ -0,0 +1,167 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.concurrent.atomic.AtomicInteger; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ThreadDownloadImageData extends SimpleTexture +{ + private static final Logger logger = LogManager.getLogger(); + private static final AtomicInteger threadDownloadCounter = new AtomicInteger(0); + private final File field_152434_e; + private final String imageUrl; + private final IImageBuffer imageBuffer; + private BufferedImage bufferedImage; + private Thread imageThread; + private boolean textureUploaded; + private static final String __OBFID = "CL_00001049"; + + public ThreadDownloadImageData(File p_i1049_1_, String p_i1049_2_, ResourceLocation p_i1049_3_, IImageBuffer p_i1049_4_) + { + super(p_i1049_3_); + this.field_152434_e = p_i1049_1_; + this.imageUrl = p_i1049_2_; + this.imageBuffer = p_i1049_4_; + } + + private void checkTextureUploaded() + { + if (!this.textureUploaded) + { + if (this.bufferedImage != null) + { + if (this.textureLocation != null) + { + this.deleteGlTexture(); + } + + TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage); + this.textureUploaded = true; + } + } + } + + public int getGlTextureId() + { + this.checkTextureUploaded(); + return super.getGlTextureId(); + } + + public void setBufferedImage(BufferedImage p_147641_1_) + { + this.bufferedImage = p_147641_1_; + + if (this.imageBuffer != null) + { + this.imageBuffer.func_152634_a(); + } + } + + public void loadTexture(IResourceManager p_110551_1_) throws IOException + { + if (this.bufferedImage == null && this.textureLocation != null) + { + super.loadTexture(p_110551_1_); + } + + if (this.imageThread == null) + { + if (this.field_152434_e != null && this.field_152434_e.isFile()) + { + logger.debug("Loading http texture from local cache ({})", new Object[] {this.field_152434_e}); + + try + { + this.bufferedImage = ImageIO.read(this.field_152434_e); + + if (this.imageBuffer != null) + { + this.setBufferedImage(this.imageBuffer.parseUserSkin(this.bufferedImage)); + } + } + catch (IOException ioexception) + { + logger.error("Couldn\'t load skin " + this.field_152434_e, ioexception); + this.func_152433_a(); + } + } + else + { + this.func_152433_a(); + } + } + } + + protected void func_152433_a() + { + this.imageThread = new Thread("Texture Downloader #" + threadDownloadCounter.incrementAndGet()) + { + private static final String __OBFID = "CL_00001050"; + public void run() + { + HttpURLConnection httpurlconnection = null; + ThreadDownloadImageData.logger.debug("Downloading http texture from {} to {}", new Object[] {ThreadDownloadImageData.this.imageUrl, ThreadDownloadImageData.this.field_152434_e}); + + try + { + httpurlconnection = (HttpURLConnection)(new URL(ThreadDownloadImageData.this.imageUrl)).openConnection(Minecraft.getMinecraft().getProxy()); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(false); + httpurlconnection.connect(); + + if (httpurlconnection.getResponseCode() / 100 == 2) + { + BufferedImage bufferedimage; + + if (ThreadDownloadImageData.this.field_152434_e != null) + { + FileUtils.copyInputStreamToFile(httpurlconnection.getInputStream(), ThreadDownloadImageData.this.field_152434_e); + bufferedimage = ImageIO.read(ThreadDownloadImageData.this.field_152434_e); + } + else + { + bufferedimage = ImageIO.read(httpurlconnection.getInputStream()); + } + + if (ThreadDownloadImageData.this.imageBuffer != null) + { + bufferedimage = ThreadDownloadImageData.this.imageBuffer.parseUserSkin(bufferedimage); + } + + ThreadDownloadImageData.this.setBufferedImage(bufferedimage); + return; + } + } + catch (Exception exception) + { + ThreadDownloadImageData.logger.error("Couldn\'t download http texture", exception); + return; + } + finally + { + if (httpurlconnection != null) + { + httpurlconnection.disconnect(); + } + } + } + }; + this.imageThread.setDaemon(true); + this.imageThread.start(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/WorldRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/WorldRenderer.java new file mode 100644 index 0000000..7b07039 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/WorldRenderer.java @@ -0,0 +1,363 @@ +package net.minecraft.client.renderer; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.culling.ICamera; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.client.shader.TesselatorVertexState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class WorldRenderer +{ + private TesselatorVertexState vertexState; + /** Reference to the World object. */ + public World worldObj; + private int glRenderList = -1; + //private static Tessellator tessellator = Tessellator.instance; + public static int chunksUpdated; + public int posX; + public int posY; + public int posZ; + /** Pos X minus */ + public int posXMinus; + /** Pos Y minus */ + public int posYMinus; + /** Pos Z minus */ + public int posZMinus; + /** Pos X clipped */ + public int posXClip; + /** Pos Y clipped */ + public int posYClip; + /** Pos Z clipped */ + public int posZClip; + public boolean isInFrustum; + /** Should this renderer skip this render pass */ + public boolean[] skipRenderPass = new boolean[2]; + /** Pos X plus */ + public int posXPlus; + /** Pos Y plus */ + public int posYPlus; + /** Pos Z plus */ + public int posZPlus; + /** Boolean for whether this renderer needs to be updated or not */ + public boolean needsUpdate; + /** Axis aligned bounding box */ + public AxisAlignedBB rendererBoundingBox; + /** Chunk index */ + public int chunkIndex; + /** Is this renderer visible according to the occlusion query */ + public boolean isVisible = true; + /** Is this renderer waiting on the result of the occlusion query */ + public boolean isWaitingOnOcclusionQuery; + /** OpenGL occlusion query */ + public int glOcclusionQuery; + /** Is the chunk lit */ + public boolean isChunkLit; + private boolean isInitialized; + /** All the tile entities that have special rendering code for this chunk */ + public List tileEntityRenderers = new ArrayList(); + private List tileEntities; + /** Bytes sent to the GPU */ + private int bytesDrawn; + private static final String __OBFID = "CL_00000942"; + + public WorldRenderer(World p_i1240_1_, List p_i1240_2_, int p_i1240_3_, int p_i1240_4_, int p_i1240_5_, int p_i1240_6_) + { + this.worldObj = p_i1240_1_; + this.vertexState = null; + this.tileEntities = p_i1240_2_; + this.glRenderList = p_i1240_6_; + this.posX = -999; + this.setPosition(p_i1240_3_, p_i1240_4_, p_i1240_5_); + this.needsUpdate = false; + } + + /** + * Sets a new position for the renderer and setting it up so it can be reloaded with the new data for that position + */ + public void setPosition(int p_78913_1_, int p_78913_2_, int p_78913_3_) + { + if (p_78913_1_ != this.posX || p_78913_2_ != this.posY || p_78913_3_ != this.posZ) + { + this.setDontDraw(); + this.posX = p_78913_1_; + this.posY = p_78913_2_; + this.posZ = p_78913_3_; + this.posXPlus = p_78913_1_ + 8; + this.posYPlus = p_78913_2_ + 8; + this.posZPlus = p_78913_3_ + 8; + this.posXClip = p_78913_1_ & 1023; + this.posYClip = p_78913_2_; + this.posZClip = p_78913_3_ & 1023; + this.posXMinus = p_78913_1_ - this.posXClip; + this.posYMinus = p_78913_2_ - this.posYClip; + this.posZMinus = p_78913_3_ - this.posZClip; + float f = 6.0F; + this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)p_78913_1_ - f), (double)((float)p_78913_2_ - f), (double)((float)p_78913_3_ - f), (double)((float)(p_78913_1_ + 16) + f), (double)((float)(p_78913_2_ + 16) + f), (double)((float)(p_78913_3_ + 16) + f)); + GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE); + RenderItem.renderAABB(AxisAlignedBB.getBoundingBox((double)((float)this.posXClip - f), (double)((float)this.posYClip - f), (double)((float)this.posZClip - f), (double)((float)(this.posXClip + 16) + f), (double)((float)(this.posYClip + 16) + f), (double)((float)(this.posZClip + 16) + f))); + GL11.glEndList(); + this.markDirty(); + } + } + + private void setupGLTranslation() + { + GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip); + } + + /** + * Will update this chunk renderer + */ + public void updateRenderer(EntityLivingBase p_147892_1_) + { + if (this.needsUpdate) + { + this.needsUpdate = false; + int i = this.posX; + int j = this.posY; + int k = this.posZ; + int l = this.posX + 16; + int i1 = this.posY + 16; + int j1 = this.posZ + 16; + + for (int k1 = 0; k1 < 2; ++k1) + { + this.skipRenderPass[k1] = true; + } + + Chunk.isLit = false; + HashSet hashset = new HashSet(); + hashset.addAll(this.tileEntityRenderers); + this.tileEntityRenderers.clear(); + Minecraft minecraft = Minecraft.getMinecraft(); + EntityLivingBase entitylivingbase1 = minecraft.renderViewEntity; + int l1 = MathHelper.floor_double(entitylivingbase1.posX); + int i2 = MathHelper.floor_double(entitylivingbase1.posY); + int j2 = MathHelper.floor_double(entitylivingbase1.posZ); + byte b0 = 1; + ChunkCache chunkcache = new ChunkCache(this.worldObj, i - b0, j - b0, k - b0, l + b0, i1 + b0, j1 + b0, b0); + + if (!chunkcache.extendedLevelsInChunkCache()) + { + ++chunksUpdated; + RenderBlocks renderblocks = new RenderBlocks(chunkcache); + net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(renderblocks); + this.bytesDrawn = 0; + this.vertexState = null; + + for (int k2 = 0; k2 < 2; ++k2) + { + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + + for (int l2 = j; l2 < i1; ++l2) + { + for (int i3 = k; i3 < j1; ++i3) + { + for (int j3 = i; j3 < l; ++j3) + { + Block block = chunkcache.getBlock(j3, l2, i3); + + if (block.getMaterial() != Material.air) + { + if (!flag2) + { + flag2 = true; + this.preRenderBlocks(k2); + } + + if (k2 == 0 && block.hasTileEntity(chunkcache.getBlockMetadata(j3, l2, i3))) + { + TileEntity tileentity = chunkcache.getTileEntity(j3, l2, i3); + + if (TileEntityRendererDispatcher.instance.hasSpecialRenderer(tileentity)) + { + this.tileEntityRenderers.add(tileentity); + } + } + + int k3 = block.getRenderBlockPass(); + + if (k3 > k2) + { + flag = true; + } + + if (!block.canRenderInPass(k2)) continue; + + { + flag1 |= renderblocks.renderBlockByRenderType(block, j3, l2, i3); + + if (block.getRenderType() == 0 && j3 == l1 && l2 == i2 && i3 == j2) + { + renderblocks.setRenderFromInside(true); + renderblocks.setRenderAllFaces(true); + renderblocks.renderBlockByRenderType(block, j3, l2, i3); + renderblocks.setRenderFromInside(false); + renderblocks.setRenderAllFaces(false); + } + } + } + } + } + } + + if (flag1) + { + this.skipRenderPass[k2] = false; + } + + if (flag2) + { + this.postRenderBlocks(k2, p_147892_1_); + } + else + { + flag1 = false; + } + + if (!flag) + { + break; + } + } + net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(null); + } + + HashSet hashset1 = new HashSet(); + hashset1.addAll(this.tileEntityRenderers); + hashset1.removeAll(hashset); + this.tileEntities.addAll(hashset1); + hashset.removeAll(this.tileEntityRenderers); + this.tileEntities.removeAll(hashset); + this.isChunkLit = Chunk.isLit; + this.isInitialized = true; + } + } + + private void preRenderBlocks(int p_147890_1_) + { + GL11.glNewList(this.glRenderList + p_147890_1_, GL11.GL_COMPILE); + GL11.glPushMatrix(); + this.setupGLTranslation(); + float f = 1.000001F; + GL11.glTranslatef(-8.0F, -8.0F, -8.0F); + GL11.glScalef(f, f, f); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); + net.minecraftforge.client.ForgeHooksClient.onPreRenderWorld(this, p_147890_1_); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); + } + + private void postRenderBlocks(int p_147891_1_, EntityLivingBase p_147891_2_) + { + if (p_147891_1_ == 1 && !this.skipRenderPass[p_147891_1_]) + { + this.vertexState = Tessellator.instance.getVertexState((float)p_147891_2_.posX, (float)p_147891_2_.posY, (float)p_147891_2_.posZ); + } + + this.bytesDrawn += Tessellator.instance.draw(); + net.minecraftforge.client.ForgeHooksClient.onPostRenderWorld(this, p_147891_1_); + GL11.glPopMatrix(); + GL11.glEndList(); + Tessellator.instance.setTranslation(0.0D, 0.0D, 0.0D); + } + + public void updateRendererSort(EntityLivingBase p_147889_1_) + { + if (this.vertexState != null && !this.skipRenderPass[1]) + { + this.preRenderBlocks(1); + Tessellator.instance.setVertexState(this.vertexState); + this.postRenderBlocks(1, p_147889_1_); + } + } + + /** + * Returns the distance of this chunk renderer to the entity without performing the final normalizing square root, + * for performance reasons. + */ + public float distanceToEntitySquared(Entity p_78912_1_) + { + float f = (float)(p_78912_1_.posX - (double)this.posXPlus); + float f1 = (float)(p_78912_1_.posY - (double)this.posYPlus); + float f2 = (float)(p_78912_1_.posZ - (double)this.posZPlus); + return f * f + f1 * f1 + f2 * f2; + } + + /** + * When called this renderer won't draw anymore until its gets initialized again + */ + public void setDontDraw() + { + for (int i = 0; i < 2; ++i) + { + this.skipRenderPass[i] = true; + } + + this.isInFrustum = false; + this.isInitialized = false; + this.vertexState = null; + } + + public void stopRendering() + { + this.setDontDraw(); + this.worldObj = null; + } + + /** + * Takes in the pass the call list is being requested for. Args: renderPass + */ + public int getGLCallListForPass(int p_78909_1_) + { + return !this.isInFrustum ? -1 : (!this.skipRenderPass[p_78909_1_] ? this.glRenderList + p_78909_1_ : -1); + } + + public void updateInFrustum(ICamera p_78908_1_) + { + this.isInFrustum = p_78908_1_.isBoundingBoxInFrustum(this.rendererBoundingBox); + } + + /** + * Renders the occlusion query GL List + */ + public void callOcclusionQueryList() + { + GL11.glCallList(this.glRenderList + 2); + } + + /** + * Checks if all render passes are to be skipped. Returns false if the renderer is not initialized + */ + public boolean skipAllRenderPasses() + { + return !this.isInitialized ? false : this.skipRenderPass[0] && this.skipRenderPass[1]; + } + + /** + * Marks the current renderer data as dirty and needing to be updated. + */ + public void markDirty() + { + this.needsUpdate = true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelper.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelper.java new file mode 100644 index 0000000..565531d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelper.java @@ -0,0 +1,30 @@ +package net.minecraft.client.renderer.culling; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ClippingHelper +{ + public float[][] frustum = new float[16][16]; + public float[] projectionMatrix = new float[16]; + public float[] modelviewMatrix = new float[16]; + public float[] clippingMatrix = new float[16]; + private static final String __OBFID = "CL_00000977"; + + /** + * Returns true if the box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoxInFrustum(double p_78553_1_, double p_78553_3_, double p_78553_5_, double p_78553_7_, double p_78553_9_, double p_78553_11_) + { + for (int i = 0; i < 6; ++i) + { + if ((double)this.frustum[i][0] * p_78553_1_ + (double)this.frustum[i][1] * p_78553_3_ + (double)this.frustum[i][2] * p_78553_5_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_7_ + (double)this.frustum[i][1] * p_78553_3_ + (double)this.frustum[i][2] * p_78553_5_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_1_ + (double)this.frustum[i][1] * p_78553_9_ + (double)this.frustum[i][2] * p_78553_5_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_7_ + (double)this.frustum[i][1] * p_78553_9_ + (double)this.frustum[i][2] * p_78553_5_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_1_ + (double)this.frustum[i][1] * p_78553_3_ + (double)this.frustum[i][2] * p_78553_11_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_7_ + (double)this.frustum[i][1] * p_78553_3_ + (double)this.frustum[i][2] * p_78553_11_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_1_ + (double)this.frustum[i][1] * p_78553_9_ + (double)this.frustum[i][2] * p_78553_11_ + (double)this.frustum[i][3] <= 0.0D && (double)this.frustum[i][0] * p_78553_7_ + (double)this.frustum[i][1] * p_78553_9_ + (double)this.frustum[i][2] * p_78553_11_ + (double)this.frustum[i][3] <= 0.0D) + { + return false; + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java new file mode 100644 index 0000000..0bae7c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ClippingHelperImpl.java @@ -0,0 +1,98 @@ +package net.minecraft.client.renderer.culling; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.FloatBuffer; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ClippingHelperImpl extends ClippingHelper +{ + private static ClippingHelperImpl instance = new ClippingHelperImpl(); + private FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); + private FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); + private static final String __OBFID = "CL_00000975"; + + /** + * Initialises the ClippingHelper object then returns an instance of it. + */ + public static ClippingHelper getInstance() + { + instance.init(); + return instance; + } + + /** + * Normalize the frustum. + */ + private void normalize(float[][] p_78559_1_, int p_78559_2_) + { + float f = MathHelper.sqrt_float(p_78559_1_[p_78559_2_][0] * p_78559_1_[p_78559_2_][0] + p_78559_1_[p_78559_2_][1] * p_78559_1_[p_78559_2_][1] + p_78559_1_[p_78559_2_][2] * p_78559_1_[p_78559_2_][2]); + p_78559_1_[p_78559_2_][0] /= f; + p_78559_1_[p_78559_2_][1] /= f; + p_78559_1_[p_78559_2_][2] /= f; + p_78559_1_[p_78559_2_][3] /= f; + } + + private void init() + { + this.projectionMatrixBuffer.clear(); + this.modelviewMatrixBuffer.clear(); + this.field_78564_h.clear(); + GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer); + GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer); + this.projectionMatrixBuffer.flip().limit(16); + this.projectionMatrixBuffer.get(this.projectionMatrix); + this.modelviewMatrixBuffer.flip().limit(16); + this.modelviewMatrixBuffer.get(this.modelviewMatrix); + this.clippingMatrix[0] = this.modelviewMatrix[0] * this.projectionMatrix[0] + this.modelviewMatrix[1] * this.projectionMatrix[4] + this.modelviewMatrix[2] * this.projectionMatrix[8] + this.modelviewMatrix[3] * this.projectionMatrix[12]; + this.clippingMatrix[1] = this.modelviewMatrix[0] * this.projectionMatrix[1] + this.modelviewMatrix[1] * this.projectionMatrix[5] + this.modelviewMatrix[2] * this.projectionMatrix[9] + this.modelviewMatrix[3] * this.projectionMatrix[13]; + this.clippingMatrix[2] = this.modelviewMatrix[0] * this.projectionMatrix[2] + this.modelviewMatrix[1] * this.projectionMatrix[6] + this.modelviewMatrix[2] * this.projectionMatrix[10] + this.modelviewMatrix[3] * this.projectionMatrix[14]; + this.clippingMatrix[3] = this.modelviewMatrix[0] * this.projectionMatrix[3] + this.modelviewMatrix[1] * this.projectionMatrix[7] + this.modelviewMatrix[2] * this.projectionMatrix[11] + this.modelviewMatrix[3] * this.projectionMatrix[15]; + this.clippingMatrix[4] = this.modelviewMatrix[4] * this.projectionMatrix[0] + this.modelviewMatrix[5] * this.projectionMatrix[4] + this.modelviewMatrix[6] * this.projectionMatrix[8] + this.modelviewMatrix[7] * this.projectionMatrix[12]; + this.clippingMatrix[5] = this.modelviewMatrix[4] * this.projectionMatrix[1] + this.modelviewMatrix[5] * this.projectionMatrix[5] + this.modelviewMatrix[6] * this.projectionMatrix[9] + this.modelviewMatrix[7] * this.projectionMatrix[13]; + this.clippingMatrix[6] = this.modelviewMatrix[4] * this.projectionMatrix[2] + this.modelviewMatrix[5] * this.projectionMatrix[6] + this.modelviewMatrix[6] * this.projectionMatrix[10] + this.modelviewMatrix[7] * this.projectionMatrix[14]; + this.clippingMatrix[7] = this.modelviewMatrix[4] * this.projectionMatrix[3] + this.modelviewMatrix[5] * this.projectionMatrix[7] + this.modelviewMatrix[6] * this.projectionMatrix[11] + this.modelviewMatrix[7] * this.projectionMatrix[15]; + this.clippingMatrix[8] = this.modelviewMatrix[8] * this.projectionMatrix[0] + this.modelviewMatrix[9] * this.projectionMatrix[4] + this.modelviewMatrix[10] * this.projectionMatrix[8] + this.modelviewMatrix[11] * this.projectionMatrix[12]; + this.clippingMatrix[9] = this.modelviewMatrix[8] * this.projectionMatrix[1] + this.modelviewMatrix[9] * this.projectionMatrix[5] + this.modelviewMatrix[10] * this.projectionMatrix[9] + this.modelviewMatrix[11] * this.projectionMatrix[13]; + this.clippingMatrix[10] = this.modelviewMatrix[8] * this.projectionMatrix[2] + this.modelviewMatrix[9] * this.projectionMatrix[6] + this.modelviewMatrix[10] * this.projectionMatrix[10] + this.modelviewMatrix[11] * this.projectionMatrix[14]; + this.clippingMatrix[11] = this.modelviewMatrix[8] * this.projectionMatrix[3] + this.modelviewMatrix[9] * this.projectionMatrix[7] + this.modelviewMatrix[10] * this.projectionMatrix[11] + this.modelviewMatrix[11] * this.projectionMatrix[15]; + this.clippingMatrix[12] = this.modelviewMatrix[12] * this.projectionMatrix[0] + this.modelviewMatrix[13] * this.projectionMatrix[4] + this.modelviewMatrix[14] * this.projectionMatrix[8] + this.modelviewMatrix[15] * this.projectionMatrix[12]; + this.clippingMatrix[13] = this.modelviewMatrix[12] * this.projectionMatrix[1] + this.modelviewMatrix[13] * this.projectionMatrix[5] + this.modelviewMatrix[14] * this.projectionMatrix[9] + this.modelviewMatrix[15] * this.projectionMatrix[13]; + this.clippingMatrix[14] = this.modelviewMatrix[12] * this.projectionMatrix[2] + this.modelviewMatrix[13] * this.projectionMatrix[6] + this.modelviewMatrix[14] * this.projectionMatrix[10] + this.modelviewMatrix[15] * this.projectionMatrix[14]; + this.clippingMatrix[15] = this.modelviewMatrix[12] * this.projectionMatrix[3] + this.modelviewMatrix[13] * this.projectionMatrix[7] + this.modelviewMatrix[14] * this.projectionMatrix[11] + this.modelviewMatrix[15] * this.projectionMatrix[15]; + this.frustum[0][0] = this.clippingMatrix[3] - this.clippingMatrix[0]; + this.frustum[0][1] = this.clippingMatrix[7] - this.clippingMatrix[4]; + this.frustum[0][2] = this.clippingMatrix[11] - this.clippingMatrix[8]; + this.frustum[0][3] = this.clippingMatrix[15] - this.clippingMatrix[12]; + this.normalize(this.frustum, 0); + this.frustum[1][0] = this.clippingMatrix[3] + this.clippingMatrix[0]; + this.frustum[1][1] = this.clippingMatrix[7] + this.clippingMatrix[4]; + this.frustum[1][2] = this.clippingMatrix[11] + this.clippingMatrix[8]; + this.frustum[1][3] = this.clippingMatrix[15] + this.clippingMatrix[12]; + this.normalize(this.frustum, 1); + this.frustum[2][0] = this.clippingMatrix[3] + this.clippingMatrix[1]; + this.frustum[2][1] = this.clippingMatrix[7] + this.clippingMatrix[5]; + this.frustum[2][2] = this.clippingMatrix[11] + this.clippingMatrix[9]; + this.frustum[2][3] = this.clippingMatrix[15] + this.clippingMatrix[13]; + this.normalize(this.frustum, 2); + this.frustum[3][0] = this.clippingMatrix[3] - this.clippingMatrix[1]; + this.frustum[3][1] = this.clippingMatrix[7] - this.clippingMatrix[5]; + this.frustum[3][2] = this.clippingMatrix[11] - this.clippingMatrix[9]; + this.frustum[3][3] = this.clippingMatrix[15] - this.clippingMatrix[13]; + this.normalize(this.frustum, 3); + this.frustum[4][0] = this.clippingMatrix[3] - this.clippingMatrix[2]; + this.frustum[4][1] = this.clippingMatrix[7] - this.clippingMatrix[6]; + this.frustum[4][2] = this.clippingMatrix[11] - this.clippingMatrix[10]; + this.frustum[4][3] = this.clippingMatrix[15] - this.clippingMatrix[14]; + this.normalize(this.frustum, 4); + this.frustum[5][0] = this.clippingMatrix[3] + this.clippingMatrix[2]; + this.frustum[5][1] = this.clippingMatrix[7] + this.clippingMatrix[6]; + this.frustum[5][2] = this.clippingMatrix[11] + this.clippingMatrix[10]; + this.frustum[5][3] = this.clippingMatrix[15] + this.clippingMatrix[14]; + this.normalize(this.frustum, 5); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/Frustrum.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/Frustrum.java new file mode 100644 index 0000000..4394e7d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/Frustrum.java @@ -0,0 +1,38 @@ +package net.minecraft.client.renderer.culling; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.AxisAlignedBB; + +@SideOnly(Side.CLIENT) +public class Frustrum implements ICamera +{ + private ClippingHelper clippingHelper = ClippingHelperImpl.getInstance(); + private double xPosition; + private double yPosition; + private double zPosition; + private static final String __OBFID = "CL_00000976"; + + public void setPosition(double p_78547_1_, double p_78547_3_, double p_78547_5_) + { + this.xPosition = p_78547_1_; + this.yPosition = p_78547_3_; + this.zPosition = p_78547_5_; + } + + /** + * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoxInFrustum(double p_78548_1_, double p_78548_3_, double p_78548_5_, double p_78548_7_, double p_78548_9_, double p_78548_11_) + { + return this.clippingHelper.isBoxInFrustum(p_78548_1_ - this.xPosition, p_78548_3_ - this.yPosition, p_78548_5_ - this.zPosition, p_78548_7_ - this.xPosition, p_78548_9_ - this.yPosition, p_78548_11_ - this.zPosition); + } + + /** + * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. + */ + public boolean isBoundingBoxInFrustum(AxisAlignedBB p_78546_1_) + { + return this.isBoxInFrustum(p_78546_1_.minX, p_78546_1_.minY, p_78546_1_.minZ, p_78546_1_.maxX, p_78546_1_.maxY, p_78546_1_.maxZ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ICamera.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ICamera.java new file mode 100644 index 0000000..54e407a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/culling/ICamera.java @@ -0,0 +1,16 @@ +package net.minecraft.client.renderer.culling; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.AxisAlignedBB; + +@SideOnly(Side.CLIENT) +public interface ICamera +{ + /** + * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. + */ + boolean isBoundingBoxInFrustum(AxisAlignedBB p_78546_1_); + + void setPosition(double p_78547_1_, double p_78547_3_, double p_78547_5_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/Render.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/Render.java new file mode 100644 index 0000000..dc488c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/Render.java @@ -0,0 +1,388 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public abstract class Render +{ + private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); + protected RenderManager renderManager; + protected RenderBlocks field_147909_c = new RenderBlocks(); + protected float shadowSize; + /** Determines the darkness of the object's shadow. Higher value makes a darker shadow. */ + protected float shadowOpaque = 1.0F; + private boolean staticEntity = false; + private static final String __OBFID = "CL_00000992"; + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + { + IIcon iicon2 = i % 2 == 0 ? iicon : iicon1; + this.bindTexture(TextureMap.locationBlocksTexture); + float f7 = iicon2.getMinU(); + float f8 = iicon2.getMinV(); + float f9 = iicon2.getMaxU(); + float f10 = iicon2.getMaxV(); + + if (i / 2 % 2 == 0) + { + float f11 = f9; + f9 = f7; + f7 = f11; + } + + tessellator.addVertexWithUV((double)(f2 - f3), (double)(0.0F - f5), (double)f6, (double)f9, (double)f10); + tessellator.addVertexWithUV((double)(-f2 - f3), (double)(0.0F - f5), (double)f6, (double)f7, (double)f10); + tessellator.addVertexWithUV((double)(-f2 - f3), (double)(1.4F - f5), (double)f6, (double)f7, (double)f8); + tessellator.addVertexWithUV((double)(f2 - f3), (double)(1.4F - f5), (double)f6, (double)f9, (double)f8); + f4 -= 0.45F; + f5 -= 0.45F; + f2 *= 0.9F; + f6 += 0.03F; + ++i; + } + + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha, + * partialTickTime + */ + private void renderShadow(Entity p_76975_1_, double p_76975_2_, double p_76975_4_, double p_76975_6_, float p_76975_8_, float p_76975_9_) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.renderManager.renderEngine.bindTexture(shadowTextures); + World world = this.getWorldFromRenderManager(); + GL11.glDepthMask(false); + float f2 = this.shadowSize; + + if (p_76975_1_ instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)p_76975_1_; + f2 *= entityliving.getRenderSizeModifier(); + + if (entityliving.isChild()) + { + f2 *= 0.5F; + } + } + + double d8 = p_76975_1_.lastTickPosX + (p_76975_1_.posX - p_76975_1_.lastTickPosX) * (double)p_76975_9_; + double d3 = p_76975_1_.lastTickPosY + (p_76975_1_.posY - p_76975_1_.lastTickPosY) * (double)p_76975_9_ + (double)p_76975_1_.getShadowSize(); + double d4 = p_76975_1_.lastTickPosZ + (p_76975_1_.posZ - p_76975_1_.lastTickPosZ) * (double)p_76975_9_; + int i = MathHelper.floor_double(d8 - (double)f2); + int j = MathHelper.floor_double(d8 + (double)f2); + int k = MathHelper.floor_double(d3 - (double)f2); + int l = MathHelper.floor_double(d3); + int i1 = MathHelper.floor_double(d4 - (double)f2); + int j1 = MathHelper.floor_double(d4 + (double)f2); + double d5 = p_76975_2_ - d8; + double d6 = p_76975_4_ - d3; + double d7 = p_76975_6_ - d4; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + + for (int k1 = i; k1 <= j; ++k1) + { + for (int l1 = k; l1 <= l; ++l1) + { + for (int i2 = i1; i2 <= j1; ++i2) + { + Block block = world.getBlock(k1, l1 - 1, i2); + + if (block.getMaterial() != Material.air && world.getBlockLightValue(k1, l1, i2) > 3) + { + this.func_147907_a(block, p_76975_2_, p_76975_4_ + (double)p_76975_1_.getShadowSize(), p_76975_6_, k1, l1, i2, p_76975_8_, f2, d5, d6 + (double)p_76975_1_.getShadowSize(), d7); + } + } + } + } + + tessellator.draw(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + } + + /** + * Returns the render manager's world object + */ + private World getWorldFromRenderManager() + { + return this.renderManager.worldObj; + } + + private void func_147907_a(Block p_147907_1_, double p_147907_2_, double p_147907_4_, double p_147907_6_, int p_147907_8_, int p_147907_9_, int p_147907_10_, float p_147907_11_, float p_147907_12_, double p_147907_13_, double p_147907_15_, double p_147907_17_) + { + Tessellator tessellator = Tessellator.instance; + + if (p_147907_1_.renderAsNormalBlock()) + { + double d6 = ((double)p_147907_11_ - (p_147907_4_ - ((double)p_147907_9_ + p_147907_15_)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(p_147907_8_, p_147907_9_, p_147907_10_); + + if (d6 >= 0.0D) + { + if (d6 > 1.0D) + { + d6 = 1.0D; + } + + tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, (float)d6); + double d7 = (double)p_147907_8_ + p_147907_1_.getBlockBoundsMinX() + p_147907_13_; + double d8 = (double)p_147907_8_ + p_147907_1_.getBlockBoundsMaxX() + p_147907_13_; + double d9 = (double)p_147907_9_ + p_147907_1_.getBlockBoundsMinY() + p_147907_15_ + 0.015625D; + double d10 = (double)p_147907_10_ + p_147907_1_.getBlockBoundsMinZ() + p_147907_17_; + double d11 = (double)p_147907_10_ + p_147907_1_.getBlockBoundsMaxZ() + p_147907_17_; + float f2 = (float)((p_147907_2_ - d7) / 2.0D / (double)p_147907_12_ + 0.5D); + float f3 = (float)((p_147907_2_ - d8) / 2.0D / (double)p_147907_12_ + 0.5D); + float f4 = (float)((p_147907_6_ - d10) / 2.0D / (double)p_147907_12_ + 0.5D); + float f5 = (float)((p_147907_6_ - d11) / 2.0D / (double)p_147907_12_ + 0.5D); + tessellator.addVertexWithUV(d7, d9, d10, (double)f2, (double)f4); + tessellator.addVertexWithUV(d7, d9, d11, (double)f2, (double)f5); + tessellator.addVertexWithUV(d8, d9, d11, (double)f3, (double)f5); + tessellator.addVertexWithUV(d8, d9, d10, (double)f3, (double)f4); + } + } + } + + /** + * Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z + */ + public static void renderOffsetAABB(AxisAlignedBB p_76978_0_, double p_76978_1_, double p_76978_3_, double p_76978_5_) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setTranslation(p_76978_1_, p_76978_3_, p_76978_5_); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ); + tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ); + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Adds to the tesselator a box using the aabb for the bounds. Args: aabb + */ + public static void renderAABB(AxisAlignedBB p_76980_0_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.minX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.minZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.maxY, p_76980_0_.maxZ); + tessellator.addVertex(p_76980_0_.maxX, p_76980_0_.minY, p_76980_0_.maxZ); + tessellator.draw(); + } + + /** + * Sets the RenderManager. + */ + public void setRenderManager(RenderManager p_76976_1_) + { + this.renderManager = p_76976_1_; + } + + /** + * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw, partialTickTime + */ + public void doRenderShadowAndFire(Entity p_76979_1_, double p_76979_2_, double p_76979_4_, double p_76979_6_, float p_76979_8_, float p_76979_9_) + { + if (this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !p_76979_1_.isInvisible()) + { + double d3 = this.renderManager.getDistanceToCamera(p_76979_1_.posX, p_76979_1_.posY, p_76979_1_.posZ); + float f2 = (float)((1.0D - d3 / 256.0D) * (double)this.shadowOpaque); + + if (f2 > 0.0F) + { + this.renderShadow(p_76979_1_, p_76979_2_, p_76979_4_, p_76979_6_, f2, p_76979_9_); + } + } + + if (p_76979_1_.canRenderOnFire()) + { + this.renderEntityOnFire(p_76979_1_, p_76979_2_, p_76979_4_, p_76979_6_, p_76979_9_); + } + } + + /** + * Returns the font renderer from the set render manager + */ + public FontRenderer getFontRendererFromRenderManager() + { + return this.renderManager.getFontRenderer(); + } + + public void updateIcons(IIconRegister p_94143_1_) {} + + protected void func_147906_a(Entity p_147906_1_, String p_147906_2_, double p_147906_3_, double p_147906_5_, double p_147906_7_, int p_147906_9_) + { + double d3 = p_147906_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + + if (d3 <= (double)(p_147906_9_ * p_147906_9_)) + { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + float f = 1.6F; + float f1 = 0.016666668F * f; + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147906_3_ + 0.0F, (float)p_147906_5_ + p_147906_1_.height + 0.5F, (float)p_147906_7_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-f1, -f1, f1); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator tessellator = Tessellator.instance; + byte b0 = 0; + + if (p_147906_2_.equals("deadmau5")) + { + b0 = -10; + } + + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + int j = fontrenderer.getStringWidth(p_147906_2_) / 2; + tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + tessellator.addVertex((double)(-j - 1), (double)(-1 + b0), 0.0D); + tessellator.addVertex((double)(-j - 1), (double)(8 + b0), 0.0D); + tessellator.addVertex((double)(j + 1), (double)(8 + b0), 0.0D); + tessellator.addVertex((double)(j + 1), (double)(-1 + b0), 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + fontrenderer.drawString(p_147906_2_, -fontrenderer.getStringWidth(p_147906_2_) / 2, b0, 553648127); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(true); + fontrenderer.drawString(p_147906_2_, -fontrenderer.getStringWidth(p_147906_2_) / 2, b0, -1); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderArrow.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderArrow.java new file mode 100644 index 0000000..3584e5f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderArrow.java @@ -0,0 +1,112 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class RenderArrow extends Render +{ + private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); + private static final String __OBFID = "CL_00000978"; + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + { + float f12 = -MathHelper.sin(f11 * 3.0F) * f11; + GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); + } + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); + GL11.glNormal3f(-f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); + + for (int i = 0; i < 4; ++i) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4); + tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4); + tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5); + tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5); + tessellator.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityArrow p_110775_1_) + { + return arrowTextures; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityArrow)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float f2 = (float)(j >> 8 & 255) / 255.0F; + float f3 = (float)(j & 255) / 255.0F; + GL11.glColor3f(f1, f2, f3); + + if (itemstack.isItemEnchanted()) + { + return 31; + } + + return 16; + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (itemstack.isItemEnchanted()) + { + return 15; + } + + return 1; + } + } + + return -1; + } + + protected void func_82408_c(EntityLiving p_82408_1_, int p_82408_2_, float p_82408_3_) + { + ItemStack itemstack = p_82408_1_.func_130225_q(3 - p_82408_2_); + + if (itemstack != null) + { + Item item = itemstack.getItem(); + + if (item instanceof ItemArmor) + { + this.bindTexture(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); + float f1 = 1.0F; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + f2 = (float)(j >> 8 & 255) / 255.0F; + float f3 = (float)(j & 255) / 255.0F; + GL11.glColor4f(f5, f2, f3, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, i); + } + } + else + { + i = itemstack.getItem().getColorFromItemStack(itemstack, 0); + float f4 = (float)(i >> 16 & 255) / 255.0F; + f5 = (float)(i >> 8 & 255) / 255.0F; + f2 = (float)(i & 255) / 255.0F; + GL11.glColor4f(f4, f5, f2, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 0); + } + + GL11.glPopMatrix(); + } + } + + protected void func_82422_c() + { + GL11.glTranslatef(0.0F, 0.1875F, 0.0F); + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) + { + this.func_82408_c((EntityLiving)p_82408_1_, p_82408_2_, p_82408_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return this.shouldRenderPass((EntityLiving)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) + { + this.renderEquippedItems((EntityLiving)p_77029_1_, p_77029_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + { + GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * (float)p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + + float f4 = 0.75F; + GL11.glScalef(f4, f4, f4); + GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); + this.bindEntityTexture(p_76986_1_); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityBoat p_110775_1_) + { + return boatTextures; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityBoat)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1.0F) + { + f1 = 1.0F; + } + + f1 *= f1; + f1 *= f1; + float f3 = (1.0F + f1 * 0.4F) * f2; + float f4 = (1.0F + f1 * 0.1F) / f2; + GL11.glScalef(f3, f4, f3); + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityCreeper p_77030_1_, float p_77030_2_, float p_77030_3_) + { + float f2 = p_77030_1_.getCreeperFlashIntensity(p_77030_3_); + + if ((int)(f2 * 10.0F) % 2 == 0) + { + return 0; + } + else + { + int i = (int)(f2 * 0.2F * 255.0F); + + if (i < 0) + { + i = 0; + } + + if (i > 255) + { + i = 255; + } + + short short1 = 255; + short short2 = 255; + short short3 = 255; + return i << 24 | short1 << 16 | short2 << 8 | short3; + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityCreeper p_77032_1_, int p_77032_2_, float p_77032_3_) + { + if (p_77032_1_.getPowered()) + { + if (p_77032_1_.isInvisible()) + { + GL11.glDepthMask(false); + } + else + { + GL11.glDepthMask(true); + } + + if (p_77032_2_ == 1) + { + float f1 = (float)p_77032_1_.ticksExisted + p_77032_3_; + this.bindTexture(armoredCreeperTextures); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f2 = f1 * 0.01F; + float f3 = f1 * 0.01F; + GL11.glTranslatef(f2, f3, 0.0F); + this.setRenderPassModel(this.creeperModel); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_BLEND); + float f4 = 0.5F; + GL11.glColor4f(f4, f4, f4, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + return 1; + } + + if (p_77032_2_ == 2) + { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + } + + return -1; + } + + protected int inheritRenderPass(EntityCreeper p_77035_1_, int p_77035_2_, float p_77035_3_) + { + return -1; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityCreeper p_110775_1_) + { + return creeperTextures; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) + { + this.preRenderCallback((EntityCreeper)p_77041_1_, p_77041_2_); + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) + { + return this.getColorMultiplier((EntityCreeper)p_77030_1_, p_77030_2_, p_77030_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return this.shouldRenderPass((EntityCreeper)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_) + { + return this.inheritRenderPass((EntityCreeper)p_77035_1_, p_77035_2_, p_77035_3_); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityCreeper)p_110775_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderDragon.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderDragon.java new file mode 100644 index 0000000..bfe7e6d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderDragon.java @@ -0,0 +1,313 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.client.model.ModelDragon; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderDragon extends RenderLiving +{ + private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png"); + private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); + private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); + private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); + /** An instance of the dragon model in RenderDragon */ + protected ModelDragon modelDragon; + private static final String __OBFID = "CL_00000988"; + + public RenderDragon() + { + super(new ModelDragon(0.0F), 0.5F); + this.modelDragon = (ModelDragon)this.mainModel; + this.setRenderPassModel(this.mainModel); + } + + protected void rotateCorpse(EntityDragon p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + float f3 = (float)p_77043_1_.getMovementOffsets(7, p_77043_4_)[0]; + float f4 = (float)(p_77043_1_.getMovementOffsets(5, p_77043_4_)[1] - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]); + GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, 1.0F); + + if (p_77043_1_.deathTime > 0) + { + float f5 = ((float)p_77043_1_.deathTime + p_77043_4_ - 1.0F) / 20.0F * 1.6F; + f5 = MathHelper.sqrt_float(f5); + + if (f5 > 1.0F) + { + f5 = 1.0F; + } + + GL11.glRotatef(f5 * this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + } + } + + /** + * Renders the model in RenderLiving + */ + protected void renderModel(EntityDragon p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) + { + if (p_77036_1_.deathTicks > 0) + { + float f6 = (float)p_77036_1_.deathTicks / 200.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, f6); + this.bindTexture(enderDragonExplodingTextures); + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDepthFunc(GL11.GL_EQUAL); + } + + this.bindEntityTexture(p_77036_1_); + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + + if (p_77036_1_.hurtTime > 0) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) + { + RenderHelper.disableStandardItemLighting(); + float f1 = ((float)p_77029_1_.deathTicks + p_77029_2_) / 200.0F; + float f2 = 0.0F; + + if (f1 > 0.8F) + { + f2 = (f1 - 0.8F) / 0.2F; + } + + Random random = new Random(432L); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -1.0F, -2.0F); + + for (int i = 0; (float)i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i) + { + GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F); + tessellator.startDrawing(6); + float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F; + float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F; + tessellator.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - f2))); + tessellator.addVertex(0.0D, 0.0D, 0.0D); + tessellator.setColorRGBA_I(16711935, 0); + tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); + tessellator.addVertex(0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); + tessellator.addVertex(0.0D, (double)f3, (double)(1.0F * f4)); + tessellator.addVertex(-0.866D * (double)f4, (double)f3, (double)(-0.5F * f4)); + tessellator.draw(); + } + + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + RenderHelper.enableStandardItemLighting(); + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityDragon p_77032_1_, int p_77032_2_, float p_77032_3_) + { + if (p_77032_2_ == 1) + { + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + if (p_77032_2_ != 0) + { + return -1; + } + else + { + this.bindTexture(enderDragonEyesTextures); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_EQUAL); + char c0 = 61680; + int j = c0 % 65536; + int k = c0 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + return 1; + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= (float)Math.PI; f2 -= ((float)Math.PI * 2F)) + { + ; + } + + while (f2 < -(float)Math.PI) + { + f2 += ((float)Math.PI * 2F); + } + + float f3 = p_147500_1_.field_145925_p + f2 * p_147500_8_; + GL11.glRotatef(-f3 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); + this.bindTexture(field_147540_b); + float f4 = p_147500_1_.field_145931_j + (p_147500_1_.field_145933_i - p_147500_1_.field_145931_j) * p_147500_8_ + 0.25F; + float f5 = p_147500_1_.field_145931_j + (p_147500_1_.field_145933_i - p_147500_1_.field_145931_j) * p_147500_8_ + 0.75F; + f4 = (f4 - (float)MathHelper.truncateDoubleToInt((double)f4)) * 1.6F - 0.3F; + f5 = (f5 - (float)MathHelper.truncateDoubleToInt((double)f5)) * 1.6F - 0.3F; + + if (f4 < 0.0F) + { + f4 = 0.0F; + } + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + if (f5 > 1.0F) + { + f5 = 1.0F; + } + + float f6 = p_147500_1_.field_145927_n + (p_147500_1_.field_145930_m - p_147500_1_.field_145927_n) * p_147500_8_; + GL11.glEnable(GL11.GL_CULL_FACE); + this.field_147541_c.render((Entity)null, f1, f4, f5, f6, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityEnchantmentTable)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderEnderman.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderEnderman.java new file mode 100644 index 0000000..4136361 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderEnderman.java @@ -0,0 +1,180 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.model.ModelEnderman; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class RenderEnderman extends RenderLiving +{ + private static final ResourceLocation endermanEyesTexture = new ResourceLocation("textures/entity/enderman/enderman_eyes.png"); + private static final ResourceLocation endermanTextures = new ResourceLocation("textures/entity/enderman/enderman.png"); + /** The model of the enderman */ + private ModelEnderman endermanModel; + private Random rnd = new Random(); + private static final String __OBFID = "CL_00000989"; + + public RenderEnderman() + { + super(new ModelEnderman(), 0.5F); + this.endermanModel = (ModelEnderman)super.mainModel; + this.setRenderPassModel(this.endermanModel); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0 || p_76986_1_.field_146042_b != Minecraft.getMinecraft().thePlayer) + { + float f11 = (p_76986_1_.field_146042_b.prevRenderYawOffset + (p_76986_1_.field_146042_b.renderYawOffset - p_76986_1_.field_146042_b.prevRenderYawOffset) * p_76986_9_) * (float)Math.PI / 180.0F; + double d7 = (double)MathHelper.sin(f11); + double d9 = (double)MathHelper.cos(f11); + d3 = p_76986_1_.field_146042_b.prevPosX + (p_76986_1_.field_146042_b.posX - p_76986_1_.field_146042_b.prevPosX) * (double)p_76986_9_ - d9 * 0.35D - d7 * 0.85D; + d4 = p_76986_1_.field_146042_b.prevPosY + d6 + (p_76986_1_.field_146042_b.posY - p_76986_1_.field_146042_b.prevPosY) * (double)p_76986_9_ - 0.45D; + d5 = p_76986_1_.field_146042_b.prevPosZ + (p_76986_1_.field_146042_b.posZ - p_76986_1_.field_146042_b.prevPosZ) * (double)p_76986_9_ - d7 * 0.35D + d9 * 0.85D; + } + + double d14 = p_76986_1_.prevPosX + (p_76986_1_.posX - p_76986_1_.prevPosX) * (double)p_76986_9_; + double d8 = p_76986_1_.prevPosY + (p_76986_1_.posY - p_76986_1_.prevPosY) * (double)p_76986_9_ + 0.25D; + double d10 = p_76986_1_.prevPosZ + (p_76986_1_.posZ - p_76986_1_.prevPosZ) * (double)p_76986_9_; + double d11 = (double)((float)(d3 - d14)); + double d12 = (double)((float)(d4 - d8)); + double d13 = (double)((float)(d5 - d10)); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + tessellator.startDrawing(3); + tessellator.setColorOpaque_I(0); + byte b2 = 16; + + for (int i = 0; i <= b2; ++i) + { + float f12 = (float)i / (float)b2; + tessellator.addVertex(p_76986_2_ + d11 * (double)f12, p_76986_4_ + d12 * (double)(f12 * f12 + f12) * 0.5D + 0.25D, p_76986_6_ + d13 * (double)f12); + } + + tessellator.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityFishHook p_110775_1_) + { + return field_110792_a; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityFishHook)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 0.01D) + { + float f3 = 13.0F; + float f4 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F; + float f5 = (Math.abs(f4 % f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F); + GL11.glRotatef(6.5F * f5, 0.0F, 0.0F, 1.0F); + } + } + + protected void renderEquippedItems(EntityIronGolem p_77029_1_, float p_77029_2_) + { + super.renderEquippedItems(p_77029_1_, p_77029_2_); + + if (p_77029_1_.getHoldRoseTick() != 0) + { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glPushMatrix(); + GL11.glRotatef(5.0F + 180.0F * this.ironGolemModel.ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + float f1 = 0.8F; + GL11.glScalef(f1, -f1, f1); + int i = p_77029_1_.getBrightnessForRender(p_77029_2_); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindTexture(TextureMap.locationBlocksTexture); + this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F); + GL11.glPopMatrix(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1) + { + b0 = 2; + } + + if (p_76986_1_.getEntityItem().stackSize > 5) + { + b0 = 3; + } + + if (p_76986_1_.getEntityItem().stackSize > 20) + { + b0 = 4; + } + + if (p_76986_1_.getEntityItem().stackSize > 40) + { + b0 = 5; + } + + b0 = getMiniBlockCount(itemstack, b0); + + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + f2, (float)p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6; + float f7; + int k; + + if (ForgeHooksClient.renderEntityItem(p_76986_1_, itemstack, f2, f3, random, renderManager.renderEngine, field_147909_c, b0)) + { + ; + } + else // Code Style break here to prevent the patch from editing this line + if (itemstack.getItemSpriteNumber() == 0 && itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + { + Block block = Block.getBlockFromItem(itemstack.getItem()); + GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); + + if (renderInFrame) + { + GL11.glScalef(1.25F, 1.25F, 1.25F); + GL11.glTranslatef(0.0F, 0.05F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + float f9 = 0.25F; + k = block.getRenderType(); + + if (k == 1 || k == 19 || k == 12 || k == 2) + { + f9 = 0.5F; + } + + if (block.getRenderBlockPass() > 0) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + GL11.glScalef(f9, f9, f9); + + for (int l = 0; l < b0; ++l) + { + GL11.glPushMatrix(); + + if (l > 0) + { + f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f9; + f7 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f9; + float f8 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f9; + GL11.glTranslatef(f6, f7, f8); + } + + this.renderBlocksRi.renderBlockAsItem(block, itemstack.getItemDamage(), 1.0F); + GL11.glPopMatrix(); + } + + if (block.getRenderBlockPass() > 0) + { + GL11.glDisable(GL11.GL_BLEND); + } + } + else + { + float f5; + + if (/*itemstack.getItemSpriteNumber() == 1 &&*/ itemstack.getItem().requiresMultipleRenderPasses()) + { + if (renderInFrame) + { + GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); + GL11.glTranslatef(0.0F, -0.05F, 0.0F); + } + else + { + GL11.glScalef(0.5F, 0.5F, 0.5F); + } + + for (int j = 0; j < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++j) + { + this.random.setSeed(187L); + IIcon iicon1 = itemstack.getItem().getIcon(itemstack, j); + + if (this.renderWithColor) + { + k = itemstack.getItem().getColorFromItemStack(itemstack, j); + f5 = (float)(k >> 16 & 255) / 255.0F; + f6 = (float)(k >> 8 & 255) / 255.0F; + f7 = (float)(k & 255) / 255.0F; + GL11.glColor4f(f5, f6, f7, 1.0F); + this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, f5, f6, f7, j); + } + else + { + this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, 1.0F, 1.0F, 1.0F, j); + } + } + } + else + { + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + if (renderInFrame) + { + GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); + GL11.glTranslatef(0.0F, -0.05F, 0.0F); + } + else + { + GL11.glScalef(0.5F, 0.5F, 0.5F); + } + + IIcon iicon = itemstack.getIconIndex(); + + if (this.renderWithColor) + { + int i = itemstack.getItem().getColorFromItemStack(itemstack, 0); + float f4 = (float)(i >> 16 & 255) / 255.0F; + f5 = (float)(i >> 8 & 255) / 255.0F; + f6 = (float)(i & 255) / 255.0F; + this.renderDroppedItem(p_76986_1_, iicon, b0, p_76986_9_, f4, f5, f6); + } + else + { + this.renderDroppedItem(p_76986_1_, iicon, b0, p_76986_9_, 1.0F, 1.0F, 1.0F); + } + + if (itemstack != null && itemstack.getItem() instanceof ItemCloth) + { + GL11.glDisable(GL11.GL_BLEND); + } + } + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + this.bindEntityTexture(p_76986_1_); + TextureUtil.func_147945_b(); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityItem p_110775_1_) + { + return this.renderManager.renderEngine.getResourceLocation(p_110775_1_.getEntityItem().getItemSpriteNumber()); + } + + /** + * Renders a dropped item + */ + private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_) + { + this.renderDroppedItem(p_77020_1_, p_77020_2_, p_77020_3_, p_77020_4_, p_77020_5_, p_77020_6_, p_77020_7_, 0); + } + + private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_, int pass) + { + Tessellator tessellator = Tessellator.instance; + + if (p_77020_2_ == null) + { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + ResourceLocation resourcelocation = texturemanager.getResourceLocation(p_77020_1_.getEntityItem().getItemSpriteNumber()); + p_77020_2_ = ((TextureMap)texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno"); + } + + float f14 = ((IIcon)p_77020_2_).getMinU(); + float f15 = ((IIcon)p_77020_2_).getMaxU(); + float f4 = ((IIcon)p_77020_2_).getMinV(); + float f5 = ((IIcon)p_77020_2_).getMaxV(); + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.25F; + float f10; + + if (this.renderManager.options.fancyGraphics) + { + GL11.glPushMatrix(); + + if (renderInFrame) + { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + else + { + GL11.glRotatef((((float)p_77020_1_.age + p_77020_4_) / 20.0F + p_77020_1_.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + float f9 = 0.0625F; + f10 = 0.021875F; + ItemStack itemstack = p_77020_1_.getEntityItem(); + int j = itemstack.stackSize; + byte b0; + + if (j < 2) + { + b0 = 1; + } + else if (j < 16) + { + b0 = 2; + } + else if (j < 32) + { + b0 = 3; + } + else + { + b0 = 4; + } + + b0 = getMiniItemCount(itemstack, b0); + + GL11.glTranslatef(-f7, -f8, -((f9 + f10) * (float)b0 / 2.0F)); + + for (int k = 0; k < b0; ++k) + { + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + if (k > 0 && shouldSpreadItems()) + { + float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + GL11.glTranslatef(x, y, f9 + f10); + } + else + { + GL11.glTranslatef(0f, 0f, f9 + f10); + } + + if (itemstack.getItemSpriteNumber() == 0) + { + this.bindTexture(TextureMap.locationBlocksTexture); + } + else + { + this.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, f15, f4, f14, f5, ((IIcon)p_77020_2_).getIconWidth(), ((IIcon)p_77020_2_).getIconHeight(), f9); + + if (itemstack.hasEffect(pass)) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + float f11 = 0.76F; + GL11.glColor4f(0.5F * f11, 0.25F * f11, 0.8F * f11, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f12 = 0.125F; + GL11.glScalef(f12, f12, f12); + float f13 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(f13, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f9); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f12, f12, f12); + f13 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-f13, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f9); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + } + + GL11.glPopMatrix(); + } + else + { + for (int l = 0; l < p_77020_3_; ++l) + { + GL11.glPushMatrix(); + + if (l > 0) + { + f10 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float f16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float f17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + GL11.glTranslatef(f10, f16, f17); + } + + if (!renderInFrame) + { + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.addVertexWithUV((double)(0.0F - f7), (double)(0.0F - f8), 0.0D, (double)f14, (double)f5); + tessellator.addVertexWithUV((double)(f6 - f7), (double)(0.0F - f8), 0.0D, (double)f15, (double)f5); + tessellator.addVertexWithUV((double)(f6 - f7), (double)(1.0F - f8), 0.0D, (double)f15, (double)f4); + tessellator.addVertexWithUV((double)(0.0F - f7), (double)(1.0F - f8), 0.0D, (double)f14, (double)f4); + tessellator.draw(); + GL11.glPopMatrix(); + } + } + } + + /** + * Renders the item's icon or block into the UI at the specified position. + */ + public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_) + { + this.renderItemIntoGUI(p_77015_1_, p_77015_2_, p_77015_3_, p_77015_4_, p_77015_5_, false); + } + + public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_, boolean renderEffect) + { + int k = p_77015_3_.getItemDamage(); + Object object = p_77015_3_.getIconIndex(); + int l; + float f; + float f3; + float f4; + + if (p_77015_3_.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(p_77015_3_.getItem()).getRenderType())) + { + p_77015_2_.bindTexture(TextureMap.locationBlocksTexture); + Block block = Block.getBlockFromItem(p_77015_3_.getItem()); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (block.getRenderBlockPass() != 0) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + else + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPushMatrix(); + GL11.glTranslatef((float)(p_77015_4_ - 2), (float)(p_77015_5_ + 3), -3.0F + this.zLevel); + GL11.glScalef(10.0F, 10.0F, 10.0F); + GL11.glTranslatef(1.0F, 0.5F, 1.0F); + GL11.glScalef(1.0F, 1.0F, -1.0F); + GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0); + f3 = (float)(l >> 16 & 255) / 255.0F; + f4 = (float)(l >> 8 & 255) / 255.0F; + f = (float)(l & 255) / 255.0F; + + if (this.renderWithColor) + { + GL11.glColor4f(f3, f4, f, 1.0F); + } + + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + this.renderBlocksRi.useInventoryTint = this.renderWithColor; + this.renderBlocksRi.renderBlockAsItem(block, k, 1.0F); + this.renderBlocksRi.useInventoryTint = true; + + if (block.getRenderBlockPass() == 0) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + } + + GL11.glPopMatrix(); + } + else if (p_77015_3_.getItem().requiresMultipleRenderPasses()) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + p_77015_2_.bindTexture(TextureMap.locationItemsTexture); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(0, 0, 0, 0); + GL11.glColorMask(false, false, false, true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(-1); + tessellator.addVertex((double)(p_77015_4_ - 2), (double)(p_77015_5_ + 18), (double)this.zLevel); + tessellator.addVertex((double)(p_77015_4_ + 18), (double)(p_77015_5_ + 18), (double)this.zLevel); + tessellator.addVertex((double)(p_77015_4_ + 18), (double)(p_77015_5_ - 2), (double)this.zLevel); + tessellator.addVertex((double)(p_77015_4_ - 2), (double)(p_77015_5_ - 2), (double)this.zLevel); + tessellator.draw(); + GL11.glColorMask(true, true, true, true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + Item item = p_77015_3_.getItem(); + for (l = 0; l < item.getRenderPasses(k); ++l) + { + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + p_77015_2_.bindTexture(item.getSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + IIcon iicon = item.getIcon(p_77015_3_, l); + int i1 = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, l); + f = (float)(i1 >> 16 & 255) / 255.0F; + float f1 = (float)(i1 >> 8 & 255) / 255.0F; + float f2 = (float)(i1 & 255) / 255.0F; + + if (this.renderWithColor) + { + GL11.glColor4f(f, f1, f2, 1.0F); + } + + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, ad renderEffect can derp them up. + GL11.glEnable(GL11.GL_ALPHA_TEST); + + this.renderIcon(p_77015_4_, p_77015_5_, iicon, 16, 16); + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + + if (renderEffect && p_77015_3_.hasEffect(l)) + { + renderEffect(p_77015_2_, p_77015_4_, p_77015_5_); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + else + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + ResourceLocation resourcelocation = p_77015_2_.getResourceLocation(p_77015_3_.getItemSpriteNumber()); + p_77015_2_.bindTexture(resourcelocation); + + if (object == null) + { + object = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno"); + } + + l = p_77015_3_.getItem().getColorFromItemStack(p_77015_3_, 0); + f3 = (float)(l >> 16 & 255) / 255.0F; + f4 = (float)(l >> 8 & 255) / 255.0F; + f = (float)(l & 255) / 255.0F; + + if (this.renderWithColor) + { + GL11.glColor4f(f3, f4, f, 1.0F); + } + + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up. + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + + this.renderIcon(p_77015_4_, p_77015_5_, (IIcon)object, 16, 16); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + + if (renderEffect && p_77015_3_.hasEffect(0)) + { + renderEffect(p_77015_2_, p_77015_4_, p_77015_5_); + } + GL11.glEnable(GL11.GL_LIGHTING); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + } + + /** + * Render the item's icon or block into the GUI, including the glint effect. + */ + @SuppressWarnings("unused") + public void renderItemAndEffectIntoGUI(FontRenderer p_82406_1_, TextureManager p_82406_2_, final ItemStack p_82406_3_, int p_82406_4_, int p_82406_5_) + { + if (p_82406_3_ != null) + { + this.zLevel += 50.0F; + + try + { + if (!ForgeHooksClient.renderInventoryItem(this.field_147909_c, p_82406_2_, p_82406_3_, renderWithColor, zLevel, (float)p_82406_4_, (float)p_82406_5_)) + { + this.renderItemIntoGUI(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_, true); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering item"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being rendered"); + crashreportcategory.addCrashSectionCallable("Item Type", new Callable() + { + private static final String __OBFID = "CL_00001004"; + public String call() + { + return String.valueOf(p_82406_3_.getItem()); + } + }); + crashreportcategory.addCrashSectionCallable("Item Aux", new Callable() + { + private static final String __OBFID = "CL_00001005"; + public String call() + { + return String.valueOf(p_82406_3_.getItemDamage()); + } + }); + crashreportcategory.addCrashSectionCallable("Item NBT", new Callable() + { + private static final String __OBFID = "CL_00001006"; + public String call() + { + return String.valueOf(p_82406_3_.getTagCompound()); + } + }); + crashreportcategory.addCrashSectionCallable("Item Foil", new Callable() + { + private static final String __OBFID = "CL_00001007"; + public String call() + { + return String.valueOf(p_82406_3_.hasEffect()); + } + }); + throw new ReportedException(crashreport); + } + + // Forge: Bugfix, Move this to a per-render pass, modders must handle themselves + if (false && p_82406_3_.hasEffect()) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + p_82406_2_.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); + this.renderGlint(p_82406_4_ * 431278612 + p_82406_5_ * 32178161, p_82406_4_ - 2, p_82406_5_ - 2, 20, 20); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + this.zLevel -= 50.0F; + } + } + + public void renderEffect(TextureManager manager, int x, int y) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + manager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); + this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + private void renderGlint(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) + { + for (int j1 = 0; j1 < 2; ++j1) + { + OpenGlHelper.glBlendFunc(772, 1, 0, 0); + float f = 0.00390625F; + float f1 = 0.00390625F; + float f2 = (float)(Minecraft.getSystemTime() % (long)(3000 + j1 * 1873)) / (3000.0F + (float)(j1 * 1873)) * 256.0F; + float f3 = 0.0F; + Tessellator tessellator = Tessellator.instance; + float f4 = 4.0F; + + if (j1 == 1) + { + f4 = -1.0F; + } + + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_77018_2_ + 0), (double)(p_77018_3_ + p_77018_5_), (double)this.zLevel, (double)((f2 + (float)p_77018_5_ * f4) * f), (double)((f3 + (float)p_77018_5_) * f1)); + tessellator.addVertexWithUV((double)(p_77018_2_ + p_77018_4_), (double)(p_77018_3_ + p_77018_5_), (double)this.zLevel, (double)((f2 + (float)p_77018_4_ + (float)p_77018_5_ * f4) * f), (double)((f3 + (float)p_77018_5_) * f1)); + tessellator.addVertexWithUV((double)(p_77018_2_ + p_77018_4_), (double)(p_77018_3_ + 0), (double)this.zLevel, (double)((f2 + (float)p_77018_4_) * f), (double)((f3 + 0.0F) * f1)); + tessellator.addVertexWithUV((double)(p_77018_2_ + 0), (double)(p_77018_3_ + 0), (double)this.zLevel, (double)((f2 + 0.0F) * f), (double)((f3 + 0.0F) * f1)); + tessellator.draw(); + } + } + + /** + * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the + * specified position. + */ + public void renderItemOverlayIntoGUI(FontRenderer p_77021_1_, TextureManager p_77021_2_, ItemStack p_77021_3_, int p_77021_4_, int p_77021_5_) + { + this.renderItemOverlayIntoGUI(p_77021_1_, p_77021_2_, p_77021_3_, p_77021_4_, p_77021_5_, (String)null); + } + + public void renderItemOverlayIntoGUI(FontRenderer p_94148_1_, TextureManager p_94148_2_, ItemStack p_94148_3_, int p_94148_4_, int p_94148_5_, String p_94148_6_) + { + if (p_94148_3_ != null) + { + if (p_94148_3_.stackSize > 1 || p_94148_6_ != null) + { + String s1 = p_94148_6_ == null ? String.valueOf(p_94148_3_.stackSize) : p_94148_6_; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_BLEND); + p_94148_1_.drawStringWithShadow(s1, p_94148_4_ + 19 - 2 - p_94148_1_.getStringWidth(s1), p_94148_5_ + 6 + 3, 16777215); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + if (p_94148_3_.getItem().showDurabilityBar(p_94148_3_)) + { + double health = p_94148_3_.getItem().getDurabilityForDisplay(p_94148_3_); + int j1 = (int)Math.round(13.0D - health * 13.0D); + int k = (int)Math.round(255.0D - health * 255.0D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + Tessellator tessellator = Tessellator.instance; + int l = 255 - k << 16 | k << 8; + int i1 = (255 - k) / 4 << 16 | 16128; + this.renderQuad(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 13, 2, 0); + this.renderQuad(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 12, 1, i1); + this.renderQuad(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, j1, 1, l); + //GL11.glEnable(GL11.GL_BLEND); // Forge: Disable Bled because it screws with a lot of things down the line. + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: + * tessellator, x, y, width, height, color + */ + private void renderQuad(Tessellator p_77017_1_, int p_77017_2_, int p_77017_3_, int p_77017_4_, int p_77017_5_, int p_77017_6_) + { + p_77017_1_.startDrawingQuads(); + p_77017_1_.setColorOpaque_I(p_77017_6_); + p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + 0), 0.0D); + p_77017_1_.addVertex((double)(p_77017_2_ + 0), (double)(p_77017_3_ + p_77017_5_), 0.0D); + p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + p_77017_5_), 0.0D); + p_77017_1_.addVertex((double)(p_77017_2_ + p_77017_4_), (double)(p_77017_3_ + 0), 0.0D); + p_77017_1_.draw(); + } + + public void renderIcon(int p_94149_1_, int p_94149_2_, IIcon p_94149_3_, int p_94149_4_, int p_94149_5_) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double)(p_94149_1_ + 0), (double)(p_94149_2_ + p_94149_5_), (double)this.zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMaxV()); + tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)(p_94149_2_ + p_94149_5_), (double)this.zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMaxV()); + tessellator.addVertexWithUV((double)(p_94149_1_ + p_94149_4_), (double)(p_94149_2_ + 0), (double)this.zLevel, (double)p_94149_3_.getMaxU(), (double)p_94149_3_.getMinV()); + tessellator.addVertexWithUV((double)(p_94149_1_ + 0), (double)(p_94149_2_ + 0), (double)this.zLevel, (double)p_94149_3_.getMinU(), (double)p_94149_3_.getMinV()); + tessellator.draw(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityItem)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 0; --i) + { + adouble[i] = d3; + adouble1[i] = d4; + d3 += (double)(random.nextInt(11) - 5); + d4 += (double)(random.nextInt(11) - 5); + } + + for (int k1 = 0; k1 < 4; ++k1) + { + Random random1 = new Random(p_76986_1_.boltVertex); + + for (int j = 0; j < 3; ++j) + { + int k = 7; + int l = 0; + + if (j > 0) + { + k = 7 - j; + } + + if (j > 0) + { + l = k - 2; + } + + double d5 = adouble[k] - d3; + double d6 = adouble1[k] - d4; + + for (int i1 = k; i1 >= l; --i1) + { + double d7 = d5; + double d8 = d6; + + if (j == 0) + { + d5 += (double)(random1.nextInt(11) - 5); + d6 += (double)(random1.nextInt(11) - 5); + } + else + { + d5 += (double)(random1.nextInt(31) - 15); + d6 += (double)(random1.nextInt(31) - 15); + } + + tessellator.startDrawing(5); + float f2 = 0.5F; + tessellator.setColorRGBA_F(0.9F * f2, 0.9F * f2, 1.0F * f2, 0.3F); + double d9 = 0.1D + (double)k1 * 0.2D; + + if (j == 0) + { + d9 *= (double)i1 * 0.1D + 1.0D; + } + + double d10 = 0.1D + (double)k1 * 0.2D; + + if (j == 0) + { + d10 *= (double)(i1 - 1) * 0.1D + 1.0D; + } + + for (int j1 = 0; j1 < 5; ++j1) + { + double d11 = p_76986_2_ + 0.5D - d9; + double d12 = p_76986_6_ + 0.5D - d9; + + if (j1 == 1 || j1 == 2) + { + d11 += d9 * 2.0D; + } + + if (j1 == 2 || j1 == 3) + { + d12 += d9 * 2.0D; + } + + double d13 = p_76986_2_ + 0.5D - d10; + double d14 = p_76986_6_ + 0.5D - d10; + + if (j1 == 1 || j1 == 2) + { + d13 += d10 * 2.0D; + } + + if (j1 == 2 || j1 == 3) + { + d14 += d10 * 2.0D; + } + + tessellator.addVertex(d13 + d5, p_76986_4_ + (double)(i1 * 16), d14 + d6); + tessellator.addVertex(d11 + d7, p_76986_4_ + (double)((i1 + 1) * 16), d12 + d8); + } + + tessellator.draw(); + } + } + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityLightningBolt p_110775_1_) + { + return null; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityLightningBolt)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float f3 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float f4 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + GL11.glTranslatef(f2, f3, f4); + double d3 = p_76986_1_.lastTickPosX + (p_76986_1_.posX - p_76986_1_.lastTickPosX) * (double)p_76986_9_; + double d4 = p_76986_1_.lastTickPosY + (p_76986_1_.posY - p_76986_1_.lastTickPosY) * (double)p_76986_9_; + double d5 = p_76986_1_.lastTickPosZ + (p_76986_1_.posZ - p_76986_1_.lastTickPosZ) * (double)p_76986_9_; + double d6 = 0.30000001192092896D; + Vec3 vec3 = p_76986_1_.func_70489_a(d3, d4, d5); + float f5 = p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_; + + if (vec3 != null) + { + Vec3 vec31 = p_76986_1_.func_70495_a(d3, d4, d5, d6); + Vec3 vec32 = p_76986_1_.func_70495_a(d3, d4, d5, -d6); + + if (vec31 == null) + { + vec31 = vec3; + } + + if (vec32 == null) + { + vec32 = vec3; + } + + p_76986_2_ += vec3.xCoord - d3; + p_76986_4_ += (vec31.yCoord + vec32.yCoord) / 2.0D - d4; + p_76986_6_ += vec3.zCoord - d5; + Vec3 vec33 = vec32.addVector(-vec31.xCoord, -vec31.yCoord, -vec31.zCoord); + + if (vec33.lengthVector() != 0.0D) + { + vec33 = vec33.normalize(); + p_76986_8_ = (float)(Math.atan2(vec33.zCoord, vec33.xCoord) * 180.0D / Math.PI); + f5 = (float)(Math.atan(vec33.yCoord) * 73.0D); + } + } + + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); + GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-f5, 0.0F, 0.0F, 1.0F); + float f7 = (float)p_76986_1_.getRollingAmplitude() - p_76986_9_; + float f8 = p_76986_1_.getDamage() - p_76986_9_; + + if (f8 < 0.0F) + { + f8 = 0.0F; + } + + if (f7 > 0.0F) + { + GL11.glRotatef(MathHelper.sin(f7) * f7 * f8 / 10.0F * (float)p_76986_1_.getRollingDirection(), 1.0F, 0.0F, 0.0F); + } + + int k = p_76986_1_.getDisplayTileOffset(); + Block block = p_76986_1_.func_145820_n(); + int j = p_76986_1_.getDisplayTileData(); + + if (block.getRenderType() != -1) + { + GL11.glPushMatrix(); + this.bindTexture(TextureMap.locationBlocksTexture); + float f6 = 0.75F; + GL11.glScalef(f6, f6, f6); + GL11.glTranslatef(0.0F, (float)k / 16.0F, 0.0F); + this.func_147910_a(p_76986_1_, p_76986_9_, block, j); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindEntityTexture(p_76986_1_); + } + + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.modelMinecart.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityMinecart p_110775_1_) + { + return minecartTextures; + } + + protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_) + { + float f1 = p_147910_1_.getBrightness(p_147910_2_); + GL11.glPushMatrix(); + this.field_94145_f.renderBlockAsItem(p_147910_3_, p_147910_4_, f1); + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityMinecart)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float f2 = (float)(j >> 8 & 255) / 255.0F; + float f3 = (float)(j & 255) / 255.0F; + GL11.glColor3f(f1, f2, f3); + + if (itemstack.isItemEnchanted()) + { + return 31; + } + + return 16; + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (itemstack.isItemEnchanted()) + { + return 15; + } + + return 1; + } + } + + return -1; + } + + protected void func_82408_c(AbstractClientPlayer p_82408_1_, int p_82408_2_, float p_82408_3_) + { + ItemStack itemstack = p_82408_1_.inventory.armorItemInSlot(3 - p_82408_2_); + + if (itemstack != null) + { + Item item = itemstack.getItem(); + + if (item instanceof ItemArmor) + { + this.bindTexture(RenderBiped.getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) + { + EnumAction enumaction = itemstack.getItemUseAction(); + + if (enumaction == EnumAction.block) + { + this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3; + } + else if (enumaction == EnumAction.bow) + { + this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true; + } + } + + this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = p_76986_1_.isSneaking(); + double d3 = p_76986_4_ - (double)p_76986_1_.yOffset; + + if (p_76986_1_.isSneaking() && !(p_76986_1_ instanceof EntityPlayerSP)) + { + d3 -= 0.125D; + } + + super.doRender((EntityLivingBase)p_76986_1_, p_76986_2_, d3, p_76986_6_, p_76986_8_, p_76986_9_); + this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false; + this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false; + this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0; + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_)); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(AbstractClientPlayer p_110775_1_) + { + return p_110775_1_.getLocationSkin(); + } + + protected void renderEquippedItems(AbstractClientPlayer p_77029_1_, float p_77029_2_) + { + net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre event = new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre(p_77029_1_, this, p_77029_2_); + if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + super.renderEquippedItems(p_77029_1_, p_77029_2_); + super.renderArrowsStuckInEntity(p_77029_1_, p_77029_2_); + ItemStack itemstack = p_77029_1_.inventory.armorItemInSlot(3); + + if (itemstack != null && event.renderHelmet) + { + GL11.glPushMatrix(); + this.modelBipedMain.bipedHead.postRender(0.0625F); + float f1; + + if (itemstack.getItem() instanceof ItemBlock) + { + net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); + + if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + { + f1 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(f1, -f1, -f1); + } + + this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 0); + } + else if (itemstack.getItem() == Items.skull) + { + f1 = 1.0625F; + GL11.glScalef(f1, -f1, -f1); + GameProfile gameprofile = null; + + if (itemstack.hasTagCompound()) + { + NBTTagCompound nbttagcompound = itemstack.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8) && !StringUtils.isNullOrEmpty(nbttagcompound.getString("SkullOwner"))) + { + gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); + } + } + + TileEntitySkullRenderer.field_147536_b.func_152674_a(-0.5F, 0.0F, -0.5F, 1, 180.0F, itemstack.getItemDamage(), gameprofile); + } + + GL11.glPopMatrix(); + } + + float f2; + + if (p_77029_1_.getCommandSenderName().equals("deadmau5") && p_77029_1_.func_152123_o()) + { + this.bindTexture(p_77029_1_.getLocationSkin()); + + for (int j = 0; j < 2; ++j) + { + float f9 = p_77029_1_.prevRotationYaw + (p_77029_1_.rotationYaw - p_77029_1_.prevRotationYaw) * p_77029_2_ - (p_77029_1_.prevRenderYawOffset + (p_77029_1_.renderYawOffset - p_77029_1_.prevRenderYawOffset) * p_77029_2_); + float f10 = p_77029_1_.prevRotationPitch + (p_77029_1_.rotationPitch - p_77029_1_.prevRotationPitch) * p_77029_2_; + GL11.glPushMatrix(); + GL11.glRotatef(f9, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(f10, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.375F * (float)(j * 2 - 1), 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.375F, 0.0F); + GL11.glRotatef(-f10, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-f9, 0.0F, 1.0F, 0.0F); + f2 = 1.3333334F; + GL11.glScalef(f2, f2, f2); + this.modelBipedMain.renderEars(0.0625F); + GL11.glPopMatrix(); + } + } + + boolean flag = p_77029_1_.func_152122_n(); + flag = event.renderCape && flag; + float f4; + + if (flag && !p_77029_1_.isInvisible() && !p_77029_1_.getHideCape()) + { + this.bindTexture(p_77029_1_.getLocationCape()); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.0F, 0.125F); + double d3 = p_77029_1_.field_71091_bM + (p_77029_1_.field_71094_bP - p_77029_1_.field_71091_bM) * (double)p_77029_2_ - (p_77029_1_.prevPosX + (p_77029_1_.posX - p_77029_1_.prevPosX) * (double)p_77029_2_); + double d4 = p_77029_1_.field_71096_bN + (p_77029_1_.field_71095_bQ - p_77029_1_.field_71096_bN) * (double)p_77029_2_ - (p_77029_1_.prevPosY + (p_77029_1_.posY - p_77029_1_.prevPosY) * (double)p_77029_2_); + double d0 = p_77029_1_.field_71097_bO + (p_77029_1_.field_71085_bR - p_77029_1_.field_71097_bO) * (double)p_77029_2_ - (p_77029_1_.prevPosZ + (p_77029_1_.posZ - p_77029_1_.prevPosZ) * (double)p_77029_2_); + f4 = p_77029_1_.prevRenderYawOffset + (p_77029_1_.renderYawOffset - p_77029_1_.prevRenderYawOffset) * p_77029_2_; + double d1 = (double)MathHelper.sin(f4 * (float)Math.PI / 180.0F); + double d2 = (double)(-MathHelper.cos(f4 * (float)Math.PI / 180.0F)); + float f5 = (float)d4 * 10.0F; + + if (f5 < -6.0F) + { + f5 = -6.0F; + } + + if (f5 > 32.0F) + { + f5 = 32.0F; + } + + float f6 = (float)(d3 * d1 + d0 * d2) * 100.0F; + float f7 = (float)(d3 * d2 - d0 * d1) * 100.0F; + + if (f6 < 0.0F) + { + f6 = 0.0F; + } + + float f8 = p_77029_1_.prevCameraYaw + (p_77029_1_.cameraYaw - p_77029_1_.prevCameraYaw) * p_77029_2_; + f5 += MathHelper.sin((p_77029_1_.prevDistanceWalkedModified + (p_77029_1_.distanceWalkedModified - p_77029_1_.prevDistanceWalkedModified) * p_77029_2_) * 6.0F) * 32.0F * f8; + + if (p_77029_1_.isSneaking()) + { + f5 += 25.0F; + } + + GL11.glRotatef(6.0F + f6 / 2.0F + f5, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(f7 / 2.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-f7 / 2.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + this.modelBipedMain.renderCloak(0.0625F); + GL11.glPopMatrix(); + } + + ItemStack itemstack1 = p_77029_1_.inventory.getCurrentItem(); + + if (itemstack1 != null && event.renderItem) + { + GL11.glPushMatrix(); + this.modelBipedMain.bipedRightArm.postRender(0.0625F); + GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); + + if (p_77029_1_.fishEntity != null) + { + itemstack1 = new ItemStack(Items.stick); + } + + EnumAction enumaction = null; + + if (p_77029_1_.getItemInUseCount() > 0) + { + enumaction = itemstack1.getItemUseAction(); + } + + net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack1, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack1, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); + + if (is3D || itemstack1.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack1.getItem()).getRenderType())) + { + f2 = 0.5F; + GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); + f2 *= 0.75F; + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(-f2, -f2, f2); + } + else if (itemstack1.getItem() == Items.bow) + { + f2 = 0.625F; + GL11.glTranslatef(0.0F, 0.125F, 0.3125F); + GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(f2, -f2, f2); + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + } + else if (itemstack1.getItem().isFull3D()) + { + f2 = 0.625F; + + if (itemstack1.getItem().shouldRotateAroundWhenRendering()) + { + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -0.125F, 0.0F); + } + + if (p_77029_1_.getItemInUseCount() > 0 && enumaction == EnumAction.block) + { + GL11.glTranslatef(0.05F, 0.0F, -0.1F); + GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F); + } + + GL11.glTranslatef(0.0F, 0.1875F, 0.0F); + GL11.glScalef(f2, -f2, f2); + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + } + else + { + f2 = 0.375F; + GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); + GL11.glScalef(f2, f2, f2); + GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); + } + + float f3; + int k; + float f12; + + if (itemstack1.getItem().requiresMultipleRenderPasses()) + { + for (k = 0; k < itemstack1.getItem().getRenderPasses(itemstack1.getItemDamage()); ++k) + { + int i = itemstack1.getItem().getColorFromItemStack(itemstack1, k); + f12 = (float)(i >> 16 & 255) / 255.0F; + f3 = (float)(i >> 8 & 255) / 255.0F; + f4 = (float)(i & 255) / 255.0F; + GL11.glColor4f(f12, f3, f4, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack1, k); + } + } + else + { + k = itemstack1.getItem().getColorFromItemStack(itemstack1, 0); + float f11 = (float)(k >> 16 & 255) / 255.0F; + f12 = (float)(k >> 8 & 255) / 255.0F; + f3 = (float)(k & 255) / 255.0F; + GL11.glColor4f(f11, f12, f3, 1.0F); + this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack1, 0); + } + + GL11.glPopMatrix(); + } + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Post(p_77029_1_, this, p_77029_2_)); + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(AbstractClientPlayer p_77041_1_, float p_77041_2_) + { + float f1 = 0.9375F; + GL11.glScalef(f1, f1, f1); + } + + protected void func_96449_a(AbstractClientPlayer p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) + { + if (p_96449_10_ < 100.0D) + { + Scoreboard scoreboard = p_96449_1_.getWorldScoreboard(); + ScoreObjective scoreobjective = scoreboard.func_96539_a(2); + + if (scoreobjective != null) + { + Score score = scoreboard.func_96529_a(p_96449_1_.getCommandSenderName(), scoreobjective); + + if (p_96449_1_.isPlayerSleeping()) + { + this.func_147906_a(p_96449_1_, score.getScorePoints() + " " + scoreobjective.getDisplayName(), p_96449_2_, p_96449_4_ - 1.5D, p_96449_6_, 64); + } + else + { + this.func_147906_a(p_96449_1_, score.getScorePoints() + " " + scoreobjective.getDisplayName(), p_96449_2_, p_96449_4_, p_96449_6_, 64); + } + + p_96449_4_ += (double)((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * p_96449_9_); + } + } + + super.func_96449_a(p_96449_1_, p_96449_2_, p_96449_4_, p_96449_6_, p_96449_8_, p_96449_9_, p_96449_10_); + } + + public void renderFirstPersonArm(EntityPlayer p_82441_1_) + { + float f = 1.0F; + GL11.glColor3f(f, f, f); + this.modelBipedMain.onGround = 0.0F; + this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_); + this.modelBipedMain.bipedRightArm.render(0.0625F); + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(AbstractClientPlayer p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) + { + if (p_77039_1_.isEntityAlive() && p_77039_1_.isPlayerSleeping()) + { + super.renderLivingAt(p_77039_1_, p_77039_2_ + (double)p_77039_1_.field_71079_bU, p_77039_4_ + (double)p_77039_1_.field_71082_cx, p_77039_6_ + (double)p_77039_1_.field_71089_bV); + } + else + { + super.renderLivingAt(p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_); + } + } + + protected void rotateCorpse(AbstractClientPlayer p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + if (p_77043_1_.isEntityAlive() && p_77043_1_.isPlayerSleeping()) + { + GL11.glRotatef(p_77043_1_.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); + } + else + { + super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); + } + } + + protected void func_96449_a(EntityLivingBase p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) + { + this.func_96449_a((AbstractClientPlayer)p_96449_1_, p_96449_2_, p_96449_4_, p_96449_6_, p_96449_8_, p_96449_9_, p_96449_10_); + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) + { + this.preRenderCallback((AbstractClientPlayer)p_77041_1_, p_77041_2_); + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) + { + this.func_82408_c((AbstractClientPlayer)p_82408_1_, p_82408_2_, p_82408_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return this.shouldRenderPass((AbstractClientPlayer)p_77032_1_, p_77032_2_, p_77032_3_); + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) + { + this.renderEquippedItems((AbstractClientPlayer)p_77029_1_, p_77029_2_); + } + + protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + this.rotateCorpse((AbstractClientPlayer)p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) + { + this.renderLivingAt((AbstractClientPlayer)p_77039_1_, p_77039_2_, p_77039_4_, p_77039_6_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float f3 = (float)(i >> 8 & 255) / 255.0F; + float f4 = (float)(i & 255) / 255.0F; + GL11.glColor3f(f2, f3, f4); + GL11.glPushMatrix(); + this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay")); + GL11.glPopMatrix(); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + + this.func_77026_a(tessellator, iicon); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_) + { + float f = p_77026_2_.getMinU(); + float f1 = p_77026_2_.getMaxU(); + float f2 = p_77026_2_.getMinV(); + float f3 = p_77026_2_.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + p_77026_1_.startDrawingQuads(); + p_77026_1_.setNormal(0.0F, 1.0F, 0.0F); + p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); + p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); + p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); + p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); + p_77026_1_.draw(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSpider.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSpider.java new file mode 100644 index 0000000..7ef5464 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSpider.java @@ -0,0 +1,93 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelSpider; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderSpider extends RenderLiving +{ + private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png"); + private static final ResourceLocation spiderTextures = new ResourceLocation("textures/entity/spider/spider.png"); + private static final String __OBFID = "CL_00001027"; + + public RenderSpider() + { + super(new ModelSpider(), 1.0F); + this.setRenderPassModel(new ModelSpider()); + } + + protected float getDeathMaxRotation(EntitySpider p_77037_1_) + { + return 180.0F; + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntitySpider p_77032_1_, int p_77032_2_, float p_77032_3_) + { + if (p_77032_2_ != 0) + { + return -1; + } + else + { + this.bindTexture(spiderEyesTextures); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + + if (p_77032_1_.isInvisible()) + { + GL11.glDepthMask(false); + } + else + { + GL11.glDepthMask(true); + } + + char c0 = 61680; + int j = c0 % 65536; + int k = c0 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + return 1; + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntitySpider p_110775_1_) + { + return spiderTextures; + } + + protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) + { + return this.getDeathMaxRotation((EntitySpider)p_77037_1_); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return this.shouldRenderPass((EntitySpider)p_77032_1_, p_77032_2_, p_77032_3_); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntitySpider)p_110775_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSquid.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSquid.java new file mode 100644 index 0000000..e160479 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderSquid.java @@ -0,0 +1,115 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderSquid extends RenderLiving +{ + private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); + private static final String __OBFID = "CL_00001028"; + + public RenderSquid(ModelBase p_i1268_1_, float p_i1268_2_) + { + super(p_i1268_1_, p_i1268_2_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1.0F) + { + f2 = 1.0F; + } + + f2 *= f2; + f2 *= f2; + float f3 = 1.0F + f2 * 0.3F; + GL11.glScalef(f3, f3, f3); + } + + f2 = (1.0F - ((float)p_76986_1_.fuse - p_76986_9_ + 1.0F) / 100.0F) * 0.8F; + this.bindEntityTexture(p_76986_1_); + this.blockRenderer.renderBlockAsItem(Blocks.tnt, 0, p_76986_1_.getBrightness(p_76986_9_)); + + if (p_76986_1_.fuse / 5 % 2 == 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f2); + this.blockRenderer.renderBlockAsItem(Blocks.tnt, 0, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glPopMatrix(); + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityTNTPrimed p_110775_1_) + { + return TextureMap.locationBlocksTexture; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityTNTPrimed)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render -1 && (float)j - p_147910_2_ + 1.0F < 10.0F) + { + float f1 = 1.0F - ((float)j - p_147910_2_ + 1.0F) / 10.0F; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + f1 *= f1; + f1 *= f1; + float f2 = 1.0F + f1 * 0.3F; + GL11.glScalef(f2, f2, f2); + } + + super.func_147910_a(p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_); + + if (j > -1 && j / 5 % 2 == 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float)j - p_147910_2_ + 1.0F) / 100.0F) * 0.8F); + GL11.glPushMatrix(); + this.field_94145_f.renderBlockAsItem(Blocks.tnt, 0, 1.0F); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + } + + protected void func_147910_a(EntityMinecart p_147910_1_, float p_147910_2_, Block p_147910_3_, int p_147910_4_) + { + this.func_147910_a((EntityMinecartTNT)p_147910_1_, p_147910_2_, p_147910_3_, p_147910_4_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderVillager.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderVillager.java new file mode 100644 index 0000000..4d7b53d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/entity/RenderVillager.java @@ -0,0 +1,162 @@ +package net.minecraft.client.renderer.entity; + +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelVillager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderVillager extends RenderLiving +{ + private static final ResourceLocation villagerTextures = new ResourceLocation("textures/entity/villager/villager.png"); + private static final ResourceLocation farmerVillagerTextures = new ResourceLocation("textures/entity/villager/farmer.png"); + private static final ResourceLocation librarianVillagerTextures = new ResourceLocation("textures/entity/villager/librarian.png"); + private static final ResourceLocation priestVillagerTextures = new ResourceLocation("textures/entity/villager/priest.png"); + private static final ResourceLocation smithVillagerTextures = new ResourceLocation("textures/entity/villager/smith.png"); + private static final ResourceLocation butcherVillagerTextures = new ResourceLocation("textures/entity/villager/butcher.png"); + /** Model of the villager. */ + protected ModelVillager villagerModel; + private static final String __OBFID = "CL_00001032"; + + public RenderVillager() + { + super(new ModelVillager(0.0F), 0.5F); + this.villagerModel = (ModelVillager)this.mainModel; + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityVillager p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return -1; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0 && (i > 80 || i / 5 % 2 != 1) ? invulnerableWitherTextures : witherTextures; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityWither p_77041_1_, float p_77041_2_) + { + int i = p_77041_1_.func_82212_n(); + + if (i > 0) + { + float f1 = 2.0F - ((float)i - p_77041_2_) / 220.0F * 0.5F; + GL11.glScalef(f1, f1, f1); + } + else + { + GL11.glScalef(2.0F, 2.0F, 2.0F); + } + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityWither p_77032_1_, int p_77032_2_, float p_77032_3_) + { + if (p_77032_1_.isArmored()) + { + if (p_77032_1_.isInvisible()) + { + GL11.glDepthMask(false); + } + else + { + GL11.glDepthMask(true); + } + + if (p_77032_2_ == 1) + { + float f1 = (float)p_77032_1_.ticksExisted + p_77032_3_; + this.bindTexture(invulnerableWitherTextures); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f2 = MathHelper.cos(f1 * 0.02F) * 3.0F; + float f3 = f1 * 0.01F; + GL11.glTranslatef(f2, f3, 0.0F); + this.setRenderPassModel(this.mainModel); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_BLEND); + float f4 = 0.5F; + GL11.glColor4f(f4, f4, f4, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glTranslatef(0.0F, -0.01F, 0.0F); + GL11.glScalef(1.1F, 1.1F, 1.1F); + return 1; + } + + if (p_77032_2_ == 2) + { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + } + + return -1; + } + + protected int inheritRenderPass(EntityWither p_77035_1_, int p_77035_2_, float p_77035_3_) + { + return -1; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 180.0F) + { + f3 -= 360.0F; + } + + return p_77034_1_ + p_77034_3_ * f3; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 85.0F) + { + f4 = 85.0F; + } + + f2 = f3 - f4; + + if (f4 * f4 > 2500.0F) + { + f2 += f4 * 0.2F; + } + } + + float f13 = p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_; + this.renderLivingAt(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + f4 = this.handleRotationFloat(p_76986_1_, p_76986_9_); + this.rotateCorpse(p_76986_1_, f4, f2, p_76986_9_); + float f5 = 0.0625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.preRenderCallback(p_76986_1_, p_76986_9_); + GL11.glTranslatef(0.0F, -24.0F * f5 - 0.0078125F, 0.0F); + float f6 = p_76986_1_.prevLimbSwingAmount + (p_76986_1_.limbSwingAmount - p_76986_1_.prevLimbSwingAmount) * p_76986_9_; + float f7 = p_76986_1_.limbSwing - p_76986_1_.limbSwingAmount * (1.0F - p_76986_9_); + + if (p_76986_1_.isChild()) + { + f7 *= 3.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + this.mainModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_); + this.renderModel(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + int j; + float f8; + float f9; + float f10; + + for (int i = 0; i < 4; ++i) + { + j = this.shouldRenderPass(p_76986_1_, i, p_76986_9_); + + if (j > 0) + { + this.renderPassModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + if ((j & 240) == 16) + { + this.func_82408_c(p_76986_1_, i, p_76986_9_); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + if ((j & 15) == 15) + { + f8 = (float)p_76986_1_.ticksExisted + p_76986_9_; + this.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + f9 = 0.5F; + GL11.glColor4f(f9, f9, f9, 1.0F); + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDepthMask(false); + + for (int k = 0; k < 2; ++k) + { + GL11.glDisable(GL11.GL_LIGHTING); + f10 = 0.76F; + GL11.glColor4f(0.5F * f10, 0.25F * f10, 0.8F * f10, 1.0F); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f11 = f8 * (0.001F + (float)k * 0.003F) * 20.0F; + float f12 = 0.33333334F; + GL11.glScalef(f12, f12, f12); + GL11.glRotatef(30.0F - (float)k * 60.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, f11, 0.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glDepthMask(true); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } + + GL11.glDepthMask(true); + this.renderEquippedItems(p_76986_1_, p_76986_9_); + float f14 = p_76986_1_.getBrightness(p_76986_9_); + j = this.getColorMultiplier(p_76986_1_, f14, p_76986_9_); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if ((j >> 24 & 255) > 0 || p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthFunc(GL11.GL_EQUAL); + + if (p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) + { + GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F); + this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + for (int l = 0; l < 4; ++l) + { + if (this.inheritRenderPass(p_76986_1_, l, p_76986_9_) >= 0) + { + GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + } + } + + if ((j >> 24 & 255) > 0) + { + f8 = (float)(j >> 16 & 255) / 255.0F; + f9 = (float)(j >> 8 & 255) / 255.0F; + float f15 = (float)(j & 255) / 255.0F; + f10 = (float)(j >> 24 & 255) / 255.0F; + GL11.glColor4f(f8, f9, f15, f10); + this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + for (int i1 = 0; i1 < 4; ++i1) + { + if (this.inheritRenderPass(p_76986_1_, i1, p_76986_9_) >= 0) + { + GL11.glColor4f(f8, f9, f15, f10); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + } + } + + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + catch (Exception exception) + { + logger.error("Couldn\'t render entity", exception); + } + + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + this.passSpecialRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_)); + } + + /** + * Renders the model in RenderLiving + */ + protected void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) + { + this.bindEntityTexture(p_77036_1_); + + if (!p_77036_1_.isInvisible()) + { + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + } + else if (!p_77036_1_.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) + { + GL11.glPushMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + this.mainModel.render(p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glPopMatrix(); + GL11.glDepthMask(true); + } + else + { + this.mainModel.setRotationAngles(p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_, p_77036_1_); + } + } + + /** + * Sets a simple glTranslate on a LivingEntity. + */ + protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) + { + GL11.glTranslatef((float)p_77039_2_, (float)p_77039_4_, (float)p_77039_6_); + } + + protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + + if (p_77043_1_.deathTime > 0) + { + float f3 = ((float)p_77043_1_.deathTime + p_77043_4_ - 1.0F) / 20.0F * 1.6F; + f3 = MathHelper.sqrt_float(f3); + + if (f3 > 1.0F) + { + f3 = 1.0F; + } + + GL11.glRotatef(f3 * this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + } + else + { + String s = EnumChatFormatting.getTextWithoutFormattingCodes(p_77043_1_.getCommandSenderName()); + + if ((s.equals("Dinnerbone") || s.equals("Grumm")) && (!(p_77043_1_ instanceof EntityPlayer) || !((EntityPlayer)p_77043_1_).getHideCape())) + { + GL11.glTranslatef(0.0F, p_77043_1_.height + 0.1F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + } + } + } + + protected float renderSwingProgress(EntityLivingBase p_77040_1_, float p_77040_2_) + { + return p_77040_1_.getSwingProgress(p_77040_2_); + } + + /** + * Defines what float the third param in setRotationAngles of ModelBase is + */ + protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) + { + return (float)p_77044_1_.ticksExisted + p_77044_2_; + } + + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {} + + /** + * renders arrows the Entity has been attacked with, attached to it + */ + protected void renderArrowsStuckInEntity(EntityLivingBase p_85093_1_, float p_85093_2_) + { + int i = p_85093_1_.getArrowCountInEntity(); + + if (i > 0) + { + EntityArrow entityarrow = new EntityArrow(p_85093_1_.worldObj, p_85093_1_.posX, p_85093_1_.posY, p_85093_1_.posZ); + Random random = new Random((long)p_85093_1_.getEntityId()); + RenderHelper.disableStandardItemLighting(); + + for (int j = 0; j < i; ++j) + { + GL11.glPushMatrix(); + ModelRenderer modelrenderer = this.mainModel.getRandomModelBox(random); + ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size())); + modelrenderer.postRender(0.0625F); + float f1 = random.nextFloat(); + float f2 = random.nextFloat(); + float f3 = random.nextFloat(); + float f4 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f1) / 16.0F; + float f5 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f2) / 16.0F; + float f6 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f3) / 16.0F; + GL11.glTranslatef(f4, f5, f6); + f1 = f1 * 2.0F - 1.0F; + f2 = f2 * 2.0F - 1.0F; + f3 = f3 * 2.0F - 1.0F; + f1 *= -1.0F; + f2 *= -1.0F; + f3 *= -1.0F; + float f7 = MathHelper.sqrt_float(f1 * f1 + f3 * f3); + entityarrow.prevRotationYaw = entityarrow.rotationYaw = (float)(Math.atan2((double)f1, (double)f3) * 180.0D / Math.PI); + entityarrow.prevRotationPitch = entityarrow.rotationPitch = (float)(Math.atan2((double)f2, (double)f7) * 180.0D / Math.PI); + double d0 = 0.0D; + double d1 = 0.0D; + double d2 = 0.0D; + float f8 = 0.0F; + this.renderManager.renderEntityWithPosYaw(entityarrow, d0, d1, d2, f8, p_85093_2_); + GL11.glPopMatrix(); + } + + RenderHelper.enableStandardItemLighting(); + } + } + + protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_) + { + return this.shouldRenderPass(p_77035_1_, p_77035_2_, p_77035_3_); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) + { + return -1; + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) {} + + protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) + { + return 90.0F; + } + + /** + * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime + */ + protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) + { + return 0; + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {} + + /** + * Passes the specialRender and renders it + */ + protected void passSpecialRender(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_) + { + if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_))) return; + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + if (this.func_110813_b(p_77033_1_)) + { + float f = 1.6F; + float f1 = 0.016666668F * f; + double d3 = p_77033_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + float f2 = p_77033_1_.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + + if (d3 < (double)(f2 * f2)) + { + String s = p_77033_1_.func_145748_c_().getFormattedText(); + + if (p_77033_1_.isSneaking()) + { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_77033_2_ + 0.0F, (float)p_77033_4_ + p_77033_1_.height + 0.5F, (float)p_77033_6_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-f1, -f1, f1); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + int i = fontrenderer.getStringWidth(s) / 2; + tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + tessellator.addVertex((double)(-i - 1), -1.0D, 0.0D); + tessellator.addVertex((double)(-i - 1), 8.0D, 0.0D); + tessellator.addVertex((double)(i + 1), 8.0D, 0.0D); + tessellator.addVertex((double)(i + 1), -1.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + else + { + this.func_96449_a(p_77033_1_, p_77033_2_, p_77033_4_, p_77033_6_, s, f1, d3); + } + } + } + MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_)); + } + + protected boolean func_110813_b(EntityLivingBase targetEntity) + { + return Minecraft.isGuiEnabled() && targetEntity != this.renderManager.livingPlayer && !targetEntity.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && targetEntity.riddenByEntity == null; + } + + protected void func_96449_a(EntityLivingBase p_96449_1_, double p_96449_2_, double p_96449_4_, double p_96449_6_, String p_96449_8_, float p_96449_9_, double p_96449_10_) + { + if (p_96449_1_.isPlayerSleeping()) + { + this.func_147906_a(p_96449_1_, p_96449_8_, p_96449_2_, p_96449_4_ - 1.5D, p_96449_6_, 64); + } + else + { + this.func_147906_a(p_96449_1_, p_96449_8_, p_96449_2_, p_96449_4_, p_96449_6_, 64); + } + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) + { + holder.setNewDimension(this.maxTileDimension); + } + + this.setStitchHolders.add(holder); + } + + public void doStitch() + { + Stitcher.Holder[] aholder = (Stitcher.Holder[])this.setStitchHolders.toArray(new Stitcher.Holder[this.setStitchHolders.size()]); + cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Texture stitching", aholder.length); + Arrays.sort(aholder); + Stitcher.Holder[] aholder1 = aholder; + int i = aholder.length; + + for (int j = 0; j < i; ++j) + { + Stitcher.Holder holder = aholder1[j]; + bar.step(holder.getAtlasSprite().getIconName()); + + if (!this.allocateSlot(holder)) + { + String s = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution resourcepack?", new Object[] {holder.getAtlasSprite().getIconName(), Integer.valueOf(holder.getAtlasSprite().getIconWidth()), Integer.valueOf(holder.getAtlasSprite().getIconHeight())}); + throw new StitcherException(holder, s); + } + } + + if (this.forcePowerOf2) + { + this.currentWidth = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + this.currentHeight = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + } + cpw.mods.fml.common.ProgressManager.pop(bar); + } + + public List getStichSlots() + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.stitchSlots.iterator(); + + while (iterator.hasNext()) + { + Stitcher.Slot slot = (Stitcher.Slot)iterator.next(); + slot.getAllStitchSlots(arraylist); + } + + ArrayList arraylist1 = Lists.newArrayList(); + Iterator iterator1 = arraylist.iterator(); + + while (iterator1.hasNext()) + { + Stitcher.Slot slot1 = (Stitcher.Slot)iterator1.next(); + Stitcher.Holder holder = slot1.getStitchHolder(); + TextureAtlasSprite textureatlassprite = holder.getAtlasSprite(); + textureatlassprite.initSprite(this.currentWidth, this.currentHeight, slot1.getOriginX(), slot1.getOriginY(), holder.isRotated()); + arraylist1.add(textureatlassprite); + } + + return arraylist1; + } + + private static int getMipmapDimension(int p_147969_0_, int p_147969_1_) + { + return (p_147969_0_ >> p_147969_1_) + ((p_147969_0_ & (1 << p_147969_1_) - 1) == 0 ? 0 : 1) << p_147969_1_; + } + + /** + * Attempts to find space for specified tile + */ + private boolean allocateSlot(Stitcher.Holder p_94310_1_) + { + for (int i = 0; i < this.stitchSlots.size(); ++i) + { + if (((Stitcher.Slot)this.stitchSlots.get(i)).addSlot(p_94310_1_)) + { + return true; + } + + p_94310_1_.rotate(); + + if (((Stitcher.Slot)this.stitchSlots.get(i)).addSlot(p_94310_1_)) + { + return true; + } + + p_94310_1_.rotate(); + } + + return this.expandAndAllocateSlot(p_94310_1_); + } + + /** + * Expand stitched texture in order to make space for specified tile + */ + private boolean expandAndAllocateSlot(Stitcher.Holder p_94311_1_) + { + int i = Math.min(p_94311_1_.getWidth(), p_94311_1_.getHeight()); + boolean flag = this.currentWidth == 0 && this.currentHeight == 0; + boolean flag1; + int j; + + if (this.forcePowerOf2) + { + j = MathHelper.roundUpToPowerOfTwo(this.currentWidth); + int k = MathHelper.roundUpToPowerOfTwo(this.currentHeight); + int l = MathHelper.roundUpToPowerOfTwo(this.currentWidth + i); + int i1 = MathHelper.roundUpToPowerOfTwo(this.currentHeight + i); + boolean flag2 = l <= this.maxWidth; + boolean flag3 = i1 <= this.maxHeight; + + if (!flag2 && !flag3) + { + return false; + } + + boolean flag4 = j != l; + boolean flag5 = k != i1; + + if (flag4 ^ flag5) + { + flag1 = !flag4; + } + else + { + flag1 = flag2 && j <= k; + } + } + else + { + boolean flag6 = this.currentWidth + i <= this.maxWidth; + boolean flag7 = this.currentHeight + i <= this.maxHeight; + + if (!flag6 && !flag7) + { + return false; + } + + flag1 = flag6 && (flag || this.currentWidth <= this.currentHeight); + } + + j = Math.max(p_94311_1_.getWidth(), p_94311_1_.getHeight()); + + if (MathHelper.roundUpToPowerOfTwo((flag1 ? this.currentHeight : this.currentWidth) + j) > (flag1 ? this.maxHeight : this.maxWidth)) + { + return false; + } + else + { + Stitcher.Slot slot; + + if (flag1) + { + if (p_94311_1_.getWidth() > p_94311_1_.getHeight()) + { + p_94311_1_.rotate(); + } + + if (this.currentHeight == 0) + { + this.currentHeight = p_94311_1_.getHeight(); + } + + slot = new Stitcher.Slot(this.currentWidth, 0, p_94311_1_.getWidth(), this.currentHeight); + this.currentWidth += p_94311_1_.getWidth(); + } + else + { + slot = new Stitcher.Slot(0, this.currentHeight, this.currentWidth, p_94311_1_.getHeight()); + this.currentHeight += p_94311_1_.getHeight(); + } + + slot.addSlot(p_94311_1_); + this.stitchSlots.add(slot); + return true; + } + } + + @SideOnly(Side.CLIENT) + public static class Holder implements Comparable + { + private final TextureAtlasSprite theTexture; + private final int width; + private final int height; + private final int mipmapLevelHolder; + private boolean rotated; + private float scaleFactor = 1.0F; + private static final String __OBFID = "CL_00001055"; + + public Holder(TextureAtlasSprite p_i45094_1_, int p_i45094_2_) + { + this.theTexture = p_i45094_1_; + this.width = p_i45094_1_.getIconWidth(); + this.height = p_i45094_1_.getIconHeight(); + this.mipmapLevelHolder = p_i45094_2_; + this.rotated = Stitcher.getMipmapDimension(this.height, p_i45094_2_) > Stitcher.getMipmapDimension(this.width, p_i45094_2_); + } + + public TextureAtlasSprite getAtlasSprite() + { + return this.theTexture; + } + + public int getWidth() + { + return this.rotated ? Stitcher.getMipmapDimension((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.getMipmapDimension((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder); + } + + public int getHeight() + { + return this.rotated ? Stitcher.getMipmapDimension((int)((float)this.width * this.scaleFactor), this.mipmapLevelHolder) : Stitcher.getMipmapDimension((int)((float)this.height * this.scaleFactor), this.mipmapLevelHolder); + } + + public void rotate() + { + this.rotated = !this.rotated; + } + + public boolean isRotated() + { + return this.rotated; + } + + public void setNewDimension(int p_94196_1_) + { + if (this.width > p_94196_1_ && this.height > p_94196_1_) + { + this.scaleFactor = (float)p_94196_1_ / (float)Math.min(this.width, this.height); + } + } + + public String toString() + { + return "Holder{width=" + this.width + ", height=" + this.height + '}'; + } + + public int compareTo(Stitcher.Holder p_compareTo_1_) + { + int i; + + if (this.getHeight() == p_compareTo_1_.getHeight()) + { + if (this.getWidth() == p_compareTo_1_.getWidth()) + { + if (this.theTexture.getIconName() == null) + { + return p_compareTo_1_.theTexture.getIconName() == null ? 0 : -1; + } + + return this.theTexture.getIconName().compareTo(p_compareTo_1_.theTexture.getIconName()); + } + + i = this.getWidth() < p_compareTo_1_.getWidth() ? 1 : -1; + } + else + { + i = this.getHeight() < p_compareTo_1_.getHeight() ? 1 : -1; + } + + return i; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((Stitcher.Holder)p_compareTo_1_); + } + } + + @SideOnly(Side.CLIENT) + public static class Slot + { + private final int originX; + private final int originY; + private final int width; + private final int height; + private List subSlots; + private Stitcher.Holder holder; + private static final String __OBFID = "CL_00001056"; + + public Slot(int p_i1277_1_, int p_i1277_2_, int p_i1277_3_, int p_i1277_4_) + { + this.originX = p_i1277_1_; + this.originY = p_i1277_2_; + this.width = p_i1277_3_; + this.height = p_i1277_4_; + } + + public Stitcher.Holder getStitchHolder() + { + return this.holder; + } + + public int getOriginX() + { + return this.originX; + } + + public int getOriginY() + { + return this.originY; + } + + public boolean addSlot(Stitcher.Holder p_94182_1_) + { + if (this.holder != null) + { + return false; + } + else + { + int i = p_94182_1_.getWidth(); + int j = p_94182_1_.getHeight(); + + if (i <= this.width && j <= this.height) + { + if (i == this.width && j == this.height) + { + this.holder = p_94182_1_; + return true; + } + else + { + if (this.subSlots == null) + { + this.subSlots = new ArrayList(1); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY, i, j)); + int k = this.width - i; + int l = this.height - j; + + if (l > 0 && k > 0) + { + int i1 = Math.max(this.height, k); + int j1 = Math.max(this.width, l); + + if (i1 >= j1) + { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, i, l)); + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, this.height)); + } + else + { + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, j)); + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, this.width, l)); + } + } + else if (k == 0) + { + this.subSlots.add(new Stitcher.Slot(this.originX, this.originY + j, i, l)); + } + else if (l == 0) + { + this.subSlots.add(new Stitcher.Slot(this.originX + i, this.originY, k, j)); + } + } + + Iterator iterator = this.subSlots.iterator(); + Stitcher.Slot slot; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + slot = (Stitcher.Slot)iterator.next(); + } + while (!slot.addSlot(p_94182_1_)); + + return true; + } + } + else + { + return false; + } + } + } + + /** + * Gets the slot and all its subslots + */ + public void getAllStitchSlots(List p_94184_1_) + { + if (this.holder != null) + { + p_94184_1_.add(this); + } + else if (this.subSlots != null) + { + Iterator iterator = this.subSlots.iterator(); + + while (iterator.hasNext()) + { + Stitcher.Slot slot = (Stitcher.Slot)iterator.next(); + slot.getAllStitchSlots(p_94184_1_); + } + } + } + + public String toString() + { + return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}'; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java new file mode 100644 index 0000000..d5e86c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureAtlasSprite.java @@ -0,0 +1,486 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationFrame; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.IIcon; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class TextureAtlasSprite implements IIcon +{ + private final String iconName; + protected List framesTextureData = Lists.newArrayList(); + private AnimationMetadataSection animationMetadata; + protected boolean rotated; + private boolean useAnisotropicFiltering; + protected int originX; + protected int originY; + protected int width; + protected int height; + private float minU; + private float maxU; + private float minV; + private float maxV; + protected int frameCounter; + protected int tickCounter; + private static final String __OBFID = "CL_00001062"; + + protected TextureAtlasSprite(String p_i1282_1_) + { + this.iconName = p_i1282_1_; + } + + public void initSprite(int p_110971_1_, int p_110971_2_, int p_110971_3_, int p_110971_4_, boolean p_110971_5_) + { + this.originX = p_110971_3_; + this.originY = p_110971_4_; + this.rotated = p_110971_5_; + float f = (float)(0.009999999776482582D / (double)p_110971_1_); + float f1 = (float)(0.009999999776482582D / (double)p_110971_2_); + this.minU = (float)p_110971_3_ / (float)((double)p_110971_1_) + f; + this.maxU = (float)(p_110971_3_ + this.width) / (float)((double)p_110971_1_) - f; + this.minV = (float)p_110971_4_ / (float)p_110971_2_ + f1; + this.maxV = (float)(p_110971_4_ + this.height) / (float)p_110971_2_ - f1; + + if (this.useAnisotropicFiltering) + { + float f2 = 8.0F / (float)p_110971_1_; + float f3 = 8.0F / (float)p_110971_2_; + this.minU += f2; + this.maxU -= f2; + this.minV += f3; + this.maxV -= f3; + } + } + + public void copyFrom(TextureAtlasSprite p_94217_1_) + { + this.originX = p_94217_1_.originX; + this.originY = p_94217_1_.originY; + this.width = p_94217_1_.width; + this.height = p_94217_1_.height; + this.rotated = p_94217_1_.rotated; + this.minU = p_94217_1_.minU; + this.maxU = p_94217_1_.maxU; + this.minV = p_94217_1_.minV; + this.maxV = p_94217_1_.maxV; + } + + /** + * Returns the X position of this icon on its texture sheet, in pixels. + */ + public int getOriginX() + { + return this.originX; + } + + /** + * Returns the Y position of this icon on its texture sheet, in pixels. + */ + public int getOriginY() + { + return this.originY; + } + + /** + * Returns the width of the icon, in pixels. + */ + public int getIconWidth() + { + return this.width; + } + + /** + * Returns the height of the icon, in pixels. + */ + public int getIconHeight() + { + return this.height; + } + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + public float getMinU() + { + return this.minU; + } + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + public float getMaxU() + { + return this.maxU; + } + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + public float getInterpolatedU(double p_94214_1_) + { + float f = this.maxU - this.minU; + return this.minU + f * (float)p_94214_1_ / 16.0F; + } + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + public float getMinV() + { + return this.minV; + } + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + public float getMaxV() + { + return this.maxV; + } + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + public float getInterpolatedV(double p_94207_1_) + { + float f = this.maxV - this.minV; + return this.minV + f * ((float)p_94207_1_ / 16.0F); + } + + public String getIconName() + { + return this.iconName; + } + + public void updateAnimation() + { + ++this.tickCounter; + + if (this.tickCounter >= this.animationMetadata.getFrameTimeSingle(this.frameCounter)) + { + int i = this.animationMetadata.getFrameIndex(this.frameCounter); + int j = this.animationMetadata.getFrameCount() == 0 ? this.framesTextureData.size() : this.animationMetadata.getFrameCount(); + this.frameCounter = (this.frameCounter + 1) % j; + this.tickCounter = 0; + int k = this.animationMetadata.getFrameIndex(this.frameCounter); + + if (i != k && k >= 0 && k < this.framesTextureData.size()) + { + TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(k), this.width, this.height, this.originX, this.originY, false, false); + } + } + } + + public int[][] getFrameTextureData(int p_147965_1_) + { + return (int[][])this.framesTextureData.get(p_147965_1_); + } + + public int getFrameCount() + { + return this.framesTextureData.size(); + } + + public void setIconWidth(int p_110966_1_) + { + this.width = p_110966_1_; + } + + public void setIconHeight(int p_110969_1_) + { + this.height = p_110969_1_; + } + + public void loadSprite(BufferedImage[] p_147964_1_, AnimationMetadataSection p_147964_2_, boolean p_147964_3_) + { + this.resetSprite(); + this.useAnisotropicFiltering = p_147964_3_; + int i = p_147964_1_[0].getWidth(); + int j = p_147964_1_[0].getHeight(); + this.width = i; + this.height = j; + + if (p_147964_3_) + { + this.width += 16; + this.height += 16; + } + + int[][] aint = new int[p_147964_1_.length][]; + int k; + + for (k = 0; k < p_147964_1_.length; ++k) + { + BufferedImage bufferedimage = p_147964_1_[k]; + + if (bufferedimage != null) + { + if (k > 0 && (bufferedimage.getWidth() != i >> k || bufferedimage.getHeight() != j >> k)) + { + throw new RuntimeException(String.format("Unable to load miplevel: %d, image is size: %dx%d, expected %dx%d", new Object[] {Integer.valueOf(k), Integer.valueOf(bufferedimage.getWidth()), Integer.valueOf(bufferedimage.getHeight()), Integer.valueOf(i >> k), Integer.valueOf(j >> k)})); + } + + aint[k] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()]; + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[k], 0, bufferedimage.getWidth()); + } + } + + if (p_147964_2_ == null) + { + if (j != i) + { + throw new RuntimeException("broken aspect ratio and not an animation"); + } + + this.fixTransparentPixels(aint); + this.framesTextureData.add(this.prepareAnisotropicFiltering(aint, i, j)); + } + else + { + k = j / i; + int j1 = i; + int l = i; + this.height = this.width; + int i1; + + if (p_147964_2_.getFrameCount() > 0) + { + Iterator iterator = p_147964_2_.getFrameIndexSet().iterator(); + + while (iterator.hasNext()) + { + i1 = ((Integer)iterator.next()).intValue(); + + if (i1 >= k) + { + throw new RuntimeException("invalid frameindex " + i1); + } + + this.allocateFrameTextureData(i1); + this.framesTextureData.set(i1, this.prepareAnisotropicFiltering(getFrameTextureData(aint, j1, l, i1), j1, l)); + } + + this.animationMetadata = p_147964_2_; + } + else + { + ArrayList arraylist = Lists.newArrayList(); + + for (i1 = 0; i1 < k; ++i1) + { + this.framesTextureData.add(this.prepareAnisotropicFiltering(getFrameTextureData(aint, j1, l, i1), j1, l)); + arraylist.add(new AnimationFrame(i1, -1)); + } + + this.animationMetadata = new AnimationMetadataSection(arraylist, this.width, this.height, p_147964_2_.getFrameTime()); + } + } + } + + public void generateMipmaps(int p_147963_1_) + { + ArrayList arraylist = Lists.newArrayList(); + + for (int j = 0; j < this.framesTextureData.size(); ++j) + { + final int[][] aint = (int[][])this.framesTextureData.get(j); + + if (aint != null) + { + try + { + arraylist.add(TextureUtil.generateMipmapData(p_147963_1_, this.width, aint)); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Generating mipmaps for frame"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Frame being iterated"); + crashreportcategory.addCrashSection("Frame index", Integer.valueOf(j)); + crashreportcategory.addCrashSectionCallable("Frame sizes", new Callable() + { + private static final String __OBFID = "CL_00001063"; + public String call() + { + StringBuilder stringbuilder = new StringBuilder(); + int[][] aint1 = aint; + int k = aint1.length; + + for (int l = 0; l < k; ++l) + { + int[] aint2 = aint1[l]; + + if (stringbuilder.length() > 0) + { + stringbuilder.append(", "); + } + + stringbuilder.append(aint2 == null ? "null" : Integer.valueOf(aint2.length)); + } + + return stringbuilder.toString(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + this.setFramesTextureData(arraylist); + } + + private void fixTransparentPixels(int[][] p_147961_1_) + { + int[] aint1 = p_147961_1_[0]; + int i = 0; + int j = 0; + int k = 0; + int l = 0; + int i1; + + for (i1 = 0; i1 < aint1.length; ++i1) + { + if ((aint1[i1] & -16777216) != 0) + { + j += aint1[i1] >> 16 & 255; + k += aint1[i1] >> 8 & 255; + l += aint1[i1] >> 0 & 255; + ++i; + } + } + + if (i != 0) + { + j /= i; + k /= i; + l /= i; + + for (i1 = 0; i1 < aint1.length; ++i1) + { + if ((aint1[i1] & -16777216) == 0) + { + aint1[i1] = j << 16 | k << 8 | l; + } + } + } + } + + private int[][] prepareAnisotropicFiltering(int[][] p_147960_1_, int p_147960_2_, int p_147960_3_) + { + if (!this.useAnisotropicFiltering) + { + return p_147960_1_; + } + else + { + int[][] aint1 = new int[p_147960_1_.length][]; + + for (int k = 0; k < p_147960_1_.length; ++k) + { + int[] aint2 = p_147960_1_[k]; + + if (aint2 != null) + { + int[] aint3 = new int[(p_147960_2_ + 16 >> k) * (p_147960_3_ + 16 >> k)]; + System.arraycopy(aint2, 0, aint3, 0, aint2.length); + aint1[k] = TextureUtil.prepareAnisotropicData(aint3, p_147960_2_ >> k, p_147960_3_ >> k, 8 >> k); + } + } + + return aint1; + } + } + + private void allocateFrameTextureData(int p_130099_1_) + { + if (this.framesTextureData.size() <= p_130099_1_) + { + for (int j = this.framesTextureData.size(); j <= p_130099_1_; ++j) + { + this.framesTextureData.add((Object)null); + } + } + } + + private static int[][] getFrameTextureData(int[][] p_147962_0_, int p_147962_1_, int p_147962_2_, int p_147962_3_) + { + int[][] aint1 = new int[p_147962_0_.length][]; + + for (int l = 0; l < p_147962_0_.length; ++l) + { + int[] aint2 = p_147962_0_[l]; + + if (aint2 != null) + { + aint1[l] = new int[(p_147962_1_ >> l) * (p_147962_2_ >> l)]; + System.arraycopy(aint2, p_147962_3_ * aint1[l].length, aint1[l], 0, aint1[l].length); + } + } + + return aint1; + } + + public void clearFramesTextureData() + { + this.framesTextureData.clear(); + } + + public boolean hasAnimationMetadata() + { + return this.animationMetadata != null; + } + + public void setFramesTextureData(List p_110968_1_) + { + this.framesTextureData = p_110968_1_; + } + + private void resetSprite() + { + this.animationMetadata = null; + this.setFramesTextureData(Lists.newArrayList()); + this.frameCounter = 0; + this.tickCounter = 0; + } + + public String toString() + { + return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; + } + + /** + * The result of this function determines is the below 'load' function is called, and the + * default vanilla loading code is bypassed completely. + * @param manager + * @param location + * @return True to use your own custom load code and bypass vanilla loading. + */ + public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) + { + return false; + } + + /** + * Load the specified resource as this sprite's data. + * Returning false from this function will prevent this icon from being stitched onto the master texture. + * @param manager Main resource manager + * @param location File resource location + * @return False to prevent this Icon from being stitched + */ + public boolean load(IResourceManager manager, ResourceLocation location) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureClock.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureClock.java new file mode 100644 index 0000000..349e60c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureClock.java @@ -0,0 +1,76 @@ +package net.minecraft.client.renderer.texture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; + +@SideOnly(Side.CLIENT) +public class TextureClock extends TextureAtlasSprite +{ + private double field_94239_h; + private double field_94240_i; + private static final String __OBFID = "CL_00001070"; + + public TextureClock(String p_i1285_1_) + { + super(p_i1285_1_); + } + + public void updateAnimation() + { + if (!this.framesTextureData.isEmpty()) + { + Minecraft minecraft = Minecraft.getMinecraft(); + double d0 = 0.0D; + + if (minecraft.theWorld != null && minecraft.thePlayer != null) + { + float f = minecraft.theWorld.getCelestialAngle(1.0F); + d0 = (double)f; + + if (!minecraft.theWorld.provider.isSurfaceWorld()) + { + d0 = Math.random(); + } + } + + double d1; + + for (d1 = d0 - this.field_94239_h; d1 < -0.5D; ++d1) + { + ; + } + + while (d1 >= 0.5D) + { + --d1; + } + + if (d1 < -1.0D) + { + d1 = -1.0D; + } + + if (d1 > 1.0D) + { + d1 = 1.0D; + } + + this.field_94240_i += d1 * 0.1D; + this.field_94240_i *= 0.8D; + this.field_94239_h += this.field_94240_i; + int i; + + for (i = (int)((this.field_94239_h + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size()) + { + ; + } + + if (i != this.frameCounter) + { + this.frameCounter = i; + TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureCompass.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureCompass.java new file mode 100644 index 0000000..0f10ccf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureCompass.java @@ -0,0 +1,107 @@ +package net.minecraft.client.renderer.texture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public class TextureCompass extends TextureAtlasSprite +{ + /** Current compass heading in radians */ + public double currentAngle; + /** Speed and direction of compass rotation */ + public double angleDelta; + private static final String __OBFID = "CL_00001071"; + + public TextureCompass(String p_i1286_1_) + { + super(p_i1286_1_); + } + + public void updateAnimation() + { + Minecraft minecraft = Minecraft.getMinecraft(); + + if (minecraft.theWorld != null && minecraft.thePlayer != null) + { + this.updateCompass(minecraft.theWorld, minecraft.thePlayer.posX, minecraft.thePlayer.posZ, (double)minecraft.thePlayer.rotationYaw, false, false); + } + else + { + this.updateCompass((World)null, 0.0D, 0.0D, 0.0D, true, false); + } + } + + /** + * Updates the compass based on the given x,z coords and camera direction + */ + public void updateCompass(World p_94241_1_, double p_94241_2_, double p_94241_4_, double p_94241_6_, boolean p_94241_8_, boolean p_94241_9_) + { + if (!this.framesTextureData.isEmpty()) + { + double d3 = 0.0D; + + if (p_94241_1_ != null && !p_94241_8_) + { + ChunkCoordinates chunkcoordinates = p_94241_1_.getSpawnPoint(); + double d4 = (double)chunkcoordinates.posX - p_94241_2_; + double d5 = (double)chunkcoordinates.posZ - p_94241_4_; + p_94241_6_ %= 360.0D; + d3 = -((p_94241_6_ - 90.0D) * Math.PI / 180.0D - Math.atan2(d5, d4)); + + if (!p_94241_1_.provider.isSurfaceWorld()) + { + d3 = Math.random() * Math.PI * 2.0D; + } + } + + if (p_94241_9_) + { + this.currentAngle = d3; + } + else + { + double d6; + + for (d6 = d3 - this.currentAngle; d6 < -Math.PI; d6 += (Math.PI * 2D)) + { + ; + } + + while (d6 >= Math.PI) + { + d6 -= (Math.PI * 2D); + } + + if (d6 < -1.0D) + { + d6 = -1.0D; + } + + if (d6 > 1.0D) + { + d6 = 1.0D; + } + + this.angleDelta += d6 * 0.1D; + this.angleDelta *= 0.8D; + this.currentAngle += this.angleDelta; + } + + int i; + + for (i = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); i < 0; i = (i + this.framesTextureData.size()) % this.framesTextureData.size()) + { + ; + } + + if (i != this.frameCounter) + { + this.frameCounter = i; + TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureManager.java new file mode 100644 index 0000000..02d6e11 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureManager.java @@ -0,0 +1,176 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class TextureManager implements ITickable, IResourceManagerReloadListener +{ + private static final Logger logger = LogManager.getLogger(); + private final Map mapTextureObjects = Maps.newHashMap(); + private final Map mapResourceLocations = Maps.newHashMap(); + private final List listTickables = Lists.newArrayList(); + private final Map mapTextureCounters = Maps.newHashMap(); + private IResourceManager theResourceManager; + private static final String __OBFID = "CL_00001064"; + + public TextureManager(IResourceManager p_i1284_1_) + { + this.theResourceManager = p_i1284_1_; + } + + public void bindTexture(ResourceLocation resource) + { + Object object = (ITextureObject)this.mapTextureObjects.get(resource); + + if (object == null) + { + object = new SimpleTexture(resource); + this.loadTexture(resource, (ITextureObject)object); + } + + TextureUtil.bindTexture(((ITextureObject)object).getGlTextureId()); + } + + public ResourceLocation getResourceLocation(int p_130087_1_) + { + return (ResourceLocation)this.mapResourceLocations.get(Integer.valueOf(p_130087_1_)); + } + + public boolean loadTextureMap(ResourceLocation p_130088_1_, TextureMap p_130088_2_) + { + if (this.loadTickableTexture(p_130088_1_, p_130088_2_)) + { + this.mapResourceLocations.put(Integer.valueOf(p_130088_2_.getTextureType()), p_130088_1_); + return true; + } + else + { + return false; + } + } + + public boolean loadTickableTexture(ResourceLocation p_110580_1_, ITickableTextureObject p_110580_2_) + { + if (this.loadTexture(p_110580_1_, p_110580_2_)) + { + this.listTickables.add(p_110580_2_); + return true; + } + else + { + return false; + } + } + + public boolean loadTexture(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) + { + boolean flag = true; + ITextureObject p_110579_2_2 = p_110579_2_; + + try + { + ((ITextureObject)p_110579_2_).loadTexture(this.theResourceManager); + } + catch (IOException ioexception) + { + logger.warn("Failed to load texture: " + p_110579_1_, ioexception); + p_110579_2_2 = TextureUtil.missingTexture; + this.mapTextureObjects.put(p_110579_1_, p_110579_2_2); + flag = false; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Resource location being registered"); + crashreportcategory.addCrashSection("Resource location", p_110579_1_); + crashreportcategory.addCrashSectionCallable("Texture object class", new Callable() + { + private static final String __OBFID = "CL_00001065"; + public String call() + { + return p_110579_2_.getClass().getName(); + } + }); + throw new ReportedException(crashreport); + } + + this.mapTextureObjects.put(p_110579_1_, p_110579_2_2); + return flag; + } + + public ITextureObject getTexture(ResourceLocation p_110581_1_) + { + return (ITextureObject)this.mapTextureObjects.get(p_110581_1_); + } + + public ResourceLocation getDynamicTextureLocation(String p_110578_1_, DynamicTexture p_110578_2_) + { + Integer integer = (Integer)this.mapTextureCounters.get(p_110578_1_); + + if (integer == null) + { + integer = Integer.valueOf(1); + } + else + { + integer = Integer.valueOf(integer.intValue() + 1); + } + + this.mapTextureCounters.put(p_110578_1_, integer); + ResourceLocation resourcelocation = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {p_110578_1_, integer})); + this.loadTexture(resourcelocation, p_110578_2_); + return resourcelocation; + } + + public void tick() + { + Iterator iterator = this.listTickables.iterator(); + + while (iterator.hasNext()) + { + ITickable itickable = (ITickable)iterator.next(); + itickable.tick(); + } + } + + public void deleteTexture(ResourceLocation p_147645_1_) + { + ITextureObject itextureobject = this.getTexture(p_147645_1_); + + if (itextureobject != null) + { + TextureUtil.deleteTexture(itextureobject.getGlTextureId()); + } + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Reloading Texture Manager", this.mapTextureObjects.keySet().size(), true); + Iterator iterator = this.mapTextureObjects.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + bar.step(entry.getKey().toString()); + this.loadTexture((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); + } + cpw.mods.fml.common.ProgressManager.pop(bar); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureMap.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureMap.java new file mode 100644 index 0000000..711bcf8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureMap.java @@ -0,0 +1,476 @@ +package net.minecraft.client.renderer.texture; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.Callable; +import javax.imageio.ImageIO; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.StitcherException; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.data.AnimationMetadataSection; +import net.minecraft.client.resources.data.TextureMetadataSection; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class TextureMap extends AbstractTexture implements ITickableTextureObject, IIconRegister +{ + private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true")); + private static final Logger logger = LogManager.getLogger(); + public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); + public static final ResourceLocation locationItemsTexture = new ResourceLocation("textures/atlas/items.png"); + private final List listAnimatedSprites = Lists.newArrayList(); + private final Map mapRegisteredSprites = Maps.newHashMap(); + private final Map mapUploadedSprites = Maps.newHashMap(); + /** 0 = terrain.png, 1 = items.png */ + private final int textureType; + private final String basePath; + private int mipmapLevels; + private int anisotropicFiltering = 1; + private final TextureAtlasSprite missingImage = new TextureAtlasSprite("missingno"); + private static final String __OBFID = "CL_00001058"; + private boolean skipFirst = false; + + public TextureMap(int p_i1281_1_, String p_i1281_2_) + { + this(p_i1281_1_, p_i1281_2_, false); + } + public TextureMap(int p_i1281_1_, String p_i1281_2_, boolean skipFirst) + { + this.textureType = p_i1281_1_; + this.basePath = p_i1281_2_; + this.registerIcons(); + this.skipFirst = skipFirst && ENABLE_SKIP; + } + + private void initMissingImage() + { + int[] aint; + + if ((float)this.anisotropicFiltering > 1.0F) + { + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + this.missingImage.setIconWidth(32); + this.missingImage.setIconHeight(32); + aint = new int[1024]; + System.arraycopy(TextureUtil.missingTextureData, 0, aint, 0, TextureUtil.missingTextureData.length); + TextureUtil.prepareAnisotropicData(aint, 16, 16, 8); + } + else + { + aint = TextureUtil.missingTextureData; + this.missingImage.setIconWidth(16); + this.missingImage.setIconHeight(16); + } + + int[][] aint1 = new int[this.mipmapLevels + 1][]; + aint1[0] = aint; + this.missingImage.setFramesTextureData(Lists.newArrayList(new int[][][] {aint1})); + } + + public void loadTexture(IResourceManager p_110551_1_) throws IOException + { + this.initMissingImage(); + this.deleteGlTexture(); + this.loadTextureAtlas(p_110551_1_); + } + + public void loadTextureAtlas(IResourceManager p_110571_1_) + { + registerIcons(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed. + + int i = Minecraft.getGLMaximumTextureSize(); + Stitcher stitcher = new Stitcher(i, i, true, 0, this.mipmapLevels); + this.mapUploadedSprites.clear(); + this.listAnimatedSprites.clear(); + int j = Integer.MAX_VALUE; + ForgeHooksClient.onTextureStitchedPre(this); + cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Texture Loading", skipFirst ? 0 : this.mapRegisteredSprites.size()); + Iterator iterator = this.mapRegisteredSprites.entrySet().iterator(); + TextureAtlasSprite textureatlassprite; + + while (!skipFirst && iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + ResourceLocation resourcelocation = new ResourceLocation((String)entry.getKey()); + textureatlassprite = (TextureAtlasSprite)entry.getValue(); + ResourceLocation resourcelocation1 = this.completeResourceLocation(resourcelocation, 0); + bar.step(resourcelocation1.getResourcePath()); + + if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) + { + if (!textureatlassprite.load(p_110571_1_, resourcelocation)) + { + j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); + stitcher.addSprite(textureatlassprite); + } + continue; + } + + try + { + IResource iresource = p_110571_1_.getResource(resourcelocation1); + BufferedImage[] abufferedimage = new BufferedImage[1 + this.mipmapLevels]; + abufferedimage[0] = ImageIO.read(iresource.getInputStream()); + TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture"); + + if (texturemetadatasection != null) + { + List list = texturemetadatasection.getListMipmaps(); + int l; + + if (!list.isEmpty()) + { + int k = abufferedimage[0].getWidth(); + l = abufferedimage[0].getHeight(); + + if (MathHelper.roundUpToPowerOfTwo(k) != k || MathHelper.roundUpToPowerOfTwo(l) != l) + { + throw new RuntimeException("Unable to load extra miplevels, source-texture is not power of two"); + } + } + + Iterator iterator3 = list.iterator(); + + while (iterator3.hasNext()) + { + l = ((Integer)iterator3.next()).intValue(); + + if (l > 0 && l < abufferedimage.length - 1 && abufferedimage[l] == null) + { + ResourceLocation resourcelocation2 = this.completeResourceLocation(resourcelocation, l); + + try + { + abufferedimage[l] = ImageIO.read(p_110571_1_.getResource(resourcelocation2).getInputStream()); + } + catch (IOException ioexception) + { + logger.error("Unable to load miplevel {} from: {}", new Object[] {Integer.valueOf(l), resourcelocation2, ioexception}); + } + } + } + } + + AnimationMetadataSection animationmetadatasection = (AnimationMetadataSection)iresource.getMetadata("animation"); + textureatlassprite.loadSprite(abufferedimage, animationmetadatasection, (float)this.anisotropicFiltering > 1.0F); + } + catch (RuntimeException runtimeexception) + { + //logger.error("Unable to parse metadata from " + resourcelocation1, runtimeexception); + cpw.mods.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); + continue; + } + catch (IOException ioexception1) + { + //logger.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); + cpw.mods.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); + continue; + } + + j = Math.min(j, Math.min(textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight())); + stitcher.addSprite(textureatlassprite); + } + + cpw.mods.fml.common.ProgressManager.pop(bar); + int i1 = MathHelper.calculateLogBaseTwo(j); + + if (i1 < this.mipmapLevels) + { + logger.debug("{}: dropping miplevel from {} to {}, because of minTexel: {}", new Object[] {this.basePath, Integer.valueOf(this.mipmapLevels), Integer.valueOf(i1), Integer.valueOf(j)}); + this.mipmapLevels = i1; + } + + Iterator iterator1 = this.mapRegisteredSprites.values().iterator(); + bar = cpw.mods.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.mapRegisteredSprites.size()); + + while (!skipFirst && iterator1.hasNext()) + { + final TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)iterator1.next(); + bar.step(textureatlassprite1.getIconName()); + + try + { + textureatlassprite1.generateMipmaps(this.mipmapLevels); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Applying mipmap"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Sprite being mipmapped"); + crashreportcategory.addCrashSectionCallable("Sprite name", new Callable() + { + private static final String __OBFID = "CL_00001059"; + public String call() + { + return textureatlassprite1.getIconName(); + } + }); + crashreportcategory.addCrashSectionCallable("Sprite size", new Callable() + { + private static final String __OBFID = "CL_00001060"; + public String call() + { + return textureatlassprite1.getIconWidth() + " x " + textureatlassprite1.getIconHeight(); + } + }); + crashreportcategory.addCrashSectionCallable("Sprite frames", new Callable() + { + private static final String __OBFID = "CL_00001061"; + public String call() + { + return textureatlassprite1.getFrameCount() + " frames"; + } + }); + crashreportcategory.addCrashSection("Mipmap levels", Integer.valueOf(this.mipmapLevels)); + throw new ReportedException(crashreport); + } + } + + this.missingImage.generateMipmaps(this.mipmapLevels); + stitcher.addSprite(this.missingImage); + cpw.mods.fml.common.ProgressManager.pop(bar); + skipFirst = false; + bar = cpw.mods.fml.common.ProgressManager.push("Texture creation", 3); + + try + { + bar.step("Stitching"); + stitcher.doStitch(); + } + catch (StitcherException stitcherexception) + { + throw stitcherexception; + } + + logger.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.getCurrentWidth()), Integer.valueOf(stitcher.getCurrentHeight()), this.basePath}); + bar.step("Allocating GL texture"); + TextureUtil.allocateTextureImpl(this.getGlTextureId(), this.mipmapLevels, stitcher.getCurrentWidth(), stitcher.getCurrentHeight(), (float)this.anisotropicFiltering); + HashMap hashmap = Maps.newHashMap(this.mapRegisteredSprites); + Iterator iterator2 = stitcher.getStichSlots().iterator(); + + bar.step("Uploading GL texture"); + while (iterator2.hasNext()) + { + textureatlassprite = (TextureAtlasSprite)iterator2.next(); + String s = textureatlassprite.getIconName(); + hashmap.remove(s); + this.mapUploadedSprites.put(s, textureatlassprite); + + try + { + TextureUtil.uploadTextureMipmap(textureatlassprite.getFrameTextureData(0), textureatlassprite.getIconWidth(), textureatlassprite.getIconHeight(), textureatlassprite.getOriginX(), textureatlassprite.getOriginY(), false, false); + } + catch (Throwable throwable) + { + CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Stitching texture atlas"); + CrashReportCategory crashreportcategory1 = crashreport1.makeCategory("Texture being stitched together"); + crashreportcategory1.addCrashSection("Atlas path", this.basePath); + crashreportcategory1.addCrashSection("Sprite", textureatlassprite); + throw new ReportedException(crashreport1); + } + + if (textureatlassprite.hasAnimationMetadata()) + { + this.listAnimatedSprites.add(textureatlassprite); + } + else + { + textureatlassprite.clearFramesTextureData(); + } + } + + iterator2 = hashmap.values().iterator(); + + while (iterator2.hasNext()) + { + textureatlassprite = (TextureAtlasSprite)iterator2.next(); + textureatlassprite.copyFrom(this.missingImage); + } + ForgeHooksClient.onTextureStitchedPost(this); + cpw.mods.fml.common.ProgressManager.pop(bar); + } + + private ResourceLocation completeResourceLocation(ResourceLocation p_147634_1_, int p_147634_2_) + { + return p_147634_2_ == 0 ? new ResourceLocation(p_147634_1_.getResourceDomain(), String.format("%s/%s%s", new Object[] {this.basePath, p_147634_1_.getResourcePath(), ".png"})): new ResourceLocation(p_147634_1_.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {this.basePath, p_147634_1_.getResourcePath(), Integer.valueOf(p_147634_2_), ".png"})); + } + + private void registerIcons() + { + this.mapRegisteredSprites.clear(); + Iterator iterator; + + if (this.textureType == 0) + { + iterator = Block.blockRegistry.iterator(); + + while (iterator.hasNext()) + { + Block block = (Block)iterator.next(); + + if (block.getMaterial() != Material.air) + { + block.registerBlockIcons(this); + } + } + + Minecraft.getMinecraft().renderGlobal.registerDestroyBlockIcons(this); + RenderManager.instance.updateIcons(this); + } + + iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item != null && item.getSpriteNumber() == this.textureType) + { + item.registerIcons(this); + } + } + } + + public TextureAtlasSprite getAtlasSprite(String p_110572_1_) + { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.mapUploadedSprites.get(p_110572_1_); + + if (textureatlassprite == null) + { + textureatlassprite = this.missingImage; + } + + return textureatlassprite; + } + + public void updateAnimations() + { + TextureUtil.bindTexture(this.getGlTextureId()); + Iterator iterator = this.listAnimatedSprites.iterator(); + + while (iterator.hasNext()) + { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)iterator.next(); + textureatlassprite.updateAnimation(); + } + } + + public IIcon registerIcon(String p_94245_1_) + { + if (p_94245_1_ == null) + { + throw new IllegalArgumentException("Name cannot be null!"); + } + else if (p_94245_1_.indexOf(92) == -1) // Disable backslashes (\) in texture asset paths. + { + Object object = (TextureAtlasSprite)this.mapRegisteredSprites.get(p_94245_1_); + + if (object == null) + { + if (this.textureType == 1) + { + if ("clock".equals(p_94245_1_)) + { + object = new TextureClock(p_94245_1_); + } + else if ("compass".equals(p_94245_1_)) + { + object = new TextureCompass(p_94245_1_); + } + else + { + object = new TextureAtlasSprite(p_94245_1_); + } + } + else + { + object = new TextureAtlasSprite(p_94245_1_); + } + + this.mapRegisteredSprites.put(p_94245_1_, object); + } + + return (IIcon)object; + } + else + { + throw new IllegalArgumentException("Name cannot contain slashes!"); + } + } + + public int getTextureType() + { + return this.textureType; + } + + public void tick() + { + this.updateAnimations(); + } + + public void setMipmapLevels(int p_147633_1_) + { + this.mipmapLevels = p_147633_1_; + } + + public void setAnisotropicFiltering(int p_147632_1_) + { + this.anisotropicFiltering = p_147632_1_; + } + + //=================================================================================================== + // Forge Start + //=================================================================================================== + /** + * Grabs the registered entry for the specified name, returning null if there was not a entry. + * Opposed to registerIcon, this will not instantiate the entry, useful to test if a mapping exists. + * + * @param name The name of the entry to find + * @return The registered entry, null if nothing was registered. + */ + public TextureAtlasSprite getTextureExtry(String name) + { + return (TextureAtlasSprite)mapRegisteredSprites.get(name); + } + + /** + * Adds a texture registry entry to this map for the specified name if one does not already exist. + * Returns false if the map already contains a entry for the specified name. + * + * @param name Entry name + * @param entry Entry instance + * @return True if the entry was added to the map, false otherwise. + */ + public boolean setTextureEntry(String name, TextureAtlasSprite entry) + { + if (!mapRegisteredSprites.containsKey(name)) + { + mapRegisteredSprites.put(name, entry); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureUtil.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureUtil.java new file mode 100644 index 0000000..a41bbc2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/texture/TextureUtil.java @@ -0,0 +1,445 @@ +package net.minecraft.client.renderer.texture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.IntBuffer; +import javax.imageio.ImageIO; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class TextureUtil +{ + private static final Logger logger = LogManager.getLogger(); + private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304); + public static final DynamicTexture missingTexture = new DynamicTexture(16, 16); + public static final int[] missingTextureData = missingTexture.getTextureData(); + private static int field_147958_e = -1; + private static int field_147956_f = -1; + private static float field_152779_g = -1.0F; + private static final int[] field_147957_g; + private static final String __OBFID = "CL_00001067"; + + public static int glGenTextures() + { + return GL11.glGenTextures(); + } + + public static void deleteTexture(int p_147942_0_) + { + GL11.glDeleteTextures(p_147942_0_); + } + + public static int uploadTextureImage(int p_110987_0_, BufferedImage p_110987_1_) + { + return uploadTextureImageAllocate(p_110987_0_, p_110987_1_, false, false); + } + + public static void uploadTexture(int p_110988_0_, int[] p_110988_1_, int p_110988_2_, int p_110988_3_) + { + bindTexture(p_110988_0_); + uploadTextureSub(0, p_110988_1_, p_110988_2_, p_110988_3_, 0, 0, false, false, false); + } + + public static int[][] generateMipmapData(int p_147949_0_, int p_147949_1_, int[][] p_147949_2_) + { + int[][] aint1 = new int[p_147949_0_ + 1][]; + aint1[0] = p_147949_2_[0]; + + if (p_147949_0_ > 0) + { + boolean flag = false; + int k; + + for (k = 0; k < p_147949_2_.length; ++k) + { + if (p_147949_2_[0][k] >> 24 == 0) + { + flag = true; + break; + } + } + + for (k = 1; k <= p_147949_0_; ++k) + { + if (p_147949_2_[k] != null) + { + aint1[k] = p_147949_2_[k]; + } + else + { + int[] aint2 = aint1[k - 1]; + int[] aint3 = new int[aint2.length >> 2]; + int l = p_147949_1_ >> k; + int i1 = aint3.length / l; + int j1 = l << 1; + + for (int k1 = 0; k1 < l; ++k1) + { + for (int l1 = 0; l1 < i1; ++l1) + { + int i2 = 2 * (k1 + l1 * j1); + aint3[k1 + l1 * l] = func_147943_a(aint2[i2 + 0], aint2[i2 + 1], aint2[i2 + 0 + j1], aint2[i2 + 1 + j1], flag); + } + } + + aint1[k] = aint3; + } + } + } + + return aint1; + } + + private static int func_147943_a(int p_147943_0_, int p_147943_1_, int p_147943_2_, int p_147943_3_, boolean p_147943_4_) + { + if (!p_147943_4_) + { + int i2 = func_147944_a(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_, 24); + int j2 = func_147944_a(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_, 16); + int k2 = func_147944_a(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_, 8); + int l2 = func_147944_a(p_147943_0_, p_147943_1_, p_147943_2_, p_147943_3_, 0); + return i2 << 24 | j2 << 16 | k2 << 8 | l2; + } + else + { + field_147957_g[0] = p_147943_0_; + field_147957_g[1] = p_147943_1_; + field_147957_g[2] = p_147943_2_; + field_147957_g[3] = p_147943_3_; + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + int i1; + + for (i1 = 0; i1 < 4; ++i1) + { + if (field_147957_g[i1] >> 24 != 0) + { + f += (float)Math.pow((double)((float)(field_147957_g[i1] >> 24 & 255) / 255.0F), 2.2D); + f1 += (float)Math.pow((double)((float)(field_147957_g[i1] >> 16 & 255) / 255.0F), 2.2D); + f2 += (float)Math.pow((double)((float)(field_147957_g[i1] >> 8 & 255) / 255.0F), 2.2D); + f3 += (float)Math.pow((double)((float)(field_147957_g[i1] >> 0 & 255) / 255.0F), 2.2D); + } + } + + f /= 4.0F; + f1 /= 4.0F; + f2 /= 4.0F; + f3 /= 4.0F; + i1 = (int)(Math.pow((double)f, 0.45454545454545453D) * 255.0D); + int j1 = (int)(Math.pow((double)f1, 0.45454545454545453D) * 255.0D); + int k1 = (int)(Math.pow((double)f2, 0.45454545454545453D) * 255.0D); + int l1 = (int)(Math.pow((double)f3, 0.45454545454545453D) * 255.0D); + + if (i1 < 96) + { + i1 = 0; + } + + return i1 << 24 | j1 << 16 | k1 << 8 | l1; + } + } + + private static int func_147944_a(int p_147944_0_, int p_147944_1_, int p_147944_2_, int p_147944_3_, int p_147944_4_) + { + float f = (float)Math.pow((double)((float)(p_147944_0_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f1 = (float)Math.pow((double)((float)(p_147944_1_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f2 = (float)Math.pow((double)((float)(p_147944_2_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f3 = (float)Math.pow((double)((float)(p_147944_3_ >> p_147944_4_ & 255) / 255.0F), 2.2D); + float f4 = (float)Math.pow((double)(f + f1 + f2 + f3) * 0.25D, 0.45454545454545453D); + return (int)((double)f4 * 255.0D); + } + + public static void uploadTextureMipmap(int[][] p_147955_0_, int p_147955_1_, int p_147955_2_, int p_147955_3_, int p_147955_4_, boolean p_147955_5_, boolean p_147955_6_) + { + for (int i1 = 0; i1 < p_147955_0_.length; ++i1) + { + int[] aint1 = p_147955_0_[i1]; + uploadTextureSub(i1, aint1, p_147955_1_ >> i1, p_147955_2_ >> i1, p_147955_3_ >> i1, p_147955_4_ >> i1, p_147955_5_, p_147955_6_, p_147955_0_.length > 1); + } + } + + private static void uploadTextureSub(int p_147947_0_, int[] p_147947_1_, int p_147947_2_, int p_147947_3_, int p_147947_4_, int p_147947_5_, boolean p_147947_6_, boolean p_147947_7_, boolean p_147947_8_) + { + int j1 = 4194304 / p_147947_2_; + func_147954_b(p_147947_6_, p_147947_8_); + setTextureClamped(p_147947_7_); + int i2; + + for (int k1 = 0; k1 < p_147947_2_ * p_147947_3_; k1 += p_147947_2_ * i2) + { + int l1 = k1 / p_147947_2_; + i2 = Math.min(j1, p_147947_3_ - l1); + int j2 = p_147947_2_ * i2; + copyToBufferPos(p_147947_1_, k1, j2); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, p_147947_0_, p_147947_4_, p_147947_5_ + l1, p_147947_2_, i2, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); + } + } + + public static int uploadTextureImageAllocate(int p_110989_0_, BufferedImage p_110989_1_, boolean p_110989_2_, boolean p_110989_3_) + { + allocateTexture(p_110989_0_, p_110989_1_.getWidth(), p_110989_1_.getHeight()); + return uploadTextureImageSub(p_110989_0_, p_110989_1_, 0, 0, p_110989_2_, p_110989_3_); + } + + public static void allocateTexture(int p_110991_0_, int p_110991_1_, int p_110991_2_) + { + allocateTextureImpl(p_110991_0_, 0, p_110991_1_, p_110991_2_, 1.0F); + } + + public static void allocateTextureImpl(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_, float p_147946_4_) + { + synchronized(cpw.mods.fml.client.SplashProgress.class) + { + deleteTexture(p_147946_0_); + bindTexture(p_147946_0_); + } + + if (OpenGlHelper.anisotropicFilteringSupported) + { + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_147946_4_); + } + + if (p_147946_1_ > 0) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_147946_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_147946_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F); + } + + for (int i1 = 0; i1 <= p_147946_1_; ++i1) + { + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i1, GL11.GL_RGBA, p_147946_2_ >> i1, p_147946_3_ >> i1, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); + } + } + + public static int uploadTextureImageSub(int p_110995_0_, BufferedImage p_110995_1_, int p_110995_2_, int p_110995_3_, boolean p_110995_4_, boolean p_110995_5_) + { + bindTexture(p_110995_0_); + uploadTextureImageSubImpl(p_110995_1_, p_110995_2_, p_110995_3_, p_110995_4_, p_110995_5_); + return p_110995_0_; + } + + private static void uploadTextureImageSubImpl(BufferedImage p_110993_0_, int p_110993_1_, int p_110993_2_, boolean p_110993_3_, boolean p_110993_4_) + { + int k = p_110993_0_.getWidth(); + int l = p_110993_0_.getHeight(); + int i1 = 4194304 / k; + int[] aint = new int[i1 * k]; + setTextureBlurred(p_110993_3_); + setTextureClamped(p_110993_4_); + + for (int j1 = 0; j1 < k * l; j1 += k * i1) + { + int k1 = j1 / k; + int l1 = Math.min(i1, l - k1); + int i2 = k * l1; + p_110993_0_.getRGB(0, k1, k, l1, aint, 0, k); + copyToBuffer(aint, i2); + GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, p_110993_1_, p_110993_2_ + k1, k, l1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); + } + } + + private static void setTextureClamped(boolean p_110997_0_) + { + if (p_110997_0_) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + } + else + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); + } + } + + private static void setTextureBlurred(boolean p_147951_0_) + { + func_147954_b(p_147951_0_, false); + } + + public static void func_152777_a(boolean p_152777_0_, boolean p_152777_1_, float p_152777_2_) + { + field_147958_e = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER); + field_147956_f = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER); + field_152779_g = GL11.glGetTexParameterf(GL11.GL_TEXTURE_2D, 34046); + func_147954_b(p_152777_0_, p_152777_1_); + func_152778_a(p_152777_2_); + } + + public static void func_147945_b() + { + if (field_147958_e >= 0 && field_147956_f >= 0 && field_152779_g >= 0.0F) + { + func_147952_b(field_147958_e, field_147956_f); + func_152778_a(field_152779_g); + field_152779_g = -1.0F; + field_147958_e = -1; + field_147956_f = -1; + } + } + + private static void func_147952_b(int p_147952_0_, int p_147952_1_) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147952_0_); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, p_147952_1_); + } + + private static void func_152778_a(float p_152778_0_) + { + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_152778_0_); + } + + private static void func_147954_b(boolean p_147954_0_, boolean p_147954_1_) + { + if (p_147954_0_) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? GL11.GL_LINEAR_MIPMAP_LINEAR : GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } + else + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, p_147954_1_ ? GL11.GL_NEAREST_MIPMAP_LINEAR : GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + } + + private static void copyToBuffer(int[] p_110990_0_, int p_110990_1_) + { + copyToBufferPos(p_110990_0_, 0, p_110990_1_); + } + + private static void copyToBufferPos(int[] p_110994_0_, int p_110994_1_, int p_110994_2_) + { + int[] aint1 = p_110994_0_; + + if (Minecraft.getMinecraft().gameSettings.anaglyph) + { + aint1 = updateAnaglyph(p_110994_0_); + } + + dataBuffer.clear(); + dataBuffer.put(aint1, p_110994_1_, p_110994_2_); + dataBuffer.position(0).limit(p_110994_2_); + } + + static void bindTexture(int p_94277_0_) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_94277_0_); + } + + public static int[] readImageData(IResourceManager p_110986_0_, ResourceLocation p_110986_1_) throws IOException + { + BufferedImage bufferedimage = ImageIO.read(p_110986_0_.getResource(p_110986_1_).getInputStream()); + int i = bufferedimage.getWidth(); + int j = bufferedimage.getHeight(); + int[] aint = new int[i * j]; + bufferedimage.getRGB(0, 0, i, j, aint, 0, i); + return aint; + } + + public static int[] updateAnaglyph(int[] p_110985_0_) + { + int[] aint1 = new int[p_110985_0_.length]; + + for (int i = 0; i < p_110985_0_.length; ++i) + { + int j = p_110985_0_[i] >> 24 & 255; + int k = p_110985_0_[i] >> 16 & 255; + int l = p_110985_0_[i] >> 8 & 255; + int i1 = p_110985_0_[i] & 255; + int j1 = (k * 30 + l * 59 + i1 * 11) / 100; + int k1 = (k * 30 + l * 70) / 100; + int l1 = (k * 30 + i1 * 70) / 100; + aint1[i] = j << 24 | j1 << 16 | k1 << 8 | l1; + } + + return aint1; + } + + public static int[] prepareAnisotropicData(int[] p_147948_0_, int p_147948_1_, int p_147948_2_, int p_147948_3_) + { + int l = p_147948_1_ + 2 * p_147948_3_; + int i1; + int j1; + + for (i1 = p_147948_2_ - 1; i1 >= 0; --i1) + { + j1 = i1 * p_147948_1_; + int k1 = p_147948_3_ + (i1 + p_147948_3_) * l; + int l1; + + for (l1 = 0; l1 < p_147948_3_; l1 += p_147948_1_) + { + int i2 = Math.min(p_147948_1_, p_147948_3_ - l1); + System.arraycopy(p_147948_0_, j1 + p_147948_1_ - i2, p_147948_0_, k1 - l1 - i2, i2); + } + + System.arraycopy(p_147948_0_, j1, p_147948_0_, k1, p_147948_1_); + + for (l1 = 0; l1 < p_147948_3_; l1 += p_147948_1_) + { + System.arraycopy(p_147948_0_, j1, p_147948_0_, k1 + p_147948_1_ + l1, Math.min(p_147948_1_, p_147948_3_ - l1)); + } + } + + for (i1 = 0; i1 < p_147948_3_; i1 += p_147948_2_) + { + j1 = Math.min(p_147948_2_, p_147948_3_ - i1); + System.arraycopy(p_147948_0_, (p_147948_3_ + p_147948_2_ - j1) * l, p_147948_0_, (p_147948_3_ - i1 - j1) * l, l * j1); + } + + for (i1 = 0; i1 < p_147948_3_; i1 += p_147948_2_) + { + j1 = Math.min(p_147948_2_, p_147948_3_ - i1); + System.arraycopy(p_147948_0_, p_147948_3_ * l, p_147948_0_, (p_147948_2_ + p_147948_3_ + i1) * l, l * j1); + } + + return p_147948_0_; + } + + public static void func_147953_a(int[] p_147953_0_, int p_147953_1_, int p_147953_2_) + { + int[] aint1 = new int[p_147953_1_]; + int k = p_147953_2_ / 2; + + for (int l = 0; l < k; ++l) + { + System.arraycopy(p_147953_0_, l * p_147953_1_, aint1, 0, p_147953_1_); + System.arraycopy(p_147953_0_, (p_147953_2_ - 1 - l) * p_147953_1_, p_147953_0_, l * p_147953_1_, p_147953_1_); + System.arraycopy(aint1, 0, p_147953_0_, (p_147953_2_ - 1 - l) * p_147953_1_, p_147953_1_); + } + } + + static + { + int var0 = -16777216; + int var1 = -524040; + int[] var2 = new int[] { -524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040}; + int[] var3 = new int[] { -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216}; + int var4 = var2.length; + + for (int var5 = 0; var5 < 16; ++var5) + { + System.arraycopy(var5 < var4 ? var2 : var3, 0, missingTextureData, 16 * var5, var4); + System.arraycopy(var5 < var4 ? var3 : var2, 0, missingTextureData, 16 * var5 + var4, var4); + } + + missingTexture.updateDynamicTexture(); + field_147957_g = new int[4]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java new file mode 100644 index 0000000..cc673ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEndPortal.java @@ -0,0 +1,132 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.FloatBuffer; +import java.util.Random; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderEndPortal extends TileEntitySpecialRenderer +{ + private static final ResourceLocation field_147529_c = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation field_147526_d = new ResourceLocation("textures/entity/end_portal.png"); + private static final Random field_147527_e = new Random(31100L); + FloatBuffer field_147528_b = GLAllocation.createDirectFloatBuffer(16); + private static final String __OBFID = "CL_00000972"; + + public void renderTileEntityAt(TileEntityEndPortal p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + float f1 = (float)this.field_147501_a.field_147560_j; + float f2 = (float)this.field_147501_a.field_147561_k; + float f3 = (float)this.field_147501_a.field_147558_l; + GL11.glDisable(GL11.GL_LIGHTING); + field_147527_e.setSeed(31100L); + float f4 = 0.75F; + + for (int i = 0; i < 16; ++i) + { + GL11.glPushMatrix(); + float f5 = (float)(16 - i); + float f6 = 0.0625F; + float f7 = 1.0F / (f5 + 1.0F); + + if (i == 0) + { + this.bindTexture(field_147529_c); + f7 = 0.1F; + f5 = 65.0F; + f6 = 0.125F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + + if (i == 1) + { + this.bindTexture(field_147526_d); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + f6 = 0.5F; + } + + float f8 = (float)(-(p_147500_4_ + (double)f4)); + float f9 = f8 + ActiveRenderInfo.objectY; + float f10 = f8 + f5 + ActiveRenderInfo.objectY; + float f11 = f9 / f10; + f11 += (float)(p_147500_4_ + (double)f4); + GL11.glTranslatef(f1, f11, f3); + GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_EYE_LINEAR); + GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, this.func_147525_a(1.0F, 0.0F, 0.0F, 0.0F)); + GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, this.func_147525_a(0.0F, 0.0F, 1.0F, 0.0F)); + GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, this.func_147525_a(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glTexGen(GL11.GL_Q, GL11.GL_EYE_PLANE, this.func_147525_a(0.0F, 1.0F, 0.0F, 0.0F)); + GL11.glEnable(GL11.GL_TEXTURE_GEN_S); + GL11.glEnable(GL11.GL_TEXTURE_GEN_T); + GL11.glEnable(GL11.GL_TEXTURE_GEN_R); + GL11.glEnable(GL11.GL_TEXTURE_GEN_Q); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, (float)(Minecraft.getSystemTime() % 700000L) / 700000.0F, 0.0F); + GL11.glScalef(f6, f6, f6); + GL11.glTranslatef(0.5F, 0.5F, 0.0F); + GL11.glRotatef((float)(i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.5F, -0.5F, 0.0F); + GL11.glTranslatef(-f1, -f3, -f2); + f9 = f8 + ActiveRenderInfo.objectY; + GL11.glTranslatef(ActiveRenderInfo.objectX * f5 / f9, ActiveRenderInfo.objectZ * f5 / f9, -f2); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + f11 = field_147527_e.nextFloat() * 0.5F + 0.1F; + float f12 = field_147527_e.nextFloat() * 0.5F + 0.4F; + float f13 = field_147527_e.nextFloat() * 0.5F + 0.5F; + + if (i == 0) + { + f13 = 1.0F; + f12 = 1.0F; + f11 = 1.0F; + } + + tessellator.setColorRGBA_F(f11 * f7, f12 * f7, f13 * f7, 1.0F); + tessellator.addVertex(p_147500_2_, p_147500_4_ + (double)f4, p_147500_6_); + tessellator.addVertex(p_147500_2_, p_147500_4_ + (double)f4, p_147500_6_ + 1.0D); + tessellator.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + (double)f4, p_147500_6_ + 1.0D); + tessellator.addVertex(p_147500_2_ + 1.0D, p_147500_4_ + (double)f4, p_147500_6_); + tessellator.draw(); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_GEN_S); + GL11.glDisable(GL11.GL_TEXTURE_GEN_T); + GL11.glDisable(GL11.GL_TEXTURE_GEN_R); + GL11.glDisable(GL11.GL_TEXTURE_GEN_Q); + GL11.glEnable(GL11.GL_LIGHTING); + } + + private FloatBuffer func_147525_a(float p_147525_1_, float p_147525_2_, float p_147525_3_, float p_147525_4_) + { + this.field_147528_b.clear(); + this.field_147528_b.put(p_147525_1_).put(p_147525_2_).put(p_147525_3_).put(p_147525_4_); + this.field_147528_b.flip(); + return this.field_147528_b; + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityEndPortal)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java new file mode 100644 index 0000000..03695c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/RenderEnderCrystal.java @@ -0,0 +1,71 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelEnderCrystal; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RenderEnderCrystal extends Render +{ + private static final ResourceLocation enderCrystalTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal.png"); + private ModelBase field_76995_b; + private static final String __OBFID = "CL_00000987"; + + public RenderEnderCrystal() + { + this.shadowSize = 0.5F; + this.field_76995_b = new ModelEnderCrystal(0.0F, true); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) + { + textureatlassprite.updateAnimation(); + } + } + } + } + + GL11.glPopMatrix(); + } + } + + protected void func_147914_a(EntityItemFrame p_147914_1_, double p_147914_2_, double p_147914_4_, double p_147914_6_) + { + if (Minecraft.isGuiEnabled() && p_147914_1_.getDisplayedItem() != null && p_147914_1_.getDisplayedItem().hasDisplayName() && this.renderManager.field_147941_i == p_147914_1_) + { + float f = 1.6F; + float f1 = 0.016666668F * f; + double d3 = p_147914_1_.getDistanceSqToEntity(this.renderManager.livingPlayer); + float f2 = p_147914_1_.isSneaking() ? 32.0F : 64.0F; + + if (d3 < (double)(f2 * f2)) + { + String s = p_147914_1_.getDisplayedItem().getDisplayName(); + + if (p_147914_1_.isSneaking()) + { + FontRenderer fontrenderer = this.getFontRendererFromRenderManager(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147914_2_ + 0.0F, (float)p_147914_4_ + p_147914_1_.height + 0.5F, (float)p_147914_6_); + GL11.glNormal3f(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + GL11.glScalef(-f1, -f1, f1); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + tessellator.startDrawingQuads(); + int i = fontrenderer.getStringWidth(s) / 2; + tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); + tessellator.addVertex((double)(-i - 1), -1.0D, 0.0D); + tessellator.addVertex((double)(-i - 1), 8.0D, 0.0D); + tessellator.addVertex((double)(i + 1), 8.0D, 0.0D); + tessellator.addVertex((double)(i + 1), -1.0D, 0.0D); + tessellator.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + else + { + this.func_147906_a(p_147914_1_, s, p_147914_2_, p_147914_4_, p_147914_6_, 64); + } + } + } + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + return this.getEntityTexture((EntityItemFrame)p_110775_1_); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render= 180.0F) + { + f3 -= 360.0F; + } + + return p_82400_1_ + p_82400_3_ * f3; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + { + Tessellator tessellator = Tessellator.instance; + this.bindTexture(field_147523_b); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthMask(true); + OpenGlHelper.glBlendFunc(770, 1, 1, 0); + float f2 = (float)p_147500_1_.getWorldObj().getTotalWorldTime() + p_147500_8_; + float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F); + byte b0 = 1; + double d3 = (double)f2 * 0.025D * (1.0D - (double)(b0 & 1) * 2.5D); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(255, 255, 255, 32); + double d5 = (double)b0 * 0.2D; + double d7 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d5; + double d9 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d5; + double d11 = 0.5D + Math.cos(d3 + (Math.PI / 4D)) * d5; + double d13 = 0.5D + Math.sin(d3 + (Math.PI / 4D)) * d5; + double d15 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d5; + double d17 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d5; + double d19 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d5; + double d21 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d5; + double d23 = (double)(256.0F * f1); + double d25 = 0.0D; + double d27 = 1.0D; + double d28 = (double)(-1.0F + f3); + double d29 = (double)(256.0F * f1) * (0.5D / d5) + d28; + tessellator.addVertexWithUV(p_147500_2_ + d7, p_147500_4_ + d23, p_147500_6_ + d9, d27, d29); + tessellator.addVertexWithUV(p_147500_2_ + d7, p_147500_4_, p_147500_6_ + d9, d27, d28); + tessellator.addVertexWithUV(p_147500_2_ + d11, p_147500_4_, p_147500_6_ + d13, d25, d28); + tessellator.addVertexWithUV(p_147500_2_ + d11, p_147500_4_ + d23, p_147500_6_ + d13, d25, d29); + tessellator.addVertexWithUV(p_147500_2_ + d19, p_147500_4_ + d23, p_147500_6_ + d21, d27, d29); + tessellator.addVertexWithUV(p_147500_2_ + d19, p_147500_4_, p_147500_6_ + d21, d27, d28); + tessellator.addVertexWithUV(p_147500_2_ + d15, p_147500_4_, p_147500_6_ + d17, d25, d28); + tessellator.addVertexWithUV(p_147500_2_ + d15, p_147500_4_ + d23, p_147500_6_ + d17, d25, d29); + tessellator.addVertexWithUV(p_147500_2_ + d11, p_147500_4_ + d23, p_147500_6_ + d13, d27, d29); + tessellator.addVertexWithUV(p_147500_2_ + d11, p_147500_4_, p_147500_6_ + d13, d27, d28); + tessellator.addVertexWithUV(p_147500_2_ + d19, p_147500_4_, p_147500_6_ + d21, d25, d28); + tessellator.addVertexWithUV(p_147500_2_ + d19, p_147500_4_ + d23, p_147500_6_ + d21, d25, d29); + tessellator.addVertexWithUV(p_147500_2_ + d15, p_147500_4_ + d23, p_147500_6_ + d17, d27, d29); + tessellator.addVertexWithUV(p_147500_2_ + d15, p_147500_4_, p_147500_6_ + d17, d27, d28); + tessellator.addVertexWithUV(p_147500_2_ + d7, p_147500_4_, p_147500_6_ + d9, d25, d28); + tessellator.addVertexWithUV(p_147500_2_ + d7, p_147500_4_ + d23, p_147500_6_ + d9, d25, d29); + tessellator.draw(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDepthMask(false); + tessellator.startDrawingQuads(); + tessellator.setColorRGBA(255, 255, 255, 32); + double d30 = 0.2D; + double d4 = 0.2D; + double d6 = 0.8D; + double d8 = 0.2D; + double d10 = 0.2D; + double d12 = 0.8D; + double d14 = 0.8D; + double d16 = 0.8D; + double d18 = (double)(256.0F * f1); + double d20 = 0.0D; + double d22 = 1.0D; + double d24 = (double)(-1.0F + f3); + double d26 = (double)(256.0F * f1) + d24; + tessellator.addVertexWithUV(p_147500_2_ + d30, p_147500_4_ + d18, p_147500_6_ + d4, d22, d26); + tessellator.addVertexWithUV(p_147500_2_ + d30, p_147500_4_, p_147500_6_ + d4, d22, d24); + tessellator.addVertexWithUV(p_147500_2_ + d6, p_147500_4_, p_147500_6_ + d8, d20, d24); + tessellator.addVertexWithUV(p_147500_2_ + d6, p_147500_4_ + d18, p_147500_6_ + d8, d20, d26); + tessellator.addVertexWithUV(p_147500_2_ + d14, p_147500_4_ + d18, p_147500_6_ + d16, d22, d26); + tessellator.addVertexWithUV(p_147500_2_ + d14, p_147500_4_, p_147500_6_ + d16, d22, d24); + tessellator.addVertexWithUV(p_147500_2_ + d10, p_147500_4_, p_147500_6_ + d12, d20, d24); + tessellator.addVertexWithUV(p_147500_2_ + d10, p_147500_4_ + d18, p_147500_6_ + d12, d20, d26); + tessellator.addVertexWithUV(p_147500_2_ + d6, p_147500_4_ + d18, p_147500_6_ + d8, d22, d26); + tessellator.addVertexWithUV(p_147500_2_ + d6, p_147500_4_, p_147500_6_ + d8, d22, d24); + tessellator.addVertexWithUV(p_147500_2_ + d14, p_147500_4_, p_147500_6_ + d16, d20, d24); + tessellator.addVertexWithUV(p_147500_2_ + d14, p_147500_4_ + d18, p_147500_6_ + d16, d20, d26); + tessellator.addVertexWithUV(p_147500_2_ + d10, p_147500_4_ + d18, p_147500_6_ + d12, d22, d26); + tessellator.addVertexWithUV(p_147500_2_ + d10, p_147500_4_, p_147500_6_ + d12, d22, d24); + tessellator.addVertexWithUV(p_147500_2_ + d30, p_147500_4_, p_147500_6_ + d4, d20, d24); + tessellator.addVertexWithUV(p_147500_2_ + d30, p_147500_4_ + d18, p_147500_6_ + d4, d20, d26); + tessellator.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(true); + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityBeacon)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java new file mode 100644 index 0000000..69a2aaf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java @@ -0,0 +1,186 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.client.model.ModelChest; +import net.minecraft.client.model.ModelLargeChest; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class TileEntityChestRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation field_147507_b = new ResourceLocation("textures/entity/chest/trapped_double.png"); + private static final ResourceLocation field_147508_c = new ResourceLocation("textures/entity/chest/christmas_double.png"); + private static final ResourceLocation field_147505_d = new ResourceLocation("textures/entity/chest/normal_double.png"); + private static final ResourceLocation field_147506_e = new ResourceLocation("textures/entity/chest/trapped.png"); + private static final ResourceLocation field_147503_f = new ResourceLocation("textures/entity/chest/christmas.png"); + private static final ResourceLocation field_147504_g = new ResourceLocation("textures/entity/chest/normal.png"); + private ModelChest field_147510_h = new ModelChest(); + private ModelChest field_147511_i = new ModelLargeChest(); + private boolean field_147509_j; + private static final String __OBFID = "CL_00000965"; + + public TileEntityChestRenderer() + { + Calendar calendar = Calendar.getInstance(); + + if (calendar.get(2) + 1 == 12 && calendar.get(5) >= 24 && calendar.get(5) <= 26) + { + this.field_147509_j = true; + } + } + + public void renderTileEntityAt(TileEntityChest p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + int i; + + if (!p_147500_1_.hasWorldObj()) + { + i = 0; + } + else + { + Block block = p_147500_1_.getBlockType(); + i = p_147500_1_.getBlockMetadata(); + + if (block instanceof BlockChest && i == 0) + { + try + { + ((BlockChest)block).func_149954_e(p_147500_1_.getWorldObj(), p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord); + } + catch (ClassCastException e) + { + FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord); + } + i = p_147500_1_.getBlockMetadata(); + } + + p_147500_1_.checkForAdjacentChests(); + } + + if (p_147500_1_.adjacentChestZNeg == null && p_147500_1_.adjacentChestXNeg == null) + { + ModelChest modelchest; + + if (p_147500_1_.adjacentChestXPos == null && p_147500_1_.adjacentChestZPos == null) + { + modelchest = this.field_147510_h; + + if (p_147500_1_.func_145980_j() == 1) + { + this.bindTexture(field_147506_e); + } + else if (this.field_147509_j) + { + this.bindTexture(field_147503_f); + } + else + { + this.bindTexture(field_147504_g); + } + } + else + { + modelchest = this.field_147511_i; + + if (p_147500_1_.func_145980_j() == 1) + { + this.bindTexture(field_147507_b); + } + else if (this.field_147509_j) + { + this.bindTexture(field_147508_c); + } + else + { + this.bindTexture(field_147505_d); + } + } + + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)p_147500_2_, (float)p_147500_4_ + 1.0F, (float)p_147500_6_ + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + short short1 = 0; + + if (i == 2) + { + short1 = 180; + } + + if (i == 3) + { + short1 = 0; + } + + if (i == 4) + { + short1 = 90; + } + + if (i == 5) + { + short1 = -90; + } + + if (i == 2 && p_147500_1_.adjacentChestXPos != null) + { + GL11.glTranslatef(1.0F, 0.0F, 0.0F); + } + + if (i == 5 && p_147500_1_.adjacentChestZPos != null) + { + GL11.glTranslatef(0.0F, 0.0F, -1.0F); + } + + GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_; + float f2; + + if (p_147500_1_.adjacentChestZNeg != null) + { + f2 = p_147500_1_.adjacentChestZNeg.prevLidAngle + (p_147500_1_.adjacentChestZNeg.lidAngle - p_147500_1_.adjacentChestZNeg.prevLidAngle) * p_147500_8_; + + if (f2 > f1) + { + f1 = f2; + } + } + + if (p_147500_1_.adjacentChestXNeg != null) + { + f2 = p_147500_1_.adjacentChestXNeg.prevLidAngle + (p_147500_1_.adjacentChestXNeg.lidAngle - p_147500_1_.adjacentChestXNeg.prevLidAngle) * p_147500_8_; + + if (f2 > f1) + { + f1 = f2; + } + } + + f1 = 1.0F - f1; + f1 = 1.0F - f1 * f1 * f1; + modelchest.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F); + modelchest.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityChest)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java new file mode 100644 index 0000000..af7b23e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityEnderChestRenderer.java @@ -0,0 +1,73 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.model.ModelChest; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class TileEntityEnderChestRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation field_147520_b = new ResourceLocation("textures/entity/chest/ender.png"); + private ModelChest field_147521_c = new ModelChest(); + private static final String __OBFID = "CL_00000967"; + + public void renderTileEntityAt(TileEntityEnderChest p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + int i = 0; + + if (p_147500_1_.hasWorldObj()) + { + i = p_147500_1_.getBlockMetadata(); + } + + this.bindTexture(field_147520_b); + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float)p_147500_2_, (float)p_147500_4_ + 1.0F, (float)p_147500_6_ + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + short short1 = 0; + + if (i == 2) + { + short1 = 180; + } + + if (i == 3) + { + short1 = 0; + } + + if (i == 4) + { + short1 = 90; + } + + if (i == 5) + { + short1 = -90; + } + + GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float f1 = p_147500_1_.field_145975_i + (p_147500_1_.field_145972_a - p_147500_1_.field_145975_i) * p_147500_8_; + f1 = 1.0F - f1; + f1 = 1.0F - f1 * f1 * f1; + this.field_147521_c.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F); + this.field_147521_c.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityEnderChest)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java new file mode 100644 index 0000000..7c81b41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityMobSpawnerRenderer.java @@ -0,0 +1,47 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityMobSpawner; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer +{ + private static final String __OBFID = "CL_00000968"; + + public void renderTileEntityAt(TileEntityMobSpawner p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_, (float)p_147500_6_ + 0.5F); + func_147517_a(p_147500_1_.func_145881_a(), p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + GL11.glPopMatrix(); + } + + public static void func_147517_a(MobSpawnerBaseLogic p_147517_0_, double p_147517_1_, double p_147517_3_, double p_147517_5_, float p_147517_7_) + { + Entity entity = p_147517_0_.func_98281_h(); + + if (entity != null) + { + entity.setWorld(p_147517_0_.getSpawnerWorld()); + float f1 = 0.4375F; + GL11.glTranslatef(0.0F, 0.4F, 0.0F); + GL11.glRotatef((float)(p_147517_0_.field_98284_d + (p_147517_0_.field_98287_c - p_147517_0_.field_98284_d) * (double)p_147517_7_) * 10.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.4F, 0.0F); + GL11.glScalef(f1, f1, f1); + entity.setLocationAndAngles(p_147517_1_, p_147517_3_, p_147517_5_, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, p_147517_7_); + } + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityMobSpawner)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java new file mode 100644 index 0000000..5ddbe38 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererChestHelper.java @@ -0,0 +1,37 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnderChest; + +@SideOnly(Side.CLIENT) +public class TileEntityRendererChestHelper +{ + public static TileEntityRendererChestHelper instance = new TileEntityRendererChestHelper(); + private TileEntityChest field_147717_b = new TileEntityChest(0); + private TileEntityChest field_147718_c = new TileEntityChest(1); + private TileEntityEnderChest field_147716_d = new TileEntityEnderChest(); + private static final String __OBFID = "CL_00000946"; + + /** + * Renders a chest at 0,0,0 - used for item rendering + */ + public void renderChest(Block p_147715_1_, int p_147715_2_, float p_147715_3_) + { + if (p_147715_1_ == Blocks.ender_chest) + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147716_d, 0.0D, 0.0D, 0.0D, 0.0F); + } + else if (p_147715_1_ == Blocks.trapped_chest) + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F); + } + else + { + TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java new file mode 100644 index 0000000..54173c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java @@ -0,0 +1,173 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderEnchantmentTable; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityEnchantmentTable; +import net.minecraft.tileentity.TileEntityEndPortal; +import net.minecraft.tileentity.TileEntityEnderChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.ReportedException; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TileEntityRendererDispatcher +{ + public Map mapSpecialRenderers = new HashMap(); + public static TileEntityRendererDispatcher instance = new TileEntityRendererDispatcher(); + private FontRenderer field_147557_n; + /** The player's current X position (same as playerX) */ + public static double staticPlayerX; + /** The player's current Y position (same as playerY) */ + public static double staticPlayerY; + /** The player's current Z position (same as playerZ) */ + public static double staticPlayerZ; + public TextureManager field_147553_e; + public World field_147550_f; + public EntityLivingBase field_147551_g; + public float field_147562_h; + public float field_147563_i; + public double field_147560_j; + public double field_147561_k; + public double field_147558_l; + private static final String __OBFID = "CL_00000963"; + + private TileEntityRendererDispatcher() + { + this.mapSpecialRenderers.put(TileEntitySign.class, new TileEntitySignRenderer()); + this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); + this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityRendererPiston()); + this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); + this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable()); + this.mapSpecialRenderers.put(TileEntityEndPortal.class, new RenderEndPortal()); + this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); + this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer()); + Iterator iterator = this.mapSpecialRenderers.values().iterator(); + + while (iterator.hasNext()) + { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)iterator.next(); + tileentityspecialrenderer.func_147497_a(this); + } + } + + public TileEntitySpecialRenderer getSpecialRendererByClass(Class p_147546_1_) + { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.mapSpecialRenderers.get(p_147546_1_); + + if (tileentityspecialrenderer == null && p_147546_1_ != TileEntity.class) + { + tileentityspecialrenderer = this.getSpecialRendererByClass(p_147546_1_.getSuperclass()); + this.mapSpecialRenderers.put(p_147546_1_, tileentityspecialrenderer); + } + + return tileentityspecialrenderer; + } + + /** + * Returns true if this TileEntity instance has a TileEntitySpecialRenderer associated with it, false otherwise. + */ + public boolean hasSpecialRenderer(TileEntity p_147545_1_) + { + return this.getSpecialRenderer(p_147545_1_) != null; + } + + public TileEntitySpecialRenderer getSpecialRenderer(TileEntity p_147547_1_) + { + return p_147547_1_ == null ? null : this.getSpecialRendererByClass(p_147547_1_.getClass()); + } + + public void cacheActiveRenderInfo(World p_147542_1_, TextureManager p_147542_2_, FontRenderer p_147542_3_, EntityLivingBase p_147542_4_, float p_147542_5_) + { + if (this.field_147550_f != p_147542_1_) + { + this.func_147543_a(p_147542_1_); + } + + this.field_147553_e = p_147542_2_; + this.field_147551_g = p_147542_4_; + this.field_147557_n = p_147542_3_; + this.field_147562_h = p_147542_4_.prevRotationYaw + (p_147542_4_.rotationYaw - p_147542_4_.prevRotationYaw) * p_147542_5_; + this.field_147563_i = p_147542_4_.prevRotationPitch + (p_147542_4_.rotationPitch - p_147542_4_.prevRotationPitch) * p_147542_5_; + this.field_147560_j = p_147542_4_.lastTickPosX + (p_147542_4_.posX - p_147542_4_.lastTickPosX) * (double)p_147542_5_; + this.field_147561_k = p_147542_4_.lastTickPosY + (p_147542_4_.posY - p_147542_4_.lastTickPosY) * (double)p_147542_5_; + this.field_147558_l = p_147542_4_.lastTickPosZ + (p_147542_4_.posZ - p_147542_4_.lastTickPosZ) * (double)p_147542_5_; + } + + /** + * Render this TileEntity at its current position from the player + */ + public void renderTileEntity(TileEntity p_147544_1_, float p_147544_2_) + { + if (p_147544_1_.getDistanceFrom(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_147544_1_.getMaxRenderDistanceSquared()) + { + int i = this.field_147550_f.getLightBrightnessForSkyBlocks(p_147544_1_.xCoord, p_147544_1_.yCoord, p_147544_1_.zCoord, 0); + int j = i % 65536; + int k = i / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.renderTileEntityAt(p_147544_1_, (double)p_147544_1_.xCoord - staticPlayerX, (double)p_147544_1_.yCoord - staticPlayerY, (double)p_147544_1_.zCoord - staticPlayerZ, p_147544_2_); + } + } + + /** + * Render this TileEntity at a given set of coordinates + */ + public void renderTileEntityAt(TileEntity p_147549_1_, double p_147549_2_, double p_147549_4_, double p_147549_6_, float p_147549_8_) + { + TileEntitySpecialRenderer tileentityspecialrenderer = this.getSpecialRenderer(p_147549_1_); + + if (tileentityspecialrenderer != null) + { + try + { + tileentityspecialrenderer.renderTileEntityAt(p_147549_1_, p_147549_2_, p_147549_4_, p_147549_6_, p_147549_8_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Block Entity"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block Entity Details"); + p_147549_1_.func_145828_a(crashreportcategory); + throw new ReportedException(crashreport); + } + } + } + + public void func_147543_a(World p_147543_1_) + { + this.field_147550_f = p_147543_1_; + Iterator iterator = this.mapSpecialRenderers.values().iterator(); + + while (iterator.hasNext()) + { + TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)iterator.next(); + + if (tileentityspecialrenderer != null) + { + tileentityspecialrenderer.func_147496_a(p_147543_1_); + } + } + } + + public FontRenderer getFontRenderer() + { + return this.field_147557_n; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java new file mode 100644 index 0000000..4e8900f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntityRendererPiston.java @@ -0,0 +1,83 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityPiston; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TileEntityRendererPiston extends TileEntitySpecialRenderer +{ + private RenderBlocks field_147516_b; + private static final String __OBFID = "CL_00000969"; + + public void renderTileEntityAt(TileEntityPiston p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + Block block = p_147500_1_.getStoredBlockID(); + + if (block.getMaterial() != Material.air && p_147500_1_.func_145860_a(p_147500_8_) < 1.0F) + { + Tessellator tessellator = Tessellator.instance; + this.bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_CULL_FACE); + + if (Minecraft.isAmbientOcclusionEnabled()) + { + GL11.glShadeModel(GL11.GL_SMOOTH); + } + else + { + GL11.glShadeModel(GL11.GL_FLAT); + } + + tessellator.startDrawingQuads(); + tessellator.setTranslation((double)((float)p_147500_2_ - (float)p_147500_1_.xCoord + p_147500_1_.func_145865_b(p_147500_8_)), (double)((float)p_147500_4_ - (float)p_147500_1_.yCoord + p_147500_1_.func_145862_c(p_147500_8_)), (double)((float)p_147500_6_ - (float)p_147500_1_.zCoord + p_147500_1_.func_145859_d(p_147500_8_))); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + + if (block == Blocks.piston_head && p_147500_1_.func_145860_a(p_147500_8_) < 0.5F) + { + this.field_147516_b.renderPistonExtensionAllFaces(block, p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord, false); + } + else if (p_147500_1_.func_145867_d() && !p_147500_1_.isExtending()) + { + Blocks.piston_head.func_150086_a(((BlockPistonBase)block).getPistonExtensionTexture()); + this.field_147516_b.renderPistonExtensionAllFaces(Blocks.piston_head, p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord, p_147500_1_.func_145860_a(p_147500_8_) < 0.5F); + Blocks.piston_head.func_150087_e(); + tessellator.setTranslation((double)((float)p_147500_2_ - (float)p_147500_1_.xCoord), (double)((float)p_147500_4_ - (float)p_147500_1_.yCoord), (double)((float)p_147500_6_ - (float)p_147500_1_.zCoord)); + this.field_147516_b.renderPistonBaseAllFaces(block, p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord); + } + else + { + this.field_147516_b.renderBlockAllFaces(block, p_147500_1_.xCoord, p_147500_1_.yCoord, p_147500_1_.zCoord); + } + + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + tessellator.draw(); + RenderHelper.enableStandardItemLighting(); + } + } + + public void func_147496_a(World p_147496_1_) + { + this.field_147516_b = new RenderBlocks(p_147496_1_); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntityPiston)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java new file mode 100644 index 0000000..6dc7a9a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySignRenderer.java @@ -0,0 +1,98 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.model.ModelSign; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class TileEntitySignRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation field_147513_b = new ResourceLocation("textures/entity/sign.png"); + private final ModelSign field_147514_c = new ModelSign(); + private static final String __OBFID = "CL_00000970"; + + public void renderTileEntityAt(TileEntitySign p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + Block block = p_147500_1_.getBlockType(); + GL11.glPushMatrix(); + float f1 = 0.6666667F; + float f3; + + if (block == Blocks.standing_sign) + { + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * f1, (float)p_147500_6_ + 0.5F); + float f2 = (float)(p_147500_1_.getBlockMetadata() * 360) / 16.0F; + GL11.glRotatef(-f2, 0.0F, 1.0F, 0.0F); + this.field_147514_c.signStick.showModel = true; + } + else + { + int j = p_147500_1_.getBlockMetadata(); + f3 = 0.0F; + + if (j == 2) + { + f3 = 180.0F; + } + + if (j == 4) + { + f3 = 90.0F; + } + + if (j == 5) + { + f3 = -90.0F; + } + + GL11.glTranslatef((float)p_147500_2_ + 0.5F, (float)p_147500_4_ + 0.75F * f1, (float)p_147500_6_ + 0.5F); + GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -0.3125F, -0.4375F); + this.field_147514_c.signStick.showModel = false; + } + + this.bindTexture(field_147513_b); + GL11.glPushMatrix(); + GL11.glScalef(f1, -f1, -f1); + this.field_147514_c.renderSign(); + GL11.glPopMatrix(); + FontRenderer fontrenderer = this.func_147498_b(); + f3 = 0.016666668F * f1; + GL11.glTranslatef(0.0F, 0.5F * f1, 0.07F * f1); + GL11.glScalef(f3, -f3, f3); + GL11.glNormal3f(0.0F, 0.0F, -1.0F * f3); + GL11.glDepthMask(false); + byte b0 = 0; + + for (int i = 0; i < p_147500_1_.signText.length; ++i) + { + String s = p_147500_1_.signText[i]; + + if (i == p_147500_1_.lineBeingEdited) + { + s = "> " + s + " <"; + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, i * 10 - p_147500_1_.signText.length * 5, b0); + } + else + { + fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, i * 10 - p_147500_1_.signText.length * 5, b0); + } + } + + GL11.glDepthMask(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntitySign)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java new file mode 100644 index 0000000..40fdfa8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySkullRenderer.java @@ -0,0 +1,120 @@ +package net.minecraft.client.renderer.tileentity; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.model.ModelSkeletonHead; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class TileEntitySkullRenderer extends TileEntitySpecialRenderer +{ + private static final ResourceLocation field_147537_c = new ResourceLocation("textures/entity/skeleton/skeleton.png"); + private static final ResourceLocation field_147534_d = new ResourceLocation("textures/entity/skeleton/wither_skeleton.png"); + private static final ResourceLocation field_147535_e = new ResourceLocation("textures/entity/zombie/zombie.png"); + private static final ResourceLocation field_147532_f = new ResourceLocation("textures/entity/creeper/creeper.png"); + public static TileEntitySkullRenderer field_147536_b; + private ModelSkeletonHead field_147533_g = new ModelSkeletonHead(0, 0, 64, 32); + private ModelSkeletonHead field_147538_h = new ModelSkeletonHead(0, 0, 64, 64); + private static final String __OBFID = "CL_00000971"; + + public void renderTileEntityAt(TileEntitySkull p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.func_152674_a((float)p_147500_2_, (float)p_147500_4_, (float)p_147500_6_, p_147500_1_.getBlockMetadata() & 7, (float)(p_147500_1_.func_145906_b() * 360) / 16.0F, p_147500_1_.func_145904_a(), p_147500_1_.func_152108_a()); + } + + public void func_147497_a(TileEntityRendererDispatcher p_147497_1_) + { + super.func_147497_a(p_147497_1_); + field_147536_b = this; + } + + public void func_152674_a(float p_152674_1_, float p_152674_2_, float p_152674_3_, int p_152674_4_, float p_152674_5_, int p_152674_6_, GameProfile p_152674_7_) + { + ModelSkeletonHead modelskeletonhead = this.field_147533_g; + + switch (p_152674_6_) + { + case 0: + default: + this.bindTexture(field_147537_c); + break; + case 1: + this.bindTexture(field_147534_d); + break; + case 2: + this.bindTexture(field_147535_e); + modelskeletonhead = this.field_147538_h; + break; + case 3: + ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng; + + if (p_152674_7_ != null) + { + Minecraft minecraft = Minecraft.getMinecraft(); + Map map = minecraft.func_152342_ad().func_152788_a(p_152674_7_); + + if (map.containsKey(Type.SKIN)) + { + resourcelocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN); + } + } + + this.bindTexture(resourcelocation); + break; + case 4: + this.bindTexture(field_147532_f); + } + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + + if (p_152674_4_ != 1) + { + switch (p_152674_4_) + { + case 2: + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.74F); + break; + case 3: + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_ + 0.25F, p_152674_3_ + 0.26F); + p_152674_5_ = 180.0F; + break; + case 4: + GL11.glTranslatef(p_152674_1_ + 0.74F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F); + p_152674_5_ = 270.0F; + break; + case 5: + default: + GL11.glTranslatef(p_152674_1_ + 0.26F, p_152674_2_ + 0.25F, p_152674_3_ + 0.5F); + p_152674_5_ = 90.0F; + } + } + else + { + GL11.glTranslatef(p_152674_1_ + 0.5F, p_152674_2_, p_152674_3_ + 0.5F); + } + + float f4 = 0.0625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + modelskeletonhead.render((Entity)null, 0.0F, 0.0F, 0.0F, p_152674_5_, 0.0F, f4); + GL11.glPopMatrix(); + } + + public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) + { + this.renderTileEntityAt((TileEntitySkull)p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java new file mode 100644 index 0000000..d51632e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer.java @@ -0,0 +1,40 @@ +package net.minecraft.client.renderer.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +@SideOnly(Side.CLIENT) +public abstract class TileEntitySpecialRenderer +{ + protected TileEntityRendererDispatcher field_147501_a; + private static final String __OBFID = "CL_00000964"; + + public abstract void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_); + + protected void bindTexture(ResourceLocation p_147499_1_) + { + TextureManager texturemanager = this.field_147501_a.field_147553_e; + + if (texturemanager != null) + { + texturemanager.bindTexture(p_147499_1_); + } + } + + public void func_147497_a(TileEntityRendererDispatcher p_147497_1_) + { + this.field_147501_a = p_147497_1_; + } + + public void func_147496_a(World p_147496_1_) {} + + public FontRenderer func_147498_b() + { + return this.field_147501_a.getFontRenderer(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/AbstractResourcePack.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/AbstractResourcePack.java new file mode 100644 index 0000000..02398e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/AbstractResourcePack.java @@ -0,0 +1,100 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Charsets; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import javax.imageio.ImageIO; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public abstract class AbstractResourcePack implements IResourcePack +{ + private static final Logger resourceLog = LogManager.getLogger(); + protected final File resourcePackFile; + private static final String __OBFID = "CL_00001072"; + + public AbstractResourcePack(File p_i1287_1_) + { + this.resourcePackFile = p_i1287_1_; + } + + private static String locationToName(ResourceLocation p_110592_0_) + { + return String.format("%s/%s/%s", new Object[] {"assets", p_110592_0_.getResourceDomain(), p_110592_0_.getResourcePath()}); + } + + protected static String getRelativeName(File p_110595_0_, File p_110595_1_) + { + return p_110595_0_.toURI().relativize(p_110595_1_.toURI()).getPath(); + } + + public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException + { + return this.getInputStreamByName(locationToName(p_110590_1_)); + } + + public boolean resourceExists(ResourceLocation p_110589_1_) + { + return this.hasResourceName(locationToName(p_110589_1_)); + } + + protected abstract InputStream getInputStreamByName(String p_110591_1_) throws IOException; + + protected abstract boolean hasResourceName(String p_110593_1_); + + protected void logNameNotLowercase(String p_110594_1_) + { + resourceLog.warn("ResourcePack: ignored non-lowercase namespace: {} in {}", new Object[] {p_110594_1_, this.resourcePackFile}); + } + + public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException + { + return readMetadata(p_135058_1_, this.getInputStreamByName("pack.mcmeta"), p_135058_2_); + } + + static IMetadataSection readMetadata(IMetadataSerializer p_110596_0_, InputStream p_110596_1_, String p_110596_2_) + { + JsonObject jsonobject = null; + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(new InputStreamReader(p_110596_1_, Charsets.UTF_8)); + jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); + } + catch (RuntimeException runtimeexception) + { + throw new JsonParseException(runtimeexception); + } + finally + { + IOUtils.closeQuietly(bufferedreader); + } + + return p_110596_0_.parseMetadataSection(p_110596_2_, jsonobject); + } + + public BufferedImage getPackImage() throws IOException + { + return ImageIO.read(this.getInputStreamByName("pack.png")); + } + + public String getPackName() + { + return this.resourcePackFile.getName(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/DefaultResourcePack.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/DefaultResourcePack.java new file mode 100644 index 0000000..214a729 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/DefaultResourcePack.java @@ -0,0 +1,101 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.ImmutableSet; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.Set; +import javax.imageio.ImageIO; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class DefaultResourcePack implements IResourcePack +{ + public static final Set defaultResourceDomains = ImmutableSet.of("minecraft", "realms"); + private final Map field_152781_b; + private static final String __OBFID = "CL_00001073"; + + public DefaultResourcePack(Map p_i1046_1_) + { + this.field_152781_b = p_i1046_1_; + } + + public InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException + { + InputStream inputstream = this.getResourceStream(p_110590_1_); + + if (inputstream != null) + { + return inputstream; + } + else + { + InputStream inputstream1 = this.func_152780_c(p_110590_1_); + + if (inputstream1 != null) + { + return inputstream1; + } + else + { + throw new FileNotFoundException(p_110590_1_.getResourcePath()); + } + } + } + + public InputStream func_152780_c(ResourceLocation p_152780_1_) throws IOException + { + File file1 = (File)this.field_152781_b.get(p_152780_1_.toString()); + return file1 != null && file1.isFile() ? new FileInputStream(file1) : null; + } + + private InputStream getResourceStream(ResourceLocation p_110605_1_) + { + return DefaultResourcePack.class.getResourceAsStream("/assets/" + p_110605_1_.getResourceDomain() + "/" + p_110605_1_.getResourcePath()); + } + + public boolean resourceExists(ResourceLocation p_110589_1_) + { + return this.getResourceStream(p_110589_1_) != null || this.field_152781_b.containsKey(p_110589_1_.toString()); + } + + public Set getResourceDomains() + { + return defaultResourceDomains; + } + + public IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException + { + try + { + FileInputStream fileinputstream = new FileInputStream((File)this.field_152781_b.get("pack.mcmeta")); + return AbstractResourcePack.readMetadata(p_135058_1_, fileinputstream, p_135058_2_); + } + catch (RuntimeException runtimeexception) + { + return null; + } + catch (FileNotFoundException filenotfoundexception) + { + return null; + } + } + + public BufferedImage getPackImage() throws IOException + { + return ImageIO.read(DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.png")).getResourcePath())); + } + + public String getPackName() + { + return "Default"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/FallbackResourceManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FallbackResourceManager.java new file mode 100644 index 0000000..c99aabf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FallbackResourceManager.java @@ -0,0 +1,99 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class FallbackResourceManager implements IResourceManager +{ + protected final List resourcePacks = new ArrayList(); + private final IMetadataSerializer frmMetadataSerializer; + private static final String __OBFID = "CL_00001074"; + + public FallbackResourceManager(IMetadataSerializer p_i1289_1_) + { + this.frmMetadataSerializer = p_i1289_1_; + } + + public void addResourcePack(IResourcePack p_110538_1_) + { + this.resourcePacks.add(p_110538_1_); + } + + public Set getResourceDomains() + { + return null; + } + + public IResource getResource(ResourceLocation p_110536_1_) throws IOException + { + IResourcePack iresourcepack = null; + ResourceLocation resourcelocation1 = getLocationMcmeta(p_110536_1_); + + for (int i = this.resourcePacks.size() - 1; i >= 0; --i) + { + IResourcePack iresourcepack1 = (IResourcePack)this.resourcePacks.get(i); + + if (iresourcepack == null && iresourcepack1.resourceExists(resourcelocation1)) + { + iresourcepack = iresourcepack1; + } + + if (iresourcepack1.resourceExists(p_110536_1_)) + { + InputStream inputstream = null; + + if (iresourcepack != null) + { + inputstream = iresourcepack.getInputStream(resourcelocation1); + } + + return new SimpleResource(p_110536_1_, iresourcepack1.getInputStream(p_110536_1_), inputstream, this.frmMetadataSerializer); + } + } + + throw new FileNotFoundException(p_110536_1_.toString()); + } + + public List getAllResources(ResourceLocation p_135056_1_) throws IOException + { + ArrayList arraylist = Lists.newArrayList(); + ResourceLocation resourcelocation1 = getLocationMcmeta(p_135056_1_); + Iterator iterator = this.resourcePacks.iterator(); + + while (iterator.hasNext()) + { + IResourcePack iresourcepack = (IResourcePack)iterator.next(); + + if (iresourcepack.resourceExists(p_135056_1_)) + { + InputStream inputstream = iresourcepack.resourceExists(resourcelocation1) ? iresourcepack.getInputStream(resourcelocation1) : null; + arraylist.add(new SimpleResource(p_135056_1_, iresourcepack.getInputStream(p_135056_1_), inputstream, this.frmMetadataSerializer)); + } + } + + if (arraylist.isEmpty()) + { + throw new FileNotFoundException(p_135056_1_.toString()); + } + else + { + return arraylist; + } + } + + static ResourceLocation getLocationMcmeta(ResourceLocation p_110537_0_) + { + return new ResourceLocation(p_110537_0_.getResourceDomain(), p_110537_0_.getResourcePath() + ".mcmeta"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/FileResourcePack.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FileResourcePack.java new file mode 100644 index 0000000..146738a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FileResourcePack.java @@ -0,0 +1,127 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.Closeable; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +@SideOnly(Side.CLIENT) +public class FileResourcePack extends AbstractResourcePack implements Closeable +{ + public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); + private ZipFile resourcePackZipFile; + private static final String __OBFID = "CL_00001075"; + + public FileResourcePack(File p_i1290_1_) + { + super(p_i1290_1_); + } + + private ZipFile getResourcePackZipFile() throws IOException + { + if (this.resourcePackZipFile == null) + { + this.resourcePackZipFile = new ZipFile(this.resourcePackFile); + } + + return this.resourcePackZipFile; + } + + protected InputStream getInputStreamByName(String p_110591_1_) throws IOException + { + ZipFile zipfile = this.getResourcePackZipFile(); + ZipEntry zipentry = zipfile.getEntry(p_110591_1_); + + if (zipentry == null) + { + throw new ResourcePackFileNotFoundException(this.resourcePackFile, p_110591_1_); + } + else + { + return zipfile.getInputStream(zipentry); + } + } + + public boolean hasResourceName(String p_110593_1_) + { + try + { + return this.getResourcePackZipFile().getEntry(p_110593_1_) != null; + } + catch (IOException ioexception) + { + return false; + } + } + + public Set getResourceDomains() + { + ZipFile zipfile; + + try + { + zipfile = this.getResourcePackZipFile(); + } + catch (IOException ioexception) + { + return Collections.emptySet(); + } + + Enumeration enumeration = zipfile.entries(); + HashSet hashset = Sets.newHashSet(); + + while (enumeration.hasMoreElements()) + { + ZipEntry zipentry = (ZipEntry)enumeration.nextElement(); + String s = zipentry.getName(); + + if (s.startsWith("assets/")) + { + ArrayList arraylist = Lists.newArrayList(entryNameSplitter.split(s)); + + if (arraylist.size() > 1) + { + String s1 = (String)arraylist.get(1); + + if (!s1.equals(s1.toLowerCase())) + { + this.logNameNotLowercase(s1); + } + else + { + hashset.add(s1); + } + } + } + } + + return hashset; + } + + protected void finalize() throws Throwable + { + this.close(); + super.finalize(); + } + + public void close() throws IOException + { + if (this.resourcePackZipFile != null) + { + this.resourcePackZipFile.close(); + this.resourcePackZipFile = null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/FolderResourcePack.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FolderResourcePack.java new file mode 100644 index 0000000..bb25062 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FolderResourcePack.java @@ -0,0 +1,63 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashSet; +import java.util.Set; +import org.apache.commons.io.filefilter.DirectoryFileFilter; + +@SideOnly(Side.CLIENT) +public class FolderResourcePack extends AbstractResourcePack +{ + private static final String __OBFID = "CL_00001076"; + + public FolderResourcePack(File p_i1291_1_) + { + super(p_i1291_1_); + } + + protected InputStream getInputStreamByName(String p_110591_1_) throws IOException + { + return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, p_110591_1_))); + } + + protected boolean hasResourceName(String p_110593_1_) + { + return (new File(this.resourcePackFile, p_110593_1_)).isFile(); + } + + public Set getResourceDomains() + { + HashSet hashset = Sets.newHashSet(); + File file1 = new File(this.resourcePackFile, "assets/"); + + if (file1.isDirectory()) + { + File[] afile = file1.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY); + int i = afile.length; + + for (int j = 0; j < i; ++j) + { + File file2 = afile[j]; + String s = getRelativeName(file1, file2); + + if (!s.equals(s.toLowerCase())) + { + this.logNameNotLowercase(s); + } + else + { + hashset.add(s.substring(0, s.length() - 1)); + } + } + } + + return hashset; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/FoliageColorReloadListener.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FoliageColorReloadListener.java new file mode 100644 index 0000000..fec610f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/FoliageColorReloadListener.java @@ -0,0 +1,27 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerFoliage; + +@SideOnly(Side.CLIENT) +public class FoliageColorReloadListener implements IResourceManagerReloadListener +{ + private static final ResourceLocation field_130079_a = new ResourceLocation("textures/colormap/foliage.png"); + private static final String __OBFID = "CL_00001077"; + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + try + { + ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(p_110549_1_, field_130079_a)); + } + catch (IOException ioexception) + { + ; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/GrassColorReloadListener.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/GrassColorReloadListener.java new file mode 100644 index 0000000..614d588 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/GrassColorReloadListener.java @@ -0,0 +1,27 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.ColorizerGrass; + +@SideOnly(Side.CLIENT) +public class GrassColorReloadListener implements IResourceManagerReloadListener +{ + private static final ResourceLocation field_130078_a = new ResourceLocation("textures/colormap/grass.png"); + private static final String __OBFID = "CL_00001078"; + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + try + { + ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(p_110549_1_, field_130078_a)); + } + catch (IOException ioexception) + { + ; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/I18n.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/I18n.java new file mode 100644 index 0000000..f71287e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/I18n.java @@ -0,0 +1,24 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class I18n +{ + private static Locale i18nLocale; + private static final String __OBFID = "CL_00001094"; + + static void setLocale(Locale p_135051_0_) + { + i18nLocale = p_135051_0_; + } + + /** + * format(a, b) is equivalent to String.format(translate(a), b). Args: translationKey, params... + */ + public static String format(String p_135052_0_, Object ... p_135052_1_) + { + return i18nLocale.formatMessage(p_135052_0_, p_135052_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/IReloadableResourceManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IReloadableResourceManager.java new file mode 100644 index 0000000..8694544 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IReloadableResourceManager.java @@ -0,0 +1,13 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; + +@SideOnly(Side.CLIENT) +public interface IReloadableResourceManager extends IResourceManager +{ + void reloadResources(List p_110541_1_); + + void registerReloadListener(IResourceManagerReloadListener p_110542_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResource.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResource.java new file mode 100644 index 0000000..1f4e7d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResource.java @@ -0,0 +1,16 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.InputStream; +import net.minecraft.client.resources.data.IMetadataSection; + +@SideOnly(Side.CLIENT) +public interface IResource +{ + InputStream getInputStream(); + + boolean hasMetadata(); + + IMetadataSection getMetadata(String p_110526_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManager.java new file mode 100644 index 0000000..a84982e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManager.java @@ -0,0 +1,18 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.List; +import java.util.Set; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public interface IResourceManager +{ + Set getResourceDomains(); + + IResource getResource(ResourceLocation p_110536_1_) throws IOException; + + List getAllResources(ResourceLocation p_135056_1_) throws IOException; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManagerReloadListener.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManagerReloadListener.java new file mode 100644 index 0000000..6095f68 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourceManagerReloadListener.java @@ -0,0 +1,10 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IResourceManagerReloadListener +{ + void onResourceManagerReload(IResourceManager p_110549_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourcePack.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourcePack.java new file mode 100644 index 0000000..0bfd00a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/IResourcePack.java @@ -0,0 +1,27 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public interface IResourcePack +{ + InputStream getInputStream(ResourceLocation p_110590_1_) throws IOException; + + boolean resourceExists(ResourceLocation p_110589_1_); + + Set getResourceDomains(); + + IMetadataSection getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException; + + BufferedImage getPackImage() throws IOException; + + String getPackName(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/Language.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/Language.java new file mode 100644 index 0000000..92da1b2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/Language.java @@ -0,0 +1,57 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class Language implements Comparable +{ + private final String languageCode; + private final String region; + private final String name; + private final boolean bidirectional; + private static final String __OBFID = "CL_00001095"; + + public Language(String p_i1303_1_, String p_i1303_2_, String p_i1303_3_, boolean p_i1303_4_) + { + this.languageCode = p_i1303_1_; + this.region = p_i1303_2_; + this.name = p_i1303_3_; + this.bidirectional = p_i1303_4_; + } + + public String getLanguageCode() + { + return this.languageCode; + } + + public boolean isBidirectional() + { + return this.bidirectional; + } + + public String toString() + { + return String.format("%s (%s)", new Object[] {this.name, this.region}); + } + + public boolean equals(Object p_equals_1_) + { + return this == p_equals_1_ ? true : (!(p_equals_1_ instanceof Language) ? false : this.languageCode.equals(((Language)p_equals_1_).languageCode)); + } + + public int hashCode() + { + return this.languageCode.hashCode(); + } + + public int compareTo(Language p_compareTo_1_) + { + return this.languageCode.compareTo(p_compareTo_1_.languageCode); + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((Language)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/LanguageManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/LanguageManager.java new file mode 100644 index 0000000..ed00b0d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/LanguageManager.java @@ -0,0 +1,116 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.LanguageMetadataSection; +import net.minecraft.util.StringTranslate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class LanguageManager implements IResourceManagerReloadListener +{ + private static final Logger logger = LogManager.getLogger(); + private final IMetadataSerializer theMetadataSerializer; + private String currentLanguage; + protected static final Locale currentLocale = new Locale(); + private Map languageMap = Maps.newHashMap(); + private static final String __OBFID = "CL_00001096"; + + public LanguageManager(IMetadataSerializer p_i1304_1_, String p_i1304_2_) + { + this.theMetadataSerializer = p_i1304_1_; + this.currentLanguage = p_i1304_2_; + I18n.setLocale(currentLocale); + } + + public void parseLanguageMetadata(List p_135043_1_) + { + this.languageMap.clear(); + Iterator iterator = p_135043_1_.iterator(); + + while (iterator.hasNext()) + { + IResourcePack iresourcepack = (IResourcePack)iterator.next(); + + try + { + LanguageMetadataSection languagemetadatasection = (LanguageMetadataSection)iresourcepack.getPackMetadata(this.theMetadataSerializer, "language"); + + if (languagemetadatasection != null) + { + Iterator iterator1 = languagemetadatasection.getLanguages().iterator(); + + while (iterator1.hasNext()) + { + Language language = (Language)iterator1.next(); + + if (!this.languageMap.containsKey(language.getLanguageCode())) + { + this.languageMap.put(language.getLanguageCode(), language); + } + } + } + } + catch (RuntimeException runtimeexception) + { + logger.warn("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName(), runtimeexception); + } + catch (IOException ioexception) + { + logger.warn("Unable to parse metadata section of resourcepack: " + iresourcepack.getPackName(), ioexception); + } + } + } + + public void onResourceManagerReload(IResourceManager p_110549_1_) + { + ArrayList arraylist = Lists.newArrayList(new String[] {"en_US"}); + + if (!"en_US".equals(this.currentLanguage)) + { + arraylist.add(this.currentLanguage); + } + + currentLocale.loadLocaleDataFiles(p_110549_1_, arraylist); + LanguageRegistry.instance().mergeLanguageTable(currentLocale.field_135032_a, this.currentLanguage); + StringTranslate.replaceWith(currentLocale.field_135032_a); + } + + public boolean isCurrentLocaleUnicode() + { + return currentLocale.isUnicode(); + } + + public boolean isCurrentLanguageBidirectional() + { + return this.getCurrentLanguage() != null && this.getCurrentLanguage().isBidirectional(); + } + + public void setCurrentLanguage(Language p_135045_1_) + { + this.currentLanguage = p_135045_1_.getLanguageCode(); + } + + public Language getCurrentLanguage() + { + return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); + } + + public SortedSet getLanguages() + { + return Sets.newTreeSet(this.languageMap.values()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/Locale.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/Locale.java new file mode 100644 index 0000000..e654583 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/Locale.java @@ -0,0 +1,153 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.io.InputStream; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +@SideOnly(Side.CLIENT) +public class Locale +{ + /** Splits on "=" */ + private static final Splitter splitter = Splitter.on('=').limit(2); + private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + Map field_135032_a = Maps.newHashMap(); + private boolean field_135029_d; + private static final String __OBFID = "CL_00001097"; + + /** + * par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang + */ + public synchronized void loadLocaleDataFiles(IResourceManager p_135022_1_, List p_135022_2_) + { + this.field_135032_a.clear(); + Iterator iterator = p_135022_2_.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + String s1 = String.format("lang/%s.lang", new Object[] {s}); + Iterator iterator1 = p_135022_1_.getResourceDomains().iterator(); + + while (iterator1.hasNext()) + { + String s2 = (String)iterator1.next(); + + try + { + this.loadLocaleData(p_135022_1_.getAllResources(new ResourceLocation(s2, s1))); + } + catch (IOException ioexception) + { + ; + } + } + } + + this.checkUnicode(); + } + + public boolean isUnicode() + { + return this.field_135029_d; + } + + private void checkUnicode() + { + this.field_135029_d = false; + int i = 0; + int j = 0; + Iterator iterator = this.field_135032_a.values().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + int k = s.length(); + j += k; + + for (int l = 0; l < k; ++l) + { + if (s.charAt(l) >= 256) + { + ++i; + } + } + } + + float f = (float)i / (float)j; + this.field_135029_d = (double)f > 0.1D; + } + + /** + * par1 is a list of Resources + */ + private void loadLocaleData(List p_135028_1_) throws IOException + { + Iterator iterator = p_135028_1_.iterator(); + + while (iterator.hasNext()) + { + IResource iresource = (IResource)iterator.next(); + this.loadLocaleData(iresource.getInputStream()); + } + } + + private void loadLocaleData(InputStream p_135021_1_) throws IOException + { + Iterator iterator = IOUtils.readLines(p_135021_1_, Charsets.UTF_8).iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (!s.isEmpty() && s.charAt(0) != 35) + { + String[] astring = (String[])Iterables.toArray(splitter.split(s), String.class); + + if (astring != null && astring.length == 2) + { + String s1 = astring[0]; + String s2 = field_135031_c.matcher(astring[1]).replaceAll("%$1s"); + this.field_135032_a.put(s1, s2); + } + } + } + } + + /** + * Returns the translation, or the key itself if the key could not be translated. + */ + private String translateKeyPrivate(String p_135026_1_) + { + String s1 = (String)this.field_135032_a.get(p_135026_1_); + return s1 == null ? p_135026_1_ : s1; + } + + /** + * Calls String.format(translateKey(key), params) + */ + public String formatMessage(String p_135023_1_, Object[] p_135023_2_) + { + String s1 = this.translateKeyPrivate(p_135023_1_); + + try + { + return String.format(s1, p_135023_2_); + } + catch (IllegalFormatException illegalformatexception) + { + return "Format error: " + s1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourceIndex.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourceIndex.java new file mode 100644 index 0000000..6ac57a7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourceIndex.java @@ -0,0 +1,79 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Charsets; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.JsonUtils; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ResourceIndex +{ + private static final Logger field_152783_a = LogManager.getLogger(); + private final Map field_152784_b = Maps.newHashMap(); + private static final String __OBFID = "CL_00001831"; + + public ResourceIndex(File p_i1047_1_, String p_i1047_2_) + { + if (p_i1047_2_ != null) + { + File file2 = new File(p_i1047_1_, "objects"); + File file3 = new File(p_i1047_1_, "indexes/" + p_i1047_2_ + ".json"); + BufferedReader bufferedreader = null; + + try + { + bufferedreader = Files.newReader(file3, Charsets.UTF_8); + JsonObject jsonobject = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); + JsonObject jsonobject1 = JsonUtils.getJsonObjectFieldOrDefault(jsonobject, "objects", (JsonObject)null); + + if (jsonobject1 != null) + { + Iterator iterator = jsonobject1.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + JsonObject jsonobject2 = (JsonObject)entry.getValue(); + String s1 = (String)entry.getKey(); + String[] astring = s1.split("/", 2); + String s2 = astring.length == 1 ? astring[0] : astring[0] + ":" + astring[1]; + String s3 = JsonUtils.getJsonObjectStringFieldValue(jsonobject2, "hash"); + File file4 = new File(file2, s3.substring(0, 2) + "/" + s3); + this.field_152784_b.put(s2, file4); + } + } + } + catch (JsonParseException jsonparseexception) + { + field_152783_a.error("Unable to parse resource index file: " + file3); + } + catch (FileNotFoundException filenotfoundexception) + { + field_152783_a.error("Can\'t find the resource index file: " + file3); + } + finally + { + IOUtils.closeQuietly(bufferedreader); + } + } + } + + public Map func_152782_a() + { + return this.field_152784_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java new file mode 100644 index 0000000..4e31b35 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackFileNotFoundException.java @@ -0,0 +1,17 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileNotFoundException; + +@SideOnly(Side.CLIENT) +public class ResourcePackFileNotFoundException extends FileNotFoundException +{ + private static final String __OBFID = "CL_00001086"; + + public ResourcePackFileNotFoundException(File p_i1294_1_, String p_i1294_2_) + { + super(String.format("\'%s\' in ResourcePack \'%s\'", new Object[] {p_i1294_2_, p_i1294_1_})); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntry.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntry.java new file mode 100644 index 0000000..197c4e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntry.java @@ -0,0 +1,196 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiListExtended; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public abstract class ResourcePackListEntry implements GuiListExtended.IGuiListEntry +{ + private static final ResourceLocation field_148316_c = new ResourceLocation("textures/gui/resource_packs.png"); + protected final Minecraft field_148317_a; + protected final GuiScreenResourcePacks field_148315_b; + private static final String __OBFID = "CL_00000821"; + + public ResourcePackListEntry(GuiScreenResourcePacks p_i45051_1_) + { + this.field_148315_b = p_i45051_1_; + this.field_148317_a = Minecraft.getMinecraft(); + } + + public void drawEntry(int p_148279_1_, int p_148279_2_, int p_148279_3_, int p_148279_4_, int p_148279_5_, Tessellator p_148279_6_, int p_148279_7_, int p_148279_8_, boolean p_148279_9_) + { + this.func_148313_c(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Gui.func_146110_a(p_148279_2_, p_148279_3_, 0.0F, 0.0F, 32, 32, 32.0F, 32.0F); + int i2; + + if ((this.field_148317_a.gameSettings.touchscreen || p_148279_9_) && this.func_148310_d()) + { + this.field_148317_a.getTextureManager().bindTexture(field_148316_c); + Gui.drawRect(p_148279_2_, p_148279_3_, p_148279_2_ + 32, p_148279_3_ + 32, -1601138544); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int l1 = p_148279_7_ - p_148279_2_; + i2 = p_148279_8_ - p_148279_3_; + + if (this.func_148309_e()) + { + if (l1 < 32) + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 0.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 0.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + else + { + if (this.func_148308_f()) + { + if (l1 < 16) + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 32.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 32.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148314_g()) + { + if (l1 < 32 && l1 > 16 && i2 < 16) + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 96.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 96.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + + if (this.func_148307_h()) + { + if (l1 < 32 && l1 > 16 && i2 > 16) + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 64.0F, 32.0F, 32, 32, 256.0F, 256.0F); + } + else + { + Gui.func_146110_a(p_148279_2_, p_148279_3_, 64.0F, 0.0F, 32, 32, 256.0F, 256.0F); + } + } + } + } + + String s = this.func_148312_b(); + i2 = this.field_148317_a.fontRenderer.getStringWidth(s); + + if (i2 > 157) + { + s = this.field_148317_a.fontRenderer.trimStringToWidth(s, 157 - this.field_148317_a.fontRenderer.getStringWidth("...")) + "..."; + } + + this.field_148317_a.fontRenderer.drawStringWithShadow(s, p_148279_2_ + 32 + 2, p_148279_3_ + 1, 16777215); + List list = this.field_148317_a.fontRenderer.listFormattedStringToWidth(this.func_148311_a(), 157); + + for (int j2 = 0; j2 < 2 && j2 < list.size(); ++j2) + { + this.field_148317_a.fontRenderer.drawStringWithShadow((String)list.get(j2), p_148279_2_ + 32 + 2, p_148279_3_ + 12 + 10 * j2, 8421504); + } + } + + protected abstract String func_148311_a(); + + protected abstract String func_148312_b(); + + protected abstract void func_148313_c(); + + protected boolean func_148310_d() + { + return true; + } + + protected boolean func_148309_e() + { + return !this.field_148315_b.func_146961_a(this); + } + + protected boolean func_148308_f() + { + return this.field_148315_b.func_146961_a(this); + } + + protected boolean func_148314_g() + { + List list = this.field_148315_b.func_146962_b(this); + int i = list.indexOf(this); + return i > 0 && ((ResourcePackListEntry)list.get(i - 1)).func_148310_d(); + } + + protected boolean func_148307_h() + { + List list = this.field_148315_b.func_146962_b(this); + int i = list.indexOf(this); + return i >= 0 && i < list.size() - 1 && ((ResourcePackListEntry)list.get(i + 1)).func_148310_d(); + } + + /** + * Returns true if the mouse has been pressed on this control. + */ + public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) + { + if (this.func_148310_d() && p_148278_5_ <= 32) + { + if (this.func_148309_e()) + { + this.field_148315_b.func_146962_b(this).remove(this); + this.field_148315_b.func_146963_h().add(0, this); + return true; + } + + if (p_148278_5_ < 16 && this.func_148308_f()) + { + this.field_148315_b.func_146962_b(this).remove(this); + this.field_148315_b.func_146964_g().add(0, this); + return true; + } + + List list; + int k1; + + if (p_148278_5_ > 16 && p_148278_6_ < 16 && this.func_148314_g()) + { + list = this.field_148315_b.func_146962_b(this); + k1 = list.indexOf(this); + list.remove(this); + list.add(k1 - 1, this); + return true; + } + + if (p_148278_5_ > 16 && p_148278_6_ > 16 && this.func_148307_h()) + { + list = this.field_148315_b.func_146962_b(this); + k1 = list.indexOf(this); + list.remove(this); + list.add(k1 + 1, this); + return true; + } + } + + return false; + } + + /** + * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY + */ + public void mouseReleased(int p_148277_1_, int p_148277_2_, int p_148277_3_, int p_148277_4_, int p_148277_5_, int p_148277_6_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java new file mode 100644 index 0000000..81908ea --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryDefault.java @@ -0,0 +1,99 @@ +package net.minecraft.client.resources; + +import com.google.gson.JsonParseException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.client.gui.GuiScreenResourcePacks; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ResourcePackListEntryDefault extends ResourcePackListEntry +{ + private static final Logger logger = LogManager.getLogger(); + private final IResourcePack field_148320_d; + private final ResourceLocation field_148321_e; + private static final String __OBFID = "CL_00000822"; + + public ResourcePackListEntryDefault(GuiScreenResourcePacks p_i45052_1_) + { + super(p_i45052_1_); + this.field_148320_d = this.field_148317_a.getResourcePackRepository().rprDefaultResourcePack; + DynamicTexture dynamictexture; + + try + { + dynamictexture = new DynamicTexture(this.field_148320_d.getPackImage()); + } + catch (IOException ioexception) + { + dynamictexture = TextureUtil.missingTexture; + } + + this.field_148321_e = this.field_148317_a.getTextureManager().getDynamicTextureLocation("texturepackicon", dynamictexture); + } + + protected String func_148311_a() + { + try + { + PackMetadataSection packmetadatasection = (PackMetadataSection)this.field_148320_d.getPackMetadata(this.field_148317_a.getResourcePackRepository().rprMetadataSerializer, "pack"); + + if (packmetadatasection != null) + { + return packmetadatasection.func_152805_a().getFormattedText(); + } + } + catch (JsonParseException jsonparseexception) + { + logger.error("Couldn\'t load metadata info", jsonparseexception); + } + catch (IOException ioexception) + { + logger.error("Couldn\'t load metadata info", ioexception); + } + + return EnumChatFormatting.RED + "Missing " + "pack.mcmeta" + " :("; + } + + protected boolean func_148309_e() + { + return false; + } + + protected boolean func_148308_f() + { + return false; + } + + protected boolean func_148314_g() + { + return false; + } + + protected boolean func_148307_h() + { + return false; + } + + protected String func_148312_b() + { + return "Default"; + } + + protected void func_148313_c() + { + this.field_148317_a.getTextureManager().bindTexture(this.field_148321_e); + } + + protected boolean func_148310_d() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryFound.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryFound.java new file mode 100644 index 0000000..f55fbcb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackListEntryFound.java @@ -0,0 +1,38 @@ +package net.minecraft.client.resources; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiScreenResourcePacks; + +@SideOnly(Side.CLIENT) +public class ResourcePackListEntryFound extends ResourcePackListEntry +{ + private final ResourcePackRepository.Entry field_148319_c; + private static final String __OBFID = "CL_00000823"; + + public ResourcePackListEntryFound(GuiScreenResourcePacks p_i45053_1_, ResourcePackRepository.Entry p_i45053_2_) + { + super(p_i45053_1_); + this.field_148319_c = p_i45053_2_; + } + + protected void func_148313_c() + { + this.field_148319_c.bindTexturePackIcon(this.field_148317_a.getTextureManager()); + } + + protected String func_148311_a() + { + return this.field_148319_c.getTexturePackDescription(); + } + + protected String func_148312_b() + { + return this.field_148319_c.getResourcePackName(); + } + + public ResourcePackRepository.Entry func_148318_i() + { + return this.field_148319_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackRepository.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackRepository.java new file mode 100644 index 0000000..cb7ab35 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/ResourcePackRepository.java @@ -0,0 +1,304 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.Closeable; +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreenWorking; +import net.minecraft.client.renderer.texture.DynamicTexture; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.client.resources.data.PackMetadataSection; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; + +@SideOnly(Side.CLIENT) +public class ResourcePackRepository +{ + protected static final FileFilter resourcePackFilter = new FileFilter() + { + private static final String __OBFID = "CL_00001088"; + public boolean accept(File p_accept_1_) + { + boolean flag = p_accept_1_.isFile() && p_accept_1_.getName().endsWith(".zip"); + boolean flag1 = p_accept_1_.isDirectory() && (new File(p_accept_1_, "pack.mcmeta")).isFile(); + return flag || flag1; + } + }; + private final File dirResourcepacks; + public final IResourcePack rprDefaultResourcePack; + private final File field_148534_e; + public final IMetadataSerializer rprMetadataSerializer; + private IResourcePack field_148532_f; + private boolean field_148533_g; + private List repositoryEntriesAll = Lists.newArrayList(); + private List repositoryEntries = Lists.newArrayList(); + private static final String __OBFID = "CL_00001087"; + + public ResourcePackRepository(File p_i45101_1_, File p_i45101_2_, IResourcePack p_i45101_3_, IMetadataSerializer p_i45101_4_, GameSettings p_i45101_5_) + { + this.dirResourcepacks = p_i45101_1_; + this.field_148534_e = p_i45101_2_; + this.rprDefaultResourcePack = p_i45101_3_; + this.rprMetadataSerializer = p_i45101_4_; + this.fixDirResourcepacks(); + this.updateRepositoryEntriesAll(); + Iterator iterator = p_i45101_5_.resourcePacks.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + Iterator iterator1 = this.repositoryEntriesAll.iterator(); + + while (iterator1.hasNext()) + { + ResourcePackRepository.Entry entry = (ResourcePackRepository.Entry)iterator1.next(); + + if (entry.getResourcePackName().equals(s)) + { + this.repositoryEntries.add(entry); + break; + } + } + } + } + + private void fixDirResourcepacks() + { + if (!this.dirResourcepacks.isDirectory()) + { + this.dirResourcepacks.delete(); + this.dirResourcepacks.mkdirs(); + } + } + + private List getResourcePackFiles() + { + return this.dirResourcepacks.isDirectory() ? Arrays.asList(this.dirResourcepacks.listFiles(resourcePackFilter)) : Collections.emptyList(); + } + + public void updateRepositoryEntriesAll() + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.getResourcePackFiles().iterator(); + + while (iterator.hasNext()) + { + File file1 = (File)iterator.next(); + ResourcePackRepository.Entry entry = new ResourcePackRepository.Entry(file1, null); + + if (!this.repositoryEntriesAll.contains(entry)) + { + try + { + entry.updateResourcePack(); + arraylist.add(entry); + } + catch (Exception exception) + { + arraylist.remove(entry); + } + } + else + { + int i = this.repositoryEntriesAll.indexOf(entry); + + if (i > -1 && i < this.repositoryEntriesAll.size()) + { + arraylist.add(this.repositoryEntriesAll.get(i)); + } + } + } + + this.repositoryEntriesAll.removeAll(arraylist); + iterator = this.repositoryEntriesAll.iterator(); + + while (iterator.hasNext()) + { + ResourcePackRepository.Entry entry1 = (ResourcePackRepository.Entry)iterator.next(); + entry1.closeResourcePack(); + } + + this.repositoryEntriesAll = arraylist; + } + + public List getRepositoryEntriesAll() + { + return ImmutableList.copyOf(this.repositoryEntriesAll); + } + + public List getRepositoryEntries() + { + return ImmutableList.copyOf(this.repositoryEntries); + } + + public void func_148527_a(List p_148527_1_) + { + this.repositoryEntries.clear(); + this.repositoryEntries.addAll(p_148527_1_); + } + + public File getDirResourcepacks() + { + return this.dirResourcepacks; + } + + public void func_148526_a(String p_148526_1_) + { + String s1 = p_148526_1_.substring(p_148526_1_.lastIndexOf("/") + 1); + + if (s1.contains("?")) + { + s1 = s1.substring(0, s1.indexOf("?")); + } + + if (s1.endsWith(".zip")) + { + File file1 = new File(this.field_148534_e, s1.replaceAll("\\W", "")); + this.func_148529_f(); + this.func_148528_a(p_148526_1_, file1); + } + } + + private void func_148528_a(String p_148528_1_, File p_148528_2_) + { + HashMap hashmap = Maps.newHashMap(); + GuiScreenWorking guiscreenworking = new GuiScreenWorking(); + hashmap.put("X-Minecraft-Username", Minecraft.getMinecraft().getSession().getUsername()); + hashmap.put("X-Minecraft-UUID", Minecraft.getMinecraft().getSession().getPlayerID()); + hashmap.put("X-Minecraft-Version", "1.7.10"); + this.field_148533_g = true; + Minecraft.getMinecraft().displayGuiScreen(guiscreenworking); + HttpUtil.func_151223_a(p_148528_2_, p_148528_1_, new HttpUtil.DownloadListener() + { + private static final String __OBFID = "CL_00001089"; + public void func_148522_a(File p_148522_1_) + { + if (ResourcePackRepository.this.field_148533_g) + { + ResourcePackRepository.this.field_148533_g = false; + ResourcePackRepository.this.field_148532_f = new FileResourcePack(p_148522_1_); + Minecraft.getMinecraft().scheduleResourcesRefresh(); + } + } + }, hashmap, 52428800, guiscreenworking, Minecraft.getMinecraft().getProxy()); + } + + public IResourcePack func_148530_e() + { + return this.field_148532_f; + } + + public void func_148529_f() + { + this.field_148532_f = null; + this.field_148533_g = false; + } + + @SideOnly(Side.CLIENT) + public class Entry + { + private final File resourcePackFile; + private IResourcePack reResourcePack; + private PackMetadataSection rePackMetadataSection; + private BufferedImage texturePackIcon; + private ResourceLocation locationTexturePackIcon; + private static final String __OBFID = "CL_00001090"; + + private Entry(File p_i1295_2_) + { + this.resourcePackFile = p_i1295_2_; + } + + public void updateResourcePack() throws IOException + { + this.reResourcePack = (IResourcePack)(this.resourcePackFile.isDirectory() ? new FolderResourcePack(this.resourcePackFile) : new FileResourcePack(this.resourcePackFile)); + this.rePackMetadataSection = (PackMetadataSection)this.reResourcePack.getPackMetadata(ResourcePackRepository.this.rprMetadataSerializer, "pack"); + + try + { + this.texturePackIcon = this.reResourcePack.getPackImage(); + } + catch (IOException ioexception) + { + ; + } + + if (this.texturePackIcon == null) + { + this.texturePackIcon = ResourcePackRepository.this.rprDefaultResourcePack.getPackImage(); + } + + this.closeResourcePack(); + } + + public void bindTexturePackIcon(TextureManager p_110518_1_) + { + if (this.locationTexturePackIcon == null) + { + this.locationTexturePackIcon = p_110518_1_.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon)); + } + + p_110518_1_.bindTexture(this.locationTexturePackIcon); + } + + public void closeResourcePack() + { + if (this.reResourcePack instanceof Closeable) + { + IOUtils.closeQuietly((Closeable)this.reResourcePack); + } + } + + public IResourcePack getResourcePack() + { + return this.reResourcePack; + } + + public String getResourcePackName() + { + return this.reResourcePack.getPackName(); + } + + public String getTexturePackDescription() + { + return this.rePackMetadataSection == null ? EnumChatFormatting.RED + "Invalid pack.mcmeta (or missing \'pack\' section)" : this.rePackMetadataSection.func_152805_a().getFormattedText(); + } + + public boolean equals(Object p_equals_1_) + { + return this == p_equals_1_ ? true : (p_equals_1_ instanceof ResourcePackRepository.Entry ? this.toString().equals(p_equals_1_.toString()) : false); + } + + public int hashCode() + { + return this.toString().hashCode(); + } + + public String toString() + { + return String.format("%s:%s:%d", new Object[] {this.resourcePackFile.getName(), this.resourcePackFile.isDirectory() ? "folder" : "zip", Long.valueOf(this.resourcePackFile.lastModified())}); + } + + Entry(File p_i1296_2_, Object p_i1296_3_) + { + this(p_i1296_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java new file mode 100644 index 0000000..082ca75 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleReloadableResourceManager.java @@ -0,0 +1,147 @@ +package net.minecraft.client.resources; + +import com.google.common.base.Function; +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class SimpleReloadableResourceManager implements IReloadableResourceManager +{ + private static final Logger logger = LogManager.getLogger(); + private static final Joiner joinerResourcePacks = Joiner.on(", "); + private final Map domainResourceManagers = Maps.newHashMap(); + private final List reloadListeners = Lists.newArrayList(); + private final Set setResourceDomains = Sets.newLinkedHashSet(); + private final IMetadataSerializer rmMetadataSerializer; + private static final String __OBFID = "CL_00001091"; + + public SimpleReloadableResourceManager(IMetadataSerializer p_i1299_1_) + { + this.rmMetadataSerializer = p_i1299_1_; + } + + public void reloadResourcePack(IResourcePack p_110545_1_) + { + FallbackResourceManager fallbackresourcemanager; + + for (Iterator iterator = p_110545_1_.getResourceDomains().iterator(); iterator.hasNext(); fallbackresourcemanager.addResourcePack(p_110545_1_)) + { + String s = (String)iterator.next(); + this.setResourceDomains.add(s); + fallbackresourcemanager = (FallbackResourceManager)this.domainResourceManagers.get(s); + + if (fallbackresourcemanager == null) + { + fallbackresourcemanager = new FallbackResourceManager(this.rmMetadataSerializer); + this.domainResourceManagers.put(s, fallbackresourcemanager); + } + } + } + + public Set getResourceDomains() + { + return this.setResourceDomains; + } + + public IResource getResource(ResourceLocation p_110536_1_) throws IOException + { + IResourceManager iresourcemanager = (IResourceManager)this.domainResourceManagers.get(p_110536_1_.getResourceDomain()); + + if (iresourcemanager != null) + { + return iresourcemanager.getResource(p_110536_1_); + } + else + { + throw new FileNotFoundException(p_110536_1_.toString()); + } + } + + public List getAllResources(ResourceLocation p_135056_1_) throws IOException + { + IResourceManager iresourcemanager = (IResourceManager)this.domainResourceManagers.get(p_135056_1_.getResourceDomain()); + + if (iresourcemanager != null) + { + return iresourcemanager.getAllResources(p_135056_1_); + } + else + { + throw new FileNotFoundException(p_135056_1_.toString()); + } + } + + private void clearResources() + { + this.domainResourceManagers.clear(); + this.setResourceDomains.clear(); + } + + public void reloadResources(List p_110541_1_) + { + this.clearResources(); + cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Loading Resources", p_110541_1_.size()+1, true); + logger.info("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(p_110541_1_, new Function() + { + private static final String __OBFID = "CL_00001092"; + public String apply(IResourcePack p_apply_1_) + { + return p_apply_1_.getPackName(); + } + public Object apply(Object p_apply_1_) + { + return this.apply((IResourcePack)p_apply_1_); + } + }))); + Iterator iterator = p_110541_1_.iterator(); + + while (iterator.hasNext()) + { + IResourcePack iresourcepack = (IResourcePack)iterator.next(); + resReload.step(iresourcepack.getPackName()); + this.reloadResourcePack(iresourcepack); + } + + resReload.step("Reloading listeners"); + this.notifyReloadListeners(); + cpw.mods.fml.common.ProgressManager.pop(resReload); + } + + public void registerReloadListener(IResourceManagerReloadListener p_110542_1_) + { + this.reloadListeners.add(p_110542_1_); + cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Loading Resource", 1); + resReload.step(p_110542_1_.getClass()); + p_110542_1_.onResourceManagerReload(this); + cpw.mods.fml.common.ProgressManager.pop(resReload); + } + + private void notifyReloadListeners() + { + Iterator iterator = this.reloadListeners.iterator(); + + cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Reloading", this.reloadListeners.size()); + while (iterator.hasNext()) + { + IResourceManagerReloadListener iresourcemanagerreloadlistener = (IResourceManagerReloadListener)iterator.next(); + resReload.step(iresourcemanagerreloadlistener.getClass()); + iresourcemanagerreloadlistener.onResourceManagerReload(this); + } + cpw.mods.fml.common.ProgressManager.pop(resReload); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleResource.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleResource.java new file mode 100644 index 0000000..88209e3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SimpleResource.java @@ -0,0 +1,103 @@ +package net.minecraft.client.resources; + +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Map; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; + +@SideOnly(Side.CLIENT) +public class SimpleResource implements IResource +{ + private final Map mapMetadataSections = Maps.newHashMap(); + private final ResourceLocation srResourceLocation; + private final InputStream resourceInputStream; + private final InputStream mcmetaInputStream; + private final IMetadataSerializer srMetadataSerializer; + private boolean mcmetaJsonChecked; + private JsonObject mcmetaJson; + private static final String __OBFID = "CL_00001093"; + + public SimpleResource(ResourceLocation p_i1300_1_, InputStream p_i1300_2_, InputStream p_i1300_3_, IMetadataSerializer p_i1300_4_) + { + this.srResourceLocation = p_i1300_1_; + this.resourceInputStream = p_i1300_2_; + this.mcmetaInputStream = p_i1300_3_; + this.srMetadataSerializer = p_i1300_4_; + } + + public InputStream getInputStream() + { + return this.resourceInputStream; + } + + public boolean hasMetadata() + { + return this.mcmetaInputStream != null; + } + + public IMetadataSection getMetadata(String p_110526_1_) + { + if (!this.hasMetadata()) + { + return null; + } + else + { + if (this.mcmetaJson == null && !this.mcmetaJsonChecked) + { + this.mcmetaJsonChecked = true; + BufferedReader bufferedreader = null; + + try + { + bufferedreader = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); + this.mcmetaJson = (new JsonParser()).parse(bufferedreader).getAsJsonObject(); + } + finally + { + IOUtils.closeQuietly(bufferedreader); + } + } + + IMetadataSection imetadatasection = (IMetadataSection)this.mapMetadataSections.get(p_110526_1_); + + if (imetadatasection == null) + { + imetadatasection = this.srMetadataSerializer.parseMetadataSection(p_110526_1_, this.mcmetaJson); + } + + return imetadatasection; + } + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ instanceof SimpleResource) + { + SimpleResource simpleresource = (SimpleResource)p_equals_1_; + return this.srResourceLocation != null ? this.srResourceLocation.equals(simpleresource.srResourceLocation) : simpleresource.srResourceLocation == null; + } + else + { + return false; + } + } + + public int hashCode() + { + return this.srResourceLocation == null ? 0 : this.srResourceLocation.hashCode(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/SkinManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SkinManager.java new file mode 100644 index 0000000..529be03 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/SkinManager.java @@ -0,0 +1,166 @@ +package net.minecraft.client.resources; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.InsecureTextureException; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.IImageBuffer; +import net.minecraft.client.renderer.ImageBufferDownload; +import net.minecraft.client.renderer.ThreadDownloadImageData; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class SkinManager +{ + public static final ResourceLocation field_152793_a = new ResourceLocation("textures/entity/steve.png"); + private static final ExecutorService field_152794_b = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue()); + private final TextureManager field_152795_c; + private final File field_152796_d; + private final MinecraftSessionService field_152797_e; + private final LoadingCache field_152798_f; + private static final String __OBFID = "CL_00001830"; + + public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService) + { + this.field_152795_c = textureManagerInstance; + this.field_152796_d = skinCacheDirectory; + this.field_152797_e = sessionService; + this.field_152798_f = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).build(new CacheLoader() + { + private static final String __OBFID = "CL_00001829"; + public Map func_152786_a(GameProfile p_152786_1_) + { + return Minecraft.getMinecraft().func_152347_ac().getTextures(p_152786_1_, false); + } + public Object load(Object p_load_1_) + { + return this.func_152786_a((GameProfile)p_load_1_); + } + }); + } + + public ResourceLocation func_152792_a(MinecraftProfileTexture p_152792_1_, Type p_152792_2_) + { + return this.func_152789_a(p_152792_1_, p_152792_2_, (SkinManager.SkinAvailableCallback)null); + } + + public ResourceLocation func_152789_a(MinecraftProfileTexture p_152789_1_, final Type p_152789_2_, final SkinManager.SkinAvailableCallback p_152789_3_) + { + final ResourceLocation resourcelocation = new ResourceLocation("skins/" + p_152789_1_.getHash()); + ITextureObject itextureobject = this.field_152795_c.getTexture(resourcelocation); + + if (itextureobject != null) + { + if (p_152789_3_ != null) + { + p_152789_3_.func_152121_a(p_152789_2_, resourcelocation); + } + } + else + { + File file1 = new File(this.field_152796_d, p_152789_1_.getHash().substring(0, 2)); + File file2 = new File(file1, p_152789_1_.getHash()); + final ImageBufferDownload imagebufferdownload = p_152789_2_ == Type.SKIN ? new ImageBufferDownload() : null; + ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, p_152789_1_.getUrl(), field_152793_a, new IImageBuffer() + { + private static final String __OBFID = "CL_00001828"; + public BufferedImage parseUserSkin(BufferedImage p_78432_1_) + { + if (imagebufferdownload != null) + { + p_78432_1_ = imagebufferdownload.parseUserSkin(p_78432_1_); + } + + return p_78432_1_; + } + public void func_152634_a() + { + if (imagebufferdownload != null) + { + imagebufferdownload.func_152634_a(); + } + + if (p_152789_3_ != null) + { + p_152789_3_.func_152121_a(p_152789_2_, resourcelocation); + } + } + }); + this.field_152795_c.loadTexture(resourcelocation, threaddownloadimagedata); + } + + return resourcelocation; + } + + public void func_152790_a(final GameProfile p_152790_1_, final SkinManager.SkinAvailableCallback p_152790_2_, final boolean p_152790_3_) + { + field_152794_b.submit(new Runnable() + { + private static final String __OBFID = "CL_00001827"; + public void run() + { + final HashMap hashmap = Maps.newHashMap(); + + try + { + hashmap.putAll(SkinManager.this.field_152797_e.getTextures(p_152790_1_, p_152790_3_)); + } + catch (InsecureTextureException insecuretextureexception) + { + ; + } + + if (hashmap.isEmpty() && p_152790_1_.getId().equals(Minecraft.getMinecraft().getSession().func_148256_e().getId())) + { + hashmap.putAll(SkinManager.this.field_152797_e.getTextures(SkinManager.this.field_152797_e.fillProfileProperties(p_152790_1_, false), false)); + } + + Minecraft.getMinecraft().func_152344_a(new Runnable() + { + private static final String __OBFID = "CL_00001826"; + public void run() + { + if (hashmap.containsKey(Type.SKIN)) + { + SkinManager.this.func_152789_a((MinecraftProfileTexture)hashmap.get(Type.SKIN), Type.SKIN, p_152790_2_); + } + + if (hashmap.containsKey(Type.CAPE)) + { + SkinManager.this.func_152789_a((MinecraftProfileTexture)hashmap.get(Type.CAPE), Type.CAPE, p_152790_2_); + } + } + }); + } + }); + } + + public Map func_152788_a(GameProfile p_152788_1_) + { + return (Map)this.field_152798_f.getUnchecked(p_152788_1_); + } + + @SideOnly(Side.CLIENT) + public interface SkinAvailableCallback + { + void func_152121_a(Type skinPart, ResourceLocation skinLoc); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationFrame.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationFrame.java new file mode 100644 index 0000000..5931f9c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationFrame.java @@ -0,0 +1,38 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class AnimationFrame +{ + private final int frameIndex; + private final int frameTime; + private static final String __OBFID = "CL_00001104"; + + public AnimationFrame(int p_i1307_1_) + { + this(p_i1307_1_, -1); + } + + public AnimationFrame(int p_i1308_1_, int p_i1308_2_) + { + this.frameIndex = p_i1308_1_; + this.frameTime = p_i1308_2_; + } + + public boolean hasNoTime() + { + return this.frameTime == -1; + } + + public int getFrameTime() + { + return this.frameTime; + } + + public int getFrameIndex() + { + return this.frameIndex; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSection.java new file mode 100644 index 0000000..dbeb221 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSection.java @@ -0,0 +1,82 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +@SideOnly(Side.CLIENT) +public class AnimationMetadataSection implements IMetadataSection +{ + private final List animationFrames; + private final int frameWidth; + private final int frameHeight; + private final int frameTime; + private static final String __OBFID = "CL_00001106"; + + public AnimationMetadataSection(List p_i1309_1_, int p_i1309_2_, int p_i1309_3_, int p_i1309_4_) + { + this.animationFrames = p_i1309_1_; + this.frameWidth = p_i1309_2_; + this.frameHeight = p_i1309_3_; + this.frameTime = p_i1309_4_; + } + + public int getFrameHeight() + { + return this.frameHeight; + } + + public int getFrameWidth() + { + return this.frameWidth; + } + + public int getFrameCount() + { + return this.animationFrames.size(); + } + + public int getFrameTime() + { + return this.frameTime; + } + + private AnimationFrame getAnimationFrame(int p_130072_1_) + { + return (AnimationFrame)this.animationFrames.get(p_130072_1_); + } + + public int getFrameTimeSingle(int p_110472_1_) + { + AnimationFrame animationframe = this.getAnimationFrame(p_110472_1_); + return animationframe.hasNoTime() ? this.frameTime : animationframe.getFrameTime(); + } + + public boolean frameHasTime(int p_110470_1_) + { + return !((AnimationFrame)this.animationFrames.get(p_110470_1_)).hasNoTime(); + } + + public int getFrameIndex(int p_110468_1_) + { + return ((AnimationFrame)this.animationFrames.get(p_110468_1_)).getFrameIndex(); + } + + public Set getFrameIndexSet() + { + HashSet hashset = Sets.newHashSet(); + Iterator iterator = this.animationFrames.iterator(); + + while (iterator.hasNext()) + { + AnimationFrame animationframe = (AnimationFrame)iterator.next(); + hashset.add(Integer.valueOf(animationframe.getFrameIndex())); + } + + return hashset; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java new file mode 100644 index 0000000..1cc4a2e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/AnimationMetadataSectionSerializer.java @@ -0,0 +1,154 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import java.util.ArrayList; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +@SideOnly(Side.CLIENT) +public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer +{ + private static final String __OBFID = "CL_00001107"; + + public AnimationMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + ArrayList arraylist = Lists.newArrayList(); + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "metadata section"); + int i = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "frametime", 1); + + if (i != 1) + { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(i), "Invalid default frame time", new Object[0]); + } + + int j; + + if (jsonobject.has("frames")) + { + try + { + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "frames"); + + for (j = 0; j < jsonarray.size(); ++j) + { + JsonElement jsonelement1 = jsonarray.get(j); + AnimationFrame animationframe = this.parseAnimationFrame(j, jsonelement1); + + if (animationframe != null) + { + arraylist.add(animationframe); + } + } + } + catch (ClassCastException classcastexception) + { + throw new JsonParseException("Invalid animation->frames: expected array, was " + jsonobject.get("frames"), classcastexception); + } + } + + int k = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "width", -1); + j = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "height", -1); + + if (k != -1) + { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(k), "Invalid width", new Object[0]); + } + + if (j != -1) + { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(j), "Invalid height", new Object[0]); + } + + return new AnimationMetadataSection(arraylist, k, j, i); + } + + private AnimationFrame parseAnimationFrame(int p_110492_1_, JsonElement p_110492_2_) + { + if (p_110492_2_.isJsonPrimitive()) + { + return new AnimationFrame(JsonUtils.getJsonElementIntegerValue(p_110492_2_, "frames[" + p_110492_1_ + "]")); + } + else if (p_110492_2_.isJsonObject()) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_110492_2_, "frames[" + p_110492_1_ + "]"); + int j = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "time", -1); + + if (jsonobject.has("time")) + { + Validate.inclusiveBetween(Integer.valueOf(1), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(j), "Invalid frame time", new Object[0]); + } + + int k = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "index"); + Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(Integer.MAX_VALUE), Integer.valueOf(k), "Invalid frame index", new Object[0]); + return new AnimationFrame(k, j); + } + else + { + return null; + } + } + + public JsonElement serialize(AnimationMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("frametime", Integer.valueOf(p_serialize_1_.getFrameTime())); + + if (p_serialize_1_.getFrameWidth() != -1) + { + jsonobject.addProperty("width", Integer.valueOf(p_serialize_1_.getFrameWidth())); + } + + if (p_serialize_1_.getFrameHeight() != -1) + { + jsonobject.addProperty("height", Integer.valueOf(p_serialize_1_.getFrameHeight())); + } + + if (p_serialize_1_.getFrameCount() > 0) + { + JsonArray jsonarray = new JsonArray(); + + for (int i = 0; i < p_serialize_1_.getFrameCount(); ++i) + { + if (p_serialize_1_.frameHasTime(i)) + { + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("index", Integer.valueOf(p_serialize_1_.getFrameIndex(i))); + jsonobject1.addProperty("time", Integer.valueOf(p_serialize_1_.getFrameTimeSingle(i))); + jsonarray.add(jsonobject1); + } + else + { + jsonarray.add(new JsonPrimitive(Integer.valueOf(p_serialize_1_.getFrameIndex(i)))); + } + } + + jsonobject.add("frames", jsonarray); + } + + return jsonobject; + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() + { + return "animation"; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((AnimationMetadataSection)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java new file mode 100644 index 0000000..7de4080 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/BaseMetadataSectionSerializer.java @@ -0,0 +1,10 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public abstract class BaseMetadataSectionSerializer implements IMetadataSectionSerializer +{ + private static final String __OBFID = "CL_00001098"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSection.java new file mode 100644 index 0000000..00d6a47 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSection.java @@ -0,0 +1,20 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class FontMetadataSection implements IMetadataSection +{ + private final float[] charWidths; + private final float[] charLefts; + private final float[] charSpacings; + private static final String __OBFID = "CL_00001108"; + + public FontMetadataSection(float[] p_i1310_1_, float[] p_i1310_2_, float[] p_i1310_3_) + { + this.charWidths = p_i1310_1_; + this.charLefts = p_i1310_2_; + this.charSpacings = p_i1310_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java new file mode 100644 index 0000000..9721aac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/FontMetadataSectionSerializer.java @@ -0,0 +1,87 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import net.minecraft.util.JsonUtils; +import org.apache.commons.lang3.Validate; + +@SideOnly(Side.CLIENT) +public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + private static final String __OBFID = "CL_00001109"; + + public FontMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + float[] afloat = new float[256]; + float[] afloat1 = new float[256]; + float[] afloat2 = new float[256]; + float f = 1.0F; + float f1 = 0.0F; + float f2 = 0.0F; + + if (jsonobject.has("characters")) + { + if (!jsonobject.get("characters").isJsonObject()) + { + throw new JsonParseException("Invalid font->characters: expected object, was " + jsonobject.get("characters")); + } + + JsonObject jsonobject1 = jsonobject.getAsJsonObject("characters"); + + if (jsonobject1.has("default")) + { + if (!jsonobject1.get("default").isJsonObject()) + { + throw new JsonParseException("Invalid font->characters->default: expected object, was " + jsonobject1.get("default")); + } + + JsonObject jsonobject2 = jsonobject1.getAsJsonObject("default"); + f = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject2, "width", f); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f), "Invalid default width", new Object[0]); + f1 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject2, "spacing", f1); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f1), "Invalid default spacing", new Object[0]); + f2 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject2, "left", f1); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f2), "Invalid default left", new Object[0]); + } + + for (int i = 0; i < 256; ++i) + { + JsonElement jsonelement1 = jsonobject1.get(Integer.toString(i)); + float f3 = f; + float f4 = f1; + float f5 = f2; + + if (jsonelement1 != null) + { + JsonObject jsonobject3 = JsonUtils.getJsonElementAsJsonObject(jsonelement1, "characters[" + i + "]"); + f3 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject3, "width", f); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f3), "Invalid width", new Object[0]); + f4 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject3, "spacing", f1); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f4), "Invalid spacing", new Object[0]); + f5 = JsonUtils.getJsonObjectFloatFieldValueOrDefault(jsonobject3, "left", f2); + Validate.inclusiveBetween(Float.valueOf(0.0F), Float.valueOf(Float.MAX_VALUE), Float.valueOf(f5), "Invalid left", new Object[0]); + } + + afloat[i] = f3; + afloat1[i] = f4; + afloat2[i] = f5; + } + } + + return new FontMetadataSection(afloat, afloat2, afloat1); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() + { + return "font"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSection.java new file mode 100644 index 0000000..89e6a77 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSection.java @@ -0,0 +1,9 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IMetadataSection +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java new file mode 100644 index 0000000..83ae976 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSectionSerializer.java @@ -0,0 +1,14 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IMetadataSectionSerializer extends JsonDeserializer +{ + /** + * The name of this section type as it appears in JSON. + */ + String getSectionName(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSerializer.java new file mode 100644 index 0000000..95e0d62 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/IMetadataSerializer.java @@ -0,0 +1,97 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IRegistry; +import net.minecraft.util.RegistrySimple; + +@SideOnly(Side.CLIENT) +public class IMetadataSerializer +{ + private final IRegistry metadataSectionSerializerRegistry = new RegistrySimple(); + private final GsonBuilder gsonBuilder = new GsonBuilder(); + /** Cached Gson instance. Set to null when more sections are registered, and then re-created from the builder. */ + private Gson gson; + private static final String __OBFID = "CL_00001101"; + + public IMetadataSerializer() + { + this.gsonBuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + this.gsonBuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + } + + public void registerMetadataSectionType(IMetadataSectionSerializer p_110504_1_, Class p_110504_2_) + { + this.metadataSectionSerializerRegistry.putObject(p_110504_1_.getSectionName(), new IMetadataSerializer.Registration(p_110504_1_, p_110504_2_, null)); + this.gsonBuilder.registerTypeAdapter(p_110504_2_, p_110504_1_); + this.gson = null; + } + + public IMetadataSection parseMetadataSection(String p_110503_1_, JsonObject p_110503_2_) + { + if (p_110503_1_ == null) + { + throw new IllegalArgumentException("Metadata section name cannot be null"); + } + else if (!p_110503_2_.has(p_110503_1_)) + { + return null; + } + else if (!p_110503_2_.get(p_110503_1_).isJsonObject()) + { + throw new IllegalArgumentException("Invalid metadata for \'" + p_110503_1_ + "\' - expected object, found " + p_110503_2_.get(p_110503_1_)); + } + else + { + IMetadataSerializer.Registration registration = (IMetadataSerializer.Registration)this.metadataSectionSerializerRegistry.getObject(p_110503_1_); + + if (registration == null) + { + throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + p_110503_1_ + "\'"); + } + else + { + return (IMetadataSection)this.getGson().fromJson(p_110503_2_.getAsJsonObject(p_110503_1_), registration.field_110500_b); + } + } + } + + /** + * Returns a Gson instance with type adapters registered for metadata sections. + */ + private Gson getGson() + { + if (this.gson == null) + { + this.gson = this.gsonBuilder.create(); + } + + return this.gson; + } + + @SideOnly(Side.CLIENT) + class Registration + { + final IMetadataSectionSerializer field_110502_a; + final Class field_110500_b; + private static final String __OBFID = "CL_00001103"; + + private Registration(IMetadataSectionSerializer p_i1305_2_, Class p_i1305_3_) + { + this.field_110502_a = p_i1305_2_; + this.field_110500_b = p_i1305_3_; + } + + Registration(IMetadataSectionSerializer p_i1306_2_, Class p_i1306_3_, Object p_i1306_4_) + { + this(p_i1306_2_, p_i1306_3_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSection.java new file mode 100644 index 0000000..fab034e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSection.java @@ -0,0 +1,22 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; + +@SideOnly(Side.CLIENT) +public class LanguageMetadataSection implements IMetadataSection +{ + private final Collection languages; + private static final String __OBFID = "CL_00001110"; + + public LanguageMetadataSection(Collection p_i1311_1_) + { + this.languages = p_i1311_1_; + } + + public Collection getLanguages() + { + return this.languages; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java new file mode 100644 index 0000000..59b43be --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/LanguageMetadataSectionSerializer.java @@ -0,0 +1,68 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Sets; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map.Entry; +import net.minecraft.client.resources.Language; +import net.minecraft.util.JsonUtils; + +@SideOnly(Side.CLIENT) +public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + private static final String __OBFID = "CL_00001111"; + + public LanguageMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + HashSet hashset = Sets.newHashSet(); + Iterator iterator = jsonobject.entrySet().iterator(); + String s; + String s1; + String s2; + boolean flag; + + do + { + if (!iterator.hasNext()) + { + return new LanguageMetadataSection(hashset); + } + + Entry entry = (Entry)iterator.next(); + s = (String)entry.getKey(); + JsonObject jsonobject1 = JsonUtils.getJsonElementAsJsonObject((JsonElement)entry.getValue(), "language"); + s1 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "region"); + s2 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "name"); + flag = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject1, "bidirectional", false); + + if (s1.isEmpty()) + { + throw new JsonParseException("Invalid language->\'" + s + "\'->region: empty value"); + } + + if (s2.isEmpty()) + { + throw new JsonParseException("Invalid language->\'" + s + "\'->name: empty value"); + } + } + while (hashset.add(new Language(s, s1, s2, flag))); + + throw new JsonParseException("Duplicate language->\'" + s + "\' defined"); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() + { + return "language"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSection.java new file mode 100644 index 0000000..6d44973 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSection.java @@ -0,0 +1,29 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.IChatComponent; + +@SideOnly(Side.CLIENT) +public class PackMetadataSection implements IMetadataSection +{ + private final IChatComponent packDescription; + private final int packFormat; + private static final String __OBFID = "CL_00001112"; + + public PackMetadataSection(IChatComponent p_i1034_1_, int p_i1034_2_) + { + this.packDescription = p_i1034_1_; + this.packFormat = p_i1034_2_; + } + + public IChatComponent func_152805_a() + { + return this.packDescription; + } + + public int getPackFormat() + { + return this.packFormat; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java new file mode 100644 index 0000000..399a829 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/PackMetadataSectionSerializer.java @@ -0,0 +1,47 @@ +package net.minecraft.client.resources.data; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +@SideOnly(Side.CLIENT) +public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer +{ + private static final String __OBFID = "CL_00001113"; + + public PackMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + IChatComponent ichatcomponent = (IChatComponent)p_deserialize_3_.deserialize(jsonobject.get("description"), IChatComponent.class); + int i = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "pack_format"); + return new PackMetadataSection(ichatcomponent, i); + } + + public JsonElement serialize(PackMetadataSection p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("pack_format", Integer.valueOf(p_serialize_1_.getPackFormat())); + jsonobject.add("description", p_serialize_3_.serialize(p_serialize_1_.func_152805_a())); + return jsonobject; + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() + { + return "pack"; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((PackMetadataSection)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSection.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSection.java new file mode 100644 index 0000000..5a7c7af --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSection.java @@ -0,0 +1,37 @@ +package net.minecraft.client.resources.data; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collections; +import java.util.List; + +@SideOnly(Side.CLIENT) +public class TextureMetadataSection implements IMetadataSection +{ + private final boolean textureBlur; + private final boolean textureClamp; + private final List listMipmaps; + private static final String __OBFID = "CL_00001114"; + + public TextureMetadataSection(boolean p_i45102_1_, boolean p_i45102_2_, List p_i45102_3_) + { + this.textureBlur = p_i45102_1_; + this.textureClamp = p_i45102_2_; + this.listMipmaps = p_i45102_3_; + } + + public boolean getTextureBlur() + { + return this.textureBlur; + } + + public boolean getTextureClamp() + { + return this.textureClamp; + } + + public List getListMipmaps() + { + return Collections.unmodifiableList(this.listMipmaps); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java new file mode 100644 index 0000000..990961c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/resources/data/TextureMetadataSectionSerializer.java @@ -0,0 +1,70 @@ +package net.minecraft.client.resources.data; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import java.util.ArrayList; +import net.minecraft.util.JsonUtils; + +@SideOnly(Side.CLIENT) +public class TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer +{ + private static final String __OBFID = "CL_00001115"; + + public TextureMetadataSection deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + boolean flag = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject, "blur", false); + boolean flag1 = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject, "clamp", false); + ArrayList arraylist = Lists.newArrayList(); + + if (jsonobject.has("mipmaps")) + { + try + { + JsonArray jsonarray = jsonobject.getAsJsonArray("mipmaps"); + + for (int i = 0; i < jsonarray.size(); ++i) + { + JsonElement jsonelement1 = jsonarray.get(i); + + if (jsonelement1.isJsonPrimitive()) + { + try + { + arraylist.add(Integer.valueOf(jsonelement1.getAsInt())); + } + catch (NumberFormatException numberformatexception) + { + throw new JsonParseException("Invalid texture->mipmap->" + i + ": expected number, was " + jsonelement1, numberformatexception); + } + } + else if (jsonelement1.isJsonObject()) + { + throw new JsonParseException("Invalid texture->mipmap->" + i + ": expected number, was " + jsonelement1); + } + } + } + catch (ClassCastException classcastexception) + { + throw new JsonParseException("Invalid texture->mipmaps: expected array, was " + jsonobject.get("mipmaps"), classcastexception); + } + } + + return new TextureMetadataSection(flag, flag1, arraylist); + } + + /** + * The name of this section type as it appears in JSON. + */ + public String getSectionName() + { + return "texture"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/settings/GameSettings.java b/build/rfg/minecraft-src/java/net/minecraft/client/settings/GameSettings.java new file mode 100644 index 0000000..35ba7ee --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/settings/GameSettings.java @@ -0,0 +1,1531 @@ +package net.minecraft.client.settings; + +import com.google.common.collect.Maps; +import com.google.gson.Gson; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.PrintWriter; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.stream.TwitchStream; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; + +@SideOnly(Side.CLIENT) +public class GameSettings +{ + private static final Logger logger = LogManager.getLogger(); + private static final Gson gson = new Gson(); + private static final ParameterizedType typeListString = new ParameterizedType() + { + private static final String __OBFID = "CL_00000651"; + public Type[] getActualTypeArguments() + { + return new Type[] {String.class}; + } + public Type getRawType() + { + return List.class; + } + public Type getOwnerType() + { + return null; + } + }; + /** GUI scale values */ + private static final String[] GUISCALES = new String[] {"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; + private static final String[] PARTICLES = new String[] {"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; + private static final String[] AMBIENT_OCCLUSIONS = new String[] {"options.ao.off", "options.ao.min", "options.ao.max"}; + private static final String[] field_152391_aS = new String[] {"options.stream.compression.low", "options.stream.compression.medium", "options.stream.compression.high"}; + private static final String[] field_152392_aT = new String[] {"options.stream.chat.enabled.streaming", "options.stream.chat.enabled.always", "options.stream.chat.enabled.never"}; + private static final String[] field_152393_aU = new String[] {"options.stream.chat.userFilter.all", "options.stream.chat.userFilter.subs", "options.stream.chat.userFilter.mods"}; + private static final String[] field_152394_aV = new String[] {"options.stream.mic_toggle.mute", "options.stream.mic_toggle.talk"}; + public float mouseSensitivity = 0.5F; + public boolean invertMouse; + public int renderDistanceChunks = -1; + public boolean viewBobbing = true; + public boolean anaglyph; + /** Advanced OpenGL */ + public boolean advancedOpengl; + public boolean fboEnable = true; + public int limitFramerate = 120; + public boolean fancyGraphics = true; + /** Smooth Lighting */ + public int ambientOcclusion = 2; + /** Clouds flag */ + public boolean clouds = true; + public List resourcePacks = new ArrayList(); + public EntityPlayer.EnumChatVisibility chatVisibility; + public boolean chatColours; + public boolean chatLinks; + public boolean chatLinksPrompt; + public float chatOpacity; + public boolean snooperEnabled; + public boolean fullScreen; + public boolean enableVsync; + public boolean hideServerAddress; + /** Whether to show advanced information on item tooltips, toggled by F3+H */ + public boolean advancedItemTooltips; + /** Whether to pause when the game loses focus, toggled by F3+P */ + public boolean pauseOnLostFocus; + /** Whether to show your cape */ + public boolean showCape; + public boolean touchscreen; + public int overrideWidth; + public int overrideHeight; + public boolean heldItemTooltips; + public float chatScale; + public float chatWidth; + public float chatHeightUnfocused; + public float chatHeightFocused; + public boolean showInventoryAchievementHint; + public int mipmapLevels; + public int anisotropicFiltering; + private Map mapSoundLevels; + public float field_152400_J; + public float field_152401_K; + public float field_152402_L; + public float field_152403_M; + public float field_152404_N; + public int field_152405_O; + public boolean field_152406_P; + public String field_152407_Q; + public int field_152408_R; + public int field_152409_S; + public int field_152410_T; + public KeyBinding keyBindForward; + public KeyBinding keyBindLeft; + public KeyBinding keyBindBack; + public KeyBinding keyBindRight; + public KeyBinding keyBindJump; + public KeyBinding keyBindSneak; + public KeyBinding keyBindInventory; + public KeyBinding keyBindUseItem; + public KeyBinding keyBindDrop; + public KeyBinding keyBindAttack; + public KeyBinding keyBindPickBlock; + public KeyBinding keyBindSprint; + public KeyBinding keyBindChat; + public KeyBinding keyBindPlayerList; + public KeyBinding keyBindCommand; + public KeyBinding keyBindScreenshot; + public KeyBinding keyBindTogglePerspective; + public KeyBinding keyBindSmoothCamera; + public KeyBinding field_152395_am; + public KeyBinding field_152396_an; + public KeyBinding field_152397_ao; + public KeyBinding field_152398_ap; + public KeyBinding field_152399_aq; + public KeyBinding[] keyBindsHotbar; + public KeyBinding[] keyBindings; + protected Minecraft mc; + private File optionsFile; + public EnumDifficulty difficulty; + public boolean hideGUI; + public int thirdPersonView; + /** true if debug info should be displayed instead of version */ + public boolean showDebugInfo; + public boolean showDebugProfilerChart; + /** The lastServer string. */ + public String lastServer; + /** No clipping for singleplayer */ + public boolean noclip; + /** Smooth Camera Toggle */ + public boolean smoothCamera; + public boolean debugCamEnable; + /** No clipping movement rate */ + public float noclipRate; + /** Change rate for debug camera */ + public float debugCamRate; + public float fovSetting; + public float gammaSetting; + public float saturation; + /** GUI scale */ + public int guiScale; + /** Determines amount of particles. 0 = All, 1 = Decreased, 2 = Minimal */ + public int particleSetting; + /** Game settings language */ + public String language; + public boolean forceUnicodeFont; + private static final String __OBFID = "CL_00000650"; + + public GameSettings(Minecraft p_i1016_1_, File p_i1016_2_) + { + this.chatVisibility = EntityPlayer.EnumChatVisibility.FULL; + this.chatColours = true; + this.chatLinks = true; + this.chatLinksPrompt = true; + this.chatOpacity = 1.0F; + this.snooperEnabled = true; + this.enableVsync = true; + this.pauseOnLostFocus = true; + this.showCape = true; + this.heldItemTooltips = true; + this.chatScale = 1.0F; + this.chatWidth = 1.0F; + this.chatHeightUnfocused = 0.44366196F; + this.chatHeightFocused = 1.0F; + this.showInventoryAchievementHint = true; + this.mipmapLevels = 4; + this.anisotropicFiltering = 1; + this.mapSoundLevels = Maps.newEnumMap(SoundCategory.class); + this.field_152400_J = 0.5F; + this.field_152401_K = 1.0F; + this.field_152402_L = 1.0F; + this.field_152403_M = 0.5412844F; + this.field_152404_N = 0.31690142F; + this.field_152405_O = 1; + this.field_152406_P = true; + this.field_152407_Q = ""; + this.field_152408_R = 0; + this.field_152409_S = 0; + this.field_152410_T = 0; + this.keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); + this.keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); + this.keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); + this.keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); + this.keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); + this.keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); + this.keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + this.keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + this.keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + this.keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); + this.keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); + this.keyBindSprint = new KeyBinding("key.sprint", 29, "key.categories.gameplay"); + this.keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); + this.keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); + this.keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); + this.keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); + this.keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + this.keyBindSmoothCamera = new KeyBinding("key.smoothCamera", 0, "key.categories.misc"); + this.field_152395_am = new KeyBinding("key.fullscreen", 87, "key.categories.misc"); + this.field_152396_an = new KeyBinding("key.streamStartStop", 64, "key.categories.stream"); + this.field_152397_ao = new KeyBinding("key.streamPauseUnpause", 65, "key.categories.stream"); + this.field_152398_ap = new KeyBinding("key.streamCommercial", 0, "key.categories.stream"); + this.field_152399_aq = new KeyBinding("key.streamToggleMic", 0, "key.categories.stream"); + this.keyBindsHotbar = new KeyBinding[] {new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 4, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 5, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 6, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 7, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 8, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 9, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 10, "key.categories.inventory")}; + this.keyBindings = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindSprint, this.field_152396_an, this.field_152397_ao, this.field_152398_ap, this.field_152399_aq, this.field_152395_am}, this.keyBindsHotbar); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.noclipRate = 1.0F; + this.debugCamRate = 1.0F; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + this.mc = p_i1016_1_; + this.optionsFile = new File(p_i1016_2_, "options.txt"); + GameSettings.Options.RENDER_DISTANCE.setValueMax(16.0F); + this.renderDistanceChunks = p_i1016_1_.isJava64bit() ? 12 : 8; + this.loadOptions(); + } + + public GameSettings() + { + this.chatVisibility = EntityPlayer.EnumChatVisibility.FULL; + this.chatColours = true; + this.chatLinks = true; + this.chatLinksPrompt = true; + this.chatOpacity = 1.0F; + this.snooperEnabled = true; + this.enableVsync = true; + this.pauseOnLostFocus = true; + this.showCape = true; + this.heldItemTooltips = true; + this.chatScale = 1.0F; + this.chatWidth = 1.0F; + this.chatHeightUnfocused = 0.44366196F; + this.chatHeightFocused = 1.0F; + this.showInventoryAchievementHint = true; + this.mipmapLevels = 4; + this.anisotropicFiltering = 1; + this.mapSoundLevels = Maps.newEnumMap(SoundCategory.class); + this.field_152400_J = 0.5F; + this.field_152401_K = 1.0F; + this.field_152402_L = 1.0F; + this.field_152403_M = 0.5412844F; + this.field_152404_N = 0.31690142F; + this.field_152405_O = 1; + this.field_152406_P = true; + this.field_152407_Q = ""; + this.field_152408_R = 0; + this.field_152409_S = 0; + this.field_152410_T = 0; + this.keyBindForward = new KeyBinding("key.forward", 17, "key.categories.movement"); + this.keyBindLeft = new KeyBinding("key.left", 30, "key.categories.movement"); + this.keyBindBack = new KeyBinding("key.back", 31, "key.categories.movement"); + this.keyBindRight = new KeyBinding("key.right", 32, "key.categories.movement"); + this.keyBindJump = new KeyBinding("key.jump", 57, "key.categories.movement"); + this.keyBindSneak = new KeyBinding("key.sneak", 42, "key.categories.movement"); + this.keyBindInventory = new KeyBinding("key.inventory", 18, "key.categories.inventory"); + this.keyBindUseItem = new KeyBinding("key.use", -99, "key.categories.gameplay"); + this.keyBindDrop = new KeyBinding("key.drop", 16, "key.categories.gameplay"); + this.keyBindAttack = new KeyBinding("key.attack", -100, "key.categories.gameplay"); + this.keyBindPickBlock = new KeyBinding("key.pickItem", -98, "key.categories.gameplay"); + this.keyBindSprint = new KeyBinding("key.sprint", 29, "key.categories.gameplay"); + this.keyBindChat = new KeyBinding("key.chat", 20, "key.categories.multiplayer"); + this.keyBindPlayerList = new KeyBinding("key.playerlist", 15, "key.categories.multiplayer"); + this.keyBindCommand = new KeyBinding("key.command", 53, "key.categories.multiplayer"); + this.keyBindScreenshot = new KeyBinding("key.screenshot", 60, "key.categories.misc"); + this.keyBindTogglePerspective = new KeyBinding("key.togglePerspective", 63, "key.categories.misc"); + this.keyBindSmoothCamera = new KeyBinding("key.smoothCamera", 0, "key.categories.misc"); + this.field_152395_am = new KeyBinding("key.fullscreen", 87, "key.categories.misc"); + this.field_152396_an = new KeyBinding("key.streamStartStop", 64, "key.categories.stream"); + this.field_152397_ao = new KeyBinding("key.streamPauseUnpause", 65, "key.categories.stream"); + this.field_152398_ap = new KeyBinding("key.streamCommercial", 0, "key.categories.stream"); + this.field_152399_aq = new KeyBinding("key.streamToggleMic", 0, "key.categories.stream"); + this.keyBindsHotbar = new KeyBinding[] {new KeyBinding("key.hotbar.1", 2, "key.categories.inventory"), new KeyBinding("key.hotbar.2", 3, "key.categories.inventory"), new KeyBinding("key.hotbar.3", 4, "key.categories.inventory"), new KeyBinding("key.hotbar.4", 5, "key.categories.inventory"), new KeyBinding("key.hotbar.5", 6, "key.categories.inventory"), new KeyBinding("key.hotbar.6", 7, "key.categories.inventory"), new KeyBinding("key.hotbar.7", 8, "key.categories.inventory"), new KeyBinding("key.hotbar.8", 9, "key.categories.inventory"), new KeyBinding("key.hotbar.9", 10, "key.categories.inventory")}; + this.keyBindings = (KeyBinding[])ArrayUtils.addAll(new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand, this.keyBindScreenshot, this.keyBindTogglePerspective, this.keyBindSmoothCamera, this.keyBindSprint, this.field_152396_an, this.field_152397_ao, this.field_152398_ap, this.field_152399_aq, this.field_152395_am}, this.keyBindsHotbar); + this.difficulty = EnumDifficulty.NORMAL; + this.lastServer = ""; + this.noclipRate = 1.0F; + this.debugCamRate = 1.0F; + this.fovSetting = 70.0F; + this.language = "en_US"; + this.forceUnicodeFont = false; + } + + /** + * Represents a key or mouse button as a string. Args: key + */ + public static String getKeyDisplayString(int p_74298_0_) + { + return p_74298_0_ < 0 ? I18n.format("key.mouseButton", new Object[] {Integer.valueOf(p_74298_0_ + 101)}): Keyboard.getKeyName(p_74298_0_); + } + + /** + * Returns whether the specified key binding is currently being pressed. + */ + public static boolean isKeyDown(KeyBinding p_100015_0_) + { + return p_100015_0_.getKeyCode() == 0 ? false : (p_100015_0_.getKeyCode() < 0 ? Mouse.isButtonDown(p_100015_0_.getKeyCode() + 100) : Keyboard.isKeyDown(p_100015_0_.getKeyCode())); + } + + /** + * Sets a key binding and then saves all settings. + */ + public void setOptionKeyBinding(KeyBinding p_151440_1_, int p_151440_2_) + { + p_151440_1_.setKeyCode(p_151440_2_); + this.saveOptions(); + } + + /** + * If the specified option is controlled by a slider (float value), this will set the float value. + */ + public void setOptionFloatValue(GameSettings.Options p_74304_1_, float p_74304_2_) + { + if (p_74304_1_ == GameSettings.Options.SENSITIVITY) + { + this.mouseSensitivity = p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.FOV) + { + this.fovSetting = p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.GAMMA) + { + this.gammaSetting = p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.FRAMERATE_LIMIT) + { + this.limitFramerate = (int)p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.CHAT_OPACITY) + { + this.chatOpacity = p_74304_2_; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (p_74304_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED) + { + this.chatHeightFocused = p_74304_2_; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (p_74304_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED) + { + this.chatHeightUnfocused = p_74304_2_; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (p_74304_1_ == GameSettings.Options.CHAT_WIDTH) + { + this.chatWidth = p_74304_2_; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + if (p_74304_1_ == GameSettings.Options.CHAT_SCALE) + { + this.chatScale = p_74304_2_; + this.mc.ingameGUI.getChatGUI().refreshChat(); + } + + int i; + + if (p_74304_1_ == GameSettings.Options.ANISOTROPIC_FILTERING) + { + i = this.anisotropicFiltering; + this.anisotropicFiltering = (int)p_74304_2_; + + if ((float)i != p_74304_2_) + { + this.mc.getTextureMapBlocks().setAnisotropicFiltering(this.anisotropicFiltering); + this.mc.scheduleResourcesRefresh(); + } + } + + if (p_74304_1_ == GameSettings.Options.MIPMAP_LEVELS) + { + i = this.mipmapLevels; + this.mipmapLevels = (int)p_74304_2_; + + if ((float)i != p_74304_2_) + { + this.mc.getTextureMapBlocks().setMipmapLevels(this.mipmapLevels); + this.mc.scheduleResourcesRefresh(); + } + } + + if (p_74304_1_ == GameSettings.Options.RENDER_DISTANCE) + { + this.renderDistanceChunks = (int)p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL) + { + this.field_152400_J = p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.STREAM_VOLUME_MIC) + { + this.field_152401_K = p_74304_2_; + this.mc.func_152346_Z().func_152915_s(); + } + + if (p_74304_1_ == GameSettings.Options.STREAM_VOLUME_SYSTEM) + { + this.field_152402_L = p_74304_2_; + this.mc.func_152346_Z().func_152915_s(); + } + + if (p_74304_1_ == GameSettings.Options.STREAM_KBPS) + { + this.field_152403_M = p_74304_2_; + } + + if (p_74304_1_ == GameSettings.Options.STREAM_FPS) + { + this.field_152404_N = p_74304_2_; + } + } + + /** + * For non-float options. Toggles the option on/off, or cycles through the list i.e. render distances. + */ + public void setOptionValue(GameSettings.Options p_74306_1_, int p_74306_2_) + { + if (p_74306_1_ == GameSettings.Options.INVERT_MOUSE) + { + this.invertMouse = !this.invertMouse; + } + + if (p_74306_1_ == GameSettings.Options.GUI_SCALE) + { + this.guiScale = this.guiScale + p_74306_2_ & 3; + } + + if (p_74306_1_ == GameSettings.Options.PARTICLES) + { + this.particleSetting = (this.particleSetting + p_74306_2_) % 3; + } + + if (p_74306_1_ == GameSettings.Options.VIEW_BOBBING) + { + this.viewBobbing = !this.viewBobbing; + } + + if (p_74306_1_ == GameSettings.Options.RENDER_CLOUDS) + { + this.clouds = !this.clouds; + } + + if (p_74306_1_ == GameSettings.Options.FORCE_UNICODE_FONT) + { + this.forceUnicodeFont = !this.forceUnicodeFont; + this.mc.fontRenderer.setUnicodeFlag(this.mc.getLanguageManager().isCurrentLocaleUnicode() || this.forceUnicodeFont); + } + + if (p_74306_1_ == GameSettings.Options.ADVANCED_OPENGL) + { + this.advancedOpengl = !this.advancedOpengl; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_74306_1_ == GameSettings.Options.FBO_ENABLE) + { + this.fboEnable = !this.fboEnable; + } + + if (p_74306_1_ == GameSettings.Options.ANAGLYPH) + { + this.anaglyph = !this.anaglyph; + this.mc.refreshResources(); + } + + if (p_74306_1_ == GameSettings.Options.DIFFICULTY) + { + this.difficulty = EnumDifficulty.getDifficultyEnum(this.difficulty.getDifficultyId() + p_74306_2_ & 3); + } + + if (p_74306_1_ == GameSettings.Options.GRAPHICS) + { + this.fancyGraphics = !this.fancyGraphics; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_74306_1_ == GameSettings.Options.AMBIENT_OCCLUSION) + { + this.ambientOcclusion = (this.ambientOcclusion + p_74306_2_) % 3; + this.mc.renderGlobal.loadRenderers(); + } + + if (p_74306_1_ == GameSettings.Options.CHAT_VISIBILITY) + { + this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility((this.chatVisibility.getChatVisibility() + p_74306_2_) % 3); + } + + if (p_74306_1_ == GameSettings.Options.STREAM_COMPRESSION) + { + this.field_152405_O = (this.field_152405_O + p_74306_2_) % 3; + } + + if (p_74306_1_ == GameSettings.Options.STREAM_SEND_METADATA) + { + this.field_152406_P = !this.field_152406_P; + } + + if (p_74306_1_ == GameSettings.Options.STREAM_CHAT_ENABLED) + { + this.field_152408_R = (this.field_152408_R + p_74306_2_) % 3; + } + + if (p_74306_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER) + { + this.field_152409_S = (this.field_152409_S + p_74306_2_) % 3; + } + + if (p_74306_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) + { + this.field_152410_T = (this.field_152410_T + p_74306_2_) % 2; + } + + if (p_74306_1_ == GameSettings.Options.CHAT_COLOR) + { + this.chatColours = !this.chatColours; + } + + if (p_74306_1_ == GameSettings.Options.CHAT_LINKS) + { + this.chatLinks = !this.chatLinks; + } + + if (p_74306_1_ == GameSettings.Options.CHAT_LINKS_PROMPT) + { + this.chatLinksPrompt = !this.chatLinksPrompt; + } + + if (p_74306_1_ == GameSettings.Options.SNOOPER_ENABLED) + { + this.snooperEnabled = !this.snooperEnabled; + } + + if (p_74306_1_ == GameSettings.Options.SHOW_CAPE) + { + this.showCape = !this.showCape; + } + + if (p_74306_1_ == GameSettings.Options.TOUCHSCREEN) + { + this.touchscreen = !this.touchscreen; + } + + if (p_74306_1_ == GameSettings.Options.USE_FULLSCREEN) + { + this.fullScreen = !this.fullScreen; + + if (this.mc.isFullScreen() != this.fullScreen) + { + this.mc.toggleFullscreen(); + } + } + + if (p_74306_1_ == GameSettings.Options.ENABLE_VSYNC) + { + this.enableVsync = !this.enableVsync; + Display.setVSyncEnabled(this.enableVsync); + } + + this.saveOptions(); + } + + public float getOptionFloatValue(GameSettings.Options p_74296_1_) + { + return p_74296_1_ == GameSettings.Options.FOV ? this.fovSetting : (p_74296_1_ == GameSettings.Options.GAMMA ? this.gammaSetting : (p_74296_1_ == GameSettings.Options.SATURATION ? this.saturation : (p_74296_1_ == GameSettings.Options.SENSITIVITY ? this.mouseSensitivity : (p_74296_1_ == GameSettings.Options.CHAT_OPACITY ? this.chatOpacity : (p_74296_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (p_74296_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (p_74296_1_ == GameSettings.Options.CHAT_SCALE ? this.chatScale : (p_74296_1_ == GameSettings.Options.CHAT_WIDTH ? this.chatWidth : (p_74296_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (float)this.limitFramerate : (p_74296_1_ == GameSettings.Options.ANISOTROPIC_FILTERING ? (float)this.anisotropicFiltering : (p_74296_1_ == GameSettings.Options.MIPMAP_LEVELS ? (float)this.mipmapLevels : (p_74296_1_ == GameSettings.Options.RENDER_DISTANCE ? (float)this.renderDistanceChunks : (p_74296_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? this.field_152400_J : (p_74296_1_ == GameSettings.Options.STREAM_VOLUME_MIC ? this.field_152401_K : (p_74296_1_ == GameSettings.Options.STREAM_VOLUME_SYSTEM ? this.field_152402_L : (p_74296_1_ == GameSettings.Options.STREAM_KBPS ? this.field_152403_M : (p_74296_1_ == GameSettings.Options.STREAM_FPS ? this.field_152404_N : 0.0F))))))))))))))))); + } + + public boolean getOptionOrdinalValue(GameSettings.Options p_74308_1_) + { + switch (GameSettings.SwitchOptions.optionIds[p_74308_1_.ordinal()]) + { + case 1: + return this.invertMouse; + case 2: + return this.viewBobbing; + case 3: + return this.anaglyph; + case 4: + return this.advancedOpengl; + case 5: + return this.fboEnable; + case 6: + return this.clouds; + case 7: + return this.chatColours; + case 8: + return this.chatLinks; + case 9: + return this.chatLinksPrompt; + case 10: + return this.snooperEnabled; + case 11: + return this.fullScreen; + case 12: + return this.enableVsync; + case 13: + return this.showCape; + case 14: + return this.touchscreen; + case 15: + return this.field_152406_P; + case 16: + return this.forceUnicodeFont; + default: + return false; + } + } + + /** + * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater + * than/equal to the length of the String array, it is changed to 0. + */ + private static String getTranslation(String[] p_74299_0_, int p_74299_1_) + { + if (p_74299_1_ < 0 || p_74299_1_ >= p_74299_0_.length) + { + p_74299_1_ = 0; + } + + return I18n.format(p_74299_0_[p_74299_1_], new Object[0]); + } + + /** + * Gets a key binding. + */ + public String getKeyBinding(GameSettings.Options p_74297_1_) + { + String s = I18n.format(p_74297_1_.getEnumString(), new Object[0]) + ": "; + + if (p_74297_1_.getEnumFloat()) + { + float f1 = this.getOptionFloatValue(p_74297_1_); + float f = p_74297_1_.normalizeValue(f1); + return p_74297_1_ == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int)(f * 200.0F) + "%")) : (p_74297_1_ == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int)f1)) : (p_74297_1_ == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == p_74297_1_.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int)f1 + " fps") : (p_74297_1_ == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int)(f * 100.0F) + "%")) : (p_74297_1_ == GameSettings.Options.SATURATION ? s + (int)(f * 400.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_OPACITY ? s + (int)(f * 90.0F + 10.0F) + "%" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_UNFOCUSED ? s + GuiNewChat.func_146243_b(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_HEIGHT_FOCUSED ? s + GuiNewChat.func_146243_b(f) + "px" : (p_74297_1_ == GameSettings.Options.CHAT_WIDTH ? s + GuiNewChat.func_146233_a(f) + "px" : (p_74297_1_ == GameSettings.Options.RENDER_DISTANCE ? s + (int)f1 + " chunks" : (p_74297_1_ == GameSettings.Options.ANISOTROPIC_FILTERING ? (f1 == 1.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (p_74297_1_ == GameSettings.Options.MIPMAP_LEVELS ? (f1 == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)f1) : (p_74297_1_ == GameSettings.Options.STREAM_FPS ? s + TwitchStream.func_152948_a(f) + " fps" : (p_74297_1_ == GameSettings.Options.STREAM_KBPS ? s + TwitchStream.func_152946_b(f) + " Kbps" : (p_74297_1_ == GameSettings.Options.STREAM_BYTES_PER_PIXEL ? s + String.format("%.3f bpp", new Object[] {Float.valueOf(TwitchStream.func_152947_c(f))}): (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int)(f * 100.0F) + "%"))))))))))))))); + } + else if (p_74297_1_.getEnumBoolean()) + { + boolean flag = this.getOptionOrdinalValue(p_74297_1_); + return flag ? s + I18n.format("options.on", new Object[0]) : s + I18n.format("options.off", new Object[0]); + } + else if (p_74297_1_ == GameSettings.Options.DIFFICULTY) + { + return s + I18n.format(this.difficulty.getDifficultyResourceKey(), new Object[0]); + } + else if (p_74297_1_ == GameSettings.Options.GUI_SCALE) + { + return s + getTranslation(GUISCALES, this.guiScale); + } + else if (p_74297_1_ == GameSettings.Options.CHAT_VISIBILITY) + { + return s + I18n.format(this.chatVisibility.getResourceKey(), new Object[0]); + } + else if (p_74297_1_ == GameSettings.Options.PARTICLES) + { + return s + getTranslation(PARTICLES, this.particleSetting); + } + else if (p_74297_1_ == GameSettings.Options.AMBIENT_OCCLUSION) + { + return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); + } + else if (p_74297_1_ == GameSettings.Options.STREAM_COMPRESSION) + { + return s + getTranslation(field_152391_aS, this.field_152405_O); + } + else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_ENABLED) + { + return s + getTranslation(field_152392_aT, this.field_152408_R); + } + else if (p_74297_1_ == GameSettings.Options.STREAM_CHAT_USER_FILTER) + { + return s + getTranslation(field_152393_aU, this.field_152409_S); + } + else if (p_74297_1_ == GameSettings.Options.STREAM_MIC_TOGGLE_BEHAVIOR) + { + return s + getTranslation(field_152394_aV, this.field_152410_T); + } + else if (p_74297_1_ == GameSettings.Options.GRAPHICS) + { + if (this.fancyGraphics) + { + return s + I18n.format("options.graphics.fancy", new Object[0]); + } + else + { + String s1 = "options.graphics.fast"; + return s + I18n.format("options.graphics.fast", new Object[0]); + } + } + else + { + return s; + } + } + + /** + * Loads the options from the options file. It appears that this has replaced the previous 'loadOptions' + */ + public void loadOptions() + { + try + { + if (!this.optionsFile.exists()) + { + return; + } + + BufferedReader bufferedreader = new BufferedReader(new FileReader(this.optionsFile)); + String s = ""; + this.mapSoundLevels.clear(); + + while ((s = bufferedreader.readLine()) != null) + { + try + { + String[] astring = s.split(":"); + + if (astring[0].equals("mouseSensitivity")) + { + this.mouseSensitivity = this.parseFloat(astring[1]); + } + + if (astring[0].equals("invertYMouse")) + { + this.invertMouse = astring[1].equals("true"); + } + + if (astring[0].equals("fov")) + { + this.fovSetting = this.parseFloat(astring[1]); + } + + if (astring[0].equals("gamma")) + { + this.gammaSetting = this.parseFloat(astring[1]); + } + + if (astring[0].equals("saturation")) + { + this.saturation = this.parseFloat(astring[1]); + } + + if (astring[0].equals("fov")) + { + this.fovSetting = this.parseFloat(astring[1]) * 40.0F + 70.0F; + } + + if (astring[0].equals("renderDistance")) + { + this.renderDistanceChunks = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("guiScale")) + { + this.guiScale = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("particles")) + { + this.particleSetting = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("bobView")) + { + this.viewBobbing = astring[1].equals("true"); + } + + if (astring[0].equals("anaglyph3d")) + { + this.anaglyph = astring[1].equals("true"); + } + + if (astring[0].equals("advancedOpengl")) + { + this.advancedOpengl = astring[1].equals("true"); + } + + if (astring[0].equals("maxFps")) + { + this.limitFramerate = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("fboEnable")) + { + this.fboEnable = astring[1].equals("true"); + } + + if (astring[0].equals("difficulty")) + { + this.difficulty = EnumDifficulty.getDifficultyEnum(Integer.parseInt(astring[1])); + } + + if (astring[0].equals("fancyGraphics")) + { + this.fancyGraphics = astring[1].equals("true"); + } + + if (astring[0].equals("ao")) + { + if (astring[1].equals("true")) + { + this.ambientOcclusion = 2; + } + else if (astring[1].equals("false")) + { + this.ambientOcclusion = 0; + } + else + { + this.ambientOcclusion = Integer.parseInt(astring[1]); + } + } + + if (astring[0].equals("clouds")) + { + this.clouds = astring[1].equals("true"); + } + + if (astring[0].equals("resourcePacks")) + { + this.resourcePacks = (List)gson.fromJson(s.substring(s.indexOf(58) + 1), typeListString); + + if (this.resourcePacks == null) + { + this.resourcePacks = new ArrayList(); + } + } + + if (astring[0].equals("lastServer") && astring.length >= 2) + { + this.lastServer = s.substring(s.indexOf(58) + 1); + } + + if (astring[0].equals("lang") && astring.length >= 2) + { + this.language = astring[1]; + } + + if (astring[0].equals("chatVisibility")) + { + this.chatVisibility = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(Integer.parseInt(astring[1])); + } + + if (astring[0].equals("chatColors")) + { + this.chatColours = astring[1].equals("true"); + } + + if (astring[0].equals("chatLinks")) + { + this.chatLinks = astring[1].equals("true"); + } + + if (astring[0].equals("chatLinksPrompt")) + { + this.chatLinksPrompt = astring[1].equals("true"); + } + + if (astring[0].equals("chatOpacity")) + { + this.chatOpacity = this.parseFloat(astring[1]); + } + + if (astring[0].equals("snooperEnabled")) + { + this.snooperEnabled = astring[1].equals("true"); + } + + if (astring[0].equals("fullscreen")) + { + this.fullScreen = astring[1].equals("true"); + } + + if (astring[0].equals("enableVsync")) + { + this.enableVsync = astring[1].equals("true"); + } + + if (astring[0].equals("hideServerAddress")) + { + this.hideServerAddress = astring[1].equals("true"); + } + + if (astring[0].equals("advancedItemTooltips")) + { + this.advancedItemTooltips = astring[1].equals("true"); + } + + if (astring[0].equals("pauseOnLostFocus")) + { + this.pauseOnLostFocus = astring[1].equals("true"); + } + + if (astring[0].equals("showCape")) + { + this.showCape = astring[1].equals("true"); + } + + if (astring[0].equals("touchscreen")) + { + this.touchscreen = astring[1].equals("true"); + } + + if (astring[0].equals("overrideHeight")) + { + this.overrideHeight = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("overrideWidth")) + { + this.overrideWidth = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("heldItemTooltips")) + { + this.heldItemTooltips = astring[1].equals("true"); + } + + if (astring[0].equals("chatHeightFocused")) + { + this.chatHeightFocused = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatHeightUnfocused")) + { + this.chatHeightUnfocused = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatScale")) + { + this.chatScale = this.parseFloat(astring[1]); + } + + if (astring[0].equals("chatWidth")) + { + this.chatWidth = this.parseFloat(astring[1]); + } + + if (astring[0].equals("showInventoryAchievementHint")) + { + this.showInventoryAchievementHint = astring[1].equals("true"); + } + + if (astring[0].equals("mipmapLevels")) + { + this.mipmapLevels = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("anisotropicFiltering")) + { + this.anisotropicFiltering = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamBytesPerPixel")) + { + this.field_152400_J = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamMicVolume")) + { + this.field_152401_K = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamSystemVolume")) + { + this.field_152402_L = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamKbps")) + { + this.field_152403_M = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamFps")) + { + this.field_152404_N = this.parseFloat(astring[1]); + } + + if (astring[0].equals("streamCompression")) + { + this.field_152405_O = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamSendMetadata")) + { + this.field_152406_P = astring[1].equals("true"); + } + + if (astring[0].equals("streamPreferredServer") && astring.length >= 2) + { + this.field_152407_Q = s.substring(s.indexOf(58) + 1); + } + + if (astring[0].equals("streamChatEnabled")) + { + this.field_152408_R = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamChatUserFilter")) + { + this.field_152409_S = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("streamMicToggleBehavior")) + { + this.field_152410_T = Integer.parseInt(astring[1]); + } + + if (astring[0].equals("forceUnicodeFont")) + { + this.forceUnicodeFont = astring[1].equals("true"); + } + + KeyBinding[] akeybinding = this.keyBindings; + int i = akeybinding.length; + int j; + + for (j = 0; j < i; ++j) + { + KeyBinding keybinding = akeybinding[j]; + + if (astring[0].equals("key_" + keybinding.getKeyDescription())) + { + keybinding.setKeyCode(Integer.parseInt(astring[1])); + } + } + + SoundCategory[] asoundcategory = SoundCategory.values(); + i = asoundcategory.length; + + for (j = 0; j < i; ++j) + { + SoundCategory soundcategory = asoundcategory[j]; + + if (astring[0].equals("soundCategory_" + soundcategory.getCategoryName())) + { + this.mapSoundLevels.put(soundcategory, Float.valueOf(this.parseFloat(astring[1]))); + } + } + } + catch (Exception exception) + { + logger.warn("Skipping bad option: " + s); + } + } + + KeyBinding.resetKeyBindingArrayAndHash(); + bufferedreader.close(); + } + catch (Exception exception1) + { + logger.error("Failed to load options", exception1); + } + } + + /** + * Parses a string into a float. + */ + private float parseFloat(String p_74305_1_) + { + return p_74305_1_.equals("true") ? 1.0F : (p_74305_1_.equals("false") ? 0.0F : Float.parseFloat(p_74305_1_)); + } + + /** + * Saves the options to the options file. + */ + public void saveOptions() + { + if (FMLClientHandler.instance().isLoading()) return; + try + { + PrintWriter printwriter = new PrintWriter(new FileWriter(this.optionsFile)); + printwriter.println("invertYMouse:" + this.invertMouse); + printwriter.println("mouseSensitivity:" + this.mouseSensitivity); + printwriter.println("fov:" + (this.fovSetting - 70.0F) / 40.0F); + printwriter.println("gamma:" + this.gammaSetting); + printwriter.println("saturation:" + this.saturation); + printwriter.println("renderDistance:" + this.renderDistanceChunks); + printwriter.println("guiScale:" + this.guiScale); + printwriter.println("particles:" + this.particleSetting); + printwriter.println("bobView:" + this.viewBobbing); + printwriter.println("anaglyph3d:" + this.anaglyph); + printwriter.println("advancedOpengl:" + this.advancedOpengl); + printwriter.println("maxFps:" + this.limitFramerate); + printwriter.println("fboEnable:" + this.fboEnable); + printwriter.println("difficulty:" + this.difficulty.getDifficultyId()); + printwriter.println("fancyGraphics:" + this.fancyGraphics); + printwriter.println("ao:" + this.ambientOcclusion); + printwriter.println("clouds:" + this.clouds); + printwriter.println("resourcePacks:" + gson.toJson(this.resourcePacks)); + printwriter.println("lastServer:" + this.lastServer); + printwriter.println("lang:" + this.language); + printwriter.println("chatVisibility:" + this.chatVisibility.getChatVisibility()); + printwriter.println("chatColors:" + this.chatColours); + printwriter.println("chatLinks:" + this.chatLinks); + printwriter.println("chatLinksPrompt:" + this.chatLinksPrompt); + printwriter.println("chatOpacity:" + this.chatOpacity); + printwriter.println("snooperEnabled:" + this.snooperEnabled); + printwriter.println("fullscreen:" + this.fullScreen); + printwriter.println("enableVsync:" + this.enableVsync); + printwriter.println("hideServerAddress:" + this.hideServerAddress); + printwriter.println("advancedItemTooltips:" + this.advancedItemTooltips); + printwriter.println("pauseOnLostFocus:" + this.pauseOnLostFocus); + printwriter.println("showCape:" + this.showCape); + printwriter.println("touchscreen:" + this.touchscreen); + printwriter.println("overrideWidth:" + this.overrideWidth); + printwriter.println("overrideHeight:" + this.overrideHeight); + printwriter.println("heldItemTooltips:" + this.heldItemTooltips); + printwriter.println("chatHeightFocused:" + this.chatHeightFocused); + printwriter.println("chatHeightUnfocused:" + this.chatHeightUnfocused); + printwriter.println("chatScale:" + this.chatScale); + printwriter.println("chatWidth:" + this.chatWidth); + printwriter.println("showInventoryAchievementHint:" + this.showInventoryAchievementHint); + printwriter.println("mipmapLevels:" + this.mipmapLevels); + printwriter.println("anisotropicFiltering:" + this.anisotropicFiltering); + printwriter.println("streamBytesPerPixel:" + this.field_152400_J); + printwriter.println("streamMicVolume:" + this.field_152401_K); + printwriter.println("streamSystemVolume:" + this.field_152402_L); + printwriter.println("streamKbps:" + this.field_152403_M); + printwriter.println("streamFps:" + this.field_152404_N); + printwriter.println("streamCompression:" + this.field_152405_O); + printwriter.println("streamSendMetadata:" + this.field_152406_P); + printwriter.println("streamPreferredServer:" + this.field_152407_Q); + printwriter.println("streamChatEnabled:" + this.field_152408_R); + printwriter.println("streamChatUserFilter:" + this.field_152409_S); + printwriter.println("streamMicToggleBehavior:" + this.field_152410_T); + printwriter.println("forceUnicodeFont:" + this.forceUnicodeFont); + KeyBinding[] akeybinding = this.keyBindings; + int i = akeybinding.length; + int j; + + for (j = 0; j < i; ++j) + { + KeyBinding keybinding = akeybinding[j]; + printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); + } + + SoundCategory[] asoundcategory = SoundCategory.values(); + i = asoundcategory.length; + + for (j = 0; j < i; ++j) + { + SoundCategory soundcategory = asoundcategory[j]; + printwriter.println("soundCategory_" + soundcategory.getCategoryName() + ":" + this.getSoundLevel(soundcategory)); + } + + printwriter.close(); + } + catch (Exception exception) + { + logger.error("Failed to save options", exception); + } + + this.sendSettingsToServer(); + } + + public float getSoundLevel(SoundCategory p_151438_1_) + { + return this.mapSoundLevels.containsKey(p_151438_1_) ? ((Float)this.mapSoundLevels.get(p_151438_1_)).floatValue() : 1.0F; + } + + public void setSoundLevel(SoundCategory p_151439_1_, float p_151439_2_) + { + this.mc.getSoundHandler().setSoundLevel(p_151439_1_, p_151439_2_); + this.mapSoundLevels.put(p_151439_1_, Float.valueOf(p_151439_2_)); + } + + /** + * Send a client info packet with settings information to the server + */ + public void sendSettingsToServer() + { + if (this.mc.thePlayer != null) + { + this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language, this.renderDistanceChunks, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); + } + } + + /** + * Should render clouds + */ + public boolean shouldRenderClouds() + { + return this.renderDistanceChunks >= 4 && this.clouds; + } + + @SideOnly(Side.CLIENT) + public static enum Options + { + INVERT_MOUSE("options.invertMouse", false, true), + SENSITIVITY("options.sensitivity", true, false), + FOV("options.fov", true, false, 30.0F, 110.0F, 1.0F), + GAMMA("options.gamma", true, false), + SATURATION("options.saturation", true, false), + RENDER_DISTANCE("options.renderDistance", true, false, 2.0F, 16.0F, 1.0F), + VIEW_BOBBING("options.viewBobbing", false, true), + ANAGLYPH("options.anaglyph", false, true), + ADVANCED_OPENGL("options.advancedOpengl", false, true), + FRAMERATE_LIMIT("options.framerateLimit", true, false, 10.0F, 260.0F, 10.0F), + FBO_ENABLE("options.fboEnable", false, true), + DIFFICULTY("options.difficulty", false, false), + GRAPHICS("options.graphics", false, false), + AMBIENT_OCCLUSION("options.ao", false, false), + GUI_SCALE("options.guiScale", false, false), + RENDER_CLOUDS("options.renderClouds", false, true), + PARTICLES("options.particles", false, false), + CHAT_VISIBILITY("options.chat.visibility", false, false), + CHAT_COLOR("options.chat.color", false, true), + CHAT_LINKS("options.chat.links", false, true), + CHAT_OPACITY("options.chat.opacity", true, false), + CHAT_LINKS_PROMPT("options.chat.links.prompt", false, true), + SNOOPER_ENABLED("options.snooper", false, true), + USE_FULLSCREEN("options.fullscreen", false, true), + ENABLE_VSYNC("options.vsync", false, true), + SHOW_CAPE("options.showCape", false, true), + TOUCHSCREEN("options.touchscreen", false, true), + CHAT_SCALE("options.chat.scale", true, false), + CHAT_WIDTH("options.chat.width", true, false), + CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), + CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false), + MIPMAP_LEVELS("options.mipmapLevels", true, false, 0.0F, 4.0F, 1.0F), + ANISOTROPIC_FILTERING("options.anisotropicFiltering", true, false, 1.0F, 16.0F, 0.0F) + { + private static final String __OBFID = "CL_00000654"; + protected float snapToStep(float p_148264_1_) + { + return (float)MathHelper.roundUpToPowerOfTwo((int)p_148264_1_); + } + }, + FORCE_UNICODE_FONT("options.forceUnicodeFont", false, true), + STREAM_BYTES_PER_PIXEL("options.stream.bytesPerPixel", true, false), + STREAM_VOLUME_MIC("options.stream.micVolumne", true, false), + STREAM_VOLUME_SYSTEM("options.stream.systemVolume", true, false), + STREAM_KBPS("options.stream.kbps", true, false), + STREAM_FPS("options.stream.fps", true, false), + STREAM_COMPRESSION("options.stream.compression", false, false), + STREAM_SEND_METADATA("options.stream.sendMetadata", false, true), + STREAM_CHAT_ENABLED("options.stream.chat.enabled", false, false), + STREAM_CHAT_USER_FILTER("options.stream.chat.userFilter", false, false), + STREAM_MIC_TOGGLE_BEHAVIOR("options.stream.micToggleBehavior", false, false); + private final boolean enumFloat; + private final boolean enumBoolean; + private final String enumString; + private final float valueStep; + private float valueMin; + private float valueMax; + + private static final String __OBFID = "CL_00000653"; + + public static GameSettings.Options getEnumOptions(int p_74379_0_) + { + GameSettings.Options[] aoptions = values(); + int j = aoptions.length; + + for (int k = 0; k < j; ++k) + { + GameSettings.Options options = aoptions[k]; + + if (options.returnEnumOrdinal() == p_74379_0_) + { + return options; + } + } + + return null; + } + + private Options(String p_i1015_3_, boolean p_i1015_4_, boolean p_i1015_5_) + { + this(p_i1015_3_, p_i1015_4_, p_i1015_5_, 0.0F, 1.0F, 0.0F); + } + + private Options(String p_i45004_3_, boolean p_i45004_4_, boolean p_i45004_5_, float p_i45004_6_, float p_i45004_7_, float p_i45004_8_) + { + this.enumString = p_i45004_3_; + this.enumFloat = p_i45004_4_; + this.enumBoolean = p_i45004_5_; + this.valueMin = p_i45004_6_; + this.valueMax = p_i45004_7_; + this.valueStep = p_i45004_8_; + } + + public boolean getEnumFloat() + { + return this.enumFloat; + } + + public boolean getEnumBoolean() + { + return this.enumBoolean; + } + + public int returnEnumOrdinal() + { + return this.ordinal(); + } + + public String getEnumString() + { + return this.enumString; + } + + public float getValueMax() + { + return this.valueMax; + } + + public void setValueMax(float p_148263_1_) + { + this.valueMax = p_148263_1_; + } + + public float normalizeValue(float p_148266_1_) + { + return MathHelper.clamp_float((this.snapToStepClamp(p_148266_1_) - this.valueMin) / (this.valueMax - this.valueMin), 0.0F, 1.0F); + } + + public float denormalizeValue(float p_148262_1_) + { + return this.snapToStepClamp(this.valueMin + (this.valueMax - this.valueMin) * MathHelper.clamp_float(p_148262_1_, 0.0F, 1.0F)); + } + + public float snapToStepClamp(float p_148268_1_) + { + p_148268_1_ = this.snapToStep(p_148268_1_); + return MathHelper.clamp_float(p_148268_1_, this.valueMin, this.valueMax); + } + + protected float snapToStep(float p_148264_1_) + { + if (this.valueStep > 0.0F) + { + p_148264_1_ = this.valueStep * (float)Math.round(p_148264_1_ / this.valueStep); + } + + return p_148264_1_; + } + + Options(String p_i45005_3_, boolean p_i45005_4_, boolean p_i45005_5_, float p_i45005_6_, float p_i45005_7_, float p_i45005_8_, Object p_i45005_9_) + { + this(p_i45005_3_, p_i45005_4_, p_i45005_5_, p_i45005_6_, p_i45005_7_, p_i45005_8_); + } + } + + @SideOnly(Side.CLIENT) + + static final class SwitchOptions + { + static final int[] optionIds = new int[GameSettings.Options.values().length]; + private static final String __OBFID = "CL_00000652"; + + static + { + try + { + optionIds[GameSettings.Options.INVERT_MOUSE.ordinal()] = 1; + } + catch (NoSuchFieldError var16) + { + ; + } + + try + { + optionIds[GameSettings.Options.VIEW_BOBBING.ordinal()] = 2; + } + catch (NoSuchFieldError var15) + { + ; + } + + try + { + optionIds[GameSettings.Options.ANAGLYPH.ordinal()] = 3; + } + catch (NoSuchFieldError var14) + { + ; + } + + try + { + optionIds[GameSettings.Options.ADVANCED_OPENGL.ordinal()] = 4; + } + catch (NoSuchFieldError var13) + { + ; + } + + try + { + optionIds[GameSettings.Options.FBO_ENABLE.ordinal()] = 5; + } + catch (NoSuchFieldError var12) + { + ; + } + + try + { + optionIds[GameSettings.Options.RENDER_CLOUDS.ordinal()] = 6; + } + catch (NoSuchFieldError var11) + { + ; + } + + try + { + optionIds[GameSettings.Options.CHAT_COLOR.ordinal()] = 7; + } + catch (NoSuchFieldError var10) + { + ; + } + + try + { + optionIds[GameSettings.Options.CHAT_LINKS.ordinal()] = 8; + } + catch (NoSuchFieldError var9) + { + ; + } + + try + { + optionIds[GameSettings.Options.CHAT_LINKS_PROMPT.ordinal()] = 9; + } + catch (NoSuchFieldError var8) + { + ; + } + + try + { + optionIds[GameSettings.Options.SNOOPER_ENABLED.ordinal()] = 10; + } + catch (NoSuchFieldError var7) + { + ; + } + + try + { + optionIds[GameSettings.Options.USE_FULLSCREEN.ordinal()] = 11; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + optionIds[GameSettings.Options.ENABLE_VSYNC.ordinal()] = 12; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + optionIds[GameSettings.Options.SHOW_CAPE.ordinal()] = 13; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + optionIds[GameSettings.Options.TOUCHSCREEN.ordinal()] = 14; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + optionIds[GameSettings.Options.STREAM_SEND_METADATA.ordinal()] = 15; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + optionIds[GameSettings.Options.FORCE_UNICODE_FONT.ordinal()] = 16; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/settings/KeyBinding.java b/build/rfg/minecraft-src/java/net/minecraft/client/settings/KeyBinding.java new file mode 100644 index 0000000..321991c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/settings/KeyBinding.java @@ -0,0 +1,158 @@ +package net.minecraft.client.settings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.IntHashMap; + +@SideOnly(Side.CLIENT) +public class KeyBinding implements Comparable +{ + private static final List keybindArray = new ArrayList(); + private static final IntHashMap hash = new IntHashMap(); + private static final Set keybindSet = new HashSet(); + private final String keyDescription; + private final int keyCodeDefault; + private final String keyCategory; + private int keyCode; + /** because _303 wanted me to call it that(Caironater) */ + private boolean pressed; + private int pressTime; + private static final String __OBFID = "CL_00000628"; + + public static void onTick(int keyCode) + { + if (keyCode != 0) + { + KeyBinding keybinding = (KeyBinding)hash.lookup(keyCode); + + if (keybinding != null) + { + ++keybinding.pressTime; + } + } + } + + public static void setKeyBindState(int keyCode, boolean pressed) + { + if (keyCode != 0) + { + KeyBinding keybinding = (KeyBinding)hash.lookup(keyCode); + + if (keybinding != null) + { + keybinding.pressed = pressed; + } + } + } + + public static void unPressAllKeys() + { + Iterator iterator = keybindArray.iterator(); + + while (iterator.hasNext()) + { + KeyBinding keybinding = (KeyBinding)iterator.next(); + keybinding.unpressKey(); + } + } + + public static void resetKeyBindingArrayAndHash() + { + hash.clearMap(); + Iterator iterator = keybindArray.iterator(); + + while (iterator.hasNext()) + { + KeyBinding keybinding = (KeyBinding)iterator.next(); + hash.addKey(keybinding.keyCode, keybinding); + } + } + + public static Set getKeybinds() + { + return keybindSet; + } + + public KeyBinding(String description, int keyCode, String category) + { + this.keyDescription = description; + this.keyCode = keyCode; + this.keyCodeDefault = keyCode; + this.keyCategory = category; + keybindArray.add(this); + hash.addKey(keyCode, this); + keybindSet.add(category); + } + + public boolean getIsKeyPressed() + { + return this.pressed; + } + + public String getKeyCategory() + { + return this.keyCategory; + } + + public boolean isPressed() + { + if (this.pressTime == 0) + { + return false; + } + else + { + --this.pressTime; + return true; + } + } + + private void unpressKey() + { + this.pressTime = 0; + this.pressed = false; + } + + public String getKeyDescription() + { + return this.keyDescription; + } + + public int getKeyCodeDefault() + { + return this.keyCodeDefault; + } + + public int getKeyCode() + { + return this.keyCode; + } + + public void setKeyCode(int keyCode) + { + this.keyCode = keyCode; + } + + public int compareTo(KeyBinding p_compareTo_1_) + { + int i = I18n.format(this.keyCategory, new Object[0]).compareTo(I18n.format(p_compareTo_1_.keyCategory, new Object[0])); + + if (i == 0) + { + i = I18n.format(this.keyDescription, new Object[0]).compareTo(I18n.format(p_compareTo_1_.keyDescription, new Object[0])); + } + + return i; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((KeyBinding)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/Framebuffer.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/Framebuffer.java new file mode 100644 index 0000000..4abdce7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/Framebuffer.java @@ -0,0 +1,280 @@ +package net.minecraft.client.shader; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.ByteBuffer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureUtil; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class Framebuffer +{ + public int framebufferTextureWidth; + public int framebufferTextureHeight; + public int framebufferWidth; + public int framebufferHeight; + public boolean useDepth; + public int framebufferObject; + public int framebufferTexture; + public int depthBuffer; + public float[] framebufferColor; + public int framebufferFilter; + private static final String __OBFID = "CL_00000959"; + + public Framebuffer(int p_i45078_1_, int p_i45078_2_, boolean p_i45078_3_) + { + this.useDepth = p_i45078_3_; + this.framebufferObject = -1; + this.framebufferTexture = -1; + this.depthBuffer = -1; + this.framebufferColor = new float[4]; + this.framebufferColor[0] = 1.0F; + this.framebufferColor[1] = 1.0F; + this.framebufferColor[2] = 1.0F; + this.framebufferColor[3] = 0.0F; + this.createBindFramebuffer(p_i45078_1_, p_i45078_2_); + } + + public void createBindFramebuffer(int p_147613_1_, int p_147613_2_) + { + if (!OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferWidth = p_147613_1_; + this.framebufferHeight = p_147613_2_; + } + else + { + GL11.glEnable(GL11.GL_DEPTH_TEST); + + if (this.framebufferObject >= 0) + { + this.deleteFramebuffer(); + } + + this.createFramebuffer(p_147613_1_, p_147613_2_); + this.checkFramebufferComplete(); + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + } + } + + public void deleteFramebuffer() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + this.unbindFramebufferTexture(); + this.unbindFramebuffer(); + + if (this.depthBuffer > -1) + { + OpenGlHelper.func_153184_g(this.depthBuffer); + this.depthBuffer = -1; + } + + if (this.framebufferTexture > -1) + { + TextureUtil.deleteTexture(this.framebufferTexture); + this.framebufferTexture = -1; + } + + if (this.framebufferObject > -1) + { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + OpenGlHelper.func_153174_h(this.framebufferObject); + this.framebufferObject = -1; + } + } + } + + public void createFramebuffer(int p_147605_1_, int p_147605_2_) + { + this.framebufferWidth = p_147605_1_; + this.framebufferHeight = p_147605_2_; + this.framebufferTextureWidth = p_147605_1_; + this.framebufferTextureHeight = p_147605_2_; + + if (!OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferClear(); + } + else + { + this.framebufferObject = OpenGlHelper.func_153165_e(); + this.framebufferTexture = TextureUtil.glGenTextures(); + + if (this.useDepth) + { + this.depthBuffer = OpenGlHelper.func_153185_f(); + } + + this.setFramebufferFilter(9728); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, this.framebufferObject); + OpenGlHelper.func_153188_a(OpenGlHelper.field_153198_e, OpenGlHelper.field_153200_g, 3553, this.framebufferTexture, 0); + + if (this.useDepth) + { + OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.depthBuffer); + if (net.minecraftforge.client.MinecraftForgeClient.getStencilBits() == 0) + { + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, OpenGlHelper.field_153201_h, OpenGlHelper.field_153199_f, this.depthBuffer); + } + else + { + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.framebufferTextureWidth, this.framebufferTextureHeight); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.depthBuffer); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.depthBuffer); + } + } + + this.framebufferClear(); + this.unbindFramebufferTexture(); + } + } + + public void setFramebufferFilter(int p_147607_1_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + this.framebufferFilter = p_147607_1_; + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, (float)p_147607_1_); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + + public void checkFramebufferComplete() + { + int i = OpenGlHelper.func_153167_i(OpenGlHelper.field_153198_e); + + if (i != OpenGlHelper.field_153202_i) + { + if (i == OpenGlHelper.field_153203_j) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); + } + else if (i == OpenGlHelper.field_153204_k) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); + } + else if (i == OpenGlHelper.field_153205_l) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER"); + } + else if (i == OpenGlHelper.field_153206_m) + { + throw new RuntimeException("GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER"); + } + else + { + throw new RuntimeException("glCheckFramebufferStatus returned unknown status:" + i); + } + } + } + + public void bindFramebufferTexture() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.framebufferTexture); + } + } + + public void unbindFramebufferTexture() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + + public void bindFramebuffer(boolean p_147610_1_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, this.framebufferObject); + + if (p_147610_1_) + { + GL11.glViewport(0, 0, this.framebufferWidth, this.framebufferHeight); + } + } + } + + public void unbindFramebuffer() + { + if (OpenGlHelper.isFramebufferEnabled()) + { + OpenGlHelper.func_153171_g(OpenGlHelper.field_153198_e, 0); + } + } + + public void setFramebufferColor(float p_147604_1_, float p_147604_2_, float p_147604_3_, float p_147604_4_) + { + this.framebufferColor[0] = p_147604_1_; + this.framebufferColor[1] = p_147604_2_; + this.framebufferColor[2] = p_147604_3_; + this.framebufferColor[3] = p_147604_4_; + } + + public void framebufferRender(int p_147615_1_, int p_147615_2_) + { + if (OpenGlHelper.isFramebufferEnabled()) + { + GL11.glColorMask(true, true, true, false); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)p_147615_1_, (double)p_147615_2_, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glViewport(0, 0, p_147615_1_, p_147615_2_); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + this.bindFramebufferTexture(); + float f = (float)p_147615_1_; + float f1 = (float)p_147615_2_; + float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth; + float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(-1); + tessellator.addVertexWithUV(0.0D, (double)f1, 0.0D, 0.0D, 0.0D); + tessellator.addVertexWithUV((double)f, (double)f1, 0.0D, (double)f2, 0.0D); + tessellator.addVertexWithUV((double)f, 0.0D, 0.0D, (double)f2, (double)f3); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)f3); + tessellator.draw(); + this.unbindFramebufferTexture(); + GL11.glDepthMask(true); + GL11.glColorMask(true, true, true, true); + } + } + + public void framebufferClear() + { + this.bindFramebuffer(true); + GL11.glClearColor(this.framebufferColor[0], this.framebufferColor[1], this.framebufferColor[2], this.framebufferColor[3]); + int i = 16384; + + if (this.useDepth) + { + GL11.glClearDepth(1.0D); + i |= 256; + } + + GL11.glClear(i); + this.unbindFramebuffer(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/Shader.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/Shader.java new file mode 100644 index 0000000..56281d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/Shader.java @@ -0,0 +1,122 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import javax.vecmath.Matrix4f; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class Shader +{ + private final ShaderManager manager; + public final Framebuffer framebufferIn; + public final Framebuffer framebufferOut; + private final List listAuxFramebuffers = Lists.newArrayList(); + private final List listAuxNames = Lists.newArrayList(); + private final List listAuxWidths = Lists.newArrayList(); + private final List listAuxHeights = Lists.newArrayList(); + private Matrix4f projectionMatrix; + private static final String __OBFID = "CL_00001042"; + + public Shader(IResourceManager p_i45089_1_, String p_i45089_2_, Framebuffer p_i45089_3_, Framebuffer p_i45089_4_) throws JsonException + { + this.manager = new ShaderManager(p_i45089_1_, p_i45089_2_); + this.framebufferIn = p_i45089_3_; + this.framebufferOut = p_i45089_4_; + } + + public void deleteShader() + { + this.manager.func_147988_a(); + } + + public void addAuxFramebuffer(String p_148041_1_, Object p_148041_2_, int p_148041_3_, int p_148041_4_) + { + this.listAuxNames.add(this.listAuxNames.size(), p_148041_1_); + this.listAuxFramebuffers.add(this.listAuxFramebuffers.size(), p_148041_2_); + this.listAuxWidths.add(this.listAuxWidths.size(), Integer.valueOf(p_148041_3_)); + this.listAuxHeights.add(this.listAuxHeights.size(), Integer.valueOf(p_148041_4_)); + } + + private void preLoadShader() + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_FOG); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + + public void setProjectionMatrix(Matrix4f p_148045_1_) + { + this.projectionMatrix = p_148045_1_; + } + + public void loadShader(float p_148042_1_) + { + this.preLoadShader(); + this.framebufferIn.unbindFramebuffer(); + float f1 = (float)this.framebufferOut.framebufferTextureWidth; + float f2 = (float)this.framebufferOut.framebufferTextureHeight; + GL11.glViewport(0, 0, (int)f1, (int)f2); + this.manager.func_147992_a("DiffuseSampler", this.framebufferIn); + + for (int i = 0; i < this.listAuxFramebuffers.size(); ++i) + { + this.manager.func_147992_a((String)this.listAuxNames.get(i), this.listAuxFramebuffers.get(i)); + this.manager.func_147984_b("AuxSize" + i).func_148087_a((float)((Integer)this.listAuxWidths.get(i)).intValue(), (float)((Integer)this.listAuxHeights.get(i)).intValue()); + } + + this.manager.func_147984_b("ProjMat").func_148088_a(this.projectionMatrix); + this.manager.func_147984_b("InSize").func_148087_a((float)this.framebufferIn.framebufferTextureWidth, (float)this.framebufferIn.framebufferTextureHeight); + this.manager.func_147984_b("OutSize").func_148087_a(f1, f2); + this.manager.func_147984_b("Time").func_148090_a(p_148042_1_); + Minecraft minecraft = Minecraft.getMinecraft(); + this.manager.func_147984_b("ScreenSize").func_148087_a((float)minecraft.displayWidth, (float)minecraft.displayHeight); + this.manager.func_147995_c(); + this.framebufferOut.framebufferClear(); + this.framebufferOut.bindFramebuffer(false); + GL11.glDepthMask(false); + GL11.glColorMask(true, true, true, false); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorOpaque_I(-1); + tessellator.addVertex(0.0D, (double)f2, 500.0D); + tessellator.addVertex((double)f1, (double)f2, 500.0D); + tessellator.addVertex((double)f1, 0.0D, 500.0D); + tessellator.addVertex(0.0D, 0.0D, 500.0D); + tessellator.draw(); + GL11.glDepthMask(true); + GL11.glColorMask(true, true, true, true); + this.manager.func_147993_b(); + this.framebufferOut.unbindFramebuffer(); + this.framebufferIn.unbindFramebufferTexture(); + Iterator iterator = this.listAuxFramebuffers.iterator(); + + while (iterator.hasNext()) + { + Object object = iterator.next(); + + if (object instanceof Framebuffer) + { + ((Framebuffer)object).unbindFramebufferTexture(); + } + } + } + + public ShaderManager getShaderManager() + { + return this.manager; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderDefault.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderDefault.java new file mode 100644 index 0000000..c10263f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderDefault.java @@ -0,0 +1,34 @@ +package net.minecraft.client.shader; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import javax.vecmath.Matrix4f; + +@SideOnly(Side.CLIENT) +public class ShaderDefault extends ShaderUniform +{ + private static final String __OBFID = "CL_00001039"; + + public ShaderDefault() + { + super("dummy", 4, 1, (ShaderManager)null); + } + + public void func_148090_a(float p_148090_1_) {} + + public void func_148087_a(float p_148087_1_, float p_148087_2_) {} + + public void func_148095_a(float p_148095_1_, float p_148095_2_, float p_148095_3_) {} + + public void func_148081_a(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) {} + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) {} + + public void func_148083_a(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) {} + + public void func_148097_a(float[] p_148097_1_) {} + + public void func_148094_a(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) {} + + public void func_148088_a(Matrix4f p_148088_1_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderGroup.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderGroup.java new file mode 100644 index 0000000..564ee6d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderGroup.java @@ -0,0 +1,421 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import javax.vecmath.Matrix4f; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.IResource; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class ShaderGroup +{ + private final Framebuffer mainFramebuffer; + private final IResourceManager resourceManager; + private final String shaderGroupName; + private final List listShaders = Lists.newArrayList(); + private final Map mapFramebuffers = Maps.newHashMap(); + private final List listFramebuffers = Lists.newArrayList(); + private Matrix4f projectionMatrix; + private int mainFramebufferWidth; + private int mainFramebufferHeight; + private float field_148036_j; + private float field_148037_k; + private static final String __OBFID = "CL_00001041"; + + public ShaderGroup(TextureManager p_i1050_1_, IResourceManager p_i1050_2_, Framebuffer p_i1050_3_, ResourceLocation p_i1050_4_) throws JsonException + { + this.resourceManager = p_i1050_2_; + this.mainFramebuffer = p_i1050_3_; + this.field_148036_j = 0.0F; + this.field_148037_k = 0.0F; + this.mainFramebufferWidth = p_i1050_3_.framebufferWidth; + this.mainFramebufferHeight = p_i1050_3_.framebufferHeight; + this.shaderGroupName = p_i1050_4_.toString(); + this.resetProjectionMatrix(); + this.func_152765_a(p_i1050_1_, p_i1050_4_); + } + + public void func_152765_a(TextureManager p_152765_1_, ResourceLocation p_152765_2_) throws JsonException + { + JsonParser jsonparser = new JsonParser(); + InputStream inputstream = null; + + try + { + IResource iresource = this.resourceManager.getResource(p_152765_2_); + inputstream = iresource.getInputStream(); + JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject(); + JsonArray jsonarray; + int i; + Iterator iterator; + JsonElement jsonelement; + JsonException jsonexception1; + + if (JsonUtils.jsonObjectFieldTypeIsArray(jsonobject, "targets")) + { + jsonarray = jsonobject.getAsJsonArray("targets"); + i = 0; + + for (iterator = jsonarray.iterator(); iterator.hasNext(); ++i) + { + jsonelement = (JsonElement)iterator.next(); + + try + { + this.initTarget(jsonelement); + } + catch (Exception exception1) + { + jsonexception1 = JsonException.func_151379_a(exception1); + jsonexception1.func_151380_a("targets[" + i + "]"); + throw jsonexception1; + } + } + } + + if (JsonUtils.jsonObjectFieldTypeIsArray(jsonobject, "passes")) + { + jsonarray = jsonobject.getAsJsonArray("passes"); + i = 0; + + for (iterator = jsonarray.iterator(); iterator.hasNext(); ++i) + { + jsonelement = (JsonElement)iterator.next(); + + try + { + this.func_152764_a(p_152765_1_, jsonelement); + } + catch (Exception exception) + { + jsonexception1 = JsonException.func_151379_a(exception); + jsonexception1.func_151380_a("passes[" + i + "]"); + throw jsonexception1; + } + } + } + } + catch (Exception exception2) + { + JsonException jsonexception = JsonException.func_151379_a(exception2); + jsonexception.func_151381_b(p_152765_2_.getResourcePath()); + throw jsonexception; + } + finally + { + IOUtils.closeQuietly(inputstream); + } + } + + private void initTarget(JsonElement p_148027_1_) throws JsonException + { + if (JsonUtils.jsonElementTypeIsString(p_148027_1_)) + { + this.addFramebuffer(p_148027_1_.getAsString(), this.mainFramebufferWidth, this.mainFramebufferHeight); + } + else + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_148027_1_, "target"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"); + int i = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "width", this.mainFramebufferWidth); + int j = JsonUtils.getJsonObjectIntegerFieldValueOrDefault(jsonobject, "height", this.mainFramebufferHeight); + + if (this.mapFramebuffers.containsKey(s)) + { + throw new JsonException(s + " is already defined"); + } + + this.addFramebuffer(s, i, j); + } + } + + private void func_152764_a(TextureManager p_152764_1_, JsonElement p_152764_2_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_152764_2_, "pass"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"); + String s1 = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "intarget"); + String s2 = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "outtarget"); + Framebuffer framebuffer = this.getFramebuffer(s1); + Framebuffer framebuffer1 = this.getFramebuffer(s2); + + if (framebuffer == null) + { + throw new JsonException("Input target \'" + s1 + "\' does not exist"); + } + else if (framebuffer1 == null) + { + throw new JsonException("Output target \'" + s2 + "\' does not exist"); + } + else + { + Shader shader = this.addShader(s, framebuffer, framebuffer1); + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(jsonobject, "auxtargets", (JsonArray)null); + + if (jsonarray != null) + { + int i = 0; + + for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++i) + { + JsonElement jsonelement1 = (JsonElement)iterator.next(); + + try + { + JsonObject jsonobject1 = JsonUtils.getJsonElementAsJsonObject(jsonelement1, "auxtarget"); + String s4 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "name"); + String s3 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "id"); + Framebuffer framebuffer2 = this.getFramebuffer(s3); + + if (framebuffer2 == null) + { + ResourceLocation resourcelocation = new ResourceLocation("textures/effect/" + s3 + ".png"); + + try + { + this.resourceManager.getResource(resourcelocation); + } + catch (FileNotFoundException filenotfoundexception) + { + throw new JsonException("Render target or texture \'" + s3 + "\' does not exist"); + } + + p_152764_1_.bindTexture(resourcelocation); + ITextureObject itextureobject = p_152764_1_.getTexture(resourcelocation); + int j = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject1, "width"); + int k = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject1, "height"); + boolean flag = JsonUtils.getJsonObjectBooleanFieldValue(jsonobject1, "bilinear"); + + if (flag) + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); + } + else + { + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); + } + + shader.addAuxFramebuffer(s4, Integer.valueOf(itextureobject.getGlTextureId()), j, k); + } + else + { + shader.addAuxFramebuffer(s4, framebuffer2, framebuffer2.framebufferTextureWidth, framebuffer2.framebufferTextureHeight); + } + } + catch (Exception exception1) + { + JsonException jsonexception = JsonException.func_151379_a(exception1); + jsonexception.func_151380_a("auxtargets[" + i + "]"); + throw jsonexception; + } + } + } + + JsonArray jsonarray1 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(jsonobject, "uniforms", (JsonArray)null); + + if (jsonarray1 != null) + { + int l = 0; + + for (Iterator iterator1 = jsonarray1.iterator(); iterator1.hasNext(); ++l) + { + JsonElement jsonelement2 = (JsonElement)iterator1.next(); + + try + { + this.initUniform(jsonelement2); + } + catch (Exception exception) + { + JsonException jsonexception1 = JsonException.func_151379_a(exception); + jsonexception1.func_151380_a("uniforms[" + l + "]"); + throw jsonexception1; + } + } + } + } + } + + private void initUniform(JsonElement p_148028_1_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_148028_1_, "uniform"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"); + ShaderUniform shaderuniform = ((Shader)this.listShaders.get(this.listShaders.size() - 1)).getShaderManager().func_147991_a(s); + + if (shaderuniform == null) + { + throw new JsonException("Uniform \'" + s + "\' does not exist"); + } + else + { + float[] afloat = new float[4]; + int i = 0; + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "values"); + + for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++i) + { + JsonElement jsonelement1 = (JsonElement)iterator.next(); + + try + { + afloat[i] = JsonUtils.getJsonElementFloatValue(jsonelement1, "value"); + } + catch (Exception exception) + { + JsonException jsonexception = JsonException.func_151379_a(exception); + jsonexception.func_151380_a("values[" + i + "]"); + throw jsonexception; + } + } + + switch (i) + { + case 0: + default: + break; + case 1: + shaderuniform.func_148090_a(afloat[0]); + break; + case 2: + shaderuniform.func_148087_a(afloat[0], afloat[1]); + break; + case 3: + shaderuniform.func_148095_a(afloat[0], afloat[1], afloat[2]); + break; + case 4: + shaderuniform.func_148081_a(afloat[0], afloat[1], afloat[2], afloat[3]); + } + } + } + + public void addFramebuffer(String p_148020_1_, int p_148020_2_, int p_148020_3_) + { + Framebuffer framebuffer = new Framebuffer(p_148020_2_, p_148020_3_, true); + framebuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + this.mapFramebuffers.put(p_148020_1_, framebuffer); + + if (p_148020_2_ == this.mainFramebufferWidth && p_148020_3_ == this.mainFramebufferHeight) + { + this.listFramebuffers.add(framebuffer); + } + } + + public void deleteShaderGroup() + { + Iterator iterator = this.mapFramebuffers.values().iterator(); + + while (iterator.hasNext()) + { + Framebuffer framebuffer = (Framebuffer)iterator.next(); + framebuffer.deleteFramebuffer(); + } + + iterator = this.listShaders.iterator(); + + while (iterator.hasNext()) + { + Shader shader = (Shader)iterator.next(); + shader.deleteShader(); + } + + this.listShaders.clear(); + } + + public Shader addShader(String p_148023_1_, Framebuffer p_148023_2_, Framebuffer p_148023_3_) throws JsonException + { + Shader shader = new Shader(this.resourceManager, p_148023_1_, p_148023_2_, p_148023_3_); + this.listShaders.add(this.listShaders.size(), shader); + return shader; + } + + private void resetProjectionMatrix() + { + this.projectionMatrix = new Matrix4f(); + this.projectionMatrix.setIdentity(); + this.projectionMatrix.m00 = 2.0F / (float)this.mainFramebuffer.framebufferTextureWidth; + this.projectionMatrix.m11 = 2.0F / (float)(-this.mainFramebuffer.framebufferTextureHeight); + this.projectionMatrix.m22 = -0.0020001999F; + this.projectionMatrix.m33 = 1.0F; + this.projectionMatrix.m03 = -1.0F; + this.projectionMatrix.m13 = 1.0F; + this.projectionMatrix.m23 = -1.0001999F; + } + + public void createBindFramebuffers(int p_148026_1_, int p_148026_2_) + { + this.mainFramebufferWidth = this.mainFramebuffer.framebufferTextureWidth; + this.mainFramebufferHeight = this.mainFramebuffer.framebufferTextureHeight; + this.resetProjectionMatrix(); + Iterator iterator = this.listShaders.iterator(); + + while (iterator.hasNext()) + { + Shader shader = (Shader)iterator.next(); + shader.setProjectionMatrix(this.projectionMatrix); + } + + iterator = this.listFramebuffers.iterator(); + + while (iterator.hasNext()) + { + Framebuffer framebuffer = (Framebuffer)iterator.next(); + framebuffer.createBindFramebuffer(p_148026_1_, p_148026_2_); + } + } + + public void loadShaderGroup(float p_148018_1_) + { + if (p_148018_1_ < this.field_148037_k) + { + this.field_148036_j += 1.0F - this.field_148037_k; + this.field_148036_j += p_148018_1_; + } + else + { + this.field_148036_j += p_148018_1_ - this.field_148037_k; + } + + for (this.field_148037_k = p_148018_1_; this.field_148036_j > 20.0F; this.field_148036_j -= 20.0F) + { + ; + } + + Iterator iterator = this.listShaders.iterator(); + + while (iterator.hasNext()) + { + Shader shader = (Shader)iterator.next(); + shader.loadShader(this.field_148036_j / 20.0F); + } + } + + public final String getShaderGroupName() + { + return this.shaderGroupName; + } + + private Framebuffer getFramebuffer(String p_148017_1_) + { + return p_148017_1_ == null ? null : (p_148017_1_.equals("minecraft:main") ? this.mainFramebuffer : (Framebuffer)this.mapFramebuffers.get(p_148017_1_)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLinkHelper.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLinkHelper.java new file mode 100644 index 0000000..f6303e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLinkHelper.java @@ -0,0 +1,61 @@ +package net.minecraft.client.shader; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.util.JsonException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class ShaderLinkHelper +{ + private static final Logger logger = LogManager.getLogger(); + private static ShaderLinkHelper staticShaderLinkHelper; + private static final String __OBFID = "CL_00001045"; + + public static void setNewStaticShaderLinkHelper() + { + staticShaderLinkHelper = new ShaderLinkHelper(); + } + + public static ShaderLinkHelper getStaticShaderLinkHelper() + { + return staticShaderLinkHelper; + } + + public void func_148077_a(ShaderManager p_148077_1_) + { + p_148077_1_.func_147994_f().func_148054_b(p_148077_1_); + p_148077_1_.func_147989_e().func_148054_b(p_148077_1_); + OpenGlHelper.func_153187_e(p_148077_1_.func_147986_h()); + } + + public int func_148078_c() throws JsonException + { + int i = OpenGlHelper.func_153183_d(); + + if (i <= 0) + { + throw new JsonException("Could not create shader program (returned program ID " + i + ")"); + } + else + { + return i; + } + } + + public void func_148075_b(ShaderManager manager) + { + manager.func_147994_f().func_148056_a(manager); + manager.func_147989_e().func_148056_a(manager); + OpenGlHelper.func_153179_f(manager.func_147986_h()); + int i = OpenGlHelper.func_153175_a(manager.func_147986_h(), OpenGlHelper.field_153207_o); + + if (i == 0) + { + logger.warn("Error encountered when linking program containing VS " + manager.func_147989_e().func_148055_a() + " and FS " + manager.func_147994_f().func_148055_a() + ". Log output:"); + logger.warn(OpenGlHelper.func_153166_e(manager.func_147986_h(), 32768)); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLoader.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLoader.java new file mode 100644 index 0000000..b32292b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderLoader.java @@ -0,0 +1,126 @@ +package net.minecraft.client.shader; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Map; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.BufferUtils; + +@SideOnly(Side.CLIENT) +public class ShaderLoader +{ + private final ShaderLoader.ShaderType field_148061_a; + private final String field_148059_b; + private int field_148060_c; + private int field_148058_d = 0; + private static final String __OBFID = "CL_00001043"; + + private ShaderLoader(ShaderLoader.ShaderType type, int shaderId, String filename) + { + this.field_148061_a = type; + this.field_148060_c = shaderId; + this.field_148059_b = filename; + } + + public void func_148056_a(ShaderManager manager) + { + ++this.field_148058_d; + OpenGlHelper.func_153178_b(manager.func_147986_h(), this.field_148060_c); + } + + public void func_148054_b(ShaderManager manager) + { + --this.field_148058_d; + + if (this.field_148058_d <= 0) + { + OpenGlHelper.func_153180_a(this.field_148060_c); + this.field_148061_a.func_148064_d().remove(this.field_148059_b); + } + } + + public String func_148055_a() + { + return this.field_148059_b; + } + + public static ShaderLoader func_148057_a(IResourceManager resourceManager, ShaderLoader.ShaderType type, String filename) throws IOException + { + ShaderLoader shaderloader = (ShaderLoader)type.func_148064_d().get(filename); + + if (shaderloader == null) + { + ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + filename + type.func_148063_b()); + BufferedInputStream bufferedinputstream = new BufferedInputStream(resourceManager.getResource(resourcelocation).getInputStream()); + byte[] abyte = IOUtils.toByteArray(bufferedinputstream); + ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length); + bytebuffer.put(abyte); + bytebuffer.position(0); + int i = OpenGlHelper.func_153195_b(type.func_148065_c()); + OpenGlHelper.func_153169_a(i, bytebuffer); + OpenGlHelper.func_153170_c(i); + + if (OpenGlHelper.func_153157_c(i, OpenGlHelper.field_153208_p) == 0) + { + String s1 = StringUtils.trim(OpenGlHelper.func_153158_d(i, 32768)); + JsonException jsonexception = new JsonException("Couldn\'t compile " + type.func_148062_a() + " program: " + s1); + jsonexception.func_151381_b(resourcelocation.getResourcePath()); + throw jsonexception; + } + + shaderloader = new ShaderLoader(type, i, filename); + type.func_148064_d().put(filename, shaderloader); + } + + return shaderloader; + } + + @SideOnly(Side.CLIENT) + public static enum ShaderType + { + VERTEX("vertex", ".vsh", OpenGlHelper.field_153209_q), + FRAGMENT("fragment", ".fsh", OpenGlHelper.field_153210_r); + private final String field_148072_c; + private final String field_148069_d; + private final int field_148070_e; + private final Map field_148067_f = Maps.newHashMap(); + + private static final String __OBFID = "CL_00001044"; + + private ShaderType(String p_i45090_3_, String p_i45090_4_, int p_i45090_5_) + { + this.field_148072_c = p_i45090_3_; + this.field_148069_d = p_i45090_4_; + this.field_148070_e = p_i45090_5_; + } + + public String func_148062_a() + { + return this.field_148072_c; + } + + protected String func_148063_b() + { + return this.field_148069_d; + } + + protected int func_148065_c() + { + return this.field_148070_e; + } + + protected Map func_148064_d() + { + return this.field_148067_f; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderManager.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderManager.java new file mode 100644 index 0000000..1c64b30 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderManager.java @@ -0,0 +1,431 @@ +package net.minecraft.client.shader; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.ITextureObject; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.util.JsonBlendingMode; +import net.minecraft.client.util.JsonException; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.ARBMultitexture; +import org.lwjgl.opengl.GL13; + +@SideOnly(Side.CLIENT) +public class ShaderManager +{ + private static final Logger logger = LogManager.getLogger(); + private static final ShaderDefault defaultShaderUniform = new ShaderDefault(); + private static ShaderManager staticShaderManager = null; + private static int field_147999_d = -1; + private static boolean field_148000_e = true; + private final Map field_147997_f = Maps.newHashMap(); + private final List field_147998_g = Lists.newArrayList(); + private final List field_148010_h = Lists.newArrayList(); + private final List field_148011_i = Lists.newArrayList(); + private final List field_148008_j = Lists.newArrayList(); + private final Map field_148009_k = Maps.newHashMap(); + private final int field_148006_l; + private final String field_148007_m; + private final boolean field_148004_n; + private boolean field_148005_o; + private final JsonBlendingMode field_148016_p; + private final List field_148015_q; + private final List field_148014_r; + private final ShaderLoader field_148013_s; + private final ShaderLoader field_148012_t; + private static final String __OBFID = "CL_00001040"; + + public ShaderManager(IResourceManager resourceManager, String programName) throws JsonException + { + JsonParser jsonparser = new JsonParser(); + ResourceLocation resourcelocation = new ResourceLocation("shaders/program/" + programName + ".json"); + this.field_148007_m = programName; + InputStream inputstream = null; + + try + { + inputstream = resourceManager.getResource(resourcelocation).getInputStream(); + JsonObject jsonobject = jsonparser.parse(IOUtils.toString(inputstream, Charsets.UTF_8)).getAsJsonObject(); + String s1 = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "vertex"); + String s2 = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "fragment"); + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(jsonobject, "samplers", (JsonArray)null); + + if (jsonarray != null) + { + int i = 0; + + for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++i) + { + JsonElement jsonelement = (JsonElement)iterator.next(); + + try + { + this.func_147996_a(jsonelement); + } + catch (Exception exception2) + { + JsonException jsonexception1 = JsonException.func_151379_a(exception2); + jsonexception1.func_151380_a("samplers[" + i + "]"); + throw jsonexception1; + } + } + } + + JsonArray jsonarray1 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(jsonobject, "attributes", (JsonArray)null); + Iterator iterator1; + + if (jsonarray1 != null) + { + int j = 0; + this.field_148015_q = Lists.newArrayListWithCapacity(jsonarray1.size()); + this.field_148014_r = Lists.newArrayListWithCapacity(jsonarray1.size()); + + for (iterator1 = jsonarray1.iterator(); iterator1.hasNext(); ++j) + { + JsonElement jsonelement1 = (JsonElement)iterator1.next(); + + try + { + this.field_148014_r.add(JsonUtils.getJsonElementStringValue(jsonelement1, "attribute")); + } + catch (Exception exception1) + { + JsonException jsonexception2 = JsonException.func_151379_a(exception1); + jsonexception2.func_151380_a("attributes[" + j + "]"); + throw jsonexception2; + } + } + } + else + { + this.field_148015_q = null; + this.field_148014_r = null; + } + + JsonArray jsonarray2 = JsonUtils.getJsonObjectJsonArrayFieldOrDefault(jsonobject, "uniforms", (JsonArray)null); + + if (jsonarray2 != null) + { + int k = 0; + + for (Iterator iterator2 = jsonarray2.iterator(); iterator2.hasNext(); ++k) + { + JsonElement jsonelement2 = (JsonElement)iterator2.next(); + + try + { + this.func_147987_b(jsonelement2); + } + catch (Exception exception) + { + JsonException jsonexception3 = JsonException.func_151379_a(exception); + jsonexception3.func_151380_a("uniforms[" + k + "]"); + throw jsonexception3; + } + } + } + + this.field_148016_p = JsonBlendingMode.func_148110_a(JsonUtils.getJsonObjectFieldOrDefault(jsonobject, "blend", (JsonObject)null)); + this.field_148004_n = JsonUtils.getJsonObjectBooleanFieldValueOrDefault(jsonobject, "cull", true); + this.field_148013_s = ShaderLoader.func_148057_a(resourceManager, ShaderLoader.ShaderType.VERTEX, s1); + this.field_148012_t = ShaderLoader.func_148057_a(resourceManager, ShaderLoader.ShaderType.FRAGMENT, s2); + this.field_148006_l = ShaderLinkHelper.getStaticShaderLinkHelper().func_148078_c(); + ShaderLinkHelper.getStaticShaderLinkHelper().func_148075_b(this); + this.func_147990_i(); + + if (this.field_148014_r != null) + { + iterator1 = this.field_148014_r.iterator(); + + while (iterator1.hasNext()) + { + String s3 = (String)iterator1.next(); + int l = OpenGlHelper.func_153164_b(this.field_148006_l, s3); + this.field_148015_q.add(Integer.valueOf(l)); + } + } + } + catch (Exception exception3) + { + JsonException jsonexception = JsonException.func_151379_a(exception3); + jsonexception.func_151381_b(resourcelocation.getResourcePath()); + throw jsonexception; + } + finally + { + IOUtils.closeQuietly(inputstream); + } + + this.func_147985_d(); + } + + public void func_147988_a() + { + ShaderLinkHelper.getStaticShaderLinkHelper().func_148077_a(this); + } + + public void func_147993_b() + { + OpenGlHelper.func_153161_d(0); + field_147999_d = -1; + staticShaderManager = null; + field_148000_e = true; + + for (int i = 0; i < this.field_148010_h.size(); ++i) + { + if (this.field_147997_f.get(this.field_147998_g.get(i)) != null) + { + GL13.glActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + i); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); + } + } + } + + public void func_147995_c() + { + this.field_148005_o = false; + staticShaderManager = this; + this.field_148016_p.func_148109_a(); + + if (this.field_148006_l != field_147999_d) + { + OpenGlHelper.func_153161_d(this.field_148006_l); + field_147999_d = this.field_148006_l; + } + + if (field_148000_e != this.field_148004_n) + { + field_148000_e = this.field_148004_n; + + if (this.field_148004_n) + { + GL11.glEnable(GL11.GL_CULL_FACE); + } + else + { + GL11.glDisable(GL11.GL_CULL_FACE); + } + } + + for (int i = 0; i < this.field_148010_h.size(); ++i) + { + if (this.field_147997_f.get(this.field_147998_g.get(i)) != null) + { + GL13.glActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + i); + GL11.glEnable(GL11.GL_TEXTURE_2D); + Object object = this.field_147997_f.get(this.field_147998_g.get(i)); + int j = -1; + + if (object instanceof Framebuffer) + { + j = ((Framebuffer)object).framebufferTexture; + } + else if (object instanceof ITextureObject) + { + j = ((ITextureObject)object).getGlTextureId(); + } + else if (object instanceof Integer) + { + j = ((Integer)object).intValue(); + } + + if (j != -1) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, j); + OpenGlHelper.func_153163_f(OpenGlHelper.func_153194_a(this.field_148006_l, (CharSequence)this.field_147998_g.get(i)), i); + } + } + } + + Iterator iterator = this.field_148011_i.iterator(); + + while (iterator.hasNext()) + { + ShaderUniform shaderuniform = (ShaderUniform)iterator.next(); + shaderuniform.func_148093_b(); + } + } + + public void func_147985_d() + { + this.field_148005_o = true; + } + + public ShaderUniform func_147991_a(String p_147991_1_) + { + return this.field_148009_k.containsKey(p_147991_1_) ? (ShaderUniform)this.field_148009_k.get(p_147991_1_) : null; + } + + public ShaderUniform func_147984_b(String p_147984_1_) + { + return (ShaderUniform)(this.field_148009_k.containsKey(p_147984_1_) ? (ShaderUniform)this.field_148009_k.get(p_147984_1_) : defaultShaderUniform); + } + + private void func_147990_i() + { + int i = 0; + String s; + int k; + + for (int j = 0; i < this.field_147998_g.size(); ++j) + { + s = (String)this.field_147998_g.get(i); + k = OpenGlHelper.func_153194_a(this.field_148006_l, s); + + if (k == -1) + { + logger.warn("Shader " + this.field_148007_m + "could not find sampler named " + s + " in the specified shader program."); + this.field_147997_f.remove(s); + this.field_147998_g.remove(j); + --j; + } + else + { + this.field_148010_h.add(Integer.valueOf(k)); + } + + ++i; + } + + Iterator iterator = this.field_148011_i.iterator(); + + while (iterator.hasNext()) + { + ShaderUniform shaderuniform = (ShaderUniform)iterator.next(); + s = shaderuniform.func_148086_a(); + k = OpenGlHelper.func_153194_a(this.field_148006_l, s); + + if (k == -1) + { + logger.warn("Could not find uniform named " + s + " in the specified" + " shader program."); + } + else + { + this.field_148008_j.add(Integer.valueOf(k)); + shaderuniform.func_148084_b(k); + this.field_148009_k.put(s, shaderuniform); + } + } + } + + private void func_147996_a(JsonElement p_147996_1_) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_147996_1_, "sampler"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"); + + if (!JsonUtils.jsonObjectFieldTypeIsString(jsonobject, "file")) + { + this.field_147997_f.put(s, (Object)null); + this.field_147998_g.add(s); + } + else + { + this.field_147998_g.add(s); + } + } + + public void func_147992_a(String p_147992_1_, Object p_147992_2_) + { + if (this.field_147997_f.containsKey(p_147992_1_)) + { + this.field_147997_f.remove(p_147992_1_); + } + + this.field_147997_f.put(p_147992_1_, p_147992_2_); + this.func_147985_d(); + } + + private void func_147987_b(JsonElement p_147987_1_) throws JsonException + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_147987_1_, "uniform"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"); + int i = ShaderUniform.func_148085_a(JsonUtils.getJsonObjectStringFieldValue(jsonobject, "type")); + int j = JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "count"); + float[] afloat = new float[Math.max(j, 16)]; + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "values"); + + if (jsonarray.size() != j && jsonarray.size() > 1) + { + throw new JsonException("Invalid amount of values specified (expected " + j + ", found " + jsonarray.size() + ")"); + } + else + { + int k = 0; + + for (Iterator iterator = jsonarray.iterator(); iterator.hasNext(); ++k) + { + JsonElement jsonelement1 = (JsonElement)iterator.next(); + + try + { + afloat[k] = JsonUtils.getJsonElementFloatValue(jsonelement1, "value"); + } + catch (Exception exception) + { + JsonException jsonexception = JsonException.func_151379_a(exception); + jsonexception.func_151380_a("values[" + k + "]"); + throw jsonexception; + } + } + + if (j > 1 && jsonarray.size() == 1) + { + while (k < j) + { + afloat[k] = afloat[0]; + ++k; + } + } + + int l = j > 1 && j <= 4 && i < 8 ? j - 1 : 0; + ShaderUniform shaderuniform = new ShaderUniform(s, i + l, j, this); + + if (i <= 3) + { + shaderuniform.func_148083_a((int)afloat[0], (int)afloat[1], (int)afloat[2], (int)afloat[3]); + } + else if (i <= 7) + { + shaderuniform.func_148092_b(afloat[0], afloat[1], afloat[2], afloat[3]); + } + else + { + shaderuniform.func_148097_a(afloat); + } + + this.field_148011_i.add(shaderuniform); + } + } + + public ShaderLoader func_147989_e() + { + return this.field_148013_s; + } + + public ShaderLoader func_147994_f() + { + return this.field_148012_t; + } + + public int func_147986_h() + { + return this.field_148006_l; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderUniform.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderUniform.java new file mode 100644 index 0000000..8c0bec8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/ShaderUniform.java @@ -0,0 +1,316 @@ +package net.minecraft.client.shader; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import javax.vecmath.Matrix4f; +import net.minecraft.client.renderer.OpenGlHelper; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; + +@SideOnly(Side.CLIENT) +public class ShaderUniform +{ + private static final Logger logger = LogManager.getLogger(); + private int field_148102_b; + private final int field_148103_c; + private final int field_148100_d; + private final IntBuffer field_148101_e; + private final FloatBuffer field_148098_f; + private final String field_148099_g; + private boolean field_148105_h; + private final ShaderManager field_148106_i; + private static final String __OBFID = "CL_00001046"; + + public ShaderUniform(String name, int type, int count, ShaderManager manager) + { + this.field_148099_g = name; + this.field_148103_c = count; + this.field_148100_d = type; + this.field_148106_i = manager; + + if (type <= 3) + { + this.field_148101_e = BufferUtils.createIntBuffer(count); + this.field_148098_f = null; + } + else + { + this.field_148101_e = null; + this.field_148098_f = BufferUtils.createFloatBuffer(count); + } + + this.field_148102_b = -1; + this.func_148096_h(); + } + + private void func_148096_h() + { + this.field_148105_h = true; + + if (this.field_148106_i != null) + { + this.field_148106_i.func_147985_d(); + } + } + + public static int func_148085_a(String p_148085_0_) + { + byte b0 = -1; + + if (p_148085_0_.equals("int")) + { + b0 = 0; + } + else if (p_148085_0_.equals("float")) + { + b0 = 4; + } + else if (p_148085_0_.startsWith("matrix")) + { + if (p_148085_0_.endsWith("2x2")) + { + b0 = 8; + } + else if (p_148085_0_.endsWith("3x3")) + { + b0 = 9; + } + else if (p_148085_0_.endsWith("4x4")) + { + b0 = 10; + } + } + + return b0; + } + + public void func_148084_b(int p_148084_1_) + { + this.field_148102_b = p_148084_1_; + } + + public String func_148086_a() + { + return this.field_148099_g; + } + + public void func_148090_a(float p_148090_1_) + { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148090_1_); + this.func_148096_h(); + } + + public void func_148087_a(float p_148087_1_, float p_148087_2_) + { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148087_1_); + this.field_148098_f.put(1, p_148087_2_); + this.func_148096_h(); + } + + public void func_148095_a(float p_148095_1_, float p_148095_2_, float p_148095_3_) + { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148095_1_); + this.field_148098_f.put(1, p_148095_2_); + this.field_148098_f.put(2, p_148095_3_); + this.func_148096_h(); + } + + public void func_148081_a(float p_148081_1_, float p_148081_2_, float p_148081_3_, float p_148081_4_) + { + this.field_148098_f.position(0); + this.field_148098_f.put(p_148081_1_); + this.field_148098_f.put(p_148081_2_); + this.field_148098_f.put(p_148081_3_); + this.field_148098_f.put(p_148081_4_); + this.field_148098_f.flip(); + this.func_148096_h(); + } + + public void func_148092_b(float p_148092_1_, float p_148092_2_, float p_148092_3_, float p_148092_4_) + { + this.field_148098_f.position(0); + + if (this.field_148100_d >= 4) + { + this.field_148098_f.put(0, p_148092_1_); + } + + if (this.field_148100_d >= 5) + { + this.field_148098_f.put(1, p_148092_2_); + } + + if (this.field_148100_d >= 6) + { + this.field_148098_f.put(2, p_148092_3_); + } + + if (this.field_148100_d >= 7) + { + this.field_148098_f.put(3, p_148092_4_); + } + + this.func_148096_h(); + } + + public void func_148083_a(int p_148083_1_, int p_148083_2_, int p_148083_3_, int p_148083_4_) + { + this.field_148101_e.position(0); + + if (this.field_148100_d >= 0) + { + this.field_148101_e.put(0, p_148083_1_); + } + + if (this.field_148100_d >= 1) + { + this.field_148101_e.put(1, p_148083_2_); + } + + if (this.field_148100_d >= 2) + { + this.field_148101_e.put(2, p_148083_3_); + } + + if (this.field_148100_d >= 3) + { + this.field_148101_e.put(3, p_148083_4_); + } + + this.func_148096_h(); + } + + public void func_148097_a(float[] p_148097_1_) + { + if (p_148097_1_.length < this.field_148103_c) + { + logger.warn("Uniform.set called with a too-small value array (expected " + this.field_148103_c + ", got " + p_148097_1_.length + "). Ignoring."); + } + else + { + this.field_148098_f.position(0); + this.field_148098_f.put(p_148097_1_); + this.field_148098_f.position(0); + this.func_148096_h(); + } + } + + public void func_148094_a(float p_148094_1_, float p_148094_2_, float p_148094_3_, float p_148094_4_, float p_148094_5_, float p_148094_6_, float p_148094_7_, float p_148094_8_, float p_148094_9_, float p_148094_10_, float p_148094_11_, float p_148094_12_, float p_148094_13_, float p_148094_14_, float p_148094_15_, float p_148094_16_) + { + this.field_148098_f.position(0); + this.field_148098_f.put(0, p_148094_1_); + this.field_148098_f.put(1, p_148094_2_); + this.field_148098_f.put(2, p_148094_3_); + this.field_148098_f.put(3, p_148094_4_); + this.field_148098_f.put(4, p_148094_5_); + this.field_148098_f.put(5, p_148094_6_); + this.field_148098_f.put(6, p_148094_7_); + this.field_148098_f.put(7, p_148094_8_); + this.field_148098_f.put(8, p_148094_9_); + this.field_148098_f.put(9, p_148094_10_); + this.field_148098_f.put(10, p_148094_11_); + this.field_148098_f.put(11, p_148094_12_); + this.field_148098_f.put(12, p_148094_13_); + this.field_148098_f.put(13, p_148094_14_); + this.field_148098_f.put(14, p_148094_15_); + this.field_148098_f.put(15, p_148094_16_); + this.func_148096_h(); + } + + public void func_148088_a(Matrix4f p_148088_1_) + { + this.func_148094_a(p_148088_1_.m00, p_148088_1_.m01, p_148088_1_.m02, p_148088_1_.m03, p_148088_1_.m10, p_148088_1_.m11, p_148088_1_.m12, p_148088_1_.m13, p_148088_1_.m20, p_148088_1_.m21, p_148088_1_.m22, p_148088_1_.m23, p_148088_1_.m30, p_148088_1_.m31, p_148088_1_.m32, p_148088_1_.m33); + } + + public void func_148093_b() + { + if (!this.field_148105_h) + { + ; + } + + this.field_148105_h = false; + + if (this.field_148100_d <= 3) + { + this.func_148091_i(); + } + else if (this.field_148100_d <= 7) + { + this.func_148089_j(); + } + else + { + if (this.field_148100_d > 10) + { + logger.warn("Uniform.upload called, but type value (" + this.field_148100_d + ") is not " + "a valid type. Ignoring."); + return; + } + + this.func_148082_k(); + } + } + + private void func_148091_i() + { + switch (this.field_148100_d) + { + case 0: + OpenGlHelper.func_153181_a(this.field_148102_b, this.field_148101_e); + break; + case 1: + OpenGlHelper.func_153182_b(this.field_148102_b, this.field_148101_e); + break; + case 2: + OpenGlHelper.func_153192_c(this.field_148102_b, this.field_148101_e); + break; + case 3: + OpenGlHelper.func_153162_d(this.field_148102_b, this.field_148101_e); + break; + default: + logger.warn("Uniform.upload called, but count value (" + this.field_148103_c + ") is " + " not in the range of 1 to 4. Ignoring."); + } + } + + private void func_148089_j() + { + switch (this.field_148100_d) + { + case 4: + OpenGlHelper.func_153168_a(this.field_148102_b, this.field_148098_f); + break; + case 5: + OpenGlHelper.func_153177_b(this.field_148102_b, this.field_148098_f); + break; + case 6: + OpenGlHelper.func_153191_c(this.field_148102_b, this.field_148098_f); + break; + case 7: + OpenGlHelper.func_153159_d(this.field_148102_b, this.field_148098_f); + break; + default: + logger.warn("Uniform.upload called, but count value (" + this.field_148103_c + ") is " + "not in the range of 1 to 4. Ignoring."); + } + } + + private void func_148082_k() + { + switch (this.field_148100_d) + { + case 8: + OpenGlHelper.func_153173_a(this.field_148102_b, true, this.field_148098_f); + break; + case 9: + OpenGlHelper.func_153189_b(this.field_148102_b, true, this.field_148098_f); + break; + case 10: + OpenGlHelper.func_153160_c(this.field_148102_b, true, this.field_148098_f); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/shader/TesselatorVertexState.java b/build/rfg/minecraft-src/java/net/minecraft/client/shader/TesselatorVertexState.java new file mode 100644 index 0000000..b279f21 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/shader/TesselatorVertexState.java @@ -0,0 +1,63 @@ +package net.minecraft.client.shader; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class TesselatorVertexState +{ + private int[] rawBuffer; + private int rawBufferIndex; + private int vertexCount; + private boolean hasTexture; + private boolean hasBrightness; + private boolean hasNormals; + private boolean hasColor; + private static final String __OBFID = "CL_00000961"; + + public TesselatorVertexState(int[] p_i45079_1_, int p_i45079_2_, int p_i45079_3_, boolean p_i45079_4_, boolean p_i45079_5_, boolean p_i45079_6_, boolean p_i45079_7_) + { + this.rawBuffer = p_i45079_1_; + this.rawBufferIndex = p_i45079_2_; + this.vertexCount = p_i45079_3_; + this.hasTexture = p_i45079_4_; + this.hasBrightness = p_i45079_5_; + this.hasNormals = p_i45079_6_; + this.hasColor = p_i45079_7_; + } + + public int[] getRawBuffer() + { + return this.rawBuffer; + } + + public int getRawBufferIndex() + { + return this.rawBufferIndex; + } + + public int getVertexCount() + { + return this.vertexCount; + } + + public boolean getHasTexture() + { + return this.hasTexture; + } + + public boolean getHasBrightness() + { + return this.hasBrightness; + } + + public boolean getHasNormals() + { + return this.hasNormals; + } + + public boolean getHasColor() + { + return this.hasColor; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/BroadcastController.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/BroadcastController.java new file mode 100644 index 0000000..7896bb1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/BroadcastController.java @@ -0,0 +1,1233 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ThreadSafeBoundList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import tv.twitch.AuthToken; +import tv.twitch.Core; +import tv.twitch.ErrorCode; +import tv.twitch.MessageLevel; +import tv.twitch.StandardCoreAPI; +import tv.twitch.VideoEncoder; +import tv.twitch.broadcast.ArchivingState; +import tv.twitch.broadcast.AudioDeviceType; +import tv.twitch.broadcast.AudioParams; +import tv.twitch.broadcast.ChannelInfo; +import tv.twitch.broadcast.DesktopStreamAPI; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfo; +import tv.twitch.broadcast.GameInfoList; +import tv.twitch.broadcast.IStatCallbacks; +import tv.twitch.broadcast.IStreamCallbacks; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.PixelFormat; +import tv.twitch.broadcast.StartFlags; +import tv.twitch.broadcast.StatType; +import tv.twitch.broadcast.Stream; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.StreamInfoForSetting; +import tv.twitch.broadcast.UserInfo; +import tv.twitch.broadcast.VideoParams; + +@SideOnly(Side.CLIENT) +public class BroadcastController implements IStatCallbacks, IStreamCallbacks +{ + private static final Logger field_152861_B = LogManager.getLogger(); + protected final int field_152865_a = 30; + protected final int field_152866_b = 3; + private static final ThreadSafeBoundList field_152862_C = new ThreadSafeBoundList(String.class, 50); + private String field_152863_D = null; + protected BroadcastController.BroadcastListener field_152867_c = null; + protected String field_152868_d = ""; + protected String field_152869_e = ""; + protected String field_152870_f = ""; + protected boolean field_152871_g = true; + protected Core field_152872_h = null; + protected Stream field_152873_i = null; + protected List field_152874_j = new ArrayList(); + protected List field_152875_k = new ArrayList(); + protected boolean field_152876_l = false; + protected boolean field_152877_m = false; + protected boolean field_152878_n = false; + protected BroadcastController.BroadcastState field_152879_o; + protected String field_152880_p; + protected VideoParams field_152881_q; + protected AudioParams field_152882_r; + protected IngestList field_152883_s; + protected IngestServer field_152884_t; + protected AuthToken field_152885_u; + protected ChannelInfo field_152886_v; + protected UserInfo field_152887_w; + protected StreamInfo field_152888_x; + protected ArchivingState field_152889_y; + protected long field_152890_z; + protected IngestServerTester field_152860_A; + private ErrorCode field_152864_E; + private static final String __OBFID = "CL_00001822"; + + public void requestAuthTokenCallback(ErrorCode p_requestAuthTokenCallback_1_, AuthToken p_requestAuthTokenCallback_2_) + { + if (ErrorCode.succeeded(p_requestAuthTokenCallback_1_)) + { + this.field_152885_u = p_requestAuthTokenCallback_2_; + this.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + else + { + this.field_152885_u.data = ""; + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + String s = ErrorCode.getString(p_requestAuthTokenCallback_1_); + this.func_152820_d(String.format("RequestAuthTokenDoneCallback got failure: %s", new Object[] {s})); + } + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152900_a(p_requestAuthTokenCallback_1_, p_requestAuthTokenCallback_2_); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + + public void loginCallback(ErrorCode p_loginCallback_1_, ChannelInfo p_loginCallback_2_) + { + if (ErrorCode.succeeded(p_loginCallback_1_)) + { + this.field_152886_v = p_loginCallback_2_; + this.func_152827_a(BroadcastController.BroadcastState.LoggedIn); + this.field_152877_m = true; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + this.field_152877_m = false; + String s = ErrorCode.getString(p_loginCallback_1_); + this.func_152820_d(String.format("LoginCallback got failure: %s", new Object[] {s})); + } + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152897_a(p_loginCallback_1_); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + + public void getIngestServersCallback(ErrorCode p_getIngestServersCallback_1_, IngestList p_getIngestServersCallback_2_) + { + if (ErrorCode.succeeded(p_getIngestServersCallback_1_)) + { + this.field_152883_s = p_getIngestServersCallback_2_; + this.field_152884_t = this.field_152883_s.getDefaultServer(); + this.func_152827_a(BroadcastController.BroadcastState.ReceivedIngestServers); + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152896_a(p_getIngestServersCallback_2_); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + else + { + String s = ErrorCode.getString(p_getIngestServersCallback_1_); + this.func_152820_d(String.format("IngestListCallback got failure: %s", new Object[] {s})); + this.func_152827_a(BroadcastController.BroadcastState.LoggingIn); + } + } + + public void getUserInfoCallback(ErrorCode p_getUserInfoCallback_1_, UserInfo p_getUserInfoCallback_2_) + { + this.field_152887_w = p_getUserInfoCallback_2_; + + if (ErrorCode.failed(p_getUserInfoCallback_1_)) + { + String s = ErrorCode.getString(p_getUserInfoCallback_1_); + this.func_152820_d(String.format("UserInfoDoneCallback got failure: %s", new Object[] {s})); + } + } + + public void getStreamInfoCallback(ErrorCode p_getStreamInfoCallback_1_, StreamInfo p_getStreamInfoCallback_2_) + { + if (ErrorCode.succeeded(p_getStreamInfoCallback_1_)) + { + this.field_152888_x = p_getStreamInfoCallback_2_; + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152894_a(p_getStreamInfoCallback_2_); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + else + { + String s = ErrorCode.getString(p_getStreamInfoCallback_1_); + this.func_152832_e(String.format("StreamInfoDoneCallback got failure: %s", new Object[] {s})); + } + } + + public void getArchivingStateCallback(ErrorCode p_getArchivingStateCallback_1_, ArchivingState p_getArchivingStateCallback_2_) + { + this.field_152889_y = p_getArchivingStateCallback_2_; + + if (ErrorCode.failed(p_getArchivingStateCallback_1_)) + { + ; + } + } + + public void runCommercialCallback(ErrorCode p_runCommercialCallback_1_) + { + if (ErrorCode.failed(p_runCommercialCallback_1_)) + { + String s = ErrorCode.getString(p_runCommercialCallback_1_); + this.func_152832_e(String.format("RunCommercialCallback got failure: %s", new Object[] {s})); + } + } + + public void setStreamInfoCallback(ErrorCode p_setStreamInfoCallback_1_) + { + if (ErrorCode.failed(p_setStreamInfoCallback_1_)) + { + String s = ErrorCode.getString(p_setStreamInfoCallback_1_); + this.func_152832_e(String.format("SetStreamInfoCallback got failure: %s", new Object[] {s})); + } + } + + public void getGameNameListCallback(ErrorCode p_getGameNameListCallback_1_, GameInfoList p_getGameNameListCallback_2_) + { + if (ErrorCode.failed(p_getGameNameListCallback_1_)) + { + String s = ErrorCode.getString(p_getGameNameListCallback_1_); + this.func_152820_d(String.format("GameNameListCallback got failure: %s", new Object[] {s})); + } + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152898_a(p_getGameNameListCallback_1_, p_getGameNameListCallback_2_ == null ? new GameInfo[0] : p_getGameNameListCallback_2_.list); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + + public void bufferUnlockCallback(long p_bufferUnlockCallback_1_) + { + FrameBuffer framebuffer = FrameBuffer.lookupBuffer(p_bufferUnlockCallback_1_); + this.field_152875_k.add(framebuffer); + } + + public void startCallback(ErrorCode p_startCallback_1_) + { + if (ErrorCode.succeeded(p_startCallback_1_)) + { + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152899_b(); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + + this.func_152827_a(BroadcastController.BroadcastState.Broadcasting); + } + else + { + this.field_152881_q = null; + this.field_152882_r = null; + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + String s = ErrorCode.getString(p_startCallback_1_); + this.field_152867_c.func_152892_c(p_startCallback_1_); + this.func_152820_d(String.format("startCallback got failure: %s", new Object[] {s})); + } + } + + public void stopCallback(ErrorCode p_stopCallback_1_) + { + if (ErrorCode.succeeded(p_stopCallback_1_)) + { + this.field_152881_q = null; + this.field_152882_r = null; + this.func_152831_M(); + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152901_c(); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + + if (this.field_152877_m) + { + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + } + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + String s = ErrorCode.getString(p_stopCallback_1_); + this.func_152820_d(String.format("stopCallback got failure: %s", new Object[] {s})); + } + } + + public void sendActionMetaDataCallback(ErrorCode p_sendActionMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendActionMetaDataCallback_1_)) + { + this.func_152832_e("Failed sending action metadata: " + ErrorCode.getString(p_sendActionMetaDataCallback_1_)); + } + } + + public void sendStartSpanMetaDataCallback(ErrorCode p_sendStartSpanMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendStartSpanMetaDataCallback_1_)) + { + this.func_152832_e("Failed sending span metadata start: " + ErrorCode.getString(p_sendStartSpanMetaDataCallback_1_)); + } + } + + public void sendEndSpanMetaDataCallback(ErrorCode p_sendEndSpanMetaDataCallback_1_) + { + if (ErrorCode.failed(p_sendEndSpanMetaDataCallback_1_)) + { + this.func_152832_e("Failed sending span metadata end: " + ErrorCode.getString(p_sendEndSpanMetaDataCallback_1_)); + } + } + + public void statCallback(StatType p_statCallback_1_, long p_statCallback_2_) {} + + public void func_152841_a(BroadcastController.BroadcastListener p_152841_1_) + { + this.field_152867_c = p_152841_1_; + } + + public boolean func_152858_b() + { + return this.field_152876_l; + } + + public void func_152842_a(String p_152842_1_) + { + this.field_152868_d = p_152842_1_; + } + + public StreamInfo func_152816_j() + { + return this.field_152888_x; + } + + public ChannelInfo func_152843_l() + { + return this.field_152886_v; + } + + public boolean func_152850_m() + { + return this.field_152879_o == BroadcastController.BroadcastState.Broadcasting || this.field_152879_o == BroadcastController.BroadcastState.Paused; + } + + public boolean func_152857_n() + { + return this.field_152879_o == BroadcastController.BroadcastState.ReadyToBroadcast; + } + + public boolean func_152825_o() + { + return this.field_152879_o == BroadcastController.BroadcastState.IngestTesting; + } + + public boolean func_152839_p() + { + return this.field_152879_o == BroadcastController.BroadcastState.Paused; + } + + public boolean func_152849_q() + { + return this.field_152877_m; + } + + public IngestServer func_152833_s() + { + return this.field_152884_t; + } + + public void func_152824_a(IngestServer p_152824_1_) + { + this.field_152884_t = p_152824_1_; + } + + public IngestList func_152855_t() + { + return this.field_152883_s; + } + + public void func_152829_a(float p_152829_1_) + { + this.field_152873_i.setVolume(AudioDeviceType.TTV_RECORDER_DEVICE, p_152829_1_); + } + + public void func_152837_b(float p_152837_1_) + { + this.field_152873_i.setVolume(AudioDeviceType.TTV_PLAYBACK_DEVICE, p_152837_1_); + } + + public IngestServerTester func_152856_w() + { + return this.field_152860_A; + } + + public long func_152844_x() + { + return this.field_152873_i.getStreamTime(); + } + + protected boolean func_152848_y() + { + return true; + } + + public BroadcastController() + { + this.field_152879_o = BroadcastController.BroadcastState.Uninitialized; + this.field_152880_p = null; + this.field_152881_q = null; + this.field_152882_r = null; + this.field_152883_s = new IngestList(new IngestServer[0]); + this.field_152884_t = null; + this.field_152885_u = new AuthToken(); + this.field_152886_v = new ChannelInfo(); + this.field_152887_w = new UserInfo(); + this.field_152888_x = new StreamInfo(); + this.field_152889_y = new ArchivingState(); + this.field_152890_z = 0L; + this.field_152860_A = null; + this.field_152872_h = new Core(new StandardCoreAPI()); + this.field_152873_i = new Stream(new DesktopStreamAPI()); + } + + protected PixelFormat func_152826_z() + { + return PixelFormat.TTV_PF_RGBA; + } + + public boolean func_152817_A() + { + if (this.field_152876_l) + { + return false; + } + else + { + ErrorCode errorcode = this.field_152872_h.initialize(this.field_152868_d, VideoEncoder.TTV_VID_ENC_DEFAULT, System.getProperty("java.library.path")); + + if (!this.func_152853_a(errorcode)) + { + this.field_152864_E = errorcode; + return false; + } + else + { + this.field_152873_i.setStreamCallbacks(this); + + if (!this.func_152853_a(errorcode)) + { + this.field_152873_i.setStreamCallbacks((IStreamCallbacks)null); + this.field_152864_E = errorcode; + return false; + } + else + { + errorcode = this.field_152872_h.setTraceLevel(MessageLevel.TTV_ML_ERROR); + + if (!this.func_152853_a(errorcode)) + { + this.field_152873_i.setStreamCallbacks((IStreamCallbacks)null); + this.field_152864_E = errorcode; + return false; + } + else if (ErrorCode.succeeded(errorcode)) + { + this.field_152876_l = true; + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + return true; + } + else + { + this.field_152864_E = errorcode; + return false; + } + } + } + } + } + + public boolean func_152851_B() + { + if (!this.field_152876_l) + { + return true; + } + else if (this.func_152825_o()) + { + return false; + } + else + { + this.field_152878_n = true; + this.func_152845_C(); + this.field_152873_i.setStreamCallbacks((IStreamCallbacks)null); + this.field_152873_i.setStatCallbacks((IStatCallbacks)null); + ErrorCode errorcode = this.field_152872_h.shutdown(); + this.func_152853_a(errorcode); + this.field_152876_l = false; + this.field_152878_n = false; + this.func_152827_a(BroadcastController.BroadcastState.Uninitialized); + return true; + } + } + + public boolean func_152818_a(String p_152818_1_, AuthToken p_152818_2_) + { + if (this.func_152825_o()) + { + return false; + } + else + { + this.func_152845_C(); + + if (p_152818_1_ != null && !p_152818_1_.isEmpty()) + { + if (p_152818_2_ != null && p_152818_2_.data != null && !p_152818_2_.data.isEmpty()) + { + this.field_152880_p = p_152818_1_; + this.field_152885_u = p_152818_2_; + + if (this.func_152858_b()) + { + this.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + + return true; + } + else + { + this.func_152820_d("Auth token must be valid"); + return false; + } + } + else + { + this.func_152820_d("Username must be valid"); + return false; + } + } + } + + public boolean func_152845_C() + { + if (this.func_152825_o()) + { + return false; + } + else + { + if (this.func_152850_m()) + { + this.field_152873_i.stop(false); + } + + this.field_152880_p = ""; + this.field_152885_u = new AuthToken(); + + if (!this.field_152877_m) + { + return false; + } + else + { + this.field_152877_m = false; + + if (!this.field_152878_n) + { + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152895_a(); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + + this.func_152827_a(BroadcastController.BroadcastState.Initialized); + return true; + } + } + } + + public boolean func_152828_a(String p_152828_1_, String p_152828_2_, String p_152828_3_) + { + if (!this.field_152877_m) + { + return false; + } + else + { + if (p_152828_1_ == null || p_152828_1_.equals("")) + { + p_152828_1_ = this.field_152880_p; + } + + if (p_152828_2_ == null) + { + p_152828_2_ = ""; + } + + if (p_152828_3_ == null) + { + p_152828_3_ = ""; + } + + StreamInfoForSetting streaminfoforsetting = new StreamInfoForSetting(); + streaminfoforsetting.streamTitle = p_152828_3_; + streaminfoforsetting.gameName = p_152828_2_; + ErrorCode errorcode = this.field_152873_i.setStreamInfo(this.field_152885_u, p_152828_1_, streaminfoforsetting); + this.func_152853_a(errorcode); + return ErrorCode.succeeded(errorcode); + } + } + + public boolean func_152830_D() + { + if (!this.func_152850_m()) + { + return false; + } + else + { + ErrorCode errorcode = this.field_152873_i.runCommercial(this.field_152885_u); + this.func_152853_a(errorcode); + return ErrorCode.succeeded(errorcode); + } + } + + public VideoParams func_152834_a(int p_152834_1_, int p_152834_2_, float p_152834_3_, float p_152834_4_) + { + int[] aint = this.field_152873_i.getMaxResolution(p_152834_1_, p_152834_2_, p_152834_3_, p_152834_4_); + VideoParams videoparams = new VideoParams(); + videoparams.maxKbps = p_152834_1_; + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + videoparams.pixelFormat = this.func_152826_z(); + videoparams.targetFps = p_152834_2_; + videoparams.outputWidth = aint[0]; + videoparams.outputHeight = aint[1]; + videoparams.disableAdaptiveBitrate = false; + videoparams.verticalFlip = false; + return videoparams; + } + + public boolean func_152836_a(VideoParams p_152836_1_) + { + if (p_152836_1_ != null && this.func_152857_n()) + { + this.field_152881_q = p_152836_1_.clone(); + this.field_152882_r = new AudioParams(); + this.field_152882_r.audioEnabled = this.field_152871_g && this.func_152848_y(); + + if (!this.func_152823_L()) + { + this.field_152881_q = null; + this.field_152882_r = null; + return false; + } + else + { + ErrorCode errorcode = this.field_152873_i.start(p_152836_1_, this.field_152882_r, this.field_152884_t, StartFlags.None, true); + + if (ErrorCode.failed(errorcode)) + { + this.func_152831_M(); + String s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error while starting to broadcast: %s", new Object[] {s})); + this.field_152881_q = null; + this.field_152882_r = null; + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Starting); + return true; + } + } + } + else + { + return false; + } + } + + public boolean func_152819_E() + { + if (!this.func_152850_m()) + { + return false; + } + else + { + ErrorCode errorcode = this.field_152873_i.stop(true); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error while stopping the broadcast: %s", new Object[] {s})); + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Stopping); + return ErrorCode.succeeded(errorcode); + } + } + } + + public boolean func_152847_F() + { + if (!this.func_152850_m()) + { + return false; + } + else + { + ErrorCode errorcode = this.field_152873_i.pauseVideo(); + + if (ErrorCode.failed(errorcode)) + { + this.func_152819_E(); + String s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error pausing stream: %s\n", new Object[] {s})); + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Paused); + } + + return ErrorCode.succeeded(errorcode); + } + } + + public boolean func_152854_G() + { + if (!this.func_152839_p()) + { + return false; + } + else + { + this.func_152827_a(BroadcastController.BroadcastState.Broadcasting); + return true; + } + } + + public boolean func_152840_a(String p_152840_1_, long p_152840_2_, String p_152840_4_, String p_152840_5_) + { + ErrorCode errorcode = this.field_152873_i.sendActionMetaData(this.field_152885_u, p_152840_1_, p_152840_2_, p_152840_4_, p_152840_5_); + + if (ErrorCode.failed(errorcode)) + { + String s3 = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error while sending meta data: %s\n", new Object[] {s3})); + return false; + } + else + { + return true; + } + } + + protected void func_152827_a(BroadcastController.BroadcastState p_152827_1_) + { + if (p_152827_1_ != this.field_152879_o) + { + this.field_152879_o = p_152827_1_; + + try + { + if (this.field_152867_c != null) + { + this.field_152867_c.func_152891_a(p_152827_1_); + } + } + catch (Exception exception) + { + this.func_152820_d(exception.toString()); + } + } + } + + public void func_152821_H() + { + if (this.field_152873_i != null && this.field_152876_l) + { + ErrorCode errorcode = this.field_152873_i.pollTasks(); + this.func_152853_a(errorcode); + + if (this.func_152825_o()) + { + this.field_152860_A.func_153041_j(); + + if (this.field_152860_A.func_153032_e()) + { + this.field_152860_A = null; + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + } + } + + String s; + + switch (BroadcastController.SwitchBroadcastState.field_152815_a[this.field_152879_o.ordinal()]) + { + case 1: + this.func_152827_a(BroadcastController.BroadcastState.LoggingIn); + errorcode = this.field_152873_i.login(this.field_152885_u); + + if (ErrorCode.failed(errorcode)) + { + s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error in TTV_Login: %s\n", new Object[] {s})); + } + + break; + case 2: + this.func_152827_a(BroadcastController.BroadcastState.FindingIngestServer); + errorcode = this.field_152873_i.getIngestServers(this.field_152885_u); + + if (ErrorCode.failed(errorcode)) + { + this.func_152827_a(BroadcastController.BroadcastState.LoggedIn); + s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error in TTV_GetIngestServers: %s\n", new Object[] {s})); + } + + break; + case 3: + this.func_152827_a(BroadcastController.BroadcastState.ReadyToBroadcast); + errorcode = this.field_152873_i.getUserInfo(this.field_152885_u); + + if (ErrorCode.failed(errorcode)) + { + s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error in TTV_GetUserInfo: %s\n", new Object[] {s})); + } + + this.func_152835_I(); + errorcode = this.field_152873_i.getArchivingState(this.field_152885_u); + + if (ErrorCode.failed(errorcode)) + { + s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error in TTV_GetArchivingState: %s\n", new Object[] {s})); + } + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + default: + break; + case 11: + case 12: + this.func_152835_I(); + } + } + } + + protected void func_152835_I() + { + long i = System.nanoTime(); + long j = (i - this.field_152890_z) / 1000000000L; + + if (j >= 30L) + { + this.field_152890_z = i; + ErrorCode errorcode = this.field_152873_i.getStreamInfo(this.field_152885_u, this.field_152880_p); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152820_d(String.format("Error in TTV_GetStreamInfo: %s", new Object[] {s})); + } + } + } + + public IngestServerTester func_152838_J() + { + if (this.func_152857_n() && this.field_152883_s != null) + { + if (this.func_152825_o()) + { + return null; + } + else + { + this.field_152860_A = new IngestServerTester(this.field_152873_i, this.field_152883_s); + this.field_152860_A.func_153033_i(); + this.func_152827_a(BroadcastController.BroadcastState.IngestTesting); + return this.field_152860_A; + } + } + else + { + return null; + } + } + + protected boolean func_152823_L() + { + for (int i = 0; i < 3; ++i) + { + FrameBuffer framebuffer = this.field_152873_i.allocateFrameBuffer(this.field_152881_q.outputWidth * this.field_152881_q.outputHeight * 4); + + if (!framebuffer.getIsValid()) + { + this.func_152820_d(String.format("Error while allocating frame buffer", new Object[0])); + return false; + } + + this.field_152874_j.add(framebuffer); + this.field_152875_k.add(framebuffer); + } + + return true; + } + + protected void func_152831_M() + { + for (int i = 0; i < this.field_152874_j.size(); ++i) + { + FrameBuffer framebuffer = (FrameBuffer)this.field_152874_j.get(i); + framebuffer.free(); + } + + this.field_152875_k.clear(); + this.field_152874_j.clear(); + } + + public FrameBuffer func_152822_N() + { + if (this.field_152875_k.size() == 0) + { + this.func_152820_d(String.format("Out of free buffers, this should never happen", new Object[0])); + return null; + } + else + { + FrameBuffer framebuffer = (FrameBuffer)this.field_152875_k.get(this.field_152875_k.size() - 1); + this.field_152875_k.remove(this.field_152875_k.size() - 1); + return framebuffer; + } + } + + public void func_152846_a(FrameBuffer p_152846_1_) + { + try + { + this.field_152873_i.captureFrameBuffer_ReadPixels(p_152846_1_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Trying to submit a frame to Twitch"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Broadcast State"); + crashreportcategory.addCrashSection("Last reported errors", Arrays.toString(field_152862_C.func_152756_c())); + crashreportcategory.addCrashSection("Buffer", p_152846_1_); + crashreportcategory.addCrashSection("Free buffer count", Integer.valueOf(this.field_152875_k.size())); + crashreportcategory.addCrashSection("Capture buffer count", Integer.valueOf(this.field_152874_j.size())); + throw new ReportedException(crashreport); + } + } + + public ErrorCode func_152859_b(FrameBuffer p_152859_1_) + { + if (this.func_152839_p()) + { + this.func_152854_G(); + } + else if (!this.func_152850_m()) + { + return ErrorCode.TTV_EC_STREAM_NOT_STARTED; + } + + ErrorCode errorcode = this.field_152873_i.submitVideoFrame(p_152859_1_); + + if (errorcode != ErrorCode.TTV_EC_SUCCESS) + { + String s = ErrorCode.getString(errorcode); + + if (ErrorCode.succeeded(errorcode)) + { + this.func_152832_e(String.format("Warning in SubmitTexturePointer: %s\n", new Object[] {s})); + } + else + { + this.func_152820_d(String.format("Error in SubmitTexturePointer: %s\n", new Object[] {s})); + this.func_152819_E(); + } + + if (this.field_152867_c != null) + { + this.field_152867_c.func_152893_b(errorcode); + } + } + + return errorcode; + } + + protected boolean func_152853_a(ErrorCode p_152853_1_) + { + if (ErrorCode.failed(p_152853_1_)) + { + this.func_152820_d(ErrorCode.getString(p_152853_1_)); + return false; + } + else + { + return true; + } + } + + protected void func_152820_d(String p_152820_1_) + { + this.field_152863_D = p_152820_1_; + field_152862_C.func_152757_a(" " + p_152820_1_); + field_152861_B.error(TwitchStream.field_152949_a, "[Broadcast controller] {}", new Object[] {p_152820_1_}); + } + + protected void func_152832_e(String p_152832_1_) + { + field_152862_C.func_152757_a(" " + p_152832_1_); + field_152861_B.warn(TwitchStream.field_152949_a, "[Broadcast controller] {}", new Object[] {p_152832_1_}); + } + + public ErrorCode func_152852_P() + { + return this.field_152864_E; + } + + @SideOnly(Side.CLIENT) + public interface BroadcastListener + { + void func_152900_a(ErrorCode p_152900_1_, AuthToken p_152900_2_); + + void func_152897_a(ErrorCode p_152897_1_); + + void func_152898_a(ErrorCode p_152898_1_, GameInfo[] p_152898_2_); + + void func_152891_a(BroadcastController.BroadcastState p_152891_1_); + + void func_152895_a(); + + void func_152894_a(StreamInfo p_152894_1_); + + void func_152896_a(IngestList p_152896_1_); + + void func_152893_b(ErrorCode p_152893_1_); + + void func_152899_b(); + + void func_152901_c(); + + void func_152892_c(ErrorCode p_152892_1_); + } + + @SideOnly(Side.CLIENT) + public static enum BroadcastState + { + Uninitialized, + Initialized, + Authenticating, + Authenticated, + LoggingIn, + LoggedIn, + FindingIngestServer, + ReceivedIngestServers, + ReadyToBroadcast, + Starting, + Broadcasting, + Stopping, + Paused, + IngestTesting; + + private static final String __OBFID = "CL_00001820"; + } + + @SideOnly(Side.CLIENT) + + static final class SwitchBroadcastState + { + static final int[] field_152815_a = new int[BroadcastController.BroadcastState.values().length]; + private static final String __OBFID = "CL_00001821"; + + static + { + try + { + field_152815_a[BroadcastController.BroadcastState.Authenticated.ordinal()] = 1; + } + catch (NoSuchFieldError var12) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.LoggedIn.ordinal()] = 2; + } + catch (NoSuchFieldError var11) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.ReceivedIngestServers.ordinal()] = 3; + } + catch (NoSuchFieldError var10) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Starting.ordinal()] = 4; + } + catch (NoSuchFieldError var9) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Stopping.ordinal()] = 5; + } + catch (NoSuchFieldError var8) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.FindingIngestServer.ordinal()] = 6; + } + catch (NoSuchFieldError var7) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Authenticating.ordinal()] = 7; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Initialized.ordinal()] = 8; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Uninitialized.ordinal()] = 9; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.IngestTesting.ordinal()] = 10; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Paused.ordinal()] = 11; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_152815_a[BroadcastController.BroadcastState.Broadcasting.ordinal()] = 12; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/ChatController.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/ChatController.java new file mode 100644 index 0000000..e5fdca7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/ChatController.java @@ -0,0 +1,510 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import tv.twitch.AuthToken; +import tv.twitch.ErrorCode; +import tv.twitch.chat.Chat; +import tv.twitch.chat.ChatChannelInfo; +import tv.twitch.chat.ChatEvent; +import tv.twitch.chat.ChatMessage; +import tv.twitch.chat.ChatMessageList; +import tv.twitch.chat.ChatTokenizedMessage; +import tv.twitch.chat.ChatUserInfo; +import tv.twitch.chat.ChatUserList; +import tv.twitch.chat.IChatCallbacks; +import tv.twitch.chat.StandardChatAPI; + +@SideOnly(Side.CLIENT) +public class ChatController implements IChatCallbacks +{ + private static final Logger field_153018_p = LogManager.getLogger(); + protected ChatController.ChatListener field_153003_a = null; + protected String field_153004_b = ""; + protected String field_153005_c = ""; + protected String field_153006_d = ""; + protected String field_153007_e = ""; + protected Chat field_153008_f = null; + protected boolean field_153009_g = false; + protected boolean field_153010_h = false; + protected ChatController.ChatState field_153011_i; + protected AuthToken field_153012_j; + protected List field_153013_k; + protected LinkedList field_153014_l; + protected int field_153015_m; + protected boolean field_153016_n; + protected boolean field_153017_o; + private static final String __OBFID = "CL_00001819"; + + public void chatStatusCallback(ErrorCode p_chatStatusCallback_1_) + { + if (!ErrorCode.succeeded(p_chatStatusCallback_1_)) + { + this.field_153011_i = ChatController.ChatState.Disconnected; + } + } + + public void chatChannelMembershipCallback(ChatEvent p_chatChannelMembershipCallback_1_, ChatChannelInfo p_chatChannelMembershipCallback_2_) + { + switch (ChatController.SwitchChatState.field_152982_a[p_chatChannelMembershipCallback_1_.ordinal()]) + { + case 1: + this.field_153011_i = ChatController.ChatState.Connected; + this.func_152999_p(); + break; + case 2: + this.field_153011_i = ChatController.ChatState.Disconnected; + } + } + + public void chatChannelUserChangeCallback(ChatUserList p_chatChannelUserChangeCallback_1_, ChatUserList p_chatChannelUserChangeCallback_2_, ChatUserList p_chatChannelUserChangeCallback_3_) + { + int i; + int j; + + for (i = 0; i < p_chatChannelUserChangeCallback_2_.userList.length; ++i) + { + j = this.field_153013_k.indexOf(p_chatChannelUserChangeCallback_2_.userList[i]); + + if (j >= 0) + { + this.field_153013_k.remove(j); + } + } + + for (i = 0; i < p_chatChannelUserChangeCallback_3_.userList.length; ++i) + { + j = this.field_153013_k.indexOf(p_chatChannelUserChangeCallback_3_.userList[i]); + + if (j >= 0) + { + this.field_153013_k.remove(j); + } + + this.field_153013_k.add(p_chatChannelUserChangeCallback_3_.userList[i]); + } + + for (i = 0; i < p_chatChannelUserChangeCallback_1_.userList.length; ++i) + { + this.field_153013_k.add(p_chatChannelUserChangeCallback_1_.userList[i]); + } + + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_152904_a(p_chatChannelUserChangeCallback_1_.userList, p_chatChannelUserChangeCallback_2_.userList, p_chatChannelUserChangeCallback_3_.userList); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + + public void chatQueryChannelUsersCallback(ChatUserList p_chatQueryChannelUsersCallback_1_) {} + + public void chatChannelMessageCallback(ChatMessageList p_chatChannelMessageCallback_1_) + { + for (int i = 0; i < p_chatChannelMessageCallback_1_.messageList.length; ++i) + { + this.field_153014_l.addLast(p_chatChannelMessageCallback_1_.messageList[i]); + } + + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_152903_a(p_chatChannelMessageCallback_1_.messageList); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + + while (this.field_153014_l.size() > this.field_153015_m) + { + this.field_153014_l.removeFirst(); + } + } + + public void chatClearCallback(String p_chatClearCallback_1_) + { + this.func_152987_o(); + } + + public void emoticonDataDownloadCallback(ErrorCode p_emoticonDataDownloadCallback_1_) + { + if (ErrorCode.succeeded(p_emoticonDataDownloadCallback_1_)) + { + this.func_152988_s(); + } + } + + public void chatChannelTokenizedMessageCallback(ChatTokenizedMessage[] p_chatChannelTokenizedMessageCallback_1_) {} + + public void func_152990_a(ChatController.ChatListener p_152990_1_) + { + this.field_153003_a = p_152990_1_; + } + + public boolean func_152991_c() + { + return this.field_153011_i == ChatController.ChatState.Connected; + } + + public void func_152994_a(AuthToken p_152994_1_) + { + this.field_153012_j = p_152994_1_; + } + + public void func_152984_a(String p_152984_1_) + { + this.field_153006_d = p_152984_1_; + } + + public void func_152998_c(String p_152998_1_) + { + this.field_153004_b = p_152998_1_; + } + + public ChatController.ChatState func_153000_j() + { + return this.field_153011_i; + } + + public ChatController() + { + this.field_153011_i = ChatController.ChatState.Uninitialized; + this.field_153012_j = new AuthToken(); + this.field_153013_k = new ArrayList(); + this.field_153014_l = new LinkedList(); + this.field_153015_m = 128; + this.field_153016_n = false; + this.field_153017_o = false; + this.field_153008_f = new Chat(new StandardChatAPI()); + } + + public boolean func_152986_d(String p_152986_1_) + { + this.func_153002_l(); + this.field_153010_h = false; + this.field_153005_c = p_152986_1_; + return this.func_152985_f(p_152986_1_); + } + + public boolean func_153002_l() + { + if (this.field_153011_i != ChatController.ChatState.Connected && this.field_153011_i != ChatController.ChatState.Connecting) + { + if (this.field_153011_i == ChatController.ChatState.Disconnected) + { + this.func_152989_q(); + } + } + else + { + ErrorCode errorcode = this.field_153008_f.disconnect(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error disconnecting: %s", new Object[] {s})); + return false; + } + + this.func_152989_q(); + } + + return this.func_152993_m(); + } + + protected boolean func_152985_f(String p_152985_1_) + { + if (this.field_153009_g) + { + return false; + } + else + { + ErrorCode errorcode = this.field_153008_f.initialize(p_152985_1_, false); + + if (ErrorCode.failed(errorcode)) + { + String s1 = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error initializing chat: %s", new Object[] {s1})); + this.func_152989_q(); + return false; + } + else + { + this.field_153009_g = true; + this.field_153008_f.setChatCallbacks(this); + this.field_153011_i = ChatController.ChatState.Initialized; + return true; + } + } + } + + protected boolean func_152993_m() + { + if (this.field_153009_g) + { + ErrorCode errorcode = this.field_153008_f.shutdown(); + + if (ErrorCode.failed(errorcode)) + { + String s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error shutting down chat: %s", new Object[] {s})); + return false; + } + } + + this.field_153011_i = ChatController.ChatState.Uninitialized; + this.field_153009_g = false; + this.func_152996_t(); + this.field_153008_f.setChatCallbacks((IChatCallbacks)null); + return true; + } + + public void func_152997_n() + { + if (this.field_153009_g) + { + ErrorCode errorcode = this.field_153008_f.flushEvents(); + String s; + + if (ErrorCode.failed(errorcode)) + { + s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error flushing chat events: %s", new Object[] {s})); + } + + switch (ChatController.SwitchChatState.field_152983_b[this.field_153011_i.ordinal()]) + { + case 1: + case 3: + case 4: + default: + break; + case 2: + if (this.field_153010_h) + { + errorcode = this.field_153008_f.connectAnonymous(); + } + else + { + errorcode = this.field_153008_f.connect(this.field_153005_c, this.field_153012_j.data); + } + + if (ErrorCode.failed(errorcode)) + { + s = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error connecting: %s", new Object[] {s})); + this.func_152993_m(); + this.func_152989_q(); + } + else + { + this.field_153011_i = ChatController.ChatState.Connecting; + this.func_153001_r(); + } + + break; + case 5: + this.func_153002_l(); + } + } + } + + public boolean func_152992_g(String p_152992_1_) + { + if (this.field_153011_i != ChatController.ChatState.Connected) + { + return false; + } + else + { + ErrorCode errorcode = this.field_153008_f.sendMessage(p_152992_1_); + + if (ErrorCode.failed(errorcode)) + { + String s1 = ErrorCode.getString(errorcode); + this.func_152995_h(String.format("Error sending chat message: %s", new Object[] {s1})); + return false; + } + else + { + return true; + } + } + } + + public void func_152987_o() + { + this.field_153014_l.clear(); + + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_152902_f(); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + + protected void func_152999_p() + { + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_152906_d(); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + + protected void func_152989_q() + { + try + { + if (this.field_153003_a != null) + { + this.field_153003_a.func_152905_e(); + } + } + catch (Exception exception) + { + this.func_152995_h(exception.toString()); + } + } + + protected void func_153001_r() {} + + protected void func_152988_s() {} + + protected void func_152996_t() {} + + protected void func_152995_h(String p_152995_1_) + { + field_153018_p.error(TwitchStream.field_152949_a, "[Chat controller] {}", new Object[] {p_152995_1_}); + } + + @SideOnly(Side.CLIENT) + public interface ChatListener + { + void func_152903_a(ChatMessage[] p_152903_1_); + + void func_152904_a(ChatUserInfo[] p_152904_1_, ChatUserInfo[] p_152904_2_, ChatUserInfo[] p_152904_3_); + + void func_152906_d(); + + void func_152905_e(); + + void func_152902_f(); + } + + @SideOnly(Side.CLIENT) + public static enum ChatState + { + Uninitialized, + Initialized, + Connecting, + Connected, + Disconnected; + + private static final String __OBFID = "CL_00001817"; + } + + @SideOnly(Side.CLIENT) + + static final class SwitchChatState + { + static final int[] field_152982_a; + + static final int[] field_152983_b = new int[ChatController.ChatState.values().length]; + private static final String __OBFID = "CL_00001818"; + + static + { + try + { + field_152983_b[ChatController.ChatState.Uninitialized.ordinal()] = 1; + } + catch (NoSuchFieldError var7) + { + ; + } + + try + { + field_152983_b[ChatController.ChatState.Initialized.ordinal()] = 2; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + field_152983_b[ChatController.ChatState.Connecting.ordinal()] = 3; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + field_152983_b[ChatController.ChatState.Connected.ordinal()] = 4; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + field_152983_b[ChatController.ChatState.Disconnected.ordinal()] = 5; + } + catch (NoSuchFieldError var3) + { + ; + } + + field_152982_a = new int[ChatEvent.values().length]; + + try + { + field_152982_a[ChatEvent.TTV_CHAT_JOINED_CHANNEL.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_152982_a[ChatEvent.TTV_CHAT_LEFT_CHANNEL.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/IStream.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/IStream.java new file mode 100644 index 0000000..07d0908 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/IStream.java @@ -0,0 +1,78 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.chat.ChatUserInfo; + +@SideOnly(Side.CLIENT) +public interface IStream +{ + void func_152923_i(); + + void func_152935_j(); + + void func_152922_k(); + + boolean func_152936_l(); + + boolean func_152924_m(); + + boolean func_152934_n(); + + void func_152911_a(Metadata p_152911_1_, long p_152911_2_); + + boolean func_152919_o(); + + void func_152931_p(); + + void func_152916_q(); + + void func_152933_r(); + + void func_152915_s(); + + void func_152930_t(); + + void func_152914_u(); + + IngestServer[] func_152925_v(); + + void func_152909_x(); + + IngestServerTester func_152932_y(); + + boolean func_152908_z(); + + int func_152920_A(); + + boolean func_152927_B(); + + String func_152921_C(); + + ChatUserInfo func_152926_a(String p_152926_1_); + + void func_152917_b(String p_152917_1_); + + boolean func_152928_D(); + + ErrorCode func_152912_E(); + + boolean func_152913_F(); + + void func_152910_a(boolean p_152910_1_); + + boolean func_152929_G(); + + IStream.AuthFailureReason func_152918_H(); + + @SideOnly(Side.CLIENT) + public static enum AuthFailureReason + { + ERROR, + INVALID_TOKEN; + + private static final String __OBFID = "CL_00001813"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/IngestServerTester.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/IngestServerTester.java new file mode 100644 index 0000000..1adbebe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/IngestServerTester.java @@ -0,0 +1,600 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import tv.twitch.AuthToken; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.ArchivingState; +import tv.twitch.broadcast.AudioParams; +import tv.twitch.broadcast.ChannelInfo; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfoList; +import tv.twitch.broadcast.IStatCallbacks; +import tv.twitch.broadcast.IStreamCallbacks; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.PixelFormat; +import tv.twitch.broadcast.RTMPState; +import tv.twitch.broadcast.StartFlags; +import tv.twitch.broadcast.StatType; +import tv.twitch.broadcast.Stream; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.UserInfo; +import tv.twitch.broadcast.VideoParams; + +@SideOnly(Side.CLIENT) +public class IngestServerTester implements IStatCallbacks, IStreamCallbacks +{ + protected final boolean field_153043_a = true; + protected IngestServerTester.IngestTestListener field_153044_b = null; + protected Stream field_153045_c = null; + protected IngestList field_153046_d = null; + protected IngestServerTester.IngestTestState field_153047_e; + protected long field_153048_f; + protected long field_153049_g; + protected long field_153050_h; + protected RTMPState field_153051_i; + protected VideoParams field_153052_j; + protected AudioParams field_153053_k; + protected long field_153054_l; + protected List field_153055_m; + protected boolean field_153056_n; + protected IStreamCallbacks field_153057_o; + protected IStatCallbacks field_153058_p; + protected IngestServer field_153059_q; + protected boolean field_153060_r; + protected boolean field_153061_s; + protected int field_153062_t; + protected int field_153063_u; + protected long field_153064_v; + protected float field_153065_w; + protected float field_153066_x; + protected boolean field_153067_y; + private static final String __OBFID = "CL_00001816"; + + public void func_153042_a(IngestServerTester.IngestTestListener p_153042_1_) + { + this.field_153044_b = p_153042_1_; + } + + public IngestServer func_153040_c() + { + return this.field_153059_q; + } + + public boolean func_153032_e() + { + return this.field_153047_e == IngestServerTester.IngestTestState.Finished || this.field_153047_e == IngestServerTester.IngestTestState.Cancelled || this.field_153047_e == IngestServerTester.IngestTestState.Failed; + } + + public float func_153030_h() + { + return this.field_153066_x; + } + + public void requestAuthTokenCallback(ErrorCode p_requestAuthTokenCallback_1_, AuthToken p_requestAuthTokenCallback_2_) {} + + public void loginCallback(ErrorCode p_loginCallback_1_, ChannelInfo p_loginCallback_2_) {} + + public void getIngestServersCallback(ErrorCode p_getIngestServersCallback_1_, IngestList p_getIngestServersCallback_2_) {} + + public void getUserInfoCallback(ErrorCode p_getUserInfoCallback_1_, UserInfo p_getUserInfoCallback_2_) {} + + public void getStreamInfoCallback(ErrorCode p_getStreamInfoCallback_1_, StreamInfo p_getStreamInfoCallback_2_) {} + + public void getArchivingStateCallback(ErrorCode p_getArchivingStateCallback_1_, ArchivingState p_getArchivingStateCallback_2_) {} + + public void runCommercialCallback(ErrorCode p_runCommercialCallback_1_) {} + + public void setStreamInfoCallback(ErrorCode p_setStreamInfoCallback_1_) {} + + public void getGameNameListCallback(ErrorCode p_getGameNameListCallback_1_, GameInfoList p_getGameNameListCallback_2_) {} + + public void bufferUnlockCallback(long p_bufferUnlockCallback_1_) {} + + public void startCallback(ErrorCode p_startCallback_1_) + { + this.field_153067_y = false; + + if (ErrorCode.succeeded(p_startCallback_1_)) + { + this.func_153034_a(IngestServerTester.IngestTestState.ConnectingToServer); + this.field_153054_l = System.currentTimeMillis(); + } + else + { + this.field_153056_n = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + } + } + + public void stopCallback(ErrorCode p_stopCallback_1_) + { + this.field_153067_y = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + } + + public void sendActionMetaDataCallback(ErrorCode p_sendActionMetaDataCallback_1_) {} + + public void sendStartSpanMetaDataCallback(ErrorCode p_sendStartSpanMetaDataCallback_1_) {} + + public void sendEndSpanMetaDataCallback(ErrorCode p_sendEndSpanMetaDataCallback_1_) {} + + public void statCallback(StatType p_statCallback_1_, long p_statCallback_2_) + { + switch (IngestServerTester.SwitchStatType.field_153026_a[p_statCallback_1_.ordinal()]) + { + case 1: + this.field_153051_i = RTMPState.lookupValue((int)p_statCallback_2_); + break; + case 2: + this.field_153050_h = p_statCallback_2_; + } + } + + public IngestServerTester(Stream p_i1019_1_, IngestList p_i1019_2_) + { + this.field_153047_e = IngestServerTester.IngestTestState.Uninitalized; + this.field_153048_f = 8000L; + this.field_153049_g = 1000L; + this.field_153050_h = 0L; + this.field_153051_i = RTMPState.Invalid; + this.field_153052_j = null; + this.field_153053_k = null; + this.field_153054_l = 0L; + this.field_153055_m = null; + this.field_153056_n = false; + this.field_153057_o = null; + this.field_153058_p = null; + this.field_153059_q = null; + this.field_153060_r = false; + this.field_153061_s = false; + this.field_153062_t = -1; + this.field_153063_u = 0; + this.field_153064_v = 0L; + this.field_153065_w = 0.0F; + this.field_153066_x = 0.0F; + this.field_153067_y = false; + this.field_153045_c = p_i1019_1_; + this.field_153046_d = p_i1019_2_; + } + + protected void finalize() throws Throwable + { + if (this.field_153059_q != null) + { + this.func_153035_b(this.field_153059_q); + } + + this.func_153031_o(); + super.finalize(); + } + + public void func_153033_i() + { + if (this.field_153047_e == IngestServerTester.IngestTestState.Uninitalized) + { + this.field_153062_t = 0; + this.field_153060_r = false; + this.field_153061_s = false; + this.field_153058_p = this.field_153045_c.getStatCallbacks(); + this.field_153045_c.setStatCallbacks(this); + this.field_153057_o = this.field_153045_c.getStreamCallbacks(); + this.field_153045_c.setStreamCallbacks(this); + this.field_153052_j = new VideoParams(); + this.field_153052_j.targetFps = 60; + this.field_153052_j.maxKbps = 3500; + this.field_153052_j.outputWidth = 1280; + this.field_153052_j.outputHeight = 720; + this.field_153052_j.pixelFormat = PixelFormat.TTV_PF_BGRA; + this.field_153052_j.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + this.field_153052_j.disableAdaptiveBitrate = true; + this.field_153052_j.verticalFlip = false; + this.field_153045_c.getDefaultParams(this.field_153052_j); + this.field_153053_k = new AudioParams(); + this.field_153053_k.audioEnabled = false; + this.field_153055_m = new ArrayList(); + byte b0 = 3; + + for (int i = 0; i < b0; ++i) + { + FrameBuffer framebuffer = this.field_153045_c.allocateFrameBuffer(this.field_153052_j.outputWidth * this.field_153052_j.outputHeight * 4); + + if (!framebuffer.getIsValid()) + { + this.func_153031_o(); + this.func_153034_a(IngestServerTester.IngestTestState.Failed); + return; + } + + this.field_153055_m.add(framebuffer); + this.field_153045_c.randomizeFrameBuffer(framebuffer); + } + + this.func_153034_a(IngestServerTester.IngestTestState.Starting); + this.field_153054_l = System.currentTimeMillis(); + } + } + + public void func_153041_j() + { + if (!this.func_153032_e() && this.field_153047_e != IngestServerTester.IngestTestState.Uninitalized) + { + if (!this.field_153067_y) + { + if (this.field_153060_r) + { + this.func_153034_a(IngestServerTester.IngestTestState.Cancelled); + } + + switch (IngestServerTester.SwitchStatType.field_153027_b[this.field_153047_e.ordinal()]) + { + case 1: + case 2: + if (this.field_153059_q != null) + { + if (!this.field_153061_s && this.field_153056_n) + { + this.func_153035_b(this.field_153059_q); + } + else + { + this.field_153059_q.bitrateKbps = 0.0F; + this.field_153054_l = 0L; + this.field_153067_y = false; + } + + this.field_153059_q = null; + } + else if (!this.field_153067_y && this.func_153037_m() >= this.field_153049_g) + { + this.field_153054_l = 0L; + this.field_153061_s = false; + this.field_153056_n = true; + + if (this.field_153047_e != IngestServerTester.IngestTestState.Starting) + { + ++this.field_153062_t; + } + + if (this.field_153062_t < this.field_153046_d.getServers().length) + { + this.field_153059_q = this.field_153046_d.getServers()[this.field_153062_t]; + this.func_153036_a(this.field_153059_q); + } + else + { + this.func_153034_a(IngestServerTester.IngestTestState.Finished); + } + } + + break; + case 3: + case 4: + this.func_153029_c(this.field_153059_q); + } + + this.func_153038_n(); + + if (this.field_153047_e == IngestServerTester.IngestTestState.Cancelled || this.field_153047_e == IngestServerTester.IngestTestState.Finished) + { + if (this.field_153059_q != null) + { + if (this.field_153047_e == IngestServerTester.IngestTestState.Cancelled) + { + this.field_153059_q.bitrateKbps = 0.0F; + } + + this.func_153035_b(this.field_153059_q); + this.field_153059_q = null; + } + + if (this.field_153055_m != null) + { + this.func_153031_o(); + } + } + } + } + } + + public void func_153039_l() + { + if (!this.func_153032_e()) + { + this.field_153060_r = true; + } + } + + protected boolean func_153036_a(IngestServer p_153036_1_) + { + this.field_153056_n = true; + this.field_153050_h = 0L; + this.field_153051_i = RTMPState.Idle; + this.field_153059_q = p_153036_1_; + this.func_153034_a(IngestServerTester.IngestTestState.ConnectingToServer); + this.field_153067_y = true; + ErrorCode errorcode = this.field_153045_c.start(this.field_153052_j, this.field_153053_k, p_153036_1_, StartFlags.TTV_Start_BandwidthTest, true); + + if (ErrorCode.failed(errorcode)) + { + this.field_153056_n = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return false; + } + else + { + this.field_153064_v = this.field_153050_h; + p_153036_1_.bitrateKbps = 0.0F; + this.field_153063_u = 0; + return true; + } + } + + protected void func_153035_b(IngestServer p_153035_1_) + { + this.field_153067_y = true; + this.field_153045_c.stop(true); + this.field_153045_c.pollStats(); + } + + protected long func_153037_m() + { + return System.currentTimeMillis() - this.field_153054_l; + } + + protected void func_153038_n() + { + float f = (float)this.func_153037_m(); + + switch (IngestServerTester.SwitchStatType.field_153027_b[this.field_153047_e.ordinal()]) + { + case 1: + case 3: + case 5: + case 6: + case 7: + case 8: + this.field_153066_x = 0.0F; + break; + case 2: + this.field_153066_x = 1.0F; + break; + case 4: + default: + this.field_153066_x = f / (float)this.field_153048_f; + } + + switch (IngestServerTester.SwitchStatType.field_153027_b[this.field_153047_e.ordinal()]) + { + case 6: + case 7: + case 8: + this.field_153065_w = 1.0F; + break; + default: + this.field_153065_w = (float)this.field_153062_t / (float)this.field_153046_d.getServers().length; + this.field_153065_w += this.field_153066_x / (float)this.field_153046_d.getServers().length; + } + } + + protected boolean func_153029_c(IngestServer p_153029_1_) + { + if (!this.field_153061_s && this.func_153037_m() < this.field_153048_f) + { + if (this.field_153067_y) + { + return true; + } + else + { + ErrorCode errorcode = this.field_153045_c.submitVideoFrame((FrameBuffer)this.field_153055_m.get(this.field_153063_u)); + + if (ErrorCode.failed(errorcode)) + { + this.field_153056_n = false; + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return false; + } + else + { + this.field_153063_u = (this.field_153063_u + 1) % this.field_153055_m.size(); + this.field_153045_c.pollStats(); + + if (this.field_153051_i == RTMPState.SendVideo) + { + this.func_153034_a(IngestServerTester.IngestTestState.TestingServer); + long i = this.func_153037_m(); + + if (i > 0L && this.field_153050_h > this.field_153064_v) + { + p_153029_1_.bitrateKbps = (float)(this.field_153050_h * 8L) / (float)this.func_153037_m(); + this.field_153064_v = this.field_153050_h; + } + } + + return true; + } + } + } + else + { + this.func_153034_a(IngestServerTester.IngestTestState.DoneTestingServer); + return true; + } + } + + protected void func_153031_o() + { + this.field_153059_q = null; + + if (this.field_153055_m != null) + { + for (int i = 0; i < this.field_153055_m.size(); ++i) + { + ((FrameBuffer)this.field_153055_m.get(i)).free(); + } + + this.field_153055_m = null; + } + + if (this.field_153045_c.getStatCallbacks() == this) + { + this.field_153045_c.setStatCallbacks(this.field_153058_p); + this.field_153058_p = null; + } + + if (this.field_153045_c.getStreamCallbacks() == this) + { + this.field_153045_c.setStreamCallbacks(this.field_153057_o); + this.field_153057_o = null; + } + } + + protected void func_153034_a(IngestServerTester.IngestTestState p_153034_1_) + { + if (p_153034_1_ != this.field_153047_e) + { + this.field_153047_e = p_153034_1_; + + if (this.field_153044_b != null) + { + this.field_153044_b.func_152907_a(this, p_153034_1_); + } + } + } + + public int func_153028_p() + { + return this.field_153062_t; + } + + @SideOnly(Side.CLIENT) + public interface IngestTestListener + { + void func_152907_a(IngestServerTester p_152907_1_, IngestServerTester.IngestTestState p_152907_2_); + } + + @SideOnly(Side.CLIENT) + public static enum IngestTestState + { + Uninitalized, + Starting, + ConnectingToServer, + TestingServer, + DoneTestingServer, + Finished, + Cancelled, + Failed; + + private static final String __OBFID = "CL_00001814"; + } + + @SideOnly(Side.CLIENT) + + static final class SwitchStatType + { + static final int[] field_153026_a; + + static final int[] field_153027_b = new int[IngestServerTester.IngestTestState.values().length]; + private static final String __OBFID = "CL_00001815"; + + static + { + try + { + field_153027_b[IngestServerTester.IngestTestState.Starting.ordinal()] = 1; + } + catch (NoSuchFieldError var10) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.DoneTestingServer.ordinal()] = 2; + } + catch (NoSuchFieldError var9) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.ConnectingToServer.ordinal()] = 3; + } + catch (NoSuchFieldError var8) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.TestingServer.ordinal()] = 4; + } + catch (NoSuchFieldError var7) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.Uninitalized.ordinal()] = 5; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.Finished.ordinal()] = 6; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.Cancelled.ordinal()] = 7; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + field_153027_b[IngestServerTester.IngestTestState.Failed.ordinal()] = 8; + } + catch (NoSuchFieldError var3) + { + ; + } + + field_153026_a = new int[StatType.values().length]; + + try + { + field_153026_a[StatType.TTV_ST_RTMPSTATE.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_153026_a[StatType.TTV_ST_RTMPDATASENT.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/Metadata.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/Metadata.java new file mode 100644 index 0000000..b545ce8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/Metadata.java @@ -0,0 +1,87 @@ +package net.minecraft.client.stream; + +import com.google.common.base.Objects; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; + +@SideOnly(Side.CLIENT) +public class Metadata +{ + private static final Gson field_152811_a = new Gson(); + private final String field_152812_b; + private String field_152813_c; + private Map field_152814_d; + private static final String __OBFID = "CL_00001823"; + + public Metadata(String p_i1029_1_, String p_i1029_2_) + { + this.field_152812_b = p_i1029_1_; + this.field_152813_c = p_i1029_2_; + } + + public Metadata(String p_i1030_1_) + { + this(p_i1030_1_, (String)null); + } + + public void func_152807_a(String p_152807_1_) + { + this.field_152813_c = p_152807_1_; + } + + public String func_152809_a() + { + return this.field_152813_c == null ? this.field_152812_b : this.field_152813_c; + } + + public void func_152808_a(String p_152808_1_, String p_152808_2_) + { + if (this.field_152814_d == null) + { + this.field_152814_d = Maps.newHashMap(); + } + + if (this.field_152814_d.size() > 50) + { + throw new IllegalArgumentException("Metadata payload is full, cannot add more to it!"); + } + else if (p_152808_1_ == null) + { + throw new IllegalArgumentException("Metadata payload key cannot be null!"); + } + else if (p_152808_1_.length() > 255) + { + throw new IllegalArgumentException("Metadata payload key is too long!"); + } + else if (p_152808_2_ == null) + { + throw new IllegalArgumentException("Metadata payload value cannot be null!"); + } + else if (p_152808_2_.length() > 255) + { + throw new IllegalArgumentException("Metadata payload value is too long!"); + } + else + { + this.field_152814_d.put(p_152808_1_, p_152808_2_); + } + } + + public String func_152806_b() + { + return this.field_152814_d != null && !this.field_152814_d.isEmpty() ? field_152811_a.toJson(this.field_152814_d) : null; + } + + public String func_152810_c() + { + return this.field_152812_b; + } + + public String toString() + { + return Objects.toStringHelper(this).add("name", this.field_152812_b).add("description", this.field_152813_c).add("data", this.func_152806_b()).toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/MetadataAchievement.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/MetadataAchievement.java new file mode 100644 index 0000000..7f3abd7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/MetadataAchievement.java @@ -0,0 +1,20 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.stats.Achievement; + +@SideOnly(Side.CLIENT) +public class MetadataAchievement extends Metadata +{ + private static final String __OBFID = "CL_00001824"; + + public MetadataAchievement(Achievement p_i1032_1_) + { + super("achievement"); + this.func_152808_a("achievement_id", p_i1032_1_.statId); + this.func_152808_a("achievement_name", p_i1032_1_.func_150951_e().getUnformattedText()); + this.func_152808_a("achievement_description", p_i1032_1_.getDescription()); + this.func_152807_a("Achievement \'" + p_i1032_1_.func_150951_e().getUnformattedText() + "\' obtained!"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/NullStream.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/NullStream.java new file mode 100644 index 0000000..606c497 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/NullStream.java @@ -0,0 +1,130 @@ +package net.minecraft.client.stream; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.chat.ChatUserInfo; + +@SideOnly(Side.CLIENT) +public class NullStream implements IStream +{ + private final Throwable field_152938_a; + private static final String __OBFID = "CL_00001809"; + + public NullStream(Throwable p_i1006_1_) + { + this.field_152938_a = p_i1006_1_; + } + + public void func_152923_i() {} + + public void func_152935_j() {} + + public void func_152922_k() {} + + public boolean func_152936_l() + { + return false; + } + + public boolean func_152924_m() + { + return false; + } + + public boolean func_152934_n() + { + return false; + } + + public void func_152911_a(Metadata p_152911_1_, long p_152911_2_) {} + + public boolean func_152919_o() + { + return false; + } + + public void func_152931_p() {} + + public void func_152916_q() {} + + public void func_152933_r() {} + + public void func_152915_s() {} + + public void func_152930_t() {} + + public void func_152914_u() {} + + public IngestServer[] func_152925_v() + { + return new IngestServer[0]; + } + + public void func_152909_x() {} + + public IngestServerTester func_152932_y() + { + return null; + } + + public boolean func_152908_z() + { + return false; + } + + public int func_152920_A() + { + return 0; + } + + public boolean func_152927_B() + { + return false; + } + + public String func_152921_C() + { + return null; + } + + public ChatUserInfo func_152926_a(String p_152926_1_) + { + return null; + } + + public void func_152917_b(String p_152917_1_) {} + + public boolean func_152928_D() + { + return false; + } + + public ErrorCode func_152912_E() + { + return null; + } + + public boolean func_152913_F() + { + return false; + } + + public void func_152910_a(boolean p_152910_1_) {} + + public boolean func_152929_G() + { + return false; + } + + public IStream.AuthFailureReason func_152918_H() + { + return IStream.AuthFailureReason.ERROR; + } + + public Throwable func_152937_a() + { + return this.field_152938_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/stream/TwitchStream.java b/build/rfg/minecraft-src/java/net/minecraft/client/stream/TwitchStream.java new file mode 100644 index 0000000..6f307a1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/stream/TwitchStream.java @@ -0,0 +1,708 @@ +package net.minecraft.client.stream; + +import com.google.common.collect.Maps; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.stream.GuiTwitchUserMode; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.HttpUtil; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Util; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; +import org.apache.logging.log4j.core.helpers.Strings; +import org.lwjgl.opengl.GL11; +import tv.twitch.AuthToken; +import tv.twitch.ErrorCode; +import tv.twitch.broadcast.EncodingCpuUsage; +import tv.twitch.broadcast.FrameBuffer; +import tv.twitch.broadcast.GameInfo; +import tv.twitch.broadcast.IngestList; +import tv.twitch.broadcast.IngestServer; +import tv.twitch.broadcast.StreamInfo; +import tv.twitch.broadcast.VideoParams; +import tv.twitch.chat.ChatMessage; +import tv.twitch.chat.ChatUserInfo; +import tv.twitch.chat.ChatUserMode; +import tv.twitch.chat.ChatUserSubscription; + +@SideOnly(Side.CLIENT) +public class TwitchStream implements BroadcastController.BroadcastListener, ChatController.ChatListener, IngestServerTester.IngestTestListener, IStream +{ + private static final Logger field_152950_b = LogManager.getLogger(); + public static final Marker field_152949_a = MarkerManager.getMarker("STREAM"); + private final BroadcastController field_152951_c; + private final ChatController field_152952_d; + private final Minecraft field_152953_e; + private final IChatComponent field_152954_f = new ChatComponentText("Twitch"); + private final Map field_152955_g = Maps.newHashMap(); + private Framebuffer field_152956_h; + private boolean field_152957_i; + private int field_152958_j = 30; + private long field_152959_k = 0L; + private boolean field_152960_l = false; + private boolean field_152961_m; + private boolean field_152962_n; + private boolean field_152963_o; + private IStream.AuthFailureReason field_152964_p; + private static boolean field_152965_q; + private static final String __OBFID = "CL_00001812"; + + public TwitchStream(Minecraft p_i1012_1_, final String p_i1012_2_) + { + this.field_152964_p = IStream.AuthFailureReason.ERROR; + this.field_152953_e = p_i1012_1_; + this.field_152951_c = new BroadcastController(); + this.field_152952_d = new ChatController(); + this.field_152951_c.func_152841_a(this); + this.field_152952_d.func_152990_a(this); + this.field_152951_c.func_152842_a("nmt37qblda36pvonovdkbopzfzw3wlq"); + this.field_152952_d.func_152984_a("nmt37qblda36pvonovdkbopzfzw3wlq"); + this.field_152954_f.getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE); + + if (Strings.isNotEmpty(p_i1012_2_) && OpenGlHelper.framebufferSupported) + { + Thread thread = new Thread("Twitch authenticator") + { + private static final String __OBFID = "CL_00001811"; + public void run() + { + try + { + URL url = new URL("https://api.twitch.tv/kraken?oauth_token=" + URLEncoder.encode(p_i1012_2_, "UTF-8")); + String s = HttpUtil.func_152755_a(url); + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject((new JsonParser()).parse(s), "Response"); + JsonObject jsonobject1 = JsonUtils.func_152754_s(jsonobject, "token"); + + if (JsonUtils.getJsonObjectBooleanFieldValue(jsonobject1, "valid")) + { + String s1 = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "user_name"); + TwitchStream.field_152950_b.debug(TwitchStream.field_152949_a, "Authenticated with twitch; username is {}", new Object[] {s1}); + AuthToken authtoken = new AuthToken(); + authtoken.data = p_i1012_2_; + TwitchStream.this.field_152951_c.func_152818_a(s1, authtoken); + TwitchStream.this.field_152952_d.func_152998_c(s1); + TwitchStream.this.field_152952_d.func_152994_a(authtoken); + Runtime.getRuntime().addShutdownHook(new Thread("Twitch shutdown hook") + { + private static final String __OBFID = "CL_00001810"; + public void run() + { + TwitchStream.this.func_152923_i(); + } + }); + TwitchStream.this.field_152951_c.func_152817_A(); + } + else + { + TwitchStream.this.field_152964_p = IStream.AuthFailureReason.INVALID_TOKEN; + TwitchStream.field_152950_b.error(TwitchStream.field_152949_a, "Given twitch access token is invalid"); + } + } + catch (IOException ioexception) + { + TwitchStream.this.field_152964_p = IStream.AuthFailureReason.ERROR; + TwitchStream.field_152950_b.error(TwitchStream.field_152949_a, "Could not authenticate with twitch", ioexception); + } + } + }; + thread.setDaemon(true); + thread.start(); + } + } + + public void func_152923_i() + { + field_152950_b.debug(field_152949_a, "Shutdown streaming"); + this.field_152951_c.func_152851_B(); + this.field_152952_d.func_152993_m(); + } + + public void func_152935_j() + { + int i = this.field_152953_e.gameSettings.field_152408_R; + ChatController.ChatState chatstate = this.field_152952_d.func_153000_j(); + + if (i == 2) + { + if (chatstate == ChatController.ChatState.Connected) + { + field_152950_b.debug(field_152949_a, "Disconnecting from twitch chat per user options"); + this.field_152952_d.func_153002_l(); + } + } + else if (i == 1) + { + if ((chatstate == ChatController.ChatState.Disconnected || chatstate == ChatController.ChatState.Uninitialized) && this.field_152951_c.func_152849_q()) + { + field_152950_b.debug(field_152949_a, "Connecting to twitch chat per user options"); + this.func_152942_I(); + } + } + else if (i == 0) + { + if ((chatstate == ChatController.ChatState.Disconnected || chatstate == ChatController.ChatState.Uninitialized) && this.func_152934_n()) + { + field_152950_b.debug(field_152949_a, "Connecting to twitch chat as user is streaming"); + this.func_152942_I(); + } + else if (chatstate == ChatController.ChatState.Connected && !this.func_152934_n()) + { + field_152950_b.debug(field_152949_a, "Disconnecting from twitch chat as user is no longer streaming"); + this.field_152952_d.func_153002_l(); + } + } + + this.field_152951_c.func_152821_H(); + this.field_152952_d.func_152997_n(); + } + + protected void func_152942_I() + { + ChatController.ChatState chatstate = this.field_152952_d.func_153000_j(); + String s = this.field_152951_c.func_152843_l().name; + + if (chatstate == ChatController.ChatState.Uninitialized) + { + this.field_152952_d.func_152985_f(s); + this.field_152952_d.field_153005_c = s; + } + else if (chatstate == ChatController.ChatState.Disconnected) + { + this.field_152952_d.func_152986_d(s); + } + else + { + field_152950_b.warn("Invalid twitch chat state {}", new Object[] {chatstate}); + } + } + + public void func_152922_k() + { + if (this.field_152951_c.func_152850_m() && !this.field_152951_c.func_152839_p()) + { + long i = System.nanoTime(); + long j = (long)(1000000000 / this.field_152958_j); + long k = i - this.field_152959_k; + boolean flag = k >= j; + + if (flag) + { + FrameBuffer framebuffer = this.field_152951_c.func_152822_N(); + Framebuffer framebuffer1 = this.field_152953_e.getFramebuffer(); + this.field_152956_h.bindFramebuffer(true); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, (double)this.field_152956_h.framebufferWidth, (double)this.field_152956_h.framebufferHeight, 0.0D, 1000.0D, 3000.0D); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glViewport(0, 0, this.field_152956_h.framebufferWidth, this.field_152956_h.framebufferHeight); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + float f = (float)this.field_152956_h.framebufferWidth; + float f1 = (float)this.field_152956_h.framebufferHeight; + float f2 = (float)framebuffer1.framebufferWidth / (float)framebuffer1.framebufferTextureWidth; + float f3 = (float)framebuffer1.framebufferHeight / (float)framebuffer1.framebufferTextureHeight; + framebuffer1.bindFramebufferTexture(); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, 9729.0F); + GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, 9729.0F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(0.0D, (double)f1, 0.0D, 0.0D, (double)f3); + tessellator.addVertexWithUV((double)f, (double)f1, 0.0D, (double)f2, (double)f3); + tessellator.addVertexWithUV((double)f, 0.0D, 0.0D, (double)f2, 0.0D); + tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + tessellator.draw(); + framebuffer1.unbindFramebufferTexture(); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.field_152951_c.func_152846_a(framebuffer); + this.field_152956_h.unbindFramebuffer(); + this.field_152951_c.func_152859_b(framebuffer); + this.field_152959_k = i; + } + } + } + + public boolean func_152936_l() + { + return this.field_152951_c.func_152849_q(); + } + + public boolean func_152924_m() + { + return this.field_152951_c.func_152857_n(); + } + + public boolean func_152934_n() + { + return this.field_152951_c.func_152850_m(); + } + + public void func_152911_a(Metadata p_152911_1_, long p_152911_2_) + { + if (this.func_152934_n() && this.field_152957_i) + { + long j = this.field_152951_c.func_152844_x(); + + if (!this.field_152951_c.func_152840_a(p_152911_1_.func_152810_c(), j + p_152911_2_, p_152911_1_.func_152809_a(), p_152911_1_.func_152806_b())) + { + field_152950_b.warn(field_152949_a, "Couldn\'t send stream metadata action at {}: {}", new Object[] {Long.valueOf(j + p_152911_2_), p_152911_1_}); + } + else + { + field_152950_b.debug(field_152949_a, "Sent stream metadata action at {}: {}", new Object[] {Long.valueOf(j + p_152911_2_), p_152911_1_}); + } + } + } + + public boolean func_152919_o() + { + return this.field_152951_c.func_152839_p(); + } + + public void func_152931_p() + { + if (this.field_152951_c.func_152830_D()) + { + field_152950_b.debug(field_152949_a, "Requested commercial from Twitch"); + } + else + { + field_152950_b.warn(field_152949_a, "Could not request commercial from Twitch"); + } + } + + public void func_152916_q() + { + this.field_152951_c.func_152847_F(); + this.field_152962_n = true; + this.func_152915_s(); + } + + public void func_152933_r() + { + this.field_152951_c.func_152854_G(); + this.field_152962_n = false; + this.func_152915_s(); + } + + public void func_152915_s() + { + if (this.func_152934_n()) + { + float f = this.field_152953_e.gameSettings.field_152402_L; + boolean flag = this.field_152962_n || f <= 0.0F; + this.field_152951_c.func_152837_b(flag ? 0.0F : f); + this.field_152951_c.func_152829_a(this.func_152929_G() ? 0.0F : this.field_152953_e.gameSettings.field_152401_K); + } + } + + public void func_152930_t() + { + GameSettings gamesettings = this.field_152953_e.gameSettings; + VideoParams videoparams = this.field_152951_c.func_152834_a(func_152946_b(gamesettings.field_152403_M), func_152948_a(gamesettings.field_152404_N), func_152947_c(gamesettings.field_152400_J), (float)this.field_152953_e.displayWidth / (float)this.field_152953_e.displayHeight); + + switch (gamesettings.field_152405_O) + { + case 0: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_LOW; + break; + case 1: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_MEDIUM; + break; + case 2: + videoparams.encodingCpuUsage = EncodingCpuUsage.TTV_ECU_HIGH; + } + + if (this.field_152956_h == null) + { + this.field_152956_h = new Framebuffer(videoparams.outputWidth, videoparams.outputHeight, false); + } + else + { + this.field_152956_h.createBindFramebuffer(videoparams.outputWidth, videoparams.outputHeight); + } + + if (gamesettings.field_152407_Q != null && gamesettings.field_152407_Q.length() > 0) + { + IngestServer[] aingestserver = this.func_152925_v(); + int i = aingestserver.length; + + for (int j = 0; j < i; ++j) + { + IngestServer ingestserver = aingestserver[j]; + + if (ingestserver.serverUrl.equals(gamesettings.field_152407_Q)) + { + this.field_152951_c.func_152824_a(ingestserver); + break; + } + } + } + + this.field_152958_j = videoparams.targetFps; + this.field_152957_i = gamesettings.field_152406_P; + this.field_152951_c.func_152836_a(videoparams); + field_152950_b.info(field_152949_a, "Streaming at {}/{} at {} kbps to {}", new Object[] {Integer.valueOf(videoparams.outputWidth), Integer.valueOf(videoparams.outputHeight), Integer.valueOf(videoparams.maxKbps), this.field_152951_c.func_152833_s().serverUrl}); + this.field_152951_c.func_152828_a((String)null, "Minecraft", (String)null); + } + + public void func_152914_u() + { + if (this.field_152951_c.func_152819_E()) + { + field_152950_b.info(field_152949_a, "Stopped streaming to Twitch"); + } + else + { + field_152950_b.warn(field_152949_a, "Could not stop streaming to Twitch"); + } + } + + public void func_152900_a(ErrorCode p_152900_1_, AuthToken p_152900_2_) {} + + public void func_152897_a(ErrorCode p_152897_1_) + { + if (ErrorCode.succeeded(p_152897_1_)) + { + field_152950_b.debug(field_152949_a, "Login attempt successful"); + this.field_152961_m = true; + } + else + { + field_152950_b.warn(field_152949_a, "Login attempt unsuccessful: {} (error code {})", new Object[] {ErrorCode.getString(p_152897_1_), Integer.valueOf(p_152897_1_.getValue())}); + this.field_152961_m = false; + } + } + + public void func_152898_a(ErrorCode p_152898_1_, GameInfo[] p_152898_2_) {} + + public void func_152891_a(BroadcastController.BroadcastState p_152891_1_) + { + field_152950_b.debug(field_152949_a, "Broadcast state changed to {}", new Object[] {p_152891_1_}); + + if (p_152891_1_ == BroadcastController.BroadcastState.Initialized) + { + this.field_152951_c.func_152827_a(BroadcastController.BroadcastState.Authenticated); + } + } + + public void func_152895_a() + { + field_152950_b.info(field_152949_a, "Logged out of twitch"); + } + + public void func_152894_a(StreamInfo p_152894_1_) + { + field_152950_b.debug(field_152949_a, "Stream info updated; {} viewers on stream ID {}", new Object[] {Integer.valueOf(p_152894_1_.viewers), Long.valueOf(p_152894_1_.streamId)}); + } + + public void func_152896_a(IngestList p_152896_1_) {} + + public void func_152893_b(ErrorCode p_152893_1_) + { + field_152950_b.warn(field_152949_a, "Issue submitting frame: {} (Error code {})", new Object[] {ErrorCode.getString(p_152893_1_), Integer.valueOf(p_152893_1_.getValue())}); + this.field_152953_e.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText("Issue streaming frame: " + p_152893_1_ + " (" + ErrorCode.getString(p_152893_1_) + ")"), 2); + } + + public void func_152899_b() + { + this.func_152915_s(); + field_152950_b.info(field_152949_a, "Broadcast to Twitch has started"); + } + + public void func_152901_c() + { + field_152950_b.info(field_152949_a, "Broadcast to Twitch has stopped"); + } + + public void func_152892_c(ErrorCode p_152892_1_) + { + ChatComponentTranslation chatcomponenttranslation; + + if (p_152892_1_ == ErrorCode.TTV_EC_SOUNDFLOWER_NOT_INSTALLED) + { + chatcomponenttranslation = new ChatComponentTranslation("stream.unavailable.soundflower.chat.link", new Object[0]); + chatcomponenttranslation.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://help.mojang.com/customer/portal/articles/1374877-configuring-soundflower-for-streaming-on-apple-computers")); + chatcomponenttranslation.getChatStyle().setUnderlined(Boolean.valueOf(true)); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("stream.unavailable.soundflower.chat", new Object[] {chatcomponenttranslation}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_RED); + this.field_152953_e.ingameGUI.getChatGUI().printChatMessage(chatcomponenttranslation1); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("stream.unavailable.unknown.chat", new Object[] {ErrorCode.getString(p_152892_1_)}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_RED); + this.field_152953_e.ingameGUI.getChatGUI().printChatMessage(chatcomponenttranslation); + } + } + + public void func_152907_a(IngestServerTester p_152907_1_, IngestServerTester.IngestTestState p_152907_2_) + { + field_152950_b.debug(field_152949_a, "Ingest test state changed to {}", new Object[] {p_152907_2_}); + + if (p_152907_2_ == IngestServerTester.IngestTestState.Finished) + { + this.field_152960_l = true; + } + } + + public static int func_152948_a(float p_152948_0_) + { + return MathHelper.floor_float(10.0F + p_152948_0_ * 50.0F); + } + + public static int func_152946_b(float p_152946_0_) + { + return MathHelper.floor_float(230.0F + p_152946_0_ * 3270.0F); + } + + public static float func_152947_c(float p_152947_0_) + { + return 0.1F + p_152947_0_ * 0.1F; + } + + public IngestServer[] func_152925_v() + { + return this.field_152951_c.func_152855_t().getServers(); + } + + public void func_152909_x() + { + IngestServerTester ingestservertester = this.field_152951_c.func_152838_J(); + + if (ingestservertester != null) + { + ingestservertester.func_153042_a(this); + } + } + + public IngestServerTester func_152932_y() + { + return this.field_152951_c.func_152856_w(); + } + + public boolean func_152908_z() + { + return this.field_152951_c.func_152825_o(); + } + + public int func_152920_A() + { + return this.func_152934_n() ? this.field_152951_c.func_152816_j().viewers : 0; + } + + public void func_152903_a(ChatMessage[] p_152903_1_) + { + ChatMessage[] achatmessage1 = p_152903_1_; + int i = p_152903_1_.length; + + for (int j = 0; j < i; ++j) + { + ChatMessage chatmessage = achatmessage1[j]; + this.func_152939_a(chatmessage.userName, chatmessage); + + if (this.func_152940_a(chatmessage.modes, chatmessage.subscriptions, this.field_152953_e.gameSettings.field_152409_S)) + { + ChatComponentText chatcomponenttext = new ChatComponentText(chatmessage.userName); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.stream." + (chatmessage.action ? "emote" : "text"), new Object[] {this.field_152954_f, chatcomponenttext, EnumChatFormatting.getTextWithoutFormattingCodes(chatmessage.message)}); + + if (chatmessage.action) + { + chatcomponenttranslation.getChatStyle().setItalic(Boolean.valueOf(true)); + } + + ChatComponentText chatcomponenttext1 = new ChatComponentText(""); + chatcomponenttext1.appendSibling(new ChatComponentTranslation("stream.userinfo.chatTooltip", new Object[0])); + Iterator iterator = GuiTwitchUserMode.func_152328_a(chatmessage.modes, chatmessage.subscriptions, (IStream)null).iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + chatcomponenttext1.appendText("\n"); + chatcomponenttext1.appendSibling(ichatcomponent); + } + + chatcomponenttext.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, chatcomponenttext1)); + chatcomponenttext.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.TWITCH_USER_INFO, chatmessage.userName)); + this.field_152953_e.ingameGUI.getChatGUI().printChatMessage(chatcomponenttranslation); + } + } + } + + private void func_152939_a(String p_152939_1_, ChatMessage p_152939_2_) + { + ChatUserInfo chatuserinfo = (ChatUserInfo)this.field_152955_g.get(p_152939_1_); + + if (chatuserinfo == null) + { + chatuserinfo = new ChatUserInfo(); + chatuserinfo.displayName = p_152939_1_; + this.field_152955_g.put(p_152939_1_, chatuserinfo); + } + + chatuserinfo.subscriptions = p_152939_2_.subscriptions; + chatuserinfo.modes = p_152939_2_.modes; + chatuserinfo.emoticonSet = p_152939_2_.emoticonSet; + chatuserinfo.nameColorARGB = p_152939_2_.nameColorARGB; + } + + private boolean func_152940_a(HashSet p_152940_1_, HashSet p_152940_2_, int p_152940_3_) + { + return p_152940_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_BANNED) ? false : (p_152940_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_ADMINSTRATOR) ? true : (p_152940_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_MODERATOR) ? true : (p_152940_1_.contains(ChatUserMode.TTV_CHAT_USERMODE_STAFF) ? true : (p_152940_3_ == 0 ? true : (p_152940_3_ == 1 ? p_152940_2_.contains(ChatUserSubscription.TTV_CHAT_USERSUB_SUBSCRIBER) : false))))); + } + + public void func_152904_a(ChatUserInfo[] p_152904_1_, ChatUserInfo[] p_152904_2_, ChatUserInfo[] p_152904_3_) + { + ChatUserInfo[] achatuserinfo3 = p_152904_2_; + int i = p_152904_2_.length; + int j; + ChatUserInfo chatuserinfo; + + for (j = 0; j < i; ++j) + { + chatuserinfo = achatuserinfo3[j]; + this.field_152955_g.remove(chatuserinfo.displayName); + } + + achatuserinfo3 = p_152904_3_; + i = p_152904_3_.length; + + for (j = 0; j < i; ++j) + { + chatuserinfo = achatuserinfo3[j]; + this.field_152955_g.put(chatuserinfo.displayName, chatuserinfo); + } + + achatuserinfo3 = p_152904_1_; + i = p_152904_1_.length; + + for (j = 0; j < i; ++j) + { + chatuserinfo = achatuserinfo3[j]; + this.field_152955_g.put(chatuserinfo.displayName, chatuserinfo); + } + } + + public void func_152906_d() + { + field_152950_b.debug(field_152949_a, "Chat connected"); + } + + public void func_152905_e() + { + field_152950_b.debug(field_152949_a, "Chat disconnected"); + this.field_152955_g.clear(); + } + + public void func_152902_f() {} + + public boolean func_152927_B() + { + return this.field_152952_d.func_152991_c() && this.field_152952_d.field_153005_c.equals(this.field_152951_c.func_152843_l().name); + } + + public String func_152921_C() + { + return this.field_152952_d.field_153005_c; + } + + public ChatUserInfo func_152926_a(String p_152926_1_) + { + return (ChatUserInfo)this.field_152955_g.get(p_152926_1_); + } + + public void func_152917_b(String p_152917_1_) + { + this.field_152952_d.func_152992_g(p_152917_1_); + } + + public boolean func_152928_D() + { + return field_152965_q && this.field_152951_c.func_152858_b(); + } + + public ErrorCode func_152912_E() + { + return !field_152965_q ? ErrorCode.TTV_EC_OS_TOO_OLD : this.field_152951_c.func_152852_P(); + } + + public boolean func_152913_F() + { + return this.field_152961_m; + } + + public void func_152910_a(boolean p_152910_1_) + { + this.field_152963_o = p_152910_1_; + this.func_152915_s(); + } + + public boolean func_152929_G() + { + boolean flag = this.field_152953_e.gameSettings.field_152410_T == 1; + return this.field_152962_n || this.field_152953_e.gameSettings.field_152401_K <= 0.0F || flag != this.field_152963_o; + } + + public IStream.AuthFailureReason func_152918_H() + { + return this.field_152964_p; + } + + static + { + try + { + if (Util.getOSType() == Util.EnumOS.WINDOWS) + { + System.loadLibrary("avutil-ttv-51"); + System.loadLibrary("swresample-ttv-0"); + System.loadLibrary("libmp3lame-ttv"); + + if (System.getProperty("os.arch").contains("64")) + { + System.loadLibrary("libmfxsw64"); + } + else + { + System.loadLibrary("libmfxsw32"); + } + } + + field_152965_q = true; + } + catch (Throwable var1) + { + field_152965_q = false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonBlendingMode.java b/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonBlendingMode.java new file mode 100644 index 0000000..578d848 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonBlendingMode.java @@ -0,0 +1,202 @@ +package net.minecraft.client.util; + +import com.google.gson.JsonObject; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.JsonUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL14; + +@SideOnly(Side.CLIENT) +public class JsonBlendingMode +{ + private static JsonBlendingMode field_148118_a = null; + private final int field_148116_b; + private final int field_148117_c; + private final int field_148114_d; + private final int field_148115_e; + private final int field_148112_f; + private final boolean field_148113_g; + private final boolean field_148119_h; + private static final String __OBFID = "CL_00001038"; + + private JsonBlendingMode(boolean p_i45084_1_, boolean p_i45084_2_, int p_i45084_3_, int p_i45084_4_, int p_i45084_5_, int p_i45084_6_, int p_i45084_7_) + { + this.field_148113_g = p_i45084_1_; + this.field_148116_b = p_i45084_3_; + this.field_148114_d = p_i45084_4_; + this.field_148117_c = p_i45084_5_; + this.field_148115_e = p_i45084_6_; + this.field_148119_h = p_i45084_2_; + this.field_148112_f = p_i45084_7_; + } + + public JsonBlendingMode() + { + this(false, true, 1, 0, 1, 0, 32774); + } + + public JsonBlendingMode(int p_i45085_1_, int p_i45085_2_, int p_i45085_3_) + { + this(false, false, p_i45085_1_, p_i45085_2_, p_i45085_1_, p_i45085_2_, p_i45085_3_); + } + + public JsonBlendingMode(int p_i45086_1_, int p_i45086_2_, int p_i45086_3_, int p_i45086_4_, int p_i45086_5_) + { + this(true, false, p_i45086_1_, p_i45086_2_, p_i45086_3_, p_i45086_4_, p_i45086_5_); + } + + public void func_148109_a() + { + if (!this.equals(field_148118_a)) + { + if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b()) + { + field_148118_a = this; + + if (this.field_148119_h) + { + GL11.glDisable(GL11.GL_BLEND); + return; + } + + GL11.glEnable(GL11.GL_BLEND); + } + + GL14.glBlendEquation(this.field_148112_f); + + if (this.field_148113_g) + { + GL14.glBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e); + } + else + { + GL11.glBlendFunc(this.field_148116_b, this.field_148114_d); + } + } + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof JsonBlendingMode)) + { + return false; + } + else + { + JsonBlendingMode jsonblendingmode = (JsonBlendingMode)p_equals_1_; + return this.field_148112_f != jsonblendingmode.field_148112_f ? false : (this.field_148115_e != jsonblendingmode.field_148115_e ? false : (this.field_148114_d != jsonblendingmode.field_148114_d ? false : (this.field_148119_h != jsonblendingmode.field_148119_h ? false : (this.field_148113_g != jsonblendingmode.field_148113_g ? false : (this.field_148117_c != jsonblendingmode.field_148117_c ? false : this.field_148116_b == jsonblendingmode.field_148116_b))))); + } + } + + public int hashCode() + { + int i = this.field_148116_b; + i = 31 * i + this.field_148117_c; + i = 31 * i + this.field_148114_d; + i = 31 * i + this.field_148115_e; + i = 31 * i + this.field_148112_f; + i = 31 * i + (this.field_148113_g ? 1 : 0); + i = 31 * i + (this.field_148119_h ? 1 : 0); + return i; + } + + public boolean func_148111_b() + { + return this.field_148119_h; + } + + public static JsonBlendingMode func_148110_a(JsonObject p_148110_0_) + { + if (p_148110_0_ == null) + { + return new JsonBlendingMode(); + } + else + { + int i = 32774; + int j = 1; + int k = 0; + int l = 1; + int i1 = 0; + boolean flag = true; + boolean flag1 = false; + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "func")) + { + i = func_148108_a(p_148110_0_.get("func").getAsString()); + + if (i != 32774) + { + flag = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "srcrgb")) + { + j = func_148107_b(p_148110_0_.get("srcrgb").getAsString()); + + if (j != 1) + { + flag = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "dstrgb")) + { + k = func_148107_b(p_148110_0_.get("dstrgb").getAsString()); + + if (k != 0) + { + flag = false; + } + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "srcalpha")) + { + l = func_148107_b(p_148110_0_.get("srcalpha").getAsString()); + + if (l != 1) + { + flag = false; + } + + flag1 = true; + } + + if (JsonUtils.jsonObjectFieldTypeIsString(p_148110_0_, "dstalpha")) + { + i1 = func_148107_b(p_148110_0_.get("dstalpha").getAsString()); + + if (i1 != 0) + { + flag = false; + } + + flag1 = true; + } + + return flag ? new JsonBlendingMode() : (flag1 ? new JsonBlendingMode(j, k, l, i1, i) : new JsonBlendingMode(j, k, i)); + } + } + + private static int func_148108_a(String p_148108_0_) + { + String s1 = p_148108_0_.trim().toLowerCase(); + return s1.equals("add") ? 32774 : (s1.equals("subtract") ? 32778 : (s1.equals("reversesubtract") ? 32779 : (s1.equals("reverse_subtract") ? 32779 : (s1.equals("min") ? 32775 : (s1.equals("max") ? 32776 : 32774))))); + } + + private static int func_148107_b(String p_148107_0_) + { + String s1 = p_148107_0_.trim().toLowerCase(); + s1 = s1.replaceAll("_", ""); + s1 = s1.replaceAll("one", "1"); + s1 = s1.replaceAll("zero", "0"); + s1 = s1.replaceAll("minus", "-"); + return s1.equals("0") ? 0 : (s1.equals("1") ? 1 : (s1.equals("srccolor") ? 768 : (s1.equals("1-srccolor") ? 769 : (s1.equals("dstcolor") ? 774 : (s1.equals("1-dstcolor") ? 775 : (s1.equals("srcalpha") ? 770 : (s1.equals("1-srcalpha") ? 771 : (s1.equals("dstalpha") ? 772 : (s1.equals("1-dstalpha") ? 773 : -1))))))))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonException.java b/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonException.java new file mode 100644 index 0000000..378fe5f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/util/JsonException.java @@ -0,0 +1,99 @@ +package net.minecraft.client.util; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import org.apache.commons.lang3.StringUtils; + +@SideOnly(Side.CLIENT) +public class JsonException extends IOException +{ + private final List field_151383_a = Lists.newArrayList(); + private final String field_151382_b; + private static final String __OBFID = "CL_00001414"; + + public JsonException(String p_i45279_1_) + { + this.field_151383_a.add(new JsonException.Entry(null)); + this.field_151382_b = p_i45279_1_; + } + + public JsonException(String p_i45280_1_, Throwable p_i45280_2_) + { + super(p_i45280_2_); + this.field_151383_a.add(new JsonException.Entry(null)); + this.field_151382_b = p_i45280_1_; + } + + public void func_151380_a(String p_151380_1_) + { + ((JsonException.Entry)this.field_151383_a.get(0)).func_151373_a(p_151380_1_); + } + + public void func_151381_b(String p_151381_1_) + { + ((JsonException.Entry)this.field_151383_a.get(0)).field_151376_a = p_151381_1_; + this.field_151383_a.add(0, new JsonException.Entry(null)); + } + + public String getMessage() + { + return "Invalid " + ((JsonException.Entry)this.field_151383_a.get(this.field_151383_a.size() - 1)).toString() + ": " + this.field_151382_b; + } + + public static JsonException func_151379_a(Exception p_151379_0_) + { + if (p_151379_0_ instanceof JsonException) + { + return (JsonException)p_151379_0_; + } + else + { + String s = p_151379_0_.getMessage(); + + if (p_151379_0_ instanceof FileNotFoundException) + { + s = "File not found"; + } + + return new JsonException(s, p_151379_0_); + } + } + + @SideOnly(Side.CLIENT) + public static class Entry + { + private String field_151376_a; + private final List field_151375_b; + private static final String __OBFID = "CL_00001416"; + + private Entry() + { + this.field_151376_a = null; + this.field_151375_b = Lists.newArrayList(); + } + + private void func_151373_a(String p_151373_1_) + { + this.field_151375_b.add(0, p_151373_1_); + } + + public String func_151372_b() + { + return StringUtils.join(this.field_151375_b, "->"); + } + + public String toString() + { + return this.field_151376_a != null ? (!this.field_151375_b.isEmpty() ? this.field_151376_a + " " + this.func_151372_b() : this.field_151376_a) : (!this.field_151375_b.isEmpty() ? "(Unknown file) " + this.func_151372_b() : "(Unknown file)"); + } + + Entry(Object p_i45278_1_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/util/QuadComparator.java b/build/rfg/minecraft-src/java/net/minecraft/client/util/QuadComparator.java new file mode 100644 index 0000000..5535f65 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/util/QuadComparator.java @@ -0,0 +1,65 @@ +package net.minecraft.client.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Comparator; + +@SideOnly(Side.CLIENT) +public class QuadComparator implements Comparator +{ + private float field_147630_a; + private float field_147628_b; + private float field_147629_c; + private int[] field_147627_d; + private static final String __OBFID = "CL_00000958"; + + public QuadComparator(int[] p_i45077_1_, float p_i45077_2_, float p_i45077_3_, float p_i45077_4_) + { + this.field_147627_d = p_i45077_1_; + this.field_147630_a = p_i45077_2_; + this.field_147628_b = p_i45077_3_; + this.field_147629_c = p_i45077_4_; + } + + public int compare(Integer p_compare_1_, Integer p_compare_2_) + { + float f = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue()]) - this.field_147630_a; + float f1 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 1]) - this.field_147628_b; + float f2 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 2]) - this.field_147629_c; + float f3 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 8]) - this.field_147630_a; + float f4 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 9]) - this.field_147628_b; + float f5 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 10]) - this.field_147629_c; + float f6 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 16]) - this.field_147630_a; + float f7 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 17]) - this.field_147628_b; + float f8 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 18]) - this.field_147629_c; + float f9 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 24]) - this.field_147630_a; + float f10 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 25]) - this.field_147628_b; + float f11 = Float.intBitsToFloat(this.field_147627_d[p_compare_1_.intValue() + 26]) - this.field_147629_c; + float f12 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue()]) - this.field_147630_a; + float f13 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 1]) - this.field_147628_b; + float f14 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 2]) - this.field_147629_c; + float f15 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 8]) - this.field_147630_a; + float f16 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 9]) - this.field_147628_b; + float f17 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 10]) - this.field_147629_c; + float f18 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 16]) - this.field_147630_a; + float f19 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 17]) - this.field_147628_b; + float f20 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 18]) - this.field_147629_c; + float f21 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 24]) - this.field_147630_a; + float f22 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 25]) - this.field_147628_b; + float f23 = Float.intBitsToFloat(this.field_147627_d[p_compare_2_.intValue() + 26]) - this.field_147629_c; + float f24 = (f + f3 + f6 + f9) * 0.25F; + float f25 = (f1 + f4 + f7 + f10) * 0.25F; + float f26 = (f2 + f5 + f8 + f11) * 0.25F; + float f27 = (f12 + f15 + f18 + f21) * 0.25F; + float f28 = (f13 + f16 + f19 + f22) * 0.25F; + float f29 = (f14 + f17 + f20 + f23) * 0.25F; + float f30 = f24 * f24 + f25 * f25 + f26 * f26; + float f31 = f27 * f27 + f28 * f28 + f29 * f29; + return Float.compare(f31, f30); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((Integer)p_compare_1_, (Integer)p_compare_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/client/util/RenderDistanceSorter.java b/build/rfg/minecraft-src/java/net/minecraft/client/util/RenderDistanceSorter.java new file mode 100644 index 0000000..7c96b5f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/client/util/RenderDistanceSorter.java @@ -0,0 +1,37 @@ +package net.minecraft.client.util; + +import com.google.common.collect.ComparisonChain; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Comparator; +import net.minecraft.client.renderer.RenderList; + +@SideOnly(Side.CLIENT) +public class RenderDistanceSorter implements Comparator +{ + int field_152632_a; + int field_152633_b; + private static final String __OBFID = "CL_00000945"; + + public RenderDistanceSorter(int p_i1051_1_, int p_i1051_2_) + { + this.field_152632_a = p_i1051_1_; + this.field_152633_b = p_i1051_2_; + } + + public int compare(RenderList p_compare_1_, RenderList p_compare_2_) + { + int i = p_compare_1_.renderChunkX - this.field_152632_a; + int j = p_compare_1_.renderChunkZ - this.field_152633_b; + int k = p_compare_2_.renderChunkX - this.field_152632_a; + int l = p_compare_2_.renderChunkZ - this.field_152633_b; + int i1 = i * i + j * j; + int j1 = k * k + l * l; + return ComparisonChain.start().compare(j1, i1).result(); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((RenderList)p_compare_1_, (RenderList)p_compare_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandBase.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandBase.java new file mode 100644 index 0000000..c3780d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandBase.java @@ -0,0 +1,572 @@ +package net.minecraft.command; + +import com.google.common.primitives.Doubles; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public abstract class CommandBase implements ICommand +{ + private static IAdminCommand theAdmin; + private static final String __OBFID = "CL_00001739"; + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 4; + } + + public List getCommandAliases() + { + return null; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return sender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return null; + } + + /** + * Parses an int from the given string. + */ + public static int parseInt(ICommandSender sender, String str) + { + try + { + return Integer.parseInt(str); + } + catch (NumberFormatException numberformatexception) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {str}); + } + } + + /** + * Parses an int from the given sring with a specified minimum. + */ + public static int parseIntWithMin(ICommandSender sender, String str, int min) + { + return parseIntBounded(sender, str, min, Integer.MAX_VALUE); + } + + /** + * Parses an int from the given string within a specified bound. + */ + public static int parseIntBounded(ICommandSender sender, String str, int min, int max) + { + int k = parseInt(sender, str); + + if (k < min) + { + throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Integer.valueOf(k), Integer.valueOf(min)}); + } + else if (k > max) + { + throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Integer.valueOf(k), Integer.valueOf(max)}); + } + else + { + return k; + } + } + + /** + * Parses a double from the given string or throws an exception if it's not a double. + */ + public static double parseDouble(ICommandSender sender, String str) + { + try + { + double d0 = Double.parseDouble(str); + + if (!Doubles.isFinite(d0)) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {str}); + } + else + { + return d0; + } + } + catch (NumberFormatException numberformatexception) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {str}); + } + } + + /** + * Parses a double from the given string. Throws if the string could not be parsed as a double, or if it's less + * than the given minimum value. + */ + public static double parseDoubleWithMin(ICommandSender sender, String str, double min) + { + return parseDoubleBounded(sender, str, min, Double.MAX_VALUE); + } + + /** + * Parses a double from the given string. Throws if the string could not be parsed as a double, or if it's not + * between the given min and max values. + */ + public static double parseDoubleBounded(ICommandSender sender, String str, double min, double max) + { + double d2 = parseDouble(sender, str); + + if (d2 < min) + { + throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(d2), Double.valueOf(min)}); + } + else if (d2 > max) + { + throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(d2), Double.valueOf(max)}); + } + else + { + return d2; + } + } + + /** + * Parses a boolean value from the given string. Throws if the string does not contain a boolean value. Accepted + * values are (case-sensitive): "true", "false", "0", "1". + */ + public static boolean parseBoolean(ICommandSender sender, String str) + { + if (!str.equals("true") && !str.equals("1")) + { + if (!str.equals("false") && !str.equals("0")) + { + throw new CommandException("commands.generic.boolean.invalid", new Object[] {str}); + } + else + { + return false; + } + } + else + { + return true; + } + } + + /** + * Returns the given ICommandSender as a EntityPlayer or throw an exception. + */ + public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender sender) + { + if (sender instanceof EntityPlayerMP) + { + return (EntityPlayerMP)sender; + } + else + { + throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", new Object[0]); + } + } + + public static EntityPlayerMP getPlayer(ICommandSender sender, String username) + { + EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(sender, username); + + if (entityplayermp != null) + { + return entityplayermp; + } + else + { + entityplayermp = MinecraftServer.getServer().getConfigurationManager().func_152612_a(username); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + else + { + return entityplayermp; + } + } + } + + public static String func_96332_d(ICommandSender sender, String query) + { + EntityPlayerMP entityplayermp = PlayerSelector.matchOnePlayer(sender, query); + + if (entityplayermp != null) + { + return entityplayermp.getCommandSenderName(); + } + else if (PlayerSelector.hasArguments(query)) + { + throw new PlayerNotFoundException(); + } + else + { + return query; + } + } + + public static IChatComponent func_147178_a(ICommandSender sender, String[] args, int p_147178_2_) + { + return func_147176_a(sender, args, p_147178_2_, false); + } + + public static IChatComponent func_147176_a(ICommandSender sender, String[] args, int index, boolean p_147176_3_) + { + ChatComponentText chatcomponenttext = new ChatComponentText(""); + + for (int j = index; j < args.length; ++j) + { + if (j > index) + { + chatcomponenttext.appendText(" "); + } + + Object object = new ChatComponentText(args[j]); + + if (p_147176_3_) + { + IChatComponent ichatcomponent = PlayerSelector.func_150869_b(sender, args[j]); + + if (ichatcomponent != null) + { + object = ichatcomponent; + } + else if (PlayerSelector.hasArguments(args[j])) + { + throw new PlayerNotFoundException(); + } + } + + chatcomponenttext.appendSibling((IChatComponent)object); + } + + return chatcomponenttext; + } + + public static String func_82360_a(ICommandSender sender, String[] args, int index) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int j = index; j < args.length; ++j) + { + if (j > index) + { + stringbuilder.append(" "); + } + + String s = args[j]; + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + public static double func_110666_a(ICommandSender sender, double p_110666_1_, String p_110666_3_) + { + return func_110665_a(sender, p_110666_1_, p_110666_3_, -30000000, 30000000); + } + + public static double func_110665_a(ICommandSender sender, double p_110665_1_, String p_110665_3_, int min, int max) + { + boolean flag = p_110665_3_.startsWith("~"); + + if (flag && Double.isNaN(p_110665_1_)) + { + throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(p_110665_1_)}); + } + else + { + double d1 = flag ? p_110665_1_ : 0.0D; + + if (!flag || p_110665_3_.length() > 1) + { + boolean flag1 = p_110665_3_.contains("."); + + if (flag) + { + p_110665_3_ = p_110665_3_.substring(1); + } + + d1 += parseDouble(sender, p_110665_3_); + + if (!flag1 && !flag) + { + d1 += 0.5D; + } + } + + if (min != 0 || max != 0) + { + if (d1 < (double)min) + { + throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(d1), Integer.valueOf(min)}); + } + + if (d1 > (double)max) + { + throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(d1), Integer.valueOf(max)}); + } + } + + return d1; + } + } + + /** + * Gets the Item specified by the given text string. First checks the item registry, then tries by parsing the + * string as an integer ID (deprecated). Warns the sender if we matched by parsing the ID. Throws if the item + * wasn't found. Returns the item if it was found. + */ + public static Item getItemByText(ICommandSender sender, String id) + { + Item item = (Item)Item.itemRegistry.getObject(id); + + if (item == null) + { + try + { + Item item1 = Item.getItemById(Integer.parseInt(id)); + + if (item1 != null) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.deprecatedId", new Object[] {Item.itemRegistry.getNameForObject(item1)}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY); + sender.addChatMessage(chatcomponenttranslation); + } + + item = item1; + } + catch (NumberFormatException numberformatexception) + { + ; + } + } + + if (item == null) + { + throw new NumberInvalidException("commands.give.notFound", new Object[] {id}); + } + else + { + return item; + } + } + + /** + * Gets the Block specified by the given text string. First checks the block registry, then tries by parsing the + * string as an integer ID (deprecated). Warns the sender if we matched by parsing the ID. Throws if the block + * wasn't found. Returns the block if it was found. + */ + public static Block getBlockByText(ICommandSender sender, String id) + { + if (Block.blockRegistry.containsKey(id)) + { + return (Block)Block.blockRegistry.getObject(id); + } + else + { + try + { + int i = Integer.parseInt(id); + + if (Block.blockRegistry.containsId(i)) + { + Block block = Block.getBlockById(i); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.generic.deprecatedId", new Object[] {Block.blockRegistry.getNameForObject(block)}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY); + sender.addChatMessage(chatcomponenttranslation); + return block; + } + } + catch (NumberFormatException numberformatexception) + { + ; + } + + throw new NumberInvalidException("commands.give.notFound", new Object[] {id}); + } + } + + /** + * Creates a linguistic series joining the input objects together. Examples: 1) {} --> "", 2) {"Steve"} --> + * "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static String joinNiceString(Object[] elements) + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < elements.length; ++i) + { + String s = elements[i].toString(); + + if (i > 0) + { + if (i == elements.length - 1) + { + stringbuilder.append(" and "); + } + else + { + stringbuilder.append(", "); + } + } + + stringbuilder.append(s); + } + + return stringbuilder.toString(); + } + + /** + * Creates a linguistic series joining the input chat components. Examples: 1) {} --> "", 2) {"Steve"} --> + * "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil and Mark" + */ + public static IChatComponent joinNiceString(IChatComponent[] components) + { + ChatComponentText chatcomponenttext = new ChatComponentText(""); + + for (int i = 0; i < components.length; ++i) + { + if (i > 0) + { + if (i == components.length - 1) + { + chatcomponenttext.appendText(" and "); + } + else if (i > 0) + { + chatcomponenttext.appendText(", "); + } + } + + chatcomponenttext.appendSibling(components[i]); + } + + return chatcomponenttext; + } + + /** + * Creates a linguistic series joining together the elements of the given collection. Examples: 1) {} --> "", 2) + * {"Steve"} --> "Steve", 3) {"Steve", "Phil"} --> "Steve and Phil", 4) {"Steve", "Phil", "Mark"} --> "Steve, Phil + * and Mark" + */ + public static String joinNiceStringFromCollection(Collection strings) + { + return joinNiceString(strings.toArray(new String[strings.size()])); + } + + /** + * Returns true if the given substring is exactly equal to the start of the given string (case insensitive). + */ + public static boolean doesStringStartWith(String original, String region) + { + return region.regionMatches(true, 0, original, 0, original.length()); + } + + /** + * Returns a List of strings (chosen from the given strings) which the last word in the given string array is a + * beginning-match for. (Tab completion). + */ + public static List getListOfStringsMatchingLastWord(String[] args, String ... possibilities) + { + String s1 = args[args.length - 1]; + ArrayList arraylist = new ArrayList(); + String[] astring1 = possibilities; + int i = possibilities.length; + + for (int j = 0; j < i; ++j) + { + String s2 = astring1[j]; + + if (doesStringStartWith(s1, s2)) + { + arraylist.add(s2); + } + } + + return arraylist; + } + + /** + * Returns a List of strings (chosen from the given string iterable) which the last word in the given string array + * is a beginning-match for. (Tab completion). + */ + public static List getListOfStringsFromIterableMatchingLastWord(String[] args, Iterable possibilities) + { + String s = args[args.length - 1]; + ArrayList arraylist = new ArrayList(); + Iterator iterator = possibilities.iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + + if (doesStringStartWith(s, s1)) + { + arraylist.add(s1); + } + } + + return arraylist; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return false; + } + + public static void func_152373_a(ICommandSender sender, ICommand command, String msgFormat, Object ... msgParams) + { + func_152374_a(sender, command, 0, msgFormat, msgParams); + } + + public static void func_152374_a(ICommandSender sender, ICommand command, int p_152374_2_, String msgFormat, Object ... msgParams) + { + if (theAdmin != null) + { + theAdmin.func_152372_a(sender, command, p_152374_2_, msgFormat, msgParams); + } + } + + /** + * Sets the static IAdminCommander. + */ + public static void setAdminCommander(IAdminCommand command) + { + theAdmin = command; + } + + public int compareTo(ICommand p_compareTo_1_) + { + return this.getCommandName().compareTo(p_compareTo_1_.getCommandName()); + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((ICommand)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandClearInventory.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandClearInventory.java new file mode 100644 index 0000000..33c3dc5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandClearInventory.java @@ -0,0 +1,81 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.server.MinecraftServer; + +public class CommandClearInventory extends CommandBase +{ + private static final String __OBFID = "CL_00000218"; + + public String getCommandName() + { + return "clear"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.clear.usage"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public void processCommand(ICommandSender sender, String[] args) + { + EntityPlayerMP entityplayermp = args.length == 0 ? getCommandSenderAsPlayer(sender) : getPlayer(sender, args[0]); + Item item = args.length >= 2 ? getItemByText(sender, args[1]) : null; + int i = args.length >= 3 ? parseIntWithMin(sender, args[2], 0) : -1; + + if (args.length >= 2 && item == null) + { + throw new CommandException("commands.clear.failure", new Object[] {entityplayermp.getCommandSenderName()}); + } + else + { + int j = entityplayermp.inventory.clearInventory(item, i); + entityplayermp.inventoryContainer.detectAndSendChanges(); + + if (!entityplayermp.capabilities.isCreativeMode) + { + entityplayermp.updateHeldItem(); + } + + if (j == 0) + { + throw new CommandException("commands.clear.failure", new Object[] {entityplayermp.getCommandSenderName()}); + } + else + { + func_152373_a(sender, this, "commands.clear.success", new Object[] {entityplayermp.getCommandSenderName(), Integer.valueOf(j)}); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.func_147209_d()) : (args.length == 2 ? getListOfStringsFromIterableMatchingLastWord(args, Item.itemRegistry.getKeys()) : null); + } + + protected String[] func_147209_d() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandDebug.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDebug.java new file mode 100644 index 0000000..2a2436f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDebug.java @@ -0,0 +1,164 @@ +package net.minecraft.command; + +import java.io.File; +import java.io.FileWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CommandDebug extends CommandBase +{ + private static final Logger logger = LogManager.getLogger(); + private long field_147206_b; + private int field_147207_c; + private static final String __OBFID = "CL_00000270"; + + public String getCommandName() + { + return "debug"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.debug.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + if (args[0].equals("start")) + { + func_152373_a(sender, this, "commands.debug.start", new Object[0]); + MinecraftServer.getServer().enableProfiling(); + this.field_147206_b = MinecraftServer.getSystemTimeMillis(); + this.field_147207_c = MinecraftServer.getServer().getTickCounter(); + return; + } + + if (args[0].equals("stop")) + { + if (!MinecraftServer.getServer().theProfiler.profilingEnabled) + { + throw new CommandException("commands.debug.notStarted", new Object[0]); + } + + long i = MinecraftServer.getSystemTimeMillis(); + int j = MinecraftServer.getServer().getTickCounter(); + long k = i - this.field_147206_b; + int l = j - this.field_147207_c; + this.func_147205_a(k, l); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; + func_152373_a(sender, this, "commands.debug.stop", new Object[] {Float.valueOf((float)k / 1000.0F), Integer.valueOf(l)}); + return; + } + } + + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + + private void func_147205_a(long p_147205_1_, int p_147205_3_) + { + File file1 = new File(MinecraftServer.getServer().getFile("debug"), "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt"); + file1.getParentFile().mkdirs(); + + try + { + FileWriter filewriter = new FileWriter(file1); + filewriter.write(this.func_147204_b(p_147205_1_, p_147205_3_)); + filewriter.close(); + } + catch (Throwable throwable) + { + logger.error("Could not save profiler results to " + file1, throwable); + } + } + + private String func_147204_b(long p_147204_1_, int p_147204_3_) + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Profiler Results ----\n"); + stringbuilder.append("// "); + stringbuilder.append(func_147203_d()); + stringbuilder.append("\n\n"); + stringbuilder.append("Time span: ").append(p_147204_1_).append(" ms\n"); + stringbuilder.append("Tick span: ").append(p_147204_3_).append(" ticks\n"); + stringbuilder.append("// This is approximately ").append(String.format("%.2f", new Object[] {Float.valueOf((float)p_147204_3_ / ((float)p_147204_1_ / 1000.0F))})).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); + stringbuilder.append("--- BEGIN PROFILE DUMP ---\n\n"); + this.func_147202_a(0, "root", stringbuilder); + stringbuilder.append("--- END PROFILE DUMP ---\n\n"); + return stringbuilder.toString(); + } + + private void func_147202_a(int p_147202_1_, String p_147202_2_, StringBuilder p_147202_3_) + { + List list = MinecraftServer.getServer().theProfiler.getProfilingData(p_147202_2_); + + if (list != null && list.size() >= 3) + { + for (int j = 1; j < list.size(); ++j) + { + Profiler.Result result = (Profiler.Result)list.get(j); + p_147202_3_.append(String.format("[%02d] ", new Object[] {Integer.valueOf(p_147202_1_)})); + + for (int k = 0; k < p_147202_1_; ++k) + { + p_147202_3_.append(" "); + } + + p_147202_3_.append(result.field_76331_c); + p_147202_3_.append(" - "); + p_147202_3_.append(String.format("%.2f", new Object[] {Double.valueOf(result.field_76332_a)})); + p_147202_3_.append("%/"); + p_147202_3_.append(String.format("%.2f", new Object[] {Double.valueOf(result.field_76330_b)})); + p_147202_3_.append("%\n"); + + if (!result.field_76331_c.equals("unspecified")) + { + try + { + this.func_147202_a(p_147202_1_ + 1, p_147202_2_ + "." + result.field_76331_c, p_147202_3_); + } + catch (Exception exception) + { + p_147202_3_.append("[[ EXCEPTION " + exception + " ]]"); + } + } + } + } + } + + private static String func_147203_d() + { + String[] astring = new String[] {"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; + + try + { + return astring[(int)(System.nanoTime() % (long)astring.length)]; + } + catch (Throwable throwable) + { + return "Witty comment unavailable :("; + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"start", "stop"}): null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandDefaultGameMode.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDefaultGameMode.java new file mode 100644 index 0000000..2fc2619 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDefaultGameMode.java @@ -0,0 +1,52 @@ +package net.minecraft.command; + +import java.util.Iterator; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; + +public class CommandDefaultGameMode extends CommandGameMode +{ + private static final String __OBFID = "CL_00000296"; + + public String getCommandName() + { + return "defaultgamemode"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.defaultgamemode.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0) + { + WorldSettings.GameType gametype = this.getGameModeFromCommand(sender, args[0]); + this.setGameType(gametype); + func_152373_a(sender, this, "commands.defaultgamemode.success", new Object[] {new ChatComponentTranslation("gameMode." + gametype.getName(), new Object[0])}); + } + else + { + throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]); + } + } + + protected void setGameType(WorldSettings.GameType p_71541_1_) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + minecraftserver.setGameType(p_71541_1_); + EntityPlayerMP entityplayermp; + + if (minecraftserver.getForceGamemode()) + { + for (Iterator iterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); iterator.hasNext(); entityplayermp.fallDistance = 0.0F) + { + entityplayermp = (EntityPlayerMP)iterator.next(); + entityplayermp.setGameType(p_71541_1_); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandDifficulty.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDifficulty.java new file mode 100644 index 0000000..eaa6512 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandDifficulty.java @@ -0,0 +1,56 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.EnumDifficulty; + +public class CommandDifficulty extends CommandBase +{ + private static final String __OBFID = "CL_00000422"; + + public String getCommandName() + { + return "difficulty"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.difficulty.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0) + { + EnumDifficulty enumdifficulty = this.func_147201_h(sender, args[0]); + MinecraftServer.getServer().func_147139_a(enumdifficulty); + func_152373_a(sender, this, "commands.difficulty.success", new Object[] {new ChatComponentTranslation(enumdifficulty.getDifficultyResourceKey(), new Object[0])}); + } + else + { + throw new WrongUsageException("commands.difficulty.usage", new Object[0]); + } + } + + protected EnumDifficulty func_147201_h(ICommandSender p_147201_1_, String p_147201_2_) + { + return !p_147201_2_.equalsIgnoreCase("peaceful") && !p_147201_2_.equalsIgnoreCase("p") ? (!p_147201_2_.equalsIgnoreCase("easy") && !p_147201_2_.equalsIgnoreCase("e") ? (!p_147201_2_.equalsIgnoreCase("normal") && !p_147201_2_.equalsIgnoreCase("n") ? (!p_147201_2_.equalsIgnoreCase("hard") && !p_147201_2_.equalsIgnoreCase("h") ? EnumDifficulty.getDifficultyEnum(parseIntBounded(p_147201_1_, p_147201_2_, 0, 3)) : EnumDifficulty.HARD) : EnumDifficulty.NORMAL) : EnumDifficulty.EASY) : EnumDifficulty.PEACEFUL; + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"peaceful", "easy", "normal", "hard"}): null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandEffect.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandEffect.java new file mode 100644 index 0000000..1a2a2ac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandEffect.java @@ -0,0 +1,127 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandEffect extends CommandBase +{ + private static final String __OBFID = "CL_00000323"; + + public String getCommandName() + { + return "effect"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.effect.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.effect.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + + if (args[1].equals("clear")) + { + if (entityplayermp.getActivePotionEffects().isEmpty()) + { + throw new CommandException("commands.effect.failure.notActive.all", new Object[] {entityplayermp.getCommandSenderName()}); + } + + entityplayermp.clearActivePotions(); + func_152373_a(sender, this, "commands.effect.success.removed.all", new Object[] {entityplayermp.getCommandSenderName()}); + } + else + { + int i = parseIntWithMin(sender, args[1], 1); + int j = 600; + int k = 30; + int l = 0; + + if (i < 0 || i >= Potion.potionTypes.length || Potion.potionTypes[i] == null) + { + throw new NumberInvalidException("commands.effect.notFound", new Object[] {Integer.valueOf(i)}); + } + + if (args.length >= 3) + { + k = parseIntBounded(sender, args[2], 0, 1000000); + + if (Potion.potionTypes[i].isInstant()) + { + j = k; + } + else + { + j = k * 20; + } + } + else if (Potion.potionTypes[i].isInstant()) + { + j = 1; + } + + if (args.length >= 4) + { + l = parseIntBounded(sender, args[3], 0, 255); + } + + if (k == 0) + { + if (!entityplayermp.isPotionActive(i)) + { + throw new CommandException("commands.effect.failure.notActive", new Object[] {new ChatComponentTranslation(Potion.potionTypes[i].getName(), new Object[0]), entityplayermp.getCommandSenderName()}); + } + + entityplayermp.removePotionEffect(i); + func_152373_a(sender, this, "commands.effect.success.removed", new Object[] {new ChatComponentTranslation(Potion.potionTypes[i].getName(), new Object[0]), entityplayermp.getCommandSenderName()}); + } + else + { + PotionEffect potioneffect = new PotionEffect(i, j, l); + entityplayermp.addPotionEffect(potioneffect); + func_152373_a(sender, this, "commands.effect.success", new Object[] {new ChatComponentTranslation(potioneffect.getEffectName(), new Object[0]), Integer.valueOf(i), Integer.valueOf(l), entityplayermp.getCommandSenderName(), Integer.valueOf(k)}); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandEnchant.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandEnchant.java new file mode 100644 index 0000000..5c23ea9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandEnchant.java @@ -0,0 +1,118 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; + +public class CommandEnchant extends CommandBase +{ + private static final String __OBFID = "CL_00000377"; + + public String getCommandName() + { + return "enchant"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.enchant.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.enchant.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + int i = parseIntBounded(sender, args[1], 0, Enchantment.enchantmentsList.length - 1); + int j = 1; + ItemStack itemstack = entityplayermp.getCurrentEquippedItem(); + + if (itemstack == null) + { + throw new CommandException("commands.enchant.noItem", new Object[0]); + } + else + { + Enchantment enchantment = Enchantment.enchantmentsList[i]; + + if (enchantment == null) + { + throw new NumberInvalidException("commands.enchant.notFound", new Object[] {Integer.valueOf(i)}); + } + else if (!enchantment.canApply(itemstack)) + { + throw new CommandException("commands.enchant.cantEnchant", new Object[0]); + } + else + { + if (args.length >= 3) + { + j = parseIntBounded(sender, args[2], enchantment.getMinLevel(), enchantment.getMaxLevel()); + } + + if (itemstack.hasTagCompound()) + { + NBTTagList nbttaglist = itemstack.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int k = 0; k < nbttaglist.tagCount(); ++k) + { + short short1 = nbttaglist.getCompoundTagAt(k).getShort("id"); + + if (Enchantment.enchantmentsList[short1] != null) + { + Enchantment enchantment1 = Enchantment.enchantmentsList[short1]; + + if (!enchantment1.canApplyTogether(enchantment) || !enchantment.canApplyTogether(enchantment1)) //Forge BugFix: Let Both enchantments veto being together + { + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment.getTranslatedName(j), enchantment1.getTranslatedName(nbttaglist.getCompoundTagAt(k).getShort("lvl"))}); + } + } + } + } + } + + itemstack.addEnchantment(enchantment, j); + func_152373_a(sender, this, "commands.enchant.success", new Object[0]); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getListOfPlayers()) : null; + } + + protected String[] getListOfPlayers() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandException.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandException.java new file mode 100644 index 0000000..9af0fa4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandException.java @@ -0,0 +1,18 @@ +package net.minecraft.command; + +public class CommandException extends RuntimeException +{ + private Object[] errorObjects; + private static final String __OBFID = "CL_00001187"; + + public CommandException(String p_i1359_1_, Object ... p_i1359_2_) + { + super(p_i1359_1_); + this.errorObjects = p_i1359_2_; + } + + public Object[] getErrorOjbects() + { + return this.errorObjects; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameMode.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameMode.java new file mode 100644 index 0000000..aa9e764 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameMode.java @@ -0,0 +1,87 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.WorldSettings; + +public class CommandGameMode extends CommandBase +{ + private static final String __OBFID = "CL_00000448"; + + public String getCommandName() + { + return "gamemode"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.gamemode.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0) + { + WorldSettings.GameType gametype = this.getGameModeFromCommand(sender, args[0]); + EntityPlayerMP entityplayermp = args.length >= 2 ? getPlayer(sender, args[1]) : getCommandSenderAsPlayer(sender); + entityplayermp.setGameType(gametype); + entityplayermp.fallDistance = 0.0F; + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("gameMode." + gametype.getName(), new Object[0]); + + if (entityplayermp != sender) + { + func_152374_a(sender, this, 1, "commands.gamemode.success.other", new Object[] {entityplayermp.getCommandSenderName(), chatcomponenttranslation}); + } + else + { + func_152374_a(sender, this, 1, "commands.gamemode.success.self", new Object[] {chatcomponenttranslation}); + } + } + else + { + throw new WrongUsageException("commands.gamemode.usage", new Object[0]); + } + } + + /** + * Gets the Game Mode specified in the command. + */ + protected WorldSettings.GameType getGameModeFromCommand(ICommandSender p_71539_1_, String p_71539_2_) + { + return !p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.SURVIVAL.getName()) && !p_71539_2_.equalsIgnoreCase("s") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.CREATIVE.getName()) && !p_71539_2_.equalsIgnoreCase("c") ? (!p_71539_2_.equalsIgnoreCase(WorldSettings.GameType.ADVENTURE.getName()) && !p_71539_2_.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(p_71539_1_, p_71539_2_, 0, WorldSettings.GameType.values().length - 2)) : WorldSettings.GameType.ADVENTURE) : WorldSettings.GameType.CREATIVE) : WorldSettings.GameType.SURVIVAL; + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"survival", "creative", "adventure"}): (args.length == 2 ? getListOfStringsMatchingLastWord(args, this.getListOfPlayerUsernames()) : null); + } + + /** + * Returns String array containing all player usernames in the server. + */ + protected String[] getListOfPlayerUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameRule.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameRule.java new file mode 100644 index 0000000..118c34a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGameRule.java @@ -0,0 +1,91 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.GameRules; + +public class CommandGameRule extends CommandBase +{ + private static final String __OBFID = "CL_00000475"; + + public String getCommandName() + { + return "gamerule"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.gamerule.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + String s1; + + if (args.length == 2) + { + s1 = args[0]; + String s2 = args[1]; + GameRules gamerules2 = this.getGameRules(); + + if (gamerules2.hasRule(s1)) + { + gamerules2.setOrCreateGameRule(s1, s2); + func_152373_a(sender, this, "commands.gamerule.success", new Object[0]); + } + else + { + func_152373_a(sender, this, "commands.gamerule.norule", new Object[] {s1}); + } + } + else if (args.length == 1) + { + s1 = args[0]; + GameRules gamerules1 = this.getGameRules(); + + if (gamerules1.hasRule(s1)) + { + String s = gamerules1.getGameRuleStringValue(s1); + sender.addChatMessage((new ChatComponentText(s1)).appendText(" = ").appendText(s)); + } + else + { + func_152373_a(sender, this, "commands.gamerule.norule", new Object[] {s1}); + } + } + else if (args.length == 0) + { + GameRules gamerules = this.getGameRules(); + sender.addChatMessage(new ChatComponentText(joinNiceString(gamerules.getRules()))); + } + else + { + throw new WrongUsageException("commands.gamerule.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getGameRules().getRules()) : (args.length == 2 ? getListOfStringsMatchingLastWord(args, new String[] {"true", "false"}): null); + } + + /** + * Return the game rule set this command should be able to manipulate. + */ + private GameRules getGameRules() + { + return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandGive.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGive.java new file mode 100644 index 0000000..b43d837 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandGive.java @@ -0,0 +1,111 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; + +public class CommandGive extends CommandBase +{ + private static final String __OBFID = "CL_00000502"; + + public String getCommandName() + { + return "give"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.give.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.give.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + Item item = getItemByText(sender, args[1]); + int i = 1; + int j = 0; + + if (args.length >= 3) + { + i = parseIntBounded(sender, args[2], 1, 64); + } + + if (args.length >= 4) + { + j = parseInt(sender, args[3]); + } + + ItemStack itemstack = new ItemStack(item, i, j); + + if (args.length >= 5) + { + String s = func_147178_a(sender, args, 4).getUnformattedText(); + + try + { + NBTBase nbtbase = JsonToNBT.func_150315_a(s); + + if (!(nbtbase instanceof NBTTagCompound)) + { + func_152373_a(sender, this, "commands.give.tagError", new Object[] {"Not a valid tag"}); + return; + } + + itemstack.setTagCompound((NBTTagCompound)nbtbase); + } + catch (NBTException nbtexception) + { + func_152373_a(sender, this, "commands.give.tagError", new Object[] {nbtexception.getMessage()}); + return; + } + } + + EntityItem entityitem = entityplayermp.dropPlayerItemWithRandomChoice(itemstack, false); + entityitem.delayBeforeCanPickup = 0; + entityitem.func_145797_a(entityplayermp.getCommandSenderName()); + func_152373_a(sender, this, "commands.give.success", new Object[] {itemstack.func_151000_E(), Integer.valueOf(i), entityplayermp.getCommandSenderName()}); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.getPlayers()) : (args.length == 2 ? getListOfStringsFromIterableMatchingLastWord(args, Item.itemRegistry.getKeys()) : null); + } + + protected String[] getPlayers() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandHandler.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandHandler.java new file mode 100644 index 0000000..4e63af4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandHandler.java @@ -0,0 +1,272 @@ +package net.minecraft.command; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.CommandEvent; + +public class CommandHandler implements ICommandManager +{ + private static final Logger logger = LogManager.getLogger(); + /** Map of Strings to the ICommand objects they represent */ + private final Map commandMap = new HashMap(); + /** The set of ICommand objects currently loaded. */ + private final Set commandSet = new HashSet(); + private static final String __OBFID = "CL_00001765"; + + public int executeCommand(ICommandSender p_71556_1_, String p_71556_2_) + { + p_71556_2_ = p_71556_2_.trim(); + + if (p_71556_2_.startsWith("/")) + { + p_71556_2_ = p_71556_2_.substring(1); + } + + String[] astring = p_71556_2_.split(" "); + String s1 = astring[0]; + astring = dropFirstString(astring); + ICommand icommand = (ICommand)this.commandMap.get(s1); + int i = this.getUsernameIndex(icommand, astring); + int j = 0; + ChatComponentTranslation chatcomponenttranslation; + + try + { + if (icommand == null) + { + throw new CommandNotFoundException(); + } + + if (icommand.canCommandSenderUseCommand(p_71556_1_)) + { + CommandEvent event = new CommandEvent(icommand, p_71556_1_, astring); + if (MinecraftForge.EVENT_BUS.post(event)) + { + if (event.exception != null) + { + throw event.exception; + } + return 1; + } + + if (i > -1) + { + EntityPlayerMP[] aentityplayermp = PlayerSelector.matchPlayers(p_71556_1_, astring[i]); + String s2 = astring[i]; + EntityPlayerMP[] aentityplayermp1 = aentityplayermp; + int k = aentityplayermp.length; + + for (int l = 0; l < k; ++l) + { + EntityPlayerMP entityplayermp = aentityplayermp1[l]; + astring[i] = entityplayermp.getCommandSenderName(); + + try + { + icommand.processCommand(p_71556_1_, astring); + ++j; + } + catch (CommandException commandexception1) + { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation(commandexception1.getMessage(), commandexception1.getErrorOjbects()); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation1); + } + } + + astring[i] = s2; + } + else + { + try + { + icommand.processCommand(p_71556_1_, astring); + ++j; + } + catch (CommandException commandexception) + { + chatcomponenttranslation = new ChatComponentTranslation(commandexception.getMessage(), commandexception.getErrorOjbects()); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation); + } + } + } + else + { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.generic.permission", new Object[0]); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation2); + } + } + catch (WrongUsageException wrongusageexception) + { + chatcomponenttranslation = new ChatComponentTranslation("commands.generic.usage", new Object[] {new ChatComponentTranslation(wrongusageexception.getMessage(), wrongusageexception.getErrorOjbects())}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation); + } + catch (CommandException commandexception2) + { + chatcomponenttranslation = new ChatComponentTranslation(commandexception2.getMessage(), commandexception2.getErrorOjbects()); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation); + } + catch (Throwable throwable) + { + chatcomponenttranslation = new ChatComponentTranslation("commands.generic.exception", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + p_71556_1_.addChatMessage(chatcomponenttranslation); + logger.error("Couldn\'t process command: \'" + p_71556_2_ + "\'", throwable); + } + + return j; + } + + /** + * adds the command and any aliases it has to the internal map of available commands + */ + public ICommand registerCommand(ICommand p_71560_1_) + { + List list = p_71560_1_.getCommandAliases(); + this.commandMap.put(p_71560_1_.getCommandName(), p_71560_1_); + this.commandSet.add(p_71560_1_); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + ICommand icommand1 = (ICommand)this.commandMap.get(s); + + if (icommand1 == null || !icommand1.getCommandName().equals(s)) + { + this.commandMap.put(s, p_71560_1_); + } + } + } + + return p_71560_1_; + } + + /** + * creates a new array and sets elements 0..n-2 to be 0..n-1 of the input (n elements) + */ + private static String[] dropFirstString(String[] p_71559_0_) + { + String[] astring1 = new String[p_71559_0_.length - 1]; + + for (int i = 1; i < p_71559_0_.length; ++i) + { + astring1[i - 1] = p_71559_0_[i]; + } + + return astring1; + } + + /** + * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. + */ + public List getPossibleCommands(ICommandSender p_71558_1_, String p_71558_2_) + { + String[] astring = p_71558_2_.split(" ", -1); + String s1 = astring[0]; + + if (astring.length == 1) + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.commandMap.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (CommandBase.doesStringStartWith(s1, (String)entry.getKey()) && ((ICommand)entry.getValue()).canCommandSenderUseCommand(p_71558_1_)) + { + arraylist.add(entry.getKey()); + } + } + + return arraylist; + } + else + { + if (astring.length > 1) + { + ICommand icommand = (ICommand)this.commandMap.get(s1); + + if (icommand != null) + { + return icommand.addTabCompletionOptions(p_71558_1_, dropFirstString(astring)); + } + } + + return null; + } + } + + /** + * returns all commands that the commandSender can use + */ + public List getPossibleCommands(ICommandSender p_71557_1_) + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.commandSet.iterator(); + + while (iterator.hasNext()) + { + ICommand icommand = (ICommand)iterator.next(); + + if (icommand.canCommandSenderUseCommand(p_71557_1_)) + { + arraylist.add(icommand); + } + } + + return arraylist; + } + + /** + * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. + */ + public Map getCommands() + { + return this.commandMap; + } + + /** + * Return a command's first parameter index containing a valid username. + */ + private int getUsernameIndex(ICommand p_82370_1_, String[] p_82370_2_) + { + if (p_82370_1_ == null) + { + return -1; + } + else + { + for (int i = 0; i < p_82370_2_.length; ++i) + { + if (p_82370_1_.isUsernameIndex(p_82370_2_, i) && PlayerSelector.matchesMultiplePlayers(p_82370_2_[i])) + { + return i; + } + } + + return -1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandHelp.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandHelp.java new file mode 100644 index 0000000..34690b3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandHelp.java @@ -0,0 +1,106 @@ +package net.minecraft.command; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; + +public class CommandHelp extends CommandBase +{ + private static final String __OBFID = "CL_00000529"; + + public String getCommandName() + { + return "help"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.help.usage"; + } + + public List getCommandAliases() + { + return Arrays.asList(new String[] {"?"}); + } + + public void processCommand(ICommandSender sender, String[] args) + { + List list = this.getSortedPossibleCommands(sender); + byte b0 = 7; + int i = (list.size() - 1) / b0; + boolean flag = false; + int k; + + try + { + k = args.length == 0 ? 0 : parseIntBounded(sender, args[0], 1, i + 1) - 1; + } + catch (NumberInvalidException numberinvalidexception) + { + Map map = this.getCommands(); + ICommand icommand = (ICommand)map.get(args[0]); + + if (icommand != null) + { + throw new WrongUsageException(icommand.getCommandUsage(sender), new Object[0]); + } + + if (MathHelper.parseIntWithDefault(args[0], -1) != -1) + { + throw numberinvalidexception; + } + + throw new CommandNotFoundException(); + } + + int j = Math.min((k + 1) * b0, list.size()); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.help.header", new Object[] {Integer.valueOf(k + 1), Integer.valueOf(i + 1)}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + sender.addChatMessage(chatcomponenttranslation1); + + for (int l = k * b0; l < j; ++l) + { + ICommand icommand1 = (ICommand)list.get(l); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(icommand1.getCommandUsage(sender), new Object[0]); + chatcomponenttranslation.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + icommand1.getCommandName() + " ")); + sender.addChatMessage(chatcomponenttranslation); + } + + if (k == 0 && sender instanceof EntityPlayer) + { + ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation("commands.help.footer", new Object[0]); + chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.GREEN); + sender.addChatMessage(chatcomponenttranslation2); + } + } + + /** + * Returns a sorted list of all possible commands for the given ICommandSender. + */ + protected List getSortedPossibleCommands(ICommandSender p_71534_1_) + { + List list = MinecraftServer.getServer().getCommandManager().getPossibleCommands(p_71534_1_); + Collections.sort(list); + return list; + } + + protected Map getCommands() + { + return MinecraftServer.getServer().getCommandManager().getCommands(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandKill.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandKill.java new file mode 100644 index 0000000..57a7ed5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandKill.java @@ -0,0 +1,35 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; + +public class CommandKill extends CommandBase +{ + private static final String __OBFID = "CL_00000570"; + + public String getCommandName() + { + return "kill"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.kill.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + EntityPlayerMP entityplayermp = getCommandSenderAsPlayer(sender); + entityplayermp.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); + sender.addChatMessage(new ChatComponentTranslation("commands.kill.success", new Object[0])); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandNotFoundException.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandNotFoundException.java new file mode 100644 index 0000000..c33d69d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandNotFoundException.java @@ -0,0 +1,16 @@ +package net.minecraft.command; + +public class CommandNotFoundException extends CommandException +{ + private static final String __OBFID = "CL_00001191"; + + public CommandNotFoundException() + { + this("commands.generic.notFound", new Object[0]); + } + + public CommandNotFoundException(String p_i1363_1_, Object ... p_i1363_2_) + { + super(p_i1363_1_, p_i1363_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandPlaySound.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandPlaySound.java new file mode 100644 index 0000000..aae18a7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandPlaySound.java @@ -0,0 +1,120 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S29PacketSoundEffect; + +public class CommandPlaySound extends CommandBase +{ + private static final String __OBFID = "CL_00000774"; + + public String getCommandName() + { + return "playsound"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.playsound.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException(this.getCommandUsage(sender), new Object[0]); + } + else + { + byte b0 = 0; + int i = b0 + 1; + String s = args[b0]; + EntityPlayerMP entityplayermp = getPlayer(sender, args[i++]); + double d0 = (double)entityplayermp.getPlayerCoordinates().posX; + double d1 = (double)entityplayermp.getPlayerCoordinates().posY; + double d2 = (double)entityplayermp.getPlayerCoordinates().posZ; + double d3 = 1.0D; + double d4 = 1.0D; + double d5 = 0.0D; + + if (args.length > i) + { + d0 = func_110666_a(sender, d0, args[i++]); + } + + if (args.length > i) + { + d1 = func_110665_a(sender, d1, args[i++], 0, 0); + } + + if (args.length > i) + { + d2 = func_110666_a(sender, d2, args[i++]); + } + + if (args.length > i) + { + d3 = parseDoubleBounded(sender, args[i++], 0.0D, 3.4028234663852886E38D); + } + + if (args.length > i) + { + d4 = parseDoubleBounded(sender, args[i++], 0.0D, 2.0D); + } + + if (args.length > i) + { + d5 = parseDoubleBounded(sender, args[i++], 0.0D, 1.0D); + } + + double d6 = d3 > 1.0D ? d3 * 16.0D : 16.0D; + double d7 = entityplayermp.getDistance(d0, d1, d2); + + if (d7 > d6) + { + if (d5 <= 0.0D) + { + throw new CommandException("commands.playsound.playerTooFar", new Object[] {entityplayermp.getCommandSenderName()}); + } + + double d8 = d0 - entityplayermp.posX; + double d9 = d1 - entityplayermp.posY; + double d10 = d2 - entityplayermp.posZ; + double d11 = Math.sqrt(d8 * d8 + d9 * d9 + d10 * d10); + double d12 = entityplayermp.posX; + double d13 = entityplayermp.posY; + double d14 = entityplayermp.posZ; + + if (d11 > 0.0D) + { + d12 += d8 / d11 * 2.0D; + d13 += d9 / d11 * 2.0D; + d14 += d10 / d11 * 2.0D; + } + + entityplayermp.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(s, d12, d13, d14, (float)d5, (float)d4)); + } + else + { + entityplayermp.playerNetServerHandler.sendPacket(new S29PacketSoundEffect(s, d0, d1, d2, (float)d3, (float)d4)); + } + + func_152373_a(sender, this, "commands.playsound.success", new Object[] {s, entityplayermp.getCommandSenderName()}); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandServerKick.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandServerKick.java new file mode 100644 index 0000000..ebc645f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandServerKick.java @@ -0,0 +1,74 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandServerKick extends CommandBase +{ + private static final String __OBFID = "CL_00000550"; + + public String getCommandName() + { + return "kick"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.kick.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0 && args[0].length() > 1) + { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager().func_152612_a(args[0]); + String s = "Kicked by an operator."; + boolean flag = false; + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + else + { + if (args.length >= 2) + { + s = func_147178_a(sender, args, 1).getUnformattedText(); + flag = true; + } + + entityplayermp.playerNetServerHandler.kickPlayerFromServer(s); + + if (flag) + { + func_152373_a(sender, this, "commands.kick.success.reason", new Object[] {entityplayermp.getCommandSenderName(), s}); + } + else + { + func_152373_a(sender, this, "commands.kick.success", new Object[] {entityplayermp.getCommandSenderName()}); + } + } + } + else + { + throw new WrongUsageException("commands.kick.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetPlayerTimeout.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetPlayerTimeout.java new file mode 100644 index 0000000..8debfcc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetPlayerTimeout.java @@ -0,0 +1,40 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; + +public class CommandSetPlayerTimeout extends CommandBase +{ + private static final String __OBFID = "CL_00000999"; + + public String getCommandName() + { + return "setidletimeout"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setidletimeout.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + int i = parseIntWithMin(sender, args[0], 0); + MinecraftServer.getServer().func_143006_e(i); + func_152373_a(sender, this, "commands.setidletimeout.success", new Object[] {Integer.valueOf(i)}); + } + else + { + throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetSpawnpoint.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetSpawnpoint.java new file mode 100644 index 0000000..35d24d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSetSpawnpoint.java @@ -0,0 +1,76 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChunkCoordinates; + +public class CommandSetSpawnpoint extends CommandBase +{ + private static final String __OBFID = "CL_00001026"; + + public String getCommandName() + { + return "spawnpoint"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.spawnpoint.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + EntityPlayerMP entityplayermp = args.length == 0 ? getCommandSenderAsPlayer(sender) : getPlayer(sender, args[0]); + + if (args.length == 4) + { + if (entityplayermp.worldObj != null) + { + byte b0 = 1; + int i = 30000000; + int i1 = b0 + 1; + int j = parseIntBounded(sender, args[b0], -i, i); + int k = parseIntBounded(sender, args[i1++], 0, 256); + int l = parseIntBounded(sender, args[i1++], -i, i); + entityplayermp.setSpawnChunk(new ChunkCoordinates(j, k, l), true); + func_152373_a(sender, this, "commands.spawnpoint.success", new Object[] {entityplayermp.getCommandSenderName(), Integer.valueOf(j), Integer.valueOf(k), Integer.valueOf(l)}); + } + } + else + { + if (args.length > 1) + { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } + + ChunkCoordinates chunkcoordinates = entityplayermp.getPlayerCoordinates(); + entityplayermp.setSpawnChunk(chunkcoordinates, true); + func_152373_a(sender, this, "commands.spawnpoint.success", new Object[] {entityplayermp.getCommandSenderName(), Integer.valueOf(chunkcoordinates.posX), Integer.valueOf(chunkcoordinates.posY), Integer.valueOf(chunkcoordinates.posZ)}); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length != 1 && args.length != 2 ? null : getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandShowSeed.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandShowSeed.java new file mode 100644 index 0000000..b8fd38c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandShowSeed.java @@ -0,0 +1,43 @@ +package net.minecraft.command; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +public class CommandShowSeed extends CommandBase +{ + private static final String __OBFID = "CL_00001053"; + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(sender); + } + + public String getCommandName() + { + return "seed"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.seed.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + Object object = sender instanceof EntityPlayer ? ((EntityPlayer)sender).worldObj : MinecraftServer.getServer().worldServerForDimension(0); + sender.addChatMessage(new ChatComponentTranslation("commands.seed.success", new Object[] {Long.valueOf(((World)object).getSeed())})); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandSpreadPlayers.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSpreadPlayers.java new file mode 100644 index 0000000..29ac725 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandSpreadPlayers.java @@ -0,0 +1,400 @@ +package net.minecraft.command; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandSpreadPlayers extends CommandBase +{ + private static final String __OBFID = "CL_00001080"; + + public String getCommandName() + { + return "spreadplayers"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.spreadplayers.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 6) + { + throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]); + } + else + { + byte b0 = 0; + int i = b0 + 1; + double d0 = func_110666_a(sender, Double.NaN, args[b0]); + double d1 = func_110666_a(sender, Double.NaN, args[i++]); + double d2 = parseDoubleWithMin(sender, args[i++], 0.0D); + double d3 = parseDoubleWithMin(sender, args[i++], d2 + 1.0D); + boolean flag = parseBoolean(sender, args[i++]); + ArrayList arraylist = Lists.newArrayList(); + + while (true) + { + while (i < args.length) + { + String s = args[i++]; + + if (PlayerSelector.hasArguments(s)) + { + EntityPlayerMP[] aentityplayermp = PlayerSelector.matchPlayers(sender, s); + + if (aentityplayermp == null || aentityplayermp.length == 0) + { + throw new PlayerNotFoundException(); + } + + Collections.addAll(arraylist, aentityplayermp); + } + else + { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager().func_152612_a(s); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + + arraylist.add(entityplayermp); + } + } + + if (arraylist.isEmpty()) + { + throw new PlayerNotFoundException(); + } + + sender.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.spreading." + (flag ? "teams" : "players"), new Object[] {Integer.valueOf(arraylist.size()), Double.valueOf(d3), Double.valueOf(d0), Double.valueOf(d1), Double.valueOf(d2)})); + this.func_110669_a(sender, arraylist, new CommandSpreadPlayers.Position(d0, d1), d2, d3, ((EntityLivingBase)arraylist.get(0)).worldObj, flag); + return; + } + } + } + + private void func_110669_a(ICommandSender p_110669_1_, List p_110669_2_, CommandSpreadPlayers.Position p_110669_3_, double p_110669_4_, double p_110669_6_, World p_110669_8_, boolean p_110669_9_) + { + Random random = new Random(); + double d2 = p_110669_3_.field_111101_a - p_110669_6_; + double d3 = p_110669_3_.field_111100_b - p_110669_6_; + double d4 = p_110669_3_.field_111101_a + p_110669_6_; + double d5 = p_110669_3_.field_111100_b + p_110669_6_; + CommandSpreadPlayers.Position[] aposition = this.func_110670_a(random, p_110669_9_ ? this.func_110667_a(p_110669_2_) : p_110669_2_.size(), d2, d3, d4, d5); + int i = this.func_110668_a(p_110669_3_, p_110669_4_, p_110669_8_, random, d2, d3, d4, d5, aposition, p_110669_9_); + double d6 = this.func_110671_a(p_110669_2_, p_110669_8_, aposition, p_110669_9_); + func_152373_a(p_110669_1_, this, "commands.spreadplayers.success." + (p_110669_9_ ? "teams" : "players"), new Object[] {Integer.valueOf(aposition.length), Double.valueOf(p_110669_3_.field_111101_a), Double.valueOf(p_110669_3_.field_111100_b)}); + + if (aposition.length > 1) + { + p_110669_1_.addChatMessage(new ChatComponentTranslation("commands.spreadplayers.info." + (p_110669_9_ ? "teams" : "players"), new Object[] {String.format("%.2f", new Object[]{Double.valueOf(d6)}), Integer.valueOf(i)})); + } + } + + private int func_110667_a(List p_110667_1_) + { + HashSet hashset = Sets.newHashSet(); + Iterator iterator = p_110667_1_.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)iterator.next(); + + if (entitylivingbase instanceof EntityPlayer) + { + hashset.add(entitylivingbase.getTeam()); + } + else + { + hashset.add((Object)null); + } + } + + return hashset.size(); + } + + private int func_110668_a(CommandSpreadPlayers.Position p_110668_1_, double p_110668_2_, World p_110668_4_, Random p_110668_5_, double p_110668_6_, double p_110668_8_, double p_110668_10_, double p_110668_12_, CommandSpreadPlayers.Position[] p_110668_14_, boolean p_110668_15_) + { + boolean flag1 = true; + double d5 = 3.4028234663852886E38D; + int i; + + for (i = 0; i < 10000 && flag1; ++i) + { + flag1 = false; + d5 = 3.4028234663852886E38D; + int k; + CommandSpreadPlayers.Position position1; + + for (int j = 0; j < p_110668_14_.length; ++j) + { + CommandSpreadPlayers.Position position = p_110668_14_[j]; + k = 0; + position1 = new CommandSpreadPlayers.Position(); + + for (int l = 0; l < p_110668_14_.length; ++l) + { + if (j != l) + { + CommandSpreadPlayers.Position position2 = p_110668_14_[l]; + double d6 = position.func_111099_a(position2); + d5 = Math.min(d6, d5); + + if (d6 < p_110668_2_) + { + ++k; + position1.field_111101_a += position2.field_111101_a - position.field_111101_a; + position1.field_111100_b += position2.field_111100_b - position.field_111100_b; + } + } + } + + if (k > 0) + { + position1.field_111101_a /= (double)k; + position1.field_111100_b /= (double)k; + double d7 = (double)position1.func_111096_b(); + + if (d7 > 0.0D) + { + position1.func_111095_a(); + position.func_111094_b(position1); + } + else + { + position.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + } + + flag1 = true; + } + + if (position.func_111093_a(p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_)) + { + flag1 = true; + } + } + + if (!flag1) + { + CommandSpreadPlayers.Position[] aposition = p_110668_14_; + int i1 = p_110668_14_.length; + + for (k = 0; k < i1; ++k) + { + position1 = aposition[k]; + + if (!position1.func_111098_b(p_110668_4_)) + { + position1.func_111097_a(p_110668_5_, p_110668_6_, p_110668_8_, p_110668_10_, p_110668_12_); + flag1 = true; + } + } + } + } + + if (i >= 10000) + { + throw new CommandException("commands.spreadplayers.failure." + (p_110668_15_ ? "teams" : "players"), new Object[] {Integer.valueOf(p_110668_14_.length), Double.valueOf(p_110668_1_.field_111101_a), Double.valueOf(p_110668_1_.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(d5)})}); + } + else + { + return i; + } + } + + private double func_110671_a(List p_110671_1_, World p_110671_2_, CommandSpreadPlayers.Position[] p_110671_3_, boolean p_110671_4_) + { + double d0 = 0.0D; + int i = 0; + HashMap hashmap = Maps.newHashMap(); + + for (int j = 0; j < p_110671_1_.size(); ++j) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_110671_1_.get(j); + CommandSpreadPlayers.Position position; + + if (p_110671_4_) + { + Team team = entitylivingbase instanceof EntityPlayer ? entitylivingbase.getTeam() : null; + + if (!hashmap.containsKey(team)) + { + hashmap.put(team, p_110671_3_[i++]); + } + + position = (CommandSpreadPlayers.Position)hashmap.get(team); + } + else + { + position = p_110671_3_[i++]; + } + + entitylivingbase.setPositionAndUpdate((double)((float)MathHelper.floor_double(position.field_111101_a) + 0.5F), (double)position.func_111092_a(p_110671_2_), (double)MathHelper.floor_double(position.field_111100_b) + 0.5D); + double d2 = Double.MAX_VALUE; + + for (int k = 0; k < p_110671_3_.length; ++k) + { + if (position != p_110671_3_[k]) + { + double d1 = position.func_111099_a(p_110671_3_[k]); + d2 = Math.min(d1, d2); + } + } + + d0 += d2; + } + + d0 /= (double)p_110671_1_.size(); + return d0; + } + + private CommandSpreadPlayers.Position[] func_110670_a(Random p_110670_1_, int p_110670_2_, double p_110670_3_, double p_110670_5_, double p_110670_7_, double p_110670_9_) + { + CommandSpreadPlayers.Position[] aposition = new CommandSpreadPlayers.Position[p_110670_2_]; + + for (int j = 0; j < aposition.length; ++j) + { + CommandSpreadPlayers.Position position = new CommandSpreadPlayers.Position(); + position.func_111097_a(p_110670_1_, p_110670_3_, p_110670_5_, p_110670_7_, p_110670_9_); + aposition[j] = position; + } + + return aposition; + } + + static class Position + { + double field_111101_a; + double field_111100_b; + private static final String __OBFID = "CL_00001105"; + + Position() {} + + Position(double p_i1358_1_, double p_i1358_3_) + { + this.field_111101_a = p_i1358_1_; + this.field_111100_b = p_i1358_3_; + } + + double func_111099_a(CommandSpreadPlayers.Position p_111099_1_) + { + double d0 = this.field_111101_a - p_111099_1_.field_111101_a; + double d1 = this.field_111100_b - p_111099_1_.field_111100_b; + return Math.sqrt(d0 * d0 + d1 * d1); + } + + void func_111095_a() + { + double d0 = (double)this.func_111096_b(); + this.field_111101_a /= d0; + this.field_111100_b /= d0; + } + + float func_111096_b() + { + return MathHelper.sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); + } + + public void func_111094_b(CommandSpreadPlayers.Position p_111094_1_) + { + this.field_111101_a -= p_111094_1_.field_111101_a; + this.field_111100_b -= p_111094_1_.field_111100_b; + } + + public boolean func_111093_a(double p_111093_1_, double p_111093_3_, double p_111093_5_, double p_111093_7_) + { + boolean flag = false; + + if (this.field_111101_a < p_111093_1_) + { + this.field_111101_a = p_111093_1_; + flag = true; + } + else if (this.field_111101_a > p_111093_5_) + { + this.field_111101_a = p_111093_5_; + flag = true; + } + + if (this.field_111100_b < p_111093_3_) + { + this.field_111100_b = p_111093_3_; + flag = true; + } + else if (this.field_111100_b > p_111093_7_) + { + this.field_111100_b = p_111093_7_; + flag = true; + } + + return flag; + } + + public int func_111092_a(World p_111092_1_) + { + int i = MathHelper.floor_double(this.field_111101_a); + int j = MathHelper.floor_double(this.field_111100_b); + + for (int k = 256; k > 0; --k) + { + if (p_111092_1_.getBlock(i, k, j).getMaterial() != Material.air) + { + return k + 1; + } + } + + return 257; + } + + public boolean func_111098_b(World p_111098_1_) + { + int i = MathHelper.floor_double(this.field_111101_a); + int j = MathHelper.floor_double(this.field_111100_b); + short short1 = 256; + + if (short1 <= 0) + { + return false; + } + else + { + Material material = p_111098_1_.getBlock(i, short1, j).getMaterial(); + return !material.isLiquid() && material != Material.fire; + } + } + + public void func_111097_a(Random p_111097_1_, double p_111097_2_, double p_111097_4_, double p_111097_6_, double p_111097_8_) + { + this.field_111101_a = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_2_, p_111097_6_); + this.field_111100_b = MathHelper.getRandomDoubleInRange(p_111097_1_, p_111097_4_, p_111097_8_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandTime.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandTime.java new file mode 100644 index 0000000..173028b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandTime.java @@ -0,0 +1,97 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandTime extends CommandBase +{ + private static final String __OBFID = "CL_00001183"; + + public String getCommandName() + { + return "time"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.time.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 1) + { + int i; + + if (args[0].equals("set")) + { + if (args[1].equals("day")) + { + i = 1000; + } + else if (args[1].equals("night")) + { + i = 13000; + } + else + { + i = parseIntWithMin(sender, args[1], 0); + } + + this.setTime(sender, i); + func_152373_a(sender, this, "commands.time.set", new Object[] {Integer.valueOf(i)}); + return; + } + + if (args[0].equals("add")) + { + i = parseIntWithMin(sender, args[1], 0); + this.addTime(sender, i); + func_152373_a(sender, this, "commands.time.added", new Object[] {Integer.valueOf(i)}); + return; + } + } + + throw new WrongUsageException("commands.time.usage", new Object[0]); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"set", "add"}): (args.length == 2 && args[0].equals("set") ? getListOfStringsMatchingLastWord(args, new String[] {"day", "night"}): null); + } + + /** + * Set the time in the server object. + */ + protected void setTime(ICommandSender p_71552_1_, int p_71552_2_) + { + for (int j = 0; j < MinecraftServer.getServer().worldServers.length; ++j) + { + MinecraftServer.getServer().worldServers[j].setWorldTime((long)p_71552_2_); + } + } + + /** + * Adds (or removes) time in the server object. + */ + protected void addTime(ICommandSender p_71553_1_, int p_71553_2_) + { + for (int j = 0; j < MinecraftServer.getServer().worldServers.length; ++j) + { + WorldServer worldserver = MinecraftServer.getServer().worldServers[j]; + worldserver.setWorldTime(worldserver.getWorldTime() + (long)p_71553_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandToggleDownfall.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandToggleDownfall.java new file mode 100644 index 0000000..c265ce1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandToggleDownfall.java @@ -0,0 +1,42 @@ +package net.minecraft.command; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.WorldInfo; + +public class CommandToggleDownfall extends CommandBase +{ + private static final String __OBFID = "CL_00001184"; + + public String getCommandName() + { + return "toggledownfall"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.downfall.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + this.toggleDownfall(); + func_152373_a(sender, this, "commands.downfall.success", new Object[0]); + } + + /** + * Toggle rain and enable thundering. + */ + protected void toggleDownfall() + { + WorldInfo worldinfo = MinecraftServer.getServer().worldServers[0].getWorldInfo(); + worldinfo.setRaining(!worldinfo.isRaining()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandWeather.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandWeather.java new file mode 100644 index 0000000..5c0138d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandWeather.java @@ -0,0 +1,87 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Random; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.storage.WorldInfo; + +public class CommandWeather extends CommandBase +{ + private static final String __OBFID = "CL_00001185"; + + public String getCommandName() + { + return "weather"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.weather.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1 && args.length <= 2) + { + int i = (300 + (new Random()).nextInt(600)) * 20; + + if (args.length >= 2) + { + i = parseIntBounded(sender, args[1], 1, 1000000) * 20; + } + + WorldServer worldserver = MinecraftServer.getServer().worldServers[0]; + WorldInfo worldinfo = worldserver.getWorldInfo(); + + if ("clear".equalsIgnoreCase(args[0])) + { + worldinfo.setRainTime(0); + worldinfo.setThunderTime(0); + worldinfo.setRaining(false); + worldinfo.setThundering(false); + func_152373_a(sender, this, "commands.weather.clear", new Object[0]); + } + else if ("rain".equalsIgnoreCase(args[0])) + { + worldinfo.setRainTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(false); + func_152373_a(sender, this, "commands.weather.rain", new Object[0]); + } + else + { + if (!"thunder".equalsIgnoreCase(args[0])) + { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + + worldinfo.setRainTime(i); + worldinfo.setThunderTime(i); + worldinfo.setRaining(true); + worldinfo.setThundering(true); + func_152373_a(sender, this, "commands.weather.thunder", new Object[0]); + } + } + else + { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"clear", "rain", "thunder"}): null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/CommandXP.java b/build/rfg/minecraft-src/java/net/minecraft/command/CommandXP.java new file mode 100644 index 0000000..90227e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/CommandXP.java @@ -0,0 +1,110 @@ +package net.minecraft.command; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandXP extends CommandBase +{ + private static final String __OBFID = "CL_00000398"; + + public String getCommandName() + { + return "xp"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.xp.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length <= 0) + { + throw new WrongUsageException("commands.xp.usage", new Object[0]); + } + else + { + String s = args[0]; + boolean flag = s.endsWith("l") || s.endsWith("L"); + + if (flag && s.length() > 1) + { + s = s.substring(0, s.length() - 1); + } + + int i = parseInt(sender, s); + boolean flag1 = i < 0; + + if (flag1) + { + i *= -1; + } + + EntityPlayerMP entityplayermp; + + if (args.length > 1) + { + entityplayermp = getPlayer(sender, args[1]); + } + else + { + entityplayermp = getCommandSenderAsPlayer(sender); + } + + if (flag) + { + if (flag1) + { + entityplayermp.addExperienceLevel(-i); + func_152373_a(sender, this, "commands.xp.success.negative.levels", new Object[] {Integer.valueOf(i), entityplayermp.getCommandSenderName()}); + } + else + { + entityplayermp.addExperienceLevel(i); + func_152373_a(sender, this, "commands.xp.success.levels", new Object[] {Integer.valueOf(i), entityplayermp.getCommandSenderName()}); + } + } + else + { + if (flag1) + { + throw new WrongUsageException("commands.xp.failure.widthdrawXp", new Object[0]); + } + + entityplayermp.addExperience(i); + func_152373_a(sender, this, "commands.xp.success", new Object[] {Integer.valueOf(i), entityplayermp.getCommandSenderName()}); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 2 ? getListOfStringsMatchingLastWord(args, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() + { + return MinecraftServer.getServer().getAllUsernames(); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/IAdminCommand.java b/build/rfg/minecraft-src/java/net/minecraft/command/IAdminCommand.java new file mode 100644 index 0000000..cdb2dd9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/IAdminCommand.java @@ -0,0 +1,6 @@ +package net.minecraft.command; + +public interface IAdminCommand +{ + void func_152372_a(ICommandSender sender, ICommand command, int p_152372_3_, String msgFormat, Object ... msgParams); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/ICommand.java b/build/rfg/minecraft-src/java/net/minecraft/command/ICommand.java new file mode 100644 index 0000000..5f3ff1d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/ICommand.java @@ -0,0 +1,29 @@ +package net.minecraft.command; + +import java.util.List; + +public interface ICommand extends Comparable +{ + String getCommandName(); + + String getCommandUsage(ICommandSender sender); + + List getCommandAliases(); + + void processCommand(ICommandSender sender, String[] args); + + /** + * Returns true if the given command sender is allowed to use this command. + */ + boolean canCommandSenderUseCommand(ICommandSender sender); + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + List addTabCompletionOptions(ICommandSender sender, String[] args); + + /** + * Return whether the specified command parameter index is a username parameter. + */ + boolean isUsernameIndex(String[] args, int index); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/ICommandManager.java b/build/rfg/minecraft-src/java/net/minecraft/command/ICommandManager.java new file mode 100644 index 0000000..753469c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/ICommandManager.java @@ -0,0 +1,24 @@ +package net.minecraft.command; + +import java.util.List; +import java.util.Map; + +public interface ICommandManager +{ + int executeCommand(ICommandSender p_71556_1_, String p_71556_2_); + + /** + * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. + */ + List getPossibleCommands(ICommandSender p_71558_1_, String p_71558_2_); + + /** + * returns all commands that the commandSender can use + */ + List getPossibleCommands(ICommandSender p_71557_1_); + + /** + * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. + */ + Map getCommands(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/ICommandSender.java b/build/rfg/minecraft-src/java/net/minecraft/command/ICommandSender.java new file mode 100644 index 0000000..8d11cd5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/ICommandSender.java @@ -0,0 +1,35 @@ +package net.minecraft.command; + +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public interface ICommandSender +{ + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + String getCommandSenderName(); + + IChatComponent func_145748_c_(); + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + void addChatMessage(IChatComponent message); + + /** + * Returns true if the command sender is allowed to use the given command. + */ + boolean canCommandSenderUseCommand(int permissionLevel, String command); + + /** + * Return the position for this command sender. + */ + ChunkCoordinates getPlayerCoordinates(); + + World getEntityWorld(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/IEntitySelector.java b/build/rfg/minecraft-src/java/net/minecraft/command/IEntitySelector.java new file mode 100644 index 0000000..2b07993 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/IEntitySelector.java @@ -0,0 +1,81 @@ +package net.minecraft.command; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +public interface IEntitySelector +{ + IEntitySelector selectAnything = new IEntitySelector() + { + private static final String __OBFID = "CL_00001541"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_.isEntityAlive(); + } + }; + IEntitySelector field_152785_b = new IEntitySelector() + { + private static final String __OBFID = "CL_00001542"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_.isEntityAlive() && p_82704_1_.riddenByEntity == null && p_82704_1_.ridingEntity == null; + } + }; + IEntitySelector selectInventories = new IEntitySelector() + { + private static final String __OBFID = "CL_00001867"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_ instanceof IInventory && p_82704_1_.isEntityAlive(); + } + }; + + /** + * Return whether the specified entity is applicable to this filter. + */ + boolean isEntityApplicable(Entity p_82704_1_); + + public static class ArmoredMob implements IEntitySelector + { + private final ItemStack field_96567_c; + private static final String __OBFID = "CL_00001543"; + + public ArmoredMob(ItemStack p_i1584_1_) + { + this.field_96567_c = p_i1584_1_; + } + + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + if (!p_82704_1_.isEntityAlive()) + { + return false; + } + else if (!(p_82704_1_ instanceof EntityLivingBase)) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_82704_1_; + return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : entitylivingbase instanceof EntityPlayer); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/NumberInvalidException.java b/build/rfg/minecraft-src/java/net/minecraft/command/NumberInvalidException.java new file mode 100644 index 0000000..d220be9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/NumberInvalidException.java @@ -0,0 +1,16 @@ +package net.minecraft.command; + +public class NumberInvalidException extends CommandException +{ + private static final String __OBFID = "CL_00001188"; + + public NumberInvalidException() + { + this("commands.generic.num.invalid", new Object[0]); + } + + public NumberInvalidException(String p_i1360_1_, Object ... p_i1360_2_) + { + super(p_i1360_1_, p_i1360_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/PlayerNotFoundException.java b/build/rfg/minecraft-src/java/net/minecraft/command/PlayerNotFoundException.java new file mode 100644 index 0000000..28524dc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/PlayerNotFoundException.java @@ -0,0 +1,16 @@ +package net.minecraft.command; + +public class PlayerNotFoundException extends CommandException +{ + private static final String __OBFID = "CL_00001190"; + + public PlayerNotFoundException() + { + this("commands.generic.player.notFound", new Object[0]); + } + + public PlayerNotFoundException(String p_i1362_1_, Object ... p_i1362_2_) + { + super(p_i1362_1_, p_i1362_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/PlayerSelector.java b/build/rfg/minecraft-src/java/net/minecraft/command/PlayerSelector.java new file mode 100644 index 0000000..6733e61 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/PlayerSelector.java @@ -0,0 +1,336 @@ +package net.minecraft.command; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; + +public class PlayerSelector +{ + /** This matches the at-tokens introduced for command blocks, including their arguments, if any. */ + private static final Pattern tokenPattern = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); + /** This matches things like "-1,,4", and is used for getting x,y,z,range from the token's argument list. */ + private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); + /** This matches things like "rm=4,c=2" and is used for handling named token arguments. */ + private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); + private static final String __OBFID = "CL_00000086"; + + /** + * Returns the one player that matches the given at-token. Returns null if more than one player matches. + */ + public static EntityPlayerMP matchOnePlayer(ICommandSender p_82386_0_, String p_82386_1_) + { + EntityPlayerMP[] aentityplayermp = matchPlayers(p_82386_0_, p_82386_1_); + return aentityplayermp != null && aentityplayermp.length == 1 ? aentityplayermp[0] : null; + } + + public static IChatComponent func_150869_b(ICommandSender p_150869_0_, String p_150869_1_) + { + EntityPlayerMP[] aentityplayermp = matchPlayers(p_150869_0_, p_150869_1_); + + if (aentityplayermp != null && aentityplayermp.length != 0) + { + IChatComponent[] aichatcomponent = new IChatComponent[aentityplayermp.length]; + + for (int i = 0; i < aichatcomponent.length; ++i) + { + aichatcomponent[i] = aentityplayermp[i].func_145748_c_(); + } + + return CommandBase.joinNiceString(aichatcomponent); + } + else + { + return null; + } + } + + /** + * Returns an array of all players matched by the given at-token. + */ + public static EntityPlayerMP[] matchPlayers(ICommandSender p_82380_0_, String p_82380_1_) + { + Matcher matcher = tokenPattern.matcher(p_82380_1_); + + if (matcher.matches()) + { + Map map = getArgumentMap(matcher.group(2)); + String s1 = matcher.group(1); + int i = getDefaultMinimumRange(s1); + int j = getDefaultMaximumRange(s1); + int k = getDefaultMinimumLevel(s1); + int l = getDefaultMaximumLevel(s1); + int i1 = getDefaultCount(s1); + int j1 = WorldSettings.GameType.NOT_SET.getID(); + ChunkCoordinates chunkcoordinates = p_82380_0_.getPlayerCoordinates(); + Map map1 = func_96560_a(map); + String s2 = null; + String s3 = null; + boolean flag = false; + + if (map.containsKey("rm")) + { + i = MathHelper.parseIntWithDefault((String)map.get("rm"), i); + flag = true; + } + + if (map.containsKey("r")) + { + j = MathHelper.parseIntWithDefault((String)map.get("r"), j); + flag = true; + } + + if (map.containsKey("lm")) + { + k = MathHelper.parseIntWithDefault((String)map.get("lm"), k); + } + + if (map.containsKey("l")) + { + l = MathHelper.parseIntWithDefault((String)map.get("l"), l); + } + + if (map.containsKey("x")) + { + chunkcoordinates.posX = MathHelper.parseIntWithDefault((String)map.get("x"), chunkcoordinates.posX); + flag = true; + } + + if (map.containsKey("y")) + { + chunkcoordinates.posY = MathHelper.parseIntWithDefault((String)map.get("y"), chunkcoordinates.posY); + flag = true; + } + + if (map.containsKey("z")) + { + chunkcoordinates.posZ = MathHelper.parseIntWithDefault((String)map.get("z"), chunkcoordinates.posZ); + flag = true; + } + + if (map.containsKey("m")) + { + j1 = MathHelper.parseIntWithDefault((String)map.get("m"), j1); + } + + if (map.containsKey("c")) + { + i1 = MathHelper.parseIntWithDefault((String)map.get("c"), i1); + } + + if (map.containsKey("team")) + { + s3 = (String)map.get("team"); + } + + if (map.containsKey("name")) + { + s2 = (String)map.get("name"); + } + + World world = flag ? p_82380_0_.getEntityWorld() : null; + List list; + + if (!s1.equals("p") && !s1.equals("a")) + { + if (s1.equals("r")) + { + list = MinecraftServer.getServer().getConfigurationManager().findPlayers(chunkcoordinates, i, j, 0, j1, k, l, map1, s2, s3, world); + Collections.shuffle(list); + list = list.subList(0, Math.min(i1, list.size())); + return list.isEmpty() ? new EntityPlayerMP[0] : (EntityPlayerMP[])list.toArray(new EntityPlayerMP[list.size()]); + } + else + { + return null; + } + } + else + { + list = MinecraftServer.getServer().getConfigurationManager().findPlayers(chunkcoordinates, i, j, i1, j1, k, l, map1, s2, s3, world); + return list.isEmpty() ? new EntityPlayerMP[0] : (EntityPlayerMP[])list.toArray(new EntityPlayerMP[list.size()]); + } + } + else + { + return null; + } + } + + public static Map func_96560_a(Map p_96560_0_) + { + HashMap hashmap = new HashMap(); + Iterator iterator = p_96560_0_.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (s.startsWith("score_") && s.length() > "score_".length()) + { + String s1 = s.substring("score_".length()); + hashmap.put(s1, Integer.valueOf(MathHelper.parseIntWithDefault((String)p_96560_0_.get(s), 1))); + } + } + + return hashmap; + } + + /** + * Returns whether the given pattern can match more than one player. + */ + public static boolean matchesMultiplePlayers(String p_82377_0_) + { + Matcher matcher = tokenPattern.matcher(p_82377_0_); + + if (matcher.matches()) + { + Map map = getArgumentMap(matcher.group(2)); + String s1 = matcher.group(1); + int i = getDefaultCount(s1); + + if (map.containsKey("c")) + { + i = MathHelper.parseIntWithDefault((String)map.get("c"), i); + } + + return i != 1; + } + else + { + return false; + } + } + + /** + * Returns whether the given token (parameter 1) has exactly the given arguments (parameter 2). + */ + public static boolean hasTheseArguments(String p_82383_0_, String p_82383_1_) + { + Matcher matcher = tokenPattern.matcher(p_82383_0_); + + if (matcher.matches()) + { + String s2 = matcher.group(1); + return p_82383_1_ == null || p_82383_1_.equals(s2); + } + else + { + return false; + } + } + + /** + * Returns whether the given token has any arguments set. + */ + public static boolean hasArguments(String p_82378_0_) + { + return hasTheseArguments(p_82378_0_, (String)null); + } + + /** + * Gets the default minimum range (argument rm). + */ + private static final int getDefaultMinimumRange(String p_82384_0_) + { + return 0; + } + + /** + * Gets the default maximum range (argument r). + */ + private static final int getDefaultMaximumRange(String p_82379_0_) + { + return 0; + } + + /** + * Gets the default maximum experience level (argument l) + */ + private static final int getDefaultMaximumLevel(String p_82376_0_) + { + return Integer.MAX_VALUE; + } + + /** + * Gets the default minimum experience level (argument lm) + */ + private static final int getDefaultMinimumLevel(String p_82375_0_) + { + return 0; + } + + /** + * Gets the default number of players to return (argument c, 0 for infinite) + */ + private static final int getDefaultCount(String p_82382_0_) + { + return p_82382_0_.equals("a") ? 0 : 1; + } + + /** + * Parses the given argument string, turning it into a HashMap<String, String> of name->value. + */ + private static Map getArgumentMap(String p_82381_0_) + { + HashMap hashmap = new HashMap(); + + if (p_82381_0_ == null) + { + return hashmap; + } + else + { + Matcher matcher = intListPattern.matcher(p_82381_0_); + int i = 0; + int j; + + for (j = -1; matcher.find(); j = matcher.end()) + { + String s1 = null; + + switch (i++) + { + case 0: + s1 = "x"; + break; + case 1: + s1 = "y"; + break; + case 2: + s1 = "z"; + break; + case 3: + s1 = "r"; + } + + if (s1 != null && matcher.group(1).length() > 0) + { + hashmap.put(s1, matcher.group(1)); + } + } + + if (j < p_82381_0_.length()) + { + matcher = keyValueListPattern.matcher(j == -1 ? p_82381_0_ : p_82381_0_.substring(j)); + + while (matcher.find()) + { + hashmap.put(matcher.group(1), matcher.group(2)); + } + } + + return hashmap; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommand.java b/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommand.java new file mode 100644 index 0000000..0d8eb31 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommand.java @@ -0,0 +1,19 @@ +package net.minecraft.command; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.SERVER) +public class ServerCommand +{ + /** The command string. */ + public final String command; + public final ICommandSender sender; + private static final String __OBFID = "CL_00001779"; + + public ServerCommand(String p_i1491_1_, ICommandSender p_i1491_2_) + { + this.command = p_i1491_1_; + this.sender = p_i1491_2_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommandManager.java b/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommandManager.java new file mode 100644 index 0000000..7045e86 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/ServerCommandManager.java @@ -0,0 +1,141 @@ +package net.minecraft.command; + +import java.util.Iterator; +import net.minecraft.command.server.CommandAchievement; +import net.minecraft.command.server.CommandBanIp; +import net.minecraft.command.server.CommandBanPlayer; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.command.server.CommandBroadcast; +import net.minecraft.command.server.CommandDeOp; +import net.minecraft.command.server.CommandEmote; +import net.minecraft.command.server.CommandListBans; +import net.minecraft.command.server.CommandListPlayers; +import net.minecraft.command.server.CommandMessage; +import net.minecraft.command.server.CommandMessageRaw; +import net.minecraft.command.server.CommandNetstat; +import net.minecraft.command.server.CommandOp; +import net.minecraft.command.server.CommandPardonIp; +import net.minecraft.command.server.CommandPardonPlayer; +import net.minecraft.command.server.CommandPublishLocalServer; +import net.minecraft.command.server.CommandSaveAll; +import net.minecraft.command.server.CommandSaveOff; +import net.minecraft.command.server.CommandSaveOn; +import net.minecraft.command.server.CommandScoreboard; +import net.minecraft.command.server.CommandSetBlock; +import net.minecraft.command.server.CommandSetDefaultSpawnpoint; +import net.minecraft.command.server.CommandStop; +import net.minecraft.command.server.CommandSummon; +import net.minecraft.command.server.CommandTeleport; +import net.minecraft.command.server.CommandTestFor; +import net.minecraft.command.server.CommandTestForBlock; +import net.minecraft.command.server.CommandWhitelist; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.rcon.RConConsoleSource; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; + +public class ServerCommandManager extends CommandHandler implements IAdminCommand +{ + private static final String __OBFID = "CL_00000922"; + + public ServerCommandManager() + { + this.registerCommand(new CommandTime()); + this.registerCommand(new CommandGameMode()); + this.registerCommand(new CommandDifficulty()); + this.registerCommand(new CommandDefaultGameMode()); + this.registerCommand(new CommandKill()); + this.registerCommand(new CommandToggleDownfall()); + this.registerCommand(new CommandWeather()); + this.registerCommand(new CommandXP()); + this.registerCommand(new CommandTeleport()); + this.registerCommand(new CommandGive()); + this.registerCommand(new CommandEffect()); + this.registerCommand(new CommandEnchant()); + this.registerCommand(new CommandEmote()); + this.registerCommand(new CommandShowSeed()); + this.registerCommand(new CommandHelp()); + this.registerCommand(new CommandDebug()); + this.registerCommand(new CommandMessage()); + this.registerCommand(new CommandBroadcast()); + this.registerCommand(new CommandSetSpawnpoint()); + this.registerCommand(new CommandSetDefaultSpawnpoint()); + this.registerCommand(new CommandGameRule()); + this.registerCommand(new CommandClearInventory()); + this.registerCommand(new CommandTestFor()); + this.registerCommand(new CommandSpreadPlayers()); + this.registerCommand(new CommandPlaySound()); + this.registerCommand(new CommandScoreboard()); + this.registerCommand(new CommandAchievement()); + this.registerCommand(new CommandSummon()); + this.registerCommand(new CommandSetBlock()); + this.registerCommand(new CommandTestForBlock()); + this.registerCommand(new CommandMessageRaw()); + + if (MinecraftServer.getServer().isDedicatedServer()) + { + this.registerCommand(new CommandOp()); + this.registerCommand(new CommandDeOp()); + this.registerCommand(new CommandStop()); + this.registerCommand(new CommandSaveAll()); + this.registerCommand(new CommandSaveOff()); + this.registerCommand(new CommandSaveOn()); + this.registerCommand(new CommandBanIp()); + this.registerCommand(new CommandPardonIp()); + this.registerCommand(new CommandBanPlayer()); + this.registerCommand(new CommandListBans()); + this.registerCommand(new CommandPardonPlayer()); + this.registerCommand(new CommandServerKick()); + this.registerCommand(new CommandListPlayers()); + this.registerCommand(new CommandWhitelist()); + this.registerCommand(new CommandSetPlayerTimeout()); + this.registerCommand(new CommandNetstat()); + } + else + { + this.registerCommand(new CommandPublishLocalServer()); + } + + CommandBase.setAdminCommander(this); + } + + public void func_152372_a(ICommandSender sender, ICommand command, int p_152372_3_, String msgFormat, Object ... msgParams) + { + boolean flag = true; + + if (sender instanceof CommandBlockLogic && !MinecraftServer.getServer().worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput")) + { + flag = false; + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.type.admin", new Object[] {sender.getCommandSenderName(), new ChatComponentTranslation(msgFormat, msgParams)}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY); + chatcomponenttranslation.getChatStyle().setItalic(Boolean.valueOf(true)); + + if (flag) + { + Iterator iterator = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (entityplayer != sender && MinecraftServer.getServer().getConfigurationManager().func_152596_g(entityplayer.getGameProfile()) && command.canCommandSenderUseCommand(entityplayer) && (!(sender instanceof RConConsoleSource) || MinecraftServer.getServer().func_152363_m())) + { + entityplayer.addChatMessage(chatcomponenttranslation); + } + } + } + + if (sender != MinecraftServer.getServer()) + { + MinecraftServer.getServer().addChatMessage(chatcomponenttranslation); + } + + if ((p_152372_3_ & 1) != 1) + { + sender.addChatMessage(new ChatComponentTranslation(msgFormat, msgParams)); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/SyntaxErrorException.java b/build/rfg/minecraft-src/java/net/minecraft/command/SyntaxErrorException.java new file mode 100644 index 0000000..8070322 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/SyntaxErrorException.java @@ -0,0 +1,16 @@ +package net.minecraft.command; + +public class SyntaxErrorException extends CommandException +{ + private static final String __OBFID = "CL_00001189"; + + public SyntaxErrorException() + { + this("commands.generic.snytax", new Object[0]); + } + + public SyntaxErrorException(String p_i1361_1_, Object ... p_i1361_2_) + { + super(p_i1361_1_, p_i1361_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/WrongUsageException.java b/build/rfg/minecraft-src/java/net/minecraft/command/WrongUsageException.java new file mode 100644 index 0000000..7763c48 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/WrongUsageException.java @@ -0,0 +1,11 @@ +package net.minecraft.command; + +public class WrongUsageException extends SyntaxErrorException +{ + private static final String __OBFID = "CL_00001192"; + + public WrongUsageException(String p_i1364_1_, Object ... p_i1364_2_) + { + super(p_i1364_1_, p_i1364_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandAchievement.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandAchievement.java new file mode 100644 index 0000000..dc70e83 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandAchievement.java @@ -0,0 +1,143 @@ +package net.minecraft.command.server; + +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; + +public class CommandAchievement extends CommandBase +{ + private static final String __OBFID = "CL_00000113"; + + public String getCommandName() + { + return "achievement"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.achievement.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 2) + { + StatBase statbase = StatList.func_151177_a(args[1]); + + if (statbase == null && !args[1].equals("*")) + { + throw new CommandException("commands.achievement.unknownAchievement", new Object[] {args[1]}); + } + + EntityPlayerMP entityplayermp; + + if (args.length >= 3) + { + entityplayermp = getPlayer(sender, args[2]); + } + else + { + entityplayermp = getCommandSenderAsPlayer(sender); + } + + if (args[0].equalsIgnoreCase("give")) + { + if (statbase == null) + { + Iterator iterator = AchievementList.achievementList.iterator(); + + while (iterator.hasNext()) + { + Achievement achievement = (Achievement)iterator.next(); + entityplayermp.triggerAchievement(achievement); + } + + func_152373_a(sender, this, "commands.achievement.give.success.all", new Object[] {entityplayermp.getCommandSenderName()}); + } + else + { + if (statbase instanceof Achievement) + { + Achievement achievement2 = (Achievement)statbase; + ArrayList arraylist; + + for (arraylist = Lists.newArrayList(); achievement2.parentAchievement != null && !entityplayermp.func_147099_x().hasAchievementUnlocked(achievement2.parentAchievement); achievement2 = achievement2.parentAchievement) + { + arraylist.add(achievement2.parentAchievement); + } + + Iterator iterator1 = Lists.reverse(arraylist).iterator(); + + while (iterator1.hasNext()) + { + Achievement achievement1 = (Achievement)iterator1.next(); + entityplayermp.triggerAchievement(achievement1); + } + } + + entityplayermp.triggerAchievement(statbase); + func_152373_a(sender, this, "commands.achievement.give.success.one", new Object[] {entityplayermp.getCommandSenderName(), statbase.func_150955_j()}); + } + + return; + } + } + + throw new WrongUsageException("commands.achievement.usage", new Object[0]); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"give"}); + } + else if (args.length != 2) + { + return args.length == 3 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + else + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = StatList.allStats.iterator(); + + while (iterator.hasNext()) + { + StatBase statbase = (StatBase)iterator.next(); + arraylist.add(statbase.statId); + } + + return getListOfStringsFromIterableMatchingLastWord(args, arraylist); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanIp.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanIp.java new file mode 100644 index 0000000..db29014 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanIp.java @@ -0,0 +1,114 @@ +package net.minecraft.command.server; + +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.IPBanEntry; +import net.minecraft.util.IChatComponent; + +public class CommandBanIp extends CommandBase +{ + public static final Pattern field_147211_a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); + private static final String __OBFID = "CL_00000139"; + + public String getCommandName() + { + return "ban-ip"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.banip.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1 && args[0].length() > 1) + { + Matcher matcher = field_147211_a.matcher(args[0]); + IChatComponent ichatcomponent = null; + + if (args.length >= 2) + { + ichatcomponent = func_147178_a(sender, args, 1); + } + + if (matcher.matches()) + { + this.func_147210_a(sender, args[0], ichatcomponent == null ? null : ichatcomponent.getUnformattedText()); + } + else + { + EntityPlayerMP entityplayermp = MinecraftServer.getServer().getConfigurationManager().func_152612_a(args[0]); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); + } + + this.func_147210_a(sender, entityplayermp.getPlayerIP(), ichatcomponent == null ? null : ichatcomponent.getUnformattedText()); + } + } + else + { + throw new WrongUsageException("commands.banip.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + + protected void func_147210_a(ICommandSender p_147210_1_, String p_147210_2_, String p_147210_3_) + { + IPBanEntry ipbanentry = new IPBanEntry(p_147210_2_, (Date)null, p_147210_1_.getCommandSenderName(), (Date)null, p_147210_3_); + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152687_a(ipbanentry); + List list = MinecraftServer.getServer().getConfigurationManager().getPlayerList(p_147210_2_); + String[] astring = new String[list.size()]; + int i = 0; + EntityPlayerMP entityplayermp; + + for (Iterator iterator = list.iterator(); iterator.hasNext(); astring[i++] = entityplayermp.getCommandSenderName()) + { + entityplayermp = (EntityPlayerMP)iterator.next(); + entityplayermp.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); + } + + if (list.isEmpty()) + { + func_152373_a(p_147210_1_, this, "commands.banip.success", new Object[] {p_147210_2_}); + } + else + { + func_152373_a(p_147210_1_, this, "commands.banip.success.players", new Object[] {p_147210_2_, joinNiceString(astring)}); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanPlayer.java new file mode 100644 index 0000000..b1bc14e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBanPlayer.java @@ -0,0 +1,89 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; + +public class CommandBanPlayer extends CommandBase +{ + private static final String __OBFID = "CL_00000165"; + + public String getCommandName() + { + return "ban"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.ban.usage"; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b() && super.canCommandSenderUseCommand(sender); + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.func_152358_ax().func_152655_a(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.ban.failed", new Object[] {args[0]}); + } + else + { + String s = null; + + if (args.length >= 2) + { + s = func_147178_a(sender, args, 1).getUnformattedText(); + } + + UserListBansEntry userlistbansentry = new UserListBansEntry(gameprofile, (Date)null, sender.getCommandSenderName(), (Date)null, s); + minecraftserver.getConfigurationManager().func_152608_h().func_152687_a(userlistbansentry); + EntityPlayerMP entityplayermp = minecraftserver.getConfigurationManager().func_152612_a(args[0]); + + if (entityplayermp != null) + { + entityplayermp.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); + } + + func_152373_a(sender, this, "commands.ban.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.ban.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBlockLogic.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBlockLogic.java new file mode 100644 index 0000000..2595f76 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBlockLogic.java @@ -0,0 +1,154 @@ +package net.minecraft.command.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import java.text.SimpleDateFormat; +import java.util.Date; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public abstract class CommandBlockLogic implements ICommandSender +{ + private static final SimpleDateFormat field_145766_a = new SimpleDateFormat("HH:mm:ss"); + private int field_145764_b; + private boolean field_145765_c = true; + private IChatComponent field_145762_d = null; + private String field_145763_e = ""; + private String field_145761_f = "@"; + private static final String __OBFID = "CL_00000128"; + + public int func_145760_g() + { + return this.field_145764_b; + } + + public IChatComponent func_145749_h() + { + return this.field_145762_d; + } + + public void func_145758_a(NBTTagCompound p_145758_1_) + { + p_145758_1_.setString("Command", this.field_145763_e); + p_145758_1_.setInteger("SuccessCount", this.field_145764_b); + p_145758_1_.setString("CustomName", this.field_145761_f); + + if (this.field_145762_d != null) + { + p_145758_1_.setString("LastOutput", IChatComponent.Serializer.func_150696_a(this.field_145762_d)); + } + + p_145758_1_.setBoolean("TrackOutput", this.field_145765_c); + } + + public void func_145759_b(NBTTagCompound p_145759_1_) + { + this.field_145763_e = p_145759_1_.getString("Command"); + this.field_145764_b = p_145759_1_.getInteger("SuccessCount"); + + if (p_145759_1_.hasKey("CustomName", 8)) + { + this.field_145761_f = p_145759_1_.getString("CustomName"); + } + + if (p_145759_1_.hasKey("LastOutput", 8)) + { + this.field_145762_d = IChatComponent.Serializer.func_150699_a(p_145759_1_.getString("LastOutput")); + } + + if (p_145759_1_.hasKey("TrackOutput", 1)) + { + this.field_145765_c = p_145759_1_.getBoolean("TrackOutput"); + } + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + return permissionLevel <= 2; + } + + public void func_145752_a(String p_145752_1_) + { + this.field_145763_e = p_145752_1_; + } + + public String func_145753_i() + { + return this.field_145763_e; + } + + public void func_145755_a(World p_145755_1_) + { + if (p_145755_1_.isRemote) + { + this.field_145764_b = 0; + } + + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (minecraftserver != null && minecraftserver.isCommandBlockEnabled()) + { + ICommandManager icommandmanager = minecraftserver.getCommandManager(); + this.field_145764_b = icommandmanager.executeCommand(this, this.field_145763_e); + } + else + { + this.field_145764_b = 0; + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return this.field_145761_f; + } + + public IChatComponent func_145748_c_() + { + return new ChatComponentText(this.getCommandSenderName()); + } + + public void func_145754_b(String p_145754_1_) + { + this.field_145761_f = p_145754_1_; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + if (this.field_145765_c && this.getEntityWorld() != null && !this.getEntityWorld().isRemote) + { + this.field_145762_d = (new ChatComponentText("[" + field_145766_a.format(new Date()) + "] ")).appendSibling(message); + this.func_145756_e(); + } + } + + public abstract void func_145756_e(); + + @SideOnly(Side.CLIENT) + public abstract int func_145751_f(); + + @SideOnly(Side.CLIENT) + public abstract void func_145757_a(ByteBuf p_145757_1_); + + public void func_145750_b(IChatComponent p_145750_1_) + { + this.field_145762_d = p_145750_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBroadcast.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBroadcast.java new file mode 100644 index 0000000..fa50d16 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandBroadcast.java @@ -0,0 +1,53 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandBroadcast extends CommandBase +{ + private static final String __OBFID = "CL_00000191"; + + public String getCommandName() + { + return "say"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 1; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.say.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0 && args[0].length() > 0) + { + IChatComponent ichatcomponent = func_147176_a(sender, args, 0, true); + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.announcement", new Object[] {sender.getCommandSenderName(), ichatcomponent})); + } + else + { + throw new WrongUsageException("commands.say.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length >= 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandDeOp.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandDeOp.java new file mode 100644 index 0000000..52c8fb9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandDeOp.java @@ -0,0 +1,63 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandDeOp extends CommandBase +{ + private static final String __OBFID = "CL_00000244"; + + public String getCommandName() + { + return "deop"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.deop.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getConfigurationManager().func_152603_m().func_152700_a(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.deop.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().func_152610_b(gameprofile); + func_152373_a(sender, this, "commands.deop.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.deop.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().func_152606_n()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandEmote.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandEmote.java new file mode 100644 index 0000000..91dde47 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandEmote.java @@ -0,0 +1,53 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IChatComponent; + +public class CommandEmote extends CommandBase +{ + private static final String __OBFID = "CL_00000351"; + + public String getCommandName() + { + return "me"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.me.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length > 0) + { + IChatComponent ichatcomponent = func_147176_a(sender, args, 0, sender.canCommandSenderUseCommand(1, "me")); + MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.emote", new Object[] {sender.func_145748_c_(), ichatcomponent})); + } + else + { + throw new WrongUsageException("commands.me.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListBans.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListBans.java new file mode 100644 index 0000000..fa37b62 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListBans.java @@ -0,0 +1,61 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListBans extends CommandBase +{ + private static final String __OBFID = "CL_00000596"; + + public String getCommandName() + { + return "banlist"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() || MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b()) && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.banlist.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1 && args[0].equalsIgnoreCase("ips")) + { + sender.addChatMessage(new ChatComponentTranslation("commands.banlist.ips", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a().length)})); + sender.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a()))); + } + else + { + sender.addChatMessage(new ChatComponentTranslation("commands.banlist.players", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a().length)})); + sender.addChatMessage(new ChatComponentText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a()))); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"players", "ips"}): null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListPlayers.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListPlayers.java new file mode 100644 index 0000000..3980b0e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandListPlayers.java @@ -0,0 +1,36 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandListPlayers extends CommandBase +{ + private static final String __OBFID = "CL_00000615"; + + public String getCommandName() + { + return "list"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.players.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + sender.addChatMessage(new ChatComponentTranslation("commands.players.list", new Object[] {Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); + sender.addChatMessage(new ChatComponentText(MinecraftServer.getServer().getConfigurationManager().func_152609_b(args.length > 0 && "uuids".equalsIgnoreCase(args[0])))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessage.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessage.java new file mode 100644 index 0000000..a0b733f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessage.java @@ -0,0 +1,89 @@ +package net.minecraft.command.server; + +import java.util.Arrays; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class CommandMessage extends CommandBase +{ + private static final String __OBFID = "CL_00000641"; + + public List getCommandAliases() + { + return Arrays.asList(new String[] {"w", "msg"}); + } + + public String getCommandName() + { + return "tell"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.message.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.message.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + else if (entityplayermp == sender) + { + throw new PlayerNotFoundException("commands.message.sameTarget", new Object[0]); + } + else + { + IChatComponent ichatcomponent = func_147176_a(sender, args, 1, !(sender instanceof EntityPlayer)); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.message.display.incoming", new Object[] {sender.func_145748_c_(), ichatcomponent.createCopy()}); + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.message.display.outgoing", new Object[] {entityplayermp.func_145748_c_(), ichatcomponent.createCopy()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true)); + entityplayermp.addChatMessage(chatcomponenttranslation); + sender.addChatMessage(chatcomponenttranslation1); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessageRaw.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessageRaw.java new file mode 100644 index 0000000..5d4e951 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandMessageRaw.java @@ -0,0 +1,75 @@ +package net.minecraft.command.server; + +import com.google.gson.JsonParseException; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.exception.ExceptionUtils; + +public class CommandMessageRaw extends CommandBase +{ + private static final String __OBFID = "CL_00000667"; + + public String getCommandName() + { + return "tellraw"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.tellraw.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.tellraw.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp = getPlayer(sender, args[0]); + String s = func_82360_a(sender, args, 1); + + try + { + IChatComponent ichatcomponent = IChatComponent.Serializer.func_150699_a(s); + entityplayermp.addChatMessage(ichatcomponent); + } + catch (JsonParseException jsonparseexception) + { + Throwable throwable = ExceptionUtils.getRootCause(jsonparseexception); + throw new SyntaxErrorException("commands.tellraw.jsonException", new Object[] {throwable == null ? "" : throwable.getMessage()}); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()) : null; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandNetstat.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandNetstat.java new file mode 100644 index 0000000..0ef363d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandNetstat.java @@ -0,0 +1,137 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.util.ChatComponentText; + +public class CommandNetstat extends CommandBase +{ + private static final String __OBFID = "CL_00001904"; + + public String getCommandName() + { + return "netstat"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 0; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.players.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (sender instanceof EntityPlayer) + { + sender.addChatMessage(new ChatComponentText("Command is not available for players")); + } + else + { + if (args.length > 0 && args[0].length() > 1) + { + if ("hottest-read".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152477_e().toString())); + } + else if ("hottest-write".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152475_g().toString())); + } + else if ("most-read".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152467_f().toString())); + } + else if ("most-write".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText(NetworkManager.field_152462_h.func_152470_h().toString())); + } + else + { + NetworkStatistics.PacketStat packetstat; + int i; + + if ("packet-read".equals(args[0])) + { + if (args.length > 1 && args[1].length() > 0) + { + try + { + i = Integer.parseInt(args[1].trim()); + packetstat = NetworkManager.field_152462_h.func_152466_a(i); + this.func_152375_a(sender, i, packetstat); + } + catch (Exception exception1) + { + sender.addChatMessage(new ChatComponentText("Packet " + args[1] + " not found!")); + } + } + else + { + sender.addChatMessage(new ChatComponentText("Packet id is missing")); + } + } + else if ("packet-write".equals(args[0])) + { + if (args.length > 1 && args[1].length() > 0) + { + try + { + i = Integer.parseInt(args[1].trim()); + packetstat = NetworkManager.field_152462_h.func_152468_b(i); + this.func_152375_a(sender, i, packetstat); + } + catch (Exception exception) + { + sender.addChatMessage(new ChatComponentText("Packet " + args[1] + " not found!")); + } + } + else + { + sender.addChatMessage(new ChatComponentText("Packet id is missing")); + } + } + else if ("read-count".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText("total-read-count" + String.valueOf(NetworkManager.field_152462_h.func_152472_c()))); + } + else if ("write-count".equals(args[0])) + { + sender.addChatMessage(new ChatComponentText("total-write-count" + String.valueOf(NetworkManager.field_152462_h.func_152473_d()))); + } + else + { + sender.addChatMessage(new ChatComponentText("Unrecognized: " + args[0])); + } + } + } + else + { + String s = "reads: " + NetworkManager.field_152462_h.func_152465_a(); + s = s + ", writes: " + NetworkManager.field_152462_h.func_152471_b(); + sender.addChatMessage(new ChatComponentText(s)); + } + } + } + + private void func_152375_a(ICommandSender p_152375_1_, int p_152375_2_, NetworkStatistics.PacketStat p_152375_3_) + { + if (p_152375_3_ != null) + { + p_152375_1_.addChatMessage(new ChatComponentText(p_152375_3_.toString())); + } + else + { + p_152375_1_.addChatMessage(new ChatComponentText("Packet " + p_152375_2_ + " not found!")); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandOp.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandOp.java new file mode 100644 index 0000000..ac8d7ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandOp.java @@ -0,0 +1,86 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandOp extends CommandBase +{ + private static final String __OBFID = "CL_00000694"; + + public String getCommandName() + { + return "op"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.op.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.func_152358_ax().func_152655_a(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.op.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().func_152605_a(gameprofile); + func_152373_a(sender, this, "commands.op.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.op.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + String s = args[args.length - 1]; + ArrayList arraylist = new ArrayList(); + GameProfile[] agameprofile = MinecraftServer.getServer().func_152357_F(); + int i = agameprofile.length; + + for (int j = 0; j < i; ++j) + { + GameProfile gameprofile = agameprofile[j]; + + if (!MinecraftServer.getServer().getConfigurationManager().func_152596_g(gameprofile) && doesStringStartWith(s, gameprofile.getName())) + { + arraylist.add(gameprofile.getName()); + } + } + + return arraylist; + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonIp.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonIp.java new file mode 100644 index 0000000..4b93d72 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonIp.java @@ -0,0 +1,70 @@ +package net.minecraft.command.server; + +import java.util.List; +import java.util.regex.Matcher; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandPardonIp extends CommandBase +{ + private static final String __OBFID = "CL_00000720"; + + public String getCommandName() + { + return "pardon-ip"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152689_b() && super.canCommandSenderUseCommand(sender); + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.unbanip.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1 && args[0].length() > 1) + { + Matcher matcher = CommandBanIp.field_147211_a.matcher(args[0]); + + if (matcher.matches()) + { + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152684_c(args[0]); + func_152373_a(sender, this, "commands.unbanip.success", new Object[] {args[0]}); + } + else + { + throw new SyntaxErrorException("commands.unbanip.invalid", new Object[0]); + } + } + else + { + throw new WrongUsageException("commands.unbanip.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().func_152685_a()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonPlayer.java new file mode 100644 index 0000000..1d43e5e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPardonPlayer.java @@ -0,0 +1,71 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; + +public class CommandPardonPlayer extends CommandBase +{ + private static final String __OBFID = "CL_00000747"; + + public String getCommandName() + { + return "pardon"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.unban.usage"; + } + + /** + * Returns true if the given command sender is allowed to use this command. + */ + public boolean canCommandSenderUseCommand(ICommandSender sender) + { + return MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152689_b() && super.canCommandSenderUseCommand(sender); + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 1 && args[0].length() > 0) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.getConfigurationManager().func_152608_h().func_152703_a(args[0]); + + if (gameprofile == null) + { + throw new CommandException("commands.unban.failed", new Object[] {args[0]}); + } + else + { + minecraftserver.getConfigurationManager().func_152608_h().func_152684_c(gameprofile); + func_152373_a(sender, this, "commands.unban.success", new Object[] {args[0]}); + } + } + else + { + throw new WrongUsageException("commands.unban.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().func_152608_h().func_152685_a()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPublishLocalServer.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPublishLocalServer.java new file mode 100644 index 0000000..3bb2e73 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandPublishLocalServer.java @@ -0,0 +1,35 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldSettings; + +public class CommandPublishLocalServer extends CommandBase +{ + private static final String __OBFID = "CL_00000799"; + + public String getCommandName() + { + return "publish"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.publish.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + String s = MinecraftServer.getServer().shareToLAN(WorldSettings.GameType.SURVIVAL, false); + + if (s != null) + { + func_152373_a(sender, this, "commands.publish.started", new Object[] {s}); + } + else + { + func_152373_a(sender, this, "commands.publish.failed", new Object[0]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveAll.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveAll.java new file mode 100644 index 0000000..58d4eb2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveAll.java @@ -0,0 +1,80 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldServer; + +public class CommandSaveAll extends CommandBase +{ + private static final String __OBFID = "CL_00000826"; + + public String getCommandName() + { + return "save-all"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + sender.addChatMessage(new ChatComponentTranslation("commands.save.start", new Object[0])); + + if (minecraftserver.getConfigurationManager() != null) + { + minecraftserver.getConfigurationManager().saveAllPlayerData(); + } + + try + { + int i; + WorldServer worldserver; + boolean flag; + + for (i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + worldserver = minecraftserver.worldServers[i]; + flag = worldserver.levelSaving; + worldserver.levelSaving = false; + worldserver.saveAllChunks(true, (IProgressUpdate)null); + worldserver.levelSaving = flag; + } + } + + if (args.length > 0 && "flush".equals(args[0])) + { + sender.addChatMessage(new ChatComponentTranslation("commands.save.flushStart", new Object[0])); + + for (i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + worldserver = minecraftserver.worldServers[i]; + flag = worldserver.levelSaving; + worldserver.levelSaving = false; + worldserver.saveChunkData(); + worldserver.levelSaving = flag; + } + } + + sender.addChatMessage(new ChatComponentTranslation("commands.save.flushEnd", new Object[0])); + } + } + catch (MinecraftException minecraftexception) + { + func_152373_a(sender, this, "commands.save.failed", new Object[] {minecraftexception.getMessage()}); + return; + } + + func_152373_a(sender, this, "commands.save.success", new Object[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOff.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOff.java new file mode 100644 index 0000000..5da00a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOff.java @@ -0,0 +1,51 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOff extends CommandBase +{ + private static final String __OBFID = "CL_00000847"; + + public String getCommandName() + { + return "save-off"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save-off.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + boolean flag = false; + + for (int i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + WorldServer worldserver = minecraftserver.worldServers[i]; + + if (!worldserver.levelSaving) + { + worldserver.levelSaving = true; + flag = true; + } + } + } + + if (flag) + { + func_152373_a(sender, this, "commands.save.disabled", new Object[0]); + } + else + { + throw new CommandException("commands.save-off.alreadyOff", new Object[0]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOn.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOn.java new file mode 100644 index 0000000..58611b9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSaveOn.java @@ -0,0 +1,51 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; + +public class CommandSaveOn extends CommandBase +{ + private static final String __OBFID = "CL_00000873"; + + public String getCommandName() + { + return "save-on"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.save-on.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + boolean flag = false; + + for (int i = 0; i < minecraftserver.worldServers.length; ++i) + { + if (minecraftserver.worldServers[i] != null) + { + WorldServer worldserver = minecraftserver.worldServers[i]; + + if (worldserver.levelSaving) + { + worldserver.levelSaving = false; + flag = true; + } + } + } + + if (flag) + { + func_152373_a(sender, this, "commands.save.enabled", new Object[0]); + } + else + { + throw new CommandException("commands.save-on.alreadyOn", new Object[0]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandScoreboard.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandScoreboard.java new file mode 100644 index 0000000..43eb353 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandScoreboard.java @@ -0,0 +1,933 @@ +package net.minecraft.command.server; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.SyntaxErrorException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; + +public class CommandScoreboard extends CommandBase +{ + private static final String __OBFID = "CL_00000896"; + + public String getCommandName() + { + return "scoreboard"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.scoreboard.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1) + { + if (args[0].equalsIgnoreCase("objectives")) + { + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + this.func_147196_d(sender); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length < 4) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } + + this.func_147193_c(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.objectives.remove.usage", new Object[0]); + } + + this.func_147191_h(sender, args[2]); + } + else + { + if (!args[1].equalsIgnoreCase("setdisplay")) + { + throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); + } + + if (args.length != 3 && args.length != 4) + { + throw new WrongUsageException("commands.scoreboard.objectives.setdisplay.usage", new Object[0]); + } + + this.func_147198_k(sender, args, 2); + } + + return; + } + + if (args[0].equalsIgnoreCase("players")) + { + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + if (args.length > 3) + { + throw new WrongUsageException("commands.scoreboard.players.list.usage", new Object[0]); + } + + this.func_147195_l(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length != 5) + { + throw new WrongUsageException("commands.scoreboard.players.add.usage", new Object[0]); + } + + this.func_147197_m(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length != 5) + { + throw new WrongUsageException("commands.scoreboard.players.remove.usage", new Object[0]); + } + + this.func_147197_m(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("set")) + { + if (args.length != 5) + { + throw new WrongUsageException("commands.scoreboard.players.set.usage", new Object[0]); + } + + this.func_147197_m(sender, args, 2); + } + else + { + if (!args[1].equalsIgnoreCase("reset")) + { + throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); + } + + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.players.reset.usage", new Object[0]); + } + + this.func_147187_n(sender, args, 2); + } + + return; + } + + if (args[0].equalsIgnoreCase("teams")) + { + if (args.length == 1) + { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (args[1].equalsIgnoreCase("list")) + { + if (args.length > 3) + { + throw new WrongUsageException("commands.scoreboard.teams.list.usage", new Object[0]); + } + + this.func_147186_g(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("add")) + { + if (args.length < 3) + { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } + + this.func_147185_d(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.teams.remove.usage", new Object[0]); + } + + this.func_147194_f(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("empty")) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.scoreboard.teams.empty.usage", new Object[0]); + } + + this.func_147188_j(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("join")) + { + if (args.length < 4 && (args.length != 3 || !(sender instanceof EntityPlayer))) + { + throw new WrongUsageException("commands.scoreboard.teams.join.usage", new Object[0]); + } + + this.func_147190_h(sender, args, 2); + } + else if (args[1].equalsIgnoreCase("leave")) + { + if (args.length < 3 && !(sender instanceof EntityPlayer)) + { + throw new WrongUsageException("commands.scoreboard.teams.leave.usage", new Object[0]); + } + + this.func_147199_i(sender, args, 2); + } + else + { + if (!args[1].equalsIgnoreCase("option")) + { + throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); + } + + if (args.length != 4 && args.length != 5) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + + this.func_147200_e(sender, args, 2); + } + + return; + } + } + + throw new WrongUsageException("commands.scoreboard.usage", new Object[0]); + } + + protected Scoreboard func_147192_d() + { + return MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); + } + + protected ScoreObjective func_147189_a(String name, boolean edit) + { + Scoreboard scoreboard = this.func_147192_d(); + ScoreObjective scoreobjective = scoreboard.getObjective(name); + + if (scoreobjective == null) + { + throw new CommandException("commands.scoreboard.objectiveNotFound", new Object[] {name}); + } + else if (edit && scoreobjective.getCriteria().isReadOnly()) + { + throw new CommandException("commands.scoreboard.objectiveReadOnly", new Object[] {name}); + } + else + { + return scoreobjective; + } + } + + protected ScorePlayerTeam func_147183_a(String name) + { + Scoreboard scoreboard = this.func_147192_d(); + ScorePlayerTeam scoreplayerteam = scoreboard.getTeam(name); + + if (scoreplayerteam == null) + { + throw new CommandException("commands.scoreboard.teamNotFound", new Object[] {name}); + } + else + { + return scoreplayerteam; + } + } + + protected void func_147193_c(ICommandSender sender, String[] args, int index) + { + String s = args[index++]; + String s1 = args[index++]; + Scoreboard scoreboard = this.func_147192_d(); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.field_96643_a.get(s1); + + if (iscoreobjectivecriteria == null) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", new Object[] {s1}); + } + else if (scoreboard.getObjective(s) != null) + { + throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", new Object[] {s}); + } + else if (s.length() > 16) + { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", new Object[] {s, Integer.valueOf(16)}); + } + else if (s.length() == 0) + { + throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); + } + else + { + if (args.length > index) + { + String s2 = func_147178_a(sender, args, index).getUnformattedText(); + + if (s2.length() > 32) + { + throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", new Object[] {s2, Integer.valueOf(32)}); + } + + if (s2.length() > 0) + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria).setDisplayName(s2); + } + else + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + } + else + { + scoreboard.addScoreObjective(s, iscoreobjectivecriteria); + } + + func_152373_a(sender, this, "commands.scoreboard.objectives.add.success", new Object[] {s}); + } + } + + protected void func_147185_d(ICommandSender p_147185_1_, String[] p_147185_2_, int p_147185_3_) + { + String s = p_147185_2_[p_147185_3_++]; + Scoreboard scoreboard = this.func_147192_d(); + + if (scoreboard.getTeam(s) != null) + { + throw new CommandException("commands.scoreboard.teams.add.alreadyExists", new Object[] {s}); + } + else if (s.length() > 16) + { + throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", new Object[] {s, Integer.valueOf(16)}); + } + else if (s.length() == 0) + { + throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); + } + else + { + if (p_147185_2_.length > p_147185_3_) + { + String s1 = func_147178_a(p_147185_1_, p_147185_2_, p_147185_3_).getUnformattedText(); + + if (s1.length() > 32) + { + throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[] {s1, Integer.valueOf(32)}); + } + + if (s1.length() > 0) + { + scoreboard.createTeam(s).setTeamName(s1); + } + else + { + scoreboard.createTeam(s); + } + } + else + { + scoreboard.createTeam(s); + } + + func_152373_a(p_147185_1_, this, "commands.scoreboard.teams.add.success", new Object[] {s}); + } + } + + protected void func_147200_e(ICommandSender p_147200_1_, String[] p_147200_2_, int p_147200_3_) + { + ScorePlayerTeam scoreplayerteam = this.func_147183_a(p_147200_2_[p_147200_3_++]); + + if (scoreplayerteam != null) + { + String s = p_147200_2_[p_147200_3_++].toLowerCase(); + + if (!s.equalsIgnoreCase("color") && !s.equalsIgnoreCase("friendlyfire") && !s.equalsIgnoreCase("seeFriendlyInvisibles")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + else if (p_147200_2_.length == 4) + { + if (s.equalsIgnoreCase("color")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))}); + } + else if (!s.equalsIgnoreCase("friendlyfire") && !s.equalsIgnoreCase("seeFriendlyInvisibles")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); + } + else + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + } + else + { + String s1 = p_147200_2_[p_147200_3_++]; + + if (s.equalsIgnoreCase("color")) + { + EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s1); + + if (enumchatformatting == null || enumchatformatting.isFancyStyling()) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(EnumChatFormatting.getValidValues(true, false))}); + } + + scoreplayerteam.setNamePrefix(enumchatformatting.toString()); + scoreplayerteam.setNameSuffix(EnumChatFormatting.RESET.toString()); + } + else if (s.equalsIgnoreCase("friendlyfire")) + { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + + scoreplayerteam.setAllowFriendlyFire(s1.equalsIgnoreCase("true")); + } + else if (s.equalsIgnoreCase("seeFriendlyInvisibles")) + { + if (!s1.equalsIgnoreCase("true") && !s1.equalsIgnoreCase("false")) + { + throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {s, joinNiceStringFromCollection(Arrays.asList(new String[]{"true", "false"}))}); + } + + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(s1.equalsIgnoreCase("true")); + } + + func_152373_a(p_147200_1_, this, "commands.scoreboard.teams.option.success", new Object[] {s, scoreplayerteam.getRegisteredName(), s1}); + } + } + } + + protected void func_147194_f(ICommandSender p_147194_1_, String[] p_147194_2_, int p_147194_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + ScorePlayerTeam scoreplayerteam = this.func_147183_a(p_147194_2_[p_147194_3_++]); + + if (scoreplayerteam != null) + { + scoreboard.removeTeam(scoreplayerteam); + func_152373_a(p_147194_1_, this, "commands.scoreboard.teams.remove.success", new Object[] {scoreplayerteam.getRegisteredName()}); + } + } + + protected void func_147186_g(ICommandSender p_147186_1_, String[] p_147186_2_, int p_147186_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + + if (p_147186_2_.length > p_147186_3_) + { + ScorePlayerTeam scoreplayerteam = this.func_147183_a(p_147186_2_[p_147186_3_++]); + + if (scoreplayerteam == null) + { + return; + } + + Collection collection = scoreplayerteam.getMembershipCollection(); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.teams.list.player.empty", new Object[] {scoreplayerteam.getRegisteredName()}); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.teams.list.player.count", new Object[] {Integer.valueOf(collection.size()), scoreplayerteam.getRegisteredName()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(chatcomponenttranslation); + p_147186_1_.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } + else + { + Collection collection1 = scoreboard.getTeams(); + + if (collection1.size() <= 0) + { + throw new CommandException("commands.scoreboard.teams.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.scoreboard.teams.list.count", new Object[] {Integer.valueOf(collection1.size())}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147186_1_.addChatMessage(chatcomponenttranslation1); + Iterator iterator = collection1.iterator(); + + while (iterator.hasNext()) + { + ScorePlayerTeam scoreplayerteam1 = (ScorePlayerTeam)iterator.next(); + p_147186_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.teams.list.entry", new Object[] {scoreplayerteam1.getRegisteredName(), scoreplayerteam1.func_96669_c(), Integer.valueOf(scoreplayerteam1.getMembershipCollection().size())})); + } + } + } + + protected void func_147190_h(ICommandSender p_147190_1_, String[] p_147190_2_, int p_147190_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + String s = p_147190_2_[p_147190_3_++]; + HashSet hashset = new HashSet(); + HashSet hashset1 = new HashSet(); + String s1; + + if (p_147190_1_ instanceof EntityPlayer && p_147190_3_ == p_147190_2_.length) + { + s1 = getCommandSenderAsPlayer(p_147190_1_).getCommandSenderName(); + + if (scoreboard.func_151392_a(s1, s)) + { + hashset.add(s1); + } + else + { + hashset1.add(s1); + } + } + else + { + while (p_147190_3_ < p_147190_2_.length) + { + s1 = func_96332_d(p_147190_1_, p_147190_2_[p_147190_3_++]); + + if (scoreboard.func_151392_a(s1, s)) + { + hashset.add(s1); + } + else + { + hashset1.add(s1); + } + } + } + + if (!hashset.isEmpty()) + { + func_152373_a(p_147190_1_, this, "commands.scoreboard.teams.join.success", new Object[] {Integer.valueOf(hashset.size()), s, joinNiceString(hashset.toArray(new String[0]))}); + } + + if (!hashset1.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.join.failure", new Object[] {Integer.valueOf(hashset1.size()), s, joinNiceString(hashset1.toArray(new String[0]))}); + } + } + + protected void func_147199_i(ICommandSender p_147199_1_, String[] p_147199_2_, int p_147199_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + HashSet hashset = new HashSet(); + HashSet hashset1 = new HashSet(); + String s; + + if (p_147199_1_ instanceof EntityPlayer && p_147199_3_ == p_147199_2_.length) + { + s = getCommandSenderAsPlayer(p_147199_1_).getCommandSenderName(); + + if (scoreboard.removePlayerFromTeams(s)) + { + hashset.add(s); + } + else + { + hashset1.add(s); + } + } + else + { + while (p_147199_3_ < p_147199_2_.length) + { + s = func_96332_d(p_147199_1_, p_147199_2_[p_147199_3_++]); + + if (scoreboard.removePlayerFromTeams(s)) + { + hashset.add(s); + } + else + { + hashset1.add(s); + } + } + } + + if (!hashset.isEmpty()) + { + func_152373_a(p_147199_1_, this, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(hashset.size()), joinNiceString(hashset.toArray(new String[0]))}); + } + + if (!hashset1.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(hashset1.size()), joinNiceString(hashset1.toArray(new String[0]))}); + } + } + + protected void func_147188_j(ICommandSender p_147188_1_, String[] p_147188_2_, int p_147188_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + ScorePlayerTeam scoreplayerteam = this.func_147183_a(p_147188_2_[p_147188_3_++]); + + if (scoreplayerteam != null) + { + ArrayList arraylist = new ArrayList(scoreplayerteam.getMembershipCollection()); + + if (arraylist.isEmpty()) + { + throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {scoreplayerteam.getRegisteredName()}); + } + else + { + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + scoreboard.removePlayerFromTeam(s, scoreplayerteam); + } + + func_152373_a(p_147188_1_, this, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(arraylist.size()), scoreplayerteam.getRegisteredName()}); + } + } + } + + protected void func_147191_h(ICommandSender p_147191_1_, String p_147191_2_) + { + Scoreboard scoreboard = this.func_147192_d(); + ScoreObjective scoreobjective = this.func_147189_a(p_147191_2_, false); + scoreboard.func_96519_k(scoreobjective); + func_152373_a(p_147191_1_, this, "commands.scoreboard.objectives.remove.success", new Object[] {p_147191_2_}); + } + + protected void func_147196_d(ICommandSender p_147196_1_) + { + Scoreboard scoreboard = this.func_147192_d(); + Collection collection = scoreboard.getScoreObjectives(); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.objectives.list.empty", new Object[0]); + } + else + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.objectives.list.count", new Object[] {Integer.valueOf(collection.size())}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147196_1_.addChatMessage(chatcomponenttranslation); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + p_147196_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.objectives.list.entry", new Object[] {scoreobjective.getName(), scoreobjective.getDisplayName(), scoreobjective.getCriteria().func_96636_a()})); + } + } + } + + protected void func_147198_k(ICommandSender p_147198_1_, String[] p_147198_2_, int p_147198_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + String s = p_147198_2_[p_147198_3_++]; + int j = Scoreboard.getObjectiveDisplaySlotNumber(s); + ScoreObjective scoreobjective = null; + + if (p_147198_2_.length == 4) + { + scoreobjective = this.func_147189_a(p_147198_2_[p_147198_3_++], false); + } + + if (j < 0) + { + throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] {s}); + } + else + { + scoreboard.func_96530_a(j, scoreobjective); + + if (scoreobjective != null) + { + func_152373_a(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successSet", new Object[] {Scoreboard.getObjectiveDisplaySlot(j), scoreobjective.getName()}); + } + else + { + func_152373_a(p_147198_1_, this, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[] {Scoreboard.getObjectiveDisplaySlot(j)}); + } + } + } + + protected void func_147195_l(ICommandSender p_147195_1_, String[] p_147195_2_, int p_147195_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + + if (p_147195_2_.length > p_147195_3_) + { + String s = func_96332_d(p_147195_1_, p_147195_2_[p_147195_3_++]); + Map map = scoreboard.func_96510_d(s); + + if (map.size() <= 0) + { + throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] {s}); + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("commands.scoreboard.players.list.player.count", new Object[] {Integer.valueOf(map.size()), s}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(chatcomponenttranslation); + Iterator iterator = map.values().iterator(); + + while (iterator.hasNext()) + { + Score score = (Score)iterator.next(); + p_147195_1_.addChatMessage(new ChatComponentTranslation("commands.scoreboard.players.list.player.entry", new Object[] {Integer.valueOf(score.getScorePoints()), score.func_96645_d().getDisplayName(), score.func_96645_d().getName()})); + } + } + else + { + Collection collection = scoreboard.getObjectiveNames(); + + if (collection.size() <= 0) + { + throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]); + } + + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("commands.scoreboard.players.list.count", new Object[] {Integer.valueOf(collection.size())}); + chatcomponenttranslation1.getChatStyle().setColor(EnumChatFormatting.DARK_GREEN); + p_147195_1_.addChatMessage(chatcomponenttranslation1); + p_147195_1_.addChatMessage(new ChatComponentText(joinNiceString(collection.toArray()))); + } + } + + protected void func_147197_m(ICommandSender p_147197_1_, String[] p_147197_2_, int p_147197_3_) + { + String s = p_147197_2_[p_147197_3_ - 1]; + String s1 = func_96332_d(p_147197_1_, p_147197_2_[p_147197_3_++]); + ScoreObjective scoreobjective = this.func_147189_a(p_147197_2_[p_147197_3_++], true); + int j = s.equalsIgnoreCase("set") ? parseInt(p_147197_1_, p_147197_2_[p_147197_3_++]) : parseIntWithMin(p_147197_1_, p_147197_2_[p_147197_3_++], 1); + Scoreboard scoreboard = this.func_147192_d(); + Score score = scoreboard.func_96529_a(s1, scoreobjective); + + if (s.equalsIgnoreCase("set")) + { + score.setScorePoints(j); + } + else if (s.equalsIgnoreCase("add")) + { + score.increseScore(j); + } + else + { + score.decreaseScore(j); + } + + func_152373_a(p_147197_1_, this, "commands.scoreboard.players.set.success", new Object[] {scoreobjective.getName(), s1, Integer.valueOf(score.getScorePoints())}); + } + + protected void func_147187_n(ICommandSender p_147187_1_, String[] p_147187_2_, int p_147187_3_) + { + Scoreboard scoreboard = this.func_147192_d(); + String s = func_96332_d(p_147187_1_, p_147187_2_[p_147187_3_++]); + scoreboard.func_96515_c(s); + func_152373_a(p_147187_1_, this, "commands.scoreboard.players.reset.success", new Object[] {s}); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"objectives", "players", "teams"}); + } + else + { + if (args[0].equalsIgnoreCase("objectives")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"list", "add", "remove", "setdisplay"}); + } + + if (args[1].equalsIgnoreCase("add")) + { + if (args.length == 4) + { + Set set = IScoreObjectiveCriteria.field_96643_a.keySet(); + return getListOfStringsFromIterableMatchingLastWord(args, set); + } + } + else if (args[1].equalsIgnoreCase("remove")) + { + if (args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147184_a(false)); + } + } + else if (args[1].equalsIgnoreCase("setdisplay")) + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, new String[] {"list", "sidebar", "belowName"}); + } + + if (args.length == 4) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147184_a(false)); + } + } + } + else if (args[0].equalsIgnoreCase("players")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"set", "add", "remove", "reset", "list"}); + } + + if (!args[1].equalsIgnoreCase("set") && !args[1].equalsIgnoreCase("add") && !args[1].equalsIgnoreCase("remove")) + { + if ((args[1].equalsIgnoreCase("reset") || args[1].equalsIgnoreCase("list")) && args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147192_d().getObjectiveNames()); + } + } + else + { + if (args.length == 3) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (args.length == 4) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147184_a(true)); + } + } + } + else if (args[0].equalsIgnoreCase("teams")) + { + if (args.length == 2) + { + return getListOfStringsMatchingLastWord(args, new String[] {"add", "remove", "join", "leave", "empty", "list", "option"}); + } + + if (args[1].equalsIgnoreCase("join")) + { + if (args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147192_d().getTeamNames()); + } + + if (args.length >= 4) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + } + else + { + if (args[1].equalsIgnoreCase("leave")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + if (!args[1].equalsIgnoreCase("empty") && !args[1].equalsIgnoreCase("list") && !args[1].equalsIgnoreCase("remove")) + { + if (args[1].equalsIgnoreCase("option")) + { + if (args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147192_d().getTeamNames()); + } + + if (args.length == 4) + { + return getListOfStringsMatchingLastWord(args, new String[] {"color", "friendlyfire", "seeFriendlyInvisibles"}); + } + + if (args.length == 5) + { + if (args[3].equalsIgnoreCase("color")) + { + return getListOfStringsFromIterableMatchingLastWord(args, EnumChatFormatting.getValidValues(true, false)); + } + + if (args[3].equalsIgnoreCase("friendlyfire") || args[3].equalsIgnoreCase("seeFriendlyInvisibles")) + { + return getListOfStringsMatchingLastWord(args, new String[] {"true", "false"}); + } + } + } + } + else if (args.length == 3) + { + return getListOfStringsFromIterableMatchingLastWord(args, this.func_147192_d().getTeamNames()); + } + } + } + + return null; + } + } + + protected List func_147184_a(boolean p_147184_1_) + { + Collection collection = this.func_147192_d().getScoreObjectives(); + ArrayList arraylist = new ArrayList(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + + if (!p_147184_1_ || !scoreobjective.getCriteria().isReadOnly()) + { + arraylist.add(scoreobjective.getName()); + } + } + + return arraylist; + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return args[0].equalsIgnoreCase("players") ? index == 2 : (!args[0].equalsIgnoreCase("teams") ? false : index == 2 || index == 3); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetBlock.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetBlock.java new file mode 100644 index 0000000..7599296 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetBlock.java @@ -0,0 +1,138 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandSetBlock extends CommandBase +{ + private static final String __OBFID = "CL_00000949"; + + public String getCommandName() + { + return "setblock"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setblock.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 4) + { + int i = sender.getPlayerCoordinates().posX; + int j = sender.getPlayerCoordinates().posY; + int k = sender.getPlayerCoordinates().posZ; + i = MathHelper.floor_double(func_110666_a(sender, (double)i, args[0])); + j = MathHelper.floor_double(func_110666_a(sender, (double)j, args[1])); + k = MathHelper.floor_double(func_110666_a(sender, (double)k, args[2])); + Block block = CommandBase.getBlockByText(sender, args[3]); + int l = 0; + + if (args.length >= 5) + { + l = parseIntBounded(sender, args[4], 0, 15); + } + + World world = sender.getEntityWorld(); + + if (!world.blockExists(i, j, k)) + { + throw new CommandException("commands.setblock.outOfWorld", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 7 && block.hasTileEntity()) + { + String s = func_147178_a(sender, args, 6).getUnformattedText(); + + try + { + NBTBase nbtbase = JsonToNBT.func_150315_a(s); + + if (!(nbtbase instanceof NBTTagCompound)) + { + throw new CommandException("commands.setblock.tagError", new Object[] {"Not a valid tag"}); + } + + nbttagcompound = (NBTTagCompound)nbtbase; + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.setblock.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + if (args.length >= 6) + { + if (args[5].equals("destroy")) + { + world.func_147480_a(i, j, k, true); + } + else if (args[5].equals("keep") && !world.isAirBlock(i, j, k)) + { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } + } + + if (!world.setBlock(i, j, k, block, l, 3)) + { + throw new CommandException("commands.setblock.noChange", new Object[0]); + } + else + { + if (flag) + { + TileEntity tileentity = world.getTileEntity(i, j, k); + + if (tileentity != null) + { + nbttagcompound.setInteger("x", i); + nbttagcompound.setInteger("y", j); + nbttagcompound.setInteger("z", k); + tileentity.readFromNBT(nbttagcompound); + } + } + + func_152373_a(sender, this, "commands.setblock.success", new Object[0]); + } + } + } + else + { + throw new WrongUsageException("commands.setblock.usage", new Object[0]); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 4 ? getListOfStringsFromIterableMatchingLastWord(args, Block.blockRegistry.getKeys()) : (args.length == 6 ? getListOfStringsMatchingLastWord(args, new String[] {"replace", "destroy", "keep"}): null); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java new file mode 100644 index 0000000..4c64504 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSetDefaultSpawnpoint.java @@ -0,0 +1,59 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.util.ChunkCoordinates; + +public class CommandSetDefaultSpawnpoint extends CommandBase +{ + private static final String __OBFID = "CL_00000973"; + + public String getCommandName() + { + return "setworldspawn"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.setworldspawn.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 3) + { + if (sender.getEntityWorld() == null) + { + throw new WrongUsageException("commands.setworldspawn.usage", new Object[0]); + } + + byte b0 = 0; + int l = b0 + 1; + int i = parseIntBounded(sender, args[b0], -30000000, 30000000); + int j = parseIntBounded(sender, args[l++], 0, 256); + int k = parseIntBounded(sender, args[l++], -30000000, 30000000); + sender.getEntityWorld().setSpawnLocation(i, j, k); + func_152373_a(sender, this, "commands.setworldspawn.success", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)}); + } + else + { + if (args.length != 0) + { + throw new WrongUsageException("commands.setworldspawn.usage", new Object[0]); + } + + ChunkCoordinates chunkcoordinates = getCommandSenderAsPlayer(sender).getPlayerCoordinates(); + sender.getEntityWorld().setSpawnLocation(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ); + func_152373_a(sender, this, "commands.setworldspawn.success", new Object[] {Integer.valueOf(chunkcoordinates.posX), Integer.valueOf(chunkcoordinates.posY), Integer.valueOf(chunkcoordinates.posZ)}); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandStop.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandStop.java new file mode 100644 index 0000000..20761ab --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandStop.java @@ -0,0 +1,30 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; + +public class CommandStop extends CommandBase +{ + private static final String __OBFID = "CL_00001132"; + + public String getCommandName() + { + return "stop"; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.stop.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (MinecraftServer.getServer().worldServers != null) + { + func_152373_a(sender, this, "commands.stop.start", new Object[0]); + } + + MinecraftServer.getServer().initiateShutdown(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSummon.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSummon.java new file mode 100644 index 0000000..2dbe25d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandSummon.java @@ -0,0 +1,146 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class CommandSummon extends CommandBase +{ + private static final String __OBFID = "CL_00001158"; + + public String getCommandName() + { + return "summon"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.summon.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 1) + { + throw new WrongUsageException("commands.summon.usage", new Object[0]); + } + else + { + String s = args[0]; + double d0 = (double)sender.getPlayerCoordinates().posX + 0.5D; + double d1 = (double)sender.getPlayerCoordinates().posY; + double d2 = (double)sender.getPlayerCoordinates().posZ + 0.5D; + + if (args.length >= 4) + { + d0 = func_110666_a(sender, d0, args[1]); + d1 = func_110666_a(sender, d1, args[2]); + d2 = func_110666_a(sender, d2, args[3]); + } + + World world = sender.getEntityWorld(); + + if (!world.blockExists((int)d0, (int)d1, (int)d2)) + { + func_152373_a(sender, this, "commands.summon.outOfWorld", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 5) + { + IChatComponent ichatcomponent = func_147178_a(sender, args, 4); + + try + { + NBTBase nbtbase = JsonToNBT.func_150315_a(ichatcomponent.getUnformattedText()); + + if (!(nbtbase instanceof NBTTagCompound)) + { + func_152373_a(sender, this, "commands.summon.tagError", new Object[] {"Not a valid tag"}); + return; + } + + nbttagcompound = (NBTTagCompound)nbtbase; + flag = true; + } + catch (NBTException nbtexception) + { + func_152373_a(sender, this, "commands.summon.tagError", new Object[] {nbtexception.getMessage()}); + return; + } + } + + nbttagcompound.setString("id", s); + Entity entity1 = EntityList.createEntityFromNBT(nbttagcompound, world); + + if (entity1 == null) + { + func_152373_a(sender, this, "commands.summon.failed", new Object[0]); + } + else + { + entity1.setLocationAndAngles(d0, d1, d2, entity1.rotationYaw, entity1.rotationPitch); + + if (!flag && entity1 instanceof EntityLiving) + { + ((EntityLiving)entity1).onSpawnWithEgg((IEntityLivingData)null); + } + + world.spawnEntityInWorld(entity1); + Entity entity2 = entity1; + + for (NBTTagCompound nbttagcompound1 = nbttagcompound; entity2 != null && nbttagcompound1.hasKey("Riding", 10); nbttagcompound1 = nbttagcompound1.getCompoundTag("Riding")) + { + Entity entity = EntityList.createEntityFromNBT(nbttagcompound1.getCompoundTag("Riding"), world); + + if (entity != null) + { + entity.setLocationAndAngles(d0, d1, d2, entity.rotationYaw, entity.rotationPitch); + world.spawnEntityInWorld(entity); + entity2.mountEntity(entity); + } + + entity2 = entity; + } + + func_152373_a(sender, this, "commands.summon.success", new Object[0]); + } + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, this.func_147182_d()) : null; + } + + protected String[] func_147182_d() + { + return (String[])EntityList.func_151515_b().toArray(new String[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTeleport.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTeleport.java new file mode 100644 index 0000000..dba766b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTeleport.java @@ -0,0 +1,108 @@ +package net.minecraft.command.server; + +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class CommandTeleport extends CommandBase +{ + private static final String __OBFID = "CL_00001180"; + + public String getCommandName() + { + return "tp"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.tp.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length < 1) + { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } + else + { + EntityPlayerMP entityplayermp; + + if (args.length != 2 && args.length != 4) + { + entityplayermp = getCommandSenderAsPlayer(sender); + } + else + { + entityplayermp = getPlayer(sender, args[0]); + + if (entityplayermp == null) + { + throw new PlayerNotFoundException(); + } + } + + if (args.length != 3 && args.length != 4) + { + if (args.length == 1 || args.length == 2) + { + EntityPlayerMP entityplayermp1 = getPlayer(sender, args[args.length - 1]); + + if (entityplayermp1 == null) + { + throw new PlayerNotFoundException(); + } + + if (entityplayermp1.worldObj != entityplayermp.worldObj) + { + func_152373_a(sender, this, "commands.tp.notSameDimension", new Object[0]); + return; + } + + entityplayermp.mountEntity((Entity)null); + entityplayermp.playerNetServerHandler.setPlayerLocation(entityplayermp1.posX, entityplayermp1.posY, entityplayermp1.posZ, entityplayermp1.rotationYaw, entityplayermp1.rotationPitch); + func_152373_a(sender, this, "commands.tp.success", new Object[] {entityplayermp.getCommandSenderName(), entityplayermp1.getCommandSenderName()}); + } + } + else if (entityplayermp.worldObj != null) + { + int i = args.length - 3; + double d0 = func_110666_a(sender, entityplayermp.posX, args[i++]); + double d1 = func_110665_a(sender, entityplayermp.posY, args[i++], 0, 0); + double d2 = func_110666_a(sender, entityplayermp.posZ, args[i++]); + entityplayermp.mountEntity((Entity)null); + entityplayermp.setPositionAndUpdate(d0, d1, d2); + func_152373_a(sender, this, "commands.tp.success.coordinates", new Object[] {entityplayermp.getCommandSenderName(), Double.valueOf(d0), Double.valueOf(d1), Double.valueOf(d2)}); + } + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length != 1 && args.length != 2 ? null : getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getAllUsernames()); + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestFor.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestFor.java new file mode 100644 index 0000000..4a057a9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestFor.java @@ -0,0 +1,53 @@ +package net.minecraft.command.server; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; + +public class CommandTestFor extends CommandBase +{ + private static final String __OBFID = "CL_00001182"; + + public String getCommandName() + { + return "testfor"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.testfor.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length != 1) + { + throw new WrongUsageException("commands.testfor.usage", new Object[0]); + } + else if (!(sender instanceof CommandBlockLogic)) + { + throw new CommandException("commands.testfor.failed", new Object[0]); + } + else + { + getPlayer(sender, args[0]); + } + } + + /** + * Return whether the specified command parameter index is a username parameter. + */ + public boolean isUsernameIndex(String[] args, int index) + { + return index == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestForBlock.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestForBlock.java new file mode 100644 index 0000000..18c657f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandTestForBlock.java @@ -0,0 +1,200 @@ +package net.minecraft.command.server; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.NumberInvalidException; +import net.minecraft.command.WrongUsageException; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class CommandTestForBlock extends CommandBase +{ + private static final String __OBFID = "CL_00001181"; + + public String getCommandName() + { + return "testforblock"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 2; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.testforblock.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 4) + { + int i = sender.getPlayerCoordinates().posX; + int j = sender.getPlayerCoordinates().posY; + int k = sender.getPlayerCoordinates().posZ; + i = MathHelper.floor_double(func_110666_a(sender, (double)i, args[0])); + j = MathHelper.floor_double(func_110666_a(sender, (double)j, args[1])); + k = MathHelper.floor_double(func_110666_a(sender, (double)k, args[2])); + Block block = Block.getBlockFromName(args[3]); + + if (block == null) + { + throw new NumberInvalidException("commands.setblock.notFound", new Object[] {args[3]}); + } + else + { + int l = -1; + + if (args.length >= 5) + { + l = parseIntBounded(sender, args[4], -1, 15); + } + + World world = sender.getEntityWorld(); + + if (!world.blockExists(i, j, k)) + { + throw new CommandException("commands.testforblock.outOfWorld", new Object[0]); + } + else + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + boolean flag = false; + + if (args.length >= 6 && block.hasTileEntity()) + { + String s = func_147178_a(sender, args, 5).getUnformattedText(); + + try + { + NBTBase nbtbase = JsonToNBT.func_150315_a(s); + + if (!(nbtbase instanceof NBTTagCompound)) + { + throw new CommandException("commands.setblock.tagError", new Object[] {"Not a valid tag"}); + } + + nbttagcompound = (NBTTagCompound)nbtbase; + flag = true; + } + catch (NBTException nbtexception) + { + throw new CommandException("commands.setblock.tagError", new Object[] {nbtexception.getMessage()}); + } + } + + Block block1 = world.getBlock(i, j, k); + + if (block1 != block) + { + throw new CommandException("commands.testforblock.failed.tile", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k), block1.getLocalizedName(), block.getLocalizedName()}); + } + else + { + if (l > -1) + { + int i1 = world.getBlockMetadata(i, j, k); + + if (i1 != l) + { + throw new CommandException("commands.testforblock.failed.data", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k), Integer.valueOf(i1), Integer.valueOf(l)}); + } + } + + if (flag) + { + TileEntity tileentity = world.getTileEntity(i, j, k); + + if (tileentity == null) + { + throw new CommandException("commands.testforblock.failed.tileEntity", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)}); + } + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound1); + + if (!this.func_147181_a(nbttagcompound, nbttagcompound1)) + { + throw new CommandException("commands.testforblock.failed.nbt", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)}); + } + } + + sender.addChatMessage(new ChatComponentTranslation("commands.testforblock.success", new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)})); + } + } + } + } + else + { + throw new WrongUsageException("commands.testforblock.usage", new Object[0]); + } + } + + public boolean func_147181_a(NBTBase p_147181_1_, NBTBase p_147181_2_) + { + if (p_147181_1_ == p_147181_2_) + { + return true; + } + else if (p_147181_1_ == null) + { + return true; + } + else if (p_147181_2_ == null) + { + return false; + } + else if (!p_147181_1_.getClass().equals(p_147181_2_.getClass())) + { + return false; + } + else if (p_147181_1_ instanceof NBTTagCompound) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)p_147181_1_; + NBTTagCompound nbttagcompound1 = (NBTTagCompound)p_147181_2_; + Iterator iterator = nbttagcompound.func_150296_c().iterator(); + String s; + NBTBase nbtbase2; + + do + { + if (!iterator.hasNext()) + { + return true; + } + + s = (String)iterator.next(); + nbtbase2 = nbttagcompound.getTag(s); + } + while (this.func_147181_a(nbtbase2, nbttagcompound1.getTag(s))); + + return false; + } + else + { + return p_147181_1_.equals(p_147181_2_); + } + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 4 ? getListOfStringsFromIterableMatchingLastWord(args, Block.blockRegistry.getKeys()) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandWhitelist.java b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandWhitelist.java new file mode 100644 index 0000000..fa6b155 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/command/server/CommandWhitelist.java @@ -0,0 +1,141 @@ +package net.minecraft.command.server; + +import com.mojang.authlib.GameProfile; +import java.util.List; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; + +public class CommandWhitelist extends CommandBase +{ + private static final String __OBFID = "CL_00001186"; + + public String getCommandName() + { + return "whitelist"; + } + + /** + * Return the required permission level for this command. + */ + public int getRequiredPermissionLevel() + { + return 3; + } + + public String getCommandUsage(ICommandSender sender) + { + return "commands.whitelist.usage"; + } + + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length >= 1) + { + MinecraftServer minecraftserver = MinecraftServer.getServer(); + + if (args[0].equals("on")) + { + minecraftserver.getConfigurationManager().setWhiteListEnabled(true); + func_152373_a(sender, this, "commands.whitelist.enabled", new Object[0]); + return; + } + + if (args[0].equals("off")) + { + minecraftserver.getConfigurationManager().setWhiteListEnabled(false); + func_152373_a(sender, this, "commands.whitelist.disabled", new Object[0]); + return; + } + + if (args[0].equals("list")) + { + sender.addChatMessage(new ChatComponentTranslation("commands.whitelist.list", new Object[] {Integer.valueOf(minecraftserver.getConfigurationManager().func_152598_l().length), Integer.valueOf(minecraftserver.getConfigurationManager().getAvailablePlayerDat().length)})); + String[] astring1 = minecraftserver.getConfigurationManager().func_152598_l(); + sender.addChatMessage(new ChatComponentText(joinNiceString(astring1))); + return; + } + + GameProfile gameprofile; + + if (args[0].equals("add")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.whitelist.add.usage", new Object[0]); + } + + gameprofile = minecraftserver.func_152358_ax().func_152655_a(args[1]); + + if (gameprofile == null) + { + throw new CommandException("commands.whitelist.add.failed", new Object[] {args[1]}); + } + + minecraftserver.getConfigurationManager().func_152601_d(gameprofile); + func_152373_a(sender, this, "commands.whitelist.add.success", new Object[] {args[1]}); + return; + } + + if (args[0].equals("remove")) + { + if (args.length < 2) + { + throw new WrongUsageException("commands.whitelist.remove.usage", new Object[0]); + } + + gameprofile = minecraftserver.getConfigurationManager().func_152599_k().func_152706_a(args[1]); + + if (gameprofile == null) + { + throw new CommandException("commands.whitelist.remove.failed", new Object[] {args[1]}); + } + + minecraftserver.getConfigurationManager().func_152597_c(gameprofile); + func_152373_a(sender, this, "commands.whitelist.remove.success", new Object[] {args[1]}); + return; + } + + if (args[0].equals("reload")) + { + minecraftserver.getConfigurationManager().loadWhiteList(); + func_152373_a(sender, this, "commands.whitelist.reloaded", new Object[0]); + return; + } + } + + throw new WrongUsageException("commands.whitelist.usage", new Object[0]); + } + + /** + * Adds the strings available in this command to the given list of tab completion options. + */ + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + if (args.length == 1) + { + return getListOfStringsMatchingLastWord(args, new String[] {"on", "off", "list", "add", "remove", "reload"}); + } + else + { + if (args.length == 2) + { + if (args[0].equals("remove")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().getConfigurationManager().func_152598_l()); + } + + if (args[0].equals("add")) + { + return getListOfStringsMatchingLastWord(args, MinecraftServer.getServer().func_152358_ax().func_152654_a()); + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReport.java b/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReport.java new file mode 100644 index 0000000..b866684 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReport.java @@ -0,0 +1,426 @@ +package net.minecraft.crash; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.util.ReportedException; +import net.minecraft.world.gen.layer.IntCache; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class CrashReport +{ + private static final Logger logger = LogManager.getLogger(); + /** Description of the crash report. */ + private final String description; + /** The Throwable that is the "cause" for this crash and Crash Report. */ + private final Throwable cause; + /** Category of crash */ + private final CrashReportCategory theReportCategory = new CrashReportCategory(this, "System Details"); + /** Holds the keys and values of all crash report sections. */ + private final List crashReportSections = new ArrayList(); + /** File of crash report. */ + private File crashReportFile; + private boolean field_85059_f = true; + private StackTraceElement[] stacktrace = new StackTraceElement[0]; + private static final String __OBFID = "CL_00000990"; + + public CrashReport(String p_i1348_1_, Throwable p_i1348_2_) + { + this.description = p_i1348_1_; + this.cause = p_i1348_2_; + this.populateEnvironment(); + } + + /** + * Populates this crash report with initial information about the running server and operating system / java + * environment + */ + private void populateEnvironment() + { + this.theReportCategory.addCrashSectionCallable("Minecraft Version", new Callable() + { + private static final String __OBFID = "CL_00001197"; + public String call() + { + return "1.7.10"; + } + }); + this.theReportCategory.addCrashSectionCallable("Operating System", new Callable() + { + private static final String __OBFID = "CL_00001222"; + public String call() + { + return System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version"); + } + }); + this.theReportCategory.addCrashSectionCallable("Java Version", new Callable() + { + private static final String __OBFID = "CL_00001248"; + public String call() + { + return System.getProperty("java.version") + ", " + System.getProperty("java.vendor"); + } + }); + this.theReportCategory.addCrashSectionCallable("Java VM Version", new Callable() + { + private static final String __OBFID = "CL_00001275"; + public String call() + { + return System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor"); + } + }); + this.theReportCategory.addCrashSectionCallable("Memory", new Callable() + { + private static final String __OBFID = "CL_00001302"; + public String call() + { + Runtime runtime = Runtime.getRuntime(); + long i = runtime.maxMemory(); + long j = runtime.totalMemory(); + long k = runtime.freeMemory(); + long l = i / 1024L / 1024L; + long i1 = j / 1024L / 1024L; + long j1 = k / 1024L / 1024L; + return k + " bytes (" + j1 + " MB) / " + j + " bytes (" + i1 + " MB) up to " + i + " bytes (" + l + " MB)"; + } + }); + this.theReportCategory.addCrashSectionCallable("JVM Flags", new Callable() + { + private static final String __OBFID = "CL_00001329"; + public String call() + { + RuntimeMXBean runtimemxbean = ManagementFactory.getRuntimeMXBean(); + List list = runtimemxbean.getInputArguments(); + int i = 0; + StringBuilder stringbuilder = new StringBuilder(); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (s.startsWith("-X")) + { + if (i++ > 0) + { + stringbuilder.append(" "); + } + + stringbuilder.append(s); + } + } + + return String.format("%d total; %s", new Object[] {Integer.valueOf(i), stringbuilder.toString()}); + } + }); + this.theReportCategory.addCrashSectionCallable("AABB Pool Size", new Callable() + { + private static final String __OBFID = "CL_00001355"; + public String call() + { + byte b0 = 0; + int i = 56 * b0; + int j = i / 1024 / 1024; + byte b1 = 0; + int k = 56 * b1; + int l = k / 1024 / 1024; + return b0 + " (" + i + " bytes; " + j + " MB) allocated, " + b1 + " (" + k + " bytes; " + l + " MB) used"; + } + }); + this.theReportCategory.addCrashSectionCallable("IntCache", new Callable() + { + private static final String __OBFID = "CL_00001382"; + public String call() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException + { + return IntCache.getCacheSizes(); + } + }); + FMLCommonHandler.instance().enhanceCrashReport(this, this.theReportCategory); + } + + /** + * Returns the description of the Crash Report. + */ + public String getDescription() + { + return this.description; + } + + /** + * Returns the Throwable object that is the cause for the crash and Crash Report. + */ + public Throwable getCrashCause() + { + return this.cause; + } + + /** + * Gets the various sections of the crash report into the given StringBuilder + */ + public void getSectionsInStringBuilder(StringBuilder p_71506_1_) + { + if ((this.stacktrace == null || this.stacktrace.length <= 0) && this.crashReportSections.size() > 0) + { + this.stacktrace = (StackTraceElement[])ArrayUtils.subarray(((CrashReportCategory)this.crashReportSections.get(0)).func_147152_a(), 0, 1); + } + + if (this.stacktrace != null && this.stacktrace.length > 0) + { + p_71506_1_.append("-- Head --\n"); + p_71506_1_.append("Stacktrace:\n"); + StackTraceElement[] astacktraceelement = this.stacktrace; + int i = astacktraceelement.length; + + for (int j = 0; j < i; ++j) + { + StackTraceElement stacktraceelement = astacktraceelement[j]; + p_71506_1_.append("\t").append("at ").append(stacktraceelement.toString()); + p_71506_1_.append("\n"); + } + + p_71506_1_.append("\n"); + } + + Iterator iterator = this.crashReportSections.iterator(); + + while (iterator.hasNext()) + { + CrashReportCategory crashreportcategory = (CrashReportCategory)iterator.next(); + crashreportcategory.appendToStringBuilder(p_71506_1_); + p_71506_1_.append("\n\n"); + } + + this.theReportCategory.appendToStringBuilder(p_71506_1_); + } + + /** + * Gets the stack trace of the Throwable that caused this crash report, or if that fails, the cause .toString(). + */ + public String getCauseStackTraceOrString() + { + StringWriter stringwriter = null; + PrintWriter printwriter = null; + Object object = this.cause; + + if (((Throwable)object).getMessage() == null) + { + if (object instanceof NullPointerException) + { + object = new NullPointerException(this.description); + } + else if (object instanceof StackOverflowError) + { + object = new StackOverflowError(this.description); + } + else if (object instanceof OutOfMemoryError) + { + object = new OutOfMemoryError(this.description); + } + + ((Throwable)object).setStackTrace(this.cause.getStackTrace()); + } + + String s = ((Throwable)object).toString(); + + try + { + stringwriter = new StringWriter(); + printwriter = new PrintWriter(stringwriter); + ((Throwable)object).printStackTrace(printwriter); + s = stringwriter.toString(); + } + finally + { + IOUtils.closeQuietly(stringwriter); + IOUtils.closeQuietly(printwriter); + } + + return s; + } + + /** + * Gets the complete report with headers, stack trace, and different sections as a string. + */ + public String getCompleteReport() + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append("---- Minecraft Crash Report ----\n"); + stringbuilder.append("// "); + stringbuilder.append(getWittyComment()); + stringbuilder.append("\n\n"); + stringbuilder.append("Time: "); + stringbuilder.append((new SimpleDateFormat()).format(new Date())); + stringbuilder.append("\n"); + stringbuilder.append("Description: "); + stringbuilder.append(this.description); + stringbuilder.append("\n\n"); + stringbuilder.append(this.getCauseStackTraceOrString()); + stringbuilder.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n"); + + for (int i = 0; i < 87; ++i) + { + stringbuilder.append("-"); + } + + stringbuilder.append("\n\n"); + this.getSectionsInStringBuilder(stringbuilder); + return stringbuilder.toString(); + } + + /** + * Gets the file this crash report is saved into. + */ + @SideOnly(Side.CLIENT) + public File getFile() + { + return this.crashReportFile; + } + + /** + * Saves this CrashReport to the given file and returns a value indicating whether we were successful at doing so. + */ + public boolean saveToFile(File p_147149_1_) + { + if (this.crashReportFile != null) + { + return false; + } + else + { + if (p_147149_1_.getParentFile() != null) + { + p_147149_1_.getParentFile().mkdirs(); + } + + try + { + FileWriter filewriter = new FileWriter(p_147149_1_); + filewriter.write(this.getCompleteReport()); + filewriter.close(); + this.crashReportFile = p_147149_1_; + return true; + } + catch (Throwable throwable) + { + logger.error("Could not save crash report to " + p_147149_1_, throwable); + return false; + } + } + } + + public CrashReportCategory getCategory() + { + return this.theReportCategory; + } + + /** + * Creates a CrashReportCategory + */ + public CrashReportCategory makeCategory(String p_85058_1_) + { + return this.makeCategoryDepth(p_85058_1_, 1); + } + + /** + * Creates a CrashReportCategory for the given stack trace depth + */ + public CrashReportCategory makeCategoryDepth(String p_85057_1_, int p_85057_2_) + { + CrashReportCategory crashreportcategory = new CrashReportCategory(this, p_85057_1_); + + if (this.field_85059_f) + { + int j = crashreportcategory.getPrunedStackTrace(p_85057_2_); + StackTraceElement[] astacktraceelement = this.cause.getStackTrace(); + StackTraceElement stacktraceelement = null; + StackTraceElement stacktraceelement1 = null; + int k = astacktraceelement.length - j; + + if (k < 0) + { + System.out.println("Negative index in crash report handler (" + astacktraceelement.length + "/" + j + ")"); + } + + if (astacktraceelement != null && 0 <= k && k < astacktraceelement.length) + { + stacktraceelement = astacktraceelement[k]; + + if (astacktraceelement.length + 1 - j < astacktraceelement.length) + { + stacktraceelement1 = astacktraceelement[astacktraceelement.length + 1 - j]; + } + } + + this.field_85059_f = crashreportcategory.firstTwoElementsOfStackTraceMatch(stacktraceelement, stacktraceelement1); + + if (j > 0 && !this.crashReportSections.isEmpty()) + { + CrashReportCategory crashreportcategory1 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1); + crashreportcategory1.trimStackTraceEntriesFromBottom(j); + } + else if (astacktraceelement != null && astacktraceelement.length >= j && 0 <= k && k < astacktraceelement.length) + { + this.stacktrace = new StackTraceElement[k]; + System.arraycopy(astacktraceelement, 0, this.stacktrace, 0, this.stacktrace.length); + } + else + { + this.field_85059_f = false; + } + } + + this.crashReportSections.add(crashreportcategory); + return crashreportcategory; + } + + /** + * Gets a random witty comment for inclusion in this CrashReport + */ + private static String getWittyComment() + { + String[] astring = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!", "But it works on my machine."}; + + try + { + return astring[(int)(System.nanoTime() % (long)astring.length)]; + } + catch (Throwable throwable) + { + return "Witty comment unavailable :("; + } + } + + /** + * Creates a crash report for the exception + */ + public static CrashReport makeCrashReport(Throwable p_85055_0_, String p_85055_1_) + { + CrashReport crashreport; + + if (p_85055_0_ instanceof ReportedException) + { + crashreport = ((ReportedException)p_85055_0_).getCrashReport(); + } + else + { + crashreport = new CrashReport(p_85055_1_, p_85055_0_); + } + + return crashreport; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReportCategory.java b/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReportCategory.java new file mode 100644 index 0000000..0718727 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/crash/CrashReportCategory.java @@ -0,0 +1,315 @@ +package net.minecraft.crash; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.util.MathHelper; + +public class CrashReportCategory +{ + private final CrashReport theCrashReport; + private final String field_85076_b; + private final List field_85077_c = new ArrayList(); + private StackTraceElement[] stackTrace = new StackTraceElement[0]; + private static final String __OBFID = "CL_00001409"; + + public CrashReportCategory(CrashReport p_i1353_1_, String p_i1353_2_) + { + this.theCrashReport = p_i1353_1_; + this.field_85076_b = p_i1353_2_; + } + + @SideOnly(Side.CLIENT) + public static String func_85074_a(double p_85074_0_, double p_85074_2_, double p_85074_4_) + { + return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(p_85074_0_), Double.valueOf(p_85074_2_), Double.valueOf(p_85074_4_), getLocationInfo(MathHelper.floor_double(p_85074_0_), MathHelper.floor_double(p_85074_2_), MathHelper.floor_double(p_85074_4_))}); + } + + /** + * Returns a string with world information on location.Args:x,y,z + */ + public static String getLocationInfo(int p_85071_0_, int p_85071_1_, int p_85071_2_) + { + StringBuilder stringbuilder = new StringBuilder(); + + try + { + stringbuilder.append(String.format("World: (%d,%d,%d)", new Object[] {Integer.valueOf(p_85071_0_), Integer.valueOf(p_85071_1_), Integer.valueOf(p_85071_2_)})); + } + catch (Throwable throwable2) + { + stringbuilder.append("(Error finding world loc)"); + } + + stringbuilder.append(", "); + int l; + int i1; + int j1; + int k1; + int l1; + int i2; + int j2; + int k2; + int l2; + + try + { + l = p_85071_0_ >> 4; + i1 = p_85071_2_ >> 4; + j1 = p_85071_0_ & 15; + k1 = p_85071_1_ >> 4; + l1 = p_85071_2_ & 15; + i2 = l << 4; + j2 = i1 << 4; + k2 = (l + 1 << 4) - 1; + l2 = (i1 + 1 << 4) - 1; + stringbuilder.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(j1), Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(l), Integer.valueOf(i1), Integer.valueOf(i2), Integer.valueOf(j2), Integer.valueOf(k2), Integer.valueOf(l2)})); + } + catch (Throwable throwable1) + { + stringbuilder.append("(Error finding chunk loc)"); + } + + stringbuilder.append(", "); + + try + { + l = p_85071_0_ >> 9; + i1 = p_85071_2_ >> 9; + j1 = l << 5; + k1 = i1 << 5; + l1 = (l + 1 << 5) - 1; + i2 = (i1 + 1 << 5) - 1; + j2 = l << 9; + k2 = i1 << 9; + l2 = (l + 1 << 9) - 1; + int i3 = (i1 + 1 << 9) - 1; + stringbuilder.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(l), Integer.valueOf(i1), Integer.valueOf(j1), Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(i2), Integer.valueOf(j2), Integer.valueOf(k2), Integer.valueOf(l2), Integer.valueOf(i3)})); + } + catch (Throwable throwable) + { + stringbuilder.append("(Error finding world loc)"); + } + + return stringbuilder.toString(); + } + + /** + * Adds a Crashreport section with the given name with the value set to the result of the given Callable; + */ + public void addCrashSectionCallable(String p_71500_1_, Callable p_71500_2_) + { + try + { + this.addCrashSection(p_71500_1_, p_71500_2_.call()); + } + catch (Throwable throwable) + { + this.addCrashSectionThrowable(p_71500_1_, throwable); + } + } + + /** + * Adds a Crashreport section with the given name with the given value (convered .toString()) + */ + public void addCrashSection(String p_71507_1_, Object p_71507_2_) + { + this.field_85077_c.add(new CrashReportCategory.Entry(p_71507_1_, p_71507_2_)); + } + + /** + * Adds a Crashreport section with the given name with the given Throwable + */ + public void addCrashSectionThrowable(String p_71499_1_, Throwable p_71499_2_) + { + this.addCrashSection(p_71499_1_, p_71499_2_); + } + + /** + * Resets our stack trace according to the current trace, pruning the deepest 3 entries. The parameter indicates + * how many additional deepest entries to prune. Returns the number of entries in the resulting pruned stack trace. + */ + public int getPrunedStackTrace(int p_85073_1_) + { + StackTraceElement[] astacktraceelement = Thread.currentThread().getStackTrace(); + + if (astacktraceelement.length <= 0) + { + return 0; + } + else + { + int len = astacktraceelement.length - 3 - p_85073_1_; + // Really Mojang, Still, god damn... + if (len <= 0) len = astacktraceelement.length; + this.stackTrace = new StackTraceElement[len]; + System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.stackTrace, 0, this.stackTrace.length); + return this.stackTrace.length; + } + } + + /** + * Do the deepest two elements of our saved stack trace match the given elements, in order from the deepest? + */ + public boolean firstTwoElementsOfStackTraceMatch(StackTraceElement p_85069_1_, StackTraceElement p_85069_2_) + { + if (this.stackTrace.length != 0 && p_85069_1_ != null) + { + StackTraceElement stacktraceelement2 = this.stackTrace[0]; + + if (stacktraceelement2.isNativeMethod() == p_85069_1_.isNativeMethod() && stacktraceelement2.getClassName().equals(p_85069_1_.getClassName()) && stacktraceelement2.getFileName().equals(p_85069_1_.getFileName()) && stacktraceelement2.getMethodName().equals(p_85069_1_.getMethodName())) + { + if (p_85069_2_ != null != this.stackTrace.length > 1) + { + return false; + } + else if (p_85069_2_ != null && !this.stackTrace[1].equals(p_85069_2_)) + { + return false; + } + else + { + this.stackTrace[0] = p_85069_1_; + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + /** + * Removes the given number entries from the bottom of the stack trace. + */ + public void trimStackTraceEntriesFromBottom(int p_85070_1_) + { + StackTraceElement[] astacktraceelement = new StackTraceElement[this.stackTrace.length - p_85070_1_]; + System.arraycopy(this.stackTrace, 0, astacktraceelement, 0, astacktraceelement.length); + this.stackTrace = astacktraceelement; + } + + public void appendToStringBuilder(StringBuilder p_85072_1_) + { + p_85072_1_.append("-- ").append(this.field_85076_b).append(" --\n"); + p_85072_1_.append("Details:"); + Iterator iterator = this.field_85077_c.iterator(); + + while (iterator.hasNext()) + { + CrashReportCategory.Entry entry = (CrashReportCategory.Entry)iterator.next(); + p_85072_1_.append("\n\t"); + p_85072_1_.append(entry.func_85089_a()); + p_85072_1_.append(": "); + p_85072_1_.append(entry.func_85090_b()); + } + + if (this.stackTrace != null && this.stackTrace.length > 0) + { + p_85072_1_.append("\nStacktrace:"); + StackTraceElement[] astacktraceelement = this.stackTrace; + int j = astacktraceelement.length; + + for (int i = 0; i < j; ++i) + { + StackTraceElement stacktraceelement = astacktraceelement[i]; + p_85072_1_.append("\n\tat "); + p_85072_1_.append(stacktraceelement.toString()); + } + } + } + + public StackTraceElement[] func_147152_a() + { + return this.stackTrace; + } + + public static void func_147153_a(CrashReportCategory category, final int x, final int y, final int z, final Block blockIn, final int meta) + { + final int i = Block.getIdFromBlock(blockIn); + category.addCrashSectionCallable("Block type", new Callable() + { + private static final String __OBFID = "CL_00001426"; + public String call() + { + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(i), blockIn.getUnlocalizedName(), blockIn.getClass().getCanonicalName()}); + } + catch (Throwable throwable) + { + return "ID #" + i; + } + } + }); + category.addCrashSectionCallable("Block data value", new Callable() + { + private static final String __OBFID = "CL_00001441"; + public String call() + { + if (meta < 0) + { + return "Unknown? (Got " + meta + ")"; + } + else + { + String s = String.format("%4s", new Object[] {Integer.toBinaryString(meta)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(meta), s}); + } + } + }); + category.addCrashSectionCallable("Block location", new Callable() + { + private static final String __OBFID = "CL_00001465"; + public String call() + { + return CrashReportCategory.getLocationInfo(x, y, z); + } + }); + } + + static class Entry + { + private final String field_85092_a; + private final String field_85091_b; + private static final String __OBFID = "CL_00001489"; + + public Entry(String p_i1352_1_, Object p_i1352_2_) + { + this.field_85092_a = p_i1352_1_; + + if (p_i1352_2_ == null) + { + this.field_85091_b = "~~NULL~~"; + } + else if (p_i1352_2_ instanceof Throwable) + { + Throwable throwable = (Throwable)p_i1352_2_; + this.field_85091_b = "~~ERROR~~ " + throwable.getClass().getSimpleName() + ": " + throwable.getMessage(); + } + else + { + this.field_85091_b = p_i1352_2_.toString(); + } + } + + public String func_85089_a() + { + return this.field_85092_a; + } + + public String func_85090_b() + { + return this.field_85091_b; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/creativetab/CreativeTabs.java b/build/rfg/minecraft-src/java/net/minecraft/creativetab/CreativeTabs.java new file mode 100644 index 0000000..9ba5296 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/creativetab/CreativeTabs.java @@ -0,0 +1,404 @@ +package net.minecraft.creativetab; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public abstract class CreativeTabs +{ + public static CreativeTabs[] creativeTabArray = new CreativeTabs[12]; + public static final CreativeTabs tabBlock = new CreativeTabs(0, "buildingBlocks") + { + private static final String __OBFID = "CL_00000006"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.brick_block); + } + }; + public static final CreativeTabs tabDecorations = new CreativeTabs(1, "decorations") + { + private static final String __OBFID = "CL_00000010"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.double_plant); + } + @SideOnly(Side.CLIENT) + public int func_151243_f() + { + return 5; + } + }; + public static final CreativeTabs tabRedstone = new CreativeTabs(2, "redstone") + { + private static final String __OBFID = "CL_00000011"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.redstone; + } + }; + public static final CreativeTabs tabTransport = new CreativeTabs(3, "transportation") + { + private static final String __OBFID = "CL_00000012"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.golden_rail); + } + }; + public static final CreativeTabs tabMisc = (new CreativeTabs(4, "misc") + { + private static final String __OBFID = "CL_00000014"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.lava_bucket; + } + }).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.all}); + public static final CreativeTabs tabAllSearch = (new CreativeTabs(5, "search") + { + private static final String __OBFID = "CL_00000015"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.compass; + } + }).setBackgroundImageName("item_search.png"); + public static final CreativeTabs tabFood = new CreativeTabs(6, "food") + { + private static final String __OBFID = "CL_00000016"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.apple; + } + }; + public static final CreativeTabs tabTools = (new CreativeTabs(7, "tools") + { + private static final String __OBFID = "CL_00000017"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.iron_axe; + } + }).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.digger, EnumEnchantmentType.fishing_rod, EnumEnchantmentType.breakable}); + public static final CreativeTabs tabCombat = (new CreativeTabs(8, "combat") + { + private static final String __OBFID = "CL_00000018"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.golden_sword; + } + }).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon}); + public static final CreativeTabs tabBrewing = new CreativeTabs(9, "brewing") + { + private static final String __OBFID = "CL_00000007"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.potionitem; + } + }; + public static final CreativeTabs tabMaterials = new CreativeTabs(10, "materials") + { + private static final String __OBFID = "CL_00000008"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Items.stick; + } + }; + public static final CreativeTabs tabInventory = (new CreativeTabs(11, "inventory") + { + private static final String __OBFID = "CL_00000009"; + @SideOnly(Side.CLIENT) + public Item getTabIconItem() + { + return Item.getItemFromBlock(Blocks.chest); + } + }).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); + private final int tabIndex; + private final String tabLabel; + /** Texture to use. */ + private String backgroundImageName = "items.png"; + private boolean hasScrollbar = true; + /** Whether to draw the title in the foreground of the creative GUI */ + private boolean drawTitle = true; + private EnumEnchantmentType[] field_111230_s; + @SideOnly(Side.CLIENT) + private ItemStack field_151245_t; + private static final String __OBFID = "CL_00000005"; + + public CreativeTabs(String lable) + { + this(getNextID(), lable); + } + + public CreativeTabs(int index, String label) + { + if (index >= creativeTabArray.length) + { + CreativeTabs[] tmp = new CreativeTabs[index + 1]; + for (int x = 0; x < creativeTabArray.length; x++) + { + tmp[x] = creativeTabArray[x]; + } + creativeTabArray = tmp; + } + this.tabIndex = index; + this.tabLabel = label; + creativeTabArray[index] = this; + } + + @SideOnly(Side.CLIENT) + public int getTabIndex() + { + return this.tabIndex; + } + + public CreativeTabs setBackgroundImageName(String texture) + { + this.backgroundImageName = texture; + return this; + } + + @SideOnly(Side.CLIENT) + public String getTabLabel() + { + return this.tabLabel; + } + + /** + * Gets the translated Label. + */ + @SideOnly(Side.CLIENT) + public String getTranslatedTabLabel() + { + return "itemGroup." + this.getTabLabel(); + } + + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + if (this.field_151245_t == null) + { + this.field_151245_t = new ItemStack(this.getTabIconItem(), 1, this.func_151243_f()); + } + + return this.field_151245_t; + } + + @SideOnly(Side.CLIENT) + public abstract Item getTabIconItem(); + + @SideOnly(Side.CLIENT) + public int func_151243_f() + { + return 0; + } + + @SideOnly(Side.CLIENT) + public String getBackgroundImageName() + { + return this.backgroundImageName; + } + + @SideOnly(Side.CLIENT) + public boolean drawInForegroundOfTab() + { + return this.drawTitle; + } + + public CreativeTabs setNoTitle() + { + this.drawTitle = false; + return this; + } + + @SideOnly(Side.CLIENT) + public boolean shouldHidePlayerInventory() + { + return this.hasScrollbar; + } + + public CreativeTabs setNoScrollbar() + { + this.hasScrollbar = false; + return this; + } + + /** + * returns index % 6 + */ + @SideOnly(Side.CLIENT) + public int getTabColumn() + { + if (tabIndex > 11) + { + return ((tabIndex - 12) % 10) % 5; + } + return this.tabIndex % 6; + } + + /** + * returns tabIndex < 6 + */ + @SideOnly(Side.CLIENT) + public boolean isTabInFirstRow() + { + if (tabIndex > 11) + { + return ((tabIndex - 12) % 10) < 5; + } + return this.tabIndex < 6; + } + + @SideOnly(Side.CLIENT) + public EnumEnchantmentType[] func_111225_m() + { + return this.field_111230_s; + } + + public CreativeTabs func_111229_a(EnumEnchantmentType ... types) + { + this.field_111230_s = types; + return this; + } + + @SideOnly(Side.CLIENT) + public boolean func_111226_a(EnumEnchantmentType p_111226_1_) + { + if (this.field_111230_s == null) + { + return false; + } + else + { + EnumEnchantmentType[] aenumenchantmenttype = this.field_111230_s; + int i = aenumenchantmenttype.length; + + for (int j = 0; j < i; ++j) + { + EnumEnchantmentType enumenchantmenttype1 = aenumenchantmenttype[j]; + + if (enumenchantmenttype1 == p_111226_1_) + { + return true; + } + } + + return false; + } + } + + /** + * only shows items which have tabToDisplayOn == this + */ + @SideOnly(Side.CLIENT) + public void displayAllReleventItems(List p_78018_1_) + { + Iterator iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item == null) + { + continue; + } + + for (CreativeTabs tab : item.getCreativeTabs()) + { + if (tab == this) + { + item.getSubItems(item, this, p_78018_1_); + } + } + } + + if (this.func_111225_m() != null) + { + this.addEnchantmentBooksToList(p_78018_1_, this.func_111225_m()); + } + } + + /** + * Adds the enchantment books from the supplied EnumEnchantmentType to the given list. + */ + @SideOnly(Side.CLIENT) + public void addEnchantmentBooksToList(List p_92116_1_, EnumEnchantmentType ... p_92116_2_) + { + Enchantment[] aenchantment = Enchantment.enchantmentsList; + int i = aenchantment.length; + + for (int j = 0; j < i; ++j) + { + Enchantment enchantment = aenchantment[j]; + + if (enchantment != null && enchantment.type != null) + { + boolean flag = false; + + for (int k = 0; k < p_92116_2_.length && !flag; ++k) + { + if (enchantment.type == p_92116_2_[k]) + { + flag = true; + } + } + + if (flag) + { + p_92116_1_.add(Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, enchantment.getMaxLevel()))); + } + } + } + } + + public int getTabPage() + { + if (tabIndex > 11) + { + return ((tabIndex - 12) / 10) + 1; + } + return 0; + } + + public static int getNextID() + { + return creativeTabArray.length; + } + + /** + * Determines if the search bar should be shown for this tab. + * + * @return True to show the bar + */ + public boolean hasSearchBar() + { + return tabIndex == CreativeTabs.tabAllSearch.tabIndex; + } + + /** + * Gets the width of the search bar of the creative tab, use this if your + * creative tab name overflows together with a custom texture. + * + * @return The width of the search bar, 89 by default + */ + public int getSearchbarWidth() + { + return 89; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java new file mode 100644 index 0000000..4522dfe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorDefaultDispenseItem.java @@ -0,0 +1,72 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class BehaviorDefaultDispenseItem implements IBehaviorDispenseItem +{ + private static final String __OBFID = "CL_00001195"; + + /** + * Dispenses the specified ItemStack from a dispenser. + */ + public final ItemStack dispense(IBlockSource source, ItemStack stack) + { + ItemStack itemstack1 = this.dispenseStack(source, stack); + this.playDispenseSound(source); + this.spawnDispenseParticles(source, BlockDispenser.func_149937_b(source.getBlockMetadata())); + return itemstack1; + } + + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + IPosition iposition = BlockDispenser.func_149939_a(source); + ItemStack itemstack1 = stack.splitStack(1); + doDispense(source.getWorld(), itemstack1, 6, enumfacing, iposition); + return stack; + } + + public static void doDispense(World worldIn, ItemStack stack, int speed, EnumFacing p_82486_3_, IPosition position) + { + double d0 = position.getX(); + double d1 = position.getY(); + double d2 = position.getZ(); + EntityItem entityitem = new EntityItem(worldIn, d0, d1 - 0.3D, d2, stack); + double d3 = worldIn.rand.nextDouble() * 0.1D + 0.2D; + entityitem.motionX = (double)p_82486_3_.getFrontOffsetX() * d3; + entityitem.motionY = 0.20000000298023224D; + entityitem.motionZ = (double)p_82486_3_.getFrontOffsetZ() * d3; + entityitem.motionX += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + entityitem.motionY += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + entityitem.motionZ += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double)speed; + worldIn.spawnEntityInWorld(entityitem); + } + + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + + /** + * Order clients to display dispense particles from the specified block and facing. + */ + protected void spawnDispenseParticles(IBlockSource source, EnumFacing facingIn) + { + source.getWorld().playAuxSFX(2000, source.getXInt(), source.getYInt(), source.getZInt(), this.func_82488_a(facingIn)); + } + + private int func_82488_a(EnumFacing facingIn) + { + return facingIn.getFrontOffsetX() + 1 + (facingIn.getFrontOffsetZ() + 1) * 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorProjectileDispense.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorProjectileDispense.java new file mode 100644 index 0000000..fa5c2ce --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/BehaviorProjectileDispense.java @@ -0,0 +1,51 @@ +package net.minecraft.dispenser; + +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IProjectile; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem +{ + private static final String __OBFID = "CL_00001394"; + + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + World world = source.getWorld(); + IPosition iposition = BlockDispenser.func_149939_a(source); + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + IProjectile iprojectile = this.getProjectileEntity(world, iposition); + iprojectile.setThrowableHeading((double)enumfacing.getFrontOffsetX(), (double)((float)enumfacing.getFrontOffsetY() + 0.1F), (double)enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a()); + world.spawnEntityInWorld((Entity)iprojectile); + stack.splitStack(1); + return stack; + } + + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1002, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected abstract IProjectile getProjectileEntity(World worldIn, IPosition position); + + protected float func_82498_a() + { + return 6.0F; + } + + protected float func_82500_b() + { + return 1.1F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBehaviorDispenseItem.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBehaviorDispenseItem.java new file mode 100644 index 0000000..6e2adbe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBehaviorDispenseItem.java @@ -0,0 +1,23 @@ +package net.minecraft.dispenser; + +import net.minecraft.item.ItemStack; + +public interface IBehaviorDispenseItem +{ + IBehaviorDispenseItem itemDispenseBehaviorProvider = new IBehaviorDispenseItem() + { + private static final String __OBFID = "CL_00001200"; + /** + * Dispenses the specified ItemStack from a dispenser. + */ + public ItemStack dispense(IBlockSource source, ItemStack stack) + { + return stack; + } + }; + + /** + * Dispenses the specified ItemStack from a dispenser. + */ + ItemStack dispense(IBlockSource source, ItemStack stack); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBlockSource.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBlockSource.java new file mode 100644 index 0000000..93ecac8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IBlockSource.java @@ -0,0 +1,22 @@ +package net.minecraft.dispenser; + +import net.minecraft.tileentity.TileEntity; + +public interface IBlockSource extends ILocatableSource +{ + double getX(); + + double getY(); + + double getZ(); + + int getXInt(); + + int getYInt(); + + int getZInt(); + + int getBlockMetadata(); + + TileEntity getBlockTileEntity(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocatableSource.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocatableSource.java new file mode 100644 index 0000000..ce7bf95 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocatableSource.java @@ -0,0 +1,5 @@ +package net.minecraft.dispenser; + +public interface ILocatableSource extends ILocation +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocation.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocation.java new file mode 100644 index 0000000..0a09078 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/ILocation.java @@ -0,0 +1,8 @@ +package net.minecraft.dispenser; + +import net.minecraft.world.World; + +public interface ILocation extends IPosition +{ + World getWorld(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/IPosition.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IPosition.java new file mode 100644 index 0000000..b6602d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/IPosition.java @@ -0,0 +1,10 @@ +package net.minecraft.dispenser; + +public interface IPosition +{ + double getX(); + + double getY(); + + double getZ(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/dispenser/PositionImpl.java b/build/rfg/minecraft-src/java/net/minecraft/dispenser/PositionImpl.java new file mode 100644 index 0000000..8c976ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/dispenser/PositionImpl.java @@ -0,0 +1,31 @@ +package net.minecraft.dispenser; + +public class PositionImpl implements IPosition +{ + protected final double x; + protected final double y; + protected final double z; + private static final String __OBFID = "CL_00001208"; + + public PositionImpl(double xCoord, double yCoord, double zCoord) + { + this.x = xCoord; + this.y = yCoord; + this.z = zCoord; + } + + public double getX() + { + return this.x; + } + + public double getY() + { + return this.y; + } + + public double getZ() + { + return this.z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/Enchantment.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/Enchantment.java new file mode 100644 index 0000000..fd24616 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/Enchantment.java @@ -0,0 +1,241 @@ +package net.minecraft.enchantment; + +import java.util.ArrayList; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StatCollector; + +public abstract class Enchantment +{ + public static final Enchantment[] enchantmentsList = new Enchantment[256]; + /** The list of enchantments applicable by the anvil from a book */ + public static final Enchantment[] enchantmentsBookList; + /** Converts environmental damage to armour damage */ + public static final Enchantment protection = new EnchantmentProtection(0, 10, 0); + /** Protection against fire */ + public static final Enchantment fireProtection = new EnchantmentProtection(1, 5, 1); + /** Less fall damage */ + public static final Enchantment featherFalling = new EnchantmentProtection(2, 5, 2); + /** Protection against explosions */ + public static final Enchantment blastProtection = new EnchantmentProtection(3, 2, 3); + /** Protection against projectile entities (e.g. arrows) */ + public static final Enchantment projectileProtection = new EnchantmentProtection(4, 5, 4); + /** Decreases the rate of air loss underwater; increases time between damage while suffocating */ + public static final Enchantment respiration = new EnchantmentOxygen(5, 2); + /** Increases underwater mining rate */ + public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, 2); + public static final Enchantment thorns = new EnchantmentThorns(7, 1); + /** Extra damage to mobs */ + public static final Enchantment sharpness = new EnchantmentDamage(16, 10, 0); + /** Extra damage to zombies, zombie pigmen and skeletons */ + public static final Enchantment smite = new EnchantmentDamage(17, 5, 1); + /** Extra damage to spiders, cave spiders and silverfish */ + public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, 5, 2); + /** Knocks mob and players backwards upon hit */ + public static final Enchantment knockback = new EnchantmentKnockback(19, 5); + /** Lights mobs on fire */ + public static final Enchantment fireAspect = new EnchantmentFireAspect(20, 2); + /** Mobs have a chance to drop more loot */ + public static final Enchantment looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon); + /** Faster resource gathering while in use */ + public static final Enchantment efficiency = new EnchantmentDigging(32, 10); + /** + * Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not + * cobblestone) + */ + public static final Enchantment silkTouch = new EnchantmentUntouching(33, 1); + /** Sometimes, the tool's durability will not be spent when the tool is used */ + public static final Enchantment unbreaking = new EnchantmentDurability(34, 5); + /** Can multiply the drop rate of items from blocks */ + public static final Enchantment fortune = new EnchantmentLootBonus(35, 2, EnumEnchantmentType.digger); + /** Power enchantment for bows, add's extra damage to arrows. */ + public static final Enchantment power = new EnchantmentArrowDamage(48, 10); + /** Knockback enchantments for bows, the arrows will knockback the target when hit. */ + public static final Enchantment punch = new EnchantmentArrowKnockback(49, 2); + /** Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire. */ + public static final Enchantment flame = new EnchantmentArrowFire(50, 2); + /** + * Infinity enchantment for bows. The bow will not consume arrows anymore, but will still required at least one + * arrow on inventory use the bow. + */ + public static final Enchantment infinity = new EnchantmentArrowInfinite(51, 1); + public static final Enchantment field_151370_z = new EnchantmentLootBonus(61, 2, EnumEnchantmentType.fishing_rod); + public static final Enchantment field_151369_A = new EnchantmentFishingSpeed(62, 2, EnumEnchantmentType.fishing_rod); + public final int effectId; + private final int weight; + /** The EnumEnchantmentType given to this Enchantment. */ + public EnumEnchantmentType type; + /** Used in localisation and stats. */ + protected String name; + private static final String __OBFID = "CL_00000105"; + + protected Enchantment(int p_i1926_1_, int p_i1926_2_, EnumEnchantmentType p_i1926_3_) + { + this.effectId = p_i1926_1_; + this.weight = p_i1926_2_; + this.type = p_i1926_3_; + + if (enchantmentsList[p_i1926_1_] != null) + { + throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + enchantmentsList[p_i1926_1_].getClass() + " Enchantment ID:" + p_i1926_1_); + } + else + { + enchantmentsList[p_i1926_1_] = this; + } + } + + public int getWeight() + { + return this.weight; + } + + /** + * Returns the minimum level that the enchantment can have. + */ + public int getMinLevel() + { + return 1; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 1 + p_77321_1_ * 10; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + 5; + } + + /** + * Calculates de damage protection of the enchantment based on level and damage source passed. + */ + public int calcModifierDamage(int p_77318_1_, DamageSource p_77318_2_) + { + return 0; + } + + public float func_152376_a(int p_152376_1_, EnumCreatureAttribute p_152376_2_) + { + return 0.0F; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) + { + return this != p_77326_1_; + } + + /** + * Sets the enchantment name + */ + public Enchantment setName(String p_77322_1_) + { + this.name = p_77322_1_; + return this; + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() + { + return "enchantment." + this.name; + } + + /** + * Returns the correct traslated name of the enchantment and the level in roman numbers. + */ + public String getTranslatedName(int p_77316_1_) + { + String s = StatCollector.translateToLocal(this.getName()); + return s + " " + StatCollector.translateToLocal("enchantment.level." + p_77316_1_); + } + + public boolean canApply(ItemStack p_92089_1_) + { + return this.type.canEnchantItem(p_92089_1_.getItem()); + } + + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) {} + + public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) {} + + /** + * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} + * applies for all possible enchantments. + * @param stack + * @return + */ + public boolean canApplyAtEnchantingTable(ItemStack stack) + { + return canApply(stack); + } + + private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; + /** + * Add to the list of enchantments applicable by the anvil from a book + * + * @param enchantment + */ + public static void addToBookList(Enchantment enchantment) + { + try + { + net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, + com.google.common.collect.ObjectArrays.concat(enchantmentsBookList, enchantment)); + } + catch (Exception e) + { + throw new RuntimeException(e); //Rethrow see what happens + } + } + + /** + * Is this enchantment allowed to be enchanted on books via Enchantment Table + * @return false to disable the vanilla feature + */ + public boolean isAllowedOnBooks() + { + return true; + } + + static + { + ArrayList var0 = new ArrayList(); + Enchantment[] var1 = enchantmentsList; + int var2 = var1.length; + + for (int var3 = 0; var3 < var2; ++var3) + { + Enchantment var4 = var1[var3]; + + if (var4 != null) + { + var0.add(var4); + } + } + + enchantmentsBookList = (Enchantment[])var0.toArray(new Enchantment[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowDamage.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowDamage.java new file mode 100644 index 0000000..a4c723f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowDamage.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowDamage extends Enchantment +{ + private static final String __OBFID = "CL_00000098"; + + public EnchantmentArrowDamage(int p_i1919_1_, int p_i1919_2_) + { + super(p_i1919_1_, p_i1919_2_, EnumEnchantmentType.bow); + this.setName("arrowDamage"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 1 + (p_77321_1_ - 1) * 10; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + 15; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 5; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowFire.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowFire.java new file mode 100644 index 0000000..5eb03ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowFire.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowFire extends Enchantment +{ + private static final String __OBFID = "CL_00000099"; + + public EnchantmentArrowFire(int p_i1920_1_, int p_i1920_2_) + { + super(p_i1920_1_, p_i1920_2_, EnumEnchantmentType.bow); + this.setName("arrowFire"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java new file mode 100644 index 0000000..592f2f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowInfinite.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowInfinite extends Enchantment +{ + private static final String __OBFID = "CL_00000100"; + + public EnchantmentArrowInfinite(int p_i1921_1_, int p_i1921_2_) + { + super(p_i1921_1_, p_i1921_2_, EnumEnchantmentType.bow); + this.setName("arrowInfinite"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java new file mode 100644 index 0000000..0df03c8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentArrowKnockback.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentArrowKnockback extends Enchantment +{ + private static final String __OBFID = "CL_00000101"; + + public EnchantmentArrowKnockback(int p_i1922_1_, int p_i1922_2_) + { + super(p_i1922_1_, p_i1922_2_, EnumEnchantmentType.bow); + this.setName("arrowKnockback"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 12 + (p_77321_1_ - 1) * 20; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + 25; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDamage.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDamage.java new file mode 100644 index 0000000..897161a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDamage.java @@ -0,0 +1,97 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class EnchantmentDamage extends Enchantment +{ + /** Holds the name to be translated of each protection type. */ + private static final String[] protectionName = new String[] {"all", "undead", "arthropods"}; + /** Holds the base factor of enchantability needed to be able to use the enchant. */ + private static final int[] baseEnchantability = new int[] {1, 5, 5}; + /** Holds how much each level increased the enchantability factor to be able to use this enchant. */ + private static final int[] levelEnchantability = new int[] {11, 8, 8}; + /** + * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing + * enchant. + */ + private static final int[] thresholdEnchantability = new int[] {20, 20, 20}; + /** Defines the type of damage of the enchantment, 0 = all, 1 = undead, 3 = arthropods */ + public final int damageType; + private static final String __OBFID = "CL_00000102"; + + public EnchantmentDamage(int p_i1923_1_, int p_i1923_2_, int p_i1923_3_) + { + super(p_i1923_1_, p_i1923_2_, EnumEnchantmentType.weapon); + this.damageType = p_i1923_3_; + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return baseEnchantability[this.damageType] + (p_77321_1_ - 1) * levelEnchantability[this.damageType]; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + thresholdEnchantability[this.damageType]; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 5; + } + + public float func_152376_a(int p_152376_1_, EnumCreatureAttribute p_152376_2_) + { + return this.damageType == 0 ? (float)p_152376_1_ * 1.25F : (this.damageType == 1 && p_152376_2_ == EnumCreatureAttribute.UNDEAD ? (float)p_152376_1_ * 2.5F : (this.damageType == 2 && p_152376_2_ == EnumCreatureAttribute.ARTHROPOD ? (float)p_152376_1_ * 2.5F : 0.0F)); + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() + { + return "enchantment.damage." + protectionName[this.damageType]; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) + { + return !(p_77326_1_ instanceof EnchantmentDamage); + } + + public boolean canApply(ItemStack p_92089_1_) + { + return p_92089_1_.getItem() instanceof ItemAxe ? true : super.canApply(p_92089_1_); + } + + public void func_151368_a(EntityLivingBase p_151368_1_, Entity p_151368_2_, int p_151368_3_) + { + if (p_151368_2_ instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase1 = (EntityLivingBase)p_151368_2_; + + if (this.damageType == 2 && entitylivingbase1.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) + { + int j = 20 + p_151368_1_.getRNG().nextInt(10 * p_151368_3_); + entitylivingbase1.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, j, 3)); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentData.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentData.java new file mode 100644 index 0000000..97717f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentData.java @@ -0,0 +1,24 @@ +package net.minecraft.enchantment; + +import net.minecraft.util.WeightedRandom; + +public class EnchantmentData extends WeightedRandom.Item +{ + /** Enchantment object associated with this EnchantmentData */ + public final Enchantment enchantmentobj; + /** Enchantment level associated with this EnchantmentData */ + public final int enchantmentLevel; + private static final String __OBFID = "CL_00000115"; + + public EnchantmentData(Enchantment p_i1930_1_, int p_i1930_2_) + { + super(p_i1930_1_.getWeight()); + this.enchantmentobj = p_i1930_1_; + this.enchantmentLevel = p_i1930_2_; + } + + public EnchantmentData(int p_i1931_1_, int p_i1931_2_) + { + this(Enchantment.enchantmentsList[p_i1931_1_], p_i1931_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDigging.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDigging.java new file mode 100644 index 0000000..2a70e63 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDigging.java @@ -0,0 +1,44 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class EnchantmentDigging extends Enchantment +{ + private static final String __OBFID = "CL_00000104"; + + protected EnchantmentDigging(int p_i1925_1_, int p_i1925_2_) + { + super(p_i1925_1_, p_i1925_2_, EnumEnchantmentType.digger); + this.setName("digging"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 1 + 10 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 5; + } + + public boolean canApply(ItemStack p_92089_1_) + { + return p_92089_1_.getItem() == Items.shears ? true : super.canApply(p_92089_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDurability.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDurability.java new file mode 100644 index 0000000..9332204 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentDurability.java @@ -0,0 +1,55 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; + +public class EnchantmentDurability extends Enchantment +{ + private static final String __OBFID = "CL_00000103"; + + protected EnchantmentDurability(int p_i1924_1_, int p_i1924_2_) + { + super(p_i1924_1_, p_i1924_2_, EnumEnchantmentType.breakable); + this.setName("durability"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 5 + (p_77321_1_ - 1) * 8; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 3; + } + + public boolean canApply(ItemStack p_92089_1_) + { + return p_92089_1_.isItemStackDamageable() ? true : super.canApply(p_92089_1_); + } + + /** + * Used by ItemStack.attemptDamageItem. Randomly determines if a point of damage should be negated using the + * enchantment level (par1). If the ItemStack is Armor then there is a flat 60% chance for damage to be negated no + * matter the enchantment level, otherwise there is a 1-(par/1) chance for damage to be negated. + */ + public static boolean negateDamage(ItemStack p_92097_0_, int p_92097_1_, Random p_92097_2_) + { + return p_92097_0_.getItem() instanceof ItemArmor && p_92097_2_.nextFloat() < 0.6F ? false : p_92097_2_.nextInt(p_92097_1_ + 1) > 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFireAspect.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFireAspect.java new file mode 100644 index 0000000..4bbd0e3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFireAspect.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentFireAspect extends Enchantment +{ + private static final String __OBFID = "CL_00000116"; + + protected EnchantmentFireAspect(int p_i1932_1_, int p_i1932_2_) + { + super(p_i1932_1_, p_i1932_2_, EnumEnchantmentType.weapon); + this.setName("fire"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 10 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java new file mode 100644 index 0000000..069d4e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentFishingSpeed.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentFishingSpeed extends Enchantment +{ + private static final String __OBFID = "CL_00000117"; + + protected EnchantmentFishingSpeed(int p_i45361_1_, int p_i45361_2_, EnumEnchantmentType p_i45361_3_) + { + super(p_i45361_1_, p_i45361_2_, p_i45361_3_); + this.setName("fishingSpeed"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 15 + (p_77321_1_ - 1) * 9; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentHelper.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentHelper.java new file mode 100644 index 0000000..dc7fb88 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentHelper.java @@ -0,0 +1,632 @@ +package net.minecraft.enchantment; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.WeightedRandom; + +public class EnchantmentHelper +{ + /** Is the random seed of enchantment effects. */ + private static final Random enchantmentRand = new Random(); + /** Used to calculate the extra armor of enchantments on armors equipped on player. */ + private static final EnchantmentHelper.ModifierDamage enchantmentModifierDamage = new EnchantmentHelper.ModifierDamage(null); + /** Used to calculate the (magic) extra damage done by enchantments on current equipped item of player. */ + private static final EnchantmentHelper.ModifierLiving enchantmentModifierLiving = new EnchantmentHelper.ModifierLiving(null); + private static final EnchantmentHelper.HurtIterator field_151388_d = new EnchantmentHelper.HurtIterator(null); + private static final EnchantmentHelper.DamageIterator field_151389_e = new EnchantmentHelper.DamageIterator(null); + private static final String __OBFID = "CL_00000107"; + + /** + * Returns the level of enchantment on the ItemStack passed. + */ + public static int getEnchantmentLevel(int p_77506_0_, ItemStack p_77506_1_) + { + if (p_77506_1_ == null) + { + return 0; + } + else + { + NBTTagList nbttaglist = p_77506_1_.getEnchantmentTagList(); + + if (nbttaglist == null) + { + return 0; + } + else + { + for (int j = 0; j < nbttaglist.tagCount(); ++j) + { + short short1 = nbttaglist.getCompoundTagAt(j).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(j).getShort("lvl"); + + if (short1 == p_77506_0_) + { + return short2; + } + } + + return 0; + } + } + } + + /** + * Return the enchantments for the specified stack. + */ + public static Map getEnchantments(ItemStack p_82781_0_) + { + LinkedHashMap linkedhashmap = new LinkedHashMap(); + NBTTagList nbttaglist = p_82781_0_.getItem() == Items.enchanted_book ? Items.enchanted_book.func_92110_g(p_82781_0_) : p_82781_0_.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + linkedhashmap.put(Integer.valueOf(short1), Integer.valueOf(short2)); + } + } + + return linkedhashmap; + } + + /** + * Set the enchantments for the specified stack. + */ + public static void setEnchantments(Map p_82782_0_, ItemStack p_82782_1_) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = p_82782_0_.keySet().iterator(); + + while (iterator.hasNext()) + { + int i = ((Integer)iterator.next()).intValue(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short)i); + nbttagcompound.setShort("lvl", (short)((Integer)p_82782_0_.get(Integer.valueOf(i))).intValue()); + nbttaglist.appendTag(nbttagcompound); + + if (p_82782_1_.getItem() == Items.enchanted_book) + { + Items.enchanted_book.addEnchantment(p_82782_1_, new EnchantmentData(i, ((Integer)p_82782_0_.get(Integer.valueOf(i))).intValue())); + } + } + + if (nbttaglist.tagCount() > 0) + { + if (p_82782_1_.getItem() != Items.enchanted_book) + { + p_82782_1_.setTagInfo("ench", nbttaglist); + } + } + else if (p_82782_1_.hasTagCompound()) + { + p_82782_1_.getTagCompound().removeTag("ench"); + } + } + + /** + * Returns the biggest level of the enchantment on the array of ItemStack passed. + */ + public static int getMaxEnchantmentLevel(int p_77511_0_, ItemStack[] p_77511_1_) + { + if (p_77511_1_ == null) + { + return 0; + } + else + { + int j = 0; + ItemStack[] aitemstack1 = p_77511_1_; + int k = p_77511_1_.length; + + for (int l = 0; l < k; ++l) + { + ItemStack itemstack = aitemstack1[l]; + int i1 = getEnchantmentLevel(p_77511_0_, itemstack); + + if (i1 > j) + { + j = i1; + } + } + + return j; + } + } + + /** + * Executes the enchantment modifier on the ItemStack passed. + */ + private static void applyEnchantmentModifier(EnchantmentHelper.IModifier p_77518_0_, ItemStack p_77518_1_) + { + if (p_77518_1_ != null) + { + NBTTagList nbttaglist = p_77518_1_.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (Enchantment.enchantmentsList[short1] != null) + { + p_77518_0_.calculateModifier(Enchantment.enchantmentsList[short1], short2); + } + } + } + } + } + + /** + * Executes the enchantment modifier on the array of ItemStack passed. + */ + private static void applyEnchantmentModifierArray(EnchantmentHelper.IModifier p_77516_0_, ItemStack[] p_77516_1_) + { + ItemStack[] aitemstack1 = p_77516_1_; + int i = p_77516_1_.length; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = aitemstack1[j]; + applyEnchantmentModifier(p_77516_0_, itemstack); + } + } + + /** + * Returns the modifier of protection enchantments on armors equipped on player. + */ + public static int getEnchantmentModifierDamage(ItemStack[] p_77508_0_, DamageSource p_77508_1_) + { + enchantmentModifierDamage.damageModifier = 0; + enchantmentModifierDamage.source = p_77508_1_; + applyEnchantmentModifierArray(enchantmentModifierDamage, p_77508_0_); + + if (enchantmentModifierDamage.damageModifier > 25) + { + enchantmentModifierDamage.damageModifier = 25; + } + + return (enchantmentModifierDamage.damageModifier + 1 >> 1) + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); + } + + /** + * Return the (magic) extra damage of the enchantments on player equipped item. + */ + public static float getEnchantmentModifierLiving(EntityLivingBase p_77512_0_, EntityLivingBase p_77512_1_) + { + return func_152377_a(p_77512_0_.getHeldItem(), p_77512_1_.getCreatureAttribute()); + } + + public static float func_152377_a(ItemStack p_152377_0_, EnumCreatureAttribute p_152377_1_) + { + enchantmentModifierLiving.livingModifier = 0.0F; + enchantmentModifierLiving.entityLiving = p_152377_1_; + applyEnchantmentModifier(enchantmentModifierLiving, p_152377_0_); + return enchantmentModifierLiving.livingModifier; + } + + public static void func_151384_a(EntityLivingBase p_151384_0_, Entity p_151384_1_) + { + field_151388_d.field_151363_b = p_151384_1_; + field_151388_d.field_151364_a = p_151384_0_; + applyEnchantmentModifierArray(field_151388_d, p_151384_0_.getLastActiveItems()); + + if (p_151384_1_ instanceof EntityPlayer) + { + applyEnchantmentModifier(field_151388_d, p_151384_0_.getHeldItem()); + } + } + + public static void func_151385_b(EntityLivingBase p_151385_0_, Entity p_151385_1_) + { + field_151389_e.field_151366_a = p_151385_0_; + field_151389_e.field_151365_b = p_151385_1_; + applyEnchantmentModifierArray(field_151389_e, p_151385_0_.getLastActiveItems()); + + if (p_151385_0_ instanceof EntityPlayer) + { + applyEnchantmentModifier(field_151389_e, p_151385_0_.getHeldItem()); + } + } + + /** + * Returns the knockback value of enchantments on equipped player item. + */ + public static int getKnockbackModifier(EntityLivingBase p_77507_0_, EntityLivingBase p_77507_1_) + { + return getEnchantmentLevel(Enchantment.knockback.effectId, p_77507_0_.getHeldItem()); + } + + public static int getFireAspectModifier(EntityLivingBase p_90036_0_) + { + return getEnchantmentLevel(Enchantment.fireAspect.effectId, p_90036_0_.getHeldItem()); + } + + /** + * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. + */ + public static int getRespiration(EntityLivingBase p_77501_0_) + { + return getMaxEnchantmentLevel(Enchantment.respiration.effectId, p_77501_0_.getLastActiveItems()); + } + + /** + * Return the extra efficiency of tools based on enchantments on equipped player item. + */ + public static int getEfficiencyModifier(EntityLivingBase p_77509_0_) + { + return getEnchantmentLevel(Enchantment.efficiency.effectId, p_77509_0_.getHeldItem()); + } + + /** + * Returns the silk touch status of enchantments on current equipped item of player. + */ + public static boolean getSilkTouchModifier(EntityLivingBase p_77502_0_) + { + return getEnchantmentLevel(Enchantment.silkTouch.effectId, p_77502_0_.getHeldItem()) > 0; + } + + /** + * Returns the fortune enchantment modifier of the current equipped item of player. + */ + public static int getFortuneModifier(EntityLivingBase p_77517_0_) + { + return getEnchantmentLevel(Enchantment.fortune.effectId, p_77517_0_.getHeldItem()); + } + + public static int func_151386_g(EntityLivingBase p_151386_0_) + { + return getEnchantmentLevel(Enchantment.field_151370_z.effectId, p_151386_0_.getHeldItem()); + } + + public static int func_151387_h(EntityLivingBase p_151387_0_) + { + return getEnchantmentLevel(Enchantment.field_151369_A.effectId, p_151387_0_.getHeldItem()); + } + + /** + * Returns the looting enchantment modifier of the current equipped item of player. + */ + public static int getLootingModifier(EntityLivingBase p_77519_0_) + { + return getEnchantmentLevel(Enchantment.looting.effectId, p_77519_0_.getHeldItem()); + } + + /** + * Returns the aqua affinity status of enchantments on current equipped item of player. + */ + public static boolean getAquaAffinityModifier(EntityLivingBase p_77510_0_) + { + return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, p_77510_0_.getLastActiveItems()) > 0; + } + + public static ItemStack func_92099_a(Enchantment p_92099_0_, EntityLivingBase p_92099_1_) + { + ItemStack[] aitemstack = p_92099_1_.getLastActiveItems(); + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = aitemstack[j]; + + if (itemstack != null && getEnchantmentLevel(p_92099_0_.effectId, itemstack) > 0) + { + return itemstack; + } + } + + return null; + } + + /** + * Returns the enchantability of itemstack, it's uses a singular formula for each index (2nd parameter: 0, 1 and 2), + * cutting to the max enchantability power of the table (3rd parameter) + */ + public static int calcItemStackEnchantability(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) + { + Item item = p_77514_3_.getItem(); + int k = item.getItemEnchantability(p_77514_3_); + + if (k <= 0) + { + return 0; + } + else + { + if (p_77514_2_ > 15) + { + p_77514_2_ = 15; + } + + int l = p_77514_0_.nextInt(8) + 1 + (p_77514_2_ >> 1) + p_77514_0_.nextInt(p_77514_2_ + 1); + return p_77514_1_ == 0 ? Math.max(l / 3, 1) : (p_77514_1_ == 1 ? l * 2 / 3 + 1 : Math.max(l, p_77514_2_ * 2)); + } + } + + /** + * Adds a random enchantment to the specified item. Args: random, itemStack, enchantabilityLevel + */ + public static ItemStack addRandomEnchantment(Random p_77504_0_, ItemStack p_77504_1_, int p_77504_2_) + { + List list = buildEnchantmentList(p_77504_0_, p_77504_1_, p_77504_2_); + boolean flag = p_77504_1_.getItem() == Items.book; + + if (flag) + { + p_77504_1_.func_150996_a(Items.enchanted_book); + } + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EnchantmentData enchantmentdata = (EnchantmentData)iterator.next(); + + if (flag) + { + Items.enchanted_book.addEnchantment(p_77504_1_, enchantmentdata); + } + else + { + p_77504_1_.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + } + + return p_77504_1_; + } + + /** + * Create a list of random EnchantmentData (enchantments) that can be added together to the ItemStack, the 3rd + * parameter is the total enchantability level. + */ + public static List buildEnchantmentList(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) + { + Item item = p_77513_1_.getItem(); + int j = item.getItemEnchantability(p_77513_1_); + + if (j <= 0) + { + return null; + } + else + { + j /= 2; + j = 1 + p_77513_0_.nextInt((j >> 1) + 1) + p_77513_0_.nextInt((j >> 1) + 1); + int k = j + p_77513_2_; + float f = (p_77513_0_.nextFloat() + p_77513_0_.nextFloat() - 1.0F) * 0.15F; + int l = (int)((float)k * (1.0F + f) + 0.5F); + + if (l < 1) + { + l = 1; + } + + ArrayList arraylist = null; + Map map = mapEnchantmentData(l, p_77513_1_); + + if (map != null && !map.isEmpty()) + { + EnchantmentData enchantmentdata = (EnchantmentData)WeightedRandom.getRandomItem(p_77513_0_, map.values()); + + if (enchantmentdata != null) + { + arraylist = new ArrayList(); + arraylist.add(enchantmentdata); + + for (int i1 = l; p_77513_0_.nextInt(50) <= i1; i1 >>= 1) + { + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = (Integer)iterator.next(); + boolean flag = true; + Iterator iterator1 = arraylist.iterator(); + + while (true) + { + if (iterator1.hasNext()) + { + EnchantmentData enchantmentdata1 = (EnchantmentData)iterator1.next(); + + Enchantment e1 = enchantmentdata1.enchantmentobj; + Enchantment e2 = Enchantment.enchantmentsList[integer.intValue()]; + if (e1.canApplyTogether(e2) && e2.canApplyTogether(e1)) //Forge BugFix: Let Both enchantments veto being together + { + continue; + } + + flag = false; + } + + if (!flag) + { + iterator.remove(); + } + + break; + } + } + + if (!map.isEmpty()) + { + EnchantmentData enchantmentdata2 = (EnchantmentData)WeightedRandom.getRandomItem(p_77513_0_, map.values()); + arraylist.add(enchantmentdata2); + } + } + } + } + + return arraylist; + } + } + + /** + * Creates a 'Map' of EnchantmentData (enchantments) possible to add on the ItemStack and the enchantability level + * passed. + */ + public static Map mapEnchantmentData(int p_77505_0_, ItemStack p_77505_1_) + { + Item item = p_77505_1_.getItem(); + HashMap hashmap = null; + boolean flag = p_77505_1_.getItem() == Items.book; + Enchantment[] aenchantment = Enchantment.enchantmentsList; + int j = aenchantment.length; + + for (int k = 0; k < j; ++k) + { + Enchantment enchantment = aenchantment[k]; + + if (enchantment == null) continue; + if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || ((item == Items.book) && enchantment.isAllowedOnBooks())) + { + for (int l = enchantment.getMinLevel(); l <= enchantment.getMaxLevel(); ++l) + { + if (p_77505_0_ >= enchantment.getMinEnchantability(l) && p_77505_0_ <= enchantment.getMaxEnchantability(l)) + { + if (hashmap == null) + { + hashmap = new HashMap(); + } + + hashmap.put(Integer.valueOf(enchantment.effectId), new EnchantmentData(enchantment, l)); + } + } + } + } + + return hashmap; + } + + static final class DamageIterator implements EnchantmentHelper.IModifier + { + public EntityLivingBase field_151366_a; + public Entity field_151365_b; + private static final String __OBFID = "CL_00000109"; + + private DamageIterator() {} + + /** + * Generic method use to calculate modifiers of offensive or defensive enchantment values. + */ + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) + { + p_77493_1_.func_151368_a(this.field_151366_a, this.field_151365_b, p_77493_2_); + } + + DamageIterator(Object p_i45359_1_) + { + this(); + } + } + + static final class HurtIterator implements EnchantmentHelper.IModifier + { + public EntityLivingBase field_151364_a; + public Entity field_151363_b; + private static final String __OBFID = "CL_00000110"; + + private HurtIterator() {} + + /** + * Generic method use to calculate modifiers of offensive or defensive enchantment values. + */ + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) + { + p_77493_1_.func_151367_b(this.field_151364_a, this.field_151363_b, p_77493_2_); + } + + HurtIterator(Object p_i45360_1_) + { + this(); + } + } + + interface IModifier + { + /** + * Generic method use to calculate modifiers of offensive or defensive enchantment values. + */ + void calculateModifier(Enchantment p_77493_1_, int p_77493_2_); + } + + static final class ModifierDamage implements EnchantmentHelper.IModifier + { + /** + * Used to calculate the damage modifier (extra armor) on enchantments that the player have on equipped + * armors. + */ + public int damageModifier; + /** + * Used as parameter to calculate the damage modifier (extra armor) on enchantments that the player have on + * equipped armors. + */ + public DamageSource source; + private static final String __OBFID = "CL_00000114"; + + private ModifierDamage() {} + + /** + * Generic method use to calculate modifiers of offensive or defensive enchantment values. + */ + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) + { + this.damageModifier += p_77493_1_.calcModifierDamage(p_77493_2_, this.source); + } + + ModifierDamage(Object p_i1929_1_) + { + this(); + } + } + + static final class ModifierLiving implements EnchantmentHelper.IModifier + { + /** Used to calculate the (magic) extra damage based on enchantments of current equipped player item. */ + public float livingModifier; + /** + * Used as parameter to calculate the (magic) extra damage based on enchantments of current equipped player + * item. + */ + public EnumCreatureAttribute entityLiving; + private static final String __OBFID = "CL_00000112"; + + private ModifierLiving() {} + + /** + * Generic method use to calculate modifiers of offensive or defensive enchantment values. + */ + public void calculateModifier(Enchantment p_77493_1_, int p_77493_2_) + { + this.livingModifier += p_77493_1_.func_152376_a(p_77493_2_, this.entityLiving); + } + + ModifierLiving(Object p_i1928_1_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentKnockback.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentKnockback.java new file mode 100644 index 0000000..e9e33e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentKnockback.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentKnockback extends Enchantment +{ + private static final String __OBFID = "CL_00000118"; + + protected EnchantmentKnockback(int p_i1933_1_, int p_i1933_2_) + { + super(p_i1933_1_, p_i1933_2_, EnumEnchantmentType.weapon); + this.setName("knockback"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 5 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentLootBonus.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentLootBonus.java new file mode 100644 index 0000000..e3c53e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentLootBonus.java @@ -0,0 +1,56 @@ +package net.minecraft.enchantment; + +public class EnchantmentLootBonus extends Enchantment +{ + private static final String __OBFID = "CL_00000119"; + + protected EnchantmentLootBonus(int p_i1934_1_, int p_i1934_2_, EnumEnchantmentType p_i1934_3_) + { + super(p_i1934_1_, p_i1934_2_, p_i1934_3_); + + if (p_i1934_3_ == EnumEnchantmentType.digger) + { + this.setName("lootBonusDigger"); + } + else if (p_i1934_3_ == EnumEnchantmentType.fishing_rod) + { + this.setName("lootBonusFishing"); + } + else + { + this.setName("lootBonus"); + } + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 15 + (p_77321_1_ - 1) * 9; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 3; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) + { + return super.canApplyTogether(p_77326_1_) && p_77326_1_.effectId != silkTouch.effectId; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentOxygen.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentOxygen.java new file mode 100644 index 0000000..d622dd9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentOxygen.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentOxygen extends Enchantment +{ + private static final String __OBFID = "CL_00000120"; + + public EnchantmentOxygen(int p_i1935_1_, int p_i1935_2_) + { + super(p_i1935_1_, p_i1935_2_, EnumEnchantmentType.armor_head); + this.setName("oxygen"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 10 * p_77321_1_; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + 30; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentProtection.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentProtection.java new file mode 100644 index 0000000..6f4e99c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentProtection.java @@ -0,0 +1,128 @@ +package net.minecraft.enchantment; + +import net.minecraft.entity.Entity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; + +public class EnchantmentProtection extends Enchantment +{ + /** Holds the name to be translated of each protection type. */ + private static final String[] protectionName = new String[] {"all", "fire", "fall", "explosion", "projectile"}; + /** Holds the base factor of enchantability needed to be able to use the enchant. */ + private static final int[] baseEnchantability = new int[] {1, 10, 5, 5, 3}; + /** Holds how much each level increased the enchantability factor to be able to use this enchant. */ + private static final int[] levelEnchantability = new int[] {11, 8, 6, 8, 6}; + /** + * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing + * enchant. + */ + private static final int[] thresholdEnchantability = new int[] {20, 12, 10, 12, 15}; + /** + * Defines the type of protection of the enchantment, 0 = all, 1 = fire, 2 = fall (feather fall), 3 = explosion and + * 4 = projectile. + */ + public final int protectionType; + private static final String __OBFID = "CL_00000121"; + + public EnchantmentProtection(int p_i1936_1_, int p_i1936_2_, int p_i1936_3_) + { + super(p_i1936_1_, p_i1936_2_, EnumEnchantmentType.armor); + this.protectionType = p_i1936_3_; + + if (p_i1936_3_ == 2) + { + this.type = EnumEnchantmentType.armor_feet; + } + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return baseEnchantability[this.protectionType] + (p_77321_1_ - 1) * levelEnchantability[this.protectionType]; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + thresholdEnchantability[this.protectionType]; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 4; + } + + /** + * Calculates de damage protection of the enchantment based on level and damage source passed. + */ + public int calcModifierDamage(int p_77318_1_, DamageSource p_77318_2_) + { + if (p_77318_2_.canHarmInCreative()) + { + return 0; + } + else + { + float f = (float)(6 + p_77318_1_ * p_77318_1_) / 3.0F; + return this.protectionType == 0 ? MathHelper.floor_float(f * 0.75F) : (this.protectionType == 1 && p_77318_2_.isFireDamage() ? MathHelper.floor_float(f * 1.25F) : (this.protectionType == 2 && p_77318_2_ == DamageSource.fall ? MathHelper.floor_float(f * 2.5F) : (this.protectionType == 3 && p_77318_2_.isExplosion() ? MathHelper.floor_float(f * 1.5F) : (this.protectionType == 4 && p_77318_2_.isProjectile() ? MathHelper.floor_float(f * 1.5F) : 0)))); + } + } + + /** + * Return the name of key in translation table of this enchantment. + */ + public String getName() + { + return "enchantment.protect." + protectionName[this.protectionType]; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) + { + if (p_77326_1_ instanceof EnchantmentProtection) + { + EnchantmentProtection enchantmentprotection = (EnchantmentProtection)p_77326_1_; + return enchantmentprotection.protectionType == this.protectionType ? false : this.protectionType == 2 || enchantmentprotection.protectionType == 2; + } + else + { + return super.canApplyTogether(p_77326_1_); + } + } + + /** + * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. + */ + public static int getFireTimeForEntity(Entity p_92093_0_, int p_92093_1_) + { + int j = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, p_92093_0_.getLastActiveItems()); + + if (j > 0) + { + p_92093_1_ -= MathHelper.floor_float((float)p_92093_1_ * (float)j * 0.15F); + } + + return p_92093_1_; + } + + public static double func_92092_a(Entity p_92092_0_, double p_92092_1_) + { + int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, p_92092_0_.getLastActiveItems()); + + if (i > 0) + { + p_92092_1_ -= (double)MathHelper.floor_double(p_92092_1_ * (double)((float)i * 0.15F)); + } + + return p_92092_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentThorns.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentThorns.java new file mode 100644 index 0000000..799dcdb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentThorns.java @@ -0,0 +1,79 @@ +package net.minecraft.enchantment; + +import java.util.Random; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; + +public class EnchantmentThorns extends Enchantment +{ + private static final String __OBFID = "CL_00000122"; + + public EnchantmentThorns(int p_i1937_1_, int p_i1937_2_) + { + super(p_i1937_1_, p_i1937_2_, EnumEnchantmentType.armor_torso); + this.setName("thorns"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 10 + 20 * (p_77321_1_ - 1); + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 3; + } + + public boolean canApply(ItemStack p_92089_1_) + { + return p_92089_1_.getItem() instanceof ItemArmor ? true : super.canApply(p_92089_1_); + } + + public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) + { + Random random = p_151367_1_.getRNG(); + ItemStack itemstack = EnchantmentHelper.func_92099_a(Enchantment.thorns, p_151367_1_); + + if (func_92094_a(p_151367_3_, random)) + { + p_151367_2_.attackEntityFrom(DamageSource.causeThornsDamage(p_151367_1_), (float)func_92095_b(p_151367_3_, random)); + p_151367_2_.playSound("damage.thorns", 0.5F, 1.0F); + + if (itemstack != null) + { + itemstack.damageItem(3, p_151367_1_); + } + } + else if (itemstack != null) + { + itemstack.damageItem(1, p_151367_1_); + } + } + + public static boolean func_92094_a(int p_92094_0_, Random p_92094_1_) + { + return p_92094_0_ <= 0 ? false : p_92094_1_.nextFloat() < 0.15F * (float)p_92094_0_; + } + + public static int func_92095_b(int p_92095_0_, Random p_92095_1_) + { + return p_92095_0_ > 10 ? p_92095_0_ - 10 : 1 + p_92095_1_.nextInt(4); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentUntouching.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentUntouching.java new file mode 100644 index 0000000..c928fe2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentUntouching.java @@ -0,0 +1,52 @@ +package net.minecraft.enchantment; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class EnchantmentUntouching extends Enchantment +{ + private static final String __OBFID = "CL_00000123"; + + protected EnchantmentUntouching(int p_i1938_1_, int p_i1938_2_) + { + super(p_i1938_1_, p_i1938_2_, EnumEnchantmentType.digger); + this.setName("untouching"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 15; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return super.getMinEnchantability(p_77317_1_) + 50; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } + + /** + * Determines if the enchantment passed can be applyied together with this enchantment. + */ + public boolean canApplyTogether(Enchantment p_77326_1_) + { + return super.canApplyTogether(p_77326_1_) && p_77326_1_.effectId != fortune.effectId; + } + + public boolean canApply(ItemStack p_92089_1_) + { + return p_92089_1_.getItem() == Items.shears ? true : super.canApply(p_92089_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentWaterWorker.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentWaterWorker.java new file mode 100644 index 0000000..54dcdff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnchantmentWaterWorker.java @@ -0,0 +1,36 @@ +package net.minecraft.enchantment; + +public class EnchantmentWaterWorker extends Enchantment +{ + private static final String __OBFID = "CL_00000124"; + + public EnchantmentWaterWorker(int p_i1939_1_, int p_i1939_2_) + { + super(p_i1939_1_, p_i1939_2_, EnumEnchantmentType.armor_head); + this.setName("waterWorker"); + } + + /** + * Returns the minimal value of enchantability needed on the enchantment level passed. + */ + public int getMinEnchantability(int p_77321_1_) + { + return 1; + } + + /** + * Returns the maximum value of enchantability nedded on the enchantment level passed. + */ + public int getMaxEnchantability(int p_77317_1_) + { + return this.getMinEnchantability(p_77317_1_) + 40; + } + + /** + * Returns the maximum level that the enchantment can have. + */ + public int getMaxLevel() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnumEnchantmentType.java b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnumEnchantmentType.java new file mode 100644 index 0000000..8318a51 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/enchantment/EnumEnchantmentType.java @@ -0,0 +1,56 @@ +package net.minecraft.enchantment; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; + +public enum EnumEnchantmentType +{ + all, + armor, + armor_feet, + armor_legs, + armor_torso, + armor_head, + weapon, + digger, + fishing_rod, + breakable, + bow; + + private static final String __OBFID = "CL_00000106"; + + /** + * Return true if the item passed can be enchanted by a enchantment of this type. + */ + public boolean canEnchantItem(Item p_77557_1_) + { + if (this == all) + { + return true; + } + else if (this == breakable && p_77557_1_.isDamageable()) + { + return true; + } + else if (p_77557_1_ instanceof ItemArmor) + { + if (this == armor) + { + return true; + } + else + { + ItemArmor itemarmor = (ItemArmor)p_77557_1_; + return itemarmor.armorType == 0 ? this == armor_head : (itemarmor.armorType == 2 ? this == armor_legs : (itemarmor.armorType == 1 ? this == armor_torso : (itemarmor.armorType == 3 ? this == armor_feet : false))); + } + } + else + { + return p_77557_1_ instanceof ItemSword ? this == weapon : (p_77557_1_ instanceof ItemTool ? this == digger : (p_77557_1_ instanceof ItemBow ? this == bow : (p_77557_1_ instanceof ItemFishingRod ? this == fishing_rod : false))); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/DataWatcher.java b/build/rfg/minecraft-src/java/net/minecraft/entity/DataWatcher.java new file mode 100644 index 0000000..d05a70a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/DataWatcher.java @@ -0,0 +1,441 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.item.ItemStack; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ReportedException; +import org.apache.commons.lang3.ObjectUtils; + +public class DataWatcher +{ + private final Entity field_151511_a; + /** When isBlank is true the DataWatcher is not watching any objects */ + private boolean isBlank = true; + private static final HashMap dataTypes = new HashMap(); + private final Map watchedObjects = new HashMap(); + /** true if one or more object was changed */ + private boolean objectChanged; + private ReadWriteLock lock = new ReentrantReadWriteLock(); + private static final String __OBFID = "CL_00001559"; + + public DataWatcher(Entity p_i45313_1_) + { + this.field_151511_a = p_i45313_1_; + } + + /** + * adds a new object to dataWatcher to watch, to update an already existing object see updateObject. Arguments: data + * Value Id, Object to add + */ + public void addObject(int p_75682_1_, Object p_75682_2_) + { + Integer integer = (Integer)dataTypes.get(p_75682_2_.getClass()); + + if (integer == null) + { + throw new IllegalArgumentException("Unknown data type: " + p_75682_2_.getClass()); + } + else if (p_75682_1_ > 31) + { + throw new IllegalArgumentException("Data value id is too big with " + p_75682_1_ + "! (Max is " + 31 + ")"); + } + else if (this.watchedObjects.containsKey(Integer.valueOf(p_75682_1_))) + { + throw new IllegalArgumentException("Duplicate id value for " + p_75682_1_ + "!"); + } + else + { + DataWatcher.WatchableObject watchableobject = new DataWatcher.WatchableObject(integer.intValue(), p_75682_1_, p_75682_2_); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(p_75682_1_), watchableobject); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + } + + /** + * Add a new object for the DataWatcher to watch, using the specified data type. + */ + public void addObjectByDataType(int p_82709_1_, int p_82709_2_) + { + DataWatcher.WatchableObject watchableobject = new DataWatcher.WatchableObject(p_82709_2_, p_82709_1_, (Object)null); + this.lock.writeLock().lock(); + this.watchedObjects.put(Integer.valueOf(p_82709_1_), watchableobject); + this.lock.writeLock().unlock(); + this.isBlank = false; + } + + /** + * gets the bytevalue of a watchable object + */ + public byte getWatchableObjectByte(int p_75683_1_) + { + return ((Byte)this.getWatchedObject(p_75683_1_).getObject()).byteValue(); + } + + public short getWatchableObjectShort(int p_75693_1_) + { + return ((Short)this.getWatchedObject(p_75693_1_).getObject()).shortValue(); + } + + /** + * gets a watchable object and returns it as a Integer + */ + public int getWatchableObjectInt(int p_75679_1_) + { + return ((Integer)this.getWatchedObject(p_75679_1_).getObject()).intValue(); + } + + public float getWatchableObjectFloat(int p_111145_1_) + { + return ((Float)this.getWatchedObject(p_111145_1_).getObject()).floatValue(); + } + + /** + * gets a watchable object and returns it as a String + */ + public String getWatchableObjectString(int p_75681_1_) + { + return (String)this.getWatchedObject(p_75681_1_).getObject(); + } + + /** + * Get a watchable object as an ItemStack. + */ + public ItemStack getWatchableObjectItemStack(int p_82710_1_) + { + return (ItemStack)this.getWatchedObject(p_82710_1_).getObject(); + } + + /** + * is threadsafe, unless it throws an exception, then + */ + private DataWatcher.WatchableObject getWatchedObject(int p_75691_1_) + { + this.lock.readLock().lock(); + DataWatcher.WatchableObject watchableobject; + + try + { + watchableobject = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(p_75691_1_)); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting synched entity data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Synched entity data"); + crashreportcategory.addCrashSection("Data ID", Integer.valueOf(p_75691_1_)); + throw new ReportedException(crashreport); + } + + this.lock.readLock().unlock(); + return watchableobject; + } + + /** + * updates an already existing object + */ + public void updateObject(int p_75692_1_, Object p_75692_2_) + { + DataWatcher.WatchableObject watchableobject = this.getWatchedObject(p_75692_1_); + + if (ObjectUtils.notEqual(p_75692_2_, watchableobject.getObject())) + { + watchableobject.setObject(p_75692_2_); + this.field_151511_a.func_145781_i(p_75692_1_); + watchableobject.setWatched(true); + this.objectChanged = true; + } + } + + public void setObjectWatched(int p_82708_1_) + { + this.getWatchedObject(p_82708_1_).watched = true; + this.objectChanged = true; + } + + public boolean hasChanges() + { + return this.objectChanged; + } + + /** + * Writes the list of watched objects (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) to the specified PacketBuffer + */ + public static void writeWatchedListToPacketBuffer(List p_151507_0_, PacketBuffer p_151507_1_) throws IOException + { + if (p_151507_0_ != null) + { + Iterator iterator = p_151507_0_.iterator(); + + while (iterator.hasNext()) + { + DataWatcher.WatchableObject watchableobject = (DataWatcher.WatchableObject)iterator.next(); + writeWatchableObjectToPacketBuffer(p_151507_1_, watchableobject); + } + } + + p_151507_1_.writeByte(127); + } + + public List getChanged() + { + ArrayList arraylist = null; + + if (this.objectChanged) + { + this.lock.readLock().lock(); + Iterator iterator = this.watchedObjects.values().iterator(); + + while (iterator.hasNext()) + { + DataWatcher.WatchableObject watchableobject = (DataWatcher.WatchableObject)iterator.next(); + + if (watchableobject.isWatched()) + { + watchableobject.setWatched(false); + + if (arraylist == null) + { + arraylist = new ArrayList(); + } + + arraylist.add(watchableobject); + } + } + + this.lock.readLock().unlock(); + } + + this.objectChanged = false; + return arraylist; + } + + public void func_151509_a(PacketBuffer p_151509_1_) throws IOException + { + this.lock.readLock().lock(); + Iterator iterator = this.watchedObjects.values().iterator(); + + while (iterator.hasNext()) + { + DataWatcher.WatchableObject watchableobject = (DataWatcher.WatchableObject)iterator.next(); + writeWatchableObjectToPacketBuffer(p_151509_1_, watchableobject); + } + + this.lock.readLock().unlock(); + p_151509_1_.writeByte(127); + } + + public List getAllWatched() + { + ArrayList arraylist = null; + this.lock.readLock().lock(); + DataWatcher.WatchableObject watchableobject; + + for (Iterator iterator = this.watchedObjects.values().iterator(); iterator.hasNext(); arraylist.add(watchableobject)) + { + watchableobject = (DataWatcher.WatchableObject)iterator.next(); + + if (arraylist == null) + { + arraylist = new ArrayList(); + } + } + + this.lock.readLock().unlock(); + return arraylist; + } + + /** + * Writes a watchable object (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) to the specified PacketBuffer + */ + private static void writeWatchableObjectToPacketBuffer(PacketBuffer p_151510_0_, DataWatcher.WatchableObject p_151510_1_) throws IOException + { + int i = (p_151510_1_.getObjectType() << 5 | p_151510_1_.getDataValueId() & 31) & 255; + p_151510_0_.writeByte(i); + + switch (p_151510_1_.getObjectType()) + { + case 0: + p_151510_0_.writeByte(((Byte)p_151510_1_.getObject()).byteValue()); + break; + case 1: + p_151510_0_.writeShort(((Short)p_151510_1_.getObject()).shortValue()); + break; + case 2: + p_151510_0_.writeInt(((Integer)p_151510_1_.getObject()).intValue()); + break; + case 3: + p_151510_0_.writeFloat(((Float)p_151510_1_.getObject()).floatValue()); + break; + case 4: + p_151510_0_.writeStringToBuffer((String)p_151510_1_.getObject()); + break; + case 5: + ItemStack itemstack = (ItemStack)p_151510_1_.getObject(); + p_151510_0_.writeItemStackToBuffer(itemstack); + break; + case 6: + ChunkCoordinates chunkcoordinates = (ChunkCoordinates)p_151510_1_.getObject(); + p_151510_0_.writeInt(chunkcoordinates.posX); + p_151510_0_.writeInt(chunkcoordinates.posY); + p_151510_0_.writeInt(chunkcoordinates.posZ); + } + } + + /** + * Reads a list of watched objects (entity attribute of type {byte, short, int, float, string, ItemStack, + * ChunkCoordinates}) from the supplied PacketBuffer + */ + public static List readWatchedListFromPacketBuffer(PacketBuffer p_151508_0_) throws IOException + { + ArrayList arraylist = null; + + for (byte b0 = p_151508_0_.readByte(); b0 != 127; b0 = p_151508_0_.readByte()) + { + if (arraylist == null) + { + arraylist = new ArrayList(); + } + + int i = (b0 & 224) >> 5; + int j = b0 & 31; + DataWatcher.WatchableObject watchableobject = null; + + switch (i) + { + case 0: + watchableobject = new DataWatcher.WatchableObject(i, j, Byte.valueOf(p_151508_0_.readByte())); + break; + case 1: + watchableobject = new DataWatcher.WatchableObject(i, j, Short.valueOf(p_151508_0_.readShort())); + break; + case 2: + watchableobject = new DataWatcher.WatchableObject(i, j, Integer.valueOf(p_151508_0_.readInt())); + break; + case 3: + watchableobject = new DataWatcher.WatchableObject(i, j, Float.valueOf(p_151508_0_.readFloat())); + break; + case 4: + watchableobject = new DataWatcher.WatchableObject(i, j, p_151508_0_.readStringFromBuffer(32767)); + break; + case 5: + watchableobject = new DataWatcher.WatchableObject(i, j, p_151508_0_.readItemStackFromBuffer()); + break; + case 6: + int k = p_151508_0_.readInt(); + int l = p_151508_0_.readInt(); + int i1 = p_151508_0_.readInt(); + watchableobject = new DataWatcher.WatchableObject(i, j, new ChunkCoordinates(k, l, i1)); + } + + arraylist.add(watchableobject); + } + + return arraylist; + } + + @SideOnly(Side.CLIENT) + public void updateWatchedObjectsFromList(List p_75687_1_) + { + this.lock.writeLock().lock(); + Iterator iterator = p_75687_1_.iterator(); + + while (iterator.hasNext()) + { + DataWatcher.WatchableObject watchableobject = (DataWatcher.WatchableObject)iterator.next(); + DataWatcher.WatchableObject watchableobject1 = (DataWatcher.WatchableObject)this.watchedObjects.get(Integer.valueOf(watchableobject.getDataValueId())); + + if (watchableobject1 != null) + { + watchableobject1.setObject(watchableobject.getObject()); + this.field_151511_a.func_145781_i(watchableobject.getDataValueId()); + } + } + + this.lock.writeLock().unlock(); + this.objectChanged = true; + } + + public boolean getIsBlank() + { + return this.isBlank; + } + + public void func_111144_e() + { + this.objectChanged = false; + } + + static + { + dataTypes.put(Byte.class, Integer.valueOf(0)); + dataTypes.put(Short.class, Integer.valueOf(1)); + dataTypes.put(Integer.class, Integer.valueOf(2)); + dataTypes.put(Float.class, Integer.valueOf(3)); + dataTypes.put(String.class, Integer.valueOf(4)); + dataTypes.put(ItemStack.class, Integer.valueOf(5)); + dataTypes.put(ChunkCoordinates.class, Integer.valueOf(6)); + } + + public static class WatchableObject + { + private final int objectType; + /** id of max 31 */ + private final int dataValueId; + private Object watchedObject; + private boolean watched; + private static final String __OBFID = "CL_00001560"; + + public WatchableObject(int p_i1603_1_, int p_i1603_2_, Object p_i1603_3_) + { + this.dataValueId = p_i1603_2_; + this.watchedObject = p_i1603_3_; + this.objectType = p_i1603_1_; + this.watched = true; + } + + public int getDataValueId() + { + return this.dataValueId; + } + + public void setObject(Object p_75673_1_) + { + this.watchedObject = p_75673_1_; + } + + public Object getObject() + { + return this.watchedObject; + } + + public int getObjectType() + { + return this.objectType; + } + + public boolean isWatched() + { + return this.watched; + } + + public void setWatched(boolean p_75671_1_) + { + this.watched = p_75671_1_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/Entity.java b/build/rfg/minecraft-src/java/net/minecraft/entity/Entity.java new file mode 100644 index 0000000..67d4c5c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/Entity.java @@ -0,0 +1,2820 @@ +package net.minecraft.entity; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagDouble; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Direction; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.IExtendedEntityProperties; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.EntityEvent; +import net.minecraftforge.fluids.IFluidBlock; + +public abstract class Entity +{ + private static int nextEntityID; + private int entityId; + public double renderDistanceWeight; + /** + * Blocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can + * prevent spawning. + */ + public boolean preventEntitySpawning; + /** The entity that is riding this entity */ + public Entity riddenByEntity; + /** The entity we are currently riding */ + public Entity ridingEntity; + public boolean forceSpawn; + /** Reference to the World object. */ + public World worldObj; + public double prevPosX; + public double prevPosY; + public double prevPosZ; + /** Entity position X */ + public double posX; + /** Entity position Y */ + public double posY; + /** Entity position Z */ + public double posZ; + /** Entity motion X */ + public double motionX; + /** Entity motion Y */ + public double motionY; + /** Entity motion Z */ + public double motionZ; + /** Entity rotation Yaw */ + public float rotationYaw; + /** Entity rotation Pitch */ + public float rotationPitch; + public float prevRotationYaw; + public float prevRotationPitch; + /** Axis aligned bounding box. */ + public final AxisAlignedBB boundingBox; + public boolean onGround; + /** True if after a move this entity has collided with something on X- or Z-axis */ + public boolean isCollidedHorizontally; + /** True if after a move this entity has collided with something on Y-axis */ + public boolean isCollidedVertically; + /** True if after a move this entity has collided with something either vertically or horizontally */ + public boolean isCollided; + public boolean velocityChanged; + protected boolean isInWeb; + public boolean field_70135_K; + /** Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) */ + public boolean isDead; + public float yOffset; + /** How wide this entity is considered to be */ + public float width; + /** How high this entity is considered to be */ + public float height; + /** The previous ticks distance walked multiplied by 0.6 */ + public float prevDistanceWalkedModified; + /** The distance walked multiplied by 0.6 */ + public float distanceWalkedModified; + public float distanceWalkedOnStepModified; + public float fallDistance; + /** The distance that has to be exceeded in order to triger a new step sound and an onEntityWalking event on a block */ + private int nextStepDistance; + /** The entity's X coordinate at the previous tick, used to calculate position during rendering routines */ + public double lastTickPosX; + /** The entity's Y coordinate at the previous tick, used to calculate position during rendering routines */ + public double lastTickPosY; + /** The entity's Z coordinate at the previous tick, used to calculate position during rendering routines */ + public double lastTickPosZ; + public float ySize; + /** + * How high this entity can step up when running into a block to try to get over it (currently make note the entity + * will always step up this amount and not just the amount needed) + */ + public float stepHeight; + /** Whether this entity won't clip with collision or not (make note it won't disable gravity) */ + public boolean noClip; + /** Reduces the velocity applied by entity collisions by the specified percent. */ + public float entityCollisionReduction; + protected Random rand; + /** How many ticks has this entity had ran since being alive */ + public int ticksExisted; + /** The amount of ticks you have to stand inside of fire before be set on fire */ + public int fireResistance; + private int fire; + /** Whether this entity is currently inside of water (if it handles water movement that is) */ + protected boolean inWater; + /** Remaining time an entity will be "immune" to further damage after being hurt. */ + public int hurtResistantTime; + private boolean firstUpdate; + protected boolean isImmuneToFire; + protected DataWatcher dataWatcher; + private double entityRiderPitchDelta; + private double entityRiderYawDelta; + /** Has this entity been added to the chunk its within */ + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; + public int chunkCoordZ; + @SideOnly(Side.CLIENT) + public int serverPosX; + @SideOnly(Side.CLIENT) + public int serverPosY; + @SideOnly(Side.CLIENT) + public int serverPosZ; + /** + * Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: + * render if ignoreFrustumCheck or in frustum. + */ + public boolean ignoreFrustumCheck; + public boolean isAirBorne; + public int timeUntilPortal; + /** Whether the entity is inside a Portal */ + protected boolean inPortal; + protected int portalCounter; + /** Which dimension the player is in (-1 = the Nether, 0 = normal world) */ + public int dimension; + protected int teleportDirection; + private boolean invulnerable; + protected UUID entityUniqueID; + public Entity.EnumEntitySize myEntitySize; + private static final String __OBFID = "CL_00001533"; + /** Forge: Used to store custom data for each entity. */ + private NBTTagCompound customEntityData; + public boolean captureDrops = false; + public ArrayList capturedDrops = new ArrayList(); + private UUID persistentID; + + protected HashMap extendedProperties; + + public int getEntityId() + { + return this.entityId; + } + + public void setEntityId(int id) + { + this.entityId = id; + } + + public Entity(World worldIn) + { + this.entityId = nextEntityID++; + this.renderDistanceWeight = 1.0D; + this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + this.field_70135_K = true; + this.width = 0.6F; + this.height = 1.8F; + this.nextStepDistance = 1; + this.rand = new Random(); + this.fireResistance = 1; + this.firstUpdate = true; + this.entityUniqueID = UUID.randomUUID(); + this.myEntitySize = Entity.EnumEntitySize.SIZE_2; + this.worldObj = worldIn; + this.setPosition(0.0D, 0.0D, 0.0D); + + if (worldIn != null) + { + this.dimension = worldIn.provider.dimensionId; + } + + this.dataWatcher = new DataWatcher(this); + this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(1, Short.valueOf((short)300)); + this.entityInit(); + + extendedProperties = new HashMap(); + + MinecraftForge.EVENT_BUS.post(new EntityEvent.EntityConstructing(this)); + + for (IExtendedEntityProperties props : this.extendedProperties.values()) + { + props.init(this, worldIn); + } + } + + protected abstract void entityInit(); + + public DataWatcher getDataWatcher() + { + return this.dataWatcher; + } + + public boolean equals(Object p_equals_1_) + { + return p_equals_1_ instanceof Entity ? ((Entity)p_equals_1_).entityId == this.entityId : false; + } + + public int hashCode() + { + return this.entityId; + } + + /** + * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned + * (only actually used on players though its also on Entity) + */ + @SideOnly(Side.CLIENT) + protected void preparePlayerToSpawn() + { + if (this.worldObj != null) + { + while (this.posY > 0.0D) + { + this.setPosition(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) + { + break; + } + + ++this.posY; + } + + this.motionX = this.motionY = this.motionZ = 0.0D; + this.rotationPitch = 0.0F; + } + } + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + this.isDead = true; + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected void setSize(float width, float height) + { + float f2; + + if (width != this.width || height != this.height) + { + f2 = this.width; + this.width = width; + this.height = height; + this.boundingBox.maxX = this.boundingBox.minX + (double)this.width; + this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.width; + this.boundingBox.maxY = this.boundingBox.minY + (double)this.height; + + if (this.width > f2 && !this.firstUpdate && !this.worldObj.isRemote) + { + this.moveEntity((double)(f2 - this.width), 0.0D, (double)(f2 - this.width)); + } + } + + f2 = width % 2.0F; + + if ((double)f2 < 0.375D) + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_1; + } + else if ((double)f2 < 0.75D) + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_2; + } + else if ((double)f2 < 1.0D) + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_3; + } + else if ((double)f2 < 1.375D) + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_4; + } + else if ((double)f2 < 1.75D) + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_5; + } + else + { + this.myEntitySize = Entity.EnumEntitySize.SIZE_6; + } + } + + /** + * Sets the rotation of the entity + */ + protected void setRotation(float yaw, float pitch) + { + this.rotationYaw = yaw % 360.0F; + this.rotationPitch = pitch % 360.0F; + } + + /** + * Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. + */ + public void setPosition(double x, double y, double z) + { + this.posX = x; + this.posY = y; + this.posZ = z; + float f = this.width / 2.0F; + float f1 = this.height; + this.boundingBox.setBounds(x - (double)f, y - (double)this.yOffset + (double)this.ySize, z - (double)f, x + (double)f, y - (double)this.yOffset + (double)this.ySize + (double)f1, z + (double)f); + } + + /** + * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both + * arguments in degrees. + */ + @SideOnly(Side.CLIENT) + public void setAngles(float yaw, float pitch) + { + float f2 = this.rotationPitch; + float f3 = this.rotationYaw; + this.rotationYaw = (float)((double)this.rotationYaw + (double)yaw * 0.15D); + this.rotationPitch = (float)((double)this.rotationPitch - (double)pitch * 0.15D); + + if (this.rotationPitch < -90.0F) + { + this.rotationPitch = -90.0F; + } + + if (this.rotationPitch > 90.0F) + { + this.rotationPitch = 90.0F; + } + + this.prevRotationPitch += this.rotationPitch - f2; + this.prevRotationYaw += this.rotationYaw - f3; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.onEntityUpdate(); + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() + { + this.worldObj.theProfiler.startSection("entityBaseTick"); + + if (this.ridingEntity != null && this.ridingEntity.isDead) + { + this.ridingEntity = null; + } + + this.prevDistanceWalkedModified = this.distanceWalkedModified; + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + int i; + + if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) + { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer)this.worldObj).func_73046_m(); + i = this.getMaxInPortalTime(); + + if (this.inPortal) + { + if (minecraftserver.getAllowNether()) + { + if (this.ridingEntity == null && this.portalCounter++ >= i) + { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + byte b0; + + if (this.worldObj.provider.dimensionId == -1) + { + b0 = 0; + } + else + { + b0 = -1; + } + + this.travelToDimension(b0); + } + + this.inPortal = false; + } + } + else + { + if (this.portalCounter > 0) + { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) + { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) + { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + if (this.isSprinting() && !this.isInWater()) + { + int j = MathHelper.floor_double(this.posX); + i = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(j, i, k); + + if (block.getMaterial() != Material.air) + { + this.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(block) + "_" + this.worldObj.getBlockMetadata(j, i, k), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); + } + } + + this.handleWaterMovement(); + + if (this.worldObj.isRemote) + { + this.fire = 0; + } + else if (this.fire > 0) + { + if (this.isImmuneToFire) + { + this.fire -= 4; + + if (this.fire < 0) + { + this.fire = 0; + } + } + else + { + if (this.fire % 20 == 0) + { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + --this.fire; + } + } + + if (this.handleLavaMovement()) + { + this.setOnFireFromLava(); + this.fallDistance *= 0.5F; + } + + if (this.posY < -64.0D) + { + this.kill(); + } + + if (!this.worldObj.isRemote) + { + this.setFlag(0, this.fire > 0); + } + + this.firstUpdate = false; + this.worldObj.theProfiler.endSection(); + } + + /** + * Return the amount of time this entity should stay in a portal before being transported. + */ + public int getMaxInPortalTime() + { + return 0; + } + + /** + * Called whenever the entity is walking inside of lava. + */ + protected void setOnFireFromLava() + { + if (!this.isImmuneToFire) + { + this.attackEntityFrom(DamageSource.lava, 4.0F); + this.setFire(15); + } + } + + /** + * Sets entity to burn for x amount of seconds, cannot lower amount of existing fire. + */ + public void setFire(int seconds) + { + int j = seconds * 20; + j = EnchantmentProtection.getFireTimeForEntity(this, j); + + if (this.fire < j) + { + this.fire = j; + } + } + + /** + * Removes fire from entity. + */ + public void extinguish() + { + this.fire = 0; + } + + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() + { + this.setDead(); + } + + /** + * Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z + */ + public boolean isOffsetPositionInLiquid(double x, double y, double z) + { + AxisAlignedBB axisalignedbb = this.boundingBox.getOffsetBoundingBox(x, y, z); + List list = this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb); + return !list.isEmpty() ? false : !this.worldObj.isAnyLiquid(axisalignedbb); + } + + /** + * Tries to moves the entity by the passed in displacement. Args: x, y, z + */ + public void moveEntity(double x, double y, double z) + { + if (this.noClip) + { + this.boundingBox.offset(x, y, z); + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; + } + else + { + this.worldObj.theProfiler.startSection("move"); + this.ySize *= 0.4F; + double d3 = this.posX; + double d4 = this.posY; + double d5 = this.posZ; + + if (this.isInWeb) + { + this.isInWeb = false; + x *= 0.25D; + y *= 0.05000000074505806D; + z *= 0.25D; + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } + + double d6 = x; + double d7 = y; + double d8 = z; + AxisAlignedBB axisalignedbb = this.boundingBox.copy(); + boolean flag = this.onGround && this.isSneaking() && this instanceof EntityPlayer; + + if (flag) + { + double d9; + + for (d9 = 0.05D; x != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(x, -1.0D, 0.0D)).isEmpty(); d6 = x) + { + if (x < d9 && x >= -d9) + { + x = 0.0D; + } + else if (x > 0.0D) + { + x -= d9; + } + else + { + x += d9; + } + } + + for (; z != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, z)).isEmpty(); d8 = z) + { + if (z < d9 && z >= -d9) + { + z = 0.0D; + } + else if (z > 0.0D) + { + z -= d9; + } + else + { + z += d9; + } + } + + while (x != 0.0D && z != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(x, -1.0D, z)).isEmpty()) + { + if (x < d9 && x >= -d9) + { + x = 0.0D; + } + else if (x > 0.0D) + { + x -= d9; + } + else + { + x += d9; + } + + if (z < d9 && z >= -d9) + { + z = 0.0D; + } + else if (z > 0.0D) + { + z -= d9; + } + else + { + z += d9; + } + + d6 = x; + d8 = z; + } + } + + List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(x, y, z)); + + for (int i = 0; i < list.size(); ++i) + { + y = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, y); + } + + this.boundingBox.offset(0.0D, y, 0.0D); + + if (!this.field_70135_K && d7 != y) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + boolean flag1 = this.onGround || d7 != y && d7 < 0.0D; + int j; + + for (j = 0; j < list.size(); ++j) + { + x = ((AxisAlignedBB)list.get(j)).calculateXOffset(this.boundingBox, x); + } + + this.boundingBox.offset(x, 0.0D, 0.0D); + + if (!this.field_70135_K && d6 != x) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + for (j = 0; j < list.size(); ++j) + { + z = ((AxisAlignedBB)list.get(j)).calculateZOffset(this.boundingBox, z); + } + + this.boundingBox.offset(0.0D, 0.0D, z); + + if (!this.field_70135_K && d8 != z) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + double d10; + double d11; + int k; + double d12; + + if (this.stepHeight > 0.0F && flag1 && (flag || this.ySize < 0.05F) && (d6 != x || d8 != z)) + { + d12 = x; + d10 = y; + d11 = z; + x = d6; + y = (double)this.stepHeight; + z = d8; + AxisAlignedBB axisalignedbb1 = this.boundingBox.copy(); + this.boundingBox.setBB(axisalignedbb); + list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(d6, y, d8)); + + for (k = 0; k < list.size(); ++k) + { + y = ((AxisAlignedBB)list.get(k)).calculateYOffset(this.boundingBox, y); + } + + this.boundingBox.offset(0.0D, y, 0.0D); + + if (!this.field_70135_K && d7 != y) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + for (k = 0; k < list.size(); ++k) + { + x = ((AxisAlignedBB)list.get(k)).calculateXOffset(this.boundingBox, x); + } + + this.boundingBox.offset(x, 0.0D, 0.0D); + + if (!this.field_70135_K && d6 != x) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + for (k = 0; k < list.size(); ++k) + { + z = ((AxisAlignedBB)list.get(k)).calculateZOffset(this.boundingBox, z); + } + + this.boundingBox.offset(0.0D, 0.0D, z); + + if (!this.field_70135_K && d8 != z) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + + if (!this.field_70135_K && d7 != y) + { + z = 0.0D; + y = 0.0D; + x = 0.0D; + } + else + { + y = (double)(-this.stepHeight); + + for (k = 0; k < list.size(); ++k) + { + y = ((AxisAlignedBB)list.get(k)).calculateYOffset(this.boundingBox, y); + } + + this.boundingBox.offset(0.0D, y, 0.0D); + } + + if (d12 * d12 + d11 * d11 >= x * x + z * z) + { + x = d12; + y = d10; + z = d11; + this.boundingBox.setBB(axisalignedbb1); + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rest"); + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; + this.isCollidedHorizontally = d6 != x || d8 != z; + this.isCollidedVertically = d7 != y; + this.onGround = d7 != y && d7 < 0.0D; + this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; + this.updateFallState(y, this.onGround); + + if (d6 != x) + { + this.motionX = 0.0D; + } + + if (d7 != y) + { + this.motionY = 0.0D; + } + + if (d8 != z) + { + this.motionZ = 0.0D; + } + + d12 = this.posX - d3; + d10 = this.posY - d4; + d11 = this.posZ - d5; + + if (this.canTriggerWalking() && !flag && this.ridingEntity == null) + { + int j1 = MathHelper.floor_double(this.posX); + k = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int l = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(j1, k, l); + int i1 = this.worldObj.getBlock(j1, k - 1, l).getRenderType(); + + if (i1 == 11 || i1 == 32 || i1 == 21) + { + block = this.worldObj.getBlock(j1, k - 1, l); + } + + if (block != Blocks.ladder) + { + d10 = 0.0D; + } + + this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(d12 * d12 + d11 * d11) * 0.6D); + this.distanceWalkedOnStepModified = (float)((double)this.distanceWalkedOnStepModified + (double)MathHelper.sqrt_double(d12 * d12 + d10 * d10 + d11 * d11) * 0.6D); + + if (this.distanceWalkedOnStepModified > (float)this.nextStepDistance && block.getMaterial() != Material.air) + { + this.nextStepDistance = (int)this.distanceWalkedOnStepModified + 1; + + if (this.isInWater()) + { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F; + + if (f > 1.0F) + { + f = 1.0F; + } + + this.playSound(this.getSwimSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + } + + this.func_145780_a(j1, k, l, block); + block.onEntityWalking(this.worldObj, j1, k, l, this); + } + } + + try + { + this.func_145775_I(); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Checking entity block collision"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being checked for collision"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + + boolean flag2 = this.isWet(); + + if (this.worldObj.func_147470_e(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) + { + this.dealFireDamage(1); + + if (!flag2) + { + ++this.fire; + + if (this.fire == 0) + { + this.setFire(8); + } + } + } + else if (this.fire <= 0) + { + this.fire = -this.fireResistance; + } + + if (flag2 && this.fire > 0) + { + this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + this.fire = -this.fireResistance; + } + + this.worldObj.theProfiler.endSection(); + } + } + + protected String getSwimSound() + { + return "game.neutral.swim"; + } + + protected void func_145775_I() + { + int i = MathHelper.floor_double(this.boundingBox.minX + 0.001D); + int j = MathHelper.floor_double(this.boundingBox.minY + 0.001D); + int k = MathHelper.floor_double(this.boundingBox.minZ + 0.001D); + int l = MathHelper.floor_double(this.boundingBox.maxX - 0.001D); + int i1 = MathHelper.floor_double(this.boundingBox.maxY - 0.001D); + int j1 = MathHelper.floor_double(this.boundingBox.maxZ - 0.001D); + + if (this.worldObj.checkChunksExist(i, j, k, l, i1, j1)) + { + for (int k1 = i; k1 <= l; ++k1) + { + for (int l1 = j; l1 <= i1; ++l1) + { + for (int i2 = k; i2 <= j1; ++i2) + { + Block block = this.worldObj.getBlock(k1, l1, i2); + + try + { + block.onEntityCollidedWithBlock(this.worldObj, k1, l1, i2, this); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Colliding entity with block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being collided with"); + CrashReportCategory.func_147153_a(crashreportcategory, k1, l1, i2, block, this.worldObj.getBlockMetadata(k1, l1, i2)); + throw new ReportedException(crashreport); + } + } + } + } + } + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + Block.SoundType soundtype = blockIn.stepSound; + + if (this.worldObj.getBlock(x, y + 1, z) == Blocks.snow_layer) + { + soundtype = Blocks.snow_layer.stepSound; + this.playSound(soundtype.getStepResourcePath(), soundtype.getVolume() * 0.15F, soundtype.getPitch()); + } + else if (!blockIn.getMaterial().isLiquid()) + { + this.playSound(soundtype.getStepResourcePath(), soundtype.getVolume() * 0.15F, soundtype.getPitch()); + } + } + + public void playSound(String name, float volume, float pitch) + { + this.worldObj.playSoundAtEntity(this, name, volume, pitch); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return true; + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) + { + if (isOnGround) + { + if (this.fallDistance > 0.0F) + { + this.fall(this.fallDistance); + this.fallDistance = 0.0F; + } + } + else if (distanceFallenThisTick < 0.0D) + { + this.fallDistance = (float)((double)this.fallDistance - distanceFallenThisTick); + } + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() + { + return null; + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int amount) + { + if (!this.isImmuneToFire) + { + this.attackEntityFrom(DamageSource.inFire, (float)amount); + } + } + + public final boolean isImmuneToFire() + { + return this.isImmuneToFire; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.fall(distance); + } + } + + /** + * Checks if this entity is either in water or on an open air block in rain (used in wolves). + */ + public boolean isWet() + { + return this.inWater || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + (double)this.height), MathHelper.floor_double(this.posZ)); + } + + /** + * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning + * true) + */ + public boolean isInWater() + { + return this.inWater; + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() + { + if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) + { + if (!this.inWater && !this.firstUpdate) + { + float f = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; + + if (f > 1.0F) + { + f = 1.0F; + } + + this.playSound(this.getSplashSound(), f, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float f1 = (float)MathHelper.floor_double(this.boundingBox.minY); + int i; + float f2; + float f3; + + for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) + { + f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("bubble", this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); + } + + for (i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) + { + f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + f3 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("splash", this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY, this.motionZ); + } + } + + this.fallDistance = 0.0F; + this.inWater = true; + this.fire = 0; + } + else + { + this.inWater = false; + } + + return this.inWater; + } + + protected String getSplashSound() + { + return "game.neutral.swim.splash"; + } + + /** + * Checks if the current block the entity is within of the specified material type + */ + public boolean isInsideOfMaterial(Material materialIn) + { + double d0 = this.posY + (double)this.getEyeHeight(); + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_float((float)MathHelper.floor_double(d0)); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(i, j, k); + + if (block.getMaterial() == materialIn) + { + double filled = 1.0f; //If it's not a liquid assume it's a solid block + if (block instanceof IFluidBlock) + { + filled = ((IFluidBlock)block).getFilledPercentage(worldObj, i, j, k); + } + + if (filled < 0) + { + filled *= -1; + //filled -= 0.11111111F; //Why this is needed.. not sure... + return d0 > (double)(j + (1 - filled)); + } + else + { + return d0 < (double)(j + filled); + } + } + else + { + return false; + } + } + + public float getEyeHeight() + { + return 0.0F; + } + + /** + * Whether or not the current entity is in lava + */ + public boolean handleLavaMovement() + { + return this.worldObj.isMaterialInBB(this.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.lava); + } + + /** + * Used in both water and by flying objects + */ + public void moveFlying(float strafe, float forward, float friction) + { + float f3 = strafe * strafe + forward * forward; + + if (f3 >= 1.0E-4F) + { + f3 = MathHelper.sqrt_float(f3); + + if (f3 < 1.0F) + { + f3 = 1.0F; + } + + f3 = friction / f3; + strafe *= f3; + forward *= f3; + float f4 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float f5 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += (double)(strafe * f5 - forward * f4); + this.motionZ += (double)(forward * f5 + strafe * f4); + } + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(i, 0, j)) + { + double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; + int k = MathHelper.floor_double(this.posY - (double)this.yOffset + d0); + return this.worldObj.getLightBrightnessForSkyBlocks(i, k, j, 0); + } + else + { + return 0; + } + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(i, 0, j)) + { + double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; + int k = MathHelper.floor_double(this.posY - (double)this.yOffset + d0); + return this.worldObj.getLightBrightness(i, k, j); + } + else + { + return 0.0F; + } + } + + /** + * Sets the reference to the World object. + */ + public void setWorld(World worldIn) + { + this.worldObj = worldIn; + } + + /** + * Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch + */ + public void setPositionAndRotation(double x, double y, double z, float yaw, float pitch) + { + this.prevPosX = this.posX = x; + this.prevPosY = this.posY = y; + this.prevPosZ = this.posZ = z; + this.prevRotationYaw = this.rotationYaw = yaw; + this.prevRotationPitch = this.rotationPitch = pitch; + this.ySize = 0.0F; + double d3 = (double)(this.prevRotationYaw - yaw); + + if (d3 < -180.0D) + { + this.prevRotationYaw += 360.0F; + } + + if (d3 >= 180.0D) + { + this.prevRotationYaw -= 360.0F; + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(yaw, pitch); + } + + /** + * Sets the location and Yaw/Pitch of an entity in the world + */ + public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) + { + this.lastTickPosX = this.prevPosX = this.posX = x; + this.lastTickPosY = this.prevPosY = this.posY = y + (double)this.yOffset; + this.lastTickPosZ = this.prevPosZ = this.posZ = z; + this.rotationYaw = yaw; + this.rotationPitch = pitch; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /** + * Returns the distance to the entity. Args: entity + */ + public float getDistanceToEntity(Entity entityIn) + { + float f = (float)(this.posX - entityIn.posX); + float f1 = (float)(this.posY - entityIn.posY); + float f2 = (float)(this.posZ - entityIn.posZ); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + /** + * Gets the squared distance to the position. Args: x, y, z + */ + public double getDistanceSq(double x, double y, double z) + { + double d3 = this.posX - x; + double d4 = this.posY - y; + double d5 = this.posZ - z; + return d3 * d3 + d4 * d4 + d5 * d5; + } + + /** + * Gets the distance to the position. Args: x, y, z + */ + public double getDistance(double x, double y, double z) + { + double d3 = this.posX - x; + double d4 = this.posY - y; + double d5 = this.posZ - z; + return (double)MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5); + } + + /** + * Returns the squared distance to the entity. Args: entity + */ + public double getDistanceSqToEntity(Entity entityIn) + { + double d0 = this.posX - entityIn.posX; + double d1 = this.posY - entityIn.posY; + double d2 = this.posZ - entityIn.posZ; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityIn) {} + + /** + * Applies a velocity to each of the entities pushing them away from each other. Args: entity + */ + public void applyEntityCollision(Entity entityIn) + { + if (entityIn.riddenByEntity != this && entityIn.ridingEntity != this) + { + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2 = MathHelper.abs_max(d0, d1); + + if (d2 >= 0.009999999776482582D) + { + d2 = (double)MathHelper.sqrt_double(d2); + d0 /= d2; + d1 /= d2; + double d3 = 1.0D / d2; + + if (d3 > 1.0D) + { + d3 = 1.0D; + } + + d0 *= d3; + d1 *= d3; + d0 *= 0.05000000074505806D; + d1 *= 0.05000000074505806D; + d0 *= (double)(1.0F - this.entityCollisionReduction); + d1 *= (double)(1.0F - this.entityCollisionReduction); + this.addVelocity(-d0, 0.0D, -d1); + entityIn.addVelocity(d0, 0.0D, d1); + } + } + } + + /** + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double x, double y, double z) + { + this.motionX += x; + this.motionY += y; + this.motionZ += z; + this.isAirBorne = true; + } + + /** + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() + { + this.velocityChanged = true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.setBeenAttacked(); + return false; + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return false; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return false; + } + + /** + * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: + * entity, scoreToAdd + */ + public void addToPlayerScore(Entity entityIn, int amount) {} + + @SideOnly(Side.CLIENT) + public boolean isInRangeToRender3d(double x, double y, double z) + { + double d3 = this.posX - x; + double d4 = this.posY - y; + double d5 = this.posZ - z; + double d6 = d3 * d3 + d4 * d4 + d5 * d5; + return this.isInRangeToRenderDist(d6); + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = this.boundingBox.getAverageEdgeLength(); + d1 *= 64.0D * this.renderDistanceWeight; + return distance < d1 * d1; + } + + /** + * Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their + * riders. + */ + public boolean writeMountToNBT(NBTTagCompound tagCompund) + { + String s = this.getEntityString(); + + if (!this.isDead && s != null) + { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } + else + { + return false; + } + } + + /** + * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this + * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their + * rider. + */ + public boolean writeToNBTOptional(NBTTagCompound tagCompund) + { + String s = this.getEntityString(); + + if (!this.isDead && s != null && this.riddenByEntity == null) + { + tagCompund.setString("id", s); + this.writeToNBT(tagCompund); + return true; + } + else + { + return false; + } + } + + /** + * Save the entity to NBT (calls an abstract helper method to write extra data) + */ + public void writeToNBT(NBTTagCompound tagCompund) + { + try + { + tagCompund.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ})); + tagCompund.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); + tagCompund.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch})); + tagCompund.setFloat("FallDistance", this.fallDistance); + tagCompund.setShort("Fire", (short)this.fire); + tagCompund.setShort("Air", (short)this.getAir()); + tagCompund.setBoolean("OnGround", this.onGround); + tagCompund.setInteger("Dimension", this.dimension); + tagCompund.setBoolean("Invulnerable", this.invulnerable); + tagCompund.setInteger("PortalCooldown", this.timeUntilPortal); + tagCompund.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits()); + tagCompund.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits()); + if (customEntityData != null) + { + tagCompund.setTag("ForgeData", customEntityData); + } + + for (String identifier : this.extendedProperties.keySet()) + { + try + { + IExtendedEntityProperties props = this.extendedProperties.get(identifier); + props.saveNBTData(tagCompund); + } + catch (Throwable t) + { + FMLLog.severe("Failed to save extended properties for %s. This is a mod issue.", identifier); + t.printStackTrace(); + } + } + + this.writeEntityToNBT(tagCompund); + + if (this.ridingEntity != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + + if (this.ridingEntity.writeMountToNBT(nbttagcompound1)) + { + tagCompund.setTag("Riding", nbttagcompound1); + } + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Saving entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being saved"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + /** + * Reads the entity from NBT (calls an abstract helper method to read specialized data) + */ + public void readFromNBT(NBTTagCompound tagCompund) + { + try + { + NBTTagList nbttaglist = tagCompund.getTagList("Pos", 6); + NBTTagList nbttaglist1 = tagCompund.getTagList("Motion", 6); + NBTTagList nbttaglist2 = tagCompund.getTagList("Rotation", 5); + this.motionX = nbttaglist1.func_150309_d(0); + this.motionY = nbttaglist1.func_150309_d(1); + this.motionZ = nbttaglist1.func_150309_d(2); + + if (Math.abs(this.motionX) > 10.0D) + { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) > 10.0D) + { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) > 10.0D) + { + this.motionZ = 0.0D; + } + + this.prevPosX = this.lastTickPosX = this.posX = nbttaglist.func_150309_d(0); + this.prevPosY = this.lastTickPosY = this.posY = nbttaglist.func_150309_d(1); + this.prevPosZ = this.lastTickPosZ = this.posZ = nbttaglist.func_150309_d(2); + this.prevRotationYaw = this.rotationYaw = nbttaglist2.func_150308_e(0); + this.prevRotationPitch = this.rotationPitch = nbttaglist2.func_150308_e(1); + this.fallDistance = tagCompund.getFloat("FallDistance"); + this.fire = tagCompund.getShort("Fire"); + this.setAir(tagCompund.getShort("Air")); + this.onGround = tagCompund.getBoolean("OnGround"); + this.dimension = tagCompund.getInteger("Dimension"); + this.invulnerable = tagCompund.getBoolean("Invulnerable"); + this.timeUntilPortal = tagCompund.getInteger("PortalCooldown"); + + if (tagCompund.hasKey("UUIDMost", 4) && tagCompund.hasKey("UUIDLeast", 4)) + { + this.entityUniqueID = new UUID(tagCompund.getLong("UUIDMost"), tagCompund.getLong("UUIDLeast")); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + if (tagCompund.hasKey("ForgeData")) + { + customEntityData = tagCompund.getCompoundTag("ForgeData"); + } + + for (String identifier : this.extendedProperties.keySet()) + { + try + { + IExtendedEntityProperties props = this.extendedProperties.get(identifier); + props.loadNBTData(tagCompund); + } + catch (Throwable t) + { + FMLLog.severe("Failed to load extended properties for %s. This is a mod issue.", identifier); + t.printStackTrace(); + } + } + + //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly + if (tagCompund.hasKey("PersistentIDMSB") && tagCompund.hasKey("PersistentIDLSB")) + { + this.entityUniqueID = new UUID(tagCompund.getLong("PersistentIDMSB"), tagCompund.getLong("PersistentIDLSB")); + } + this.readEntityFromNBT(tagCompund); + + if (this.shouldSetPosAfterLoading()) + { + this.setPosition(this.posX, this.posY, this.posZ); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Loading entity NBT"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being loaded"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + protected boolean shouldSetPosAfterLoading() + { + return true; + } + + /** + * Returns the string that identifies this Entity's class + */ + protected final String getEntityString() + { + return EntityList.getEntityString(this); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected abstract void readEntityFromNBT(NBTTagCompound tagCompund); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected abstract void writeEntityToNBT(NBTTagCompound tagCompound); + + public void onChunkLoad() {} + + /** + * creates a NBT list from the array of doubles passed to this function + */ + protected NBTTagList newDoubleNBTList(double ... numbers) + { + NBTTagList nbttaglist = new NBTTagList(); + double[] adouble = numbers; + int i = numbers.length; + + for (int j = 0; j < i; ++j) + { + double d1 = adouble[j]; + nbttaglist.appendTag(new NBTTagDouble(d1)); + } + + return nbttaglist; + } + + /** + * Returns a new NBTTagList filled with the specified floats + */ + protected NBTTagList newFloatNBTList(float ... numbers) + { + NBTTagList nbttaglist = new NBTTagList(); + float[] afloat = numbers; + int i = numbers.length; + + for (int j = 0; j < i; ++j) + { + float f1 = afloat[j]; + nbttaglist.appendTag(new NBTTagFloat(f1)); + } + + return nbttaglist; + } + + public EntityItem dropItem(Item itemIn, int size) + { + return this.func_145778_a(itemIn, size, 0.0F); + } + + public EntityItem func_145778_a(Item itemIn, int size, float p_145778_3_) + { + return this.entityDropItem(new ItemStack(itemIn, size, 0), p_145778_3_); + } + + /** + * Drops an item at the position of the entity. + */ + public EntityItem entityDropItem(ItemStack itemStackIn, float offsetY) + { + if (itemStackIn.stackSize != 0 && itemStackIn.getItem() != null) + { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)offsetY, this.posZ, itemStackIn); + entityitem.delayBeforeCanPickup = 10; + if (captureDrops) + { + capturedDrops.add(entityitem); + } + else + { + this.worldObj.spawnEntityInWorld(entityitem); + } + return entityitem; + } + else + { + return null; + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return this.height / 2.0F; + } + + /** + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() + { + return !this.isDead; + } + + /** + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() + { + for (int i = 0; i < 8; ++i) + { + float f = ((float)((i >> 0) % 2) - 0.5F) * this.width * 0.8F; + float f1 = ((float)((i >> 1) % 2) - 0.5F) * 0.1F; + float f2 = ((float)((i >> 2) % 2) - 0.5F) * this.width * 0.8F; + int j = MathHelper.floor_double(this.posX + (double)f); + int k = MathHelper.floor_double(this.posY + (double)this.getEyeHeight() + (double)f1); + int l = MathHelper.floor_double(this.posZ + (double)f2); + + if (this.worldObj.getBlock(j, k, l).isNormalCube()) + { + return true; + } + } + + return false; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + return false; + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entityIn) + { + return null; + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() + { + if (this.ridingEntity.isDead) + { + this.ridingEntity = null; + } + else + { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.onUpdate(); + + if (this.ridingEntity != null) + { + this.ridingEntity.updateRiderPosition(); + this.entityRiderYawDelta += (double)(this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw); + + for (this.entityRiderPitchDelta += (double)(this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) + { + ; + } + + while (this.entityRiderYawDelta < -180.0D) + { + this.entityRiderYawDelta += 360.0D; + } + + while (this.entityRiderPitchDelta >= 180.0D) + { + this.entityRiderPitchDelta -= 360.0D; + } + + while (this.entityRiderPitchDelta < -180.0D) + { + this.entityRiderPitchDelta += 360.0D; + } + + double d0 = this.entityRiderYawDelta * 0.5D; + double d1 = this.entityRiderPitchDelta * 0.5D; + float f = 10.0F; + + if (d0 > (double)f) + { + d0 = (double)f; + } + + if (d0 < (double)(-f)) + { + d0 = (double)(-f); + } + + if (d1 > (double)f) + { + d1 = (double)f; + } + + if (d1 < (double)(-f)) + { + d1 = (double)(-f); + } + + this.entityRiderYawDelta -= d0; + this.entityRiderPitchDelta -= d1; + } + } + } + + public void updateRiderPosition() + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() + { + return (double)this.yOffset; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() + { + return (double)this.height * 0.75D; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity entityIn) + { + this.entityRiderPitchDelta = 0.0D; + this.entityRiderYawDelta = 0.0D; + + if (entityIn == null) + { + if (this.ridingEntity != null) + { + this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.boundingBox.minY + (double)this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } + else + { + if (this.ridingEntity != null) + { + this.ridingEntity.riddenByEntity = null; + } + + if (entityIn != null) + { + for (Entity entity1 = entityIn.ridingEntity; entity1 != null; entity1 = entity1.ridingEntity) + { + if (entity1 == this) + { + return; + } + } + } + + this.ridingEntity = entityIn; + entityIn.riddenByEntity = this; + } + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.setPosition(x, y, z); + this.setRotation(yaw, pitch); + List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D)); + + if (!list.isEmpty()) + { + double d3 = 0.0D; + + for (int j = 0; j < list.size(); ++j) + { + AxisAlignedBB axisalignedbb = (AxisAlignedBB)list.get(j); + + if (axisalignedbb.maxY > d3) + { + d3 = axisalignedbb.maxY; + } + } + + y += d3 - this.boundingBox.minY; + this.setPosition(x, y, z); + } + } + + public float getCollisionBorderSize() + { + return 0.1F; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() + { + return null; + } + + /** + * Called by portal blocks when an entity is within it. + */ + public void setInPortal() + { + if (this.timeUntilPortal > 0) + { + this.timeUntilPortal = this.getPortalCooldown(); + } + else + { + double d0 = this.prevPosX - this.posX; + double d1 = this.prevPosZ - this.posZ; + + if (!this.worldObj.isRemote && !this.inPortal) + { + this.teleportDirection = Direction.getMovementDirection(d0, d1); + } + + this.inPortal = true; + } + } + + /** + * Return the amount of cooldown before this entity can use a portal again. + */ + public int getPortalCooldown() + { + return 300; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) {} + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + @SideOnly(Side.CLIENT) + public void performHurtAnimation() {} + + public ItemStack[] getLastActiveItems() + { + return null; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn) {} + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() + { + boolean flag = this.worldObj != null && this.worldObj.isRemote; + return !this.isImmuneToFire && (this.fire > 0 || flag && this.getFlag(0)); + } + + /** + * Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position + * for players. + */ + public boolean isRiding() + { + return this.ridingEntity != null && ridingEntity.shouldRiderSit(); + } + + /** + * Returns if this entity is sneaking. + */ + public boolean isSneaking() + { + return this.getFlag(1); + } + + /** + * Sets the sneaking flag. + */ + public void setSneaking(boolean sneaking) + { + this.setFlag(1, sneaking); + } + + /** + * Get if the Entity is sprinting. + */ + public boolean isSprinting() + { + return this.getFlag(3); + } + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean sprinting) + { + this.setFlag(3, sprinting); + } + + public boolean isInvisible() + { + return this.getFlag(5); + } + + /** + * Only used by renderer in EntityLivingBase subclasses. + * Determines if an entity is visible or not to a specfic player, if the entity is normally invisible. + * For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent. + */ + @SideOnly(Side.CLIENT) + public boolean isInvisibleToPlayer(EntityPlayer player) + { + return this.isInvisible(); + } + + public void setInvisible(boolean invisible) + { + this.setFlag(5, invisible); + } + + @SideOnly(Side.CLIENT) + public boolean isEating() + { + return this.getFlag(4); + } + + public void setEating(boolean eating) + { + this.setFlag(4, eating); + } + + /** + * Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding + * something; 3) is sprinting; 4) is eating + */ + protected boolean getFlag(int flag) + { + return (this.dataWatcher.getWatchableObjectByte(0) & 1 << flag) != 0; + } + + /** + * Enable or disable a entity flag, see getEntityFlag to read the know flags. + */ + protected void setFlag(int flag, boolean set) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(0); + + if (set) + { + this.dataWatcher.updateObject(0, Byte.valueOf((byte)(b0 | 1 << flag))); + } + else + { + this.dataWatcher.updateObject(0, Byte.valueOf((byte)(b0 & ~(1 << flag)))); + } + } + + public int getAir() + { + return this.dataWatcher.getWatchableObjectShort(1); + } + + public void setAir(int air) + { + this.dataWatcher.updateObject(1, Short.valueOf((short)air)); + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + this.dealFireDamage(5); + ++this.fire; + + if (this.fire == 0) + { + this.setFire(8); + } + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entityLivingIn) {} + + protected boolean func_145771_j(double x, double y, double z) + { + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + double d3 = x - (double)i; + double d4 = y - (double)j; + double d5 = z - (double)k; + List list = this.worldObj.func_147461_a(this.boundingBox); + + if (list.isEmpty() && !this.worldObj.func_147469_q(i, j, k)) + { + return false; + } + else + { + boolean flag = !this.worldObj.func_147469_q(i - 1, j, k); + boolean flag1 = !this.worldObj.func_147469_q(i + 1, j, k); + boolean flag2 = !this.worldObj.func_147469_q(i, j - 1, k); + boolean flag3 = !this.worldObj.func_147469_q(i, j + 1, k); + boolean flag4 = !this.worldObj.func_147469_q(i, j, k - 1); + boolean flag5 = !this.worldObj.func_147469_q(i, j, k + 1); + byte b0 = 3; + double d6 = 9999.0D; + + if (flag && d3 < d6) + { + d6 = d3; + b0 = 0; + } + + if (flag1 && 1.0D - d3 < d6) + { + d6 = 1.0D - d3; + b0 = 1; + } + + if (flag3 && 1.0D - d4 < d6) + { + d6 = 1.0D - d4; + b0 = 3; + } + + if (flag4 && d5 < d6) + { + d6 = d5; + b0 = 4; + } + + if (flag5 && 1.0D - d5 < d6) + { + d6 = 1.0D - d5; + b0 = 5; + } + + float f = this.rand.nextFloat() * 0.2F + 0.1F; + + if (b0 == 0) + { + this.motionX = (double)(-f); + } + + if (b0 == 1) + { + this.motionX = (double)f; + } + + if (b0 == 2) + { + this.motionY = (double)(-f); + } + + if (b0 == 3) + { + this.motionY = (double)f; + } + + if (b0 == 4) + { + this.motionZ = (double)(-f); + } + + if (b0 == 5) + { + this.motionZ = (double)f; + } + + return true; + } + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() + { + this.isInWeb = true; + this.fallDistance = 0.0F; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + String s = EntityList.getEntityString(this); + + if (s == null) + { + s = "generic"; + } + + return StatCollector.translateToLocal("entity." + s + ".name"); + } + + /** + * Return the Entity parts making up this Entity (currently only for dragons) + */ + public Entity[] getParts() + { + return null; + } + + /** + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity entityIn) + { + return this == entityIn; + } + + public float getRotationYawHead() + { + return 0.0F; + } + + /** + * Sets the head's yaw rotation of the entity. + */ + @SideOnly(Side.CLIENT) + public void setRotationYawHead(float rotation) {} + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return true; + } + + /** + * Called when a player attacks an entity. If this returns true the attack will not happen. + */ + public boolean hitByEntity(Entity entityIn) + { + return false; + } + + public String toString() + { + return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[] {this.getClass().getSimpleName(), this.getCommandSenderName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); + } + + /** + * Return whether this entity is invulnerable to damage. + */ + public boolean isEntityInvulnerable() + { + return this.invulnerable; + } + + /** + * Sets this entity's location and angles to the location and angles of the passed in entity. + */ + public void copyLocationAndAnglesFrom(Entity entityIn) + { + this.setLocationAndAngles(entityIn.posX, entityIn.posY, entityIn.posZ, entityIn.rotationYaw, entityIn.rotationPitch); + } + + /** + * Copies important data from another entity to this entity. Used when teleporting entities between worlds, as this + * actually deletes the teleporting entity and re-creates it on the other side. Params: Entity to copy from, unused + * (always true) + */ + public void copyDataFrom(Entity entityIn, boolean unused) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + entityIn.writeToNBT(nbttagcompound); + this.readFromNBT(nbttagcompound); + this.timeUntilPortal = entityIn.timeUntilPortal; + this.teleportDirection = entityIn.teleportDirection; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int dimensionId) + { + if (!this.worldObj.isRemote && !this.isDead) + { + this.worldObj.theProfiler.startSection("changeDimension"); + MinecraftServer minecraftserver = MinecraftServer.getServer(); + int j = this.dimension; + WorldServer worldserver = minecraftserver.worldServerForDimension(j); + WorldServer worldserver1 = minecraftserver.worldServerForDimension(dimensionId); + this.dimension = dimensionId; + + if (j == 1 && dimensionId == 1) + { + worldserver1 = minecraftserver.worldServerForDimension(0); + this.dimension = 0; + } + + this.worldObj.removeEntity(this); + this.isDead = false; + this.worldObj.theProfiler.startSection("reposition"); + minecraftserver.getConfigurationManager().transferEntityToWorld(this, j, worldserver, worldserver1); + this.worldObj.theProfiler.endStartSection("reloading"); + Entity entity = EntityList.createEntityByName(EntityList.getEntityString(this), worldserver1); + + if (entity != null) + { + entity.copyDataFrom(this, true); + + if (j == 1 && dimensionId == 1) + { + ChunkCoordinates chunkcoordinates = worldserver1.getSpawnPoint(); + chunkcoordinates.posY = this.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); + entity.setLocationAndAngles((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, entity.rotationYaw, entity.rotationPitch); + } + + worldserver1.spawnEntityInWorld(entity); + } + + this.isDead = true; + this.worldObj.theProfiler.endSection(); + worldserver.resetUpdateEntityTick(); + worldserver1.resetUpdateEntityTick(); + this.worldObj.theProfiler.endSection(); + } + } + + public float func_145772_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn) + { + return blockIn.getExplosionResistance(this, worldIn, x, y, z, posX, posY + getEyeHeight(), posZ); + } + + public boolean func_145774_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn, float unused) + { + return true; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() + { + return 3; + } + + public int getTeleportDirection() + { + return this.teleportDirection; + } + + /** + * Return whether this entity should NOT trigger a pressure plate or a tripwire. + */ + public boolean doesEntityNotTriggerPressurePlate() + { + return false; + } + + public void addEntityCrashInfo(CrashReportCategory category) + { + category.addCrashSectionCallable("Entity Type", new Callable() + { + private static final String __OBFID = "CL_00001534"; + public String call() + { + return EntityList.getEntityString(Entity.this) + " (" + Entity.this.getClass().getCanonicalName() + ")"; + } + }); + category.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); + category.addCrashSectionCallable("Entity Name", new Callable() + { + private static final String __OBFID = "CL_00001535"; + public String call() + { + return Entity.this.getCommandSenderName(); + } + }); + category.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); + category.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); + category.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); + } + + /** + * Return whether this entity should be rendered as on fire. + */ + @SideOnly(Side.CLIENT) + public boolean canRenderOnFire() + { + return this.isBurning(); + } + + public UUID getUniqueID() + { + return this.entityUniqueID; + } + + public boolean isPushedByWater() + { + return true; + } + + public IChatComponent func_145748_c_() + { + return new ChatComponentText(this.getCommandSenderName()); + } + + public void func_145781_i(int p_145781_1_) {} + + /* ================================== Forge Start =====================================*/ + /** + * Returns a NBTTagCompound that can be used to store custom data for this entity. + * It will be written, and read from disc, so it persists over world saves. + * @return A NBTTagCompound + */ + public NBTTagCompound getEntityData() + { + if (customEntityData == null) + { + customEntityData = new NBTTagCompound(); + } + return customEntityData; + } + + /** + * Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position. + * @return false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation. + */ + public boolean shouldRiderSit() + { + return true; + } + + /** + * Called when a user uses the creative pick block button on this entity. + * + * @param target The full target the player is looking at + * @return A ItemStack to add to the player's inventory, Null if nothing should be added. + */ + public ItemStack getPickedResult(MovingObjectPosition target) + { + if (this instanceof EntityPainting) + { + return new ItemStack(Items.painting); + } + else if (this instanceof EntityLeashKnot) + { + return new ItemStack(Items.lead); + } + else if (this instanceof EntityItemFrame) + { + ItemStack held = ((EntityItemFrame)this).getDisplayedItem(); + if (held == null) + { + return new ItemStack(Items.item_frame); + } + else + { + return held.copy(); + } + } + else if (this instanceof EntityMinecart) + { + return ((EntityMinecart)this).getCartItem(); + } + else if (this instanceof EntityBoat) + { + return new ItemStack(Items.boat); + } + else + { + int id = EntityList.getEntityID(this); + if (id > 0 && EntityList.entityEggs.containsKey(id)) + { + return new ItemStack(Items.spawn_egg, 1, id); + } + } + return null; + } + + public UUID getPersistentID() + { + return entityUniqueID; + } + + /** + * Reset the entity ID to a new value. Not to be used from Mod code + */ + public final void resetEntityId() + { + this.entityId = nextEntityID++; + } + + public boolean shouldRenderInPass(int pass) + { + return pass == 0; + } + + /** + * Returns true if the entity is of the @link{EnumCreatureType} provided + * @param type The EnumCreatureType type this entity is evaluating + * @param forSpawnCount If this is being invoked to check spawn count caps. + * @return If the creature is of the type provided + */ + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { + return type.getCreatureClass().isAssignableFrom(this.getClass()); + } + + /** + * Register the instance of IExtendedProperties into the entity's collection. + * @param identifier The identifier which you can use to retrieve these properties for the entity. + * @param properties The instanceof IExtendedProperties to register + * @return The identifier that was used to register the extended properties. Empty String indicates an error. If your requested key already existed, this will return a modified one that is unique. + */ + public String registerExtendedProperties(String identifier, IExtendedEntityProperties properties) + { + if (identifier == null) + { + FMLLog.warning("Someone is attempting to register extended properties using a null identifier. This is not allowed. Aborting. This may have caused instability."); + return ""; + } + if (properties == null) + { + FMLLog.warning("Someone is attempting to register null extended properties. This is not allowed. Aborting. This may have caused instability."); + return ""; + } + + String baseIdentifier = identifier; + int identifierModCount = 1; + while (this.extendedProperties.containsKey(identifier)) + { + identifier = String.format("%s%d", baseIdentifier, identifierModCount++); + } + + if (baseIdentifier != identifier) + { + FMLLog.info("An attempt was made to register exended properties using an existing key. The duplicate identifier (%s) has been remapped to %s.", baseIdentifier, identifier); + } + + this.extendedProperties.put(identifier, properties); + return identifier; + } + + /** + * Gets the extended properties identified by the passed in key + * @param identifier The key that identifies the extended properties. + * @return The instance of IExtendedProperties that was found, or null. + */ + public IExtendedEntityProperties getExtendedProperties(String identifier) + { + return this.extendedProperties.get(identifier); + } + + /** + * If a rider of this entity can interact with this entity. Should return true on the + * ridden entity if so. + * + * @return if the entity can be interacted with from a rider + */ + public boolean canRiderInteract() + { + return false; + } + + /** + * If the rider should be dismounted from the entity when the entity goes under water + * + * @param rider The entity that is riding + * @return if the entity should be dismounted when under water + */ + public boolean shouldDismountInWater(Entity rider) + { + return this instanceof EntityLivingBase; + } + /* ================================== Forge End =====================================*/ + + public static enum EnumEntitySize + { + SIZE_1, + SIZE_2, + SIZE_3, + SIZE_4, + SIZE_5, + SIZE_6; + + private static final String __OBFID = "CL_00001537"; + + public int multiplyBy32AndRound(double p_75630_1_) + { + double d1 = p_75630_1_ - ((double)MathHelper.floor_double(p_75630_1_) + 0.5D); + + switch (Entity.SwitchEnumEntitySize.field_96565_a[this.ordinal()]) + { + case 1: + if (d1 < 0.0D) + { + if (d1 < -0.3125D) + { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + } + else if (d1 < 0.3125D) + { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + + return MathHelper.floor_double(p_75630_1_ * 32.0D); + case 2: + if (d1 < 0.0D) + { + if (d1 < -0.3125D) + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } + else if (d1 < 0.3125D) + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + case 3: + if (d1 > 0.0D) + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + case 4: + if (d1 < 0.0D) + { + if (d1 < -0.1875D) + { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + } + else if (d1 < 0.1875D) + { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + + return MathHelper.floor_double(p_75630_1_ * 32.0D); + case 5: + if (d1 < 0.0D) + { + if (d1 < -0.1875D) + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } + else if (d1 < 0.1875D) + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + case 6: + default: + if (d1 > 0.0D) + { + return MathHelper.ceiling_double_int(p_75630_1_ * 32.0D); + } + else + { + return MathHelper.floor_double(p_75630_1_ * 32.0D); + } + } + } + } + + static final class SwitchEnumEntitySize + { + static final int[] field_96565_a = new int[Entity.EnumEntitySize.values().length]; + private static final String __OBFID = "CL_00001536"; + + static + { + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_1.ordinal()] = 1; + } + catch (NoSuchFieldError var6) + { + ; + } + + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_2.ordinal()] = 2; + } + catch (NoSuchFieldError var5) + { + ; + } + + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_3.ordinal()] = 3; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_4.ordinal()] = 4; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_5.ordinal()] = 5; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_96565_a[Entity.EnumEntitySize.SIZE_6.ordinal()] = 6; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityAgeable.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityAgeable.java new file mode 100644 index 0000000..c1965be --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityAgeable.java @@ -0,0 +1,196 @@ +package net.minecraft.entity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public abstract class EntityAgeable extends EntityCreature +{ + private float field_98056_d = -1.0F; + private float field_98057_e; + private static final String __OBFID = "CL_00001530"; + + public EntityAgeable(World p_i1578_1_) + { + super(p_i1578_1_); + } + + public abstract EntityAgeable createChild(EntityAgeable p_90011_1_); + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) + { + if (!this.worldObj.isRemote) + { + Class oclass = EntityList.getClassFromID(itemstack.getItemDamage()); + + if (oclass != null && oclass.isAssignableFrom(this.getClass())) + { + EntityAgeable entityageable = this.createChild(this); + + if (entityageable != null) + { + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityageable); + + if (itemstack.hasDisplayName()) + { + entityageable.setCustomNameTag(itemstack.getDisplayName()); + } + + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(12, new Integer(0)); + } + + /** + * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the + * Entity is considered a child. + */ + public int getGrowingAge() + { + return this.dataWatcher.getWatchableObjectInt(12); + } + + /** + * "Adds the value of the parameter times 20 to the age of this entity. If the entity is an adult (if the entity's + * age is greater than 0), it will have no effect." + */ + public void addGrowth(int p_110195_1_) + { + int j = this.getGrowingAge(); + j += p_110195_1_ * 20; + + if (j > 0) + { + j = 0; + } + + this.setGrowingAge(j); + } + + /** + * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's + * positive, it get's decremented each tick. With a negative value the Entity is considered a child. + */ + public void setGrowingAge(int p_70873_1_) + { + this.dataWatcher.updateObject(12, Integer.valueOf(p_70873_1_)); + this.setScaleForAge(this.isChild()); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Age", this.getGrowingAge()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setGrowingAge(tagCompund.getInteger("Age")); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.worldObj.isRemote) + { + this.setScaleForAge(this.isChild()); + } + else + { + int i = this.getGrowingAge(); + + if (i < 0) + { + ++i; + this.setGrowingAge(i); + } + else if (i > 0) + { + --i; + this.setGrowingAge(i); + } + } + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() + { + return this.getGrowingAge() < 0; + } + + /** + * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean p_98054_1_) + { + this.setScale(p_98054_1_ ? 0.5F : 1.0F); + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float width, float height) + { + boolean flag = this.field_98056_d > 0.0F; + this.field_98056_d = width; + this.field_98057_e = height; + + if (!flag) + { + this.setScale(1.0F); + } + } + + protected final void setScale(float p_98055_1_) + { + super.setSize(this.field_98056_d * p_98055_1_, this.field_98057_e * p_98055_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityBodyHelper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityBodyHelper.java new file mode 100644 index 0000000..122a1b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityBodyHelper.java @@ -0,0 +1,70 @@ +package net.minecraft.entity; + +import net.minecraft.util.MathHelper; + +public class EntityBodyHelper +{ + /** Instance of EntityLiving. */ + private EntityLivingBase theLiving; + private int field_75666_b; + private float field_75667_c; + private static final String __OBFID = "CL_00001570"; + + public EntityBodyHelper(EntityLivingBase p_i1611_1_) + { + this.theLiving = p_i1611_1_; + } + + public void func_75664_a() + { + double d0 = this.theLiving.posX - this.theLiving.prevPosX; + double d1 = this.theLiving.posZ - this.theLiving.prevPosZ; + + if (d0 * d0 + d1 * d1 > 2.500000277905201E-7D) + { + this.theLiving.renderYawOffset = this.theLiving.rotationYaw; + this.theLiving.rotationYawHead = this.func_75665_a(this.theLiving.renderYawOffset, this.theLiving.rotationYawHead, 75.0F); + this.field_75667_c = this.theLiving.rotationYawHead; + this.field_75666_b = 0; + } + else + { + float f = 75.0F; + + if (Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) + { + this.field_75666_b = 0; + this.field_75667_c = this.theLiving.rotationYawHead; + } + else + { + ++this.field_75666_b; + boolean flag = true; + + if (this.field_75666_b > 10) + { + f = Math.max(1.0F - (float)(this.field_75666_b - 10) / 10.0F, 0.0F) * 75.0F; + } + } + + this.theLiving.renderYawOffset = this.func_75665_a(this.theLiving.rotationYawHead, this.theLiving.renderYawOffset, f); + } + } + + private float func_75665_a(float p_75665_1_, float p_75665_2_, float p_75665_3_) + { + float f3 = MathHelper.wrapAngleTo180_float(p_75665_1_ - p_75665_2_); + + if (f3 < -p_75665_3_) + { + f3 = -p_75665_3_; + } + + if (f3 >= p_75665_3_) + { + f3 = p_75665_3_; + } + + return p_75665_1_ - f3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityCreature.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityCreature.java new file mode 100644 index 0000000..d9ffbe9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityCreature.java @@ -0,0 +1,396 @@ +package net.minecraft.entity; + +import java.util.UUID; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityCreature extends EntityLiving +{ + public static final UUID field_110179_h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); + public static final AttributeModifier field_110181_i = (new AttributeModifier(field_110179_h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); + private PathEntity pathToEntity; + /** The Entity this EntityCreature is set to attack. */ + protected Entity entityToAttack; + /** returns true if a creature has attacked recently only used for creepers and skeletons */ + protected boolean hasAttacked; + /** Used to make a creature speed up and wander away when hit. */ + protected int fleeingTick; + private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); + /** If -1 there is no maximum distance */ + private float maximumHomeDistance = -1.0F; + private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0D); + private boolean field_110180_bt; + private static final String __OBFID = "CL_00001558"; + + public EntityCreature(World p_i1602_1_) + { + super(p_i1602_1_); + } + + /** + * Disables a mob's ability to move on its own while true. + */ + protected boolean isMovementCeased() + { + return false; + } + + protected void updateEntityActionState() + { + this.worldObj.theProfiler.startSection("ai"); + + if (this.fleeingTick > 0 && --this.fleeingTick == 0) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(field_110181_i); + } + + this.hasAttacked = this.isMovementCeased(); + float f4 = 16.0F; + + if (this.entityToAttack == null) + { + this.entityToAttack = this.findPlayerToAttack(); + + if (this.entityToAttack != null) + { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, f4, true, false, false, true); + } + } + else if (this.entityToAttack.isEntityAlive()) + { + float f = this.entityToAttack.getDistanceToEntity(this); + + if (this.canEntityBeSeen(this.entityToAttack)) + { + this.attackEntity(this.entityToAttack, f); + } + } + else + { + this.entityToAttack = null; + } + + if (this.entityToAttack instanceof EntityPlayerMP && ((EntityPlayerMP)this.entityToAttack).theItemInWorldManager.isCreative()) + { + this.entityToAttack = null; + } + + this.worldObj.theProfiler.endSection(); + + if (!this.hasAttacked && this.entityToAttack != null && (this.pathToEntity == null || this.rand.nextInt(20) == 0)) + { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, f4, true, false, false, true); + } + else if (!this.hasAttacked && (this.pathToEntity == null && this.rand.nextInt(180) == 0 || this.rand.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) + { + this.updateWanderPath(); + } + + int i = MathHelper.floor_double(this.boundingBox.minY + 0.5D); + boolean flag = this.isInWater(); + boolean flag1 = this.handleLavaMovement(); + this.rotationPitch = 0.0F; + + if (this.pathToEntity != null && this.rand.nextInt(100) != 0) + { + this.worldObj.theProfiler.startSection("followpath"); + Vec3 vec3 = this.pathToEntity.getPosition(this); + double d0 = (double)(this.width * 2.0F); + + while (vec3 != null && vec3.squareDistanceTo(this.posX, vec3.yCoord, this.posZ) < d0 * d0) + { + this.pathToEntity.incrementPathIndex(); + + if (this.pathToEntity.isFinished()) + { + vec3 = null; + this.pathToEntity = null; + } + else + { + vec3 = this.pathToEntity.getPosition(this); + } + } + + this.isJumping = false; + + if (vec3 != null) + { + double d1 = vec3.xCoord - this.posX; + double d2 = vec3.zCoord - this.posZ; + double d3 = vec3.yCoord - (double)i; + float f1 = (float)(Math.atan2(d2, d1) * 180.0D / Math.PI) - 90.0F; + float f2 = MathHelper.wrapAngleTo180_float(f1 - this.rotationYaw); + this.moveForward = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + + if (f2 > 30.0F) + { + f2 = 30.0F; + } + + if (f2 < -30.0F) + { + f2 = -30.0F; + } + + this.rotationYaw += f2; + + if (this.hasAttacked && this.entityToAttack != null) + { + double d4 = this.entityToAttack.posX - this.posX; + double d5 = this.entityToAttack.posZ - this.posZ; + float f3 = this.rotationYaw; + this.rotationYaw = (float)(Math.atan2(d5, d4) * 180.0D / Math.PI) - 90.0F; + f2 = (f3 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F; + this.moveStrafing = -MathHelper.sin(f2) * this.moveForward * 1.0F; + this.moveForward = MathHelper.cos(f2) * this.moveForward * 1.0F; + } + + if (d3 > 0.0D) + { + this.isJumping = true; + } + } + + if (this.entityToAttack != null) + { + this.faceEntity(this.entityToAttack, 30.0F, 30.0F); + } + + if (this.isCollidedHorizontally && !this.hasPath()) + { + this.isJumping = true; + } + + if (this.rand.nextFloat() < 0.8F && (flag || flag1)) + { + this.isJumping = true; + } + + this.worldObj.theProfiler.endSection(); + } + else + { + super.updateEntityActionState(); + this.pathToEntity = null; + } + } + + /** + * Time remaining during which the Animal is sped up and flees. + */ + protected void updateWanderPath() + { + this.worldObj.theProfiler.startSection("stroll"); + boolean flag = false; + int i = -1; + int j = -1; + int k = -1; + float f = -99999.0F; + + for (int l = 0; l < 10; ++l) + { + int i1 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(13) - 6.0D); + int j1 = MathHelper.floor_double(this.posY + (double)this.rand.nextInt(7) - 3.0D); + int k1 = MathHelper.floor_double(this.posZ + (double)this.rand.nextInt(13) - 6.0D); + float f1 = this.getBlockPathWeight(i1, j1, k1); + + if (f1 > f) + { + f = f1; + i = i1; + j = j1; + k = k1; + flag = true; + } + } + + if (flag) + { + this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, i, j, k, 10.0F, true, false, false, true); + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) {} + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) + { + return 0.0F; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + return null; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.boundingBox.minY); + int k = MathHelper.floor_double(this.posZ); + return super.getCanSpawnHere() && this.getBlockPathWeight(i, j, k) >= 0.0F; + } + + /** + * if the entity has a PathEntity to follow, it returns true, else false + */ + public boolean hasPath() + { + return this.pathToEntity != null; + } + + /** + * sets the EntityCreature's walk path + */ + public void setPathToEntity(PathEntity p_70778_1_) + { + this.pathToEntity = p_70778_1_; + } + + /** + * returns the target Entity + */ + public Entity getEntityToAttack() + { + return this.entityToAttack; + } + + /** + * Sets the entity which is to be attacked. + */ + public void setTarget(Entity p_70784_1_) + { + this.entityToAttack = p_70784_1_; + } + + public boolean isWithinHomeDistanceCurrentPosition() + { + return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + } + + public boolean isWithinHomeDistance(int p_110176_1_, int p_110176_2_, int p_110176_3_) + { + return this.maximumHomeDistance == -1.0F ? true : this.homePosition.getDistanceSquared(p_110176_1_, p_110176_2_, p_110176_3_) < this.maximumHomeDistance * this.maximumHomeDistance; + } + + public void setHomeArea(int p_110171_1_, int p_110171_2_, int p_110171_3_, int p_110171_4_) + { + this.homePosition.set(p_110171_1_, p_110171_2_, p_110171_3_); + this.maximumHomeDistance = (float)p_110171_4_; + } + + /** + * Returns the chunk coordinate object of the home position. + */ + public ChunkCoordinates getHomePosition() + { + return this.homePosition; + } + + public float func_110174_bM() + { + return this.maximumHomeDistance; + } + + public void detachHome() + { + this.maximumHomeDistance = -1.0F; + } + + /** + * Returns whether a home area is defined for this entity. + */ + public boolean hasHome() + { + return this.maximumHomeDistance != -1.0F; + } + + /** + * Applies logic related to leashes, for example dragging the entity or breaking the leash. + */ + protected void updateLeashedState() + { + super.updateLeashedState(); + + if (this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) + { + Entity entity = this.getLeashedToEntity(); + this.setHomeArea((int)entity.posX, (int)entity.posY, (int)entity.posZ, 5); + float f = this.getDistanceToEntity(entity); + + if (this instanceof EntityTameable && ((EntityTameable)this).isSitting()) + { + if (f > 10.0F) + { + this.clearLeashed(true, true); + } + + return; + } + + if (!this.field_110180_bt) + { + this.tasks.addTask(2, this.field_110178_bs); + this.getNavigator().setAvoidsWater(false); + this.field_110180_bt = true; + } + + this.func_142017_o(f); + + if (f > 4.0F) + { + this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); + } + + if (f > 6.0F) + { + double d0 = (entity.posX - this.posX) / (double)f; + double d1 = (entity.posY - this.posY) / (double)f; + double d2 = (entity.posZ - this.posZ) / (double)f; + this.motionX += d0 * Math.abs(d0) * 0.4D; + this.motionY += d1 * Math.abs(d1) * 0.4D; + this.motionZ += d2 * Math.abs(d2) * 0.4D; + } + + if (f > 10.0F) + { + this.clearLeashed(true, true); + } + } + else if (!this.getLeashed() && this.field_110180_bt) + { + this.field_110180_bt = false; + this.tasks.removeTask(this.field_110178_bs); + this.getNavigator().setAvoidsWater(true); + this.detachHome(); + } + } + + protected void func_142017_o(float p_142017_1_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityFlying.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityFlying.java new file mode 100644 index 0000000..b66e64b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityFlying.java @@ -0,0 +1,92 @@ +package net.minecraft.entity; + +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityFlying extends EntityLiving +{ + private static final String __OBFID = "CL_00001545"; + + public EntityFlying(World p_i1587_1_) + { + super(p_i1587_1_); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) {} + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + { + if (this.isInWater()) + { + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + } + else if (this.handleLavaMovement()) + { + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + else + { + float f2 = 0.91F; + + if (this.onGround) + { + f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + this.moveFlying(p_70612_1_, p_70612_2_, this.onGround ? 0.1F * f3 : 0.02F); + f2 = 0.91F; + + if (this.onGround) + { + f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= (double)f2; + this.motionY *= (double)f2; + this.motionZ *= (double)f2; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityHanging.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityHanging.java new file mode 100644 index 0000000..68b5212 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityHanging.java @@ -0,0 +1,356 @@ +package net.minecraft.entity; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.Direction; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityHanging extends Entity +{ + private int tickCounter1; + public int hangingDirection; + public int field_146063_b; + public int field_146064_c; + public int field_146062_d; + private static final String __OBFID = "CL_00001546"; + + public EntityHanging(World p_i1588_1_) + { + super(p_i1588_1_); + this.yOffset = 0.0F; + this.setSize(0.5F, 0.5F); + } + + public EntityHanging(World p_i1589_1_, int p_i1589_2_, int p_i1589_3_, int p_i1589_4_, int p_i1589_5_) + { + this(p_i1589_1_); + this.field_146063_b = p_i1589_2_; + this.field_146064_c = p_i1589_3_; + this.field_146062_d = p_i1589_4_; + } + + protected void entityInit() {} + + public void setDirection(int p_82328_1_) + { + this.hangingDirection = p_82328_1_; + this.prevRotationYaw = this.rotationYaw = (float)(p_82328_1_ * 90); + float f = (float)this.getWidthPixels(); + float f1 = (float)this.getHeightPixels(); + float f2 = (float)this.getWidthPixels(); + + if (p_82328_1_ != 2 && p_82328_1_ != 0) + { + f = 0.5F; + } + else + { + f2 = 0.5F; + this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[p_82328_1_] * 90); + } + + f /= 32.0F; + f1 /= 32.0F; + f2 /= 32.0F; + float f3 = (float)this.field_146063_b + 0.5F; + float f4 = (float)this.field_146064_c + 0.5F; + float f5 = (float)this.field_146062_d + 0.5F; + float f6 = 0.5625F; + + if (p_82328_1_ == 2) + { + f5 -= f6; + } + + if (p_82328_1_ == 1) + { + f3 -= f6; + } + + if (p_82328_1_ == 0) + { + f5 += f6; + } + + if (p_82328_1_ == 3) + { + f3 += f6; + } + + if (p_82328_1_ == 2) + { + f3 -= this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 1) + { + f5 += this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 0) + { + f3 += this.func_70517_b(this.getWidthPixels()); + } + + if (p_82328_1_ == 3) + { + f5 -= this.func_70517_b(this.getWidthPixels()); + } + + f4 += this.func_70517_b(this.getHeightPixels()); + this.setPosition((double)f3, (double)f4, (double)f5); + float f7 = -0.03125F; + this.boundingBox.setBounds((double)(f3 - f - f7), (double)(f4 - f1 - f7), (double)(f5 - f2 - f7), (double)(f3 + f + f7), (double)(f4 + f1 + f7), (double)(f5 + f2 + f7)); + } + + private float func_70517_b(int p_70517_1_) + { + return p_70517_1_ == 32 ? 0.5F : (p_70517_1_ == 64 ? 0.5F : 0.0F); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) + { + this.tickCounter1 = 0; + + if (!this.isDead && !this.onValidSurface()) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + } + + /** + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() + { + if (!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) + { + return false; + } + else + { + int i = Math.max(1, this.getWidthPixels() / 16); + int j = Math.max(1, this.getHeightPixels() / 16); + int k = this.field_146063_b; + int l = this.field_146064_c; + int i1 = this.field_146062_d; + + if (this.hangingDirection == 2) + { + k = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 1) + { + i1 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 0) + { + k = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + + if (this.hangingDirection == 3) + { + i1 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + + l = MathHelper.floor_double(this.posY - (double)((float)this.getHeightPixels() / 32.0F)); + + for (int j1 = 0; j1 < i; ++j1) + { + for (int k1 = 0; k1 < j; ++k1) + { + Material material; + + if (this.hangingDirection != 2 && this.hangingDirection != 0) + { + material = this.worldObj.getBlock(this.field_146063_b, l + k1, i1 + j1).getMaterial(); + } + else + { + material = this.worldObj.getBlock(k + j1, l + k1, this.field_146062_d).getMaterial(); + } + + if (!material.isSolid()) + { + return false; + } + } + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox); + Iterator iterator = list.iterator(); + Entity entity; + + do + { + if (!iterator.hasNext()) + { + return true; + } + + entity = (Entity)iterator.next(); + } + while (!(entity instanceof EntityHanging)); + + return false; + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return true; + } + + /** + * Called when a player attacks an entity. If this returns true the attack will not happen. + */ + public boolean hitByEntity(Entity entityIn) + { + return entityIn instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)entityIn), 0.0F) : false; + } + + public void func_145781_i(int p_145781_1_) + { + this.worldObj.func_147450_X(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + if (!this.isDead && !this.worldObj.isRemote) + { + this.setDead(); + this.setBeenAttacked(); + this.onBroken(source.getEntity()); + } + + return true; + } + } + + /** + * Tries to moves the entity by the passed in displacement. Args: x, y, z + */ + public void moveEntity(double x, double y, double z) + { + if (!this.worldObj.isRemote && !this.isDead && x * x + y * y + z * z > 0.0D) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + + /** + * Adds to the current velocity of the entity. Args: x, y, z + */ + public void addVelocity(double x, double y, double z) + { + if (!this.worldObj.isRemote && !this.isDead && x * x + y * y + z * z > 0.0D) + { + this.setDead(); + this.onBroken((Entity)null); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setByte("Direction", (byte)this.hangingDirection); + tagCompound.setInteger("TileX", this.field_146063_b); + tagCompound.setInteger("TileY", this.field_146064_c); + tagCompound.setInteger("TileZ", this.field_146062_d); + + switch (this.hangingDirection) + { + case 0: + tagCompound.setByte("Dir", (byte)2); + break; + case 1: + tagCompound.setByte("Dir", (byte)1); + break; + case 2: + tagCompound.setByte("Dir", (byte)0); + break; + case 3: + tagCompound.setByte("Dir", (byte)3); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + if (tagCompund.hasKey("Direction", 99)) + { + this.hangingDirection = tagCompund.getByte("Direction"); + } + else + { + switch (tagCompund.getByte("Dir")) + { + case 0: + this.hangingDirection = 2; + break; + case 1: + this.hangingDirection = 1; + break; + case 2: + this.hangingDirection = 0; + break; + case 3: + this.hangingDirection = 3; + } + } + + this.field_146063_b = tagCompund.getInteger("TileX"); + this.field_146064_c = tagCompund.getInteger("TileY"); + this.field_146062_d = tagCompund.getInteger("TileZ"); + this.setDirection(this.hangingDirection); + } + + public abstract int getWidthPixels(); + + public abstract int getHeightPixels(); + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public abstract void onBroken(Entity p_110128_1_); + + protected boolean shouldSetPosAfterLoading() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLeashKnot.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLeashKnot.java new file mode 100644 index 0000000..0cccab8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLeashKnot.java @@ -0,0 +1,181 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class EntityLeashKnot extends EntityHanging +{ + private static final String __OBFID = "CL_00001548"; + + public EntityLeashKnot(World p_i1592_1_) + { + super(p_i1592_1_); + } + + public EntityLeashKnot(World p_i1593_1_, int p_i1593_2_, int p_i1593_3_, int p_i1593_4_) + { + super(p_i1593_1_, p_i1593_2_, p_i1593_3_, p_i1593_4_, 0); + this.setPosition((double)p_i1593_2_ + 0.5D, (double)p_i1593_3_ + 0.5D, (double)p_i1593_4_ + 0.5D); + } + + protected void entityInit() + { + super.entityInit(); + } + + public void setDirection(int p_82328_1_) {} + + public int getWidthPixels() + { + return 9; + } + + public int getHeightPixels() + { + return 9; + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 1024.0D; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) {} + + /** + * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this + * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their + * rider. + */ + public boolean writeToNBTOptional(NBTTagCompound tagCompund) + { + return false; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) {} + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + ItemStack itemstack = player.getHeldItem(); + boolean flag = false; + double d0; + List list; + Iterator iterator; + EntityLiving entityliving; + + if (itemstack != null && itemstack.getItem() == Items.lead && !this.worldObj.isRemote) + { + d0 = 7.0D; + list = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + d0, this.posZ + d0)); + + if (list != null) + { + iterator = list.iterator(); + + while (iterator.hasNext()) + { + entityliving = (EntityLiving)iterator.next(); + + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == player) + { + entityliving.setLeashedToEntity(this, true); + flag = true; + } + } + } + } + + if (!this.worldObj.isRemote && !flag) + { + this.setDead(); + + if (player.capabilities.isCreativeMode) + { + d0 = 7.0D; + list = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + d0, this.posZ + d0)); + + if (list != null) + { + iterator = list.iterator(); + + while (iterator.hasNext()) + { + entityliving = (EntityLiving)iterator.next(); + + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == this) + { + entityliving.clearLeashed(true, false); + } + } + } + } + } + + return true; + } + + /** + * checks to make sure painting can be placed there + */ + public boolean onValidSurface() + { + return this.worldObj.getBlock(this.field_146063_b, this.field_146064_c, this.field_146062_d).getRenderType() == 11; + } + + public static EntityLeashKnot func_110129_a(World p_110129_0_, int p_110129_1_, int p_110129_2_, int p_110129_3_) + { + EntityLeashKnot entityleashknot = new EntityLeashKnot(p_110129_0_, p_110129_1_, p_110129_2_, p_110129_3_); + entityleashknot.forceSpawn = true; + p_110129_0_.spawnEntityInWorld(entityleashknot); + return entityleashknot; + } + + public static EntityLeashKnot getKnotForBlock(World p_110130_0_, int p_110130_1_, int p_110130_2_, int p_110130_3_) + { + List list = p_110130_0_.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getBoundingBox((double)p_110130_1_ - 1.0D, (double)p_110130_2_ - 1.0D, (double)p_110130_3_ - 1.0D, (double)p_110130_1_ + 1.0D, (double)p_110130_2_ + 1.0D, (double)p_110130_3_ + 1.0D)); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLeashKnot entityleashknot = (EntityLeashKnot)iterator.next(); + + if (entityleashknot.field_146063_b == p_110130_1_ && entityleashknot.field_146064_c == p_110130_2_ && entityleashknot.field_146062_d == p_110130_3_) + { + return entityleashknot; + } + } + } + + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityList.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityList.java new file mode 100644 index 0000000..6ff3d29 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityList.java @@ -0,0 +1,361 @@ +package net.minecraft.entity; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.entity.item.EntityMinecartEmpty; +import net.minecraft.entity.item.EntityMinecartFurnace; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityCaveSpider; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityGiantZombie; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySilverfish; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySnowman; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.FMLLog; + +public class EntityList +{ + private static final Logger logger = LogManager.getLogger(); + /** Provides a mapping between entity classes and a string */ + public static Map stringToClassMapping = new HashMap(); + /** Provides a mapping between a string and an entity classes */ + public static Map classToStringMapping = new HashMap(); + /** provides a mapping between an entityID and an Entity Class */ + public static Map IDtoClassMapping = new HashMap(); + /** provides a mapping between an Entity Class and an entity ID */ + private static Map classToIDMapping = new HashMap(); + /** Maps entity names to their numeric identifiers */ + private static Map stringToIDMapping = new HashMap(); + /** This is a HashMap of the Creative Entity Eggs/Spawners. */ + public static HashMap entityEggs = new LinkedHashMap(); + private static final String __OBFID = "CL_00001538"; + + /** + * adds a mapping between Entity classes and both a string representation and an ID + */ + public static void addMapping(Class p_75618_0_, String p_75618_1_, int p_75618_2_) + { + if (p_75618_2_ < 0 || p_75618_2_ > 255) throw new IllegalArgumentException("Attempted to register a entity with invalid ID: " + p_75618_2_ + " Name: " + p_75618_1_ + " Class: " + p_75618_0_); + if (stringToClassMapping.containsKey(p_75618_1_)) + { + throw new IllegalArgumentException("ID is already registered: " + p_75618_1_); + } + else if (IDtoClassMapping.containsKey(Integer.valueOf(p_75618_2_))) + { + throw new IllegalArgumentException("ID is already registered: " + p_75618_2_); + } + else + { + stringToClassMapping.put(p_75618_1_, p_75618_0_); + classToStringMapping.put(p_75618_0_, p_75618_1_); + IDtoClassMapping.put(Integer.valueOf(p_75618_2_), p_75618_0_); + classToIDMapping.put(p_75618_0_, Integer.valueOf(p_75618_2_)); + stringToIDMapping.put(p_75618_1_, Integer.valueOf(p_75618_2_)); + } + } + + /** + * Adds a entity mapping with egg info. + */ + public static void addMapping(Class p_75614_0_, String p_75614_1_, int p_75614_2_, int p_75614_3_, int p_75614_4_) + { + addMapping(p_75614_0_, p_75614_1_, p_75614_2_); + entityEggs.put(Integer.valueOf(p_75614_2_), new EntityList.EntityEggInfo(p_75614_2_, p_75614_3_, p_75614_4_)); + } + + /** + * Create a new instance of an entity in the world by using the entity name. + */ + public static Entity createEntityByName(String p_75620_0_, World p_75620_1_) + { + Entity entity = null; + + try + { + Class oclass = (Class)stringToClassMapping.get(p_75620_0_); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75620_1_}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + return entity; + } + + /** + * create a new instance of an entity from NBT store + */ + public static Entity createEntityFromNBT(NBTTagCompound p_75615_0_, World p_75615_1_) + { + Entity entity = null; + + if ("Minecart".equals(p_75615_0_.getString("id"))) + { + switch (p_75615_0_.getInteger("Type")) + { + case 0: + p_75615_0_.setString("id", "MinecartRideable"); + break; + case 1: + p_75615_0_.setString("id", "MinecartChest"); + break; + case 2: + p_75615_0_.setString("id", "MinecartFurnace"); + } + + p_75615_0_.removeTag("Type"); + } + + Class oclass = null; + try + { + oclass = (Class)stringToClassMapping.get(p_75615_0_.getString("id")); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75615_1_}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (entity != null) + { + try + { + entity.readFromNBT(p_75615_0_); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, + "An Entity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", + p_75615_0_.getString("id"), oclass.getName()); + entity = null; + } + } + else + { + logger.warn("Skipping Entity with id " + p_75615_0_.getString("id")); + } + + return entity; + } + + /** + * Create a new instance of an entity in the world by using an entity ID. + */ + public static Entity createEntityByID(int p_75616_0_, World p_75616_1_) + { + Entity entity = null; + + try + { + Class oclass = getClassFromID(p_75616_0_); + + if (oclass != null) + { + entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_75616_1_}); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (entity == null) + { + logger.warn("Skipping Entity with id " + p_75616_0_); + } + + return entity; + } + + /** + * gets the entityID of a specific entity + */ + public static int getEntityID(Entity p_75619_0_) + { + Class oclass = p_75619_0_.getClass(); + return classToIDMapping.containsKey(oclass) ? ((Integer)classToIDMapping.get(oclass)).intValue() : 0; + } + + /** + * Return the class assigned to this entity ID. + */ + public static Class getClassFromID(int p_90035_0_) + { + return (Class)IDtoClassMapping.get(Integer.valueOf(p_90035_0_)); + } + + /** + * Gets the string representation of a specific entity. + */ + public static String getEntityString(Entity p_75621_0_) + { + return (String)classToStringMapping.get(p_75621_0_.getClass()); + } + + /** + * Finds the class using IDtoClassMapping and classToStringMapping + */ + public static String getStringFromID(int p_75617_0_) + { + Class oclass = getClassFromID(p_75617_0_); + return oclass != null ? (String)classToStringMapping.get(oclass) : null; + } + + public static void func_151514_a() {} + + public static Set func_151515_b() + { + return Collections.unmodifiableSet(stringToIDMapping.keySet()); + } + + static + { + addMapping(EntityItem.class, "Item", 1); + addMapping(EntityXPOrb.class, "XPOrb", 2); + addMapping(EntityLeashKnot.class, "LeashKnot", 8); + addMapping(EntityPainting.class, "Painting", 9); + addMapping(EntityArrow.class, "Arrow", 10); + addMapping(EntitySnowball.class, "Snowball", 11); + addMapping(EntityLargeFireball.class, "Fireball", 12); + addMapping(EntitySmallFireball.class, "SmallFireball", 13); + addMapping(EntityEnderPearl.class, "ThrownEnderpearl", 14); + addMapping(EntityEnderEye.class, "EyeOfEnderSignal", 15); + addMapping(EntityPotion.class, "ThrownPotion", 16); + addMapping(EntityExpBottle.class, "ThrownExpBottle", 17); + addMapping(EntityItemFrame.class, "ItemFrame", 18); + addMapping(EntityWitherSkull.class, "WitherSkull", 19); + addMapping(EntityTNTPrimed.class, "PrimedTnt", 20); + addMapping(EntityFallingBlock.class, "FallingSand", 21); + addMapping(EntityFireworkRocket.class, "FireworksRocketEntity", 22); + addMapping(EntityBoat.class, "Boat", 41); + addMapping(EntityMinecartEmpty.class, "MinecartRideable", 42); + addMapping(EntityMinecartChest.class, "MinecartChest", 43); + addMapping(EntityMinecartFurnace.class, "MinecartFurnace", 44); + addMapping(EntityMinecartTNT.class, "MinecartTNT", 45); + addMapping(EntityMinecartHopper.class, "MinecartHopper", 46); + addMapping(EntityMinecartMobSpawner.class, "MinecartSpawner", 47); + addMapping(EntityMinecartCommandBlock.class, "MinecartCommandBlock", 40); + addMapping(EntityLiving.class, "Mob", 48); + addMapping(EntityMob.class, "Monster", 49); + addMapping(EntityCreeper.class, "Creeper", 50, 894731, 0); + addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889); + addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646); + addMapping(EntityGiantZombie.class, "Giant", 53); + addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893); + addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542); + addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084); + addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705); + addMapping(EntityEnderman.class, "Enderman", 58, 1447446, 0); + addMapping(EntityCaveSpider.class, "CaveSpider", 59, 803406, 11013646); + addMapping(EntitySilverfish.class, "Silverfish", 60, 7237230, 3158064); + addMapping(EntityBlaze.class, "Blaze", 61, 16167425, 16775294); + addMapping(EntityMagmaCube.class, "LavaSlime", 62, 3407872, 16579584); + addMapping(EntityDragon.class, "EnderDragon", 63); + addMapping(EntityWither.class, "WitherBoss", 64); + addMapping(EntityBat.class, "Bat", 65, 4996656, 986895); + addMapping(EntityWitch.class, "Witch", 66, 3407872, 5349438); + addMapping(EntityPig.class, "Pig", 90, 15771042, 14377823); + addMapping(EntitySheep.class, "Sheep", 91, 15198183, 16758197); + addMapping(EntityCow.class, "Cow", 92, 4470310, 10592673); + addMapping(EntityChicken.class, "Chicken", 93, 10592673, 16711680); + addMapping(EntitySquid.class, "Squid", 94, 2243405, 7375001); + addMapping(EntityWolf.class, "Wolf", 95, 14144467, 13545366); + addMapping(EntityMooshroom.class, "MushroomCow", 96, 10489616, 12040119); + addMapping(EntitySnowman.class, "SnowMan", 97); + addMapping(EntityOcelot.class, "Ozelot", 98, 15720061, 5653556); + addMapping(EntityIronGolem.class, "VillagerGolem", 99); + addMapping(EntityHorse.class, "EntityHorse", 100, 12623485, 15656192); + addMapping(EntityVillager.class, "Villager", 120, 5651507, 12422002); + addMapping(EntityEnderCrystal.class, "EnderCrystal", 200); + } + + public static class EntityEggInfo + { + /** The entityID of the spawned mob */ + public final int spawnedID; + /** Base color of the egg */ + public final int primaryColor; + /** Color of the egg spots */ + public final int secondaryColor; + public final StatBase field_151512_d; + public final StatBase field_151513_e; + private static final String __OBFID = "CL_00001539"; + + public EntityEggInfo(int p_i1583_1_, int p_i1583_2_, int p_i1583_3_) + { + this.spawnedID = p_i1583_1_; + this.primaryColor = p_i1583_2_; + this.secondaryColor = p_i1583_3_; + this.field_151512_d = StatList.func_151182_a(this); + this.field_151513_e = StatList.func_151176_b(this); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLiving.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLiving.java new file mode 100644 index 0000000..171617e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLiving.java @@ -0,0 +1,1286 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.EntityAITasks; +import net.minecraft.entity.ai.EntityJumpHelper; +import net.minecraft.entity.ai.EntityLookHelper; +import net.minecraft.entity.ai.EntityMoveHelper; +import net.minecraft.entity.ai.EntitySenses; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.ForgeHooks; +import cpw.mods.fml.common.eventhandler.Event.Result; +import net.minecraftforge.event.ForgeEventFactory; + +public abstract class EntityLiving extends EntityLivingBase +{ + /** Number of ticks since this EntityLiving last produced its sound */ + public int livingSoundTime; + /** The experience points the Entity gives. */ + protected int experienceValue; + private EntityLookHelper lookHelper; + private EntityMoveHelper moveHelper; + /** Entity jumping helper */ + private EntityJumpHelper jumpHelper; + private EntityBodyHelper bodyHelper; + private PathNavigate navigator; + public final EntityAITasks tasks; + public final EntityAITasks targetTasks; + /** The active target the Task system uses for tracking */ + private EntityLivingBase attackTarget; + private EntitySenses senses; + /** Equipment (armor and held item) for this entity. */ + private ItemStack[] equipment = new ItemStack[5]; + /** Chances for each equipment piece from dropping when this entity dies. */ + protected float[] equipmentDropChances = new float[5]; + /** Whether this entity can pick up items from the ground. */ + private boolean canPickUpLoot; + /** Whether this entity should NOT despawn. */ + private boolean persistenceRequired; + protected float defaultPitch; + /** This entity's current target. */ + private Entity currentTarget; + /** How long to keep a specific target entity */ + protected int numTicksToChaseTarget; + private boolean isLeashed; + private Entity leashedToEntity; + private NBTTagCompound field_110170_bx; + private static final String __OBFID = "CL_00001550"; + + public EntityLiving(World p_i1595_1_) + { + super(p_i1595_1_); + this.tasks = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.theProfiler != null ? p_i1595_1_.theProfiler : null); + this.targetTasks = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.theProfiler != null ? p_i1595_1_.theProfiler : null); + this.lookHelper = new EntityLookHelper(this); + this.moveHelper = new EntityMoveHelper(this); + this.jumpHelper = new EntityJumpHelper(this); + this.bodyHelper = new EntityBodyHelper(this); + this.navigator = new PathNavigate(this, p_i1595_1_); + this.senses = new EntitySenses(this); + + for (int i = 0; i < this.equipmentDropChances.length; ++i) + { + this.equipmentDropChances[i] = 0.085F; + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D); + } + + public EntityLookHelper getLookHelper() + { + return this.lookHelper; + } + + public EntityMoveHelper getMoveHelper() + { + return this.moveHelper; + } + + public EntityJumpHelper getJumpHelper() + { + return this.jumpHelper; + } + + public PathNavigate getNavigator() + { + return this.navigator; + } + + /** + * returns the EntitySenses Object for the EntityLiving + */ + public EntitySenses getEntitySenses() + { + return this.senses; + } + + /** + * Gets the active target the Task system uses for tracking + */ + public EntityLivingBase getAttackTarget() + { + return this.attackTarget; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase p_70624_1_) + { + this.attackTarget = p_70624_1_; + ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_); + } + + /** + * Returns true if this entity can attack entities of the specified class. + */ + public boolean canAttackClass(Class p_70686_1_) + { + return EntityCreeper.class != p_70686_1_ && EntityGhast.class != p_70686_1_; + } + + /** + * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This + * function is used in the AIEatGrass) + */ + public void eatGrassBonus() {} + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(11, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(10, ""); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 80; + } + + /** + * Plays living's sound at its position + */ + public void playLivingSound() + { + String s = this.getLivingSound(); + + if (s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() + { + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("mobBaseTick"); + + if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) + { + this.livingSoundTime = -this.getTalkInterval(); + this.playLivingSound(); + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + if (this.experienceValue > 0) + { + int i = this.experienceValue; + ItemStack[] aitemstack = this.getLastActiveItems(); + + for (int j = 0; j < aitemstack.length; ++j) + { + if (aitemstack[j] != null && this.equipmentDropChances[j] <= 1.0F) + { + i += 1 + this.rand.nextInt(3); + } + } + + return i; + } + else + { + return this.experienceValue; + } + } + + /** + * Spawns an explosion particle around the Entity's location + */ + public void spawnExplosionParticle() + { + for (int i = 0; i < 20; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + double d3 = 10.0D; + this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - d0 * d3, this.posY + (double)(this.rand.nextFloat() * this.height) - d1 * d3, this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - d2 * d3, d0, d1, d2); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + this.updateLeashedState(); + } + } + + protected float func_110146_f(float p_110146_1_, float p_110146_2_) + { + if (this.isAIEnabled()) + { + this.bodyHelper.func_75664_a(); + return p_110146_2_; + } + else + { + return super.func_110146_f(p_110146_1_, p_110146_2_); + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return null; + } + + protected Item getDropItem() + { + return Item.getItemById(0); + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + Item item = this.getDropItem(); + + if (item != null) + { + int j = this.rand.nextInt(3); + + if (p_70628_2_ > 0) + { + j += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int k = 0; k < j; ++k) + { + this.dropItem(item, 1); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); + tagCompound.setBoolean("PersistenceRequired", this.persistenceRequired); + NBTTagList nbttaglist = new NBTTagList(); + NBTTagCompound nbttagcompound1; + + for (int i = 0; i < this.equipment.length; ++i) + { + nbttagcompound1 = new NBTTagCompound(); + + if (this.equipment[i] != null) + { + this.equipment[i].writeToNBT(nbttagcompound1); + } + + nbttaglist.appendTag(nbttagcompound1); + } + + tagCompound.setTag("Equipment", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + + for (int j = 0; j < this.equipmentDropChances.length; ++j) + { + nbttaglist1.appendTag(new NBTTagFloat(this.equipmentDropChances[j])); + } + + tagCompound.setTag("DropChances", nbttaglist1); + tagCompound.setString("CustomName", this.getCustomNameTag()); + tagCompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); + tagCompound.setBoolean("Leashed", this.isLeashed); + + if (this.leashedToEntity != null) + { + nbttagcompound1 = new NBTTagCompound(); + + if (this.leashedToEntity instanceof EntityLivingBase) + { + nbttagcompound1.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); + nbttagcompound1.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); + } + else if (this.leashedToEntity instanceof EntityHanging) + { + EntityHanging entityhanging = (EntityHanging)this.leashedToEntity; + nbttagcompound1.setInteger("X", entityhanging.field_146063_b); + nbttagcompound1.setInteger("Y", entityhanging.field_146064_c); + nbttagcompound1.setInteger("Z", entityhanging.field_146062_d); + } + + tagCompound.setTag("Leash", nbttagcompound1); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setCanPickUpLoot(tagCompund.getBoolean("CanPickUpLoot")); + this.persistenceRequired = tagCompund.getBoolean("PersistenceRequired"); + + if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) + { + this.setCustomNameTag(tagCompund.getString("CustomName")); + } + + this.setAlwaysRenderNameTag(tagCompund.getBoolean("CustomNameVisible")); + NBTTagList nbttaglist; + int i; + + if (tagCompund.hasKey("Equipment", 9)) + { + nbttaglist = tagCompund.getTagList("Equipment", 10); + + for (i = 0; i < this.equipment.length; ++i) + { + this.equipment[i] = ItemStack.loadItemStackFromNBT(nbttaglist.getCompoundTagAt(i)); + } + } + + if (tagCompund.hasKey("DropChances", 9)) + { + nbttaglist = tagCompund.getTagList("DropChances", 5); + + for (i = 0; i < nbttaglist.tagCount(); ++i) + { + this.equipmentDropChances[i] = nbttaglist.func_150308_e(i); + } + } + + this.isLeashed = tagCompund.getBoolean("Leashed"); + + if (this.isLeashed && tagCompund.hasKey("Leash", 10)) + { + this.field_110170_bx = tagCompund.getCompoundTag("Leash"); + } + } + + public void setMoveForward(float p_70657_1_) + { + this.moveForward = p_70657_1_; + } + + /** + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float p_70659_1_) + { + super.setAIMoveSpeed(p_70659_1_); + this.setMoveForward(p_70659_1_); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.worldObj.theProfiler.startSection("looting"); + + if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + List list = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(1.0D, 0.0D, 1.0D)); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityItem entityitem = (EntityItem)iterator.next(); + + if (!entityitem.isDead && entityitem.getEntityItem() != null) + { + ItemStack itemstack = entityitem.getEntityItem(); + int i = getArmorPosition(itemstack); + + if (i > -1) + { + boolean flag = true; + ItemStack itemstack1 = this.getEquipmentInSlot(i); + + if (itemstack1 != null) + { + if (i == 0) + { + if (itemstack.getItem() instanceof ItemSword && !(itemstack1.getItem() instanceof ItemSword)) + { + flag = true; + } + else if (itemstack.getItem() instanceof ItemSword && itemstack1.getItem() instanceof ItemSword) + { + ItemSword itemsword = (ItemSword)itemstack.getItem(); + ItemSword itemsword1 = (ItemSword)itemstack1.getItem(); + + if (itemsword.func_150931_i() == itemsword1.func_150931_i()) + { + flag = itemstack.getItemDamage() > itemstack1.getItemDamage() || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + else + { + flag = itemsword.func_150931_i() > itemsword1.func_150931_i(); + } + } + else + { + flag = false; + } + } + else if (itemstack.getItem() instanceof ItemArmor && !(itemstack1.getItem() instanceof ItemArmor)) + { + flag = true; + } + else if (itemstack.getItem() instanceof ItemArmor && itemstack1.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); + ItemArmor itemarmor1 = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.damageReduceAmount == itemarmor1.damageReduceAmount) + { + flag = itemstack.getItemDamage() > itemstack1.getItemDamage() || itemstack.hasTagCompound() && !itemstack1.hasTagCompound(); + } + else + { + flag = itemarmor.damageReduceAmount > itemarmor1.damageReduceAmount; + } + } + else + { + flag = false; + } + } + + if (flag) + { + if (itemstack1 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[i]) + { + this.entityDropItem(itemstack1, 0.0F); + } + + if (itemstack.getItem() == Items.diamond && entityitem.func_145800_j() != null) + { + EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(entityitem.func_145800_j()); + + if (entityplayer != null) + { + entityplayer.triggerAchievement(AchievementList.field_150966_x); + } + } + + this.setCurrentItemOrArmor(i, itemstack); + this.equipmentDropChances[i] = 2.0F; + this.persistenceRequired = true; + this.onItemPickup(entityitem, 1); + entityitem.setDead(); + } + } + } + } + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return false; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return true; + } + + /** + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() + { + Result result = null; + if (this.persistenceRequired) + { + this.entityAge = 0; + } + else if ((this.entityAge & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT) + { + if (result == Result.DENY) + { + this.entityAge = 0; + } + else + { + this.setDead(); + } + } + else + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, -1.0D); + + if (entityplayer != null) + { + double d0 = entityplayer.posX - this.posX; + double d1 = entityplayer.posY - this.posY; + double d2 = entityplayer.posZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (this.canDespawn() && d3 > 16384.0D) + { + this.setDead(); + } + + if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && d3 > 1024.0D && this.canDespawn()) + { + this.setDead(); + } + else if (d3 < 1024.0D) + { + this.entityAge = 0; + } + } + } + } + + protected void updateAITasks() + { + ++this.entityAge; + this.worldObj.theProfiler.startSection("checkDespawn"); + this.despawnEntity(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("sensing"); + this.senses.clearSensingCache(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("targetSelector"); + this.targetTasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("goalSelector"); + this.tasks.onUpdateTasks(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("navigation"); + this.navigator.onUpdateNavigation(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("mob tick"); + this.updateAITick(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("controls"); + this.worldObj.theProfiler.startSection("move"); + this.moveHelper.onUpdateMoveHelper(); + this.worldObj.theProfiler.endStartSection("look"); + this.lookHelper.onUpdateLook(); + this.worldObj.theProfiler.endStartSection("jump"); + this.jumpHelper.doJump(); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.endSection(); + } + + protected void updateEntityActionState() + { + super.updateEntityActionState(); + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.despawnEntity(); + float f = 8.0F; + + if (this.rand.nextFloat() < 0.02F) + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, (double)f); + + if (entityplayer != null) + { + this.currentTarget = entityplayer; + this.numTicksToChaseTarget = 10 + this.rand.nextInt(20); + } + else + { + this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + } + + if (this.currentTarget != null) + { + this.faceEntity(this.currentTarget, 10.0F, (float)this.getVerticalFaceSpeed()); + + if (this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(f * f)) + { + this.currentTarget = null; + } + } + else + { + if (this.rand.nextFloat() < 0.05F) + { + this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + + this.rotationYaw += this.randomYawVelocity; + this.rotationPitch = this.defaultPitch; + } + + boolean flag1 = this.isInWater(); + boolean flag = this.handleLavaMovement(); + + if (flag1 || flag) + { + this.isJumping = this.rand.nextFloat() < 0.8F; + } + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return 40; + } + + /** + * Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. + */ + public void faceEntity(Entity p_70625_1_, float p_70625_2_, float p_70625_3_) + { + double d0 = p_70625_1_.posX - this.posX; + double d2 = p_70625_1_.posZ - this.posZ; + double d1; + + if (p_70625_1_ instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)p_70625_1_; + d1 = entitylivingbase.posY + (double)entitylivingbase.getEyeHeight() - (this.posY + (double)this.getEyeHeight()); + } + else + { + d1 = (p_70625_1_.boundingBox.minY + p_70625_1_.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); + } + + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); + float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + this.rotationPitch = this.updateRotation(this.rotationPitch, f3, p_70625_3_); + this.rotationYaw = this.updateRotation(this.rotationYaw, f2, p_70625_2_); + } + + /** + * Arguments: current rotation, intended rotation, max increment. + */ + private float updateRotation(float p_70663_1_, float p_70663_2_, float p_70663_3_) + { + float f3 = MathHelper.wrapAngleTo180_float(p_70663_2_ - p_70663_1_); + + if (f3 > p_70663_3_) + { + f3 = p_70663_3_; + } + + if (f3 < -p_70663_3_) + { + f3 = -p_70663_3_; + } + + return p_70663_1_ + f3; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * Returns render size modifier + */ + public float getRenderSizeModifier() + { + return 1.0F; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 4; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() + { + if (this.getAttackTarget() == null) + { + return 3; + } + else + { + int i = (int)(this.getHealth() - this.getMaxHealth() * 0.33F); + i -= (3 - this.worldObj.difficultySetting.getDifficultyId()) * 4; + + if (i < 0) + { + i = 0; + } + + return i + 3; + } + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() + { + return this.equipment[0]; + } + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int p_71124_1_) + { + return this.equipment[p_71124_1_]; + } + + public ItemStack func_130225_q(int p_130225_1_) + { + return this.equipment[p_130225_1_ + 1]; + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn) + { + this.equipment[slotIn] = itemStackIn; + } + + public ItemStack[] getLastActiveItems() + { + return this.equipment; + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) + { + for (int j = 0; j < this.getLastActiveItems().length; ++j) + { + ItemStack itemstack = this.getEquipmentInSlot(j); + boolean flag1 = this.equipmentDropChances[j] > 1.0F; + + if (itemstack != null && (p_82160_1_ || flag1) && this.rand.nextFloat() - (float)p_82160_2_ * 0.01F < this.equipmentDropChances[j]) + { + if (!flag1 && itemstack.isItemStackDamageable()) + { + int k = Math.max(itemstack.getMaxDamage() - 25, 1); + int l = itemstack.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(k) + 1); + + if (l > k) + { + l = k; + } + + if (l < 1) + { + l = 1; + } + + itemstack.setItemDamage(l); + } + + this.entityDropItem(itemstack, 0.0F); + } + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() + { + if (this.rand.nextFloat() < 0.15F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)) + { + int i = this.rand.nextInt(2); + float f = this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.1F : 0.25F; + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + if (this.rand.nextFloat() < 0.095F) + { + ++i; + } + + for (int j = 3; j >= 0; --j) + { + ItemStack itemstack = this.func_130225_q(j); + + if (j < 3 && this.rand.nextFloat() < f) + { + break; + } + + if (itemstack == null) + { + Item item = getArmorItemForSlot(j + 1, i); + + if (item != null) + { + this.setCurrentItemOrArmor(j + 1, new ItemStack(item)); + } + } + } + } + } + + public static int getArmorPosition(ItemStack p_82159_0_) + { + if (p_82159_0_.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && p_82159_0_.getItem() != Items.skull) + { + if (p_82159_0_.getItem() instanceof ItemArmor) + { + switch (((ItemArmor)p_82159_0_.getItem()).armorType) + { + case 0: + return 4; + case 1: + return 3; + case 2: + return 2; + case 3: + return 1; + } + } + + return 0; + } + else + { + return 4; + } + } + + /** + * Params: Armor slot, Item tier + */ + public static Item getArmorItemForSlot(int armorSlot, int itemTier) + { + switch (armorSlot) + { + case 4: + if (itemTier == 0) + { + return Items.leather_helmet; + } + else if (itemTier == 1) + { + return Items.golden_helmet; + } + else if (itemTier == 2) + { + return Items.chainmail_helmet; + } + else if (itemTier == 3) + { + return Items.iron_helmet; + } + else if (itemTier == 4) + { + return Items.diamond_helmet; + } + case 3: + if (itemTier == 0) + { + return Items.leather_chestplate; + } + else if (itemTier == 1) + { + return Items.golden_chestplate; + } + else if (itemTier == 2) + { + return Items.chainmail_chestplate; + } + else if (itemTier == 3) + { + return Items.iron_chestplate; + } + else if (itemTier == 4) + { + return Items.diamond_chestplate; + } + case 2: + if (itemTier == 0) + { + return Items.leather_leggings; + } + else if (itemTier == 1) + { + return Items.golden_leggings; + } + else if (itemTier == 2) + { + return Items.chainmail_leggings; + } + else if (itemTier == 3) + { + return Items.iron_leggings; + } + else if (itemTier == 4) + { + return Items.diamond_leggings; + } + case 1: + if (itemTier == 0) + { + return Items.leather_boots; + } + else if (itemTier == 1) + { + return Items.golden_boots; + } + else if (itemTier == 2) + { + return Items.chainmail_boots; + } + else if (itemTier == 3) + { + return Items.iron_boots; + } + else if (itemTier == 4) + { + return Items.diamond_boots; + } + default: + return null; + } + } + + /** + * Enchants the entity's armor and held item based on difficulty + */ + protected void enchantEquipment() + { + float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * f) + { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + f * (float)this.rand.nextInt(18))); + } + + for (int i = 0; i < 4; ++i) + { + ItemStack itemstack = this.func_130225_q(i); + + if (itemstack != null && this.rand.nextFloat() < 0.5F * f) + { + EnchantmentHelper.addRandomEnchantment(this.rand, itemstack, (int)(5.0F + f * (float)this.rand.nextInt(18))); + } + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); + return p_110161_1_; + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() + { + return false; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return this.hasCustomNameTag() ? this.getCustomNameTag() : super.getCommandSenderName(); + } + + public void func_110163_bv() + { + this.persistenceRequired = true; + } + + public void setCustomNameTag(String p_94058_1_) + { + this.dataWatcher.updateObject(10, p_94058_1_); + } + + public String getCustomNameTag() + { + return this.dataWatcher.getWatchableObjectString(10); + } + + public boolean hasCustomNameTag() + { + return this.dataWatcher.getWatchableObjectString(10).length() > 0; + } + + public void setAlwaysRenderNameTag(boolean p_94061_1_) + { + this.dataWatcher.updateObject(11, Byte.valueOf((byte)(p_94061_1_ ? 1 : 0))); + } + + public boolean getAlwaysRenderNameTag() + { + return this.dataWatcher.getWatchableObjectByte(11) == 1; + } + + @SideOnly(Side.CLIENT) + public boolean getAlwaysRenderNameTagForRender() + { + return this.getAlwaysRenderNameTag(); + } + + public void setEquipmentDropChance(int p_96120_1_, float p_96120_2_) + { + this.equipmentDropChances[p_96120_1_] = p_96120_2_; + } + + public boolean canPickUpLoot() + { + return this.canPickUpLoot; + } + + public void setCanPickUpLoot(boolean p_98053_1_) + { + this.canPickUpLoot = p_98053_1_; + } + + public boolean isNoDespawnRequired() + { + return this.persistenceRequired; + } + + /** + * First layer of player interaction + */ + public final boolean interactFirst(EntityPlayer player) + { + if (this.getLeashed() && this.getLeashedToEntity() == player) + { + this.clearLeashed(true, !player.capabilities.isCreativeMode); + return true; + } + else + { + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.lead && this.allowLeashing()) + { + if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) + { + this.setLeashedToEntity(player, true); + --itemstack.stackSize; + return true; + } + + if (((EntityTameable)this).func_152114_e(player)) + { + this.setLeashedToEntity(player, true); + --itemstack.stackSize; + return true; + } + } + + return this.interact(player) ? true : super.interactFirst(player); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer p_70085_1_) + { + return false; + } + + /** + * Applies logic related to leashes, for example dragging the entity or breaking the leash. + */ + protected void updateLeashedState() + { + if (this.field_110170_bx != null) + { + this.recreateLeash(); + } + + if (this.isLeashed) + { + if (this.leashedToEntity == null || this.leashedToEntity.isDead) + { + this.clearLeashed(true, true); + } + } + } + + /** + * Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players. + */ + public void clearLeashed(boolean p_110160_1_, boolean p_110160_2_) + { + if (this.isLeashed) + { + this.isLeashed = false; + this.leashedToEntity = null; + + if (!this.worldObj.isRemote && p_110160_2_) + { + this.dropItem(Items.lead, 1); + } + + if (!this.worldObj.isRemote && p_110160_1_ && this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, (Entity)null)); + } + } + } + + public boolean allowLeashing() + { + return !this.getLeashed() && !(this instanceof IMob); + } + + public boolean getLeashed() + { + return this.isLeashed; + } + + public Entity getLeashedToEntity() + { + return this.leashedToEntity; + } + + /** + * Sets the entity to be leashed to. + * Args: + * @param par1Entity: The entity to be tethered to. + * @param par2: Whether to send an attaching notification packet to surrounding players. + */ + public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) + { + this.isLeashed = true; + this.leashedToEntity = entityIn; + + if (!this.worldObj.isRemote && sendAttachNotification && this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S1BPacketEntityAttach(1, this, this.leashedToEntity)); + } + } + + private void recreateLeash() + { + if (this.isLeashed && this.field_110170_bx != null) + { + if (this.field_110170_bx.hasKey("UUIDMost", 4) && this.field_110170_bx.hasKey("UUIDLeast", 4)) + { + UUID uuid = new UUID(this.field_110170_bx.getLong("UUIDMost"), this.field_110170_bx.getLong("UUIDLeast")); + List list = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(10.0D, 10.0D, 10.0D)); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)iterator.next(); + + if (entitylivingbase.getUniqueID().equals(uuid)) + { + this.leashedToEntity = entitylivingbase; + break; + } + } + } + else if (this.field_110170_bx.hasKey("X", 99) && this.field_110170_bx.hasKey("Y", 99) && this.field_110170_bx.hasKey("Z", 99)) + { + int i = this.field_110170_bx.getInteger("X"); + int j = this.field_110170_bx.getInteger("Y"); + int k = this.field_110170_bx.getInteger("Z"); + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForBlock(this.worldObj, i, j, k); + + if (entityleashknot == null) + { + entityleashknot = EntityLeashKnot.func_110129_a(this.worldObj, i, j, k); + } + + this.leashedToEntity = entityleashknot; + } + else + { + this.clearLeashed(false, true); + } + } + + this.field_110170_bx = null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLivingBase.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLivingBase.java new file mode 100644 index 0000000..6dfa995 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityLivingBase.java @@ -0,0 +1,2346 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagFloat; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.scoreboard.Team; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.CombatTracker; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.ForgeHooks; + +public abstract class EntityLivingBase extends Entity +{ + private static final UUID sprintingSpeedBoostModifierUUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); + private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); + private BaseAttributeMap attributeMap; + private final CombatTracker _combatTracker = new CombatTracker(this); + private final HashMap activePotionsMap = new HashMap(); + /** The equipment this mob was previously wearing, used for syncing. */ + private final ItemStack[] previousEquipment = new ItemStack[5]; + /** Whether an arm swing is currently in progress. */ + public boolean isSwingInProgress; + public int swingProgressInt; + public int arrowHitTimer; + public float prevHealth; + /** The amount of time remaining this entity should act 'hurt'. (Visual appearance of red tint) */ + public int hurtTime; + /** What the hurt time was max set to last. */ + public int maxHurtTime; + /** The yaw at which this entity was last attacked from. */ + public float attackedAtYaw; + /** The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world. */ + public int deathTime; + public int attackTime; + public float prevSwingProgress; + public float swingProgress; + public float prevLimbSwingAmount; + public float limbSwingAmount; + /** + * Only relevant when limbYaw is not 0(the entity is moving). Influences where in its swing legs and arms currently + * are. + */ + public float limbSwing; + public int maxHurtResistantTime = 20; + public float prevCameraPitch; + public float cameraPitch; + public float field_70769_ao; + public float field_70770_ap; + public float renderYawOffset; + public float prevRenderYawOffset; + /** Entity head rotation yaw */ + public float rotationYawHead; + /** Entity head rotation yaw at previous tick */ + public float prevRotationYawHead; + /** A factor used to determine how far this entity will move each tick if it is jumping or falling. */ + public float jumpMovementFactor = 0.02F; + /** The most recent player that has attacked this entity */ + protected EntityPlayer attackingPlayer; + /** + * Set to 60 when hit by the player or the player's wolf, then decrements. Used to determine whether the entity + * should drop items on death. + */ + protected int recentlyHit; + /** This gets set on entity death, but never used. Looks like a duplicate of isDead */ + protected boolean dead; + /** The age of this EntityLiving (used to determine when it dies) */ + protected int entityAge; + protected float field_70768_au; + protected float field_110154_aX; + protected float field_70764_aw; + protected float field_70763_ax; + protected float field_70741_aB; + /** The score value of the Mob, the amount of points the mob is worth. */ + protected int scoreValue; + /** Damage taken in the last hit. Mobs are resistant to damage less than this for a short time after taking damage. */ + protected float lastDamage; + /** used to check whether entity is jumping. */ + protected boolean isJumping; + public float moveStrafing; + public float moveForward; + protected float randomYawVelocity; + /** The number of updates over which the new position and rotation are to be applied to the entity. */ + protected int newPosRotationIncrements; + /** The new X position to be applied to the entity. */ + protected double newPosX; + /** The new Y position to be applied to the entity. */ + protected double newPosY; + protected double newPosZ; + /** The new yaw rotation to be applied to the entity. */ + protected double newRotationYaw; + /** The new yaw rotation to be applied to the entity. */ + protected double newRotationPitch; + /** Whether the DataWatcher needs to be updated with the active potions */ + private boolean potionsNeedUpdate = true; + /** is only being set, has no uses as of MC 1.1 */ + private EntityLivingBase entityLivingToAttack; + private int revengeTimer; + private EntityLivingBase lastAttacker; + /** Holds the value of ticksExisted when setLastAttacker was last called. */ + private int lastAttackerTime; + /** + * A factor used to determine how far this entity will move each tick if it is walking on land. Adjusted by speed, + * and slipperiness of the current block. + */ + private float landMovementFactor; + /** Number of ticks since last jump */ + private int jumpTicks; + private float field_110151_bq; + private static final String __OBFID = "CL_00001549"; + + public EntityLivingBase(World p_i1594_1_) + { + super(p_i1594_1_); + this.applyEntityAttributes(); + this.setHealth(this.getMaxHealth()); + this.preventEntitySpawning = true; + this.field_70770_ap = (float)(Math.random() + 1.0D) * 0.01F; + this.setPosition(this.posX, this.posY, this.posZ); + this.field_70769_ao = (float)Math.random() * 12398.0F; + this.rotationYaw = (float)(Math.random() * Math.PI * 2.0D); + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 0.5F; + } + + protected void entityInit() + { + this.dataWatcher.addObject(7, Integer.valueOf(0)); + this.dataWatcher.addObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(9, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(6, Float.valueOf(1.0F)); + } + + protected void applyEntityAttributes() + { + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); + + if (!this.isAIEnabled()) + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.10000000149011612D); + } + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) + { + if (!this.isInWater()) + { + this.handleWaterMovement(); + } + + if (isOnGround && this.fallDistance > 0.0F) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(i, j, k); + + if (block.getMaterial() == Material.air) + { + int l = this.worldObj.getBlock(i, j - 1, k).getRenderType(); + + if (l == 11 || l == 32 || l == 21) + { + block = this.worldObj.getBlock(i, j - 1, k); + } + } + else if (!this.worldObj.isRemote && this.fallDistance > 3.0F) + { + this.worldObj.playAuxSFX(2006, i, j, k, MathHelper.ceiling_float_int(this.fallDistance - 3.0F)); + } + + block.onFallenUpon(this.worldObj, i, j, k, this, this.fallDistance); + } + + super.updateFallState(distanceFallenThisTick, isOnGround); + } + + public boolean canBreatheUnderwater() + { + return false; + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() + { + this.prevSwingProgress = this.swingProgress; + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("livingEntityBaseTick"); + + if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) + { + this.attackEntityFrom(DamageSource.inWall, 1.0F); + } + + if (this.isImmuneToFire() || this.worldObj.isRemote) + { + this.extinguish(); + } + + boolean flag = this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.disableDamage; + + if (this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) + { + if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !flag) + { + this.setAir(this.decreaseAirSupply(this.getAir())); + + if (this.getAir() == -20) + { + this.setAir(0); + + for (int i = 0; i < 8; ++i) + { + float f = this.rand.nextFloat() - this.rand.nextFloat(); + float f1 = this.rand.nextFloat() - this.rand.nextFloat(); + float f2 = this.rand.nextFloat() - this.rand.nextFloat(); + this.worldObj.spawnParticle("bubble", this.posX + (double)f, this.posY + (double)f1, this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ); + } + + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + + if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity != null && ridingEntity.shouldDismountInWater(this)) + { + this.mountEntity((Entity)null); + } + } + else + { + this.setAir(300); + } + + if (this.isEntityAlive() && this.isWet()) + { + this.extinguish(); + } + + this.prevCameraPitch = this.cameraPitch; + + if (this.attackTime > 0) + { + --this.attackTime; + } + + if (this.hurtTime > 0) + { + --this.hurtTime; + } + + if (this.hurtResistantTime > 0 && !(this instanceof EntityPlayerMP)) + { + --this.hurtResistantTime; + } + + if (this.getHealth() <= 0.0F) + { + this.onDeathUpdate(); + } + + if (this.recentlyHit > 0) + { + --this.recentlyHit; + } + else + { + this.attackingPlayer = null; + } + + if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) + { + this.lastAttacker = null; + } + + if (this.entityLivingToAttack != null) + { + if (!this.entityLivingToAttack.isEntityAlive()) + { + this.setRevengeTarget((EntityLivingBase)null); + } + else if (this.ticksExisted - this.revengeTimer > 100) + { + this.setRevengeTarget((EntityLivingBase)null); + } + } + + this.updatePotionEffects(); + this.field_70763_ax = this.field_70764_aw; + this.prevRenderYawOffset = this.renderYawOffset; + this.prevRotationYawHead = this.rotationYawHead; + this.prevRotationYaw = this.rotationYaw; + this.prevRotationPitch = this.rotationPitch; + this.worldObj.theProfiler.endSection(); + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() + { + return false; + } + + /** + * handles entity death timer, experience orb and particle creation + */ + protected void onDeathUpdate() + { + ++this.deathTime; + + if (this.deathTime == 20) + { + int i; + + if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) + { + i = this.getExperiencePoints(this.attackingPlayer); + + while (i > 0) + { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + } + + this.setDead(); + + for (i = 0; i < 20; ++i) + { + double d2 = this.rand.nextGaussian() * 0.02D; + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d2, d0, d1); + } + } + } + + protected boolean func_146066_aG() + { + return !this.isChild(); + } + + /** + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int p_70682_1_) + { + int j = EnchantmentHelper.getRespiration(this); + return j > 0 && this.rand.nextInt(j + 1) > 0 ? p_70682_1_ : p_70682_1_ - 1; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 0; + } + + /** + * Only use is to identify if class is an instance of player for experience dropping + */ + protected boolean isPlayer() + { + return false; + } + + public Random getRNG() + { + return this.rand; + } + + public EntityLivingBase getAITarget() + { + return this.entityLivingToAttack; + } + + public int func_142015_aE() + { + return this.revengeTimer; + } + + public void setRevengeTarget(EntityLivingBase p_70604_1_) + { + this.entityLivingToAttack = p_70604_1_; + this.revengeTimer = this.ticksExisted; + ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_); + } + + public EntityLivingBase getLastAttacker() + { + return this.lastAttacker; + } + + public int getLastAttackerTime() + { + return this.lastAttackerTime; + } + + public void setLastAttacker(Entity p_130011_1_) + { + if (p_130011_1_ instanceof EntityLivingBase) + { + this.lastAttacker = (EntityLivingBase)p_130011_1_; + } + else + { + this.lastAttacker = null; + } + + this.lastAttackerTime = this.ticksExisted; + } + + public int getAge() + { + return this.entityAge; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setFloat("HealF", this.getHealth()); + tagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); + tagCompound.setShort("HurtTime", (short)this.hurtTime); + tagCompound.setShort("DeathTime", (short)this.deathTime); + tagCompound.setShort("AttackTime", (short)this.attackTime); + tagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); + ItemStack[] aitemstack = this.getLastActiveItems(); + int i = aitemstack.length; + int j; + ItemStack itemstack; + + for (j = 0; j < i; ++j) + { + itemstack = aitemstack[j]; + + if (itemstack != null) + { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + } + + tagCompound.setTag("Attributes", SharedMonsterAttributes.writeBaseAttributeMapToNBT(this.getAttributeMap())); + aitemstack = this.getLastActiveItems(); + i = aitemstack.length; + + for (j = 0; j < i; ++j) + { + itemstack = aitemstack[j]; + + if (itemstack != null) + { + this.attributeMap.applyAttributeModifiers(itemstack.getAttributeModifiers()); + } + } + + if (!this.activePotionsMap.isEmpty()) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.activePotionsMap.values().iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + nbttaglist.appendTag(potioneffect.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + + tagCompound.setTag("ActiveEffects", nbttaglist); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.setAbsorptionAmount(tagCompund.getFloat("AbsorptionAmount")); + + if (tagCompund.hasKey("Attributes", 9) && this.worldObj != null && !this.worldObj.isRemote) + { + SharedMonsterAttributes.func_151475_a(this.getAttributeMap(), tagCompund.getTagList("Attributes", 10)); + } + + if (tagCompund.hasKey("ActiveEffects", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("ActiveEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound1); + + if (potioneffect != null) + { + this.activePotionsMap.put(Integer.valueOf(potioneffect.getPotionID()), potioneffect); + } + } + } + + if (tagCompund.hasKey("HealF", 99)) + { + this.setHealth(tagCompund.getFloat("HealF")); + } + else + { + NBTBase nbtbase = tagCompund.getTag("Health"); + + if (nbtbase == null) + { + this.setHealth(this.getMaxHealth()); + } + else if (nbtbase.getId() == 5) + { + this.setHealth(((NBTTagFloat)nbtbase).func_150288_h()); + } + else if (nbtbase.getId() == 2) + { + this.setHealth((float)((NBTTagShort)nbtbase).func_150289_e()); + } + } + + this.hurtTime = tagCompund.getShort("HurtTime"); + this.deathTime = tagCompund.getShort("DeathTime"); + this.attackTime = tagCompund.getShort("AttackTime"); + } + + protected void updatePotionEffects() + { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = (Integer)iterator.next(); + PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.get(integer); + + if (!potioneffect.onUpdate(this)) + { + if (!this.worldObj.isRemote) + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } + else if (potioneffect.getDuration() % 600 == 0) + { + this.onChangedPotionEffect(potioneffect, false); + } + } + + int i; + + if (this.potionsNeedUpdate) + { + if (!this.worldObj.isRemote) + { + if (this.activePotionsMap.isEmpty()) + { + this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); + this.dataWatcher.updateObject(7, Integer.valueOf(0)); + this.setInvisible(false); + } + else + { + i = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); + this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.activePotionsMap.values()) ? 1 : 0))); + this.dataWatcher.updateObject(7, Integer.valueOf(i)); + this.setInvisible(this.isPotionActive(Potion.invisibility.id)); + } + } + + this.potionsNeedUpdate = false; + } + + i = this.dataWatcher.getWatchableObjectInt(7); + boolean flag1 = this.dataWatcher.getWatchableObjectByte(8) > 0; + + if (i > 0) + { + boolean flag = false; + + if (!this.isInvisible()) + { + flag = this.rand.nextBoolean(); + } + else + { + flag = this.rand.nextInt(15) == 0; + } + + if (flag1) + { + flag &= this.rand.nextInt(5) == 0; + } + + if (flag && i > 0) + { + double d0 = (double)(i >> 16 & 255) / 255.0D; + double d1 = (double)(i >> 8 & 255) / 255.0D; + double d2 = (double)(i >> 0 & 255) / 255.0D; + this.worldObj.spawnParticle(flag1 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, d0, d1, d2); + } + } + } + + public void clearActivePotions() + { + Iterator iterator = this.activePotionsMap.keySet().iterator(); + + while (iterator.hasNext()) + { + Integer integer = (Integer)iterator.next(); + PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.get(integer); + + if (!this.worldObj.isRemote) + { + iterator.remove(); + this.onFinishedPotionEffect(potioneffect); + } + } + } + + public Collection getActivePotionEffects() + { + return this.activePotionsMap.values(); + } + + public boolean isPotionActive(int p_82165_1_) + { + return this.activePotionsMap.containsKey(Integer.valueOf(p_82165_1_)); + } + + public boolean isPotionActive(Potion p_70644_1_) + { + return this.activePotionsMap.containsKey(Integer.valueOf(p_70644_1_.id)); + } + + /** + * returns the PotionEffect for the supplied Potion if it is active, null otherwise. + */ + public PotionEffect getActivePotionEffect(Potion p_70660_1_) + { + return (PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70660_1_.id)); + } + + /** + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect p_70690_1_) + { + if (this.isPotionApplicable(p_70690_1_)) + { + if (this.activePotionsMap.containsKey(Integer.valueOf(p_70690_1_.getPotionID()))) + { + ((PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70690_1_.getPotionID()))).combine(p_70690_1_); + this.onChangedPotionEffect((PotionEffect)this.activePotionsMap.get(Integer.valueOf(p_70690_1_.getPotionID())), true); + } + else + { + this.activePotionsMap.put(Integer.valueOf(p_70690_1_.getPotionID()), p_70690_1_); + this.onNewPotionEffect(p_70690_1_); + } + } + } + + public boolean isPotionApplicable(PotionEffect p_70687_1_) + { + if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) + { + int i = p_70687_1_.getPotionID(); + + if (i == Potion.regeneration.id || i == Potion.poison.id) + { + return false; + } + } + + return true; + } + + /** + * Returns true if this entity is undead. + */ + public boolean isEntityUndead() + { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + + /** + * Remove the speified potion effect from this entity. + */ + public void removePotionEffectClient(int p_70618_1_) + { + this.activePotionsMap.remove(Integer.valueOf(p_70618_1_)); + } + + /** + * Remove the specified potion effect from this entity. + */ + public void removePotionEffect(int p_82170_1_) + { + PotionEffect potioneffect = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(p_82170_1_)); + + if (potioneffect != null) + { + this.onFinishedPotionEffect(potioneffect); + } + } + + protected void onNewPotionEffect(PotionEffect p_70670_1_) + { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isRemote) + { + Potion.potionTypes[p_70670_1_.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), p_70670_1_.getAmplifier()); + } + } + + protected void onChangedPotionEffect(PotionEffect p_70695_1_, boolean p_70695_2_) + { + this.potionsNeedUpdate = true; + + if (p_70695_2_ && !this.worldObj.isRemote) + { + Potion.potionTypes[p_70695_1_.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), p_70695_1_.getAmplifier()); + Potion.potionTypes[p_70695_1_.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), p_70695_1_.getAmplifier()); + } + } + + protected void onFinishedPotionEffect(PotionEffect p_70688_1_) + { + this.potionsNeedUpdate = true; + + if (!this.worldObj.isRemote) + { + Potion.potionTypes[p_70688_1_.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), p_70688_1_.getAmplifier()); + } + } + + /** + * Heal living entity (param: amount of half-hearts) + */ + public void heal(float p_70691_1_) + { + p_70691_1_ = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, p_70691_1_); + if (p_70691_1_ <= 0) return; + float f1 = this.getHealth(); + + if (f1 > 0.0F) + { + this.setHealth(f1 + p_70691_1_); + } + } + + public final float getHealth() + { + return this.dataWatcher.getWatchableObjectFloat(6); + } + + public void setHealth(float p_70606_1_) + { + this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(p_70606_1_, 0.0F, this.getMaxHealth()))); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (ForgeHooks.onLivingAttack(this, source, amount)) return false; + if (this.isEntityInvulnerable()) + { + return false; + } + else if (this.worldObj.isRemote) + { + return false; + } + else + { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) + { + return false; + } + else if (source.isFireDamage() && this.isPotionActive(Potion.fireResistance)) + { + return false; + } + else + { + if ((source == DamageSource.anvil || source == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) + { + this.getEquipmentInSlot(4).damageItem((int)(amount * 4.0F + this.rand.nextFloat() * amount * 2.0F), this); + amount *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean flag = true; + + if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) + { + if (amount <= this.lastDamage) + { + return false; + } + + this.damageEntity(source, amount - this.lastDamage); + this.lastDamage = amount; + flag = false; + } + else + { + this.lastDamage = amount; + this.prevHealth = this.getHealth(); + this.hurtResistantTime = this.maxHurtResistantTime; + this.damageEntity(source, amount); + this.hurtTime = this.maxHurtTime = 10; + } + + this.attackedAtYaw = 0.0F; + Entity entity = source.getEntity(); + + if (entity != null) + { + if (entity instanceof EntityLivingBase) + { + this.setRevengeTarget((EntityLivingBase)entity); + } + + if (entity instanceof EntityPlayer) + { + this.recentlyHit = 100; + this.attackingPlayer = (EntityPlayer)entity; + } + else if (entity instanceof net.minecraft.entity.passive.EntityTameable) + { + net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity; + + if (entitywolf.isTamed()) + { + this.recentlyHit = 100; + this.attackingPlayer = null; + } + } + } + + if (flag) + { + this.worldObj.setEntityState(this, (byte)2); + + if (source != DamageSource.drown) + { + this.setBeenAttacked(); + } + + if (entity != null) + { + double d1 = entity.posX - this.posX; + double d0; + + for (d0 = entity.posZ - this.posZ; d1 * d1 + d0 * d0 < 1.0E-4D; d0 = (Math.random() - Math.random()) * 0.01D) + { + d1 = (Math.random() - Math.random()) * 0.01D; + } + + this.attackedAtYaw = (float)(Math.atan2(d0, d1) * 180.0D / Math.PI) - this.rotationYaw; + this.knockBack(entity, amount, d1, d0); + } + else + { + this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); + } + } + + String s; + + if (this.getHealth() <= 0.0F) + { + s = this.getDeathSound(); + + if (flag && s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + + this.onDeath(source); + } + else + { + s = this.getHurtSound(); + + if (flag && s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + } + + return true; + } + } + } + + /** + * Renders broken item particles using the given ItemStack + */ + public void renderBrokenItemStack(ItemStack p_70669_1_) + { + this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); + + for (int i = 0; i < 5; ++i) + { + Vec3 vec3 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + vec3.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + Vec3 vec31 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + vec31.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + vec31.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + this.worldObj.spawnParticle("iconcrack_" + Item.getIdFromItem(p_70669_1_.getItem()), vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord); + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + Entity entity = p_70645_1_.getEntity(); + EntityLivingBase entitylivingbase = this.func_94060_bK(); + + if (this.scoreValue >= 0 && entitylivingbase != null) + { + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + if (entity != null) + { + entity.onKillEntity(this); + } + + this.dead = true; + this.func_110142_aN().func_94549_h(); + + if (!this.worldObj.isRemote) + { + int i = 0; + + if (entity instanceof EntityPlayer) + { + i = EnchantmentHelper.getLootingModifier((EntityLivingBase)entity); + } + + captureDrops = true; + capturedDrops.clear(); + int j = 0; + + if (this.func_146066_aG() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) + { + this.dropFewItems(this.recentlyHit > 0, i); + this.dropEquipment(this.recentlyHit > 0, i); + + if (this.recentlyHit > 0) + { + j = this.rand.nextInt(200) - i; + + if (j < 5) + { + this.dropRareDrop(j <= 0 ? 1 : 0); + } + } + } + + captureDrops = false; + + if (!ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, recentlyHit > 0, j)) + { + for (EntityItem item : capturedDrops) + { + worldObj.spawnEntityInWorld(item); + } + } + } + + this.worldObj.setEntityState(this, (byte)3); + } + + /** + * Drop the equipment for this entity. + */ + protected void dropEquipment(boolean p_82160_1_, int p_82160_2_) {} + + /** + * knocks back this entity + */ + public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) + { + if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) + { + this.isAirBorne = true; + float f1 = MathHelper.sqrt_double(p_70653_3_ * p_70653_3_ + p_70653_5_ * p_70653_5_); + float f2 = 0.4F; + this.motionX /= 2.0D; + this.motionY /= 2.0D; + this.motionZ /= 2.0D; + this.motionX -= p_70653_3_ / (double)f1 * (double)f2; + this.motionY += (double)f2; + this.motionZ -= p_70653_5_ / (double)f1 * (double)f2; + + if (this.motionY > 0.4000000059604645D) + { + this.motionY = 0.4000000059604645D; + } + } + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "game.neutral.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "game.neutral.die"; + } + + protected void dropRareDrop(int p_70600_1_) {} + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {} + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.boundingBox.minY); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(i, j, k); + return ForgeHooks.isLivingOnLadder(block, worldObj, i, j, k, this); + } + + /** + * Checks whether target entity is alive. + */ + public boolean isEntityAlive() + { + return !this.isDead && this.getHealth() > 0.0F; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + distance = ForgeHooks.onLivingFall(this, distance); + if (distance <= 0) return; + super.fall(distance); + PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); + float f1 = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; + int i = MathHelper.ceiling_float_int(distance - 3.0F - f1); + + if (i > 0) + { + this.playSound(this.func_146067_o(i), 1.0F, 1.0F); + this.attackEntityFrom(DamageSource.fall, (float)i); + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int l = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(j, k, l); + + if (block.getMaterial() != Material.air) + { + Block.SoundType soundtype = block.stepSound; + this.playSound(soundtype.getStepResourcePath(), soundtype.getVolume() * 0.5F, soundtype.getPitch() * 0.75F); + } + } + } + + protected String func_146067_o(int p_146067_1_) + { + return p_146067_1_ > 4 ? "game.neutral.hurt.fall.big" : "game.neutral.hurt.fall.small"; + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + @SideOnly(Side.CLIENT) + public void performHurtAnimation() + { + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + int i = 0; + ItemStack[] aitemstack = this.getLastActiveItems(); + int j = aitemstack.length; + + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = aitemstack[k]; + + if (itemstack != null && itemstack.getItem() instanceof ItemArmor) + { + int l = ((ItemArmor)itemstack.getItem()).damageReduceAmount; + i += l; + } + } + + return i; + } + + protected void damageArmor(float p_70675_1_) {} + + /** + * Reduces damage, depending on armor + */ + protected float applyArmorCalculations(DamageSource p_70655_1_, float p_70655_2_) + { + if (!p_70655_1_.isUnblockable()) + { + int i = 25 - this.getTotalArmorValue(); + float f1 = p_70655_2_ * (float)i; + this.damageArmor(p_70655_2_); + p_70655_2_ = f1 / 25.0F; + } + + return p_70655_2_; + } + + /** + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource p_70672_1_, float p_70672_2_) + { + if (p_70672_1_.isDamageAbsolute()) + { + return p_70672_2_; + } + else + { + if (this instanceof EntityZombie) + { + //par2 = par2; // Forge: Noop Warning + } + + int i; + int j; + float f1; + + if (this.isPotionActive(Potion.resistance) && p_70672_1_ != DamageSource.outOfWorld) + { + i = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; + j = 25 - i; + f1 = p_70672_2_ * (float)j; + p_70672_2_ = f1 / 25.0F; + } + + if (p_70672_2_ <= 0.0F) + { + return 0.0F; + } + else + { + i = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), p_70672_1_); + + if (i > 20) + { + i = 20; + } + + if (i > 0 && i <= 20) + { + j = 25 - i; + f1 = p_70672_2_ * (float)j; + p_70672_2_ = f1 / 25.0F; + } + + return p_70672_2_; + } + } + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) + { + if (!this.isEntityInvulnerable()) + { + p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); + if (p_70665_2_ <= 0) return; + p_70665_2_ = this.applyArmorCalculations(p_70665_1_, p_70665_2_); + p_70665_2_ = this.applyPotionDamageCalculations(p_70665_1_, p_70665_2_); + float f1 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f1 - p_70665_2_)); + + if (p_70665_2_ != 0.0F) + { + float f2 = this.getHealth(); + this.setHealth(f2 - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, f2, p_70665_2_); + this.setAbsorptionAmount(this.getAbsorptionAmount() - p_70665_2_); + } + } + } + + public CombatTracker func_110142_aN() + { + return this._combatTracker; + } + + public EntityLivingBase func_94060_bK() + { + return (EntityLivingBase)(this._combatTracker.func_94550_c() != null ? this._combatTracker.func_94550_c() : (this.attackingPlayer != null ? this.attackingPlayer : (this.entityLivingToAttack != null ? this.entityLivingToAttack : null))); + } + + public final float getMaxHealth() + { + return (float)this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); + } + + /** + * counts the amount of arrows stuck in the entity. getting hit by arrows increases this, used in rendering + */ + public final int getArrowCountInEntity() + { + return this.dataWatcher.getWatchableObjectByte(9); + } + + /** + * sets the amount of arrows stuck in the entity. used for rendering those + */ + public final void setArrowCountInEntity(int p_85034_1_) + { + this.dataWatcher.updateObject(9, Byte.valueOf((byte)p_85034_1_)); + } + + /** + * Returns an integer indicating the end point of the swing animation, used by {@link #swingProgress} to provide a + * progress indicator. Takes dig speed enchantments into account. + */ + private int getArmSwingAnimationEnd() + { + return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); + } + + /** + * Swings the item the player is holding. + */ + public void swingItem() + { + ItemStack stack = this.getHeldItem(); + + if (stack != null && stack.getItem() != null) + { + Item item = stack.getItem(); + if (item.onEntitySwing(this, stack)) + { + return; + } + } + + if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) + { + this.swingProgressInt = -1; + this.isSwingInProgress = true; + + if (this.worldObj instanceof WorldServer) + { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S0BPacketAnimation(this, 0)); + } + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 2) + { + this.limbSwingAmount = 1.5F; + this.hurtResistantTime = this.maxHurtResistantTime; + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.attackEntityFrom(DamageSource.generic, 0.0F); + } + else if (p_70103_1_ == 3) + { + this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.setHealth(0.0F); + this.onDeath(DamageSource.generic); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * sets the dead flag. Used when you fall off the bottom of the world. + */ + protected void kill() + { + this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); + } + + /** + * Updates the arm swing progress counters and animation progress + */ + protected void updateArmSwingProgress() + { + int i = this.getArmSwingAnimationEnd(); + + if (this.isSwingInProgress) + { + ++this.swingProgressInt; + + if (this.swingProgressInt >= i) + { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } + } + else + { + this.swingProgressInt = 0; + } + + this.swingProgress = (float)this.swingProgressInt / (float)i; + } + + public IAttributeInstance getEntityAttribute(IAttribute p_110148_1_) + { + return this.getAttributeMap().getAttributeInstance(p_110148_1_); + } + + public BaseAttributeMap getAttributeMap() + { + if (this.attributeMap == null) + { + this.attributeMap = new ServersideAttributeMap(); + } + + return this.attributeMap; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEFINED; + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public abstract ItemStack getHeldItem(); + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public abstract ItemStack getEquipmentInSlot(int p_71124_1_); + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public abstract void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn); + + /** + * Set sprinting switch for Entity. + */ + public void setSprinting(boolean sprinting) + { + super.setSprinting(sprinting); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (iattributeinstance.getModifier(sprintingSpeedBoostModifierUUID) != null) + { + iattributeinstance.removeModifier(sprintingSpeedBoostModifier); + } + + if (sprinting) + { + iattributeinstance.applyModifier(sprintingSpeedBoostModifier); + } + } + + public abstract ItemStack[] getLastActiveItems(); + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 1.0F; + } + + /** + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() + { + return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F; + } + + /** + * Sets the position of the entity, keeps yaw/pitch, and updates the 'last' variables + */ + public void setPositionAndUpdate(double p_70634_1_, double p_70634_3_, double p_70634_5_) + { + this.setLocationAndAngles(p_70634_1_, p_70634_3_, p_70634_5_, this.rotationYaw, this.rotationPitch); + } + + /** + * Moves the entity to a position out of the way of its mount. + */ + public void dismountEntity(Entity p_110145_1_) + { + double d0 = p_110145_1_.posX; + double d1 = p_110145_1_.boundingBox.minY + (double)p_110145_1_.height; + double d2 = p_110145_1_.posZ; + byte b0 = 1; + + for (int i = -b0; i <= b0; ++i) + { + for (int j = -b0; j < b0; ++j) + { + if (i != 0 || j != 0) + { + int k = (int)(this.posX + (double)i); + int l = (int)(this.posZ + (double)j); + AxisAlignedBB axisalignedbb = this.boundingBox.getOffsetBoundingBox((double)i, 1.0D, (double)j); + + if (this.worldObj.func_147461_a(axisalignedbb).isEmpty()) + { + if (World.doesBlockHaveSolidTopSurface(this.worldObj, k, (int)this.posY, l)) + { + this.setPositionAndUpdate(this.posX + (double)i, this.posY + 1.0D, this.posZ + (double)j); + return; + } + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, k, (int)this.posY - 1, l) || this.worldObj.getBlock(k, (int)this.posY - 1, l).getMaterial() == Material.water) + { + d0 = this.posX + (double)i; + d1 = this.posY + 1.0D; + d2 = this.posZ + (double)j; + } + } + } + } + } + + this.setPositionAndUpdate(d0, d1, d2); + } + + @SideOnly(Side.CLIENT) + public boolean getAlwaysRenderNameTagForRender() + { + return false; + } + + /** + * Gets the Icon Index of the item currently held + */ + @SideOnly(Side.CLIENT) + public IIcon getItemIcon(ItemStack itemStackIn, int p_70620_2_) + { + return itemStackIn.getItem().requiresMultipleRenderPasses() ? itemStackIn.getItem().getIconFromDamageForRenderPass(itemStackIn.getItemDamage(), p_70620_2_) : itemStackIn.getIconIndex(); + } + + /** + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() + { + this.motionY = 0.41999998688697815D; + + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double)(MathHelper.sin(f) * 0.2F); + this.motionZ += (double)(MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + ForgeHooks.onLivingJump(this); + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + { + double d0; + + if (this.isInWater() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) + { + d0 = this.posY; + this.moveFlying(p_70612_1_, p_70612_2_, this.isAIEnabled() ? 0.04F : 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.800000011920929D; + this.motionY *= 0.800000011920929D; + this.motionZ *= 0.800000011920929D; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d0, this.motionZ)) + { + this.motionY = 0.30000001192092896D; + } + } + else if (this.handleLavaMovement() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) + { + d0 = this.posY; + this.moveFlying(p_70612_1_, p_70612_2_, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + this.motionY -= 0.02D; + + if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + d0, this.motionZ)) + { + this.motionY = 0.30000001192092896D; + } + } + else + { + float f2 = 0.91F; + + if (this.onGround) + { + f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + float f4; + + if (this.onGround) + { + f4 = this.getAIMoveSpeed() * f3; + } + else + { + f4 = this.jumpMovementFactor; + } + + this.moveFlying(p_70612_1_, p_70612_2_, f4); + f2 = 0.91F; + + if (this.onGround) + { + f2 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.91F; + } + + if (this.isOnLadder()) + { + float f5 = 0.15F; + + if (this.motionX < (double)(-f5)) + { + this.motionX = (double)(-f5); + } + + if (this.motionX > (double)f5) + { + this.motionX = (double)f5; + } + + if (this.motionZ < (double)(-f5)) + { + this.motionZ = (double)(-f5); + } + + if (this.motionZ > (double)f5) + { + this.motionZ = (double)f5; + } + + this.fallDistance = 0.0F; + + if (this.motionY < -0.15D) + { + this.motionY = -0.15D; + } + + boolean flag = this.isSneaking() && this instanceof EntityPlayer; + + if (flag && this.motionY < 0.0D) + { + this.motionY = 0.0D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && this.isOnLadder()) + { + this.motionY = 0.2D; + } + + if (this.worldObj.isRemote && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) + { + if (this.posY > 0.0D) + { + this.motionY = -0.1D; + } + else + { + this.motionY = 0.0D; + } + } + else + { + this.motionY -= 0.08D; + } + + this.motionY *= 0.9800000190734863D; + this.motionX *= (double)f2; + this.motionZ *= (double)f2; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f6 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.limbSwingAmount += (f6 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return false; + } + + /** + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() + { + return this.isAIEnabled() ? this.landMovementFactor : 0.1F; + } + + /** + * set the movespeed used for the new AI system + */ + public void setAIMoveSpeed(float p_70659_1_) + { + this.landMovementFactor = p_70659_1_; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + this.setLastAttacker(p_70652_1_); + return false; + } + + /** + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() + { + return false; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (ForgeHooks.onLivingUpdate(this)) return; + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + int i = this.getArrowCountInEntity(); + + if (i > 0) + { + if (this.arrowHitTimer <= 0) + { + this.arrowHitTimer = 20 * (30 - i); + } + + --this.arrowHitTimer; + + if (this.arrowHitTimer <= 0) + { + this.setArrowCountInEntity(i - 1); + } + } + + for (int j = 0; j < 5; ++j) + { + ItemStack itemstack = this.previousEquipment[j]; + ItemStack itemstack1 = this.getEquipmentInSlot(j); + + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) + { + ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S04PacketEntityEquipment(this.getEntityId(), j, itemstack1)); + + if (itemstack != null) + { + this.attributeMap.removeAttributeModifiers(itemstack.getAttributeModifiers()); + } + + if (itemstack1 != null) + { + this.attributeMap.applyAttributeModifiers(itemstack1.getAttributeModifiers()); + } + + this.previousEquipment[j] = itemstack1 == null ? null : itemstack1.copy(); + } + } + + if (this.ticksExisted % 20 == 0) + { + this.func_110142_aN().func_94549_h(); + } + } + + this.onLivingUpdate(); + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f = (float)(d0 * d0 + d1 * d1); + float f1 = this.renderYawOffset; + float f2 = 0.0F; + this.field_70768_au = this.field_110154_aX; + float f3 = 0.0F; + + if (f > 0.0025000002F) + { + f3 = 1.0F; + f2 = (float)Math.sqrt((double)f) * 3.0F; + f1 = (float)Math.atan2(d1, d0) * 180.0F / (float)Math.PI - 90.0F; + } + + if (this.swingProgress > 0.0F) + { + f1 = this.rotationYaw; + } + + if (!this.onGround) + { + f3 = 0.0F; + } + + this.field_110154_aX += (f3 - this.field_110154_aX) * 0.3F; + this.worldObj.theProfiler.startSection("headTurn"); + f2 = this.func_110146_f(f1, f2); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rangeChecks"); + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) + { + this.prevRenderYawOffset -= 360.0F; + } + + while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) + { + this.prevRenderYawOffset += 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch < -180.0F) + { + this.prevRotationPitch -= 360.0F; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) + { + this.prevRotationYawHead -= 360.0F; + } + + while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) + { + this.prevRotationYawHead += 360.0F; + } + + this.worldObj.theProfiler.endSection(); + this.field_70764_aw += f2; + } + + protected float func_110146_f(float p_110146_1_, float p_110146_2_) + { + float f2 = MathHelper.wrapAngleTo180_float(p_110146_1_ - this.renderYawOffset); + this.renderYawOffset += f2 * 0.3F; + float f3 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); + boolean flag = f3 < -90.0F || f3 >= 90.0F; + + if (f3 < -75.0F) + { + f3 = -75.0F; + } + + if (f3 >= 75.0F) + { + f3 = 75.0F; + } + + this.renderYawOffset = this.rotationYaw - f3; + + if (f3 * f3 > 2500.0F) + { + this.renderYawOffset += f3 * 0.2F; + } + + if (flag) + { + p_110146_2_ *= -1.0F; + } + + return p_110146_2_; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.jumpTicks > 0) + { + --this.jumpTicks; + } + + if (this.newPosRotationIncrements > 0) + { + double d0 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + double d1 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + double d2 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + double d3 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d0, d1, d2); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else if (!this.isClientWorld()) + { + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + } + + if (Math.abs(this.motionX) < 0.005D) + { + this.motionX = 0.0D; + } + + if (Math.abs(this.motionY) < 0.005D) + { + this.motionY = 0.0D; + } + + if (Math.abs(this.motionZ) < 0.005D) + { + this.motionZ = 0.0D; + } + + this.worldObj.theProfiler.startSection("ai"); + + if (this.isMovementBlocked()) + { + this.isJumping = false; + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.randomYawVelocity = 0.0F; + } + else if (this.isClientWorld()) + { + if (this.isAIEnabled()) + { + this.worldObj.theProfiler.startSection("newAi"); + this.updateAITasks(); + this.worldObj.theProfiler.endSection(); + } + else + { + this.worldObj.theProfiler.startSection("oldAi"); + this.updateEntityActionState(); + this.worldObj.theProfiler.endSection(); + this.rotationYawHead = this.rotationYaw; + } + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("jump"); + + if (this.isJumping) + { + if (!this.isInWater() && !this.handleLavaMovement()) + { + if (this.onGround && this.jumpTicks == 0) + { + this.jump(); + this.jumpTicks = 10; + } + } + else + { + this.motionY += 0.03999999910593033D; + } + } + else + { + this.jumpTicks = 0; + } + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("travel"); + this.moveStrafing *= 0.98F; + this.moveForward *= 0.98F; + this.randomYawVelocity *= 0.9F; + this.moveEntityWithHeading(this.moveStrafing, this.moveForward); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("push"); + + if (!this.worldObj.isRemote) + { + this.collideWithNearbyEntities(); + } + + this.worldObj.theProfiler.endSection(); + } + + protected void updateAITasks() {} + + protected void collideWithNearbyEntities() + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (list != null && !list.isEmpty()) + { + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (entity.canBePushed()) + { + this.collideWithEntity(entity); + } + } + } + } + + protected void collideWithEntity(Entity p_82167_1_) + { + p_82167_1_.applyEntityCollision(this); + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() + { + super.updateRidden(); + this.field_70768_au = this.field_110154_aX; + this.field_110154_aX = 0.0F; + this.fallDistance = 0.0F; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.yOffset = 0.0F; + this.newPosX = x; + this.newPosY = y; + this.newPosZ = z; + this.newRotationYaw = (double)yaw; + this.newRotationPitch = (double)pitch; + this.newPosRotationIncrements = rotationIncrements; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() {} + + protected void updateEntityActionState() + { + ++this.entityAge; + } + + public void setJumping(boolean p_70637_1_) + { + this.isJumping = p_70637_1_; + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) + { + if (!p_71001_1_.isDead && !this.worldObj.isRemote) + { + EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker(); + + if (p_71001_1_ instanceof EntityItem) + { + entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityArrow) + { + entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + + if (p_71001_1_ instanceof EntityXPOrb) + { + entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId())); + } + } + } + + /** + * returns true if the entity provided in the argument can be seen. (Raytrace) + */ + public boolean canEntityBeSeen(Entity p_70685_1_) + { + return this.worldObj.rayTraceBlocks(Vec3.createVectorHelper(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), Vec3.createVectorHelper(p_70685_1_.posX, p_70685_1_.posY + (double)p_70685_1_.getEyeHeight(), p_70685_1_.posZ)) == null; + } + + /** + * returns a (normalized) vector of where this entity is looking + */ + public Vec3 getLookVec() + { + return this.getLook(1.0F); + } + + /** + * interpolated look vector + */ + public Vec3 getLook(float p_70676_1_) + { + float f1; + float f2; + float f3; + float f4; + + if (p_70676_1_ == 1.0F) + { + f1 = MathHelper.cos(-this.rotationYaw * 0.017453292F - (float)Math.PI); + f2 = MathHelper.sin(-this.rotationYaw * 0.017453292F - (float)Math.PI); + f3 = -MathHelper.cos(-this.rotationPitch * 0.017453292F); + f4 = MathHelper.sin(-this.rotationPitch * 0.017453292F); + return Vec3.createVectorHelper((double)(f2 * f3), (double)f4, (double)(f1 * f3)); + } + else + { + f1 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * p_70676_1_; + f2 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * p_70676_1_; + f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); + f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + return Vec3.createVectorHelper((double)(f4 * f5), (double)f6, (double)(f3 * f5)); + } + } + + /** + * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime + */ + @SideOnly(Side.CLIENT) + public float getSwingProgress(float p_70678_1_) + { + float f1 = this.swingProgress - this.prevSwingProgress; + + if (f1 < 0.0F) + { + ++f1; + } + + return this.prevSwingProgress + f1 * p_70678_1_; + } + + /** + * interpolated position vector + */ + @SideOnly(Side.CLIENT) + public Vec3 getPosition(float p_70666_1_) + { + if (p_70666_1_ == 1.0F) + { + return Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + } + else + { + double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double)p_70666_1_; + double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double)p_70666_1_; + double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)p_70666_1_; + return Vec3.createVectorHelper(d0, d1, d2); + } + } + + /** + * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime + */ + @SideOnly(Side.CLIENT) + public MovingObjectPosition rayTrace(double p_70614_1_, float p_70614_3_) + { + Vec3 vec3 = this.getPosition(p_70614_3_); + Vec3 vec31 = this.getLook(p_70614_3_); + Vec3 vec32 = vec3.addVector(vec31.xCoord * p_70614_1_, vec31.yCoord * p_70614_1_, vec31.zCoord * p_70614_1_); + return this.worldObj.func_147447_a(vec3, vec32, false, false, true); + } + + /** + * Returns whether the entity is in a local (client) world + */ + public boolean isClientWorld() + { + return !this.worldObj.isRemote; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return !this.isDead; + } + + public float getEyeHeight() + { + return this.height * 0.85F; + } + + /** + * Sets that this entity has been attacked. + */ + protected void setBeenAttacked() + { + this.velocityChanged = this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + } + + public float getRotationYawHead() + { + return this.rotationYawHead; + } + + /** + * Sets the head's yaw rotation of the entity. + */ + @SideOnly(Side.CLIENT) + public void setRotationYawHead(float rotation) + { + this.rotationYawHead = rotation; + } + + public float getAbsorptionAmount() + { + return this.field_110151_bq; + } + + public void setAbsorptionAmount(float p_110149_1_) + { + if (p_110149_1_ < 0.0F) + { + p_110149_1_ = 0.0F; + } + + this.field_110151_bq = p_110149_1_; + } + + public Team getTeam() + { + return null; + } + + public boolean isOnSameTeam(EntityLivingBase p_142014_1_) + { + return this.isOnTeam(p_142014_1_.getTeam()); + } + + /** + * Returns true if the entity is on a specific team. + */ + public boolean isOnTeam(Team p_142012_1_) + { + return this.getTeam() != null ? this.getTeam().isSameTeam(p_142012_1_) : false; + } + + /*** + * Removes all potion effects that have curativeItem as a curative item for its effect + * @param curativeItem The itemstack we are using to cure potion effects + */ + public void curePotionEffects(ItemStack curativeItem) + { + Iterator potionKey = activePotionsMap.keySet().iterator(); + + if (worldObj.isRemote) + { + return; + } + + while (potionKey.hasNext()) + { + Integer key = potionKey.next(); + PotionEffect effect = (PotionEffect)activePotionsMap.get(key); + + if (effect.isCurativeItem(curativeItem)) + { + potionKey.remove(); + onFinishedPotionEffect(effect); + } + } + } + + /** + * Returns true if the entity's rider (EntityPlayer) should face forward when mounted. + * currently only used in vanilla code by pigs. + * + * @param player The player who is riding the entity. + * @return If the player should orient the same direction as this entity. + */ + public boolean shouldRiderFaceForward(EntityPlayer player) + { + return this instanceof EntityPig; + } + + public void func_152111_bt() {} + + public void func_152112_bu() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityMinecartCommandBlock.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityMinecartCommandBlock.java new file mode 100644 index 0000000..6741a1d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityMinecartCommandBlock.java @@ -0,0 +1,149 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import net.minecraft.block.Block; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartCommandBlock extends EntityMinecart +{ + private final CommandBlockLogic field_145824_a = new CommandBlockLogic() + { + private static final String __OBFID = "CL_00001673"; + public void func_145756_e() + { + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(23, this.func_145753_i()); + EntityMinecartCommandBlock.this.getDataWatcher().updateObject(24, IChatComponent.Serializer.func_150696_a(this.func_145749_h())); + } + @SideOnly(Side.CLIENT) + public int func_145751_f() + { + return 1; + } + @SideOnly(Side.CLIENT) + public void func_145757_a(ByteBuf p_145757_1_) + { + p_145757_1_.writeInt(EntityMinecartCommandBlock.this.getEntityId()); + } + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(MathHelper.floor_double(EntityMinecartCommandBlock.this.posX), MathHelper.floor_double(EntityMinecartCommandBlock.this.posY + 0.5D), MathHelper.floor_double(EntityMinecartCommandBlock.this.posZ)); + } + public World getEntityWorld() + { + return EntityMinecartCommandBlock.this.worldObj; + } + }; + private int field_145823_b = 0; + private static final String __OBFID = "CL_00001672"; + + public EntityMinecartCommandBlock(World p_i45321_1_) + { + super(p_i45321_1_); + } + + public EntityMinecartCommandBlock(World p_i45322_1_, double p_i45322_2_, double p_i45322_4_, double p_i45322_6_) + { + super(p_i45322_1_, p_i45322_2_, p_i45322_4_, p_i45322_6_); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(23, ""); + this.getDataWatcher().addObject(24, ""); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.field_145824_a.func_145759_b(tagCompund); + this.getDataWatcher().updateObject(23, this.func_145822_e().func_145753_i()); + this.getDataWatcher().updateObject(24, IChatComponent.Serializer.func_150696_a(this.func_145822_e().func_145749_h())); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + this.field_145824_a.func_145758_a(tagCompound); + } + + public int getMinecartType() + { + return 6; + } + + public Block func_145817_o() + { + return Blocks.command_block; + } + + public CommandBlockLogic func_145822_e() + { + return this.field_145824_a; + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) + { + if (p_96095_4_ && this.ticksExisted - this.field_145823_b >= 4) + { + this.func_145822_e().func_145755_a(this.worldObj); + this.field_145823_b = this.ticksExisted; + } + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if (this.worldObj.isRemote) + { + player.func_146095_a(this.func_145822_e()); + } + + return super.interactFirst(player); + } + + public void func_145781_i(int p_145781_1_) + { + super.func_145781_i(p_145781_1_); + + if (p_145781_1_ == 24) + { + try + { + this.field_145824_a.func_145750_b(IChatComponent.Serializer.func_150699_a(this.getDataWatcher().getWatchableObjectString(24))); + } + catch (Throwable throwable) + { + ; + } + } + else if (p_145781_1_ == 23) + { + this.field_145824_a.func_145752_a(this.getDataWatcher().getWatchableObjectString(23)); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTracker.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTracker.java new file mode 100644 index 0000000..a77ac6f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTracker.java @@ -0,0 +1,364 @@ +package net.minecraft.entity; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.boss.EntityWither; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.network.Packet; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.registry.EntityRegistry; + +public class EntityTracker +{ + private static final Logger logger = LogManager.getLogger(); + private final WorldServer theWorld; + /** List of tracked entities, used for iteration operations on tracked entities. */ + private Set trackedEntities = new HashSet(); + private IntHashMap trackedEntityIDs = new IntHashMap(); + private int entityViewDistance; + private static final String __OBFID = "CL_00001431"; + + public EntityTracker(WorldServer p_i1516_1_) + { + this.theWorld = p_i1516_1_; + this.entityViewDistance = p_i1516_1_.func_73046_m().getConfigurationManager().getEntityViewDistance(); + } + + /** + * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate + * based on the class type + */ + public void addEntityToTracker(Entity p_72786_1_) + { + if (EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) + { + return; + } + + if (p_72786_1_ instanceof EntityPlayerMP) + { + this.addEntityToTracker(p_72786_1_, 512, 2); + EntityPlayerMP entityplayermp = (EntityPlayerMP)p_72786_1_; + Iterator iterator = this.trackedEntities.iterator(); + + while (iterator.hasNext()) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)iterator.next(); + + if (entitytrackerentry.myEntity != entityplayermp) + { + entitytrackerentry.tryStartWachingThis(entityplayermp); + } + } + } + else if (p_72786_1_ instanceof EntityFishHook) + { + this.addEntityToTracker(p_72786_1_, 64, 5, true); + } + else if (p_72786_1_ instanceof EntityArrow) + { + this.addEntityToTracker(p_72786_1_, 64, 20, false); + } + else if (p_72786_1_ instanceof EntitySmallFireball) + { + this.addEntityToTracker(p_72786_1_, 64, 10, false); + } + else if (p_72786_1_ instanceof EntityFireball) + { + this.addEntityToTracker(p_72786_1_, 64, 10, false); + } + else if (p_72786_1_ instanceof EntitySnowball) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityEnderPearl) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityEnderEye) + { + this.addEntityToTracker(p_72786_1_, 64, 4, true); + } + else if (p_72786_1_ instanceof EntityEgg) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityPotion) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityExpBottle) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityFireworkRocket) + { + this.addEntityToTracker(p_72786_1_, 64, 10, true); + } + else if (p_72786_1_ instanceof EntityItem) + { + this.addEntityToTracker(p_72786_1_, 64, 20, true); + } + else if (p_72786_1_ instanceof EntityMinecart) + { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } + else if (p_72786_1_ instanceof EntityBoat) + { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } + else if (p_72786_1_ instanceof EntitySquid) + { + this.addEntityToTracker(p_72786_1_, 64, 3, true); + } + else if (p_72786_1_ instanceof EntityWither) + { + this.addEntityToTracker(p_72786_1_, 80, 3, false); + } + else if (p_72786_1_ instanceof EntityBat) + { + this.addEntityToTracker(p_72786_1_, 80, 3, false); + } + else if (p_72786_1_ instanceof IAnimals) + { + this.addEntityToTracker(p_72786_1_, 80, 3, true); + } + else if (p_72786_1_ instanceof EntityDragon) + { + this.addEntityToTracker(p_72786_1_, 160, 3, true); + } + else if (p_72786_1_ instanceof EntityTNTPrimed) + { + this.addEntityToTracker(p_72786_1_, 160, 10, true); + } + else if (p_72786_1_ instanceof EntityFallingBlock) + { + this.addEntityToTracker(p_72786_1_, 160, 20, true); + } + else if (p_72786_1_ instanceof EntityHanging) + { + this.addEntityToTracker(p_72786_1_, 160, Integer.MAX_VALUE, false); + } + else if (p_72786_1_ instanceof EntityXPOrb) + { + this.addEntityToTracker(p_72786_1_, 160, 20, true); + } + else if (p_72786_1_ instanceof EntityEnderCrystal) + { + this.addEntityToTracker(p_72786_1_, 256, Integer.MAX_VALUE, false); + } + } + + public void addEntityToTracker(Entity p_72791_1_, int p_72791_2_, int p_72791_3_) + { + this.addEntityToTracker(p_72791_1_, p_72791_2_, p_72791_3_, false); + } + + public void addEntityToTracker(Entity p_72785_1_, int p_72785_2_, final int p_72785_3_, boolean p_72785_4_) + { + if (p_72785_2_ > this.entityViewDistance) + { + p_72785_2_ = this.entityViewDistance; + } + + try + { + if (this.trackedEntityIDs.containsItem(p_72785_1_.getEntityId())) + { + throw new IllegalStateException("Entity is already tracked!"); + } + + EntityTrackerEntry entitytrackerentry = new EntityTrackerEntry(p_72785_1_, p_72785_2_, p_72785_3_, p_72785_4_); + this.trackedEntities.add(entitytrackerentry); + this.trackedEntityIDs.addKey(p_72785_1_.getEntityId(), entitytrackerentry); + entitytrackerentry.sendEventsToPlayers(this.theWorld.playerEntities); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding entity to track"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity To Track"); + crashreportcategory.addCrashSection("Tracking range", p_72785_2_ + " blocks"); + crashreportcategory.addCrashSectionCallable("Update interval", new Callable() + { + private static final String __OBFID = "CL_00001432"; + public String call() + { + String s = "Once per " + p_72785_3_ + " ticks"; + + if (p_72785_3_ == Integer.MAX_VALUE) + { + s = "Maximum (" + s + ")"; + } + + return s; + } + }); + p_72785_1_.addEntityCrashInfo(crashreportcategory); + CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Entity That Is Already Tracked"); + ((EntityTrackerEntry)this.trackedEntityIDs.lookup(p_72785_1_.getEntityId())).myEntity.addEntityCrashInfo(crashreportcategory1); + + try + { + throw new ReportedException(crashreport); + } + catch (ReportedException reportedexception) + { + logger.error("\"Silently\" catching entity tracking error.", reportedexception); + } + } + } + + public void removeEntityFromAllTrackingPlayers(Entity p_72790_1_) + { + if (p_72790_1_ instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)p_72790_1_; + Iterator iterator = this.trackedEntities.iterator(); + + while (iterator.hasNext()) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)iterator.next(); + entitytrackerentry.removeFromWatchingList(entityplayermp); + } + } + + EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(p_72790_1_.getEntityId()); + + if (entitytrackerentry1 != null) + { + this.trackedEntities.remove(entitytrackerentry1); + entitytrackerentry1.informAllAssociatedPlayersOfItemDestruction(); + } + } + + public void updateTrackedEntities() + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.trackedEntities.iterator(); + + while (iterator.hasNext()) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)iterator.next(); + entitytrackerentry.sendLocationToAllClients(this.theWorld.playerEntities); + + if (entitytrackerentry.playerEntitiesUpdated && entitytrackerentry.myEntity instanceof EntityPlayerMP) + { + arraylist.add((EntityPlayerMP)entitytrackerentry.myEntity); + } + } + + for (int i = 0; i < arraylist.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)arraylist.get(i); + Iterator iterator1 = this.trackedEntities.iterator(); + + while (iterator1.hasNext()) + { + EntityTrackerEntry entitytrackerentry1 = (EntityTrackerEntry)iterator1.next(); + + if (entitytrackerentry1.myEntity != entityplayermp) + { + entitytrackerentry1.tryStartWachingThis(entityplayermp); + } + } + } + } + + public void func_151247_a(Entity p_151247_1_, Packet p_151247_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityIDs.lookup(p_151247_1_.getEntityId()); + + if (entitytrackerentry != null) + { + entitytrackerentry.func_151259_a(p_151247_2_); + } + } + + public void func_151248_b(Entity p_151248_1_, Packet p_151248_2_) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)this.trackedEntityIDs.lookup(p_151248_1_.getEntityId()); + + if (entitytrackerentry != null) + { + entitytrackerentry.func_151261_b(p_151248_2_); + } + } + + public void removePlayerFromTrackers(EntityPlayerMP p_72787_1_) + { + Iterator iterator = this.trackedEntities.iterator(); + + while (iterator.hasNext()) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)iterator.next(); + entitytrackerentry.removePlayerFromTracker(p_72787_1_); + } + } + + public void func_85172_a(EntityPlayerMP p_85172_1_, Chunk p_85172_2_) + { + Iterator iterator = this.trackedEntities.iterator(); + + while (iterator.hasNext()) + { + EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry)iterator.next(); + + if (entitytrackerentry.myEntity != p_85172_1_ && entitytrackerentry.myEntity.chunkCoordX == p_85172_2_.xPosition && entitytrackerentry.myEntity.chunkCoordZ == p_85172_2_.zPosition) + { + entitytrackerentry.tryStartWachingThis(p_85172_1_); + } + } + } + + /* ======================================== FORGE START =====================================*/ + + // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily + /** + * Get all players tracking the given Entity. The Entity must be part of the World that this Tracker belongs to. + * @param entity the Entity + * @return all players tracking the Entity + */ + public Set getTrackingPlayers(Entity entity) + { + EntityTrackerEntry entry = (EntityTrackerEntry) trackedEntityIDs.lookup(entity.getEntityId()); + if (entry == null) + return java.util.Collections.emptySet(); + else + return java.util.Collections.unmodifiableSet(entry.trackingPlayers); + } + + /* ======================================== FORGE END =====================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTrackerEntry.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTrackerEntry.java new file mode 100644 index 0000000..0a6bdf4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EntityTrackerEntry.java @@ -0,0 +1,644 @@ +package net.minecraft.entity; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.entity.ai.attributes.ServersideAttributeMap; +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MathHelper; +import net.minecraft.world.storage.MapData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + +public class EntityTrackerEntry +{ + private static final Logger logger = LogManager.getLogger(); + public Entity myEntity; + public int blocksDistanceThreshold; + /** check for sync when ticks % updateFrequency==0 */ + public int updateFrequency; + public int lastScaledXPosition; + public int lastScaledYPosition; + public int lastScaledZPosition; + public int lastYaw; + public int lastPitch; + public int lastHeadMotion; + public double motionX; + public double motionY; + public double motionZ; + public int ticks; + private double posX; + private double posY; + private double posZ; + /** set to true on first sendLocationToClients */ + private boolean isDataInitialized; + private boolean sendVelocityUpdates; + /** + * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position + * remains fully synced. + */ + private int ticksSinceLastForcedTeleport; + private Entity field_85178_v; + private boolean ridingEntity; + public boolean playerEntitiesUpdated; + /** Holds references to all the players that are currently receiving position updates for this entity. */ + public Set trackingPlayers = new HashSet(); + private static final String __OBFID = "CL_00001443"; + + public EntityTrackerEntry(Entity p_i1525_1_, int p_i1525_2_, int p_i1525_3_, boolean p_i1525_4_) + { + this.myEntity = p_i1525_1_; + this.blocksDistanceThreshold = p_i1525_2_; + this.updateFrequency = p_i1525_3_; + this.sendVelocityUpdates = p_i1525_4_; + this.lastScaledXPosition = MathHelper.floor_double(p_i1525_1_.posX * 32.0D); + this.lastScaledYPosition = MathHelper.floor_double(p_i1525_1_.posY * 32.0D); + this.lastScaledZPosition = MathHelper.floor_double(p_i1525_1_.posZ * 32.0D); + this.lastYaw = MathHelper.floor_float(p_i1525_1_.rotationYaw * 256.0F / 360.0F); + this.lastPitch = MathHelper.floor_float(p_i1525_1_.rotationPitch * 256.0F / 360.0F); + this.lastHeadMotion = MathHelper.floor_float(p_i1525_1_.getRotationYawHead() * 256.0F / 360.0F); + } + + public boolean equals(Object p_equals_1_) + { + return p_equals_1_ instanceof EntityTrackerEntry ? ((EntityTrackerEntry)p_equals_1_).myEntity.getEntityId() == this.myEntity.getEntityId() : false; + } + + public int hashCode() + { + return this.myEntity.getEntityId(); + } + + /** + * also sends velocity, rotation, and riding info. + */ + public void sendLocationToAllClients(List p_73122_1_) + { + this.playerEntitiesUpdated = false; + + if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D) + { + this.posX = this.myEntity.posX; + this.posY = this.myEntity.posY; + this.posZ = this.myEntity.posZ; + this.isDataInitialized = true; + this.playerEntitiesUpdated = true; + this.sendEventsToPlayers(p_73122_1_); + } + + if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0) + { + this.field_85178_v = this.myEntity.ridingEntity; + this.func_151259_a(new S1BPacketEntityAttach(0, this.myEntity, this.myEntity.ridingEntity)); + } + + if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0) + { + EntityItemFrame entityitemframe = (EntityItemFrame)this.myEntity; + ItemStack itemstack = entityitemframe.getDisplayedItem(); + + if (itemstack != null && itemstack.getItem() instanceof ItemMap) + { + MapData mapdata = Items.filled_map.getMapData(itemstack, this.myEntity.worldObj); + Iterator iterator = p_73122_1_.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + EntityPlayerMP entityplayermp = (EntityPlayerMP)entityplayer; + mapdata.updateVisiblePlayers(entityplayermp, itemstack); + Packet packet = Items.filled_map.func_150911_c(itemstack, this.myEntity.worldObj, entityplayermp); + + if (packet != null) + { + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + } + + this.sendMetadataToAllAssociatedPlayers(); + } + else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges()) + { + int i; + int j; + + if (this.myEntity.ridingEntity == null) + { + ++this.ticksSinceLastForcedTeleport; + i = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); + j = MathHelper.floor_double(this.myEntity.posY * 32.0D); + int k = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + int l = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); + int i1 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); + int j1 = i - this.lastScaledXPosition; + int k1 = j - this.lastScaledYPosition; + int l1 = k - this.lastScaledZPosition; + Object object = null; + boolean flag = Math.abs(j1) >= 4 || Math.abs(k1) >= 4 || Math.abs(l1) >= 4 || this.ticks % 60 == 0; + boolean flag1 = Math.abs(l - this.lastYaw) >= 4 || Math.abs(i1 - this.lastPitch) >= 4; + + if (this.ticks > 0 || this.myEntity instanceof EntityArrow) + { + if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) + { + if (flag && flag1) + { + object = new S14PacketEntity.S17PacketEntityLookMove(this.myEntity.getEntityId(), (byte)j1, (byte)k1, (byte)l1, (byte)l, (byte)i1); + } + else if (flag) + { + object = new S14PacketEntity.S15PacketEntityRelMove(this.myEntity.getEntityId(), (byte)j1, (byte)k1, (byte)l1); + } + else if (flag1) + { + object = new S14PacketEntity.S16PacketEntityLook(this.myEntity.getEntityId(), (byte)l, (byte)i1); + } + } + else + { + this.ticksSinceLastForcedTeleport = 0; + object = new S18PacketEntityTeleport(this.myEntity.getEntityId(), i, j, k, (byte)l, (byte)i1); + } + } + + if (this.sendVelocityUpdates) + { + double d0 = this.myEntity.motionX - this.motionX; + double d1 = this.myEntity.motionY - this.motionY; + double d2 = this.myEntity.motionZ - this.motionZ; + double d3 = 0.02D; + double d4 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d4 > d3 * d3 || d4 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D) + { + this.motionX = this.myEntity.motionX; + this.motionY = this.myEntity.motionY; + this.motionZ = this.myEntity.motionZ; + this.func_151259_a(new S12PacketEntityVelocity(this.myEntity.getEntityId(), this.motionX, this.motionY, this.motionZ)); + } + } + + if (object != null) + { + this.func_151259_a((Packet)object); + } + + this.sendMetadataToAllAssociatedPlayers(); + + if (flag) + { + this.lastScaledXPosition = i; + this.lastScaledYPosition = j; + this.lastScaledZPosition = k; + } + + if (flag1) + { + this.lastYaw = l; + this.lastPitch = i1; + } + + this.ridingEntity = false; + } + else + { + i = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); + j = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); + boolean flag2 = Math.abs(i - this.lastYaw) >= 4 || Math.abs(j - this.lastPitch) >= 4; + + if (flag2) + { + this.func_151259_a(new S14PacketEntity.S16PacketEntityLook(this.myEntity.getEntityId(), (byte)i, (byte)j)); + this.lastYaw = i; + this.lastPitch = j; + } + + this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); + this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D); + this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + this.sendMetadataToAllAssociatedPlayers(); + this.ridingEntity = true; + } + + i = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); + + if (Math.abs(i - this.lastHeadMotion) >= 4) + { + this.func_151259_a(new S19PacketEntityHeadLook(this.myEntity, (byte)i)); + this.lastHeadMotion = i; + } + + this.myEntity.isAirBorne = false; + } + + ++this.ticks; + + if (this.myEntity.velocityChanged) + { + this.func_151261_b(new S12PacketEntityVelocity(this.myEntity)); + this.myEntity.velocityChanged = false; + } + } + + /** + * Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity + * itself if a player. + */ + private void sendMetadataToAllAssociatedPlayers() + { + DataWatcher datawatcher = this.myEntity.getDataWatcher(); + + if (datawatcher.hasChanges()) + { + this.func_151261_b(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), datawatcher, false)); + } + + if (this.myEntity instanceof EntityLivingBase) + { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Set set = serversideattributemap.getAttributeInstanceSet(); + + if (!set.isEmpty()) + { + this.func_151261_b(new S20PacketEntityProperties(this.myEntity.getEntityId(), set)); + } + + set.clear(); + } + } + + public void func_151259_a(Packet p_151259_1_) + { + Iterator iterator = this.trackingPlayers.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + entityplayermp.playerNetServerHandler.sendPacket(p_151259_1_); + } + } + + public void func_151261_b(Packet p_151261_1_) + { + this.func_151259_a(p_151261_1_); + + if (this.myEntity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacket(p_151261_1_); + } + } + + public void informAllAssociatedPlayersOfItemDestruction() + { + Iterator iterator = this.trackingPlayers.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + entityplayermp.func_152339_d(this.myEntity); + } + } + + public void removeFromWatchingList(EntityPlayerMP p_73118_1_) + { + if (this.trackingPlayers.contains(p_73118_1_)) + { + p_73118_1_.func_152339_d(this.myEntity); + this.trackingPlayers.remove(p_73118_1_); + } + } + + /** + * if the player is more than the distance threshold (typically 64) then the player is removed instead + */ + public void tryStartWachingThis(EntityPlayerMP p_73117_1_) + { + if (p_73117_1_ != this.myEntity) + { + double d0 = p_73117_1_.posX - (double)(this.lastScaledXPosition / 32); + double d1 = p_73117_1_.posZ - (double)(this.lastScaledZPosition / 32); + + if (d0 >= (double)(-this.blocksDistanceThreshold) && d0 <= (double)this.blocksDistanceThreshold && d1 >= (double)(-this.blocksDistanceThreshold) && d1 <= (double)this.blocksDistanceThreshold) + { + if (!this.trackingPlayers.contains(p_73117_1_) && (this.isPlayerWatchingThisChunk(p_73117_1_) || this.myEntity.forceSpawn)) + { + this.trackingPlayers.add(p_73117_1_); + Packet packet = this.func_151260_c(); + p_73117_1_.playerNetServerHandler.sendPacket(packet); + + if (!this.myEntity.getDataWatcher().getIsBlank()) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), this.myEntity.getDataWatcher(), true)); + } + + if (this.myEntity instanceof EntityLivingBase) + { + ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Collection collection = serversideattributemap.getWatchedAttributes(); + + if (!collection.isEmpty()) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S20PacketEntityProperties(this.myEntity.getEntityId(), collection)); + } + } + + this.motionX = this.myEntity.motionX; + this.motionY = this.myEntity.motionY; + this.motionZ = this.myEntity.motionZ; + + int posX = MathHelper.floor_double(this.myEntity.posX * 32.0D); + int posY = MathHelper.floor_double(this.myEntity.posY * 32.0D); + int posZ = MathHelper.floor_double(this.myEntity.posZ * 32.0D); + if (posX != this.lastScaledXPosition || posY != this.lastScaledYPosition || posZ != this.lastScaledZPosition) + { + FMLNetworkHandler.makeEntitySpawnAdjustment(this.myEntity, p_73117_1_, this.lastScaledXPosition, this.lastScaledYPosition, this.lastScaledZPosition); + } + + if (this.sendVelocityUpdates && !(packet instanceof S0FPacketSpawnMob)) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(this.myEntity.getEntityId(), this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ)); + } + + if (this.myEntity.ridingEntity != null) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this.myEntity, this.myEntity.ridingEntity)); + } + + if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity())); + } + + if (this.myEntity instanceof EntityLivingBase) + { + for (int i = 0; i < 5; ++i) + { + ItemStack itemstack = ((EntityLivingBase)this.myEntity).getEquipmentInSlot(i); + + if (itemstack != null) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S04PacketEntityEquipment(this.myEntity.getEntityId(), i, itemstack)); + } + } + } + + if (this.myEntity instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)this.myEntity; + + if (entityplayer.isPlayerSleeping()) + { + p_73117_1_.playerNetServerHandler.sendPacket(new S0APacketUseBed(entityplayer, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ))); + } + } + + if (this.myEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.myEntity; + Iterator iterator = entitylivingbase.getActivePotionEffects().iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + p_73117_1_.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.myEntity.getEntityId(), potioneffect)); + } + } + net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(myEntity, p_73117_1_); + } + } + else if (this.trackingPlayers.contains(p_73117_1_)) + { + this.trackingPlayers.remove(p_73117_1_); + p_73117_1_.func_152339_d(this.myEntity); + net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(myEntity, p_73117_1_); + } + } + } + + private boolean isPlayerWatchingThisChunk(EntityPlayerMP p_73121_1_) + { + return p_73121_1_.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(p_73121_1_, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ); + } + + public void sendEventsToPlayers(List p_73125_1_) + { + for (int i = 0; i < p_73125_1_.size(); ++i) + { + this.tryStartWachingThis((EntityPlayerMP)p_73125_1_.get(i)); + } + } + + private Packet func_151260_c() + { + if (this.myEntity.isDead) + { + logger.warn("Fetching addPacket for removed entity"); + } + + Packet pkt = FMLNetworkHandler.getEntitySpawningPacket(this.myEntity); + + if (pkt != null) + { + return pkt; + } + if (this.myEntity instanceof EntityItem) + { + return new S0EPacketSpawnObject(this.myEntity, 2, 1); + } + else if (this.myEntity instanceof EntityPlayerMP) + { + return new S0CPacketSpawnPlayer((EntityPlayer)this.myEntity); + } + else if (this.myEntity instanceof EntityMinecart) + { + EntityMinecart entityminecart = (EntityMinecart)this.myEntity; + return new S0EPacketSpawnObject(this.myEntity, 10, entityminecart.getMinecartType()); + } + else if (this.myEntity instanceof EntityBoat) + { + return new S0EPacketSpawnObject(this.myEntity, 1); + } + else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon)) + { + if (this.myEntity instanceof EntityFishHook) + { + EntityPlayer entityplayer = ((EntityFishHook)this.myEntity).field_146042_b; + return new S0EPacketSpawnObject(this.myEntity, 90, entityplayer != null ? entityplayer.getEntityId() : this.myEntity.getEntityId()); + } + else if (this.myEntity instanceof EntityArrow) + { + Entity entity = ((EntityArrow)this.myEntity).shootingEntity; + return new S0EPacketSpawnObject(this.myEntity, 60, entity != null ? entity.getEntityId() : this.myEntity.getEntityId()); + } + else if (this.myEntity instanceof EntitySnowball) + { + return new S0EPacketSpawnObject(this.myEntity, 61); + } + else if (this.myEntity instanceof EntityPotion) + { + return new S0EPacketSpawnObject(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage()); + } + else if (this.myEntity instanceof EntityExpBottle) + { + return new S0EPacketSpawnObject(this.myEntity, 75); + } + else if (this.myEntity instanceof EntityEnderPearl) + { + return new S0EPacketSpawnObject(this.myEntity, 65); + } + else if (this.myEntity instanceof EntityEnderEye) + { + return new S0EPacketSpawnObject(this.myEntity, 72); + } + else if (this.myEntity instanceof EntityFireworkRocket) + { + return new S0EPacketSpawnObject(this.myEntity, 76); + } + else + { + S0EPacketSpawnObject s0epacketspawnobject; + + if (this.myEntity instanceof EntityFireball) + { + EntityFireball entityfireball = (EntityFireball)this.myEntity; + s0epacketspawnobject = null; + byte b0 = 63; + + if (this.myEntity instanceof EntitySmallFireball) + { + b0 = 64; + } + else if (this.myEntity instanceof EntityWitherSkull) + { + b0 = 66; + } + + if (entityfireball.shootingEntity != null) + { + s0epacketspawnobject = new S0EPacketSpawnObject(this.myEntity, b0, ((EntityFireball)this.myEntity).shootingEntity.getEntityId()); + } + else + { + s0epacketspawnobject = new S0EPacketSpawnObject(this.myEntity, b0, 0); + } + + s0epacketspawnobject.func_149003_d((int)(entityfireball.accelerationX * 8000.0D)); + s0epacketspawnobject.func_149000_e((int)(entityfireball.accelerationY * 8000.0D)); + s0epacketspawnobject.func_149007_f((int)(entityfireball.accelerationZ * 8000.0D)); + return s0epacketspawnobject; + } + else if (this.myEntity instanceof EntityEgg) + { + return new S0EPacketSpawnObject(this.myEntity, 62); + } + else if (this.myEntity instanceof EntityTNTPrimed) + { + return new S0EPacketSpawnObject(this.myEntity, 50); + } + else if (this.myEntity instanceof EntityEnderCrystal) + { + return new S0EPacketSpawnObject(this.myEntity, 51); + } + else if (this.myEntity instanceof EntityFallingBlock) + { + EntityFallingBlock entityfallingblock = (EntityFallingBlock)this.myEntity; + return new S0EPacketSpawnObject(this.myEntity, 70, Block.getIdFromBlock(entityfallingblock.func_145805_f()) | entityfallingblock.field_145814_a << 16); + } + else if (this.myEntity instanceof EntityPainting) + { + return new S10PacketSpawnPainting((EntityPainting)this.myEntity); + } + else if (this.myEntity instanceof EntityItemFrame) + { + EntityItemFrame entityitemframe = (EntityItemFrame)this.myEntity; + s0epacketspawnobject = new S0EPacketSpawnObject(this.myEntity, 71, entityitemframe.hangingDirection); + s0epacketspawnobject.func_148996_a(MathHelper.floor_float((float)(entityitemframe.field_146063_b * 32))); + s0epacketspawnobject.func_148995_b(MathHelper.floor_float((float)(entityitemframe.field_146064_c * 32))); + s0epacketspawnobject.func_149005_c(MathHelper.floor_float((float)(entityitemframe.field_146062_d * 32))); + return s0epacketspawnobject; + } + else if (this.myEntity instanceof EntityLeashKnot) + { + EntityLeashKnot entityleashknot = (EntityLeashKnot)this.myEntity; + s0epacketspawnobject = new S0EPacketSpawnObject(this.myEntity, 77); + s0epacketspawnobject.func_148996_a(MathHelper.floor_float((float)(entityleashknot.field_146063_b * 32))); + s0epacketspawnobject.func_148995_b(MathHelper.floor_float((float)(entityleashknot.field_146064_c * 32))); + s0epacketspawnobject.func_149005_c(MathHelper.floor_float((float)(entityleashknot.field_146062_d * 32))); + return s0epacketspawnobject; + } + else if (this.myEntity instanceof EntityXPOrb) + { + return new S11PacketSpawnExperienceOrb((EntityXPOrb)this.myEntity); + } + else + { + throw new IllegalArgumentException("Don\'t know how to add " + this.myEntity.getClass() + "!"); + } + } + } + else + { + this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); + return new S0FPacketSpawnMob((EntityLivingBase)this.myEntity); + } + } + + public void removePlayerFromTracker(EntityPlayerMP p_73123_1_) + { + if (this.trackingPlayers.contains(p_73123_1_)) + { + this.trackingPlayers.remove(p_73123_1_); + p_73123_1_.func_152339_d(this.myEntity); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureAttribute.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureAttribute.java new file mode 100644 index 0000000..0cd5fd2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureAttribute.java @@ -0,0 +1,10 @@ +package net.minecraft.entity; + +public enum EnumCreatureAttribute +{ + UNDEFINED, + UNDEAD, + ARTHROPOD; + + private static final String __OBFID = "CL_00001553"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureType.java b/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureType.java new file mode 100644 index 0000000..8cf9393 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/EnumCreatureType.java @@ -0,0 +1,68 @@ +package net.minecraft.entity; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityAmbientCreature; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; + +public enum EnumCreatureType +{ + monster(IMob.class, 70, Material.air, false, false), + creature(EntityAnimal.class, 10, Material.air, true, true), + ambient(EntityAmbientCreature.class, 15, Material.air, true, false), + waterCreature(EntityWaterMob.class, 5, Material.water, true, false); + /** + * The root class of creatures associated with this EnumCreatureType (IMobs for aggressive creatures, EntityAnimals + * for friendly ones) + */ + private final Class creatureClass; + private final int maxNumberOfCreature; + private final Material creatureMaterial; + /** A flag indicating whether this creature type is peaceful. */ + private final boolean isPeacefulCreature; + /** Whether this creature type is an animal. */ + private final boolean isAnimal; + + private static final String __OBFID = "CL_00001551"; + + private EnumCreatureType(Class p_i1596_3_, int p_i1596_4_, Material p_i1596_5_, boolean p_i1596_6_, boolean p_i1596_7_) + { + this.creatureClass = p_i1596_3_; + this.maxNumberOfCreature = p_i1596_4_; + this.creatureMaterial = p_i1596_5_; + this.isPeacefulCreature = p_i1596_6_; + this.isAnimal = p_i1596_7_; + } + + public Class getCreatureClass() + { + return this.creatureClass; + } + + public int getMaxNumberOfCreature() + { + return this.maxNumberOfCreature; + } + + public Material getCreatureMaterial() + { + return this.creatureMaterial; + } + + /** + * Gets whether or not this creature type is peaceful. + */ + public boolean getPeacefulCreature() + { + return this.isPeacefulCreature; + } + + /** + * Return whether this creature type is an animal. + */ + public boolean getAnimal() + { + return this.isAnimal; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityLivingData.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityLivingData.java new file mode 100644 index 0000000..f111c18 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityLivingData.java @@ -0,0 +1,5 @@ +package net.minecraft.entity; + +public interface IEntityLivingData +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityMultiPart.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityMultiPart.java new file mode 100644 index 0000000..ba28b64 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityMultiPart.java @@ -0,0 +1,12 @@ +package net.minecraft.entity; + +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public interface IEntityMultiPart +{ + World func_82194_d(); + + boolean attackEntityFromPart(EntityDragonPart p_70965_1_, DamageSource p_70965_2_, float p_70965_3_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityOwnable.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityOwnable.java new file mode 100644 index 0000000..5d8e344 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IEntityOwnable.java @@ -0,0 +1,8 @@ +package net.minecraft.entity; + +public interface IEntityOwnable +{ + String func_152113_b(); + + Entity getOwner(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IMerchant.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IMerchant.java new file mode 100644 index 0000000..09fb4ac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IMerchant.java @@ -0,0 +1,24 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public interface IMerchant +{ + void setCustomer(EntityPlayer p_70932_1_); + + EntityPlayer getCustomer(); + + MerchantRecipeList getRecipes(EntityPlayer p_70934_1_); + + @SideOnly(Side.CLIENT) + void setRecipes(MerchantRecipeList p_70930_1_); + + void useRecipe(MerchantRecipe p_70933_1_); + + void func_110297_a_(ItemStack p_110297_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/INpc.java b/build/rfg/minecraft-src/java/net/minecraft/entity/INpc.java new file mode 100644 index 0000000..2d877be --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/INpc.java @@ -0,0 +1,7 @@ +package net.minecraft.entity; + +import net.minecraft.entity.passive.IAnimals; + +public interface INpc extends IAnimals +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IProjectile.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IProjectile.java new file mode 100644 index 0000000..44b5ab0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IProjectile.java @@ -0,0 +1,9 @@ +package net.minecraft.entity; + +public interface IProjectile +{ + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/IRangedAttackMob.java b/build/rfg/minecraft-src/java/net/minecraft/entity/IRangedAttackMob.java new file mode 100644 index 0000000..c67d485 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/IRangedAttackMob.java @@ -0,0 +1,9 @@ +package net.minecraft.entity; + +public interface IRangedAttackMob +{ + /** + * Attack the specified entity using a ranged attack. + */ + void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/NpcMerchant.java b/build/rfg/minecraft-src/java/net/minecraft/entity/NpcMerchant.java new file mode 100644 index 0000000..01543d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/NpcMerchant.java @@ -0,0 +1,48 @@ +package net.minecraft.entity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +@SideOnly(Side.CLIENT) +public class NpcMerchant implements IMerchant +{ + /** Instance of Merchants Inventory. */ + private InventoryMerchant theMerchantInventory; + /** This merchant's current player customer. */ + private EntityPlayer customer; + /** The MerchantRecipeList instance. */ + private MerchantRecipeList recipeList; + private static final String __OBFID = "CL_00001705"; + + public NpcMerchant(EntityPlayer p_i1746_1_) + { + this.customer = p_i1746_1_; + this.theMerchantInventory = new InventoryMerchant(p_i1746_1_, this); + } + + public EntityPlayer getCustomer() + { + return this.customer; + } + + public void setCustomer(EntityPlayer p_70932_1_) {} + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) + { + return this.recipeList; + } + + public void setRecipes(MerchantRecipeList p_70930_1_) + { + this.recipeList = p_70930_1_; + } + + public void useRecipe(MerchantRecipe p_70933_1_) {} + + public void func_110297_a_(ItemStack p_110297_1_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/SharedMonsterAttributes.java b/build/rfg/minecraft-src/java/net/minecraft/entity/SharedMonsterAttributes.java new file mode 100644 index 0000000..9431167 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/SharedMonsterAttributes.java @@ -0,0 +1,138 @@ +package net.minecraft.entity; + +import java.util.Collection; +import java.util.Iterator; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SharedMonsterAttributes +{ + private static final Logger logger = LogManager.getLogger(); + public static final IAttribute maxHealth = (new RangedAttribute("generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).setDescription("Max Health").setShouldWatch(true); + public static final IAttribute followRange = (new RangedAttribute("generic.followRange", 32.0D, 0.0D, 2048.0D)).setDescription("Follow Range"); + public static final IAttribute knockbackResistance = (new RangedAttribute("generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).setDescription("Knockback Resistance"); + public static final IAttribute movementSpeed = (new RangedAttribute("generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).setDescription("Movement Speed").setShouldWatch(true); + public static final IAttribute attackDamage = new RangedAttribute("generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE); + private static final String __OBFID = "CL_00001695"; + + /** + * Creates an NBTTagList from a BaseAttributeMap, including all its AttributeInstances + */ + public static NBTTagList writeBaseAttributeMapToNBT(BaseAttributeMap p_111257_0_) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = p_111257_0_.getAllAttributes().iterator(); + + while (iterator.hasNext()) + { + IAttributeInstance iattributeinstance = (IAttributeInstance)iterator.next(); + nbttaglist.appendTag(writeAttributeInstanceToNBT(iattributeinstance)); + } + + return nbttaglist; + } + + /** + * Creates an NBTTagCompound from an AttributeInstance, including its AttributeModifiers + */ + private static NBTTagCompound writeAttributeInstanceToNBT(IAttributeInstance p_111261_0_) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + IAttribute iattribute = p_111261_0_.getAttribute(); + nbttagcompound.setString("Name", iattribute.getAttributeUnlocalizedName()); + nbttagcompound.setDouble("Base", p_111261_0_.getBaseValue()); + Collection collection = p_111261_0_.func_111122_c(); + + if (collection != null && !collection.isEmpty()) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + AttributeModifier attributemodifier = (AttributeModifier)iterator.next(); + + if (attributemodifier.isSaved()) + { + nbttaglist.appendTag(writeAttributeModifierToNBT(attributemodifier)); + } + } + + nbttagcompound.setTag("Modifiers", nbttaglist); + } + + return nbttagcompound; + } + + /** + * Creates an NBTTagCompound from an AttributeModifier + */ + private static NBTTagCompound writeAttributeModifierToNBT(AttributeModifier p_111262_0_) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", p_111262_0_.getName()); + nbttagcompound.setDouble("Amount", p_111262_0_.getAmount()); + nbttagcompound.setInteger("Operation", p_111262_0_.getOperation()); + nbttagcompound.setLong("UUIDMost", p_111262_0_.getID().getMostSignificantBits()); + nbttagcompound.setLong("UUIDLeast", p_111262_0_.getID().getLeastSignificantBits()); + return nbttagcompound; + } + + public static void func_151475_a(BaseAttributeMap p_151475_0_, NBTTagList p_151475_1_) + { + for (int i = 0; i < p_151475_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_151475_1_.getCompoundTagAt(i); + IAttributeInstance iattributeinstance = p_151475_0_.getAttributeInstanceByName(nbttagcompound.getString("Name")); + + if (iattributeinstance != null) + { + applyModifiersToAttributeInstance(iattributeinstance, nbttagcompound); + } + else + { + logger.warn("Ignoring unknown attribute \'" + nbttagcompound.getString("Name") + "\'"); + } + } + } + + private static void applyModifiersToAttributeInstance(IAttributeInstance p_111258_0_, NBTTagCompound p_111258_1_) + { + p_111258_0_.setBaseValue(p_111258_1_.getDouble("Base")); + + if (p_111258_1_.hasKey("Modifiers", 9)) + { + NBTTagList nbttaglist = p_111258_1_.getTagList("Modifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + AttributeModifier attributemodifier = readAttributeModifierFromNBT(nbttaglist.getCompoundTagAt(i)); + AttributeModifier attributemodifier1 = p_111258_0_.getModifier(attributemodifier.getID()); + + if (attributemodifier1 != null) + { + p_111258_0_.removeModifier(attributemodifier1); + } + + p_111258_0_.applyModifier(attributemodifier); + } + } + } + + /** + * Creates an AttributeModifier from an NBTTagCompound + */ + public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound p_111259_0_) + { + UUID uuid = new UUID(p_111259_0_.getLong("UUIDMost"), p_111259_0_.getLong("UUIDLeast")); + return new AttributeModifier(uuid, p_111259_0_.getString("Name"), p_111259_0_.getDouble("Amount"), p_111259_0_.getInteger("Operation")); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIArrowAttack.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIArrowAttack.java new file mode 100644 index 0000000..f720181 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIArrowAttack.java @@ -0,0 +1,149 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.util.MathHelper; + +public class EntityAIArrowAttack extends EntityAIBase +{ + /** The entity the AI instance has been applied to */ + private final EntityLiving entityHost; + /** The entity (as a RangedAttackMob) the AI instance has been applied to. */ + private final IRangedAttackMob rangedAttackEntityHost; + private EntityLivingBase attackTarget; + /** + * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the + * maxRangedAttackTime. + */ + private int rangedAttackTime; + private double entityMoveSpeed; + private int field_75318_f; + private int field_96561_g; + /** The maximum time the AI has to wait before peforming another ranged attack. */ + private int maxRangedAttackTime; + private float field_96562_i; + private float field_82642_h; + private static final String __OBFID = "CL_00001609"; + + public EntityAIArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_) + { + this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_); + } + + public EntityAIArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_) + { + this.rangedAttackTime = -1; + + if (!(p_i1650_1_ instanceof EntityLivingBase)) + { + throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + } + else + { + this.rangedAttackEntityHost = p_i1650_1_; + this.entityHost = (EntityLiving)p_i1650_1_; + this.entityMoveSpeed = p_i1650_2_; + this.field_96561_g = p_i1650_4_; + this.maxRangedAttackTime = p_i1650_5_; + this.field_96562_i = p_i1650_6_; + this.field_82642_h = p_i1650_6_ * p_i1650_6_; + this.setMutexBits(3); + } + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.attackTarget = entitylivingbase; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.attackTarget = null; + this.field_75318_f = 0; + this.rangedAttackTime = -1; + } + + /** + * Updates the task + */ + public void updateTask() + { + double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ); + boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget); + + if (flag) + { + ++this.field_75318_f; + } + else + { + this.field_75318_f = 0; + } + + if (d0 <= (double)this.field_82642_h && this.field_75318_f >= 20) + { + this.entityHost.getNavigator().clearPathEntity(); + } + else + { + this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); + } + + this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); + float f; + + if (--this.rangedAttackTime == 0) + { + if (d0 > (double)this.field_82642_h || !flag) + { + return; + } + + f = MathHelper.sqrt_double(d0) / this.field_96562_i; + float f1 = f; + + if (f < 0.1F) + { + f1 = 0.1F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, f1); + this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } + else if (this.rangedAttackTime < 0) + { + f = MathHelper.sqrt_double(d0) / this.field_96562_i; + this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java new file mode 100644 index 0000000..9fb8628 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAttackOnCollide.java @@ -0,0 +1,170 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIAttackOnCollide extends EntityAIBase +{ + World worldObj; + EntityCreature attacker; + /** An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. */ + int attackTick; + /** The speed with which the mob will approach the target */ + double speedTowardsTarget; + /** When true, the mob will continue chasing its target, even if it can't find a path to them right now. */ + boolean longMemory; + /** The PathEntity of our entity. */ + PathEntity entityPathEntity; + Class classTarget; + private int field_75445_i; + private double field_151497_i; + private double field_151495_j; + private double field_151496_k; + private static final String __OBFID = "CL_00001595"; + + private int failedPathFindingPenalty; + + public EntityAIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) + { + this(p_i1635_1_, p_i1635_3_, p_i1635_5_); + this.classTarget = p_i1635_2_; + } + + public EntityAIAttackOnCollide(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) + { + this.attacker = p_i1636_1_; + this.worldObj = p_i1636_1_.worldObj; + this.speedTowardsTarget = p_i1636_2_; + this.longMemory = p_i1636_4_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) + { + return false; + } + else + { + if (-- this.field_75445_i <= 0) + { + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); + this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); + return this.entityPathEntity != null; + } + else + { + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)))); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); + this.field_75445_i = 0; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.attacker.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() + { + EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); + double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); + double d1 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width); + --this.field_75445_i; + + if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D || entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F)) + { + this.field_151497_i = entitylivingbase.posX; + this.field_151495_j = entitylivingbase.boundingBox.minY; + this.field_151496_k = entitylivingbase.posZ; + this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7); + + if (this.attacker.getNavigator().getPath() != null) + { + PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); + if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) + { + failedPathFindingPenalty = 0; + } + else + { + failedPathFindingPenalty += 10; + } + } + else + { + failedPathFindingPenalty += 10; + } + + if (d0 > 1024.0D) + { + this.field_75445_i += 10; + } + else if (d0 > 256.0D) + { + this.field_75445_i += 5; + } + + if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) + { + this.field_75445_i += 15; + } + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + + if (d0 <= d1 && this.attackTick <= 20) + { + this.attackTick = 20; + + if (this.attacker.getHeldItem() != null) + { + this.attacker.swingItem(); + } + + this.attacker.attackEntityAsMob(entitylivingbase); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java new file mode 100644 index 0000000..5236139 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIAvoidEntity.java @@ -0,0 +1,137 @@ +package net.minecraft.entity.ai; + +import java.util.List; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.Vec3; + +public class EntityAIAvoidEntity extends EntityAIBase +{ + public final IEntitySelector field_98218_a = new IEntitySelector() + { + private static final String __OBFID = "CL_00001575"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_.isEntityAlive() && EntityAIAvoidEntity.this.theEntity.getEntitySenses().canSee(p_82704_1_); + } + }; + /** The entity we are attached to */ + private EntityCreature theEntity; + private double farSpeed; + private double nearSpeed; + private Entity closestLivingEntity; + private float distanceFromEntity; + /** The PathEntity of our entity */ + private PathEntity entityPathEntity; + /** The PathNavigate of our entity */ + private PathNavigate entityPathNavigate; + /** The class of the entity we should avoid */ + private Class targetEntityClass; + private static final String __OBFID = "CL_00001574"; + + public EntityAIAvoidEntity(EntityCreature p_i1616_1_, Class p_i1616_2_, float p_i1616_3_, double p_i1616_4_, double p_i1616_6_) + { + this.theEntity = p_i1616_1_; + this.targetEntityClass = p_i1616_2_; + this.distanceFromEntity = p_i1616_3_; + this.farSpeed = p_i1616_4_; + this.nearSpeed = p_i1616_6_; + this.entityPathNavigate = p_i1616_1_.getNavigator(); + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.targetEntityClass == EntityPlayer.class) + { + if (this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) + { + return false; + } + + this.closestLivingEntity = this.theEntity.worldObj.getClosestPlayerToEntity(this.theEntity, (double)this.distanceFromEntity); + + if (this.closestLivingEntity == null) + { + return false; + } + } + else + { + List list = this.theEntity.worldObj.selectEntitiesWithinAABB(this.targetEntityClass, this.theEntity.boundingBox.expand((double)this.distanceFromEntity, 3.0D, (double)this.distanceFromEntity), this.field_98218_a); + + if (list.isEmpty()) + { + return false; + } + + this.closestLivingEntity = (Entity)list.get(0); + } + + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, Vec3.createVectorHelper(this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); + + if (vec3 == null) + { + return false; + } + else if (this.closestLivingEntity.getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) + { + return false; + } + else + { + this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); + return this.entityPathEntity == null ? false : this.entityPathEntity.isDestinationSame(vec3); + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.entityPathNavigate.noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.closestLivingEntity = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) + { + this.theEntity.getNavigator().setSpeed(this.nearSpeed); + } + else + { + this.theEntity.getNavigator().setSpeed(this.farSpeed); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBase.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBase.java new file mode 100644 index 0000000..eac9803 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBase.java @@ -0,0 +1,65 @@ +package net.minecraft.entity.ai; + +public abstract class EntityAIBase +{ + /** + * A bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + private int mutexBits; + private static final String __OBFID = "CL_00001587"; + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public abstract boolean shouldExecute(); + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.shouldExecute(); + } + + /** + * Determine if this AI Task is interruptible by a higher (= lower value) priority task. + */ + public boolean isInterruptible() + { + return true; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() {} + + /** + * Resets the task + */ + public void resetTask() {} + + /** + * Updates the task + */ + public void updateTask() {} + + /** + * Sets a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it + * yields zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + public void setMutexBits(int p_75248_1_) + { + this.mutexBits = p_75248_1_; + } + + /** + * Get a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields + * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. + */ + public int getMutexBits() + { + return this.mutexBits; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBeg.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBeg.java new file mode 100644 index 0000000..4238a8f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBeg.java @@ -0,0 +1,78 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityAIBeg extends EntityAIBase +{ + private EntityWolf theWolf; + private EntityPlayer thePlayer; + private World worldObject; + private float minPlayerDistance; + private int field_75384_e; + private static final String __OBFID = "CL_00001576"; + + public EntityAIBeg(EntityWolf p_i1617_1_, float p_i1617_2_) + { + this.theWolf = p_i1617_1_; + this.worldObject = p_i1617_1_.worldObj; + this.minPlayerDistance = p_i1617_2_; + this.setMutexBits(2); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, (double)this.minPlayerDistance); + return this.thePlayer == null ? false : this.hasPlayerGotBoneInHand(this.thePlayer); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.thePlayer.isEntityAlive() ? false : (this.theWolf.getDistanceSqToEntity(this.thePlayer) > (double)(this.minPlayerDistance * this.minPlayerDistance) ? false : this.field_75384_e > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theWolf.func_70918_i(true); + this.field_75384_e = 40 + this.theWolf.getRNG().nextInt(40); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theWolf.func_70918_i(false); + this.thePlayer = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, this.thePlayer.posY + (double)this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, (float)this.theWolf.getVerticalFaceSpeed()); + --this.field_75384_e; + } + + /** + * Gets if the Player has the Bone in the hand. + */ + private boolean hasPlayerGotBoneInHand(EntityPlayer p_75382_1_) + { + ItemStack itemstack = p_75382_1_.inventory.getCurrentItem(); + return itemstack == null ? false : (!this.theWolf.isTamed() && itemstack.getItem() == Items.bone ? true : this.theWolf.isBreedingItem(itemstack)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBreakDoor.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBreakDoor.java new file mode 100644 index 0000000..791cb7c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIBreakDoor.java @@ -0,0 +1,81 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLiving; +import net.minecraft.world.EnumDifficulty; + +public class EntityAIBreakDoor extends EntityAIDoorInteract +{ + private int breakingTime; + private int field_75358_j = -1; + private static final String __OBFID = "CL_00001577"; + + public EntityAIBreakDoor(EntityLiving p_i1618_1_) + { + super(p_i1618_1_); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing") ? false : !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + super.startExecuting(); + this.breakingTime = 0; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + double d0 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ); + return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && d0 < 4.0D; + } + + /** + * Resets the task + */ + public void resetTask() + { + super.resetTask(); + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, -1); + } + + /** + * Updates the task + */ + public void updateTask() + { + super.updateTask(); + + if (this.theEntity.getRNG().nextInt(20) == 0) + { + this.theEntity.worldObj.playAuxSFX(1010, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + } + + ++this.breakingTime; + int i = (int)((float)this.breakingTime / 240.0F * 10.0F); + + if (i != this.field_75358_j) + { + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, i); + this.field_75358_j = i; + } + + if (this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == EnumDifficulty.HARD) + { + this.theEntity.worldObj.setBlockToAir(this.entityPosX, this.entityPosY, this.entityPosZ); + this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, Block.getIdFromBlock(this.field_151504_e)); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java new file mode 100644 index 0000000..83384cf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIControlledByPlayer.java @@ -0,0 +1,217 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; + +public class EntityAIControlledByPlayer extends EntityAIBase +{ + private final EntityLiving thisEntity; + private final float maxSpeed; + private float currentSpeed; + /** Whether the entity's speed is boosted. */ + private boolean speedBoosted; + /** Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled */ + private int speedBoostTime; + /** Maximum time the entity's speed should be boosted for. */ + private int maxSpeedBoostTime; + private static final String __OBFID = "CL_00001580"; + + public EntityAIControlledByPlayer(EntityLiving p_i1620_1_, float p_i1620_2_) + { + this.thisEntity = p_i1620_1_; + this.maxSpeed = p_i1620_2_; + this.setMutexBits(7); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.currentSpeed = 0.0F; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.speedBoosted = false; + this.currentSpeed = 0.0F; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); + } + + /** + * Updates the task + */ + public void updateTask() + { + EntityPlayer entityplayer = (EntityPlayer)this.thisEntity.riddenByEntity; + EntityCreature entitycreature = (EntityCreature)this.thisEntity; + float f = MathHelper.wrapAngleTo180_float(entityplayer.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; + + if (f > 5.0F) + { + f = 5.0F; + } + + if (f < -5.0F) + { + f = -5.0F; + } + + this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + f); + + if (this.currentSpeed < this.maxSpeed) + { + this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; + } + + if (this.currentSpeed > this.maxSpeed) + { + this.currentSpeed = this.maxSpeed; + } + + int i = MathHelper.floor_double(this.thisEntity.posX); + int j = MathHelper.floor_double(this.thisEntity.posY); + int k = MathHelper.floor_double(this.thisEntity.posZ); + float f1 = this.currentSpeed; + + if (this.speedBoosted) + { + if (this.speedBoostTime++ > this.maxSpeedBoostTime) + { + this.speedBoosted = false; + } + + f1 += f1 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); + } + + float f2 = 0.91F; + + if (this.thisEntity.onGround) + { + f2 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)i), MathHelper.floor_float((float)j) - 1, MathHelper.floor_float((float)k)).slipperiness * 0.91F; + } + + float f3 = 0.16277136F / (f2 * f2 * f2); + float f4 = MathHelper.sin(entitycreature.rotationYaw * (float)Math.PI / 180.0F); + float f5 = MathHelper.cos(entitycreature.rotationYaw * (float)Math.PI / 180.0F); + float f6 = entitycreature.getAIMoveSpeed() * f3; + float f7 = Math.max(f1, 1.0F); + f7 = f6 / f7; + float f8 = f1 * f7; + float f9 = -(f8 * f4); + float f10 = f8 * f5; + + if (MathHelper.abs(f9) > MathHelper.abs(f10)) + { + if (f9 < 0.0F) + { + f9 -= this.thisEntity.width / 2.0F; + } + + if (f9 > 0.0F) + { + f9 += this.thisEntity.width / 2.0F; + } + + f10 = 0.0F; + } + else + { + f9 = 0.0F; + + if (f10 < 0.0F) + { + f10 -= this.thisEntity.width / 2.0F; + } + + if (f10 > 0.0F) + { + f10 += this.thisEntity.width / 2.0F; + } + } + + int l = MathHelper.floor_double(this.thisEntity.posX + (double)f9); + int i1 = MathHelper.floor_double(this.thisEntity.posZ + (double)f10); + PathPoint pathpoint = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + entityplayer.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); + + if (i != l || k != i1) + { + Block block = this.thisEntity.worldObj.getBlock(i, j, k); + boolean flag = !this.func_151498_a(block) && (block.getMaterial() != Material.air || !this.func_151498_a(this.thisEntity.worldObj.getBlock(i, j - 1, k))); + + if (flag && PathFinder.func_82565_a(this.thisEntity, l, j, i1, pathpoint, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, i, j + 1, k, pathpoint, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, l, j + 1, i1, pathpoint, false, false, true) == 1) + { + entitycreature.getJumpHelper().setJumping(); + } + } + + if (!entityplayer.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) + { + ItemStack itemstack = entityplayer.getHeldItem(); + + if (itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick) + { + itemstack.damageItem(1, entityplayer); + + if (itemstack.stackSize == 0) + { + ItemStack itemstack1 = new ItemStack(Items.fishing_rod); + itemstack1.setTagCompound(itemstack.stackTagCompound); + entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = itemstack1; + } + } + } + + this.thisEntity.moveEntityWithHeading(0.0F, f1); + } + + private boolean func_151498_a(Block p_151498_1_) + { + return p_151498_1_.getRenderType() == 10 || p_151498_1_ instanceof BlockSlab; + } + + /** + * Return whether the entity's speed is boosted. + */ + public boolean isSpeedBoosted() + { + return this.speedBoosted; + } + + /** + * Boost the entity's movement speed. + */ + public void boostSpeed() + { + this.speedBoosted = true; + this.speedBoostTime = 0; + this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; + } + + /** + * Return whether the entity is being controlled by a player. + */ + public boolean isControlledByPlayer() + { + return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAICreeperSwell.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAICreeperSwell.java new file mode 100644 index 0000000..4773390 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAICreeperSwell.java @@ -0,0 +1,68 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; + +public class EntityAICreeperSwell extends EntityAIBase +{ + /** The creeper that is swelling. */ + EntityCreeper swellingCreeper; + /** The creeper's attack target. This is used for the changing of the creeper's state. */ + EntityLivingBase creeperAttackTarget; + private static final String __OBFID = "CL_00001614"; + + public EntityAICreeperSwell(EntityCreeper p_i1655_1_) + { + this.swellingCreeper = p_i1655_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || entitylivingbase != null && this.swellingCreeper.getDistanceSqToEntity(entitylivingbase) < 9.0D; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.swellingCreeper.getNavigator().clearPathEntity(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.creeperAttackTarget = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + if (this.creeperAttackTarget == null) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) + { + this.swellingCreeper.setCreeperState(-1); + } + else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) + { + this.swellingCreeper.setCreeperState(-1); + } + else + { + this.swellingCreeper.setCreeperState(1); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDefendVillage.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDefendVillage.java new file mode 100644 index 0000000..53d1236 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDefendVillage.java @@ -0,0 +1,63 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.village.Village; + +public class EntityAIDefendVillage extends EntityAITarget +{ + EntityIronGolem irongolem; + /** The aggressor of the iron golem's village which is now the golem's attack target. */ + EntityLivingBase villageAgressorTarget; + private static final String __OBFID = "CL_00001618"; + + public EntityAIDefendVillage(EntityIronGolem p_i1659_1_) + { + super(p_i1659_1_, false, true); + this.irongolem = p_i1659_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + Village village = this.irongolem.getVillage(); + + if (village == null) + { + return false; + } + else + { + this.villageAgressorTarget = village.findNearestVillageAggressor(this.irongolem); + + if (!this.isSuitableTarget(this.villageAgressorTarget, false)) + { + if (this.taskOwner.getRNG().nextInt(20) == 0) + { + this.villageAgressorTarget = village.func_82685_c(this.irongolem); + return this.isSuitableTarget(this.villageAgressorTarget, false); + } + else + { + return false; + } + } + else + { + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.irongolem.setAttackTarget(this.villageAgressorTarget); + super.startExecuting(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDoorInteract.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDoorInteract.java new file mode 100644 index 0000000..ee319c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIDoorInteract.java @@ -0,0 +1,115 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; + +public abstract class EntityAIDoorInteract extends EntityAIBase +{ + protected EntityLiving theEntity; + protected int entityPosX; + protected int entityPosY; + protected int entityPosZ; + protected BlockDoor field_151504_e; + /** If is true then the Entity has stopped Door Interaction and compoleted the task. */ + boolean hasStoppedDoorInteraction; + float entityPositionX; + float entityPositionZ; + private static final String __OBFID = "CL_00001581"; + + public EntityAIDoorInteract(EntityLiving p_i1621_1_) + { + this.theEntity = p_i1621_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theEntity.isCollidedHorizontally) + { + return false; + } + else + { + PathNavigate pathnavigate = this.theEntity.getNavigator(); + PathEntity pathentity = pathnavigate.getPath(); + + if (pathentity != null && !pathentity.isFinished() && pathnavigate.getCanBreakDoors()) + { + for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) + { + PathPoint pathpoint = pathentity.getPathPointFromIndex(i); + this.entityPosX = pathpoint.xCoord; + this.entityPosY = pathpoint.yCoord + 1; + this.entityPosZ = pathpoint.zCoord; + + if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D) + { + this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ); + + if (this.field_151504_e != null) + { + return true; + } + } + } + + this.entityPosX = MathHelper.floor_double(this.theEntity.posX); + this.entityPosY = MathHelper.floor_double(this.theEntity.posY + 1.0D); + this.entityPosZ = MathHelper.floor_double(this.theEntity.posZ); + this.field_151504_e = this.func_151503_a(this.entityPosX, this.entityPosY, this.entityPosZ); + return this.field_151504_e != null; + } + else + { + return false; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.hasStoppedDoorInteraction; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.hasStoppedDoorInteraction = false; + this.entityPositionX = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + this.entityPositionZ = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + } + + /** + * Updates the task + */ + public void updateTask() + { + float f = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + float f1 = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + float f2 = this.entityPositionX * f + this.entityPositionZ * f1; + + if (f2 < 0.0F) + { + this.hasStoppedDoorInteraction = true; + } + } + + private BlockDoor func_151503_a(int p_151503_1_, int p_151503_2_, int p_151503_3_) + { + Block block = this.theEntity.worldObj.getBlock(p_151503_1_, p_151503_2_, p_151503_3_); + return block != Blocks.wooden_door ? null : (BlockDoor)block; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIEatGrass.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIEatGrass.java new file mode 100644 index 0000000..cb755db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIEatGrass.java @@ -0,0 +1,106 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIEatGrass extends EntityAIBase +{ + private EntityLiving field_151500_b; + private World field_151501_c; + int field_151502_a; + private static final String __OBFID = "CL_00001582"; + + public EntityAIEatGrass(EntityLiving p_i45314_1_) + { + this.field_151500_b = p_i45314_1_; + this.field_151501_c = p_i45314_1_.worldObj; + this.setMutexBits(7); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.field_151500_b.getRNG().nextInt(this.field_151500_b.isChild() ? 50 : 1000) != 0) + { + return false; + } + else + { + int i = MathHelper.floor_double(this.field_151500_b.posX); + int j = MathHelper.floor_double(this.field_151500_b.posY); + int k = MathHelper.floor_double(this.field_151500_b.posZ); + return this.field_151501_c.getBlock(i, j, k) == Blocks.tallgrass && this.field_151501_c.getBlockMetadata(i, j, k) == 1 ? true : this.field_151501_c.getBlock(i, j - 1, k) == Blocks.grass; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.field_151502_a = 40; + this.field_151501_c.setEntityState(this.field_151500_b, (byte)10); + this.field_151500_b.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.field_151502_a = 0; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.field_151502_a > 0; + } + + public int func_151499_f() + { + return this.field_151502_a; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.field_151502_a = Math.max(0, this.field_151502_a - 1); + + if (this.field_151502_a == 4) + { + int i = MathHelper.floor_double(this.field_151500_b.posX); + int j = MathHelper.floor_double(this.field_151500_b.posY); + int k = MathHelper.floor_double(this.field_151500_b.posZ); + + if (this.field_151501_c.getBlock(i, j, k) == Blocks.tallgrass) + { + if (this.field_151501_c.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + this.field_151501_c.func_147480_a(i, j, k, false); + } + + this.field_151500_b.eatGrassBonus(); + } + else if (this.field_151501_c.getBlock(i, j - 1, k) == Blocks.grass) + { + if (this.field_151501_c.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + this.field_151501_c.playAuxSFX(2001, i, j - 1, k, Block.getIdFromBlock(Blocks.grass)); + this.field_151501_c.setBlock(i, j - 1, k, Blocks.dirt, 0, 2); + } + + this.field_151500_b.eatGrassBonus(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFleeSun.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFleeSun.java new file mode 100644 index 0000000..7bad24b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFleeSun.java @@ -0,0 +1,96 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityAIFleeSun extends EntityAIBase +{ + private EntityCreature theCreature; + private double shelterX; + private double shelterY; + private double shelterZ; + private double movementSpeed; + private World theWorld; + private static final String __OBFID = "CL_00001583"; + + public EntityAIFleeSun(EntityCreature p_i1623_1_, double p_i1623_2_) + { + this.theCreature = p_i1623_1_; + this.movementSpeed = p_i1623_2_; + this.theWorld = p_i1623_1_.worldObj; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theWorld.isDaytime()) + { + return false; + } + else if (!this.theCreature.isBurning()) + { + return false; + } + else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) + { + return false; + } + else + { + Vec3 vec3 = this.findPossibleShelter(); + + if (vec3 == null) + { + return false; + } + else + { + this.shelterX = vec3.xCoord; + this.shelterY = vec3.yCoord; + this.shelterZ = vec3.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.theCreature.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); + } + + private Vec3 findPossibleShelter() + { + Random random = this.theCreature.getRNG(); + + for (int i = 0; i < 10; ++i) + { + int j = MathHelper.floor_double(this.theCreature.posX + (double)random.nextInt(20) - 10.0D); + int k = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double)random.nextInt(6) - 3.0D); + int l = MathHelper.floor_double(this.theCreature.posZ + (double)random.nextInt(20) - 10.0D); + + if (!this.theWorld.canBlockSeeTheSky(j, k, l) && this.theCreature.getBlockPathWeight(j, k, l) < 0.0F) + { + return Vec3.createVectorHelper((double)j, (double)k, (double)l); + } + } + + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowGolem.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowGolem.java new file mode 100644 index 0000000..2c0dcc8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowGolem.java @@ -0,0 +1,109 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAIFollowGolem extends EntityAIBase +{ + private EntityVillager theVillager; + private EntityIronGolem theGolem; + private int takeGolemRoseTick; + private boolean tookGolemRose; + private static final String __OBFID = "CL_00001615"; + + public EntityAIFollowGolem(EntityVillager p_i1656_1_) + { + this.theVillager = p_i1656_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.theVillager.getGrowingAge() >= 0) + { + return false; + } + else if (!this.theVillager.worldObj.isDaytime()) + { + return false; + } + else + { + List list = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, this.theVillager.boundingBox.expand(6.0D, 2.0D, 6.0D)); + + if (list.isEmpty()) + { + return false; + } + else + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityIronGolem entityirongolem = (EntityIronGolem)iterator.next(); + + if (entityirongolem.getHoldRoseTick() > 0) + { + this.theGolem = entityirongolem; + break; + } + } + + return this.theGolem != null; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.theGolem.getHoldRoseTick() > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); + this.tookGolemRose = false; + this.theGolem.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theGolem = null; + this.theVillager.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); + + if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) + { + this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); + this.tookGolemRose = true; + } + + if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) + { + this.theGolem.setHoldingRose(false); + this.theVillager.getNavigator().clearPathEntity(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowOwner.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowOwner.java new file mode 100644 index 0000000..795bce1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowOwner.java @@ -0,0 +1,128 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.pathfinding.PathNavigate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityAIFollowOwner extends EntityAIBase +{ + private EntityTameable thePet; + private EntityLivingBase theOwner; + World theWorld; + private double field_75336_f; + private PathNavigate petPathfinder; + private int field_75343_h; + float maxDist; + float minDist; + private boolean field_75344_i; + private static final String __OBFID = "CL_00001585"; + + public EntityAIFollowOwner(EntityTameable p_i1625_1_, double p_i1625_2_, float p_i1625_4_, float p_i1625_5_) + { + this.thePet = p_i1625_1_; + this.theWorld = p_i1625_1_.worldObj; + this.field_75336_f = p_i1625_2_; + this.petPathfinder = p_i1625_1_.getNavigator(); + this.minDist = p_i1625_4_; + this.maxDist = p_i1625_5_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.thePet.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else if (this.thePet.isSitting()) + { + return false; + } + else if (this.thePet.getDistanceSqToEntity(entitylivingbase) < (double)(this.minDist * this.minDist)) + { + return false; + } + else + { + this.theOwner = entitylivingbase; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.field_75343_h = 0; + this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); + this.thePet.getNavigator().setAvoidsWater(false); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theOwner = null; + this.petPathfinder.clearPathEntity(); + this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); + } + + /** + * Updates the task + */ + public void updateTask() + { + this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); + + if (!this.thePet.isSitting()) + { + if (--this.field_75343_h <= 0) + { + this.field_75343_h = 10; + + if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) + { + if (!this.thePet.getLeashed()) + { + if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) + { + int i = MathHelper.floor_double(this.theOwner.posX) - 2; + int j = MathHelper.floor_double(this.theOwner.posZ) - 2; + int k = MathHelper.floor_double(this.theOwner.boundingBox.minY); + + for (int l = 0; l <= 4; ++l) + { + for (int i1 = 0; i1 <= 4; ++i1) + { + if ((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(this.theWorld, i + l, k - 1, j + i1) && !this.theWorld.getBlock(i + l, k, j + i1).isNormalCube() && !this.theWorld.getBlock(i + l, k + 1, j + i1).isNormalCube()) + { + this.thePet.setLocationAndAngles((double)((float)(i + l) + 0.5F), (double)k, (double)((float)(j + i1) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch); + this.petPathfinder.clearPathEntity(); + return; + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowParent.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowParent.java new file mode 100644 index 0000000..c478c56 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIFollowParent.java @@ -0,0 +1,113 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.passive.EntityAnimal; + +public class EntityAIFollowParent extends EntityAIBase +{ + /** The child that is following its parent. */ + EntityAnimal childAnimal; + EntityAnimal parentAnimal; + double field_75347_c; + private int field_75345_d; + private static final String __OBFID = "CL_00001586"; + + public EntityAIFollowParent(EntityAnimal p_i1626_1_, double p_i1626_2_) + { + this.childAnimal = p_i1626_1_; + this.field_75347_c = p_i1626_2_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.childAnimal.getGrowingAge() >= 0) + { + return false; + } + else + { + List list = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); + EntityAnimal entityanimal = null; + double d0 = Double.MAX_VALUE; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityAnimal entityanimal1 = (EntityAnimal)iterator.next(); + + if (entityanimal1.getGrowingAge() >= 0) + { + double d1 = this.childAnimal.getDistanceSqToEntity(entityanimal1); + + if (d1 <= d0) + { + d0 = d1; + entityanimal = entityanimal1; + } + } + } + + if (entityanimal == null) + { + return false; + } + else if (d0 < 9.0D) + { + return false; + } + else + { + this.parentAnimal = entityanimal; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + if (!this.parentAnimal.isEntityAlive()) + { + return false; + } + else + { + double d0 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); + return d0 >= 9.0D && d0 <= 256.0D; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.field_75345_d = 0; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.parentAnimal = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + if (--this.field_75345_d <= 0) + { + this.field_75345_d = 10; + this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java new file mode 100644 index 0000000..8e96509 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIHurtByTarget.java @@ -0,0 +1,57 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.AxisAlignedBB; + +public class EntityAIHurtByTarget extends EntityAITarget +{ + boolean entityCallsForHelp; + private int field_142052_b; + private static final String __OBFID = "CL_00001619"; + + public EntityAIHurtByTarget(EntityCreature p_i1660_1_, boolean p_i1660_2_) + { + super(p_i1660_1_, false); + this.entityCallsForHelp = p_i1660_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + int i = this.taskOwner.func_142015_aE(); + return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); + this.field_142052_b = this.taskOwner.func_142015_aE(); + + if (this.entityCallsForHelp) + { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityCreature entitycreature = (EntityCreature)iterator.next(); + + if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) + { + entitycreature.setAttackTarget(this.taskOwner.getAITarget()); + } + } + } + + super.startExecuting(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java new file mode 100644 index 0000000..ef7bc4d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILeapAtTarget.java @@ -0,0 +1,62 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityAILeapAtTarget extends EntityAIBase +{ + /** The entity that is leaping. */ + EntityLiving leaper; + /** The entity that the leaper is leaping towards. */ + EntityLivingBase leapTarget; + /** The entity's motionY after leaping. */ + float leapMotionY; + private static final String __OBFID = "CL_00001591"; + + public EntityAILeapAtTarget(EntityLiving p_i1630_1_, float p_i1630_2_) + { + this.leaper = p_i1630_1_; + this.leapMotionY = p_i1630_2_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + this.leapTarget = this.leaper.getAttackTarget(); + + if (this.leapTarget == null) + { + return false; + } + else + { + double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget); + return d0 >= 4.0D && d0 <= 16.0D ? (!this.leaper.onGround ? false : this.leaper.getRNG().nextInt(5) == 0) : false; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.leaper.onGround; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + double d0 = this.leapTarget.posX - this.leaper.posX; + double d1 = this.leapTarget.posZ - this.leaper.posZ; + float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1); + this.leaper.motionX += d0 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; + this.leaper.motionZ += d1 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; + this.leaper.motionY = (double)this.leapMotionY; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java new file mode 100644 index 0000000..fdaa9f6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtTradePlayer.java @@ -0,0 +1,32 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAILookAtTradePlayer extends EntityAIWatchClosest +{ + private final EntityVillager theMerchant; + private static final String __OBFID = "CL_00001593"; + + public EntityAILookAtTradePlayer(EntityVillager p_i1633_1_) + { + super(p_i1633_1_, EntityPlayer.class, 8.0F); + this.theMerchant = p_i1633_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.theMerchant.isTrading()) + { + this.closestEntity = this.theMerchant.getCustomer(); + return true; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtVillager.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtVillager.java new file mode 100644 index 0000000..901af4a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookAtVillager.java @@ -0,0 +1,73 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; + +public class EntityAILookAtVillager extends EntityAIBase +{ + private EntityIronGolem theGolem; + private EntityVillager theVillager; + private int lookTime; + private static final String __OBFID = "CL_00001602"; + + public EntityAILookAtVillager(EntityIronGolem p_i1643_1_) + { + this.theGolem = p_i1643_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theGolem.worldObj.isDaytime()) + { + return false; + } + else if (this.theGolem.getRNG().nextInt(8000) != 0) + { + return false; + } + else + { + this.theVillager = (EntityVillager)this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.theGolem.boundingBox.expand(6.0D, 2.0D, 6.0D), this.theGolem); + return this.theVillager != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.lookTime > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.lookTime = 400; + this.theGolem.setHoldingRose(true); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theGolem.setHoldingRose(false); + this.theVillager = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); + --this.lookTime; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookIdle.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookIdle.java new file mode 100644 index 0000000..71b2e45 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAILookIdle.java @@ -0,0 +1,58 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAILookIdle extends EntityAIBase +{ + /** The entity that is looking idle. */ + private EntityLiving idleEntity; + /** X offset to look at */ + private double lookX; + /** Z offset to look at */ + private double lookZ; + /** A decrementing tick that stops the entity from being idle once it reaches 0. */ + private int idleTime; + private static final String __OBFID = "CL_00001607"; + + public EntityAILookIdle(EntityLiving p_i1647_1_) + { + this.idleEntity = p_i1647_1_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return this.idleEntity.getRNG().nextFloat() < 0.02F; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.idleTime >= 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + double d0 = (Math.PI * 2D) * this.idleEntity.getRNG().nextDouble(); + this.lookX = Math.cos(d0); + this.lookZ = Math.sin(d0); + this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); + } + + /** + * Updates the task + */ + public void updateTask() + { + --this.idleTime; + this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, this.idleEntity.posY + (double)this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, 10.0F, (float)this.idleEntity.getVerticalFaceSpeed()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMate.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMate.java new file mode 100644 index 0000000..fa908c8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMate.java @@ -0,0 +1,157 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; + +public class EntityAIMate extends EntityAIBase +{ + private EntityAnimal theAnimal; + World theWorld; + private EntityAnimal targetMate; + /** Delay preventing a baby from spawning immediately when two mate-able animals find each other. */ + int spawnBabyDelay; + /** The speed the creature moves at during mating behavior. */ + double moveSpeed; + private static final String __OBFID = "CL_00001578"; + + public EntityAIMate(EntityAnimal p_i1619_1_, double p_i1619_2_) + { + this.theAnimal = p_i1619_1_; + this.theWorld = p_i1619_1_.worldObj; + this.moveSpeed = p_i1619_2_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theAnimal.isInLove()) + { + return false; + } + else + { + this.targetMate = this.getNearbyMate(); + return this.targetMate != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.targetMate = null; + this.spawnBabyDelay = 0; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); + this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); + ++this.spawnBabyDelay; + + if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) + { + this.spawnBaby(); + } + } + + /** + * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first + * valid mate found. + */ + private EntityAnimal getNearbyMate() + { + float f = 8.0F; + List list = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)f, (double)f, (double)f)); + double d0 = Double.MAX_VALUE; + EntityAnimal entityanimal = null; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityAnimal entityanimal1 = (EntityAnimal)iterator.next(); + + if (this.theAnimal.canMateWith(entityanimal1) && this.theAnimal.getDistanceSqToEntity(entityanimal1) < d0) + { + entityanimal = entityanimal1; + d0 = this.theAnimal.getDistanceSqToEntity(entityanimal1); + } + } + + return entityanimal; + } + + /** + * Spawns a baby animal of the same type. + */ + private void spawnBaby() + { + EntityAgeable entityageable = this.theAnimal.createChild(this.targetMate); + + if (entityageable != null) + { + EntityPlayer entityplayer = this.theAnimal.func_146083_cb(); + + if (entityplayer == null && this.targetMate.func_146083_cb() != null) + { + entityplayer = this.targetMate.func_146083_cb(); + } + + if (entityplayer != null) + { + entityplayer.triggerAchievement(StatList.field_151186_x); + + if (this.theAnimal instanceof EntityCow) + { + entityplayer.triggerAchievement(AchievementList.field_150962_H); + } + } + + this.theAnimal.setGrowingAge(6000); + this.targetMate.setGrowingAge(6000); + this.theAnimal.resetInLove(); + this.targetMate.resetInLove(); + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); + this.theWorld.spawnEntityInWorld(entityageable); + Random random = this.theAnimal.getRNG(); + + for (int i = 0; i < 7; ++i) + { + double d0 = random.nextGaussian() * 0.02D; + double d1 = random.nextGaussian() * 0.02D; + double d2 = random.nextGaussian() * 0.02D; + this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(random.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(random.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(random.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, d0, d1, d2); + } + + if (this.theWorld.getGameRules().getGameRuleBooleanValue("doMobLoot")) + { + this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, random.nextInt(7) + 1)); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java new file mode 100644 index 0000000..f4591fd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveIndoors.java @@ -0,0 +1,102 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveIndoors extends EntityAIBase +{ + private EntityCreature entityObj; + private VillageDoorInfo doorInfo; + private int insidePosX = -1; + private int insidePosZ = -1; + private static final String __OBFID = "CL_00001596"; + + public EntityAIMoveIndoors(EntityCreature p_i1637_1_) + { + this.entityObj = p_i1637_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + int i = MathHelper.floor_double(this.entityObj.posX); + int j = MathHelper.floor_double(this.entityObj.posY); + int k = MathHelper.floor_double(this.entityObj.posZ); + + if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining() || !this.entityObj.worldObj.getBiomeGenForCoords(i, k).canSpawnLightningBolt()) && !this.entityObj.worldObj.provider.hasNoSky) + { + if (this.entityObj.getRNG().nextInt(50) != 0) + { + return false; + } + else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) + { + return false; + } + else + { + Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(i, j, k, 14); + + if (village == null) + { + return false; + } + else + { + this.doorInfo = village.findNearestDoorUnrestricted(i, j, k); + return this.doorInfo != null; + } + } + } + else + { + return false; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.entityObj.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.insidePosX = -1; + + if (this.entityObj.getDistanceSq((double)this.doorInfo.getInsidePosX(), (double)this.doorInfo.posY, (double)this.doorInfo.getInsidePosZ()) > 256.0D) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, Vec3.createVectorHelper((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D)); + + if (vec3 != null) + { + this.entityObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, 1.0D); + } + } + else + { + this.entityObj.getNavigator().tryMoveToXYZ((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D, 1.0D); + } + } + + /** + * Resets the task + */ + public void resetTask() + { + this.insidePosX = this.doorInfo.getInsidePosX(); + this.insidePosZ = this.doorInfo.getInsidePosZ(); + this.doorInfo = null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java new file mode 100644 index 0000000..8ae1f7e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveThroughVillage.java @@ -0,0 +1,174 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityCreature; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIMoveThroughVillage extends EntityAIBase +{ + private EntityCreature theEntity; + private double movementSpeed; + /** The PathNavigate of our entity. */ + private PathEntity entityPathNavigate; + private VillageDoorInfo doorInfo; + private boolean isNocturnal; + private List doorList = new ArrayList(); + private static final String __OBFID = "CL_00001597"; + + public EntityAIMoveThroughVillage(EntityCreature p_i1638_1_, double p_i1638_2_, boolean p_i1638_4_) + { + this.theEntity = p_i1638_1_; + this.movementSpeed = p_i1638_2_; + this.isNocturnal = p_i1638_4_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + this.func_75414_f(); + + if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) + { + return false; + } + else + { + Village village = this.theEntity.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ), 0); + + if (village == null) + { + return false; + } + else + { + this.doorInfo = this.func_75412_a(village); + + if (this.doorInfo == null) + { + return false; + } + else + { + boolean flag = this.theEntity.getNavigator().getCanBreakDoors(); + this.theEntity.getNavigator().setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ); + this.theEntity.getNavigator().setBreakDoors(flag); + + if (this.entityPathNavigate != null) + { + return true; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, Vec3.createVectorHelper((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ)); + + if (vec3 == null) + { + return false; + } + else + { + this.theEntity.getNavigator().setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); + this.theEntity.getNavigator().setBreakDoors(flag); + return this.entityPathNavigate != null; + } + } + } + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + if (this.theEntity.getNavigator().noPath()) + { + return false; + } + else + { + float f = this.theEntity.width + 4.0F; + return this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) > (double)(f * f); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); + } + + /** + * Resets the task + */ + public void resetTask() + { + if (this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) < 16.0D) + { + this.doorList.add(this.doorInfo); + } + } + + private VillageDoorInfo func_75412_a(Village p_75412_1_) + { + VillageDoorInfo villagedoorinfo = null; + int i = Integer.MAX_VALUE; + List list = p_75412_1_.getVillageDoorInfoList(); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo1 = (VillageDoorInfo)iterator.next(); + int j = villagedoorinfo1.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); + + if (j < i && !this.func_75413_a(villagedoorinfo1)) + { + villagedoorinfo = villagedoorinfo1; + i = j; + } + } + + return villagedoorinfo; + } + + private boolean func_75413_a(VillageDoorInfo p_75413_1_) + { + Iterator iterator = this.doorList.iterator(); + VillageDoorInfo villagedoorinfo1; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + villagedoorinfo1 = (VillageDoorInfo)iterator.next(); + } + while (p_75413_1_.posX != villagedoorinfo1.posX || p_75413_1_.posY != villagedoorinfo1.posY || p_75413_1_.posZ != villagedoorinfo1.posZ); + + return true; + } + + private void func_75414_f() + { + if (this.doorList.size() > 15) + { + this.doorList.remove(0); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java new file mode 100644 index 0000000..6982c9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsRestriction.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsRestriction extends EntityAIBase +{ + private EntityCreature theEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double movementSpeed; + private static final String __OBFID = "CL_00001598"; + + public EntityAIMoveTowardsRestriction(EntityCreature p_i2347_1_, double p_i2347_2_) + { + this.theEntity = p_i2347_1_; + this.movementSpeed = p_i2347_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.theEntity.isWithinHomeDistanceCurrentPosition()) + { + return false; + } + else + { + ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); + + if (vec3 == null) + { + return false; + } + else + { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.theEntity.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java new file mode 100644 index 0000000..aa78f7f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIMoveTowardsTarget.java @@ -0,0 +1,83 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.Vec3; + +public class EntityAIMoveTowardsTarget extends EntityAIBase +{ + private EntityCreature theEntity; + private EntityLivingBase targetEntity; + private double movePosX; + private double movePosY; + private double movePosZ; + private double speed; + /** If the distance to the target entity is further than this, this AI task will not run. */ + private float maxTargetDistance; + private static final String __OBFID = "CL_00001599"; + + public EntityAIMoveTowardsTarget(EntityCreature p_i1640_1_, double p_i1640_2_, float p_i1640_4_) + { + this.theEntity = p_i1640_1_; + this.speed = p_i1640_2_; + this.maxTargetDistance = p_i1640_4_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + this.targetEntity = this.theEntity.getAttackTarget(); + + if (this.targetEntity == null) + { + return false; + } + else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) + { + return false; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); + + if (vec3 == null) + { + return false; + } + else + { + this.movePosX = vec3.xCoord; + this.movePosY = vec3.yCoord; + this.movePosZ = vec3.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.maxTargetDistance * this.maxTargetDistance); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.targetEntity = null; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java new file mode 100644 index 0000000..b751b8b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java @@ -0,0 +1,113 @@ +package net.minecraft.entity.ai; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; + +public class EntityAINearestAttackableTarget extends EntityAITarget +{ + private final Class targetClass; + private final int targetChance; + /** Instance of EntityAINearestAttackableTargetSorter. */ + private final EntityAINearestAttackableTarget.Sorter theNearestAttackableTargetSorter; + /** + * This filter is applied to the Entity search. Only matching entities will be targetted. (null -> no + * restrictions) + */ + private final IEntitySelector targetEntitySelector; + private EntityLivingBase targetEntity; + private static final String __OBFID = "CL_00001620"; + + public EntityAINearestAttackableTarget(EntityCreature p_i1663_1_, Class p_i1663_2_, int p_i1663_3_, boolean p_i1663_4_) + { + this(p_i1663_1_, p_i1663_2_, p_i1663_3_, p_i1663_4_, false); + } + + public EntityAINearestAttackableTarget(EntityCreature p_i1664_1_, Class p_i1664_2_, int p_i1664_3_, boolean p_i1664_4_, boolean p_i1664_5_) + { + this(p_i1664_1_, p_i1664_2_, p_i1664_3_, p_i1664_4_, p_i1664_5_, (IEntitySelector)null); + } + + public EntityAINearestAttackableTarget(EntityCreature p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_) + { + super(p_i1665_1_, p_i1665_4_, p_i1665_5_); + this.targetClass = p_i1665_2_; + this.targetChance = p_i1665_3_; + this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(p_i1665_1_); + this.setMutexBits(1); + this.targetEntitySelector = new IEntitySelector() + { + private static final String __OBFID = "CL_00001621"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false)); + } + }; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) + { + return false; + } + else + { + double d0 = this.getTargetDistance(); + List list = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(d0, 4.0D, d0), this.targetEntitySelector); + Collections.sort(list, this.theNearestAttackableTargetSorter); + + if (list.isEmpty()) + { + return false; + } + else + { + this.targetEntity = (EntityLivingBase)list.get(0); + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.targetEntity); + super.startExecuting(); + } + + public static class Sorter implements Comparator + { + private final Entity theEntity; + private static final String __OBFID = "CL_00001622"; + + public Sorter(Entity p_i1662_1_) + { + this.theEntity = p_i1662_1_; + } + + public int compare(Entity p_compare_1_, Entity p_compare_2_) + { + double d0 = this.theEntity.getDistanceSqToEntity(p_compare_1_); + double d1 = this.theEntity.getDistanceSqToEntity(p_compare_2_); + return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((Entity)p_compare_1_, (Entity)p_compare_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java new file mode 100644 index 0000000..e9293ee --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotAttack.java @@ -0,0 +1,88 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class EntityAIOcelotAttack extends EntityAIBase +{ + World theWorld; + EntityLiving theEntity; + EntityLivingBase theVictim; + int attackCountdown; + private static final String __OBFID = "CL_00001600"; + + public EntityAIOcelotAttack(EntityLiving p_i1641_1_) + { + this.theEntity = p_i1641_1_; + this.theWorld = p_i1641_1_.worldObj; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theVictim = entitylivingbase; + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.theVictim.isEntityAlive() ? false : (this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D ? false : !this.theEntity.getNavigator().noPath() || this.shouldExecute()); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theVictim = null; + this.theEntity.getNavigator().clearPathEntity(); + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); + double d0 = (double)(this.theEntity.width * 2.0F * this.theEntity.width * 2.0F); + double d1 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.boundingBox.minY, this.theVictim.posZ); + double d2 = 0.8D; + + if (d1 > d0 && d1 < 16.0D) + { + d2 = 1.33D; + } + else if (d1 < 225.0D) + { + d2 = 0.6D; + } + + this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, d2); + this.attackCountdown = Math.max(this.attackCountdown - 1, 0); + + if (d1 <= d0) + { + if (this.attackCountdown <= 0) + { + this.attackCountdown = 20; + this.theEntity.attackEntityAsMob(this.theVictim); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotSit.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotSit.java new file mode 100644 index 0000000..7e5d555 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOcelotSit.java @@ -0,0 +1,145 @@ +package net.minecraft.entity.ai; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; + +public class EntityAIOcelotSit extends EntityAIBase +{ + private final EntityOcelot field_151493_a; + private final double field_151491_b; + private int field_151492_c; + private int field_151489_d; + private int field_151490_e; + private int field_151487_f; + private int field_151488_g; + private int field_151494_h; + private static final String __OBFID = "CL_00001601"; + + public EntityAIOcelotSit(EntityOcelot p_i45315_1_, double p_i45315_2_) + { + this.field_151493_a = p_i45315_1_; + this.field_151491_b = p_i45315_2_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return this.field_151493_a.isTamed() && !this.field_151493_a.isSitting() && this.field_151493_a.getRNG().nextDouble() <= 0.006500000134110451D && this.func_151485_f(); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.field_151492_c <= this.field_151490_e && this.field_151489_d <= 60 && this.func_151486_a(this.field_151493_a.worldObj, this.field_151487_f, this.field_151488_g, this.field_151494_h); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.field_151493_a.getNavigator().tryMoveToXYZ((double)((float)this.field_151487_f) + 0.5D, (double)(this.field_151488_g + 1), (double)((float)this.field_151494_h) + 0.5D, this.field_151491_b); + this.field_151492_c = 0; + this.field_151489_d = 0; + this.field_151490_e = this.field_151493_a.getRNG().nextInt(this.field_151493_a.getRNG().nextInt(1200) + 1200) + 1200; + this.field_151493_a.func_70907_r().setSitting(false); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.field_151493_a.setSitting(false); + } + + /** + * Updates the task + */ + public void updateTask() + { + ++this.field_151492_c; + this.field_151493_a.func_70907_r().setSitting(false); + + if (this.field_151493_a.getDistanceSq((double)this.field_151487_f, (double)(this.field_151488_g + 1), (double)this.field_151494_h) > 1.0D) + { + this.field_151493_a.setSitting(false); + this.field_151493_a.getNavigator().tryMoveToXYZ((double)((float)this.field_151487_f) + 0.5D, (double)(this.field_151488_g + 1), (double)((float)this.field_151494_h) + 0.5D, this.field_151491_b); + ++this.field_151489_d; + } + else if (!this.field_151493_a.isSitting()) + { + this.field_151493_a.setSitting(true); + } + else + { + --this.field_151489_d; + } + } + + private boolean func_151485_f() + { + int i = (int)this.field_151493_a.posY; + double d0 = 2.147483647E9D; + + for (int j = (int)this.field_151493_a.posX - 8; (double)j < this.field_151493_a.posX + 8.0D; ++j) + { + for (int k = (int)this.field_151493_a.posZ - 8; (double)k < this.field_151493_a.posZ + 8.0D; ++k) + { + if (this.func_151486_a(this.field_151493_a.worldObj, j, i, k) && this.field_151493_a.worldObj.isAirBlock(j, i + 1, k)) + { + double d1 = this.field_151493_a.getDistanceSq((double)j, (double)i, (double)k); + + if (d1 < d0) + { + this.field_151487_f = j; + this.field_151488_g = i; + this.field_151494_h = k; + d0 = d1; + } + } + } + } + + return d0 < 2.147483647E9D; + } + + private boolean func_151486_a(World p_151486_1_, int p_151486_2_, int p_151486_3_, int p_151486_4_) + { + Block block = p_151486_1_.getBlock(p_151486_2_, p_151486_3_, p_151486_4_); + int l = p_151486_1_.getBlockMetadata(p_151486_2_, p_151486_3_, p_151486_4_); + + if (block == Blocks.chest) + { + TileEntityChest tileentitychest = (TileEntityChest)p_151486_1_.getTileEntity(p_151486_2_, p_151486_3_, p_151486_4_); + + if (tileentitychest.numPlayersUsing < 1) + { + return true; + } + } + else + { + if (block == Blocks.lit_furnace) + { + return true; + } + + if (block == Blocks.bed && !BlockBed.isBlockHeadOfBed(l)) + { + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOpenDoor.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOpenDoor.java new file mode 100644 index 0000000..73083a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOpenDoor.java @@ -0,0 +1,54 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAIOpenDoor extends EntityAIDoorInteract +{ + boolean field_75361_i; + int field_75360_j; + private static final String __OBFID = "CL_00001603"; + + public EntityAIOpenDoor(EntityLiving p_i1644_1_, boolean p_i1644_2_) + { + super(p_i1644_1_); + this.theEntity = p_i1644_1_; + this.field_75361_i = p_i1644_2_; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.field_75361_i && this.field_75360_j > 0 && super.continueExecuting(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.field_75360_j = 20; + this.field_151504_e.func_150014_a(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, true); + } + + /** + * Resets the task + */ + public void resetTask() + { + if (this.field_75361_i) + { + this.field_151504_e.func_150014_a(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, false); + } + } + + /** + * Updates the task + */ + public void updateTask() + { + --this.field_75360_j; + super.updateTask(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java new file mode 100644 index 0000000..e24152c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtByTarget.java @@ -0,0 +1,61 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtByTarget extends EntityAITarget +{ + EntityTameable theDefendingTameable; + EntityLivingBase theOwnerAttacker; + private int field_142051_e; + private static final String __OBFID = "CL_00001624"; + + public EntityAIOwnerHurtByTarget(EntityTameable p_i1667_1_) + { + super(p_i1667_1_, false); + this.theDefendingTameable = p_i1667_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theDefendingTameable.isTamed()) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theOwnerAttacker = entitylivingbase.getAITarget(); + int i = entitylivingbase.func_142015_aE(); + return i != this.field_142051_e && this.isSuitableTarget(this.theOwnerAttacker, false) && this.theDefendingTameable.func_142018_a(this.theOwnerAttacker, entitylivingbase); + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.theOwnerAttacker); + EntityLivingBase entitylivingbase = this.theDefendingTameable.getOwner(); + + if (entitylivingbase != null) + { + this.field_142051_e = entitylivingbase.func_142015_aE(); + } + + super.startExecuting(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java new file mode 100644 index 0000000..48d77d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIOwnerHurtTarget.java @@ -0,0 +1,61 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAIOwnerHurtTarget extends EntityAITarget +{ + EntityTameable theEntityTameable; + EntityLivingBase theTarget; + private int field_142050_e; + private static final String __OBFID = "CL_00001625"; + + public EntityAIOwnerHurtTarget(EntityTameable p_i1668_1_) + { + super(p_i1668_1_, false); + this.theEntityTameable = p_i1668_1_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theEntityTameable.isTamed()) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + + if (entitylivingbase == null) + { + return false; + } + else + { + this.theTarget = entitylivingbase.getLastAttacker(); + int i = entitylivingbase.getLastAttackerTime(); + return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.func_142018_a(this.theTarget, entitylivingbase); + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.taskOwner.setAttackTarget(this.theTarget); + EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner(); + + if (entitylivingbase != null) + { + this.field_142050_e = entitylivingbase.getLastAttackerTime(); + } + + super.startExecuting(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPanic.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPanic.java new file mode 100644 index 0000000..dd4cd50 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPanic.java @@ -0,0 +1,64 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIPanic extends EntityAIBase +{ + private EntityCreature theEntityCreature; + private double speed; + private double randPosX; + private double randPosY; + private double randPosZ; + private static final String __OBFID = "CL_00001604"; + + public EntityAIPanic(EntityCreature p_i1645_1_, double p_i1645_2_) + { + this.theEntityCreature = p_i1645_1_; + this.speed = p_i1645_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) + { + return false; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); + + if (vec3 == null) + { + return false; + } + else + { + this.randPosX = vec3.xCoord; + this.randPosY = vec3.yCoord; + this.randPosZ = vec3.zCoord; + return true; + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.theEntityCreature.getNavigator().noPath(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPlay.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPlay.java new file mode 100644 index 0000000..2030cd1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIPlay.java @@ -0,0 +1,129 @@ +package net.minecraft.entity.ai; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.Vec3; + +public class EntityAIPlay extends EntityAIBase +{ + private EntityVillager villagerObj; + private EntityLivingBase targetVillager; + private double field_75261_c; + private int playTime; + private static final String __OBFID = "CL_00001605"; + + public EntityAIPlay(EntityVillager p_i1646_1_, double p_i1646_2_) + { + this.villagerObj = p_i1646_1_; + this.field_75261_c = p_i1646_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.villagerObj.getGrowingAge() >= 0) + { + return false; + } + else if (this.villagerObj.getRNG().nextInt(400) != 0) + { + return false; + } + else + { + List list = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(6.0D, 3.0D, 6.0D)); + double d0 = Double.MAX_VALUE; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityVillager entityvillager = (EntityVillager)iterator.next(); + + if (entityvillager != this.villagerObj && !entityvillager.isPlaying() && entityvillager.getGrowingAge() < 0) + { + double d1 = entityvillager.getDistanceSqToEntity(this.villagerObj); + + if (d1 <= d0) + { + d0 = d1; + this.targetVillager = entityvillager; + } + } + } + + if (this.targetVillager == null) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + if (vec3 == null) + { + return false; + } + } + + return true; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.playTime > 0; + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + if (this.targetVillager != null) + { + this.villagerObj.setPlaying(true); + } + + this.playTime = 1000; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.villagerObj.setPlaying(false); + this.targetVillager = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + --this.playTime; + + if (this.targetVillager != null) + { + if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) + { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.field_75261_c); + } + } + else if (this.villagerObj.getNavigator().noPath()) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); + + if (vec3 == null) + { + return; + } + + this.villagerObj.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.field_75261_c); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java new file mode 100644 index 0000000..4743390 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictOpenDoor.java @@ -0,0 +1,78 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.village.VillageDoorInfo; + +public class EntityAIRestrictOpenDoor extends EntityAIBase +{ + private EntityCreature entityObj; + private VillageDoorInfo frontDoor; + private static final String __OBFID = "CL_00001610"; + + public EntityAIRestrictOpenDoor(EntityCreature p_i1651_1_) + { + this.entityObj = p_i1651_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.entityObj.worldObj.isDaytime()) + { + return false; + } + else + { + Village village = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 16); + + if (village == null) + { + return false; + } + else + { + this.frontDoor = village.findNearestDoor(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); + return this.frontDoor == null ? false : (double)this.frontDoor.getInsideDistanceSquare(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)) < 2.25D; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.entityObj.worldObj.isDaytime() ? false : !this.frontDoor.isDetachedFromVillageFlag && this.frontDoor.isInside(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posZ)); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.entityObj.getNavigator().setBreakDoors(false); + this.entityObj.getNavigator().setEnterDoors(false); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.entityObj.getNavigator().setBreakDoors(true); + this.entityObj.getNavigator().setEnterDoors(true); + this.frontDoor = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.frontDoor.incrementDoorOpeningRestrictionCounter(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictSun.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictSun.java new file mode 100644 index 0000000..ee69dbc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRestrictSun.java @@ -0,0 +1,38 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; + +public class EntityAIRestrictSun extends EntityAIBase +{ + private EntityCreature theEntity; + private static final String __OBFID = "CL_00001611"; + + public EntityAIRestrictSun(EntityCreature p_i1652_1_) + { + this.theEntity = p_i1652_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return this.theEntity.worldObj.isDaytime(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntity.getNavigator().setAvoidSun(true); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theEntity.getNavigator().setAvoidSun(false); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java new file mode 100644 index 0000000..8654b9f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIRunAroundLikeCrazy.java @@ -0,0 +1,95 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Vec3; + +public class EntityAIRunAroundLikeCrazy extends EntityAIBase +{ + private EntityHorse horseHost; + private double field_111178_b; + private double field_111179_c; + private double field_111176_d; + private double field_111177_e; + private static final String __OBFID = "CL_00001612"; + + public EntityAIRunAroundLikeCrazy(EntityHorse p_i1653_1_, double p_i1653_2_) + { + this.horseHost = p_i1653_1_; + this.field_111178_b = p_i1653_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); + + if (vec3 == null) + { + return false; + } + else + { + this.field_111179_c = vec3.xCoord; + this.field_111176_d = vec3.yCoord; + this.field_111177_e = vec3.zCoord; + return true; + } + } + else + { + return false; + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.horseHost.getNavigator().tryMoveToXYZ(this.field_111179_c, this.field_111176_d, this.field_111177_e, this.field_111178_b); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; + } + + /** + * Updates the task + */ + public void updateTask() + { + if (this.horseHost.getRNG().nextInt(50) == 0) + { + if (this.horseHost.riddenByEntity instanceof EntityPlayer) + { + int i = this.horseHost.getTemper(); + int j = this.horseHost.getMaxTemper(); + + if (j > 0 && this.horseHost.getRNG().nextInt(j) < i) + { + this.horseHost.setTamedBy((EntityPlayer)this.horseHost.riddenByEntity); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)7); + return; + } + + this.horseHost.increaseTemper(5); + } + + this.horseHost.riddenByEntity.mountEntity((Entity)null); + this.horseHost.riddenByEntity = null; + this.horseHost.makeHorseRearWithSound(); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)6); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISit.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISit.java new file mode 100644 index 0000000..a92b12e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISit.java @@ -0,0 +1,67 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAISit extends EntityAIBase +{ + private EntityTameable theEntity; + /** If the EntityTameable is sitting. */ + private boolean isSitting; + private static final String __OBFID = "CL_00001613"; + + public EntityAISit(EntityTameable p_i1654_1_) + { + this.theEntity = p_i1654_1_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.theEntity.isTamed()) + { + return false; + } + else if (this.theEntity.isInWater()) + { + return false; + } + else if (!this.theEntity.onGround) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.theEntity.getOwner(); + return entitylivingbase == null ? true : (this.theEntity.getDistanceSqToEntity(entitylivingbase) < 144.0D && entitylivingbase.getAITarget() != null ? false : this.isSitting); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.setSitting(true); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.theEntity.setSitting(false); + } + + /** + * Sets the sitting flag. + */ + public void setSitting(boolean p_75270_1_) + { + this.isSitting = p_75270_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISwimming.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISwimming.java new file mode 100644 index 0000000..63b23c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAISwimming.java @@ -0,0 +1,35 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAISwimming extends EntityAIBase +{ + private EntityLiving theEntity; + private static final String __OBFID = "CL_00001584"; + + public EntityAISwimming(EntityLiving p_i1624_1_) + { + this.theEntity = p_i1624_1_; + this.setMutexBits(4); + p_i1624_1_.getNavigator().setCanSwim(true); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + + /** + * Updates the task + */ + public void updateTask() + { + if (this.theEntity.getRNG().nextFloat() < 0.8F) + { + this.theEntity.getJumpHelper().setJumping(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITarget.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITarget.java new file mode 100644 index 0000000..9061b22 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITarget.java @@ -0,0 +1,209 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathPoint; +import net.minecraft.util.MathHelper; +import org.apache.commons.lang3.StringUtils; + +public abstract class EntityAITarget extends EntityAIBase +{ + /** The entity that this task belongs to */ + protected EntityCreature taskOwner; + /** If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. */ + protected boolean shouldCheckSight; + /** When true, only entities that can be reached with minimal effort will be targetted. */ + private boolean nearbyOnly; + /** When nearbyOnly is true: 0 -> No target, but OK to search; 1 -> Nearby target found; 2 -> Target too far. */ + private int targetSearchStatus; + /** When nearbyOnly is true, this throttles target searching to avoid excessive pathfinding. */ + private int targetSearchDelay; + private int field_75298_g; + private static final String __OBFID = "CL_00001626"; + + public EntityAITarget(EntityCreature p_i1669_1_, boolean p_i1669_2_) + { + this(p_i1669_1_, p_i1669_2_, false); + } + + public EntityAITarget(EntityCreature p_i1670_1_, boolean p_i1670_2_, boolean p_i1670_3_) + { + this.taskOwner = p_i1670_1_; + this.shouldCheckSight = p_i1670_2_; + this.nearbyOnly = p_i1670_3_; + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget(); + + if (entitylivingbase == null) + { + return false; + } + else if (!entitylivingbase.isEntityAlive()) + { + return false; + } + else + { + double d0 = this.getTargetDistance(); + + if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0) + { + return false; + } + else + { + if (this.shouldCheckSight) + { + if (this.taskOwner.getEntitySenses().canSee(entitylivingbase)) + { + this.field_75298_g = 0; + } + else if (++this.field_75298_g > 60) + { + return false; + } + } + + return !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative(); + } + } + } + + protected double getTargetDistance() + { + IAttributeInstance iattributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); + return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.targetSearchStatus = 0; + this.targetSearchDelay = 0; + this.field_75298_g = 0; + } + + /** + * Resets the task + */ + public void resetTask() + { + this.taskOwner.setAttackTarget((EntityLivingBase)null); + } + + /** + * A method used to see if an entity is a suitable target through a number of checks. + */ + protected boolean isSuitableTarget(EntityLivingBase p_75296_1_, boolean p_75296_2_) + { + if (p_75296_1_ == null) + { + return false; + } + else if (p_75296_1_ == this.taskOwner) + { + return false; + } + else if (!p_75296_1_.isEntityAlive()) + { + return false; + } + else if (!this.taskOwner.canAttackClass(p_75296_1_.getClass())) + { + return false; + } + else + { + if (this.taskOwner instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)this.taskOwner).func_152113_b())) + { + if (p_75296_1_ instanceof IEntityOwnable && ((IEntityOwnable)this.taskOwner).func_152113_b().equals(((IEntityOwnable)p_75296_1_).func_152113_b())) + { + return false; + } + + if (p_75296_1_ == ((IEntityOwnable)this.taskOwner).getOwner()) + { + return false; + } + } + else if (p_75296_1_ instanceof EntityPlayer && !p_75296_2_ && ((EntityPlayer)p_75296_1_).capabilities.disableDamage) + { + return false; + } + + if (!this.taskOwner.isWithinHomeDistance(MathHelper.floor_double(p_75296_1_.posX), MathHelper.floor_double(p_75296_1_.posY), MathHelper.floor_double(p_75296_1_.posZ))) + { + return false; + } + else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(p_75296_1_)) + { + return false; + } + else + { + if (this.nearbyOnly) + { + if (--this.targetSearchDelay <= 0) + { + this.targetSearchStatus = 0; + } + + if (this.targetSearchStatus == 0) + { + this.targetSearchStatus = this.canEasilyReach(p_75296_1_) ? 1 : 2; + } + + if (this.targetSearchStatus == 2) + { + return false; + } + } + + return true; + } + } + } + + /** + * Checks to see if this entity can find a short path to the given target. + */ + private boolean canEasilyReach(EntityLivingBase p_75295_1_) + { + this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); + PathEntity pathentity = this.taskOwner.getNavigator().getPathToEntityLiving(p_75295_1_); + + if (pathentity == null) + { + return false; + } + else + { + PathPoint pathpoint = pathentity.getFinalPathPoint(); + + if (pathpoint == null) + { + return false; + } + else + { + int i = pathpoint.xCoord - MathHelper.floor_double(p_75295_1_.posX); + int j = pathpoint.zCoord - MathHelper.floor_double(p_75295_1_.posZ); + return (double)(i * i + j * j) <= 2.25D; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java new file mode 100644 index 0000000..c60035a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITargetNonTamed.java @@ -0,0 +1,23 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityTameable; + +public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget +{ + private EntityTameable theTameable; + private static final String __OBFID = "CL_00001623"; + + public EntityAITargetNonTamed(EntityTameable p_i1666_1_, Class p_i1666_2_, int p_i1666_3_, boolean p_i1666_4_) + { + super(p_i1666_1_, p_i1666_2_, p_i1666_3_, p_i1666_4_); + this.theTameable = p_i1666_1_; + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + return !this.theTameable.isTamed() && super.shouldExecute(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITasks.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITasks.java new file mode 100644 index 0000000..79907af --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITasks.java @@ -0,0 +1,199 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.profiler.Profiler; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityAITasks +{ + private static final Logger logger = LogManager.getLogger(); + /** A list of EntityAITaskEntrys in EntityAITasks. */ + public List taskEntries = new ArrayList(); + /** A list of EntityAITaskEntrys that are currently being executed. */ + private List executingTaskEntries = new ArrayList(); + /** Instance of Profiler. */ + private final Profiler theProfiler; + private int tickCount; + private int tickRate = 3; + private static final String __OBFID = "CL_00001588"; + + public EntityAITasks(Profiler p_i1628_1_) + { + this.theProfiler = p_i1628_1_; + } + + public void addTask(int p_75776_1_, EntityAIBase p_75776_2_) + { + this.taskEntries.add(new EntityAITasks.EntityAITaskEntry(p_75776_1_, p_75776_2_)); + } + + /** + * removes the indicated task from the entity's AI tasks. + */ + public void removeTask(EntityAIBase p_85156_1_) + { + Iterator iterator = this.taskEntries.iterator(); + + while (iterator.hasNext()) + { + EntityAITasks.EntityAITaskEntry entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + EntityAIBase entityaibase1 = entityaitaskentry.action; + + if (entityaibase1 == p_85156_1_) + { + if (this.executingTaskEntries.contains(entityaitaskentry)) + { + entityaibase1.resetTask(); + this.executingTaskEntries.remove(entityaitaskentry); + } + + iterator.remove(); + } + } + } + + public void onUpdateTasks() + { + ArrayList arraylist = new ArrayList(); + Iterator iterator; + EntityAITasks.EntityAITaskEntry entityaitaskentry; + + if (this.tickCount++ % this.tickRate == 0) + { + iterator = this.taskEntries.iterator(); + + while (iterator.hasNext()) + { + entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + boolean flag = this.executingTaskEntries.contains(entityaitaskentry); + + if (flag) + { + if (this.canUse(entityaitaskentry) && this.canContinue(entityaitaskentry)) + { + continue; + } + + entityaitaskentry.action.resetTask(); + this.executingTaskEntries.remove(entityaitaskentry); + } + + if (this.canUse(entityaitaskentry) && entityaitaskentry.action.shouldExecute()) + { + arraylist.add(entityaitaskentry); + this.executingTaskEntries.add(entityaitaskentry); + } + } + } + else + { + iterator = this.executingTaskEntries.iterator(); + + while (iterator.hasNext()) + { + entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + + if (!entityaitaskentry.action.continueExecuting()) + { + entityaitaskentry.action.resetTask(); + iterator.remove(); + } + } + } + + this.theProfiler.startSection("goalStart"); + iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + this.theProfiler.startSection(entityaitaskentry.action.getClass().getSimpleName()); + entityaitaskentry.action.startExecuting(); + this.theProfiler.endSection(); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("goalTick"); + iterator = this.executingTaskEntries.iterator(); + + while (iterator.hasNext()) + { + entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + entityaitaskentry.action.updateTask(); + } + + this.theProfiler.endSection(); + } + + /** + * Determine if a specific AI Task should continue being executed. + */ + private boolean canContinue(EntityAITasks.EntityAITaskEntry p_75773_1_) + { + this.theProfiler.startSection("canContinue"); + boolean flag = p_75773_1_.action.continueExecuting(); + this.theProfiler.endSection(); + return flag; + } + + /** + * Determine if a specific AI Task can be executed, which means that all running higher (= lower int value) priority + * tasks are compatible with it or all lower priority tasks can be interrupted. + */ + private boolean canUse(EntityAITasks.EntityAITaskEntry p_75775_1_) + { + this.theProfiler.startSection("canUse"); + Iterator iterator = this.taskEntries.iterator(); + + while (iterator.hasNext()) + { + EntityAITasks.EntityAITaskEntry entityaitaskentry = (EntityAITasks.EntityAITaskEntry)iterator.next(); + + if (entityaitaskentry != p_75775_1_) + { + if (p_75775_1_.priority >= entityaitaskentry.priority) + { + if (this.executingTaskEntries.contains(entityaitaskentry) && !this.areTasksCompatible(p_75775_1_, entityaitaskentry)) + { + this.theProfiler.endSection(); + return false; + } + } + else if (this.executingTaskEntries.contains(entityaitaskentry) && !entityaitaskentry.action.isInterruptible()) + { + this.theProfiler.endSection(); + return false; + } + } + } + + this.theProfiler.endSection(); + return true; + } + + /** + * Returns whether two EntityAITaskEntries can be executed concurrently + */ + private boolean areTasksCompatible(EntityAITasks.EntityAITaskEntry p_75777_1_, EntityAITasks.EntityAITaskEntry p_75777_2_) + { + return (p_75777_1_.action.getMutexBits() & p_75777_2_.action.getMutexBits()) == 0; + } + + public class EntityAITaskEntry + { + /** The EntityAIBase object. */ + public EntityAIBase action; + /** Priority of the EntityAIBase */ + public int priority; + private static final String __OBFID = "CL_00001589"; + + public EntityAITaskEntry(int p_i1627_2_, EntityAIBase p_i1627_3_) + { + this.priority = p_i1627_2_; + this.action = p_i1627_3_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITempt.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITempt.java new file mode 100644 index 0000000..a351374 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITempt.java @@ -0,0 +1,153 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class EntityAITempt extends EntityAIBase +{ + /** The entity using this AI that is tempted by the player. */ + private EntityCreature temptedEntity; + private double field_75282_b; + /** X position of player tempting this mob */ + private double targetX; + /** Y position of player tempting this mob */ + private double targetY; + /** Z position of player tempting this mob */ + private double targetZ; + private double field_75278_f; + private double field_75279_g; + /** The player that is tempting the entity that is using this AI. */ + private EntityPlayer temptingPlayer; + /** + * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always + * return false if delayTemptCounter is greater than 0. + */ + private int delayTemptCounter; + /** True if this EntityAITempt task is running */ + private boolean isRunning; + private Item field_151484_k; + /** Whether the entity using this AI will be scared by the tempter's sudden movement. */ + private boolean scaredByPlayerMovement; + private boolean field_75286_m; + private static final String __OBFID = "CL_00001616"; + + public EntityAITempt(EntityCreature p_i45316_1_, double p_i45316_2_, Item p_i45316_4_, boolean p_i45316_5_) + { + this.temptedEntity = p_i45316_1_; + this.field_75282_b = p_i45316_2_; + this.field_151484_k = p_i45316_4_; + this.scaredByPlayerMovement = p_i45316_5_; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.delayTemptCounter > 0) + { + --this.delayTemptCounter; + return false; + } + else + { + this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); + + if (this.temptingPlayer == null) + { + return false; + } + else + { + ItemStack itemstack = this.temptingPlayer.getCurrentEquippedItem(); + return itemstack == null ? false : itemstack.getItem() == this.field_151484_k; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + if (this.scaredByPlayerMovement) + { + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) + { + if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) + { + return false; + } + + if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) + { + return false; + } + } + else + { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + } + + this.field_75278_f = (double)this.temptingPlayer.rotationPitch; + this.field_75279_g = (double)this.temptingPlayer.rotationYaw; + } + + return this.shouldExecute(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; + this.targetZ = this.temptingPlayer.posZ; + this.isRunning = true; + this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); + this.temptedEntity.getNavigator().setAvoidsWater(false); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.temptingPlayer = null; + this.temptedEntity.getNavigator().clearPathEntity(); + this.delayTemptCounter = 100; + this.isRunning = false; + this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); + } + + /** + * Updates the task + */ + public void updateTask() + { + this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); + + if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) + { + this.temptedEntity.getNavigator().clearPathEntity(); + } + else + { + this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.field_75282_b); + } + } + + /** + * @see #isRunning + */ + public boolean isRunning() + { + return this.isRunning; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITradePlayer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITradePlayer.java new file mode 100644 index 0000000..b2e40f4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAITradePlayer.java @@ -0,0 +1,61 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + +public class EntityAITradePlayer extends EntityAIBase +{ + private EntityVillager villager; + private static final String __OBFID = "CL_00001617"; + + public EntityAITradePlayer(EntityVillager p_i1658_1_) + { + this.villager = p_i1658_1_; + this.setMutexBits(5); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (!this.villager.isEntityAlive()) + { + return false; + } + else if (this.villager.isInWater()) + { + return false; + } + else if (!this.villager.onGround) + { + return false; + } + else if (this.villager.velocityChanged) + { + return false; + } + else + { + EntityPlayer entityplayer = this.villager.getCustomer(); + return entityplayer == null ? false : (this.villager.getDistanceSqToEntity(entityplayer) > 16.0D ? false : entityplayer.openContainer instanceof Container); + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.villager.getNavigator().clearPathEntity(); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.villager.setCustomer((EntityPlayer)null); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIVillagerMate.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIVillagerMate.java new file mode 100644 index 0000000..e253832 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIVillagerMate.java @@ -0,0 +1,140 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityAIVillagerMate extends EntityAIBase +{ + private EntityVillager villagerObj; + private EntityVillager mate; + private World worldObj; + private int matingTimeout; + Village villageObj; + private static final String __OBFID = "CL_00001594"; + + public EntityAIVillagerMate(EntityVillager p_i1634_1_) + { + this.villagerObj = p_i1634_1_; + this.worldObj = p_i1634_1_.worldObj; + this.setMutexBits(3); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.villagerObj.getGrowingAge() != 0) + { + return false; + } + else if (this.villagerObj.getRNG().nextInt(500) != 0) + { + return false; + } + else + { + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.villagerObj.posX), MathHelper.floor_double(this.villagerObj.posY), MathHelper.floor_double(this.villagerObj.posZ), 0); + + if (this.villageObj == null) + { + return false; + } + else if (!this.checkSufficientDoorsPresentForNewVillager()) + { + return false; + } + else + { + Entity entity = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(8.0D, 3.0D, 8.0D), this.villagerObj); + + if (entity == null) + { + return false; + } + else + { + this.mate = (EntityVillager)entity; + return this.mate.getGrowingAge() == 0; + } + } + } + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.matingTimeout = 300; + this.villagerObj.setMating(true); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.villageObj = null; + this.mate = null; + this.villagerObj.setMating(false); + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0; + } + + /** + * Updates the task + */ + public void updateTask() + { + --this.matingTimeout; + this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); + + if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) + { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); + } + else if (this.matingTimeout == 0 && this.mate.isMating()) + { + this.giveBirth(); + } + + if (this.villagerObj.getRNG().nextInt(35) == 0) + { + this.worldObj.setEntityState(this.villagerObj, (byte)12); + } + } + + private boolean checkSufficientDoorsPresentForNewVillager() + { + if (!this.villageObj.isMatingSeason()) + { + return false; + } + else + { + int i = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D); + return this.villageObj.getNumVillagers() < i; + } + } + + private void giveBirth() + { + EntityVillager entityvillager = this.villagerObj.createChild(this.mate); + this.mate.setGrowingAge(6000); + this.villagerObj.setGrowingAge(6000); + entityvillager.setGrowingAge(-24000); + entityvillager.setLocationAndAngles(this.villagerObj.posX, this.villagerObj.posY, this.villagerObj.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityvillager); + this.worldObj.setEntityState(entityvillager, (byte)12); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWander.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWander.java new file mode 100644 index 0000000..194e300 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWander.java @@ -0,0 +1,68 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.Vec3; + +public class EntityAIWander extends EntityAIBase +{ + private EntityCreature entity; + private double xPosition; + private double yPosition; + private double zPosition; + private double speed; + private static final String __OBFID = "CL_00001608"; + + public EntityAIWander(EntityCreature p_i1648_1_, double p_i1648_2_) + { + this.entity = p_i1648_1_; + this.speed = p_i1648_2_; + this.setMutexBits(1); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.entity.getAge() >= 100) + { + return false; + } + else if (this.entity.getRNG().nextInt(120) != 0) + { + return false; + } + else + { + Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); + + if (vec3 == null) + { + return false; + } + else + { + this.xPosition = vec3.xCoord; + this.yPosition = vec3.yCoord; + this.zPosition = vec3.zCoord; + return true; + } + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.entity.getNavigator().noPath(); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest.java new file mode 100644 index 0000000..aa6aa26 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest.java @@ -0,0 +1,98 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; + +public class EntityAIWatchClosest extends EntityAIBase +{ + private EntityLiving theWatcher; + /** The closest entity which is being watched by this one. */ + protected Entity closestEntity; + /** This is the Maximum distance that the AI will look for the Entity */ + private float maxDistanceForPlayer; + private int lookTime; + private float field_75331_e; + private Class watchedClass; + private static final String __OBFID = "CL_00001592"; + + public EntityAIWatchClosest(EntityLiving p_i1631_1_, Class p_i1631_2_, float p_i1631_3_) + { + this.theWatcher = p_i1631_1_; + this.watchedClass = p_i1631_2_; + this.maxDistanceForPlayer = p_i1631_3_; + this.field_75331_e = 0.02F; + this.setMutexBits(2); + } + + public EntityAIWatchClosest(EntityLiving p_i1632_1_, Class p_i1632_2_, float p_i1632_3_, float p_i1632_4_) + { + this.theWatcher = p_i1632_1_; + this.watchedClass = p_i1632_2_; + this.maxDistanceForPlayer = p_i1632_3_; + this.field_75331_e = p_i1632_4_; + this.setMutexBits(2); + } + + /** + * Returns whether the EntityAIBase should begin execution. + */ + public boolean shouldExecute() + { + if (this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) + { + return false; + } + else + { + if (this.theWatcher.getAttackTarget() != null) + { + this.closestEntity = this.theWatcher.getAttackTarget(); + } + + if (this.watchedClass == EntityPlayer.class) + { + this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, (double)this.maxDistanceForPlayer); + } + else + { + this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.boundingBox.expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); + } + + return this.closestEntity != null; + } + } + + /** + * Returns whether an in-progress EntityAIBase should continue executing + */ + public boolean continueExecuting() + { + return !this.closestEntity.isEntityAlive() ? false : (this.theWatcher.getDistanceSqToEntity(this.closestEntity) > (double)(this.maxDistanceForPlayer * this.maxDistanceForPlayer) ? false : this.lookTime > 0); + } + + /** + * Execute a one shot task or start executing a continuous task + */ + public void startExecuting() + { + this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); + } + + /** + * Resets the task + */ + public void resetTask() + { + this.closestEntity = null; + } + + /** + * Updates the task + */ + public void updateTask() + { + this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); + --this.lookTime; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java new file mode 100644 index 0000000..d7ed880 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityAIWatchClosest2.java @@ -0,0 +1,14 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityAIWatchClosest2 extends EntityAIWatchClosest +{ + private static final String __OBFID = "CL_00001590"; + + public EntityAIWatchClosest2(EntityLiving p_i1629_1_, Class p_i1629_2_, float p_i1629_3_, float p_i1629_4_) + { + super(p_i1629_1_, p_i1629_2_, p_i1629_3_, p_i1629_4_); + this.setMutexBits(3); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityJumpHelper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityJumpHelper.java new file mode 100644 index 0000000..17f1784 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityJumpHelper.java @@ -0,0 +1,29 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; + +public class EntityJumpHelper +{ + private EntityLiving entity; + private boolean isJumping; + private static final String __OBFID = "CL_00001571"; + + public EntityJumpHelper(EntityLiving p_i1612_1_) + { + this.entity = p_i1612_1_; + } + + public void setJumping() + { + this.isJumping = true; + } + + /** + * Called to actually make the entity jump if isJumping is true. + */ + public void doJump() + { + this.entity.setJumping(this.isJumping); + this.isJumping = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityLookHelper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityLookHelper.java new file mode 100644 index 0000000..827b4b4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityLookHelper.java @@ -0,0 +1,118 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +public class EntityLookHelper +{ + private EntityLiving entity; + /** The amount of change that is made each update for an entity facing a direction. */ + private float deltaLookYaw; + /** The amount of change that is made each update for an entity facing a direction. */ + private float deltaLookPitch; + /** Whether or not the entity is trying to look at something. */ + private boolean isLooking; + private double posX; + private double posY; + private double posZ; + private static final String __OBFID = "CL_00001572"; + + public EntityLookHelper(EntityLiving p_i1613_1_) + { + this.entity = p_i1613_1_; + } + + /** + * Sets position to look at using entity + */ + public void setLookPositionWithEntity(Entity p_75651_1_, float p_75651_2_, float p_75651_3_) + { + this.posX = p_75651_1_.posX; + + if (p_75651_1_ instanceof EntityLivingBase) + { + this.posY = p_75651_1_.posY + (double)p_75651_1_.getEyeHeight(); + } + else + { + this.posY = (p_75651_1_.boundingBox.minY + p_75651_1_.boundingBox.maxY) / 2.0D; + } + + this.posZ = p_75651_1_.posZ; + this.deltaLookYaw = p_75651_2_; + this.deltaLookPitch = p_75651_3_; + this.isLooking = true; + } + + /** + * Sets position to look at + */ + public void setLookPosition(double p_75650_1_, double p_75650_3_, double p_75650_5_, float p_75650_7_, float p_75650_8_) + { + this.posX = p_75650_1_; + this.posY = p_75650_3_; + this.posZ = p_75650_5_; + this.deltaLookYaw = p_75650_7_; + this.deltaLookPitch = p_75650_8_; + this.isLooking = true; + } + + /** + * Updates look + */ + public void onUpdateLook() + { + this.entity.rotationPitch = 0.0F; + + if (this.isLooking) + { + this.isLooking = false; + double d0 = this.posX - this.entity.posX; + double d1 = this.posY - (this.entity.posY + (double)this.entity.getEyeHeight()); + double d2 = this.posZ - this.entity.posZ; + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); + float f = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, f1, this.deltaLookPitch); + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, f, this.deltaLookYaw); + } + else + { + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, this.entity.renderYawOffset, 10.0F); + } + + float f2 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); + + if (!this.entity.getNavigator().noPath()) + { + if (f2 < -75.0F) + { + this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; + } + + if (f2 > 75.0F) + { + this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; + } + } + } + + private float updateRotation(float p_75652_1_, float p_75652_2_, float p_75652_3_) + { + float f3 = MathHelper.wrapAngleTo180_float(p_75652_2_ - p_75652_1_); + + if (f3 > p_75652_3_) + { + f3 = p_75652_3_; + } + + if (f3 < -p_75652_3_) + { + f3 = -p_75652_3_; + } + + return p_75652_1_ + f3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java new file mode 100644 index 0000000..911aa7d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMinecartMobSpawner.java @@ -0,0 +1,100 @@ +package net.minecraft.entity.ai; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.MobSpawnerBaseLogic; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartMobSpawner extends EntityMinecart +{ + /** Mob spawner logic for this spawner minecart. */ + private final MobSpawnerBaseLogic mobSpawnerLogic = new MobSpawnerBaseLogic() + { + private static final String __OBFID = "CL_00001679"; + public void func_98267_a(int p_98267_1_) + { + EntityMinecartMobSpawner.this.worldObj.setEntityState(EntityMinecartMobSpawner.this, (byte)p_98267_1_); + } + public World getSpawnerWorld() + { + return EntityMinecartMobSpawner.this.worldObj; + } + public int getSpawnerX() + { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posX); + } + public int getSpawnerY() + { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posY); + } + public int getSpawnerZ() + { + return MathHelper.floor_double(EntityMinecartMobSpawner.this.posZ); + } + }; + private static final String __OBFID = "CL_00001678"; + + public EntityMinecartMobSpawner(World p_i1725_1_) + { + super(p_i1725_1_); + } + + public EntityMinecartMobSpawner(World p_i1726_1_, double p_i1726_2_, double p_i1726_4_, double p_i1726_6_) + { + super(p_i1726_1_, p_i1726_2_, p_i1726_4_, p_i1726_6_); + } + + public int getMinecartType() + { + return 4; + } + + public Block func_145817_o() + { + return Blocks.mob_spawner; + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.mobSpawnerLogic.readFromNBT(tagCompund); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + this.mobSpawnerLogic.writeToNBT(tagCompound); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + this.mobSpawnerLogic.setDelayToMin(p_70103_1_); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); + } + + @SideOnly(Side.CLIENT) + public MobSpawnerBaseLogic func_98039_d() + { + return this.mobSpawnerLogic; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMoveHelper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMoveHelper.java new file mode 100644 index 0000000..5053856 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntityMoveHelper.java @@ -0,0 +1,95 @@ +package net.minecraft.entity.ai; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.MathHelper; + +public class EntityMoveHelper +{ + /** The EntityLiving that is being moved */ + private EntityLiving entity; + private double posX; + private double posY; + private double posZ; + /** The speed at which the entity should move */ + private double speed; + private boolean update; + private static final String __OBFID = "CL_00001573"; + + public EntityMoveHelper(EntityLiving p_i1614_1_) + { + this.entity = p_i1614_1_; + this.posX = p_i1614_1_.posX; + this.posY = p_i1614_1_.posY; + this.posZ = p_i1614_1_.posZ; + } + + public boolean isUpdating() + { + return this.update; + } + + public double getSpeed() + { + return this.speed; + } + + /** + * Sets the speed and location to move to + */ + public void setMoveTo(double p_75642_1_, double p_75642_3_, double p_75642_5_, double p_75642_7_) + { + this.posX = p_75642_1_; + this.posY = p_75642_3_; + this.posZ = p_75642_5_; + this.speed = p_75642_7_; + this.update = true; + } + + public void onUpdateMoveHelper() + { + this.entity.setMoveForward(0.0F); + + if (this.update) + { + this.update = false; + int i = MathHelper.floor_double(this.entity.boundingBox.minY + 0.5D); + double d0 = this.posX - this.entity.posX; + double d1 = this.posZ - this.entity.posZ; + double d2 = this.posY - (double)i; + double d3 = d0 * d0 + d2 * d2 + d1 * d1; + + if (d3 >= 2.500000277905201E-7D) + { + float f = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F; + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, f, 30.0F); + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); + + if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) + { + this.entity.getJumpHelper().setJumping(); + } + } + } + } + + /** + * Limits the given angle to a upper and lower limit. + */ + private float limitAngle(float p_75639_1_, float p_75639_2_, float p_75639_3_) + { + float f3 = MathHelper.wrapAngleTo180_float(p_75639_2_ - p_75639_1_); + + if (f3 > p_75639_3_) + { + f3 = p_75639_3_; + } + + if (f3 < -p_75639_3_) + { + f3 = -p_75639_3_; + } + + return p_75639_1_ + f3; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntitySenses.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntitySenses.java new file mode 100644 index 0000000..1bd8d00 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/EntitySenses.java @@ -0,0 +1,62 @@ +package net.minecraft.entity.ai; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; + +public class EntitySenses +{ + EntityLiving entityObj; + /** Cache of entities which we can see */ + List seenEntities = new ArrayList(); + /** Cache of entities which we cannot see */ + List unseenEntities = new ArrayList(); + private static final String __OBFID = "CL_00001628"; + + public EntitySenses(EntityLiving p_i1672_1_) + { + this.entityObj = p_i1672_1_; + } + + /** + * Clears canSeeCachePositive and canSeeCacheNegative. + */ + public void clearSensingCache() + { + this.seenEntities.clear(); + this.unseenEntities.clear(); + } + + /** + * Checks, whether 'our' entity can see the entity given as argument (true) or not (false), caching the result. + */ + public boolean canSee(Entity p_75522_1_) + { + if (this.seenEntities.contains(p_75522_1_)) + { + return true; + } + else if (this.unseenEntities.contains(p_75522_1_)) + { + return false; + } + else + { + this.entityObj.worldObj.theProfiler.startSection("canSee"); + boolean flag = this.entityObj.canEntityBeSeen(p_75522_1_); + this.entityObj.worldObj.theProfiler.endSection(); + + if (flag) + { + this.seenEntities.add(p_75522_1_); + } + else + { + this.unseenEntities.add(p_75522_1_); + } + + return flag; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/RandomPositionGenerator.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/RandomPositionGenerator.java new file mode 100644 index 0000000..fc79729 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/RandomPositionGenerator.java @@ -0,0 +1,109 @@ +package net.minecraft.entity.ai; + +import java.util.Random; +import net.minecraft.entity.EntityCreature; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class RandomPositionGenerator +{ + /** + * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. + * MULTIPLE findTowards and findAway calls, will share this var + */ + private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + private static final String __OBFID = "CL_00001629"; + + /** + * finds a random target within par1(x,z) and par2 (y) blocks + */ + public static Vec3 findRandomTarget(EntityCreature p_75463_0_, int p_75463_1_, int p_75463_2_) + { + return findRandomTargetBlock(p_75463_0_, p_75463_1_, p_75463_2_, (Vec3)null); + } + + /** + * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 + */ + public static Vec3 findRandomTargetBlockTowards(EntityCreature p_75464_0_, int p_75464_1_, int p_75464_2_, Vec3 p_75464_3_) + { + staticVector.xCoord = p_75464_3_.xCoord - p_75464_0_.posX; + staticVector.yCoord = p_75464_3_.yCoord - p_75464_0_.posY; + staticVector.zCoord = p_75464_3_.zCoord - p_75464_0_.posZ; + return findRandomTargetBlock(p_75464_0_, p_75464_1_, p_75464_2_, staticVector); + } + + /** + * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 + */ + public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature p_75461_0_, int p_75461_1_, int p_75461_2_, Vec3 p_75461_3_) + { + staticVector.xCoord = p_75461_0_.posX - p_75461_3_.xCoord; + staticVector.yCoord = p_75461_0_.posY - p_75461_3_.yCoord; + staticVector.zCoord = p_75461_0_.posZ - p_75461_3_.zCoord; + return findRandomTargetBlock(p_75461_0_, p_75461_1_, p_75461_2_, staticVector); + } + + /** + * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of + * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number + */ + private static Vec3 findRandomTargetBlock(EntityCreature p_75462_0_, int p_75462_1_, int p_75462_2_, Vec3 p_75462_3_) + { + Random random = p_75462_0_.getRNG(); + boolean flag = false; + int k = 0; + int l = 0; + int i1 = 0; + float f = -99999.0F; + boolean flag1; + + if (p_75462_0_.hasHome()) + { + double d0 = (double)(p_75462_0_.getHomePosition().getDistanceSquared(MathHelper.floor_double(p_75462_0_.posX), MathHelper.floor_double(p_75462_0_.posY), MathHelper.floor_double(p_75462_0_.posZ)) + 4.0F); + double d1 = (double)(p_75462_0_.func_110174_bM() + (float)p_75462_1_); + flag1 = d0 < d1 * d1; + } + else + { + flag1 = false; + } + + for (int l1 = 0; l1 < 10; ++l1) + { + int j1 = random.nextInt(2 * p_75462_1_) - p_75462_1_; + int i2 = random.nextInt(2 * p_75462_2_) - p_75462_2_; + int k1 = random.nextInt(2 * p_75462_1_) - p_75462_1_; + + if (p_75462_3_ == null || (double)j1 * p_75462_3_.xCoord + (double)k1 * p_75462_3_.zCoord >= 0.0D) + { + j1 += MathHelper.floor_double(p_75462_0_.posX); + i2 += MathHelper.floor_double(p_75462_0_.posY); + k1 += MathHelper.floor_double(p_75462_0_.posZ); + + if (!flag1 || p_75462_0_.isWithinHomeDistance(j1, i2, k1)) + { + float f1 = p_75462_0_.getBlockPathWeight(j1, i2, k1); + + if (f1 > f) + { + f = f1; + k = j1; + l = i2; + i1 = k1; + flag = true; + } + } + } + } + + if (flag) + { + return Vec3.createVectorHelper((double)k, (double)l, (double)i1); + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/AttributeModifier.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/AttributeModifier.java new file mode 100644 index 0000000..ae08b42 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/AttributeModifier.java @@ -0,0 +1,108 @@ +package net.minecraft.entity.ai.attributes; + +import java.util.UUID; +import org.apache.commons.lang3.Validate; + +public class AttributeModifier +{ + private final double amount; + private final int operation; + private final String name; + private final UUID id; + /** If false, this modifier is not saved in NBT. Used for "natural" modifiers like speed boost from sprinting */ + private boolean isSaved; + private static final String __OBFID = "CL_00001564"; + + public AttributeModifier(String p_i1605_1_, double p_i1605_2_, int p_i1605_4_) + { + this(UUID.randomUUID(), p_i1605_1_, p_i1605_2_, p_i1605_4_); + } + + public AttributeModifier(UUID p_i1606_1_, String p_i1606_2_, double p_i1606_3_, int p_i1606_5_) + { + this.isSaved = true; + this.id = p_i1606_1_; + this.name = p_i1606_2_; + this.amount = p_i1606_3_; + this.operation = p_i1606_5_; + Validate.notEmpty(p_i1606_2_, "Modifier name cannot be empty", new Object[0]); + Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(p_i1606_5_), "Invalid operation", new Object[0]); + } + + public UUID getID() + { + return this.id; + } + + public String getName() + { + return this.name; + } + + public int getOperation() + { + return this.operation; + } + + public double getAmount() + { + return this.amount; + } + + /** + * @see #isSaved + */ + public boolean isSaved() + { + return this.isSaved; + } + + /** + * @see #isSaved + */ + public AttributeModifier setSaved(boolean p_111168_1_) + { + this.isSaved = p_111168_1_; + return this; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + AttributeModifier attributemodifier = (AttributeModifier)p_equals_1_; + + if (this.id != null) + { + if (!this.id.equals(attributemodifier.id)) + { + return false; + } + } + else if (attributemodifier.id != null) + { + return false; + } + + return true; + } + else + { + return false; + } + } + + public int hashCode() + { + return this.id != null ? this.id.hashCode() : 0; + } + + public String toString() + { + return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.name + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttribute.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttribute.java new file mode 100644 index 0000000..1449a1e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttribute.java @@ -0,0 +1,46 @@ +package net.minecraft.entity.ai.attributes; + +public abstract class BaseAttribute implements IAttribute +{ + private final String unlocalizedName; + private final double defaultValue; + private boolean shouldWatch; + private static final String __OBFID = "CL_00001565"; + + protected BaseAttribute(String p_i1607_1_, double p_i1607_2_) + { + this.unlocalizedName = p_i1607_1_; + this.defaultValue = p_i1607_2_; + + if (p_i1607_1_ == null) + { + throw new IllegalArgumentException("Name cannot be null!"); + } + } + + public String getAttributeUnlocalizedName() + { + return this.unlocalizedName; + } + + public double getDefaultValue() + { + return this.defaultValue; + } + + public boolean getShouldWatch() + { + return this.shouldWatch; + } + + public BaseAttribute setShouldWatch(boolean p_111112_1_) + { + this.shouldWatch = p_111112_1_; + return this; + } + + public int hashCode() + { + return this.unlocalizedName.hashCode(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java new file mode 100644 index 0000000..8f836e2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/BaseAttributeMap.java @@ -0,0 +1,71 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Multimap; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.server.management.LowerStringMap; + +public abstract class BaseAttributeMap +{ + protected final Map attributes = new HashMap(); + protected final Map attributesByName = new LowerStringMap(); + private static final String __OBFID = "CL_00001566"; + + public IAttributeInstance getAttributeInstance(IAttribute p_111151_1_) + { + return (IAttributeInstance)this.attributes.get(p_111151_1_); + } + + public IAttributeInstance getAttributeInstanceByName(String p_111152_1_) + { + return (IAttributeInstance)this.attributesByName.get(p_111152_1_); + } + + /** + * Registers an attribute with this AttributeMap, returns a modifiable AttributeInstance associated with this map + */ + public abstract IAttributeInstance registerAttribute(IAttribute p_111150_1_); + + public Collection getAllAttributes() + { + return this.attributesByName.values(); + } + + public void addAttributeInstance(ModifiableAttributeInstance p_111149_1_) {} + + public void removeAttributeModifiers(Multimap p_111148_1_) + { + Iterator iterator = p_111148_1_.entries().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + } + } + } + + public void applyAttributeModifiers(Multimap p_111147_1_) + { + Iterator iterator = p_111147_1_.entries().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + IAttributeInstance iattributeinstance = this.getAttributeInstanceByName((String)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + iattributeinstance.applyModifier((AttributeModifier)entry.getValue()); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttribute.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttribute.java new file mode 100644 index 0000000..74ae422 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttribute.java @@ -0,0 +1,12 @@ +package net.minecraft.entity.ai.attributes; + +public interface IAttribute +{ + String getAttributeUnlocalizedName(); + + double clampValue(double p_111109_1_); + + double getDefaultValue(); + + boolean getShouldWatch(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java new file mode 100644 index 0000000..df0ac62 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/IAttributeInstance.java @@ -0,0 +1,34 @@ +package net.minecraft.entity.ai.attributes; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; +import java.util.UUID; + +public interface IAttributeInstance +{ + /** + * Get the Attribute this is an instance of + */ + IAttribute getAttribute(); + + double getBaseValue(); + + void setBaseValue(double p_111128_1_); + + Collection func_111122_c(); + + /** + * Returns attribute modifier, if any, by the given UUID + */ + AttributeModifier getModifier(UUID p_111127_1_); + + void applyModifier(AttributeModifier p_111121_1_); + + void removeModifier(AttributeModifier p_111124_1_); + + @SideOnly(Side.CLIENT) + void removeAllModifiers(); + + double getAttributeValue(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java new file mode 100644 index 0000000..06d99da --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ModifiableAttributeInstance.java @@ -0,0 +1,195 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class ModifiableAttributeInstance implements IAttributeInstance +{ + /** The BaseAttributeMap this attributeInstance can be found in */ + private final BaseAttributeMap attributeMap; + /** The Attribute this is an instance of */ + private final IAttribute genericAttribute; + private final Map mapByOperation = Maps.newHashMap(); + private final Map mapByName = Maps.newHashMap(); + private final Map mapByUUID = Maps.newHashMap(); + private double baseValue; + private boolean needsUpdate = true; + private double cachedValue; + private static final String __OBFID = "CL_00001567"; + + public ModifiableAttributeInstance(BaseAttributeMap p_i1608_1_, IAttribute p_i1608_2_) + { + this.attributeMap = p_i1608_1_; + this.genericAttribute = p_i1608_2_; + this.baseValue = p_i1608_2_.getDefaultValue(); + + for (int i = 0; i < 3; ++i) + { + this.mapByOperation.put(Integer.valueOf(i), new HashSet()); + } + } + + /** + * Get the Attribute this is an instance of + */ + public IAttribute getAttribute() + { + return this.genericAttribute; + } + + public double getBaseValue() + { + return this.baseValue; + } + + public void setBaseValue(double p_111128_1_) + { + if (p_111128_1_ != this.getBaseValue()) + { + this.baseValue = p_111128_1_; + this.flagForUpdate(); + } + } + + public Collection getModifiersByOperation(int p_111130_1_) + { + return (Collection)this.mapByOperation.get(Integer.valueOf(p_111130_1_)); + } + + public Collection func_111122_c() + { + HashSet hashset = new HashSet(); + + for (int i = 0; i < 3; ++i) + { + hashset.addAll(this.getModifiersByOperation(i)); + } + + return hashset; + } + + /** + * Returns attribute modifier, if any, by the given UUID + */ + public AttributeModifier getModifier(UUID p_111127_1_) + { + return (AttributeModifier)this.mapByUUID.get(p_111127_1_); + } + + public void applyModifier(AttributeModifier p_111121_1_) + { + if (this.getModifier(p_111121_1_.getID()) != null) + { + throw new IllegalArgumentException("Modifier is already applied on this attribute!"); + } + else + { + Object object = (Set)this.mapByName.get(p_111121_1_.getName()); + + if (object == null) + { + object = new HashSet(); + this.mapByName.put(p_111121_1_.getName(), object); + } + + ((Set)this.mapByOperation.get(Integer.valueOf(p_111121_1_.getOperation()))).add(p_111121_1_); + ((Set)object).add(p_111121_1_); + this.mapByUUID.put(p_111121_1_.getID(), p_111121_1_); + this.flagForUpdate(); + } + } + + private void flagForUpdate() + { + this.needsUpdate = true; + this.attributeMap.addAttributeInstance(this); + } + + public void removeModifier(AttributeModifier p_111124_1_) + { + for (int i = 0; i < 3; ++i) + { + Set set = (Set)this.mapByOperation.get(Integer.valueOf(i)); + set.remove(p_111124_1_); + } + + Set set1 = (Set)this.mapByName.get(p_111124_1_.getName()); + + if (set1 != null) + { + set1.remove(p_111124_1_); + + if (set1.isEmpty()) + { + this.mapByName.remove(p_111124_1_.getName()); + } + } + + this.mapByUUID.remove(p_111124_1_.getID()); + this.flagForUpdate(); + } + + @SideOnly(Side.CLIENT) + public void removeAllModifiers() + { + Collection collection = this.func_111122_c(); + + if (collection != null) + { + ArrayList arraylist = new ArrayList(collection); + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + AttributeModifier attributemodifier = (AttributeModifier)iterator.next(); + this.removeModifier(attributemodifier); + } + } + } + + public double getAttributeValue() + { + if (this.needsUpdate) + { + this.cachedValue = this.computeValue(); + this.needsUpdate = false; + } + + return this.cachedValue; + } + + private double computeValue() + { + double d0 = this.getBaseValue(); + AttributeModifier attributemodifier; + + for (Iterator iterator = this.getModifiersByOperation(0).iterator(); iterator.hasNext(); d0 += attributemodifier.getAmount()) + { + attributemodifier = (AttributeModifier)iterator.next(); + } + + double d1 = d0; + Iterator iterator1; + AttributeModifier attributemodifier1; + + for (iterator1 = this.getModifiersByOperation(1).iterator(); iterator1.hasNext(); d1 += d0 * attributemodifier1.getAmount()) + { + attributemodifier1 = (AttributeModifier)iterator1.next(); + } + + for (iterator1 = this.getModifiersByOperation(2).iterator(); iterator1.hasNext(); d1 *= 1.0D + attributemodifier1.getAmount()) + { + attributemodifier1 = (AttributeModifier)iterator1.next(); + } + + return this.genericAttribute.clampValue(d1); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/RangedAttribute.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/RangedAttribute.java new file mode 100644 index 0000000..124970d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/RangedAttribute.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.ai.attributes; + +public class RangedAttribute extends BaseAttribute +{ + private final double minimumValue; + private final double maximumValue; + private String description; + private static final String __OBFID = "CL_00001568"; + + public RangedAttribute(String p_i1609_1_, double p_i1609_2_, double p_i1609_4_, double p_i1609_6_) + { + super(p_i1609_1_, p_i1609_2_); + this.minimumValue = p_i1609_4_; + this.maximumValue = p_i1609_6_; + + if (p_i1609_4_ > p_i1609_6_) + { + throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); + } + else if (p_i1609_2_ < p_i1609_4_) + { + throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); + } + else if (p_i1609_2_ > p_i1609_6_) + { + throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); + } + } + + public RangedAttribute setDescription(String p_111117_1_) + { + this.description = p_111117_1_; + return this; + } + + public String getDescription() + { + return this.description; + } + + public double clampValue(double p_111109_1_) + { + if (p_111109_1_ < this.minimumValue) + { + p_111109_1_ = this.minimumValue; + } + + if (p_111109_1_ > this.maximumValue) + { + p_111109_1_ = this.maximumValue; + } + + return p_111109_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java new file mode 100644 index 0000000..59e3332 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/ai/attributes/ServersideAttributeMap.java @@ -0,0 +1,88 @@ +package net.minecraft.entity.ai.attributes; + +import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import net.minecraft.server.management.LowerStringMap; + +public class ServersideAttributeMap extends BaseAttributeMap +{ + private final Set attributeInstanceSet = Sets.newHashSet(); + protected final Map descriptionToAttributeInstanceMap = new LowerStringMap(); + private static final String __OBFID = "CL_00001569"; + + public ModifiableAttributeInstance getAttributeInstance(IAttribute p_111151_1_) + { + return (ModifiableAttributeInstance)super.getAttributeInstance(p_111151_1_); + } + + public ModifiableAttributeInstance getAttributeInstanceByName(String p_111152_1_) + { + IAttributeInstance iattributeinstance = super.getAttributeInstanceByName(p_111152_1_); + + if (iattributeinstance == null) + { + iattributeinstance = (IAttributeInstance)this.descriptionToAttributeInstanceMap.get(p_111152_1_); + } + + return (ModifiableAttributeInstance)iattributeinstance; + } + + /** + * Registers an attribute with this AttributeMap, returns a modifiable AttributeInstance associated with this map + */ + public IAttributeInstance registerAttribute(IAttribute p_111150_1_) + { + if (this.attributesByName.containsKey(p_111150_1_.getAttributeUnlocalizedName())) + { + throw new IllegalArgumentException("Attribute is already registered!"); + } + else + { + ModifiableAttributeInstance modifiableattributeinstance = new ModifiableAttributeInstance(this, p_111150_1_); + this.attributesByName.put(p_111150_1_.getAttributeUnlocalizedName(), modifiableattributeinstance); + + if (p_111150_1_ instanceof RangedAttribute && ((RangedAttribute)p_111150_1_).getDescription() != null) + { + this.descriptionToAttributeInstanceMap.put(((RangedAttribute)p_111150_1_).getDescription(), modifiableattributeinstance); + } + + this.attributes.put(p_111150_1_, modifiableattributeinstance); + return modifiableattributeinstance; + } + } + + public void addAttributeInstance(ModifiableAttributeInstance p_111149_1_) + { + if (p_111149_1_.getAttribute().getShouldWatch()) + { + this.attributeInstanceSet.add(p_111149_1_); + } + } + + public Set getAttributeInstanceSet() + { + return this.attributeInstanceSet; + } + + public Collection getWatchedAttributes() + { + HashSet hashset = Sets.newHashSet(); + Iterator iterator = this.getAllAttributes().iterator(); + + while (iterator.hasNext()) + { + IAttributeInstance iattributeinstance = (IAttributeInstance)iterator.next(); + + if (iattributeinstance.getAttribute().getShouldWatch()) + { + hashset.add(iattributeinstance); + } + } + + return hashset; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/boss/BossStatus.java b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/BossStatus.java new file mode 100644 index 0000000..28a75d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/BossStatus.java @@ -0,0 +1,22 @@ +package net.minecraft.entity.boss; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public final class BossStatus +{ + public static float healthScale; + public static int statusBarTime; + public static String bossName; + public static boolean hasColorModifier; + private static final String __OBFID = "CL_00000941"; + + public static void setBossStatus(IBossDisplayData p_82824_0_, boolean p_82824_1_) + { + healthScale = p_82824_0_.getHealth() / p_82824_0_.getMaxHealth(); + statusBarTime = 100; + bossName = p_82824_0_.func_145748_c_().getFormattedText(); + hasColorModifier = p_82824_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragon.java b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragon.java new file mode 100644 index 0000000..22d3b8c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragon.java @@ -0,0 +1,741 @@ +package net.minecraft.entity.boss; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEndPortal; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob +{ + public double targetX; + public double targetY; + public double targetZ; + /** Ring buffer array for the last 64 Y-positions and yaw rotations. Used to calculate offsets for the animations. */ + public double[][] ringBuffer = new double[64][3]; + /** Index into the ring buffer. Incremented once per tick and restarts at 0 once it reaches the end of the buffer. */ + public int ringBufferIndex = -1; + /** An array containing all body parts of this dragon */ + public EntityDragonPart[] dragonPartArray; + /** The head bounding box of a dragon */ + public EntityDragonPart dragonPartHead; + /** The body bounding box of a dragon */ + public EntityDragonPart dragonPartBody; + public EntityDragonPart dragonPartTail1; + public EntityDragonPart dragonPartTail2; + public EntityDragonPart dragonPartTail3; + public EntityDragonPart dragonPartWing1; + public EntityDragonPart dragonPartWing2; + /** Animation time at previous tick. */ + public float prevAnimTime; + /** Animation time, used to control the speed of the animation cycles (wings flapping, jaw opening, etc.) */ + public float animTime; + /** Force selecting a new flight target at next tick if set to true. */ + public boolean forceNewTarget; + /** Activated if the dragon is flying though obsidian, white stone or bedrock. Slows movement and animation speed. */ + public boolean slowed; + private Entity target; + public int deathTicks; + /** The current endercrystal that is healing this dragon */ + public EntityEnderCrystal healingEnderCrystal; + private static final String __OBFID = "CL_00001659"; + + public EntityDragon(World p_i1700_1_) + { + super(p_i1700_1_); + this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; + this.setHealth(this.getMaxHealth()); + this.setSize(16.0F, 8.0F); + this.noClip = true; + this.isImmuneToFire = true; + this.targetY = 100.0D; + this.ignoreFrustumCheck = true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(200.0D); + } + + protected void entityInit() + { + super.entityInit(); + } + + /** + * Returns a double[3] array with movement offsets, used to calculate trailing tail/neck positions. [0] = yaw + * offset, [1] = y offset, [2] = unused, always 0. Parameters: buffer index offset, partial ticks. + */ + public double[] getMovementOffsets(int p_70974_1_, float p_70974_2_) + { + if (this.getHealth() <= 0.0F) + { + p_70974_2_ = 0.0F; + } + + p_70974_2_ = 1.0F - p_70974_2_; + int j = this.ringBufferIndex - p_70974_1_ * 1 & 63; + int k = this.ringBufferIndex - p_70974_1_ * 1 - 1 & 63; + double[] adouble = new double[3]; + double d0 = this.ringBuffer[j][0]; + double d1 = MathHelper.wrapAngleTo180_double(this.ringBuffer[k][0] - d0); + adouble[0] = d0 + d1 * (double)p_70974_2_; + d0 = this.ringBuffer[j][1]; + d1 = this.ringBuffer[k][1] - d0; + adouble[1] = d0 + d1 * (double)p_70974_2_; + adouble[2] = this.ringBuffer[j][2] + (this.ringBuffer[k][2] - this.ringBuffer[j][2]) * (double)p_70974_2_; + return adouble; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + float f; + float f1; + + if (this.worldObj.isRemote) + { + f = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F); + f1 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F); + + if (f1 <= -0.3F && f >= -0.3F) + { + this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); + } + } + + this.prevAnimTime = this.animTime; + float f2; + + if (this.getHealth() <= 0.0F) + { + f = (this.rand.nextFloat() - 0.5F) * 8.0F; + f1 = (this.rand.nextFloat() - 0.5F) * 4.0F; + f2 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("largeexplode", this.posX + (double)f, this.posY + 2.0D + (double)f1, this.posZ + (double)f2, 0.0D, 0.0D, 0.0D); + } + else + { + this.updateDragonEnderCrystal(); + f = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); + f *= (float)Math.pow(2.0D, this.motionY); + + if (this.slowed) + { + this.animTime += f * 0.5F; + } + else + { + this.animTime += f; + } + + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + + if (this.ringBufferIndex < 0) + { + for (int i = 0; i < this.ringBuffer.length; ++i) + { + this.ringBuffer[i][0] = (double)this.rotationYaw; + this.ringBuffer[i][1] = this.posY; + } + } + + if (++this.ringBufferIndex == this.ringBuffer.length) + { + this.ringBufferIndex = 0; + } + + this.ringBuffer[this.ringBufferIndex][0] = (double)this.rotationYaw; + this.ringBuffer[this.ringBufferIndex][1] = this.posY; + double d0; + double d1; + double d2; + double d10; + float f12; + + if (this.worldObj.isRemote) + { + if (this.newPosRotationIncrements > 0) + { + d10 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + d0 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + d1 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; + d2 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d2 / (double)this.newPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.newRotationPitch - (double)this.rotationPitch) / (double)this.newPosRotationIncrements); + --this.newPosRotationIncrements; + this.setPosition(d10, d0, d1); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } + else + { + d10 = this.targetX - this.posX; + d0 = this.targetY - this.posY; + d1 = this.targetZ - this.posZ; + d2 = d10 * d10 + d0 * d0 + d1 * d1; + + if (this.target != null) + { + this.targetX = this.target.posX; + this.targetZ = this.target.posZ; + double d3 = this.targetX - this.posX; + double d5 = this.targetZ - this.posZ; + double d7 = Math.sqrt(d3 * d3 + d5 * d5); + double d8 = 0.4000000059604645D + d7 / 80.0D - 1.0D; + + if (d8 > 10.0D) + { + d8 = 10.0D; + } + + this.targetY = this.target.boundingBox.minY + d8; + } + else + { + this.targetX += this.rand.nextGaussian() * 2.0D; + this.targetZ += this.rand.nextGaussian() * 2.0D; + } + + if (this.forceNewTarget || d2 < 100.0D || d2 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) + { + this.setNewTarget(); + } + + d0 /= (double)MathHelper.sqrt_double(d10 * d10 + d1 * d1); + f12 = 0.6F; + + if (d0 < (double)(-f12)) + { + d0 = (double)(-f12); + } + + if (d0 > (double)f12) + { + d0 = (double)f12; + } + + this.motionY += d0 * 0.10000000149011612D; + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); + double d4 = 180.0D - Math.atan2(d10, d1) * 180.0D / Math.PI; + double d6 = MathHelper.wrapAngleTo180_double(d4 - (double)this.rotationYaw); + + if (d6 > 50.0D) + { + d6 = 50.0D; + } + + if (d6 < -50.0D) + { + d6 = -50.0D; + } + + Vec3 vec3 = Vec3.createVectorHelper(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize(); + Vec3 vec32 = Vec3.createVectorHelper((double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F))).normalize(); + float f5 = (float)(vec32.dotProduct(vec3) + 0.5D) / 1.5F; + + if (f5 < 0.0F) + { + f5 = 0.0F; + } + + this.randomYawVelocity *= 0.8F; + float f6 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F; + double d9 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; + + if (d9 > 40.0D) + { + d9 = 40.0D; + } + + this.randomYawVelocity = (float)((double)this.randomYawVelocity + d6 * (0.699999988079071D / d9 / (double)f6)); + this.rotationYaw += this.randomYawVelocity * 0.1F; + float f7 = (float)(2.0D / (d9 + 1.0D)); + float f8 = 0.06F; + this.moveFlying(0.0F, -1.0F, f8 * (f5 * f7 + (1.0F - f7))); + + if (this.slowed) + { + this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); + } + else + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + Vec3 vec31 = Vec3.createVectorHelper(this.motionX, this.motionY, this.motionZ).normalize(); + float f9 = (float)(vec31.dotProduct(vec32) + 1.0D) / 2.0F; + f9 = 0.8F + 0.15F * f9; + this.motionX *= (double)f9; + this.motionZ *= (double)f9; + this.motionY *= 0.9100000262260437D; + } + + this.renderYawOffset = this.rotationYaw; + this.dragonPartHead.width = this.dragonPartHead.height = 3.0F; + this.dragonPartTail1.width = this.dragonPartTail1.height = 2.0F; + this.dragonPartTail2.width = this.dragonPartTail2.height = 2.0F; + this.dragonPartTail3.width = this.dragonPartTail3.height = 2.0F; + this.dragonPartBody.height = 3.0F; + this.dragonPartBody.width = 5.0F; + this.dragonPartWing1.height = 2.0F; + this.dragonPartWing1.width = 4.0F; + this.dragonPartWing2.height = 3.0F; + this.dragonPartWing2.width = 4.0F; + f1 = (float)(this.getMovementOffsets(5, 1.0F)[1] - this.getMovementOffsets(10, 1.0F)[1]) * 10.0F / 180.0F * (float)Math.PI; + f2 = MathHelper.cos(f1); + float f10 = -MathHelper.sin(f1); + float f3 = this.rotationYaw * (float)Math.PI / 180.0F; + float f11 = MathHelper.sin(f3); + float f4 = MathHelper.cos(f3); + this.dragonPartBody.onUpdate(); + this.dragonPartBody.setLocationAndAngles(this.posX + (double)(f11 * 0.5F), this.posY, this.posZ - (double)(f4 * 0.5F), 0.0F, 0.0F); + this.dragonPartWing1.onUpdate(); + this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(f4 * 4.5F), this.posY + 2.0D, this.posZ + (double)(f11 * 4.5F), 0.0F, 0.0F); + this.dragonPartWing2.onUpdate(); + this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(f4 * 4.5F), this.posY + 2.0D, this.posZ - (double)(f11 * 4.5F), 0.0F, 0.0F); + + if (!this.worldObj.isRemote && this.hurtTime == 0) + { + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D))); + } + + double[] adouble1 = this.getMovementOffsets(5, 1.0F); + double[] adouble = this.getMovementOffsets(0, 1.0F); + f12 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + float f13 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F - this.randomYawVelocity * 0.01F); + this.dragonPartHead.onUpdate(); + this.dragonPartHead.setLocationAndAngles(this.posX + (double)(f12 * 5.5F * f2), this.posY + (adouble[1] - adouble1[1]) * 1.0D + (double)(f10 * 5.5F), this.posZ - (double)(f13 * 5.5F * f2), 0.0F, 0.0F); + + for (int j = 0; j < 3; ++j) + { + EntityDragonPart entitydragonpart = null; + + if (j == 0) + { + entitydragonpart = this.dragonPartTail1; + } + + if (j == 1) + { + entitydragonpart = this.dragonPartTail2; + } + + if (j == 2) + { + entitydragonpart = this.dragonPartTail3; + } + + double[] adouble2 = this.getMovementOffsets(12 + j * 2, 1.0F); + float f14 = this.rotationYaw * (float)Math.PI / 180.0F + this.simplifyAngle(adouble2[0] - adouble1[0]) * (float)Math.PI / 180.0F * 1.0F; + float f15 = MathHelper.sin(f14); + float f16 = MathHelper.cos(f14); + float f17 = 1.5F; + float f18 = (float)(j + 1) * 2.0F; + entitydragonpart.onUpdate(); + entitydragonpart.setLocationAndAngles(this.posX - (double)((f11 * f17 + f15 * f18) * f2), this.posY + (adouble2[1] - adouble1[1]) * 1.0D - (double)((f18 + f17) * f10) + 1.5D, this.posZ + (double)((f4 * f17 + f16 * f18) * f2), 0.0F, 0.0F); + } + + if (!this.worldObj.isRemote) + { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox); + } + } + } + + /** + * Updates the state of the enderdragon's current endercrystal. + */ + private void updateDragonEnderCrystal() + { + if (this.healingEnderCrystal != null) + { + if (this.healingEnderCrystal.isDead) + { + if (!this.worldObj.isRemote) + { + this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion)null), 10.0F); + } + + this.healingEnderCrystal = null; + } + else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) + { + this.setHealth(this.getHealth() + 1.0F); + } + } + + if (this.rand.nextInt(10) == 0) + { + float f = 32.0F; + List list = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.boundingBox.expand((double)f, (double)f, (double)f)); + EntityEnderCrystal entityendercrystal = null; + double d0 = Double.MAX_VALUE; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityEnderCrystal entityendercrystal1 = (EntityEnderCrystal)iterator.next(); + double d1 = entityendercrystal1.getDistanceSqToEntity(this); + + if (d1 < d0) + { + d0 = d1; + entityendercrystal = entityendercrystal1; + } + } + + this.healingEnderCrystal = entityendercrystal; + } + } + + /** + * Pushes all entities inside the list away from the enderdragon. + */ + private void collideWithEntities(List p_70970_1_) + { + double d0 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D; + double d1 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D; + Iterator iterator = p_70970_1_.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + + if (entity instanceof EntityLivingBase) + { + double d2 = entity.posX - d0; + double d3 = entity.posZ - d1; + double d4 = d2 * d2 + d3 * d3; + entity.addVelocity(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D); + } + } + } + + /** + * Attacks all entities inside this list, dealing 5 hearts of damage. + */ + private void attackEntitiesInList(List p_70971_1_) + { + for (int i = 0; i < p_70971_1_.size(); ++i) + { + Entity entity = (Entity)p_70971_1_.get(i); + + if (entity instanceof EntityLivingBase) + { + entity.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); + } + } + } + + /** + * Sets a new target for the flight AI. It can be a random coordinate or a nearby player. + */ + private void setNewTarget() + { + this.forceNewTarget = false; + + if (this.rand.nextInt(2) == 0 && !this.worldObj.playerEntities.isEmpty()) + { + this.target = (Entity)this.worldObj.playerEntities.get(this.rand.nextInt(this.worldObj.playerEntities.size())); + } + else + { + boolean flag = false; + + do + { + this.targetX = 0.0D; + this.targetY = (double)(70.0F + this.rand.nextFloat() * 50.0F); + this.targetZ = 0.0D; + this.targetX += (double)(this.rand.nextFloat() * 120.0F - 60.0F); + this.targetZ += (double)(this.rand.nextFloat() * 120.0F - 60.0F); + double d0 = this.posX - this.targetX; + double d1 = this.posY - this.targetY; + double d2 = this.posZ - this.targetZ; + flag = d0 * d0 + d1 * d1 + d2 * d2 > 100.0D; + } + while (!flag); + + this.target = null; + } + } + + /** + * Simplifies the value of a number by adding/subtracting 180 to the point that the number is between -180 and 180. + */ + private float simplifyAngle(double p_70973_1_) + { + return (float)MathHelper.wrapAngleTo180_double(p_70973_1_); + } + + /** + * Destroys all blocks that aren't associated with 'The End' inside the given bounding box. + */ + private boolean destroyBlocksInAABB(AxisAlignedBB p_70972_1_) + { + int i = MathHelper.floor_double(p_70972_1_.minX); + int j = MathHelper.floor_double(p_70972_1_.minY); + int k = MathHelper.floor_double(p_70972_1_.minZ); + int l = MathHelper.floor_double(p_70972_1_.maxX); + int i1 = MathHelper.floor_double(p_70972_1_.maxY); + int j1 = MathHelper.floor_double(p_70972_1_.maxZ); + boolean flag = false; + boolean flag1 = false; + + for (int k1 = i; k1 <= l; ++k1) + { + for (int l1 = j; l1 <= i1; ++l1) + { + for (int i2 = k; i2 <= j1; ++i2) + { + Block block = this.worldObj.getBlock(k1, l1, i2); + + if (!block.isAir(worldObj, k1, l1, i2)) + { + if (block.canEntityDestroy(worldObj, k1, l1, i2, this) && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + flag1 = this.worldObj.setBlockToAir(k1, l1, i2) || flag1; + } + else + { + flag = true; + } + } + } + } + } + + if (flag1) + { + double d1 = p_70972_1_.minX + (p_70972_1_.maxX - p_70972_1_.minX) * (double)this.rand.nextFloat(); + double d2 = p_70972_1_.minY + (p_70972_1_.maxY - p_70972_1_.minY) * (double)this.rand.nextFloat(); + double d0 = p_70972_1_.minZ + (p_70972_1_.maxZ - p_70972_1_.minZ) * (double)this.rand.nextFloat(); + this.worldObj.spawnParticle("largeexplode", d1, d2, d0, 0.0D, 0.0D, 0.0D); + } + + return flag; + } + + public boolean attackEntityFromPart(EntityDragonPart p_70965_1_, DamageSource p_70965_2_, float p_70965_3_) + { + if (p_70965_1_ != this.dragonPartHead) + { + p_70965_3_ = p_70965_3_ / 4.0F + 1.0F; + } + + float f1 = this.rotationYaw * (float)Math.PI / 180.0F; + float f2 = MathHelper.sin(f1); + float f3 = MathHelper.cos(f1); + this.targetX = this.posX + (double)(f2 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D; + this.targetZ = this.posZ - (double)(f3 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.target = null; + + if (p_70965_2_.getEntity() instanceof EntityPlayer || p_70965_2_.isExplosion()) + { + this.func_82195_e(p_70965_2_, p_70965_3_); + } + + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } + + protected boolean func_82195_e(DamageSource p_82195_1_, float p_82195_2_) + { + return super.attackEntityFrom(p_82195_1_, p_82195_2_); + } + + /** + * handles entity death timer, experience orb and particle creation + */ + protected void onDeathUpdate() + { + ++this.deathTicks; + + if (this.deathTicks >= 180 && this.deathTicks <= 200) + { + float f = (this.rand.nextFloat() - 0.5F) * 8.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 4.0F; + float f2 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("hugeexplosion", this.posX + (double)f, this.posY + 2.0D + (double)f1, this.posZ + (double)f2, 0.0D, 0.0D, 0.0D); + } + + int i; + int j; + + if (!this.worldObj.isRemote) + { + if (this.deathTicks > 150 && this.deathTicks % 5 == 0) + { + i = 1000; + + while (i > 0) + { + j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + } + + if (this.deathTicks == 1) + { + this.worldObj.playBroadcastSound(1018, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + + this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); + this.renderYawOffset = this.rotationYaw += 20.0F; + + if (this.deathTicks == 200 && !this.worldObj.isRemote) + { + i = 2000; + + while (i > 0) + { + j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + + this.createEnderPortal(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + this.setDead(); + } + } + + /** + * Creates the ender portal leading back to the normal world after defeating the enderdragon. + */ + private void createEnderPortal(int p_70975_1_, int p_70975_2_) + { + byte b0 = 64; + BlockEndPortal.field_149948_a = true; + byte b1 = 4; + + for (int k = b0 - 1; k <= b0 + 32; ++k) + { + for (int l = p_70975_1_ - b1; l <= p_70975_1_ + b1; ++l) + { + for (int i1 = p_70975_2_ - b1; i1 <= p_70975_2_ + b1; ++i1) + { + double d0 = (double)(l - p_70975_1_); + double d1 = (double)(i1 - p_70975_2_); + double d2 = d0 * d0 + d1 * d1; + + if (d2 <= ((double)b1 - 0.5D) * ((double)b1 - 0.5D)) + { + if (k < b0) + { + if (d2 <= ((double)(b1 - 1) - 0.5D) * ((double)(b1 - 1) - 0.5D)) + { + this.worldObj.setBlock(l, k, i1, Blocks.bedrock); + } + } + else if (k > b0) + { + this.worldObj.setBlock(l, k, i1, Blocks.air); + } + else if (d2 > ((double)(b1 - 1) - 0.5D) * ((double)(b1 - 1) - 0.5D)) + { + this.worldObj.setBlock(l, k, i1, Blocks.bedrock); + } + else + { + this.worldObj.setBlock(l, k, i1, Blocks.end_portal); + } + } + } + } + } + + this.worldObj.setBlock(p_70975_1_, b0 + 0, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, b0 + 1, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, b0 + 2, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_ - 1, b0 + 2, p_70975_2_, Blocks.torch); + this.worldObj.setBlock(p_70975_1_ + 1, b0 + 2, p_70975_2_, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, b0 + 2, p_70975_2_ - 1, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, b0 + 2, p_70975_2_ + 1, Blocks.torch); + this.worldObj.setBlock(p_70975_1_, b0 + 3, p_70975_2_, Blocks.bedrock); + this.worldObj.setBlock(p_70975_1_, b0 + 4, p_70975_2_, Blocks.dragon_egg); + BlockEndPortal.field_149948_a = false; + } + + /** + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() {} + + /** + * Return the Entity parts making up this Entity (currently only for dragons) + */ + public Entity[] getParts() + { + return this.dragonPartArray; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return false; + } + + public World func_82194_d() + { + return this.worldObj; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.enderdragon.growl"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.enderdragon.hit"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 5.0F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragonPart.java b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragonPart.java new file mode 100644 index 0000000..cfe64f0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityDragonPart.java @@ -0,0 +1,58 @@ +package net.minecraft.entity.boss; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; + +public class EntityDragonPart extends Entity +{ + /** The dragon entity this dragon part belongs to */ + public final IEntityMultiPart entityDragonObj; + public final String field_146032_b; + private static final String __OBFID = "CL_00001657"; + + public EntityDragonPart(IEntityMultiPart p_i1697_1_, String p_i1697_2_, float p_i1697_3_, float p_i1697_4_) + { + super(p_i1697_1_.func_82194_d()); + this.setSize(p_i1697_3_, p_i1697_4_); + this.entityDragonObj = p_i1697_1_; + this.field_146032_b = p_i1697_2_; + } + + protected void entityInit() {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, source, amount); + } + + /** + * Returns true if Entity argument is equal to this Entity + */ + public boolean isEntityEqual(Entity entityIn) + { + return this == entityIn || this.entityDragonObj == entityIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityWither.java b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityWither.java new file mode 100644 index 0000000..fb371f4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/EntityWither.java @@ -0,0 +1,672 @@ +package net.minecraft.entity.boss; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityWitherSkull; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob +{ + private float[] field_82220_d = new float[2]; + private float[] field_82221_e = new float[2]; + private float[] field_82217_f = new float[2]; + private float[] field_82218_g = new float[2]; + private int[] field_82223_h = new int[2]; + private int[] field_82224_i = new int[2]; + private int field_82222_j; + /** Selector used to determine the entities a wither boss should attack. */ + private static final IEntitySelector attackEntitySelector = new IEntitySelector() + { + private static final String __OBFID = "CL_00001662"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_ instanceof EntityLivingBase && ((EntityLivingBase)p_82704_1_).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; + } + }; + private static final String __OBFID = "CL_00001661"; + + public EntityWither(World p_i1701_1_) + { + super(p_i1701_1_); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 4.0F); + this.isImmuneToFire = true; + this.getNavigator().setCanSwim(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 40, 20.0F)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, attackEntitySelector)); + this.experienceValue = 50; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(0)); + this.dataWatcher.addObject(19, new Integer(0)); + this.dataWatcher.addObject(20, new Integer(0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Invul", this.func_82212_n()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.func_82215_s(tagCompund.getInteger("Invul")); + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return this.height / 8.0F; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.wither.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.wither.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wither.death"; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + this.motionY *= 0.6000000238418579D; + double d1; + double d3; + double d5; + + if (!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) + { + Entity entity = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); + + if (entity != null) + { + if (this.posY < entity.posY || !this.isArmored() && this.posY < entity.posY + 5.0D) + { + if (this.motionY < 0.0D) + { + this.motionY = 0.0D; + } + + this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double d0 = entity.posX - this.posX; + d1 = entity.posZ - this.posZ; + d3 = d0 * d0 + d1 * d1; + + if (d3 > 9.0D) + { + d5 = (double)MathHelper.sqrt_double(d3); + this.motionX += (d0 / d5 * 0.5D - this.motionX) * 0.6000000238418579D; + this.motionZ += (d1 / d5 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) + { + this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180F / (float)Math.PI) - 90.0F; + } + + super.onLivingUpdate(); + int i; + + for (i = 0; i < 2; ++i) + { + this.field_82218_g[i] = this.field_82221_e[i]; + this.field_82217_f[i] = this.field_82220_d[i]; + } + + int j; + + for (i = 0; i < 2; ++i) + { + j = this.getWatchedTargetId(i + 1); + Entity entity1 = null; + + if (j > 0) + { + entity1 = this.worldObj.getEntityByID(j); + } + + if (entity1 != null) + { + d1 = this.func_82214_u(i + 1); + d3 = this.func_82208_v(i + 1); + d5 = this.func_82213_w(i + 1); + double d6 = entity1.posX - d1; + double d7 = entity1.posY + (double)entity1.getEyeHeight() - d3; + double d8 = entity1.posZ - d5; + double d9 = (double)MathHelper.sqrt_double(d6 * d6 + d8 * d8); + float f = (float)(Math.atan2(d8, d6) * 180.0D / Math.PI) - 90.0F; + float f1 = (float)(-(Math.atan2(d7, d9) * 180.0D / Math.PI)); + this.field_82220_d[i] = this.func_82204_b(this.field_82220_d[i], f1, 40.0F); + this.field_82221_e[i] = this.func_82204_b(this.field_82221_e[i], f, 10.0F); + } + else + { + this.field_82221_e[i] = this.func_82204_b(this.field_82221_e[i], this.renderYawOffset, 10.0F); + } + } + + boolean flag = this.isArmored(); + + for (j = 0; j < 3; ++j) + { + double d10 = this.func_82214_u(j); + double d2 = this.func_82208_v(j); + double d4 = this.func_82213_w(j); + this.worldObj.spawnParticle("smoke", d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); + + if (flag && this.worldObj.rand.nextInt(4) == 0) + { + this.worldObj.spawnParticle("mobSpell", d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); + } + } + + if (this.func_82212_n() > 0) + { + for (j = 0; j < 3; ++j) + { + this.worldObj.spawnParticle("mobSpell", this.posX + this.rand.nextGaussian() * 1.0D, this.posY + (double)(this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); + } + } + } + + protected void updateAITasks() + { + int i; + + if (this.func_82212_n() > 0) + { + i = this.func_82212_n() - 1; + + if (i <= 0) + { + this.worldObj.newExplosion(this, this.posX, this.posY + (double)this.getEyeHeight(), this.posZ, 7.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.worldObj.playBroadcastSound(1013, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + this.func_82215_s(i); + + if (this.ticksExisted % 10 == 0) + { + this.heal(10.0F); + } + } + else + { + super.updateAITasks(); + int i1; + + for (i = 1; i < 3; ++i) + { + if (this.ticksExisted >= this.field_82223_h[i - 1]) + { + this.field_82223_h[i - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL || this.worldObj.difficultySetting == EnumDifficulty.HARD) + { + int k2 = i - 1; + int l2 = this.field_82224_i[i - 1]; + this.field_82224_i[k2] = this.field_82224_i[i - 1] + 1; + + if (l2 > 15) + { + float f = 10.0F; + float f1 = 5.0F; + double d0 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double)f, this.posX + (double)f); + double d1 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double)f1, this.posY + (double)f1); + double d2 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double)f, this.posZ + (double)f); + this.func_82209_a(i + 1, d0, d1, d2, true); + this.field_82224_i[i - 1] = 0; + } + } + + i1 = this.getWatchedTargetId(i); + + if (i1 > 0) + { + Entity entity = this.worldObj.getEntityByID(i1); + + if (entity != null && entity.isEntityAlive() && this.getDistanceSqToEntity(entity) <= 900.0D && this.canEntityBeSeen(entity)) + { + this.func_82216_a(i + 1, (EntityLivingBase)entity); + this.field_82223_h[i - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.field_82224_i[i - 1] = 0; + } + else + { + this.func_82211_c(i, 0); + } + } + else + { + List list = this.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(20.0D, 8.0D, 20.0D), attackEntitySelector); + + for (int k1 = 0; k1 < 10 && !list.isEmpty(); ++k1) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(this.rand.nextInt(list.size())); + + if (entitylivingbase != this && entitylivingbase.isEntityAlive() && this.canEntityBeSeen(entitylivingbase)) + { + if (entitylivingbase instanceof EntityPlayer) + { + if (!((EntityPlayer)entitylivingbase).capabilities.disableDamage) + { + this.func_82211_c(i, entitylivingbase.getEntityId()); + } + } + else + { + this.func_82211_c(i, entitylivingbase.getEntityId()); + } + + break; + } + + list.remove(entitylivingbase); + } + } + } + } + + if (this.getAttackTarget() != null) + { + this.func_82211_c(0, this.getAttackTarget().getEntityId()); + } + else + { + this.func_82211_c(0, 0); + } + + if (this.field_82222_j > 0) + { + --this.field_82222_j; + + if (this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + i = MathHelper.floor_double(this.posY); + i1 = MathHelper.floor_double(this.posX); + int j1 = MathHelper.floor_double(this.posZ); + boolean flag = false; + + for (int l1 = -1; l1 <= 1; ++l1) + { + for (int i2 = -1; i2 <= 1; ++i2) + { + for (int j = 0; j <= 3; ++j) + { + int j2 = i1 + l1; + int k = i + j; + int l = j1 + i2; + Block block = this.worldObj.getBlock(j2, k, l); + + if (!block.isAir(worldObj, j2, k, l) && block.canEntityDestroy(worldObj, j2, k, l, this)) + { + flag = this.worldObj.func_147480_a(j2, k, l, true) || flag; + } + } + } + } + + if (flag) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1012, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } + + if (this.ticksExisted % 20 == 0) + { + this.heal(1.0F); + } + } + } + + public void func_82206_m() + { + this.func_82215_s(220); + this.setHealth(this.getMaxHealth() / 3.0F); + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() {} + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + return 4; + } + + private double func_82214_u(int p_82214_1_) + { + if (p_82214_1_ <= 0) + { + return this.posX; + } + else + { + float f = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) / 180.0F * (float)Math.PI; + float f1 = MathHelper.cos(f); + return this.posX + (double)f1 * 1.3D; + } + } + + private double func_82208_v(int p_82208_1_) + { + return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + + private double func_82213_w(int p_82213_1_) + { + if (p_82213_1_ <= 0) + { + return this.posZ; + } + else + { + float f = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) / 180.0F * (float)Math.PI; + float f1 = MathHelper.sin(f); + return this.posZ + (double)f1 * 1.3D; + } + } + + private float func_82204_b(float p_82204_1_, float p_82204_2_, float p_82204_3_) + { + float f3 = MathHelper.wrapAngleTo180_float(p_82204_2_ - p_82204_1_); + + if (f3 > p_82204_3_) + { + f3 = p_82204_3_; + } + + if (f3 < -p_82204_3_) + { + f3 = -p_82204_3_; + } + + return p_82204_1_ + f3; + } + + private void func_82216_a(int p_82216_1_, EntityLivingBase p_82216_2_) + { + this.func_82209_a(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double)p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); + } + + private void func_82209_a(int p_82209_1_, double p_82209_2_, double p_82209_4_, double p_82209_6_, boolean p_82209_8_) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + double d3 = this.func_82214_u(p_82209_1_); + double d4 = this.func_82208_v(p_82209_1_); + double d5 = this.func_82213_w(p_82209_1_); + double d6 = p_82209_2_ - d3; + double d7 = p_82209_4_ - d4; + double d8 = p_82209_6_ - d5; + EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d6, d7, d8); + + if (p_82209_8_) + { + entitywitherskull.setInvulnerable(true); + } + + entitywitherskull.posY = d4; + entitywitherskull.posX = d3; + entitywitherskull.posZ = d5; + this.worldObj.spawnEntityInWorld(entitywitherskull); + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) + { + this.func_82216_a(0, p_82196_1_); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (source == DamageSource.drown) + { + return false; + } + else if (this.func_82212_n() > 0) + { + return false; + } + else + { + Entity entity; + + if (this.isArmored()) + { + entity = source.getSourceOfDamage(); + + if (entity instanceof EntityArrow) + { + return false; + } + } + + entity = source.getEntity(); + + if (entity != null && !(entity instanceof EntityPlayer) && entity instanceof EntityLivingBase && ((EntityLivingBase)entity).getCreatureAttribute() == this.getCreatureAttribute()) + { + return false; + } + else + { + if (this.field_82222_j <= 0) + { + this.field_82222_j = 20; + } + + for (int i = 0; i < this.field_82224_i.length; ++i) + { + this.field_82224_i[i] += 3; + } + + return super.attackEntityFrom(source, amount); + } + } + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + this.dropItem(Items.nether_star, 1); + + if (!this.worldObj.isRemote) + { + Iterator iterator = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand(50.0D, 100.0D, 50.0D)).iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + entityplayer.triggerAchievement(AchievementList.field_150964_J); + } + } + } + + /** + * Makes the entity despawn if requirements are reached + */ + protected void despawnEntity() + { + this.entityAge = 0; + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * adds a PotionEffect to the entity + */ + public void addPotionEffect(PotionEffect p_70690_1_) {} + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + } + + @SideOnly(Side.CLIENT) + public float func_82207_a(int p_82207_1_) + { + return this.field_82221_e[p_82207_1_]; + } + + @SideOnly(Side.CLIENT) + public float func_82210_r(int p_82210_1_) + { + return this.field_82220_d[p_82210_1_]; + } + + public int func_82212_n() + { + return this.dataWatcher.getWatchableObjectInt(20); + } + + public void func_82215_s(int p_82215_1_) + { + this.dataWatcher.updateObject(20, Integer.valueOf(p_82215_1_)); + } + + /** + * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 + */ + public int getWatchedTargetId(int p_82203_1_) + { + return this.dataWatcher.getWatchableObjectInt(17 + p_82203_1_); + } + + public void func_82211_c(int p_82211_1_, int p_82211_2_) + { + this.dataWatcher.updateObject(17 + p_82211_1_, Integer.valueOf(p_82211_2_)); + } + + /** + * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of + * its maximum. + */ + public boolean isArmored() + { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity entityIn) + { + this.ridingEntity = null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/boss/IBossDisplayData.java b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/IBossDisplayData.java new file mode 100644 index 0000000..235252e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/boss/IBossDisplayData.java @@ -0,0 +1,14 @@ +package net.minecraft.entity.boss; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.IChatComponent; + +public interface IBossDisplayData +{ + float getMaxHealth(); + + float getHealth(); + + IChatComponent func_145748_c_(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityLightningBolt.java b/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityLightningBolt.java new file mode 100644 index 0000000..97ee030 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityLightningBolt.java @@ -0,0 +1,129 @@ +package net.minecraft.entity.effect; + +import java.util.List; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityLightningBolt extends EntityWeatherEffect +{ + /** Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. */ + private int lightningState; + /** A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt */ + public long boltVertex; + /** Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. */ + private int boltLivingTime; + private static final String __OBFID = "CL_00001666"; + + public EntityLightningBolt(World p_i1703_1_, double p_i1703_2_, double p_i1703_4_, double p_i1703_6_) + { + super(p_i1703_1_); + this.setLocationAndAngles(p_i1703_2_, p_i1703_4_, p_i1703_6_, 0.0F, 0.0F); + this.lightningState = 2; + this.boltVertex = this.rand.nextLong(); + this.boltLivingTime = this.rand.nextInt(3) + 1; + + if (!p_i1703_1_.isRemote && p_i1703_1_.getGameRules().getGameRuleBooleanValue("doFireTick") && (p_i1703_1_.difficultySetting == EnumDifficulty.NORMAL || p_i1703_1_.difficultySetting == EnumDifficulty.HARD) && p_i1703_1_.doChunksNearChunkExist(MathHelper.floor_double(p_i1703_2_), MathHelper.floor_double(p_i1703_4_), MathHelper.floor_double(p_i1703_6_), 10)) + { + int i = MathHelper.floor_double(p_i1703_2_); + int j = MathHelper.floor_double(p_i1703_4_); + int k = MathHelper.floor_double(p_i1703_6_); + + if (p_i1703_1_.getBlock(i, j, k).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(p_i1703_1_, i, j, k)) + { + p_i1703_1_.setBlock(i, j, k, Blocks.fire); + } + + for (i = 0; i < 4; ++i) + { + j = MathHelper.floor_double(p_i1703_2_) + this.rand.nextInt(3) - 1; + k = MathHelper.floor_double(p_i1703_4_) + this.rand.nextInt(3) - 1; + int l = MathHelper.floor_double(p_i1703_6_) + this.rand.nextInt(3) - 1; + + if (p_i1703_1_.getBlock(j, k, l).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(p_i1703_1_, j, k, l)) + { + p_i1703_1_.setBlock(j, k, l, Blocks.fire); + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.lightningState == 2) + { + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); + this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); + } + + --this.lightningState; + + if (this.lightningState < 0) + { + if (this.boltLivingTime == 0) + { + this.setDead(); + } + else if (this.lightningState < -this.rand.nextInt(10)) + { + --this.boltLivingTime; + this.lightningState = 1; + this.boltVertex = this.rand.nextLong(); + + if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.air && Blocks.fire.canPlaceBlockAt(this.worldObj, i, j, k)) + { + this.worldObj.setBlock(i, j, k, Blocks.fire); + } + } + } + } + + if (this.lightningState >= 0) + { + if (this.worldObj.isRemote) + { + this.worldObj.lastLightningBolt = 2; + } + else + { + double d0 = 3.0D; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0)); + + for (int l = 0; l < list.size(); ++l) + { + Entity entity = (Entity)list.get(l); + if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) + entity.onStruckByLightning(this); + } + } + } + } + + protected void entityInit() {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityWeatherEffect.java b/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityWeatherEffect.java new file mode 100644 index 0000000..304899d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/effect/EntityWeatherEffect.java @@ -0,0 +1,14 @@ +package net.minecraft.entity.effect; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public abstract class EntityWeatherEffect extends Entity +{ + private static final String __OBFID = "CL_00001665"; + + public EntityWeatherEffect(World p_i1702_1_) + { + super(p_i1702_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityBoat.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityBoat.java new file mode 100644 index 0000000..ac5a097 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityBoat.java @@ -0,0 +1,624 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBoat extends Entity +{ + /** true if no player in boat */ + private boolean isBoatEmpty; + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + private double boatYaw; + private double boatPitch; + @SideOnly(Side.CLIENT) + private double velocityX; + @SideOnly(Side.CLIENT) + private double velocityY; + @SideOnly(Side.CLIENT) + private double velocityZ; + private static final String __OBFID = "CL_00001667"; + + public EntityBoat(World p_i1704_1_) + { + super(p_i1704_1_); + this.isBoatEmpty = true; + this.speedMultiplier = 0.07D; + this.preventEntitySpawning = true; + this.setSize(1.5F, 0.6F); + this.yOffset = this.height / 2.0F; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entityIn) + { + return entityIn.boundingBox; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() + { + return this.boundingBox; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return true; + } + + public EntityBoat(World p_i1705_1_, double p_i1705_2_, double p_i1705_4_, double p_i1705_6_) + { + this(p_i1705_1_); + this.setPosition(p_i1705_2_, p_i1705_4_ + (double)this.yOffset, p_i1705_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i1705_2_; + this.prevPosY = p_i1705_4_; + this.prevPosZ = p_i1705_6_; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() + { + return (double)this.height * 0.0D - 0.30000001192092896D; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (!this.worldObj.isRemote && !this.isDead) + { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() + amount * 10.0F); + this.setBeenAttacked(); + boolean flag = source.getEntity() instanceof EntityPlayer && ((EntityPlayer)source.getEntity()).capabilities.isCreativeMode; + + if (flag || this.getDamageTaken() > 40.0F) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (!flag) + { + this.func_145778_a(Items.boat, 1, 0.0F); + } + + this.setDead(); + } + + return true; + } + else + { + return true; + } + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + @SideOnly(Side.CLIENT) + public void performHurtAnimation() + { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() * 11.0F); + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + if (this.isBoatEmpty) + { + this.boatPosRotationIncrements = rotationIncrements + 5; + } + else + { + double d3 = x - this.posX; + double d4 = y - this.posY; + double d5 = z - this.posZ; + double d6 = d3 * d3 + d4 * d4 + d5 * d5; + + if (d6 <= 1.0D) + { + return; + } + + this.boatPosRotationIncrements = 3; + } + + this.boatX = x; + this.boatY = y; + this.boatZ = z; + this.boatYaw = (double)yaw; + this.boatPitch = (double)pitch; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.velocityX = this.motionX = x; + this.velocityY = this.motionY = y; + this.velocityZ = this.motionZ = z; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.getTimeSinceHit() > 0) + { + this.setTimeSinceHit(this.getTimeSinceHit() - 1); + } + + if (this.getDamageTaken() > 0.0F) + { + this.setDamageTaken(this.getDamageTaken() - 1.0F); + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + byte b0 = 5; + double d0 = 0.0D; + + for (int i = 0; i < b0; ++i) + { + double d1 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(i + 0) / (double)b0 - 0.125D; + double d3 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(i + 1) / (double)b0 - 0.125D; + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d1, this.boundingBox.minZ, this.boundingBox.maxX, d3, this.boundingBox.maxZ); + + if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) + { + d0 += 1.0D / (double)b0; + } + } + + double d10 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double d2; + double d4; + int j; + + if (d10 > 0.26249999999999996D) + { + d2 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); + d4 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); + + for (j = 0; (double)j < 1.0D + d10 * 60.0D; ++j) + { + double d5 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); + double d6 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; + double d8; + double d9; + + if (this.rand.nextBoolean()) + { + d8 = this.posX - d2 * d5 * 0.8D + d4 * d6; + d9 = this.posZ - d4 * d5 * 0.8D - d2 * d6; + this.worldObj.spawnParticle("splash", d8, this.posY - 0.125D, d9, this.motionX, this.motionY, this.motionZ); + } + else + { + d8 = this.posX + d2 + d4 * d5 * 0.7D; + d9 = this.posZ + d4 - d2 * d5 * 0.7D; + this.worldObj.spawnParticle("splash", d8, this.posY - 0.125D, d9, this.motionX, this.motionY, this.motionZ); + } + } + } + + double d11; + double d12; + + if (this.worldObj.isRemote && this.isBoatEmpty) + { + if (this.boatPosRotationIncrements > 0) + { + d2 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; + d4 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; + d11 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; + d12 = MathHelper.wrapAngleTo180_double(this.boatYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d12 / (double)this.boatPosRotationIncrements); + this.rotationPitch = (float)((double)this.rotationPitch + (this.boatPitch - (double)this.rotationPitch) / (double)this.boatPosRotationIncrements); + --this.boatPosRotationIncrements; + this.setPosition(d2, d4, d11); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + d2 = this.posX + this.motionX; + d4 = this.posY + this.motionY; + d11 = this.posZ + this.motionZ; + this.setPosition(d2, d4, d11); + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + } + else + { + if (d0 < 1.0D) + { + d2 = d0 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d2; + } + else + { + if (this.motionY < 0.0D) + { + this.motionY /= 2.0D; + } + + this.motionY += 0.007000000216066837D; + } + + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)this.riddenByEntity; + float f = this.riddenByEntity.rotationYaw + -entitylivingbase.moveStrafing * 90.0F; + this.motionX += -Math.sin((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; + this.motionZ += Math.cos((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; + } + + d2 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d2 > 0.35D) + { + d4 = 0.35D / d2; + this.motionX *= d4; + this.motionZ *= d4; + d2 = 0.35D; + } + + if (d2 > d10 && this.speedMultiplier < 0.35D) + { + this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; + + if (this.speedMultiplier > 0.35D) + { + this.speedMultiplier = 0.35D; + } + } + else + { + this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; + + if (this.speedMultiplier < 0.07D) + { + this.speedMultiplier = 0.07D; + } + } + + int l; + + for (l = 0; l < 4; ++l) + { + int i1 = MathHelper.floor_double(this.posX + ((double)(l % 2) - 0.5D) * 0.8D); + j = MathHelper.floor_double(this.posZ + ((double)(l / 2) - 0.5D) * 0.8D); + + for (int j1 = 0; j1 < 2; ++j1) + { + int k = MathHelper.floor_double(this.posY) + j1; + Block block = this.worldObj.getBlock(i1, k, j); + + if (block == Blocks.snow_layer) + { + this.worldObj.setBlockToAir(i1, k, j); + this.isCollidedHorizontally = false; + } + else if (block == Blocks.waterlily) + { + this.worldObj.func_147480_a(i1, k, j, true); + this.isCollidedHorizontally = false; + } + } + } + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.isCollidedHorizontally && d10 > 0.2D) + { + if (!this.worldObj.isRemote && !this.isDead) + { + this.setDead(); + + for (l = 0; l < 3; ++l) + { + this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (l = 0; l < 2; ++l) + { + this.func_145778_a(Items.stick, 1, 0.0F); + } + } + } + else + { + this.motionX *= 0.9900000095367432D; + this.motionY *= 0.949999988079071D; + this.motionZ *= 0.9900000095367432D; + } + + this.rotationPitch = 0.0F; + d4 = (double)this.rotationYaw; + d11 = this.prevPosX - this.posX; + d12 = this.prevPosZ - this.posZ; + + if (d11 * d11 + d12 * d12 > 0.001D) + { + d4 = (double)((float)(Math.atan2(d12, d11) * 180.0D / Math.PI)); + } + + double d7 = MathHelper.wrapAngleTo180_double(d4 - (double)this.rotationYaw); + + if (d7 > 20.0D) + { + d7 = 20.0D; + } + + if (d7 < -20.0D) + { + d7 = -20.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + d7); + this.setRotation(this.rotationYaw, this.rotationPitch); + + if (!this.worldObj.isRemote) + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + + if (list != null && !list.isEmpty()) + { + for (int k1 = 0; k1 < list.size(); ++k1) + { + Entity entity = (Entity)list.get(k1); + + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBoat) + { + entity.applyEntityCollision(this); + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) + { + this.riddenByEntity = null; + } + } + } + } + + public void updateRiderPosition() + { + if (this.riddenByEntity != null) + { + double d0 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + double d1 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + this.riddenByEntity.setPosition(this.posX + d0, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + d1); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) {} + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player) + { + return true; + } + else + { + if (!this.worldObj.isRemote) + { + player.mountEntity(this); + } + + return true; + } + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (isOnGround) + { + if (this.fallDistance > 3.0F) + { + this.fall(this.fallDistance); + + if (!this.worldObj.isRemote && !this.isDead) + { + this.setDead(); + int l; + + for (l = 0; l < 3; ++l) + { + this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); + } + + for (l = 0; l < 2; ++l) + { + this.func_145778_a(Items.stick, 1, 0.0F); + } + } + + this.fallDistance = 0.0F; + } + } + else if (this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.water && distanceFallenThisTick < 0.0D) + { + this.fallDistance = (float)((double)this.fallDistance - distanceFallenThisTick); + } + } + + /** + * Sets the damage taken from the last hit. + */ + public void setDamageTaken(float p_70266_1_) + { + this.dataWatcher.updateObject(19, Float.valueOf(p_70266_1_)); + } + + /** + * Gets the damage taken from the last hit. + */ + public float getDamageTaken() + { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /** + * Sets the time to count down from since the last time entity was hit. + */ + public void setTimeSinceHit(int p_70265_1_) + { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70265_1_)); + } + + /** + * Gets the time since the last hit. + */ + public int getTimeSinceHit() + { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /** + * Sets the forward direction of the entity. + */ + public void setForwardDirection(int p_70269_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70269_1_)); + } + + /** + * Gets the forward direction of the entity. + */ + public int getForwardDirection() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /** + * true if no player in boat + */ + @SideOnly(Side.CLIENT) + public void setIsBoatEmpty(boolean p_70270_1_) + { + this.isBoatEmpty = p_70270_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderCrystal.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderCrystal.java new file mode 100644 index 0000000..e23e730 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderCrystal.java @@ -0,0 +1,124 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderEnd; + +public class EntityEnderCrystal extends Entity +{ + /** Used to create the rotation animation when rendering the crystal. */ + public int innerRotation; + public int health; + private static final String __OBFID = "CL_00001658"; + + public EntityEnderCrystal(World p_i1698_1_) + { + super(p_i1698_1_); + this.preventEntitySpawning = true; + this.setSize(2.0F, 2.0F); + this.yOffset = this.height / 2.0F; + this.health = 5; + this.innerRotation = this.rand.nextInt(100000); + } + + @SideOnly(Side.CLIENT) + public EntityEnderCrystal(World p_i1699_1_, double p_i1699_2_, double p_i1699_4_, double p_i1699_6_) + { + this(p_i1699_1_); + this.setPosition(p_i1699_2_, p_i1699_4_, p_i1699_6_); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(8, Integer.valueOf(this.health)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.innerRotation; + this.dataWatcher.updateObject(8, Integer.valueOf(this.health)); + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.worldObj.provider instanceof WorldProviderEnd && this.worldObj.getBlock(i, j, k) != Blocks.fire) + { + this.worldObj.setBlock(i, j, k, Blocks.fire); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) {} + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + if (!this.isDead && !this.worldObj.isRemote) + { + this.health = 0; + + if (this.health <= 0) + { + this.setDead(); + + if (!this.worldObj.isRemote) + { + this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true); + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderEye.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderEye.java new file mode 100644 index 0000000..22b5c1c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderEye.java @@ -0,0 +1,235 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityEnderEye extends Entity +{ + /** 'x' location the eye should float towards. */ + private double targetX; + /** 'y' location the eye should float towards. */ + private double targetY; + /** 'z' location the eye should float towards. */ + private double targetZ; + private int despawnTimer; + private boolean shatterOrDrop; + private static final String __OBFID = "CL_00001716"; + + public EntityEnderEye(World p_i1757_1_) + { + super(p_i1757_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D; + d1 *= 64.0D; + return distance < d1 * d1; + } + + public EntityEnderEye(World p_i1758_1_, double p_i1758_2_, double p_i1758_4_, double p_i1758_6_) + { + super(p_i1758_1_); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_); + this.yOffset = 0.0F; + } + + /** + * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args: + * strongholdX, strongholdY, strongholdZ + */ + public void moveTowards(double p_70220_1_, int p_70220_3_, double p_70220_4_) + { + double d2 = p_70220_1_ - this.posX; + double d3 = p_70220_4_ - this.posZ; + float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3); + + if (f > 12.0F) + { + this.targetX = this.posX + d2 / (double)f * 12.0D; + this.targetZ = this.posZ + d3 / (double)f * 12.0D; + this.targetY = this.posY + 8.0D; + } + else + { + this.targetX = p_70220_1_; + this.targetY = (double)p_70220_3_; + this.targetZ = p_70220_4_; + } + + this.despawnTimer = 0; + this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (!this.worldObj.isRemote) + { + double d0 = this.targetX - this.posX; + double d1 = this.targetZ - this.posZ; + float f1 = (float)Math.sqrt(d0 * d0 + d1 * d1); + float f2 = (float)Math.atan2(d1, d0); + double d2 = (double)f + (double)(f1 - f) * 0.0025D; + + if (f1 < 1.0F) + { + d2 *= 0.8D; + this.motionY *= 0.8D; + } + + this.motionX = Math.cos((double)f2) * d2; + this.motionZ = Math.sin((double)f2) * d2; + + if (this.posY < this.targetY) + { + this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; + } + else + { + this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; + } + } + + float f3 = 0.25F; + + if (this.isInWater()) + { + for (int i = 0; i < 4; ++i) + { + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); + } + } + else + { + this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)f3 - 0.5D, this.posZ - this.motionZ * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); + } + + if (!this.worldObj.isRemote) + { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; + + if (this.despawnTimer > 80 && !this.worldObj.isRemote) + { + this.setDead(); + + if (this.shatterOrDrop) + { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye))); + } + else + { + this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); + } + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) {} + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) {} + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderPearl.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderPearl.java new file mode 100644 index 0000000..01bd6cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityEnderPearl.java @@ -0,0 +1,76 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; + +public class EntityEnderPearl extends EntityThrowable +{ + private static final String __OBFID = "CL_00001725"; + + public EntityEnderPearl(World p_i1782_1_) + { + super(p_i1782_1_); + } + + public EntityEnderPearl(World p_i1783_1_, EntityLivingBase p_i1783_2_) + { + super(p_i1783_1_, p_i1783_2_); + } + + @SideOnly(Side.CLIENT) + public EntityEnderPearl(World p_i1784_1_, double p_i1784_2_, double p_i1784_4_, double p_i1784_6_) + { + super(p_i1784_1_, p_i1784_2_, p_i1784_4_, p_i1784_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + + for (int i = 0; i < 32; ++i) + { + this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); + } + + if (!this.worldObj.isRemote) + { + if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.getThrower(); + + if (entityplayermp.playerNetServerHandler.func_147362_b().isChannelOpen() && entityplayermp.worldObj == this.worldObj) + { + EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F); + if (!MinecraftForge.EVENT_BUS.post(event)) + { // Don't indent to lower patch size + if (this.getThrower().isRiding()) + { + this.getThrower().mountEntity((Entity)null); + } + + this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ); + this.getThrower().fallDistance = 0.0F; + this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage); + } + } + } + + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityExpBottle.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityExpBottle.java new file mode 100644 index 0000000..7ee48a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityExpBottle.java @@ -0,0 +1,65 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityExpBottle extends EntityThrowable +{ + private static final String __OBFID = "CL_00001726"; + + public EntityExpBottle(World p_i1785_1_) + { + super(p_i1785_1_); + } + + public EntityExpBottle(World p_i1786_1_, EntityLivingBase p_i1786_2_) + { + super(p_i1786_1_, p_i1786_2_); + } + + public EntityExpBottle(World p_i1787_1_, double p_i1787_2_, double p_i1787_4_, double p_i1787_6_) + { + super(p_i1787_1_, p_i1787_2_, p_i1787_4_, p_i1787_6_); + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() + { + return 0.07F; + } + + protected float func_70182_d() + { + return 0.7F; + } + + protected float func_70183_g() + { + return -20.0F; + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (!this.worldObj.isRemote) + { + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); + int i = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); + + while (i > 0) + { + int j = EntityXPOrb.getXPSplit(i); + i -= j; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, j)); + } + + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFallingBlock.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFallingBlock.java new file mode 100644 index 0000000..eb27733 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFallingBlock.java @@ -0,0 +1,329 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFallingBlock extends Entity +{ + private Block field_145811_e; + public int field_145814_a; + public int field_145812_b; + public boolean field_145813_c; + private boolean field_145808_f; + private boolean field_145809_g; + private int field_145815_h; + private float field_145816_i; + public NBTTagCompound field_145810_d; + private static final String __OBFID = "CL_00001668"; + + public EntityFallingBlock(World p_i1706_1_) + { + super(p_i1706_1_); + this.field_145813_c = true; + this.field_145815_h = 40; + this.field_145816_i = 2.0F; + } + + public EntityFallingBlock(World p_i45318_1_, double p_i45318_2_, double p_i45318_4_, double p_i45318_6_, Block p_i45318_8_) + { + this(p_i45318_1_, p_i45318_2_, p_i45318_4_, p_i45318_6_, p_i45318_8_, 0); + } + + public EntityFallingBlock(World p_i45319_1_, double p_i45319_2_, double p_i45319_4_, double p_i45319_6_, Block p_i45319_8_, int p_i45319_9_) + { + super(p_i45319_1_); + this.field_145813_c = true; + this.field_145815_h = 40; + this.field_145816_i = 2.0F; + this.field_145811_e = p_i45319_8_; + this.field_145814_a = p_i45319_9_; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i45319_2_, p_i45319_4_, p_i45319_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i45319_2_; + this.prevPosY = p_i45319_4_; + this.prevPosZ = p_i45319_6_; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() {} + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (this.field_145811_e.getMaterial() == Material.air) + { + this.setDead(); + } + else + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_145812_b; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (!this.worldObj.isRemote) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.field_145812_b == 1) + { + if (this.worldObj.getBlock(i, j, k) != this.field_145811_e) + { + this.setDead(); + return; + } + + this.worldObj.setBlockToAir(i, j, k); + } + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + + if (this.worldObj.getBlock(i, j, k) != Blocks.piston_extension) + { + this.setDead(); + + if (!this.field_145808_f && this.worldObj.canPlaceEntityOnSide(this.field_145811_e, i, j, k, true, 1, (Entity)null, (ItemStack)null) && !BlockFalling.func_149831_e(this.worldObj, i, j - 1, k) && this.worldObj.setBlock(i, j, k, this.field_145811_e, this.field_145814_a, 3)) + { + if (this.field_145811_e instanceof BlockFalling) + { + ((BlockFalling)this.field_145811_e).func_149828_a(this.worldObj, i, j, k, this.field_145814_a); + } + + if (this.field_145810_d != null && this.field_145811_e instanceof ITileEntityProvider) + { + TileEntity tileentity = this.worldObj.getTileEntity(i, j, k); + + if (tileentity != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + tileentity.writeToNBT(nbttagcompound); + Iterator iterator = this.field_145810_d.func_150296_c().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTBase nbtbase = this.field_145810_d.getTag(s); + + if (!s.equals("x") && !s.equals("y") && !s.equals("z")) + { + nbttagcompound.setTag(s, nbtbase.copy()); + } + } + + tileentity.readFromNBT(nbttagcompound); + tileentity.markDirty(); + } + } + } + else if (this.field_145813_c && !this.field_145808_f) + { + this.entityDropItem(new ItemStack(this.field_145811_e, 1, this.field_145811_e.damageDropped(this.field_145814_a)), 0.0F); + } + } + } + else if (this.field_145812_b > 100 && !this.worldObj.isRemote && (j < 1 || j > 256) || this.field_145812_b > 600) + { + if (this.field_145813_c) + { + this.entityDropItem(new ItemStack(this.field_145811_e, 1, this.field_145811_e.damageDropped(this.field_145814_a)), 0.0F); + } + + this.setDead(); + } + } + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + if (this.field_145809_g) + { + int i = MathHelper.ceiling_float_int(distance - 1.0F); + + if (i > 0) + { + ArrayList arraylist = new ArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox)); + boolean flag = this.field_145811_e == Blocks.anvil; + DamageSource damagesource = flag ? DamageSource.anvil : DamageSource.fallingBlock; + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + entity.attackEntityFrom(damagesource, (float)Math.min(MathHelper.floor_float((float)i * this.field_145816_i), this.field_145815_h)); + } + + if (flag && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)i * 0.05D) + { + int j = this.field_145814_a >> 2; + int k = this.field_145814_a & 3; + ++j; + + if (j > 2) + { + this.field_145808_f = true; + } + else + { + this.field_145814_a = k | j << 2; + } + } + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setByte("Tile", (byte)Block.getIdFromBlock(this.field_145811_e)); + tagCompound.setInteger("TileID", Block.getIdFromBlock(this.field_145811_e)); + tagCompound.setByte("Data", (byte)this.field_145814_a); + tagCompound.setByte("Time", (byte)this.field_145812_b); + tagCompound.setBoolean("DropItem", this.field_145813_c); + tagCompound.setBoolean("HurtEntities", this.field_145809_g); + tagCompound.setFloat("FallHurtAmount", this.field_145816_i); + tagCompound.setInteger("FallHurtMax", this.field_145815_h); + + if (this.field_145810_d != null) + { + tagCompound.setTag("TileEntityData", this.field_145810_d); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + if (tagCompund.hasKey("TileID", 99)) + { + this.field_145811_e = Block.getBlockById(tagCompund.getInteger("TileID")); + } + else + { + this.field_145811_e = Block.getBlockById(tagCompund.getByte("Tile") & 255); + } + + this.field_145814_a = tagCompund.getByte("Data") & 255; + this.field_145812_b = tagCompund.getByte("Time") & 255; + + if (tagCompund.hasKey("HurtEntities", 99)) + { + this.field_145809_g = tagCompund.getBoolean("HurtEntities"); + this.field_145816_i = tagCompund.getFloat("FallHurtAmount"); + this.field_145815_h = tagCompund.getInteger("FallHurtMax"); + } + else if (this.field_145811_e == Blocks.anvil) + { + this.field_145809_g = true; + } + + if (tagCompund.hasKey("DropItem", 99)) + { + this.field_145813_c = tagCompund.getBoolean("DropItem"); + } + + if (tagCompund.hasKey("TileEntityData", 10)) + { + this.field_145810_d = tagCompund.getCompoundTag("TileEntityData"); + } + + if (this.field_145811_e.getMaterial() == Material.air) + { + this.field_145811_e = Blocks.sand; + } + } + + public void func_145806_a(boolean p_145806_1_) + { + this.field_145809_g = p_145806_1_; + } + + public void addEntityCrashInfo(CrashReportCategory category) + { + super.addEntityCrashInfo(category); + category.addCrashSection("Immitating block ID", Integer.valueOf(Block.getIdFromBlock(this.field_145811_e))); + category.addCrashSection("Immitating block data", Integer.valueOf(this.field_145814_a)); + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + @SideOnly(Side.CLIENT) + public World func_145807_e() + { + return this.worldObj; + } + + /** + * Return whether this entity should be rendered as on fire. + */ + @SideOnly(Side.CLIENT) + public boolean canRenderOnFire() + { + return false; + } + + public Block func_145805_f() + { + return this.field_145811_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFireworkRocket.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFireworkRocket.java new file mode 100644 index 0000000..9e1ba1f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityFireworkRocket.java @@ -0,0 +1,226 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityFireworkRocket extends Entity +{ + /** The age of the firework in ticks. */ + private int fireworkAge; + /** The lifetime of the firework in ticks. When the age reaches the lifetime the firework explodes. */ + private int lifetime; + private static final String __OBFID = "CL_00001718"; + + public EntityFireworkRocket(World p_i1762_1_) + { + super(p_i1762_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() + { + this.dataWatcher.addObjectByDataType(8, 5); + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + return distance < 4096.0D; + } + + public EntityFireworkRocket(World p_i1763_1_, double p_i1763_2_, double p_i1763_4_, double p_i1763_6_, ItemStack p_i1763_8_) + { + super(p_i1763_1_); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1763_2_, p_i1763_4_, p_i1763_6_); + this.yOffset = 0.0F; + int i = 1; + + if (p_i1763_8_ != null && p_i1763_8_.hasTagCompound()) + { + this.dataWatcher.updateObject(8, p_i1763_8_); + NBTTagCompound nbttagcompound = p_i1763_8_.getTagCompound(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Fireworks"); + + if (nbttagcompound1 != null) + { + i += nbttagcompound1.getByte("Flight"); + } + } + + this.motionX = this.rand.nextGaussian() * 0.001D; + this.motionZ = this.rand.nextGaussian() * 0.001D; + this.motionY = 0.05D; + this.lifetime = 10 * i + this.rand.nextInt(6) + this.rand.nextInt(7); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + this.motionX *= 1.15D; + this.motionZ *= 1.15D; + this.motionY += 0.04D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + + if (this.fireworkAge == 0) + { + this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); + } + + ++this.fireworkAge; + + if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) + { + this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D); + } + + if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) + { + this.worldObj.setEntityState(this, (byte)17); + this.setDead(); + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 17 && this.worldObj.isRemote) + { + ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); + NBTTagCompound nbttagcompound = null; + + if (itemstack != null && itemstack.hasTagCompound()) + { + nbttagcompound = itemstack.getTagCompound().getCompoundTag("Fireworks"); + } + + this.worldObj.makeFireworks(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, nbttagcompound); + } + + super.handleHealthUpdate(p_70103_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setInteger("Life", this.fireworkAge); + tagCompound.setInteger("LifeTime", this.lifetime); + ItemStack itemstack = this.dataWatcher.getWatchableObjectItemStack(8); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + itemstack.writeToNBT(nbttagcompound1); + tagCompound.setTag("FireworksItem", nbttagcompound1); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.fireworkAge = tagCompund.getInteger("Life"); + this.lifetime = tagCompund.getInteger("LifeTime"); + NBTTagCompound nbttagcompound1 = tagCompund.getCompoundTag("FireworksItem"); + + if (nbttagcompound1 != null) + { + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound1); + + if (itemstack != null) + { + this.dataWatcher.updateObject(8, itemstack); + } + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return super.getBrightness(p_70013_1_); + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return super.getBrightnessForRender(p_70070_1_); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItem.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItem.java new file mode 100644 index 0000000..1adf9f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItem.java @@ -0,0 +1,510 @@ +package net.minecraft.entity.item; + +import java.util.Iterator; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.item.ItemExpireEvent; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.Event.Result; + +public class EntityItem extends Entity +{ + private static final Logger logger = LogManager.getLogger(); + /** The age of this EntityItem (used to animate it up and down as well as expire it) */ + public int age; + public int delayBeforeCanPickup; + /** The health of this EntityItem. (For example, damage for tools) */ + private int health; + private String field_145801_f; + private String field_145802_g; + /** The EntityItem's random initial float height. */ + public float hoverStart; + private static final String __OBFID = "CL_00001669"; + + /** + * The maximum age of this EntityItem. The item is expired once this is reached. + */ + public int lifespan = 6000; + + public EntityItem(World worldIn, double x, double y, double z) + { + super(worldIn); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + this.setPosition(x, y, z); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + this.motionY = 0.20000000298023224D; + this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); + } + + public EntityItem(World worldIn, double x, double y, double z, ItemStack stack) + { + this(worldIn, x, y, z); + this.setEntityItemStack(stack); + this.lifespan = (stack.getItem() == null ? 6000 : stack.getItem().getEntityLifespan(stack, worldIn)); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + public EntityItem(World p_i1711_1_) + { + super(p_i1711_1_); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + } + + protected void entityInit() + { + this.getDataWatcher().addObjectByDataType(10, 5); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + ItemStack stack = this.getDataWatcher().getWatchableObjectItemStack(10); + if (stack != null && stack.getItem() != null) + { + if (stack.getItem().onEntityItemUpdate(this)) + { + return; + } + } + + if (this.getEntityItem() == null) + { + this.setDead(); + } + else + { + super.onUpdate(); + + if (this.delayBeforeCanPickup > 0) + { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.noClip = this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean flag = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; + + if (flag || this.ticksExisted % 25 == 0) + { + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava) + { + this.motionY = 0.20000000298023224D; + this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + if (!this.worldObj.isRemote) + { + this.searchForOtherItemsNearby(); + } + } + + float f = 0.98F; + + if (this.onGround) + { + f = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.98F; + } + + this.motionX *= (double)f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)f; + + if (this.onGround) + { + this.motionY *= -0.5D; + } + + ++this.age; + + ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); + + if (!this.worldObj.isRemote && this.age >= lifespan) + { + if (item != null) + { + ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj))); + if (MinecraftForge.EVENT_BUS.post(event)) + { + lifespan += event.extraLife; + } + else + { + this.setDead(); + } + } + else + { + this.setDead(); + } + } + + if (item != null && item.stackSize <= 0) + { + this.setDead(); + } + } + } + + /** + * Looks for other itemstacks nearby and tries to stack them together + */ + private void searchForOtherItemsNearby() + { + Iterator iterator = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.5D, 0.0D, 0.5D)).iterator(); + + while (iterator.hasNext()) + { + EntityItem entityitem = (EntityItem)iterator.next(); + this.combineItems(entityitem); + } + } + + /** + * Tries to merge this item with the item passed as the parameter. Returns true if successful. Either this item or + * the other item will be removed from the world. + */ + public boolean combineItems(EntityItem p_70289_1_) + { + if (p_70289_1_ == this) + { + return false; + } + else if (p_70289_1_.isEntityAlive() && this.isEntityAlive()) + { + ItemStack itemstack = this.getEntityItem(); + ItemStack itemstack1 = p_70289_1_.getEntityItem(); + + if (itemstack1.getItem() != itemstack.getItem()) + { + return false; + } + else if (itemstack1.hasTagCompound() ^ itemstack.hasTagCompound()) + { + return false; + } + else if (itemstack1.hasTagCompound() && !itemstack1.getTagCompound().equals(itemstack.getTagCompound())) + { + return false; + } + else if (itemstack1.getItem() == null) + { + return false; + } + else if (itemstack1.getItem().getHasSubtypes() && itemstack1.getItemDamage() != itemstack.getItemDamage()) + { + return false; + } + else if (itemstack1.stackSize < itemstack.stackSize) + { + return p_70289_1_.combineItems(this); + } + else if (itemstack1.stackSize + itemstack.stackSize > itemstack1.getMaxStackSize()) + { + return false; + } + else + { + itemstack1.stackSize += itemstack.stackSize; + p_70289_1_.delayBeforeCanPickup = Math.max(p_70289_1_.delayBeforeCanPickup, this.delayBeforeCanPickup); + p_70289_1_.age = Math.min(p_70289_1_.age, this.age); + p_70289_1_.setEntityItemStack(itemstack1); + this.setDead(); + return true; + } + } + else + { + return false; + } + } + + /** + * sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five). Used when + * items are dropped from players in creative mode + */ + public void setAgeToCreativeDespawnTime() + { + this.age = 4800; + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() + { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int amount) + { + this.attackEntityFrom(DamageSource.inFire, (float)amount); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion()) + { + return false; + } + else + { + this.setBeenAttacked(); + this.health = (int)((float)this.health - amount); + + if (this.health <= 0) + { + this.setDead(); + } + + return false; + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("Health", (short)((byte)this.health)); + tagCompound.setShort("Age", (short)this.age); + tagCompound.setInteger("Lifespan", lifespan); + + if (this.func_145800_j() != null) + { + tagCompound.setString("Thrower", this.field_145801_f); + } + + if (this.func_145798_i() != null) + { + tagCompound.setString("Owner", this.field_145802_g); + } + + if (this.getEntityItem() != null) + { + tagCompound.setTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.health = tagCompund.getShort("Health") & 255; + this.age = tagCompund.getShort("Age"); + + if (tagCompund.hasKey("Owner")) + { + this.field_145802_g = tagCompund.getString("Owner"); + } + + if (tagCompund.hasKey("Thrower")) + { + this.field_145801_f = tagCompund.getString("Thrower"); + } + + NBTTagCompound nbttagcompound1 = tagCompund.getCompoundTag("Item"); + this.setEntityItemStack(ItemStack.loadItemStackFromNBT(nbttagcompound1)); + + ItemStack item = getDataWatcher().getWatchableObjectItemStack(10); + + if (item == null || item.stackSize <= 0) + { + this.setDead(); + } + + if (tagCompund.hasKey("Lifespan")) + { + lifespan = tagCompund.getInteger("Lifespan"); + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote) + { + if (this.delayBeforeCanPickup > 0) + { + return; + } + + EntityItemPickupEvent event = new EntityItemPickupEvent(entityIn, this); + + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + + ItemStack itemstack = this.getEntityItem(); + int i = itemstack.stackSize; + + if (this.delayBeforeCanPickup <= 0 && (this.field_145802_g == null || lifespan - this.age <= 200 || this.field_145802_g.equals(entityIn.getCommandSenderName())) && (event.getResult() == Result.ALLOW || i <= 0 || entityIn.inventory.addItemStackToInventory(itemstack))) + { + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log)) + { + entityIn.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log2)) + { + entityIn.triggerAchievement(AchievementList.mineWood); + } + + if (itemstack.getItem() == Items.leather) + { + entityIn.triggerAchievement(AchievementList.killCow); + } + + if (itemstack.getItem() == Items.diamond) + { + entityIn.triggerAchievement(AchievementList.diamonds); + } + + if (itemstack.getItem() == Items.blaze_rod) + { + entityIn.triggerAchievement(AchievementList.blazeRod); + } + + if (itemstack.getItem() == Items.diamond && this.func_145800_j() != null) + { + EntityPlayer entityplayer1 = this.worldObj.getPlayerEntityByName(this.func_145800_j()); + + if (entityplayer1 != null && entityplayer1 != entityIn) + { + entityplayer1.triggerAchievement(AchievementList.field_150966_x); + } + } + + FMLCommonHandler.instance().firePlayerItemPickupEvent(entityIn, this); + + this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityIn.onItemPickup(this, i); + + if (itemstack.stackSize <= 0) + { + this.setDead(); + } + } + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int dimensionId) + { + super.travelToDimension(dimensionId); + + if (!this.worldObj.isRemote) + { + this.searchForOtherItemsNearby(); + } + } + + /** + * Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an + * ItemStack containing Block.stone) + */ + public ItemStack getEntityItem() + { + ItemStack itemstack = this.getDataWatcher().getWatchableObjectItemStack(10); + return itemstack == null ? new ItemStack(Blocks.stone) : itemstack; + } + + /** + * Sets the ItemStack for this entity + */ + public void setEntityItemStack(ItemStack p_92058_1_) + { + this.getDataWatcher().updateObject(10, p_92058_1_); + this.getDataWatcher().setObjectWatched(10); + } + + public String func_145798_i() + { + return this.field_145802_g; + } + + public void func_145797_a(String p_145797_1_) + { + this.field_145802_g = p_145797_1_; + } + + public String func_145800_j() + { + return this.field_145801_f; + } + + public void func_145799_b(String p_145799_1_) + { + this.field_145801_f = p_145799_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItemFrame.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItemFrame.java new file mode 100644 index 0000000..c64ca14 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityItemFrame.java @@ -0,0 +1,232 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class EntityItemFrame extends EntityHanging +{ + /** Chance for this item frame's item to drop from the frame. */ + private float itemDropChance = 1.0F; + private static final String __OBFID = "CL_00001547"; + + public EntityItemFrame(World p_i1590_1_) + { + super(p_i1590_1_); + } + + public EntityItemFrame(World p_i1591_1_, int p_i1591_2_, int p_i1591_3_, int p_i1591_4_, int p_i1591_5_) + { + super(p_i1591_1_, p_i1591_2_, p_i1591_3_, p_i1591_4_, p_i1591_5_); + this.setDirection(p_i1591_5_); + } + + protected void entityInit() + { + this.getDataWatcher().addObjectByDataType(2, 5); + this.getDataWatcher().addObject(3, Byte.valueOf((byte)0)); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (this.getDisplayedItem() != null) + { + if (!this.worldObj.isRemote) + { + this.func_146065_b(source.getEntity(), false); + this.setDisplayedItem((ItemStack)null); + } + + return true; + } + else + { + return super.attackEntityFrom(source, amount); + } + } + + public int getWidthPixels() + { + return 9; + } + + public int getHeightPixels() + { + return 9; + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = 16.0D; + d1 *= 64.0D * this.renderDistanceWeight; + return distance < d1 * d1; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) + { + this.func_146065_b(p_110128_1_, true); + } + + public void func_146065_b(Entity p_146065_1_, boolean p_146065_2_) + { + ItemStack itemstack = this.getDisplayedItem(); + + if (p_146065_1_ instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_146065_1_; + + if (entityplayer.capabilities.isCreativeMode) + { + this.removeFrameFromMap(itemstack); + return; + } + } + + if (p_146065_2_) + { + this.entityDropItem(new ItemStack(Items.item_frame), 0.0F); + } + + if (itemstack != null && this.rand.nextFloat() < this.itemDropChance) + { + itemstack = itemstack.copy(); + this.removeFrameFromMap(itemstack); + this.entityDropItem(itemstack, 0.0F); + } + } + + /** + * Removes the dot representing this frame's position from the map when the item frame is broken. + */ + private void removeFrameFromMap(ItemStack p_110131_1_) + { + if (p_110131_1_ != null) + { + if (p_110131_1_.getItem() == Items.filled_map) + { + MapData mapdata = ((ItemMap)p_110131_1_.getItem()).getMapData(p_110131_1_, this.worldObj); + mapdata.playersVisibleOnMap.remove("frame-" + this.getEntityId()); + } + + p_110131_1_.setItemFrame((EntityItemFrame)null); + } + } + + public ItemStack getDisplayedItem() + { + return this.getDataWatcher().getWatchableObjectItemStack(2); + } + + public void setDisplayedItem(ItemStack p_82334_1_) + { + if (p_82334_1_ != null) + { + p_82334_1_ = p_82334_1_.copy(); + p_82334_1_.stackSize = 1; + p_82334_1_.setItemFrame(this); + } + + this.getDataWatcher().updateObject(2, p_82334_1_); + this.getDataWatcher().setObjectWatched(2); + } + + /** + * Return the rotation of the item currently on this frame. + */ + public int getRotation() + { + return this.getDataWatcher().getWatchableObjectByte(3); + } + + public void setItemRotation(int p_82336_1_) + { + this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(p_82336_1_ % 4))); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + if (this.getDisplayedItem() != null) + { + tagCompound.setTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); + tagCompound.setByte("ItemRotation", (byte)this.getRotation()); + tagCompound.setFloat("ItemDropChance", this.itemDropChance); + } + + super.writeEntityToNBT(tagCompound); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + NBTTagCompound nbttagcompound1 = tagCompund.getCompoundTag("Item"); + + if (nbttagcompound1 != null && !nbttagcompound1.hasNoTags()) + { + this.setDisplayedItem(ItemStack.loadItemStackFromNBT(nbttagcompound1)); + this.setItemRotation(tagCompund.getByte("ItemRotation")); + + if (tagCompund.hasKey("ItemDropChance", 99)) + { + this.itemDropChance = tagCompund.getFloat("ItemDropChance"); + } + } + + super.readEntityFromNBT(tagCompund); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if (this.getDisplayedItem() == null) + { + ItemStack itemstack = player.getHeldItem(); + + if (itemstack != null && !this.worldObj.isRemote) + { + this.setDisplayedItem(itemstack); + + if (!player.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + } + } + else if (!this.worldObj.isRemote) + { + this.setItemRotation(this.getRotation() + 1); + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecart.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecart.java new file mode 100644 index 0000000..2193aff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecart.java @@ -0,0 +1,1392 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.ai.EntityMinecartMobSpawner; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.IMinecartCollisionHandler; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.minecart.MinecartCollisionEvent; +import net.minecraftforge.event.entity.minecart.MinecartUpdateEvent; + +public abstract class EntityMinecart extends Entity +{ + private boolean isInReverse; + private String entityName; + /** Minecart rotational logic matrix */ + private static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; + /** appears to be the progress of the turn */ + private int turnProgress; + private double minecartX; + private double minecartY; + private double minecartZ; + private double minecartYaw; + private double minecartPitch; + @SideOnly(Side.CLIENT) + private double velocityX; + @SideOnly(Side.CLIENT) + private double velocityY; + @SideOnly(Side.CLIENT) + private double velocityZ; + private static final String __OBFID = "CL_00001670"; + + /* Forge: Minecart Compatibility Layer Integration. */ + public static float defaultMaxSpeedAirLateral = 0.4f; + public static float defaultMaxSpeedAirVertical = -1f; + public static double defaultDragAir = 0.94999998807907104D; + protected boolean canUseRail = true; + protected boolean canBePushed = true; + private static IMinecartCollisionHandler collisionHandler = null; + + /* Instance versions of the above physics properties */ + private float currentSpeedRail = getMaxCartSpeedOnRail(); + protected float maxSpeedAirLateral = defaultMaxSpeedAirLateral; + protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical; + protected double dragAir = defaultDragAir; + + public EntityMinecart(World p_i1712_1_) + { + super(p_i1712_1_); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.7F); + this.yOffset = this.height / 2.0F; + } + + /** + * Creates a new minecart of the specified type in the specified location in the given world. par0World - world to + * create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for + * MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for + * a standard empty minecart + */ + public static EntityMinecart createMinecart(World p_94090_0_, double p_94090_1_, double p_94090_3_, double p_94090_5_, int p_94090_7_) + { + switch (p_94090_7_) + { + case 1: + return new EntityMinecartChest(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + case 2: + return new EntityMinecartFurnace(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + case 3: + return new EntityMinecartTNT(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + case 4: + return new EntityMinecartMobSpawner(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + case 5: + return new EntityMinecartHopper(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + case 6: + return new EntityMinecartCommandBlock(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + default: + return new EntityMinecartEmpty(p_94090_0_, p_94090_1_, p_94090_3_, p_94090_5_); + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(17, new Integer(0)); + this.dataWatcher.addObject(18, new Integer(1)); + this.dataWatcher.addObject(19, new Float(0.0F)); + this.dataWatcher.addObject(20, new Integer(0)); + this.dataWatcher.addObject(21, new Integer(6)); + this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); + } + + /** + * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be + * pushable on contact, like boats or minecarts. + */ + public AxisAlignedBB getCollisionBox(Entity entityIn) + { + if (getCollisionHandler() != null) + { + return getCollisionHandler().getCollisionBox(this, entityIn); + } + return entityIn.canBePushed() ? entityIn.boundingBox : null; + } + + /** + * returns the bounding box for this entity + */ + public AxisAlignedBB getBoundingBox() + { + if (getCollisionHandler() != null) + { + return getCollisionHandler().getBoundingBox(this); + } + return null; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return canBePushed; + } + + public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) + { + this(p_i1713_1_); + this.setPosition(p_i1713_2_, p_i1713_4_, p_i1713_6_); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.prevPosX = p_i1713_2_; + this.prevPosY = p_i1713_4_; + this.prevPosZ = p_i1713_6_; + } + + /** + * Returns the Y offset from the entity's position for any entity riding this one. + */ + public double getMountedYOffset() + { + return (double)this.height * 0.0D - 0.30000001192092896D; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (!this.worldObj.isRemote && !this.isDead) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setBeenAttacked(); + this.setDamage(this.getDamage() + amount * 10.0F); + boolean flag = source.getEntity() instanceof EntityPlayer && ((EntityPlayer)source.getEntity()).capabilities.isCreativeMode; + + if (flag || this.getDamage() > 40.0F) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (flag && !this.hasCustomInventoryName()) + { + this.setDead(); + } + else + { + this.killMinecart(source); + } + } + + return true; + } + } + else + { + return true; + } + } + + public void killMinecart(DamageSource p_94095_1_) + { + this.setDead(); + ItemStack itemstack = new ItemStack(Items.minecart, 1); + + if (this.entityName != null) + { + itemstack.setStackDisplayName(this.entityName); + } + + this.entityDropItem(itemstack, 0.0F); + } + + /** + * Setups the entity to do the hurt animation. Only used by packets in multiplayer. + */ + @SideOnly(Side.CLIENT) + public void performHurtAnimation() + { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(this.getDamage() + this.getDamage() * 10.0F); + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + super.setDead(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (this.getRollingAmplitude() > 0) + { + this.setRollingAmplitude(this.getRollingAmplitude() - 1); + } + + if (this.getDamage() > 0.0F) + { + this.setDamage(this.getDamage() - 1.0F); + } + + if (this.posY < -64.0D) + { + this.kill(); + } + + int i; + + if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) + { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer minecraftserver = ((WorldServer)this.worldObj).func_73046_m(); + i = this.getMaxInPortalTime(); + + if (this.inPortal) + { + if (minecraftserver.getAllowNether()) + { + if (this.ridingEntity == null && this.portalCounter++ >= i) + { + this.portalCounter = i; + this.timeUntilPortal = this.getPortalCooldown(); + byte b0; + + if (this.worldObj.provider.dimensionId == -1) + { + b0 = 0; + } + else + { + b0 = -1; + } + + this.travelToDimension(b0); + } + + this.inPortal = false; + } + } + else + { + if (this.portalCounter > 0) + { + this.portalCounter -= 4; + } + + if (this.portalCounter < 0) + { + this.portalCounter = 0; + } + } + + if (this.timeUntilPortal > 0) + { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + + if (this.worldObj.isRemote) + { + if (this.turnProgress > 0) + { + double d6 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; + double d7 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; + double d1 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; + double d3 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d3 / (double)this.turnProgress); + this.rotationPitch = (float)((double)this.rotationPitch + (this.minecartPitch - (double)this.rotationPitch) / (double)this.turnProgress); + --this.turnProgress; + this.setPosition(d6, d7, d1); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + } + else + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + int l = MathHelper.floor_double(this.posX); + i = MathHelper.floor_double(this.posY); + int i1 = MathHelper.floor_double(this.posZ); + + if (BlockRailBase.func_150049_b_(this.worldObj, l, i - 1, i1)) + { + --i; + } + + double d0 = 0.4D; + double d2 = 0.0078125D; + Block block = this.worldObj.getBlock(l, i, i1); + + if (canUseRail() && BlockRailBase.func_150051_a(block)) + { + float railMaxSpeed = ((BlockRailBase)block).getRailMaxSpeed(worldObj, this, l, i, i1); + double maxSpeed = Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); + this.func_145821_a(l, i, i1, maxSpeed, getSlopeAdjustment(), block, ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, l, i, i1)); + + if (block == Blocks.activator_rail) + { + this.onActivatorRailPass(l, i, i1, (worldObj.getBlockMetadata(l, i, i1) & 8) != 0); + } + } + else + { + this.func_94088_b(onGround ? d0 : getMaxSpeedAirLateral()); + } + + this.func_145775_I(); + this.rotationPitch = 0.0F; + double d8 = this.prevPosX - this.posX; + double d4 = this.prevPosZ - this.posZ; + + if (d8 * d8 + d4 * d4 > 0.001D) + { + this.rotationYaw = (float)(Math.atan2(d4, d8) * 180.0D / Math.PI); + + if (this.isInReverse) + { + this.rotationYaw += 180.0F; + } + } + + double d5 = (double)MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); + + if (d5 < -170.0D || d5 >= 170.0D) + { + this.rotationYaw += 180.0F; + this.isInReverse = !this.isInReverse; + } + + this.setRotation(this.rotationYaw, this.rotationPitch); + + AxisAlignedBB box; + if (getCollisionHandler() != null) + { + box = getCollisionHandler().getMinecartCollisionBox(this); + } + else + { + box = boundingBox.expand(0.2D, 0.0D, 0.2D); + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, box); + + if (list != null && !list.isEmpty()) + { + for (int k = 0; k < list.size(); ++k) + { + Entity entity = (Entity)list.get(k); + + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityMinecart) + { + entity.applyEntityCollision(this); + } + } + } + + if (this.riddenByEntity != null && this.riddenByEntity.isDead) + { + if (this.riddenByEntity.ridingEntity == this) + { + this.riddenByEntity.ridingEntity = null; + } + + this.riddenByEntity = null; + } + + MinecraftForge.EVENT_BUS.post(new MinecartUpdateEvent(this, l, i, i1)); + } + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) {} + + protected void func_94088_b(double p_94088_1_) + { + if (this.motionX < -p_94088_1_) + { + this.motionX = -p_94088_1_; + } + + if (this.motionX > p_94088_1_) + { + this.motionX = p_94088_1_; + } + + if (this.motionZ < -p_94088_1_) + { + this.motionZ = -p_94088_1_; + } + + if (this.motionZ > p_94088_1_) + { + this.motionZ = p_94088_1_; + } + + double moveY = motionY; + if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) + { + moveY = getMaxSpeedAirVertical(); + if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) + { + moveY = 0.15f; + motionY = moveY; + } + } + + if (this.onGround) + { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, moveY, this.motionZ); + + if (!this.onGround) + { + this.motionX *= getDragAir(); + this.motionY *= getDragAir(); + this.motionZ *= getDragAir(); + } + } + + protected void func_145821_a(int p_145821_1_, int p_145821_2_, int p_145821_3_, double p_145821_4_, double p_145821_6_, Block p_145821_8_, int p_145821_9_) + { + this.fallDistance = 0.0F; + Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ); + this.posY = (double)p_145821_2_; + boolean flag = false; + boolean flag1 = false; + + if (p_145821_8_ == Blocks.golden_rail) + { + flag = (worldObj.getBlockMetadata(p_145821_1_, p_145821_2_, p_145821_3_) & 8) != 0; + flag1 = !flag; + } + + if (((BlockRailBase)p_145821_8_).isPowered()) + { + p_145821_9_ &= 7; + } + + if (p_145821_9_ >= 2 && p_145821_9_ <= 5) + { + this.posY = (double)(p_145821_2_ + 1); + } + + if (p_145821_9_ == 2) + { + this.motionX -= p_145821_6_; + } + + if (p_145821_9_ == 3) + { + this.motionX += p_145821_6_; + } + + if (p_145821_9_ == 4) + { + this.motionZ += p_145821_6_; + } + + if (p_145821_9_ == 5) + { + this.motionZ -= p_145821_6_; + } + + int[][] aint = matrix[p_145821_9_]; + double d2 = (double)(aint[1][0] - aint[0][0]); + double d3 = (double)(aint[1][2] - aint[0][2]); + double d4 = Math.sqrt(d2 * d2 + d3 * d3); + double d5 = this.motionX * d2 + this.motionZ * d3; + + if (d5 < 0.0D) + { + d2 = -d2; + d3 = -d3; + } + + double d6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d6 > 2.0D) + { + d6 = 2.0D; + } + + this.motionX = d6 * d2 / d4; + this.motionZ = d6 * d3 / d4; + double d7; + double d8; + double d9; + double d10; + + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) + { + d7 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; + + if (d7 > 0.0D) + { + d8 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + d9 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + d10 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (d10 < 0.01D) + { + this.motionX += d8 * 0.1D; + this.motionZ += d9 * 0.1D; + flag1 = false; + } + } + } + + if (flag1 && shouldDoRailFunctions()) + { + d7 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d7 < 0.03D) + { + this.motionX *= 0.0D; + this.motionY *= 0.0D; + this.motionZ *= 0.0D; + } + else + { + this.motionX *= 0.5D; + this.motionY *= 0.0D; + this.motionZ *= 0.5D; + } + } + + d7 = 0.0D; + d8 = (double)p_145821_1_ + 0.5D + (double)aint[0][0] * 0.5D; + d9 = (double)p_145821_3_ + 0.5D + (double)aint[0][2] * 0.5D; + d10 = (double)p_145821_1_ + 0.5D + (double)aint[1][0] * 0.5D; + double d11 = (double)p_145821_3_ + 0.5D + (double)aint[1][2] * 0.5D; + d2 = d10 - d8; + d3 = d11 - d9; + double d12; + double d13; + + if (d2 == 0.0D) + { + this.posX = (double)p_145821_1_ + 0.5D; + d7 = this.posZ - (double)p_145821_3_; + } + else if (d3 == 0.0D) + { + this.posZ = (double)p_145821_3_ + 0.5D; + d7 = this.posX - (double)p_145821_1_; + } + else + { + d12 = this.posX - d8; + d13 = this.posZ - d9; + d7 = (d12 * d2 + d13 * d3) * 2.0D; + } + + this.posX = d8 + d2 * d7; + this.posZ = d9 + d3 * d7; + this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); + + moveMinecartOnRail(p_145821_1_, p_145821_2_, p_145821_3_, p_145821_4_); + + if (aint[0][1] != 0 && MathHelper.floor_double(this.posX) - p_145821_1_ == aint[0][0] && MathHelper.floor_double(this.posZ) - p_145821_3_ == aint[0][2]) + { + this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); + } + else if (aint[1][1] != 0 && MathHelper.floor_double(this.posX) - p_145821_1_ == aint[1][0] && MathHelper.floor_double(this.posZ) - p_145821_3_ == aint[1][2]) + { + this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ); + } + + this.applyDrag(); + Vec3 vec31 = this.func_70489_a(this.posX, this.posY, this.posZ); + + if (vec31 != null && vec3 != null) + { + double d14 = (vec3.yCoord - vec31.yCoord) * 0.05D; + d6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d6 > 0.0D) + { + this.motionX = this.motionX / d6 * (d6 + d14); + this.motionZ = this.motionZ / d6 * (d6 + d14); + } + + this.setPosition(this.posX, vec31.yCoord, this.posZ); + } + + int j1 = MathHelper.floor_double(this.posX); + int i1 = MathHelper.floor_double(this.posZ); + + if (j1 != p_145821_1_ || i1 != p_145821_3_) + { + d6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.motionX = d6 * (double)(j1 - p_145821_1_); + this.motionZ = d6 * (double)(i1 - p_145821_3_); + } + + if(shouldDoRailFunctions()) + { + ((BlockRailBase)p_145821_8_).onMinecartPass(worldObj, this, p_145821_1_, p_145821_2_, p_145821_3_); + } + + if (flag && shouldDoRailFunctions()) + { + double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (d15 > 0.01D) + { + double d16 = 0.06D; + this.motionX += this.motionX / d15 * d16; + this.motionZ += this.motionZ / d15 * d16; + } + else if (p_145821_9_ == 1) + { + if (this.worldObj.getBlock(p_145821_1_ - 1, p_145821_2_, p_145821_3_).isNormalCube()) + { + this.motionX = 0.02D; + } + else if (this.worldObj.getBlock(p_145821_1_ + 1, p_145821_2_, p_145821_3_).isNormalCube()) + { + this.motionX = -0.02D; + } + } + else if (p_145821_9_ == 0) + { + if (this.worldObj.getBlock(p_145821_1_, p_145821_2_, p_145821_3_ - 1).isNormalCube()) + { + this.motionZ = 0.02D; + } + else if (this.worldObj.getBlock(p_145821_1_, p_145821_2_, p_145821_3_ + 1).isNormalCube()) + { + this.motionZ = -0.02D; + } + } + } + } + + protected void applyDrag() + { + if (this.riddenByEntity != null) + { + this.motionX *= 0.996999979019165D; + this.motionY *= 0.0D; + this.motionZ *= 0.996999979019165D; + } + else + { + this.motionX *= 0.9599999785423279D; + this.motionY *= 0.0D; + this.motionZ *= 0.9599999785423279D; + } + } + + @SideOnly(Side.CLIENT) + public Vec3 func_70495_a(double p_70495_1_, double p_70495_3_, double p_70495_5_, double p_70495_7_) + { + int i = MathHelper.floor_double(p_70495_1_); + int j = MathHelper.floor_double(p_70495_3_); + int k = MathHelper.floor_double(p_70495_5_); + + if (BlockRailBase.func_150049_b_(this.worldObj, i, j - 1, k)) + { + --j; + } + + Block block = this.worldObj.getBlock(i, j, k); + + if (!BlockRailBase.func_150051_a(block)) + { + return null; + } + else + { + int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); + + p_70495_3_ = (double)j; + + if (l >= 2 && l <= 5) + { + p_70495_3_ = (double)(j + 1); + } + + int[][] aint = matrix[l]; + double d4 = (double)(aint[1][0] - aint[0][0]); + double d5 = (double)(aint[1][2] - aint[0][2]); + double d6 = Math.sqrt(d4 * d4 + d5 * d5); + d4 /= d6; + d5 /= d6; + p_70495_1_ += d4 * p_70495_7_; + p_70495_5_ += d5 * p_70495_7_; + + if (aint[0][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[0][0] && MathHelper.floor_double(p_70495_5_) - k == aint[0][2]) + { + p_70495_3_ += (double)aint[0][1]; + } + else if (aint[1][1] != 0 && MathHelper.floor_double(p_70495_1_) - i == aint[1][0] && MathHelper.floor_double(p_70495_5_) - k == aint[1][2]) + { + p_70495_3_ += (double)aint[1][1]; + } + + return this.func_70489_a(p_70495_1_, p_70495_3_, p_70495_5_); + } + } + + public Vec3 func_70489_a(double p_70489_1_, double p_70489_3_, double p_70489_5_) + { + int i = MathHelper.floor_double(p_70489_1_); + int j = MathHelper.floor_double(p_70489_3_); + int k = MathHelper.floor_double(p_70489_5_); + + if (BlockRailBase.func_150049_b_(this.worldObj, i, j - 1, k)) + { + --j; + } + + Block block = this.worldObj.getBlock(i, j, k); + + if (BlockRailBase.func_150051_a(block)) + { + int l = ((BlockRailBase)block).getBasicRailMetadata(worldObj, this, i, j, k); + p_70489_3_ = (double)j; + + if (l >= 2 && l <= 5) + { + p_70489_3_ = (double)(j + 1); + } + + int[][] aint = matrix[l]; + double d3 = 0.0D; + double d4 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; + double d5 = (double)j + 0.5D + (double)aint[0][1] * 0.5D; + double d6 = (double)k + 0.5D + (double)aint[0][2] * 0.5D; + double d7 = (double)i + 0.5D + (double)aint[1][0] * 0.5D; + double d8 = (double)j + 0.5D + (double)aint[1][1] * 0.5D; + double d9 = (double)k + 0.5D + (double)aint[1][2] * 0.5D; + double d10 = d7 - d4; + double d11 = (d8 - d5) * 2.0D; + double d12 = d9 - d6; + + if (d10 == 0.0D) + { + p_70489_1_ = (double)i + 0.5D; + d3 = p_70489_5_ - (double)k; + } + else if (d12 == 0.0D) + { + p_70489_5_ = (double)k + 0.5D; + d3 = p_70489_1_ - (double)i; + } + else + { + double d13 = p_70489_1_ - d4; + double d14 = p_70489_5_ - d6; + d3 = (d13 * d10 + d14 * d12) * 2.0D; + } + + p_70489_1_ = d4 + d10 * d3; + p_70489_3_ = d5 + d11 * d3; + p_70489_5_ = d6 + d12 * d3; + + if (d11 < 0.0D) + { + ++p_70489_3_; + } + + if (d11 > 0.0D) + { + p_70489_3_ += 0.5D; + } + + return Vec3.createVectorHelper(p_70489_1_, p_70489_3_, p_70489_5_); + } + else + { + return null; + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + if (tagCompund.getBoolean("CustomDisplayTile")) + { + this.func_145819_k(tagCompund.getInteger("DisplayTile")); + this.setDisplayTileData(tagCompund.getInteger("DisplayData")); + this.setDisplayTileOffset(tagCompund.getInteger("DisplayOffset")); + } + + if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0) + { + this.entityName = tagCompund.getString("CustomName"); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + if (this.hasDisplayTile()) + { + tagCompound.setBoolean("CustomDisplayTile", true); + tagCompound.setInteger("DisplayTile", this.func_145820_n().getMaterial() == Material.air ? 0 : Block.getIdFromBlock(this.func_145820_n())); + tagCompound.setInteger("DisplayData", this.getDisplayTileData()); + tagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset()); + } + + if (this.entityName != null && this.entityName.length() > 0) + { + tagCompound.setString("CustomName", this.entityName); + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Applies a velocity to each of the entities pushing them away from each other. Args: entity + */ + public void applyEntityCollision(Entity entityIn) + { + MinecraftForge.EVENT_BUS.post(new MinecartCollisionEvent(this, entityIn)); + if (getCollisionHandler() != null) + { + getCollisionHandler().onEntityCollision(this, entityIn); + return; + } + if (!this.worldObj.isRemote) + { + if (entityIn != this.riddenByEntity) + { + if (entityIn instanceof EntityLivingBase && !(entityIn instanceof EntityPlayer) && !(entityIn instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && entityIn.ridingEntity == null) + { + entityIn.mountEntity(this); + } + + double d0 = entityIn.posX - this.posX; + double d1 = entityIn.posZ - this.posZ; + double d2 = d0 * d0 + d1 * d1; + + if (d2 >= 9.999999747378752E-5D) + { + d2 = (double)MathHelper.sqrt_double(d2); + d0 /= d2; + d1 /= d2; + double d3 = 1.0D / d2; + + if (d3 > 1.0D) + { + d3 = 1.0D; + } + + d0 *= d3; + d1 *= d3; + d0 *= 0.10000000149011612D; + d1 *= 0.10000000149011612D; + d0 *= (double)(1.0F - this.entityCollisionReduction); + d1 *= (double)(1.0F - this.entityCollisionReduction); + d0 *= 0.5D; + d1 *= 0.5D; + + if (entityIn instanceof EntityMinecart) + { + double d4 = entityIn.posX - this.posX; + double d5 = entityIn.posZ - this.posZ; + Vec3 vec3 = Vec3.createVectorHelper(d4, 0.0D, d5).normalize(); + Vec3 vec31 = Vec3.createVectorHelper((double)MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, (double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); + double d6 = Math.abs(vec3.dotProduct(vec31)); + + if (d6 < 0.800000011920929D) + { + return; + } + + double d7 = entityIn.motionX + this.motionX; + double d8 = entityIn.motionZ + this.motionZ; + + if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart()) + { + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(entityIn.motionX - d0, 0.0D, entityIn.motionZ - d1); + entityIn.motionX *= 0.949999988079071D; + entityIn.motionZ *= 0.949999988079071D; + } + else if (((EntityMinecart)entityIn).isPoweredCart() && !isPoweredCart()) + { + entityIn.motionX *= 0.20000000298023224D; + entityIn.motionZ *= 0.20000000298023224D; + entityIn.addVelocity(this.motionX + d0, 0.0D, this.motionZ + d1); + this.motionX *= 0.949999988079071D; + this.motionZ *= 0.949999988079071D; + } + else + { + d7 /= 2.0D; + d8 /= 2.0D; + this.motionX *= 0.20000000298023224D; + this.motionZ *= 0.20000000298023224D; + this.addVelocity(d7 - d0, 0.0D, d8 - d1); + entityIn.motionX *= 0.20000000298023224D; + entityIn.motionZ *= 0.20000000298023224D; + entityIn.addVelocity(d7 + d0, 0.0D, d8 + d1); + } + } + else + { + this.addVelocity(-d0, 0.0D, -d1); + entityIn.addVelocity(d0 / 4.0D, 0.0D, d1 / 4.0D); + } + } + } + } + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.minecartX = x; + this.minecartY = y; + this.minecartZ = z; + this.minecartYaw = (double)yaw; + this.minecartPitch = (double)pitch; + this.turnProgress = rotationIncrements + 2; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + /** + * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over + * 40. + */ + public void setDamage(float p_70492_1_) + { + this.dataWatcher.updateObject(19, Float.valueOf(p_70492_1_)); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.velocityX = this.motionX = x; + this.velocityY = this.motionY = y; + this.velocityZ = this.motionZ = z; + } + + /** + * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over + * 40. + */ + public float getDamage() + { + return this.dataWatcher.getWatchableObjectFloat(19); + } + + /** + * Sets the rolling amplitude the cart rolls while being attacked. + */ + public void setRollingAmplitude(int p_70497_1_) + { + this.dataWatcher.updateObject(17, Integer.valueOf(p_70497_1_)); + } + + /** + * Gets the rolling amplitude the cart rolls while being attacked. + */ + public int getRollingAmplitude() + { + return this.dataWatcher.getWatchableObjectInt(17); + } + + /** + * Sets the rolling direction the cart rolls while being attacked. Can be 1 or -1. + */ + public void setRollingDirection(int p_70494_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_70494_1_)); + } + + /** + * Gets the rolling direction the cart rolls while being attacked. Can be 1 or -1. + */ + public int getRollingDirection() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + public abstract int getMinecartType(); + + public Block func_145820_n() + { + if (!this.hasDisplayTile()) + { + return this.func_145817_o(); + } + else + { + int i = this.getDataWatcher().getWatchableObjectInt(20) & 65535; + return Block.getBlockById(i); + } + } + + public Block func_145817_o() + { + return Blocks.air; + } + + public int getDisplayTileData() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileData() : this.getDataWatcher().getWatchableObjectInt(20) >> 16; + } + + public int getDefaultDisplayTileData() + { + return 0; + } + + public int getDisplayTileOffset() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileOffset() : this.getDataWatcher().getWatchableObjectInt(21); + } + + public int getDefaultDisplayTileOffset() + { + return 6; + } + + public void func_145819_k(int p_145819_1_) + { + this.getDataWatcher().updateObject(20, Integer.valueOf(p_145819_1_ & 65535 | this.getDisplayTileData() << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileData(int p_94092_1_) + { + this.getDataWatcher().updateObject(20, Integer.valueOf(Block.getIdFromBlock(this.func_145820_n()) & 65535 | p_94092_1_ << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileOffset(int p_94086_1_) + { + this.getDataWatcher().updateObject(21, Integer.valueOf(p_94086_1_)); + this.setHasDisplayTile(true); + } + + public boolean hasDisplayTile() + { + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + + public void setHasDisplayTile(boolean p_94096_1_) + { + this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(p_94096_1_ ? 1 : 0))); + } + + /** + * Sets the minecart's name. + */ + public void setMinecartName(String p_96094_1_) + { + this.entityName = p_96094_1_; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return this.entityName != null ? this.entityName : super.getCommandSenderName(); + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.entityName != null; + } + + public String func_95999_t() + { + return this.entityName; + } + /* =================================== FORGE START ===========================================*/ + /** + * Moved to allow overrides. + * This code handles minecart movement and speed capping when on a rail. + */ + public void moveMinecartOnRail(int x, int y, int z, double par4){ + double d12 = this.motionX; + double d13 = this.motionZ; + + if (this.riddenByEntity != null) + { + d12 *= 0.75D; + d13 *= 0.75D; + } + + if (d12 < -par4) + { + d12 = -par4; + } + + if (d12 > par4) + { + d12 = par4; + } + + if (d13 < -par4) + { + d13 = -par4; + } + + if (d13 > par4) + { + d13 = par4; + } + + this.moveEntity(d12, 0.0D, d13); + } + + /** + * Gets the current global Minecart Collision handler if none + * is registered, returns null + * @return The collision handler or null + */ + public static IMinecartCollisionHandler getCollisionHandler() + { + return collisionHandler; + } + + /** + * Sets the global Minecart Collision handler, overwrites any + * that is currently set. + * @param handler The new handler + */ + public static void setCollisionHandler(IMinecartCollisionHandler handler) + { + collisionHandler = handler; + } + + /** + * This function returns an ItemStack that represents this cart. + * This should be an ItemStack that can be used by the player to place the cart, + * but is not necessary the item the cart drops when destroyed. + * @return An ItemStack that can be used to place the cart. + */ + public ItemStack getCartItem() + { + if (this instanceof EntityMinecartFurnace) + { + return new ItemStack(Items.furnace_minecart); + } + else if (this instanceof EntityMinecartChest) + { + return new ItemStack(Items.chest_minecart); + } + else if (this instanceof EntityMinecartTNT) + { + return new ItemStack(Items.tnt_minecart); + } + else if (this instanceof EntityMinecartHopper) + { + return new ItemStack(Items.hopper_minecart); + } + else if (this instanceof EntityMinecartCommandBlock) + { + return new ItemStack(Items.command_block_minecart); + } + return new ItemStack(Items.minecart); + } + + /** + * Returns true if this cart can currently use rails. + * This function is mainly used to gracefully detach a minecart from a rail. + * @return True if the minecart can use rails. + */ + public boolean canUseRail() + { + return canUseRail; + } + + /** + * Set whether the minecart can use rails. + * This function is mainly used to gracefully detach a minecart from a rail. + * @param use Whether the minecart can currently use rails. + */ + public void setCanUseRail(boolean use) + { + canUseRail = use; + } + + /** + * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails. + * @return True if this cart should call onMinecartPass(). + */ + public boolean shouldDoRailFunctions() + { + return true; + } + + /** + * Returns true if this cart is self propelled. + * @return True if powered. + */ + public boolean isPoweredCart() + { + return getMinecartType()== 2; + } + + /** + * Returns true if this cart can be ridden by an Entity. + * @return True if this cart can be ridden. + */ + public boolean canBeRidden() + { + if(this instanceof EntityMinecartEmpty) + { + return true; + } + return false; + } + + /** + * Getters/setters for physics variables + */ + + /** + * Returns the carts max speed when traveling on rails. Carts going faster + * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or + * corners at greater than 0.5 - 0.6. This value is compared with the rails + * max speed and the carts current speed cap to determine the carts current + * max speed. A normal rail's max speed is 0.4. + * + * @return Carts max speed. + */ + public float getMaxCartSpeedOnRail() + { + return 1.2f; + } + + /** + * Returns the current speed cap for the cart when traveling on rails. This + * functions differs from getMaxCartSpeedOnRail() in that it controls + * current movement and cannot be overridden. The value however can never be + * higher than getMaxCartSpeedOnRail(). + * + * @return + */ + public final float getCurrentCartSpeedCapOnRail() + { + return currentSpeedRail; + } + + public final void setCurrentCartSpeedCapOnRail(float value) + { + value = Math.min(value, getMaxCartSpeedOnRail()); + currentSpeedRail = value; + } + + public float getMaxSpeedAirLateral() + { + return maxSpeedAirLateral; + } + + public void setMaxSpeedAirLateral(float value) + { + maxSpeedAirLateral = value; + } + + public float getMaxSpeedAirVertical() + { + return maxSpeedAirVertical; + } + + public void setMaxSpeedAirVertical(float value) + { + maxSpeedAirVertical = value; + } + + public double getDragAir() + { + return dragAir; + } + + public void setDragAir(double value) + { + dragAir = value; + } + + public double getSlopeAdjustment() + { + return 0.0078125D; + } + /* =================================== FORGE END ===========================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartChest.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartChest.java new file mode 100644 index 0000000..f661cc8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartChest.java @@ -0,0 +1,51 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMinecartChest extends EntityMinecartContainer +{ + private static final String __OBFID = "CL_00001671"; + + public EntityMinecartChest(World p_i1714_1_) + { + super(p_i1714_1_); + } + + public EntityMinecartChest(World p_i1715_1_, double p_i1715_2_, double p_i1715_4_, double p_i1715_6_) + { + super(p_i1715_1_, p_i1715_2_, p_i1715_4_, p_i1715_6_); + } + + public void killMinecart(DamageSource p_94095_1_) + { + super.killMinecart(p_94095_1_); + this.func_145778_a(Item.getItemFromBlock(Blocks.chest), 1, 0.0F); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 27; + } + + public int getMinecartType() + { + return 1; + } + + public Block func_145817_o() + { + return Blocks.chest; + } + + public int getDefaultDisplayTileOffset() + { + return 8; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartContainer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartContainer.java new file mode 100644 index 0000000..1622f3c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartContainer.java @@ -0,0 +1,303 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory +{ + private ItemStack[] minecartContainerItems = new ItemStack[36]; + /** + * When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling + * dimensions) it preserves its contents. + */ + private boolean dropContentsWhenDead = true; + private static final String __OBFID = "CL_00001674"; + + public EntityMinecartContainer(World p_i1716_1_) + { + super(p_i1716_1_); + } + + public EntityMinecartContainer(World p_i1717_1_, double p_i1717_2_, double p_i1717_4_, double p_i1717_6_) + { + super(p_i1717_1_, p_i1717_2_, p_i1717_4_, p_i1717_6_); + } + + public void killMinecart(DamageSource p_94095_1_) + { + super.killMinecart(p_94095_1_); + + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + float f = this.rand.nextFloat() * 0.8F + 0.1F; + float f1 = this.rand.nextFloat() * 0.8F + 0.1F; + float f2 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j = this.rand.nextInt(21) + 10; + + if (j > itemstack.stackSize) + { + j = itemstack.stackSize; + } + + itemstack.stackSize -= j; + EntityItem entityitem = new EntityItem(this.worldObj, this.posX + (double)f, this.posY + (double)f1, this.posZ + (double)f2, new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage())); + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.rand.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.rand.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.rand.nextGaussian() * f3); + this.worldObj.spawnEntityInWorld(entityitem); + } + } + } + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.minecartContainerItems[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.minecartContainerItems[index] != null) + { + ItemStack itemstack; + + if (this.minecartContainerItems[index].stackSize <= count) + { + itemstack = this.minecartContainerItems[index]; + this.minecartContainerItems[index] = null; + return itemstack; + } + else + { + itemstack = this.minecartContainerItems[index].splitStack(count); + + if (this.minecartContainerItems[index].stackSize == 0) + { + this.minecartContainerItems[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.minecartContainerItems[index] != null) + { + ItemStack itemstack = this.minecartContainerItems[index]; + this.minecartContainerItems[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.minecartContainerItems[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.isDead ? false : player.getDistanceSqToEntity(this) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.func_95999_t() : "container.minecart"; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int dimensionId) + { + this.dropContentsWhenDead = false; + super.travelToDimension(dimensionId); + } + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + if (this.dropContentsWhenDead) + { + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + float f = this.rand.nextFloat() * 0.8F + 0.1F; + float f1 = this.rand.nextFloat() * 0.8F + 0.1F; + float f2 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j = this.rand.nextInt(21) + 10; + + if (j > itemstack.stackSize) + { + j = itemstack.stackSize; + } + + itemstack.stackSize -= j; + EntityItem entityitem = new EntityItem(this.worldObj, this.posX + (double)f, this.posY + (double)f1, this.posZ + (double)f2, new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (double)((float)this.rand.nextGaussian() * f3); + entityitem.motionY = (double)((float)this.rand.nextGaussian() * f3 + 0.2F); + entityitem.motionZ = (double)((float)this.rand.nextGaussian() * f3); + this.worldObj.spawnEntityInWorld(entityitem); + } + } + } + } + + super.setDead(); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.minecartContainerItems.length; ++i) + { + if (this.minecartContainerItems[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.minecartContainerItems[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + tagCompound.setTag("Items", nbttaglist); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + NBTTagList nbttaglist = tagCompund.getTagList("Items", 10); + this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + + if (j >= 0 && j < this.minecartContainerItems.length) + { + this.minecartContainerItems[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player))) return true; + if (!this.worldObj.isRemote) + { + player.displayGUIChest(this); + } + + return true; + } + + protected void applyDrag() + { + int i = 15 - Container.calcRedstoneFromInventory(this); + float f = 0.98F + (float)i * 0.001F; + this.motionX *= (double)f; + this.motionY *= 0.0D; + this.motionZ *= (double)f; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartEmpty.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartEmpty.java new file mode 100644 index 0000000..e03b052 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartEmpty.java @@ -0,0 +1,49 @@ +package net.minecraft.entity.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class EntityMinecartEmpty extends EntityMinecart +{ + private static final String __OBFID = "CL_00001677"; + + public EntityMinecartEmpty(World p_i1722_1_) + { + super(p_i1722_1_); + } + + public EntityMinecartEmpty(World p_i1723_1_, double p_i1723_2_, double p_i1723_4_, double p_i1723_6_) + { + super(p_i1723_1_, p_i1723_2_, p_i1723_4_, p_i1723_6_); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player))) return true; + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player) + { + return true; + } + else if (this.riddenByEntity != null && this.riddenByEntity != player) + { + return false; + } + else + { + if (!this.worldObj.isRemote) + { + player.mountEntity(this); + } + + return true; + } + } + + public int getMinecartType() + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartFurnace.java new file mode 100644 index 0000000..4331652 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartFurnace.java @@ -0,0 +1,197 @@ +package net.minecraft.entity.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityMinecartFurnace extends EntityMinecart +{ + private int fuel; + public double pushX; + public double pushZ; + private static final String __OBFID = "CL_00001675"; + + public EntityMinecartFurnace(World p_i1718_1_) + { + super(p_i1718_1_); + } + + public EntityMinecartFurnace(World p_i1719_1_, double p_i1719_2_, double p_i1719_4_, double p_i1719_6_) + { + super(p_i1719_1_, p_i1719_2_, p_i1719_4_, p_i1719_6_); + } + + public int getMinecartType() + { + return 2; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.fuel > 0) + { + --this.fuel; + } + + if (this.fuel <= 0) + { + this.pushX = this.pushZ = 0.0D; + } + + this.setMinecartPowered(this.fuel > 0); + + if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) + { + this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); + } + } + + public void killMinecart(DamageSource p_94095_1_) + { + super.killMinecart(p_94095_1_); + + if (!p_94095_1_.isExplosion()) + { + this.entityDropItem(new ItemStack(Blocks.furnace, 1), 0.0F); + } + } + + protected void func_145821_a(int p_145821_1_, int p_145821_2_, int p_145821_3_, double p_145821_4_, double p_145821_6_, Block p_145821_8_, int p_145821_9_) + { + super.func_145821_a(p_145821_1_, p_145821_2_, p_145821_3_, p_145821_4_, p_145821_6_, p_145821_8_, p_145821_9_); + double d2 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (d2 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) + { + d2 = (double)MathHelper.sqrt_double(d2); + this.pushX /= d2; + this.pushZ /= d2; + + if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) + { + this.pushX = 0.0D; + this.pushZ = 0.0D; + } + else + { + this.pushX = this.motionX; + this.pushZ = this.motionZ; + } + } + } + + protected void applyDrag() + { + double d0 = this.pushX * this.pushX + this.pushZ * this.pushZ; + + if (d0 > 1.0E-4D) + { + d0 = (double)MathHelper.sqrt_double(d0); + this.pushX /= d0; + this.pushZ /= d0; + double d1 = 0.05D; + this.motionX *= 0.800000011920929D; + this.motionY *= 0.0D; + this.motionZ *= 0.800000011920929D; + this.motionX += this.pushX * d1; + this.motionZ += this.pushZ * d1; + } + else + { + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.0D; + this.motionZ *= 0.9800000190734863D; + } + + super.applyDrag(); + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player))) return true; + ItemStack itemstack = player.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.coal) + { + if (!player.capabilities.isCreativeMode && --itemstack.stackSize == 0) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + } + + this.fuel += 3600; + } + + this.pushX = this.posX - player.posX; + this.pushZ = this.posZ - player.posZ; + return true; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setDouble("PushX", this.pushX); + tagCompound.setDouble("PushZ", this.pushZ); + tagCompound.setShort("Fuel", (short)this.fuel); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.pushX = tagCompund.getDouble("PushX"); + this.pushZ = tagCompund.getDouble("PushZ"); + this.fuel = tagCompund.getShort("Fuel"); + } + + protected boolean isMinecartPowered() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + protected void setMinecartPowered(boolean p_94107_1_) + { + if (p_94107_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); + } + } + + public Block func_145817_o() + { + return Blocks.lit_furnace; + } + + public int getDefaultDisplayTileData() + { + return 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartHopper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartHopper.java new file mode 100644 index 0000000..9bb109e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartHopper.java @@ -0,0 +1,212 @@ +package net.minecraft.entity.item; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.IHopper; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMinecartHopper extends EntityMinecartContainer implements IHopper +{ + /** Whether this hopper minecart is being blocked by an activator rail. */ + private boolean isBlocked = true; + private int transferTicker = -1; + private static final String __OBFID = "CL_00001676"; + + public EntityMinecartHopper(World p_i1720_1_) + { + super(p_i1720_1_); + } + + public EntityMinecartHopper(World p_i1721_1_, double p_i1721_2_, double p_i1721_4_, double p_i1721_6_) + { + super(p_i1721_1_, p_i1721_2_, p_i1721_4_, p_i1721_6_); + } + + public int getMinecartType() + { + return 5; + } + + public Block func_145817_o() + { + return Blocks.hopper; + } + + public int getDefaultDisplayTileOffset() + { + return 1; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 5; + } + + /** + * First layer of player interaction + */ + public boolean interactFirst(EntityPlayer player) + { + if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player))) return true; + if (!this.worldObj.isRemote) + { + player.displayGUIHopperMinecart(this); + } + + return true; + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) + { + boolean flag1 = !p_96095_4_; + + if (flag1 != this.getBlocked()) + { + this.setBlocked(flag1); + } + } + + /** + * Get whether this hopper minecart is being blocked by an activator rail. + */ + public boolean getBlocked() + { + return this.isBlocked; + } + + /** + * Set whether this hopper minecart is being blocked by an activator rail. + */ + public void setBlocked(boolean p_96110_1_) + { + this.isBlocked = p_96110_1_; + } + + /** + * Returns the worldObj for this tileEntity. + */ + public World getWorldObj() + { + return this.worldObj; + } + + /** + * Gets the world X position for this hopper entity. + */ + public double getXPos() + { + return this.posX; + } + + /** + * Gets the world Y position for this hopper entity. + */ + public double getYPos() + { + return this.posY; + } + + /** + * Gets the world Z position for this hopper entity. + */ + public double getZPos() + { + return this.posZ; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) + { + --this.transferTicker; + + if (!this.canTransfer()) + { + this.setTransferTicker(0); + + if (this.func_96112_aD()) + { + this.setTransferTicker(4); + this.markDirty(); + } + } + } + } + + public boolean func_96112_aD() + { + if (TileEntityHopper.func_145891_a(this)) + { + return true; + } + else + { + List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); + + if (list.size() > 0) + { + TileEntityHopper.func_145898_a(this, (EntityItem)list.get(0)); + } + + return false; + } + } + + public void killMinecart(DamageSource p_94095_1_) + { + super.killMinecart(p_94095_1_); + this.func_145778_a(Item.getItemFromBlock(Blocks.hopper), 1, 0.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("TransferCooldown", this.transferTicker); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.transferTicker = tagCompund.getInteger("TransferCooldown"); + } + + /** + * Sets the transfer ticker, used to determine the delay between transfers. + */ + public void setTransferTicker(int p_98042_1_) + { + this.transferTicker = p_98042_1_; + } + + /** + * Returns whether the hopper cart can currently transfer an item. + */ + public boolean canTransfer() + { + return this.transferTicker > 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartTNT.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartTNT.java new file mode 100644 index 0000000..8522895 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityMinecartTNT.java @@ -0,0 +1,199 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityMinecartTNT extends EntityMinecart +{ + private int minecartTNTFuse = -1; + private static final String __OBFID = "CL_00001680"; + + public EntityMinecartTNT(World p_i1727_1_) + { + super(p_i1727_1_); + } + + public EntityMinecartTNT(World p_i1728_1_, double p_i1728_2_, double p_i1728_4_, double p_i1728_6_) + { + super(p_i1728_1_, p_i1728_2_, p_i1728_4_, p_i1728_6_); + } + + public int getMinecartType() + { + return 3; + } + + public Block func_145817_o() + { + return Blocks.tnt; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.minecartTNTFuse > 0) + { + --this.minecartTNTFuse; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + } + else if (this.minecartTNTFuse == 0) + { + this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + + if (this.isCollidedHorizontally) + { + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (d0 >= 0.009999999776482582D) + { + this.explodeCart(d0); + } + } + } + + public void killMinecart(DamageSource p_94095_1_) + { + super.killMinecart(p_94095_1_); + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (!p_94095_1_.isExplosion()) + { + this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F); + } + + if (p_94095_1_.isFireDamage() || p_94095_1_.isExplosion() || d0 >= 0.009999999776482582D) + { + this.explodeCart(d0); + } + } + + /** + * Makes the minecart explode. + */ + protected void explodeCart(double p_94103_1_) + { + if (!this.worldObj.isRemote) + { + double d1 = Math.sqrt(p_94103_1_); + + if (d1 > 5.0D) + { + d1 = 5.0D; + } + + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * d1), true); + this.setDead(); + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + if (distance >= 3.0F) + { + float f1 = distance / 10.0F; + this.explodeCart((double)(f1 * f1)); + } + + super.fall(distance); + } + + /** + * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power + */ + public void onActivatorRailPass(int p_96095_1_, int p_96095_2_, int p_96095_3_, boolean p_96095_4_) + { + if (p_96095_4_ && this.minecartTNTFuse < 0) + { + this.ignite(); + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 10) + { + this.ignite(); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Ignites this TNT cart. + */ + public void ignite() + { + this.minecartTNTFuse = 80; + + if (!this.worldObj.isRemote) + { + this.worldObj.setEntityState(this, (byte)10); + this.worldObj.playSoundAtEntity(this, "game.tnt.primed", 1.0F, 1.0F); + } + } + + @SideOnly(Side.CLIENT) + public int func_94104_d() + { + return this.minecartTNTFuse; + } + + /** + * Returns true if the TNT minecart is ignited. + */ + public boolean isIgnited() + { + return this.minecartTNTFuse > -1; + } + + public float func_145772_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn) + { + return this.isIgnited() && (BlockRailBase.func_150051_a(blockIn) || BlockRailBase.func_150049_b_(worldIn, x, y + 1, z)) ? 0.0F : super.func_145772_a(explosionIn, worldIn, x, y, z, blockIn); + } + + public boolean func_145774_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn, float unused) + { + return this.isIgnited() && (BlockRailBase.func_150051_a(blockIn) || BlockRailBase.func_150049_b_(worldIn, x, y + 1, z)) ? false : super.func_145774_a(explosionIn, worldIn, x, y, z, blockIn, unused); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("TNTFuse", 99)) + { + this.minecartTNTFuse = tagCompund.getInteger("TNTFuse"); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("TNTFuse", this.minecartTNTFuse); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityPainting.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityPainting.java new file mode 100644 index 0000000..2bcf876 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityPainting.java @@ -0,0 +1,184 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityPainting extends EntityHanging +{ + public EntityPainting.EnumArt art; + private static final String __OBFID = "CL_00001556"; + + public EntityPainting(World p_i1599_1_) + { + super(p_i1599_1_); + } + + public EntityPainting(World p_i1600_1_, int p_i1600_2_, int p_i1600_3_, int p_i1600_4_, int p_i1600_5_) + { + super(p_i1600_1_, p_i1600_2_, p_i1600_3_, p_i1600_4_, p_i1600_5_); + ArrayList arraylist = new ArrayList(); + EntityPainting.EnumArt[] aenumart = EntityPainting.EnumArt.values(); + int i1 = aenumart.length; + + for (int j1 = 0; j1 < i1; ++j1) + { + EntityPainting.EnumArt enumart = aenumart[j1]; + this.art = enumart; + this.setDirection(p_i1600_5_); + + if (this.onValidSurface()) + { + arraylist.add(enumart); + } + } + + if (!arraylist.isEmpty()) + { + this.art = (EntityPainting.EnumArt)arraylist.get(this.rand.nextInt(arraylist.size())); + } + + this.setDirection(p_i1600_5_); + } + + @SideOnly(Side.CLIENT) + public EntityPainting(World p_i1601_1_, int p_i1601_2_, int p_i1601_3_, int p_i1601_4_, int p_i1601_5_, String p_i1601_6_) + { + this(p_i1601_1_, p_i1601_2_, p_i1601_3_, p_i1601_4_, p_i1601_5_); + EntityPainting.EnumArt[] aenumart = EntityPainting.EnumArt.values(); + int i1 = aenumart.length; + + for (int j1 = 0; j1 < i1; ++j1) + { + EntityPainting.EnumArt enumart = aenumart[j1]; + + if (enumart.title.equals(p_i1601_6_)) + { + this.art = enumart; + break; + } + } + + this.setDirection(p_i1601_5_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setString("Motive", this.art.title); + super.writeEntityToNBT(tagCompound); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + String s = tagCompund.getString("Motive"); + EntityPainting.EnumArt[] aenumart = EntityPainting.EnumArt.values(); + int i = aenumart.length; + + for (int j = 0; j < i; ++j) + { + EntityPainting.EnumArt enumart = aenumart[j]; + + if (enumart.title.equals(s)) + { + this.art = enumart; + } + } + + if (this.art == null) + { + this.art = EntityPainting.EnumArt.Kebab; + } + + super.readEntityFromNBT(tagCompund); + } + + public int getWidthPixels() + { + return this.art.sizeX; + } + + public int getHeightPixels() + { + return this.art.sizeY; + } + + /** + * Called when this entity is broken. Entity parameter may be null. + */ + public void onBroken(Entity p_110128_1_) + { + if (p_110128_1_ instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_110128_1_; + + if (entityplayer.capabilities.isCreativeMode) + { + return; + } + } + + this.entityDropItem(new ItemStack(Items.painting), 0.0F); + } + + public static enum EnumArt + { + Kebab("Kebab", 16, 16, 0, 0), + Aztec("Aztec", 16, 16, 16, 0), + Alban("Alban", 16, 16, 32, 0), + Aztec2("Aztec2", 16, 16, 48, 0), + Bomb("Bomb", 16, 16, 64, 0), + Plant("Plant", 16, 16, 80, 0), + Wasteland("Wasteland", 16, 16, 96, 0), + Pool("Pool", 32, 16, 0, 32), + Courbet("Courbet", 32, 16, 32, 32), + Sea("Sea", 32, 16, 64, 32), + Sunset("Sunset", 32, 16, 96, 32), + Creebet("Creebet", 32, 16, 128, 32), + Wanderer("Wanderer", 16, 32, 0, 64), + Graham("Graham", 16, 32, 16, 64), + Match("Match", 32, 32, 0, 128), + Bust("Bust", 32, 32, 32, 128), + Stage("Stage", 32, 32, 64, 128), + Void("Void", 32, 32, 96, 128), + SkullAndRoses("SkullAndRoses", 32, 32, 128, 128), + Wither("Wither", 32, 32, 160, 128), + Fighters("Fighters", 64, 32, 0, 96), + Pointer("Pointer", 64, 64, 0, 192), + Pigscene("Pigscene", 64, 64, 64, 192), + BurningSkull("BurningSkull", 64, 64, 128, 192), + Skeleton("Skeleton", 64, 48, 192, 64), + DonkeyKong("DonkeyKong", 64, 48, 192, 112); + /** Holds the maximum length of paintings art title. */ + public static final int maxArtTitleLength = "SkullAndRoses".length(); + /** Painting Title. */ + public final String title; + public final int sizeX; + public final int sizeY; + public final int offsetX; + public final int offsetY; + + private static final String __OBFID = "CL_00001557"; + + private EnumArt(String p_i1598_3_, int p_i1598_4_, int p_i1598_5_, int p_i1598_6_, int p_i1598_7_) + { + this.title = p_i1598_3_; + this.sizeX = p_i1598_4_; + this.sizeY = p_i1598_5_; + this.offsetX = p_i1598_6_; + this.offsetY = p_i1598_7_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityTNTPrimed.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityTNTPrimed.java new file mode 100644 index 0000000..5924e03 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityTNTPrimed.java @@ -0,0 +1,130 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class EntityTNTPrimed extends Entity +{ + /** How long the fuse is */ + public int fuse; + private EntityLivingBase tntPlacedBy; + private static final String __OBFID = "CL_00001681"; + + public EntityTNTPrimed(World p_i1729_1_) + { + super(p_i1729_1_); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + } + + public EntityTNTPrimed(World p_i1730_1_, double p_i1730_2_, double p_i1730_4_, double p_i1730_6_, EntityLivingBase p_i1730_8_) + { + this(p_i1730_1_); + this.setPosition(p_i1730_2_, p_i1730_4_, p_i1730_6_); + float f = (float)(Math.random() * Math.PI * 2.0D); + this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F); + this.motionY = 0.20000000298023224D; + this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F); + this.fuse = 80; + this.prevPosX = p_i1730_2_; + this.prevPosY = p_i1730_4_; + this.prevPosZ = p_i1730_6_; + this.tntPlacedBy = p_i1730_8_; + } + + protected void entityInit() {} + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !this.isDead; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + + if (this.fuse-- <= 0) + { + this.setDead(); + + if (!this.worldObj.isRemote) + { + this.explode(); + } + } + else + { + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + } + } + + private void explode() + { + float f = 4.0F; + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, f, true); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setByte("Fuse", (byte)this.fuse); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.fuse = tagCompund.getByte("Fuse"); + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * returns null or the entityliving it was placed or ignited by + */ + public EntityLivingBase getTntPlacedBy() + { + return this.tntPlacedBy; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityXPOrb.java b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityXPOrb.java new file mode 100644 index 0000000..ccbb2d2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/item/EntityXPOrb.java @@ -0,0 +1,284 @@ +package net.minecraft.entity.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerPickupXpEvent; + +public class EntityXPOrb extends Entity +{ + /** A constantly increasing value that RenderXPOrb uses to control the colour shifting (Green / yellow) */ + public int xpColor; + /** The age of the XP orb in ticks. */ + public int xpOrbAge; + public int field_70532_c; + /** The health of this XP orb. */ + private int xpOrbHealth = 5; + /** This is how much XP this orb has. */ + public int xpValue; + /** The closest EntityPlayer to this orb. */ + private EntityPlayer closestPlayer; + /** Threshold color for tracking players */ + private int xpTargetColor; + private static final String __OBFID = "CL_00001544"; + + public EntityXPOrb(World p_i1585_1_, double p_i1585_2_, double p_i1585_4_, double p_i1585_6_, int p_i1585_8_) + { + super(p_i1585_1_); + this.setSize(0.5F, 0.5F); + this.yOffset = this.height / 2.0F; + this.setPosition(p_i1585_2_, p_i1585_4_, p_i1585_6_); + this.rotationYaw = (float)(Math.random() * 360.0D); + this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.motionY = (double)((float)(Math.random() * 0.2D) * 2.0F); + this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.xpValue = p_i1585_8_; + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + public EntityXPOrb(World p_i1586_1_) + { + super(p_i1586_1_); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + } + + protected void entityInit() {} + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + float f1 = 0.5F; + + if (f1 < 0.0F) + { + f1 = 0.0F; + } + + if (f1 > 1.0F) + { + f1 = 1.0F; + } + + int i = super.getBrightnessForRender(p_70070_1_); + int j = i & 255; + int k = i >> 16 & 255; + j += (int)(f1 * 15.0F * 16.0F); + + if (j > 240) + { + j = 240; + } + + return j | k << 16; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.field_70532_c > 0) + { + --this.field_70532_c; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.029999999329447746D; + + if (this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial() == Material.lava) + { + this.motionY = 0.20000000298023224D; + this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + double d0 = 8.0D; + + if (this.xpTargetColor < this.xpColor - 20 + this.getEntityId() % 100) + { + if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > d0 * d0) + { + this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, d0); + } + + this.xpTargetColor = this.xpColor; + } + + if (this.closestPlayer != null) + { + double d1 = (this.closestPlayer.posX - this.posX) / d0; + double d2 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / d0; + double d3 = (this.closestPlayer.posZ - this.posZ) / d0; + double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3); + double d5 = 1.0D - d4; + + if (d5 > 0.0D) + { + d5 *= d5; + this.motionX += d1 / d4 * d5 * 0.1D; + this.motionY += d2 / d4 * d5 * 0.1D; + this.motionZ += d3 / d4 * d5 * 0.1D; + } + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f = 0.98F; + + if (this.onGround) + { + f = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)).slipperiness * 0.98F; + } + + this.motionX *= (double)f; + this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)f; + + if (this.onGround) + { + this.motionY *= -0.8999999761581421D; + } + + ++this.xpColor; + ++this.xpOrbAge; + + if (this.xpOrbAge >= 6000) + { + this.setDead(); + } + } + + /** + * Returns if this entity is in water and will end up adding the waters velocity to the entity + */ + public boolean handleWaterMovement() + { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + + /** + * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: + * amountDamage + */ + protected void dealFireDamage(int amount) + { + this.attackEntityFrom(DamageSource.inFire, (float)amount); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.setBeenAttacked(); + this.xpOrbHealth = (int)((float)this.xpOrbHealth - amount); + + if (this.xpOrbHealth <= 0) + { + this.setDead(); + } + + return false; + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("Health", (short)((byte)this.xpOrbHealth)); + tagCompound.setShort("Age", (short)this.xpOrbAge); + tagCompound.setShort("Value", (short)this.xpValue); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.xpOrbHealth = tagCompund.getShort("Health") & 255; + this.xpOrbAge = tagCompund.getShort("Age"); + this.xpValue = tagCompund.getShort("Value"); + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote) + { + if (this.field_70532_c == 0 && entityIn.xpCooldown == 0) + { + if (MinecraftForge.EVENT_BUS.post(new PlayerPickupXpEvent(entityIn, this))) return; + entityIn.xpCooldown = 2; + this.worldObj.playSoundAtEntity(entityIn, "random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); + entityIn.onItemPickup(this, 1); + entityIn.addExperience(this.xpValue); + this.setDead(); + } + } + } + + /** + * Returns the XP value of this XP orb. + */ + public int getXpValue() + { + return this.xpValue; + } + + /** + * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine + * what texture to use. + */ + @SideOnly(Side.CLIENT) + public int getTextureByXP() + { + return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); + } + + /** + * Get a fragment of the maximum experience points value for the supplied value of experience points value. + */ + public static int getXPSplit(int p_70527_0_) + { + return p_70527_0_ >= 2477 ? 2477 : (p_70527_0_ >= 1237 ? 1237 : (p_70527_0_ >= 617 ? 617 : (p_70527_0_ >= 307 ? 307 : (p_70527_0_ >= 149 ? 149 : (p_70527_0_ >= 73 ? 73 : (p_70527_0_ >= 37 ? 37 : (p_70527_0_ >= 17 ? 17 : (p_70527_0_ >= 7 ? 7 : (p_70527_0_ >= 3 ? 3 : 1))))))))); + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityBlaze.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityBlaze.java new file mode 100644 index 0000000..6cf06c2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityBlaze.java @@ -0,0 +1,244 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBlaze extends EntityMob +{ + /** Random offset used in floating behaviour */ + private float heightOffset = 0.5F; + /** ticks until heightOffset is randomized */ + private int heightOffsetUpdateTime; + private int field_70846_g; + private static final String __OBFID = "CL_00001682"; + + public EntityBlaze(World p_i1731_1_) + { + super(p_i1731_1_); + this.isImmuneToFire = true; + this.experienceValue = 10; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.blaze.breathe"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.blaze.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.blaze.death"; + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (!this.worldObj.isRemote) + { + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + --this.heightOffsetUpdateTime; + + if (this.heightOffsetUpdateTime <= 0) + { + this.heightOffsetUpdateTime = 100; + this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F; + } + + if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) + { + this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; + } + } + + if (this.rand.nextInt(24) == 0) + { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F); + } + + if (!this.onGround && this.motionY < 0.0D) + { + this.motionY *= 0.6D; + } + + for (int i = 0; i < 2; ++i) + { + this.worldObj.spawnParticle("largesmoke", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); + } + + super.onLivingUpdate(); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) + { + if (this.attackTime <= 0 && p_70785_2_ < 2.0F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) + { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } + else if (p_70785_2_ < 30.0F) + { + double d0 = p_70785_1_.posX - this.posX; + double d1 = p_70785_1_.boundingBox.minY + (double)(p_70785_1_.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); + double d2 = p_70785_1_.posZ - this.posZ; + + if (this.attackTime == 0) + { + ++this.field_70846_g; + + if (this.field_70846_g == 1) + { + this.attackTime = 60; + this.func_70844_e(true); + } + else if (this.field_70846_g <= 4) + { + this.attackTime = 6; + } + else + { + this.attackTime = 100; + this.field_70846_g = 0; + this.func_70844_e(false); + } + + if (this.field_70846_g > 1) + { + float f1 = MathHelper.sqrt_float(p_70785_2_) * 0.5F; + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + + for (int i = 0; i < 1; ++i) + { + EntitySmallFireball entitysmallfireball = new EntitySmallFireball(this.worldObj, this, d0 + this.rand.nextGaussian() * (double)f1, d1, d2 + this.rand.nextGaussian() * (double)f1); + entitysmallfireball.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; + this.worldObj.spawnEntityInWorld(entitysmallfireball); + } + } + } + + this.rotationYaw = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + protected Item getDropItem() + { + return Items.blaze_rod; + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() + { + return this.func_70845_n(); + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + if (p_70628_1_) + { + int j = this.rand.nextInt(2 + p_70628_2_); + + for (int k = 0; k < j; ++k) + { + this.dropItem(Items.blaze_rod, 1); + } + } + } + + public boolean func_70845_n() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void func_70844_e(boolean p_70844_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70844_1_) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 &= -2; + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCaveSpider.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCaveSpider.java new file mode 100644 index 0000000..9f5b744 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCaveSpider.java @@ -0,0 +1,63 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityCaveSpider extends EntitySpider +{ + private static final String __OBFID = "CL_00001683"; + + public EntityCaveSpider(World p_i1732_1_) + { + super(p_i1732_1_); + this.setSize(0.7F, 0.5F); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(12.0D); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + if (super.attackEntityAsMob(p_70652_1_)) + { + if (p_70652_1_ instanceof EntityLivingBase) + { + byte b0 = 0; + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) + { + b0 = 7; + } + else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) + { + b0 = 15; + } + + if (b0 > 0) + { + ((EntityLivingBase)p_70652_1_).addPotionEffect(new PotionEffect(Potion.poison.id, b0 * 20, 0)); + } + } + + return true; + } + else + { + return false; + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + return p_110161_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCreeper.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCreeper.java new file mode 100644 index 0000000..4206596 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityCreeper.java @@ -0,0 +1,312 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAICreeperSwell; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityCreeper extends EntityMob +{ + /** + * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go + * weird) + */ + private int lastActiveTime; + /** The amount of time since the creeper was close enough to the player to ignite */ + private int timeSinceIgnited; + private int fuseTime = 30; + /** Explosion radius for this creeper. */ + private int explosionRadius = 3; + private static final String __OBFID = "CL_00001684"; + + public EntityCreeper(World p_i1733_1_) + { + super(p_i1733_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAICreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, false)); + this.tasks.addTask(5, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * The number of iterations PathFinder.getSafePoint will execute before giving up. + */ + public int getMaxSafePointTries() + { + return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + super.fall(distance); + this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + distance * 1.5F); + + if (this.timeSinceIgnited > this.fuseTime - 5) + { + this.timeSinceIgnited = this.fuseTime - 5; + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.dataWatcher.getWatchableObjectByte(17) == 1) + { + tagCompound.setBoolean("powered", true); + } + + tagCompound.setShort("Fuse", (short)this.fuseTime); + tagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius); + tagCompound.setBoolean("ignited", this.func_146078_ca()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)(tagCompund.getBoolean("powered") ? 1 : 0))); + + if (tagCompund.hasKey("Fuse", 99)) + { + this.fuseTime = tagCompund.getShort("Fuse"); + } + + if (tagCompund.hasKey("ExplosionRadius", 99)) + { + this.explosionRadius = tagCompund.getByte("ExplosionRadius"); + } + + if (tagCompund.getBoolean("ignited")) + { + this.func_146079_cb(); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (this.isEntityAlive()) + { + this.lastActiveTime = this.timeSinceIgnited; + + if (this.func_146078_ca()) + { + this.setCreeperState(1); + } + + int i = this.getCreeperState(); + + if (i > 0 && this.timeSinceIgnited == 0) + { + this.playSound("creeper.primed", 1.0F, 0.5F); + } + + this.timeSinceIgnited += i; + + if (this.timeSinceIgnited < 0) + { + this.timeSinceIgnited = 0; + } + + if (this.timeSinceIgnited >= this.fuseTime) + { + this.timeSinceIgnited = this.fuseTime; + this.func_146077_cc(); + } + } + + super.onUpdate(); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.creeper.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.creeper.death"; + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + super.onDeath(p_70645_1_); + + if (p_70645_1_.getEntity() instanceof EntitySkeleton) + { + int i = Item.getIdFromItem(Items.record_13); + int j = Item.getIdFromItem(Items.record_wait); + int k = i + this.rand.nextInt(j - i + 1); + this.dropItem(Item.getItemById(k), 1); + } + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + return true; + } + + /** + * Returns true if the creeper is powered by a lightning bolt. + */ + public boolean getPowered() + { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + + /** + * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. + */ + @SideOnly(Side.CLIENT) + public float getCreeperFlashIntensity(float p_70831_1_) + { + return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * p_70831_1_) / (float)(this.fuseTime - 2); + } + + protected Item getDropItem() + { + return Items.gunpowder; + } + + /** + * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' + */ + public int getCreeperState() + { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /** + * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' + */ + public void setCreeperState(int p_70829_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)p_70829_1_)); + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + super.onStruckByLightning(lightningBolt); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) + { + this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.ignite", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + p_70085_1_.swingItem(); + + if (!this.worldObj.isRemote) + { + this.func_146079_cb(); + itemstack.damageItem(1, p_70085_1_); + return true; + } + } + + return super.interact(p_70085_1_); + } + + private void func_146077_cc() + { + if (!this.worldObj.isRemote) + { + boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); + + if (this.getPowered()) + { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), flag); + } + else + { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, flag); + } + + this.setDead(); + } + } + + public boolean func_146078_ca() + { + return this.dataWatcher.getWatchableObjectByte(18) != 0; + } + + public void func_146079_cb() + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)1)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityEnderman.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityEnderman.java new file mode 100644 index 0000000..784804b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityEnderman.java @@ -0,0 +1,531 @@ +package net.minecraft.entity.monster; + +import java.util.IdentityHashMap; +import java.util.UUID; +import com.google.common.collect.Maps; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.EnderTeleportEvent; + +public class EntityEnderman extends EntityMob +{ + private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); + @Deprecated //DO NOT TOUCH THIS EVER + private static boolean[] carriableBlocks = new boolean[256]; + /** Counter to delay the teleportation of an enderman towards the currently attacked target */ + private int teleportDelay; + /** A player must stare at an enderman for 5 ticks before it becomes aggressive. This field counts those ticks. */ + private int stareTimer; + private Entity lastEntityToAttack; + private boolean isAggressive; + private static final String __OBFID = "CL_00001685"; + + public EntityEnderman(World p_i1734_1_) + { + super(p_i1734_1_); + this.setSize(0.6F, 2.9F); + this.stepHeight = 1.0F; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(7.0D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + this.dataWatcher.addObject(17, new Byte((byte)0)); + this.dataWatcher.addObject(18, new Byte((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setShort("carried", (short)Block.getIdFromBlock(this.func_146080_bZ())); + tagCompound.setShort("carriedData", (short)this.getCarryingData()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.func_146081_a(Block.getBlockById(tagCompund.getShort("carried"))); + this.setCarryingData(tagCompund.getShort("carriedData")); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); + + if (entityplayer != null) + { + if (this.shouldAttackPlayer(entityplayer)) + { + this.isAggressive = true; + + if (this.stareTimer == 0) + { + this.worldObj.playSoundEffect(entityplayer.posX, entityplayer.posY, entityplayer.posZ, "mob.endermen.stare", 1.0F, 1.0F); + } + + if (this.stareTimer++ == 5) + { + this.stareTimer = 0; + this.setScreaming(true); + return entityplayer; + } + } + else + { + this.stareTimer = 0; + } + } + + return null; + } + + /** + * Checks to see if this enderman should be attacking this player + */ + private boolean shouldAttackPlayer(EntityPlayer p_70821_1_) + { + ItemStack itemstack = p_70821_1_.inventory.armorInventory[3]; + + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) + { + return false; + } + else + { + Vec3 vec3 = p_70821_1_.getLook(1.0F).normalize(); + Vec3 vec31 = Vec3.createVectorHelper(this.posX - p_70821_1_.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (p_70821_1_.posY + (double)p_70821_1_.getEyeHeight()), this.posZ - p_70821_1_.posZ); + double d0 = vec31.lengthVector(); + vec31 = vec31.normalize(); + double d1 = vec3.dotProduct(vec31); + return d1 > 1.0D - 0.025D / d0 && p_70821_1_.canEntityBeSeen(this); + } + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.lastEntityToAttack != this.entityToAttack) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(attackingSpeedBoostModifier); + + if (this.entityToAttack != null) + { + iattributeinstance.applyModifier(attackingSpeedBoostModifier); + } + } + + this.lastEntityToAttack = this.entityToAttack; + int k; + + if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + int i; + int j; + Block block; + + if (this.func_146080_bZ().getMaterial() == Material.air) + { + if (this.rand.nextInt(20) == 0) + { + k = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D); + i = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D); + j = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D); + block = this.worldObj.getBlock(k, i, j); + + if (EntityEnderman.getCarriable(block)) + { + this.func_146081_a(block); + this.setCarryingData(this.worldObj.getBlockMetadata(k, i, j)); + this.worldObj.setBlock(k, i, j, Blocks.air); + } + } + } + else if (this.rand.nextInt(2000) == 0) + { + k = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D); + i = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D); + j = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D); + block = this.worldObj.getBlock(k, i, j); + Block block1 = this.worldObj.getBlock(k, i - 1, j); + + if (block.getMaterial() == Material.air && block1.getMaterial() != Material.air && block1.renderAsNormalBlock()) + { + this.worldObj.setBlock(k, i, j, this.func_146080_bZ(), this.getCarryingData(), 3); + this.func_146081_a(Blocks.air); + } + } + } + + for (k = 0; k < 2; ++k) + { + this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); + } + + if (this.worldObj.isDaytime() && !this.worldObj.isRemote) + { + float f = this.getBrightness(1.0F); + + if (f > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) + { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + } + + if (this.isWet() || this.isBurning()) + { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + + if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) + { + this.setScreaming(false); + } + + this.isJumping = false; + + if (this.entityToAttack != null) + { + this.faceEntity(this.entityToAttack, 100.0F, 100.0F); + } + + if (!this.worldObj.isRemote && this.isEntityAlive()) + { + if (this.entityToAttack != null) + { + if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) + { + if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) + { + this.teleportRandomly(); + } + + this.teleportDelay = 0; + } + else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) + { + this.teleportDelay = 0; + } + } + else + { + this.setScreaming(false); + this.teleportDelay = 0; + } + } + + super.onLivingUpdate(); + } + + /** + * Teleport the enderman to a random nearby position + */ + protected boolean teleportRandomly() + { + double d0 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; + double d1 = this.posY + (double)(this.rand.nextInt(64) - 32); + double d2 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; + return this.teleportTo(d0, d1, d2); + } + + /** + * Teleport the enderman to another entity + */ + protected boolean teleportToEntity(Entity p_70816_1_) + { + Vec3 vec3 = Vec3.createVectorHelper(this.posX - p_70816_1_.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - p_70816_1_.posY + (double)p_70816_1_.getEyeHeight(), this.posZ - p_70816_1_.posZ); + vec3 = vec3.normalize(); + double d0 = 16.0D; + double d1 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.xCoord * d0; + double d2 = this.posY + (double)(this.rand.nextInt(16) - 8) - vec3.yCoord * d0; + double d3 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - vec3.zCoord * d0; + return this.teleportTo(d1, d2, d3); + } + + /** + * Teleport the enderman + */ + protected boolean teleportTo(double p_70825_1_, double p_70825_3_, double p_70825_5_) + { + EnderTeleportEvent event = new EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); + if (MinecraftForge.EVENT_BUS.post(event)){ + return false; + } + double d3 = this.posX; + double d4 = this.posY; + double d5 = this.posZ; + this.posX = event.targetX; + this.posY = event.targetY; + this.posZ = event.targetZ; + boolean flag = false; + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.worldObj.blockExists(i, j, k)) + { + boolean flag1 = false; + + while (!flag1 && j > 0) + { + Block block = this.worldObj.getBlock(i, j - 1, k); + + if (block.getMaterial().blocksMovement()) + { + flag1 = true; + } + else + { + --this.posY; + --j; + } + } + + if (flag1) + { + this.setPosition(this.posX, this.posY, this.posZ); + + if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) + { + flag = true; + } + } + } + + if (!flag) + { + this.setPosition(d3, d4, d5); + return false; + } + else + { + short short1 = 128; + + for (int l = 0; l < short1; ++l) + { + double d6 = (double)l / ((double)short1 - 1.0D); + float f = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f1 = (this.rand.nextFloat() - 0.5F) * 0.2F; + float f2 = (this.rand.nextFloat() - 0.5F) * 0.2F; + double d7 = d3 + (this.posX - d3) * d6 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + double d8 = d4 + (this.posY - d4) * d6 + this.rand.nextDouble() * (double)this.height; + double d9 = d5 + (this.posZ - d5) * d6 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + this.worldObj.spawnParticle("portal", d7, d8, d9, (double)f, (double)f1, (double)f2); + } + + this.worldObj.playSoundEffect(d3, d4, d5, "mob.endermen.portal", 1.0F, 1.0F); + this.playSound("mob.endermen.portal", 1.0F, 1.0F); + return true; + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.endermen.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.endermen.death"; + } + + protected Item getDropItem() + { + return Items.ender_pearl; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + Item item = this.getDropItem(); + + if (item != null) + { + int j = this.rand.nextInt(2 + p_70628_2_); + + for (int k = 0; k < j; ++k) + { + this.dropItem(item, 1); + } + } + } + + public void func_146081_a(Block p_146081_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(Block.getIdFromBlock(p_146081_1_) & 255))); + } + + public Block func_146080_bZ() + { + return Block.getBlockById(this.dataWatcher.getWatchableObjectByte(16)); + } + + /** + * Set the metadata of the block an enderman carries + */ + public void setCarryingData(int p_70817_1_) + { + this.dataWatcher.updateObject(17, Byte.valueOf((byte)(p_70817_1_ & 255))); + } + + /** + * Get the metadata of the block an enderman carries + */ + public int getCarryingData() + { + return this.dataWatcher.getWatchableObjectByte(17); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.setScreaming(true); + + if (source instanceof EntityDamageSource && source.getEntity() instanceof EntityPlayer) + { + this.isAggressive = true; + } + + if (source instanceof EntityDamageSourceIndirect) + { + this.isAggressive = false; + + for (int i = 0; i < 64; ++i) + { + if (this.teleportRandomly()) + { + return true; + } + } + + return super.attackEntityFrom(source, amount); + } + else + { + return super.attackEntityFrom(source, amount); + } + } + } + + public boolean isScreaming() + { + return this.dataWatcher.getWatchableObjectByte(18) > 0; + } + + public void setScreaming(boolean p_70819_1_) + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)(p_70819_1_ ? 1 : 0))); + } + + static + { + carriableBlocks[Block.getIdFromBlock(Blocks.grass)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.dirt)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.sand)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.gravel)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.yellow_flower)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.red_flower)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.brown_mushroom)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.red_mushroom)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.tnt)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.cactus)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.clay)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.pumpkin)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.melon_block)] = true; + carriableBlocks[Block.getIdFromBlock(Blocks.mycelium)] = true; + for (int x = 0; x < carriableBlocks.length; x++) + { + if (carriableBlocks[x]) setCarriable(Block.getBlockById(x), true); + } + } + + /*===================================== Forge Start ==============================*/ + private static IdentityHashMap carriable; + public static void setCarriable(Block block, boolean canCarry) + { + if (carriable == null) carriable = new IdentityHashMap(4096); + carriable.put(block, canCarry); + } + public static boolean getCarriable(Block block) + { + Boolean ret = carriable.get(block); + return ret != null ? ret : false; + } + /*===================================== Forge End ==============================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGhast.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGhast.java new file mode 100644 index 0000000..ce47bf7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGhast.java @@ -0,0 +1,316 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityGhast extends EntityFlying implements IMob +{ + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; + /** Cooldown time between target loss and new target aquirement. */ + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; + /** The explosion radius of spawned fireballs. */ + private int explosionStrength = 1; + private static final String __OBFID = "CL_00001689"; + + public EntityGhast(World p_i1735_1_) + { + super(p_i1735_1_); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; + } + + @SideOnly(Side.CLIENT) + public boolean func_110182_bF() + { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if ("fireball".equals(source.getDamageType()) && source.getEntity() instanceof EntityPlayer) + { + super.attackEntityFrom(source, 1000.0F); + ((EntityPlayer)source.getEntity()).triggerAchievement(AchievementList.ghast); + return true; + } + else + { + return super.attackEntityFrom(source, amount); + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + protected void updateEntityActionState() + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + + this.despawnEntity(); + this.prevAttackCounter = this.attackCounter; + double d0 = this.waypointX - this.posX; + double d1 = this.waypointY - this.posY; + double d2 = this.waypointZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 < 1.0D || d3 > 3600.0D) + { + this.waypointX = this.posX + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + + if (this.courseChangeCooldown-- <= 0) + { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + d3 = (double)MathHelper.sqrt_double(d3); + + if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, d3)) + { + this.motionX += d0 / d3 * 0.1D; + this.motionY += d1 / d3 * 0.1D; + this.motionZ += d2 / d3 * 0.1D; + } + else + { + this.waypointX = this.posX; + this.waypointY = this.posY; + this.waypointZ = this.posZ; + } + } + + if (this.targetedEntity != null && this.targetedEntity.isDead) + { + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) + { + this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); + + if (this.targetedEntity != null) + { + this.aggroCooldown = 20; + } + } + + double d4 = 64.0D; + + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < d4 * d4) + { + double d5 = this.targetedEntity.posX - this.posX; + double d6 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); + double d7 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(d5, d7)) * 180.0F / (float)Math.PI; + + if (this.canEntityBeSeen(this.targetedEntity)) + { + if (this.attackCounter == 10) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + ++this.attackCounter; + + if (this.attackCounter == 20) + { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + EntityLargeFireball entitylargefireball = new EntityLargeFireball(this.worldObj, this, d5, d6, d7); + entitylargefireball.field_92057_e = this.explosionStrength; + double d8 = 4.0D; + Vec3 vec3 = this.getLook(1.0F); + entitylargefireball.posX = this.posX + vec3.xCoord * d8; + entitylargefireball.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; + entitylargefireball.posZ = this.posZ + vec3.zCoord * d8; + this.worldObj.spawnEntityInWorld(entitylargefireball); + this.attackCounter = -40; + } + } + else if (this.attackCounter > 0) + { + --this.attackCounter; + } + } + else + { + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI; + + if (this.attackCounter > 0) + { + --this.attackCounter; + } + } + + if (!this.worldObj.isRemote) + { + byte b1 = this.dataWatcher.getWatchableObjectByte(16); + byte b0 = (byte)(this.attackCounter > 10 ? 1 : 0); + + if (b1 != b0) + { + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + } + } + + /** + * True if the ghast has an unobstructed line of travel to the waypoint. + */ + private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) + { + double d4 = (this.waypointX - this.posX) / p_70790_7_; + double d5 = (this.waypointY - this.posY) / p_70790_7_; + double d6 = (this.waypointZ - this.posZ) / p_70790_7_; + AxisAlignedBB axisalignedbb = this.boundingBox.copy(); + + for (int i = 1; (double)i < p_70790_7_; ++i) + { + axisalignedbb.offset(d4, d5, d6); + + if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) + { + return false; + } + } + + return true; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.ghast.moan"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.ghast.scream"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.ghast.death"; + } + + protected Item getDropItem() + { + return Items.gunpowder; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(2) + this.rand.nextInt(1 + p_70628_2_); + int k; + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.ghast_tear, 1); + } + + j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.gunpowder, 1); + } + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 10.0F; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL; + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 1; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("ExplosionPower", this.explosionStrength); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("ExplosionPower", 99)) + { + this.explosionStrength = tagCompund.getInteger("ExplosionPower"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGiantZombie.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGiantZombie.java new file mode 100644 index 0000000..cf17907 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGiantZombie.java @@ -0,0 +1,33 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.world.World; + +public class EntityGiantZombie extends EntityMob +{ + private static final String __OBFID = "CL_00001690"; + + public EntityGiantZombie(World p_i1736_1_) + { + super(p_i1736_1_); + this.yOffset *= 6.0F; + this.setSize(this.width * 6.0F, this.height * 6.0F); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50.0D); + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) + { + return this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_) - 0.5F; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGolem.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGolem.java new file mode 100644 index 0000000..0efb25f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityGolem.java @@ -0,0 +1,60 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.world.World; + +public abstract class EntityGolem extends EntityCreature implements IAnimals +{ + private static final String __OBFID = "CL_00001644"; + + public EntityGolem(World p_i1686_1_) + { + super(p_i1686_1_); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "none"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "none"; + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityIronGolem.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityIronGolem.java new file mode 100644 index 0000000..a1a6edd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityIronGolem.java @@ -0,0 +1,310 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIDefendVillage; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookAtVillager; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIMoveTowardsTarget; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityIronGolem extends EntityGolem +{ + /** deincrements, and a distance-to-home check is done at 0 */ + private int homeCheckTimer; + Village villageObj; + private int attackTimer; + private int holdRoseTick; + private static final String __OBFID = "CL_00001652"; + + public EntityIronGolem(World p_i1694_1_) + { + super(p_i1694_1_); + this.setSize(1.4F, 2.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F)); + this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true)); + this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(5, new EntityAILookAtVillager(this)); + this.tasks.addTask(6, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIDefendVillage(this)); + this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, true, IMob.mobSelector)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + if (--this.homeCheckTimer <= 0) + { + this.homeCheckTimer = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); + + if (this.villageObj == null) + { + this.detachHome(); + } + else + { + ChunkCoordinates chunkcoordinates = this.villageObj.getCenter(); + this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); + } + } + + super.updateAITick(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Decrements the entity's air supply when underwater + */ + protected int decreaseAirSupply(int p_70682_1_) + { + return p_70682_1_; + } + + protected void collideWithEntity(Entity p_82167_1_) + { + if (p_82167_1_ instanceof IMob && this.getRNG().nextInt(20) == 0) + { + this.setAttackTarget((EntityLivingBase)p_82167_1_); + } + + super.collideWithEntity(p_82167_1_); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.attackTimer > 0) + { + --this.attackTimer; + } + + if (this.holdRoseTick > 0) + { + --this.holdRoseTick; + } + + if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int k = MathHelper.floor_double(this.posZ); + Block block = this.worldObj.getBlock(i, j, k); + + if (block.getMaterial() != Material.air) + { + this.worldObj.spawnParticle("blockcrack_" + Block.getIdFromBlock(block) + "_" + this.worldObj.getBlockMetadata(i, j, k), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D); + } + } + } + + /** + * Returns true if this entity can attack entities of the specified class. + */ + public boolean canAttackClass(Class p_70686_1_) + { + return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(p_70686_1_) ? false : super.canAttackClass(p_70686_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("PlayerCreated", this.isPlayerCreated()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setPlayerCreated(tagCompund.getBoolean("PlayerCreated")); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte)4); + boolean flag = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15))); + + if (flag) + { + p_70652_1_.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return flag; + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 4) + { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + } + else if (p_70103_1_ == 11) + { + this.holdRoseTick = 400; + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + public Village getVillage() + { + return this.villageObj; + } + + @SideOnly(Side.CLIENT) + public int getAttackTimer() + { + return this.attackTimer; + } + + public void setHoldingRose(boolean p_70851_1_) + { + this.holdRoseTick = p_70851_1_ ? 400 : 0; + this.worldObj.setEntityState(this, (byte)11); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.irongolem.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.irongolem.death"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3); + int k; + + for (k = 0; k < j; ++k) + { + this.func_145778_a(Item.getItemFromBlock(Blocks.red_flower), 1, 0.0F); + } + + k = 3 + this.rand.nextInt(3); + + for (int l = 0; l < k; ++l) + { + this.dropItem(Items.iron_ingot, 1); + } + } + + public int getHoldRoseTick() + { + return this.holdRoseTick; + } + + public boolean isPlayerCreated() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setPlayerCreated(boolean p_70849_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70849_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) + { + this.villageObj.setReputationForPlayer(this.attackingPlayer.getCommandSenderName(), -5); + } + + super.onDeath(p_70645_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMagmaCube.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMagmaCube.java new file mode 100644 index 0000000..13ad125 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMagmaCube.java @@ -0,0 +1,174 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityMagmaCube extends EntitySlime +{ + private static final String __OBFID = "CL_00001691"; + + public EntityMagmaCube(World p_i1737_1_) + { + super(p_i1737_1_); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + return this.getSlimeSize() * 3; + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + /** + * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() + */ + protected String getSlimeParticle() + { + return "flame"; + } + + protected EntitySlime createInstance() + { + return new EntityMagmaCube(this.worldObj); + } + + protected Item getDropItem() + { + return Items.magma_cream; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + Item item = this.getDropItem(); + + if (item != null && this.getSlimeSize() > 1) + { + int j = this.rand.nextInt(4) - 2; + + if (p_70628_2_ > 0) + { + j += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int k = 0; k < j; ++k) + { + this.dropItem(item, 1); + } + } + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() + { + return false; + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay() + { + return super.getJumpDelay() * 4; + } + + protected void alterSquishAmount() + { + this.squishAmount *= 0.9F; + } + + /** + * Causes this entity to do an upwards motion (jumping). + */ + protected void jump() + { + this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); + this.isAirBorne = true; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer() + { + return true; + } + + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength() + { + return super.getAttackStrength() + 2; + } + + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() + { + return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; + } + + /** + * Whether or not the current entity is in lava + */ + public boolean handleLavaMovement() + { + return false; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMob.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMob.java new file mode 100644 index 0000000..413c4e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityMob.java @@ -0,0 +1,237 @@ +package net.minecraft.entity.monster; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public abstract class EntityMob extends EntityCreature implements IMob +{ + private static final String __OBFID = "CL_00001692"; + + public EntityMob(World p_i1738_1_) + { + super(p_i1738_1_); + this.experienceValue = 5; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + this.updateArmSwingProgress(); + float f = this.getBrightness(1.0F); + + if (f > 0.5F) + { + this.entityAge += 2; + } + + super.onLivingUpdate(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) + { + this.setDead(); + } + } + + protected String getSwimSound() + { + return "game.hostile.swim"; + } + + protected String getSplashSound() + { + return "game.hostile.swim.splash"; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + return entityplayer != null && this.canEntityBeSeen(entityplayer) ? entityplayer : null; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (super.attackEntityFrom(source, amount)) + { + Entity entity = source.getEntity(); + + if (this.riddenByEntity != entity && this.ridingEntity != entity) + { + if (entity != this) + { + this.entityToAttack = entity; + } + + return true; + } + else + { + return true; + } + } + else + { + return false; + } + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "game.hostile.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "game.hostile.die"; + } + + protected String func_146067_o(int p_146067_1_) + { + return p_146067_1_ > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + + if (p_70652_1_ instanceof EntityLivingBase) + { + f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)p_70652_1_); + i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)p_70652_1_); + } + + boolean flag = p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), f); + + if (flag) + { + if (i > 0) + { + p_70652_1_.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } + + int j = EnchantmentHelper.getFireAspectModifier(this); + + if (j > 0) + { + p_70652_1_.setFire(j * 4); + } + + if (p_70652_1_ instanceof EntityLivingBase) + { + EnchantmentHelper.func_151384_a((EntityLivingBase)p_70652_1_, this); + } + + EnchantmentHelper.func_151385_b(this, p_70652_1_); + } + + return flag; + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) + { + if (this.attackTime <= 0 && p_70785_2_ < 2.0F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) + { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) + { + return 0.5F - this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.boundingBox.minY); + int k = MathHelper.floor_double(this.posZ); + + if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) + { + return false; + } + else + { + int l = this.worldObj.getBlockLightValue(i, j, k); + + if (this.worldObj.isThundering()) + { + int i1 = this.worldObj.skylightSubtracted; + this.worldObj.skylightSubtracted = 10; + l = this.worldObj.getBlockLightValue(i, j, k); + this.worldObj.skylightSubtracted = i1; + } + + return l <= this.rand.nextInt(8); + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.isValidLightLevel() && super.getCanSpawnHere(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); + } + + protected boolean func_146066_aG() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityPigZombie.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityPigZombie.java new file mode 100644 index 0000000..547c6e5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityPigZombie.java @@ -0,0 +1,230 @@ +package net.minecraft.entity.monster; + +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntityPigZombie extends EntityZombie +{ + private static final UUID field_110189_bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); + private static final AttributeModifier field_110190_br = (new AttributeModifier(field_110189_bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); + /** Above zero if this PigZombie is Angry. */ + private int angerLevel; + /** A random delay until this PigZombie next makes a sound. */ + private int randomSoundDelay; + private Entity field_110191_bu; + private static final String __OBFID = "CL_00001693"; + + public EntityPigZombie(World p_i1739_1_) + { + super(p_i1739_1_); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(field_110186_bp).setBaseValue(0.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return false; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (this.field_110191_bu != this.entityToAttack && !this.worldObj.isRemote) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(field_110190_br); + + if (this.entityToAttack != null) + { + iattributeinstance.applyModifier(field_110190_br); + } + } + + this.field_110191_bu = this.entityToAttack; + + if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) + { + this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + + super.onUpdate(); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setShort("Anger", (short)this.angerLevel); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.angerLevel = tagCompund.getShort("Anger"); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + return this.angerLevel == 0 ? null : super.findPlayerToAttack(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityPlayer) + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(32.0D, 32.0D, 32.0D)); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1 instanceof EntityPigZombie) + { + EntityPigZombie entitypigzombie = (EntityPigZombie)entity1; + entitypigzombie.becomeAngryAt(entity); + } + } + + this.becomeAngryAt(entity); + } + + return super.attackEntityFrom(source, amount); + } + } + + /** + * Causes this PigZombie to become angry at the supplied Entity (which will be a player). + */ + private void becomeAngryAt(Entity p_70835_1_) + { + this.entityToAttack = p_70835_1_; + this.angerLevel = 400 + this.rand.nextInt(400); + this.randomSoundDelay = this.rand.nextInt(40); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.zombiepig.zpig"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.zombiepig.zpighurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.zombiepig.zpigdeath"; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(2 + p_70628_2_); + int k; + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.rotten_flesh, 1); + } + + j = this.rand.nextInt(2 + p_70628_2_); + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.gold_nugget, 1); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + return false; + } + + protected void dropRareDrop(int p_70600_1_) + { + this.dropItem(Items.gold_ingot, 1); + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + super.onSpawnWithEgg(p_110161_1_); + this.setVillager(false); + return p_110161_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySilverfish.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySilverfish.java new file mode 100644 index 0000000..b51edbc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySilverfish.java @@ -0,0 +1,254 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import org.apache.commons.lang3.tuple.ImmutablePair; + +public class EntitySilverfish extends EntityMob +{ + /** A cooldown before this entity will search for another Silverfish to join them in battle. */ + private int allySummonCooldown; + private static final String __OBFID = "CL_00001696"; + + public EntitySilverfish(World p_i1740_1_) + { + super(p_i1740_1_); + this.setSize(0.3F, 0.7F); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + double d0 = 8.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, d0); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.silverfish.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.silverfish.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.silverfish.kill"; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + if (this.allySummonCooldown <= 0 && (source instanceof EntityDamageSource || source == DamageSource.magic)) + { + this.allySummonCooldown = 20; + } + + return super.attackEntityFrom(source, amount); + } + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) + { + if (this.attackTime <= 0 && p_70785_2_ < 1.2F && p_70785_1_.boundingBox.maxY > this.boundingBox.minY && p_70785_1_.boundingBox.minY < this.boundingBox.maxY) + { + this.attackTime = 20; + this.attackEntityAsMob(p_70785_1_); + } + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Item.getItemById(0); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); + } + + protected void updateEntityActionState() + { + super.updateEntityActionState(); + + if (!this.worldObj.isRemote) + { + int i; + int j; + int k; + int i1; + + if (this.allySummonCooldown > 0) + { + --this.allySummonCooldown; + + if (this.allySummonCooldown == 0) + { + i = MathHelper.floor_double(this.posX); + j = MathHelper.floor_double(this.posY); + k = MathHelper.floor_double(this.posZ); + boolean flag = false; + + for (int l = 0; !flag && l <= 5 && l >= -5; l = l <= 0 ? 1 - l : 0 - l) + { + for (i1 = 0; !flag && i1 <= 10 && i1 >= -10; i1 = i1 <= 0 ? 1 - i1 : 0 - i1) + { + for (int j1 = 0; !flag && j1 <= 10 && j1 >= -10; j1 = j1 <= 0 ? 1 - j1 : 0 - j1) + { + if (this.worldObj.getBlock(i + i1, j + l, k + j1) == Blocks.monster_egg) + { + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) + { + int k1 = this.worldObj.getBlockMetadata(i + i1, j + l, k + j1); + ImmutablePair immutablepair = BlockSilverfish.func_150197_b(k1); + this.worldObj.setBlock(i + i1, j + l, k + j1, (Block)immutablepair.getLeft(), ((Integer)immutablepair.getRight()).intValue(), 3); + } + else + { + this.worldObj.func_147480_a(i + i1, j + l, k + j1, false); + } + + Blocks.monster_egg.onBlockDestroyedByPlayer(this.worldObj, i + i1, j + l, k + j1, 0); + + if (this.rand.nextBoolean()) + { + flag = true; + break; + } + } + } + } + } + } + } + + if (this.entityToAttack == null && !this.hasPath()) + { + i = MathHelper.floor_double(this.posX); + j = MathHelper.floor_double(this.posY + 0.5D); + k = MathHelper.floor_double(this.posZ); + int l1 = this.rand.nextInt(6); + Block block = this.worldObj.getBlock(i + Facing.offsetsXForSide[l1], j + Facing.offsetsYForSide[l1], k + Facing.offsetsZForSide[l1]); + i1 = this.worldObj.getBlockMetadata(i + Facing.offsetsXForSide[l1], j + Facing.offsetsYForSide[l1], k + Facing.offsetsZForSide[l1]); + + if (BlockSilverfish.func_150196_a(block)) + { + this.worldObj.setBlock(i + Facing.offsetsXForSide[l1], j + Facing.offsetsYForSide[l1], k + Facing.offsetsZForSide[l1], Blocks.monster_egg, BlockSilverfish.func_150195_a(block, i1), 3); + this.spawnExplosionParticle(); + this.setDead(); + } + else + { + this.updateWanderPath(); + } + } + else if (this.entityToAttack != null && !this.hasPath()) + { + this.entityToAttack = null; + } + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) + { + return this.worldObj.getBlock(p_70783_1_, p_70783_2_ - 1, p_70783_3_) == Blocks.stone ? 10.0F : super.getBlockPathWeight(p_70783_1_, p_70783_2_, p_70783_3_); + } + + /** + * Checks to make sure the light is not too bright where the mob is spawning + */ + protected boolean isValidLightLevel() + { + return true; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + if (super.getCanSpawnHere()) + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return entityplayer == null; + } + else + { + return false; + } + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.ARTHROPOD; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySkeleton.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySkeleton.java new file mode 100644 index 0000000..ee43bd6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySkeleton.java @@ -0,0 +1,428 @@ +package net.minecraft.entity.monster; + +import java.util.Calendar; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIFleeSun; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIRestrictSun; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldProviderHell; + +public class EntitySkeleton extends EntityMob implements IRangedAttackMob +{ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + private static final String __OBFID = "CL_00001697"; + + public EntitySkeleton(World p_i1741_1_) + { + super(p_i1741_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIRestrictSun(this)); + this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + + if (p_i1741_1_ != null && !p_i1741_1_.isRemote) + { + this.setCombatTask(); + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(13, new Byte((byte)0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.skeleton.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.skeleton.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.skeleton.death"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.skeleton.step", 0.15F, 1.0F); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + if (super.attackEntityAsMob(p_70652_1_)) + { + if (this.getSkeletonType() == 1 && p_70652_1_ instanceof EntityLivingBase) + { + ((EntityLivingBase)p_70652_1_).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); + } + + return true; + } + else + { + return false; + } + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.worldObj.isDaytime() && !this.worldObj.isRemote) + { + float f = this.getBrightness(1.0F); + + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + + if (itemstack != null) + { + if (itemstack.isItemStackDamageable()) + { + itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2)); + + if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage()) + { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } + } + + flag = false; + } + + if (flag) + { + this.setFire(8); + } + } + } + + if (this.worldObj.isRemote && this.getSkeletonType() == 1) + { + this.setSize(0.72F, 2.34F); + } + + super.onLivingUpdate(); + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() + { + super.updateRidden(); + + if (this.ridingEntity instanceof EntityCreature) + { + EntityCreature entitycreature = (EntityCreature)this.ridingEntity; + this.renderYawOffset = entitycreature.renderYawOffset; + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + super.onDeath(p_70645_1_); + + if (p_70645_1_.getSourceOfDamage() instanceof EntityArrow && p_70645_1_.getEntity() instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_70645_1_.getEntity(); + double d0 = entityplayer.posX - this.posX; + double d1 = entityplayer.posZ - this.posZ; + + if (d0 * d0 + d1 * d1 >= 2500.0D) + { + entityplayer.triggerAchievement(AchievementList.snipeSkeleton); + } + } + } + + protected Item getDropItem() + { + return Items.arrow; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j; + int k; + + if (this.getSkeletonType() == 1) + { + j = this.rand.nextInt(3 + p_70628_2_) - 1; + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.coal, 1); + } + } + else + { + j = this.rand.nextInt(3 + p_70628_2_); + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.arrow, 1); + } + } + + j = this.rand.nextInt(3 + p_70628_2_); + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.bone, 1); + } + } + + protected void dropRareDrop(int p_70600_1_) + { + if (this.getSkeletonType() == 1) + { + this.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F); + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() + { + super.addRandomArmor(); + this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) + { + this.tasks.addTask(4, this.aiAttackOnCollide); + this.setSkeletonType(1); + this.setCurrentItemOrArmor(0, new ItemStack(Items.stone_sword)); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D); + } + else + { + this.tasks.addTask(4, this.aiArrowAttack); + this.addRandomArmor(); + this.enchantEquipment(); + } + + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)); + + if (this.getEquipmentInSlot(4) == null) + { + Calendar calendar = this.worldObj.getCurrentDate(); + + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + return p_110161_1_; + } + + /** + * sets this entity's combat AI. + */ + public void setCombatTask() + { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack itemstack = this.getHeldItem(); + + if (itemstack != null && itemstack.getItem() == Items.bow) + { + this.tasks.addTask(4, this.aiArrowAttack); + } + else + { + this.tasks.addTask(4, this.aiAttackOnCollide); + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) + { + EntityArrow entityarrow = new EntityArrow(this.worldObj, this, p_82196_1_, 1.6F, (float)(14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow.setDamage((double)(p_82196_2_ * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + + if (i > 0) + { + entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); + } + + if (j > 0) + { + entityarrow.setKnockbackStrength(j); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) + { + entityarrow.setFire(100); + } + + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entityarrow); + } + + /** + * Return this skeleton's type. + */ + public int getSkeletonType() + { + return this.dataWatcher.getWatchableObjectByte(13); + } + + /** + * Set this skeleton's type. + */ + public void setSkeletonType(int p_82201_1_) + { + this.dataWatcher.updateObject(13, Byte.valueOf((byte)p_82201_1_)); + this.isImmuneToFire = p_82201_1_ == 1; + + if (p_82201_1_ == 1) + { + this.setSize(0.72F, 2.34F); + } + else + { + this.setSize(0.6F, 1.8F); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("SkeletonType", 99)) + { + byte b0 = tagCompund.getByte("SkeletonType"); + this.setSkeletonType(b0); + } + + this.setCombatTask(); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setByte("SkeletonType", (byte)this.getSkeletonType()); + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn) + { + super.setCurrentItemOrArmor(slotIn, itemStackIn); + + if (!this.worldObj.isRemote && slotIn == 0) + { + this.setCombatTask(); + } + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() + { + return super.getYOffset() - 0.5D; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySlime.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySlime.java new file mode 100644 index 0000000..47f4ad0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySlime.java @@ -0,0 +1,350 @@ +package net.minecraft.entity.monster; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +public class EntitySlime extends EntityLiving implements IMob +{ + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; + /** ticks until this slime jumps again */ + private int slimeJumpDelay; + private static final String __OBFID = "CL_00001698"; + + public EntitySlime(World p_i1742_1_) + { + super(p_i1742_1_); + int i = 1 << this.rand.nextInt(3); + this.yOffset = 0.0F; + this.slimeJumpDelay = this.rand.nextInt(20) + 10; + this.setSlimeSize(i); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)1)); + } + + protected void setSlimeSize(int p_70799_1_) + { + this.dataWatcher.updateObject(16, new Byte((byte)p_70799_1_)); + this.setSize(0.6F * (float)p_70799_1_, 0.6F * (float)p_70799_1_); + this.setPosition(this.posX, this.posY, this.posZ); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue((double)(p_70799_1_ * p_70799_1_)); + this.setHealth(this.getMaxHealth()); + this.experienceValue = p_70799_1_; + } + + /** + * Returns the size of the slime. + */ + public int getSlimeSize() + { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Size", this.getSlimeSize() - 1); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + int i = tagCompund.getInteger("Size"); + + if (i < 0) + { + i = 0; + } + + this.setSlimeSize(i + 1); + } + + /** + * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() + */ + protected String getSlimeParticle() + { + return "slime"; + } + + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL && this.getSlimeSize() > 0) + { + this.isDead = true; + } + + this.squishFactor += (this.squishAmount - this.squishFactor) * 0.5F; + this.prevSquishFactor = this.squishFactor; + boolean flag = this.onGround; + super.onUpdate(); + int i; + + if (this.onGround && !flag) + { + i = this.getSlimeSize(); + + for (int j = 0; j < i * 8; ++j) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = this.rand.nextFloat() * 0.5F + 0.5F; + float f2 = MathHelper.sin(f) * (float)i * 0.5F * f1; + float f3 = MathHelper.cos(f) * (float)i * 0.5F * f1; + this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)f2, this.boundingBox.minY, this.posZ + (double)f3, 0.0D, 0.0D, 0.0D); + } + + if (this.makesSoundOnLand()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } + + this.squishAmount = -0.5F; + } + else if (!this.onGround && flag) + { + this.squishAmount = 1.0F; + } + + this.alterSquishAmount(); + + if (this.worldObj.isRemote) + { + i = this.getSlimeSize(); + this.setSize(0.6F * (float)i, 0.6F * (float)i); + } + } + + protected void updateEntityActionState() + { + this.despawnEntity(); + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + + if (entityplayer != null) + { + this.faceEntity(entityplayer, 10.0F, 20.0F); + } + + if (this.onGround && this.slimeJumpDelay-- <= 0) + { + this.slimeJumpDelay = this.getJumpDelay(); + + if (entityplayer != null) + { + this.slimeJumpDelay /= 3; + } + + this.isJumping = true; + + if (this.makesSoundOnJump()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + + this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float)(1 * this.getSlimeSize()); + } + else + { + this.isJumping = false; + + if (this.onGround) + { + this.moveStrafing = this.moveForward = 0.0F; + } + } + } + + protected void alterSquishAmount() + { + this.squishAmount *= 0.6F; + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay() + { + return this.rand.nextInt(20) + 10; + } + + protected EntitySlime createInstance() + { + return new EntitySlime(this.worldObj); + } + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + int i = this.getSlimeSize(); + + if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0.0F) + { + int j = 2 + this.rand.nextInt(3); + + for (int k = 0; k < j; ++k) + { + float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F; + float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F; + EntitySlime entityslime = this.createInstance(); + entityslime.setSlimeSize(i / 2); + entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityslime); + } + } + + super.setDead(); + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (this.canDamagePlayer()) + { + int i = this.getSlimeSize(); + + if (this.canEntityBeSeen(entityIn) && this.getDistanceSqToEntity(entityIn) < 0.6D * (double)i * 0.6D * (double)i && entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) + { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + } + + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer() + { + return this.getSlimeSize() > 1; + } + + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength() + { + return this.getSlimeSize(); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + protected Item getDropItem() + { + return this.getSlimeSize() == 1 ? Items.slime_ball : Item.getItemById(0); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + Chunk chunk = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (this.worldObj.getWorldInfo().getTerrainType().handleSlimeSpawnReduction(rand, worldObj)) + { + return false; + } + else + { + if (this.getSlimeSize() == 1 || this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (biomegenbase == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.rand.nextInt(8)) + { + return super.getCanSpawnHere(); + } + + if (this.rand.nextInt(10) == 0 && chunk.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) + { + return super.getCanSpawnHere(); + } + } + + return false; + } + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F * (float)this.getSlimeSize(); + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return 0; + } + + /** + * Returns true if the slime makes a sound when it jumps (based upon the slime's size) + */ + protected boolean makesSoundOnJump() + { + return this.getSlimeSize() > 0; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand() + { + return this.getSlimeSize() > 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySnowman.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySnowman.java new file mode 100644 index 0000000..8dc8bb1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySnowman.java @@ -0,0 +1,120 @@ +package net.minecraft.entity.monster; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySnowman extends EntityGolem implements IRangedAttackMob +{ + private static final String __OBFID = "CL_00001650"; + + public EntitySnowman(World p_i1692_1_) + { + super(p_i1692_1_); + this.setSize(0.4F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(4, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + if (this.isWet()) + { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + if (this.worldObj.getBiomeGenForCoords(i, k).getFloatTemperature(i, j, k) > 1.0F) + { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + for (int l = 0; l < 4; ++l) + { + i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); + j = MathHelper.floor_double(this.posY); + k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); + + if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.air && this.worldObj.getBiomeGenForCoords(i, k).getFloatTemperature(i, j, k) < 0.8F && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, i, j, k)) + { + this.worldObj.setBlock(i, j, k, Blocks.snow_layer); + } + } + } + + protected Item getDropItem() + { + return Items.snowball; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(16); + + for (int k = 0; k < j; ++k) + { + this.dropItem(Items.snowball, 1); + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) + { + EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this); + double d0 = p_82196_1_.posX - this.posX; + double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - entitysnowball.posY; + double d2 = p_82196_1_.posZ - this.posZ; + float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F; + entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entitysnowball); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySpider.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySpider.java new file mode 100644 index 0000000..3b48cc1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntitySpider.java @@ -0,0 +1,270 @@ +package net.minecraft.entity.monster; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class EntitySpider extends EntityMob +{ + private static final String __OBFID = "CL_00001699"; + + public EntitySpider(World p_i1743_1_) + { + super(p_i1743_1_); + this.setSize(1.4F, 0.9F); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (!this.worldObj.isRemote) + { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.800000011920929D); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + float f = this.getBrightness(1.0F); + + if (f < 0.5F) + { + double d0 = 16.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, d0); + } + else + { + return null; + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.spider.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.spider.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.spider.death"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.spider.step", 0.15F, 1.0F); + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) + { + float f1 = this.getBrightness(1.0F); + + if (f1 > 0.5F && this.rand.nextInt(100) == 0) + { + this.entityToAttack = null; + } + else + { + if (p_70785_2_ > 2.0F && p_70785_2_ < 6.0F && this.rand.nextInt(10) == 0) + { + if (this.onGround) + { + double d0 = p_70785_1_.posX - this.posX; + double d1 = p_70785_1_.posZ - this.posZ; + float f2 = MathHelper.sqrt_double(d0 * d0 + d1 * d1); + this.motionX = d0 / (double)f2 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D; + this.motionZ = d1 / (double)f2 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; + this.motionY = 0.4000000059604645D; + } + } + else + { + super.attackEntity(p_70785_1_, p_70785_2_); + } + } + } + + protected Item getDropItem() + { + return Items.string; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + super.dropFewItems(p_70628_1_, p_70628_2_); + + if (p_70628_1_ && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + p_70628_2_) > 0)) + { + this.dropItem(Items.spider_eye, 1); + } + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() + { + return this.isBesideClimbableBlock(); + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() {} + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.ARTHROPOD; + } + + public boolean isPotionApplicable(PotionEffect p_70687_1_) + { + return p_70687_1_.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(p_70687_1_); + } + + /** + * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using + * setBesideClimableBlock. + */ + public boolean isBesideClimbableBlock() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /** + * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is + * false. + */ + public void setBesideClimbableBlock(boolean p_70839_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70839_1_) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 &= -2; + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.rand.nextInt(100) == 0) + { + EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); + entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityskeleton.onSpawnWithEgg((IEntityLivingData)null); + this.worldObj.spawnEntityInWorld(entityskeleton); + entityskeleton.mountEntity(this); + } + + if (p_110161_1_1 == null) + { + p_110161_1_1 = new EntitySpider.GroupData(); + + if (this.worldObj.difficultySetting == EnumDifficulty.HARD && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.func_147462_b(this.posX, this.posY, this.posZ)) + { + ((EntitySpider.GroupData)p_110161_1_1).func_111104_a(this.worldObj.rand); + } + } + + if (p_110161_1_1 instanceof EntitySpider.GroupData) + { + int i = ((EntitySpider.GroupData)p_110161_1_1).field_111105_a; + + if (i > 0 && Potion.potionTypes[i] != null) + { + this.addPotionEffect(new PotionEffect(i, Integer.MAX_VALUE)); + } + } + + return (IEntityLivingData)p_110161_1_1; + } + + public static class GroupData implements IEntityLivingData + { + public int field_111105_a; + private static final String __OBFID = "CL_00001700"; + + public void func_111104_a(Random p_111104_1_) + { + int i = p_111104_1_.nextInt(5); + + if (i <= 1) + { + this.field_111105_a = Potion.moveSpeed.id; + } + else if (i <= 2) + { + this.field_111105_a = Potion.damageBoost.id; + } + else if (i <= 3) + { + this.field_111105_a = Potion.regeneration.id; + } + else if (i <= 4) + { + this.field_111105_a = Potion.invisibility.id; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityWitch.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityWitch.java new file mode 100644 index 0000000..eef8f15 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityWitch.java @@ -0,0 +1,290 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIArrowAttack; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWitch extends EntityMob implements IRangedAttackMob +{ + private static final UUID field_110184_bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); + private static final AttributeModifier field_110185_bq = (new AttributeModifier(field_110184_bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); + /** List of items a witch should drop on death. */ + private static final Item[] witchDrops = new Item[] {Items.glowstone_dust, Items.sugar, Items.redstone, Items.spider_eye, Items.glass_bottle, Items.gunpowder, Items.stick, Items.stick}; + /** + * Timer used as interval for a witch's attack, decremented every tick if aggressive and when reaches zero the witch + * will throw a potion at the target entity. + */ + private int witchAttackTimer; + private static final String __OBFID = "CL_00001701"; + + public EntityWitch(World p_i1744_1_) + { + super(p_i1744_1_); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(3, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(21, Byte.valueOf((byte)0)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.witch.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.witch.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.witch.death"; + } + + /** + * Set whether this witch is aggressive at an entity. + */ + public void setAggressive(boolean p_82197_1_) + { + this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(p_82197_1_ ? 1 : 0))); + } + + /** + * Return whether this witch is aggressive at an entity. + */ + public boolean getAggressive() + { + return this.getDataWatcher().getWatchableObjectByte(21) == 1; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(26.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (!this.worldObj.isRemote) + { + if (this.getAggressive()) + { + if (this.witchAttackTimer-- <= 0) + { + this.setAggressive(false); + ItemStack itemstack = this.getHeldItem(); + this.setCurrentItemOrArmor(0, (ItemStack)null); + + if (itemstack != null && itemstack.getItem() == Items.potionitem) + { + List list = Items.potionitem.getEffects(itemstack); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + this.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(field_110185_bq); + } + } + else + { + short short1 = -1; + + if (this.rand.nextFloat() < 0.15F && this.isInsideOfMaterial(Material.water) && !this.isPotionActive(Potion.waterBreathing)) + { + short1 = 8237; + } + else if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) + { + short1 = 16307; + } + else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) + { + short1 = 16341; + } + else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) + { + short1 = 16274; + } + else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) + { + short1 = 16274; + } + + if (short1 > -1) + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.potionitem, 1, short1)); + this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); + this.setAggressive(true); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(field_110185_bq); + iattributeinstance.applyModifier(field_110185_bq); + } + } + + if (this.rand.nextFloat() < 7.5E-4F) + { + this.worldObj.setEntityState(this, (byte)15); + } + } + + super.onLivingUpdate(); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 15) + { + for (int i = 0; i < this.rand.nextInt(35) + 10; ++i) + { + this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); + } + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Reduces damage, depending on potions + */ + protected float applyPotionDamageCalculations(DamageSource p_70672_1_, float p_70672_2_) + { + p_70672_2_ = super.applyPotionDamageCalculations(p_70672_1_, p_70672_2_); + + if (p_70672_1_.getEntity() == this) + { + p_70672_2_ = 0.0F; + } + + if (p_70672_1_.isMagicDamage()) + { + p_70672_2_ = (float)((double)p_70672_2_ * 0.15D); + } + + return p_70672_2_; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3) + 1; + + for (int k = 0; k < j; ++k) + { + int l = this.rand.nextInt(3); + Item item = witchDrops[this.rand.nextInt(witchDrops.length)]; + + if (p_70628_2_ > 0) + { + l += this.rand.nextInt(p_70628_2_ + 1); + } + + for (int i1 = 0; i1 < l; ++i1) + { + this.dropItem(item, 1); + } + } + } + + /** + * Attack the specified entity using a ranged attack. + */ + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) + { + if (!this.getAggressive()) + { + EntityPotion entitypotion = new EntityPotion(this.worldObj, this, 32732); + entitypotion.rotationPitch -= -20.0F; + double d0 = p_82196_1_.posX + p_82196_1_.motionX - this.posX; + double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - this.posY; + double d2 = p_82196_1_.posZ + p_82196_1_.motionZ - this.posZ; + float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (f1 >= 8.0F && !p_82196_1_.isPotionActive(Potion.moveSlowdown)) + { + entitypotion.setPotionDamage(32698); + } + else if (p_82196_1_.getHealth() >= 8.0F && !p_82196_1_.isPotionActive(Potion.poison)) + { + entitypotion.setPotionDamage(32660); + } + else if (f1 <= 3.0F && !p_82196_1_.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F) + { + entitypotion.setPotionDamage(32696); + } + + entitypotion.setThrowableHeading(d0, d1 + (double)(f1 * 0.2F), d2, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(entitypotion); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityZombie.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityZombie.java new file mode 100644 index 0000000..1bdd5ed --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/EntityZombie.java @@ -0,0 +1,765 @@ +package net.minecraft.entity.monster; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Calendar; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBreakDoor; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMoveThroughVillage; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeModContainer; +import cpw.mods.fml.common.eventhandler.Event.Result; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent; + +public class EntityZombie extends EntityMob +{ + protected static final IAttribute field_110186_bp = (new RangedAttribute("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).setDescription("Spawn Reinforcements Chance"); + private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); + private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1); + private final EntityAIBreakDoor field_146075_bs = new EntityAIBreakDoor(this); + /** Ticker used to determine the time remaining for this zombie to convert into a villager when cured. */ + private int conversionTime; + private boolean field_146076_bu = false; + private float field_146074_bv = -1.0F; + private float field_146073_bw; + private static final String __OBFID = "CL_00001702"; + + public EntityZombie(World p_i1745_1_) + { + super(p_i1745_1_); + this.getNavigator().setBreakDoors(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); + this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false)); + this.setSize(0.6F, 1.8F); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); + this.getAttributeMap().registerAttribute(field_110186_bp).setBaseValue(this.rand.nextDouble() * ForgeModContainer.zombieSummonBaseChance); + } + + protected void entityInit() + { + super.entityInit(); + this.getDataWatcher().addObject(12, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(13, Byte.valueOf((byte)0)); + this.getDataWatcher().addObject(14, Byte.valueOf((byte)0)); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + int i = super.getTotalArmorValue() + 2; + + if (i > 20) + { + i = 20; + } + + return i; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + public boolean func_146072_bX() + { + return this.field_146076_bu; + } + + public void func_146070_a(boolean p_146070_1_) + { + if (this.field_146076_bu != p_146070_1_) + { + this.field_146076_bu = p_146070_1_; + + if (p_146070_1_) + { + this.tasks.addTask(1, this.field_146075_bs); + } + else + { + this.tasks.removeTask(this.field_146075_bs); + } + } + } + + /** + * If Animal, checks if the age timer is negative + */ + public boolean isChild() + { + return this.getDataWatcher().getWatchableObjectByte(12) == 1; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + if (this.isChild()) + { + this.experienceValue = (int)((float)this.experienceValue * 2.5F); + } + + return super.getExperiencePoints(p_70693_1_); + } + + /** + * Set whether this zombie is a child. + */ + public void setChild(boolean p_82227_1_) + { + this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(p_82227_1_ ? 1 : 0))); + + if (this.worldObj != null && !this.worldObj.isRemote) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + iattributeinstance.removeModifier(babySpeedBoostModifier); + + if (p_82227_1_) + { + iattributeinstance.applyModifier(babySpeedBoostModifier); + } + } + + this.func_146071_k(p_82227_1_); + } + + /** + * Return whether this zombie is a villager. + */ + public boolean isVillager() + { + return this.getDataWatcher().getWatchableObjectByte(13) == 1; + } + + /** + * Set whether this zombie is a villager. + */ + public void setVillager(boolean p_82229_1_) + { + this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(p_82229_1_ ? 1 : 0))); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) + { + float f = this.getBrightness(1.0F); + + if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + boolean flag = true; + ItemStack itemstack = this.getEquipmentInSlot(4); + + if (itemstack != null) + { + if (itemstack.isItemStackDamageable()) + { + itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2)); + + if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage()) + { + this.renderBrokenItemStack(itemstack); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } + } + + flag = false; + } + + if (flag) + { + this.setFire(8); + } + } + } + + if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken) + { + ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D); + } + + super.onLivingUpdate(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (!super.attackEntityFrom(source, amount)) + { + return false; + } + else + { + EntityLivingBase entitylivingbase = this.getAttackTarget(); + + if (entitylivingbase == null && this.getEntityToAttack() instanceof EntityLivingBase) + { + entitylivingbase = (EntityLivingBase)this.getEntityToAttack(); + } + + if (entitylivingbase == null && source.getEntity() instanceof EntityLivingBase) + { + entitylivingbase = (EntityLivingBase)source.getEntity(); + } + + + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posY); + int k = MathHelper.floor_double(this.posZ); + + SummonAidEvent summonAid = ForgeEventFactory.fireZombieSummonAid(this, worldObj, i, j, k, entitylivingbase, this.getEntityAttribute(field_110186_bp).getAttributeValue()); + + if (summonAid.getResult() == Result.DENY) + { + return true; + } + else if (summonAid.getResult() == Result.ALLOW || entitylivingbase != null && this.worldObj.difficultySetting == EnumDifficulty.HARD && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) + { + EntityZombie entityzombie; + if (summonAid.customSummonedAid != null && summonAid.getResult() == Result.ALLOW) + { + entityzombie = summonAid.customSummonedAid; + } + else + { + entityzombie = new EntityZombie(this.worldObj); + } + + for (int l = 0; l < 50; ++l) + { + int i1 = i + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int j1 = j + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + int k1 = k + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); + + if (World.doesBlockHaveSolidTopSurface(this.worldObj, i1, j1 - 1, k1) && this.worldObj.getBlockLightValue(i1, j1, k1) < 10) + { + entityzombie.setPosition((double)i1, (double)j1, (double)k1); + + if (this.worldObj.checkNoEntityCollision(entityzombie.boundingBox) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.boundingBox)) + { + this.worldObj.spawnEntityInWorld(entityzombie); + if (entitylivingbase != null) entityzombie.setAttackTarget(entitylivingbase); + entityzombie.onSpawnWithEgg((IEntityLivingData)null); + this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + break; + } + } + } + } + + return true; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (!this.worldObj.isRemote && this.isConverting()) + { + int i = this.getConversionTimeBoost(); + this.conversionTime -= i; + + if (this.conversionTime <= 0) + { + this.convertToVillager(); + } + } + + super.onUpdate(); + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + boolean flag = super.attackEntityAsMob(p_70652_1_); + + if (flag) + { + int i = this.worldObj.difficultySetting.getDifficultyId(); + + if (this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)i * 0.3F) + { + p_70652_1_.setFire(2 * i); + } + } + + return flag; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.zombie.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.zombie.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.zombie.death"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Items.rotten_flesh; + } + + /** + * Get this Entity's EnumCreatureAttribute + */ + public EnumCreatureAttribute getCreatureAttribute() + { + return EnumCreatureAttribute.UNDEAD; + } + + protected void dropRareDrop(int p_70600_1_) + { + switch (this.rand.nextInt(3)) + { + case 0: + this.dropItem(Items.iron_ingot, 1); + break; + case 1: + this.dropItem(Items.carrot, 1); + break; + case 2: + this.dropItem(Items.potato, 1); + } + } + + /** + * Makes entity wear random armor based on difficulty + */ + protected void addRandomArmor() + { + super.addRandomArmor(); + + if (this.rand.nextFloat() < (this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.05F : 0.01F)) + { + int i = this.rand.nextInt(3); + + if (i == 0) + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); + } + else + { + this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_shovel)); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.isChild()) + { + tagCompound.setBoolean("IsBaby", true); + } + + if (this.isVillager()) + { + tagCompound.setBoolean("IsVillager", true); + } + + tagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); + tagCompound.setBoolean("CanBreakDoors", this.func_146072_bX()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.getBoolean("IsBaby")) + { + this.setChild(true); + } + + if (tagCompund.getBoolean("IsVillager")) + { + this.setVillager(true); + } + + if (tagCompund.hasKey("ConversionTime", 99) && tagCompund.getInteger("ConversionTime") > -1) + { + this.startConversion(tagCompund.getInteger("ConversionTime")); + } + + this.func_146070_a(tagCompund.getBoolean("CanBreakDoors")); + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entityLivingIn) + { + super.onKillEntity(entityLivingIn); + + if ((this.worldObj.difficultySetting == EnumDifficulty.NORMAL || this.worldObj.difficultySetting == EnumDifficulty.HARD) && entityLivingIn instanceof EntityVillager) + { + if (this.worldObj.difficultySetting != EnumDifficulty.HARD && this.rand.nextBoolean()) + { + return; + } + + EntityZombie entityzombie = new EntityZombie(this.worldObj); + entityzombie.copyLocationAndAnglesFrom(entityLivingIn); + this.worldObj.removeEntity(entityLivingIn); + entityzombie.onSpawnWithEgg((IEntityLivingData)null); + entityzombie.setVillager(true); + + if (entityLivingIn.isChild()) + { + entityzombie.setChild(true); + } + + this.worldObj.spawnEntityInWorld(entityzombie); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f); + + if (p_110161_1_1 == null) + { + p_110161_1_1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null); + } + + if (p_110161_1_1 instanceof EntityZombie.GroupData) + { + EntityZombie.GroupData groupdata = (EntityZombie.GroupData)p_110161_1_1; + + if (groupdata.field_142046_b) + { + this.setVillager(true); + } + + if (groupdata.field_142048_a) + { + this.setChild(true); + + if ((double)this.worldObj.rand.nextFloat() < 0.05D) + { + List list = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b); + + if (!list.isEmpty()) + { + EntityChicken entitychicken = (EntityChicken)list.get(0); + entitychicken.func_152117_i(true); + this.mountEntity(entitychicken); + } + } + else if ((double)this.worldObj.rand.nextFloat() < 0.05D) + { + EntityChicken entitychicken1 = new EntityChicken(this.worldObj); + entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entitychicken1.onSpawnWithEgg((IEntityLivingData)null); + entitychicken1.func_152117_i(true); + this.worldObj.spawnEntityInWorld(entitychicken1); + this.mountEntity(entitychicken1); + } + } + } + + this.func_146070_a(this.rand.nextFloat() < f * 0.1F); + this.addRandomArmor(); + this.enchantEquipment(); + + if (this.getEquipmentInSlot(4) == null) + { + Calendar calendar = this.worldObj.getCurrentDate(); + + if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F) + { + this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + + this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); + double d0 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + + if (d0 > 1.0D) + { + this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2)); + } + + if (this.rand.nextFloat() < f * 0.05F) + { + this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); + this.func_146070_a(true); + } + + return (IEntityLivingData)p_110161_1_1; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.getCurrentEquippedItem(); + + if (itemstack != null && itemstack.getItem() == Items.golden_apple && itemstack.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) + { + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + this.startConversion(this.rand.nextInt(2401) + 3600); + } + + return true; + } + else + { + return false; + } + } + + /** + * Starts converting this zombie into a villager. The zombie converts into a villager after the specified time in + * ticks. + */ + protected void startConversion(int p_82228_1_) + { + this.conversionTime = p_82228_1_; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); + this.removePotionEffect(Potion.weakness.id); + this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, p_82228_1_, Math.min(this.worldObj.difficultySetting.getDifficultyId() - 1, 0))); + this.worldObj.setEntityState(this, (byte)16); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 16) + { + this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return !this.isConverting(); + } + + /** + * Returns whether this zombie is in the process of converting to a villager + */ + public boolean isConverting() + { + return this.getDataWatcher().getWatchableObjectByte(14) == 1; + } + + /** + * Convert this zombie into a villager. + */ + protected void convertToVillager() + { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.copyLocationAndAnglesFrom(this); + entityvillager.onSpawnWithEgg((IEntityLivingData)null); + entityvillager.setLookingForHome(); + + if (this.isChild()) + { + entityvillager.setGrowingAge(-24000); + } + + this.worldObj.removeEntity(this); + this.worldObj.spawnEntityInWorld(entityvillager); + entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0)); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + /** + * Return the amount of time decremented from conversionTime every tick. + */ + protected int getConversionTimeBoost() + { + int i = 1; + + if (this.rand.nextFloat() < 0.01F) + { + int j = 0; + + for (int k = (int)this.posX - 4; k < (int)this.posX + 4 && j < 14; ++k) + { + for (int l = (int)this.posY - 4; l < (int)this.posY + 4 && j < 14; ++l) + { + for (int i1 = (int)this.posZ - 4; i1 < (int)this.posZ + 4 && j < 14; ++i1) + { + Block block = this.worldObj.getBlock(k, l, i1); + + if (block == Blocks.iron_bars || block == Blocks.bed) + { + if (this.rand.nextFloat() < 0.3F) + { + ++i; + } + + ++j; + } + } + } + } + } + + return i; + } + + public void func_146071_k(boolean p_146071_1_) + { + this.func_146069_a(p_146071_1_ ? 0.5F : 1.0F); + } + + /** + * Sets the width and height of the entity. Args: width, height + */ + protected final void setSize(float width, float height) + { + boolean flag = this.field_146074_bv > 0.0F && this.field_146073_bw > 0.0F; + this.field_146074_bv = width; + this.field_146073_bw = height; + + if (!flag) + { + this.func_146069_a(1.0F); + } + } + + protected final void func_146069_a(float p_146069_1_) + { + super.setSize(this.field_146074_bv * p_146069_1_, this.field_146073_bw * p_146069_1_); + } + + class GroupData implements IEntityLivingData + { + public boolean field_142048_a; + public boolean field_142046_b; + private static final String __OBFID = "CL_00001704"; + + private GroupData(boolean p_i2348_2_, boolean p_i2348_3_) + { + this.field_142048_a = false; + this.field_142046_b = false; + this.field_142048_a = p_i2348_2_; + this.field_142046_b = p_i2348_3_; + } + + GroupData(boolean p_i2349_2_, boolean p_i2349_3_, Object p_i2349_4_) + { + this(p_i2349_2_, p_i2349_3_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/monster/IMob.java b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/IMob.java new file mode 100644 index 0000000..dadae38 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/monster/IMob.java @@ -0,0 +1,21 @@ +package net.minecraft.entity.monster; + +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.IAnimals; + +public interface IMob extends IAnimals +{ + /** Entity selector for IMob types. */ + IEntitySelector mobSelector = new IEntitySelector() + { + private static final String __OBFID = "CL_00001688"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_ instanceof IMob; + } + }; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAmbientCreature.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAmbientCreature.java new file mode 100644 index 0000000..2f32ce3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAmbientCreature.java @@ -0,0 +1,28 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public abstract class EntityAmbientCreature extends EntityLiving implements IAnimals +{ + private static final String __OBFID = "CL_00001636"; + + public EntityAmbientCreature(World p_i1679_1_) + { + super(p_i1679_1_); + } + + public boolean allowLeashing() + { + return false; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + protected boolean interact(EntityPlayer p_70085_1_) + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAnimal.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAnimal.java new file mode 100644 index 0000000..cbf04ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityAnimal.java @@ -0,0 +1,443 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatList; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public abstract class EntityAnimal extends EntityAgeable implements IAnimals +{ + private int inLove; + /** + * This is representation of a counter for reproduction progress. (Note that this is different from the inLove which + * represent being in Love-Mode) + */ + private int breeding; + private EntityPlayer field_146084_br; + private static final String __OBFID = "CL_00001638"; + + public EntityAnimal(World p_i1681_1_) + { + super(p_i1681_1_); + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + if (this.getGrowingAge() != 0) + { + this.inLove = 0; + } + + super.updateAITick(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (this.getGrowingAge() != 0) + { + this.inLove = 0; + } + + if (this.inLove > 0) + { + --this.inLove; + String s = "heart"; + + if (this.inLove % 10 == 0) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(s, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + } + else + { + this.breeding = 0; + } + } + + /** + * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. + */ + protected void attackEntity(Entity p_70785_1_, float p_70785_2_) + { + if (p_70785_1_ instanceof EntityPlayer) + { + if (p_70785_2_ < 3.0F) + { + double d0 = p_70785_1_.posX - this.posX; + double d1 = p_70785_1_.posZ - this.posZ; + this.rotationYaw = (float)(Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } + + EntityPlayer entityplayer = (EntityPlayer)p_70785_1_; + + if (entityplayer.getCurrentEquippedItem() == null || !this.isBreedingItem(entityplayer.getCurrentEquippedItem())) + { + this.entityToAttack = null; + } + } + else if (p_70785_1_ instanceof EntityAnimal) + { + EntityAnimal entityanimal = (EntityAnimal)p_70785_1_; + + if (this.getGrowingAge() > 0 && entityanimal.getGrowingAge() < 0) + { + if ((double)p_70785_2_ < 2.5D) + { + this.hasAttacked = true; + } + } + else if (this.inLove > 0 && entityanimal.inLove > 0) + { + if (entityanimal.entityToAttack == null) + { + entityanimal.entityToAttack = this; + } + + if (entityanimal.entityToAttack == this && (double)p_70785_2_ < 3.5D) + { + ++entityanimal.inLove; + ++this.inLove; + ++this.breeding; + + if (this.breeding % 4 == 0) + { + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); + } + + if (this.breeding == 60) + { + this.procreate((EntityAnimal)p_70785_1_); + } + } + else + { + this.breeding = 0; + } + } + else + { + this.breeding = 0; + this.entityToAttack = null; + } + } + } + + /** + * Creates a baby animal according to the animal type of the target at the actual position and spawns 'love' + * particles. + */ + private void procreate(EntityAnimal p_70876_1_) + { + EntityAgeable entityageable = this.createChild(p_70876_1_); + + if (entityageable != null) + { + if (this.field_146084_br == null && p_70876_1_.func_146083_cb() != null) + { + this.field_146084_br = p_70876_1_.func_146083_cb(); + } + + if (this.field_146084_br != null) + { + this.field_146084_br.triggerAchievement(StatList.field_151186_x); + + if (this instanceof EntityCow) + { + this.field_146084_br.triggerAchievement(AchievementList.field_150962_H); + } + } + + this.setGrowingAge(6000); + p_70876_1_.setGrowingAge(6000); + this.inLove = 0; + this.breeding = 0; + this.entityToAttack = null; + p_70876_1_.entityToAttack = null; + p_70876_1_.breeding = 0; + p_70876_1_.inLove = 0; + entityageable.setGrowingAge(-24000); + entityageable.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + + this.worldObj.spawnEntityInWorld(entityageable); + } + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.fleeingTick = 60; + + if (!this.isAIEnabled()) + { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (iattributeinstance.getModifier(field_110179_h) == null) + { + iattributeinstance.applyModifier(field_110181_i); + } + } + + this.entityToAttack = null; + this.inLove = 0; + return super.attackEntityFrom(source, amount); + } + } + + /** + * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. + * Args: x, y, z + */ + public float getBlockPathWeight(int p_70783_1_, int p_70783_2_, int p_70783_3_) + { + return this.worldObj.getBlock(p_70783_1_, p_70783_2_ - 1, p_70783_3_) == Blocks.grass ? 10.0F : this.worldObj.getLightBrightness(p_70783_1_, p_70783_2_, p_70783_3_) - 0.5F; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("InLove", this.inLove); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.inLove = tagCompund.getInteger("InLove"); + } + + /** + * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking + * (Animals, Spiders at day, peaceful PigZombies). + */ + protected Entity findPlayerToAttack() + { + if (this.fleeingTick > 0) + { + return null; + } + else + { + float f = 8.0F; + List list; + int i; + EntityAnimal entityanimal; + + if (this.inLove > 0) + { + list = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)f, (double)f, (double)f)); + + for (i = 0; i < list.size(); ++i) + { + entityanimal = (EntityAnimal)list.get(i); + + if (entityanimal != this && entityanimal.inLove > 0) + { + return entityanimal; + } + } + } + else if (this.getGrowingAge() == 0) + { + list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand((double)f, (double)f, (double)f)); + + for (i = 0; i < list.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)list.get(i); + + if (entityplayer.getCurrentEquippedItem() != null && this.isBreedingItem(entityplayer.getCurrentEquippedItem())) + { + return entityplayer; + } + } + } + else if (this.getGrowingAge() > 0) + { + list = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)f, (double)f, (double)f)); + + for (i = 0; i < list.size(); ++i) + { + entityanimal = (EntityAnimal)list.get(i); + + if (entityanimal != this && entityanimal.getGrowingAge() < 0) + { + return entityanimal; + } + } + } + + return null; + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.boundingBox.minY); + int k = MathHelper.floor_double(this.posZ); + return this.worldObj.getBlock(i, j - 1, k) == Blocks.grass && this.worldObj.getFullBlockLightValue(i, j, k) > 8 && super.getCanSpawnHere(); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 1 + this.worldObj.rand.nextInt(3); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return p_70877_1_.getItem() == Items.wheat; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && this.isBreedingItem(itemstack) && this.getGrowingAge() == 0 && this.inLove <= 0) + { + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + } + + this.func_146082_f(p_70085_1_); + return true; + } + else + { + return super.interact(p_70085_1_); + } + } + + public void func_146082_f(EntityPlayer p_146082_1_) + { + this.inLove = 600; + this.field_146084_br = p_146082_1_; + this.entityToAttack = null; + this.worldObj.setEntityState(this, (byte)18); + } + + public EntityPlayer func_146083_cb() + { + return this.field_146084_br; + } + + /** + * Returns if the entity is currently in 'love mode'. + */ + public boolean isInLove() + { + return this.inLove > 0; + } + + public void resetInLove() + { + this.inLove = 0; + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) + { + return p_70878_1_ == this ? false : (p_70878_1_.getClass() != this.getClass() ? false : this.isInLove() && p_70878_1_.isInLove()); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 18) + { + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityBat.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityBat.java new file mode 100644 index 0000000..7f115ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityBat.java @@ -0,0 +1,290 @@ +package net.minecraft.entity.passive; + +import java.util.Calendar; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBat extends EntityAmbientCreature +{ + /** Coordinates of where the bat spawned. */ + private ChunkCoordinates spawnPosition; + private static final String __OBFID = "CL_00001637"; + + public EntityBat(World p_i1680_1_) + { + super(p_i1680_1_); + this.setSize(0.5F, 0.9F); + this.setIsBatHanging(true); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.1F; + } + + /** + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() + { + return super.getSoundPitch() * 0.95F; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.bat.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.bat.death"; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return false; + } + + protected void collideWithEntity(Entity p_82167_1_) {} + + protected void collideWithNearbyEntities() {} + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D); + } + + public boolean getIsBatHanging() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setIsBatHanging(boolean p_82236_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_82236_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.getIsBatHanging()) + { + this.motionX = this.motionY = this.motionZ = 0.0D; + this.posY = (double)MathHelper.floor_double(this.posY) + 1.0D - (double)this.height; + } + else + { + this.motionY *= 0.6000000238418579D; + } + } + + protected void updateAITasks() + { + super.updateAITasks(); + + if (this.getIsBatHanging()) + { + if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ)).isNormalCube()) + { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + else + { + if (this.rand.nextInt(200) == 0) + { + this.rotationYawHead = (float)this.rand.nextInt(360); + } + + if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) + { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } + else + { + if (this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1)) + { + this.spawnPosition = null; + } + + if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) + { + this.spawnPosition = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); + } + + double d0 = (double)this.spawnPosition.posX + 0.5D - this.posX; + double d1 = (double)this.spawnPosition.posY + 0.1D - this.posY; + double d2 = (double)this.spawnPosition.posZ + 0.5D - this.posZ; + this.motionX += (Math.signum(d0) * 0.5D - this.motionX) * 0.10000000149011612D; + this.motionY += (Math.signum(d1) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; + this.motionZ += (Math.signum(d2) * 0.5D - this.motionZ) * 0.10000000149011612D; + float f = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float f1 = MathHelper.wrapAngleTo180_float(f - this.rotationYaw); + this.moveForward = 0.5F; + this.rotationYaw += f1; + + if (this.rand.nextInt(100) == 0 && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ)).isNormalCube()) + { + this.setIsBatHanging(true); + } + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) {} + + /** + * Return whether this entity should NOT trigger a pressure plate or a tripwire. + */ + public boolean doesEntityNotTriggerPressurePlate() + { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + if (!this.worldObj.isRemote && this.getIsBatHanging()) + { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(source, amount); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.dataWatcher.updateObject(16, Byte.valueOf(tagCompund.getByte("BatFlags"))); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + int i = MathHelper.floor_double(this.boundingBox.minY); + + if (i >= 63) + { + return false; + } + else + { + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posZ); + int l = this.worldObj.getBlockLightValue(j, i, k); + byte b0 = 4; + Calendar calendar = this.worldObj.getCurrentDate(); + + if ((calendar.get(2) + 1 != 10 || calendar.get(5) < 20) && (calendar.get(2) + 1 != 11 || calendar.get(5) > 3)) + { + if (this.rand.nextBoolean()) + { + return false; + } + } + else + { + b0 = 7; + } + + return l > this.rand.nextInt(b0) ? false : super.getCanSpawnHere(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityChicken.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityChicken.java new file mode 100644 index 0000000..09669da --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityChicken.java @@ -0,0 +1,243 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSeeds; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityChicken extends EntityAnimal +{ + public float field_70886_e; + public float destPos; + public float field_70884_g; + public float field_70888_h; + public float field_70889_i = 1.0F; + /** The time until the next egg is spawned. */ + public int timeUntilNextEgg; + public boolean field_152118_bv; + private static final String __OBFID = "CL_00001639"; + + public EntityChicken(World p_i1682_1_) + { + super(p_i1682_1_); + this.setSize(0.3F, 0.7F); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.wheat_seeds, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.field_70888_h = this.field_70886_e; + this.field_70884_g = this.destPos; + this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); + + if (this.destPos < 0.0F) + { + this.destPos = 0.0F; + } + + if (this.destPos > 1.0F) + { + this.destPos = 1.0F; + } + + if (!this.onGround && this.field_70889_i < 1.0F) + { + this.field_70889_i = 1.0F; + } + + this.field_70889_i = (float)((double)this.field_70889_i * 0.9D); + + if (!this.onGround && this.motionY < 0.0D) + { + this.motionY *= 0.6D; + } + + this.field_70886_e += this.field_70889_i * 2.0F; + + if (!this.worldObj.isRemote && !this.isChild() && !this.func_152116_bZ() && --this.timeUntilNextEgg <= 0) + { + this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(Items.egg, 1); + this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.chicken.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.chicken.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.chicken.hurt"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.chicken.step", 0.15F, 1.0F); + } + + protected Item getDropItem() + { + return Items.feather; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + + for (int k = 0; k < j; ++k) + { + this.dropItem(Items.feather, 1); + } + + if (this.isBurning()) + { + this.dropItem(Items.cooked_chicken, 1); + } + else + { + this.dropItem(Items.chicken, 1); + } + } + + public EntityChicken createChild(EntityAgeable p_90011_1_) + { + return new EntityChicken(this.worldObj); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return p_70877_1_ != null && p_70877_1_.getItem() instanceof ItemSeeds; + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.field_152118_bv = tagCompund.getBoolean("IsChickenJockey"); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return this.func_152116_bZ() ? 10 : super.getExperiencePoints(p_70693_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("IsChickenJockey", this.field_152118_bv); + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return this.func_152116_bZ() && this.riddenByEntity == null; + } + + public void updateRiderPosition() + { + super.updateRiderPosition(); + float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float f2 = 0.1F; + float f3 = 0.0F; + this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + (double)(this.height * 0.5F) + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1)); + + if (this.riddenByEntity instanceof EntityLivingBase) + { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + + public boolean func_152116_bZ() + { + return this.field_152118_bv; + } + + public void func_152117_i(boolean p_152117_1_) + { + this.field_152118_bv = p_152117_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityCow.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityCow.java new file mode 100644 index 0000000..155c2c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityCow.java @@ -0,0 +1,155 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class EntityCow extends EntityAnimal +{ + private static final String __OBFID = "CL_00001640"; + + public EntityCow(World p_i1683_1_) + { + super(p_i1683_1_); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 2.0D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.cow.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.cow.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.cow.hurt"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.cow.step", 0.15F, 1.0F); + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Items.leather; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_); + int k; + + for (k = 0; k < j; ++k) + { + this.dropItem(Items.leather, 1); + } + + j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_); + + for (k = 0; k < j; ++k) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_beef, 1); + } + else + { + this.dropItem(Items.beef, 1); + } + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.bucket && !p_70085_1_.capabilities.isCreativeMode) + { + if (itemstack.stackSize-- == 1) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, new ItemStack(Items.milk_bucket)); + } + else if (!p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.milk_bucket))) + { + p_70085_1_.dropPlayerItemWithRandomChoice(new ItemStack(Items.milk_bucket, 1, 0), false); + } + + return true; + } + else + { + return super.interact(p_70085_1_); + } + } + + public EntityCow createChild(EntityAgeable p_90011_1_) + { + return new EntityCow(this.worldObj); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityHorse.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityHorse.java new file mode 100644 index 0000000..c78080e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityHorse.java @@ -0,0 +1,1770 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.ai.attributes.RangedAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.IInvBasic; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class EntityHorse extends EntityAnimal implements IInvBasic +{ + private static final IEntitySelector horseBreedingSelector = new IEntitySelector() + { + private static final String __OBFID = "CL_00001642"; + /** + * Return whether the specified entity is applicable to this filter. + */ + public boolean isEntityApplicable(Entity p_82704_1_) + { + return p_82704_1_ instanceof EntityHorse && ((EntityHorse)p_82704_1_).func_110205_ce(); + } + }; + private static final IAttribute horseJumpStrength = (new RangedAttribute("horse.jumpStrength", 0.7D, 0.0D, 2.0D)).setDescription("Jump Strength").setShouldWatch(true); + private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; + private static final String[] field_110273_bx = new String[] {"", "meo", "goo", "dio"}; + private static final int[] armorValues = new int[] {0, 5, 7, 11}; + private static final String[] horseTextures = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; + private static final String[] field_110269_bA = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; + private static final String[] horseMarkingTextures = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; + private static final String[] field_110292_bC = new String[] {"", "wo_", "wmo", "wdo", "bdo"}; + private int eatingHaystackCounter; + private int openMouthCounter; + private int jumpRearingCounter; + public int field_110278_bp; + public int field_110279_bq; + protected boolean horseJumping; + private AnimalChest horseChest; + private boolean hasReproduced; + /** "The higher this value, the more likely the horse is to be tamed next time a player rides it." */ + protected int temper; + protected float jumpPower; + private boolean field_110294_bI; + private float headLean; + private float prevHeadLean; + private float rearingAmount; + private float prevRearingAmount; + private float mouthOpenness; + private float prevMouthOpenness; + private int field_110285_bP; + private String field_110286_bQ; + private String[] field_110280_bR = new String[3]; + private static final String __OBFID = "CL_00001641"; + + public EntityHorse(World p_i1685_1_) + { + super(p_i1685_1_); + this.setSize(1.4F, 1.6F); + this.isImmuneToFire = false; + this.setChested(false); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.2D)); + this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWander(this, 0.7D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.func_110226_cD(); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + this.dataWatcher.addObject(19, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(20, Integer.valueOf(0)); + this.dataWatcher.addObject(21, String.valueOf("")); + this.dataWatcher.addObject(22, Integer.valueOf(0)); + } + + public void setHorseType(int p_110214_1_) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)p_110214_1_)); + this.func_110230_cF(); + } + + /** + * returns the horse type + */ + public int getHorseType() + { + return this.dataWatcher.getWatchableObjectByte(19); + } + + public void setHorseVariant(int p_110235_1_) + { + this.dataWatcher.updateObject(20, Integer.valueOf(p_110235_1_)); + this.func_110230_cF(); + } + + public int getHorseVariant() + { + return this.dataWatcher.getWatchableObjectInt(20); + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + if (this.hasCustomNameTag()) + { + return this.getCustomNameTag(); + } + else + { + int i = this.getHorseType(); + + switch (i) + { + case 0: + default: + return StatCollector.translateToLocal("entity.horse.name"); + case 1: + return StatCollector.translateToLocal("entity.donkey.name"); + case 2: + return StatCollector.translateToLocal("entity.mule.name"); + case 3: + return StatCollector.translateToLocal("entity.zombiehorse.name"); + case 4: + return StatCollector.translateToLocal("entity.skeletonhorse.name"); + } + } + } + + private boolean getHorseWatchableBoolean(int p_110233_1_) + { + return (this.dataWatcher.getWatchableObjectInt(16) & p_110233_1_) != 0; + } + + private void setHorseWatchableBoolean(int p_110208_1_, boolean p_110208_2_) + { + int j = this.dataWatcher.getWatchableObjectInt(16); + + if (p_110208_2_) + { + this.dataWatcher.updateObject(16, Integer.valueOf(j | p_110208_1_)); + } + else + { + this.dataWatcher.updateObject(16, Integer.valueOf(j & ~p_110208_1_)); + } + } + + public boolean isAdultHorse() + { + return !this.isChild(); + } + + public boolean isTame() + { + return this.getHorseWatchableBoolean(2); + } + + public boolean func_110253_bW() + { + return this.isAdultHorse(); + } + + public String func_152119_ch() + { + return this.dataWatcher.getWatchableObjectString(21); + } + + public void func_152120_b(String p_152120_1_) + { + this.dataWatcher.updateObject(21, p_152120_1_); + } + + public float getHorseSize() + { + int i = this.getGrowingAge(); + return i >= 0 ? 1.0F : 0.5F + (float)(-24000 - i) / -24000.0F * 0.5F; + } + + /** + * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." + */ + public void setScaleForAge(boolean p_98054_1_) + { + if (p_98054_1_) + { + this.setScale(this.getHorseSize()); + } + else + { + this.setScale(1.0F); + } + } + + public boolean isHorseJumping() + { + return this.horseJumping; + } + + public void setHorseTamed(boolean p_110234_1_) + { + this.setHorseWatchableBoolean(2, p_110234_1_); + } + + public void setHorseJumping(boolean p_110255_1_) + { + this.horseJumping = p_110255_1_; + } + + public boolean allowLeashing() + { + return !this.func_110256_cu() && super.allowLeashing(); + } + + protected void func_142017_o(float p_142017_1_) + { + if (p_142017_1_ > 6.0F && this.isEatingHaystack()) + { + this.setEatingHaystack(false); + } + } + + public boolean isChested() + { + return this.getHorseWatchableBoolean(8); + } + + public int func_110241_cb() + { + return this.dataWatcher.getWatchableObjectInt(22); + } + + /** + * 0 = iron, 1 = gold, 2 = diamond + */ + private int getHorseArmorIndex(ItemStack p_110260_1_) + { + if (p_110260_1_ == null) + { + return 0; + } + else + { + Item item = p_110260_1_.getItem(); + return item == Items.iron_horse_armor ? 1 : (item == Items.golden_horse_armor ? 2 : (item == Items.diamond_horse_armor ? 3 : 0)); + } + } + + public boolean isEatingHaystack() + { + return this.getHorseWatchableBoolean(32); + } + + public boolean isRearing() + { + return this.getHorseWatchableBoolean(64); + } + + public boolean func_110205_ce() + { + return this.getHorseWatchableBoolean(16); + } + + public boolean getHasReproduced() + { + return this.hasReproduced; + } + + public void func_146086_d(ItemStack p_146086_1_) + { + this.dataWatcher.updateObject(22, Integer.valueOf(this.getHorseArmorIndex(p_146086_1_))); + this.func_110230_cF(); + } + + public void func_110242_l(boolean p_110242_1_) + { + this.setHorseWatchableBoolean(16, p_110242_1_); + } + + public void setChested(boolean p_110207_1_) + { + this.setHorseWatchableBoolean(8, p_110207_1_); + } + + public void setHasReproduced(boolean p_110221_1_) + { + this.hasReproduced = p_110221_1_; + } + + public void setHorseSaddled(boolean p_110251_1_) + { + this.setHorseWatchableBoolean(4, p_110251_1_); + } + + public int getTemper() + { + return this.temper; + } + + public void setTemper(int p_110238_1_) + { + this.temper = p_110238_1_; + } + + public int increaseTemper(int p_110198_1_) + { + int j = MathHelper.clamp_int(this.getTemper() + p_110198_1_, 0, this.getMaxTemper()); + this.setTemper(j); + return j; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + Entity entity = source.getEntity(); + return this.riddenByEntity != null && this.riddenByEntity.equals(entity) ? false : super.attackEntityFrom(source, amount); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + return armorValues[this.func_110241_cb()]; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return this.riddenByEntity == null; + } + + public boolean prepareChunkForSpawn() + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.posZ); + this.worldObj.getBiomeGenForCoords(i, j); + return true; + } + + public void dropChests() + { + if (!this.worldObj.isRemote && this.isChested()) + { + this.dropItem(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } + } + + private void func_110266_cB() + { + this.openHorseMouth(); + this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + if (distance > 1.0F) + { + this.playSound("mob.horse.land", 0.4F, 1.0F); + } + + int i = MathHelper.ceiling_float_int(distance * 0.5F - 3.0F); + + if (i > 0) + { + this.attackEntityFrom(DamageSource.fall, (float)i); + + if (this.riddenByEntity != null) + { + this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); + } + + Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); + + if (block.getMaterial() != Material.air) + { + Block.SoundType soundtype = block.stepSound; + this.worldObj.playSoundAtEntity(this, soundtype.getStepResourcePath(), soundtype.getVolume() * 0.5F, soundtype.getPitch() * 0.75F); + } + } + } + + private int func_110225_cC() + { + int i = this.getHorseType(); + return this.isChested() && (i == 1 || i == 2) ? 17 : 2; + } + + private void func_110226_cD() + { + AnimalChest animalchest = this.horseChest; + this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC()); + this.horseChest.func_110133_a(this.getCommandSenderName()); + + if (animalchest != null) + { + animalchest.func_110132_b(this); + int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory()); + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = animalchest.getStackInSlot(j); + + if (itemstack != null) + { + this.horseChest.setInventorySlotContents(j, itemstack.copy()); + } + } + + animalchest = null; + } + + this.horseChest.func_110134_a(this); + this.func_110232_cE(); + } + + private void func_110232_cE() + { + if (!this.worldObj.isRemote) + { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); + + if (this.func_110259_cr()) + { + this.func_146086_d(this.horseChest.getStackInSlot(1)); + } + } + } + + /** + * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. + */ + public void onInventoryChanged(InventoryBasic p_76316_1_) + { + int i = this.func_110241_cb(); + boolean flag = this.isHorseSaddled(); + this.func_110232_cE(); + + if (this.ticksExisted > 20) + { + if (i == 0 && i != this.func_110241_cb()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + else if (i != this.func_110241_cb()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + + if (!flag && this.isHorseSaddled()) + { + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + } + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + this.prepareChunkForSpawn(); + return super.getCanSpawnHere(); + } + + protected EntityHorse getClosestHorse(Entity p_110250_1_, double p_110250_2_) + { + double d1 = Double.MAX_VALUE; + Entity entity1 = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(p_110250_1_, p_110250_1_.boundingBox.addCoord(p_110250_2_, p_110250_2_, p_110250_2_), horseBreedingSelector); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + Entity entity2 = (Entity)iterator.next(); + double d2 = entity2.getDistanceSq(p_110250_1_.posX, p_110250_1_.posY, p_110250_1_.posZ); + + if (d2 < d1) + { + entity1 = entity2; + d1 = d2; + } + } + + return (EntityHorse)entity1; + } + + public double getHorseJumpStrength() + { + return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + this.openHorseMouth(); + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.death" : (i == 4 ? "mob.horse.skeleton.death" : (i != 1 && i != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); + } + + protected Item getDropItem() + { + boolean flag = this.rand.nextInt(4) == 0; + int i = this.getHorseType(); + return i == 4 ? Items.bone : (i == 3 ? (flag ? Item.getItemById(0) : Items.rotten_flesh) : Items.leather); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + this.openHorseMouth(); + + if (this.rand.nextInt(3) == 0) + { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.hit" : (i == 4 ? "mob.horse.skeleton.hit" : (i != 1 && i != 2 ? "mob.horse.hit" : "mob.horse.donkey.hit")); + } + + public boolean isHorseSaddled() + { + return this.getHorseWatchableBoolean(4); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + this.openHorseMouth(); + + if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) + { + this.makeHorseRear(); + } + + int i = this.getHorseType(); + return i == 3 ? "mob.horse.zombie.idle" : (i == 4 ? "mob.horse.skeleton.idle" : (i != 1 && i != 2 ? "mob.horse.idle" : "mob.horse.donkey.idle")); + } + + protected String getAngrySoundName() + { + this.openHorseMouth(); + this.makeHorseRear(); + int i = this.getHorseType(); + return i != 3 && i != 4 ? (i != 1 && i != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + Block.SoundType soundtype = blockIn.stepSound; + + if (this.worldObj.getBlock(x, y + 1, z) == Blocks.snow_layer) + { + soundtype = Blocks.snow_layer.stepSound; + } + + if (!blockIn.getMaterial().isLiquid()) + { + int l = this.getHorseType(); + + if (this.riddenByEntity != null && l != 1 && l != 2) + { + ++this.field_110285_bP; + + if (this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) + { + this.playSound("mob.horse.gallop", soundtype.getVolume() * 0.15F, soundtype.getPitch()); + + if (l == 0 && this.rand.nextInt(10) == 0) + { + this.playSound("mob.horse.breathe", soundtype.getVolume() * 0.6F, soundtype.getPitch()); + } + } + else if (this.field_110285_bP <= 5) + { + this.playSound("mob.horse.wood", soundtype.getVolume() * 0.15F, soundtype.getPitch()); + } + } + else if (soundtype == Block.soundTypeWood) + { + this.playSound("mob.horse.wood", soundtype.getVolume() * 0.15F, soundtype.getPitch()); + } + else + { + this.playSound("mob.horse.soft", soundtype.getVolume() * 0.15F, soundtype.getPitch()); + } + } + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(horseJumpStrength); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(53.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.22499999403953552D); + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 6; + } + + public int getMaxTemper() + { + return 100; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.8F; + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 400; + } + + @SideOnly(Side.CLIENT) + public boolean func_110239_cn() + { + return this.getHorseType() == 0 || this.func_110241_cb() > 0; + } + + private void func_110230_cF() + { + this.field_110286_bQ = null; + } + + @SideOnly(Side.CLIENT) + private void setHorseTexturePaths() + { + this.field_110286_bQ = "horse/"; + this.field_110280_bR[0] = null; + this.field_110280_bR[1] = null; + this.field_110280_bR[2] = null; + int i = this.getHorseType(); + int j = this.getHorseVariant(); + int k; + + if (i == 0) + { + k = j & 255; + int l = (j & 65280) >> 8; + this.field_110280_bR[0] = horseTextures[k]; + this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[k]; + this.field_110280_bR[1] = horseMarkingTextures[l]; + this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[l]; + } + else + { + this.field_110280_bR[0] = ""; + this.field_110286_bQ = this.field_110286_bQ + "_" + i + "_"; + } + + k = this.func_110241_cb(); + this.field_110280_bR[2] = horseArmorTextures[k]; + this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[k]; + } + + @SideOnly(Side.CLIENT) + public String getHorseTexture() + { + if (this.field_110286_bQ == null) + { + this.setHorseTexturePaths(); + } + + return this.field_110286_bQ; + } + + @SideOnly(Side.CLIENT) + public String[] getVariantTexturePaths() + { + if (this.field_110286_bQ == null) + { + this.setHorseTexturePaths(); + } + + return this.field_110280_bR; + } + + public void openGUI(EntityPlayer p_110199_1_) + { + if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == p_110199_1_) && this.isTame()) + { + this.horseChest.func_110133_a(this.getCommandSenderName()); + p_110199_1_.displayGUIHorse(this, this.horseChest); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) + { + return super.interact(p_70085_1_); + } + else if (!this.isTame() && this.func_110256_cu()) + { + return false; + } + else if (this.isTame() && this.isAdultHorse() && p_70085_1_.isSneaking()) + { + this.openGUI(p_70085_1_); + return true; + } + else if (this.func_110253_bW() && this.riddenByEntity != null) + { + return super.interact(p_70085_1_); + } + else + { + if (itemstack != null) + { + boolean flag = false; + + if (this.func_110259_cr()) + { + byte b0 = -1; + + if (itemstack.getItem() == Items.iron_horse_armor) + { + b0 = 1; + } + else if (itemstack.getItem() == Items.golden_horse_armor) + { + b0 = 2; + } + else if (itemstack.getItem() == Items.diamond_horse_armor) + { + b0 = 3; + } + + if (b0 >= 0) + { + if (!this.isTame()) + { + this.makeHorseRearWithSound(); + return true; + } + + this.openGUI(p_70085_1_); + return true; + } + } + + if (!flag && !this.func_110256_cu()) + { + float f = 0.0F; + short short1 = 0; + byte b1 = 0; + + if (itemstack.getItem() == Items.wheat) + { + f = 2.0F; + short1 = 60; + b1 = 3; + } + else if (itemstack.getItem() == Items.sugar) + { + f = 1.0F; + short1 = 30; + b1 = 3; + } + else if (itemstack.getItem() == Items.bread) + { + f = 7.0F; + short1 = 180; + b1 = 3; + } + else if (Block.getBlockFromItem(itemstack.getItem()) == Blocks.hay_block) + { + f = 20.0F; + short1 = 180; + } + else if (itemstack.getItem() == Items.apple) + { + f = 3.0F; + short1 = 60; + b1 = 3; + } + else if (itemstack.getItem() == Items.golden_carrot) + { + f = 4.0F; + short1 = 60; + b1 = 5; + + if (this.isTame() && this.getGrowingAge() == 0) + { + flag = true; + this.func_146082_f(p_70085_1_); + } + } + else if (itemstack.getItem() == Items.golden_apple) + { + f = 10.0F; + short1 = 240; + b1 = 10; + + if (this.isTame() && this.getGrowingAge() == 0) + { + flag = true; + this.func_146082_f(p_70085_1_); + } + } + + if (this.getHealth() < this.getMaxHealth() && f > 0.0F) + { + this.heal(f); + flag = true; + } + + if (!this.isAdultHorse() && short1 > 0) + { + this.addGrowth(short1); + flag = true; + } + + if (b1 > 0 && (flag || !this.isTame()) && b1 < this.getMaxTemper()) + { + flag = true; + this.increaseTemper(b1); + } + + if (flag) + { + this.func_110266_cB(); + } + } + + if (!this.isTame() && !flag) + { + if (itemstack != null && itemstack.interactWithEntity(p_70085_1_, this)) + { + return true; + } + + this.makeHorseRearWithSound(); + return true; + } + + if (!flag && this.func_110229_cs() && !this.isChested() && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest)) + { + this.setChested(true); + this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + flag = true; + this.func_110226_cD(); + } + + if (!flag && this.func_110253_bW() && !this.isHorseSaddled() && itemstack.getItem() == Items.saddle) + { + this.openGUI(p_70085_1_); + return true; + } + + if (flag) + { + if (!p_70085_1_.capabilities.isCreativeMode && --itemstack.stackSize == 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + + if (this.func_110253_bW() && this.riddenByEntity == null) + { + if (itemstack != null && itemstack.interactWithEntity(p_70085_1_, this)) + { + return true; + } + else + { + this.func_110237_h(p_70085_1_); + return true; + } + } + else + { + return super.interact(p_70085_1_); + } + } + } + + private void func_110237_h(EntityPlayer p_110237_1_) + { + p_110237_1_.rotationYaw = this.rotationYaw; + p_110237_1_.rotationPitch = this.rotationPitch; + this.setEatingHaystack(false); + this.setRearing(false); + + if (!this.worldObj.isRemote) + { + p_110237_1_.mountEntity(this); + } + } + + public boolean func_110259_cr() + { + return this.getHorseType() == 0; + } + + public boolean func_110229_cs() + { + int i = this.getHorseType(); + return i == 2 || i == 1; + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() + { + return this.riddenByEntity != null && this.isHorseSaddled() ? true : this.isEatingHaystack() || this.isRearing(); + } + + public boolean func_110256_cu() + { + int i = this.getHorseType(); + return i == 3 || i == 4; + } + + public boolean func_110222_cv() + { + return this.func_110256_cu() || this.getHorseType() == 2; + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return false; + } + + private void func_110210_cH() + { + this.field_110278_bp = 1; + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + super.onDeath(p_70645_1_); + + if (!this.worldObj.isRemote) + { + this.dropChestItems(); + } + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.rand.nextInt(200) == 0) + { + this.func_110210_cH(); + } + + super.onLivingUpdate(); + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(900) == 0 && this.deathTime == 0) + { + this.heal(1.0F); + } + + if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 && this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Blocks.grass) + { + this.setEatingHaystack(true); + } + + if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) + { + this.eatingHaystackCounter = 0; + this.setEatingHaystack(false); + } + + if (this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) + { + EntityHorse entityhorse = this.getClosestHorse(this, 16.0D); + + if (entityhorse != null && this.getDistanceSqToEntity(entityhorse) > 4.0D) + { + PathEntity pathentity = this.worldObj.getPathEntityToEntity(this, entityhorse, 16.0F, true, false, false, true); + this.setPathToEntity(pathentity); + } + } + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.worldObj.isRemote && this.dataWatcher.hasChanges()) + { + this.dataWatcher.func_111144_e(); + this.func_110230_cF(); + } + + if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) + { + this.openMouthCounter = 0; + this.setHorseWatchableBoolean(128, false); + } + + if (!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) + { + this.jumpRearingCounter = 0; + this.setRearing(false); + } + + if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) + { + this.field_110278_bp = 0; + } + + if (this.field_110279_bq > 0) + { + ++this.field_110279_bq; + + if (this.field_110279_bq > 300) + { + this.field_110279_bq = 0; + } + } + + this.prevHeadLean = this.headLean; + + if (this.isEatingHaystack()) + { + this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; + + if (this.headLean > 1.0F) + { + this.headLean = 1.0F; + } + } + else + { + this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; + + if (this.headLean < 0.0F) + { + this.headLean = 0.0F; + } + } + + this.prevRearingAmount = this.rearingAmount; + + if (this.isRearing()) + { + this.prevHeadLean = this.headLean = 0.0F; + this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; + + if (this.rearingAmount > 1.0F) + { + this.rearingAmount = 1.0F; + } + } + else + { + this.field_110294_bI = false; + this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F; + + if (this.rearingAmount < 0.0F) + { + this.rearingAmount = 0.0F; + } + } + + this.prevMouthOpenness = this.mouthOpenness; + + if (this.getHorseWatchableBoolean(128)) + { + this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; + + if (this.mouthOpenness > 1.0F) + { + this.mouthOpenness = 1.0F; + } + } + else + { + this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; + + if (this.mouthOpenness < 0.0F) + { + this.mouthOpenness = 0.0F; + } + } + } + + private void openHorseMouth() + { + if (!this.worldObj.isRemote) + { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } + } + + private boolean func_110200_cJ() + { + return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() && !this.func_110222_cv() && this.getHealth() >= this.getMaxHealth(); + } + + public void setEating(boolean eating) + { + this.setHorseWatchableBoolean(32, eating); + } + + public void setEatingHaystack(boolean p_110227_1_) + { + this.setEating(p_110227_1_); + } + + public void setRearing(boolean p_110219_1_) + { + if (p_110219_1_) + { + this.setEatingHaystack(false); + } + + this.setHorseWatchableBoolean(64, p_110219_1_); + } + + private void makeHorseRear() + { + if (!this.worldObj.isRemote) + { + this.jumpRearingCounter = 1; + this.setRearing(true); + } + } + + public void makeHorseRearWithSound() + { + this.makeHorseRear(); + String s = this.getAngrySoundName(); + + if (s != null) + { + this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + } + } + + public void dropChestItems() + { + this.dropItemsInChest(this, this.horseChest); + this.dropChests(); + } + + private void dropItemsInChest(Entity p_110240_1_, AnimalChest p_110240_2_) + { + if (p_110240_2_ != null && !this.worldObj.isRemote) + { + for (int i = 0; i < p_110240_2_.getSizeInventory(); ++i) + { + ItemStack itemstack = p_110240_2_.getStackInSlot(i); + + if (itemstack != null) + { + this.entityDropItem(itemstack, 0.0F); + } + } + } + } + + public boolean setTamedBy(EntityPlayer p_110263_1_) + { + this.func_152120_b(p_110263_1_.getUniqueID().toString()); + this.setHorseTamed(true); + return true; + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase && this.isHorseSaddled()) + { + this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; + this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; + p_70612_1_ = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; + p_70612_2_ = ((EntityLivingBase)this.riddenByEntity).moveForward; + + if (p_70612_2_ <= 0.0F) + { + p_70612_2_ *= 0.25F; + this.field_110285_bP = 0; + } + + if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) + { + p_70612_1_ = 0.0F; + p_70612_2_ = 0.0F; + } + + if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) + { + this.motionY = this.getHorseJumpStrength() * (double)this.jumpPower; + + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + this.setHorseJumping(true); + this.isAirBorne = true; + + if (p_70612_2_ > 0.0F) + { + float f2 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float f3 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += (double)(-0.4F * f2 * this.jumpPower); + this.motionZ += (double)(0.4F * f3 * this.jumpPower); + this.playSound("mob.horse.jump", 0.4F, 1.0F); + } + + this.jumpPower = 0.0F; + net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + + if (!this.worldObj.isRemote) + { + this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + + if (this.onGround) + { + this.jumpPower = 0.0F; + this.setHorseJumping(false); + } + + this.prevLimbSwingAmount = this.limbSwingAmount; + double d1 = this.posX - this.prevPosX; + double d0 = this.posZ - this.prevPosZ; + float f4 = MathHelper.sqrt_double(d1 * d1 + d0 * d0) * 4.0F; + + if (f4 > 1.0F) + { + f4 = 1.0F; + } + + this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + else + { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("EatingHaystack", this.isEatingHaystack()); + tagCompound.setBoolean("ChestedHorse", this.isChested()); + tagCompound.setBoolean("HasReproduced", this.getHasReproduced()); + tagCompound.setBoolean("Bred", this.func_110205_ce()); + tagCompound.setInteger("Type", this.getHorseType()); + tagCompound.setInteger("Variant", this.getHorseVariant()); + tagCompound.setInteger("Temper", this.getTemper()); + tagCompound.setBoolean("Tame", this.isTame()); + tagCompound.setString("OwnerUUID", this.func_152119_ch()); + + if (this.isChested()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 2; i < this.horseChest.getSizeInventory(); ++i) + { + ItemStack itemstack = this.horseChest.getStackInSlot(i); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + itemstack.writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + tagCompound.setTag("Items", nbttaglist); + } + + if (this.horseChest.getStackInSlot(1) != null) + { + tagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound())); + } + + if (this.horseChest.getStackInSlot(0) != null) + { + tagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack")); + this.func_110242_l(tagCompund.getBoolean("Bred")); + this.setChested(tagCompund.getBoolean("ChestedHorse")); + this.setHasReproduced(tagCompund.getBoolean("HasReproduced")); + this.setHorseType(tagCompund.getInteger("Type")); + this.setHorseVariant(tagCompund.getInteger("Variant")); + this.setTemper(tagCompund.getInteger("Temper")); + this.setHorseTamed(tagCompund.getBoolean("Tame")); + + if (tagCompund.hasKey("OwnerUUID", 8)) + { + this.func_152120_b(tagCompund.getString("OwnerUUID")); + } + + IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed"); + + if (iattributeinstance != null) + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D); + } + + if (this.isChested()) + { + NBTTagList nbttaglist = tagCompund.getTagList("Items", 10); + this.func_110226_cD(); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + + if (j >= 2 && j < this.horseChest.getSizeInventory()) + { + this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound1)); + } + } + } + + ItemStack itemstack; + + if (tagCompund.hasKey("ArmorItem", 10)) + { + itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem")); + + if (itemstack != null && func_146085_a(itemstack.getItem())) + { + this.horseChest.setInventorySlotContents(1, itemstack); + } + } + + if (tagCompund.hasKey("SaddleItem", 10)) + { + itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem")); + + if (itemstack != null && itemstack.getItem() == Items.saddle) + { + this.horseChest.setInventorySlotContents(0, itemstack); + } + } + else if (tagCompund.getBoolean("Saddle")) + { + this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle)); + } + + this.func_110232_cE(); + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) + { + if (p_70878_1_ == this) + { + return false; + } + else if (p_70878_1_.getClass() != this.getClass()) + { + return false; + } + else + { + EntityHorse entityhorse = (EntityHorse)p_70878_1_; + + if (this.func_110200_cJ() && entityhorse.func_110200_cJ()) + { + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + return i == j || i == 0 && j == 1 || i == 1 && j == 0; + } + else + { + return false; + } + } + } + + public EntityAgeable createChild(EntityAgeable p_90011_1_) + { + EntityHorse entityhorse = (EntityHorse)p_90011_1_; + EntityHorse entityhorse1 = new EntityHorse(this.worldObj); + int i = this.getHorseType(); + int j = entityhorse.getHorseType(); + int k = 0; + + if (i == j) + { + k = i; + } + else if (i == 0 && j == 1 || i == 1 && j == 0) + { + k = 2; + } + + if (k == 0) + { + int i1 = this.rand.nextInt(9); + int l; + + if (i1 < 4) + { + l = this.getHorseVariant() & 255; + } + else if (i1 < 8) + { + l = entityhorse.getHorseVariant() & 255; + } + else + { + l = this.rand.nextInt(7); + } + + int j1 = this.rand.nextInt(5); + + if (j1 < 2) + { + l |= this.getHorseVariant() & 65280; + } + else if (j1 < 4) + { + l |= entityhorse.getHorseVariant() & 65280; + } + else + { + l |= this.rand.nextInt(5) << 8 & 65280; + } + + entityhorse1.setHorseVariant(l); + } + + entityhorse1.setHorseType(k); + double d1 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + p_90011_1_.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(d1 / 3.0D); + double d2 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + p_90011_1_.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); + entityhorse1.getEntityAttribute(horseJumpStrength).setBaseValue(d2 / 3.0D); + double d0 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + p_90011_1_.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); + entityhorse1.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(d0 / 3.0D); + return entityhorse1; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_); + boolean flag = false; + int i = 0; + int l; + + if (p_110161_1_1 instanceof EntityHorse.GroupData) + { + l = ((EntityHorse.GroupData)p_110161_1_1).field_111107_a; + i = ((EntityHorse.GroupData)p_110161_1_1).field_111106_b & 255 | this.rand.nextInt(5) << 8; + } + else + { + if (this.rand.nextInt(10) == 0) + { + l = 1; + } + else + { + int j = this.rand.nextInt(7); + int k = this.rand.nextInt(5); + l = 0; + i = j | k << 8; + } + + p_110161_1_1 = new EntityHorse.GroupData(l, i); + } + + this.setHorseType(l); + this.setHorseVariant(i); + + if (this.rand.nextInt(5) == 0) + { + this.setGrowingAge(-24000); + } + + if (l != 4 && l != 3) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue((double)this.func_110267_cL()); + + if (l == 0) + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(this.func_110203_cN()); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.17499999701976776D); + } + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(15.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.20000000298023224D); + } + + if (l != 2 && l != 1) + { + this.getEntityAttribute(horseJumpStrength).setBaseValue(this.func_110245_cM()); + } + else + { + this.getEntityAttribute(horseJumpStrength).setBaseValue(0.5D); + } + + this.setHealth(this.getMaxHealth()); + return (IEntityLivingData)p_110161_1_1; + } + + @SideOnly(Side.CLIENT) + public float getGrassEatingAmount(float p_110258_1_) + { + return this.prevHeadLean + (this.headLean - this.prevHeadLean) * p_110258_1_; + } + + @SideOnly(Side.CLIENT) + public float getRearingAmount(float p_110223_1_) + { + return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * p_110223_1_; + } + + @SideOnly(Side.CLIENT) + public float func_110201_q(float p_110201_1_) + { + return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * p_110201_1_; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + public void setJumpPower(int p_110206_1_) + { + if (this.isHorseSaddled()) + { + if (p_110206_1_ < 0) + { + p_110206_1_ = 0; + } + else + { + this.field_110294_bI = true; + this.makeHorseRear(); + } + + if (p_110206_1_ >= 90) + { + this.jumpPower = 1.0F; + } + else + { + this.jumpPower = 0.4F + 0.4F * (float)p_110206_1_ / 90.0F; + } + } + } + + /** + * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke." + */ + @SideOnly(Side.CLIENT) + protected void spawnHorseParticles(boolean p_110216_1_) + { + String s = p_110216_1_ ? "heart" : "smoke"; + + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(s, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 7) + { + this.spawnHorseParticles(true); + } + else if (p_70103_1_ == 6) + { + this.spawnHorseParticles(false); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + public void updateRiderPosition() + { + super.updateRiderPosition(); + + if (this.prevRearingAmount > 0.0F) + { + float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float f2 = 0.7F * this.prevRearingAmount; + float f3 = 0.15F * this.prevRearingAmount; + this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1)); + + if (this.riddenByEntity instanceof EntityLivingBase) + { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } + } + + private float func_110267_cL() + { + return 15.0F + (float)this.rand.nextInt(8) + (float)this.rand.nextInt(9); + } + + private double func_110245_cM() + { + return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D; + } + + private double func_110203_cN() + { + return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D; + } + + public static boolean func_146085_a(Item p_146085_0_) + { + return p_146085_0_ == Items.iron_horse_armor || p_146085_0_ == Items.golden_horse_armor || p_146085_0_ == Items.diamond_horse_armor; + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + public boolean isOnLadder() + { + return false; + } + + public static class GroupData implements IEntityLivingData + { + public int field_111107_a; + public int field_111106_b; + private static final String __OBFID = "CL_00001643"; + + public GroupData(int p_i1684_1_, int p_i1684_2_) + { + this.field_111107_a = p_i1684_1_; + this.field_111106_b = p_i1684_2_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityMooshroom.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityMooshroom.java new file mode 100644 index 0000000..62e134e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityMooshroom.java @@ -0,0 +1,82 @@ +package net.minecraft.entity.passive; + +import java.util.ArrayList; + +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public class EntityMooshroom extends EntityCow implements IShearable +{ + private static final String __OBFID = "CL_00001645"; + + public EntityMooshroom(World p_i1687_1_) + { + super(p_i1687_1_); + this.setSize(0.9F, 1.3F); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.getItem() == Items.bowl && this.getGrowingAge() >= 0) + { + if (itemstack.stackSize == 1) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, new ItemStack(Items.mushroom_stew)); + return true; + } + + if (p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.mushroom_stew)) && !p_70085_1_.capabilities.isCreativeMode) + { + p_70085_1_.inventory.decrStackSize(p_70085_1_.inventory.currentItem, 1); + return true; + } + } + + { + return super.interact(p_70085_1_); + } + } + + public EntityMooshroom createChild(EntityAgeable p_90011_1_) + { + return new EntityMooshroom(this.worldObj); + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + return getGrowingAge() >= 0; + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + setDead(); + EntityCow entitycow = new EntityCow(worldObj); + entitycow.setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + entitycow.setHealth(this.getHealth()); + entitycow.renderYawOffset = renderYawOffset; + worldObj.spawnEntityInWorld(entitycow); + worldObj.spawnParticle("largeexplode", posX, posY + (double)(height / 2.0F), posZ, 0.0D, 0.0D, 0.0D); + + ArrayList ret = new ArrayList(); + for (int i = 0; i < 5; i++) + { + ret.add(new ItemStack(Blocks.red_mushroom)); + } + playSound("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityOcelot.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityOcelot.java new file mode 100644 index 0000000..99888c1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityOcelot.java @@ -0,0 +1,370 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOcelotAttack; +import net.minecraft.entity.ai.EntityAIOcelotSit; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class EntityOcelot extends EntityTameable +{ + /** The tempt AI task for this mob, used to prevent taming while it is fleeing. */ + private EntityAITempt aiTempt; + private static final String __OBFID = "CL_00001646"; + + public EntityOcelot(World p_i1688_1_) + { + super(p_i1688_1_); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true)); + this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F)); + this.tasks.addTask(6, new EntityAIOcelotSit(this, 1.33D)); + this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F)); + this.tasks.addTask(8, new EntityAIOcelotAttack(this)); + this.tasks.addTask(9, new EntityAIMate(this, 0.8D)); + this.tasks.addTask(10, new EntityAIWander(this, 0.8D)); + this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F)); + this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false)); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + public void updateAITick() + { + if (this.getMoveHelper().isUpdating()) + { + double d0 = this.getMoveHelper().getSpeed(); + + if (d0 == 0.6D) + { + this.setSneaking(true); + this.setSprinting(false); + } + else if (d0 == 1.33D) + { + this.setSneaking(false); + this.setSprinting(true); + } + else + { + this.setSneaking(false); + this.setSprinting(false); + } + } + else + { + this.setSneaking(false); + this.setSprinting(false); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return !this.isTamed() && this.ticksExisted > 2400; + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) {} + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("CatType", this.getTameSkin()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setTameSkin(tagCompund.getInteger("CatType")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.cat.hitt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.cat.hitt"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Items.leather; + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.aiSit.setSitting(false); + return super.attackEntityFrom(source, amount); + } + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {} + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) + { + this.aiSit.setSitting(!this.isSitting()); + } + } + else if (this.aiTempt.isRunning() && itemstack != null && itemstack.getItem() == Items.fish && p_70085_1_.getDistanceSqToEntity(this) < 9.0D) + { + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(3) == 0) + { + this.setTamed(true); + this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); + this.func_152115_b(p_70085_1_.getUniqueID().toString()); + this.playTameEffect(true); + this.aiSit.setSitting(true); + this.worldObj.setEntityState(this, (byte)7); + } + else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(p_70085_1_); + } + + public EntityOcelot createChild(EntityAgeable p_90011_1_) + { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + + if (this.isTamed()) + { + entityocelot.func_152115_b(this.func_152113_b()); + entityocelot.setTamed(true); + entityocelot.setTameSkin(this.getTameSkin()); + } + + return entityocelot; + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return p_70877_1_ != null && p_70877_1_.getItem() == Items.fish; + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) + { + if (p_70878_1_ == this) + { + return false; + } + else if (!this.isTamed()) + { + return false; + } + else if (!(p_70878_1_ instanceof EntityOcelot)) + { + return false; + } + else + { + EntityOcelot entityocelot = (EntityOcelot)p_70878_1_; + return !entityocelot.isTamed() ? false : this.isInLove() && entityocelot.isInLove(); + } + } + + public int getTameSkin() + { + return this.dataWatcher.getWatchableObjectByte(18); + } + + public void setTameSkin(int p_70912_1_) + { + this.dataWatcher.updateObject(18, Byte.valueOf((byte)p_70912_1_)); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + if (this.worldObj.rand.nextInt(3) == 0) + { + return false; + } + else + { + if (this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) + { + int i = MathHelper.floor_double(this.posX); + int j = MathHelper.floor_double(this.boundingBox.minY); + int k = MathHelper.floor_double(this.posZ); + + if (j < 63) + { + return false; + } + + Block block = this.worldObj.getBlock(i, j - 1, k); + + if (block == Blocks.grass || block.isLeaves(worldObj, i, j - 1, k)) + { + return true; + } + } + + return false; + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return this.hasCustomNameTag() ? this.getCustomNameTag() : (this.isTamed() ? StatCollector.translateToLocal("entity.Cat.name") : super.getCommandSenderName()); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + + if (this.worldObj.rand.nextInt(7) == 0) + { + for (int i = 0; i < 2; ++i) + { + EntityOcelot entityocelot = new EntityOcelot(this.worldObj); + entityocelot.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityocelot.setGrowingAge(-24000); + this.worldObj.spawnEntityInWorld(entityocelot); + } + } + + return p_110161_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityPig.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityPig.java new file mode 100644 index 0000000..b996f82 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityPig.java @@ -0,0 +1,254 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIControlledByPlayer; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.AchievementList; +import net.minecraft.world.World; + +public class EntityPig extends EntityAnimal +{ + /** AI task for player control. */ + private final EntityAIControlledByPlayer aiControlledByPlayer; + private static final String __OBFID = "CL_00001647"; + + public EntityPig(World p_i1689_1_) + { + super(p_i1689_1_); + this.setSize(0.9F, 0.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F)); + this.tasks.addTask(3, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false)); + this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false)); + this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + } + + protected void updateAITasks() + { + super.updateAITasks(); + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + public boolean canBeSteered() + { + ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem(); + return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick; + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Saddle", this.getSaddled()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setSaddled(tagCompund.getBoolean("Saddle")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.pig.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.pig.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.pig.death"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.pig.step", 0.15F, 1.0F); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + if (super.interact(p_70085_1_)) + { + return true; + } + else if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == p_70085_1_)) + { + p_70085_1_.mountEntity(this); + return true; + } + else + { + return false; + } + } + + protected Item getDropItem() + { + return this.isBurning() ? Items.cooked_porkchop : Items.porkchop; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + p_70628_2_); + + for (int k = 0; k < j; ++k) + { + if (this.isBurning()) + { + this.dropItem(Items.cooked_porkchop, 1); + } + else + { + this.dropItem(Items.porkchop, 1); + } + } + + if (this.getSaddled()) + { + this.dropItem(Items.saddle, 1); + } + } + + /** + * Returns true if the pig is saddled. + */ + public boolean getSaddled() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + /** + * Set or remove the saddle of the pig. + */ + public void setSaddled(boolean p_70900_1_) + { + if (p_70900_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)1)); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)0)); + } + } + + /** + * Called when a lightning bolt hits the entity. + */ + public void onStruckByLightning(EntityLightningBolt lightningBolt) + { + if (!this.worldObj.isRemote) + { + EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj); + entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); + entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.worldObj.spawnEntityInWorld(entitypigzombie); + this.setDead(); + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + super.fall(distance); + + if (distance > 5.0F && this.riddenByEntity instanceof EntityPlayer) + { + ((EntityPlayer)this.riddenByEntity).triggerAchievement(AchievementList.flyPig); + } + } + + public EntityPig createChild(EntityAgeable p_90011_1_) + { + return new EntityPig(this.worldObj); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return p_70877_1_ != null && p_70877_1_.getItem() == Items.carrot; + } + + /** + * Return the AI task for player control. + */ + public EntityAIControlledByPlayer getAIControlledByPlayer() + { + return this.aiControlledByPlayer; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySheep.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySheep.java new file mode 100644 index 0000000..a2f456d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySheep.java @@ -0,0 +1,341 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIEatGrass; +import net.minecraft.entity.ai.EntityAIFollowParent; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITempt; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public class EntitySheep extends EntityAnimal implements IShearable +{ + private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() + { + private static final String __OBFID = "CL_00001649"; + public boolean canInteractWith(EntityPlayer player) + { + return false; + } + }, 2, 1); + /** Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. */ + public static final float[][] fleeceColorTable = new float[][] {{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; + /** + * Used to control movement as well as wool regrowth. Set to 40 on handleHealthUpdate and counts down with each + * tick. + */ + private int sheepTimer; + private EntityAIEatGrass field_146087_bs = new EntityAIEatGrass(this); + private static final String __OBFID = "CL_00001648"; + + public EntitySheep(World p_i1691_1_) + { + super(p_i1691_1_); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false)); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); + this.tasks.addTask(5, this.field_146087_bs); + this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.field_90016_e.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0)); + this.field_90016_e.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0)); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + protected void updateAITasks() + { + this.sheepTimer = this.field_146087_bs.func_151499_f(); + super.updateAITasks(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.worldObj.isRemote) + { + this.sheepTimer = Math.max(0, this.sheepTimer - 1); + } + + super.onLivingUpdate(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + if (!this.getSheared()) + { + this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, this.getFleeceColor()), 0.0F); + } + } + + protected Item getDropItem() + { + return Item.getItemFromBlock(Blocks.wool); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 10) + { + this.sheepTimer = 40; + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + return super.interact(p_70085_1_); + } + + @SideOnly(Side.CLIENT) + public float func_70894_j(float p_70894_1_) + { + return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - p_70894_1_) / 4.0F : -((float)(this.sheepTimer - 40) - p_70894_1_) / 4.0F)); + } + + @SideOnly(Side.CLIENT) + public float func_70890_k(float p_70890_1_) + { + if (this.sheepTimer > 4 && this.sheepTimer <= 36) + { + float f1 = ((float)(this.sheepTimer - 4) - p_70890_1_) / 32.0F; + return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(f1 * 28.7F); + } + else + { + return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Sheared", this.getSheared()); + tagCompound.setByte("Color", (byte)this.getFleeceColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setSheared(tagCompund.getBoolean("Sheared")); + this.setFleeceColor(tagCompund.getByte("Color")); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return "mob.sheep.say"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.sheep.say"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.sheep.say"; + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.sheep.step", 0.15F, 1.0F); + } + + public int getFleeceColor() + { + return this.dataWatcher.getWatchableObjectByte(16) & 15; + } + + public void setFleeceColor(int p_70891_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & 240 | p_70891_1_ & 15))); + } + + /** + * returns true if a sheeps wool has been sheared + */ + public boolean getSheared() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; + } + + /** + * make a sheep sheared if set to true + */ + public void setSheared(boolean p_70893_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70893_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 16))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -17))); + } + } + + /** + * This method is called when a sheep spawns in the world to select the color of sheep fleece. + */ + public static int getRandomFleeceColor(Random p_70895_0_) + { + int i = p_70895_0_.nextInt(100); + return i < 5 ? 15 : (i < 10 ? 7 : (i < 15 ? 8 : (i < 18 ? 12 : (p_70895_0_.nextInt(500) == 0 ? 6 : 0)))); + } + + public EntitySheep createChild(EntityAgeable p_90011_1_) + { + EntitySheep entitysheep = (EntitySheep)p_90011_1_; + EntitySheep entitysheep1 = new EntitySheep(this.worldObj); + int i = this.func_90014_a(this, entitysheep); + entitysheep1.setFleeceColor(15 - i); + return entitysheep1; + } + + /** + * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This + * function is used in the AIEatGrass) + */ + public void eatGrassBonus() + { + this.setSheared(false); + + if (this.isChild()) + { + this.addGrowth(60); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + this.setFleeceColor(getRandomFleeceColor(this.worldObj.rand)); + return p_110161_1_; + } + + private int func_90014_a(EntityAnimal p_90014_1_, EntityAnimal p_90014_2_) + { + int i = this.func_90013_b(p_90014_1_); + int j = this.func_90013_b(p_90014_2_); + this.field_90016_e.getStackInSlot(0).setItemDamage(i); + this.field_90016_e.getStackInSlot(1).setItemDamage(j); + ItemStack itemstack = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, ((EntitySheep)p_90014_1_).worldObj); + int k; + + if (itemstack != null && itemstack.getItem() == Items.dye) + { + k = itemstack.getItemDamage(); + } + else + { + k = this.worldObj.rand.nextBoolean() ? i : j; + } + + return k; + } + + private int func_90013_b(EntityAnimal p_90013_1_) + { + return 15 - ((EntitySheep)p_90013_1_).getFleeceColor(); + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) + { + return !getSheared() && !isChild(); + } + + @Override + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) + { + ArrayList ret = new ArrayList(); + setSheared(true); + int i = 1 + rand.nextInt(3); + for (int j = 0; j < i; j++) + { + ret.add(new ItemStack(Blocks.wool, 1, getFleeceColor())); + } + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySquid.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySquid.java new file mode 100644 index 0000000..849ea78 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntitySquid.java @@ -0,0 +1,228 @@ +package net.minecraft.entity.passive; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntitySquid extends EntityWaterMob +{ + public float squidPitch; + public float prevSquidPitch; + public float squidYaw; + public float prevSquidYaw; + /** appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. */ + public float squidRotation; + /** previous squidRotation in radians */ + public float prevSquidRotation; + /** angle of the tentacles in radians */ + public float tentacleAngle; + /** the last calculated angle of the tentacles in radians */ + public float lastTentacleAngle; + private float randomMotionSpeed; + /** change in squidRotation in radians. */ + private float rotationVelocity; + private float field_70871_bB; + private float randomMotionVecX; + private float randomMotionVecY; + private float randomMotionVecZ; + private static final String __OBFID = "CL_00001651"; + + public EntitySquid(World p_i1693_1_) + { + super(p_i1693_1_); + this.setSize(0.95F, 0.95F); + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return null; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return null; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return null; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Item.getItemById(0); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param + * par2 - Level of Looting used to kill this mob. + */ + protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) + { + int j = this.rand.nextInt(3 + p_70628_2_) + 1; + + for (int k = 0; k < j; ++k) + { + this.entityDropItem(new ItemStack(Items.dye, 1, 0), 0.0F); + } + } + + /** + * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning + * true) + */ + public boolean isInWater() + { + return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; + this.lastTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; + + if (this.squidRotation > ((float)Math.PI * 2F)) + { + this.squidRotation -= ((float)Math.PI * 2F); + + if (this.rand.nextInt(10) == 0) + { + this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + } + + if (this.isInWater()) + { + float f; + + if (this.squidRotation < (float)Math.PI) + { + f = this.squidRotation / (float)Math.PI; + this.tentacleAngle = MathHelper.sin(f * f * (float)Math.PI) * (float)Math.PI * 0.25F; + + if ((double)f > 0.75D) + { + this.randomMotionSpeed = 1.0F; + this.field_70871_bB = 1.0F; + } + else + { + this.field_70871_bB *= 0.8F; + } + } + else + { + this.tentacleAngle = 0.0F; + this.randomMotionSpeed *= 0.9F; + this.field_70871_bB *= 0.99F; + } + + if (!this.worldObj.isRemote) + { + this.motionX = (double)(this.randomMotionVecX * this.randomMotionSpeed); + this.motionY = (double)(this.randomMotionVecY * this.randomMotionSpeed); + this.motionZ = (double)(this.randomMotionVecZ * this.randomMotionSpeed); + } + + f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.renderYawOffset += (-((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI - this.renderYawOffset) * 0.1F; + this.rotationYaw = this.renderYawOffset; + this.squidYaw += (float)Math.PI * this.field_70871_bB * 1.5F; + this.squidPitch += (-((float)Math.atan2((double)f, this.motionY)) * 180.0F / (float)Math.PI - this.squidPitch) * 0.1F; + } + else + { + this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * (float)Math.PI * 0.25F; + + if (!this.worldObj.isRemote) + { + this.motionX = 0.0D; + this.motionY -= 0.08D; + this.motionY *= 0.9800000190734863D; + this.motionZ = 0.0D; + } + + this.squidPitch = (float)((double)this.squidPitch + (double)(-90.0F - this.squidPitch) * 0.02D); + } + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + protected void updateEntityActionState() + { + ++this.entityAge; + + if (this.entityAge > 100) + { + this.randomMotionVecX = this.randomMotionVecY = this.randomMotionVecZ = 0.0F; + } + else if (this.rand.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + this.randomMotionVecX = MathHelper.cos(f) * 0.2F; + this.randomMotionVecY = -0.1F + this.rand.nextFloat() * 0.2F; + this.randomMotionVecZ = MathHelper.sin(f) * 0.2F; + } + + this.despawnEntity(); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.posY > 45.0D && this.posY < 63.0D && super.getCanSpawnHere(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityTameable.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityTameable.java new file mode 100644 index 0000000..d779107 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityTameable.java @@ -0,0 +1,227 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityOwnable; +import net.minecraft.entity.ai.EntityAISit; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.management.PreYggdrasilConverter; +import net.minecraft.world.World; + +public abstract class EntityTameable extends EntityAnimal implements IEntityOwnable +{ + protected EntityAISit aiSit = new EntityAISit(this); + private static final String __OBFID = "CL_00001561"; + + public EntityTameable(World p_i1604_1_) + { + super(p_i1604_1_); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, ""); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.func_152113_b() == null) + { + tagCompound.setString("OwnerUUID", ""); + } + else + { + tagCompound.setString("OwnerUUID", this.func_152113_b()); + } + + tagCompound.setBoolean("Sitting", this.isSitting()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + String s = ""; + + if (tagCompund.hasKey("OwnerUUID", 8)) + { + s = tagCompund.getString("OwnerUUID"); + } + else + { + String s1 = tagCompund.getString("Owner"); + s = PreYggdrasilConverter.func_152719_a(s1); + } + + if (s.length() > 0) + { + this.func_152115_b(s); + this.setTamed(true); + } + + this.aiSit.setSitting(tagCompund.getBoolean("Sitting")); + this.setSitting(tagCompund.getBoolean("Sitting")); + } + + /** + * Play the taming effect, will either be hearts or smoke depending on status + */ + protected void playTameEffect(boolean p_70908_1_) + { + String s = "heart"; + + if (!p_70908_1_) + { + s = "smoke"; + } + + for (int i = 0; i < 7; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(s, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 7) + { + this.playTameEffect(true); + } + else if (p_70103_1_ == 6) + { + this.playTameEffect(false); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + public boolean isTamed() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + + public void setTamed(boolean p_70903_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70903_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 4))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -5))); + } + } + + public boolean isSitting() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setSitting(boolean p_70904_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70904_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + public String func_152113_b() + { + return this.dataWatcher.getWatchableObjectString(17); + } + + public void func_152115_b(String p_152115_1_) + { + this.dataWatcher.updateObject(17, p_152115_1_); + } + + public EntityLivingBase getOwner() + { + try + { + UUID uuid = UUID.fromString(this.func_152113_b()); + return uuid == null ? null : this.worldObj.func_152378_a(uuid); + } + catch (IllegalArgumentException illegalargumentexception) + { + return null; + } + } + + public boolean func_152114_e(EntityLivingBase p_152114_1_) + { + return p_152114_1_ == this.getOwner(); + } + + public EntityAISit func_70907_r() + { + return this.aiSit; + } + + public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) + { + return true; + } + + public Team getTeam() + { + if (this.isTamed()) + { + EntityLivingBase entitylivingbase = this.getOwner(); + + if (entitylivingbase != null) + { + return entitylivingbase.getTeam(); + } + } + + return super.getTeam(); + } + + public boolean isOnSameTeam(EntityLivingBase p_142014_1_) + { + if (this.isTamed()) + { + EntityLivingBase entitylivingbase1 = this.getOwner(); + + if (p_142014_1_ == entitylivingbase1) + { + return true; + } + + if (entitylivingbase1 != null) + { + return entitylivingbase1.isOnSameTeam(p_142014_1_); + } + } + + return super.isOnSameTeam(p_142014_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityVillager.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityVillager.java new file mode 100644 index 0000000..c665345 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityVillager.java @@ -0,0 +1,777 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.common.registry.VillagerRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.INpc; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import net.minecraft.entity.ai.EntityAIFollowGolem; +import net.minecraft.entity.ai.EntityAILookAtTradePlayer; +import net.minecraft.entity.ai.EntityAIMoveIndoors; +import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAIPlay; +import net.minecraft.entity.ai.EntityAIRestrictOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITradePlayer; +import net.minecraft.entity.ai.EntityAIVillagerMate; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Tuple; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.village.Village; +import net.minecraft.world.World; + +public class EntityVillager extends EntityAgeable implements IMerchant, INpc +{ + private int randomTickDivider; + private boolean isMating; + private boolean isPlaying; + Village villageObj; + /** This villager's current customer. */ + private EntityPlayer buyingPlayer; + /** Initialises the MerchantRecipeList.java */ + private MerchantRecipeList buyingList; + private int timeUntilReset; + /** addDefaultEquipmentAndRecipies is called if this is true */ + private boolean needsInitilization; + private int wealth; + /** Last player to trade with this villager, used for aggressivity. */ + private String lastBuyingPlayer; + private boolean isLookingForHome; + private float field_82191_bN; + /** Selling list of Villagers items. */ + public static final Map villagersSellingList = new HashMap(); + /** Selling list of Blacksmith items. */ + public static final Map blacksmithSellingList = new HashMap(); + private static final String __OBFID = "CL_00001707"; + + public EntityVillager(World p_i1747_1_) + { + this(p_i1747_1_, 0); + } + + public EntityVillager(World p_i1748_1_, int p_i1748_2_) + { + super(p_i1748_1_); + this.setProfession(p_i1748_2_); + this.setSize(0.6F, 1.8F); + this.getNavigator().setBreakDoors(true); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D)); + this.tasks.addTask(1, new EntityAITradePlayer(this)); + this.tasks.addTask(1, new EntityAILookAtTradePlayer(this)); + this.tasks.addTask(2, new EntityAIMoveIndoors(this)); + this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this)); + this.tasks.addTask(4, new EntityAIOpenDoor(this, true)); + this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); + this.tasks.addTask(6, new EntityAIVillagerMate(this)); + this.tasks.addTask(7, new EntityAIFollowGolem(this)); + this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F)); + this.tasks.addTask(9, new EntityAIWander(this, 0.6D)); + this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + if (--this.randomTickDivider <= 0) + { + this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.randomTickDivider = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); + + if (this.villageObj == null) + { + this.detachHome(); + } + else + { + ChunkCoordinates chunkcoordinates = this.villageObj.getCenter(); + this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); + + if (this.isLookingForHome) + { + this.isLookingForHome = false; + this.villageObj.setDefaultPlayerReputation(5); + } + } + } + + if (!this.isTrading() && this.timeUntilReset > 0) + { + --this.timeUntilReset; + + if (this.timeUntilReset <= 0) + { + if (this.needsInitilization) + { + if (this.buyingList.size() > 1) + { + Iterator iterator = this.buyingList.iterator(); + + while (iterator.hasNext()) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next(); + + if (merchantrecipe.isRecipeDisabled()) + { + merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); + } + } + } + + this.addDefaultEquipmentAndRecipies(1); + this.needsInitilization = false; + + if (this.villageObj != null && this.lastBuyingPlayer != null) + { + this.worldObj.setEntityState(this, (byte)14); + this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); + } + } + + this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0)); + } + } + + super.updateAITick(); + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg; + + if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !p_70085_1_.isSneaking()) + { + if (!this.worldObj.isRemote) + { + this.setCustomer(p_70085_1_); + p_70085_1_.displayGUIMerchant(this, this.getCustomNameTag()); + } + + return true; + } + else + { + return super.interact(p_70085_1_); + } + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Integer.valueOf(0)); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("Profession", this.getProfession()); + tagCompound.setInteger("Riches", this.wealth); + + if (this.buyingList != null) + { + tagCompound.setTag("Offers", this.buyingList.getRecipiesAsTags()); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setProfession(tagCompund.getInteger("Profession")); + this.wealth = tagCompund.getInteger("Riches"); + + if (tagCompund.hasKey("Offers", 10)) + { + NBTTagCompound nbttagcompound1 = tagCompund.getCompoundTag("Offers"); + this.buyingList = new MerchantRecipeList(nbttagcompound1); + } + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return false; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.villager.hit"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.villager.death"; + } + + public void setProfession(int p_70938_1_) + { + this.dataWatcher.updateObject(16, Integer.valueOf(p_70938_1_)); + } + + public int getProfession() + { + return this.dataWatcher.getWatchableObjectInt(16); + } + + public boolean isMating() + { + return this.isMating; + } + + public void setMating(boolean p_70947_1_) + { + this.isMating = p_70947_1_; + } + + public void setPlaying(boolean p_70939_1_) + { + this.isPlaying = p_70939_1_; + } + + public boolean isPlaying() + { + return this.isPlaying; + } + + public void setRevengeTarget(EntityLivingBase p_70604_1_) + { + super.setRevengeTarget(p_70604_1_); + + if (this.villageObj != null && p_70604_1_ != null) + { + this.villageObj.addOrRenewAgressor(p_70604_1_); + + if (p_70604_1_ instanceof EntityPlayer) + { + byte b0 = -1; + + if (this.isChild()) + { + b0 = -3; + } + + this.villageObj.setReputationForPlayer(p_70604_1_.getCommandSenderName(), b0); + + if (this.isEntityAlive()) + { + this.worldObj.setEntityState(this, (byte)13); + } + } + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + if (this.villageObj != null) + { + Entity entity = p_70645_1_.getEntity(); + + if (entity != null) + { + if (entity instanceof EntityPlayer) + { + this.villageObj.setReputationForPlayer(entity.getCommandSenderName(), -2); + } + else if (entity instanceof IMob) + { + this.villageObj.endMatingSeason(); + } + } + else if (entity == null) + { + EntityPlayer entityplayer = this.worldObj.getClosestPlayerToEntity(this, 16.0D); + + if (entityplayer != null) + { + this.villageObj.endMatingSeason(); + } + } + } + + super.onDeath(p_70645_1_); + } + + public void setCustomer(EntityPlayer p_70932_1_) + { + this.buyingPlayer = p_70932_1_; + } + + public EntityPlayer getCustomer() + { + return this.buyingPlayer; + } + + public boolean isTrading() + { + return this.buyingPlayer != null; + } + + public void useRecipe(MerchantRecipe p_70933_1_) + { + p_70933_1_.incrementToolUses(); + this.livingSoundTime = -this.getTalkInterval(); + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + + if (p_70933_1_.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) + { + this.timeUntilReset = 40; + this.needsInitilization = true; + + if (this.buyingPlayer != null) + { + this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName(); + } + else + { + this.lastBuyingPlayer = null; + } + } + + if (p_70933_1_.getItemToBuy().getItem() == Items.emerald) + { + this.wealth += p_70933_1_.getItemToBuy().stackSize; + } + } + + public void func_110297_a_(ItemStack p_110297_1_) + { + if (!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) + { + this.livingSoundTime = -this.getTalkInterval(); + + if (p_110297_1_ != null) + { + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + } + else + { + this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); + } + } + } + + public MerchantRecipeList getRecipes(EntityPlayer p_70934_1_) + { + if (this.buyingList == null) + { + this.addDefaultEquipmentAndRecipies(1); + } + + return this.buyingList; + } + + /** + * Adjusts the probability of obtaining a given recipe being offered by a villager + */ + private float adjustProbability(float p_82188_1_) + { + float f1 = p_82188_1_ + this.field_82191_bN; + return f1 > 0.9F ? 0.9F - (f1 - 0.9F) : f1; + } + + /** + * based on the villagers profession add items, equipment, and recipies adds par1 random items to the list of things + * that the villager wants to buy. (at most 1 of each wanted type is added) + */ + private void addDefaultEquipmentAndRecipies(int p_70950_1_) + { + if (this.buyingList != null) + { + this.field_82191_bN = MathHelper.sqrt_float((float)this.buyingList.size()) * 0.2F; + } + else + { + this.field_82191_bN = 0.0F; + } + + MerchantRecipeList merchantrecipelist; + merchantrecipelist = new MerchantRecipeList(); + VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.getProfession(), this.rand); + int k; + label50: + + switch (this.getProfession()) + { + case 0: + func_146091_a(merchantrecipelist, Items.wheat, this.rand, this.adjustProbability(0.9F)); + func_146091_a(merchantrecipelist, Item.getItemFromBlock(Blocks.wool), this.rand, this.adjustProbability(0.5F)); + func_146091_a(merchantrecipelist, Items.chicken, this.rand, this.adjustProbability(0.5F)); + func_146091_a(merchantrecipelist, Items.cooked_fished, this.rand, this.adjustProbability(0.4F)); + func_146089_b(merchantrecipelist, Items.bread, this.rand, this.adjustProbability(0.9F)); + func_146089_b(merchantrecipelist, Items.melon, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.apple, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.cookie, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.shears, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.flint_and_steel, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.cooked_chicken, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.arrow, this.rand, this.adjustProbability(0.5F)); + + if (this.rand.nextFloat() < this.adjustProbability(0.5F)) + { + merchantrecipelist.add(new MerchantRecipe(new ItemStack(Blocks.gravel, 10), new ItemStack(Items.emerald), new ItemStack(Items.flint, 4 + this.rand.nextInt(2), 0))); + } + + break; + case 1: + func_146091_a(merchantrecipelist, Items.paper, this.rand, this.adjustProbability(0.8F)); + func_146091_a(merchantrecipelist, Items.book, this.rand, this.adjustProbability(0.8F)); + func_146091_a(merchantrecipelist, Items.written_book, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Item.getItemFromBlock(Blocks.bookshelf), this.rand, this.adjustProbability(0.8F)); + func_146089_b(merchantrecipelist, Item.getItemFromBlock(Blocks.glass), this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.compass, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.clock, this.rand, this.adjustProbability(0.2F)); + + if (this.rand.nextFloat() < this.adjustProbability(0.07F)) + { + Enchantment enchantment = Enchantment.enchantmentsBookList[this.rand.nextInt(Enchantment.enchantmentsBookList.length)]; + int i1 = MathHelper.getRandomIntegerInRange(this.rand, enchantment.getMinLevel(), enchantment.getMaxLevel()); + ItemStack itemstack = Items.enchanted_book.getEnchantedItemStack(new EnchantmentData(enchantment, i1)); + k = 2 + this.rand.nextInt(5 + i1 * 10) + 3 * i1; + merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.book), new ItemStack(Items.emerald, k), itemstack)); + } + + break; + case 2: + func_146089_b(merchantrecipelist, Items.ender_eye, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.experience_bottle, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.redstone, this.rand, this.adjustProbability(0.4F)); + func_146089_b(merchantrecipelist, Item.getItemFromBlock(Blocks.glowstone), this.rand, this.adjustProbability(0.3F)); + Item[] aitem = new Item[] {Items.iron_sword, Items.diamond_sword, Items.iron_chestplate, Items.diamond_chestplate, Items.iron_axe, Items.diamond_axe, Items.iron_pickaxe, Items.diamond_pickaxe}; + Item[] aitem1 = aitem; + int j = aitem.length; + k = 0; + + while (true) + { + if (k >= j) + { + break label50; + } + + Item item = aitem1[k]; + + if (this.rand.nextFloat() < this.adjustProbability(0.05F)) + { + merchantrecipelist.add(new MerchantRecipe(new ItemStack(item, 1, 0), new ItemStack(Items.emerald, 2 + this.rand.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(item, 1, 0), 5 + this.rand.nextInt(15)))); + } + + ++k; + } + case 3: + func_146091_a(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F)); + func_146091_a(merchantrecipelist, Items.iron_ingot, this.rand, this.adjustProbability(0.5F)); + func_146091_a(merchantrecipelist, Items.gold_ingot, this.rand, this.adjustProbability(0.5F)); + func_146091_a(merchantrecipelist, Items.diamond, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.iron_sword, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.diamond_sword, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.iron_axe, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.diamond_axe, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.iron_pickaxe, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.diamond_pickaxe, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.iron_shovel, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_shovel, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.iron_hoe, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_hoe, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.iron_boots, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_boots, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.iron_helmet, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_helmet, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.iron_chestplate, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_chestplate, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.iron_leggings, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.diamond_leggings, this.rand, this.adjustProbability(0.2F)); + func_146089_b(merchantrecipelist, Items.chainmail_boots, this.rand, this.adjustProbability(0.1F)); + func_146089_b(merchantrecipelist, Items.chainmail_helmet, this.rand, this.adjustProbability(0.1F)); + func_146089_b(merchantrecipelist, Items.chainmail_chestplate, this.rand, this.adjustProbability(0.1F)); + func_146089_b(merchantrecipelist, Items.chainmail_leggings, this.rand, this.adjustProbability(0.1F)); + break; + case 4: + func_146091_a(merchantrecipelist, Items.coal, this.rand, this.adjustProbability(0.7F)); + func_146091_a(merchantrecipelist, Items.porkchop, this.rand, this.adjustProbability(0.5F)); + func_146091_a(merchantrecipelist, Items.beef, this.rand, this.adjustProbability(0.5F)); + func_146089_b(merchantrecipelist, Items.saddle, this.rand, this.adjustProbability(0.1F)); + func_146089_b(merchantrecipelist, Items.leather_chestplate, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.leather_boots, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.leather_helmet, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.leather_leggings, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.cooked_porkchop, this.rand, this.adjustProbability(0.3F)); + func_146089_b(merchantrecipelist, Items.cooked_beef, this.rand, this.adjustProbability(0.3F)); + } + + if (merchantrecipelist.isEmpty()) + { + func_146091_a(merchantrecipelist, Items.gold_ingot, this.rand, 1.0F); + } + + Collections.shuffle(merchantrecipelist); + + if (this.buyingList == null) + { + this.buyingList = new MerchantRecipeList(); + } + + for (int l = 0; l < p_70950_1_ && l < merchantrecipelist.size(); ++l) + { + this.buyingList.addToListWithCheck((MerchantRecipe)merchantrecipelist.get(l)); + } + } + + @SideOnly(Side.CLIENT) + public void setRecipes(MerchantRecipeList p_70930_1_) {} + + public static void func_146091_a(MerchantRecipeList p_146091_0_, Item p_146091_1_, Random p_146091_2_, float p_146091_3_) + { + if (p_146091_2_.nextFloat() < p_146091_3_) + { + p_146091_0_.add(new MerchantRecipe(func_146088_a(p_146091_1_, p_146091_2_), Items.emerald)); + } + } + + private static ItemStack func_146088_a(Item p_146088_0_, Random p_146088_1_) + { + return new ItemStack(p_146088_0_, func_146092_b(p_146088_0_, p_146088_1_), 0); + } + + private static int func_146092_b(Item p_146092_0_, Random p_146092_1_) + { + Tuple tuple = (Tuple)villagersSellingList.get(p_146092_0_); + return tuple == null ? 1 : (((Integer)tuple.getFirst()).intValue() >= ((Integer)tuple.getSecond()).intValue() ? ((Integer)tuple.getFirst()).intValue() : ((Integer)tuple.getFirst()).intValue() + p_146092_1_.nextInt(((Integer)tuple.getSecond()).intValue() - ((Integer)tuple.getFirst()).intValue())); + } + + public static void func_146089_b(MerchantRecipeList p_146089_0_, Item p_146089_1_, Random p_146089_2_, float p_146089_3_) + { + if (p_146089_2_.nextFloat() < p_146089_3_) + { + int i = func_146090_c(p_146089_1_, p_146089_2_); + ItemStack itemstack; + ItemStack itemstack1; + + if (i < 0) + { + itemstack = new ItemStack(Items.emerald, 1, 0); + itemstack1 = new ItemStack(p_146089_1_, -i, 0); + } + else + { + itemstack = new ItemStack(Items.emerald, i, 0); + itemstack1 = new ItemStack(p_146089_1_, 1, 0); + } + + p_146089_0_.add(new MerchantRecipe(itemstack, itemstack1)); + } + } + + private static int func_146090_c(Item p_146090_0_, Random p_146090_1_) + { + Tuple tuple = (Tuple)blacksmithSellingList.get(p_146090_0_); + return tuple == null ? 1 : (((Integer)tuple.getFirst()).intValue() >= ((Integer)tuple.getSecond()).intValue() ? ((Integer)tuple.getFirst()).intValue() : ((Integer)tuple.getFirst()).intValue() + p_146090_1_.nextInt(((Integer)tuple.getSecond()).intValue() - ((Integer)tuple.getFirst()).intValue())); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 12) + { + this.generateRandomParticles("heart"); + } + else if (p_70103_1_ == 13) + { + this.generateRandomParticles("angryVillager"); + } + else if (p_70103_1_ == 14) + { + this.generateRandomParticles("happyVillager"); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) + { + p_110161_1_ = super.onSpawnWithEgg(p_110161_1_); + VillagerRegistry.applyRandomTrade(this, worldObj.rand); + return p_110161_1_; + } + + /** + * par1 is the particleName + */ + @SideOnly(Side.CLIENT) + private void generateRandomParticles(String p_70942_1_) + { + for (int i = 0; i < 5; ++i) + { + double d0 = this.rand.nextGaussian() * 0.02D; + double d1 = this.rand.nextGaussian() * 0.02D; + double d2 = this.rand.nextGaussian() * 0.02D; + this.worldObj.spawnParticle(p_70942_1_, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2); + } + } + + public void setLookingForHome() + { + this.isLookingForHome = true; + } + + public EntityVillager createChild(EntityAgeable p_90011_1_) + { + EntityVillager entityvillager = new EntityVillager(this.worldObj); + entityvillager.onSpawnWithEgg((IEntityLivingData)null); + return entityvillager; + } + + public boolean allowLeashing() + { + return false; + } + + static + { + villagersSellingList.put(Items.coal, new Tuple(Integer.valueOf(16), Integer.valueOf(24))); + villagersSellingList.put(Items.iron_ingot, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + villagersSellingList.put(Items.gold_ingot, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + villagersSellingList.put(Items.diamond, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + villagersSellingList.put(Items.paper, new Tuple(Integer.valueOf(24), Integer.valueOf(36))); + villagersSellingList.put(Items.book, new Tuple(Integer.valueOf(11), Integer.valueOf(13))); + villagersSellingList.put(Items.written_book, new Tuple(Integer.valueOf(1), Integer.valueOf(1))); + villagersSellingList.put(Items.ender_pearl, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + villagersSellingList.put(Items.ender_eye, new Tuple(Integer.valueOf(2), Integer.valueOf(3))); + villagersSellingList.put(Items.porkchop, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.beef, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.chicken, new Tuple(Integer.valueOf(14), Integer.valueOf(18))); + villagersSellingList.put(Items.cooked_fished, new Tuple(Integer.valueOf(9), Integer.valueOf(13))); + villagersSellingList.put(Items.wheat_seeds, new Tuple(Integer.valueOf(34), Integer.valueOf(48))); + villagersSellingList.put(Items.melon_seeds, new Tuple(Integer.valueOf(30), Integer.valueOf(38))); + villagersSellingList.put(Items.pumpkin_seeds, new Tuple(Integer.valueOf(30), Integer.valueOf(38))); + villagersSellingList.put(Items.wheat, new Tuple(Integer.valueOf(18), Integer.valueOf(22))); + villagersSellingList.put(Item.getItemFromBlock(Blocks.wool), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); + villagersSellingList.put(Items.rotten_flesh, new Tuple(Integer.valueOf(36), Integer.valueOf(64))); + blacksmithSellingList.put(Items.flint_and_steel, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.shears, new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.iron_sword, new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Items.diamond_sword, new Tuple(Integer.valueOf(12), Integer.valueOf(14))); + blacksmithSellingList.put(Items.iron_axe, new Tuple(Integer.valueOf(6), Integer.valueOf(8))); + blacksmithSellingList.put(Items.diamond_axe, new Tuple(Integer.valueOf(9), Integer.valueOf(12))); + blacksmithSellingList.put(Items.iron_pickaxe, new Tuple(Integer.valueOf(7), Integer.valueOf(9))); + blacksmithSellingList.put(Items.diamond_pickaxe, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Items.iron_shovel, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_shovel, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_hoe, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_hoe, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_boots, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_boots, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_helmet, new Tuple(Integer.valueOf(4), Integer.valueOf(6))); + blacksmithSellingList.put(Items.diamond_helmet, new Tuple(Integer.valueOf(7), Integer.valueOf(8))); + blacksmithSellingList.put(Items.iron_chestplate, new Tuple(Integer.valueOf(10), Integer.valueOf(14))); + blacksmithSellingList.put(Items.diamond_chestplate, new Tuple(Integer.valueOf(16), Integer.valueOf(19))); + blacksmithSellingList.put(Items.iron_leggings, new Tuple(Integer.valueOf(8), Integer.valueOf(10))); + blacksmithSellingList.put(Items.diamond_leggings, new Tuple(Integer.valueOf(11), Integer.valueOf(14))); + blacksmithSellingList.put(Items.chainmail_boots, new Tuple(Integer.valueOf(5), Integer.valueOf(7))); + blacksmithSellingList.put(Items.chainmail_helmet, new Tuple(Integer.valueOf(5), Integer.valueOf(7))); + blacksmithSellingList.put(Items.chainmail_chestplate, new Tuple(Integer.valueOf(11), Integer.valueOf(15))); + blacksmithSellingList.put(Items.chainmail_leggings, new Tuple(Integer.valueOf(9), Integer.valueOf(11))); + blacksmithSellingList.put(Items.bread, new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); + blacksmithSellingList.put(Items.melon, new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); + blacksmithSellingList.put(Items.apple, new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); + blacksmithSellingList.put(Items.cookie, new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.glass), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.bookshelf), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_chestplate, new Tuple(Integer.valueOf(4), Integer.valueOf(5))); + blacksmithSellingList.put(Items.leather_boots, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_helmet, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.leather_leggings, new Tuple(Integer.valueOf(2), Integer.valueOf(4))); + blacksmithSellingList.put(Items.saddle, new Tuple(Integer.valueOf(6), Integer.valueOf(8))); + blacksmithSellingList.put(Items.experience_bottle, new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.redstone, new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.compass, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Items.clock, new Tuple(Integer.valueOf(10), Integer.valueOf(12))); + blacksmithSellingList.put(Item.getItemFromBlock(Blocks.glowstone), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); + blacksmithSellingList.put(Items.cooked_porkchop, new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); + blacksmithSellingList.put(Items.cooked_beef, new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); + blacksmithSellingList.put(Items.cooked_chicken, new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); + blacksmithSellingList.put(Items.ender_eye, new Tuple(Integer.valueOf(7), Integer.valueOf(11))); + blacksmithSellingList.put(Items.arrow, new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWaterMob.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWaterMob.java new file mode 100644 index 0000000..5479d33 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWaterMob.java @@ -0,0 +1,78 @@ +package net.minecraft.entity.passive; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public abstract class EntityWaterMob extends EntityCreature implements IAnimals +{ + private static final String __OBFID = "CL_00001653"; + + public EntityWaterMob(World p_i1695_1_) + { + super(p_i1695_1_); + } + + public boolean canBreatheUnderwater() + { + return true; + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + return this.worldObj.checkNoEntityCollision(this.boundingBox); + } + + /** + * Get number of ticks, at least during which the living entity will be silent. + */ + public int getTalkInterval() + { + return 120; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return true; + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 1 + this.worldObj.rand.nextInt(3); + } + + /** + * Gets called every tick from main Entity class + */ + public void onEntityUpdate() + { + int i = this.getAir(); + super.onEntityUpdate(); + + if (this.isEntityAlive() && !this.isInWater()) + { + --i; + this.setAir(i); + + if (this.getAir() == -20) + { + this.setAir(0); + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } + else + { + this.setAir(300); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWolf.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWolf.java new file mode 100644 index 0000000..5c021ac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/EntityWolf.java @@ -0,0 +1,628 @@ +package net.minecraft.entity.passive; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIAttackOnCollide; +import net.minecraft.entity.ai.EntityAIBeg; +import net.minecraft.entity.ai.EntityAIFollowOwner; +import net.minecraft.entity.ai.EntityAIHurtByTarget; +import net.minecraft.entity.ai.EntityAILeapAtTarget; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIMate; +import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget; +import net.minecraft.entity.ai.EntityAIOwnerHurtTarget; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAITargetNonTamed; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityWolf extends EntityTameable +{ + private float field_70926_e; + private float field_70924_f; + /** true is the wolf is wet else false */ + private boolean isShaking; + private boolean field_70928_h; + /** This time increases while wolf is shaking and emitting water particles. */ + private float timeWolfIsShaking; + private float prevTimeWolfIsShaking; + private static final String __OBFID = "CL_00001654"; + + public EntityWolf(World p_i1696_1_) + { + super(p_i1696_1_); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, this.aiSit); + this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F)); + this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true)); + this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); + this.tasks.addTask(6, new EntityAIMate(this, 1.0D)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIBeg(this, 8.0F)); + this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(9, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); + this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); + this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false)); + this.setTamed(false); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30000001192092896D); + + if (this.isTamed()) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + } + + /** + * Returns true if the newer Entity AI code should be run + */ + public boolean isAIEnabled() + { + return true; + } + + /** + * Sets the active target the Task system uses for tracking + */ + public void setAttackTarget(EntityLivingBase p_70624_1_) + { + super.setAttackTarget(p_70624_1_); + + if (p_70624_1_ == null) + { + this.setAngry(false); + } + else if (!this.isTamed()) + { + this.setAngry(true); + } + } + + /** + * main AI tick function, replaces updateEntityActionState + */ + protected void updateAITick() + { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(18, new Float(this.getHealth())); + this.dataWatcher.addObject(19, new Byte((byte)0)); + this.dataWatcher.addObject(20, new Byte((byte)BlockColored.func_150032_b(1))); + } + + protected void func_145780_a(int x, int y, int z, Block blockIn) + { + this.playSound("mob.wolf.step", 0.15F, 1.0F); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setBoolean("Angry", this.isAngry()); + tagCompound.setByte("CollarColor", (byte)this.getCollarColor()); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.setAngry(tagCompund.getBoolean("Angry")); + + if (tagCompund.hasKey("CollarColor", 99)) + { + this.setCollarColor(tagCompund.getByte("CollarColor")); + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.wolf.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.wolf.death"; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.4F; + } + + protected Item getDropItem() + { + return Item.getItemById(-1); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + super.onLivingUpdate(); + + if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) + { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + this.worldObj.setEntityState(this, (byte)8); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + this.field_70924_f = this.field_70926_e; + + if (this.func_70922_bv()) + { + this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; + } + else + { + this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; + } + + if (this.func_70922_bv()) + { + this.numTicksToChaseTarget = 10; + } + + if (this.isWet()) + { + this.isShaking = true; + this.field_70928_h = false; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } + else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) + { + if (this.timeWolfIsShaking == 0.0F) + { + this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.prevTimeWolfIsShaking = this.timeWolfIsShaking; + this.timeWolfIsShaking += 0.05F; + + if (this.prevTimeWolfIsShaking >= 2.0F) + { + this.isShaking = false; + this.field_70928_h = false; + this.prevTimeWolfIsShaking = 0.0F; + this.timeWolfIsShaking = 0.0F; + } + + if (this.timeWolfIsShaking > 0.4F) + { + float f = (float)this.boundingBox.minY; + int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F); + + for (int j = 0; j < i; ++j) + { + float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ); + } + } + } + } + + @SideOnly(Side.CLIENT) + public boolean getWolfShaking() + { + return this.isShaking; + } + + /** + * Used when calculating the amount of shading to apply while the wolf is shaking. + */ + @SideOnly(Side.CLIENT) + public float getShadingWhileShaking(float p_70915_1_) + { + return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F; + } + + @SideOnly(Side.CLIENT) + public float getShakeAngle(float p_70923_1_, float p_70923_2_) + { + float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + else if (f2 > 1.0F) + { + f2 = 1.0F; + } + + return MathHelper.sin(f2 * (float)Math.PI) * MathHelper.sin(f2 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; + } + + public float getEyeHeight() + { + return this.height * 0.8F; + } + + @SideOnly(Side.CLIENT) + public float getInterestedAngle(float p_70917_1_) + { + return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI; + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed() + { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + Entity entity = source.getEntity(); + this.aiSit.setSitting(false); + + if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) + { + amount = (amount + 1.0F) / 2.0F; + } + + return super.attackEntityFrom(source, amount); + } + } + + public boolean attackEntityAsMob(Entity p_70652_1_) + { + int i = this.isTamed() ? 4 : 2; + return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), (float)i); + } + + public void setTamed(boolean p_70903_1_) + { + super.setTamed(p_70903_1_); + + if (p_70903_1_) + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + } + else + { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(8.0D); + } + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if (this.isTamed()) + { + if (itemstack != null) + { + if (itemstack.getItem() instanceof ItemFood) + { + ItemFood itemfood = (ItemFood)itemstack.getItem(); + + if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) + { + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + this.heal((float)itemfood.func_150905_g(itemstack)); + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + else if (itemstack.getItem() == Items.dye) + { + int i = BlockColored.func_150032_b(itemstack.getItemDamage()); + + if (i != this.getCollarColor()) + { + this.setCollarColor(i); + + if (!p_70085_1_.capabilities.isCreativeMode && --itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + } + + if (this.func_152114_e(p_70085_1_) && !this.worldObj.isRemote && !this.isBreedingItem(itemstack)) + { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity)null); + this.setTarget((Entity)null); + this.setAttackTarget((EntityLivingBase)null); + } + } + else if (itemstack != null && itemstack.getItem() == Items.bone && !this.isAngry()) + { + if (!p_70085_1_.capabilities.isCreativeMode) + { + --itemstack.stackSize; + } + + if (itemstack.stackSize <= 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + if (!this.worldObj.isRemote) + { + if (this.rand.nextInt(3) == 0) + { + this.setTamed(true); + this.setPathToEntity((PathEntity)null); + this.setAttackTarget((EntityLivingBase)null); + this.aiSit.setSitting(true); + this.setHealth(20.0F); + this.func_152115_b(p_70085_1_.getUniqueID().toString()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte)7); + } + else + { + this.playTameEffect(false); + this.worldObj.setEntityState(this, (byte)6); + } + } + + return true; + } + + return super.interact(p_70085_1_); + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 8) + { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + @SideOnly(Side.CLIENT) + public float getTailRotation() + { + return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); + } + + /** + * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on + * the animal type) + */ + public boolean isBreedingItem(ItemStack p_70877_1_) + { + return p_70877_1_ == null ? false : (!(p_70877_1_.getItem() instanceof ItemFood) ? false : ((ItemFood)p_70877_1_.getItem()).isWolfsFavoriteMeat()); + } + + /** + * Will return how many at most can spawn in a chunk at once. + */ + public int getMaxSpawnedInChunk() + { + return 8; + } + + /** + * Determines whether this wolf is angry or not. + */ + public boolean isAngry() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + + /** + * Sets whether this wolf is angry or not. + */ + public void setAngry(boolean p_70916_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70916_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3))); + } + } + + /** + * Return this wolf's collar color. + */ + public int getCollarColor() + { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + + /** + * Set this wolf's collar color. + */ + public void setCollarColor(int p_82185_1_) + { + this.dataWatcher.updateObject(20, Byte.valueOf((byte)(p_82185_1_ & 15))); + } + + public EntityWolf createChild(EntityAgeable p_90011_1_) + { + EntityWolf entitywolf = new EntityWolf(this.worldObj); + String s = this.func_152113_b(); + + if (s != null && s.trim().length() > 0) + { + entitywolf.func_152115_b(s); + entitywolf.setTamed(true); + } + + return entitywolf; + } + + public void func_70918_i(boolean p_70918_1_) + { + if (p_70918_1_) + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)1)); + } + else + { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)0)); + } + } + + /** + * Returns true if the mob is currently able to mate with the specified mob. + */ + public boolean canMateWith(EntityAnimal p_70878_1_) + { + if (p_70878_1_ == this) + { + return false; + } + else if (!this.isTamed()) + { + return false; + } + else if (!(p_70878_1_ instanceof EntityWolf)) + { + return false; + } + else + { + EntityWolf entitywolf = (EntityWolf)p_70878_1_; + return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove()); + } + } + + public boolean func_70922_bv() + { + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + + /** + * Determines if an entity can be despawned, used on idle far away entities + */ + protected boolean canDespawn() + { + return !this.isTamed() && this.ticksExisted > 2400; + } + + public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) + { + if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) + { + if (p_142018_1_ instanceof EntityWolf) + { + EntityWolf entitywolf = (EntityWolf)p_142018_1_; + + if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_) + { + return false; + } + } + + return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame(); + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/passive/IAnimals.java b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/IAnimals.java new file mode 100644 index 0000000..d3d8677 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/passive/IAnimals.java @@ -0,0 +1,5 @@ +package net.minecraft.entity.passive; + +public interface IAnimals +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayer.java new file mode 100644 index 0000000..fd3e791 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayer.java @@ -0,0 +1,2630 @@ +package net.minecraft.entity.player; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBed; +import net.minecraft.block.material.Material; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityMultiPart; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.boss.EntityDragonPart; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.event.ClickEvent; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryEnderChest; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.FoodStats; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.chunk.IChunkProvider; + +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.ISpecialArmor.ArmorProperties; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.minecraftforge.event.entity.player.EntityInteractEvent; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; +import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; + +public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender +{ + public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; + private HashMap spawnChunkMap = new HashMap(); + private HashMap spawnForcedMap = new HashMap(); + + /** Inventory of the player */ + public InventoryPlayer inventory = new InventoryPlayer(this); + private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); + /** The Container for the player's inventory (which opens when they press E) */ + public Container inventoryContainer; + /** The Container the player has open. */ + public Container openContainer; + /** The food object of the player, the general hunger logic. */ + protected FoodStats foodStats = new FoodStats(); + /** + * Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as + * defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. + */ + protected int flyToggleTimer; + public float prevCameraYaw; + public float cameraYaw; + /** Used by EntityPlayer to prevent too many xp orbs from getting absorbed at once. */ + public int xpCooldown; + public double field_71091_bM; + public double field_71096_bN; + public double field_71097_bO; + public double field_71094_bP; + public double field_71095_bQ; + public double field_71085_bR; + /** Boolean value indicating weather a player is sleeping or not */ + protected boolean sleeping; + /** the current location of the player */ + public ChunkCoordinates playerLocation; + private int sleepTimer; + public float field_71079_bU; + @SideOnly(Side.CLIENT) + public float field_71082_cx; + public float field_71089_bV; + /** holds the spawn chunk of the player */ + private ChunkCoordinates spawnChunk; + /** Whether this player's spawn point is forced, preventing execution of bed checks. */ + private boolean spawnForced; + /** Holds the coordinate of the player when enter a minecraft to ride. */ + private ChunkCoordinates startMinecartRidingCoordinate; + /** The player's capabilities. (See class PlayerCapabilities) */ + public PlayerCapabilities capabilities = new PlayerCapabilities(); + /** The current experience level the player is on. */ + public int experienceLevel; + /** + * The total amount of experience the player has. This also includes the amount of experience within their + * Experience Bar. + */ + public int experienceTotal; + /** The current amount of experience the player has within their Experience Bar. */ + public float experience; + /** This is the item that is in use when the player is holding down the useItemButton (e.g., bow, food, sword) */ + private ItemStack itemInUse; + /** This field starts off equal to getMaxItemUseDuration and is decremented on each tick */ + private int itemInUseCount; + protected float speedOnGround = 0.1F; + protected float speedInAir = 0.02F; + private int field_82249_h; + private final GameProfile field_146106_i; + /** An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different */ + public EntityFishHook fishEntity; + private static final String __OBFID = "CL_00001711"; + + public EntityPlayer(World p_i45324_1_, GameProfile p_i45324_2_) + { + super(p_i45324_1_); + this.entityUniqueID = func_146094_a(p_i45324_2_); + this.field_146106_i = p_i45324_2_; + this.inventoryContainer = new ContainerPlayer(this.inventory, !p_i45324_1_.isRemote, this); + this.openContainer = this.inventoryContainer; + this.yOffset = 1.62F; + ChunkCoordinates chunkcoordinates = p_i45324_1_.getSpawnPoint(); + this.setLocationAndAngles((double)chunkcoordinates.posX + 0.5D, (double)(chunkcoordinates.posY + 1), (double)chunkcoordinates.posZ + 0.5D, 0.0F, 0.0F); + this.field_70741_aB = 180.0F; + this.fireResistance = 20; + this.eyeHeight = this.getDefaultEyeHeight(); + } + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(17, Float.valueOf(0.0F)); + this.dataWatcher.addObject(18, Integer.valueOf(0)); + } + + /** + * returns the ItemStack containing the itemInUse + */ + @SideOnly(Side.CLIENT) + public ItemStack getItemInUse() + { + return this.itemInUse; + } + + /** + * Returns the item in use count + */ + @SideOnly(Side.CLIENT) + public int getItemInUseCount() + { + return this.itemInUseCount; + } + + /** + * Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton + */ + public boolean isUsingItem() + { + return this.itemInUse != null; + } + + /** + * gets the duration for how long the current itemInUse has been in use + */ + @SideOnly(Side.CLIENT) + public int getItemInUseDuration() + { + return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; + } + + public void stopUsingItem() + { + if (this.itemInUse != null) + { + if (!ForgeEventFactory.onUseItemStop(this, itemInUse, itemInUseCount)) + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); + } + + this.clearItemInUse(); + } + + public void clearItemInUse() + { + this.itemInUse = null; + this.itemInUseCount = 0; + + if (!this.worldObj.isRemote) + { + this.setEating(false); + } + } + + public boolean isBlocking() + { + return this.isUsingItem() && this.itemInUse.getItem().getItemUseAction(this.itemInUse) == EnumAction.block; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + FMLCommonHandler.instance().onPlayerPreTick(this); + if (this.itemInUse != null) + { + ItemStack itemstack = this.inventory.getCurrentItem(); + + if (itemstack == this.itemInUse) + { + itemInUseCount = ForgeEventFactory.onItemUseTick(this, itemInUse, itemInUseCount); + if (itemInUseCount <= 0) + { + this.onItemUseFinish(); + } + else + { + itemInUse.getItem().onUsingTick(itemInUse, this, itemInUseCount); + if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) + { + this.updateItemUse(itemstack, 5); + } + + if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) + { + this.onItemUseFinish(); + } + } + } + else + { + this.clearItemInUse(); + } + } + + if (this.xpCooldown > 0) + { + --this.xpCooldown; + } + + if (this.isPlayerSleeping()) + { + ++this.sleepTimer; + + if (this.sleepTimer > 100) + { + this.sleepTimer = 100; + } + + if (!this.worldObj.isRemote) + { + if (!this.isInBed()) + { + this.wakeUpPlayer(true, true, false); + } + else if (this.worldObj.isDaytime()) + { + this.wakeUpPlayer(false, true, true); + } + } + } + else if (this.sleepTimer > 0) + { + ++this.sleepTimer; + + if (this.sleepTimer >= 110) + { + this.sleepTimer = 0; + } + } + + super.onUpdate(); + + if (!this.worldObj.isRemote && this.openContainer != null && !ForgeHooks.canInteractWith(this, this.openContainer)) + { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + if (this.isBurning() && this.capabilities.disableDamage) + { + this.extinguish(); + } + + this.field_71091_bM = this.field_71094_bP; + this.field_71096_bN = this.field_71095_bQ; + this.field_71097_bO = this.field_71085_bR; + double d3 = this.posX - this.field_71094_bP; + double d0 = this.posY - this.field_71095_bQ; + double d1 = this.posZ - this.field_71085_bR; + double d2 = 10.0D; + + if (d3 > d2) + { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + + if (d1 > d2) + { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + + if (d0 > d2) + { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + + if (d3 < -d2) + { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + + if (d1 < -d2) + { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + + if (d0 < -d2) + { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + + this.field_71094_bP += d3 * 0.25D; + this.field_71085_bR += d1 * 0.25D; + this.field_71095_bQ += d0 * 0.25D; + + if (this.ridingEntity == null) + { + this.startMinecartRidingCoordinate = null; + } + + if (!this.worldObj.isRemote) + { + this.foodStats.onUpdate(this); + this.addStat(StatList.minutesPlayedStat, 1); + } + FMLCommonHandler.instance().onPlayerPostTick(this); + } + + /** + * Return the amount of time this entity should stay in a portal before being transported. + */ + public int getMaxInPortalTime() + { + return this.capabilities.disableDamage ? 0 : 80; + } + + protected String getSwimSound() + { + return "game.player.swim"; + } + + protected String getSplashSound() + { + return "game.player.swim.splash"; + } + + /** + * Return the amount of cooldown before this entity can use a portal again. + */ + public int getPortalCooldown() + { + return 10; + } + + public void playSound(String name, float volume, float pitch) + { + this.worldObj.playSoundToNearExcept(this, name, volume, pitch); + } + + /** + * Plays sounds and makes particles for item in use state + */ + protected void updateItemUse(ItemStack itemStackIn, int p_71010_2_) + { + if (itemStackIn.getItemUseAction() == EnumAction.drink) + { + this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (itemStackIn.getItemUseAction() == EnumAction.eat) + { + for (int j = 0; j < p_71010_2_; ++j) + { + Vec3 vec3 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + vec3.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + vec3.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + Vec3 vec31 = Vec3.createVectorHelper(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + vec31.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + vec31.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); + String s = "iconcrack_" + Item.getIdFromItem(itemStackIn.getItem()); + + if (itemStackIn.getHasSubtypes()) + { + s = s + "_" + itemStackIn.getItemDamage(); + } + + this.worldObj.spawnParticle(s, vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord); + } + + this.playSound("random.eat", 0.5F + 0.5F * (float)this.rand.nextInt(2), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() + { + if (this.itemInUse != null) + { + this.updateItemUse(this.itemInUse, 16); + int i = this.itemInUse.stackSize; + ItemStack itemstack = this.itemInUse.onFoodEaten(this.worldObj, this); + + itemstack = ForgeEventFactory.onItemUseFinish(this, itemInUse, itemInUseCount, itemstack); + + if (itemstack != this.itemInUse || itemstack != null && itemstack.stackSize != i) + { + this.inventory.mainInventory[this.inventory.currentItem] = itemstack; + + if (itemstack != null && itemstack.stackSize == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } + } + + this.clearItemInUse(); + } + } + + @SideOnly(Side.CLIENT) + public void handleHealthUpdate(byte p_70103_1_) + { + if (p_70103_1_ == 9) + { + this.onItemUseFinish(); + } + else + { + super.handleHealthUpdate(p_70103_1_); + } + } + + /** + * Dead and sleeping entities cannot move + */ + protected boolean isMovementBlocked() + { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + + /** + * sets current screen to null (used on escape buttons of GUIs); sets current crafting inventory back to the 2x2 + * square + */ + public void closeScreen() + { + this.openContainer = this.inventoryContainer; + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity entityIn) + { + if (this.ridingEntity != null && entityIn == null) + { + if (!this.worldObj.isRemote) + { + this.dismountEntity(this.ridingEntity); + } + + if (this.ridingEntity != null) + { + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } + else + { + super.mountEntity(entityIn); + } + } + + /** + * Handles updating while being ridden by an entity + */ + public void updateRidden() + { + if (!this.worldObj.isRemote && this.isSneaking()) + { + this.mountEntity((Entity)null); + this.setSneaking(false); + } + else + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + float f = this.rotationYaw; + float f1 = this.rotationPitch; + super.updateRidden(); + this.prevCameraYaw = this.cameraYaw; + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + + if (this.ridingEntity instanceof EntityLivingBase && ((EntityLivingBase)ridingEntity).shouldRiderFaceForward(this)) + { + this.rotationPitch = f1; + this.rotationYaw = f; + this.renderYawOffset = ((EntityLivingBase)this.ridingEntity).renderYawOffset; + } + } + } + + /** + * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned + * (only actually used on players though its also on Entity) + */ + @SideOnly(Side.CLIENT) + public void preparePlayerToSpawn() + { + this.yOffset = 1.62F; + this.setSize(0.6F, 1.8F); + super.preparePlayerToSpawn(); + this.setHealth(this.getMaxHealth()); + this.deathTime = 0; + } + + protected void updateEntityActionState() + { + super.updateEntityActionState(); + this.updateArmSwingProgress(); + } + + /** + * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons + * use this to react to sunlight and start to burn. + */ + public void onLivingUpdate() + { + if (this.flyToggleTimer > 0) + { + --this.flyToggleTimer; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) + { + this.heal(1.0F); + } + + this.inventory.decrementAnimations(); + this.prevCameraYaw = this.cameraYaw; + super.onLivingUpdate(); + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + + if (!this.worldObj.isRemote) + { + iattributeinstance.setBaseValue((double)this.capabilities.getWalkSpeed()); + } + + this.jumpMovementFactor = this.speedInAir; + + if (this.isSprinting()) + { + this.jumpMovementFactor = (float)((double)this.jumpMovementFactor + (double)this.speedInAir * 0.3D); + } + + this.setAIMoveSpeed((float)iattributeinstance.getAttributeValue()); + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f1 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; + + if (f > 0.1F) + { + f = 0.1F; + } + + if (!this.onGround || this.getHealth() <= 0.0F) + { + f = 0.0F; + } + + if (this.onGround || this.getHealth() <= 0.0F) + { + f1 = 0.0F; + } + + this.cameraYaw += (f - this.cameraYaw) * 0.4F; + this.cameraPitch += (f1 - this.cameraPitch) * 0.8F; + + if (this.getHealth() > 0.0F) + { + AxisAlignedBB axisalignedbb = null; + + if (this.ridingEntity != null && !this.ridingEntity.isDead) + { + axisalignedbb = this.boundingBox.func_111270_a(this.ridingEntity.boundingBox).expand(1.0D, 0.0D, 1.0D); + } + else + { + axisalignedbb = this.boundingBox.expand(1.0D, 0.5D, 1.0D); + } + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, axisalignedbb); + + if (list != null) + { + for (int i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (!entity.isDead) + { + this.collideWithPlayer(entity); + } + } + } + } + } + + private void collideWithPlayer(Entity p_71044_1_) + { + p_71044_1_.onCollideWithPlayer(this); + } + + public int getScore() + { + return this.dataWatcher.getWatchableObjectInt(18); + } + + /** + * Set player's score + */ + public void setScore(int p_85040_1_) + { + this.dataWatcher.updateObject(18, Integer.valueOf(p_85040_1_)); + } + + /** + * Add to player's score + */ + public void addScore(int p_85039_1_) + { + int j = this.getScore(); + this.dataWatcher.updateObject(18, Integer.valueOf(j + p_85039_1_)); + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + super.onDeath(p_70645_1_); + this.setSize(0.2F, 0.2F); + this.setPosition(this.posX, this.posY, this.posZ); + this.motionY = 0.10000000149011612D; + + captureDrops = true; + capturedDrops.clear(); + + if (this.getCommandSenderName().equals("Notch")) + { + this.func_146097_a(new ItemStack(Items.apple, 1), true, false); + } + + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + { + this.inventory.dropAllItems(); + } + + captureDrops = false; + + if (!worldObj.isRemote) + { + PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, recentlyHit > 0); + if (!MinecraftForge.EVENT_BUS.post(event)) + { + for (EntityItem item : capturedDrops) + { + joinEntityItemWithWorld(item); + } + } + } + + if (p_70645_1_ != null) + { + this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + this.motionZ = (double)(-MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + } + else + { + this.motionX = this.motionZ = 0.0D; + } + + this.yOffset = 0.1F; + this.addStat(StatList.deathsStat, 1); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "game.player.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "game.player.die"; + } + + /** + * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: + * entity, scoreToAdd + */ + public void addToPlayerScore(Entity entityIn, int amount) + { + this.addScore(amount); + Collection collection = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.totalKillCount); + + if (entityIn instanceof EntityPlayer) + { + this.addStat(StatList.playerKillsStat, 1); + collection.addAll(this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.playerKillCount)); + } + else + { + this.addStat(StatList.mobKillsStat, 1); + } + + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + Score score = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), scoreobjective); + score.func_96648_a(); + } + } + + /** + * Called when player presses the drop item key + */ + public EntityItem dropOneItem(boolean p_71040_1_) + { + ItemStack stack = inventory.getCurrentItem(); + + if (stack == null) + { + return null; + } + + if (stack.getItem().onDroppedByPlayer(stack, this)) + { + int count = p_71040_1_ && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1; + return ForgeHooks.onPlayerTossEvent(this, inventory.decrStackSize(inventory.currentItem, count), true); + } + + return null; + } + + /** + * Args: itemstack, flag + */ + public EntityItem dropPlayerItemWithRandomChoice(ItemStack itemStackIn, boolean p_71019_2_) + { + return ForgeHooks.onPlayerTossEvent(this, itemStackIn, false); + } + + public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) + { + if (p_146097_1_ == null) + { + return null; + } + else if (p_146097_1_.stackSize == 0) + { + return null; + } + else + { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY - 0.30000001192092896D + (double)this.getEyeHeight(), this.posZ, p_146097_1_); + entityitem.delayBeforeCanPickup = 40; + + if (p_146097_3_) + { + entityitem.func_145799_b(this.getCommandSenderName()); + } + + float f = 0.1F; + float f1; + + if (p_146097_2_) + { + f1 = this.rand.nextFloat() * 0.5F; + float f2 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + entityitem.motionX = (double)(-MathHelper.sin(f2) * f1); + entityitem.motionZ = (double)(MathHelper.cos(f2) * f1); + entityitem.motionY = 0.20000000298023224D; + } + else + { + f = 0.3F; + entityitem.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + entityitem.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + entityitem.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * f + 0.1F); + f = 0.02F; + f1 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + f *= this.rand.nextFloat(); + entityitem.motionX += Math.cos((double)f1) * (double)f; + entityitem.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + entityitem.motionZ += Math.sin((double)f1) * (double)f; + } + + this.joinEntityItemWithWorld(entityitem); + this.addStat(StatList.dropStat, 1); + return entityitem; + } + } + + /** + * Joins the passed in entity item with the world. Args: entityItem + */ + public void joinEntityItemWithWorld(EntityItem p_71012_1_) + { + if (captureDrops) + { + capturedDrops.add(p_71012_1_); + return; + } + this.worldObj.spawnEntityInWorld(p_71012_1_); + } + + /** + * Returns how strong the player is against the specified block at this moment + */ + @Deprecated //Metadata sensitive version, named getBreakSpeed + public float getCurrentPlayerStrVsBlock(Block p_146096_1_, boolean p_146096_2_) + { + return getBreakSpeed(p_146096_1_, p_146096_2_, 0, 0, -1, 0); + } + + @Deprecated //Location Specifc, one below, remove in 1.8 + public float getBreakSpeed(Block p_146096_1_, boolean p_146096_2_, int meta) + { + return getBreakSpeed(p_146096_1_, p_146096_2_, meta, 0, -1, 0); + } + + public float getBreakSpeed(Block p_146096_1_, boolean p_146096_2_, int meta, int x, int y, int z) + { + ItemStack stack = inventory.getCurrentItem(); + float f = (stack == null ? 1.0F : stack.getItem().getDigSpeed(stack, p_146096_1_, meta)); + + if (f > 1.0F) + { + int i = EnchantmentHelper.getEfficiencyModifier(this); + ItemStack itemstack = this.inventory.getCurrentItem(); + + if (i > 0 && itemstack != null) + { + float f1 = (float)(i * i + 1); + + boolean canHarvest = ForgeHooks.canToolHarvestBlock(p_146096_1_, meta, itemstack); + + if (!canHarvest && f <= 1.0F) + { + f += f1 * 0.08F; + } + else + { + f += f1; + } + } + } + + if (this.isPotionActive(Potion.digSpeed)) + { + f *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + + if (this.isPotionActive(Potion.digSlowdown)) + { + f *= 1.0F - (float)(this.getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F; + } + + if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) + { + f /= 5.0F; + } + + if (!this.onGround) + { + f /= 5.0F; + } + + f = ForgeEventFactory.getBreakSpeed(this, p_146096_1_, meta, f, x, y, z); + return (f < 0 ? 0 : f); + } + + /** + * Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary) + */ + public boolean canHarvestBlock(Block p_146099_1_) + { + return ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.inventory.func_146025_b(p_146099_1_)); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + this.entityUniqueID = func_146094_a(this.field_146106_i); + NBTTagList nbttaglist = tagCompund.getTagList("Inventory", 10); + this.inventory.readFromNBT(nbttaglist); + this.inventory.currentItem = tagCompund.getInteger("SelectedItemSlot"); + this.sleeping = tagCompund.getBoolean("Sleeping"); + this.sleepTimer = tagCompund.getShort("SleepTimer"); + this.experience = tagCompund.getFloat("XpP"); + this.experienceLevel = tagCompund.getInteger("XpLevel"); + this.experienceTotal = tagCompund.getInteger("XpTotal"); + this.setScore(tagCompund.getInteger("Score")); + + if (this.sleeping) + { + this.playerLocation = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.wakeUpPlayer(true, true, false); + } + + if (tagCompund.hasKey("SpawnX", 99) && tagCompund.hasKey("SpawnY", 99) && tagCompund.hasKey("SpawnZ", 99)) + { + this.spawnChunk = new ChunkCoordinates(tagCompund.getInteger("SpawnX"), tagCompund.getInteger("SpawnY"), tagCompund.getInteger("SpawnZ")); + this.spawnForced = tagCompund.getBoolean("SpawnForced"); + } + + NBTTagList spawnlist = null; + spawnlist = tagCompund.getTagList("Spawns", 10); + for (int i = 0; i < spawnlist.tagCount(); i++) + { + NBTTagCompound spawndata = (NBTTagCompound)spawnlist.getCompoundTagAt(i); + int spawndim = spawndata.getInteger("Dim"); + this.spawnChunkMap.put(spawndim, new ChunkCoordinates(spawndata.getInteger("SpawnX"), spawndata.getInteger("SpawnY"), spawndata.getInteger("SpawnZ"))); + this.spawnForcedMap.put(spawndim, spawndata.getBoolean("SpawnForced")); + } + + this.foodStats.readNBT(tagCompund); + this.capabilities.readCapabilitiesFromNBT(tagCompund); + + if (tagCompund.hasKey("EnderItems", 9)) + { + NBTTagList nbttaglist1 = tagCompund.getTagList("EnderItems", 10); + this.theInventoryEnderChest.loadInventoryFromNBT(nbttaglist1); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); + tagCompound.setInteger("SelectedItemSlot", this.inventory.currentItem); + tagCompound.setBoolean("Sleeping", this.sleeping); + tagCompound.setShort("SleepTimer", (short)this.sleepTimer); + tagCompound.setFloat("XpP", this.experience); + tagCompound.setInteger("XpLevel", this.experienceLevel); + tagCompound.setInteger("XpTotal", this.experienceTotal); + tagCompound.setInteger("Score", this.getScore()); + + if (this.spawnChunk != null) + { + tagCompound.setInteger("SpawnX", this.spawnChunk.posX); + tagCompound.setInteger("SpawnY", this.spawnChunk.posY); + tagCompound.setInteger("SpawnZ", this.spawnChunk.posZ); + tagCompound.setBoolean("SpawnForced", this.spawnForced); + } + + NBTTagList spawnlist = new NBTTagList(); + for (Entry entry : this.spawnChunkMap.entrySet()) + { + ChunkCoordinates spawn = entry.getValue(); + if (spawn == null) continue; + Boolean forced = spawnForcedMap.get(entry.getKey()); + if (forced == null) forced = false; + NBTTagCompound spawndata = new NBTTagCompound(); + spawndata.setInteger("Dim", entry.getKey()); + spawndata.setInteger("SpawnX", spawn.posX); + spawndata.setInteger("SpawnY", spawn.posY); + spawndata.setInteger("SpawnZ", spawn.posZ); + spawndata.setBoolean("SpawnForced", forced); + spawnlist.appendTag(spawndata); + } + tagCompound.setTag("Spawns", spawnlist); + + this.foodStats.writeNBT(tagCompound); + this.capabilities.writeCapabilitiesToNBT(tagCompound); + tagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) {} + + public void func_146093_a(TileEntityHopper p_146093_1_) {} + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) {} + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) {} + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) {} + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) {} + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) {} + + public float getEyeHeight() + { + return eyeHeight; + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() + { + this.yOffset = 1.62F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (ForgeHooks.onLivingAttack(this, source, amount)) return false; + if (this.isEntityInvulnerable()) + { + return false; + } + else if (this.capabilities.disableDamage && !source.canHarmInCreative()) + { + return false; + } + else + { + this.entityAge = 0; + + if (this.getHealth() <= 0.0F) + { + return false; + } + else + { + if (this.isPlayerSleeping() && !this.worldObj.isRemote) + { + this.wakeUpPlayer(true, true, false); + } + + if (source.isDifficultyScaled()) + { + if (this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) + { + amount = 0.0F; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.EASY) + { + amount = amount / 2.0F + 1.0F; + } + + if (this.worldObj.difficultySetting == EnumDifficulty.HARD) + { + amount = amount * 3.0F / 2.0F; + } + } + + if (amount == 0.0F) + { + return false; + } + else + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityArrow && ((EntityArrow)entity).shootingEntity != null) + { + entity = ((EntityArrow)entity).shootingEntity; + } + + this.addStat(StatList.damageTakenStat, Math.round(amount * 10.0F)); + return super.attackEntityFrom(source, amount); + } + } + } + } + + public boolean canAttackPlayer(EntityPlayer p_96122_1_) + { + Team team = this.getTeam(); + Team team1 = p_96122_1_.getTeam(); + return team == null ? true : (!team.isSameTeam(team1) ? true : team.getAllowFriendlyFire()); + } + + protected void damageArmor(float p_70675_1_) + { + this.inventory.damageArmor(p_70675_1_); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + public int getTotalArmorValue() + { + return this.inventory.getTotalArmorValue(); + } + + /** + * When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing + * them anyway. + */ + public float getArmorVisibility() + { + int i = 0; + ItemStack[] aitemstack = this.inventory.armorInventory; + int j = aitemstack.length; + + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = aitemstack[k]; + + if (itemstack != null) + { + ++i; + } + } + + return (float)i / (float)this.inventory.armorInventory.length; + } + + /** + * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health + * second with the reduced value. Args: damageAmount + */ + protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_) + { + if (!this.isEntityInvulnerable()) + { + p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); + if (p_70665_2_ <= 0) return; + if (!p_70665_1_.isUnblockable() && this.isBlocking() && p_70665_2_ > 0.0F) + { + p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; + } + + p_70665_2_ = ArmorProperties.ApplyArmor(this, inventory.armorInventory, p_70665_1_, p_70665_2_); + if (p_70665_2_ <= 0) return; + p_70665_2_ = this.applyPotionDamageCalculations(p_70665_1_, p_70665_2_); + float f1 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.getAbsorptionAmount(), 0.0F); + this.setAbsorptionAmount(this.getAbsorptionAmount() - (f1 - p_70665_2_)); + + if (p_70665_2_ != 0.0F) + { + this.addExhaustion(p_70665_1_.getHungerDamage()); + float f2 = this.getHealth(); + this.setHealth(this.getHealth() - p_70665_2_); + this.func_110142_aN().func_94547_a(p_70665_1_, f2, p_70665_2_); + } + } + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) {} + + public void func_146102_a(TileEntityDispenser p_146102_1_) {} + + public void func_146100_a(TileEntity p_146100_1_) {} + + public void func_146095_a(CommandBlockLogic p_146095_1_) {} + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) {} + + public void func_146104_a(TileEntityBeacon p_146104_1_) {} + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) {} + + /** + * Displays the GUI for interacting with a book. + */ + public void displayGUIBook(ItemStack p_71048_1_) {} + + public boolean interactWith(Entity p_70998_1_) + { + if (MinecraftForge.EVENT_BUS.post(new EntityInteractEvent(this, p_70998_1_))) return false; + ItemStack itemstack = this.getCurrentEquippedItem(); + ItemStack itemstack1 = itemstack != null ? itemstack.copy() : null; + + if (!p_70998_1_.interactFirst(this)) + { + if (itemstack != null && p_70998_1_ instanceof EntityLivingBase) + { + if (this.capabilities.isCreativeMode) + { + itemstack = itemstack1; + } + + if (itemstack.interactWithEntity(this, (EntityLivingBase)p_70998_1_)) + { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) + { + this.destroyCurrentEquippedItem(); + } + + return true; + } + } + + return false; + } + else + { + if (itemstack != null && itemstack == this.getCurrentEquippedItem()) + { + if (itemstack.stackSize <= 0 && !this.capabilities.isCreativeMode) + { + this.destroyCurrentEquippedItem(); + } + else if (itemstack.stackSize < itemstack1.stackSize && this.capabilities.isCreativeMode) + { + itemstack.stackSize = itemstack1.stackSize; + } + } + + return true; + } + } + + /** + * Returns the currently being used item by the player. + */ + public ItemStack getCurrentEquippedItem() + { + return this.inventory.getCurrentItem(); + } + + /** + * Destroys the currently equipped item from the player's inventory. + */ + public void destroyCurrentEquippedItem() + { + ItemStack orig = getCurrentEquippedItem(); + this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, orig)); + } + + /** + * Returns the Y Offset of this entity. + */ + public double getYOffset() + { + return (double)(this.yOffset - 0.5F); + } + + /** + * Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity + * called on it. Args: targetEntity + */ + public void attackTargetEntityWithCurrentItem(Entity targetEntity) + { + if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(this, targetEntity))) + { + return; + } + ItemStack stack = getCurrentEquippedItem(); + if (stack != null && stack.getItem().onLeftClickEntity(stack, this, targetEntity)) + { + return; + } + if (targetEntity.canAttackWithItem()) + { + if (!targetEntity.hitByEntity(this)) + { + float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; + float f1 = 0.0F; + + if (targetEntity instanceof EntityLivingBase) + { + f1 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)targetEntity); + i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)targetEntity); + } + + if (this.isSprinting()) + { + ++i; + } + + if (f > 0.0F || f1 > 0.0F) + { + boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && targetEntity instanceof EntityLivingBase; + + if (flag && f > 0.0F) + { + f *= 1.5F; + } + + f += f1; + boolean flag1 = false; + int j = EnchantmentHelper.getFireAspectModifier(this); + + if (targetEntity instanceof EntityLivingBase && j > 0 && !targetEntity.isBurning()) + { + flag1 = true; + targetEntity.setFire(1); + } + + boolean flag2 = targetEntity.attackEntityFrom(DamageSource.causePlayerDamage(this), f); + + if (flag2) + { + if (i > 0) + { + targetEntity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + + if (flag) + { + this.onCriticalHit(targetEntity); + } + + if (f1 > 0.0F) + { + this.onEnchantmentCritical(targetEntity); + } + + if (f >= 18.0F) + { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(targetEntity); + + if (targetEntity instanceof EntityLivingBase) + { + EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); + } + + EnchantmentHelper.func_151385_b(this, targetEntity); + ItemStack itemstack = this.getCurrentEquippedItem(); + Object object = targetEntity; + + if (targetEntity instanceof EntityDragonPart) + { + IEntityMultiPart ientitymultipart = ((EntityDragonPart)targetEntity).entityDragonObj; + + if (ientitymultipart != null && ientitymultipart instanceof EntityLivingBase) + { + object = (EntityLivingBase)ientitymultipart; + } + } + + if (itemstack != null && object instanceof EntityLivingBase) + { + itemstack.hitEntity((EntityLivingBase)object, this); + + if (itemstack.stackSize <= 0) + { + this.destroyCurrentEquippedItem(); + } + } + + if (targetEntity instanceof EntityLivingBase) + { + this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F)); + + if (j > 0) + { + targetEntity.setFire(j * 4); + } + } + + this.addExhaustion(0.3F); + } + else if (flag1) + { + targetEntity.extinguish(); + } + } + } + } + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) {} + + public void onEnchantmentCritical(Entity p_71047_1_) {} + + @SideOnly(Side.CLIENT) + public void respawnPlayer() {} + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + super.setDead(); + this.inventoryContainer.onContainerClosed(this); + + if (this.openContainer != null) + { + this.openContainer.onContainerClosed(this); + } + } + + /** + * Checks if this entity is inside of an opaque block + */ + public boolean isEntityInsideOpaqueBlock() + { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + + /** + * Returns the GameProfile for this player + */ + public GameProfile getGameProfile() + { + return this.field_146106_i; + } + + /** + * puts player to sleep on specified bed if possible + */ + public EntityPlayer.EnumStatus sleepInBedAt(int x, int y, int z) + { + PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(this, x, y, z); + MinecraftForge.EVENT_BUS.post(event); + if (event.result != null) + { + return event.result; + } + if (!this.worldObj.isRemote) + { + if (this.isPlayerSleeping() || !this.isEntityAlive()) + { + return EntityPlayer.EnumStatus.OTHER_PROBLEM; + } + + if (!this.worldObj.provider.isSurfaceWorld()) + { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_HERE; + } + + if (this.worldObj.isDaytime()) + { + return EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW; + } + + if (Math.abs(this.posX - (double)x) > 3.0D || Math.abs(this.posY - (double)y) > 2.0D || Math.abs(this.posZ - (double)z) > 3.0D) + { + return EntityPlayer.EnumStatus.TOO_FAR_AWAY; + } + + double d0 = 8.0D; + double d1 = 5.0D; + List list = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox((double)x - d0, (double)y - d1, (double)z - d0, (double)x + d0, (double)y + d1, (double)z + d0)); + + if (!list.isEmpty()) + { + return EntityPlayer.EnumStatus.NOT_SAFE; + } + } + + if (this.isRiding()) + { + this.mountEntity((Entity)null); + } + + this.setSize(0.2F, 0.2F); + this.yOffset = 0.2F; + + if (this.worldObj.blockExists(x, y, z)) + { + int l = worldObj.getBlock(x, y, z).getBedDirection(worldObj, x, y, z); + float f1 = 0.5F; + float f = 0.5F; + + switch (l) + { + case 0: + f = 0.9F; + break; + case 1: + f1 = 0.1F; + break; + case 2: + f = 0.1F; + break; + case 3: + f1 = 0.9F; + } + + this.func_71013_b(l); + this.setPosition((double)((float)x + f1), (double)((float)y + 0.9375F), (double)((float)z + f)); + } + else + { + this.setPosition((double)((float)x + 0.5F), (double)((float)y + 0.9375F), (double)((float)z + 0.5F)); + } + + this.sleeping = true; + this.sleepTimer = 0; + this.playerLocation = new ChunkCoordinates(x, y, z); + this.motionX = this.motionZ = this.motionY = 0.0D; + + if (!this.worldObj.isRemote) + { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + return EntityPlayer.EnumStatus.OK; + } + + private void func_71013_b(int p_71013_1_) + { + this.field_71079_bU = 0.0F; + this.field_71089_bV = 0.0F; + + switch (p_71013_1_) + { + case 0: + this.field_71089_bV = -1.8F; + break; + case 1: + this.field_71079_bU = 1.8F; + break; + case 2: + this.field_71089_bV = 1.8F; + break; + case 3: + this.field_71079_bU = -1.8F; + } + } + + /** + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean p_70999_1_, boolean updateWorldFlag, boolean setSpawn) + { + MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerWakeUpEvent(this, p_70999_1_, updateWorldFlag, setSpawn)); + this.setSize(0.6F, 1.8F); + this.resetHeight(); + ChunkCoordinates chunkcoordinates = this.playerLocation; + ChunkCoordinates chunkcoordinates1 = this.playerLocation; + Block block = (chunkcoordinates == null ? null : worldObj.getBlock(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)); + + if (chunkcoordinates != null && block.isBed(worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this)) + { + block.setBedOccupied(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this, false); + chunkcoordinates1 = block.getBedSpawnPosition(this.worldObj, chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this); + + if (chunkcoordinates1 == null) + { + chunkcoordinates1 = new ChunkCoordinates(chunkcoordinates.posX, chunkcoordinates.posY + 1, chunkcoordinates.posZ); + } + + this.setPosition((double)((float)chunkcoordinates1.posX + 0.5F), (double)((float)chunkcoordinates1.posY + this.yOffset + 0.1F), (double)((float)chunkcoordinates1.posZ + 0.5F)); + } + + this.sleeping = false; + + if (!this.worldObj.isRemote && updateWorldFlag) + { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + if (p_70999_1_) + { + this.sleepTimer = 0; + } + else + { + this.sleepTimer = 100; + } + + if (setSpawn) + { + this.setSpawnChunk(this.playerLocation, false); + } + } + + /** + * Checks if the player is currently in a bed + */ + private boolean isInBed() + { + return this.worldObj.getBlock(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ).isBed(worldObj, playerLocation.posX, playerLocation.posY, playerLocation.posZ, this); + } + + /** + * Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to + * spawn. + */ + public static ChunkCoordinates verifyRespawnCoordinates(World p_71056_0_, ChunkCoordinates p_71056_1_, boolean p_71056_2_) + { + IChunkProvider ichunkprovider = p_71056_0_.getChunkProvider(); + ichunkprovider.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ - 3 >> 4); + ichunkprovider.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ - 3 >> 4); + ichunkprovider.loadChunk(p_71056_1_.posX - 3 >> 4, p_71056_1_.posZ + 3 >> 4); + ichunkprovider.loadChunk(p_71056_1_.posX + 3 >> 4, p_71056_1_.posZ + 3 >> 4); + + if (p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).isBed(p_71056_0_, p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ, null)) + { + ChunkCoordinates chunkcoordinates1 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).getBedSpawnPosition(p_71056_0_, p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ, null); + return chunkcoordinates1; + } + else + { + Material material = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY, p_71056_1_.posZ).getMaterial(); + Material material1 = p_71056_0_.getBlock(p_71056_1_.posX, p_71056_1_.posY + 1, p_71056_1_.posZ).getMaterial(); + boolean flag1 = !material.isSolid() && !material.isLiquid(); + boolean flag2 = !material1.isSolid() && !material1.isLiquid(); + return p_71056_2_ && flag1 && flag2 ? p_71056_1_ : null; + } + } + + /** + * Returns the orientation of the bed in degrees. + */ + @SideOnly(Side.CLIENT) + public float getBedOrientationInDegrees() + { + if (this.playerLocation != null) + { + int x = playerLocation.posX; + int y = playerLocation.posY; + int z = playerLocation.posZ; + int j = worldObj.getBlock(x, y, z).getBedDirection(worldObj, x, y, z); + + switch (j) + { + case 0: + return 90.0F; + case 1: + return 0.0F; + case 2: + return 270.0F; + case 3: + return 180.0F; + } + } + + return 0.0F; + } + + /** + * Returns whether player is sleeping or not + */ + public boolean isPlayerSleeping() + { + return this.sleeping; + } + + /** + * Returns whether or not the player is asleep and the screen has fully faded. + */ + public boolean isPlayerFullyAsleep() + { + return this.sleeping && this.sleepTimer >= 100; + } + + @SideOnly(Side.CLIENT) + public int getSleepTimer() + { + return this.sleepTimer; + } + + @SideOnly(Side.CLIENT) + protected boolean getHideCape(int p_82241_1_) + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1 << p_82241_1_) != 0; + } + + protected void setHideCape(int p_82239_1_, boolean p_82239_2_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_82239_2_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1 << p_82239_1_))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & ~(1 << p_82239_1_)))); + } + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) {} + + /** + * Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. + */ + @Deprecated + public ChunkCoordinates getBedLocation() + { + return getBedLocation(this.dimension); + } + + @Deprecated + public boolean isSpawnForced() + { + return isSpawnForced(this.dimension); + } + + /** + * Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. + */ + public void setSpawnChunk(ChunkCoordinates p_71063_1_, boolean p_71063_2_) + { + if (this.dimension != 0) + { + setSpawnChunk(p_71063_1_, p_71063_2_, this.dimension); + return; + } + if (p_71063_1_ != null) + { + this.spawnChunk = new ChunkCoordinates(p_71063_1_); + this.spawnForced = p_71063_2_; + } + else + { + this.spawnChunk = null; + this.spawnForced = false; + } + } + + /** + * Will trigger the specified trigger. + */ + public void triggerAchievement(StatBase p_71029_1_) + { + this.addStat(p_71029_1_, 1); + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) {} + + /** + * Causes this entity to do an upwards motion (jumping). + */ + public void jump() + { + super.jump(); + this.addStat(StatList.jumpStat, 1); + + if (this.isSprinting()) + { + this.addExhaustion(0.8F); + } + else + { + this.addExhaustion(0.2F); + } + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + public void moveEntityWithHeading(float p_70612_1_, float p_70612_2_) + { + double d0 = this.posX; + double d1 = this.posY; + double d2 = this.posZ; + + if (this.capabilities.isFlying && this.ridingEntity == null) + { + double d3 = this.motionY; + float f2 = this.jumpMovementFactor; + this.jumpMovementFactor = this.capabilities.getFlySpeed(); + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + this.motionY = d3 * 0.6D; + this.jumpMovementFactor = f2; + } + else + { + super.moveEntityWithHeading(p_70612_1_, p_70612_2_); + } + + this.addMovementStat(this.posX - d0, this.posY - d1, this.posZ - d2); + } + + /** + * the movespeed used for the new AI system + */ + public float getAIMoveSpeed() + { + return (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + } + + /** + * Adds a value to a movement statistic field - like run, walk, swin or climb. + */ + public void addMovementStat(double p_71000_1_, double p_71000_3_, double p_71000_5_) + { + if (this.ridingEntity == null) + { + int i; + + if (this.isInsideOfMaterial(Material.water)) + { + i = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_3_ * p_71000_3_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (i > 0) + { + this.addStat(StatList.distanceDoveStat, i); + this.addExhaustion(0.015F * (float)i * 0.01F); + } + } + else if (this.isInWater()) + { + i = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (i > 0) + { + this.addStat(StatList.distanceSwumStat, i); + this.addExhaustion(0.015F * (float)i * 0.01F); + } + } + else if (this.isOnLadder()) + { + if (p_71000_3_ > 0.0D) + { + this.addStat(StatList.distanceClimbedStat, (int)Math.round(p_71000_3_ * 100.0D)); + } + } + else if (this.onGround) + { + i = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (i > 0) + { + this.addStat(StatList.distanceWalkedStat, i); + + if (this.isSprinting()) + { + this.addExhaustion(0.099999994F * (float)i * 0.01F); + } + else + { + this.addExhaustion(0.01F * (float)i * 0.01F); + } + } + } + else + { + i = Math.round(MathHelper.sqrt_double(p_71000_1_ * p_71000_1_ + p_71000_5_ * p_71000_5_) * 100.0F); + + if (i > 25) + { + this.addStat(StatList.distanceFlownStat, i); + } + } + } + } + + /** + * Adds a value to a mounted movement statistic field - by minecart, boat, or pig. + */ + private void addMountedMovementStat(double p_71015_1_, double p_71015_3_, double p_71015_5_) + { + if (this.ridingEntity != null) + { + int i = Math.round(MathHelper.sqrt_double(p_71015_1_ * p_71015_1_ + p_71015_3_ * p_71015_3_ + p_71015_5_ * p_71015_5_) * 100.0F); + + if (i > 0) + { + if (this.ridingEntity instanceof EntityMinecart) + { + this.addStat(StatList.distanceByMinecartStat, i); + + if (this.startMinecartRidingCoordinate == null) + { + this.startMinecartRidingCoordinate = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + } + else if ((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) + { + this.addStat(AchievementList.onARail, 1); + } + } + else if (this.ridingEntity instanceof EntityBoat) + { + this.addStat(StatList.distanceByBoatStat, i); + } + else if (this.ridingEntity instanceof EntityPig) + { + this.addStat(StatList.distanceByPigStat, i); + } + else if (this.ridingEntity instanceof EntityHorse) + { + this.addStat(StatList.field_151185_q, i); + } + } + } + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float distance) + { + if (!this.capabilities.allowFlying) + { + if (distance >= 2.0F) + { + this.addStat(StatList.distanceFallenStat, (int)Math.round((double)distance * 100.0D)); + } + + super.fall(distance); + } + else + { + MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, distance)); + } + } + + protected String func_146067_o(int p_146067_1_) + { + return p_146067_1_ > 4 ? "game.player.hurt.fall.big" : "game.player.hurt.fall.small"; + } + + /** + * This method gets called when the entity kills another one. + */ + public void onKillEntity(EntityLivingBase entityLivingIn) + { + if (entityLivingIn instanceof IMob) + { + this.triggerAchievement(AchievementList.killEnemy); + } + + int i = EntityList.getEntityID(entityLivingIn); + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(i)); + + if (entityegginfo != null) + { + this.addStat(entityegginfo.field_151512_d, 1); + } + } + + /** + * Sets the Entity inside a web block. + */ + public void setInWeb() + { + if (!this.capabilities.isFlying) + { + super.setInWeb(); + } + } + + /** + * Gets the Icon Index of the item currently held + */ + @SideOnly(Side.CLIENT) + public IIcon getItemIcon(ItemStack itemStackIn, int p_70620_2_) + { + IIcon iicon = super.getItemIcon(itemStackIn, p_70620_2_); + + if (itemStackIn.getItem() == Items.fishing_rod && this.fishEntity != null) + { + iicon = Items.fishing_rod.func_94597_g(); + } + else + { + if (this.itemInUse != null && itemStackIn.getItem() == Items.bow) + { + int j = itemStackIn.getMaxItemUseDuration() - this.itemInUseCount; + + if (j >= 18) + { + return Items.bow.getItemIconForUseDuration(2); + } + + if (j > 13) + { + return Items.bow.getItemIconForUseDuration(1); + } + + if (j > 0) + { + return Items.bow.getItemIconForUseDuration(0); + } + } + iicon = itemStackIn.getItem().getIcon(itemStackIn, p_70620_2_, this, itemInUse, itemInUseCount); + } + + return iicon; + } + + public ItemStack getCurrentArmor(int p_82169_1_) + { + return this.inventory.armorItemInSlot(p_82169_1_); + } + + /** + * Add experience points to player. + */ + public void addExperience(int p_71023_1_) + { + this.addScore(p_71023_1_); + int j = Integer.MAX_VALUE - this.experienceTotal; + + if (p_71023_1_ > j) + { + p_71023_1_ = j; + } + + this.experience += (float)p_71023_1_ / (float)this.xpBarCap(); + + for (this.experienceTotal += p_71023_1_; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) + { + this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); + this.addExperienceLevel(1); + } + } + + /** + * Add experience levels to this player. + */ + public void addExperienceLevel(int p_82242_1_) + { + this.experienceLevel += p_82242_1_; + + if (this.experienceLevel < 0) + { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + + if (p_82242_1_ > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) + { + float f = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; + this.worldObj.playSoundAtEntity(this, "random.levelup", f * 0.75F, 1.0F); + this.field_82249_h = this.ticksExisted; + } + } + + /** + * This method returns the cap amount of experience that the experience bar can hold. With each level, the + * experience cap on the player's experience bar is raised by 10. + */ + public int xpBarCap() + { + return this.experienceLevel >= 30 ? 62 + (this.experienceLevel - 30) * 7 : (this.experienceLevel >= 15 ? 17 + (this.experienceLevel - 15) * 3 : 17); + } + + /** + * increases exhaustion level by supplied amount + */ + public void addExhaustion(float p_71020_1_) + { + if (!this.capabilities.disableDamage) + { + if (!this.worldObj.isRemote) + { + this.foodStats.addExhaustion(p_71020_1_); + } + } + } + + /** + * Returns the player's FoodStats object. + */ + public FoodStats getFoodStats() + { + return this.foodStats; + } + + public boolean canEat(boolean p_71043_1_) + { + return (p_71043_1_ || this.foodStats.needFood()) && !this.capabilities.disableDamage; + } + + /** + * Checks if the player's health is not full and not zero. + */ + public boolean shouldHeal() + { + return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack p_71008_1_, int p_71008_2_) + { + if (p_71008_1_ != this.itemInUse) + { + p_71008_2_ = ForgeEventFactory.onItemUseStart(this, p_71008_1_, p_71008_2_); + if (p_71008_2_ <= 0) return; + this.itemInUse = p_71008_1_; + this.itemInUseCount = p_71008_2_; + + if (!this.worldObj.isRemote) + { + this.setEating(true); + } + } + } + + /** + * Returns true if the given block can be mined with the current tool in adventure mode. + */ + public boolean isCurrentToolAdventureModeExempt(int p_82246_1_, int p_82246_2_, int p_82246_3_) + { + if (this.capabilities.allowEdit) + { + return true; + } + else + { + Block block = this.worldObj.getBlock(p_82246_1_, p_82246_2_, p_82246_3_); + + if (block.getMaterial() != Material.air) + { + if (block.getMaterial().isAdventureModeExempt()) + { + return true; + } + + if (this.getCurrentEquippedItem() != null) + { + ItemStack itemstack = this.getCurrentEquippedItem(); + + if (itemstack.func_150998_b(block) || itemstack.func_150997_a(block) > 1.0F) + { + return true; + } + } + } + + return false; + } + } + + public boolean canPlayerEdit(int p_82247_1_, int p_82247_2_, int p_82247_3_, int p_82247_4_, ItemStack p_82247_5_) + { + return this.capabilities.allowEdit ? true : (p_82247_5_ != null ? p_82247_5_.canEditBlocks() : false); + } + + /** + * Get the experience points the entity currently has. + */ + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + { + return 0; + } + else + { + int i = this.experienceLevel * 7; + return i > 100 ? 100 : i; + } + } + + /** + * Only use is to identify if class is an instance of player for experience dropping + */ + protected boolean isPlayer() + { + return true; + } + + @SideOnly(Side.CLIENT) + public boolean getAlwaysRenderNameTagForRender() + { + return true; + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest + * Inventory. + */ + public void clonePlayer(EntityPlayer p_71049_1_, boolean p_71049_2_) + { + if (p_71049_2_) + { + this.inventory.copyInventory(p_71049_1_.inventory); + this.setHealth(p_71049_1_.getHealth()); + this.foodStats = p_71049_1_.foodStats; + this.experienceLevel = p_71049_1_.experienceLevel; + this.experienceTotal = p_71049_1_.experienceTotal; + this.experience = p_71049_1_.experience; + this.setScore(p_71049_1_.getScore()); + this.teleportDirection = p_71049_1_.teleportDirection; + //Copy and re-init ExtendedProperties when switching dimensions. + this.extendedProperties = p_71049_1_.extendedProperties; + for (net.minecraftforge.common.IExtendedEntityProperties p : this.extendedProperties.values()) + p.init(this, this.worldObj); + } + else if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + { + this.inventory.copyInventory(p_71049_1_.inventory); + this.experienceLevel = p_71049_1_.experienceLevel; + this.experienceTotal = p_71049_1_.experienceTotal; + this.experience = p_71049_1_.experience; + this.setScore(p_71049_1_.getScore()); + } + + this.theInventoryEnderChest = p_71049_1_.theInventoryEnderChest; + + this.spawnChunkMap = p_71049_1_.spawnChunkMap; + this.spawnForcedMap = p_71049_1_.spawnForcedMap; + + //Copy over a section of the Entity Data from the old player. + //Allows mods to specify data that persists after players respawn. + NBTTagCompound old = p_71049_1_.getEntityData(); + if (old.hasKey(PERSISTED_NBT_TAG)) + { + getEntityData().setTag(PERSISTED_NBT_TAG, old.getCompoundTag(PERSISTED_NBT_TAG)); + } + MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerEvent.Clone(this, p_71049_1_, !p_71049_2_)); + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return !this.capabilities.isFlying; + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() {} + + /** + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType gameType) {} + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return this.field_146106_i.getName(); + } + + public World getEntityWorld() + { + return this.worldObj; + } + + /** + * Returns the InventoryEnderChest of this player. + */ + public InventoryEnderChest getInventoryEnderChest() + { + return this.theInventoryEnderChest; + } + + /** + * 0: Tool in Hand; 1-4: Armor + */ + public ItemStack getEquipmentInSlot(int p_71124_1_) + { + return p_71124_1_ == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[p_71124_1_ - 1]; + } + + /** + * Returns the item that this EntityLiving is holding, if any. + */ + public ItemStack getHeldItem() + { + return this.inventory.getCurrentItem(); + } + + /** + * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot + */ + public void setCurrentItemOrArmor(int slotIn, ItemStack itemStackIn) + { + if (slotIn == 0) + { + this.inventory.mainInventory[this.inventory.currentItem] = itemStackIn; + } + else + { + this.inventory.armorInventory[slotIn - 1] = itemStackIn; + } + } + + /** + * Only used by renderer in EntityLivingBase subclasses. + * Determines if an entity is visible or not to a specfic player, if the entity is normally invisible. + * For EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent. + */ + @SideOnly(Side.CLIENT) + public boolean isInvisibleToPlayer(EntityPlayer player) + { + if (!this.isInvisible()) + { + return false; + } + else + { + Team team = this.getTeam(); + return team == null || player == null || player.getTeam() != team || !team.func_98297_h(); + } + } + + public ItemStack[] getLastActiveItems() + { + return this.inventory.armorInventory; + } + + @SideOnly(Side.CLIENT) + public boolean getHideCape() + { + return this.getHideCape(1); + } + + public boolean isPushedByWater() + { + return !this.capabilities.isFlying; + } + + public Scoreboard getWorldScoreboard() + { + return this.worldObj.getScoreboard(); + } + + public Team getTeam() + { + return this.getWorldScoreboard().getPlayersTeam(this.getCommandSenderName()); + } + + public IChatComponent func_145748_c_() + { + ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.formatPlayerName(this.getTeam(), this.getDisplayName())); + chatcomponenttext.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " ")); + return chatcomponenttext; + } + + public void setAbsorptionAmount(float p_110149_1_) + { + if (p_110149_1_ < 0.0F) + { + p_110149_1_ = 0.0F; + } + + this.getDataWatcher().updateObject(17, Float.valueOf(p_110149_1_)); + } + + public float getAbsorptionAmount() + { + return this.getDataWatcher().getWatchableObjectFloat(17); + } + + public static UUID func_146094_a(GameProfile p_146094_0_) + { + UUID uuid = p_146094_0_.getId(); + + if (uuid == null) + { + uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + p_146094_0_.getName()).getBytes(Charsets.UTF_8)); + } + + return uuid; + } + + public static enum EnumChatVisibility + { + FULL(0, "options.chat.visibility.full"), + SYSTEM(1, "options.chat.visibility.system"), + HIDDEN(2, "options.chat.visibility.hidden"); + private static final EntityPlayer.EnumChatVisibility[] field_151432_d = new EntityPlayer.EnumChatVisibility[values().length]; + private final int chatVisibility; + private final String resourceKey; + + private static final String __OBFID = "CL_00001714"; + + private EnumChatVisibility(int p_i45323_3_, String p_i45323_4_) + { + this.chatVisibility = p_i45323_3_; + this.resourceKey = p_i45323_4_; + } + + public int getChatVisibility() + { + return this.chatVisibility; + } + + public static EntityPlayer.EnumChatVisibility getEnumChatVisibility(int p_151426_0_) + { + return field_151432_d[p_151426_0_ % field_151432_d.length]; + } + + @SideOnly(Side.CLIENT) + public String getResourceKey() + { + return this.resourceKey; + } + + static + { + EntityPlayer.EnumChatVisibility[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + EntityPlayer.EnumChatVisibility var3 = var0[var2]; + field_151432_d[var3.chatVisibility] = var3; + } + } + } + + public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) + { + FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); + } + + /* ======================================== FORGE START =====================================*/ + /** + * interpolated position vector + */ + @SideOnly(Side.CLIENT) + @Override + public Vec3 getPosition(float par1) + { + if (par1 == 1.0F) + { + return Vec3.createVectorHelper(this.posX, this.posY + (this.getEyeHeight() - this.getDefaultEyeHeight()), this.posZ); + } + else + { + double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1; + double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1 + (this.getEyeHeight() - this.getDefaultEyeHeight()); + double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1; + return Vec3.createVectorHelper(d0, d1, d2); + } + } + + /** + * A dimension aware version of getBedLocation. + * @param dimension The dimension to get the bed spawn for + * @return The player specific spawn location for the dimension. May be null. + */ + public ChunkCoordinates getBedLocation(int dimension) + { + return dimension == 0 ? spawnChunk : spawnChunkMap.get(dimension); + } + + /** + * 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 + * @return The player specific spawn location for the dimension. May be null. + */ + public boolean isSpawnForced(int dimension) + { + if (dimension == 0) return this.spawnForced; + Boolean forced = this.spawnForcedMap.get(dimension); + return forced == null ? false : forced; + } + + /** + * A dimension aware version of setSpawnChunk. + * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension. + * @param chunkCoordinates 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 + */ + public void setSpawnChunk(ChunkCoordinates chunkCoordinates, boolean forced, int dimension) + { + if (dimension == 0) + { + if (chunkCoordinates != null) + { + spawnChunk = new ChunkCoordinates(chunkCoordinates); + spawnForced = forced; + } + else + { + spawnChunk = null; + spawnForced = false; + } + return; + } + + if (chunkCoordinates != null) + { + spawnChunkMap.put(dimension, new ChunkCoordinates(chunkCoordinates)); + spawnForcedMap.put(dimension, forced); + } + else + { + spawnChunkMap.remove(dimension); + spawnForcedMap.remove(dimension); + } + } + + public float eyeHeight; + private String displayname; + + /** + * Returns the default eye height of the player + * @return player default eye height + */ + public float getDefaultEyeHeight() + { + return 0.12F; + } + + /** + * Get the currently computed display name, cached for efficiency. + * @return the current display name + */ + public String getDisplayName() + { + if(this.displayname == null) + { + this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.getCommandSenderName()); + } + return this.displayname; + } + + /** + * Force the displayed name to refresh + */ + public void refreshDisplayName() + { + this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.getCommandSenderName()); + } + /* ======================================== FORGE END =====================================*/ + + public static enum EnumStatus + { + OK, + NOT_POSSIBLE_HERE, + NOT_POSSIBLE_NOW, + TOO_FAR_AWAY, + OTHER_PROBLEM, + NOT_SAFE; + + private static final String __OBFID = "CL_00001712"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayerMP.java b/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayerMP.java new file mode 100644 index 0000000..bf347f9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -0,0 +1,1192 @@ +package net.minecraft.entity.player; + +import com.google.common.collect.Sets; +import com.mojang.authlib.GameProfile; +import io.netty.buffer.Unpooled; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.item.EntityMinecartHopper; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerBrewingStand; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.ContainerDispenser; +import net.minecraft.inventory.ContainerEnchantment; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.inventory.ContainerHopper; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryMerchant; +import net.minecraft.inventory.SlotCrafting; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemMapBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.server.management.UserListOpsEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.tileentity.TileEntityDropper; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.tileentity.TileEntityHopper; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonSerializableSet; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.village.MerchantRecipeList; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import org.apache.commons.io.Charsets; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraft.entity.item.EntityItem; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import net.minecraftforge.event.world.ChunkWatchEvent; + +public class EntityPlayerMP extends EntityPlayer implements ICrafting +{ + private static final Logger logger = LogManager.getLogger(); + private String translator = "en_US"; + /** The NetServerHandler assigned to this player by the ServerConfigurationManager. */ + public NetHandlerPlayServer playerNetServerHandler; + /** Reference to the MinecraftServer object. */ + public final MinecraftServer mcServer; + /** The ItemInWorldManager belonging to this player */ + public final ItemInWorldManager theItemInWorldManager; + /** player X position as seen by PlayerManager */ + public double managedPosX; + /** player Z position as seen by PlayerManager */ + public double managedPosZ; + /** LinkedList that holds the loaded chunks. */ + public final List loadedChunks = new LinkedList(); + /** entities added to this list will be packet29'd to the player */ + private final List destroyedItemsNetCache = new LinkedList(); + private final StatisticsFile field_147103_bO; + private float field_130068_bO = Float.MIN_VALUE; + /** amount of health the client was last set to */ + private float lastHealth = -1.0E8F; + /** set to foodStats.GetFoodLevel */ + private int lastFoodLevel = -99999999; + /** set to foodStats.getSaturationLevel() == 0.0F each tick */ + private boolean wasHungry = true; + /** Amount of experience the client was last set to */ + private int lastExperience = -99999999; + private int field_147101_bU = 60; + private EntityPlayer.EnumChatVisibility chatVisibility; + private boolean chatColours = true; + private long field_143005_bX = System.currentTimeMillis(); + /** The currently in use window ID. Incremented every time a window is opened. */ + public int currentWindowId; + /** + * set to true when player is moving quantity of items from one inventory to another(crafting) but item in either + * slot is not changed + */ + public boolean isChangingQuantityOnly; + public int ping; + /** + * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory + * and XP + */ + public boolean playerConqueredTheEnd; + private static final String __OBFID = "CL_00001440"; + + public EntityPlayerMP(MinecraftServer p_i45285_1_, WorldServer p_i45285_2_, GameProfile p_i45285_3_, ItemInWorldManager p_i45285_4_) + { + super(p_i45285_2_, p_i45285_3_); + p_i45285_4_.thisPlayerMP = this; + this.theItemInWorldManager = p_i45285_4_; + ChunkCoordinates chunkcoordinates = p_i45285_2_.provider.getRandomizedSpawnPoint(); + int i = chunkcoordinates.posX; + int j = chunkcoordinates.posZ; + int k = chunkcoordinates.posY; + + this.mcServer = p_i45285_1_; + this.field_147103_bO = p_i45285_1_.getConfigurationManager().func_152602_a(this); + this.stepHeight = 0.0F; + this.yOffset = 0.0F; + this.setLocationAndAngles((double)i + 0.5D, (double)k, (double)j + 0.5D, 0.0F, 0.0F); + + while (!p_i45285_2_.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) + { + this.setPosition(this.posX, this.posY + 1.0D, this.posZ); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("playerGameType", 99)) + { + if (MinecraftServer.getServer().getForceGamemode()) + { + this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); + } + else + { + this.theItemInWorldManager.setGameType(WorldSettings.GameType.getByID(tagCompund.getInteger("playerGameType"))); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); + } + + /** + * Add experience levels to this player. + */ + public void addExperienceLevel(int p_82242_1_) + { + super.addExperienceLevel(p_82242_1_); + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() + { + this.openContainer.addCraftingToCrafters(this); + } + + /** + * sets the players height back to normal after doing things like sleeping and dieing + */ + protected void resetHeight() + { + this.yOffset = 0.0F; + } + + public float getEyeHeight() + { + return super.getEyeHeight(); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.theItemInWorldManager.updateBlockRemoving(); + --this.field_147101_bU; + + if (this.hurtResistantTime > 0) + { + --this.hurtResistantTime; + } + + this.openContainer.detectAndSendChanges(); + + if (!this.worldObj.isRemote && !ForgeHooks.canInteractWith(this, this.openContainer)) + { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + + while (!this.destroyedItemsNetCache.isEmpty()) + { + int i = Math.min(this.destroyedItemsNetCache.size(), 127); + int[] aint = new int[i]; + Iterator iterator = this.destroyedItemsNetCache.iterator(); + int j = 0; + + while (iterator.hasNext() && j < i) + { + aint[j++] = ((Integer)iterator.next()).intValue(); + iterator.remove(); + } + + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(aint)); + } + + if (!this.loadedChunks.isEmpty()) + { + ArrayList arraylist = new ArrayList(); + Iterator iterator1 = this.loadedChunks.iterator(); + ArrayList arraylist1 = new ArrayList(); + Chunk chunk; + + while (iterator1.hasNext() && arraylist.size() < S26PacketMapChunkBulk.func_149258_c()) + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator1.next(); + + if (chunkcoordintpair != null) + { + if (this.worldObj.blockExists(chunkcoordintpair.chunkXPos << 4, 0, chunkcoordintpair.chunkZPos << 4)) + { + chunk = this.worldObj.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + + if (chunk.func_150802_k()) + { + arraylist.add(chunk); + arraylist1.addAll(((WorldServer)this.worldObj).func_147486_a(chunkcoordintpair.chunkXPos * 16, 0, chunkcoordintpair.chunkZPos * 16, chunkcoordintpair.chunkXPos * 16 + 15, 256, chunkcoordintpair.chunkZPos * 16 + 15)); + //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it. + iterator1.remove(); + } + } + } + else + { + iterator1.remove(); + } + } + + if (!arraylist.isEmpty()) + { + this.playerNetServerHandler.sendPacket(new S26PacketMapChunkBulk(arraylist)); + Iterator iterator2 = arraylist1.iterator(); + + while (iterator2.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator2.next(); + this.func_147097_b(tileentity); + } + + iterator2 = arraylist.iterator(); + + while (iterator2.hasNext()) + { + chunk = (Chunk)iterator2.next(); + this.getServerForPlayer().getEntityTracker().func_85172_a(this, chunk); + MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.getChunkCoordIntPair(), this)); + } + } + } + } + + public void onUpdateEntity() + { + try + { + super.onUpdate(); + + for (int i = 0; i < this.inventory.getSizeInventory(); ++i) + { + ItemStack itemstack = this.inventory.getStackInSlot(i); + + if (itemstack != null && itemstack.getItem().isMap()) + { + Packet packet = ((ItemMapBase)itemstack.getItem()).func_150911_c(itemstack, this.worldObj, this); + + if (packet != null) + { + this.playerNetServerHandler.sendPacket(packet); + } + } + } + + if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) + { + this.playerNetServerHandler.sendPacket(new S06PacketUpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + + if (this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) + { + this.field_130068_bO = this.getHealth() + this.getAbsorptionAmount(); + Collection collection = this.getWorldScoreboard().func_96520_a(IScoreObjectiveCriteria.health); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), scoreobjective).func_96651_a(Arrays.asList(new EntityPlayer[] {this})); + } + } + + if (this.experienceTotal != this.lastExperience) + { + this.lastExperience = this.experienceTotal; + this.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(this.experience, this.experienceTotal, this.experienceLevel)); + } + + if (this.ticksExisted % 20 * 5 == 0 && !this.func_147099_x().hasAchievementUnlocked(AchievementList.field_150961_L)) + { + this.func_147098_j(); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked"); + this.addEntityCrashInfo(crashreportcategory); + throw new ReportedException(crashreport); + } + } + + protected void func_147098_j() + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + + if (biomegenbase != null) + { + String s = biomegenbase.biomeName; + JsonSerializableSet jsonserializableset = (JsonSerializableSet)this.func_147099_x().func_150870_b(AchievementList.field_150961_L); + + if (jsonserializableset == null) + { + jsonserializableset = (JsonSerializableSet)this.func_147099_x().func_150872_a(AchievementList.field_150961_L, new JsonSerializableSet()); + } + + jsonserializableset.add(s); + + if (this.func_147099_x().canUnlockAchievement(AchievementList.field_150961_L) && jsonserializableset.size() == BiomeGenBase.explorationBiomesList.size()) + { + HashSet hashset = Sets.newHashSet(BiomeGenBase.explorationBiomesList); + Iterator iterator = jsonserializableset.iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + Iterator iterator1 = hashset.iterator(); + + while (iterator1.hasNext()) + { + BiomeGenBase biomegenbase1 = (BiomeGenBase)iterator1.next(); + + if (biomegenbase1.biomeName.equals(s1)) + { + iterator1.remove(); + } + } + + if (hashset.isEmpty()) + { + break; + } + } + + if (hashset.isEmpty()) + { + this.triggerAchievement(AchievementList.field_150961_L); + } + } + } + } + + /** + * Called when the mob's health reaches 0. + */ + public void onDeath(DamageSource p_70645_1_) + { + if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_151521_b()); + + if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) + { + captureDrops = true; + capturedDrops.clear(); + + this.inventory.dropAllItems(); + + captureDrops = false; + PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, recentlyHit > 0); + if (!MinecraftForge.EVENT_BUS.post(event)) + { + for (EntityItem item : capturedDrops) + { + joinEntityItemWithWorld(item); + } + } + } + + Collection collection = this.worldObj.getScoreboard().func_96520_a(IScoreObjectiveCriteria.deathCount); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + Score score = this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), scoreobjective); + score.func_96648_a(); + } + + EntityLivingBase entitylivingbase = this.func_94060_bK(); + + if (entitylivingbase != null) + { + int i = EntityList.getEntityID(entitylivingbase); + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(i)); + + if (entityegginfo != null) + { + this.addStat(entityegginfo.field_151513_e, 1); + } + + entitylivingbase.addToPlayerScore(this, this.scoreValue); + } + + this.addStat(StatList.deathsStat, 1); + this.func_110142_aN().func_94549_h(); + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + boolean flag = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(source.damageType); + + if (!flag && this.field_147101_bU > 0 && source != DamageSource.outOfWorld) + { + return false; + } + else + { + if (source instanceof EntityDamageSource) + { + Entity entity = source.getEntity(); + + if (entity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)entity)) + { + return false; + } + + if (entity instanceof EntityArrow) + { + EntityArrow entityarrow = (EntityArrow)entity; + + if (entityarrow.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)entityarrow.shootingEntity)) + { + return false; + } + } + } + + return super.attackEntityFrom(source, amount); + } + } + } + + public boolean canAttackPlayer(EntityPlayer p_96122_1_) + { + return !this.mcServer.isPVPEnabled() ? false : super.canAttackPlayer(p_96122_1_); + } + + /** + * Teleports the entity to another dimension. Params: Dimension number to teleport to + */ + public void travelToDimension(int dimensionId) + { + if (this.dimension == 1 && dimensionId == 1) + { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(4, 0.0F)); + } + else + { + if (this.dimension == 0 && dimensionId == 1) + { + this.triggerAchievement(AchievementList.theEnd); + ChunkCoordinates chunkcoordinates = this.mcServer.worldServerForDimension(dimensionId).getEntrancePortalLocation(); + + if (chunkcoordinates != null) + { + this.playerNetServerHandler.setPlayerLocation((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, 0.0F, 0.0F); + } + + dimensionId = 1; + } + else + { + this.triggerAchievement(AchievementList.portal); + } + + this.mcServer.getConfigurationManager().transferPlayerToDimension(this, dimensionId); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + } + } + + private void func_147097_b(TileEntity p_147097_1_) + { + if (p_147097_1_ != null) + { + Packet packet = p_147097_1_.getDescriptionPacket(); + + if (packet != null) + { + this.playerNetServerHandler.sendPacket(packet); + } + } + } + + /** + * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize + */ + public void onItemPickup(Entity p_71001_1_, int p_71001_2_) + { + super.onItemPickup(p_71001_1_, p_71001_2_); + this.openContainer.detectAndSendChanges(); + } + + /** + * puts player to sleep on specified bed if possible + */ + public EntityPlayer.EnumStatus sleepInBedAt(int x, int y, int z) + { + EntityPlayer.EnumStatus enumstatus = super.sleepInBedAt(x, y, z); + + if (enumstatus == EntityPlayer.EnumStatus.OK) + { + S0APacketUseBed s0apacketusebed = new S0APacketUseBed(this, x, y, z); + this.getServerForPlayer().getEntityTracker().func_151247_a(this, s0apacketusebed); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.playerNetServerHandler.sendPacket(s0apacketusebed); + } + + return enumstatus; + } + + /** + * Wake up the player if they're sleeping. + */ + public void wakeUpPlayer(boolean p_70999_1_, boolean updateWorldFlag, boolean setSpawn) + { + if (this.isPlayerSleeping()) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 2)); + } + + super.wakeUpPlayer(p_70999_1_, updateWorldFlag, setSpawn); + + if (this.playerNetServerHandler != null) + { + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + } + + /** + * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. + */ + public void mountEntity(Entity entityIn) + { + super.mountEntity(entityIn); + this.playerNetServerHandler.sendPacket(new S1BPacketEntityAttach(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double distanceFallenThisTick, boolean isOnGround) {} + + /** + * process player falling based on movement packet + */ + public void handleFalling(double p_71122_1_, boolean p_71122_3_) + { + super.updateFallState(p_71122_1_, p_71122_3_); + } + + public void func_146100_a(TileEntity p_146100_1_) + { + if (p_146100_1_ instanceof TileEntitySign) + { + ((TileEntitySign)p_146100_1_).func_145912_a(this); + this.playerNetServerHandler.sendPacket(new S36PacketSignEditorOpen(p_146100_1_.xCoord, p_146100_1_.yCoord, p_146100_1_.zCoord)); + } + } + + /** + * get the next window id to use + */ + public void getNextWindowId() + { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + + /** + * Displays the crafting GUI for a workbench. + */ + public void displayGUIWorkbench(int p_71058_1_, int p_71058_2_, int p_71058_3_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); + this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, p_71058_1_, p_71058_2_, p_71058_3_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIEnchantment(int p_71002_1_, int p_71002_2_, int p_71002_3_, String p_71002_4_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 4, p_71002_4_ == null ? "" : p_71002_4_, 9, p_71002_4_ != null)); + this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, p_71002_1_, p_71002_2_, p_71002_3_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with an anvil. + */ + public void displayGUIAnvil(int p_82244_1_, int p_82244_2_, int p_82244_3_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); + this.openContainer = new ContainerRepair(this.inventory, this.worldObj, p_82244_1_, p_82244_2_, p_82244_3_, this); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Displays the GUI for interacting with a chest inventory. Args: chestInventory + */ + public void displayGUIChest(IInventory p_71007_1_) + { + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 0, p_71007_1_.getInventoryName(), p_71007_1_.getSizeInventory(), p_71007_1_.hasCustomInventoryName())); + this.openContainer = new ContainerChest(this.inventory, p_71007_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146093_a(TileEntityHopper p_146093_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_146093_1_.getInventoryName(), p_146093_1_.getSizeInventory(), p_146093_1_.hasCustomInventoryName())); + this.openContainer = new ContainerHopper(this.inventory, p_146093_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIHopperMinecart(EntityMinecartHopper p_96125_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 9, p_96125_1_.getInventoryName(), p_96125_1_.getSizeInventory(), p_96125_1_.hasCustomInventoryName())); + this.openContainer = new ContainerHopper(this.inventory, p_96125_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146101_a(TileEntityFurnace p_146101_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 2, p_146101_1_.getInventoryName(), p_146101_1_.getSizeInventory(), p_146101_1_.hasCustomInventoryName())); + this.openContainer = new ContainerFurnace(this.inventory, p_146101_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146102_a(TileEntityDispenser p_146102_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, p_146102_1_ instanceof TileEntityDropper ? 10 : 3, p_146102_1_.getInventoryName(), p_146102_1_.getSizeInventory(), p_146102_1_.hasCustomInventoryName())); + this.openContainer = new ContainerDispenser(this.inventory, p_146102_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146098_a(TileEntityBrewingStand p_146098_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 5, p_146098_1_.getInventoryName(), p_146098_1_.getSizeInventory(), p_146098_1_.hasCustomInventoryName())); + this.openContainer = new ContainerBrewingStand(this.inventory, p_146098_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void func_146104_a(TileEntityBeacon p_146104_1_) + { + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 7, p_146104_1_.getInventoryName(), p_146104_1_.getSizeInventory(), p_146104_1_.hasCustomInventoryName())); + this.openContainer = new ContainerBeacon(this.inventory, p_146104_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + public void displayGUIMerchant(IMerchant p_71030_1_, String p_71030_2_) + { + this.getNextWindowId(); + this.openContainer = new ContainerMerchant(this.inventory, p_71030_1_, this.worldObj); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + InventoryMerchant inventorymerchant = ((ContainerMerchant)this.openContainer).getMerchantInventory(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 6, p_71030_2_ == null ? "" : p_71030_2_, inventorymerchant.getSizeInventory(), p_71030_2_ != null)); + MerchantRecipeList merchantrecipelist = p_71030_1_.getRecipes(this); + + if (merchantrecipelist != null) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer()); + + try + { + packetbuffer.writeInt(this.currentWindowId); + merchantrecipelist.func_151391_a(packetbuffer); + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", packetbuffer)); + } + catch (IOException ioexception) + { + logger.error("Couldn\'t send trade list", ioexception); + } + finally + { + packetbuffer.release(); + } + } + } + + public void displayGUIHorse(EntityHorse p_110298_1_, IInventory p_110298_2_) + { + if (this.openContainer != this.inventoryContainer) + { + this.closeScreen(); + } + + this.getNextWindowId(); + this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, 11, p_110298_2_.getInventoryName(), p_110298_2_.getSizeInventory(), p_110298_2_.hasCustomInventoryName(), p_110298_1_.getEntityId())); + this.openContainer = new ContainerHorseInventory(this.inventory, p_110298_2_, p_110298_1_); + this.openContainer.windowId = this.currentWindowId; + this.openContainer.addCraftingToCrafters(this); + } + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) + { + if (!(p_71111_1_.getSlot(p_71111_2_) instanceof SlotCrafting)) + { + if (!this.isChangingQuantityOnly) + { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(p_71111_1_.windowId, p_71111_2_, p_71111_3_)); + } + } + } + + public void sendContainerToPlayer(Container p_71120_1_) + { + this.sendContainerAndContentsToPlayer(p_71120_1_, p_71120_1_.getInventory()); + } + + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) + { + this.playerNetServerHandler.sendPacket(new S30PacketWindowItems(p_71110_1_.windowId, p_71110_2_)); + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) + { + this.playerNetServerHandler.sendPacket(new S31PacketWindowProperty(p_71112_1_.windowId, p_71112_2_, p_71112_3_)); + } + + /** + * sets current screen to null (used on escape buttons of GUIs); sets current crafting inventory back to the 2x2 + * square + */ + public void closeScreen() + { + this.playerNetServerHandler.sendPacket(new S2EPacketCloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + + /** + * updates item held by mouse + */ + public void updateHeldItem() + { + if (!this.isChangingQuantityOnly) + { + this.playerNetServerHandler.sendPacket(new S2FPacketSetSlot(-1, -1, this.inventory.getItemStack())); + } + } + + /** + * Closes the container the player currently has open. + */ + public void closeContainer() + { + this.openContainer.onContainerClosed(this); + this.openContainer = this.inventoryContainer; + } + + public void setEntityActionState(float p_110430_1_, float p_110430_2_, boolean p_110430_3_, boolean p_110430_4_) + { + if (this.ridingEntity != null) + { + if (p_110430_1_ >= -1.0F && p_110430_1_ <= 1.0F) + { + this.moveStrafing = p_110430_1_; + } + + if (p_110430_2_ >= -1.0F && p_110430_2_ <= 1.0F) + { + this.moveForward = p_110430_2_; + } + + this.isJumping = p_110430_3_; + this.setSneaking(p_110430_4_); + } + } + + /** + * Adds a value to a statistic field. + */ + public void addStat(StatBase p_71064_1_, int p_71064_2_) + { + if (p_71064_1_ != null) + { + if (p_71064_1_.isAchievement() && MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) p_71064_1_))) return; + this.field_147103_bO.func_150871_b(this, p_71064_1_, p_71064_2_); + Iterator iterator = this.getWorldScoreboard().func_96520_a(p_71064_1_.func_150952_k()).iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + this.getWorldScoreboard().func_96529_a(this.getCommandSenderName(), scoreobjective).func_96648_a(); + } + + if (this.field_147103_bO.func_150879_e()) + { + this.field_147103_bO.func_150876_a(this); + } + } + } + + public void mountEntityAndWakeUp() + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (this.sleeping) + { + this.wakeUpPlayer(true, false, false); + } + } + + /** + * this function is called when a players inventory is sent to him, lastHealth is updated on any dimension + * transitions, then reset. + */ + public void setPlayerHealthUpdated() + { + this.lastHealth = -1.0E8F; + } + + public void addChatComponentMessage(IChatComponent p_146105_1_) + { + this.playerNetServerHandler.sendPacket(new S02PacketChat(p_146105_1_)); + } + + /** + * Used for when item use count runs out, ie: eating completed + */ + protected void onItemUseFinish() + { + this.playerNetServerHandler.sendPacket(new S19PacketEntityStatus(this, (byte)9)); + super.onItemUseFinish(); + } + + /** + * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration + */ + public void setItemInUse(ItemStack p_71008_1_, int p_71008_2_) + { + super.setItemInUse(p_71008_1_, p_71008_2_); + + if (p_71008_1_ != null && p_71008_1_.getItem() != null && p_71008_1_.getItem().getItemUseAction(p_71008_1_) == EnumAction.eat) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(this, 3)); + } + } + + /** + * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest + * Inventory. + */ + public void clonePlayer(EntityPlayer p_71049_1_, boolean p_71049_2_) + { + super.clonePlayer(p_71049_1_, p_71049_2_); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + this.destroyedItemsNetCache.addAll(((EntityPlayerMP)p_71049_1_).destroyedItemsNetCache); + } + + protected void onNewPotionEffect(PotionEffect p_70670_1_) + { + super.onNewPotionEffect(p_70670_1_); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), p_70670_1_)); + } + + protected void onChangedPotionEffect(PotionEffect p_70695_1_, boolean p_70695_2_) + { + super.onChangedPotionEffect(p_70695_1_, p_70695_2_); + this.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(this.getEntityId(), p_70695_1_)); + } + + protected void onFinishedPotionEffect(PotionEffect p_70688_1_) + { + super.onFinishedPotionEffect(p_70688_1_); + this.playerNetServerHandler.sendPacket(new S1EPacketRemoveEntityEffect(this.getEntityId(), p_70688_1_)); + } + + /** + * Sets the position of the entity, keeps yaw/pitch, and updates the 'last' variables + */ + public void setPositionAndUpdate(double p_70634_1_, double p_70634_3_, double p_70634_5_) + { + this.playerNetServerHandler.setPlayerLocation(p_70634_1_, p_70634_3_, p_70634_5_, this.rotationYaw, this.rotationPitch); + } + + /** + * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically + */ + public void onCriticalHit(Entity p_71009_1_) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(p_71009_1_, 4)); + } + + public void onEnchantmentCritical(Entity p_71047_1_) + { + this.getServerForPlayer().getEntityTracker().func_151248_b(this, new S0BPacketAnimation(p_71047_1_, 5)); + } + + /** + * Sends the player's abilities to the server (if there is one). + */ + public void sendPlayerAbilities() + { + if (this.playerNetServerHandler != null) + { + this.playerNetServerHandler.sendPacket(new S39PacketPlayerAbilities(this.capabilities)); + } + } + + public WorldServer getServerForPlayer() + { + return (WorldServer)this.worldObj; + } + + /** + * Sets the player's game mode and sends it to them. + */ + public void setGameType(WorldSettings.GameType gameType) + { + this.theItemInWorldManager.setGameType(gameType); + this.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(3, (float)gameType.getID())); + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + this.playerNetServerHandler.sendPacket(new S02PacketChat(message)); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + if ("seed".equals(command) && !this.mcServer.isDedicatedServer()) + { + return true; + } + else if (!"tell".equals(command) && !"help".equals(command) && !"me".equals(command)) + { + if (this.mcServer.getConfigurationManager().func_152596_g(this.getGameProfile())) + { + UserListOpsEntry userlistopsentry = (UserListOpsEntry)this.mcServer.getConfigurationManager().func_152603_m().func_152683_b(this.getGameProfile()); + return userlistopsentry != null ? userlistopsentry.func_152644_a() >= permissionLevel : this.mcServer.getOpPermissionLevel() >= permissionLevel; + } + else + { + return false; + } + } + else + { + return true; + } + } + + /** + * Gets the player's IP address. Used in /banip. + */ + public String getPlayerIP() + { + String s = this.playerNetServerHandler.netManager.getSocketAddress().toString(); + s = s.substring(s.indexOf("/") + 1); + s = s.substring(0, s.indexOf(":")); + return s; + } + + public void func_147100_a(C15PacketClientSettings p_147100_1_) + { + this.translator = p_147100_1_.func_149524_c(); + int i = 256 >> p_147100_1_.func_149521_d(); + + if (i > 3 && i < 20) + { + ; + } + + this.chatVisibility = p_147100_1_.func_149523_e(); + this.chatColours = p_147100_1_.func_149520_f(); + + if (this.mcServer.isSinglePlayer() && this.mcServer.getServerOwner().equals(this.getCommandSenderName())) + { + this.mcServer.func_147139_a(p_147100_1_.func_149518_g()); + } + + this.setHideCape(1, !p_147100_1_.func_149519_h()); + } + + public EntityPlayer.EnumChatVisibility func_147096_v() + { + return this.chatVisibility; + } + + /** + * on receiving this message the client (if permission is given) will download the requested textures + */ + public void requestTexturePackLoad(String p_147095_1_) + { + this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|RPack", p_147095_1_.getBytes(Charsets.UTF_8))); + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); + } + + public void func_143004_u() + { + this.field_143005_bX = MinecraftServer.getSystemTimeMillis(); + } + + public StatisticsFile func_147099_x() + { + return this.field_147103_bO; + } + + public void func_152339_d(Entity p_152339_1_) + { + if (p_152339_1_ instanceof EntityPlayer) + { + this.playerNetServerHandler.sendPacket(new S13PacketDestroyEntities(new int[] {p_152339_1_.getEntityId()})); + } + else + { + this.destroyedItemsNetCache.add(Integer.valueOf(p_152339_1_.getEntityId())); + } + } + + public long func_154331_x() + { + return this.field_143005_bX; + } + + /* ===================================== FORGE START =====================================*/ + /** + * Returns the default eye height of the player + * @return player default eye height + */ + @Override + public float getDefaultEyeHeight() + { + return 1.62F; + } + /* ===================================== FORGE END =====================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/player/InventoryPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/entity/player/InventoryPlayer.java new file mode 100644 index 0000000..ad5b5f4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/player/InventoryPlayer.java @@ -0,0 +1,849 @@ +package net.minecraft.entity.player; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ReportedException; + +public class InventoryPlayer implements IInventory +{ + /** An array of 36 item stacks indicating the main player inventory (including the visible bar). */ + public ItemStack[] mainInventory = new ItemStack[36]; + /** An array of 4 item stacks containing the currently worn armor pieces. */ + public ItemStack[] armorInventory = new ItemStack[4]; + /** The index of the currently held item (0-8). */ + public int currentItem; + /** The current ItemStack. */ + @SideOnly(Side.CLIENT) + private ItemStack currentItemStack; + /** The player whose inventory this is. */ + public EntityPlayer player; + private ItemStack itemStack; + /** + * Set true whenever the inventory changes. Nothing sets it false so you will have to write your own code to check + * it and reset the value. + */ + public boolean inventoryChanged; + private static final String __OBFID = "CL_00001709"; + + public InventoryPlayer(EntityPlayer p_i1750_1_) + { + this.player = p_i1750_1_; + } + + /** + * Returns the item stack currently held by the player. + */ + public ItemStack getCurrentItem() + { + return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; + } + + /** + * Get the size of the player hotbar inventory + */ + public static int getHotbarSize() + { + return 9; + } + + private int func_146029_c(Item itemIn) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == itemIn) + { + return i; + } + } + + return -1; + } + + @SideOnly(Side.CLIENT) + private int func_146024_c(Item p_146024_1_, int p_146024_2_) + { + for (int j = 0; j < this.mainInventory.length; ++j) + { + if (this.mainInventory[j] != null && this.mainInventory[j].getItem() == p_146024_1_ && this.mainInventory[j].getItemDamage() == p_146024_2_) + { + return j; + } + } + + return -1; + } + + /** + * stores an itemstack in the users inventory + */ + private int storeItemStack(ItemStack p_70432_1_) + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].getItem() == p_70432_1_.getItem() && this.mainInventory[i].isStackable() && this.mainInventory[i].stackSize < this.mainInventory[i].getMaxStackSize() && this.mainInventory[i].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[i].getHasSubtypes() || this.mainInventory[i].getItemDamage() == p_70432_1_.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[i], p_70432_1_)) + { + return i; + } + } + + return -1; + } + + /** + * Returns the first item stack that is empty. + */ + public int getFirstEmptyStack() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] == null) + { + return i; + } + } + + return -1; + } + + @SideOnly(Side.CLIENT) + public void func_146030_a(Item p_146030_1_, int p_146030_2_, boolean p_146030_3_, boolean p_146030_4_) + { + boolean flag2 = true; + this.currentItemStack = this.getCurrentItem(); + int k; + + if (p_146030_3_) + { + k = this.func_146024_c(p_146030_1_, p_146030_2_); + } + else + { + k = this.func_146029_c(p_146030_1_); + } + + if (k >= 0 && k < 9) + { + this.currentItem = k; + } + else + { + if (p_146030_4_ && p_146030_1_ != null) + { + int j = this.getFirstEmptyStack(); + + if (j >= 0 && j < 9) + { + this.currentItem = j; + } + + this.func_70439_a(p_146030_1_, p_146030_2_); + } + } + } + + /** + * Clear this player's inventory (including armor), using the specified Item and metadata as filters or -1 for no + * filter. + */ + public int clearInventory(Item p_146027_1_, int p_146027_2_) + { + int j = 0; + int k; + ItemStack itemstack; + + for (k = 0; k < this.mainInventory.length; ++k) + { + itemstack = this.mainInventory[k]; + + if (itemstack != null && (p_146027_1_ == null || itemstack.getItem() == p_146027_1_) && (p_146027_2_ <= -1 || itemstack.getItemDamage() == p_146027_2_)) + { + j += itemstack.stackSize; + this.mainInventory[k] = null; + } + } + + for (k = 0; k < this.armorInventory.length; ++k) + { + itemstack = this.armorInventory[k]; + + if (itemstack != null && (p_146027_1_ == null || itemstack.getItem() == p_146027_1_) && (p_146027_2_ <= -1 || itemstack.getItemDamage() == p_146027_2_)) + { + j += itemstack.stackSize; + this.armorInventory[k] = null; + } + } + + if (this.itemStack != null) + { + if (p_146027_1_ != null && this.itemStack.getItem() != p_146027_1_) + { + return j; + } + + if (p_146027_2_ > -1 && this.itemStack.getItemDamage() != p_146027_2_) + { + return j; + } + + j += this.itemStack.stackSize; + this.setItemStack((ItemStack)null); + } + + return j; + } + + /** + * Switch the current item to the next one or the previous one + */ + @SideOnly(Side.CLIENT) + public void changeCurrentItem(int p_70453_1_) + { + if (p_70453_1_ > 0) + { + p_70453_1_ = 1; + } + + if (p_70453_1_ < 0) + { + p_70453_1_ = -1; + } + + for (this.currentItem -= p_70453_1_; this.currentItem < 0; this.currentItem += 9) + { + ; + } + + while (this.currentItem >= 9) + { + this.currentItem -= 9; + } + } + + @SideOnly(Side.CLIENT) + public void func_70439_a(Item p_70439_1_, int p_70439_2_) + { + if (p_70439_1_ != null) + { + if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.func_146024_c(this.currentItemStack.getItem(), this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) + { + return; + } + + int j = this.func_146024_c(p_70439_1_, p_70439_2_); + + if (j >= 0) + { + int k = this.mainInventory[j].stackSize; + this.mainInventory[j] = this.mainInventory[this.currentItem]; + this.mainInventory[this.currentItem] = new ItemStack(p_70439_1_, k, p_70439_2_); + } + else + { + this.mainInventory[this.currentItem] = new ItemStack(p_70439_1_, 1, p_70439_2_); + } + } + } + + /** + * This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of + * left over items. + */ + private int storePartialItemStack(ItemStack p_70452_1_) + { + Item item = p_70452_1_.getItem(); + int i = p_70452_1_.stackSize; + int j; + + if (p_70452_1_.getMaxStackSize() == 1) + { + j = this.getFirstEmptyStack(); + + if (j < 0) + { + return i; + } + else + { + if (this.mainInventory[j] == null) + { + this.mainInventory[j] = ItemStack.copyItemStack(p_70452_1_); + } + + return 0; + } + } + else + { + j = this.storeItemStack(p_70452_1_); + + if (j < 0) + { + j = this.getFirstEmptyStack(); + } + + if (j < 0) + { + return i; + } + else + { + if (this.mainInventory[j] == null) + { + this.mainInventory[j] = new ItemStack(item, 0, p_70452_1_.getItemDamage()); + + if (p_70452_1_.hasTagCompound()) + { + this.mainInventory[j].setTagCompound((NBTTagCompound)p_70452_1_.getTagCompound().copy()); + } + } + + int k = i; + + if (i > this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize) + { + k = this.mainInventory[j].getMaxStackSize() - this.mainInventory[j].stackSize; + } + + if (k > this.getInventoryStackLimit() - this.mainInventory[j].stackSize) + { + k = this.getInventoryStackLimit() - this.mainInventory[j].stackSize; + } + + if (k == 0) + { + return i; + } + else + { + i -= k; + this.mainInventory[j].stackSize += k; + this.mainInventory[j].animationsToGo = 5; + return i; + } + } + } + } + + /** + * Decrement the number of animations remaining. Only called on client side. This is used to handle the animation of + * receiving a block. + */ + public void decrementAnimations() + { + for (int i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + this.mainInventory[i].updateAnimation(this.player.worldObj, this.player, i, this.currentItem == i); + } + } + + for (int i = 0; i < armorInventory.length; i++) + { + if (armorInventory[i] != null) + { + armorInventory[i].getItem().onArmorTick(player.worldObj, player, armorInventory[i]); + } + } + } + + /** + * removed one item of specified Item from inventory (if it is in a stack, the stack size will reduce with 1) + */ + public boolean consumeInventoryItem(Item p_146026_1_) + { + int i = this.func_146029_c(p_146026_1_); + + if (i < 0) + { + return false; + } + else + { + if (--this.mainInventory[i].stackSize <= 0) + { + this.mainInventory[i] = null; + } + + return true; + } + } + + /** + * Checks if a specified Item is inside the inventory + */ + public boolean hasItem(Item p_146028_1_) + { + int i = this.func_146029_c(p_146028_1_); + return i >= 0; + } + + /** + * Adds the item stack to the inventory, returns false if it is impossible. + */ + public boolean addItemStackToInventory(final ItemStack p_70441_1_) + { + if (p_70441_1_ != null && p_70441_1_.stackSize != 0 && p_70441_1_.getItem() != null) + { + try + { + int i; + + if (p_70441_1_.isItemDamaged()) + { + i = this.getFirstEmptyStack(); + + if (i >= 0) + { + this.mainInventory[i] = ItemStack.copyItemStack(p_70441_1_); + this.mainInventory[i].animationsToGo = 5; + p_70441_1_.stackSize = 0; + return true; + } + else if (this.player.capabilities.isCreativeMode) + { + p_70441_1_.stackSize = 0; + return true; + } + else + { + return false; + } + } + else + { + do + { + i = p_70441_1_.stackSize; + p_70441_1_.stackSize = this.storePartialItemStack(p_70441_1_); + } + while (p_70441_1_.stackSize > 0 && p_70441_1_.stackSize < i); + + if (p_70441_1_.stackSize == i && this.player.capabilities.isCreativeMode) + { + p_70441_1_.stackSize = 0; + return true; + } + else + { + return p_70441_1_.stackSize < i; + } + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Adding item to inventory"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Item being added"); + crashreportcategory.addCrashSection("Item ID", Integer.valueOf(Item.getIdFromItem(p_70441_1_.getItem()))); + crashreportcategory.addCrashSection("Item data", Integer.valueOf(p_70441_1_.getItemDamage())); + crashreportcategory.addCrashSectionCallable("Item name", new Callable() + { + private static final String __OBFID = "CL_00001710"; + public String call() + { + return p_70441_1_.getDisplayName(); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return false; + } + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= this.mainInventory.length) + { + aitemstack = this.armorInventory; + index -= this.mainInventory.length; + } + + if (aitemstack[index] != null) + { + ItemStack itemstack; + + if (aitemstack[index].stackSize <= count) + { + itemstack = aitemstack[index]; + aitemstack[index] = null; + return itemstack; + } + else + { + itemstack = aitemstack[index].splitStack(count); + + if (aitemstack[index].stackSize == 0) + { + aitemstack[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= this.mainInventory.length) + { + aitemstack = this.armorInventory; + index -= this.mainInventory.length; + } + + if (aitemstack[index] != null) + { + ItemStack itemstack = aitemstack[index]; + aitemstack[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + ItemStack[] aitemstack = this.mainInventory; + + if (index >= aitemstack.length) + { + index -= aitemstack.length; + aitemstack = this.armorInventory; + } + + aitemstack[index] = stack; + } + + public float func_146023_a(Block p_146023_1_) + { + float f = 1.0F; + + if (this.mainInventory[this.currentItem] != null) + { + f *= this.mainInventory[this.currentItem].func_150997_a(p_146023_1_); + } + + return f; + } + + /** + * Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 + * for crafting). + */ + public NBTTagList writeToNBT(NBTTagList p_70442_1_) + { + int i; + NBTTagCompound nbttagcompound; + + for (i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + this.mainInventory[i].writeToNBT(nbttagcompound); + p_70442_1_.appendTag(nbttagcompound); + } + } + + for (i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null) + { + nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)(i + 100)); + this.armorInventory[i].writeToNBT(nbttagcompound); + p_70442_1_.appendTag(nbttagcompound); + } + } + + return p_70442_1_; + } + + /** + * Reads from the given tag list and fills the slots in the inventory with the correct items. + */ + public void readFromNBT(NBTTagList p_70443_1_) + { + this.mainInventory = new ItemStack[36]; + this.armorInventory = new ItemStack[4]; + + for (int i = 0; i < p_70443_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_70443_1_.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound); + + if (itemstack != null) + { + if (j >= 0 && j < this.mainInventory.length) + { + this.mainInventory[j] = itemstack; + } + + if (j >= 100 && j < this.armorInventory.length + 100) + { + this.armorInventory[j - 100] = itemstack; + } + } + } + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.mainInventory.length + 4; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + ItemStack[] aitemstack = this.mainInventory; + + if (slotIn >= aitemstack.length) + { + slotIn -= aitemstack.length; + aitemstack = this.armorInventory; + } + + return aitemstack[slotIn]; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return "container.inventory"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return false; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + public boolean func_146025_b(Block p_146025_1_) + { + if (p_146025_1_.getMaterial().isToolNotRequired()) + { + return true; + } + else + { + ItemStack itemstack = this.getStackInSlot(this.currentItem); + return itemstack != null ? itemstack.func_150998_b(p_146025_1_) : false; + } + } + + /** + * returns a player armor item (as itemstack) contained in specified armor slot. + */ + public ItemStack armorItemInSlot(int p_70440_1_) + { + return this.armorInventory[p_70440_1_]; + } + + /** + * Based on the damage values and maximum damage values of each armor item, returns the current armor value. + */ + public int getTotalArmorValue() + { + int i = 0; + + for (int j = 0; j < this.armorInventory.length; ++j) + { + if (this.armorInventory[j] != null && this.armorInventory[j].getItem() instanceof ItemArmor) + { + int k = ((ItemArmor)this.armorInventory[j].getItem()).damageReduceAmount; + i += k; + } + } + + return i; + } + + /** + * Damages armor in each slot by the specified amount. + */ + public void damageArmor(float p_70449_1_) + { + p_70449_1_ /= 4.0F; + + if (p_70449_1_ < 1.0F) + { + p_70449_1_ = 1.0F; + } + + for (int i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null && this.armorInventory[i].getItem() instanceof ItemArmor) + { + this.armorInventory[i].damageItem((int)p_70449_1_, this.player); + + if (this.armorInventory[i].stackSize == 0) + { + this.armorInventory[i] = null; + } + } + } + } + + /** + * Drop all armor and main inventory items. + */ + public void dropAllItems() + { + int i; + + for (i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null) + { + this.player.func_146097_a(this.mainInventory[i], true, false); + this.mainInventory[i] = null; + } + } + + for (i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null) + { + this.player.func_146097_a(this.armorInventory[i], true, false); + this.armorInventory[i] = null; + } + } + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + this.inventoryChanged = true; + } + + public void setItemStack(ItemStack p_70437_1_) + { + this.itemStack = p_70437_1_; + } + + public ItemStack getItemStack() + { + return this.itemStack; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.player.isDead ? false : player.getDistanceSqToEntity(this.player) <= 64.0D; + } + + /** + * Returns true if the specified ItemStack exists in the inventory. + */ + public boolean hasItemStack(ItemStack p_70431_1_) + { + int i; + + for (i = 0; i < this.armorInventory.length; ++i) + { + if (this.armorInventory[i] != null && this.armorInventory[i].isItemEqual(p_70431_1_)) + { + return true; + } + } + + for (i = 0; i < this.mainInventory.length; ++i) + { + if (this.mainInventory[i] != null && this.mainInventory[i].isItemEqual(p_70431_1_)) + { + return true; + } + } + + return false; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + /** + * Copy the ItemStack contents from another InventoryPlayer instance + */ + public void copyInventory(InventoryPlayer p_70455_1_) + { + int i; + + for (i = 0; i < this.mainInventory.length; ++i) + { + this.mainInventory[i] = ItemStack.copyItemStack(p_70455_1_.mainInventory[i]); + } + + for (i = 0; i < this.armorInventory.length; ++i) + { + this.armorInventory[i] = ItemStack.copyItemStack(p_70455_1_.armorInventory[i]); + } + + this.currentItem = p_70455_1_.currentItem; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/player/PlayerCapabilities.java b/build/rfg/minecraft-src/java/net/minecraft/entity/player/PlayerCapabilities.java new file mode 100644 index 0000000..f822b7b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/player/PlayerCapabilities.java @@ -0,0 +1,80 @@ +package net.minecraft.entity.player; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; + +public class PlayerCapabilities +{ + /** Disables player damage. */ + public boolean disableDamage; + /** Sets/indicates whether the player is flying. */ + public boolean isFlying; + /** whether or not to allow the player to fly when they double jump. */ + public boolean allowFlying; + /** Used to determine if creative mode is enabled, and therefore if items should be depleted on usage */ + public boolean isCreativeMode; + /** Indicates whether the player is allowed to modify the surroundings */ + public boolean allowEdit = true; + private float flySpeed = 0.05F; + private float walkSpeed = 0.1F; + private static final String __OBFID = "CL_00001708"; + + public void writeCapabilitiesToNBT(NBTTagCompound p_75091_1_) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setBoolean("invulnerable", this.disableDamage); + nbttagcompound1.setBoolean("flying", this.isFlying); + nbttagcompound1.setBoolean("mayfly", this.allowFlying); + nbttagcompound1.setBoolean("instabuild", this.isCreativeMode); + nbttagcompound1.setBoolean("mayBuild", this.allowEdit); + nbttagcompound1.setFloat("flySpeed", this.flySpeed); + nbttagcompound1.setFloat("walkSpeed", this.walkSpeed); + p_75091_1_.setTag("abilities", nbttagcompound1); + } + + public void readCapabilitiesFromNBT(NBTTagCompound p_75095_1_) + { + if (p_75095_1_.hasKey("abilities", 10)) + { + NBTTagCompound nbttagcompound1 = p_75095_1_.getCompoundTag("abilities"); + this.disableDamage = nbttagcompound1.getBoolean("invulnerable"); + this.isFlying = nbttagcompound1.getBoolean("flying"); + this.allowFlying = nbttagcompound1.getBoolean("mayfly"); + this.isCreativeMode = nbttagcompound1.getBoolean("instabuild"); + + if (nbttagcompound1.hasKey("flySpeed", 99)) + { + this.flySpeed = nbttagcompound1.getFloat("flySpeed"); + this.walkSpeed = nbttagcompound1.getFloat("walkSpeed"); + } + + if (nbttagcompound1.hasKey("mayBuild", 1)) + { + this.allowEdit = nbttagcompound1.getBoolean("mayBuild"); + } + } + } + + public float getFlySpeed() + { + return this.flySpeed; + } + + @SideOnly(Side.CLIENT) + public void setFlySpeed(float p_75092_1_) + { + this.flySpeed = p_75092_1_; + } + + public float getWalkSpeed() + { + return this.walkSpeed; + } + + @SideOnly(Side.CLIENT) + public void setPlayerWalkSpeed(float p_82877_1_) + { + this.walkSpeed = p_82877_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityArrow.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityArrow.java new file mode 100644 index 0000000..0685a6c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityArrow.java @@ -0,0 +1,598 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class EntityArrow extends Entity implements IProjectile +{ + private int field_145791_d = -1; + private int field_145792_e = -1; + private int field_145789_f = -1; + private Block field_145790_g; + private int inData; + private boolean inGround; + /** 1 if the player can pick up the arrow */ + public int canBePickedUp; + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + private static final String __OBFID = "CL_00001715"; + + public EntityArrow(World p_i1753_1_) + { + super(p_i1753_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + + public EntityArrow(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_) + { + super(p_i1754_1_); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(p_i1754_2_, p_i1754_4_, p_i1754_6_); + this.yOffset = 0.0F; + } + + public EntityArrow(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_) + { + super(p_i1755_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1755_2_; + + if (p_i1755_2_ instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.posY = p_i1755_2_.posY + (double)p_i1755_2_.getEyeHeight() - 0.10000000149011612D; + double d0 = p_i1755_3_.posX - p_i1755_2_.posX; + double d1 = p_i1755_3_.boundingBox.minY + (double)(p_i1755_3_.height / 3.0F) - this.posY; + double d2 = p_i1755_3_.posZ - p_i1755_2_.posZ; + double d3 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2); + + if (d3 >= 1.0E-7D) + { + float f2 = (float)(Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float)(-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(p_i1755_2_.posX + d4, this.posY, p_i1755_2_.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float)d3 * 0.2F; + this.setThrowableHeading(d0, d1 + (double)f4, d2, p_i1755_4_, p_i1755_5_); + } + } + + public EntityArrow(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_) + { + super(p_i1756_1_); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = p_i1756_2_; + + if (p_i1756_2_ instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(p_i1756_2_.posX, p_i1756_2_.posY + (double)p_i1756_2_.getEyeHeight(), p_i1756_2_.posZ, p_i1756_2_.rotationYaw, p_i1756_2_.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F); + } + + protected void entityInit() + { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) + { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= (double)f2; + p_70186_3_ /= (double)f2; + p_70186_5_ /= (double)f2; + p_70186_1_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)p_70186_8_; + p_70186_1_ *= (double)p_70186_7_; + p_70186_3_ *= (double)p_70186_7_; + p_70186_5_ *= (double)p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, (double)f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.setPosition(x, y, z); + this.setRotation(yaw, pitch); + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); + } + + Block block = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) + { + this.inGround = true; + } + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + + if (this.inGround) + { + int j = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + + if (block == this.field_145790_g && j == this.inData) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + } + else + { + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } + else + { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int i; + float f1; + + for (i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) + { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double)f1, (double)f1, (double)f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + double d1 = vec31.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)movingobjectposition.entityHit; + + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(entityplayer)) + { + movingobjectposition = null; + } + } + + float f2; + float f4; + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int k = MathHelper.ceiling_double_int((double)f2 * this.damage); + + if (this.getIsCritical()) + { + k += this.rand.nextInt(k / 2 + 2); + } + + DamageSource damagesource = null; + + if (this.shootingEntity == null) + { + damagesource = DamageSource.causeArrowDamage(this, this); + } + else + { + damagesource = DamageSource.causeArrowDamage(this, this.shootingEntity); + } + + if (this.isBurning() && !(movingobjectposition.entityHit instanceof EntityEnderman)) + { + movingobjectposition.entityHit.setFire(5); + } + + if (movingobjectposition.entityHit.attackEntityFrom(damagesource, (float)k)) + { + if (movingobjectposition.entityHit instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)movingobjectposition.entityHit; + + if (!this.worldObj.isRemote) + { + entitylivingbase.setArrowCountInEntity(entitylivingbase.getArrowCountInEntity() + 1); + } + + if (this.knockbackStrength > 0) + { + f4 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (f4 > 0.0F) + { + movingobjectposition.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)f4); + } + } + + if (this.shootingEntity != null && this.shootingEntity instanceof EntityLivingBase) + { + EnchantmentHelper.func_151384_a(entitylivingbase, this.shootingEntity); + EnchantmentHelper.func_151385_b((EntityLivingBase)this.shootingEntity, entitylivingbase); + } + + if (this.shootingEntity != null && movingobjectposition.entityHit != this.shootingEntity && movingobjectposition.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) + { + ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(6, 0.0F)); + } + } + + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + + if (!(movingobjectposition.entityHit instanceof EntityEnderman)) + { + this.setDead(); + } + } + else + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } + else + { + this.field_145791_d = movingobjectposition.blockX; + this.field_145792_e = movingobjectposition.blockY; + this.field_145789_f = movingobjectposition.blockZ; + this.field_145790_g = this.worldObj.getBlock(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.inData = this.worldObj.getBlockMetadata(this.field_145791_d, this.field_145792_e, this.field_145789_f); + this.motionX = (double)((float)(movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = (double)((float)(movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = (double)((float)(movingobjectposition.hitVec.zCoord - this.posZ)); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double)f2 * 0.05000000074505806D; + this.posY -= this.motionY / (double)f2 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double)f2 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); + + if (this.field_145790_g.getMaterial() != Material.air) + { + this.field_145790_g.onEntityCollidedWithBlock(this.worldObj, this.field_145791_d, this.field_145792_e, this.field_145789_f, this); + } + } + } + + if (this.getIsCritical()) + { + for (i = 0; i < 4; ++i) + { + this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)i / 4.0D, this.posY + this.motionY * (double)i / 4.0D, this.posZ + this.motionZ * (double)i / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f3 = 0.99F; + f1 = 0.05F; + + if (this.isInWater()) + { + for (int l = 0; l < 4; ++l) + { + f4 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ); + } + + f3 = 0.8F; + } + + if (this.isWet()) + { + this.extinguish(); + } + + this.motionX *= (double)f3; + this.motionY *= (double)f3; + this.motionZ *= (double)f3; + this.motionY -= (double)f1; + this.setPosition(this.posX, this.posY, this.posZ); + this.func_145775_I(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.field_145791_d); + tagCompound.setShort("yTile", (short)this.field_145792_e); + tagCompound.setShort("zTile", (short)this.field_145789_f); + tagCompound.setShort("life", (short)this.ticksInGround); + tagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145790_g)); + tagCompound.setByte("inData", (byte)this.inData); + tagCompound.setByte("shake", (byte)this.arrowShake); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + tagCompound.setByte("pickup", (byte)this.canBePickedUp); + tagCompound.setDouble("damage", this.damage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.field_145791_d = tagCompund.getShort("xTile"); + this.field_145792_e = tagCompund.getShort("yTile"); + this.field_145789_f = tagCompund.getShort("zTile"); + this.ticksInGround = tagCompund.getShort("life"); + this.field_145790_g = Block.getBlockById(tagCompund.getByte("inTile") & 255); + this.inData = tagCompund.getByte("inData") & 255; + this.arrowShake = tagCompund.getByte("shake") & 255; + this.inGround = tagCompund.getByte("inGround") == 1; + + if (tagCompund.hasKey("damage", 99)) + { + this.damage = tagCompund.getDouble("damage"); + } + + if (tagCompund.hasKey("pickup", 99)) + { + this.canBePickedUp = tagCompund.getByte("pickup"); + } + else if (tagCompund.hasKey("player", 99)) + { + this.canBePickedUp = tagCompund.getBoolean("player") ? 1 : 0; + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityIn) + { + if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) + { + boolean flag = this.canBePickedUp == 1 || this.canBePickedUp == 2 && entityIn.capabilities.isCreativeMode; + + if (this.canBePickedUp == 1 && !entityIn.inventory.addItemStackToInventory(new ItemStack(Items.arrow, 1))) + { + flag = false; + } + + if (flag) + { + this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityIn.onItemPickup(this, 1); + this.setDead(); + } + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public void setDamage(double p_70239_1_) + { + this.damage = p_70239_1_; + } + + public double getDamage() + { + return this.damage; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int p_70240_1_) + { + this.knockbackStrength = p_70240_1_; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public void setIsCritical(boolean p_70243_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70243_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Whether the arrow has a stream of critical hit particles flying behind it. + */ + public boolean getIsCritical() + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + return (b0 & 1) != 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityEgg.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityEgg.java new file mode 100644 index 0000000..d1c60d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityEgg.java @@ -0,0 +1,66 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityEgg extends EntityThrowable +{ + private static final String __OBFID = "CL_00001724"; + + public EntityEgg(World p_i1779_1_) + { + super(p_i1779_1_); + } + + public EntityEgg(World p_i1780_1_, EntityLivingBase p_i1780_2_) + { + super(p_i1780_1_, p_i1780_2_); + } + + public EntityEgg(World p_i1781_1_, double p_i1781_2_, double p_i1781_4_, double p_i1781_6_) + { + super(p_i1781_1_, p_i1781_2_, p_i1781_4_, p_i1781_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + + if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) + { + byte b0 = 1; + + if (this.rand.nextInt(32) == 0) + { + b0 = 4; + } + + for (int i = 0; i < b0; ++i) + { + EntityChicken entitychicken = new EntityChicken(this.worldObj); + entitychicken.setGrowingAge(-24000); + entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + this.worldObj.spawnEntityInWorld(entitychicken); + } + } + + for (int j = 0; j < 8; ++j) + { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFireball.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFireball.java new file mode 100644 index 0000000..45fd9dc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFireball.java @@ -0,0 +1,346 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityFireball extends Entity +{ + private int field_145795_e = -1; + private int field_145793_f = -1; + private int field_145794_g = -1; + private Block field_145796_h; + private boolean inGround; + public EntityLivingBase shootingEntity; + private int ticksAlive; + private int ticksInAir; + public double accelerationX; + public double accelerationY; + public double accelerationZ; + private static final String __OBFID = "CL_00001717"; + + public EntityFireball(World p_i1759_1_) + { + super(p_i1759_1_); + this.setSize(1.0F, 1.0F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D; + d1 *= 64.0D; + return distance < d1 * d1; + } + + public EntityFireball(World p_i1760_1_, double p_i1760_2_, double p_i1760_4_, double p_i1760_6_, double p_i1760_8_, double p_i1760_10_, double p_i1760_12_) + { + super(p_i1760_1_); + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(p_i1760_2_, p_i1760_4_, p_i1760_6_, this.rotationYaw, this.rotationPitch); + this.setPosition(p_i1760_2_, p_i1760_4_, p_i1760_6_); + double d6 = (double)MathHelper.sqrt_double(p_i1760_8_ * p_i1760_8_ + p_i1760_10_ * p_i1760_10_ + p_i1760_12_ * p_i1760_12_); + this.accelerationX = p_i1760_8_ / d6 * 0.1D; + this.accelerationY = p_i1760_10_ / d6 * 0.1D; + this.accelerationZ = p_i1760_12_ / d6 * 0.1D; + } + + public EntityFireball(World p_i1761_1_, EntityLivingBase p_i1761_2_, double p_i1761_3_, double p_i1761_5_, double p_i1761_7_) + { + super(p_i1761_1_); + this.shootingEntity = p_i1761_2_; + this.setSize(1.0F, 1.0F); + this.setLocationAndAngles(p_i1761_2_.posX, p_i1761_2_.posY, p_i1761_2_.posZ, p_i1761_2_.rotationYaw, p_i1761_2_.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = this.motionY = this.motionZ = 0.0D; + p_i1761_3_ += this.rand.nextGaussian() * 0.4D; + p_i1761_5_ += this.rand.nextGaussian() * 0.4D; + p_i1761_7_ += this.rand.nextGaussian() * 0.4D; + double d3 = (double)MathHelper.sqrt_double(p_i1761_3_ * p_i1761_3_ + p_i1761_5_ * p_i1761_5_ + p_i1761_7_ * p_i1761_7_); + this.accelerationX = p_i1761_3_ / d3 * 0.1D; + this.accelerationY = p_i1761_5_ / d3 * 0.1D; + this.accelerationZ = p_i1761_7_ / d3 * 0.1D; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ))) + { + this.setDead(); + } + else + { + super.onUpdate(); + this.setFire(1); + + if (this.inGround) + { + if (this.worldObj.getBlock(this.field_145795_e, this.field_145793_f, this.field_145794_g) == this.field_145796_h) + { + ++this.ticksAlive; + + if (this.ticksAlive == 600) + { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksAlive = 0; + this.ticksInAir = 0; + } + else + { + ++this.ticksInAir; + } + + Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + + if (movingobjectposition1 != null) + { + double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) + { + this.onImpact(movingobjectposition); + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; + + for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = this.getMotionFactor(); + + if (this.isInWater()) + { + for (int j = 0; j < 4; ++j) + { + float f3 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); + } + + f2 = 0.8F; + } + + this.motionX += this.accelerationX; + this.motionY += this.accelerationY; + this.motionZ += this.accelerationZ; + this.motionX *= (double)f2; + this.motionY *= (double)f2; + this.motionZ *= (double)f2; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + this.setPosition(this.posX, this.posY, this.posZ); + } + } + + /** + * Return the motion factor for this projectile. The factor is multiplied by the original motion. + */ + protected float getMotionFactor() + { + return 0.95F; + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected abstract void onImpact(MovingObjectPosition p_70227_1_); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.field_145795_e); + tagCompound.setShort("yTile", (short)this.field_145793_f); + tagCompound.setShort("zTile", (short)this.field_145794_g); + tagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145796_h)); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + tagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.field_145795_e = tagCompund.getShort("xTile"); + this.field_145793_f = tagCompund.getShort("yTile"); + this.field_145794_g = tagCompund.getShort("zTile"); + this.field_145796_h = Block.getBlockById(tagCompund.getByte("inTile") & 255); + this.inGround = tagCompund.getByte("inGround") == 1; + + if (tagCompund.hasKey("direction", 9)) + { + NBTTagList nbttaglist = tagCompund.getTagList("direction", 6); + this.motionX = nbttaglist.func_150309_d(0); + this.motionY = nbttaglist.func_150309_d(1); + this.motionZ = nbttaglist.func_150309_d(2); + } + else + { + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return true; + } + + public float getCollisionBorderSize() + { + return 1.0F; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + this.setBeenAttacked(); + + if (source.getEntity() != null) + { + Vec3 vec3 = source.getEntity().getLookVec(); + + if (vec3 != null) + { + this.motionX = vec3.xCoord; + this.motionY = vec3.yCoord; + this.motionZ = vec3.zCoord; + this.accelerationX = this.motionX * 0.1D; + this.accelerationY = this.motionY * 0.1D; + this.accelerationZ = this.motionZ * 0.1D; + } + + if (source.getEntity() instanceof EntityLivingBase) + { + this.shootingEntity = (EntityLivingBase)source.getEntity(); + } + + return true; + } + else + { + return false; + } + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + /** + * Gets how bright this entity is. + */ + public float getBrightness(float p_70013_1_) + { + return 1.0F; + } + + @SideOnly(Side.CLIENT) + public int getBrightnessForRender(float p_70070_1_) + { + return 15728880; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFishHook.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFishHook.java new file mode 100644 index 0000000..00b249a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityFishHook.java @@ -0,0 +1,620 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Arrays; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.stats.StatList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +public class EntityFishHook extends Entity +{ + public static final List field_146039_d = Arrays.asList(new WeightedRandomFishable[] {(new WeightedRandomFishable(new ItemStack(Items.leather_boots), 10)).func_150709_a(0.9F), new WeightedRandomFishable(new ItemStack(Items.leather), 10), new WeightedRandomFishable(new ItemStack(Items.bone), 10), new WeightedRandomFishable(new ItemStack(Items.potionitem), 10), new WeightedRandomFishable(new ItemStack(Items.string), 5), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 2)).func_150709_a(0.9F), new WeightedRandomFishable(new ItemStack(Items.bowl), 10), new WeightedRandomFishable(new ItemStack(Items.stick), 5), new WeightedRandomFishable(new ItemStack(Items.dye, 10, 0), 1), new WeightedRandomFishable(new ItemStack(Blocks.tripwire_hook), 10), new WeightedRandomFishable(new ItemStack(Items.rotten_flesh), 10)}); + public static final List field_146041_e = Arrays.asList(new WeightedRandomFishable[] {new WeightedRandomFishable(new ItemStack(Blocks.waterlily), 1), new WeightedRandomFishable(new ItemStack(Items.name_tag), 1), new WeightedRandomFishable(new ItemStack(Items.saddle), 1), (new WeightedRandomFishable(new ItemStack(Items.bow), 1)).func_150709_a(0.25F).func_150707_a(), (new WeightedRandomFishable(new ItemStack(Items.fishing_rod), 1)).func_150709_a(0.25F).func_150707_a(), (new WeightedRandomFishable(new ItemStack(Items.book), 1)).func_150707_a()}); + public static final List field_146036_f = Arrays.asList(new WeightedRandomFishable[] {new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.COD.func_150976_a()), 60), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.SALMON.func_150976_a()), 25), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.CLOWNFISH.func_150976_a()), 2), new WeightedRandomFishable(new ItemStack(Items.fish, 1, ItemFishFood.FishType.PUFFERFISH.func_150976_a()), 13)}); + private int field_146037_g; + private int field_146048_h; + private int field_146050_i; + private Block field_146046_j; + private boolean field_146051_au; + public int field_146044_a; + public EntityPlayer field_146042_b; + private int field_146049_av; + private int field_146047_aw; + private int field_146045_ax; + private int field_146040_ay; + private int field_146038_az; + private float field_146054_aA; + public Entity field_146043_c; + private int field_146055_aB; + private double field_146056_aC; + private double field_146057_aD; + private double field_146058_aE; + private double field_146059_aF; + private double field_146060_aG; + @SideOnly(Side.CLIENT) + private double field_146061_aH; + @SideOnly(Side.CLIENT) + private double field_146052_aI; + @SideOnly(Side.CLIENT) + private double field_146053_aJ; + private static final String __OBFID = "CL_00001663"; + + public EntityFishHook(World p_i1764_1_) + { + super(p_i1764_1_); + this.field_146037_g = -1; + this.field_146048_h = -1; + this.field_146050_i = -1; + this.setSize(0.25F, 0.25F); + this.ignoreFrustumCheck = true; + } + + @SideOnly(Side.CLIENT) + public EntityFishHook(World p_i1765_1_, double p_i1765_2_, double p_i1765_4_, double p_i1765_6_, EntityPlayer p_i1765_8_) + { + this(p_i1765_1_); + this.setPosition(p_i1765_2_, p_i1765_4_, p_i1765_6_); + this.ignoreFrustumCheck = true; + this.field_146042_b = p_i1765_8_; + p_i1765_8_.fishEntity = this; + } + + public EntityFishHook(World p_i1766_1_, EntityPlayer p_i1766_2_) + { + super(p_i1766_1_); + this.field_146037_g = -1; + this.field_146048_h = -1; + this.field_146050_i = -1; + this.ignoreFrustumCheck = true; + this.field_146042_b = p_i1766_2_; + this.field_146042_b.fishEntity = this; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(p_i1766_2_.posX, p_i1766_2_.posY + 1.62D - (double)p_i1766_2_.yOffset, p_i1766_2_.posZ, p_i1766_2_.rotationYaw, p_i1766_2_.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + float f = 0.4F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.func_146035_c(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + + protected void entityInit() {} + + public void func_146035_c(double p_146035_1_, double p_146035_3_, double p_146035_5_, float p_146035_7_, float p_146035_8_) + { + float f2 = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_3_ * p_146035_3_ + p_146035_5_ * p_146035_5_); + p_146035_1_ /= (double)f2; + p_146035_3_ /= (double)f2; + p_146035_5_ /= (double)f2; + p_146035_1_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_3_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_5_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_146035_8_; + p_146035_1_ *= (double)p_146035_7_; + p_146035_3_ *= (double)p_146035_7_; + p_146035_5_ *= (double)p_146035_7_; + this.motionX = p_146035_1_; + this.motionY = p_146035_3_; + this.motionZ = p_146035_5_; + float f3 = MathHelper.sqrt_double(p_146035_1_ * p_146035_1_ + p_146035_5_ * p_146035_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_146035_1_, p_146035_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_146035_3_, (double)f3) * 180.0D / Math.PI); + this.field_146049_av = 0; + } + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D; + d1 *= 64.0D; + return distance < d1 * d1; + } + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int rotationIncrements) + { + this.field_146056_aC = x; + this.field_146057_aD = y; + this.field_146058_aE = z; + this.field_146059_aF = (double)yaw; + this.field_146060_aG = (double)pitch; + this.field_146055_aB = rotationIncrements; + this.motionX = this.field_146061_aH; + this.motionY = this.field_146052_aI; + this.motionZ = this.field_146053_aJ; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.field_146061_aH = this.motionX = x; + this.field_146052_aI = this.motionY = y; + this.field_146053_aJ = this.motionZ = z; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.field_146055_aB > 0) + { + double d7 = this.posX + (this.field_146056_aC - this.posX) / (double)this.field_146055_aB; + double d8 = this.posY + (this.field_146057_aD - this.posY) / (double)this.field_146055_aB; + double d9 = this.posZ + (this.field_146058_aE - this.posZ) / (double)this.field_146055_aB; + double d1 = MathHelper.wrapAngleTo180_double(this.field_146059_aF - (double)this.rotationYaw); + this.rotationYaw = (float)((double)this.rotationYaw + d1 / (double)this.field_146055_aB); + this.rotationPitch = (float)((double)this.rotationPitch + (this.field_146060_aG - (double)this.rotationPitch) / (double)this.field_146055_aB); + --this.field_146055_aB; + this.setPosition(d7, d8, d9); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else + { + if (!this.worldObj.isRemote) + { + ItemStack itemstack = this.field_146042_b.getCurrentEquippedItem(); + + if (this.field_146042_b.isDead || !this.field_146042_b.isEntityAlive() || itemstack == null || itemstack.getItem() != Items.fishing_rod || this.getDistanceSqToEntity(this.field_146042_b) > 1024.0D) + { + this.setDead(); + this.field_146042_b.fishEntity = null; + return; + } + + if (this.field_146043_c != null) + { + if (!this.field_146043_c.isDead) + { + this.posX = this.field_146043_c.posX; + this.posY = this.field_146043_c.boundingBox.minY + (double)this.field_146043_c.height * 0.8D; + this.posZ = this.field_146043_c.posZ; + return; + } + + this.field_146043_c = null; + } + } + + if (this.field_146044_a > 0) + { + --this.field_146044_a; + } + + if (this.field_146051_au) + { + if (this.worldObj.getBlock(this.field_146037_g, this.field_146048_h, this.field_146050_i) == this.field_146046_j) + { + ++this.field_146049_av; + + if (this.field_146049_av == 1200) + { + this.setDead(); + } + + return; + } + + this.field_146051_au = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.field_146049_av = 0; + this.field_146047_aw = 0; + } + else + { + ++this.field_146047_aw; + } + + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec31, vec3); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + double d2; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (entity1.canBeCollidedWith() && (entity1 != this.field_146042_b || this.field_146047_aw >= 5)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec31, vec3); + + if (movingobjectposition1 != null) + { + d2 = vec31.distanceTo(movingobjectposition1.hitVec); + + if (d2 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d2; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + if (movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.field_146042_b), 0.0F)) + { + this.field_146043_c = movingobjectposition.entityHit; + } + } + else + { + this.field_146051_au = true; + } + } + + if (!this.field_146051_au) + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float f5 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f5) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f6 = 0.92F; + + if (this.onGround || this.isCollidedHorizontally) + { + f6 = 0.5F; + } + + byte b0 = 5; + double d10 = 0.0D; + + for (int j = 0; j < b0; ++j) + { + double d3 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(j + 0) / (double)b0 - 0.125D + 0.125D; + double d4 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(j + 1) / (double)b0 - 0.125D + 0.125D; + AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d3, this.boundingBox.minZ, this.boundingBox.maxX, d4, this.boundingBox.maxZ); + + if (this.worldObj.isAABBInMaterial(axisalignedbb1, Material.water)) + { + d10 += 1.0D / (double)b0; + } + } + + if (!this.worldObj.isRemote && d10 > 0.0D) + { + WorldServer worldserver = (WorldServer)this.worldObj; + int k = 1; + + if (this.rand.nextFloat() < 0.25F && this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) + { + k = 2; + } + + if (this.rand.nextFloat() < 0.5F && !this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) + { + --k; + } + + if (this.field_146045_ax > 0) + { + --this.field_146045_ax; + + if (this.field_146045_ax <= 0) + { + this.field_146040_ay = 0; + this.field_146038_az = 0; + } + } + else + { + float f1; + float f2; + double d5; + double d6; + float f7; + double d11; + + if (this.field_146038_az > 0) + { + this.field_146038_az -= k; + + if (this.field_146038_az <= 0) + { + this.motionY -= 0.20000000298023224D; + this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + f1 = (float)MathHelper.floor_double(this.boundingBox.minY); + worldserver.func_147487_a("bubble", this.posX, (double)(f1 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D); + worldserver.func_147487_a("wake", this.posX, (double)(f1 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D); + this.field_146045_ax = MathHelper.getRandomIntegerInRange(this.rand, 10, 30); + } + else + { + this.field_146054_aA = (float)((double)this.field_146054_aA + this.rand.nextGaussian() * 4.0D); + f1 = this.field_146054_aA * 0.017453292F; + f7 = MathHelper.sin(f1); + f2 = MathHelper.cos(f1); + d11 = this.posX + (double)(f7 * (float)this.field_146038_az * 0.1F); + d5 = (double)((float)MathHelper.floor_double(this.boundingBox.minY) + 1.0F); + d6 = this.posZ + (double)(f2 * (float)this.field_146038_az * 0.1F); + + if (this.rand.nextFloat() < 0.15F) + { + worldserver.func_147487_a("bubble", d11, d5 - 0.10000000149011612D, d6, 1, (double)f7, 0.1D, (double)f2, 0.0D); + } + + float f3 = f7 * 0.04F; + float f4 = f2 * 0.04F; + worldserver.func_147487_a("wake", d11, d5, d6, 0, (double)f4, 0.01D, (double)(-f3), 1.0D); + worldserver.func_147487_a("wake", d11, d5, d6, 0, (double)(-f4), 0.01D, (double)f3, 1.0D); + } + } + else if (this.field_146040_ay > 0) + { + this.field_146040_ay -= k; + f1 = 0.15F; + + if (this.field_146040_ay < 20) + { + f1 = (float)((double)f1 + (double)(20 - this.field_146040_ay) * 0.05D); + } + else if (this.field_146040_ay < 40) + { + f1 = (float)((double)f1 + (double)(40 - this.field_146040_ay) * 0.02D); + } + else if (this.field_146040_ay < 60) + { + f1 = (float)((double)f1 + (double)(60 - this.field_146040_ay) * 0.01D); + } + + if (this.rand.nextFloat() < f1) + { + f7 = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F) * 0.017453292F; + f2 = MathHelper.randomFloatClamp(this.rand, 25.0F, 60.0F); + d11 = this.posX + (double)(MathHelper.sin(f7) * f2 * 0.1F); + d5 = (double)((float)MathHelper.floor_double(this.boundingBox.minY) + 1.0F); + d6 = this.posZ + (double)(MathHelper.cos(f7) * f2 * 0.1F); + worldserver.func_147487_a("splash", d11, d5, d6, 2 + this.rand.nextInt(2), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D); + } + + if (this.field_146040_ay <= 0) + { + this.field_146054_aA = MathHelper.randomFloatClamp(this.rand, 0.0F, 360.0F); + this.field_146038_az = MathHelper.getRandomIntegerInRange(this.rand, 20, 80); + } + } + else + { + this.field_146040_ay = MathHelper.getRandomIntegerInRange(this.rand, 100, 900); + this.field_146040_ay -= EnchantmentHelper.func_151387_h(this.field_146042_b) * 20 * 5; + } + } + + if (this.field_146045_ax > 0) + { + this.motionY -= (double)(this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) * 0.2D; + } + } + + d2 = d10 * 2.0D - 1.0D; + this.motionY += 0.03999999910593033D * d2; + + if (d10 > 0.0D) + { + f6 = (float)((double)f6 * 0.9D); + this.motionY *= 0.8D; + } + + this.motionX *= (double)f6; + this.motionY *= (double)f6; + this.motionZ *= (double)f6; + this.setPosition(this.posX, this.posY, this.posZ); + } + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.field_146037_g); + tagCompound.setShort("yTile", (short)this.field_146048_h); + tagCompound.setShort("zTile", (short)this.field_146050_i); + tagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.field_146046_j)); + tagCompound.setByte("shake", (byte)this.field_146044_a); + tagCompound.setByte("inGround", (byte)(this.field_146051_au ? 1 : 0)); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.field_146037_g = tagCompund.getShort("xTile"); + this.field_146048_h = tagCompund.getShort("yTile"); + this.field_146050_i = tagCompund.getShort("zTile"); + this.field_146046_j = Block.getBlockById(tagCompund.getByte("inTile") & 255); + this.field_146044_a = tagCompund.getByte("shake") & 255; + this.field_146051_au = tagCompund.getByte("inGround") == 1; + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public int func_146034_e() + { + if (this.worldObj.isRemote) + { + return 0; + } + else + { + byte b0 = 0; + + if (this.field_146043_c != null) + { + double d0 = this.field_146042_b.posX - this.posX; + double d2 = this.field_146042_b.posY - this.posY; + double d4 = this.field_146042_b.posZ - this.posZ; + double d6 = (double)MathHelper.sqrt_double(d0 * d0 + d2 * d2 + d4 * d4); + double d8 = 0.1D; + this.field_146043_c.motionX += d0 * d8; + this.field_146043_c.motionY += d2 * d8 + (double)MathHelper.sqrt_double(d6) * 0.08D; + this.field_146043_c.motionZ += d4 * d8; + b0 = 3; + } + else if (this.field_146045_ax > 0) + { + EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, this.func_146033_f()); + double d1 = this.field_146042_b.posX - this.posX; + double d3 = this.field_146042_b.posY - this.posY; + double d5 = this.field_146042_b.posZ - this.posZ; + double d7 = (double)MathHelper.sqrt_double(d1 * d1 + d3 * d3 + d5 * d5); + double d9 = 0.1D; + entityitem.motionX = d1 * d9; + entityitem.motionY = d3 * d9 + (double)MathHelper.sqrt_double(d7) * 0.08D; + entityitem.motionZ = d5 * d9; + this.worldObj.spawnEntityInWorld(entityitem); + this.field_146042_b.worldObj.spawnEntityInWorld(new EntityXPOrb(this.field_146042_b.worldObj, this.field_146042_b.posX, this.field_146042_b.posY + 0.5D, this.field_146042_b.posZ + 0.5D, this.rand.nextInt(6) + 1)); + b0 = 1; + } + + if (this.field_146051_au) + { + b0 = 2; + } + + this.setDead(); + this.field_146042_b.fishEntity = null; + return b0; + } + } + + private ItemStack func_146033_f() + { + float f = this.worldObj.rand.nextFloat(); + int i = EnchantmentHelper.func_151386_g(this.field_146042_b); + int j = EnchantmentHelper.func_151387_h(this.field_146042_b); + if (true) + { + this.field_146042_b.addStat(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); + return net.minecraftforge.common.FishingHooks.getRandomFishable(this.rand, f, i, j); + } + + float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; + float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; + f1 = MathHelper.clamp_float(f1, 0.0F, 1.0F); + f2 = MathHelper.clamp_float(f2, 0.0F, 1.0F); + + if (f < f1) + { + this.field_146042_b.addStat(StatList.field_151183_A, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146039_d)).func_150708_a(this.rand); + } + else + { + f -= f1; + + if (f < f2) + { + this.field_146042_b.addStat(StatList.field_151184_B, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146041_e)).func_150708_a(this.rand); + } + else + { + float f3 = f - f2; + this.field_146042_b.addStat(StatList.fishCaughtStat, 1); + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(this.rand, field_146036_f)).func_150708_a(this.rand); + } + } + } + + /** + * Will get destroyed next tick. + */ + public void setDead() + { + super.setDead(); + + if (this.field_146042_b != null) + { + this.field_146042_b.fishEntity = null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityLargeFireball.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityLargeFireball.java new file mode 100644 index 0000000..5af03a3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityLargeFireball.java @@ -0,0 +1,71 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityLargeFireball extends EntityFireball +{ + public int field_92057_e = 1; + private static final String __OBFID = "CL_00001719"; + + public EntityLargeFireball(World p_i1767_1_) + { + super(p_i1767_1_); + } + + @SideOnly(Side.CLIENT) + public EntityLargeFireball(World p_i1768_1_, double p_i1768_2_, double p_i1768_4_, double p_i1768_6_, double p_i1768_8_, double p_i1768_10_, double p_i1768_12_) + { + super(p_i1768_1_, p_i1768_2_, p_i1768_4_, p_i1768_6_, p_i1768_8_, p_i1768_10_, p_i1768_12_); + } + + public EntityLargeFireball(World p_i1769_1_, EntityLivingBase p_i1769_2_, double p_i1769_3_, double p_i1769_5_, double p_i1769_7_) + { + super(p_i1769_1_, p_i1769_2_, p_i1769_3_, p_i1769_5_, p_i1769_7_); + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) + { + if (!this.worldObj.isRemote) + { + if (p_70227_1_.entityHit != null) + { + p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); + } + + this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + tagCompound.setInteger("ExplosionPower", this.field_92057_e); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("ExplosionPower", 99)) + { + this.field_92057_e = tagCompund.getInteger("ExplosionPower"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityPotion.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityPotion.java new file mode 100644 index 0000000..3a4c904 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityPotion.java @@ -0,0 +1,189 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntityPotion extends EntityThrowable +{ + /** The damage value of the thrown potion that this EntityPotion represents. */ + private ItemStack potionDamage; + private static final String __OBFID = "CL_00001727"; + + public EntityPotion(World p_i1788_1_) + { + super(p_i1788_1_); + } + + public EntityPotion(World p_i1789_1_, EntityLivingBase p_i1789_2_, int p_i1789_3_) + { + this(p_i1789_1_, p_i1789_2_, new ItemStack(Items.potionitem, 1, p_i1789_3_)); + } + + public EntityPotion(World p_i1790_1_, EntityLivingBase p_i1790_2_, ItemStack p_i1790_3_) + { + super(p_i1790_1_, p_i1790_2_); + this.potionDamage = p_i1790_3_; + } + + @SideOnly(Side.CLIENT) + public EntityPotion(World p_i1791_1_, double p_i1791_2_, double p_i1791_4_, double p_i1791_6_, int p_i1791_8_) + { + this(p_i1791_1_, p_i1791_2_, p_i1791_4_, p_i1791_6_, new ItemStack(Items.potionitem, 1, p_i1791_8_)); + } + + public EntityPotion(World p_i1792_1_, double p_i1792_2_, double p_i1792_4_, double p_i1792_6_, ItemStack p_i1792_8_) + { + super(p_i1792_1_, p_i1792_2_, p_i1792_4_, p_i1792_6_); + this.potionDamage = p_i1792_8_; + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() + { + return 0.05F; + } + + protected float func_70182_d() + { + return 0.5F; + } + + protected float func_70183_g() + { + return -20.0F; + } + + public void setPotionDamage(int p_82340_1_) + { + if (this.potionDamage == null) + { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + this.potionDamage.setItemDamage(p_82340_1_); + } + + /** + * Returns the damage value of the thrown potion that this EntityPotion represents. + */ + public int getPotionDamage() + { + if (this.potionDamage == null) + { + this.potionDamage = new ItemStack(Items.potionitem, 1, 0); + } + + return this.potionDamage.getItemDamage(); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (!this.worldObj.isRemote) + { + List list = Items.potionitem.getEffects(this.potionDamage); + + if (list != null && !list.isEmpty()) + { + AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); + List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb); + + if (list1 != null && !list1.isEmpty()) + { + Iterator iterator = list1.iterator(); + + while (iterator.hasNext()) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)iterator.next(); + double d0 = this.getDistanceSqToEntity(entitylivingbase); + + if (d0 < 16.0D) + { + double d1 = 1.0D - Math.sqrt(d0) / 4.0D; + + if (entitylivingbase == p_70184_1_.entityHit) + { + d1 = 1.0D; + } + + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator1.next(); + int i = potioneffect.getPotionID(); + + if (Potion.potionTypes[i].isInstant()) + { + Potion.potionTypes[i].affectEntity(this.getThrower(), entitylivingbase, potioneffect.getAmplifier(), d1); + } + else + { + int j = (int)(d1 * (double)potioneffect.getDuration() + 0.5D); + + if (j > 20) + { + entitylivingbase.addPotionEffect(new PotionEffect(i, j, potioneffect.getAmplifier())); + } + } + } + } + } + } + } + + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage()); + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + super.readEntityFromNBT(tagCompund); + + if (tagCompund.hasKey("Potion", 10)) + { + this.potionDamage = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("Potion")); + } + else + { + this.setPotionDamage(tagCompund.getInteger("potionValue")); + } + + if (this.potionDamage == null) + { + this.setDead(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + super.writeEntityToNBT(tagCompound); + + if (this.potionDamage != null) + { + tagCompound.setTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySmallFireball.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySmallFireball.java new file mode 100644 index 0000000..d75b512 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySmallFireball.java @@ -0,0 +1,97 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySmallFireball extends EntityFireball +{ + private static final String __OBFID = "CL_00001721"; + + public EntitySmallFireball(World p_i1770_1_) + { + super(p_i1770_1_); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World p_i1771_1_, EntityLivingBase p_i1771_2_, double p_i1771_3_, double p_i1771_5_, double p_i1771_7_) + { + super(p_i1771_1_, p_i1771_2_, p_i1771_3_, p_i1771_5_, p_i1771_7_); + this.setSize(0.3125F, 0.3125F); + } + + public EntitySmallFireball(World p_i1772_1_, double p_i1772_2_, double p_i1772_4_, double p_i1772_6_, double p_i1772_8_, double p_i1772_10_, double p_i1772_12_) + { + super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) + { + if (!this.worldObj.isRemote) + { + if (p_70227_1_.entityHit != null) + { + if (!p_70227_1_.entityHit.isImmuneToFire() && p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) + { + p_70227_1_.entityHit.setFire(5); + } + } + else + { + int i = p_70227_1_.blockX; + int j = p_70227_1_.blockY; + int k = p_70227_1_.blockZ; + + switch (p_70227_1_.sideHit) + { + case 0: + --j; + break; + case 1: + ++j; + break; + case 2: + --k; + break; + case 3: + ++k; + break; + case 4: + --i; + break; + case 5: + ++i; + } + + if (this.worldObj.isAirBlock(i, j, k)) + { + this.worldObj.setBlock(i, j, k, Blocks.fire); + } + } + + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return false; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySnowball.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySnowball.java new file mode 100644 index 0000000..a230ade --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntitySnowball.java @@ -0,0 +1,55 @@ +package net.minecraft.entity.projectile; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class EntitySnowball extends EntityThrowable +{ + private static final String __OBFID = "CL_00001722"; + + public EntitySnowball(World p_i1773_1_) + { + super(p_i1773_1_); + } + + public EntitySnowball(World p_i1774_1_, EntityLivingBase p_i1774_2_) + { + super(p_i1774_1_, p_i1774_2_); + } + + public EntitySnowball(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) + { + super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70184_1_) + { + if (p_70184_1_.entityHit != null) + { + byte b0 = 0; + + if (p_70184_1_.entityHit instanceof EntityBlaze) + { + b0 = 3; + } + + p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0); + } + + for (int i = 0; i < 8; ++i) + { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityThrowable.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityThrowable.java new file mode 100644 index 0000000..1817b1a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityThrowable.java @@ -0,0 +1,349 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public abstract class EntityThrowable extends Entity implements IProjectile +{ + private int field_145788_c = -1; + private int field_145786_d = -1; + private int field_145787_e = -1; + private Block field_145785_f; + protected boolean inGround; + public int throwableShake; + /** The entity that threw this throwable item. */ + private EntityLivingBase thrower; + private String throwerName; + private int ticksInGround; + private int ticksInAir; + private static final String __OBFID = "CL_00001723"; + + public EntityThrowable(World p_i1776_1_) + { + super(p_i1776_1_); + this.setSize(0.25F, 0.25F); + } + + protected void entityInit() {} + + /** + * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge + * length * 64 * renderDistanceWeight Args: distance + */ + @SideOnly(Side.CLIENT) + public boolean isInRangeToRenderDist(double distance) + { + double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D; + d1 *= 64.0D; + return distance < d1 * d1; + } + + public EntityThrowable(World p_i1777_1_, EntityLivingBase p_i1777_2_) + { + super(p_i1777_1_); + this.thrower = p_i1777_2_; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(p_i1777_2_.posX, p_i1777_2_.posY + (double)p_i1777_2_.getEyeHeight(), p_i1777_2_.posZ, p_i1777_2_.rotationYaw, p_i1777_2_.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + float f = 0.4F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); + this.motionY = (double)(-MathHelper.sin((this.rotationPitch + this.func_70183_g()) / 180.0F * (float)Math.PI) * f); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F); + } + + public EntityThrowable(World p_i1778_1_, double p_i1778_2_, double p_i1778_4_, double p_i1778_6_) + { + super(p_i1778_1_); + this.ticksInGround = 0; + this.setSize(0.25F, 0.25F); + this.setPosition(p_i1778_2_, p_i1778_4_, p_i1778_6_); + this.yOffset = 0.0F; + } + + protected float func_70182_d() + { + return 1.5F; + } + + protected float func_70183_g() + { + return 0.0F; + } + + /** + * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. + */ + public void setThrowableHeading(double p_70186_1_, double p_70186_3_, double p_70186_5_, float p_70186_7_, float p_70186_8_) + { + float f2 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_3_ * p_70186_3_ + p_70186_5_ * p_70186_5_); + p_70186_1_ /= (double)f2; + p_70186_3_ /= (double)f2; + p_70186_5_ /= (double)f2; + p_70186_1_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_3_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_5_ += this.rand.nextGaussian() * 0.007499999832361937D * (double)p_70186_8_; + p_70186_1_ *= (double)p_70186_7_; + p_70186_3_ *= (double)p_70186_7_; + p_70186_5_ *= (double)p_70186_7_; + this.motionX = p_70186_1_; + this.motionY = p_70186_3_; + this.motionZ = p_70186_5_; + float f3 = MathHelper.sqrt_double(p_70186_1_ * p_70186_1_ + p_70186_5_ * p_70186_5_); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70186_1_, p_70186_5_) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70186_3_, (double)f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + @SideOnly(Side.CLIENT) + public void setVelocity(double x, double y, double z) + { + this.motionX = x; + this.motionY = y; + this.motionZ = z; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(x * x + z * z); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, (double)f) * 180.0D / Math.PI); + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + + if (this.throwableShake > 0) + { + --this.throwableShake; + } + + if (this.inGround) + { + if (this.worldObj.getBlock(this.field_145788_c, this.field_145786_d, this.field_145787_e) == this.field_145785_f) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + + return; + } + + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + else + { + ++this.ticksInAir; + } + + Vec3 vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); + vec3 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec31 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingobjectposition != null) + { + vec31 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + if (!this.worldObj.isRemote) + { + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + EntityLivingBase entitylivingbase = this.getThrower(); + + for (int j = 0; j < list.size(); ++j) + { + Entity entity1 = (Entity)list.get(j); + + if (entity1.canBeCollidedWith() && (entity1 != entitylivingbase || this.ticksInAir >= 5)) + { + float f = 0.3F; + AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)f); + MovingObjectPosition movingobjectposition1 = axisalignedbb.calculateIntercept(vec3, vec31); + + if (movingobjectposition1 != null) + { + double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d0 || d0 == 0.0D) + { + entity = entity1; + d0 = d1; + } + } + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + } + + if (movingobjectposition != null) + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && this.worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.portal) + { + this.setInPortal(); + } + else + { + this.onImpact(movingobjectposition); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + float f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f2 = 0.99F; + float f3 = this.getGravityVelocity(); + + if (this.isInWater()) + { + for (int i = 0; i < 4; ++i) + { + float f4 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ); + } + + f2 = 0.8F; + } + + this.motionX *= (double)f2; + this.motionY *= (double)f2; + this.motionZ *= (double)f2; + this.motionY -= (double)f3; + this.setPosition(this.posX, this.posY, this.posZ); + } + + /** + * Gets the amount of gravity to apply to the thrown entity with each tick. + */ + protected float getGravityVelocity() + { + return 0.03F; + } + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected abstract void onImpact(MovingObjectPosition p_70184_1_); + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound tagCompound) + { + tagCompound.setShort("xTile", (short)this.field_145788_c); + tagCompound.setShort("yTile", (short)this.field_145786_d); + tagCompound.setShort("zTile", (short)this.field_145787_e); + tagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.field_145785_f)); + tagCompound.setByte("shake", (byte)this.throwableShake); + tagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + + if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) + { + this.throwerName = this.thrower.getCommandSenderName(); + } + + tagCompound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound tagCompund) + { + this.field_145788_c = tagCompund.getShort("xTile"); + this.field_145786_d = tagCompund.getShort("yTile"); + this.field_145787_e = tagCompund.getShort("zTile"); + this.field_145785_f = Block.getBlockById(tagCompund.getByte("inTile") & 255); + this.throwableShake = tagCompund.getByte("shake") & 255; + this.inGround = tagCompund.getByte("inGround") == 1; + this.throwerName = tagCompund.getString("ownerName"); + + if (this.throwerName != null && this.throwerName.length() == 0) + { + this.throwerName = null; + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public EntityLivingBase getThrower() + { + if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) + { + this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + } + + return this.thrower; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityWitherSkull.java b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityWitherSkull.java new file mode 100644 index 0000000..3005bc4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/entity/projectile/EntityWitherSkull.java @@ -0,0 +1,149 @@ +package net.minecraft.entity.projectile; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class EntityWitherSkull extends EntityFireball +{ + private static final String __OBFID = "CL_00001728"; + + public EntityWitherSkull(World p_i1793_1_) + { + super(p_i1793_1_); + this.setSize(0.3125F, 0.3125F); + } + + public EntityWitherSkull(World p_i1794_1_, EntityLivingBase p_i1794_2_, double p_i1794_3_, double p_i1794_5_, double p_i1794_7_) + { + super(p_i1794_1_, p_i1794_2_, p_i1794_3_, p_i1794_5_, p_i1794_7_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Return the motion factor for this projectile. The factor is multiplied by the original motion. + */ + protected float getMotionFactor() + { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + + @SideOnly(Side.CLIENT) + public EntityWitherSkull(World p_i1795_1_, double p_i1795_2_, double p_i1795_4_, double p_i1795_6_, double p_i1795_8_, double p_i1795_10_, double p_i1795_12_) + { + super(p_i1795_1_, p_i1795_2_, p_i1795_4_, p_i1795_6_, p_i1795_8_, p_i1795_10_, p_i1795_12_); + this.setSize(0.3125F, 0.3125F); + } + + /** + * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. + */ + public boolean isBurning() + { + return false; + } + + public float func_145772_a(Explosion explosionIn, World worldIn, int x, int y, int z, Block blockIn) + { + float f = super.func_145772_a(explosionIn, worldIn, x, y, z, blockIn); + + if (this.isInvulnerable() && blockIn != Blocks.bedrock && blockIn != Blocks.end_portal && blockIn != Blocks.end_portal_frame && blockIn != Blocks.command_block) + { + f = Math.min(0.8F, f); + } + + return f; + } + + /** + * Called when this EntityFireball hits a block or entity. + */ + protected void onImpact(MovingObjectPosition p_70227_1_) + { + if (!this.worldObj.isRemote) + { + if (p_70227_1_.entityHit != null) + { + if (this.shootingEntity != null) + { + if (p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !p_70227_1_.entityHit.isEntityAlive()) + { + this.shootingEntity.heal(5.0F); + } + } + else + { + p_70227_1_.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); + } + + if (p_70227_1_.entityHit instanceof EntityLivingBase) + { + byte b0 = 0; + + if (this.worldObj.difficultySetting == EnumDifficulty.NORMAL) + { + b0 = 10; + } + else if (this.worldObj.difficultySetting == EnumDifficulty.HARD) + { + b0 = 40; + } + + if (b0 > 0) + { + ((EntityLivingBase)p_70227_1_.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * b0, 1)); + } + } + } + + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return false; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource source, float amount) + { + return false; + } + + protected void entityInit() + { + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + } + + /** + * Return whether this skull comes from an invulnerable (aura) wither boss. + */ + public boolean isInvulnerable() + { + return this.dataWatcher.getWatchableObjectByte(10) == 1; + } + + /** + * Set whether this skull comes from an invulnerable (aura) wither boss. + */ + public void setInvulnerable(boolean p_82343_1_) + { + this.dataWatcher.updateObject(10, Byte.valueOf((byte)(p_82343_1_ ? 1 : 0))); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/event/ClickEvent.java b/build/rfg/minecraft-src/java/net/minecraft/event/ClickEvent.java new file mode 100644 index 0000000..629c2e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/event/ClickEvent.java @@ -0,0 +1,140 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; + +public class ClickEvent +{ + private final ClickEvent.Action action; + private final String value; + private static final String __OBFID = "CL_00001260"; + + public ClickEvent(ClickEvent.Action p_i45156_1_, String p_i45156_2_) + { + this.action = p_i45156_1_; + this.value = p_i45156_2_; + } + + /** + * Gets the action to perform when this event is raised. + */ + public ClickEvent.Action getAction() + { + return this.action; + } + + /** + * Gets the value to perform the action on when this event is raised. For example, if the action is "open URL", + * this would be the URL to open. + */ + public String getValue() + { + return this.value; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + ClickEvent clickevent = (ClickEvent)p_equals_1_; + + if (this.action != clickevent.action) + { + return false; + } + else + { + if (this.value != null) + { + if (!this.value.equals(clickevent.value)) + { + return false; + } + } + else if (clickevent.value != null) + { + return false; + } + + return true; + } + } + else + { + return false; + } + } + + public String toString() + { + return "ClickEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() + { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action + { + OPEN_URL("open_url", true), + OPEN_FILE("open_file", false), + RUN_COMMAND("run_command", true), + TWITCH_USER_INFO("twitch_user_info", false), + SUGGEST_COMMAND("suggest_command", true); + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + /** The canonical name used to refer to this action. */ + private final String canonicalName; + + private static final String __OBFID = "CL_00001261"; + + private Action(String p_i45155_3_, boolean p_i45155_4_) + { + this.canonicalName = p_i45155_3_; + this.allowedInChat = p_i45155_4_; + } + + /** + * Indicates whether this event can be run from chat text. + */ + public boolean shouldAllowInChat() + { + return this.allowedInChat; + } + + /** + * Gets the canonical name for this action (e.g., "run_command") + */ + public String getCanonicalName() + { + return this.canonicalName; + } + + /** + * Gets a value by its canonical name. + */ + public static ClickEvent.Action getValueByCanonicalName(String p_150672_0_) + { + return (ClickEvent.Action)nameMapping.get(p_150672_0_); + } + + static + { + ClickEvent.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + ClickEvent.Action var3 = var0[var2]; + nameMapping.put(var3.getCanonicalName(), var3); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/event/HoverEvent.java b/build/rfg/minecraft-src/java/net/minecraft/event/HoverEvent.java new file mode 100644 index 0000000..06f9c40 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/event/HoverEvent.java @@ -0,0 +1,138 @@ +package net.minecraft.event; + +import com.google.common.collect.Maps; +import java.util.Map; +import net.minecraft.util.IChatComponent; + +public class HoverEvent +{ + private final HoverEvent.Action action; + private final IChatComponent value; + private static final String __OBFID = "CL_00001264"; + + public HoverEvent(HoverEvent.Action p_i45158_1_, IChatComponent p_i45158_2_) + { + this.action = p_i45158_1_; + this.value = p_i45158_2_; + } + + /** + * Gets the action to perform when this event is raised. + */ + public HoverEvent.Action getAction() + { + return this.action; + } + + /** + * Gets the value to perform the action on when this event is raised. For example, if the action is "show item", + * this would be the item to show. + */ + public IChatComponent getValue() + { + return this.value; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + HoverEvent hoverevent = (HoverEvent)p_equals_1_; + + if (this.action != hoverevent.action) + { + return false; + } + else + { + if (this.value != null) + { + if (!this.value.equals(hoverevent.value)) + { + return false; + } + } + else if (hoverevent.value != null) + { + return false; + } + + return true; + } + } + else + { + return false; + } + } + + public String toString() + { + return "HoverEvent{action=" + this.action + ", value=\'" + this.value + '\'' + '}'; + } + + public int hashCode() + { + int i = this.action.hashCode(); + i = 31 * i + (this.value != null ? this.value.hashCode() : 0); + return i; + } + + public static enum Action + { + SHOW_TEXT("show_text", true), + SHOW_ACHIEVEMENT("show_achievement", true), + SHOW_ITEM("show_item", true); + private static final Map nameMapping = Maps.newHashMap(); + private final boolean allowedInChat; + private final String canonicalName; + + private static final String __OBFID = "CL_00001265"; + + private Action(String p_i45157_3_, boolean p_i45157_4_) + { + this.canonicalName = p_i45157_3_; + this.allowedInChat = p_i45157_4_; + } + + /** + * Indicates whether this event can be run from chat text. + */ + public boolean shouldAllowInChat() + { + return this.allowedInChat; + } + + /** + * Gets the canonical name for this action (e.g., "show_achievement") + */ + public String getCanonicalName() + { + return this.canonicalName; + } + + /** + * Gets a value by its canonical name. + */ + public static HoverEvent.Action getValueByCanonicalName(String p_150684_0_) + { + return (HoverEvent.Action)nameMapping.get(p_150684_0_); + } + + static + { + HoverEvent.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + HoverEvent.Action var3 = var0[var2]; + nameMapping.put(var3.getCanonicalName(), var3); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/init/Blocks.java b/build/rfg/minecraft-src/java/net/minecraft/init/Blocks.java new file mode 100644 index 0000000..a660fe0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/init/Blocks.java @@ -0,0 +1,206 @@ +package net.minecraft.init; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBeacon; +import net.minecraft.block.BlockBush; +import net.minecraft.block.BlockCauldron; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockDaylightDetector; +import net.minecraft.block.BlockDeadBush; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFire; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockGrass; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockMycelium; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockPistonMoving; +import net.minecraft.block.BlockPortal; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockRedstoneWire; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.BlockStainedGlassPane; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.BlockTripWireHook; + +public class Blocks +{ + public static final Block air = (Block)Block.blockRegistry.getObject("air"); + public static final Block stone = (Block)Block.blockRegistry.getObject("stone"); + public static final BlockGrass grass = (BlockGrass)Block.blockRegistry.getObject("grass"); + public static final Block dirt = (Block)Block.blockRegistry.getObject("dirt"); + public static final Block cobblestone = (Block)Block.blockRegistry.getObject("cobblestone"); + public static final Block planks = (Block)Block.blockRegistry.getObject("planks"); + public static final Block sapling = (Block)Block.blockRegistry.getObject("sapling"); + public static final Block bedrock = (Block)Block.blockRegistry.getObject("bedrock"); + public static final BlockLiquid flowing_water = (BlockLiquid)Block.blockRegistry.getObject("flowing_water"); + public static final Block water = (Block)Block.blockRegistry.getObject("water"); + public static final BlockLiquid flowing_lava = (BlockLiquid)Block.blockRegistry.getObject("flowing_lava"); + public static final Block lava = (Block)Block.blockRegistry.getObject("lava"); + public static final BlockSand sand = (BlockSand)Block.blockRegistry.getObject("sand"); + public static final Block gravel = (Block)Block.blockRegistry.getObject("gravel"); + public static final Block gold_ore = (Block)Block.blockRegistry.getObject("gold_ore"); + public static final Block iron_ore = (Block)Block.blockRegistry.getObject("iron_ore"); + public static final Block coal_ore = (Block)Block.blockRegistry.getObject("coal_ore"); + public static final Block log = (Block)Block.blockRegistry.getObject("log"); + public static final Block log2 = (Block)Block.blockRegistry.getObject("log2"); + public static final BlockLeaves leaves = (BlockLeaves)Block.blockRegistry.getObject("leaves"); + public static final BlockLeaves leaves2 = (BlockLeaves)Block.blockRegistry.getObject("leaves2"); + public static final Block sponge = (Block)Block.blockRegistry.getObject("sponge"); + public static final Block glass = (Block)Block.blockRegistry.getObject("glass"); + public static final Block lapis_ore = (Block)Block.blockRegistry.getObject("lapis_ore"); + public static final Block lapis_block = (Block)Block.blockRegistry.getObject("lapis_block"); + public static final Block dispenser = (Block)Block.blockRegistry.getObject("dispenser"); + public static final Block sandstone = (Block)Block.blockRegistry.getObject("sandstone"); + public static final Block noteblock = (Block)Block.blockRegistry.getObject("noteblock"); + public static final Block bed = (Block)Block.blockRegistry.getObject("bed"); + public static final Block golden_rail = (Block)Block.blockRegistry.getObject("golden_rail"); + public static final Block detector_rail = (Block)Block.blockRegistry.getObject("detector_rail"); + public static final BlockPistonBase sticky_piston = (BlockPistonBase)Block.blockRegistry.getObject("sticky_piston"); + public static final Block web = (Block)Block.blockRegistry.getObject("web"); + public static final BlockTallGrass tallgrass = (BlockTallGrass)Block.blockRegistry.getObject("tallgrass"); + public static final BlockDeadBush deadbush = (BlockDeadBush)Block.blockRegistry.getObject("deadbush"); + public static final BlockPistonBase piston = (BlockPistonBase)Block.blockRegistry.getObject("piston"); + public static final BlockPistonExtension piston_head = (BlockPistonExtension)Block.blockRegistry.getObject("piston_head"); + public static final Block wool = (Block)Block.blockRegistry.getObject("wool"); + public static final BlockPistonMoving piston_extension = (BlockPistonMoving)Block.blockRegistry.getObject("piston_extension"); + public static final BlockFlower yellow_flower = (BlockFlower)Block.blockRegistry.getObject("yellow_flower"); + public static final BlockFlower red_flower = (BlockFlower)Block.blockRegistry.getObject("red_flower"); + public static final BlockBush brown_mushroom = (BlockBush)Block.blockRegistry.getObject("brown_mushroom"); + public static final BlockBush red_mushroom = (BlockBush)Block.blockRegistry.getObject("red_mushroom"); + public static final Block gold_block = (Block)Block.blockRegistry.getObject("gold_block"); + public static final Block iron_block = (Block)Block.blockRegistry.getObject("iron_block"); + public static final BlockSlab double_stone_slab = (BlockSlab)Block.blockRegistry.getObject("double_stone_slab"); + public static final BlockSlab stone_slab = (BlockSlab)Block.blockRegistry.getObject("stone_slab"); + public static final Block brick_block = (Block)Block.blockRegistry.getObject("brick_block"); + public static final Block tnt = (Block)Block.blockRegistry.getObject("tnt"); + public static final Block bookshelf = (Block)Block.blockRegistry.getObject("bookshelf"); + public static final Block mossy_cobblestone = (Block)Block.blockRegistry.getObject("mossy_cobblestone"); + public static final Block obsidian = (Block)Block.blockRegistry.getObject("obsidian"); + public static final Block torch = (Block)Block.blockRegistry.getObject("torch"); + public static final BlockFire fire = (BlockFire)Block.blockRegistry.getObject("fire"); + public static final Block mob_spawner = (Block)Block.blockRegistry.getObject("mob_spawner"); + public static final Block oak_stairs = (Block)Block.blockRegistry.getObject("oak_stairs"); + public static final BlockChest chest = (BlockChest)Block.blockRegistry.getObject("chest"); + public static final BlockRedstoneWire redstone_wire = (BlockRedstoneWire)Block.blockRegistry.getObject("redstone_wire"); + public static final Block diamond_ore = (Block)Block.blockRegistry.getObject("diamond_ore"); + public static final Block diamond_block = (Block)Block.blockRegistry.getObject("diamond_block"); + public static final Block crafting_table = (Block)Block.blockRegistry.getObject("crafting_table"); + public static final Block wheat = (Block)Block.blockRegistry.getObject("wheat"); + public static final Block farmland = (Block)Block.blockRegistry.getObject("farmland"); + public static final Block furnace = (Block)Block.blockRegistry.getObject("furnace"); + public static final Block lit_furnace = (Block)Block.blockRegistry.getObject("lit_furnace"); + public static final Block standing_sign = (Block)Block.blockRegistry.getObject("standing_sign"); + public static final Block wooden_door = (Block)Block.blockRegistry.getObject("wooden_door"); + public static final Block ladder = (Block)Block.blockRegistry.getObject("ladder"); + public static final Block rail = (Block)Block.blockRegistry.getObject("rail"); + public static final Block stone_stairs = (Block)Block.blockRegistry.getObject("stone_stairs"); + public static final Block wall_sign = (Block)Block.blockRegistry.getObject("wall_sign"); + public static final Block lever = (Block)Block.blockRegistry.getObject("lever"); + public static final Block stone_pressure_plate = (Block)Block.blockRegistry.getObject("stone_pressure_plate"); + public static final Block iron_door = (Block)Block.blockRegistry.getObject("iron_door"); + public static final Block wooden_pressure_plate = (Block)Block.blockRegistry.getObject("wooden_pressure_plate"); + public static final Block redstone_ore = (Block)Block.blockRegistry.getObject("redstone_ore"); + public static final Block lit_redstone_ore = (Block)Block.blockRegistry.getObject("lit_redstone_ore"); + public static final Block unlit_redstone_torch = (Block)Block.blockRegistry.getObject("unlit_redstone_torch"); + public static final Block redstone_torch = (Block)Block.blockRegistry.getObject("redstone_torch"); + public static final Block stone_button = (Block)Block.blockRegistry.getObject("stone_button"); + public static final Block snow_layer = (Block)Block.blockRegistry.getObject("snow_layer"); + public static final Block ice = (Block)Block.blockRegistry.getObject("ice"); + public static final Block snow = (Block)Block.blockRegistry.getObject("snow"); + public static final Block cactus = (Block)Block.blockRegistry.getObject("cactus"); + public static final Block clay = (Block)Block.blockRegistry.getObject("clay"); + public static final Block reeds = (Block)Block.blockRegistry.getObject("reeds"); + public static final Block jukebox = (Block)Block.blockRegistry.getObject("jukebox"); + public static final Block fence = (Block)Block.blockRegistry.getObject("fence"); + public static final Block pumpkin = (Block)Block.blockRegistry.getObject("pumpkin"); + public static final Block netherrack = (Block)Block.blockRegistry.getObject("netherrack"); + public static final Block soul_sand = (Block)Block.blockRegistry.getObject("soul_sand"); + public static final Block glowstone = (Block)Block.blockRegistry.getObject("glowstone"); + public static final BlockPortal portal = (BlockPortal)Block.blockRegistry.getObject("portal"); + public static final Block lit_pumpkin = (Block)Block.blockRegistry.getObject("lit_pumpkin"); + public static final Block cake = (Block)Block.blockRegistry.getObject("cake"); + public static final BlockRedstoneRepeater unpowered_repeater = (BlockRedstoneRepeater)Block.blockRegistry.getObject("unpowered_repeater"); + public static final BlockRedstoneRepeater powered_repeater = (BlockRedstoneRepeater)Block.blockRegistry.getObject("powered_repeater"); + public static final Block trapdoor = (Block)Block.blockRegistry.getObject("trapdoor"); + public static final Block monster_egg = (Block)Block.blockRegistry.getObject("monster_egg"); + public static final Block stonebrick = (Block)Block.blockRegistry.getObject("stonebrick"); + public static final Block brown_mushroom_block = (Block)Block.blockRegistry.getObject("brown_mushroom_block"); + public static final Block red_mushroom_block = (Block)Block.blockRegistry.getObject("red_mushroom_block"); + public static final Block iron_bars = (Block)Block.blockRegistry.getObject("iron_bars"); + public static final Block glass_pane = (Block)Block.blockRegistry.getObject("glass_pane"); + public static final Block melon_block = (Block)Block.blockRegistry.getObject("melon_block"); + public static final Block pumpkin_stem = (Block)Block.blockRegistry.getObject("pumpkin_stem"); + public static final Block melon_stem = (Block)Block.blockRegistry.getObject("melon_stem"); + public static final Block vine = (Block)Block.blockRegistry.getObject("vine"); + public static final Block fence_gate = (Block)Block.blockRegistry.getObject("fence_gate"); + public static final Block brick_stairs = (Block)Block.blockRegistry.getObject("brick_stairs"); + public static final Block stone_brick_stairs = (Block)Block.blockRegistry.getObject("stone_brick_stairs"); + public static final BlockMycelium mycelium = (BlockMycelium)Block.blockRegistry.getObject("mycelium"); + public static final Block waterlily = (Block)Block.blockRegistry.getObject("waterlily"); + public static final Block nether_brick = (Block)Block.blockRegistry.getObject("nether_brick"); + public static final Block nether_brick_fence = (Block)Block.blockRegistry.getObject("nether_brick_fence"); + public static final Block nether_brick_stairs = (Block)Block.blockRegistry.getObject("nether_brick_stairs"); + public static final Block nether_wart = (Block)Block.blockRegistry.getObject("nether_wart"); + public static final Block enchanting_table = (Block)Block.blockRegistry.getObject("enchanting_table"); + public static final Block brewing_stand = (Block)Block.blockRegistry.getObject("brewing_stand"); + public static final BlockCauldron cauldron = (BlockCauldron)Block.blockRegistry.getObject("cauldron"); + public static final Block end_portal = (Block)Block.blockRegistry.getObject("end_portal"); + public static final Block end_portal_frame = (Block)Block.blockRegistry.getObject("end_portal_frame"); + public static final Block end_stone = (Block)Block.blockRegistry.getObject("end_stone"); + public static final Block dragon_egg = (Block)Block.blockRegistry.getObject("dragon_egg"); + public static final Block redstone_lamp = (Block)Block.blockRegistry.getObject("redstone_lamp"); + public static final Block lit_redstone_lamp = (Block)Block.blockRegistry.getObject("lit_redstone_lamp"); + public static final BlockSlab double_wooden_slab = (BlockSlab)Block.blockRegistry.getObject("double_wooden_slab"); + public static final BlockSlab wooden_slab = (BlockSlab)Block.blockRegistry.getObject("wooden_slab"); + public static final Block cocoa = (Block)Block.blockRegistry.getObject("cocoa"); + public static final Block sandstone_stairs = (Block)Block.blockRegistry.getObject("sandstone_stairs"); + public static final Block emerald_ore = (Block)Block.blockRegistry.getObject("emerald_ore"); + public static final Block ender_chest = (Block)Block.blockRegistry.getObject("ender_chest"); + public static final BlockTripWireHook tripwire_hook = (BlockTripWireHook)Block.blockRegistry.getObject("tripwire_hook"); + public static final Block tripwire = (Block)Block.blockRegistry.getObject("tripwire"); + public static final Block emerald_block = (Block)Block.blockRegistry.getObject("emerald_block"); + public static final Block spruce_stairs = (Block)Block.blockRegistry.getObject("spruce_stairs"); + public static final Block birch_stairs = (Block)Block.blockRegistry.getObject("birch_stairs"); + public static final Block jungle_stairs = (Block)Block.blockRegistry.getObject("jungle_stairs"); + public static final Block command_block = (Block)Block.blockRegistry.getObject("command_block"); + public static final BlockBeacon beacon = (BlockBeacon)Block.blockRegistry.getObject("beacon"); + public static final Block cobblestone_wall = (Block)Block.blockRegistry.getObject("cobblestone_wall"); + public static final Block flower_pot = (Block)Block.blockRegistry.getObject("flower_pot"); + public static final Block carrots = (Block)Block.blockRegistry.getObject("carrots"); + public static final Block potatoes = (Block)Block.blockRegistry.getObject("potatoes"); + public static final Block wooden_button = (Block)Block.blockRegistry.getObject("wooden_button"); + public static final Block skull = (Block)Block.blockRegistry.getObject("skull"); + public static final Block anvil = (Block)Block.blockRegistry.getObject("anvil"); + public static final Block trapped_chest = (Block)Block.blockRegistry.getObject("trapped_chest"); + public static final Block light_weighted_pressure_plate = (Block)Block.blockRegistry.getObject("light_weighted_pressure_plate"); + public static final Block heavy_weighted_pressure_plate = (Block)Block.blockRegistry.getObject("heavy_weighted_pressure_plate"); + public static final BlockRedstoneComparator unpowered_comparator = (BlockRedstoneComparator)Block.blockRegistry.getObject("unpowered_comparator"); + public static final BlockRedstoneComparator powered_comparator = (BlockRedstoneComparator)Block.blockRegistry.getObject("powered_comparator"); + public static final BlockDaylightDetector daylight_detector = (BlockDaylightDetector)Block.blockRegistry.getObject("daylight_detector"); + public static final Block redstone_block = (Block)Block.blockRegistry.getObject("redstone_block"); + public static final Block quartz_ore = (Block)Block.blockRegistry.getObject("quartz_ore"); + public static final BlockHopper hopper = (BlockHopper)Block.blockRegistry.getObject("hopper"); + public static final Block quartz_block = (Block)Block.blockRegistry.getObject("quartz_block"); + public static final Block quartz_stairs = (Block)Block.blockRegistry.getObject("quartz_stairs"); + public static final Block activator_rail = (Block)Block.blockRegistry.getObject("activator_rail"); + public static final Block dropper = (Block)Block.blockRegistry.getObject("dropper"); + public static final Block stained_hardened_clay = (Block)Block.blockRegistry.getObject("stained_hardened_clay"); + public static final Block hay_block = (Block)Block.blockRegistry.getObject("hay_block"); + public static final Block carpet = (Block)Block.blockRegistry.getObject("carpet"); + public static final Block hardened_clay = (Block)Block.blockRegistry.getObject("hardened_clay"); + public static final Block coal_block = (Block)Block.blockRegistry.getObject("coal_block"); + public static final Block packed_ice = (Block)Block.blockRegistry.getObject("packed_ice"); + public static final Block acacia_stairs = (Block)Block.blockRegistry.getObject("acacia_stairs"); + public static final Block dark_oak_stairs = (Block)Block.blockRegistry.getObject("dark_oak_stairs"); + public static final BlockDoublePlant double_plant = (BlockDoublePlant)Block.blockRegistry.getObject("double_plant"); + public static final BlockStainedGlass stained_glass = (BlockStainedGlass)Block.blockRegistry.getObject("stained_glass"); + public static final BlockStainedGlassPane stained_glass_pane = (BlockStainedGlassPane)Block.blockRegistry.getObject("stained_glass_pane"); + private static final String __OBFID = "CL_00000204"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/init/Bootstrap.java b/build/rfg/minecraft-src/java/net/minecraft/init/Bootstrap.java new file mode 100644 index 0000000..312ba6c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/init/Bootstrap.java @@ -0,0 +1,464 @@ +package net.minecraft.init; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockFire; +import net.minecraft.block.material.Material; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.BehaviorProjectileDispense; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.entity.projectile.EntitySmallFireball; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemMonsterPlacer; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class Bootstrap +{ + private static boolean field_151355_a = false; + private static final String __OBFID = "CL_00001397"; + + static void func_151353_a() + { + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.arrow, new BehaviorProjectileDispense() + { + private static final String __OBFID = "CL_00001398"; + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + EntityArrow entityarrow = new EntityArrow(worldIn, position.getX(), position.getY(), position.getZ()); + entityarrow.canBePickedUp = 1; + return entityarrow; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.egg, new BehaviorProjectileDispense() + { + private static final String __OBFID = "CL_00001404"; + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityEgg(worldIn, position.getX(), position.getY(), position.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.snowball, new BehaviorProjectileDispense() + { + private static final String __OBFID = "CL_00001405"; + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntitySnowball(worldIn, position.getX(), position.getY(), position.getZ()); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.experience_bottle, new BehaviorProjectileDispense() + { + private static final String __OBFID = "CL_00001406"; + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityExpBottle(worldIn, position.getX(), position.getY(), position.getZ()); + } + protected float func_82498_a() + { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() + { + return super.func_82500_b() * 1.25F; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.potionitem, new IBehaviorDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150843_b = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00001407"; + /** + * Dispenses the specified ItemStack from a dispenser. + */ + public ItemStack dispense(IBlockSource source, final ItemStack stack) + { + return ItemPotion.isSplash(stack.getItemDamage()) ? (new BehaviorProjectileDispense() + { + private static final String __OBFID = "CL_00001408"; + /** + * Return the projectile entity spawned by this dispense behavior. + */ + protected IProjectile getProjectileEntity(World worldIn, IPosition position) + { + return new EntityPotion(worldIn, position.getX(), position.getY(), position.getZ(), stack.copy()); + } + protected float func_82498_a() + { + return super.func_82498_a() * 0.5F; + } + protected float func_82500_b() + { + return super.func_82500_b() * 1.25F; + } + }).dispense(source, stack): this.field_150843_b.dispense(source, stack); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.spawn_egg, new BehaviorDefaultDispenseItem() + { + private static final String __OBFID = "CL_00001410"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); + double d1 = (double)((float)source.getYInt() + 0.2F); + double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); + Entity entity = ItemMonsterPlacer.spawnCreature(source.getWorld(), stack.getItemDamage(), d0, d1, d2); + + if (entity instanceof EntityLivingBase && stack.hasDisplayName()) + { + ((EntityLiving)entity).setCustomNameTag(stack.getDisplayName()); + } + + stack.splitStack(1); + return stack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fireworks, new BehaviorDefaultDispenseItem() + { + private static final String __OBFID = "CL_00001411"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + double d0 = source.getX() + (double)enumfacing.getFrontOffsetX(); + double d1 = (double)((float)source.getYInt() + 0.2F); + double d2 = source.getZ() + (double)enumfacing.getFrontOffsetZ(); + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(source.getWorld(), d0, d1, d2, stack); + source.getWorld().spawnEntityInWorld(entityfireworkrocket); + stack.splitStack(1); + return stack; + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1002, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.fire_charge, new BehaviorDefaultDispenseItem() + { + private static final String __OBFID = "CL_00001412"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + IPosition iposition = BlockDispenser.func_149939_a(source); + double d0 = iposition.getX() + (double)((float)enumfacing.getFrontOffsetX() * 0.3F); + double d1 = iposition.getY() + (double)((float)enumfacing.getFrontOffsetX() * 0.3F); + double d2 = iposition.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 0.3F); + World world = source.getWorld(); + Random random = world.rand; + double d3 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetX(); + double d4 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetY(); + double d5 = random.nextGaussian() * 0.05D + (double)enumfacing.getFrontOffsetZ(); + world.spawnEntityInWorld(new EntitySmallFireball(world, d0, d1, d2, d3, d4, d5)); + stack.splitStack(1); + return stack; + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1009, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.boat, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150842_b = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00001413"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + double d0 = source.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F); + double d1 = source.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F); + double d2 = source.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + Material material = world.getBlock(i, j, k).getMaterial(); + double d3; + + if (Material.water.equals(material)) + { + d3 = 1.0D; + } + else + { + if (!Material.air.equals(material) || !Material.water.equals(world.getBlock(i, j - 1, k).getMaterial())) + { + return this.field_150842_b.dispense(source, stack); + } + + d3 = 0.0D; + } + + EntityBoat entityboat = new EntityBoat(world, d0, d1 + d3, d2); + world.spawnEntityInWorld(entityboat); + stack.splitStack(1); + return stack; + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + }); + BehaviorDefaultDispenseItem behaviordefaultdispenseitem = new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150841_b = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00001399"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + ItemBucket itembucket = (ItemBucket)stack.getItem(); + int i = source.getXInt(); + int j = source.getYInt(); + int k = source.getZInt(); + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + + if (itembucket.tryPlaceContainedLiquid(source.getWorld(), i + enumfacing.getFrontOffsetX(), j + enumfacing.getFrontOffsetY(), k + enumfacing.getFrontOffsetZ())) + { + stack.func_150996_a(Items.bucket); + stack.stackSize = 1; + return stack; + } + else + { + return this.field_150841_b.dispense(source, stack); + } + } + }; + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.lava_bucket, behaviordefaultdispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.water_bucket, behaviordefaultdispenseitem); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.bucket, new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem field_150840_b = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00001400"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + Material material = world.getBlock(i, j, k).getMaterial(); + int l = world.getBlockMetadata(i, j, k); + Item item; + + if (Material.water.equals(material) && l == 0) + { + item = Items.water_bucket; + } + else + { + if (!Material.lava.equals(material) || l != 0) + { + return super.dispenseStack(source, stack); + } + + item = Items.lava_bucket; + } + + world.setBlockToAir(i, j, k); + + if (--stack.stackSize == 0) + { + stack.func_150996_a(item); + stack.stackSize = 1; + } + else if (((TileEntityDispenser)source.getBlockTileEntity()).func_146019_a(new ItemStack(item)) < 0) + { + this.field_150840_b.dispense(source, new ItemStack(item)); + } + + return stack; + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.flint_and_steel, new BehaviorDefaultDispenseItem() + { + private boolean field_150839_b = true; + private static final String __OBFID = "CL_00001401"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + + if (world.isAirBlock(i, j, k)) + { + world.setBlock(i, j, k, Blocks.fire); + + if (stack.attemptDamageItem(1, world.rand)) + { + stack.stackSize = 0; + } + } + else if (world.getBlock(i, j, k) == Blocks.tnt) + { + Blocks.tnt.onBlockDestroyedByPlayer(world, i, j, k, 1); + world.setBlockToAir(i, j, k); + } + else + { + this.field_150839_b = false; + } + + return stack; + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + if (this.field_150839_b) + { + source.getWorld().playAuxSFX(1000, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Items.dye, new BehaviorDefaultDispenseItem() + { + private boolean field_150838_b = true; + private static final String __OBFID = "CL_00001402"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + if (stack.getItemDamage() == 15) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + + if (ItemDye.func_150919_a(stack, world, i, j, k)) + { + if (!world.isRemote) + { + world.playAuxSFX(2005, i, j, k, 0); + } + } + else + { + this.field_150838_b = false; + } + + return stack; + } + else + { + return super.dispenseStack(source, stack); + } + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + if (this.field_150838_b) + { + source.getWorld().playAuxSFX(1000, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + else + { + source.getWorld().playAuxSFX(1001, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + } + }); + BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.tnt), new BehaviorDefaultDispenseItem() + { + private static final String __OBFID = "CL_00001403"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), (EntityLivingBase)null); + world.spawnEntityInWorld(entitytntprimed); + --stack.stackSize; + return stack; + } + }); + } + + public static void func_151354_b() + { + if (!field_151355_a) + { + field_151355_a = true; + Block.registerBlocks(); + BlockFire.func_149843_e(); + Item.registerItems(); + StatList.func_151178_a(); + func_151353_a(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/init/Items.java b/build/rfg/minecraft-src/java/net/minecraft/init/Items.java new file mode 100644 index 0000000..09b4b95 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/init/Items.java @@ -0,0 +1,187 @@ +package net.minecraft.init; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemEmptyMap; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemShears; + +public class Items +{ + public static final Item iron_shovel = (Item)Item.itemRegistry.getObject("iron_shovel"); + public static final Item iron_pickaxe = (Item)Item.itemRegistry.getObject("iron_pickaxe"); + public static final Item iron_axe = (Item)Item.itemRegistry.getObject("iron_axe"); + public static final Item flint_and_steel = (Item)Item.itemRegistry.getObject("flint_and_steel"); + public static final Item apple = (Item)Item.itemRegistry.getObject("apple"); + public static final ItemBow bow = (ItemBow)Item.itemRegistry.getObject("bow"); + public static final Item arrow = (Item)Item.itemRegistry.getObject("arrow"); + public static final Item coal = (Item)Item.itemRegistry.getObject("coal"); + public static final Item diamond = (Item)Item.itemRegistry.getObject("diamond"); + public static final Item iron_ingot = (Item)Item.itemRegistry.getObject("iron_ingot"); + public static final Item gold_ingot = (Item)Item.itemRegistry.getObject("gold_ingot"); + public static final Item iron_sword = (Item)Item.itemRegistry.getObject("iron_sword"); + public static final Item wooden_sword = (Item)Item.itemRegistry.getObject("wooden_sword"); + public static final Item wooden_shovel = (Item)Item.itemRegistry.getObject("wooden_shovel"); + public static final Item wooden_pickaxe = (Item)Item.itemRegistry.getObject("wooden_pickaxe"); + public static final Item wooden_axe = (Item)Item.itemRegistry.getObject("wooden_axe"); + public static final Item stone_sword = (Item)Item.itemRegistry.getObject("stone_sword"); + public static final Item stone_shovel = (Item)Item.itemRegistry.getObject("stone_shovel"); + public static final Item stone_pickaxe = (Item)Item.itemRegistry.getObject("stone_pickaxe"); + public static final Item stone_axe = (Item)Item.itemRegistry.getObject("stone_axe"); + public static final Item diamond_sword = (Item)Item.itemRegistry.getObject("diamond_sword"); + public static final Item diamond_shovel = (Item)Item.itemRegistry.getObject("diamond_shovel"); + public static final Item diamond_pickaxe = (Item)Item.itemRegistry.getObject("diamond_pickaxe"); + public static final Item diamond_axe = (Item)Item.itemRegistry.getObject("diamond_axe"); + public static final Item stick = (Item)Item.itemRegistry.getObject("stick"); + public static final Item bowl = (Item)Item.itemRegistry.getObject("bowl"); + public static final Item mushroom_stew = (Item)Item.itemRegistry.getObject("mushroom_stew"); + public static final Item golden_sword = (Item)Item.itemRegistry.getObject("golden_sword"); + public static final Item golden_shovel = (Item)Item.itemRegistry.getObject("golden_shovel"); + public static final Item golden_pickaxe = (Item)Item.itemRegistry.getObject("golden_pickaxe"); + public static final Item golden_axe = (Item)Item.itemRegistry.getObject("golden_axe"); + public static final Item string = (Item)Item.itemRegistry.getObject("string"); + public static final Item feather = (Item)Item.itemRegistry.getObject("feather"); + public static final Item gunpowder = (Item)Item.itemRegistry.getObject("gunpowder"); + public static final Item wooden_hoe = (Item)Item.itemRegistry.getObject("wooden_hoe"); + public static final Item stone_hoe = (Item)Item.itemRegistry.getObject("stone_hoe"); + public static final Item iron_hoe = (Item)Item.itemRegistry.getObject("iron_hoe"); + public static final Item diamond_hoe = (Item)Item.itemRegistry.getObject("diamond_hoe"); + public static final Item golden_hoe = (Item)Item.itemRegistry.getObject("golden_hoe"); + public static final Item wheat_seeds = (Item)Item.itemRegistry.getObject("wheat_seeds"); + public static final Item wheat = (Item)Item.itemRegistry.getObject("wheat"); + public static final Item bread = (Item)Item.itemRegistry.getObject("bread"); + public static final ItemArmor leather_helmet = (ItemArmor)Item.itemRegistry.getObject("leather_helmet"); + public static final ItemArmor leather_chestplate = (ItemArmor)Item.itemRegistry.getObject("leather_chestplate"); + public static final ItemArmor leather_leggings = (ItemArmor)Item.itemRegistry.getObject("leather_leggings"); + public static final ItemArmor leather_boots = (ItemArmor)Item.itemRegistry.getObject("leather_boots"); + public static final ItemArmor chainmail_helmet = (ItemArmor)Item.itemRegistry.getObject("chainmail_helmet"); + public static final ItemArmor chainmail_chestplate = (ItemArmor)Item.itemRegistry.getObject("chainmail_chestplate"); + public static final ItemArmor chainmail_leggings = (ItemArmor)Item.itemRegistry.getObject("chainmail_leggings"); + public static final ItemArmor chainmail_boots = (ItemArmor)Item.itemRegistry.getObject("chainmail_boots"); + public static final ItemArmor iron_helmet = (ItemArmor)Item.itemRegistry.getObject("iron_helmet"); + public static final ItemArmor iron_chestplate = (ItemArmor)Item.itemRegistry.getObject("iron_chestplate"); + public static final ItemArmor iron_leggings = (ItemArmor)Item.itemRegistry.getObject("iron_leggings"); + public static final ItemArmor iron_boots = (ItemArmor)Item.itemRegistry.getObject("iron_boots"); + public static final ItemArmor diamond_helmet = (ItemArmor)Item.itemRegistry.getObject("diamond_helmet"); + public static final ItemArmor diamond_chestplate = (ItemArmor)Item.itemRegistry.getObject("diamond_chestplate"); + public static final ItemArmor diamond_leggings = (ItemArmor)Item.itemRegistry.getObject("diamond_leggings"); + public static final ItemArmor diamond_boots = (ItemArmor)Item.itemRegistry.getObject("diamond_boots"); + public static final ItemArmor golden_helmet = (ItemArmor)Item.itemRegistry.getObject("golden_helmet"); + public static final ItemArmor golden_chestplate = (ItemArmor)Item.itemRegistry.getObject("golden_chestplate"); + public static final ItemArmor golden_leggings = (ItemArmor)Item.itemRegistry.getObject("golden_leggings"); + public static final ItemArmor golden_boots = (ItemArmor)Item.itemRegistry.getObject("golden_boots"); + public static final Item flint = (Item)Item.itemRegistry.getObject("flint"); + public static final Item porkchop = (Item)Item.itemRegistry.getObject("porkchop"); + public static final Item cooked_porkchop = (Item)Item.itemRegistry.getObject("cooked_porkchop"); + public static final Item painting = (Item)Item.itemRegistry.getObject("painting"); + public static final Item golden_apple = (Item)Item.itemRegistry.getObject("golden_apple"); + public static final Item sign = (Item)Item.itemRegistry.getObject("sign"); + public static final Item wooden_door = (Item)Item.itemRegistry.getObject("wooden_door"); + public static final Item bucket = (Item)Item.itemRegistry.getObject("bucket"); + public static final Item water_bucket = (Item)Item.itemRegistry.getObject("water_bucket"); + public static final Item lava_bucket = (Item)Item.itemRegistry.getObject("lava_bucket"); + public static final Item minecart = (Item)Item.itemRegistry.getObject("minecart"); + public static final Item saddle = (Item)Item.itemRegistry.getObject("saddle"); + public static final Item iron_door = (Item)Item.itemRegistry.getObject("iron_door"); + public static final Item redstone = (Item)Item.itemRegistry.getObject("redstone"); + public static final Item snowball = (Item)Item.itemRegistry.getObject("snowball"); + public static final Item boat = (Item)Item.itemRegistry.getObject("boat"); + public static final Item leather = (Item)Item.itemRegistry.getObject("leather"); + public static final Item milk_bucket = (Item)Item.itemRegistry.getObject("milk_bucket"); + public static final Item brick = (Item)Item.itemRegistry.getObject("brick"); + public static final Item clay_ball = (Item)Item.itemRegistry.getObject("clay_ball"); + public static final Item reeds = (Item)Item.itemRegistry.getObject("reeds"); + public static final Item paper = (Item)Item.itemRegistry.getObject("paper"); + public static final Item book = (Item)Item.itemRegistry.getObject("book"); + public static final Item slime_ball = (Item)Item.itemRegistry.getObject("slime_ball"); + public static final Item chest_minecart = (Item)Item.itemRegistry.getObject("chest_minecart"); + public static final Item furnace_minecart = (Item)Item.itemRegistry.getObject("furnace_minecart"); + public static final Item egg = (Item)Item.itemRegistry.getObject("egg"); + public static final Item compass = (Item)Item.itemRegistry.getObject("compass"); + public static final ItemFishingRod fishing_rod = (ItemFishingRod)Item.itemRegistry.getObject("fishing_rod"); + public static final Item clock = (Item)Item.itemRegistry.getObject("clock"); + public static final Item glowstone_dust = (Item)Item.itemRegistry.getObject("glowstone_dust"); + public static final Item fish = (Item)Item.itemRegistry.getObject("fish"); + public static final Item cooked_fished = (Item)Item.itemRegistry.getObject("cooked_fished"); + public static final Item dye = (Item)Item.itemRegistry.getObject("dye"); + public static final Item bone = (Item)Item.itemRegistry.getObject("bone"); + public static final Item sugar = (Item)Item.itemRegistry.getObject("sugar"); + public static final Item cake = (Item)Item.itemRegistry.getObject("cake"); + public static final Item bed = (Item)Item.itemRegistry.getObject("bed"); + public static final Item repeater = (Item)Item.itemRegistry.getObject("repeater"); + public static final Item cookie = (Item)Item.itemRegistry.getObject("cookie"); + public static final ItemMap filled_map = (ItemMap)Item.itemRegistry.getObject("filled_map"); + public static final ItemShears shears = (ItemShears)Item.itemRegistry.getObject("shears"); + public static final Item melon = (Item)Item.itemRegistry.getObject("melon"); + public static final Item pumpkin_seeds = (Item)Item.itemRegistry.getObject("pumpkin_seeds"); + public static final Item melon_seeds = (Item)Item.itemRegistry.getObject("melon_seeds"); + public static final Item beef = (Item)Item.itemRegistry.getObject("beef"); + public static final Item cooked_beef = (Item)Item.itemRegistry.getObject("cooked_beef"); + public static final Item chicken = (Item)Item.itemRegistry.getObject("chicken"); + public static final Item cooked_chicken = (Item)Item.itemRegistry.getObject("cooked_chicken"); + public static final Item rotten_flesh = (Item)Item.itemRegistry.getObject("rotten_flesh"); + public static final Item ender_pearl = (Item)Item.itemRegistry.getObject("ender_pearl"); + public static final Item blaze_rod = (Item)Item.itemRegistry.getObject("blaze_rod"); + public static final Item ghast_tear = (Item)Item.itemRegistry.getObject("ghast_tear"); + public static final Item gold_nugget = (Item)Item.itemRegistry.getObject("gold_nugget"); + public static final Item nether_wart = (Item)Item.itemRegistry.getObject("nether_wart"); + public static final ItemPotion potionitem = (ItemPotion)Item.itemRegistry.getObject("potion"); + public static final Item glass_bottle = (Item)Item.itemRegistry.getObject("glass_bottle"); + public static final Item spider_eye = (Item)Item.itemRegistry.getObject("spider_eye"); + public static final Item fermented_spider_eye = (Item)Item.itemRegistry.getObject("fermented_spider_eye"); + public static final Item blaze_powder = (Item)Item.itemRegistry.getObject("blaze_powder"); + public static final Item magma_cream = (Item)Item.itemRegistry.getObject("magma_cream"); + public static final Item brewing_stand = (Item)Item.itemRegistry.getObject("brewing_stand"); + public static final Item cauldron = (Item)Item.itemRegistry.getObject("cauldron"); + public static final Item ender_eye = (Item)Item.itemRegistry.getObject("ender_eye"); + public static final Item speckled_melon = (Item)Item.itemRegistry.getObject("speckled_melon"); + public static final Item spawn_egg = (Item)Item.itemRegistry.getObject("spawn_egg"); + public static final Item experience_bottle = (Item)Item.itemRegistry.getObject("experience_bottle"); + public static final Item fire_charge = (Item)Item.itemRegistry.getObject("fire_charge"); + public static final Item writable_book = (Item)Item.itemRegistry.getObject("writable_book"); + public static final Item written_book = (Item)Item.itemRegistry.getObject("written_book"); + public static final Item emerald = (Item)Item.itemRegistry.getObject("emerald"); + public static final Item item_frame = (Item)Item.itemRegistry.getObject("item_frame"); + public static final Item flower_pot = (Item)Item.itemRegistry.getObject("flower_pot"); + public static final Item carrot = (Item)Item.itemRegistry.getObject("carrot"); + public static final Item potato = (Item)Item.itemRegistry.getObject("potato"); + public static final Item baked_potato = (Item)Item.itemRegistry.getObject("baked_potato"); + public static final Item poisonous_potato = (Item)Item.itemRegistry.getObject("poisonous_potato"); + public static final ItemEmptyMap map = (ItemEmptyMap)Item.itemRegistry.getObject("map"); + public static final Item golden_carrot = (Item)Item.itemRegistry.getObject("golden_carrot"); + public static final Item skull = (Item)Item.itemRegistry.getObject("skull"); + public static final Item carrot_on_a_stick = (Item)Item.itemRegistry.getObject("carrot_on_a_stick"); + public static final Item nether_star = (Item)Item.itemRegistry.getObject("nether_star"); + public static final Item pumpkin_pie = (Item)Item.itemRegistry.getObject("pumpkin_pie"); + public static final Item fireworks = (Item)Item.itemRegistry.getObject("fireworks"); + public static final Item firework_charge = (Item)Item.itemRegistry.getObject("firework_charge"); + public static final ItemEnchantedBook enchanted_book = (ItemEnchantedBook)Item.itemRegistry.getObject("enchanted_book"); + public static final Item comparator = (Item)Item.itemRegistry.getObject("comparator"); + public static final Item netherbrick = (Item)Item.itemRegistry.getObject("netherbrick"); + public static final Item quartz = (Item)Item.itemRegistry.getObject("quartz"); + public static final Item tnt_minecart = (Item)Item.itemRegistry.getObject("tnt_minecart"); + public static final Item hopper_minecart = (Item)Item.itemRegistry.getObject("hopper_minecart"); + public static final Item iron_horse_armor = (Item)Item.itemRegistry.getObject("iron_horse_armor"); + public static final Item golden_horse_armor = (Item)Item.itemRegistry.getObject("golden_horse_armor"); + public static final Item diamond_horse_armor = (Item)Item.itemRegistry.getObject("diamond_horse_armor"); + public static final Item lead = (Item)Item.itemRegistry.getObject("lead"); + public static final Item name_tag = (Item)Item.itemRegistry.getObject("name_tag"); + public static final Item command_block_minecart = (Item)Item.itemRegistry.getObject("command_block_minecart"); + public static final Item record_13 = (Item)Item.itemRegistry.getObject("record_13"); + public static final Item record_cat = (Item)Item.itemRegistry.getObject("record_cat"); + public static final Item record_blocks = (Item)Item.itemRegistry.getObject("record_blocks"); + public static final Item record_chirp = (Item)Item.itemRegistry.getObject("record_chirp"); + public static final Item record_far = (Item)Item.itemRegistry.getObject("record_far"); + public static final Item record_mall = (Item)Item.itemRegistry.getObject("record_mall"); + public static final Item record_mellohi = (Item)Item.itemRegistry.getObject("record_mellohi"); + public static final Item record_stal = (Item)Item.itemRegistry.getObject("record_stal"); + public static final Item record_strad = (Item)Item.itemRegistry.getObject("record_strad"); + public static final Item record_ward = (Item)Item.itemRegistry.getObject("record_ward"); + public static final Item record_11 = (Item)Item.itemRegistry.getObject("record_11"); + public static final Item record_wait = (Item)Item.itemRegistry.getObject("record_wait"); + private static final String __OBFID = "CL_00000044"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/AnimalChest.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/AnimalChest.java new file mode 100644 index 0000000..75e6144 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/AnimalChest.java @@ -0,0 +1,20 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AnimalChest extends InventoryBasic +{ + private static final String __OBFID = "CL_00001731"; + + public AnimalChest(String p_i1796_1_, int p_i1796_2_) + { + super(p_i1796_1_, false, p_i1796_2_); + } + + @SideOnly(Side.CLIENT) + public AnimalChest(String p_i1797_1_, boolean p_i1797_2_, int p_i1797_3_) + { + super(p_i1797_1_, p_i1797_2_, p_i1797_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/Container.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/Container.java new file mode 100644 index 0000000..81c2991 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/Container.java @@ -0,0 +1,782 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; + +public abstract class Container +{ + /** the list of all items(stacks) for the corresponding slot */ + public List inventoryItemStacks = new ArrayList(); + /** the list of all slots in the inventory */ + public List inventorySlots = new ArrayList(); + public int windowId; + @SideOnly(Side.CLIENT) + private short transactionID; + private int field_94535_f = -1; + private int field_94536_g; + private final Set field_94537_h = new HashSet(); + /** list of all people that need to be notified when this craftinventory changes */ + protected List crafters = new ArrayList(); + private Set playerList = new HashSet(); + private static final String __OBFID = "CL_00001730"; + + /** + * the slot is assumed empty + */ + protected Slot addSlotToContainer(Slot p_75146_1_) + { + p_75146_1_.slotNumber = this.inventorySlots.size(); + this.inventorySlots.add(p_75146_1_); + this.inventoryItemStacks.add((Object)null); + return p_75146_1_; + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + if (this.crafters.contains(p_75132_1_)) + { + throw new IllegalArgumentException("Listener already listening"); + } + else + { + this.crafters.add(p_75132_1_); + p_75132_1_.sendContainerAndContentsToPlayer(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + + /** + * returns a list if itemStacks, for each slot. + */ + public List getInventory() + { + ArrayList arraylist = new ArrayList(); + + for (int i = 0; i < this.inventorySlots.size(); ++i) + { + arraylist.add(((Slot)this.inventorySlots.get(i)).getStack()); + } + + return arraylist; + } + + /** + * Remove this crafting listener from the listener list. + */ + @SideOnly(Side.CLIENT) + public void removeCraftingFromCrafters(ICrafting p_82847_1_) + { + this.crafters.remove(p_82847_1_); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + for (int i = 0; i < this.inventorySlots.size(); ++i) + { + ItemStack itemstack = ((Slot)this.inventorySlots.get(i)).getStack(); + ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i); + + if (!ItemStack.areItemStacksEqual(itemstack1, itemstack)) + { + itemstack1 = itemstack == null ? null : itemstack.copy(); + this.inventoryItemStacks.set(i, itemstack1); + + for (int j = 0; j < this.crafters.size(); ++j) + { + ((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1); + } + } + } + } + + /** + * enchants the item on the table using the specified slot; also deducts XP from player + */ + public boolean enchantItem(EntityPlayer player, int id) + { + return false; + } + + public Slot getSlotFromInventory(IInventory p_75147_1_, int p_75147_2_) + { + for (int j = 0; j < this.inventorySlots.size(); ++j) + { + Slot slot = (Slot)this.inventorySlots.get(j); + + if (slot.isSlotInInventory(p_75147_1_, p_75147_2_)) + { + return slot; + } + } + + return null; + } + + public Slot getSlot(int p_75139_1_) + { + return (Slot)this.inventorySlots.get(p_75139_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + Slot slot = (Slot)this.inventorySlots.get(index); + return slot != null ? slot.getStack() : null; + } + + public ItemStack slotClick(int slotId, int clickedButton, int mode, EntityPlayer player) + { + ItemStack itemstack = null; + InventoryPlayer inventoryplayer = player.inventory; + int i1; + ItemStack itemstack3; + + if (mode == 5) + { + int l = this.field_94536_g; + this.field_94536_g = func_94532_c(clickedButton); + + if ((l != 1 || this.field_94536_g != 2) && l != this.field_94536_g) + { + this.func_94533_d(); + } + else if (inventoryplayer.getItemStack() == null) + { + this.func_94533_d(); + } + else if (this.field_94536_g == 0) + { + this.field_94535_f = func_94529_b(clickedButton); + + if (func_94528_d(this.field_94535_f)) + { + this.field_94536_g = 1; + this.field_94537_h.clear(); + } + else + { + this.func_94533_d(); + } + } + else if (this.field_94536_g == 1) + { + Slot slot = (Slot)this.inventorySlots.get(slotId); + + if (slot != null && func_94527_a(slot, inventoryplayer.getItemStack(), true) && slot.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize > this.field_94537_h.size() && this.canDragIntoSlot(slot)) + { + this.field_94537_h.add(slot); + } + } + else if (this.field_94536_g == 2) + { + if (!this.field_94537_h.isEmpty()) + { + itemstack3 = inventoryplayer.getItemStack().copy(); + i1 = inventoryplayer.getItemStack().stackSize; + Iterator iterator = this.field_94537_h.iterator(); + + while (iterator.hasNext()) + { + Slot slot1 = (Slot)iterator.next(); + + if (slot1 != null && func_94527_a(slot1, inventoryplayer.getItemStack(), true) && slot1.isItemValid(inventoryplayer.getItemStack()) && inventoryplayer.getItemStack().stackSize >= this.field_94537_h.size() && this.canDragIntoSlot(slot1)) + { + ItemStack itemstack1 = itemstack3.copy(); + int j1 = slot1.getHasStack() ? slot1.getStack().stackSize : 0; + func_94525_a(this.field_94537_h, this.field_94535_f, itemstack1, j1); + + if (itemstack1.stackSize > itemstack1.getMaxStackSize()) + { + itemstack1.stackSize = itemstack1.getMaxStackSize(); + } + + if (itemstack1.stackSize > slot1.getSlotStackLimit()) + { + itemstack1.stackSize = slot1.getSlotStackLimit(); + } + + i1 -= itemstack1.stackSize - j1; + slot1.putStack(itemstack1); + } + } + + itemstack3.stackSize = i1; + + if (itemstack3.stackSize <= 0) + { + itemstack3 = null; + } + + inventoryplayer.setItemStack(itemstack3); + } + + this.func_94533_d(); + } + else + { + this.func_94533_d(); + } + } + else if (this.field_94536_g != 0) + { + this.func_94533_d(); + } + else + { + Slot slot2; + int l1; + ItemStack itemstack5; + + if ((mode == 0 || mode == 1) && (clickedButton == 0 || clickedButton == 1)) + { + if (slotId == -999) + { + if (inventoryplayer.getItemStack() != null && slotId == -999) + { + if (clickedButton == 0) + { + player.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), true); + inventoryplayer.setItemStack((ItemStack)null); + } + + if (clickedButton == 1) + { + player.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1), true); + + if (inventoryplayer.getItemStack().stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + } + } + else if (mode == 1) + { + if (slotId < 0) + { + return null; + } + + slot2 = (Slot)this.inventorySlots.get(slotId); + + if (slot2 != null && slot2.canTakeStack(player)) + { + itemstack3 = this.transferStackInSlot(player, slotId); + + if (itemstack3 != null) + { + Item item = itemstack3.getItem(); + itemstack = itemstack3.copy(); + + if (slot2.getStack() != null && slot2.getStack().getItem() == item) + { + this.retrySlotClick(slotId, clickedButton, true, player); + } + } + } + } + else + { + if (slotId < 0) + { + return null; + } + + slot2 = (Slot)this.inventorySlots.get(slotId); + + if (slot2 != null) + { + itemstack3 = slot2.getStack(); + ItemStack itemstack4 = inventoryplayer.getItemStack(); + + if (itemstack3 != null) + { + itemstack = itemstack3.copy(); + } + + if (itemstack3 == null) + { + if (itemstack4 != null && slot2.isItemValid(itemstack4)) + { + l1 = clickedButton == 0 ? itemstack4.stackSize : 1; + + if (l1 > slot2.getSlotStackLimit()) + { + l1 = slot2.getSlotStackLimit(); + } + + if (itemstack4.stackSize >= l1) + { + slot2.putStack(itemstack4.splitStack(l1)); + } + + if (itemstack4.stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + } + } + else if (slot2.canTakeStack(player)) + { + if (itemstack4 == null) + { + l1 = clickedButton == 0 ? itemstack3.stackSize : (itemstack3.stackSize + 1) / 2; + itemstack5 = slot2.decrStackSize(l1); + inventoryplayer.setItemStack(itemstack5); + + if (itemstack3.stackSize == 0) + { + slot2.putStack((ItemStack)null); + } + + slot2.onPickupFromSlot(player, inventoryplayer.getItemStack()); + } + else if (slot2.isItemValid(itemstack4)) + { + if (itemstack3.getItem() == itemstack4.getItem() && itemstack3.getItemDamage() == itemstack4.getItemDamage() && ItemStack.areItemStackTagsEqual(itemstack3, itemstack4)) + { + l1 = clickedButton == 0 ? itemstack4.stackSize : 1; + + if (l1 > slot2.getSlotStackLimit() - itemstack3.stackSize) + { + l1 = slot2.getSlotStackLimit() - itemstack3.stackSize; + } + + if (l1 > itemstack4.getMaxStackSize() - itemstack3.stackSize) + { + l1 = itemstack4.getMaxStackSize() - itemstack3.stackSize; + } + + itemstack4.splitStack(l1); + + if (itemstack4.stackSize == 0) + { + inventoryplayer.setItemStack((ItemStack)null); + } + + itemstack3.stackSize += l1; + } + else if (itemstack4.stackSize <= slot2.getSlotStackLimit()) + { + slot2.putStack(itemstack4); + inventoryplayer.setItemStack(itemstack3); + } + } + else if (itemstack3.getItem() == itemstack4.getItem() && itemstack4.getMaxStackSize() > 1 && (!itemstack3.getHasSubtypes() || itemstack3.getItemDamage() == itemstack4.getItemDamage()) && ItemStack.areItemStackTagsEqual(itemstack3, itemstack4)) + { + l1 = itemstack3.stackSize; + + if (l1 > 0 && l1 + itemstack4.stackSize <= itemstack4.getMaxStackSize()) + { + itemstack4.stackSize += l1; + itemstack3 = slot2.decrStackSize(l1); + + if (itemstack3.stackSize == 0) + { + slot2.putStack((ItemStack)null); + } + + slot2.onPickupFromSlot(player, inventoryplayer.getItemStack()); + } + } + } + + slot2.onSlotChanged(); + } + } + } + else if (mode == 2 && clickedButton >= 0 && clickedButton < 9) + { + slot2 = (Slot)this.inventorySlots.get(slotId); + + if (slot2.canTakeStack(player)) + { + itemstack3 = inventoryplayer.getStackInSlot(clickedButton); + boolean flag = itemstack3 == null || slot2.inventory == inventoryplayer && slot2.isItemValid(itemstack3); + l1 = -1; + + if (!flag) + { + l1 = inventoryplayer.getFirstEmptyStack(); + flag |= l1 > -1; + } + + if (slot2.getHasStack() && flag) + { + itemstack5 = slot2.getStack(); + inventoryplayer.setInventorySlotContents(clickedButton, itemstack5.copy()); + + if ((slot2.inventory != inventoryplayer || !slot2.isItemValid(itemstack3)) && itemstack3 != null) + { + if (l1 > -1) + { + inventoryplayer.addItemStackToInventory(itemstack3); + slot2.decrStackSize(itemstack5.stackSize); + slot2.putStack((ItemStack)null); + slot2.onPickupFromSlot(player, itemstack5); + } + } + else + { + slot2.decrStackSize(itemstack5.stackSize); + slot2.putStack(itemstack3); + slot2.onPickupFromSlot(player, itemstack5); + } + } + else if (!slot2.getHasStack() && itemstack3 != null && slot2.isItemValid(itemstack3)) + { + inventoryplayer.setInventorySlotContents(clickedButton, (ItemStack)null); + slot2.putStack(itemstack3); + } + } + } + else if (mode == 3 && player.capabilities.isCreativeMode && inventoryplayer.getItemStack() == null && slotId >= 0) + { + slot2 = (Slot)this.inventorySlots.get(slotId); + + if (slot2 != null && slot2.getHasStack()) + { + itemstack3 = slot2.getStack().copy(); + itemstack3.stackSize = itemstack3.getMaxStackSize(); + inventoryplayer.setItemStack(itemstack3); + } + } + else if (mode == 4 && inventoryplayer.getItemStack() == null && slotId >= 0) + { + slot2 = (Slot)this.inventorySlots.get(slotId); + + if (slot2 != null && slot2.getHasStack() && slot2.canTakeStack(player)) + { + itemstack3 = slot2.decrStackSize(clickedButton == 0 ? 1 : slot2.getStack().stackSize); + slot2.onPickupFromSlot(player, itemstack3); + player.dropPlayerItemWithRandomChoice(itemstack3, true); + } + } + else if (mode == 6 && slotId >= 0) + { + slot2 = (Slot)this.inventorySlots.get(slotId); + itemstack3 = inventoryplayer.getItemStack(); + + if (itemstack3 != null && (slot2 == null || !slot2.getHasStack() || !slot2.canTakeStack(player))) + { + i1 = clickedButton == 0 ? 0 : this.inventorySlots.size() - 1; + l1 = clickedButton == 0 ? 1 : -1; + + for (int i2 = 0; i2 < 2; ++i2) + { + for (int j2 = i1; j2 >= 0 && j2 < this.inventorySlots.size() && itemstack3.stackSize < itemstack3.getMaxStackSize(); j2 += l1) + { + Slot slot3 = (Slot)this.inventorySlots.get(j2); + + if (slot3.getHasStack() && func_94527_a(slot3, itemstack3, true) && slot3.canTakeStack(player) && this.func_94530_a(itemstack3, slot3) && (i2 != 0 || slot3.getStack().stackSize != slot3.getStack().getMaxStackSize())) + { + int k1 = Math.min(itemstack3.getMaxStackSize() - itemstack3.stackSize, slot3.getStack().stackSize); + ItemStack itemstack2 = slot3.decrStackSize(k1); + itemstack3.stackSize += k1; + + if (itemstack2.stackSize <= 0) + { + slot3.putStack((ItemStack)null); + } + + slot3.onPickupFromSlot(player, itemstack2); + } + } + } + } + + this.detectAndSendChanges(); + } + } + + return itemstack; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) + { + return true; + } + + protected void retrySlotClick(int p_75133_1_, int p_75133_2_, boolean p_75133_3_, EntityPlayer p_75133_4_) + { + this.slotClick(p_75133_1_, p_75133_2_, 1, p_75133_4_); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + InventoryPlayer inventoryplayer = p_75134_1_.inventory; + + if (inventoryplayer.getItemStack() != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), false); + inventoryplayer.setItemStack((ItemStack)null); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + this.detectAndSendChanges(); + } + + /** + * args: slotID, itemStack to put in slot + */ + public void putStackInSlot(int p_75141_1_, ItemStack p_75141_2_) + { + this.getSlot(p_75141_1_).putStack(p_75141_2_); + } + + /** + * places itemstacks in first x slots, x being aitemstack.lenght + */ + @SideOnly(Side.CLIENT) + public void putStacksInSlots(ItemStack[] p_75131_1_) + { + for (int i = 0; i < p_75131_1_.length; ++i) + { + this.getSlot(i).putStack(p_75131_1_[i]); + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) {} + + /** + * Gets a unique transaction ID. Parameter is unused. + */ + @SideOnly(Side.CLIENT) + public short getNextTransactionID(InventoryPlayer p_75136_1_) + { + ++this.transactionID; + return this.transactionID; + } + + /** + * NotUsing because adding a player twice is an error + */ + public boolean isPlayerNotUsingContainer(EntityPlayer p_75129_1_) + { + return !this.playerList.contains(p_75129_1_); + } + + /** + * adds or removes the player from the container based on par2 + */ + public void setPlayerIsPresent(EntityPlayer p_75128_1_, boolean p_75128_2_) + { + if (p_75128_2_) + { + this.playerList.remove(p_75128_1_); + } + else + { + this.playerList.add(p_75128_1_); + } + } + + public abstract boolean canInteractWith(EntityPlayer player); + + /** + * merges provided ItemStack with the first avaliable one in the container/player inventory + */ + protected boolean mergeItemStack(ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_) + { + boolean flag1 = false; + int k = p_75135_2_; + + if (p_75135_4_) + { + k = p_75135_3_ - 1; + } + + Slot slot; + ItemStack itemstack1; + + if (p_75135_1_.isStackable()) + { + while (p_75135_1_.stackSize > 0 && (!p_75135_4_ && k < p_75135_3_ || p_75135_4_ && k >= p_75135_2_)) + { + slot = (Slot)this.inventorySlots.get(k); + itemstack1 = slot.getStack(); + + if (itemstack1 != null && itemstack1.getItem() == p_75135_1_.getItem() && (!p_75135_1_.getHasSubtypes() || p_75135_1_.getItemDamage() == itemstack1.getItemDamage()) && ItemStack.areItemStackTagsEqual(p_75135_1_, itemstack1)) + { + int l = itemstack1.stackSize + p_75135_1_.stackSize; + + if (l <= p_75135_1_.getMaxStackSize()) + { + p_75135_1_.stackSize = 0; + itemstack1.stackSize = l; + slot.onSlotChanged(); + flag1 = true; + } + else if (itemstack1.stackSize < p_75135_1_.getMaxStackSize()) + { + p_75135_1_.stackSize -= p_75135_1_.getMaxStackSize() - itemstack1.stackSize; + itemstack1.stackSize = p_75135_1_.getMaxStackSize(); + slot.onSlotChanged(); + flag1 = true; + } + } + + if (p_75135_4_) + { + --k; + } + else + { + ++k; + } + } + } + + if (p_75135_1_.stackSize > 0) + { + if (p_75135_4_) + { + k = p_75135_3_ - 1; + } + else + { + k = p_75135_2_; + } + + while (!p_75135_4_ && k < p_75135_3_ || p_75135_4_ && k >= p_75135_2_) + { + slot = (Slot)this.inventorySlots.get(k); + itemstack1 = slot.getStack(); + + if (itemstack1 == null) + { + slot.putStack(p_75135_1_.copy()); + slot.onSlotChanged(); + p_75135_1_.stackSize = 0; + flag1 = true; + break; + } + + if (p_75135_4_) + { + --k; + } + else + { + ++k; + } + } + } + + return flag1; + } + + public static int func_94529_b(int p_94529_0_) + { + return p_94529_0_ >> 2 & 3; + } + + public static int func_94532_c(int p_94532_0_) + { + return p_94532_0_ & 3; + } + + @SideOnly(Side.CLIENT) + public static int func_94534_d(int p_94534_0_, int p_94534_1_) + { + return p_94534_0_ & 3 | (p_94534_1_ & 3) << 2; + } + + public static boolean func_94528_d(int p_94528_0_) + { + return p_94528_0_ == 0 || p_94528_0_ == 1; + } + + protected void func_94533_d() + { + this.field_94536_g = 0; + this.field_94537_h.clear(); + } + + public static boolean func_94527_a(Slot slotIn, ItemStack stack, boolean stackSizeMatters) + { + boolean flag1 = slotIn == null || !slotIn.getHasStack(); + + if (slotIn != null && slotIn.getHasStack() && stack != null && stack.isItemEqual(slotIn.getStack()) && ItemStack.areItemStackTagsEqual(slotIn.getStack(), stack)) + { + int i = stackSizeMatters ? 0 : stack.stackSize; + flag1 |= slotIn.getStack().stackSize + i <= stack.getMaxStackSize(); + } + + return flag1; + } + + public static void func_94525_a(Set p_94525_0_, int p_94525_1_, ItemStack p_94525_2_, int p_94525_3_) + { + switch (p_94525_1_) + { + case 0: + p_94525_2_.stackSize = MathHelper.floor_float((float)p_94525_2_.stackSize / (float)p_94525_0_.size()); + break; + case 1: + p_94525_2_.stackSize = 1; + } + + p_94525_2_.stackSize += p_94525_3_; + } + + /** + * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if + * the slot can be added to a list of Slots to split the held ItemStack across. + */ + public boolean canDragIntoSlot(Slot p_94531_1_) + { + return true; + } + + public static int calcRedstoneFromInventory(IInventory p_94526_0_) + { + if (p_94526_0_ == null) + { + return 0; + } + else + { + int i = 0; + float f = 0.0F; + + for (int j = 0; j < p_94526_0_.getSizeInventory(); ++j) + { + ItemStack itemstack = p_94526_0_.getStackInSlot(j); + + if (itemstack != null) + { + f += (float)itemstack.stackSize / (float)Math.min(p_94526_0_.getInventoryStackLimit(), itemstack.getMaxStackSize()); + ++i; + } + } + + f /= (float)p_94526_0_.getSizeInventory(); + return MathHelper.floor_float(f * 14.0F) + (i > 0 ? 1 : 0); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBeacon.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBeacon.java new file mode 100644 index 0000000..671214e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBeacon.java @@ -0,0 +1,178 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBeacon; + +public class ContainerBeacon extends Container +{ + private TileEntityBeacon tileBeacon; + /** This beacon's slot where you put in Emerald, Diamond, Gold or Iron Ingot. */ + private final ContainerBeacon.BeaconSlot beaconSlot; + private int field_82865_g; + private int field_82867_h; + private int field_82868_i; + private static final String __OBFID = "CL_00001735"; + + public ContainerBeacon(InventoryPlayer p_i1802_1_, TileEntityBeacon p_i1802_2_) + { + this.tileBeacon = p_i1802_2_; + this.addSlotToContainer(this.beaconSlot = new ContainerBeacon.BeaconSlot(p_i1802_2_, 0, 136, 110)); + byte b0 = 36; + short short1 = 137; + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1802_1_, j + i * 9 + 9, b0 + j * 18, short1 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1802_1_, i, b0 + i * 18, 58 + short1)); + } + + this.field_82865_g = p_i1802_2_.getLevels(); + this.field_82867_h = p_i1802_2_.getPrimaryEffect(); + this.field_82868_i = p_i1802_2_.getSecondaryEffect(); + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.field_82865_g); + p_75132_1_.sendProgressBarUpdate(this, 1, this.field_82867_h); + p_75132_1_.sendProgressBarUpdate(this, 2, this.field_82868_i); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileBeacon.func_146005_c(p_75137_2_); + } + + if (p_75137_1_ == 1) + { + this.tileBeacon.setPrimaryEffect(p_75137_2_); + } + + if (p_75137_1_ == 2) + { + this.tileBeacon.setSecondaryEffect(p_75137_2_); + } + } + + public TileEntityBeacon func_148327_e() + { + return this.tileBeacon; + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.tileBeacon.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 1, 37, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(itemstack1) && itemstack1.stackSize == 1) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (index >= 1 && index < 28) + { + if (!this.mergeItemStack(itemstack1, 28, 37, false)) + { + return null; + } + } + else if (index >= 28 && index < 37) + { + if (!this.mergeItemStack(itemstack1, 1, 28, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 1, 37, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + class BeaconSlot extends Slot + { + private static final String __OBFID = "CL_00001736"; + + public BeaconSlot(IInventory p_i1801_2_, int p_i1801_3_, int p_i1801_4_, int p_i1801_5_) + { + super(p_i1801_2_, p_i1801_3_, p_i1801_4_, p_i1801_5_); + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return stack != null && stack.getItem() != null && stack.getItem().isBeaconPayment(stack); + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the + * case of armor slots) + */ + public int getSlotStackLimit() + { + return 1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBrewingStand.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBrewingStand.java new file mode 100644 index 0000000..a3fc684 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerBrewingStand.java @@ -0,0 +1,236 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntityBrewingStand; + +public class ContainerBrewingStand extends Container +{ + private TileEntityBrewingStand tileBrewingStand; + /** Instance of Slot. */ + private final Slot theSlot; + private int brewTime; + private static final String __OBFID = "CL_00001737"; + + public ContainerBrewingStand(InventoryPlayer p_i1805_1_, TileEntityBrewingStand p_i1805_2_) + { + this.tileBrewingStand = p_i1805_2_; + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 0, 56, 46)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 1, 79, 53)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(p_i1805_1_.player, p_i1805_2_, 2, 102, 46)); + this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(p_i1805_2_, 3, 79, 17)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1805_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1805_1_, i, 8 + i * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.brewTime != this.tileBrewingStand.getBrewTime()) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); + } + } + + this.brewTime = this.tileBrewingStand.getBrewTime(); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileBrewingStand.func_145938_d(p_75137_2_); + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.tileBrewingStand.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if ((index < 0 || index > 2) && index != 3) + { + if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 3, 4, false)) + { + return null; + } + } + else if (ContainerBrewingStand.Potion.canHoldPotion(itemstack)) + { + if (!this.mergeItemStack(itemstack1, 0, 3, false)) + { + return null; + } + } + else if (index >= 4 && index < 31) + { + if (!this.mergeItemStack(itemstack1, 31, 40, false)) + { + return null; + } + } + else if (index >= 31 && index < 40) + { + if (!this.mergeItemStack(itemstack1, 4, 31, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 4, 40, false)) + { + return null; + } + } + else + { + if (!this.mergeItemStack(itemstack1, 4, 40, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + class Ingredient extends Slot + { + private static final String __OBFID = "CL_00001738"; + + public Ingredient(IInventory p_i1803_2_, int p_i1803_3_, int p_i1803_4_, int p_i1803_5_) + { + super(p_i1803_2_, p_i1803_3_, p_i1803_4_, p_i1803_5_); + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return stack != null ? stack.getItem().isPotionIngredient(stack) : false; + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the + * case of armor slots) + */ + public int getSlotStackLimit() + { + return 64; + } + } + + static class Potion extends Slot + { + /** The player that has this container open. */ + private EntityPlayer player; + private static final String __OBFID = "CL_00001740"; + + public Potion(EntityPlayer p_i1804_1_, IInventory p_i1804_2_, int p_i1804_3_, int p_i1804_4_, int p_i1804_5_) + { + super(p_i1804_2_, p_i1804_3_, p_i1804_4_, p_i1804_5_); + this.player = p_i1804_1_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return canHoldPotion(stack); + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in + * the case of armor slots) + */ + public int getSlotStackLimit() + { + return 1; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + if (p_82870_2_.getItem() instanceof ItemPotion && p_82870_2_.getItemDamage() > 0) + { + this.player.addStat(AchievementList.potion, 1); + } + + super.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + /** + * Returns true if this itemstack can be filled with a potion + */ + public static boolean canHoldPotion(ItemStack p_75243_0_) + { + return p_75243_0_ != null && (p_75243_0_.getItem() instanceof ItemPotion || p_75243_0_.getItem() == Items.glass_bottle); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerChest.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerChest.java new file mode 100644 index 0000000..bcf3264 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerChest.java @@ -0,0 +1,102 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerChest extends Container +{ + private IInventory lowerChestInventory; + private int numRows; + private static final String __OBFID = "CL_00001742"; + + public ContainerChest(IInventory p_i1806_1_, IInventory p_i1806_2_) + { + this.lowerChestInventory = p_i1806_2_; + this.numRows = p_i1806_2_.getSizeInventory() / 9; + p_i1806_2_.openInventory(); + int i = (this.numRows - 4) * 18; + int j; + int k; + + for (j = 0; j < this.numRows; ++j) + { + for (k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(p_i1806_2_, k + j * 9, 8 + k * 18, 18 + j * 18)); + } + } + + for (j = 0; j < 3; ++j) + { + for (k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(p_i1806_1_, k + j * 9 + 9, 8 + k * 18, 103 + j * 18 + i)); + } + } + + for (j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1806_1_, j, 8 + j * 18, 161 + i)); + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.lowerChestInventory.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.numRows * 9) + { + if (!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, this.numRows * 9, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.lowerChestInventory.closeInventory(); + } + + /** + * Return this chest container's lower chest inventory. + */ + public IInventory getLowerChestInventory() + { + return this.lowerChestInventory; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerDispenser.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerDispenser.java new file mode 100644 index 0000000..e503e77 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerDispenser.java @@ -0,0 +1,89 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityDispenser; + +public class ContainerDispenser extends Container +{ + private TileEntityDispenser tileDispenser; + private static final String __OBFID = "CL_00001763"; + + public ContainerDispenser(IInventory p_i1825_1_, TileEntityDispenser p_i1825_2_) + { + this.tileDispenser = p_i1825_2_; + int i; + int j; + + for (i = 0; i < 3; ++i) + { + for (j = 0; j < 3; ++j) + { + this.addSlotToContainer(new Slot(p_i1825_2_, j + i * 3, 62 + j * 18, 17 + i * 18)); + } + } + + for (i = 0; i < 3; ++i) + { + for (j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1825_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1825_1_, i, 8 + i * 18, 142)); + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.tileDispenser.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < 9) + { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, 9, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerEnchantment.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerEnchantment.java new file mode 100644 index 0000000..ecaf000 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerEnchantment.java @@ -0,0 +1,315 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; + +public class ContainerEnchantment extends Container +{ + /** SlotEnchantmentTable object with ItemStack to be enchanted */ + public IInventory tableInventory = new InventoryBasic("Enchant", true, 1) + { + private static final String __OBFID = "CL_00001746"; + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 1; + } + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think + * it hasn't changed and skip it. + */ + public void markDirty() + { + super.markDirty(); + ContainerEnchantment.this.onCraftMatrixChanged(this); + } + }; + /** current world (for bookshelf counting) */ + private World worldPointer; + private int posX; + private int posY; + private int posZ; + private Random rand = new Random(); + /** used as seed for EnchantmentNameParts (see GuiEnchantment) */ + public long nameSeed; + /** 3-member array storing the enchantment levels of each slot */ + public int[] enchantLevels = new int[3]; + private static final String __OBFID = "CL_00001745"; + + public ContainerEnchantment(InventoryPlayer p_i1811_1_, World p_i1811_2_, int p_i1811_3_, int p_i1811_4_, int p_i1811_5_) + { + this.worldPointer = p_i1811_2_; + this.posX = p_i1811_3_; + this.posY = p_i1811_4_; + this.posZ = p_i1811_5_; + this.addSlotToContainer(new Slot(this.tableInventory, 0, 25, 47) + { + private static final String __OBFID = "CL_00001747"; + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return true; + } + }); + int l; + + for (l = 0; l < 3; ++l) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(p_i1811_1_, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); + } + } + + for (l = 0; l < 9; ++l) + { + this.addSlotToContainer(new Slot(p_i1811_1_, l, 8 + l * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + p_75132_1_.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + p_75132_1_.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ >= 0 && p_75137_1_ <= 2) + { + this.enchantLevels[p_75137_1_] = p_75137_2_; + } + else + { + super.updateProgressBar(p_75137_1_, p_75137_2_); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + if (p_75130_1_ == this.tableInventory) + { + ItemStack itemstack = p_75130_1_.getStackInSlot(0); + int i; + + if (itemstack != null && itemstack.isItemEnchantable()) + { + this.nameSeed = this.rand.nextLong(); + + if (!this.worldPointer.isRemote) + { + i = 0; + int j; + float power = 0; + + for (j = -1; j <= 1; ++j) + { + for (int k = -1; k <= 1; ++k) + { + if ((j != 0 || k != 0) && this.worldPointer.isAirBlock(this.posX + k, this.posY, this.posZ + j) && this.worldPointer.isAirBlock(this.posX + k, this.posY + 1, this.posZ + j)) + { + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j * 2); + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j * 2); + + if (k != 0 && j != 0) + { + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY, posZ + j ); + power += ForgeHooks.getEnchantPower(worldPointer, posX + k * 2, posY + 1, posZ + j ); + power += ForgeHooks.getEnchantPower(worldPointer, posX + k, posY, posZ + j * 2); + power += ForgeHooks.getEnchantPower(worldPointer, posX + k, posY + 1, posZ + j * 2); + } + } + } + } + + for (j = 0; j < 3; ++j) + { + this.enchantLevels[j] = EnchantmentHelper.calcItemStackEnchantability(this.rand, j, (int)power, itemstack); + } + + this.detectAndSendChanges(); + } + } + else + { + for (i = 0; i < 3; ++i) + { + this.enchantLevels[i] = 0; + } + } + } + } + + /** + * enchants the item on the table using the specified slot; also deducts XP from player + */ + public boolean enchantItem(EntityPlayer player, int id) + { + ItemStack itemstack = this.tableInventory.getStackInSlot(0); + + if (this.enchantLevels[id] > 0 && itemstack != null && (player.experienceLevel >= this.enchantLevels[id] || player.capabilities.isCreativeMode)) + { + if (!this.worldPointer.isRemote) + { + List list = EnchantmentHelper.buildEnchantmentList(this.rand, itemstack, this.enchantLevels[id]); + boolean flag = itemstack.getItem() == Items.book; + + if (list != null) + { + player.addExperienceLevel(-this.enchantLevels[id]); + + if (flag) + { + itemstack.func_150996_a(Items.enchanted_book); + } + + int j = flag && list.size() > 1 ? this.rand.nextInt(list.size()) : -1; + + for (int k = 0; k < list.size(); ++k) + { + EnchantmentData enchantmentdata = (EnchantmentData)list.get(k); + + if (!flag || k != j) + { + if (flag) + { + Items.enchanted_book.addEnchantment(itemstack, enchantmentdata); + } + else + { + itemstack.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel); + } + } + } + + this.onCraftMatrixChanged(this.tableInventory); + } + } + + return true; + } + else + { + return false; + } + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + + if (!this.worldPointer.isRemote) + { + ItemStack itemstack = this.tableInventory.getStackInSlotOnClosing(0); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.worldPointer.getBlock(this.posX, this.posY, this.posZ) != Blocks.enchanting_table ? false : player.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 1, 37, true)) + { + return null; + } + } + else + { + if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(itemstack1)) + { + return null; + } + + if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1) + { + ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy()); + itemstack1.stackSize = 0; + } + else if (itemstack1.stackSize >= 1) + { + ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getItemDamage())); + --itemstack1.stackSize; + } + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerFurnace.java new file mode 100644 index 0000000..d3ec465 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerFurnace.java @@ -0,0 +1,179 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.tileentity.TileEntityFurnace; + +public class ContainerFurnace extends Container +{ + private TileEntityFurnace tileFurnace; + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + private static final String __OBFID = "CL_00001748"; + + public ContainerFurnace(InventoryPlayer invPlayer, TileEntityFurnace teFurnace) + { + this.tileFurnace = teFurnace; + this.addSlotToContainer(new Slot(teFurnace, 0, 56, 17)); + this.addSlotToContainer(new Slot(teFurnace, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnace(invPlayer.player, teFurnace, 2, 116, 35)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime); + p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.currentItemBurnTime); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.lastCookTime != this.tileFurnace.furnaceCookTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.furnaceCookTime); + } + + if (this.lastBurnTime != this.tileFurnace.furnaceBurnTime) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.furnaceBurnTime); + } + + if (this.lastItemBurnTime != this.tileFurnace.currentItemBurnTime) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.currentItemBurnTime); + } + } + + this.lastCookTime = this.tileFurnace.furnaceCookTime; + this.lastBurnTime = this.tileFurnace.furnaceBurnTime; + this.lastItemBurnTime = this.tileFurnace.currentItemBurnTime; + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileFurnace.furnaceCookTime = p_75137_2_; + } + + if (p_75137_1_ == 1) + { + this.tileFurnace.furnaceBurnTime = p_75137_2_; + } + + if (p_75137_1_ == 2) + { + this.tileFurnace.currentItemBurnTime = p_75137_2_; + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.tileFurnace.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 1 && index != 0) + { + if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (TileEntityFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (index >= 3 && index < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHopper.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHopper.java new file mode 100644 index 0000000..87b5d0f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHopper.java @@ -0,0 +1,89 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class ContainerHopper extends Container +{ + private final IInventory field_94538_a; + private static final String __OBFID = "CL_00001750"; + + public ContainerHopper(InventoryPlayer p_i1814_1_, IInventory p_i1814_2_) + { + this.field_94538_a = p_i1814_2_; + p_i1814_2_.openInventory(); + byte b0 = 51; + int i; + + for (i = 0; i < p_i1814_2_.getSizeInventory(); ++i) + { + this.addSlotToContainer(new Slot(p_i1814_2_, i, 44 + i * 18, 20)); + } + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1814_1_, j + i * 9 + 9, 8 + j * 18, i * 18 + b0)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1814_1_, i, 8 + i * 18, 58 + b0)); + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.field_94538_a.isUseableByPlayer(player); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.field_94538_a.getSizeInventory()) + { + if (!this.mergeItemStack(itemstack1, this.field_94538_a.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, this.field_94538_a.getSizeInventory(), false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.field_94538_a.closeInventory(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHorseInventory.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHorseInventory.java new file mode 100644 index 0000000..6c395e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerHorseInventory.java @@ -0,0 +1,143 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class ContainerHorseInventory extends Container +{ + private IInventory field_111243_a; + private EntityHorse theHorse; + private static final String __OBFID = "CL_00001751"; + + public ContainerHorseInventory(IInventory p_i1817_1_, final IInventory p_i1817_2_, final EntityHorse p_i1817_3_) + { + this.field_111243_a = p_i1817_2_; + this.theHorse = p_i1817_3_; + byte b0 = 3; + p_i1817_2_.openInventory(); + int i = (b0 - 4) * 18; + this.addSlotToContainer(new Slot(p_i1817_2_, 0, 8, 18) + { + private static final String __OBFID = "CL_00001752"; + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return super.isItemValid(stack) && stack.getItem() == Items.saddle && !this.getHasStack(); + } + }); + this.addSlotToContainer(new Slot(p_i1817_2_, 1, 8, 36) + { + private static final String __OBFID = "CL_00001753"; + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return super.isItemValid(stack) && p_i1817_3_.func_110259_cr() && EntityHorse.func_146085_a(stack.getItem()); + } + @SideOnly(Side.CLIENT) + public boolean func_111238_b() + { + return p_i1817_3_.func_110259_cr(); + } + }); + int j; + int k; + + if (p_i1817_3_.isChested()) + { + for (j = 0; j < b0; ++j) + { + for (k = 0; k < 5; ++k) + { + this.addSlotToContainer(new Slot(p_i1817_2_, 2 + k + j * 5, 80 + k * 18, 18 + j * 18)); + } + } + } + + for (j = 0; j < 3; ++j) + { + for (k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(p_i1817_1_, k + j * 9 + 9, 8 + k * 18, 102 + j * 18 + i)); + } + } + + for (j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1817_1_, j, 8 + j * 18, 160 + i)); + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.field_111243_a.isUseableByPlayer(player) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(player) < 8.0F; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.field_111243_a.getSizeInventory()) + { + if (!this.mergeItemStack(itemstack1, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + else if (this.getSlot(1).isItemValid(itemstack1) && !this.getSlot(1).getHasStack()) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (this.getSlot(0).isItemValid(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(itemstack1, 2, this.field_111243_a.getSizeInventory(), false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.field_111243_a.closeInventory(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerMerchant.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerMerchant.java new file mode 100644 index 0000000..bfe2ca4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerMerchant.java @@ -0,0 +1,171 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ContainerMerchant extends Container +{ + /** Instance of Merchant. */ + private IMerchant theMerchant; + private InventoryMerchant merchantInventory; + /** Instance of World. */ + private final World theWorld; + private static final String __OBFID = "CL_00001757"; + + public ContainerMerchant(InventoryPlayer p_i1821_1_, IMerchant p_i1821_2_, World p_i1821_3_) + { + this.theMerchant = p_i1821_2_; + this.theWorld = p_i1821_3_; + this.merchantInventory = new InventoryMerchant(p_i1821_1_.player, p_i1821_2_); + this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); + this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); + this.addSlotToContainer(new SlotMerchantResult(p_i1821_1_.player, p_i1821_2_, this.merchantInventory, 2, 120, 53)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1821_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1821_1_, i, 8 + i * 18, 142)); + } + } + + public InventoryMerchant getMerchantInventory() + { + return this.merchantInventory; + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + this.merchantInventory.resetRecipeAndSlots(); + super.onCraftMatrixChanged(p_75130_1_); + } + + public void setCurrentRecipeIndex(int p_75175_1_) + { + this.merchantInventory.setCurrentRecipeIndex(p_75175_1_); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) {} + + public boolean canInteractWith(EntityPlayer player) + { + return this.theMerchant.getCustomer() == player; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 0 && index != 1) + { + if (index >= 3 && index < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.theMerchant.setCustomer((EntityPlayer)null); + super.onContainerClosed(p_75134_1_); + + if (!this.theWorld.isRemote) + { + ItemStack itemstack = this.merchantInventory.getStackInSlotOnClosing(0); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + + itemstack = this.merchantInventory.getStackInSlotOnClosing(1); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerPlayer.java new file mode 100644 index 0000000..173e6c1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerPlayer.java @@ -0,0 +1,211 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.util.IIcon; + +public class ContainerPlayer extends Container +{ + /** The crafting matrix inventory. */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); + public IInventory craftResult = new InventoryCraftResult(); + /** Determines if inventory manipulation should be handled. */ + public boolean isLocalWorld; + private final EntityPlayer thePlayer; + private static final String __OBFID = "CL_00001754"; + + public ContainerPlayer(final InventoryPlayer p_i1819_1_, boolean p_i1819_2_, EntityPlayer p_i1819_3_) + { + this.isLocalWorld = p_i1819_2_; + this.thePlayer = p_i1819_3_; + this.addSlotToContainer(new SlotCrafting(p_i1819_1_.player, this.craftMatrix, this.craftResult, 0, 144, 36)); + int i; + int j; + + for (i = 0; i < 2; ++i) + { + for (j = 0; j < 2; ++j) + { + this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 88 + j * 18, 26 + i * 18)); + } + } + + for (i = 0; i < 4; ++i) + { + final int k = i; + this.addSlotToContainer(new Slot(p_i1819_1_, p_i1819_1_.getSizeInventory() - 1 - i, 8, 8 + i * 18) + { + private static final String __OBFID = "CL_00001755"; + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 + * in the case of armor slots) + */ + public int getSlotStackLimit() + { + return 1; + } + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + if (stack == null) return false; + return stack.getItem().isValidArmor(stack, k, thePlayer); + } + /** + * Returns the icon index on items.png that is used as background image of the slot. + */ + @SideOnly(Side.CLIENT) + public IIcon getBackgroundIconIndex() + { + return ItemArmor.func_94602_b(k); + } + }); + } + + for (i = 0; i < 3; ++i) + { + for (j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1819_1_, j + (i + 1) * 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1819_1_, i, 8 + i * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + + for (int i = 0; i < 4; ++i) + { + ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + + this.craftResult.setInventorySlotContents(0, (ItemStack)null); + } + + public boolean canInteractWith(EntityPlayer player) + { + return true; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 9, 45, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index >= 1 && index < 5) + { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + } + else if (index >= 5 && index < 9) + { + if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + } + else if (itemstack.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)itemstack.getItem()).armorType)).getHasStack()) + { + int j = 5 + ((ItemArmor)itemstack.getItem()).armorType; + + if (!this.mergeItemStack(itemstack1, j, j + 1, false)) + { + return null; + } + } + else if (index >= 9 && index < 36) + { + if (!this.mergeItemStack(itemstack1, 36, 45, false)) + { + return null; + } + } + else if (index >= 36 && index < 45) + { + if (!this.mergeItemStack(itemstack1, 9, 36, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 9, 45, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) + { + return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerRepair.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerRepair.java new file mode 100644 index 0000000..efd2be8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerRepair.java @@ -0,0 +1,568 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ContainerRepair extends Container +{ + private static final Logger logger = LogManager.getLogger(); + /** Here comes out item you merged and/or renamed. */ + private IInventory outputSlot = new InventoryCraftResult(); + /** The 2slots where you put your items in that you want to merge and/or rename. */ + private IInventory inputSlots = new InventoryBasic("Repair", true, 2) + { + private static final String __OBFID = "CL_00001733"; + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think + * it hasn't changed and skip it. + */ + public void markDirty() + { + super.markDirty(); + ContainerRepair.this.onCraftMatrixChanged(this); + } + }; + private World theWorld; + private int field_82861_i; + private int field_82858_j; + private int field_82859_k; + /** The maximum cost of repairing/renaming in the anvil. */ + public int maximumCost; + /** determined by damage of input item and stackSize of repair materials */ + public int stackSizeToBeUsedInRepair; + private String repairedItemName; + /** The player that has this container open. */ + private final EntityPlayer thePlayer; + private static final String __OBFID = "CL_00001732"; + + public ContainerRepair(InventoryPlayer p_i1800_1_, final World p_i1800_2_, final int p_i1800_3_, final int p_i1800_4_, final int p_i1800_5_, EntityPlayer p_i1800_6_) + { + this.theWorld = p_i1800_2_; + this.field_82861_i = p_i1800_3_; + this.field_82858_j = p_i1800_4_; + this.field_82859_k = p_i1800_5_; + this.thePlayer = p_i1800_6_; + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); + this.addSlotToContainer(new Slot(this.outputSlot, 2, 134, 47) + { + private static final String __OBFID = "CL_00001734"; + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return false; + } + /** + * Return whether this slot's stack can be taken from this slot. + */ + public boolean canTakeStack(EntityPlayer p_82869_1_) + { + return (p_82869_1_.capabilities.isCreativeMode || p_82869_1_.experienceLevel >= ContainerRepair.this.maximumCost) && ContainerRepair.this.maximumCost > 0 && this.getHasStack(); + } + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + if (!p_82870_1_.capabilities.isCreativeMode) + { + p_82870_1_.addExperienceLevel(-ContainerRepair.this.maximumCost); + } + + float breakChance = ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerRepair.this.inputSlots.getStackInSlot(0), ContainerRepair.this.inputSlots.getStackInSlot(1)); + + ContainerRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack)null); + + if (ContainerRepair.this.stackSizeToBeUsedInRepair > 0) + { + ItemStack itemstack1 = ContainerRepair.this.inputSlots.getStackInSlot(1); + + if (itemstack1 != null && itemstack1.stackSize > ContainerRepair.this.stackSizeToBeUsedInRepair) + { + itemstack1.stackSize -= ContainerRepair.this.stackSizeToBeUsedInRepair; + ContainerRepair.this.inputSlots.setInventorySlotContents(1, itemstack1); + } + else + { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack)null); + } + } + else + { + ContainerRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack)null); + } + + ContainerRepair.this.maximumCost = 0; + + if (!p_82870_1_.capabilities.isCreativeMode && !p_i1800_2_.isRemote && p_i1800_2_.getBlock(p_i1800_3_, p_i1800_4_, p_i1800_5_) == Blocks.anvil && p_82870_1_.getRNG().nextFloat() < breakChance) + { + int i1 = p_i1800_2_.getBlockMetadata(p_i1800_3_, p_i1800_4_, p_i1800_5_); + int k = i1 & 3; + int l = i1 >> 2; + ++l; + + if (l > 2) + { + p_i1800_2_.setBlockToAir(p_i1800_3_, p_i1800_4_, p_i1800_5_); + p_i1800_2_.playAuxSFX(1020, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + else + { + p_i1800_2_.setBlockMetadataWithNotify(p_i1800_3_, p_i1800_4_, p_i1800_5_, k | l << 2, 2); + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } + else if (!p_i1800_2_.isRemote) + { + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } + }); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1800_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1800_1_, i, 8 + i * 18, 142)); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + super.onCraftMatrixChanged(p_75130_1_); + + if (p_75130_1_ == this.inputSlots) + { + this.updateRepairOutput(); + } + } + + /** + * called when the Anvil Input Slot changes, calculates the new result and puts it in the output slot + */ + public void updateRepairOutput() + { + ItemStack itemstack = this.inputSlots.getStackInSlot(0); + this.maximumCost = 0; + int i = 0; + byte b0 = 0; + int j = 0; + + if (itemstack == null) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + } + else + { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = this.inputSlots.getStackInSlot(1); + Map map = EnchantmentHelper.getEnchantments(itemstack1); + boolean flag = false; + int k2 = b0 + itemstack.getRepairCost() + (itemstack2 == null ? 0 : itemstack2.getRepairCost()); + this.stackSizeToBeUsedInRepair = 0; + int k; + int l; + int i1; + int k1; + int l1; + Iterator iterator1; + Enchantment enchantment; + + if (itemstack2 != null) + { + if (!ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, k2)) return; + flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.func_92110_g(itemstack2).tagCount() > 0; + + if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) + { + k = Math.min(itemstack1.getItemDamageForDisplay(), itemstack1.getMaxDamage() / 4); + + if (k <= 0) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + + for (l = 0; k > 0 && l < itemstack2.stackSize; ++l) + { + i1 = itemstack1.getItemDamageForDisplay() - k; + itemstack1.setItemDamage(i1); + i += Math.max(1, k / 100) + map.size(); + k = Math.min(itemstack1.getItemDamageForDisplay(), itemstack1.getMaxDamage() / 4); + } + + this.stackSizeToBeUsedInRepair = l; + } + else + { + if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isItemStackDamageable())) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + + if (itemstack1.isItemStackDamageable() && !flag) + { + k = itemstack.getMaxDamage() - itemstack.getItemDamageForDisplay(); + l = itemstack2.getMaxDamage() - itemstack2.getItemDamageForDisplay(); + i1 = l + itemstack1.getMaxDamage() * 12 / 100; + int j1 = k + i1; + k1 = itemstack1.getMaxDamage() - j1; + + if (k1 < 0) + { + k1 = 0; + } + + if (k1 < itemstack1.getItemDamage()) + { + itemstack1.setItemDamage(k1); + i += Math.max(1, i1 / 100); + } + } + + Map map1 = EnchantmentHelper.getEnchantments(itemstack2); + iterator1 = map1.keySet().iterator(); + + while (iterator1.hasNext()) + { + i1 = ((Integer)iterator1.next()).intValue(); + enchantment = Enchantment.enchantmentsList[i1]; + k1 = map.containsKey(Integer.valueOf(i1)) ? ((Integer)map.get(Integer.valueOf(i1))).intValue() : 0; + l1 = ((Integer)map1.get(Integer.valueOf(i1))).intValue(); + int i3; + + if (k1 == l1) + { + ++l1; + i3 = l1; + } + else + { + i3 = Math.max(l1, k1); + } + + l1 = i3; + int i2 = l1 - k1; + boolean flag1 = enchantment.canApply(itemstack); + + if (this.thePlayer.capabilities.isCreativeMode || itemstack.getItem() == Items.enchanted_book) + { + flag1 = true; + } + + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) + { + int j2 = ((Integer)iterator.next()).intValue(); + + Enchantment e2 = Enchantment.enchantmentsList[j2]; + if (j2 != i1 && !(enchantment.canApplyTogether(e2) && e2.canApplyTogether(enchantment))) //Forge BugFix: Let Both enchantments veto being together + { + flag1 = false; + i += i2; + } + } + + if (flag1) + { + if (l1 > enchantment.getMaxLevel()) + { + l1 = enchantment.getMaxLevel(); + } + + map.put(Integer.valueOf(i1), Integer.valueOf(l1)); + int l2 = 0; + + switch (enchantment.getWeight()) + { + case 1: + l2 = 8; + break; + case 2: + l2 = 4; + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + case 5: + l2 = 2; + break; + case 10: + l2 = 1; + } + + if (flag) + { + l2 = Math.max(1, l2 / 2); + } + + i += l2 * i2; + } + } + } + } + + if (StringUtils.isBlank(this.repairedItemName)) + { + if (itemstack.hasDisplayName()) + { + j = itemstack.isItemStackDamageable() ? 7 : itemstack.stackSize * 5; + i += j; + itemstack1.func_135074_t(); + } + } + else if (!this.repairedItemName.equals(itemstack.getDisplayName())) + { + j = itemstack.isItemStackDamageable() ? 7 : itemstack.stackSize * 5; + i += j; + + if (itemstack.hasDisplayName()) + { + k2 += j / 2; + } + + itemstack1.setStackDisplayName(this.repairedItemName); + } + + k = 0; + + for (iterator1 = map.keySet().iterator(); iterator1.hasNext(); k2 += k + k1 * l1) + { + i1 = ((Integer)iterator1.next()).intValue(); + enchantment = Enchantment.enchantmentsList[i1]; + k1 = ((Integer)map.get(Integer.valueOf(i1))).intValue(); + l1 = 0; + ++k; + + switch (enchantment.getWeight()) + { + case 1: + l1 = 8; + break; + case 2: + l1 = 4; + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + case 5: + l1 = 2; + break; + case 10: + l1 = 1; + } + + if (flag) + { + l1 = Math.max(1, l1 / 2); + } + } + + if (flag) + { + k2 = Math.max(1, k2 / 2); + } + + if (flag && !itemstack1.getItem().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; + + this.maximumCost = k2 + i; + + if (i <= 0) + { + itemstack1 = null; + } + + if (j == i && j > 0 && this.maximumCost >= 40) + { + this.maximumCost = 39; + } + + if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) + { + itemstack1 = null; + } + + if (itemstack1 != null) + { + l = itemstack1.getRepairCost(); + + if (itemstack2 != null && l < itemstack2.getRepairCost()) + { + l = itemstack2.getRepairCost(); + } + + if (itemstack1.hasDisplayName()) + { + l -= 9; + } + + if (l < 0) + { + l = 0; + } + + l += 2; + itemstack1.setRepairCost(l); + EnchantmentHelper.setEnchantments(map, itemstack1); + } + + this.outputSlot.setInventorySlotContents(0, itemstack1); + this.detectAndSendChanges(); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.maximumCost); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.maximumCost = p_75137_2_; + } + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + + if (!this.theWorld.isRemote) + { + for (int i = 0; i < this.inputSlots.getSizeInventory(); ++i) + { + ItemStack itemstack = this.inputSlots.getStackInSlotOnClosing(i); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.theWorld.getBlock(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Blocks.anvil ? false : player.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index != 0 && index != 1) + { + if (index >= 3 && index < 39 && !this.mergeItemStack(itemstack1, 0, 2, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + /** + * used by the Anvil GUI to update the Item Name being typed by the player + */ + public void updateItemName(String p_82850_1_) + { + this.repairedItemName = p_82850_1_; + + if (this.getSlot(2).getHasStack()) + { + ItemStack itemstack = this.getSlot(2).getStack(); + + if (StringUtils.isBlank(p_82850_1_)) + { + itemstack.func_135074_t(); + } + else + { + itemstack.setStackDisplayName(this.repairedItemName); + } + } + + this.updateRepairOutput(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerWorkbench.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerWorkbench.java new file mode 100644 index 0000000..c1586d3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ContainerWorkbench.java @@ -0,0 +1,154 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.world.World; + +public class ContainerWorkbench extends Container +{ + /** The crafting matrix inventory (3x3). */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private World worldObj; + private int posX; + private int posY; + private int posZ; + private static final String __OBFID = "CL_00001744"; + + public ContainerWorkbench(InventoryPlayer p_i1808_1_, World p_i1808_2_, int p_i1808_3_, int p_i1808_4_, int p_i1808_5_) + { + this.worldObj = p_i1808_2_; + this.posX = p_i1808_3_; + this.posY = p_i1808_4_; + this.posZ = p_i1808_5_; + this.addSlotToContainer(new SlotCrafting(p_i1808_1_.player, this.craftMatrix, this.craftResult, 0, 124, 35)); + int l; + int i1; + + for (l = 0; l < 3; ++l) + { + for (i1 = 0; i1 < 3; ++i1) + { + this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18)); + } + } + + for (l = 0; l < 3; ++l) + { + for (i1 = 0; i1 < 9; ++i1) + { + this.addSlotToContainer(new Slot(p_i1808_1_, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18)); + } + } + + for (l = 0; l < 9; ++l) + { + this.addSlotToContainer(new Slot(p_i1808_1_, l, 8 + l * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + + /** + * Callback for when the crafting matrix is changed. + */ + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + } + + /** + * Called when the container is closed. + */ + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + + if (!this.worldObj.isRemote) + { + for (int i = 0; i < 9; ++i) + { + ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); + + if (itemstack != null) + { + p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); + } + } + } + } + + public boolean canInteractWith(EntityPlayer player) + { + return this.worldObj.getBlock(this.posX, this.posY, this.posZ) != Blocks.crafting_table ? false : player.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index == 0) + { + if (!this.mergeItemStack(itemstack1, 10, 46, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (index >= 10 && index < 37) + { + if (!this.mergeItemStack(itemstack1, 37, 46, false)) + { + return null; + } + } + else if (index >= 37 && index < 46) + { + if (!this.mergeItemStack(itemstack1, 10, 37, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 10, 46, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(player, itemstack1); + } + + return itemstack; + } + + public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) + { + return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ICrafting.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ICrafting.java new file mode 100644 index 0000000..72a31d0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ICrafting.java @@ -0,0 +1,22 @@ +package net.minecraft.inventory; + +import java.util.List; +import net.minecraft.item.ItemStack; + +public interface ICrafting +{ + void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_); + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_); + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/IInvBasic.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/IInvBasic.java new file mode 100644 index 0000000..4e3a69c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/IInvBasic.java @@ -0,0 +1,9 @@ +package net.minecraft.inventory; + +public interface IInvBasic +{ + /** + * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. + */ + void onInventoryChanged(InventoryBasic p_76316_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/IInventory.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/IInventory.java new file mode 100644 index 0000000..00d7c87 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/IInventory.java @@ -0,0 +1,69 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public interface IInventory +{ + /** + * Returns the number of slots in the inventory. + */ + int getSizeInventory(); + + /** + * Returns the stack in slot i + */ + ItemStack getStackInSlot(int slotIn); + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + ItemStack decrStackSize(int index, int count); + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + ItemStack getStackInSlotOnClosing(int index); + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + void setInventorySlotContents(int index, ItemStack stack); + + /** + * Returns the name of the inventory + */ + String getInventoryName(); + + /** + * Returns if the inventory is named + */ + boolean hasCustomInventoryName(); + + /** + * Returns the maximum stack size for a inventory slot. + */ + int getInventoryStackLimit(); + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + void markDirty(); + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + boolean isUseableByPlayer(EntityPlayer player); + + void openInventory(); + + void closeInventory(); + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + boolean isItemValidForSlot(int index, ItemStack stack); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/ISidedInventory.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/ISidedInventory.java new file mode 100644 index 0000000..bf2e940 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/ISidedInventory.java @@ -0,0 +1,24 @@ +package net.minecraft.inventory; + +import net.minecraft.item.ItemStack; + +public interface ISidedInventory extends IInventory +{ + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + int[] getAccessibleSlotsFromSide(int p_94128_1_); + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_); + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryBasic.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryBasic.java new file mode 100644 index 0000000..e9c687a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryBasic.java @@ -0,0 +1,189 @@ +package net.minecraft.inventory; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryBasic implements IInventory +{ + private String inventoryTitle; + private int slotsCount; + private ItemStack[] inventoryContents; + private List field_70480_d; + private boolean field_94051_e; + private static final String __OBFID = "CL_00001514"; + + public InventoryBasic(String p_i1561_1_, boolean p_i1561_2_, int p_i1561_3_) + { + this.inventoryTitle = p_i1561_1_; + this.field_94051_e = p_i1561_2_; + this.slotsCount = p_i1561_3_; + this.inventoryContents = new ItemStack[p_i1561_3_]; + } + + public void func_110134_a(IInvBasic p_110134_1_) + { + if (this.field_70480_d == null) + { + this.field_70480_d = new ArrayList(); + } + + this.field_70480_d.add(p_110134_1_); + } + + public void func_110132_b(IInvBasic p_110132_1_) + { + this.field_70480_d.remove(p_110132_1_); + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return slotIn >= 0 && slotIn < this.inventoryContents.length ? this.inventoryContents[slotIn] : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.inventoryContents[index] != null) + { + ItemStack itemstack; + + if (this.inventoryContents[index].stackSize <= count) + { + itemstack = this.inventoryContents[index]; + this.inventoryContents[index] = null; + this.markDirty(); + return itemstack; + } + else + { + itemstack = this.inventoryContents[index].splitStack(count); + + if (this.inventoryContents[index].stackSize == 0) + { + this.inventoryContents[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.inventoryContents[index] != null) + { + ItemStack itemstack = this.inventoryContents[index]; + this.inventoryContents[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.inventoryContents[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.slotsCount; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.inventoryTitle; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_94051_e; + } + + public void func_110133_a(String p_110133_1_) + { + this.field_94051_e = true; + this.inventoryTitle = p_110133_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + if (this.field_70480_d != null) + { + for (int i = 0; i < this.field_70480_d.size(); ++i) + { + ((IInvBasic)this.field_70480_d.get(i)).onInventoryChanged(this); + } + } + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCraftResult.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCraftResult.java new file mode 100644 index 0000000..fd4415b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCraftResult.java @@ -0,0 +1,121 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryCraftResult implements IInventory +{ + /** A list of one item containing the result of the crafting formula */ + private ItemStack[] stackResult = new ItemStack[1]; + private static final String __OBFID = "CL_00001760"; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 1; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.stackResult[0]; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return "Result"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return false; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.stackResult[0] != null) + { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.stackResult[0] != null) + { + ItemStack itemstack = this.stackResult[0]; + this.stackResult[0] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.stackResult[0] = stack; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCrafting.java new file mode 100644 index 0000000..7e10326 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryCrafting.java @@ -0,0 +1,168 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryCrafting implements IInventory +{ + /** List of the stacks in the crafting matrix. */ + private ItemStack[] stackList; + /** the width of the crafting inventory */ + private int inventoryWidth; + /** Class containing the callbacks for the events on_GUIClosed and on_CraftMaxtrixChanged. */ + private Container eventHandler; + private static final String __OBFID = "CL_00001743"; + + public InventoryCrafting(Container p_i1807_1_, int p_i1807_2_, int p_i1807_3_) + { + int k = p_i1807_2_ * p_i1807_3_; + this.stackList = new ItemStack[k]; + this.eventHandler = p_i1807_1_; + this.inventoryWidth = p_i1807_2_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.stackList.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return slotIn >= this.getSizeInventory() ? null : this.stackList[slotIn]; + } + + /** + * Returns the itemstack in the slot specified (Top left is 0, 0). Args: row, column + */ + public ItemStack getStackInRowAndColumn(int p_70463_1_, int p_70463_2_) + { + if (p_70463_1_ >= 0 && p_70463_1_ < this.inventoryWidth) + { + int k = p_70463_1_ + p_70463_2_ * this.inventoryWidth; + return this.getStackInSlot(k); + } + else + { + return null; + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return "container.crafting"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return false; + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.stackList[index] != null) + { + ItemStack itemstack = this.stackList[index]; + this.stackList[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.stackList[index] != null) + { + ItemStack itemstack; + + if (this.stackList[index].stackSize <= count) + { + itemstack = this.stackList[index]; + this.stackList[index] = null; + this.eventHandler.onCraftMatrixChanged(this); + return itemstack; + } + else + { + itemstack = this.stackList[index].splitStack(count); + + if (this.stackList[index].stackSize == 0) + { + this.stackList[index] = null; + } + + this.eventHandler.onCraftMatrixChanged(this); + return itemstack; + } + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.stackList[index] = stack; + this.eventHandler.onCraftMatrixChanged(this); + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() {} + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return true; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryEnderChest.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryEnderChest.java new file mode 100644 index 0000000..699b1cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryEnderChest.java @@ -0,0 +1,93 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityEnderChest; + +public class InventoryEnderChest extends InventoryBasic +{ + private TileEntityEnderChest associatedChest; + private static final String __OBFID = "CL_00001759"; + + public InventoryEnderChest() + { + super("container.enderchest", false, 27); + } + + public void func_146031_a(TileEntityEnderChest chestTileEntity) + { + this.associatedChest = chestTileEntity; + } + + public void loadInventoryFromNBT(NBTTagList p_70486_1_) + { + int i; + + for (i = 0; i < this.getSizeInventory(); ++i) + { + this.setInventorySlotContents(i, (ItemStack)null); + } + + for (i = 0; i < p_70486_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_70486_1_.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j >= 0 && j < this.getSizeInventory()) + { + this.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound)); + } + } + } + + public NBTTagList saveInventoryToNBT() + { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte)i); + itemstack.writeToNBT(nbttagcompound); + nbttaglist.appendTag(nbttagcompound); + } + } + + return nbttaglist; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.associatedChest != null && !this.associatedChest.func_145971_a(player) ? false : super.isUseableByPlayer(player); + } + + public void openInventory() + { + if (this.associatedChest != null) + { + this.associatedChest.func_145969_a(); + } + + super.openInventory(); + } + + public void closeInventory() + { + if (this.associatedChest != null) + { + this.associatedChest.func_145970_b(); + } + + super.closeInventory(); + this.associatedChest = null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryLargeChest.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryLargeChest.java new file mode 100644 index 0000000..17e894d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryLargeChest.java @@ -0,0 +1,152 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class InventoryLargeChest implements IInventory +{ + /** Name of the chest. */ + private String name; + /** Inventory object corresponding to double chest upper part */ + private IInventory upperChest; + /** Inventory object corresponding to double chest lower part */ + private IInventory lowerChest; + private static final String __OBFID = "CL_00001507"; + + public InventoryLargeChest(String p_i1559_1_, IInventory p_i1559_2_, IInventory p_i1559_3_) + { + this.name = p_i1559_1_; + + if (p_i1559_2_ == null) + { + p_i1559_2_ = p_i1559_3_; + } + + if (p_i1559_3_ == null) + { + p_i1559_3_ = p_i1559_2_; + } + + this.upperChest = p_i1559_2_; + this.lowerChest = p_i1559_3_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); + } + + /** + * Return whether the given inventory is part of this large chest. + */ + public boolean isPartOfLargeChest(IInventory p_90010_1_) + { + return this.upperChest == p_90010_1_ || this.lowerChest == p_90010_1_; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.upperChest.hasCustomInventoryName() ? this.upperChest.getInventoryName() : (this.lowerChest.hasCustomInventoryName() ? this.lowerChest.getInventoryName() : this.name); + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.upperChest.hasCustomInventoryName() || this.lowerChest.hasCustomInventoryName(); + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return slotIn >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(slotIn - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(slotIn); + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + return index >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(index - this.upperChest.getSizeInventory(), count) : this.upperChest.decrStackSize(index, count); + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + return index >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(index - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(index); + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index >= this.upperChest.getSizeInventory()) + { + this.lowerChest.setInventorySlotContents(index - this.upperChest.getSizeInventory(), stack); + } + else + { + this.upperChest.setInventorySlotContents(index, stack); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return this.upperChest.getInventoryStackLimit(); + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + this.upperChest.markDirty(); + this.lowerChest.markDirty(); + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.upperChest.isUseableByPlayer(player) && this.lowerChest.isUseableByPlayer(player); + } + + public void openInventory() + { + this.upperChest.openInventory(); + this.lowerChest.openInventory(); + } + + public void closeInventory() + { + this.upperChest.closeInventory(); + this.lowerChest.closeInventory(); + } + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryMerchant.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryMerchant.java new file mode 100644 index 0000000..f87f2e1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/InventoryMerchant.java @@ -0,0 +1,251 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + +public class InventoryMerchant implements IInventory +{ + private final IMerchant theMerchant; + private ItemStack[] theInventory = new ItemStack[3]; + private final EntityPlayer thePlayer; + private MerchantRecipe currentRecipe; + private int currentRecipeIndex; + private static final String __OBFID = "CL_00001756"; + + public InventoryMerchant(EntityPlayer p_i1820_1_, IMerchant p_i1820_2_) + { + this.thePlayer = p_i1820_1_; + this.theMerchant = p_i1820_2_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.theInventory.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.theInventory[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.theInventory[index] != null) + { + ItemStack itemstack; + + if (index == 2) + { + itemstack = this.theInventory[index]; + this.theInventory[index] = null; + return itemstack; + } + else if (this.theInventory[index].stackSize <= count) + { + itemstack = this.theInventory[index]; + this.theInventory[index] = null; + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + + return itemstack; + } + else + { + itemstack = this.theInventory[index].splitStack(count); + + if (this.theInventory[index].stackSize == 0) + { + this.theInventory[index] = null; + } + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * if par1 slot has changed, does resetRecipeAndSlots need to be called? + */ + private boolean inventoryResetNeededOnSlotChange(int p_70469_1_) + { + return p_70469_1_ == 0 || p_70469_1_ == 1; + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.theInventory[index] != null) + { + ItemStack itemstack = this.theInventory[index]; + this.theInventory[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.theInventory[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + if (this.inventoryResetNeededOnSlotChange(index)) + { + this.resetRecipeAndSlots(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return "mob.villager"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return false; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.theMerchant.getCustomer() == player; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + this.resetRecipeAndSlots(); + } + + public void resetRecipeAndSlots() + { + this.currentRecipe = null; + ItemStack itemstack = this.theInventory[0]; + ItemStack itemstack1 = this.theInventory[1]; + + if (itemstack == null) + { + itemstack = itemstack1; + itemstack1 = null; + } + + if (itemstack == null) + { + this.setInventorySlotContents(2, (ItemStack)null); + } + else + { + MerchantRecipeList merchantrecipelist = this.theMerchant.getRecipes(this.thePlayer); + + if (merchantrecipelist != null) + { + MerchantRecipe merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack, itemstack1, this.currentRecipeIndex); + + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) + { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } + else if (itemstack1 != null) + { + merchantrecipe = merchantrecipelist.canRecipeBeUsed(itemstack1, itemstack, this.currentRecipeIndex); + + if (merchantrecipe != null && !merchantrecipe.isRecipeDisabled()) + { + this.currentRecipe = merchantrecipe; + this.setInventorySlotContents(2, merchantrecipe.getItemToSell().copy()); + } + else + { + this.setInventorySlotContents(2, (ItemStack)null); + } + } + else + { + this.setInventorySlotContents(2, (ItemStack)null); + } + } + } + + this.theMerchant.func_110297_a_(this.getStackInSlot(2)); + } + + public MerchantRecipe getCurrentRecipe() + { + return this.currentRecipe; + } + + public void setCurrentRecipeIndex(int p_70471_1_) + { + this.currentRecipeIndex = p_70471_1_; + this.resetRecipeAndSlots(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/Slot.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/Slot.java new file mode 100644 index 0000000..4fabb27 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/Slot.java @@ -0,0 +1,206 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +public class Slot +{ + /** The index of the slot in the inventory. */ + private final int slotIndex; + /** The inventory we want to extract a slot from. */ + public final IInventory inventory; + /** the id of the slot(also the index in the inventory arraylist) */ + public int slotNumber; + /** display position of the inventory slot on the screen x axis */ + public int xDisplayPosition; + /** display position of the inventory slot on the screen y axis */ + public int yDisplayPosition; + private static final String __OBFID = "CL_00001762"; + + /** Position within background texture file, normally -1 which causes no background to be drawn. */ + protected IIcon backgroundIcon = null; + + /** Background texture file assigned to this slot, if any. Vanilla "/gui/items.png" is used if this is null. */ + @SideOnly(Side.CLIENT) + protected ResourceLocation texture; + + public Slot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) + { + this.inventory = p_i1824_1_; + this.slotIndex = p_i1824_2_; + this.xDisplayPosition = p_i1824_3_; + this.yDisplayPosition = p_i1824_4_; + } + + /** + * if par2 has more items than par1, onCrafting(item,countIncrease) is called + */ + public void onSlotChange(ItemStack p_75220_1_, ItemStack p_75220_2_) + { + if (p_75220_1_ != null && p_75220_2_ != null) + { + if (p_75220_1_.getItem() == p_75220_2_.getItem()) + { + int i = p_75220_2_.stackSize - p_75220_1_.stackSize; + + if (i > 0) + { + this.onCrafting(p_75220_1_, i); + } + } + } + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) {} + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) {} + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + this.onSlotChanged(); + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return true; + } + + /** + * Helper fnct to get the stack in the slot. + */ + public ItemStack getStack() + { + return this.inventory.getStackInSlot(this.slotIndex); + } + + /** + * Returns if this slot contains a stack. + */ + public boolean getHasStack() + { + return this.getStack() != null; + } + + /** + * Helper method to put a stack in the slot. + */ + public void putStack(ItemStack p_75215_1_) + { + this.inventory.setInventorySlotContents(this.slotIndex, p_75215_1_); + this.onSlotChanged(); + } + + /** + * Called when the stack in a Slot changes + */ + public void onSlotChanged() + { + this.inventory.markDirty(); + } + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case + * of armor slots) + */ + public int getSlotStackLimit() + { + return this.inventory.getInventoryStackLimit(); + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) + { + return this.inventory.decrStackSize(this.slotIndex, p_75209_1_); + } + + /** + * returns true if this slot is in par2 of par1 + */ + public boolean isSlotInInventory(IInventory p_75217_1_, int p_75217_2_) + { + return p_75217_1_ == this.inventory && p_75217_2_ == this.slotIndex; + } + + /** + * Return whether this slot's stack can be taken from this slot. + */ + public boolean canTakeStack(EntityPlayer p_82869_1_) + { + return true; + } + + /** + * Returns the icon index on items.png that is used as background image of the slot. + */ + @SideOnly(Side.CLIENT) + public IIcon getBackgroundIconIndex() + { + return backgroundIcon; + } + + @SideOnly(Side.CLIENT) + public boolean func_111238_b() + { + return true; + } + + /*========================================= FORGE START =====================================*/ + /** + * Gets the path of the texture file to use for the background image of this slot when drawing the GUI. + * @return String: The texture file that will be used in GuiContainer.drawSlotInventory for the slot background. + */ + @SideOnly(Side.CLIENT) + public ResourceLocation getBackgroundIconTexture() + { + return (texture == null ? TextureMap.locationItemsTexture : texture); + } + + /** + * Sets which icon index to use as the background image of the slot when it's empty. + * @param icon The icon to use, null for none + */ + public void setBackgroundIcon(IIcon icon) + { + backgroundIcon = icon; + } + + /** + * Sets the texture file to use for the background image of the slot when it's empty. + * @param textureFilename String: Path of texture file to use, or null to use "/gui/items.png" + */ + @SideOnly(Side.CLIENT) + public void setBackgroundIconTexture(ResourceLocation texture) + { + this.texture = texture; + } + + /** + * Retrieves the index in the inventory for this slot, this value should typically not + * be used, but can be useful for some occasions. + * + * @return Index in associated inventory for this slot. + */ + public int getSlotIndex() + { + return slotIndex; + } + /*========================================= FORGE END =====================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotCrafting.java new file mode 100644 index 0000000..bc4ca96 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotCrafting.java @@ -0,0 +1,162 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.stats.AchievementList; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; + +public class SlotCrafting extends Slot +{ + /** The craft matrix inventory linked to this result slot. */ + private final IInventory craftMatrix; + /** The player that is using the GUI where this slot resides. */ + private EntityPlayer thePlayer; + /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */ + private int amountCrafted; + private static final String __OBFID = "CL_00001761"; + + public SlotCrafting(EntityPlayer p_i1823_1_, IInventory p_i1823_2_, IInventory p_i1823_3_, int p_i1823_4_, int p_i1823_5_, int p_i1823_6_) + { + super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_); + this.thePlayer = p_i1823_1_; + this.craftMatrix = p_i1823_2_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) + { + if (this.getHasStack()) + { + this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) + { + this.amountCrafted += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) + { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + this.amountCrafted = 0; + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) + { + this.thePlayer.addStat(AchievementList.buildWorkBench, 1); + } + + if (p_75208_1_.getItem() instanceof ItemPickaxe) + { + this.thePlayer.addStat(AchievementList.buildPickaxe, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) + { + this.thePlayer.addStat(AchievementList.buildFurnace, 1); + } + + if (p_75208_1_.getItem() instanceof ItemHoe) + { + this.thePlayer.addStat(AchievementList.buildHoe, 1); + } + + if (p_75208_1_.getItem() == Items.bread) + { + this.thePlayer.addStat(AchievementList.makeBread, 1); + } + + if (p_75208_1_.getItem() == Items.cake) + { + this.thePlayer.addStat(AchievementList.bakeCake, 1); + } + + if (p_75208_1_.getItem() instanceof ItemPickaxe && ((ItemPickaxe)p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) + { + this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); + } + + if (p_75208_1_.getItem() instanceof ItemSword) + { + this.thePlayer.addStat(AchievementList.buildSword, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) + { + this.thePlayer.addStat(AchievementList.enchantments, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) + { + this.thePlayer.addStat(AchievementList.bookcase, 1); + } + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, craftMatrix); + this.onCrafting(p_82870_2_); + + for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) + { + ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + + if (itemstack1 != null) + { + this.craftMatrix.decrStackSize(i, 1); + + if (itemstack1.getItem().hasContainerItem(itemstack1)) + { + ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); + + if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); + continue; + } + + if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) + { + if (this.craftMatrix.getStackInSlot(i) == null) + { + this.craftMatrix.setInventorySlotContents(i, itemstack2); + } + else + { + this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotFurnace.java new file mode 100644 index 0000000..3bf6019 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotFurnace.java @@ -0,0 +1,114 @@ +package net.minecraft.inventory; + +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.MathHelper; + +public class SlotFurnace extends Slot +{ + /** The player that is using the GUI where this slot resides. */ + private EntityPlayer thePlayer; + private int field_75228_b; + private static final String __OBFID = "CL_00001749"; + + public SlotFurnace(EntityPlayer p_i1813_1_, IInventory p_i1813_2_, int p_i1813_3_, int p_i1813_4_, int p_i1813_5_) + { + super(p_i1813_2_, p_i1813_3_, p_i1813_4_, p_i1813_5_); + this.thePlayer = p_i1813_1_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) + { + if (this.getHasStack()) + { + this.field_75228_b += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + this.onCrafting(p_82870_2_); + super.onPickupFromSlot(p_82870_1_, p_82870_2_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) + { + this.field_75228_b += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) + { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); + + if (!this.thePlayer.worldObj.isRemote) + { + int i = this.field_75228_b; + float f = FurnaceRecipes.smelting().func_151398_b(p_75208_1_); + int j; + + if (f == 0.0F) + { + i = 0; + } + else if (f < 1.0F) + { + j = MathHelper.floor_float((float)i * f); + + if (j < MathHelper.ceiling_float_int((float)i * f) && (float)Math.random() < (float)i * f - (float)j) + { + ++j; + } + + i = j; + } + + while (i > 0) + { + j = EntityXPOrb.getXPSplit(i); + i -= j; + this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, j)); + } + } + + this.field_75228_b = 0; + + FMLCommonHandler.instance().firePlayerSmeltedEvent(thePlayer, p_75208_1_); + + if (p_75208_1_.getItem() == Items.iron_ingot) + { + this.thePlayer.addStat(AchievementList.acquireIron, 1); + } + + if (p_75208_1_.getItem() == Items.cooked_fished) + { + this.thePlayer.addStat(AchievementList.cookFish, 1); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotMerchantResult.java b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotMerchantResult.java new file mode 100644 index 0000000..1dec905 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/inventory/SlotMerchantResult.java @@ -0,0 +1,121 @@ +package net.minecraft.inventory; + +import net.minecraft.entity.IMerchant; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; + +public class SlotMerchantResult extends Slot +{ + /** Merchant's inventory. */ + private final InventoryMerchant theMerchantInventory; + /** The Player whos trying to buy/sell stuff. */ + private EntityPlayer thePlayer; + private int field_75231_g; + /** "Instance" of the Merchant. */ + private final IMerchant theMerchant; + private static final String __OBFID = "CL_00001758"; + + public SlotMerchantResult(EntityPlayer p_i1822_1_, IMerchant p_i1822_2_, InventoryMerchant p_i1822_3_, int p_i1822_4_, int p_i1822_5_, int p_i1822_6_) + { + super(p_i1822_3_, p_i1822_4_, p_i1822_5_, p_i1822_6_); + this.thePlayer = p_i1822_1_; + this.theMerchant = p_i1822_2_; + this.theMerchantInventory = p_i1822_3_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack stack) + { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int p_75209_1_) + { + if (this.getHasStack()) + { + this.field_75231_g += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) + { + this.field_75231_g += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + protected void onCrafting(ItemStack p_75208_1_) + { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); + this.field_75231_g = 0; + } + + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + this.onCrafting(p_82870_2_); + MerchantRecipe merchantrecipe = this.theMerchantInventory.getCurrentRecipe(); + + if (merchantrecipe != null) + { + ItemStack itemstack1 = this.theMerchantInventory.getStackInSlot(0); + ItemStack itemstack2 = this.theMerchantInventory.getStackInSlot(1); + + if (this.func_75230_a(merchantrecipe, itemstack1, itemstack2) || this.func_75230_a(merchantrecipe, itemstack2, itemstack1)) + { + this.theMerchant.useRecipe(merchantrecipe); + + if (itemstack1 != null && itemstack1.stackSize <= 0) + { + itemstack1 = null; + } + + if (itemstack2 != null && itemstack2.stackSize <= 0) + { + itemstack2 = null; + } + + this.theMerchantInventory.setInventorySlotContents(0, itemstack1); + this.theMerchantInventory.setInventorySlotContents(1, itemstack2); + } + } + } + + private boolean func_75230_a(MerchantRecipe trade, ItemStack firstItem, ItemStack secondItem) + { + ItemStack itemstack2 = trade.getItemToBuy(); + ItemStack itemstack3 = trade.getSecondItemToBuy(); + + if (firstItem != null && firstItem.getItem() == itemstack2.getItem()) + { + if (itemstack3 != null && secondItem != null && itemstack3.getItem() == secondItem.getItem()) + { + firstItem.stackSize -= itemstack2.stackSize; + secondItem.stackSize -= itemstack3.stackSize; + return true; + } + + if (itemstack3 == null && secondItem == null) + { + firstItem.stackSize -= itemstack2.stackSize; + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/EnumAction.java b/build/rfg/minecraft-src/java/net/minecraft/item/EnumAction.java new file mode 100644 index 0000000..58cf652 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/EnumAction.java @@ -0,0 +1,12 @@ +package net.minecraft.item; + +public enum EnumAction +{ + none, + eat, + drink, + block, + bow; + + private static final String __OBFID = "CL_00000073"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/EnumRarity.java b/build/rfg/minecraft-src/java/net/minecraft/item/EnumRarity.java new file mode 100644 index 0000000..e33eeaf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/EnumRarity.java @@ -0,0 +1,26 @@ +package net.minecraft.item; + +import net.minecraft.util.EnumChatFormatting; + +public enum EnumRarity +{ + common(EnumChatFormatting.WHITE, "Common"), + uncommon(EnumChatFormatting.YELLOW, "Uncommon"), + rare(EnumChatFormatting.AQUA, "Rare"), + epic(EnumChatFormatting.LIGHT_PURPLE, "Epic"); + /** + * A decimal representation of the hex color codes of a the color assigned to this rarity type. (13 becomes d as in + * \247d which is light purple) + */ + public final EnumChatFormatting rarityColor; + /** Rarity name. */ + public final String rarityName; + + private static final String __OBFID = "CL_00000056"; + + private EnumRarity(EnumChatFormatting p_i45349_3_, String p_i45349_4_) + { + this.rarityColor = p_i45349_3_; + this.rarityName = p_i45349_4_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/Item.java b/build/rfg/minecraft-src/java/net/minecraft/item/Item.java new file mode 100644 index 0000000..3687c12 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/Item.java @@ -0,0 +1,1581 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.registry.GameData; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirt; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockNewLog; +import net.minecraft.block.BlockOldLog; +import net.minecraft.block.BlockQuartz; +import net.minecraft.block.BlockSand; +import net.minecraft.block.BlockSandStone; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStoneBrick; +import net.minecraft.block.BlockWall; +import net.minecraft.block.BlockWood; +import net.minecraft.block.material.Material; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.RegistryNamespaced; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.util.EnumHelper; + +public class Item +{ + public static final RegistryNamespaced itemRegistry = GameData.getItemRegistry(); + protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs tabToDisplayOn; + /** The RNG used by the Item subclasses. */ + protected static Random itemRand = new Random(); + /** Maximum size of the stack. */ + protected int maxStackSize = 64; + /** Maximum damage an item can handle. */ + private int maxDamage; + /** If true, render the object in full 3D, like weapons and tools. */ + protected boolean bFull3D; + /** Some items (like dyes) have multiple subtypes on same item, this is field define this behavior */ + protected boolean hasSubtypes; + private Item containerItem; + private String potionEffect; + /** The unlocalized name of this item. */ + private String unlocalizedName; + /** Icon index in the icons table. */ + @SideOnly(Side.CLIENT) + protected IIcon itemIcon; + /** The string associated with this Item's Icon. */ + protected String iconString; + private static final String __OBFID = "CL_00000041"; + + public final cpw.mods.fml.common.registry.RegistryDelegate delegate = + ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)itemRegistry).getDelegate(this, Item.class); + public static int getIdFromItem(Item p_150891_0_) + { + return p_150891_0_ == null ? 0 : itemRegistry.getIDForObject(p_150891_0_); + } + + public static Item getItemById(int p_150899_0_) + { + return (Item)itemRegistry.getObjectById(p_150899_0_); + } + + public static Item getItemFromBlock(Block p_150898_0_) + { + return getItemById(Block.getIdFromBlock(p_150898_0_)); + } + + public static void registerItems() + { + itemRegistry.addObject(256, "iron_shovel", (new ItemSpade(Item.ToolMaterial.IRON)).setUnlocalizedName("shovelIron").setTextureName("iron_shovel")); + itemRegistry.addObject(257, "iron_pickaxe", (new ItemPickaxe(Item.ToolMaterial.IRON)).setUnlocalizedName("pickaxeIron").setTextureName("iron_pickaxe")); + itemRegistry.addObject(258, "iron_axe", (new ItemAxe(Item.ToolMaterial.IRON)).setUnlocalizedName("hatchetIron").setTextureName("iron_axe")); + itemRegistry.addObject(259, "flint_and_steel", (new ItemFlintAndSteel()).setUnlocalizedName("flintAndSteel").setTextureName("flint_and_steel")); + itemRegistry.addObject(260, "apple", (new ItemFood(4, 0.3F, false)).setUnlocalizedName("apple").setTextureName("apple")); + itemRegistry.addObject(261, "bow", (new ItemBow()).setUnlocalizedName("bow").setTextureName("bow")); + itemRegistry.addObject(262, "arrow", (new Item()).setUnlocalizedName("arrow").setCreativeTab(CreativeTabs.tabCombat).setTextureName("arrow")); + itemRegistry.addObject(263, "coal", (new ItemCoal()).setUnlocalizedName("coal").setTextureName("coal")); + itemRegistry.addObject(264, "diamond", (new Item()).setUnlocalizedName("diamond").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("diamond")); + itemRegistry.addObject(265, "iron_ingot", (new Item()).setUnlocalizedName("ingotIron").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("iron_ingot")); + itemRegistry.addObject(266, "gold_ingot", (new Item()).setUnlocalizedName("ingotGold").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_ingot")); + itemRegistry.addObject(267, "iron_sword", (new ItemSword(Item.ToolMaterial.IRON)).setUnlocalizedName("swordIron").setTextureName("iron_sword")); + itemRegistry.addObject(268, "wooden_sword", (new ItemSword(Item.ToolMaterial.WOOD)).setUnlocalizedName("swordWood").setTextureName("wood_sword")); + itemRegistry.addObject(269, "wooden_shovel", (new ItemSpade(Item.ToolMaterial.WOOD)).setUnlocalizedName("shovelWood").setTextureName("wood_shovel")); + itemRegistry.addObject(270, "wooden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("pickaxeWood").setTextureName("wood_pickaxe")); + itemRegistry.addObject(271, "wooden_axe", (new ItemAxe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hatchetWood").setTextureName("wood_axe")); + itemRegistry.addObject(272, "stone_sword", (new ItemSword(Item.ToolMaterial.STONE)).setUnlocalizedName("swordStone").setTextureName("stone_sword")); + itemRegistry.addObject(273, "stone_shovel", (new ItemSpade(Item.ToolMaterial.STONE)).setUnlocalizedName("shovelStone").setTextureName("stone_shovel")); + itemRegistry.addObject(274, "stone_pickaxe", (new ItemPickaxe(Item.ToolMaterial.STONE)).setUnlocalizedName("pickaxeStone").setTextureName("stone_pickaxe")); + itemRegistry.addObject(275, "stone_axe", (new ItemAxe(Item.ToolMaterial.STONE)).setUnlocalizedName("hatchetStone").setTextureName("stone_axe")); + itemRegistry.addObject(276, "diamond_sword", (new ItemSword(Item.ToolMaterial.EMERALD)).setUnlocalizedName("swordDiamond").setTextureName("diamond_sword")); + itemRegistry.addObject(277, "diamond_shovel", (new ItemSpade(Item.ToolMaterial.EMERALD)).setUnlocalizedName("shovelDiamond").setTextureName("diamond_shovel")); + itemRegistry.addObject(278, "diamond_pickaxe", (new ItemPickaxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("pickaxeDiamond").setTextureName("diamond_pickaxe")); + itemRegistry.addObject(279, "diamond_axe", (new ItemAxe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hatchetDiamond").setTextureName("diamond_axe")); + itemRegistry.addObject(280, "stick", (new Item()).setFull3D().setUnlocalizedName("stick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("stick")); + itemRegistry.addObject(281, "bowl", (new Item()).setUnlocalizedName("bowl").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("bowl")); + itemRegistry.addObject(282, "mushroom_stew", (new ItemSoup(6)).setUnlocalizedName("mushroomStew").setTextureName("mushroom_stew")); + itemRegistry.addObject(283, "golden_sword", (new ItemSword(Item.ToolMaterial.GOLD)).setUnlocalizedName("swordGold").setTextureName("gold_sword")); + itemRegistry.addObject(284, "golden_shovel", (new ItemSpade(Item.ToolMaterial.GOLD)).setUnlocalizedName("shovelGold").setTextureName("gold_shovel")); + itemRegistry.addObject(285, "golden_pickaxe", (new ItemPickaxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("pickaxeGold").setTextureName("gold_pickaxe")); + itemRegistry.addObject(286, "golden_axe", (new ItemAxe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hatchetGold").setTextureName("gold_axe")); + itemRegistry.addObject(287, "string", (new ItemReed(Blocks.tripwire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("string")); + itemRegistry.addObject(288, "feather", (new Item()).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather")); + itemRegistry.addObject(289, "gunpowder", (new Item()).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder")); + itemRegistry.addObject(290, "wooden_hoe", (new ItemHoe(Item.ToolMaterial.WOOD)).setUnlocalizedName("hoeWood").setTextureName("wood_hoe")); + itemRegistry.addObject(291, "stone_hoe", (new ItemHoe(Item.ToolMaterial.STONE)).setUnlocalizedName("hoeStone").setTextureName("stone_hoe")); + itemRegistry.addObject(292, "iron_hoe", (new ItemHoe(Item.ToolMaterial.IRON)).setUnlocalizedName("hoeIron").setTextureName("iron_hoe")); + itemRegistry.addObject(293, "diamond_hoe", (new ItemHoe(Item.ToolMaterial.EMERALD)).setUnlocalizedName("hoeDiamond").setTextureName("diamond_hoe")); + itemRegistry.addObject(294, "golden_hoe", (new ItemHoe(Item.ToolMaterial.GOLD)).setUnlocalizedName("hoeGold").setTextureName("gold_hoe")); + itemRegistry.addObject(295, "wheat_seeds", (new ItemSeeds(Blocks.wheat, Blocks.farmland)).setUnlocalizedName("seeds").setTextureName("seeds_wheat")); + itemRegistry.addObject(296, "wheat", (new Item()).setUnlocalizedName("wheat").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("wheat")); + itemRegistry.addObject(297, "bread", (new ItemFood(5, 0.6F, false)).setUnlocalizedName("bread").setTextureName("bread")); + itemRegistry.addObject(298, "leather_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 0)).setUnlocalizedName("helmetCloth").setTextureName("leather_helmet")); + itemRegistry.addObject(299, "leather_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 1)).setUnlocalizedName("chestplateCloth").setTextureName("leather_chestplate")); + itemRegistry.addObject(300, "leather_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 2)).setUnlocalizedName("leggingsCloth").setTextureName("leather_leggings")); + itemRegistry.addObject(301, "leather_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CLOTH, 0, 3)).setUnlocalizedName("bootsCloth").setTextureName("leather_boots")); + itemRegistry.addObject(302, "chainmail_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 0)).setUnlocalizedName("helmetChain").setTextureName("chainmail_helmet")); + itemRegistry.addObject(303, "chainmail_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 1)).setUnlocalizedName("chestplateChain").setTextureName("chainmail_chestplate")); + itemRegistry.addObject(304, "chainmail_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 2)).setUnlocalizedName("leggingsChain").setTextureName("chainmail_leggings")); + itemRegistry.addObject(305, "chainmail_boots", (new ItemArmor(ItemArmor.ArmorMaterial.CHAIN, 1, 3)).setUnlocalizedName("bootsChain").setTextureName("chainmail_boots")); + itemRegistry.addObject(306, "iron_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 0)).setUnlocalizedName("helmetIron").setTextureName("iron_helmet")); + itemRegistry.addObject(307, "iron_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 1)).setUnlocalizedName("chestplateIron").setTextureName("iron_chestplate")); + itemRegistry.addObject(308, "iron_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 2)).setUnlocalizedName("leggingsIron").setTextureName("iron_leggings")); + itemRegistry.addObject(309, "iron_boots", (new ItemArmor(ItemArmor.ArmorMaterial.IRON, 2, 3)).setUnlocalizedName("bootsIron").setTextureName("iron_boots")); + itemRegistry.addObject(310, "diamond_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 0)).setUnlocalizedName("helmetDiamond").setTextureName("diamond_helmet")); + itemRegistry.addObject(311, "diamond_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 1)).setUnlocalizedName("chestplateDiamond").setTextureName("diamond_chestplate")); + itemRegistry.addObject(312, "diamond_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 2)).setUnlocalizedName("leggingsDiamond").setTextureName("diamond_leggings")); + itemRegistry.addObject(313, "diamond_boots", (new ItemArmor(ItemArmor.ArmorMaterial.DIAMOND, 3, 3)).setUnlocalizedName("bootsDiamond").setTextureName("diamond_boots")); + itemRegistry.addObject(314, "golden_helmet", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 0)).setUnlocalizedName("helmetGold").setTextureName("gold_helmet")); + itemRegistry.addObject(315, "golden_chestplate", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold").setTextureName("gold_chestplate")); + itemRegistry.addObject(316, "golden_leggings", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold").setTextureName("gold_leggings")); + itemRegistry.addObject(317, "golden_boots", (new ItemArmor(ItemArmor.ArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold").setTextureName("gold_boots")); + itemRegistry.addObject(318, "flint", (new Item()).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint")); + itemRegistry.addObject(319, "porkchop", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("porkchopRaw").setTextureName("porkchop_raw")); + itemRegistry.addObject(320, "cooked_porkchop", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("porkchopCooked").setTextureName("porkchop_cooked")); + itemRegistry.addObject(321, "painting", (new ItemHangingEntity(EntityPainting.class)).setUnlocalizedName("painting").setTextureName("painting")); + itemRegistry.addObject(322, "golden_apple", (new ItemAppleGold(4, 1.2F, false)).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 1, 1.0F).setUnlocalizedName("appleGold").setTextureName("apple_golden")); + itemRegistry.addObject(323, "sign", (new ItemSign()).setUnlocalizedName("sign").setTextureName("sign")); + itemRegistry.addObject(324, "wooden_door", (new ItemDoor(Material.wood)).setUnlocalizedName("doorWood").setTextureName("door_wood")); + Item item = (new ItemBucket(Blocks.air)).setUnlocalizedName("bucket").setMaxStackSize(16).setTextureName("bucket_empty"); + itemRegistry.addObject(325, "bucket", item); + itemRegistry.addObject(326, "water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(item).setTextureName("bucket_water")); + itemRegistry.addObject(327, "lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(item).setTextureName("bucket_lava")); + itemRegistry.addObject(328, "minecart", (new ItemMinecart(0)).setUnlocalizedName("minecart").setTextureName("minecart_normal")); + itemRegistry.addObject(329, "saddle", (new ItemSaddle()).setUnlocalizedName("saddle").setTextureName("saddle")); + itemRegistry.addObject(330, "iron_door", (new ItemDoor(Material.iron)).setUnlocalizedName("doorIron").setTextureName("door_iron")); + itemRegistry.addObject(331, "redstone", (new ItemRedstone()).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect).setTextureName("redstone_dust")); + itemRegistry.addObject(332, "snowball", (new ItemSnowball()).setUnlocalizedName("snowball").setTextureName("snowball")); + itemRegistry.addObject(333, "boat", (new ItemBoat()).setUnlocalizedName("boat").setTextureName("boat")); + itemRegistry.addObject(334, "leather", (new Item()).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("leather")); + itemRegistry.addObject(335, "milk_bucket", (new ItemBucketMilk()).setUnlocalizedName("milk").setContainerItem(item).setTextureName("bucket_milk")); + itemRegistry.addObject(336, "brick", (new Item()).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("brick")); + itemRegistry.addObject(337, "clay_ball", (new Item()).setUnlocalizedName("clay").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("clay_ball")); + itemRegistry.addObject(338, "reeds", (new ItemReed(Blocks.reeds)).setUnlocalizedName("reeds").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("reeds")); + itemRegistry.addObject(339, "paper", (new Item()).setUnlocalizedName("paper").setCreativeTab(CreativeTabs.tabMisc).setTextureName("paper")); + itemRegistry.addObject(340, "book", (new ItemBook()).setUnlocalizedName("book").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_normal")); + itemRegistry.addObject(341, "slime_ball", (new Item()).setUnlocalizedName("slimeball").setCreativeTab(CreativeTabs.tabMisc).setTextureName("slimeball")); + itemRegistry.addObject(342, "chest_minecart", (new ItemMinecart(1)).setUnlocalizedName("minecartChest").setTextureName("minecart_chest")); + itemRegistry.addObject(343, "furnace_minecart", (new ItemMinecart(2)).setUnlocalizedName("minecartFurnace").setTextureName("minecart_furnace")); + itemRegistry.addObject(344, "egg", (new ItemEgg()).setUnlocalizedName("egg").setTextureName("egg")); + itemRegistry.addObject(345, "compass", (new Item()).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools).setTextureName("compass")); + itemRegistry.addObject(346, "fishing_rod", (new ItemFishingRod()).setUnlocalizedName("fishingRod").setTextureName("fishing_rod")); + itemRegistry.addObject(347, "clock", (new Item()).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools).setTextureName("clock")); + itemRegistry.addObject(348, "glowstone_dust", (new Item()).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust")); + itemRegistry.addObject(349, "fish", (new ItemFishFood(false)).setUnlocalizedName("fish").setTextureName("fish_raw").setHasSubtypes(true)); + itemRegistry.addObject(350, "cooked_fished", (new ItemFishFood(true)).setUnlocalizedName("fish").setTextureName("fish_cooked").setHasSubtypes(true)); + itemRegistry.addObject(351, "dye", (new ItemDye()).setUnlocalizedName("dyePowder").setTextureName("dye_powder")); + itemRegistry.addObject(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone")); + itemRegistry.addObject(353, "sugar", (new Item()).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar")); + itemRegistry.addObject(354, "cake", (new ItemReed(Blocks.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood).setTextureName("cake")); + itemRegistry.addObject(355, "bed", (new ItemBed()).setMaxStackSize(1).setUnlocalizedName("bed").setTextureName("bed")); + itemRegistry.addObject(356, "repeater", (new ItemReed(Blocks.unpowered_repeater)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("repeater")); + itemRegistry.addObject(357, "cookie", (new ItemFood(2, 0.1F, false)).setUnlocalizedName("cookie").setTextureName("cookie")); + itemRegistry.addObject(358, "filled_map", (new ItemMap()).setUnlocalizedName("map").setTextureName("map_filled")); + itemRegistry.addObject(359, "shears", (new ItemShears()).setUnlocalizedName("shears").setTextureName("shears")); + itemRegistry.addObject(360, "melon", (new ItemFood(2, 0.3F, false)).setUnlocalizedName("melon").setTextureName("melon")); + itemRegistry.addObject(361, "pumpkin_seeds", (new ItemSeeds(Blocks.pumpkin_stem, Blocks.farmland)).setUnlocalizedName("seeds_pumpkin").setTextureName("seeds_pumpkin")); + itemRegistry.addObject(362, "melon_seeds", (new ItemSeeds(Blocks.melon_stem, Blocks.farmland)).setUnlocalizedName("seeds_melon").setTextureName("seeds_melon")); + itemRegistry.addObject(363, "beef", (new ItemFood(3, 0.3F, true)).setUnlocalizedName("beefRaw").setTextureName("beef_raw")); + itemRegistry.addObject(364, "cooked_beef", (new ItemFood(8, 0.8F, true)).setUnlocalizedName("beefCooked").setTextureName("beef_cooked")); + itemRegistry.addObject(365, "chicken", (new ItemFood(2, 0.3F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.3F).setUnlocalizedName("chickenRaw").setTextureName("chicken_raw")); + itemRegistry.addObject(366, "cooked_chicken", (new ItemFood(6, 0.6F, true)).setUnlocalizedName("chickenCooked").setTextureName("chicken_cooked")); + itemRegistry.addObject(367, "rotten_flesh", (new ItemFood(4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh").setTextureName("rotten_flesh")); + itemRegistry.addObject(368, "ender_pearl", (new ItemEnderPearl()).setUnlocalizedName("enderPearl").setTextureName("ender_pearl")); + itemRegistry.addObject(369, "blaze_rod", (new Item()).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("blaze_rod")); + itemRegistry.addObject(370, "ghast_tear", (new Item()).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear")); + itemRegistry.addObject(371, "gold_nugget", (new Item()).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_nugget")); + itemRegistry.addObject(372, "nether_wart", (new ItemSeeds(Blocks.nether_wart, Blocks.soul_sand)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4").setTextureName("nether_wart")); + itemRegistry.addObject(373, "potion", (new ItemPotion()).setUnlocalizedName("potion").setTextureName("potion")); + itemRegistry.addObject(374, "glass_bottle", (new ItemGlassBottle()).setUnlocalizedName("glassBottle").setTextureName("potion_bottle_empty")); + itemRegistry.addObject(375, "spider_eye", (new ItemFood(2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect).setTextureName("spider_eye")); + itemRegistry.addObject(376, "fermented_spider_eye", (new Item()).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented")); + itemRegistry.addObject(377, "blaze_powder", (new Item()).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder")); + itemRegistry.addObject(378, "magma_cream", (new Item()).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream")); + itemRegistry.addObject(379, "brewing_stand", (new ItemReed(Blocks.brewing_stand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("brewing_stand")); + itemRegistry.addObject(380, "cauldron", (new ItemReed(Blocks.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("cauldron")); + itemRegistry.addObject(381, "ender_eye", (new ItemEnderEye()).setUnlocalizedName("eyeOfEnder").setTextureName("ender_eye")); + itemRegistry.addObject(382, "speckled_melon", (new Item()).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled")); + itemRegistry.addObject(383, "spawn_egg", (new ItemMonsterPlacer()).setUnlocalizedName("monsterPlacer").setTextureName("spawn_egg")); + itemRegistry.addObject(384, "experience_bottle", (new ItemExpBottle()).setUnlocalizedName("expBottle").setTextureName("experience_bottle")); + itemRegistry.addObject(385, "fire_charge", (new ItemFireball()).setUnlocalizedName("fireball").setTextureName("fireball")); + itemRegistry.addObject(386, "writable_book", (new ItemWritableBook()).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_writable")); + itemRegistry.addObject(387, "written_book", (new ItemEditableBook()).setUnlocalizedName("writtenBook").setTextureName("book_written").setMaxStackSize(16)); + itemRegistry.addObject(388, "emerald", (new Item()).setUnlocalizedName("emerald").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("emerald")); + itemRegistry.addObject(389, "item_frame", (new ItemHangingEntity(EntityItemFrame.class)).setUnlocalizedName("frame").setTextureName("item_frame")); + itemRegistry.addObject(390, "flower_pot", (new ItemReed(Blocks.flower_pot)).setUnlocalizedName("flowerPot").setCreativeTab(CreativeTabs.tabDecorations).setTextureName("flower_pot")); + itemRegistry.addObject(391, "carrot", (new ItemSeedFood(4, 0.6F, Blocks.carrots, Blocks.farmland)).setUnlocalizedName("carrots").setTextureName("carrot")); + itemRegistry.addObject(392, "potato", (new ItemSeedFood(1, 0.3F, Blocks.potatoes, Blocks.farmland)).setUnlocalizedName("potato").setTextureName("potato")); + itemRegistry.addObject(393, "baked_potato", (new ItemFood(6, 0.6F, false)).setUnlocalizedName("potatoBaked").setTextureName("potato_baked")); + itemRegistry.addObject(394, "poisonous_potato", (new ItemFood(2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous").setTextureName("potato_poisonous")); + itemRegistry.addObject(395, "map", (new ItemEmptyMap()).setUnlocalizedName("emptyMap").setTextureName("map_empty")); + itemRegistry.addObject(396, "golden_carrot", (new ItemFood(6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setTextureName("carrot_golden")); + itemRegistry.addObject(397, "skull", (new ItemSkull()).setUnlocalizedName("skull").setTextureName("skull")); + itemRegistry.addObject(398, "carrot_on_a_stick", (new ItemCarrotOnAStick()).setUnlocalizedName("carrotOnAStick").setTextureName("carrot_on_a_stick")); + itemRegistry.addObject(399, "nether_star", (new ItemSimpleFoiled()).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("nether_star")); + itemRegistry.addObject(400, "pumpkin_pie", (new ItemFood(8, 0.3F, false)).setUnlocalizedName("pumpkinPie").setCreativeTab(CreativeTabs.tabFood).setTextureName("pumpkin_pie")); + itemRegistry.addObject(401, "fireworks", (new ItemFirework()).setUnlocalizedName("fireworks").setTextureName("fireworks")); + itemRegistry.addObject(402, "firework_charge", (new ItemFireworkCharge()).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge")); + itemRegistry.addObject(403, "enchanted_book", (new ItemEnchantedBook()).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted")); + itemRegistry.addObject(404, "comparator", (new ItemReed(Blocks.unpowered_comparator)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator")); + itemRegistry.addObject(405, "netherbrick", (new Item()).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick")); + itemRegistry.addObject(406, "quartz", (new Item()).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz")); + itemRegistry.addObject(407, "tnt_minecart", (new ItemMinecart(3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt")); + itemRegistry.addObject(408, "hopper_minecart", (new ItemMinecart(5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper")); + itemRegistry.addObject(417, "iron_horse_armor", (new Item()).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor")); + itemRegistry.addObject(418, "golden_horse_armor", (new Item()).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor")); + itemRegistry.addObject(419, "diamond_horse_armor", (new Item()).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor")); + itemRegistry.addObject(420, "lead", (new ItemLead()).setUnlocalizedName("leash").setTextureName("lead")); + itemRegistry.addObject(421, "name_tag", (new ItemNameTag()).setUnlocalizedName("nameTag").setTextureName("name_tag")); + itemRegistry.addObject(422, "command_block_minecart", (new ItemMinecart(6)).setUnlocalizedName("minecartCommandBlock").setTextureName("minecart_command_block").setCreativeTab((CreativeTabs)null)); + itemRegistry.addObject(2256, "record_13", (new ItemRecord("13")).setUnlocalizedName("record").setTextureName("record_13")); + itemRegistry.addObject(2257, "record_cat", (new ItemRecord("cat")).setUnlocalizedName("record").setTextureName("record_cat")); + itemRegistry.addObject(2258, "record_blocks", (new ItemRecord("blocks")).setUnlocalizedName("record").setTextureName("record_blocks")); + itemRegistry.addObject(2259, "record_chirp", (new ItemRecord("chirp")).setUnlocalizedName("record").setTextureName("record_chirp")); + itemRegistry.addObject(2260, "record_far", (new ItemRecord("far")).setUnlocalizedName("record").setTextureName("record_far")); + itemRegistry.addObject(2261, "record_mall", (new ItemRecord("mall")).setUnlocalizedName("record").setTextureName("record_mall")); + itemRegistry.addObject(2262, "record_mellohi", (new ItemRecord("mellohi")).setUnlocalizedName("record").setTextureName("record_mellohi")); + itemRegistry.addObject(2263, "record_stal", (new ItemRecord("stal")).setUnlocalizedName("record").setTextureName("record_stal")); + itemRegistry.addObject(2264, "record_strad", (new ItemRecord("strad")).setUnlocalizedName("record").setTextureName("record_strad")); + itemRegistry.addObject(2265, "record_ward", (new ItemRecord("ward")).setUnlocalizedName("record").setTextureName("record_ward")); + itemRegistry.addObject(2266, "record_11", (new ItemRecord("11")).setUnlocalizedName("record").setTextureName("record_11")); + itemRegistry.addObject(2267, "record_wait", (new ItemRecord("wait")).setUnlocalizedName("record").setTextureName("record_wait")); + HashSet hashset = Sets.newHashSet(new Block[] {Blocks.air, Blocks.brewing_stand, Blocks.bed, Blocks.nether_wart, Blocks.cauldron, Blocks.flower_pot, Blocks.wheat, Blocks.reeds, Blocks.cake, Blocks.skull, Blocks.piston_head, Blocks.piston_extension, Blocks.lit_redstone_ore, Blocks.powered_repeater, Blocks.pumpkin_stem, Blocks.standing_sign, Blocks.powered_comparator, Blocks.tripwire, Blocks.lit_redstone_lamp, Blocks.melon_stem, Blocks.unlit_redstone_torch, Blocks.unpowered_comparator, Blocks.redstone_wire, Blocks.wall_sign, Blocks.unpowered_repeater, Blocks.iron_door, Blocks.wooden_door}); + Iterator iterator = Block.blockRegistry.getKeys().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + Block block = (Block)Block.blockRegistry.getObject(s); + Object object; + + if (block == Blocks.wool) + { + object = (new ItemCloth(Blocks.wool)).setUnlocalizedName("cloth"); + } + else if (block == Blocks.stained_hardened_clay) + { + object = (new ItemCloth(Blocks.stained_hardened_clay)).setUnlocalizedName("clayHardenedStained"); + } + else if (block == Blocks.stained_glass) + { + object = (new ItemCloth(Blocks.stained_glass)).setUnlocalizedName("stainedGlass"); + } + else if (block == Blocks.stained_glass_pane) + { + object = (new ItemCloth(Blocks.stained_glass_pane)).setUnlocalizedName("stainedGlassPane"); + } + else if (block == Blocks.carpet) + { + object = (new ItemCloth(Blocks.carpet)).setUnlocalizedName("woolCarpet"); + } + else if (block == Blocks.dirt) + { + object = (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, BlockDirt.field_150009_a)).setUnlocalizedName("dirt"); + } + else if (block == Blocks.sand) + { + object = (new ItemMultiTexture(Blocks.sand, Blocks.sand, BlockSand.field_149838_a)).setUnlocalizedName("sand"); + } + else if (block == Blocks.log) + { + object = (new ItemMultiTexture(Blocks.log, Blocks.log, BlockOldLog.field_150168_M)).setUnlocalizedName("log"); + } + else if (block == Blocks.log2) + { + object = (new ItemMultiTexture(Blocks.log2, Blocks.log2, BlockNewLog.field_150169_M)).setUnlocalizedName("log"); + } + else if (block == Blocks.planks) + { + object = (new ItemMultiTexture(Blocks.planks, Blocks.planks, BlockWood.field_150096_a)).setUnlocalizedName("wood"); + } + else if (block == Blocks.monster_egg) + { + object = (new ItemMultiTexture(Blocks.monster_egg, Blocks.monster_egg, BlockSilverfish.field_150198_a)).setUnlocalizedName("monsterStoneEgg"); + } + else if (block == Blocks.stonebrick) + { + object = (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, BlockStoneBrick.field_150142_a)).setUnlocalizedName("stonebricksmooth"); + } + else if (block == Blocks.sandstone) + { + object = (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, BlockSandStone.field_150157_a)).setUnlocalizedName("sandStone"); + } + else if (block == Blocks.quartz_block) + { + object = (new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, BlockQuartz.field_150191_a)).setUnlocalizedName("quartzBlock"); + } + else if (block == Blocks.stone_slab) + { + object = (new ItemSlab(Blocks.stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, false)).setUnlocalizedName("stoneSlab"); + } + else if (block == Blocks.double_stone_slab) + { + object = (new ItemSlab(Blocks.double_stone_slab, Blocks.stone_slab, Blocks.double_stone_slab, true)).setUnlocalizedName("stoneSlab"); + } + else if (block == Blocks.wooden_slab) + { + object = (new ItemSlab(Blocks.wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, false)).setUnlocalizedName("woodSlab"); + } + else if (block == Blocks.double_wooden_slab) + { + object = (new ItemSlab(Blocks.double_wooden_slab, Blocks.wooden_slab, Blocks.double_wooden_slab, true)).setUnlocalizedName("woodSlab"); + } + else if (block == Blocks.sapling) + { + object = (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, BlockSapling.field_149882_a)).setUnlocalizedName("sapling"); + } + else if (block == Blocks.leaves) + { + object = (new ItemLeaves(Blocks.leaves)).setUnlocalizedName("leaves"); + } + else if (block == Blocks.leaves2) + { + object = (new ItemLeaves(Blocks.leaves2)).setUnlocalizedName("leaves"); + } + else if (block == Blocks.vine) + { + object = new ItemColored(Blocks.vine, false); + } + else if (block == Blocks.tallgrass) + { + object = (new ItemColored(Blocks.tallgrass, true)).func_150943_a(new String[] {"shrub", "grass", "fern"}); + } + else if (block == Blocks.yellow_flower) + { + object = (new ItemMultiTexture(Blocks.yellow_flower, Blocks.yellow_flower, BlockFlower.field_149858_b)).setUnlocalizedName("flower"); + } + else if (block == Blocks.red_flower) + { + object = (new ItemMultiTexture(Blocks.red_flower, Blocks.red_flower, BlockFlower.field_149859_a)).setUnlocalizedName("rose"); + } + else if (block == Blocks.snow_layer) + { + object = new ItemSnow(Blocks.snow_layer, Blocks.snow_layer); + } + else if (block == Blocks.waterlily) + { + object = new ItemLilyPad(Blocks.waterlily); + } + else if (block == Blocks.piston) + { + object = new ItemPiston(Blocks.piston); + } + else if (block == Blocks.sticky_piston) + { + object = new ItemPiston(Blocks.sticky_piston); + } + else if (block == Blocks.cobblestone_wall) + { + object = (new ItemMultiTexture(Blocks.cobblestone_wall, Blocks.cobblestone_wall, BlockWall.field_150092_a)).setUnlocalizedName("cobbleWall"); + } + else if (block == Blocks.anvil) + { + object = (new ItemAnvilBlock(Blocks.anvil)).setUnlocalizedName("anvil"); + } + else if (block == Blocks.double_plant) + { + object = (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, BlockDoublePlant.field_149892_a)).setUnlocalizedName("doublePlant"); + } + else + { + if (hashset.contains(block)) + { + continue; + } + + object = new ItemBlock(block); + } + + itemRegistry.addObject(Block.getIdFromBlock(block), s, object); + } + } + + public Item setMaxStackSize(int p_77625_1_) + { + this.maxStackSize = p_77625_1_; + return this; + } + + /** + * Returns 0 for /terrain.png, 1 for /gui/items.png + */ + @SideOnly(Side.CLIENT) + public int getSpriteNumber() + { + return 1; + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.itemIcon; + } + + /** + * Returns the icon index of the stack given as argument. + */ + @SideOnly(Side.CLIENT) + public IIcon getIconIndex(ItemStack p_77650_1_) + { + return this.getIconFromDamage(p_77650_1_.getItemDamage()); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + return false; + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return 1.0F; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + return itemStackIn; + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + return p_77654_1_; + } + + /** + * Returns the maximum size of the stack for a specific item. + */ + @Deprecated + public int getItemStackLimit() + { + return this.maxStackSize; + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return 0; + } + + public boolean getHasSubtypes() + { + return this.hasSubtypes; + } + + public Item setHasSubtypes(boolean p_77627_1_) + { + this.hasSubtypes = p_77627_1_; + return this; + } + + /** + * Returns the maximum damage an item can take. + */ + public int getMaxDamage() + { + return this.maxDamage; + } + + /** + * set max damage of an Item + */ + public Item setMaxDamage(int p_77656_1_) + { + this.maxDamage = p_77656_1_; + return this; + } + + public boolean isDamageable() + { + return this.maxDamage > 0 && !this.hasSubtypes; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { + return false; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { + return false; + } + + public boolean func_150897_b(Block p_150897_1_) + { + return false; + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) + { + return false; + } + + /** + * Sets bFull3D to True and return the object. + */ + public Item setFull3D() + { + this.bFull3D = true; + return this; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return this.bFull3D; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + @SideOnly(Side.CLIENT) + public boolean shouldRotateAroundWhenRendering() + { + return false; + } + + /** + * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." + */ + public Item setUnlocalizedName(String p_77655_1_) + { + this.unlocalizedName = p_77655_1_; + return this; + } + + /** + * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the + * unlocalized name itself is returned. + */ + public String getUnlocalizedNameInefficiently(ItemStack p_77657_1_) + { + String s = this.getUnlocalizedName(p_77657_1_); + return s == null ? "" : StatCollector.translateToLocal(s); + } + + /** + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() + { + return "item." + this.unlocalizedName; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + return "item." + this.unlocalizedName; + } + + public Item setContainerItem(Item p_77642_1_) + { + this.containerItem = p_77642_1_; + return this; + } + + /** + * If this returns true, after a recipe involving this item is crafted the container item will be added to the + * player's inventory instead of remaining in the crafting grid. + */ + public boolean doesContainerItemLeaveCraftingGrid(ItemStack p_77630_1_) + { + return true; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. + */ + public boolean getShareTag() + { + return true; + } + + public Item getContainerItem() + { + return this.containerItem; + } + + /** + * True if this Item has a container item (a.k.a. crafting result) + */ + @Deprecated // Use ItemStack sensitive version below. + public boolean hasContainerItem() + { + return this.containerItem != null; + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + return 16777215; + } + + /** + * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and + * update it's contents. + */ + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) {} + + /** + * Called when item is crafted/smelted. Used only by maps so far. + */ + public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) {} + + /** + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() + { + return false; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.none; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 0; + } + + /** + * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {} + + /** + * Sets the string representing this item's effect on a potion when used as an ingredient. + */ + public Item setPotionEffect(String p_77631_1_) + { + this.potionEffect = p_77631_1_; + return this; + } + + /** + * Returns a string representing what this item does to a potion. + */ + public String getPotionEffect(ItemStack p_150896_1_) + { + return this.potionEffect; + } + + /** + * Returns true if this item serves as a potion ingredient (its ingredient information is not null). + */ + public boolean isPotionIngredient(ItemStack p_150892_1_) + { + return this.getPotionEffect(p_150892_1_) != null; + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {} + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim(); + } + + @SideOnly(Side.CLIENT) + @Deprecated + public boolean hasEffect(ItemStack p_77636_1_) + { + return p_77636_1_.isItemEnchanted(); + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) + { + return p_77613_1_.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) + { + return this.getItemStackLimit(p_77616_1_) == 1 && this.isDamageable(); + } + + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World worldIn, EntityPlayer player, boolean useLiquids) + { + float f = 1.0F; + float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; + float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + (double)(worldIn.isRemote ? player.getEyeHeight() - player.getDefaultEyeHeight() : player.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + if (player instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP)player).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); + return worldIn.func_147447_a(vec3, vec31, useLiquids, !useLiquids, false); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 0; + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return false; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return this.getIconFromDamage(p_77618_1_); + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + } + + /** + * returns this; + */ + public Item setCreativeTab(CreativeTabs p_77637_1_) + { + this.tabToDisplayOn = p_77637_1_; + return this; + } + + /** + * gets the CreativeTab this item is displayed on + */ + @SideOnly(Side.CLIENT) + public CreativeTabs getCreativeTab() + { + return this.tabToDisplayOn; + } + + /** + * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal) + * when not in creative + */ + public boolean canItemEditBlocks() + { + return true; + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) + { + return false; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.itemIcon = register.registerIcon(this.getIconString()); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + @Deprecated + public Multimap getItemAttributeModifiers() + { + return HashMultimap.create(); + } + + public Item setTextureName(String p_111206_1_) + { + this.iconString = p_111206_1_; + return this; + } + + /** + * Returns the string associated with this Item's Icon. + */ + @SideOnly(Side.CLIENT) + protected String getIconString() + { + return this.iconString == null ? "MISSING_ICON_ITEM_" + itemRegistry.getIDForObject(this) + "_" + this.unlocalizedName : this.iconString; + } + + /* ======================================== FORGE START =====================================*/ + /** + * ItemStack sensitive version of getItemAttributeModifiers + */ + public Multimap getAttributeModifiers(ItemStack stack) + { + return this.getItemAttributeModifiers(); + } + + /** + * Called when a player drops the item into the world, + * returning false from this will prevent the item from + * being removed from the players inventory and spawning + * in the world + * + * @param player The player that dropped the item + * @param item The item stack, before the item is removed. + */ + public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) + { + return true; + } + + /** + * This is called when the item is used, before the block is activated. + * @param stack The Item Stack + * @param player The Player that used the item + * @param world The Current World + * @param x Target X Position + * @param y Target Y Position + * @param z Target Z Position + * @param side The side of the target hit + * @return Return true to prevent any further processing. + */ + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + return false; + } + + /** + * Metadata-sensitive version of getStrVsBlock + * @param itemstack The Item Stack + * @param block The block the item is trying to break + * @param metadata The items current metadata + * @return The damage strength + */ + public float getDigSpeed(ItemStack itemstack, Block block, int metadata) + { + return func_150893_a(itemstack, block); + } + + protected boolean canRepair = true; + /** + * Called by CraftingManager to determine if an item is reparable. + * @return True if reparable + */ + public boolean isRepairable() + { + return canRepair && isDamageable(); + } + + /** + * Call to disable repair recipes. + * @return The current Item instance + */ + public Item setNoRepair() + { + canRepair = false; + return this; + } + + /** + * Called before a block is broken. Return true to prevent default block harvesting. + * + * Note: In SMP, this is called on both client and server sides! + * + * @param itemstack The current ItemStack + * @param X The X Position + * @param Y The X Position + * @param Z The X Position + * @param player The Player that is wielding the item + * @return True to prevent harvesting, false to continue as normal + */ + public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) + { + return false; + } + + /** + * Called each tick while using an item. + * @param stack The Item being used + * @param player The Player using the item + * @param count The amount of time in tick the item has been used for continuously + */ + public void onUsingTick(ItemStack stack, EntityPlayer player, int count) + { + } + + /** + * Called when the player Left Clicks (attacks) an entity. + * Processed before damage is done, if return value is true further processing is canceled + * and the entity is not attacked. + * + * @param stack The Item being used + * @param player The player that is attacking + * @param entity The entity being attacked + * @return True to cancel the rest of the interaction. + */ + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) + { + return false; + } + + /** + * Player, Render pass, and item usage sensitive version of getIconIndex. + * + * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null) + * @param renderPass The pass to get the icon for, 0 is default. + * @param player The player holding the item + * @param usingItem The item the player is actively using. Can be null if not using anything. + * @param useRemaining The ticks remaining for the active item. + * @return The icon index + */ + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) + { + return getIcon(stack, renderPass); + } + + /** + * Returns the number of render passes/layers this item has. + * Usually equates to ItemRenderer.renderItem being called for this many passes. + * Does not get called unless requiresMultipleRenderPasses() is true; + * + * @param metadata The item's metadata + * @return The number of passes to run. + */ + public int getRenderPasses(int metadata) + { + return requiresMultipleRenderPasses() ? 2 : 1; + } + + /** + * ItemStack sensitive version of getContainerItem. + * Returns a full ItemStack instance of the result. + * + * @param itemStack The current ItemStack + * @return The resulting ItemStack + */ + public ItemStack getContainerItem(ItemStack itemStack) + { + if (!hasContainerItem(itemStack)) + { + return null; + } + return new ItemStack(getContainerItem()); + } + + /** + * ItemStack sensitive version of hasContainerItem + * @param stack The current item stack + * @return True if this item has a 'container' + */ + public boolean hasContainerItem(ItemStack stack) + { + return hasContainerItem(); + } + + /** + * Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem. + * This is in ticks, standard result is 6000, or 5 mins. + * + * @param itemStack The current ItemStack + * @param world The world the entity is in + * @return The normal lifespan in ticks. + */ + public int getEntityLifespan(ItemStack itemStack, World world) + { + return 6000; + } + + /** + * Determines if this Item has a special entity for when they are in the world. + * Is called when a EntityItem is spawned in the world, if true and Item#createCustomEntity + * returns non null, the EntityItem will be destroyed and the new Entity will be added to the world. + * + * @param stack The current item stack + * @return True of the item has a custom entity, If true, Item#createCustomEntity will be called + */ + public boolean hasCustomEntity(ItemStack stack) + { + return false; + } + + /** + * This function should return a new entity to replace the dropped item. + * Returning null here will not kill the EntityItem and will leave it to function normally. + * Called when the item it placed in a world. + * + * @param world The world object + * @param location The EntityItem object, useful for getting the position of the entity + * @param itemstack The current item stack + * @return A new Entity object to spawn or null + */ + public Entity createEntity(World world, Entity location, ItemStack itemstack) + { + return null; + } + + /** + * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner + * control over the update of the item without having to write a subclass. + * + * @param entityItem The entity Item + * @return Return true to skip any further update code. + */ + public boolean onEntityItemUpdate(EntityItem entityItem) + { + return false; + } + + /** + * Gets a list of tabs that items belonging to this class can display on, + * combined properly with getSubItems allows for a single item to span + * many sub-items across many tabs. + * + * @return A list of all tabs that this item could possibly be one. + */ + public CreativeTabs[] getCreativeTabs() + { + return new CreativeTabs[]{ getCreativeTab() }; + } + + /** + * Determines the base experience for a player when they remove this item from a furnace slot. + * This number must be between 0 and 1 for it to be valid. + * This number will be multiplied by the stack size to get the total experience. + * + * @param item The item stack the player is picking up. + * @return The amount to award for each item. + */ + public float getSmeltingExperience(ItemStack item) + { + return -1; //-1 will default to the old lookups. + } + + /** + * Return the correct icon for rendering based on the supplied ItemStack and render pass. + * + * Defers to {@link #getIconFromDamageForRenderPass(int, int)} + * @param stack to render for + * @param pass the multi-render pass + * @return the icon + */ + public IIcon getIcon(ItemStack stack, int pass) + { + return getIconFromDamageForRenderPass(stack.getItemDamage(), pass); + } + + /** + * Generates the base Random item for a specific instance of the chest gen, + * Enchanted books use this to pick a random enchantment. + * + * @param chest The chest category to generate for + * @param rnd World RNG + * @param original Original result registered with the chest gen hooks. + * @return New values to use as the random item, typically this will be original + */ + public WeightedRandomChestContent getChestGenBase(ChestGenHooks chest, Random rnd, WeightedRandomChestContent original) + { + if (this instanceof ItemEnchantedBook) + { + return ((ItemEnchantedBook)this).func_92112_a(rnd, + original.theMinimumChanceToGenerateItem, + original.theMaximumChanceToGenerateItem, original.itemWeight); + } + return original; + } + + /** + * + * Should this item, when held, allow sneak-clicks to pass through to the underlying block? + * + * @param world The world + * @param x The X Position + * @param y The X Position + * @param z The X Position + * @param player The Player that is wielding the item + * @return + */ + public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) + { + return false; + } + + /** + * Called to tick armor in the armor slot. Override to do something + * + * @param world + * @param player + * @param itemStack + */ + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) + { + + } + + /** + * Determines if the specific ItemStack can be placed in the specified armor slot. + * + * @param stack The ItemStack + * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots + * @param entity The entity trying to equip the armor + * @return True if the given ItemStack can be inserted in the slot + */ + public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) + { + if (this instanceof ItemArmor) + { + return ((ItemArmor)this).armorType == armorType; + } + + if (armorType == 0) + { + return this == Item.getItemFromBlock(Blocks.pumpkin) || this == Items.skull; + } + + return false; + } + + /** + * Allow or forbid the specific book/item combination as an anvil enchant + * + * @param stack The item + * @param book The book + * @return if the enchantment is allowed + */ + public boolean isBookEnchantable(ItemStack stack, ItemStack book) + { + return true; + } + + /** + * Called by RenderBiped and RenderPlayer to determine the armor texture that + * should be use for the currently equiped item. + * This will only be called on instances of ItemArmor. + * + * Returning null from this function will use the default value. + * + * @param stack ItemStack for the equpt armor + * @param entity The entity wearing the armor + * @param slot The slot the armor is in + * @param type The subtype, can be null or "overlay" + * @return Path of texture to bind, or null to use default + */ + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + return null; + } + + /** + * Returns the font renderer used to render tooltips and overlays for this item. + * Returning null will use the standard font renderer. + * + * @param stack The current item stack + * @return A instance of FontRenderer or null to use default + */ + @SideOnly(Side.CLIENT) + public FontRenderer getFontRenderer(ItemStack stack) + { + return null; + } + + /** + * Override this method to have an item handle its own armor rendering. + * + * @param entityLiving The entity wearing the armor + * @param itemStack The itemStack to render the model of + * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet + * + * @return A ModelBiped to render instead of the default + */ + @SideOnly(Side.CLIENT) + public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + { + return null; + } + + /** + * Called when a entity tries to play the 'swing' animation. + * + * @param entityLiving The entity swinging the item. + * @param stack The Item stack + * @return True to cancel any further processing by EntityLiving + */ + public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) + { + return false; + } + + /** + * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. + * This is where pumpkins would render there overlay. + * + * @param stack The ItemStack that is equipped + * @param player Reference to the current client entity + * @param resolution Resolution information about the current viewport and configured GUI Scale + * @param partialTicks Partial ticks for the renderer, useful for interpolation + * @param hasScreen If the player has a screen up, which will be rendered after this. + * @param mouseX Mouse's X position on screen + * @param mouseY Mouse's Y position on screen + */ + @SideOnly(Side.CLIENT) + public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){} + + /** + * Return the itemDamage represented by this ItemStack. Defaults to the itemDamage field on ItemStack, but can be overridden here for other sources such as NBT. + * + * @param stack The itemstack that is damaged + * @return the damage value + */ + public int getDamage(ItemStack stack) + { + return stack.itemDamage; + } + + @Deprecated // This isn't 'display' its normal Damage, the above function is 'Aux' data, but the same value. + public int getDisplayDamage(ItemStack stack) + { + return stack.itemDamage; + } + + /** + * Determines if the durability bar should be rendered for this item. + * Defaults to vanilla stack.isDamaged behavior. + * But modders can use this for any data they wish. + * + * @param stack The current Item Stack + * @return True if it should render the 'durability' bar. + */ + public boolean showDurabilityBar(ItemStack stack) + { + return stack.isItemDamaged(); + } + + /** + * Queries the percentage of the 'Durability' bar that should be drawn. + * + * @param stack The current ItemStack + * @return 1.0 for 100% 0 for 0% + */ + public double getDurabilityForDisplay(ItemStack stack) + { + return (double)stack.getItemDamageForDisplay() / (double)stack.getMaxDamage(); + } + + /** + * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, + * but can be overridden here for other sources such as NBT. + * + * @param stack The itemstack that is damaged + * @return the damage value + */ + public int getMaxDamage(ItemStack stack) + { + return getMaxDamage(); + } + + /** + * Return if this itemstack is damaged. Note only called if {@link #isDamageable()} is true. + * @param stack the stack + * @return if the stack is damaged + */ + public boolean isDamaged(ItemStack stack) + { + return stack.itemDamage > 0; + } + + /** + * Set the damage for this itemstack. Note, this method is responsible for zero checking. + * @param stack the stack + * @param damage the new damage value + */ + public void setDamage(ItemStack stack, int damage) + { + stack.itemDamage = damage; + + if (stack.itemDamage < 0) + { + stack.itemDamage = 0; + } + } + + /** + * ItemStack sensitive version of {@link #canHarvestBlock(Block)} + * @param par1Block The block trying to harvest + * @param itemStack The itemstack used to harvest the block + * @return true if can harvest the block + */ + public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) + { + return func_150897_b(par1Block); + } + + /** + * Render Pass sensitive version of hasEffect() + */ + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack par1ItemStack, int pass) + { + return hasEffect(par1ItemStack) && (pass == 0 || this != Items.potionitem); + } + + /** + * Gets the maximum number of items that this stack should be able to hold. + * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() + * + * @param stack The ItemStack + * @return THe maximum number this item can be stacked to + */ + public int getItemStackLimit(ItemStack stack) + { + return this.getItemStackLimit(); + } + + private HashMap toolClasses = new HashMap(); + /** + * Sets or removes the harvest level for the specified tool class. + * + * @param toolClass Class + * @param level Harvest level: + * Wood: 0 + * Stone: 1 + * Iron: 2 + * Diamond: 3 + * Gold: 0 + */ + public void setHarvestLevel(String toolClass, int level) + { + if (level < 0) + toolClasses.remove(toolClass); + else + toolClasses.put(toolClass, level); + } + + public Set getToolClasses(ItemStack stack) + { + return toolClasses.keySet(); + } + + /** + * Queries the harvest level of this item stack for the specifred tool class, + * Returns -1 if this tool is not of the specified type + * + * @param stack This item stack instance + * @param toolClass Tool Class + * @return Harvest level, or -1 if not the specified tool type. + */ + public int getHarvestLevel(ItemStack stack, String toolClass) + { + Integer ret = toolClasses.get(toolClass); + return ret == null ? -1 : ret; + } + + /** + * ItemStack sensitive version of getItemEnchantability + * + * @param stack The ItemStack + * @return the item echantability value + */ + public int getItemEnchantability(ItemStack stack) + { + return getItemEnchantability(); + } + + /** + * Whether this Item can be used as a payment to activate the vanilla beacon. + * @param stack the ItemStack + * @return true if this Item can be used + */ + public boolean isBeaconPayment(ItemStack stack) + { + return this == Items.emerald || this == Items.diamond || this == Items.gold_ingot || this == Items.iron_ingot; + } + /* ======================================== FORGE END =====================================*/ + + public static enum ToolMaterial + { + WOOD(0, 59, 2.0F, 0.0F, 15), + STONE(1, 131, 4.0F, 1.0F, 5), + IRON(2, 250, 6.0F, 2.0F, 14), + EMERALD(3, 1561, 8.0F, 3.0F, 10), + GOLD(0, 32, 12.0F, 0.0F, 22); + /** The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = WOOD/GOLD) */ + private final int harvestLevel; + /** The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) */ + private final int maxUses; + /** The strength of this tool material against blocks which it is effective against. */ + private final float efficiencyOnProperMaterial; + /** Damage versus entities. */ + private final float damageVsEntity; + /** Defines the natural enchantability factor of the material. */ + private final int enchantability; + + private static final String __OBFID = "CL_00000042"; + + //Added by forge for custom Tool materials. + @Deprecated public Item customCraftingMaterial = null; + private ItemStack repairMaterial = null; + + private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) + { + this.harvestLevel = p_i1874_3_; + this.maxUses = p_i1874_4_; + this.efficiencyOnProperMaterial = p_i1874_5_; + this.damageVsEntity = p_i1874_6_; + this.enchantability = p_i1874_7_; + } + + /** + * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) + */ + public int getMaxUses() + { + return this.maxUses; + } + + /** + * The strength of this tool material against blocks which it is effective against. + */ + public float getEfficiencyOnProperMaterial() + { + return this.efficiencyOnProperMaterial; + } + + /** + * Damage versus entities. + */ + public float getDamageVsEntity() + { + return this.damageVsEntity; + } + + /** + * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) + */ + public int getHarvestLevel() + { + return this.harvestLevel; + } + + /** + * Return the natural enchantability factor of the material. + */ + public int getEnchantability() + { + return this.enchantability; + } + + @Deprecated // Use getRepairItemStack below + public Item func_150995_f() + { + switch (this) + { + case WOOD: return Item.getItemFromBlock(Blocks.planks); + case STONE: return Item.getItemFromBlock(Blocks.cobblestone); + case GOLD: return Items.gold_ingot; + case IRON: return Items.iron_ingot; + case EMERALD: return Items.diamond; + default: return customCraftingMaterial; + } + } + + public ToolMaterial setRepairItem(ItemStack stack) + { + if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); + if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); + this.repairMaterial = stack; + this.customCraftingMaterial = stack.getItem(); + return this; + } + + public ItemStack getRepairItemStack() + { + if (repairMaterial != null) return repairMaterial; + Item ret = this.func_150995_f(); + if (ret == null) return null; + repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); + return repairMaterial; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemAnvilBlock.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAnvilBlock.java new file mode 100644 index 0000000..0f5967c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAnvilBlock.java @@ -0,0 +1,22 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; + +public class ItemAnvilBlock extends ItemMultiTexture +{ + private static final String __OBFID = "CL_00001764"; + + public ItemAnvilBlock(Block p_i1826_1_) + { + super(p_i1826_1_, p_i1826_1_, BlockAnvil.anvilDamageNames); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_ << 2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemAppleGold.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAppleGold.java new file mode 100644 index 0000000..9880644 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAppleGold.java @@ -0,0 +1,67 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemAppleGold extends ItemFood +{ + private static final String __OBFID = "CL_00000037"; + + public ItemAppleGold(int p_i45341_1_, float p_i45341_2_, boolean p_i45341_3_) + { + super(p_i45341_1_, p_i45341_2_, p_i45341_3_); + this.setHasSubtypes(true); + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + return p_77636_1_.getItemDamage() > 0; + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) + { + return p_77613_1_.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) + { + if (!p_77849_2_.isRemote) + { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); + } + + if (p_77849_1_.getItemDamage() > 0) + { + if (!p_77849_2_.isRemote) + { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + } + } + else + { + super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_); + } + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 1)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemArmor.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemArmor.java new file mode 100644 index 0000000..12e2c96 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemArmor.java @@ -0,0 +1,351 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.BlockDispenser; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.command.IEntitySelector; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemArmor extends Item +{ + /** Holds the 'base' maxDamage that each armorType have. */ + private static final int[] maxDamageArray = new int[] {11, 16, 15, 13}; + private static final String[] CLOTH_OVERLAY_NAMES = new String[] {"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; + public static final String[] EMPTY_SLOT_NAMES = new String[] {"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; + private static final IBehaviorDispenseItem dispenserBehavior = new BehaviorDefaultDispenseItem() + { + private static final String __OBFID = "CL_00001767"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double)i, (double)j, (double)k, (double)(i + 1), (double)(j + 1), (double)(k + 1)); + List list = source.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb, new IEntitySelector.ArmoredMob(stack)); + + if (list.size() > 0) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); + int l = 0;// Forge: We fix the indexes. Mojang Stop hard coding this! + int i1 = EntityLiving.getArmorPosition(stack); + ItemStack itemstack1 = stack.copy(); + itemstack1.stackSize = 1; + entitylivingbase.setCurrentItemOrArmor(i1 - l, itemstack1); + + if (entitylivingbase instanceof EntityLiving) + { + ((EntityLiving)entitylivingbase).setEquipmentDropChance(i1, 2.0F); + } + + --stack.stackSize; + return stack; + } + else + { + return super.dispenseStack(source, stack); + } + } + }; + /** Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots */ + public final int armorType; + /** Holds the amount of damage that the armor reduces at full durability. */ + public final int damageReduceAmount; + /** + * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is + * iron, 3 is diamond and 4 is gold. + */ + public final int renderIndex; + /** The EnumArmorMaterial used for this ItemArmor */ + private final ItemArmor.ArmorMaterial material; + @SideOnly(Side.CLIENT) + private IIcon overlayIcon; + @SideOnly(Side.CLIENT) + private IIcon emptySlotIcon; + private static final String __OBFID = "CL_00001766"; + + public ItemArmor(ItemArmor.ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) + { + this.material = p_i45325_1_; + this.armorType = p_i45325_3_; + this.renderIndex = p_i45325_2_; + this.damageReduceAmount = p_i45325_1_.getDamageReductionAmount(p_i45325_3_); + this.setMaxDamage(p_i45325_1_.getDurability(p_i45325_3_)); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserBehavior); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + if (p_82790_2_ > 0) + { + return 16777215; + } + else + { + int j = this.getColor(p_82790_1_); + + if (j < 0) + { + j = 16777215; + } + + return j; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return this.material == ItemArmor.ArmorMaterial.CLOTH; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return this.material.getEnchantability(); + } + + /** + * Return the armor material for this armor item. + */ + public ItemArmor.ArmorMaterial getArmorMaterial() + { + return this.material; + } + + /** + * Return whether the specified armor ItemStack has a color. + */ + public boolean hasColor(ItemStack p_82816_1_) + { + return this.material != ItemArmor.ArmorMaterial.CLOTH ? false : (!p_82816_1_.hasTagCompound() ? false : (!p_82816_1_.getTagCompound().hasKey("display", 10) ? false : p_82816_1_.getTagCompound().getCompoundTag("display").hasKey("color", 3))); + } + + /** + * Return the color for the specified armor ItemStack. + */ + public int getColor(ItemStack p_82814_1_) + { + if (this.material != ItemArmor.ArmorMaterial.CLOTH) + { + return -1; + } + else + { + NBTTagCompound nbttagcompound = p_82814_1_.getTagCompound(); + + if (nbttagcompound == null) + { + return 10511680; + } + else + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + return nbttagcompound1 == null ? 10511680 : (nbttagcompound1.hasKey("color", 3) ? nbttagcompound1.getInteger("color") : 10511680); + } + } + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return p_77618_2_ == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * Remove the color from the specified armor ItemStack. + */ + public void removeColor(ItemStack p_82815_1_) + { + if (this.material == ItemArmor.ArmorMaterial.CLOTH) + { + NBTTagCompound nbttagcompound = p_82815_1_.getTagCompound(); + + if (nbttagcompound != null) + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + + if (nbttagcompound1.hasKey("color")) + { + nbttagcompound1.removeTag("color"); + } + } + } + } + + public void func_82813_b(ItemStack p_82813_1_, int p_82813_2_) + { + if (this.material != ItemArmor.ArmorMaterial.CLOTH) + { + throw new UnsupportedOperationException("Can\'t dye non-leather!"); + } + else + { + NBTTagCompound nbttagcompound = p_82813_1_.getTagCompound(); + + if (nbttagcompound == null) + { + nbttagcompound = new NBTTagCompound(); + p_82813_1_.setTagCompound(nbttagcompound); + } + + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + + if (!nbttagcompound.hasKey("display", 10)) + { + nbttagcompound.setTag("display", nbttagcompound1); + } + + nbttagcompound1.setInteger("color", p_82813_2_); + } + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) + { + return this.material.func_151685_b() == p_82789_2_.getItem() ? true : super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + super.registerIcons(register); + + if (this.material == ItemArmor.ArmorMaterial.CLOTH) + { + this.overlayIcon = register.registerIcon(CLOTH_OVERLAY_NAMES[this.armorType]); + } + + this.emptySlotIcon = register.registerIcon(EMPTY_SLOT_NAMES[this.armorType]); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + int i = EntityLiving.getArmorPosition(itemStackIn) - 1; + ItemStack itemstack1 = player.getCurrentArmor(i); + + if (itemstack1 == null) + { + player.setCurrentItemOrArmor(i + 1, itemStackIn.copy()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. + itemStackIn.stackSize = 0; + } + + return itemStackIn; + } + + @SideOnly(Side.CLIENT) + public static IIcon func_94602_b(int p_94602_0_) + { + switch (p_94602_0_) + { + case 0: + return Items.diamond_helmet.emptySlotIcon; + case 1: + return Items.diamond_chestplate.emptySlotIcon; + case 2: + return Items.diamond_leggings.emptySlotIcon; + case 3: + return Items.diamond_boots.emptySlotIcon; + default: + return null; + } + } + + public static enum ArmorMaterial + { + CLOTH(5, new int[]{1, 3, 2, 1}, 15), + CHAIN(15, new int[]{2, 5, 4, 1}, 12), + IRON(15, new int[]{2, 6, 5, 2}, 9), + GOLD(7, new int[]{2, 5, 3, 1}, 25), + DIAMOND(33, new int[]{3, 8, 6, 3}, 10); + /** + * Holds the maximum damage factor (each piece multiply this by it's own value) of the material, this is the + * item damage (how much can absorb before breaks) + */ + private int maxDamageFactor; + /** + * Holds the damage reduction (each 1 points is half a shield on gui) of each piece of armor (helmet, plate, + * legs and boots) + */ + private int[] damageReductionAmountArray; + /** Return the enchantability factor of the material */ + private int enchantability; + + private static final String __OBFID = "CL_00001768"; + + //Added by forge for custom Armor materials. + public Item customCraftingMaterial = null; + + private ArmorMaterial(int p_i1827_3_, int[] p_i1827_4_, int p_i1827_5_) + { + this.maxDamageFactor = p_i1827_3_; + this.damageReductionAmountArray = p_i1827_4_; + this.enchantability = p_i1827_5_; + } + + /** + * Returns the durability for a armor slot of for this type. + */ + public int getDurability(int p_78046_1_) + { + return ItemArmor.maxDamageArray[p_78046_1_] * this.maxDamageFactor; + } + + /** + * Return the damage reduction (each 1 point is a half a shield on gui) of the piece index passed (0 = helmet, 1 + * = plate, 2 = legs and 3 = boots) + */ + public int getDamageReductionAmount(int p_78044_1_) + { + return this.damageReductionAmountArray[p_78044_1_]; + } + + /** + * Return the enchantability factor of the material. + */ + public int getEnchantability() + { + return this.enchantability; + } + + public Item func_151685_b() + { + return this == CLOTH ? Items.leather : + (this == CHAIN ? Items.iron_ingot : + (this == GOLD ? Items.gold_ingot : + (this == IRON ? Items.iron_ingot : + (this == DIAMOND ? Items.diamond : + customCraftingMaterial)))); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemAxe.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAxe.java new file mode 100644 index 0000000..cf4e094 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemAxe.java @@ -0,0 +1,23 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemAxe extends ItemTool +{ + private static final Set field_150917_c = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin}); + private static final String __OBFID = "CL_00001770"; + + protected ItemAxe(Item.ToolMaterial p_i45327_1_) + { + super(3.0F, p_i45327_1_, field_150917_c); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return p_150893_2_.getMaterial() != Material.wood && p_150893_2_.getMaterial() != Material.plants && p_150893_2_.getMaterial() != Material.vine ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBed.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBed.java new file mode 100644 index 0000000..4874f62 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBed.java @@ -0,0 +1,86 @@ +package net.minecraft.item; + +import net.minecraft.block.BlockBed; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemBed extends Item +{ + private static final String __OBFID = "CL_00001771"; + + public ItemBed() + { + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.isRemote) + { + return true; + } + else if (p_77648_7_ != 1) + { + return false; + } + else + { + ++p_77648_5_; + BlockBed blockbed = (BlockBed)Blocks.bed; + int i1 = MathHelper.floor_double((double)(p_77648_2_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + byte b0 = 0; + byte b1 = 0; + + if (i1 == 0) + { + b1 = 1; + } + + if (i1 == 1) + { + b0 = -1; + } + + if (i1 == 2) + { + b1 = -1; + } + + if (i1 == 3) + { + b0 = 1; + } + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1, p_77648_7_, p_77648_1_)) + { + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_3_.isAirBlock(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1) && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_, p_77648_5_ - 1, p_77648_6_) && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_ + b0, p_77648_5_ - 1, p_77648_6_ + b1)) + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, blockbed, i1, 3); + + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == blockbed) + { + p_77648_3_.setBlock(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1, blockbed, i1 + 8, 3); + } + + --p_77648_1_.stackSize; + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlock.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlock.java new file mode 100644 index 0000000..421c983 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlock.java @@ -0,0 +1,245 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemBlock extends Item +{ + public final Block field_150939_a; + @SideOnly(Side.CLIENT) + private IIcon field_150938_b; + private static final String __OBFID = "CL_00001772"; + + public ItemBlock(Block p_i45328_1_) + { + this.field_150939_a = p_i45328_1_; + } + + /** + * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." + */ + public ItemBlock setUnlocalizedName(String p_77655_1_) + { + super.setUnlocalizedName(p_77655_1_); + return this; + } + + /** + * Returns 0 for /terrain.png, 1 for /gui/items.png + */ + @SideOnly(Side.CLIENT) + public int getSpriteNumber() + { + return this.field_150939_a.getItemIconName() != null ? 1 : 0; + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150938_b != null ? this.field_150938_b : this.field_150939_a.getBlockTextureFromSide(1); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block == Blocks.snow_layer && (p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) & 7) < 1) + { + p_77648_7_ = 1; + } + else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) + { + if (p_77648_7_ == 0) + { + --p_77648_5_; + } + + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + } + + if (p_77648_1_.stackSize == 0) + { + return false; + } + else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else if (p_77648_5_ == 255 && this.field_150939_a.getMaterial().isSolid()) + { + return false; + } + else if (p_77648_3_.canPlaceEntityOnSide(this.field_150939_a, p_77648_4_, p_77648_5_, p_77648_6_, false, p_77648_7_, p_77648_2_, p_77648_1_)) + { + int i1 = this.getMetadata(p_77648_1_.getItemDamage()); + int j1 = this.field_150939_a.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, i1); + + if (placeBlockAt(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, j1)) + { + p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150939_a.stepSound.getPitch() * 0.8F); + --p_77648_1_.stackSize; + } + + return true; + } + else + { + return false; + } + } + + @SideOnly(Side.CLIENT) + public boolean func_150936_a(World p_150936_1_, int p_150936_2_, int p_150936_3_, int p_150936_4_, int p_150936_5_, EntityPlayer p_150936_6_, ItemStack p_150936_7_) + { + Block block = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + + if (block == Blocks.snow_layer) + { + p_150936_5_ = 1; + } + else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush && !block.isReplaceable(p_150936_1_, p_150936_2_, p_150936_3_, p_150936_4_)) + { + if (p_150936_5_ == 0) + { + --p_150936_3_; + } + + if (p_150936_5_ == 1) + { + ++p_150936_3_; + } + + if (p_150936_5_ == 2) + { + --p_150936_4_; + } + + if (p_150936_5_ == 3) + { + ++p_150936_4_; + } + + if (p_150936_5_ == 4) + { + --p_150936_2_; + } + + if (p_150936_5_ == 5) + { + ++p_150936_2_; + } + } + + return p_150936_1_.canPlaceEntityOnSide(this.field_150939_a, p_150936_2_, p_150936_3_, p_150936_4_, false, p_150936_5_, (Entity)null, p_150936_7_); + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + return this.field_150939_a.getUnlocalizedName(); + } + + /** + * Returns the unlocalized name of this item. + */ + public String getUnlocalizedName() + { + return this.field_150939_a.getUnlocalizedName(); + } + + /** + * gets the CreativeTab this item is displayed on + */ + @SideOnly(Side.CLIENT) + public CreativeTabs getCreativeTab() + { + return this.field_150939_a.getCreativeTabToDisplayOn(); + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + this.field_150939_a.getSubBlocks(p_150895_1_, p_150895_2_, p_150895_3_); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + String s = this.field_150939_a.getItemIconName(); + + if (s != null) + { + this.field_150938_b = register.registerIcon(s); + } + } + + /** + * 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, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + + if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) + { + return false; + } + + if (world.getBlock(x, y, z) == field_150939_a) + { + field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); + field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlockWithMetadata.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlockWithMetadata.java new file mode 100644 index 0000000..5c971af --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBlockWithMetadata.java @@ -0,0 +1,37 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemBlockWithMetadata extends ItemBlock +{ + private Block field_150950_b; + private static final String __OBFID = "CL_00001769"; + + public ItemBlockWithMetadata(Block p_i45326_1_, Block p_i45326_2_) + { + super(p_i45326_1_); + this.field_150950_b = p_i45326_2_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150950_b.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBoat.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBoat.java new file mode 100644 index 0000000..7296a9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBoat.java @@ -0,0 +1,115 @@ +package net.minecraft.item; + +import java.util.List; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class ItemBoat extends Item +{ + private static final String __OBFID = "CL_00001774"; + + public ItemBoat() + { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + float f = 1.0F; + float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; + float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f; + Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float)Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float)Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); + MovingObjectPosition movingobjectposition = worldIn.rayTraceBlocks(vec3, vec31, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + Vec3 vec32 = player.getLook(f); + boolean flag = false; + float f9 = 1.0F; + List list = worldIn.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3).expand((double)f9, (double)f9, (double)f9)); + int i; + + for (i = 0; i < list.size(); ++i) + { + Entity entity = (Entity)list.get(i); + + if (entity.canBeCollidedWith()) + { + float f10 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand((double)f10, (double)f10, (double)f10); + + if (axisalignedbb.isVecInside(vec3)) + { + flag = true; + } + } + } + + if (flag) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (worldIn.getBlock(i, j, k) == Blocks.snow_layer) + { + --j; + } + + EntityBoat entityboat = new EntityBoat(worldIn, (double)((float)i + 0.5F), (double)((float)j + 1.0F), (double)((float)k + 0.5F)); + entityboat.rotationYaw = (float)(((MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); + + if (!worldIn.getCollidingBoundingBoxes(entityboat, entityboat.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) + { + return itemStackIn; + } + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(entityboat); + } + + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + } + + return itemStackIn; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBook.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBook.java new file mode 100644 index 0000000..9ab1cde --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBook.java @@ -0,0 +1,22 @@ +package net.minecraft.item; + +public class ItemBook extends Item +{ + private static final String __OBFID = "CL_00001775"; + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) + { + return p_77616_1_.stackSize == 1; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBow.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBow.java new file mode 100644 index 0000000..03f0ed3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBow.java @@ -0,0 +1,178 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.ArrowLooseEvent; +import net.minecraftforge.event.entity.player.ArrowNockEvent; + +public class ItemBow extends Item +{ + public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; + @SideOnly(Side.CLIENT) + private IIcon[] iconArray; + private static final String __OBFID = "CL_00001777"; + + public ItemBow() + { + this.maxStackSize = 1; + this.setMaxDamage(384); + this.setCreativeTab(CreativeTabs.tabCombat); + } + + /** + * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) + { + int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_; + + ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) + { + return; + } + j = event.charge; + + boolean flag = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0; + + if (flag || p_77615_3_.inventory.hasItem(Items.arrow)) + { + float f = (float)j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + + if ((double)f < 0.1D) + { + return; + } + + if (f > 1.0F) + { + f = 1.0F; + } + + EntityArrow entityarrow = new EntityArrow(p_77615_2_, p_77615_3_, f * 2.0F); + + if (f == 1.0F) + { + entityarrow.setIsCritical(true); + } + + int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, p_77615_1_); + + if (k > 0) + { + entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); + } + + int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, p_77615_1_); + + if (l > 0) + { + entityarrow.setKnockbackStrength(l); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, p_77615_1_) > 0) + { + entityarrow.setFire(100); + } + + p_77615_1_.damageItem(1, p_77615_3_); + p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + + if (flag) + { + entityarrow.canBePickedUp = 2; + } + else + { + p_77615_3_.inventory.consumeInventoryItem(Items.arrow); + } + + if (!p_77615_2_.isRemote) + { + p_77615_2_.spawnEntityInWorld(entityarrow); + } + } + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + return p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 72000; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.bow; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + ArrowNockEvent event = new ArrowNockEvent(player, itemStackIn); + MinecraftForge.EVENT_BUS.post(event); + if (event.isCanceled()) + { + return event.result; + } + + if (player.capabilities.isCreativeMode || player.inventory.hasItem(Items.arrow)) + { + player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + } + + return itemStackIn; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 1; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.itemIcon = register.registerIcon(this.getIconString() + "_standby"); + this.iconArray = new IIcon[bowPullIconNameArray.length]; + + for (int i = 0; i < this.iconArray.length; ++i) + { + this.iconArray[i] = register.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[i]); + } + } + + /** + * used to cycle through icons based on their used duration, i.e. for the bow + */ + @SideOnly(Side.CLIENT) + public IIcon getItemIconForUseDuration(int p_94599_1_) + { + return this.iconArray[p_94599_1_]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucket.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucket.java new file mode 100644 index 0000000..c407f18 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucket.java @@ -0,0 +1,217 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.FillBucketEvent; + +public class ItemBucket extends Item +{ + /** field for checking if the bucket has been filled. */ + private Block isFull; + private static final String __OBFID = "CL_00000000"; + + public ItemBucket(Block p_i45331_1_) + { + this.maxStackSize = 1; + this.isFull = p_i45331_1_; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + boolean flag = this.isFull == Blocks.air; + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, player, flag); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + FillBucketEvent event = new FillBucketEvent(player, itemStackIn, worldIn, movingobjectposition); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return itemStackIn; + } + + if (event.getResult() == Event.Result.ALLOW) + { + if (player.capabilities.isCreativeMode) + { + return itemStackIn; + } + + if (--itemStackIn.stackSize <= 0) + { + return event.result; + } + + if (!player.inventory.addItemStackToInventory(event.result)) + { + player.dropPlayerItemWithRandomChoice(event.result, false); + } + + return itemStackIn; + } + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!worldIn.canMineBlock(player, i, j, k)) + { + return itemStackIn; + } + + if (flag) + { + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + Material material = worldIn.getBlock(i, j, k).getMaterial(); + int l = worldIn.getBlockMetadata(i, j, k); + + if (material == Material.water && l == 0) + { + worldIn.setBlockToAir(i, j, k); + return this.func_150910_a(itemStackIn, player, Items.water_bucket); + } + + if (material == Material.lava && l == 0) + { + worldIn.setBlockToAir(i, j, k); + return this.func_150910_a(itemStackIn, player, Items.lava_bucket); + } + } + else + { + if (this.isFull == Blocks.air) + { + return new ItemStack(Items.bucket); + } + + if (movingobjectposition.sideHit == 0) + { + --j; + } + + if (movingobjectposition.sideHit == 1) + { + ++j; + } + + if (movingobjectposition.sideHit == 2) + { + --k; + } + + if (movingobjectposition.sideHit == 3) + { + ++k; + } + + if (movingobjectposition.sideHit == 4) + { + --i; + } + + if (movingobjectposition.sideHit == 5) + { + ++i; + } + + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (this.tryPlaceContainedLiquid(worldIn, i, j, k) && !player.capabilities.isCreativeMode) + { + return new ItemStack(Items.bucket); + } + } + } + + return itemStackIn; + } + } + + private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) + { + if (p_150910_2_.capabilities.isCreativeMode) + { + return p_150910_1_; + } + else if (--p_150910_1_.stackSize <= 0) + { + return new ItemStack(p_150910_3_); + } + else + { + if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) + { + p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); + } + + return p_150910_1_; + } + } + + /** + * Attempts to place the liquid contained inside the bucket. + */ + public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_) + { + if (this.isFull == Blocks.air) + { + return false; + } + else + { + Material material = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial(); + boolean flag = !material.isSolid(); + + if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag) + { + return false; + } + else + { + if (p_77875_1_.provider.isHellWorld && this.isFull == Blocks.flowing_water) + { + p_77875_1_.playSoundEffect((double)((float)p_77875_2_ + 0.5F), (double)((float)p_77875_3_ + 0.5F), (double)((float)p_77875_4_ + 0.5F), "random.fizz", 0.5F, 2.6F + (p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F); + + for (int l = 0; l < 8; ++l) + { + p_77875_1_.spawnParticle("largesmoke", (double)p_77875_2_ + Math.random(), (double)p_77875_3_ + Math.random(), (double)p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D); + } + } + else + { + if (!p_77875_1_.isRemote && flag && !material.isLiquid()) + { + p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true); + } + + p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucketMilk.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucketMilk.java new file mode 100644 index 0000000..ee3a8d8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemBucketMilk.java @@ -0,0 +1,57 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemBucketMilk extends Item +{ + private static final String __OBFID = "CL_00000048"; + + public ItemBucketMilk() + { + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + if (!p_77654_3_.capabilities.isCreativeMode) + { + --p_77654_1_.stackSize; + } + + if (!p_77654_2_.isRemote) + { + p_77654_3_.curePotionEffects(p_77654_1_); + } + + return p_77654_1_.stackSize <= 0 ? new ItemStack(Items.bucket) : p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.drink; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemCarrotOnAStick.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCarrotOnAStick.java new file mode 100644 index 0000000..9ceb258 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCarrotOnAStick.java @@ -0,0 +1,66 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemCarrotOnAStick extends Item +{ + private static final String __OBFID = "CL_00000001"; + + public ItemCarrotOnAStick() + { + this.setCreativeTab(CreativeTabs.tabTransport); + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + @SideOnly(Side.CLIENT) + public boolean shouldRotateAroundWhenRendering() + { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (player.isRiding() && player.ridingEntity instanceof EntityPig) + { + EntityPig entitypig = (EntityPig)player.ridingEntity; + + if (entitypig.getAIControlledByPlayer().isControlledByPlayer() && itemStackIn.getMaxDamage() - itemStackIn.getItemDamage() >= 7) + { + entitypig.getAIControlledByPlayer().boostSpeed(); + itemStackIn.damageItem(7, player); + + if (itemStackIn.stackSize == 0) + { + ItemStack itemstack1 = new ItemStack(Items.fishing_rod); + itemstack1.setTagCompound(itemStackIn.stackTagCompound); + return itemstack1; + } + } + } + + return itemStackIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemCloth.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCloth.java new file mode 100644 index 0000000..f3fff0e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCloth.java @@ -0,0 +1,45 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.util.IIcon; + +public class ItemCloth extends ItemBlock +{ + private static final String __OBFID = "CL_00000075"; + + public ItemCloth(Block p_i45358_1_) + { + super(p_i45358_1_); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150939_a.func_149735_b(2, BlockColored.func_150032_b(p_77617_1_)); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[BlockColored.func_150032_b(stack.getItemDamage())]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemCoal.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCoal.java new file mode 100644 index 0000000..51823c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemCoal.java @@ -0,0 +1,57 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; + +public class ItemCoal extends Item +{ + @SideOnly(Side.CLIENT) + private IIcon field_111220_a; + private static final String __OBFID = "CL_00000002"; + + public ItemCoal() + { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + return stack.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 1)); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return p_77617_1_ == 1 ? this.field_111220_a : super.getIconFromDamage(p_77617_1_); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + super.registerIcons(register); + this.field_111220_a = register.registerIcon("charcoal"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemColored.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemColored.java new file mode 100644 index 0000000..9cd984a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemColored.java @@ -0,0 +1,71 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemColored extends ItemBlock +{ + private final Block field_150944_b; + private String[] field_150945_c; + private static final String __OBFID = "CL_00000003"; + + public ItemColored(Block p_i45332_1_, boolean p_i45332_2_) + { + super(p_i45332_1_); + this.field_150944_b = p_i45332_1_; + + if (p_i45332_2_) + { + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + return this.field_150944_b.getRenderColor(p_82790_1_.getItemDamage()); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + public ItemColored func_150943_a(String[] p_150943_1_) + { + this.field_150945_c = p_150943_1_; + return this; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + if (this.field_150945_c == null) + { + return super.getUnlocalizedName(stack); + } + else + { + int i = stack.getItemDamage(); + return i >= 0 && i < this.field_150945_c.length ? super.getUnlocalizedName(stack) + "." + this.field_150945_c[i] : super.getUnlocalizedName(stack); + } + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150944_b.getIcon(0, p_77617_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoor.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoor.java new file mode 100644 index 0000000..c119388 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoor.java @@ -0,0 +1,113 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemDoor extends Item +{ + private Material doorMaterial; + private static final String __OBFID = "CL_00000020"; + + public ItemDoor(Material p_i45334_1_) + { + this.doorMaterial = p_i45334_1_; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ != 1) + { + return false; + } + else + { + ++p_77648_5_; + Block block; + + if (this.doorMaterial == Material.wood) + { + block = Blocks.wooden_door; + } + else + { + block = Blocks.iron_door; + } + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) + { + if (!block.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) + { + return false; + } + else + { + int i1 = MathHelper.floor_double((double)((p_77648_2_.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; + placeDoorBlock(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1, block); + --p_77648_1_.stackSize; + return true; + } + } + else + { + return false; + } + } + } + + public static void placeDoorBlock(World p_150924_0_, int p_150924_1_, int p_150924_2_, int p_150924_3_, int p_150924_4_, Block p_150924_5_) + { + byte b0 = 0; + byte b1 = 0; + + if (p_150924_4_ == 0) + { + b1 = 1; + } + + if (p_150924_4_ == 1) + { + b0 = -1; + } + + if (p_150924_4_ == 2) + { + b1 = -1; + } + + if (p_150924_4_ == 3) + { + b0 = 1; + } + + int i1 = (p_150924_0_.getBlock(p_150924_1_ - b0, p_150924_2_, p_150924_3_ - b1).isNormalCube() ? 1 : 0) + (p_150924_0_.getBlock(p_150924_1_ - b0, p_150924_2_ + 1, p_150924_3_ - b1).isNormalCube() ? 1 : 0); + int j1 = (p_150924_0_.getBlock(p_150924_1_ + b0, p_150924_2_, p_150924_3_ + b1).isNormalCube() ? 1 : 0) + (p_150924_0_.getBlock(p_150924_1_ + b0, p_150924_2_ + 1, p_150924_3_ + b1).isNormalCube() ? 1 : 0); + boolean flag = p_150924_0_.getBlock(p_150924_1_ - b0, p_150924_2_, p_150924_3_ - b1) == p_150924_5_ || p_150924_0_.getBlock(p_150924_1_ - b0, p_150924_2_ + 1, p_150924_3_ - b1) == p_150924_5_; + boolean flag1 = p_150924_0_.getBlock(p_150924_1_ + b0, p_150924_2_, p_150924_3_ + b1) == p_150924_5_ || p_150924_0_.getBlock(p_150924_1_ + b0, p_150924_2_ + 1, p_150924_3_ + b1) == p_150924_5_; + boolean flag2 = false; + + if (flag && !flag1) + { + flag2 = true; + } + else if (j1 > i1) + { + flag2 = true; + } + + p_150924_0_.setBlock(p_150924_1_, p_150924_2_, p_150924_3_, p_150924_5_, p_150924_4_, 2); + p_150924_0_.setBlock(p_150924_1_, p_150924_2_ + 1, p_150924_3_, p_150924_5_, 8 | (flag2 ? 1 : 0), 2); + p_150924_0_.notifyBlocksOfNeighborChange(p_150924_1_, p_150924_2_, p_150924_3_, p_150924_5_); + p_150924_0_.notifyBlocksOfNeighborChange(p_150924_1_, p_150924_2_ + 1, p_150924_3_, p_150924_5_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoublePlant.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoublePlant.java new file mode 100644 index 0000000..012e81f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDoublePlant.java @@ -0,0 +1,34 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.util.IIcon; +import net.minecraft.world.ColorizerGrass; + +public class ItemDoublePlant extends ItemMultiTexture +{ + private static final String __OBFID = "CL_00000021"; + + public ItemDoublePlant(Block p_i45335_1_, BlockDoublePlant p_i45335_2_, String[] p_i45335_3_) + { + super(p_i45335_1_, p_i45335_2_, p_i45335_3_); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return BlockDoublePlant.func_149890_d(p_77617_1_) == 0 ? ((BlockDoublePlant)this.field_150941_b).sunflowerIcons[0] : ((BlockDoublePlant)this.field_150941_b).func_149888_a(true, p_77617_1_); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + int j = BlockDoublePlant.func_149890_d(p_82790_1_.getItemDamage()); + return j != 2 && j != 3 ? super.getColorFromItemStack(p_82790_1_, p_82790_2_) : ColorizerGrass.getGrassColor(0.5D, 1.0D); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemDye.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDye.java new file mode 100644 index 0000000..bda2b7d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemDye.java @@ -0,0 +1,271 @@ +package net.minecraft.item; + +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockColored; +import net.minecraft.block.BlockLog; +import net.minecraft.block.IGrowable; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.FakePlayerFactory; +import net.minecraftforge.event.entity.player.BonemealEvent; + +public class ItemDye extends Item +{ + public static final String[] field_150923_a = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; + public static final String[] field_150921_b = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; + public static final int[] field_150922_c = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; + @SideOnly(Side.CLIENT) + private IIcon[] field_150920_d; + private static final String __OBFID = "CL_00000022"; + + public ItemDye() + { + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + int j = MathHelper.clamp_int(p_77617_1_, 0, 15); + return this.field_150920_d[j]; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + int i = MathHelper.clamp_int(stack.getItemDamage(), 0, 15); + return super.getUnlocalizedName() + "." + field_150923_a[i]; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + if (p_77648_1_.getItemDamage() == 15) + { + if (applyBonemeal(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_)) + { + if (!p_77648_3_.isRemote) + { + p_77648_3_.playAuxSFX(2005, p_77648_4_, p_77648_5_, p_77648_6_, 0); + } + + return true; + } + } + else if (p_77648_1_.getItemDamage() == 3) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int i1 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block == Blocks.log && BlockLog.func_150165_c(i1) == 3) + { + if (p_77648_7_ == 0) + { + return false; + } + + if (p_77648_7_ == 1) + { + return false; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_)) + { + int j1 = Blocks.cocoa.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.cocoa, j1, 2); + + if (!p_77648_2_.capabilities.isCreativeMode) + { + --p_77648_1_.stackSize; + } + } + + return true; + } + } + + return false; + } + } + + public static boolean func_150919_a(ItemStack stack, World worldIn, int x, int y, int z) + { + if (worldIn instanceof WorldServer) + return applyBonemeal(stack, worldIn, x, y, z, FakePlayerFactory.getMinecraft((WorldServer)worldIn)); + return false; + } + + public static boolean applyBonemeal(ItemStack stack, World worldIn, int x, int y, int z, EntityPlayer player) + { + Block block = worldIn.getBlock(x, y, z); + + BonemealEvent event = new BonemealEvent(player, worldIn, block, x, y, z); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + if (event.getResult() == Result.ALLOW) + { + if (!worldIn.isRemote) + { + stack.stackSize--; + } + return true; + } + + if (block instanceof IGrowable) + { + IGrowable igrowable = (IGrowable)block; + + if (igrowable.func_149851_a(worldIn, x, y, z, worldIn.isRemote)) + { + if (!worldIn.isRemote) + { + if (igrowable.func_149852_a(worldIn, worldIn.rand, x, y, z)) + { + igrowable.func_149853_b(worldIn, worldIn.rand, x, y, z); + } + + --stack.stackSize; + } + + return true; + } + } + + return false; + } + + @SideOnly(Side.CLIENT) + public static void func_150918_a(World p_150918_0_, int p_150918_1_, int p_150918_2_, int p_150918_3_, int p_150918_4_) + { + if (p_150918_4_ == 0) + { + p_150918_4_ = 15; + } + + Block block = p_150918_0_.getBlock(p_150918_1_, p_150918_2_, p_150918_3_); + + if (block.getMaterial() != Material.air) + { + block.setBlockBoundsBasedOnState(p_150918_0_, p_150918_1_, p_150918_2_, p_150918_3_); + + for (int i1 = 0; i1 < p_150918_4_; ++i1) + { + double d0 = itemRand.nextGaussian() * 0.02D; + double d1 = itemRand.nextGaussian() * 0.02D; + double d2 = itemRand.nextGaussian() * 0.02D; + p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * block.getBlockBoundsMaxY(), (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); + } + } + else + { + for (int i1 = 0; i1 < p_150918_4_; ++i1) + { + double d0 = itemRand.nextGaussian() * 0.02D; + double d1 = itemRand.nextGaussian() * 0.02D; + double d2 = itemRand.nextGaussian() * 0.02D; + p_150918_0_.spawnParticle("happyVillager", (double)((float)p_150918_1_ + itemRand.nextFloat()), (double)p_150918_2_ + (double)itemRand.nextFloat() * 1.0f, (double)((float)p_150918_3_ + itemRand.nextFloat()), d0, d1, d2); + } + } + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) + { + if (target instanceof EntitySheep) + { + EntitySheep entitysheep = (EntitySheep)target; + int i = BlockColored.func_150032_b(stack.getItemDamage()); + + if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != i) + { + entitysheep.setFleeceColor(i); + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + for (int i = 0; i < 16; ++i) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.field_150920_d = new IIcon[field_150921_b.length]; + + for (int i = 0; i < field_150921_b.length; ++i) + { + this.field_150920_d[i] = register.registerIcon(this.getIconString() + "_" + field_150921_b[i]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEditableBook.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEditableBook.java new file mode 100644 index 0000000..9b9d7bc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEditableBook.java @@ -0,0 +1,95 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.util.StringUtils; +import net.minecraft.world.World; + +public class ItemEditableBook extends Item +{ + private static final String __OBFID = "CL_00000077"; + + public ItemEditableBook() + { + this.setMaxStackSize(1); + } + + public static boolean validBookTagContents(NBTTagCompound p_77828_0_) + { + if (!ItemWritableBook.func_150930_a(p_77828_0_)) + { + return false; + } + else if (!p_77828_0_.hasKey("title", 8)) + { + return false; + } + else + { + String s = p_77828_0_.getString("title"); + return s != null && s.length() <= 16 ? p_77828_0_.hasKey("author", 8) : false; + } + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + if (p_77653_1_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_77653_1_.getTagCompound(); + String s = nbttagcompound.getString("title"); + + if (!StringUtils.isNullOrEmpty(s)) + { + return s; + } + } + + return super.getItemStackDisplayName(p_77653_1_); + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + if (p_77624_1_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_77624_1_.getTagCompound(); + String s = nbttagcompound.getString("author"); + + if (!StringUtils.isNullOrEmpty(s)) + { + p_77624_3_.add(EnumChatFormatting.GRAY + StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {s})); + } + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + player.displayGUIBook(itemStackIn); + return itemStackIn; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. + */ + public boolean getShareTag() + { + return true; + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEgg.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEgg.java new file mode 100644 index 0000000..2a60a5b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEgg.java @@ -0,0 +1,37 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityEgg; +import net.minecraft.world.World; + +public class ItemEgg extends Item +{ + private static final String __OBFID = "CL_00000023"; + + public ItemEgg() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityEgg(worldIn, player)); + } + + return itemStackIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEmptyMap.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEmptyMap.java new file mode 100644 index 0000000..d077e0a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEmptyMap.java @@ -0,0 +1,49 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class ItemEmptyMap extends ItemMapBase +{ + private static final String __OBFID = "CL_00000024"; + + protected ItemEmptyMap() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + ItemStack itemstack1 = new ItemStack(Items.filled_map, 1, worldIn.getUniqueDataId("map")); + String s = "map_" + itemstack1.getItemDamage(); + MapData mapdata = new MapData(s); + worldIn.setItemData(s, mapdata); + mapdata.scale = 0; + int i = 128 * (1 << mapdata.scale); + mapdata.xCenter = (int)(Math.round(player.posX / (double)i) * (long)i); + mapdata.zCenter = (int)(Math.round(player.posZ / (double)i) * (long)i); + mapdata.dimension = worldIn.provider.dimensionId; + mapdata.markDirty(); + --itemStackIn.stackSize; + + if (itemStackIn.stackSize <= 0) + { + return itemstack1; + } + else + { + if (!player.inventory.addItemStackToInventory(itemstack1.copy())) + { + player.dropPlayerItemWithRandomChoice(itemstack1, false); + } + + return itemStackIn; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnchantedBook.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnchantedBook.java new file mode 100644 index 0000000..e387a65 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnchantedBook.java @@ -0,0 +1,141 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.WeightedRandomChestContent; + +public class ItemEnchantedBook extends Item +{ + private static final String __OBFID = "CL_00000025"; + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + return true; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) + { + return false; + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) + { + return this.func_92110_g(p_77613_1_).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(p_77613_1_); + } + + public NBTTagList func_92110_g(ItemStack p_92110_1_) + { + return p_92110_1_.stackTagCompound != null && p_92110_1_.stackTagCompound.hasKey("StoredEnchantments", 9) ? (NBTTagList)p_92110_1_.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); + NBTTagList nbttaglist = this.func_92110_g(p_77624_1_); + + if (nbttaglist != null) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (Enchantment.enchantmentsList[short1] != null) + { + p_77624_3_.add(Enchantment.enchantmentsList[short1].getTranslatedName(short2)); + } + } + } + } + + /** + * Adds an stored enchantment to an enchanted book ItemStack + */ + public void addEnchantment(ItemStack p_92115_1_, EnchantmentData p_92115_2_) + { + NBTTagList nbttaglist = this.func_92110_g(p_92115_1_); + boolean flag = true; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + + if (nbttagcompound.getShort("id") == p_92115_2_.enchantmentobj.effectId) + { + if (nbttagcompound.getShort("lvl") < p_92115_2_.enchantmentLevel) + { + nbttagcompound.setShort("lvl", (short)p_92115_2_.enchantmentLevel); + } + + flag = false; + break; + } + } + + if (flag) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setShort("id", (short)p_92115_2_.enchantmentobj.effectId); + nbttagcompound1.setShort("lvl", (short)p_92115_2_.enchantmentLevel); + nbttaglist.appendTag(nbttagcompound1); + } + + if (!p_92115_1_.hasTagCompound()) + { + p_92115_1_.setTagCompound(new NBTTagCompound()); + } + + p_92115_1_.getTagCompound().setTag("StoredEnchantments", nbttaglist); + } + + /** + * Returns the ItemStack of an enchanted version of this item. + */ + public ItemStack getEnchantedItemStack(EnchantmentData p_92111_1_) + { + ItemStack itemstack = new ItemStack(this); + this.addEnchantment(itemstack, p_92111_1_); + return itemstack; + } + + @SideOnly(Side.CLIENT) + public void func_92113_a(Enchantment p_92113_1_, List p_92113_2_) + { + for (int i = p_92113_1_.getMinLevel(); i <= p_92113_1_.getMaxLevel(); ++i) + { + p_92113_2_.add(this.getEnchantedItemStack(new EnchantmentData(p_92113_1_, i))); + } + } + + public WeightedRandomChestContent func_92114_b(Random p_92114_1_) + { + return this.func_92112_a(p_92114_1_, 1, 1, 1); + } + + public WeightedRandomChestContent func_92112_a(Random p_92112_1_, int p_92112_2_, int p_92112_3_, int p_92112_4_) + { + ItemStack itemstack = new ItemStack(Items.book, 1, 0); + EnchantmentHelper.addRandomEnchantment(p_92112_1_, itemstack, 30); + return new WeightedRandomChestContent(itemstack, p_92112_2_, p_92112_3_, p_92112_4_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderEye.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderEye.java new file mode 100644 index 0000000..60c116e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderEye.java @@ -0,0 +1,184 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderEye; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public class ItemEnderEye extends Item +{ + private static final String __OBFID = "CL_00000026"; + + public ItemEnderEye() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int i1 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && block == Blocks.end_portal_frame && !BlockEndPortalFrame.isEnderEyeInserted(i1)) + { + if (p_77648_3_.isRemote) + { + return true; + } + else + { + p_77648_3_.setBlockMetadataWithNotify(p_77648_4_, p_77648_5_, p_77648_6_, i1 + 4, 2); + p_77648_3_.func_147453_f(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.end_portal_frame); + --p_77648_1_.stackSize; + int j1; + + for (j1 = 0; j1 < 16; ++j1) + { + double d0 = (double)((float)p_77648_4_ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d1 = (double)((float)p_77648_5_ + 0.8125F); + double d2 = (double)((float)p_77648_6_ + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double d3 = 0.0D; + double d4 = 0.0D; + double d5 = 0.0D; + p_77648_3_.spawnParticle("smoke", d0, d1, d2, d3, d4, d5); + } + + j1 = i1 & 3; + int j2 = 0; + int k1 = 0; + boolean flag1 = false; + boolean flag = true; + int k2 = Direction.rotateRight[j1]; + int l1; + int i2; + int l2; + + for (l1 = -2; l1 <= 2; ++l1) + { + l2 = p_77648_4_ + Direction.offsetX[k2] * l1; + i2 = p_77648_6_ + Direction.offsetZ[k2] * l1; + + if (p_77648_3_.getBlock(l2, p_77648_5_, i2) == Blocks.end_portal_frame) + { + if (!BlockEndPortalFrame.isEnderEyeInserted(p_77648_3_.getBlockMetadata(l2, p_77648_5_, i2))) + { + flag = false; + break; + } + + k1 = l1; + + if (!flag1) + { + j2 = l1; + flag1 = true; + } + } + } + + if (flag && k1 == j2 + 2) + { + for (l1 = j2; l1 <= k1; ++l1) + { + l2 = p_77648_4_ + Direction.offsetX[k2] * l1; + i2 = p_77648_6_ + Direction.offsetZ[k2] * l1; + l2 += Direction.offsetX[j1] * 4; + i2 += Direction.offsetZ[j1] * 4; + + if (p_77648_3_.getBlock(l2, p_77648_5_, i2) != Blocks.end_portal_frame || !BlockEndPortalFrame.isEnderEyeInserted(p_77648_3_.getBlockMetadata(l2, p_77648_5_, i2))) + { + flag = false; + break; + } + } + + int i3; + + for (l1 = j2 - 1; l1 <= k1 + 1; l1 += 4) + { + for (l2 = 1; l2 <= 3; ++l2) + { + i2 = p_77648_4_ + Direction.offsetX[k2] * l1; + i3 = p_77648_6_ + Direction.offsetZ[k2] * l1; + i2 += Direction.offsetX[j1] * l2; + i3 += Direction.offsetZ[j1] * l2; + + if (p_77648_3_.getBlock(i2, p_77648_5_, i3) != Blocks.end_portal_frame || !BlockEndPortalFrame.isEnderEyeInserted(p_77648_3_.getBlockMetadata(i2, p_77648_5_, i3))) + { + flag = false; + break; + } + } + } + + if (flag) + { + for (l1 = j2; l1 <= k1; ++l1) + { + for (l2 = 1; l2 <= 3; ++l2) + { + i2 = p_77648_4_ + Direction.offsetX[k2] * l1; + i3 = p_77648_6_ + Direction.offsetZ[k2] * l1; + i2 += Direction.offsetX[j1] * l2; + i3 += Direction.offsetZ[j1] * l2; + p_77648_3_.setBlock(i2, p_77648_5_, i3, Blocks.end_portal, 0, 2); + } + } + } + } + + return true; + } + } + else + { + return false; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, player, false); + + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && worldIn.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ) == Blocks.end_portal_frame) + { + return itemStackIn; + } + else + { + if (!worldIn.isRemote) + { + ChunkPosition chunkposition = worldIn.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ); + + if (chunkposition != null) + { + EntityEnderEye entityendereye = new EntityEnderEye(worldIn, player.posX, player.posY + 1.62D - (double)player.yOffset, player.posZ); + entityendereye.moveTowards((double)chunkposition.chunkPosX, chunkposition.chunkPosY, (double)chunkposition.chunkPosZ); + worldIn.spawnEntityInWorld(entityendereye); + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)player.posX, (int)player.posY, (int)player.posZ, 0); + + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + } + } + + return itemStackIn; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderPearl.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderPearl.java new file mode 100644 index 0000000..ebf2378 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemEnderPearl.java @@ -0,0 +1,40 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityEnderPearl; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemEnderPearl extends Item +{ + private static final String __OBFID = "CL_00000027"; + + public ItemEnderPearl() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (player.capabilities.isCreativeMode) + { + return itemStackIn; + } + else + { + --itemStackIn.stackSize; + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityEnderPearl(worldIn, player)); + } + + return itemStackIn; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemExpBottle.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemExpBottle.java new file mode 100644 index 0000000..badfe17 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemExpBottle.java @@ -0,0 +1,44 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityExpBottle; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class ItemExpBottle extends Item +{ + private static final String __OBFID = "CL_00000028"; + + public ItemExpBottle() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityExpBottle(worldIn, player)); + } + + return itemStackIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireball.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireball.java new file mode 100644 index 0000000..6be15dc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireball.java @@ -0,0 +1,81 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemFireball extends Item +{ + private static final String __OBFID = "CL_00000029"; + + public ItemFireball() + { + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.isRemote) + { + return true; + } + else + { + if (p_77648_7_ == 0) + { + --p_77648_5_; + } + + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial() == Material.air) + { + p_77648_3_.playSoundEffect((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.fire); + } + + if (!p_77648_2_.capabilities.isCreativeMode) + { + --p_77648_1_.stackSize; + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFirework.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFirework.java new file mode 100644 index 0000000..65940e8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFirework.java @@ -0,0 +1,83 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemFirework extends Item +{ + private static final String __OBFID = "CL_00000031"; + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (!p_77648_3_.isRemote) + { + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(p_77648_3_, (double)((float)p_77648_4_ + p_77648_8_), (double)((float)p_77648_5_ + p_77648_9_), (double)((float)p_77648_6_ + p_77648_10_), p_77648_1_); + p_77648_3_.spawnEntityInWorld(entityfireworkrocket); + + if (!p_77648_2_.capabilities.isCreativeMode) + { + --p_77648_1_.stackSize; + } + + return true; + } + else + { + return false; + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + if (p_77624_1_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_77624_1_.getTagCompound().getCompoundTag("Fireworks"); + + if (nbttagcompound != null) + { + if (nbttagcompound.hasKey("Flight", 99)) + { + p_77624_3_.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + nbttagcompound.getByte("Flight")); + } + + NBTTagList nbttaglist = nbttagcompound.getTagList("Explosions", 10); + + if (nbttaglist != null && nbttaglist.tagCount() > 0) + { + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + ArrayList arraylist = new ArrayList(); + ItemFireworkCharge.func_150902_a(nbttagcompound1, arraylist); + + if (arraylist.size() > 0) + { + for (int j = 1; j < arraylist.size(); ++j) + { + arraylist.set(j, " " + (String)arraylist.get(j)); + } + + p_77624_3_.addAll(arraylist); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireworkCharge.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireworkCharge.java new file mode 100644 index 0000000..e5fc5f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFireworkCharge.java @@ -0,0 +1,235 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagIntArray; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; + +public class ItemFireworkCharge extends Item +{ + @SideOnly(Side.CLIENT) + private IIcon field_150904_a; + private static final String __OBFID = "CL_00000030"; + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return p_77618_2_ > 0 ? this.field_150904_a : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + if (p_82790_2_ != 1) + { + return super.getColorFromItemStack(p_82790_1_, p_82790_2_); + } + else + { + NBTBase nbtbase = func_150903_a(p_82790_1_, "Colors"); + + if (nbtbase != null && nbtbase instanceof NBTTagIntArray) + { + NBTTagIntArray nbttagintarray = (NBTTagIntArray)nbtbase; + int[] aint = nbttagintarray.func_150302_c(); + + if (aint.length == 1) + { + return aint[0]; + } + else + { + int j = 0; + int k = 0; + int l = 0; + int[] aint1 = aint; + int i1 = aint.length; + + for (int j1 = 0; j1 < i1; ++j1) + { + int k1 = aint1[j1]; + j += (k1 & 16711680) >> 16; + k += (k1 & 65280) >> 8; + l += (k1 & 255) >> 0; + } + + j /= aint.length; + k /= aint.length; + l /= aint.length; + return j << 16 | k << 8 | l; + } + } + else + { + return 9079434; + } + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly(Side.CLIENT) + public static NBTBase func_150903_a(ItemStack p_150903_0_, String p_150903_1_) + { + if (p_150903_0_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_150903_0_.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound != null) + { + return nbttagcompound.getTag(p_150903_1_); + } + } + + return null; + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + if (p_77624_1_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_77624_1_.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound != null) + { + func_150902_a(nbttagcompound, p_77624_3_); + } + } + } + + @SideOnly(Side.CLIENT) + public static void func_150902_a(NBTTagCompound p_150902_0_, List p_150902_1_) + { + byte b0 = p_150902_0_.getByte("Type"); + + if (b0 >= 0 && b0 <= 4) + { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.type." + b0).trim()); + } + else + { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); + } + + int[] aint = p_150902_0_.getIntArray("Colors"); + int j; + int k; + + if (aint.length > 0) + { + boolean flag = true; + String s = ""; + int[] aint1 = aint; + int i = aint.length; + + for (j = 0; j < i; ++j) + { + k = aint1[j]; + + if (!flag) + { + s = s + ", "; + } + + flag = false; + boolean flag1 = false; + + for (int l = 0; l < 16; ++l) + { + if (k == ItemDye.field_150922_c[l]) + { + flag1 = true; + s = s + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.field_150923_a[l]); + break; + } + } + + if (!flag1) + { + s = s + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + p_150902_1_.add(s); + } + + int[] aint2 = p_150902_0_.getIntArray("FadeColors"); + boolean flag2; + + if (aint2.length > 0) + { + flag2 = true; + String s1 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; + int[] aint3 = aint2; + j = aint2.length; + + for (k = 0; k < j; ++k) + { + int j1 = aint3[k]; + + if (!flag2) + { + s1 = s1 + ", "; + } + + flag2 = false; + boolean flag4 = false; + + for (int i1 = 0; i1 < 16; ++i1) + { + if (j1 == ItemDye.field_150922_c[i1]) + { + flag4 = true; + s1 = s1 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.field_150923_a[i1]); + break; + } + } + + if (!flag4) + { + s1 = s1 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + + p_150902_1_.add(s1); + } + + flag2 = p_150902_0_.getBoolean("Trail"); + + if (flag2) + { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); + } + + boolean flag3 = p_150902_0_.getBoolean("Flicker"); + + if (flag3) + { + p_150902_1_.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + super.registerIcons(register); + this.field_150904_a = register.registerIcon(this.getIconString() + "_overlay"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishFood.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishFood.java new file mode 100644 index 0000000..9817373 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishFood.java @@ -0,0 +1,239 @@ +package net.minecraft.item; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Map; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemFishFood extends ItemFood +{ + private final boolean field_150907_b; + private static final String __OBFID = "CL_00000032"; + + public ItemFishFood(boolean p_i45338_1_) + { + super(0, 0.0F, false); + this.field_150907_b = p_i45338_1_; + } + + public int func_150905_g(ItemStack itemStackIn) + { + ItemFishFood.FishType fishtype = ItemFishFood.FishType.func_150978_a(itemStackIn); + return this.field_150907_b && fishtype.func_150973_i() ? fishtype.func_150970_e() : fishtype.func_150975_c(); + } + + public float func_150906_h(ItemStack itemStackIn) + { + ItemFishFood.FishType fishtype = ItemFishFood.FishType.func_150978_a(itemStackIn); + return this.field_150907_b && fishtype.func_150973_i() ? fishtype.func_150977_f() : fishtype.func_150967_d(); + } + + /** + * Returns a string representing what this item does to a potion. + */ + public String getPotionEffect(ItemStack p_150896_1_) + { + return ItemFishFood.FishType.func_150978_a(p_150896_1_) == ItemFishFood.FishType.PUFFERFISH ? PotionHelper.field_151423_m : null; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + ItemFishFood.FishType[] afishtype = ItemFishFood.FishType.values(); + int i = afishtype.length; + + for (int j = 0; j < i; ++j) + { + ItemFishFood.FishType fishtype = afishtype[j]; + fishtype.func_150968_a(register); + } + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) + { + ItemFishFood.FishType fishtype = ItemFishFood.FishType.func_150978_a(p_77849_1_); + + if (fishtype == ItemFishFood.FishType.PUFFERFISH) + { + p_77849_3_.addPotionEffect(new PotionEffect(Potion.poison.id, 1200, 3)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.hunger.id, 300, 2)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 1)); + } + + super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + ItemFishFood.FishType fishtype = ItemFishFood.FishType.func_150974_a(p_77617_1_); + return this.field_150907_b && fishtype.func_150973_i() ? fishtype.func_150979_h() : fishtype.func_150971_g(); + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + ItemFishFood.FishType[] afishtype = ItemFishFood.FishType.values(); + int i = afishtype.length; + + for (int j = 0; j < i; ++j) + { + ItemFishFood.FishType fishtype = afishtype[j]; + + if (!this.field_150907_b || fishtype.func_150973_i()) + { + p_150895_3_.add(new ItemStack(this, 1, fishtype.func_150976_a())); + } + } + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + ItemFishFood.FishType fishtype = ItemFishFood.FishType.func_150978_a(stack); + return this.getUnlocalizedName() + "." + fishtype.func_150972_b() + "." + (this.field_150907_b && fishtype.func_150973_i() ? "cooked" : "raw"); + } + + public static enum FishType + { + COD(0, "cod", 2, 0.1F, 5, 0.6F), + SALMON(1, "salmon", 2, 0.1F, 6, 0.8F), + CLOWNFISH(2, "clownfish", 1, 0.1F), + PUFFERFISH(3, "pufferfish", 1, 0.1F); + private static final Map field_150983_e = Maps.newHashMap(); + private final int field_150980_f; + private final String field_150981_g; + @SideOnly(Side.CLIENT) + private IIcon field_150993_h; + @SideOnly(Side.CLIENT) + private IIcon field_150994_i; + private final int field_150991_j; + private final float field_150992_k; + private final int field_150989_l; + private final float field_150990_m; + private boolean field_150987_n = false; + + private static final String __OBFID = "CL_00000033"; + + private FishType(int p_i45336_3_, String p_i45336_4_, int p_i45336_5_, float p_i45336_6_, int p_i45336_7_, float p_i45336_8_) + { + this.field_150980_f = p_i45336_3_; + this.field_150981_g = p_i45336_4_; + this.field_150991_j = p_i45336_5_; + this.field_150992_k = p_i45336_6_; + this.field_150989_l = p_i45336_7_; + this.field_150990_m = p_i45336_8_; + this.field_150987_n = true; + } + + private FishType(int p_i45337_3_, String p_i45337_4_, int p_i45337_5_, float p_i45337_6_) + { + this.field_150980_f = p_i45337_3_; + this.field_150981_g = p_i45337_4_; + this.field_150991_j = p_i45337_5_; + this.field_150992_k = p_i45337_6_; + this.field_150989_l = 0; + this.field_150990_m = 0.0F; + this.field_150987_n = false; + } + + public int func_150976_a() + { + return this.field_150980_f; + } + + public String func_150972_b() + { + return this.field_150981_g; + } + + public int func_150975_c() + { + return this.field_150991_j; + } + + public float func_150967_d() + { + return this.field_150992_k; + } + + public int func_150970_e() + { + return this.field_150989_l; + } + + public float func_150977_f() + { + return this.field_150990_m; + } + + @SideOnly(Side.CLIENT) + public void func_150968_a(IIconRegister p_150968_1_) + { + this.field_150993_h = p_150968_1_.registerIcon("fish_" + this.field_150981_g + "_raw"); + + if (this.field_150987_n) + { + this.field_150994_i = p_150968_1_.registerIcon("fish_" + this.field_150981_g + "_cooked"); + } + } + + @SideOnly(Side.CLIENT) + public IIcon func_150971_g() + { + return this.field_150993_h; + } + + @SideOnly(Side.CLIENT) + public IIcon func_150979_h() + { + return this.field_150994_i; + } + + public boolean func_150973_i() + { + return this.field_150987_n; + } + + public static ItemFishFood.FishType func_150974_a(int p_150974_0_) + { + ItemFishFood.FishType fishtype = (ItemFishFood.FishType)field_150983_e.get(Integer.valueOf(p_150974_0_)); + return fishtype == null ? COD : fishtype; + } + + public static ItemFishFood.FishType func_150978_a(ItemStack p_150978_0_) + { + return p_150978_0_.getItem() instanceof ItemFishFood ? func_150974_a(p_150978_0_.getItemDamage()) : COD; + } + + static + { + ItemFishFood.FishType[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + ItemFishFood.FishType var3 = var0[var2]; + field_150983_e.put(Integer.valueOf(var3.func_150976_a()), var3); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishingRod.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishingRod.java new file mode 100644 index 0000000..ed3b353 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFishingRod.java @@ -0,0 +1,98 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemFishingRod extends Item +{ + @SideOnly(Side.CLIENT) + private IIcon theIcon; + private static final String __OBFID = "CL_00000034"; + + public ItemFishingRod() + { + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + /** + * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities + * hands. + */ + @SideOnly(Side.CLIENT) + public boolean shouldRotateAroundWhenRendering() + { + return true; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (player.fishEntity != null) + { + int i = player.fishEntity.func_146034_e(); + itemStackIn.damageItem(i, player); + player.swingItem(); + } + else + { + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityFishHook(worldIn, player)); + } + + player.swingItem(); + } + + return itemStackIn; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.itemIcon = register.registerIcon(this.getIconString() + "_uncast"); + this.theIcon = register.registerIcon(this.getIconString() + "_cast"); + } + + @SideOnly(Side.CLIENT) + public IIcon func_94597_g() + { + return this.theIcon; + } + + /** + * Checks isDamagable and if it cannot be stacked + */ + public boolean isItemTool(ItemStack p_77616_1_) + { + return super.isItemTool(p_77616_1_); + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFlintAndSteel.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFlintAndSteel.java new file mode 100644 index 0000000..e382cad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFlintAndSteel.java @@ -0,0 +1,72 @@ +package net.minecraft.item; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemFlintAndSteel extends Item +{ + private static final String __OBFID = "CL_00000035"; + + public ItemFlintAndSteel() + { + this.maxStackSize = 1; + this.setMaxDamage(64); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ == 0) + { + --p_77648_5_; + } + + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_)) + { + p_77648_3_.playSoundEffect((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.fire); + } + + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemFood.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFood.java new file mode 100644 index 0000000..36a5a93 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemFood.java @@ -0,0 +1,128 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemFood extends Item +{ + /** Number of ticks to run while 'EnumAction'ing until result. */ + public final int itemUseDuration; + /** The amount this food item heals the player. */ + private final int healAmount; + private final float saturationModifier; + /** Whether wolves like this food (true for raw and cooked porkchop). */ + private final boolean isWolfsFavoriteMeat; + /** If this field is true, the food can be consumed even if the player don't need to eat. */ + private boolean alwaysEdible; + /** represents the potion effect that will occurr upon eating this food. Set by setPotionEffect */ + private int potionId; + /** set by setPotionEffect */ + private int potionDuration; + /** set by setPotionEffect */ + private int potionAmplifier; + /** probably of the set potion effect occurring */ + private float potionEffectProbability; + private static final String __OBFID = "CL_00000036"; + + public ItemFood(int p_i45339_1_, float p_i45339_2_, boolean p_i45339_3_) + { + this.itemUseDuration = 32; + this.healAmount = p_i45339_1_; + this.isWolfsFavoriteMeat = p_i45339_3_; + this.saturationModifier = p_i45339_2_; + this.setCreativeTab(CreativeTabs.tabFood); + } + + public ItemFood(int p_i45340_1_, boolean p_i45340_2_) + { + this(p_i45340_1_, 0.6F, p_i45340_2_); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + --p_77654_1_.stackSize; + p_77654_3_.getFoodStats().func_151686_a(this, p_77654_1_); + p_77654_2_.playSoundAtEntity(p_77654_3_, "random.burp", 0.5F, p_77654_2_.rand.nextFloat() * 0.1F + 0.9F); + this.onFoodEaten(p_77654_1_, p_77654_2_, p_77654_3_); + return p_77654_1_; + } + + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) + { + if (!p_77849_2_.isRemote && this.potionId > 0 && p_77849_2_.rand.nextFloat() < this.potionEffectProbability) + { + p_77849_3_.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.eat; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (player.canEat(this.alwaysEdible)) + { + player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + } + + return itemStackIn; + } + + public int func_150905_g(ItemStack itemStackIn) + { + return this.healAmount; + } + + public float func_150906_h(ItemStack itemStackIn) + { + return this.saturationModifier; + } + + /** + * Whether wolves like this food (true for raw and cooked porkchop). + */ + public boolean isWolfsFavoriteMeat() + { + return this.isWolfsFavoriteMeat; + } + + /** + * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, + * float probability of effect happening + */ + public ItemFood setPotionEffect(int p_77844_1_, int duration, int amplifier, float probability) + { + this.potionId = p_77844_1_; + this.potionDuration = duration; + this.potionAmplifier = amplifier; + this.potionEffectProbability = probability; + return this; + } + + /** + * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. + */ + public ItemFood setAlwaysEdible() + { + this.alwaysEdible = true; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemGlassBottle.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemGlassBottle.java new file mode 100644 index 0000000..00746e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemGlassBottle.java @@ -0,0 +1,83 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemGlassBottle extends Item +{ + private static final String __OBFID = "CL_00001776"; + + public ItemGlassBottle() + { + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return Items.potionitem.getIconFromDamage(0); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, player, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!worldIn.canMineBlock(player, i, j, k)) + { + return itemStackIn; + } + + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (worldIn.getBlock(i, j, k).getMaterial() == Material.water) + { + --itemStackIn.stackSize; + + if (itemStackIn.stackSize <= 0) + { + return new ItemStack(Items.potionitem); + } + + if (!player.inventory.addItemStackToInventory(new ItemStack(Items.potionitem))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(Items.potionitem, 1, 0), false); + } + } + } + + return itemStackIn; + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemHangingEntity.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemHangingEntity.java new file mode 100644 index 0000000..31082d9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemHangingEntity.java @@ -0,0 +1,69 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityHanging; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Direction; +import net.minecraft.world.World; + +public class ItemHangingEntity extends Item +{ + private final Class hangingEntityClass; + private static final String __OBFID = "CL_00000038"; + + public ItemHangingEntity(Class p_i45342_1_) + { + this.hangingEntityClass = p_i45342_1_; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ == 0) + { + return false; + } + else if (p_77648_7_ == 1) + { + return false; + } + else + { + int i1 = Direction.facingToDirection[p_77648_7_]; + EntityHanging entityhanging = this.createHangingEntity(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1); + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + if (entityhanging != null && entityhanging.onValidSurface()) + { + if (!p_77648_3_.isRemote) + { + p_77648_3_.spawnEntityInWorld(entityhanging); + } + + --p_77648_1_.stackSize; + } + + return true; + } + } + } + + /** + * Create the hanging entity associated to this item. + */ + private EntityHanging createHangingEntity(World p_82810_1_, int p_82810_2_, int p_82810_3_, int p_82810_4_, int p_82810_5_) + { + return (EntityHanging)(this.hangingEntityClass == EntityPainting.class ? new EntityPainting(p_82810_1_, p_82810_2_, p_82810_3_, p_82810_4_, p_82810_5_) : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(p_82810_1_, p_82810_2_, p_82810_3_, p_82810_4_, p_82810_5_) : null)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemHoe.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemHoe.java new file mode 100644 index 0000000..e16033d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemHoe.java @@ -0,0 +1,94 @@ +package net.minecraft.item; + +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.UseHoeEvent; + +public class ItemHoe extends Item +{ + protected Item.ToolMaterial theToolMaterial; + private static final String __OBFID = "CL_00000039"; + + public ItemHoe(Item.ToolMaterial p_i45343_1_) + { + this.theToolMaterial = p_i45343_1_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45343_1_.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + UseHoeEvent event = new UseHoeEvent(p_77648_2_, p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + if (event.getResult() == Result.ALLOW) + { + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.grass || block == Blocks.dirt)) + { + Block block1 = Blocks.farmland; + p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + + if (p_77648_3_.isRemote) + { + return true; + } + else + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + } + else + { + return false; + } + } + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + /** + * Returns the name of the material this tool is made from as it is declared in Item.ToolMaterial (meaning diamond + * would return "EMERALD") + */ + public String getToolMaterialName() + { + return this.theToolMaterial.toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemLead.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLead.java new file mode 100644 index 0000000..f985c96 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLead.java @@ -0,0 +1,78 @@ +package net.minecraft.item; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLeashKnot; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class ItemLead extends Item +{ + private static final String __OBFID = "CL_00000045"; + + public ItemLead() + { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block.getRenderType() == 11) + { + if (p_77648_3_.isRemote) + { + return true; + } + else + { + func_150909_a(p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + return true; + } + } + else + { + return false; + } + } + + public static boolean func_150909_a(EntityPlayer p_150909_0_, World p_150909_1_, int p_150909_2_, int p_150909_3_, int p_150909_4_) + { + EntityLeashKnot entityleashknot = EntityLeashKnot.getKnotForBlock(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_); + boolean flag = false; + double d0 = 7.0D; + List list = p_150909_1_.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox((double)p_150909_2_ - d0, (double)p_150909_3_ - d0, (double)p_150909_4_ - d0, (double)p_150909_2_ + d0, (double)p_150909_3_ + d0, (double)p_150909_4_ + d0)); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityLiving entityliving = (EntityLiving)iterator.next(); + + if (entityliving.getLeashed() && entityliving.getLeashedToEntity() == p_150909_0_) + { + if (entityleashknot == null) + { + entityleashknot = EntityLeashKnot.func_110129_a(p_150909_1_, p_150909_2_, p_150909_3_, p_150909_4_); + } + + entityliving.setLeashedToEntity(entityleashknot, true); + flag = true; + } + } + } + + return flag; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemLeaves.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLeaves.java new file mode 100644 index 0000000..1b8e6b7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLeaves.java @@ -0,0 +1,59 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockLeaves; +import net.minecraft.util.IIcon; + +public class ItemLeaves extends ItemBlock +{ + private final BlockLeaves field_150940_b; + private static final String __OBFID = "CL_00000046"; + + public ItemLeaves(BlockLeaves p_i45344_1_) + { + super(p_i45344_1_); + this.field_150940_b = p_i45344_1_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_ | 4; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + int i = stack.getItemDamage(); + + if (i < 0 || i >= this.field_150940_b.func_150125_e().length) + { + i = 0; + } + + return super.getUnlocalizedName() + "." + this.field_150940_b.func_150125_e()[i]; + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150940_b.getIcon(0, p_77617_1_); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + return this.field_150940_b.getRenderColor(p_82790_1_.getItemDamage()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemLilyPad.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLilyPad.java new file mode 100644 index 0000000..9ae7466 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemLilyPad.java @@ -0,0 +1,77 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ItemLilyPad extends ItemColored +{ + private static final String __OBFID = "CL_00000074"; + + public ItemLilyPad(Block p_i45357_1_) + { + super(p_i45357_1_, false); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, player, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!worldIn.canMineBlock(player, i, j, k)) + { + return itemStackIn; + } + + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (worldIn.getBlock(i, j, k).getMaterial() == Material.water && worldIn.getBlockMetadata(i, j, k) == 0 && worldIn.isAirBlock(i, j + 1, k)) + { + // special case for handling block placement with water lilies + net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, i, j + 1, k); + worldIn.setBlock(i, j + 1, k, Blocks.waterlily); + if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(player, blocksnapshot, net.minecraftforge.common.util.ForgeDirection.UP).isCanceled()) + { + blocksnapshot.restore(true, false); + return itemStackIn; + } + + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + } + } + + return itemStackIn; + } + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + return Blocks.waterlily.getRenderColor(p_82790_1_.getItemDamage()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemMap.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMap.java new file mode 100644 index 0000000..31ae127 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMap.java @@ -0,0 +1,313 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Iterables; +import com.google.common.collect.Multisets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.material.MapColor; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.storage.MapData; + +public class ItemMap extends ItemMapBase +{ + private static final String __OBFID = "CL_00000047"; + + protected ItemMap() + { + this.setHasSubtypes(true); + } + + @SideOnly(Side.CLIENT) + public static MapData func_150912_a(int p_150912_0_, World p_150912_1_) + { + String s = "map_" + p_150912_0_; + MapData mapdata = (MapData)p_150912_1_.loadItemData(MapData.class, s); + + if (mapdata == null) + { + mapdata = new MapData(s); + p_150912_1_.setItemData(s, mapdata); + } + + return mapdata; + } + + public MapData getMapData(ItemStack p_77873_1_, World p_77873_2_) + { + String s = "map_" + p_77873_1_.getItemDamage(); + MapData mapdata = (MapData)p_77873_2_.loadItemData(MapData.class, s); + + if (mapdata == null && !p_77873_2_.isRemote) + { + p_77873_1_.setItemDamage(p_77873_2_.getUniqueDataId("map")); + s = "map_" + p_77873_1_.getItemDamage(); + mapdata = new MapData(s); + mapdata.scale = 3; + int i = 128 * (1 << mapdata.scale); + mapdata.xCenter = Math.round((float)p_77873_2_.getWorldInfo().getSpawnX() / (float)i) * i; + mapdata.zCenter = Math.round((float)(p_77873_2_.getWorldInfo().getSpawnZ() / i)) * i; + mapdata.dimension = p_77873_2_.provider.dimensionId; + mapdata.markDirty(); + p_77873_2_.setItemData(s, mapdata); + } + + return mapdata; + } + + public void updateMapData(World p_77872_1_, Entity p_77872_2_, MapData p_77872_3_) + { + if (p_77872_1_.provider.dimensionId == p_77872_3_.dimension && p_77872_2_ instanceof EntityPlayer) + { + int i = 1 << p_77872_3_.scale; + int j = p_77872_3_.xCenter; + int k = p_77872_3_.zCenter; + int l = MathHelper.floor_double(p_77872_2_.posX - (double)j) / i + 64; + int i1 = MathHelper.floor_double(p_77872_2_.posZ - (double)k) / i + 64; + int j1 = 128 / i; + + if (p_77872_1_.provider.hasNoSky) + { + j1 /= 2; + } + + MapData.MapInfo mapinfo = p_77872_3_.func_82568_a((EntityPlayer)p_77872_2_); + ++mapinfo.field_82569_d; + + for (int k1 = l - j1 + 1; k1 < l + j1; ++k1) + { + if ((k1 & 15) == (mapinfo.field_82569_d & 15)) + { + int l1 = 255; + int i2 = 0; + double d0 = 0.0D; + + for (int j2 = i1 - j1 - 1; j2 < i1 + j1; ++j2) + { + if (k1 >= 0 && j2 >= -1 && k1 < 128 && j2 < 128) + { + int k2 = k1 - l; + int l2 = j2 - i1; + boolean flag = k2 * k2 + l2 * l2 > (j1 - 2) * (j1 - 2); + int i3 = (j / i + k1 - 64) * i; + int j3 = (k / i + j2 - 64) * i; + HashMultiset hashmultiset = HashMultiset.create(); + Chunk chunk = p_77872_1_.getChunkFromBlockCoords(i3, j3); + + if (!chunk.isEmpty()) + { + int k3 = i3 & 15; + int l3 = j3 & 15; + int i4 = 0; + double d1 = 0.0D; + int j4; + + if (p_77872_1_.provider.hasNoSky) + { + j4 = i3 + j3 * 231871; + j4 = j4 * j4 * 31287121 + j4 * 11; + + if ((j4 >> 20 & 1) == 0) + { + hashmultiset.add(Blocks.dirt.getMapColor(0), 10); + } + else + { + hashmultiset.add(Blocks.stone.getMapColor(0), 100); + } + + d1 = 100.0D; + } + else + { + for (j4 = 0; j4 < i; ++j4) + { + for (int k4 = 0; k4 < i; ++k4) + { + int l4 = chunk.getHeightValue(j4 + k3, k4 + l3) + 1; + Block block = Blocks.air; + int i5 = 0; + + if (l4 > 1) + { + do + { + --l4; + block = chunk.getBlock(j4 + k3, l4, k4 + l3); + i5 = chunk.getBlockMetadata(j4 + k3, l4, k4 + l3); + } + while (block.getMapColor(i5) == MapColor.airColor && l4 > 0); + + if (l4 > 0 && block.getMaterial().isLiquid()) + { + int j5 = l4 - 1; + Block block1; + + do + { + block1 = chunk.getBlock(j4 + k3, j5--, k4 + l3); + ++i4; + } + while (j5 > 0 && block1.getMaterial().isLiquid()); + } + } + + d1 += (double)l4 / (double)(i * i); + hashmultiset.add(block.getMapColor(i5)); + } + } + } + + i4 /= i * i; + double d2 = (d1 - d0) * 4.0D / (double)(i + 4) + ((double)(k1 + j2 & 1) - 0.5D) * 0.4D; + byte b0 = 1; + + if (d2 > 0.6D) + { + b0 = 2; + } + + if (d2 < -0.6D) + { + b0 = 0; + } + + MapColor mapcolor = (MapColor)Iterables.getFirst(Multisets.copyHighestCountFirst(hashmultiset), MapColor.airColor); + + if (mapcolor == MapColor.waterColor) + { + d2 = (double)i4 * 0.1D + (double)(k1 + j2 & 1) * 0.2D; + b0 = 1; + + if (d2 < 0.5D) + { + b0 = 2; + } + + if (d2 > 0.9D) + { + b0 = 0; + } + } + + d0 = d1; + + if (j2 >= 0 && k2 * k2 + l2 * l2 < j1 * j1 && (!flag || (k1 + j2 & 1) != 0)) + { + byte b1 = p_77872_3_.colors[k1 + j2 * 128]; + byte b2 = (byte)(mapcolor.colorIndex * 4 + b0); + + if (b1 != b2) + { + if (l1 > j2) + { + l1 = j2; + } + + if (i2 < j2) + { + i2 = j2; + } + + p_77872_3_.colors[k1 + j2 * 128] = b2; + } + } + } + } + } + + if (l1 <= i2) + { + p_77872_3_.setColumnDirty(k1, l1, i2); + } + } + } + } + } + + /** + * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and + * update it's contents. + */ + public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int p_77663_4_, boolean p_77663_5_) + { + if (!worldIn.isRemote) + { + MapData mapdata = this.getMapData(stack, worldIn); + + if (entityIn instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)entityIn; + mapdata.updateVisiblePlayers(entityplayer, stack); + } + + if (p_77663_5_) + { + this.updateMapData(worldIn, entityIn, mapdata); + } + } + } + + public Packet func_150911_c(ItemStack p_150911_1_, World p_150911_2_, EntityPlayer p_150911_3_) + { + byte[] abyte = this.getMapData(p_150911_1_, p_150911_2_).getUpdatePacketData(p_150911_1_, p_150911_2_, p_150911_3_); + return abyte == null ? null : new S34PacketMaps(p_150911_1_.getItemDamage(), abyte); + } + + /** + * Called when item is crafted/smelted. Used only by maps so far. + */ + public void onCreated(ItemStack p_77622_1_, World p_77622_2_, EntityPlayer p_77622_3_) + { + if (p_77622_1_.hasTagCompound() && p_77622_1_.getTagCompound().getBoolean("map_is_scaling")) + { + MapData mapdata = Items.filled_map.getMapData(p_77622_1_, p_77622_2_); + p_77622_1_.setItemDamage(p_77622_2_.getUniqueDataId("map")); + MapData mapdata1 = new MapData("map_" + p_77622_1_.getItemDamage()); + mapdata1.scale = (byte)(mapdata.scale + 1); + + if (mapdata1.scale > 4) + { + mapdata1.scale = 4; + } + + mapdata1.xCenter = mapdata.xCenter; + mapdata1.zCenter = mapdata.zCenter; + mapdata1.dimension = mapdata.dimension; + mapdata1.markDirty(); + p_77622_2_.setItemData("map_" + p_77622_1_.getItemDamage(), mapdata1); + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + MapData mapdata = this.getMapData(p_77624_1_, p_77624_2_.worldObj); + + if (p_77624_4_) + { + if (mapdata == null) + { + p_77624_3_.add("Unknown map"); + } + else + { + p_77624_3_.add("Scaling at 1:" + (1 << mapdata.scale)); + p_77624_3_.add("(Level " + mapdata.scale + "/" + 4 + ")"); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemMapBase.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMapBase.java new file mode 100644 index 0000000..ef11576 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMapBase.java @@ -0,0 +1,23 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.world.World; + +public class ItemMapBase extends Item +{ + private static final String __OBFID = "CL_00000004"; + + /** + * false for all Items except sub-classes of ItemMapBase + */ + public boolean isMap() + { + return true; + } + + public Packet func_150911_c(ItemStack p_150911_1_, World p_150911_2_, EntityPlayer p_150911_3_) + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemMinecart.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMinecart.java new file mode 100644 index 0000000..e17acee --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMinecart.java @@ -0,0 +1,110 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockRailBase; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class ItemMinecart extends Item +{ + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() + { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + private static final String __OBFID = "CL_00000050"; + /** + * Dispense the specified stack, play the dispense sound and spawn particles. + */ + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { + EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata()); + World world = source.getWorld(); + double d0 = source.getX() + (double)((float)enumfacing.getFrontOffsetX() * 1.125F); + double d1 = source.getY() + (double)((float)enumfacing.getFrontOffsetY() * 1.125F); + double d2 = source.getZ() + (double)((float)enumfacing.getFrontOffsetZ() * 1.125F); + int i = source.getXInt() + enumfacing.getFrontOffsetX(); + int j = source.getYInt() + enumfacing.getFrontOffsetY(); + int k = source.getZInt() + enumfacing.getFrontOffsetZ(); + Block block = world.getBlock(i, j, k); + double d3; + + if (BlockRailBase.func_150051_a(block)) + { + d3 = 0.0D; + } + else + { + if (block.getMaterial() != Material.air || !BlockRailBase.func_150051_a(world.getBlock(i, j - 1, k))) + { + return this.behaviourDefaultDispenseItem.dispense(source, stack); + } + + d3 = -1.0D; + } + + EntityMinecart entityminecart = EntityMinecart.createMinecart(world, d0, d1 + d3, d2, ((ItemMinecart)stack.getItem()).minecartType); + + if (stack.hasDisplayName()) + { + entityminecart.setMinecartName(stack.getDisplayName()); + } + + world.spawnEntityInWorld(entityminecart); + stack.splitStack(1); + return stack; + } + /** + * Play the dispense sound from the specified block. + */ + protected void playDispenseSound(IBlockSource source) + { + source.getWorld().playAuxSFX(1000, source.getXInt(), source.getYInt(), source.getZInt(), 0); + } + }; + public int minecartType; + private static final String __OBFID = "CL_00000049"; + + public ItemMinecart(int p_i45345_1_) + { + this.maxStackSize = 1; + this.minecartType = p_i45345_1_; + this.setCreativeTab(CreativeTabs.tabTransport); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (BlockRailBase.func_150051_a(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_))) + { + if (!p_77648_3_.isRemote) + { + EntityMinecart entityminecart = EntityMinecart.createMinecart(p_77648_3_, (double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.minecartType); + + if (p_77648_1_.hasDisplayName()) + { + entityminecart.setMinecartName(p_77648_1_.getDisplayName()); + } + + p_77648_3_.spawnEntityInWorld(entityminecart); + } + + --p_77648_1_.stackSize; + return true; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemMonsterPlacer.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMonsterPlacer.java new file mode 100644 index 0000000..f1fb055 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMonsterPlacer.java @@ -0,0 +1,227 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.Facing; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemMonsterPlacer extends Item +{ + @SideOnly(Side.CLIENT) + private IIcon theIcon; + private static final String __OBFID = "CL_00000070"; + + public ItemMonsterPlacer() + { + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); + String s1 = EntityList.getStringFromID(p_77653_1_.getItemDamage()); + + if (s1 != null) + { + s = s + " " + StatCollector.translateToLocal("entity." + s1 + ".name"); + } + + return s; + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(p_82790_1_.getItemDamage())); + return entityegginfo != null ? (p_82790_2_ == 0 ? entityegginfo.primaryColor : entityegginfo.secondaryColor) : 16777215; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.isRemote) + { + return true; + } + else + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + p_77648_4_ += Facing.offsetsXForSide[p_77648_7_]; + p_77648_5_ += Facing.offsetsYForSide[p_77648_7_]; + p_77648_6_ += Facing.offsetsZForSide[p_77648_7_]; + double d0 = 0.0D; + + if (p_77648_7_ == 1 && block.getRenderType() == 11) + { + d0 = 0.5D; + } + + Entity entity = spawnCreature(p_77648_3_, p_77648_1_.getItemDamage(), (double)p_77648_4_ + 0.5D, (double)p_77648_5_ + d0, (double)p_77648_6_ + 0.5D); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && p_77648_1_.hasDisplayName()) + { + ((EntityLiving)entity).setCustomNameTag(p_77648_1_.getDisplayName()); + } + + if (!p_77648_2_.capabilities.isCreativeMode) + { + --p_77648_1_.stackSize; + } + } + + return true; + } + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (worldIn.isRemote) + { + return itemStackIn; + } + else + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(worldIn, player, true); + + if (movingobjectposition == null) + { + return itemStackIn; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!worldIn.canMineBlock(player, i, j, k)) + { + return itemStackIn; + } + + if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, itemStackIn)) + { + return itemStackIn; + } + + if (worldIn.getBlock(i, j, k) instanceof BlockLiquid) + { + Entity entity = spawnCreature(worldIn, itemStackIn.getItemDamage(), (double)i, (double)j, (double)k); + + if (entity != null) + { + if (entity instanceof EntityLivingBase && itemStackIn.hasDisplayName()) + { + ((EntityLiving)entity).setCustomNameTag(itemStackIn.getDisplayName()); + } + + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + } + } + } + + return itemStackIn; + } + } + } + + /** + * Spawns the creature specified by the egg's type in the location specified by the last three parameters. + * Parameters: world, entityID, x, y, z. + */ + public static Entity spawnCreature(World p_77840_0_, int p_77840_1_, double p_77840_2_, double p_77840_4_, double p_77840_6_) + { + if (!EntityList.entityEggs.containsKey(Integer.valueOf(p_77840_1_))) + { + return null; + } + else + { + Entity entity = null; + + for (int j = 0; j < 1; ++j) + { + entity = EntityList.createEntityByID(p_77840_1_, p_77840_0_); + + if (entity != null && entity instanceof EntityLivingBase) + { + EntityLiving entityliving = (EntityLiving)entity; + entity.setLocationAndAngles(p_77840_2_, p_77840_4_, p_77840_6_, MathHelper.wrapAngleTo180_float(p_77840_0_.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + entityliving.onSpawnWithEgg((IEntityLivingData)null); + p_77840_0_.spawnEntityInWorld(entity); + entityliving.playLivingSound(); + } + } + + return entity; + } + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return p_77618_2_ > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + Iterator iterator = EntityList.entityEggs.values().iterator(); + + while (iterator.hasNext()) + { + EntityList.EntityEggInfo entityegginfo = (EntityList.EntityEggInfo)iterator.next(); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, entityegginfo.spawnedID)); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + super.registerIcons(register); + this.theIcon = register.registerIcon(this.getIconString() + "_overlay"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemMultiTexture.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMultiTexture.java new file mode 100644 index 0000000..0ad4884 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemMultiTexture.java @@ -0,0 +1,55 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; + +public class ItemMultiTexture extends ItemBlock +{ + protected final Block field_150941_b; + protected final String[] field_150942_c; + private static final String __OBFID = "CL_00000051"; + + public ItemMultiTexture(Block p_i45346_1_, Block p_i45346_2_, String[] p_i45346_3_) + { + super(p_i45346_1_); + this.field_150941_b = p_i45346_2_; + this.field_150942_c = p_i45346_3_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.field_150941_b.getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + int i = stack.getItemDamage(); + + if (i < 0 || i >= this.field_150942_c.length) + { + i = 0; + } + + return super.getUnlocalizedName() + "." + this.field_150942_c[i]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemNameTag.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemNameTag.java new file mode 100644 index 0000000..18df7b7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemNameTag.java @@ -0,0 +1,39 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemNameTag extends Item +{ + private static final String __OBFID = "CL_00000052"; + + public ItemNameTag() + { + this.setCreativeTab(CreativeTabs.tabTools); + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) + { + if (!stack.hasDisplayName()) + { + return false; + } + else if (target instanceof EntityLiving) + { + EntityLiving entityliving = (EntityLiving)target; + entityliving.setCustomNameTag(stack.getDisplayName()); + entityliving.func_110163_bv(); + --stack.stackSize; + return true; + } + else + { + return super.itemInteractionForEntity(stack, player, target); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemPickaxe.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPickaxe.java new file mode 100644 index 0000000..9a7b817 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPickaxe.java @@ -0,0 +1,28 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; + +public class ItemPickaxe extends ItemTool +{ + private static final Set field_150915_c = Sets.newHashSet(new Block[] {Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone, Blocks.iron_ore, Blocks.iron_block, Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore, Blocks.diamond_block, Blocks.ice, Blocks.netherrack, Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore, Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, Blocks.golden_rail, Blocks.activator_rail}); + private static final String __OBFID = "CL_00000053"; + + protected ItemPickaxe(Item.ToolMaterial p_i45347_1_) + { + super(2.0F, p_i45347_1_, field_150915_c); + } + + public boolean func_150897_b(Block p_150897_1_) + { + return p_150897_1_ == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (p_150897_1_ != Blocks.diamond_block && p_150897_1_ != Blocks.diamond_ore ? (p_150897_1_ != Blocks.emerald_ore && p_150897_1_ != Blocks.emerald_block ? (p_150897_1_ != Blocks.gold_block && p_150897_1_ != Blocks.gold_ore ? (p_150897_1_ != Blocks.iron_block && p_150897_1_ != Blocks.iron_ore ? (p_150897_1_ != Blocks.lapis_block && p_150897_1_ != Blocks.lapis_ore ? (p_150897_1_ != Blocks.redstone_ore && p_150897_1_ != Blocks.lit_redstone_ore ? (p_150897_1_.getMaterial() == Material.rock ? true : (p_150897_1_.getMaterial() == Material.iron ? true : p_150897_1_.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return p_150893_2_.getMaterial() != Material.iron && p_150893_2_.getMaterial() != Material.anvil && p_150893_2_.getMaterial() != Material.rock ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemPiston.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPiston.java new file mode 100644 index 0000000..070f0cb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPiston.java @@ -0,0 +1,21 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; + +public class ItemPiston extends ItemBlock +{ + private static final String __OBFID = "CL_00000054"; + + public ItemPiston(Block p_i45348_1_) + { + super(p_i45348_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return 7; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemPotion.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPotion.java new file mode 100644 index 0000000..c149252 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemPotion.java @@ -0,0 +1,481 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityPotion; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemPotion extends Item +{ + /** + * Contains a map from integers to the list of potion effects that potions with that damage value confer (to prevent + * recalculating it). + */ + private HashMap effectCache = new HashMap(); + private static final Map field_77835_b = new LinkedHashMap(); + @SideOnly(Side.CLIENT) + private IIcon field_94591_c; + @SideOnly(Side.CLIENT) + private IIcon field_94590_d; + @SideOnly(Side.CLIENT) + private IIcon field_94592_ct; + private static final String __OBFID = "CL_00000055"; + + public ItemPotion() + { + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + + /** + * Returns a list of potion effects for the specified itemstack. + */ + public List getEffects(ItemStack p_77832_1_) + { + if (p_77832_1_.hasTagCompound() && p_77832_1_.getTagCompound().hasKey("CustomPotionEffects", 9)) + { + ArrayList arraylist = new ArrayList(); + NBTTagList nbttaglist = p_77832_1_.getTagCompound().getTagList("CustomPotionEffects", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound); + + if (potioneffect != null) + { + arraylist.add(potioneffect); + } + } + + return arraylist; + } + else + { + List list = (List)this.effectCache.get(Integer.valueOf(p_77832_1_.getItemDamage())); + + if (list == null) + { + list = PotionHelper.getPotionEffects(p_77832_1_.getItemDamage(), false); + this.effectCache.put(Integer.valueOf(p_77832_1_.getItemDamage()), list); + } + + return list; + } + } + + /** + * Returns a list of effects for the specified potion damage value. + */ + public List getEffects(int p_77834_1_) + { + List list = (List)this.effectCache.get(Integer.valueOf(p_77834_1_)); + + if (list == null) + { + list = PotionHelper.getPotionEffects(p_77834_1_, false); + this.effectCache.put(Integer.valueOf(p_77834_1_), list); + } + + return list; + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + if (!p_77654_3_.capabilities.isCreativeMode) + { + --p_77654_1_.stackSize; + } + + if (!p_77654_2_.isRemote) + { + List list = this.getEffects(p_77654_1_); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + p_77654_3_.addPotionEffect(new PotionEffect(potioneffect)); + } + } + } + + if (!p_77654_3_.capabilities.isCreativeMode) + { + if (p_77654_1_.stackSize <= 0) + { + return new ItemStack(Items.glass_bottle); + } + + p_77654_3_.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); + } + + return p_77654_1_; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 32; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.drink; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (isSplash(itemStackIn.getItemDamage())) + { + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntityPotion(worldIn, player, itemStackIn)); + } + + return itemStackIn; + } + else + { + player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + return false; + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return isSplash(p_77617_1_) ? this.field_94591_c : this.field_94590_d; + } + + /** + * Gets an icon index based on an item's damage value and the given render pass + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return p_77618_2_ == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + /** + * returns wether or not a potion is a throwable splash potion based on damage value + */ + public static boolean isSplash(int p_77831_0_) + { + return (p_77831_0_ & 16384) != 0; + } + + @SideOnly(Side.CLIENT) + public int getColorFromDamage(int p_77620_1_) + { + return PotionHelper.func_77915_a(p_77620_1_, false); + } + + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) + { + return p_82790_2_ > 0 ? 16777215 : this.getColorFromDamage(p_82790_1_.getItemDamage()); + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly(Side.CLIENT) + public boolean isEffectInstant(int p_77833_1_) + { + List list = this.getEffects(p_77833_1_); + + if (list != null && !list.isEmpty()) + { + Iterator iterator = list.iterator(); + PotionEffect potioneffect; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + potioneffect = (PotionEffect)iterator.next(); + } + while (!Potion.potionTypes[potioneffect.getPotionID()].isInstant()); + + return true; + } + else + { + return false; + } + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + if (p_77653_1_.getItemDamage() == 0) + { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); + } + else + { + String s = ""; + + if (isSplash(p_77653_1_.getItemDamage())) + { + s = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; + } + + List list = Items.potionitem.getEffects(p_77653_1_); + String s1; + + if (list != null && !list.isEmpty()) + { + s1 = ((PotionEffect)list.get(0)).getEffectName(); + s1 = s1 + ".postfix"; + return s + StatCollector.translateToLocal(s1).trim(); + } + else + { + s1 = PotionHelper.func_77905_c(p_77653_1_.getItemDamage()); + return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(p_77653_1_); + } + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + if (p_77624_1_.getItemDamage() != 0) + { + List list1 = Items.potionitem.getEffects(p_77624_1_); + HashMultimap hashmultimap = HashMultimap.create(); + Iterator iterator1; + + if (list1 != null && !list1.isEmpty()) + { + iterator1 = list1.iterator(); + + while (iterator1.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator1.next(); + String s1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); + Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; + Map map = potion.func_111186_k(); + + if (map != null && map.size() > 0) + { + Iterator iterator = map.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.func_111183_a(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); + hashmultimap.put(((IAttribute)entry.getKey()).getAttributeUnlocalizedName(), attributemodifier1); + } + } + + if (potioneffect.getAmplifier() > 0) + { + s1 = s1 + " " + StatCollector.translateToLocal("potion.potency." + potioneffect.getAmplifier()).trim(); + } + + if (potioneffect.getDuration() > 20) + { + s1 = s1 + " (" + Potion.getDurationString(potioneffect) + ")"; + } + + if (potion.isBadEffect()) + { + p_77624_3_.add(EnumChatFormatting.RED + s1); + } + else + { + p_77624_3_.add(EnumChatFormatting.GRAY + s1); + } + } + } + else + { + String s = StatCollector.translateToLocal("potion.empty").trim(); + p_77624_3_.add(EnumChatFormatting.GRAY + s); + } + + if (!hashmultimap.isEmpty()) + { + p_77624_3_.add(""); + p_77624_3_.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + iterator1 = hashmultimap.entries().iterator(); + + while (iterator1.hasNext()) + { + Entry entry1 = (Entry)iterator1.next(); + AttributeModifier attributemodifier2 = (AttributeModifier)entry1.getValue(); + double d0 = attributemodifier2.getAmount(); + double d1; + + if (attributemodifier2.getOperation() != 1 && attributemodifier2.getOperation() != 2) + { + d1 = attributemodifier2.getAmount(); + } + else + { + d1 = attributemodifier2.getAmount() * 100.0D; + } + + if (d0 > 0.0D) + { + p_77624_3_.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier2.getOperation(), new Object[] {ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry1.getKey())})); + } + else if (d0 < 0.0D) + { + d1 *= -1.0D; + p_77624_3_.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier2.getOperation(), new Object[] {ItemStack.field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry1.getKey())})); + } + } + } + } + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + List list = this.getEffects(p_77636_1_); + return list != null && !list.isEmpty(); + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + super.getSubItems(p_150895_1_, p_150895_2_, p_150895_3_); + int j; + + if (field_77835_b.isEmpty()) + { + for (int i = 0; i <= 15; ++i) + { + for (j = 0; j <= 1; ++j) + { + int k; + + if (j == 0) + { + k = i | 8192; + } + else + { + k = i | 16384; + } + + for (int l = 0; l <= 2; ++l) + { + int i1 = k; + + if (l != 0) + { + if (l == 1) + { + i1 = k | 32; + } + else if (l == 2) + { + i1 = k | 64; + } + } + + List list1 = PotionHelper.getPotionEffects(i1, false); + + if (list1 != null && !list1.isEmpty()) + { + field_77835_b.put(list1, Integer.valueOf(i1)); + } + } + } + } + } + + Iterator iterator = field_77835_b.values().iterator(); + + while (iterator.hasNext()) + { + j = ((Integer)iterator.next()).intValue(); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, j)); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.field_94590_d = register.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); + this.field_94591_c = register.registerIcon(this.getIconString() + "_" + "bottle_splash"); + this.field_94592_ct = register.registerIcon(this.getIconString() + "_" + "overlay"); + } + + @SideOnly(Side.CLIENT) + public static IIcon func_94589_d(String p_94589_0_) + { + return p_94589_0_.equals("bottle_drinkable") ? Items.potionitem.field_94590_d : (p_94589_0_.equals("bottle_splash") ? Items.potionitem.field_94591_c : (p_94589_0_.equals("overlay") ? Items.potionitem.field_94592_ct : null)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemRecord.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemRecord.java new file mode 100644 index 0000000..b46c6fb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemRecord.java @@ -0,0 +1,109 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.block.BlockJukebox; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemRecord extends Item +{ + private static final Map field_150928_b = new HashMap(); + /** The name of the record. */ + public final String recordName; + private static final String __OBFID = "CL_00000057"; + + protected ItemRecord(String p_i45350_1_) + { + this.recordName = p_i45350_1_; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabMisc); + field_150928_b.put("records." + p_i45350_1_, this); //Forge Bug Fix: RenderGlobal adds a "records." when looking up below. + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return this.itemIcon; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == Blocks.jukebox && p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) == 0) + { + if (p_77648_3_.isRemote) + { + return true; + } + else + { + ((BlockJukebox)Blocks.jukebox).func_149926_b(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_1_); + p_77648_3_.playAuxSFXAtEntity((EntityPlayer)null, 1005, p_77648_4_, p_77648_5_, p_77648_6_, Item.getIdFromItem(this)); + --p_77648_1_.stackSize; + return true; + } + } + else + { + return false; + } + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) + { + p_77624_3_.add(this.getRecordNameLocal()); + } + + @SideOnly(Side.CLIENT) + public String getRecordNameLocal() + { + return StatCollector.translateToLocal("item.record." + this.recordName + ".desc"); + } + + /** + * Return an item rarity from EnumRarity + */ + public EnumRarity getRarity(ItemStack p_77613_1_) + { + return EnumRarity.rare; + } + + /** + * Return the record item corresponding to the given name. + */ + @SideOnly(Side.CLIENT) + public static ItemRecord getRecord(String p_150926_0_) + { + return (ItemRecord)field_150928_b.get(p_150926_0_); + } + + /** + * Retrieves the resource location of the sound to play for this record. + * + * @param name The name of the record to play + * @return The resource location for the audio, null to use default. + */ + public ResourceLocation getRecordResource(String name) + { + return new ResourceLocation(name); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemRedstone.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemRedstone.java new file mode 100644 index 0000000..fb4e5ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemRedstone.java @@ -0,0 +1,76 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemRedstone extends Item +{ + private static final String __OBFID = "CL_00000058"; + + public ItemRedstone() + { + this.setCreativeTab(CreativeTabs.tabRedstone); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) != Blocks.snow_layer) + { + if (p_77648_7_ == 0) + { + --p_77648_5_; + } + + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + if (!p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_)) + { + return false; + } + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + if (Blocks.redstone_wire.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) + { + --p_77648_1_.stackSize; + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.redstone_wire); + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemReed.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemReed.java new file mode 100644 index 0000000..7adb24d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemReed.java @@ -0,0 +1,94 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemReed extends Item +{ + private Block field_150935_a; + private static final String __OBFID = "CL_00001773"; + + public ItemReed(Block p_i45329_1_) + { + this.field_150935_a = p_i45329_1_; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block == Blocks.snow_layer && (p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_) & 7) < 1) + { + p_77648_7_ = 1; + } + else if (block != Blocks.vine && block != Blocks.tallgrass && block != Blocks.deadbush) + { + if (p_77648_7_ == 0) + { + --p_77648_5_; + } + + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else if (p_77648_1_.stackSize == 0) + { + return false; + } + else + { + if (p_77648_3_.canPlaceEntityOnSide(this.field_150935_a, p_77648_4_, p_77648_5_, p_77648_6_, false, p_77648_7_, (Entity)null, p_77648_1_)) + { + int i1 = this.field_150935_a.onBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, 0); + + if (p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150935_a, i1, 3)) + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_150935_a) + { + this.field_150935_a.onBlockPlacedBy(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_, p_77648_1_); + this.field_150935_a.onPostBlockPlaced(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1); + } + + p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150935_a.stepSound.func_150496_b(), (this.field_150935_a.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150935_a.stepSound.getPitch() * 0.8F); + --p_77648_1_.stackSize; + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSaddle.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSaddle.java new file mode 100644 index 0000000..88fbf64 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSaddle.java @@ -0,0 +1,51 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; + +public class ItemSaddle extends Item +{ + private static final String __OBFID = "CL_00000059"; + + public ItemSaddle() + { + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) + { + if (target instanceof EntityPig) + { + EntityPig entitypig = (EntityPig)target; + + if (!entitypig.getSaddled() && !entitypig.isChild()) + { + entitypig.setSaddled(true); + entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F); + --stack.stackSize; + } + + return true; + } + else + { + return false; + } + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { + this.itemInteractionForEntity(stack, (EntityPlayer)null, p_77644_2_); + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeedFood.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeedFood.java new file mode 100644 index 0000000..799b88b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeedFood.java @@ -0,0 +1,71 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.util.ForgeDirection; + +public class ItemSeedFood extends ItemFood implements IPlantable +{ + private Block field_150908_b; + /** Block ID of the soil this seed food should be planted on. */ + private Block soilId; + private static final String __OBFID = "CL_00000060"; + + public ItemSeedFood(int p_i45351_1_, float p_i45351_2_, Block p_i45351_3_, Block p_i45351_4_) + { + super(p_i45351_1_, p_i45351_2_, false); + this.field_150908_b = p_i45351_3_; + this.soilId = p_i45351_4_; + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ != 1) + { + return false; + } + else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150908_b); + --p_77648_1_.stackSize; + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { + return EnumPlantType.Crop; + } + + @Override + public Block getPlant(IBlockAccess world, int x, int y, int z) + { + return field_150908_b; + } + + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeeds.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeeds.java new file mode 100644 index 0000000..2401bbd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSeeds.java @@ -0,0 +1,73 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.util.ForgeDirection; + +public class ItemSeeds extends Item implements IPlantable +{ + private Block field_150925_a; + /** BlockID of the block the seeds can be planted on. */ + private Block soilBlockID; + private static final String __OBFID = "CL_00000061"; + + public ItemSeeds(Block p_i45352_1_, Block p_i45352_2_) + { + this.field_150925_a = p_i45352_1_; + this.soilBlockID = p_i45352_2_; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ != 1) + { + return false; + } + else if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) + { + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a); + --p_77648_1_.stackSize; + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + + @Override + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) + { + return field_150925_a == Blocks.nether_wart ? EnumPlantType.Nether : EnumPlantType.Crop; + } + + @Override + public Block getPlant(IBlockAccess world, int x, int y, int z) + { + return field_150925_a; + } + + @Override + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemShears.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemShears.java new file mode 100644 index 0000000..c129daf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemShears.java @@ -0,0 +1,119 @@ +package net.minecraft.item; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +public class ItemShears extends Item +{ + private static final String __OBFID = "CL_00000062"; + + public ItemShears() + { + this.setMaxStackSize(1); + this.setMaxDamage(238); + this.setCreativeTab(CreativeTabs.tabTools); + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { + if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && !(blockIn instanceof IShearable)) + { + return super.onBlockDestroyed(stack, worldIn, blockIn, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); + } + else + { + return true; + } + } + + public boolean func_150897_b(Block p_150897_1_) + { + return p_150897_1_ == Blocks.web || p_150897_1_ == Blocks.redstone_wire || p_150897_1_ == Blocks.tripwire; + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return p_150893_2_ != Blocks.web && p_150893_2_.getMaterial() != Material.leaves ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; + } + + /** + * Returns true if the item can be used on the given entity, e.g. shears on sheep. + */ + @Override + public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) + { + if (entity.worldObj.isRemote) + { + return false; + } + if (entity instanceof IShearable) + { + IShearable target = (IShearable)entity; + if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) + { + ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, + EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + + Random rand = new Random(); + for(ItemStack stack : drops) + { + EntityItem ent = entity.entityDropItem(stack, 1.0F); + ent.motionY += rand.nextFloat() * 0.05F; + ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; + } + itemstack.damageItem(1, entity); + } + return true; + } + return false; + } + + @Override + public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) + { + if (player.worldObj.isRemote) + { + return false; + } + Block block = player.worldObj.getBlock(x, y, z); + if (block instanceof IShearable) + { + IShearable target = (IShearable)block; + if (target.isShearable(itemstack, player.worldObj, x, y, z)) + { + ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, + EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + Random rand = new Random(); + + for(ItemStack stack : drops) + { + float f = 0.7F; + double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack); + entityitem.delayBeforeCanPickup = 10; + player.worldObj.spawnEntityInWorld(entityitem); + } + + itemstack.damageItem(1, player); + player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); + } + } + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSign.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSign.java new file mode 100644 index 0000000..3db463d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSign.java @@ -0,0 +1,97 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ItemSign extends Item +{ + private static final String __OBFID = "CL_00000064"; + + public ItemSign() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_7_ == 0) + { + return false; + } + else if (!p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial().isSolid()) + { + return false; + } + else + { + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else if (!Blocks.standing_sign.canPlaceBlockAt(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) + { + return false; + } + else if (p_77648_3_.isRemote) + { + return true; + } + else + { + if (p_77648_7_ == 1) + { + int i1 = MathHelper.floor_double((double)((p_77648_2_.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.standing_sign, i1, 3); + } + else + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.wall_sign, p_77648_7_, 3); + } + + --p_77648_1_.stackSize; + TileEntitySign tileentitysign = (TileEntitySign)p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); + + if (tileentitysign != null) + { + p_77648_2_.func_146100_a(tileentitysign); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSimpleFoiled.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSimpleFoiled.java new file mode 100644 index 0000000..22d0e03 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSimpleFoiled.java @@ -0,0 +1,15 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemSimpleFoiled extends Item +{ + private static final String __OBFID = "CL_00000065"; + + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack p_77636_1_) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSkull.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSkull.java new file mode 100644 index 0000000..a7c25ca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSkull.java @@ -0,0 +1,214 @@ +package net.minecraft.item; + +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.UUID; +import net.minecraft.block.BlockSkull; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntitySkull; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class ItemSkull extends Item +{ + private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; + public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"}; + @SideOnly(Side.CLIENT) + private IIcon[] field_94586_c; + private static final String __OBFID = "CL_00000067"; + + public ItemSkull() + { + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if(p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_7_ != 0) + { + p_77648_7_ = 1; + p_77648_5_--; + } + if (p_77648_7_ == 0) + { + return false; + } + else if (!p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_).getMaterial().isSolid() && !p_77648_3_.isSideSolid(p_77648_4_, p_77648_5_, p_77648_6_, net.minecraftforge.common.util.ForgeDirection.getOrientation(p_77648_7_))) + { + return false; + } + else + { + if (p_77648_7_ == 1) + { + ++p_77648_5_; + } + + if (p_77648_7_ == 2) + { + --p_77648_6_; + } + + if (p_77648_7_ == 3) + { + ++p_77648_6_; + } + + if (p_77648_7_ == 4) + { + --p_77648_4_; + } + + if (p_77648_7_ == 5) + { + ++p_77648_4_; + } + + } + { + if (!p_77648_3_.isRemote) + { + if (!Blocks.skull.canPlaceBlockOnSide(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_)) return false; + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.skull, p_77648_7_, 2); + int i1 = 0; + + if (p_77648_7_ == 1) + { + i1 = MathHelper.floor_double((double)(p_77648_2_.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + + TileEntity tileentity = p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); + + if (tileentity != null && tileentity instanceof TileEntitySkull) + { + if (p_77648_1_.getItemDamage() == 3) + { + GameProfile gameprofile = null; + + if (p_77648_1_.hasTagCompound()) + { + NBTTagCompound nbttagcompound = p_77648_1_.getTagCompound(); + + if (nbttagcompound.hasKey("SkullOwner", 10)) + { + gameprofile = NBTUtil.func_152459_a(nbttagcompound.getCompoundTag("SkullOwner")); + } + else if (nbttagcompound.hasKey("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) + { + gameprofile = new GameProfile((UUID)null, nbttagcompound.getString("SkullOwner")); + } + } + + ((TileEntitySkull)tileentity).func_152106_a(gameprofile); + } + else + { + ((TileEntitySkull)tileentity).func_152107_a(p_77648_1_.getItemDamage()); + } + + ((TileEntitySkull)tileentity).func_145903_a(i1); + ((BlockSkull)Blocks.skull).func_149965_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, (TileEntitySkull)tileentity); + } + + --p_77648_1_.stackSize; + } + + return true; + } + } + + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + for (int i = 0; i < skullTypes.length; ++i) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); + } + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + int i = stack.getItemDamage(); + + if (i < 0 || i >= skullTypes.length) + { + i = 0; + } + + return super.getUnlocalizedName() + "." + skullTypes[i]; + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + if (p_77617_1_ < 0 || p_77617_1_ >= skullTypes.length) + { + p_77617_1_ = 0; + } + + return this.field_94586_c[p_77617_1_]; + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + if (p_77653_1_.getItemDamage() == 3 && p_77653_1_.hasTagCompound()) + { + if (p_77653_1_.getTagCompound().hasKey("SkullOwner", 10)) + { + return StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {NBTUtil.func_152459_a(p_77653_1_.getTagCompound().getCompoundTag("SkullOwner")).getName()}); + } + + if (p_77653_1_.getTagCompound().hasKey("SkullOwner", 8)) + { + return StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {p_77653_1_.getTagCompound().getString("SkullOwner")}); + } + } + + return super.getItemStackDisplayName(p_77653_1_); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister register) + { + this.field_94586_c = new IIcon[field_94587_a.length]; + + for (int i = 0; i < field_94587_a.length; ++i) + { + this.field_94586_c[i] = register.registerIcon(this.getIconString() + "_" + field_94587_a[i]); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSlab.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSlab.java new file mode 100644 index 0000000..6d2cb00 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSlab.java @@ -0,0 +1,201 @@ +package net.minecraft.item; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemSlab extends ItemBlock +{ + private final boolean field_150948_b; + private final BlockSlab field_150949_c; + private final BlockSlab field_150947_d; + private static final String __OBFID = "CL_00000071"; + + public ItemSlab(Block p_i45355_1_, BlockSlab p_i45355_2_, BlockSlab p_i45355_3_, boolean p_i45355_4_) + { + super(p_i45355_1_); + this.field_150949_c = p_i45355_2_; + this.field_150947_d = p_i45355_3_; + this.field_150948_b = p_i45355_4_; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** + * Gets an icon index based on an item's damage value + */ + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int p_77617_1_) + { + return Block.getBlockFromItem(this).getIcon(2, p_77617_1_); + } + + /** + * Returns the metadata of the block which this Item (ItemBlock) can place + */ + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + /** + * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have + * different names based on their damage or NBT. + */ + public String getUnlocalizedName(ItemStack stack) + { + return this.field_150949_c.func_150002_b(stack.getItemDamage()); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (this.field_150948_b) + { + return super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } + else if (p_77648_1_.stackSize == 0) + { + return false; + } + else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + int i1 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + int j1 = i1 & 7; + boolean flag = (i1 & 8) != 0; + + if ((p_77648_7_ == 1 && !flag || p_77648_7_ == 0 && flag) && block == this.field_150949_c && j1 == p_77648_1_.getItemDamage()) + { + if (p_77648_3_.checkNoEntityCollision(this.field_150947_d.getCollisionBoundingBoxFromPool(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) && p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150947_d, j1, 3)) + { + p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150947_d.stepSound.func_150496_b(), (this.field_150947_d.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150947_d.stepSound.getPitch() * 0.8F); + --p_77648_1_.stackSize; + } + + return true; + } + else + { + return this.func_150946_a(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_) ? true : super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } + } + } + + @SideOnly(Side.CLIENT) + public boolean func_150936_a(World p_150936_1_, int p_150936_2_, int p_150936_3_, int p_150936_4_, int p_150936_5_, EntityPlayer p_150936_6_, ItemStack p_150936_7_) + { + int i1 = p_150936_2_; + int j1 = p_150936_3_; + int k1 = p_150936_4_; + Block block = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + int l1 = p_150936_1_.getBlockMetadata(p_150936_2_, p_150936_3_, p_150936_4_); + int i2 = l1 & 7; + boolean flag = (l1 & 8) != 0; + + if ((p_150936_5_ == 1 && !flag || p_150936_5_ == 0 && flag) && block == this.field_150949_c && i2 == p_150936_7_.getItemDamage()) + { + return true; + } + else + { + if (p_150936_5_ == 0) + { + --p_150936_3_; + } + + if (p_150936_5_ == 1) + { + ++p_150936_3_; + } + + if (p_150936_5_ == 2) + { + --p_150936_4_; + } + + if (p_150936_5_ == 3) + { + ++p_150936_4_; + } + + if (p_150936_5_ == 4) + { + --p_150936_2_; + } + + if (p_150936_5_ == 5) + { + ++p_150936_2_; + } + + Block block1 = p_150936_1_.getBlock(p_150936_2_, p_150936_3_, p_150936_4_); + int j2 = p_150936_1_.getBlockMetadata(p_150936_2_, p_150936_3_, p_150936_4_); + i2 = j2 & 7; + return block1 == this.field_150949_c && i2 == p_150936_7_.getItemDamage() ? true : super.func_150936_a(p_150936_1_, i1, j1, k1, p_150936_5_, p_150936_6_, p_150936_7_); + } + } + + private boolean func_150946_a(ItemStack p_150946_1_, EntityPlayer p_150946_2_, World p_150946_3_, int p_150946_4_, int p_150946_5_, int p_150946_6_, int p_150946_7_) + { + if (p_150946_7_ == 0) + { + --p_150946_5_; + } + + if (p_150946_7_ == 1) + { + ++p_150946_5_; + } + + if (p_150946_7_ == 2) + { + --p_150946_6_; + } + + if (p_150946_7_ == 3) + { + ++p_150946_6_; + } + + if (p_150946_7_ == 4) + { + --p_150946_4_; + } + + if (p_150946_7_ == 5) + { + ++p_150946_4_; + } + + Block block = p_150946_3_.getBlock(p_150946_4_, p_150946_5_, p_150946_6_); + int i1 = p_150946_3_.getBlockMetadata(p_150946_4_, p_150946_5_, p_150946_6_); + int j1 = i1 & 7; + + if (block == this.field_150949_c && j1 == p_150946_1_.getItemDamage()) + { + if (p_150946_3_.checkNoEntityCollision(this.field_150947_d.getCollisionBoundingBoxFromPool(p_150946_3_, p_150946_4_, p_150946_5_, p_150946_6_)) && p_150946_3_.setBlock(p_150946_4_, p_150946_5_, p_150946_6_, this.field_150947_d, j1, 3)) + { + p_150946_3_.playSoundEffect((double)((float)p_150946_4_ + 0.5F), (double)((float)p_150946_5_ + 0.5F), (double)((float)p_150946_6_ + 0.5F), this.field_150947_d.stepSound.func_150496_b(), (this.field_150947_d.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150947_d.stepSound.getPitch() * 0.8F); + --p_150946_1_.stackSize; + } + + return true; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnow.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnow.java new file mode 100644 index 0000000..7924915 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnow.java @@ -0,0 +1,51 @@ +package net.minecraft.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemSnow extends ItemBlockWithMetadata +{ + private static final String __OBFID = "CL_00000068"; + + public ItemSnow(Block p_i45354_1_, Block p_i45354_2_) + { + super(p_i45354_1_, p_i45354_2_); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS + */ + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_1_.stackSize == 0) + { + return false; + } + else if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block == Blocks.snow_layer) + { + int i1 = p_77648_3_.getBlockMetadata(p_77648_4_, p_77648_5_, p_77648_6_); + int j1 = i1 & 7; + + if (j1 <= 6 && p_77648_3_.checkNoEntityCollision(this.field_150939_a.getCollisionBoundingBoxFromPool(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) && p_77648_3_.setBlockMetadataWithNotify(p_77648_4_, p_77648_5_, p_77648_6_, j1 + 1 | i1 & -8, 2)) + { + p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150939_a.stepSound.func_150496_b(), (this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F, this.field_150939_a.stepSound.getPitch() * 0.8F); + --p_77648_1_.stackSize; + return true; + } + } + + return super.onItemUse(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnowball.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnowball.java new file mode 100644 index 0000000..27f4126 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSnowball.java @@ -0,0 +1,37 @@ +package net.minecraft.item; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntitySnowball; +import net.minecraft.world.World; + +public class ItemSnowball extends Item +{ + private static final String __OBFID = "CL_00000069"; + + public ItemSnowball() + { + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + if (!player.capabilities.isCreativeMode) + { + --itemStackIn.stackSize; + } + + worldIn.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!worldIn.isRemote) + { + worldIn.spawnEntityInWorld(new EntitySnowball(worldIn, player)); + } + + return itemStackIn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSoup.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSoup.java new file mode 100644 index 0000000..96e677a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSoup.java @@ -0,0 +1,22 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.world.World; + +public class ItemSoup extends ItemFood +{ + private static final String __OBFID = "CL_00001778"; + + public ItemSoup(int p_i45330_1_) + { + super(p_i45330_1_, false); + this.setMaxStackSize(1); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + super.onEaten(p_77654_1_, p_77654_2_, p_77654_3_); + return new ItemStack(Items.bowl); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSpade.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSpade.java new file mode 100644 index 0000000..20e106b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSpade.java @@ -0,0 +1,22 @@ +package net.minecraft.item; + +import com.google.common.collect.Sets; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + +public class ItemSpade extends ItemTool +{ + private static final Set field_150916_c = Sets.newHashSet(new Block[] {Blocks.grass, Blocks.dirt, Blocks.sand, Blocks.gravel, Blocks.snow_layer, Blocks.snow, Blocks.clay, Blocks.farmland, Blocks.soul_sand, Blocks.mycelium}); + private static final String __OBFID = "CL_00000063"; + + public ItemSpade(Item.ToolMaterial p_i45353_1_) + { + super(1.0F, p_i45353_1_, field_150916_c); + } + + public boolean func_150897_b(Block p_150897_1_) + { + return p_150897_1_ == Blocks.snow_layer ? true : p_150897_1_ == Blocks.snow; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemStack.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemStack.java new file mode 100644 index 0000000..3be61db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemStack.java @@ -0,0 +1,900 @@ +package net.minecraft.item; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentDurability; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.HoverEvent; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.event.ForgeEventFactory; + +public final class ItemStack +{ + public static final DecimalFormat field_111284_a = new DecimalFormat("#.###"); + /** Size of the stack. */ + public int stackSize; + /** Number of animation frames to go when receiving an item (by walking into it, for example). */ + public int animationsToGo; + private Item field_151002_e; + /** A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items */ + public NBTTagCompound stackTagCompound; + /** Damage dealt to the item or number of use. Raise when using items. */ + int itemDamage; + /** Item frame this stack is on, or null if not on an item frame. */ + private EntityItemFrame itemFrame; + private static final String __OBFID = "CL_00000043"; + + private cpw.mods.fml.common.registry.RegistryDelegate delegate; + public ItemStack(Block p_i1876_1_) + { + this(p_i1876_1_, 1); + } + + public ItemStack(Block p_i1877_1_, int p_i1877_2_) + { + this(p_i1877_1_, p_i1877_2_, 0); + } + + public ItemStack(Block p_i1878_1_, int p_i1878_2_, int p_i1878_3_) + { + this(Item.getItemFromBlock(p_i1878_1_), p_i1878_2_, p_i1878_3_); + } + + public ItemStack(Item p_i1879_1_) + { + this(p_i1879_1_, 1); + } + + public ItemStack(Item p_i1880_1_, int p_i1880_2_) + { + this(p_i1880_1_, p_i1880_2_, 0); + } + + public ItemStack(Item p_i1881_1_, int p_i1881_2_, int p_i1881_3_) + { + func_150996_a(p_i1881_1_); + this.stackSize = p_i1881_2_; + this.itemDamage = p_i1881_3_; + + if (this.itemDamage < 0) + { + this.itemDamage = 0; + } + } + + public static ItemStack loadItemStackFromNBT(NBTTagCompound p_77949_0_) + { + ItemStack itemstack = new ItemStack(); + itemstack.readFromNBT(p_77949_0_); + return itemstack.getItem() != null ? itemstack : null; + } + + private ItemStack() {} + + /** + * Remove the argument from the stack size. Return a new stack object with argument size. + */ + public ItemStack splitStack(int p_77979_1_) + { + ItemStack itemstack = new ItemStack(this.field_151002_e, p_77979_1_, this.itemDamage); + + if (this.stackTagCompound != null) + { + itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + + this.stackSize -= p_77979_1_; + return itemstack; + } + + /** + * Returns the object corresponding to the stack. + */ + public Item getItem() + { + return this.delegate != null ? this.delegate.get() : null; + } + + /** + * Returns the icon index of the current stack. + */ + @SideOnly(Side.CLIENT) + public IIcon getIconIndex() + { + return this.getItem().getIconIndex(this); + } + + @SideOnly(Side.CLIENT) + public int getItemSpriteNumber() + { + return this.getItem().getSpriteNumber(); + } + + public boolean tryPlaceItemIntoWorld(EntityPlayer p_77943_1_, World p_77943_2_, int p_77943_3_, int p_77943_4_, int p_77943_5_, int p_77943_6_, float p_77943_7_, float p_77943_8_, float p_77943_9_) + { + if (!p_77943_2_.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_77943_1_, p_77943_2_, p_77943_3_, p_77943_4_, p_77943_5_, p_77943_6_, p_77943_7_, p_77943_8_, p_77943_9_); + boolean flag = this.getItem().onItemUse(this, p_77943_1_, p_77943_2_, p_77943_3_, p_77943_4_, p_77943_5_, p_77943_6_, p_77943_7_, p_77943_8_, p_77943_9_); + + if (flag) + { + p_77943_1_.addStat(StatList.objectUseStats[Item.getIdFromItem(this.field_151002_e)], 1); + } + + return flag; + } + + public float func_150997_a(Block p_150997_1_) + { + return this.getItem().func_150893_a(this, p_150997_1_); + } + + /** + * Called whenever this item stack is equipped and right clicked. Returns the new item stack to put in the position + * where this item is. Args: world, player + */ + public ItemStack useItemRightClick(World p_77957_1_, EntityPlayer p_77957_2_) + { + return this.getItem().onItemRightClick(this, p_77957_1_, p_77957_2_); + } + + public ItemStack onFoodEaten(World p_77950_1_, EntityPlayer p_77950_2_) + { + return this.getItem().onEaten(this, p_77950_1_, p_77950_2_); + } + + /** + * Write the stack fields to a NBT object. Return the new NBT object. + */ + public NBTTagCompound writeToNBT(NBTTagCompound p_77955_1_) + { + p_77955_1_.setShort("id", (short)Item.getIdFromItem(this.field_151002_e)); + p_77955_1_.setByte("Count", (byte)this.stackSize); + p_77955_1_.setShort("Damage", (short)this.itemDamage); + + if (this.stackTagCompound != null) + { + p_77955_1_.setTag("tag", this.stackTagCompound); + } + + return p_77955_1_; + } + + /** + * Read the stack fields from a NBT object. + */ + public void readFromNBT(NBTTagCompound p_77963_1_) + { + func_150996_a(Item.getItemById(p_77963_1_.getShort("id"))); + this.stackSize = p_77963_1_.getByte("Count"); + this.itemDamage = p_77963_1_.getShort("Damage"); + + if (this.itemDamage < 0) + { + this.itemDamage = 0; + } + + if (p_77963_1_.hasKey("tag", 10)) + { + this.stackTagCompound = p_77963_1_.getCompoundTag("tag"); + } + } + + /** + * Returns maximum size of the stack. + */ + public int getMaxStackSize() + { + return this.getItem().getItemStackLimit(this); + } + + /** + * Returns true if the ItemStack can hold 2 or more units of the item. + */ + public boolean isStackable() + { + return this.getMaxStackSize() > 1 && (!this.isItemStackDamageable() || !this.isItemDamaged()); + } + + /** + * true if this itemStack is damageable + */ + public boolean isItemStackDamageable() + { + return this.field_151002_e.getMaxDamage(this) <= 0 ? false : !this.hasTagCompound() || !this.getTagCompound().getBoolean("Unbreakable"); + } + + public boolean getHasSubtypes() + { + return this.field_151002_e.getHasSubtypes(); + } + + /** + * returns true when a damageable item is damaged + */ + public boolean isItemDamaged() + { + return this.isItemStackDamageable() && getItem().isDamaged(this); + } + + /** + * gets the damage of an itemstack, for displaying purposes + */ + public int getItemDamageForDisplay() + { + return getItem().getDisplayDamage(this); + } + + /** + * gets the damage of an itemstack + */ + public int getItemDamage() + { + return getItem().getDamage(this); + } + + /** + * Sets the item damage of the ItemStack. + */ + public void setItemDamage(int p_77964_1_) + { + getItem().setDamage(this, p_77964_1_); + } + + /** + * Returns the max damage an item in the stack can take. + */ + public int getMaxDamage() + { + return getItem().getMaxDamage(this); + } + + /** + * Attempts to damage the ItemStack with par1 amount of damage, If the ItemStack has the Unbreaking enchantment + * there is a chance for each point of damage to be negated. Returns true if it takes more damage than + * getMaxDamage(). Returns false otherwise or if the ItemStack can't be damaged or if all points of damage are + * negated. + */ + public boolean attemptDamageItem(int p_96631_1_, Random p_96631_2_) + { + if (!this.isItemStackDamageable()) + { + return false; + } + else + { + if (p_96631_1_ > 0) + { + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); + int k = 0; + + for (int l = 0; j > 0 && l < p_96631_1_; ++l) + { + if (EnchantmentDurability.negateDamage(this, j, p_96631_2_)) + { + ++k; + } + } + + p_96631_1_ -= k; + + if (p_96631_1_ <= 0) + { + return false; + } + } + + setItemDamage(getItemDamage() + p_96631_1_); //Redirect through Item's callback if applicable. + return getItemDamage() > getMaxDamage(); + } + } + + /** + * Damages the item in the ItemStack + */ + public void damageItem(int p_77972_1_, EntityLivingBase p_77972_2_) + { + if (!(p_77972_2_ instanceof EntityPlayer) || !((EntityPlayer)p_77972_2_).capabilities.isCreativeMode) + { + if (this.isItemStackDamageable()) + { + if (this.attemptDamageItem(p_77972_1_, p_77972_2_.getRNG())) + { + p_77972_2_.renderBrokenItemStack(this); + --this.stackSize; + + if (p_77972_2_ instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_77972_2_; + entityplayer.addStat(StatList.objectBreakStats[Item.getIdFromItem(this.field_151002_e)], 1); + + if (this.stackSize == 0 && this.getItem() instanceof ItemBow) + { + entityplayer.destroyCurrentEquippedItem(); + } + } + + if (this.stackSize < 0) + { + this.stackSize = 0; + } + + this.itemDamage = 0; + } + } + } + } + + /** + * Calls the corresponding fct in di + */ + public void hitEntity(EntityLivingBase p_77961_1_, EntityPlayer p_77961_2_) + { + boolean flag = this.field_151002_e.hitEntity(this, p_77961_1_, p_77961_2_); + + if (flag) + { + p_77961_2_.addStat(StatList.objectUseStats[Item.getIdFromItem(this.field_151002_e)], 1); + } + } + + public void func_150999_a(World p_150999_1_, Block p_150999_2_, int p_150999_3_, int p_150999_4_, int p_150999_5_, EntityPlayer p_150999_6_) + { + boolean flag = this.field_151002_e.onBlockDestroyed(this, p_150999_1_, p_150999_2_, p_150999_3_, p_150999_4_, p_150999_5_, p_150999_6_); + + if (flag) + { + p_150999_6_.addStat(StatList.objectUseStats[Item.getIdFromItem(this.field_151002_e)], 1); + } + } + + public boolean func_150998_b(Block p_150998_1_) + { + return getItem().canHarvestBlock(p_150998_1_, this); + } + + public boolean interactWithEntity(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_) + { + return this.field_151002_e.itemInteractionForEntity(this, p_111282_1_, p_111282_2_); + } + + /** + * Returns a new stack with the same properties. + */ + public ItemStack copy() + { + ItemStack itemstack = new ItemStack(this.field_151002_e, this.stackSize, this.itemDamage); + + if (this.stackTagCompound != null) + { + itemstack.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + + return itemstack; + } + + public static boolean areItemStackTagsEqual(ItemStack p_77970_0_, ItemStack p_77970_1_) + { + return p_77970_0_ == null && p_77970_1_ == null ? true : (p_77970_0_ != null && p_77970_1_ != null ? (p_77970_0_.stackTagCompound == null && p_77970_1_.stackTagCompound != null ? false : p_77970_0_.stackTagCompound == null || p_77970_0_.stackTagCompound.equals(p_77970_1_.stackTagCompound)) : false); + } + + /** + * compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal + */ + public static boolean areItemStacksEqual(ItemStack p_77989_0_, ItemStack p_77989_1_) + { + return p_77989_0_ == null && p_77989_1_ == null ? true : (p_77989_0_ != null && p_77989_1_ != null ? p_77989_0_.isItemStackEqual(p_77989_1_) : false); + } + + /** + * compares ItemStack argument to the instance ItemStack; returns true if both ItemStacks are equal + */ + private boolean isItemStackEqual(ItemStack p_77959_1_) + { + return this.stackSize != p_77959_1_.stackSize ? false : (this.field_151002_e != p_77959_1_.field_151002_e ? false : (this.itemDamage != p_77959_1_.itemDamage ? false : (this.stackTagCompound == null && p_77959_1_.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(p_77959_1_.stackTagCompound)))); + } + + /** + * compares ItemStack argument to the instance ItemStack; returns true if the Items contained in both ItemStacks are + * equal + */ + public boolean isItemEqual(ItemStack p_77969_1_) + { + return this.field_151002_e == p_77969_1_.field_151002_e && this.itemDamage == p_77969_1_.itemDamage; + } + + public String getUnlocalizedName() + { + return this.field_151002_e.getUnlocalizedName(this); + } + + /** + * Creates a copy of a ItemStack, a null parameters will return a null. + */ + public static ItemStack copyItemStack(ItemStack p_77944_0_) + { + return p_77944_0_ == null ? null : p_77944_0_.copy(); + } + + public String toString() + { + return this.stackSize + "x" + this.field_151002_e.getUnlocalizedName() + "@" + this.itemDamage; + } + + /** + * Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update + * maps. + */ + public void updateAnimation(World p_77945_1_, Entity p_77945_2_, int p_77945_3_, boolean p_77945_4_) + { + if (this.animationsToGo > 0) + { + --this.animationsToGo; + } + + this.field_151002_e.onUpdate(this, p_77945_1_, p_77945_2_, p_77945_3_, p_77945_4_); + } + + public void onCrafting(World p_77980_1_, EntityPlayer p_77980_2_, int p_77980_3_) + { + p_77980_2_.addStat(StatList.objectCraftStats[Item.getIdFromItem(this.field_151002_e)], p_77980_3_); + this.field_151002_e.onCreated(this, p_77980_1_, p_77980_2_); + } + + public int getMaxItemUseDuration() + { + return this.getItem().getMaxItemUseDuration(this); + } + + public EnumAction getItemUseAction() + { + return this.getItem().getItemUseAction(this); + } + + /** + * Called when the player releases the use item button. Args: world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(World p_77974_1_, EntityPlayer p_77974_2_, int p_77974_3_) + { + this.getItem().onPlayerStoppedUsing(this, p_77974_1_, p_77974_2_, p_77974_3_); + } + + /** + * Returns true if the ItemStack has an NBTTagCompound. Currently used to store enchantments. + */ + public boolean hasTagCompound() + { + return this.stackTagCompound != null; + } + + /** + * Returns the NBTTagCompound of the ItemStack. + */ + public NBTTagCompound getTagCompound() + { + return this.stackTagCompound; + } + + public NBTTagList getEnchantmentTagList() + { + return this.stackTagCompound == null ? null : this.stackTagCompound.getTagList("ench", 10); + } + + /** + * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it. + */ + public void setTagCompound(NBTTagCompound p_77982_1_) + { + this.stackTagCompound = p_77982_1_; + } + + /** + * returns the display name of the itemstack + */ + public String getDisplayName() + { + String s = this.getItem().getItemStackDisplayName(this); + + if (this.stackTagCompound != null && this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + + if (nbttagcompound.hasKey("Name", 8)) + { + s = nbttagcompound.getString("Name"); + } + } + + return s; + } + + public ItemStack setStackDisplayName(String p_151001_1_) + { + if (this.stackTagCompound == null) + { + this.stackTagCompound = new NBTTagCompound(); + } + + if (!this.stackTagCompound.hasKey("display", 10)) + { + this.stackTagCompound.setTag("display", new NBTTagCompound()); + } + + this.stackTagCompound.getCompoundTag("display").setString("Name", p_151001_1_); + return this; + } + + public void func_135074_t() + { + if (this.stackTagCompound != null) + { + if (this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + nbttagcompound.removeTag("Name"); + + if (nbttagcompound.hasNoTags()) + { + this.stackTagCompound.removeTag("display"); + + if (this.stackTagCompound.hasNoTags()) + { + this.setTagCompound((NBTTagCompound)null); + } + } + } + } + } + + /** + * Returns true if the itemstack has a display name + */ + public boolean hasDisplayName() + { + return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display", 10) ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name", 8)); + } + + /** + * Return a list of strings containing information about the item + */ + @SideOnly(Side.CLIENT) + public List getTooltip(EntityPlayer p_82840_1_, boolean p_82840_2_) + { + ArrayList arraylist = new ArrayList(); + String s = this.getDisplayName(); + + if (this.hasDisplayName()) + { + s = EnumChatFormatting.ITALIC + s + EnumChatFormatting.RESET; + } + + int i; + + if (p_82840_2_) + { + String s1 = ""; + + if (s.length() > 0) + { + s = s + " ("; + s1 = ")"; + } + + i = Item.getIdFromItem(this.field_151002_e); + + if (this.getHasSubtypes()) + { + s = s + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(i), Integer.valueOf(this.itemDamage), s1}); + } + else + { + s = s + String.format("#%04d%s", new Object[] {Integer.valueOf(i), s1}); + } + } + else if (!this.hasDisplayName() && this.field_151002_e == Items.filled_map) + { + s = s + " #" + this.itemDamage; + } + + arraylist.add(s); + this.field_151002_e.addInformation(this, p_82840_1_, arraylist, p_82840_2_); + + if (this.hasTagCompound()) + { + NBTTagList nbttaglist = this.getEnchantmentTagList(); + + if (nbttaglist != null) + { + for (i = 0; i < nbttaglist.tagCount(); ++i) + { + short short1 = nbttaglist.getCompoundTagAt(i).getShort("id"); + short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl"); + + if (Enchantment.enchantmentsList[short1] != null) + { + arraylist.add(Enchantment.enchantmentsList[short1].getTranslatedName(short2)); + } + } + } + + if (this.stackTagCompound.hasKey("display", 10)) + { + NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display"); + + if (nbttagcompound.hasKey("color", 3)) + { + if (p_82840_2_) + { + arraylist.add("Color: #" + Integer.toHexString(nbttagcompound.getInteger("color")).toUpperCase()); + } + else + { + arraylist.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); + } + } + + if (nbttagcompound.func_150299_b("Lore") == 9) + { + NBTTagList nbttaglist1 = nbttagcompound.getTagList("Lore", 8); + + if (nbttaglist1.tagCount() > 0) + { + for (int j = 0; j < nbttaglist1.tagCount(); ++j) + { + arraylist.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + nbttaglist1.getStringTagAt(j)); + } + } + } + } + } + + Multimap multimap = this.getAttributeModifiers(); + + if (!multimap.isEmpty()) + { + arraylist.add(""); + Iterator iterator = multimap.entries().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + double d0 = attributemodifier.getAmount(); + + if (attributemodifier.getID() == Item.field_111210_e) + { + d0 += (double)EnchantmentHelper.func_152377_a(this, EnumCreatureAttribute.UNDEFINED); + } + + double d1; + + if (attributemodifier.getOperation() != 1 && attributemodifier.getOperation() != 2) + { + d1 = d0; + } + else + { + d1 = d0 * 100.0D; + } + + if (d0 > 0.0D) + { + arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + attributemodifier.getOperation(), new Object[] {field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry.getKey())})); + } + else if (d0 < 0.0D) + { + d1 *= -1.0D; + arraylist.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + attributemodifier.getOperation(), new Object[] {field_111284_a.format(d1), StatCollector.translateToLocal("attribute.name." + (String)entry.getKey())})); + } + } + } + + if (this.hasTagCompound() && this.getTagCompound().getBoolean("Unbreakable")) + { + arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("item.unbreakable")); + } + + if (p_82840_2_ && this.isItemDamaged()) + { + arraylist.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); + } + ForgeEventFactory.onItemTooltip(this, p_82840_1_, arraylist, p_82840_2_); + + return arraylist; + } + + @Deprecated + @SideOnly(Side.CLIENT) + public boolean hasEffect() + { + return hasEffect(0); + } + + @SideOnly(Side.CLIENT) + public boolean hasEffect(int pass) + { + return this.getItem().hasEffect(this, pass); + } + + public EnumRarity getRarity() + { + return this.getItem().getRarity(this); + } + + /** + * True if it is a tool and has no enchantments to begin with + */ + public boolean isItemEnchantable() + { + return !this.getItem().isItemTool(this) ? false : !this.isItemEnchanted(); + } + + /** + * Adds an enchantment with a desired level on the ItemStack. + */ + public void addEnchantment(Enchantment p_77966_1_, int p_77966_2_) + { + if (this.stackTagCompound == null) + { + this.setTagCompound(new NBTTagCompound()); + } + + if (!this.stackTagCompound.hasKey("ench", 9)) + { + this.stackTagCompound.setTag("ench", new NBTTagList()); + } + + NBTTagList nbttaglist = this.stackTagCompound.getTagList("ench", 10); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setShort("id", (short)p_77966_1_.effectId); + nbttagcompound.setShort("lvl", (short)((byte)p_77966_2_)); + nbttaglist.appendTag(nbttagcompound); + } + + /** + * True if the item has enchantment data + */ + public boolean isItemEnchanted() + { + return this.stackTagCompound != null && this.stackTagCompound.hasKey("ench", 9); + } + + public void setTagInfo(String p_77983_1_, NBTBase p_77983_2_) + { + if (this.stackTagCompound == null) + { + this.setTagCompound(new NBTTagCompound()); + } + + this.stackTagCompound.setTag(p_77983_1_, p_77983_2_); + } + + public boolean canEditBlocks() + { + return this.getItem().canItemEditBlocks(); + } + + /** + * Return whether this stack is on an item frame. + */ + public boolean isOnItemFrame() + { + return this.itemFrame != null; + } + + /** + * Set the item frame this stack is on. + */ + public void setItemFrame(EntityItemFrame p_82842_1_) + { + this.itemFrame = p_82842_1_; + } + + /** + * Return the item frame this stack is on. Returns null if not on an item frame. + */ + public EntityItemFrame getItemFrame() + { + return this.itemFrame; + } + + /** + * Get this stack's repair cost, or 0 if no repair cost is defined. + */ + public int getRepairCost() + { + return this.hasTagCompound() && this.stackTagCompound.hasKey("RepairCost", 3) ? this.stackTagCompound.getInteger("RepairCost") : 0; + } + + /** + * Set this stack's repair cost. + */ + public void setRepairCost(int p_82841_1_) + { + if (!this.hasTagCompound()) + { + this.stackTagCompound = new NBTTagCompound(); + } + + this.stackTagCompound.setInteger("RepairCost", p_82841_1_); + } + + /** + * Gets the attribute modifiers for this ItemStack. + * Will check for an NBT tag list containing modifiers for the stack. + */ + public Multimap getAttributeModifiers() + { + Object object; + + if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers", 9)) + { + object = HashMultimap.create(); + NBTTagList nbttaglist = this.stackTagCompound.getTagList("AttributeModifiers", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + AttributeModifier attributemodifier = SharedMonsterAttributes.readAttributeModifierFromNBT(nbttagcompound); + + if (attributemodifier.getID().getLeastSignificantBits() != 0L && attributemodifier.getID().getMostSignificantBits() != 0L) + { + ((Multimap)object).put(nbttagcompound.getString("AttributeName"), attributemodifier); + } + } + } + else + { + object = this.getItem().getAttributeModifiers(this); + } + + return (Multimap)object; + } + + public void func_150996_a(Item p_150996_1_) + { + this.delegate = p_150996_1_ != null ? p_150996_1_.delegate : null; + this.field_151002_e = p_150996_1_; + } + + public IChatComponent func_151000_E() + { + IChatComponent ichatcomponent = (new ChatComponentText("[")).appendText(this.getDisplayName()).appendText("]"); + + if (this.field_151002_e != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString()))); + ichatcomponent.getChatStyle().setColor(this.getRarity().rarityColor); + } + + return ichatcomponent; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemSword.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSword.java new file mode 100644 index 0000000..7e5d447 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemSword.java @@ -0,0 +1,143 @@ +package net.minecraft.item; + +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class ItemSword extends Item +{ + private float field_150934_a; + private final Item.ToolMaterial field_150933_b; + private static final String __OBFID = "CL_00000072"; + + public ItemSword(Item.ToolMaterial p_i45356_1_) + { + this.field_150933_b = p_i45356_1_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45356_1_.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabCombat); + this.field_150934_a = 4.0F + p_i45356_1_.getDamageVsEntity(); + } + + public float func_150931_i() + { + return this.field_150933_b.getDamageVsEntity(); + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + if (p_150893_2_ == Blocks.web) + { + return 15.0F; + } + else + { + Material material = p_150893_2_.getMaterial(); + return material != Material.plants && material != Material.vine && material != Material.coral && material != Material.leaves && material != Material.gourd ? 1.0F : 1.5F; + } + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { + stack.damageItem(1, p_77644_3_); + return true; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { + if ((double)blockIn.getBlockHardness(worldIn, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) + { + stack.damageItem(2, p_150894_7_); + } + + return true; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) + { + return EnumAction.block; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 72000; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + player.setItemInUse(itemStackIn, this.getMaxItemUseDuration(itemStackIn)); + return itemStackIn; + } + + public boolean func_150897_b(Block p_150897_1_) + { + return p_150897_1_ == Blocks.web; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return this.field_150933_b.getEnchantability(); + } + + /** + * Return the name for this tool's material. + */ + public String getToolMaterialName() + { + return this.field_150933_b.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) + { + ItemStack mat = this.field_150933_b.getRepairItemStack(); + if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; + return super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.field_150934_a, 0)); + return multimap; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemTool.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemTool.java new file mode 100644 index 0000000..99e853c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemTool.java @@ -0,0 +1,156 @@ +package net.minecraft.item; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Multimap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; + +public class ItemTool extends Item +{ + private Set field_150914_c; + protected float efficiencyOnProperMaterial = 4.0F; + /** Damage versus entities. */ + private float damageVsEntity; + /** The material this tool is made from. */ + protected Item.ToolMaterial toolMaterial; + private static final String __OBFID = "CL_00000019"; + + protected ItemTool(float p_i45333_1_, Item.ToolMaterial p_i45333_2_, Set p_i45333_3_) + { + this.toolMaterial = p_i45333_2_; + this.field_150914_c = p_i45333_3_; + this.maxStackSize = 1; + this.setMaxDamage(p_i45333_2_.getMaxUses()); + this.efficiencyOnProperMaterial = p_i45333_2_.getEfficiencyOnProperMaterial(); + this.damageVsEntity = p_i45333_1_ + p_i45333_2_.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + if (this instanceof ItemPickaxe) + { + toolClass = "pickaxe"; + } + else if (this instanceof ItemAxe) + { + toolClass = "axe"; + } + else if (this instanceof ItemSpade) + { + toolClass = "shovel"; + } + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return this.field_150914_c.contains(p_150893_2_) ? this.efficiencyOnProperMaterial : 1.0F; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { + stack.damageItem(2, p_77644_3_); + return true; + } + + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { + if ((double)blockIn.getBlockHardness(worldIn, p_150894_4_, p_150894_5_, p_150894_6_) != 0.0D) + { + stack.damageItem(1, p_150894_7_); + } + + return true; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + public Item.ToolMaterial func_150913_i() + { + return this.toolMaterial; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return this.toolMaterial.getEnchantability(); + } + + /** + * Return the name for this tool's material. + */ + public String getToolMaterialName() + { + return this.toolMaterial.toString(); + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) + { + ItemStack mat = this.toolMaterial.getRepairItemStack(); + if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; + return super.getIsRepairable(p_82789_1_, p_82789_2_); + } + + /** + * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. + */ + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0)); + return multimap; + } + + /*===================================== FORGE START =================================*/ + private String toolClass; + @Override + public int getHarvestLevel(ItemStack stack, String toolClass) + { + int level = super.getHarvestLevel(stack, toolClass); + if (level == -1 && toolClass != null && toolClass.equals(this.toolClass)) + { + return this.toolMaterial.getHarvestLevel(); + } + else + { + return level; + } + } + + @Override + public Set getToolClasses(ItemStack stack) + { + return toolClass != null ? ImmutableSet.of(toolClass) : super.getToolClasses(stack); + } + + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) + { + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return efficiencyOnProperMaterial; + } + return super.getDigSpeed(stack, block, meta); + } + /*===================================== FORGE END =================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/ItemWritableBook.java b/build/rfg/minecraft-src/java/net/minecraft/item/ItemWritableBook.java new file mode 100644 index 0000000..a489113 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/ItemWritableBook.java @@ -0,0 +1,66 @@ +package net.minecraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class ItemWritableBook extends Item +{ + private static final String __OBFID = "CL_00000076"; + + public ItemWritableBook() + { + this.setMaxStackSize(1); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player) + { + player.displayGUIBook(itemStackIn); + return itemStackIn; + } + + /** + * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. + */ + public boolean getShareTag() + { + return true; + } + + public static boolean func_150930_a(NBTTagCompound p_150930_0_) + { + if (p_150930_0_ == null) + { + return false; + } + else if (!p_150930_0_.hasKey("pages", 9)) + { + return false; + } + else + { + NBTTagList nbttaglist = p_150930_0_.getTagList("pages", 8); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + String s = nbttaglist.getStringTagAt(i); + + if (s == null) + { + return false; + } + + if (s.length() > 256) + { + return false; + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/CraftingManager.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/CraftingManager.java new file mode 100644 index 0000000..025545f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/CraftingManager.java @@ -0,0 +1,345 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class CraftingManager +{ + /** The static instance of this class */ + private static final CraftingManager instance = new CraftingManager(); + /** A list of all the recipes added */ + private List recipes = new ArrayList(); + private static final String __OBFID = "CL_00000090"; + + /** + * Returns the static instance of this class + */ + public static final CraftingManager getInstance() + { + return instance; + } + + private CraftingManager() + { + (new RecipesTools()).addRecipes(this); + (new RecipesWeapons()).addRecipes(this); + (new RecipesIngots()).addRecipes(this); + (new RecipesFood()).addRecipes(this); + (new RecipesCrafting()).addRecipes(this); + (new RecipesArmor()).addRecipes(this); + (new RecipesDyes()).addRecipes(this); + this.recipes.add(new RecipesArmorDyes()); + this.recipes.add(new RecipeBookCloning()); + this.recipes.add(new RecipesMapCloning()); + this.recipes.add(new RecipesMapExtending()); + this.recipes.add(new RecipeFireworks()); + this.addRecipe(new ItemStack(Items.paper, 3), new Object[] {"###", '#', Items.reeds}); + this.addShapelessRecipe(new ItemStack(Items.book, 1), new Object[] {Items.paper, Items.paper, Items.paper, Items.leather}); + this.addShapelessRecipe(new ItemStack(Items.writable_book, 1), new Object[] {Items.book, new ItemStack(Items.dye, 1, 0), Items.feather}); + this.addRecipe(new ItemStack(Blocks.fence, 2), new Object[] {"###", "###", '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, 0), new Object[] {"###", "###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.cobblestone_wall, 6, 1), new Object[] {"###", "###", '#', Blocks.mossy_cobblestone}); + this.addRecipe(new ItemStack(Blocks.nether_brick_fence, 6), new Object[] {"###", "###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.fence_gate, 1), new Object[] {"#W#", "#W#", '#', Items.stick, 'W', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Blocks.planks, 'X', Items.diamond}); + this.addRecipe(new ItemStack(Items.lead, 2), new Object[] {"~~ ", "~O ", " ~", '~', Items.string, 'O', Items.slime_ball}); + this.addRecipe(new ItemStack(Blocks.noteblock, 1), new Object[] {"###", "#X#", "###", '#', Blocks.planks, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.bookshelf, 1), new Object[] {"###", "XXX", "###", '#', Blocks.planks, 'X', Items.book}); + this.addRecipe(new ItemStack(Blocks.snow, 1), new Object[] {"##", "##", '#', Items.snowball}); + this.addRecipe(new ItemStack(Blocks.snow_layer, 6), new Object[] {"###", '#', Blocks.snow}); + this.addRecipe(new ItemStack(Blocks.clay, 1), new Object[] {"##", "##", '#', Items.clay_ball}); + this.addRecipe(new ItemStack(Blocks.brick_block, 1), new Object[] {"##", "##", '#', Items.brick}); + this.addRecipe(new ItemStack(Blocks.glowstone, 1), new Object[] {"##", "##", '#', Items.glowstone_dust}); + this.addRecipe(new ItemStack(Blocks.quartz_block, 1), new Object[] {"##", "##", '#', Items.quartz}); + this.addRecipe(new ItemStack(Blocks.wool, 1), new Object[] {"##", "##", '#', Items.string}); + this.addRecipe(new ItemStack(Blocks.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Blocks.sand}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 3), new Object[] {"###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 0), new Object[] {"###", '#', Blocks.stone}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 1), new Object[] {"###", '#', Blocks.sandstone}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 4), new Object[] {"###", '#', Blocks.brick_block}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 5), new Object[] {"###", '#', Blocks.stonebrick}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 6), new Object[] {"###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.stone_slab, 6, 7), new Object[] {"###", '#', Blocks.quartz_block}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 0), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 0)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 2), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 2)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 1), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 1)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 3), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 3)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 4), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 4)}); + this.addRecipe(new ItemStack(Blocks.wooden_slab, 6, 5), new Object[] {"###", '#', new ItemStack(Blocks.planks, 1, 5)}); + this.addRecipe(new ItemStack(Blocks.ladder, 3), new Object[] {"# #", "###", "# #", '#', Items.stick}); + this.addRecipe(new ItemStack(Items.wooden_door, 1), new Object[] {"##", "##", "##", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.trapdoor, 2), new Object[] {"###", "###", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.iron_door, 1), new Object[] {"##", "##", "##", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.sign, 3), new Object[] {"###", "###", " X ", '#', Blocks.planks, 'X', Items.stick}); + this.addRecipe(new ItemStack(Items.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Items.milk_bucket, 'B', Items.sugar, 'C', Items.wheat, 'E', Items.egg}); + this.addRecipe(new ItemStack(Items.sugar, 1), new Object[] {"#", '#', Items.reeds}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 0), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, 0)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 1), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, 1)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 2), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, 2)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 3), new Object[] {"#", '#', new ItemStack(Blocks.log, 1, 3)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 4), new Object[] {"#", '#', new ItemStack(Blocks.log2, 1, 0)}); + this.addRecipe(new ItemStack(Blocks.planks, 4, 5), new Object[] {"#", '#', new ItemStack(Blocks.log2, 1, 1)}); + this.addRecipe(new ItemStack(Items.stick, 4), new Object[] {"#", "#", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.torch, 4), new Object[] {"X", "#", 'X', Items.coal, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.torch, 4), new Object[] {"X", "#", 'X', new ItemStack(Items.coal, 1, 1), '#', Items.stick}); + this.addRecipe(new ItemStack(Items.bowl, 4), new Object[] {"# #", " # ", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.glass_bottle, 3), new Object[] {"# #", " # ", '#', Blocks.glass}); + this.addRecipe(new ItemStack(Blocks.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.golden_rail, 6), new Object[] {"X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick}); + this.addRecipe(new ItemStack(Blocks.activator_rail, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Blocks.redstone_torch, 'S', Items.stick}); + this.addRecipe(new ItemStack(Blocks.detector_rail, 6), new Object[] {"X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Blocks.stone_pressure_plate}); + this.addRecipe(new ItemStack(Items.minecart, 1), new Object[] {"# #", "###", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.brewing_stand, 1), new Object[] {" B ", "###", '#', Blocks.cobblestone, 'B', Items.blaze_rod}); + this.addRecipe(new ItemStack(Blocks.lit_pumpkin, 1), new Object[] {"A", "B", 'A', Blocks.pumpkin, 'B', Blocks.torch}); + this.addRecipe(new ItemStack(Items.chest_minecart, 1), new Object[] {"A", "B", 'A', Blocks.chest, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.furnace_minecart, 1), new Object[] {"A", "B", 'A', Blocks.furnace, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.tnt_minecart, 1), new Object[] {"A", "B", 'A', Blocks.tnt, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.hopper_minecart, 1), new Object[] {"A", "B", 'A', Blocks.hopper, 'B', Items.minecart}); + this.addRecipe(new ItemStack(Items.boat, 1), new Object[] {"# #", "###", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Items.bucket, 1), new Object[] {"# #", " # ", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Items.flower_pot, 1), new Object[] {"# #", " # ", '#', Items.brick}); + this.addShapelessRecipe(new ItemStack(Items.flint_and_steel, 1), new Object[] {new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.flint, 1)}); + this.addRecipe(new ItemStack(Items.bread, 1), new Object[] {"###", '#', Items.wheat}); + this.addRecipe(new ItemStack(Blocks.oak_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 0)}); + this.addRecipe(new ItemStack(Blocks.birch_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 2)}); + this.addRecipe(new ItemStack(Blocks.spruce_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 1)}); + this.addRecipe(new ItemStack(Blocks.jungle_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 3)}); + this.addRecipe(new ItemStack(Blocks.acacia_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 4)}); + this.addRecipe(new ItemStack(Blocks.dark_oak_stairs, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Blocks.planks, 1, 5)}); + this.addRecipe(new ItemStack(Items.fishing_rod, 1), new Object[] {" #", " #X", "# X", '#', Items.stick, 'X', Items.string}); + this.addRecipe(new ItemStack(Items.carrot_on_a_stick, 1), new Object[] {"# ", " X", '#', Items.fishing_rod, 'X', Items.carrot}).func_92100_c(); + this.addRecipe(new ItemStack(Blocks.stone_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.cobblestone}); + this.addRecipe(new ItemStack(Blocks.brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.brick_block}); + this.addRecipe(new ItemStack(Blocks.stone_brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.stonebrick}); + this.addRecipe(new ItemStack(Blocks.nether_brick_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.nether_brick}); + this.addRecipe(new ItemStack(Blocks.sandstone_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.sandstone}); + this.addRecipe(new ItemStack(Blocks.quartz_stairs, 4), new Object[] {"# ", "## ", "###", '#', Blocks.quartz_block}); + this.addRecipe(new ItemStack(Items.painting, 1), new Object[] {"###", "#X#", "###", '#', Items.stick, 'X', Blocks.wool}); + this.addRecipe(new ItemStack(Items.item_frame, 1), new Object[] {"###", "#X#", "###", '#', Items.stick, 'X', Items.leather}); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 0), new Object[] {"###", "#X#", "###", '#', Items.gold_ingot, 'X', Items.apple}); + this.addRecipe(new ItemStack(Items.golden_apple, 1, 1), new Object[] {"###", "#X#", "###", '#', Blocks.gold_block, 'X', Items.apple}); + this.addRecipe(new ItemStack(Items.golden_carrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot}); + this.addRecipe(new ItemStack(Items.speckled_melon, 1), new Object[] {"###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon}); + this.addRecipe(new ItemStack(Blocks.lever, 1), new Object[] {"X", "#", '#', Blocks.cobblestone, 'X', Items.stick}); + this.addRecipe(new ItemStack(Blocks.tripwire_hook, 2), new Object[] {"I", "S", "#", '#', Blocks.planks, 'S', Items.stick, 'I', Items.iron_ingot}); + this.addRecipe(new ItemStack(Blocks.redstone_torch, 1), new Object[] {"X", "#", '#', Items.stick, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.repeater, 1), new Object[] {"#X#", "III", '#', Blocks.redstone_torch, 'X', Items.redstone, 'I', Blocks.stone}); + this.addRecipe(new ItemStack(Items.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Blocks.redstone_torch, 'X', Items.quartz, 'I', Blocks.stone}); + this.addRecipe(new ItemStack(Items.clock, 1), new Object[] {" # ", "#X#", " # ", '#', Items.gold_ingot, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone}); + this.addRecipe(new ItemStack(Items.map, 1), new Object[] {"###", "#X#", "###", '#', Items.paper, 'X', Items.compass}); + this.addRecipe(new ItemStack(Blocks.stone_button, 1), new Object[] {"#", '#', Blocks.stone}); + this.addRecipe(new ItemStack(Blocks.wooden_button, 1), new Object[] {"#", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.stone_pressure_plate, 1), new Object[] {"##", '#', Blocks.stone}); + this.addRecipe(new ItemStack(Blocks.wooden_pressure_plate, 1), new Object[] {"##", '#', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1), new Object[] {"##", '#', Items.iron_ingot}); + this.addRecipe(new ItemStack(Blocks.light_weighted_pressure_plate, 1), new Object[] {"##", '#', Items.gold_ingot}); + this.addRecipe(new ItemStack(Blocks.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.bow, 'R', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Blocks.cobblestone, 'R', Items.redstone}); + this.addRecipe(new ItemStack(Blocks.piston, 1), new Object[] {"TTT", "#X#", "#R#", '#', Blocks.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.sticky_piston, 1), new Object[] {"S", "P", 'S', Items.slime_ball, 'P', Blocks.piston}); + this.addRecipe(new ItemStack(Items.bed, 1), new Object[] {"###", "XXX", '#', Blocks.wool, 'X', Blocks.planks}); + this.addRecipe(new ItemStack(Blocks.enchanting_table, 1), new Object[] {" B ", "D#D", "###", '#', Blocks.obsidian, 'B', Items.book, 'D', Items.diamond}); + this.addRecipe(new ItemStack(Blocks.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Blocks.iron_block, 'i', Items.iron_ingot}); + this.addShapelessRecipe(new ItemStack(Items.ender_eye, 1), new Object[] {Items.ender_pearl, Items.blaze_powder}); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), new Object[] {Items.gunpowder, Items.blaze_powder, Items.coal}); + this.addShapelessRecipe(new ItemStack(Items.fire_charge, 3), new Object[] {Items.gunpowder, Items.blaze_powder, new ItemStack(Items.coal, 1, 1)}); + this.addRecipe(new ItemStack(Blocks.daylight_detector), new Object[] {"GGG", "QQQ", "WWW", 'G', Blocks.glass, 'Q', Items.quartz, 'W', Blocks.wooden_slab}); + this.addRecipe(new ItemStack(Blocks.hopper), new Object[] {"I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Blocks.chest}); + Collections.sort(this.recipes, new Comparator() + { + private static final String __OBFID = "CL_00000091"; + public int compare(IRecipe p_compare_1_, IRecipe p_compare_2_) + { + return p_compare_1_ instanceof ShapelessRecipes && p_compare_2_ instanceof ShapedRecipes ? 1 : (p_compare_2_ instanceof ShapelessRecipes && p_compare_1_ instanceof ShapedRecipes ? -1 : (p_compare_2_.getRecipeSize() < p_compare_1_.getRecipeSize() ? -1 : (p_compare_2_.getRecipeSize() > p_compare_1_.getRecipeSize() ? 1 : 0))); + } + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((IRecipe)p_compare_1_, (IRecipe)p_compare_2_); + } + }); + } + + public ShapedRecipes addRecipe(ItemStack p_92103_1_, Object ... p_92103_2_) + { + String s = ""; + int i = 0; + int j = 0; + int k = 0; + + if (p_92103_2_[i] instanceof String[]) + { + String[] astring = (String[])((String[])p_92103_2_[i++]); + + for (int l = 0; l < astring.length; ++l) + { + String s1 = astring[l]; + ++k; + j = s1.length(); + s = s + s1; + } + } + else + { + while (p_92103_2_[i] instanceof String) + { + String s2 = (String)p_92103_2_[i++]; + ++k; + j = s2.length(); + s = s + s2; + } + } + + HashMap hashmap; + + for (hashmap = new HashMap(); i < p_92103_2_.length; i += 2) + { + Character character = (Character)p_92103_2_[i]; + ItemStack itemstack1 = null; + + if (p_92103_2_[i + 1] instanceof Item) + { + itemstack1 = new ItemStack((Item)p_92103_2_[i + 1]); + } + else if (p_92103_2_[i + 1] instanceof Block) + { + itemstack1 = new ItemStack((Block)p_92103_2_[i + 1], 1, 32767); + } + else if (p_92103_2_[i + 1] instanceof ItemStack) + { + itemstack1 = (ItemStack)p_92103_2_[i + 1]; + } + + hashmap.put(character, itemstack1); + } + + ItemStack[] aitemstack = new ItemStack[j * k]; + + for (int i1 = 0; i1 < j * k; ++i1) + { + char c0 = s.charAt(i1); + + if (hashmap.containsKey(Character.valueOf(c0))) + { + aitemstack[i1] = ((ItemStack)hashmap.get(Character.valueOf(c0))).copy(); + } + else + { + aitemstack[i1] = null; + } + } + + ShapedRecipes shapedrecipes = new ShapedRecipes(j, k, aitemstack, p_92103_1_); + this.recipes.add(shapedrecipes); + return shapedrecipes; + } + + public void addShapelessRecipe(ItemStack p_77596_1_, Object ... p_77596_2_) + { + ArrayList arraylist = new ArrayList(); + Object[] aobject = p_77596_2_; + int i = p_77596_2_.length; + + for (int j = 0; j < i; ++j) + { + Object object1 = aobject[j]; + + if (object1 instanceof ItemStack) + { + arraylist.add(((ItemStack)object1).copy()); + } + else if (object1 instanceof Item) + { + arraylist.add(new ItemStack((Item)object1)); + } + else + { + if (!(object1 instanceof Block)) + { + throw new RuntimeException("Invalid shapeless recipy!"); + } + + arraylist.add(new ItemStack((Block)object1)); + } + } + + this.recipes.add(new ShapelessRecipes(p_77596_1_, arraylist)); + } + + public ItemStack findMatchingRecipe(InventoryCrafting p_82787_1_, World p_82787_2_) + { + int i = 0; + ItemStack itemstack = null; + ItemStack itemstack1 = null; + int j; + + for (j = 0; j < p_82787_1_.getSizeInventory(); ++j) + { + ItemStack itemstack2 = p_82787_1_.getStackInSlot(j); + + if (itemstack2 != null) + { + if (i == 0) + { + itemstack = itemstack2; + } + + if (i == 1) + { + itemstack1 = itemstack2; + } + + ++i; + } + } + + if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable()) + { + Item item = itemstack.getItem(); + int j1 = item.getMaxDamage() - itemstack.getItemDamageForDisplay(); + int k = item.getMaxDamage() - itemstack1.getItemDamageForDisplay(); + int l = j1 + k + item.getMaxDamage() * 5 / 100; + int i1 = item.getMaxDamage() - l; + + if (i1 < 0) + { + i1 = 0; + } + + return new ItemStack(itemstack.getItem(), 1, i1); + } + else + { + for (j = 0; j < this.recipes.size(); ++j) + { + IRecipe irecipe = (IRecipe)this.recipes.get(j); + + if (irecipe.matches(p_82787_1_, p_82787_2_)) + { + return irecipe.getCraftingResult(p_82787_1_); + } + } + + return null; + } + } + + /** + * returns the List<> of all recipes + */ + public List getRecipeList() + { + return this.recipes; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/FurnaceRecipes.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/FurnaceRecipes.java new file mode 100644 index 0000000..c34da41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/FurnaceRecipes.java @@ -0,0 +1,136 @@ +package net.minecraft.item.crafting; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFishFood; +import net.minecraft.item.ItemStack; + +public class FurnaceRecipes +{ + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); + /** The list of smelting results. */ + private Map smeltingList = new HashMap(); + private Map experienceList = new HashMap(); + private static final String __OBFID = "CL_00000085"; + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static FurnaceRecipes smelting() + { + return smeltingBase; + } + + private FurnaceRecipes() + { + this.func_151393_a(Blocks.iron_ore, new ItemStack(Items.iron_ingot), 0.7F); + this.func_151393_a(Blocks.gold_ore, new ItemStack(Items.gold_ingot), 1.0F); + this.func_151393_a(Blocks.diamond_ore, new ItemStack(Items.diamond), 1.0F); + this.func_151393_a(Blocks.sand, new ItemStack(Blocks.glass), 0.1F); + this.func_151396_a(Items.porkchop, new ItemStack(Items.cooked_porkchop), 0.35F); + this.func_151396_a(Items.beef, new ItemStack(Items.cooked_beef), 0.35F); + this.func_151396_a(Items.chicken, new ItemStack(Items.cooked_chicken), 0.35F); + this.func_151393_a(Blocks.cobblestone, new ItemStack(Blocks.stone), 0.1F); + this.func_151396_a(Items.clay_ball, new ItemStack(Items.brick), 0.3F); + this.func_151393_a(Blocks.clay, new ItemStack(Blocks.hardened_clay), 0.35F); + this.func_151393_a(Blocks.cactus, new ItemStack(Items.dye, 1, 2), 0.2F); + this.func_151393_a(Blocks.log, new ItemStack(Items.coal, 1, 1), 0.15F); + this.func_151393_a(Blocks.log2, new ItemStack(Items.coal, 1, 1), 0.15F); + this.func_151393_a(Blocks.emerald_ore, new ItemStack(Items.emerald), 1.0F); + this.func_151396_a(Items.potato, new ItemStack(Items.baked_potato), 0.35F); + this.func_151393_a(Blocks.netherrack, new ItemStack(Items.netherbrick), 0.1F); + ItemFishFood.FishType[] afishtype = ItemFishFood.FishType.values(); + int i = afishtype.length; + + for (int j = 0; j < i; ++j) + { + ItemFishFood.FishType fishtype = afishtype[j]; + + if (fishtype.func_150973_i()) + { + this.func_151394_a(new ItemStack(Items.fish, 1, fishtype.func_150976_a()), new ItemStack(Items.cooked_fished, 1, fishtype.func_150976_a()), 0.35F); + } + } + + this.func_151393_a(Blocks.coal_ore, new ItemStack(Items.coal), 0.1F); + this.func_151393_a(Blocks.redstone_ore, new ItemStack(Items.redstone), 0.7F); + this.func_151393_a(Blocks.lapis_ore, new ItemStack(Items.dye, 1, 4), 0.2F); + this.func_151393_a(Blocks.quartz_ore, new ItemStack(Items.quartz), 0.2F); + } + + public void func_151393_a(Block p_151393_1_, ItemStack p_151393_2_, float p_151393_3_) + { + this.func_151396_a(Item.getItemFromBlock(p_151393_1_), p_151393_2_, p_151393_3_); + } + + public void func_151396_a(Item p_151396_1_, ItemStack p_151396_2_, float p_151396_3_) + { + this.func_151394_a(new ItemStack(p_151396_1_, 1, 32767), p_151396_2_, p_151396_3_); + } + + public void func_151394_a(ItemStack p_151394_1_, ItemStack p_151394_2_, float p_151394_3_) + { + this.smeltingList.put(p_151394_1_, p_151394_2_); + this.experienceList.put(p_151394_2_, Float.valueOf(p_151394_3_)); + } + + /** + * Returns the smelting result of an item. + */ + public ItemStack getSmeltingResult(ItemStack p_151395_1_) + { + Iterator iterator = this.smeltingList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + entry = (Entry)iterator.next(); + } + while (!this.func_151397_a(p_151395_1_, (ItemStack)entry.getKey())); + + return (ItemStack)entry.getValue(); + } + + private boolean func_151397_a(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + public float func_151398_b(ItemStack p_151398_1_) + { + float ret = p_151398_1_.getItem().getSmeltingExperience(p_151398_1_); + if (ret != -1) return ret; + + Iterator iterator = this.experienceList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return 0.0F; + } + + entry = (Entry)iterator.next(); + } + while (!this.func_151397_a(p_151398_1_, (ItemStack)entry.getKey())); + + return ((Float)entry.getValue()).floatValue(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/IRecipe.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/IRecipe.java new file mode 100644 index 0000000..ce83a6f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/IRecipe.java @@ -0,0 +1,25 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IRecipe +{ + /** + * Used to check if a recipe matches current crafting inventory + */ + boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_); + + /** + * Returns an Item that is the result of this recipe + */ + ItemStack getCraftingResult(InventoryCrafting p_77572_1_); + + /** + * Returns the size of the recipe area + */ + int getRecipeSize(); + + ItemStack getRecipeOutput(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeBookCloning.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeBookCloning.java new file mode 100644 index 0000000..c1a7ba9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeBookCloning.java @@ -0,0 +1,116 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class RecipeBookCloning implements IRecipe +{ + private static final String __OBFID = "CL_00000081"; + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < p_77569_1_.getSizeInventory(); ++j) + { + ItemStack itemstack1 = p_77569_1_.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.written_book) + { + if (itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.writable_book) + { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < p_77572_1_.getSizeInventory(); ++j) + { + ItemStack itemstack1 = p_77572_1_.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.written_book) + { + if (itemstack != null) + { + return null; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.writable_book) + { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1) + { + ItemStack itemstack2 = new ItemStack(Items.written_book, i + 1); + itemstack2.setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + + if (itemstack.hasDisplayName()) + { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } + else + { + return null; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return 9; + } + + public ItemStack getRecipeOutput() + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeFireworks.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeFireworks.java new file mode 100644 index 0000000..82c8b06 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipeFireworks.java @@ -0,0 +1,256 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class RecipeFireworks implements IRecipe +{ + private ItemStack field_92102_a; + private static final String __OBFID = "CL_00000083"; + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + this.field_92102_a = null; + int i = 0; + int j = 0; + int k = 0; + int l = 0; + int i1 = 0; + int j1 = 0; + + for (int k1 = 0; k1 < p_77569_1_.getSizeInventory(); ++k1) + { + ItemStack itemstack = p_77569_1_.getStackInSlot(k1); + + if (itemstack != null) + { + if (itemstack.getItem() == Items.gunpowder) + { + ++j; + } + else if (itemstack.getItem() == Items.firework_charge) + { + ++l; + } + else if (itemstack.getItem() == Items.dye) + { + ++k; + } + else if (itemstack.getItem() == Items.paper) + { + ++i; + } + else if (itemstack.getItem() == Items.glowstone_dust) + { + ++i1; + } + else if (itemstack.getItem() == Items.diamond) + { + ++i1; + } + else if (itemstack.getItem() == Items.fire_charge) + { + ++j1; + } + else if (itemstack.getItem() == Items.feather) + { + ++j1; + } + else if (itemstack.getItem() == Items.gold_nugget) + { + ++j1; + } + else + { + if (itemstack.getItem() != Items.skull) + { + return false; + } + + ++j1; + } + } + } + + i1 += k + j1; + + if (j <= 3 && i <= 1) + { + NBTTagCompound nbttagcompound; + NBTTagCompound nbttagcompound1; + + if (j >= 1 && i == 1 && i1 == 0) + { + this.field_92102_a = new ItemStack(Items.fireworks); + + nbttagcompound = new NBTTagCompound(); + if (l > 0) + { + nbttagcompound1 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int k2 = 0; k2 < p_77569_1_.getSizeInventory(); ++k2) + { + ItemStack itemstack3 = p_77569_1_.getStackInSlot(k2); + + if (itemstack3 != null && itemstack3.getItem() == Items.firework_charge && itemstack3.hasTagCompound() && itemstack3.getTagCompound().hasKey("Explosion", 10)) + { + nbttaglist.appendTag(itemstack3.getTagCompound().getCompoundTag("Explosion")); + } + } + + nbttagcompound1.setTag("Explosions", nbttaglist); + nbttagcompound1.setByte("Flight", (byte)j); + nbttagcompound.setTag("Fireworks", nbttagcompound1); + } + this.field_92102_a.setTagCompound(nbttagcompound); //Forge BugFix: NPE Protection + + return true; + } + else if (j == 1 && i == 0 && l == 0 && k > 0 && j1 <= 1) + { + this.field_92102_a = new ItemStack(Items.firework_charge); + nbttagcompound = new NBTTagCompound(); + nbttagcompound1 = new NBTTagCompound(); + byte b0 = 0; + ArrayList arraylist = new ArrayList(); + + for (int l1 = 0; l1 < p_77569_1_.getSizeInventory(); ++l1) + { + ItemStack itemstack2 = p_77569_1_.getStackInSlot(l1); + + if (itemstack2 != null) + { + if (itemstack2.getItem() == Items.dye) + { + arraylist.add(Integer.valueOf(ItemDye.field_150922_c[itemstack2.getItemDamage()])); + } + else if (itemstack2.getItem() == Items.glowstone_dust) + { + nbttagcompound1.setBoolean("Flicker", true); + } + else if (itemstack2.getItem() == Items.diamond) + { + nbttagcompound1.setBoolean("Trail", true); + } + else if (itemstack2.getItem() == Items.fire_charge) + { + b0 = 1; + } + else if (itemstack2.getItem() == Items.feather) + { + b0 = 4; + } + else if (itemstack2.getItem() == Items.gold_nugget) + { + b0 = 2; + } + else if (itemstack2.getItem() == Items.skull) + { + b0 = 3; + } + } + } + + int[] aint1 = new int[arraylist.size()]; + + for (int l2 = 0; l2 < aint1.length; ++l2) + { + aint1[l2] = ((Integer)arraylist.get(l2)).intValue(); + } + + nbttagcompound1.setIntArray("Colors", aint1); + nbttagcompound1.setByte("Type", b0); + nbttagcompound.setTag("Explosion", nbttagcompound1); + this.field_92102_a.setTagCompound(nbttagcompound); + return true; + } + else if (j == 0 && i == 0 && l == 1 && k > 0 && k == i1) + { + ArrayList arraylist1 = new ArrayList(); + + for (int i2 = 0; i2 < p_77569_1_.getSizeInventory(); ++i2) + { + ItemStack itemstack1 = p_77569_1_.getStackInSlot(i2); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.dye) + { + arraylist1.add(Integer.valueOf(ItemDye.field_150922_c[itemstack1.getItemDamage()])); + } + else if (itemstack1.getItem() == Items.firework_charge) + { + this.field_92102_a = itemstack1.copy(); + this.field_92102_a.stackSize = 1; + } + } + } + + int[] aint = new int[arraylist1.size()]; + + for (int j2 = 0; j2 < aint.length; ++j2) + { + aint[j2] = ((Integer)arraylist1.get(j2)).intValue(); + } + + if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) + { + NBTTagCompound nbttagcompound2 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); + + if (nbttagcompound2 == null) + { + return false; + } + else + { + nbttagcompound2.setIntArray("FadeColors", aint); + return true; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + return this.field_92102_a.copy(); + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return 10; + } + + public ItemStack getRecipeOutput() + { + return this.field_92102_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmor.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmor.java new file mode 100644 index 0000000..ed41f46 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmor.java @@ -0,0 +1,35 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesArmor +{ + private String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; + private Object[][] recipeItems; + private static final String __OBFID = "CL_00000080"; + + public RecipesArmor() + { + this.recipeItems = new Object[][] {{Items.leather, Blocks.fire, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.leather_helmet, Items.chainmail_helmet, Items.iron_helmet, Items.diamond_helmet, Items.golden_helmet}, {Items.leather_chestplate, Items.chainmail_chestplate, Items.iron_chestplate, Items.diamond_chestplate, Items.golden_chestplate}, {Items.leather_leggings, Items.chainmail_leggings, Items.iron_leggings, Items.diamond_leggings, Items.golden_leggings}, {Items.leather_boots, Items.chainmail_boots, Items.iron_boots, Items.diamond_boots, Items.golden_boots}}; + } + + /** + * Adds the armor recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77609_1_) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item = (Item)this.recipeItems[j + 1][i]; + p_77609_1_.addRecipe(new ItemStack(item), new Object[] {this.recipePatterns[j], 'X', object}); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmorDyes.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmorDyes.java new file mode 100644 index 0000000..9511b99 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesArmorDyes.java @@ -0,0 +1,156 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesArmorDyes implements IRecipe +{ + private static final String __OBFID = "CL_00000079"; + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + ItemStack itemstack = null; + ArrayList arraylist = new ArrayList(); + + for (int i = 0; i < p_77569_1_.getSizeInventory(); ++i) + { + ItemStack itemstack1 = p_77569_1_.getStackInSlot(i); + + if (itemstack1 != null) + { + if (itemstack1.getItem() instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.CLOTH || itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.dye) + { + return false; + } + + arraylist.add(itemstack1); + } + } + } + + return itemstack != null && !arraylist.isEmpty(); + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + ItemStack itemstack = null; + int[] aint = new int[3]; + int i = 0; + int j = 0; + ItemArmor itemarmor = null; + int k; + int l; + float f; + float f1; + int l1; + + for (k = 0; k < p_77572_1_.getSizeInventory(); ++k) + { + ItemStack itemstack1 = p_77572_1_.getStackInSlot(k); + + if (itemstack1 != null) + { + if (itemstack1.getItem() instanceof ItemArmor) + { + itemarmor = (ItemArmor)itemstack1.getItem(); + + if (itemarmor.getArmorMaterial() != ItemArmor.ArmorMaterial.CLOTH || itemstack != null) + { + return null; + } + + itemstack = itemstack1.copy(); + itemstack.stackSize = 1; + + if (itemarmor.hasColor(itemstack1)) + { + l = itemarmor.getColor(itemstack); + f = (float)(l >> 16 & 255) / 255.0F; + f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + i = (int)((float)i + Math.max(f, Math.max(f1, f2)) * 255.0F); + aint[0] = (int)((float)aint[0] + f * 255.0F); + aint[1] = (int)((float)aint[1] + f1 * 255.0F); + aint[2] = (int)((float)aint[2] + f2 * 255.0F); + ++j; + } + } + else + { + if (itemstack1.getItem() != Items.dye) + { + return null; + } + + float[] afloat = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(itemstack1.getItemDamage())]; + int j1 = (int)(afloat[0] * 255.0F); + int k1 = (int)(afloat[1] * 255.0F); + l1 = (int)(afloat[2] * 255.0F); + i += Math.max(j1, Math.max(k1, l1)); + aint[0] += j1; + aint[1] += k1; + aint[2] += l1; + ++j; + } + } + } + + if (itemarmor == null) + { + return null; + } + else + { + k = aint[0] / j; + int i1 = aint[1] / j; + l = aint[2] / j; + f = (float)i / (float)j; + f1 = (float)Math.max(k, Math.max(i1, l)); + k = (int)((float)k * f / f1); + i1 = (int)((float)i1 * f / f1); + l = (int)((float)l * f / f1); + l1 = (k << 8) + i1; + l1 = (l1 << 8) + l; + itemarmor.func_82813_b(itemstack, l1); + return itemstack; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return 10; + } + + public ItemStack getRecipeOutput() + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesCrafting.java new file mode 100644 index 0000000..ea3904a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesCrafting.java @@ -0,0 +1,33 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesCrafting +{ + private static final String __OBFID = "CL_00000095"; + + /** + * Adds the crafting recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77589_1_) + { + p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks}); + p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook}); + p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye}); + p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, 0)}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, 2), new Object[] {"##", "##", '#', Blocks.sandstone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, 1)}); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, 7)}); + p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, 2), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, 0)}); + p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', Blocks.stone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot}); + p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass}); + p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone}); + p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian}); + p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesDyes.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesDyes.java new file mode 100644 index 0000000..a70af30 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesDyes.java @@ -0,0 +1,61 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.BlockColored; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesDyes +{ + private static final String __OBFID = "CL_00000082"; + + /** + * Adds the dye recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77607_1_) + { + int i; + + for (i = 0; i < 16; ++i) + { + p_77607_1_.addShapelessRecipe(new ItemStack(Blocks.wool, 1, BlockColored.func_150031_c(i)), new Object[] {new ItemStack(Items.dye, 1, i), new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 0)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_hardened_clay, 8, BlockColored.func_150031_c(i)), new Object[] {"###", "#X#", "###", '#', new ItemStack(Blocks.hardened_clay), 'X', new ItemStack(Items.dye, 1, i)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass, 8, BlockColored.func_150031_c(i)), new Object[] {"###", "#X#", "###", '#', new ItemStack(Blocks.glass), 'X', new ItemStack(Items.dye, 1, i)}); + p_77607_1_.addRecipe(new ItemStack(Blocks.stained_glass_pane, 16, i), new Object[] {"###", "###", '#', new ItemStack(Blocks.stained_glass, 1, i)}); + } + + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 11), new Object[] {new ItemStack(Blocks.yellow_flower, 1, 0)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 1), new Object[] {new ItemStack(Blocks.red_flower, 1, 0)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 15), new Object[] {Items.bone}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 9), new Object[] {new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 14), new Object[] {new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 11)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 10), new Object[] {new ItemStack(Items.dye, 1, 2), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 8), new Object[] {new ItemStack(Items.dye, 1, 0), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 7), new Object[] {new ItemStack(Items.dye, 1, 8), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 7), new Object[] {new ItemStack(Items.dye, 1, 0), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 12), new Object[] {new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 6), new Object[] {new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 2)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 5), new Object[] {new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 13), new Object[] {new ItemStack(Items.dye, 1, 5), new ItemStack(Items.dye, 1, 9)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 3, 13), new Object[] {new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 9)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 4, 13), new Object[] {new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 15)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 12), new Object[] {new ItemStack(Blocks.red_flower, 1, 1)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 13), new Object[] {new ItemStack(Blocks.red_flower, 1, 2)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new Object[] {new ItemStack(Blocks.red_flower, 1, 3)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 1), new Object[] {new ItemStack(Blocks.red_flower, 1, 4)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 14), new Object[] {new ItemStack(Blocks.red_flower, 1, 5)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new Object[] {new ItemStack(Blocks.red_flower, 1, 6)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 9), new Object[] {new ItemStack(Blocks.red_flower, 1, 7)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 1, 7), new Object[] {new ItemStack(Blocks.red_flower, 1, 8)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 11), new Object[] {new ItemStack(Blocks.double_plant, 1, 0)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 13), new Object[] {new ItemStack(Blocks.double_plant, 1, 1)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), new Object[] {new ItemStack(Blocks.double_plant, 1, 4)}); + p_77607_1_.addShapelessRecipe(new ItemStack(Items.dye, 2, 9), new Object[] {new ItemStack(Blocks.double_plant, 1, 5)}); + + for (i = 0; i < 16; ++i) + { + p_77607_1_.addRecipe(new ItemStack(Blocks.carpet, 3, i), new Object[] {"##", '#', new ItemStack(Blocks.wool, 1, i)}); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesFood.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesFood.java new file mode 100644 index 0000000..c9b6609 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesFood.java @@ -0,0 +1,26 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesFood +{ + private static final String __OBFID = "CL_00000084"; + + /** + * Adds the food recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77608_1_) + { + p_77608_1_.addShapelessRecipe(new ItemStack(Items.mushroom_stew), new Object[] {Blocks.brown_mushroom, Blocks.red_mushroom, Items.bowl}); + p_77608_1_.addRecipe(new ItemStack(Items.cookie, 8), new Object[] {"#X#", 'X', new ItemStack(Items.dye, 1, 3), '#', Items.wheat}); + p_77608_1_.addRecipe(new ItemStack(Blocks.melon_block), new Object[] {"MMM", "MMM", "MMM", 'M', Items.melon}); + p_77608_1_.addRecipe(new ItemStack(Items.melon_seeds), new Object[] {"M", 'M', Items.melon}); + p_77608_1_.addRecipe(new ItemStack(Items.pumpkin_seeds, 4), new Object[] {"M", 'M', Blocks.pumpkin}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.pumpkin_pie), new Object[] {Blocks.pumpkin, Items.sugar, Items.egg}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.fermented_spider_eye), new Object[] {Items.spider_eye, Blocks.brown_mushroom, Items.sugar}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.blaze_powder, 2), new Object[] {Items.blaze_rod}); + p_77608_1_.addShapelessRecipe(new ItemStack(Items.magma_cream), new Object[] {Items.blaze_powder, Items.slime_ball}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesIngots.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesIngots.java new file mode 100644 index 0000000..c968fe9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesIngots.java @@ -0,0 +1,34 @@ +package net.minecraft.item.crafting; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesIngots +{ + private Object[][] recipeItems; + private static final String __OBFID = "CL_00000089"; + + public RecipesIngots() + { + this.recipeItems = new Object[][] {{Blocks.gold_block, new ItemStack(Items.gold_ingot, 9)}, {Blocks.iron_block, new ItemStack(Items.iron_ingot, 9)}, {Blocks.diamond_block, new ItemStack(Items.diamond, 9)}, {Blocks.emerald_block, new ItemStack(Items.emerald, 9)}, {Blocks.lapis_block, new ItemStack(Items.dye, 9, 4)}, {Blocks.redstone_block, new ItemStack(Items.redstone, 9)}, {Blocks.coal_block, new ItemStack(Items.coal, 9, 0)}, {Blocks.hay_block, new ItemStack(Items.wheat, 9)}}; + } + + /** + * Adds the ingot recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77590_1_) + { + for (int i = 0; i < this.recipeItems.length; ++i) + { + Block block = (Block)this.recipeItems[i][0]; + ItemStack itemstack = (ItemStack)this.recipeItems[i][1]; + p_77590_1_.addRecipe(new ItemStack(block), new Object[] {"###", "###", "###", '#', itemstack}); + p_77590_1_.addRecipe(itemstack, new Object[] {"#", '#', block}); + } + + p_77590_1_.addRecipe(new ItemStack(Items.gold_ingot), new Object[] {"###", "###", "###", '#', Items.gold_nugget}); + p_77590_1_.addRecipe(new ItemStack(Items.gold_nugget, 9), new Object[] {"#", '#', Items.gold_ingot}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapCloning.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapCloning.java new file mode 100644 index 0000000..1b790c2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapCloning.java @@ -0,0 +1,114 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class RecipesMapCloning implements IRecipe +{ + private static final String __OBFID = "CL_00000087"; + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < p_77569_1_.getSizeInventory(); ++j) + { + ItemStack itemstack1 = p_77569_1_.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.filled_map) + { + if (itemstack != null) + { + return false; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.map) + { + return false; + } + + ++i; + } + } + } + + return itemstack != null && i > 0; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + int i = 0; + ItemStack itemstack = null; + + for (int j = 0; j < p_77572_1_.getSizeInventory(); ++j) + { + ItemStack itemstack1 = p_77572_1_.getStackInSlot(j); + + if (itemstack1 != null) + { + if (itemstack1.getItem() == Items.filled_map) + { + if (itemstack != null) + { + return null; + } + + itemstack = itemstack1; + } + else + { + if (itemstack1.getItem() != Items.map) + { + return null; + } + + ++i; + } + } + } + + if (itemstack != null && i >= 1) + { + ItemStack itemstack2 = new ItemStack(Items.filled_map, i + 1, itemstack.getItemDamage()); + + if (itemstack.hasDisplayName()) + { + itemstack2.setStackDisplayName(itemstack.getDisplayName()); + } + + return itemstack2; + } + else + { + return null; + } + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return 9; + } + + public ItemStack getRecipeOutput() + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapExtending.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapExtending.java new file mode 100644 index 0000000..4115659 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesMapExtending.java @@ -0,0 +1,82 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.storage.MapData; + +public class RecipesMapExtending extends ShapedRecipes +{ + private static final String __OBFID = "CL_00000088"; + + public RecipesMapExtending() + { + super(3, 3, new ItemStack[] {new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.filled_map, 0, 32767), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper), new ItemStack(Items.paper)}, new ItemStack(Items.map, 0, 0)); + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + if (!super.matches(p_77569_1_, p_77569_2_)) + { + return false; + } + else + { + ItemStack itemstack = null; + + for (int i = 0; i < p_77569_1_.getSizeInventory() && itemstack == null; ++i) + { + ItemStack itemstack1 = p_77569_1_.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) + { + itemstack = itemstack1; + } + } + + if (itemstack == null) + { + return false; + } + else + { + MapData mapdata = Items.filled_map.getMapData(itemstack, p_77569_2_); + return mapdata == null ? false : mapdata.scale < 4; + } + } + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + ItemStack itemstack = null; + + for (int i = 0; i < p_77572_1_.getSizeInventory() && itemstack == null; ++i) + { + ItemStack itemstack1 = p_77572_1_.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.getItem() == Items.filled_map) + { + itemstack = itemstack1; + } + } + + itemstack = itemstack.copy(); + itemstack.stackSize = 1; + + if (itemstack.getTagCompound() == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.getTagCompound().setBoolean("map_is_scaling", true); + return itemstack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesTools.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesTools.java new file mode 100644 index 0000000..37f1c81 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesTools.java @@ -0,0 +1,37 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesTools +{ + private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; + private Object[][] recipeItems; + private static final String __OBFID = "CL_00000096"; + + public RecipesTools() + { + this.recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_pickaxe, Items.stone_pickaxe, Items.iron_pickaxe, Items.diamond_pickaxe, Items.golden_pickaxe}, {Items.wooden_shovel, Items.stone_shovel, Items.iron_shovel, Items.diamond_shovel, Items.golden_shovel}, {Items.wooden_axe, Items.stone_axe, Items.iron_axe, Items.diamond_axe, Items.golden_axe}, {Items.wooden_hoe, Items.stone_hoe, Items.iron_hoe, Items.diamond_hoe, Items.golden_hoe}}; + } + + /** + * Adds the tool recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77586_1_) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item = (Item)this.recipeItems[j + 1][i]; + p_77586_1_.addRecipe(new ItemStack(item), new Object[] {this.recipePatterns[j], '#', Items.stick, 'X', object}); + } + } + + p_77586_1_.addRecipe(new ItemStack(Items.shears), new Object[] {" #", "# ", '#', Items.iron_ingot}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesWeapons.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesWeapons.java new file mode 100644 index 0000000..4ba01ab --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/RecipesWeapons.java @@ -0,0 +1,38 @@ +package net.minecraft.item.crafting; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class RecipesWeapons +{ + private String[][] recipePatterns = new String[][] {{"X", "X", "#"}}; + private Object[][] recipeItems; + private static final String __OBFID = "CL_00000097"; + + public RecipesWeapons() + { + this.recipeItems = new Object[][] {{Blocks.planks, Blocks.cobblestone, Items.iron_ingot, Items.diamond, Items.gold_ingot}, {Items.wooden_sword, Items.stone_sword, Items.iron_sword, Items.diamond_sword, Items.golden_sword}}; + } + + /** + * Adds the weapon recipes to the CraftingManager. + */ + public void addRecipes(CraftingManager p_77583_1_) + { + for (int i = 0; i < this.recipeItems[0].length; ++i) + { + Object object = this.recipeItems[0][i]; + + for (int j = 0; j < this.recipeItems.length - 1; ++j) + { + Item item = (Item)this.recipeItems[j + 1][i]; + p_77583_1_.addRecipe(new ItemStack(item), new Object[] {this.recipePatterns[j], '#', Items.stick, 'X', object}); + } + } + + p_77583_1_.addRecipe(new ItemStack(Items.bow, 1), new Object[] {" #X", "# X", " #X", 'X', Items.string, '#', Items.stick}); + p_77583_1_.addRecipe(new ItemStack(Items.arrow, 4), new Object[] {"X", "#", "Y", 'Y', Items.feather, 'X', Items.flint, '#', Items.stick}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapedRecipes.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapedRecipes.java new file mode 100644 index 0000000..39cc3cb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapedRecipes.java @@ -0,0 +1,144 @@ +package net.minecraft.item.crafting; + +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class ShapedRecipes implements IRecipe +{ + /** How many horizontal slots this recipe is wide. */ + public final int recipeWidth; + /** How many vertical slots this recipe uses. */ + public final int recipeHeight; + /** Is a array of ItemStack that composes the recipe. */ + public final ItemStack[] recipeItems; + /** Is the ItemStack that you get when craft the recipe. */ + private ItemStack recipeOutput; + private boolean field_92101_f; + private static final String __OBFID = "CL_00000093"; + + public ShapedRecipes(int p_i1917_1_, int p_i1917_2_, ItemStack[] p_i1917_3_, ItemStack p_i1917_4_) + { + this.recipeWidth = p_i1917_1_; + this.recipeHeight = p_i1917_2_; + this.recipeItems = p_i1917_3_; + this.recipeOutput = p_i1917_4_; + } + + public ItemStack getRecipeOutput() + { + return this.recipeOutput; + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + for (int i = 0; i <= 3 - this.recipeWidth; ++i) + { + for (int j = 0; j <= 3 - this.recipeHeight; ++j) + { + if (this.checkMatch(p_77569_1_, i, j, true)) + { + return true; + } + + if (this.checkMatch(p_77569_1_, i, j, false)) + { + return true; + } + } + } + + return false; + } + + /** + * Checks if the region of a crafting inventory is match for the recipe. + */ + private boolean checkMatch(InventoryCrafting p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) + { + for (int k = 0; k < 3; ++k) + { + for (int l = 0; l < 3; ++l) + { + int i1 = k - p_77573_2_; + int j1 = l - p_77573_3_; + ItemStack itemstack = null; + + if (i1 >= 0 && j1 >= 0 && i1 < this.recipeWidth && j1 < this.recipeHeight) + { + if (p_77573_4_) + { + itemstack = this.recipeItems[this.recipeWidth - i1 - 1 + j1 * this.recipeWidth]; + } + else + { + itemstack = this.recipeItems[i1 + j1 * this.recipeWidth]; + } + } + + ItemStack itemstack1 = p_77573_1_.getStackInRowAndColumn(k, l); + + if (itemstack1 != null || itemstack != null) + { + if (itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null) + { + return false; + } + + if (itemstack.getItem() != itemstack1.getItem()) + { + return false; + } + + if (itemstack.getItemDamage() != 32767 && itemstack.getItemDamage() != itemstack1.getItemDamage()) + { + return false; + } + } + } + } + + return true; + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + ItemStack itemstack = this.getRecipeOutput().copy(); + + if (this.field_92101_f) + { + for (int i = 0; i < p_77572_1_.getSizeInventory(); ++i) + { + ItemStack itemstack1 = p_77572_1_.getStackInSlot(i); + + if (itemstack1 != null && itemstack1.hasTagCompound()) + { + itemstack.setTagCompound((NBTTagCompound)itemstack1.stackTagCompound.copy()); + } + } + } + + return itemstack; + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return this.recipeWidth * this.recipeHeight; + } + + public ShapedRecipes func_92100_c() + { + this.field_92101_f = true; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapelessRecipes.java b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapelessRecipes.java new file mode 100644 index 0000000..3f01e40 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/item/crafting/ShapelessRecipes.java @@ -0,0 +1,85 @@ +package net.minecraft.item.crafting; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ShapelessRecipes implements IRecipe +{ + /** Is the ItemStack that you get when craft the recipe. */ + private final ItemStack recipeOutput; + /** Is a List of ItemStack that composes the recipe. */ + public final List recipeItems; + private static final String __OBFID = "CL_00000094"; + + public ShapelessRecipes(ItemStack p_i1918_1_, List p_i1918_2_) + { + this.recipeOutput = p_i1918_1_; + this.recipeItems = p_i1918_2_; + } + + public ItemStack getRecipeOutput() + { + return this.recipeOutput; + } + + /** + * Used to check if a recipe matches current crafting inventory + */ + public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) + { + ArrayList arraylist = new ArrayList(this.recipeItems); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 3; ++j) + { + ItemStack itemstack = p_77569_1_.getStackInRowAndColumn(j, i); + + if (itemstack != null) + { + boolean flag = false; + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + ItemStack itemstack1 = (ItemStack)iterator.next(); + + if (itemstack.getItem() == itemstack1.getItem() && (itemstack1.getItemDamage() == 32767 || itemstack.getItemDamage() == itemstack1.getItemDamage())) + { + flag = true; + arraylist.remove(itemstack1); + break; + } + } + + if (!flag) + { + return false; + } + } + } + } + + return arraylist.isEmpty(); + } + + /** + * Returns an Item that is the result of this recipe + */ + public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) + { + return this.recipeOutput.copy(); + } + + /** + * Returns the size of the recipe area + */ + public int getRecipeSize() + { + return this.recipeItems.size(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/CompressedStreamTools.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/CompressedStreamTools.java new file mode 100644 index 0000000..38bfaf1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/CompressedStreamTools.java @@ -0,0 +1,235 @@ +package net.minecraft.nbt; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; + +public class CompressedStreamTools +{ + private static final String __OBFID = "CL_00001226"; + + /** + * Load the gzipped compound from the inputstream. + */ + public static NBTTagCompound readCompressed(InputStream p_74796_0_) throws IOException + { + DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(p_74796_0_))); + NBTTagCompound nbttagcompound; + + try + { + nbttagcompound = func_152456_a(datainputstream, NBTSizeTracker.field_152451_a); + } + finally + { + datainputstream.close(); + } + + return nbttagcompound; + } + + /** + * Write the compound, gzipped, to the outputstream. + */ + public static void writeCompressed(NBTTagCompound p_74799_0_, OutputStream p_74799_1_) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(p_74799_1_))); + + try + { + write(p_74799_0_, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } + } + + public static NBTTagCompound func_152457_a(byte[] p_152457_0_, NBTSizeTracker p_152457_1_) throws IOException + { + DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(p_152457_0_)))); + NBTTagCompound nbttagcompound; + + try + { + nbttagcompound = func_152456_a(datainputstream, p_152457_1_); + } + finally + { + datainputstream.close(); + } + + return nbttagcompound; + } + + public static byte[] compress(NBTTagCompound p_74798_0_) throws IOException + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); + DataOutputStream dataoutputstream = new DataOutputStream(new GZIPOutputStream(bytearrayoutputstream)); + + try + { + write(p_74798_0_, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } + + return bytearrayoutputstream.toByteArray(); + } + + public static void safeWrite(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException + { + File file2 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); + + if (file2.exists()) + { + file2.delete(); + } + + write(p_74793_0_, file2); + + if (p_74793_1_.exists()) + { + p_74793_1_.delete(); + } + + if (p_74793_1_.exists()) + { + throw new IOException("Failed to delete " + p_74793_1_); + } + else + { + file2.renameTo(p_74793_1_); + } + } + + /** + * Reads from a CompressedStream. + */ + public static NBTTagCompound read(DataInputStream p_74794_0_) throws IOException + { + return func_152456_a(p_74794_0_, NBTSizeTracker.field_152451_a); + } + + public static NBTTagCompound func_152456_a(DataInput p_152456_0_, NBTSizeTracker p_152456_1_) throws IOException + { + NBTBase nbtbase = func_152455_a(p_152456_0_, 0, p_152456_1_); + + if (nbtbase instanceof NBTTagCompound) + { + return (NBTTagCompound)nbtbase; + } + else + { + throw new IOException("Root tag must be a named compound tag"); + } + } + + public static void write(NBTTagCompound p_74800_0_, DataOutput p_74800_1_) throws IOException + { + func_150663_a(p_74800_0_, p_74800_1_); + } + + private static void func_150663_a(NBTBase p_150663_0_, DataOutput p_150663_1_) throws IOException + { + p_150663_1_.writeByte(p_150663_0_.getId()); + + if (p_150663_0_.getId() != 0) + { + p_150663_1_.writeUTF(""); + p_150663_0_.write(p_150663_1_); + } + } + + private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException + { + byte b0 = p_152455_0_.readByte(); + p_152455_2_.func_152450_a(8); // Forge: Count everything! + + if (b0 == 0) + { + return new NBTTagEnd(); + } + else + { + NBTSizeTracker.readUTF(p_152455_2_, p_152455_0_.readUTF()); //Forge: Count this string. + p_152455_2_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(b0); + + try + { + nbtbase.func_152446_a(p_152455_0_, p_152455_1_, p_152455_2_); + return nbtbase; + } + catch (IOException ioexception) + { + CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag"); + crashreportcategory.addCrashSection("Tag name", "[UNNAMED TAG]"); + crashreportcategory.addCrashSection("Tag type", Byte.valueOf(b0)); + throw new ReportedException(crashreport); + } + } + } + + public static void write(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); + + try + { + write(p_74795_0_, dataoutputstream); + } + finally + { + dataoutputstream.close(); + } + } + + public static NBTTagCompound read(File p_74797_0_) throws IOException + { + return func_152458_a(p_74797_0_, NBTSizeTracker.field_152451_a); + } + + public static NBTTagCompound func_152458_a(File p_152458_0_, NBTSizeTracker p_152458_1_) throws IOException + { + if (!p_152458_0_.exists()) + { + return null; + } + else + { + DataInputStream datainputstream = new DataInputStream(new FileInputStream(p_152458_0_)); + NBTTagCompound nbttagcompound; + + try + { + nbttagcompound = func_152456_a(datainputstream, p_152458_1_); + } + finally + { + datainputstream.close(); + } + + return nbttagcompound; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/JsonToNBT.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/JsonToNBT.java new file mode 100644 index 0000000..33d2676 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/JsonToNBT.java @@ -0,0 +1,560 @@ +package net.minecraft.nbt; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Stack; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class JsonToNBT +{ + private static final Logger logger = LogManager.getLogger(); + private static final String __OBFID = "CL_00001232"; + + public static NBTBase func_150315_a(String p_150315_0_) throws NBTException + { + p_150315_0_ = p_150315_0_.trim(); + int i = func_150310_b(p_150315_0_); + + if (i != 1) + { + throw new NBTException("Encountered multiple top tags, only one expected"); + } + else + { + JsonToNBT.Any any = null; + + if (p_150315_0_.startsWith("{")) + { + any = func_150316_a("tag", p_150315_0_); + } + else + { + any = func_150316_a(func_150313_b(p_150315_0_, false), func_150311_c(p_150315_0_, false)); + } + + return any.func_150489_a(); + } + } + + static int func_150310_b(String p_150310_0_) throws NBTException + { + int i = 0; + boolean flag = false; + Stack stack = new Stack(); + + for (int j = 0; j < p_150310_0_.length(); ++j) + { + char c0 = p_150310_0_.charAt(j); + + if (c0 == 34) + { + if (j > 0 && p_150310_0_.charAt(j - 1) == 92) + { + if (!flag) + { + throw new NBTException("Illegal use of \\\": " + p_150310_0_); + } + } + else + { + flag = !flag; + } + } + else if (!flag) + { + if (c0 != 123 && c0 != 91) + { + if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123)) + { + throw new NBTException("Unbalanced curly brackets {}: " + p_150310_0_); + } + + if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91)) + { + throw new NBTException("Unbalanced square brackets []: " + p_150310_0_); + } + } + else + { + if (stack.isEmpty()) + { + ++i; + } + + stack.push(Character.valueOf(c0)); + } + } + } + + if (flag) + { + throw new NBTException("Unbalanced quotation: " + p_150310_0_); + } + else if (!stack.isEmpty()) + { + throw new NBTException("Unbalanced brackets: " + p_150310_0_); + } + else if (i == 0 && !p_150310_0_.isEmpty()) + { + return 1; + } + else + { + return i; + } + } + + static JsonToNBT.Any func_150316_a(String p_150316_0_, String p_150316_1_) throws NBTException + { + p_150316_1_ = p_150316_1_.trim(); + func_150310_b(p_150316_1_); + String s2; + String s3; + String s4; + char c0; + + if (p_150316_1_.startsWith("{")) + { + if (!p_150316_1_.endsWith("}")) + { + throw new NBTException("Unable to locate ending bracket for: " + p_150316_1_); + } + else + { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.Compound compound = new JsonToNBT.Compound(p_150316_0_); + + while (p_150316_1_.length() > 0) + { + s2 = func_150314_a(p_150316_1_, false); + + if (s2.length() > 0) + { + s3 = func_150313_b(s2, false); + s4 = func_150311_c(s2, false); + compound.field_150491_b.add(func_150316_a(s3, s4)); + + if (p_150316_1_.length() < s2.length() + 1) + { + break; + } + + c0 = p_150316_1_.charAt(s2.length()); + + if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93) + { + throw new NBTException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s2.length())); + } + + p_150316_1_ = p_150316_1_.substring(s2.length() + 1); + } + } + + return compound; + } + } + else if (p_150316_1_.startsWith("[") && !p_150316_1_.matches("\\[[-\\d|,\\s]+\\]")) + { + if (!p_150316_1_.endsWith("]")) + { + throw new NBTException("Unable to locate ending bracket for: " + p_150316_1_); + } + else + { + p_150316_1_ = p_150316_1_.substring(1, p_150316_1_.length() - 1); + JsonToNBT.List list = new JsonToNBT.List(p_150316_0_); + + while (p_150316_1_.length() > 0) + { + s2 = func_150314_a(p_150316_1_, true); + + if (s2.length() > 0) + { + s3 = func_150313_b(s2, true); + s4 = func_150311_c(s2, true); + list.field_150492_b.add(func_150316_a(s3, s4)); + + if (p_150316_1_.length() < s2.length() + 1) + { + break; + } + + c0 = p_150316_1_.charAt(s2.length()); + + if (c0 != 44 && c0 != 123 && c0 != 125 && c0 != 91 && c0 != 93) + { + throw new NBTException("Unexpected token \'" + c0 + "\' at: " + p_150316_1_.substring(s2.length())); + } + + p_150316_1_ = p_150316_1_.substring(s2.length() + 1); + } + else + { + logger.debug(p_150316_1_); + } + } + + return list; + } + } + else + { + return new JsonToNBT.Primitive(p_150316_0_, p_150316_1_); + } + } + + private static String func_150314_a(String p_150314_0_, boolean p_150314_1_) throws NBTException + { + int i = func_150312_a(p_150314_0_, ':'); + + if (i < 0 && !p_150314_1_) + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150314_0_); + } + else + { + int j = func_150312_a(p_150314_0_, ','); + + if (j >= 0 && j < i && !p_150314_1_) + { + throw new NBTException("Name error at: " + p_150314_0_); + } + else + { + if (p_150314_1_ && (i < 0 || i > j)) + { + i = -1; + } + + Stack stack = new Stack(); + int k = i + 1; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + + for (int l = 0; k < p_150314_0_.length(); ++k) + { + char c0 = p_150314_0_.charAt(k); + + if (c0 == 34) + { + if (k > 0 && p_150314_0_.charAt(k - 1) == 92) + { + if (!flag1) + { + throw new NBTException("Illegal use of \\\": " + p_150314_0_); + } + } + else + { + flag1 = !flag1; + + if (flag1 && !flag3) + { + flag2 = true; + } + + if (!flag1) + { + l = k; + } + } + } + else if (!flag1) + { + if (c0 != 123 && c0 != 91) + { + if (c0 == 125 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 123)) + { + throw new NBTException("Unbalanced curly brackets {}: " + p_150314_0_); + } + + if (c0 == 93 && (stack.isEmpty() || ((Character)stack.pop()).charValue() != 91)) + { + throw new NBTException("Unbalanced square brackets []: " + p_150314_0_); + } + + if (c0 == 44 && stack.isEmpty()) + { + return p_150314_0_.substring(0, k); + } + } + else + { + stack.push(Character.valueOf(c0)); + } + } + + if (!Character.isWhitespace(c0)) + { + if (!flag1 && flag2 && l != k) + { + return p_150314_0_.substring(0, l + 1); + } + + flag3 = true; + } + } + + return p_150314_0_.substring(0, k); + } + } + } + + private static String func_150313_b(String p_150313_0_, boolean p_150313_1_) throws NBTException + { + if (p_150313_1_) + { + p_150313_0_ = p_150313_0_.trim(); + + if (p_150313_0_.startsWith("{") || p_150313_0_.startsWith("[")) + { + return ""; + } + } + + int i = p_150313_0_.indexOf(58); + + if (i < 0) + { + if (p_150313_1_) + { + return ""; + } + else + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150313_0_); + } + } + else + { + return p_150313_0_.substring(0, i).trim(); + } + } + + private static String func_150311_c(String p_150311_0_, boolean p_150311_1_) throws NBTException + { + if (p_150311_1_) + { + p_150311_0_ = p_150311_0_.trim(); + + if (p_150311_0_.startsWith("{") || p_150311_0_.startsWith("[")) + { + return p_150311_0_; + } + } + + int i = p_150311_0_.indexOf(58); + + if (i < 0) + { + if (p_150311_1_) + { + return p_150311_0_; + } + else + { + throw new NBTException("Unable to locate name/value separator for string: " + p_150311_0_); + } + } + else + { + return p_150311_0_.substring(i + 1).trim(); + } + } + + private static int func_150312_a(String p_150312_0_, char p_150312_1_) + { + int i = 0; + + for (boolean flag = false; i < p_150312_0_.length(); ++i) + { + char c1 = p_150312_0_.charAt(i); + + if (c1 == 34) + { + if (i <= 0 || p_150312_0_.charAt(i - 1) != 92) + { + flag = !flag; + } + } + else if (!flag) + { + if (c1 == p_150312_1_) + { + return i; + } + + if (c1 == 123 || c1 == 91) + { + return -1; + } + } + } + + return -1; + } + + abstract static class Any + { + protected String field_150490_a; + private static final String __OBFID = "CL_00001233"; + + public abstract NBTBase func_150489_a(); + } + + static class Compound extends JsonToNBT.Any + { + protected ArrayList field_150491_b = new ArrayList(); + private static final String __OBFID = "CL_00001234"; + + public Compound(String p_i45137_1_) + { + this.field_150490_a = p_i45137_1_; + } + + public NBTBase func_150489_a() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + Iterator iterator = this.field_150491_b.iterator(); + + while (iterator.hasNext()) + { + JsonToNBT.Any any = (JsonToNBT.Any)iterator.next(); + nbttagcompound.setTag(any.field_150490_a, any.func_150489_a()); + } + + return nbttagcompound; + } + } + + static class List extends JsonToNBT.Any + { + protected ArrayList field_150492_b = new ArrayList(); + private static final String __OBFID = "CL_00001235"; + + public List(String p_i45138_1_) + { + this.field_150490_a = p_i45138_1_; + } + + public NBTBase func_150489_a() + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.field_150492_b.iterator(); + + while (iterator.hasNext()) + { + JsonToNBT.Any any = (JsonToNBT.Any)iterator.next(); + nbttaglist.appendTag(any.func_150489_a()); + } + + return nbttaglist; + } + } + + static class Primitive extends JsonToNBT.Any + { + protected String field_150493_b; + private static final String __OBFID = "CL_00001236"; + + public Primitive(String p_i45139_1_, String p_i45139_2_) + { + this.field_150490_a = p_i45139_1_; + this.field_150493_b = p_i45139_2_; + } + + public NBTBase func_150489_a() + { + try + { + if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+[d|D]")) + { + return new NBTTagDouble(Double.parseDouble(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+[f|F]")) + { + return new NBTTagFloat(Float.parseFloat(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]+[b|B]")) + { + return new NBTTagByte(Byte.parseByte(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]+[l|L]")) + { + return new NBTTagLong(Long.parseLong(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]+[s|S]")) + { + return new NBTTagShort(Short.parseShort(this.field_150493_b.substring(0, this.field_150493_b.length() - 1))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]+")) + { + return new NBTTagInt(Integer.parseInt(this.field_150493_b.substring(0, this.field_150493_b.length()))); + } + else if (this.field_150493_b.matches("[-+]?[0-9]*\\.?[0-9]+")) + { + return new NBTTagDouble(Double.parseDouble(this.field_150493_b.substring(0, this.field_150493_b.length()))); + } + else if (!this.field_150493_b.equalsIgnoreCase("true") && !this.field_150493_b.equalsIgnoreCase("false")) + { + if (this.field_150493_b.startsWith("[") && this.field_150493_b.endsWith("]")) + { + if (this.field_150493_b.length() > 2) + { + String s = this.field_150493_b.substring(1, this.field_150493_b.length() - 1); + String[] astring = s.split(","); + + try + { + if (astring.length <= 1) + { + return new NBTTagIntArray(new int[] {Integer.parseInt(s.trim())}); + } + else + { + int[] aint = new int[astring.length]; + + for (int i = 0; i < astring.length; ++i) + { + aint[i] = Integer.parseInt(astring[i].trim()); + } + + return new NBTTagIntArray(aint); + } + } + catch (NumberFormatException numberformatexception) + { + return new NBTTagString(this.field_150493_b); + } + } + else + { + return new NBTTagIntArray(); + } + } + else + { + if (this.field_150493_b.startsWith("\"") && this.field_150493_b.endsWith("\"") && this.field_150493_b.length() > 2) + { + this.field_150493_b = this.field_150493_b.substring(1, this.field_150493_b.length() - 1); + } + + this.field_150493_b = this.field_150493_b.replaceAll("\\\\\"", "\""); + return new NBTTagString(this.field_150493_b); + } + } + else + { + return new NBTTagByte((byte)(Boolean.parseBoolean(this.field_150493_b) ? 1 : 0)); + } + } + catch (NumberFormatException numberformatexception1) + { + this.field_150493_b = this.field_150493_b.replaceAll("\\\\\"", "\""); + return new NBTTagString(this.field_150493_b); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTBase.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTBase.java new file mode 100644 index 0000000..c7f2314 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTBase.java @@ -0,0 +1,103 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public abstract class NBTBase +{ + public static final String[] NBTTypes = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; + private static final String __OBFID = "CL_00001229"; + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + abstract void write(DataOutput output) throws IOException; + + abstract void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException; + + public abstract String toString(); + + /** + * Gets the type byte for the tag. + */ + public abstract byte getId(); + + protected static NBTBase func_150284_a(byte id) + { + switch (id) + { + case 0: + return new NBTTagEnd(); + case 1: + return new NBTTagByte(); + case 2: + return new NBTTagShort(); + case 3: + return new NBTTagInt(); + case 4: + return new NBTTagLong(); + case 5: + return new NBTTagFloat(); + case 6: + return new NBTTagDouble(); + case 7: + return new NBTTagByteArray(); + case 8: + return new NBTTagString(); + case 9: + return new NBTTagList(); + case 10: + return new NBTTagCompound(); + case 11: + return new NBTTagIntArray(); + default: + return null; + } + } + + /** + * Creates a clone of the tag. + */ + public abstract NBTBase copy(); + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof NBTBase)) + { + return false; + } + else + { + NBTBase nbtbase = (NBTBase)p_equals_1_; + return this.getId() == nbtbase.getId(); + } + } + + public int hashCode() + { + return this.getId(); + } + + protected String func_150285_a_() + { + return this.toString(); + } + + public abstract static class NBTPrimitive extends NBTBase + { + private static final String __OBFID = "CL_00001230"; + + public abstract long func_150291_c(); + + public abstract int func_150287_d(); + + public abstract short func_150289_e(); + + public abstract byte func_150290_f(); + + public abstract double func_150286_g(); + + public abstract float func_150288_h(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTException.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTException.java new file mode 100644 index 0000000..eee4b7a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTException.java @@ -0,0 +1,11 @@ +package net.minecraft.nbt; + +public class NBTException extends Exception +{ + private static final String __OBFID = "CL_00001231"; + + public NBTException(String p_i45136_1_) + { + super(p_i45136_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTSizeTracker.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTSizeTracker.java new file mode 100644 index 0000000..856b6f5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTSizeTracker.java @@ -0,0 +1,58 @@ +package net.minecraft.nbt; + +public class NBTSizeTracker +{ + public static final NBTSizeTracker field_152451_a = new NBTSizeTracker(0L) + { + private static final String __OBFID = "CL_00001902"; + public void func_152450_a(long size) {} + }; + private final long field_152452_b; + private long field_152453_c; + private static final String __OBFID = "CL_00001903"; + + public NBTSizeTracker(long worldIn) + { + this.field_152452_b = worldIn; + } + + public void func_152450_a(long size) + { + this.field_152453_c += size / 8L; + + if (this.field_152453_c > this.field_152452_b) + { + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); + } + } + + /* + * UTF8 is not a simple encoding system, each character can be either + * 1, 2, or 3 bytes. Depending on where it's numerical value falls. + * We have to count up each character individually to see the true + * length of the data. + * + * Basic concept is that it uses the MSB of each byte as a 'read more' signal. + * So it has to shift each 7-bit segment. + * + * This will accurately count the correct byte length to encode this string, plus the 2 bytes for it's length prefix. + */ + public static void readUTF(NBTSizeTracker tracker, String data) + { + tracker.func_152450_a(16); //Header length + if (data == null) + return; + + int len = data.length(); + int utflen = 0; + + for (int i = 0; i < len; i++) + { + int c = data.charAt(i); + if ((c >= 0x0001) && (c <= 0x007F)) utflen += 1; + else if (c > 0x07FF) utflen += 3; + else utflen += 2; + } + tracker.func_152450_a(8 * utflen); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByte.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByte.java new file mode 100644 index 0000000..8ff00aa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByte.java @@ -0,0 +1,102 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagByte extends NBTBase.NBTPrimitive +{ + /** The byte value for the tag. */ + private byte data; + private static final String __OBFID = "CL_00001214"; + + NBTTagByte() {} + + public NBTTagByte(byte p_i45129_1_) + { + this.data = p_i45129_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeByte(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(8L); + this.data = input.readByte(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)1; + } + + public String toString() + { + return "" + this.data + "b"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagByte(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagByte nbttagbyte = (NBTTagByte)p_equals_1_; + return this.data == nbttagbyte.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() + { + return (long)this.data; + } + + public int func_150287_d() + { + return this.data; + } + + public short func_150289_e() + { + return (short)this.data; + } + + public byte func_150290_f() + { + return this.data; + } + + public double func_150286_g() + { + return (double)this.data; + } + + public float func_150288_h() + { + return (float)this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByteArray.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByteArray.java new file mode 100644 index 0000000..93fcc3d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagByteArray.java @@ -0,0 +1,76 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagByteArray extends NBTBase +{ + /** The byte array stored in the tag. */ + private byte[] byteArray; + private static final String __OBFID = "CL_00001213"; + + NBTTagByteArray() {} + + public NBTTagByteArray(byte[] p_i45128_1_) + { + this.byteArray = p_i45128_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeInt(this.byteArray.length); + output.write(this.byteArray); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(32); //Forge: Count the length as well + int j = input.readInt(); + sizeTracker.func_152450_a((long)(8 * j)); + this.byteArray = new byte[j]; + input.readFully(this.byteArray); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)7; + } + + public String toString() + { + return "[" + this.byteArray.length + " bytes]"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + byte[] abyte = new byte[this.byteArray.length]; + System.arraycopy(this.byteArray, 0, abyte, 0, this.byteArray.length); + return new NBTTagByteArray(abyte); + } + + public boolean equals(Object p_equals_1_) + { + return super.equals(p_equals_1_) ? Arrays.equals(this.byteArray, ((NBTTagByteArray)p_equals_1_).byteArray) : false; + } + + public int hashCode() + { + return super.hashCode() ^ Arrays.hashCode(this.byteArray); + } + + public byte[] func_150292_c() + { + return this.byteArray; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagCompound.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagCompound.java new file mode 100644 index 0000000..9a12d1b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagCompound.java @@ -0,0 +1,506 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NBTTagCompound extends NBTBase +{ + private static final Logger logger = LogManager.getLogger(); + /** The key-value pairs for the tag. Each key is a UTF string, each value is a tag. */ + private Map tagMap = new HashMap(); + private static final String __OBFID = "CL_00001215"; + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + Iterator iterator = this.tagMap.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTBase nbtbase = (NBTBase)this.tagMap.get(s); + func_150298_a(s, nbtbase, output); + } + + output.writeByte(0); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + if (depth > 512) + { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } + else + { + this.tagMap.clear(); + byte b0; + + while ((b0 = func_152447_a(input, sizeTracker)) != 0) + { + String s = func_152448_b(input, sizeTracker); + NBTSizeTracker.readUTF(sizeTracker, s); // Forge: Correctly read String length including header. + NBTBase nbtbase = func_152449_a(b0, s, input, depth + 1, sizeTracker); + this.tagMap.put(s, nbtbase); + } + } + } + + public Set func_150296_c() + { + return this.tagMap.keySet(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)10; + } + + /** + * Stores the given tag into the map with the given string key. This is mostly used to store tag lists. + */ + public void setTag(String key, NBTBase value) + { + this.tagMap.put(key, value); + } + + /** + * Stores a new NBTTagByte with the given byte value into the map with the given string key. + */ + public void setByte(String key, byte value) + { + this.tagMap.put(key, new NBTTagByte(value)); + } + + /** + * Stores a new NBTTagShort with the given short value into the map with the given string key. + */ + public void setShort(String key, short value) + { + this.tagMap.put(key, new NBTTagShort(value)); + } + + /** + * Stores a new NBTTagInt with the given integer value into the map with the given string key. + */ + public void setInteger(String key, int value) + { + this.tagMap.put(key, new NBTTagInt(value)); + } + + /** + * Stores a new NBTTagLong with the given long value into the map with the given string key. + */ + public void setLong(String key, long value) + { + this.tagMap.put(key, new NBTTagLong(value)); + } + + /** + * Stores a new NBTTagFloat with the given float value into the map with the given string key. + */ + public void setFloat(String key, float value) + { + this.tagMap.put(key, new NBTTagFloat(value)); + } + + /** + * Stores a new NBTTagDouble with the given double value into the map with the given string key. + */ + public void setDouble(String key, double value) + { + this.tagMap.put(key, new NBTTagDouble(value)); + } + + /** + * Stores a new NBTTagString with the given string value into the map with the given string key. + */ + public void setString(String key, String value) + { + this.tagMap.put(key, new NBTTagString(value)); + } + + /** + * Stores a new NBTTagByteArray with the given array as data into the map with the given string key. + */ + public void setByteArray(String key, byte[] value) + { + this.tagMap.put(key, new NBTTagByteArray(value)); + } + + /** + * Stores a new NBTTagIntArray with the given array as data into the map with the given string key. + */ + public void setIntArray(String key, int[] value) + { + this.tagMap.put(key, new NBTTagIntArray(value)); + } + + /** + * Stores the given boolean value as a NBTTagByte, storing 1 for true and 0 for false, using the given string key. + */ + public void setBoolean(String key, boolean value) + { + this.setByte(key, (byte)(value ? 1 : 0)); + } + + /** + * gets a generic tag with the specified name + */ + public NBTBase getTag(String key) + { + return (NBTBase)this.tagMap.get(key); + } + + public byte func_150299_b(String key) + { + NBTBase nbtbase = (NBTBase)this.tagMap.get(key); + return nbtbase != null ? nbtbase.getId() : 0; + } + + /** + * Returns whether the given string has been previously stored as a key in the map. + */ + public boolean hasKey(String key) + { + return this.tagMap.containsKey(key); + } + + public boolean hasKey(String key, int type) + { + byte b0 = this.func_150299_b(key); + return b0 == type ? true : (type != 99 ? false : b0 == 1 || b0 == 2 || b0 == 3 || b0 == 4 || b0 == 5 || b0 == 6); + } + + /** + * Retrieves a byte value using the specified key, or 0 if no such key was stored. + */ + public byte getByte(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150290_f(); + } + catch (ClassCastException classcastexception) + { + return (byte)0; + } + } + + /** + * Retrieves a short value using the specified key, or 0 if no such key was stored. + */ + public short getShort(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150289_e(); + } + catch (ClassCastException classcastexception) + { + return (short)0; + } + } + + /** + * Retrieves an integer value using the specified key, or 0 if no such key was stored. + */ + public int getInteger(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0 : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150287_d(); + } + catch (ClassCastException classcastexception) + { + return 0; + } + } + + /** + * Retrieves a long value using the specified key, or 0 if no such key was stored. + */ + public long getLong(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0L : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150291_c(); + } + catch (ClassCastException classcastexception) + { + return 0L; + } + } + + /** + * Retrieves a float value using the specified key, or 0 if no such key was stored. + */ + public float getFloat(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0.0F : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150288_h(); + } + catch (ClassCastException classcastexception) + { + return 0.0F; + } + } + + /** + * Retrieves a double value using the specified key, or 0 if no such key was stored. + */ + public double getDouble(String key) + { + try + { + return !this.tagMap.containsKey(key) ? 0.0D : ((NBTBase.NBTPrimitive)this.tagMap.get(key)).func_150286_g(); + } + catch (ClassCastException classcastexception) + { + return 0.0D; + } + } + + /** + * Retrieves a string value using the specified key, or an empty string if no such key was stored. + */ + public String getString(String key) + { + try + { + return !this.tagMap.containsKey(key) ? "" : ((NBTBase)this.tagMap.get(key)).func_150285_a_(); + } + catch (ClassCastException classcastexception) + { + return ""; + } + } + + /** + * Retrieves a byte array using the specified key, or a zero-length array if no such key was stored. + */ + public byte[] getByteArray(String key) + { + try + { + return !this.tagMap.containsKey(key) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(key)).func_150292_c(); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 7, classcastexception)); + } + } + + /** + * Retrieves an int array using the specified key, or a zero-length array if no such key was stored. + */ + public int[] getIntArray(String key) + { + try + { + return !this.tagMap.containsKey(key) ? new int[0] : ((NBTTagIntArray)this.tagMap.get(key)).func_150302_c(); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 11, classcastexception)); + } + } + + /** + * Retrieves a NBTTagCompound subtag matching the specified key, or a new empty NBTTagCompound if no such key was + * stored. + */ + public NBTTagCompound getCompoundTag(String key) + { + try + { + return !this.tagMap.containsKey(key) ? new NBTTagCompound() : (NBTTagCompound)this.tagMap.get(key); + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 10, classcastexception)); + } + } + + /** + * Gets the NBTTagList object with the given name. Args: name, NBTBase type + */ + public NBTTagList getTagList(String key, int type) + { + try + { + if (this.func_150299_b(key) != 9) + { + return new NBTTagList(); + } + else + { + NBTTagList nbttaglist = (NBTTagList)this.tagMap.get(key); + return nbttaglist.tagCount() > 0 && nbttaglist.func_150303_d() != type ? new NBTTagList() : nbttaglist; + } + } + catch (ClassCastException classcastexception) + { + throw new ReportedException(this.createCrashReport(key, 9, classcastexception)); + } + } + + /** + * Retrieves a boolean value using the specified key, or false if no such key was stored. This uses the getByte + * method. + */ + public boolean getBoolean(String key) + { + return this.getByte(key) != 0; + } + + /** + * Remove the specified tag. + */ + public void removeTag(String key) + { + this.tagMap.remove(key); + } + + public String toString() + { + String s = "{"; + String s1; + + for (Iterator iterator = this.tagMap.keySet().iterator(); iterator.hasNext(); s = s + s1 + ':' + this.tagMap.get(s1) + ',') + { + s1 = (String)iterator.next(); + } + + return s + "}"; + } + + /** + * Return whether this compound has no tags. + */ + public boolean hasNoTags() + { + return this.tagMap.isEmpty(); + } + + /** + * Create a crash report which indicates a NBT read error. + */ + private CrashReport createCrashReport(final String p_82581_1_, final int p_82581_2_, ClassCastException p_82581_3_) + { + CrashReport crashreport = CrashReport.makeCrashReport(p_82581_3_, "Reading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategoryDepth("Corrupt NBT tag", 1); + crashreportcategory.addCrashSectionCallable("Tag type found", new Callable() + { + private static final String __OBFID = "CL_00001216"; + public String call() + { + return NBTBase.NBTTypes[((NBTBase)NBTTagCompound.this.tagMap.get(p_82581_1_)).getId()]; + } + }); + crashreportcategory.addCrashSectionCallable("Tag type expected", new Callable() + { + private static final String __OBFID = "CL_00001217"; + public String call() + { + return NBTBase.NBTTypes[p_82581_2_]; + } + }); + crashreportcategory.addCrashSection("Tag name", p_82581_1_); + return crashreport; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + Iterator iterator = this.tagMap.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + nbttagcompound.setTag(s, ((NBTBase)this.tagMap.get(s)).copy()); + } + + return nbttagcompound; + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagCompound nbttagcompound = (NBTTagCompound)p_equals_1_; + return this.tagMap.entrySet().equals(nbttagcompound.tagMap.entrySet()); + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.tagMap.hashCode(); + } + + private static void func_150298_a(String name, NBTBase data, DataOutput output) throws IOException + { + output.writeByte(data.getId()); + + if (data.getId() != 0) + { + output.writeUTF(name); + data.write(output); + } + } + + private static byte func_152447_a(DataInput input, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(8); + return input.readByte(); + } + + private static String func_152448_b(DataInput input, NBTSizeTracker sizeTracker) throws IOException + { + return input.readUTF(); + } + + static NBTBase func_152449_a(byte id, String key, DataInput input, int depth, NBTSizeTracker sizeTracker) + { + sizeTracker.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(id); + + try + { + nbtbase.func_152446_a(input, depth, sizeTracker); + return nbtbase; + } + catch (IOException ioexception) + { + CrashReport crashreport = CrashReport.makeCrashReport(ioexception, "Loading NBT data"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("NBT Tag"); + crashreportcategory.addCrashSection("Tag name", key); + crashreportcategory.addCrashSection("Tag type", Byte.valueOf(id)); + throw new ReportedException(crashreport); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagDouble.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagDouble.java new file mode 100644 index 0000000..8acd75b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagDouble.java @@ -0,0 +1,104 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagDouble extends NBTBase.NBTPrimitive +{ + /** The double value for the tag. */ + private double data; + private static final String __OBFID = "CL_00001218"; + + NBTTagDouble() {} + + public NBTTagDouble(double p_i45130_1_) + { + this.data = p_i45130_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeDouble(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(64L); + this.data = input.readDouble(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)6; + } + + public String toString() + { + return "" + this.data + "d"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagDouble(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagDouble nbttagdouble = (NBTTagDouble)p_equals_1_; + return this.data == nbttagdouble.data; + } + else + { + return false; + } + } + + public int hashCode() + { + long i = Double.doubleToLongBits(this.data); + return super.hashCode() ^ (int)(i ^ i >>> 32); + } + + public long func_150291_c() + { + return (long)Math.floor(this.data); + } + + public int func_150287_d() + { + return MathHelper.floor_double(this.data); + } + + public short func_150289_e() + { + return (short)(MathHelper.floor_double(this.data) & 65535); + } + + public byte func_150290_f() + { + return (byte)(MathHelper.floor_double(this.data) & 255); + } + + public double func_150286_g() + { + return this.data; + } + + public float func_150288_h() + { + return (float)this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagEnd.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagEnd.java new file mode 100644 index 0000000..17c554b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagEnd.java @@ -0,0 +1,38 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagEnd extends NBTBase +{ + private static final String __OBFID = "CL_00001219"; + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException {} + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException {} + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)0; + } + + public String toString() + { + return "END"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagEnd(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagFloat.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagFloat.java new file mode 100644 index 0000000..db5584c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagFloat.java @@ -0,0 +1,103 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import net.minecraft.util.MathHelper; + +public class NBTTagFloat extends NBTBase.NBTPrimitive +{ + /** The float value for the tag. */ + private float data; + private static final String __OBFID = "CL_00001220"; + + NBTTagFloat() {} + + public NBTTagFloat(float p_i45131_1_) + { + this.data = p_i45131_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeFloat(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(32L); + this.data = input.readFloat(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)5; + } + + public String toString() + { + return "" + this.data + "f"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagFloat(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagFloat nbttagfloat = (NBTTagFloat)p_equals_1_; + return this.data == nbttagfloat.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ Float.floatToIntBits(this.data); + } + + public long func_150291_c() + { + return (long)this.data; + } + + public int func_150287_d() + { + return MathHelper.floor_float(this.data); + } + + public short func_150289_e() + { + return (short)(MathHelper.floor_float(this.data) & 65535); + } + + public byte func_150290_f() + { + return (byte)(MathHelper.floor_float(this.data) & 255); + } + + public double func_150286_g() + { + return (double)this.data; + } + + public float func_150288_h() + { + return this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagInt.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagInt.java new file mode 100644 index 0000000..ae794c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagInt.java @@ -0,0 +1,102 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagInt extends NBTBase.NBTPrimitive +{ + /** The integer value for the tag. */ + private int data; + private static final String __OBFID = "CL_00001223"; + + NBTTagInt() {} + + public NBTTagInt(int p_i45133_1_) + { + this.data = p_i45133_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeInt(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(32L); + this.data = input.readInt(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)3; + } + + public String toString() + { + return "" + this.data; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagInt(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagInt nbttagint = (NBTTagInt)p_equals_1_; + return this.data == nbttagint.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() + { + return (long)this.data; + } + + public int func_150287_d() + { + return this.data; + } + + public short func_150289_e() + { + return (short)(this.data & 65535); + } + + public byte func_150290_f() + { + return (byte)(this.data & 255); + } + + public double func_150286_g() + { + return (double)this.data; + } + + public float func_150288_h() + { + return (float)this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagIntArray.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagIntArray.java new file mode 100644 index 0000000..06c5525 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagIntArray.java @@ -0,0 +1,94 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.Arrays; + +public class NBTTagIntArray extends NBTBase +{ + /** The array of saved integers */ + private int[] intArray; + private static final String __OBFID = "CL_00001221"; + + NBTTagIntArray() {} + + public NBTTagIntArray(int[] p_i45132_1_) + { + this.intArray = p_i45132_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeInt(this.intArray.length); + + for (int i = 0; i < this.intArray.length; ++i) + { + output.writeInt(this.intArray[i]); + } + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(32); //Forge: Count the length as well + int j = input.readInt(); + sizeTracker.func_152450_a((long)(32 * j)); + this.intArray = new int[j]; + + for (int k = 0; k < j; ++k) + { + this.intArray[k] = input.readInt(); + } + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)11; + } + + public String toString() + { + String s = "["; + int[] aint = this.intArray; + int i = aint.length; + + for (int j = 0; j < i; ++j) + { + int k = aint[j]; + s = s + k + ","; + } + + return s + "]"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + int[] aint = new int[this.intArray.length]; + System.arraycopy(this.intArray, 0, aint, 0, this.intArray.length); + return new NBTTagIntArray(aint); + } + + public boolean equals(Object p_equals_1_) + { + return super.equals(p_equals_1_) ? Arrays.equals(this.intArray, ((NBTTagIntArray)p_equals_1_).intArray) : false; + } + + public int hashCode() + { + return super.hashCode() ^ Arrays.hashCode(this.intArray); + } + + public int[] func_150302_c() + { + return this.intArray; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagList.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagList.java new file mode 100644 index 0000000..de671be --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagList.java @@ -0,0 +1,258 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class NBTTagList extends NBTBase +{ + /** The array list containing the tags encapsulated in this list. */ + private List tagList = new ArrayList(); + /** The type byte for the tags in the list - they must all be of the same type. */ + private byte tagType = 0; + private static final String __OBFID = "CL_00001224"; + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + if (!this.tagList.isEmpty()) + { + this.tagType = ((NBTBase)this.tagList.get(0)).getId(); + } + else + { + this.tagType = 0; + } + + output.writeByte(this.tagType); + output.writeInt(this.tagList.size()); + + for (int i = 0; i < this.tagList.size(); ++i) + { + ((NBTBase)this.tagList.get(i)).write(output); + } + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + if (depth > 512) + { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } + else + { + sizeTracker.func_152450_a(8L); + this.tagType = input.readByte(); + sizeTracker.func_152450_a(32); //Forge: Count the length as well + int j = input.readInt(); + this.tagList = new ArrayList(); + + for (int k = 0; k < j; ++k) + { + sizeTracker.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(this.tagType); + nbtbase.func_152446_a(input, depth + 1, sizeTracker); + this.tagList.add(nbtbase); + } + } + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)9; + } + + public String toString() + { + String s = "["; + int i = 0; + + for (Iterator iterator = this.tagList.iterator(); iterator.hasNext(); ++i) + { + NBTBase nbtbase = (NBTBase)iterator.next(); + s = s + "" + i + ':' + nbtbase + ','; + } + + return s + "]"; + } + + /** + * Adds the provided tag to the end of the list. There is no check to verify this tag is of the same type as any + * previous tag. + */ + public void appendTag(NBTBase p_74742_1_) + { + if (this.tagType == 0) + { + this.tagType = p_74742_1_.getId(); + } + else if (this.tagType != p_74742_1_.getId()) + { + System.err.println("WARNING: Adding mismatching tag types to tag list"); + return; + } + + this.tagList.add(p_74742_1_); + } + + public void func_150304_a(int i, NBTBase p_150304_2_) + { + if (i >= 0 && i < this.tagList.size()) + { + if (this.tagType == 0) + { + this.tagType = p_150304_2_.getId(); + } + else if (this.tagType != p_150304_2_.getId()) + { + System.err.println("WARNING: Adding mismatching tag types to tag list"); + return; + } + + this.tagList.set(i, p_150304_2_); + } + else + { + System.err.println("WARNING: index out of bounds to set tag in tag list"); + } + } + + /** + * Removes a tag at the given index. + */ + public NBTBase removeTag(int i) + { + return (NBTBase)this.tagList.remove(i); + } + + /** + * Retrieves the NBTTagCompound at the specified index in the list + */ + public NBTTagCompound getCompoundTagAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 10 ? (NBTTagCompound)nbtbase : new NBTTagCompound(); + } + else + { + return new NBTTagCompound(); + } + } + + public int[] func_150306_c(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 11 ? ((NBTTagIntArray)nbtbase).func_150302_c() : new int[0]; + } + else + { + return new int[0]; + } + } + + public double func_150309_d(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 6 ? ((NBTTagDouble)nbtbase).func_150286_g() : 0.0D; + } + else + { + return 0.0D; + } + } + + public float func_150308_e(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 5 ? ((NBTTagFloat)nbtbase).func_150288_h() : 0.0F; + } + else + { + return 0.0F; + } + } + + /** + * Retrieves the tag String value at the specified index in the list + */ + public String getStringTagAt(int i) + { + if (i >= 0 && i < this.tagList.size()) + { + NBTBase nbtbase = (NBTBase)this.tagList.get(i); + return nbtbase.getId() == 8 ? nbtbase.func_150285_a_() : nbtbase.toString(); + } + else + { + return ""; + } + } + + /** + * Returns the number of tags in the list. + */ + public int tagCount() + { + return this.tagList.size(); + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + NBTTagList nbttaglist = new NBTTagList(); + nbttaglist.tagType = this.tagType; + Iterator iterator = this.tagList.iterator(); + + while (iterator.hasNext()) + { + NBTBase nbtbase = (NBTBase)iterator.next(); + NBTBase nbtbase1 = nbtbase.copy(); + nbttaglist.tagList.add(nbtbase1); + } + + return nbttaglist; + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagList nbttaglist = (NBTTagList)p_equals_1_; + + if (this.tagType == nbttaglist.tagType) + { + return this.tagList.equals(nbttaglist.tagList); + } + } + + return false; + } + + public int hashCode() + { + return super.hashCode() ^ this.tagList.hashCode(); + } + + public int func_150303_d() + { + return this.tagType; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagLong.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagLong.java new file mode 100644 index 0000000..b50b957 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagLong.java @@ -0,0 +1,102 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagLong extends NBTBase.NBTPrimitive +{ + /** The long value for the tag. */ + private long data; + private static final String __OBFID = "CL_00001225"; + + NBTTagLong() {} + + public NBTTagLong(long p_i45134_1_) + { + this.data = p_i45134_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeLong(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(64L); + this.data = input.readLong(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)4; + } + + public String toString() + { + return "" + this.data + "L"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagLong(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagLong nbttaglong = (NBTTagLong)p_equals_1_; + return this.data == nbttaglong.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ (int)(this.data ^ this.data >>> 32); + } + + public long func_150291_c() + { + return this.data; + } + + public int func_150287_d() + { + return (int)(this.data & -1L); + } + + public short func_150289_e() + { + return (short)((int)(this.data & 65535L)); + } + + public byte func_150290_f() + { + return (byte)((int)(this.data & 255L)); + } + + public double func_150286_g() + { + return (double)this.data; + } + + public float func_150288_h() + { + return (float)this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagShort.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagShort.java new file mode 100644 index 0000000..1d6f0fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagShort.java @@ -0,0 +1,102 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagShort extends NBTBase.NBTPrimitive +{ + /** The short value for the tag. */ + private short data; + private static final String __OBFID = "CL_00001227"; + + public NBTTagShort() {} + + public NBTTagShort(short p_i45135_1_) + { + this.data = p_i45135_1_; + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeShort(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + sizeTracker.func_152450_a(16L); + this.data = input.readShort(); + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)2; + } + + public String toString() + { + return "" + this.data + "s"; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagShort(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (super.equals(p_equals_1_)) + { + NBTTagShort nbttagshort = (NBTTagShort)p_equals_1_; + return this.data == nbttagshort.data; + } + else + { + return false; + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data; + } + + public long func_150291_c() + { + return (long)this.data; + } + + public int func_150287_d() + { + return this.data; + } + + public short func_150289_e() + { + return this.data; + } + + public byte func_150290_f() + { + return (byte)(this.data & 255); + } + + public double func_150286_g() + { + return (double)this.data; + } + + public float func_150288_h() + { + return (float)this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagString.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagString.java new file mode 100644 index 0000000..4623a22 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTTagString.java @@ -0,0 +1,85 @@ +package net.minecraft.nbt; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +public class NBTTagString extends NBTBase +{ + /** The string value for the tag (cannot be empty). */ + private String data; + private static final String __OBFID = "CL_00001228"; + + public NBTTagString() + { + this.data = ""; + } + + public NBTTagString(String p_i1389_1_) + { + this.data = p_i1389_1_; + + if (p_i1389_1_ == null) + { + throw new IllegalArgumentException("Empty string not allowed"); + } + } + + /** + * Write the actual data contents of the tag, implemented in NBT extension classes + */ + void write(DataOutput output) throws IOException + { + output.writeUTF(this.data); + } + + void func_152446_a(DataInput input, int depth, NBTSizeTracker sizeTracker) throws IOException + { + this.data = input.readUTF(); + NBTSizeTracker.readUTF(sizeTracker, data); // Forge: Correctly read String length including header. + } + + /** + * Gets the type byte for the tag. + */ + public byte getId() + { + return (byte)8; + } + + public String toString() + { + return "\"" + this.data + "\""; + } + + /** + * Creates a clone of the tag. + */ + public NBTBase copy() + { + return new NBTTagString(this.data); + } + + public boolean equals(Object p_equals_1_) + { + if (!super.equals(p_equals_1_)) + { + return false; + } + else + { + NBTTagString nbttagstring = (NBTTagString)p_equals_1_; + return this.data == null && nbttagstring.data == null || this.data != null && this.data.equals(nbttagstring.data); + } + } + + public int hashCode() + { + return super.hashCode() ^ this.data.hashCode(); + } + + public String func_150285_a_() + { + return this.data; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTUtil.java b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTUtil.java new file mode 100644 index 0000000..3d5d232 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/nbt/NBTUtil.java @@ -0,0 +1,119 @@ +package net.minecraft.nbt; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import java.util.Iterator; +import java.util.UUID; +import net.minecraft.util.StringUtils; + +public final class NBTUtil +{ + private static final String __OBFID = "CL_00001901"; + + public static GameProfile func_152459_a(NBTTagCompound compound) + { + String s = null; + String s1 = null; + + if (compound.hasKey("Name", 8)) + { + s = compound.getString("Name"); + } + + if (compound.hasKey("Id", 8)) + { + s1 = compound.getString("Id"); + } + + if (StringUtils.isNullOrEmpty(s) && StringUtils.isNullOrEmpty(s1)) + { + return null; + } + else + { + UUID uuid; + + try + { + uuid = UUID.fromString(s1); + } + catch (Throwable throwable) + { + uuid = null; + } + + GameProfile gameprofile = new GameProfile(uuid, s); + + if (compound.hasKey("Properties", 10)) + { + NBTTagCompound nbttagcompound1 = compound.getCompoundTag("Properties"); + Iterator iterator = nbttagcompound1.func_150296_c().iterator(); + + while (iterator.hasNext()) + { + String s2 = (String)iterator.next(); + NBTTagList nbttaglist = nbttagcompound1.getTagList(s2, 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound2 = nbttaglist.getCompoundTagAt(i); + String s3 = nbttagcompound2.getString("Value"); + + if (nbttagcompound2.hasKey("Signature", 8)) + { + gameprofile.getProperties().put(s2, new Property(s2, s3, nbttagcompound2.getString("Signature"))); + } + else + { + gameprofile.getProperties().put(s2, new Property(s2, s3)); + } + } + } + } + + return gameprofile; + } + } + + public static void func_152460_a(NBTTagCompound compound, GameProfile profile) + { + if (!StringUtils.isNullOrEmpty(profile.getName())) + { + compound.setString("Name", profile.getName()); + } + + if (profile.getId() != null) + { + compound.setString("Id", profile.getId().toString()); + } + + if (!profile.getProperties().isEmpty()) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + Iterator iterator = profile.getProperties().keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTTagList nbttaglist = new NBTTagList(); + NBTTagCompound nbttagcompound2; + + for (Iterator iterator1 = profile.getProperties().get(s).iterator(); iterator1.hasNext(); nbttaglist.appendTag(nbttagcompound2)) + { + Property property = (Property)iterator1.next(); + nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setString("Value", property.getValue()); + + if (property.hasSignature()) + { + nbttagcompound2.setString("Signature", property.getSignature()); + } + } + + nbttagcompound1.setTag(s, nbttaglist); + } + + compound.setTag("Properties", nbttagcompound1); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/EnumConnectionState.java b/build/rfg/minecraft-src/java/net/minecraft/network/EnumConnectionState.java new file mode 100644 index 0000000..de20785 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/EnumConnectionState.java @@ -0,0 +1,356 @@ +package net.minecraft.network; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import gnu.trove.map.TIntObjectMap; +import gnu.trove.map.hash.TIntObjectHashMap; +import java.util.Iterator; +import java.util.Map; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import org.apache.logging.log4j.LogManager; + +public enum EnumConnectionState +{ + HANDSHAKING(-1) + { + private static final String __OBFID = "CL_00001247"; + { + this.func_150751_a(0, C00Handshake.class); + } + }, + PLAY(0) + { + private static final String __OBFID = "CL_00001250"; + { + this.func_150756_b(0, S00PacketKeepAlive.class); + this.func_150756_b(1, S01PacketJoinGame.class); + this.func_150756_b(2, S02PacketChat.class); + this.func_150756_b(3, S03PacketTimeUpdate.class); + this.func_150756_b(4, S04PacketEntityEquipment.class); + this.func_150756_b(5, S05PacketSpawnPosition.class); + this.func_150756_b(6, S06PacketUpdateHealth.class); + this.func_150756_b(7, S07PacketRespawn.class); + this.func_150756_b(8, S08PacketPlayerPosLook.class); + this.func_150756_b(9, S09PacketHeldItemChange.class); + this.func_150756_b(10, S0APacketUseBed.class); + this.func_150756_b(11, S0BPacketAnimation.class); + this.func_150756_b(12, S0CPacketSpawnPlayer.class); + this.func_150756_b(13, S0DPacketCollectItem.class); + this.func_150756_b(14, S0EPacketSpawnObject.class); + this.func_150756_b(15, S0FPacketSpawnMob.class); + this.func_150756_b(16, S10PacketSpawnPainting.class); + this.func_150756_b(17, S11PacketSpawnExperienceOrb.class); + this.func_150756_b(18, S12PacketEntityVelocity.class); + this.func_150756_b(19, S13PacketDestroyEntities.class); + this.func_150756_b(20, S14PacketEntity.class); + this.func_150756_b(21, S14PacketEntity.S15PacketEntityRelMove.class); + this.func_150756_b(22, S14PacketEntity.S16PacketEntityLook.class); + this.func_150756_b(23, S14PacketEntity.S17PacketEntityLookMove.class); + this.func_150756_b(24, S18PacketEntityTeleport.class); + this.func_150756_b(25, S19PacketEntityHeadLook.class); + this.func_150756_b(26, S19PacketEntityStatus.class); + this.func_150756_b(27, S1BPacketEntityAttach.class); + this.func_150756_b(28, S1CPacketEntityMetadata.class); + this.func_150756_b(29, S1DPacketEntityEffect.class); + this.func_150756_b(30, S1EPacketRemoveEntityEffect.class); + this.func_150756_b(31, S1FPacketSetExperience.class); + this.func_150756_b(32, S20PacketEntityProperties.class); + this.func_150756_b(33, S21PacketChunkData.class); + this.func_150756_b(34, S22PacketMultiBlockChange.class); + this.func_150756_b(35, S23PacketBlockChange.class); + this.func_150756_b(36, S24PacketBlockAction.class); + this.func_150756_b(37, S25PacketBlockBreakAnim.class); + this.func_150756_b(38, S26PacketMapChunkBulk.class); + this.func_150756_b(39, S27PacketExplosion.class); + this.func_150756_b(40, S28PacketEffect.class); + this.func_150756_b(41, S29PacketSoundEffect.class); + this.func_150756_b(42, S2APacketParticles.class); + this.func_150756_b(43, S2BPacketChangeGameState.class); + this.func_150756_b(44, S2CPacketSpawnGlobalEntity.class); + this.func_150756_b(45, S2DPacketOpenWindow.class); + this.func_150756_b(46, S2EPacketCloseWindow.class); + this.func_150756_b(47, S2FPacketSetSlot.class); + this.func_150756_b(48, S30PacketWindowItems.class); + this.func_150756_b(49, S31PacketWindowProperty.class); + this.func_150756_b(50, S32PacketConfirmTransaction.class); + this.func_150756_b(51, S33PacketUpdateSign.class); + this.func_150756_b(52, S34PacketMaps.class); + this.func_150756_b(53, S35PacketUpdateTileEntity.class); + this.func_150756_b(54, S36PacketSignEditorOpen.class); + this.func_150756_b(55, S37PacketStatistics.class); + this.func_150756_b(56, S38PacketPlayerListItem.class); + this.func_150756_b(57, S39PacketPlayerAbilities.class); + this.func_150756_b(58, S3APacketTabComplete.class); + this.func_150756_b(59, S3BPacketScoreboardObjective.class); + this.func_150756_b(60, S3CPacketUpdateScore.class); + this.func_150756_b(61, S3DPacketDisplayScoreboard.class); + this.func_150756_b(62, S3EPacketTeams.class); + this.func_150756_b(63, S3FPacketCustomPayload.class); + this.func_150756_b(64, S40PacketDisconnect.class); + this.func_150751_a(0, C00PacketKeepAlive.class); + this.func_150751_a(1, C01PacketChatMessage.class); + this.func_150751_a(2, C02PacketUseEntity.class); + this.func_150751_a(3, C03PacketPlayer.class); + this.func_150751_a(4, C03PacketPlayer.C04PacketPlayerPosition.class); + this.func_150751_a(5, C03PacketPlayer.C05PacketPlayerLook.class); + this.func_150751_a(6, C03PacketPlayer.C06PacketPlayerPosLook.class); + this.func_150751_a(7, C07PacketPlayerDigging.class); + this.func_150751_a(8, C08PacketPlayerBlockPlacement.class); + this.func_150751_a(9, C09PacketHeldItemChange.class); + this.func_150751_a(10, C0APacketAnimation.class); + this.func_150751_a(11, C0BPacketEntityAction.class); + this.func_150751_a(12, C0CPacketInput.class); + this.func_150751_a(13, C0DPacketCloseWindow.class); + this.func_150751_a(14, C0EPacketClickWindow.class); + this.func_150751_a(15, C0FPacketConfirmTransaction.class); + this.func_150751_a(16, C10PacketCreativeInventoryAction.class); + this.func_150751_a(17, C11PacketEnchantItem.class); + this.func_150751_a(18, C12PacketUpdateSign.class); + this.func_150751_a(19, C13PacketPlayerAbilities.class); + this.func_150751_a(20, C14PacketTabComplete.class); + this.func_150751_a(21, C15PacketClientSettings.class); + this.func_150751_a(22, C16PacketClientStatus.class); + this.func_150751_a(23, C17PacketCustomPayload.class); + } + }, + STATUS(1) + { + private static final String __OBFID = "CL_00001246"; + { + this.func_150751_a(0, C00PacketServerQuery.class); + this.func_150756_b(0, S00PacketServerInfo.class); + this.func_150751_a(1, C01PacketPing.class); + this.func_150756_b(1, S01PacketPong.class); + } + }, + LOGIN(2) + { + private static final String __OBFID = "CL_00001249"; + { + this.func_150756_b(0, S00PacketDisconnect.class); + this.func_150756_b(1, S01PacketEncryptionRequest.class); + this.func_150756_b(2, S02PacketLoginSuccess.class); + this.func_150751_a(0, C00PacketLoginStart.class); + this.func_150751_a(1, C01PacketEncryptionResponse.class); + } + }; + private static final TIntObjectMap field_150764_e = new TIntObjectHashMap(); + private static final Map field_150761_f = Maps.newHashMap(); + private final int field_150762_g; + private final BiMap field_150769_h; + private final BiMap field_150770_i; + + private static final String __OBFID = "CL_00001245"; + + private EnumConnectionState(int protocolId) + { + this.field_150769_h = HashBiMap.create(); + this.field_150770_i = HashBiMap.create(); + this.field_150762_g = protocolId; + } + + protected EnumConnectionState func_150751_a(int p_150751_1_, Class p_150751_2_) + { + String s; + + if (this.field_150769_h.containsKey(Integer.valueOf(p_150751_1_))) + { + s = "Serverbound packet ID " + p_150751_1_ + " is already assigned to " + this.field_150769_h.get(Integer.valueOf(p_150751_1_)) + "; cannot re-assign to " + p_150751_2_; + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } + else if (this.field_150769_h.containsValue(p_150751_2_)) + { + s = "Serverbound packet " + p_150751_2_ + " is already assigned to ID " + this.field_150769_h.inverse().get(p_150751_2_) + "; cannot re-assign to " + p_150751_1_; + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } + else + { + this.field_150769_h.put(Integer.valueOf(p_150751_1_), p_150751_2_); + return this; + } + } + + protected EnumConnectionState func_150756_b(int p_150756_1_, Class p_150756_2_) + { + String s; + + if (this.field_150770_i.containsKey(Integer.valueOf(p_150756_1_))) + { + s = "Clientbound packet ID " + p_150756_1_ + " is already assigned to " + this.field_150770_i.get(Integer.valueOf(p_150756_1_)) + "; cannot re-assign to " + p_150756_2_; + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } + else if (this.field_150770_i.containsValue(p_150756_2_)) + { + s = "Clientbound packet " + p_150756_2_ + " is already assigned to ID " + this.field_150770_i.inverse().get(p_150756_2_) + "; cannot re-assign to " + p_150756_1_; + LogManager.getLogger().fatal(s); + throw new IllegalArgumentException(s); + } + else + { + this.field_150770_i.put(Integer.valueOf(p_150756_1_), p_150756_2_); + return this; + } + } + + public BiMap func_150753_a() + { + return this.field_150769_h; + } + + public BiMap func_150755_b() + { + return this.field_150770_i; + } + + public BiMap func_150757_a(boolean p_150757_1_) + { + return p_150757_1_ ? this.func_150755_b() : this.func_150753_a(); + } + + public BiMap func_150754_b(boolean p_150754_1_) + { + return p_150754_1_ ? this.func_150753_a() : this.func_150755_b(); + } + + public int func_150759_c() + { + return this.field_150762_g; + } + + public static EnumConnectionState func_150760_a(int stateId) + { + return (EnumConnectionState)field_150764_e.get(stateId); + } + + public static EnumConnectionState func_150752_a(Packet packetIn) + { + return (EnumConnectionState)field_150761_f.get(packetIn.getClass()); + } + + EnumConnectionState(int p_i1197_3_, Object p_i1197_4_) + { + this(p_i1197_3_); + } + + static + { + EnumConnectionState[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + EnumConnectionState var3 = var0[var2]; + field_150764_e.put(var3.func_150759_c(), var3); + Iterator var4 = Iterables.concat(var3.func_150755_b().values(), var3.func_150753_a().values()).iterator(); + + while (var4.hasNext()) + { + Class var5 = (Class)var4.next(); + + if (field_150761_f.containsKey(var5) && field_150761_f.get(var5) != var3) + { + throw new Error("Packet " + var5 + " is already assigned to protocol " + field_150761_f.get(var5) + " - can\'t reassign to " + var3); + } + + field_150761_f.put(var5, var3); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/INetHandler.java b/build/rfg/minecraft-src/java/net/minecraft/network/INetHandler.java new file mode 100644 index 0000000..ea61673 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/INetHandler.java @@ -0,0 +1,23 @@ +package net.minecraft.network; + +import net.minecraft.util.IChatComponent; + +public interface INetHandler +{ + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + void onDisconnect(IChatComponent reason); + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState); + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + void onNetworkTick(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NetHandlerPlayServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/NetHandlerPlayServer.java new file mode 100644 index 0000000..db11d30 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NetHandlerPlayServer.java @@ -0,0 +1,1434 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import io.netty.buffer.Unpooled; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.material.Material; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityMinecartCommandBlock; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerBeacon; +import net.minecraft.inventory.ContainerMerchant; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemWritableBook; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.UserListBansEntry; +import net.minecraft.stats.AchievementList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.tileentity.TileEntityCommandBlock; +import net.minecraft.tileentity.TileEntitySign; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatAllowedCharacters; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldServer; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.ServerChatEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; + +public class NetHandlerPlayServer implements INetHandlerPlayServer +{ + private static final Logger logger = LogManager.getLogger(); + public final NetworkManager netManager; + private final MinecraftServer serverController; + public EntityPlayerMP playerEntity; + private int networkTickCount; + /** + * Used to keep track of how the player is floating while gamerules should prevent that. Surpassing 80 ticks means + * kick + */ + private int floatingTickCount; + private boolean field_147366_g; + private int field_147378_h; + private long field_147379_i; + private static Random field_147376_j = new Random(); + private long field_147377_k; + /** + * Incremented by 20 each time a user sends a chat message, decreased by one every tick. Non-ops kicked when over + * 200 + */ + private int chatSpamThresholdCount; + private int field_147375_m; + private IntHashMap field_147372_n = new IntHashMap(); + /** The last known x position for this connection. */ + private double lastPosX; + /** The last known y position for this connection. */ + private double lastPosY; + /** The last known z position for this connection. */ + private double lastPosZ; + /** is true when the player has moved since his last movement packet */ + private boolean hasMoved = true; + private static final String __OBFID = "CL_00001452"; + + public NetHandlerPlayServer(MinecraftServer server, NetworkManager networkManagerIn, EntityPlayerMP player) + { + this.serverController = server; + this.netManager = networkManagerIn; + networkManagerIn.setNetHandler(this); + this.playerEntity = player; + player.playerNetServerHandler = this; + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() + { + this.field_147366_g = false; + ++this.networkTickCount; + this.serverController.theProfiler.startSection("keepAlive"); + + if ((long)this.networkTickCount - this.field_147377_k > 40L) + { + this.field_147377_k = (long)this.networkTickCount; + this.field_147379_i = this.func_147363_d(); + this.field_147378_h = (int)this.field_147379_i; + this.sendPacket(new S00PacketKeepAlive(this.field_147378_h)); + } + + if (this.chatSpamThresholdCount > 0) + { + --this.chatSpamThresholdCount; + } + + if (this.field_147375_m > 0) + { + --this.field_147375_m; + } + + if (this.playerEntity.func_154331_x() > 0L && this.serverController.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.playerEntity.func_154331_x() > (long)(this.serverController.func_143007_ar() * 1000 * 60)) + { + this.kickPlayerFromServer("You have been idle for too long!"); + } + } + + public NetworkManager func_147362_b() + { + return this.netManager; + } + + /** + * Kick a player from the server with a reason + */ + public void kickPlayerFromServer(String reason) + { + final ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.netManager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener[] {new GenericFutureListener() + { + private static final String __OBFID = "CL_00001453"; + public void operationComplete(Future p_operationComplete_1_) + { + NetHandlerPlayServer.this.netManager.closeChannel(chatcomponenttext); + } + } + }); + this.netManager.disableAutoRead(); + } + + /** + * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + public void processInput(C0CPacketInput packetIn) + { + this.playerEntity.setEntityActionState(packetIn.func_149620_c(), packetIn.func_149616_d(), packetIn.func_149618_e(), packetIn.func_149617_f()); + } + + /** + * Processes clients perspective on player positioning and/or orientation + */ + public void processPlayer(C03PacketPlayer packetIn) + { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.field_147366_g = true; + + if (!this.playerEntity.playerConqueredTheEnd) + { + double d0; + + if (!this.hasMoved) + { + d0 = packetIn.func_149467_d() - this.lastPosY; + + if (packetIn.func_149464_c() == this.lastPosX && d0 * d0 < 0.01D && packetIn.func_149472_e() == this.lastPosZ) + { + this.hasMoved = true; + } + } + + if (this.hasMoved) + { + double d1; + double d2; + double d3; + + if (this.playerEntity.ridingEntity != null) + { + float f4 = this.playerEntity.rotationYaw; + float f = this.playerEntity.rotationPitch; + this.playerEntity.ridingEntity.updateRiderPosition(); + d1 = this.playerEntity.posX; + d2 = this.playerEntity.posY; + d3 = this.playerEntity.posZ; + + if (packetIn.func_149463_k()) + { + f4 = packetIn.func_149462_g(); + f = packetIn.func_149470_h(); + } + + this.playerEntity.onGround = packetIn.func_149465_i(); + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(d1, d2, d3, f4, f); + + if (this.playerEntity.ridingEntity != null) + { + this.playerEntity.ridingEntity.updateRiderPosition(); + } + + if (!this.hasMoved) //Fixes teleportation kick while riding entities + { + return; + } + + this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); + + if (this.hasMoved) + { + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + } + + worldserver.updateEntity(this.playerEntity); + return; + } + + if (this.playerEntity.isPlayerSleeping()) + { + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + worldserver.updateEntity(this.playerEntity); + return; + } + + d0 = this.playerEntity.posY; + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; + d1 = this.playerEntity.posX; + d2 = this.playerEntity.posY; + d3 = this.playerEntity.posZ; + float f1 = this.playerEntity.rotationYaw; + float f2 = this.playerEntity.rotationPitch; + + if (packetIn.func_149466_j() && packetIn.func_149467_d() == -999.0D && packetIn.func_149471_f() == -999.0D) + { + packetIn.func_149469_a(false); + } + + double d4; + + if (packetIn.func_149466_j()) + { + d1 = packetIn.func_149464_c(); + d2 = packetIn.func_149467_d(); + d3 = packetIn.func_149472_e(); + d4 = packetIn.func_149471_f() - packetIn.func_149467_d(); + + if (!this.playerEntity.isPlayerSleeping() && (d4 > 1.65D || d4 < 0.1D)) + { + this.kickPlayerFromServer("Illegal stance"); + logger.warn(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + d4); + return; + } + + if (Math.abs(packetIn.func_149464_c()) > 3.2E7D || Math.abs(packetIn.func_149472_e()) > 3.2E7D) + { + this.kickPlayerFromServer("Illegal position"); + return; + } + } + + if (packetIn.func_149463_k()) + { + f1 = packetIn.func_149462_g(); + f2 = packetIn.func_149470_h(); + } + + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + + if (!this.hasMoved) + { + return; + } + + d4 = d1 - this.playerEntity.posX; + double d5 = d2 - this.playerEntity.posY; + double d6 = d3 - this.playerEntity.posZ; + //BUGFIX: min -> max, grabs the highest distance + double d7 = Math.max(Math.abs(d4), Math.abs(this.playerEntity.motionX)); + double d8 = Math.max(Math.abs(d5), Math.abs(this.playerEntity.motionY)); + double d9 = Math.max(Math.abs(d6), Math.abs(this.playerEntity.motionZ)); + double d10 = d7 * d7 + d8 * d8 + d9 * d9; + + if (d10 > 100.0D && (!this.serverController.isSinglePlayer() || !this.serverController.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) + { + logger.warn(this.playerEntity.getCommandSenderName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")"); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + return; + } + + float f3 = 0.0625F; + boolean flag = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + + if (this.playerEntity.onGround && !packetIn.func_149465_i() && d5 > 0.0D) + { + this.playerEntity.jump(); + } + + if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + + this.playerEntity.moveEntity(d4, d5, d6); + this.playerEntity.onGround = packetIn.func_149465_i(); + this.playerEntity.addMovementStat(d4, d5, d6); + double d11 = d5; + d4 = d1 - this.playerEntity.posX; + d5 = d2 - this.playerEntity.posY; + + if (d5 > -0.5D || d5 < 0.5D) + { + d5 = 0.0D; + } + + d6 = d3 - this.playerEntity.posZ; + d10 = d4 * d4 + d5 * d5 + d6 * d6; + boolean flag1 = false; + + if (d10 > 0.0625D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) + { + flag1 = true; + logger.warn(this.playerEntity.getCommandSenderName() + " moved wrongly!"); + } + + if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + + this.playerEntity.setPositionAndRotation(d1, d2, d3, f1, f2); + boolean flag2 = worldserver.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)f3, (double)f3, (double)f3)).isEmpty(); + + if (flag && (flag1 || !flag2) && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.noClip) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, f1, f2); + return; + } + + AxisAlignedBB axisalignedbb = this.playerEntity.boundingBox.copy().expand((double)f3, (double)f3, (double)f3).addCoord(0.0D, -0.55D, 0.0D); + + if (!this.serverController.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !worldserver.checkBlockCollision(axisalignedbb) && !this.playerEntity.capabilities.allowFlying) + { + if (d11 >= -0.03125D) + { + ++this.floatingTickCount; + + if (this.floatingTickCount > 80) + { + logger.warn(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); + this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } + else + { + this.floatingTickCount = 0; + } + + if (!this.hasMoved) //Fixes "Moved Too Fast" kick when being teleported while moving + { + return; + } + + this.playerEntity.onGround = packetIn.func_149465_i(); + this.serverController.getConfigurationManager().updatePlayerPertinentChunks(this.playerEntity); + this.playerEntity.handleFalling(this.playerEntity.posY - d0, packetIn.func_149465_i()); + } + else if (this.networkTickCount % 20 == 0) + { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } + } + } + + /** + * Moves the player to the specified destination and rotation + */ + public void setPlayerLocation(double x, double y, double z, float yaw, float pitch) + { + this.hasMoved = false; + this.lastPosX = x; + this.lastPosY = y; + this.lastPosZ = z; + this.playerEntity.setPositionAndRotation(x, y, z, yaw, pitch); + this.playerEntity.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(x, y + 1.6200000047683716D, z, yaw, pitch, false)); + } + + /** + * Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z, + * side clicked on;) + */ + public void processPlayerDigging(C07PacketPlayerDigging packetIn) + { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + this.playerEntity.func_143004_u(); + + if (packetIn.func_149506_g() == 4) + { + this.playerEntity.dropOneItem(false); + } + else if (packetIn.func_149506_g() == 3) + { + this.playerEntity.dropOneItem(true); + } + else if (packetIn.func_149506_g() == 5) + { + this.playerEntity.stopUsingItem(); + } + else + { + boolean flag = false; + + if (packetIn.func_149506_g() == 0) + { + flag = true; + } + + if (packetIn.func_149506_g() == 1) + { + flag = true; + } + + if (packetIn.func_149506_g() == 2) + { + flag = true; + } + + int i = packetIn.func_149505_c(); + int j = packetIn.func_149503_d(); + int k = packetIn.func_149502_e(); + + if (flag) + { + double d0 = this.playerEntity.posX - ((double)i + 0.5D); + double d1 = this.playerEntity.posY - ((double)j + 0.5D) + 1.5D; + double d2 = this.playerEntity.posZ - ((double)k + 0.5D); + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; + dist *= dist; + + if (d3 > dist) + { + return; + } + + if (j >= this.serverController.getBuildLimit()) + { + return; + } + } + + if (packetIn.func_149506_g() == 0) + { + if (!this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) + { + this.playerEntity.theItemInWorldManager.onBlockClicked(i, j, k, packetIn.func_149501_f()); + } + else + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(i, j, k, worldserver)); + } + } + else if (packetIn.func_149506_g() == 2) + { + this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(i, j, k); + + if (worldserver.getBlock(i, j, k).getMaterial() != Material.air) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(i, j, k, worldserver)); + } + } + else if (packetIn.func_149506_g() == 1) + { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(i, j, k); + + if (worldserver.getBlock(i, j, k).getMaterial() != Material.air) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(i, j, k, worldserver)); + } + } + } + } + + /** + * Processes block placement and block activation (anvil, furnace, etc.) + */ + public void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement packetIn) + { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + ItemStack itemstack = this.playerEntity.inventory.getCurrentItem(); + boolean flag = false; + boolean placeResult = true; + int i = packetIn.func_149576_c(); + int j = packetIn.func_149571_d(); + int k = packetIn.func_149570_e(); + int l = packetIn.func_149568_f(); + this.playerEntity.func_143004_u(); + + if (packetIn.func_149568_f() == 255) + { + if (itemstack == null) + { + return; + } + + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(playerEntity, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, worldserver); + if (event.useItem != Event.Result.DENY) + { + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, worldserver, itemstack); + } + } + else if (packetIn.func_149571_d() >= this.serverController.getBuildLimit() - 1 && (packetIn.func_149568_f() == 1 || packetIn.func_149571_d() >= this.serverController.getBuildLimit())) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("build.tooHigh", new Object[] {Integer.valueOf(this.serverController.getBuildLimit())}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.playerEntity.playerNetServerHandler.sendPacket(new S02PacketChat(chatcomponenttranslation)); + flag = true; + } + else + { + double dist = playerEntity.theItemInWorldManager.getBlockReachDistance() + 1; + dist *= dist; + if (this.hasMoved && this.playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.serverController.isBlockProtected(worldserver, i, j, k, this.playerEntity)) + { + // record block place result so we can update client itemstack size if place event was cancelled. + if (!this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, worldserver, itemstack, i, j, k, l, packetIn.func_149573_h(), packetIn.func_149569_i(), packetIn.func_149575_j())) + { + placeResult = false; + } + } + + flag = true; + } + + if (flag) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(i, j, k, worldserver)); + + if (l == 0) + { + --j; + } + + if (l == 1) + { + ++j; + } + + if (l == 2) + { + --k; + } + + if (l == 3) + { + ++k; + } + + if (l == 4) + { + --i; + } + + if (l == 5) + { + ++i; + } + + this.playerEntity.playerNetServerHandler.sendPacket(new S23PacketBlockChange(i, j, k, worldserver)); + } + + itemstack = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack != null && itemstack.stackSize == 0) + { + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; + itemstack = null; + } + + if (itemstack == null || itemstack.getMaxItemUseDuration() == 0) + { + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.isChangingQuantityOnly = false; + + if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), packetIn.func_149574_g()) || !placeResult) // force client itemstack update if place event was cancelled + { + this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + logger.info(this.playerEntity.getCommandSenderName() + " lost connection: " + reason); + this.serverController.func_147132_au(); + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.left", new Object[] {this.playerEntity.func_145748_c_()}); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.serverController.getConfigurationManager().sendChatMsg(chatcomponenttranslation); + this.playerEntity.mountEntityAndWakeUp(); + this.serverController.getConfigurationManager().playerLoggedOut(this.playerEntity); + + if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) + { + logger.info("Stopping singleplayer server as player logged out"); + this.serverController.initiateShutdown(); + } + } + + public void sendPacket(final Packet packetIn) + { + if (packetIn instanceof S02PacketChat) + { + S02PacketChat s02packetchat = (S02PacketChat)packetIn; + EntityPlayer.EnumChatVisibility enumchatvisibility = this.playerEntity.func_147096_v(); + + if (enumchatvisibility == EntityPlayer.EnumChatVisibility.HIDDEN) + { + return; + } + + if (enumchatvisibility == EntityPlayer.EnumChatVisibility.SYSTEM && !s02packetchat.func_148916_d()) + { + return; + } + } + + try + { + this.netManager.scheduleOutboundPacket(packetIn, new GenericFutureListener[0]); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Sending packet"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Packet being sent"); + crashreportcategory.addCrashSectionCallable("Packet class", new Callable() + { + private static final String __OBFID = "CL_00001454"; + public String call() + { + return packetIn.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + + /** + * Updates which quickbar slot is selected + */ + public void processHeldItemChange(C09PacketHeldItemChange packetIn) + { + if (packetIn.func_149614_c() >= 0 && packetIn.func_149614_c() < InventoryPlayer.getHotbarSize()) + { + this.playerEntity.inventory.currentItem = packetIn.func_149614_c(); + this.playerEntity.func_143004_u(); + } + else + { + logger.warn(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); + } + } + + /** + * Process chat messages (broadcast back to clients) and commands (executes) + */ + public void processChatMessage(C01PacketChatMessage packetIn) + { + if (this.playerEntity.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) + { + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation("chat.cannotSend", new Object[0]); + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.RED); + this.sendPacket(new S02PacketChat(chatcomponenttranslation)); + } + else + { + this.playerEntity.func_143004_u(); + String s = packetIn.func_149439_c(); + s = StringUtils.normalizeSpace(s); + + for (int i = 0; i < s.length(); ++i) + { + if (!ChatAllowedCharacters.isAllowedCharacter(s.charAt(i))) + { + this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + + if (s.startsWith("/")) + { + this.handleSlashCommand(s); + } + else + { + ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.playerEntity.func_145748_c_(), ForgeHooks.newChatWithLinks(s)}); // Fixes chat links + chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); + if (chatcomponenttranslation1 == null) return; + this.serverController.getConfigurationManager().sendChatMsgImpl(chatcomponenttranslation1, false); + } + + this.chatSpamThresholdCount += 20; + + if (this.chatSpamThresholdCount > 200 && !this.serverController.getConfigurationManager().func_152596_g(this.playerEntity.getGameProfile())) + { + this.kickPlayerFromServer("disconnect.spam"); + } + } + } + + /** + * Handle commands that start with a / + */ + private void handleSlashCommand(String command) + { + this.serverController.getCommandManager().executeCommand(this.playerEntity, command); + } + + /** + * Processes the player swinging its held item + */ + public void processAnimation(C0APacketAnimation packetIn) + { + this.playerEntity.func_143004_u(); + + if (packetIn.func_149421_d() == 1) + { + this.playerEntity.swingItem(); + } + } + + /** + * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + public void processEntityAction(C0BPacketEntityAction packetIn) + { + this.playerEntity.func_143004_u(); + + if (packetIn.func_149513_d() == 1) + { + this.playerEntity.setSneaking(true); + } + else if (packetIn.func_149513_d() == 2) + { + this.playerEntity.setSneaking(false); + } + else if (packetIn.func_149513_d() == 4) + { + this.playerEntity.setSprinting(true); + } + else if (packetIn.func_149513_d() == 5) + { + this.playerEntity.setSprinting(false); + } + else if (packetIn.func_149513_d() == 3) + { + this.playerEntity.wakeUpPlayer(false, true, true); + this.hasMoved = false; + } + else if (packetIn.func_149513_d() == 6) + { + if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) + { + ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(packetIn.func_149512_e()); + } + } + else if (packetIn.func_149513_d() == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) + { + ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity); + } + } + + /** + * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently + * equipped item + */ + public void processUseEntity(C02PacketUseEntity packetIn) + { + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + Entity entity = packetIn.func_149564_a(worldserver); + this.playerEntity.func_143004_u(); + + if (entity != null) + { + boolean flag = this.playerEntity.canEntityBeSeen(entity); + double d0 = 36.0D; + + if (!flag) + { + d0 = 9.0D; + } + + if (this.playerEntity.getDistanceSqToEntity(entity) < d0) + { + if (packetIn.func_149565_c() == C02PacketUseEntity.Action.INTERACT) + { + this.playerEntity.interactWith(entity); + } + else if (packetIn.func_149565_c() == C02PacketUseEntity.Action.ATTACK) + { + if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == this.playerEntity) + { + this.kickPlayerFromServer("Attempting to attack an invalid entity"); + this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); + return; + } + + this.playerEntity.attackTargetEntityWithCurrentItem(entity); + } + } + } + } + + /** + * Processes the client status updates: respawn attempt from player, opening statistics or achievements, or + * acquiring 'open inventory' achievement + */ + public void processClientStatus(C16PacketClientStatus packetIn) + { + this.playerEntity.func_143004_u(); + C16PacketClientStatus.EnumState enumstate = packetIn.func_149435_c(); + + switch (NetHandlerPlayServer.SwitchEnumState.field_151290_a[enumstate.ordinal()]) + { + case 1: + if (this.playerEntity.playerConqueredTheEnd) + { + this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true); + } + else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) + { + if (this.serverController.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.serverController.getServerOwner())) + { + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + this.serverController.deleteWorldAndStopServer(); + } + else + { + UserListBansEntry userlistbansentry = new UserListBansEntry(this.playerEntity.getGameProfile(), (Date)null, "(You just lost the game)", (Date)null, "Death in Hardcore"); + this.serverController.getConfigurationManager().func_152608_h().func_152687_a(userlistbansentry); + this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + } + } + else + { + if (this.playerEntity.getHealth() > 0.0F) + { + return; + } + + this.playerEntity = this.serverController.getConfigurationManager().respawnPlayer(this.playerEntity, playerEntity.dimension, false); + } + + break; + case 2: + this.playerEntity.func_147099_x().func_150876_a(this.playerEntity); + break; + case 3: + this.playerEntity.triggerAchievement(AchievementList.openInventory); + } + } + + /** + * Processes the client closing windows (container) + */ + public void processCloseWindow(C0DPacketCloseWindow packetIn) + { + this.playerEntity.closeContainer(); + } + + /** + * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they + * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has + * the same open container/inventory + */ + public void processClickWindow(C0EPacketClickWindow packetIn) + { + this.playerEntity.func_143004_u(); + + if (this.playerEntity.openContainer.windowId == packetIn.func_149548_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { + ItemStack itemstack = this.playerEntity.openContainer.slotClick(packetIn.func_149544_d(), packetIn.func_149543_e(), packetIn.func_149542_h(), this.playerEntity); + + if (ItemStack.areItemStacksEqual(packetIn.func_149546_g(), itemstack)) + { + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.func_149548_c(), packetIn.func_149547_f(), true)); + this.playerEntity.isChangingQuantityOnly = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); + this.playerEntity.isChangingQuantityOnly = false; + } + else + { + this.field_147372_n.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(packetIn.func_149547_f())); + this.playerEntity.playerNetServerHandler.sendPacket(new S32PacketConfirmTransaction(packetIn.func_149548_c(), packetIn.func_149547_f(), false)); + this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false); + ArrayList arraylist = new ArrayList(); + + for (int i = 0; i < this.playerEntity.openContainer.inventorySlots.size(); ++i) + { + arraylist.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(i)).getStack()); + } + + this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, arraylist); + } + } + } + + /** + * Enchants the item identified by the packet given some convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + public void processEnchantItem(C11PacketEnchantItem packetIn) + { + this.playerEntity.func_143004_u(); + + if (this.playerEntity.openContainer.windowId == packetIn.func_149539_c() && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { + this.playerEntity.openContainer.enchantItem(this.playerEntity, packetIn.func_149537_d()); + this.playerEntity.openContainer.detectAndSendChanges(); + } + } + + /** + * Update the server with an ItemStack in a slot. + */ + public void processCreativeInventoryAction(C10PacketCreativeInventoryAction packetIn) + { + if (this.playerEntity.theItemInWorldManager.isCreative()) + { + boolean flag = packetIn.func_149627_c() < 0; + ItemStack itemstack = packetIn.func_149625_d(); + boolean flag1 = packetIn.func_149627_c() >= 1 && packetIn.func_149627_c() < 36 + InventoryPlayer.getHotbarSize(); + boolean flag2 = itemstack == null || itemstack.getItem() != null; + boolean flag3 = itemstack == null || itemstack.getItemDamage() >= 0 && itemstack.stackSize <= 64 && itemstack.stackSize > 0; + + if (flag1 && flag2 && flag3) + { + if (itemstack == null) + { + this.playerEntity.inventoryContainer.putStackInSlot(packetIn.func_149627_c(), (ItemStack)null); + } + else + { + this.playerEntity.inventoryContainer.putStackInSlot(packetIn.func_149627_c(), itemstack); + } + + this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true); + } + else if (flag && flag2 && flag3 && this.field_147375_m < 200) + { + this.field_147375_m += 20; + EntityItem entityitem = this.playerEntity.dropPlayerItemWithRandomChoice(itemstack, true); + + if (entityitem != null) + { + entityitem.setAgeToCreativeDespawnTime(); + } + } + } + } + + /** + * Received in response to the server requesting to confirm that the client-side open container matches the servers' + * after a mismatched container-slot manipulation. It will unlock the player's ability to manipulate the container + * contents + */ + public void processConfirmTransaction(C0FPacketConfirmTransaction packetIn) + { + Short oshort = (Short)this.field_147372_n.lookup(this.playerEntity.openContainer.windowId); + + if (oshort != null && packetIn.func_149533_d() == oshort.shortValue() && this.playerEntity.openContainer.windowId == packetIn.func_149532_c() && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) + { + this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true); + } + } + + public void processUpdateSign(C12PacketUpdateSign packetIn) + { + this.playerEntity.func_143004_u(); + WorldServer worldserver = this.serverController.worldServerForDimension(this.playerEntity.dimension); + + if (worldserver.blockExists(packetIn.func_149588_c(), packetIn.func_149586_d(), packetIn.func_149585_e())) + { + TileEntity tileentity = worldserver.getTileEntity(packetIn.func_149588_c(), packetIn.func_149586_d(), packetIn.func_149585_e()); + + if (tileentity instanceof TileEntitySign) + { + TileEntitySign tileentitysign = (TileEntitySign)tileentity; + + if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.playerEntity) + { + this.serverController.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); + return; + } + } + + int i; + int j; + + for (j = 0; j < 4; ++j) + { + boolean flag = true; + + if (packetIn.func_149589_f()[j].length() > 15) + { + flag = false; + } + else + { + for (i = 0; i < packetIn.func_149589_f()[j].length(); ++i) + { + if (!ChatAllowedCharacters.isAllowedCharacter(packetIn.func_149589_f()[j].charAt(i))) + { + flag = false; + } + } + } + + if (!flag) + { + packetIn.func_149589_f()[j] = "!?"; + } + } + + if (tileentity instanceof TileEntitySign) + { + j = packetIn.func_149588_c(); + int k = packetIn.func_149586_d(); + i = packetIn.func_149585_e(); + TileEntitySign tileentitysign1 = (TileEntitySign)tileentity; + System.arraycopy(packetIn.func_149589_f(), 0, tileentitysign1.signText, 0, 4); + tileentitysign1.markDirty(); + worldserver.markBlockForUpdate(j, k, i); + } + } + } + + /** + * Updates a players' ping statistics + */ + public void processKeepAlive(C00PacketKeepAlive packetIn) + { + if (packetIn.func_149460_c() == this.field_147378_h) + { + int i = (int)(this.func_147363_d() - this.field_147379_i); + this.playerEntity.ping = (this.playerEntity.ping * 3 + i) / 4; + } + } + + private long func_147363_d() + { + return System.nanoTime() / 1000000L; + } + + /** + * Processes a player starting/stopping flying + */ + public void processPlayerAbilities(C13PacketPlayerAbilities packetIn) + { + this.playerEntity.capabilities.isFlying = packetIn.func_149488_d() && this.playerEntity.capabilities.allowFlying; + } + + /** + * Retrieves possible tab completions for the requested command string and sends them to the client + */ + public void processTabComplete(C14PacketTabComplete packetIn) + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.serverController.getPossibleCompletions(this.playerEntity, packetIn.func_149419_c()).iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + arraylist.add(s); + } + + this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete((String[])arraylist.toArray(new String[arraylist.size()]))); + } + + /** + * Updates serverside copy of client settings: language, render distance, chat visibility, chat colours, difficulty, + * and whether to show the cape + */ + public void processClientSettings(C15PacketClientSettings packetIn) + { + this.playerEntity.func_147100_a(packetIn); + } + + /** + * Synchronizes serverside and clientside book contents and signing + */ + public void processVanilla250Packet(C17PacketCustomPayload packetIn) + { + PacketBuffer packetbuffer; + ItemStack itemstack; + ItemStack itemstack1; + + if ("MC|BEdit".equals(packetIn.func_149559_c())) + { + packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(packetIn.func_149558_e())); + + try + { + itemstack = packetbuffer.readItemStackFromBuffer(); + + if (itemstack == null) + { + return; + } + + if (!ItemWritableBook.func_150930_a(itemstack.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } + + itemstack1 = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack1 != null) + { + if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem()) + { + itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); + } + + return; + } + } + catch (Exception exception4) + { + logger.error("Couldn\'t handle book info", exception4); + return; + } + finally + { + packetbuffer.release(); + } + + return; + } + else if ("MC|BSign".equals(packetIn.func_149559_c())) + { + packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(packetIn.func_149558_e())); + + try + { + itemstack = packetbuffer.readItemStackFromBuffer(); + + if (itemstack == null) + { + return; + } + + if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound())) + { + throw new IOException("Invalid book tag!"); + } + + itemstack1 = this.playerEntity.inventory.getCurrentItem(); + + if (itemstack1 != null) + { + if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book) + { + itemstack1.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName())); + itemstack1.setTagInfo("title", new NBTTagString(itemstack.getTagCompound().getString("title"))); + itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8)); + itemstack1.func_150996_a(Items.written_book); + } + + return; + } + } + catch (Exception exception3) + { + logger.error("Couldn\'t sign book", exception3); + return; + } + finally + { + packetbuffer.release(); + } + + return; + } + else + { + DataInputStream datainputstream; + int i; + + if ("MC|TrSel".equals(packetIn.func_149559_c())) + { + try + { + datainputstream = new DataInputStream(new ByteArrayInputStream(packetIn.func_149558_e())); + i = datainputstream.readInt(); + Container container = this.playerEntity.openContainer; + + if (container instanceof ContainerMerchant) + { + ((ContainerMerchant)container).setCurrentRecipeIndex(i); + } + } + catch (Exception exception2) + { + logger.error("Couldn\'t select trade", exception2); + } + } + else if ("MC|AdvCdm".equals(packetIn.func_149559_c())) + { + if (!this.serverController.isCommandBlockEnabled()) + { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notEnabled", new Object[0])); + } + else if (this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) + { + packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(packetIn.func_149558_e())); + + try + { + byte b0 = packetbuffer.readByte(); + CommandBlockLogic commandblocklogic = null; + + if (b0 == 0) + { + TileEntity tileentity = this.playerEntity.worldObj.getTileEntity(packetbuffer.readInt(), packetbuffer.readInt(), packetbuffer.readInt()); + + if (tileentity instanceof TileEntityCommandBlock) + { + commandblocklogic = ((TileEntityCommandBlock)tileentity).func_145993_a(); + } + } + else if (b0 == 1) + { + Entity entity = this.playerEntity.worldObj.getEntityByID(packetbuffer.readInt()); + + if (entity instanceof EntityMinecartCommandBlock) + { + commandblocklogic = ((EntityMinecartCommandBlock)entity).func_145822_e(); + } + } + + String s1 = packetbuffer.readStringFromBuffer(packetbuffer.readableBytes()); + + if (commandblocklogic != null) + { + commandblocklogic.func_145752_a(s1); + commandblocklogic.func_145756_e(); + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.setCommand.success", new Object[] {s1})); + } + } + catch (Exception exception1) + { + logger.error("Couldn\'t set command block", exception1); + } + finally + { + packetbuffer.release(); + } + } + else + { + this.playerEntity.addChatMessage(new ChatComponentTranslation("advMode.notAllowed", new Object[0])); + } + } + else if ("MC|Beacon".equals(packetIn.func_149559_c())) + { + if (this.playerEntity.openContainer instanceof ContainerBeacon) + { + try + { + datainputstream = new DataInputStream(new ByteArrayInputStream(packetIn.func_149558_e())); + i = datainputstream.readInt(); + int j = datainputstream.readInt(); + ContainerBeacon containerbeacon = (ContainerBeacon)this.playerEntity.openContainer; + Slot slot = containerbeacon.getSlot(0); + + if (slot.getHasStack()) + { + slot.decrStackSize(1); + TileEntityBeacon tileentitybeacon = containerbeacon.func_148327_e(); + tileentitybeacon.setPrimaryEffect(i); + tileentitybeacon.setSecondaryEffect(j); + tileentitybeacon.markDirty(); + } + } + catch (Exception exception) + { + logger.error("Couldn\'t set beacon", exception); + } + } + } + else if ("MC|ItemName".equals(packetIn.func_149559_c()) && this.playerEntity.openContainer instanceof ContainerRepair) + { + ContainerRepair containerrepair = (ContainerRepair)this.playerEntity.openContainer; + + if (packetIn.func_149558_e() != null && packetIn.func_149558_e().length >= 1) + { + String s = ChatAllowedCharacters.filerAllowedCharacters(new String(packetIn.func_149558_e(), Charsets.UTF_8)); + + if (s.length() <= 30) + { + containerrepair.updateItemName(s); + } + } + else + { + containerrepair.updateItemName(""); + } + } + } + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + if (newState != EnumConnectionState.PLAY) + { + throw new IllegalStateException("Unexpected change in protocol!"); + } + } + + static final class SwitchEnumState + { + static final int[] field_151290_a = new int[C16PacketClientStatus.EnumState.values().length]; + private static final String __OBFID = "CL_00001455"; + + static + { + try + { + field_151290_a[C16PacketClientStatus.EnumState.PERFORM_RESPAWN.ordinal()] = 1; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + field_151290_a[C16PacketClientStatus.EnumState.REQUEST_STATS.ordinal()] = 2; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_151290_a[C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT.ordinal()] = 3; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingDecoder.java b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingDecoder.java new file mode 100644 index 0000000..3b5d3a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingDecoder.java @@ -0,0 +1,29 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToMessageDecoder; +import java.util.List; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingDecoder extends MessageToMessageDecoder +{ + private final NettyEncryptionTranslator field_150509_a; + private static final String __OBFID = "CL_00001238"; + + public NettyEncryptingDecoder(Cipher cipher) + { + this.field_150509_a = new NettyEncryptionTranslator(cipher); + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws ShortBufferException + { + p_decode_3_.add(this.field_150509_a.func_150503_a(p_decode_1_, p_decode_2_)); + } + + protected void decode(ChannelHandlerContext p_decode_1_, Object p_decode_2_, List p_decode_3_) throws ShortBufferException + { + this.decode(p_decode_1_, (ByteBuf)p_decode_2_, p_decode_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingEncoder.java b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingEncoder.java new file mode 100644 index 0000000..1d1f853 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptingEncoder.java @@ -0,0 +1,28 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptingEncoder extends MessageToByteEncoder +{ + private final NettyEncryptionTranslator field_150750_a; + private static final String __OBFID = "CL_00001239"; + + public NettyEncryptingEncoder(Cipher cipher) + { + this.field_150750_a = new NettyEncryptionTranslator(cipher); + } + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) throws ShortBufferException + { + this.field_150750_a.func_150504_a(p_encode_2_, p_encode_3_); + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) throws ShortBufferException + { + this.encode(p_encode_1_, (ByteBuf)p_encode_2_, p_encode_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptionTranslator.java b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptionTranslator.java new file mode 100644 index 0000000..4b67644 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NettyEncryptionTranslator.java @@ -0,0 +1,55 @@ +package net.minecraft.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import javax.crypto.Cipher; +import javax.crypto.ShortBufferException; + +public class NettyEncryptionTranslator +{ + private final Cipher field_150507_a; + private byte[] field_150505_b = new byte[0]; + private byte[] field_150506_c = new byte[0]; + private static final String __OBFID = "CL_00001237"; + + protected NettyEncryptionTranslator(Cipher cipherIn) + { + this.field_150507_a = cipherIn; + } + + private byte[] func_150502_a(ByteBuf p_150502_1_) + { + int i = p_150502_1_.readableBytes(); + + if (this.field_150505_b.length < i) + { + this.field_150505_b = new byte[i]; + } + + p_150502_1_.readBytes(this.field_150505_b, 0, i); + return this.field_150505_b; + } + + protected ByteBuf func_150503_a(ChannelHandlerContext ctx, ByteBuf buffer) throws ShortBufferException + { + int i = buffer.readableBytes(); + byte[] abyte = this.func_150502_a(buffer); + ByteBuf bytebuf1 = ctx.alloc().heapBuffer(this.field_150507_a.getOutputSize(i)); + bytebuf1.writerIndex(this.field_150507_a.update(abyte, 0, i, bytebuf1.array(), bytebuf1.arrayOffset())); + return bytebuf1; + } + + protected void func_150504_a(ByteBuf p_150504_1_, ByteBuf p_150504_2_) throws ShortBufferException + { + int i = p_150504_1_.readableBytes(); + byte[] abyte = this.func_150502_a(p_150504_1_); + int j = this.field_150507_a.getOutputSize(i); + + if (this.field_150506_c.length < j) + { + this.field_150506_c = new byte[j]; + } + + p_150504_2_.writeBytes(this.field_150506_c, 0, this.field_150507_a.update(abyte, 0, i, this.field_150506_c)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NetworkManager.java b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkManager.java new file mode 100644 index 0000000..43d4de3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkManager.java @@ -0,0 +1,399 @@ +package net.minecraft.network; + +import com.google.common.collect.Queues; +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.local.LocalChannel; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.TimeoutException; +import io.netty.util.AttributeKey; +import io.netty.util.concurrent.GenericFutureListener; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.util.Queue; +import javax.crypto.SecretKey; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MessageDeserializer; +import net.minecraft.util.MessageDeserializer2; +import net.minecraft.util.MessageSerializer; +import net.minecraft.util.MessageSerializer2; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class NetworkManager extends SimpleChannelInboundHandler +{ + private static final Logger logger = LogManager.getLogger(); + public static final Marker logMarkerNetwork = MarkerManager.getMarker("NETWORK"); + public static final Marker logMarkerPackets = MarkerManager.getMarker("NETWORK_PACKETS", logMarkerNetwork); + public static final Marker field_152461_c = MarkerManager.getMarker("NETWORK_STAT", logMarkerNetwork); + public static final AttributeKey attrKeyConnectionState = new AttributeKey("protocol"); + public static final AttributeKey attrKeyReceivable = new AttributeKey("receivable_packets"); + public static final AttributeKey attrKeySendable = new AttributeKey("sendable_packets"); + public static final NioEventLoopGroup eventLoops = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty Client IO #%d").setDaemon(true).build()); + public static final NetworkStatistics field_152462_h = new NetworkStatistics(); + /** Whether this NetworkManager deals with the client or server side of the connection */ + private final boolean isClientSide; + /** The queue for received, unprioritized packets that will be processed at the earliest opportunity */ + private final Queue receivedPacketsQueue = Queues.newConcurrentLinkedQueue(); + /** The queue for packets that require transmission */ + private final Queue outboundPacketsQueue = Queues.newConcurrentLinkedQueue(); + /** The active channel used to send data */ + private Channel channel; + /** The address of the remote party */ + private SocketAddress socketAddress; + /** The INetHandler instance responsible for processing received packets */ + private INetHandler netHandler; + /** The current connection state, being one of: HANDSHAKING, PLAY, STATUS, LOGIN */ + private EnumConnectionState connectionState; + /** A String indicating why the network has shutdown. */ + private IChatComponent terminationReason; + private boolean field_152463_r; + private static final String __OBFID = "CL_00001240"; + + public NetworkManager(boolean isClient) + { + this.isClientSide = isClient; + } + + public void channelActive(ChannelHandlerContext p_channelActive_1_) throws Exception + { + super.channelActive(p_channelActive_1_); + this.channel = p_channelActive_1_.channel(); + this.socketAddress = this.channel.remoteAddress(); + this.setConnectionState(EnumConnectionState.HANDSHAKING); + } + + /** + * Sets the new connection state and registers which packets this channel may send and receive + */ + public void setConnectionState(EnumConnectionState newState) + { + this.connectionState = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).getAndSet(newState); + this.channel.attr(attrKeyReceivable).set(newState.func_150757_a(this.isClientSide)); + this.channel.attr(attrKeySendable).set(newState.func_150754_b(this.isClientSide)); + this.channel.config().setAutoRead(true); + logger.debug("Enabled auto read"); + } + + public void channelInactive(ChannelHandlerContext p_channelInactive_1_) + { + this.closeChannel(new ChatComponentTranslation("disconnect.endOfStream", new Object[0])); + } + + public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) + { + ChatComponentTranslation chatcomponenttranslation; + + if (p_exceptionCaught_2_ instanceof TimeoutException) + { + chatcomponenttranslation = new ChatComponentTranslation("disconnect.timeout", new Object[0]); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Internal Exception: " + p_exceptionCaught_2_}); + } + + this.closeChannel(chatcomponenttranslation); + } + + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet p_channelRead0_2_) + { + if (this.channel.isOpen()) + { + if (p_channelRead0_2_.hasPriority()) + { + p_channelRead0_2_.processPacket(this.netHandler); + } + else + { + this.receivedPacketsQueue.add(p_channelRead0_2_); + } + } + } + + /** + * Sets the NetHandler for this NetworkManager, no checks are made if this handler is suitable for the particular + * connection state (protocol) + */ + public void setNetHandler(INetHandler handler) + { + Validate.notNull(handler, "packetListener", new Object[0]); + logger.debug("Set listener of {} to {}", new Object[] {this, handler}); + this.netHandler = handler; + } + + /** + * Will flush the outbound queue and dispatch the supplied Packet if the channel is ready, otherwise it adds the + * packet to the outbound queue and registers the GenericFutureListener to fire after transmission + */ + public void scheduleOutboundPacket(Packet inPacket, GenericFutureListener ... futureListeners) + { + if (this.channel != null && this.channel.isOpen()) + { + this.flushOutboundQueue(); + this.dispatchPacket(inPacket, futureListeners); + } + else + { + this.outboundPacketsQueue.add(new NetworkManager.InboundHandlerTuplePacketListener(inPacket, futureListeners)); + } + } + + /** + * Will commit the packet to the channel. If the current thread 'owns' the channel it will write and flush the + * packet, otherwise it will add a task for the channel eventloop thread to do that. + */ + private void dispatchPacket(final Packet inPacket, final GenericFutureListener[] futureListeners) + { + final EnumConnectionState enumconnectionstate = EnumConnectionState.func_150752_a(inPacket); + final EnumConnectionState enumconnectionstate1 = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).get(); + + if (enumconnectionstate1 != enumconnectionstate && !( inPacket instanceof FMLProxyPacket)) + { + logger.debug("Disabled auto read"); + this.channel.config().setAutoRead(false); + } + + if (this.channel.eventLoop().inEventLoop()) + { + if (enumconnectionstate != enumconnectionstate1 && !( inPacket instanceof FMLProxyPacket)) + { + this.setConnectionState(enumconnectionstate); + } + + this.channel.writeAndFlush(inPacket).addListeners(futureListeners).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + else + { + this.channel.eventLoop().execute(new Runnable() + { + private static final String __OBFID = "CL_00001241"; + public void run() + { + if (enumconnectionstate != enumconnectionstate1 && !( inPacket instanceof FMLProxyPacket)) + { + NetworkManager.this.setConnectionState(enumconnectionstate); + } + + NetworkManager.this.channel.writeAndFlush(inPacket).addListeners(futureListeners).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + } + }); + } + } + + /** + * Will iterate through the outboundPacketQueue and dispatch all Packets + */ + private void flushOutboundQueue() + { + if (this.channel != null && this.channel.isOpen()) + { + while (!this.outboundPacketsQueue.isEmpty()) + { + NetworkManager.InboundHandlerTuplePacketListener inboundhandlertuplepacketlistener = (NetworkManager.InboundHandlerTuplePacketListener)this.outboundPacketsQueue.poll(); + this.dispatchPacket(inboundhandlertuplepacketlistener.field_150774_a, inboundhandlertuplepacketlistener.field_150773_b); + } + } + } + + /** + * Checks timeouts and processes all packets received + */ + public void processReceivedPackets() + { + this.flushOutboundQueue(); + EnumConnectionState enumconnectionstate = (EnumConnectionState)this.channel.attr(attrKeyConnectionState).get(); + + if (this.connectionState != enumconnectionstate) + { + if (this.connectionState != null) + { + this.netHandler.onConnectionStateTransition(this.connectionState, enumconnectionstate); + } + + this.connectionState = enumconnectionstate; + } + + if (this.netHandler != null) + { + for (int i = 1000; !this.receivedPacketsQueue.isEmpty() && i >= 0; --i) + { + Packet packet = (Packet)this.receivedPacketsQueue.poll(); + packet.processPacket(this.netHandler); + } + + this.netHandler.onNetworkTick(); + } + + this.channel.flush(); + } + + /** + * Return the InetSocketAddress of the remote endpoint + */ + public SocketAddress getSocketAddress() + { + return this.socketAddress; + } + + /** + * Closes the channel, the parameter can be used for an exit message (not certain how it gets sent) + */ + public void closeChannel(IChatComponent message) + { + if (this.channel.isOpen()) + { + this.channel.close(); + this.terminationReason = message; + } + } + + /** + * True if this NetworkManager uses a memory connection (single player game). False may imply both an active TCP + * connection or simply no active connection at all + */ + public boolean isLocalChannel() + { + return this.channel instanceof LocalChannel || this.channel instanceof LocalServerChannel; + } + + /** + * Prepares a clientside NetworkManager: establishes a connection to the address and port supplied and configures + * the channel pipeline. Returns the newly created instance. + */ + @SideOnly(Side.CLIENT) + public static NetworkManager provideLanClient(InetAddress p_150726_0_, int p_150726_1_) + { + final NetworkManager networkmanager = new NetworkManager(true); + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group(eventLoops)).handler(new ChannelInitializer() + { + private static final String __OBFID = "CL_00001242"; + protected void initChannel(Channel p_initChannel_1_) + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, Integer.valueOf(24)); + } + catch (ChannelException channelexception1) + { + ; + } + + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(false)); + } + catch (ChannelException channelexception) + { + ; + } + + p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(20)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)).addLast("packet_handler", networkmanager); + } + })).channel(NioSocketChannel.class)).connect(p_150726_0_, p_150726_1_).syncUninterruptibly(); + return networkmanager; + } + + /** + * Prepares a clientside NetworkManager: establishes a connection to the socket supplied and configures the channel + * pipeline. Returns the newly created instance. + */ + @SideOnly(Side.CLIENT) + public static NetworkManager provideLocalClient(SocketAddress p_150722_0_) + { + final NetworkManager networkmanager = new NetworkManager(true); + ((Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group(eventLoops)).handler(new ChannelInitializer() + { + private static final String __OBFID = "CL_00001243"; + protected void initChannel(Channel p_initChannel_1_) + { + p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); + } + })).channel(LocalChannel.class)).connect(p_150722_0_).syncUninterruptibly(); + return networkmanager; + } + + /** + * Adds an encoder+decoder to the channel pipeline. The parameter is the secret key used for encrypted communication + */ + public void enableEncryption(SecretKey key) + { + this.channel.pipeline().addBefore("splitter", "decrypt", new NettyEncryptingDecoder(CryptManager.func_151229_a(2, key))); + this.channel.pipeline().addBefore("prepender", "encrypt", new NettyEncryptingEncoder(CryptManager.func_151229_a(1, key))); + this.field_152463_r = true; + } + + /** + * Returns true if this NetworkManager has an active channel, false otherwise + */ + public boolean isChannelOpen() + { + return this.channel != null && this.channel.isOpen(); + } + + /** + * Gets the current handler for processing packets + */ + public INetHandler getNetHandler() + { + return this.netHandler; + } + + /** + * If this channel is closed, returns the exit message, null otherwise. + */ + public IChatComponent getExitMessage() + { + return this.terminationReason; + } + + /** + * Switches the channel to manual reading modus + */ + public void disableAutoRead() + { + this.channel.config().setAutoRead(false); + } + + protected void channelRead0(ChannelHandlerContext p_channelRead0_1_, Object p_channelRead0_2_) + { + this.channelRead0(p_channelRead0_1_, (Packet)p_channelRead0_2_); + } + + public Channel channel() + { + return channel; + } + + static class InboundHandlerTuplePacketListener + { + private final Packet field_150774_a; + private final GenericFutureListener[] field_150773_b; + private static final String __OBFID = "CL_00001244"; + + public InboundHandlerTuplePacketListener(Packet inPacket, GenericFutureListener ... inFutureListeners) + { + this.field_150774_a = inPacket; + this.field_150773_b = inFutureListeners; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NetworkStatistics.java b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkStatistics.java new file mode 100644 index 0000000..c525867 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkStatistics.java @@ -0,0 +1,243 @@ +package net.minecraft.network; + +import java.util.concurrent.atomic.AtomicReference; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class NetworkStatistics +{ + private static final Logger field_152478_a = LogManager.getLogger(); + private static final Marker field_152479_b = MarkerManager.getMarker("NETSTAT_MARKER", NetworkManager.field_152461_c); + private NetworkStatistics.Tracker field_152480_c = new NetworkStatistics.Tracker(); + private NetworkStatistics.Tracker field_152481_d = new NetworkStatistics.Tracker(); + private static final String __OBFID = "CL_00001897"; + + public void func_152469_a(int p_152469_1_, long p_152469_2_) + { + this.field_152480_c.func_152488_a(p_152469_1_, p_152469_2_); + } + + public void func_152464_b(int p_152464_1_, long p_152464_2_) + { + this.field_152481_d.func_152488_a(p_152464_1_, p_152464_2_); + } + + public long func_152465_a() + { + return this.field_152480_c.func_152485_a(); + } + + public long func_152471_b() + { + return this.field_152481_d.func_152485_a(); + } + + public long func_152472_c() + { + return this.field_152480_c.func_152489_b(); + } + + public long func_152473_d() + { + return this.field_152481_d.func_152489_b(); + } + + public NetworkStatistics.PacketStat func_152477_e() + { + return this.field_152480_c.func_152484_c(); + } + + public NetworkStatistics.PacketStat func_152467_f() + { + return this.field_152480_c.func_152486_d(); + } + + public NetworkStatistics.PacketStat func_152475_g() + { + return this.field_152481_d.func_152484_c(); + } + + public NetworkStatistics.PacketStat func_152470_h() + { + return this.field_152481_d.func_152486_d(); + } + + public NetworkStatistics.PacketStat func_152466_a(int p_152466_1_) + { + return this.field_152480_c.func_152487_a(p_152466_1_); + } + + public NetworkStatistics.PacketStat func_152468_b(int p_152468_1_) + { + return this.field_152481_d.func_152487_a(p_152468_1_); + } + + public static class PacketStat + { + private final int field_152482_a; + private final NetworkStatistics.PacketStatData field_152483_b; + private static final String __OBFID = "CL_00001895"; + + public PacketStat(int id, NetworkStatistics.PacketStatData statData) + { + this.field_152482_a = id; + this.field_152483_b = statData; + } + + public String toString() + { + return "PacketStat(" + this.field_152482_a + ")" + this.field_152483_b; + } + } + + static class PacketStatData + { + private final long field_152496_a; + private final int field_152497_b; + private final double field_152498_c; + private static final String __OBFID = "CL_00001893"; + + private PacketStatData(long p_i1184_1_, int p_i1184_3_, double p_i1184_4_) + { + this.field_152496_a = p_i1184_1_; + this.field_152497_b = p_i1184_3_; + this.field_152498_c = p_i1184_4_; + } + + public NetworkStatistics.PacketStatData func_152494_a(long p_152494_1_) + { + return new NetworkStatistics.PacketStatData(p_152494_1_ + this.field_152496_a, this.field_152497_b + 1, (double)((p_152494_1_ + this.field_152496_a) / (long)(this.field_152497_b + 1))); + } + + public long func_152493_a() + { + return this.field_152496_a; + } + + public int func_152495_b() + { + return this.field_152497_b; + } + + public String toString() + { + return "{totalBytes=" + this.field_152496_a + ", count=" + this.field_152497_b + ", averageBytes=" + this.field_152498_c + '}'; + } + + PacketStatData(long p_i1185_1_, int p_i1185_3_, double p_i1185_4_, Object p_i1185_6_) + { + this(p_i1185_1_, p_i1185_3_, p_i1185_4_); + } + } + + static class Tracker + { + private AtomicReference[] field_152490_a = new AtomicReference[100]; + private static final String __OBFID = "CL_00001894"; + + public Tracker() + { + for (int i = 0; i < 100; ++i) + { + this.field_152490_a[i] = new AtomicReference(new NetworkStatistics.PacketStatData(0L, 0, 0.0D, null)); + } + } + + public void func_152488_a(int p_152488_1_, long p_152488_2_) + { + try + { + if (p_152488_1_ < 0 || p_152488_1_ >= 100) + { + return; + } + + NetworkStatistics.PacketStatData packetstatdata; + NetworkStatistics.PacketStatData packetstatdata1; + + do + { + packetstatdata = (NetworkStatistics.PacketStatData)this.field_152490_a[p_152488_1_].get(); + packetstatdata1 = packetstatdata.func_152494_a(p_152488_2_); + } + while (!this.field_152490_a[p_152488_1_].compareAndSet(packetstatdata, packetstatdata1)); + } + catch (Exception exception) + { + if (NetworkStatistics.field_152478_a.isDebugEnabled()) + { + NetworkStatistics.field_152478_a.debug(NetworkStatistics.field_152479_b, "NetStat failed with packetId: " + p_152488_1_, exception); + } + } + } + + public long func_152485_a() + { + long i = 0L; + + for (int j = 0; j < 100; ++j) + { + i += ((NetworkStatistics.PacketStatData)this.field_152490_a[j].get()).func_152493_a(); + } + + return i; + } + + public long func_152489_b() + { + long i = 0L; + + for (int j = 0; j < 100; ++j) + { + i += (long)((NetworkStatistics.PacketStatData)this.field_152490_a[j].get()).func_152495_b(); + } + + return i; + } + + public NetworkStatistics.PacketStat func_152484_c() + { + int i = -1; + NetworkStatistics.PacketStatData packetstatdata = new NetworkStatistics.PacketStatData(-1L, -1, 0.0D, null); + + for (int j = 0; j < 100; ++j) + { + NetworkStatistics.PacketStatData packetstatdata1 = (NetworkStatistics.PacketStatData)this.field_152490_a[j].get(); + + if (packetstatdata1.field_152496_a > packetstatdata.field_152496_a) + { + i = j; + packetstatdata = packetstatdata1; + } + } + + return new NetworkStatistics.PacketStat(i, packetstatdata); + } + + public NetworkStatistics.PacketStat func_152486_d() + { + int i = -1; + NetworkStatistics.PacketStatData packetstatdata = new NetworkStatistics.PacketStatData(-1L, -1, 0.0D, null); + + for (int j = 0; j < 100; ++j) + { + NetworkStatistics.PacketStatData packetstatdata1 = (NetworkStatistics.PacketStatData)this.field_152490_a[j].get(); + + if (packetstatdata1.field_152497_b > packetstatdata.field_152497_b) + { + i = j; + packetstatdata = packetstatdata1; + } + } + + return new NetworkStatistics.PacketStat(i, packetstatdata); + } + + public NetworkStatistics.PacketStat func_152487_a(int p_152487_1_) + { + return p_152487_1_ >= 0 && p_152487_1_ < 100 ? new NetworkStatistics.PacketStat(p_152487_1_, (NetworkStatistics.PacketStatData)this.field_152490_a[p_152487_1_].get()) : null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/NetworkSystem.java b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkSystem.java new file mode 100644 index 0000000..d061d9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/NetworkSystem.java @@ -0,0 +1,223 @@ +package net.minecraft.network; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelException; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.local.LocalAddress; +import io.netty.channel.local.LocalServerChannel; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.net.InetAddress; +import java.net.SocketAddress; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.Callable; +import net.minecraft.client.network.NetHandlerHandshakeMemory; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.network.play.server.S40PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.NetHandlerHandshakeTCP; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MessageDeserializer; +import net.minecraft.util.MessageDeserializer2; +import net.minecraft.util.MessageSerializer; +import net.minecraft.util.MessageSerializer2; +import net.minecraft.util.ReportedException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetworkSystem +{ + private static final Logger logger = LogManager.getLogger(); + private static final NioEventLoopGroup eventLoops = new NioEventLoopGroup(0, (new ThreadFactoryBuilder()).setNameFormat("Netty IO #%d").setDaemon(true).build()); + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + /** True if this NetworkSystem has never had his endpoints terminated */ + public volatile boolean isAlive; + /** Contains all endpoints added to this NetworkSystem */ + private final List endpoints = Collections.synchronizedList(new ArrayList()); + /** A list containing all NetworkManager instances of all endpoints */ + private final List networkManagers = Collections.synchronizedList(new ArrayList()); + private static final String __OBFID = "CL_00001447"; + + public NetworkSystem(MinecraftServer server) + { + this.mcServer = server; + this.isAlive = true; + } + + /** + * Adds a channel that listens on publicly accessible network ports + */ + public void addLanEndpoint(InetAddress address, int port) throws IOException + { + List list = this.endpoints; + + synchronized (this.endpoints) + { + this.endpoints.add(((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(NioServerSocketChannel.class)).childHandler(new ChannelInitializer() + { + private static final String __OBFID = "CL_00001448"; + protected void initChannel(Channel p_initChannel_1_) + { + try + { + p_initChannel_1_.config().setOption(ChannelOption.IP_TOS, Integer.valueOf(24)); + } + catch (ChannelException channelexception1) + { + ; + } + + try + { + p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(false)); + } + catch (ChannelException channelexception) + { + ; + } + + p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(FMLNetworkHandler.READ_TIMEOUT)).addLast("legacy_query", new PingResponseHandler(NetworkSystem.this)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)); + NetworkManager networkmanager = new NetworkManager(false); + NetworkSystem.this.networkManagers.add(networkmanager); + p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); + networkmanager.setNetHandler(new NetHandlerHandshakeTCP(NetworkSystem.this.mcServer, networkmanager)); + } + }).group(eventLoops).localAddress(address, port)).bind().syncUninterruptibly()); + } + } + + /** + * Adds a channel that listens locally + */ + @SideOnly(Side.CLIENT) + public SocketAddress addLocalEndpoint() + { + List list = this.endpoints; + ChannelFuture channelfuture; + + synchronized (this.endpoints) + { + channelfuture = ((ServerBootstrap)((ServerBootstrap)(new ServerBootstrap()).channel(LocalServerChannel.class)).childHandler(new ChannelInitializer() + { + private static final String __OBFID = "CL_00001449"; + protected void initChannel(Channel p_initChannel_1_) + { + NetworkManager networkmanager = new NetworkManager(false); + networkmanager.setNetHandler(new NetHandlerHandshakeMemory(NetworkSystem.this.mcServer, networkmanager)); + NetworkSystem.this.networkManagers.add(networkmanager); + p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); + } + }).group(eventLoops).localAddress(LocalAddress.ANY)).bind().syncUninterruptibly(); + this.endpoints.add(channelfuture); + } + + return channelfuture.channel().localAddress(); + } + + /** + * Shuts down all open endpoints (with immediate effect?) + */ + public void terminateEndpoints() + { + this.isAlive = false; + Iterator iterator = this.endpoints.iterator(); + + while (iterator.hasNext()) + { + ChannelFuture channelfuture = (ChannelFuture)iterator.next(); + channelfuture.channel().close().syncUninterruptibly(); + } + } + + /** + * Will try to process the packets received by each NetworkManager, gracefully manage processing failures and cleans + * up dead connections + */ + public void networkTick() + { + List list = this.networkManagers; + + synchronized (this.networkManagers) + { + Iterator iterator = this.networkManagers.iterator(); + + while (iterator.hasNext()) + { + final NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (!networkmanager.isChannelOpen()) + { + iterator.remove(); + + if (networkmanager.getExitMessage() != null) + { + networkmanager.getNetHandler().onDisconnect(networkmanager.getExitMessage()); + } + else if (networkmanager.getNetHandler() != null) + { + networkmanager.getNetHandler().onDisconnect(new ChatComponentText("Disconnected")); + } + } + else + { + try + { + networkmanager.processReceivedPackets(); + } + catch (Exception exception) + { + if (networkmanager.isLocalChannel()) + { + CrashReport crashreport = CrashReport.makeCrashReport(exception, "Ticking memory connection"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Ticking connection"); + crashreportcategory.addCrashSectionCallable("Connection", new Callable() + { + private static final String __OBFID = "CL_00001450"; + public String call() + { + return networkmanager.toString(); + } + }); + throw new ReportedException(crashreport); + } + + logger.warn("Failed to handle packet for " + networkmanager.getSocketAddress(), exception); + final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error"); + networkmanager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener[] {new GenericFutureListener() + { + private static final String __OBFID = "CL_00001451"; + public void operationComplete(Future p_operationComplete_1_) + { + networkmanager.closeChannel(chatcomponenttext); + } + } + }); + networkmanager.disableAutoRead(); + } + } + } + } + } + + public MinecraftServer func_151267_d() + { + return this.mcServer; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/Packet.java b/build/rfg/minecraft-src/java/net/minecraft/network/Packet.java new file mode 100644 index 0000000..484652a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/Packet.java @@ -0,0 +1,97 @@ +package net.minecraft.network; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class Packet +{ + private static final Logger logger = LogManager.getLogger(); + private static final String __OBFID = "CL_00001272"; + + /** + * Returns a packet instance, given the params: BiMap and (int) id + */ + public static Packet generatePacket(BiMap protocolMap, int packetId) + { + try + { + Class oclass = (Class)protocolMap.get(Integer.valueOf(packetId)); + return oclass == null ? null : (Packet)oclass.newInstance(); + } + catch (Exception exception) + { + logger.error("Couldn\'t create packet " + packetId, exception); + return null; + } + } + + /** + * Will write a byte array to supplied ByteBuf as a separately defined structure by prefixing the byte array with + * its length + */ + public static void writeBlob(ByteBuf buffer, byte[] blob) + { + buffer.writeShort(blob.length); + buffer.writeBytes(blob); + } + + /** + * Will read a byte array from the supplied ByteBuf, the first short encountered will be interpreted as the size of + * the byte array to read in + */ + public static byte[] readBlob(ByteBuf buffer) throws IOException + { + short short1 = buffer.readShort(); + + if (short1 < 0) + { + throw new IOException("Key was smaller than nothing! Weird key!"); + } + else + { + byte[] abyte = new byte[short1]; + buffer.readBytes(abyte); + return abyte; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public abstract void readPacketData(PacketBuffer data) throws IOException; + + /** + * Writes the raw packet data to the data stream. + */ + public abstract void writePacketData(PacketBuffer data) throws IOException; + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public abstract void processPacket(INetHandler handler); + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return false; + } + + public String toString() + { + return this.getClass().getSimpleName(); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return ""; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/PacketBuffer.java b/build/rfg/minecraft-src/java/net/minecraft/network/PacketBuffer.java new file mode 100644 index 0000000..f446c9a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/PacketBuffer.java @@ -0,0 +1,936 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.ByteBufProcessor; +import io.netty.util.ReferenceCounted; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.channels.GatheringByteChannel; +import java.nio.channels.ScatteringByteChannel; +import java.nio.charset.Charset; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTSizeTracker; +import net.minecraft.nbt.NBTTagCompound; + +public class PacketBuffer extends ByteBuf +{ + private final ByteBuf field_150794_a; + private static final String __OBFID = "CL_00001251"; + + public PacketBuffer(ByteBuf wrapped) + { + this.field_150794_a = wrapped; + } + + /** + * Calculates the number of bytes required to fit the supplied int (0-5) if it were to be read/written using + * readVarIntFromBuffer or writeVarIntToBuffer + */ + public static int getVarIntSize(int input) + { + return (input & -128) == 0 ? 1 : ((input & -16384) == 0 ? 2 : ((input & -2097152) == 0 ? 3 : ((input & -268435456) == 0 ? 4 : 5))); + } + + /** + * Reads a compressed int from the buffer. To do so it maximally reads 5 byte-sized chunks whose most significant + * bit dictates whether another byte should be read. + */ + public int readVarIntFromBuffer() + { + int i = 0; + int j = 0; + byte b0; + + do + { + b0 = this.readByte(); + i |= (b0 & 127) << j++ * 7; + + if (j > 5) + { + throw new RuntimeException("VarInt too big"); + } + } + while ((b0 & 128) == 128); + + return i; + } + + /** + * Writes a compressed int to the buffer. The smallest number of bytes to fit the passed int will be written. Of + * each such byte only 7 bits will be used to describe the actual value since its most significant bit dictates + * whether the next byte is part of that same int. Micro-optimization for int values that are expected to have + * values below 128. + */ + public void writeVarIntToBuffer(int input) + { + while ((input & -128) != 0) + { + this.writeByte(input & 127 | 128); + input >>>= 7; + } + + this.writeByte(input); + } + + /** + * Writes a compressed NBTTagCompound to this buffer + */ + public void writeNBTTagCompoundToBuffer(NBTTagCompound nbt) throws IOException + { + if (nbt == null) + { + this.writeShort(-1); + } + else + { + byte[] abyte = CompressedStreamTools.compress(nbt); + this.writeShort((short)abyte.length); + this.writeBytes(abyte); + } + } + + /** + * Reads a compressed NBTTagCompound from this buffer + */ + public NBTTagCompound readNBTTagCompoundFromBuffer() throws IOException + { + short short1 = this.readShort(); + + if (short1 < 0) + { + return null; + } + else + { + byte[] abyte = new byte[short1]; + this.readBytes(abyte); + return CompressedStreamTools.func_152457_a(abyte, new NBTSizeTracker(2097152L)); + } + } + + /** + * Writes the ItemStack's ID (short), then size (byte), then damage. (short) + */ + public void writeItemStackToBuffer(ItemStack stack) throws IOException + { + if (stack == null) + { + this.writeShort(-1); + } + else + { + this.writeShort(Item.getIdFromItem(stack.getItem())); + this.writeByte(stack.stackSize); + this.writeShort(stack.getItemDamage()); + NBTTagCompound nbttagcompound = null; + + if (stack.getItem().isDamageable() || stack.getItem().getShareTag()) + { + nbttagcompound = stack.stackTagCompound; + } + + this.writeNBTTagCompoundToBuffer(nbttagcompound); + } + } + + /** + * Reads an ItemStack from this buffer + */ + public ItemStack readItemStackFromBuffer() throws IOException + { + ItemStack itemstack = null; + short short1 = this.readShort(); + + if (short1 >= 0) + { + byte b0 = this.readByte(); + short short2 = this.readShort(); + itemstack = new ItemStack(Item.getItemById(short1), b0, short2); + itemstack.stackTagCompound = this.readNBTTagCompoundFromBuffer(); + } + + return itemstack; + } + + /** + * Reads a string from this buffer. Expected parameter is maximum allowed string length. Will throw IOException if + * string length exceeds this value! + */ + public String readStringFromBuffer(int maxLength) throws IOException + { + int j = this.readVarIntFromBuffer(); + + if (j > maxLength * 4) + { + throw new IOException("The received encoded string buffer length is longer than maximum allowed (" + j + " > " + maxLength * 4 + ")"); + } + else if (j < 0) + { + throw new IOException("The received encoded string buffer length is less than zero! Weird string!"); + } + else + { + String s = new String(this.readBytes(j).array(), Charsets.UTF_8); + + if (s.length() > maxLength) + { + throw new IOException("The received string length is longer than maximum allowed (" + j + " > " + maxLength + ")"); + } + else + { + return s; + } + } + } + + /** + * Writes a (UTF-8 encoded) String to this buffer. Will throw IOException if String length exceeds 32767 bytes + */ + public void writeStringToBuffer(String str) throws IOException + { + byte[] abyte = str.getBytes(Charsets.UTF_8); + + if (abyte.length > 32767) + { + throw new IOException("String too big (was " + str.length() + " bytes encoded, max " + 32767 + ")"); + } + else + { + this.writeVarIntToBuffer(abyte.length); + this.writeBytes(abyte); + } + } + + public int capacity() + { + return this.field_150794_a.capacity(); + } + + public ByteBuf capacity(int p_capacity_1_) + { + return this.field_150794_a.capacity(p_capacity_1_); + } + + public int maxCapacity() + { + return this.field_150794_a.maxCapacity(); + } + + public ByteBufAllocator alloc() + { + return this.field_150794_a.alloc(); + } + + public ByteOrder order() + { + return this.field_150794_a.order(); + } + + public ByteBuf order(ByteOrder p_order_1_) + { + return this.field_150794_a.order(p_order_1_); + } + + public ByteBuf unwrap() + { + return this.field_150794_a.unwrap(); + } + + public boolean isDirect() + { + return this.field_150794_a.isDirect(); + } + + public int readerIndex() + { + return this.field_150794_a.readerIndex(); + } + + public ByteBuf readerIndex(int p_readerIndex_1_) + { + return this.field_150794_a.readerIndex(p_readerIndex_1_); + } + + public int writerIndex() + { + return this.field_150794_a.writerIndex(); + } + + public ByteBuf writerIndex(int p_writerIndex_1_) + { + return this.field_150794_a.writerIndex(p_writerIndex_1_); + } + + public ByteBuf setIndex(int p_setIndex_1_, int p_setIndex_2_) + { + return this.field_150794_a.setIndex(p_setIndex_1_, p_setIndex_2_); + } + + public int readableBytes() + { + return this.field_150794_a.readableBytes(); + } + + public int writableBytes() + { + return this.field_150794_a.writableBytes(); + } + + public int maxWritableBytes() + { + return this.field_150794_a.maxWritableBytes(); + } + + public boolean isReadable() + { + return this.field_150794_a.isReadable(); + } + + public boolean isReadable(int p_isReadable_1_) + { + return this.field_150794_a.isReadable(p_isReadable_1_); + } + + public boolean isWritable() + { + return this.field_150794_a.isWritable(); + } + + public boolean isWritable(int p_isWritable_1_) + { + return this.field_150794_a.isWritable(p_isWritable_1_); + } + + public ByteBuf clear() + { + return this.field_150794_a.clear(); + } + + public ByteBuf markReaderIndex() + { + return this.field_150794_a.markReaderIndex(); + } + + public ByteBuf resetReaderIndex() + { + return this.field_150794_a.resetReaderIndex(); + } + + public ByteBuf markWriterIndex() + { + return this.field_150794_a.markWriterIndex(); + } + + public ByteBuf resetWriterIndex() + { + return this.field_150794_a.resetWriterIndex(); + } + + public ByteBuf discardReadBytes() + { + return this.field_150794_a.discardReadBytes(); + } + + public ByteBuf discardSomeReadBytes() + { + return this.field_150794_a.discardSomeReadBytes(); + } + + public ByteBuf ensureWritable(int p_ensureWritable_1_) + { + return this.field_150794_a.ensureWritable(p_ensureWritable_1_); + } + + public int ensureWritable(int p_ensureWritable_1_, boolean p_ensureWritable_2_) + { + return this.field_150794_a.ensureWritable(p_ensureWritable_1_, p_ensureWritable_2_); + } + + public boolean getBoolean(int p_getBoolean_1_) + { + return this.field_150794_a.getBoolean(p_getBoolean_1_); + } + + public byte getByte(int p_getByte_1_) + { + return this.field_150794_a.getByte(p_getByte_1_); + } + + public short getUnsignedByte(int p_getUnsignedByte_1_) + { + return this.field_150794_a.getUnsignedByte(p_getUnsignedByte_1_); + } + + public short getShort(int p_getShort_1_) + { + return this.field_150794_a.getShort(p_getShort_1_); + } + + public int getUnsignedShort(int p_getUnsignedShort_1_) + { + return this.field_150794_a.getUnsignedShort(p_getUnsignedShort_1_); + } + + public int getMedium(int p_getMedium_1_) + { + return this.field_150794_a.getMedium(p_getMedium_1_); + } + + public int getUnsignedMedium(int p_getUnsignedMedium_1_) + { + return this.field_150794_a.getUnsignedMedium(p_getUnsignedMedium_1_); + } + + public int getInt(int p_getInt_1_) + { + return this.field_150794_a.getInt(p_getInt_1_); + } + + public long getUnsignedInt(int p_getUnsignedInt_1_) + { + return this.field_150794_a.getUnsignedInt(p_getUnsignedInt_1_); + } + + public long getLong(int p_getLong_1_) + { + return this.field_150794_a.getLong(p_getLong_1_); + } + + public char getChar(int p_getChar_1_) + { + return this.field_150794_a.getChar(p_getChar_1_); + } + + public float getFloat(int p_getFloat_1_) + { + return this.field_150794_a.getFloat(p_getFloat_1_); + } + + public double getDouble(int p_getDouble_1_) + { + return this.field_150794_a.getDouble(p_getDouble_1_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuf p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, byte[] p_getBytes_2_, int p_getBytes_3_, int p_getBytes_4_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_, p_getBytes_4_); + } + + public ByteBuf getBytes(int p_getBytes_1_, ByteBuffer p_getBytes_2_) + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_); + } + + public ByteBuf getBytes(int p_getBytes_1_, OutputStream p_getBytes_2_, int p_getBytes_3_) throws IOException + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public int getBytes(int p_getBytes_1_, GatheringByteChannel p_getBytes_2_, int p_getBytes_3_) throws IOException + { + return this.field_150794_a.getBytes(p_getBytes_1_, p_getBytes_2_, p_getBytes_3_); + } + + public ByteBuf setBoolean(int p_setBoolean_1_, boolean p_setBoolean_2_) + { + return this.field_150794_a.setBoolean(p_setBoolean_1_, p_setBoolean_2_); + } + + public ByteBuf setByte(int p_setByte_1_, int p_setByte_2_) + { + return this.field_150794_a.setByte(p_setByte_1_, p_setByte_2_); + } + + public ByteBuf setShort(int p_setShort_1_, int p_setShort_2_) + { + return this.field_150794_a.setShort(p_setShort_1_, p_setShort_2_); + } + + public ByteBuf setMedium(int p_setMedium_1_, int p_setMedium_2_) + { + return this.field_150794_a.setMedium(p_setMedium_1_, p_setMedium_2_); + } + + public ByteBuf setInt(int p_setInt_1_, int p_setInt_2_) + { + return this.field_150794_a.setInt(p_setInt_1_, p_setInt_2_); + } + + public ByteBuf setLong(int p_setLong_1_, long p_setLong_2_) + { + return this.field_150794_a.setLong(p_setLong_1_, p_setLong_2_); + } + + public ByteBuf setChar(int p_setChar_1_, int p_setChar_2_) + { + return this.field_150794_a.setChar(p_setChar_1_, p_setChar_2_); + } + + public ByteBuf setFloat(int p_setFloat_1_, float p_setFloat_2_) + { + return this.field_150794_a.setFloat(p_setFloat_1_, p_setFloat_2_); + } + + public ByteBuf setDouble(int p_setDouble_1_, double p_setDouble_2_) + { + return this.field_150794_a.setDouble(p_setDouble_1_, p_setDouble_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuf p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public ByteBuf setBytes(int p_setBytes_1_, byte[] p_setBytes_2_, int p_setBytes_3_, int p_setBytes_4_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_, p_setBytes_4_); + } + + public ByteBuf setBytes(int p_setBytes_1_, ByteBuffer p_setBytes_2_) + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_); + } + + public int setBytes(int p_setBytes_1_, InputStream p_setBytes_2_, int p_setBytes_3_) throws IOException + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public int setBytes(int p_setBytes_1_, ScatteringByteChannel p_setBytes_2_, int p_setBytes_3_) throws IOException + { + return this.field_150794_a.setBytes(p_setBytes_1_, p_setBytes_2_, p_setBytes_3_); + } + + public ByteBuf setZero(int p_setZero_1_, int p_setZero_2_) + { + return this.field_150794_a.setZero(p_setZero_1_, p_setZero_2_); + } + + public boolean readBoolean() + { + return this.field_150794_a.readBoolean(); + } + + public byte readByte() + { + return this.field_150794_a.readByte(); + } + + public short readUnsignedByte() + { + return this.field_150794_a.readUnsignedByte(); + } + + public short readShort() + { + return this.field_150794_a.readShort(); + } + + public int readUnsignedShort() + { + return this.field_150794_a.readUnsignedShort(); + } + + public int readMedium() + { + return this.field_150794_a.readMedium(); + } + + public int readUnsignedMedium() + { + return this.field_150794_a.readUnsignedMedium(); + } + + public int readInt() + { + return this.field_150794_a.readInt(); + } + + public long readUnsignedInt() + { + return this.field_150794_a.readUnsignedInt(); + } + + public long readLong() + { + return this.field_150794_a.readLong(); + } + + public char readChar() + { + return this.field_150794_a.readChar(); + } + + public float readFloat() + { + return this.field_150794_a.readFloat(); + } + + public double readDouble() + { + return this.field_150794_a.readDouble(); + } + + public ByteBuf readBytes(int p_readBytes_1_) + { + return this.field_150794_a.readBytes(p_readBytes_1_); + } + + public ByteBuf readSlice(int p_readSlice_1_) + { + return this.field_150794_a.readSlice(p_readSlice_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_) + { + return this.field_150794_a.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_) + { + return this.field_150794_a.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf readBytes(ByteBuf p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) + { + return this.field_150794_a.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_) + { + return this.field_150794_a.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(byte[] p_readBytes_1_, int p_readBytes_2_, int p_readBytes_3_) + { + return this.field_150794_a.readBytes(p_readBytes_1_, p_readBytes_2_, p_readBytes_3_); + } + + public ByteBuf readBytes(ByteBuffer p_readBytes_1_) + { + return this.field_150794_a.readBytes(p_readBytes_1_); + } + + public ByteBuf readBytes(OutputStream p_readBytes_1_, int p_readBytes_2_) throws IOException + { + return this.field_150794_a.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public int readBytes(GatheringByteChannel p_readBytes_1_, int p_readBytes_2_) throws IOException + { + return this.field_150794_a.readBytes(p_readBytes_1_, p_readBytes_2_); + } + + public ByteBuf skipBytes(int p_skipBytes_1_) + { + return this.field_150794_a.skipBytes(p_skipBytes_1_); + } + + public ByteBuf writeBoolean(boolean p_writeBoolean_1_) + { + return this.field_150794_a.writeBoolean(p_writeBoolean_1_); + } + + public ByteBuf writeByte(int p_writeByte_1_) + { + return this.field_150794_a.writeByte(p_writeByte_1_); + } + + public ByteBuf writeShort(int p_writeShort_1_) + { + return this.field_150794_a.writeShort(p_writeShort_1_); + } + + public ByteBuf writeMedium(int p_writeMedium_1_) + { + return this.field_150794_a.writeMedium(p_writeMedium_1_); + } + + public ByteBuf writeInt(int p_writeInt_1_) + { + return this.field_150794_a.writeInt(p_writeInt_1_); + } + + public ByteBuf writeLong(long p_writeLong_1_) + { + return this.field_150794_a.writeLong(p_writeLong_1_); + } + + public ByteBuf writeChar(int p_writeChar_1_) + { + return this.field_150794_a.writeChar(p_writeChar_1_); + } + + public ByteBuf writeFloat(float p_writeFloat_1_) + { + return this.field_150794_a.writeFloat(p_writeFloat_1_); + } + + public ByteBuf writeDouble(double p_writeDouble_1_) + { + return this.field_150794_a.writeDouble(p_writeDouble_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeBytes(ByteBuf p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_); + } + + public ByteBuf writeBytes(byte[] p_writeBytes_1_, int p_writeBytes_2_, int p_writeBytes_3_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_, p_writeBytes_2_, p_writeBytes_3_); + } + + public ByteBuf writeBytes(ByteBuffer p_writeBytes_1_) + { + return this.field_150794_a.writeBytes(p_writeBytes_1_); + } + + public int writeBytes(InputStream p_writeBytes_1_, int p_writeBytes_2_) throws IOException + { + return this.field_150794_a.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public int writeBytes(ScatteringByteChannel p_writeBytes_1_, int p_writeBytes_2_) throws IOException + { + return this.field_150794_a.writeBytes(p_writeBytes_1_, p_writeBytes_2_); + } + + public ByteBuf writeZero(int p_writeZero_1_) + { + return this.field_150794_a.writeZero(p_writeZero_1_); + } + + public int indexOf(int p_indexOf_1_, int p_indexOf_2_, byte p_indexOf_3_) + { + return this.field_150794_a.indexOf(p_indexOf_1_, p_indexOf_2_, p_indexOf_3_); + } + + public int bytesBefore(byte p_bytesBefore_1_) + { + return this.field_150794_a.bytesBefore(p_bytesBefore_1_); + } + + public int bytesBefore(int p_bytesBefore_1_, byte p_bytesBefore_2_) + { + return this.field_150794_a.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_); + } + + public int bytesBefore(int p_bytesBefore_1_, int p_bytesBefore_2_, byte p_bytesBefore_3_) + { + return this.field_150794_a.bytesBefore(p_bytesBefore_1_, p_bytesBefore_2_, p_bytesBefore_3_); + } + + public int forEachByte(ByteBufProcessor p_forEachByte_1_) + { + return this.field_150794_a.forEachByte(p_forEachByte_1_); + } + + public int forEachByte(int p_forEachByte_1_, int p_forEachByte_2_, ByteBufProcessor p_forEachByte_3_) + { + return this.field_150794_a.forEachByte(p_forEachByte_1_, p_forEachByte_2_, p_forEachByte_3_); + } + + public int forEachByteDesc(ByteBufProcessor p_forEachByteDesc_1_) + { + return this.field_150794_a.forEachByteDesc(p_forEachByteDesc_1_); + } + + public int forEachByteDesc(int p_forEachByteDesc_1_, int p_forEachByteDesc_2_, ByteBufProcessor p_forEachByteDesc_3_) + { + return this.field_150794_a.forEachByteDesc(p_forEachByteDesc_1_, p_forEachByteDesc_2_, p_forEachByteDesc_3_); + } + + public ByteBuf copy() + { + return this.field_150794_a.copy(); + } + + public ByteBuf copy(int p_copy_1_, int p_copy_2_) + { + return this.field_150794_a.copy(p_copy_1_, p_copy_2_); + } + + public ByteBuf slice() + { + return this.field_150794_a.slice(); + } + + public ByteBuf slice(int p_slice_1_, int p_slice_2_) + { + return this.field_150794_a.slice(p_slice_1_, p_slice_2_); + } + + public ByteBuf duplicate() + { + return this.field_150794_a.duplicate(); + } + + public int nioBufferCount() + { + return this.field_150794_a.nioBufferCount(); + } + + public ByteBuffer nioBuffer() + { + return this.field_150794_a.nioBuffer(); + } + + public ByteBuffer nioBuffer(int p_nioBuffer_1_, int p_nioBuffer_2_) + { + return this.field_150794_a.nioBuffer(p_nioBuffer_1_, p_nioBuffer_2_); + } + + public ByteBuffer internalNioBuffer(int p_internalNioBuffer_1_, int p_internalNioBuffer_2_) + { + return this.field_150794_a.internalNioBuffer(p_internalNioBuffer_1_, p_internalNioBuffer_2_); + } + + public ByteBuffer[] nioBuffers() + { + return this.field_150794_a.nioBuffers(); + } + + public ByteBuffer[] nioBuffers(int p_nioBuffers_1_, int p_nioBuffers_2_) + { + return this.field_150794_a.nioBuffers(p_nioBuffers_1_, p_nioBuffers_2_); + } + + public boolean hasArray() + { + return this.field_150794_a.hasArray(); + } + + public byte[] array() + { + return this.field_150794_a.array(); + } + + public int arrayOffset() + { + return this.field_150794_a.arrayOffset(); + } + + public boolean hasMemoryAddress() + { + return this.field_150794_a.hasMemoryAddress(); + } + + public long memoryAddress() + { + return this.field_150794_a.memoryAddress(); + } + + public String toString(Charset p_toString_1_) + { + return this.field_150794_a.toString(p_toString_1_); + } + + public String toString(int p_toString_1_, int p_toString_2_, Charset p_toString_3_) + { + return this.field_150794_a.toString(p_toString_1_, p_toString_2_, p_toString_3_); + } + + public int hashCode() + { + return this.field_150794_a.hashCode(); + } + + public boolean equals(Object p_equals_1_) + { + return this.field_150794_a.equals(p_equals_1_); + } + + public int compareTo(ByteBuf p_compareTo_1_) + { + return this.field_150794_a.compareTo(p_compareTo_1_); + } + + public String toString() + { + return this.field_150794_a.toString(); + } + + public ByteBuf retain(int p_retain_1_) + { + return this.field_150794_a.retain(p_retain_1_); + } + + public ByteBuf retain() + { + return this.field_150794_a.retain(); + } + + public int refCnt() + { + return this.field_150794_a.refCnt(); + } + + public boolean release() + { + return this.field_150794_a.release(); + } + + public boolean release(int p_release_1_) + { + return this.field_150794_a.release(p_release_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/PingResponseHandler.java b/build/rfg/minecraft-src/java/net/minecraft/network/PingResponseHandler.java new file mode 100644 index 0000000..cab41c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/PingResponseHandler.java @@ -0,0 +1,132 @@ +package net.minecraft.network; + +import com.google.common.base.Charsets; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import java.net.InetSocketAddress; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PingResponseHandler extends ChannelInboundHandlerAdapter +{ + private static final Logger logger = LogManager.getLogger(); + private NetworkSystem field_151257_b; + private static final String __OBFID = "CL_00001444"; + + public PingResponseHandler(NetworkSystem networkSystemIn) + { + this.field_151257_b = networkSystemIn; + } + + public void channelRead(ChannelHandlerContext p_channelRead_1_, Object p_channelRead_2_) + { + ByteBuf bytebuf = (ByteBuf)p_channelRead_2_; + bytebuf.markReaderIndex(); + boolean flag = true; + + try + { + try + { + if (bytebuf.readUnsignedByte() != 254) + { + return; + } + + InetSocketAddress inetsocketaddress = (InetSocketAddress)p_channelRead_1_.channel().remoteAddress(); + MinecraftServer minecraftserver = this.field_151257_b.func_151267_d(); + int i = bytebuf.readableBytes(); + String s; + + switch (i) + { + case 0: + logger.debug("Ping: (<1.3.x) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + s = String.format("%s\u00a7%d\u00a7%d", new Object[] {minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + this.func_151256_a(p_channelRead_1_, this.func_151255_a(s)); + break; + case 1: + if (bytebuf.readUnsignedByte() != 1) + { + return; + } + + logger.debug("Ping: (1.4-1.5.x) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] {Integer.valueOf(127), minecraftserver.getMinecraftVersion(), minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + this.func_151256_a(p_channelRead_1_, this.func_151255_a(s)); + break; + default: + boolean flag1 = bytebuf.readUnsignedByte() == 1; + flag1 &= bytebuf.readUnsignedByte() == 250; + flag1 &= "MC|PingHost".equals(new String(bytebuf.readBytes(bytebuf.readShort() * 2).array(), Charsets.UTF_16BE)); + int j = bytebuf.readUnsignedShort(); + flag1 &= bytebuf.readUnsignedByte() >= 73; + flag1 &= 3 + bytebuf.readBytes(bytebuf.readShort() * 2).array().length + 4 == j; + flag1 &= bytebuf.readInt() <= 65535; + flag1 &= bytebuf.readableBytes() == 0; + + if (!flag1) + { + return; + } + + logger.debug("Ping: (1.6) from {}:{}", new Object[] {inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())}); + String s1 = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] {Integer.valueOf(127), minecraftserver.getMinecraftVersion(), minecraftserver.getMOTD(), Integer.valueOf(minecraftserver.getCurrentPlayerCount()), Integer.valueOf(minecraftserver.getMaxPlayers())}); + ByteBuf bytebuf1 = this.func_151255_a(s1); + + try + { + this.func_151256_a(p_channelRead_1_, bytebuf1); + } + finally + { + bytebuf1.release(); + } + } + + bytebuf.release(); + flag = false; + } + catch (RuntimeException runtimeexception) + { + ; + } + } + finally + { + if (flag) + { + bytebuf.resetReaderIndex(); + p_channelRead_1_.channel().pipeline().remove("legacy_query"); + p_channelRead_1_.fireChannelRead(p_channelRead_2_); + } + } + } + + private void func_151256_a(ChannelHandlerContext ctx, ByteBuf data) + { + ctx.pipeline().firstContext().writeAndFlush(data).addListener(ChannelFutureListener.CLOSE); + } + + private ByteBuf func_151255_a(String string) + { + ByteBuf bytebuf = Unpooled.buffer(); + bytebuf.writeByte(255); + char[] achar = string.toCharArray(); + bytebuf.writeShort(achar.length); + char[] achar1 = achar; + int i = achar.length; + + for (int j = 0; j < i; ++j) + { + char c0 = achar1[j]; + bytebuf.writeChar(c0); + } + + return bytebuf; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/ServerStatusResponse.java b/build/rfg/minecraft-src/java/net/minecraft/network/ServerStatusResponse.java new file mode 100644 index 0000000..09029db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/ServerStatusResponse.java @@ -0,0 +1,275 @@ +package net.minecraft.network; + +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import java.lang.reflect.Type; +import java.util.UUID; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.JsonUtils; + +public class ServerStatusResponse +{ + private IChatComponent field_151326_a; + private ServerStatusResponse.PlayerCountData field_151324_b; + private ServerStatusResponse.MinecraftProtocolVersionIdentifier field_151325_c; + private String field_151323_d; + private static final String __OBFID = "CL_00001385"; + + public IChatComponent func_151317_a() + { + return this.field_151326_a; + } + + public void func_151315_a(IChatComponent motd) + { + this.field_151326_a = motd; + } + + public ServerStatusResponse.PlayerCountData func_151318_b() + { + return this.field_151324_b; + } + + public void func_151319_a(ServerStatusResponse.PlayerCountData countData) + { + this.field_151324_b = countData; + } + + public ServerStatusResponse.MinecraftProtocolVersionIdentifier func_151322_c() + { + return this.field_151325_c; + } + + public void func_151321_a(ServerStatusResponse.MinecraftProtocolVersionIdentifier protocolVersionData) + { + this.field_151325_c = protocolVersionData; + } + + public void func_151320_a(String faviconBlob) + { + this.field_151323_d = faviconBlob; + } + + public String func_151316_d() + { + return this.field_151323_d; + } + + public static class MinecraftProtocolVersionIdentifier + { + private final String field_151306_a; + private final int field_151305_b; + private static final String __OBFID = "CL_00001389"; + + public MinecraftProtocolVersionIdentifier(String nameIn, int protocolIn) + { + this.field_151306_a = nameIn; + this.field_151305_b = protocolIn; + } + + public String func_151303_a() + { + return this.field_151306_a; + } + + public int func_151304_b() + { + return this.field_151305_b; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001390"; + + public ServerStatusResponse.MinecraftProtocolVersionIdentifier deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "version"); + return new ServerStatusResponse.MinecraftProtocolVersionIdentifier(JsonUtils.getJsonObjectStringFieldValue(jsonobject, "name"), JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "protocol")); + } + + public JsonElement serialize(ServerStatusResponse.MinecraftProtocolVersionIdentifier p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("name", p_serialize_1_.func_151303_a()); + jsonobject.addProperty("protocol", Integer.valueOf(p_serialize_1_.func_151304_b())); + return jsonobject; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((ServerStatusResponse.MinecraftProtocolVersionIdentifier)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } + } + + public static class PlayerCountData + { + private final int field_151336_a; + private final int field_151334_b; + private GameProfile[] field_151335_c; + private static final String __OBFID = "CL_00001386"; + + public PlayerCountData(int p_i45274_1_, int p_i45274_2_) + { + this.field_151336_a = p_i45274_1_; + this.field_151334_b = p_i45274_2_; + } + + public int func_151332_a() + { + return this.field_151336_a; + } + + public int func_151333_b() + { + return this.field_151334_b; + } + + public GameProfile[] func_151331_c() + { + return this.field_151335_c; + } + + public void func_151330_a(GameProfile[] playersIn) + { + this.field_151335_c = playersIn; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001387"; + + public ServerStatusResponse.PlayerCountData deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "players"); + ServerStatusResponse.PlayerCountData playercountdata = new ServerStatusResponse.PlayerCountData(JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "max"), JsonUtils.getJsonObjectIntegerFieldValue(jsonobject, "online")); + + if (JsonUtils.jsonObjectFieldTypeIsArray(jsonobject, "sample")) + { + JsonArray jsonarray = JsonUtils.getJsonObjectJsonArrayField(jsonobject, "sample"); + + if (jsonarray.size() > 0) + { + GameProfile[] agameprofile = new GameProfile[jsonarray.size()]; + + for (int i = 0; i < agameprofile.length; ++i) + { + JsonObject jsonobject1 = JsonUtils.getJsonElementAsJsonObject(jsonarray.get(i), "player[" + i + "]"); + String s = JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "id"); + agameprofile[i] = new GameProfile(UUID.fromString(s), JsonUtils.getJsonObjectStringFieldValue(jsonobject1, "name")); + } + + playercountdata.func_151330_a(agameprofile); + } + } + + return playercountdata; + } + + public JsonElement serialize(ServerStatusResponse.PlayerCountData p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("max", Integer.valueOf(p_serialize_1_.func_151332_a())); + jsonobject.addProperty("online", Integer.valueOf(p_serialize_1_.func_151333_b())); + + if (p_serialize_1_.func_151331_c() != null && p_serialize_1_.func_151331_c().length > 0) + { + JsonArray jsonarray = new JsonArray(); + + for (int i = 0; i < p_serialize_1_.func_151331_c().length; ++i) + { + JsonObject jsonobject1 = new JsonObject(); + UUID uuid = p_serialize_1_.func_151331_c()[i].getId(); + jsonobject1.addProperty("id", uuid == null ? "" : uuid.toString()); + jsonobject1.addProperty("name", p_serialize_1_.func_151331_c()[i].getName()); + jsonarray.add(jsonobject1); + } + + jsonobject.add("sample", jsonarray); + } + + return jsonobject; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((ServerStatusResponse.PlayerCountData)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001388"; + + public ServerStatusResponse deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + JsonObject jsonobject = JsonUtils.getJsonElementAsJsonObject(p_deserialize_1_, "status"); + ServerStatusResponse serverstatusresponse = new ServerStatusResponse(); + + if (jsonobject.has("description")) + { + serverstatusresponse.func_151315_a((IChatComponent)p_deserialize_3_.deserialize(jsonobject.get("description"), IChatComponent.class)); + } + + if (jsonobject.has("players")) + { + serverstatusresponse.func_151319_a((ServerStatusResponse.PlayerCountData)p_deserialize_3_.deserialize(jsonobject.get("players"), ServerStatusResponse.PlayerCountData.class)); + } + + if (jsonobject.has("version")) + { + serverstatusresponse.func_151321_a((ServerStatusResponse.MinecraftProtocolVersionIdentifier)p_deserialize_3_.deserialize(jsonobject.get("version"), ServerStatusResponse.MinecraftProtocolVersionIdentifier.class)); + } + + if (jsonobject.has("favicon")) + { + serverstatusresponse.func_151320_a(JsonUtils.getJsonObjectStringFieldValue(jsonobject, "favicon")); + } + + FMLClientHandler.instance().captureAdditionalData(serverstatusresponse, jsonobject); + return serverstatusresponse; + } + + public JsonElement serialize(ServerStatusResponse p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + JsonObject jsonobject = new JsonObject(); + + if (p_serialize_1_.func_151317_a() != null) + { + jsonobject.add("description", p_serialize_3_.serialize(p_serialize_1_.func_151317_a())); + } + + if (p_serialize_1_.func_151318_b() != null) + { + jsonobject.add("players", p_serialize_3_.serialize(p_serialize_1_.func_151318_b())); + } + + if (p_serialize_1_.func_151322_c() != null) + { + jsonobject.add("version", p_serialize_3_.serialize(p_serialize_1_.func_151322_c())); + } + + if (p_serialize_1_.func_151316_d() != null) + { + jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d()); + } + + FMLNetworkHandler.enhanceStatusQuery(jsonobject); + return jsonobject; + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((ServerStatusResponse)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java new file mode 100644 index 0000000..5cf645f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/handshake/INetHandlerHandshakeServer.java @@ -0,0 +1,14 @@ +package net.minecraft.network.handshake; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.handshake.client.C00Handshake; + +public interface INetHandlerHandshakeServer extends INetHandler +{ + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + void processHandshake(C00Handshake packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/handshake/client/C00Handshake.java b/build/rfg/minecraft-src/java/net/minecraft/network/handshake/client/C00Handshake.java new file mode 100644 index 0000000..dba685c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/handshake/client/C00Handshake.java @@ -0,0 +1,87 @@ +package net.minecraft.network.handshake.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; + +public class C00Handshake extends Packet +{ + private int field_149600_a; + private String field_149598_b; + private int field_149599_c; + private EnumConnectionState field_149597_d; + private static final String __OBFID = "CL_00001372"; + + public C00Handshake() {} + + @SideOnly(Side.CLIENT) + public C00Handshake(int p_i45266_1_, String p_i45266_2_, int p_i45266_3_, EnumConnectionState p_i45266_4_) + { + this.field_149600_a = p_i45266_1_; + this.field_149598_b = p_i45266_2_; + this.field_149599_c = p_i45266_3_; + this.field_149597_d = p_i45266_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149600_a = data.readVarIntFromBuffer(); + this.field_149598_b = data.readStringFromBuffer(255); + this.field_149599_c = data.readUnsignedShort(); + this.field_149597_d = EnumConnectionState.func_150760_a(data.readVarIntFromBuffer()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149600_a); + data.writeStringToBuffer(this.field_149598_b); + data.writeShort(this.field_149599_c); + data.writeVarIntToBuffer(this.field_149597_d.func_150759_c()); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerHandshakeServer handler) + { + handler.processHandshake(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + public EnumConnectionState func_149594_c() + { + return this.field_149597_d; + } + + public int func_149595_d() + { + return this.field_149600_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerHandshakeServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginClient.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginClient.java new file mode 100644 index 0000000..fc74b78 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginClient.java @@ -0,0 +1,15 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; + +public interface INetHandlerLoginClient extends INetHandler +{ + void handleEncryptionRequest(S01PacketEncryptionRequest packetIn); + + void handleLoginSuccess(S02PacketLoginSuccess packetIn); + + void handleDisconnect(S00PacketDisconnect packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginServer.java new file mode 100644 index 0000000..e7fca70 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/INetHandlerLoginServer.java @@ -0,0 +1,12 @@ +package net.minecraft.network.login; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; + +public interface INetHandlerLoginServer extends INetHandler +{ + void processLoginStart(C00PacketLoginStart packetIn); + + void processEncryptionResponse(C01PacketEncryptionResponse packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C00PacketLoginStart.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C00PacketLoginStart.java new file mode 100644 index 0000000..4f38781 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C00PacketLoginStart.java @@ -0,0 +1,59 @@ +package net.minecraft.network.login.client; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; + +public class C00PacketLoginStart extends Packet +{ + private GameProfile field_149305_a; + private static final String __OBFID = "CL_00001379"; + + public C00PacketLoginStart() {} + + public C00PacketLoginStart(GameProfile profileIn) + { + this.field_149305_a = profileIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149305_a = new GameProfile((UUID)null, data.readStringFromBuffer(16)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149305_a.getName()); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginServer handler) + { + handler.processLoginStart(this); + } + + public GameProfile func_149304_c() + { + return this.field_149305_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerLoginServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java new file mode 100644 index 0000000..e777e6f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/client/C01PacketEncryptionResponse.java @@ -0,0 +1,73 @@ +package net.minecraft.network.login.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.security.PrivateKey; +import java.security.PublicKey; +import javax.crypto.SecretKey; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.util.CryptManager; + +public class C01PacketEncryptionResponse extends Packet +{ + private byte[] field_149302_a = new byte[0]; + private byte[] field_149301_b = new byte[0]; + private static final String __OBFID = "CL_00001380"; + + public C01PacketEncryptionResponse() {} + + @SideOnly(Side.CLIENT) + public C01PacketEncryptionResponse(SecretKey p_i45271_1_, PublicKey p_i45271_2_, byte[] p_i45271_3_) + { + this.field_149302_a = CryptManager.encryptData(p_i45271_2_, p_i45271_1_.getEncoded()); + this.field_149301_b = CryptManager.encryptData(p_i45271_2_, p_i45271_3_); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149302_a = readBlob(data); + this.field_149301_b = readBlob(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + writeBlob(data, this.field_149302_a); + writeBlob(data, this.field_149301_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginServer handler) + { + handler.processEncryptionResponse(this); + } + + public SecretKey func_149300_a(PrivateKey key) + { + return CryptManager.decryptSharedKey(key, this.field_149302_a); + } + + public byte[] func_149299_b(PrivateKey p_149299_1_) + { + return p_149299_1_ == null ? this.field_149301_b : CryptManager.decryptData(p_149299_1_, this.field_149301_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerLoginServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S00PacketDisconnect.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S00PacketDisconnect.java new file mode 100644 index 0000000..28c48fd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S00PacketDisconnect.java @@ -0,0 +1,70 @@ +package net.minecraft.network.login.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.IChatComponent; + +public class S00PacketDisconnect extends Packet +{ + private IChatComponent field_149605_a; + private static final String __OBFID = "CL_00001377"; + + public S00PacketDisconnect() {} + + public S00PacketDisconnect(IChatComponent reasonIn) + { + this.field_149605_a = reasonIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149605_a = IChatComponent.Serializer.func_150699_a(data.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_149605_a)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleDisconnect(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerLoginClient)handler); + } + + @SideOnly(Side.CLIENT) + public IChatComponent func_149603_c() + { + return this.field_149605_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java new file mode 100644 index 0000000..e813acf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S01PacketEncryptionRequest.java @@ -0,0 +1,82 @@ +package net.minecraft.network.login.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.security.PublicKey; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; +import net.minecraft.util.CryptManager; + +public class S01PacketEncryptionRequest extends Packet +{ + private String field_149612_a; + private PublicKey field_149610_b; + private byte[] field_149611_c; + private static final String __OBFID = "CL_00001376"; + + public S01PacketEncryptionRequest() {} + + public S01PacketEncryptionRequest(String serverId, PublicKey key, byte[] p_i45268_3_) + { + this.field_149612_a = serverId; + this.field_149610_b = key; + this.field_149611_c = p_i45268_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149612_a = data.readStringFromBuffer(20); + this.field_149610_b = CryptManager.decodePublicKey(readBlob(data)); + this.field_149611_c = readBlob(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149612_a); + writeBlob(data, this.field_149610_b.getEncoded()); + writeBlob(data, this.field_149611_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleEncryptionRequest(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerLoginClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149609_c() + { + return this.field_149612_a; + } + + @SideOnly(Side.CLIENT) + public PublicKey func_149608_d() + { + return this.field_149610_b; + } + + @SideOnly(Side.CLIENT) + public byte[] func_149607_e() + { + return this.field_149611_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java new file mode 100644 index 0000000..360ff3b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/login/server/S02PacketLoginSuccess.java @@ -0,0 +1,68 @@ +package net.minecraft.network.login.server; + +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.UUID; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.login.INetHandlerLoginClient; + +public class S02PacketLoginSuccess extends Packet +{ + private GameProfile field_149602_a; + private static final String __OBFID = "CL_00001375"; + + public S02PacketLoginSuccess() {} + + public S02PacketLoginSuccess(GameProfile profileIn) + { + this.field_149602_a = profileIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + String s = data.readStringFromBuffer(36); + String s1 = data.readStringFromBuffer(16); + UUID uuid = UUID.fromString(s); + this.field_149602_a = new GameProfile(uuid, s1); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + UUID uuid = this.field_149602_a.getId(); + data.writeStringToBuffer(uuid == null ? "" : uuid.toString()); + data.writeStringToBuffer(this.field_149602_a.getName()); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerLoginClient handler) + { + handler.handleLoginSuccess(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerLoginClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayClient.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayClient.java new file mode 100644 index 0000000..b510dc7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayClient.java @@ -0,0 +1,367 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S04PacketEntityEquipment; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S06PacketUpdateHealth; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S0APacketUseBed; +import net.minecraft.network.play.server.S0BPacketAnimation; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.network.play.server.S0DPacketCollectItem; +import net.minecraft.network.play.server.S0EPacketSpawnObject; +import net.minecraft.network.play.server.S0FPacketSpawnMob; +import net.minecraft.network.play.server.S10PacketSpawnPainting; +import net.minecraft.network.play.server.S11PacketSpawnExperienceOrb; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.server.S13PacketDestroyEntities; +import net.minecraft.network.play.server.S14PacketEntity; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S19PacketEntityHeadLook; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S1BPacketEntityAttach; +import net.minecraft.network.play.server.S1CPacketEntityMetadata; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1EPacketRemoveEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S20PacketEntityProperties; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S26PacketMapChunkBulk; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S31PacketWindowProperty; +import net.minecraft.network.play.server.S32PacketConfirmTransaction; +import net.minecraft.network.play.server.S33PacketUpdateSign; +import net.minecraft.network.play.server.S34PacketMaps; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.network.play.server.S36PacketSignEditorOpen; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3APacketTabComplete; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.network.play.server.S40PacketDisconnect; + +public interface INetHandlerPlayClient extends INetHandler +{ + /** + * Spawns an instance of the objecttype indicated by the packet and sets its position and momentum + */ + void handleSpawnObject(S0EPacketSpawnObject packetIn); + + /** + * Spawns an experience orb and sets its value (amount of XP) + */ + void handleSpawnExperienceOrb(S11PacketSpawnExperienceOrb packetIn); + + /** + * Handles globally visible entities. Used in vanilla for lightning bolts + */ + void handleSpawnGlobalEntity(S2CPacketSpawnGlobalEntity packetIn); + + /** + * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the + * entities Datawatchers with the entity metadata specified in the packet + */ + void handleSpawnMob(S0FPacketSpawnMob packetIn); + + /** + * May create a scoreboard objective, remove an objective from the scoreboard or update an objectives' displayname + */ + void handleScoreboardObjective(S3BPacketScoreboardObjective packetIn); + + /** + * Handles the spawning of a painting object + */ + void handleSpawnPainting(S10PacketSpawnPainting packetIn); + + /** + * Handles the creation of a nearby player entity, sets the position and held item + */ + void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn); + + /** + * Renders a specified animation: Waking up a player, a living entity swinging its currently held item, being hurt + * or receiving a critical hit by normal or magical means + */ + void handleAnimation(S0BPacketAnimation packetIn); + + /** + * Updates the players statistics or achievements + */ + void handleStatistics(S37PacketStatistics packetIn); + + /** + * Updates all registered IWorldAccess instances with destroyBlockInWorldPartially + */ + void handleBlockBreakAnim(S25PacketBlockBreakAnim packetIn); + + /** + * Creates a sign in the specified location if it didn't exist and opens the GUI to edit its text + */ + void handleSignEditorOpen(S36PacketSignEditorOpen packetIn); + + /** + * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks, + * beacons, skulls, flowerpot + */ + void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn); + + /** + * Triggers Block.onBlockEventReceived, which is implemented in BlockPistonBase for extension/retraction, BlockNote + * for setting the instrument (including audiovisual feedback) and in BlockContainer to set the number of players + * accessing a (Ender)Chest + */ + void handleBlockAction(S24PacketBlockAction packetIn); + + /** + * Updates the block and metadata and generates a blockupdate (and notify the clients) + */ + void handleBlockChange(S23PacketBlockChange packetIn); + + /** + * Prints a chatmessage in the chat GUI + */ + void handleChat(S02PacketChat packetIn); + + /** + * Displays the available command-completion options the server knows of + */ + void handleTabComplete(S3APacketTabComplete packetIn); + + /** + * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block + * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends + * S21PacketChunkData + */ + void handleMultiBlockChange(S22PacketMultiBlockChange packetIn); + + /** + * Updates the worlds MapStorage with the specified MapData for the specified map-identifier and invokes a + * MapItemRenderer for it + */ + void handleMaps(S34PacketMaps packetIn); + + /** + * Verifies that the server and client are synchronized with respect to the inventory/container opened by the player + * and confirms if it is the case. + */ + void handleConfirmTransaction(S32PacketConfirmTransaction packetIn); + + /** + * Resets the ItemStack held in hand and closes the window that is opened + */ + void handleCloseWindow(S2EPacketCloseWindow packetIn); + + /** + * Handles the placement of a specified ItemStack in a specified container/inventory slot + */ + void handleWindowItems(S30PacketWindowItems packetIn); + + /** + * Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table, + * Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse + */ + void handleOpenWindow(S2DPacketOpenWindow packetIn); + + /** + * Sets the progressbar of the opened window to the specified value + */ + void handleWindowProperty(S31PacketWindowProperty packetIn); + + /** + * Handles pickin up an ItemStack or dropping one in your inventory or an open (non-creative) container + */ + void handleSetSlot(S2FPacketSetSlot packetIn); + + /** + * Handles packets that have room for a channel specification. Vanilla implemented channels are "MC|TrList" to + * acquire a MerchantRecipeList trades for a villager merchant, "MC|Brand" which sets the server brand? on the + * player instance and finally "MC|RPack" which the server uses to communicate the identifier of the default server + * resourcepack for the client to load. + */ + void handleCustomPayload(S3FPacketCustomPayload packetIn); + + /** + * Closes the network channel + */ + void handleDisconnect(S40PacketDisconnect packetIn); + + /** + * Retrieves the player identified by the packet, puts him to sleep if possible (and flags whether all players are + * asleep) + */ + void handleUseBed(S0APacketUseBed packetIn); + + /** + * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death), + * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch + * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke + * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...) + */ + void handleEntityStatus(S19PacketEntityStatus packetIn); + + void handleEntityAttach(S1BPacketEntityAttach packetIn); + + /** + * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. + */ + void handleExplosion(S27PacketExplosion packetIn); + + void handleChangeGameState(S2BPacketChangeGameState packetIn); + + void handleKeepAlive(S00PacketKeepAlive packetIn); + + /** + * Updates the specified chunk with the supplied data, marks it for re-rendering and lighting recalculation + */ + void handleChunkData(S21PacketChunkData packetIn); + + void handleMapChunkBulk(S26PacketMapChunkBulk packetIn); + + void handleEffect(S28PacketEffect packetIn); + + /** + * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new + * WorldClient and sets the player initial dimension + */ + void handleJoinGame(S01PacketJoinGame packetIn); + + /** + * Updates the specified entity's position by the specified relative moment and absolute rotation. Note that + * subclassing of the packet allows for the specification of a subset of this data (e.g. only rel. position, abs. + * rotation or both). + */ + void handleEntityMovement(S14PacketEntity packetIn); + + /** + * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, + * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the + * player positioning + */ + void handlePlayerPosLook(S08PacketPlayerPosLook packetIn); + + /** + * Spawns a specified number of particles at the specified location with a randomized displacement according to + * specified bounds + */ + void handleParticles(S2APacketParticles packetIn); + + void handlePlayerAbilities(S39PacketPlayerAbilities packetIn); + + void handlePlayerListItem(S38PacketPlayerListItem packetIn); + + /** + * Locally eliminates the entities. Invoked by the server when the items are in fact destroyed, or the player is no + * longer registered as required to monitor them. The latter happens when distance between the player and item + * increases beyond a certain treshold (typically the viewing distance) + */ + void handleDestroyEntities(S13PacketDestroyEntities packetIn); + + /** + * Handle a remove entity effect packet. + */ + void handleRemoveEntityEffect(S1EPacketRemoveEntityEffect packetIn); + + /** + * respawns the player + */ + void handleRespawn(S07PacketRespawn packetIn); + + /** + * Updates the direction in which the specified entity is looking, normally this head rotation is independent of the + * rotation of the entity itself + */ + void handleEntityHeadLook(S19PacketEntityHeadLook packetIn); + + /** + * Updates which hotbar slot of the player is currently selected + */ + void handleHeldItemChange(S09PacketHeldItemChange packetIn); + + /** + * Removes or sets the ScoreObjective to be displayed at a particular scoreboard position (list, sidebar, below + * name) + */ + void handleDisplayScoreboard(S3DPacketDisplayScoreboard packetIn); + + /** + * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have + * changed -> Registers any changes locally + */ + void handleEntityMetadata(S1CPacketEntityMetadata packetIn); + + /** + * Sets the velocity of the specified entity to the specified value + */ + void handleEntityVelocity(S12PacketEntityVelocity packetIn); + + void handleEntityEquipment(S04PacketEntityEquipment packetIn); + + void handleSetExperience(S1FPacketSetExperience packetIn); + + /** + * Recieves player health from the server and then proceeds to set it locally on the client. + */ + void handleUpdateHealth(S06PacketUpdateHealth packetIn); + + /** + * Updates a team managed by the scoreboard: Create/Remove the team registration, Register/Remove the player-team- + * memberships, Set team displayname/prefix/suffix and/or whether friendly fire is enabled + */ + void handleTeams(S3EPacketTeams packetIn); + + /** + * Either updates the score with a specified value or removes the score for an objective + */ + void handleUpdateScore(S3CPacketUpdateScore packetIn); + + void handleSpawnPosition(S05PacketSpawnPosition packetIn); + + void handleTimeUpdate(S03PacketTimeUpdate packetIn); + + /** + * Updates a specified sign with the specified text lines + */ + void handleUpdateSign(S33PacketUpdateSign packetIn); + + void handleSoundEffect(S29PacketSoundEffect packetIn); + + void handleCollectItem(S0DPacketCollectItem packetIn); + + /** + * Updates an entity's position and rotation as specified by the packet + */ + void handleEntityTeleport(S18PacketEntityTeleport packetIn); + + /** + * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player + * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie + * maxHealth and knockback resistance as well as reinforcement spawning chance. + */ + void handleEntityProperties(S20PacketEntityProperties packetIn); + + void handleEntityEffect(S1DPacketEntityEffect packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayServer.java new file mode 100644 index 0000000..f7480db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/INetHandlerPlayServer.java @@ -0,0 +1,141 @@ +package net.minecraft.network.play; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C10PacketCreativeInventoryAction; +import net.minecraft.network.play.client.C11PacketEnchantItem; +import net.minecraft.network.play.client.C12PacketUpdateSign; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C14PacketTabComplete; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C17PacketCustomPayload; + +public interface INetHandlerPlayServer extends INetHandler +{ + /** + * Processes the player swinging its held item + */ + void processAnimation(C0APacketAnimation packetIn); + + /** + * Process chat messages (broadcast back to clients) and commands (executes) + */ + void processChatMessage(C01PacketChatMessage packetIn); + + /** + * Retrieves possible tab completions for the requested command string and sends them to the client + */ + void processTabComplete(C14PacketTabComplete packetIn); + + /** + * Processes the client status updates: respawn attempt from player, opening statistics or achievements, or + * acquiring 'open inventory' achievement + */ + void processClientStatus(C16PacketClientStatus packetIn); + + /** + * Updates serverside copy of client settings: language, render distance, chat visibility, chat colours, difficulty, + * and whether to show the cape + */ + void processClientSettings(C15PacketClientSettings packetIn); + + /** + * Received in response to the server requesting to confirm that the client-side open container matches the servers' + * after a mismatched container-slot manipulation. It will unlock the player's ability to manipulate the container + * contents + */ + void processConfirmTransaction(C0FPacketConfirmTransaction packetIn); + + /** + * Enchants the item identified by the packet given some convoluted conditions (matching window, which + * should/shouldn't be in use?) + */ + void processEnchantItem(C11PacketEnchantItem packetIn); + + /** + * Executes a container/inventory slot manipulation as indicated by the packet. Sends the serverside result if they + * didn't match the indicated result and prevents further manipulation by the player until he confirms that it has + * the same open container/inventory + */ + void processClickWindow(C0EPacketClickWindow packetIn); + + /** + * Processes the client closing windows (container) + */ + void processCloseWindow(C0DPacketCloseWindow packetIn); + + /** + * Synchronizes serverside and clientside book contents and signing + */ + void processVanilla250Packet(C17PacketCustomPayload packetIn); + + /** + * Processes interactions ((un)leashing, opening command block GUI) and attacks on an entity with players currently + * equipped item + */ + void processUseEntity(C02PacketUseEntity packetIn); + + /** + * Updates a players' ping statistics + */ + void processKeepAlive(C00PacketKeepAlive packetIn); + + /** + * Processes clients perspective on player positioning and/or orientation + */ + void processPlayer(C03PacketPlayer packetIn); + + /** + * Processes a player starting/stopping flying + */ + void processPlayerAbilities(C13PacketPlayerAbilities packetIn); + + /** + * Processes the player initiating/stopping digging on a particular spot, as well as a player dropping items?. (0: + * initiated, 1: reinitiated, 2? , 3-4 drop item (respectively without or with player control), 5: stopped; x,y,z, + * side clicked on;) + */ + void processPlayerDigging(C07PacketPlayerDigging packetIn); + + /** + * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump + * height of the horse the player is riding + */ + void processEntityAction(C0BPacketEntityAction packetIn); + + /** + * Processes player movement input. Includes walking, strafing, jumping, sneaking; excludes riding and toggling + * flying/sprinting + */ + void processInput(C0CPacketInput packetIn); + + /** + * Updates which quickbar slot is selected + */ + void processHeldItemChange(C09PacketHeldItemChange packetIn); + + /** + * Update the server with an ItemStack in a slot. + */ + void processCreativeInventoryAction(C10PacketCreativeInventoryAction packetIn); + + void processUpdateSign(C12PacketUpdateSign packetIn); + + /** + * Processes block placement and block activation (anvil, furnace, etc.) + */ + void processPlayerBlockPlacement(C08PacketPlayerBlockPlacement packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C00PacketKeepAlive.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C00PacketKeepAlive.java new file mode 100644 index 0000000..9358bab --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C00PacketKeepAlive.java @@ -0,0 +1,69 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C00PacketKeepAlive extends Packet +{ + private int field_149461_a; + private static final String __OBFID = "CL_00001359"; + + public C00PacketKeepAlive() {} + + @SideOnly(Side.CLIENT) + public C00PacketKeepAlive(int p_i45252_1_) + { + this.field_149461_a = p_i45252_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processKeepAlive(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149461_a = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149461_a); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + public int func_149460_c() + { + return this.field_149461_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C01PacketChatMessage.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C01PacketChatMessage.java new file mode 100644 index 0000000..2d64770 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C01PacketChatMessage.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C01PacketChatMessage extends Packet +{ + private String field_149440_a; + private static final String __OBFID = "CL_00001347"; + + public C01PacketChatMessage() {} + + public C01PacketChatMessage(String messageIn) + { + if (messageIn.length() > 100) + { + messageIn = messageIn.substring(0, 100); + } + + this.field_149440_a = messageIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149440_a = data.readStringFromBuffer(100); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149440_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processChatMessage(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("message=\'%s\'", new Object[] {this.field_149440_a}); + } + + public String func_149439_c() + { + return this.field_149440_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C02PacketUseEntity.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C02PacketUseEntity.java new file mode 100644 index 0000000..30fff2a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C02PacketUseEntity.java @@ -0,0 +1,98 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.World; + +public class C02PacketUseEntity extends Packet +{ + private int field_149567_a; + private C02PacketUseEntity.Action field_149566_b; + private static final String __OBFID = "CL_00001357"; + + public C02PacketUseEntity() {} + + @SideOnly(Side.CLIENT) + public C02PacketUseEntity(Entity p_i45251_1_, C02PacketUseEntity.Action p_i45251_2_) + { + this.field_149567_a = p_i45251_1_.getEntityId(); + this.field_149566_b = p_i45251_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149567_a = data.readInt(); + this.field_149566_b = C02PacketUseEntity.Action.field_151421_c[data.readByte() % C02PacketUseEntity.Action.field_151421_c.length]; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149567_a); + data.writeByte(this.field_149566_b.field_151418_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processUseEntity(this); + } + + public Entity func_149564_a(World worldIn) + { + return worldIn.getEntityByID(this.field_149567_a); + } + + public C02PacketUseEntity.Action func_149565_c() + { + return this.field_149566_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } + + public static enum Action + { + INTERACT(0), + ATTACK(1); + private static final C02PacketUseEntity.Action[] field_151421_c = new C02PacketUseEntity.Action[values().length]; + private final int field_151418_d; + + private static final String __OBFID = "CL_00001358"; + + private Action(int actionId) + { + this.field_151418_d = actionId; + } + + static + { + C02PacketUseEntity.Action[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + C02PacketUseEntity.Action var3 = var0[var2]; + field_151421_c[var3.field_151418_d] = var3; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C03PacketPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C03PacketPlayer.java new file mode 100644 index 0000000..c96ec52 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C03PacketPlayer.java @@ -0,0 +1,274 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C03PacketPlayer extends Packet +{ + protected double field_149479_a; + protected double field_149477_b; + protected double field_149478_c; + protected double field_149475_d; + protected float field_149476_e; + protected float field_149473_f; + protected boolean field_149474_g; + protected boolean field_149480_h; + protected boolean field_149481_i; + private static final String __OBFID = "CL_00001360"; + + public C03PacketPlayer() {} + + @SideOnly(Side.CLIENT) + public C03PacketPlayer(boolean p_i45256_1_) + { + this.field_149474_g = p_i45256_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayer(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149474_g = data.readUnsignedByte() != 0; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149474_g ? 1 : 0); + } + + public double func_149464_c() + { + return this.field_149479_a; + } + + public double func_149467_d() + { + return this.field_149477_b; + } + + public double func_149472_e() + { + return this.field_149478_c; + } + + public double func_149471_f() + { + return this.field_149475_d; + } + + public float func_149462_g() + { + return this.field_149476_e; + } + + public float func_149470_h() + { + return this.field_149473_f; + } + + public boolean func_149465_i() + { + return this.field_149474_g; + } + + public boolean func_149466_j() + { + return this.field_149480_h; + } + + public boolean func_149463_k() + { + return this.field_149481_i; + } + + public void func_149469_a(boolean p_149469_1_) + { + this.field_149480_h = p_149469_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } + + public static class C04PacketPlayerPosition extends C03PacketPlayer + { + private static final String __OBFID = "CL_00001361"; + + public C04PacketPlayerPosition() + { + this.field_149480_h = true; + } + + @SideOnly(Side.CLIENT) + public C04PacketPlayerPosition(double p_i45253_1_, double p_i45253_3_, double p_i45253_5_, double p_i45253_7_, boolean p_i45253_9_) + { + this.field_149479_a = p_i45253_1_; + this.field_149477_b = p_i45253_3_; + this.field_149475_d = p_i45253_5_; + this.field_149478_c = p_i45253_7_; + this.field_149474_g = p_i45253_9_; + this.field_149480_h = true; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149479_a = data.readDouble(); + this.field_149477_b = data.readDouble(); + this.field_149475_d = data.readDouble(); + this.field_149478_c = data.readDouble(); + super.readPacketData(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeDouble(this.field_149479_a); + data.writeDouble(this.field_149477_b); + data.writeDouble(this.field_149475_d); + data.writeDouble(this.field_149478_c); + super.writePacketData(data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayServer)handler); + } + } + + public static class C05PacketPlayerLook extends C03PacketPlayer + { + private static final String __OBFID = "CL_00001363"; + + public C05PacketPlayerLook() + { + this.field_149481_i = true; + } + + @SideOnly(Side.CLIENT) + public C05PacketPlayerLook(float p_i45255_1_, float p_i45255_2_, boolean p_i45255_3_) + { + this.field_149476_e = p_i45255_1_; + this.field_149473_f = p_i45255_2_; + this.field_149474_g = p_i45255_3_; + this.field_149481_i = true; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149476_e = data.readFloat(); + this.field_149473_f = data.readFloat(); + super.readPacketData(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeFloat(this.field_149476_e); + data.writeFloat(this.field_149473_f); + super.writePacketData(data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayServer)handler); + } + } + + public static class C06PacketPlayerPosLook extends C03PacketPlayer + { + private static final String __OBFID = "CL_00001362"; + + public C06PacketPlayerPosLook() + { + this.field_149480_h = true; + this.field_149481_i = true; + } + + @SideOnly(Side.CLIENT) + public C06PacketPlayerPosLook(double p_i45254_1_, double p_i45254_3_, double p_i45254_5_, double p_i45254_7_, float p_i45254_9_, float p_i45254_10_, boolean p_i45254_11_) + { + this.field_149479_a = p_i45254_1_; + this.field_149477_b = p_i45254_3_; + this.field_149475_d = p_i45254_5_; + this.field_149478_c = p_i45254_7_; + this.field_149476_e = p_i45254_9_; + this.field_149473_f = p_i45254_10_; + this.field_149474_g = p_i45254_11_; + this.field_149481_i = true; + this.field_149480_h = true; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149479_a = data.readDouble(); + this.field_149477_b = data.readDouble(); + this.field_149475_d = data.readDouble(); + this.field_149478_c = data.readDouble(); + this.field_149476_e = data.readFloat(); + this.field_149473_f = data.readFloat(); + super.readPacketData(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeDouble(this.field_149479_a); + data.writeDouble(this.field_149477_b); + data.writeDouble(this.field_149475_d); + data.writeDouble(this.field_149478_c); + data.writeFloat(this.field_149476_e); + data.writeFloat(this.field_149473_f); + super.writePacketData(data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayServer)handler); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java new file mode 100644 index 0000000..b499941 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C07PacketPlayerDigging.java @@ -0,0 +1,96 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C07PacketPlayerDigging extends Packet +{ + private int field_149511_a; + private int field_149509_b; + private int field_149510_c; + private int field_149507_d; + private int field_149508_e; + private static final String __OBFID = "CL_00001365"; + + public C07PacketPlayerDigging() {} + + @SideOnly(Side.CLIENT) + public C07PacketPlayerDigging(int p_i45258_1_, int p_i45258_2_, int p_i45258_3_, int p_i45258_4_, int p_i45258_5_) + { + this.field_149508_e = p_i45258_1_; + this.field_149511_a = p_i45258_2_; + this.field_149509_b = p_i45258_3_; + this.field_149510_c = p_i45258_4_; + this.field_149507_d = p_i45258_5_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149508_e = data.readUnsignedByte(); + this.field_149511_a = data.readInt(); + this.field_149509_b = data.readUnsignedByte(); + this.field_149510_c = data.readInt(); + this.field_149507_d = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149508_e); + data.writeInt(this.field_149511_a); + data.writeByte(this.field_149509_b); + data.writeInt(this.field_149510_c); + data.writeByte(this.field_149507_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerDigging(this); + } + + public int func_149505_c() + { + return this.field_149511_a; + } + + public int func_149503_d() + { + return this.field_149509_b; + } + + public int func_149502_e() + { + return this.field_149510_c; + } + + public int func_149501_f() + { + return this.field_149507_d; + } + + public int func_149506_g() + { + return this.field_149508_e; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java new file mode 100644 index 0000000..acc787d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C08PacketPlayerBlockPlacement.java @@ -0,0 +1,124 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C08PacketPlayerBlockPlacement extends Packet +{ + private int field_149583_a; + private int field_149581_b; + private int field_149582_c; + private int field_149579_d; + private ItemStack field_149580_e; + private float field_149577_f; + private float field_149578_g; + private float field_149584_h; + private static final String __OBFID = "CL_00001371"; + + public C08PacketPlayerBlockPlacement() {} + + @SideOnly(Side.CLIENT) + public C08PacketPlayerBlockPlacement(int p_i45265_1_, int p_i45265_2_, int p_i45265_3_, int p_i45265_4_, ItemStack p_i45265_5_, float p_i45265_6_, float p_i45265_7_, float p_i45265_8_) + { + this.field_149583_a = p_i45265_1_; + this.field_149581_b = p_i45265_2_; + this.field_149582_c = p_i45265_3_; + this.field_149579_d = p_i45265_4_; + this.field_149580_e = p_i45265_5_ != null ? p_i45265_5_.copy() : null; + this.field_149577_f = p_i45265_6_; + this.field_149578_g = p_i45265_7_; + this.field_149584_h = p_i45265_8_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149583_a = data.readInt(); + this.field_149581_b = data.readUnsignedByte(); + this.field_149582_c = data.readInt(); + this.field_149579_d = data.readUnsignedByte(); + this.field_149580_e = data.readItemStackFromBuffer(); + this.field_149577_f = (float)data.readUnsignedByte() / 16.0F; + this.field_149578_g = (float)data.readUnsignedByte() / 16.0F; + this.field_149584_h = (float)data.readUnsignedByte() / 16.0F; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149583_a); + data.writeByte(this.field_149581_b); + data.writeInt(this.field_149582_c); + data.writeByte(this.field_149579_d); + data.writeItemStackToBuffer(this.field_149580_e); + data.writeByte((int)(this.field_149577_f * 16.0F)); + data.writeByte((int)(this.field_149578_g * 16.0F)); + data.writeByte((int)(this.field_149584_h * 16.0F)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerBlockPlacement(this); + } + + public int func_149576_c() + { + return this.field_149583_a; + } + + public int func_149571_d() + { + return this.field_149581_b; + } + + public int func_149570_e() + { + return this.field_149582_c; + } + + public int func_149568_f() + { + return this.field_149579_d; + } + + public ItemStack func_149574_g() + { + return this.field_149580_e; + } + + public float func_149573_h() + { + return this.field_149577_f; + } + + public float func_149569_i() + { + return this.field_149578_g; + } + + public float func_149575_j() + { + return this.field_149584_h; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java new file mode 100644 index 0000000..991e708 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C09PacketHeldItemChange.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C09PacketHeldItemChange extends Packet +{ + private int field_149615_a; + private static final String __OBFID = "CL_00001368"; + + public C09PacketHeldItemChange() {} + + @SideOnly(Side.CLIENT) + public C09PacketHeldItemChange(int p_i45262_1_) + { + this.field_149615_a = p_i45262_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149615_a = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeShort(this.field_149615_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processHeldItemChange(this); + } + + public int func_149614_c() + { + return this.field_149615_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0APacketAnimation.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0APacketAnimation.java new file mode 100644 index 0000000..9f0f503 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0APacketAnimation.java @@ -0,0 +1,73 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0APacketAnimation extends Packet +{ + private int field_149424_a; + private int field_149423_b; + private static final String __OBFID = "CL_00001345"; + + public C0APacketAnimation() {} + + @SideOnly(Side.CLIENT) + public C0APacketAnimation(Entity p_i45238_1_, int p_i45238_2_) + { + this.field_149424_a = p_i45238_1_.getEntityId(); + this.field_149423_b = p_i45238_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149424_a = data.readInt(); + this.field_149423_b = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149424_a); + data.writeByte(this.field_149423_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processAnimation(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%d", new Object[] {Integer.valueOf(this.field_149424_a), Integer.valueOf(this.field_149423_b)}); + } + + public int func_149421_d() + { + return this.field_149423_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0BPacketEntityAction.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0BPacketEntityAction.java new file mode 100644 index 0000000..100198e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0BPacketEntityAction.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0BPacketEntityAction extends Packet +{ + private int field_149517_a; + private int field_149515_b; + private int field_149516_c; + private static final String __OBFID = "CL_00001366"; + + public C0BPacketEntityAction() {} + + @SideOnly(Side.CLIENT) + public C0BPacketEntityAction(Entity p_i45259_1_, int p_i45259_2_) + { + this(p_i45259_1_, p_i45259_2_, 0); + } + + @SideOnly(Side.CLIENT) + public C0BPacketEntityAction(Entity p_i45260_1_, int p_i45260_2_, int p_i45260_3_) + { + this.field_149517_a = p_i45260_1_.getEntityId(); + this.field_149515_b = p_i45260_2_; + this.field_149516_c = p_i45260_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149517_a = data.readInt(); + this.field_149515_b = data.readByte(); + this.field_149516_c = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149517_a); + data.writeByte(this.field_149515_b); + data.writeInt(this.field_149516_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processEntityAction(this); + } + + public int func_149513_d() + { + return this.field_149515_b; + } + + public int func_149512_e() + { + return this.field_149516_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0CPacketInput.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0CPacketInput.java new file mode 100644 index 0000000..9ea31e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0CPacketInput.java @@ -0,0 +1,87 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0CPacketInput extends Packet +{ + private float field_149624_a; + private float field_149622_b; + private boolean field_149623_c; + private boolean field_149621_d; + private static final String __OBFID = "CL_00001367"; + + public C0CPacketInput() {} + + @SideOnly(Side.CLIENT) + public C0CPacketInput(float p_i45261_1_, float p_i45261_2_, boolean p_i45261_3_, boolean p_i45261_4_) + { + this.field_149624_a = p_i45261_1_; + this.field_149622_b = p_i45261_2_; + this.field_149623_c = p_i45261_3_; + this.field_149621_d = p_i45261_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149624_a = data.readFloat(); + this.field_149622_b = data.readFloat(); + this.field_149623_c = data.readBoolean(); + this.field_149621_d = data.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeFloat(this.field_149624_a); + data.writeFloat(this.field_149622_b); + data.writeBoolean(this.field_149623_c); + data.writeBoolean(this.field_149621_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processInput(this); + } + + public float func_149620_c() + { + return this.field_149624_a; + } + + public float func_149616_d() + { + return this.field_149622_b; + } + + public boolean func_149618_e() + { + return this.field_149623_c; + } + + public boolean func_149617_f() + { + return this.field_149621_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java new file mode 100644 index 0000000..b832793 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0DPacketCloseWindow.java @@ -0,0 +1,55 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0DPacketCloseWindow extends Packet +{ + private int field_149556_a; + private static final String __OBFID = "CL_00001354"; + + public C0DPacketCloseWindow() {} + + @SideOnly(Side.CLIENT) + public C0DPacketCloseWindow(int p_i45247_1_) + { + this.field_149556_a = p_i45247_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processCloseWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149556_a = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149556_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0EPacketClickWindow.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0EPacketClickWindow.java new file mode 100644 index 0000000..fd3f5cc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0EPacketClickWindow.java @@ -0,0 +1,115 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0EPacketClickWindow extends Packet +{ + private int field_149554_a; + private int field_149552_b; + private int field_149553_c; + private short field_149550_d; + private ItemStack field_149551_e; + private int field_149549_f; + private static final String __OBFID = "CL_00001353"; + + public C0EPacketClickWindow() {} + + @SideOnly(Side.CLIENT) + public C0EPacketClickWindow(int p_i45246_1_, int p_i45246_2_, int p_i45246_3_, int p_i45246_4_, ItemStack p_i45246_5_, short p_i45246_6_) + { + this.field_149554_a = p_i45246_1_; + this.field_149552_b = p_i45246_2_; + this.field_149553_c = p_i45246_3_; + this.field_149551_e = p_i45246_5_ != null ? p_i45246_5_.copy() : null; + this.field_149550_d = p_i45246_6_; + this.field_149549_f = p_i45246_4_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClickWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149554_a = data.readByte(); + this.field_149552_b = data.readShort(); + this.field_149553_c = data.readByte(); + this.field_149550_d = data.readShort(); + this.field_149549_f = data.readByte(); + this.field_149551_e = data.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149554_a); + data.writeShort(this.field_149552_b); + data.writeByte(this.field_149553_c); + data.writeShort(this.field_149550_d); + data.writeByte(this.field_149549_f); + data.writeItemStackToBuffer(this.field_149551_e); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return this.field_149551_e != null ? String.format("id=%d, slot=%d, button=%d, type=%d, itemid=%d, itemcount=%d, itemaux=%d", new Object[] {Integer.valueOf(this.field_149554_a), Integer.valueOf(this.field_149552_b), Integer.valueOf(this.field_149553_c), Integer.valueOf(this.field_149549_f), Integer.valueOf(Item.getIdFromItem(this.field_149551_e.getItem())), Integer.valueOf(this.field_149551_e.stackSize), Integer.valueOf(this.field_149551_e.getItemDamage())}): String.format("id=%d, slot=%d, button=%d, type=%d, itemid=-1", new Object[] {Integer.valueOf(this.field_149554_a), Integer.valueOf(this.field_149552_b), Integer.valueOf(this.field_149553_c), Integer.valueOf(this.field_149549_f)}); + } + + public int func_149548_c() + { + return this.field_149554_a; + } + + public int func_149544_d() + { + return this.field_149552_b; + } + + public int func_149543_e() + { + return this.field_149553_c; + } + + public short func_149547_f() + { + return this.field_149550_d; + } + + public ItemStack func_149546_g() + { + return this.field_149551_e; + } + + public int func_149542_h() + { + return this.field_149549_f; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java new file mode 100644 index 0000000..0e73844 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C0FPacketConfirmTransaction.java @@ -0,0 +1,81 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C0FPacketConfirmTransaction extends Packet +{ + private int field_149536_a; + private short field_149534_b; + private boolean field_149535_c; + private static final String __OBFID = "CL_00001351"; + + public C0FPacketConfirmTransaction() {} + + @SideOnly(Side.CLIENT) + public C0FPacketConfirmTransaction(int p_i45244_1_, short p_i45244_2_, boolean p_i45244_3_) + { + this.field_149536_a = p_i45244_1_; + this.field_149534_b = p_i45244_2_; + this.field_149535_c = p_i45244_3_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processConfirmTransaction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149536_a = data.readByte(); + this.field_149534_b = data.readShort(); + this.field_149535_c = data.readByte() != 0; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149536_a); + data.writeShort(this.field_149534_b); + data.writeByte(this.field_149535_c ? 1 : 0); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, uid=%d, accepted=%b", new Object[] {Integer.valueOf(this.field_149536_a), Short.valueOf(this.field_149534_b), Boolean.valueOf(this.field_149535_c)}); + } + + public int func_149532_c() + { + return this.field_149536_a; + } + + public short func_149533_d() + { + return this.field_149534_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java new file mode 100644 index 0000000..44c2680 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C10PacketCreativeInventoryAction.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C10PacketCreativeInventoryAction extends Packet +{ + private int field_149629_a; + private ItemStack field_149628_b; + private static final String __OBFID = "CL_00001369"; + + public C10PacketCreativeInventoryAction() {} + + @SideOnly(Side.CLIENT) + public C10PacketCreativeInventoryAction(int p_i45263_1_, ItemStack p_i45263_2_) + { + this.field_149629_a = p_i45263_1_; + this.field_149628_b = p_i45263_2_ != null ? p_i45263_2_.copy() : null; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processCreativeInventoryAction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149629_a = data.readShort(); + this.field_149628_b = data.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeShort(this.field_149629_a); + data.writeItemStackToBuffer(this.field_149628_b); + } + + public int func_149627_c() + { + return this.field_149629_a; + } + + public ItemStack func_149625_d() + { + return this.field_149628_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C11PacketEnchantItem.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C11PacketEnchantItem.java new file mode 100644 index 0000000..899f35c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C11PacketEnchantItem.java @@ -0,0 +1,77 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C11PacketEnchantItem extends Packet +{ + private int field_149541_a; + private int field_149540_b; + private static final String __OBFID = "CL_00001352"; + + public C11PacketEnchantItem() {} + + @SideOnly(Side.CLIENT) + public C11PacketEnchantItem(int p_i45245_1_, int p_i45245_2_) + { + this.field_149541_a = p_i45245_1_; + this.field_149540_b = p_i45245_2_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processEnchantItem(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149541_a = data.readByte(); + this.field_149540_b = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149541_a); + data.writeByte(this.field_149540_b); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, button=%d", new Object[] {Integer.valueOf(this.field_149541_a), Integer.valueOf(this.field_149540_b)}); + } + + public int func_149539_c() + { + return this.field_149541_a; + } + + public int func_149537_d() + { + return this.field_149540_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C12PacketUpdateSign.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C12PacketUpdateSign.java new file mode 100644 index 0000000..c1d8c71 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C12PacketUpdateSign.java @@ -0,0 +1,96 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C12PacketUpdateSign extends Packet +{ + private int field_149593_a; + private int field_149591_b; + private int field_149592_c; + private String[] field_149590_d; + private static final String __OBFID = "CL_00001370"; + + public C12PacketUpdateSign() {} + + @SideOnly(Side.CLIENT) + public C12PacketUpdateSign(int p_i45264_1_, int p_i45264_2_, int p_i45264_3_, String[] p_i45264_4_) + { + this.field_149593_a = p_i45264_1_; + this.field_149591_b = p_i45264_2_; + this.field_149592_c = p_i45264_3_; + this.field_149590_d = new String[] {p_i45264_4_[0], p_i45264_4_[1], p_i45264_4_[2], p_i45264_4_[3]}; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149593_a = data.readInt(); + this.field_149591_b = data.readShort(); + this.field_149592_c = data.readInt(); + this.field_149590_d = new String[4]; + + for (int i = 0; i < 4; ++i) + { + this.field_149590_d[i] = data.readStringFromBuffer(15); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149593_a); + data.writeShort(this.field_149591_b); + data.writeInt(this.field_149592_c); + + for (int i = 0; i < 4; ++i) + { + data.writeStringToBuffer(this.field_149590_d[i]); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processUpdateSign(this); + } + + public int func_149588_c() + { + return this.field_149593_a; + } + + public int func_149586_d() + { + return this.field_149591_b; + } + + public int func_149585_e() + { + return this.field_149592_c; + } + + public String[] func_149589_f() + { + return this.field_149590_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java new file mode 100644 index 0000000..c78c805 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C13PacketPlayerAbilities.java @@ -0,0 +1,161 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C13PacketPlayerAbilities extends Packet +{ + private boolean field_149500_a; + private boolean field_149498_b; + private boolean field_149499_c; + private boolean field_149496_d; + private float field_149497_e; + private float field_149495_f; + private static final String __OBFID = "CL_00001364"; + + public C13PacketPlayerAbilities() {} + + public C13PacketPlayerAbilities(PlayerCapabilities capabilities) + { + this.func_149490_a(capabilities.disableDamage); + this.func_149483_b(capabilities.isFlying); + this.func_149491_c(capabilities.allowFlying); + this.func_149493_d(capabilities.isCreativeMode); + this.func_149485_a(capabilities.getFlySpeed()); + this.func_149492_b(capabilities.getWalkSpeed()); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + byte b0 = data.readByte(); + this.func_149490_a((b0 & 1) > 0); + this.func_149483_b((b0 & 2) > 0); + this.func_149491_c((b0 & 4) > 0); + this.func_149493_d((b0 & 8) > 0); + this.func_149485_a(data.readFloat()); + this.func_149492_b(data.readFloat()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + byte b0 = 0; + + if (this.func_149494_c()) + { + b0 = (byte)(b0 | 1); + } + + if (this.func_149488_d()) + { + b0 = (byte)(b0 | 2); + } + + if (this.func_149486_e()) + { + b0 = (byte)(b0 | 4); + } + + if (this.func_149484_f()) + { + b0 = (byte)(b0 | 8); + } + + data.writeByte(b0); + data.writeFloat(this.field_149497_e); + data.writeFloat(this.field_149495_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processPlayerAbilities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", new Object[] {Boolean.valueOf(this.func_149494_c()), Boolean.valueOf(this.func_149488_d()), Boolean.valueOf(this.func_149486_e()), Boolean.valueOf(this.func_149484_f()), Float.valueOf(this.func_149482_g()), Float.valueOf(this.func_149489_h())}); + } + + public boolean func_149494_c() + { + return this.field_149500_a; + } + + public void func_149490_a(boolean isInvulnerable) + { + this.field_149500_a = isInvulnerable; + } + + public boolean func_149488_d() + { + return this.field_149498_b; + } + + public void func_149483_b(boolean isFlying) + { + this.field_149498_b = isFlying; + } + + public boolean func_149486_e() + { + return this.field_149499_c; + } + + public void func_149491_c(boolean isAllowFlying) + { + this.field_149499_c = isAllowFlying; + } + + public boolean func_149484_f() + { + return this.field_149496_d; + } + + public void func_149493_d(boolean isCreativeMode) + { + this.field_149496_d = isCreativeMode; + } + + public float func_149482_g() + { + return this.field_149497_e; + } + + public void func_149485_a(float flySpeedIn) + { + this.field_149497_e = flySpeedIn; + } + + public float func_149489_h() + { + return this.field_149495_f; + } + + public void func_149492_b(float walkSpeedIn) + { + this.field_149495_f = walkSpeedIn; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C14PacketTabComplete.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C14PacketTabComplete.java new file mode 100644 index 0000000..072d823 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C14PacketTabComplete.java @@ -0,0 +1,66 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import org.apache.commons.lang3.StringUtils; + +public class C14PacketTabComplete extends Packet +{ + private String field_149420_a; + private static final String __OBFID = "CL_00001346"; + + public C14PacketTabComplete() {} + + public C14PacketTabComplete(String msg) + { + this.field_149420_a = msg; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149420_a = data.readStringFromBuffer(32767); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(StringUtils.substring(this.field_149420_a, 0, 32767)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processTabComplete(this); + } + + public String func_149419_c() + { + return this.field_149420_a; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("message=\'%s\'", new Object[] {this.field_149420_a}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C15PacketClientSettings.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C15PacketClientSettings.java new file mode 100644 index 0000000..1329a18 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C15PacketClientSettings.java @@ -0,0 +1,115 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; +import net.minecraft.world.EnumDifficulty; + +public class C15PacketClientSettings extends Packet +{ + private String field_149530_a; + private int field_149528_b; + private EntityPlayer.EnumChatVisibility field_149529_c; + private boolean field_149526_d; + private EnumDifficulty field_149527_e; + private boolean field_149525_f; + private static final String __OBFID = "CL_00001350"; + + public C15PacketClientSettings() {} + + @SideOnly(Side.CLIENT) + public C15PacketClientSettings(String p_i45243_1_, int p_i45243_2_, EntityPlayer.EnumChatVisibility p_i45243_3_, boolean p_i45243_4_, EnumDifficulty p_i45243_5_, boolean p_i45243_6_) + { + this.field_149530_a = p_i45243_1_; + this.field_149528_b = p_i45243_2_; + this.field_149529_c = p_i45243_3_; + this.field_149526_d = p_i45243_4_; + this.field_149527_e = p_i45243_5_; + this.field_149525_f = p_i45243_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149530_a = data.readStringFromBuffer(7); + this.field_149528_b = data.readByte(); + this.field_149529_c = EntityPlayer.EnumChatVisibility.getEnumChatVisibility(data.readByte()); + this.field_149526_d = data.readBoolean(); + this.field_149527_e = EnumDifficulty.getDifficultyEnum(data.readByte()); + this.field_149525_f = data.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149530_a); + data.writeByte(this.field_149528_b); + data.writeByte(this.field_149529_c.getChatVisibility()); + data.writeBoolean(this.field_149526_d); + data.writeByte(this.field_149527_e.getDifficultyId()); + data.writeBoolean(this.field_149525_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClientSettings(this); + } + + public String func_149524_c() + { + return this.field_149530_a; + } + + public int func_149521_d() + { + return this.field_149528_b; + } + + public EntityPlayer.EnumChatVisibility func_149523_e() + { + return this.field_149529_c; + } + + public boolean func_149520_f() + { + return this.field_149526_d; + } + + public EnumDifficulty func_149518_g() + { + return this.field_149527_e; + } + + public boolean func_149519_h() + { + return this.field_149525_f; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("lang=\'%s\', view=%d, chat=%s, col=%b, difficulty=%s, cape=%b", new Object[] {this.field_149530_a, Integer.valueOf(this.field_149528_b), this.field_149529_c, Boolean.valueOf(this.field_149526_d), this.field_149527_e, Boolean.valueOf(this.field_149525_f)}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C16PacketClientStatus.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C16PacketClientStatus.java new file mode 100644 index 0000000..b04bd58 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C16PacketClientStatus.java @@ -0,0 +1,85 @@ +package net.minecraft.network.play.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C16PacketClientStatus extends Packet +{ + private C16PacketClientStatus.EnumState field_149437_a; + private static final String __OBFID = "CL_00001348"; + + public C16PacketClientStatus() {} + + public C16PacketClientStatus(C16PacketClientStatus.EnumState statusIn) + { + this.field_149437_a = statusIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149437_a = C16PacketClientStatus.EnumState.field_151404_e[data.readByte() % C16PacketClientStatus.EnumState.field_151404_e.length]; + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149437_a.field_151403_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processClientStatus(this); + } + + public C16PacketClientStatus.EnumState func_149435_c() + { + return this.field_149437_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } + + public static enum EnumState + { + PERFORM_RESPAWN(0), + REQUEST_STATS(1), + OPEN_INVENTORY_ACHIEVEMENT(2); + private final int field_151403_d; + private static final C16PacketClientStatus.EnumState[] field_151404_e = new C16PacketClientStatus.EnumState[values().length]; + + private static final String __OBFID = "CL_00001349"; + + private EnumState(int statusId) + { + this.field_151403_d = statusId; + } + + static + { + C16PacketClientStatus.EnumState[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + C16PacketClientStatus.EnumState var3 = var0[var2]; + field_151404_e[var3.field_151403_d] = var3; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C17PacketCustomPayload.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C17PacketCustomPayload.java new file mode 100644 index 0000000..8a6b89b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/client/C17PacketCustomPayload.java @@ -0,0 +1,98 @@ +package net.minecraft.network.play.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayServer; + +public class C17PacketCustomPayload extends Packet +{ + private String field_149562_a; + private int field_149560_b; + private byte[] field_149561_c; + private static final String __OBFID = "CL_00001356"; + + public C17PacketCustomPayload() {} + + @SideOnly(Side.CLIENT) + public C17PacketCustomPayload(String p_i45248_1_, ByteBuf p_i45248_2_) + { + this(p_i45248_1_, p_i45248_2_.array()); + } + + @SideOnly(Side.CLIENT) + public C17PacketCustomPayload(String p_i45249_1_, byte[] p_i45249_2_) + { + this.field_149562_a = p_i45249_1_; + this.field_149561_c = p_i45249_2_; + + if (p_i45249_2_ != null) + { + this.field_149560_b = p_i45249_2_.length; + + if (this.field_149560_b >= 32767) + { + throw new IllegalArgumentException("Payload may not be larger than 32k"); + } + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149562_a = data.readStringFromBuffer(20); + this.field_149560_b = data.readShort(); + + if (this.field_149560_b > 0 && this.field_149560_b < 32767) + { + this.field_149561_c = new byte[this.field_149560_b]; + data.readBytes(this.field_149561_c); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149562_a); + data.writeShort((short)this.field_149560_b); + + if (this.field_149561_c != null) + { + data.writeBytes(this.field_149561_c); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayServer handler) + { + handler.processVanilla250Packet(this); + } + + public String func_149559_c() + { + return this.field_149562_a; + } + + public byte[] func_149558_e() + { + return this.field_149561_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S00PacketKeepAlive.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S00PacketKeepAlive.java new file mode 100644 index 0000000..7924cb7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S00PacketKeepAlive.java @@ -0,0 +1,69 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S00PacketKeepAlive extends Packet +{ + private int field_149136_a; + private static final String __OBFID = "CL_00001303"; + + public S00PacketKeepAlive() {} + + public S00PacketKeepAlive(int p_i45195_1_) + { + this.field_149136_a = p_i45195_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleKeepAlive(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149136_a = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149136_a); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149134_c() + { + return this.field_149136_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S01PacketJoinGame.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S01PacketJoinGame.java new file mode 100644 index 0000000..fbeef2e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S01PacketJoinGame.java @@ -0,0 +1,144 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S01PacketJoinGame extends Packet +{ + private int field_149206_a; + private boolean field_149204_b; + private WorldSettings.GameType field_149205_c; + private int field_149202_d; + private EnumDifficulty field_149203_e; + private int field_149200_f; + private WorldType field_149201_g; + private static final String __OBFID = "CL_00001310"; + + public S01PacketJoinGame() {} + + public S01PacketJoinGame(int p_i45201_1_, WorldSettings.GameType p_i45201_2_, boolean p_i45201_3_, int p_i45201_4_, EnumDifficulty p_i45201_5_, int p_i45201_6_, WorldType p_i45201_7_) + { + this.field_149206_a = p_i45201_1_; + this.field_149202_d = p_i45201_4_; + this.field_149203_e = p_i45201_5_; + this.field_149205_c = p_i45201_2_; + this.field_149200_f = p_i45201_6_; + this.field_149204_b = p_i45201_3_; + this.field_149201_g = p_i45201_7_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149206_a = data.readInt(); + short short1 = data.readUnsignedByte(); + this.field_149204_b = (short1 & 8) == 8; + int i = short1 & -9; + this.field_149205_c = WorldSettings.GameType.getByID(i); + this.field_149202_d = data.readByte(); + this.field_149203_e = EnumDifficulty.getDifficultyEnum(data.readUnsignedByte()); + this.field_149200_f = data.readUnsignedByte(); + this.field_149201_g = WorldType.parseWorldType(data.readStringFromBuffer(16)); + + if (this.field_149201_g == null) + { + this.field_149201_g = WorldType.DEFAULT; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149206_a); + int i = this.field_149205_c.getID(); + + if (this.field_149204_b) + { + i |= 8; + } + + data.writeByte(i); + data.writeByte(this.field_149202_d); + data.writeByte(this.field_149203_e.getDifficultyId()); + data.writeByte(this.field_149200_f); + data.writeStringToBuffer(this.field_149201_g.getWorldTypeName()); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleJoinGame(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("eid=%d, gameType=%d, hardcore=%b, dimension=%d, difficulty=%s, maxplayers=%d", new Object[] {Integer.valueOf(this.field_149206_a), Integer.valueOf(this.field_149205_c.getID()), Boolean.valueOf(this.field_149204_b), Integer.valueOf(this.field_149202_d), this.field_149203_e, Integer.valueOf(this.field_149200_f)}); + } + + @SideOnly(Side.CLIENT) + public int func_149197_c() + { + return this.field_149206_a; + } + + @SideOnly(Side.CLIENT) + public boolean func_149195_d() + { + return this.field_149204_b; + } + + @SideOnly(Side.CLIENT) + public WorldSettings.GameType func_149198_e() + { + return this.field_149205_c; + } + + @SideOnly(Side.CLIENT) + public int func_149194_f() + { + return this.field_149202_d; + } + + @SideOnly(Side.CLIENT) + public EnumDifficulty func_149192_g() + { + return this.field_149203_e; + } + + @SideOnly(Side.CLIENT) + public int func_149193_h() + { + return this.field_149200_f; + } + + @SideOnly(Side.CLIENT) + public WorldType func_149196_i() + { + return this.field_149201_g; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S02PacketChat.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S02PacketChat.java new file mode 100644 index 0000000..79ca4b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S02PacketChat.java @@ -0,0 +1,85 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S02PacketChat extends Packet +{ + private IChatComponent field_148919_a; + private boolean field_148918_b; + private static final String __OBFID = "CL_00001289"; + + public S02PacketChat() + { + this.field_148918_b = true; + } + + public S02PacketChat(IChatComponent component) + { + this(component, true); + } + + public S02PacketChat(IChatComponent component, boolean chat) + { + this.field_148918_b = true; + this.field_148919_a = component; + this.field_148918_b = chat; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148919_a = IChatComponent.Serializer.func_150699_a(data.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_148919_a)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChat(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("message=\'%s\'", new Object[] {this.field_148919_a}); + } + + @SideOnly(Side.CLIENT) + public IChatComponent func_148915_c() + { + return this.field_148919_a; + } + + public boolean func_148916_d() + { + return this.field_148918_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java new file mode 100644 index 0000000..7261334 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S03PacketTimeUpdate.java @@ -0,0 +1,88 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S03PacketTimeUpdate extends Packet +{ + private long field_149369_a; + private long field_149368_b; + private static final String __OBFID = "CL_00001337"; + + public S03PacketTimeUpdate() {} + + public S03PacketTimeUpdate(long p_i45230_1_, long p_i45230_3_, boolean p_i45230_5_) + { + this.field_149369_a = p_i45230_1_; + this.field_149368_b = p_i45230_3_; + + if (!p_i45230_5_) + { + this.field_149368_b = -this.field_149368_b; + + if (this.field_149368_b == 0L) + { + this.field_149368_b = -1L; + } + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149369_a = data.readLong(); + this.field_149368_b = data.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeLong(this.field_149369_a); + data.writeLong(this.field_149368_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTimeUpdate(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("time=%d,dtime=%d", new Object[] {Long.valueOf(this.field_149369_a), Long.valueOf(this.field_149368_b)}); + } + + @SideOnly(Side.CLIENT) + public long func_149366_c() + { + return this.field_149369_a; + } + + @SideOnly(Side.CLIENT) + public long func_149365_d() + { + return this.field_149368_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java new file mode 100644 index 0000000..227ce5f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S04PacketEntityEquipment.java @@ -0,0 +1,89 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S04PacketEntityEquipment extends Packet +{ + private int field_149394_a; + private int field_149392_b; + private ItemStack field_149393_c; + private static final String __OBFID = "CL_00001330"; + + public S04PacketEntityEquipment() {} + + public S04PacketEntityEquipment(int p_i45221_1_, int p_i45221_2_, ItemStack p_i45221_3_) + { + this.field_149394_a = p_i45221_1_; + this.field_149392_b = p_i45221_2_; + this.field_149393_c = p_i45221_3_ == null ? null : p_i45221_3_.copy(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149394_a = data.readInt(); + this.field_149392_b = data.readShort(); + this.field_149393_c = data.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149394_a); + data.writeShort(this.field_149392_b); + data.writeItemStackToBuffer(this.field_149393_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityEquipment(this); + } + + @SideOnly(Side.CLIENT) + public ItemStack func_149390_c() + { + return this.field_149393_c; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("entity=%d, slot=%d, item=%s", new Object[] {Integer.valueOf(this.field_149394_a), Integer.valueOf(this.field_149392_b), this.field_149393_c}); + } + + @SideOnly(Side.CLIENT) + public int func_149389_d() + { + return this.field_149394_a; + } + + @SideOnly(Side.CLIENT) + public int func_149388_e() + { + return this.field_149392_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java new file mode 100644 index 0000000..3d40ac9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S05PacketSpawnPosition.java @@ -0,0 +1,97 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S05PacketSpawnPosition extends Packet +{ + private int field_149364_a; + private int field_149362_b; + private int field_149363_c; + private static final String __OBFID = "CL_00001336"; + + public S05PacketSpawnPosition() {} + + public S05PacketSpawnPosition(int p_i45229_1_, int p_i45229_2_, int p_i45229_3_) + { + this.field_149364_a = p_i45229_1_; + this.field_149362_b = p_i45229_2_; + this.field_149363_c = p_i45229_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149364_a = data.readInt(); + this.field_149362_b = data.readInt(); + this.field_149363_c = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149364_a); + data.writeInt(this.field_149362_b); + data.writeInt(this.field_149363_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPosition(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return false; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("x=%d, y=%d, z=%d", new Object[] {Integer.valueOf(this.field_149364_a), Integer.valueOf(this.field_149362_b), Integer.valueOf(this.field_149363_c)}); + } + + @SideOnly(Side.CLIENT) + public int func_149360_c() + { + return this.field_149364_a; + } + + @SideOnly(Side.CLIENT) + public int func_149359_d() + { + return this.field_149362_b; + } + + @SideOnly(Side.CLIENT) + public int func_149358_e() + { + return this.field_149363_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java new file mode 100644 index 0000000..ecb8467 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S06PacketUpdateHealth.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S06PacketUpdateHealth extends Packet +{ + private float field_149336_a; + private int field_149334_b; + private float field_149335_c; + private static final String __OBFID = "CL_00001332"; + + public S06PacketUpdateHealth() {} + + public S06PacketUpdateHealth(float healthIn, int foodLevelIn, float saturationIn) + { + this.field_149336_a = healthIn; + this.field_149334_b = foodLevelIn; + this.field_149335_c = saturationIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149336_a = data.readFloat(); + this.field_149334_b = data.readShort(); + this.field_149335_c = data.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeFloat(this.field_149336_a); + data.writeShort(this.field_149334_b); + data.writeFloat(this.field_149335_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateHealth(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public float func_149332_c() + { + return this.field_149336_a; + } + + @SideOnly(Side.CLIENT) + public int func_149330_d() + { + return this.field_149334_b; + } + + @SideOnly(Side.CLIENT) + public float func_149331_e() + { + return this.field_149335_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S07PacketRespawn.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S07PacketRespawn.java new file mode 100644 index 0000000..4ea9a16 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S07PacketRespawn.java @@ -0,0 +1,98 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class S07PacketRespawn extends Packet +{ + private int field_149088_a; + private EnumDifficulty field_149086_b; + private WorldSettings.GameType field_149087_c; + private WorldType field_149085_d; + private static final String __OBFID = "CL_00001322"; + + public S07PacketRespawn() {} + + public S07PacketRespawn(int p_i45213_1_, EnumDifficulty p_i45213_2_, WorldType p_i45213_3_, WorldSettings.GameType p_i45213_4_) + { + this.field_149088_a = p_i45213_1_; + this.field_149086_b = p_i45213_2_; + this.field_149087_c = p_i45213_4_; + this.field_149085_d = p_i45213_3_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleRespawn(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149088_a = data.readInt(); + this.field_149086_b = EnumDifficulty.getDifficultyEnum(data.readUnsignedByte()); + this.field_149087_c = WorldSettings.GameType.getByID(data.readUnsignedByte()); + this.field_149085_d = WorldType.parseWorldType(data.readStringFromBuffer(16)); + + if (this.field_149085_d == null) + { + this.field_149085_d = WorldType.DEFAULT; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149088_a); + data.writeByte(this.field_149086_b.getDifficultyId()); + data.writeByte(this.field_149087_c.getID()); + data.writeStringToBuffer(this.field_149085_d.getWorldTypeName()); + } + + @SideOnly(Side.CLIENT) + public int func_149082_c() + { + return this.field_149088_a; + } + + @SideOnly(Side.CLIENT) + public EnumDifficulty func_149081_d() + { + return this.field_149086_b; + } + + @SideOnly(Side.CLIENT) + public WorldSettings.GameType func_149083_e() + { + return this.field_149087_c; + } + + @SideOnly(Side.CLIENT) + public WorldType func_149080_f() + { + return this.field_149085_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java new file mode 100644 index 0000000..b8dfff6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java @@ -0,0 +1,110 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S08PacketPlayerPosLook extends Packet +{ + private double field_148940_a; + private double field_148938_b; + private double field_148939_c; + private float field_148936_d; + private float field_148937_e; + private boolean field_148935_f; + private static final String __OBFID = "CL_00001273"; + + public S08PacketPlayerPosLook() {} + + public S08PacketPlayerPosLook(double p_i45164_1_, double p_i45164_3_, double p_i45164_5_, float p_i45164_7_, float p_i45164_8_, boolean p_i45164_9_) + { + this.field_148940_a = p_i45164_1_; + this.field_148938_b = p_i45164_3_; + this.field_148939_c = p_i45164_5_; + this.field_148936_d = p_i45164_7_; + this.field_148937_e = p_i45164_8_; + this.field_148935_f = p_i45164_9_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148940_a = data.readDouble(); + this.field_148938_b = data.readDouble(); + this.field_148939_c = data.readDouble(); + this.field_148936_d = data.readFloat(); + this.field_148937_e = data.readFloat(); + this.field_148935_f = data.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeDouble(this.field_148940_a); + data.writeDouble(this.field_148938_b); + data.writeDouble(this.field_148939_c); + data.writeFloat(this.field_148936_d); + data.writeFloat(this.field_148937_e); + data.writeBoolean(this.field_148935_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerPosLook(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public double func_148932_c() + { + return this.field_148940_a; + } + + @SideOnly(Side.CLIENT) + public double func_148928_d() + { + return this.field_148938_b; + } + + @SideOnly(Side.CLIENT) + public double func_148933_e() + { + return this.field_148939_c; + } + + @SideOnly(Side.CLIENT) + public float func_148931_f() + { + return this.field_148936_d; + } + + @SideOnly(Side.CLIENT) + public float func_148930_g() + { + return this.field_148937_e; + } + + @SideOnly(Side.CLIENT) + public boolean func_148929_h() + { + return this.field_148935_f; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java new file mode 100644 index 0000000..88a967b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S09PacketHeldItemChange.java @@ -0,0 +1,60 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S09PacketHeldItemChange extends Packet +{ + private int field_149387_a; + private static final String __OBFID = "CL_00001324"; + + public S09PacketHeldItemChange() {} + + public S09PacketHeldItemChange(int p_i45215_1_) + { + this.field_149387_a = p_i45215_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149387_a = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149387_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleHeldItemChange(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149385_c() + { + return this.field_149387_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0APacketUseBed.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0APacketUseBed.java new file mode 100644 index 0000000..7128e6f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0APacketUseBed.java @@ -0,0 +1,92 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S0APacketUseBed extends Packet +{ + private int field_149097_a; + private int field_149095_b; + private int field_149096_c; + private int field_149094_d; + private static final String __OBFID = "CL_00001319"; + + public S0APacketUseBed() {} + + public S0APacketUseBed(EntityPlayer player, int xPos, int yPos, int zPos) + { + this.field_149095_b = xPos; + this.field_149096_c = yPos; + this.field_149094_d = zPos; + this.field_149097_a = player.getEntityId(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149097_a = data.readInt(); + this.field_149095_b = data.readInt(); + this.field_149096_c = data.readByte(); + this.field_149094_d = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149097_a); + data.writeInt(this.field_149095_b); + data.writeByte(this.field_149096_c); + data.writeInt(this.field_149094_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUseBed(this); + } + + @SideOnly(Side.CLIENT) + public EntityPlayer func_149091_a(World p_149091_1_) + { + return (EntityPlayer)p_149091_1_.getEntityByID(this.field_149097_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149092_c() + { + return this.field_149095_b; + } + + @SideOnly(Side.CLIENT) + public int func_149090_d() + { + return this.field_149096_c; + } + + @SideOnly(Side.CLIENT) + public int func_149089_e() + { + return this.field_149094_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0BPacketAnimation.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0BPacketAnimation.java new file mode 100644 index 0000000..05d31a6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0BPacketAnimation.java @@ -0,0 +1,79 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0BPacketAnimation extends Packet +{ + private int field_148981_a; + private int field_148980_b; + private static final String __OBFID = "CL_00001282"; + + public S0BPacketAnimation() {} + + public S0BPacketAnimation(Entity ent, int animationType) + { + this.field_148981_a = ent.getEntityId(); + this.field_148980_b = animationType; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148981_a = data.readVarIntFromBuffer(); + this.field_148980_b = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148981_a); + data.writeByte(this.field_148980_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleAnimation(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%d", new Object[] {Integer.valueOf(this.field_148981_a), Integer.valueOf(this.field_148980_b)}); + } + + @SideOnly(Side.CLIENT) + public int func_148978_c() + { + return this.field_148981_a; + } + + @SideOnly(Side.CLIENT) + public int func_148977_d() + { + return this.field_148980_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java new file mode 100644 index 0000000..bbfe741 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0CPacketSpawnPlayer.java @@ -0,0 +1,189 @@ +package net.minecraft.network.play.server; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0CPacketSpawnPlayer extends Packet +{ + private int field_148957_a; + private GameProfile field_148955_b; + private int field_148956_c; + private int field_148953_d; + private int field_148954_e; + private byte field_148951_f; + private byte field_148952_g; + private int field_148959_h; + private DataWatcher field_148960_i; + private List field_148958_j; + private static final String __OBFID = "CL_00001281"; + + public S0CPacketSpawnPlayer() {} + + public S0CPacketSpawnPlayer(EntityPlayer p_i45171_1_) + { + this.field_148957_a = p_i45171_1_.getEntityId(); + this.field_148955_b = p_i45171_1_.getGameProfile(); + this.field_148956_c = MathHelper.floor_double(p_i45171_1_.posX * 32.0D); + this.field_148953_d = MathHelper.floor_double(p_i45171_1_.posY * 32.0D); + this.field_148954_e = MathHelper.floor_double(p_i45171_1_.posZ * 32.0D); + this.field_148951_f = (byte)((int)(p_i45171_1_.rotationYaw * 256.0F / 360.0F)); + this.field_148952_g = (byte)((int)(p_i45171_1_.rotationPitch * 256.0F / 360.0F)); + ItemStack itemstack = p_i45171_1_.inventory.getCurrentItem(); + this.field_148959_h = itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem()); + this.field_148960_i = p_i45171_1_.getDataWatcher(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148957_a = data.readVarIntFromBuffer(); + UUID uuid = UUID.fromString(data.readStringFromBuffer(36)); + this.field_148955_b = new GameProfile(uuid, data.readStringFromBuffer(16)); + int i = data.readVarIntFromBuffer(); + + for (int j = 0; j < i; ++j) + { + String s = data.readStringFromBuffer(32767); + String s1 = data.readStringFromBuffer(32767); + String s2 = data.readStringFromBuffer(32767); + this.field_148955_b.getProperties().put(s, new Property(s, s1, s2)); + } + + this.field_148956_c = data.readInt(); + this.field_148953_d = data.readInt(); + this.field_148954_e = data.readInt(); + this.field_148951_f = data.readByte(); + this.field_148952_g = data.readByte(); + this.field_148959_h = data.readShort(); + this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148957_a); + UUID uuid = this.field_148955_b.getId(); + data.writeStringToBuffer(uuid == null ? "" : uuid.toString()); + data.writeStringToBuffer(this.field_148955_b.getName()); + data.writeVarIntToBuffer(this.field_148955_b.getProperties().size()); + Iterator iterator = this.field_148955_b.getProperties().values().iterator(); + + while (iterator.hasNext()) + { + Property property = (Property)iterator.next(); + data.writeStringToBuffer(property.getName()); + data.writeStringToBuffer(property.getValue()); + data.writeStringToBuffer(property.getSignature()); + } + + data.writeInt(this.field_148956_c); + data.writeInt(this.field_148953_d); + data.writeInt(this.field_148954_e); + data.writeByte(this.field_148951_f); + data.writeByte(this.field_148952_g); + data.writeShort(this.field_148959_h); + this.field_148960_i.func_151509_a(data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPlayer(this); + } + + @SideOnly(Side.CLIENT) + public List func_148944_c() + { + if (this.field_148958_j == null) + { + this.field_148958_j = this.field_148960_i.getAllWatched(); + } + + return this.field_148958_j; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, gameProfile=\'%s\', x=%.2f, y=%.2f, z=%.2f, carried=%d", new Object[] {Integer.valueOf(this.field_148957_a), this.field_148955_b, Float.valueOf((float)this.field_148956_c / 32.0F), Float.valueOf((float)this.field_148953_d / 32.0F), Float.valueOf((float)this.field_148954_e / 32.0F), Integer.valueOf(this.field_148959_h)}); + } + + @SideOnly(Side.CLIENT) + public int func_148943_d() + { + return this.field_148957_a; + } + + @SideOnly(Side.CLIENT) + public GameProfile func_148948_e() + { + return this.field_148955_b; + } + + @SideOnly(Side.CLIENT) + public int func_148942_f() + { + return this.field_148956_c; + } + + @SideOnly(Side.CLIENT) + public int func_148949_g() + { + return this.field_148953_d; + } + + @SideOnly(Side.CLIENT) + public int func_148946_h() + { + return this.field_148954_e; + } + + @SideOnly(Side.CLIENT) + public byte func_148941_i() + { + return this.field_148951_f; + } + + @SideOnly(Side.CLIENT) + public byte func_148945_j() + { + return this.field_148952_g; + } + + @SideOnly(Side.CLIENT) + public int func_148947_k() + { + return this.field_148959_h; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0DPacketCollectItem.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0DPacketCollectItem.java new file mode 100644 index 0000000..7949ac0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0DPacketCollectItem.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S0DPacketCollectItem extends Packet +{ + private int field_149357_a; + private int field_149356_b; + private static final String __OBFID = "CL_00001339"; + + public S0DPacketCollectItem() {} + + public S0DPacketCollectItem(int p_i45232_1_, int p_i45232_2_) + { + this.field_149357_a = p_i45232_1_; + this.field_149356_b = p_i45232_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149357_a = data.readInt(); + this.field_149356_b = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149357_a); + data.writeInt(this.field_149356_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCollectItem(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149354_c() + { + return this.field_149357_a; + } + + @SideOnly(Side.CLIENT) + public int func_149353_d() + { + return this.field_149356_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java new file mode 100644 index 0000000..93a9753 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0EPacketSpawnObject.java @@ -0,0 +1,258 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0EPacketSpawnObject extends Packet +{ + private int field_149018_a; + private int field_149016_b; + private int field_149017_c; + private int field_149014_d; + private int field_149015_e; + private int field_149012_f; + private int field_149013_g; + private int field_149021_h; + private int field_149022_i; + private int field_149019_j; + private int field_149020_k; + private static final String __OBFID = "CL_00001276"; + + public S0EPacketSpawnObject() {} + + public S0EPacketSpawnObject(Entity p_i45165_1_, int p_i45165_2_) + { + this(p_i45165_1_, p_i45165_2_, 0); + } + + public S0EPacketSpawnObject(Entity p_i45166_1_, int p_i45166_2_, int p_i45166_3_) + { + this.field_149018_a = p_i45166_1_.getEntityId(); + this.field_149016_b = MathHelper.floor_double(p_i45166_1_.posX * 32.0D); + this.field_149017_c = MathHelper.floor_double(p_i45166_1_.posY * 32.0D); + this.field_149014_d = MathHelper.floor_double(p_i45166_1_.posZ * 32.0D); + this.field_149021_h = MathHelper.floor_float(p_i45166_1_.rotationPitch * 256.0F / 360.0F); + this.field_149022_i = MathHelper.floor_float(p_i45166_1_.rotationYaw * 256.0F / 360.0F); + this.field_149019_j = p_i45166_2_; + this.field_149020_k = p_i45166_3_; + + if (p_i45166_3_ > 0) + { + double d0 = p_i45166_1_.motionX; + double d1 = p_i45166_1_.motionY; + double d2 = p_i45166_1_.motionZ; + double d3 = 3.9D; + + if (d0 < -d3) + { + d0 = -d3; + } + + if (d1 < -d3) + { + d1 = -d3; + } + + if (d2 < -d3) + { + d2 = -d3; + } + + if (d0 > d3) + { + d0 = d3; + } + + if (d1 > d3) + { + d1 = d3; + } + + if (d2 > d3) + { + d2 = d3; + } + + this.field_149015_e = (int)(d0 * 8000.0D); + this.field_149012_f = (int)(d1 * 8000.0D); + this.field_149013_g = (int)(d2 * 8000.0D); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149018_a = data.readVarIntFromBuffer(); + this.field_149019_j = data.readByte(); + this.field_149016_b = data.readInt(); + this.field_149017_c = data.readInt(); + this.field_149014_d = data.readInt(); + this.field_149021_h = data.readByte(); + this.field_149022_i = data.readByte(); + this.field_149020_k = data.readInt(); + + if (this.field_149020_k > 0) + { + this.field_149015_e = data.readShort(); + this.field_149012_f = data.readShort(); + this.field_149013_g = data.readShort(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149018_a); + data.writeByte(this.field_149019_j); + data.writeInt(this.field_149016_b); + data.writeInt(this.field_149017_c); + data.writeInt(this.field_149014_d); + data.writeByte(this.field_149021_h); + data.writeByte(this.field_149022_i); + data.writeInt(this.field_149020_k); + + if (this.field_149020_k > 0) + { + data.writeShort(this.field_149015_e); + data.writeShort(this.field_149012_f); + data.writeShort(this.field_149013_g); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnObject(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f", new Object[] {Integer.valueOf(this.field_149018_a), Integer.valueOf(this.field_149019_j), Float.valueOf((float)this.field_149016_b / 32.0F), Float.valueOf((float)this.field_149017_c / 32.0F), Float.valueOf((float)this.field_149014_d / 32.0F)}); + } + + @SideOnly(Side.CLIENT) + public int func_149001_c() + { + return this.field_149018_a; + } + + @SideOnly(Side.CLIENT) + public int func_148997_d() + { + return this.field_149016_b; + } + + @SideOnly(Side.CLIENT) + public int func_148998_e() + { + return this.field_149017_c; + } + + @SideOnly(Side.CLIENT) + public int func_148994_f() + { + return this.field_149014_d; + } + + @SideOnly(Side.CLIENT) + public int func_149010_g() + { + return this.field_149015_e; + } + + @SideOnly(Side.CLIENT) + public int func_149004_h() + { + return this.field_149012_f; + } + + @SideOnly(Side.CLIENT) + public int func_148999_i() + { + return this.field_149013_g; + } + + @SideOnly(Side.CLIENT) + public int func_149008_j() + { + return this.field_149021_h; + } + + @SideOnly(Side.CLIENT) + public int func_149006_k() + { + return this.field_149022_i; + } + + @SideOnly(Side.CLIENT) + public int func_148993_l() + { + return this.field_149019_j; + } + + @SideOnly(Side.CLIENT) + public int func_149009_m() + { + return this.field_149020_k; + } + + public void func_148996_a(int p_148996_1_) + { + this.field_149016_b = p_148996_1_; + } + + public void func_148995_b(int p_148995_1_) + { + this.field_149017_c = p_148995_1_; + } + + public void func_149005_c(int p_149005_1_) + { + this.field_149014_d = p_149005_1_; + } + + public void func_149003_d(int p_149003_1_) + { + this.field_149015_e = p_149003_1_; + } + + public void func_149000_e(int p_149000_1_) + { + this.field_149012_f = p_149000_1_; + } + + public void func_149007_f(int p_149007_1_) + { + this.field_149013_g = p_149007_1_; + } + + @SideOnly(Side.CLIENT) + public void func_149002_g(int p_149002_1_) + { + this.field_149020_k = p_149002_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java new file mode 100644 index 0000000..496bd9c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S0FPacketSpawnMob.java @@ -0,0 +1,224 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S0FPacketSpawnMob extends Packet +{ + private int field_149042_a; + private int field_149040_b; + private int field_149041_c; + private int field_149038_d; + private int field_149039_e; + private int field_149036_f; + private int field_149037_g; + private int field_149047_h; + private byte field_149048_i; + private byte field_149045_j; + private byte field_149046_k; + private DataWatcher field_149043_l; + private List field_149044_m; + private static final String __OBFID = "CL_00001279"; + + public S0FPacketSpawnMob() {} + + public S0FPacketSpawnMob(EntityLivingBase p_i45192_1_) + { + this.field_149042_a = p_i45192_1_.getEntityId(); + this.field_149040_b = (byte)EntityList.getEntityID(p_i45192_1_); + this.field_149041_c = p_i45192_1_.myEntitySize.multiplyBy32AndRound(p_i45192_1_.posX); + this.field_149038_d = MathHelper.floor_double(p_i45192_1_.posY * 32.0D); + this.field_149039_e = p_i45192_1_.myEntitySize.multiplyBy32AndRound(p_i45192_1_.posZ); + this.field_149048_i = (byte)((int)(p_i45192_1_.rotationYaw * 256.0F / 360.0F)); + this.field_149045_j = (byte)((int)(p_i45192_1_.rotationPitch * 256.0F / 360.0F)); + this.field_149046_k = (byte)((int)(p_i45192_1_.rotationYawHead * 256.0F / 360.0F)); + double d0 = 3.9D; + double d1 = p_i45192_1_.motionX; + double d2 = p_i45192_1_.motionY; + double d3 = p_i45192_1_.motionZ; + + if (d1 < -d0) + { + d1 = -d0; + } + + if (d2 < -d0) + { + d2 = -d0; + } + + if (d3 < -d0) + { + d3 = -d0; + } + + if (d1 > d0) + { + d1 = d0; + } + + if (d2 > d0) + { + d2 = d0; + } + + if (d3 > d0) + { + d3 = d0; + } + + this.field_149036_f = (int)(d1 * 8000.0D); + this.field_149037_g = (int)(d2 * 8000.0D); + this.field_149047_h = (int)(d3 * 8000.0D); + this.field_149043_l = p_i45192_1_.getDataWatcher(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149042_a = data.readVarIntFromBuffer(); + this.field_149040_b = data.readByte() & 255; + this.field_149041_c = data.readInt(); + this.field_149038_d = data.readInt(); + this.field_149039_e = data.readInt(); + this.field_149048_i = data.readByte(); + this.field_149045_j = data.readByte(); + this.field_149046_k = data.readByte(); + this.field_149036_f = data.readShort(); + this.field_149037_g = data.readShort(); + this.field_149047_h = data.readShort(); + this.field_149044_m = DataWatcher.readWatchedListFromPacketBuffer(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149042_a); + data.writeByte(this.field_149040_b & 255); + data.writeInt(this.field_149041_c); + data.writeInt(this.field_149038_d); + data.writeInt(this.field_149039_e); + data.writeByte(this.field_149048_i); + data.writeByte(this.field_149045_j); + data.writeByte(this.field_149046_k); + data.writeShort(this.field_149036_f); + data.writeShort(this.field_149037_g); + data.writeShort(this.field_149047_h); + this.field_149043_l.func_151509_a(data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnMob(this); + } + + @SideOnly(Side.CLIENT) + public List func_149027_c() + { + if (this.field_149044_m == null) + { + this.field_149044_m = this.field_149043_l.getAllWatched(); + } + + return this.field_149044_m; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f, xd=%.2f, yd=%.2f, zd=%.2f", new Object[] {Integer.valueOf(this.field_149042_a), Integer.valueOf(this.field_149040_b), Float.valueOf((float)this.field_149041_c / 32.0F), Float.valueOf((float)this.field_149038_d / 32.0F), Float.valueOf((float)this.field_149039_e / 32.0F), Float.valueOf((float)this.field_149036_f / 8000.0F), Float.valueOf((float)this.field_149037_g / 8000.0F), Float.valueOf((float)this.field_149047_h / 8000.0F)}); + } + + @SideOnly(Side.CLIENT) + public int func_149024_d() + { + return this.field_149042_a; + } + + @SideOnly(Side.CLIENT) + public int func_149025_e() + { + return this.field_149040_b; + } + + @SideOnly(Side.CLIENT) + public int func_149023_f() + { + return this.field_149041_c; + } + + @SideOnly(Side.CLIENT) + public int func_149034_g() + { + return this.field_149038_d; + } + + @SideOnly(Side.CLIENT) + public int func_149029_h() + { + return this.field_149039_e; + } + + @SideOnly(Side.CLIENT) + public int func_149026_i() + { + return this.field_149036_f; + } + + @SideOnly(Side.CLIENT) + public int func_149033_j() + { + return this.field_149037_g; + } + + @SideOnly(Side.CLIENT) + public int func_149031_k() + { + return this.field_149047_h; + } + + @SideOnly(Side.CLIENT) + public byte func_149028_l() + { + return this.field_149048_i; + } + + @SideOnly(Side.CLIENT) + public byte func_149030_m() + { + return this.field_149045_j; + } + + @SideOnly(Side.CLIENT) + public byte func_149032_n() + { + return this.field_149046_k; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java new file mode 100644 index 0000000..287a47b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S10PacketSpawnPainting.java @@ -0,0 +1,119 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.item.EntityPainting; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S10PacketSpawnPainting extends Packet +{ + private int field_148973_a; + private int field_148971_b; + private int field_148972_c; + private int field_148969_d; + private int field_148970_e; + private String field_148968_f; + private static final String __OBFID = "CL_00001280"; + + public S10PacketSpawnPainting() {} + + public S10PacketSpawnPainting(EntityPainting p_i45170_1_) + { + this.field_148973_a = p_i45170_1_.getEntityId(); + this.field_148971_b = p_i45170_1_.field_146063_b; + this.field_148972_c = p_i45170_1_.field_146064_c; + this.field_148969_d = p_i45170_1_.field_146062_d; + this.field_148970_e = p_i45170_1_.hangingDirection; + this.field_148968_f = p_i45170_1_.art.title; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148973_a = data.readVarIntFromBuffer(); + this.field_148968_f = data.readStringFromBuffer(EntityPainting.EnumArt.maxArtTitleLength); + this.field_148971_b = data.readInt(); + this.field_148972_c = data.readInt(); + this.field_148969_d = data.readInt(); + this.field_148970_e = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148973_a); + data.writeStringToBuffer(this.field_148968_f); + data.writeInt(this.field_148971_b); + data.writeInt(this.field_148972_c); + data.writeInt(this.field_148969_d); + data.writeInt(this.field_148970_e); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnPainting(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%s, x=%d, y=%d, z=%d", new Object[] {Integer.valueOf(this.field_148973_a), this.field_148968_f, Integer.valueOf(this.field_148971_b), Integer.valueOf(this.field_148972_c), Integer.valueOf(this.field_148969_d)}); + } + + @SideOnly(Side.CLIENT) + public int func_148965_c() + { + return this.field_148973_a; + } + + @SideOnly(Side.CLIENT) + public int func_148964_d() + { + return this.field_148971_b; + } + + @SideOnly(Side.CLIENT) + public int func_148963_e() + { + return this.field_148972_c; + } + + @SideOnly(Side.CLIENT) + public int func_148962_f() + { + return this.field_148969_d; + } + + @SideOnly(Side.CLIENT) + public int func_148966_g() + { + return this.field_148970_e; + } + + @SideOnly(Side.CLIENT) + public String func_148961_h() + { + return this.field_148968_f; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java new file mode 100644 index 0000000..bdaccbe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S11PacketSpawnExperienceOrb.java @@ -0,0 +1,110 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S11PacketSpawnExperienceOrb extends Packet +{ + private int field_148992_a; + private int field_148990_b; + private int field_148991_c; + private int field_148988_d; + private int field_148989_e; + private static final String __OBFID = "CL_00001277"; + + public S11PacketSpawnExperienceOrb() {} + + public S11PacketSpawnExperienceOrb(EntityXPOrb p_i45167_1_) + { + this.field_148992_a = p_i45167_1_.getEntityId(); + this.field_148990_b = MathHelper.floor_double(p_i45167_1_.posX * 32.0D); + this.field_148991_c = MathHelper.floor_double(p_i45167_1_.posY * 32.0D); + this.field_148988_d = MathHelper.floor_double(p_i45167_1_.posZ * 32.0D); + this.field_148989_e = p_i45167_1_.getXpValue(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148992_a = data.readVarIntFromBuffer(); + this.field_148990_b = data.readInt(); + this.field_148991_c = data.readInt(); + this.field_148988_d = data.readInt(); + this.field_148989_e = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148992_a); + data.writeInt(this.field_148990_b); + data.writeInt(this.field_148991_c); + data.writeInt(this.field_148988_d); + data.writeShort(this.field_148989_e); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnExperienceOrb(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, value=%d, x=%.2f, y=%.2f, z=%.2f", new Object[] {Integer.valueOf(this.field_148992_a), Integer.valueOf(this.field_148989_e), Float.valueOf((float)this.field_148990_b / 32.0F), Float.valueOf((float)this.field_148991_c / 32.0F), Float.valueOf((float)this.field_148988_d / 32.0F)}); + } + + @SideOnly(Side.CLIENT) + public int func_148985_c() + { + return this.field_148992_a; + } + + @SideOnly(Side.CLIENT) + public int func_148984_d() + { + return this.field_148990_b; + } + + @SideOnly(Side.CLIENT) + public int func_148983_e() + { + return this.field_148991_c; + } + + @SideOnly(Side.CLIENT) + public int func_148982_f() + { + return this.field_148988_d; + } + + @SideOnly(Side.CLIENT) + public int func_148986_g() + { + return this.field_148989_e; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java new file mode 100644 index 0000000..c1de090 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S12PacketEntityVelocity.java @@ -0,0 +1,136 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S12PacketEntityVelocity extends Packet +{ + private int field_149417_a; + private int field_149415_b; + private int field_149416_c; + private int field_149414_d; + private static final String __OBFID = "CL_00001328"; + + public S12PacketEntityVelocity() {} + + public S12PacketEntityVelocity(Entity p_i45219_1_) + { + this(p_i45219_1_.getEntityId(), p_i45219_1_.motionX, p_i45219_1_.motionY, p_i45219_1_.motionZ); + } + + public S12PacketEntityVelocity(int p_i45220_1_, double p_i45220_2_, double p_i45220_4_, double p_i45220_6_) + { + this.field_149417_a = p_i45220_1_; + double d3 = 3.9D; + + if (p_i45220_2_ < -d3) + { + p_i45220_2_ = -d3; + } + + if (p_i45220_4_ < -d3) + { + p_i45220_4_ = -d3; + } + + if (p_i45220_6_ < -d3) + { + p_i45220_6_ = -d3; + } + + if (p_i45220_2_ > d3) + { + p_i45220_2_ = d3; + } + + if (p_i45220_4_ > d3) + { + p_i45220_4_ = d3; + } + + if (p_i45220_6_ > d3) + { + p_i45220_6_ = d3; + } + + this.field_149415_b = (int)(p_i45220_2_ * 8000.0D); + this.field_149416_c = (int)(p_i45220_4_ * 8000.0D); + this.field_149414_d = (int)(p_i45220_6_ * 8000.0D); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149417_a = data.readInt(); + this.field_149415_b = data.readShort(); + this.field_149416_c = data.readShort(); + this.field_149414_d = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149417_a); + data.writeShort(this.field_149415_b); + data.writeShort(this.field_149416_c); + data.writeShort(this.field_149414_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityVelocity(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, x=%.2f, y=%.2f, z=%.2f", new Object[] {Integer.valueOf(this.field_149417_a), Float.valueOf((float)this.field_149415_b / 8000.0F), Float.valueOf((float)this.field_149416_c / 8000.0F), Float.valueOf((float)this.field_149414_d / 8000.0F)}); + } + + @SideOnly(Side.CLIENT) + public int func_149412_c() + { + return this.field_149417_a; + } + + @SideOnly(Side.CLIENT) + public int func_149411_d() + { + return this.field_149415_b; + } + + @SideOnly(Side.CLIENT) + public int func_149410_e() + { + return this.field_149416_c; + } + + @SideOnly(Side.CLIENT) + public int func_149409_f() + { + return this.field_149414_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java new file mode 100644 index 0000000..df02869 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S13PacketDestroyEntities.java @@ -0,0 +1,90 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S13PacketDestroyEntities extends Packet +{ + private int[] field_149100_a; + private static final String __OBFID = "CL_00001320"; + + public S13PacketDestroyEntities() {} + + public S13PacketDestroyEntities(int ... p_i45211_1_) + { + this.field_149100_a = p_i45211_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149100_a = new int[data.readByte()]; + + for (int i = 0; i < this.field_149100_a.length; ++i) + { + this.field_149100_a[i] = data.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149100_a.length); + + for (int i = 0; i < this.field_149100_a.length; ++i) + { + data.writeInt(this.field_149100_a[i]); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDestroyEntities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < this.field_149100_a.length; ++i) + { + if (i > 0) + { + stringbuilder.append(", "); + } + + stringbuilder.append(this.field_149100_a[i]); + } + + return String.format("entities=%d[%s]", new Object[] {Integer.valueOf(this.field_149100_a.length), stringbuilder}); + } + + @SideOnly(Side.CLIENT) + public int[] func_149098_c() + { + return this.field_149100_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S14PacketEntity.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S14PacketEntity.java new file mode 100644 index 0000000..dfb6b06 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S14PacketEntity.java @@ -0,0 +1,290 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S14PacketEntity extends Packet +{ + protected int field_149074_a; + protected byte field_149072_b; + protected byte field_149073_c; + protected byte field_149070_d; + protected byte field_149071_e; + protected byte field_149068_f; + protected boolean field_149069_g; + private static final String __OBFID = "CL_00001312"; + + public S14PacketEntity() {} + + public S14PacketEntity(int p_i45206_1_) + { + this.field_149074_a = p_i45206_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149074_a = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149074_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityMovement(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d", new Object[] {Integer.valueOf(this.field_149074_a)}); + } + + public String toString() + { + return "Entity_" + super.toString(); + } + + @SideOnly(Side.CLIENT) + public Entity func_149065_a(World p_149065_1_) + { + return p_149065_1_.getEntityByID(this.field_149074_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public byte func_149062_c() + { + return this.field_149072_b; + } + + @SideOnly(Side.CLIENT) + public byte func_149061_d() + { + return this.field_149073_c; + } + + @SideOnly(Side.CLIENT) + public byte func_149064_e() + { + return this.field_149070_d; + } + + @SideOnly(Side.CLIENT) + public byte func_149066_f() + { + return this.field_149071_e; + } + + @SideOnly(Side.CLIENT) + public byte func_149063_g() + { + return this.field_149068_f; + } + + @SideOnly(Side.CLIENT) + public boolean func_149060_h() + { + return this.field_149069_g; + } + + public static class S15PacketEntityRelMove extends S14PacketEntity + { + private static final String __OBFID = "CL_00001313"; + + public S15PacketEntityRelMove() {} + + public S15PacketEntityRelMove(int p_i45203_1_, byte p_i45203_2_, byte p_i45203_3_, byte p_i45203_4_) + { + super(p_i45203_1_); + this.field_149072_b = p_i45203_2_; + this.field_149073_c = p_i45203_3_; + this.field_149070_d = p_i45203_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + super.readPacketData(data); + this.field_149072_b = data.readByte(); + this.field_149073_c = data.readByte(); + this.field_149070_d = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + super.writePacketData(data); + data.writeByte(this.field_149072_b); + data.writeByte(this.field_149073_c); + data.writeByte(this.field_149070_d); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging + * purposes. + */ + public String serialize() + { + return super.serialize() + String.format(", xa=%d, ya=%d, za=%d", new Object[] {Byte.valueOf(this.field_149072_b), Byte.valueOf(this.field_149073_c), Byte.valueOf(this.field_149070_d)}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayClient)handler); + } + } + + public static class S16PacketEntityLook extends S14PacketEntity + { + private static final String __OBFID = "CL_00001315"; + + public S16PacketEntityLook() + { + this.field_149069_g = true; + } + + public S16PacketEntityLook(int p_i45205_1_, byte p_i45205_2_, byte p_i45205_3_) + { + super(p_i45205_1_); + this.field_149071_e = p_i45205_2_; + this.field_149068_f = p_i45205_3_; + this.field_149069_g = true; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + super.readPacketData(data); + this.field_149071_e = data.readByte(); + this.field_149068_f = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + super.writePacketData(data); + data.writeByte(this.field_149071_e); + data.writeByte(this.field_149068_f); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging + * purposes. + */ + public String serialize() + { + return super.serialize() + String.format(", yRot=%d, xRot=%d", new Object[] {Byte.valueOf(this.field_149071_e), Byte.valueOf(this.field_149068_f)}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayClient)handler); + } + } + + public static class S17PacketEntityLookMove extends S14PacketEntity + { + private static final String __OBFID = "CL_00001314"; + + public S17PacketEntityLookMove() + { + this.field_149069_g = true; + } + + public S17PacketEntityLookMove(int p_i45204_1_, byte p_i45204_2_, byte p_i45204_3_, byte p_i45204_4_, byte p_i45204_5_, byte p_i45204_6_) + { + super(p_i45204_1_); + this.field_149072_b = p_i45204_2_; + this.field_149073_c = p_i45204_3_; + this.field_149070_d = p_i45204_4_; + this.field_149071_e = p_i45204_5_; + this.field_149068_f = p_i45204_6_; + this.field_149069_g = true; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + super.readPacketData(data); + this.field_149072_b = data.readByte(); + this.field_149073_c = data.readByte(); + this.field_149070_d = data.readByte(); + this.field_149071_e = data.readByte(); + this.field_149068_f = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + super.writePacketData(data); + data.writeByte(this.field_149072_b); + data.writeByte(this.field_149073_c); + data.writeByte(this.field_149070_d); + data.writeByte(this.field_149071_e); + data.writeByte(this.field_149068_f); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging + * purposes. + */ + public String serialize() + { + return super.serialize() + String.format(", xa=%d, ya=%d, za=%d, yRot=%d, xRot=%d", new Object[] {Byte.valueOf(this.field_149072_b), Byte.valueOf(this.field_149073_c), Byte.valueOf(this.field_149070_d), Byte.valueOf(this.field_149071_e), Byte.valueOf(this.field_149068_f)}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + super.processPacket((INetHandlerPlayClient)handler); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java new file mode 100644 index 0000000..747ba34 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S18PacketEntityTeleport.java @@ -0,0 +1,122 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S18PacketEntityTeleport extends Packet +{ + private int field_149458_a; + private int field_149456_b; + private int field_149457_c; + private int field_149454_d; + private byte field_149455_e; + private byte field_149453_f; + private static final String __OBFID = "CL_00001340"; + + public S18PacketEntityTeleport() {} + + public S18PacketEntityTeleport(Entity p_i45233_1_) + { + this.field_149458_a = p_i45233_1_.getEntityId(); + this.field_149456_b = MathHelper.floor_double(p_i45233_1_.posX * 32.0D); + this.field_149457_c = MathHelper.floor_double(p_i45233_1_.posY * 32.0D); + this.field_149454_d = MathHelper.floor_double(p_i45233_1_.posZ * 32.0D); + this.field_149455_e = (byte)((int)(p_i45233_1_.rotationYaw * 256.0F / 360.0F)); + this.field_149453_f = (byte)((int)(p_i45233_1_.rotationPitch * 256.0F / 360.0F)); + } + + public S18PacketEntityTeleport(int p_i45234_1_, int p_i45234_2_, int p_i45234_3_, int p_i45234_4_, byte p_i45234_5_, byte p_i45234_6_) + { + this.field_149458_a = p_i45234_1_; + this.field_149456_b = p_i45234_2_; + this.field_149457_c = p_i45234_3_; + this.field_149454_d = p_i45234_4_; + this.field_149455_e = p_i45234_5_; + this.field_149453_f = p_i45234_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149458_a = data.readInt(); + this.field_149456_b = data.readInt(); + this.field_149457_c = data.readInt(); + this.field_149454_d = data.readInt(); + this.field_149455_e = data.readByte(); + this.field_149453_f = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149458_a); + data.writeInt(this.field_149456_b); + data.writeInt(this.field_149457_c); + data.writeInt(this.field_149454_d); + data.writeByte(this.field_149455_e); + data.writeByte(this.field_149453_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityTeleport(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149451_c() + { + return this.field_149458_a; + } + + @SideOnly(Side.CLIENT) + public int func_149449_d() + { + return this.field_149456_b; + } + + @SideOnly(Side.CLIENT) + public int func_149448_e() + { + return this.field_149457_c; + } + + @SideOnly(Side.CLIENT) + public int func_149446_f() + { + return this.field_149454_d; + } + + @SideOnly(Side.CLIENT) + public byte func_149450_g() + { + return this.field_149455_e; + } + + @SideOnly(Side.CLIENT) + public byte func_149447_h() + { + return this.field_149453_f; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java new file mode 100644 index 0000000..511986c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityHeadLook.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityHeadLook extends Packet +{ + private int field_149384_a; + private byte field_149383_b; + private static final String __OBFID = "CL_00001323"; + + public S19PacketEntityHeadLook() {} + + public S19PacketEntityHeadLook(Entity p_i45214_1_, byte p_i45214_2_) + { + this.field_149384_a = p_i45214_1_.getEntityId(); + this.field_149383_b = p_i45214_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149384_a = data.readInt(); + this.field_149383_b = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149384_a); + data.writeByte(this.field_149383_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityHeadLook(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, rot=%d", new Object[] {Integer.valueOf(this.field_149384_a), Byte.valueOf(this.field_149383_b)}); + } + + @SideOnly(Side.CLIENT) + public Entity func_149381_a(World p_149381_1_) + { + return p_149381_1_.getEntityByID(this.field_149384_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public byte func_149380_c() + { + return this.field_149383_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityStatus.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityStatus.java new file mode 100644 index 0000000..9e0f9bf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S19PacketEntityStatus.java @@ -0,0 +1,72 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S19PacketEntityStatus extends Packet +{ + private int field_149164_a; + private byte field_149163_b; + private static final String __OBFID = "CL_00001299"; + + public S19PacketEntityStatus() {} + + public S19PacketEntityStatus(Entity p_i45192_1_, byte p_i45192_2_) + { + this.field_149164_a = p_i45192_1_.getEntityId(); + this.field_149163_b = p_i45192_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149164_a = data.readInt(); + this.field_149163_b = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149164_a); + data.writeByte(this.field_149163_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityStatus(this); + } + + @SideOnly(Side.CLIENT) + public Entity func_149161_a(World p_149161_1_) + { + return p_149161_1_.getEntityByID(this.field_149164_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public byte func_149160_c() + { + return this.field_149163_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java new file mode 100644 index 0000000..a0af2d5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1BPacketEntityAttach.java @@ -0,0 +1,81 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1BPacketEntityAttach extends Packet +{ + private int field_149408_a; + private int field_149406_b; + private int field_149407_c; + private static final String __OBFID = "CL_00001327"; + + public S1BPacketEntityAttach() {} + + public S1BPacketEntityAttach(int p_i45218_1_, Entity p_i45218_2_, Entity p_i45218_3_) + { + this.field_149408_a = p_i45218_1_; + this.field_149406_b = p_i45218_2_.getEntityId(); + this.field_149407_c = p_i45218_3_ != null ? p_i45218_3_.getEntityId() : -1; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149406_b = data.readInt(); + this.field_149407_c = data.readInt(); + this.field_149408_a = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149406_b); + data.writeInt(this.field_149407_c); + data.writeByte(this.field_149408_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityAttach(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149404_c() + { + return this.field_149408_a; + } + + @SideOnly(Side.CLIENT) + public int func_149403_d() + { + return this.field_149406_b; + } + + @SideOnly(Side.CLIENT) + public int func_149402_e() + { + return this.field_149407_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java new file mode 100644 index 0000000..e5cadbc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1CPacketEntityMetadata.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.List; +import net.minecraft.entity.DataWatcher; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1CPacketEntityMetadata extends Packet +{ + private int field_149379_a; + private List field_149378_b; + private static final String __OBFID = "CL_00001326"; + + public S1CPacketEntityMetadata() {} + + public S1CPacketEntityMetadata(int p_i45217_1_, DataWatcher p_i45217_2_, boolean p_i45217_3_) + { + this.field_149379_a = p_i45217_1_; + + if (p_i45217_3_) + { + this.field_149378_b = p_i45217_2_.getAllWatched(); + } + else + { + this.field_149378_b = p_i45217_2_.getChanged(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149379_a = data.readInt(); + this.field_149378_b = DataWatcher.readWatchedListFromPacketBuffer(data); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149379_a); + DataWatcher.writeWatchedListToPacketBuffer(this.field_149378_b, data); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityMetadata(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public List func_149376_c() + { + return this.field_149378_b; + } + + @SideOnly(Side.CLIENT) + public int func_149375_d() + { + return this.field_149379_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java new file mode 100644 index 0000000..8795ee7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1DPacketEntityEffect.java @@ -0,0 +1,105 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1DPacketEntityEffect extends Packet +{ + private int field_149434_a; + private byte field_149432_b; + private byte field_149433_c; + private short field_149431_d; + private static final String __OBFID = "CL_00001343"; + + public S1DPacketEntityEffect() {} + + public S1DPacketEntityEffect(int p_i45237_1_, PotionEffect p_i45237_2_) + { + this.field_149434_a = p_i45237_1_; + this.field_149432_b = (byte)(p_i45237_2_.getPotionID() & 255); + this.field_149433_c = (byte)(p_i45237_2_.getAmplifier() & 255); + + if (p_i45237_2_.getDuration() > 32767) + { + this.field_149431_d = 32767; + } + else + { + this.field_149431_d = (short)p_i45237_2_.getDuration(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149434_a = data.readInt(); + this.field_149432_b = data.readByte(); + this.field_149433_c = data.readByte(); + this.field_149431_d = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149434_a); + data.writeByte(this.field_149432_b); + data.writeByte(this.field_149433_c); + data.writeShort(this.field_149431_d); + } + + @SideOnly(Side.CLIENT) + public boolean func_149429_c() + { + return this.field_149431_d == 32767; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityEffect(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149426_d() + { + return this.field_149434_a; + } + + @SideOnly(Side.CLIENT) + public byte func_149427_e() + { + return this.field_149432_b; + } + + @SideOnly(Side.CLIENT) + public byte func_149428_f() + { + return this.field_149433_c; + } + + @SideOnly(Side.CLIENT) + public short func_149425_g() + { + return this.field_149431_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java new file mode 100644 index 0000000..6b7905b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1EPacketRemoveEntityEffect.java @@ -0,0 +1,71 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.potion.PotionEffect; + +public class S1EPacketRemoveEntityEffect extends Packet +{ + private int field_149079_a; + private int field_149078_b; + private static final String __OBFID = "CL_00001321"; + + public S1EPacketRemoveEntityEffect() {} + + public S1EPacketRemoveEntityEffect(int p_i45212_1_, PotionEffect p_i45212_2_) + { + this.field_149079_a = p_i45212_1_; + this.field_149078_b = p_i45212_2_.getPotionID(); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149079_a = data.readInt(); + this.field_149078_b = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149079_a); + data.writeByte(this.field_149078_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleRemoveEntityEffect(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149076_c() + { + return this.field_149079_a; + } + + @SideOnly(Side.CLIENT) + public int func_149075_d() + { + return this.field_149078_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1FPacketSetExperience.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1FPacketSetExperience.java new file mode 100644 index 0000000..ad33f79 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S1FPacketSetExperience.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S1FPacketSetExperience extends Packet +{ + private float field_149401_a; + private int field_149399_b; + private int field_149400_c; + private static final String __OBFID = "CL_00001331"; + + public S1FPacketSetExperience() {} + + public S1FPacketSetExperience(float p_i45222_1_, int p_i45222_2_, int p_i45222_3_) + { + this.field_149401_a = p_i45222_1_; + this.field_149399_b = p_i45222_2_; + this.field_149400_c = p_i45222_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149401_a = data.readFloat(); + this.field_149400_c = data.readShort(); + this.field_149399_b = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeFloat(this.field_149401_a); + data.writeShort(this.field_149400_c); + data.writeShort(this.field_149399_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSetExperience(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public float func_149397_c() + { + return this.field_149401_a; + } + + @SideOnly(Side.CLIENT) + public int func_149396_d() + { + return this.field_149399_b; + } + + @SideOnly(Side.CLIENT) + public int func_149395_e() + { + return this.field_149400_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S20PacketEntityProperties.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S20PacketEntityProperties.java new file mode 100644 index 0000000..abf9164 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S20PacketEntityProperties.java @@ -0,0 +1,148 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S20PacketEntityProperties extends Packet +{ + private int field_149445_a; + private final List field_149444_b = new ArrayList(); + private static final String __OBFID = "CL_00001341"; + + public S20PacketEntityProperties() {} + + public S20PacketEntityProperties(int p_i45236_1_, Collection p_i45236_2_) + { + this.field_149445_a = p_i45236_1_; + Iterator iterator = p_i45236_2_.iterator(); + + while (iterator.hasNext()) + { + IAttributeInstance iattributeinstance = (IAttributeInstance)iterator.next(); + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(iattributeinstance.getAttribute().getAttributeUnlocalizedName(), iattributeinstance.getBaseValue(), iattributeinstance.func_111122_c())); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149445_a = data.readInt(); + int i = data.readInt(); + + for (int j = 0; j < i; ++j) + { + String s = data.readStringFromBuffer(64); + double d0 = data.readDouble(); + ArrayList arraylist = new ArrayList(); + short short1 = data.readShort(); + + for (int k = 0; k < short1; ++k) + { + UUID uuid = new UUID(data.readLong(), data.readLong()); + arraylist.add(new AttributeModifier(uuid, "Unknown synced attribute modifier", data.readDouble(), data.readByte())); + } + + this.field_149444_b.add(new S20PacketEntityProperties.Snapshot(s, d0, arraylist)); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149445_a); + data.writeInt(this.field_149444_b.size()); + Iterator iterator = this.field_149444_b.iterator(); + + while (iterator.hasNext()) + { + S20PacketEntityProperties.Snapshot snapshot = (S20PacketEntityProperties.Snapshot)iterator.next(); + data.writeStringToBuffer(snapshot.func_151409_a()); + data.writeDouble(snapshot.func_151410_b()); + data.writeShort(snapshot.func_151408_c().size()); + Iterator iterator1 = snapshot.func_151408_c().iterator(); + + while (iterator1.hasNext()) + { + AttributeModifier attributemodifier = (AttributeModifier)iterator1.next(); + data.writeLong(attributemodifier.getID().getMostSignificantBits()); + data.writeLong(attributemodifier.getID().getLeastSignificantBits()); + data.writeDouble(attributemodifier.getAmount()); + data.writeByte(attributemodifier.getOperation()); + } + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEntityProperties(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149442_c() + { + return this.field_149445_a; + } + + @SideOnly(Side.CLIENT) + public List func_149441_d() + { + return this.field_149444_b; + } + + public class Snapshot + { + private final String field_151412_b; + private final double field_151413_c; + private final Collection field_151411_d; + private static final String __OBFID = "CL_00001342"; + + public Snapshot(String p_i45235_2_, double p_i45235_3_, Collection p_i45235_5_) + { + this.field_151412_b = p_i45235_2_; + this.field_151413_c = p_i45235_3_; + this.field_151411_d = p_i45235_5_; + } + + public String func_151409_a() + { + return this.field_151412_b; + } + + public double func_151410_b() + { + return this.field_151413_c; + } + + public Collection func_151408_c() + { + return this.field_151411_d; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S21PacketChunkData.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S21PacketChunkData.java new file mode 100644 index 0000000..42014de --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S21PacketChunkData.java @@ -0,0 +1,311 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.concurrent.Semaphore; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + +public class S21PacketChunkData extends Packet +{ + private int field_149284_a; + private int field_149282_b; + private int field_149283_c; + private int field_149280_d; + private byte[] field_149281_e; + private byte[] field_149278_f; + private boolean field_149279_g; + private int field_149285_h; + private static byte[] field_149286_i = new byte[196864]; + private static final String __OBFID = "CL_00001304"; + private Semaphore deflateGate; + + public S21PacketChunkData() {} + + public S21PacketChunkData(Chunk p_i45196_1_, boolean p_i45196_2_, int p_i45196_3_) + { + this.field_149284_a = p_i45196_1_.xPosition; + this.field_149282_b = p_i45196_1_.zPosition; + this.field_149279_g = p_i45196_2_; + S21PacketChunkData.Extracted extracted = func_149269_a(p_i45196_1_, p_i45196_2_, p_i45196_3_); + this.field_149280_d = extracted.field_150281_c; + this.field_149283_c = extracted.field_150280_b; + this.field_149278_f = extracted.field_150282_a; + this.deflateGate = new Semaphore(1); + } + + private void deflate() + { + Deflater deflater = new Deflater(-1); + try + { + deflater.setInput(this.field_149278_f, 0, this.field_149278_f.length); + deflater.finish(); + byte[] deflated = new byte[this.field_149278_f.length]; + this.field_149285_h = deflater.deflate(deflated); + this.field_149281_e = deflated; + } + finally + { + deflater.end(); + } + } + + public static int func_149275_c() + { + return 196864; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149284_a = data.readInt(); + this.field_149282_b = data.readInt(); + this.field_149279_g = data.readBoolean(); + this.field_149283_c = data.readShort(); + this.field_149280_d = data.readShort(); + this.field_149285_h = data.readInt(); + + if (field_149286_i.length < this.field_149285_h) + { + field_149286_i = new byte[this.field_149285_h]; + } + + data.readBytes(field_149286_i, 0, this.field_149285_h); + int i = 0; + int j; + int msb = 0; //BugFix: MC does not read the MSB array from the packet properly, causing issues for servers that use blocks > 256 + + for (j = 0; j < 16; ++j) + { + i += this.field_149283_c >> j & 1; + msb += this.field_149283_c >> j & 1; + } + + j = 12288 * i; + j += 2048 * msb; + + if (this.field_149279_g) + { + j += 256; + } + + this.field_149278_f = new byte[j]; + Inflater inflater = new Inflater(); + inflater.setInput(field_149286_i, 0, this.field_149285_h); + + try + { + inflater.inflate(this.field_149278_f); + } + catch (DataFormatException dataformatexception) + { + throw new IOException("Bad compressed data format"); + } + finally + { + inflater.end(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + if (this.field_149281_e == null) + { + deflateGate.acquireUninterruptibly(); + if (this.field_149281_e == null) + { + deflate(); + } + deflateGate.release(); + } + data.writeInt(this.field_149284_a); + data.writeInt(this.field_149282_b); + data.writeBoolean(this.field_149279_g); + data.writeShort((short)(this.field_149283_c & 65535)); + data.writeShort((short)(this.field_149280_d & 65535)); + data.writeInt(this.field_149285_h); + data.writeBytes(this.field_149281_e, 0, this.field_149285_h); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChunkData(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("x=%d, z=%d, full=%b, sects=%d, add=%d, size=%d", new Object[] {Integer.valueOf(this.field_149284_a), Integer.valueOf(this.field_149282_b), Boolean.valueOf(this.field_149279_g), Integer.valueOf(this.field_149283_c), Integer.valueOf(this.field_149280_d), Integer.valueOf(this.field_149285_h)}); + } + + @SideOnly(Side.CLIENT) + public byte[] func_149272_d() + { + return this.field_149278_f; + } + + public static S21PacketChunkData.Extracted func_149269_a(Chunk p_149269_0_, boolean p_149269_1_, int p_149269_2_) + { + int j = 0; + ExtendedBlockStorage[] aextendedblockstorage = p_149269_0_.getBlockStorageArray(); + int k = 0; + S21PacketChunkData.Extracted extracted = new S21PacketChunkData.Extracted(); + byte[] abyte = field_149286_i; + + if (p_149269_1_) + { + p_149269_0_.sendUpdates = true; + } + + int l; + + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && (p_149269_2_ & 1 << l) != 0) + { + extracted.field_150280_b |= 1 << l; + + if (aextendedblockstorage[l].getBlockMSBArray() != null) + { + extracted.field_150281_c |= 1 << l; + ++k; + } + } + } + + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && (p_149269_2_ & 1 << l) != 0) + { + byte[] abyte1 = aextendedblockstorage[l].getBlockLSBArray(); + System.arraycopy(abyte1, 0, abyte, j, abyte1.length); + j += abyte1.length; + } + } + + NibbleArray nibblearray; + + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && (p_149269_2_ & 1 << l) != 0) + { + nibblearray = aextendedblockstorage[l].getMetadataArray(); + System.arraycopy(nibblearray.data, 0, abyte, j, nibblearray.data.length); + j += nibblearray.data.length; + } + } + + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && (p_149269_2_ & 1 << l) != 0) + { + nibblearray = aextendedblockstorage[l].getBlocklightArray(); + System.arraycopy(nibblearray.data, 0, abyte, j, nibblearray.data.length); + j += nibblearray.data.length; + } + } + + if (!p_149269_0_.worldObj.provider.hasNoSky) + { + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && (p_149269_2_ & 1 << l) != 0) + { + nibblearray = aextendedblockstorage[l].getSkylightArray(); + System.arraycopy(nibblearray.data, 0, abyte, j, nibblearray.data.length); + j += nibblearray.data.length; + } + } + } + + if (k > 0) + { + for (l = 0; l < aextendedblockstorage.length; ++l) + { + if (aextendedblockstorage[l] != null && (!p_149269_1_ || !aextendedblockstorage[l].isEmpty()) && aextendedblockstorage[l].getBlockMSBArray() != null && (p_149269_2_ & 1 << l) != 0) + { + nibblearray = aextendedblockstorage[l].getBlockMSBArray(); + System.arraycopy(nibblearray.data, 0, abyte, j, nibblearray.data.length); + j += nibblearray.data.length; + } + } + } + + if (p_149269_1_) + { + byte[] abyte2 = p_149269_0_.getBiomeArray(); + System.arraycopy(abyte2, 0, abyte, j, abyte2.length); + j += abyte2.length; + } + + extracted.field_150282_a = new byte[j]; + System.arraycopy(abyte, 0, extracted.field_150282_a, 0, j); + return extracted; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149273_e() + { + return this.field_149284_a; + } + + @SideOnly(Side.CLIENT) + public int func_149271_f() + { + return this.field_149282_b; + } + + @SideOnly(Side.CLIENT) + public int func_149276_g() + { + return this.field_149283_c; + } + + @SideOnly(Side.CLIENT) + public int func_149270_h() + { + return this.field_149280_d; + } + + @SideOnly(Side.CLIENT) + public boolean func_149274_i() + { + return this.field_149279_g; + } + + public static class Extracted + { + public byte[] field_150282_a; + public int field_150280_b; + public int field_150281_c; + private static final String __OBFID = "CL_00001305"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java new file mode 100644 index 0000000..4e38a38 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S22PacketMultiBlockChange.java @@ -0,0 +1,139 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class S22PacketMultiBlockChange extends Packet +{ + private static final Logger logger = LogManager.getLogger(); + private ChunkCoordIntPair field_148925_b; + private byte[] field_148926_c; + private int field_148924_d; + private static final String __OBFID = "CL_00001290"; + + public S22PacketMultiBlockChange() {} + + public S22PacketMultiBlockChange(int p_i45181_1_, short[] p_i45181_2_, Chunk p_i45181_3_) + { + this.field_148925_b = new ChunkCoordIntPair(p_i45181_3_.xPosition, p_i45181_3_.zPosition); + this.field_148924_d = p_i45181_1_; + int j = 4 * p_i45181_1_; + + try + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(j); + DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream); + + for (int k = 0; k < p_i45181_1_; ++k) + { + int l = p_i45181_2_[k] >> 12 & 15; + int i1 = p_i45181_2_[k] >> 8 & 15; + int j1 = p_i45181_2_[k] & 255; + dataoutputstream.writeShort(p_i45181_2_[k]); + dataoutputstream.writeShort((short)((Block.getIdFromBlock(p_i45181_3_.getBlock(l, j1, i1)) & 4095) << 4 | p_i45181_3_.getBlockMetadata(l, j1, i1) & 15)); + } + + this.field_148926_c = bytearrayoutputstream.toByteArray(); + + if (this.field_148926_c.length != j) + { + throw new RuntimeException("Expected length " + j + " doesn\'t match received length " + this.field_148926_c.length); + } + } + catch (IOException ioexception) + { + logger.error("Couldn\'t create bulk block update packet", ioexception); + this.field_148926_c = null; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148925_b = new ChunkCoordIntPair(data.readInt(), data.readInt()); + this.field_148924_d = data.readShort() & 65535; + int i = data.readInt(); + + if (i > 0) + { + this.field_148926_c = new byte[i]; + data.readBytes(this.field_148926_c); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_148925_b.chunkXPos); + data.writeInt(this.field_148925_b.chunkZPos); + data.writeShort((short)this.field_148924_d); + + if (this.field_148926_c != null) + { + data.writeInt(this.field_148926_c.length); + data.writeBytes(this.field_148926_c); + } + else + { + data.writeInt(0); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMultiBlockChange(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("xc=%d, zc=%d, count=%d", new Object[] {Integer.valueOf(this.field_148925_b.chunkXPos), Integer.valueOf(this.field_148925_b.chunkZPos), Integer.valueOf(this.field_148924_d)}); + } + + @SideOnly(Side.CLIENT) + public ChunkCoordIntPair func_148920_c() + { + return this.field_148925_b; + } + + @SideOnly(Side.CLIENT) + public byte[] func_148921_d() + { + return this.field_148926_c; + } + + @SideOnly(Side.CLIENT) + public int func_148922_e() + { + return this.field_148924_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S23PacketBlockChange.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S23PacketBlockChange.java new file mode 100644 index 0000000..9be7a86 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S23PacketBlockChange.java @@ -0,0 +1,110 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.World; + +public class S23PacketBlockChange extends Packet +{ + private int field_148887_a; + private int field_148885_b; + private int field_148886_c; + public Block field_148883_d; + public int field_148884_e; + private static final String __OBFID = "CL_00001287"; + + public S23PacketBlockChange() {} + + public S23PacketBlockChange(int p_i45177_1_, int p_i45177_2_, int p_i45177_3_, World p_i45177_4_) + { + this.field_148887_a = p_i45177_1_; + this.field_148885_b = p_i45177_2_; + this.field_148886_c = p_i45177_3_; + this.field_148883_d = p_i45177_4_.getBlock(p_i45177_1_, p_i45177_2_, p_i45177_3_); + this.field_148884_e = p_i45177_4_.getBlockMetadata(p_i45177_1_, p_i45177_2_, p_i45177_3_); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148887_a = data.readInt(); + this.field_148885_b = data.readUnsignedByte(); + this.field_148886_c = data.readInt(); + this.field_148883_d = Block.getBlockById(data.readVarIntFromBuffer()); + this.field_148884_e = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_148887_a); + data.writeByte(this.field_148885_b); + data.writeInt(this.field_148886_c); + data.writeVarIntToBuffer(Block.getIdFromBlock(this.field_148883_d)); + data.writeByte(this.field_148884_e); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockChange(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("type=%d, data=%d, x=%d, y=%d, z=%d", new Object[] {Integer.valueOf(Block.getIdFromBlock(this.field_148883_d)), Integer.valueOf(this.field_148884_e), Integer.valueOf(this.field_148887_a), Integer.valueOf(this.field_148885_b), Integer.valueOf(this.field_148886_c)}); + } + + @SideOnly(Side.CLIENT) + public Block func_148880_c() + { + return this.field_148883_d; + } + + @SideOnly(Side.CLIENT) + public int func_148879_d() + { + return this.field_148887_a; + } + + @SideOnly(Side.CLIENT) + public int func_148878_e() + { + return this.field_148885_b; + } + + @SideOnly(Side.CLIENT) + public int func_148877_f() + { + return this.field_148886_c; + } + + @SideOnly(Side.CLIENT) + public int func_148881_g() + { + return this.field_148884_e; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S24PacketBlockAction.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S24PacketBlockAction.java new file mode 100644 index 0000000..5f32ce0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S24PacketBlockAction.java @@ -0,0 +1,111 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.block.Block; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S24PacketBlockAction extends Packet +{ + private int field_148876_a; + private int field_148874_b; + private int field_148875_c; + private int field_148872_d; + private int field_148873_e; + private Block field_148871_f; + private static final String __OBFID = "CL_00001286"; + + public S24PacketBlockAction() {} + + public S24PacketBlockAction(int p_i45176_1_, int p_i45176_2_, int p_i45176_3_, Block p_i45176_4_, int p_i45176_5_, int p_i45176_6_) + { + this.field_148876_a = p_i45176_1_; + this.field_148874_b = p_i45176_2_; + this.field_148875_c = p_i45176_3_; + this.field_148872_d = p_i45176_5_; + this.field_148873_e = p_i45176_6_; + this.field_148871_f = p_i45176_4_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148876_a = data.readInt(); + this.field_148874_b = data.readShort(); + this.field_148875_c = data.readInt(); + this.field_148872_d = data.readUnsignedByte(); + this.field_148873_e = data.readUnsignedByte(); + this.field_148871_f = Block.getBlockById(data.readVarIntFromBuffer() & 4095); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_148876_a); + data.writeShort(this.field_148874_b); + data.writeInt(this.field_148875_c); + data.writeByte(this.field_148872_d); + data.writeByte(this.field_148873_e); + data.writeVarIntToBuffer(Block.getIdFromBlock(this.field_148871_f) & 4095); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockAction(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public Block func_148868_c() + { + return this.field_148871_f; + } + + @SideOnly(Side.CLIENT) + public int func_148867_d() + { + return this.field_148876_a; + } + + @SideOnly(Side.CLIENT) + public int func_148866_e() + { + return this.field_148874_b; + } + + @SideOnly(Side.CLIENT) + public int func_148865_f() + { + return this.field_148875_c; + } + + @SideOnly(Side.CLIENT) + public int func_148869_g() + { + return this.field_148872_d; + } + + @SideOnly(Side.CLIENT) + public int func_148864_h() + { + return this.field_148873_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java new file mode 100644 index 0000000..e0940db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S25PacketBlockBreakAnim.java @@ -0,0 +1,100 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S25PacketBlockBreakAnim extends Packet +{ + private int field_148852_a; + private int field_148850_b; + private int field_148851_c; + private int field_148848_d; + private int field_148849_e; + private static final String __OBFID = "CL_00001284"; + + public S25PacketBlockBreakAnim() {} + + public S25PacketBlockBreakAnim(int p_i45174_1_, int p_i45174_2_, int p_i45174_3_, int p_i45174_4_, int p_i45174_5_) + { + this.field_148852_a = p_i45174_1_; + this.field_148850_b = p_i45174_2_; + this.field_148851_c = p_i45174_3_; + this.field_148848_d = p_i45174_4_; + this.field_148849_e = p_i45174_5_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148852_a = data.readVarIntFromBuffer(); + this.field_148850_b = data.readInt(); + this.field_148851_c = data.readInt(); + this.field_148848_d = data.readInt(); + this.field_148849_e = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148852_a); + data.writeInt(this.field_148850_b); + data.writeInt(this.field_148851_c); + data.writeInt(this.field_148848_d); + data.writeByte(this.field_148849_e); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleBlockBreakAnim(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_148845_c() + { + return this.field_148852_a; + } + + @SideOnly(Side.CLIENT) + public int func_148844_d() + { + return this.field_148850_b; + } + + @SideOnly(Side.CLIENT) + public int func_148843_e() + { + return this.field_148851_c; + } + + @SideOnly(Side.CLIENT) + public int func_148842_f() + { + return this.field_148848_d; + } + + @SideOnly(Side.CLIENT) + public int func_148846_g() + { + return this.field_148849_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java new file mode 100644 index 0000000..96eeaeb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S26PacketMapChunkBulk.java @@ -0,0 +1,259 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.Semaphore; +import java.util.zip.DataFormatException; +import java.util.zip.Deflater; +import java.util.zip.Inflater; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.world.chunk.Chunk; + +public class S26PacketMapChunkBulk extends Packet +{ + private int[] field_149266_a; + private int[] field_149264_b; + private int[] field_149265_c; + private int[] field_149262_d; + private byte[] field_149263_e; + private byte[][] field_149260_f; + private int field_149261_g; + private boolean field_149267_h; + private static byte[] field_149268_i = new byte[0]; + private static final String __OBFID = "CL_00001306"; + private int maxLen = 0; + private Semaphore deflateGate; + + public S26PacketMapChunkBulk() {} + + public S26PacketMapChunkBulk(List p_i45197_1_) + { + int i = p_i45197_1_.size(); + this.field_149266_a = new int[i]; + this.field_149264_b = new int[i]; + this.field_149265_c = new int[i]; + this.field_149262_d = new int[i]; + this.field_149260_f = new byte[i][]; + this.field_149267_h = !p_i45197_1_.isEmpty() && !((Chunk)p_i45197_1_.get(0)).worldObj.provider.hasNoSky; + int j = 0; + + for (int k = 0; k < i; ++k) + { + Chunk chunk = (Chunk)p_i45197_1_.get(k); + S21PacketChunkData.Extracted extracted = S21PacketChunkData.func_149269_a(chunk, true, 65535); + j += extracted.field_150282_a.length; + this.field_149266_a[k] = chunk.xPosition; + this.field_149264_b[k] = chunk.zPosition; + this.field_149265_c[k] = extracted.field_150280_b; + this.field_149262_d[k] = extracted.field_150281_c; + this.field_149260_f[k] = extracted.field_150282_a; + } + this.deflateGate = new Semaphore(1); + maxLen = j; + } + + private void deflate() + { + byte[] data = new byte[maxLen]; + int offset = 0; + for (int x = 0; x < field_149260_f.length; x++) + { + System.arraycopy(field_149260_f[x], 0, data, offset, field_149260_f[x].length); + offset += field_149260_f[x].length; + } + Deflater deflater = new Deflater(-1); + + try + { + deflater.setInput(data, 0, data.length); + deflater.finish(); + byte[] deflated = new byte[data.length]; + this.field_149261_g = deflater.deflate(deflated); + this.field_149263_e = deflated; + } + finally + { + deflater.end(); + } + } + + public static int func_149258_c() + { + return 5; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + short short1 = data.readShort(); + this.field_149261_g = data.readInt(); + this.field_149267_h = data.readBoolean(); + this.field_149266_a = new int[short1]; + this.field_149264_b = new int[short1]; + this.field_149265_c = new int[short1]; + this.field_149262_d = new int[short1]; + this.field_149260_f = new byte[short1][]; + + if (field_149268_i.length < this.field_149261_g) + { + field_149268_i = new byte[this.field_149261_g]; + } + + data.readBytes(field_149268_i, 0, this.field_149261_g); + byte[] abyte = new byte[S21PacketChunkData.func_149275_c() * short1]; + Inflater inflater = new Inflater(); + inflater.setInput(field_149268_i, 0, this.field_149261_g); + + try + { + inflater.inflate(abyte); + } + catch (DataFormatException dataformatexception) + { + throw new IOException("Bad compressed data format"); + } + finally + { + inflater.end(); + } + + int i = 0; + + for (int j = 0; j < short1; ++j) + { + this.field_149266_a[j] = data.readInt(); + this.field_149264_b[j] = data.readInt(); + this.field_149265_c[j] = data.readShort(); + this.field_149262_d[j] = data.readShort(); + int k = 0; + int l = 0; + int i1; + + for (i1 = 0; i1 < 16; ++i1) + { + k += this.field_149265_c[j] >> i1 & 1; + l += this.field_149262_d[j] >> i1 & 1; + } + + i1 = 2048 * 4 * k + 256; + i1 += 2048 * l; + + if (this.field_149267_h) + { + i1 += 2048 * k; + } + + this.field_149260_f[j] = new byte[i1]; + System.arraycopy(abyte, i, this.field_149260_f[j], 0, i1); + i += i1; + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + if (this.field_149263_e == null) + { + deflateGate.acquireUninterruptibly(); + if (this.field_149263_e == null) + { + deflate(); + } + deflateGate.release(); + } + + data.writeShort(this.field_149266_a.length); + data.writeInt(this.field_149261_g); + data.writeBoolean(this.field_149267_h); + data.writeBytes(this.field_149263_e, 0, this.field_149261_g); + + for (int i = 0; i < this.field_149266_a.length; ++i) + { + data.writeInt(this.field_149266_a[i]); + data.writeInt(this.field_149264_b[i]); + data.writeShort((short)(this.field_149265_c[i] & 65535)); + data.writeShort((short)(this.field_149262_d[i] & 65535)); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMapChunkBulk(this); + } + + @SideOnly(Side.CLIENT) + public int func_149255_a(int p_149255_1_) + { + return this.field_149266_a[p_149255_1_]; + } + + @SideOnly(Side.CLIENT) + public int func_149253_b(int p_149253_1_) + { + return this.field_149264_b[p_149253_1_]; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + StringBuilder stringbuilder = new StringBuilder(); + + for (int i = 0; i < this.field_149266_a.length; ++i) + { + if (i > 0) + { + stringbuilder.append(", "); + } + + stringbuilder.append(String.format("{x=%d, z=%d, sections=%d, adds=%d, data=%d}", new Object[] {Integer.valueOf(this.field_149266_a[i]), Integer.valueOf(this.field_149264_b[i]), Integer.valueOf(this.field_149265_c[i]), Integer.valueOf(this.field_149262_d[i]), Integer.valueOf(this.field_149260_f[i].length)})); + } + + return String.format("size=%d, chunks=%d[%s]", new Object[] {Integer.valueOf(this.field_149261_g), Integer.valueOf(this.field_149266_a.length), stringbuilder}); + } + + @SideOnly(Side.CLIENT) + public int func_149254_d() + { + return this.field_149266_a.length; + } + + @SideOnly(Side.CLIENT) + public byte[] func_149256_c(int p_149256_1_) + { + return this.field_149260_f[p_149256_1_]; + } + + @SideOnly(Side.CLIENT) + public int[] func_149252_e() + { + return this.field_149265_c; + } + + @SideOnly(Side.CLIENT) + public int[] func_149257_f() + { + return this.field_149262_d; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S27PacketExplosion.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S27PacketExplosion.java new file mode 100644 index 0000000..543628b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S27PacketExplosion.java @@ -0,0 +1,168 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkPosition; + +public class S27PacketExplosion extends Packet +{ + private double field_149158_a; + private double field_149156_b; + private double field_149157_c; + private float field_149154_d; + private List field_149155_e; + private float field_149152_f; + private float field_149153_g; + private float field_149159_h; + private static final String __OBFID = "CL_00001300"; + + public S27PacketExplosion() {} + + public S27PacketExplosion(double p_i45193_1_, double p_i45193_3_, double p_i45193_5_, float p_i45193_7_, List p_i45193_8_, Vec3 p_i45193_9_) + { + this.field_149158_a = p_i45193_1_; + this.field_149156_b = p_i45193_3_; + this.field_149157_c = p_i45193_5_; + this.field_149154_d = p_i45193_7_; + this.field_149155_e = new ArrayList(p_i45193_8_); + + if (p_i45193_9_ != null) + { + this.field_149152_f = (float)p_i45193_9_.xCoord; + this.field_149153_g = (float)p_i45193_9_.yCoord; + this.field_149159_h = (float)p_i45193_9_.zCoord; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149158_a = (double)data.readFloat(); + this.field_149156_b = (double)data.readFloat(); + this.field_149157_c = (double)data.readFloat(); + this.field_149154_d = data.readFloat(); + int i = data.readInt(); + this.field_149155_e = new ArrayList(i); + int j = (int)this.field_149158_a; + int k = (int)this.field_149156_b; + int l = (int)this.field_149157_c; + + for (int i1 = 0; i1 < i; ++i1) + { + int j1 = data.readByte() + j; + int k1 = data.readByte() + k; + int l1 = data.readByte() + l; + this.field_149155_e.add(new ChunkPosition(j1, k1, l1)); + } + + this.field_149152_f = data.readFloat(); + this.field_149153_g = data.readFloat(); + this.field_149159_h = data.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeFloat((float)this.field_149158_a); + data.writeFloat((float)this.field_149156_b); + data.writeFloat((float)this.field_149157_c); + data.writeFloat(this.field_149154_d); + data.writeInt(this.field_149155_e.size()); + int i = (int)this.field_149158_a; + int j = (int)this.field_149156_b; + int k = (int)this.field_149157_c; + Iterator iterator = this.field_149155_e.iterator(); + + while (iterator.hasNext()) + { + ChunkPosition chunkposition = (ChunkPosition)iterator.next(); + int l = chunkposition.chunkPosX - i; + int i1 = chunkposition.chunkPosY - j; + int j1 = chunkposition.chunkPosZ - k; + data.writeByte(l); + data.writeByte(i1); + data.writeByte(j1); + } + + data.writeFloat(this.field_149152_f); + data.writeFloat(this.field_149153_g); + data.writeFloat(this.field_149159_h); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleExplosion(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public float func_149149_c() + { + return this.field_149152_f; + } + + @SideOnly(Side.CLIENT) + public float func_149144_d() + { + return this.field_149153_g; + } + + @SideOnly(Side.CLIENT) + public float func_149147_e() + { + return this.field_149159_h; + } + + @SideOnly(Side.CLIENT) + public double func_149148_f() + { + return this.field_149158_a; + } + + @SideOnly(Side.CLIENT) + public double func_149143_g() + { + return this.field_149156_b; + } + + @SideOnly(Side.CLIENT) + public double func_149145_h() + { + return this.field_149157_c; + } + + @SideOnly(Side.CLIENT) + public float func_149146_i() + { + return this.field_149154_d; + } + + @SideOnly(Side.CLIENT) + public List func_149150_j() + { + return this.field_149155_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S28PacketEffect.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S28PacketEffect.java new file mode 100644 index 0000000..84753b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S28PacketEffect.java @@ -0,0 +1,110 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S28PacketEffect extends Packet +{ + private int field_149251_a; + private int field_149249_b; + private int field_149250_c; + private int field_149247_d; + private int field_149248_e; + private boolean field_149246_f; + private static final String __OBFID = "CL_00001307"; + + public S28PacketEffect() {} + + public S28PacketEffect(int p_i45198_1_, int p_i45198_2_, int p_i45198_3_, int p_i45198_4_, int p_i45198_5_, boolean p_i45198_6_) + { + this.field_149251_a = p_i45198_1_; + this.field_149250_c = p_i45198_2_; + this.field_149247_d = p_i45198_3_; + this.field_149248_e = p_i45198_4_; + this.field_149249_b = p_i45198_5_; + this.field_149246_f = p_i45198_6_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149251_a = data.readInt(); + this.field_149250_c = data.readInt(); + this.field_149247_d = data.readByte() & 255; + this.field_149248_e = data.readInt(); + this.field_149249_b = data.readInt(); + this.field_149246_f = data.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149251_a); + data.writeInt(this.field_149250_c); + data.writeByte(this.field_149247_d & 255); + data.writeInt(this.field_149248_e); + data.writeInt(this.field_149249_b); + data.writeBoolean(this.field_149246_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleEffect(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public boolean func_149244_c() + { + return this.field_149246_f; + } + + @SideOnly(Side.CLIENT) + public int func_149242_d() + { + return this.field_149251_a; + } + + @SideOnly(Side.CLIENT) + public int func_149241_e() + { + return this.field_149249_b; + } + + @SideOnly(Side.CLIENT) + public int func_149240_f() + { + return this.field_149250_c; + } + + @SideOnly(Side.CLIENT) + public int func_149243_g() + { + return this.field_149247_d; + } + + @SideOnly(Side.CLIENT) + public int func_149239_h() + { + return this.field_149248_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S29PacketSoundEffect.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S29PacketSoundEffect.java new file mode 100644 index 0000000..3c218c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S29PacketSoundEffect.java @@ -0,0 +1,122 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import org.apache.commons.lang3.Validate; + +public class S29PacketSoundEffect extends Packet +{ + private String field_149219_a; + private int field_149217_b; + private int field_149218_c = Integer.MAX_VALUE; + private int field_149215_d; + private float field_149216_e; + private int field_149214_f; + private static final String __OBFID = "CL_00001309"; + + public S29PacketSoundEffect() {} + + public S29PacketSoundEffect(String p_i45200_1_, double p_i45200_2_, double p_i45200_4_, double p_i45200_6_, float p_i45200_8_, float p_i45200_9_) + { + Validate.notNull(p_i45200_1_, "name", new Object[0]); + this.field_149219_a = p_i45200_1_; + this.field_149217_b = (int)(p_i45200_2_ * 8.0D); + this.field_149218_c = (int)(p_i45200_4_ * 8.0D); + this.field_149215_d = (int)(p_i45200_6_ * 8.0D); + this.field_149216_e = p_i45200_8_; + this.field_149214_f = (int)(p_i45200_9_ * 63.0F); + + if (this.field_149214_f < 0) + { + this.field_149214_f = 0; + } + + if (this.field_149214_f > 255) + { + this.field_149214_f = 255; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149219_a = data.readStringFromBuffer(256); + this.field_149217_b = data.readInt(); + this.field_149218_c = data.readInt(); + this.field_149215_d = data.readInt(); + this.field_149216_e = data.readFloat(); + this.field_149214_f = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149219_a); + data.writeInt(this.field_149217_b); + data.writeInt(this.field_149218_c); + data.writeInt(this.field_149215_d); + data.writeFloat(this.field_149216_e); + data.writeByte(this.field_149214_f); + } + + @SideOnly(Side.CLIENT) + public String func_149212_c() + { + return this.field_149219_a; + } + + @SideOnly(Side.CLIENT) + public double func_149207_d() + { + return (double)((float)this.field_149217_b / 8.0F); + } + + @SideOnly(Side.CLIENT) + public double func_149211_e() + { + return (double)((float)this.field_149218_c / 8.0F); + } + + @SideOnly(Side.CLIENT) + public double func_149210_f() + { + return (double)((float)this.field_149215_d / 8.0F); + } + + @SideOnly(Side.CLIENT) + public float func_149208_g() + { + return this.field_149216_e; + } + + @SideOnly(Side.CLIENT) + public float func_149209_h() + { + return (float)this.field_149214_f / 63.0F; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSoundEffect(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2APacketParticles.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2APacketParticles.java new file mode 100644 index 0000000..a763ac6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2APacketParticles.java @@ -0,0 +1,140 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2APacketParticles extends Packet +{ + private String field_149236_a; + private float field_149234_b; + private float field_149235_c; + private float field_149232_d; + private float field_149233_e; + private float field_149230_f; + private float field_149231_g; + private float field_149237_h; + private int field_149238_i; + private static final String __OBFID = "CL_00001308"; + + public S2APacketParticles() {} + + public S2APacketParticles(String p_i45199_1_, float p_i45199_2_, float p_i45199_3_, float p_i45199_4_, float p_i45199_5_, float p_i45199_6_, float p_i45199_7_, float p_i45199_8_, int p_i45199_9_) + { + this.field_149236_a = p_i45199_1_; + this.field_149234_b = p_i45199_2_; + this.field_149235_c = p_i45199_3_; + this.field_149232_d = p_i45199_4_; + this.field_149233_e = p_i45199_5_; + this.field_149230_f = p_i45199_6_; + this.field_149231_g = p_i45199_7_; + this.field_149237_h = p_i45199_8_; + this.field_149238_i = p_i45199_9_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149236_a = data.readStringFromBuffer(64); + this.field_149234_b = data.readFloat(); + this.field_149235_c = data.readFloat(); + this.field_149232_d = data.readFloat(); + this.field_149233_e = data.readFloat(); + this.field_149230_f = data.readFloat(); + this.field_149231_g = data.readFloat(); + this.field_149237_h = data.readFloat(); + this.field_149238_i = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149236_a); + data.writeFloat(this.field_149234_b); + data.writeFloat(this.field_149235_c); + data.writeFloat(this.field_149232_d); + data.writeFloat(this.field_149233_e); + data.writeFloat(this.field_149230_f); + data.writeFloat(this.field_149231_g); + data.writeFloat(this.field_149237_h); + data.writeInt(this.field_149238_i); + } + + @SideOnly(Side.CLIENT) + public String func_149228_c() + { + return this.field_149236_a; + } + + @SideOnly(Side.CLIENT) + public double func_149220_d() + { + return (double)this.field_149234_b; + } + + @SideOnly(Side.CLIENT) + public double func_149226_e() + { + return (double)this.field_149235_c; + } + + @SideOnly(Side.CLIENT) + public double func_149225_f() + { + return (double)this.field_149232_d; + } + + @SideOnly(Side.CLIENT) + public float func_149221_g() + { + return this.field_149233_e; + } + + @SideOnly(Side.CLIENT) + public float func_149224_h() + { + return this.field_149230_f; + } + + @SideOnly(Side.CLIENT) + public float func_149223_i() + { + return this.field_149231_g; + } + + @SideOnly(Side.CLIENT) + public float func_149227_j() + { + return this.field_149237_h; + } + + @SideOnly(Side.CLIENT) + public int func_149222_k() + { + return this.field_149238_i; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleParticles(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java new file mode 100644 index 0000000..f1e7e81 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2BPacketChangeGameState.java @@ -0,0 +1,71 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2BPacketChangeGameState extends Packet +{ + public static final String[] field_149142_a = new String[] {"tile.bed.notValid", null, null, "gameMode.changed"}; + private int field_149140_b; + private float field_149141_c; + private static final String __OBFID = "CL_00001301"; + + public S2BPacketChangeGameState() {} + + public S2BPacketChangeGameState(int stateIn, float p_i45194_2_) + { + this.field_149140_b = stateIn; + this.field_149141_c = p_i45194_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149140_b = data.readUnsignedByte(); + this.field_149141_c = data.readFloat(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149140_b); + data.writeFloat(this.field_149141_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleChangeGameState(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149138_c() + { + return this.field_149140_b; + } + + @SideOnly(Side.CLIENT) + public float func_149137_d() + { + return this.field_149141_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java new file mode 100644 index 0000000..6e0f537 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java @@ -0,0 +1,115 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.MathHelper; + +public class S2CPacketSpawnGlobalEntity extends Packet +{ + private int field_149059_a; + private int field_149057_b; + private int field_149058_c; + private int field_149055_d; + private int field_149056_e; + private static final String __OBFID = "CL_00001278"; + + public S2CPacketSpawnGlobalEntity() {} + + public S2CPacketSpawnGlobalEntity(Entity p_i45191_1_) + { + this.field_149059_a = p_i45191_1_.getEntityId(); + this.field_149057_b = MathHelper.floor_double(p_i45191_1_.posX * 32.0D); + this.field_149058_c = MathHelper.floor_double(p_i45191_1_.posY * 32.0D); + this.field_149055_d = MathHelper.floor_double(p_i45191_1_.posZ * 32.0D); + + if (p_i45191_1_ instanceof EntityLightningBolt) + { + this.field_149056_e = 1; + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149059_a = data.readVarIntFromBuffer(); + this.field_149056_e = data.readByte(); + this.field_149057_b = data.readInt(); + this.field_149058_c = data.readInt(); + this.field_149055_d = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149059_a); + data.writeByte(this.field_149056_e); + data.writeInt(this.field_149057_b); + data.writeInt(this.field_149058_c); + data.writeInt(this.field_149055_d); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSpawnGlobalEntity(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, type=%d, x=%.2f, y=%.2f, z=%.2f", new Object[] {Integer.valueOf(this.field_149059_a), Integer.valueOf(this.field_149056_e), Float.valueOf((float)this.field_149057_b / 32.0F), Float.valueOf((float)this.field_149058_c / 32.0F), Float.valueOf((float)this.field_149055_d / 32.0F)}); + } + + @SideOnly(Side.CLIENT) + public int func_149052_c() + { + return this.field_149059_a; + } + + @SideOnly(Side.CLIENT) + public int func_149051_d() + { + return this.field_149057_b; + } + + @SideOnly(Side.CLIENT) + public int func_149050_e() + { + return this.field_149058_c; + } + + @SideOnly(Side.CLIENT) + public int func_149049_f() + { + return this.field_149055_d; + } + + @SideOnly(Side.CLIENT) + public int func_149053_g() + { + return this.field_149056_e; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java new file mode 100644 index 0000000..a92cadc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2DPacketOpenWindow.java @@ -0,0 +1,123 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2DPacketOpenWindow extends Packet +{ + private int field_148909_a; + private int field_148907_b; + private String field_148908_c; + private int field_148905_d; + private boolean field_148906_e; + private int field_148904_f; + private static final String __OBFID = "CL_00001293"; + + public S2DPacketOpenWindow() {} + + public S2DPacketOpenWindow(int p_i45184_1_, int p_i45184_2_, String p_i45184_3_, int p_i45184_4_, boolean p_i45184_5_) + { + this.field_148909_a = p_i45184_1_; + this.field_148907_b = p_i45184_2_; + this.field_148908_c = p_i45184_3_; + this.field_148905_d = p_i45184_4_; + this.field_148906_e = p_i45184_5_; + } + + public S2DPacketOpenWindow(int p_i45185_1_, int p_i45185_2_, String p_i45185_3_, int p_i45185_4_, boolean p_i45185_5_, int p_i45185_6_) + { + this(p_i45185_1_, p_i45185_2_, p_i45185_3_, p_i45185_4_, p_i45185_5_); + this.field_148904_f = p_i45185_6_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleOpenWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148909_a = data.readUnsignedByte(); + this.field_148907_b = data.readUnsignedByte(); + this.field_148908_c = data.readStringFromBuffer(32); + this.field_148905_d = data.readUnsignedByte(); + this.field_148906_e = data.readBoolean(); + + if (this.field_148907_b == 11) + { + this.field_148904_f = data.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_148909_a); + data.writeByte(this.field_148907_b); + data.writeStringToBuffer(this.field_148908_c); + data.writeByte(this.field_148905_d); + data.writeBoolean(this.field_148906_e); + + if (this.field_148907_b == 11) + { + data.writeInt(this.field_148904_f); + } + } + + @SideOnly(Side.CLIENT) + public int func_148901_c() + { + return this.field_148909_a; + } + + @SideOnly(Side.CLIENT) + public int func_148899_d() + { + return this.field_148907_b; + } + + @SideOnly(Side.CLIENT) + public String func_148902_e() + { + return this.field_148908_c; + } + + @SideOnly(Side.CLIENT) + public int func_148898_f() + { + return this.field_148905_d; + } + + @SideOnly(Side.CLIENT) + public boolean func_148900_g() + { + return this.field_148906_e; + } + + @SideOnly(Side.CLIENT) + public int func_148897_h() + { + return this.field_148904_f; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java new file mode 100644 index 0000000..5660cbc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2EPacketCloseWindow.java @@ -0,0 +1,52 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2EPacketCloseWindow extends Packet +{ + private int field_148896_a; + private static final String __OBFID = "CL_00001292"; + + public S2EPacketCloseWindow() {} + + public S2EPacketCloseWindow(int p_i45183_1_) + { + this.field_148896_a = p_i45183_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCloseWindow(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148896_a = data.readUnsignedByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_148896_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2FPacketSetSlot.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2FPacketSetSlot.java new file mode 100644 index 0000000..4cbe2bb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S2FPacketSetSlot.java @@ -0,0 +1,81 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S2FPacketSetSlot extends Packet +{ + private int field_149179_a; + private int field_149177_b; + private ItemStack field_149178_c; + private static final String __OBFID = "CL_00001296"; + + public S2FPacketSetSlot() {} + + public S2FPacketSetSlot(int p_i45188_1_, int p_i45188_2_, ItemStack p_i45188_3_) + { + this.field_149179_a = p_i45188_1_; + this.field_149177_b = p_i45188_2_; + this.field_149178_c = p_i45188_3_ == null ? null : p_i45188_3_.copy(); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSetSlot(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149179_a = data.readByte(); + this.field_149177_b = data.readShort(); + this.field_149178_c = data.readItemStackFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149179_a); + data.writeShort(this.field_149177_b); + data.writeItemStackToBuffer(this.field_149178_c); + } + + @SideOnly(Side.CLIENT) + public int func_149175_c() + { + return this.field_149179_a; + } + + @SideOnly(Side.CLIENT) + public int func_149173_d() + { + return this.field_149177_b; + } + + @SideOnly(Side.CLIENT) + public ItemStack func_149174_e() + { + return this.field_149178_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S30PacketWindowItems.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S30PacketWindowItems.java new file mode 100644 index 0000000..11a5564 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S30PacketWindowItems.java @@ -0,0 +1,92 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S30PacketWindowItems extends Packet +{ + private int field_148914_a; + private ItemStack[] field_148913_b; + private static final String __OBFID = "CL_00001294"; + + public S30PacketWindowItems() {} + + public S30PacketWindowItems(int p_i45186_1_, List p_i45186_2_) + { + this.field_148914_a = p_i45186_1_; + this.field_148913_b = new ItemStack[p_i45186_2_.size()]; + + for (int j = 0; j < this.field_148913_b.length; ++j) + { + ItemStack itemstack = (ItemStack)p_i45186_2_.get(j); + this.field_148913_b[j] = itemstack == null ? null : itemstack.copy(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148914_a = data.readUnsignedByte(); + short short1 = data.readShort(); + this.field_148913_b = new ItemStack[short1]; + + for (int i = 0; i < short1; ++i) + { + this.field_148913_b[i] = data.readItemStackFromBuffer(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_148914_a); + data.writeShort(this.field_148913_b.length); + ItemStack[] aitemstack = this.field_148913_b; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = aitemstack[j]; + data.writeItemStackToBuffer(itemstack); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleWindowItems(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_148911_c() + { + return this.field_148914_a; + } + + @SideOnly(Side.CLIENT) + public ItemStack[] func_148910_d() + { + return this.field_148913_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S31PacketWindowProperty.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S31PacketWindowProperty.java new file mode 100644 index 0000000..9cabbd4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S31PacketWindowProperty.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S31PacketWindowProperty extends Packet +{ + private int field_149186_a; + private int field_149184_b; + private int field_149185_c; + private static final String __OBFID = "CL_00001295"; + + public S31PacketWindowProperty() {} + + public S31PacketWindowProperty(int p_i45187_1_, int p_i45187_2_, int p_i45187_3_) + { + this.field_149186_a = p_i45187_1_; + this.field_149184_b = p_i45187_2_; + this.field_149185_c = p_i45187_3_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleWindowProperty(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149186_a = data.readUnsignedByte(); + this.field_149184_b = data.readShort(); + this.field_149185_c = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149186_a); + data.writeShort(this.field_149184_b); + data.writeShort(this.field_149185_c); + } + + @SideOnly(Side.CLIENT) + public int func_149182_c() + { + return this.field_149186_a; + } + + @SideOnly(Side.CLIENT) + public int func_149181_d() + { + return this.field_149184_b; + } + + @SideOnly(Side.CLIENT) + public int func_149180_e() + { + return this.field_149185_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java new file mode 100644 index 0000000..1e61c21 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S32PacketConfirmTransaction.java @@ -0,0 +1,88 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S32PacketConfirmTransaction extends Packet +{ + private int field_148894_a; + private short field_148892_b; + private boolean field_148893_c; + private static final String __OBFID = "CL_00001291"; + + public S32PacketConfirmTransaction() {} + + public S32PacketConfirmTransaction(int p_i45182_1_, short p_i45182_2_, boolean p_i45182_3_) + { + this.field_148894_a = p_i45182_1_; + this.field_148892_b = p_i45182_2_; + this.field_148893_c = p_i45182_3_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleConfirmTransaction(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148894_a = data.readUnsignedByte(); + this.field_148892_b = data.readShort(); + this.field_148893_c = data.readBoolean(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_148894_a); + data.writeShort(this.field_148892_b); + data.writeBoolean(this.field_148893_c); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, uid=%d, accepted=%b", new Object[] {Integer.valueOf(this.field_148894_a), Short.valueOf(this.field_148892_b), Boolean.valueOf(this.field_148893_c)}); + } + + @SideOnly(Side.CLIENT) + public int func_148889_c() + { + return this.field_148894_a; + } + + @SideOnly(Side.CLIENT) + public short func_148890_d() + { + return this.field_148892_b; + } + + @SideOnly(Side.CLIENT) + public boolean func_148888_e() + { + return this.field_148893_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S33PacketUpdateSign.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S33PacketUpdateSign.java new file mode 100644 index 0000000..c5b64c3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S33PacketUpdateSign.java @@ -0,0 +1,99 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S33PacketUpdateSign extends Packet +{ + private int field_149352_a; + private int field_149350_b; + private int field_149351_c; + private String[] field_149349_d; + private static final String __OBFID = "CL_00001338"; + + public S33PacketUpdateSign() {} + + public S33PacketUpdateSign(int p_i45231_1_, int p_i45231_2_, int p_i45231_3_, String[] p_i45231_4_) + { + this.field_149352_a = p_i45231_1_; + this.field_149350_b = p_i45231_2_; + this.field_149351_c = p_i45231_3_; + this.field_149349_d = new String[] {p_i45231_4_[0], p_i45231_4_[1], p_i45231_4_[2], p_i45231_4_[3]}; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149352_a = data.readInt(); + this.field_149350_b = data.readShort(); + this.field_149351_c = data.readInt(); + this.field_149349_d = new String[4]; + + for (int i = 0; i < 4; ++i) + { + this.field_149349_d[i] = data.readStringFromBuffer(15); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149352_a); + data.writeShort(this.field_149350_b); + data.writeInt(this.field_149351_c); + + for (int i = 0; i < 4; ++i) + { + data.writeStringToBuffer(this.field_149349_d[i]); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateSign(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149346_c() + { + return this.field_149352_a; + } + + @SideOnly(Side.CLIENT) + public int func_149345_d() + { + return this.field_149350_b; + } + + @SideOnly(Side.CLIENT) + public int func_149344_e() + { + return this.field_149351_c; + } + + @SideOnly(Side.CLIENT) + public String[] func_149347_f() + { + return this.field_149349_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S34PacketMaps.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S34PacketMaps.java new file mode 100644 index 0000000..83caf59 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S34PacketMaps.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S34PacketMaps extends Packet +{ + private int field_149191_a; + private byte[] field_149190_b; + private static final String __OBFID = "CL_00001311"; + + public S34PacketMaps() {} + + public S34PacketMaps(int p_i45202_1_, byte[] p_i45202_2_) + { + this.field_149191_a = p_i45202_1_; + this.field_149190_b = p_i45202_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149191_a = data.readVarIntFromBuffer(); + this.field_149190_b = new byte[data.readUnsignedShort()]; + data.readBytes(this.field_149190_b); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149191_a); + data.writeShort(this.field_149190_b.length); + data.writeBytes(this.field_149190_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleMaps(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("id=%d, length=%d", new Object[] {Integer.valueOf(this.field_149191_a), Integer.valueOf(this.field_149190_b.length)}); + } + + @SideOnly(Side.CLIENT) + public int func_149188_c() + { + return this.field_149191_a; + } + + @SideOnly(Side.CLIENT) + public byte[] func_149187_d() + { + return this.field_149190_b; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java new file mode 100644 index 0000000..ce275ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S35PacketUpdateTileEntity.java @@ -0,0 +1,101 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S35PacketUpdateTileEntity extends Packet +{ + private int field_148863_a; + private int field_148861_b; + private int field_148862_c; + private int field_148859_d; + private NBTTagCompound field_148860_e; + private static final String __OBFID = "CL_00001285"; + + public S35PacketUpdateTileEntity() {} + + public S35PacketUpdateTileEntity(int xcoord, int ycoord, int zcoord, int meta, NBTTagCompound nbtTag) + { + this.field_148863_a = xcoord; + this.field_148861_b = ycoord; + this.field_148862_c = zcoord; + this.field_148859_d = meta; + this.field_148860_e = nbtTag; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_148863_a = data.readInt(); + this.field_148861_b = data.readShort(); + this.field_148862_c = data.readInt(); + this.field_148859_d = data.readUnsignedByte(); + this.field_148860_e = data.readNBTTagCompoundFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_148863_a); + data.writeShort(this.field_148861_b); + data.writeInt(this.field_148862_c); + data.writeByte((byte)this.field_148859_d); + data.writeNBTTagCompoundToBuffer(this.field_148860_e); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateTileEntity(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_148856_c() + { + return this.field_148863_a; + } + + @SideOnly(Side.CLIENT) + public int func_148855_d() + { + return this.field_148861_b; + } + + @SideOnly(Side.CLIENT) + public int func_148854_e() + { + return this.field_148862_c; + } + + @SideOnly(Side.CLIENT) + public int func_148853_f() + { + return this.field_148859_d; + } + + @SideOnly(Side.CLIENT) + public NBTTagCompound func_148857_g() + { + return this.field_148860_e; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java new file mode 100644 index 0000000..1299aa7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S36PacketSignEditorOpen.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S36PacketSignEditorOpen extends Packet +{ + private int field_149133_a; + private int field_149131_b; + private int field_149132_c; + private static final String __OBFID = "CL_00001316"; + + public S36PacketSignEditorOpen() {} + + public S36PacketSignEditorOpen(int p_i45207_1_, int p_i45207_2_, int p_i45207_3_) + { + this.field_149133_a = p_i45207_1_; + this.field_149131_b = p_i45207_2_; + this.field_149132_c = p_i45207_3_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleSignEditorOpen(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149133_a = data.readInt(); + this.field_149131_b = data.readInt(); + this.field_149132_c = data.readInt(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeInt(this.field_149133_a); + data.writeInt(this.field_149131_b); + data.writeInt(this.field_149132_c); + } + + @SideOnly(Side.CLIENT) + public int func_149129_c() + { + return this.field_149133_a; + } + + @SideOnly(Side.CLIENT) + public int func_149128_d() + { + return this.field_149131_b; + } + + @SideOnly(Side.CLIENT) + public int func_149127_e() + { + return this.field_149132_c; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S37PacketStatistics.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S37PacketStatistics.java new file mode 100644 index 0000000..26bc158 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S37PacketStatistics.java @@ -0,0 +1,94 @@ +package net.minecraft.network.play.server; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; + +public class S37PacketStatistics extends Packet +{ + private Map field_148976_a; + private static final String __OBFID = "CL_00001283"; + + public S37PacketStatistics() {} + + public S37PacketStatistics(Map p_i45173_1_) + { + this.field_148976_a = p_i45173_1_; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleStatistics(this); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + int i = data.readVarIntFromBuffer(); + this.field_148976_a = Maps.newHashMap(); + + for (int j = 0; j < i; ++j) + { + StatBase statbase = StatList.func_151177_a(data.readStringFromBuffer(32767)); + int k = data.readVarIntFromBuffer(); + + if (statbase != null) + { + this.field_148976_a.put(statbase, Integer.valueOf(k)); + } + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_148976_a.size()); + Iterator iterator = this.field_148976_a.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + data.writeStringToBuffer(((StatBase)entry.getKey()).statId); + data.writeVarIntToBuffer(((Integer)entry.getValue()).intValue()); + } + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("count=%d", new Object[] {Integer.valueOf(this.field_148976_a.size())}); + } + + @SideOnly(Side.CLIENT) + public Map func_148974_c() + { + return this.field_148976_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java new file mode 100644 index 0000000..8d012d8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S38PacketPlayerListItem.java @@ -0,0 +1,80 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S38PacketPlayerListItem extends Packet +{ + private String field_149126_a; + private boolean field_149124_b; + private int field_149125_c; + private static final String __OBFID = "CL_00001318"; + + public S38PacketPlayerListItem() {} + + public S38PacketPlayerListItem(String p_i45209_1_, boolean p_i45209_2_, int p_i45209_3_) + { + this.field_149126_a = p_i45209_1_; + this.field_149124_b = p_i45209_2_; + this.field_149125_c = p_i45209_3_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149126_a = data.readStringFromBuffer(16); + this.field_149124_b = data.readBoolean(); + this.field_149125_c = data.readShort(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149126_a); + data.writeBoolean(this.field_149124_b); + data.writeShort(this.field_149125_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerListItem(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149122_c() + { + return this.field_149126_a; + } + + @SideOnly(Side.CLIENT) + public boolean func_149121_d() + { + return this.field_149124_b; + } + + @SideOnly(Side.CLIENT) + public int func_149120_e() + { + return this.field_149125_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java new file mode 100644 index 0000000..b8dfb6b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S39PacketPlayerAbilities.java @@ -0,0 +1,161 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S39PacketPlayerAbilities extends Packet +{ + private boolean field_149119_a; + private boolean field_149117_b; + private boolean field_149118_c; + private boolean field_149115_d; + private float field_149116_e; + private float field_149114_f; + private static final String __OBFID = "CL_00001317"; + + public S39PacketPlayerAbilities() {} + + public S39PacketPlayerAbilities(PlayerCapabilities capabilities) + { + this.func_149108_a(capabilities.disableDamage); + this.func_149102_b(capabilities.isFlying); + this.func_149109_c(capabilities.allowFlying); + this.func_149111_d(capabilities.isCreativeMode); + this.func_149104_a(capabilities.getFlySpeed()); + this.func_149110_b(capabilities.getWalkSpeed()); + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + byte b0 = data.readByte(); + this.func_149108_a((b0 & 1) > 0); + this.func_149102_b((b0 & 2) > 0); + this.func_149109_c((b0 & 4) > 0); + this.func_149111_d((b0 & 8) > 0); + this.func_149104_a(data.readFloat()); + this.func_149110_b(data.readFloat()); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + byte b0 = 0; + + if (this.func_149112_c()) + { + b0 = (byte)(b0 | 1); + } + + if (this.func_149106_d()) + { + b0 = (byte)(b0 | 2); + } + + if (this.func_149105_e()) + { + b0 = (byte)(b0 | 4); + } + + if (this.func_149103_f()) + { + b0 = (byte)(b0 | 8); + } + + data.writeByte(b0); + data.writeFloat(this.field_149116_e); + data.writeFloat(this.field_149114_f); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handlePlayerAbilities(this); + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("invuln=%b, flying=%b, canfly=%b, instabuild=%b, flyspeed=%.4f, walkspped=%.4f", new Object[] {Boolean.valueOf(this.func_149112_c()), Boolean.valueOf(this.func_149106_d()), Boolean.valueOf(this.func_149105_e()), Boolean.valueOf(this.func_149103_f()), Float.valueOf(this.func_149101_g()), Float.valueOf(this.func_149107_h())}); + } + + public boolean func_149112_c() + { + return this.field_149119_a; + } + + public void func_149108_a(boolean isInvulnerable) + { + this.field_149119_a = isInvulnerable; + } + + public boolean func_149106_d() + { + return this.field_149117_b; + } + + public void func_149102_b(boolean isFlying) + { + this.field_149117_b = isFlying; + } + + public boolean func_149105_e() + { + return this.field_149118_c; + } + + public void func_149109_c(boolean isAllowFlying) + { + this.field_149118_c = isAllowFlying; + } + + public boolean func_149103_f() + { + return this.field_149115_d; + } + + public void func_149111_d(boolean isCreativeMode) + { + this.field_149115_d = isCreativeMode; + } + + public float func_149101_g() + { + return this.field_149116_e; + } + + public void func_149104_a(float flySpeedIn) + { + this.field_149116_e = flySpeedIn; + } + + public float func_149107_h() + { + return this.field_149114_f; + } + + public void func_149110_b(float walkSpeedIn) + { + this.field_149114_f = walkSpeedIn; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3APacketTabComplete.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3APacketTabComplete.java new file mode 100644 index 0000000..d47ac5e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3APacketTabComplete.java @@ -0,0 +1,82 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import org.apache.commons.lang3.ArrayUtils; + +public class S3APacketTabComplete extends Packet +{ + private String[] field_149632_a; + private static final String __OBFID = "CL_00001288"; + + public S3APacketTabComplete() {} + + public S3APacketTabComplete(String[] p_i45178_1_) + { + this.field_149632_a = p_i45178_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149632_a = new String[data.readVarIntFromBuffer()]; + + for (int i = 0; i < this.field_149632_a.length; ++i) + { + this.field_149632_a[i] = data.readStringFromBuffer(32767); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeVarIntToBuffer(this.field_149632_a.length); + String[] astring = this.field_149632_a; + int i = astring.length; + + for (int j = 0; j < i; ++j) + { + String s = astring[j]; + data.writeStringToBuffer(s); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTabComplete(this); + } + + @SideOnly(Side.CLIENT) + public String[] func_149630_c() + { + return this.field_149632_a; + } + + /** + * Returns a string formatted as comma separated [field]=[value] values. Used by Minecraft for logging purposes. + */ + public String serialize() + { + return String.format("candidates=\'%s\'", new Object[] {ArrayUtils.toString(this.field_149632_a)}); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java new file mode 100644 index 0000000..c420365 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3BPacketScoreboardObjective.java @@ -0,0 +1,81 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3BPacketScoreboardObjective extends Packet +{ + private String field_149343_a; + private String field_149341_b; + private int field_149342_c; + private static final String __OBFID = "CL_00001333"; + + public S3BPacketScoreboardObjective() {} + + public S3BPacketScoreboardObjective(ScoreObjective p_i45224_1_, int p_i45224_2_) + { + this.field_149343_a = p_i45224_1_.getName(); + this.field_149341_b = p_i45224_1_.getDisplayName(); + this.field_149342_c = p_i45224_2_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149343_a = data.readStringFromBuffer(16); + this.field_149341_b = data.readStringFromBuffer(32); + this.field_149342_c = data.readByte(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149343_a); + data.writeStringToBuffer(this.field_149341_b); + data.writeByte(this.field_149342_c); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleScoreboardObjective(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149339_c() + { + return this.field_149343_a; + } + + @SideOnly(Side.CLIENT) + public String func_149337_d() + { + return this.field_149341_b; + } + + @SideOnly(Side.CLIENT) + public int func_149338_e() + { + return this.field_149342_c; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java new file mode 100644 index 0000000..deb8e77 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3CPacketUpdateScore.java @@ -0,0 +1,107 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.Score; + +public class S3CPacketUpdateScore extends Packet +{ + private String field_149329_a = ""; + private String field_149327_b = ""; + private int field_149328_c; + private int field_149326_d; + private static final String __OBFID = "CL_00001335"; + + public S3CPacketUpdateScore() {} + + public S3CPacketUpdateScore(Score p_i45227_1_, int p_i45227_2_) + { + this.field_149329_a = p_i45227_1_.getPlayerName(); + this.field_149327_b = p_i45227_1_.func_96645_d().getName(); + this.field_149328_c = p_i45227_1_.getScorePoints(); + this.field_149326_d = p_i45227_2_; + } + + public S3CPacketUpdateScore(String p_i45228_1_) + { + this.field_149329_a = p_i45228_1_; + this.field_149327_b = ""; + this.field_149328_c = 0; + this.field_149326_d = 1; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149329_a = data.readStringFromBuffer(16); + this.field_149326_d = data.readByte(); + + if (this.field_149326_d != 1) + { + this.field_149327_b = data.readStringFromBuffer(16); + this.field_149328_c = data.readInt(); + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149329_a); + data.writeByte(this.field_149326_d); + + if (this.field_149326_d != 1) + { + data.writeStringToBuffer(this.field_149327_b); + data.writeInt(this.field_149328_c); + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleUpdateScore(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149324_c() + { + return this.field_149329_a; + } + + @SideOnly(Side.CLIENT) + public String func_149321_d() + { + return this.field_149327_b; + } + + @SideOnly(Side.CLIENT) + public int func_149323_e() + { + return this.field_149328_c; + } + + @SideOnly(Side.CLIENT) + public int func_149322_f() + { + return this.field_149326_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java new file mode 100644 index 0000000..7732976 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3DPacketDisplayScoreboard.java @@ -0,0 +1,79 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScoreObjective; + +public class S3DPacketDisplayScoreboard extends Packet +{ + private int field_149374_a; + private String field_149373_b; + private static final String __OBFID = "CL_00001325"; + + public S3DPacketDisplayScoreboard() {} + + public S3DPacketDisplayScoreboard(int p_i45216_1_, ScoreObjective p_i45216_2_) + { + this.field_149374_a = p_i45216_1_; + + if (p_i45216_2_ == null) + { + this.field_149373_b = ""; + } + else + { + this.field_149373_b = p_i45216_2_.getName(); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149374_a = data.readByte(); + this.field_149373_b = data.readStringFromBuffer(16); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeByte(this.field_149374_a); + data.writeStringToBuffer(this.field_149373_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDisplayScoreboard(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public int func_149371_c() + { + return this.field_149374_a; + } + + @SideOnly(Side.CLIENT) + public String func_149370_d() + { + return this.field_149373_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3EPacketTeams.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3EPacketTeams.java new file mode 100644 index 0000000..39e878e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3EPacketTeams.java @@ -0,0 +1,178 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.scoreboard.ScorePlayerTeam; + +public class S3EPacketTeams extends Packet +{ + private String field_149320_a = ""; + private String field_149318_b = ""; + private String field_149319_c = ""; + private String field_149316_d = ""; + private Collection field_149317_e = new ArrayList(); + private int field_149314_f; + private int field_149315_g; + private static final String __OBFID = "CL_00001334"; + + public S3EPacketTeams() {} + + public S3EPacketTeams(ScorePlayerTeam p_i45225_1_, int p_i45225_2_) + { + this.field_149320_a = p_i45225_1_.getRegisteredName(); + this.field_149314_f = p_i45225_2_; + + if (p_i45225_2_ == 0 || p_i45225_2_ == 2) + { + this.field_149318_b = p_i45225_1_.func_96669_c(); + this.field_149319_c = p_i45225_1_.getColorPrefix(); + this.field_149316_d = p_i45225_1_.getColorSuffix(); + this.field_149315_g = p_i45225_1_.func_98299_i(); + } + + if (p_i45225_2_ == 0) + { + this.field_149317_e.addAll(p_i45225_1_.getMembershipCollection()); + } + } + + public S3EPacketTeams(ScorePlayerTeam p_i45226_1_, Collection p_i45226_2_, int p_i45226_3_) + { + if (p_i45226_3_ != 3 && p_i45226_3_ != 4) + { + throw new IllegalArgumentException("Method must be join or leave for player constructor"); + } + else if (p_i45226_2_ != null && !p_i45226_2_.isEmpty()) + { + this.field_149314_f = p_i45226_3_; + this.field_149320_a = p_i45226_1_.getRegisteredName(); + this.field_149317_e.addAll(p_i45226_2_); + } + else + { + throw new IllegalArgumentException("Players cannot be null/empty"); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149320_a = data.readStringFromBuffer(16); + this.field_149314_f = data.readByte(); + + if (this.field_149314_f == 0 || this.field_149314_f == 2) + { + this.field_149318_b = data.readStringFromBuffer(32); + this.field_149319_c = data.readStringFromBuffer(16); + this.field_149316_d = data.readStringFromBuffer(16); + this.field_149315_g = data.readByte(); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) + { + short short1 = data.readShort(); + + for (int i = 0; i < short1; ++i) + { + this.field_149317_e.add(data.readStringFromBuffer(40)); + } + } + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149320_a); + data.writeByte(this.field_149314_f); + + if (this.field_149314_f == 0 || this.field_149314_f == 2) + { + data.writeStringToBuffer(this.field_149318_b); + data.writeStringToBuffer(this.field_149319_c); + data.writeStringToBuffer(this.field_149316_d); + data.writeByte(this.field_149315_g); + } + + if (this.field_149314_f == 0 || this.field_149314_f == 3 || this.field_149314_f == 4) + { + data.writeShort(this.field_149317_e.size()); + Iterator iterator = this.field_149317_e.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + data.writeStringToBuffer(s); + } + } + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleTeams(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149312_c() + { + return this.field_149320_a; + } + + @SideOnly(Side.CLIENT) + public String func_149306_d() + { + return this.field_149318_b; + } + + @SideOnly(Side.CLIENT) + public String func_149311_e() + { + return this.field_149319_c; + } + + @SideOnly(Side.CLIENT) + public String func_149309_f() + { + return this.field_149316_d; + } + + @SideOnly(Side.CLIENT) + public Collection func_149310_g() + { + return this.field_149317_e; + } + + @SideOnly(Side.CLIENT) + public int func_149307_h() + { + return this.field_149314_f; + } + + @SideOnly(Side.CLIENT) + public int func_149308_i() + { + return this.field_149315_g; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java new file mode 100644 index 0000000..aa3e5db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S3FPacketCustomPayload.java @@ -0,0 +1,84 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class S3FPacketCustomPayload extends Packet +{ + private String field_149172_a; + private byte[] field_149171_b; + private static final String __OBFID = "CL_00001297"; + + public S3FPacketCustomPayload() {} + + public S3FPacketCustomPayload(String channelName, ByteBuf dataIn) + { + this(channelName, dataIn.array()); + } + + public S3FPacketCustomPayload(String channelName, byte[] dataIn) + { + this.field_149172_a = channelName; + this.field_149171_b = dataIn; + + //TODO: Remove this when FML protocol is re-written. To restore vanilla compatibility. + if (dataIn.length > 0x1FFF9A) // Max size of ANY MC packet is 0x1FFFFF minus max size of this packet (101) + { + throw new IllegalArgumentException("Payload may not be larger than 2097050 bytes"); + } + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149172_a = data.readStringFromBuffer(20); + this.field_149171_b = new byte[cpw.mods.fml.common.network.ByteBufUtils.readVarShort(data)]; + data.readBytes(this.field_149171_b); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(this.field_149172_a); + cpw.mods.fml.common.network.ByteBufUtils.writeVarShort(data, this.field_149171_b.length); + data.writeBytes(this.field_149171_b); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCustomPayload(this); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public String func_149169_c() + { + return this.field_149172_a; + } + + @SideOnly(Side.CLIENT) + public byte[] func_149168_d() + { + return this.field_149171_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S40PacketDisconnect.java b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S40PacketDisconnect.java new file mode 100644 index 0000000..a02a46a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/play/server/S40PacketDisconnect.java @@ -0,0 +1,70 @@ +package net.minecraft.network.play.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; +import net.minecraft.util.IChatComponent; + +public class S40PacketDisconnect extends Packet +{ + private IChatComponent field_149167_a; + private static final String __OBFID = "CL_00001298"; + + public S40PacketDisconnect() {} + + public S40PacketDisconnect(IChatComponent p_i45191_1_) + { + this.field_149167_a = p_i45191_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149167_a = IChatComponent.Serializer.func_150699_a(data.readStringFromBuffer(32767)); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(IChatComponent.Serializer.func_150696_a(this.field_149167_a)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleDisconnect(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerPlayClient)handler); + } + + @SideOnly(Side.CLIENT) + public IChatComponent func_149165_c() + { + return this.field_149167_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/IServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/IServer.java new file mode 100644 index 0000000..1724e22 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/IServer.java @@ -0,0 +1,105 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.SERVER) +public interface IServer +{ + /** + * Gets an integer property. If it does not exist, set it to the specified value. + */ + int getIntProperty(String key, int defaultValue); + + /** + * Gets a string property. If it does not exist, set it to the specified value. + */ + String getStringProperty(String key, String defaultValue); + + /** + * Saves an Object with the given property name. + */ + void setProperty(String key, Object value); + + /** + * Saves all of the server properties to the properties file. + */ + void saveProperties(); + + /** + * Returns the filename where server properties are stored + */ + String getSettingsFilename(); + + /** + * Returns the server's hostname. + */ + String getHostname(); + + /** + * Never used, but "getServerPort" is already taken. + */ + int getPort(); + + /** + * Returns the server message of the day + */ + String getMotd(); + + /** + * Returns the server's Minecraft version as string. + */ + String getMinecraftVersion(); + + /** + * Returns the number of players currently on the server. + */ + int getCurrentPlayerCount(); + + /** + * Returns the maximum number of players allowed on the server. + */ + int getMaxPlayers(); + + /** + * Returns an array of the usernames of all the connected players. + */ + String[] getAllUsernames(); + + String getFolderName(); + + /** + * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". + */ + String getPlugins(); + + /** + * Handle a command received by an RCon instance + */ + String handleRConCommand(String command); + + /** + * Returns true if debugging is enabled, false otherwise. + */ + boolean isDebuggingEnabled(); + + /** + * Logs the message with a level of INFO. + */ + void logInfo(String msg); + + /** + * Logs the message with a level of WARN. + */ + void logWarning(String msg); + + /** + * Logs the error message with a level of SEVERE. + */ + void logSevere(String msg); + + /** + * If isDebuggingEnabled(), logs the message with a level of INFO. + */ + void logDebug(String msg); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConConsoleSource.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConConsoleSource.java new file mode 100644 index 0000000..d4d3c37 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConConsoleSource.java @@ -0,0 +1,82 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.command.ICommandSender; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; + +public class RConConsoleSource implements ICommandSender +{ + /** Single instance of RConConsoleSource */ + public static final RConConsoleSource instance = new RConConsoleSource(); + /** RCon string buffer for log. */ + private StringBuffer buffer = new StringBuffer(); + private static final String __OBFID = "CL_00001800"; + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return "Rcon"; + } + + public IChatComponent func_145748_c_() + { + return new ChatComponentText(this.getCommandSenderName()); + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + this.buffer.append(message.getUnformattedText()); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + return true; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() + { + return MinecraftServer.getServer().getEntityWorld(); + } + + /** + * Clears the RCon log + */ + @SideOnly(Side.SERVER) + public void resetLog() + { + this.buffer.setLength(0); + } + + /** + * Gets the contents of the RCon log + */ + @SideOnly(Side.SERVER) + public String getLogContents() + { + return this.buffer.toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConOutputStream.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConOutputStream.java new file mode 100644 index 0000000..7eec08c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConOutputStream.java @@ -0,0 +1,72 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +@SideOnly(Side.SERVER) +public class RConOutputStream +{ + /** Output stream */ + private ByteArrayOutputStream byteArrayOutput; + /** ByteArrayOutputStream wrapper */ + private DataOutputStream output; + private static final String __OBFID = "CL_00001798"; + + public RConOutputStream(int size) + { + this.byteArrayOutput = new ByteArrayOutputStream(size); + this.output = new DataOutputStream(this.byteArrayOutput); + } + + /** + * Writes the given byte array to the output stream + */ + public void writeByteArray(byte[] data) throws IOException + { + this.output.write(data, 0, data.length); + } + + /** + * Writes the given String to the output stream + */ + public void writeString(String data) throws IOException + { + this.output.writeBytes(data); + this.output.write(0); + } + + /** + * Writes the given int to the output stream + */ + public void writeInt(int data) throws IOException + { + this.output.write(data); + } + + /** + * Writes the given short to the output stream + */ + public void writeShort(short data) throws IOException + { + this.output.writeShort(Short.reverseBytes(data)); + } + + /** + * Returns the contents of the output stream as a byte array + */ + public byte[] toByteArray() + { + return this.byteArrayOutput.toByteArray(); + } + + /** + * Resets the byte array output. + */ + public void reset() + { + this.byteArrayOutput.reset(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadBase.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadBase.java new file mode 100644 index 0000000..57b8a8a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadBase.java @@ -0,0 +1,230 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.DatagramSocket; +import java.net.ServerSocket; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +@SideOnly(Side.SERVER) +public abstract class RConThreadBase implements Runnable +{ + private static final AtomicInteger field_164004_h = new AtomicInteger(0); + /** True if the Thread is running, false otherwise */ + protected boolean running; + /** Reference to the IServer object. */ + protected IServer server; + protected final String field_164003_c; + /** Thread for this runnable class */ + protected Thread rconThread; + protected int field_72615_d = 5; + /** A list of registered DatagramSockets */ + protected List socketList = new ArrayList(); + /** A list of registered ServerSockets */ + protected List serverSocketList = new ArrayList(); + private static final String __OBFID = "CL_00001801"; + + protected RConThreadBase(IServer p_i45300_1_, String threadName) + { + this.server = p_i45300_1_; + this.field_164003_c = threadName; + + if (this.server.isDebuggingEnabled()) + { + this.logWarning("Debugging is enabled, performance maybe reduced!"); + } + } + + /** + * Creates a new Thread object from this class and starts running + */ + public synchronized void startThread() + { + this.rconThread = new Thread(this, this.field_164003_c + " #" + field_164004_h.incrementAndGet()); + this.rconThread.start(); + this.running = true; + } + + /** + * Returns true if the Thread is running, false otherwise + */ + public boolean isRunning() + { + return this.running; + } + + /** + * Log debug message + */ + protected void logDebug(String msg) + { + this.server.logDebug(msg); + } + + /** + * Log information message + */ + protected void logInfo(String msg) + { + this.server.logInfo(msg); + } + + /** + * Log warning message + */ + protected void logWarning(String msg) + { + this.server.logWarning(msg); + } + + /** + * Log severe error message + */ + protected void logSevere(String msg) + { + this.server.logSevere(msg); + } + + /** + * Returns the number of players on the server + */ + protected int getNumberOfPlayers() + { + return this.server.getCurrentPlayerCount(); + } + + /** + * Registers a DatagramSocket with this thread + */ + protected void registerSocket(DatagramSocket socket) + { + this.logDebug("registerSocket: " + socket); + this.socketList.add(socket); + } + + /** + * Closes the specified DatagramSocket + */ + protected boolean closeSocket(DatagramSocket socket, boolean removeFromList) + { + this.logDebug("closeSocket: " + socket); + + if (null == socket) + { + return false; + } + else + { + boolean flag1 = false; + + if (!socket.isClosed()) + { + socket.close(); + flag1 = true; + } + + if (removeFromList) + { + this.socketList.remove(socket); + } + + return flag1; + } + } + + /** + * Closes the specified ServerSocket + */ + protected boolean closeServerSocket(ServerSocket socket) + { + return this.closeServerSocket_do(socket, true); + } + + /** + * Closes the specified ServerSocket + */ + protected boolean closeServerSocket_do(ServerSocket socket, boolean removeFromList) + { + this.logDebug("closeSocket: " + socket); + + if (null == socket) + { + return false; + } + else + { + boolean flag1 = false; + + try + { + if (!socket.isClosed()) + { + socket.close(); + flag1 = true; + } + } + catch (IOException ioexception) + { + this.logWarning("IO: " + ioexception.getMessage()); + } + + if (removeFromList) + { + this.serverSocketList.remove(socket); + } + + return flag1; + } + } + + /** + * Closes all of the opened sockets + */ + protected void closeAllSockets() + { + this.closeAllSockets_do(false); + } + + /** + * Closes all of the opened sockets + */ + protected void closeAllSockets_do(boolean logWarning) + { + int i = 0; + Iterator iterator = this.socketList.iterator(); + + while (iterator.hasNext()) + { + DatagramSocket datagramsocket = (DatagramSocket)iterator.next(); + + if (this.closeSocket(datagramsocket, false)) + { + ++i; + } + } + + this.socketList.clear(); + iterator = this.serverSocketList.iterator(); + + while (iterator.hasNext()) + { + ServerSocket serversocket = (ServerSocket)iterator.next(); + + if (this.closeServerSocket_do(serversocket, false)) + { + ++i; + } + } + + this.serverSocketList.clear(); + + if (logWarning && 0 < i) + { + this.logWarning("Force closed " + i + " sockets"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadClient.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadClient.java new file mode 100644 index 0000000..6d2658e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadClient.java @@ -0,0 +1,200 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; +import java.net.SocketTimeoutException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class RConThreadClient extends RConThreadBase +{ + private static final Logger field_164005_h = LogManager.getLogger(); + /** True if the client has succefssfully logged into the RCon, otherwise false */ + private boolean loggedIn; + /** The client's Socket connection */ + private Socket clientSocket; + /** A buffer for incoming Socket data */ + private byte[] buffer = new byte[1460]; + /** The RCon password */ + private String rconPassword; + private static final String __OBFID = "CL_00001804"; + + RConThreadClient(IServer p_i1537_1_, Socket socket) + { + super(p_i1537_1_, "RCON Client"); + this.clientSocket = socket; + + try + { + this.clientSocket.setSoTimeout(0); + } + catch (Exception exception) + { + this.running = false; + } + + this.rconPassword = p_i1537_1_.getStringProperty("rcon.password", ""); + this.logInfo("Rcon connection from: " + socket.getInetAddress()); + } + + public void run() + { + while (true) + { + try + { + if (!this.running) + { + break; + } + + BufferedInputStream bufferedinputstream = new BufferedInputStream(this.clientSocket.getInputStream()); + int i = bufferedinputstream.read(this.buffer, 0, 1460); + + if (10 <= i) + { + byte b0 = 0; + int j = RConUtils.getBytesAsLEInt(this.buffer, 0, i); + + if (j != i - 4) + { + return; + } + + int i1 = b0 + 4; + int k = RConUtils.getBytesAsLEInt(this.buffer, i1, i); + i1 += 4; + int l = RConUtils.getRemainingBytesAsLEInt(this.buffer, i1); + i1 += 4; + + switch (l) + { + case 2: + if (this.loggedIn) + { + String s1 = RConUtils.getBytesAsString(this.buffer, i1, i); + + try + { + this.sendMultipacketResponse(k, this.server.handleRConCommand(s1)); + } + catch (Exception exception) + { + this.sendMultipacketResponse(k, "Error executing: " + s1 + " (" + exception.getMessage() + ")"); + } + + continue; + } + + this.sendLoginFailedResponse(); + continue; + case 3: + String s = RConUtils.getBytesAsString(this.buffer, i1, i); + int j1 = i1 + s.length(); + + if (0 != s.length() && s.equals(this.rconPassword)) + { + this.loggedIn = true; + this.sendResponse(k, 2, ""); + continue; + } + + this.loggedIn = false; + this.sendLoginFailedResponse(); + continue; + default: + this.sendMultipacketResponse(k, String.format("Unknown request %s", new Object[] {Integer.toHexString(l)})); + continue; + } + } + } + catch (SocketTimeoutException sockettimeoutexception) + { + break; + } + catch (IOException ioexception) + { + break; + } + catch (Exception exception1) + { + field_164005_h.error("Exception whilst parsing RCON input", exception1); + break; + } + finally + { + this.closeSocket(); + } + + return; + } + } + + /** + * Sends the given response message to the client + */ + private void sendResponse(int p_72654_1_, int p_72654_2_, String message) throws IOException + { + ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(1248); + DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream); + byte[] abyte = message.getBytes("UTF-8"); + dataoutputstream.writeInt(Integer.reverseBytes(abyte.length + 10)); + dataoutputstream.writeInt(Integer.reverseBytes(p_72654_1_)); + dataoutputstream.writeInt(Integer.reverseBytes(p_72654_2_)); + dataoutputstream.write(abyte); + dataoutputstream.write(0); + dataoutputstream.write(0); + this.clientSocket.getOutputStream().write(bytearrayoutputstream.toByteArray()); + } + + /** + * Sends the standard RCon 'authorization failed' response packet + */ + private void sendLoginFailedResponse() throws IOException + { + this.sendResponse(-1, 2, ""); + } + + /** + * Splits the response message into individual packets and sends each one + */ + private void sendMultipacketResponse(int p_72655_1_, String p_72655_2_) throws IOException + { + int j = p_72655_2_.length(); + + do + { + int k = 4096 <= j ? 4096 : j; + this.sendResponse(p_72655_1_, 0, p_72655_2_.substring(0, k)); + p_72655_2_ = p_72655_2_.substring(k); + j = p_72655_2_.length(); + } + while (0 != j); + } + + /** + * Closes the client socket + */ + private void closeSocket() + { + if (null != this.clientSocket) + { + try + { + this.clientSocket.close(); + } + catch (IOException ioexception) + { + this.logWarning("IO: " + ioexception.getMessage()); + } + + this.clientSocket = null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadMain.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadMain.java new file mode 100644 index 0000000..b9dbb9a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadMain.java @@ -0,0 +1,152 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +@SideOnly(Side.SERVER) +public class RConThreadMain extends RConThreadBase +{ + /** Port RCon is running on */ + private int rconPort; + /** Port the server is running on */ + private int serverPort; + /** Hostname RCon is running on */ + private String hostname; + /** The RCon ServerSocket. */ + private ServerSocket serverSocket; + /** The RCon password */ + private String rconPassword; + /** A map of client addresses to their running Threads */ + private Map clientThreads; + private static final String __OBFID = "CL_00001805"; + + public RConThreadMain(IServer p_i1538_1_) + { + super(p_i1538_1_, "RCON Listener"); + this.rconPort = p_i1538_1_.getIntProperty("rcon.port", 0); + this.rconPassword = p_i1538_1_.getStringProperty("rcon.password", ""); + this.hostname = p_i1538_1_.getHostname(); + this.serverPort = p_i1538_1_.getPort(); + + if (0 == this.rconPort) + { + this.rconPort = this.serverPort + 10; + this.logInfo("Setting default rcon port to " + this.rconPort); + p_i1538_1_.setProperty("rcon.port", Integer.valueOf(this.rconPort)); + + if (0 == this.rconPassword.length()) + { + p_i1538_1_.setProperty("rcon.password", ""); + } + + p_i1538_1_.saveProperties(); + } + + if (0 == this.hostname.length()) + { + this.hostname = "0.0.0.0"; + } + + this.initClientThreadList(); + this.serverSocket = null; + } + + private void initClientThreadList() + { + this.clientThreads = new HashMap(); + } + + /** + * Cleans up the clientThreads map by removing client Threads that are not running + */ + private void cleanClientThreadsMap() + { + Iterator iterator = this.clientThreads.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (!((RConThreadClient)entry.getValue()).isRunning()) + { + iterator.remove(); + } + } + } + + public void run() + { + this.logInfo("RCON running on " + this.hostname + ":" + this.rconPort); + + try + { + while (this.running) + { + try + { + Socket socket = this.serverSocket.accept(); + socket.setSoTimeout(500); + RConThreadClient rconthreadclient = new RConThreadClient(this.server, socket); + rconthreadclient.startThread(); + this.clientThreads.put(socket.getRemoteSocketAddress(), rconthreadclient); + this.cleanClientThreadsMap(); + } + catch (SocketTimeoutException sockettimeoutexception) + { + this.cleanClientThreadsMap(); + } + catch (IOException ioexception) + { + if (this.running) + { + this.logInfo("IO: " + ioexception.getMessage()); + } + } + } + } + finally + { + this.closeServerSocket(this.serverSocket); + } + } + + /** + * Creates a new Thread object from this class and starts running + */ + public void startThread() + { + if (0 == this.rconPassword.length()) + { + this.logWarning("No rcon password set in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); + } + else if (0 < this.rconPort && 65535 >= this.rconPort) + { + if (!this.running) + { + try + { + this.serverSocket = new ServerSocket(this.rconPort, 0, InetAddress.getByName(this.hostname)); + this.serverSocket.setSoTimeout(500); + super.startThread(); + } + catch (IOException ioexception) + { + this.logWarning("Unable to initialise rcon on " + this.hostname + ":" + this.rconPort + " : " + ioexception.getMessage()); + } + } + } + else + { + this.logWarning("Invalid rcon port " + this.rconPort + " found in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadQuery.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadQuery.java new file mode 100644 index 0000000..e90f3b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConThreadQuery.java @@ -0,0 +1,459 @@ +package net.minecraft.network.rcon; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.PortUnreachableException; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.net.UnknownHostException; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.server.MinecraftServer; + +@SideOnly(Side.SERVER) +public class RConThreadQuery extends RConThreadBase +{ + /** The time of the last client auth check */ + private long lastAuthCheckTime; + /** The RCon query port */ + private int queryPort; + /** Port the server is running on */ + private int serverPort; + /** The maximum number of players allowed on the server */ + private int maxPlayers; + /** The current server message of the day */ + private String serverMotd; + /** The name of the currently loaded world */ + private String worldName; + /** The remote socket querying the server */ + private DatagramSocket querySocket; + /** A buffer for incoming DatagramPackets */ + private byte[] buffer = new byte[1460]; + /** Storage for incoming DatagramPackets */ + private DatagramPacket incomingPacket; + private Map field_72644_p; + /** The hostname of this query server */ + private String queryHostname; + /** The hostname of the running server */ + private String serverHostname; + /** A map of SocketAddress objects to RConThreadQueryAuth objects */ + private Map queryClients; + /** The time that this RConThreadQuery was constructed, from (new Date()).getTime() */ + private long time; + /** The RConQuery output stream */ + private RConOutputStream output; + /** The time of the last query response sent */ + private long lastQueryResponseTime; + private static final String __OBFID = "CL_00001802"; + + public RConThreadQuery(IServer p_i1536_1_) + { + super(p_i1536_1_, "Query Listener"); + this.queryPort = p_i1536_1_.getIntProperty("query.port", 0); + this.serverHostname = p_i1536_1_.getHostname(); + this.serverPort = p_i1536_1_.getPort(); + this.serverMotd = p_i1536_1_.getMotd(); + this.maxPlayers = p_i1536_1_.getMaxPlayers(); + this.worldName = p_i1536_1_.getFolderName(); + this.lastQueryResponseTime = 0L; + this.queryHostname = "0.0.0.0"; + + if (0 != this.serverHostname.length() && !this.queryHostname.equals(this.serverHostname)) + { + this.queryHostname = this.serverHostname; + } + else + { + this.serverHostname = "0.0.0.0"; + + try + { + InetAddress inetaddress = InetAddress.getLocalHost(); + this.queryHostname = inetaddress.getHostAddress(); + } + catch (UnknownHostException unknownhostexception) + { + this.logWarning("Unable to determine local host IP, please set server-ip in \'" + p_i1536_1_.getSettingsFilename() + "\' : " + unknownhostexception.getMessage()); + } + } + + if (0 == this.queryPort) + { + this.queryPort = this.serverPort; + this.logInfo("Setting default query port to " + this.queryPort); + p_i1536_1_.setProperty("query.port", Integer.valueOf(this.queryPort)); + p_i1536_1_.setProperty("debug", Boolean.valueOf(false)); + p_i1536_1_.saveProperties(); + } + + this.field_72644_p = new HashMap(); + this.output = new RConOutputStream(1460); + this.queryClients = new HashMap(); + this.time = (new Date()).getTime(); + } + + /** + * Sends a byte array as a DatagramPacket response to the client who sent the given DatagramPacket + */ + private void sendResponsePacket(byte[] data, DatagramPacket requestPacket) throws IOException + { + this.querySocket.send(new DatagramPacket(data, data.length, requestPacket.getSocketAddress())); + } + + /** + * Parses an incoming DatagramPacket, returning true if the packet was valid + */ + private boolean parseIncomingPacket(DatagramPacket requestPacket) throws IOException + { + byte[] abyte = requestPacket.getData(); + int i = requestPacket.getLength(); + SocketAddress socketaddress = requestPacket.getSocketAddress(); + this.logDebug("Packet len " + i + " [" + socketaddress + "]"); + + if (3 <= i && -2 == abyte[0] && -3 == abyte[1]) + { + this.logDebug("Packet \'" + RConUtils.getByteAsHexString(abyte[2]) + "\' [" + socketaddress + "]"); + + switch (abyte[2]) + { + case 0: + if (!this.verifyClientAuth(requestPacket).booleanValue()) + { + this.logDebug("Invalid challenge [" + socketaddress + "]"); + return false; + } + else if (15 == i) + { + this.sendResponsePacket(this.createQueryResponse(requestPacket), requestPacket); + this.logDebug("Rules [" + socketaddress + "]"); + } + else + { + RConOutputStream rconoutputstream = new RConOutputStream(1460); + rconoutputstream.writeInt(0); + rconoutputstream.writeByteArray(this.getRequestID(requestPacket.getSocketAddress())); + rconoutputstream.writeString(this.serverMotd); + rconoutputstream.writeString("SMP"); + rconoutputstream.writeString(this.worldName); + rconoutputstream.writeString(Integer.toString(this.getNumberOfPlayers())); + rconoutputstream.writeString(Integer.toString(this.maxPlayers)); + rconoutputstream.writeShort((short)this.serverPort); + rconoutputstream.writeString(this.queryHostname); + this.sendResponsePacket(rconoutputstream.toByteArray(), requestPacket); + this.logDebug("Status [" + socketaddress + "]"); + } + case 9: + this.sendAuthChallenge(requestPacket); + this.logDebug("Challenge [" + socketaddress + "]"); + return true; + default: + return true; + } + } + else + { + this.logDebug("Invalid packet [" + socketaddress + "]"); + return false; + } + } + + /** + * Creates a query response as a byte array for the specified query DatagramPacket + */ + private byte[] createQueryResponse(DatagramPacket requestPacket) throws IOException + { + long i = MinecraftServer.getSystemTimeMillis(); + + if (i < this.lastQueryResponseTime + 5000L) + { + byte[] abyte = this.output.toByteArray(); + byte[] abyte1 = this.getRequestID(requestPacket.getSocketAddress()); + abyte[1] = abyte1[0]; + abyte[2] = abyte1[1]; + abyte[3] = abyte1[2]; + abyte[4] = abyte1[3]; + return abyte; + } + else + { + this.lastQueryResponseTime = i; + this.output.reset(); + this.output.writeInt(0); + this.output.writeByteArray(this.getRequestID(requestPacket.getSocketAddress())); + this.output.writeString("splitnum"); + this.output.writeInt(128); + this.output.writeInt(0); + this.output.writeString("hostname"); + this.output.writeString(this.serverMotd); + this.output.writeString("gametype"); + this.output.writeString("SMP"); + this.output.writeString("game_id"); + this.output.writeString("MINECRAFT"); + this.output.writeString("version"); + this.output.writeString(this.server.getMinecraftVersion()); + this.output.writeString("plugins"); + this.output.writeString(this.server.getPlugins()); + this.output.writeString("map"); + this.output.writeString(this.worldName); + this.output.writeString("numplayers"); + this.output.writeString("" + this.getNumberOfPlayers()); + this.output.writeString("maxplayers"); + this.output.writeString("" + this.maxPlayers); + this.output.writeString("hostport"); + this.output.writeString("" + this.serverPort); + this.output.writeString("hostip"); + this.output.writeString(this.queryHostname); + this.output.writeInt(0); + this.output.writeInt(1); + this.output.writeString("player_"); + this.output.writeInt(0); + String[] astring = this.server.getAllUsernames(); + String[] astring1 = astring; + int j = astring.length; + + for (int k = 0; k < j; ++k) + { + String s = astring1[k]; + this.output.writeString(s); + } + + this.output.writeInt(0); + return this.output.toByteArray(); + } + } + + /** + * Returns the request ID provided by the authorized client + */ + private byte[] getRequestID(SocketAddress address) + { + return ((RConThreadQuery.Auth)this.queryClients.get(address)).getRequestId(); + } + + /** + * Returns true if the client has a valid auth, otherwise false + */ + private Boolean verifyClientAuth(DatagramPacket requestPacket) + { + SocketAddress socketaddress = requestPacket.getSocketAddress(); + + if (!this.queryClients.containsKey(socketaddress)) + { + return Boolean.valueOf(false); + } + else + { + byte[] abyte = requestPacket.getData(); + return ((RConThreadQuery.Auth)this.queryClients.get(socketaddress)).getRandomChallenge() != RConUtils.getBytesAsBEint(abyte, 7, requestPacket.getLength()) ? Boolean.valueOf(false) : Boolean.valueOf(true); + } + } + + /** + * Sends an auth challenge DatagramPacket to the client and adds the client to the queryClients map + */ + private void sendAuthChallenge(DatagramPacket requestPacket) throws IOException + { + RConThreadQuery.Auth auth = new RConThreadQuery.Auth(requestPacket); + this.queryClients.put(requestPacket.getSocketAddress(), auth); + this.sendResponsePacket(auth.getChallengeValue(), requestPacket); + } + + /** + * Removes all clients whose auth is no longer valid + */ + private void cleanQueryClientsMap() + { + if (this.running) + { + long i = MinecraftServer.getSystemTimeMillis(); + + if (i >= this.lastAuthCheckTime + 30000L) + { + this.lastAuthCheckTime = i; + Iterator iterator = this.queryClients.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((RConThreadQuery.Auth)entry.getValue()).hasExpired(i).booleanValue()) + { + iterator.remove(); + } + } + } + } + } + + public void run() + { + this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort); + this.lastAuthCheckTime = MinecraftServer.getSystemTimeMillis(); + this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length); + + try + { + while (this.running) + { + try + { + this.querySocket.receive(this.incomingPacket); + this.cleanQueryClientsMap(); + this.parseIncomingPacket(this.incomingPacket); + } + catch (SocketTimeoutException sockettimeoutexception) + { + this.cleanQueryClientsMap(); + } + catch (PortUnreachableException portunreachableexception) + { + ; + } + catch (IOException ioexception) + { + this.stopWithException(ioexception); + } + } + } + finally + { + this.closeAllSockets(); + } + } + + /** + * Creates a new Thread object from this class and starts running + */ + public void startThread() + { + if (!this.running) + { + if (0 < this.queryPort && 65535 >= this.queryPort) + { + if (this.initQuerySystem()) + { + super.startThread(); + } + } + else + { + this.logWarning("Invalid query port " + this.queryPort + " found in \'" + this.server.getSettingsFilename() + "\' (queries disabled)"); + } + } + } + + /** + * Stops the query server and reports the given Exception + */ + private void stopWithException(Exception exception) + { + if (this.running) + { + this.logWarning("Unexpected exception, buggy JRE? (" + exception.toString() + ")"); + + if (!this.initQuerySystem()) + { + this.logSevere("Failed to recover from buggy JRE, shutting down!"); + this.running = false; + } + } + } + + /** + * Initializes the query system by binding it to a port + */ + private boolean initQuerySystem() + { + try + { + this.querySocket = new DatagramSocket(this.queryPort, InetAddress.getByName(this.serverHostname)); + this.registerSocket(this.querySocket); + this.querySocket.setSoTimeout(500); + return true; + } + catch (SocketException socketexception) + { + this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Socket): " + socketexception.getMessage()); + } + catch (UnknownHostException unknownhostexception) + { + this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Unknown Host): " + unknownhostexception.getMessage()); + } + catch (Exception exception) + { + this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (E): " + exception.getMessage()); + } + + return false; + } + + @SideOnly(Side.SERVER) + class Auth + { + /** The creation timestamp for this auth */ + private long timestamp = (new Date()).getTime(); + /** A random integer value to be used for client response authentication */ + private int randomChallenge; + /** A client-provided request ID associated with this query. */ + private byte[] requestId; + /** A unique string of bytes used to verify client auth */ + private byte[] challengeValue; + /** The request ID stored as a String */ + private String requestIdAsString; + private static final String __OBFID = "CL_00001803"; + + public Auth(DatagramPacket requestPacket) + { + byte[] abyte = requestPacket.getData(); + this.requestId = new byte[4]; + this.requestId[0] = abyte[3]; + this.requestId[1] = abyte[4]; + this.requestId[2] = abyte[5]; + this.requestId[3] = abyte[6]; + this.requestIdAsString = new String(this.requestId); + this.randomChallenge = (new Random()).nextInt(16777216); + this.challengeValue = String.format("\t%s%d\u0000", new Object[] {this.requestIdAsString, Integer.valueOf(this.randomChallenge)}).getBytes(); + } + + /** + * Returns true if the auth's creation timestamp is less than the given time, otherwise false + */ + public Boolean hasExpired(long currentTime) + { + return Boolean.valueOf(this.timestamp < currentTime); + } + + /** + * Returns the random challenge number assigned to this auth + */ + public int getRandomChallenge() + { + return this.randomChallenge; + } + + /** + * Returns the auth challenge value + */ + public byte[] getChallengeValue() + { + return this.challengeValue; + } + + /** + * Returns the request ID provided by the client. + */ + public byte[] getRequestId() + { + return this.requestId; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConUtils.java b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConUtils.java new file mode 100644 index 0000000..154cfac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/rcon/RConUtils.java @@ -0,0 +1,61 @@ +package net.minecraft.network.rcon; + +import com.google.common.base.Charsets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.SERVER) +public class RConUtils +{ + /** Translation array of decimal to hex digits */ + public static char[] hexDigits = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + private static final String __OBFID = "CL_00001799"; + + /** + * Read a null-terminated string from the given byte array + */ + public static String getBytesAsString(byte[] p_72661_0_, int p_72661_1_, int p_72661_2_) + { + int k = p_72661_2_ - 1; + int l; + + for (l = p_72661_1_ > k ? k : p_72661_1_; 0 != p_72661_0_[l] && l < k; ++l) + { + ; + } + + return new String(p_72661_0_, p_72661_1_, l - p_72661_1_, Charsets.UTF_8); + } + + /** + * Read 4 bytes from the + */ + public static int getRemainingBytesAsLEInt(byte[] p_72662_0_, int p_72662_1_) + { + return getBytesAsLEInt(p_72662_0_, p_72662_1_, p_72662_0_.length); + } + + /** + * Read 4 bytes from the given array in little-endian format and return them as an int + */ + public static int getBytesAsLEInt(byte[] p_72665_0_, int p_72665_1_, int p_72665_2_) + { + return 0 > p_72665_2_ - p_72665_1_ - 4 ? 0 : p_72665_0_[p_72665_1_ + 3] << 24 | (p_72665_0_[p_72665_1_ + 2] & 255) << 16 | (p_72665_0_[p_72665_1_ + 1] & 255) << 8 | p_72665_0_[p_72665_1_] & 255; + } + + /** + * Read 4 bytes from the given array in big-endian format and return them as an int + */ + public static int getBytesAsBEint(byte[] p_72664_0_, int p_72664_1_, int p_72664_2_) + { + return 0 > p_72664_2_ - p_72664_1_ - 4 ? 0 : p_72664_0_[p_72664_1_] << 24 | (p_72664_0_[p_72664_1_ + 1] & 255) << 16 | (p_72664_0_[p_72664_1_ + 2] & 255) << 8 | p_72664_0_[p_72664_1_ + 3] & 255; + } + + /** + * Returns a String representation of the byte in hexadecimal format + */ + public static String getByteAsHexString(byte input) + { + return "" + hexDigits[(input & 240) >>> 4] + hexDigits[input & 15]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusClient.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusClient.java new file mode 100644 index 0000000..144faef --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusClient.java @@ -0,0 +1,12 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; + +public interface INetHandlerStatusClient extends INetHandler +{ + void handleServerInfo(S00PacketServerInfo packetIn); + + void handlePong(S01PacketPong packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusServer.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusServer.java new file mode 100644 index 0000000..009037a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/INetHandlerStatusServer.java @@ -0,0 +1,12 @@ +package net.minecraft.network.status; + +import net.minecraft.network.INetHandler; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; + +public interface INetHandlerStatusServer extends INetHandler +{ + void processPing(C01PacketPing packetIn); + + void processServerQuery(C00PacketServerQuery packetIn); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C00PacketServerQuery.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C00PacketServerQuery.java new file mode 100644 index 0000000..3c07a27 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C00PacketServerQuery.java @@ -0,0 +1,47 @@ +package net.minecraft.network.status.client; + +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C00PacketServerQuery extends Packet +{ + private static final String __OBFID = "CL_00001393"; + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException {} + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException {} + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerStatusServer handler) + { + handler.processServerQuery(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerStatusServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C01PacketPing.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C01PacketPing.java new file mode 100644 index 0000000..29f5304 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/client/C01PacketPing.java @@ -0,0 +1,69 @@ +package net.minecraft.network.status.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusServer; + +public class C01PacketPing extends Packet +{ + private long field_149290_a; + private static final String __OBFID = "CL_00001392"; + + public C01PacketPing() {} + + @SideOnly(Side.CLIENT) + public C01PacketPing(long p_i45276_1_) + { + this.field_149290_a = p_i45276_1_; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149290_a = data.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeLong(this.field_149290_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerStatusServer handler) + { + handler.processPing(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + public long func_149289_c() + { + return this.field_149290_a; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerStatusServer)handler); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S00PacketServerInfo.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S00PacketServerInfo.java new file mode 100644 index 0000000..04f93f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S00PacketServerInfo.java @@ -0,0 +1,76 @@ +package net.minecraft.network.status.server; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumTypeAdapterFactory; +import net.minecraft.util.IChatComponent; + +public class S00PacketServerInfo extends Packet +{ + private static final Gson field_149297_a = (new GsonBuilder()).registerTypeAdapter(ServerStatusResponse.MinecraftProtocolVersionIdentifier.class, new ServerStatusResponse.MinecraftProtocolVersionIdentifier.Serializer()).registerTypeAdapter(ServerStatusResponse.PlayerCountData.class, new ServerStatusResponse.PlayerCountData.Serializer()).registerTypeAdapter(ServerStatusResponse.class, new ServerStatusResponse.Serializer()).registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()).registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()).registerTypeAdapterFactory(new EnumTypeAdapterFactory()).create(); + private ServerStatusResponse field_149296_b; + private static final String __OBFID = "CL_00001384"; + + public S00PacketServerInfo() {} + + public S00PacketServerInfo(ServerStatusResponse responseIn) + { + this.field_149296_b = responseIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149296_b = (ServerStatusResponse)field_149297_a.fromJson(data.readStringFromBuffer(32767), ServerStatusResponse.class); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeStringToBuffer(field_149297_a.toJson(this.field_149296_b)); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerStatusClient handler) + { + handler.handleServerInfo(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerStatusClient)handler); + } + + @SideOnly(Side.CLIENT) + public ServerStatusResponse func_149294_c() + { + return this.field_149296_b; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S01PacketPong.java b/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S01PacketPong.java new file mode 100644 index 0000000..8061c44 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/network/status/server/S01PacketPong.java @@ -0,0 +1,69 @@ +package net.minecraft.network.status.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.network.INetHandler; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.status.INetHandlerStatusClient; + +public class S01PacketPong extends Packet +{ + private long field_149293_a; + private static final String __OBFID = "CL_00001383"; + + public S01PacketPong() {} + + public S01PacketPong(long time) + { + this.field_149293_a = time; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer data) throws IOException + { + this.field_149293_a = data.readLong(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer data) throws IOException + { + data.writeLong(this.field_149293_a); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerStatusClient handler) + { + handler.handlePong(this); + } + + /** + * If true, the network manager will process the packet immediately when received, otherwise it will queue it for + * processing. Currently true for: Disconnect, LoginSuccess, KeepAlive, ServerQuery/Info, Ping/Pong + */ + public boolean hasPriority() + { + return true; + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandler handler) + { + this.processPacket((INetHandlerStatusClient)handler); + } + + @SideOnly(Side.CLIENT) + public long func_149292_c() + { + return this.field_149293_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/pathfinding/Path.java b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/Path.java new file mode 100644 index 0000000..0f74e28 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/Path.java @@ -0,0 +1,175 @@ +package net.minecraft.pathfinding; + +public class Path +{ + /** Contains the points in this path */ + private PathPoint[] pathPoints = new PathPoint[1024]; + /** The number of points in this path */ + private int count; + private static final String __OBFID = "CL_00000573"; + + /** + * Adds a point to the path + */ + public PathPoint addPoint(PathPoint point) + { + if (point.index >= 0) + { + throw new IllegalStateException("OW KNOWS!"); + } + else + { + if (this.count == this.pathPoints.length) + { + PathPoint[] apathpoint = new PathPoint[this.count << 1]; + System.arraycopy(this.pathPoints, 0, apathpoint, 0, this.count); + this.pathPoints = apathpoint; + } + + this.pathPoints[this.count] = point; + point.index = this.count; + this.sortBack(this.count++); + return point; + } + } + + /** + * Clears the path + */ + public void clearPath() + { + this.count = 0; + } + + /** + * Returns and removes the first point in the path + */ + public PathPoint dequeue() + { + PathPoint pathpoint = this.pathPoints[0]; + this.pathPoints[0] = this.pathPoints[--this.count]; + this.pathPoints[this.count] = null; + + if (this.count > 0) + { + this.sortForward(0); + } + + pathpoint.index = -1; + return pathpoint; + } + + /** + * Changes the provided point's distance to target + */ + public void changeDistance(PathPoint p_75850_1_, float p_75850_2_) + { + float f1 = p_75850_1_.distanceToTarget; + p_75850_1_.distanceToTarget = p_75850_2_; + + if (p_75850_2_ < f1) + { + this.sortBack(p_75850_1_.index); + } + else + { + this.sortForward(p_75850_1_.index); + } + } + + /** + * Sorts a point to the left + */ + private void sortBack(int p_75847_1_) + { + PathPoint pathpoint = this.pathPoints[p_75847_1_]; + int j; + + for (float f = pathpoint.distanceToTarget; p_75847_1_ > 0; p_75847_1_ = j) + { + j = p_75847_1_ - 1 >> 1; + PathPoint pathpoint1 = this.pathPoints[j]; + + if (f >= pathpoint1.distanceToTarget) + { + break; + } + + this.pathPoints[p_75847_1_] = pathpoint1; + pathpoint1.index = p_75847_1_; + } + + this.pathPoints[p_75847_1_] = pathpoint; + pathpoint.index = p_75847_1_; + } + + /** + * Sorts a point to the right + */ + private void sortForward(int p_75846_1_) + { + PathPoint pathpoint = this.pathPoints[p_75846_1_]; + float f = pathpoint.distanceToTarget; + + while (true) + { + int j = 1 + (p_75846_1_ << 1); + int k = j + 1; + + if (j >= this.count) + { + break; + } + + PathPoint pathpoint1 = this.pathPoints[j]; + float f1 = pathpoint1.distanceToTarget; + PathPoint pathpoint2; + float f2; + + if (k >= this.count) + { + pathpoint2 = null; + f2 = Float.POSITIVE_INFINITY; + } + else + { + pathpoint2 = this.pathPoints[k]; + f2 = pathpoint2.distanceToTarget; + } + + if (f1 < f2) + { + if (f1 >= f) + { + break; + } + + this.pathPoints[p_75846_1_] = pathpoint1; + pathpoint1.index = p_75846_1_; + p_75846_1_ = j; + } + else + { + if (f2 >= f) + { + break; + } + + this.pathPoints[p_75846_1_] = pathpoint2; + pathpoint2.index = p_75846_1_; + p_75846_1_ = k; + } + } + + this.pathPoints[p_75846_1_] = pathpoint; + pathpoint.index = p_75846_1_; + } + + /** + * Returns true if this path contains no points + */ + public boolean isPathEmpty() + { + return this.count == 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathEntity.java b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathEntity.java new file mode 100644 index 0000000..4511df5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathEntity.java @@ -0,0 +1,128 @@ +package net.minecraft.pathfinding; + +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; + +public class PathEntity +{ + /** The actual points in the path */ + private final PathPoint[] points; + /** PathEntity Array Index the Entity is currently targeting */ + private int currentPathIndex; + /** The total length of the path */ + private int pathLength; + private static final String __OBFID = "CL_00000575"; + + public PathEntity(PathPoint[] p_i2136_1_) + { + this.points = p_i2136_1_; + this.pathLength = p_i2136_1_.length; + } + + /** + * Directs this path to the next point in its array + */ + public void incrementPathIndex() + { + ++this.currentPathIndex; + } + + /** + * Returns true if this path has reached the end + */ + public boolean isFinished() + { + return this.currentPathIndex >= this.pathLength; + } + + /** + * returns the last PathPoint of the Array + */ + public PathPoint getFinalPathPoint() + { + return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; + } + + /** + * return the PathPoint located at the specified PathIndex, usually the current one + */ + public PathPoint getPathPointFromIndex(int p_75877_1_) + { + return this.points[p_75877_1_]; + } + + public int getCurrentPathLength() + { + return this.pathLength; + } + + public void setCurrentPathLength(int p_75871_1_) + { + this.pathLength = p_75871_1_; + } + + public int getCurrentPathIndex() + { + return this.currentPathIndex; + } + + public void setCurrentPathIndex(int p_75872_1_) + { + this.currentPathIndex = p_75872_1_; + } + + /** + * Gets the vector of the PathPoint associated with the given index. + */ + public Vec3 getVectorFromIndex(Entity p_75881_1_, int p_75881_2_) + { + double d0 = (double)this.points[p_75881_2_].xCoord + (double)((int)(p_75881_1_.width + 1.0F)) * 0.5D; + double d1 = (double)this.points[p_75881_2_].yCoord; + double d2 = (double)this.points[p_75881_2_].zCoord + (double)((int)(p_75881_1_.width + 1.0F)) * 0.5D; + return Vec3.createVectorHelper(d0, d1, d2); + } + + /** + * returns the current PathEntity target node as Vec3D + */ + public Vec3 getPosition(Entity p_75878_1_) + { + return this.getVectorFromIndex(p_75878_1_, this.currentPathIndex); + } + + /** + * Returns true if the EntityPath are the same. Non instance related equals. + */ + public boolean isSamePath(PathEntity p_75876_1_) + { + if (p_75876_1_ == null) + { + return false; + } + else if (p_75876_1_.points.length != this.points.length) + { + return false; + } + else + { + for (int i = 0; i < this.points.length; ++i) + { + if (this.points[i].xCoord != p_75876_1_.points[i].xCoord || this.points[i].yCoord != p_75876_1_.points[i].yCoord || this.points[i].zCoord != p_75876_1_.points[i].zCoord) + { + return false; + } + } + + return true; + } + } + + /** + * Returns true if the final PathPoint in the PathEntity is equal to Vec3D coords. + */ + public boolean isDestinationSame(Vec3 p_75880_1_) + { + PathPoint pathpoint = this.getFinalPathPoint(); + return pathpoint == null ? false : pathpoint.xCoord == (int)p_75880_1_.xCoord && pathpoint.zCoord == (int)p_75880_1_.zCoord; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathFinder.java b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathFinder.java new file mode 100644 index 0000000..7de137a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathFinder.java @@ -0,0 +1,394 @@ +package net.minecraft.pathfinding; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; + +public class PathFinder +{ + /** Used to find obstacles */ + private IBlockAccess worldMap; + /** The path being generated */ + private Path path = new Path(); + /** The points in the path */ + private IntHashMap pointMap = new IntHashMap(); + /** Selection of path points to add to the path */ + private PathPoint[] pathOptions = new PathPoint[32]; + /** should the PathFinder go through wodden door blocks */ + private boolean isWoddenDoorAllowed; + /** should the PathFinder disregard BlockMovement type materials in its path */ + private boolean isMovementBlockAllowed; + private boolean isPathingInWater; + /** tells the FathFinder to not stop pathing underwater */ + private boolean canEntityDrown; + private static final String __OBFID = "CL_00000576"; + + public PathFinder(IBlockAccess p_i2137_1_, boolean p_i2137_2_, boolean p_i2137_3_, boolean p_i2137_4_, boolean p_i2137_5_) + { + this.worldMap = p_i2137_1_; + this.isWoddenDoorAllowed = p_i2137_2_; + this.isMovementBlockAllowed = p_i2137_3_; + this.isPathingInWater = p_i2137_4_; + this.canEntityDrown = p_i2137_5_; + } + + /** + * Creates a path from one entity to another within a minimum distance + */ + public PathEntity createEntityPathTo(Entity p_75856_1_, Entity p_75856_2_, float p_75856_3_) + { + return this.createEntityPathTo(p_75856_1_, p_75856_2_.posX, p_75856_2_.boundingBox.minY, p_75856_2_.posZ, p_75856_3_); + } + + /** + * Creates a path from an entity to a specified location within a minimum distance + */ + public PathEntity createEntityPathTo(Entity p_75859_1_, int p_75859_2_, int p_75859_3_, int p_75859_4_, float p_75859_5_) + { + return this.createEntityPathTo(p_75859_1_, (double)((float)p_75859_2_ + 0.5F), (double)((float)p_75859_3_ + 0.5F), (double)((float)p_75859_4_ + 0.5F), p_75859_5_); + } + + /** + * Internal implementation of creating a path from an entity to a point + */ + private PathEntity createEntityPathTo(Entity p_75857_1_, double p_75857_2_, double p_75857_4_, double p_75857_6_, float p_75857_8_) + { + this.path.clearPath(); + this.pointMap.clearMap(); + boolean flag = this.isPathingInWater; + int i = MathHelper.floor_double(p_75857_1_.boundingBox.minY + 0.5D); + + if (this.canEntityDrown && p_75857_1_.isInWater()) + { + i = (int)p_75857_1_.boundingBox.minY; + + for (Block block = this.worldMap.getBlock(MathHelper.floor_double(p_75857_1_.posX), i, MathHelper.floor_double(p_75857_1_.posZ)); block == Blocks.flowing_water || block == Blocks.water; block = this.worldMap.getBlock(MathHelper.floor_double(p_75857_1_.posX), i, MathHelper.floor_double(p_75857_1_.posZ))) + { + ++i; + } + + flag = this.isPathingInWater; + this.isPathingInWater = false; + } + else + { + i = MathHelper.floor_double(p_75857_1_.boundingBox.minY + 0.5D); + } + + PathPoint pathpoint2 = this.openPoint(MathHelper.floor_double(p_75857_1_.boundingBox.minX), i, MathHelper.floor_double(p_75857_1_.boundingBox.minZ)); + PathPoint pathpoint = this.openPoint(MathHelper.floor_double(p_75857_2_ - (double)(p_75857_1_.width / 2.0F)), MathHelper.floor_double(p_75857_4_), MathHelper.floor_double(p_75857_6_ - (double)(p_75857_1_.width / 2.0F))); + PathPoint pathpoint1 = new PathPoint(MathHelper.floor_float(p_75857_1_.width + 1.0F), MathHelper.floor_float(p_75857_1_.height + 1.0F), MathHelper.floor_float(p_75857_1_.width + 1.0F)); + PathEntity pathentity = this.addToPath(p_75857_1_, pathpoint2, pathpoint, pathpoint1, p_75857_8_); + this.isPathingInWater = flag; + return pathentity; + } + + /** + * Adds a path from start to end and returns the whole path (args: unused, start, end, unused, maxDistance) + */ + private PathEntity addToPath(Entity p_75861_1_, PathPoint p_75861_2_, PathPoint p_75861_3_, PathPoint p_75861_4_, float p_75861_5_) + { + p_75861_2_.totalPathDistance = 0.0F; + p_75861_2_.distanceToNext = p_75861_2_.distanceToSquared(p_75861_3_); + p_75861_2_.distanceToTarget = p_75861_2_.distanceToNext; + this.path.clearPath(); + this.path.addPoint(p_75861_2_); + PathPoint pathpoint3 = p_75861_2_; + + while (!this.path.isPathEmpty()) + { + PathPoint pathpoint4 = this.path.dequeue(); + + if (pathpoint4.equals(p_75861_3_)) + { + return this.createEntityPath(p_75861_2_, p_75861_3_); + } + + if (pathpoint4.distanceToSquared(p_75861_3_) < pathpoint3.distanceToSquared(p_75861_3_)) + { + pathpoint3 = pathpoint4; + } + + pathpoint4.isFirst = true; + int i = this.findPathOptions(p_75861_1_, pathpoint4, p_75861_4_, p_75861_3_, p_75861_5_); + + for (int j = 0; j < i; ++j) + { + PathPoint pathpoint5 = this.pathOptions[j]; + float f1 = pathpoint4.totalPathDistance + pathpoint4.distanceToSquared(pathpoint5); + + if (!pathpoint5.isAssigned() || f1 < pathpoint5.totalPathDistance) + { + pathpoint5.previous = pathpoint4; + pathpoint5.totalPathDistance = f1; + pathpoint5.distanceToNext = pathpoint5.distanceToSquared(p_75861_3_); + + if (pathpoint5.isAssigned()) + { + this.path.changeDistance(pathpoint5, pathpoint5.totalPathDistance + pathpoint5.distanceToNext); + } + else + { + pathpoint5.distanceToTarget = pathpoint5.totalPathDistance + pathpoint5.distanceToNext; + this.path.addPoint(pathpoint5); + } + } + } + } + + if (pathpoint3 == p_75861_2_) + { + return null; + } + else + { + return this.createEntityPath(p_75861_2_, pathpoint3); + } + } + + /** + * populates pathOptions with available points and returns the number of options found (args: unused1, currentPoint, + * unused2, targetPoint, maxDistance) + */ + private int findPathOptions(Entity p_75860_1_, PathPoint p_75860_2_, PathPoint p_75860_3_, PathPoint p_75860_4_, float p_75860_5_) + { + int i = 0; + byte b0 = 0; + + if (this.getVerticalOffset(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord + 1, p_75860_2_.zCoord, p_75860_3_) == 1) + { + b0 = 1; + } + + PathPoint pathpoint3 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord, p_75860_2_.zCoord + 1, p_75860_3_, b0); + PathPoint pathpoint4 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord - 1, p_75860_2_.yCoord, p_75860_2_.zCoord, p_75860_3_, b0); + PathPoint pathpoint5 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord + 1, p_75860_2_.yCoord, p_75860_2_.zCoord, p_75860_3_, b0); + PathPoint pathpoint6 = this.getSafePoint(p_75860_1_, p_75860_2_.xCoord, p_75860_2_.yCoord, p_75860_2_.zCoord - 1, p_75860_3_, b0); + + if (pathpoint3 != null && !pathpoint3.isFirst && pathpoint3.distanceTo(p_75860_4_) < p_75860_5_) + { + this.pathOptions[i++] = pathpoint3; + } + + if (pathpoint4 != null && !pathpoint4.isFirst && pathpoint4.distanceTo(p_75860_4_) < p_75860_5_) + { + this.pathOptions[i++] = pathpoint4; + } + + if (pathpoint5 != null && !pathpoint5.isFirst && pathpoint5.distanceTo(p_75860_4_) < p_75860_5_) + { + this.pathOptions[i++] = pathpoint5; + } + + if (pathpoint6 != null && !pathpoint6.isFirst && pathpoint6.distanceTo(p_75860_4_) < p_75860_5_) + { + this.pathOptions[i++] = pathpoint6; + } + + return i; + } + + /** + * Returns a point that the entity can safely move to + */ + private PathPoint getSafePoint(Entity p_75858_1_, int p_75858_2_, int p_75858_3_, int p_75858_4_, PathPoint p_75858_5_, int p_75858_6_) + { + PathPoint pathpoint1 = null; + int i1 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_, p_75858_4_, p_75858_5_); + + if (i1 == 2) + { + return this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } + else + { + if (i1 == 1) + { + pathpoint1 = this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } + + if (pathpoint1 == null && p_75858_6_ > 0 && i1 != -3 && i1 != -4 && this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_ + p_75858_6_, p_75858_4_, p_75858_5_) == 1) + { + pathpoint1 = this.openPoint(p_75858_2_, p_75858_3_ + p_75858_6_, p_75858_4_); + p_75858_3_ += p_75858_6_; + } + + if (pathpoint1 != null) + { + int j1 = 0; + int k1 = 0; + + while (p_75858_3_ > 0) + { + k1 = this.getVerticalOffset(p_75858_1_, p_75858_2_, p_75858_3_ - 1, p_75858_4_, p_75858_5_); + + if (this.isPathingInWater && k1 == -1) + { + return null; + } + + if (k1 != 1) + { + break; + } + + if (j1++ >= p_75858_1_.getMaxSafePointTries()) + { + return null; + } + + --p_75858_3_; + + if (p_75858_3_ > 0) + { + pathpoint1 = this.openPoint(p_75858_2_, p_75858_3_, p_75858_4_); + } + } + + if (k1 == -2) + { + return null; + } + } + + return pathpoint1; + } + } + + /** + * Returns a mapped point or creates and adds one + */ + private final PathPoint openPoint(int p_75854_1_, int p_75854_2_, int p_75854_3_) + { + int l = PathPoint.makeHash(p_75854_1_, p_75854_2_, p_75854_3_); + PathPoint pathpoint = (PathPoint)this.pointMap.lookup(l); + + if (pathpoint == null) + { + pathpoint = new PathPoint(p_75854_1_, p_75854_2_, p_75854_3_); + this.pointMap.addKey(l, pathpoint); + } + + return pathpoint; + } + + /** + * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block, + * -1 for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if + * otherwise clear except for open trapdoor or water(if not avoiding) + */ + public int getVerticalOffset(Entity p_75855_1_, int p_75855_2_, int p_75855_3_, int p_75855_4_, PathPoint p_75855_5_) + { + return func_82565_a(p_75855_1_, p_75855_2_, p_75855_3_, p_75855_4_, p_75855_5_, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); + } + + public static int func_82565_a(Entity p_82565_0_, int p_82565_1_, int p_82565_2_, int p_82565_3_, PathPoint p_82565_4_, boolean p_82565_5_, boolean p_82565_6_, boolean p_82565_7_) + { + boolean flag3 = false; + + for (int l = p_82565_1_; l < p_82565_1_ + p_82565_4_.xCoord; ++l) + { + for (int i1 = p_82565_2_; i1 < p_82565_2_ + p_82565_4_.yCoord; ++i1) + { + for (int j1 = p_82565_3_; j1 < p_82565_3_ + p_82565_4_.zCoord; ++j1) + { + Block block = p_82565_0_.worldObj.getBlock(l, i1, j1); + + if (block.getMaterial() != Material.air) + { + if (block == Blocks.trapdoor) + { + flag3 = true; + } + else if (block != Blocks.flowing_water && block != Blocks.water) + { + if (!p_82565_7_ && block == Blocks.wooden_door) + { + return 0; + } + } + else + { + if (p_82565_5_) + { + return -1; + } + + flag3 = true; + } + + int k1 = block.getRenderType(); + + if (p_82565_0_.worldObj.getBlock(l, i1, j1).getRenderType() == 9) + { + int j2 = MathHelper.floor_double(p_82565_0_.posX); + int l1 = MathHelper.floor_double(p_82565_0_.posY); + int i2 = MathHelper.floor_double(p_82565_0_.posZ); + + if (p_82565_0_.worldObj.getBlock(j2, l1, i2).getRenderType() != 9 && p_82565_0_.worldObj.getBlock(j2, l1 - 1, i2).getRenderType() != 9) + { + return -3; + } + } + else if (!block.getBlocksMovement(p_82565_0_.worldObj, l, i1, j1) && (!p_82565_6_ || block != Blocks.wooden_door)) + { + if (k1 == 11 || block == Blocks.fence_gate || k1 == 32) + { + return -3; + } + + if (block == Blocks.trapdoor) + { + return -4; + } + + Material material = block.getMaterial(); + + if (material != Material.lava) + { + return 0; + } + + if (!p_82565_0_.handleLavaMovement()) + { + return -2; + } + } + } + } + } + } + + return flag3 ? 2 : 1; + } + + /** + * Returns a new PathEntity for a given start and end point + */ + private PathEntity createEntityPath(PathPoint p_75853_1_, PathPoint p_75853_2_) + { + int i = 1; + PathPoint pathpoint2; + + for (pathpoint2 = p_75853_2_; pathpoint2.previous != null; pathpoint2 = pathpoint2.previous) + { + ++i; + } + + PathPoint[] apathpoint = new PathPoint[i]; + pathpoint2 = p_75853_2_; + --i; + + for (apathpoint[i] = p_75853_2_; pathpoint2.previous != null; apathpoint[i] = pathpoint2) + { + pathpoint2 = pathpoint2.previous; + --i; + } + + return new PathEntity(apathpoint); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathNavigate.java b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathNavigate.java new file mode 100644 index 0000000..27179fe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathNavigate.java @@ -0,0 +1,523 @@ +package net.minecraft.pathfinding; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class PathNavigate +{ + private EntityLiving theEntity; + private World worldObj; + /** The PathEntity being followed. */ + private PathEntity currentPath; + private double speed; + /** The number of blocks (extra) +/- in each axis that get pulled out as cache for the pathfinder's search space */ + private IAttributeInstance pathSearchRange; + private boolean noSunPathfind; + /** Time, in number of ticks, following the current path */ + private int totalTicks; + /** The time when the last position check was done (to detect successful movement) */ + private int ticksAtLastPos; + /** Coordinates of the entity's position last time a check was done (part of monitoring getting 'stuck') */ + private Vec3 lastPosCheck = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + /** Specifically, if a wooden door block is even considered to be passable by the pathfinder */ + private boolean canPassOpenWoodenDoors = true; + /** If door blocks are considered passable even when closed */ + private boolean canPassClosedWoodenDoors; + /** If water blocks are avoided (at least by the pathfinder) */ + private boolean avoidsWater; + /** + * If the entity can swim. Swimming AI enables this and the pathfinder will also cause the entity to swim straight + * upwards when underwater + */ + private boolean canSwim; + private static final String __OBFID = "CL_00001627"; + + public PathNavigate(EntityLiving p_i1671_1_, World p_i1671_2_) + { + this.theEntity = p_i1671_1_; + this.worldObj = p_i1671_2_; + this.pathSearchRange = p_i1671_1_.getEntityAttribute(SharedMonsterAttributes.followRange); + } + + public void setAvoidsWater(boolean p_75491_1_) + { + this.avoidsWater = p_75491_1_; + } + + public boolean getAvoidsWater() + { + return this.avoidsWater; + } + + public void setBreakDoors(boolean p_75498_1_) + { + this.canPassClosedWoodenDoors = p_75498_1_; + } + + /** + * Sets if the entity can enter open doors + */ + public void setEnterDoors(boolean p_75490_1_) + { + this.canPassOpenWoodenDoors = p_75490_1_; + } + + /** + * Returns true if the entity can break doors, false otherwise + */ + public boolean getCanBreakDoors() + { + return this.canPassClosedWoodenDoors; + } + + /** + * Sets if the path should avoid sunlight + */ + public void setAvoidSun(boolean p_75504_1_) + { + this.noSunPathfind = p_75504_1_; + } + + /** + * Sets the speed + */ + public void setSpeed(double p_75489_1_) + { + this.speed = p_75489_1_; + } + + /** + * Sets if the entity can swim + */ + public void setCanSwim(boolean p_75495_1_) + { + this.canSwim = p_75495_1_; + } + + /** + * Gets the maximum distance that the path finding will search in. + */ + public float getPathSearchRange() + { + return (float)this.pathSearchRange.getAttributeValue(); + } + + /** + * Returns the path to the given coordinates + */ + public PathEntity getPathToXYZ(double p_75488_1_, double p_75488_3_, double p_75488_5_) + { + return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(p_75488_1_), (int)p_75488_3_, MathHelper.floor_double(p_75488_5_), this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to XYZ. Returns true if successful. + */ + public boolean tryMoveToXYZ(double p_75492_1_, double p_75492_3_, double p_75492_5_, double p_75492_7_) + { + PathEntity pathentity = this.getPathToXYZ((double)MathHelper.floor_double(p_75492_1_), (double)((int)p_75492_3_), (double)MathHelper.floor_double(p_75492_5_)); + return this.setPath(pathentity, p_75492_7_); + } + + /** + * Returns the path to the given EntityLiving + */ + public PathEntity getPathToEntityLiving(Entity p_75494_1_) + { + return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, p_75494_1_, this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); + } + + /** + * Try to find and set a path to EntityLiving. Returns true if successful. + */ + public boolean tryMoveToEntityLiving(Entity p_75497_1_, double p_75497_2_) + { + PathEntity pathentity = this.getPathToEntityLiving(p_75497_1_); + return pathentity != null ? this.setPath(pathentity, p_75497_2_) : false; + } + + /** + * sets the active path data if path is 100% unique compared to old path, checks to adjust path for sun avoiding + * ents and stores end coords + */ + public boolean setPath(PathEntity p_75484_1_, double p_75484_2_) + { + if (p_75484_1_ == null) + { + this.currentPath = null; + return false; + } + else + { + if (!p_75484_1_.isSamePath(this.currentPath)) + { + this.currentPath = p_75484_1_; + } + + if (this.noSunPathfind) + { + this.removeSunnyPath(); + } + + if (this.currentPath.getCurrentPathLength() == 0) + { + return false; + } + else + { + this.speed = p_75484_2_; + Vec3 vec3 = this.getEntityPosition(); + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck.xCoord = vec3.xCoord; + this.lastPosCheck.yCoord = vec3.yCoord; + this.lastPosCheck.zCoord = vec3.zCoord; + return true; + } + } + } + + /** + * gets the actively used PathEntity + */ + public PathEntity getPath() + { + return this.currentPath; + } + + public void onUpdateNavigation() + { + ++this.totalTicks; + + if (!this.noPath()) + { + if (this.canNavigate()) + { + this.pathFollow(); + } + + if (!this.noPath()) + { + Vec3 vec3 = this.currentPath.getPosition(this.theEntity); + + if (vec3 != null) + { + this.theEntity.getMoveHelper().setMoveTo(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.speed); + } + } + } + } + + private void pathFollow() + { + Vec3 vec3 = this.getEntityPosition(); + int i = this.currentPath.getCurrentPathLength(); + + for (int j = this.currentPath.getCurrentPathIndex(); j < this.currentPath.getCurrentPathLength(); ++j) + { + if (this.currentPath.getPathPointFromIndex(j).yCoord != (int)vec3.yCoord) + { + i = j; + break; + } + } + + float f = this.theEntity.width * this.theEntity.width; + int k; + + for (k = this.currentPath.getCurrentPathIndex(); k < i; ++k) + { + if (vec3.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, k)) < (double)f) + { + this.currentPath.setCurrentPathIndex(k + 1); + } + } + + k = MathHelper.ceiling_float_int(this.theEntity.width); + int l = (int)this.theEntity.height + 1; + int i1 = k; + + for (int j1 = i - 1; j1 >= this.currentPath.getCurrentPathIndex(); --j1) + { + if (this.isDirectPathBetweenPoints(vec3, this.currentPath.getVectorFromIndex(this.theEntity, j1), k, l, i1)) + { + this.currentPath.setCurrentPathIndex(j1); + break; + } + } + + if (this.totalTicks - this.ticksAtLastPos > 100) + { + if (vec3.squareDistanceTo(this.lastPosCheck) < 2.25D) + { + this.clearPathEntity(); + } + + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck.xCoord = vec3.xCoord; + this.lastPosCheck.yCoord = vec3.yCoord; + this.lastPosCheck.zCoord = vec3.zCoord; + } + } + + /** + * If null path or reached the end + */ + public boolean noPath() + { + return this.currentPath == null || this.currentPath.isFinished(); + } + + /** + * sets active PathEntity to null + */ + public void clearPathEntity() + { + this.currentPath = null; + } + + private Vec3 getEntityPosition() + { + return Vec3.createVectorHelper(this.theEntity.posX, (double)this.getPathableYPos(), this.theEntity.posZ); + } + + /** + * Gets the safe pathing Y position for the entity depending on if it can path swim or not + */ + private int getPathableYPos() + { + if (this.theEntity.isInWater() && this.canSwim) + { + int i = (int)this.theEntity.boundingBox.minY; + Block block = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ)); + int j = 0; + + do + { + if (block != Blocks.flowing_water && block != Blocks.water) + { + return i; + } + + ++i; + block = this.worldObj.getBlock(MathHelper.floor_double(this.theEntity.posX), i, MathHelper.floor_double(this.theEntity.posZ)); + ++j; + } + while (j <= 16); + + return (int)this.theEntity.boundingBox.minY; + } + else + { + return (int)(this.theEntity.boundingBox.minY + 0.5D); + } + } + + /** + * If on ground or swimming and can swim + */ + private boolean canNavigate() + { + return this.theEntity.onGround || this.canSwim && this.isInLiquid() || this.theEntity.isRiding() && this.theEntity instanceof EntityZombie && this.theEntity.ridingEntity instanceof EntityChicken; + } + + /** + * Returns true if the entity is in water or lava, false otherwise + */ + private boolean isInLiquid() + { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + + /** + * Trims path data from the end to the first sun covered block + */ + private void removeSunnyPath() + { + if (!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) + { + for (int i = 0; i < this.currentPath.getCurrentPathLength(); ++i) + { + PathPoint pathpoint = this.currentPath.getPathPointFromIndex(i); + + if (this.worldObj.canBlockSeeTheSky(pathpoint.xCoord, pathpoint.yCoord, pathpoint.zCoord)) + { + this.currentPath.setCurrentPathLength(i - 1); + return; + } + } + } + } + + /** + * Returns true when an entity of specified size could safely walk in a straight line between the two points. Args: + * pos1, pos2, entityXSize, entityYSize, entityZSize + */ + private boolean isDirectPathBetweenPoints(Vec3 p_75493_1_, Vec3 p_75493_2_, int p_75493_3_, int p_75493_4_, int p_75493_5_) + { + int l = MathHelper.floor_double(p_75493_1_.xCoord); + int i1 = MathHelper.floor_double(p_75493_1_.zCoord); + double d0 = p_75493_2_.xCoord - p_75493_1_.xCoord; + double d1 = p_75493_2_.zCoord - p_75493_1_.zCoord; + double d2 = d0 * d0 + d1 * d1; + + if (d2 < 1.0E-8D) + { + return false; + } + else + { + double d3 = 1.0D / Math.sqrt(d2); + d0 *= d3; + d1 *= d3; + p_75493_3_ += 2; + p_75493_5_ += 2; + + if (!this.isSafeToStandAt(l, (int)p_75493_1_.yCoord, i1, p_75493_3_, p_75493_4_, p_75493_5_, p_75493_1_, d0, d1)) + { + return false; + } + else + { + p_75493_3_ -= 2; + p_75493_5_ -= 2; + double d4 = 1.0D / Math.abs(d0); + double d5 = 1.0D / Math.abs(d1); + double d6 = (double)(l * 1) - p_75493_1_.xCoord; + double d7 = (double)(i1 * 1) - p_75493_1_.zCoord; + + if (d0 >= 0.0D) + { + ++d6; + } + + if (d1 >= 0.0D) + { + ++d7; + } + + d6 /= d0; + d7 /= d1; + int j1 = d0 < 0.0D ? -1 : 1; + int k1 = d1 < 0.0D ? -1 : 1; + int l1 = MathHelper.floor_double(p_75493_2_.xCoord); + int i2 = MathHelper.floor_double(p_75493_2_.zCoord); + int j2 = l1 - l; + int k2 = i2 - i1; + + do + { + if (j2 * j1 <= 0 && k2 * k1 <= 0) + { + return true; + } + + if (d6 < d7) + { + d6 += d4; + l += j1; + j2 = l1 - l; + } + else + { + d7 += d5; + i1 += k1; + k2 = i2 - i1; + } + } + while (this.isSafeToStandAt(l, (int)p_75493_1_.yCoord, i1, p_75493_3_, p_75493_4_, p_75493_5_, p_75493_1_, d0, d1)); + + return false; + } + } + } + + /** + * Returns true when an entity could stand at a position, including solid blocks under the entire entity. Args: + * xOffset, yOffset, zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ + */ + private boolean isSafeToStandAt(int p_75483_1_, int p_75483_2_, int p_75483_3_, int p_75483_4_, int p_75483_5_, int p_75483_6_, Vec3 p_75483_7_, double p_75483_8_, double p_75483_10_) + { + int k1 = p_75483_1_ - p_75483_4_ / 2; + int l1 = p_75483_3_ - p_75483_6_ / 2; + + if (!this.isPositionClear(k1, p_75483_2_, l1, p_75483_4_, p_75483_5_, p_75483_6_, p_75483_7_, p_75483_8_, p_75483_10_)) + { + return false; + } + else + { + for (int i2 = k1; i2 < k1 + p_75483_4_; ++i2) + { + for (int j2 = l1; j2 < l1 + p_75483_6_; ++j2) + { + double d2 = (double)i2 + 0.5D - p_75483_7_.xCoord; + double d3 = (double)j2 + 0.5D - p_75483_7_.zCoord; + + if (d2 * p_75483_8_ + d3 * p_75483_10_ >= 0.0D) + { + Block block = this.worldObj.getBlock(i2, p_75483_2_ - 1, j2); + Material material = block.getMaterial(); + + if (material == Material.air) + { + return false; + } + + if (material == Material.water && !this.theEntity.isInWater()) + { + return false; + } + + if (material == Material.lava) + { + return false; + } + } + } + } + + return true; + } + } + + /** + * Returns true if an entity does not collide with any solid blocks at the position. Args: xOffset, yOffset, + * zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ + */ + private boolean isPositionClear(int p_75496_1_, int p_75496_2_, int p_75496_3_, int p_75496_4_, int p_75496_5_, int p_75496_6_, Vec3 p_75496_7_, double p_75496_8_, double p_75496_10_) + { + for (int k1 = p_75496_1_; k1 < p_75496_1_ + p_75496_4_; ++k1) + { + for (int l1 = p_75496_2_; l1 < p_75496_2_ + p_75496_5_; ++l1) + { + for (int i2 = p_75496_3_; i2 < p_75496_3_ + p_75496_6_; ++i2) + { + double d2 = (double)k1 + 0.5D - p_75496_7_.xCoord; + double d3 = (double)i2 + 0.5D - p_75496_7_.zCoord; + + if (d2 * p_75496_8_ + d3 * p_75496_10_ >= 0.0D) + { + Block block = this.worldObj.getBlock(k1, l1, i2); + + if (!block.getBlocksMovement(this.worldObj, k1, l1, i2)) + { + return false; + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathPoint.java b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathPoint.java new file mode 100644 index 0000000..ec450b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/pathfinding/PathPoint.java @@ -0,0 +1,94 @@ +package net.minecraft.pathfinding; + +import net.minecraft.util.MathHelper; + +public class PathPoint +{ + /** The x coordinate of this point */ + public final int xCoord; + /** The y coordinate of this point */ + public final int yCoord; + /** The z coordinate of this point */ + public final int zCoord; + /** A hash of the coordinates used to identify this point */ + private final int hash; + /** The index of this point in its assigned path */ + int index = -1; + /** The distance along the path to this point */ + float totalPathDistance; + /** The linear distance to the next point */ + float distanceToNext; + /** The distance to the target */ + float distanceToTarget; + /** The point preceding this in its assigned path */ + PathPoint previous; + /** Indicates this is the origin */ + public boolean isFirst; + private static final String __OBFID = "CL_00000574"; + + public PathPoint(int p_i2135_1_, int p_i2135_2_, int p_i2135_3_) + { + this.xCoord = p_i2135_1_; + this.yCoord = p_i2135_2_; + this.zCoord = p_i2135_3_; + this.hash = makeHash(p_i2135_1_, p_i2135_2_, p_i2135_3_); + } + + public static int makeHash(int p_75830_0_, int p_75830_1_, int p_75830_2_) + { + return p_75830_1_ & 255 | (p_75830_0_ & 32767) << 8 | (p_75830_2_ & 32767) << 24 | (p_75830_0_ < 0 ? Integer.MIN_VALUE : 0) | (p_75830_2_ < 0 ? 32768 : 0); + } + + /** + * Returns the linear distance to another path point + */ + public float distanceTo(PathPoint p_75829_1_) + { + float f = (float)(p_75829_1_.xCoord - this.xCoord); + float f1 = (float)(p_75829_1_.yCoord - this.yCoord); + float f2 = (float)(p_75829_1_.zCoord - this.zCoord); + return MathHelper.sqrt_float(f * f + f1 * f1 + f2 * f2); + } + + /** + * Returns the squared distance to another path point + */ + public float distanceToSquared(PathPoint p_75832_1_) + { + float f = (float)(p_75832_1_.xCoord - this.xCoord); + float f1 = (float)(p_75832_1_.yCoord - this.yCoord); + float f2 = (float)(p_75832_1_.zCoord - this.zCoord); + return f * f + f1 * f1 + f2 * f2; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof PathPoint)) + { + return false; + } + else + { + PathPoint pathpoint = (PathPoint)p_equals_1_; + return this.hash == pathpoint.hash && this.xCoord == pathpoint.xCoord && this.yCoord == pathpoint.yCoord && this.zCoord == pathpoint.zCoord; + } + } + + public int hashCode() + { + return this.hash; + } + + /** + * Returns true if this point has already been assigned to a path + */ + public boolean isAssigned() + { + return this.index >= 0; + } + + public String toString() + { + return this.xCoord + ", " + this.yCoord + ", " + this.zCoord; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/Potion.java b/build/rfg/minecraft-src/java/net/minecraft/potion/Potion.java new file mode 100644 index 0000000..85243b2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/Potion.java @@ -0,0 +1,382 @@ +package net.minecraft.potion; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.StringUtils; + +public class Potion +{ + /** The array of potion types. */ + public static final Potion[] potionTypes = new Potion[32]; + public static final Potion field_76423_b = null; + public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); + public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); + public static final Potion digSpeed = (new Potion(3, false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); + public static final Potion digSlowdown = (new Potion(4, true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); + public static final Potion damageBoost = (new PotionAttackDamage(5, false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3.0D, 2); + public static final Potion heal = (new PotionHealth(6, false, 16262179)).setPotionName("potion.heal"); + public static final Potion harm = (new PotionHealth(7, true, 4393481)).setPotionName("potion.harm"); + public static final Potion jump = (new Potion(8, false, 7889559)).setPotionName("potion.jump").setIconIndex(2, 1); + public static final Potion confusion = (new Potion(9, true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); + /** The regeneration Potion object. */ + public static final Potion regeneration = (new Potion(10, false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); + public static final Potion resistance = (new Potion(11, false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); + /** The fire resistance Potion object. */ + public static final Potion fireResistance = (new Potion(12, false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); + /** The water breathing Potion object. */ + public static final Potion waterBreathing = (new Potion(13, false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); + /** The invisibility Potion object. */ + public static final Potion invisibility = (new Potion(14, false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); + /** The blindness Potion object. */ + public static final Potion blindness = (new Potion(15, true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); + /** The night vision Potion object. */ + public static final Potion nightVision = (new Potion(16, false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); + /** The hunger Potion object. */ + public static final Potion hunger = (new Potion(17, true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); + /** The weakness Potion object. */ + public static final Potion weakness = (new PotionAttackDamage(18, true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); + /** The poison Potion object. */ + public static final Potion poison = (new Potion(19, true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); + /** The wither Potion object. */ + public static final Potion wither = (new Potion(20, true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); + public static final Potion field_76434_w = (new PotionHealthBoost(21, false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).func_111184_a(SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); + public static final Potion field_76444_x = (new PotionAbsoption(22, false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); + public static final Potion field_76443_y = (new PotionHealth(23, false, 16262179)).setPotionName("potion.saturation"); + public static final Potion field_76442_z = null; + public static final Potion field_76409_A = null; + public static final Potion field_76410_B = null; + public static final Potion field_76411_C = null; + public static final Potion field_76405_D = null; + public static final Potion field_76406_E = null; + public static final Potion field_76407_F = null; + public static final Potion field_76408_G = null; + /** The Id of a Potion object. */ + public final int id; + private final Map field_111188_I = Maps.newHashMap(); + /** This field indicated if the effect is 'bad' - negative - for the entity. */ + private final boolean isBadEffect; + /** Is the color of the liquid for this potion. */ + private final int liquidColor; + /** The name of the Potion. */ + private String name = ""; + /** The index for the icon displayed when the potion effect is active. */ + private int statusIconIndex = -1; + private double effectiveness; + private boolean usable; + private static final String __OBFID = "CL_00001528"; + + protected Potion(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_) + { + this.id = p_i1573_1_; + potionTypes[p_i1573_1_] = this; + this.isBadEffect = p_i1573_2_; + + if (p_i1573_2_) + { + this.effectiveness = 0.5D; + } + else + { + this.effectiveness = 1.0D; + } + + this.liquidColor = p_i1573_3_; + } + + /** + * Sets the index for the icon displayed in the player's inventory when the status is active. + */ + protected Potion setIconIndex(int p_76399_1_, int p_76399_2_) + { + this.statusIconIndex = p_76399_1_ + p_76399_2_ * 8; + return this; + } + + /** + * returns the ID of the potion + */ + public int getId() + { + return this.id; + } + + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) + { + if (this.id == regeneration.id) + { + if (p_76394_1_.getHealth() < p_76394_1_.getMaxHealth()) + { + p_76394_1_.heal(1.0F); + } + } + else if (this.id == poison.id) + { + if (p_76394_1_.getHealth() > 1.0F) + { + p_76394_1_.attackEntityFrom(DamageSource.magic, 1.0F); + } + } + else if (this.id == wither.id) + { + p_76394_1_.attackEntityFrom(DamageSource.wither, 1.0F); + } + else if (this.id == hunger.id && p_76394_1_ instanceof EntityPlayer) + { + ((EntityPlayer)p_76394_1_).addExhaustion(0.025F * (float)(p_76394_2_ + 1)); + } + else if (this.id == field_76443_y.id && p_76394_1_ instanceof EntityPlayer) + { + if (!p_76394_1_.worldObj.isRemote) + { + ((EntityPlayer)p_76394_1_).getFoodStats().addStats(p_76394_2_ + 1, 1.0F); + } + } + else if ((this.id != heal.id || p_76394_1_.isEntityUndead()) && (this.id != harm.id || !p_76394_1_.isEntityUndead())) + { + if (this.id == harm.id && !p_76394_1_.isEntityUndead() || this.id == heal.id && p_76394_1_.isEntityUndead()) + { + p_76394_1_.attackEntityFrom(DamageSource.magic, (float)(6 << p_76394_2_)); + } + } + else + { + p_76394_1_.heal((float)Math.max(4 << p_76394_2_, 0)); + } + } + + /** + * Hits the provided entity with this potion's instant effect. + */ + public void affectEntity(EntityLivingBase p_76402_1_, EntityLivingBase p_76402_2_, int p_76402_3_, double p_76402_4_) + { + int j; + + if ((this.id != heal.id || p_76402_2_.isEntityUndead()) && (this.id != harm.id || !p_76402_2_.isEntityUndead())) + { + if (this.id == harm.id && !p_76402_2_.isEntityUndead() || this.id == heal.id && p_76402_2_.isEntityUndead()) + { + j = (int)(p_76402_4_ * (double)(6 << p_76402_3_) + 0.5D); + + if (p_76402_1_ == null) + { + p_76402_2_.attackEntityFrom(DamageSource.magic, (float)j); + } + else + { + p_76402_2_.attackEntityFrom(DamageSource.causeIndirectMagicDamage(p_76402_2_, p_76402_1_), (float)j); + } + } + } + else + { + j = (int)(p_76402_4_ * (double)(4 << p_76402_3_) + 0.5D); + p_76402_2_.heal((float)j); + } + } + + /** + * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) + */ + public boolean isInstant() + { + return false; + } + + /** + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int p_76397_1_, int p_76397_2_) + { + int k; + + if (this.id == regeneration.id) + { + k = 50 >> p_76397_2_; + return k > 0 ? p_76397_1_ % k == 0 : true; + } + else if (this.id == poison.id) + { + k = 25 >> p_76397_2_; + return k > 0 ? p_76397_1_ % k == 0 : true; + } + else if (this.id == wither.id) + { + k = 40 >> p_76397_2_; + return k > 0 ? p_76397_1_ % k == 0 : true; + } + else + { + return this.id == hunger.id; + } + } + + /** + * Set the potion name. + */ + public Potion setPotionName(String p_76390_1_) + { + this.name = p_76390_1_; + return this; + } + + /** + * returns the name of the potion + */ + public String getName() + { + return this.name; + } + + protected Potion setEffectiveness(double p_76404_1_) + { + this.effectiveness = p_76404_1_; + return this; + } + + /** + * Returns true if the potion has a associated status icon to display in then inventory when active. + */ + @SideOnly(Side.CLIENT) + public boolean hasStatusIcon() + { + return this.statusIconIndex >= 0; + } + + /** + * Returns the index for the icon to display when the potion is active. + */ + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() + { + return this.statusIconIndex; + } + + /** + * This method returns true if the potion effect is bad - negative - for the entity. + */ + @SideOnly(Side.CLIENT) + public boolean isBadEffect() + { + return this.isBadEffect; + } + + @SideOnly(Side.CLIENT) + public static String getDurationString(PotionEffect p_76389_0_) + { + if (p_76389_0_.getIsPotionDurationMax()) + { + return "**:**"; + } + else + { + int i = p_76389_0_.getDuration(); + return StringUtils.ticksToElapsedTime(i); + } + } + + public double getEffectiveness() + { + return this.effectiveness; + } + + public boolean isUsable() + { + return this.usable; + } + + /** + * Returns the color of the potion liquid. + */ + public int getLiquidColor() + { + return this.liquidColor; + } + + public Potion func_111184_a(IAttribute p_111184_1_, String p_111184_2_, double p_111184_3_, int p_111184_5_) + { + AttributeModifier attributemodifier = new AttributeModifier(UUID.fromString(p_111184_2_), this.getName(), p_111184_3_, p_111184_5_); + this.field_111188_I.put(p_111184_1_, attributemodifier); + return this; + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) + { + Iterator iterator = this.field_111188_I.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + IAttributeInstance iattributeinstance = p_111187_2_.getAttributeInstance((IAttribute)entry.getKey()); + + if (iattributeinstance != null) + { + iattributeinstance.removeModifier((AttributeModifier)entry.getValue()); + } + } + } + + @SideOnly(Side.CLIENT) + public Map func_111186_k() + { + return this.field_111188_I; + } + + public void applyAttributesModifiersToEntity(EntityLivingBase p_111185_1_, BaseAttributeMap p_111185_2_, int p_111185_3_) + { + Iterator iterator = this.field_111188_I.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + IAttributeInstance iattributeinstance = p_111185_2_.getAttributeInstance((IAttribute)entry.getKey()); + + if (iattributeinstance != null) + { + AttributeModifier attributemodifier = (AttributeModifier)entry.getValue(); + iattributeinstance.removeModifier(attributemodifier); + iattributeinstance.applyModifier(new AttributeModifier(attributemodifier.getID(), this.getName() + " " + p_111185_3_, this.func_111183_a(p_111185_3_, attributemodifier), attributemodifier.getOperation())); + } + } + } + + public double func_111183_a(int p_111183_1_, AttributeModifier p_111183_2_) + { + return p_111183_2_.getAmount() * (double)(p_111183_1_ + 1); + } + + /* ======================================== FORGE START =====================================*/ + + /** + * If the standard PotionEffect text (name and duration) should be drawn when this potion is active. + * @param effect the active PotionEffect + * @return true to draw the standard text + */ + public boolean shouldRenderInvText(PotionEffect effect) + { + return true; + } + + /** + * 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 x the x coordinate + * @param y the y coordinate + * @param effect the active PotionEffect + * @param mc the Minecraft instance, for convenience + */ + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAbsoption.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAbsoption.java new file mode 100644 index 0000000..47ff4e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAbsoption.java @@ -0,0 +1,26 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; + +public class PotionAbsoption extends Potion +{ + private static final String __OBFID = "CL_00001524"; + + protected PotionAbsoption(int p_i1569_1_, boolean p_i1569_2_, int p_i1569_3_) + { + super(p_i1569_1_, p_i1569_2_, p_i1569_3_); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) + { + p_111187_1_.setAbsorptionAmount(p_111187_1_.getAbsorptionAmount() - (float)(4 * (p_111187_3_ + 1))); + super.removeAttributesModifiersFromEntity(p_111187_1_, p_111187_2_, p_111187_3_); + } + + public void applyAttributesModifiersToEntity(EntityLivingBase p_111185_1_, BaseAttributeMap p_111185_2_, int p_111185_3_) + { + p_111185_1_.setAbsorptionAmount(p_111185_1_.getAbsorptionAmount() + (float)(4 * (p_111185_3_ + 1))); + super.applyAttributesModifiersToEntity(p_111185_1_, p_111185_2_, p_111185_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAttackDamage.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAttackDamage.java new file mode 100644 index 0000000..da521c1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionAttackDamage.java @@ -0,0 +1,18 @@ +package net.minecraft.potion; + +import net.minecraft.entity.ai.attributes.AttributeModifier; + +public class PotionAttackDamage extends Potion +{ + private static final String __OBFID = "CL_00001525"; + + protected PotionAttackDamage(int p_i1570_1_, boolean p_i1570_2_, int p_i1570_3_) + { + super(p_i1570_1_, p_i1570_2_, p_i1570_3_); + } + + public double func_111183_a(int p_111183_1_, AttributeModifier p_111183_2_) + { + return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(p_111183_1_ + 1)) : 1.3D * (double)(p_111183_1_ + 1); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionEffect.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionEffect.java new file mode 100644 index 0000000..9eb11ef --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionEffect.java @@ -0,0 +1,296 @@ +package net.minecraft.potion; + +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class PotionEffect +{ + /** ID value of the potion this effect matches. */ + private int potionID; + /** The duration of the potion effect */ + private int duration; + /** The amplifier of the potion effect */ + private int amplifier; + /** Whether the potion is a splash potion */ + private boolean isSplashPotion; + /** Whether the potion effect came from a beacon */ + private boolean isAmbient; + /** True if potion effect duration is at maximum, false otherwise. */ + @SideOnly(Side.CLIENT) + private boolean isPotionDurationMax; + private static final String __OBFID = "CL_00001529"; + /** List of ItemStack that can cure the potion effect **/ + private List curativeItems; + + public PotionEffect(int p_i1574_1_, int p_i1574_2_) + { + this(p_i1574_1_, p_i1574_2_, 0); + } + + public PotionEffect(int p_i1575_1_, int p_i1575_2_, int p_i1575_3_) + { + this(p_i1575_1_, p_i1575_2_, p_i1575_3_, false); + } + + public PotionEffect(int p_i1576_1_, int p_i1576_2_, int p_i1576_3_, boolean p_i1576_4_) + { + this.potionID = p_i1576_1_; + this.duration = p_i1576_2_; + this.amplifier = p_i1576_3_; + this.isAmbient = p_i1576_4_; + this.curativeItems = new ArrayList(); + this.curativeItems.add(new ItemStack(Items.milk_bucket)); + } + + public PotionEffect(PotionEffect p_i1577_1_) + { + this.potionID = p_i1577_1_.potionID; + this.duration = p_i1577_1_.duration; + this.amplifier = p_i1577_1_.amplifier; + this.curativeItems = p_i1577_1_.curativeItems; + } + + /** + * merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier. The duration in the supplied + * potion effect is assumed to be greater. + */ + public void combine(PotionEffect p_76452_1_) + { + if (this.potionID != p_76452_1_.potionID) + { + System.err.println("This method should only be called for matching effects!"); + } + + if (p_76452_1_.amplifier > this.amplifier) + { + this.amplifier = p_76452_1_.amplifier; + this.duration = p_76452_1_.duration; + } + else if (p_76452_1_.amplifier == this.amplifier && this.duration < p_76452_1_.duration) + { + this.duration = p_76452_1_.duration; + } + else if (!p_76452_1_.isAmbient && this.isAmbient) + { + this.isAmbient = p_76452_1_.isAmbient; + } + } + + /** + * Retrieve the ID of the potion this effect matches. + */ + public int getPotionID() + { + return this.potionID; + } + + public int getDuration() + { + return this.duration; + } + + public int getAmplifier() + { + return this.amplifier; + } + + /** + * Set whether this potion is a splash potion. + */ + public void setSplashPotion(boolean p_82721_1_) + { + this.isSplashPotion = p_82721_1_; + } + + /** + * Gets whether this potion effect originated from a beacon + */ + public boolean getIsAmbient() + { + return this.isAmbient; + } + + public boolean onUpdate(EntityLivingBase p_76455_1_) + { + if (this.duration > 0) + { + if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) + { + this.performEffect(p_76455_1_); + } + + this.deincrementDuration(); + } + + return this.duration > 0; + } + + private int deincrementDuration() + { + return --this.duration; + } + + public void performEffect(EntityLivingBase p_76457_1_) + { + if (this.duration > 0) + { + Potion.potionTypes[this.potionID].performEffect(p_76457_1_, this.amplifier); + } + } + + public String getEffectName() + { + return Potion.potionTypes[this.potionID].getName(); + } + + public int hashCode() + { + return this.potionID; + } + + public String toString() + { + String s = ""; + + if (this.getAmplifier() > 0) + { + s = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); + } + else + { + s = this.getEffectName() + ", Duration: " + this.getDuration(); + } + + if (this.isSplashPotion) + { + s = s + ", Splash: true"; + } + + return Potion.potionTypes[this.potionID].isUsable() ? "(" + s + ")" : s; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof PotionEffect)) + { + return false; + } + else + { + PotionEffect potioneffect = (PotionEffect)p_equals_1_; + return this.potionID == potioneffect.potionID && this.amplifier == potioneffect.amplifier && this.duration == potioneffect.duration && this.isSplashPotion == potioneffect.isSplashPotion && this.isAmbient == potioneffect.isAmbient; + } + } + + /** + * Write a custom potion effect to a potion item's NBT data. + */ + public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound p_82719_1_) + { + p_82719_1_.setByte("Id", (byte)this.getPotionID()); + p_82719_1_.setByte("Amplifier", (byte)this.getAmplifier()); + p_82719_1_.setInteger("Duration", this.getDuration()); + p_82719_1_.setBoolean("Ambient", this.getIsAmbient()); + return p_82719_1_; + } + + /** + * Read a custom potion effect from a potion item's NBT data. + */ + public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound p_82722_0_) + { + byte b0 = p_82722_0_.getByte("Id"); + + if (b0 >= 0 && b0 < Potion.potionTypes.length && Potion.potionTypes[b0] != null) + { + byte b1 = p_82722_0_.getByte("Amplifier"); + int i = p_82722_0_.getInteger("Duration"); + boolean flag = p_82722_0_.getBoolean("Ambient"); + return new PotionEffect(b0, i, b1, flag); + } + else + { + return null; + } + } + + /** + * Toggle the isPotionDurationMax field. + */ + @SideOnly(Side.CLIENT) + public void setPotionDurationMax(boolean p_100012_1_) + { + this.isPotionDurationMax = p_100012_1_; + } + + @SideOnly(Side.CLIENT) + public boolean getIsPotionDurationMax() + { + return this.isPotionDurationMax; + } + + /* ======================================== FORGE START =====================================*/ + /*** + * Returns a list of curative items for the potion effect + * @return The list (ItemStack) of curative items for the potion effect + */ + public List getCurativeItems() + { + return this.curativeItems; + } + + /*** + * Checks the given ItemStack to see if it is in the list of curative items for the potion effect + * @param stack The ItemStack being checked against the list of curative items for the potion effect + * @return true if the given ItemStack is in the list of curative items for the potion effect, false otherwise + */ + public boolean isCurativeItem(ItemStack stack) + { + boolean found = false; + for (ItemStack curativeItem : this.curativeItems) + { + if (curativeItem.isItemEqual(stack)) + { + found = true; + } + } + + return found; + } + + /*** + * Sets the array of curative items for the potion effect + * @param curativeItems The list of ItemStacks being set to the potion effect + */ + public void setCurativeItems(List curativeItems) + { + this.curativeItems = curativeItems; + } + + /*** + * Adds the given stack to list of curative items for the potion effect + * @param stack The ItemStack being added to the curative item list + */ + public void addCurativeItem(ItemStack stack) + { + boolean found = false; + for (ItemStack curativeItem : this.curativeItems) + { + if (curativeItem.isItemEqual(stack)) + { + found = true; + } + } + if (!found) + { + this.curativeItems.add(stack); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealth.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealth.java new file mode 100644 index 0000000..7b12e43 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealth.java @@ -0,0 +1,27 @@ +package net.minecraft.potion; + +public class PotionHealth extends Potion +{ + private static final String __OBFID = "CL_00001527"; + + public PotionHealth(int p_i1572_1_, boolean p_i1572_2_, int p_i1572_3_) + { + super(p_i1572_1_, p_i1572_2_, p_i1572_3_); + } + + /** + * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) + */ + public boolean isInstant() + { + return true; + } + + /** + * checks if Potion effect is ready to be applied this tick. + */ + public boolean isReady(int p_76397_1_, int p_76397_2_) + { + return p_76397_1_ >= 1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealthBoost.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealthBoost.java new file mode 100644 index 0000000..b0c6722 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHealthBoost.java @@ -0,0 +1,24 @@ +package net.minecraft.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.attributes.BaseAttributeMap; + +public class PotionHealthBoost extends Potion +{ + private static final String __OBFID = "CL_00001526"; + + public PotionHealthBoost(int p_i1571_1_, boolean p_i1571_2_, int p_i1571_3_) + { + super(p_i1571_1_, p_i1571_2_, p_i1571_3_); + } + + public void removeAttributesModifiersFromEntity(EntityLivingBase p_111187_1_, BaseAttributeMap p_111187_2_, int p_111187_3_) + { + super.removeAttributesModifiersFromEntity(p_111187_1_, p_111187_2_, p_111187_3_); + + if (p_111187_1_.getHealth() > p_111187_1_.getMaxHealth()) + { + p_111187_1_.setHealth(p_111187_1_.getMaxHealth()); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHelper.java b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHelper.java new file mode 100644 index 0000000..91330f6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/potion/PotionHelper.java @@ -0,0 +1,613 @@ +package net.minecraft.potion; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +public class PotionHelper +{ + public static final String field_77924_a = null; + public static final String sugarEffect; + public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; + public static final String spiderEyeEffect; + public static final String fermentedSpiderEyeEffect; + public static final String speckledMelonEffect; + public static final String blazePowderEffect; + public static final String magmaCreamEffect; + public static final String redstoneEffect; + public static final String glowstoneEffect; + public static final String gunpowderEffect; + public static final String goldenCarrotEffect; + public static final String field_151423_m; + private static final HashMap potionRequirements = new HashMap(); + /** Potion effect amplifier map */ + private static final HashMap potionAmplifiers = new HashMap(); + private static final HashMap field_77925_n; + /** An array of possible potion prefix names, as translation IDs. */ + private static final String[] potionPrefixes; + private static final String __OBFID = "CL_00000078"; + + /** + * Is the bit given set to 1? + */ + public static boolean checkFlag(int p_77914_0_, int p_77914_1_) + { + return (p_77914_0_ & 1 << p_77914_1_) != 0; + } + + /** + * Returns 1 if the flag is set, 0 if it is not set. + */ + private static int isFlagSet(int p_77910_0_, int p_77910_1_) + { + return checkFlag(p_77910_0_, p_77910_1_) ? 1 : 0; + } + + /** + * Returns 0 if the flag is set, 1 if it is not set. + */ + private static int isFlagUnset(int p_77916_0_, int p_77916_1_) + { + return checkFlag(p_77916_0_, p_77916_1_) ? 0 : 1; + } + + public static int func_77909_a(int p_77909_0_) + { + return func_77908_a(p_77909_0_, 5, 4, 3, 2, 1); + } + + /** + * Given a {@link Collection}<{@link PotionEffect}> will return an Integer color. + */ + public static int calcPotionLiquidColor(Collection p_77911_0_) + { + int i = 3694022; + + if (p_77911_0_ != null && !p_77911_0_.isEmpty()) + { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + float f3 = 0.0F; + Iterator iterator = p_77911_0_.iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + int j = Potion.potionTypes[potioneffect.getPotionID()].getLiquidColor(); + + for (int k = 0; k <= potioneffect.getAmplifier(); ++k) + { + f += (float)(j >> 16 & 255) / 255.0F; + f1 += (float)(j >> 8 & 255) / 255.0F; + f2 += (float)(j >> 0 & 255) / 255.0F; + ++f3; + } + } + + f = f / f3 * 255.0F; + f1 = f1 / f3 * 255.0F; + f2 = f2 / f3 * 255.0F; + return (int)f << 16 | (int)f1 << 8 | (int)f2; + } + else + { + return i; + } + } + + public static boolean func_82817_b(Collection p_82817_0_) + { + Iterator iterator = p_82817_0_.iterator(); + PotionEffect potioneffect; + + do + { + if (!iterator.hasNext()) + { + return true; + } + + potioneffect = (PotionEffect)iterator.next(); + } + while (potioneffect.getIsAmbient()); + + return false; + } + + @SideOnly(Side.CLIENT) + public static int func_77915_a(int p_77915_0_, boolean p_77915_1_) + { + if (!p_77915_1_) + { + if (field_77925_n.containsKey(Integer.valueOf(p_77915_0_))) + { + return ((Integer)field_77925_n.get(Integer.valueOf(p_77915_0_))).intValue(); + } + else + { + int j = calcPotionLiquidColor(getPotionEffects(p_77915_0_, false)); + field_77925_n.put(Integer.valueOf(p_77915_0_), Integer.valueOf(j)); + return j; + } + } + else + { + return calcPotionLiquidColor(getPotionEffects(p_77915_0_, p_77915_1_)); + } + } + + public static String func_77905_c(int p_77905_0_) + { + int j = func_77909_a(p_77905_0_); + return potionPrefixes[j]; + } + + private static int func_77904_a(boolean p_77904_0_, boolean p_77904_1_, boolean p_77904_2_, int p_77904_3_, int p_77904_4_, int p_77904_5_, int p_77904_6_) + { + int i1 = 0; + + if (p_77904_0_) + { + i1 = isFlagUnset(p_77904_6_, p_77904_4_); + } + else if (p_77904_3_ != -1) + { + if (p_77904_3_ == 0 && countSetFlags(p_77904_6_) == p_77904_4_) + { + i1 = 1; + } + else if (p_77904_3_ == 1 && countSetFlags(p_77904_6_) > p_77904_4_) + { + i1 = 1; + } + else if (p_77904_3_ == 2 && countSetFlags(p_77904_6_) < p_77904_4_) + { + i1 = 1; + } + } + else + { + i1 = isFlagSet(p_77904_6_, p_77904_4_); + } + + if (p_77904_1_) + { + i1 *= p_77904_5_; + } + + if (p_77904_2_) + { + i1 *= -1; + } + + return i1; + } + + /** + * Count the number of bits in an integer set to ON. + */ + private static int countSetFlags(int p_77907_0_) + { + int j; + + for (j = 0; p_77907_0_ > 0; ++j) + { + p_77907_0_ &= p_77907_0_ - 1; + } + + return j; + } + + private static int parsePotionEffects(String p_77912_0_, int p_77912_1_, int p_77912_2_, int p_77912_3_) + { + if (p_77912_1_ < p_77912_0_.length() && p_77912_2_ >= 0 && p_77912_1_ < p_77912_2_) + { + int l = p_77912_0_.indexOf(124, p_77912_1_); + int i1; + int j2; + + if (l >= 0 && l < p_77912_2_) + { + i1 = parsePotionEffects(p_77912_0_, p_77912_1_, l - 1, p_77912_3_); + + if (i1 > 0) + { + return i1; + } + else + { + j2 = parsePotionEffects(p_77912_0_, l + 1, p_77912_2_, p_77912_3_); + return j2 > 0 ? j2 : 0; + } + } + else + { + i1 = p_77912_0_.indexOf(38, p_77912_1_); + + if (i1 >= 0 && i1 < p_77912_2_) + { + j2 = parsePotionEffects(p_77912_0_, p_77912_1_, i1 - 1, p_77912_3_); + + if (j2 <= 0) + { + return 0; + } + else + { + int k2 = parsePotionEffects(p_77912_0_, i1 + 1, p_77912_2_, p_77912_3_); + return k2 <= 0 ? 0 : (j2 > k2 ? j2 : k2); + } + } + else + { + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + boolean flag4 = false; + byte b0 = -1; + int j1 = 0; + int k1 = 0; + int l1 = 0; + + for (int i2 = p_77912_1_; i2 < p_77912_2_; ++i2) + { + char c0 = p_77912_0_.charAt(i2); + + if (c0 >= 48 && c0 <= 57) + { + if (flag) + { + k1 = c0 - 48; + flag1 = true; + } + else + { + j1 *= 10; + j1 += c0 - 48; + flag2 = true; + } + } + else if (c0 == 42) + { + flag = true; + } + else if (c0 == 33) + { + if (flag2) + { + l1 += func_77904_a(flag3, flag1, flag4, b0, j1, k1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + k1 = 0; + j1 = 0; + b0 = -1; + } + + flag3 = true; + } + else if (c0 == 45) + { + if (flag2) + { + l1 += func_77904_a(flag3, flag1, flag4, b0, j1, k1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + k1 = 0; + j1 = 0; + b0 = -1; + } + + flag4 = true; + } + else if (c0 != 61 && c0 != 60 && c0 != 62) + { + if (c0 == 43 && flag2) + { + l1 += func_77904_a(flag3, flag1, flag4, b0, j1, k1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + k1 = 0; + j1 = 0; + b0 = -1; + } + } + else + { + if (flag2) + { + l1 += func_77904_a(flag3, flag1, flag4, b0, j1, k1, p_77912_3_); + flag3 = false; + flag4 = false; + flag = false; + flag1 = false; + flag2 = false; + k1 = 0; + j1 = 0; + b0 = -1; + } + + if (c0 == 61) + { + b0 = 0; + } + else if (c0 == 60) + { + b0 = 2; + } + else if (c0 == 62) + { + b0 = 1; + } + } + } + + if (flag2) + { + l1 += func_77904_a(flag3, flag1, flag4, b0, j1, k1, p_77912_3_); + } + + return l1; + } + } + } + else + { + return 0; + } + } + + /** + * Returns a list of effects for the specified potion damage value. + */ + public static List getPotionEffects(int p_77917_0_, boolean p_77917_1_) + { + ArrayList arraylist = null; + Potion[] apotion = Potion.potionTypes; + int j = apotion.length; + + for (int k = 0; k < j; ++k) + { + Potion potion = apotion[k]; + + if (potion != null && (!potion.isUsable() || p_77917_1_)) + { + String s = (String)potionRequirements.get(Integer.valueOf(potion.getId())); + + if (s != null) + { + int l = parsePotionEffects(s, 0, s.length(), p_77917_0_); + + if (l > 0) + { + int i1 = 0; + String s1 = (String)potionAmplifiers.get(Integer.valueOf(potion.getId())); + + if (s1 != null) + { + i1 = parsePotionEffects(s1, 0, s1.length(), p_77917_0_); + + if (i1 < 0) + { + i1 = 0; + } + } + + if (potion.isInstant()) + { + l = 1; + } + else + { + l = 1200 * (l * 3 + (l - 1) * 2); + l >>= i1; + l = (int)Math.round((double)l * potion.getEffectiveness()); + + if ((p_77917_0_ & 16384) != 0) + { + l = (int)Math.round((double)l * 0.75D + 0.5D); + } + } + + if (arraylist == null) + { + arraylist = new ArrayList(); + } + + PotionEffect potioneffect = new PotionEffect(potion.getId(), l, i1); + + if ((p_77917_0_ & 16384) != 0) + { + potioneffect.setSplashPotion(true); + } + + arraylist.add(potioneffect); + } + } + } + } + + return arraylist; + } + + /** + * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit + * will be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is + * not present. + */ + private static int brewBitOperations(int p_77906_0_, int p_77906_1_, boolean p_77906_2_, boolean p_77906_3_, boolean p_77906_4_) + { + if (p_77906_4_) + { + if (!checkFlag(p_77906_0_, p_77906_1_)) + { + return 0; + } + } + else if (p_77906_2_) + { + p_77906_0_ &= ~(1 << p_77906_1_); + } + else if (p_77906_3_) + { + if ((p_77906_0_ & 1 << p_77906_1_) == 0) + { + p_77906_0_ |= 1 << p_77906_1_; + } + else + { + p_77906_0_ &= ~(1 << p_77906_1_); + } + } + else + { + p_77906_0_ |= 1 << p_77906_1_; + } + + return p_77906_0_; + } + + /** + * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will + * receive + */ + public static int applyIngredient(int p_77913_0_, String p_77913_1_) + { + byte b0 = 0; + int j = p_77913_1_.length(); + boolean flag = false; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + int k = 0; + + for (int l = b0; l < j; ++l) + { + char c0 = p_77913_1_.charAt(l); + + if (c0 >= 48 && c0 <= 57) + { + k *= 10; + k += c0 - 48; + flag = true; + } + else if (c0 == 33) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag1 = true; + } + else if (c0 == 45) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag2 = true; + } + else if (c0 == 43) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + } + else if (c0 == 38) + { + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + flag3 = false; + flag1 = false; + flag2 = false; + flag = false; + k = 0; + } + + flag3 = true; + } + } + + if (flag) + { + p_77913_0_ = brewBitOperations(p_77913_0_, k, flag2, flag1, flag3); + } + + return p_77913_0_ & 32767; + } + + public static int func_77908_a(int p_77908_0_, int p_77908_1_, int p_77908_2_, int p_77908_3_, int p_77908_4_, int p_77908_5_) + { + return (checkFlag(p_77908_0_, p_77908_1_) ? 16 : 0) | (checkFlag(p_77908_0_, p_77908_2_) ? 8 : 0) | (checkFlag(p_77908_0_, p_77908_3_) ? 4 : 0) | (checkFlag(p_77908_0_, p_77908_4_) ? 2 : 0) | (checkFlag(p_77908_0_, p_77908_5_) ? 1 : 0); + } + + static + { + potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); + sugarEffect = "-0+1-2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); + magmaCreamEffect = "+0+1-2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); + speckledMelonEffect = "+0-1+2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); + spiderEyeEffect = "-0-1+2-3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); + fermentedSpiderEyeEffect = "-0+3-4+13"; + potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); + potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); + potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); + blazePowderEffect = "+0-1-2+3&4-4+13"; + potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); + goldenCarrotEffect = "-0+1+2-3+13&4-4"; + potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); + potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); + field_151423_m = "+0-1+2+3+13&4-4"; + potionRequirements.put(Integer.valueOf(Potion.waterBreathing.getId()), "0 & !1 & 2 & 3 & 2+6"); + glowstoneEffect = "+5-6-7"; + potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); + potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); + redstoneEffect = "-5+6-7"; + gunpowderEffect = "+14&13-13"; + field_77925_n = new HashMap(); + potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/profiler/IPlayerUsage.java b/build/rfg/minecraft-src/java/net/minecraft/profiler/IPlayerUsage.java new file mode 100644 index 0000000..ede4116 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/profiler/IPlayerUsage.java @@ -0,0 +1,13 @@ +package net.minecraft.profiler; + +public interface IPlayerUsage +{ + void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper); + + void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper); + + /** + * Returns whether snooping is enabled or not. + */ + boolean isSnooperEnabled(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/profiler/PlayerUsageSnooper.java b/build/rfg/minecraft-src/java/net/minecraft/profiler/PlayerUsageSnooper.java new file mode 100644 index 0000000..91a59fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/profiler/PlayerUsageSnooper.java @@ -0,0 +1,211 @@ +package net.minecraft.profiler; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.util.HttpUtil; + +public class PlayerUsageSnooper +{ + private final Map field_152773_a = Maps.newHashMap(); + private final Map field_152774_b = Maps.newHashMap(); + private final String uniqueID = UUID.randomUUID().toString(); + /** URL of the server to send the report to */ + private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; + /** set to fire the snooperThread every 15 mins */ + private final Timer threadTrigger = new Timer("Snooper Timer", true); + private final Object syncLock = new Object(); + private final long minecraftStartTimeMilis; + private boolean isRunning; + /** incremented on every getSelfCounterFor */ + private int selfCounter; + private static final String __OBFID = "CL_00001515"; + + public PlayerUsageSnooper(String p_i1563_1_, IPlayerUsage p_i1563_2_, long p_i1563_3_) + { + try + { + this.serverUrl = new URL("http://snoop.minecraft.net/" + p_i1563_1_ + "?version=" + 2); + } + catch (MalformedURLException malformedurlexception) + { + throw new IllegalArgumentException(); + } + + this.playerStatsCollector = p_i1563_2_; + this.minecraftStartTimeMilis = p_i1563_3_; + } + + /** + * Note issuing start multiple times is not an error. + */ + public void startSnooper() + { + if (!this.isRunning) + { + this.isRunning = true; + this.func_152766_h(); + this.threadTrigger.schedule(new TimerTask() + { + private static final String __OBFID = "CL_00001516"; + public void run() + { + if (PlayerUsageSnooper.this.playerStatsCollector.isSnooperEnabled()) + { + HashMap hashmap; + + synchronized (PlayerUsageSnooper.this.syncLock) + { + hashmap = new HashMap(PlayerUsageSnooper.this.field_152774_b); + + if (PlayerUsageSnooper.this.selfCounter == 0) + { + hashmap.putAll(PlayerUsageSnooper.this.field_152773_a); + } + + hashmap.put("snooper_count", Integer.valueOf(PlayerUsageSnooper.access$308(PlayerUsageSnooper.this))); + hashmap.put("snooper_token", PlayerUsageSnooper.this.uniqueID); + } + + HttpUtil.func_151226_a(PlayerUsageSnooper.this.serverUrl, hashmap, true); + } + } + }, 0L, 900000L); + } + } + + private void func_152766_h() + { + this.addJvmArgsToSnooper(); + this.func_152768_a("snooper_token", this.uniqueID); + this.func_152767_b("snooper_token", this.uniqueID); + this.func_152767_b("os_name", System.getProperty("os.name")); + this.func_152767_b("os_version", System.getProperty("os.version")); + this.func_152767_b("os_architecture", System.getProperty("os.arch")); + this.func_152767_b("java_version", System.getProperty("java.version")); + this.func_152767_b("version", "1.7.10"); + this.playerStatsCollector.addServerTypeToSnooper(this); + } + + private void addJvmArgsToSnooper() + { + RuntimeMXBean runtimemxbean = ManagementFactory.getRuntimeMXBean(); + List list = runtimemxbean.getInputArguments(); + int i = 0; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (s.startsWith("-X")) + { + this.func_152768_a("jvm_arg[" + i++ + "]", s); + } + } + + this.func_152768_a("jvm_args", Integer.valueOf(i)); + } + + public void addMemoryStatsToSnooper() + { + this.func_152767_b("memory_total", Long.valueOf(Runtime.getRuntime().totalMemory())); + this.func_152767_b("memory_max", Long.valueOf(Runtime.getRuntime().maxMemory())); + this.func_152767_b("memory_free", Long.valueOf(Runtime.getRuntime().freeMemory())); + this.func_152767_b("cpu_cores", Integer.valueOf(Runtime.getRuntime().availableProcessors())); + this.playerStatsCollector.addServerStatsToSnooper(this); + } + + public void func_152768_a(String p_152768_1_, Object p_152768_2_) + { + Object object1 = this.syncLock; + + synchronized (this.syncLock) + { + this.field_152774_b.put(p_152768_1_, p_152768_2_); + } + } + + public void func_152767_b(String p_152767_1_, Object p_152767_2_) + { + Object object1 = this.syncLock; + + synchronized (this.syncLock) + { + this.field_152773_a.put(p_152767_1_, p_152767_2_); + } + } + + @SideOnly(Side.CLIENT) + public Map getCurrentStats() + { + LinkedHashMap linkedhashmap = new LinkedHashMap(); + Object object = this.syncLock; + + synchronized (this.syncLock) + { + this.addMemoryStatsToSnooper(); + Iterator iterator = this.field_152773_a.entrySet().iterator(); + Entry entry; + + while (iterator.hasNext()) + { + entry = (Entry)iterator.next(); + linkedhashmap.put(entry.getKey(), entry.getValue().toString()); + } + + iterator = this.field_152774_b.entrySet().iterator(); + + while (iterator.hasNext()) + { + entry = (Entry)iterator.next(); + linkedhashmap.put(entry.getKey(), entry.getValue().toString()); + } + + return linkedhashmap; + } + } + + public boolean isSnooperRunning() + { + return this.isRunning; + } + + public void stopSnooper() + { + this.threadTrigger.cancel(); + } + + @SideOnly(Side.CLIENT) + public String getUniqueID() + { + return this.uniqueID; + } + + /** + * Returns the saved value of System#currentTimeMillis when the game started + */ + public long getMinecraftStartTimeMillis() + { + return this.minecraftStartTimeMilis; + } + + static int access$308(PlayerUsageSnooper p_access$308_0_) + { + return p_access$308_0_.selfCounter++; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/profiler/Profiler.java b/build/rfg/minecraft-src/java/net/minecraft/profiler/Profiler.java new file mode 100644 index 0000000..2fd63fb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/profiler/Profiler.java @@ -0,0 +1,212 @@ +package net.minecraft.profiler; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Profiler +{ + private static final Logger logger = LogManager.getLogger(); + /** List of parent sections */ + private final List sectionList = new ArrayList(); + /** List of timestamps (System.nanoTime) */ + private final List timestampList = new ArrayList(); + /** Flag profiling enabled */ + public boolean profilingEnabled; + /** Current profiling section */ + private String profilingSection = ""; + /** Profiling map */ + private final Map profilingMap = new HashMap(); + private static final String __OBFID = "CL_00001497"; + + /** + * Clear profiling. + */ + public void clearProfiling() + { + this.profilingMap.clear(); + this.profilingSection = ""; + this.sectionList.clear(); + } + + /** + * Start section + */ + public void startSection(String name) + { + if (this.profilingEnabled) + { + if (this.profilingSection.length() > 0) + { + this.profilingSection = this.profilingSection + "."; + } + + this.profilingSection = this.profilingSection + name; + this.sectionList.add(this.profilingSection); + this.timestampList.add(Long.valueOf(System.nanoTime())); + } + } + + /** + * End section + */ + public void endSection() + { + if (this.profilingEnabled) + { + long i = System.nanoTime(); + long j = ((Long)this.timestampList.remove(this.timestampList.size() - 1)).longValue(); + this.sectionList.remove(this.sectionList.size() - 1); + long k = i - j; + + if (this.profilingMap.containsKey(this.profilingSection)) + { + this.profilingMap.put(this.profilingSection, Long.valueOf(((Long)this.profilingMap.get(this.profilingSection)).longValue() + k)); + } + else + { + this.profilingMap.put(this.profilingSection, Long.valueOf(k)); + } + + if (k > 100000000L) + { + logger.warn("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double)k / 1000000.0D + " ms"); + } + + this.profilingSection = !this.sectionList.isEmpty() ? (String)this.sectionList.get(this.sectionList.size() - 1) : ""; + } + } + + /** + * Get profiling data + */ + public List getProfilingData(String p_76321_1_) + { + if (!this.profilingEnabled) + { + return null; + } + else + { + long i = this.profilingMap.containsKey("root") ? ((Long)this.profilingMap.get("root")).longValue() : 0L; + long j = this.profilingMap.containsKey(p_76321_1_) ? ((Long)this.profilingMap.get(p_76321_1_)).longValue() : -1L; + ArrayList arraylist = new ArrayList(); + + if (p_76321_1_.length() > 0) + { + p_76321_1_ = p_76321_1_ + "."; + } + + long k = 0L; + Iterator iterator = this.profilingMap.keySet().iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + + if (s1.length() > p_76321_1_.length() && s1.startsWith(p_76321_1_) && s1.indexOf(".", p_76321_1_.length() + 1) < 0) + { + k += ((Long)this.profilingMap.get(s1)).longValue(); + } + } + + float f = (float)k; + + if (k < j) + { + k = j; + } + + if (i < k) + { + i = k; + } + + Iterator iterator1 = this.profilingMap.keySet().iterator(); + String s2; + + while (iterator1.hasNext()) + { + s2 = (String)iterator1.next(); + + if (s2.length() > p_76321_1_.length() && s2.startsWith(p_76321_1_) && s2.indexOf(".", p_76321_1_.length() + 1) < 0) + { + long l = ((Long)this.profilingMap.get(s2)).longValue(); + double d0 = (double)l * 100.0D / (double)k; + double d1 = (double)l * 100.0D / (double)i; + String s3 = s2.substring(p_76321_1_.length()); + arraylist.add(new Profiler.Result(s3, d0, d1)); + } + } + + iterator1 = this.profilingMap.keySet().iterator(); + + while (iterator1.hasNext()) + { + s2 = (String)iterator1.next(); + this.profilingMap.put(s2, Long.valueOf(((Long)this.profilingMap.get(s2)).longValue() * 999L / 1000L)); + } + + if ((float)k > f) + { + arraylist.add(new Profiler.Result("unspecified", (double)((float)k - f) * 100.0D / (double)k, (double)((float)k - f) * 100.0D / (double)i)); + } + + Collections.sort(arraylist); + arraylist.add(0, new Profiler.Result(p_76321_1_, 100.0D, (double)k * 100.0D / (double)i)); + return arraylist; + } + } + + /** + * End current section and start a new section + */ + public void endStartSection(String name) + { + this.endSection(); + this.startSection(name); + } + + public String getNameOfLastSection() + { + return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String)this.sectionList.get(this.sectionList.size() - 1); + } + + public static final class Result implements Comparable + { + public double field_76332_a; + public double field_76330_b; + public String field_76331_c; + private static final String __OBFID = "CL_00001498"; + + public Result(String p_i1554_1_, double p_i1554_2_, double p_i1554_4_) + { + this.field_76331_c = p_i1554_1_; + this.field_76332_a = p_i1554_2_; + this.field_76330_b = p_i1554_4_; + } + + public int compareTo(Profiler.Result p_compareTo_1_) + { + return p_compareTo_1_.field_76332_a < this.field_76332_a ? -1 : (p_compareTo_1_.field_76332_a > this.field_76332_a ? 1 : p_compareTo_1_.field_76331_c.compareTo(this.field_76331_c)); + } + + @SideOnly(Side.CLIENT) + public int func_76329_a() + { + return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((Profiler.Result)p_compareTo_1_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/DisconnectedOnlineScreen.java b/build/rfg/minecraft-src/java/net/minecraft/realms/DisconnectedOnlineScreen.java new file mode 100644 index 0000000..b7ecfa5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/DisconnectedOnlineScreen.java @@ -0,0 +1,65 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.util.IChatComponent; + +@SideOnly(Side.CLIENT) +public class DisconnectedOnlineScreen extends RealmsScreen +{ + private String title; + private IChatComponent reason; + private List lines; + private final RealmsScreen parent; + private static final String __OBFID = "CL_00001912"; + + public DisconnectedOnlineScreen(RealmsScreen p_i1000_1_, String p_i1000_2_, IChatComponent p_i1000_3_) + { + this.parent = p_i1000_1_; + this.title = getLocalizedString(p_i1000_2_); + this.reason = p_i1000_3_; + } + + public void init() + { + this.buttonsClear(); + this.buttonsAdd(newButton(0, this.width() / 2 - 100, this.height() / 4 + 120 + 12, getLocalizedString("gui.back"))); + this.lines = this.fontSplit(this.reason.getFormattedText(), this.width() - 50); + } + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) + { + if (p_keyPressed_2_ == 1) + { + Realms.setScreen(this.parent); + } + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) + { + if (p_buttonClicked_1_.id() == 0) + { + Realms.setScreen(this.parent); + } + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.renderBackground(); + this.drawCenteredString(this.title, this.width() / 2, this.height() / 2 - 50, 11184810); + int k = this.height() / 2 - 30; + + if (this.lines != null) + { + for (Iterator iterator = this.lines.iterator(); iterator.hasNext(); k += this.fontLineHeight()) + { + String s = (String)iterator.next(); + this.drawCenteredString(s, this.width() / 2, k, 16777215); + } + } + + super.render(p_render_1_, p_render_2_, p_render_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/Realms.java b/build/rfg/minecraft-src/java/net/minecraft/realms/Realms.java new file mode 100644 index 0000000..40eff83 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/Realms.java @@ -0,0 +1,83 @@ +package net.minecraft.realms; + +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.net.Proxy; +import java.util.UUID; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; +import net.minecraft.world.WorldSettings; + +@SideOnly(Side.CLIENT) +public class Realms +{ + private static final String __OBFID = "CL_00001892"; + + public static boolean isTouchScreen() + { + return Minecraft.getMinecraft().gameSettings.touchscreen; + } + + public static Proxy getProxy() + { + return Minecraft.getMinecraft().getProxy(); + } + + public static String sessionId() + { + Session session = Minecraft.getMinecraft().getSession(); + return session == null ? null : session.getSessionID(); + } + + public static String userName() + { + Session session = Minecraft.getMinecraft().getSession(); + return session == null ? null : session.getUsername(); + } + + public static long currentTimeMillis() + { + return Minecraft.getSystemTime(); + } + + public static String getSessionId() + { + return Minecraft.getMinecraft().getSession().getSessionID(); + } + + public static String getName() + { + return Minecraft.getMinecraft().getSession().getUsername(); + } + + public static String uuidToName(String p_uuidToName_0_) + { + return Minecraft.getMinecraft().func_152347_ac().fillProfileProperties(new GameProfile(UUID.fromString(p_uuidToName_0_.replaceAll("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")), (String)null), false).getName(); + } + + public static void setScreen(RealmsScreen p_setScreen_0_) + { + Minecraft.getMinecraft().displayGuiScreen(p_setScreen_0_.getProxy()); + } + + public static String getGameDirectoryPath() + { + return Minecraft.getMinecraft().mcDataDir.getAbsolutePath(); + } + + public static int survivalId() + { + return WorldSettings.GameType.SURVIVAL.getID(); + } + + public static int creativeId() + { + return WorldSettings.GameType.CREATIVE.getID(); + } + + public static int adventureId() + { + return WorldSettings.GameType.ADVENTURE.getID(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java new file mode 100644 index 0000000..a9b82fc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsAnvilLevelStorageSource.java @@ -0,0 +1,82 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.SaveFormatComparator; + +@SideOnly(Side.CLIENT) +public class RealmsAnvilLevelStorageSource +{ + private ISaveFormat levelStorageSource; + private static final String __OBFID = "CL_00001856"; + + public RealmsAnvilLevelStorageSource(ISaveFormat p_i1106_1_) + { + this.levelStorageSource = p_i1106_1_; + } + + public String getName() + { + return this.levelStorageSource.func_154333_a(); + } + + public boolean levelExists(String p_levelExists_1_) + { + return this.levelStorageSource.canLoadWorld(p_levelExists_1_); + } + + public boolean convertLevel(String p_convertLevel_1_, IProgressUpdate p_convertLevel_2_) + { + return this.levelStorageSource.convertMapFormat(p_convertLevel_1_, p_convertLevel_2_); + } + + public boolean requiresConversion(String p_requiresConversion_1_) + { + return this.levelStorageSource.isOldMapFormat(p_requiresConversion_1_); + } + + public boolean isNewLevelIdAcceptable(String p_isNewLevelIdAcceptable_1_) + { + return this.levelStorageSource.func_154335_d(p_isNewLevelIdAcceptable_1_); + } + + public boolean deleteLevel(String p_deleteLevel_1_) + { + return this.levelStorageSource.deleteWorldDirectory(p_deleteLevel_1_); + } + + public boolean isConvertible(String p_isConvertible_1_) + { + return this.levelStorageSource.func_154334_a(p_isConvertible_1_); + } + + public void renameLevel(String p_renameLevel_1_, String p_renameLevel_2_) + { + this.levelStorageSource.renameWorld(p_renameLevel_1_, p_renameLevel_2_); + } + + public void clearAll() + { + this.levelStorageSource.flushCache(); + } + + public List getLevelList() throws AnvilConverterException + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.levelStorageSource.getSaveList().iterator(); + + while (iterator.hasNext()) + { + SaveFormatComparator saveformatcomparator = (SaveFormatComparator)iterator.next(); + arraylist.add(new RealmsLevelSummary(saveformatcomparator)); + } + + return arraylist; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsBridge.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsBridge.java new file mode 100644 index 0000000..fa0d7c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsBridge.java @@ -0,0 +1,40 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Constructor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class RealmsBridge extends RealmsScreen +{ + private static final Logger LOGGER = LogManager.getLogger(); + private GuiScreen previousScreen; + private static final String __OBFID = "CL_00001869"; + + public void switchToRealms(GuiScreen p_switchToRealms_1_) + { + this.previousScreen = p_switchToRealms_1_; + + try + { + Class oclass = Class.forName("com.mojang.realmsclient.RealmsMainScreen"); + Constructor constructor = oclass.getDeclaredConstructor(new Class[] {RealmsScreen.class}); + constructor.setAccessible(true); + Object object = constructor.newInstance(new Object[] {this}); + Minecraft.getMinecraft().displayGuiScreen(((RealmsScreen)object).getProxy()); + } + catch (Exception exception) + { + LOGGER.error("Realms module missing", exception); + } + } + + public void init() + { + Minecraft.getMinecraft().displayGuiScreen(this.previousScreen); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsButton.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsButton.java new file mode 100644 index 0000000..ed2e606 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsButton.java @@ -0,0 +1,85 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiButtonRealmsProxy; + +@SideOnly(Side.CLIENT) +public class RealmsButton +{ + private GuiButtonRealmsProxy proxy; + private static final String __OBFID = "CL_00001890"; + + public RealmsButton(int p_i1177_1_, int p_i1177_2_, int p_i1177_3_, String p_i1177_4_) + { + this.proxy = new GuiButtonRealmsProxy(this, p_i1177_1_, p_i1177_2_, p_i1177_3_, p_i1177_4_); + } + + public RealmsButton(int p_i1178_1_, int p_i1178_2_, int p_i1178_3_, int p_i1178_4_, int p_i1178_5_, String p_i1178_6_) + { + this.proxy = new GuiButtonRealmsProxy(this, p_i1178_1_, p_i1178_2_, p_i1178_3_, p_i1178_6_, p_i1178_4_, p_i1178_5_); + } + + public GuiButton getProxy() + { + return this.proxy; + } + + public int id() + { + return this.proxy.func_154314_d(); + } + + public boolean active() + { + return this.proxy.func_154315_e(); + } + + public void active(boolean p_active_1_) + { + this.proxy.func_154313_b(p_active_1_); + } + + public void msg(String p_msg_1_) + { + this.proxy.func_154311_a(p_msg_1_); + } + + public int getWidth() + { + return this.proxy.getButtonWidth(); + } + + public int getHeight() + { + return this.proxy.func_154310_c(); + } + + public int y() + { + return this.proxy.func_154316_f(); + } + + public void render(int p_render_1_, int p_render_2_) + { + this.proxy.drawButton(Minecraft.getMinecraft(), p_render_1_, p_render_2_); + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) {} + + public void released(int p_released_1_, int p_released_2_) {} + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) + { + this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) {} + + public int getYImage(boolean p_getYImage_1_) + { + return this.proxy.func_154312_c(p_getYImage_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsConnect.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsConnect.java new file mode 100644 index 0000000..8a6bfd2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsConnect.java @@ -0,0 +1,125 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.util.concurrent.GenericFutureListener; +import java.net.InetAddress; +import java.net.UnknownHostException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerLoginClient; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.util.ChatComponentTranslation; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class RealmsConnect +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final RealmsScreen onlineScreen; + private volatile boolean aborted = false; + private NetworkManager connection; + private static final String __OBFID = "CL_00001844"; + + public RealmsConnect(RealmsScreen p_i1079_1_) + { + this.onlineScreen = p_i1079_1_; + } + + public void connect(final String p_connect_1_, final int p_connect_2_) + { + (new Thread("Realms-connect-task") + { + private static final String __OBFID = "CL_00001808"; + public void run() + { + InetAddress inetaddress = null; + + try + { + cpw.mods.fml.client.FMLClientHandler.instance().connectToRealmsServer(p_connect_1_, p_connect_2_); + inetaddress = InetAddress.getByName(p_connect_1_); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection = NetworkManager.provideLanClient(inetaddress, p_connect_2_); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.setNetHandler(new NetHandlerLoginClient(RealmsConnect.this.connection, Minecraft.getMinecraft(), RealmsConnect.this.onlineScreen.getProxy())); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.scheduleOutboundPacket(new C00Handshake(5, p_connect_1_, p_connect_2_, EnumConnectionState.LOGIN), new GenericFutureListener[0]); + + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.this.connection.scheduleOutboundPacket(new C00PacketLoginStart(Minecraft.getMinecraft().getSession().func_148256_e()), new GenericFutureListener[0]); + } + catch (UnknownHostException unknownhostexception) + { + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.LOGGER.error("Couldn\'t connect to world", unknownhostexception); + Realms.setScreen(new DisconnectedOnlineScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Unknown host \'" + p_connect_1_ + "\'"}))); + } + catch (Exception exception) + { + if (RealmsConnect.this.aborted) + { + return; + } + + RealmsConnect.LOGGER.error("Couldn\'t connect to world", exception); + String s = exception.toString(); + + if (inetaddress != null) + { + String s1 = inetaddress.toString() + ":" + p_connect_2_; + s = s.replaceAll(s1, ""); + } + + Realms.setScreen(new DisconnectedOnlineScreen(RealmsConnect.this.onlineScreen, "connect.failed", new ChatComponentTranslation("disconnect.genericReason", new Object[] {s}))); + } + } + }).start(); + } + + public void abort() + { + this.aborted = true; + } + + public void tick() + { + if (this.connection != null) + { + if (this.connection.isChannelOpen()) + { + this.connection.processReceivedPackets(); + } + else if (this.connection.getExitMessage() != null) + { + this.connection.getNetHandler().onDisconnect(this.connection.getExitMessage()); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsEditBox.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsEditBox.java new file mode 100644 index 0000000..3921647 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsEditBox.java @@ -0,0 +1,706 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ChatAllowedCharacters; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RealmsEditBox +{ + public static final int BACKWARDS = -1; + public static final int FORWARDS = 1; + private static final int CURSOR_INSERT_WIDTH = 1; + private static final int CURSOR_INSERT_COLOR = -3092272; + private static final String CURSOR_APPEND_CHARACTER = "_"; + private final FontRenderer font; + private final int x; + private final int y; + private final int width; + private final int height; + private String value; + private int maxLength; + private int frame; + private boolean bordered; + private boolean canLoseFocus; + private boolean inFocus; + private boolean isEditable; + private int displayPos; + private int cursorPos; + private int highlightPos; + private int textColor; + private int textColorUneditable; + private boolean visible; + private static final String __OBFID = "CL_00001858"; + + public RealmsEditBox(int p_i1111_1_, int p_i1111_2_, int p_i1111_3_, int p_i1111_4_) + { + this(Minecraft.getMinecraft().fontRenderer, p_i1111_1_, p_i1111_2_, p_i1111_3_, p_i1111_4_); + } + + public RealmsEditBox(FontRenderer p_i1112_1_, int p_i1112_2_, int p_i1112_3_, int p_i1112_4_, int p_i1112_5_) + { + this.value = ""; + this.maxLength = 32; + this.bordered = true; + this.canLoseFocus = true; + this.isEditable = true; + this.textColor = 14737632; + this.textColorUneditable = 7368816; + this.visible = true; + this.font = p_i1112_1_; + this.x = p_i1112_2_; + this.y = p_i1112_3_; + this.width = p_i1112_4_; + this.height = p_i1112_5_; + } + + public void tick() + { + ++this.frame; + } + + public void setValue(String p_setValue_1_) + { + if (p_setValue_1_.length() > this.maxLength) + { + this.value = p_setValue_1_.substring(0, this.maxLength); + } + else + { + this.value = p_setValue_1_; + } + + this.moveCursorToEnd(); + } + + public String getValue() + { + return this.value; + } + + public String getHighlighted() + { + int i = this.cursorPos < this.highlightPos ? this.cursorPos : this.highlightPos; + int j = this.cursorPos < this.highlightPos ? this.highlightPos : this.cursorPos; + return this.value.substring(i, j); + } + + public void insertText(String p_insertText_1_) + { + String s1 = ""; + String s2 = ChatAllowedCharacters.filerAllowedCharacters(p_insertText_1_); + int i = this.cursorPos < this.highlightPos ? this.cursorPos : this.highlightPos; + int j = this.cursorPos < this.highlightPos ? this.highlightPos : this.cursorPos; + int k = this.maxLength - this.value.length() - (i - this.highlightPos); + boolean flag = false; + + if (this.value.length() > 0) + { + s1 = s1 + this.value.substring(0, i); + } + + int l; + + if (k < s2.length()) + { + s1 = s1 + s2.substring(0, k); + l = k; + } + else + { + s1 = s1 + s2; + l = s2.length(); + } + + if (this.value.length() > 0 && j < this.value.length()) + { + s1 = s1 + this.value.substring(j); + } + + this.value = s1; + this.moveCursor(i - this.highlightPos + l); + } + + public void deleteWords(int p_deleteWords_1_) + { + if (this.value.length() != 0) + { + if (this.highlightPos != this.cursorPos) + { + this.insertText(""); + } + else + { + this.deleteChars(this.getWordPosition(p_deleteWords_1_) - this.cursorPos); + } + } + } + + public void deleteChars(int p_deleteChars_1_) + { + if (this.value.length() != 0) + { + if (this.highlightPos != this.cursorPos) + { + this.insertText(""); + } + else + { + boolean flag = p_deleteChars_1_ < 0; + int j = flag ? this.cursorPos + p_deleteChars_1_ : this.cursorPos; + int k = flag ? this.cursorPos : this.cursorPos + p_deleteChars_1_; + String s = ""; + + if (j >= 0) + { + s = this.value.substring(0, j); + } + + if (k < this.value.length()) + { + s = s + this.value.substring(k); + } + + this.value = s; + + if (flag) + { + this.moveCursor(p_deleteChars_1_); + } + } + } + } + + public int getWordPosition(int p_getWordPosition_1_) + { + return this.getWordPosition(p_getWordPosition_1_, this.getCursorPosition()); + } + + public int getWordPosition(int p_getWordPosition_1_, int p_getWordPosition_2_) + { + return this.getWordPosition(p_getWordPosition_1_, this.getCursorPosition(), true); + } + + public int getWordPosition(int p_getWordPosition_1_, int p_getWordPosition_2_, boolean p_getWordPosition_3_) + { + int k = p_getWordPosition_2_; + boolean flag1 = p_getWordPosition_1_ < 0; + int l = Math.abs(p_getWordPosition_1_); + + for (int i1 = 0; i1 < l; ++i1) + { + if (flag1) + { + while (p_getWordPosition_3_ && k > 0 && this.value.charAt(k - 1) == 32) + { + --k; + } + + while (k > 0 && this.value.charAt(k - 1) != 32) + { + --k; + } + } + else + { + int j1 = this.value.length(); + k = this.value.indexOf(32, k); + + if (k == -1) + { + k = j1; + } + else + { + while (p_getWordPosition_3_ && k < j1 && this.value.charAt(k) == 32) + { + ++k; + } + } + } + } + + return k; + } + + public void moveCursor(int p_moveCursor_1_) + { + this.moveCursorTo(this.highlightPos + p_moveCursor_1_); + } + + public void moveCursorTo(int p_moveCursorTo_1_) + { + this.cursorPos = p_moveCursorTo_1_; + int j = this.value.length(); + + if (this.cursorPos < 0) + { + this.cursorPos = 0; + } + + if (this.cursorPos > j) + { + this.cursorPos = j; + } + + this.setHighlightPos(this.cursorPos); + } + + public void moveCursorToStart() + { + this.moveCursorTo(0); + } + + public void moveCursorToEnd() + { + this.moveCursorTo(this.value.length()); + } + + public boolean keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) + { + if (!this.inFocus) + { + return false; + } + else + { + switch (p_keyPressed_1_) + { + case 1: + this.moveCursorToEnd(); + this.setHighlightPos(0); + return true; + case 3: + GuiScreen.setClipboardString(this.getHighlighted()); + return true; + case 22: + if (this.isEditable) + { + this.insertText(GuiScreen.getClipboardString()); + } + + return true; + case 24: + GuiScreen.setClipboardString(this.getHighlighted()); + + if (this.isEditable) + { + this.insertText(""); + } + + return true; + default: + switch (p_keyPressed_2_) + { + case 14: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEditable) + { + this.deleteWords(-1); + } + } + else if (this.isEditable) + { + this.deleteChars(-1); + } + + return true; + case 199: + if (GuiScreen.isShiftKeyDown()) + { + this.setHighlightPos(0); + } + else + { + this.moveCursorToStart(); + } + + return true; + case 203: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setHighlightPos(this.getWordPosition(-1, this.getHighlightPos())); + } + else + { + this.setHighlightPos(this.getHighlightPos() - 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.moveCursorTo(this.getWordPosition(-1)); + } + else + { + this.moveCursor(-1); + } + + return true; + case 205: + if (GuiScreen.isShiftKeyDown()) + { + if (GuiScreen.isCtrlKeyDown()) + { + this.setHighlightPos(this.getWordPosition(1, this.getHighlightPos())); + } + else + { + this.setHighlightPos(this.getHighlightPos() + 1); + } + } + else if (GuiScreen.isCtrlKeyDown()) + { + this.moveCursorTo(this.getWordPosition(1)); + } + else + { + this.moveCursor(1); + } + + return true; + case 207: + if (GuiScreen.isShiftKeyDown()) + { + this.setHighlightPos(this.value.length()); + } + else + { + this.moveCursorToEnd(); + } + + return true; + case 211: + if (GuiScreen.isCtrlKeyDown()) + { + if (this.isEditable) + { + this.deleteWords(1); + } + } + else if (this.isEditable) + { + this.deleteChars(1); + } + + return true; + default: + if (ChatAllowedCharacters.isAllowedCharacter(p_keyPressed_1_)) + { + if (this.isEditable) + { + this.insertText(Character.toString(p_keyPressed_1_)); + } + + return true; + } + else + { + return false; + } + } + } + } + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) + { + boolean flag = p_mouseClicked_1_ >= this.x && p_mouseClicked_1_ < this.x + this.width && p_mouseClicked_2_ >= this.y && p_mouseClicked_2_ < this.y + this.height; + + if (this.canLoseFocus) + { + this.setFocus(flag); + } + + if (this.inFocus && p_mouseClicked_3_ == 0) + { + int l = p_mouseClicked_1_ - this.x; + + if (this.bordered) + { + l -= 4; + } + + String s = this.font.trimStringToWidth(this.value.substring(this.displayPos), this.getInnerWidth()); + this.moveCursorTo(this.font.trimStringToWidth(s, l).length() + this.displayPos); + } + } + + public void render() + { + if (this.isVisible()) + { + if (this.isBordered()) + { + Gui.drawRect(this.x - 1, this.y - 1, this.x + this.width + 1, this.y + this.height + 1, -6250336); + Gui.drawRect(this.x, this.y, this.x + this.width, this.y + this.height, -16777216); + } + + int i = this.isEditable ? this.textColor : this.textColorUneditable; + int j = this.cursorPos - this.displayPos; + int k = this.highlightPos - this.displayPos; + String s = this.font.trimStringToWidth(this.value.substring(this.displayPos), this.getInnerWidth()); + boolean flag = j >= 0 && j <= s.length(); + boolean flag1 = this.inFocus && this.frame / 6 % 2 == 0 && flag; + int l = this.bordered ? this.x + 4 : this.x; + int i1 = this.bordered ? this.y + (this.height - 8) / 2 : this.y; + int j1 = l; + + if (k > s.length()) + { + k = s.length(); + } + + if (s.length() > 0) + { + String s1 = flag ? s.substring(0, j) : s; + j1 = this.font.drawStringWithShadow(s1, l, i1, i); + } + + boolean flag2 = this.cursorPos < this.value.length() || this.value.length() >= this.getMaxLength(); + int k1 = j1; + + if (!flag) + { + k1 = j > 0 ? l + this.width : l; + } + else if (flag2) + { + k1 = j1 - 1; + --j1; + } + + if (s.length() > 0 && flag && j < s.length()) + { + this.font.drawStringWithShadow(s.substring(j), j1, i1, i); + } + + if (flag1) + { + if (flag2) + { + Gui.drawRect(k1, i1 - 1, k1 + 1, i1 + 1 + this.font.FONT_HEIGHT, -3092272); + } + else + { + this.font.drawStringWithShadow("_", k1, i1, i); + } + } + + if (k != j) + { + int l1 = l + this.font.getStringWidth(s.substring(0, k)); + this.renderHighlight(k1, i1 - 1, l1 - 1, i1 + 1 + this.font.FONT_HEIGHT); + } + } + } + + private void renderHighlight(int p_renderHighlight_1_, int p_renderHighlight_2_, int p_renderHighlight_3_, int p_renderHighlight_4_) + { + int i1; + + if (p_renderHighlight_1_ < p_renderHighlight_3_) + { + i1 = p_renderHighlight_1_; + p_renderHighlight_1_ = p_renderHighlight_3_; + p_renderHighlight_3_ = i1; + } + + if (p_renderHighlight_2_ < p_renderHighlight_4_) + { + i1 = p_renderHighlight_2_; + p_renderHighlight_2_ = p_renderHighlight_4_; + p_renderHighlight_4_ = i1; + } + + if (p_renderHighlight_3_ > this.x + this.width) + { + p_renderHighlight_3_ = this.x + this.width; + } + + if (p_renderHighlight_1_ > this.x + this.width) + { + p_renderHighlight_1_ = this.x + this.width; + } + + Tessellator tessellator = Tessellator.instance; + GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + tessellator.startDrawingQuads(); + tessellator.addVertex((double)p_renderHighlight_1_, (double)p_renderHighlight_4_, 0.0D); + tessellator.addVertex((double)p_renderHighlight_3_, (double)p_renderHighlight_4_, 0.0D); + tessellator.addVertex((double)p_renderHighlight_3_, (double)p_renderHighlight_2_, 0.0D); + tessellator.addVertex((double)p_renderHighlight_1_, (double)p_renderHighlight_2_, 0.0D); + tessellator.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + public void setMaxLength(int p_setMaxLength_1_) + { + this.maxLength = p_setMaxLength_1_; + + if (this.value.length() > p_setMaxLength_1_) + { + this.value = this.value.substring(0, p_setMaxLength_1_); + } + } + + public int getMaxLength() + { + return this.maxLength; + } + + public int getCursorPosition() + { + return this.cursorPos; + } + + public boolean isBordered() + { + return this.bordered; + } + + public void setBordered(boolean p_setBordered_1_) + { + this.bordered = p_setBordered_1_; + } + + public int getTextColor() + { + return this.textColor; + } + + public void setTextColor(int p_setTextColor_1_) + { + this.textColor = p_setTextColor_1_; + } + + public int getTextColorUneditable() + { + return this.textColorUneditable; + } + + public void setTextColorUneditable(int p_setTextColorUneditable_1_) + { + this.textColorUneditable = p_setTextColorUneditable_1_; + } + + public void setFocus(boolean p_setFocus_1_) + { + if (p_setFocus_1_ && !this.inFocus) + { + this.frame = 0; + } + + this.inFocus = p_setFocus_1_; + } + + public boolean isFocused() + { + return this.inFocus; + } + + public boolean isIsEditable() + { + return this.isEditable; + } + + public void setIsEditable(boolean p_setIsEditable_1_) + { + this.isEditable = p_setIsEditable_1_; + } + + public int getHighlightPos() + { + return this.highlightPos; + } + + public int getInnerWidth() + { + return this.isBordered() ? this.width - 8 : this.width; + } + + public void setHighlightPos(int p_setHighlightPos_1_) + { + int j = this.value.length(); + + if (p_setHighlightPos_1_ > j) + { + p_setHighlightPos_1_ = j; + } + + if (p_setHighlightPos_1_ < 0) + { + p_setHighlightPos_1_ = 0; + } + + this.highlightPos = p_setHighlightPos_1_; + + if (this.font != null) + { + if (this.displayPos > j) + { + this.displayPos = j; + } + + int k = this.getInnerWidth(); + String s = this.font.trimStringToWidth(this.value.substring(this.displayPos), k); + int l = s.length() + this.displayPos; + + if (p_setHighlightPos_1_ == this.displayPos) + { + this.displayPos -= this.font.trimStringToWidth(this.value, k, true).length(); + } + + if (p_setHighlightPos_1_ > l) + { + this.displayPos += p_setHighlightPos_1_ - l; + } + else if (p_setHighlightPos_1_ <= this.displayPos) + { + this.displayPos -= this.displayPos - p_setHighlightPos_1_; + } + + if (this.displayPos < 0) + { + this.displayPos = 0; + } + + if (this.displayPos > j) + { + this.displayPos = j; + } + } + } + + public boolean isCanLoseFocus() + { + return this.canLoseFocus; + } + + public void setCanLoseFocus(boolean p_setCanLoseFocus_1_) + { + this.canLoseFocus = p_setCanLoseFocus_1_; + } + + public boolean isVisible() + { + return this.visible; + } + + public void setVisible(boolean p_setVisible_1_) + { + this.visible = p_setVisible_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsLevelSummary.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsLevelSummary.java new file mode 100644 index 0000000..d6996ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsLevelSummary.java @@ -0,0 +1,72 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.storage.SaveFormatComparator; + +@SideOnly(Side.CLIENT) +public class RealmsLevelSummary implements Comparable +{ + private SaveFormatComparator levelSummary; + private static final String __OBFID = "CL_00001857"; + + public RealmsLevelSummary(SaveFormatComparator p_i1109_1_) + { + this.levelSummary = p_i1109_1_; + } + + public int getGameMode() + { + return this.levelSummary.getEnumGameType().getID(); + } + + public String getLevelId() + { + return this.levelSummary.getFileName(); + } + + public boolean hasCheats() + { + return this.levelSummary.getCheatsEnabled(); + } + + public boolean isHardcore() + { + return this.levelSummary.isHardcoreModeEnabled(); + } + + public boolean isRequiresConversion() + { + return this.levelSummary.requiresConversion(); + } + + public String getLevelName() + { + return this.levelSummary.getDisplayName(); + } + + public long getLastPlayed() + { + return this.levelSummary.getLastTimePlayed(); + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) + { + return this.levelSummary.compareTo(p_compareTo_1_); + } + + public long getSizeOnDisk() + { + return this.levelSummary.func_154336_c(); + } + + public int compareTo(RealmsLevelSummary p_compareTo_1_) + { + return this.levelSummary.getLastTimePlayed() < p_compareTo_1_.getLastPlayed() ? 1 : (this.levelSummary.getLastTimePlayed() > p_compareTo_1_.getLastPlayed() ? -1 : this.levelSummary.getFileName().compareTo(p_compareTo_1_.getLevelId())); + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((RealmsLevelSummary)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsMth.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsMth.java new file mode 100644 index 0000000..a191afd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsMth.java @@ -0,0 +1,177 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.util.MathHelper; + +@SideOnly(Side.CLIENT) +public class RealmsMth +{ + private static final String __OBFID = "CL_00001900"; + + public static float sin(float p_sin_0_) + { + return MathHelper.sin(p_sin_0_); + } + + public static double nextDouble(Random p_nextDouble_0_, double p_nextDouble_1_, double p_nextDouble_3_) + { + return MathHelper.getRandomDoubleInRange(p_nextDouble_0_, p_nextDouble_1_, p_nextDouble_3_); + } + + public static int ceil(float p_ceil_0_) + { + return MathHelper.ceiling_float_int(p_ceil_0_); + } + + public static int floor(double p_floor_0_) + { + return MathHelper.floor_double(p_floor_0_); + } + + public static int intFloorDiv(int p_intFloorDiv_0_, int p_intFloorDiv_1_) + { + return MathHelper.bucketInt(p_intFloorDiv_0_, p_intFloorDiv_1_); + } + + public static float abs(float p_abs_0_) + { + return MathHelper.abs(p_abs_0_); + } + + public static int clamp(int p_clamp_0_, int p_clamp_1_, int p_clamp_2_) + { + return MathHelper.clamp_int(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double clampedLerp(double p_clampedLerp_0_, double p_clampedLerp_2_, double p_clampedLerp_4_) + { + return MathHelper.denormalizeClamp(p_clampedLerp_0_, p_clampedLerp_2_, p_clampedLerp_4_); + } + + public static int ceil(double p_ceil_0_) + { + return MathHelper.ceiling_double_int(p_ceil_0_); + } + + public static boolean isEmpty(String p_isEmpty_0_) + { + return MathHelper.stringNullOrLengthZero(p_isEmpty_0_); + } + + public static long lfloor(double p_lfloor_0_) + { + return MathHelper.floor_double_long(p_lfloor_0_); + } + + public static float sqrt(double p_sqrt_0_) + { + return MathHelper.sqrt_double(p_sqrt_0_); + } + + public static double clamp(double p_clamp_0_, double p_clamp_2_, double p_clamp_4_) + { + return MathHelper.clamp_double(p_clamp_0_, p_clamp_2_, p_clamp_4_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_) + { + return MathHelper.parseIntWithDefault(p_getInt_0_, p_getInt_1_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_) + { + return MathHelper.parseDoubleWithDefault(p_getDouble_0_, p_getDouble_1_); + } + + public static int log2(int p_log2_0_) + { + return MathHelper.calculateLogBaseTwo(p_log2_0_); + } + + public static int absFloor(double p_absFloor_0_) + { + return MathHelper.func_154353_e(p_absFloor_0_); + } + + public static int smallestEncompassingPowerOfTwo(int p_smallestEncompassingPowerOfTwo_0_) + { + return MathHelper.roundUpToPowerOfTwo(p_smallestEncompassingPowerOfTwo_0_); + } + + public static float sqrt(float p_sqrt_0_) + { + return MathHelper.sqrt_float(p_sqrt_0_); + } + + public static float cos(float p_cos_0_) + { + return MathHelper.cos(p_cos_0_); + } + + public static int getInt(String p_getInt_0_, int p_getInt_1_, int p_getInt_2_) + { + return MathHelper.parseIntWithDefaultAndMax(p_getInt_0_, p_getInt_1_, p_getInt_2_); + } + + public static int fastFloor(double p_fastFloor_0_) + { + return MathHelper.truncateDoubleToInt(p_fastFloor_0_); + } + + public static double asbMax(double p_asbMax_0_, double p_asbMax_2_) + { + return MathHelper.abs_max(p_asbMax_0_, p_asbMax_2_); + } + + public static float nextFloat(Random p_nextFloat_0_, float p_nextFloat_1_, float p_nextFloat_2_) + { + return MathHelper.randomFloatClamp(p_nextFloat_0_, p_nextFloat_1_, p_nextFloat_2_); + } + + public static double wrapDegrees(double p_wrapDegrees_0_) + { + return MathHelper.wrapAngleTo180_double(p_wrapDegrees_0_); + } + + public static float wrapDegrees(float p_wrapDegrees_0_) + { + return MathHelper.wrapAngleTo180_float(p_wrapDegrees_0_); + } + + public static float clamp(float p_clamp_0_, float p_clamp_1_, float p_clamp_2_) + { + return MathHelper.clamp_float(p_clamp_0_, p_clamp_1_, p_clamp_2_); + } + + public static double getDouble(String p_getDouble_0_, double p_getDouble_1_, double p_getDouble_3_) + { + return MathHelper.parseDoubleWithDefaultAndMax(p_getDouble_0_, p_getDouble_1_, p_getDouble_3_); + } + + public static int roundUp(int p_roundUp_0_, int p_roundUp_1_) + { + return MathHelper.func_154354_b(p_roundUp_0_, p_roundUp_1_); + } + + public static double average(long[] p_average_0_) + { + return MathHelper.average(p_average_0_); + } + + public static int floor(float p_floor_0_) + { + return MathHelper.floor_float(p_floor_0_); + } + + public static int abs(int p_abs_0_) + { + return MathHelper.abs_int(p_abs_0_); + } + + public static int nextInt(Random p_nextInt_0_, int p_nextInt_1_, int p_nextInt_2_) + { + return MathHelper.getRandomIntegerInRange(p_nextInt_0_, p_nextInt_1_, p_nextInt_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScreen.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScreen.java new file mode 100644 index 0000000..69d038e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScreen.java @@ -0,0 +1,228 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiScreenRealmsProxy; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +@SideOnly(Side.CLIENT) +public class RealmsScreen +{ + public static final int SKIN_HEAD_U = 8; + public static final int SKIN_HEAD_V = 8; + public static final int SKIN_HEAD_WIDTH = 8; + public static final int SKIN_HEAD_HEIGHT = 8; + public static final int SKIN_TEX_WIDTH = 64; + public static final int SKIN_TEX_HEIGHT = 32; + public static final int SKIN_HAT_U = 40; + public static final int SKIN_HAT_V = 8; + public static final int SKIN_HAT_WIDTH = 8; + public static final int SKIN_HAT_HEIGHT = 8; + protected Minecraft minecraft; + public int width; + public int height; + private GuiScreenRealmsProxy proxy = new GuiScreenRealmsProxy(this); + private static final String __OBFID = "CL_00001898"; + + public GuiScreenRealmsProxy getProxy() + { + return this.proxy; + } + + public void init() {} + + public void init(Minecraft p_init_1_, int p_init_2_, int p_init_3_) {} + + public void drawCenteredString(String p_drawCenteredString_1_, int p_drawCenteredString_2_, int p_drawCenteredString_3_, int p_drawCenteredString_4_) + { + this.proxy.func_154325_a(p_drawCenteredString_1_, p_drawCenteredString_2_, p_drawCenteredString_3_, p_drawCenteredString_4_); + } + + public void drawString(String p_drawString_1_, int p_drawString_2_, int p_drawString_3_, int p_drawString_4_) + { + this.proxy.func_154322_b(p_drawString_1_, p_drawString_2_, p_drawString_3_, p_drawString_4_); + } + + public void blit(int p_blit_1_, int p_blit_2_, int p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_) + { + this.proxy.drawTexturedModalRect(p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, int p_blit_6_, int p_blit_7_, float p_blit_8_, float p_blit_9_) + { + Gui.func_152125_a(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_, p_blit_8_, p_blit_9_); + } + + public static void blit(int p_blit_0_, int p_blit_1_, float p_blit_2_, float p_blit_3_, int p_blit_4_, int p_blit_5_, float p_blit_6_, float p_blit_7_) + { + Gui.func_146110_a(p_blit_0_, p_blit_1_, p_blit_2_, p_blit_3_, p_blit_4_, p_blit_5_, p_blit_6_, p_blit_7_); + } + + public void fillGradient(int p_fillGradient_1_, int p_fillGradient_2_, int p_fillGradient_3_, int p_fillGradient_4_, int p_fillGradient_5_, int p_fillGradient_6_) + { + this.proxy.drawGradientRect(p_fillGradient_1_, p_fillGradient_2_, p_fillGradient_3_, p_fillGradient_4_, p_fillGradient_5_, p_fillGradient_6_); + } + + public void renderBackground() + { + this.proxy.drawDefaultBackground(); + } + + public boolean isPauseScreen() + { + return this.proxy.doesGuiPauseGame(); + } + + public void renderBackground(int p_renderBackground_1_) + { + this.proxy.drawWorldBackground(p_renderBackground_1_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + for (int k = 0; k < this.proxy.func_154320_j().size(); ++k) + { + ((RealmsButton)this.proxy.func_154320_j().get(k)).render(p_render_1_, p_render_2_); + } + } + + public void renderTooltip(ItemStack p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.renderToolTip(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(String p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.drawCreativeTabHoveringText(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public void renderTooltip(List p_renderTooltip_1_, int p_renderTooltip_2_, int p_renderTooltip_3_) + { + this.proxy.func_146283_a(p_renderTooltip_1_, p_renderTooltip_2_, p_renderTooltip_3_); + } + + public static void bindFace(String p_bindFace_0_) + { + ResourceLocation resourcelocation = AbstractClientPlayer.getLocationSkin(p_bindFace_0_); + + if (resourcelocation == null) + { + resourcelocation = AbstractClientPlayer.getLocationSkin("default"); + } + + AbstractClientPlayer.getDownloadImageSkin(resourcelocation, p_bindFace_0_); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation); + } + + public static void bind(String p_bind_0_) + { + ResourceLocation resourcelocation = new ResourceLocation(p_bind_0_); + Minecraft.getMinecraft().getTextureManager().bindTexture(resourcelocation); + } + + public void tick() {} + + public int width() + { + return this.proxy.width; + } + + public int height() + { + return this.proxy.height; + } + + public int fontLineHeight() + { + return this.proxy.func_154329_h(); + } + + public int fontWidth(String p_fontWidth_1_) + { + return this.proxy.func_154326_c(p_fontWidth_1_); + } + + public void fontDrawShadow(String p_fontDrawShadow_1_, int p_fontDrawShadow_2_, int p_fontDrawShadow_3_, int p_fontDrawShadow_4_) + { + this.proxy.func_154319_c(p_fontDrawShadow_1_, p_fontDrawShadow_2_, p_fontDrawShadow_3_, p_fontDrawShadow_4_); + } + + public List fontSplit(String p_fontSplit_1_, int p_fontSplit_2_) + { + return this.proxy.func_154323_a(p_fontSplit_1_, p_fontSplit_2_); + } + + public void buttonClicked(RealmsButton p_buttonClicked_1_) {} + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, String p_newButton_3_) + { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_); + } + + public static RealmsButton newButton(int p_newButton_0_, int p_newButton_1_, int p_newButton_2_, int p_newButton_3_, int p_newButton_4_, String p_newButton_5_) + { + return new RealmsButton(p_newButton_0_, p_newButton_1_, p_newButton_2_, p_newButton_3_, p_newButton_4_, p_newButton_5_); + } + + public void buttonsClear() + { + this.proxy.func_154324_i(); + } + + public void buttonsAdd(RealmsButton p_buttonsAdd_1_) + { + this.proxy.func_154327_a(p_buttonsAdd_1_); + } + + public List buttons() + { + return this.proxy.func_154320_j(); + } + + public void buttonsRemove(RealmsButton p_buttonsRemove_1_) + { + this.proxy.func_154328_b(p_buttonsRemove_1_); + } + + public RealmsEditBox newEditBox(int p_newEditBox_1_, int p_newEditBox_2_, int p_newEditBox_3_, int p_newEditBox_4_) + { + return new RealmsEditBox(p_newEditBox_1_, p_newEditBox_2_, p_newEditBox_3_, p_newEditBox_4_); + } + + public void mouseClicked(int p_mouseClicked_1_, int p_mouseClicked_2_, int p_mouseClicked_3_) {} + + public void mouseEvent() {} + + public void keyboardEvent() {} + + public void mouseReleased(int p_mouseReleased_1_, int p_mouseReleased_2_, int p_mouseReleased_3_) {} + + public void mouseDragged(int p_mouseDragged_1_, int p_mouseDragged_2_, int p_mouseDragged_3_, long p_mouseDragged_4_) {} + + public void keyPressed(char p_keyPressed_1_, int p_keyPressed_2_) {} + + public void confirmResult(boolean p_confirmResult_1_, int p_confirmResult_2_) {} + + public static String getLocalizedString(String p_getLocalizedString_0_) + { + return I18n.format(p_getLocalizedString_0_, new Object[0]); + } + + public static String getLocalizedString(String p_getLocalizedString_0_, Object ... p_getLocalizedString_1_) + { + return I18n.format(p_getLocalizedString_0_, p_getLocalizedString_1_); + } + + public RealmsAnvilLevelStorageSource getLevelStorageSource() + { + return new RealmsAnvilLevelStorageSource(Minecraft.getMinecraft().getSaveLoader()); + } + + public void removed() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScrolledSelectionList.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScrolledSelectionList.java new file mode 100644 index 0000000..ec7afee --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsScrolledSelectionList.java @@ -0,0 +1,68 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.gui.GuiSlotRealmsProxy; + +@SideOnly(Side.CLIENT) +public class RealmsScrolledSelectionList +{ + private final GuiSlotRealmsProxy proxy; + private static final String __OBFID = "CL_00001863"; + + public RealmsScrolledSelectionList(int p_i1119_1_, int p_i1119_2_, int p_i1119_3_, int p_i1119_4_, int p_i1119_5_) + { + this.proxy = new GuiSlotRealmsProxy(this, p_i1119_1_, p_i1119_2_, p_i1119_3_, p_i1119_4_, p_i1119_5_); + } + + public void render(int p_render_1_, int p_render_2_, float p_render_3_) + { + this.proxy.drawScreen(p_render_1_, p_render_2_, p_render_3_); + } + + public int width() + { + return this.proxy.func_154338_k(); + } + + public int ym() + { + return this.proxy.func_154339_l(); + } + + public int xm() + { + return this.proxy.func_154337_m(); + } + + protected void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, Tezzelator p_renderItem_5_, int p_renderItem_6_, int p_renderItem_7_) {} + + public void renderItem(int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_) + { + this.renderItem(p_renderItem_1_, p_renderItem_2_, p_renderItem_3_, p_renderItem_4_, Tezzelator.instance, p_renderItem_5_, p_renderItem_6_); + } + + public int getItemCount() + { + return 0; + } + + public void selectItem(int p_selectItem_1_, boolean p_selectItem_2_, int p_selectItem_3_, int p_selectItem_4_) {} + + public boolean isSelectedItem(int p_isSelectedItem_1_) + { + return false; + } + + public void renderBackground() {} + + public int getMaxPosition() + { + return 0; + } + + public int getScrollbarPosition() + { + return this.proxy.func_154338_k() / 2 + 124; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerAddress.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerAddress.java new file mode 100644 index 0000000..3fc7eba --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerAddress.java @@ -0,0 +1,114 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Hashtable; +import javax.naming.directory.Attributes; +import javax.naming.directory.InitialDirContext; + +@SideOnly(Side.CLIENT) +public class RealmsServerAddress +{ + private final String host; + private final int port; + private static final String __OBFID = "CL_00001864"; + + protected RealmsServerAddress(String p_i1121_1_, int p_i1121_2_) + { + this.host = p_i1121_1_; + this.port = p_i1121_2_; + } + + public String getHost() + { + return this.host; + } + + public int getPort() + { + return this.port; + } + + public static RealmsServerAddress parseString(String p_parseString_0_) + { + if (p_parseString_0_ == null) + { + return null; + } + else + { + String[] astring = p_parseString_0_.split(":"); + + if (p_parseString_0_.startsWith("[")) + { + int i = p_parseString_0_.indexOf("]"); + + if (i > 0) + { + String s1 = p_parseString_0_.substring(1, i); + String s2 = p_parseString_0_.substring(i + 1).trim(); + + if (s2.startsWith(":") && s2.length() > 0) + { + s2 = s2.substring(1); + astring = new String[] {s1, s2}; + } + else + { + astring = new String[] {s1}; + } + } + } + + if (astring.length > 2) + { + astring = new String[] {p_parseString_0_}; + } + + String s3 = astring[0]; + int j = astring.length > 1 ? parseInt(astring[1], 25565) : 25565; + + if (j == 25565) + { + String[] astring1 = lookupSrv(s3); + s3 = astring1[0]; + j = parseInt(astring1[1], 25565); + } + + return new RealmsServerAddress(s3, j); + } + } + + private static String[] lookupSrv(String p_lookupSrv_0_) + { + try + { + String s1 = "com.sun.jndi.dns.DnsContextFactory"; + Class.forName("com.sun.jndi.dns.DnsContextFactory"); + Hashtable hashtable = new Hashtable(); + hashtable.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory"); + hashtable.put("java.naming.provider.url", "dns:"); + hashtable.put("com.sun.jndi.dns.timeout.retries", "1"); + InitialDirContext initialdircontext = new InitialDirContext(hashtable); + Attributes attributes = initialdircontext.getAttributes("_minecraft._tcp." + p_lookupSrv_0_, new String[] {"SRV"}); + String[] astring = attributes.get("srv").get().toString().split(" ", 4); + return new String[] {astring[3], astring[2]}; + } + catch (Throwable throwable) + { + return new String[] {p_lookupSrv_0_, Integer.toString(25565)}; + } + } + + private static int parseInt(String p_parseInt_0_, int p_parseInt_1_) + { + try + { + return Integer.parseInt(p_parseInt_0_.trim()); + } + catch (Exception exception) + { + return p_parseInt_1_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerStatusPinger.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerStatusPinger.java new file mode 100644 index 0000000..cdb0ae9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsServerStatusPinger.java @@ -0,0 +1,149 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.util.concurrent.GenericFutureListener; +import java.io.IOException; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.status.INetHandlerStatusClient; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class RealmsServerStatusPinger +{ + private static final Logger LOGGER = LogManager.getLogger(); + private final List connections = Collections.synchronizedList(new ArrayList()); + private static final String __OBFID = "CL_00001854"; + + public void pingServer(final String p_pingServer_1_, final ServerPing p_pingServer_2_) throws IOException + { + if (p_pingServer_1_ != null && !p_pingServer_1_.startsWith("0.0.0.0") && !p_pingServer_1_.isEmpty()) + { + RealmsServerAddress realmsserveraddress = RealmsServerAddress.parseString(p_pingServer_1_); + final NetworkManager networkmanager = NetworkManager.provideLanClient(InetAddress.getByName(realmsserveraddress.getHost()), realmsserveraddress.getPort()); + this.connections.add(networkmanager); + networkmanager.setNetHandler(new INetHandlerStatusClient() + { + private boolean field_154345_e = false; + private static final String __OBFID = "CL_00001807"; + public void handleServerInfo(S00PacketServerInfo packetIn) + { + ServerStatusResponse serverstatusresponse = packetIn.func_149294_c(); + + if (serverstatusresponse.func_151318_b() != null) + { + p_pingServer_2_.nrOfPlayers = String.valueOf(serverstatusresponse.func_151318_b().func_151333_b()); + } + + networkmanager.scheduleOutboundPacket(new C01PacketPing(Realms.currentTimeMillis()), new GenericFutureListener[0]); + this.field_154345_e = true; + } + public void handlePong(S01PacketPong packetIn) + { + networkmanager.closeChannel(new ChatComponentText("Finished")); + } + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + if (!this.field_154345_e) + { + RealmsServerStatusPinger.LOGGER.error("Can\'t ping " + p_pingServer_1_ + ": " + reason.getUnformattedText()); + } + } + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). + * Typically throws IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + if (newState != EnumConnectionState.STATUS) + { + throw new UnsupportedOperationException("Unexpected change in protocol to " + newState); + } + } + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in + * NetHandlerLoginServer for a login-timeout + */ + public void onNetworkTick() {} + }); + + try + { + networkmanager.scheduleOutboundPacket(new C00Handshake(RealmsSharedConstants.NETWORK_PROTOCOL_VERSION, realmsserveraddress.getHost(), realmsserveraddress.getPort(), EnumConnectionState.STATUS), new GenericFutureListener[0]); + networkmanager.scheduleOutboundPacket(new C00PacketServerQuery(), new GenericFutureListener[0]); + } + catch (Throwable throwable) + { + LOGGER.error(throwable); + } + } + } + + public void tick() + { + List list = this.connections; + + synchronized (this.connections) + { + Iterator iterator = this.connections.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + networkmanager.processReceivedPackets(); + } + else + { + iterator.remove(); + + if (networkmanager.getExitMessage() != null) + { + networkmanager.getNetHandler().onDisconnect(networkmanager.getExitMessage()); + } + } + } + } + } + + public void removeAll() + { + List list = this.connections; + + synchronized (this.connections) + { + Iterator iterator = this.connections.iterator(); + + while (iterator.hasNext()) + { + NetworkManager networkmanager = (NetworkManager)iterator.next(); + + if (networkmanager.isChannelOpen()) + { + iterator.remove(); + networkmanager.closeChannel(new ChatComponentText("Cancelled")); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSharedConstants.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSharedConstants.java new file mode 100644 index 0000000..c60738f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSharedConstants.java @@ -0,0 +1,13 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RealmsSharedConstants +{ + public static int NETWORK_PROTOCOL_VERSION = 5; + public static int TICKS_PER_SECOND = 20; + public static String VERSION_STRING = "1.7.10"; + private static final String __OBFID = "CL_00001866"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSliderButton.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSliderButton.java new file mode 100644 index 0000000..6e4f365 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RealmsSliderButton.java @@ -0,0 +1,124 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +@SideOnly(Side.CLIENT) +public class RealmsSliderButton extends RealmsButton +{ + public float value; + public boolean sliding; + private final float minValue; + private final float maxValue; + private int steps; + private static final String __OBFID = "CL_00001834"; + + public RealmsSliderButton(int p_i1056_1_, int p_i1056_2_, int p_i1056_3_, int p_i1056_4_, int p_i1056_5_, int p_i1056_6_) + { + this(p_i1056_1_, p_i1056_2_, p_i1056_3_, p_i1056_4_, p_i1056_6_, 0, 1.0F, (float)p_i1056_5_); + } + + public RealmsSliderButton(int p_i1057_1_, int p_i1057_2_, int p_i1057_3_, int p_i1057_4_, int p_i1057_5_, int p_i1057_6_, float p_i1057_7_, float p_i1057_8_) + { + super(p_i1057_1_, p_i1057_2_, p_i1057_3_, p_i1057_4_, 20, ""); + this.value = 1.0F; + this.minValue = p_i1057_7_; + this.maxValue = p_i1057_8_; + this.value = this.toPct((float)p_i1057_6_); + this.getProxy().displayString = this.getMessage(); + } + + public String getMessage() + { + return ""; + } + + public float toPct(float p_toPct_1_) + { + return MathHelper.clamp_float((this.clamp(p_toPct_1_) - this.minValue) / (this.maxValue - this.minValue), 0.0F, 1.0F); + } + + public float toValue(float p_toValue_1_) + { + return this.clamp(this.minValue + (this.maxValue - this.minValue) * MathHelper.clamp_float(p_toValue_1_, 0.0F, 1.0F)); + } + + public float clamp(float p_clamp_1_) + { + p_clamp_1_ = this.clampSteps(p_clamp_1_); + return MathHelper.clamp_float(p_clamp_1_, this.minValue, this.maxValue); + } + + protected float clampSteps(float p_clampSteps_1_) + { + if (this.steps > 0) + { + p_clampSteps_1_ = (float)(this.steps * Math.round(p_clampSteps_1_ / (float)this.steps)); + } + + return p_clampSteps_1_; + } + + public int getYImage(boolean p_getYImage_1_) + { + return 0; + } + + public void renderBg(int p_renderBg_1_, int p_renderBg_2_) + { + if (this.getProxy().visible) + { + if (this.sliding) + { + this.value = (float)(p_renderBg_1_ - (this.getProxy().xPosition + 4)) / (float)(this.getProxy().getButtonWidth() - 8); + + if (this.value < 0.0F) + { + this.value = 0.0F; + } + + if (this.value > 1.0F) + { + this.value = 1.0F; + } + + float f = this.toValue(this.value); + this.clicked(f); + this.value = this.toPct(f); + this.getProxy().displayString = this.getMessage(); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.blit(this.getProxy().xPosition + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)), this.getProxy().yPosition, 0, 66, 4, 20); + this.blit(this.getProxy().xPosition + (int)(this.value * (float)(this.getProxy().getButtonWidth() - 8)) + 4, this.getProxy().yPosition, 196, 66, 4, 20); + } + } + + public void clicked(int p_clicked_1_, int p_clicked_2_) + { + this.value = (float)(p_clicked_1_ - (this.getProxy().xPosition + 4)) / (float)(this.getProxy().getButtonWidth() - 8); + + if (this.value < 0.0F) + { + this.value = 0.0F; + } + + if (this.value > 1.0F) + { + this.value = 1.0F; + } + + this.clicked(this.toValue(this.value)); + this.getProxy().displayString = this.getMessage(); + this.sliding = true; + } + + public void clicked(float p_clicked_1_) {} + + public void released(int p_released_1_, int p_released_2_) + { + this.sliding = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/RendererUtility.java b/build/rfg/minecraft-src/java/net/minecraft/realms/RendererUtility.java new file mode 100644 index 0000000..0272636 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/RendererUtility.java @@ -0,0 +1,15 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class RendererUtility +{ + private static final String __OBFID = "CL_00001899"; + + public static void render(RealmsButton p_render_0_, int p_render_1_, int p_render_2_) + { + p_render_0_.render(p_render_1_, p_render_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/ServerPing.java b/build/rfg/minecraft-src/java/net/minecraft/realms/ServerPing.java new file mode 100644 index 0000000..502c5fc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/ServerPing.java @@ -0,0 +1,12 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ServerPing +{ + public volatile String nrOfPlayers = "0"; + public volatile long lastPingSnapshot = 0L; + private static final String __OBFID = "CL_00001860"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/realms/Tezzelator.java b/build/rfg/minecraft-src/java/net/minecraft/realms/Tezzelator.java new file mode 100644 index 0000000..e6b72fe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/realms/Tezzelator.java @@ -0,0 +1,114 @@ +package net.minecraft.realms; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.shader.TesselatorVertexState; + +@SideOnly(Side.CLIENT) +public class Tezzelator +{ + public static Tessellator t = Tessellator.instance; + public static final Tezzelator instance = new Tezzelator(); + private static final String __OBFID = "CL_00001855"; + + public int end() + { + return t.draw(); + } + + public void vertex(double p_vertex_1_, double p_vertex_3_, double p_vertex_5_) + { + t.addVertex(p_vertex_1_, p_vertex_3_, p_vertex_5_); + } + + public void color(float p_color_1_, float p_color_2_, float p_color_3_, float p_color_4_) + { + t.setColorRGBA_F(p_color_1_, p_color_2_, p_color_3_, p_color_4_); + } + + public void color(int p_color_1_, int p_color_2_, int p_color_3_) + { + t.setColorOpaque(p_color_1_, p_color_2_, p_color_3_); + } + + public void tex2(int p_tex2_1_) + { + t.setBrightness(p_tex2_1_); + } + + public void normal(float p_normal_1_, float p_normal_2_, float p_normal_3_) + { + t.setNormal(p_normal_1_, p_normal_2_, p_normal_3_); + } + + public void noColor() + { + t.disableColor(); + } + + public void color(int p_color_1_) + { + t.setColorOpaque_I(p_color_1_); + } + + public void color(float p_color_1_, float p_color_2_, float p_color_3_) + { + t.setColorOpaque_F(p_color_1_, p_color_2_, p_color_3_); + } + + public TesselatorVertexState sortQuads(float p_sortQuads_1_, float p_sortQuads_2_, float p_sortQuads_3_) + { + return t.getVertexState(p_sortQuads_1_, p_sortQuads_2_, p_sortQuads_3_); + } + + public void restoreState(TesselatorVertexState p_restoreState_1_) + { + t.setVertexState(p_restoreState_1_); + } + + public void begin(int p_begin_1_) + { + t.startDrawing(p_begin_1_); + } + + public void begin() + { + t.startDrawingQuads(); + } + + public void vertexUV(double p_vertexUV_1_, double p_vertexUV_3_, double p_vertexUV_5_, double p_vertexUV_7_, double p_vertexUV_9_) + { + t.addVertexWithUV(p_vertexUV_1_, p_vertexUV_3_, p_vertexUV_5_, p_vertexUV_7_, p_vertexUV_9_); + } + + public void color(int p_color_1_, int p_color_2_) + { + t.setColorRGBA_I(p_color_1_, p_color_2_); + } + + public void offset(double p_offset_1_, double p_offset_3_, double p_offset_5_) + { + t.setTranslation(p_offset_1_, p_offset_3_, p_offset_5_); + } + + public void color(int p_color_1_, int p_color_2_, int p_color_3_, int p_color_4_) + { + t.setColorRGBA(p_color_1_, p_color_2_, p_color_3_, p_color_4_); + } + + public void addOffset(float p_addOffset_1_, float p_addOffset_2_, float p_addOffset_3_) + { + t.addTranslation(p_addOffset_1_, p_addOffset_2_, p_addOffset_3_); + } + + public void tex(double p_tex_1_, double p_tex_3_) + { + t.setTextureUV(p_tex_1_, p_tex_3_); + } + + public void color(byte p_color_1_, byte p_color_2_, byte p_color_3_) + { + t.func_154352_a(p_color_1_, p_color_2_, p_color_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java new file mode 100644 index 0000000..a102200 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/IScoreObjectiveCriteria.java @@ -0,0 +1,21 @@ +package net.minecraft.scoreboard; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public interface IScoreObjectiveCriteria +{ + Map field_96643_a = new HashMap(); + IScoreObjectiveCriteria field_96641_b = new ScoreDummyCriteria("dummy"); + IScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount"); + IScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount"); + IScoreObjectiveCriteria totalKillCount = new ScoreDummyCriteria("totalKillCount"); + IScoreObjectiveCriteria health = new ScoreHealthCriteria("health"); + + String func_96636_a(); + + int func_96635_a(List p_96635_1_); + + boolean isReadOnly(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Score.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Score.java new file mode 100644 index 0000000..0069b43 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Score.java @@ -0,0 +1,104 @@ +package net.minecraft.scoreboard; + +import java.util.Comparator; +import java.util.List; + +public class Score +{ + public static final Comparator field_96658_a = new Comparator() + { + private static final String __OBFID = "CL_00000618"; + public int compare(Score p_compare_1_, Score p_compare_2_) + { + return p_compare_1_.getScorePoints() > p_compare_2_.getScorePoints() ? 1 : (p_compare_1_.getScorePoints() < p_compare_2_.getScorePoints() ? -1 : 0); + } + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((Score)p_compare_1_, (Score)p_compare_2_); + } + }; + private final Scoreboard theScoreboard; + private final ScoreObjective theScoreObjective; + private final String scorePlayerName; + private int field_96655_e; + private static final String __OBFID = "CL_00000617"; + + public Score(Scoreboard p_i2309_1_, ScoreObjective p_i2309_2_, String p_i2309_3_) + { + this.theScoreboard = p_i2309_1_; + this.theScoreObjective = p_i2309_2_; + this.scorePlayerName = p_i2309_3_; + } + + public void increseScore(int p_96649_1_) + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.setScorePoints(this.getScorePoints() + p_96649_1_); + } + } + + public void decreaseScore(int p_96646_1_) + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.setScorePoints(this.getScorePoints() - p_96646_1_); + } + } + + public void func_96648_a() + { + if (this.theScoreObjective.getCriteria().isReadOnly()) + { + throw new IllegalStateException("Cannot modify read-only score"); + } + else + { + this.increseScore(1); + } + } + + public int getScorePoints() + { + return this.field_96655_e; + } + + public void setScorePoints(int p_96647_1_) + { + int j = this.field_96655_e; + this.field_96655_e = p_96647_1_; + + if (j != p_96647_1_) + { + this.getScoreScoreboard().func_96536_a(this); + } + } + + public ScoreObjective func_96645_d() + { + return this.theScoreObjective; + } + + public String getPlayerName() + { + return this.scorePlayerName; + } + + public Scoreboard getScoreScoreboard() + { + return this.theScoreboard; + } + + public void func_96651_a(List p_96651_1_) + { + this.setScorePoints(this.theScoreObjective.getCriteria().func_96635_a(p_96651_1_)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreDummyCriteria.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreDummyCriteria.java new file mode 100644 index 0000000..a78ca8d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreDummyCriteria.java @@ -0,0 +1,30 @@ +package net.minecraft.scoreboard; + +import java.util.List; + +public class ScoreDummyCriteria implements IScoreObjectiveCriteria +{ + private final String field_96644_g; + private static final String __OBFID = "CL_00000622"; + + public ScoreDummyCriteria(String p_i2311_1_) + { + this.field_96644_g = p_i2311_1_; + IScoreObjectiveCriteria.field_96643_a.put(p_i2311_1_, this); + } + + public String func_96636_a() + { + return this.field_96644_g; + } + + public int func_96635_a(List p_96635_1_) + { + return 0; + } + + public boolean isReadOnly() + { + return false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreHealthCriteria.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreHealthCriteria.java new file mode 100644 index 0000000..7a37dc9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreHealthCriteria.java @@ -0,0 +1,39 @@ +package net.minecraft.scoreboard; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; + +public class ScoreHealthCriteria extends ScoreDummyCriteria +{ + private static final String __OBFID = "CL_00000623"; + + public ScoreHealthCriteria(String p_i2312_1_) + { + super(p_i2312_1_); + } + + public int func_96635_a(List p_96635_1_) + { + float f = 0.0F; + EntityPlayer entityplayer; + + for (Iterator iterator = p_96635_1_.iterator(); iterator.hasNext(); f += entityplayer.getHealth() + entityplayer.getAbsorptionAmount()) + { + entityplayer = (EntityPlayer)iterator.next(); + } + + if (p_96635_1_.size() > 0) + { + f /= (float)p_96635_1_.size(); + } + + return MathHelper.ceiling_float_int(f); + } + + public boolean isReadOnly() + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreObjective.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreObjective.java new file mode 100644 index 0000000..d73ffc5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreObjective.java @@ -0,0 +1,49 @@ +package net.minecraft.scoreboard; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ScoreObjective +{ + private final Scoreboard theScoreboard; + private final String name; + /** The ScoreObjectiveCriteria for this objetive */ + private final IScoreObjectiveCriteria objectiveCriteria; + private String displayName; + private static final String __OBFID = "CL_00000614"; + + public ScoreObjective(Scoreboard p_i2307_1_, String p_i2307_2_, IScoreObjectiveCriteria p_i2307_3_) + { + this.theScoreboard = p_i2307_1_; + this.name = p_i2307_2_; + this.objectiveCriteria = p_i2307_3_; + this.displayName = p_i2307_2_; + } + + @SideOnly(Side.CLIENT) + public Scoreboard getScoreboard() + { + return this.theScoreboard; + } + + public String getName() + { + return this.name; + } + + public IScoreObjectiveCriteria getCriteria() + { + return this.objectiveCriteria; + } + + public String getDisplayName() + { + return this.displayName; + } + + public void setDisplayName(String p_96681_1_) + { + this.displayName = p_96681_1_; + this.theScoreboard.func_96532_b(this); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScorePlayerTeam.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScorePlayerTeam.java new file mode 100644 index 0000000..dbf1ae0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScorePlayerTeam.java @@ -0,0 +1,160 @@ +package net.minecraft.scoreboard; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +public class ScorePlayerTeam extends Team +{ + private final Scoreboard theScoreboard; + private final String field_96675_b; + /** A set of all team member usernames. */ + private final Set membershipSet = new HashSet(); + private String teamNameSPT; + private String namePrefixSPT = ""; + private String colorSuffix = ""; + private boolean allowFriendlyFire = true; + private boolean canSeeFriendlyInvisibles = true; + private static final String __OBFID = "CL_00000616"; + + public ScorePlayerTeam(Scoreboard p_i2308_1_, String p_i2308_2_) + { + this.theScoreboard = p_i2308_1_; + this.field_96675_b = p_i2308_2_; + this.teamNameSPT = p_i2308_2_; + } + + /** + * Retrieve the name by which this team is registered in the scoreboard + */ + public String getRegisteredName() + { + return this.field_96675_b; + } + + public String func_96669_c() + { + return this.teamNameSPT; + } + + public void setTeamName(String p_96664_1_) + { + if (p_96664_1_ == null) + { + throw new IllegalArgumentException("Name cannot be null"); + } + else + { + this.teamNameSPT = p_96664_1_; + this.theScoreboard.broadcastTeamRemoved(this); + } + } + + public Collection getMembershipCollection() + { + return this.membershipSet; + } + + /** + * Returns the color prefix for the player's team name + */ + public String getColorPrefix() + { + return this.namePrefixSPT; + } + + public void setNamePrefix(String p_96666_1_) + { + if (p_96666_1_ == null) + { + throw new IllegalArgumentException("Prefix cannot be null"); + } + else + { + this.namePrefixSPT = p_96666_1_; + this.theScoreboard.broadcastTeamRemoved(this); + } + } + + /** + * Returns the color suffix for the player's team name + */ + public String getColorSuffix() + { + return this.colorSuffix; + } + + public void setNameSuffix(String p_96662_1_) + { + if (p_96662_1_ == null) + { + throw new IllegalArgumentException("Suffix cannot be null"); + } + else + { + this.colorSuffix = p_96662_1_; + this.theScoreboard.broadcastTeamRemoved(this); + } + } + + public String formatString(String input) + { + return this.getColorPrefix() + input + this.getColorSuffix(); + } + + /** + * Returns the player name including the color prefixes and suffixes + */ + public static String formatPlayerName(Team p_96667_0_, String p_96667_1_) + { + return p_96667_0_ == null ? p_96667_1_ : p_96667_0_.formatString(p_96667_1_); + } + + public boolean getAllowFriendlyFire() + { + return this.allowFriendlyFire; + } + + public void setAllowFriendlyFire(boolean p_96660_1_) + { + this.allowFriendlyFire = p_96660_1_; + this.theScoreboard.broadcastTeamRemoved(this); + } + + public boolean func_98297_h() + { + return this.canSeeFriendlyInvisibles; + } + + public void setSeeFriendlyInvisiblesEnabled(boolean p_98300_1_) + { + this.canSeeFriendlyInvisibles = p_98300_1_; + this.theScoreboard.broadcastTeamRemoved(this); + } + + public int func_98299_i() + { + int i = 0; + + if (this.getAllowFriendlyFire()) + { + i |= 1; + } + + if (this.func_98297_h()) + { + i |= 2; + } + + return i; + } + + @SideOnly(Side.CLIENT) + public void func_98298_a(int p_98298_1_) + { + this.setAllowFriendlyFire((p_98298_1_ & 1) > 0); + this.setSeeFriendlyInvisiblesEnabled((p_98298_1_ & 2) > 0); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Scoreboard.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Scoreboard.java new file mode 100644 index 0000000..d935d4b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Scoreboard.java @@ -0,0 +1,362 @@ +package net.minecraft.scoreboard; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class Scoreboard +{ + /** Map of objective names to ScoreObjective objects. */ + private final Map scoreObjectives = new HashMap(); + private final Map scoreObjectiveCriterias = new HashMap(); + private final Map field_96544_c = new HashMap(); + private final ScoreObjective[] field_96541_d = new ScoreObjective[3]; + /** Map of teamnames to ScorePlayerTeam instances */ + private final Map teams = new HashMap(); + /** Map of usernames to ScorePlayerTeam objects. */ + private final Map teamMemberships = new HashMap(); + private static final String __OBFID = "CL_00000619"; + + /** + * Returns a ScoreObjective for the objective name + */ + public ScoreObjective getObjective(String p_96518_1_) + { + return (ScoreObjective)this.scoreObjectives.get(p_96518_1_); + } + + public ScoreObjective addScoreObjective(String p_96535_1_, IScoreObjectiveCriteria p_96535_2_) + { + ScoreObjective scoreobjective = this.getObjective(p_96535_1_); + + if (scoreobjective != null) + { + throw new IllegalArgumentException("An objective with the name \'" + p_96535_1_ + "\' already exists!"); + } + else + { + scoreobjective = new ScoreObjective(this, p_96535_1_, p_96535_2_); + Object object = (List)this.scoreObjectiveCriterias.get(p_96535_2_); + + if (object == null) + { + object = new ArrayList(); + this.scoreObjectiveCriterias.put(p_96535_2_, object); + } + + ((List)object).add(scoreobjective); + this.scoreObjectives.put(p_96535_1_, scoreobjective); + this.func_96522_a(scoreobjective); + return scoreobjective; + } + } + + public Collection func_96520_a(IScoreObjectiveCriteria p_96520_1_) + { + Collection collection = (Collection)this.scoreObjectiveCriterias.get(p_96520_1_); + return collection == null ? new ArrayList() : new ArrayList(collection); + } + + public Score func_96529_a(String p_96529_1_, ScoreObjective p_96529_2_) + { + Object object = (Map)this.field_96544_c.get(p_96529_1_); + + if (object == null) + { + object = new HashMap(); + this.field_96544_c.put(p_96529_1_, object); + } + + Score score = (Score)((Map)object).get(p_96529_2_); + + if (score == null) + { + score = new Score(this, p_96529_2_, p_96529_1_); + ((Map)object).put(p_96529_2_, score); + } + + return score; + } + + public Collection func_96534_i(ScoreObjective p_96534_1_) + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.field_96544_c.values().iterator(); + + while (iterator.hasNext()) + { + Map map = (Map)iterator.next(); + Score score = (Score)map.get(p_96534_1_); + + if (score != null) + { + arraylist.add(score); + } + } + + Collections.sort(arraylist, Score.field_96658_a); + return arraylist; + } + + public Collection getScoreObjectives() + { + return this.scoreObjectives.values(); + } + + public Collection getObjectiveNames() + { + return this.field_96544_c.keySet(); + } + + public void func_96515_c(String p_96515_1_) + { + Map map = (Map)this.field_96544_c.remove(p_96515_1_); + + if (map != null) + { + this.func_96516_a(p_96515_1_); + } + } + + public Collection func_96528_e() + { + Collection collection = this.field_96544_c.values(); + ArrayList arraylist = new ArrayList(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + Map map = (Map)iterator.next(); + arraylist.addAll(map.values()); + } + + return arraylist; + } + + public Map func_96510_d(String p_96510_1_) + { + Object object = (Map)this.field_96544_c.get(p_96510_1_); + + if (object == null) + { + object = new HashMap(); + } + + return (Map)object; + } + + public void func_96519_k(ScoreObjective p_96519_1_) + { + this.scoreObjectives.remove(p_96519_1_.getName()); + + for (int i = 0; i < 3; ++i) + { + if (this.func_96539_a(i) == p_96519_1_) + { + this.func_96530_a(i, (ScoreObjective)null); + } + } + + List list = (List)this.scoreObjectiveCriterias.get(p_96519_1_.getCriteria()); + + if (list != null) + { + list.remove(p_96519_1_); + } + + Iterator iterator = this.field_96544_c.values().iterator(); + + while (iterator.hasNext()) + { + Map map = (Map)iterator.next(); + map.remove(p_96519_1_); + } + + this.func_96533_c(p_96519_1_); + } + + public void func_96530_a(int p_96530_1_, ScoreObjective p_96530_2_) + { + this.field_96541_d[p_96530_1_] = p_96530_2_; + } + + public ScoreObjective func_96539_a(int p_96539_1_) + { + return this.field_96541_d[p_96539_1_]; + } + + /** + * Retrieve the ScorePlayerTeam instance identified by the passed team name + */ + public ScorePlayerTeam getTeam(String p_96508_1_) + { + return (ScorePlayerTeam)this.teams.get(p_96508_1_); + } + + /** + * Verifies that the given name doesn't already refer to an existing team, creates it otherwise and broadcasts the + * addition to all players + */ + public ScorePlayerTeam createTeam(String p_96527_1_) + { + ScorePlayerTeam scoreplayerteam = this.getTeam(p_96527_1_); + + if (scoreplayerteam != null) + { + throw new IllegalArgumentException("A team with the name \'" + p_96527_1_ + "\' already exists!"); + } + else + { + scoreplayerteam = new ScorePlayerTeam(this, p_96527_1_); + this.teams.put(p_96527_1_, scoreplayerteam); + this.broadcastTeamCreated(scoreplayerteam); + return scoreplayerteam; + } + } + + /** + * Removes the team from the scoreboard, updates all player memberships and broadcasts the deletion to all players + */ + public void removeTeam(ScorePlayerTeam p_96511_1_) + { + this.teams.remove(p_96511_1_.getRegisteredName()); + Iterator iterator = p_96511_1_.getMembershipCollection().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + this.teamMemberships.remove(s); + } + + this.func_96513_c(p_96511_1_); + } + + public boolean func_151392_a(String p_151392_1_, String p_151392_2_) + { + if (!this.teams.containsKey(p_151392_2_)) + { + return false; + } + else + { + ScorePlayerTeam scoreplayerteam = this.getTeam(p_151392_2_); + + if (this.getPlayersTeam(p_151392_1_) != null) + { + this.removePlayerFromTeams(p_151392_1_); + } + + this.teamMemberships.put(p_151392_1_, scoreplayerteam); + scoreplayerteam.getMembershipCollection().add(p_151392_1_); + return true; + } + } + + public boolean removePlayerFromTeams(String p_96524_1_) + { + ScorePlayerTeam scoreplayerteam = this.getPlayersTeam(p_96524_1_); + + if (scoreplayerteam != null) + { + this.removePlayerFromTeam(p_96524_1_, scoreplayerteam); + return true; + } + else + { + return false; + } + } + + /** + * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an + * IllegalStateException is thrown. + */ + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) + { + if (this.getPlayersTeam(p_96512_1_) != p_96512_2_) + { + throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team \'" + p_96512_2_.getRegisteredName() + "\'."); + } + else + { + this.teamMemberships.remove(p_96512_1_); + p_96512_2_.getMembershipCollection().remove(p_96512_1_); + } + } + + /** + * Retrieve all registered ScorePlayerTeam names + */ + public Collection getTeamNames() + { + return this.teams.keySet(); + } + + /** + * Retrieve all registered ScorePlayerTeam instances + */ + public Collection getTeams() + { + return this.teams.values(); + } + + /** + * Gets the ScorePlayerTeam object for the given username. + */ + public ScorePlayerTeam getPlayersTeam(String p_96509_1_) + { + return (ScorePlayerTeam)this.teamMemberships.get(p_96509_1_); + } + + public void func_96522_a(ScoreObjective p_96522_1_) {} + + public void func_96532_b(ScoreObjective p_96532_1_) {} + + public void func_96533_c(ScoreObjective p_96533_1_) {} + + public void func_96536_a(Score p_96536_1_) {} + + public void func_96516_a(String p_96516_1_) {} + + /** + * This packet will notify the players that this team is created, and that will register it on the client + */ + public void broadcastTeamCreated(ScorePlayerTeam p_96523_1_) {} + + /** + * This packet will notify the players that this team is removed + */ + public void broadcastTeamRemoved(ScorePlayerTeam p_96538_1_) {} + + public void func_96513_c(ScorePlayerTeam p_96513_1_) {} + + /** + * Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null. + */ + public static String getObjectiveDisplaySlot(int p_96517_0_) + { + switch (p_96517_0_) + { + case 0: + return "list"; + case 1: + return "sidebar"; + case 2: + return "belowName"; + default: + return null; + } + } + + /** + * Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2 for 'belowName', otherwise -1. + */ + public static int getObjectiveDisplaySlotNumber(String p_96537_0_) + { + return p_96537_0_.equalsIgnoreCase("list") ? 0 : (p_96537_0_.equalsIgnoreCase("sidebar") ? 1 : (p_96537_0_.equalsIgnoreCase("belowName") ? 2 : -1)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreboardSaveData.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreboardSaveData.java new file mode 100644 index 0000000..2bb76f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ScoreboardSaveData.java @@ -0,0 +1,241 @@ +package net.minecraft.scoreboard; + +import java.util.Collection; +import java.util.Iterator; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.world.WorldSavedData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ScoreboardSaveData extends WorldSavedData +{ + private static final Logger logger = LogManager.getLogger(); + private Scoreboard theScoreboard; + private NBTTagCompound field_96506_b; + private static final String __OBFID = "CL_00000620"; + + public ScoreboardSaveData() + { + this("scoreboard"); + } + + public ScoreboardSaveData(String p_i2310_1_) + { + super(p_i2310_1_); + } + + public void func_96499_a(Scoreboard p_96499_1_) + { + this.theScoreboard = p_96499_1_; + + if (this.field_96506_b != null) + { + this.readFromNBT(this.field_96506_b); + } + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound p_76184_1_) + { + if (this.theScoreboard == null) + { + this.field_96506_b = p_76184_1_; + } + else + { + this.func_96501_b(p_76184_1_.getTagList("Objectives", 10)); + this.func_96500_c(p_76184_1_.getTagList("PlayerScores", 10)); + + if (p_76184_1_.hasKey("DisplaySlots", 10)) + { + this.func_96504_c(p_76184_1_.getCompoundTag("DisplaySlots")); + } + + if (p_76184_1_.hasKey("Teams", 9)) + { + this.func_96498_a(p_76184_1_.getTagList("Teams", 10)); + } + } + } + + protected void func_96498_a(NBTTagList p_96498_1_) + { + for (int i = 0; i < p_96498_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_96498_1_.getCompoundTagAt(i); + ScorePlayerTeam scoreplayerteam = this.theScoreboard.createTeam(nbttagcompound.getString("Name")); + scoreplayerteam.setTeamName(nbttagcompound.getString("DisplayName")); + scoreplayerteam.setNamePrefix(nbttagcompound.getString("Prefix")); + scoreplayerteam.setNameSuffix(nbttagcompound.getString("Suffix")); + + if (nbttagcompound.hasKey("AllowFriendlyFire", 99)) + { + scoreplayerteam.setAllowFriendlyFire(nbttagcompound.getBoolean("AllowFriendlyFire")); + } + + if (nbttagcompound.hasKey("SeeFriendlyInvisibles", 99)) + { + scoreplayerteam.setSeeFriendlyInvisiblesEnabled(nbttagcompound.getBoolean("SeeFriendlyInvisibles")); + } + + this.func_96502_a(scoreplayerteam, nbttagcompound.getTagList("Players", 8)); + } + } + + protected void func_96502_a(ScorePlayerTeam p_96502_1_, NBTTagList p_96502_2_) + { + for (int i = 0; i < p_96502_2_.tagCount(); ++i) + { + this.theScoreboard.func_151392_a(p_96502_2_.getStringTagAt(i), p_96502_1_.getRegisteredName()); + } + } + + protected void func_96504_c(NBTTagCompound p_96504_1_) + { + for (int i = 0; i < 3; ++i) + { + if (p_96504_1_.hasKey("slot_" + i, 8)) + { + String s = p_96504_1_.getString("slot_" + i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(s); + this.theScoreboard.func_96530_a(i, scoreobjective); + } + } + } + + protected void func_96501_b(NBTTagList p_96501_1_) + { + for (int i = 0; i < p_96501_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_96501_1_.getCompoundTagAt(i); + IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria)IScoreObjectiveCriteria.field_96643_a.get(nbttagcompound.getString("CriteriaName")); + ScoreObjective scoreobjective = this.theScoreboard.addScoreObjective(nbttagcompound.getString("Name"), iscoreobjectivecriteria); + scoreobjective.setDisplayName(nbttagcompound.getString("DisplayName")); + } + } + + protected void func_96500_c(NBTTagList p_96500_1_) + { + for (int i = 0; i < p_96500_1_.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = p_96500_1_.getCompoundTagAt(i); + ScoreObjective scoreobjective = this.theScoreboard.getObjective(nbttagcompound.getString("Objective")); + Score score = this.theScoreboard.func_96529_a(nbttagcompound.getString("Name"), scoreobjective); + score.setScorePoints(nbttagcompound.getInteger("Score")); + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound p_76187_1_) + { + if (this.theScoreboard == null) + { + logger.warn("Tried to save scoreboard without having a scoreboard..."); + } + else + { + p_76187_1_.setTag("Objectives", this.func_96505_b()); + p_76187_1_.setTag("PlayerScores", this.func_96503_e()); + p_76187_1_.setTag("Teams", this.func_96496_a()); + this.func_96497_d(p_76187_1_); + } + } + + protected NBTTagList func_96496_a() + { + NBTTagList nbttaglist = new NBTTagList(); + Collection collection = this.theScoreboard.getTeams(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)iterator.next(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreplayerteam.getRegisteredName()); + nbttagcompound.setString("DisplayName", scoreplayerteam.func_96669_c()); + nbttagcompound.setString("Prefix", scoreplayerteam.getColorPrefix()); + nbttagcompound.setString("Suffix", scoreplayerteam.getColorSuffix()); + nbttagcompound.setBoolean("AllowFriendlyFire", scoreplayerteam.getAllowFriendlyFire()); + nbttagcompound.setBoolean("SeeFriendlyInvisibles", scoreplayerteam.func_98297_h()); + NBTTagList nbttaglist1 = new NBTTagList(); + Iterator iterator1 = scoreplayerteam.getMembershipCollection().iterator(); + + while (iterator1.hasNext()) + { + String s = (String)iterator1.next(); + nbttaglist1.appendTag(new NBTTagString(s)); + } + + nbttagcompound.setTag("Players", nbttaglist1); + nbttaglist.appendTag(nbttagcompound); + } + + return nbttaglist; + } + + protected void func_96497_d(NBTTagCompound p_96497_1_) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + boolean flag = false; + + for (int i = 0; i < 3; ++i) + { + ScoreObjective scoreobjective = this.theScoreboard.func_96539_a(i); + + if (scoreobjective != null) + { + nbttagcompound1.setString("slot_" + i, scoreobjective.getName()); + flag = true; + } + } + + if (flag) + { + p_96497_1_.setTag("DisplaySlots", nbttagcompound1); + } + } + + protected NBTTagList func_96505_b() + { + NBTTagList nbttaglist = new NBTTagList(); + Collection collection = this.theScoreboard.getScoreObjectives(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", scoreobjective.getName()); + nbttagcompound.setString("CriteriaName", scoreobjective.getCriteria().func_96636_a()); + nbttagcompound.setString("DisplayName", scoreobjective.getDisplayName()); + nbttaglist.appendTag(nbttagcompound); + } + + return nbttaglist; + } + + protected NBTTagList func_96503_e() + { + NBTTagList nbttaglist = new NBTTagList(); + Collection collection = this.theScoreboard.func_96528_e(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + Score score = (Score)iterator.next(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("Name", score.getPlayerName()); + nbttagcompound.setString("Objective", score.func_96645_d().getName()); + nbttagcompound.setInteger("Score", score.getScorePoints()); + nbttaglist.appendTag(nbttagcompound); + } + + return nbttaglist; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ServerScoreboard.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ServerScoreboard.java new file mode 100644 index 0000000..9bbc688 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/ServerScoreboard.java @@ -0,0 +1,270 @@ +package net.minecraft.scoreboard; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S3BPacketScoreboardObjective; +import net.minecraft.network.play.server.S3CPacketUpdateScore; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.server.MinecraftServer; + +public class ServerScoreboard extends Scoreboard +{ + private final MinecraftServer scoreboardMCServer; + private final Set field_96553_b = new HashSet(); + private ScoreboardSaveData field_96554_c; + private static final String __OBFID = "CL_00001424"; + + public ServerScoreboard(MinecraftServer p_i1501_1_) + { + this.scoreboardMCServer = p_i1501_1_; + } + + public void func_96536_a(Score p_96536_1_) + { + super.func_96536_a(p_96536_1_); + + if (this.field_96553_b.contains(p_96536_1_.func_96645_d())) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96536_1_, 0)); + } + + this.func_96551_b(); + } + + public void func_96516_a(String p_96516_1_) + { + super.func_96516_a(p_96516_1_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3CPacketUpdateScore(p_96516_1_)); + this.func_96551_b(); + } + + public void func_96530_a(int p_96530_1_, ScoreObjective p_96530_2_) + { + ScoreObjective scoreobjective1 = this.func_96539_a(p_96530_1_); + super.func_96530_a(p_96530_1_, p_96530_2_); + + if (scoreobjective1 != p_96530_2_ && scoreobjective1 != null) + { + if (this.func_96552_h(scoreobjective1) > 0) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } + else + { + this.func_96546_g(scoreobjective1); + } + } + + if (p_96530_2_ != null) + { + if (this.field_96553_b.contains(p_96530_2_)) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3DPacketDisplayScoreboard(p_96530_1_, p_96530_2_)); + } + else + { + this.func_96549_e(p_96530_2_); + } + } + + this.func_96551_b(); + } + + public boolean func_151392_a(String p_151392_1_, String p_151392_2_) + { + if (super.func_151392_a(p_151392_1_, p_151392_2_)) + { + ScorePlayerTeam scoreplayerteam = this.getTeam(p_151392_2_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(scoreplayerteam, Arrays.asList(new String[] {p_151392_1_}), 3)); + this.func_96551_b(); + return true; + } + else + { + return false; + } + } + + /** + * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an + * IllegalStateException is thrown. + */ + public void removePlayerFromTeam(String p_96512_1_, ScorePlayerTeam p_96512_2_) + { + super.removePlayerFromTeam(p_96512_1_, p_96512_2_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96512_2_, Arrays.asList(new String[] {p_96512_1_}), 4)); + this.func_96551_b(); + } + + public void func_96522_a(ScoreObjective p_96522_1_) + { + super.func_96522_a(p_96522_1_); + this.func_96551_b(); + } + + public void func_96532_b(ScoreObjective p_96532_1_) + { + super.func_96532_b(p_96532_1_); + + if (this.field_96553_b.contains(p_96532_1_)) + { + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3BPacketScoreboardObjective(p_96532_1_, 2)); + } + + this.func_96551_b(); + } + + public void func_96533_c(ScoreObjective p_96533_1_) + { + super.func_96533_c(p_96533_1_); + + if (this.field_96553_b.contains(p_96533_1_)) + { + this.func_96546_g(p_96533_1_); + } + + this.func_96551_b(); + } + + /** + * This packet will notify the players that this team is created, and that will register it on the client + */ + public void broadcastTeamCreated(ScorePlayerTeam p_96523_1_) + { + super.broadcastTeamCreated(p_96523_1_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96523_1_, 0)); + this.func_96551_b(); + } + + /** + * This packet will notify the players that this team is removed + */ + public void broadcastTeamRemoved(ScorePlayerTeam p_96538_1_) + { + super.broadcastTeamRemoved(p_96538_1_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96538_1_, 2)); + this.func_96551_b(); + } + + public void func_96513_c(ScorePlayerTeam p_96513_1_) + { + super.func_96513_c(p_96513_1_); + this.scoreboardMCServer.getConfigurationManager().sendPacketToAllPlayers(new S3EPacketTeams(p_96513_1_, 1)); + this.func_96551_b(); + } + + public void func_96547_a(ScoreboardSaveData p_96547_1_) + { + this.field_96554_c = p_96547_1_; + } + + protected void func_96551_b() + { + if (this.field_96554_c != null) + { + this.field_96554_c.markDirty(); + } + } + + public List func_96550_d(ScoreObjective p_96550_1_) + { + ArrayList arraylist = new ArrayList(); + arraylist.add(new S3BPacketScoreboardObjective(p_96550_1_, 0)); + + for (int i = 0; i < 3; ++i) + { + if (this.func_96539_a(i) == p_96550_1_) + { + arraylist.add(new S3DPacketDisplayScoreboard(i, p_96550_1_)); + } + } + + Iterator iterator = this.func_96534_i(p_96550_1_).iterator(); + + while (iterator.hasNext()) + { + Score score = (Score)iterator.next(); + arraylist.add(new S3CPacketUpdateScore(score, 0)); + } + + return arraylist; + } + + public void func_96549_e(ScoreObjective p_96549_1_) + { + List list = this.func_96550_d(p_96549_1_); + Iterator iterator = this.scoreboardMCServer.getConfigurationManager().playerEntityList.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + Packet packet = (Packet)iterator1.next(); + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.add(p_96549_1_); + } + + public List func_96548_f(ScoreObjective p_96548_1_) + { + ArrayList arraylist = new ArrayList(); + arraylist.add(new S3BPacketScoreboardObjective(p_96548_1_, 1)); + + for (int i = 0; i < 3; ++i) + { + if (this.func_96539_a(i) == p_96548_1_) + { + arraylist.add(new S3DPacketDisplayScoreboard(i, p_96548_1_)); + } + } + + return arraylist; + } + + public void func_96546_g(ScoreObjective p_96546_1_) + { + List list = this.func_96548_f(p_96546_1_); + Iterator iterator = this.scoreboardMCServer.getConfigurationManager().playerEntityList.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + Packet packet = (Packet)iterator1.next(); + entityplayermp.playerNetServerHandler.sendPacket(packet); + } + } + + this.field_96553_b.remove(p_96546_1_); + } + + public int func_96552_h(ScoreObjective p_96552_1_) + { + int i = 0; + + for (int j = 0; j < 3; ++j) + { + if (this.func_96539_a(j) == p_96552_1_) + { + ++i; + } + } + + return i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Team.java b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Team.java new file mode 100644 index 0000000..7c14b8e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/scoreboard/Team.java @@ -0,0 +1,29 @@ +package net.minecraft.scoreboard; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class Team +{ + private static final String __OBFID = "CL_00000621"; + + /** + * Same as == + */ + public boolean isSameTeam(Team other) + { + return other == null ? false : this == other; + } + + /** + * Retrieve the name by which this team is registered in the scoreboard + */ + public abstract String getRegisteredName(); + + public abstract String formatString(String input); + + @SideOnly(Side.CLIENT) + public abstract boolean func_98297_h(); + + public abstract boolean getAllowFriendlyFire(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/MinecraftServer.java b/build/rfg/minecraft-src/java/net/minecraft/server/MinecraftServer.java new file mode 100644 index 0000000..9258af3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +1,1649 @@ +package net.minecraft.server; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfileRepository; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.LoaderState; +import cpw.mods.fml.common.StartupQuery; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufOutputStream; +import io.netty.buffer.Unpooled; +import io.netty.handler.codec.base64.Base64; +import java.awt.GraphicsEnvironment; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.net.Proxy; +import java.security.KeyPair; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.Callable; +import javax.imageio.ImageIO; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Bootstrap; +import net.minecraft.network.NetworkSystem; +import net.minecraft.network.ServerStatusResponse; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.rcon.RConConsoleSource; +import net.minecraft.profiler.IPlayerUsage; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.profiler.Profiler; +import net.minecraft.server.dedicated.DedicatedServer; +import net.minecraft.server.gui.IUpdatePlayerListBox; +import net.minecraft.server.management.PlayerProfileCache; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.chunk.storage.AnvilSaveConverter; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveFormat; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.WorldInfo; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; + +public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage +{ + private static final Logger logger = LogManager.getLogger(); + public static final File field_152367_a = new File("usercache.json"); + /** Instance of Minecraft Server. */ + private static MinecraftServer mcServer; + private final ISaveFormat anvilConverterForAnvilFile; + /** The PlayerUsageSnooper instance. */ + private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getSystemTimeMillis()); + private final File anvilFile; + /** Collection of objects to update every tick. Type: List */ + private final List tickables = new ArrayList(); + private final ICommandManager commandManager; + public final Profiler theProfiler = new Profiler(); + private final NetworkSystem field_147144_o; + private final ServerStatusResponse field_147147_p = new ServerStatusResponse(); + private final Random field_147146_q = new Random(); + /** The server's hostname. */ + @SideOnly(Side.SERVER) + private String hostname; + /** The server's port. */ + private int serverPort = -1; + /** The server world instances. */ + public WorldServer[] worldServers = new WorldServer[0]; + /** The ServerConfigurationManager instance. */ + private ServerConfigurationManager serverConfigManager; + /** Indicates whether the server is running or not. Set to false to initiate a shutdown. */ + private boolean serverRunning = true; + /** Indicates to other classes that the server is safely stopped. */ + private boolean serverStopped; + /** Incremented every tick. */ + private int tickCounter; + protected final Proxy serverProxy; + /** The task the server is currently working on(and will output on outputPercentRemaining). */ + public String currentTask; + /** The percentage of the current task finished so far. */ + public int percentDone; + /** True if the server is in online mode. */ + private boolean onlineMode; + /** True if the server has animals turned on. */ + private boolean canSpawnAnimals; + private boolean canSpawnNPCs; + /** Indicates whether PvP is active on the server or not. */ + private boolean pvpEnabled; + /** Determines if flight is allowed or not. */ + private boolean allowFlight; + /** The server MOTD string. */ + private String motd; + /** Maximum build height. */ + private int buildLimit; + private int field_143008_E = 0; + public final long[] tickTimeArray = new long[100]; + //public long[][] timeOfLastDimensionTick; + public Hashtable worldTickTimes = new Hashtable(); + private KeyPair serverKeyPair; + /** Username of the server owner (for integrated servers) */ + private String serverOwner; + private String folderName; + @SideOnly(Side.CLIENT) + private String worldName; + private boolean isDemo; + private boolean enableBonusChest; + /** If true, there is no need to save chunks or stop the server, because that is already being done. */ + private boolean worldIsBeingDeleted; + private String field_147141_M = ""; + private boolean serverIsRunning; + /** Set when warned for "Can't keep up", which triggers again after 15 seconds. */ + private long timeOfLastWarning; + private String userMessage; + private boolean startProfiling; + private boolean isGamemodeForced; + private final YggdrasilAuthenticationService field_152364_T; + private final MinecraftSessionService field_147143_S; + private long field_147142_T = 0L; + private final GameProfileRepository field_152365_W; + private final PlayerProfileCache field_152366_X; + private static final String __OBFID = "CL_00001462"; + + public MinecraftServer(File workDir, Proxy proxy) + { + this.field_152366_X = new PlayerProfileCache(this, field_152367_a); + mcServer = this; + this.serverProxy = proxy; + this.anvilFile = workDir; + this.field_147144_o = new NetworkSystem(this); + this.commandManager = new ServerCommandManager(); + this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir); + this.field_152364_T = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString()); + this.field_147143_S = this.field_152364_T.createMinecraftSessionService(); + this.field_152365_W = this.field_152364_T.createProfileRepository(); + } + + /** + * Initialises the server and starts it. + */ + protected abstract boolean startServer() throws IOException; + + protected void convertMapIfNeeded(String p_71237_1_) + { + if (this.getActiveAnvilConverter().isOldMapFormat(p_71237_1_)) + { + logger.info("Converting map!"); + this.setUserMessage("menu.convertingLevel"); + this.getActiveAnvilConverter().convertMapFormat(p_71237_1_, new IProgressUpdate() + { + private long field_96245_b = System.currentTimeMillis(); + private static final String __OBFID = "CL_00001417"; + /** + * "Saving level", or the loading,or downloading equivelent + */ + public void displayProgressMessage(String p_73720_1_) {} + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + public void setLoadingProgress(int p_73718_1_) + { + if (System.currentTimeMillis() - this.field_96245_b >= 1000L) + { + this.field_96245_b = System.currentTimeMillis(); + MinecraftServer.logger.info("Converting... " + p_73718_1_ + "%"); + } + } + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets + * progress to 0, and the WorkingString to "working...". + */ + @SideOnly(Side.CLIENT) + public void resetProgressAndMessage(String p_73721_1_) {} + @SideOnly(Side.CLIENT) + public void func_146586_a() {} + /** + * This is called with "Working..." by resetProgressAndMessage + */ + public void resetProgresAndWorkingMessage(String p_73719_1_) {} + }); + } + } + + /** + * Typically "menu.convertingLevel", "menu.loadingLevel" or others. + */ + protected synchronized void setUserMessage(String message) + { + this.userMessage = message; + } + + @SideOnly(Side.CLIENT) + + public synchronized String getUserMessage() + { + return this.userMessage; + } + + protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) + { + this.convertMapIfNeeded(p_71247_1_); + this.setUserMessage("menu.loadingLevel"); + ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true); + WorldInfo worldinfo = isavehandler.loadWorldInfo(); + WorldSettings worldsettings; + + if (worldinfo == null) + { + worldsettings = new WorldSettings(p_71247_3_, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), p_71247_5_); + worldsettings.func_82750_a(p_71247_6_); + } + else + { + worldsettings = new WorldSettings(worldinfo); + } + + if (this.enableBonusChest) + { + worldsettings.enableBonusChest(); + } + + WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, worldsettings, theProfiler)); + for (int dim : DimensionManager.getStaticDimensionIDs()) + { + WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, worldsettings, overWorld, theProfiler)); + world.addWorldAccess(new WorldManager(this, world)); + + if (!this.isSinglePlayer()) + { + world.getWorldInfo().setGameType(this.getGameType()); + } + + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + } + + this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld }); + this.func_147139_a(this.func_147135_j()); + this.initialWorldChunkLoad(); + } + + protected void initialWorldChunkLoad() + { + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + int i = 0; + this.setUserMessage("menu.generatingTerrain"); + byte b0 = 0; + logger.info("Preparing start region for level " + b0); + WorldServer worldserver = this.worldServers[b0]; + ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint(); + long j = getSystemTimeMillis(); + + for (int k = -192; k <= 192 && this.isServerRunning(); k += 16) + { + for (int l = -192; l <= 192 && this.isServerRunning(); l += 16) + { + long i1 = getSystemTimeMillis(); + + if (i1 - j > 1000L) + { + this.outputPercentRemaining("Preparing spawn area", i * 100 / 625); + j = i1; + } + + ++i; + worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + k >> 4, chunkcoordinates.posZ + l >> 4); + } + } + + this.clearCurrentTask(); + } + + public abstract boolean canStructuresSpawn(); + + public abstract WorldSettings.GameType getGameType(); + + public abstract EnumDifficulty func_147135_j(); + + /** + * Defaults to false. + */ + public abstract boolean isHardcore(); + + public abstract int getOpPermissionLevel(); + + public abstract boolean func_152363_m(); + + /** + * Used to display a percent remaining given text and the percentage. + */ + protected void outputPercentRemaining(String message, int percent) + { + this.currentTask = message; + this.percentDone = percent; + logger.info(message + ": " + percent + "%"); + } + + /** + * Set current task to null and set its percentage to 0. + */ + protected void clearCurrentTask() + { + this.currentTask = null; + this.percentDone = 0; + } + + /** + * par1 indicates if a log message should be output. + */ + protected void saveAllWorlds(boolean dontLog) + { + if (!this.worldIsBeingDeleted) + { + WorldServer[] aworldserver = this.worldServers; + if (aworldserver == null) return; //Forge: Just in case, NPE protection as it has been encountered. + int i = aworldserver.length; + + for (int j = 0; j < i; ++j) + { + WorldServer worldserver = aworldserver[j]; + + if (worldserver != null) + { + if (!dontLog) + { + logger.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionName()); + } + + try + { + worldserver.saveAllChunks(true, (IProgressUpdate)null); + } + catch (MinecraftException minecraftexception) + { + logger.warn(minecraftexception.getMessage()); + } + } + } + } + } + + /** + * Saves all necessary data as preparation for stopping the server. + */ + public void stopServer() + { + if (!this.worldIsBeingDeleted && Loader.instance().hasReachedState(LoaderState.SERVER_STARTED) && !serverStopped) // make sure the save is valid and we don't save twice + { + logger.info("Stopping server"); + + if (this.func_147137_ag() != null) + { + this.func_147137_ag().terminateEndpoints(); + } + + if (this.serverConfigManager != null) + { + logger.info("Saving players"); + this.serverConfigManager.saveAllPlayerData(); + this.serverConfigManager.removeAllPlayers(); + } + + if (this.worldServers != null) + { + logger.info("Saving worlds"); + this.saveAllWorlds(false); + + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); + worldserver.flush(); + } + + WorldServer[] tmp = worldServers; + for (WorldServer world : tmp) + { + DimensionManager.setWorld(world.provider.dimensionId, null); + } + } + + if (this.usageSnooper.isSnooperRunning()) + { + this.usageSnooper.stopSnooper(); + } + } + } + + public boolean isServerRunning() + { + return this.serverRunning; + } + + /** + * Sets the serverRunning variable to false, in order to get the server to shut down. + */ + public void initiateShutdown() + { + this.serverRunning = false; + } + + public void run() + { + try + { + if (this.startServer()) + { + FMLCommonHandler.instance().handleServerStarted(); + long i = getSystemTimeMillis(); + long l = 0L; + this.field_147147_p.func_151315_a(new ChatComponentText(this.motd)); + this.field_147147_p.func_151321_a(new ServerStatusResponse.MinecraftProtocolVersionIdentifier("1.7.10", 5)); + this.func_147138_a(this.field_147147_p); + + while (this.serverRunning) + { + long j = getSystemTimeMillis(); + long k = j - i; + + if (k > 2000L && i - this.timeOfLastWarning >= 15000L) + { + logger.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] {Long.valueOf(k), Long.valueOf(k / 50L)}); + k = 2000L; + this.timeOfLastWarning = i; + } + + if (k < 0L) + { + logger.warn("Time ran backwards! Did the system time change?"); + k = 0L; + } + + l += k; + i = j; + + if (this.worldServers[0].areAllPlayersAsleep()) + { + this.tick(); + l = 0L; + } + else + { + while (l > 50L) + { + l -= 50L; + this.tick(); + } + } + + Thread.sleep(Math.max(1L, 50L - l)); + this.serverIsRunning = true; + } + FMLCommonHandler.instance().handleServerStopping(); + FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + } + else + { + FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + this.finalTick((CrashReport)null); + } + } + catch (StartupQuery.AbortedException e) + { + // ignore silently + FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + } + catch (Throwable throwable1) + { + logger.error("Encountered an unexpected exception", throwable1); + CrashReport crashreport = null; + + if (throwable1 instanceof ReportedException) + { + crashreport = this.addServerInfoToCrashReport(((ReportedException)throwable1).getCrashReport()); + } + else + { + crashreport = this.addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", throwable1)); + } + + File file1 = new File(new File(this.getDataDirectory(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); + + if (crashreport.saveToFile(file1)) + { + logger.error("This crash report has been saved to: " + file1.getAbsolutePath()); + } + else + { + logger.error("We were unable to save this crash report to disk."); + } + + FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + this.finalTick(crashreport); + } + finally + { + try + { + this.stopServer(); + this.serverStopped = true; + } + catch (Throwable throwable) + { + logger.error("Exception stopping the server", throwable); + } + finally + { + FMLCommonHandler.instance().handleServerStopped(); + this.serverStopped = true; + this.systemExitNow(); + } + } + } + + private void func_147138_a(ServerStatusResponse response) + { + File file1 = this.getFile("server-icon.png"); + + if (file1.isFile()) + { + ByteBuf bytebuf = Unpooled.buffer(); + + try + { + BufferedImage bufferedimage = ImageIO.read(file1); + Validate.validState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide", new Object[0]); + Validate.validState(bufferedimage.getHeight() == 64, "Must be 64 pixels high", new Object[0]); + ImageIO.write(bufferedimage, "PNG", new ByteBufOutputStream(bytebuf)); + ByteBuf bytebuf1 = Base64.encode(bytebuf); + response.func_151320_a("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8)); + } + catch (Exception exception) + { + logger.error("Couldn\'t load server icon", exception); + } + finally + { + bytebuf.release(); + } + } + } + + protected File getDataDirectory() + { + return new File("."); + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport report) {} + + /** + * Directly calls System.exit(0), instantly killing the program. + */ + protected void systemExitNow() {} + + /** + * Main function called by run() every loop. + */ + public void tick() + { + long i = System.nanoTime(); + FMLCommonHandler.instance().onPreServerTick(); + ++this.tickCounter; + + if (this.startProfiling) + { + this.startProfiling = false; + this.theProfiler.profilingEnabled = true; + this.theProfiler.clearProfiling(); + } + + this.theProfiler.startSection("root"); + this.updateTimeLightAndEntities(); + + if (i - this.field_147142_T >= 5000000000L) + { + this.field_147142_T = i; + this.field_147147_p.func_151319_a(new ServerStatusResponse.PlayerCountData(this.getMaxPlayers(), this.getCurrentPlayerCount())); + GameProfile[] agameprofile = new GameProfile[Math.min(this.getCurrentPlayerCount(), 12)]; + int j = MathHelper.getRandomIntegerInRange(this.field_147146_q, 0, this.getCurrentPlayerCount() - agameprofile.length); + + for (int k = 0; k < agameprofile.length; ++k) + { + agameprofile[k] = ((EntityPlayerMP)this.serverConfigManager.playerEntityList.get(j + k)).getGameProfile(); + } + + Collections.shuffle(Arrays.asList(agameprofile)); + this.field_147147_p.func_151318_b().func_151330_a(agameprofile); + } + + if (this.tickCounter % 900 == 0) + { + this.theProfiler.startSection("save"); + this.serverConfigManager.saveAllPlayerData(); + this.saveAllWorlds(true); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tallying"); + this.tickTimeArray[this.tickCounter % 100] = System.nanoTime() - i; + this.theProfiler.endSection(); + this.theProfiler.startSection("snooper"); + + if (!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) + { + this.usageSnooper.startSnooper(); + } + + if (this.tickCounter % 6000 == 0) + { + this.usageSnooper.addMemoryStatsToSnooper(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + FMLCommonHandler.instance().onPostServerTick(); + } + + public void updateTimeLightAndEntities() + { + this.theProfiler.startSection("levels"); + net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(); + int i; + + Integer[] ids = DimensionManager.getIDs(this.tickCounter % 200 == 0); + for (int x = 0; x < ids.length; x++) + { + int id = ids[x]; + long j = System.nanoTime(); + + if (id == 0 || this.getAllowNether()) + { + WorldServer worldserver = DimensionManager.getWorld(id); + this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); + this.theProfiler.startSection("pools"); + this.theProfiler.endSection(); + + if (this.tickCounter % 20 == 0) + { + this.theProfiler.startSection("timeSync"); + this.serverConfigManager.sendPacketToAllPlayersInDimension(new S03PacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), worldserver.provider.dimensionId); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tick"); + FMLCommonHandler.instance().onPreWorldTick(worldserver); + CrashReport crashreport; + + try + { + worldserver.tick(); + } + catch (Throwable throwable1) + { + crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world"); + worldserver.addWorldInfoToCrashReport(crashreport); + throw new ReportedException(crashreport); + } + + try + { + worldserver.updateEntities(); + } + catch (Throwable throwable) + { + crashreport = CrashReport.makeCrashReport(throwable, "Exception ticking world entities"); + worldserver.addWorldInfoToCrashReport(crashreport); + throw new ReportedException(crashreport); + } + + FMLCommonHandler.instance().onPostWorldTick(worldserver); + this.theProfiler.endSection(); + this.theProfiler.startSection("tracker"); + worldserver.getEntityTracker().updateTrackedEntities(); + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - j; + } + + this.theProfiler.endStartSection("dim_unloading"); + DimensionManager.unloadWorlds(worldTickTimes); + this.theProfiler.endStartSection("connection"); + this.func_147137_ag().networkTick(); + this.theProfiler.endStartSection("players"); + this.serverConfigManager.sendPlayerInfoToAllPlayers(); + this.theProfiler.endStartSection("tickables"); + + for (i = 0; i < this.tickables.size(); ++i) + { + ((IUpdatePlayerListBox)this.tickables.get(i)).update(); + } + + this.theProfiler.endSection(); + } + + public boolean getAllowNether() + { + return true; + } + + public void startServerThread() + { + StartupQuery.reset(); + (new Thread("Server thread") + { + private static final String __OBFID = "CL_00001418"; + public void run() + { + MinecraftServer.this.run(); + } + }).start(); + } + + /** + * Returns a File object from the specified string. + */ + public File getFile(String fileName) + { + return new File(this.getDataDirectory(), fileName); + } + + /** + * Logs the message with a level of WARN. + */ + public void logWarning(String msg) + { + logger.warn(msg); + } + + /** + * Gets the worldServer by the given dimension. + */ + public WorldServer worldServerForDimension(int dimension) + { + WorldServer ret = DimensionManager.getWorld(dimension); + if (ret == null) + { + DimensionManager.initDimension(dimension); + ret = DimensionManager.getWorld(dimension); + } + return ret; + } + + /** + * Returns the server's Minecraft version as string. + */ + public String getMinecraftVersion() + { + return "1.7.10"; + } + + /** + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() + { + return this.serverConfigManager.getCurrentPlayerCount(); + } + + /** + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() + { + return this.serverConfigManager.getMaxPlayers(); + } + + /** + * Returns an array of the usernames of all the connected players. + */ + public String[] getAllUsernames() + { + return this.serverConfigManager.getAllUsernames(); + } + + public GameProfile[] func_152357_F() + { + return this.serverConfigManager.func_152600_g(); + } + + public String getServerModName() + { + return FMLCommonHandler.instance().getModName(); + } + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport report) + { + report.getCategory().addCrashSectionCallable("Profiler Position", new Callable() + { + private static final String __OBFID = "CL_00001419"; + public String call() + { + return MinecraftServer.this.theProfiler.profilingEnabled ? MinecraftServer.this.theProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + }); + + if (this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) + { + report.getCategory().addCrashSectionCallable("Vec3 Pool Size", new Callable() + { + private static final String __OBFID = "CL_00001420"; + public String call() + { + byte b0 = 0; + int i = 56 * b0; + int j = i / 1024 / 1024; + byte b1 = 0; + int k = 56 * b1; + int l = k / 1024 / 1024; + return b0 + " (" + i + " bytes; " + j + " MB) allocated, " + b1 + " (" + k + " bytes; " + l + " MB) used"; + } + }); + } + + if (this.serverConfigManager != null) + { + report.getCategory().addCrashSectionCallable("Player Count", new Callable() + { + private static final String __OBFID = "CL_00001780"; + public String call() + { + return MinecraftServer.this.serverConfigManager.getCurrentPlayerCount() + " / " + MinecraftServer.this.serverConfigManager.getMaxPlayers() + "; " + MinecraftServer.this.serverConfigManager.playerEntityList; + } + }); + } + + return report; + } + + /** + * If par2Str begins with /, then it searches for commands, otherwise it returns players. + */ + public List getPossibleCompletions(ICommandSender sender, String input) + { + ArrayList arraylist = new ArrayList(); + + if (input.startsWith("/")) + { + input = input.substring(1); + boolean flag = !input.contains(" "); + List list = this.commandManager.getPossibleCommands(sender, input); + + if (list != null) + { + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + String s3 = (String)iterator.next(); + + if (flag) + { + arraylist.add("/" + s3); + } + else + { + arraylist.add(s3); + } + } + } + + return arraylist; + } + else + { + String[] astring = input.split(" ", -1); + String s1 = astring[astring.length - 1]; + String[] astring1 = this.serverConfigManager.getAllUsernames(); + int i = astring1.length; + + for (int j = 0; j < i; ++j) + { + String s2 = astring1[j]; + + if (CommandBase.doesStringStartWith(s1, s2)) + { + arraylist.add(s2); + } + } + + return arraylist; + } + } + + /** + * Gets mcServer. + */ + public static MinecraftServer getServer() + { + return mcServer; + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + return "Server"; + } + + /** + * Notifies this sender of some sort of information. This is for messages intended to display to the user. Used + * for typical output (like "you asked for whether or not this game rule is set, so here's your answer"), warnings + * (like "I fetched this block for you by ID, but I'd like you to know that every time you do this, I die a little + * inside"), and errors (like "it's not called iron_pixacke, silly"). + */ + public void addChatMessage(IChatComponent message) + { + logger.info(message.getUnformattedText()); + } + + /** + * Returns true if the command sender is allowed to use the given command. + */ + public boolean canCommandSenderUseCommand(int permissionLevel, String command) + { + return true; + } + + public ICommandManager getCommandManager() + { + return this.commandManager; + } + + /** + * Gets KeyPair instanced in MinecraftServer. + */ + public KeyPair getKeyPair() + { + return this.serverKeyPair; + } + + /** + * Returns the username of the server owner (for integrated servers) + */ + public String getServerOwner() + { + return this.serverOwner; + } + + /** + * Sets the username of the owner of this server (in the case of an integrated server) + */ + public void setServerOwner(String owner) + { + this.serverOwner = owner; + } + + public boolean isSinglePlayer() + { + return this.serverOwner != null; + } + + public String getFolderName() + { + return this.folderName; + } + + public void setFolderName(String name) + { + this.folderName = name; + } + + @SideOnly(Side.CLIENT) + public void setWorldName(String p_71246_1_) + { + this.worldName = p_71246_1_; + } + + @SideOnly(Side.CLIENT) + public String getWorldName() + { + return this.worldName; + } + + public void setKeyPair(KeyPair keyPair) + { + this.serverKeyPair = keyPair; + } + + public void func_147139_a(EnumDifficulty difficulty) + { + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; + + if (worldserver != null) + { + if (worldserver.getWorldInfo().isHardcoreModeEnabled()) + { + worldserver.difficultySetting = EnumDifficulty.HARD; + worldserver.setAllowedSpawnTypes(true, true); + } + else if (this.isSinglePlayer()) + { + worldserver.difficultySetting = difficulty; + worldserver.setAllowedSpawnTypes(worldserver.difficultySetting != EnumDifficulty.PEACEFUL, true); + } + else + { + worldserver.difficultySetting = difficulty; + worldserver.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); + } + } + } + } + + protected boolean allowSpawnMonsters() + { + return true; + } + + /** + * Gets whether this is a demo or not. + */ + public boolean isDemo() + { + return this.isDemo; + } + + /** + * Sets whether this is a demo or not. + */ + public void setDemo(boolean demo) + { + this.isDemo = demo; + } + + public void canCreateBonusChest(boolean enable) + { + this.enableBonusChest = enable; + } + + public ISaveFormat getActiveAnvilConverter() + { + return this.anvilConverterForAnvilFile; + } + + /** + * WARNING : directly calls + * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName()); + */ + public void deleteWorldAndStopServer() + { + this.worldIsBeingDeleted = true; + this.getActiveAnvilConverter().flushCache(); + + for (int i = 0; i < this.worldServers.length; ++i) + { + WorldServer worldserver = this.worldServers[i]; + + if (worldserver != null) + { + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); + worldserver.flush(); + } + } + + this.getActiveAnvilConverter().deleteWorldDirectory(this.worldServers[0].getSaveHandler().getWorldDirectoryName()); + this.initiateShutdown(); + } + + public String getTexturePack() + { + return this.field_147141_M; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.func_152768_a("whitelist_enabled", Boolean.valueOf(false)); + playerSnooper.func_152768_a("whitelist_count", Integer.valueOf(0)); + playerSnooper.func_152768_a("players_current", Integer.valueOf(this.getCurrentPlayerCount())); + playerSnooper.func_152768_a("players_max", Integer.valueOf(this.getMaxPlayers())); + playerSnooper.func_152768_a("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); + playerSnooper.func_152768_a("uses_auth", Boolean.valueOf(this.onlineMode)); + playerSnooper.func_152768_a("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); + playerSnooper.func_152768_a("run_time", Long.valueOf((getSystemTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L)); + playerSnooper.func_152768_a("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); + int i = 0; + + for (int j = 0; j < this.worldServers.length; ++j) + { + if (this.worldServers[j] != null) + { + WorldServer worldserver = this.worldServers[j]; + WorldInfo worldinfo = worldserver.getWorldInfo(); + playerSnooper.func_152768_a("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.dimensionId)); + playerSnooper.func_152768_a("world[" + i + "][mode]", worldinfo.getGameType()); + playerSnooper.func_152768_a("world[" + i + "][difficulty]", worldserver.difficultySetting); + playerSnooper.func_152768_a("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled())); + playerSnooper.func_152768_a("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName()); + playerSnooper.func_152768_a("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion())); + playerSnooper.func_152768_a("world[" + i + "][height]", Integer.valueOf(this.buildLimit)); + playerSnooper.func_152768_a("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount())); + ++i; + } + } + + playerSnooper.func_152768_a("worlds", Integer.valueOf(i)); + } + + public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.func_152767_b("singleplayer", Boolean.valueOf(this.isSinglePlayer())); + playerSnooper.func_152767_b("server_brand", this.getServerModName()); + playerSnooper.func_152767_b("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); + playerSnooper.func_152767_b("dedicated", Boolean.valueOf(this.isDedicatedServer())); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() + { + return true; + } + + public abstract boolean isDedicatedServer(); + + public boolean isServerInOnlineMode() + { + return this.onlineMode; + } + + public void setOnlineMode(boolean online) + { + this.onlineMode = online; + } + + public boolean getCanSpawnAnimals() + { + return this.canSpawnAnimals; + } + + public void setCanSpawnAnimals(boolean spawnAnimals) + { + this.canSpawnAnimals = spawnAnimals; + } + + public boolean getCanSpawnNPCs() + { + return this.canSpawnNPCs; + } + + public void setCanSpawnNPCs(boolean spawnNpcs) + { + this.canSpawnNPCs = spawnNpcs; + } + + public boolean isPVPEnabled() + { + return this.pvpEnabled; + } + + public void setAllowPvp(boolean allowPvp) + { + this.pvpEnabled = allowPvp; + } + + public boolean isFlightAllowed() + { + return this.allowFlight; + } + + public void setAllowFlight(boolean allow) + { + this.allowFlight = allow; + } + + /** + * Return whether command blocks are enabled. + */ + public abstract boolean isCommandBlockEnabled(); + + public String getMOTD() + { + return this.motd; + } + + public void setMOTD(String motdIn) + { + this.motd = motdIn; + } + + public int getBuildLimit() + { + return this.buildLimit; + } + + public void setBuildLimit(int maxBuildHeight) + { + this.buildLimit = maxBuildHeight; + } + + public ServerConfigurationManager getConfigurationManager() + { + return this.serverConfigManager; + } + + public void func_152361_a(ServerConfigurationManager configManager) + { + this.serverConfigManager = configManager; + } + + /** + * Sets the game type for all worlds. + */ + public void setGameType(WorldSettings.GameType gameMode) + { + for (int i = 0; i < this.worldServers.length; ++i) + { + getServer().worldServers[i].getWorldInfo().setGameType(gameMode); + } + } + + public NetworkSystem func_147137_ag() + { + return this.field_147144_o; + } + + @SideOnly(Side.CLIENT) + public boolean serverIsInRunLoop() + { + return this.serverIsRunning; + } + + public boolean getGuiEnabled() + { + return false; + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public abstract String shareToLAN(WorldSettings.GameType type, boolean allowCheats); + + public int getTickCounter() + { + return this.tickCounter; + } + + public void enableProfiling() + { + this.startProfiling = true; + } + + @SideOnly(Side.CLIENT) + public PlayerUsageSnooper getPlayerUsageSnooper() + { + return this.usageSnooper; + } + + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(0, 0, 0); + } + + public World getEntityWorld() + { + return this.worldServers[0]; + } + + /** + * Return the spawn protection area's size. + */ + public int getSpawnProtectionSize() + { + return 16; + } + + /** + * Returns true if a player does not have permission to edit the block at the given coordinates. + */ + public boolean isBlockProtected(World inWorld, int x, int y, int z, EntityPlayer player) + { + return false; + } + + public boolean getForceGamemode() + { + return this.isGamemodeForced; + } + + public Proxy getServerProxy() + { + return this.serverProxy; + } + + /** + * returns the difference, measured in milliseconds, between the current system time and midnight, January 1, 1970 + * UTC. + */ + public static long getSystemTimeMillis() + { + return System.currentTimeMillis(); + } + + public int func_143007_ar() + { + return this.field_143008_E; + } + + public void func_143006_e(int idleTimeout) + { + this.field_143008_E = idleTimeout; + } + + public IChatComponent func_145748_c_() + { + return new ChatComponentText(this.getCommandSenderName()); + } + + public boolean func_147136_ar() + { + return true; + } + + public MinecraftSessionService func_147130_as() + { + return this.field_147143_S; + } + + public GameProfileRepository func_152359_aw() + { + return this.field_152365_W; + } + + public PlayerProfileCache func_152358_ax() + { + return this.field_152366_X; + } + + public ServerStatusResponse func_147134_at() + { + return this.field_147147_p; + } + + public void func_147132_au() + { + this.field_147142_T = 0L; + } + + /** + * "getHostname" is already taken, but both return the hostname. + */ + @SideOnly(Side.SERVER) + public String getServerHostname() + { + return this.hostname; + } + + @SideOnly(Side.SERVER) + public void setHostname(String host) + { + this.hostname = host; + } + + @SideOnly(Side.SERVER) + public void func_82010_a(IUpdatePlayerListBox p_82010_1_) + { + this.tickables.add(p_82010_1_); + } + + @SideOnly(Side.SERVER) + public static void main(String[] p_main_0_) + { + Bootstrap.func_151354_b(); + + try + { + boolean flag = true; + String s = null; + String s1 = "."; + String s2 = null; + boolean flag1 = false; + boolean flag2 = false; + int i = -1; + + for (int j = 0; j < p_main_0_.length; ++j) + { + String s3 = p_main_0_[j]; + String s4 = j == p_main_0_.length - 1 ? null : p_main_0_[j + 1]; + boolean flag3 = false; + + if (!s3.equals("nogui") && !s3.equals("--nogui")) + { + if (s3.equals("--port") && s4 != null) + { + flag3 = true; + + try + { + i = Integer.parseInt(s4); + } + catch (NumberFormatException numberformatexception) + { + ; + } + } + else if (s3.equals("--singleplayer") && s4 != null) + { + flag3 = true; + s = s4; + } + else if (s3.equals("--universe") && s4 != null) + { + flag3 = true; + s1 = s4; + } + else if (s3.equals("--world") && s4 != null) + { + flag3 = true; + s2 = s4; + } + else if (s3.equals("--demo")) + { + flag1 = true; + } + else if (s3.equals("--bonusChest")) + { + flag2 = true; + } + } + else + { + flag = false; + } + + if (flag3) + { + ++j; + } + } + + final DedicatedServer dedicatedserver = new DedicatedServer(new File(s1)); + + if (s != null) + { + dedicatedserver.setServerOwner(s); + } + + if (s2 != null) + { + dedicatedserver.setFolderName(s2); + } + + if (i >= 0) + { + dedicatedserver.setServerPort(i); + } + + if (flag1) + { + dedicatedserver.setDemo(true); + } + + if (flag2) + { + dedicatedserver.canCreateBonusChest(true); + } + + if (flag && !GraphicsEnvironment.isHeadless()) + { + dedicatedserver.setGuiEnabled(); + } + + dedicatedserver.startServerThread(); + Runtime.getRuntime().addShutdownHook(new Thread("Server Shutdown Thread") + { + private static final String __OBFID = "CL_00001806"; + public void run() + { + dedicatedserver.stopServer(); + } + }); + } + catch (Exception exception) + { + logger.fatal("Failed to start the minecraft server", exception); + } + } + + /** + * Logs the message with a level of INFO. + */ + @SideOnly(Side.SERVER) + public void logInfo(String msg) + { + logger.info(msg); + } + + /** + * Returns the server's hostname. + */ + @SideOnly(Side.SERVER) + public String getHostname() + { + return this.hostname; + } + + /** + * Never used, but "getServerPort" is already taken. + */ + @SideOnly(Side.SERVER) + public int getPort() + { + return this.serverPort; + } + + /** + * Returns the server message of the day + */ + @SideOnly(Side.SERVER) + public String getMotd() + { + return this.motd; + } + + /** + * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". + */ + @SideOnly(Side.SERVER) + public String getPlugins() + { + return ""; + } + + /** + * Handle a command received by an RCon instance + */ + @SideOnly(Side.SERVER) + public String handleRConCommand(String command) + { + RConConsoleSource.instance.resetLog(); + this.commandManager.executeCommand(RConConsoleSource.instance, command); + return RConConsoleSource.instance.getLogContents(); + } + + /** + * Returns true if debugging is enabled, false otherwise. + */ + @SideOnly(Side.SERVER) + public boolean isDebuggingEnabled() + { + return false; + } + + /** + * Logs the error message with a level of SEVERE. + */ + @SideOnly(Side.SERVER) + public void logSevere(String msg) + { + logger.error(msg); + } + + /** + * If isDebuggingEnabled(), logs the message with a level of INFO. + */ + @SideOnly(Side.SERVER) + public void logDebug(String msg) + { + if (this.isDebuggingEnabled()) + { + logger.info(msg); + } + } + + /** + * Gets serverPort. + */ + @SideOnly(Side.SERVER) + public int getServerPort() + { + return this.serverPort; + } + + @SideOnly(Side.SERVER) + public void setServerPort(int port) + { + this.serverPort = port; + } + + @SideOnly(Side.SERVER) + public void func_155759_m(String resourcePackUrl) + { + this.field_147141_M = resourcePackUrl; + } + + public boolean isServerStopped() + { + return this.serverStopped; + } + + @SideOnly(Side.SERVER) + public void setForceGamemode(boolean force) + { + this.isGamemodeForced = force; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/ServerEula.java b/build/rfg/minecraft-src/java/net/minecraft/server/ServerEula.java new file mode 100644 index 0000000..24f438d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/ServerEula.java @@ -0,0 +1,77 @@ +package net.minecraft.server; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.Properties; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class ServerEula +{ + private static final Logger field_154349_a = LogManager.getLogger(); + private final File field_154350_b; + private final boolean field_154351_c; + private static final String __OBFID = "CL_00001911"; + + public ServerEula(File p_i1227_1_) + { + this.field_154350_b = p_i1227_1_; + this.field_154351_c = this.func_154347_a(p_i1227_1_); + } + + private boolean func_154347_a(File inFile) + { + FileInputStream fileinputstream = null; + boolean flag = false; + + try + { + Properties properties = new Properties(); + fileinputstream = new FileInputStream(inFile); + properties.load(fileinputstream); + flag = Boolean.parseBoolean(properties.getProperty("eula", "false")); + } + catch (Exception exception) + { + field_154349_a.warn("Failed to load " + inFile); + this.func_154348_b(); + } + finally + { + IOUtils.closeQuietly(fileinputstream); + } + + return flag; + } + + public boolean func_154346_a() + { + return this.field_154351_c; + } + + public void func_154348_b() + { + FileOutputStream fileoutputstream = null; + + try + { + Properties properties = new Properties(); + fileoutputstream = new FileOutputStream(this.field_154350_b); + properties.setProperty("eula", "false"); + properties.store(fileoutputstream, "By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula)."); + } + catch (Exception exception) + { + field_154349_a.warn("Failed to save " + this.field_154350_b, exception); + } + finally + { + IOUtils.closeQuietly(fileoutputstream); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedPlayerList.java new file mode 100644 index 0000000..76325a3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedPlayerList.java @@ -0,0 +1,189 @@ +package net.minecraft.server.dedicated; + +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ServerConfigurationManager; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class DedicatedPlayerList extends ServerConfigurationManager +{ + private static final Logger field_164439_d = LogManager.getLogger(); + private static final String __OBFID = "CL_00001783"; + + public DedicatedPlayerList(DedicatedServer server) + { + super(server); + this.func_152611_a(server.getIntProperty("view-distance", 10)); + this.maxPlayers = server.getIntProperty("max-players", 20); + this.setWhiteListEnabled(server.getBooleanProperty("white-list", false)); + + if (!server.isSinglePlayer()) + { + this.func_152608_h().func_152686_a(true); + this.getBannedIPs().func_152686_a(true); + } + + this.func_152620_y(); + this.func_152617_w(); + this.func_152619_x(); + this.func_152618_v(); + this.loadOpsList(); + this.readWhiteList(); + this.saveOpsList(); + + if (!this.func_152599_k().func_152691_c().exists()) + { + this.saveWhiteList(); + } + } + + public void setWhiteListEnabled(boolean whitelistEnabled) + { + super.setWhiteListEnabled(whitelistEnabled); + this.getServerInstance().setProperty("white-list", Boolean.valueOf(whitelistEnabled)); + this.getServerInstance().saveProperties(); + } + + public void func_152605_a(GameProfile profile) + { + super.func_152605_a(profile); + this.saveOpsList(); + } + + public void func_152610_b(GameProfile profile) + { + super.func_152610_b(profile); + this.saveOpsList(); + } + + public void func_152597_c(GameProfile profile) + { + super.func_152597_c(profile); + this.saveWhiteList(); + } + + public void func_152601_d(GameProfile profile) + { + super.func_152601_d(profile); + this.saveWhiteList(); + } + + /** + * Either does nothing, or calls readWhiteList. + */ + public void loadWhiteList() + { + this.readWhiteList(); + } + + private void func_152618_v() + { + try + { + this.getBannedIPs().func_152678_f(); + } + catch (IOException ioexception) + { + field_164439_d.warn("Failed to save ip banlist: ", ioexception); + } + } + + private void func_152617_w() + { + try + { + this.func_152608_h().func_152678_f(); + } + catch (IOException ioexception) + { + field_164439_d.warn("Failed to save user banlist: ", ioexception); + } + } + + private void func_152619_x() + { + try + { + this.getBannedIPs().func_152679_g(); + } + catch (IOException ioexception) + { + field_164439_d.warn("Failed to load ip banlist: ", ioexception); + } + } + + private void func_152620_y() + { + try + { + this.func_152608_h().func_152679_g(); + } + catch (IOException ioexception) + { + field_164439_d.warn("Failed to load user banlist: ", ioexception); + } + } + + private void loadOpsList() + { + try + { + this.func_152603_m().func_152679_g(); + } + catch (Exception exception) + { + field_164439_d.warn("Failed to load operators list: ", exception); + } + } + + private void saveOpsList() + { + try + { + this.func_152603_m().func_152678_f(); + } + catch (Exception exception) + { + field_164439_d.warn("Failed to save operators list: ", exception); + } + } + + private void readWhiteList() + { + try + { + this.func_152599_k().func_152679_g(); + } + catch (Exception exception) + { + field_164439_d.warn("Failed to load white-list: ", exception); + } + } + + private void saveWhiteList() + { + try + { + this.func_152599_k().func_152678_f(); + } + catch (Exception exception) + { + field_164439_d.warn("Failed to save white-list: ", exception); + } + } + + public boolean func_152607_e(GameProfile profile) + { + return !this.isWhiteListEnabled() || this.func_152596_g(profile) || this.func_152599_k().func_152705_a(profile); + } + + public DedicatedServer getServerInstance() + { + return (DedicatedServer)super.getServerInstance(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedServer.java b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedServer.java new file mode 100644 index 0000000..2aee5c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -0,0 +1,621 @@ +package net.minecraft.server.dedicated; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.net.Proxy; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.ServerCommand; +import net.minecraft.crash.CrashReport; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.rcon.IServer; +import net.minecraft.network.rcon.RConThreadMain; +import net.minecraft.network.rcon.RConThreadQuery; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.ServerEula; +import net.minecraft.server.gui.MinecraftServerGui; +import net.minecraft.server.management.PreYggdrasilConverter; +import net.minecraft.server.management.ServerConfigurationManager; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.CryptManager; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class DedicatedServer extends MinecraftServer implements IServer +{ + private static final Logger field_155771_h = LogManager.getLogger(); + public final List pendingCommandList = Collections.synchronizedList(new ArrayList()); + private RConThreadQuery theRConThreadQuery; + private RConThreadMain theRConThreadMain; + private PropertyManager settings; + private ServerEula field_154332_n; + private boolean canSpawnStructures; + private WorldSettings.GameType gameType; + private boolean guiIsEnabled; + public static boolean allowPlayerLogins = false; + private static final String __OBFID = "CL_00001784"; + + public DedicatedServer(File workDir) + { + super(workDir, Proxy.NO_PROXY); + Thread thread = new Thread("Server Infinisleeper") + { + private static final String __OBFID = "CL_00001787"; + { + this.setDaemon(true); + this.start(); + } + public void run() + { + while (true) + { + try + { + while (true) + { + Thread.sleep(2147483647L); + } + } + catch (InterruptedException interruptedexception) + { + ; + } + } + } + }; + } + + /** + * Initialises the server and starts it. + */ + protected boolean startServer() throws IOException + { + Thread thread = new Thread("Server console handler") + { + private static final String __OBFID = "CL_00001786"; + public void run() + { + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in)); + String s4; + + try + { + while (!DedicatedServer.this.isServerStopped() && DedicatedServer.this.isServerRunning() && (s4 = bufferedreader.readLine()) != null) + { + DedicatedServer.this.addPendingCommand(s4, DedicatedServer.this); + } + } + catch (IOException ioexception1) + { + DedicatedServer.field_155771_h.error("Exception handling console input", ioexception1); + } + } + }; + thread.setDaemon(true); + thread.start(); + field_155771_h.info("Starting minecraft server version 1.7.10"); + + if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) + { + field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + } + + FMLCommonHandler.instance().onServerStart(this); + + field_155771_h.info("Loading properties"); + this.settings = new PropertyManager(new File("server.properties")); + this.field_154332_n = new ServerEula(new File("eula.txt")); + + if (!this.field_154332_n.func_154346_a()) + { + field_155771_h.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); + this.field_154332_n.func_154348_b(); + return false; + } + else + { + if (this.isSinglePlayer()) + { + this.setHostname("127.0.0.1"); + } + else + { + this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); + this.setHostname(this.settings.getStringProperty("server-ip", "")); + } + + this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); + this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); + this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); + this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); + this.func_155759_m(this.settings.getStringProperty("resource-pack", "")); + this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server")); + this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); + this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); + + if (this.settings.getIntProperty("difficulty", 1) < 0) + { + this.settings.setProperty("difficulty", Integer.valueOf(0)); + } + else if (this.settings.getIntProperty("difficulty", 1) > 3) + { + this.settings.setProperty("difficulty", Integer.valueOf(3)); + } + + this.canSpawnStructures = this.settings.getBooleanProperty("generate-structures", true); + int i = this.settings.getIntProperty("gamemode", WorldSettings.GameType.SURVIVAL.getID()); + this.gameType = WorldSettings.getGameTypeById(i); + field_155771_h.info("Default game type: " + this.gameType); + InetAddress inetaddress = null; + + if (this.getServerHostname().length() > 0) + { + inetaddress = InetAddress.getByName(this.getServerHostname()); + } + + if (this.getServerPort() < 0) + { + this.setServerPort(this.settings.getIntProperty("server-port", 25565)); + } + + field_155771_h.info("Generating keypair"); + this.setKeyPair(CryptManager.createNewKeyPair()); + field_155771_h.info("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); + + try + { + this.func_147137_ag().addLanEndpoint(inetaddress, this.getServerPort()); + } + catch (IOException ioexception) + { + field_155771_h.warn("**** FAILED TO BIND TO PORT!"); + field_155771_h.warn("The exception was: {}", new Object[] {ioexception.toString()}); + field_155771_h.warn("Perhaps a server is already running on that port?"); + return false; + } + + if (!this.isServerInOnlineMode()) + { + field_155771_h.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); + field_155771_h.warn("The server will make no attempt to authenticate usernames. Beware."); + field_155771_h.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); + field_155771_h.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); + } + + if (this.func_152368_aE()) + { + this.func_152358_ax().func_152658_c(); + } + + if (!PreYggdrasilConverter.func_152714_a(this.settings)) + { + return false; + } + else + { + FMLCommonHandler.instance().onServerStarted(); + this.func_152361_a(new DedicatedPlayerList(this)); + long j = System.nanoTime(); + + if (this.getFolderName() == null) + { + this.setFolderName(this.settings.getStringProperty("level-name", "world")); + } + + String s = this.settings.getStringProperty("level-seed", ""); + String s1 = this.settings.getStringProperty("level-type", "DEFAULT"); + String s2 = this.settings.getStringProperty("generator-settings", ""); + long k = (new Random()).nextLong(); + + if (s.length() > 0) + { + try + { + long l = Long.parseLong(s); + + if (l != 0L) + { + k = l; + } + } + catch (NumberFormatException numberformatexception) + { + k = (long)s.hashCode(); + } + } + + WorldType worldtype = WorldType.parseWorldType(s1); + + if (worldtype == null) + { + worldtype = WorldType.DEFAULT; + } + + this.func_147136_ar(); + this.isCommandBlockEnabled(); + this.getOpPermissionLevel(); + this.isSnooperEnabled(); + this.setBuildLimit(this.settings.getIntProperty("max-build-height", 256)); + this.setBuildLimit((this.getBuildLimit() + 8) / 16 * 16); + this.setBuildLimit(MathHelper.clamp_int(this.getBuildLimit(), 64, 256)); + this.settings.setProperty("max-build-height", Integer.valueOf(this.getBuildLimit())); + if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; } + field_155771_h.info("Preparing level \"" + this.getFolderName() + "\""); + this.loadAllWorlds(this.getFolderName(), this.getFolderName(), k, worldtype, s2); + long i1 = System.nanoTime() - j; + String s3 = String.format("%.3fs", new Object[] {Double.valueOf((double)i1 / 1.0E9D)}); + field_155771_h.info("Done (" + s3 + ")! For help, type \"help\" or \"?\""); + + if (this.settings.getBooleanProperty("enable-query", false)) + { + field_155771_h.info("Starting GS4 status listener"); + this.theRConThreadQuery = new RConThreadQuery(this); + this.theRConThreadQuery.startThread(); + } + + if (this.settings.getBooleanProperty("enable-rcon", false)) + { + field_155771_h.info("Starting remote control listener"); + this.theRConThreadMain = new RConThreadMain(this); + this.theRConThreadMain.startThread(); + } + + return FMLCommonHandler.instance().handleServerStarting(this); + } + } + } + + public boolean canStructuresSpawn() + { + return this.canSpawnStructures; + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + public EnumDifficulty func_147135_j() + { + return EnumDifficulty.getDifficultyEnum(this.settings.getIntProperty("difficulty", 1)); + } + + /** + * Defaults to false. + */ + public boolean isHardcore() + { + return this.settings.getBooleanProperty("hardcore", false); + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport report) {} + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport report) + { + report = super.addServerInfoToCrashReport(report); + report.getCategory().addCrashSectionCallable("Is Modded", new Callable() + { + private static final String __OBFID = "CL_00001785"; + public String call() + { + String s = DedicatedServer.this.getServerModName(); + return !s.equals("vanilla") ? "Definitely; Server brand changed to \'" + s + "\'" : "Unknown (can\'t tell)"; + } + }); + report.getCategory().addCrashSectionCallable("Type", new Callable() + { + private static final String __OBFID = "CL_00001788"; + public String call() + { + return "Dedicated Server (map_server.txt)"; + } + }); + return report; + } + + /** + * Directly calls System.exit(0), instantly killing the program. + */ + protected void systemExitNow() + { + System.exit(0); + } + + public void updateTimeLightAndEntities() + { + super.updateTimeLightAndEntities(); + this.executePendingCommands(); + } + + public boolean getAllowNether() + { + return this.settings.getBooleanProperty("allow-nether", true); + } + + public boolean allowSpawnMonsters() + { + return this.settings.getBooleanProperty("spawn-monsters", true); + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + playerSnooper.func_152768_a("whitelist_enabled", Boolean.valueOf(this.getConfigurationManager().isWhiteListEnabled())); + playerSnooper.func_152768_a("whitelist_count", Integer.valueOf(this.getConfigurationManager().func_152598_l().length)); + super.addServerStatsToSnooper(playerSnooper); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() + { + return this.settings.getBooleanProperty("snooper-enabled", true); + } + + public void addPendingCommand(String input, ICommandSender sender) + { + this.pendingCommandList.add(new ServerCommand(input, sender)); + } + + public void executePendingCommands() + { + while (!this.pendingCommandList.isEmpty()) + { + ServerCommand servercommand = (ServerCommand)this.pendingCommandList.remove(0); + this.getCommandManager().executeCommand(servercommand.sender, servercommand.command); + } + } + + public boolean isDedicatedServer() + { + return true; + } + + public DedicatedPlayerList getConfigurationManager() + { + return (DedicatedPlayerList)super.getConfigurationManager(); + } + + /** + * Gets an integer property. If it does not exist, set it to the specified value. + */ + public int getIntProperty(String key, int defaultValue) + { + return this.settings.getIntProperty(key, defaultValue); + } + + /** + * Gets a string property. If it does not exist, set it to the specified value. + */ + public String getStringProperty(String key, String defaultValue) + { + return this.settings.getStringProperty(key, defaultValue); + } + + /** + * Gets a boolean property. If it does not exist, set it to the specified value. + */ + public boolean getBooleanProperty(String key, boolean defaultValue) + { + return this.settings.getBooleanProperty(key, defaultValue); + } + + /** + * Saves an Object with the given property name. + */ + public void setProperty(String key, Object value) + { + this.settings.setProperty(key, value); + } + + /** + * Saves all of the server properties to the properties file. + */ + public void saveProperties() + { + this.settings.saveProperties(); + } + + /** + * Returns the filename where server properties are stored + */ + public String getSettingsFilename() + { + File file1 = this.settings.getPropertiesFile(); + return file1 != null ? file1.getAbsolutePath() : "No settings file"; + } + + public void setGuiEnabled() + { + MinecraftServerGui.createServerGui(this); + this.guiIsEnabled = true; + } + + public boolean getGuiEnabled() + { + return this.guiIsEnabled; + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public String shareToLAN(WorldSettings.GameType type, boolean allowCheats) + { + return ""; + } + + /** + * Return whether command blocks are enabled. + */ + public boolean isCommandBlockEnabled() + { + return this.settings.getBooleanProperty("enable-command-block", false); + } + + /** + * Return the spawn protection area's size. + */ + public int getSpawnProtectionSize() + { + return this.settings.getIntProperty("spawn-protection", super.getSpawnProtectionSize()); + } + + /** + * Returns true if a player does not have permission to edit the block at the given coordinates. + */ + public boolean isBlockProtected(World inWorld, int x, int y, int z, EntityPlayer player) + { + if (inWorld.provider.dimensionId != 0) + { + return false; + } + else if (this.getConfigurationManager().func_152603_m().func_152690_d()) + { + return false; + } + else if (this.getConfigurationManager().func_152596_g(player.getGameProfile())) + { + return false; + } + else if (this.getSpawnProtectionSize() <= 0) + { + return false; + } + else + { + ChunkCoordinates chunkcoordinates = inWorld.getSpawnPoint(); + int l = MathHelper.abs_int(x - chunkcoordinates.posX); + int i1 = MathHelper.abs_int(z - chunkcoordinates.posZ); + int j1 = Math.max(l, i1); + return j1 <= this.getSpawnProtectionSize(); + } + } + + public int getOpPermissionLevel() + { + return this.settings.getIntProperty("op-permission-level", 4); + } + + public void func_143006_e(int idleTimeout) + { + super.func_143006_e(idleTimeout); + this.settings.setProperty("player-idle-timeout", Integer.valueOf(idleTimeout)); + this.saveProperties(); + } + + public boolean func_152363_m() + { + return this.settings.getBooleanProperty("broadcast-rcon-to-ops", true); + } + + public boolean func_147136_ar() + { + return this.settings.getBooleanProperty("announce-player-achievements", true); + } + + protected boolean func_152368_aE() throws IOException + { + boolean flag = false; + int i; + + for (i = 0; !flag && i <= 2; ++i) + { + if (i > 0) + { + field_155771_h.warn("Encountered a problem while converting the user banlist, retrying in a few seconds"); + this.func_152369_aG(); + } + + flag = PreYggdrasilConverter.func_152724_a(this); + } + + boolean flag1 = false; + + for (i = 0; !flag1 && i <= 2; ++i) + { + if (i > 0) + { + field_155771_h.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds"); + this.func_152369_aG(); + } + + flag1 = PreYggdrasilConverter.func_152722_b(this); + } + + boolean flag2 = false; + + for (i = 0; !flag2 && i <= 2; ++i) + { + if (i > 0) + { + field_155771_h.warn("Encountered a problem while converting the op list, retrying in a few seconds"); + this.func_152369_aG(); + } + + flag2 = PreYggdrasilConverter.func_152718_c(this); + } + + boolean flag3 = false; + + for (i = 0; !flag3 && i <= 2; ++i) + { + if (i > 0) + { + field_155771_h.warn("Encountered a problem while converting the whitelist, retrying in a few seconds"); + this.func_152369_aG(); + } + + flag3 = PreYggdrasilConverter.func_152710_d(this); + } + + boolean flag4 = false; + + for (i = 0; !flag4 && i <= 2; ++i) + { + if (i > 0) + { + field_155771_h.warn("Encountered a problem while converting the player save files, retrying in a few seconds"); + this.func_152369_aG(); + } + + flag4 = PreYggdrasilConverter.func_152723_a(this, this.settings); + } + + return flag || flag1 || flag2 || flag3 || flag4; + } + + private void func_152369_aG() + { + try + { + Thread.sleep(5000L); + } + catch (InterruptedException interruptedexception) + { + ; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/PropertyManager.java b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/PropertyManager.java new file mode 100644 index 0000000..d70ff8d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/dedicated/PropertyManager.java @@ -0,0 +1,169 @@ +package net.minecraft.server.dedicated; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Properties; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class PropertyManager +{ + private static final Logger field_164440_a = LogManager.getLogger(); + /** The server properties object. */ + private final Properties serverProperties = new Properties(); + /** The server properties file. */ + private final File serverPropertiesFile; + private static final String __OBFID = "CL_00001782"; + + public PropertyManager(File p_i45278_1_) + { + this.serverPropertiesFile = p_i45278_1_; + + if (p_i45278_1_.exists()) + { + FileInputStream fileinputstream = null; + + try + { + fileinputstream = new FileInputStream(p_i45278_1_); + this.serverProperties.load(fileinputstream); + } + catch (Exception exception) + { + field_164440_a.warn("Failed to load " + p_i45278_1_, exception); + this.generateNewProperties(); + } + finally + { + if (fileinputstream != null) + { + try + { + fileinputstream.close(); + } + catch (IOException ioexception) + { + ; + } + } + } + } + else + { + field_164440_a.warn(p_i45278_1_ + " does not exist"); + this.generateNewProperties(); + } + } + + /** + * Generates a new properties file. + */ + public void generateNewProperties() + { + field_164440_a.info("Generating new properties file"); + this.saveProperties(); + } + + /** + * Writes the properties to the properties file. + */ + public void saveProperties() + { + FileOutputStream fileoutputstream = null; + + try + { + fileoutputstream = new FileOutputStream(this.serverPropertiesFile); + this.serverProperties.store(fileoutputstream, "Minecraft server properties"); + } + catch (Exception exception) + { + field_164440_a.warn("Failed to save " + this.serverPropertiesFile, exception); + this.generateNewProperties(); + } + finally + { + if (fileoutputstream != null) + { + try + { + fileoutputstream.close(); + } + catch (IOException ioexception) + { + ; + } + } + } + } + + /** + * Returns this PropertyManager's file object used for property saving. + */ + public File getPropertiesFile() + { + return this.serverPropertiesFile; + } + + /** + * Returns a string property. If the property doesn't exist the default is returned. + */ + public String getStringProperty(String key, String defaultValue) + { + if (!this.serverProperties.containsKey(key)) + { + this.serverProperties.setProperty(key, defaultValue); + this.saveProperties(); + this.saveProperties(); + } + + return this.serverProperties.getProperty(key, defaultValue); + } + + /** + * Gets an integer property. If it does not exist, set it to the specified value. + */ + public int getIntProperty(String key, int defaultValue) + { + try + { + return Integer.parseInt(this.getStringProperty(key, "" + defaultValue)); + } + catch (Exception exception) + { + this.serverProperties.setProperty(key, "" + defaultValue); + this.saveProperties(); + return defaultValue; + } + } + + /** + * Gets a boolean property. If it does not exist, set it to the specified value. + */ + public boolean getBooleanProperty(String key, boolean defaultValue) + { + try + { + return Boolean.parseBoolean(this.getStringProperty(key, "" + defaultValue)); + } + catch (Exception exception) + { + this.serverProperties.setProperty(key, "" + defaultValue); + this.saveProperties(); + return defaultValue; + } + } + + /** + * Saves an Object with the given property name. + */ + public void setProperty(String key, Object value) + { + this.serverProperties.setProperty(key, "" + value); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/gui/IUpdatePlayerListBox.java b/build/rfg/minecraft-src/java/net/minecraft/server/gui/IUpdatePlayerListBox.java new file mode 100644 index 0000000..6c3c313 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/gui/IUpdatePlayerListBox.java @@ -0,0 +1,9 @@ +package net.minecraft.server.gui; + +public interface IUpdatePlayerListBox +{ + /** + * Updates the JList with a new model. + */ + void update(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/gui/MinecraftServerGui.java b/build/rfg/minecraft-src/java/net/minecraft/server/gui/MinecraftServerGui.java new file mode 100644 index 0000000..10e669f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/gui/MinecraftServerGui.java @@ -0,0 +1,224 @@ +package net.minecraft.server.gui; + +import com.mojang.util.QueueLogAppender; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.concurrent.CountDownLatch; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.EtchedBorder; +import javax.swing.border.TitledBorder; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.dedicated.DedicatedServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.SERVER) +public class MinecraftServerGui extends JComponent +{ + private static final Font field_164249_a = new Font("Monospaced", 0, 12); + private static final Logger field_164248_b = LogManager.getLogger(); + private DedicatedServer field_120021_b; + private static final String __OBFID = "CL_00001789"; + + /** + * Creates the server GUI and sets it visible for the user. + */ + public static void createServerGui(final DedicatedServer serverIn) + { + try + { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } + catch (Exception exception) + { + ; + } + + MinecraftServerGui minecraftservergui = new MinecraftServerGui(serverIn); + JFrame jframe = new JFrame("Minecraft server"); + jframe.add(minecraftservergui); + jframe.pack(); + jframe.setLocationRelativeTo((Component)null); + jframe.setVisible(true); + jframe.addWindowListener(new WindowAdapter() + { + private static final String __OBFID = "CL_00001791"; + public void windowClosing(WindowEvent p_windowClosing_1_) + { + serverIn.initiateShutdown(); + + while (!serverIn.isServerStopped()) + { + try + { + Thread.sleep(100L); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + } + + System.exit(0); + } + }); + minecraftservergui.latch.countDown(); + } + + public MinecraftServerGui(DedicatedServer serverIn) + { + this.field_120021_b = serverIn; + this.setPreferredSize(new Dimension(854, 480)); + this.setLayout(new BorderLayout()); + + try + { + this.add(this.getLogComponent(), "Center"); + this.add(this.getStatsComponent(), "West"); + } + catch (Exception exception) + { + field_164248_b.error("Couldn\'t build server GUI", exception); + } + } + + /** + * Generates new StatsComponent and returns it. + */ + private JComponent getStatsComponent() + { + JPanel jpanel = new JPanel(new BorderLayout()); + jpanel.add(new StatsComponent(this.field_120021_b), "North"); + jpanel.add(this.getPlayerListComponent(), "Center"); + jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats")); + return jpanel; + } + + /** + * Generates new PlayerListComponent and returns it. + */ + private JComponent getPlayerListComponent() + { + PlayerListComponent playerlistcomponent = new PlayerListComponent(this.field_120021_b); + JScrollPane jscrollpane = new JScrollPane(playerlistcomponent, 22, 30); + jscrollpane.setBorder(new TitledBorder(new EtchedBorder(), "Players")); + return jscrollpane; + } + + private JComponent getLogComponent() + { + JPanel jpanel = new JPanel(new BorderLayout()); + final JTextArea jtextarea = new JTextArea(); + final JScrollPane jscrollpane = new JScrollPane(jtextarea, 22, 30); + jtextarea.setEditable(false); + jtextarea.setFont(field_164249_a); + final JTextField jtextfield = new JTextField(); + jtextfield.addActionListener(new ActionListener() + { + private static final String __OBFID = "CL_00001790"; + public void actionPerformed(ActionEvent p_actionPerformed_1_) + { + String s = jtextfield.getText().trim(); + + if (s.length() > 0) + { + MinecraftServerGui.this.field_120021_b.addPendingCommand(s, MinecraftServer.getServer()); + } + + jtextfield.setText(""); + } + }); + jtextarea.addFocusListener(new FocusAdapter() + { + private static final String __OBFID = "CL_00001794"; + public void focusGained(FocusEvent p_focusGained_1_) {} + }); + jpanel.add(jscrollpane, "Center"); + jpanel.add(jtextfield, "South"); + jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat")); + Thread thread = new Thread(new Runnable() + { + private static final String __OBFID = "CL_00001793"; + public void run() + { + String s; + + while ((s = QueueLogAppender.getNextLogEvent("ServerGuiConsole")) != null) + { + MinecraftServerGui.this.func_164247_a(jtextarea, jscrollpane, s); + } + } + }); + thread.setDaemon(true); + thread.start(); + return jpanel; + } + + private CountDownLatch latch = new CountDownLatch(1); + public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_) + { + try + { + latch.await(); + } catch (InterruptedException e) + { + } + if (!SwingUtilities.isEventDispatchThread()) + { + SwingUtilities.invokeLater(new Runnable() + { + private static final String __OBFID = "CL_00001792"; + public void run() + { + MinecraftServerGui.this.func_164247_a(p_164247_1_, p_164247_2_, p_164247_3_); + } + }); + } + else + { + Document document = p_164247_1_.getDocument(); + JScrollBar jscrollbar = p_164247_2_.getVerticalScrollBar(); + boolean flag = false; + + if (p_164247_2_.getViewport().getView() == p_164247_1_) + { + flag = (double)jscrollbar.getValue() + jscrollbar.getSize().getHeight() + (double)(field_164249_a.getSize() * 4) > (double)jscrollbar.getMaximum(); + } + + try + { + document.insertString(document.getLength(), p_164247_3_, (AttributeSet)null); + } + catch (BadLocationException badlocationexception) + { + ; + } + + if (flag) + { + jscrollbar.setValue(Integer.MAX_VALUE); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/gui/PlayerListComponent.java b/build/rfg/minecraft-src/java/net/minecraft/server/gui/PlayerListComponent.java new file mode 100644 index 0000000..0604b4e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/gui/PlayerListComponent.java @@ -0,0 +1,40 @@ +package net.minecraft.server.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Vector; +import javax.swing.JList; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +@SideOnly(Side.SERVER) +public class PlayerListComponent extends JList implements IUpdatePlayerListBox +{ + private MinecraftServer field_120015_a; + private int field_120014_b; + private static final String __OBFID = "CL_00001795"; + + public PlayerListComponent(MinecraftServer p_i2366_1_) + { + this.field_120015_a = p_i2366_1_; + p_i2366_1_.func_82010_a(this); + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + if (this.field_120014_b++ % 20 == 0) + { + Vector vector = new Vector(); + + for (int i = 0; i < this.field_120015_a.getConfigurationManager().playerEntityList.size(); ++i) + { + vector.add(((EntityPlayerMP)this.field_120015_a.getConfigurationManager().playerEntityList.get(i)).getCommandSenderName()); + } + + this.setListData(vector); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/gui/StatsComponent.java b/build/rfg/minecraft-src/java/net/minecraft/server/gui/StatsComponent.java new file mode 100644 index 0000000..e3318ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/gui/StatsComponent.java @@ -0,0 +1,88 @@ +package net.minecraft.server.gui; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.text.DecimalFormat; +import javax.swing.JComponent; +import javax.swing.Timer; +import net.minecraft.server.MinecraftServer; + +@SideOnly(Side.SERVER) +public class StatsComponent extends JComponent +{ + private static final DecimalFormat field_120040_a = new DecimalFormat("########0.000"); + private int[] field_120038_b = new int[256]; + private int field_120039_c; + private String[] field_120036_d = new String[11]; + private final MinecraftServer field_120037_e; + private static final String __OBFID = "CL_00001796"; + + public StatsComponent(MinecraftServer p_i2367_1_) + { + this.field_120037_e = p_i2367_1_; + this.setPreferredSize(new Dimension(456, 246)); + this.setMinimumSize(new Dimension(456, 246)); + this.setMaximumSize(new Dimension(456, 246)); + (new Timer(500, new ActionListener() + { + private static final String __OBFID = "CL_00001797"; + public void actionPerformed(ActionEvent p_actionPerformed_1_) + { + StatsComponent.this.func_120034_a(); + } + })).start(); + this.setBackground(Color.BLACK); + } + + private void func_120034_a() + { + long i = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.gc(); + this.field_120036_d[0] = "Memory use: " + i / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)"; + this.field_120036_d[1] = "Avg tick: " + field_120040_a.format(this.func_120035_a(this.field_120037_e.tickTimeArray) * 1.0E-6D) + " ms"; + this.repaint(); + } + + private double func_120035_a(long[] p_120035_1_) + { + long i = 0L; + + for (int j = 0; j < p_120035_1_.length; ++j) + { + i += p_120035_1_[j]; + } + + return (double)i / (double)p_120035_1_.length; + } + + public void paint(Graphics p_paint_1_) + { + p_paint_1_.setColor(new Color(16777215)); + p_paint_1_.fillRect(0, 0, 456, 246); + int i; + + for (i = 0; i < 256; ++i) + { + int j = this.field_120038_b[i + this.field_120039_c & 255]; + p_paint_1_.setColor(new Color(j + 28 << 16)); + p_paint_1_.fillRect(i, 100 - j, 1, j); + } + + p_paint_1_.setColor(Color.BLACK); + + for (i = 0; i < this.field_120036_d.length; ++i) + { + String s = this.field_120036_d[i]; + + if (s != null) + { + p_paint_1_.drawString(s, 32, 116 + i * 16); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedPlayerList.java b/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedPlayerList.java new file mode 100644 index 0000000..ed78c70 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedPlayerList.java @@ -0,0 +1,59 @@ +package net.minecraft.server.integrated; + +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.net.SocketAddress; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.ServerConfigurationManager; + +@SideOnly(Side.CLIENT) +public class IntegratedPlayerList extends ServerConfigurationManager +{ + /** Holds the NBT data for the host player's save file, so this can be written to level.dat. */ + private NBTTagCompound hostPlayerData; + private static final String __OBFID = "CL_00001128"; + + public IntegratedPlayerList(IntegratedServer p_i1314_1_) + { + super(p_i1314_1_); + this.func_152611_a(10); + } + + /** + * also stores the NBTTags if this is an intergratedPlayerList + */ + protected void writePlayerData(EntityPlayerMP player) + { + if (player.getCommandSenderName().equals(this.getServerInstance().getServerOwner())) + { + this.hostPlayerData = new NBTTagCompound(); + player.writeToNBT(this.hostPlayerData); + } + + super.writePlayerData(player); + } + + /** + * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message + */ + public String allowUserToConnect(SocketAddress address, GameProfile profile) + { + return profile.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.func_152612_a(profile.getName()) != null ? "That name is already taken." : super.allowUserToConnect(address, profile); + } + + public IntegratedServer getServerInstance() + { + return (IntegratedServer)super.getServerInstance(); + } + + /** + * On integrated servers, returns the host's player data to be written to level.dat. + */ + public NBTTagCompound getHostPlayerData() + { + return this.hostPlayerData; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedServer.java b/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedServer.java new file mode 100644 index 0000000..e70de83 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/integrated/IntegratedServer.java @@ -0,0 +1,317 @@ +package net.minecraft.server.integrated; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.util.concurrent.Callable; +import net.minecraft.client.ClientBrandRetriever; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ThreadLanServerPing; +import net.minecraft.crash.CrashReport; +import net.minecraft.profiler.PlayerUsageSnooper; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.CryptManager; +import net.minecraft.util.HttpUtil; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.demo.DemoWorldServer; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@SideOnly(Side.CLIENT) +public class IntegratedServer extends MinecraftServer +{ + private static final Logger logger = LogManager.getLogger(); + /** The Minecraft instance. */ + private final Minecraft mc; + private final WorldSettings theWorldSettings; + private boolean isGamePaused; + private boolean isPublic; + private ThreadLanServerPing lanServerPing; + private static final String __OBFID = "CL_00001129"; + + public IntegratedServer(Minecraft p_i1317_1_, String p_i1317_2_, String p_i1317_3_, WorldSettings p_i1317_4_) + { + super(new File(p_i1317_1_.mcDataDir, "saves"), p_i1317_1_.getProxy()); + this.setServerOwner(p_i1317_1_.getSession().getUsername()); + this.setFolderName(p_i1317_2_); + this.setWorldName(p_i1317_3_); + this.setDemo(p_i1317_1_.isDemo()); + this.canCreateBonusChest(p_i1317_4_.isBonusChestEnabled()); + this.setBuildLimit(256); + this.func_152361_a(new IntegratedPlayerList(this)); + this.mc = p_i1317_1_; + this.theWorldSettings = p_i1317_4_; + } + + protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) + { + this.convertMapIfNeeded(p_71247_1_); + ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(p_71247_1_, true); + + WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, theWorldSettings, theProfiler)); + for (int dim : DimensionManager.getStaticDimensionIDs()) + { + WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, theWorldSettings, overWorld, theProfiler)); + world.addWorldAccess(new WorldManager(this, world)); + + if (!this.isSinglePlayer()) + { + world.getWorldInfo().setGameType(getGameType()); + } + + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + } + + this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld }); + this.func_147139_a(this.func_147135_j()); + this.initialWorldChunkLoad(); + } + + /** + * Initialises the server and starts it. + */ + protected boolean startServer() throws IOException + { + logger.info("Starting integrated minecraft server version 1.7.10"); + this.setOnlineMode(true); + this.setCanSpawnAnimals(true); + this.setCanSpawnNPCs(true); + this.setAllowPvp(true); + this.setAllowFlight(true); + logger.info("Generating keypair"); + this.setKeyPair(CryptManager.createNewKeyPair()); + if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; } + this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j()); + this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); + return FMLCommonHandler.instance().handleServerStarting(this); + } + + /** + * Main function called by run() every loop. + */ + public void tick() + { + boolean flag = this.isGamePaused; + this.isGamePaused = Minecraft.getMinecraft().getNetHandler() != null && Minecraft.getMinecraft().isGamePaused(); + + if (!flag && this.isGamePaused) + { + logger.info("Saving and pausing game..."); + this.getConfigurationManager().saveAllPlayerData(); + this.saveAllWorlds(false); + } + + if (!this.isGamePaused) + { + super.tick(); + + if (this.mc.gameSettings.renderDistanceChunks != this.getConfigurationManager().getViewDistance()) + { + logger.info("Changing view distance to {}, from {}", new Object[] {Integer.valueOf(this.mc.gameSettings.renderDistanceChunks), Integer.valueOf(this.getConfigurationManager().getViewDistance())}); + this.getConfigurationManager().func_152611_a(this.mc.gameSettings.renderDistanceChunks); + } + } + } + + public boolean canStructuresSpawn() + { + return false; + } + + public WorldSettings.GameType getGameType() + { + return this.theWorldSettings.getGameType(); + } + + public EnumDifficulty func_147135_j() + { + return this.mc.gameSettings.difficulty; + } + + /** + * Defaults to false. + */ + public boolean isHardcore() + { + return this.theWorldSettings.getHardcoreEnabled(); + } + + public boolean func_152363_m() + { + return false; + } + + protected File getDataDirectory() + { + return this.mc.mcDataDir; + } + + public boolean isDedicatedServer() + { + return false; + } + + /** + * Called on exit from the main run() loop. + */ + protected void finalTick(CrashReport report) + { + this.mc.crashed(report); + } + + /** + * Adds the server info, including from theWorldServer, to the crash report. + */ + public CrashReport addServerInfoToCrashReport(CrashReport report) + { + report = super.addServerInfoToCrashReport(report); + report.getCategory().addCrashSectionCallable("Type", new Callable() + { + private static final String __OBFID = "CL_00001130"; + public String call() + { + return "Integrated Server (map_client.txt)"; + } + }); + report.getCategory().addCrashSectionCallable("Is Modded", new Callable() + { + private static final String __OBFID = "CL_00001131"; + public String call() + { + String s = ClientBrandRetriever.getClientModName(); + + if (!s.equals("vanilla")) + { + return "Definitely; Client brand changed to \'" + s + "\'"; + } + else + { + s = IntegratedServer.this.getServerModName(); + return !s.equals("vanilla") ? "Definitely; Server brand changed to \'" + s + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and both client + server brands are untouched."); + } + } + }); + return report; + } + + public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) + { + super.addServerStatsToSnooper(playerSnooper); + playerSnooper.func_152768_a("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); + } + + /** + * Returns whether snooping is enabled or not. + */ + public boolean isSnooperEnabled() + { + return Minecraft.getMinecraft().isSnooperEnabled(); + } + + /** + * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. + */ + public String shareToLAN(WorldSettings.GameType type, boolean allowCheats) + { + try + { + int i = -1; + + try + { + i = HttpUtil.func_76181_a(); + } + catch (IOException ioexception) + { + ; + } + + if (i <= 0) + { + i = 25564; + } + + this.func_147137_ag().addLanEndpoint((InetAddress)null, i); + logger.info("Started on " + i); + this.isPublic = true; + this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), i + ""); + this.lanServerPing.start(); + this.getConfigurationManager().func_152604_a(type); + this.getConfigurationManager().setCommandsAllowedForAll(allowCheats); + return i + ""; + } + catch (IOException ioexception1) + { + return null; + } + } + + /** + * Saves all necessary data as preparation for stopping the server. + */ + public void stopServer() + { + super.stopServer(); + + if (this.lanServerPing != null) + { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + /** + * Sets the serverRunning variable to false, in order to get the server to shut down. + */ + public void initiateShutdown() + { + super.initiateShutdown(); + + if (this.lanServerPing != null) + { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } + } + + /** + * Returns true if this integrated server is open to LAN + */ + public boolean getPublic() + { + return this.isPublic; + } + + /** + * Sets the game type for all worlds. + */ + public void setGameType(WorldSettings.GameType gameMode) + { + this.getConfigurationManager().func_152604_a(gameMode); + } + + /** + * Return whether command blocks are enabled. + */ + public boolean isCommandBlockEnabled() + { + return true; + } + + public int getOpPermissionLevel() + { + return 4; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/BanEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/BanEntry.java new file mode 100644 index 0000000..2eaaf8b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/BanEntry.java @@ -0,0 +1,79 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +public abstract class BanEntry extends UserListEntry +{ + public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + protected final Date banStartDate; + protected final String bannedBy; + protected final Date banEndDate; + protected final String reason; + private static final String __OBFID = "CL_00001395"; + + public BanEntry(Object p_i1173_1_, Date p_i1173_2_, String p_i1173_3_, Date p_i1173_4_, String p_i1173_5_) + { + super(p_i1173_1_); + this.banStartDate = p_i1173_2_ == null ? new Date() : p_i1173_2_; + this.bannedBy = p_i1173_3_ == null ? "(Unknown)" : p_i1173_3_; + this.banEndDate = p_i1173_4_; + this.reason = p_i1173_5_ == null ? "Banned by an operator." : p_i1173_5_; + } + + protected BanEntry(Object p_i1174_1_, JsonObject p_i1174_2_) + { + super(p_i1174_1_, p_i1174_2_); + Date date; + + try + { + date = p_i1174_2_.has("created") ? dateFormat.parse(p_i1174_2_.get("created").getAsString()) : new Date(); + } + catch (ParseException parseexception1) + { + date = new Date(); + } + + this.banStartDate = date; + this.bannedBy = p_i1174_2_.has("source") ? p_i1174_2_.get("source").getAsString() : "(Unknown)"; + Date date1; + + try + { + date1 = p_i1174_2_.has("expires") ? dateFormat.parse(p_i1174_2_.get("expires").getAsString()) : null; + } + catch (ParseException parseexception) + { + date1 = null; + } + + this.banEndDate = date1; + this.reason = p_i1174_2_.has("reason") ? p_i1174_2_.get("reason").getAsString() : "Banned by an operator."; + } + + public Date getBanEndDate() + { + return this.banEndDate; + } + + public String getBanReason() + { + return this.reason; + } + + boolean hasBanExpired() + { + return this.banEndDate == null ? false : this.banEndDate.before(new Date()); + } + + protected void func_152641_a(JsonObject data) + { + data.addProperty("created", dateFormat.format(this.banStartDate)); + data.addProperty("source", this.bannedBy); + data.addProperty("expires", this.banEndDate == null ? "forever" : dateFormat.format(this.banEndDate)); + data.addProperty("reason", this.reason); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/BanList.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/BanList.java new file mode 100644 index 0000000..18e7b2a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/BanList.java @@ -0,0 +1,49 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.io.File; +import java.net.SocketAddress; + +public class BanList extends UserList +{ + private static final String __OBFID = "CL_00001396"; + + public BanList(File bansFile) + { + super(bansFile); + } + + protected UserListEntry func_152682_a(JsonObject entryData) + { + return new IPBanEntry(entryData); + } + + public boolean func_152708_a(SocketAddress address) + { + String s = this.func_152707_c(address); + return this.func_152692_d(s); + } + + public IPBanEntry func_152709_b(SocketAddress address) + { + String s = this.func_152707_c(address); + return (IPBanEntry)this.func_152683_b(s); + } + + private String func_152707_c(SocketAddress address) + { + String s = address.toString(); + + if (s.contains("/")) + { + s = s.substring(s.indexOf(47) + 1); + } + + if (s.contains(":")) + { + s = s.substring(0, s.indexOf(58)); + } + + return s; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/IPBanEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/IPBanEntry.java new file mode 100644 index 0000000..366c71b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/IPBanEntry.java @@ -0,0 +1,38 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import java.util.Date; + +public class IPBanEntry extends BanEntry +{ + private static final String __OBFID = "CL_00001883"; + + public IPBanEntry(String p_i1158_1_) + { + this(p_i1158_1_, (Date)null, (String)null, (Date)null, (String)null); + } + + public IPBanEntry(String p_i1159_1_, Date p_i1159_2_, String p_i1159_3_, Date p_i1159_4_, String p_i1159_5_) + { + super(p_i1159_1_, p_i1159_2_, p_i1159_3_, p_i1159_4_, p_i1159_5_); + } + + public IPBanEntry(JsonObject p_i1160_1_) + { + super(func_152647_b(p_i1160_1_), p_i1160_1_); + } + + private static String func_152647_b(JsonObject p_152647_0_) + { + return p_152647_0_.has("ip") ? p_152647_0_.get("ip").getAsString() : null; + } + + protected void func_152641_a(JsonObject data) + { + if (this.func_152640_f() != null) + { + data.addProperty("ip", (String)this.func_152640_f()); + super.func_152641_a(data); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/ItemInWorldManager.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/ItemInWorldManager.java new file mode 100644 index 0000000..8f54efc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/ItemInWorldManager.java @@ -0,0 +1,455 @@ +package net.minecraft.server.management; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.event.world.BlockEvent; + +public class ItemInWorldManager +{ + /** Forge reach distance */ + private double blockReachDistance = 5.0d; + /** The world object that this object is connected to. */ + public World theWorld; + /** The EntityPlayerMP object that this object is connected to. */ + public EntityPlayerMP thisPlayerMP; + private WorldSettings.GameType gameType; + /** True if the player is destroying a block */ + private boolean isDestroyingBlock; + private int initialDamage; + private int partiallyDestroyedBlockX; + private int partiallyDestroyedBlockY; + private int partiallyDestroyedBlockZ; + private int curblockDamage; + /** + * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The + * block will not be destroyed while this is false. + */ + private boolean receivedFinishDiggingPacket; + private int posX; + private int posY; + private int posZ; + private int initialBlockDamage; + private int durabilityRemainingOnBlock; + private static final String __OBFID = "CL_00001442"; + + public ItemInWorldManager(World p_i1524_1_) + { + this.gameType = WorldSettings.GameType.NOT_SET; + this.durabilityRemainingOnBlock = -1; + this.theWorld = p_i1524_1_; + } + + public void setGameType(WorldSettings.GameType p_73076_1_) + { + this.gameType = p_73076_1_; + p_73076_1_.configurePlayerCapabilities(this.thisPlayerMP.capabilities); + this.thisPlayerMP.sendPlayerAbilities(); + } + + public WorldSettings.GameType getGameType() + { + return this.gameType; + } + + /** + * Get if we are in creative game mode. + */ + public boolean isCreative() + { + return this.gameType.isCreative(); + } + + /** + * if the gameType is currently NOT_SET then change it to par1 + */ + public void initializeGameType(WorldSettings.GameType p_73077_1_) + { + if (this.gameType == WorldSettings.GameType.NOT_SET) + { + this.gameType = p_73077_1_; + } + + this.setGameType(this.gameType); + } + + public void updateBlockRemoving() + { + ++this.curblockDamage; + float f; + int j; + + if (this.receivedFinishDiggingPacket) + { + int i = this.curblockDamage - this.initialBlockDamage; + Block block = this.theWorld.getBlock(this.posX, this.posY, this.posZ); + + if (block.getMaterial() == Material.air) + { + this.receivedFinishDiggingPacket = false; + } + else + { + f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.posX, this.posY, this.posZ) * (float)(i + 1); + j = (int)(f * 10.0F); + + if (j != this.durabilityRemainingOnBlock) + { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.posX, this.posY, this.posZ, j); + this.durabilityRemainingOnBlock = j; + } + + if (f >= 1.0F) + { + this.receivedFinishDiggingPacket = false; + this.tryHarvestBlock(this.posX, this.posY, this.posZ); + } + } + } + else if (this.isDestroyingBlock) + { + Block block1 = this.theWorld.getBlock(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); + + if (block1.getMaterial() == Material.air) + { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } + else + { + int k = this.curblockDamage - this.initialDamage; + f = block1.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ) * (float)(k + 1); + j = (int)(f * 10.0F); + + if (j != this.durabilityRemainingOnBlock) + { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, j); + this.durabilityRemainingOnBlock = j; + } + } + } + } + + /** + * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific + * side. tryHarvestBlock can also be the result of this call + */ + public void onBlockClicked(int p_73074_1_, int p_73074_2_, int p_73074_3_, int p_73074_4_) + { + if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(p_73074_1_, p_73074_2_, p_73074_3_)) + { + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, theWorld); + if (event.isCanceled()) + { + thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, theWorld)); + return; + } + + if (this.isCreative()) + { + if (!this.theWorld.extinguishFire((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_)) + { + this.tryHarvestBlock(p_73074_1_, p_73074_2_, p_73074_3_); + } + } + else + { + this.initialDamage = this.curblockDamage; + float f = 1.0F; + Block block = this.theWorld.getBlock(p_73074_1_, p_73074_2_, p_73074_3_); + + + if (!block.isAir(theWorld, p_73074_1_, p_73074_2_, p_73074_3_)) + { + if (event.useBlock != Event.Result.DENY) + { + block.onBlockClicked(theWorld, p_73074_1_, p_73074_2_, p_73074_3_, thisPlayerMP); + theWorld.extinguishFire(null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + } + else + { + thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, theWorld)); + } + f = block.getPlayerRelativeBlockHardness(thisPlayerMP, thisPlayerMP.worldObj, p_73074_1_, p_73074_2_, p_73074_3_); + } + + if (event.useItem == Event.Result.DENY) + { + if (f >= 1.0f) + { + thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, theWorld)); + } + return; + } + + if (!block.isAir(theWorld, p_73074_1_, p_73074_2_, p_73074_3_) && f >= 1.0F) + { + this.tryHarvestBlock(p_73074_1_, p_73074_2_, p_73074_3_); + } + else + { + this.isDestroyingBlock = true; + this.partiallyDestroyedBlockX = p_73074_1_; + this.partiallyDestroyedBlockY = p_73074_2_; + this.partiallyDestroyedBlockZ = p_73074_3_; + int i1 = (int)(f * 10.0F); + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), p_73074_1_, p_73074_2_, p_73074_3_, i1); + this.durabilityRemainingOnBlock = i1; + } + } + } + } + + public void uncheckedTryHarvestBlock(int p_73082_1_, int p_73082_2_, int p_73082_3_) + { + if (p_73082_1_ == this.partiallyDestroyedBlockX && p_73082_2_ == this.partiallyDestroyedBlockY && p_73082_3_ == this.partiallyDestroyedBlockZ) + { + int l = this.curblockDamage - this.initialDamage; + Block block = this.theWorld.getBlock(p_73082_1_, p_73082_2_, p_73082_3_); + + if (!block.isAir(theWorld, p_73082_1_, p_73082_2_, p_73082_3_)) + { + float f = block.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, p_73082_1_, p_73082_2_, p_73082_3_) * (float)(l + 1); + + if (f >= 0.7F) + { + this.isDestroyingBlock = false; + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), p_73082_1_, p_73082_2_, p_73082_3_, -1); + this.tryHarvestBlock(p_73082_1_, p_73082_2_, p_73082_3_); + } + else if (!this.receivedFinishDiggingPacket) + { + this.isDestroyingBlock = false; + this.receivedFinishDiggingPacket = true; + this.posX = p_73082_1_; + this.posY = p_73082_2_; + this.posZ = p_73082_3_; + this.initialBlockDamage = this.initialDamage; + } + } + } + } + + /** + * note: this ignores the pars passed in and continues to destroy the onClickedBlock + */ + public void cancelDestroyingBlock(int p_73073_1_, int p_73073_2_, int p_73073_3_) + { + this.isDestroyingBlock = false; + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.getEntityId(), this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + } + + /** + * Removes a block and triggers the appropriate events + */ + private boolean removeBlock(int p_73079_1_, int p_73079_2_, int p_73079_3_) + { + return removeBlock(p_73079_1_, p_73079_2_, p_73079_3_, false); + } + private boolean removeBlock(int p_73079_1_, int p_73079_2_, int p_73079_3_, boolean canHarvest) + { + Block block = this.theWorld.getBlock(p_73079_1_, p_73079_2_, p_73079_3_); + int l = this.theWorld.getBlockMetadata(p_73079_1_, p_73079_2_, p_73079_3_); + block.onBlockHarvested(this.theWorld, p_73079_1_, p_73079_2_, p_73079_3_, l, this.thisPlayerMP); + boolean flag = block.removedByPlayer(theWorld, thisPlayerMP, p_73079_1_, p_73079_2_, p_73079_3_, canHarvest); + + if (flag) + { + block.onBlockDestroyedByPlayer(this.theWorld, p_73079_1_, p_73079_2_, p_73079_3_, l); + } + + return flag; + } + + /** + * Attempts to harvest a block at the given coordinate + */ + public boolean tryHarvestBlock(int p_73084_1_, int p_73084_2_, int p_73084_3_) + { + BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(theWorld, gameType, thisPlayerMP, p_73084_1_, p_73084_2_, p_73084_3_); + if (event.isCanceled()) + { + return false; + } + else + { + ItemStack stack = thisPlayerMP.getCurrentEquippedItem(); + if (stack != null && stack.getItem().onBlockStartBreak(stack, p_73084_1_, p_73084_2_, p_73084_3_, thisPlayerMP)) + { + return false; + } + Block block = this.theWorld.getBlock(p_73084_1_, p_73084_2_, p_73084_3_); + int l = this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_); + this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, p_73084_1_, p_73084_2_, p_73084_3_, Block.getIdFromBlock(block) + (this.theWorld.getBlockMetadata(p_73084_1_, p_73084_2_, p_73084_3_) << 12)); + boolean flag = false; + + if (this.isCreative()) + { + flag = this.removeBlock(p_73084_1_, p_73084_2_, p_73084_3_); + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73084_1_, p_73084_2_, p_73084_3_, this.theWorld)); + } + else + { + ItemStack itemstack = this.thisPlayerMP.getCurrentEquippedItem(); + boolean flag1 = block.canHarvestBlock(thisPlayerMP, l); + + if (itemstack != null) + { + itemstack.func_150999_a(this.theWorld, block, p_73084_1_, p_73084_2_, p_73084_3_, this.thisPlayerMP); + + if (itemstack.stackSize == 0) + { + this.thisPlayerMP.destroyCurrentEquippedItem(); + } + } + + flag = this.removeBlock(p_73084_1_, p_73084_2_, p_73084_3_, flag1); + if (flag && flag1) + { + block.harvestBlock(this.theWorld, this.thisPlayerMP, p_73084_1_, p_73084_2_, p_73084_3_, l); + } + } + + // Drop experience + if (!this.isCreative() && flag && event != null) + { + block.dropXpOnBlockBreak(this.theWorld, p_73084_1_, p_73084_2_, p_73084_3_, event.getExpToDrop()); + } + return flag; + } + } + + /** + * Attempts to right-click use an item by the given EntityPlayer in the given World + */ + public boolean tryUseItem(EntityPlayer p_73085_1_, World p_73085_2_, ItemStack p_73085_3_) + { + int i = p_73085_3_.stackSize; + int j = p_73085_3_.getItemDamage(); + ItemStack itemstack1 = p_73085_3_.useItemRightClick(p_73085_2_, p_73085_1_); + + if (itemstack1 == p_73085_3_ && (itemstack1 == null || itemstack1.stackSize == i && itemstack1.getMaxItemUseDuration() <= 0 && itemstack1.getItemDamage() == j)) + { + return false; + } + else + { + p_73085_1_.inventory.mainInventory[p_73085_1_.inventory.currentItem] = itemstack1; + + if (this.isCreative()) + { + itemstack1.stackSize = i; + + if (itemstack1.isItemStackDamageable()) + { + itemstack1.setItemDamage(j); + } + } + + if (itemstack1.stackSize == 0) + { + p_73085_1_.inventory.mainInventory[p_73085_1_.inventory.currentItem] = null; + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thisPlayerMP, itemstack1)); + } + + if (!p_73085_1_.isUsingItem()) + { + ((EntityPlayerMP)p_73085_1_).sendContainerToPlayer(p_73085_1_.inventoryContainer); + } + + return true; + } + } + + /** + * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, + * xOffset, yOffset, zOffset + */ + public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) + { + PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(player, Action.RIGHT_CLICK_BLOCK, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, worldIn); + if (event.isCanceled()) + { + thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, theWorld)); + return false; + } + + if (stack != null && stack.getItem().onItemUseFirst(stack, player, worldIn, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) + { + if (stack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); + return true; + } + + Block block = worldIn.getBlock(p_73078_4_, p_73078_5_, p_73078_6_); + boolean isAir = block.isAir(worldIn, p_73078_4_, p_73078_5_, p_73078_6_); + boolean useBlock = !player.isSneaking() || player.getHeldItem() == null; + if (!useBlock) useBlock = player.getHeldItem().getItem().doesSneakBypassUse(worldIn, p_73078_4_, p_73078_5_, p_73078_6_, player); + boolean result = false; + + if (useBlock) + { + if (event.useBlock != Event.Result.DENY) + { + result = block.onBlockActivated(worldIn, p_73078_4_, p_73078_5_, p_73078_6_, player, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + } + else + { + thisPlayerMP.playerNetServerHandler.sendPacket(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, theWorld)); + result = event.useItem != Event.Result.ALLOW; + } + } + + if (stack != null && !result && event.useItem != Event.Result.DENY) + { + int meta = stack.getItemDamage(); + int size = stack.stackSize; + result = stack.tryPlaceItemIntoWorld(player, worldIn, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + if (isCreative()) + { + stack.setItemDamage(meta); + stack.stackSize = size; + } + if (stack.stackSize <= 0) ForgeEventFactory.onPlayerDestroyItem(thisPlayerMP, stack); + } + + /* Re-enable if this causes bukkit incompatibility, or re-write client side to only send a single packet per right click. + if (par3ItemStack != null && ((!result && event.useItem != Event.Result.DENY) || event.useItem == Event.Result.ALLOW)) + { + this.tryUseItem(thisPlayerMP, par2World, par3ItemStack); + }*/ + return result; + } + + /** + * Sets the world instance. + */ + public void setWorld(WorldServer p_73080_1_) + { + this.theWorld = p_73080_1_; + } + + public double getBlockReachDistance() + { + return blockReachDistance; + } + public void setBlockReachDistance(double distance) + { + blockReachDistance = distance; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/LowerStringMap.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/LowerStringMap.java new file mode 100644 index 0000000..e99679e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/LowerStringMap.java @@ -0,0 +1,85 @@ +package net.minecraft.server.management; + +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +public class LowerStringMap implements Map +{ + private final Map internalMap = new LinkedHashMap(); + private static final String __OBFID = "CL_00001488"; + + public int size() + { + return this.internalMap.size(); + } + + public boolean isEmpty() + { + return this.internalMap.isEmpty(); + } + + public boolean containsKey(Object p_containsKey_1_) + { + return this.internalMap.containsKey(p_containsKey_1_.toString().toLowerCase()); + } + + public boolean containsValue(Object p_containsValue_1_) + { + return this.internalMap.containsKey(p_containsValue_1_); + } + + public Object get(Object p_get_1_) + { + return this.internalMap.get(p_get_1_.toString().toLowerCase()); + } + + public Object put(String p_put_1_, Object p_put_2_) + { + return this.internalMap.put(p_put_1_.toLowerCase(), p_put_2_); + } + + public Object remove(Object p_remove_1_) + { + return this.internalMap.remove(p_remove_1_.toString().toLowerCase()); + } + + public void putAll(Map p_putAll_1_) + { + Iterator iterator = p_putAll_1_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + this.put((String)entry.getKey(), entry.getValue()); + } + } + + public void clear() + { + this.internalMap.clear(); + } + + public Set keySet() + { + return this.internalMap.keySet(); + } + + public Collection values() + { + return this.internalMap.values(); + } + + public Set entrySet() + { + return this.internalMap.entrySet(); + } + + public Object put(Object p_put_1_, Object p_put_2_) + { + return this.put((String)p_put_1_, p_put_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerManager.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerManager.java new file mode 100644 index 0000000..6a0aee7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerManager.java @@ -0,0 +1,641 @@ +package net.minecraft.server.management; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S21PacketChunkData; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PlayerManager +{ + private static final Logger field_152627_a = LogManager.getLogger(); + private final WorldServer theWorldServer; + /** players in the current instance */ + private final List players = new ArrayList(); + /** A map of chunk position (two ints concatenated into a long) to PlayerInstance */ + private final LongHashMap playerInstances = new LongHashMap(); + /** + * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who + * can also that chunk + */ + private final List chunkWatcherWithPlayers = new ArrayList(); + /** This field is using when chunk should be processed (every 8000 ticks) */ + private final List playerInstanceList = new ArrayList(); + /** Number of chunks the server sends to the client. Valid 3<=x<=15. In server.properties. */ + private int playerViewRadius; + /** time what is using to check if InhabitedTime should be calculated */ + private long previousTotalWorldTime; + /** x, z direction vectors: east, south, west, north */ + private final int[][] xzDirectionsConst = new int[][] {{1, 0}, {0, 1}, { -1, 0}, {0, -1}}; + private static final String __OBFID = "CL_00001434"; + + public PlayerManager(WorldServer p_i1176_1_) + { + this.theWorldServer = p_i1176_1_; + this.func_152622_a(p_i1176_1_.func_73046_m().getConfigurationManager().getViewDistance()); + } + + public WorldServer getWorldServer() + { + return this.theWorldServer; + } + + /** + * updates all the player instances that need to be updated + */ + public void updatePlayerInstances() + { + long i = this.theWorldServer.getTotalWorldTime(); + int j; + PlayerManager.PlayerInstance playerinstance; + + if (i - this.previousTotalWorldTime > 8000L) + { + this.previousTotalWorldTime = i; + + for (j = 0; j < this.playerInstanceList.size(); ++j) + { + playerinstance = (PlayerManager.PlayerInstance)this.playerInstanceList.get(j); + playerinstance.sendChunkUpdate(); + playerinstance.processChunk(); + } + } + else + { + for (j = 0; j < this.chunkWatcherWithPlayers.size(); ++j) + { + playerinstance = (PlayerManager.PlayerInstance)this.chunkWatcherWithPlayers.get(j); + playerinstance.sendChunkUpdate(); + } + } + + this.chunkWatcherWithPlayers.clear(); + + if (this.players.isEmpty()) + { + WorldProvider worldprovider = this.theWorldServer.provider; + + if (!worldprovider.canRespawnHere()) + { + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } + } + + public boolean func_152621_a(int p_152621_1_, int p_152621_2_) + { + long k = (long)p_152621_1_ + 2147483647L | (long)p_152621_2_ + 2147483647L << 32; + return this.playerInstances.getValueByKey(k) != null; + } + + private PlayerManager.PlayerInstance getOrCreateChunkWatcher(int p_72690_1_, int p_72690_2_, boolean p_72690_3_) + { + long k = (long)p_72690_1_ + 2147483647L | (long)p_72690_2_ + 2147483647L << 32; + PlayerManager.PlayerInstance playerinstance = (PlayerManager.PlayerInstance)this.playerInstances.getValueByKey(k); + + if (playerinstance == null && p_72690_3_) + { + playerinstance = new PlayerManager.PlayerInstance(p_72690_1_, p_72690_2_); + this.playerInstances.add(k, playerinstance); + this.playerInstanceList.add(playerinstance); + } + + return playerinstance; + } + + public void markBlockForUpdate(int p_151250_1_, int p_151250_2_, int p_151250_3_) + { + int l = p_151250_1_ >> 4; + int i1 = p_151250_3_ >> 4; + PlayerManager.PlayerInstance playerinstance = this.getOrCreateChunkWatcher(l, i1, false); + + if (playerinstance != null) + { + playerinstance.flagChunkForUpdate(p_151250_1_ & 15, p_151250_2_, p_151250_3_ & 15); + } + } + + /** + * Adds an EntityPlayerMP to the PlayerManager. + */ + public void addPlayer(EntityPlayerMP p_72683_1_) + { + int i = (int)p_72683_1_.posX >> 4; + int j = (int)p_72683_1_.posZ >> 4; + p_72683_1_.managedPosX = p_72683_1_.posX; + p_72683_1_.managedPosZ = p_72683_1_.posZ; + // Load nearby chunks first + List chunkList = new ArrayList(); + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) + { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + { + chunkList.add(new ChunkCoordIntPair(k, l)); + } + } + + java.util.Collections.sort(chunkList, new net.minecraftforge.common.util.ChunkCoordComparator(p_72683_1_)); + + for (ChunkCoordIntPair pair : chunkList) + { + this.getOrCreateChunkWatcher(pair.chunkXPos, pair.chunkZPos, true).addPlayer(p_72683_1_); + } + + this.players.add(p_72683_1_); + this.filterChunkLoadQueue(p_72683_1_); + } + + /** + * Removes all chunks from the given player's chunk load queue that are not in viewing range of the player. + */ + public void filterChunkLoadQueue(EntityPlayerMP p_72691_1_) + { + ArrayList arraylist = new ArrayList(p_72691_1_.loadedChunks); + int i = 0; + int j = this.playerViewRadius; + int k = (int)p_72691_1_.posX >> 4; + int l = (int)p_72691_1_.posZ >> 4; + int i1 = 0; + int j1 = 0; + ChunkCoordIntPair chunkcoordintpair = this.getOrCreateChunkWatcher(k, l, true).chunkLocation; + p_72691_1_.loadedChunks.clear(); + + if (arraylist.contains(chunkcoordintpair)) + { + p_72691_1_.loadedChunks.add(chunkcoordintpair); + } + + int k1; + + for (k1 = 1; k1 <= j * 2; ++k1) + { + for (int l1 = 0; l1 < 2; ++l1) + { + int[] aint = this.xzDirectionsConst[i++ % 4]; + + for (int i2 = 0; i2 < k1; ++i2) + { + i1 += aint[0]; + j1 += aint[1]; + chunkcoordintpair = this.getOrCreateChunkWatcher(k + i1, l + j1, true).chunkLocation; + + if (arraylist.contains(chunkcoordintpair)) + { + p_72691_1_.loadedChunks.add(chunkcoordintpair); + } + } + } + } + + i %= 4; + + for (k1 = 0; k1 < j * 2; ++k1) + { + i1 += this.xzDirectionsConst[i][0]; + j1 += this.xzDirectionsConst[i][1]; + chunkcoordintpair = this.getOrCreateChunkWatcher(k + i1, l + j1, true).chunkLocation; + + if (arraylist.contains(chunkcoordintpair)) + { + p_72691_1_.loadedChunks.add(chunkcoordintpair); + } + } + } + + /** + * Removes an EntityPlayerMP from the PlayerManager. + */ + public void removePlayer(EntityPlayerMP p_72695_1_) + { + int i = (int)p_72695_1_.managedPosX >> 4; + int j = (int)p_72695_1_.managedPosZ >> 4; + + for (int k = i - this.playerViewRadius; k <= i + this.playerViewRadius; ++k) + { + for (int l = j - this.playerViewRadius; l <= j + this.playerViewRadius; ++l) + { + PlayerManager.PlayerInstance playerinstance = this.getOrCreateChunkWatcher(k, l, false); + + if (playerinstance != null) + { + playerinstance.removePlayer(p_72695_1_); + } + } + } + + this.players.remove(p_72695_1_); + } + + /** + * Determine if two rectangles centered at the given points overlap for the provided radius. Arguments: x1, z1, x2, + * z2, radius. + */ + private boolean overlaps(int p_72684_1_, int p_72684_2_, int p_72684_3_, int p_72684_4_, int p_72684_5_) + { + int j1 = p_72684_1_ - p_72684_3_; + int k1 = p_72684_2_ - p_72684_4_; + return j1 >= -p_72684_5_ && j1 <= p_72684_5_ ? k1 >= -p_72684_5_ && k1 <= p_72684_5_ : false; + } + + /** + * Update which chunks the player needs info on. + */ + public void updatePlayerPertinentChunks(EntityPlayerMP p_72685_1_) + { + int i = (int)p_72685_1_.posX >> 4; + int j = (int)p_72685_1_.posZ >> 4; + double d0 = p_72685_1_.managedPosX - p_72685_1_.posX; + double d1 = p_72685_1_.managedPosZ - p_72685_1_.posZ; + double d2 = d0 * d0 + d1 * d1; + + if (d2 >= 64.0D) + { + int k = (int)p_72685_1_.managedPosX >> 4; + int l = (int)p_72685_1_.managedPosZ >> 4; + int i1 = this.playerViewRadius; + int j1 = i - k; + int k1 = j - l; + List chunksToLoad = new ArrayList(); + + if (j1 != 0 || k1 != 0) + { + for (int l1 = i - i1; l1 <= i + i1; ++l1) + { + for (int i2 = j - i1; i2 <= j + i1; ++i2) + { + if (!this.overlaps(l1, i2, k, l, i1)) + { + chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); + } + + if (!this.overlaps(l1 - j1, i2 - k1, i, j, i1)) + { + PlayerManager.PlayerInstance playerinstance = this.getOrCreateChunkWatcher(l1 - j1, i2 - k1, false); + + if (playerinstance != null) + { + playerinstance.removePlayer(p_72685_1_); + } + } + } + } + + this.filterChunkLoadQueue(p_72685_1_); + p_72685_1_.managedPosX = p_72685_1_.posX; + p_72685_1_.managedPosZ = p_72685_1_.posZ; + // send nearest chunks first + java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); + + for (ChunkCoordIntPair pair : chunksToLoad) + { + this.getOrCreateChunkWatcher(pair.chunkXPos, pair.chunkZPos, true).addPlayer(p_72685_1_); + } + + if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) + { + java.util.Collections.sort(p_72685_1_.loadedChunks, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); + } + } + } + } + + public boolean isPlayerWatchingChunk(EntityPlayerMP p_72694_1_, int p_72694_2_, int p_72694_3_) + { + PlayerManager.PlayerInstance playerinstance = this.getOrCreateChunkWatcher(p_72694_2_, p_72694_3_, false); + return playerinstance != null && playerinstance.playersWatchingChunk.contains(p_72694_1_) && !p_72694_1_.loadedChunks.contains(playerinstance.chunkLocation); + } + + public void func_152622_a(int p_152622_1_) + { + p_152622_1_ = MathHelper.clamp_int(p_152622_1_, 3, 20); + + if (p_152622_1_ != this.playerViewRadius) + { + int j = p_152622_1_ - this.playerViewRadius; + Iterator iterator = this.players.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + int k = (int)entityplayermp.posX >> 4; + int l = (int)entityplayermp.posZ >> 4; + int i1; + int j1; + + if (j > 0) + { + for (i1 = k - p_152622_1_; i1 <= k + p_152622_1_; ++i1) + { + for (j1 = l - p_152622_1_; j1 <= l + p_152622_1_; ++j1) + { + PlayerManager.PlayerInstance playerinstance = this.getOrCreateChunkWatcher(i1, j1, true); + + if (!playerinstance.playersWatchingChunk.contains(entityplayermp)) + { + playerinstance.addPlayer(entityplayermp); + } + } + } + } + else + { + for (i1 = k - this.playerViewRadius; i1 <= k + this.playerViewRadius; ++i1) + { + for (j1 = l - this.playerViewRadius; j1 <= l + this.playerViewRadius; ++j1) + { + if (!this.overlaps(i1, j1, k, l, p_152622_1_)) + { + this.getOrCreateChunkWatcher(i1, j1, true).removePlayer(entityplayermp); + } + } + } + } + } + + this.playerViewRadius = p_152622_1_; + } + } + + /** + * Get the furthest viewable block given player's view distance + */ + public static int getFurthestViewableBlock(int p_72686_0_) + { + return p_72686_0_ * 16 - 16; + } + + class PlayerInstance + { + private final List playersWatchingChunk = new ArrayList(); + /** note: this is final */ + private final ChunkCoordIntPair chunkLocation; + private short[] locationOfBlockChange = new short[64]; + private int numberOfTilesToUpdate; + /** Integer field where each bit means to make update 16x16x16 division of chunk (from bottom). */ + private int flagsYAreasToUpdate; + /** time what is using when chunk InhabitedTime is being calculated */ + private long previousWorldTime; + private final java.util.HashMap players = new java.util.HashMap(); + private boolean loaded = false; + private Runnable loadedRunnable = new Runnable() + { + public void run() + { + PlayerInstance.this.loaded = true; + } + }; + private static final String __OBFID = "CL_00001435"; + + public PlayerInstance(int p_i1518_2_, int p_i1518_3_) + { + this.chunkLocation = new ChunkCoordIntPair(p_i1518_2_, p_i1518_3_); + PlayerManager.this.theWorldServer.theChunkProviderServer.loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); + } + + public void addPlayer(final EntityPlayerMP p_73255_1_) + { + if (this.playersWatchingChunk.contains(p_73255_1_)) + { + PlayerManager.field_152627_a.debug("Failed to add player. {} already is in chunk {}, {}", new Object[] {p_73255_1_, Integer.valueOf(this.chunkLocation.chunkXPos), Integer.valueOf(this.chunkLocation.chunkZPos)}); + } + else + { + if (this.playersWatchingChunk.isEmpty()) + { + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + this.playersWatchingChunk.add(p_73255_1_); + Runnable playerRunnable; + + if (this.loaded) + { + playerRunnable = null; + p_73255_1_.loadedChunks.add(this.chunkLocation); + } + else + { + playerRunnable = new Runnable() + { + public void run() + { + p_73255_1_.loadedChunks.add(PlayerInstance.this.chunkLocation); + } + }; + PlayerManager.this.getWorldServer().theChunkProviderServer.loadChunk(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, playerRunnable); + } + + this.players.put(p_73255_1_, playerRunnable); + } + } + + public void removePlayer(EntityPlayerMP p_73252_1_) + { + if (this.playersWatchingChunk.contains(p_73252_1_)) + { + // If we haven't loaded yet don't load the chunk just so we can clean it up + if (!this.loaded) + { + net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getWorldServer(), this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.players.get(p_73252_1_)); + this.playersWatchingChunk.remove(p_73252_1_); + this.players.remove(p_73252_1_); + + if (this.playersWatchingChunk.isEmpty()) + { + net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.getWorldServer(), this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.loadedRunnable); + long i = (long) this.chunkLocation.chunkXPos + 2147483647L | (long) this.chunkLocation.chunkZPos + 2147483647L << 32; + PlayerManager.this.playerInstances.remove(i); + PlayerManager.this.playerInstanceList.remove(this); + } + + return; + } + + Chunk chunk = PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + + if (chunk.func_150802_k()) + { + p_73252_1_.playerNetServerHandler.sendPacket(new S21PacketChunkData(chunk, true, 0)); + } + + this.players.remove(p_73252_1_); + this.playersWatchingChunk.remove(p_73252_1_); + p_73252_1_.loadedChunks.remove(this.chunkLocation); + + net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(chunkLocation, p_73252_1_)); + + if (this.playersWatchingChunk.isEmpty()) + { + long i = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(chunk); + PlayerManager.this.playerInstances.remove(i); + PlayerManager.this.playerInstanceList.remove(this); + + if (this.numberOfTilesToUpdate > 0) + { + PlayerManager.this.chunkWatcherWithPlayers.remove(this); + } + + PlayerManager.this.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + } + } + } + + /** + * This method currently only increases chunk inhabited time. Extension is possible in next versions + */ + public void processChunk() + { + this.increaseInhabitedTime(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos)); + } + + /** + * Increases chunk inhabited time every 8000 ticks + */ + private void increaseInhabitedTime(Chunk p_111196_1_) + { + p_111196_1_.inhabitedTime += PlayerManager.this.theWorldServer.getTotalWorldTime() - this.previousWorldTime; + this.previousWorldTime = PlayerManager.this.theWorldServer.getTotalWorldTime(); + } + + public void flagChunkForUpdate(int p_151253_1_, int p_151253_2_, int p_151253_3_) + { + if (this.numberOfTilesToUpdate == 0) + { + PlayerManager.this.chunkWatcherWithPlayers.add(this); + } + + this.flagsYAreasToUpdate |= 1 << (p_151253_2_ >> 4); + + //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run + { + short short1 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); + + for (int l = 0; l < this.numberOfTilesToUpdate; ++l) + { + if (this.locationOfBlockChange[l] == short1) + { + return; + } + } + + if (numberOfTilesToUpdate == locationOfBlockChange.length) + { + locationOfBlockChange = java.util.Arrays.copyOf(locationOfBlockChange, locationOfBlockChange.length << 1); + } + this.locationOfBlockChange[this.numberOfTilesToUpdate++] = short1; + } + } + + public void sendToAllPlayersWatchingChunk(Packet p_151251_1_) + { + for (int i = 0; i < this.playersWatchingChunk.size(); ++i) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playersWatchingChunk.get(i); + + if (!entityplayermp.loadedChunks.contains(this.chunkLocation)) + { + entityplayermp.playerNetServerHandler.sendPacket(p_151251_1_); + } + } + } + + @SuppressWarnings("unused") + public void sendChunkUpdate() + { + if (this.numberOfTilesToUpdate != 0) + { + int i; + int j; + int k; + + if (this.numberOfTilesToUpdate == 1) + { + i = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15); + j = this.locationOfBlockChange[0] & 255; + k = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); + this.sendToAllPlayersWatchingChunk(new S23PacketBlockChange(i, j, k, PlayerManager.this.theWorldServer)); + + if (PlayerManager.this.theWorldServer.getBlock(i, j, k).hasTileEntity(PlayerManager.this.theWorldServer.getBlockMetadata(i, j, k))) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(i, j, k)); + } + } + else + { + int l; + + if (this.numberOfTilesToUpdate >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) + { + i = this.chunkLocation.chunkXPos * 16; + j = this.chunkLocation.chunkZPos * 16; + this.sendToAllPlayersWatchingChunk(new S21PacketChunkData(PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); + + // Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones + for (k = 0; false && k < 16; ++k) + { + if ((this.flagsYAreasToUpdate & 1 << k) != 0) + { + l = k << 4; + List list = PlayerManager.this.theWorldServer.func_147486_a(i, l, j, i + 16, l + 16, j + 16); + + for (int i1 = 0; i1 < list.size(); ++i1) + { + this.sendTileToAllPlayersWatchingChunk((TileEntity)list.get(i1)); + } + } + } + } + else + { + this.sendToAllPlayersWatchingChunk(new S22PacketMultiBlockChange(this.numberOfTilesToUpdate, this.locationOfBlockChange, PlayerManager.this.theWorldServer.getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos))); + } + + { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small + WorldServer world = PlayerManager.this.theWorldServer; + for (i = 0; i < this.numberOfTilesToUpdate; ++i) + { + j = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[i] >> 12 & 15); + k = this.locationOfBlockChange[i] & 255; + l = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[i] >> 8 & 15); + + if (world.getBlock(j, k, l).hasTileEntity(world.getBlockMetadata(j, k, l))) + { + this.sendTileToAllPlayersWatchingChunk(PlayerManager.this.theWorldServer.getTileEntity(j, k, l)); + } + } + } + } + + this.numberOfTilesToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + + private void sendTileToAllPlayersWatchingChunk(TileEntity p_151252_1_) + { + if (p_151252_1_ != null) + { + Packet packet = p_151252_1_.getDescriptionPacket(); + + if (packet != null) + { + this.sendToAllPlayersWatchingChunk(packet); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerPositionComparator.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerPositionComparator.java new file mode 100644 index 0000000..b365aea --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerPositionComparator.java @@ -0,0 +1,28 @@ +package net.minecraft.server.management; + +import java.util.Comparator; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChunkCoordinates; + +public class PlayerPositionComparator implements Comparator +{ + private final ChunkCoordinates theChunkCoordinates; + private static final String __OBFID = "CL_00001422"; + + public PlayerPositionComparator(ChunkCoordinates p_i1499_1_) + { + this.theChunkCoordinates = p_i1499_1_; + } + + public int compare(EntityPlayerMP p_compare_1_, EntityPlayerMP p_compare_2_) + { + double d0 = p_compare_1_.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); + double d1 = p_compare_2_.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); + return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0); + } + + public int compare(Object p_compare_1_, Object p_compare_2_) + { + return this.compare((EntityPlayerMP)p_compare_1_, (EntityPlayerMP)p_compare_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerProfileCache.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerProfileCache.java new file mode 100644 index 0000000..74b4b76 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/PlayerProfileCache.java @@ -0,0 +1,443 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import org.apache.commons.io.IOUtils; + +public class PlayerProfileCache +{ + public static final SimpleDateFormat field_152659_a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); + private final Map field_152661_c = Maps.newHashMap(); + private final Map field_152662_d = Maps.newHashMap(); + private final LinkedList field_152663_e = Lists.newLinkedList(); + private final MinecraftServer field_152664_f; + protected final Gson field_152660_b; + private final File field_152665_g; + private static final ParameterizedType field_152666_h = new ParameterizedType() + { + private static final String __OBFID = "CL_00001886"; + public Type[] getActualTypeArguments() + { + return new Type[] {PlayerProfileCache.ProfileEntry.class}; + } + public Type getRawType() + { + return List.class; + } + public Type getOwnerType() + { + return null; + } + }; + private static final String __OBFID = "CL_00001888"; + + public PlayerProfileCache(MinecraftServer p_i1171_1_, File p_i1171_2_) + { + this.field_152664_f = p_i1171_1_; + this.field_152665_g = p_i1171_2_; + GsonBuilder gsonbuilder = new GsonBuilder(); + gsonbuilder.registerTypeHierarchyAdapter(PlayerProfileCache.ProfileEntry.class, new PlayerProfileCache.Serializer(null)); + this.field_152660_b = gsonbuilder.create(); + this.func_152657_b(); + } + + private static GameProfile func_152650_a(MinecraftServer p_152650_0_, String p_152650_1_) + { + final GameProfile[] agameprofile = new GameProfile[1]; + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001887"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + agameprofile[0] = p_onProfileLookupSucceeded_1_; + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + agameprofile[0] = null; + } + }; + p_152650_0_.func_152359_aw().findProfilesByNames(new String[] {p_152650_1_}, Agent.MINECRAFT, profilelookupcallback); + + if (!p_152650_0_.isServerInOnlineMode() && agameprofile[0] == null) + { + UUID uuid = EntityPlayer.func_146094_a(new GameProfile((UUID)null, p_152650_1_)); + GameProfile gameprofile = new GameProfile(uuid, p_152650_1_); + profilelookupcallback.onProfileLookupSucceeded(gameprofile); + } + + return agameprofile[0]; + } + + public void func_152649_a(GameProfile p_152649_1_) + { + this.func_152651_a(p_152649_1_, (Date)null); + } + + private void func_152651_a(GameProfile p_152651_1_, Date p_152651_2_) + { + UUID uuid = p_152651_1_.getId(); + + if (p_152651_2_ == null) + { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(2, 1); + p_152651_2_ = calendar.getTime(); + } + + String s = p_152651_1_.getName().toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry profileentry = new PlayerProfileCache.ProfileEntry(p_152651_1_, p_152651_2_, null); + LinkedList linkedlist = this.field_152663_e; + + synchronized (this.field_152663_e) + { + if (this.field_152662_d.containsKey(uuid)) + { + PlayerProfileCache.ProfileEntry profileentry1 = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(uuid); + this.field_152661_c.remove(profileentry1.func_152668_a().getName().toLowerCase(Locale.ROOT)); + this.field_152661_c.put(p_152651_1_.getName().toLowerCase(Locale.ROOT), profileentry); + this.field_152663_e.remove(p_152651_1_); + } + else + { + this.field_152662_d.put(uuid, profileentry); + this.field_152661_c.put(s, profileentry); + } + + this.field_152663_e.addFirst(p_152651_1_); + } + } + + public GameProfile func_152655_a(String p_152655_1_) + { + String s1 = p_152655_1_.toLowerCase(Locale.ROOT); + PlayerProfileCache.ProfileEntry profileentry = (PlayerProfileCache.ProfileEntry)this.field_152661_c.get(s1); + + if (profileentry != null && (new Date()).getTime() >= profileentry.field_152673_c.getTime()) + { + this.field_152662_d.remove(profileentry.func_152668_a().getId()); + this.field_152661_c.remove(profileentry.func_152668_a().getName().toLowerCase(Locale.ROOT)); + LinkedList linkedlist = this.field_152663_e; + + synchronized (this.field_152663_e) + { + this.field_152663_e.remove(profileentry.func_152668_a()); + } + + profileentry = null; + } + + GameProfile gameprofile; + + if (profileentry != null) + { + gameprofile = profileentry.func_152668_a(); + LinkedList linkedlist1 = this.field_152663_e; + + synchronized (this.field_152663_e) + { + this.field_152663_e.remove(gameprofile); + this.field_152663_e.addFirst(gameprofile); + } + } + else + { + gameprofile = func_152650_a(this.field_152664_f, s1); + + if (gameprofile != null) + { + this.func_152649_a(gameprofile); + profileentry = (PlayerProfileCache.ProfileEntry)this.field_152661_c.get(s1); + } + } + + this.func_152658_c(); + return profileentry == null ? null : profileentry.func_152668_a(); + } + + public String[] func_152654_a() + { + ArrayList arraylist = Lists.newArrayList(this.field_152661_c.keySet()); + return (String[])arraylist.toArray(new String[arraylist.size()]); + } + + public GameProfile func_152652_a(UUID p_152652_1_) + { + PlayerProfileCache.ProfileEntry profileentry = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(p_152652_1_); + return profileentry == null ? null : profileentry.func_152668_a(); + } + + private PlayerProfileCache.ProfileEntry func_152653_b(UUID p_152653_1_) + { + PlayerProfileCache.ProfileEntry profileentry = (PlayerProfileCache.ProfileEntry)this.field_152662_d.get(p_152653_1_); + + if (profileentry != null) + { + GameProfile gameprofile = profileentry.func_152668_a(); + LinkedList linkedlist = this.field_152663_e; + + synchronized (this.field_152663_e) + { + this.field_152663_e.remove(gameprofile); + this.field_152663_e.addFirst(gameprofile); + } + } + + return profileentry; + } + + public void func_152657_b() + { + List list = null; + BufferedReader bufferedreader = null; + { + try + { + bufferedreader = Files.newReader(this.field_152665_g, Charsets.UTF_8); + list = (List)this.field_152660_b.fromJson(bufferedreader, field_152666_h); + + if (list != null) + { + this.field_152661_c.clear(); + this.field_152662_d.clear(); + LinkedList linkedlist = this.field_152663_e; + + synchronized (this.field_152663_e) + { + this.field_152663_e.clear(); + } + + list = Lists.reverse(list); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + PlayerProfileCache.ProfileEntry profileentry = (PlayerProfileCache.ProfileEntry)iterator.next(); + + if (profileentry != null) + { + this.func_152651_a(profileentry.func_152668_a(), profileentry.func_152670_b()); + } + } + } + } + catch (FileNotFoundException filenotfoundexception) + { + ; + } + catch (com.google.gson.JsonParseException parsefail) + { + // No op - the cache can quietly rebuild if it's junk + } + finally + { + IOUtils.closeQuietly(bufferedreader); + } + } + } + + public void func_152658_c() + { + String s = this.field_152660_b.toJson(this.func_152656_a(1000)); + BufferedWriter bufferedwriter = null; + + try + { + bufferedwriter = Files.newWriter(this.field_152665_g, Charsets.UTF_8); + bufferedwriter.write(s); + return; + } + catch (FileNotFoundException filenotfoundexception) + { + ; + } + catch (IOException ioexception) + { + return; + } + finally + { + IOUtils.closeQuietly(bufferedwriter); + } + } + + private List func_152656_a(int p_152656_1_) + { + ArrayList arraylist = Lists.newArrayList(); + LinkedList linkedlist = this.field_152663_e; + ArrayList arraylist1; + + synchronized (this.field_152663_e) + { + arraylist1 = Lists.newArrayList(Iterators.limit(this.field_152663_e.iterator(), p_152656_1_)); + } + + Iterator iterator = arraylist1.iterator(); + + while (iterator.hasNext()) + { + GameProfile gameprofile = (GameProfile)iterator.next(); + PlayerProfileCache.ProfileEntry profileentry = this.func_152653_b(gameprofile.getId()); + + if (profileentry != null) + { + arraylist.add(profileentry); + } + } + + return arraylist; + } + + class ProfileEntry + { + private final GameProfile field_152672_b; + private final Date field_152673_c; + private static final String __OBFID = "CL_00001885"; + + private ProfileEntry(GameProfile p_i1165_2_, Date p_i1165_3_) + { + this.field_152672_b = p_i1165_2_; + this.field_152673_c = p_i1165_3_; + } + + public GameProfile func_152668_a() + { + return this.field_152672_b; + } + + public Date func_152670_b() + { + return this.field_152673_c; + } + + ProfileEntry(GameProfile p_i1166_2_, Date p_i1166_3_, Object p_i1166_4_) + { + this(p_i1166_2_, p_i1166_3_); + } + } + + class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001884"; + + private Serializer() {} + + public JsonElement func_152676_a(PlayerProfileCache.ProfileEntry p_152676_1_, Type p_152676_2_, JsonSerializationContext p_152676_3_) + { + JsonObject jsonobject = new JsonObject(); + jsonobject.addProperty("name", p_152676_1_.func_152668_a().getName()); + UUID uuid = p_152676_1_.func_152668_a().getId(); + jsonobject.addProperty("uuid", uuid == null ? "" : uuid.toString()); + jsonobject.addProperty("expiresOn", PlayerProfileCache.field_152659_a.format(p_152676_1_.func_152670_b())); + return jsonobject; + } + + public PlayerProfileCache.ProfileEntry func_152675_a(JsonElement p_152675_1_, Type p_152675_2_, JsonDeserializationContext p_152675_3_) + { + if (p_152675_1_.isJsonObject()) + { + JsonObject jsonobject = p_152675_1_.getAsJsonObject(); + JsonElement jsonelement1 = jsonobject.get("name"); + JsonElement jsonelement2 = jsonobject.get("uuid"); + JsonElement jsonelement3 = jsonobject.get("expiresOn"); + + if (jsonelement1 != null && jsonelement2 != null) + { + String s = jsonelement2.getAsString(); + String s1 = jsonelement1.getAsString(); + Date date = null; + + if (jsonelement3 != null) + { + try + { + date = PlayerProfileCache.field_152659_a.parse(jsonelement3.getAsString()); + } + catch (ParseException parseexception) + { + date = null; + } + } + + if (s1 != null && s != null) + { + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable throwable) + { + return null; + } + + PlayerProfileCache.ProfileEntry profileentry = PlayerProfileCache.this.new ProfileEntry(new GameProfile(uuid, s1), date, null); + return profileentry; + } + else + { + return null; + } + } + else + { + return null; + } + } + else + { + return null; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.func_152676_a((PlayerProfileCache.ProfileEntry)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + public Object deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + return this.func_152675_a(p_deserialize_1_, p_deserialize_2_, p_deserialize_3_); + } + + Serializer(Object p_i1163_2_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/PreYggdrasilConverter.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/PreYggdrasilConverter.java new file mode 100644 index 0000000..7068423 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/PreYggdrasilConverter.java @@ -0,0 +1,681 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.base.Predicate; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.mojang.authlib.Agent; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.ProfileLookupCallback; +import com.mojang.authlib.yggdrasil.ProfileNotFoundException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FilenameFilter; +import java.io.IOException; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.dedicated.DedicatedServer; +import net.minecraft.server.dedicated.PropertyManager; +import net.minecraft.util.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PreYggdrasilConverter +{ + private static final Logger field_152732_e = LogManager.getLogger(); + public static final File field_152728_a = new File("banned-ips.txt"); + public static final File field_152729_b = new File("banned-players.txt"); + public static final File field_152730_c = new File("ops.txt"); + public static final File field_152731_d = new File("white-list.txt"); + private static final String __OBFID = "CL_00001882"; + + private static void func_152717_a(MinecraftServer server, Collection names, ProfileLookupCallback callback) + { + String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate() + { + private static final String __OBFID = "CL_00001881"; + public boolean func_152733_a(String p_152733_1_) + { + return !StringUtils.isNullOrEmpty(p_152733_1_); + } + public boolean apply(Object p_apply_1_) + { + return this.func_152733_a((String)p_apply_1_); + } + }), String.class); + + if (server.isServerInOnlineMode()) + { + server.func_152359_aw().findProfilesByNames(astring, Agent.MINECRAFT, callback); + } + else + { + String[] astring1 = astring; + int i = astring.length; + + for (int j = 0; j < i; ++j) + { + String s = astring1[j]; + UUID uuid = EntityPlayer.func_146094_a(new GameProfile((UUID)null, s)); + GameProfile gameprofile = new GameProfile(uuid, s); + callback.onProfileLookupSucceeded(gameprofile); + } + } + } + + public static String func_152719_a(String p_152719_0_) + { + if (!StringUtils.isNullOrEmpty(p_152719_0_) && p_152719_0_.length() <= 16) + { + final MinecraftServer minecraftserver = MinecraftServer.getServer(); + GameProfile gameprofile = minecraftserver.func_152358_ax().func_152655_a(p_152719_0_); + + if (gameprofile != null && gameprofile.getId() != null) + { + return gameprofile.getId().toString(); + } + else if (!minecraftserver.isSinglePlayer() && minecraftserver.isServerInOnlineMode()) + { + final ArrayList arraylist = Lists.newArrayList(); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001880"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + minecraftserver.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + arraylist.add(p_onProfileLookupSucceeded_1_); + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + } + }; + func_152717_a(minecraftserver, Lists.newArrayList(new String[] {p_152719_0_}), profilelookupcallback); + return arraylist.size() > 0 && ((GameProfile)arraylist.get(0)).getId() != null ? ((GameProfile)arraylist.get(0)).getId().toString() : ""; + } + else + { + return EntityPlayer.func_146094_a(new GameProfile((UUID)null, p_152719_0_)).toString(); + } + } + else + { + return p_152719_0_; + } + } + + @SideOnly(Side.SERVER) + static List func_152721_a(File inFile, Map read) throws IOException + { + List list = Files.readLines(inFile, Charsets.UTF_8); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + s = s.trim(); + + if (!s.startsWith("#") && s.length() >= 1) + { + String[] astring = s.split("\\|"); + read.put(astring[0].toLowerCase(Locale.ROOT), astring); + } + } + + return list; + } + + @SideOnly(Side.SERVER) + public static boolean func_152724_a(final MinecraftServer server) throws IOException + { + final UserListBans userlistbans = new UserListBans(ServerConfigurationManager.field_152613_a); + + if (field_152729_b.exists() && field_152729_b.isFile()) + { + if (userlistbans.func_152691_c().exists()) + { + try + { + userlistbans.func_152679_g(); + } + catch (FileNotFoundException filenotfoundexception) + { + field_152732_e.warn("Could not load existing file " + userlistbans.func_152691_c().getName(), filenotfoundexception); + } + } + + try + { + final HashMap hashmap = Maps.newHashMap(); + func_152721_a(field_152729_b, hashmap); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001910"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + server.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + String[] astring = (String[])hashmap.get(p_onProfileLookupSucceeded_1_.getName().toLowerCase(Locale.ROOT)); + + if (astring == null) + { + PreYggdrasilConverter.field_152732_e.warn("Could not convert user banlist entry for " + p_onProfileLookupSucceeded_1_.getName()); + throw new PreYggdrasilConverter.ConversionError("Profile not in the conversionlist", null); + } + else + { + Date date = astring.length > 1 ? PreYggdrasilConverter.func_152713_b(astring[1], (Date)null) : null; + String s = astring.length > 2 ? astring[2] : null; + Date date1 = astring.length > 3 ? PreYggdrasilConverter.func_152713_b(astring[3], (Date)null) : null; + String s1 = astring.length > 4 ? astring[4] : null; + userlistbans.func_152687_a(new UserListBansEntry(p_onProfileLookupSucceeded_1_, date, s, date1, s1)); + } + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup user banlist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + + if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException)) + { + throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null); + } + } + }; + func_152717_a(server, hashmap.keySet(), profilelookupcallback); + userlistbans.func_152678_f(); + func_152727_c(field_152729_b); + return true; + } + catch (IOException ioexception) + { + field_152732_e.warn("Could not read old user banlist to convert it!", ioexception); + return false; + } + catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror) + { + field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror); + return false; + } + } + else + { + return true; + } + } + + @SideOnly(Side.SERVER) + public static boolean func_152722_b(MinecraftServer server) throws IOException + { + BanList banlist = new BanList(ServerConfigurationManager.field_152614_b); + + if (field_152728_a.exists() && field_152728_a.isFile()) + { + if (banlist.func_152691_c().exists()) + { + try + { + banlist.func_152679_g(); + } + catch (FileNotFoundException filenotfoundexception) + { + field_152732_e.warn("Could not load existing file " + banlist.func_152691_c().getName(), filenotfoundexception); + } + } + + try + { + HashMap hashmap = Maps.newHashMap(); + func_152721_a(field_152728_a, hashmap); + Iterator iterator = hashmap.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + String[] astring = (String[])hashmap.get(s); + Date date = astring.length > 1 ? func_152713_b(astring[1], (Date)null) : null; + String s1 = astring.length > 2 ? astring[2] : null; + Date date1 = astring.length > 3 ? func_152713_b(astring[3], (Date)null) : null; + String s2 = astring.length > 4 ? astring[4] : null; + banlist.func_152687_a(new IPBanEntry(s, date, s1, date1, s2)); + } + + banlist.func_152678_f(); + func_152727_c(field_152728_a); + return true; + } + catch (IOException ioexception) + { + field_152732_e.warn("Could not parse old ip banlist to convert it!", ioexception); + return false; + } + } + else + { + return true; + } + } + + @SideOnly(Side.SERVER) + public static boolean func_152718_c(final MinecraftServer server) throws IOException + { + final UserListOps userlistops = new UserListOps(ServerConfigurationManager.field_152615_c); + + if (field_152730_c.exists() && field_152730_c.isFile()) + { + if (userlistops.func_152691_c().exists()) + { + try + { + userlistops.func_152679_g(); + } + catch (FileNotFoundException filenotfoundexception) + { + field_152732_e.warn("Could not load existing file " + userlistops.func_152691_c().getName(), filenotfoundexception); + } + } + + try + { + List list = Files.readLines(field_152730_c, Charsets.UTF_8); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001909"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + server.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + userlistops.func_152687_a(new UserListOpsEntry(p_onProfileLookupSucceeded_1_, server.getOpPermissionLevel())); + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup oplist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + + if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException)) + { + throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null); + } + } + }; + func_152717_a(server, list, profilelookupcallback); + userlistops.func_152678_f(); + func_152727_c(field_152730_c); + return true; + } + catch (IOException ioexception) + { + field_152732_e.warn("Could not read old oplist to convert it!", ioexception); + return false; + } + catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror) + { + field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror); + return false; + } + } + else + { + return true; + } + } + + @SideOnly(Side.SERVER) + public static boolean func_152710_d(final MinecraftServer server) throws IOException + { + final UserListWhitelist userlistwhitelist = new UserListWhitelist(ServerConfigurationManager.field_152616_d); + + if (field_152731_d.exists() && field_152731_d.isFile()) + { + if (userlistwhitelist.func_152691_c().exists()) + { + try + { + userlistwhitelist.func_152679_g(); + } + catch (FileNotFoundException filenotfoundexception) + { + field_152732_e.warn("Could not load existing file " + userlistwhitelist.func_152691_c().getName(), filenotfoundexception); + } + } + + try + { + List list = Files.readLines(field_152731_d, Charsets.UTF_8); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001908"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + server.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + userlistwhitelist.func_152687_a(new UserListWhitelistEntry(p_onProfileLookupSucceeded_1_)); + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + + if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException)) + { + throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null); + } + } + }; + func_152717_a(server, list, profilelookupcallback); + userlistwhitelist.func_152678_f(); + func_152727_c(field_152731_d); + return true; + } + catch (IOException ioexception) + { + field_152732_e.warn("Could not read old whitelist to convert it!", ioexception); + return false; + } + catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror) + { + field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror); + return false; + } + } + else + { + return true; + } + } + + @SideOnly(Side.SERVER) + public static boolean func_152723_a(final DedicatedServer server, PropertyManager p_152723_1_) + { + final File file1 = func_152725_d(p_152723_1_); + final File file2 = new File(file1.getParentFile(), "playerdata"); + final File file3 = new File(file1.getParentFile(), "unknownplayers"); + + if (file1.exists() && file1.isDirectory()) + { + File[] afile = file1.listFiles(); + ArrayList arraylist = Lists.newArrayList(); + File[] afile1 = afile; + int i = afile.length; + + for (int j = 0; j < i; ++j) + { + File file4 = afile1[j]; + String s = file4.getName(); + + if (s.toLowerCase(Locale.ROOT).endsWith(".dat")) + { + String s1 = s.substring(0, s.length() - ".dat".length()); + + if (s1.length() > 0) + { + arraylist.add(s1); + } + } + } + + try + { + final String[] astring = (String[])arraylist.toArray(new String[arraylist.size()]); + ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback() + { + private static final String __OBFID = "CL_00001907"; + public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_) + { + server.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_); + UUID uuid = p_onProfileLookupSucceeded_1_.getId(); + + if (uuid == null) + { + throw new PreYggdrasilConverter.ConversionError("Missing UUID for user profile " + p_onProfileLookupSucceeded_1_.getName(), null); + } + else + { + this.func_152743_a(file2, this.func_152744_a(p_onProfileLookupSucceeded_1_), uuid.toString()); + } + } + public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_) + { + PreYggdrasilConverter.field_152732_e.warn("Could not lookup user uuid for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_); + + if (p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException) + { + String s2 = this.func_152744_a(p_onProfileLookupFailed_1_); + this.func_152743_a(file3, s2, s2); + } + else + { + throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null); + } + } + private void func_152743_a(File p_152743_1_, String p_152743_2_, String p_152743_3_) + { + File file7 = new File(file1, p_152743_2_ + ".dat"); + File file6 = new File(p_152743_1_, p_152743_3_ + ".dat"); + PreYggdrasilConverter.func_152711_b(p_152743_1_); + + if (!file7.renameTo(file6)) + { + throw new PreYggdrasilConverter.ConversionError("Could not convert file for " + p_152743_2_, null); + } + } + private String func_152744_a(GameProfile p_152744_1_) + { + String s2 = null; + + for (int k = 0; k < astring.length; ++k) + { + if (astring[k] != null && astring[k].equalsIgnoreCase(p_152744_1_.getName())) + { + s2 = astring[k]; + break; + } + } + + if (s2 == null) + { + throw new PreYggdrasilConverter.ConversionError("Could not find the filename for " + p_152744_1_.getName() + " anymore", null); + } + else + { + return s2; + } + } + }; + func_152717_a(server, Lists.newArrayList(astring), profilelookupcallback); + return true; + } + catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror) + { + field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror); + return false; + } + } + else + { + return true; + } + } + + @SideOnly(Side.SERVER) + private static void func_152711_b(File dir) + { + if (dir.exists()) + { + if (!dir.isDirectory()) + { + throw new PreYggdrasilConverter.ConversionError("Can\'t create directory " + dir.getName() + " in world save directory.", null); + } + } + else if (!dir.mkdirs()) + { + throw new PreYggdrasilConverter.ConversionError("Can\'t create directory " + dir.getName() + " in world save directory.", null); + } + } + + @SideOnly(Side.SERVER) + public static boolean func_152714_a(PropertyManager properties) + { + boolean flag = func_152712_b(properties); + flag = flag && func_152715_c(properties); + return flag; + } + + @SideOnly(Side.SERVER) + private static boolean func_152712_b(PropertyManager properties) + { + boolean flag = false; + + if (field_152729_b.exists() && field_152729_b.isFile()) + { + flag = true; + } + + boolean flag1 = false; + + if (field_152728_a.exists() && field_152728_a.isFile()) + { + flag1 = true; + } + + boolean flag2 = false; + + if (field_152730_c.exists() && field_152730_c.isFile()) + { + flag2 = true; + } + + boolean flag3 = false; + + if (field_152731_d.exists() && field_152731_d.isFile()) + { + flag3 = true; + } + + if (!flag && !flag1 && !flag2 && !flag3) + { + return true; + } + else + { + field_152732_e.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!"); + field_152732_e.warn("** please remove the following files and restart the server:"); + + if (flag) + { + field_152732_e.warn("* " + field_152729_b.getName()); + } + + if (flag1) + { + field_152732_e.warn("* " + field_152728_a.getName()); + } + + if (flag2) + { + field_152732_e.warn("* " + field_152730_c.getName()); + } + + if (flag3) + { + field_152732_e.warn("* " + field_152731_d.getName()); + } + + return false; + } + } + + @SideOnly(Side.SERVER) + private static boolean func_152715_c(PropertyManager properties) + { + File file1 = func_152725_d(properties); + + if (file1.exists() && file1.isDirectory()) + { + String[] astring = file1.list(new FilenameFilter() + { + private static final String __OBFID = "CL_00001906"; + public boolean accept(File p_accept_1_, String p_accept_2_) + { + return p_accept_2_.endsWith(".dat"); + } + }); + + if (astring.length > 0) + { + field_152732_e.warn("**** DETECTED OLD PLAYER FILES IN THE WORLD SAVE"); + field_152732_e.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY"); + field_152732_e.warn("** please restart the server and if the problem persists, remove the directory \'{}\'", new Object[] {file1.getPath()}); + return false; + } + } + + return true; + } + + @SideOnly(Side.SERVER) + private static File func_152725_d(PropertyManager properties) + { + String s = properties.getStringProperty("level-name", "world"); + File file1 = new File(s); + return new File(file1, "players"); + } + + @SideOnly(Side.SERVER) + private static void func_152727_c(File convertedFile) + { + File file2 = new File(convertedFile.getName() + ".converted"); + convertedFile.renameTo(file2); + } + + @SideOnly(Side.SERVER) + private static Date func_152713_b(String input, Date defaultValue) + { + Date date1; + + try + { + date1 = BanEntry.dateFormat.parse(input); + } + catch (ParseException parseexception) + { + date1 = defaultValue; + } + + return date1; + } + + @SideOnly(Side.SERVER) + static class ConversionError extends RuntimeException + { + private static final String __OBFID = "CL_00001905"; + + private ConversionError(String message, Throwable cause) + { + super(message, cause); + } + + private ConversionError(String message) + { + super(message); + } + + ConversionError(String p_i1208_1_, Object p_i1208_2_) + { + this(p_i1208_1_); + } + + ConversionError(String p_i1209_1_, Throwable p_i1209_2_, Object p_i1209_3_) + { + this(p_i1209_1_, p_i1209_2_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/ServerConfigurationManager.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/ServerConfigurationManager.java new file mode 100644 index 0000000..9f80ed7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/ServerConfigurationManager.java @@ -0,0 +1,1202 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.net.SocketAddress; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.Map.Entry; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S05PacketSpawnPosition; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S09PacketHeldItemChange; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S38PacketPlayerListItem; +import net.minecraft.network.play.server.S39PacketPlayerAbilities; +import net.minecraft.network.play.server.S3EPacketTeams; +import net.minecraft.network.play.server.S3FPacketCustomPayload; +import net.minecraft.potion.PotionEffect; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.scoreboard.Team; +import net.minecraft.server.MinecraftServer; +import net.minecraft.stats.StatList; +import net.minecraft.stats.StatisticsFile; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.world.Teleporter; +import net.minecraft.world.World; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.demo.DemoWorldManager; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.SaveHandler; +import net.minecraftforge.common.chunkio.ChunkIOExecutor; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public abstract class ServerConfigurationManager +{ + public static final File field_152613_a = new File("banned-players.json"); + public static final File field_152614_b = new File("banned-ips.json"); + public static final File field_152615_c = new File("ops.json"); + public static final File field_152616_d = new File("whitelist.json"); + private static final Logger logger = LogManager.getLogger(); + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); + /** Reference to the MinecraftServer object. */ + private final MinecraftServer mcServer; + /** A list of player entities that exist on this server. */ + public final List playerEntityList = new ArrayList(); + private final UserListBans bannedPlayers; + private final BanList bannedIPs; + /** A set containing the OPs. */ + private final UserListOps ops; + /** The Set of all whitelisted players. */ + private final UserListWhitelist whiteListedPlayers; + private final Map field_148547_k; + /** Reference to the PlayerNBTManager object. */ + private IPlayerFileData playerNBTManagerObj; + /** Server setting to only allow OPs and whitelisted players to join the server. */ + private boolean whiteListEnforced; + /** The maximum number of players that can be connected at a time. */ + protected int maxPlayers; + private int viewDistance; + private WorldSettings.GameType gameType; + /** True if all players are allowed to use commands (cheats). */ + private boolean commandsAllowedForAll; + /** index into playerEntities of player to ping, updated every tick; currently hardcoded to max at 200 players */ + private int playerPingIndex; + private static final String __OBFID = "CL_00001423"; + + public ServerConfigurationManager(MinecraftServer server) + { + this.bannedPlayers = new UserListBans(field_152613_a); + this.bannedIPs = new BanList(field_152614_b); + this.ops = new UserListOps(field_152615_c); + this.whiteListedPlayers = new UserListWhitelist(field_152616_d); + this.field_148547_k = Maps.newHashMap(); + this.mcServer = server; + this.bannedPlayers.func_152686_a(false); + this.bannedIPs.func_152686_a(false); + this.maxPlayers = 8; + } + + public void initializeConnectionToPlayer(NetworkManager netManager, EntityPlayerMP player, NetHandlerPlayServer nethandlerplayserver) + { + GameProfile gameprofile = player.getGameProfile(); + PlayerProfileCache playerprofilecache = this.mcServer.func_152358_ax(); + GameProfile gameprofile1 = playerprofilecache.func_152652_a(gameprofile.getId()); + String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); + playerprofilecache.func_152649_a(gameprofile); + NBTTagCompound nbttagcompound = this.readPlayerDataFromFile(player); + + World playerWorld = this.mcServer.worldServerForDimension(player.dimension); + if (playerWorld==null) + { + player.dimension=0; + playerWorld=this.mcServer.worldServerForDimension(0); + ChunkCoordinates spawnPoint = playerWorld.provider.getRandomizedSpawnPoint(); + player.setPosition(spawnPoint.posX, spawnPoint.posY, spawnPoint.posZ); + } + + player.setWorld(playerWorld); + player.theItemInWorldManager.setWorld((WorldServer)player.worldObj); + String s1 = "local"; + + if (netManager.getSocketAddress() != null) + { + s1 = netManager.getSocketAddress().toString(); + } + + logger.info(player.getCommandSenderName() + "[" + s1 + "] logged in with entity id " + player.getEntityId() + " at (" + player.posX + ", " + player.posY + ", " + player.posZ + ")"); + WorldServer worldserver = this.mcServer.worldServerForDimension(player.dimension); + ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint(); + this.func_72381_a(player, (EntityPlayerMP)null, worldserver); + player.playerNetServerHandler = nethandlerplayserver; + nethandlerplayserver.sendPacket(new S01PacketJoinGame(player.getEntityId(), player.theItemInWorldManager.getGameType(), worldserver.getWorldInfo().isHardcoreModeEnabled(), worldserver.provider.dimensionId, worldserver.difficultySetting, this.getMaxPlayers(), worldserver.getWorldInfo().getTerrainType())); + nethandlerplayserver.sendPacket(new S3FPacketCustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8))); + nethandlerplayserver.sendPacket(new S05PacketSpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ)); + nethandlerplayserver.sendPacket(new S39PacketPlayerAbilities(player.capabilities)); + nethandlerplayserver.sendPacket(new S09PacketHeldItemChange(player.inventory.currentItem)); + player.func_147099_x().func_150877_d(); + player.func_147099_x().func_150884_b(player); + this.func_96456_a((ServerScoreboard)worldserver.getScoreboard(), player); + this.mcServer.func_147132_au(); + ChatComponentTranslation chatcomponenttranslation; + + if (!player.getCommandSenderName().equalsIgnoreCase(s)) + { + chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined.renamed", new Object[] {player.func_145748_c_(), s}); + } + else + { + chatcomponenttranslation = new ChatComponentTranslation("multiplayer.player.joined", new Object[] {player.func_145748_c_()}); + } + + chatcomponenttranslation.getChatStyle().setColor(EnumChatFormatting.YELLOW); + this.sendChatMsg(chatcomponenttranslation); + this.playerLoggedIn(player); + nethandlerplayserver.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch); + this.updateTimeAndWeatherForPlayer(player, worldserver); + + if (this.mcServer.getTexturePack().length() > 0) + { + player.requestTexturePackLoad(this.mcServer.getTexturePack()); + } + + Iterator iterator = player.getActivePotionEffects().iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + nethandlerplayserver.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect)); + } + + player.addSelfToInternalCraftingInventory(); + + FMLCommonHandler.instance().firePlayerLoggedIn(player); + if (nbttagcompound != null && nbttagcompound.hasKey("Riding", 10)) + { + Entity entity = EntityList.createEntityFromNBT(nbttagcompound.getCompoundTag("Riding"), worldserver); + + if (entity != null) + { + entity.forceSpawn = true; + worldserver.spawnEntityInWorld(entity); + player.mountEntity(entity); + entity.forceSpawn = false; + } + } + } + + protected void func_96456_a(ServerScoreboard scoreboardIn, EntityPlayerMP player) + { + HashSet hashset = new HashSet(); + Iterator iterator = scoreboardIn.getTeams().iterator(); + + while (iterator.hasNext()) + { + ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)iterator.next(); + player.playerNetServerHandler.sendPacket(new S3EPacketTeams(scoreplayerteam, 0)); + } + + for (int i = 0; i < 3; ++i) + { + ScoreObjective scoreobjective = scoreboardIn.func_96539_a(i); + + if (scoreobjective != null && !hashset.contains(scoreobjective)) + { + List list = scoreboardIn.func_96550_d(scoreobjective); + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + Packet packet = (Packet)iterator1.next(); + player.playerNetServerHandler.sendPacket(packet); + } + + hashset.add(scoreobjective); + } + } + } + + /** + * Sets the NBT manager to the one for the WorldServer given. + */ + public void setPlayerManager(WorldServer[] p_72364_1_) + { + this.playerNBTManagerObj = p_72364_1_[0].getSaveHandler().getSaveHandler(); + } + + public void func_72375_a(EntityPlayerMP player, WorldServer worldIn) + { + WorldServer worldserver1 = player.getServerForPlayer(); + + if (worldIn != null) + { + worldIn.getPlayerManager().removePlayer(player); + } + + worldserver1.getPlayerManager().addPlayer(player); + worldserver1.theChunkProviderServer.loadChunk((int)player.posX >> 4, (int)player.posZ >> 4); + } + + public int getEntityViewDistance() + { + return PlayerManager.getFurthestViewableBlock(this.getViewDistance()); + } + + /** + * called during player login. reads the player information from disk. + */ + public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP player) + { + NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); + NBTTagCompound nbttagcompound1; + + if (player.getCommandSenderName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) + { + player.readFromNBT(nbttagcompound); + nbttagcompound1 = nbttagcompound; + logger.debug("loading single player"); + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(player, this.playerNBTManagerObj, player.getUniqueID().toString()); + } + else + { + nbttagcompound1 = this.playerNBTManagerObj.readPlayerData(player); + } + + return nbttagcompound1; + } + + public NBTTagCompound getPlayerNBT(EntityPlayerMP player) + { + // Hacky method to allow loading the NBT for a player prior to login + NBTTagCompound nbttagcompound = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); + if (player.getCommandSenderName().equals(this.mcServer.getServerOwner()) && nbttagcompound != null) + { + return nbttagcompound; + } + else + { + return ((SaveHandler)this.playerNBTManagerObj).getPlayerNBT(player); + } + } + /** + * also stores the NBTTags if this is an intergratedPlayerList + */ + protected void writePlayerData(EntityPlayerMP player) + { + if (player.playerNetServerHandler == null) return; + + this.playerNBTManagerObj.writePlayerData(player); + StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(player.getUniqueID()); + + if (statisticsfile != null) + { + statisticsfile.func_150883_b(); + } + } + + /** + * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world. + */ + public void playerLoggedIn(EntityPlayerMP player) + { + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(player.getCommandSenderName(), true, 1000)); + this.playerEntityList.add(player); + WorldServer worldserver = this.mcServer.worldServerForDimension(player.dimension); + ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); + worldserver.spawnEntityInWorld(player); + this.func_72375_a(player, (WorldServer)null); + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + EntityPlayerMP entityplayermp1 = (EntityPlayerMP)this.playerEntityList.get(i); + player.playerNetServerHandler.sendPacket(new S38PacketPlayerListItem(entityplayermp1.getCommandSenderName(), true, entityplayermp1.ping)); + } + } + + /** + * Update which chunks the player needs info on. + */ + public void updatePlayerPertinentChunks(EntityPlayerMP player) + { + player.getServerForPlayer().getPlayerManager().updatePlayerPertinentChunks(player); + } + + /** + * Called when a player disconnects from the game. Writes player data to disk and removes them from the world. + */ + public void playerLoggedOut(EntityPlayerMP player) + { + FMLCommonHandler.instance().firePlayerLoggedOut(player); + player.triggerAchievement(StatList.leaveGameStat); + this.writePlayerData(player); + WorldServer worldserver = player.getServerForPlayer(); + + if (player.ridingEntity != null) + { + worldserver.removePlayerEntityDangerously(player.ridingEntity); + logger.debug("removing player mount"); + } + + worldserver.removeEntity(player); + worldserver.getPlayerManager().removePlayer(player); + this.playerEntityList.remove(player); + this.field_148547_k.remove(player.getUniqueID()); + net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.getCurrentPlayerCount()); + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(player.getCommandSenderName(), false, 9999)); + } + + /** + * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message + */ + public String allowUserToConnect(SocketAddress address, GameProfile profile) + { + String s; + + if (this.bannedPlayers.func_152702_a(profile)) + { + UserListBansEntry userlistbansentry = (UserListBansEntry)this.bannedPlayers.func_152683_b(profile); + s = "You are banned from this server!\nReason: " + userlistbansentry.getBanReason(); + + if (userlistbansentry.getBanEndDate() != null) + { + s = s + "\nYour ban will be removed on " + dateFormat.format(userlistbansentry.getBanEndDate()); + } + + return s; + } + else if (!this.func_152607_e(profile)) + { + return "You are not white-listed on this server!"; + } + else if (this.bannedIPs.func_152708_a(address)) + { + IPBanEntry ipbanentry = this.bannedIPs.func_152709_b(address); + s = "Your IP address is banned from this server!\nReason: " + ipbanentry.getBanReason(); + + if (ipbanentry.getBanEndDate() != null) + { + s = s + "\nYour ban will be removed on " + dateFormat.format(ipbanentry.getBanEndDate()); + } + + return s; + } + else + { + return this.playerEntityList.size() >= this.maxPlayers ? "The server is full!" : null; + } + } + + /** + * also checks for multiple logins across servers + */ + public EntityPlayerMP createPlayerForUser(GameProfile profile) + { + UUID uuid = EntityPlayer.func_146094_a(profile); + ArrayList arraylist = Lists.newArrayList(); + EntityPlayerMP entityplayermp; + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i); + + if (entityplayermp.getUniqueID().equals(uuid)) + { + arraylist.add(entityplayermp); + } + } + + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + entityplayermp = (EntityPlayerMP)iterator.next(); + entityplayermp.playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); + } + + Object object; + + if (this.mcServer.isDemo()) + { + object = new DemoWorldManager(this.mcServer.worldServerForDimension(0)); + } + else + { + object = new ItemInWorldManager(this.mcServer.worldServerForDimension(0)); + } + + return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), profile, (ItemInWorldManager)object); + } + + /** + * creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to + * respawn, an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player + * beat the game rather than dying + */ + public EntityPlayerMP respawnPlayer(EntityPlayerMP player, int dimension, boolean conqueredEnd) + { + World world = mcServer.worldServerForDimension(dimension); + if (world == null) + { + dimension = 0; + } + else if (!world.provider.canRespawnHere()) + { + dimension = world.provider.getRespawnDimension(player); + } + + player.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(player); + player.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(player); + player.getServerForPlayer().getPlayerManager().removePlayer(player); + this.playerEntityList.remove(player); + this.mcServer.worldServerForDimension(player.dimension).removePlayerEntityDangerously(player); + ChunkCoordinates chunkcoordinates = player.getBedLocation(dimension); + boolean flag1 = player.isSpawnForced(dimension); + player.dimension = dimension; + Object object; + + if (this.mcServer.isDemo()) + { + object = new DemoWorldManager(this.mcServer.worldServerForDimension(player.dimension)); + } + else + { + object = new ItemInWorldManager(this.mcServer.worldServerForDimension(player.dimension)); + } + + EntityPlayerMP entityplayermp1 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(player.dimension), player.getGameProfile(), (ItemInWorldManager)object); + entityplayermp1.playerNetServerHandler = player.playerNetServerHandler; + entityplayermp1.clonePlayer(player, conqueredEnd); + entityplayermp1.dimension = dimension; + entityplayermp1.setEntityId(player.getEntityId()); + WorldServer worldserver = this.mcServer.worldServerForDimension(player.dimension); + this.func_72381_a(entityplayermp1, player, worldserver); + ChunkCoordinates chunkcoordinates1; + + if (chunkcoordinates != null) + { + chunkcoordinates1 = EntityPlayer.verifyRespawnCoordinates(this.mcServer.worldServerForDimension(player.dimension), chunkcoordinates, flag1); + + if (chunkcoordinates1 != null) + { + entityplayermp1.setLocationAndAngles((double)((float)chunkcoordinates1.posX + 0.5F), (double)((float)chunkcoordinates1.posY + 0.1F), (double)((float)chunkcoordinates1.posZ + 0.5F), 0.0F, 0.0F); + entityplayermp1.setSpawnChunk(chunkcoordinates, flag1); + } + else + { + entityplayermp1.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(0, 0.0F)); + } + } + + worldserver.theChunkProviderServer.loadChunk((int)entityplayermp1.posX >> 4, (int)entityplayermp1.posZ >> 4); + + while (!worldserver.getCollidingBoundingBoxes(entityplayermp1, entityplayermp1.boundingBox).isEmpty()) + { + entityplayermp1.setPosition(entityplayermp1.posX, entityplayermp1.posY + 1.0D, entityplayermp1.posZ); + } + + entityplayermp1.playerNetServerHandler.sendPacket(new S07PacketRespawn(entityplayermp1.dimension, entityplayermp1.worldObj.difficultySetting, entityplayermp1.worldObj.getWorldInfo().getTerrainType(), entityplayermp1.theItemInWorldManager.getGameType())); + chunkcoordinates1 = worldserver.getSpawnPoint(); + entityplayermp1.playerNetServerHandler.setPlayerLocation(entityplayermp1.posX, entityplayermp1.posY, entityplayermp1.posZ, entityplayermp1.rotationYaw, entityplayermp1.rotationPitch); + entityplayermp1.playerNetServerHandler.sendPacket(new S05PacketSpawnPosition(chunkcoordinates1.posX, chunkcoordinates1.posY, chunkcoordinates1.posZ)); + entityplayermp1.playerNetServerHandler.sendPacket(new S1FPacketSetExperience(entityplayermp1.experience, entityplayermp1.experienceTotal, entityplayermp1.experienceLevel)); + this.updateTimeAndWeatherForPlayer(entityplayermp1, worldserver); + worldserver.getPlayerManager().addPlayer(entityplayermp1); + worldserver.spawnEntityInWorld(entityplayermp1); + this.playerEntityList.add(entityplayermp1); + entityplayermp1.addSelfToInternalCraftingInventory(); + entityplayermp1.setHealth(entityplayermp1.getHealth()); + FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1); + return entityplayermp1; + } + + public void transferPlayerToDimension(EntityPlayerMP player, int dimension) + { + transferPlayerToDimension(player, dimension, mcServer.worldServerForDimension(dimension).getDefaultTeleporter()); + } + + public void transferPlayerToDimension(EntityPlayerMP player, int dimension, Teleporter teleporter) + { + int j = player.dimension; + WorldServer worldserver = this.mcServer.worldServerForDimension(player.dimension); + player.dimension = dimension; + WorldServer worldserver1 = this.mcServer.worldServerForDimension(player.dimension); + player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, worldserver1.difficultySetting, worldserver1.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType())); // Forge: Use new dimensions information + worldserver.removePlayerEntityDangerously(player); + player.isDead = false; + this.transferEntityToWorld(player, j, worldserver, worldserver1, teleporter); + this.func_72375_a(player, worldserver); + player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch); + player.theItemInWorldManager.setWorld(worldserver1); + this.updateTimeAndWeatherForPlayer(player, worldserver1); + this.syncPlayerInventory(player); + Iterator iterator = player.getActivePotionEffects().iterator(); + + while (iterator.hasNext()) + { + PotionEffect potioneffect = (PotionEffect)iterator.next(); + player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect)); + } + FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, j, dimension); + } + + /** + * Transfers an entity from a world to another world. + */ + public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) + { + transferEntityToWorld(entityIn, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.getDefaultTeleporter()); + } + + public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter) + { + WorldProvider pOld = p_82448_3_.provider; + WorldProvider pNew = p_82448_4_.provider; + double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); + double d0 = entityIn.posX * moveFactor; + double d1 = entityIn.posZ * moveFactor; + double d3 = entityIn.posX; + double d4 = entityIn.posY; + double d5 = entityIn.posZ; + float f = entityIn.rotationYaw; + p_82448_3_.theProfiler.startSection("moving"); + + /* + if (par1Entity.dimension == -1) + { + d0 /= d2; + d1 /= d2; + par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + + if (par1Entity.isEntityAlive()) + { + par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + } + } + else if (par1Entity.dimension == 0) + { + d0 *= d2; + d1 *= d2; + par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + + if (par1Entity.isEntityAlive()) + { + par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + } + } + */ + if (entityIn.dimension == 1) + { + ChunkCoordinates chunkcoordinates; + + if (p_82448_2_ == 1) + { + chunkcoordinates = p_82448_4_.getSpawnPoint(); + } + else + { + chunkcoordinates = p_82448_4_.getEntrancePortalLocation(); + } + + d0 = (double)chunkcoordinates.posX; + entityIn.posY = (double)chunkcoordinates.posY; + d1 = (double)chunkcoordinates.posZ; + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, 90.0F, 0.0F); + + if (entityIn.isEntityAlive()) + { + p_82448_3_.updateEntityWithOptionalForce(entityIn, false); + } + } + + p_82448_3_.theProfiler.endSection(); + + if (p_82448_2_ != 1) + { + p_82448_3_.theProfiler.startSection("placing"); + d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872); + d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872); + + if (entityIn.isEntityAlive()) + { + entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch); + teleporter.placeInPortal(entityIn, d3, d4, d5, f); + p_82448_4_.spawnEntityInWorld(entityIn); + p_82448_4_.updateEntityWithOptionalForce(entityIn, false); + } + + p_82448_3_.theProfiler.endSection(); + } + + entityIn.setWorld(p_82448_4_); + } + + /** + * sends 1 player per tick, but only sends a player once every 600 ticks + */ + public void sendPlayerInfoToAllPlayers() + { + if (++this.playerPingIndex > 600) + { + this.playerPingIndex = 0; + } + + if (this.playerPingIndex < this.playerEntityList.size()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(this.playerPingIndex); + this.sendPacketToAllPlayers(new S38PacketPlayerListItem(entityplayermp.getCommandSenderName(), true, entityplayermp.ping)); + } + } + + public void sendPacketToAllPlayers(Packet packetIn) + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + ((EntityPlayerMP)this.playerEntityList.get(i)).playerNetServerHandler.sendPacket(packetIn); + } + } + + /** + * Sends a packet to all players in the specified Dimension + */ + public void sendPacketToAllPlayersInDimension(Packet packetIn, int dimension) + { + for (int j = 0; j < this.playerEntityList.size(); ++j) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j); + + if (entityplayermp.dimension == dimension) + { + entityplayermp.playerNetServerHandler.sendPacket(packetIn); + } + } + } + + public String func_152609_b(boolean includeUuid) + { + String s = ""; + ArrayList arraylist = Lists.newArrayList(this.playerEntityList); + + for (int i = 0; i < arraylist.size(); ++i) + { + if (i > 0) + { + s = s + ", "; + } + + s = s + ((EntityPlayerMP)arraylist.get(i)).getCommandSenderName(); + + if (includeUuid) + { + s = s + " (" + ((EntityPlayerMP)arraylist.get(i)).getUniqueID().toString() + ")"; + } + } + + return s; + } + + /** + * Returns an array of the usernames of all the connected players. + */ + public String[] getAllUsernames() + { + String[] astring = new String[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + astring[i] = ((EntityPlayerMP)this.playerEntityList.get(i)).getCommandSenderName(); + } + + return astring; + } + + public GameProfile[] func_152600_g() + { + GameProfile[] agameprofile = new GameProfile[this.playerEntityList.size()]; + + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + agameprofile[i] = ((EntityPlayerMP)this.playerEntityList.get(i)).getGameProfile(); + } + + return agameprofile; + } + + public UserListBans func_152608_h() + { + return this.bannedPlayers; + } + + public BanList getBannedIPs() + { + return this.bannedIPs; + } + + public void func_152605_a(GameProfile profile) + { + this.ops.func_152687_a(new UserListOpsEntry(profile, this.mcServer.getOpPermissionLevel())); + } + + public void func_152610_b(GameProfile profile) + { + this.ops.func_152684_c(profile); + } + + public boolean func_152607_e(GameProfile profile) + { + return !this.whiteListEnforced || this.ops.func_152692_d(profile) || this.whiteListedPlayers.func_152692_d(profile); + } + + public boolean func_152596_g(GameProfile profile) + { + return this.ops.func_152692_d(profile) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(profile.getName()) || this.commandsAllowedForAll; + } + + public EntityPlayerMP func_152612_a(String username) + { + Iterator iterator = this.playerEntityList.iterator(); + EntityPlayerMP entityplayermp; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + entityplayermp = (EntityPlayerMP)iterator.next(); + } + while (!entityplayermp.getCommandSenderName().equalsIgnoreCase(username)); + + return entityplayermp; + } + + /** + * Find all players in a specified range and narrowing down by other parameters + */ + public List findPlayers(ChunkCoordinates coordinates, int minRadius, int maxRadius, int maxAmount, int gameMode, int minXp, int maxXp, Map scoreboardData, String username, String teamName, World worldIn) + { + if (this.playerEntityList.isEmpty()) + { + return Collections.emptyList(); + } + else + { + Object object = new ArrayList(); + boolean flag = maxAmount < 0; + boolean flag1 = username != null && username.startsWith("!"); + boolean flag2 = teamName != null && teamName.startsWith("!"); + int k1 = minRadius * minRadius; + int l1 = maxRadius * maxRadius; + maxAmount = MathHelper.abs_int(maxAmount); + + if (flag1) + { + username = username.substring(1); + } + + if (flag2) + { + teamName = teamName.substring(1); + } + + for (int i2 = 0; i2 < this.playerEntityList.size(); ++i2) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(i2); + + if ((worldIn == null || entityplayermp.worldObj == worldIn) && (username == null || flag1 != username.equalsIgnoreCase(entityplayermp.getCommandSenderName()))) + { + if (teamName != null) + { + Team team = entityplayermp.getTeam(); + String s2 = team == null ? "" : team.getRegisteredName(); + + if (flag2 == teamName.equalsIgnoreCase(s2)) + { + continue; + } + } + + if (coordinates != null && (minRadius > 0 || maxRadius > 0)) + { + float f = coordinates.getDistanceSquaredToChunkCoordinates(entityplayermp.getPlayerCoordinates()); + + if (minRadius > 0 && f < (float)k1 || maxRadius > 0 && f > (float)l1) + { + continue; + } + } + + if (this.func_96457_a(entityplayermp, scoreboardData) && (gameMode == WorldSettings.GameType.NOT_SET.getID() || gameMode == entityplayermp.theItemInWorldManager.getGameType().getID()) && (minXp <= 0 || entityplayermp.experienceLevel >= minXp) && entityplayermp.experienceLevel <= maxXp) + { + ((List)object).add(entityplayermp); + } + } + } + + if (coordinates != null) + { + Collections.sort((List)object, new PlayerPositionComparator(coordinates)); + } + + if (flag) + { + Collections.reverse((List)object); + } + + if (maxAmount > 0) + { + object = ((List)object).subList(0, Math.min(maxAmount, ((List)object).size())); + } + + return (List)object; + } + } + + private boolean func_96457_a(EntityPlayer player, Map scoreboardCriteria) + { + if (scoreboardCriteria != null && scoreboardCriteria.size() != 0) + { + Iterator iterator = scoreboardCriteria.entrySet().iterator(); + Entry entry; + boolean flag; + int i; + + do + { + if (!iterator.hasNext()) + { + return true; + } + + entry = (Entry)iterator.next(); + String s = (String)entry.getKey(); + flag = false; + + if (s.endsWith("_min") && s.length() > 4) + { + flag = true; + s = s.substring(0, s.length() - 4); + } + + Scoreboard scoreboard = player.getWorldScoreboard(); + ScoreObjective scoreobjective = scoreboard.getObjective(s); + + if (scoreobjective == null) + { + return false; + } + + Score score = player.getWorldScoreboard().func_96529_a(player.getCommandSenderName(), scoreobjective); + i = score.getScorePoints(); + + if (i < ((Integer)entry.getValue()).intValue() && flag) + { + return false; + } + } + while (i <= ((Integer)entry.getValue()).intValue() || flag); + + return false; + } + else + { + return true; + } + } + + /** + * params: x,y,z,r,dimension. The packet is sent to all players within r radius of x,y,z (r^2>x^2+y^2+z^2) + */ + public void sendToAllNear(double x, double y, double z, double radius, int dimension, Packet packetIn) + { + this.sendToAllNearExcept((EntityPlayer)null, x, y, z, radius, dimension, packetIn); + } + + /** + * params: srcPlayer,x,y,z,r,dimension. The packet is not sent to the srcPlayer, but all other players within the + * search radius + */ + public void sendToAllNearExcept(EntityPlayer p_148543_1_, double x, double y, double z, double radius, int dimension, Packet p_148543_11_) + { + for (int j = 0; j < this.playerEntityList.size(); ++j) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j); + + if (entityplayermp != p_148543_1_ && entityplayermp.dimension == dimension) + { + double d4 = x - entityplayermp.posX; + double d5 = y - entityplayermp.posY; + double d6 = z - entityplayermp.posZ; + + if (d4 * d4 + d5 * d5 + d6 * d6 < radius * radius) + { + entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_); + } + } + } + } + + /** + * Saves all of the players' current states. + */ + public void saveAllPlayerData() + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + this.writePlayerData((EntityPlayerMP)this.playerEntityList.get(i)); + } + } + + public void func_152601_d(GameProfile profile) + { + this.whiteListedPlayers.func_152687_a(new UserListWhitelistEntry(profile)); + } + + public void func_152597_c(GameProfile profile) + { + this.whiteListedPlayers.func_152684_c(profile); + } + + public UserListWhitelist func_152599_k() + { + return this.whiteListedPlayers; + } + + public String[] func_152598_l() + { + return this.whiteListedPlayers.func_152685_a(); + } + + public UserListOps func_152603_m() + { + return this.ops; + } + + public String[] func_152606_n() + { + return this.ops.func_152685_a(); + } + + /** + * Either does nothing, or calls readWhiteList. + */ + public void loadWhiteList() {} + + /** + * Updates the time and weather for the given player to those of the given world + */ + public void updateTimeAndWeatherForPlayer(EntityPlayerMP player, WorldServer worldIn) + { + player.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); + + if (worldIn.isRaining()) + { + player.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); + player.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, worldIn.getRainStrength(1.0F))); + player.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, worldIn.getWeightedThunderStrength(1.0F))); + } + } + + /** + * sends the players inventory to himself + */ + public void syncPlayerInventory(EntityPlayerMP player) + { + player.sendContainerToPlayer(player.inventoryContainer); + player.setPlayerHealthUpdated(); + player.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(player.inventory.currentItem)); + } + + /** + * Returns the number of players currently on the server. + */ + public int getCurrentPlayerCount() + { + return this.playerEntityList.size(); + } + + /** + * Returns the maximum number of players allowed on the server. + */ + public int getMaxPlayers() + { + return this.maxPlayers; + } + + /** + * Returns an array of usernames for which player.dat exists for. + */ + public String[] getAvailablePlayerDat() + { + return this.mcServer.worldServers[0].getSaveHandler().getSaveHandler().getAvailablePlayerDat(); + } + + public void setWhiteListEnabled(boolean whitelistEnabled) + { + this.whiteListEnforced = whitelistEnabled; + } + + public List getPlayerList(String address) + { + ArrayList arraylist = new ArrayList(); + Iterator iterator = this.playerEntityList.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + + if (entityplayermp.getPlayerIP().equals(address)) + { + arraylist.add(entityplayermp); + } + } + + return arraylist; + } + + /** + * Gets the View Distance. + */ + public int getViewDistance() + { + return this.viewDistance; + } + + public MinecraftServer getServerInstance() + { + return this.mcServer; + } + + /** + * On integrated servers, returns the host's player data to be written to level.dat. + */ + public NBTTagCompound getHostPlayerData() + { + return null; + } + + @SideOnly(Side.CLIENT) + public void func_152604_a(WorldSettings.GameType p_152604_1_) + { + this.gameType = p_152604_1_; + } + + private void func_72381_a(EntityPlayerMP p_72381_1_, EntityPlayerMP p_72381_2_, World p_72381_3_) + { + if (p_72381_2_ != null) + { + p_72381_1_.theItemInWorldManager.setGameType(p_72381_2_.theItemInWorldManager.getGameType()); + } + else if (this.gameType != null) + { + p_72381_1_.theItemInWorldManager.setGameType(this.gameType); + } + + p_72381_1_.theItemInWorldManager.initializeGameType(p_72381_3_.getWorldInfo().getGameType()); + } + + /** + * Sets whether all players are allowed to use commands (cheats) on the server. + */ + @SideOnly(Side.CLIENT) + public void setCommandsAllowedForAll(boolean p_72387_1_) + { + this.commandsAllowedForAll = p_72387_1_; + } + + /** + * Kicks everyone with "Server closed" as reason. + */ + public void removeAllPlayers() + { + for (int i = 0; i < this.playerEntityList.size(); ++i) + { + ((EntityPlayerMP)this.playerEntityList.get(i)).playerNetServerHandler.kickPlayerFromServer("Server closed"); + } + } + + public void sendChatMsgImpl(IChatComponent component, boolean isChat) + { + this.mcServer.addChatMessage(component); + this.sendPacketToAllPlayers(new S02PacketChat(component, isChat)); + } + + /** + * Sends the given string to every player as chat message. + */ + public void sendChatMsg(IChatComponent component) + { + this.sendChatMsgImpl(component, true); + } + + public StatisticsFile func_152602_a(EntityPlayer player) + { + UUID uuid = player.getUniqueID(); + StatisticsFile statisticsfile = uuid == null ? null : (StatisticsFile)this.field_148547_k.get(uuid); + + if (statisticsfile == null) + { + File file1 = new File(this.mcServer.worldServerForDimension(0).getSaveHandler().getWorldDirectory(), "stats"); + File file2 = new File(file1, uuid.toString() + ".json"); + + if (!file2.exists()) + { + File file3 = new File(file1, player.getCommandSenderName() + ".json"); + + if (file3.exists() && file3.isFile()) + { + file3.renameTo(file2); + } + } + + statisticsfile = new StatisticsFile(this.mcServer, file2); + statisticsfile.func_150882_a(); + this.field_148547_k.put(uuid, statisticsfile); + } + + return statisticsfile; + } + + public void func_152611_a(int distance) + { + this.viewDistance = distance; + + if (this.mcServer.worldServers != null) + { + WorldServer[] aworldserver = this.mcServer.worldServers; + int j = aworldserver.length; + + for (int k = 0; k < j; ++k) + { + WorldServer worldserver = aworldserver[k]; + + if (worldserver != null) + { + worldserver.getPlayerManager().func_152622_a(distance); + } + } + } + } + + @SideOnly(Side.SERVER) + public boolean isWhiteListEnabled() + { + return this.whiteListEnforced; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserList.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserList.java new file mode 100644 index 0000000..f9ed854 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserList.java @@ -0,0 +1,262 @@ +package net.minecraft.server.management; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.IOUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class UserList +{ + protected static final Logger field_152693_a = LogManager.getLogger(); + protected final Gson field_152694_b; + private final File field_152695_c; + private final Map field_152696_d = Maps.newHashMap(); + private boolean field_152697_e = true; + private static final ParameterizedType field_152698_f = new ParameterizedType() + { + private static final String __OBFID = "CL_00001875"; + public Type[] getActualTypeArguments() + { + return new Type[] {UserListEntry.class}; + } + public Type getRawType() + { + return List.class; + } + public Type getOwnerType() + { + return null; + } + }; + private static final String __OBFID = "CL_00001876"; + + public UserList(File saveFile) + { + this.field_152695_c = saveFile; + GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting(); + gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer(null)); + this.field_152694_b = gsonbuilder.create(); + } + + public boolean func_152689_b() + { + return this.field_152697_e; + } + + public void func_152686_a(boolean state) + { + this.field_152697_e = state; + } + + public void func_152687_a(UserListEntry entry) + { + this.field_152696_d.put(this.func_152681_a(entry.func_152640_f()), entry); + + try + { + this.func_152678_f(); + } + catch (IOException ioexception) + { + field_152693_a.warn("Could not save the list after adding a user.", ioexception); + } + } + + public UserListEntry func_152683_b(Object obj) + { + this.func_152680_h(); + return (UserListEntry)this.field_152696_d.get(this.func_152681_a(obj)); + } + + public void func_152684_c(Object p_152684_1_) + { + this.field_152696_d.remove(this.func_152681_a(p_152684_1_)); + + try + { + this.func_152678_f(); + } + catch (IOException ioexception) + { + field_152693_a.warn("Could not save the list after removing a user.", ioexception); + } + } + + @SideOnly(Side.SERVER) + public File func_152691_c() + { + return this.field_152695_c; + } + + public String[] func_152685_a() + { + return (String[])this.field_152696_d.keySet().toArray(new String[this.field_152696_d.size()]); + } + + protected String func_152681_a(Object obj) + { + return obj.toString(); + } + + protected boolean func_152692_d(Object entry) + { + return this.field_152696_d.containsKey(this.func_152681_a(entry)); + } + + private void func_152680_h() + { + ArrayList arraylist = Lists.newArrayList(); + Iterator iterator = this.field_152696_d.values().iterator(); + + while (iterator.hasNext()) + { + UserListEntry userlistentry = (UserListEntry)iterator.next(); + + if (userlistentry.hasBanExpired()) + { + arraylist.add(userlistentry.func_152640_f()); + } + } + + iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + Object object = iterator.next(); + this.field_152696_d.remove(object); + } + } + + protected UserListEntry func_152682_a(JsonObject entryData) + { + return new UserListEntry((Object)null, entryData); + } + + protected Map func_152688_e() + { + return this.field_152696_d; + } + + public void func_152678_f() throws IOException + { + Collection collection = this.field_152696_d.values(); + String s = this.field_152694_b.toJson(collection); + BufferedWriter bufferedwriter = null; + + try + { + bufferedwriter = Files.newWriter(this.field_152695_c, Charsets.UTF_8); + bufferedwriter.write(s); + } + finally + { + IOUtils.closeQuietly(bufferedwriter); + } + } + + @SideOnly(Side.SERVER) + public boolean func_152690_d() + { + return this.field_152696_d.size() < 1; + } + + @SideOnly(Side.SERVER) + public void func_152679_g() throws IOException + { + Collection collection = null; + BufferedReader bufferedreader = null; + + try + { + bufferedreader = Files.newReader(this.field_152695_c, Charsets.UTF_8); + collection = (Collection)this.field_152694_b.fromJson(bufferedreader, field_152698_f); + } + finally + { + IOUtils.closeQuietly(bufferedreader); + } + + if (collection != null) + { + this.field_152696_d.clear(); + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) + { + UserListEntry userlistentry = (UserListEntry)iterator.next(); + + if (userlistentry.func_152640_f() != null) + { + this.field_152696_d.put(this.func_152681_a(userlistentry.func_152640_f()), userlistentry); + } + } + } + } + + class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001874"; + + private Serializer() {} + + public JsonElement func_152751_a(UserListEntry p_152751_1_, Type p_152751_2_, JsonSerializationContext p_152751_3_) + { + JsonObject jsonobject = new JsonObject(); + p_152751_1_.func_152641_a(jsonobject); + return jsonobject; + } + + public UserListEntry func_152750_a(JsonElement p_152750_1_, Type p_152750_2_, JsonDeserializationContext p_152750_3_) + { + if (p_152750_1_.isJsonObject()) + { + JsonObject jsonobject = p_152750_1_.getAsJsonObject(); + UserListEntry userlistentry = UserList.this.func_152682_a(jsonobject); + return userlistentry; + } + else + { + return null; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.func_152751_a((UserListEntry)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + public Object deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + return this.func_152750_a(p_deserialize_1_, p_deserialize_2_, p_deserialize_3_); + } + + Serializer(Object p_i1141_2_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBans.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBans.java new file mode 100644 index 0000000..330a80e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBans.java @@ -0,0 +1,69 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Iterator; + +public class UserListBans extends UserList +{ + private static final String __OBFID = "CL_00001873"; + + public UserListBans(File bansFile) + { + super(bansFile); + } + + protected UserListEntry func_152682_a(JsonObject entryData) + { + return new UserListBansEntry(entryData); + } + + public boolean func_152702_a(GameProfile profile) + { + return this.func_152692_d(profile); + } + + public String[] func_152685_a() + { + String[] astring = new String[this.func_152688_e().size()]; + int i = 0; + UserListBansEntry userlistbansentry; + + for (Iterator iterator = this.func_152688_e().values().iterator(); iterator.hasNext(); astring[i++] = ((GameProfile)userlistbansentry.func_152640_f()).getName()) + { + userlistbansentry = (UserListBansEntry)iterator.next(); + } + + return astring; + } + + protected String func_152701_b(GameProfile profile) + { + return profile.getId().toString(); + } + + public GameProfile func_152703_a(String username) + { + Iterator iterator = this.func_152688_e().values().iterator(); + UserListBansEntry userlistbansentry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + userlistbansentry = (UserListBansEntry)iterator.next(); + } + while (!username.equalsIgnoreCase(((GameProfile)userlistbansentry.func_152640_f()).getName())); + + return (GameProfile)userlistbansentry.func_152640_f(); + } + + protected String func_152681_a(Object obj) + { + return this.func_152701_b((GameProfile)obj); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBansEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBansEntry.java new file mode 100644 index 0000000..75e866d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListBansEntry.java @@ -0,0 +1,60 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.Date; +import java.util.UUID; + +public class UserListBansEntry extends BanEntry +{ + private static final String __OBFID = "CL_00001872"; + + public UserListBansEntry(GameProfile p_i1134_1_) + { + this(p_i1134_1_, (Date)null, (String)null, (Date)null, (String)null); + } + + public UserListBansEntry(GameProfile p_i1135_1_, Date p_i1135_2_, String p_i1135_3_, Date p_i1135_4_, String p_i1135_5_) + { + super(p_i1135_1_, p_i1135_4_, p_i1135_3_, p_i1135_4_, p_i1135_5_); + } + + public UserListBansEntry(JsonObject p_i1136_1_) + { + super(func_152648_b(p_i1136_1_), p_i1136_1_); + } + + protected void func_152641_a(JsonObject data) + { + if (this.func_152640_f() != null) + { + data.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + data.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(data); + } + } + + private static GameProfile func_152648_b(JsonObject p_152648_0_) + { + if (p_152648_0_.has("uuid") && p_152648_0_.has("name")) + { + String s = p_152648_0_.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable throwable) + { + return null; + } + + return new GameProfile(uuid, p_152648_0_.get("name").getAsString()); + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListEntry.java new file mode 100644 index 0000000..fb8b643 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListEntry.java @@ -0,0 +1,31 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; + +public class UserListEntry +{ + private final Object field_152642_a; + private static final String __OBFID = "CL_00001877"; + + public UserListEntry(Object p_i1146_1_) + { + this.field_152642_a = p_i1146_1_; + } + + protected UserListEntry(Object p_i1147_1_, JsonObject p_i1147_2_) + { + this.field_152642_a = p_i1147_1_; + } + + Object func_152640_f() + { + return this.field_152642_a; + } + + boolean hasBanExpired() + { + return false; + } + + protected void func_152641_a(JsonObject data) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOps.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOps.java new file mode 100644 index 0000000..0e5ebfc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOps.java @@ -0,0 +1,64 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.io.File; +import java.util.Iterator; + +public class UserListOps extends UserList +{ + private static final String __OBFID = "CL_00001879"; + + public UserListOps(File p_i1152_1_) + { + super(p_i1152_1_); + } + + protected UserListEntry func_152682_a(JsonObject entryData) + { + return new UserListOpsEntry(entryData); + } + + public String[] func_152685_a() + { + String[] astring = new String[this.func_152688_e().size()]; + int i = 0; + UserListOpsEntry userlistopsentry; + + for (Iterator iterator = this.func_152688_e().values().iterator(); iterator.hasNext(); astring[i++] = ((GameProfile)userlistopsentry.func_152640_f()).getName()) + { + userlistopsentry = (UserListOpsEntry)iterator.next(); + } + + return astring; + } + + protected String func_152699_b(GameProfile p_152699_1_) + { + return p_152699_1_.getId().toString(); + } + + public GameProfile func_152700_a(String p_152700_1_) + { + Iterator iterator = this.func_152688_e().values().iterator(); + UserListOpsEntry userlistopsentry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + userlistopsentry = (UserListOpsEntry)iterator.next(); + } + while (!p_152700_1_.equalsIgnoreCase(((GameProfile)userlistopsentry.func_152640_f()).getName())); + + return (GameProfile)userlistopsentry.func_152640_f(); + } + + protected String func_152681_a(Object obj) + { + return this.func_152699_b((GameProfile)obj); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOpsEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOpsEntry.java new file mode 100644 index 0000000..2ba8be7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListOpsEntry.java @@ -0,0 +1,63 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListOpsEntry extends UserListEntry +{ + private final int field_152645_a; + private static final String __OBFID = "CL_00001878"; + + public UserListOpsEntry(GameProfile p_i1149_1_, int p_i1149_2_) + { + super(p_i1149_1_); + this.field_152645_a = p_i1149_2_; + } + + public UserListOpsEntry(JsonObject p_i1150_1_) + { + super(func_152643_b(p_i1150_1_), p_i1150_1_); + this.field_152645_a = p_i1150_1_.has("level") ? p_i1150_1_.get("level").getAsInt() : 0; + } + + public int func_152644_a() + { + return this.field_152645_a; + } + + protected void func_152641_a(JsonObject data) + { + if (this.func_152640_f() != null) + { + data.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + data.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(data); + data.addProperty("level", Integer.valueOf(this.field_152645_a)); + } + } + + private static GameProfile func_152643_b(JsonObject p_152643_0_) + { + if (p_152643_0_.has("uuid") && p_152643_0_.has("name")) + { + String s = p_152643_0_.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable throwable) + { + return null; + } + + return new GameProfile(uuid, p_152643_0_.get("name").getAsString()); + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelist.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelist.java new file mode 100644 index 0000000..b8837ef --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelist.java @@ -0,0 +1,72 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.util.Iterator; + +public class UserListWhitelist extends UserList +{ + private static final String __OBFID = "CL_00001871"; + + public UserListWhitelist(File p_i1132_1_) + { + super(p_i1132_1_); + } + + protected UserListEntry func_152682_a(JsonObject entryData) + { + return new UserListWhitelistEntry(entryData); + } + + public String[] func_152685_a() + { + String[] astring = new String[this.func_152688_e().size()]; + int i = 0; + UserListWhitelistEntry userlistwhitelistentry; + + for (Iterator iterator = this.func_152688_e().values().iterator(); iterator.hasNext(); astring[i++] = ((GameProfile)userlistwhitelistentry.func_152640_f()).getName()) + { + userlistwhitelistentry = (UserListWhitelistEntry)iterator.next(); + } + + return astring; + } + + @SideOnly(Side.SERVER) + public boolean func_152705_a(GameProfile p_152705_1_) + { + return this.func_152692_d(p_152705_1_); + } + + protected String func_152704_b(GameProfile p_152704_1_) + { + return p_152704_1_.getId().toString(); + } + + public GameProfile func_152706_a(String p_152706_1_) + { + Iterator iterator = this.func_152688_e().values().iterator(); + UserListWhitelistEntry userlistwhitelistentry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + userlistwhitelistentry = (UserListWhitelistEntry)iterator.next(); + } + while (!p_152706_1_.equalsIgnoreCase(((GameProfile)userlistwhitelistentry.func_152640_f()).getName())); + + return (GameProfile)userlistwhitelistentry.func_152640_f(); + } + + protected String func_152681_a(Object obj) + { + return this.func_152704_b((GameProfile)obj); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelistEntry.java b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelistEntry.java new file mode 100644 index 0000000..71de049 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/management/UserListWhitelistEntry.java @@ -0,0 +1,54 @@ +package net.minecraft.server.management; + +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import java.util.UUID; + +public class UserListWhitelistEntry extends UserListEntry +{ + private static final String __OBFID = "CL_00001870"; + + public UserListWhitelistEntry(GameProfile p_i1129_1_) + { + super(p_i1129_1_); + } + + public UserListWhitelistEntry(JsonObject p_i1130_1_) + { + super(func_152646_b(p_i1130_1_), p_i1130_1_); + } + + protected void func_152641_a(JsonObject data) + { + if (this.func_152640_f() != null) + { + data.addProperty("uuid", ((GameProfile)this.func_152640_f()).getId() == null ? "" : ((GameProfile)this.func_152640_f()).getId().toString()); + data.addProperty("name", ((GameProfile)this.func_152640_f()).getName()); + super.func_152641_a(data); + } + } + + private static GameProfile func_152646_b(JsonObject p_152646_0_) + { + if (p_152646_0_.has("uuid") && p_152646_0_.has("name")) + { + String s = p_152646_0_.get("uuid").getAsString(); + UUID uuid; + + try + { + uuid = UUID.fromString(s); + } + catch (Throwable throwable) + { + return null; + } + + return new GameProfile(uuid, p_152646_0_.get("name").getAsString()); + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java new file mode 100644 index 0000000..f26752b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerHandshakeTCP.java @@ -0,0 +1,123 @@ +package net.minecraft.server.network; + +import cpw.mods.fml.common.FMLCommonHandler; +import io.netty.util.concurrent.GenericFutureListener; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.handshake.INetHandlerHandshakeServer; +import net.minecraft.network.handshake.client.C00Handshake; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; + +public class NetHandlerHandshakeTCP implements INetHandlerHandshakeServer +{ + private final MinecraftServer field_147387_a; + private final NetworkManager field_147386_b; + private static final String __OBFID = "CL_00001456"; + + public NetHandlerHandshakeTCP(MinecraftServer serverIn, NetworkManager netManager) + { + this.field_147387_a = serverIn; + this.field_147386_b = netManager; + } + + /** + * There are two recognized intentions for initiating a handshake: logging in and acquiring server status. The + * NetworkManager's protocol will be reconfigured according to the specified intention, although a login-intention + * must pass a versioncheck or receive a disconnect otherwise + */ + public void processHandshake(C00Handshake packetIn) + { + if (!FMLCommonHandler.instance().shouldAllowPlayerLogins()) + { + ChatComponentText chatcomponenttext = new ChatComponentText("Server is still starting! Please wait before reconnecting."); + this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); + this.field_147386_b.closeChannel(chatcomponenttext); + return; + } + + switch (NetHandlerHandshakeTCP.SwitchEnumConnectionState.field_151291_a[packetIn.func_149594_c().ordinal()]) + { + case 1: + this.field_147386_b.setConnectionState(EnumConnectionState.LOGIN); + ChatComponentText chatcomponenttext; + + if (packetIn.func_149595_d() > 5) + { + chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.7.10"); + this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); + this.field_147386_b.closeChannel(chatcomponenttext); + } + else if (packetIn.func_149595_d() < 5) + { + chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.7.10"); + this.field_147386_b.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); + this.field_147386_b.closeChannel(chatcomponenttext); + } + else + { + this.field_147386_b.setNetHandler(new NetHandlerLoginServer(this.field_147387_a, this.field_147386_b)); + } + + break; + case 2: + this.field_147386_b.setConnectionState(EnumConnectionState.STATUS); + this.field_147386_b.setNetHandler(new NetHandlerStatusServer(this.field_147387_a, this.field_147386_b)); + break; + default: + throw new UnsupportedOperationException("Invalid intention " + packetIn.func_149594_c()); + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + if (newState != EnumConnectionState.LOGIN && newState != EnumConnectionState.STATUS) + { + throw new UnsupportedOperationException("Invalid state " + newState); + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + static final class SwitchEnumConnectionState + { + static final int[] field_151291_a = new int[EnumConnectionState.values().length]; + private static final String __OBFID = "CL_00001457"; + + static + { + try + { + field_151291_a[EnumConnectionState.LOGIN.ordinal()] = 1; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_151291_a[EnumConnectionState.STATUS.ordinal()] = 2; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerLoginServer.java b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerLoginServer.java new file mode 100644 index 0000000..4c4c406 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerLoginServer.java @@ -0,0 +1,226 @@ +package net.minecraft.server.network; + +import com.google.common.base.Charsets; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.exceptions.AuthenticationUnavailableException; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import io.netty.util.concurrent.GenericFutureListener; +import java.math.BigInteger; +import java.security.PrivateKey; +import java.util.Arrays; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; +import javax.crypto.SecretKey; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.login.INetHandlerLoginServer; +import net.minecraft.network.login.client.C00PacketLoginStart; +import net.minecraft.network.login.client.C01PacketEncryptionResponse; +import net.minecraft.network.login.server.S00PacketDisconnect; +import net.minecraft.network.login.server.S01PacketEncryptionRequest; +import net.minecraft.network.login.server.S02PacketLoginSuccess; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.CryptManager; +import net.minecraft.util.IChatComponent; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class NetHandlerLoginServer implements INetHandlerLoginServer +{ + private static final AtomicInteger field_147331_b = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final Random field_147329_d = new Random(); + private final byte[] field_147330_e = new byte[4]; + private final MinecraftServer field_147327_f; + public final NetworkManager field_147333_a; + private NetHandlerLoginServer.LoginState field_147328_g; + private int field_147336_h; + private GameProfile field_147337_i; + private String field_147334_j; + private SecretKey field_147335_k; + private static final String __OBFID = "CL_00001458"; + + public NetHandlerLoginServer(MinecraftServer p_i45298_1_, NetworkManager p_i45298_2_) + { + this.field_147328_g = NetHandlerLoginServer.LoginState.HELLO; + this.field_147334_j = ""; + this.field_147327_f = p_i45298_1_; + this.field_147333_a = p_i45298_2_; + field_147329_d.nextBytes(this.field_147330_e); + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() + { + if (this.field_147328_g == NetHandlerLoginServer.LoginState.READY_TO_ACCEPT) + { + this.func_147326_c(); + } + + if (this.field_147336_h++ == FMLNetworkHandler.LOGIN_TIMEOUT) + { + this.func_147322_a("Took too long to log in"); + } + } + + public void func_147322_a(String reason) + { + try + { + logger.info("Disconnecting " + this.func_147317_d() + ": " + reason); + ChatComponentText chatcomponenttext = new ChatComponentText(reason); + this.field_147333_a.scheduleOutboundPacket(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); + this.field_147333_a.closeChannel(chatcomponenttext); + } + catch (Exception exception) + { + logger.error("Error whilst disconnecting player", exception); + } + } + + public void func_147326_c() + { + if (!this.field_147337_i.isComplete()) + { + this.field_147337_i = this.func_152506_a(this.field_147337_i); + } + + String s = this.field_147327_f.getConfigurationManager().allowUserToConnect(this.field_147333_a.getSocketAddress(), this.field_147337_i); + + if (s != null) + { + this.func_147322_a(s); + } + else + { + this.field_147328_g = NetHandlerLoginServer.LoginState.ACCEPTED; + this.field_147333_a.scheduleOutboundPacket(new S02PacketLoginSuccess(this.field_147337_i), new GenericFutureListener[0]); + FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.getConfigurationManager(), this.field_147333_a, this.field_147327_f.getConfigurationManager().createPlayerForUser(this.field_147337_i)); + } + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) + { + logger.info(this.func_147317_d() + " lost connection: " + reason.getUnformattedText()); + } + + public String func_147317_d() + { + return this.field_147337_i != null ? this.field_147337_i.toString() + " (" + this.field_147333_a.getSocketAddress().toString() + ")" : String.valueOf(this.field_147333_a.getSocketAddress()); + } + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.ACCEPTED || this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected change in protocol", new Object[0]); + Validate.validState(newState == EnumConnectionState.PLAY || newState == EnumConnectionState.LOGIN, "Unexpected protocol " + newState, new Object[0]); + } + + public void processLoginStart(C00PacketLoginStart packetIn) + { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.HELLO, "Unexpected hello packet", new Object[0]); + this.field_147337_i = packetIn.func_149304_c(); + + if (this.field_147327_f.isServerInOnlineMode() && !this.field_147333_a.isLocalChannel()) + { + this.field_147328_g = NetHandlerLoginServer.LoginState.KEY; + this.field_147333_a.scheduleOutboundPacket(new S01PacketEncryptionRequest(this.field_147334_j, this.field_147327_f.getKeyPair().getPublic(), this.field_147330_e), new GenericFutureListener[0]); + } + else + { + this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + } + + public void processEncryptionResponse(C01PacketEncryptionResponse packetIn) + { + Validate.validState(this.field_147328_g == NetHandlerLoginServer.LoginState.KEY, "Unexpected key packet", new Object[0]); + PrivateKey privatekey = this.field_147327_f.getKeyPair().getPrivate(); + + if (!Arrays.equals(this.field_147330_e, packetIn.func_149299_b(privatekey))) + { + throw new IllegalStateException("Invalid nonce!"); + } + else + { + this.field_147335_k = packetIn.func_149300_a(privatekey); + this.field_147328_g = NetHandlerLoginServer.LoginState.AUTHENTICATING; + this.field_147333_a.enableEncryption(this.field_147335_k); + (new Thread("User Authenticator #" + field_147331_b.incrementAndGet()) + { + private static final String __OBFID = "CL_00001459"; + public void run() + { + GameProfile gameprofile = NetHandlerLoginServer.this.field_147337_i; + + try + { + String s = (new BigInteger(CryptManager.getServerIdHash(NetHandlerLoginServer.this.field_147334_j, NetHandlerLoginServer.this.field_147327_f.getKeyPair().getPublic(), NetHandlerLoginServer.this.field_147335_k))).toString(16); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.field_147327_f.func_147130_as().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s); + + if (NetHandlerLoginServer.this.field_147337_i != null) + { + NetHandlerLoginServer.logger.info("UUID of player " + NetHandlerLoginServer.this.field_147337_i.getName() + " is " + NetHandlerLoginServer.this.field_147337_i.getId()); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else if (NetHandlerLoginServer.this.field_147327_f.isSinglePlayer()) + { + NetHandlerLoginServer.logger.warn("Failed to verify username but will let them in anyway!"); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(gameprofile); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else + { + NetHandlerLoginServer.this.func_147322_a("Failed to verify username!"); + NetHandlerLoginServer.logger.error("Username \'" + NetHandlerLoginServer.this.field_147337_i.getName() + "\' tried to join with an invalid session"); + } + } + catch (AuthenticationUnavailableException authenticationunavailableexception) + { + if (NetHandlerLoginServer.this.field_147327_f.isSinglePlayer()) + { + NetHandlerLoginServer.logger.warn("Authentication servers are down but will let them in anyway!"); + NetHandlerLoginServer.this.field_147337_i = NetHandlerLoginServer.this.func_152506_a(gameprofile); + NetHandlerLoginServer.this.field_147328_g = NetHandlerLoginServer.LoginState.READY_TO_ACCEPT; + } + else + { + NetHandlerLoginServer.this.func_147322_a("Authentication servers are down. Please try again later, sorry!"); + NetHandlerLoginServer.logger.error("Couldn\'t verify username because servers are unavailable"); + } + } + } + }).start(); + } + } + + protected GameProfile func_152506_a(GameProfile original) + { + UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + original.getName()).getBytes(Charsets.UTF_8)); + return new GameProfile(uuid, original.getName()); + } + + static enum LoginState + { + HELLO, + KEY, + AUTHENTICATING, + READY_TO_ACCEPT, + ACCEPTED; + + private static final String __OBFID = "CL_00001463"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerStatusServer.java b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerStatusServer.java new file mode 100644 index 0000000..7201c71 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/server/network/NetHandlerStatusServer.java @@ -0,0 +1,58 @@ +package net.minecraft.server.network; + +import io.netty.util.concurrent.GenericFutureListener; +import net.minecraft.network.EnumConnectionState; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.status.INetHandlerStatusServer; +import net.minecraft.network.status.client.C00PacketServerQuery; +import net.minecraft.network.status.client.C01PacketPing; +import net.minecraft.network.status.server.S00PacketServerInfo; +import net.minecraft.network.status.server.S01PacketPong; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.IChatComponent; + +public class NetHandlerStatusServer implements INetHandlerStatusServer +{ + private final MinecraftServer field_147314_a; + private final NetworkManager field_147313_b; + private static final String __OBFID = "CL_00001464"; + + public NetHandlerStatusServer(MinecraftServer serverIn, NetworkManager netManager) + { + this.field_147314_a = serverIn; + this.field_147313_b = netManager; + } + + /** + * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination + */ + public void onDisconnect(IChatComponent reason) {} + + /** + * Allows validation of the connection state transition. Parameters: from, to (connection state). Typically throws + * IllegalStateException or UnsupportedOperationException if validation fails + */ + public void onConnectionStateTransition(EnumConnectionState oldState, EnumConnectionState newState) + { + if (newState != EnumConnectionState.STATUS) + { + throw new UnsupportedOperationException("Unexpected change in protocol to " + newState); + } + } + + /** + * For scheduled network tasks. Used in NetHandlerPlayServer to send keep-alive packets and in NetHandlerLoginServer + * for a login-timeout + */ + public void onNetworkTick() {} + + public void processServerQuery(C00PacketServerQuery packetIn) + { + this.field_147313_b.scheduleOutboundPacket(new S00PacketServerInfo(this.field_147314_a.func_147134_at()), new GenericFutureListener[0]); + } + + public void processPing(C01PacketPing packetIn) + { + this.field_147313_b.scheduleOutboundPacket(new S01PacketPong(packetIn.func_149289_c()), new GenericFutureListener[0]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/src/FMLRenderAccessLibrary.java b/build/rfg/minecraft-src/java/net/minecraft/src/FMLRenderAccessLibrary.java new file mode 100644 index 0000000..0bffde9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/src/FMLRenderAccessLibrary.java @@ -0,0 +1,72 @@ +/* + * Forge Mod Loader + * Copyright (c) 2012-2013 cpw. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v2.1 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * + * Contributors: + * cpw - implementation + */ + +package net.minecraft.src; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLLog; + +/** + * + * A static hook library for optifine and other basemod editing code to access FML functions + * + * @author cpw + * + */ +public class FMLRenderAccessLibrary +{ + public static Logger getLogger() + { + Logger l = LogManager.getLogger("FMLRenderAccessLibrary"); + return l; + } + + public static void log(Level level, String message) + { + FMLLog.log("FMLRenderAccessLibrary", level, message); + } + + public static void log(Level level, String message, Throwable throwable) + { + FMLLog.log(level, throwable, message); + } + + @SuppressWarnings("deprecation") + public static boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelId) + { + return RenderingRegistry.instance().renderWorldBlock(renderer, world, x, y, z, block, modelId); + } + + @SuppressWarnings("deprecation") + public static void renderInventoryBlock(RenderBlocks renderer, Block block, int metadata, int modelID) + { + RenderingRegistry.instance().renderInventoryBlock(renderer, block, metadata, modelID); + } + + @SuppressWarnings("deprecation") + public static boolean renderItemAsFull3DBlock(int modelId) + { + return RenderingRegistry.instance().renderItemAsFull3DBlock(modelId); + } + +// public static void doTextureCopy(Texture atlas, Texture source, int targetX, int targetY) +// { +// TextureFXManager.instance().getHelper().doTextureCopy(atlas, source, targetX, targetY); +// } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/Achievement.java b/build/rfg/minecraft-src/java/net/minecraft/stats/Achievement.java new file mode 100644 index 0000000..d1c7a76 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/Achievement.java @@ -0,0 +1,156 @@ +package net.minecraft.stats; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.StatCollector; + +public class Achievement extends StatBase +{ + /** Is the column (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. */ + public final int displayColumn; + /** Is the row (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. */ + public final int displayRow; + /** Holds the parent achievement, that must be taken before this achievement is avaiable. */ + public final Achievement parentAchievement; + /** Holds the description of the achievement, ready to be formatted and/or displayed. */ + private final String achievementDescription; + /** + * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open + * the inventory. + */ + @SideOnly(Side.CLIENT) + private IStatStringFormat statStringFormatter; + /** Holds the ItemStack that will be used to draw the achievement into the GUI. */ + public final ItemStack theItemStack; + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + private boolean isSpecial; + private static final String __OBFID = "CL_00001466"; + + public Achievement(String p_i45300_1_, String threadName, int p_i45300_3_, int p_i45300_4_, Item p_i45300_5_, Achievement p_i45300_6_) + { + this(p_i45300_1_, threadName, p_i45300_3_, p_i45300_4_, new ItemStack(p_i45300_5_), p_i45300_6_); + } + + public Achievement(String p_i45301_1_, String p_i45301_2_, int p_i45301_3_, int p_i45301_4_, Block p_i45301_5_, Achievement p_i45301_6_) + { + this(p_i45301_1_, p_i45301_2_, p_i45301_3_, p_i45301_4_, new ItemStack(p_i45301_5_), p_i45301_6_); + } + + public Achievement(String p_i45302_1_, String p_i45302_2_, int p_i45302_3_, int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_) + { + super(p_i45302_1_, new ChatComponentTranslation("achievement." + p_i45302_2_, new Object[0])); + this.theItemStack = p_i45302_5_; + this.achievementDescription = "achievement." + p_i45302_2_ + ".desc"; + this.displayColumn = p_i45302_3_; + this.displayRow = p_i45302_4_; + + if (p_i45302_3_ < AchievementList.minDisplayColumn) + { + AchievementList.minDisplayColumn = p_i45302_3_; + } + + if (p_i45302_4_ < AchievementList.minDisplayRow) + { + AchievementList.minDisplayRow = p_i45302_4_; + } + + if (p_i45302_3_ > AchievementList.maxDisplayColumn) + { + AchievementList.maxDisplayColumn = p_i45302_3_; + } + + if (p_i45302_4_ > AchievementList.maxDisplayRow) + { + AchievementList.maxDisplayRow = p_i45302_4_; + } + + this.parentAchievement = p_i45302_6_; + } + + /** + * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the + * current instance. + */ + public Achievement initIndependentStat() + { + this.isIndependent = true; + return this; + } + + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + public Achievement setSpecial() + { + this.isSpecial = true; + return this; + } + + /** + * Register the stat into StatList. + */ + public Achievement registerStat() + { + super.registerStat(); + AchievementList.achievementList.add(this); + return this; + } + + /** + * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() + { + return true; + } + + public IChatComponent func_150951_e() + { + IChatComponent ichatcomponent = super.func_150951_e(); + ichatcomponent.getChatStyle().setColor(this.getSpecial() ? EnumChatFormatting.DARK_PURPLE : EnumChatFormatting.GREEN); + return ichatcomponent; + } + + public Achievement func_150953_b(Class p_150953_1_) + { + return (Achievement)super.func_150953_b(p_150953_1_); + } + + /** + * Returns the fully description of the achievement - ready to be displayed on screen. + */ + @SideOnly(Side.CLIENT) + public String getDescription() + { + return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); + } + + /** + * Defines a string formatter for the achievement. + */ + @SideOnly(Side.CLIENT) + public Achievement setStatStringFormatter(IStatStringFormat p_75988_1_) + { + this.statStringFormatter = p_75988_1_; + return this; + } + + /** + * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to + * achieve. + */ + public boolean getSpecial() + { + return this.isSpecial; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/AchievementList.java b/build/rfg/minecraft-src/java/net/minecraft/stats/AchievementList.java new file mode 100644 index 0000000..db571c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/AchievementList.java @@ -0,0 +1,87 @@ +package net.minecraft.stats; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.JsonSerializableSet; + +public class AchievementList +{ + /** Is the smallest column used to display a achievement on the GUI. */ + public static int minDisplayColumn; + /** Is the smallest row used to display a achievement on the GUI. */ + public static int minDisplayRow; + /** Is the biggest column used to display a achievement on the GUI. */ + public static int maxDisplayColumn; + /** Is the biggest row used to display a achievement on the GUI. */ + public static int maxDisplayRow; + /** Holds a list of all registered achievements. */ + public static List achievementList = new ArrayList(); + /** Is the 'open inventory' achievement. */ + public static Achievement openInventory = (new Achievement("achievement.openInventory", "openInventory", 0, 0, Items.book, (Achievement)null)).initIndependentStat().registerStat(); + /** Is the 'getting wood' achievement. */ + public static Achievement mineWood = (new Achievement("achievement.mineWood", "mineWood", 2, 1, Blocks.log, openInventory)).registerStat(); + /** Is the 'benchmarking' achievement. */ + public static Achievement buildWorkBench = (new Achievement("achievement.buildWorkBench", "buildWorkBench", 4, -1, Blocks.crafting_table, mineWood)).registerStat(); + /** Is the 'time to mine' achievement. */ + public static Achievement buildPickaxe = (new Achievement("achievement.buildPickaxe", "buildPickaxe", 4, 2, Items.wooden_pickaxe, buildWorkBench)).registerStat(); + /** Is the 'hot topic' achievement. */ + public static Achievement buildFurnace = (new Achievement("achievement.buildFurnace", "buildFurnace", 3, 4, Blocks.furnace, buildPickaxe)).registerStat(); + /** Is the 'acquire hardware' achievement. */ + public static Achievement acquireIron = (new Achievement("achievement.acquireIron", "acquireIron", 1, 4, Items.iron_ingot, buildFurnace)).registerStat(); + /** Is the 'time to farm' achievement. */ + public static Achievement buildHoe = (new Achievement("achievement.buildHoe", "buildHoe", 2, -3, Items.wooden_hoe, buildWorkBench)).registerStat(); + /** Is the 'bake bread' achievement. */ + public static Achievement makeBread = (new Achievement("achievement.makeBread", "makeBread", -1, -3, Items.bread, buildHoe)).registerStat(); + /** Is the 'the lie' achievement. */ + public static Achievement bakeCake = (new Achievement("achievement.bakeCake", "bakeCake", 0, -5, Items.cake, buildHoe)).registerStat(); + /** Is the 'getting a upgrade' achievement. */ + public static Achievement buildBetterPickaxe = (new Achievement("achievement.buildBetterPickaxe", "buildBetterPickaxe", 6, 2, Items.stone_pickaxe, buildPickaxe)).registerStat(); + /** Is the 'delicious fish' achievement. */ + public static Achievement cookFish = (new Achievement("achievement.cookFish", "cookFish", 2, 6, Items.cooked_fished, buildFurnace)).registerStat(); + /** Is the 'on a rail' achievement */ + public static Achievement onARail = (new Achievement("achievement.onARail", "onARail", 2, 3, Blocks.rail, acquireIron)).setSpecial().registerStat(); + /** Is the 'time to strike' achievement. */ + public static Achievement buildSword = (new Achievement("achievement.buildSword", "buildSword", 6, -1, Items.wooden_sword, buildWorkBench)).registerStat(); + /** Is the 'monster hunter' achievement. */ + public static Achievement killEnemy = (new Achievement("achievement.killEnemy", "killEnemy", 8, -1, Items.bone, buildSword)).registerStat(); + /** is the 'cow tipper' achievement. */ + public static Achievement killCow = (new Achievement("achievement.killCow", "killCow", 7, -3, Items.leather, buildSword)).registerStat(); + /** Is the 'when pig fly' achievement. */ + public static Achievement flyPig = (new Achievement("achievement.flyPig", "flyPig", 9, -3, Items.saddle, killCow)).setSpecial().registerStat(); + /** The achievement for killing a Skeleton from 50 meters aways. */ + public static Achievement snipeSkeleton = (new Achievement("achievement.snipeSkeleton", "snipeSkeleton", 7, 0, Items.bow, killEnemy)).setSpecial().registerStat(); + /** Is the 'DIAMONDS!' achievement */ + public static Achievement diamonds = (new Achievement("achievement.diamonds", "diamonds", -1, 5, Blocks.diamond_ore, acquireIron)).registerStat(); + public static Achievement field_150966_x = (new Achievement("achievement.diamondsToYou", "diamondsToYou", -1, 2, Items.diamond, diamonds)).registerStat(); + /** Is the 'We Need to Go Deeper' achievement */ + public static Achievement portal = (new Achievement("achievement.portal", "portal", -1, 7, Blocks.obsidian, diamonds)).registerStat(); + /** Is the 'Return to Sender' achievement */ + public static Achievement ghast = (new Achievement("achievement.ghast", "ghast", -4, 8, Items.ghast_tear, portal)).setSpecial().registerStat(); + /** Is the 'Into Fire' achievement */ + public static Achievement blazeRod = (new Achievement("achievement.blazeRod", "blazeRod", 0, 9, Items.blaze_rod, portal)).registerStat(); + /** Is the 'Local Brewery' achievement */ + public static Achievement potion = (new Achievement("achievement.potion", "potion", 2, 8, Items.potionitem, blazeRod)).registerStat(); + /** Is the 'The End?' achievement */ + public static Achievement theEnd = (new Achievement("achievement.theEnd", "theEnd", 3, 10, Items.ender_eye, blazeRod)).setSpecial().registerStat(); + /** Is the 'The End.' achievement */ + public static Achievement theEnd2 = (new Achievement("achievement.theEnd2", "theEnd2", 4, 13, Blocks.dragon_egg, theEnd)).setSpecial().registerStat(); + /** Is the 'Enchanter' achievement */ + public static Achievement enchantments = (new Achievement("achievement.enchantments", "enchantments", -4, 4, Blocks.enchanting_table, diamonds)).registerStat(); + public static Achievement overkill = (new Achievement("achievement.overkill", "overkill", -4, 1, Items.diamond_sword, enchantments)).setSpecial().registerStat(); + /** Is the 'Librarian' achievement */ + public static Achievement bookcase = (new Achievement("achievement.bookcase", "bookcase", -3, 6, Blocks.bookshelf, enchantments)).registerStat(); + public static Achievement field_150962_H = (new Achievement("achievement.breedCow", "breedCow", 7, -5, Items.wheat, killCow)).registerStat(); + public static Achievement field_150963_I = (new Achievement("achievement.spawnWither", "spawnWither", 7, 12, new ItemStack(Items.skull, 1, 1), theEnd2)).registerStat(); + public static Achievement field_150964_J = (new Achievement("achievement.killWither", "killWither", 7, 10, Items.nether_star, field_150963_I)).registerStat(); + public static Achievement field_150965_K = (new Achievement("achievement.fullBeacon", "fullBeacon", 7, 8, Blocks.beacon, field_150964_J)).setSpecial().registerStat(); + public static Achievement field_150961_L = (new Achievement("achievement.exploreAllBiomes", "exploreAllBiomes", 4, 8, Items.diamond_boots, theEnd)).func_150953_b(JsonSerializableSet.class).setSpecial().registerStat(); + private static final String __OBFID = "CL_00001467"; + + /** + * A stub functions called to make the static initializer for this class run. + */ + public static void init() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/IStatStringFormat.java b/build/rfg/minecraft-src/java/net/minecraft/stats/IStatStringFormat.java new file mode 100644 index 0000000..ac34c02 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/IStatStringFormat.java @@ -0,0 +1,13 @@ +package net.minecraft.stats; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public interface IStatStringFormat +{ + /** + * Formats the strings based on 'IStatStringFormat' interface. + */ + String formatString(String p_74535_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/IStatType.java b/build/rfg/minecraft-src/java/net/minecraft/stats/IStatType.java new file mode 100644 index 0000000..2eb4aba --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/IStatType.java @@ -0,0 +1,13 @@ +package net.minecraft.stats; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public interface IStatType +{ + /** + * Formats a given stat for human consumption. + */ + @SideOnly(Side.CLIENT) + String format(int p_75843_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/ObjectiveStat.java b/build/rfg/minecraft-src/java/net/minecraft/stats/ObjectiveStat.java new file mode 100644 index 0000000..523aa8f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/ObjectiveStat.java @@ -0,0 +1,15 @@ +package net.minecraft.stats; + +import net.minecraft.scoreboard.ScoreDummyCriteria; + +public class ObjectiveStat extends ScoreDummyCriteria +{ + private final StatBase field_151459_g; + private static final String __OBFID = "CL_00000625"; + + public ObjectiveStat(StatBase p_i45483_1_) + { + super(p_i45483_1_.statId); + this.field_151459_g = p_i45483_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatBase.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatBase.java new file mode 100644 index 0000000..670bff3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatBase.java @@ -0,0 +1,196 @@ +package net.minecraft.stats; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.Locale; +import net.minecraft.event.HoverEvent; +import net.minecraft.scoreboard.IScoreObjectiveCriteria; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class StatBase +{ + /** The Stat ID */ + public final String statId; + /** The Stat name */ + private final IChatComponent statName; + public boolean isIndependent; + private final IStatType type; + private final IScoreObjectiveCriteria field_150957_c; + private Class field_150956_d; + private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.US); + public static IStatType simpleStatType = new IStatType() + { + private static final String __OBFID = "CL_00001473"; + /** + * Formats a given stat for human consumption. + */ + @SideOnly(Side.CLIENT) + public String format(int p_75843_1_) + { + return StatBase.numberFormat.format((long)p_75843_1_); + } + }; + private static DecimalFormat decimalFormat = new DecimalFormat("########0.00"); + public static IStatType timeStatType = new IStatType() + { + private static final String __OBFID = "CL_00001474"; + /** + * Formats a given stat for human consumption. + */ + @SideOnly(Side.CLIENT) + public String format(int p_75843_1_) + { + double d0 = (double)p_75843_1_ / 20.0D; + double d1 = d0 / 60.0D; + double d2 = d1 / 60.0D; + double d3 = d2 / 24.0D; + double d4 = d3 / 365.0D; + return d4 > 0.5D ? StatBase.decimalFormat.format(d4) + " y" : (d3 > 0.5D ? StatBase.decimalFormat.format(d3) + " d" : (d2 > 0.5D ? StatBase.decimalFormat.format(d2) + " h" : (d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " m" : d0 + " s"))); + } + }; + public static IStatType distanceStatType = new IStatType() + { + private static final String __OBFID = "CL_00001475"; + /** + * Formats a given stat for human consumption. + */ + @SideOnly(Side.CLIENT) + public String format(int p_75843_1_) + { + double d0 = (double)p_75843_1_ / 100.0D; + double d1 = d0 / 1000.0D; + return d1 > 0.5D ? StatBase.decimalFormat.format(d1) + " km" : (d0 > 0.5D ? StatBase.decimalFormat.format(d0) + " m" : p_75843_1_ + " cm"); + } + }; + public static IStatType field_111202_k = new IStatType() + { + private static final String __OBFID = "CL_00001476"; + /** + * Formats a given stat for human consumption. + */ + @SideOnly(Side.CLIENT) + public String format(int p_75843_1_) + { + return StatBase.decimalFormat.format((double)p_75843_1_ * 0.1D); + } + }; + private static final String __OBFID = "CL_00001472"; + + public StatBase(String p_i45307_1_, IChatComponent p_i45307_2_, IStatType p_i45307_3_) + { + this.statId = p_i45307_1_; + this.statName = p_i45307_2_; + this.type = p_i45307_3_; + this.field_150957_c = new ObjectiveStat(this); + IScoreObjectiveCriteria.field_96643_a.put(this.field_150957_c.func_96636_a(), this.field_150957_c); + } + + public StatBase(String p_i45308_1_, IChatComponent p_i45308_2_) + { + this(p_i45308_1_, p_i45308_2_, simpleStatType); + } + + /** + * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the + * current instance. + */ + public StatBase initIndependentStat() + { + this.isIndependent = true; + return this; + } + + /** + * Register the stat into StatList. + */ + public StatBase registerStat() + { + if (StatList.oneShotStats.containsKey(this.statId)) + { + throw new RuntimeException("Duplicate stat id: \"" + ((StatBase)StatList.oneShotStats.get(this.statId)).statName + "\" and \"" + this.statName + "\" at id " + this.statId); + } + else + { + StatList.allStats.add(this); + StatList.oneShotStats.put(this.statId, this); + return this; + } + } + + /** + * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). + */ + public boolean isAchievement() + { + return false; + } + + @SideOnly(Side.CLIENT) + public String func_75968_a(int p_75968_1_) + { + return this.type.format(p_75968_1_); + } + + public IChatComponent func_150951_e() + { + IChatComponent ichatcomponent = this.statName.createCopy(); + ichatcomponent.getChatStyle().setColor(EnumChatFormatting.GRAY); + ichatcomponent.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ACHIEVEMENT, new ChatComponentText(this.statId))); + return ichatcomponent; + } + + public IChatComponent func_150955_j() + { + IChatComponent ichatcomponent = this.func_150951_e(); + IChatComponent ichatcomponent1 = (new ChatComponentText("[")).appendSibling(ichatcomponent).appendText("]"); + ichatcomponent1.setChatStyle(ichatcomponent.getChatStyle()); + return ichatcomponent1; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (p_equals_1_ != null && this.getClass() == p_equals_1_.getClass()) + { + StatBase statbase = (StatBase)p_equals_1_; + return this.statId.equals(statbase.statId); + } + else + { + return false; + } + } + + public int hashCode() + { + return this.statId.hashCode(); + } + + public String toString() + { + return "Stat{id=" + this.statId + ", nameId=" + this.statName + ", awardLocallyOnly=" + this.isIndependent + ", formatter=" + this.type + ", objectiveCriteria=" + this.field_150957_c + '}'; + } + + public IScoreObjectiveCriteria func_150952_k() + { + return this.field_150957_c; + } + + public Class func_150954_l() + { + return this.field_150956_d; + } + + public StatBase func_150953_b(Class p_150953_1_) + { + this.field_150956_d = p_150953_1_; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatBasic.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatBasic.java new file mode 100644 index 0000000..52843f3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatBasic.java @@ -0,0 +1,28 @@ +package net.minecraft.stats; + +import net.minecraft.util.IChatComponent; + +public class StatBasic extends StatBase +{ + private static final String __OBFID = "CL_00001469"; + + public StatBasic(String p_i45303_1_, IChatComponent p_i45303_2_, IStatType p_i45303_3_) + { + super(p_i45303_1_, p_i45303_2_, p_i45303_3_); + } + + public StatBasic(String p_i45304_1_, IChatComponent p_i45304_2_) + { + super(p_i45304_1_, p_i45304_2_); + } + + /** + * Register the stat into StatList. + */ + public StatBase registerStat() + { + super.registerStat(); + StatList.generalStats.add(this); + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatCrafting.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatCrafting.java new file mode 100644 index 0000000..89d34a1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatCrafting.java @@ -0,0 +1,24 @@ +package net.minecraft.stats; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.item.Item; +import net.minecraft.util.IChatComponent; + +public class StatCrafting extends StatBase +{ + private final Item field_150960_a; + private static final String __OBFID = "CL_00001470"; + + public StatCrafting(String p_i45305_1_, IChatComponent p_i45305_2_, Item p_i45305_3_) + { + super(p_i45305_1_, p_i45305_2_); + this.field_150960_a = p_i45305_3_; + } + + @SideOnly(Side.CLIENT) + public Item func_150959_a() + { + return this.field_150960_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatFileWriter.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatFileWriter.java new file mode 100644 index 0000000..b8e1433 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatFileWriter.java @@ -0,0 +1,98 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; + +public class StatFileWriter +{ + protected final Map field_150875_a = Maps.newConcurrentMap(); + private static final String __OBFID = "CL_00001481"; + + /** + * Returns true if the achievement has been unlocked. + */ + public boolean hasAchievementUnlocked(Achievement p_77443_1_) + { + return this.writeStat(p_77443_1_) > 0; + } + + /** + * Returns true if the parent has been unlocked, or there is no parent + */ + public boolean canUnlockAchievement(Achievement p_77442_1_) + { + return p_77442_1_.parentAchievement == null || this.hasAchievementUnlocked(p_77442_1_.parentAchievement); + } + + public void func_150871_b(EntityPlayer p_150871_1_, StatBase p_150871_2_, int p_150871_3_) + { + if (!p_150871_2_.isAchievement() || this.canUnlockAchievement((Achievement)p_150871_2_)) + { + this.func_150873_a(p_150871_1_, p_150871_2_, this.writeStat(p_150871_2_) + p_150871_3_); + } + } + + @SideOnly(Side.CLIENT) + public int func_150874_c(Achievement p_150874_1_) + { + if (this.hasAchievementUnlocked(p_150874_1_)) + { + return 0; + } + else + { + int i = 0; + + for (Achievement achievement1 = p_150874_1_.parentAchievement; achievement1 != null && !this.hasAchievementUnlocked(achievement1); ++i) + { + achievement1 = achievement1.parentAchievement; + } + + return i; + } + } + + public void func_150873_a(EntityPlayer p_150873_1_, StatBase p_150873_2_, int p_150873_3_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.field_150875_a.get(p_150873_2_); + + if (tupleintjsonserializable == null) + { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.field_150875_a.put(p_150873_2_, tupleintjsonserializable); + } + + tupleintjsonserializable.setIntegerValue(p_150873_3_); + } + + public int writeStat(StatBase p_77444_1_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.field_150875_a.get(p_77444_1_); + return tupleintjsonserializable == null ? 0 : tupleintjsonserializable.getIntegerValue(); + } + + public IJsonSerializable func_150870_b(StatBase p_150870_1_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.field_150875_a.get(p_150870_1_); + return tupleintjsonserializable != null ? tupleintjsonserializable.getJsonSerializableValue() : null; + } + + public IJsonSerializable func_150872_a(StatBase p_150872_1_, IJsonSerializable p_150872_2_) + { + TupleIntJsonSerializable tupleintjsonserializable = (TupleIntJsonSerializable)this.field_150875_a.get(p_150872_1_); + + if (tupleintjsonserializable == null) + { + tupleintjsonserializable = new TupleIntJsonSerializable(); + this.field_150875_a.put(p_150872_1_, tupleintjsonserializable); + } + + tupleintjsonserializable.setJsonSerializableValue(p_150872_2_); + return p_150872_2_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatList.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatList.java new file mode 100644 index 0000000..0c958b0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatList.java @@ -0,0 +1,255 @@ +package net.minecraft.stats; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityList; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ChatComponentTranslation; + +public class StatList +{ + /** Tracks one-off stats. */ + protected static Map oneShotStats = new HashMap(); + public static List allStats = new ArrayList(); + public static List generalStats = new ArrayList(); + public static List itemStats = new ArrayList(); + /** Tracks the number of times a given block or item has been mined. */ + public static List objectMineStats = new ArrayList(); + /** number of times you've left a game */ + public static StatBase leaveGameStat = (new StatBasic("stat.leaveGame", new ChatComponentTranslation("stat.leaveGame", new Object[0]))).initIndependentStat().registerStat(); + /** number of minutes you have played */ + public static StatBase minutesPlayedStat = (new StatBasic("stat.playOneMinute", new ChatComponentTranslation("stat.playOneMinute", new Object[0]), StatBase.timeStatType)).initIndependentStat().registerStat(); + /** distance you've walked */ + public static StatBase distanceWalkedStat = (new StatBasic("stat.walkOneCm", new ChatComponentTranslation("stat.walkOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** distance you have swam */ + public static StatBase distanceSwumStat = (new StatBasic("stat.swimOneCm", new ChatComponentTranslation("stat.swimOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you have fallen */ + public static StatBase distanceFallenStat = (new StatBasic("stat.fallOneCm", new ChatComponentTranslation("stat.fallOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've climbed */ + public static StatBase distanceClimbedStat = (new StatBasic("stat.climbOneCm", new ChatComponentTranslation("stat.climbOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've flown */ + public static StatBase distanceFlownStat = (new StatBasic("stat.flyOneCm", new ChatComponentTranslation("stat.flyOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've dived */ + public static StatBase distanceDoveStat = (new StatBasic("stat.diveOneCm", new ChatComponentTranslation("stat.diveOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've traveled by minecart */ + public static StatBase distanceByMinecartStat = (new StatBasic("stat.minecartOneCm", new ChatComponentTranslation("stat.minecartOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've traveled by boat */ + public static StatBase distanceByBoatStat = (new StatBasic("stat.boatOneCm", new ChatComponentTranslation("stat.boatOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the distance you've traveled by pig */ + public static StatBase distanceByPigStat = (new StatBasic("stat.pigOneCm", new ChatComponentTranslation("stat.pigOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + public static StatBase field_151185_q = (new StatBasic("stat.horseOneCm", new ChatComponentTranslation("stat.horseOneCm", new Object[0]), StatBase.distanceStatType)).initIndependentStat().registerStat(); + /** the times you've jumped */ + public static StatBase jumpStat = (new StatBasic("stat.jump", new ChatComponentTranslation("stat.jump", new Object[0]))).initIndependentStat().registerStat(); + /** the distance you've dropped (or times you've fallen?) */ + public static StatBase dropStat = (new StatBasic("stat.drop", new ChatComponentTranslation("stat.drop", new Object[0]))).initIndependentStat().registerStat(); + /** the amount of damage you've dealt */ + public static StatBase damageDealtStat = (new StatBasic("stat.damageDealt", new ChatComponentTranslation("stat.damageDealt", new Object[0]), StatBase.field_111202_k)).registerStat(); + /** the amount of damage you have taken */ + public static StatBase damageTakenStat = (new StatBasic("stat.damageTaken", new ChatComponentTranslation("stat.damageTaken", new Object[0]), StatBase.field_111202_k)).registerStat(); + /** the number of times you have died */ + public static StatBase deathsStat = (new StatBasic("stat.deaths", new ChatComponentTranslation("stat.deaths", new Object[0]))).registerStat(); + /** the number of mobs you have killed */ + public static StatBase mobKillsStat = (new StatBasic("stat.mobKills", new ChatComponentTranslation("stat.mobKills", new Object[0]))).registerStat(); + public static StatBase field_151186_x = (new StatBasic("stat.animalsBred", new ChatComponentTranslation("stat.animalsBred", new Object[0]))).registerStat(); + /** counts the number of times you've killed a player */ + public static StatBase playerKillsStat = (new StatBasic("stat.playerKills", new ChatComponentTranslation("stat.playerKills", new Object[0]))).registerStat(); + public static StatBase fishCaughtStat = (new StatBasic("stat.fishCaught", new ChatComponentTranslation("stat.fishCaught", new Object[0]))).registerStat(); + public static StatBase field_151183_A = (new StatBasic("stat.junkFished", new ChatComponentTranslation("stat.junkFished", new Object[0]))).registerStat(); + public static StatBase field_151184_B = (new StatBasic("stat.treasureFished", new ChatComponentTranslation("stat.treasureFished", new Object[0]))).registerStat(); + public static final StatBase[] mineBlockStatArray = new StatBase[4096]; + /** Tracks the number of items a given block or item has been crafted. */ + public static final StatBase[] objectCraftStats = new StatBase[32000]; + /** Tracks the number of times a given block or item has been used. */ + public static final StatBase[] objectUseStats = new StatBase[32000]; + /** Tracks the number of times a given block or item has been broken. */ + public static final StatBase[] objectBreakStats = new StatBase[32000]; + private static final String __OBFID = "CL_00001480"; + + public static void func_151178_a() + { + func_151181_c(); + initStats(); + func_151179_e(); + initCraftableStats(); + AchievementList.init(); + EntityList.func_151514_a(); + } + + /** + * Initializes statistics related to craftable items. Is only called after both block and item stats have been + * initialized. + */ + private static void initCraftableStats() + { + HashSet hashset = new HashSet(); + Iterator iterator = CraftingManager.getInstance().getRecipeList().iterator(); + + while (iterator.hasNext()) + { + IRecipe irecipe = (IRecipe)iterator.next(); + + if (irecipe.getRecipeOutput() != null) + { + hashset.add(irecipe.getRecipeOutput().getItem()); + } + } + + iterator = FurnaceRecipes.smelting().getSmeltingList().values().iterator(); + + while (iterator.hasNext()) + { + ItemStack itemstack = (ItemStack)iterator.next(); + hashset.add(itemstack.getItem()); + } + + iterator = hashset.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item != null) + { + int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these + objectCraftStats[i] = (new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); + } + } + + replaceAllSimilarBlocks(objectCraftStats); + } + + private static void func_151181_c() + { + Iterator iterator = Block.blockRegistry.iterator(); + + while (iterator.hasNext()) + { + Block block = (Block)iterator.next(); + + if (Item.getItemFromBlock(block) != null) + { + int i = Block.getIdFromBlock(block); //TODO: Hook FML's stat change event and re-assign these + + if (block.getEnableStats()) + { + mineBlockStatArray[i] = (new StatCrafting("stat.mineBlock." + i, new ChatComponentTranslation("stat.mineBlock", new Object[] {(new ItemStack(block)).func_151000_E()}), Item.getItemFromBlock(block))).registerStat(); + objectMineStats.add((StatCrafting)mineBlockStatArray[i]); + } + } + } + + replaceAllSimilarBlocks(mineBlockStatArray); + } + + private static void initStats() + { + Iterator iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item != null) + { + int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these + objectUseStats[i] = (new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); + + if (!(item instanceof ItemBlock)) + { + itemStats.add((StatCrafting)objectUseStats[i]); + } + } + } + + replaceAllSimilarBlocks(objectUseStats); + } + + private static void func_151179_e() + { + Iterator iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + Item item = (Item)iterator.next(); + + if (item != null) + { + int i = Item.getIdFromItem(item); //TODO: Hook FML's stat change event and re-assign these + + if (item.isDamageable()) + { + objectBreakStats[i] = (new StatCrafting("stat.breakItem." + i, new ChatComponentTranslation("stat.breakItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); + } + } + } + + replaceAllSimilarBlocks(objectBreakStats); + } + + /** + * Forces all dual blocks to count for each other on the stats list + */ + private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) + { + func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water); + func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava); + func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); + func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); + func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); + func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); + func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); + func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); + func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); + func_151180_a(p_75924_0_, Blocks.red_mushroom, Blocks.brown_mushroom); + func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); + func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); + func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt); + func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt); + } + + private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) + { + int i = Block.getIdFromBlock(p_151180_1_); + int j = Block.getIdFromBlock(p_151180_2_); + + if (p_151180_0_[i] != null && p_151180_0_[j] == null) + { + p_151180_0_[j] = p_151180_0_[i]; + } + else + { + allStats.remove(p_151180_0_[i]); + objectMineStats.remove(p_151180_0_[i]); + generalStats.remove(p_151180_0_[i]); + p_151180_0_[i] = p_151180_0_[j]; + } + } + + public static StatBase func_151182_a(EntityList.EntityEggInfo p_151182_0_) + { + String s = EntityList.getStringFromID(p_151182_0_.spawnedID); + return s == null ? null : (new StatBase("stat.killEntity." + s, new ChatComponentTranslation("stat.entityKill", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat(); + } + + public static StatBase func_151176_b(EntityList.EntityEggInfo p_151176_0_) + { + String s = EntityList.getStringFromID(p_151176_0_.spawnedID); + return s == null ? null : (new StatBase("stat.entityKilledBy." + s, new ChatComponentTranslation("stat.entityKilledBy", new Object[] {new ChatComponentTranslation("entity." + s + ".name", new Object[0])}))).registerStat(); + } + + public static StatBase func_151177_a(String p_151177_0_) + { + return (StatBase)oneShotStats.get(p_151177_0_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/stats/StatisticsFile.java b/build/rfg/minecraft-src/java/net/minecraft/stats/StatisticsFile.java new file mode 100644 index 0000000..82ecab5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/stats/StatisticsFile.java @@ -0,0 +1,254 @@ +package net.minecraft.stats; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S37PacketStatistics; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IJsonSerializable; +import net.minecraft.util.TupleIntJsonSerializable; +import org.apache.commons.io.FileUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class StatisticsFile extends StatFileWriter +{ + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer field_150890_c; + private final File field_150887_d; + private final Set field_150888_e = Sets.newHashSet(); + private int field_150885_f = -300; + private boolean field_150886_g = false; + private static final String __OBFID = "CL_00001471"; + + public StatisticsFile(MinecraftServer p_i45306_1_, File p_i45306_2_) + { + this.field_150890_c = p_i45306_1_; + this.field_150887_d = p_i45306_2_; + } + + public void func_150882_a() + { + if (this.field_150887_d.isFile()) + { + try + { + this.field_150875_a.clear(); + this.field_150875_a.putAll(this.func_150881_a(FileUtils.readFileToString(this.field_150887_d))); + } + catch (IOException ioexception) + { + logger.error("Couldn\'t read statistics file " + this.field_150887_d, ioexception); + } + catch (JsonParseException jsonparseexception) + { + logger.error("Couldn\'t parse statistics file " + this.field_150887_d, jsonparseexception); + } + } + } + + public void func_150883_b() + { + try + { + FileUtils.writeStringToFile(this.field_150887_d, func_150880_a(this.field_150875_a)); + } + catch (IOException ioexception) + { + logger.error("Couldn\'t save stats", ioexception); + } + } + + public void func_150873_a(EntityPlayer p_150873_1_, StatBase p_150873_2_, int p_150873_3_) + { + int j = p_150873_2_.isAchievement() ? this.writeStat(p_150873_2_) : 0; + super.func_150873_a(p_150873_1_, p_150873_2_, p_150873_3_); + this.field_150888_e.add(p_150873_2_); + + if (p_150873_2_.isAchievement() && j == 0 && p_150873_3_ > 0) + { + this.field_150886_g = true; + + if (this.field_150890_c.func_147136_ar()) + { + this.field_150890_c.getConfigurationManager().sendChatMsg(new ChatComponentTranslation("chat.type.achievement", new Object[] {p_150873_1_.func_145748_c_(), p_150873_2_.func_150955_j()})); + } + } + } + + public Set func_150878_c() + { + HashSet hashset = Sets.newHashSet(this.field_150888_e); + this.field_150888_e.clear(); + this.field_150886_g = false; + return hashset; + } + + public Map func_150881_a(String p_150881_1_) + { + JsonElement jsonelement = (new JsonParser()).parse(p_150881_1_); + + if (!jsonelement.isJsonObject()) + { + return Maps.newHashMap(); + } + else + { + JsonObject jsonobject = jsonelement.getAsJsonObject(); + HashMap hashmap = Maps.newHashMap(); + Iterator iterator = jsonobject.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + StatBase statbase = StatList.func_151177_a((String)entry.getKey()); + + if (statbase != null) + { + TupleIntJsonSerializable tupleintjsonserializable = new TupleIntJsonSerializable(); + + if (((JsonElement)entry.getValue()).isJsonPrimitive() && ((JsonElement)entry.getValue()).getAsJsonPrimitive().isNumber()) + { + tupleintjsonserializable.setIntegerValue(((JsonElement)entry.getValue()).getAsInt()); + } + else if (((JsonElement)entry.getValue()).isJsonObject()) + { + JsonObject jsonobject1 = ((JsonElement)entry.getValue()).getAsJsonObject(); + + if (jsonobject1.has("value") && jsonobject1.get("value").isJsonPrimitive() && jsonobject1.get("value").getAsJsonPrimitive().isNumber()) + { + tupleintjsonserializable.setIntegerValue(jsonobject1.getAsJsonPrimitive("value").getAsInt()); + } + + if (jsonobject1.has("progress") && statbase.func_150954_l() != null) + { + try + { + Constructor constructor = statbase.func_150954_l().getConstructor(new Class[0]); + IJsonSerializable ijsonserializable = (IJsonSerializable)constructor.newInstance(new Object[0]); + ijsonserializable.func_152753_a(jsonobject1.get("progress")); + tupleintjsonserializable.setJsonSerializableValue(ijsonserializable); + } + catch (Throwable throwable) + { + logger.warn("Invalid statistic progress in " + this.field_150887_d, throwable); + } + } + } + + hashmap.put(statbase, tupleintjsonserializable); + } + else + { + logger.warn("Invalid statistic in " + this.field_150887_d + ": Don\'t know what " + (String)entry.getKey() + " is"); + } + } + + return hashmap; + } + } + + public static String func_150880_a(Map p_150880_0_) + { + JsonObject jsonobject = new JsonObject(); + Iterator iterator = p_150880_0_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((TupleIntJsonSerializable)entry.getValue()).getJsonSerializableValue() != null) + { + JsonObject jsonobject1 = new JsonObject(); + jsonobject1.addProperty("value", Integer.valueOf(((TupleIntJsonSerializable)entry.getValue()).getIntegerValue())); + + try + { + jsonobject1.add("progress", ((TupleIntJsonSerializable)entry.getValue()).getJsonSerializableValue().getSerializableElement()); + } + catch (Throwable throwable) + { + logger.warn("Couldn\'t save statistic " + ((StatBase)entry.getKey()).func_150951_e() + ": error serializing progress", throwable); + } + + jsonobject.add(((StatBase)entry.getKey()).statId, jsonobject1); + } + else + { + jsonobject.addProperty(((StatBase)entry.getKey()).statId, Integer.valueOf(((TupleIntJsonSerializable)entry.getValue()).getIntegerValue())); + } + } + + return jsonobject.toString(); + } + + public void func_150877_d() + { + Iterator iterator = this.field_150875_a.keySet().iterator(); + + while (iterator.hasNext()) + { + StatBase statbase = (StatBase)iterator.next(); + this.field_150888_e.add(statbase); + } + } + + public void func_150876_a(EntityPlayerMP p_150876_1_) + { + int i = this.field_150890_c.getTickCounter(); + HashMap hashmap = Maps.newHashMap(); + + if (this.field_150886_g || i - this.field_150885_f > 300) + { + this.field_150885_f = i; + Iterator iterator = this.func_150878_c().iterator(); + + while (iterator.hasNext()) + { + StatBase statbase = (StatBase)iterator.next(); + hashmap.put(statbase, Integer.valueOf(this.writeStat(statbase))); + } + } + + p_150876_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(hashmap)); + } + + public void func_150884_b(EntityPlayerMP p_150884_1_) + { + HashMap hashmap = Maps.newHashMap(); + Iterator iterator = AchievementList.achievementList.iterator(); + + while (iterator.hasNext()) + { + Achievement achievement = (Achievement)iterator.next(); + + if (this.hasAchievementUnlocked(achievement)) + { + hashmap.put(achievement, Integer.valueOf(this.writeStat(achievement))); + this.field_150888_e.remove(achievement); + } + } + + p_150884_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(hashmap)); + } + + public boolean func_150879_e() + { + return this.field_150886_g; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/IHopper.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/IHopper.java new file mode 100644 index 0000000..3ce7198 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/IHopper.java @@ -0,0 +1,27 @@ +package net.minecraft.tileentity; + +import net.minecraft.inventory.IInventory; +import net.minecraft.world.World; + +public interface IHopper extends IInventory +{ + /** + * Returns the worldObj for this tileEntity. + */ + World getWorldObj(); + + /** + * Gets the world X position for this hopper entity. + */ + double getXPos(); + + /** + * Gets the world Y position for this hopper entity. + */ + double getYPos(); + + /** + * Gets the world Z position for this hopper entity. + */ + double getZPos(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java new file mode 100644 index 0000000..0c5c794 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/MobSpawnerBaseLogic.java @@ -0,0 +1,460 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; + +public abstract class MobSpawnerBaseLogic +{ + /** The delay to spawn. */ + public int spawnDelay = 20; + private String entityTypeName = "Pig"; + /** List of entities to spawn. */ + private List potentialEntitySpawns; + private MobSpawnerBaseLogic.WeightedRandomMinecart randomEntity; + public double field_98287_c; + public double field_98284_d; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; + /** A counter for spawn tries. */ + private int spawnCount = 4; + private Entity field_98291_j; + private int maxNearbyEntities = 6; + /** The distance from which a player activates the spawner. */ + private int activatingRangeFromPlayer = 16; + /** The range coefficient for spawning entities around. */ + private int spawnRange = 4; + private static final String __OBFID = "CL_00000129"; + + /** + * Gets the entity name that should be spawned. + */ + public String getEntityNameToSpawn() + { + if (this.getRandomEntity() == null) + { + if (this.entityTypeName.equals("Minecart")) + { + this.entityTypeName = "MinecartRideable"; + } + + return this.entityTypeName; + } + else + { + return this.getRandomEntity().entityTypeName; + } + } + + public void setEntityName(String p_98272_1_) + { + this.entityTypeName = p_98272_1_; + } + + /** + * Returns true if there's a player close enough to this mob spawner to activate it. + */ + public boolean isActivated() + { + return this.getSpawnerWorld().getClosestPlayer((double)this.getSpawnerX() + 0.5D, (double)this.getSpawnerY() + 0.5D, (double)this.getSpawnerZ() + 0.5D, (double)this.activatingRangeFromPlayer) != null; + } + + public void updateSpawner() + { + if (this.isActivated()) + { + double d2; + + if (this.getSpawnerWorld().isRemote) + { + double d0 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().rand.nextFloat()); + double d1 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().rand.nextFloat()); + d2 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().rand.nextFloat()); + this.getSpawnerWorld().spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D); + this.getSpawnerWorld().spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D); + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + } + + this.field_98284_d = this.field_98287_c; + this.field_98287_c = (this.field_98287_c + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; + } + else + { + if (this.spawnDelay == -1) + { + this.resetTimer(); + } + + if (this.spawnDelay > 0) + { + --this.spawnDelay; + return; + } + + boolean flag = false; + + for (int i = 0; i < this.spawnCount; ++i) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); + + if (entity == null) + { + return; + } + + int j = this.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); + + if (j >= this.maxNearbyEntities) + { + this.resetTimer(); + return; + } + + d2 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + double d3 = (double)(this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1); + double d4 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; + EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null; + entity.setLocationAndAngles(d2, d3, d4, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); + + if (entityliving == null || entityliving.getCanSpawnHere()) + { + this.func_98265_a(entity); + this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); + + if (entityliving != null) + { + entityliving.spawnExplosionParticle(); + } + + flag = true; + } + } + + if (flag) + { + this.resetTimer(); + } + } + } + } + + public Entity func_98265_a(Entity p_98265_1_) + { + if (this.getRandomEntity() != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + p_98265_1_.writeToNBTOptional(nbttagcompound); + Iterator iterator = this.getRandomEntity().field_98222_b.func_150296_c().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTBase nbtbase = this.getRandomEntity().field_98222_b.getTag(s); + nbttagcompound.setTag(s, nbtbase.copy()); + } + + p_98265_1_.readFromNBT(nbttagcompound); + + if (p_98265_1_.worldObj != null) + { + p_98265_1_.worldObj.spawnEntityInWorld(p_98265_1_); + } + + NBTTagCompound nbttagcompound2; + + for (Entity entity1 = p_98265_1_; nbttagcompound.hasKey("Riding", 10); nbttagcompound = nbttagcompound2) + { + nbttagcompound2 = nbttagcompound.getCompoundTag("Riding"); + Entity entity2 = EntityList.createEntityByName(nbttagcompound2.getString("id"), p_98265_1_.worldObj); + + if (entity2 != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + entity2.writeToNBTOptional(nbttagcompound1); + Iterator iterator1 = nbttagcompound2.func_150296_c().iterator(); + + while (iterator1.hasNext()) + { + String s1 = (String)iterator1.next(); + NBTBase nbtbase1 = nbttagcompound2.getTag(s1); + nbttagcompound1.setTag(s1, nbtbase1.copy()); + } + + entity2.readFromNBT(nbttagcompound1); + entity2.setLocationAndAngles(entity1.posX, entity1.posY, entity1.posZ, entity1.rotationYaw, entity1.rotationPitch); + + if (p_98265_1_.worldObj != null) + { + p_98265_1_.worldObj.spawnEntityInWorld(entity2); + } + + entity1.mountEntity(entity2); + } + + entity1 = entity2; + } + } + else if (p_98265_1_ instanceof EntityLivingBase && p_98265_1_.worldObj != null) + { + ((EntityLiving)p_98265_1_).onSpawnWithEgg((IEntityLivingData)null); + this.getSpawnerWorld().spawnEntityInWorld(p_98265_1_); + } + + return p_98265_1_; + } + + private void resetTimer() + { + if (this.maxSpawnDelay <= this.minSpawnDelay) + { + this.spawnDelay = this.minSpawnDelay; + } + else + { + int i = this.maxSpawnDelay - this.minSpawnDelay; + this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(i); + } + + if (this.potentialEntitySpawns != null && this.potentialEntitySpawns.size() > 0) + { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.potentialEntitySpawns)); + } + + this.func_98267_a(1); + } + + public void readFromNBT(NBTTagCompound p_98270_1_) + { + this.entityTypeName = p_98270_1_.getString("EntityId"); + this.spawnDelay = p_98270_1_.getShort("Delay"); + + if (p_98270_1_.hasKey("SpawnPotentials", 9)) + { + this.potentialEntitySpawns = new ArrayList(); + NBTTagList nbttaglist = p_98270_1_.getTagList("SpawnPotentials", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.potentialEntitySpawns.add(new MobSpawnerBaseLogic.WeightedRandomMinecart(nbttaglist.getCompoundTagAt(i))); + } + } + else + { + this.potentialEntitySpawns = null; + } + + if (p_98270_1_.hasKey("SpawnData", 10)) + { + this.setRandomEntity(new MobSpawnerBaseLogic.WeightedRandomMinecart(p_98270_1_.getCompoundTag("SpawnData"), this.entityTypeName)); + } + else + { + this.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)null); + } + + if (p_98270_1_.hasKey("MinSpawnDelay", 99)) + { + this.minSpawnDelay = p_98270_1_.getShort("MinSpawnDelay"); + this.maxSpawnDelay = p_98270_1_.getShort("MaxSpawnDelay"); + this.spawnCount = p_98270_1_.getShort("SpawnCount"); + } + + if (p_98270_1_.hasKey("MaxNearbyEntities", 99)) + { + this.maxNearbyEntities = p_98270_1_.getShort("MaxNearbyEntities"); + this.activatingRangeFromPlayer = p_98270_1_.getShort("RequiredPlayerRange"); + } + + if (p_98270_1_.hasKey("SpawnRange", 99)) + { + this.spawnRange = p_98270_1_.getShort("SpawnRange"); + } + + if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) + { + this.field_98291_j = null; + } + } + + public void writeToNBT(NBTTagCompound p_98280_1_) + { + p_98280_1_.setString("EntityId", this.getEntityNameToSpawn()); + p_98280_1_.setShort("Delay", (short)this.spawnDelay); + p_98280_1_.setShort("MinSpawnDelay", (short)this.minSpawnDelay); + p_98280_1_.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); + p_98280_1_.setShort("SpawnCount", (short)this.spawnCount); + p_98280_1_.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); + p_98280_1_.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); + p_98280_1_.setShort("SpawnRange", (short)this.spawnRange); + + if (this.getRandomEntity() != null) + { + p_98280_1_.setTag("SpawnData", this.getRandomEntity().field_98222_b.copy()); + } + + if (this.getRandomEntity() != null || this.potentialEntitySpawns != null && this.potentialEntitySpawns.size() > 0) + { + NBTTagList nbttaglist = new NBTTagList(); + + if (this.potentialEntitySpawns != null && this.potentialEntitySpawns.size() > 0) + { + Iterator iterator = this.potentialEntitySpawns.iterator(); + + while (iterator.hasNext()) + { + MobSpawnerBaseLogic.WeightedRandomMinecart weightedrandomminecart = (MobSpawnerBaseLogic.WeightedRandomMinecart)iterator.next(); + nbttaglist.appendTag(weightedrandomminecart.func_98220_a()); + } + } + else + { + nbttaglist.appendTag(this.getRandomEntity().func_98220_a()); + } + + p_98280_1_.setTag("SpawnPotentials", nbttaglist); + } + } + + /** + * Sets the delay to minDelay if parameter given is 1, else return false. + */ + public boolean setDelayToMin(int p_98268_1_) + { + if (p_98268_1_ == 1 && this.getSpawnerWorld().isRemote) + { + this.spawnDelay = this.minSpawnDelay; + return true; + } + else + { + return false; + } + } + + @SideOnly(Side.CLIENT) + public Entity func_98281_h() + { + if (this.field_98291_j == null) + { + Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null); + entity = this.func_98265_a(entity); + this.field_98291_j = entity; + } + + return this.field_98291_j; + } + + public MobSpawnerBaseLogic.WeightedRandomMinecart getRandomEntity() + { + return this.randomEntity; + } + + public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) + { + this.randomEntity = p_98277_1_; + } + + public abstract void func_98267_a(int p_98267_1_); + + public abstract World getSpawnerWorld(); + + public abstract int getSpawnerX(); + + public abstract int getSpawnerY(); + + public abstract int getSpawnerZ(); + + public class WeightedRandomMinecart extends WeightedRandom.Item + { + public final NBTTagCompound field_98222_b; + public final String entityTypeName; + private static final String __OBFID = "CL_00000130"; + + public WeightedRandomMinecart(NBTTagCompound p_i1945_2_) + { + super(p_i1945_2_.getInteger("Weight")); + NBTTagCompound nbttagcompound1 = p_i1945_2_.getCompoundTag("Properties"); + String s = p_i1945_2_.getString("Type"); + + if (s.equals("Minecart")) + { + if (nbttagcompound1 != null) + { + switch (nbttagcompound1.getInteger("Type")) + { + case 0: + s = "MinecartRideable"; + break; + case 1: + s = "MinecartChest"; + break; + case 2: + s = "MinecartFurnace"; + } + } + else + { + s = "MinecartRideable"; + } + } + + this.field_98222_b = nbttagcompound1; + this.entityTypeName = s; + } + + public WeightedRandomMinecart(NBTTagCompound p_i1946_2_, String p_i1946_3_) + { + super(1); + + if (p_i1946_3_.equals("Minecart")) + { + if (p_i1946_2_ != null) + { + switch (p_i1946_2_.getInteger("Type")) + { + case 0: + p_i1946_3_ = "MinecartRideable"; + break; + case 1: + p_i1946_3_ = "MinecartChest"; + break; + case 2: + p_i1946_3_ = "MinecartFurnace"; + } + } + else + { + p_i1946_3_ = "MinecartRideable"; + } + } + + this.field_98222_b = p_i1946_2_; + this.entityTypeName = p_i1946_3_; + } + + public NBTTagCompound func_98220_a() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("Properties", this.field_98222_b); + nbttagcompound.setString("Type", this.entityTypeName); + nbttagcompound.setInteger("Weight", this.itemWeight); + return nbttagcompound; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntity.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntity.java new file mode 100644 index 0000000..edc8407 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntity.java @@ -0,0 +1,421 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Callable; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockJukebox; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TileEntity +{ + private static final Logger logger = LogManager.getLogger(); + /** A HashMap storing string names of classes mapping to the actual java.lang.Class type. */ + private static Map nameToClassMap = new HashMap(); + /** A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). */ + private static Map classToNameMap = new HashMap(); + /** the instance of the world the tile entity is in. */ + protected World worldObj; + public int xCoord; + public int yCoord; + public int zCoord; + protected boolean tileEntityInvalid; + public int blockMetadata = -1; + /** the Block type that this TileEntity is contained within */ + public Block blockType; + private static final String __OBFID = "CL_00000340"; + + /** + * Adds a new two-way mapping between the class and its string name in both hashmaps. + */ + public static void addMapping(Class cl, String id) + { + if (nameToClassMap.containsKey(id)) + { + throw new IllegalArgumentException("Duplicate id: " + id); + } + else + { + nameToClassMap.put(id, cl); + classToNameMap.put(cl, id); + } + } + + /** + * Returns the worldObj for this tileEntity. + */ + public World getWorldObj() + { + return this.worldObj; + } + + /** + * Sets the worldObj for this tileEntity. + */ + public void setWorldObj(World worldIn) + { + this.worldObj = worldIn; + } + + /** + * Returns true if the worldObj isn't null. + */ + public boolean hasWorldObj() + { + return this.worldObj != null; + } + + public void readFromNBT(NBTTagCompound compound) + { + this.xCoord = compound.getInteger("x"); + this.yCoord = compound.getInteger("y"); + this.zCoord = compound.getInteger("z"); + } + + public void writeToNBT(NBTTagCompound compound) + { + String s = (String)classToNameMap.get(this.getClass()); + + if (s == null) + { + throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); + } + else + { + compound.setString("id", s); + compound.setInteger("x", this.xCoord); + compound.setInteger("y", this.yCoord); + compound.setInteger("z", this.zCoord); + } + } + + public void updateEntity() {} + + /** + * Creates a new entity and loads its data from the specified NBT. + */ + public static TileEntity createAndLoadEntity(NBTTagCompound nbt) + { + TileEntity tileentity = null; + + Class oclass = null; + try + { + oclass = (Class)nameToClassMap.get(nbt.getString("id")); + + if (oclass != null) + { + tileentity = (TileEntity)oclass.newInstance(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + if (tileentity != null) + { + try + { + tileentity.readFromNBT(nbt); + } + catch (Exception ex) + { + FMLLog.log(Level.ERROR, ex, + "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", + nbt.getString("id"), oclass.getName()); + tileentity = null; + } + } + else + { + logger.warn("Skipping BlockEntity with id " + nbt.getString("id")); + } + + return tileentity; + } + + public int getBlockMetadata() + { + if (this.blockMetadata == -1) + { + this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); + } + + return this.blockMetadata; + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + if (this.worldObj != null) + { + this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); + this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); + + if (this.getBlockType() != Blocks.air) + { + this.worldObj.func_147453_f(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); + } + } + } + + /** + * Returns the square of the distance between this entity and the passed in coordinates. + */ + public double getDistanceFrom(double p_145835_1_, double p_145835_3_, double p_145835_5_) + { + double d3 = (double)this.xCoord + 0.5D - p_145835_1_; + double d4 = (double)this.yCoord + 0.5D - p_145835_3_; + double d5 = (double)this.zCoord + 0.5D - p_145835_5_; + return d3 * d3 + d4 * d4 + d5 * d5; + } + + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 4096.0D; + } + + /** + * Gets the block type at the location of this entity (client-only). + */ + public Block getBlockType() + { + if (this.blockType == null) + { + this.blockType = this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord); + } + + return this.blockType; + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + return null; + } + + /** + * returns true if tile entity is invalid, false otherwise + */ + public boolean isInvalid() + { + return this.tileEntityInvalid; + } + + /** + * invalidates a tile entity + */ + public void invalidate() + { + this.tileEntityInvalid = true; + } + + /** + * validates a tile entity + */ + public void validate() + { + this.tileEntityInvalid = false; + } + + /** + * Called when a client event is received with the event number and argument, see World.sendClientEvent + */ + public boolean receiveClientEvent(int id, int type) + { + return false; + } + + /** + * Causes the TileEntity to reset all it's cached values for it's container Block, metadata and in the case of + * chests, the adjacent chest check + */ + public void updateContainingBlockInfo() + { + this.blockType = null; + this.blockMetadata = -1; + } + + public void func_145828_a(CrashReportCategory reportCategory) + { + reportCategory.addCrashSectionCallable("Name", new Callable() + { + private static final String __OBFID = "CL_00000341"; + public String call() + { + return (String)TileEntity.classToNameMap.get(TileEntity.this.getClass()) + " // " + TileEntity.this.getClass().getCanonicalName(); + } + }); + CrashReportCategory.func_147153_a(reportCategory, this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), this.getBlockMetadata()); + reportCategory.addCrashSectionCallable("Actual block type", new Callable() + { + private static final String __OBFID = "CL_00000343"; + public String call() + { + int i = Block.getIdFromBlock(TileEntity.this.worldObj.getBlock(TileEntity.this.xCoord, TileEntity.this.yCoord, TileEntity.this.zCoord)); + + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(i), Block.getBlockById(i).getUnlocalizedName(), Block.getBlockById(i).getClass().getCanonicalName()}); + } + catch (Throwable throwable) + { + return "ID #" + i; + } + } + }); + reportCategory.addCrashSectionCallable("Actual block data value", new Callable() + { + private static final String __OBFID = "CL_00000344"; + public String call() + { + int i = TileEntity.this.worldObj.getBlockMetadata(TileEntity.this.xCoord, TileEntity.this.yCoord, TileEntity.this.zCoord); + + if (i < 0) + { + return "Unknown? (Got " + i + ")"; + } + else + { + String s = String.format("%4s", new Object[] {Integer.toBinaryString(i)}).replace(" ", "0"); + return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(i), s}); + } + } + }); + } + + static + { + addMapping(TileEntityFurnace.class, "Furnace"); + addMapping(TileEntityChest.class, "Chest"); + addMapping(TileEntityEnderChest.class, "EnderChest"); + addMapping(BlockJukebox.TileEntityJukebox.class, "RecordPlayer"); + addMapping(TileEntityDispenser.class, "Trap"); + addMapping(TileEntityDropper.class, "Dropper"); + addMapping(TileEntitySign.class, "Sign"); + addMapping(TileEntityMobSpawner.class, "MobSpawner"); + addMapping(TileEntityNote.class, "Music"); + addMapping(TileEntityPiston.class, "Piston"); + addMapping(TileEntityBrewingStand.class, "Cauldron"); + addMapping(TileEntityEnchantmentTable.class, "EnchantTable"); + addMapping(TileEntityEndPortal.class, "Airportal"); + addMapping(TileEntityCommandBlock.class, "Control"); + addMapping(TileEntityBeacon.class, "Beacon"); + addMapping(TileEntitySkull.class, "Skull"); + addMapping(TileEntityDaylightDetector.class, "DLDetector"); + addMapping(TileEntityHopper.class, "Hopper"); + addMapping(TileEntityComparator.class, "Comparator"); + addMapping(TileEntityFlowerPot.class, "FlowerPot"); + } + + // -- BEGIN FORGE PATCHES -- + /** + * Determines if this TileEntity requires update calls. + * @return True if you want updateEntity() to be called, false if not + */ + public boolean canUpdate() + { + return true; + } + + /** + * Called when you receive a TileEntityData packet for the location this + * TileEntity is currently in. On the client, the NetworkManager will always + * be the remote server. On the server, it will be whomever is responsible for + * sending the packet. + * + * @param net The NetworkManager the packet originated from + * @param pkt The data packet + */ + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) + { + } + + /** + * Called when the chunk this TileEntity is on is Unloaded. + */ + public void onChunkUnload() + { + } + + private boolean isVanilla = getClass().getName().startsWith("net.minecraft.tileentity"); + /** + * Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes. + * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly. + * + * @param oldID The old ID of the block + * @param newID The new ID of the block (May be the same) + * @param oldMeta The old metadata of the block + * @param newMeta The new metadata of the block (May be the same) + * @param world Current world + * @param x X Position + * @param y Y Position + * @param z Z Position + * @return True to remove the old tile entity, false to keep it in tact {and create a new one if the new values specify to} + */ + public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) + { + return !isVanilla || (oldBlock != newBlock); + } + + public boolean shouldRenderInPass(int pass) + { + return pass == 0; + } + /** + * Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}. + */ + public static final AxisAlignedBB INFINITE_EXTENT_AABB = AxisAlignedBB.getBoundingBox(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); + /** + * Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity} + * Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block + * at this location. + * + * @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity} + */ + @SideOnly(Side.CLIENT) + public AxisAlignedBB getRenderBoundingBox() + { + AxisAlignedBB bb = INFINITE_EXTENT_AABB; + Block type = getBlockType(); + if (type == Blocks.enchanting_table) + { + bb = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1); + } + else if (type == Blocks.chest || type == Blocks.trapped_chest) + { + bb = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 2, zCoord + 2); + } + else if (type != null && type != Blocks.beacon) + { + AxisAlignedBB cbb = type.getCollisionBoundingBoxFromPool(worldObj, xCoord, yCoord, zCoord); + if (cbb != null) + { + bb = cbb; + } + } + return bb; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBeacon.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBeacon.java new file mode 100644 index 0000000..82b0630 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -0,0 +1,411 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.stats.AchievementList; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityBeacon extends TileEntity implements IInventory +{ + /** List of effects that Beacon can apply */ + public static final Potion[][] effectsList = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}}; + @SideOnly(Side.CLIENT) + private long field_146016_i; + @SideOnly(Side.CLIENT) + private float field_146014_j; + private boolean field_146015_k; + /** Level of this beacon's pyramid. */ + private int levels = -1; + /** Primary potion effect given by this beacon. */ + private int primaryEffect; + /** Secondary potion effect given by this beacon. */ + private int secondaryEffect; + /** Item given to this beacon as payment. */ + private ItemStack payment; + private String field_146008_p; + private static final String __OBFID = "CL_00000339"; + + public void updateEntity() + { + if (this.worldObj.getTotalWorldTime() % 80L == 0L) + { + this.func_146003_y(); + this.func_146000_x(); + } + } + + private void func_146000_x() + { + if (this.field_146015_k && this.levels > 0 && !this.worldObj.isRemote && this.primaryEffect > 0) + { + double d0 = (double)(this.levels * 10 + 10); + byte b0 = 0; + + if (this.levels >= 4 && this.primaryEffect == this.secondaryEffect) + { + b0 = 1; + } + + AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 1), (double)(this.zCoord + 1)).expand(d0, d0, d0); + axisalignedbb.maxY = (double)this.worldObj.getHeight(); + List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb); + Iterator iterator = list.iterator(); + EntityPlayer entityplayer; + + while (iterator.hasNext()) + { + entityplayer = (EntityPlayer)iterator.next(); + entityplayer.addPotionEffect(new PotionEffect(this.primaryEffect, 180, b0, true)); + } + + if (this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) + { + iterator = list.iterator(); + + while (iterator.hasNext()) + { + entityplayer = (EntityPlayer)iterator.next(); + entityplayer.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true)); + } + } + } + } + + private void func_146003_y() + { + int i = this.levels; + + if (!this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) + { + this.field_146015_k = false; + this.levels = 0; + } + else + { + this.field_146015_k = true; + this.levels = 0; + + for (int j = 1; j <= 4; this.levels = j++) + { + int k = this.yCoord - j; + + if (k < 0) + { + break; + } + + boolean flag = true; + + for (int l = this.xCoord - j; l <= this.xCoord + j && flag; ++l) + { + for (int i1 = this.zCoord - j; i1 <= this.zCoord + j; ++i1) + { + Block block = this.worldObj.getBlock(l, k, i1); + + if (!block.isBeaconBase(this.worldObj, l, k, i1, xCoord, yCoord, zCoord)) + { + flag = false; + break; + } + } + } + + if (!flag) + { + break; + } + } + + if (this.levels == 0) + { + this.field_146015_k = false; + } + } + + if (!this.worldObj.isRemote && this.levels == 4 && i < this.levels) + { + Iterator iterator = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)this.xCoord, (double)(this.yCoord - 4), (double)this.zCoord).expand(10.0D, 5.0D, 10.0D)).iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + entityplayer.triggerAchievement(AchievementList.field_150965_K); + } + } + } + + @SideOnly(Side.CLIENT) + public float func_146002_i() + { + if (!this.field_146015_k) + { + return 0.0F; + } + else + { + int i = (int)(this.worldObj.getTotalWorldTime() - this.field_146016_i); + this.field_146016_i = this.worldObj.getTotalWorldTime(); + + if (i > 1) + { + this.field_146014_j -= (float)i / 40.0F; + + if (this.field_146014_j < 0.0F) + { + this.field_146014_j = 0.0F; + } + } + + this.field_146014_j += 0.025F; + + if (this.field_146014_j > 1.0F) + { + this.field_146014_j = 1.0F; + } + + return this.field_146014_j; + } + } + + /** + * Return the primary potion effect given by this beacon. + */ + public int getPrimaryEffect() + { + return this.primaryEffect; + } + + /** + * Return the secondary potion effect given by this beacon. + */ + public int getSecondaryEffect() + { + return this.secondaryEffect; + } + + /** + * Return the levels of this beacon's pyramid. + */ + public int getLevels() + { + return this.levels; + } + + @SideOnly(Side.CLIENT) + public void func_146005_c(int p_146005_1_) + { + this.levels = p_146005_1_; + } + + public void setPrimaryEffect(int p_146001_1_) + { + this.primaryEffect = 0; + + for (int j = 0; j < this.levels && j < 3; ++j) + { + Potion[] apotion = effectsList[j]; + int k = apotion.length; + + for (int l = 0; l < k; ++l) + { + Potion potion = apotion[l]; + + if (potion.id == p_146001_1_) + { + this.primaryEffect = p_146001_1_; + return; + } + } + } + } + + public void setSecondaryEffect(int p_146004_1_) + { + this.secondaryEffect = 0; + + if (this.levels >= 4) + { + for (int j = 0; j < 4; ++j) + { + Potion[] apotion = effectsList[j]; + int k = apotion.length; + + for (int l = 0; l < k; ++l) + { + Potion potion = apotion[l]; + + if (potion.id == p_146004_1_) + { + this.secondaryEffect = p_146004_1_; + return; + } + } + } + } + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound); + } + + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.primaryEffect = compound.getInteger("Primary"); + this.secondaryEffect = compound.getInteger("Secondary"); + this.levels = compound.getInteger("Levels"); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("Primary", this.primaryEffect); + compound.setInteger("Secondary", this.secondaryEffect); + compound.setInteger("Levels", this.levels); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 1; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return slotIn == 0 ? this.payment : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (index == 0 && this.payment != null) + { + if (count >= this.payment.stackSize) + { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } + else + { + this.payment.stackSize -= count; + return new ItemStack(this.payment.getItem(), count, this.payment.getItemDamage()); + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (index == 0 && this.payment != null) + { + ItemStack itemstack = this.payment; + this.payment = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index == 0) + { + this.payment = stack; + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_146008_p : "container.beacon"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_146008_p != null && this.field_146008_p.length() > 0; + } + + public void func_145999_a(String p_145999_1_) + { + this.field_146008_p = p_145999_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 1; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return stack.getItem() != null && stack.getItem().isBeaconPayment(stack); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBrewingStand.java new file mode 100644 index 0000000..ea234ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -0,0 +1,384 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.PotionHelper; + +public class TileEntityBrewingStand extends TileEntity implements ISidedInventory +{ + private static final int[] field_145941_a = new int[] {3}; + private static final int[] field_145947_i = new int[] {0, 1, 2}; + /** The ItemStacks currently placed in the slots of the brewing stand */ + private ItemStack[] brewingItemStacks = new ItemStack[4]; + private int brewTime; + /** an integer with each bit specifying whether that slot of the stand contains a potion */ + private int filledSlots; + private Item ingredientID; + private String field_145942_n; + private static final String __OBFID = "CL_00000345"; + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_145942_n : "container.brewing"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_145942_n != null && this.field_145942_n.length() > 0; + } + + public void func_145937_a(String p_145937_1_) + { + this.field_145942_n = p_145937_1_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.brewingItemStacks.length; + } + + public void updateEntity() + { + if (this.brewTime > 0) + { + --this.brewTime; + + if (this.brewTime == 0) + { + this.brewPotions(); + this.markDirty(); + } + else if (!this.canBrew()) + { + this.brewTime = 0; + this.markDirty(); + } + else if (this.ingredientID != this.brewingItemStacks[3].getItem()) + { + this.brewTime = 0; + this.markDirty(); + } + } + else if (this.canBrew()) + { + this.brewTime = 400; + this.ingredientID = this.brewingItemStacks[3].getItem(); + } + + int i = this.getFilledSlots(); + + if (i != this.filledSlots) + { + this.filledSlots = i; + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, i, 2); + } + + super.updateEntity(); + } + + public int getBrewTime() + { + return this.brewTime; + } + + private boolean canBrew() + { + if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) + { + ItemStack itemstack = this.brewingItemStacks[3]; + + if (!itemstack.getItem().isPotionIngredient(itemstack)) + { + return false; + } + else + { + boolean flag = false; + + for (int i = 0; i < 3; ++i) + { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) + { + int j = this.brewingItemStacks[i].getItemDamage(); + int k = this.func_145936_c(j, itemstack); + + if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) + { + flag = true; + break; + } + + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + + if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null) && j != k) + { + flag = true; + break; + } + } + } + + return flag; + } + } + else + { + return false; + } + } + + private void brewPotions() + { + if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(brewingItemStacks)) return; + if (this.canBrew()) + { + ItemStack itemstack = this.brewingItemStacks[3]; + + for (int i = 0; i < 3; ++i) + { + if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion) + { + int j = this.brewingItemStacks[i].getItemDamage(); + int k = this.func_145936_c(j, itemstack); + List list = Items.potionitem.getEffects(j); + List list1 = Items.potionitem.getEffects(k); + + if ((j <= 0 || list != list1) && (list == null || !list.equals(list1) && list1 != null)) + { + if (j != k) + { + this.brewingItemStacks[i].setItemDamage(k); + } + } + else if (!ItemPotion.isSplash(j) && ItemPotion.isSplash(k)) + { + this.brewingItemStacks[i].setItemDamage(k); + } + } + } + + if (itemstack.getItem().hasContainerItem(itemstack)) + { + this.brewingItemStacks[3] = itemstack.getItem().getContainerItem(itemstack); + } + else + { + --this.brewingItemStacks[3].stackSize; + + if (this.brewingItemStacks[3].stackSize <= 0) + { + this.brewingItemStacks[3] = null; + } + } + net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(brewingItemStacks); + } + } + + private int func_145936_c(int p_145936_1_, ItemStack p_145936_2_) + { + return p_145936_2_ == null ? p_145936_1_ : (p_145936_2_.getItem().isPotionIngredient(p_145936_2_) ? PotionHelper.applyIngredient(p_145936_1_, p_145936_2_.getItem().getPotionEffect(p_145936_2_)) : p_145936_1_); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + + if (b0 >= 0 && b0 < this.brewingItemStacks.length) + { + this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + this.brewTime = compound.getShort("BrewTime"); + + if (compound.hasKey("CustomName", 8)) + { + this.field_145942_n = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setShort("BrewTime", (short)this.brewTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.brewingItemStacks.length; ++i) + { + if (this.brewingItemStacks[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.brewingItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomInventoryName()) + { + compound.setString("CustomName", this.field_145942_n); + } + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return slotIn >= 0 && slotIn < this.brewingItemStacks.length ? this.brewingItemStacks[slotIn] : null; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + ItemStack itemstack = this.brewingItemStacks[index]; + this.brewingItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + ItemStack itemstack = this.brewingItemStacks[index]; + this.brewingItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + if (index >= 0 && index < this.brewingItemStacks.length) + { + this.brewingItemStacks[index] = stack; + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return index == 3 ? stack.getItem().isPotionIngredient(stack) : stack.getItem() instanceof ItemPotion || stack.getItem() == Items.glass_bottle; + } + + @SideOnly(Side.CLIENT) + public void func_145938_d(int p_145938_1_) + { + this.brewTime = p_145938_1_; + } + + /** + * Returns an integer with each bit specifying whether that slot of the stand contains a potion + */ + public int getFilledSlots() + { + int i = 0; + + for (int j = 0; j < 3; ++j) + { + if (this.brewingItemStacks[j] != null) + { + i |= 1 << j; + } + } + + return i; + } + + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + public int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 1 ? field_145941_a : field_145947_i; + } + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) + { + return this.isItemValidForSlot(p_102007_1_, p_102007_2_); + } + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityChest.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityChest.java new file mode 100644 index 0000000..14883d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityChest.java @@ -0,0 +1,510 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityChest extends TileEntity implements IInventory +{ + private ItemStack[] chestContents = new ItemStack[36]; + /** Determines if the check for adjacent chests has taken place. */ + public boolean adjacentChestChecked; + /** Contains the chest tile located adjacent to this one (if any) */ + public TileEntityChest adjacentChestZNeg; + /** Contains the chest tile located adjacent to this one (if any) */ + public TileEntityChest adjacentChestXPos; + /** Contains the chest tile located adjacent to this one (if any) */ + public TileEntityChest adjacentChestXNeg; + /** Contains the chest tile located adjacent to this one (if any) */ + public TileEntityChest adjacentChestZPos; + /** The current angle of the lid (between 0 and 1) */ + public float lidAngle; + /** The angle of the lid last tick */ + public float prevLidAngle; + /** The number of players currently using this chest */ + public int numPlayersUsing; + /** Server sync counter (once per 20 ticks) */ + private int ticksSinceSync; + private int cachedChestType; + private String customName; + private static final String __OBFID = "CL_00000346"; + + public TileEntityChest() + { + this.cachedChestType = -1; + } + + @SideOnly(Side.CLIENT) + public TileEntityChest(int p_i2350_1_) + { + this.cachedChestType = p_i2350_1_; + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 27; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.chestContents[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.chestContents[index] != null) + { + ItemStack itemstack; + + if (this.chestContents[index].stackSize <= count) + { + itemstack = this.chestContents[index]; + this.chestContents[index] = null; + this.markDirty(); + return itemstack; + } + else + { + itemstack = this.chestContents[index].splitStack(count); + + if (this.chestContents[index].stackSize == 0) + { + this.chestContents[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.chestContents[index] != null) + { + ItemStack itemstack = this.chestContents[index]; + this.chestContents[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.chestContents[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.customName : "container.chest"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.customName != null && this.customName.length() > 0; + } + + public void func_145976_a(String p_145976_1_) + { + this.customName = p_145976_1_; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.chestContents = new ItemStack[this.getSizeInventory()]; + + if (compound.hasKey("CustomName", 8)) + { + this.customName = compound.getString("CustomName"); + } + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + + if (j >= 0 && j < this.chestContents.length) + { + this.chestContents[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.chestContents.length; ++i) + { + if (this.chestContents[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.chestContents[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomInventoryName()) + { + compound.setString("CustomName", this.customName); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + /** + * Causes the TileEntity to reset all it's cached values for it's container Block, metadata and in the case of + * chests, the adjacent chest check + */ + public void updateContainingBlockInfo() + { + super.updateContainingBlockInfo(); + this.adjacentChestChecked = false; + } + + private void func_145978_a(TileEntityChest p_145978_1_, int p_145978_2_) + { + if (p_145978_1_.isInvalid()) + { + this.adjacentChestChecked = false; + } + else if (this.adjacentChestChecked) + { + switch (p_145978_2_) + { + case 0: + if (this.adjacentChestZPos != p_145978_1_) + { + this.adjacentChestChecked = false; + } + + break; + case 1: + if (this.adjacentChestXNeg != p_145978_1_) + { + this.adjacentChestChecked = false; + } + + break; + case 2: + if (this.adjacentChestZNeg != p_145978_1_) + { + this.adjacentChestChecked = false; + } + + break; + case 3: + if (this.adjacentChestXPos != p_145978_1_) + { + this.adjacentChestChecked = false; + } + } + } + } + + /** + * Performs the check for adjacent chests to determine if this chest is double or not. + */ + public void checkForAdjacentChests() + { + if (!this.adjacentChestChecked) + { + this.adjacentChestChecked = true; + this.adjacentChestZNeg = null; + this.adjacentChestXPos = null; + this.adjacentChestXNeg = null; + this.adjacentChestZPos = null; + + if (this.func_145977_a(this.xCoord - 1, this.yCoord, this.zCoord)) + { + this.adjacentChestXNeg = (TileEntityChest)this.worldObj.getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord); + } + + if (this.func_145977_a(this.xCoord + 1, this.yCoord, this.zCoord)) + { + this.adjacentChestXPos = (TileEntityChest)this.worldObj.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord); + } + + if (this.func_145977_a(this.xCoord, this.yCoord, this.zCoord - 1)) + { + this.adjacentChestZNeg = (TileEntityChest)this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord - 1); + } + + if (this.func_145977_a(this.xCoord, this.yCoord, this.zCoord + 1)) + { + this.adjacentChestZPos = (TileEntityChest)this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord + 1); + } + + if (this.adjacentChestZNeg != null) + { + this.adjacentChestZNeg.func_145978_a(this, 0); + } + + if (this.adjacentChestZPos != null) + { + this.adjacentChestZPos.func_145978_a(this, 2); + } + + if (this.adjacentChestXPos != null) + { + this.adjacentChestXPos.func_145978_a(this, 1); + } + + if (this.adjacentChestXNeg != null) + { + this.adjacentChestXNeg.func_145978_a(this, 3); + } + } + } + + private boolean func_145977_a(int p_145977_1_, int p_145977_2_, int p_145977_3_) + { + if (this.worldObj == null) + { + return false; + } + else + { + Block block = this.worldObj.getBlock(p_145977_1_, p_145977_2_, p_145977_3_); + return block instanceof BlockChest && ((BlockChest)block).field_149956_a == this.func_145980_j(); + } + } + + public void updateEntity() + { + super.updateEntity(); + this.checkForAdjacentChests(); + ++this.ticksSinceSync; + float f; + + if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) + { + this.numPlayersUsing = 0; + f = 5.0F; + List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)this.xCoord - f), (double)((float)this.yCoord - f), (double)((float)this.zCoord - f), (double)((float)(this.xCoord + 1) + f), (double)((float)(this.yCoord + 1) + f), (double)((float)(this.zCoord + 1) + f))); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (entityplayer.openContainer instanceof ContainerChest) + { + IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory(); + + if (iinventory == this || iinventory instanceof InventoryLargeChest && ((InventoryLargeChest)iinventory).isPartOfLargeChest(this)) + { + ++this.numPlayersUsing; + } + } + } + } + + this.prevLidAngle = this.lidAngle; + f = 0.1F; + double d2; + + if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) + { + double d1 = (double)this.xCoord + 0.5D; + d2 = (double)this.zCoord + 0.5D; + + if (this.adjacentChestZPos != null) + { + d2 += 0.5D; + } + + if (this.adjacentChestXPos != null) + { + d1 += 0.5D; + } + + this.worldObj.playSoundEffect(d1, (double)this.yCoord + 0.5D, d2, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) + { + float f1 = this.lidAngle; + + if (this.numPlayersUsing > 0) + { + this.lidAngle += f; + } + else + { + this.lidAngle -= f; + } + + if (this.lidAngle > 1.0F) + { + this.lidAngle = 1.0F; + } + + float f2 = 0.5F; + + if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) + { + d2 = (double)this.xCoord + 0.5D; + double d0 = (double)this.zCoord + 0.5D; + + if (this.adjacentChestZPos != null) + { + d0 += 0.5D; + } + + if (this.adjacentChestXPos != null) + { + d2 += 0.5D; + } + + this.worldObj.playSoundEffect(d2, (double)this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.lidAngle < 0.0F) + { + this.lidAngle = 0.0F; + } + } + } + + /** + * Called when a client event is received with the event number and argument, see World.sendClientEvent + */ + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.numPlayersUsing = type; + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + public void openInventory() + { + if (this.numPlayersUsing < 0) + { + this.numPlayersUsing = 0; + } + + ++this.numPlayersUsing; + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); + } + + public void closeInventory() + { + if (this.getBlockType() instanceof BlockChest) + { + --this.numPlayersUsing; + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType()); + this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType()); + } + } + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + /** + * invalidates a tile entity + */ + public void invalidate() + { + super.invalidate(); + this.updateContainingBlockInfo(); + this.checkForAdjacentChests(); + } + + public int func_145980_j() + { + if (this.cachedChestType == -1) + { + if (this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) + { + return 0; + } + + this.cachedChestType = ((BlockChest)this.getBlockType()).field_149956_a; + } + + return this.cachedChestType; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityCommandBlock.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityCommandBlock.java new file mode 100644 index 0000000..b1ed63e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityCommandBlock.java @@ -0,0 +1,79 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import io.netty.buffer.ByteBuf; +import net.minecraft.command.server.CommandBlockLogic; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + +public class TileEntityCommandBlock extends TileEntity +{ + private final CommandBlockLogic field_145994_a = new CommandBlockLogic() + { + private static final String __OBFID = "CL_00000348"; + /** + * Return the position for this command sender. + */ + public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(TileEntityCommandBlock.this.xCoord, TileEntityCommandBlock.this.yCoord, TileEntityCommandBlock.this.zCoord); + } + public World getEntityWorld() + { + return TileEntityCommandBlock.this.getWorldObj(); + } + public void func_145752_a(String p_145752_1_) + { + super.func_145752_a(p_145752_1_); + TileEntityCommandBlock.this.markDirty(); + } + public void func_145756_e() + { + TileEntityCommandBlock.this.getWorldObj().markBlockForUpdate(TileEntityCommandBlock.this.xCoord, TileEntityCommandBlock.this.yCoord, TileEntityCommandBlock.this.zCoord); + } + @SideOnly(Side.CLIENT) + public int func_145751_f() + { + return 0; + } + @SideOnly(Side.CLIENT) + public void func_145757_a(ByteBuf p_145757_1_) + { + p_145757_1_.writeInt(TileEntityCommandBlock.this.xCoord); + p_145757_1_.writeInt(TileEntityCommandBlock.this.yCoord); + p_145757_1_.writeInt(TileEntityCommandBlock.this.zCoord); + } + }; + private static final String __OBFID = "CL_00000347"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + this.field_145994_a.func_145758_a(compound); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.field_145994_a.func_145759_b(compound); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 2, nbttagcompound); + } + + public CommandBlockLogic func_145993_a() + { + return this.field_145994_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityComparator.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityComparator.java new file mode 100644 index 0000000..e6912fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityComparator.java @@ -0,0 +1,31 @@ +package net.minecraft.tileentity; + +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityComparator extends TileEntity +{ + private int field_145997_a; + private static final String __OBFID = "CL_00000349"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("OutputSignal", this.field_145997_a); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.field_145997_a = compound.getInteger("OutputSignal"); + } + + public int getOutputSignal() + { + return this.field_145997_a; + } + + public void setOutputSignal(int p_145995_1_) + { + this.field_145997_a = p_145995_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDaylightDetector.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDaylightDetector.java new file mode 100644 index 0000000..9952051 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDaylightDetector.java @@ -0,0 +1,21 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.BlockDaylightDetector; + +public class TileEntityDaylightDetector extends TileEntity +{ + private static final String __OBFID = "CL_00000350"; + + public void updateEntity() + { + if (this.worldObj != null && !this.worldObj.isRemote && this.worldObj.getTotalWorldTime() % 20L == 0L) + { + this.blockType = this.getBlockType(); + + if (this.blockType instanceof BlockDaylightDetector) + { + ((BlockDaylightDetector)this.blockType).func_149957_e(this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDispenser.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDispenser.java new file mode 100644 index 0000000..379fee0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDispenser.java @@ -0,0 +1,227 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class TileEntityDispenser extends TileEntity implements IInventory +{ + private ItemStack[] field_146022_i = new ItemStack[9]; + private Random field_146021_j = new Random(); + protected String field_146020_a; + private static final String __OBFID = "CL_00000352"; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return 9; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.field_146022_i[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.field_146022_i[index] != null) + { + ItemStack itemstack; + + if (this.field_146022_i[index].stackSize <= count) + { + itemstack = this.field_146022_i[index]; + this.field_146022_i[index] = null; + this.markDirty(); + return itemstack; + } + else + { + itemstack = this.field_146022_i[index].splitStack(count); + + if (this.field_146022_i[index].stackSize == 0) + { + this.field_146022_i[index] = null; + } + + this.markDirty(); + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.field_146022_i[index] != null) + { + ItemStack itemstack = this.field_146022_i[index]; + this.field_146022_i[index] = null; + return itemstack; + } + else + { + return null; + } + } + + public int func_146017_i() + { + int i = -1; + int j = 1; + + for (int k = 0; k < this.field_146022_i.length; ++k) + { + if (this.field_146022_i[k] != null && this.field_146021_j.nextInt(j++) == 0) + { + i = k; + } + } + + return i; + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.field_146022_i[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + public int func_146019_a(ItemStack p_146019_1_) + { + for (int i = 0; i < this.field_146022_i.length; ++i) + { + if (this.field_146022_i[i] == null || this.field_146022_i[i].getItem() == null) + { + this.setInventorySlotContents(i, p_146019_1_); + return i; + } + } + + return -1; + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_146020_a : "container.dispenser"; + } + + public void func_146018_a(String p_146018_1_) + { + this.field_146020_a = p_146018_1_; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_146020_a != null; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.field_146022_i = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + + if (j >= 0 && j < this.field_146022_i.length) + { + this.field_146022_i[j] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + if (compound.hasKey("CustomName", 8)) + { + this.field_146020_a = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.field_146022_i.length; ++i) + { + if (this.field_146022_i[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.field_146022_i[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomInventoryName()) + { + compound.setString("CustomName", this.field_146020_a); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDropper.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDropper.java new file mode 100644 index 0000000..a8d128b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityDropper.java @@ -0,0 +1,14 @@ +package net.minecraft.tileentity; + +public class TileEntityDropper extends TileEntityDispenser +{ + private static final String __OBFID = "CL_00000353"; + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_146020_a : "container.dropper"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java new file mode 100644 index 0000000..93ccbe1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnchantmentTable.java @@ -0,0 +1,151 @@ +package net.minecraft.tileentity; + +import java.util.Random; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class TileEntityEnchantmentTable extends TileEntity +{ + public int field_145926_a; + public float field_145933_i; + public float field_145931_j; + public float field_145932_k; + public float field_145929_l; + public float field_145930_m; + public float field_145927_n; + public float field_145928_o; + public float field_145925_p; + public float field_145924_q; + private static Random field_145923_r = new Random(); + private String field_145922_s; + private static final String __OBFID = "CL_00000354"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + + if (this.func_145921_b()) + { + compound.setString("CustomName", this.field_145922_s); + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + + if (compound.hasKey("CustomName", 8)) + { + this.field_145922_s = compound.getString("CustomName"); + } + } + + public void updateEntity() + { + super.updateEntity(); + this.field_145927_n = this.field_145930_m; + this.field_145925_p = this.field_145928_o; + EntityPlayer entityplayer = this.worldObj.getClosestPlayer((double)((float)this.xCoord + 0.5F), (double)((float)this.yCoord + 0.5F), (double)((float)this.zCoord + 0.5F), 3.0D); + + if (entityplayer != null) + { + double d0 = entityplayer.posX - (double)((float)this.xCoord + 0.5F); + double d1 = entityplayer.posZ - (double)((float)this.zCoord + 0.5F); + this.field_145924_q = (float)Math.atan2(d1, d0); + this.field_145930_m += 0.1F; + + if (this.field_145930_m < 0.5F || field_145923_r.nextInt(40) == 0) + { + float f1 = this.field_145932_k; + + do + { + this.field_145932_k += (float)(field_145923_r.nextInt(4) - field_145923_r.nextInt(4)); + } + while (f1 == this.field_145932_k); + } + } + else + { + this.field_145924_q += 0.02F; + this.field_145930_m -= 0.1F; + } + + while (this.field_145928_o >= (float)Math.PI) + { + this.field_145928_o -= ((float)Math.PI * 2F); + } + + while (this.field_145928_o < -(float)Math.PI) + { + this.field_145928_o += ((float)Math.PI * 2F); + } + + while (this.field_145924_q >= (float)Math.PI) + { + this.field_145924_q -= ((float)Math.PI * 2F); + } + + while (this.field_145924_q < -(float)Math.PI) + { + this.field_145924_q += ((float)Math.PI * 2F); + } + + float f2; + + for (f2 = this.field_145924_q - this.field_145928_o; f2 >= (float)Math.PI; f2 -= ((float)Math.PI * 2F)) + { + ; + } + + while (f2 < -(float)Math.PI) + { + f2 += ((float)Math.PI * 2F); + } + + this.field_145928_o += f2 * 0.4F; + + if (this.field_145930_m < 0.0F) + { + this.field_145930_m = 0.0F; + } + + if (this.field_145930_m > 1.0F) + { + this.field_145930_m = 1.0F; + } + + ++this.field_145926_a; + this.field_145931_j = this.field_145933_i; + float f = (this.field_145932_k - this.field_145933_i) * 0.4F; + float f3 = 0.2F; + + if (f < -f3) + { + f = -f3; + } + + if (f > f3) + { + f = f3; + } + + this.field_145929_l += (f - this.field_145929_l) * 0.9F; + this.field_145933_i += this.field_145929_l; + } + + public String func_145919_a() + { + return this.func_145921_b() ? this.field_145922_s : "container.enchant"; + } + + public boolean func_145921_b() + { + return this.field_145922_s != null && this.field_145922_s.length() > 0; + } + + public void func_145920_a(String p_145920_1_) + { + this.field_145922_s = p_145920_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEndPortal.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEndPortal.java new file mode 100644 index 0000000..609a509 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEndPortal.java @@ -0,0 +1,6 @@ +package net.minecraft.tileentity; + +public class TileEntityEndPortal extends TileEntity +{ + private static final String __OBFID = "CL_00000365"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnderChest.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnderChest.java new file mode 100644 index 0000000..b92cb9e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityEnderChest.java @@ -0,0 +1,109 @@ +package net.minecraft.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; + +public class TileEntityEnderChest extends TileEntity +{ + public float field_145972_a; + public float field_145975_i; + public int field_145973_j; + private int field_145974_k; + private static final String __OBFID = "CL_00000355"; + + public void updateEntity() + { + super.updateEntity(); + + if (++this.field_145974_k % 20 * 4 == 0) + { + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, Blocks.ender_chest, 1, this.field_145973_j); + } + + this.field_145975_i = this.field_145972_a; + float f = 0.1F; + double d1; + + if (this.field_145973_j > 0 && this.field_145972_a == 0.0F) + { + double d0 = (double)this.xCoord + 0.5D; + d1 = (double)this.zCoord + 0.5D; + this.worldObj.playSoundEffect(d0, (double)this.yCoord + 0.5D, d1, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145973_j == 0 && this.field_145972_a > 0.0F || this.field_145973_j > 0 && this.field_145972_a < 1.0F) + { + float f2 = this.field_145972_a; + + if (this.field_145973_j > 0) + { + this.field_145972_a += f; + } + else + { + this.field_145972_a -= f; + } + + if (this.field_145972_a > 1.0F) + { + this.field_145972_a = 1.0F; + } + + float f1 = 0.5F; + + if (this.field_145972_a < f1 && f2 >= f1) + { + d1 = (double)this.xCoord + 0.5D; + double d2 = (double)this.zCoord + 0.5D; + this.worldObj.playSoundEffect(d1, (double)this.yCoord + 0.5D, d2, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + if (this.field_145972_a < 0.0F) + { + this.field_145972_a = 0.0F; + } + } + } + + /** + * Called when a client event is received with the event number and argument, see World.sendClientEvent + */ + public boolean receiveClientEvent(int id, int type) + { + if (id == 1) + { + this.field_145973_j = type; + return true; + } + else + { + return super.receiveClientEvent(id, type); + } + } + + /** + * invalidates a tile entity + */ + public void invalidate() + { + this.updateContainingBlockInfo(); + super.invalidate(); + } + + public void func_145969_a() + { + ++this.field_145973_j; + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, Blocks.ender_chest, 1, this.field_145973_j); + } + + public void func_145970_b() + { + --this.field_145973_j; + this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, Blocks.ender_chest, 1, this.field_145973_j); + } + + public boolean func_145971_a(EntityPlayer p_145971_1_) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : p_145971_1_.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFlowerPot.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFlowerPot.java new file mode 100644 index 0000000..9e580b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFlowerPot.java @@ -0,0 +1,61 @@ +package net.minecraft.tileentity; + +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class TileEntityFlowerPot extends TileEntity +{ + private Item flowerPotItem; + private int flowerPotData; + private static final String __OBFID = "CL_00000356"; + + public TileEntityFlowerPot() {} + + public TileEntityFlowerPot(Item p_i45442_1_, int p_i45442_2_) + { + this.flowerPotItem = p_i45442_1_; + this.flowerPotData = p_i45442_2_; + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem)); + compound.setInteger("Data", this.flowerPotData); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.flowerPotItem = Item.getItemById(compound.getInteger("Item")); + this.flowerPotData = compound.getInteger("Data"); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 5, nbttagcompound); + } + + public void func_145964_a(Item p_145964_1_, int p_145964_2_) + { + this.flowerPotItem = p_145964_1_; + this.flowerPotData = p_145964_2_; + } + + public Item getFlowerPotItem() + { + return this.flowerPotItem; + } + + public int getFlowerPotData() + { + return this.flowerPotData; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFurnace.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFurnace.java new file mode 100644 index 0000000..906371e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityFurnace.java @@ -0,0 +1,446 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class TileEntityFurnace extends TileEntity implements ISidedInventory +{ + private static final int[] slotsTop = new int[] {0}; + private static final int[] slotsBottom = new int[] {2, 1}; + private static final int[] slotsSides = new int[] {1}; + /** The ItemStacks that hold the items currently being used in the furnace */ + private ItemStack[] furnaceItemStacks = new ItemStack[3]; + /** The number of ticks that the furnace will keep burning */ + public int furnaceBurnTime; + /** The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for */ + public int currentItemBurnTime; + /** The number of ticks that the current item has been cooking for */ + public int furnaceCookTime; + private String field_145958_o; + private static final String __OBFID = "CL_00000357"; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.furnaceItemStacks.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.furnaceItemStacks[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.furnaceItemStacks[index] != null) + { + ItemStack itemstack; + + if (this.furnaceItemStacks[index].stackSize <= count) + { + itemstack = this.furnaceItemStacks[index]; + this.furnaceItemStacks[index] = null; + return itemstack; + } + else + { + itemstack = this.furnaceItemStacks[index].splitStack(count); + + if (this.furnaceItemStacks[index].stackSize == 0) + { + this.furnaceItemStacks[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.furnaceItemStacks[index] != null) + { + ItemStack itemstack = this.furnaceItemStacks[index]; + this.furnaceItemStacks[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.furnaceItemStacks[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_145958_o : "container.furnace"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_145958_o != null && this.field_145958_o.length() > 0; + } + + public void func_145951_a(String p_145951_1_) + { + this.field_145958_o = p_145951_1_; + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.furnaceItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + + if (b0 >= 0 && b0 < this.furnaceItemStacks.length) + { + this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + + this.furnaceBurnTime = compound.getShort("BurnTime"); + this.furnaceCookTime = compound.getShort("CookTime"); + this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + + if (compound.hasKey("CustomName", 8)) + { + this.field_145958_o = compound.getString("CustomName"); + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setShort("BurnTime", (short)this.furnaceBurnTime); + compound.setShort("CookTime", (short)this.furnaceCookTime); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.furnaceItemStacks.length; ++i) + { + if (this.furnaceItemStacks[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.furnaceItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + compound.setTag("Items", nbttaglist); + + if (this.hasCustomInventoryName()) + { + compound.setString("CustomName", this.field_145958_o); + } + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Returns an integer between 0 and the passed value representing how close the current item is to being completely + * cooked + */ + @SideOnly(Side.CLIENT) + public int getCookProgressScaled(int p_145953_1_) + { + return this.furnaceCookTime * p_145953_1_ / 200; + } + + /** + * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel + * item, where 0 means that the item is exhausted and the passed value means that the item is fresh + */ + @SideOnly(Side.CLIENT) + public int getBurnTimeRemainingScaled(int p_145955_1_) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } + + return this.furnaceBurnTime * p_145955_1_ / this.currentItemBurnTime; + } + + /** + * Furnace isBurning + */ + public boolean isBurning() + { + return this.furnaceBurnTime > 0; + } + + public void updateEntity() + { + boolean flag = this.furnaceBurnTime > 0; + boolean flag1 = false; + + if (this.furnaceBurnTime > 0) + { + --this.furnaceBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.furnaceBurnTime != 0 || this.furnaceItemStacks[1] != null && this.furnaceItemStacks[0] != null) + { + if (this.furnaceBurnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); + + if (this.furnaceBurnTime > 0) + { + flag1 = true; + + if (this.furnaceItemStacks[1] != null) + { + --this.furnaceItemStacks[1].stackSize; + + if (this.furnaceItemStacks[1].stackSize == 0) + { + this.furnaceItemStacks[1] = furnaceItemStacks[1].getItem().getContainerItem(furnaceItemStacks[1]); + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.furnaceCookTime; + + if (this.furnaceCookTime == 200) + { + this.furnaceCookTime = 0; + this.smeltItem(); + flag1 = true; + } + } + else + { + this.furnaceCookTime = 0; + } + } + + if (flag != this.furnaceBurnTime > 0) + { + flag1 = true; + BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + + if (flag1) + { + this.markDirty(); + } + } + + /** + * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. + */ + private boolean canSmelt() + { + if (this.furnaceItemStacks[0] == null) + { + return false; + } + else + { + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); + if (itemstack == null) return false; + if (this.furnaceItemStacks[2] == null) return true; + if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false; + int result = furnaceItemStacks[2].stackSize + itemstack.stackSize; + return result <= getInventoryStackLimit() && result <= this.furnaceItemStacks[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. + } + } + + /** + * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]); + + if (this.furnaceItemStacks[2] == null) + { + this.furnaceItemStacks[2] = itemstack.copy(); + } + else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem()) + { + this.furnaceItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items + } + + --this.furnaceItemStacks[0].stackSize; + + if (this.furnaceItemStacks[0].stackSize <= 0) + { + this.furnaceItemStacks[0] = null; + } + } + } + + /** + * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't + * fuel + */ + public static int getItemBurnTime(ItemStack p_145952_0_) + { + if (p_145952_0_ == null) + { + return 0; + } + else + { + int moddedBurnTime = net.minecraftforge.event.ForgeEventFactory.getFuelBurnTime(p_145952_0_); + if (moddedBurnTime >= 0) return moddedBurnTime; + + Item item = p_145952_0_.getItem(); + + if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) + { + Block block = Block.getBlockFromItem(item); + + if (block == Blocks.wooden_slab) + { + return 150; + } + + if (block.getMaterial() == Material.wood) + { + return 300; + } + + if (block == Blocks.coal_block) + { + return 16000; + } + } + + if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200; + if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200; + if (item instanceof ItemHoe && ((ItemHoe)item).getToolMaterialName().equals("WOOD")) return 200; + if (item == Items.stick) return 100; + if (item == Items.coal) return 1600; + if (item == Items.lava_bucket) return 20000; + if (item == Item.getItemFromBlock(Blocks.sapling)) return 100; + if (item == Items.blaze_rod) return 2400; + return GameRegistry.getFuelValue(p_145952_0_); + } + } + + public static boolean isItemFuel(ItemStack p_145954_0_) + { + return getItemBurnTime(p_145954_0_) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return index == 2 ? false : (index == 1 ? isItemFuel(stack) : true); + } + + /** + * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this + * block. + */ + public int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 0 ? slotsBottom : (p_94128_1_ == 1 ? slotsTop : slotsSides); + } + + /** + * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) + { + return this.isItemValidForSlot(p_102007_1_, p_102007_2_); + } + + /** + * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, + * side + */ + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + return p_102008_3_ != 0 || p_102008_1_ != 1 || p_102008_2_.getItem() == Items.bucket; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityHopper.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityHopper.java new file mode 100644 index 0000000..f4f11ac --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityHopper.java @@ -0,0 +1,689 @@ +package net.minecraft.tileentity; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockHopper; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TileEntityHopper extends TileEntity implements IHopper +{ + private ItemStack[] field_145900_a = new ItemStack[5]; + private String field_145902_i; + private int field_145901_j = -1; + private static final String __OBFID = "CL_00000359"; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + NBTTagList nbttaglist = compound.getTagList("Items", 10); + this.field_145900_a = new ItemStack[this.getSizeInventory()]; + + if (compound.hasKey("CustomName", 8)) + { + this.field_145902_i = compound.getString("CustomName"); + } + + this.field_145901_j = compound.getInteger("TransferCooldown"); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); + + if (b0 >= 0 && b0 < this.field_145900_a.length) + { + this.field_145900_a[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.field_145900_a.length; ++i) + { + if (this.field_145900_a[i] != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + this.field_145900_a[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + compound.setTag("Items", nbttaglist); + compound.setInteger("TransferCooldown", this.field_145901_j); + + if (this.hasCustomInventoryName()) + { + compound.setString("CustomName", this.field_145902_i); + } + } + + /** + * For tile entities, ensures the chunk containing the tile entity is saved to disk later - the game won't think it + * hasn't changed and skip it. + */ + public void markDirty() + { + super.markDirty(); + } + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.field_145900_a.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int slotIn) + { + return this.field_145900_a[slotIn]; + } + + /** + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. + */ + public ItemStack decrStackSize(int index, int count) + { + if (this.field_145900_a[index] != null) + { + ItemStack itemstack; + + if (this.field_145900_a[index].stackSize <= count) + { + itemstack = this.field_145900_a[index]; + this.field_145900_a[index] = null; + return itemstack; + } + else + { + itemstack = this.field_145900_a[index].splitStack(count); + + if (this.field_145900_a[index].stackSize == 0) + { + this.field_145900_a[index] = null; + } + + return itemstack; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int index) + { + if (this.field_145900_a[index] != null) + { + ItemStack itemstack = this.field_145900_a[index]; + this.field_145900_a[index] = null; + return itemstack; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int index, ItemStack stack) + { + this.field_145900_a[index] = stack; + + if (stack != null && stack.stackSize > this.getInventoryStackLimit()) + { + stack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory + */ + public String getInventoryName() + { + return this.hasCustomInventoryName() ? this.field_145902_i : "container.hopper"; + } + + /** + * Returns if the inventory is named + */ + public boolean hasCustomInventoryName() + { + return this.field_145902_i != null && this.field_145902_i.length() > 0; + } + + public void func_145886_a(String p_145886_1_) + { + this.field_145902_i = p_145886_1_; + } + + /** + * Returns the maximum stack size for a inventory slot. + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer player) + { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openInventory() {} + + public void closeInventory() {} + + /** + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. + */ + public boolean isItemValidForSlot(int index, ItemStack stack) + { + return true; + } + + public void updateEntity() + { + if (this.worldObj != null && !this.worldObj.isRemote) + { + --this.field_145901_j; + + if (!this.func_145888_j()) + { + this.func_145896_c(0); + this.func_145887_i(); + } + } + } + + public boolean func_145887_i() + { + if (this.worldObj != null && !this.worldObj.isRemote) + { + if (!this.func_145888_j() && BlockHopper.func_149917_c(this.getBlockMetadata())) + { + boolean flag = false; + + if (!this.func_152104_k()) + { + flag = this.func_145883_k(); + } + + if (!this.func_152105_l()) + { + flag = func_145891_a(this) || flag; + } + + if (flag) + { + this.func_145896_c(8); + this.markDirty(); + return true; + } + } + + return false; + } + else + { + return false; + } + } + + private boolean func_152104_k() + { + ItemStack[] aitemstack = this.field_145900_a; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = aitemstack[j]; + + if (itemstack != null) + { + return false; + } + } + + return true; + } + + private boolean func_152105_l() + { + ItemStack[] aitemstack = this.field_145900_a; + int i = aitemstack.length; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = aitemstack[j]; + + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + + return true; + } + + private boolean func_145883_k() + { + IInventory iinventory = this.func_145895_l(); + + if (iinventory == null) + { + return false; + } + else + { + int i = Facing.oppositeSide[BlockHopper.getDirectionFromMetadata(this.getBlockMetadata())]; + + if (this.func_152102_a(iinventory, i)) + { + return false; + } + else + { + for (int j = 0; j < this.getSizeInventory(); ++j) + { + if (this.getStackInSlot(j) != null) + { + ItemStack itemstack = this.getStackInSlot(j).copy(); + ItemStack itemstack1 = func_145889_a(iinventory, this.decrStackSize(j, 1), i); + + if (itemstack1 == null || itemstack1.stackSize == 0) + { + iinventory.markDirty(); + return true; + } + + this.setInventorySlotContents(j, itemstack); + } + } + + return false; + } + } + } + + private boolean func_152102_a(IInventory p_152102_1_, int p_152102_2_) + { + if (p_152102_1_ instanceof ISidedInventory && p_152102_2_ > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)p_152102_1_; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(p_152102_2_); + + for (int l = 0; l < aint.length; ++l) + { + ItemStack itemstack1 = isidedinventory.getStackInSlot(aint[l]); + + if (itemstack1 == null || itemstack1.stackSize != itemstack1.getMaxStackSize()) + { + return false; + } + } + } + else + { + int j = p_152102_1_.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + ItemStack itemstack = p_152102_1_.getStackInSlot(k); + + if (itemstack == null || itemstack.stackSize != itemstack.getMaxStackSize()) + { + return false; + } + } + } + + return true; + } + + private static boolean func_152103_b(IInventory p_152103_0_, int p_152103_1_) + { + if (p_152103_0_ instanceof ISidedInventory && p_152103_1_ > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)p_152103_0_; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(p_152103_1_); + + for (int l = 0; l < aint.length; ++l) + { + if (isidedinventory.getStackInSlot(aint[l]) != null) + { + return false; + } + } + } + else + { + int j = p_152103_0_.getSizeInventory(); + + for (int k = 0; k < j; ++k) + { + if (p_152103_0_.getStackInSlot(k) != null) + { + return false; + } + } + } + + return true; + } + + public static boolean func_145891_a(IHopper p_145891_0_) + { + IInventory iinventory = func_145884_b(p_145891_0_); + + if (iinventory != null) + { + byte b0 = 0; + + if (func_152103_b(iinventory, b0)) + { + return false; + } + + if (iinventory instanceof ISidedInventory && b0 > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)iinventory; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(b0); + + for (int k = 0; k < aint.length; ++k) + { + if (func_145892_a(p_145891_0_, iinventory, aint[k], b0)) + { + return true; + } + } + } + else + { + int i = iinventory.getSizeInventory(); + + for (int j = 0; j < i; ++j) + { + if (func_145892_a(p_145891_0_, iinventory, j, b0)) + { + return true; + } + } + } + } + else + { + EntityItem entityitem = func_145897_a(p_145891_0_.getWorldObj(), p_145891_0_.getXPos(), p_145891_0_.getYPos() + 1.0D, p_145891_0_.getZPos()); + + if (entityitem != null) + { + return func_145898_a(p_145891_0_, entityitem); + } + } + + return false; + } + + private static boolean func_145892_a(IHopper p_145892_0_, IInventory p_145892_1_, int p_145892_2_, int p_145892_3_) + { + ItemStack itemstack = p_145892_1_.getStackInSlot(p_145892_2_); + + if (itemstack != null && func_145890_b(p_145892_1_, itemstack, p_145892_2_, p_145892_3_)) + { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = func_145889_a(p_145892_0_, p_145892_1_.decrStackSize(p_145892_2_, 1), -1); + + if (itemstack2 == null || itemstack2.stackSize == 0) + { + p_145892_1_.markDirty(); + return true; + } + + p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1); + } + + return false; + } + + public static boolean func_145898_a(IInventory p_145898_0_, EntityItem p_145898_1_) + { + boolean flag = false; + + if (p_145898_1_ == null) + { + return false; + } + else + { + ItemStack itemstack = p_145898_1_.getEntityItem().copy(); + ItemStack itemstack1 = func_145889_a(p_145898_0_, itemstack, -1); + + if (itemstack1 != null && itemstack1.stackSize != 0) + { + p_145898_1_.setEntityItemStack(itemstack1); + } + else + { + flag = true; + p_145898_1_.setDead(); + } + + return flag; + } + } + + public static ItemStack func_145889_a(IInventory p_145889_0_, ItemStack p_145889_1_, int p_145889_2_) + { + if (p_145889_0_ instanceof ISidedInventory && p_145889_2_ > -1) + { + ISidedInventory isidedinventory = (ISidedInventory)p_145889_0_; + int[] aint = isidedinventory.getAccessibleSlotsFromSide(p_145889_2_); + + for (int l = 0; l < aint.length && p_145889_1_ != null && p_145889_1_.stackSize > 0; ++l) + { + p_145889_1_ = func_145899_c(p_145889_0_, p_145889_1_, aint[l], p_145889_2_); + } + } + else + { + int j = p_145889_0_.getSizeInventory(); + + for (int k = 0; k < j && p_145889_1_ != null && p_145889_1_.stackSize > 0; ++k) + { + p_145889_1_ = func_145899_c(p_145889_0_, p_145889_1_, k, p_145889_2_); + } + } + + if (p_145889_1_ != null && p_145889_1_.stackSize == 0) + { + p_145889_1_ = null; + } + + return p_145889_1_; + } + + private static boolean func_145885_a(IInventory p_145885_0_, ItemStack p_145885_1_, int p_145885_2_, int p_145885_3_) + { + return !p_145885_0_.isItemValidForSlot(p_145885_2_, p_145885_1_) ? false : !(p_145885_0_ instanceof ISidedInventory) || ((ISidedInventory)p_145885_0_).canInsertItem(p_145885_2_, p_145885_1_, p_145885_3_); + } + + private static boolean func_145890_b(IInventory p_145890_0_, ItemStack p_145890_1_, int p_145890_2_, int p_145890_3_) + { + return !(p_145890_0_ instanceof ISidedInventory) || ((ISidedInventory)p_145890_0_).canExtractItem(p_145890_2_, p_145890_1_, p_145890_3_); + } + + private static ItemStack func_145899_c(IInventory p_145899_0_, ItemStack p_145899_1_, int p_145899_2_, int p_145899_3_) + { + ItemStack itemstack1 = p_145899_0_.getStackInSlot(p_145899_2_); + + if (func_145885_a(p_145899_0_, p_145899_1_, p_145899_2_, p_145899_3_)) + { + boolean flag = false; + + if (itemstack1 == null) + { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(p_145899_1_.getMaxStackSize(), p_145899_0_.getInventoryStackLimit()); + if (max >= p_145899_1_.stackSize) + { + p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_); + p_145899_1_ = null; + } + else + { + p_145899_0_.setInventorySlotContents(p_145899_2_, p_145899_1_.splitStack(max)); + } + flag = true; + } + else if (func_145894_a(itemstack1, p_145899_1_)) + { + //Forge: BUGFIX: Again, make things respect max stack sizes. + int max = Math.min(p_145899_1_.getMaxStackSize(), p_145899_0_.getInventoryStackLimit()); + if (max > itemstack1.stackSize) + { + int l = Math.min(p_145899_1_.stackSize, max - itemstack1.stackSize); + p_145899_1_.stackSize -= l; + itemstack1.stackSize += l; + flag = l > 0; + } + } + + if (flag) + { + if (p_145899_0_ instanceof TileEntityHopper) + { + ((TileEntityHopper)p_145899_0_).func_145896_c(8); + p_145899_0_.markDirty(); + } + + p_145899_0_.markDirty(); + } + } + + return p_145899_1_; + } + + private IInventory func_145895_l() + { + int i = BlockHopper.getDirectionFromMetadata(this.getBlockMetadata()); + return func_145893_b(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[i]), (double)(this.yCoord + Facing.offsetsYForSide[i]), (double)(this.zCoord + Facing.offsetsZForSide[i])); + } + + public static IInventory func_145884_b(IHopper p_145884_0_) + { + return func_145893_b(p_145884_0_.getWorldObj(), p_145884_0_.getXPos(), p_145884_0_.getYPos() + 1.0D, p_145884_0_.getZPos()); + } + + public static EntityItem func_145897_a(World p_145897_0_, double p_145897_1_, double p_145897_3_, double p_145897_5_) + { + List list = p_145897_0_.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(p_145897_1_, p_145897_3_, p_145897_5_, p_145897_1_ + 1.0D, p_145897_3_ + 1.0D, p_145897_5_ + 1.0D), IEntitySelector.selectAnything); + return list.size() > 0 ? (EntityItem)list.get(0) : null; + } + + public static IInventory func_145893_b(World p_145893_0_, double p_145893_1_, double p_145893_3_, double p_145893_5_) + { + IInventory iinventory = null; + int i = MathHelper.floor_double(p_145893_1_); + int j = MathHelper.floor_double(p_145893_3_); + int k = MathHelper.floor_double(p_145893_5_); + TileEntity tileentity = p_145893_0_.getTileEntity(i, j, k); + + if (tileentity != null && tileentity instanceof IInventory) + { + iinventory = (IInventory)tileentity; + + if (iinventory instanceof TileEntityChest) + { + Block block = p_145893_0_.getBlock(i, j, k); + + if (block instanceof BlockChest) + { + iinventory = ((BlockChest)block).func_149951_m(p_145893_0_, i, j, k); + } + } + } + + if (iinventory == null) + { + List list = p_145893_0_.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(p_145893_1_, p_145893_3_, p_145893_5_, p_145893_1_ + 1.0D, p_145893_3_ + 1.0D, p_145893_5_ + 1.0D), IEntitySelector.selectInventories); + + if (list != null && list.size() > 0) + { + iinventory = (IInventory)list.get(p_145893_0_.rand.nextInt(list.size())); + } + } + + return iinventory; + } + + private static boolean func_145894_a(ItemStack p_145894_0_, ItemStack p_145894_1_) + { + return p_145894_0_.getItem() != p_145894_1_.getItem() ? false : (p_145894_0_.getItemDamage() != p_145894_1_.getItemDamage() ? false : (p_145894_0_.stackSize > p_145894_0_.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(p_145894_0_, p_145894_1_))); + } + + /** + * Gets the world X position for this hopper entity. + */ + public double getXPos() + { + return (double)this.xCoord; + } + + /** + * Gets the world Y position for this hopper entity. + */ + public double getYPos() + { + return (double)this.yCoord; + } + + /** + * Gets the world Z position for this hopper entity. + */ + public double getZPos() + { + return (double)this.zCoord; + } + + public void func_145896_c(int p_145896_1_) + { + this.field_145901_j = p_145896_1_; + } + + public boolean func_145888_j() + { + return this.field_145901_j > 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityMobSpawner.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityMobSpawner.java new file mode 100644 index 0000000..3712b32 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityMobSpawner.java @@ -0,0 +1,87 @@ +package net.minecraft.tileentity; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.world.World; + +public class TileEntityMobSpawner extends TileEntity +{ + private final MobSpawnerBaseLogic field_145882_a = new MobSpawnerBaseLogic() + { + private static final String __OBFID = "CL_00000361"; + public void func_98267_a(int p_98267_1_) + { + TileEntityMobSpawner.this.worldObj.addBlockEvent(TileEntityMobSpawner.this.xCoord, TileEntityMobSpawner.this.yCoord, TileEntityMobSpawner.this.zCoord, Blocks.mob_spawner, p_98267_1_, 0); + } + public World getSpawnerWorld() + { + return TileEntityMobSpawner.this.worldObj; + } + public int getSpawnerX() + { + return TileEntityMobSpawner.this.xCoord; + } + public int getSpawnerY() + { + return TileEntityMobSpawner.this.yCoord; + } + public int getSpawnerZ() + { + return TileEntityMobSpawner.this.zCoord; + } + public void setRandomEntity(MobSpawnerBaseLogic.WeightedRandomMinecart p_98277_1_) + { + super.setRandomEntity(p_98277_1_); + + if (this.getSpawnerWorld() != null) + { + this.getSpawnerWorld().markBlockForUpdate(TileEntityMobSpawner.this.xCoord, TileEntityMobSpawner.this.yCoord, TileEntityMobSpawner.this.zCoord); + } + } + }; + private static final String __OBFID = "CL_00000360"; + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.field_145882_a.readFromNBT(compound); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + this.field_145882_a.writeToNBT(compound); + } + + public void updateEntity() + { + this.field_145882_a.updateSpawner(); + super.updateEntity(); + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + nbttagcompound.removeTag("SpawnPotentials"); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound); + } + + /** + * Called when a client event is received with the event number and argument, see World.sendClientEvent + */ + public boolean receiveClientEvent(int id, int type) + { + return this.field_145882_a.setDelayToMin(id) ? true : super.receiveClientEvent(id, type); + } + + public MobSpawnerBaseLogic func_145881_a() + { + return this.field_145882_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityNote.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityNote.java new file mode 100644 index 0000000..a7ea162 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityNote.java @@ -0,0 +1,82 @@ +package net.minecraft.tileentity; + +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class TileEntityNote extends TileEntity +{ + /** Note to play */ + public byte note; + /** stores the latest redstone state */ + public boolean previousRedstoneState; + private static final String __OBFID = "CL_00000362"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setByte("note", this.note); + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.note = compound.getByte("note"); + + if (this.note < 0) + { + this.note = 0; + } + + if (this.note > 24) + { + this.note = 24; + } + } + + /** + * change pitch by -> (currentPitch + 1) % 25 + */ + public void changePitch() + { + byte old = note; + this.note = (byte)((this.note + 1) % 25); + if (!net.minecraftforge.common.ForgeHooks.onNoteChange(this, old)) return; + this.markDirty(); + } + + /** + * plays the stored note + */ + public void triggerNote(World p_145878_1_, int p_145878_2_, int p_145878_3_, int p_145878_4_) + { + if (p_145878_1_.getBlock(p_145878_2_, p_145878_3_ + 1, p_145878_4_).getMaterial() == Material.air) + { + Material material = p_145878_1_.getBlock(p_145878_2_, p_145878_3_ - 1, p_145878_4_).getMaterial(); + byte b0 = 0; + + if (material == Material.rock) + { + b0 = 1; + } + + if (material == Material.sand) + { + b0 = 2; + } + + if (material == Material.glass) + { + b0 = 3; + } + + if (material == Material.wood) + { + b0 = 4; + } + + p_145878_1_.addBlockEvent(p_145878_2_, p_145878_3_, p_145878_4_, Blocks.noteblock, b0, this.note); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityPiston.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityPiston.java new file mode 100644 index 0000000..b6f2051 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntityPiston.java @@ -0,0 +1,201 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Facing; + +public class TileEntityPiston extends TileEntity +{ + private Block storedBlock; + private int storedMetadata; + /** the side the front of the piston is on */ + private int storedOrientation; + /** if this piston is extending or not */ + private boolean extending; + private boolean shouldHeadBeRendered; + private float progress; + /** the progress in (de)extending */ + private float lastProgress; + private List pushedObjects = new ArrayList(); + private static final String __OBFID = "CL_00000369"; + + public TileEntityPiston() {} + + public TileEntityPiston(Block p_i45444_1_, int p_i45444_2_, int p_i45444_3_, boolean p_i45444_4_, boolean p_i45444_5_) + { + this.storedBlock = p_i45444_1_; + this.storedMetadata = p_i45444_2_; + this.storedOrientation = p_i45444_3_; + this.extending = p_i45444_4_; + this.shouldHeadBeRendered = p_i45444_5_; + } + + public Block getStoredBlockID() + { + return this.storedBlock; + } + + public int getBlockMetadata() + { + return this.storedMetadata; + } + + /** + * Returns true if a piston is extending + */ + public boolean isExtending() + { + return this.extending; + } + + public int getPistonOrientation() + { + return this.storedOrientation; + } + + @SideOnly(Side.CLIENT) + public boolean func_145867_d() + { + return this.shouldHeadBeRendered; + } + + public float func_145860_a(float p_145860_1_) + { + if (p_145860_1_ > 1.0F) + { + p_145860_1_ = 1.0F; + } + + return this.lastProgress + (this.progress - this.lastProgress) * p_145860_1_; + } + + private void func_145863_a(float p_145863_1_, float p_145863_2_) + { + if (this.extending) + { + p_145863_1_ = 1.0F - p_145863_1_; + } + else + { + --p_145863_1_; + } + + AxisAlignedBB axisalignedbb = Blocks.piston_extension.func_149964_a(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.storedBlock, p_145863_1_, this.storedOrientation); + + if (axisalignedbb != null) + { + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb); + + if (!list.isEmpty()) + { + this.pushedObjects.addAll(list); + Iterator iterator = this.pushedObjects.iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + entity.moveEntity((double)(p_145863_2_ * (float)Facing.offsetsXForSide[this.storedOrientation]), (double)(p_145863_2_ * (float)Facing.offsetsYForSide[this.storedOrientation]), (double)(p_145863_2_ * (float)Facing.offsetsZForSide[this.storedOrientation])); + } + + this.pushedObjects.clear(); + } + } + } + + @SideOnly(Side.CLIENT) + public float func_145865_b(float p_145865_1_) + { + return this.extending ? (this.func_145860_a(p_145865_1_) - 1.0F) * (float)Facing.offsetsXForSide[this.storedOrientation] : (1.0F - this.func_145860_a(p_145865_1_)) * (float)Facing.offsetsXForSide[this.storedOrientation]; + } + + @SideOnly(Side.CLIENT) + public float func_145862_c(float p_145862_1_) + { + return this.extending ? (this.func_145860_a(p_145862_1_) - 1.0F) * (float)Facing.offsetsYForSide[this.storedOrientation] : (1.0F - this.func_145860_a(p_145862_1_)) * (float)Facing.offsetsYForSide[this.storedOrientation]; + } + + @SideOnly(Side.CLIENT) + public float func_145859_d(float p_145859_1_) + { + return this.extending ? (this.func_145860_a(p_145859_1_) - 1.0F) * (float)Facing.offsetsZForSide[this.storedOrientation] : (1.0F - this.func_145860_a(p_145859_1_)) * (float)Facing.offsetsZForSide[this.storedOrientation]; + } + + /** + * removes a piston's tile entity (and if the piston is moving, stops it) + */ + public void clearPistonTileEntity() + { + if (this.lastProgress < 1.0F && this.worldObj != null) + { + this.lastProgress = this.progress = 1.0F; + this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord); + this.invalidate(); + + if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) == Blocks.piston_extension) + { + this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, this.storedBlock, this.storedMetadata, 3); + this.worldObj.notifyBlockOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.storedBlock); + } + } + } + + public void updateEntity() + { + this.lastProgress = this.progress; + + if (this.lastProgress >= 1.0F) + { + this.func_145863_a(1.0F, 0.25F); + this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord); + this.invalidate(); + + if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) == Blocks.piston_extension) + { + this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, this.storedBlock, this.storedMetadata, 3); + this.worldObj.notifyBlockOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.storedBlock); + } + } + else + { + this.progress += 0.5F; + + if (this.progress >= 1.0F) + { + this.progress = 1.0F; + } + + if (this.extending) + { + this.func_145863_a(this.progress, this.progress - this.lastProgress + 0.0625F); + } + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.storedBlock = Block.getBlockById(compound.getInteger("blockId")); + this.storedMetadata = compound.getInteger("blockData"); + this.storedOrientation = compound.getInteger("facing"); + this.lastProgress = this.progress = compound.getFloat("progress"); + this.extending = compound.getBoolean("extending"); + } + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setInteger("blockId", Block.getIdFromBlock(this.storedBlock)); + compound.setInteger("blockData", this.storedMetadata); + compound.setInteger("facing", this.storedOrientation); + compound.setFloat("progress", this.lastProgress); + compound.setBoolean("extending", this.extending); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySign.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySign.java new file mode 100644 index 0000000..c0b33a8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySign.java @@ -0,0 +1,86 @@ +package net.minecraft.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S33PacketUpdateSign; + +public class TileEntitySign extends TileEntity +{ + /** An array of four strings storing the lines of text on the sign. */ + public String[] signText = new String[] {"", "", "", ""}; + /** + * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only + * really used when the > < are going to be visible. + */ + public int lineBeingEdited = -1; + private boolean field_145916_j = true; + private EntityPlayer field_145917_k; + private static final String __OBFID = "CL_00000363"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setString("Text1", this.signText[0]); + compound.setString("Text2", this.signText[1]); + compound.setString("Text3", this.signText[2]); + compound.setString("Text4", this.signText[3]); + } + + public void readFromNBT(NBTTagCompound compound) + { + this.field_145916_j = false; + super.readFromNBT(compound); + + for (int i = 0; i < 4; ++i) + { + this.signText[i] = compound.getString("Text" + (i + 1)); + + if (this.signText[i].length() > 15) + { + this.signText[i] = this.signText[i].substring(0, 15); + } + } + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + String[] astring = new String[4]; + System.arraycopy(this.signText, 0, astring, 0, 4); + return new S33PacketUpdateSign(this.xCoord, this.yCoord, this.zCoord, astring); + } + + public boolean func_145914_a() + { + return this.field_145916_j; + } + + /** + * Sets the sign's isEditable flag to the specified parameter. + */ + @SideOnly(Side.CLIENT) + public void setEditable(boolean p_145913_1_) + { + this.field_145916_j = p_145913_1_; + + if (!p_145913_1_) + { + this.field_145917_k = null; + } + } + + public void func_145912_a(EntityPlayer p_145912_1_) + { + this.field_145917_k = p_145912_1_; + } + + public EntityPlayer func_145911_b() + { + return this.field_145917_k; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySkull.java b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySkull.java new file mode 100644 index 0000000..b464d4f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/tileentity/TileEntitySkull.java @@ -0,0 +1,124 @@ +package net.minecraft.tileentity; + +import com.google.common.collect.Iterables; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.UUID; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StringUtils; + +public class TileEntitySkull extends TileEntity +{ + private int field_145908_a; + private int field_145910_i; + private GameProfile field_152110_j = null; + private static final String __OBFID = "CL_00000364"; + + public void writeToNBT(NBTTagCompound compound) + { + super.writeToNBT(compound); + compound.setByte("SkullType", (byte)(this.field_145908_a & 255)); + compound.setByte("Rot", (byte)(this.field_145910_i & 255)); + + if (this.field_152110_j != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTUtil.func_152460_a(nbttagcompound1, this.field_152110_j); + compound.setTag("Owner", nbttagcompound1); + } + } + + public void readFromNBT(NBTTagCompound compound) + { + super.readFromNBT(compound); + this.field_145908_a = compound.getByte("SkullType"); + this.field_145910_i = compound.getByte("Rot"); + + if (this.field_145908_a == 3) + { + if (compound.hasKey("Owner", 10)) + { + this.field_152110_j = NBTUtil.func_152459_a(compound.getCompoundTag("Owner")); + } + else if (compound.hasKey("ExtraType", 8) && !StringUtils.isNullOrEmpty(compound.getString("ExtraType"))) + { + this.field_152110_j = new GameProfile((UUID)null, compound.getString("ExtraType")); + this.func_152109_d(); + } + } + } + + public GameProfile func_152108_a() + { + return this.field_152110_j; + } + + /** + * Overriden in a sign to provide the text. + */ + public Packet getDescriptionPacket() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.writeToNBT(nbttagcompound); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, nbttagcompound); + } + + public void func_152107_a(int p_152107_1_) + { + this.field_145908_a = p_152107_1_; + this.field_152110_j = null; + } + + public void func_152106_a(GameProfile p_152106_1_) + { + this.field_145908_a = 3; + this.field_152110_j = p_152106_1_; + this.func_152109_d(); + } + + private void func_152109_d() + { + if (this.field_152110_j != null && !StringUtils.isNullOrEmpty(this.field_152110_j.getName())) + { + if (!this.field_152110_j.isComplete() || !this.field_152110_j.getProperties().containsKey("textures")) + { + GameProfile gameprofile = MinecraftServer.getServer().func_152358_ax().func_152655_a(this.field_152110_j.getName()); + + if (gameprofile != null) + { + Property property = (Property)Iterables.getFirst(gameprofile.getProperties().get("textures"), (Object)null); + + if (property == null) + { + gameprofile = MinecraftServer.getServer().func_147130_as().fillProfileProperties(gameprofile, true); + } + + this.field_152110_j = gameprofile; + this.markDirty(); + } + } + } + } + + public int func_145904_a() + { + return this.field_145908_a; + } + + public void func_145903_a(int p_145903_1_) + { + this.field_145910_i = p_145903_1_; + } + + @SideOnly(Side.CLIENT) + public int func_145906_b() + { + return this.field_145910_i; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/AxisAlignedBB.java b/build/rfg/minecraft-src/java/net/minecraft/util/AxisAlignedBB.java new file mode 100644 index 0000000..f282b61 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/AxisAlignedBB.java @@ -0,0 +1,480 @@ +package net.minecraft.util; + +public class AxisAlignedBB +{ + public double minX; + public double minY; + public double minZ; + public double maxX; + public double maxY; + public double maxZ; + private static final String __OBFID = "CL_00000607"; + + /** + * Returns a bounding box with the specified bounds. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public static AxisAlignedBB getBoundingBox(double x1, double y1, double z1, double x2, double y2, double z2) + { + return new AxisAlignedBB(x1, y1, z1, x2, y2, z2); + } + + protected AxisAlignedBB(double x1, double y1, double z1, double x2, double y2, double z2) + { + this.minX = x1; + this.minY = y1; + this.minZ = z1; + this.maxX = x2; + this.maxY = y2; + this.maxZ = z2; + } + + /** + * Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public AxisAlignedBB setBounds(double x1, double y1, double z1, double x2, double y2, double z2) + { + this.minX = x1; + this.minY = y1; + this.minZ = z1; + this.maxX = x2; + this.maxY = y2; + this.maxZ = z2; + return this; + } + + /** + * Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z + */ + public AxisAlignedBB addCoord(double x, double y, double z) + { + double d3 = this.minX; + double d4 = this.minY; + double d5 = this.minZ; + double d6 = this.maxX; + double d7 = this.maxY; + double d8 = this.maxZ; + + if (x < 0.0D) + { + d3 += x; + } + + if (x > 0.0D) + { + d6 += x; + } + + if (y < 0.0D) + { + d4 += y; + } + + if (y > 0.0D) + { + d7 += y; + } + + if (z < 0.0D) + { + d5 += z; + } + + if (z > 0.0D) + { + d8 += z; + } + + return getBoundingBox(d3, d4, d5, d6, d7, d8); + } + + /** + * Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x, + * y, z + */ + public AxisAlignedBB expand(double x, double y, double z) + { + double d3 = this.minX - x; + double d4 = this.minY - y; + double d5 = this.minZ - z; + double d6 = this.maxX + x; + double d7 = this.maxY + y; + double d8 = this.maxZ + z; + return getBoundingBox(d3, d4, d5, d6, d7, d8); + } + + public AxisAlignedBB func_111270_a(AxisAlignedBB other) + { + double d0 = Math.min(this.minX, other.minX); + double d1 = Math.min(this.minY, other.minY); + double d2 = Math.min(this.minZ, other.minZ); + double d3 = Math.max(this.maxX, other.maxX); + double d4 = Math.max(this.maxY, other.maxY); + double d5 = Math.max(this.maxZ, other.maxZ); + return getBoundingBox(d0, d1, d2, d3, d4, d5); + } + + /** + * Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x, + * y, z + */ + public AxisAlignedBB getOffsetBoundingBox(double x, double y, double z) + { + return getBoundingBox(this.minX + x, this.minY + y, this.minZ + z, this.maxX + x, this.maxY + y, this.maxZ + z); + } + + /** + * if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them + * in the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateXOffset(AxisAlignedBB other, double p_72316_2_) + { + if (other.maxY > this.minY && other.minY < this.maxY) + { + if (other.maxZ > this.minZ && other.minZ < this.maxZ) + { + double d1; + + if (p_72316_2_ > 0.0D && other.maxX <= this.minX) + { + d1 = this.minX - other.maxX; + + if (d1 < p_72316_2_) + { + p_72316_2_ = d1; + } + } + + if (p_72316_2_ < 0.0D && other.minX >= this.maxX) + { + d1 = this.maxX - other.minX; + + if (d1 > p_72316_2_) + { + p_72316_2_ = d1; + } + } + + return p_72316_2_; + } + else + { + return p_72316_2_; + } + } + else + { + return p_72316_2_; + } + } + + /** + * if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them + * in the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateYOffset(AxisAlignedBB other, double p_72323_2_) + { + if (other.maxX > this.minX && other.minX < this.maxX) + { + if (other.maxZ > this.minZ && other.minZ < this.maxZ) + { + double d1; + + if (p_72323_2_ > 0.0D && other.maxY <= this.minY) + { + d1 = this.minY - other.maxY; + + if (d1 < p_72323_2_) + { + p_72323_2_ = d1; + } + } + + if (p_72323_2_ < 0.0D && other.minY >= this.maxY) + { + d1 = this.maxY - other.minY; + + if (d1 > p_72323_2_) + { + p_72323_2_ = d1; + } + } + + return p_72323_2_; + } + else + { + return p_72323_2_; + } + } + else + { + return p_72323_2_; + } + } + + /** + * if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them + * in the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the + * calculated offset. Otherwise return the calculated offset. + */ + public double calculateZOffset(AxisAlignedBB other, double p_72322_2_) + { + if (other.maxX > this.minX && other.minX < this.maxX) + { + if (other.maxY > this.minY && other.minY < this.maxY) + { + double d1; + + if (p_72322_2_ > 0.0D && other.maxZ <= this.minZ) + { + d1 = this.minZ - other.maxZ; + + if (d1 < p_72322_2_) + { + p_72322_2_ = d1; + } + } + + if (p_72322_2_ < 0.0D && other.minZ >= this.maxZ) + { + d1 = this.maxZ - other.minZ; + + if (d1 > p_72322_2_) + { + p_72322_2_ = d1; + } + } + + return p_72322_2_; + } + else + { + return p_72322_2_; + } + } + else + { + return p_72322_2_; + } + } + + /** + * Returns whether the given bounding box intersects with this one. Args: axisAlignedBB + */ + public boolean intersectsWith(AxisAlignedBB other) + { + return other.maxX > this.minX && other.minX < this.maxX ? (other.maxY > this.minY && other.minY < this.maxY ? other.maxZ > this.minZ && other.minZ < this.maxZ : false) : false; + } + + /** + * Offsets the current bounding box by the specified coordinates. Args: x, y, z + */ + public AxisAlignedBB offset(double x, double y, double z) + { + this.minX += x; + this.minY += y; + this.minZ += z; + this.maxX += x; + this.maxY += y; + this.maxZ += z; + return this; + } + + /** + * Returns if the supplied Vec3D is completely inside the bounding box + */ + public boolean isVecInside(Vec3 vec) + { + return vec.xCoord > this.minX && vec.xCoord < this.maxX ? (vec.yCoord > this.minY && vec.yCoord < this.maxY ? vec.zCoord > this.minZ && vec.zCoord < this.maxZ : false) : false; + } + + /** + * Returns the average length of the edges of the bounding box. + */ + public double getAverageEdgeLength() + { + double d0 = this.maxX - this.minX; + double d1 = this.maxY - this.minY; + double d2 = this.maxZ - this.minZ; + return (d0 + d1 + d2) / 3.0D; + } + + /** + * Returns a bounding box that is inset by the specified amounts + */ + public AxisAlignedBB contract(double x, double y, double z) + { + double d3 = this.minX + x; + double d4 = this.minY + y; + double d5 = this.minZ + z; + double d6 = this.maxX - x; + double d7 = this.maxY - y; + double d8 = this.maxZ - z; + return getBoundingBox(d3, d4, d5, d6, d7, d8); + } + + /** + * Returns a copy of the bounding box. + */ + public AxisAlignedBB copy() + { + return getBoundingBox(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); + } + + public MovingObjectPosition calculateIntercept(Vec3 p_72327_1_, Vec3 p_72327_2_) + { + Vec3 vec32 = p_72327_1_.getIntermediateWithXValue(p_72327_2_, this.minX); + Vec3 vec33 = p_72327_1_.getIntermediateWithXValue(p_72327_2_, this.maxX); + Vec3 vec34 = p_72327_1_.getIntermediateWithYValue(p_72327_2_, this.minY); + Vec3 vec35 = p_72327_1_.getIntermediateWithYValue(p_72327_2_, this.maxY); + Vec3 vec36 = p_72327_1_.getIntermediateWithZValue(p_72327_2_, this.minZ); + Vec3 vec37 = p_72327_1_.getIntermediateWithZValue(p_72327_2_, this.maxZ); + + if (!this.isVecInYZ(vec32)) + { + vec32 = null; + } + + if (!this.isVecInYZ(vec33)) + { + vec33 = null; + } + + if (!this.isVecInXZ(vec34)) + { + vec34 = null; + } + + if (!this.isVecInXZ(vec35)) + { + vec35 = null; + } + + if (!this.isVecInXY(vec36)) + { + vec36 = null; + } + + if (!this.isVecInXY(vec37)) + { + vec37 = null; + } + + Vec3 vec38 = null; + + if (vec32 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec32) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec32; + } + + if (vec33 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec33) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec33; + } + + if (vec34 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec34) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec34; + } + + if (vec35 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec35) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec35; + } + + if (vec36 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec36) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec36; + } + + if (vec37 != null && (vec38 == null || p_72327_1_.squareDistanceTo(vec37) < p_72327_1_.squareDistanceTo(vec38))) + { + vec38 = vec37; + } + + if (vec38 == null) + { + return null; + } + else + { + byte b0 = -1; + + if (vec38 == vec32) + { + b0 = 4; + } + + if (vec38 == vec33) + { + b0 = 5; + } + + if (vec38 == vec34) + { + b0 = 0; + } + + if (vec38 == vec35) + { + b0 = 1; + } + + if (vec38 == vec36) + { + b0 = 2; + } + + if (vec38 == vec37) + { + b0 = 3; + } + + return new MovingObjectPosition(0, 0, 0, b0, vec38); + } + } + + /** + * Checks if the specified vector is within the YZ dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInYZ(Vec3 vec) + { + return vec == null ? false : vec.yCoord >= this.minY && vec.yCoord <= this.maxY && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ; + } + + /** + * Checks if the specified vector is within the XZ dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInXZ(Vec3 vec) + { + return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.zCoord >= this.minZ && vec.zCoord <= this.maxZ; + } + + /** + * Checks if the specified vector is within the XY dimensions of the bounding box. Args: Vec3D + */ + private boolean isVecInXY(Vec3 vec) + { + return vec == null ? false : vec.xCoord >= this.minX && vec.xCoord <= this.maxX && vec.yCoord >= this.minY && vec.yCoord <= this.maxY; + } + + /** + * Sets the bounding box to the same bounds as the bounding box passed in. Args: axisAlignedBB + */ + public void setBB(AxisAlignedBB other) + { + this.minX = other.minX; + this.minY = other.minY; + this.minZ = other.minZ; + this.maxX = other.maxX; + this.maxY = other.maxY; + this.maxZ = other.maxZ; + } + + public String toString() + { + return "box[" + this.minX + ", " + this.minY + ", " + this.minZ + " -> " + this.maxX + ", " + this.maxY + ", " + this.maxZ + "]"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatAllowedCharacters.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatAllowedCharacters.java new file mode 100644 index 0000000..72870b5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatAllowedCharacters.java @@ -0,0 +1,35 @@ +package net.minecraft.util; + +public class ChatAllowedCharacters +{ + /** Array of the special characters that are allowed in any text drawing of Minecraft. */ + public static final char[] allowedCharacters = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; + private static final String __OBFID = "CL_00001606"; + + public static boolean isAllowedCharacter(char character) + { + return character != 167 && character >= 32 && character != 127; + } + + /** + * Filter string by only keeping those characters for which isAllowedCharacter() returns true. + */ + public static String filerAllowedCharacters(String input) + { + StringBuilder stringbuilder = new StringBuilder(); + char[] achar = input.toCharArray(); + int i = achar.length; + + for (int j = 0; j < i; ++j) + { + char c0 = achar[j]; + + if (isAllowedCharacter(c0)) + { + stringbuilder.append(c0); + } + } + + return stringbuilder.toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentStyle.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentStyle.java new file mode 100644 index 0000000..a973a20 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentStyle.java @@ -0,0 +1,182 @@ +package net.minecraft.util; + +import com.google.common.base.Function; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Iterator; +import java.util.List; + +public abstract class ChatComponentStyle implements IChatComponent +{ + /** + * The later siblings of this component. If this component turns the text bold, that will apply to all the siblings + * until a later sibling turns the text something else. + */ + protected List siblings = Lists.newArrayList(); + private ChatStyle style; + private static final String __OBFID = "CL_00001257"; + + /** + * Appends the given component to the end of this one. + */ + public IChatComponent appendSibling(IChatComponent component) + { + component.getChatStyle().setParentStyle(this.getChatStyle()); + this.siblings.add(component); + return this; + } + + /** + * Gets the sibling components of this one. + */ + public List getSiblings() + { + return this.siblings; + } + + /** + * Appends the given text to the end of this component. + */ + public IChatComponent appendText(String text) + { + return this.appendSibling(new ChatComponentText(text)); + } + + public IChatComponent setChatStyle(ChatStyle style) + { + this.style = style; + Iterator iterator = this.siblings.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + ichatcomponent.getChatStyle().setParentStyle(this.getChatStyle()); + } + + return this; + } + + public ChatStyle getChatStyle() + { + if (this.style == null) + { + this.style = new ChatStyle(); + Iterator iterator = this.siblings.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + ichatcomponent.getChatStyle().setParentStyle(this.style); + } + } + + return this.style; + } + + public Iterator iterator() + { + return Iterators.concat(Iterators.forArray(new ChatComponentStyle[] {this}), createDeepCopyIterator(this.siblings)); + } + + /** + * Gets the text of this component, without any special formatting codes added. TODO: why is this two different + * methods? + */ + public final String getUnformattedText() + { + StringBuilder stringbuilder = new StringBuilder(); + Iterator iterator = this.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + /** + * Gets the text of this component, with formatting codes added for rendering. + */ + @SideOnly(Side.CLIENT) + public final String getFormattedText() + { + StringBuilder stringbuilder = new StringBuilder(); + Iterator iterator = this.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + stringbuilder.append(ichatcomponent.getChatStyle().getFormattingCode()); + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + stringbuilder.append(EnumChatFormatting.RESET); + } + + return stringbuilder.toString(); + } + + /** + * Creates an iterator that iterates over the given components, returning deep copies of each component in turn so + * that the properties of the returned objects will remain externally consistent after being returned. + */ + public static Iterator createDeepCopyIterator(Iterable components) + { + Iterator iterator = Iterators.concat(Iterators.transform(components.iterator(), new Function() + { + private static final String __OBFID = "CL_00001258"; + public Iterator apply(IChatComponent p_apply_1_) + { + return p_apply_1_.iterator(); + } + public Object apply(Object p_apply_1_) + { + return this.apply((IChatComponent)p_apply_1_); + } + })); + iterator = Iterators.transform(iterator, new Function() + { + private static final String __OBFID = "CL_00001259"; + public IChatComponent apply(IChatComponent p_apply_1_) + { + IChatComponent ichatcomponent1 = p_apply_1_.createCopy(); + ichatcomponent1.setChatStyle(ichatcomponent1.getChatStyle().createDeepCopy()); + return ichatcomponent1; + } + public Object apply(Object p_apply_1_) + { + return this.apply((IChatComponent)p_apply_1_); + } + }); + return iterator; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentStyle)) + { + return false; + } + else + { + ChatComponentStyle chatcomponentstyle = (ChatComponentStyle)p_equals_1_; + return this.siblings.equals(chatcomponentstyle.siblings) && this.getChatStyle().equals(chatcomponentstyle.getChatStyle()); + } + } + + public int hashCode() + { + return 31 * this.style.hashCode() + this.siblings.hashCode(); + } + + public String toString() + { + return "BaseComponent{style=" + this.style + ", siblings=" + this.siblings + '}'; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentText.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentText.java new file mode 100644 index 0000000..f6094c1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentText.java @@ -0,0 +1,72 @@ +package net.minecraft.util; + +import java.util.Iterator; + +public class ChatComponentText extends ChatComponentStyle +{ + private final String text; + private static final String __OBFID = "CL_00001269"; + + public ChatComponentText(String msg) + { + this.text = msg; + } + + /** + * Gets the text value of this ChatComponentText. TODO: what are getUnformattedText and getUnformattedTextForChat + * missing that made someone decide to create a third equivalent method that only ChatComponentText can implement? + */ + public String getChatComponentText_TextValue() + { + return this.text; + } + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() + { + return this.text; + } + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + public ChatComponentText createCopy() + { + ChatComponentText chatcomponenttext = new ChatComponentText(this.text); + chatcomponenttext.setChatStyle(this.getChatStyle().createShallowCopy()); + Iterator iterator = this.getSiblings().iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + chatcomponenttext.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttext; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentText)) + { + return false; + } + else + { + ChatComponentText chatcomponenttext = (ChatComponentText)p_equals_1_; + return this.text.equals(chatcomponenttext.getChatComponentText_TextValue()) && super.equals(p_equals_1_); + } + } + + public String toString() + { + return "TextComponent{text=\'" + this.text + '\'' + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslation.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslation.java new file mode 100644 index 0000000..2e5a484 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslation.java @@ -0,0 +1,296 @@ +package net.minecraft.util; + +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.Arrays; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ChatComponentTranslation extends ChatComponentStyle +{ + private final String key; + private final Object[] formatArgs; + private final Object syncLock = new Object(); + private long lastTranslationUpdateTimeInMilliseconds = -1L; + /** + * The discrete elements that make up this component. For example, this would be ["Prefix, ", "FirstArg", + * "SecondArg", " again ", "SecondArg", " and ", "FirstArg", " lastly ", "ThirdArg", " and also ", "FirstArg", " + * again!"] for "translation.test.complex" (see en-US.lang) + */ + List children = Lists.newArrayList(); + public static final Pattern stringVariablePattern = Pattern.compile("%(?:(\\d+)\\$)?([A-Za-z%]|$)"); + private static final String __OBFID = "CL_00001270"; + + public ChatComponentTranslation(String translationKey, Object ... args) + { + this.key = translationKey; + this.formatArgs = args; + Object[] aobject = args; + int i = args.length; + + for (int j = 0; j < i; ++j) + { + Object object1 = aobject[j]; + + if (object1 instanceof IChatComponent) + { + ((IChatComponent)object1).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + } + + /** + * ensures that our children are initialized from the most recent string translation mapping. + */ + synchronized void ensureInitialized() + { + Object object = this.syncLock; + + synchronized (this.syncLock) + { + long i = StatCollector.getLastTranslationUpdateTimeInMilliseconds(); + + if (i == this.lastTranslationUpdateTimeInMilliseconds) + { + return; + } + + this.lastTranslationUpdateTimeInMilliseconds = i; + this.children.clear(); + } + + try + { + this.initializeFromFormat(StatCollector.translateToLocal(this.key)); + } + catch (ChatComponentTranslationFormatException chatcomponenttranslationformatexception1) + { + this.children.clear(); + + try + { + this.initializeFromFormat(StatCollector.translateToFallback(this.key)); + } + catch (ChatComponentTranslationFormatException chatcomponenttranslationformatexception) + { + throw chatcomponenttranslationformatexception1; + } + } + } + + /** + * initializes our children from a format string, using the format args to fill in the placeholder variables. + */ + protected void initializeFromFormat(String format) + { + boolean flag = false; + Matcher matcher = stringVariablePattern.matcher(format); + int i = 0; + int j = 0; + + try + { + int l; + + for (; matcher.find(j); j = l) + { + int k = matcher.start(); + l = matcher.end(); + + if (k > j) + { + ChatComponentText chatcomponenttext = new ChatComponentText(String.format(format.substring(j, k), new Object[0])); + chatcomponenttext.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext); + } + + String s3 = matcher.group(2); + String s1 = format.substring(k, l); + + if ("%".equals(s3) && "%%".equals(s1)) + { + ChatComponentText chatcomponenttext2 = new ChatComponentText("%"); + chatcomponenttext2.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext2); + } + else + { + if (!"s".equals(s3)) + { + throw new ChatComponentTranslationFormatException(this, "Unsupported format: \'" + s1 + "\'"); + } + + String s2 = matcher.group(1); + int i1 = s2 != null ? Integer.parseInt(s2) - 1 : i++; + this.children.add(this.getFormatArgumentAsComponent(i1)); + } + } + + if (j < format.length()) + { + ChatComponentText chatcomponenttext1 = new ChatComponentText(String.format(format.substring(j), new Object[0])); + chatcomponenttext1.getChatStyle().setParentStyle(this.getChatStyle()); + this.children.add(chatcomponenttext1); + } + } + catch (IllegalFormatException illegalformatexception) + { + throw new ChatComponentTranslationFormatException(this, illegalformatexception); + } + } + + private IChatComponent getFormatArgumentAsComponent(int index) + { + if (index >= this.formatArgs.length) + { + throw new ChatComponentTranslationFormatException(this, index); + } + else + { + Object object = this.formatArgs[index]; + Object object1; + + if (object instanceof IChatComponent) + { + object1 = (IChatComponent)object; + } + else + { + object1 = new ChatComponentText(object == null ? "null" : object.toString()); + ((IChatComponent)object1).getChatStyle().setParentStyle(this.getChatStyle()); + } + + return (IChatComponent)object1; + } + } + + public IChatComponent setChatStyle(ChatStyle style) + { + super.setChatStyle(style); + Object[] aobject = this.formatArgs; + int i = aobject.length; + + for (int j = 0; j < i; ++j) + { + Object object = aobject[j]; + + if (object instanceof IChatComponent) + { + ((IChatComponent)object).getChatStyle().setParentStyle(this.getChatStyle()); + } + } + + if (this.lastTranslationUpdateTimeInMilliseconds > -1L) + { + Iterator iterator = this.children.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + ichatcomponent.getChatStyle().setParentStyle(style); + } + } + + return this; + } + + public Iterator iterator() + { + this.ensureInitialized(); + return Iterators.concat(createDeepCopyIterator(this.children), createDeepCopyIterator(this.siblings)); + } + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + public String getUnformattedTextForChat() + { + this.ensureInitialized(); + StringBuilder stringbuilder = new StringBuilder(); + Iterator iterator = this.children.iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + stringbuilder.append(ichatcomponent.getUnformattedTextForChat()); + } + + return stringbuilder.toString(); + } + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + public ChatComponentTranslation createCopy() + { + Object[] aobject = new Object[this.formatArgs.length]; + + for (int i = 0; i < this.formatArgs.length; ++i) + { + if (this.formatArgs[i] instanceof IChatComponent) + { + aobject[i] = ((IChatComponent)this.formatArgs[i]).createCopy(); + } + else + { + aobject[i] = this.formatArgs[i]; + } + } + + ChatComponentTranslation chatcomponenttranslation = new ChatComponentTranslation(this.key, aobject); + chatcomponenttranslation.setChatStyle(this.getChatStyle().createShallowCopy()); + Iterator iterator = this.getSiblings().iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent = (IChatComponent)iterator.next(); + chatcomponenttranslation.appendSibling(ichatcomponent.createCopy()); + } + + return chatcomponenttranslation; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatComponentTranslation)) + { + return false; + } + else + { + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation)p_equals_1_; + return Arrays.equals(this.formatArgs, chatcomponenttranslation.formatArgs) && this.key.equals(chatcomponenttranslation.key) && super.equals(p_equals_1_); + } + } + + public int hashCode() + { + int i = super.hashCode(); + i = 31 * i + this.key.hashCode(); + i = 31 * i + Arrays.hashCode(this.formatArgs); + return i; + } + + public String toString() + { + return "TranslatableComponent{key=\'" + this.key + '\'' + ", args=" + Arrays.toString(this.formatArgs) + ", siblings=" + this.siblings + ", style=" + this.getChatStyle() + '}'; + } + + public String getKey() + { + return this.key; + } + + public Object[] getFormatArgs() + { + return this.formatArgs; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslationFormatException.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslationFormatException.java new file mode 100644 index 0000000..38ea216 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatComponentTranslationFormatException.java @@ -0,0 +1,21 @@ +package net.minecraft.util; + +public class ChatComponentTranslationFormatException extends IllegalArgumentException +{ + private static final String __OBFID = "CL_00001271"; + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, String message) + { + super(String.format("Error parsing: %s: %s", new Object[] {component, message})); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, int index) + { + super(String.format("Invalid index %d requested for %s", new Object[] {Integer.valueOf(index), component})); + } + + public ChatComponentTranslationFormatException(ChatComponentTranslation component, Throwable cause) + { + super(String.format("Error while parsing: %s", new Object[] {component}), cause); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChatStyle.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChatStyle.java new file mode 100644 index 0000000..2e9abab --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChatStyle.java @@ -0,0 +1,676 @@ +package net.minecraft.util; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; + +public class ChatStyle +{ + /** The parent of this ChatStyle. Used for looking up values that this instance does not override. */ + private ChatStyle parentStyle; + private EnumChatFormatting color; + private Boolean bold; + private Boolean italic; + private Boolean underlined; + private Boolean strikethrough; + private Boolean obfuscated; + private ClickEvent chatClickEvent; + private HoverEvent chatHoverEvent; + /** The base of the ChatStyle hierarchy. All ChatStyle instances are implicitly children of this. */ + private static final ChatStyle rootStyle = new ChatStyle() + { + private static final String __OBFID = "CL_00001267"; + /** + * Gets the effective color of this ChatStyle. + */ + public EnumChatFormatting getColor() + { + return null; + } + /** + * Whether or not text of this ChatStyle should be in bold. + */ + public boolean getBold() + { + return false; + } + /** + * Whether or not text of this ChatStyle should be italicized. + */ + public boolean getItalic() + { + return false; + } + /** + * Whether or not to format text of this ChatStyle using strikethrough. + */ + public boolean getStrikethrough() + { + return false; + } + /** + * Whether or not text of this ChatStyle should be underlined. + */ + public boolean getUnderlined() + { + return false; + } + /** + * Whether or not text of this ChatStyle should be obfuscated. + */ + public boolean getObfuscated() + { + return false; + } + /** + * The effective chat click event. + */ + public ClickEvent getChatClickEvent() + { + return null; + } + /** + * The effective chat hover event. + */ + public HoverEvent getChatHoverEvent() + { + return null; + } + /** + * Sets the color for this ChatStyle to the given value. Only use color values for this; set other values using + * the specific methods. + */ + public ChatStyle setColor(EnumChatFormatting colorIn) + { + throw new UnsupportedOperationException(); + } + /** + * Sets whether or not text of this ChatStyle should be in bold. Set to false if, e.g., the parent style is + * bold and you want text of this style to be unbolded. + */ + public ChatStyle setBold(Boolean p_150227_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets whether or not text of this ChatStyle should be italicized. Set to false if, e.g., the parent style is + * italicized and you want to override that for this style. + */ + public ChatStyle setItalic(Boolean p_150217_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets whether or not to format text of this ChatStyle using strikethrough. Set to false if, e.g., the parent + * style uses strikethrough and you want to override that for this style. + */ + public ChatStyle setStrikethrough(Boolean p_150225_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets whether or not text of this ChatStyle should be underlined. Set to false if, e.g., the parent style is + * underlined and you want to override that for this style. + */ + public ChatStyle setUnderlined(Boolean p_150228_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets whether or not text of this ChatStyle should be obfuscated. Set to false if, e.g., the parent style is + * obfuscated and you want to override that for this style. + */ + public ChatStyle setObfuscated(Boolean p_150237_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets the event that should be run when text of this ChatStyle is clicked on. + */ + public ChatStyle setChatClickEvent(ClickEvent p_150241_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets the event that should be run when text of this ChatStyle is hovered over. + */ + public ChatStyle setChatHoverEvent(HoverEvent p_150209_1_) + { + throw new UnsupportedOperationException(); + } + /** + * Sets the fallback ChatStyle to use if this ChatStyle does not override some value. Without a parent, obvious + * defaults are used (bold: false, underlined: false, etc). + */ + public ChatStyle setParentStyle(ChatStyle p_150221_1_) + { + throw new UnsupportedOperationException(); + } + public String toString() + { + return "Style.ROOT"; + } + /** + * Creates a shallow copy of this style. Changes to this instance's values will not be reflected in the copy, + * but changes to the parent style's values WILL be reflected in both this instance and the copy, wherever + * either does not override a value. + */ + public ChatStyle createShallowCopy() + { + return this; + } + /** + * Creates a deep copy of this style. No changes to this instance or its parent style will be reflected in the + * copy. + */ + public ChatStyle createDeepCopy() + { + return this; + } + /** + * Gets the equivalent text formatting code for this style, without the initial section sign (U+00A7) character. + */ + @SideOnly(Side.CLIENT) + public String getFormattingCode() + { + return ""; + } + }; + private static final String __OBFID = "CL_00001266"; + + /** + * Gets the effective color of this ChatStyle. + */ + public EnumChatFormatting getColor() + { + return this.color == null ? this.getParent().getColor() : this.color; + } + + /** + * Whether or not text of this ChatStyle should be in bold. + */ + public boolean getBold() + { + return this.bold == null ? this.getParent().getBold() : this.bold.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be italicized. + */ + public boolean getItalic() + { + return this.italic == null ? this.getParent().getItalic() : this.italic.booleanValue(); + } + + /** + * Whether or not to format text of this ChatStyle using strikethrough. + */ + public boolean getStrikethrough() + { + return this.strikethrough == null ? this.getParent().getStrikethrough() : this.strikethrough.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be underlined. + */ + public boolean getUnderlined() + { + return this.underlined == null ? this.getParent().getUnderlined() : this.underlined.booleanValue(); + } + + /** + * Whether or not text of this ChatStyle should be obfuscated. + */ + public boolean getObfuscated() + { + return this.obfuscated == null ? this.getParent().getObfuscated() : this.obfuscated.booleanValue(); + } + + /** + * Whether or not this style is empty (inherits everything from the parent). + */ + public boolean isEmpty() + { + return this.bold == null && this.italic == null && this.strikethrough == null && this.underlined == null && this.obfuscated == null && this.color == null && this.chatClickEvent == null && this.chatHoverEvent == null; + } + + /** + * The effective chat click event. + */ + public ClickEvent getChatClickEvent() + { + return this.chatClickEvent == null ? this.getParent().getChatClickEvent() : this.chatClickEvent; + } + + /** + * The effective chat hover event. + */ + public HoverEvent getChatHoverEvent() + { + return this.chatHoverEvent == null ? this.getParent().getChatHoverEvent() : this.chatHoverEvent; + } + + /** + * Sets the color for this ChatStyle to the given value. Only use color values for this; set other values using the + * specific methods. + */ + public ChatStyle setColor(EnumChatFormatting colorIn) + { + this.color = colorIn; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be in bold. Set to false if, e.g., the parent style is bold + * and you want text of this style to be unbolded. + */ + public ChatStyle setBold(Boolean p_150227_1_) + { + this.bold = p_150227_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be italicized. Set to false if, e.g., the parent style is + * italicized and you want to override that for this style. + */ + public ChatStyle setItalic(Boolean p_150217_1_) + { + this.italic = p_150217_1_; + return this; + } + + /** + * Sets whether or not to format text of this ChatStyle using strikethrough. Set to false if, e.g., the parent + * style uses strikethrough and you want to override that for this style. + */ + public ChatStyle setStrikethrough(Boolean p_150225_1_) + { + this.strikethrough = p_150225_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be underlined. Set to false if, e.g., the parent style is + * underlined and you want to override that for this style. + */ + public ChatStyle setUnderlined(Boolean p_150228_1_) + { + this.underlined = p_150228_1_; + return this; + } + + /** + * Sets whether or not text of this ChatStyle should be obfuscated. Set to false if, e.g., the parent style is + * obfuscated and you want to override that for this style. + */ + public ChatStyle setObfuscated(Boolean p_150237_1_) + { + this.obfuscated = p_150237_1_; + return this; + } + + /** + * Sets the event that should be run when text of this ChatStyle is clicked on. + */ + public ChatStyle setChatClickEvent(ClickEvent p_150241_1_) + { + this.chatClickEvent = p_150241_1_; + return this; + } + + /** + * Sets the event that should be run when text of this ChatStyle is hovered over. + */ + public ChatStyle setChatHoverEvent(HoverEvent p_150209_1_) + { + this.chatHoverEvent = p_150209_1_; + return this; + } + + /** + * Sets the fallback ChatStyle to use if this ChatStyle does not override some value. Without a parent, obvious + * defaults are used (bold: false, underlined: false, etc). + */ + public ChatStyle setParentStyle(ChatStyle p_150221_1_) + { + this.parentStyle = p_150221_1_; + return this; + } + + /** + * Gets the equivalent text formatting code for this style, without the initial section sign (U+00A7) character. + */ + @SideOnly(Side.CLIENT) + public String getFormattingCode() + { + if (this.isEmpty()) + { + return this.parentStyle != null ? this.parentStyle.getFormattingCode() : ""; + } + else + { + StringBuilder stringbuilder = new StringBuilder(); + + if (this.getColor() != null) + { + stringbuilder.append(this.getColor()); + } + + if (this.getBold()) + { + stringbuilder.append(EnumChatFormatting.BOLD); + } + + if (this.getItalic()) + { + stringbuilder.append(EnumChatFormatting.ITALIC); + } + + if (this.getUnderlined()) + { + stringbuilder.append(EnumChatFormatting.UNDERLINE); + } + + if (this.getObfuscated()) + { + stringbuilder.append(EnumChatFormatting.OBFUSCATED); + } + + if (this.getStrikethrough()) + { + stringbuilder.append(EnumChatFormatting.STRIKETHROUGH); + } + + return stringbuilder.toString(); + } + } + + /** + * Gets the immediate parent of this ChatStyle. + */ + private ChatStyle getParent() + { + return this.parentStyle == null ? rootStyle : this.parentStyle; + } + + public String toString() + { + return "Style{hasParent=" + (this.parentStyle != null) + ", color=" + this.color + ", bold=" + this.bold + ", italic=" + this.italic + ", underlined=" + this.underlined + ", obfuscated=" + this.obfuscated + ", clickEvent=" + this.getChatClickEvent() + ", hoverEvent=" + this.getChatHoverEvent() + '}'; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChatStyle)) + { + return false; + } + else + { + ChatStyle chatstyle = (ChatStyle)p_equals_1_; + boolean flag; + + if (this.getBold() == chatstyle.getBold() && this.getColor() == chatstyle.getColor() && this.getItalic() == chatstyle.getItalic() && this.getObfuscated() == chatstyle.getObfuscated() && this.getStrikethrough() == chatstyle.getStrikethrough() && this.getUnderlined() == chatstyle.getUnderlined()) + { + label56: + { + if (this.getChatClickEvent() != null) + { + if (!this.getChatClickEvent().equals(chatstyle.getChatClickEvent())) + { + break label56; + } + } + else if (chatstyle.getChatClickEvent() != null) + { + break label56; + } + + if (this.getChatHoverEvent() != null) + { + if (!this.getChatHoverEvent().equals(chatstyle.getChatHoverEvent())) + { + break label56; + } + } + else if (chatstyle.getChatHoverEvent() != null) + { + break label56; + } + + flag = true; + return flag; + } + } + + flag = false; + return flag; + } + } + + public int hashCode() + { + int i = this.color.hashCode(); + i = 31 * i + this.bold.hashCode(); + i = 31 * i + this.italic.hashCode(); + i = 31 * i + this.underlined.hashCode(); + i = 31 * i + this.strikethrough.hashCode(); + i = 31 * i + this.obfuscated.hashCode(); + i = 31 * i + this.chatClickEvent.hashCode(); + i = 31 * i + this.chatHoverEvent.hashCode(); + return i; + } + + /** + * Creates a shallow copy of this style. Changes to this instance's values will not be reflected in the copy, but + * changes to the parent style's values WILL be reflected in both this instance and the copy, wherever either does + * not override a value. + */ + public ChatStyle createShallowCopy() + { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.bold = this.bold; + chatstyle.italic = this.italic; + chatstyle.strikethrough = this.strikethrough; + chatstyle.underlined = this.underlined; + chatstyle.obfuscated = this.obfuscated; + chatstyle.color = this.color; + chatstyle.chatClickEvent = this.chatClickEvent; + chatstyle.chatHoverEvent = this.chatHoverEvent; + chatstyle.parentStyle = this.parentStyle; + return chatstyle; + } + + /** + * Creates a deep copy of this style. No changes to this instance or its parent style will be reflected in the + * copy. + */ + public ChatStyle createDeepCopy() + { + ChatStyle chatstyle = new ChatStyle(); + chatstyle.setBold(Boolean.valueOf(this.getBold())); + chatstyle.setItalic(Boolean.valueOf(this.getItalic())); + chatstyle.setStrikethrough(Boolean.valueOf(this.getStrikethrough())); + chatstyle.setUnderlined(Boolean.valueOf(this.getUnderlined())); + chatstyle.setObfuscated(Boolean.valueOf(this.getObfuscated())); + chatstyle.setColor(this.getColor()); + chatstyle.setChatClickEvent(this.getChatClickEvent()); + chatstyle.setChatHoverEvent(this.getChatHoverEvent()); + return chatstyle; + } + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final String __OBFID = "CL_00001268"; + + public ChatStyle deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + if (p_deserialize_1_.isJsonObject()) + { + ChatStyle chatstyle = new ChatStyle(); + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + + if (jsonobject == null) + { + return null; + } + else + { + if (jsonobject.has("bold")) + { + chatstyle.bold = Boolean.valueOf(jsonobject.get("bold").getAsBoolean()); + } + + if (jsonobject.has("italic")) + { + chatstyle.italic = Boolean.valueOf(jsonobject.get("italic").getAsBoolean()); + } + + if (jsonobject.has("underlined")) + { + chatstyle.underlined = Boolean.valueOf(jsonobject.get("underlined").getAsBoolean()); + } + + if (jsonobject.has("strikethrough")) + { + chatstyle.strikethrough = Boolean.valueOf(jsonobject.get("strikethrough").getAsBoolean()); + } + + if (jsonobject.has("obfuscated")) + { + chatstyle.obfuscated = Boolean.valueOf(jsonobject.get("obfuscated").getAsBoolean()); + } + + if (jsonobject.has("color")) + { + chatstyle.color = (EnumChatFormatting)p_deserialize_3_.deserialize(jsonobject.get("color"), EnumChatFormatting.class); + } + + JsonObject jsonobject1; + JsonPrimitive jsonprimitive; + + if (jsonobject.has("clickEvent")) + { + jsonobject1 = jsonobject.getAsJsonObject("clickEvent"); + + if (jsonobject1 != null) + { + jsonprimitive = jsonobject1.getAsJsonPrimitive("action"); + ClickEvent.Action action = jsonprimitive == null ? null : ClickEvent.Action.getValueByCanonicalName(jsonprimitive.getAsString()); + JsonPrimitive jsonprimitive1 = jsonobject1.getAsJsonPrimitive("value"); + String s = jsonprimitive1 == null ? null : jsonprimitive1.getAsString(); + + if (action != null && s != null && action.shouldAllowInChat()) + { + chatstyle.chatClickEvent = new ClickEvent(action, s); + } + } + } + + if (jsonobject.has("hoverEvent")) + { + jsonobject1 = jsonobject.getAsJsonObject("hoverEvent"); + + if (jsonobject1 != null) + { + jsonprimitive = jsonobject1.getAsJsonPrimitive("action"); + HoverEvent.Action action1 = jsonprimitive == null ? null : HoverEvent.Action.getValueByCanonicalName(jsonprimitive.getAsString()); + IChatComponent ichatcomponent = (IChatComponent)p_deserialize_3_.deserialize(jsonobject1.get("value"), IChatComponent.class); + + if (action1 != null && ichatcomponent != null && action1.shouldAllowInChat()) + { + chatstyle.chatHoverEvent = new HoverEvent(action1, ichatcomponent); + } + } + } + + return chatstyle; + } + } + else + { + return null; + } + } + + public JsonElement serialize(ChatStyle p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + if (p_serialize_1_.isEmpty()) + { + return null; + } + else + { + JsonObject jsonobject = new JsonObject(); + + if (p_serialize_1_.bold != null) + { + jsonobject.addProperty("bold", p_serialize_1_.bold); + } + + if (p_serialize_1_.italic != null) + { + jsonobject.addProperty("italic", p_serialize_1_.italic); + } + + if (p_serialize_1_.underlined != null) + { + jsonobject.addProperty("underlined", p_serialize_1_.underlined); + } + + if (p_serialize_1_.strikethrough != null) + { + jsonobject.addProperty("strikethrough", p_serialize_1_.strikethrough); + } + + if (p_serialize_1_.obfuscated != null) + { + jsonobject.addProperty("obfuscated", p_serialize_1_.obfuscated); + } + + if (p_serialize_1_.color != null) + { + jsonobject.add("color", p_serialize_3_.serialize(p_serialize_1_.color)); + } + + JsonObject jsonobject1; + + if (p_serialize_1_.chatClickEvent != null) + { + jsonobject1 = new JsonObject(); + jsonobject1.addProperty("action", p_serialize_1_.chatClickEvent.getAction().getCanonicalName()); + jsonobject1.addProperty("value", p_serialize_1_.chatClickEvent.getValue()); + jsonobject.add("clickEvent", jsonobject1); + } + + if (p_serialize_1_.chatHoverEvent != null) + { + jsonobject1 = new JsonObject(); + jsonobject1.addProperty("action", p_serialize_1_.chatHoverEvent.getAction().getCanonicalName()); + jsonobject1.add("value", p_serialize_3_.serialize(p_serialize_1_.chatHoverEvent.getValue())); + jsonobject.add("hoverEvent", jsonobject1); + } + + return jsonobject; + } + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((ChatStyle)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ChunkCoordinates.java b/build/rfg/minecraft-src/java/net/minecraft/util/ChunkCoordinates.java new file mode 100644 index 0000000..df620b8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ChunkCoordinates.java @@ -0,0 +1,86 @@ +package net.minecraft.util; + +public class ChunkCoordinates implements Comparable +{ + public int posX; + /** the y coordinate */ + public int posY; + /** the z coordinate */ + public int posZ; + private static final String __OBFID = "CL_00001555"; + + public ChunkCoordinates() {} + + public ChunkCoordinates(int x, int y, int z) + { + this.posX = x; + this.posY = y; + this.posZ = z; + } + + public ChunkCoordinates(ChunkCoordinates coords) + { + this.posX = coords.posX; + this.posY = coords.posY; + this.posZ = coords.posZ; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof ChunkCoordinates)) + { + return false; + } + else + { + ChunkCoordinates chunkcoordinates = (ChunkCoordinates)p_equals_1_; + return this.posX == chunkcoordinates.posX && this.posY == chunkcoordinates.posY && this.posZ == chunkcoordinates.posZ; + } + } + + public int hashCode() + { + return this.posX + this.posZ << 8 + this.posY << 16; + } + + public int compareTo(ChunkCoordinates p_compareTo_1_) + { + return this.posY == p_compareTo_1_.posY ? (this.posZ == p_compareTo_1_.posZ ? this.posX - p_compareTo_1_.posX : this.posZ - p_compareTo_1_.posZ) : this.posY - p_compareTo_1_.posY; + } + + public void set(int x, int y, int z) + { + this.posX = x; + this.posY = y; + this.posZ = z; + } + + /** + * Returns the squared distance between this coordinates and the coordinates given as argument. + */ + public float getDistanceSquared(int x, int y, int z) + { + float f = (float)(this.posX - x); + float f1 = (float)(this.posY - y); + float f2 = (float)(this.posZ - z); + return f * f + f1 * f1 + f2 * f2; + } + + /** + * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. + */ + public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates other) + { + return this.getDistanceSquared(other.posX, other.posY, other.posZ); + } + + public String toString() + { + return "Pos{x=" + this.posX + ", y=" + this.posY + ", z=" + this.posZ + '}'; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((ChunkCoordinates)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/CombatEntry.java b/build/rfg/minecraft-src/java/net/minecraft/util/CombatEntry.java new file mode 100644 index 0000000..1131afc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/CombatEntry.java @@ -0,0 +1,57 @@ +package net.minecraft.util; + +import net.minecraft.entity.EntityLivingBase; + +public class CombatEntry +{ + private final DamageSource damageSrc; + private final int field_94567_b; + private final float field_94568_c; + private final float field_94565_d; + private final String field_94566_e; + private final float field_94564_f; + private static final String __OBFID = "CL_00001519"; + + public CombatEntry(DamageSource p_i1564_1_, int p_i1564_2_, float p_i1564_3_, float p_i1564_4_, String p_i1564_5_, float p_i1564_6_) + { + this.damageSrc = p_i1564_1_; + this.field_94567_b = p_i1564_2_; + this.field_94568_c = p_i1564_4_; + this.field_94565_d = p_i1564_3_; + this.field_94566_e = p_i1564_5_; + this.field_94564_f = p_i1564_6_; + } + + /** + * Get the DamageSource of the CombatEntry instance. + */ + public DamageSource getDamageSrc() + { + return this.damageSrc; + } + + public float func_94563_c() + { + return this.field_94568_c; + } + + public boolean func_94559_f() + { + return this.damageSrc.getEntity() instanceof EntityLivingBase; + } + + public String func_94562_g() + { + return this.field_94566_e; + } + + public IChatComponent func_151522_h() + { + return this.getDamageSrc().getEntity() == null ? null : this.getDamageSrc().getEntity().func_145748_c_(); + } + + public float func_94561_i() + { + return this.damageSrc == DamageSource.outOfWorld ? Float.MAX_VALUE : this.field_94564_f; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/CombatTracker.java b/build/rfg/minecraft-src/java/net/minecraft/util/CombatTracker.java new file mode 100644 index 0000000..7c4f986 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/CombatTracker.java @@ -0,0 +1,249 @@ +package net.minecraft.util; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class CombatTracker +{ + /** The CombatEntry objects that we've tracked so far. */ + private final List combatEntries = new ArrayList(); + /** The entity tracked. */ + private final EntityLivingBase fighter; + private int field_94555_c; + private int field_152775_d; + private int field_152776_e; + private boolean field_94552_d; + private boolean field_94553_e; + private String field_94551_f; + private static final String __OBFID = "CL_00001520"; + + public CombatTracker(EntityLivingBase p_i1565_1_) + { + this.fighter = p_i1565_1_; + } + + public void func_94545_a() + { + this.func_94542_g(); + + if (this.fighter.isOnLadder()) + { + Block block = this.fighter.worldObj.getBlock(MathHelper.floor_double(this.fighter.posX), MathHelper.floor_double(this.fighter.boundingBox.minY), MathHelper.floor_double(this.fighter.posZ)); + + if (block == Blocks.ladder) + { + this.field_94551_f = "ladder"; + } + else if (block == Blocks.vine) + { + this.field_94551_f = "vines"; + } + } + else if (this.fighter.isInWater()) + { + this.field_94551_f = "water"; + } + } + + public void func_94547_a(DamageSource p_94547_1_, float p_94547_2_, float p_94547_3_) + { + this.func_94549_h(); + this.func_94545_a(); + CombatEntry combatentry = new CombatEntry(p_94547_1_, this.fighter.ticksExisted, p_94547_2_, p_94547_3_, this.field_94551_f, this.fighter.fallDistance); + this.combatEntries.add(combatentry); + this.field_94555_c = this.fighter.ticksExisted; + this.field_94553_e = true; + + if (combatentry.func_94559_f() && !this.field_94552_d && this.fighter.isEntityAlive()) + { + this.field_94552_d = true; + this.field_152775_d = this.fighter.ticksExisted; + this.field_152776_e = this.field_152775_d; + this.fighter.func_152111_bt(); + } + } + + public IChatComponent func_151521_b() + { + if (this.combatEntries.size() == 0) + { + return new ChatComponentTranslation("death.attack.generic", new Object[] {this.fighter.func_145748_c_()}); + } + else + { + CombatEntry combatentry = this.func_94544_f(); + CombatEntry combatentry1 = (CombatEntry)this.combatEntries.get(this.combatEntries.size() - 1); + IChatComponent ichatcomponent = combatentry1.func_151522_h(); + Entity entity = combatentry1.getDamageSrc().getEntity(); + Object object; + + if (combatentry != null && combatentry1.getDamageSrc() == DamageSource.fall) + { + IChatComponent ichatcomponent1 = combatentry.func_151522_h(); + + if (combatentry.getDamageSrc() != DamageSource.fall && combatentry.getDamageSrc() != DamageSource.outOfWorld) + { + if (ichatcomponent1 != null && (ichatcomponent == null || !ichatcomponent1.equals(ichatcomponent))) + { + Entity entity1 = combatentry.getDamageSrc().getEntity(); + ItemStack itemstack1 = entity1 instanceof EntityLivingBase ? ((EntityLivingBase)entity1).getHeldItem() : null; + + if (itemstack1 != null && itemstack1.hasDisplayName()) + { + object = new ChatComponentTranslation("death.fell.assist.item", new Object[] {this.fighter.func_145748_c_(), ichatcomponent1, itemstack1.func_151000_E()}); + } + else + { + object = new ChatComponentTranslation("death.fell.assist", new Object[] {this.fighter.func_145748_c_(), ichatcomponent1}); + } + } + else if (ichatcomponent != null) + { + ItemStack itemstack = entity instanceof EntityLivingBase ? ((EntityLivingBase)entity).getHeldItem() : null; + + if (itemstack != null && itemstack.hasDisplayName()) + { + object = new ChatComponentTranslation("death.fell.finish.item", new Object[] {this.fighter.func_145748_c_(), ichatcomponent, itemstack.func_151000_E()}); + } + else + { + object = new ChatComponentTranslation("death.fell.finish", new Object[] {this.fighter.func_145748_c_(), ichatcomponent}); + } + } + else + { + object = new ChatComponentTranslation("death.fell.killer", new Object[] {this.fighter.func_145748_c_()}); + } + } + else + { + object = new ChatComponentTranslation("death.fell.accident." + this.func_94548_b(combatentry), new Object[] {this.fighter.func_145748_c_()}); + } + } + else + { + object = combatentry1.getDamageSrc().func_151519_b(this.fighter); + } + + return (IChatComponent)object; + } + } + + public EntityLivingBase func_94550_c() + { + EntityLivingBase entitylivingbase = null; + EntityPlayer entityplayer = null; + float f = 0.0F; + float f1 = 0.0F; + Iterator iterator = this.combatEntries.iterator(); + + while (iterator.hasNext()) + { + CombatEntry combatentry = (CombatEntry)iterator.next(); + + if (combatentry.getDamageSrc().getEntity() instanceof EntityPlayer && (entityplayer == null || combatentry.func_94563_c() > f1)) + { + f1 = combatentry.func_94563_c(); + entityplayer = (EntityPlayer)combatentry.getDamageSrc().getEntity(); + } + + if (combatentry.getDamageSrc().getEntity() instanceof EntityLivingBase && (entitylivingbase == null || combatentry.func_94563_c() > f)) + { + f = combatentry.func_94563_c(); + entitylivingbase = (EntityLivingBase)combatentry.getDamageSrc().getEntity(); + } + } + + if (entityplayer != null && f1 >= f / 3.0F) + { + return entityplayer; + } + else + { + return entitylivingbase; + } + } + + private CombatEntry func_94544_f() + { + CombatEntry combatentry = null; + CombatEntry combatentry1 = null; + byte b0 = 0; + float f = 0.0F; + + for (int i = 0; i < this.combatEntries.size(); ++i) + { + CombatEntry combatentry2 = (CombatEntry)this.combatEntries.get(i); + CombatEntry combatentry3 = i > 0 ? (CombatEntry)this.combatEntries.get(i - 1) : null; + + if ((combatentry2.getDamageSrc() == DamageSource.fall || combatentry2.getDamageSrc() == DamageSource.outOfWorld) && combatentry2.func_94561_i() > 0.0F && (combatentry == null || combatentry2.func_94561_i() > f)) + { + if (i > 0) + { + combatentry = combatentry3; + } + else + { + combatentry = combatentry2; + } + + f = combatentry2.func_94561_i(); + } + + if (combatentry2.func_94562_g() != null && (combatentry1 == null || combatentry2.func_94563_c() > (float)b0)) + { + combatentry1 = combatentry2; + } + } + + if (f > 5.0F && combatentry != null) + { + return combatentry; + } + else if (b0 > 5 && combatentry1 != null) + { + return combatentry1; + } + else + { + return null; + } + } + + private String func_94548_b(CombatEntry p_94548_1_) + { + return p_94548_1_.func_94562_g() == null ? "generic" : p_94548_1_.func_94562_g(); + } + + private void func_94542_g() + { + this.field_94551_f = null; + } + + public void func_94549_h() + { + int i = this.field_94552_d ? 300 : 100; + + if (this.field_94553_e && (!this.fighter.isEntityAlive() || this.fighter.ticksExisted - this.field_94555_c > i)) + { + boolean flag = this.field_94552_d; + this.field_94553_e = false; + this.field_94552_d = false; + this.field_152776_e = this.fighter.ticksExisted; + + if (flag) + { + this.fighter.func_152112_bu(); + } + + this.combatEntries.clear(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/CryptManager.java b/build/rfg/minecraft-src/java/net/minecraft/util/CryptManager.java new file mode 100644 index 0000000..b89908e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/CryptManager.java @@ -0,0 +1,219 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.UnsupportedEncodingException; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.KeyGenerator; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class CryptManager +{ + private static final String __OBFID = "CL_00001483"; + + /** + * Generate a new shared secret AES key from a secure random source + */ + @SideOnly(Side.CLIENT) + public static SecretKey createNewSharedKey() + { + try + { + KeyGenerator keygenerator = KeyGenerator.getInstance("AES"); + keygenerator.init(128); + return keygenerator.generateKey(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + throw new Error(nosuchalgorithmexception); + } + } + + public static KeyPair createNewKeyPair() + { + try + { + KeyPairGenerator keypairgenerator = KeyPairGenerator.getInstance("RSA"); + keypairgenerator.initialize(1024); + return keypairgenerator.generateKeyPair(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + System.err.println("Key pair generation failed!"); + return null; + } + } + + /** + * Compute a serverId hash for use by sendSessionRequest() + */ + public static byte[] getServerIdHash(String p_75895_0_, PublicKey p_75895_1_, SecretKey p_75895_2_) + { + try + { + return digestOperation("SHA-1", new byte[][] {p_75895_0_.getBytes("ISO_8859_1"), p_75895_2_.getEncoded(), p_75895_1_.getEncoded()}); + } + catch (UnsupportedEncodingException unsupportedencodingexception) + { + unsupportedencodingexception.printStackTrace(); + return null; + } + } + + /** + * Compute a message digest on arbitrary byte[] data + */ + private static byte[] digestOperation(String p_75893_0_, byte[] ... p_75893_1_) + { + try + { + MessageDigest messagedigest = MessageDigest.getInstance(p_75893_0_); + byte[][] abyte1 = p_75893_1_; + int i = p_75893_1_.length; + + for (int j = 0; j < i; ++j) + { + byte[] abyte2 = abyte1[j]; + messagedigest.update(abyte2); + } + + return messagedigest.digest(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + return null; + } + } + + /** + * Create a new PublicKey from encoded X.509 data + */ + public static PublicKey decodePublicKey(byte[] p_75896_0_) + { + try + { + X509EncodedKeySpec x509encodedkeyspec = new X509EncodedKeySpec(p_75896_0_); + KeyFactory keyfactory = KeyFactory.getInstance("RSA"); + return keyfactory.generatePublic(x509encodedkeyspec); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + ; + } + catch (InvalidKeySpecException invalidkeyspecexception) + { + ; + } + + System.err.println("Public key reconstitute failed!"); + return null; + } + + /** + * Decrypt shared secret AES key using RSA private key + */ + public static SecretKey decryptSharedKey(PrivateKey p_75887_0_, byte[] p_75887_1_) + { + return new SecretKeySpec(decryptData(p_75887_0_, p_75887_1_), "AES"); + } + + /** + * Encrypt byte[] data with RSA public key + */ + @SideOnly(Side.CLIENT) + public static byte[] encryptData(Key p_75894_0_, byte[] p_75894_1_) + { + return cipherOperation(1, p_75894_0_, p_75894_1_); + } + + /** + * Decrypt byte[] data with RSA private key + */ + public static byte[] decryptData(Key p_75889_0_, byte[] p_75889_1_) + { + return cipherOperation(2, p_75889_0_, p_75889_1_); + } + + /** + * Encrypt or decrypt byte[] data using the specified key + */ + private static byte[] cipherOperation(int p_75885_0_, Key p_75885_1_, byte[] p_75885_2_) + { + try + { + return createTheCipherInstance(p_75885_0_, p_75885_1_.getAlgorithm(), p_75885_1_).doFinal(p_75885_2_); + } + catch (IllegalBlockSizeException illegalblocksizeexception) + { + illegalblocksizeexception.printStackTrace(); + } + catch (BadPaddingException badpaddingexception) + { + badpaddingexception.printStackTrace(); + } + + System.err.println("Cipher data failed!"); + return null; + } + + /** + * Creates the Cipher Instance. + */ + private static Cipher createTheCipherInstance(int p_75886_0_, String p_75886_1_, Key p_75886_2_) + { + try + { + Cipher cipher = Cipher.getInstance(p_75886_1_); + cipher.init(p_75886_0_, p_75886_2_); + return cipher; + } + catch (InvalidKeyException invalidkeyexception) + { + invalidkeyexception.printStackTrace(); + } + catch (NoSuchAlgorithmException nosuchalgorithmexception) + { + nosuchalgorithmexception.printStackTrace(); + } + catch (NoSuchPaddingException nosuchpaddingexception) + { + nosuchpaddingexception.printStackTrace(); + } + + System.err.println("Cipher creation failed!"); + return null; + } + + public static Cipher func_151229_a(int p_151229_0_, Key p_151229_1_) + { + try + { + Cipher cipher = Cipher.getInstance("AES/CFB8/NoPadding"); + cipher.init(p_151229_0_, p_151229_1_, new IvParameterSpec(p_151229_1_.getEncoded())); + return cipher; + } + catch (GeneralSecurityException generalsecurityexception) + { + throw new RuntimeException(generalsecurityexception); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/DamageSource.java b/build/rfg/minecraft-src/java/net/minecraft/util/DamageSource.java new file mode 100644 index 0000000..337f7eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/DamageSource.java @@ -0,0 +1,254 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.world.Explosion; + +public class DamageSource +{ + public static DamageSource inFire = (new DamageSource("inFire")).setFireDamage(); + public static DamageSource onFire = (new DamageSource("onFire")).setDamageBypassesArmor().setFireDamage(); + public static DamageSource lava = (new DamageSource("lava")).setFireDamage(); + public static DamageSource inWall = (new DamageSource("inWall")).setDamageBypassesArmor(); + public static DamageSource drown = (new DamageSource("drown")).setDamageBypassesArmor(); + public static DamageSource starve = (new DamageSource("starve")).setDamageBypassesArmor().setDamageIsAbsolute(); + public static DamageSource cactus = new DamageSource("cactus"); + public static DamageSource fall = (new DamageSource("fall")).setDamageBypassesArmor(); + public static DamageSource outOfWorld = (new DamageSource("outOfWorld")).setDamageBypassesArmor().setDamageAllowedInCreativeMode(); + public static DamageSource generic = (new DamageSource("generic")).setDamageBypassesArmor(); + public static DamageSource magic = (new DamageSource("magic")).setDamageBypassesArmor().setMagicDamage(); + public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); + public static DamageSource anvil = new DamageSource("anvil"); + public static DamageSource fallingBlock = new DamageSource("fallingBlock"); + /** This kind of damage can be blocked or not. */ + private boolean isUnblockable; + private boolean isDamageAllowedInCreativeMode; + /** Whether or not the damage ignores modification by potion effects or enchantments. */ + private boolean damageIsAbsolute; + private float hungerDamage = 0.3F; + /** This kind of damage is based on fire or not. */ + private boolean fireDamage; + /** This kind of damage is based on a projectile or not. */ + private boolean projectile; + /** Whether this damage source will have its damage amount scaled based on the current difficulty. */ + private boolean difficultyScaled; + private boolean magicDamage; + private boolean explosion; + public String damageType; + private static final String __OBFID = "CL_00001521"; + + public static DamageSource causeMobDamage(EntityLivingBase p_76358_0_) + { + return new EntityDamageSource("mob", p_76358_0_); + } + + /** + * returns an EntityDamageSource of type player + */ + public static DamageSource causePlayerDamage(EntityPlayer p_76365_0_) + { + return new EntityDamageSource("player", p_76365_0_); + } + + /** + * returns EntityDamageSourceIndirect of an arrow + */ + public static DamageSource causeArrowDamage(EntityArrow p_76353_0_, Entity p_76353_1_) + { + return (new EntityDamageSourceIndirect("arrow", p_76353_0_, p_76353_1_)).setProjectile(); + } + + /** + * returns EntityDamageSourceIndirect of a fireball + */ + public static DamageSource causeFireballDamage(EntityFireball p_76362_0_, Entity p_76362_1_) + { + return p_76362_1_ == null ? (new EntityDamageSourceIndirect("onFire", p_76362_0_, p_76362_0_)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", p_76362_0_, p_76362_1_)).setFireDamage().setProjectile(); + } + + public static DamageSource causeThrownDamage(Entity p_76356_0_, Entity p_76356_1_) + { + return (new EntityDamageSourceIndirect("thrown", p_76356_0_, p_76356_1_)).setProjectile(); + } + + public static DamageSource causeIndirectMagicDamage(Entity p_76354_0_, Entity p_76354_1_) + { + return (new EntityDamageSourceIndirect("indirectMagic", p_76354_0_, p_76354_1_)).setDamageBypassesArmor().setMagicDamage(); + } + + /** + * Returns the EntityDamageSource of the Thorns enchantment + */ + public static DamageSource causeThornsDamage(Entity p_92087_0_) + { + return (new EntityDamageSource("thorns", p_92087_0_)).setMagicDamage(); + } + + public static DamageSource setExplosionSource(Explosion p_94539_0_) + { + return p_94539_0_ != null && p_94539_0_.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", p_94539_0_.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); + } + + /** + * Returns true if the damage is projectile based. + */ + public boolean isProjectile() + { + return this.projectile; + } + + /** + * Define the damage type as projectile based. + */ + public DamageSource setProjectile() + { + this.projectile = true; + return this; + } + + public boolean isExplosion() + { + return this.explosion; + } + + public DamageSource setExplosion() + { + this.explosion = true; + return this; + } + + public boolean isUnblockable() + { + return this.isUnblockable; + } + + /** + * How much satiate(food) is consumed by this DamageSource + */ + public float getHungerDamage() + { + return this.hungerDamage; + } + + public boolean canHarmInCreative() + { + return this.isDamageAllowedInCreativeMode; + } + + /** + * Whether or not the damage ignores modification by potion effects or enchantments. + */ + public boolean isDamageAbsolute() + { + return this.damageIsAbsolute; + } + + public DamageSource(String p_i1566_1_) + { + this.damageType = p_i1566_1_; + } + + public Entity getSourceOfDamage() + { + return this.getEntity(); + } + + public Entity getEntity() + { + return null; + } + + public DamageSource setDamageBypassesArmor() + { + this.isUnblockable = true; + this.hungerDamage = 0.0F; + return this; + } + + public DamageSource setDamageAllowedInCreativeMode() + { + this.isDamageAllowedInCreativeMode = true; + return this; + } + + /** + * Sets a value indicating whether the damage is absolute (ignores modification by potion effects or enchantments), + * and also clears out hunger damage. + */ + public DamageSource setDamageIsAbsolute() + { + this.damageIsAbsolute = true; + this.hungerDamage = 0.0F; + return this; + } + + /** + * Define the damage type as fire based. + */ + public DamageSource setFireDamage() + { + this.fireDamage = true; + return this; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) + { + EntityLivingBase entitylivingbase1 = p_151519_1_.func_94060_bK(); + String s = "death.attack." + this.damageType; + String s1 = s + ".player"; + return entitylivingbase1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {p_151519_1_.func_145748_c_(), entitylivingbase1.func_145748_c_()}): new ChatComponentTranslation(s, new Object[] {p_151519_1_.func_145748_c_()}); + } + + /** + * Returns true if the damage is fire based. + */ + public boolean isFireDamage() + { + return this.fireDamage; + } + + /** + * Return the name of damage type. + */ + public String getDamageType() + { + return this.damageType; + } + + /** + * Set whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public DamageSource setDifficultyScaled() + { + this.difficultyScaled = true; + return this; + } + + /** + * Return whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() + { + return this.difficultyScaled; + } + + /** + * Returns true if the damage is magic based. + */ + public boolean isMagicDamage() + { + return this.magicDamage; + } + + /** + * Define the damage type as magic based. + */ + public DamageSource setMagicDamage() + { + this.magicDamage = true; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Direction.java b/build/rfg/minecraft-src/java/net/minecraft/util/Direction.java new file mode 100644 index 0000000..674632f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Direction.java @@ -0,0 +1,28 @@ +package net.minecraft.util; + +public class Direction +{ + public static final int[] offsetX = new int[] {0, -1, 0, 1}; + public static final int[] offsetZ = new int[] {1, 0, -1, 0}; + public static final String[] directions = new String[] {"SOUTH", "WEST", "NORTH", "EAST"}; + /** Maps a Direction value (2D) to a Facing value (3D). */ + public static final int[] directionToFacing = new int[] {3, 4, 2, 5}; + /** Maps a Facing value (3D) to a Direction value (2D). */ + public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; + /** Maps a direction to that opposite of it. */ + public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; + /** Maps a direction to that to the right of it. */ + public static final int[] rotateRight = new int[] {1, 2, 3, 0}; + /** Maps a direction to that to the left of it. */ + public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; + public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; + private static final String __OBFID = "CL_00001506"; + + /** + * Returns the movement direction from a velocity vector. + */ + public static int getMovementDirection(double p_82372_0_, double p_82372_2_) + { + return MathHelper.abs((float)p_82372_0_) > MathHelper.abs((float)p_82372_2_) ? (p_82372_0_ > 0.0D ? 1 : 3) : (p_82372_2_ > 0.0D ? 2 : 0); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EnchantmentNameParts.java b/build/rfg/minecraft-src/java/net/minecraft/util/EnchantmentNameParts.java new file mode 100644 index 0000000..c35582f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EnchantmentNameParts.java @@ -0,0 +1,43 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; + +@SideOnly(Side.CLIENT) +public class EnchantmentNameParts +{ + public static final EnchantmentNameParts instance = new EnchantmentNameParts(); + private Random rand = new Random(); + private String[] namePartsArray = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); + private static final String __OBFID = "CL_00000756"; + + /** + * Randomly generates a new name built up of 3 or 4 randomly selected words. + */ + public String generateNewRandomName() + { + int i = this.rand.nextInt(2) + 3; + String s = ""; + + for (int j = 0; j < i; ++j) + { + if (j > 0) + { + s = s + " "; + } + + s = s + this.namePartsArray[this.rand.nextInt(this.namePartsArray.length)]; + } + + return s; + } + + /** + * Resets the underlying random number generator using a given seed. + */ + public void reseedRandomGenerator(long p_148335_1_) + { + this.rand.setSeed(p_148335_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSource.java b/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSource.java new file mode 100644 index 0000000..294fabe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSource.java @@ -0,0 +1,39 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class EntityDamageSource extends DamageSource +{ + protected Entity damageSourceEntity; + private static final String __OBFID = "CL_00001522"; + + public EntityDamageSource(String p_i1567_1_, Entity p_i1567_2_) + { + super(p_i1567_1_); + this.damageSourceEntity = p_i1567_2_; + } + + public Entity getEntity() + { + return this.damageSourceEntity; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) + { + ItemStack itemstack = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {p_151519_1_.func_145748_c_(), this.damageSourceEntity.func_145748_c_(), itemstack.func_151000_E()}): new ChatComponentTranslation(s, new Object[] {p_151519_1_.func_145748_c_(), this.damageSourceEntity.func_145748_c_()}); + } + + /** + * Return whether this damage source will have its damage amount scaled based on the current difficulty. + */ + public boolean isDifficultyScaled() + { + return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSourceIndirect.java b/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSourceIndirect.java new file mode 100644 index 0000000..7cfcead --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EntityDamageSourceIndirect.java @@ -0,0 +1,36 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +public class EntityDamageSourceIndirect extends EntityDamageSource +{ + private Entity indirectEntity; + private static final String __OBFID = "CL_00001523"; + + public EntityDamageSourceIndirect(String p_i1568_1_, Entity p_i1568_2_, Entity p_i1568_3_) + { + super(p_i1568_1_, p_i1568_2_); + this.indirectEntity = p_i1568_3_; + } + + public Entity getSourceOfDamage() + { + return this.damageSourceEntity; + } + + public Entity getEntity() + { + return this.indirectEntity; + } + + public IChatComponent func_151519_b(EntityLivingBase p_151519_1_) + { + IChatComponent ichatcomponent = this.indirectEntity == null ? this.damageSourceEntity.func_145748_c_() : this.indirectEntity.func_145748_c_(); + ItemStack itemstack = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null; + String s = "death.attack." + this.damageType; + String s1 = s + ".item"; + return itemstack != null && itemstack.hasDisplayName() && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {p_151519_1_.func_145748_c_(), ichatcomponent, itemstack.func_151000_E()}): new ChatComponentTranslation(s, new Object[] {p_151519_1_.func_145748_c_(), ichatcomponent}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EnumChatFormatting.java b/build/rfg/minecraft-src/java/net/minecraft/util/EnumChatFormatting.java new file mode 100644 index 0000000..418c59d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EnumChatFormatting.java @@ -0,0 +1,156 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; + +public enum EnumChatFormatting +{ + BLACK('0'), + DARK_BLUE('1'), + DARK_GREEN('2'), + DARK_AQUA('3'), + DARK_RED('4'), + DARK_PURPLE('5'), + GOLD('6'), + GRAY('7'), + DARK_GRAY('8'), + BLUE('9'), + GREEN('a'), + AQUA('b'), + RED('c'), + LIGHT_PURPLE('d'), + YELLOW('e'), + WHITE('f'), + OBFUSCATED('k', true), + BOLD('l', true), + STRIKETHROUGH('m', true), + UNDERLINE('n', true), + ITALIC('o', true), + RESET('r'); + /** Maps a formatting code (e.g., 'f') to its corresponding enum value (e.g., WHITE). */ + private static final Map formattingCodeMapping = new HashMap(); + /** Maps a name (e.g., 'underline') to its corresponding enum value (e.g., UNDERLINE). */ + private static final Map nameMapping = new HashMap(); + /** + * Matches formatting codes that indicate that the client should treat the following text as bold, recolored, + * obfuscated, etc. + */ + private static final Pattern formattingCodePattern = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); + /** The formatting code that produces this format. */ + private final char formattingCode; + private final boolean fancyStyling; + /** + * The control string (section sign + formatting code) that can be inserted into client-side text to display + * subsequent text in this format. + */ + private final String controlString; + + private static final String __OBFID = "CL_00000342"; + + private EnumChatFormatting(char p_i1336_3_) + { + this(p_i1336_3_, false); + } + + private EnumChatFormatting(char p_i1337_3_, boolean p_i1337_4_) + { + this.formattingCode = p_i1337_3_; + this.fancyStyling = p_i1337_4_; + this.controlString = "\u00a7" + p_i1337_3_; + } + + /** + * Gets the formatting code that produces this format. + */ + public char getFormattingCode() + { + return this.formattingCode; + } + + /** + * False if this is just changing the color or resetting; true otherwise. + */ + public boolean isFancyStyling() + { + return this.fancyStyling; + } + + /** + * Checks if typo is a color. + */ + public boolean isColor() + { + return !this.fancyStyling && this != RESET; + } + + /** + * Gets the friendly name of this value. + */ + public String getFriendlyName() + { + return this.name().toLowerCase(); + } + + public String toString() + { + return this.controlString; + } + + /** + * Returns a copy of the given string, with formatting codes stripped away. + */ + @SideOnly(Side.CLIENT) + public static String getTextWithoutFormattingCodes(String p_110646_0_) + { + return p_110646_0_ == null ? null : formattingCodePattern.matcher(p_110646_0_).replaceAll(""); + } + + /** + * Gets a value by its friendly name; null if the given name does not map to a defined value. + */ + public static EnumChatFormatting getValueByName(String p_96300_0_) + { + return p_96300_0_ == null ? null : (EnumChatFormatting)nameMapping.get(p_96300_0_.toLowerCase()); + } + + /** + * Gets all the valid values. Args: @param par0: Whether or not to include color values. @param par1: Whether or not + * to include fancy-styling values (anything that isn't a color value or the "reset" value). + */ + public static Collection getValidValues(boolean p_96296_0_, boolean p_96296_1_) + { + ArrayList arraylist = new ArrayList(); + EnumChatFormatting[] aenumchatformatting = values(); + int i = aenumchatformatting.length; + + for (int j = 0; j < i; ++j) + { + EnumChatFormatting enumchatformatting = aenumchatformatting[j]; + + if ((!enumchatformatting.isColor() || p_96296_0_) && (!enumchatformatting.isFancyStyling() || p_96296_1_)) + { + arraylist.add(enumchatformatting.getFriendlyName()); + } + } + + return arraylist; + } + + static + { + EnumChatFormatting[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + EnumChatFormatting var3 = var0[var2]; + formattingCodeMapping.put(Character.valueOf(var3.getFormattingCode()), var3); + nameMapping.put(var3.getFriendlyName(), var3); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EnumFacing.java b/build/rfg/minecraft-src/java/net/minecraft/util/EnumFacing.java new file mode 100644 index 0000000..cd2eaa0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EnumFacing.java @@ -0,0 +1,72 @@ +package net.minecraft.util; + +public enum EnumFacing +{ + DOWN(0, 1, 0, -1, 0), + UP(1, 0, 0, 1, 0), + NORTH(2, 3, 0, 0, -1), + SOUTH(3, 2, 0, 0, 1), + EAST(4, 5, -1, 0, 0), + WEST(5, 4, 1, 0, 0); + /** Face order for D-U-N-S-E-W. */ + private final int order_a; + /** Face order for U-D-S-N-W-E. */ + private final int order_b; + private final int frontOffsetX; + private final int frontOffsetY; + private final int frontOffsetZ; + /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */ + private static final EnumFacing[] faceList = new EnumFacing[6]; + + private static final String __OBFID = "CL_00001201"; + + private EnumFacing(int p_i1367_3_, int p_i1367_4_, int p_i1367_5_, int p_i1367_6_, int p_i1367_7_) + { + this.order_a = p_i1367_3_; + this.order_b = p_i1367_4_; + this.frontOffsetX = p_i1367_5_; + this.frontOffsetY = p_i1367_6_; + this.frontOffsetZ = p_i1367_7_; + } + + /** + * Returns a offset that addresses the block in front of this facing. + */ + public int getFrontOffsetX() + { + return this.frontOffsetX; + } + + public int getFrontOffsetY() + { + return this.frontOffsetY; + } + + /** + * Returns a offset that addresses the block in front of this facing. + */ + public int getFrontOffsetZ() + { + return this.frontOffsetZ; + } + + /** + * Returns the facing that represents the block in front of it. + */ + public static EnumFacing getFront(int p_82600_0_) + { + return faceList[p_82600_0_ % faceList.length]; + } + + static + { + EnumFacing[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + EnumFacing var3 = var0[var2]; + faceList[var3.order_a] = var3; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/EnumTypeAdapterFactory.java b/build/rfg/minecraft-src/java/net/minecraft/util/EnumTypeAdapterFactory.java new file mode 100644 index 0000000..5b7ce36 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/EnumTypeAdapterFactory.java @@ -0,0 +1,72 @@ +package net.minecraft.util; + +import com.google.gson.Gson; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.HashMap; +import java.util.Locale; + +public class EnumTypeAdapterFactory implements TypeAdapterFactory +{ + private static final String __OBFID = "CL_00001494"; + + public TypeAdapter create(Gson p_create_1_, TypeToken p_create_2_) + { + Class oclass = p_create_2_.getRawType(); + + if (!oclass.isEnum()) + { + return null; + } + else + { + final HashMap hashmap = new HashMap(); + Object[] aobject = oclass.getEnumConstants(); + int i = aobject.length; + + for (int j = 0; j < i; ++j) + { + Object object = aobject[j]; + hashmap.put(this.func_151232_a(object), object); + } + + return new TypeAdapter() + { + private static final String __OBFID = "CL_00001495"; + public void write(JsonWriter p_write_1_, Object p_write_2_) throws IOException + { + if (p_write_2_ == null) + { + p_write_1_.nullValue(); + } + else + { + p_write_1_.value(EnumTypeAdapterFactory.this.func_151232_a(p_write_2_)); + } + } + public Object read(JsonReader p_read_1_) throws IOException + { + if (p_read_1_.peek() == JsonToken.NULL) + { + p_read_1_.nextNull(); + return null; + } + else + { + return hashmap.get(p_read_1_.nextString()); + } + } + }; + } + } + + private String func_151232_a(Object p_151232_1_) + { + return p_151232_1_ instanceof Enum ? ((Enum)p_151232_1_).name().toLowerCase(Locale.US) : p_151232_1_.toString().toLowerCase(Locale.US); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Facing.java b/build/rfg/minecraft-src/java/net/minecraft/util/Facing.java new file mode 100644 index 0000000..69a54e9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Facing.java @@ -0,0 +1,15 @@ +package net.minecraft.util; + +public class Facing +{ + /** Converts a side to the opposite side. This is the same as XOR'ing it with 1. */ + public static final int[] oppositeSide = new int[] {1, 0, 3, 2, 5, 4}; + /** gives the offset required for this axis to get the block at that side. */ + public static final int[] offsetsXForSide = new int[] {0, 0, 0, 0, -1, 1}; + /** gives the offset required for this axis to get the block at that side. */ + public static final int[] offsetsYForSide = new int[] { -1, 1, 0, 0, 0, 0}; + /** gives the offset required for this axis to get the block at that side. */ + public static final int[] offsetsZForSide = new int[] {0, 0, -1, 1, 0, 0}; + public static final String[] facings = new String[] {"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; + private static final String __OBFID = "CL_00001532"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/FoodStats.java b/build/rfg/minecraft-src/java/net/minecraft/util/FoodStats.java new file mode 100644 index 0000000..42492f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/FoodStats.java @@ -0,0 +1,165 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.EnumDifficulty; + +public class FoodStats +{ + /** The player's food level. */ + private int foodLevel = 20; + /** The player's food saturation. */ + private float foodSaturationLevel = 5.0F; + /** The player's food exhaustion. */ + private float foodExhaustionLevel; + /** The player's food timer value. */ + private int foodTimer; + private int prevFoodLevel = 20; + private static final String __OBFID = "CL_00001729"; + + /** + * Args: int foodLevel, float foodSaturationModifier + */ + public void addStats(int p_75122_1_, float p_75122_2_) + { + this.foodLevel = Math.min(p_75122_1_ + this.foodLevel, 20); + this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)p_75122_1_ * p_75122_2_ * 2.0F, (float)this.foodLevel); + } + + public void func_151686_a(ItemFood p_151686_1_, ItemStack p_151686_2_) + { + this.addStats(p_151686_1_.func_150905_g(p_151686_2_), p_151686_1_.func_150906_h(p_151686_2_)); + } + + /** + * Handles the food game logic. + */ + public void onUpdate(EntityPlayer p_75118_1_) + { + EnumDifficulty enumdifficulty = p_75118_1_.worldObj.difficultySetting; + this.prevFoodLevel = this.foodLevel; + + if (this.foodExhaustionLevel > 4.0F) + { + this.foodExhaustionLevel -= 4.0F; + + if (this.foodSaturationLevel > 0.0F) + { + this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); + } + else if (enumdifficulty != EnumDifficulty.PEACEFUL) + { + this.foodLevel = Math.max(this.foodLevel - 1, 0); + } + } + + if (p_75118_1_.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && p_75118_1_.shouldHeal()) + { + ++this.foodTimer; + + if (this.foodTimer >= 80) + { + p_75118_1_.heal(1.0F); + this.addExhaustion(3.0F); + this.foodTimer = 0; + } + } + else if (this.foodLevel <= 0) + { + ++this.foodTimer; + + if (this.foodTimer >= 80) + { + if (p_75118_1_.getHealth() > 10.0F || enumdifficulty == EnumDifficulty.HARD || p_75118_1_.getHealth() > 1.0F && enumdifficulty == EnumDifficulty.NORMAL) + { + p_75118_1_.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.foodTimer = 0; + } + } + else + { + this.foodTimer = 0; + } + } + + /** + * Reads food stats from an NBT object. + */ + public void readNBT(NBTTagCompound p_75112_1_) + { + if (p_75112_1_.hasKey("foodLevel", 99)) + { + this.foodLevel = p_75112_1_.getInteger("foodLevel"); + this.foodTimer = p_75112_1_.getInteger("foodTickTimer"); + this.foodSaturationLevel = p_75112_1_.getFloat("foodSaturationLevel"); + this.foodExhaustionLevel = p_75112_1_.getFloat("foodExhaustionLevel"); + } + } + + /** + * Writes food stats to an NBT object. + */ + public void writeNBT(NBTTagCompound p_75117_1_) + { + p_75117_1_.setInteger("foodLevel", this.foodLevel); + p_75117_1_.setInteger("foodTickTimer", this.foodTimer); + p_75117_1_.setFloat("foodSaturationLevel", this.foodSaturationLevel); + p_75117_1_.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); + } + + /** + * Get the player's food level. + */ + public int getFoodLevel() + { + return this.foodLevel; + } + + @SideOnly(Side.CLIENT) + public int getPrevFoodLevel() + { + return this.prevFoodLevel; + } + + /** + * If foodLevel is not max. + */ + public boolean needFood() + { + return this.foodLevel < 20; + } + + /** + * adds input to foodExhaustionLevel to a max of 40 + */ + public void addExhaustion(float p_75113_1_) + { + this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + p_75113_1_, 40.0F); + } + + /** + * Get the player's food saturation level. + */ + public float getSaturationLevel() + { + return this.foodSaturationLevel; + } + + @SideOnly(Side.CLIENT) + public void setFoodLevel(int p_75114_1_) + { + this.foodLevel = p_75114_1_; + } + + @SideOnly(Side.CLIENT) + public void setFoodSaturationLevel(float p_75119_1_) + { + this.foodSaturationLevel = p_75119_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/HttpUtil.java b/build/rfg/minecraft-src/java/net/minecraft/util/HttpUtil.java new file mode 100644 index 0000000..3d41b93 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/HttpUtil.java @@ -0,0 +1,335 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.ServerSocket; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.atomic.AtomicInteger; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class HttpUtil +{ + /** The number of download threads that we have started so far. */ + private static final AtomicInteger downloadThreadsStarted = new AtomicInteger(0); + private static final Logger logger = LogManager.getLogger(); + private static final String __OBFID = "CL_00001485"; + + /** + * Builds an encoded HTTP POST content string from a string map + */ + public static String buildPostString(Map data) + { + StringBuilder stringbuilder = new StringBuilder(); + Iterator iterator = data.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (stringbuilder.length() > 0) + { + stringbuilder.append('&'); + } + + try + { + stringbuilder.append(URLEncoder.encode((String)entry.getKey(), "UTF-8")); + } + catch (UnsupportedEncodingException unsupportedencodingexception1) + { + unsupportedencodingexception1.printStackTrace(); + } + + if (entry.getValue() != null) + { + stringbuilder.append('='); + + try + { + stringbuilder.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8")); + } + catch (UnsupportedEncodingException unsupportedencodingexception) + { + unsupportedencodingexception.printStackTrace(); + } + } + } + + return stringbuilder.toString(); + } + + public static String func_151226_a(URL url, Map data, boolean skipLoggingErrors) + { + return func_151225_a(url, buildPostString(data), skipLoggingErrors); + } + + private static String func_151225_a(URL url, String content, boolean skipLoggingErrors) + { + try + { + Proxy proxy = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy(); + + if (proxy == null) + { + proxy = Proxy.NO_PROXY; + } + + HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection(proxy); + httpurlconnection.setRequestMethod("POST"); + httpurlconnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + httpurlconnection.setRequestProperty("Content-Length", "" + content.getBytes().length); + httpurlconnection.setRequestProperty("Content-Language", "en-US"); + httpurlconnection.setUseCaches(false); + httpurlconnection.setDoInput(true); + httpurlconnection.setDoOutput(true); + DataOutputStream dataoutputstream = new DataOutputStream(httpurlconnection.getOutputStream()); + dataoutputstream.writeBytes(content); + dataoutputstream.flush(); + dataoutputstream.close(); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(httpurlconnection.getInputStream())); + StringBuffer stringbuffer = new StringBuffer(); + String s1; + + while ((s1 = bufferedreader.readLine()) != null) + { + stringbuffer.append(s1); + stringbuffer.append('\r'); + } + + bufferedreader.close(); + return stringbuffer.toString(); + } + catch (Exception exception) + { + if (!skipLoggingErrors) + { + logger.error("Could not post to " + url, exception); + } + + return ""; + } + } + + @SideOnly(Side.CLIENT) + public static void func_151223_a(final File packFile, final String packName, final HttpUtil.DownloadListener completionListener, final Map requestData, final int maxSize, final IProgressUpdate loadingScreen, final Proxy proxy) + { + Thread thread = new Thread(new Runnable() + { + private static final String __OBFID = "CL_00001486"; + public void run() + { + URLConnection urlconnection = null; + InputStream inputstream = null; + DataOutputStream dataoutputstream = null; + + if (loadingScreen != null) + { + loadingScreen.resetProgressAndMessage("Downloading Texture Pack"); + loadingScreen.resetProgresAndWorkingMessage("Making Request..."); + } + + try + { + byte[] abyte = new byte[4096]; + URL url = new URL(packName); + urlconnection = url.openConnection(proxy); + float f = 0.0F; + float f1 = (float)requestData.entrySet().size(); + Iterator iterator = requestData.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + urlconnection.setRequestProperty((String)entry.getKey(), (String)entry.getValue()); + + if (loadingScreen != null) + { + loadingScreen.setLoadingProgress((int)(++f / f1 * 100.0F)); + } + } + + inputstream = urlconnection.getInputStream(); + f1 = (float)urlconnection.getContentLength(); + int i = urlconnection.getContentLength(); + + if (loadingScreen != null) + { + loadingScreen.resetProgresAndWorkingMessage(String.format("Downloading file (%.2f MB)...", new Object[] {Float.valueOf(f1 / 1000.0F / 1000.0F)})); + } + + if (packFile.exists()) + { + long j = packFile.length(); + + if (j == (long)i) + { + completionListener.func_148522_a(packFile); + + if (loadingScreen != null) + { + loadingScreen.func_146586_a(); + } + + return; + } + + HttpUtil.logger.warn("Deleting " + packFile + " as it does not match what we currently have (" + i + " vs our " + j + ")."); + packFile.delete(); + } + else if (packFile.getParentFile() != null) + { + packFile.getParentFile().mkdirs(); + } + + dataoutputstream = new DataOutputStream(new FileOutputStream(packFile)); + + if (maxSize > 0 && f1 > (float)maxSize) + { + if (loadingScreen != null) + { + loadingScreen.func_146586_a(); + } + + throw new IOException("Filesize is bigger than maximum allowed (file is " + f + ", limit is " + maxSize + ")"); + } + + boolean flag = false; + int k; + + while ((k = inputstream.read(abyte)) >= 0) + { + f += (float)k; + + if (loadingScreen != null) + { + loadingScreen.setLoadingProgress((int)(f / f1 * 100.0F)); + } + + if (maxSize > 0 && f > (float)maxSize) + { + if (loadingScreen != null) + { + loadingScreen.func_146586_a(); + } + + throw new IOException("Filesize was bigger than maximum allowed (got >= " + f + ", limit was " + maxSize + ")"); + } + + dataoutputstream.write(abyte, 0, k); + } + + completionListener.func_148522_a(packFile); + + if (loadingScreen != null) + { + loadingScreen.func_146586_a(); + } + } + catch (Throwable throwable) + { + throwable.printStackTrace(); + } + finally + { + try + { + if (inputstream != null) + { + inputstream.close(); + } + } + catch (IOException ioexception1) + { + ; + } + + try + { + if (dataoutputstream != null) + { + dataoutputstream.close(); + } + } + catch (IOException ioexception) + { + ; + } + } + } + }, "File Downloader #" + downloadThreadsStarted.incrementAndGet()); + thread.setDaemon(true); + thread.start(); + } + + @SideOnly(Side.CLIENT) + public static int func_76181_a() throws IOException + { + ServerSocket serversocket = null; + boolean flag = true; + int i; + + try + { + serversocket = new ServerSocket(0); + i = serversocket.getLocalPort(); + } + finally + { + try + { + if (serversocket != null) + { + serversocket.close(); + } + } + catch (IOException ioexception) + { + ; + } + } + + return i; + } + + @SideOnly(Side.CLIENT) + public static String func_152755_a(URL url) throws IOException + { + HttpURLConnection httpurlconnection = (HttpURLConnection)url.openConnection(); + httpurlconnection.setRequestMethod("GET"); + BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(httpurlconnection.getInputStream())); + StringBuilder stringbuilder = new StringBuilder(); + String s; + + while ((s = bufferedreader.readLine()) != null) + { + stringbuilder.append(s); + stringbuilder.append('\r'); + } + + bufferedreader.close(); + return stringbuilder.toString(); + } + + @SideOnly(Side.CLIENT) + public interface DownloadListener + { + void func_148522_a(File p_148522_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IChatComponent.java b/build/rfg/minecraft-src/java/net/minecraft/util/IChatComponent.java new file mode 100644 index 0000000..1508dca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IChatComponent.java @@ -0,0 +1,284 @@ +package net.minecraft.util; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Type; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; + +public interface IChatComponent extends Iterable +{ + IChatComponent setChatStyle(ChatStyle style); + + ChatStyle getChatStyle(); + + /** + * Appends the given text to the end of this component. + */ + IChatComponent appendText(String text); + + /** + * Appends the given component to the end of this one. + */ + IChatComponent appendSibling(IChatComponent component); + + /** + * Gets the text of this component, without any special formatting codes added, for chat. TODO: why is this two + * different methods? + */ + String getUnformattedTextForChat(); + + /** + * Gets the text of this component, without any special formatting codes added. TODO: why is this two different + * methods? + */ + String getUnformattedText(); + + /** + * Gets the text of this component, with formatting codes added for rendering. + */ + @SideOnly(Side.CLIENT) + String getFormattedText(); + + /** + * Gets the sibling components of this one. + */ + List getSiblings(); + + /** + * Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. + */ + IChatComponent createCopy(); + + public static class Serializer implements JsonDeserializer, JsonSerializer + { + private static final Gson field_150700_a; + private static final String __OBFID = "CL_00001263"; + + public IChatComponent deserialize(JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_) + { + if (p_deserialize_1_.isJsonPrimitive()) + { + return new ChatComponentText(p_deserialize_1_.getAsString()); + } + else if (!p_deserialize_1_.isJsonObject()) + { + if (p_deserialize_1_.isJsonArray()) + { + JsonArray jsonarray1 = p_deserialize_1_.getAsJsonArray(); + IChatComponent ichatcomponent = null; + Iterator iterator = jsonarray1.iterator(); + + while (iterator.hasNext()) + { + JsonElement jsonelement1 = (JsonElement)iterator.next(); + IChatComponent ichatcomponent1 = this.deserialize(jsonelement1, jsonelement1.getClass(), p_deserialize_3_); + + if (ichatcomponent == null) + { + ichatcomponent = ichatcomponent1; + } + else + { + ichatcomponent.appendSibling(ichatcomponent1); + } + } + + return ichatcomponent; + } + else + { + throw new JsonParseException("Don\'t know how to turn " + p_deserialize_1_.toString() + " into a Component"); + } + } + else + { + JsonObject jsonobject = p_deserialize_1_.getAsJsonObject(); + Object object; + + if (jsonobject.has("text")) + { + object = new ChatComponentText(jsonobject.get("text").getAsString()); + } + else + { + if (!jsonobject.has("translate")) + { + throw new JsonParseException("Don\'t know how to turn " + p_deserialize_1_.toString() + " into a Component"); + } + + String s = jsonobject.get("translate").getAsString(); + + if (jsonobject.has("with")) + { + JsonArray jsonarray = jsonobject.getAsJsonArray("with"); + Object[] aobject = new Object[jsonarray.size()]; + + for (int i = 0; i < aobject.length; ++i) + { + aobject[i] = this.deserialize(jsonarray.get(i), p_deserialize_2_, p_deserialize_3_); + + if (aobject[i] instanceof ChatComponentText) + { + ChatComponentText chatcomponenttext = (ChatComponentText)aobject[i]; + + if (chatcomponenttext.getChatStyle().isEmpty() && chatcomponenttext.getSiblings().isEmpty()) + { + aobject[i] = chatcomponenttext.getChatComponentText_TextValue(); + } + } + } + + object = new ChatComponentTranslation(s, aobject); + } + else + { + object = new ChatComponentTranslation(s, new Object[0]); + } + } + + if (jsonobject.has("extra")) + { + JsonArray jsonarray2 = jsonobject.getAsJsonArray("extra"); + + if (jsonarray2.size() <= 0) + { + throw new JsonParseException("Unexpected empty array of components"); + } + + for (int j = 0; j < jsonarray2.size(); ++j) + { + ((IChatComponent)object).appendSibling(this.deserialize(jsonarray2.get(j), p_deserialize_2_, p_deserialize_3_)); + } + } + + ((IChatComponent)object).setChatStyle((ChatStyle)p_deserialize_3_.deserialize(p_deserialize_1_, ChatStyle.class)); + return (IChatComponent)object; + } + } + + private void func_150695_a(ChatStyle style, JsonObject object, JsonSerializationContext ctx) + { + JsonElement jsonelement = ctx.serialize(style); + + if (jsonelement.isJsonObject()) + { + JsonObject jsonobject1 = (JsonObject)jsonelement; + Iterator iterator = jsonobject1.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + object.add((String)entry.getKey(), (JsonElement)entry.getValue()); + } + } + } + + public JsonElement serialize(IChatComponent p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + if (p_serialize_1_ instanceof ChatComponentText && p_serialize_1_.getChatStyle().isEmpty() && p_serialize_1_.getSiblings().isEmpty()) + { + return new JsonPrimitive(((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } + else + { + JsonObject jsonobject = new JsonObject(); + + if (!p_serialize_1_.getChatStyle().isEmpty()) + { + this.func_150695_a(p_serialize_1_.getChatStyle(), jsonobject, p_serialize_3_); + } + + if (!p_serialize_1_.getSiblings().isEmpty()) + { + JsonArray jsonarray = new JsonArray(); + Iterator iterator = p_serialize_1_.getSiblings().iterator(); + + while (iterator.hasNext()) + { + IChatComponent ichatcomponent1 = (IChatComponent)iterator.next(); + jsonarray.add(this.serialize(ichatcomponent1, ichatcomponent1.getClass(), p_serialize_3_)); + } + + jsonobject.add("extra", jsonarray); + } + + if (p_serialize_1_ instanceof ChatComponentText) + { + jsonobject.addProperty("text", ((ChatComponentText)p_serialize_1_).getChatComponentText_TextValue()); + } + else + { + if (!(p_serialize_1_ instanceof ChatComponentTranslation)) + { + throw new IllegalArgumentException("Don\'t know how to serialize " + p_serialize_1_ + " as a Component"); + } + + ChatComponentTranslation chatcomponenttranslation = (ChatComponentTranslation)p_serialize_1_; + jsonobject.addProperty("translate", chatcomponenttranslation.getKey()); + + if (chatcomponenttranslation.getFormatArgs() != null && chatcomponenttranslation.getFormatArgs().length > 0) + { + JsonArray jsonarray1 = new JsonArray(); + Object[] aobject = chatcomponenttranslation.getFormatArgs(); + int i = aobject.length; + + for (int j = 0; j < i; ++j) + { + Object object = aobject[j]; + + if (object instanceof IChatComponent) + { + jsonarray1.add(this.serialize((IChatComponent)object, object.getClass(), p_serialize_3_)); + } + else + { + jsonarray1.add(new JsonPrimitive(String.valueOf(object))); + } + } + + jsonobject.add("with", jsonarray1); + } + } + + return jsonobject; + } + } + + public static String func_150696_a(IChatComponent component) + { + return field_150700_a.toJson(component); + } + + public static IChatComponent func_150699_a(String json) + { + return (IChatComponent)field_150700_a.fromJson(json, IChatComponent.class); + } + + public JsonElement serialize(Object p_serialize_1_, Type p_serialize_2_, JsonSerializationContext p_serialize_3_) + { + return this.serialize((IChatComponent)p_serialize_1_, p_serialize_2_, p_serialize_3_); + } + + static + { + GsonBuilder var0 = new GsonBuilder(); + var0.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer()); + var0.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer()); + var0.registerTypeAdapterFactory(new EnumTypeAdapterFactory()); + field_150700_a = var0.create(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IIcon.java b/build/rfg/minecraft-src/java/net/minecraft/util/IIcon.java new file mode 100644 index 0000000..7a531df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IIcon.java @@ -0,0 +1,58 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public interface IIcon +{ + /** + * Returns the width of the icon, in pixels. + */ + @SideOnly(Side.CLIENT) + int getIconWidth(); + + /** + * Returns the height of the icon, in pixels. + */ + @SideOnly(Side.CLIENT) + int getIconHeight(); + + /** + * Returns the minimum U coordinate to use when rendering with this icon. + */ + @SideOnly(Side.CLIENT) + float getMinU(); + + /** + * Returns the maximum U coordinate to use when rendering with this icon. + */ + @SideOnly(Side.CLIENT) + float getMaxU(); + + /** + * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. + */ + @SideOnly(Side.CLIENT) + float getInterpolatedU(double p_94214_1_); + + /** + * Returns the minimum V coordinate to use when rendering with this icon. + */ + @SideOnly(Side.CLIENT) + float getMinV(); + + /** + * Returns the maximum V coordinate to use when rendering with this icon. + */ + @SideOnly(Side.CLIENT) + float getMaxV(); + + /** + * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. + */ + @SideOnly(Side.CLIENT) + float getInterpolatedV(double p_94207_1_); + + @SideOnly(Side.CLIENT) + String getIconName(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IJsonSerializable.java b/build/rfg/minecraft-src/java/net/minecraft/util/IJsonSerializable.java new file mode 100644 index 0000000..289ee67 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IJsonSerializable.java @@ -0,0 +1,13 @@ +package net.minecraft.util; + +import com.google.gson.JsonElement; + +public interface IJsonSerializable +{ + void func_152753_a(JsonElement p_152753_1_); + + /** + * Gets the JsonElement that can be serialized. + */ + JsonElement getSerializableElement(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IObjectIntIterable.java b/build/rfg/minecraft-src/java/net/minecraft/util/IObjectIntIterable.java new file mode 100644 index 0000000..bd2f746 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IObjectIntIterable.java @@ -0,0 +1,5 @@ +package net.minecraft.util; + +public interface IObjectIntIterable extends Iterable +{ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IProgressUpdate.java b/build/rfg/minecraft-src/java/net/minecraft/util/IProgressUpdate.java new file mode 100644 index 0000000..9bdd247 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IProgressUpdate.java @@ -0,0 +1,32 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public interface IProgressUpdate +{ + /** + * "Saving level", or the loading,or downloading equivelent + */ + void displayProgressMessage(String p_73720_1_); + + /** + * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, + * and the WorkingString to "working...". + */ + @SideOnly(Side.CLIENT) + void resetProgressAndMessage(String p_73721_1_); + + /** + * This is called with "Working..." by resetProgressAndMessage + */ + void resetProgresAndWorkingMessage(String p_73719_1_); + + /** + * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress + */ + void setLoadingProgress(int p_73718_1_); + + @SideOnly(Side.CLIENT) + void func_146586_a(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IRegistry.java b/build/rfg/minecraft-src/java/net/minecraft/util/IRegistry.java new file mode 100644 index 0000000..0780195 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IRegistry.java @@ -0,0 +1,11 @@ +package net.minecraft.util; + +public interface IRegistry +{ + Object getObject(Object p_82594_1_); + + /** + * Register an object on this registry. + */ + void putObject(Object p_82595_1_, Object p_82595_2_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/IntHashMap.java b/build/rfg/minecraft-src/java/net/minecraft/util/IntHashMap.java new file mode 100644 index 0000000..54ade8b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/IntHashMap.java @@ -0,0 +1,307 @@ +package net.minecraft.util; + +import java.util.HashSet; +import java.util.Set; + +public class IntHashMap +{ + /** An array of HashEntries representing the heads of hash slot lists */ + private transient IntHashMap.Entry[] slots = new IntHashMap.Entry[16]; + /** The number of items stored in this map */ + private transient int count; + /** The grow threshold */ + private int threshold = 12; + /** The scale factor used to determine when to grow the table */ + private final float growFactor = 0.75F; + /** A serial stamp used to mark changes */ + private transient volatile int versionStamp; + /** The set of all the keys stored in this MCHash object */ + private Set keySet = new HashSet(); + private static final String __OBFID = "CL_00001490"; + + /** + * Makes the passed in integer suitable for hashing by a number of shifts + */ + private static int computeHash(int p_76044_0_) + { + p_76044_0_ ^= p_76044_0_ >>> 20 ^ p_76044_0_ >>> 12; + return p_76044_0_ ^ p_76044_0_ >>> 7 ^ p_76044_0_ >>> 4; + } + + /** + * Computes the index of the slot for the hash and slot count passed in. + */ + private static int getSlotIndex(int p_76043_0_, int p_76043_1_) + { + return p_76043_0_ & p_76043_1_ - 1; + } + + /** + * Returns the object associated to a key + */ + public Object lookup(int p_76041_1_) + { + int j = computeHash(p_76041_1_); + + for (IntHashMap.Entry entry = this.slots[getSlotIndex(j, this.slots.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76041_1_) + { + return entry.valueEntry; + } + } + + return null; + } + + /** + * Return true if an object is associated with the given key + */ + public boolean containsItem(int p_76037_1_) + { + return this.lookupEntry(p_76037_1_) != null; + } + + /** + * Returns the key/object mapping for a given key as a MCHashEntry + */ + final IntHashMap.Entry lookupEntry(int p_76045_1_) + { + int j = computeHash(p_76045_1_); + + for (IntHashMap.Entry entry = this.slots[getSlotIndex(j, this.slots.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76045_1_) + { + return entry; + } + } + + return null; + } + + /** + * Adds a key and associated value to this map + */ + public void addKey(int p_76038_1_, Object p_76038_2_) + { + this.keySet.add(Integer.valueOf(p_76038_1_)); + int j = computeHash(p_76038_1_); + int k = getSlotIndex(j, this.slots.length); + + for (IntHashMap.Entry entry = this.slots[k]; entry != null; entry = entry.nextEntry) + { + if (entry.hashEntry == p_76038_1_) + { + entry.valueEntry = p_76038_2_; + return; + } + } + + ++this.versionStamp; + this.insert(j, p_76038_1_, p_76038_2_, k); + } + + /** + * Increases the number of hash slots + */ + private void grow(int p_76047_1_) + { + IntHashMap.Entry[] aentry = this.slots; + int j = aentry.length; + + if (j == 1073741824) + { + this.threshold = Integer.MAX_VALUE; + } + else + { + IntHashMap.Entry[] aentry1 = new IntHashMap.Entry[p_76047_1_]; + this.copyTo(aentry1); + this.slots = aentry1; + this.threshold = (int)((float)p_76047_1_ * this.growFactor); + } + } + + /** + * Copies the hash slots to a new array + */ + private void copyTo(IntHashMap.Entry[] p_76048_1_) + { + IntHashMap.Entry[] aentry = this.slots; + int i = p_76048_1_.length; + + for (int j = 0; j < aentry.length; ++j) + { + IntHashMap.Entry entry = aentry[j]; + + if (entry != null) + { + aentry[j] = null; + IntHashMap.Entry entry1; + + do + { + entry1 = entry.nextEntry; + int k = getSlotIndex(entry.slotHash, i); + entry.nextEntry = p_76048_1_[k]; + p_76048_1_[k] = entry; + entry = entry1; + } + while (entry1 != null); + } + } + } + + /** + * Removes the specified object from the map and returns it + */ + public Object removeObject(int p_76049_1_) + { + this.keySet.remove(Integer.valueOf(p_76049_1_)); + IntHashMap.Entry entry = this.removeEntry(p_76049_1_); + return entry == null ? null : entry.valueEntry; + } + + /** + * Removes the specified entry from the map and returns it + */ + final IntHashMap.Entry removeEntry(int p_76036_1_) + { + int j = computeHash(p_76036_1_); + int k = getSlotIndex(j, this.slots.length); + IntHashMap.Entry entry = this.slots[k]; + IntHashMap.Entry entry1; + IntHashMap.Entry entry2; + + for (entry1 = entry; entry1 != null; entry1 = entry2) + { + entry2 = entry1.nextEntry; + + if (entry1.hashEntry == p_76036_1_) + { + ++this.versionStamp; + --this.count; + + if (entry == entry1) + { + this.slots[k] = entry2; + } + else + { + entry.nextEntry = entry2; + } + + return entry1; + } + + entry = entry1; + } + + return entry1; + } + + /** + * Removes all entries from the map + */ + public void clearMap() + { + ++this.versionStamp; + IntHashMap.Entry[] aentry = this.slots; + + for (int i = 0; i < aentry.length; ++i) + { + aentry[i] = null; + } + + this.count = 0; + } + + /** + * Adds an object to a slot + */ + private void insert(int p_76040_1_, int p_76040_2_, Object p_76040_3_, int p_76040_4_) + { + IntHashMap.Entry entry = this.slots[p_76040_4_]; + this.slots[p_76040_4_] = new IntHashMap.Entry(p_76040_1_, p_76040_2_, p_76040_3_, entry); + + if (this.count++ >= this.threshold) + { + this.grow(2 * this.slots.length); + } + } + + static class Entry + { + /** The hash code of this entry */ + final int hashEntry; + /** The object stored in this entry */ + Object valueEntry; + /** The next entry in this slot */ + IntHashMap.Entry nextEntry; + /** The id of the hash slot computed from the hash */ + final int slotHash; + private static final String __OBFID = "CL_00001491"; + + Entry(int p_i1552_1_, int p_i1552_2_, Object p_i1552_3_, IntHashMap.Entry p_i1552_4_) + { + this.valueEntry = p_i1552_3_; + this.nextEntry = p_i1552_4_; + this.hashEntry = p_i1552_2_; + this.slotHash = p_i1552_1_; + } + + /** + * Returns the hash code for this entry + */ + public final int getHash() + { + return this.hashEntry; + } + + /** + * Returns the object stored in this entry + */ + public final Object getValue() + { + return this.valueEntry; + } + + public final boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof IntHashMap.Entry)) + { + return false; + } + else + { + IntHashMap.Entry entry = (IntHashMap.Entry)p_equals_1_; + Integer integer = Integer.valueOf(this.getHash()); + Integer integer1 = Integer.valueOf(entry.getHash()); + + if (integer == integer1 || integer != null && integer.equals(integer1)) + { + Object object1 = this.getValue(); + Object object2 = entry.getValue(); + + if (object1 == object2 || object1 != null && object1.equals(object2)) + { + return true; + } + } + + return false; + } + } + + public final int hashCode() + { + return IntHashMap.computeHash(this.hashEntry); + } + + public final String toString() + { + return this.getHash() + "=" + this.getValue(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/JsonSerializableSet.java b/build/rfg/minecraft-src/java/net/minecraft/util/JsonSerializableSet.java new file mode 100644 index 0000000..d3f487c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/JsonSerializableSet.java @@ -0,0 +1,53 @@ +package net.minecraft.util; + +import com.google.common.collect.ForwardingSet; +import com.google.common.collect.Sets; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import java.util.Collection; +import java.util.Iterator; +import java.util.Set; + +public class JsonSerializableSet extends ForwardingSet implements IJsonSerializable +{ + /** The set for this ForwardingSet to forward methods to. */ + private final Set underlyingSet = Sets.newHashSet(); + private static final String __OBFID = "CL_00001482"; + + public void func_152753_a(JsonElement p_152753_1_) + { + if (p_152753_1_.isJsonArray()) + { + Iterator iterator = p_152753_1_.getAsJsonArray().iterator(); + + while (iterator.hasNext()) + { + JsonElement jsonelement1 = (JsonElement)iterator.next(); + this.add(jsonelement1.getAsString()); + } + } + } + + /** + * Gets the JsonElement that can be serialized. + */ + public JsonElement getSerializableElement() + { + JsonArray jsonarray = new JsonArray(); + Iterator iterator = this.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + jsonarray.add(new JsonPrimitive(s)); + } + + return jsonarray; + } + + protected Set delegate() + { + return this.underlyingSet; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/JsonUtils.java b/build/rfg/minecraft-src/java/net/minecraft/util/JsonUtils.java new file mode 100644 index 0000000..175744d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/JsonUtils.java @@ -0,0 +1,350 @@ +package net.minecraft.util; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSyntaxException; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class JsonUtils +{ + private static final String __OBFID = "CL_00001484"; + + /** + * Does the given JsonObject contain a string field with the given name? + */ + @SideOnly(Side.CLIENT) + public static boolean jsonObjectFieldTypeIsString(JsonObject p_151205_0_, String p_151205_1_) + { + return !jsonObjectFieldTypeIsPrimitive(p_151205_0_, p_151205_1_) ? false : p_151205_0_.getAsJsonPrimitive(p_151205_1_).isString(); + } + + /** + * Is the given JsonElement a string? + */ + @SideOnly(Side.CLIENT) + public static boolean jsonElementTypeIsString(JsonElement p_151211_0_) + { + return !p_151211_0_.isJsonPrimitive() ? false : p_151211_0_.getAsJsonPrimitive().isString(); + } + + /** + * Does the given JsonObject contain an array field with the given name? + */ + public static boolean jsonObjectFieldTypeIsArray(JsonObject p_151202_0_, String p_151202_1_) + { + return !jsonObjectHasNamedField(p_151202_0_, p_151202_1_) ? false : p_151202_0_.get(p_151202_1_).isJsonArray(); + } + + /** + * Does the given JsonObject contain a field with the given name whose type is primitive (String, Java primitive, or + * Java primitive wrapper)? + */ + @SideOnly(Side.CLIENT) + public static boolean jsonObjectFieldTypeIsPrimitive(JsonObject p_151201_0_, String p_151201_1_) + { + return !jsonObjectHasNamedField(p_151201_0_, p_151201_1_) ? false : p_151201_0_.get(p_151201_1_).isJsonPrimitive(); + } + + /** + * Does the given JsonObject contain a field with the given name? + */ + public static boolean jsonObjectHasNamedField(JsonObject p_151204_0_, String p_151204_1_) + { + return p_151204_0_ == null ? false : p_151204_0_.get(p_151204_1_) != null; + } + + /** + * Gets the string value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static String getJsonElementStringValue(JsonElement p_151206_0_, String p_151206_1_) + { + if (p_151206_0_.isJsonPrimitive()) + { + return p_151206_0_.getAsString(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151206_1_ + " to be a string, was " + getJsonElementTypeDescription(p_151206_0_)); + } + } + + /** + * Gets the string value of the field on the JsonObject with the given name. + */ + public static String getJsonObjectStringFieldValue(JsonObject p_151200_0_, String p_151200_1_) + { + if (p_151200_0_.has(p_151200_1_)) + { + return getJsonElementStringValue(p_151200_0_.get(p_151200_1_), p_151200_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151200_1_ + ", expected to find a string"); + } + } + + /** + * Gets the string value of the field on the JsonObject with the given name, or the given default value if the field + * is missing. + */ + @SideOnly(Side.CLIENT) + public static String getJsonObjectStringFieldValueOrDefault(JsonObject p_151219_0_, String p_151219_1_, String p_151219_2_) + { + return p_151219_0_.has(p_151219_1_) ? getJsonElementStringValue(p_151219_0_.get(p_151219_1_), p_151219_1_) : p_151219_2_; + } + + /** + * Gets the boolean value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + @SideOnly(Side.CLIENT) + public static boolean getJsonElementBooleanValue(JsonElement p_151216_0_, String p_151216_1_) + { + if (p_151216_0_.isJsonPrimitive()) + { + return p_151216_0_.getAsBoolean(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151216_1_ + " to be a Boolean, was " + getJsonElementTypeDescription(p_151216_0_)); + } + } + + /** + * Gets the boolean value of the field on the JsonObject with the given name. + */ + @SideOnly(Side.CLIENT) + public static boolean getJsonObjectBooleanFieldValue(JsonObject p_151212_0_, String p_151212_1_) + { + if (p_151212_0_.has(p_151212_1_)) + { + return getJsonElementBooleanValue(p_151212_0_.get(p_151212_1_), p_151212_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151212_1_ + ", expected to find a Boolean"); + } + } + + /** + * Gets the boolean value of the field on the JsonObject with the given name, or the given default value if the + * field is missing. + */ + @SideOnly(Side.CLIENT) + public static boolean getJsonObjectBooleanFieldValueOrDefault(JsonObject p_151209_0_, String p_151209_1_, boolean p_151209_2_) + { + return p_151209_0_.has(p_151209_1_) ? getJsonElementBooleanValue(p_151209_0_.get(p_151209_1_), p_151209_1_) : p_151209_2_; + } + + /** + * Gets the float value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + @SideOnly(Side.CLIENT) + public static float getJsonElementFloatValue(JsonElement p_151220_0_, String p_151220_1_) + { + if (p_151220_0_.isJsonPrimitive() && p_151220_0_.getAsJsonPrimitive().isNumber()) + { + return p_151220_0_.getAsFloat(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151220_1_ + " to be a Float, was " + getJsonElementTypeDescription(p_151220_0_)); + } + } + + /** + * Gets the float value of the field on the JsonObject with the given name. + */ + @SideOnly(Side.CLIENT) + public static float getJsonObjectFloatFieldValue(JsonObject p_151217_0_, String p_151217_1_) + { + if (p_151217_0_.has(p_151217_1_)) + { + return getJsonElementFloatValue(p_151217_0_.get(p_151217_1_), p_151217_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151217_1_ + ", expected to find a Float"); + } + } + + /** + * Gets the float value of the field on the JsonObject with the given name, or the given default value if the field + * is missing. + */ + @SideOnly(Side.CLIENT) + public static float getJsonObjectFloatFieldValueOrDefault(JsonObject p_151221_0_, String p_151221_1_, float p_151221_2_) + { + return p_151221_0_.has(p_151221_1_) ? getJsonElementFloatValue(p_151221_0_.get(p_151221_1_), p_151221_1_) : p_151221_2_; + } + + /** + * Gets the integer value of the given JsonElement. Expects the second parameter to be the name of the element's + * field if an error message needs to be thrown. + */ + public static int getJsonElementIntegerValue(JsonElement p_151215_0_, String p_151215_1_) + { + if (p_151215_0_.isJsonPrimitive() && p_151215_0_.getAsJsonPrimitive().isNumber()) + { + return p_151215_0_.getAsInt(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151215_1_ + " to be a Int, was " + getJsonElementTypeDescription(p_151215_0_)); + } + } + + /** + * Gets the integer value of the field on the JsonObject with the given name. + */ + public static int getJsonObjectIntegerFieldValue(JsonObject p_151203_0_, String p_151203_1_) + { + if (p_151203_0_.has(p_151203_1_)) + { + return getJsonElementIntegerValue(p_151203_0_.get(p_151203_1_), p_151203_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151203_1_ + ", expected to find a Int"); + } + } + + /** + * Gets the integer value of the field on the JsonObject with the given name, or the given default value if the + * field is missing. + */ + @SideOnly(Side.CLIENT) + public static int getJsonObjectIntegerFieldValueOrDefault(JsonObject p_151208_0_, String p_151208_1_, int p_151208_2_) + { + return p_151208_0_.has(p_151208_1_) ? getJsonElementIntegerValue(p_151208_0_.get(p_151208_1_), p_151208_1_) : p_151208_2_; + } + + /** + * Gets the given JsonElement as a JsonObject. Expects the second parameter to be the name of the element's field + * if an error message needs to be thrown. + */ + public static JsonObject getJsonElementAsJsonObject(JsonElement p_151210_0_, String p_151210_1_) + { + if (p_151210_0_.isJsonObject()) + { + return p_151210_0_.getAsJsonObject(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151210_1_ + " to be a JsonObject, was " + getJsonElementTypeDescription(p_151210_0_)); + } + } + + @SideOnly(Side.CLIENT) + public static JsonObject func_152754_s(JsonObject base, String key) + { + if (base.has(key)) + { + return getJsonElementAsJsonObject(base.get(key), key); + } + else + { + throw new JsonSyntaxException("Missing " + key + ", expected to find a JsonObject"); + } + } + + /** + * Gets the JsonObject field on the JsonObject with the given name, or the given default value if the field is + * missing. + */ + @SideOnly(Side.CLIENT) + public static JsonObject getJsonObjectFieldOrDefault(JsonObject p_151218_0_, String p_151218_1_, JsonObject p_151218_2_) + { + return p_151218_0_.has(p_151218_1_) ? getJsonElementAsJsonObject(p_151218_0_.get(p_151218_1_), p_151218_1_) : p_151218_2_; + } + + /** + * Gets the given JsonElement as a JsonArray. Expects the second parameter to be the name of the element's field if + * an error message needs to be thrown. + */ + public static JsonArray getJsonElementAsJsonArray(JsonElement p_151207_0_, String p_151207_1_) + { + if (p_151207_0_.isJsonArray()) + { + return p_151207_0_.getAsJsonArray(); + } + else + { + throw new JsonSyntaxException("Expected " + p_151207_1_ + " to be a JsonArray, was " + getJsonElementTypeDescription(p_151207_0_)); + } + } + + /** + * Gets the JsonArray field on the JsonObject with the given name. + */ + public static JsonArray getJsonObjectJsonArrayField(JsonObject p_151214_0_, String p_151214_1_) + { + if (p_151214_0_.has(p_151214_1_)) + { + return getJsonElementAsJsonArray(p_151214_0_.get(p_151214_1_), p_151214_1_); + } + else + { + throw new JsonSyntaxException("Missing " + p_151214_1_ + ", expected to find a JsonArray"); + } + } + + /** + * Gets the JsonArray field on the JsonObject with the given name, or the given default value if the field is + * missing. + */ + @SideOnly(Side.CLIENT) + public static JsonArray getJsonObjectJsonArrayFieldOrDefault(JsonObject p_151213_0_, String p_151213_1_, JsonArray p_151213_2_) + { + return p_151213_0_.has(p_151213_1_) ? getJsonElementAsJsonArray(p_151213_0_.get(p_151213_1_), p_151213_1_) : p_151213_2_; + } + + /** + * Gets a human-readable description of the given JsonElement's type. For example: "a number (4)" + */ + public static String getJsonElementTypeDescription(JsonElement p_151222_0_) + { + String s = org.apache.commons.lang3.StringUtils.abbreviateMiddle(String.valueOf(p_151222_0_), "...", 10); + + if (p_151222_0_ == null) + { + return "null (missing)"; + } + else if (p_151222_0_.isJsonNull()) + { + return "null (json)"; + } + else if (p_151222_0_.isJsonArray()) + { + return "an array (" + s + ")"; + } + else if (p_151222_0_.isJsonObject()) + { + return "an object (" + s + ")"; + } + else + { + if (p_151222_0_.isJsonPrimitive()) + { + JsonPrimitive jsonprimitive = p_151222_0_.getAsJsonPrimitive(); + + if (jsonprimitive.isNumber()) + { + return "a number (" + s + ")"; + } + + if (jsonprimitive.isBoolean()) + { + return "a boolean (" + s + ")"; + } + } + + return s; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/LongHashMap.java b/build/rfg/minecraft-src/java/net/minecraft/util/LongHashMap.java new file mode 100644 index 0000000..467cefd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/LongHashMap.java @@ -0,0 +1,284 @@ +package net.minecraft.util; + +public class LongHashMap +{ + /** the array of all elements in the hash */ + private transient LongHashMap.Entry[] hashArray = new LongHashMap.Entry[16]; + /** the number of elements in the hash array */ + private transient int numHashElements; + /** the maximum amount of elements in the hash (probably 3/4 the size due to meh hashing function) */ + private int capacity = 12; + /** percent of the hasharray that can be used without hash colliding probably */ + private final float percentUseable = 0.75F; + /** count of times elements have been added/removed */ + private transient volatile int modCount; + private static final String __OBFID = "CL_00001492"; + + /** + * returns the hashed key given the original key + */ + private static int getHashedKey(long p_76155_0_) + { + return hash((int)(p_76155_0_ ^ p_76155_0_ >>> 32)); + } + + /** + * the hash function + */ + private static int hash(int p_76157_0_) + { + p_76157_0_ ^= p_76157_0_ >>> 20 ^ p_76157_0_ >>> 12; + return p_76157_0_ ^ p_76157_0_ >>> 7 ^ p_76157_0_ >>> 4; + } + + /** + * gets the index in the hash given the array length and the hashed key + */ + private static int getHashIndex(int p_76158_0_, int p_76158_1_) + { + return p_76158_0_ & p_76158_1_ - 1; + } + + public int getNumHashElements() + { + return this.numHashElements; + } + + /** + * get the value from the map given the key + */ + public Object getValueByKey(long p_76164_1_) + { + int j = getHashedKey(p_76164_1_); + + for (LongHashMap.Entry entry = this.hashArray[getHashIndex(j, this.hashArray.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76164_1_) + { + return entry.value; + } + } + + return null; + } + + public boolean containsItem(long p_76161_1_) + { + return this.getEntry(p_76161_1_) != null; + } + + final LongHashMap.Entry getEntry(long p_76160_1_) + { + int j = getHashedKey(p_76160_1_); + + for (LongHashMap.Entry entry = this.hashArray[getHashIndex(j, this.hashArray.length)]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76160_1_) + { + return entry; + } + } + + return null; + } + + /** + * Add a key-value pair. + */ + public void add(long p_76163_1_, Object p_76163_3_) + { + int j = getHashedKey(p_76163_1_); + int k = getHashIndex(j, this.hashArray.length); + + for (LongHashMap.Entry entry = this.hashArray[k]; entry != null; entry = entry.nextEntry) + { + if (entry.key == p_76163_1_) + { + entry.value = p_76163_3_; + return; + } + } + + ++this.modCount; + this.createKey(j, p_76163_1_, p_76163_3_, k); + } + + /** + * resizes the table + */ + private void resizeTable(int p_76153_1_) + { + LongHashMap.Entry[] aentry = this.hashArray; + int j = aentry.length; + + if (j == 1073741824) + { + this.capacity = Integer.MAX_VALUE; + } + else + { + LongHashMap.Entry[] aentry1 = new LongHashMap.Entry[p_76153_1_]; + this.copyHashTableTo(aentry1); + this.hashArray = aentry1; + this.capacity = (int)((float)p_76153_1_ * this.percentUseable); + } + } + + /** + * copies the hash table to the specified array + */ + private void copyHashTableTo(LongHashMap.Entry[] p_76154_1_) + { + LongHashMap.Entry[] aentry = this.hashArray; + int i = p_76154_1_.length; + + for (int j = 0; j < aentry.length; ++j) + { + LongHashMap.Entry entry = aentry[j]; + + if (entry != null) + { + aentry[j] = null; + LongHashMap.Entry entry1; + + do + { + entry1 = entry.nextEntry; + int k = getHashIndex(entry.hash, i); + entry.nextEntry = p_76154_1_[k]; + p_76154_1_[k] = entry; + entry = entry1; + } + while (entry1 != null); + } + } + } + + /** + * calls the removeKey method and returns removed object + */ + public Object remove(long p_76159_1_) + { + LongHashMap.Entry entry = this.removeKey(p_76159_1_); + return entry == null ? null : entry.value; + } + + /** + * removes the key from the hash linked list + */ + final LongHashMap.Entry removeKey(long p_76152_1_) + { + int j = getHashedKey(p_76152_1_); + int k = getHashIndex(j, this.hashArray.length); + LongHashMap.Entry entry = this.hashArray[k]; + LongHashMap.Entry entry1; + LongHashMap.Entry entry2; + + for (entry1 = entry; entry1 != null; entry1 = entry2) + { + entry2 = entry1.nextEntry; + + if (entry1.key == p_76152_1_) + { + ++this.modCount; + --this.numHashElements; + + if (entry == entry1) + { + this.hashArray[k] = entry2; + } + else + { + entry.nextEntry = entry2; + } + + return entry1; + } + + entry = entry1; + } + + return entry1; + } + + /** + * creates the key in the hash table + */ + private void createKey(int p_76156_1_, long p_76156_2_, Object p_76156_4_, int p_76156_5_) + { + LongHashMap.Entry entry = this.hashArray[p_76156_5_]; + this.hashArray[p_76156_5_] = new LongHashMap.Entry(p_76156_1_, p_76156_2_, p_76156_4_, entry); + + if (this.numHashElements++ >= this.capacity) + { + this.resizeTable(2 * this.hashArray.length); + } + } + + static class Entry + { + /** the key as a long (for playerInstances it is the x in the most significant 32 bits and then y) */ + final long key; + /** the value held by the hash at the specified key */ + Object value; + /** the next hashentry in the table */ + LongHashMap.Entry nextEntry; + final int hash; + private static final String __OBFID = "CL_00001493"; + + Entry(int p_i1553_1_, long p_i1553_2_, Object p_i1553_4_, LongHashMap.Entry p_i1553_5_) + { + this.value = p_i1553_4_; + this.nextEntry = p_i1553_5_; + this.key = p_i1553_2_; + this.hash = p_i1553_1_; + } + + public final long getKey() + { + return this.key; + } + + public final Object getValue() + { + return this.value; + } + + public final boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof LongHashMap.Entry)) + { + return false; + } + else + { + LongHashMap.Entry entry = (LongHashMap.Entry)p_equals_1_; + Long olong = Long.valueOf(this.getKey()); + Long olong1 = Long.valueOf(entry.getKey()); + + if (olong == olong1 || olong != null && olong.equals(olong1)) + { + Object object1 = this.getValue(); + Object object2 = entry.getValue(); + + if (object1 == object2 || object1 != null && object1.equals(object2)) + { + return true; + } + } + + return false; + } + } + + public final int hashCode() + { + return LongHashMap.getHashedKey(this.key); + } + + public final String toString() + { + return this.getKey() + "=" + this.getValue(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MathHelper.java b/build/rfg/minecraft-src/java/net/minecraft/util/MathHelper.java new file mode 100644 index 0000000..c766726 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MathHelper.java @@ -0,0 +1,405 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; + +public class MathHelper +{ + /** A table of sin values computed from 0 (inclusive) to 2*pi (exclusive), with steps of 2*PI / 65536. */ + private static float[] SIN_TABLE = new float[65536]; + /** + * Though it looks like an array, this is really more like a mapping. Key (index of this array) is the upper 5 bits + * of the result of multiplying a 32-bit unsigned integer by the B(2, 5) De Bruijn sequence 0x077CB531. Value + * (value stored in the array) is the unique index (from the right) of the leftmost one-bit in a 32-bit unsigned + * integer that can cause the upper 5 bits to get that value. Used for highly optimized "find the log-base-2 of + * this number" calculations. + */ + private static final int[] multiplyDeBruijnBitPosition; + private static final String __OBFID = "CL_00001496"; + + /** + * sin looked up in a table + */ + public static final float sin(float p_76126_0_) + { + return SIN_TABLE[(int)(p_76126_0_ * 10430.378F) & 65535]; + } + + /** + * cos looked up in the sin table with the appropriate offset + */ + public static final float cos(float p_76134_0_) + { + return SIN_TABLE[(int)(p_76134_0_ * 10430.378F + 16384.0F) & 65535]; + } + + public static final float sqrt_float(float p_76129_0_) + { + return (float)Math.sqrt((double)p_76129_0_); + } + + public static final float sqrt_double(double p_76133_0_) + { + return (float)Math.sqrt(p_76133_0_); + } + + /** + * Returns the greatest integer less than or equal to the float argument + */ + public static int floor_float(float p_76141_0_) + { + int i = (int)p_76141_0_; + return p_76141_0_ < (float)i ? i - 1 : i; + } + + /** + * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024 + */ + @SideOnly(Side.CLIENT) + public static int truncateDoubleToInt(double p_76140_0_) + { + return (int)(p_76140_0_ + 1024.0D) - 1024; + } + + /** + * Returns the greatest integer less than or equal to the double argument + */ + public static int floor_double(double p_76128_0_) + { + int i = (int)p_76128_0_; + return p_76128_0_ < (double)i ? i - 1 : i; + } + + /** + * Long version of floor_double + */ + public static long floor_double_long(double p_76124_0_) + { + long i = (long)p_76124_0_; + return p_76124_0_ < (double)i ? i - 1L : i; + } + + @SideOnly(Side.CLIENT) + public static int func_154353_e(double p_154353_0_) + { + return (int)(p_154353_0_ >= 0.0D ? p_154353_0_ : -p_154353_0_ + 1.0D); + } + + public static float abs(float p_76135_0_) + { + return p_76135_0_ >= 0.0F ? p_76135_0_ : -p_76135_0_; + } + + /** + * Returns the unsigned value of an int. + */ + public static int abs_int(int p_76130_0_) + { + return p_76130_0_ >= 0 ? p_76130_0_ : -p_76130_0_; + } + + public static int ceiling_float_int(float p_76123_0_) + { + int i = (int)p_76123_0_; + return p_76123_0_ > (float)i ? i + 1 : i; + } + + public static int ceiling_double_int(double p_76143_0_) + { + int i = (int)p_76143_0_; + return p_76143_0_ > (double)i ? i + 1 : i; + } + + /** + * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and + * third parameters. + */ + public static int clamp_int(int p_76125_0_, int p_76125_1_, int p_76125_2_) + { + return p_76125_0_ < p_76125_1_ ? p_76125_1_ : (p_76125_0_ > p_76125_2_ ? p_76125_2_ : p_76125_0_); + } + + /** + * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and + * third parameters + */ + public static float clamp_float(float p_76131_0_, float p_76131_1_, float p_76131_2_) + { + return p_76131_0_ < p_76131_1_ ? p_76131_1_ : (p_76131_0_ > p_76131_2_ ? p_76131_2_ : p_76131_0_); + } + + public static double clamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_) + { + return p_151237_0_ < p_151237_2_ ? p_151237_2_ : (p_151237_0_ > p_151237_4_ ? p_151237_4_ : p_151237_0_); + } + + public static double denormalizeClamp(double p_151238_0_, double p_151238_2_, double p_151238_4_) + { + return p_151238_4_ < 0.0D ? p_151238_0_ : (p_151238_4_ > 1.0D ? p_151238_2_ : p_151238_0_ + (p_151238_2_ - p_151238_0_) * p_151238_4_); + } + + /** + * Maximum of the absolute value of two numbers. + */ + public static double abs_max(double p_76132_0_, double p_76132_2_) + { + if (p_76132_0_ < 0.0D) + { + p_76132_0_ = -p_76132_0_; + } + + if (p_76132_2_ < 0.0D) + { + p_76132_2_ = -p_76132_2_; + } + + return p_76132_0_ > p_76132_2_ ? p_76132_0_ : p_76132_2_; + } + + /** + * Buckets an integer with specifed bucket sizes. Args: i, bucketSize + */ + @SideOnly(Side.CLIENT) + public static int bucketInt(int p_76137_0_, int p_76137_1_) + { + return p_76137_0_ < 0 ? -((-p_76137_0_ - 1) / p_76137_1_) - 1 : p_76137_0_ / p_76137_1_; + } + + /** + * Tests if a string is null or of length zero + */ + @SideOnly(Side.CLIENT) + public static boolean stringNullOrLengthZero(String p_76139_0_) + { + return p_76139_0_ == null || p_76139_0_.length() == 0; + } + + public static int getRandomIntegerInRange(Random p_76136_0_, int p_76136_1_, int p_76136_2_) + { + return p_76136_1_ >= p_76136_2_ ? p_76136_1_ : p_76136_0_.nextInt(p_76136_2_ - p_76136_1_ + 1) + p_76136_1_; + } + + public static float randomFloatClamp(Random p_151240_0_, float p_151240_1_, float p_151240_2_) + { + return p_151240_1_ >= p_151240_2_ ? p_151240_1_ : p_151240_0_.nextFloat() * (p_151240_2_ - p_151240_1_) + p_151240_1_; + } + + public static double getRandomDoubleInRange(Random p_82716_0_, double p_82716_1_, double p_82716_3_) + { + return p_82716_1_ >= p_82716_3_ ? p_82716_1_ : p_82716_0_.nextDouble() * (p_82716_3_ - p_82716_1_) + p_82716_1_; + } + + public static double average(long[] p_76127_0_) + { + long i = 0L; + long[] along1 = p_76127_0_; + int j = p_76127_0_.length; + + for (int k = 0; k < j; ++k) + { + long l = along1[k]; + i += l; + } + + return (double)i / (double)p_76127_0_.length; + } + + /** + * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check + */ + public static float wrapAngleTo180_float(float p_76142_0_) + { + p_76142_0_ %= 360.0F; + + if (p_76142_0_ >= 180.0F) + { + p_76142_0_ -= 360.0F; + } + + if (p_76142_0_ < -180.0F) + { + p_76142_0_ += 360.0F; + } + + return p_76142_0_; + } + + /** + * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check + */ + public static double wrapAngleTo180_double(double p_76138_0_) + { + p_76138_0_ %= 360.0D; + + if (p_76138_0_ >= 180.0D) + { + p_76138_0_ -= 360.0D; + } + + if (p_76138_0_ < -180.0D) + { + p_76138_0_ += 360.0D; + } + + return p_76138_0_; + } + + /** + * parses the string as integer or returns the second parameter if it fails + */ + public static int parseIntWithDefault(String p_82715_0_, int p_82715_1_) + { + int j = p_82715_1_; + + try + { + j = Integer.parseInt(p_82715_0_); + } + catch (Throwable throwable) + { + ; + } + + return j; + } + + /** + * parses the string as integer or returns the second parameter if it fails. this value is capped to par2 + */ + public static int parseIntWithDefaultAndMax(String p_82714_0_, int p_82714_1_, int p_82714_2_) + { + int k = p_82714_1_; + + try + { + k = Integer.parseInt(p_82714_0_); + } + catch (Throwable throwable) + { + ; + } + + if (k < p_82714_2_) + { + k = p_82714_2_; + } + + return k; + } + + /** + * parses the string as double or returns the second parameter if it fails. + */ + public static double parseDoubleWithDefault(String p_82712_0_, double p_82712_1_) + { + double d1 = p_82712_1_; + + try + { + d1 = Double.parseDouble(p_82712_0_); + } + catch (Throwable throwable) + { + ; + } + + return d1; + } + + public static double parseDoubleWithDefaultAndMax(String p_82713_0_, double p_82713_1_, double p_82713_3_) + { + double d2 = p_82713_1_; + + try + { + d2 = Double.parseDouble(p_82713_0_); + } + catch (Throwable throwable) + { + ; + } + + if (d2 < p_82713_3_) + { + d2 = p_82713_3_; + } + + return d2; + } + + /** + * Returns the input value rounded up to the next highest power of two. + */ + @SideOnly(Side.CLIENT) + public static int roundUpToPowerOfTwo(int p_151236_0_) + { + int j = p_151236_0_ - 1; + j |= j >> 1; + j |= j >> 2; + j |= j >> 4; + j |= j >> 8; + j |= j >> 16; + return j + 1; + } + + /** + * Is the given value a power of two? (1, 2, 4, 8, 16, ...) + */ + @SideOnly(Side.CLIENT) + private static boolean isPowerOfTwo(int p_151235_0_) + { + return p_151235_0_ != 0 && (p_151235_0_ & p_151235_0_ - 1) == 0; + } + + /** + * Uses a B(2, 5) De Bruijn sequence and a lookup table to efficiently calculate the log-base-two of the given + * value. Optimized for cases where the input value is a power-of-two. If the input value is not a power-of-two, + * then subtract 1 from the return value. + */ + @SideOnly(Side.CLIENT) + private static int calculateLogBaseTwoDeBruijn(int p_151241_0_) + { + p_151241_0_ = isPowerOfTwo(p_151241_0_) ? p_151241_0_ : roundUpToPowerOfTwo(p_151241_0_); + return multiplyDeBruijnBitPosition[(int)((long)p_151241_0_ * 125613361L >> 27) & 31]; + } + + /** + * Efficiently calculates the floor of the base-2 log of an integer value. This is effectively the index of the + * highest bit that is set. For example, if the number in binary is 0...100101, this will return 5. + */ + @SideOnly(Side.CLIENT) + public static int calculateLogBaseTwo(int p_151239_0_) + { + return calculateLogBaseTwoDeBruijn(p_151239_0_) - (isPowerOfTwo(p_151239_0_) ? 0 : 1); + } + + @SideOnly(Side.CLIENT) + public static int func_154354_b(int p_154354_0_, int p_154354_1_) + { + if (p_154354_1_ == 0) + { + return 0; + } + else + { + if (p_154354_0_ < 0) + { + p_154354_1_ *= -1; + } + + int k = p_154354_0_ % p_154354_1_; + return k == 0 ? p_154354_0_ : p_154354_0_ + p_154354_1_ - k; + } + } + + static + { + for (int var0 = 0; var0 < 65536; ++var0) + { + SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D); + } + + multiplyDeBruijnBitPosition = new int[] {0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9}; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer.java b/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer.java new file mode 100644 index 0000000..8835f5c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer.java @@ -0,0 +1,65 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageDeserializer extends ByteToMessageDecoder +{ + private static final Logger logger = LogManager.getLogger(); + private static final Marker field_150799_b = MarkerManager.getMarker("PACKET_RECEIVED", NetworkManager.logMarkerPackets); + private final NetworkStatistics field_152499_c; + private static final String __OBFID = "CL_00001252"; + + public MessageDeserializer(NetworkStatistics p_i1183_1_) + { + this.field_152499_c = p_i1183_1_; + } + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) throws IOException + { + int i = p_decode_2_.readableBytes(); + + if (i != 0) + { + PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_); + int j = packetbuffer.readVarIntFromBuffer(); + Packet packet = Packet.generatePacket((BiMap)p_decode_1_.channel().attr(NetworkManager.attrKeyReceivable).get(), j); + + if (packet == null) + { + throw new IOException("Bad packet id " + j); + } + else + { + packet.readPacketData(packetbuffer); + + if (packetbuffer.readableBytes() > 0) + { + throw new IOException("Packet was larger than I expected, found " + packetbuffer.readableBytes() + " bytes extra whilst reading packet " + j); + } + else + { + p_decode_3_.add(packet); + this.field_152499_c.func_152469_a(j, (long)i); + + if (logger.isDebugEnabled()) + { + logger.debug(field_150799_b, " IN: [{}:{}] {}[{}]", new Object[] {p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(j), packet.getClass().getName(), packet.serialize()}); + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer2.java b/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer2.java new file mode 100644 index 0000000..f57f39b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MessageDeserializer2.java @@ -0,0 +1,57 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageDecoder; +import io.netty.handler.codec.CorruptedFrameException; +import java.util.List; +import net.minecraft.network.PacketBuffer; + +public class MessageDeserializer2 extends ByteToMessageDecoder +{ + private static final String __OBFID = "CL_00001255"; + + protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List p_decode_3_) + { + p_decode_2_.markReaderIndex(); + byte[] abyte = new byte[3]; + + for (int i = 0; i < abyte.length; ++i) + { + if (!p_decode_2_.isReadable()) + { + p_decode_2_.resetReaderIndex(); + return; + } + + abyte[i] = p_decode_2_.readByte(); + + if (abyte[i] >= 0) + { + PacketBuffer packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(abyte)); + + try + { + int j = packetbuffer.readVarIntFromBuffer(); + + if (p_decode_2_.readableBytes() >= j) + { + p_decode_3_.add(p_decode_2_.readBytes(j)); + return; + } + + p_decode_2_.resetReaderIndex(); + } + finally + { + packetbuffer.release(); + } + + return; + } + } + + throw new CorruptedFrameException("length wider than 21-bit"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer.java b/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer.java new file mode 100644 index 0000000..518a29a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer.java @@ -0,0 +1,55 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import java.io.IOException; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.NetworkStatistics; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import org.apache.logging.log4j.MarkerManager; + +public class MessageSerializer extends MessageToByteEncoder +{ + private static final Logger logger = LogManager.getLogger(); + private static final Marker field_150797_b = MarkerManager.getMarker("PACKET_SENT", NetworkManager.logMarkerPackets); + private final NetworkStatistics field_152500_c; + private static final String __OBFID = "CL_00001253"; + + public MessageSerializer(NetworkStatistics p_i1182_1_) + { + this.field_152500_c = p_i1182_1_; + } + + protected void encode(ChannelHandlerContext p_encode_1_, Packet p_encode_2_, ByteBuf p_encode_3_) throws IOException + { + Integer integer = (Integer)((BiMap)p_encode_1_.channel().attr(NetworkManager.attrKeySendable).get()).inverse().get(p_encode_2_.getClass()); + + if (logger.isDebugEnabled()) + { + logger.debug(field_150797_b, "OUT: [{}:{}] {}[{}]", new Object[] {p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), integer, p_encode_2_.getClass().getName(), p_encode_2_.serialize()}); + } + + if (integer == null) + { + throw new IOException("Can\'t serialize unregistered packet"); + } + else + { + PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_); + packetbuffer.writeVarIntToBuffer(integer.intValue()); + p_encode_2_.writePacketData(packetbuffer); + this.field_152500_c.func_152464_b(integer.intValue(), (long)packetbuffer.readableBytes()); + } + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) throws IOException + { + this.encode(p_encode_1_, (Packet)p_encode_2_, p_encode_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer2.java b/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer2.java new file mode 100644 index 0000000..d306fe3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MessageSerializer2.java @@ -0,0 +1,34 @@ +package net.minecraft.util; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.MessageToByteEncoder; +import net.minecraft.network.PacketBuffer; + +public class MessageSerializer2 extends MessageToByteEncoder +{ + private static final String __OBFID = "CL_00001256"; + + protected void encode(ChannelHandlerContext p_encode_1_, ByteBuf p_encode_2_, ByteBuf p_encode_3_) + { + int i = p_encode_2_.readableBytes(); + int j = PacketBuffer.getVarIntSize(i); + + if (j > 3) + { + throw new IllegalArgumentException("unable to fit " + i + " into " + 3); + } + else + { + PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_); + packetbuffer.ensureWritable(j + i); + packetbuffer.writeVarIntToBuffer(i); + packetbuffer.writeBytes(p_encode_2_, p_encode_2_.readerIndex(), i); + } + } + + protected void encode(ChannelHandlerContext p_encode_1_, Object p_encode_2_, ByteBuf p_encode_3_) + { + this.encode(p_encode_1_, (ByteBuf)p_encode_2_, p_encode_3_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MinecraftError.java b/build/rfg/minecraft-src/java/net/minecraft/util/MinecraftError.java new file mode 100644 index 0000000..88eaa9d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MinecraftError.java @@ -0,0 +1,10 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class MinecraftError extends Error +{ + private static final String __OBFID = "CL_00000657"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MouseFilter.java b/build/rfg/minecraft-src/java/net/minecraft/util/MouseFilter.java new file mode 100644 index 0000000..4251a4f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MouseFilter.java @@ -0,0 +1,31 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class MouseFilter +{ + private float field_76336_a; + private float field_76334_b; + private float field_76335_c; + private static final String __OBFID = "CL_00001500"; + + /** + * Smooths mouse input + */ + public float smooth(float p_76333_1_, float p_76333_2_) + { + this.field_76336_a += p_76333_1_; + p_76333_1_ = (this.field_76336_a - this.field_76334_b) * p_76333_2_; + this.field_76335_c += (p_76333_1_ - this.field_76335_c) * 0.5F; + + if (p_76333_1_ > 0.0F && p_76333_1_ > this.field_76335_c || p_76333_1_ < 0.0F && p_76333_1_ < this.field_76335_c) + { + p_76333_1_ = this.field_76335_c; + } + + this.field_76334_b += p_76333_1_; + return p_76333_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MouseHelper.java b/build/rfg/minecraft-src/java/net/minecraft/util/MouseHelper.java new file mode 100644 index 0000000..33af7f1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MouseHelper.java @@ -0,0 +1,42 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; + +@SideOnly(Side.CLIENT) +public class MouseHelper +{ + /** Mouse delta X this frame */ + public int deltaX; + /** Mouse delta Y this frame */ + public int deltaY; + private static final String __OBFID = "CL_00000648"; + + /** + * Grabs the mouse cursor it doesn't move and isn't seen. + */ + public void grabMouseCursor() + { + if (Boolean.parseBoolean(System.getProperty("fml.noGrab","false"))) return; + Mouse.setGrabbed(true); + this.deltaX = 0; + this.deltaY = 0; + } + + /** + * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen + */ + public void ungrabMouseCursor() + { + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(false); + } + + public void mouseXYChange() + { + this.deltaX = Mouse.getDX(); + this.deltaY = Mouse.getDY(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MovementInput.java b/build/rfg/minecraft-src/java/net/minecraft/util/MovementInput.java new file mode 100644 index 0000000..60ac5a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MovementInput.java @@ -0,0 +1,18 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class MovementInput +{ + /** The speed at which the player is strafing. Postive numbers to the left and negative to the right. */ + public float moveStrafe; + /** The speed at which the player is moving forward. Negative numbers will move backwards. */ + public float moveForward; + public boolean jump; + public boolean sneak; + private static final String __OBFID = "CL_00000936"; + + public void updatePlayerMoveState() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MovementInputFromOptions.java b/build/rfg/minecraft-src/java/net/minecraft/util/MovementInputFromOptions.java new file mode 100644 index 0000000..79633b5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MovementInputFromOptions.java @@ -0,0 +1,52 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.settings.GameSettings; + +@SideOnly(Side.CLIENT) +public class MovementInputFromOptions extends MovementInput +{ + private GameSettings gameSettings; + private static final String __OBFID = "CL_00000937"; + + public MovementInputFromOptions(GameSettings p_i1237_1_) + { + this.gameSettings = p_i1237_1_; + } + + public void updatePlayerMoveState() + { + this.moveStrafe = 0.0F; + this.moveForward = 0.0F; + + if (this.gameSettings.keyBindForward.getIsKeyPressed()) + { + ++this.moveForward; + } + + if (this.gameSettings.keyBindBack.getIsKeyPressed()) + { + --this.moveForward; + } + + if (this.gameSettings.keyBindLeft.getIsKeyPressed()) + { + ++this.moveStrafe; + } + + if (this.gameSettings.keyBindRight.getIsKeyPressed()) + { + --this.moveStrafe; + } + + this.jump = this.gameSettings.keyBindJump.getIsKeyPressed(); + this.sneak = this.gameSettings.keyBindSneak.getIsKeyPressed(); + + if (this.sneak) + { + this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); + this.moveForward = (float)((double)this.moveForward * 0.3D); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/MovingObjectPosition.java b/build/rfg/minecraft-src/java/net/minecraft/util/MovingObjectPosition.java new file mode 100644 index 0000000..3a3fe1e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/MovingObjectPosition.java @@ -0,0 +1,72 @@ +package net.minecraft.util; + +import net.minecraft.entity.Entity; + +public class MovingObjectPosition +{ + /** What type of ray trace hit was this? 0 = block, 1 = entity */ + public MovingObjectPosition.MovingObjectType typeOfHit; + /** x coordinate of the block ray traced against */ + public int blockX; + /** y coordinate of the block ray traced against */ + public int blockY; + /** z coordinate of the block ray traced against */ + public int blockZ; + /** + * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West + * = 3, North = 4, South = 5. + */ + public int sideHit; + /** The vector position of the hit */ + public Vec3 hitVec; + /** The hit entity */ + public Entity entityHit; + private static final String __OBFID = "CL_00000610"; + + /** Used to determine what sub-segment is hit */ + public int subHit = -1; + + /** Used to add extra hit info */ + public Object hitInfo = null; + + public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) + { + this(p_i2303_1_, p_i2303_2_, p_i2303_3_, p_i2303_4_, p_i2303_5_, true); + } + + public MovingObjectPosition(int p_i45481_1_, int p_i45481_2_, int p_i45481_3_, int p_i45481_4_, Vec3 p_i45481_5_, boolean p_i45481_6_) + { + this.typeOfHit = p_i45481_6_ ? MovingObjectPosition.MovingObjectType.BLOCK : MovingObjectPosition.MovingObjectType.MISS; + this.blockX = p_i45481_1_; + this.blockY = p_i45481_2_; + this.blockZ = p_i45481_3_; + this.sideHit = p_i45481_4_; + this.hitVec = Vec3.createVectorHelper(p_i45481_5_.xCoord, p_i45481_5_.yCoord, p_i45481_5_.zCoord); + } + + public MovingObjectPosition(Entity p_i2304_1_) + { + this(p_i2304_1_, Vec3.createVectorHelper(p_i2304_1_.posX, p_i2304_1_.posY, p_i2304_1_.posZ)); + } + + public MovingObjectPosition(Entity p_i45482_1_, Vec3 p_i45482_2_) + { + this.typeOfHit = MovingObjectPosition.MovingObjectType.ENTITY; + this.entityHit = p_i45482_1_; + this.hitVec = p_i45482_2_; + } + + public String toString() + { + return "HitResult{type=" + this.typeOfHit + ", x=" + this.blockX + ", y=" + this.blockY + ", z=" + this.blockZ + ", f=" + this.sideHit + ", pos=" + this.hitVec + ", entity=" + this.entityHit + '}'; + } + + public static enum MovingObjectType + { + MISS, + BLOCK, + ENTITY; + + private static final String __OBFID = "CL_00000611"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ObjectIntIdentityMap.java b/build/rfg/minecraft-src/java/net/minecraft/util/ObjectIntIdentityMap.java new file mode 100644 index 0000000..fb5222c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ObjectIntIdentityMap.java @@ -0,0 +1,48 @@ +package net.minecraft.util; + +import com.google.common.base.Predicates; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.List; + +public class ObjectIntIdentityMap implements IObjectIntIterable +{ + protected IdentityHashMap field_148749_a = new IdentityHashMap(512); + protected List field_148748_b = Lists.newArrayList(); + private static final String __OBFID = "CL_00001203"; + + public void func_148746_a(Object p_148746_1_, int p_148746_2_) + { + this.field_148749_a.put(p_148746_1_, Integer.valueOf(p_148746_2_)); + + while (this.field_148748_b.size() <= p_148746_2_) + { + this.field_148748_b.add((Object)null); + } + + this.field_148748_b.set(p_148746_2_, p_148746_1_); + } + + public int func_148747_b(Object p_148747_1_) + { + Integer integer = (Integer)this.field_148749_a.get(p_148747_1_); + return integer == null ? -1 : integer.intValue(); + } + + public Object func_148745_a(int p_148745_1_) + { + return p_148745_1_ >= 0 && p_148745_1_ < this.field_148748_b.size() ? this.field_148748_b.get(p_148745_1_) : null; + } + + public Iterator iterator() + { + return Iterators.filter(this.field_148748_b.iterator(), Predicates.notNull()); + } + + public boolean func_148744_b(int p_148744_1_) + { + return this.func_148745_a(p_148744_1_) != null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/RegistryDefaulted.java b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryDefaulted.java new file mode 100644 index 0000000..3583690 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryDefaulted.java @@ -0,0 +1,19 @@ +package net.minecraft.util; + +public class RegistryDefaulted extends RegistrySimple +{ + /** Default object for this registry, returned when an object is not found. */ + private final Object defaultObject; + private static final String __OBFID = "CL_00001198"; + + public RegistryDefaulted(Object p_i1366_1_) + { + this.defaultObject = p_i1366_1_; + } + + public Object getObject(Object p_82594_1_) + { + Object object1 = super.getObject(p_82594_1_); + return object1 == null ? this.defaultObject : object1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespaced.java b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespaced.java new file mode 100644 index 0000000..35e77c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespaced.java @@ -0,0 +1,109 @@ +package net.minecraft.util; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import java.util.Iterator; +import java.util.Map; + +public class RegistryNamespaced extends RegistrySimple implements IObjectIntIterable +{ + /** The backing store that maps Integers to objects. */ + protected ObjectIntIdentityMap underlyingIntegerMap = new ObjectIntIdentityMap(); + protected final Map field_148758_b; + private static final String __OBFID = "CL_00001206"; + + public RegistryNamespaced() + { + this.field_148758_b = ((BiMap)this.registryObjects).inverse(); + } + + /** + * Adds a new object to this registry, keyed by both the given integer ID and the given string. + */ + public void addObject(int p_148756_1_, String p_148756_2_, Object p_148756_3_) + { + this.underlyingIntegerMap.func_148746_a(p_148756_3_, p_148756_1_); + this.putObject(ensureNamespaced(p_148756_2_), p_148756_3_); + } + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() + { + return HashBiMap.create(); + } + + public Object getObject(String p_82594_1_) + { + return super.getObject(ensureNamespaced(p_82594_1_)); + } + + /** + * Gets the name we use to identify the given object. + */ + public String getNameForObject(Object p_148750_1_) + { + return (String)this.field_148758_b.get(p_148750_1_); + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(String p_148741_1_) + { + return super.containsKey(ensureNamespaced(p_148741_1_)); + } + + /** + * Gets the integer ID we use to identify the given object. + */ + public int getIDForObject(Object p_148757_1_) + { + return this.underlyingIntegerMap.func_148747_b(p_148757_1_); + } + + /** + * Gets the object identified by the given ID. + */ + public Object getObjectById(int p_148754_1_) + { + return this.underlyingIntegerMap.func_148745_a(p_148754_1_); + } + + public Iterator iterator() + { + return this.underlyingIntegerMap.iterator(); + } + + /** + * Gets a value indicating whether this registry contains an object that can be identified by the given integer + * value + */ + public boolean containsId(int p_148753_1_) + { + return this.underlyingIntegerMap.func_148744_b(p_148753_1_); + } + + /** + * Ensures that the given name is indicated by a colon-delimited namespace, prepending "minecraft:" if it is not + * already. + */ + protected static String ensureNamespaced(String p_148755_0_) + { + return p_148755_0_.indexOf(58) == -1 ? "minecraft:" + p_148755_0_ : p_148755_0_; + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(Object p_148741_1_) + { + return this.containsKey((String)p_148741_1_); + } + + public Object getObject(Object p_82594_1_) + { + return this.getObject((String)p_82594_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java new file mode 100644 index 0000000..c33c4df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/RegistryNamespacedDefaultedByKey.java @@ -0,0 +1,46 @@ +package net.minecraft.util; + +public class RegistryNamespacedDefaultedByKey extends RegistryNamespaced +{ + private final String field_148760_d; + private Object field_148761_e; + private static final String __OBFID = "CL_00001196"; + + public RegistryNamespacedDefaultedByKey(String p_i45127_1_) + { + this.field_148760_d = p_i45127_1_; + } + + /** + * Adds a new object to this registry, keyed by both the given integer ID and the given string. + */ + public void addObject(int p_148756_1_, String p_148756_2_, Object p_148756_3_) + { + if (this.field_148760_d.equals(p_148756_2_)) + { + this.field_148761_e = p_148756_3_; + } + + super.addObject(p_148756_1_, p_148756_2_, p_148756_3_); + } + + public Object getObject(String p_82594_1_) + { + Object object = super.getObject(p_82594_1_); + return object == null ? this.field_148761_e : object; + } + + /** + * Gets the object identified by the given ID. + */ + public Object getObjectById(int p_148754_1_) + { + Object object = super.getObjectById(p_148754_1_); + return object == null ? this.field_148761_e : object; + } + + public Object getObject(Object p_82594_1_) + { + return this.getObject((String)p_82594_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/RegistrySimple.java b/build/rfg/minecraft-src/java/net/minecraft/util/RegistrySimple.java new file mode 100644 index 0000000..e70f8f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/RegistrySimple.java @@ -0,0 +1,58 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class RegistrySimple implements IRegistry +{ + private static final Logger logger = LogManager.getLogger(); + /** Objects registered on this registry. */ + protected final Map registryObjects = this.createUnderlyingMap(); + private static final String __OBFID = "CL_00001210"; + + /** + * Creates the Map we will use to map keys to their registered values. + */ + protected Map createUnderlyingMap() + { + return Maps.newHashMap(); + } + + public Object getObject(Object p_82594_1_) + { + return this.registryObjects.get(p_82594_1_); + } + + /** + * Register an object on this registry. + */ + public void putObject(Object p_82595_1_, Object p_82595_2_) + { + if (this.registryObjects.containsKey(p_82595_1_)) + { + logger.debug("Adding duplicate key \'" + p_82595_1_ + "\' to registry"); + } + + this.registryObjects.put(p_82595_1_, p_82595_2_); + } + + /** + * Gets all the keys recognized by this registry. + */ + public Set getKeys() + { + return Collections.unmodifiableSet(this.registryObjects.keySet()); + } + + /** + * Does this registry contain an entry for the given key? + */ + public boolean containsKey(Object p_148741_1_) + { + return this.registryObjects.containsKey(p_148741_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ReportedException.java b/build/rfg/minecraft-src/java/net/minecraft/util/ReportedException.java new file mode 100644 index 0000000..47c160f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ReportedException.java @@ -0,0 +1,33 @@ +package net.minecraft.util; + +import net.minecraft.crash.CrashReport; + +public class ReportedException extends RuntimeException +{ + /** Instance of CrashReport. */ + private final CrashReport theReportedExceptionCrashReport; + private static final String __OBFID = "CL_00001579"; + + public ReportedException(CrashReport p_i1356_1_) + { + this.theReportedExceptionCrashReport = p_i1356_1_; + } + + /** + * Gets the CrashReport wrapped by this exception. + */ + public CrashReport getCrashReport() + { + return this.theReportedExceptionCrashReport; + } + + public Throwable getCause() + { + return this.theReportedExceptionCrashReport.getCrashCause(); + } + + public String getMessage() + { + return this.theReportedExceptionCrashReport.getDescription(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ResourceLocation.java b/build/rfg/minecraft-src/java/net/minecraft/util/ResourceLocation.java new file mode 100644 index 0000000..8cc13f0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ResourceLocation.java @@ -0,0 +1,83 @@ +package net.minecraft.util; + +import org.apache.commons.lang3.Validate; + +public class ResourceLocation +{ + private final String resourceDomain; + private final String resourcePath; + private static final String __OBFID = "CL_00001082"; + + public ResourceLocation(String p_i1292_1_, String p_i1292_2_) + { + Validate.notNull(p_i1292_2_); + + if (p_i1292_1_ != null && p_i1292_1_.length() != 0) + { + this.resourceDomain = p_i1292_1_; + } + else + { + this.resourceDomain = "minecraft"; + } + + this.resourcePath = p_i1292_2_; + } + + public ResourceLocation(String p_i1293_1_) + { + String s1 = "minecraft"; + String s2 = p_i1293_1_; + int i = p_i1293_1_.indexOf(58); + + if (i >= 0) + { + s2 = p_i1293_1_.substring(i + 1, p_i1293_1_.length()); + + if (i > 1) + { + s1 = p_i1293_1_.substring(0, i); + } + } + + this.resourceDomain = s1.toLowerCase(); + this.resourcePath = s2; + } + + public String getResourcePath() + { + return this.resourcePath; + } + + public String getResourceDomain() + { + return this.resourceDomain; + } + + public String toString() + { + return this.resourceDomain + ":" + this.resourcePath; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ResourceLocation)) + { + return false; + } + else + { + ResourceLocation resourcelocation = (ResourceLocation)p_equals_1_; + return this.resourceDomain.equals(resourcelocation.resourceDomain) && this.resourcePath.equals(resourcelocation.resourcePath); + } + } + + public int hashCode() + { + return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ScreenShotHelper.java b/build/rfg/minecraft-src/java/net/minecraft/util/ScreenShotHelper.java new file mode 100644 index 0000000..ed1de3c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ScreenShotHelper.java @@ -0,0 +1,151 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.image.BufferedImage; +import java.io.File; +import java.nio.IntBuffer; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import javax.imageio.ImageIO; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +@SideOnly(Side.CLIENT) +public class ScreenShotHelper +{ + private static final Logger logger = LogManager.getLogger(); + private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); + /** A buffer to hold pixel values returned by OpenGL. */ + private static IntBuffer pixelBuffer; + /** The built-up array that contains all the pixel values returned by OpenGL. */ + private static int[] pixelValues; + private static final String __OBFID = "CL_00000656"; + + /** + * Saves a screenshot in the game directory with a time-stamped filename. Args: gameDirectory, + * requestedWidthInPixels, requestedHeightInPixels, frameBuffer + */ + public static IChatComponent saveScreenshot(File p_148260_0_, int p_148260_1_, int p_148260_2_, Framebuffer p_148260_3_) + { + return saveScreenshot(p_148260_0_, (String)null, p_148260_1_, p_148260_2_, p_148260_3_); + } + + /** + * Saves a screenshot in the game directory with the given file name (or null to generate a time-stamped name). + * Args: gameDirectory, fileName, requestedWidthInPixels, requestedHeightInPixels, frameBuffer + */ + public static IChatComponent saveScreenshot(File p_148259_0_, String p_148259_1_, int p_148259_2_, int p_148259_3_, Framebuffer p_148259_4_) + { + try + { + File file2 = new File(p_148259_0_, "screenshots"); + file2.mkdir(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + p_148259_2_ = p_148259_4_.framebufferTextureWidth; + p_148259_3_ = p_148259_4_.framebufferTextureHeight; + } + + int k = p_148259_2_ * p_148259_3_; + + if (pixelBuffer == null || pixelBuffer.capacity() < k) + { + pixelBuffer = BufferUtils.createIntBuffer(k); + pixelValues = new int[k]; + } + + GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); + GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); + pixelBuffer.clear(); + + if (OpenGlHelper.isFramebufferEnabled()) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_148259_4_.framebufferTexture); + GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); + } + else + { + GL11.glReadPixels(0, 0, p_148259_2_, p_148259_3_, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); + } + + pixelBuffer.get(pixelValues); + TextureUtil.func_147953_a(pixelValues, p_148259_2_, p_148259_3_); + BufferedImage bufferedimage = null; + + if (OpenGlHelper.isFramebufferEnabled()) + { + bufferedimage = new BufferedImage(p_148259_4_.framebufferWidth, p_148259_4_.framebufferHeight, 1); + int l = p_148259_4_.framebufferTextureHeight - p_148259_4_.framebufferHeight; + + for (int i1 = l; i1 < p_148259_4_.framebufferTextureHeight; ++i1) + { + for (int j1 = 0; j1 < p_148259_4_.framebufferWidth; ++j1) + { + bufferedimage.setRGB(j1, i1 - l, pixelValues[i1 * p_148259_4_.framebufferTextureWidth + j1]); + } + } + } + else + { + bufferedimage = new BufferedImage(p_148259_2_, p_148259_3_, 1); + bufferedimage.setRGB(0, 0, p_148259_2_, p_148259_3_, pixelValues, 0, p_148259_2_); + } + + File file3; + + if (p_148259_1_ == null) + { + file3 = getTimestampedPNGFileForDirectory(file2); + } + else + { + file3 = new File(file2, p_148259_1_); + } + + ImageIO.write(bufferedimage, "png", file3); + ChatComponentText chatcomponenttext = new ChatComponentText(file3.getName()); + chatcomponenttext.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file3.getAbsolutePath())); + chatcomponenttext.getChatStyle().setUnderlined(Boolean.valueOf(true)); + return new ChatComponentTranslation("screenshot.success", new Object[] {chatcomponenttext}); + } + catch (Exception exception) + { + logger.warn("Couldn\'t save screenshot", exception); + return new ChatComponentTranslation("screenshot.failure", new Object[] {exception.getMessage()}); + } + } + + /** + * Creates a unique PNG file in the given directory named by a timestamp. Handles cases where the timestamp alone + * is not enough to create a uniquely named file, though it still might suffer from an unlikely race condition where + * the filename was unique when this method was called, but another process or thread created a file at the same + * path immediately after this method returned. + */ + private static File getTimestampedPNGFileForDirectory(File p_74290_0_) + { + String s = dateFormat.format(new Date()).toString(); + int i = 1; + + while (true) + { + File file2 = new File(p_74290_0_, s + (i == 1 ? "" : "_" + i) + ".png"); + + if (!file2.exists()) + { + return file2; + } + + ++i; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Session.java b/build/rfg/minecraft-src/java/net/minecraft/util/Session.java new file mode 100644 index 0000000..09c59fa --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Session.java @@ -0,0 +1,111 @@ +package net.minecraft.util; + +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; +import com.mojang.util.UUIDTypeAdapter; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Map; +import java.util.UUID; + +@SideOnly(Side.CLIENT) +public class Session +{ + private final String username; + private final String playerID; + private final String token; + private final Session.Type field_152429_d; + private static final String __OBFID = "CL_00000659"; + + public Session(String p_i1098_1_, String p_i1098_2_, String p_i1098_3_, String p_i1098_4_) + { + if (p_i1098_1_ == null || p_i1098_1_.isEmpty()) + { + p_i1098_1_ = "MissingName"; + p_i1098_2_ = p_i1098_3_ = "NotValid"; + System.out.println("========================================================="); + System.out.println("Warning the username was not set for this session, typically"); + System.out.println("this means you installed Forge incorrectly. We have set your"); + System.out.println("name to \"MissingName\" and your session to nothing. Please"); + System.out.println("check your instllation and post a console log from the launcher"); + System.out.println("when asking for help!"); + System.out.println("========================================================="); + + } + this.username = p_i1098_1_; + this.playerID = p_i1098_2_; + this.token = p_i1098_3_; + this.field_152429_d = Session.Type.func_152421_a(p_i1098_4_); + } + + public String getSessionID() + { + return "token:" + this.token + ":" + this.playerID; + } + + public String getPlayerID() + { + return this.playerID; + } + + public String getUsername() + { + return this.username; + } + + public String getToken() + { + return this.token; + } + + public GameProfile func_148256_e() + { + try + { + UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID()); + return new GameProfile(uuid, this.getUsername()); + } + catch (IllegalArgumentException illegalargumentexception) + { + return new GameProfile(net.minecraft.entity.player.EntityPlayer.func_146094_a(new GameProfile((UUID)null, this.getUsername())), this.getUsername()); + } + } + + public Session.Type func_152428_f() + { + return this.field_152429_d; + } + + @SideOnly(Side.CLIENT) + public static enum Type + { + LEGACY("legacy"), + MOJANG("mojang"); + private static final Map field_152425_c = Maps.newHashMap(); + private final String field_152426_d; + + private static final String __OBFID = "CL_00001851"; + + private Type(String p_i1096_3_) + { + this.field_152426_d = p_i1096_3_; + } + + public static Session.Type func_152421_a(String p_152421_0_) + { + return (Session.Type)field_152425_c.get(p_152421_0_.toLowerCase()); + } + + static + { + Session.Type[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + Session.Type var3 = var0[var2]; + field_152425_c.put(var3.field_152426_d, var3); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/StatCollector.java b/build/rfg/minecraft-src/java/net/minecraft/util/StatCollector.java new file mode 100644 index 0000000..74fcd1a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/StatCollector.java @@ -0,0 +1,53 @@ +package net.minecraft.util; + +public class StatCollector +{ + private static StringTranslate localizedName = StringTranslate.getInstance(); + /** + * A StringTranslate instance using the hardcoded default locale (en_US). Used as a fallback in case the shared + * StringTranslate singleton instance fails to translate a key. + */ + private static StringTranslate fallbackTranslator = new StringTranslate(); + private static final String __OBFID = "CL_00001211"; + + /** + * Translates a Stat name + */ + public static String translateToLocal(String p_74838_0_) + { + return localizedName.translateKey(p_74838_0_); + } + + /** + * Translates a Stat name with format args + */ + public static String translateToLocalFormatted(String p_74837_0_, Object ... p_74837_1_) + { + return localizedName.translateKeyFormat(p_74837_0_, p_74837_1_); + } + + /** + * Translates a Stat name using the fallback (hardcoded en_US) locale. Looks like it's only intended to be used if + * translateToLocal fails. + */ + public static String translateToFallback(String p_150826_0_) + { + return fallbackTranslator.translateKey(p_150826_0_); + } + + /** + * Determines whether or not translateToLocal will find a translation for the given key. + */ + public static boolean canTranslate(String p_94522_0_) + { + return localizedName.containsTranslateKey(p_94522_0_); + } + + /** + * Gets the time, in milliseconds since epoch, that the translation mapping was last updated + */ + public static long getLastTranslationUpdateTimeInMilliseconds() + { + return localizedName.getLastUpdateTimeInMilliseconds(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/StringTranslate.java b/build/rfg/minecraft-src/java/net/minecraft/util/StringTranslate.java new file mode 100644 index 0000000..01fd826 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/StringTranslate.java @@ -0,0 +1,150 @@ +package net.minecraft.util; + +import com.google.common.base.Splitter; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.IllegalFormatException; +import java.util.Iterator; +import java.util.Map; +import java.util.regex.Pattern; +import org.apache.commons.io.Charsets; +import org.apache.commons.io.IOUtils; + +public class StringTranslate +{ + /** Pattern that matches numeric variable placeholders in a resource string, such as "%d", "%3$d", "%.2f" */ + private static final Pattern numericVariablePattern = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + /** A Splitter that splits a string on the first "=". For example, "a=b=c" would split into ["a", "b=c"]. */ + private static final Splitter equalSignSplitter = Splitter.on('=').limit(2); + private final Map languageList; + /** Is the private singleton instance of StringTranslate. */ + private static StringTranslate instance = new StringTranslate(); + /** The time, in milliseconds since epoch, that this instance was last updated */ + private long lastUpdateTimeInMilliseconds; + private static final String __OBFID = "CL_00001212"; + + public StringTranslate() + { + InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + languageList = Maps.newHashMap(); + inject(this, inputstream); + } + + public static void inject(InputStream inputstream) + { + inject(instance, inputstream); + } + + private static void inject(StringTranslate inst, InputStream inputstream) + { + HashMap map = parseLangFile(inputstream); + inst.languageList.putAll(map); + inst.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + public static HashMap parseLangFile(InputStream inputstream) + { + HashMap table = Maps.newHashMap(); + try + { + Iterator iterator = IOUtils.readLines(inputstream, Charsets.UTF_8).iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (!s.isEmpty() && s.charAt(0) != 35) + { + String[] astring = (String[])Iterables.toArray(equalSignSplitter.split(s), String.class); + + if (astring != null && astring.length == 2) + { + String s1 = astring[0]; + String s2 = numericVariablePattern.matcher(astring[1]).replaceAll("%$1s"); + table.put(s1, s2); + } + } + } + + } + catch (Exception ioexception) + { + ; + } + return table; + } + + /** + * Return the StringTranslate singleton instance + */ + static StringTranslate getInstance() + { + return instance; + } + + @SideOnly(Side.CLIENT) + + /** + * Replaces all the current instance's translations with the ones that are passed in. + */ + public static synchronized void replaceWith(Map p_135063_0_) + { + instance.languageList.clear(); + instance.languageList.putAll(p_135063_0_); + instance.lastUpdateTimeInMilliseconds = System.currentTimeMillis(); + } + + /** + * Translate a key to current language. + */ + public synchronized String translateKey(String p_74805_1_) + { + return this.tryTranslateKey(p_74805_1_); + } + + /** + * Translate a key to current language applying String.format() + */ + public synchronized String translateKeyFormat(String p_74803_1_, Object ... p_74803_2_) + { + String s1 = this.tryTranslateKey(p_74803_1_); + + try + { + return String.format(s1, p_74803_2_); + } + catch (IllegalFormatException illegalformatexception) + { + return "Format error: " + s1; + } + } + + /** + * Tries to look up a translation for the given key; spits back the key if no result was found. + */ + private String tryTranslateKey(String p_135064_1_) + { + String s1 = (String)this.languageList.get(p_135064_1_); + return s1 == null ? p_135064_1_ : s1; + } + + public synchronized boolean containsTranslateKey(String p_94520_1_) + { + return this.languageList.containsKey(p_94520_1_); + } + + /** + * Gets the time, in milliseconds since epoch, that this instance was last updated + */ + public long getLastUpdateTimeInMilliseconds() + { + return this.lastUpdateTimeInMilliseconds; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/StringUtils.java b/build/rfg/minecraft-src/java/net/minecraft/util/StringUtils.java new file mode 100644 index 0000000..7f832f7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/StringUtils.java @@ -0,0 +1,37 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.regex.Pattern; + +public class StringUtils +{ + private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); + private static final String __OBFID = "CL_00001501"; + + /** + * Returns the time elapsed for the given number of ticks, in "mm:ss" format. + */ + @SideOnly(Side.CLIENT) + public static String ticksToElapsedTime(int p_76337_0_) + { + int j = p_76337_0_ / 20; + int k = j / 60; + j %= 60; + return j < 10 ? k + ":0" + j : k + ":" + j; + } + + @SideOnly(Side.CLIENT) + public static String stripControlCodes(String p_76338_0_) + { + return patternControlCode.matcher(p_76338_0_).replaceAll(""); + } + + /** + * Returns a value indicating whether the given string is null or empty. + */ + public static boolean isNullOrEmpty(String p_151246_0_) + { + return p_151246_0_ == null || "".equals(p_151246_0_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/ThreadSafeBoundList.java b/build/rfg/minecraft-src/java/net/minecraft/util/ThreadSafeBoundList.java new file mode 100644 index 0000000..6e75f0b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/ThreadSafeBoundList.java @@ -0,0 +1,68 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.lang.reflect.Array; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +@SideOnly(Side.CLIENT) +public class ThreadSafeBoundList +{ + private final Object[] field_152759_a; + private final Class field_152760_b; + private final ReadWriteLock field_152761_c = new ReentrantReadWriteLock(); + private int field_152762_d; + private int field_152763_e; + private static final String __OBFID = "CL_00001868"; + + public ThreadSafeBoundList(Class p_i1126_1_, int p_i1126_2_) + { + this.field_152760_b = p_i1126_1_; + this.field_152759_a = (Object[])((Object[])Array.newInstance(p_i1126_1_, p_i1126_2_)); + } + + public Object func_152757_a(Object p_152757_1_) + { + this.field_152761_c.writeLock().lock(); + this.field_152759_a[this.field_152763_e] = p_152757_1_; + this.field_152763_e = (this.field_152763_e + 1) % this.func_152758_b(); + + if (this.field_152762_d < this.func_152758_b()) + { + ++this.field_152762_d; + } + + this.field_152761_c.writeLock().unlock(); + return p_152757_1_; + } + + public int func_152758_b() + { + this.field_152761_c.readLock().lock(); + int i = this.field_152759_a.length; + this.field_152761_c.readLock().unlock(); + return i; + } + + public Object[] func_152756_c() + { + Object[] aobject = (Object[])((Object[])Array.newInstance(this.field_152760_b, this.field_152762_d)); + this.field_152761_c.readLock().lock(); + + for (int i = 0; i < this.field_152762_d; ++i) + { + int j = (this.field_152763_e - this.field_152762_d + i) % this.func_152758_b(); + + if (j < 0) + { + j += this.func_152758_b(); + } + + aobject[i] = this.field_152759_a[j]; + } + + this.field_152761_c.readLock().unlock(); + return aobject; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Timer.java b/build/rfg/minecraft-src/java/net/minecraft/util/Timer.java new file mode 100644 index 0000000..23c4dcb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Timer.java @@ -0,0 +1,102 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; + +@SideOnly(Side.CLIENT) +public class Timer +{ + /** The number of timer ticks per second of real time */ + float ticksPerSecond; + /** The time reported by the high-resolution clock at the last call of updateTimer(), in seconds */ + private double lastHRTime; + /** How many full ticks have turned over since the last call to updateTimer(), capped at 10. */ + public int elapsedTicks; + /** + * How much time has elapsed since the last tick, in ticks, for use by display rendering routines (range: 0.0 - + * 1.0). This field is frozen if the display is paused to eliminate jitter. + */ + public float renderPartialTicks; + /** + * A multiplier to make the timer (and therefore the game) go faster or slower. 0.5 makes the game run at half- + * speed. + */ + public float timerSpeed = 1.0F; + /** How much time has elapsed since the last tick, in ticks (range: 0.0 - 1.0). */ + public float elapsedPartialTicks; + /** The time reported by the system clock at the last sync, in milliseconds */ + private long lastSyncSysClock; + /** The time reported by the high-resolution clock at the last sync, in milliseconds */ + private long lastSyncHRClock; + private long field_74285_i; + /** A ratio used to sync the high-resolution clock to the system clock, updated once per second */ + private double timeSyncAdjustment = 1.0D; + private static final String __OBFID = "CL_00000658"; + + public Timer(float p_i1018_1_) + { + this.ticksPerSecond = p_i1018_1_; + this.lastSyncSysClock = Minecraft.getSystemTime(); + this.lastSyncHRClock = System.nanoTime() / 1000000L; + } + + /** + * Updates all fields of the Timer using the current time + */ + public void updateTimer() + { + long i = Minecraft.getSystemTime(); + long j = i - this.lastSyncSysClock; + long k = System.nanoTime() / 1000000L; + double d0 = (double)k / 1000.0D; + + if (j <= 1000L && j >= 0L) + { + this.field_74285_i += j; + + if (this.field_74285_i > 1000L) + { + long l = k - this.lastSyncHRClock; + double d1 = (double)this.field_74285_i / (double)l; + this.timeSyncAdjustment += (d1 - this.timeSyncAdjustment) * 0.20000000298023224D; + this.lastSyncHRClock = k; + this.field_74285_i = 0L; + } + + if (this.field_74285_i < 0L) + { + this.lastSyncHRClock = k; + } + } + else + { + this.lastHRTime = d0; + } + + this.lastSyncSysClock = i; + double d2 = (d0 - this.lastHRTime) * this.timeSyncAdjustment; + this.lastHRTime = d0; + + if (d2 < 0.0D) + { + d2 = 0.0D; + } + + if (d2 > 1.0D) + { + d2 = 1.0D; + } + + this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + d2 * (double)this.timerSpeed * (double)this.ticksPerSecond); + this.elapsedTicks = (int)this.elapsedPartialTicks; + this.elapsedPartialTicks -= (float)this.elapsedTicks; + + if (this.elapsedTicks > 10) + { + this.elapsedTicks = 10; + } + + this.renderPartialTicks = this.elapsedPartialTicks; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Tuple.java b/build/rfg/minecraft-src/java/net/minecraft/util/Tuple.java new file mode 100644 index 0000000..9b8a48b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Tuple.java @@ -0,0 +1,32 @@ +package net.minecraft.util; + +public class Tuple +{ + /** First Object in the Tuple */ + private Object first; + /** Second Object in the Tuple */ + private Object second; + private static final String __OBFID = "CL_00001502"; + + public Tuple(Object p_i1555_1_, Object p_i1555_2_) + { + this.first = p_i1555_1_; + this.second = p_i1555_2_; + } + + /** + * Get the first Object in the Tuple + */ + public Object getFirst() + { + return this.first; + } + + /** + * Get the second Object in the Tuple + */ + public Object getSecond() + { + return this.second; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/TupleIntJsonSerializable.java b/build/rfg/minecraft-src/java/net/minecraft/util/TupleIntJsonSerializable.java new file mode 100644 index 0000000..0e1bd39 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/TupleIntJsonSerializable.java @@ -0,0 +1,40 @@ +package net.minecraft.util; + +public class TupleIntJsonSerializable +{ + private int integerValue; + private IJsonSerializable jsonSerializableValue; + private static final String __OBFID = "CL_00001478"; + + /** + * Gets the integer value stored in this tuple. + */ + public int getIntegerValue() + { + return this.integerValue; + } + + /** + * Sets this tuple's integer value to the given value. + */ + public void setIntegerValue(int p_151188_1_) + { + this.integerValue = p_151188_1_; + } + + /** + * Gets the JsonSerializable value stored in this tuple. + */ + public IJsonSerializable getJsonSerializableValue() + { + return this.jsonSerializableValue; + } + + /** + * Sets this tuple's JsonSerializable value to the given value. + */ + public void setJsonSerializableValue(IJsonSerializable p_151190_1_) + { + this.jsonSerializableValue = p_151190_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Util.java b/build/rfg/minecraft-src/java/net/minecraft/util/Util.java new file mode 100644 index 0000000..43d24c0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Util.java @@ -0,0 +1,28 @@ +package net.minecraft.util; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class Util +{ + private static final String __OBFID = "CL_00001633"; + + public static Util.EnumOS getOSType() + { + String s = System.getProperty("os.name").toLowerCase(); + return s.contains("win") ? Util.EnumOS.WINDOWS : (s.contains("mac") ? Util.EnumOS.OSX : (s.contains("solaris") ? Util.EnumOS.SOLARIS : (s.contains("sunos") ? Util.EnumOS.SOLARIS : (s.contains("linux") ? Util.EnumOS.LINUX : (s.contains("unix") ? Util.EnumOS.LINUX : Util.EnumOS.UNKNOWN))))); + } + + @SideOnly(Side.CLIENT) + public static enum EnumOS + { + LINUX, + SOLARIS, + WINDOWS, + OSX, + UNKNOWN; + + private static final String __OBFID = "CL_00001660"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/Vec3.java b/build/rfg/minecraft-src/java/net/minecraft/util/Vec3.java new file mode 100644 index 0000000..6d7da41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/Vec3.java @@ -0,0 +1,241 @@ +package net.minecraft.util; + +public class Vec3 +{ + /** X coordinate of Vec3D */ + public double xCoord; + /** Y coordinate of Vec3D */ + public double yCoord; + /** Z coordinate of Vec3D */ + public double zCoord; + private static final String __OBFID = "CL_00000612"; + + /** + * Static method for creating a new Vec3D given the three x,y,z values. This is only called from the other static + * method which creates and places it in the list. + */ + public static Vec3 createVectorHelper(double x, double y, double z) + { + return new Vec3(x, y, z); + } + + protected Vec3(double x, double y, double z) + { + if (x == -0.0D) + { + x = 0.0D; + } + + if (y == -0.0D) + { + y = 0.0D; + } + + if (z == -0.0D) + { + z = 0.0D; + } + + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + } + + /** + * Sets the x,y,z components of the vector as specified. + */ + protected Vec3 setComponents(double x, double y, double z) + { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + return this; + } + + /** + * Returns a new vector with the result of the specified vector minus this. + */ + public Vec3 subtract(Vec3 vec) + { + return createVectorHelper(vec.xCoord - this.xCoord, vec.yCoord - this.yCoord, vec.zCoord - this.zCoord); + } + + /** + * Normalizes the vector to a length of 1 (except if it is the zero vector) + */ + public Vec3 normalize() + { + double d0 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + return d0 < 1.0E-4D ? createVectorHelper(0.0D, 0.0D, 0.0D) : createVectorHelper(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0); + } + + public double dotProduct(Vec3 vec) + { + return this.xCoord * vec.xCoord + this.yCoord * vec.yCoord + this.zCoord * vec.zCoord; + } + + /** + * Returns a new vector with the result of this vector x the specified vector. + */ + public Vec3 crossProduct(Vec3 vec) + { + return createVectorHelper(this.yCoord * vec.zCoord - this.zCoord * vec.yCoord, this.zCoord * vec.xCoord - this.xCoord * vec.zCoord, this.xCoord * vec.yCoord - this.yCoord * vec.xCoord); + } + + /** + * Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this + * vector. + */ + public Vec3 addVector(double x, double y, double z) + { + return createVectorHelper(this.xCoord + x, this.yCoord + y, this.zCoord + z); + } + + /** + * Euclidean distance between this and the specified vector, returned as double. + */ + public double distanceTo(Vec3 vec) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return (double)MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2); + } + + /** + * The square of the Euclidean distance between this and the specified vector. + */ + public double squareDistanceTo(Vec3 vec) + { + double d0 = vec.xCoord - this.xCoord; + double d1 = vec.yCoord - this.yCoord; + double d2 = vec.zCoord - this.zCoord; + return d0 * d0 + d1 * d1 + d2 * d2; + } + + /** + * The square of the Euclidean distance between this and the vector of x,y,z components passed in. + */ + public double squareDistanceTo(double x, double y, double z) + { + double d3 = x - this.xCoord; + double d4 = y - this.yCoord; + double d5 = z - this.zCoord; + return d3 * d3 + d4 * d4 + d5 * d5; + } + + /** + * Returns the length of the vector. + */ + public double lengthVector() + { + return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); + } + + /** + * Returns a new vector with x value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithXValue(Vec3 vec, double x) + { + double d1 = vec.xCoord - this.xCoord; + double d2 = vec.yCoord - this.yCoord; + double d3 = vec.zCoord - this.zCoord; + + if (d1 * d1 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d4 = (x - this.xCoord) / d1; + return d4 >= 0.0D && d4 <= 1.0D ? createVectorHelper(this.xCoord + d1 * d4, this.yCoord + d2 * d4, this.zCoord + d3 * d4) : null; + } + } + + /** + * Returns a new vector with y value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithYValue(Vec3 vec, double y) + { + double d1 = vec.xCoord - this.xCoord; + double d2 = vec.yCoord - this.yCoord; + double d3 = vec.zCoord - this.zCoord; + + if (d2 * d2 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d4 = (y - this.yCoord) / d2; + return d4 >= 0.0D && d4 <= 1.0D ? createVectorHelper(this.xCoord + d1 * d4, this.yCoord + d2 * d4, this.zCoord + d3 * d4) : null; + } + } + + /** + * Returns a new vector with z value equal to the second parameter, along the line between this vector and the + * passed in vector, or null if not possible. + */ + public Vec3 getIntermediateWithZValue(Vec3 vec, double z) + { + double d1 = vec.xCoord - this.xCoord; + double d2 = vec.yCoord - this.yCoord; + double d3 = vec.zCoord - this.zCoord; + + if (d3 * d3 < 1.0000000116860974E-7D) + { + return null; + } + else + { + double d4 = (z - this.zCoord) / d3; + return d4 >= 0.0D && d4 <= 1.0D ? createVectorHelper(this.xCoord + d1 * d4, this.yCoord + d2 * d4, this.zCoord + d3 * d4) : null; + } + } + + public String toString() + { + return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")"; + } + + /** + * Rotates the vector around the x axis by the specified angle. + */ + public void rotateAroundX(float angle) + { + float f1 = MathHelper.cos(angle); + float f2 = MathHelper.sin(angle); + double d0 = this.xCoord; + double d1 = this.yCoord * (double)f1 + this.zCoord * (double)f2; + double d2 = this.zCoord * (double)f1 - this.yCoord * (double)f2; + this.setComponents(d0, d1, d2); + } + + /** + * Rotates the vector around the y axis by the specified angle. + */ + public void rotateAroundY(float angle) + { + float f1 = MathHelper.cos(angle); + float f2 = MathHelper.sin(angle); + double d0 = this.xCoord * (double)f1 + this.zCoord * (double)f2; + double d1 = this.yCoord; + double d2 = this.zCoord * (double)f1 - this.xCoord * (double)f2; + this.setComponents(d0, d1, d2); + } + + /** + * Rotates the vector around the z axis by the specified angle. + */ + public void rotateAroundZ(float angle) + { + float f1 = MathHelper.cos(angle); + float f2 = MathHelper.sin(angle); + double d0 = this.xCoord * (double)f1 + this.yCoord * (double)f2; + double d1 = this.yCoord * (double)f1 - this.xCoord * (double)f2; + double d2 = this.zCoord; + this.setComponents(d0, d1, d2); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandom.java b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandom.java new file mode 100644 index 0000000..fa3da1b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandom.java @@ -0,0 +1,145 @@ +package net.minecraft.util; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Random; + +public class WeightedRandom +{ + private static final String __OBFID = "CL_00001503"; + + /** + * Returns the total weight of all items in a collection. + */ + public static int getTotalWeight(Collection p_76272_0_) + { + int i = 0; + WeightedRandom.Item item; + + for (Iterator iterator = p_76272_0_.iterator(); iterator.hasNext(); i += item.itemWeight) + { + item = (WeightedRandom.Item)iterator.next(); + } + + return i; + } + + /** + * Returns a random choice from the input items, with a total weight value. + */ + public static WeightedRandom.Item getRandomItem(Random p_76273_0_, Collection p_76273_1_, int p_76273_2_) + { + if (p_76273_2_ <= 0) + { + throw new IllegalArgumentException(); + } + return getItem(p_76273_1_, p_76273_0_.nextInt(p_76273_2_)); + } + + //Forge: Added to allow custom random implementations, Modder is responsible for making sure the + //'weight' is under the totalWeight of the items. + public static WeightedRandom.Item getItem(Collection par1Collection, int weight) + { + { + int j = weight; + Iterator iterator = par1Collection.iterator(); + WeightedRandom.Item item; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + item = (WeightedRandom.Item)iterator.next(); + j -= item.itemWeight; + } + while (j >= 0); + + return item; + } + } + + /** + * Returns a random choice from the input items. + */ + public static WeightedRandom.Item getRandomItem(Random p_76271_0_, Collection p_76271_1_) + { + return getRandomItem(p_76271_0_, p_76271_1_, getTotalWeight(p_76271_1_)); + } + + /** + * Returns the total weight of all items in a array. + */ + public static int getTotalWeight(WeightedRandom.Item[] p_76270_0_) + { + int i = 0; + WeightedRandom.Item[] aitem = p_76270_0_; + int j = p_76270_0_.length; + + for (int k = 0; k < j; ++k) + { + WeightedRandom.Item item = aitem[k]; + i += item.itemWeight; + } + + return i; + } + + /** + * Returns a random choice from the input array of items, with a total weight value. + */ + public static WeightedRandom.Item getRandomItem(Random p_76269_0_, WeightedRandom.Item[] p_76269_1_, int p_76269_2_) + { + if (p_76269_2_ <= 0) + { + throw new IllegalArgumentException(); + } + return getItem(p_76269_1_, p_76269_0_.nextInt(p_76269_2_)); + } + + //Forge: Added to allow custom random implementations, Modder is responsible for making sure the + //'weight' is under the totalWeight of the items. + public static WeightedRandom.Item getItem(WeightedRandom.Item[] par1ArrayOfWeightedRandomItem, int weight) + { + { + int j = weight; + WeightedRandom.Item[] aitem = par1ArrayOfWeightedRandomItem; + int k = par1ArrayOfWeightedRandomItem.length; + + for (int l = 0; l < k; ++l) + { + WeightedRandom.Item item = aitem[l]; + j -= item.itemWeight; + + if (j < 0) + { + return item; + } + } + + return null; + } + } + + /** + * Returns a random choice from the input items. + */ + public static WeightedRandom.Item getRandomItem(Random p_76274_0_, WeightedRandom.Item[] p_76274_1_) + { + return getRandomItem(p_76274_0_, p_76274_1_, getTotalWeight(p_76274_1_)); + } + + public static class Item + { + /** The Weight is how often the item is chosen(higher number is higher chance(lower is lower)) */ + public int itemWeight; + private static final String __OBFID = "CL_00001504"; + + public Item(int p_i1556_1_) + { + this.itemWeight = p_i1556_1_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomChestContent.java b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomChestContent.java new file mode 100644 index 0000000..f603939 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomChestContent.java @@ -0,0 +1,101 @@ +package net.minecraft.util; + +import java.util.Random; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraftforge.common.ChestGenHooks; + +public class WeightedRandomChestContent extends WeightedRandom.Item +{ + /** The Item/Block ID to generate in the Chest. */ + public ItemStack theItemId; + /** The minimum chance of item generating. */ + public int theMinimumChanceToGenerateItem; + /** The maximum chance of item generating. */ + public int theMaximumChanceToGenerateItem; + private static final String __OBFID = "CL_00001505"; + + public WeightedRandomChestContent(Item p_i45311_1_, int p_i45311_2_, int p_i45311_3_, int p_i45311_4_, int p_i45311_5_) + { + super(p_i45311_5_); + this.theItemId = new ItemStack(p_i45311_1_, 1, p_i45311_2_); + this.theMinimumChanceToGenerateItem = p_i45311_3_; + this.theMaximumChanceToGenerateItem = p_i45311_4_; + } + + public WeightedRandomChestContent(ItemStack p_i1558_1_, int p_i1558_2_, int p_i1558_3_, int p_i1558_4_) + { + super(p_i1558_4_); + this.theItemId = p_i1558_1_; + this.theMinimumChanceToGenerateItem = p_i1558_2_; + this.theMaximumChanceToGenerateItem = p_i1558_3_; + } + + /** + * Generates the Chest contents. + */ + public static void generateChestContents(Random p_76293_0_, WeightedRandomChestContent[] p_76293_1_, IInventory p_76293_2_, int p_76293_3_) + { + for (int j = 0; j < p_76293_3_; ++j) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(p_76293_0_, p_76293_1_); + ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_76293_0_, p_76293_2_); + + for (ItemStack item : stacks) + { + p_76293_2_.setInventorySlotContents(p_76293_0_.nextInt(p_76293_2_.getSizeInventory()), item); + } + } + } + + public static void generateDispenserContents(Random p_150706_0_, WeightedRandomChestContent[] p_150706_1_, TileEntityDispenser p_150706_2_, int p_150706_3_) + { + for (int j = 0; j < p_150706_3_; ++j) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.getRandomItem(p_150706_0_, p_150706_1_); + int k = weightedrandomchestcontent.theMinimumChanceToGenerateItem + p_150706_0_.nextInt(weightedrandomchestcontent.theMaximumChanceToGenerateItem - weightedrandomchestcontent.theMinimumChanceToGenerateItem + 1); + ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_150706_0_, p_150706_2_); + for (ItemStack item : stacks) + { + p_150706_2_.setInventorySlotContents(p_150706_0_.nextInt(p_150706_2_.getSizeInventory()), item); + } + } + } + + public static WeightedRandomChestContent[] func_92080_a(WeightedRandomChestContent[] p_92080_0_, WeightedRandomChestContent ... p_92080_1_) + { + WeightedRandomChestContent[] aweightedrandomchestcontent1 = new WeightedRandomChestContent[p_92080_0_.length + p_92080_1_.length]; + int i = 0; + + for (int j = 0; j < p_92080_0_.length; ++j) + { + aweightedrandomchestcontent1[i++] = p_92080_0_[j]; + } + + WeightedRandomChestContent[] aweightedrandomchestcontent2 = p_92080_1_; + int k = p_92080_1_.length; + + for (int l = 0; l < k; ++l) + { + WeightedRandomChestContent weightedrandomchestcontent1 = aweightedrandomchestcontent2[l]; + aweightedrandomchestcontent1[i++] = weightedrandomchestcontent1; + } + + return aweightedrandomchestcontent1; + } + + // -- Forge hooks + /** + * Allow a mod to submit a custom implementation that can delegate item stack generation beyond simple stack lookup + * + * @param random The current random for generation + * @param newInventory The inventory being generated (do not populate it, but you can refer to it) + * @return An array of {@link ItemStack} to put into the chest + */ + protected ItemStack[] generateChestContent(Random random, IInventory newInventory) + { + return ChestGenHooks.generateStacks(random, theItemId, theMinimumChanceToGenerateItem, theMaximumChanceToGenerateItem); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomFishable.java b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomFishable.java new file mode 100644 index 0000000..e507216 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/util/WeightedRandomFishable.java @@ -0,0 +1,61 @@ +package net.minecraft.util; + +import java.util.Random; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.item.ItemStack; + +public class WeightedRandomFishable extends WeightedRandom.Item +{ + private final ItemStack field_150711_b; + private float field_150712_c; + private boolean field_150710_d; + private static final String __OBFID = "CL_00001664"; + + public WeightedRandomFishable(ItemStack p_i45317_1_, int p_i45317_2_) + { + super(p_i45317_2_); + this.field_150711_b = p_i45317_1_; + } + + public ItemStack func_150708_a(Random p_150708_1_) + { + ItemStack itemstack = this.field_150711_b.copy(); + + if (this.field_150712_c > 0.0F) + { + int i = (int)(this.field_150712_c * (float)this.field_150711_b.getMaxDamage()); + int j = itemstack.getMaxDamage() - p_150708_1_.nextInt(p_150708_1_.nextInt(i) + 1); + + if (j > i) + { + j = i; + } + + if (j < 1) + { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.field_150710_d) + { + EnchantmentHelper.addRandomEnchantment(p_150708_1_, itemstack, 30); + } + + return itemstack; + } + + public WeightedRandomFishable func_150709_a(float p_150709_1_) + { + this.field_150712_c = p_150709_1_; + return this; + } + + public WeightedRandomFishable func_150707_a() + { + this.field_150710_d = true; + return this; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipe.java b/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipe.java new file mode 100644 index 0000000..c7fdaff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipe.java @@ -0,0 +1,157 @@ +package net.minecraft.village; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class MerchantRecipe +{ + /** Item the Villager buys. */ + private ItemStack itemToBuy; + /** Second Item the Villager buys. */ + private ItemStack secondItemToBuy; + /** Item the Villager sells. */ + private ItemStack itemToSell; + /** Saves how much has been tool used when put into to slot to be enchanted. */ + private int toolUses; + /** Maximum times this trade can be used. */ + private int maxTradeUses; + private static final String __OBFID = "CL_00000126"; + + public MerchantRecipe(NBTTagCompound p_i1940_1_) + { + this.readFromTags(p_i1940_1_); + } + + public MerchantRecipe(ItemStack p_i1941_1_, ItemStack p_i1941_2_, ItemStack p_i1941_3_) + { + this.itemToBuy = p_i1941_1_; + this.secondItemToBuy = p_i1941_2_; + this.itemToSell = p_i1941_3_; + this.maxTradeUses = 7; + } + + public MerchantRecipe(ItemStack p_i1942_1_, ItemStack p_i1942_2_) + { + this(p_i1942_1_, (ItemStack)null, p_i1942_2_); + } + + public MerchantRecipe(ItemStack p_i1943_1_, Item p_i1943_2_) + { + this(p_i1943_1_, new ItemStack(p_i1943_2_)); + } + + /** + * Gets the itemToBuy. + */ + public ItemStack getItemToBuy() + { + return this.itemToBuy; + } + + /** + * Gets secondItemToBuy. + */ + public ItemStack getSecondItemToBuy() + { + return this.secondItemToBuy; + } + + /** + * Gets if Villager has secondItemToBuy. + */ + public boolean hasSecondItemToBuy() + { + return this.secondItemToBuy != null; + } + + /** + * Gets itemToSell. + */ + public ItemStack getItemToSell() + { + return this.itemToSell; + } + + /** + * checks if both the first and second ItemToBuy IDs are the same + */ + public boolean hasSameIDsAs(MerchantRecipe p_77393_1_) + { + return this.itemToBuy.getItem() == p_77393_1_.itemToBuy.getItem() && this.itemToSell.getItem() == p_77393_1_.itemToSell.getItem() ? this.secondItemToBuy == null && p_77393_1_.secondItemToBuy == null || this.secondItemToBuy != null && p_77393_1_.secondItemToBuy != null && this.secondItemToBuy.getItem() == p_77393_1_.secondItemToBuy.getItem() : false; + } + + /** + * checks first and second ItemToBuy ID's and count. Calls hasSameIDs + */ + public boolean hasSameItemsAs(MerchantRecipe p_77391_1_) + { + return this.hasSameIDsAs(p_77391_1_) && (this.itemToBuy.stackSize < p_77391_1_.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < p_77391_1_.secondItemToBuy.stackSize); + } + + public void incrementToolUses() + { + ++this.toolUses; + } + + public void func_82783_a(int p_82783_1_) + { + this.maxTradeUses += p_82783_1_; + } + + public boolean isRecipeDisabled() + { + return this.toolUses >= this.maxTradeUses; + } + + @SideOnly(Side.CLIENT) + public void func_82785_h() + { + this.toolUses = this.maxTradeUses; + } + + public void readFromTags(NBTTagCompound p_77390_1_) + { + NBTTagCompound nbttagcompound1 = p_77390_1_.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(nbttagcompound1); + NBTTagCompound nbttagcompound2 = p_77390_1_.getCompoundTag("sell"); + this.itemToSell = ItemStack.loadItemStackFromNBT(nbttagcompound2); + + if (p_77390_1_.hasKey("buyB", 10)) + { + this.secondItemToBuy = ItemStack.loadItemStackFromNBT(p_77390_1_.getCompoundTag("buyB")); + } + + if (p_77390_1_.hasKey("uses", 99)) + { + this.toolUses = p_77390_1_.getInteger("uses"); + } + + if (p_77390_1_.hasKey("maxUses", 99)) + { + this.maxTradeUses = p_77390_1_.getInteger("maxUses"); + } + else + { + this.maxTradeUses = 7; + } + } + + public NBTTagCompound writeToTags() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound())); + nbttagcompound.setTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound())); + + if (this.secondItemToBuy != null) + { + nbttagcompound.setTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound())); + } + + nbttagcompound.setInteger("uses", this.toolUses); + nbttagcompound.setInteger("maxUses", this.maxTradeUses); + return nbttagcompound; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipeList.java b/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipeList.java new file mode 100644 index 0000000..59ae7eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/MerchantRecipeList.java @@ -0,0 +1,149 @@ +package net.minecraft.village; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.IOException; +import java.util.ArrayList; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; + +public class MerchantRecipeList extends ArrayList +{ + private static final String __OBFID = "CL_00000127"; + + public MerchantRecipeList() {} + + public MerchantRecipeList(NBTTagCompound p_i1944_1_) + { + this.readRecipiesFromTags(p_i1944_1_); + } + + /** + * can par1,par2 be used to in crafting recipe par3 + */ + public MerchantRecipe canRecipeBeUsed(ItemStack p_77203_1_, ItemStack p_77203_2_, int p_77203_3_) + { + if (p_77203_3_ > 0 && p_77203_3_ < this.size()) + { + MerchantRecipe merchantrecipe1 = (MerchantRecipe)this.get(p_77203_3_); + return p_77203_1_.getItem() == merchantrecipe1.getItemToBuy().getItem() && (p_77203_2_ == null && !merchantrecipe1.hasSecondItemToBuy() || merchantrecipe1.hasSecondItemToBuy() && p_77203_2_ != null && merchantrecipe1.getSecondItemToBuy().getItem() == p_77203_2_.getItem()) && p_77203_1_.stackSize >= merchantrecipe1.getItemToBuy().stackSize && (!merchantrecipe1.hasSecondItemToBuy() || p_77203_2_.stackSize >= merchantrecipe1.getSecondItemToBuy().stackSize) ? merchantrecipe1 : null; + } + else + { + for (int j = 0; j < this.size(); ++j) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(j); + + if (p_77203_1_.getItem() == merchantrecipe.getItemToBuy().getItem() && p_77203_1_.stackSize >= merchantrecipe.getItemToBuy().stackSize && (!merchantrecipe.hasSecondItemToBuy() && p_77203_2_ == null || merchantrecipe.hasSecondItemToBuy() && p_77203_2_ != null && merchantrecipe.getSecondItemToBuy().getItem() == p_77203_2_.getItem() && p_77203_2_.stackSize >= merchantrecipe.getSecondItemToBuy().stackSize)) + { + return merchantrecipe; + } + } + + return null; + } + } + + /** + * checks if there is a recipie for the same ingredients already on the list, and replaces it. otherwise, adds it + */ + public void addToListWithCheck(MerchantRecipe p_77205_1_) + { + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe1 = (MerchantRecipe)this.get(i); + + if (p_77205_1_.hasSameIDsAs(merchantrecipe1)) + { + if (p_77205_1_.hasSameItemsAs(merchantrecipe1)) + { + this.set(i, p_77205_1_); + } + + return; + } + } + + this.add(p_77205_1_); + } + + public void func_151391_a(PacketBuffer p_151391_1_) throws IOException + { + p_151391_1_.writeByte((byte)(this.size() & 255)); + + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i); + p_151391_1_.writeItemStackToBuffer(merchantrecipe.getItemToBuy()); + p_151391_1_.writeItemStackToBuffer(merchantrecipe.getItemToSell()); + ItemStack itemstack = merchantrecipe.getSecondItemToBuy(); + p_151391_1_.writeBoolean(itemstack != null); + + if (itemstack != null) + { + p_151391_1_.writeItemStackToBuffer(itemstack); + } + + p_151391_1_.writeBoolean(merchantrecipe.isRecipeDisabled()); + } + } + + public void readRecipiesFromTags(NBTTagCompound p_77201_1_) + { + NBTTagList nbttaglist = p_77201_1_.getTagList("Recipes", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + this.add(new MerchantRecipe(nbttagcompound1)); + } + } + + public NBTTagCompound getRecipiesAsTags() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.size(); ++i) + { + MerchantRecipe merchantrecipe = (MerchantRecipe)this.get(i); + nbttaglist.appendTag(merchantrecipe.writeToTags()); + } + + nbttagcompound.setTag("Recipes", nbttaglist); + return nbttagcompound; + } + + @SideOnly(Side.CLIENT) + public static MerchantRecipeList func_151390_b(PacketBuffer p_151390_0_) throws IOException + { + MerchantRecipeList merchantrecipelist = new MerchantRecipeList(); + int i = p_151390_0_.readByte() & 255; + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = p_151390_0_.readItemStackFromBuffer(); + ItemStack itemstack1 = p_151390_0_.readItemStackFromBuffer(); + ItemStack itemstack2 = null; + + if (p_151390_0_.readBoolean()) + { + itemstack2 = p_151390_0_.readItemStackFromBuffer(); + } + + boolean flag = p_151390_0_.readBoolean(); + MerchantRecipe merchantrecipe = new MerchantRecipe(itemstack, itemstack2, itemstack1); + + if (flag) + { + merchantrecipe.func_82785_h(); + } + + merchantrecipelist.add(merchantrecipe); + } + + return merchantrecipelist; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/Village.java b/build/rfg/minecraft-src/java/net/minecraft/village/Village.java new file mode 100644 index 0000000..5d2c6a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/Village.java @@ -0,0 +1,599 @@ +package net.minecraft.village; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityIronGolem; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class Village +{ + private World worldObj; + /** list of VillageDoorInfo objects */ + private final List villageDoorInfoList = new ArrayList(); + /** + * This is the sum of all door coordinates and used to calculate the actual village center by dividing by the number + * of doors. + */ + private final ChunkCoordinates centerHelper = new ChunkCoordinates(0, 0, 0); + /** This is the actual village center. */ + private final ChunkCoordinates center = new ChunkCoordinates(0, 0, 0); + private int villageRadius; + private int lastAddDoorTimestamp; + private int tickCounter; + private int numVillagers; + /** Timestamp of tick count when villager last bred */ + private int noBreedTicks; + /** List of player reputations with this village */ + private TreeMap playerReputation = new TreeMap(); + private List villageAgressors = new ArrayList(); + private int numIronGolems; + private static final String __OBFID = "CL_00001631"; + + public Village() {} + + public Village(World p_i1675_1_) + { + this.worldObj = p_i1675_1_; + } + + public void func_82691_a(World p_82691_1_) + { + this.worldObj = p_82691_1_; + } + + /** + * Called periodically by VillageCollection + */ + public void tick(int p_75560_1_) + { + this.tickCounter = p_75560_1_; + this.removeDeadAndOutOfRangeDoors(); + this.removeDeadAndOldAgressors(); + + if (p_75560_1_ % 20 == 0) + { + this.updateNumVillagers(); + } + + if (p_75560_1_ % 30 == 0) + { + this.updateNumIronGolems(); + } + + int j = this.numVillagers / 10; + + if (this.numIronGolems < j && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0) + { + Vec3 vec3 = this.tryGetIronGolemSpawningLocation(MathHelper.floor_float((float)this.center.posX), MathHelper.floor_float((float)this.center.posY), MathHelper.floor_float((float)this.center.posZ), 2, 4, 2); + + if (vec3 != null) + { + EntityIronGolem entityirongolem = new EntityIronGolem(this.worldObj); + entityirongolem.setPosition(vec3.xCoord, vec3.yCoord, vec3.zCoord); + this.worldObj.spawnEntityInWorld(entityirongolem); + ++this.numIronGolems; + } + } + } + + /** + * Tries up to 10 times to get a valid spawning location before eventually failing and returning null. + */ + private Vec3 tryGetIronGolemSpawningLocation(int p_75559_1_, int p_75559_2_, int p_75559_3_, int p_75559_4_, int p_75559_5_, int p_75559_6_) + { + for (int k1 = 0; k1 < 10; ++k1) + { + int l1 = p_75559_1_ + this.worldObj.rand.nextInt(16) - 8; + int i2 = p_75559_2_ + this.worldObj.rand.nextInt(6) - 3; + int j2 = p_75559_3_ + this.worldObj.rand.nextInt(16) - 8; + + if (this.isInRange(l1, i2, j2) && this.isValidIronGolemSpawningLocation(l1, i2, j2, p_75559_4_, p_75559_5_, p_75559_6_)) + { + return Vec3.createVectorHelper((double)l1, (double)i2, (double)j2); + } + } + + return null; + } + + private boolean isValidIronGolemSpawningLocation(int p_75563_1_, int p_75563_2_, int p_75563_3_, int p_75563_4_, int p_75563_5_, int p_75563_6_) + { + if (!World.doesBlockHaveSolidTopSurface(this.worldObj, p_75563_1_, p_75563_2_ - 1, p_75563_3_)) + { + return false; + } + else + { + int k1 = p_75563_1_ - p_75563_4_ / 2; + int l1 = p_75563_3_ - p_75563_6_ / 2; + + for (int i2 = k1; i2 < k1 + p_75563_4_; ++i2) + { + for (int j2 = p_75563_2_; j2 < p_75563_2_ + p_75563_5_; ++j2) + { + for (int k2 = l1; k2 < l1 + p_75563_6_; ++k2) + { + if (this.worldObj.getBlock(i2, j2, k2).isNormalCube()) + { + return false; + } + } + } + } + + return true; + } + } + + private void updateNumIronGolems() + { + List list = this.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, AxisAlignedBB.getBoundingBox((double)(this.center.posX - this.villageRadius), (double)(this.center.posY - 4), (double)(this.center.posZ - this.villageRadius), (double)(this.center.posX + this.villageRadius), (double)(this.center.posY + 4), (double)(this.center.posZ + this.villageRadius))); + this.numIronGolems = list.size(); + } + + private void updateNumVillagers() + { + List list = this.worldObj.getEntitiesWithinAABB(EntityVillager.class, AxisAlignedBB.getBoundingBox((double)(this.center.posX - this.villageRadius), (double)(this.center.posY - 4), (double)(this.center.posZ - this.villageRadius), (double)(this.center.posX + this.villageRadius), (double)(this.center.posY + 4), (double)(this.center.posZ + this.villageRadius))); + this.numVillagers = list.size(); + + if (this.numVillagers == 0) + { + this.playerReputation.clear(); + } + } + + public ChunkCoordinates getCenter() + { + return this.center; + } + + public int getVillageRadius() + { + return this.villageRadius; + } + + /** + * Actually get num village door info entries, but that boils down to number of doors. Called by + * EntityAIVillagerMate and VillageSiege + */ + public int getNumVillageDoors() + { + return this.villageDoorInfoList.size(); + } + + public int getTicksSinceLastDoorAdding() + { + return this.tickCounter - this.lastAddDoorTimestamp; + } + + public int getNumVillagers() + { + return this.numVillagers; + } + + /** + * Returns true, if the given coordinates are within the bounding box of the village. + */ + public boolean isInRange(int p_75570_1_, int p_75570_2_, int p_75570_3_) + { + return this.center.getDistanceSquared(p_75570_1_, p_75570_2_, p_75570_3_) < (float)(this.villageRadius * this.villageRadius); + } + + /** + * called only by class EntityAIMoveThroughVillage + */ + public List getVillageDoorInfoList() + { + return this.villageDoorInfoList; + } + + public VillageDoorInfo findNearestDoor(int p_75564_1_, int p_75564_2_, int p_75564_3_) + { + VillageDoorInfo villagedoorinfo = null; + int l = Integer.MAX_VALUE; + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo1 = (VillageDoorInfo)iterator.next(); + int i1 = villagedoorinfo1.getDistanceSquared(p_75564_1_, p_75564_2_, p_75564_3_); + + if (i1 < l) + { + villagedoorinfo = villagedoorinfo1; + l = i1; + } + } + + return villagedoorinfo; + } + + /** + * Find a door suitable for shelter. If there are more doors in a distance of 16 blocks, then the least restricted + * one (i.e. the one protecting the lowest number of villagers) of them is chosen, else the nearest one regardless + * of restriction. + */ + public VillageDoorInfo findNearestDoorUnrestricted(int p_75569_1_, int p_75569_2_, int p_75569_3_) + { + VillageDoorInfo villagedoorinfo = null; + int l = Integer.MAX_VALUE; + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo1 = (VillageDoorInfo)iterator.next(); + int i1 = villagedoorinfo1.getDistanceSquared(p_75569_1_, p_75569_2_, p_75569_3_); + + if (i1 > 256) + { + i1 *= 1000; + } + else + { + i1 = villagedoorinfo1.getDoorOpeningRestrictionCounter(); + } + + if (i1 < l) + { + villagedoorinfo = villagedoorinfo1; + l = i1; + } + } + + return villagedoorinfo; + } + + public VillageDoorInfo getVillageDoorAt(int p_75578_1_, int p_75578_2_, int p_75578_3_) + { + if (this.center.getDistanceSquared(p_75578_1_, p_75578_2_, p_75578_3_) > (float)(this.villageRadius * this.villageRadius)) + { + return null; + } + else + { + Iterator iterator = this.villageDoorInfoList.iterator(); + VillageDoorInfo villagedoorinfo; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + villagedoorinfo = (VillageDoorInfo)iterator.next(); + } + while (villagedoorinfo.posX != p_75578_1_ || villagedoorinfo.posZ != p_75578_3_ || Math.abs(villagedoorinfo.posY - p_75578_2_) > 1); + + return villagedoorinfo; + } + } + + public void addVillageDoorInfo(VillageDoorInfo p_75576_1_) + { + this.villageDoorInfoList.add(p_75576_1_); + this.centerHelper.posX += p_75576_1_.posX; + this.centerHelper.posY += p_75576_1_.posY; + this.centerHelper.posZ += p_75576_1_.posZ; + this.updateVillageRadiusAndCenter(); + this.lastAddDoorTimestamp = p_75576_1_.lastActivityTimestamp; + } + + /** + * Returns true, if there is not a single village door left. Called by VillageCollection + */ + public boolean isAnnihilated() + { + return this.villageDoorInfoList.isEmpty(); + } + + public void addOrRenewAgressor(EntityLivingBase p_75575_1_) + { + Iterator iterator = this.villageAgressors.iterator(); + Village.VillageAgressor villageagressor; + + do + { + if (!iterator.hasNext()) + { + this.villageAgressors.add(new Village.VillageAgressor(p_75575_1_, this.tickCounter)); + return; + } + + villageagressor = (Village.VillageAgressor)iterator.next(); + } + while (villageagressor.agressor != p_75575_1_); + + villageagressor.agressionTime = this.tickCounter; + } + + public EntityLivingBase findNearestVillageAggressor(EntityLivingBase p_75571_1_) + { + double d0 = Double.MAX_VALUE; + Village.VillageAgressor villageagressor = null; + + for (int i = 0; i < this.villageAgressors.size(); ++i) + { + Village.VillageAgressor villageagressor1 = (Village.VillageAgressor)this.villageAgressors.get(i); + double d1 = villageagressor1.agressor.getDistanceSqToEntity(p_75571_1_); + + if (d1 <= d0) + { + villageagressor = villageagressor1; + d0 = d1; + } + } + + return villageagressor != null ? villageagressor.agressor : null; + } + + public EntityPlayer func_82685_c(EntityLivingBase p_82685_1_) + { + double d0 = Double.MAX_VALUE; + EntityPlayer entityplayer = null; + Iterator iterator = this.playerReputation.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + + if (this.isPlayerReputationTooLow(s)) + { + EntityPlayer entityplayer1 = this.worldObj.getPlayerEntityByName(s); + + if (entityplayer1 != null) + { + double d1 = entityplayer1.getDistanceSqToEntity(p_82685_1_); + + if (d1 <= d0) + { + entityplayer = entityplayer1; + d0 = d1; + } + } + } + } + + return entityplayer; + } + + private void removeDeadAndOldAgressors() + { + Iterator iterator = this.villageAgressors.iterator(); + + while (iterator.hasNext()) + { + Village.VillageAgressor villageagressor = (Village.VillageAgressor)iterator.next(); + + if (!villageagressor.agressor.isEntityAlive() || Math.abs(this.tickCounter - villageagressor.agressionTime) > 300) + { + iterator.remove(); + } + } + } + + private void removeDeadAndOutOfRangeDoors() + { + boolean flag = false; + boolean flag1 = this.worldObj.rand.nextInt(50) == 0; + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo)iterator.next(); + + if (flag1) + { + villagedoorinfo.resetDoorOpeningRestrictionCounter(); + } + + if (!this.isBlockDoor(villagedoorinfo.posX, villagedoorinfo.posY, villagedoorinfo.posZ) || Math.abs(this.tickCounter - villagedoorinfo.lastActivityTimestamp) > 1200) + { + this.centerHelper.posX -= villagedoorinfo.posX; + this.centerHelper.posY -= villagedoorinfo.posY; + this.centerHelper.posZ -= villagedoorinfo.posZ; + flag = true; + villagedoorinfo.isDetachedFromVillageFlag = true; + iterator.remove(); + } + } + + if (flag) + { + this.updateVillageRadiusAndCenter(); + } + } + + private boolean isBlockDoor(int p_75574_1_, int p_75574_2_, int p_75574_3_) + { + return this.worldObj.getBlock(p_75574_1_, p_75574_2_, p_75574_3_) == Blocks.wooden_door; + } + + private void updateVillageRadiusAndCenter() + { + int i = this.villageDoorInfoList.size(); + + if (i == 0) + { + this.center.set(0, 0, 0); + this.villageRadius = 0; + } + else + { + this.center.set(this.centerHelper.posX / i, this.centerHelper.posY / i, this.centerHelper.posZ / i); + int j = 0; + VillageDoorInfo villagedoorinfo; + + for (Iterator iterator = this.villageDoorInfoList.iterator(); iterator.hasNext(); j = Math.max(villagedoorinfo.getDistanceSquared(this.center.posX, this.center.posY, this.center.posZ), j)) + { + villagedoorinfo = (VillageDoorInfo)iterator.next(); + } + + this.villageRadius = Math.max(32, (int)Math.sqrt((double)j) + 1); + } + } + + /** + * Return the village reputation for a player + */ + public int getReputationForPlayer(String p_82684_1_) + { + Integer integer = (Integer)this.playerReputation.get(p_82684_1_); + return integer != null ? integer.intValue() : 0; + } + + /** + * Set the village reputation for a player. + */ + public int setReputationForPlayer(String p_82688_1_, int p_82688_2_) + { + int j = this.getReputationForPlayer(p_82688_1_); + int k = MathHelper.clamp_int(j + p_82688_2_, -30, 10); + this.playerReputation.put(p_82688_1_, Integer.valueOf(k)); + return k; + } + + /** + * Return whether this player has a too low reputation with this village. + */ + public boolean isPlayerReputationTooLow(String p_82687_1_) + { + return this.getReputationForPlayer(p_82687_1_) <= -15; + } + + /** + * Read this village's data from NBT. + */ + public void readVillageDataFromNBT(NBTTagCompound p_82690_1_) + { + this.numVillagers = p_82690_1_.getInteger("PopSize"); + this.villageRadius = p_82690_1_.getInteger("Radius"); + this.numIronGolems = p_82690_1_.getInteger("Golems"); + this.lastAddDoorTimestamp = p_82690_1_.getInteger("Stable"); + this.tickCounter = p_82690_1_.getInteger("Tick"); + this.noBreedTicks = p_82690_1_.getInteger("MTick"); + this.center.posX = p_82690_1_.getInteger("CX"); + this.center.posY = p_82690_1_.getInteger("CY"); + this.center.posZ = p_82690_1_.getInteger("CZ"); + this.centerHelper.posX = p_82690_1_.getInteger("ACX"); + this.centerHelper.posY = p_82690_1_.getInteger("ACY"); + this.centerHelper.posZ = p_82690_1_.getInteger("ACZ"); + NBTTagList nbttaglist = p_82690_1_.getTagList("Doors", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + VillageDoorInfo villagedoorinfo = new VillageDoorInfo(nbttagcompound1.getInteger("X"), nbttagcompound1.getInteger("Y"), nbttagcompound1.getInteger("Z"), nbttagcompound1.getInteger("IDX"), nbttagcompound1.getInteger("IDZ"), nbttagcompound1.getInteger("TS")); + this.villageDoorInfoList.add(villagedoorinfo); + } + + NBTTagList nbttaglist1 = p_82690_1_.getTagList("Players", 10); + + for (int j = 0; j < nbttaglist1.tagCount(); ++j) + { + NBTTagCompound nbttagcompound2 = nbttaglist1.getCompoundTagAt(j); + this.playerReputation.put(nbttagcompound2.getString("Name"), Integer.valueOf(nbttagcompound2.getInteger("S"))); + } + } + + /** + * Write this village's data to NBT. + */ + public void writeVillageDataToNBT(NBTTagCompound p_82689_1_) + { + p_82689_1_.setInteger("PopSize", this.numVillagers); + p_82689_1_.setInteger("Radius", this.villageRadius); + p_82689_1_.setInteger("Golems", this.numIronGolems); + p_82689_1_.setInteger("Stable", this.lastAddDoorTimestamp); + p_82689_1_.setInteger("Tick", this.tickCounter); + p_82689_1_.setInteger("MTick", this.noBreedTicks); + p_82689_1_.setInteger("CX", this.center.posX); + p_82689_1_.setInteger("CY", this.center.posY); + p_82689_1_.setInteger("CZ", this.center.posZ); + p_82689_1_.setInteger("ACX", this.centerHelper.posX); + p_82689_1_.setInteger("ACY", this.centerHelper.posY); + p_82689_1_.setInteger("ACZ", this.centerHelper.posZ); + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.villageDoorInfoList.iterator(); + + while (iterator.hasNext()) + { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo)iterator.next(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setInteger("X", villagedoorinfo.posX); + nbttagcompound1.setInteger("Y", villagedoorinfo.posY); + nbttagcompound1.setInteger("Z", villagedoorinfo.posZ); + nbttagcompound1.setInteger("IDX", villagedoorinfo.insideDirectionX); + nbttagcompound1.setInteger("IDZ", villagedoorinfo.insideDirectionZ); + nbttagcompound1.setInteger("TS", villagedoorinfo.lastActivityTimestamp); + nbttaglist.appendTag(nbttagcompound1); + } + + p_82689_1_.setTag("Doors", nbttaglist); + NBTTagList nbttaglist1 = new NBTTagList(); + Iterator iterator1 = this.playerReputation.keySet().iterator(); + + while (iterator1.hasNext()) + { + String s = (String)iterator1.next(); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setString("Name", s); + nbttagcompound2.setInteger("S", ((Integer)this.playerReputation.get(s)).intValue()); + nbttaglist1.appendTag(nbttagcompound2); + } + + p_82689_1_.setTag("Players", nbttaglist1); + } + + /** + * Prevent villager breeding for a fixed interval of time + */ + public void endMatingSeason() + { + this.noBreedTicks = this.tickCounter; + } + + /** + * Return whether villagers mating refractory period has passed + */ + public boolean isMatingSeason() + { + return this.noBreedTicks == 0 || this.tickCounter - this.noBreedTicks >= 3600; + } + + public void setDefaultPlayerReputation(int p_82683_1_) + { + Iterator iterator = this.playerReputation.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + this.setReputationForPlayer(s, p_82683_1_); + } + } + + class VillageAgressor + { + public EntityLivingBase agressor; + public int agressionTime; + private static final String __OBFID = "CL_00001632"; + + VillageAgressor(EntityLivingBase p_i1674_2_, int p_i1674_3_) + { + this.agressor = p_i1674_2_; + this.agressionTime = p_i1674_3_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/VillageCollection.java b/build/rfg/minecraft-src/java/net/minecraft/village/VillageCollection.java new file mode 100644 index 0000000..a4c09e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/VillageCollection.java @@ -0,0 +1,377 @@ +package net.minecraft.village; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.block.BlockDoor; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class VillageCollection extends WorldSavedData +{ + private World worldObj; + /** + * This is a black hole. You can add data to this list through a public interface, but you can't query that + * information in any way and it's not used internally either. + */ + private final List villagerPositionsList = new ArrayList(); + private final List newDoors = new ArrayList(); + private final List villageList = new ArrayList(); + private int tickCounter; + private static final String __OBFID = "CL_00001635"; + + public VillageCollection(String p_i1677_1_) + { + super(p_i1677_1_); + } + + public VillageCollection(World p_i1678_1_) + { + super("villages"); + this.worldObj = p_i1678_1_; + this.markDirty(); + } + + public void func_82566_a(World p_82566_1_) + { + this.worldObj = p_82566_1_; + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + village.func_82691_a(p_82566_1_); + } + } + + /** + * This is a black hole. You can add data to this list through a public interface, but you can't query that + * information in any way and it's not used internally either. + */ + public void addVillagerPosition(int p_75551_1_, int p_75551_2_, int p_75551_3_) + { + if (this.villagerPositionsList.size() <= 64) + { + if (!this.isVillagerPositionPresent(p_75551_1_, p_75551_2_, p_75551_3_)) + { + this.villagerPositionsList.add(new ChunkCoordinates(p_75551_1_, p_75551_2_, p_75551_3_)); + } + } + } + + /** + * Runs a single tick for the village collection + */ + public void tick() + { + ++this.tickCounter; + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + village.tick(this.tickCounter); + } + + this.removeAnnihilatedVillages(); + this.dropOldestVillagerPosition(); + this.addNewDoorsToVillageOrCreateVillage(); + + if (this.tickCounter % 400 == 0) + { + this.markDirty(); + } + } + + private void removeAnnihilatedVillages() + { + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + + if (village.isAnnihilated()) + { + iterator.remove(); + this.markDirty(); + } + } + } + + /** + * Get a list of villages. + */ + public List getVillageList() + { + return this.villageList; + } + + /** + * Finds the nearest village, but only the given coordinates are withing it's bounding box plus the given the + * distance. + */ + public Village findNearestVillage(int p_75550_1_, int p_75550_2_, int p_75550_3_, int p_75550_4_) + { + Village village = null; + float f = Float.MAX_VALUE; + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village1 = (Village)iterator.next(); + float f1 = village1.getCenter().getDistanceSquared(p_75550_1_, p_75550_2_, p_75550_3_); + + if (f1 < f) + { + float f2 = (float)(p_75550_4_ + village1.getVillageRadius()); + + if (f1 <= f2 * f2) + { + village = village1; + f = f1; + } + } + } + + return village; + } + + private void dropOldestVillagerPosition() + { + if (!this.villagerPositionsList.isEmpty()) + { + this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.villagerPositionsList.remove(0)); + } + } + + private void addNewDoorsToVillageOrCreateVillage() + { + int i = 0; + + while (i < this.newDoors.size()) + { + VillageDoorInfo villagedoorinfo = (VillageDoorInfo)this.newDoors.get(i); + boolean flag = false; + Iterator iterator = this.villageList.iterator(); + + while (true) + { + if (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + int j = (int)village.getCenter().getDistanceSquared(villagedoorinfo.posX, villagedoorinfo.posY, villagedoorinfo.posZ); + float k = 32f + village.getVillageRadius(); //BugFix: Avoid int wrapping + + if (j > k * k) + { + continue; + } + + village.addVillageDoorInfo(villagedoorinfo); + flag = true; + } + + if (!flag) + { + Village village1 = new Village(this.worldObj); + village1.addVillageDoorInfo(villagedoorinfo); + this.villageList.add(village1); + this.markDirty(); + } + + ++i; + break; + } + } + + this.newDoors.clear(); + } + + private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates p_75546_1_) + { + byte b0 = 16; + byte b1 = 4; + byte b2 = 16; + + for (int i = p_75546_1_.posX - b0; i < p_75546_1_.posX + b0; ++i) + { + for (int j = p_75546_1_.posY - b1; j < p_75546_1_.posY + b1; ++j) + { + for (int k = p_75546_1_.posZ - b2; k < p_75546_1_.posZ + b2; ++k) + { + if (this.isWoodenDoorAt(i, j, k)) + { + VillageDoorInfo villagedoorinfo = this.getVillageDoorAt(i, j, k); + + if (villagedoorinfo == null) + { + this.addDoorToNewListIfAppropriate(i, j, k); + } + else + { + villagedoorinfo.lastActivityTimestamp = this.tickCounter; + } + } + } + } + } + } + + private VillageDoorInfo getVillageDoorAt(int p_75547_1_, int p_75547_2_, int p_75547_3_) + { + Iterator iterator = this.newDoors.iterator(); + VillageDoorInfo villagedoorinfo; + + do + { + if (!iterator.hasNext()) + { + iterator = this.villageList.iterator(); + VillageDoorInfo villagedoorinfo1; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + Village village = (Village)iterator.next(); + villagedoorinfo1 = village.getVillageDoorAt(p_75547_1_, p_75547_2_, p_75547_3_); + } + while (villagedoorinfo1 == null); + + return villagedoorinfo1; + } + + villagedoorinfo = (VillageDoorInfo)iterator.next(); + } + while (villagedoorinfo.posX != p_75547_1_ || villagedoorinfo.posZ != p_75547_3_ || Math.abs(villagedoorinfo.posY - p_75547_2_) > 1); + + return villagedoorinfo; + } + + private void addDoorToNewListIfAppropriate(int p_75542_1_, int p_75542_2_, int p_75542_3_) + { + int l = ((BlockDoor)Blocks.wooden_door).func_150013_e(this.worldObj, p_75542_1_, p_75542_2_, p_75542_3_); + int i1; + int j1; + + if (l != 0 && l != 2) + { + i1 = 0; + + for (j1 = -5; j1 < 0; ++j1) + { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_, p_75542_2_, p_75542_3_ + j1)) + { + --i1; + } + } + + for (j1 = 1; j1 <= 5; ++j1) + { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_, p_75542_2_, p_75542_3_ + j1)) + { + ++i1; + } + } + + if (i1 != 0) + { + this.newDoors.add(new VillageDoorInfo(p_75542_1_, p_75542_2_, p_75542_3_, 0, i1 > 0 ? -2 : 2, this.tickCounter)); + } + } + else + { + i1 = 0; + + for (j1 = -5; j1 < 0; ++j1) + { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_ + j1, p_75542_2_, p_75542_3_)) + { + --i1; + } + } + + for (j1 = 1; j1 <= 5; ++j1) + { + if (this.worldObj.canBlockSeeTheSky(p_75542_1_ + j1, p_75542_2_, p_75542_3_)) + { + ++i1; + } + } + + if (i1 != 0) + { + this.newDoors.add(new VillageDoorInfo(p_75542_1_, p_75542_2_, p_75542_3_, i1 > 0 ? -2 : 2, 0, this.tickCounter)); + } + } + } + + private boolean isVillagerPositionPresent(int p_75548_1_, int p_75548_2_, int p_75548_3_) + { + Iterator iterator = this.villagerPositionsList.iterator(); + ChunkCoordinates chunkcoordinates; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + chunkcoordinates = (ChunkCoordinates)iterator.next(); + } + while (chunkcoordinates.posX != p_75548_1_ || chunkcoordinates.posY != p_75548_2_ || chunkcoordinates.posZ != p_75548_3_); + + return true; + } + + private boolean isWoodenDoorAt(int p_75541_1_, int p_75541_2_, int p_75541_3_) + { + return this.worldObj.getBlock(p_75541_1_, p_75541_2_, p_75541_3_) == Blocks.wooden_door; + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound p_76184_1_) + { + this.tickCounter = p_76184_1_.getInteger("Tick"); + NBTTagList nbttaglist = p_76184_1_.getTagList("Villages", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + Village village = new Village(); + village.readVillageDataFromNBT(nbttagcompound1); + this.villageList.add(village); + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound p_76187_1_) + { + p_76187_1_.setInteger("Tick", this.tickCounter); + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.villageList.iterator(); + + while (iterator.hasNext()) + { + Village village = (Village)iterator.next(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + village.writeVillageDataToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + + p_76187_1_.setTag("Villages", nbttaglist); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/VillageDoorInfo.java b/build/rfg/minecraft-src/java/net/minecraft/village/VillageDoorInfo.java new file mode 100644 index 0000000..fbfc48a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/VillageDoorInfo.java @@ -0,0 +1,84 @@ +package net.minecraft.village; + +public class VillageDoorInfo +{ + public final int posX; + public final int posY; + public final int posZ; + public final int insideDirectionX; + public final int insideDirectionZ; + public int lastActivityTimestamp; + public boolean isDetachedFromVillageFlag; + private int doorOpeningRestrictionCounter; + private static final String __OBFID = "CL_00001630"; + + public VillageDoorInfo(int p_i1673_1_, int p_i1673_2_, int p_i1673_3_, int p_i1673_4_, int p_i1673_5_, int p_i1673_6_) + { + this.posX = p_i1673_1_; + this.posY = p_i1673_2_; + this.posZ = p_i1673_3_; + this.insideDirectionX = p_i1673_4_; + this.insideDirectionZ = p_i1673_5_; + this.lastActivityTimestamp = p_i1673_6_; + } + + /** + * Returns the squared distance between this door and the given coordinate. + */ + public int getDistanceSquared(int p_75474_1_, int p_75474_2_, int p_75474_3_) + { + int l = p_75474_1_ - this.posX; + int i1 = p_75474_2_ - this.posY; + int j1 = p_75474_3_ - this.posZ; + return l * l + i1 * i1 + j1 * j1; + } + + /** + * Get the square of the distance from a location 2 blocks away from the door considered 'inside' and the given + * arguments + */ + public int getInsideDistanceSquare(int p_75469_1_, int p_75469_2_, int p_75469_3_) + { + int l = p_75469_1_ - this.posX - this.insideDirectionX; + int i1 = p_75469_2_ - this.posY; + int j1 = p_75469_3_ - this.posZ - this.insideDirectionZ; + return l * l + i1 * i1 + j1 * j1; + } + + public int getInsidePosX() + { + return this.posX + this.insideDirectionX; + } + + public int getInsidePosY() + { + return this.posY; + } + + public int getInsidePosZ() + { + return this.posZ + this.insideDirectionZ; + } + + public boolean isInside(int p_75467_1_, int p_75467_2_) + { + int k = p_75467_1_ - this.posX; + int l = p_75467_2_ - this.posZ; + return k * this.insideDirectionX + l * this.insideDirectionZ >= 0; + } + + public void resetDoorOpeningRestrictionCounter() + { + this.doorOpeningRestrictionCounter = 0; + } + + public void incrementDoorOpeningRestrictionCounter() + { + ++this.doorOpeningRestrictionCounter; + } + + public int getDoorOpeningRestrictionCounter() + { + return this.doorOpeningRestrictionCounter; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/village/VillageSiege.java b/build/rfg/minecraft-src/java/net/minecraft/village/VillageSiege.java new file mode 100644 index 0000000..6396507 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/village/VillageSiege.java @@ -0,0 +1,226 @@ +package net.minecraft.village; + +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; + +public class VillageSiege +{ + private World worldObj; + private boolean field_75535_b; + private int field_75536_c = -1; + private int field_75533_d; + private int field_75534_e; + /** Instance of Village. */ + private Village theVillage; + private int field_75532_g; + private int field_75538_h; + private int field_75539_i; + private static final String __OBFID = "CL_00001634"; + + public VillageSiege(World p_i1676_1_) + { + this.worldObj = p_i1676_1_; + } + + /** + * Runs a single tick for the village siege + */ + public void tick() + { + boolean flag = false; + + if (flag) + { + if (this.field_75536_c == 2) + { + this.field_75533_d = 100; + return; + } + } + else + { + if (this.worldObj.isDaytime()) + { + this.field_75536_c = 0; + return; + } + + if (this.field_75536_c == 2) + { + return; + } + + if (this.field_75536_c == 0) + { + float f = this.worldObj.getCelestialAngle(0.0F); + + if ((double)f < 0.5D || (double)f > 0.501D) + { + return; + } + + this.field_75536_c = this.worldObj.rand.nextInt(10) == 0 ? 1 : 2; + this.field_75535_b = false; + + if (this.field_75536_c == 2) + { + return; + } + } + } + + if (!this.field_75535_b) + { + if (!this.func_75529_b()) + { + return; + } + + this.field_75535_b = true; + } + + if (this.field_75534_e > 0) + { + --this.field_75534_e; + } + else + { + this.field_75534_e = 2; + + if (this.field_75533_d > 0) + { + this.spawnZombie(); + --this.field_75533_d; + } + else + { + this.field_75536_c = 2; + } + } + } + + private boolean func_75529_b() + { + List list = this.worldObj.playerEntities; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + this.theVillage = this.worldObj.villageCollectionObj.findNearestVillage((int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ, 1); + + if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20) + { + ChunkCoordinates chunkcoordinates = this.theVillage.getCenter(); + float f = (float)this.theVillage.getVillageRadius(); + boolean flag = false; + int i = 0; + + while (true) + { + if (i < 10) + { + this.field_75532_g = chunkcoordinates.posX + (int)((double)(MathHelper.cos(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * f) * 0.9D); + this.field_75538_h = chunkcoordinates.posY; + this.field_75539_i = chunkcoordinates.posZ + (int)((double)(MathHelper.sin(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * f) * 0.9D); + flag = false; + Iterator iterator1 = this.worldObj.villageCollectionObj.getVillageList().iterator(); + + while (iterator1.hasNext()) + { + Village village = (Village)iterator1.next(); + + if (village != this.theVillage && village.isInRange(this.field_75532_g, this.field_75538_h, this.field_75539_i)) + { + flag = true; + break; + } + } + + if (flag) + { + ++i; + continue; + } + } + + if (flag) + { + return false; + } + + Vec3 vec3 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); + + if (vec3 != null) + { + this.field_75534_e = 0; + this.field_75533_d = 20; + return true; + } + + break; + } + } + } + + return false; + } + + private boolean spawnZombie() + { + Vec3 vec3 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); + + if (vec3 == null) + { + return false; + } + else + { + EntityZombie entityzombie; + + try + { + entityzombie = new EntityZombie(this.worldObj); + entityzombie.onSpawnWithEgg((IEntityLivingData)null); + entityzombie.setVillager(false); + } + catch (Exception exception) + { + exception.printStackTrace(); + return false; + } + + entityzombie.setLocationAndAngles(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityzombie); + ChunkCoordinates chunkcoordinates = this.theVillage.getCenter(); + entityzombie.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, this.theVillage.getVillageRadius()); + return true; + } + } + + private Vec3 func_75527_a(int p_75527_1_, int p_75527_2_, int p_75527_3_) + { + for (int l = 0; l < 10; ++l) + { + int i1 = p_75527_1_ + this.worldObj.rand.nextInt(16) - 8; + int j1 = p_75527_2_ + this.worldObj.rand.nextInt(6) - 3; + int k1 = p_75527_3_ + this.worldObj.rand.nextInt(16) - 8; + + if (this.theVillage.isInRange(i1, j1, k1) && SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, this.worldObj, i1, j1, k1)) + { + Vec3.createVectorHelper((double)i1, (double)j1, (double)k1); + } + } + + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCache.java b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCache.java new file mode 100644 index 0000000..9bdae69 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCache.java @@ -0,0 +1,289 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.common.util.ForgeDirection; + +public class ChunkCache implements IBlockAccess +{ + private int chunkX; + private int chunkZ; + private Chunk[][] chunkArray; + /** True if the chunk cache is empty. */ + private boolean isEmpty; + /** Reference to the World object. */ + private World worldObj; + private static final String __OBFID = "CL_00000155"; + + public ChunkCache(World p_i1964_1_, int p_i1964_2_, int p_i1964_3_, int p_i1964_4_, int p_i1964_5_, int p_i1964_6_, int p_i1964_7_, int p_i1964_8_) + { + this.worldObj = p_i1964_1_; + this.chunkX = p_i1964_2_ - p_i1964_8_ >> 4; + this.chunkZ = p_i1964_4_ - p_i1964_8_ >> 4; + int l1 = p_i1964_5_ + p_i1964_8_ >> 4; + int i2 = p_i1964_7_ + p_i1964_8_ >> 4; + this.chunkArray = new Chunk[l1 - this.chunkX + 1][i2 - this.chunkZ + 1]; + this.isEmpty = true; + int j2; + int k2; + Chunk chunk; + + for (j2 = this.chunkX; j2 <= l1; ++j2) + { + for (k2 = this.chunkZ; k2 <= i2; ++k2) + { + chunk = p_i1964_1_.getChunkFromChunkCoords(j2, k2); + + if (chunk != null) + { + this.chunkArray[j2 - this.chunkX][k2 - this.chunkZ] = chunk; + } + } + } + + for (j2 = p_i1964_2_ >> 4; j2 <= p_i1964_5_ >> 4; ++j2) + { + for (k2 = p_i1964_4_ >> 4; k2 <= p_i1964_7_ >> 4; ++k2) + { + chunk = this.chunkArray[j2 - this.chunkX][k2 - this.chunkZ]; + + if (chunk != null && !chunk.getAreLevelsEmpty(p_i1964_3_, p_i1964_6_)) + { + this.isEmpty = false; + } + } + } + } + + /** + * set by !chunk.getAreLevelsEmpty + */ + @SideOnly(Side.CLIENT) + public boolean extendedLevelsInChunkCache() + { + return this.isEmpty; + } + + public Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_) + { + Block block = Blocks.air; + + if (p_147439_2_ >= 0 && p_147439_2_ < 256) + { + int l = (p_147439_1_ >> 4) - this.chunkX; + int i1 = (p_147439_3_ >> 4) - this.chunkZ; + + if (l >= 0 && l < this.chunkArray.length && i1 >= 0 && i1 < this.chunkArray[l].length) + { + Chunk chunk = this.chunkArray[l][i1]; + + if (chunk != null) + { + block = chunk.getBlock(p_147439_1_ & 15, p_147439_2_, p_147439_3_ & 15); + } + } + } + + return block; + } + + public TileEntity getTileEntity(int x, int y, int z) + { + int l = (x >> 4) - this.chunkX; + int i1 = (z >> 4) - this.chunkZ; + if (l < 0 || l >= chunkArray.length || i1 < 0 || i1 >= chunkArray[l].length) return null; + if (chunkArray[l][i1] == null) return null; + return this.chunkArray[l][i1].func_150806_e(x & 15, y, z & 15); + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + @SideOnly(Side.CLIENT) + public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) + { + int i1 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, p_72802_1_, p_72802_2_, p_72802_3_); + int j1 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, p_72802_1_, p_72802_2_, p_72802_3_); + + if (j1 < p_72802_4_) + { + j1 = p_72802_4_; + } + + return i1 << 20 | j1 << 4; + } + + /** + * Returns the block metadata at coords x,y,z + */ + public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) + { + if (p_72805_2_ < 0) + { + return 0; + } + else if (p_72805_2_ >= 256) + { + return 0; + } + else + { + int l = (p_72805_1_ >> 4) - this.chunkX; + int i1 = (p_72805_3_ >> 4) - this.chunkZ; + if (l < 0 || l >= chunkArray.length || i1 < 0 || i1 >= chunkArray[l].length) return 0; + if (chunkArray[l][i1] == null) return 0; + return this.chunkArray[l][i1].getBlockMetadata(p_72805_1_ & 15, p_72805_2_, p_72805_3_ & 15); + } + } + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + public int isBlockProvidingPowerTo(int x, int y, int z, int directionIn) + { + return this.getBlock(x, y, z).isProvidingStrongPower(this, x, y, z, directionIn); + } + + /** + * Gets the biome for a given set of x/z coordinates + */ + @SideOnly(Side.CLIENT) + public BiomeGenBase getBiomeGenForCoords(int x, int z) + { + return this.worldObj.getBiomeGenForCoords(x, z); + } + + /** + * Returns true if the block at the specified coordinates is empty + */ + public boolean isAirBlock(int x, int y, int z) + { + return this.getBlock(x, y, z).isAir(this, x, y, z); + } + + /** + * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. + * Brightness for SkyBlock.Block is yellowish and independent. + */ + @SideOnly(Side.CLIENT) + public int getSkyBlockTypeBrightness(EnumSkyBlock p_72810_1_, int p_72810_2_, int p_72810_3_, int p_72810_4_) + { + if (p_72810_3_ < 0) + { + p_72810_3_ = 0; + } + + if (p_72810_3_ >= 256) + { + p_72810_3_ = 255; + } + + if (p_72810_3_ >= 0 && p_72810_3_ < 256 && p_72810_2_ >= -30000000 && p_72810_4_ >= -30000000 && p_72810_2_ < 30000000 && p_72810_4_ <= 30000000) + { + if (p_72810_1_ == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) + { + return 0; + } + else + { + int l; + int i1; + + if (this.getBlock(p_72810_2_, p_72810_3_, p_72810_4_).getUseNeighborBrightness()) + { + l = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_ + 1, p_72810_4_); + i1 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_ + 1, p_72810_3_, p_72810_4_); + int j1 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_ - 1, p_72810_3_, p_72810_4_); + int k1 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_, p_72810_4_ + 1); + int l1 = this.getSpecialBlockBrightness(p_72810_1_, p_72810_2_, p_72810_3_, p_72810_4_ - 1); + + if (i1 > l) + { + l = i1; + } + + if (j1 > l) + { + l = j1; + } + + if (k1 > l) + { + l = k1; + } + + if (l1 > l) + { + l = l1; + } + + return l; + } + else + { + l = (p_72810_2_ >> 4) - this.chunkX; + i1 = (p_72810_4_ >> 4) - this.chunkZ; + return this.chunkArray[l][i1].getSavedLightValue(p_72810_1_, p_72810_2_ & 15, p_72810_3_, p_72810_4_ & 15); + } + } + } + else + { + return p_72810_1_.defaultLightValue; + } + } + + /** + * is only used on stairs and tilled fields + */ + @SideOnly(Side.CLIENT) + public int getSpecialBlockBrightness(EnumSkyBlock p_72812_1_, int p_72812_2_, int p_72812_3_, int p_72812_4_) + { + if (p_72812_3_ < 0) + { + p_72812_3_ = 0; + } + + if (p_72812_3_ >= 256) + { + p_72812_3_ = 255; + } + + if (p_72812_3_ >= 0 && p_72812_3_ < 256 && p_72812_2_ >= -30000000 && p_72812_4_ >= -30000000 && p_72812_2_ < 30000000 && p_72812_4_ <= 30000000) + { + int l = (p_72812_2_ >> 4) - this.chunkX; + int i1 = (p_72812_4_ >> 4) - this.chunkZ; + return this.chunkArray[l][i1].getSavedLightValue(p_72812_1_, p_72812_2_ & 15, p_72812_3_, p_72812_4_ & 15); + } + else + { + return p_72812_1_.defaultLightValue; + } + } + + /** + * Returns current world height. + */ + @SideOnly(Side.CLIENT) + public int getHeight() + { + return 256; + } + + @Override + public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) + { + if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) + { + return _default; + } + + return getBlock(x, y, z).isSideSolid(this, x, y, z, side); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCoordIntPair.java b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCoordIntPair.java new file mode 100644 index 0000000..ada4a4d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkCoordIntPair.java @@ -0,0 +1,68 @@ +package net.minecraft.world; + +public class ChunkCoordIntPair +{ + /** The X position of this Chunk Coordinate Pair */ + public final int chunkXPos; + /** The Z position of this Chunk Coordinate Pair */ + public final int chunkZPos; + private static final String __OBFID = "CL_00000133"; + + public ChunkCoordIntPair(int p_i1947_1_, int p_i1947_2_) + { + this.chunkXPos = p_i1947_1_; + this.chunkZPos = p_i1947_2_; + } + + /** + * converts a chunk coordinate pair to an integer (suitable for hashing) + */ + public static long chunkXZ2Int(int p_77272_0_, int p_77272_1_) + { + return (long)p_77272_0_ & 4294967295L | ((long)p_77272_1_ & 4294967295L) << 32; + } + + public int hashCode() + { + int i = 1664525 * this.chunkXPos + 1013904223; + int j = 1664525 * (this.chunkZPos ^ -559038737) + 1013904223; + return i ^ j; + } + + public boolean equals(Object p_equals_1_) + { + if (this == p_equals_1_) + { + return true; + } + else if (!(p_equals_1_ instanceof ChunkCoordIntPair)) + { + return false; + } + else + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)p_equals_1_; + return this.chunkXPos == chunkcoordintpair.chunkXPos && this.chunkZPos == chunkcoordintpair.chunkZPos; + } + } + + public int getCenterXPos() + { + return (this.chunkXPos << 4) + 8; + } + + public int getCenterZPosition() + { + return (this.chunkZPos << 4) + 8; + } + + public ChunkPosition func_151349_a(int p_151349_1_) + { + return new ChunkPosition(this.getCenterXPos(), p_151349_1_, this.getCenterZPosition()); + } + + public String toString() + { + return "[" + this.chunkXPos + ", " + this.chunkZPos + "]"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/ChunkPosition.java b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkPosition.java new file mode 100644 index 0000000..e33ee55 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/ChunkPosition.java @@ -0,0 +1,42 @@ +package net.minecraft.world; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class ChunkPosition +{ + public final int chunkPosX; + public final int chunkPosY; + public final int chunkPosZ; + private static final String __OBFID = "CL_00000132"; + + public ChunkPosition(int p_i45363_1_, int p_i45363_2_, int p_i45363_3_) + { + this.chunkPosX = p_i45363_1_; + this.chunkPosY = p_i45363_2_; + this.chunkPosZ = p_i45363_3_; + } + + public ChunkPosition(Vec3 p_i45364_1_) + { + this(MathHelper.floor_double(p_i45364_1_.xCoord), MathHelper.floor_double(p_i45364_1_.yCoord), MathHelper.floor_double(p_i45364_1_.zCoord)); + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof ChunkPosition)) + { + return false; + } + else + { + ChunkPosition chunkposition = (ChunkPosition)p_equals_1_; + return chunkposition.chunkPosX == this.chunkPosX && chunkposition.chunkPosY == this.chunkPosY && chunkposition.chunkPosZ == this.chunkPosZ; + } + } + + public int hashCode() + { + return this.chunkPosX * 8976890 + this.chunkPosY * 981131 + this.chunkPosZ; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerFoliage.java b/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerFoliage.java new file mode 100644 index 0000000..887a0d4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerFoliage.java @@ -0,0 +1,49 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ColorizerFoliage +{ + /** Color buffer for foliage */ + private static int[] foliageBuffer = new int[65536]; + private static final String __OBFID = "CL_00000135"; + + public static void setFoliageBiomeColorizer(int[] p_77467_0_) + { + foliageBuffer = p_77467_0_; + } + + /** + * Gets foliage color from temperature and humidity. Args: temperature, humidity + */ + public static int getFoliageColor(double p_77470_0_, double p_77470_2_) + { + p_77470_2_ *= p_77470_0_; + int i = (int)((1.0D - p_77470_0_) * 255.0D); + int j = (int)((1.0D - p_77470_2_) * 255.0D); + return foliageBuffer[j << 8 | i]; + } + + /** + * Gets the foliage color for pine type (metadata 1) trees + */ + public static int getFoliageColorPine() + { + return 6396257; + } + + /** + * Gets the foliage color for birch type (metadata 2) trees + */ + public static int getFoliageColorBirch() + { + return 8431445; + } + + public static int getFoliageColorBasic() + { + return 4764952; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerGrass.java b/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerGrass.java new file mode 100644 index 0000000..5e6b527 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/ColorizerGrass.java @@ -0,0 +1,28 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ColorizerGrass +{ + /** Color buffer for grass */ + private static int[] grassBuffer = new int[65536]; + private static final String __OBFID = "CL_00000138"; + + public static void setGrassBiomeColorizer(int[] p_77479_0_) + { + grassBuffer = p_77479_0_; + } + + /** + * Gets grass color from temperature and humidity. Args: temperature, humidity + */ + public static int getGrassColor(double p_77480_0_, double p_77480_2_) + { + p_77480_2_ *= p_77480_0_; + int i = (int)((1.0D - p_77480_0_) * 255.0D); + int j = (int)((1.0D - p_77480_2_) * 255.0D); + return grassBuffer[j << 8 | i]; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/EnumDifficulty.java b/build/rfg/minecraft-src/java/net/minecraft/world/EnumDifficulty.java new file mode 100644 index 0000000..1f1d131 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/EnumDifficulty.java @@ -0,0 +1,47 @@ +package net.minecraft.world; + +public enum EnumDifficulty +{ + PEACEFUL(0, "options.difficulty.peaceful"), + EASY(1, "options.difficulty.easy"), + NORMAL(2, "options.difficulty.normal"), + HARD(3, "options.difficulty.hard"); + private static final EnumDifficulty[] difficultyEnums = new EnumDifficulty[values().length]; + private final int difficultyId; + private final String difficultyResourceKey; + + private static final String __OBFID = "CL_00001510"; + + private EnumDifficulty(int p_i45312_3_, String p_i45312_4_) + { + this.difficultyId = p_i45312_3_; + this.difficultyResourceKey = p_i45312_4_; + } + + public int getDifficultyId() + { + return this.difficultyId; + } + + public static EnumDifficulty getDifficultyEnum(int p_151523_0_) + { + return difficultyEnums[p_151523_0_ % difficultyEnums.length]; + } + + public String getDifficultyResourceKey() + { + return this.difficultyResourceKey; + } + + static + { + EnumDifficulty[] var0 = values(); + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + EnumDifficulty var3 = var0[var2]; + difficultyEnums[var3.difficultyId] = var3; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/EnumSkyBlock.java b/build/rfg/minecraft-src/java/net/minecraft/world/EnumSkyBlock.java new file mode 100644 index 0000000..28f0e75 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/EnumSkyBlock.java @@ -0,0 +1,15 @@ +package net.minecraft.world; + +public enum EnumSkyBlock +{ + Sky(15), + Block(0); + public final int defaultLightValue; + + private static final String __OBFID = "CL_00000151"; + + private EnumSkyBlock(int p_i1961_3_) + { + this.defaultLightValue = p_i1961_3_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/Explosion.java b/build/rfg/minecraft-src/java/net/minecraft/world/Explosion.java new file mode 100644 index 0000000..b5018a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/Explosion.java @@ -0,0 +1,262 @@ +package net.minecraft.world; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentProtection; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class Explosion +{ + /** whether or not the explosion sets fire to blocks around it */ + public boolean isFlaming; + /** whether or not this explosion spawns smoke particles */ + public boolean isSmoking = true; + private int field_77289_h = 16; + private Random explosionRNG = new Random(); + private World worldObj; + public double explosionX; + public double explosionY; + public double explosionZ; + public Entity exploder; + public float explosionSize; + /** A list of ChunkPositions of blocks affected by this explosion */ + public List affectedBlockPositions = new ArrayList(); + private Map field_77288_k = new HashMap(); + private static final String __OBFID = "CL_00000134"; + + public Explosion(World p_i1948_1_, Entity p_i1948_2_, double p_i1948_3_, double p_i1948_5_, double p_i1948_7_, float p_i1948_9_) + { + this.worldObj = p_i1948_1_; + this.exploder = p_i1948_2_; + this.explosionSize = p_i1948_9_; + this.explosionX = p_i1948_3_; + this.explosionY = p_i1948_5_; + this.explosionZ = p_i1948_7_; + } + + /** + * Does the first part of the explosion (destroy blocks) + */ + public void doExplosionA() + { + float f = this.explosionSize; + HashSet hashset = new HashSet(); + int i; + int j; + int k; + double d5; + double d6; + double d7; + + for (i = 0; i < this.field_77289_h; ++i) + { + for (j = 0; j < this.field_77289_h; ++j) + { + for (k = 0; k < this.field_77289_h; ++k) + { + if (i == 0 || i == this.field_77289_h - 1 || j == 0 || j == this.field_77289_h - 1 || k == 0 || k == this.field_77289_h - 1) + { + double d0 = (double)((float)i / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); + double d1 = (double)((float)j / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); + double d2 = (double)((float)k / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); + double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2); + d0 /= d3; + d1 /= d3; + d2 /= d3; + float f1 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + d5 = this.explosionX; + d6 = this.explosionY; + d7 = this.explosionZ; + + for (float f2 = 0.3F; f1 > 0.0F; f1 -= f2 * 0.75F) + { + int j1 = MathHelper.floor_double(d5); + int k1 = MathHelper.floor_double(d6); + int l1 = MathHelper.floor_double(d7); + Block block = this.worldObj.getBlock(j1, k1, l1); + + if (block.getMaterial() != Material.air) + { + float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.worldObj, j1, k1, l1, block) : block.getExplosionResistance(this.exploder, worldObj, j1, k1, l1, explosionX, explosionY, explosionZ); + f1 -= (f3 + 0.3F) * f2; + } + + if (f1 > 0.0F && (this.exploder == null || this.exploder.func_145774_a(this, this.worldObj, j1, k1, l1, block, f1))) + { + hashset.add(new ChunkPosition(j1, k1, l1)); + } + + d5 += d0 * (double)f2; + d6 += d1 * (double)f2; + d7 += d2 * (double)f2; + } + } + } + } + } + + this.affectedBlockPositions.addAll(hashset); + this.explosionSize *= 2.0F; + i = MathHelper.floor_double(this.explosionX - (double)this.explosionSize - 1.0D); + j = MathHelper.floor_double(this.explosionX + (double)this.explosionSize + 1.0D); + k = MathHelper.floor_double(this.explosionY - (double)this.explosionSize - 1.0D); + int i2 = MathHelper.floor_double(this.explosionY + (double)this.explosionSize + 1.0D); + int l = MathHelper.floor_double(this.explosionZ - (double)this.explosionSize - 1.0D); + int j2 = MathHelper.floor_double(this.explosionZ + (double)this.explosionSize + 1.0D); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getBoundingBox((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); + net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.worldObj, this, list, this.explosionSize); + Vec3 vec3 = Vec3.createVectorHelper(this.explosionX, this.explosionY, this.explosionZ); + + for (int i1 = 0; i1 < list.size(); ++i1) + { + Entity entity = (Entity)list.get(i1); + double d4 = entity.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)this.explosionSize; + + if (d4 <= 1.0D) + { + d5 = entity.posX - this.explosionX; + d6 = entity.posY + (double)entity.getEyeHeight() - this.explosionY; + d7 = entity.posZ - this.explosionZ; + double d9 = (double)MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); + + if (d9 != 0.0D) + { + d5 /= d9; + d6 /= d9; + d7 /= d9; + double d10 = (double)this.worldObj.getBlockDensity(vec3, entity.boundingBox); + double d11 = (1.0D - d4) * d10; + entity.attackEntityFrom(DamageSource.setExplosionSource(this), (float)((int)((d11 * d11 + d11) / 2.0D * 8.0D * (double)this.explosionSize + 1.0D))); + double d8 = EnchantmentProtection.func_92092_a(entity, d11); + entity.motionX += d5 * d8; + entity.motionY += d6 * d8; + entity.motionZ += d7 * d8; + + if (entity instanceof EntityPlayer) + { + this.field_77288_k.put((EntityPlayer)entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11)); + } + } + } + } + + this.explosionSize = f; + } + + /** + * Does the second part of the explosion (sound, particles, drop spawn) + */ + public void doExplosionB(boolean p_77279_1_) + { + this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + if (this.explosionSize >= 2.0F && this.isSmoking) + { + this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); + } + else + { + this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); + } + + Iterator iterator; + ChunkPosition chunkposition; + int i; + int j; + int k; + Block block; + + if (this.isSmoking) + { + iterator = this.affectedBlockPositions.iterator(); + + while (iterator.hasNext()) + { + chunkposition = (ChunkPosition)iterator.next(); + i = chunkposition.chunkPosX; + j = chunkposition.chunkPosY; + k = chunkposition.chunkPosZ; + block = this.worldObj.getBlock(i, j, k); + + if (p_77279_1_) + { + double d0 = (double)((float)i + this.worldObj.rand.nextFloat()); + double d1 = (double)((float)j + this.worldObj.rand.nextFloat()); + double d2 = (double)((float)k + this.worldObj.rand.nextFloat()); + double d3 = d0 - this.explosionX; + double d4 = d1 - this.explosionY; + double d5 = d2 - this.explosionZ; + double d6 = (double)MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5); + d3 /= d6; + d4 /= d6; + d5 /= d6; + double d7 = 0.5D / (d6 / (double)this.explosionSize + 0.1D); + d7 *= (double)(this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); + d3 *= d7; + d4 *= d7; + d5 *= d7; + this.worldObj.spawnParticle("explode", (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5); + this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5); + } + + if (block.getMaterial() != Material.air) + { + if (block.canDropFromExplosion(this)) + { + block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0); + } + + block.onBlockExploded(this.worldObj, i, j, k, this); + } + } + } + + if (this.isFlaming) + { + iterator = this.affectedBlockPositions.iterator(); + + while (iterator.hasNext()) + { + chunkposition = (ChunkPosition)iterator.next(); + i = chunkposition.chunkPosX; + j = chunkposition.chunkPosY; + k = chunkposition.chunkPosZ; + block = this.worldObj.getBlock(i, j, k); + Block block1 = this.worldObj.getBlock(i, j - 1, k); + + if (block.getMaterial() == Material.air && block1.func_149730_j() && this.explosionRNG.nextInt(3) == 0) + { + this.worldObj.setBlock(i, j, k, Blocks.fire); + } + } + } + } + + public Map func_77277_b() + { + return this.field_77288_k; + } + + /** + * Returns either the entity that placed the explosive block, the entity that caused the explosion or null. + */ + public EntityLivingBase getExplosivePlacedBy() + { + return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/GameRules.java b/build/rfg/minecraft-src/java/net/minecraft/world/GameRules.java new file mode 100644 index 0000000..4e3f5e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/GameRules.java @@ -0,0 +1,172 @@ +package net.minecraft.world; + +import java.util.Iterator; +import java.util.Set; +import java.util.TreeMap; +import net.minecraft.nbt.NBTTagCompound; + +public class GameRules +{ + private TreeMap theGameRules = new TreeMap(); + private static final String __OBFID = "CL_00000136"; + + public GameRules() + { + this.addGameRule("doFireTick", "true"); + this.addGameRule("mobGriefing", "true"); + this.addGameRule("keepInventory", "false"); + this.addGameRule("doMobSpawning", "true"); + this.addGameRule("doMobLoot", "true"); + this.addGameRule("doTileDrops", "true"); + this.addGameRule("commandBlockOutput", "true"); + this.addGameRule("naturalRegeneration", "true"); + this.addGameRule("doDaylightCycle", "true"); + } + + /** + * Define a game rule and its default value. + */ + public void addGameRule(String p_82769_1_, String p_82769_2_) + { + this.theGameRules.put(p_82769_1_, new GameRules.Value(p_82769_2_)); + } + + public void setOrCreateGameRule(String p_82764_1_, String p_82764_2_) + { + GameRules.Value value = (GameRules.Value)this.theGameRules.get(p_82764_1_); + + if (value != null) + { + value.setValue(p_82764_2_); + } + else + { + this.addGameRule(p_82764_1_, p_82764_2_); + } + } + + /** + * Gets the string Game Rule value. + */ + public String getGameRuleStringValue(String p_82767_1_) + { + GameRules.Value value = (GameRules.Value)this.theGameRules.get(p_82767_1_); + return value != null ? value.getGameRuleStringValue() : ""; + } + + /** + * Gets the boolean Game Rule value. + */ + public boolean getGameRuleBooleanValue(String p_82766_1_) + { + GameRules.Value value = (GameRules.Value)this.theGameRules.get(p_82766_1_); + return value != null ? value.getGameRuleBooleanValue() : false; + } + + /** + * Return the defined game rules as NBT. + */ + public NBTTagCompound writeGameRulesToNBT() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + Iterator iterator = this.theGameRules.keySet().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + GameRules.Value value = (GameRules.Value)this.theGameRules.get(s); + nbttagcompound.setString(s, value.getGameRuleStringValue()); + } + + return nbttagcompound; + } + + /** + * Set defined game rules from NBT. + */ + public void readGameRulesFromNBT(NBTTagCompound p_82768_1_) + { + Set set = p_82768_1_.func_150296_c(); + Iterator iterator = set.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + String s1 = p_82768_1_.getString(s); + this.setOrCreateGameRule(s, s1); + } + } + + /** + * Return the defined game rules. + */ + public String[] getRules() + { + return (String[])this.theGameRules.keySet().toArray(new String[0]); + } + + /** + * Return whether the specified game rule is defined. + */ + public boolean hasRule(String p_82765_1_) + { + return this.theGameRules.containsKey(p_82765_1_); + } + + static class Value + { + private String valueString; + private boolean valueBoolean; + private int valueInteger; + private double valueDouble; + private static final String __OBFID = "CL_00000137"; + + public Value(String p_i1949_1_) + { + this.setValue(p_i1949_1_); + } + + /** + * Set this game rule value. + */ + public void setValue(String p_82757_1_) + { + this.valueString = p_82757_1_; + this.valueBoolean = Boolean.parseBoolean(p_82757_1_); + + try + { + this.valueInteger = Integer.parseInt(p_82757_1_); + } + catch (NumberFormatException numberformatexception1) + { + ; + } + + try + { + this.valueDouble = Double.parseDouble(p_82757_1_); + } + catch (NumberFormatException numberformatexception) + { + ; + } + } + + /** + * Gets the GameRule's value as String. + */ + public String getGameRuleStringValue() + { + return this.valueString; + } + + /** + * Gets the GameRule's value as boolean. + */ + public boolean getGameRuleBooleanValue() + { + return this.valueBoolean; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/IBlockAccess.java b/build/rfg/minecraft-src/java/net/minecraft/world/IBlockAccess.java new file mode 100644 index 0000000..2349a43 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/IBlockAccess.java @@ -0,0 +1,66 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.util.ForgeDirection; + +public interface IBlockAccess +{ + Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_); + + TileEntity getTileEntity(int x, int y, int z); + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + @SideOnly(Side.CLIENT) + int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_); + + /** + * Returns the block metadata at coords x,y,z + */ + int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_); + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + int isBlockProvidingPowerTo(int x, int y, int z, int directionIn); + + /** + * Returns true if the block at the specified coordinates is empty + */ + boolean isAirBlock(int x, int y, int z); + + /** + * Gets the biome for a given set of x/z coordinates + */ + @SideOnly(Side.CLIENT) + BiomeGenBase getBiomeGenForCoords(int x, int z); + + /** + * Returns current world height. + */ + @SideOnly(Side.CLIENT) + int getHeight(); + + /** + * set by !chunk.getAreLevelsEmpty + */ + @SideOnly(Side.CLIENT) + boolean extendedLevelsInChunkCache(); + + /** + * FORGE: isSideSolid, pulled up from {@link World} + * + * @param x X coord + * @param y Y coord + * @param z Z coord + * @param side Side + * @param _default default return value + * @return if the block is solid on the side + */ + boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/IWorldAccess.java b/build/rfg/minecraft-src/java/net/minecraft/world/IWorldAccess.java new file mode 100644 index 0000000..40e4c25 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/IWorldAccess.java @@ -0,0 +1,71 @@ +package net.minecraft.world; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +public interface IWorldAccess +{ + /** + * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_); + + /** + * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_); + + /** + * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_); + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + void playSound(String soundName, double x, double y, double z, float volume, float pitch); + + /** + * Plays sound to all near players except the player reference given + */ + void playSoundToNearExcept(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_); + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + void spawnParticle(String p_72708_1_, double p_72708_2_, double p_72708_4_, double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_); + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + void onEntityCreate(Entity p_72703_1_); + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + void onEntityDestroy(Entity p_72709_1_); + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_); + + void broadcastSound(int p_82746_1_, int p_82746_2_, int p_82746_3_, int p_82746_4_, int p_82746_5_); + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_); + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_); + + void onStaticEntitiesChanged(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/MinecraftException.java b/build/rfg/minecraft-src/java/net/minecraft/world/MinecraftException.java new file mode 100644 index 0000000..4b593b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/MinecraftException.java @@ -0,0 +1,11 @@ +package net.minecraft.world; + +public class MinecraftException extends Exception +{ + private static final String __OBFID = "CL_00000145"; + + public MinecraftException(String p_i1955_1_) + { + super(p_i1955_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/NextTickListEntry.java b/build/rfg/minecraft-src/java/net/minecraft/world/NextTickListEntry.java new file mode 100644 index 0000000..cc7fc1f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/NextTickListEntry.java @@ -0,0 +1,83 @@ +package net.minecraft.world; + +import net.minecraft.block.Block; + +public class NextTickListEntry implements Comparable +{ + /** The id number for the next tick entry */ + private static long nextTickEntryID; + private final Block field_151352_g; + /** X position this tick is occuring at */ + public int xCoord; + /** Y position this tick is occuring at */ + public int yCoord; + /** Z position this tick is occuring at */ + public int zCoord; + /** Time this tick is scheduled to occur at */ + public long scheduledTime; + public int priority; + /** The id of the tick entry */ + private long tickEntryID; + private static final String __OBFID = "CL_00000156"; + + public NextTickListEntry(int p_i45370_1_, int p_i45370_2_, int p_i45370_3_, Block p_i45370_4_) + { + this.tickEntryID = (long)(nextTickEntryID++); + this.xCoord = p_i45370_1_; + this.yCoord = p_i45370_2_; + this.zCoord = p_i45370_3_; + this.field_151352_g = p_i45370_4_; + } + + public boolean equals(Object p_equals_1_) + { + if (!(p_equals_1_ instanceof NextTickListEntry)) + { + return false; + } + else + { + NextTickListEntry nextticklistentry = (NextTickListEntry)p_equals_1_; + return this.xCoord == nextticklistentry.xCoord && this.yCoord == nextticklistentry.yCoord && this.zCoord == nextticklistentry.zCoord && Block.isEqualTo(this.field_151352_g, nextticklistentry.field_151352_g); + } + } + + public int hashCode() + { + return (this.xCoord * 1024 * 1024 + this.zCoord * 1024 + this.yCoord) * 256; + } + + /** + * Sets the scheduled time for this tick entry + */ + public NextTickListEntry setScheduledTime(long p_77176_1_) + { + this.scheduledTime = p_77176_1_; + return this; + } + + public void setPriority(int p_82753_1_) + { + this.priority = p_82753_1_; + } + + public int compareTo(NextTickListEntry p_compareTo_1_) + { + return this.scheduledTime < p_compareTo_1_.scheduledTime ? -1 : (this.scheduledTime > p_compareTo_1_.scheduledTime ? 1 : (this.priority != p_compareTo_1_.priority ? this.priority - p_compareTo_1_.priority : (this.tickEntryID < p_compareTo_1_.tickEntryID ? -1 : (this.tickEntryID > p_compareTo_1_.tickEntryID ? 1 : 0)))); + } + + public String toString() + { + return Block.getIdFromBlock(this.field_151352_g) + ": (" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + "), " + this.scheduledTime + ", " + this.priority + ", " + this.tickEntryID; + } + + public Block func_151351_a() + { + return this.field_151352_g; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((NextTickListEntry)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/SpawnerAnimals.java b/build/rfg/minecraft-src/java/net/minecraft/world/SpawnerAnimals.java new file mode 100644 index 0000000..096b6ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/SpawnerAnimals.java @@ -0,0 +1,296 @@ +package net.minecraft.world; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +import cpw.mods.fml.common.eventhandler.Event.Result; +import net.minecraftforge.event.ForgeEventFactory; + +public final class SpawnerAnimals +{ + /** The 17x17 area around the player where mobs can spawn */ + private HashMap eligibleChunksForSpawning = new HashMap(); + private static final String __OBFID = "CL_00000152"; + + protected static ChunkPosition func_151350_a(World p_151350_0_, int p_151350_1_, int p_151350_2_) + { + Chunk chunk = p_151350_0_.getChunkFromChunkCoords(p_151350_1_, p_151350_2_); + int k = p_151350_1_ * 16 + p_151350_0_.rand.nextInt(16); + int l = p_151350_2_ * 16 + p_151350_0_.rand.nextInt(16); + int i1 = p_151350_0_.rand.nextInt(chunk == null ? p_151350_0_.getActualHeight() : chunk.getTopFilledSegment() + 16 - 1); + return new ChunkPosition(k, i1, l); + } + + /** + * adds all chunks within the spawn radius of the players to eligibleChunksForSpawning. pars: the world, + * hostileCreatures, passiveCreatures. returns number of eligible chunks. + */ + public int findChunksForSpawning(WorldServer p_77192_1_, boolean p_77192_2_, boolean p_77192_3_, boolean p_77192_4_) + { + if (!p_77192_2_ && !p_77192_3_) + { + return 0; + } + else + { + this.eligibleChunksForSpawning.clear(); + int i; + int k; + + for (i = 0; i < p_77192_1_.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)p_77192_1_.playerEntities.get(i); + int j = MathHelper.floor_double(entityplayer.posX / 16.0D); + k = MathHelper.floor_double(entityplayer.posZ / 16.0D); + byte b0 = 8; + + for (int l = -b0; l <= b0; ++l) + { + for (int i1 = -b0; i1 <= b0; ++i1) + { + boolean flag3 = l == -b0 || l == b0 || i1 == -b0 || i1 == b0; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(l + j, i1 + k); + + if (!flag3) + { + this.eligibleChunksForSpawning.put(chunkcoordintpair, Boolean.valueOf(false)); + } + else if (!this.eligibleChunksForSpawning.containsKey(chunkcoordintpair)) + { + this.eligibleChunksForSpawning.put(chunkcoordintpair, Boolean.valueOf(true)); + } + } + } + } + + i = 0; + ChunkCoordinates chunkcoordinates = p_77192_1_.getSpawnPoint(); + EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); + k = aenumcreaturetype.length; + + for (int k3 = 0; k3 < k; ++k3) + { + EnumCreatureType enumcreaturetype = aenumcreaturetype[k3]; + + if ((!enumcreaturetype.getPeacefulCreature() || p_77192_3_) && (enumcreaturetype.getPeacefulCreature() || p_77192_2_) && (!enumcreaturetype.getAnimal() || p_77192_4_) && p_77192_1_.countEntities(enumcreaturetype, true) <= enumcreaturetype.getMaxNumberOfCreature() * this.eligibleChunksForSpawning.size() / 256) + { + Iterator iterator = this.eligibleChunksForSpawning.keySet().iterator(); + ArrayList tmp = new ArrayList(eligibleChunksForSpawning.keySet()); + Collections.shuffle(tmp); + iterator = tmp.iterator(); + label110: + + while (iterator.hasNext()) + { + ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair)iterator.next(); + + if (!((Boolean)this.eligibleChunksForSpawning.get(chunkcoordintpair1)).booleanValue()) + { + ChunkPosition chunkposition = func_151350_a(p_77192_1_, chunkcoordintpair1.chunkXPos, chunkcoordintpair1.chunkZPos); + int j1 = chunkposition.chunkPosX; + int k1 = chunkposition.chunkPosY; + int l1 = chunkposition.chunkPosZ; + + if (!p_77192_1_.getBlock(j1, k1, l1).isNormalCube() && p_77192_1_.getBlock(j1, k1, l1).getMaterial() == enumcreaturetype.getCreatureMaterial()) + { + int i2 = 0; + int j2 = 0; + + while (j2 < 3) + { + int k2 = j1; + int l2 = k1; + int i3 = l1; + byte b1 = 6; + BiomeGenBase.SpawnListEntry spawnlistentry = null; + IEntityLivingData ientitylivingdata = null; + int j3 = 0; + + while (true) + { + if (j3 < 4) + { + label103: + { + k2 += p_77192_1_.rand.nextInt(b1) - p_77192_1_.rand.nextInt(b1); + l2 += p_77192_1_.rand.nextInt(1) - p_77192_1_.rand.nextInt(1); + i3 += p_77192_1_.rand.nextInt(b1) - p_77192_1_.rand.nextInt(b1); + + if (canCreatureTypeSpawnAtLocation(enumcreaturetype, p_77192_1_, k2, l2, i3)) + { + float f = (float)k2 + 0.5F; + float f1 = (float)l2; + float f2 = (float)i3 + 0.5F; + + if (p_77192_1_.getClosestPlayer((double)f, (double)f1, (double)f2, 24.0D) == null) + { + float f3 = f - (float)chunkcoordinates.posX; + float f4 = f1 - (float)chunkcoordinates.posY; + float f5 = f2 - (float)chunkcoordinates.posZ; + float f6 = f3 * f3 + f4 * f4 + f5 * f5; + + if (f6 >= 576.0F) + { + if (spawnlistentry == null) + { + spawnlistentry = p_77192_1_.spawnRandomCreature(enumcreaturetype, k2, l2, i3); + + if (spawnlistentry == null) + { + break label103; + } + } + + EntityLiving entityliving; + + try + { + entityliving = (EntityLiving)spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_77192_1_}); + } + catch (Exception exception) + { + exception.printStackTrace(); + return i; + } + + entityliving.setLocationAndAngles((double)f, (double)f1, (double)f2, p_77192_1_.rand.nextFloat() * 360.0F, 0.0F); + + Result canSpawn = ForgeEventFactory.canEntitySpawn(entityliving, p_77192_1_, f, f1, f2); + if (canSpawn == Result.ALLOW || (canSpawn == Result.DEFAULT && entityliving.getCanSpawnHere())) + { + ++i2; + p_77192_1_.spawnEntityInWorld(entityliving); + if (!ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, f1, f2)) + { + ientitylivingdata = entityliving.onSpawnWithEgg(ientitylivingdata); + } + + if (j2 >= ForgeEventFactory.getMaxSpawnPackSize(entityliving)) + { + continue label110; + } + } + + i += i2; + } + } + } + + ++j3; + continue; + } + } + + ++j2; + break; + } + } + } + } + } + } + } + + return i; + } + } + + /** + * Returns whether or not the specified creature type can spawn at the specified location. + */ + public static boolean canCreatureTypeSpawnAtLocation(EnumCreatureType p_77190_0_, World p_77190_1_, int p_77190_2_, int p_77190_3_, int p_77190_4_) + { + if (p_77190_0_.getCreatureMaterial() == Material.water) + { + return p_77190_1_.getBlock(p_77190_2_, p_77190_3_, p_77190_4_).getMaterial().isLiquid() && p_77190_1_.getBlock(p_77190_2_, p_77190_3_ - 1, p_77190_4_).getMaterial().isLiquid() && !p_77190_1_.getBlock(p_77190_2_, p_77190_3_ + 1, p_77190_4_).isNormalCube(); + } + else if (!World.doesBlockHaveSolidTopSurface(p_77190_1_, p_77190_2_, p_77190_3_ - 1, p_77190_4_)) + { + return false; + } + else + { + Block block = p_77190_1_.getBlock(p_77190_2_, p_77190_3_ - 1, p_77190_4_); + boolean spawnBlock = block.canCreatureSpawn(p_77190_0_, p_77190_1_, p_77190_2_, p_77190_3_ - 1, p_77190_4_); + return spawnBlock && block != Blocks.bedrock && !p_77190_1_.getBlock(p_77190_2_, p_77190_3_, p_77190_4_).isNormalCube() && !p_77190_1_.getBlock(p_77190_2_, p_77190_3_, p_77190_4_).getMaterial().isLiquid() && !p_77190_1_.getBlock(p_77190_2_, p_77190_3_ + 1, p_77190_4_).isNormalCube(); + } + } + + /** + * Called during chunk generation to spawn initial creatures. + */ + public static void performWorldGenSpawning(World p_77191_0_, BiomeGenBase p_77191_1_, int p_77191_2_, int p_77191_3_, int p_77191_4_, int p_77191_5_, Random p_77191_6_) + { + List list = p_77191_1_.getSpawnableList(EnumCreatureType.creature); + + if (!list.isEmpty()) + { + while (p_77191_6_.nextFloat() < p_77191_1_.getSpawningChance()) + { + BiomeGenBase.SpawnListEntry spawnlistentry = (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(p_77191_0_.rand, list); + IEntityLivingData ientitylivingdata = null; + int i1 = spawnlistentry.minGroupCount + p_77191_6_.nextInt(1 + spawnlistentry.maxGroupCount - spawnlistentry.minGroupCount); + int j1 = p_77191_2_ + p_77191_6_.nextInt(p_77191_4_); + int k1 = p_77191_3_ + p_77191_6_.nextInt(p_77191_5_); + int l1 = j1; + int i2 = k1; + + for (int j2 = 0; j2 < i1; ++j2) + { + boolean flag = false; + + for (int k2 = 0; !flag && k2 < 4; ++k2) + { + int l2 = p_77191_0_.getTopSolidOrLiquidBlock(j1, k1); + + if (canCreatureTypeSpawnAtLocation(EnumCreatureType.creature, p_77191_0_, j1, l2, k1)) + { + float f = (float)j1 + 0.5F; + float f1 = (float)l2; + float f2 = (float)k1 + 0.5F; + EntityLiving entityliving; + + try + { + entityliving = (EntityLiving)spawnlistentry.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {p_77191_0_}); + } + catch (Exception exception) + { + exception.printStackTrace(); + continue; + } + + entityliving.setLocationAndAngles((double)f, (double)f1, (double)f2, p_77191_6_.nextFloat() * 360.0F, 0.0F); + p_77191_0_.spawnEntityInWorld(entityliving); + ientitylivingdata = entityliving.onSpawnWithEgg(ientitylivingdata); + flag = true; + } + + j1 += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); + + for (k1 += p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); j1 < p_77191_2_ || j1 >= p_77191_2_ + p_77191_4_ || k1 < p_77191_3_ || k1 >= p_77191_3_ + p_77191_4_; k1 = i2 + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5)) + { + j1 = l1 + p_77191_6_.nextInt(5) - p_77191_6_.nextInt(5); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/Teleporter.java b/build/rfg/minecraft-src/java/net/minecraft/world/Teleporter.java new file mode 100644 index 0000000..e6d7dbc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/Teleporter.java @@ -0,0 +1,523 @@ +package net.minecraft.world; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.MathHelper; + +public class Teleporter +{ + private final WorldServer worldServerInstance; + /** A private Random() function in Teleporter */ + private final Random random; + /** Stores successful portal placement locations for rapid lookup. */ + private final LongHashMap destinationCoordinateCache = new LongHashMap(); + /** + * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial + * location. + */ + private final List destinationCoordinateKeys = new ArrayList(); + private static final String __OBFID = "CL_00000153"; + + public Teleporter(WorldServer worldIn) + { + this.worldServerInstance = worldIn; + this.random = new Random(worldIn.getSeed()); + } + + /** + * Place an entity in a nearby portal, creating one if necessary. + */ + public void placeInPortal(Entity p_77185_1_, double p_77185_2_, double p_77185_4_, double p_77185_6_, float p_77185_8_) + { + if (this.worldServerInstance.provider.dimensionId != 1) + { + if (!this.placeInExistingPortal(p_77185_1_, p_77185_2_, p_77185_4_, p_77185_6_, p_77185_8_)) + { + this.makePortal(p_77185_1_); + this.placeInExistingPortal(p_77185_1_, p_77185_2_, p_77185_4_, p_77185_6_, p_77185_8_); + } + } + else + { + int i = MathHelper.floor_double(p_77185_1_.posX); + int j = MathHelper.floor_double(p_77185_1_.posY) - 1; + int k = MathHelper.floor_double(p_77185_1_.posZ); + byte b0 = 1; + byte b1 = 0; + + for (int l = -2; l <= 2; ++l) + { + for (int i1 = -2; i1 <= 2; ++i1) + { + for (int j1 = -1; j1 < 3; ++j1) + { + int k1 = i + i1 * b0 + l * b1; + int l1 = j + j1; + int i2 = k + i1 * b1 - l * b0; + boolean flag = j1 < 0; + this.worldServerInstance.setBlock(k1, l1, i2, flag ? Blocks.obsidian : Blocks.air); + } + } + } + + p_77185_1_.setLocationAndAngles((double)i, (double)j, (double)k, p_77185_1_.rotationYaw, 0.0F); + p_77185_1_.motionX = p_77185_1_.motionY = p_77185_1_.motionZ = 0.0D; + } + } + + /** + * Place an entity in a nearby portal which already exists. + */ + public boolean placeInExistingPortal(Entity p_77184_1_, double p_77184_2_, double p_77184_4_, double p_77184_6_, float p_77184_8_) + { + short short1 = 128; + double d3 = -1.0D; + int i = 0; + int j = 0; + int k = 0; + int l = MathHelper.floor_double(p_77184_1_.posX); + int i1 = MathHelper.floor_double(p_77184_1_.posZ); + long j1 = ChunkCoordIntPair.chunkXZ2Int(l, i1); + boolean flag = true; + double d7; + int l3; + + if (this.destinationCoordinateCache.containsItem(j1)) + { + Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(j1); + d3 = 0.0D; + i = portalposition.posX; + j = portalposition.posY; + k = portalposition.posZ; + portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime(); + flag = false; + } + else + { + for (l3 = l - short1; l3 <= l + short1; ++l3) + { + double d4 = (double)l3 + 0.5D - p_77184_1_.posX; + + for (int l1 = i1 - short1; l1 <= i1 + short1; ++l1) + { + double d5 = (double)l1 + 0.5D - p_77184_1_.posZ; + + for (int i2 = this.worldServerInstance.getActualHeight() - 1; i2 >= 0; --i2) + { + if (this.worldServerInstance.getBlock(l3, i2, l1) == Blocks.portal) + { + while (this.worldServerInstance.getBlock(l3, i2 - 1, l1) == Blocks.portal) + { + --i2; + } + + d7 = (double)i2 + 0.5D - p_77184_1_.posY; + double d8 = d4 * d4 + d7 * d7 + d5 * d5; + + if (d3 < 0.0D || d8 < d3) + { + d3 = d8; + i = l3; + j = i2; + k = l1; + } + } + } + } + } + } + + if (d3 >= 0.0D) + { + if (flag) + { + this.destinationCoordinateCache.add(j1, new Teleporter.PortalPosition(i, j, k, this.worldServerInstance.getTotalWorldTime())); + this.destinationCoordinateKeys.add(Long.valueOf(j1)); + } + + double d11 = (double)i + 0.5D; + double d6 = (double)j + 0.5D; + d7 = (double)k + 0.5D; + int i4 = -1; + + if (this.worldServerInstance.getBlock(i - 1, j, k) == Blocks.portal) + { + i4 = 2; + } + + if (this.worldServerInstance.getBlock(i + 1, j, k) == Blocks.portal) + { + i4 = 0; + } + + if (this.worldServerInstance.getBlock(i, j, k - 1) == Blocks.portal) + { + i4 = 3; + } + + if (this.worldServerInstance.getBlock(i, j, k + 1) == Blocks.portal) + { + i4 = 1; + } + + int j2 = p_77184_1_.getTeleportDirection(); + + if (i4 > -1) + { + int k2 = Direction.rotateLeft[i4]; + int l2 = Direction.offsetX[i4]; + int i3 = Direction.offsetZ[i4]; + int j3 = Direction.offsetX[k2]; + int k3 = Direction.offsetZ[k2]; + boolean flag1 = !this.worldServerInstance.isAirBlock(i + l2 + j3, j, k + i3 + k3) || !this.worldServerInstance.isAirBlock(i + l2 + j3, j + 1, k + i3 + k3); + boolean flag2 = !this.worldServerInstance.isAirBlock(i + l2, j, k + i3) || !this.worldServerInstance.isAirBlock(i + l2, j + 1, k + i3); + + if (flag1 && flag2) + { + i4 = Direction.rotateOpposite[i4]; + k2 = Direction.rotateOpposite[k2]; + l2 = Direction.offsetX[i4]; + i3 = Direction.offsetZ[i4]; + j3 = Direction.offsetX[k2]; + k3 = Direction.offsetZ[k2]; + l3 = i - j3; + d11 -= (double)j3; + int k1 = k - k3; + d7 -= (double)k3; + flag1 = !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j, k1 + i3 + k3) || !this.worldServerInstance.isAirBlock(l3 + l2 + j3, j + 1, k1 + i3 + k3); + flag2 = !this.worldServerInstance.isAirBlock(l3 + l2, j, k1 + i3) || !this.worldServerInstance.isAirBlock(l3 + l2, j + 1, k1 + i3); + } + + float f1 = 0.5F; + float f2 = 0.5F; + + if (!flag1 && flag2) + { + f1 = 1.0F; + } + else if (flag1 && !flag2) + { + f1 = 0.0F; + } + else if (flag1 && flag2) + { + f2 = 0.0F; + } + + d11 += (double)((float)j3 * f1 + f2 * (float)l2); + d7 += (double)((float)k3 * f1 + f2 * (float)i3); + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; + + if (i4 == j2) + { + f3 = 1.0F; + f4 = 1.0F; + } + else if (i4 == Direction.rotateOpposite[j2]) + { + f3 = -1.0F; + f4 = -1.0F; + } + else if (i4 == Direction.rotateRight[j2]) + { + f5 = 1.0F; + f6 = -1.0F; + } + else + { + f5 = -1.0F; + f6 = 1.0F; + } + + double d9 = p_77184_1_.motionX; + double d10 = p_77184_1_.motionZ; + p_77184_1_.motionX = d9 * (double)f3 + d10 * (double)f6; + p_77184_1_.motionZ = d9 * (double)f5 + d10 * (double)f4; + p_77184_1_.rotationYaw = p_77184_8_ - (float)(j2 * 90) + (float)(i4 * 90); + } + else + { + p_77184_1_.motionX = p_77184_1_.motionY = p_77184_1_.motionZ = 0.0D; + } + + p_77184_1_.setLocationAndAngles(d11, d6, d7, p_77184_1_.rotationYaw, p_77184_1_.rotationPitch); + return true; + } + else + { + return false; + } + } + + public boolean makePortal(Entity p_85188_1_) + { + byte b0 = 16; + double d0 = -1.0D; + int i = MathHelper.floor_double(p_85188_1_.posX); + int j = MathHelper.floor_double(p_85188_1_.posY); + int k = MathHelper.floor_double(p_85188_1_.posZ); + int l = i; + int i1 = j; + int j1 = k; + int k1 = 0; + int l1 = this.random.nextInt(4); + int i2; + double d1; + int k2; + double d2; + int i3; + int j3; + int k3; + int l3; + int i4; + int j4; + int k4; + int l4; + int i5; + double d3; + double d4; + + for (i2 = i - b0; i2 <= i + b0; ++i2) + { + d1 = (double)i2 + 0.5D - p_85188_1_.posX; + + for (k2 = k - b0; k2 <= k + b0; ++k2) + { + d2 = (double)k2 + 0.5D - p_85188_1_.posZ; + label274: + + for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) + { + if (this.worldServerInstance.isAirBlock(i2, i3, k2)) + { + while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) + { + --i3; + } + + for (j3 = l1; j3 < l1 + 4; ++j3) + { + k3 = j3 % 2; + l3 = 1 - k3; + + if (j3 % 4 >= 2) + { + k3 = -k3; + l3 = -l3; + } + + for (i4 = 0; i4 < 3; ++i4) + { + for (j4 = 0; j4 < 4; ++j4) + { + for (k4 = -1; k4 < 4; ++k4) + { + l4 = i2 + (j4 - 1) * k3 + i4 * l3; + i5 = i3 + k4; + int j5 = k2 + (j4 - 1) * l3 - i4 * k3; + + if (k4 < 0 && !this.worldServerInstance.getBlock(l4, i5, j5).getMaterial().isSolid() || k4 >= 0 && !this.worldServerInstance.isAirBlock(l4, i5, j5)) + { + continue label274; + } + } + } + } + + d3 = (double)i3 + 0.5D - p_85188_1_.posY; + d4 = d1 * d1 + d3 * d3 + d2 * d2; + + if (d0 < 0.0D || d4 < d0) + { + d0 = d4; + l = i2; + i1 = i3; + j1 = k2; + k1 = j3 % 4; + } + } + } + } + } + } + + if (d0 < 0.0D) + { + for (i2 = i - b0; i2 <= i + b0; ++i2) + { + d1 = (double)i2 + 0.5D - p_85188_1_.posX; + + for (k2 = k - b0; k2 <= k + b0; ++k2) + { + d2 = (double)k2 + 0.5D - p_85188_1_.posZ; + label222: + + for (i3 = this.worldServerInstance.getActualHeight() - 1; i3 >= 0; --i3) + { + if (this.worldServerInstance.isAirBlock(i2, i3, k2)) + { + while (i3 > 0 && this.worldServerInstance.isAirBlock(i2, i3 - 1, k2)) + { + --i3; + } + + for (j3 = l1; j3 < l1 + 2; ++j3) + { + k3 = j3 % 2; + l3 = 1 - k3; + + for (i4 = 0; i4 < 4; ++i4) + { + for (j4 = -1; j4 < 4; ++j4) + { + k4 = i2 + (i4 - 1) * k3; + l4 = i3 + j4; + i5 = k2 + (i4 - 1) * l3; + + if (j4 < 0 && !this.worldServerInstance.getBlock(k4, l4, i5).getMaterial().isSolid() || j4 >= 0 && !this.worldServerInstance.isAirBlock(k4, l4, i5)) + { + continue label222; + } + } + } + + d3 = (double)i3 + 0.5D - p_85188_1_.posY; + d4 = d1 * d1 + d3 * d3 + d2 * d2; + + if (d0 < 0.0D || d4 < d0) + { + d0 = d4; + l = i2; + i1 = i3; + j1 = k2; + k1 = j3 % 2; + } + } + } + } + } + } + } + + int k5 = l; + int j2 = i1; + k2 = j1; + int l5 = k1 % 2; + int l2 = 1 - l5; + + if (k1 % 4 >= 2) + { + l5 = -l5; + l2 = -l2; + } + + boolean flag; + + if (d0 < 0.0D) + { + if (i1 < 70) + { + i1 = 70; + } + + if (i1 > this.worldServerInstance.getActualHeight() - 10) + { + i1 = this.worldServerInstance.getActualHeight() - 10; + } + + j2 = i1; + + for (i3 = -1; i3 <= 1; ++i3) + { + for (j3 = 1; j3 < 3; ++j3) + { + for (k3 = -1; k3 < 3; ++k3) + { + l3 = k5 + (j3 - 1) * l5 + i3 * l2; + i4 = j2 + k3; + j4 = k2 + (j3 - 1) * l2 - i3 * l5; + flag = k3 < 0; + this.worldServerInstance.setBlock(l3, i4, j4, flag ? Blocks.obsidian : Blocks.air); + } + } + } + } + + for (i3 = 0; i3 < 4; ++i3) + { + for (j3 = 0; j3 < 4; ++j3) + { + for (k3 = -1; k3 < 4; ++k3) + { + l3 = k5 + (j3 - 1) * l5; + i4 = j2 + k3; + j4 = k2 + (j3 - 1) * l2; + flag = j3 == 0 || j3 == 3 || k3 == -1 || k3 == 3; + this.worldServerInstance.setBlock(l3, i4, j4, (Block)(flag ? Blocks.obsidian : Blocks.portal), 0, 2); + } + } + + for (j3 = 0; j3 < 4; ++j3) + { + for (k3 = -1; k3 < 4; ++k3) + { + l3 = k5 + (j3 - 1) * l5; + i4 = j2 + k3; + j4 = k2 + (j3 - 1) * l2; + this.worldServerInstance.notifyBlocksOfNeighborChange(l3, i4, j4, this.worldServerInstance.getBlock(l3, i4, j4)); + } + } + } + + return true; + } + + /** + * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a + * WorldServer.getTotalWorldTime() value. + */ + public void removeStalePortalLocations(long p_85189_1_) + { + if (p_85189_1_ % 100L == 0L) + { + Iterator iterator = this.destinationCoordinateKeys.iterator(); + long j = p_85189_1_ - 600L; + + while (iterator.hasNext()) + { + Long olong = (Long)iterator.next(); + Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(olong.longValue()); + + if (portalposition == null || portalposition.lastUpdateTime < j) + { + iterator.remove(); + this.destinationCoordinateCache.remove(olong.longValue()); + } + } + } + } + + public class PortalPosition extends ChunkCoordinates + { + /** The worldtime at which this PortalPosition was last verified */ + public long lastUpdateTime; + private static final String __OBFID = "CL_00000154"; + + public PortalPosition(int p_i1962_2_, int p_i1962_3_, int p_i1962_4_, long p_i1962_5_) + { + super(p_i1962_2_, p_i1962_3_, p_i1962_4_); + this.lastUpdateTime = p_i1962_5_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/World.java b/build/rfg/minecraft-src/java/net/minecraft/world/World.java new file mode 100644 index 0000000..c2a6996 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/World.java @@ -0,0 +1,4504 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockSnow; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.pathfinding.PathEntity; +import net.minecraft.pathfinding.PathFinder; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Direction; +import net.minecraft.util.Facing; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.village.VillageCollection; +import net.minecraft.village.VillageSiege; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.MapStorage; +import net.minecraft.world.storage.WorldInfo; + +import cpw.mods.fml.common.FMLLog; + +import com.google.common.collect.ImmutableSetMultimap; + +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.ForgeChunkManager.Ticket; +import net.minecraftforge.common.ForgeModContainer; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.common.WorldSpecificSaveHandler; +import net.minecraftforge.event.entity.EntityEvent; +import net.minecraftforge.event.entity.EntityJoinWorldEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.event.entity.PlaySoundAtEntityEvent; +import net.minecraft.entity.EnumCreatureType; + +public abstract class World implements IBlockAccess +{ + /** + * Used in the getEntitiesWithinAABB functions to expand the search area for entities. + * Modders should change this variable to a higher value if it is less then the radius + * of one of there entities. + */ + public static double MAX_ENTITY_RADIUS = 2.0D; + + public final MapStorage perWorldStorage; + + /** boolean; if true updates scheduled by scheduleBlockUpdate happen immediately */ + public boolean scheduledUpdatesAreImmediate; + /** A list of all Entities in all currently-loaded chunks */ + public List loadedEntityList = new ArrayList(); + protected List unloadedEntityList = new ArrayList(); + /** A list of the loaded tile entities in the world */ + public List loadedTileEntityList = new ArrayList(); + private List addedTileEntityList = new ArrayList(); + private List field_147483_b = new ArrayList(); + /** Array list of players in the world. */ + public List playerEntities = new ArrayList(); + /** a list of all the lightning entities */ + public List weatherEffects = new ArrayList(); + private long cloudColour = 16777215L; + /** How much light is subtracted from full daylight */ + public int skylightSubtracted; + /** + * Contains the current Linear Congruential Generator seed for block updates. Used with an A value of 3 and a C + * value of 0x3c6ef35f, producing a highly planar series of values ill-suited for choosing random blocks in a + * 16x128x16 field. + */ + protected int updateLCG = (new Random()).nextInt(); + /** magic number used to generate fast random numbers for 3d distribution within a chunk */ + protected final int DIST_HASH_MAGIC = 1013904223; + public float prevRainingStrength; + public float rainingStrength; + public float prevThunderingStrength; + public float thunderingStrength; + /** + * Set to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be + * unused. + */ + public int lastLightningBolt; + /** Option > Difficulty setting (0 - 3) */ + public EnumDifficulty difficultySetting; + /** RNG for World. */ + public Random rand = new Random(); + /** The WorldProvider instance that World uses. */ + public final WorldProvider provider; + protected List worldAccesses = new ArrayList(); + /** Handles chunk operations and caching */ + protected IChunkProvider chunkProvider; + protected final ISaveHandler saveHandler; + /** holds information about a world (size on disk, time, spawn point, seed, ...) */ + protected WorldInfo worldInfo; + /** Boolean that is set to true when trying to find a spawn point */ + public boolean findingSpawnPoint; + public MapStorage mapStorage; + public VillageCollection villageCollectionObj; + protected final VillageSiege villageSiegeObj = new VillageSiege(this); + public final Profiler theProfiler; + private final Calendar theCalendar = Calendar.getInstance(); + protected Scoreboard worldScoreboard = new Scoreboard(); + /** This is set to true for client worlds, and false for server worlds. */ + public boolean isRemote; + /** Positions to update */ + protected Set activeChunkSet = new HashSet(); + /** number of ticks until the next random ambients play */ + private int ambientTickCountdown; + /** indicates if enemies are spawned or not */ + protected boolean spawnHostileMobs; + /** A flag indicating whether we should spawn peaceful mobs. */ + protected boolean spawnPeacefulMobs; + private ArrayList collidingBoundingBoxes; + private boolean field_147481_N; + /** + * is a temporary list of blocks and light values used when updating light levels. Holds up to 32x32x32 blocks (the + * maximum influence of a light source.) Every element is a packed bit value: 0000000000LLLLzzzzzzyyyyyyxxxxxx. The + * 4-bit L is a light level used when darkening blocks. 6-bit numbers x, y and z represent the block's offset from + * the original block, plus 32 (i.e. value of 31 would mean a -1 offset + */ + int[] lightUpdateBlockList; + private static final String __OBFID = "CL_00000140"; + public boolean restoringBlockSnapshots = false; + public boolean captureBlockSnapshots = false; + public ArrayList capturedBlockSnapshots = new ArrayList(); + + /** + * Gets the biome for a given set of x/z coordinates + */ + public BiomeGenBase getBiomeGenForCoords(final int x, final int z) + { + return provider.getBiomeGenForCoords(x, z); + } + + public BiomeGenBase getBiomeGenForCoordsBody(final int x, final int z) + { + if (this.blockExists(x, 0, z)) + { + Chunk chunk = this.getChunkFromBlockCoords(x, z); + + try + { + return chunk.getBiomeGenForWorldCoords(x & 15, z & 15, this.provider.worldChunkMgr); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting biome"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Coordinates of biome request"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + private static final String __OBFID = "CL_00000141"; + public String call() + { + return CrashReportCategory.getLocationInfo(x, 0, z); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return this.provider.worldChunkMgr.getBiomeGenAt(x, z); + } + } + + public WorldChunkManager getWorldChunkManager() + { + return this.provider.worldChunkMgr; + } + + @SideOnly(Side.CLIENT) + public World(ISaveHandler p_i45368_1_, String p_i45368_2_, WorldProvider p_i45368_3_, WorldSettings p_i45368_4_, Profiler p_i45368_5_) + { + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.collidingBoundingBoxes = new ArrayList(); + this.lightUpdateBlockList = new int[32768]; + this.saveHandler = p_i45368_1_; + this.theProfiler = p_i45368_5_; + this.worldInfo = new WorldInfo(p_i45368_4_, p_i45368_2_); + this.provider = p_i45368_3_; + perWorldStorage = new MapStorage((ISaveHandler)null); + } + + // Broken up so that the WorldClient gets the chance to set the mapstorage object before the dimension initializes + @SideOnly(Side.CLIENT) + protected void finishSetup() + { + VillageCollection villagecollection = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); + + if (villagecollection == null) + { + this.villageCollectionObj = new VillageCollection(this); + this.mapStorage.setData("villages", this.villageCollectionObj); + } + else + { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.func_82566_a(this); + } + + // Guarantee the dimension ID was not reset by the provider + int providerDim = this.provider.dimensionId; + this.provider.registerWorld(this); + this.provider.dimensionId = providerDim; + this.chunkProvider = this.createChunkProvider(); + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + } + + public World(ISaveHandler p_i45369_1_, String p_i45369_2_, WorldSettings p_i45369_3_, WorldProvider p_i45369_4_, Profiler p_i45369_5_) + { + this.ambientTickCountdown = this.rand.nextInt(12000); + this.spawnHostileMobs = true; + this.spawnPeacefulMobs = true; + this.collidingBoundingBoxes = new ArrayList(); + this.lightUpdateBlockList = new int[32768]; + this.saveHandler = p_i45369_1_; + this.theProfiler = p_i45369_5_; + this.mapStorage = getMapStorage(p_i45369_1_); + this.worldInfo = p_i45369_1_.loadWorldInfo(); + + if (p_i45369_4_ != null) + { + this.provider = p_i45369_4_; + } + else if (this.worldInfo != null && this.worldInfo.getVanillaDimension() != 0) + { + this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getVanillaDimension()); + } + else + { + this.provider = WorldProvider.getProviderForDimension(0); + } + + if (this.worldInfo == null) + { + this.worldInfo = new WorldInfo(p_i45369_3_, p_i45369_2_); + } + else + { + this.worldInfo.setWorldName(p_i45369_2_); + } + + this.provider.registerWorld(this); + this.chunkProvider = this.createChunkProvider(); + + if (this instanceof WorldServer) + { + this.perWorldStorage = new MapStorage(new WorldSpecificSaveHandler((WorldServer)this, p_i45369_1_)); + } + else + { + this.perWorldStorage = new MapStorage((ISaveHandler)null); + } + + if (!this.worldInfo.isInitialized()) + { + try + { + this.initialize(p_i45369_3_); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception initializing level"); + + try + { + this.addWorldInfoToCrashReport(crashreport); + } + catch (Throwable throwable) + { + ; + } + + throw new ReportedException(crashreport); + } + + this.worldInfo.setServerInitialized(true); + } + + VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.loadData(VillageCollection.class, "villages"); + + if (villagecollection == null) + { + this.villageCollectionObj = new VillageCollection(this); + this.perWorldStorage.setData("villages", this.villageCollectionObj); + } + else + { + this.villageCollectionObj = villagecollection; + this.villageCollectionObj.func_82566_a(this); + } + + this.calculateInitialSkylight(); + this.calculateInitialWeather(); + } + + private static MapStorage s_mapStorage; + private static ISaveHandler s_savehandler; + //Provides a solution for different worlds getting different copies of the same data, potentially rewriting the data or causing race conditions/stale data + //Buildcraft has suffered from the issue this fixes. If you load the same data from two different worlds they can get two different copies of the same object, thus the last saved gets final say. + private MapStorage getMapStorage(ISaveHandler savehandler) + { + if (s_savehandler != savehandler || s_mapStorage == null) + { + s_mapStorage = new MapStorage(savehandler); + s_savehandler = savehandler; + } + return s_mapStorage; + } + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected abstract IChunkProvider createChunkProvider(); + + protected void initialize(WorldSettings p_72963_1_) + { + this.worldInfo.setServerInitialized(true); + } + + /** + * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. + */ + @SideOnly(Side.CLIENT) + public void setSpawnLocation() + { + this.setSpawnLocation(8, 64, 8); + } + + public Block getTopBlock(int x, int z) + { + int k; + + for (k = 63; !this.isAirBlock(x, k + 1, z); ++k) + { + ; + } + + return this.getBlock(x, k, z); + } + + public Block getBlock(int p_147439_1_, int p_147439_2_, int p_147439_3_) + { + if (p_147439_1_ >= -30000000 && p_147439_3_ >= -30000000 && p_147439_1_ < 30000000 && p_147439_3_ < 30000000 && p_147439_2_ >= 0 && p_147439_2_ < 256) + { + Chunk chunk = null; + + try + { + chunk = this.getChunkFromChunkCoords(p_147439_1_ >> 4, p_147439_3_ >> 4); + return chunk.getBlock(p_147439_1_ & 15, p_147439_2_, p_147439_3_ & 15); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception getting block type in world"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Requested block coordinates"); + crashreportcategory.addCrashSection("Found chunk", Boolean.valueOf(chunk == null)); + crashreportcategory.addCrashSection("Location", CrashReportCategory.getLocationInfo(p_147439_1_, p_147439_2_, p_147439_3_)); + throw new ReportedException(crashreport); + } + } + else + { + return Blocks.air; + } + } + + /** + * Returns true if the block at the specified coordinates is empty + */ + public boolean isAirBlock(int x, int y, int z) + { + Block block = this.getBlock(x, y, z); + return block.isAir(this, x, y, z); + } + + /** + * Returns whether a block exists at world coordinates x, y, z + */ + public boolean blockExists(int p_72899_1_, int p_72899_2_, int p_72899_3_) + { + return p_72899_2_ >= 0 && p_72899_2_ < 256 ? this.chunkExists(p_72899_1_ >> 4, p_72899_3_ >> 4) : false; + } + + /** + * Checks if any of the chunks within distance (argument 4) blocks of the given block exist + */ + public boolean doChunksNearChunkExist(int p_72873_1_, int p_72873_2_, int p_72873_3_, int p_72873_4_) + { + return this.checkChunksExist(p_72873_1_ - p_72873_4_, p_72873_2_ - p_72873_4_, p_72873_3_ - p_72873_4_, p_72873_1_ + p_72873_4_, p_72873_2_ + p_72873_4_, p_72873_3_ + p_72873_4_); + } + + /** + * Checks between a min and max all the chunks inbetween actually exist. Args: minX, minY, minZ, maxX, maxY, maxZ + */ + public boolean checkChunksExist(int p_72904_1_, int p_72904_2_, int p_72904_3_, int p_72904_4_, int p_72904_5_, int p_72904_6_) + { + if (p_72904_5_ >= 0 && p_72904_2_ < 256) + { + p_72904_1_ >>= 4; + p_72904_3_ >>= 4; + p_72904_4_ >>= 4; + p_72904_6_ >>= 4; + + for (int k1 = p_72904_1_; k1 <= p_72904_4_; ++k1) + { + for (int l1 = p_72904_3_; l1 <= p_72904_6_; ++l1) + { + if (!this.chunkExists(k1, l1)) + { + return false; + } + } + } + + return true; + } + else + { + return false; + } + } + + /** + * Returns whether a chunk exists at chunk coordinates x, y + */ + protected boolean chunkExists(int p_72916_1_, int p_72916_2_) + { + return this.chunkProvider.chunkExists(p_72916_1_, p_72916_2_); + } + + /** + * Returns a chunk looked up by block coordinates. Args: x, z + */ + public Chunk getChunkFromBlockCoords(int p_72938_1_, int p_72938_2_) + { + return this.getChunkFromChunkCoords(p_72938_1_ >> 4, p_72938_2_ >> 4); + } + + /** + * Returns back a chunk looked up by chunk coordinates Args: x, y + */ + public Chunk getChunkFromChunkCoords(int p_72964_1_, int p_72964_2_) + { + return this.chunkProvider.provideChunk(p_72964_1_, p_72964_2_); + } + + /** + * Sets the block ID and metadata at a given location. Args: X, Y, Z, new block ID, new metadata, flags. Flag 1 will + * cause a block update. Flag 2 will send the change to clients (you almost always want this). Flag 4 prevents the + * block from being re-rendered, if this is a client world. Flags can be added together. + */ + public boolean setBlock(int x, int y, int z, Block blockIn, int metadataIn, int flags) + { + if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) + { + if (y < 0) + { + return false; + } + else if (y >= 256) + { + return false; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(x >> 4, z >> 4); + Block block1 = null; + net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; + + if ((flags & 1) != 0) + { + block1 = chunk.getBlock(x & 15, y, z & 15); + } + + if (this.captureBlockSnapshots && !this.isRemote) + { + blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, x, y, z, flags); + this.capturedBlockSnapshots.add(blockSnapshot); + } + + boolean flag = chunk.func_150807_a(x & 15, y, z & 15, blockIn, metadataIn); + + if (!flag && blockSnapshot != null) + { + this.capturedBlockSnapshots.remove(blockSnapshot); + blockSnapshot = null; + } + + this.theProfiler.startSection("checkLight"); + this.func_147451_t(x, y, z); + this.theProfiler.endSection(); + + if (flag && blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates + { + // Modularize client and physic updates + this.markAndNotifyBlock(x, y, z, chunk, block1, blockIn, flags); + } + + return flag; + } + } + else + { + return false; + } + } + + // Split off from original setBlock(int x, int y, int z, Block blockIn, int metadataIn, int flags) method in order to directly send client and physic updates + public void markAndNotifyBlock(int x, int y, int z, Chunk chunk, Block oldBlock, Block newBlock, int flag) + { + if ((flag & 2) != 0 && (chunk == null || chunk.func_150802_k())) + { + this.markBlockForUpdate(x, y, z); + } + + if (!this.isRemote && (flag & 1) != 0) + { + this.notifyBlockChange(x, y, z, oldBlock); + + if (newBlock.hasComparatorInputOverride()) + { + this.func_147453_f(x, y, z, newBlock); + } + } + } + + /** + * Returns the block metadata at coords x,y,z + */ + public int getBlockMetadata(int p_72805_1_, int p_72805_2_, int p_72805_3_) + { + if (p_72805_1_ >= -30000000 && p_72805_3_ >= -30000000 && p_72805_1_ < 30000000 && p_72805_3_ < 30000000) + { + if (p_72805_2_ < 0) + { + return 0; + } + else if (p_72805_2_ >= 256) + { + return 0; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(p_72805_1_ >> 4, p_72805_3_ >> 4); + p_72805_1_ &= 15; + p_72805_3_ &= 15; + return chunk.getBlockMetadata(p_72805_1_, p_72805_2_, p_72805_3_); + } + } + else + { + return 0; + } + } + + /** + * Sets the blocks metadata and if set will then notify blocks that this block changed, depending on the flag. Args: + * x, y, z, metadata, flag. See setBlock for flag description + */ + public boolean setBlockMetadataWithNotify(int p_72921_1_, int p_72921_2_, int p_72921_3_, int p_72921_4_, int p_72921_5_) + { + if (p_72921_1_ >= -30000000 && p_72921_3_ >= -30000000 && p_72921_1_ < 30000000 && p_72921_3_ < 30000000) + { + if (p_72921_2_ < 0) + { + return false; + } + else if (p_72921_2_ >= 256) + { + return false; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(p_72921_1_ >> 4, p_72921_3_ >> 4); + int j1 = p_72921_1_ & 15; + int k1 = p_72921_3_ & 15; + boolean flag = chunk.setBlockMetadata(j1, p_72921_2_, k1, p_72921_4_); + + if (flag) + { + Block block = chunk.getBlock(j1, p_72921_2_, k1); + + if ((p_72921_5_ & 2) != 0 && (!this.isRemote || (p_72921_5_ & 4) == 0) && chunk.func_150802_k()) + { + this.markBlockForUpdate(p_72921_1_, p_72921_2_, p_72921_3_); + } + + if (!this.isRemote && (p_72921_5_ & 1) != 0) + { + this.notifyBlockChange(p_72921_1_, p_72921_2_, p_72921_3_, block); + + if (block.hasComparatorInputOverride()) + { + this.func_147453_f(p_72921_1_, p_72921_2_, p_72921_3_, block); + } + } + } + + return flag; + } + } + else + { + return false; + } + } + + /** + * Sets a block to 0 and notifies relevant systems with the block change Args: x, y, z + */ + public boolean setBlockToAir(int x, int y, int z) + { + return this.setBlock(x, y, z, Blocks.air, 0, 3); + } + + public boolean func_147480_a(int x, int y, int z, boolean dropBlock) + { + Block block = this.getBlock(x, y, z); + + if (block.getMaterial() == Material.air) + { + return false; + } + else + { + int l = this.getBlockMetadata(x, y, z); + this.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (l << 12)); + + if (dropBlock) + { + block.dropBlockAsItem(this, x, y, z, l, 0); + } + + return this.setBlock(x, y, z, Blocks.air, 0, 3); + } + } + + /** + * Sets a block by a coordinate + */ + public boolean setBlock(int x, int y, int z, Block blockType) + { + return this.setBlock(x, y, z, blockType, 0, 3); + } + + public void markBlockForUpdate(int p_147471_1_, int p_147471_2_, int p_147471_3_) + { + for (int l = 0; l < this.worldAccesses.size(); ++l) + { + ((IWorldAccess)this.worldAccesses.get(l)).markBlockForUpdate(p_147471_1_, p_147471_2_, p_147471_3_); + } + } + + /** + * The block type change and need to notify other systems Args: x, y, z, blockID + */ + public void notifyBlockChange(int p_147444_1_, int p_147444_2_, int p_147444_3_, Block p_147444_4_) + { + this.notifyBlocksOfNeighborChange(p_147444_1_, p_147444_2_, p_147444_3_, p_147444_4_); + } + + /** + * marks a vertical line of blocks as dirty + */ + public void markBlocksDirtyVertical(int p_72975_1_, int p_72975_2_, int p_72975_3_, int p_72975_4_) + { + int i1; + + if (p_72975_3_ > p_72975_4_) + { + i1 = p_72975_4_; + p_72975_4_ = p_72975_3_; + p_72975_3_ = i1; + } + + if (!this.provider.hasNoSky) + { + for (i1 = p_72975_3_; i1 <= p_72975_4_; ++i1) + { + this.updateLightByType(EnumSkyBlock.Sky, p_72975_1_, i1, p_72975_2_); + } + } + + this.markBlockRangeForRenderUpdate(p_72975_1_, p_72975_3_, p_72975_2_, p_72975_1_, p_72975_4_, p_72975_2_); + } + + public void markBlockRangeForRenderUpdate(int p_147458_1_, int p_147458_2_, int p_147458_3_, int p_147458_4_, int p_147458_5_, int p_147458_6_) + { + for (int k1 = 0; k1 < this.worldAccesses.size(); ++k1) + { + ((IWorldAccess)this.worldAccesses.get(k1)).markBlockRangeForRenderUpdate(p_147458_1_, p_147458_2_, p_147458_3_, p_147458_4_, p_147458_5_, p_147458_6_); + } + } + + public void notifyBlocksOfNeighborChange(int p_147459_1_, int p_147459_2_, int p_147459_3_, Block p_147459_4_) + { + this.notifyBlockOfNeighborChange(p_147459_1_ - 1, p_147459_2_, p_147459_3_, p_147459_4_); + this.notifyBlockOfNeighborChange(p_147459_1_ + 1, p_147459_2_, p_147459_3_, p_147459_4_); + this.notifyBlockOfNeighborChange(p_147459_1_, p_147459_2_ - 1, p_147459_3_, p_147459_4_); + this.notifyBlockOfNeighborChange(p_147459_1_, p_147459_2_ + 1, p_147459_3_, p_147459_4_); + this.notifyBlockOfNeighborChange(p_147459_1_, p_147459_2_, p_147459_3_ - 1, p_147459_4_); + this.notifyBlockOfNeighborChange(p_147459_1_, p_147459_2_, p_147459_3_ + 1, p_147459_4_); + } + + public void notifyBlocksOfNeighborChange(int p_147441_1_, int p_147441_2_, int p_147441_3_, Block p_147441_4_, int p_147441_5_) + { + if (p_147441_5_ != 4) + { + this.notifyBlockOfNeighborChange(p_147441_1_ - 1, p_147441_2_, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 5) + { + this.notifyBlockOfNeighborChange(p_147441_1_ + 1, p_147441_2_, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 0) + { + this.notifyBlockOfNeighborChange(p_147441_1_, p_147441_2_ - 1, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 1) + { + this.notifyBlockOfNeighborChange(p_147441_1_, p_147441_2_ + 1, p_147441_3_, p_147441_4_); + } + + if (p_147441_5_ != 2) + { + this.notifyBlockOfNeighborChange(p_147441_1_, p_147441_2_, p_147441_3_ - 1, p_147441_4_); + } + + if (p_147441_5_ != 3) + { + this.notifyBlockOfNeighborChange(p_147441_1_, p_147441_2_, p_147441_3_ + 1, p_147441_4_); + } + } + + /** + * Notifies a block that one of its neighbor change to the specified type Args: x, y, z, block + */ + public void notifyBlockOfNeighborChange(int p_147460_1_, int p_147460_2_, int p_147460_3_, final Block p_147460_4_) + { + if (!this.isRemote) + { + Block block = this.getBlock(p_147460_1_, p_147460_2_, p_147460_3_); + + try + { + block.onNeighborBlockChange(this, p_147460_1_, p_147460_2_, p_147460_3_, p_147460_4_); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception while updating neighbours"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being updated"); + int l; + + try + { + l = this.getBlockMetadata(p_147460_1_, p_147460_2_, p_147460_3_); + } + catch (Throwable throwable) + { + l = -1; + } + + crashreportcategory.addCrashSectionCallable("Source block type", new Callable() + { + private static final String __OBFID = "CL_00000142"; + public String call() + { + try + { + return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(Block.getIdFromBlock(p_147460_4_)), p_147460_4_.getUnlocalizedName(), p_147460_4_.getClass().getCanonicalName()}); + } + catch (Throwable throwable2) + { + return "ID #" + Block.getIdFromBlock(p_147460_4_); + } + } + }); + CrashReportCategory.func_147153_a(crashreportcategory, p_147460_1_, p_147460_2_, p_147460_3_, block, l); + throw new ReportedException(crashreport); + } + } + } + + /** + * Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, Block + */ + public boolean isBlockTickScheduledThisTick(int p_147477_1_, int p_147477_2_, int p_147477_3_, Block p_147477_4_) + { + return false; + } + + /** + * Checks if the specified block is able to see the sky + */ + public boolean canBlockSeeTheSky(int p_72937_1_, int p_72937_2_, int p_72937_3_) + { + return this.getChunkFromChunkCoords(p_72937_1_ >> 4, p_72937_3_ >> 4).canBlockSeeTheSky(p_72937_1_ & 15, p_72937_2_, p_72937_3_ & 15); + } + + /** + * Does the same as getBlockLightValue_do but without checking if its not a normal block + */ + public int getFullBlockLightValue(int p_72883_1_, int p_72883_2_, int p_72883_3_) + { + if (p_72883_2_ < 0) + { + return 0; + } + else + { + if (p_72883_2_ >= 256) + { + p_72883_2_ = 255; + } + + return this.getChunkFromChunkCoords(p_72883_1_ >> 4, p_72883_3_ >> 4).getBlockLightValue(p_72883_1_ & 15, p_72883_2_, p_72883_3_ & 15, 0); + } + } + + /** + * Gets the light value of a block location + */ + public int getBlockLightValue(int p_72957_1_, int p_72957_2_, int p_72957_3_) + { + return this.getBlockLightValue_do(p_72957_1_, p_72957_2_, p_72957_3_, true); + } + + /** + * Gets the light value of a block location. This is the actual function that gets the value and has a bool flag + * that indicates if its a half step block to get the maximum light value of a direct neighboring block (left, + * right, forward, back, and up) + */ + public int getBlockLightValue_do(int p_72849_1_, int p_72849_2_, int p_72849_3_, boolean p_72849_4_) + { + if (p_72849_1_ >= -30000000 && p_72849_3_ >= -30000000 && p_72849_1_ < 30000000 && p_72849_3_ < 30000000) + { + if (p_72849_4_ && this.getBlock(p_72849_1_, p_72849_2_, p_72849_3_).getUseNeighborBrightness()) + { + int l1 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_ + 1, p_72849_3_, false); + int l = this.getBlockLightValue_do(p_72849_1_ + 1, p_72849_2_, p_72849_3_, false); + int i1 = this.getBlockLightValue_do(p_72849_1_ - 1, p_72849_2_, p_72849_3_, false); + int j1 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_, p_72849_3_ + 1, false); + int k1 = this.getBlockLightValue_do(p_72849_1_, p_72849_2_, p_72849_3_ - 1, false); + + if (l > l1) + { + l1 = l; + } + + if (i1 > l1) + { + l1 = i1; + } + + if (j1 > l1) + { + l1 = j1; + } + + if (k1 > l1) + { + l1 = k1; + } + + return l1; + } + else if (p_72849_2_ < 0) + { + return 0; + } + else + { + if (p_72849_2_ >= 256) + { + p_72849_2_ = 255; + } + + Chunk chunk = this.getChunkFromChunkCoords(p_72849_1_ >> 4, p_72849_3_ >> 4); + p_72849_1_ &= 15; + p_72849_3_ &= 15; + return chunk.getBlockLightValue(p_72849_1_, p_72849_2_, p_72849_3_, this.skylightSubtracted); + } + } + else + { + return 15; + } + } + + /** + * Returns the y coordinate with a block in it at this x, z coordinate + */ + public int getHeightValue(int p_72976_1_, int p_72976_2_) + { + if (p_72976_1_ >= -30000000 && p_72976_2_ >= -30000000 && p_72976_1_ < 30000000 && p_72976_2_ < 30000000) + { + if (!this.chunkExists(p_72976_1_ >> 4, p_72976_2_ >> 4)) + { + return 0; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(p_72976_1_ >> 4, p_72976_2_ >> 4); + return chunk.getHeightValue(p_72976_1_ & 15, p_72976_2_ & 15); + } + } + else + { + return 64; + } + } + + /** + * Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: + * X, Z + */ + public int getChunkHeightMapMinimum(int p_82734_1_, int p_82734_2_) + { + if (p_82734_1_ >= -30000000 && p_82734_2_ >= -30000000 && p_82734_1_ < 30000000 && p_82734_2_ < 30000000) + { + if (!this.chunkExists(p_82734_1_ >> 4, p_82734_2_ >> 4)) + { + return 0; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(p_82734_1_ >> 4, p_82734_2_ >> 4); + return chunk.heightMapMinimum; + } + } + else + { + return 64; + } + } + + /** + * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. + * Brightness for SkyBlock.Block is yellowish and independent. + */ + @SideOnly(Side.CLIENT) + public int getSkyBlockTypeBrightness(EnumSkyBlock p_72925_1_, int p_72925_2_, int p_72925_3_, int p_72925_4_) + { + if (this.provider.hasNoSky && p_72925_1_ == EnumSkyBlock.Sky) + { + return 0; + } + else + { + if (p_72925_3_ < 0) + { + p_72925_3_ = 0; + } + + if (p_72925_3_ >= 256) + { + return p_72925_1_.defaultLightValue; + } + else if (p_72925_2_ >= -30000000 && p_72925_4_ >= -30000000 && p_72925_2_ < 30000000 && p_72925_4_ < 30000000) + { + int l = p_72925_2_ >> 4; + int i1 = p_72925_4_ >> 4; + + if (!this.chunkExists(l, i1)) + { + return p_72925_1_.defaultLightValue; + } + else if (this.getBlock(p_72925_2_, p_72925_3_, p_72925_4_).getUseNeighborBrightness()) + { + int j2 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_ + 1, p_72925_4_); + int j1 = this.getSavedLightValue(p_72925_1_, p_72925_2_ + 1, p_72925_3_, p_72925_4_); + int k1 = this.getSavedLightValue(p_72925_1_, p_72925_2_ - 1, p_72925_3_, p_72925_4_); + int l1 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_, p_72925_4_ + 1); + int i2 = this.getSavedLightValue(p_72925_1_, p_72925_2_, p_72925_3_, p_72925_4_ - 1); + + if (j1 > j2) + { + j2 = j1; + } + + if (k1 > j2) + { + j2 = k1; + } + + if (l1 > j2) + { + j2 = l1; + } + + if (i2 > j2) + { + j2 = i2; + } + + return j2; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(l, i1); + return chunk.getSavedLightValue(p_72925_1_, p_72925_2_ & 15, p_72925_3_, p_72925_4_ & 15); + } + } + else + { + return p_72925_1_.defaultLightValue; + } + } + } + + /** + * Returns saved light value without taking into account the time of day. Either looks in the sky light map or + * block light map based on the enumSkyBlock arg. + */ + public int getSavedLightValue(EnumSkyBlock p_72972_1_, int p_72972_2_, int p_72972_3_, int p_72972_4_) + { + if (p_72972_3_ < 0) + { + p_72972_3_ = 0; + } + + if (p_72972_3_ >= 256) + { + p_72972_3_ = 255; + } + + if (p_72972_2_ >= -30000000 && p_72972_4_ >= -30000000 && p_72972_2_ < 30000000 && p_72972_4_ < 30000000) + { + int l = p_72972_2_ >> 4; + int i1 = p_72972_4_ >> 4; + + if (!this.chunkExists(l, i1)) + { + return p_72972_1_.defaultLightValue; + } + else + { + Chunk chunk = this.getChunkFromChunkCoords(l, i1); + return chunk.getSavedLightValue(p_72972_1_, p_72972_2_ & 15, p_72972_3_, p_72972_4_ & 15); + } + } + else + { + return p_72972_1_.defaultLightValue; + } + } + + /** + * Sets the light value either into the sky map or block map depending on if enumSkyBlock is set to sky or block. + * Args: enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_72915_1_, int p_72915_2_, int p_72915_3_, int p_72915_4_, int p_72915_5_) + { + if (p_72915_2_ >= -30000000 && p_72915_4_ >= -30000000 && p_72915_2_ < 30000000 && p_72915_4_ < 30000000) + { + if (p_72915_3_ >= 0) + { + if (p_72915_3_ < 256) + { + if (this.chunkExists(p_72915_2_ >> 4, p_72915_4_ >> 4)) + { + Chunk chunk = this.getChunkFromChunkCoords(p_72915_2_ >> 4, p_72915_4_ >> 4); + chunk.setLightValue(p_72915_1_, p_72915_2_ & 15, p_72915_3_, p_72915_4_ & 15, p_72915_5_); + + for (int i1 = 0; i1 < this.worldAccesses.size(); ++i1) + { + ((IWorldAccess)this.worldAccesses.get(i1)).markBlockForRenderUpdate(p_72915_2_, p_72915_3_, p_72915_4_); + } + } + } + } + } + } + + public void func_147479_m(int p_147479_1_, int p_147479_2_, int p_147479_3_) + { + for (int l = 0; l < this.worldAccesses.size(); ++l) + { + ((IWorldAccess)this.worldAccesses.get(l)).markBlockForRenderUpdate(p_147479_1_, p_147479_2_, p_147479_3_); + } + } + + /** + * Any Light rendered on a 1.8 Block goes through here + */ + @SideOnly(Side.CLIENT) + public int getLightBrightnessForSkyBlocks(int p_72802_1_, int p_72802_2_, int p_72802_3_, int p_72802_4_) + { + int i1 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, p_72802_1_, p_72802_2_, p_72802_3_); + int j1 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, p_72802_1_, p_72802_2_, p_72802_3_); + + if (j1 < p_72802_4_) + { + j1 = p_72802_4_; + } + + return i1 << 20 | j1 << 4; + } + + /** + * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light + * values aren't linear for brightness). Args: x, y, z + */ + public float getLightBrightness(int p_72801_1_, int p_72801_2_, int p_72801_3_) + { + return this.provider.lightBrightnessTable[this.getBlockLightValue(p_72801_1_, p_72801_2_, p_72801_3_)]; + } + + /** + * Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4 + */ + public boolean isDaytime() + { + return provider.isDaytime(); + } + + /** + * Performs a raycast against all blocks in the world except liquids. + */ + public MovingObjectPosition rayTraceBlocks(Vec3 p_72933_1_, Vec3 p_72933_2_) + { + return this.func_147447_a(p_72933_1_, p_72933_2_, false, false, false); + } + + /** + * Performs a raycast against all blocks in the world, and optionally liquids. + */ + public MovingObjectPosition rayTraceBlocks(Vec3 p_72901_1_, Vec3 p_72901_2_, boolean p_72901_3_) + { + return this.func_147447_a(p_72901_1_, p_72901_2_, p_72901_3_, false, false); + } + + public MovingObjectPosition func_147447_a(Vec3 p_147447_1_, Vec3 p_147447_2_, boolean p_147447_3_, boolean p_147447_4_, boolean p_147447_5_) + { + if (!Double.isNaN(p_147447_1_.xCoord) && !Double.isNaN(p_147447_1_.yCoord) && !Double.isNaN(p_147447_1_.zCoord)) + { + if (!Double.isNaN(p_147447_2_.xCoord) && !Double.isNaN(p_147447_2_.yCoord) && !Double.isNaN(p_147447_2_.zCoord)) + { + int i = MathHelper.floor_double(p_147447_2_.xCoord); + int j = MathHelper.floor_double(p_147447_2_.yCoord); + int k = MathHelper.floor_double(p_147447_2_.zCoord); + int l = MathHelper.floor_double(p_147447_1_.xCoord); + int i1 = MathHelper.floor_double(p_147447_1_.yCoord); + int j1 = MathHelper.floor_double(p_147447_1_.zCoord); + Block block = this.getBlock(l, i1, j1); + int k1 = this.getBlockMetadata(l, i1, j1); + + if ((!p_147447_4_ || block.getCollisionBoundingBoxFromPool(this, l, i1, j1) != null) && block.canCollideCheck(k1, p_147447_3_)) + { + MovingObjectPosition movingobjectposition = block.collisionRayTrace(this, l, i1, j1, p_147447_1_, p_147447_2_); + + if (movingobjectposition != null) + { + return movingobjectposition; + } + } + + MovingObjectPosition movingobjectposition2 = null; + k1 = 200; + + while (k1-- >= 0) + { + if (Double.isNaN(p_147447_1_.xCoord) || Double.isNaN(p_147447_1_.yCoord) || Double.isNaN(p_147447_1_.zCoord)) + { + return null; + } + + if (l == i && i1 == j && j1 == k) + { + return p_147447_5_ ? movingobjectposition2 : null; + } + + boolean flag6 = true; + boolean flag3 = true; + boolean flag4 = true; + double d0 = 999.0D; + double d1 = 999.0D; + double d2 = 999.0D; + + if (i > l) + { + d0 = (double)l + 1.0D; + } + else if (i < l) + { + d0 = (double)l + 0.0D; + } + else + { + flag6 = false; + } + + if (j > i1) + { + d1 = (double)i1 + 1.0D; + } + else if (j < i1) + { + d1 = (double)i1 + 0.0D; + } + else + { + flag3 = false; + } + + if (k > j1) + { + d2 = (double)j1 + 1.0D; + } + else if (k < j1) + { + d2 = (double)j1 + 0.0D; + } + else + { + flag4 = false; + } + + double d3 = 999.0D; + double d4 = 999.0D; + double d5 = 999.0D; + double d6 = p_147447_2_.xCoord - p_147447_1_.xCoord; + double d7 = p_147447_2_.yCoord - p_147447_1_.yCoord; + double d8 = p_147447_2_.zCoord - p_147447_1_.zCoord; + + if (flag6) + { + d3 = (d0 - p_147447_1_.xCoord) / d6; + } + + if (flag3) + { + d4 = (d1 - p_147447_1_.yCoord) / d7; + } + + if (flag4) + { + d5 = (d2 - p_147447_1_.zCoord) / d8; + } + + boolean flag5 = false; + byte b0; + + if (d3 < d4 && d3 < d5) + { + if (i > l) + { + b0 = 4; + } + else + { + b0 = 5; + } + + p_147447_1_.xCoord = d0; + p_147447_1_.yCoord += d7 * d3; + p_147447_1_.zCoord += d8 * d3; + } + else if (d4 < d5) + { + if (j > i1) + { + b0 = 0; + } + else + { + b0 = 1; + } + + p_147447_1_.xCoord += d6 * d4; + p_147447_1_.yCoord = d1; + p_147447_1_.zCoord += d8 * d4; + } + else + { + if (k > j1) + { + b0 = 2; + } + else + { + b0 = 3; + } + + p_147447_1_.xCoord += d6 * d5; + p_147447_1_.yCoord += d7 * d5; + p_147447_1_.zCoord = d2; + } + + Vec3 vec32 = Vec3.createVectorHelper(p_147447_1_.xCoord, p_147447_1_.yCoord, p_147447_1_.zCoord); + l = (int)(vec32.xCoord = (double)MathHelper.floor_double(p_147447_1_.xCoord)); + + if (b0 == 5) + { + --l; + ++vec32.xCoord; + } + + i1 = (int)(vec32.yCoord = (double)MathHelper.floor_double(p_147447_1_.yCoord)); + + if (b0 == 1) + { + --i1; + ++vec32.yCoord; + } + + j1 = (int)(vec32.zCoord = (double)MathHelper.floor_double(p_147447_1_.zCoord)); + + if (b0 == 3) + { + --j1; + ++vec32.zCoord; + } + + Block block1 = this.getBlock(l, i1, j1); + int l1 = this.getBlockMetadata(l, i1, j1); + + if (!p_147447_4_ || block1.getCollisionBoundingBoxFromPool(this, l, i1, j1) != null) + { + if (block1.canCollideCheck(l1, p_147447_3_)) + { + MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(this, l, i1, j1, p_147447_1_, p_147447_2_); + + if (movingobjectposition1 != null) + { + return movingobjectposition1; + } + } + else + { + movingobjectposition2 = new MovingObjectPosition(l, i1, j1, b0, p_147447_1_, false); + } + } + } + + return p_147447_5_ ? movingobjectposition2 : null; + } + else + { + return null; + } + } + else + { + return null; + } + } + + /** + * Plays a sound at the entity's position. Args: entity, sound, volume (relative to 1.0), and frequency (or pitch, + * also relative to 1.0). + */ + public void playSoundAtEntity(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) + { + PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_72956_1_, p_72956_2_, p_72956_3_, p_72956_4_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + p_72956_2_ = event.name; + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSound(p_72956_2_, p_72956_1_.posX, p_72956_1_.posY - (double)p_72956_1_.yOffset, p_72956_1_.posZ, p_72956_3_, p_72956_4_); + } + } + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) + { + PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_85173_1_, p_85173_2_, p_85173_3_, p_85173_4_); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return; + } + p_85173_2_ = event.name; + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSoundToNearExcept(p_85173_1_, p_85173_2_, p_85173_1_.posX, p_85173_1_.posY - (double)p_85173_1_.yOffset, p_85173_1_.posZ, p_85173_3_, p_85173_4_); + } + } + + /** + * Play a sound effect. Many many parameters for this function. Not sure what they do, but a classic call is : + * (double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, 'random.door_open', 1.0F, world.rand.nextFloat() * 0.1F + + * 0.9F with i,j,k position of the block. + */ + public void playSoundEffect(double x, double y, double z, String soundName, float volume, float pitch) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).playSound(soundName, x, y, z, volume, pitch); + } + } + + /** + * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound + */ + public void playSound(double x, double y, double z, String soundName, float volume, float pitch, boolean distanceDelay) {} + + /** + * Plays a record at the specified coordinates of the specified name. Args: recordName, x, y, z + */ + public void playRecord(String recordName, int x, int y, int z) + { + for (int l = 0; l < this.worldAccesses.size(); ++l) + { + ((IWorldAccess)this.worldAccesses.get(l)).playRecord(recordName, x, y, z); + } + } + + /** + * Spawns a particle. Args particleName, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String particleName, double x, double y, double z, double velocityX, double velocityY, double velocityZ) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ); + } + } + + /** + * adds a lightning bolt to the list of lightning bolts in this world. + */ + public boolean addWeatherEffect(Entity p_72942_1_) + { + this.weatherEffects.add(p_72942_1_); + return true; + } + + /** + * Called to place all entities as part of a world + */ + public boolean spawnEntityInWorld(Entity p_72838_1_) + { + // do not drop any items while restoring blocksnapshots. Prevents dupes + if (!this.isRemote && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false; + + int i = MathHelper.floor_double(p_72838_1_.posX / 16.0D); + int j = MathHelper.floor_double(p_72838_1_.posZ / 16.0D); + boolean flag = p_72838_1_.forceSpawn; + + if (p_72838_1_ instanceof EntityPlayer) + { + flag = true; + } + + if (!flag && !this.chunkExists(i, j)) + { + return false; + } + else + { + if (p_72838_1_ instanceof EntityPlayer) + { + EntityPlayer entityplayer = (EntityPlayer)p_72838_1_; + this.playerEntities.add(entityplayer); + this.updateAllPlayersSleepingFlag(); + } + if (MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(p_72838_1_, this)) && !flag) return false; + + this.getChunkFromChunkCoords(i, j).addEntity(p_72838_1_); + this.loadedEntityList.add(p_72838_1_); + this.onEntityAdded(p_72838_1_); + return true; + } + } + + public void onEntityAdded(Entity p_72923_1_) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).onEntityCreate(p_72923_1_); + } + } + + public void onEntityRemoved(Entity p_72847_1_) + { + for (int i = 0; i < this.worldAccesses.size(); ++i) + { + ((IWorldAccess)this.worldAccesses.get(i)).onEntityDestroy(p_72847_1_); + } + } + + /** + * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. + */ + public void removeEntity(Entity p_72900_1_) + { + if (p_72900_1_.riddenByEntity != null) + { + p_72900_1_.riddenByEntity.mountEntity((Entity)null); + } + + if (p_72900_1_.ridingEntity != null) + { + p_72900_1_.mountEntity((Entity)null); + } + + p_72900_1_.setDead(); + + if (p_72900_1_ instanceof EntityPlayer) + { + this.playerEntities.remove(p_72900_1_); + this.updateAllPlayersSleepingFlag(); + this.onEntityRemoved(p_72900_1_); + } + } + + /** + * Do NOT use this method to remove normal entities- use normal removeEntity + */ + public void removePlayerEntityDangerously(Entity p_72973_1_) + { + p_72973_1_.setDead(); + + if (p_72973_1_ instanceof EntityPlayer) + { + this.playerEntities.remove(p_72973_1_); + this.updateAllPlayersSleepingFlag(); + } + + int i = p_72973_1_.chunkCoordX; + int j = p_72973_1_.chunkCoordZ; + + if (p_72973_1_.addedToChunk && this.chunkExists(i, j)) + { + this.getChunkFromChunkCoords(i, j).removeEntity(p_72973_1_); + } + + this.loadedEntityList.remove(p_72973_1_); + this.onEntityRemoved(p_72973_1_); + } + + /** + * Adds a IWorldAccess to the list of worldAccesses + */ + public void addWorldAccess(IWorldAccess p_72954_1_) + { + this.worldAccesses.add(p_72954_1_); + } + + /** + * Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity, + * aabb + */ + public List getCollidingBoundingBoxes(Entity p_72945_1_, AxisAlignedBB p_72945_2_) + { + this.collidingBoundingBoxes.clear(); + int i = MathHelper.floor_double(p_72945_2_.minX); + int j = MathHelper.floor_double(p_72945_2_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72945_2_.minY); + int l = MathHelper.floor_double(p_72945_2_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72945_2_.minZ); + int j1 = MathHelper.floor_double(p_72945_2_.maxZ + 1.0D); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = i1; l1 < j1; ++l1) + { + if (this.blockExists(k1, 64, l1)) + { + for (int i2 = k - 1; i2 < l; ++i2) + { + Block block; + + if (k1 >= -30000000 && k1 < 30000000 && l1 >= -30000000 && l1 < 30000000) + { + block = this.getBlock(k1, i2, l1); + } + else + { + block = Blocks.stone; + } + + block.addCollisionBoxesToList(this, k1, i2, l1, p_72945_2_, this.collidingBoundingBoxes, p_72945_1_); + } + } + } + } + + double d0 = 0.25D; + List list = this.getEntitiesWithinAABBExcludingEntity(p_72945_1_, p_72945_2_.expand(d0, d0, d0)); + + for (int j2 = 0; j2 < list.size(); ++j2) + { + AxisAlignedBB axisalignedbb1 = ((Entity)list.get(j2)).getBoundingBox(); + + if (axisalignedbb1 != null && axisalignedbb1.intersectsWith(p_72945_2_)) + { + this.collidingBoundingBoxes.add(axisalignedbb1); + } + + axisalignedbb1 = p_72945_1_.getCollisionBox((Entity)list.get(j2)); + + if (axisalignedbb1 != null && axisalignedbb1.intersectsWith(p_72945_2_)) + { + this.collidingBoundingBoxes.add(axisalignedbb1); + } + } + + return this.collidingBoundingBoxes; + } + + public List func_147461_a(AxisAlignedBB p_147461_1_) + { + this.collidingBoundingBoxes.clear(); + int i = MathHelper.floor_double(p_147461_1_.minX); + int j = MathHelper.floor_double(p_147461_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_147461_1_.minY); + int l = MathHelper.floor_double(p_147461_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_147461_1_.minZ); + int j1 = MathHelper.floor_double(p_147461_1_.maxZ + 1.0D); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = i1; l1 < j1; ++l1) + { + if (this.blockExists(k1, 64, l1)) + { + for (int i2 = k - 1; i2 < l; ++i2) + { + Block block; + + if (k1 >= -30000000 && k1 < 30000000 && l1 >= -30000000 && l1 < 30000000) + { + block = this.getBlock(k1, i2, l1); + } + else + { + block = Blocks.bedrock; + } + + block.addCollisionBoxesToList(this, k1, i2, l1, p_147461_1_, this.collidingBoundingBoxes, (Entity)null); + } + } + } + } + + return this.collidingBoundingBoxes; + } + + /** + * Returns the amount of skylight subtracted for the current time + */ + public int calculateSkylightSubtracted(float p_72967_1_) + { + float f2 = provider.getSunBrightnessFactor(p_72967_1_); + f2 = 1.0F - f2; + return (int)(f2 * 11.0F); + } + + /** + * The current sun brightness factor for this dimension. + * 0.0f means no light at all, and 1.0f means maximum sunlight. + * Highly recommended for sunlight detection like solar panel. + * + * @return The current brightness factor + * */ + public float getSunBrightnessFactor(float p_72967_1_) + { + float f1 = this.getCelestialAngle(p_72967_1_); + float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + f2 = 1.0F - f2; + f2 = (float)((double)f2 * (1.0D - (double)(this.getRainStrength(p_72967_1_) * 5.0F) / 16.0D)); + f2 = (float)((double)f2 * (1.0D - (double)(this.getWeightedThunderStrength(p_72967_1_) * 5.0F) / 16.0D)); + return f2; + } + + /** + * Removes a worldAccess from the worldAccesses object + */ + public void removeWorldAccess(IWorldAccess p_72848_1_) + { + this.worldAccesses.remove(p_72848_1_); + } + + /** + * Returns the sun brightness - checks time of day, rain and thunder + */ + @SideOnly(Side.CLIENT) + public float getSunBrightness(float p_72971_1_) + { + return provider.getSunBrightness(p_72971_1_); + } + + @SideOnly(Side.CLIENT) + public float getSunBrightnessBody(float p_72971_1_) + { + float f1 = this.getCelestialAngle(p_72971_1_); + float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + f2 = 1.0F - f2; + f2 = (float)((double)f2 * (1.0D - (double)(this.getRainStrength(p_72971_1_) * 5.0F) / 16.0D)); + f2 = (float)((double)f2 * (1.0D - (double)(this.getWeightedThunderStrength(p_72971_1_) * 5.0F) / 16.0D)); + return f2 * 0.8F + 0.2F; + } + + /** + * Calculates the color for the skybox + */ + @SideOnly(Side.CLIENT) + public Vec3 getSkyColor(Entity p_72833_1_, float p_72833_2_) + { + return provider.getSkyColor(p_72833_1_, p_72833_2_); + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColorBody(Entity p_72833_1_, float p_72833_2_) + { + float f1 = this.getCelestialAngle(p_72833_2_); + float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + int i = MathHelper.floor_double(p_72833_1_.posX); + int j = MathHelper.floor_double(p_72833_1_.posY); + int k = MathHelper.floor_double(p_72833_1_.posZ); + int l = ForgeHooksClient.getSkyBlendColour(this, i, j, k); + float f4 = (float)(l >> 16 & 255) / 255.0F; + float f5 = (float)(l >> 8 & 255) / 255.0F; + float f6 = (float)(l & 255) / 255.0F; + f4 *= f2; + f5 *= f2; + f6 *= f2; + float f7 = this.getRainStrength(p_72833_2_); + float f8; + float f9; + + if (f7 > 0.0F) + { + f8 = (f4 * 0.3F + f5 * 0.59F + f6 * 0.11F) * 0.6F; + f9 = 1.0F - f7 * 0.75F; + f4 = f4 * f9 + f8 * (1.0F - f9); + f5 = f5 * f9 + f8 * (1.0F - f9); + f6 = f6 * f9 + f8 * (1.0F - f9); + } + + f8 = this.getWeightedThunderStrength(p_72833_2_); + + if (f8 > 0.0F) + { + f9 = (f4 * 0.3F + f5 * 0.59F + f6 * 0.11F) * 0.2F; + float f10 = 1.0F - f8 * 0.75F; + f4 = f4 * f10 + f9 * (1.0F - f10); + f5 = f5 * f10 + f9 * (1.0F - f10); + f6 = f6 * f10 + f9 * (1.0F - f10); + } + + if (this.lastLightningBolt > 0) + { + f9 = (float)this.lastLightningBolt - p_72833_2_; + + if (f9 > 1.0F) + { + f9 = 1.0F; + } + + f9 *= 0.45F; + f4 = f4 * (1.0F - f9) + 0.8F * f9; + f5 = f5 * (1.0F - f9) + 0.8F * f9; + f6 = f6 * (1.0F - f9) + 1.0F * f9; + } + + return Vec3.createVectorHelper((double)f4, (double)f5, (double)f6); + } + + /** + * calls calculateCelestialAngle + */ + public float getCelestialAngle(float p_72826_1_) + { + return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), p_72826_1_); + } + + @SideOnly(Side.CLIENT) + public int getMoonPhase() + { + return this.provider.getMoonPhase(this.worldInfo.getWorldTime()); + } + + /** + * gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25 + */ + public float getCurrentMoonPhaseFactor() + { + return provider.getCurrentMoonPhaseFactor(); + } + + public float getCurrentMoonPhaseFactorBody() + { + return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; + } + + /** + * Return getCelestialAngle()*2*PI + */ + public float getCelestialAngleRadians(float p_72929_1_) + { + float f1 = this.getCelestialAngle(p_72929_1_); + return f1 * (float)Math.PI * 2.0F; + } + + @SideOnly(Side.CLIENT) + public Vec3 getCloudColour(float p_72824_1_) + { + return provider.drawClouds(p_72824_1_); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawCloudsBody(float p_72824_1_) + { + float f1 = this.getCelestialAngle(p_72824_1_); + float f2 = MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + float f3 = (float)(this.cloudColour >> 16 & 255L) / 255.0F; + float f4 = (float)(this.cloudColour >> 8 & 255L) / 255.0F; + float f5 = (float)(this.cloudColour & 255L) / 255.0F; + float f6 = this.getRainStrength(p_72824_1_); + float f7; + float f8; + + if (f6 > 0.0F) + { + f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F; + f8 = 1.0F - f6 * 0.95F; + f3 = f3 * f8 + f7 * (1.0F - f8); + f4 = f4 * f8 + f7 * (1.0F - f8); + f5 = f5 * f8 + f7 * (1.0F - f8); + } + + f3 *= f2 * 0.9F + 0.1F; + f4 *= f2 * 0.9F + 0.1F; + f5 *= f2 * 0.85F + 0.15F; + f7 = this.getWeightedThunderStrength(p_72824_1_); + + if (f7 > 0.0F) + { + f8 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F; + float f9 = 1.0F - f7 * 0.95F; + f3 = f3 * f9 + f8 * (1.0F - f9); + f4 = f4 * f9 + f8 * (1.0F - f9); + f5 = f5 * f9 + f8 * (1.0F - f9); + } + + return Vec3.createVectorHelper((double)f3, (double)f4, (double)f5); + } + + /** + * Returns vector(ish) with R/G/B for fog + */ + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float p_72948_1_) + { + float f1 = this.getCelestialAngle(p_72948_1_); + return this.provider.getFogColor(f1, p_72948_1_); + } + + /** + * Gets the height to which rain/snow will fall. Calculates it if not already stored. + */ + public int getPrecipitationHeight(int p_72874_1_, int p_72874_2_) + { + return this.getChunkFromBlockCoords(p_72874_1_, p_72874_2_).getPrecipitationHeight(p_72874_1_ & 15, p_72874_2_ & 15); + } + + /** + * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z + */ + public int getTopSolidOrLiquidBlock(int p_72825_1_, int p_72825_2_) + { + Chunk chunk = this.getChunkFromBlockCoords(p_72825_1_, p_72825_2_); + int x = p_72825_1_; + int z = p_72825_2_; + int k = chunk.getTopFilledSegment() + 15; + p_72825_1_ &= 15; + + for (p_72825_2_ &= 15; k > 0; --k) + { + Block block = chunk.getBlock(p_72825_1_, k, p_72825_2_); + + if (block.getMaterial().blocksMovement() && block.getMaterial() != Material.leaves && !block.isFoliage(this, x, k, z)) + { + return k + 1; + } + } + + return -1; + } + + /** + * How bright are stars in the sky + */ + @SideOnly(Side.CLIENT) + public float getStarBrightness(float p_72880_1_) + { + return provider.getStarBrightness(p_72880_1_); + } + + @SideOnly(Side.CLIENT) + public float getStarBrightnessBody(float par1) + { + float f1 = this.getCelestialAngle(par1); + float f2 = 1.0F - (MathHelper.cos(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + return f2 * f2 * 0.5F; + } + + /** + * Schedules a tick to a block with a delay (Most commonly the tick rate) + */ + public void scheduleBlockUpdate(int p_147464_1_, int p_147464_2_, int p_147464_3_, Block p_147464_4_, int p_147464_5_) {} + + public void scheduleBlockUpdateWithPriority(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) {} + + public void func_147446_b(int p_147446_1_, int p_147446_2_, int p_147446_3_, Block p_147446_4_, int p_147446_5_, int p_147446_6_) {} + + /** + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() + { + this.theProfiler.startSection("entities"); + this.theProfiler.startSection("global"); + int i; + Entity entity; + CrashReport crashreport; + CrashReportCategory crashreportcategory; + + for (i = 0; i < this.weatherEffects.size(); ++i) + { + entity = (Entity)this.weatherEffects.get(i); + + try + { + ++entity.ticksExisted; + entity.onUpdate(); + } + catch (Throwable throwable2) + { + crashreport = CrashReport.makeCrashReport(throwable2, "Ticking entity"); + crashreportcategory = crashreport.makeCategory("Entity being ticked"); + + if (entity == null) + { + crashreportcategory.addCrashSection("Entity", "~~NULL~~"); + } + else + { + entity.addEntityCrashInfo(crashreportcategory); + } + + if (ForgeModContainer.removeErroringEntities) + { + FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.getCompleteReport()); + removeEntity(entity); + } + else + { + throw new ReportedException(crashreport); + } + } + + if (entity.isDead) + { + this.weatherEffects.remove(i--); + } + } + + this.theProfiler.endStartSection("remove"); + this.loadedEntityList.removeAll(this.unloadedEntityList); + int j; + int l; + + for (i = 0; i < this.unloadedEntityList.size(); ++i) + { + entity = (Entity)this.unloadedEntityList.get(i); + j = entity.chunkCoordX; + l = entity.chunkCoordZ; + + if (entity.addedToChunk && this.chunkExists(j, l)) + { + this.getChunkFromChunkCoords(j, l).removeEntity(entity); + } + } + + for (i = 0; i < this.unloadedEntityList.size(); ++i) + { + this.onEntityRemoved((Entity)this.unloadedEntityList.get(i)); + } + + this.unloadedEntityList.clear(); + this.theProfiler.endStartSection("regular"); + + for (i = 0; i < this.loadedEntityList.size(); ++i) + { + entity = (Entity)this.loadedEntityList.get(i); + + if (entity.ridingEntity != null) + { + if (!entity.ridingEntity.isDead && entity.ridingEntity.riddenByEntity == entity) + { + continue; + } + + entity.ridingEntity.riddenByEntity = null; + entity.ridingEntity = null; + } + + this.theProfiler.startSection("tick"); + + if (!entity.isDead) + { + try + { + this.updateEntity(entity); + } + catch (Throwable throwable1) + { + crashreport = CrashReport.makeCrashReport(throwable1, "Ticking entity"); + crashreportcategory = crashreport.makeCategory("Entity being ticked"); + entity.addEntityCrashInfo(crashreportcategory); + + if (ForgeModContainer.removeErroringEntities) + { + FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.getCompleteReport()); + removeEntity(entity); + } + else + { + throw new ReportedException(crashreport); + } + } + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("remove"); + + if (entity.isDead) + { + j = entity.chunkCoordX; + l = entity.chunkCoordZ; + + if (entity.addedToChunk && this.chunkExists(j, l)) + { + this.getChunkFromChunkCoords(j, l).removeEntity(entity); + } + + this.loadedEntityList.remove(i--); + this.onEntityRemoved(entity); + } + + this.theProfiler.endSection(); + } + + this.theProfiler.endStartSection("blockEntities"); + this.field_147481_N = true; + Iterator iterator = this.loadedTileEntityList.iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); + + if (!tileentity.isInvalid() && tileentity.hasWorldObj() && this.blockExists(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)) + { + try + { + tileentity.updateEntity(); + } + catch (Throwable throwable) + { + crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity"); + crashreportcategory = crashreport.makeCategory("Block entity being ticked"); + tileentity.func_145828_a(crashreportcategory); + if (ForgeModContainer.removeErroringTileEntities) + { + FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.getCompleteReport()); + tileentity.invalidate(); + setBlockToAir(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); + } + else + { + throw new ReportedException(crashreport); + } + } + } + + if (tileentity.isInvalid()) + { + iterator.remove(); + + if (this.chunkExists(tileentity.xCoord >> 4, tileentity.zCoord >> 4)) + { + Chunk chunk = this.getChunkFromChunkCoords(tileentity.xCoord >> 4, tileentity.zCoord >> 4); + + if (chunk != null) + { + chunk.removeInvalidTileEntity(tileentity.xCoord & 15, tileentity.yCoord, tileentity.zCoord & 15); + } + } + } + } + + if (!this.field_147483_b.isEmpty()) + { + for (Object tile : field_147483_b) + { + ((TileEntity)tile).onChunkUnload(); + } + this.loadedTileEntityList.removeAll(this.field_147483_b); + this.field_147483_b.clear(); + } + + this.field_147481_N = false; + + this.theProfiler.endStartSection("pendingBlockEntities"); + + if (!this.addedTileEntityList.isEmpty()) + { + for (int k = 0; k < this.addedTileEntityList.size(); ++k) + { + TileEntity tileentity1 = (TileEntity)this.addedTileEntityList.get(k); + + if (!tileentity1.isInvalid()) + { + if (!this.loadedTileEntityList.contains(tileentity1)) + { + this.loadedTileEntityList.add(tileentity1); + } + } + else + { + if (this.chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4)) + { + Chunk chunk1 = this.getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4); + + if (chunk1 != null) + { + chunk1.removeInvalidTileEntity(tileentity1.xCoord & 15, tileentity1.yCoord, tileentity1.zCoord & 15); + } + } + } + } + + this.addedTileEntityList.clear(); + } + + this.theProfiler.endSection(); + this.theProfiler.endSection(); + } + + public void func_147448_a(Collection p_147448_1_) + { + List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; + for(TileEntity entity : (Collection)p_147448_1_) + { + if(entity.canUpdate()) dest.add(entity); + } + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded. Args: entity + */ + public void updateEntity(Entity p_72870_1_) + { + this.updateEntityWithOptionalForce(p_72870_1_, true); + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. + * Args: entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) + { + int i = MathHelper.floor_double(p_72866_1_.posX); + int j = MathHelper.floor_double(p_72866_1_.posZ); + boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(i >> 4, j >> 4)); + byte b0 = isForced ? (byte)0 : 32; + boolean canUpdate = !p_72866_2_ || this.checkChunksExist(i - b0, 0, j - b0, i + b0, 0, j + b0); + + if (!canUpdate) + { + EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(p_72866_1_); + MinecraftForge.EVENT_BUS.post(event); + canUpdate = event.canUpdate; + } + + if (canUpdate) + { + p_72866_1_.lastTickPosX = p_72866_1_.posX; + p_72866_1_.lastTickPosY = p_72866_1_.posY; + p_72866_1_.lastTickPosZ = p_72866_1_.posZ; + p_72866_1_.prevRotationYaw = p_72866_1_.rotationYaw; + p_72866_1_.prevRotationPitch = p_72866_1_.rotationPitch; + + if (p_72866_2_ && p_72866_1_.addedToChunk) + { + ++p_72866_1_.ticksExisted; + + if (p_72866_1_.ridingEntity != null) + { + p_72866_1_.updateRidden(); + } + else + { + p_72866_1_.onUpdate(); + } + } + + this.theProfiler.startSection("chunkCheck"); + + if (Double.isNaN(p_72866_1_.posX) || Double.isInfinite(p_72866_1_.posX)) + { + p_72866_1_.posX = p_72866_1_.lastTickPosX; + } + + if (Double.isNaN(p_72866_1_.posY) || Double.isInfinite(p_72866_1_.posY)) + { + p_72866_1_.posY = p_72866_1_.lastTickPosY; + } + + if (Double.isNaN(p_72866_1_.posZ) || Double.isInfinite(p_72866_1_.posZ)) + { + p_72866_1_.posZ = p_72866_1_.lastTickPosZ; + } + + if (Double.isNaN((double)p_72866_1_.rotationPitch) || Double.isInfinite((double)p_72866_1_.rotationPitch)) + { + p_72866_1_.rotationPitch = p_72866_1_.prevRotationPitch; + } + + if (Double.isNaN((double)p_72866_1_.rotationYaw) || Double.isInfinite((double)p_72866_1_.rotationYaw)) + { + p_72866_1_.rotationYaw = p_72866_1_.prevRotationYaw; + } + + int k = MathHelper.floor_double(p_72866_1_.posX / 16.0D); + int l = MathHelper.floor_double(p_72866_1_.posY / 16.0D); + int i1 = MathHelper.floor_double(p_72866_1_.posZ / 16.0D); + + if (!p_72866_1_.addedToChunk || p_72866_1_.chunkCoordX != k || p_72866_1_.chunkCoordY != l || p_72866_1_.chunkCoordZ != i1) + { + if (p_72866_1_.addedToChunk && this.chunkExists(p_72866_1_.chunkCoordX, p_72866_1_.chunkCoordZ)) + { + this.getChunkFromChunkCoords(p_72866_1_.chunkCoordX, p_72866_1_.chunkCoordZ).removeEntityAtIndex(p_72866_1_, p_72866_1_.chunkCoordY); + } + + if (this.chunkExists(k, i1)) + { + p_72866_1_.addedToChunk = true; + this.getChunkFromChunkCoords(k, i1).addEntity(p_72866_1_); + } + else + { + p_72866_1_.addedToChunk = false; + } + } + + this.theProfiler.endSection(); + + if (p_72866_2_ && p_72866_1_.addedToChunk && p_72866_1_.riddenByEntity != null) + { + if (!p_72866_1_.riddenByEntity.isDead && p_72866_1_.riddenByEntity.ridingEntity == p_72866_1_) + { + this.updateEntity(p_72866_1_.riddenByEntity); + } + else + { + p_72866_1_.riddenByEntity.ridingEntity = null; + p_72866_1_.riddenByEntity = null; + } + } + } + } + + /** + * Returns true if there are no solid, live entities in the specified AxisAlignedBB + */ + public boolean checkNoEntityCollision(AxisAlignedBB p_72855_1_) + { + return this.checkNoEntityCollision(p_72855_1_, (Entity)null); + } + + /** + * Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity + */ + public boolean checkNoEntityCollision(AxisAlignedBB p_72917_1_, Entity p_72917_2_) + { + List list = this.getEntitiesWithinAABBExcludingEntity((Entity)null, p_72917_1_); + + for (int i = 0; i < list.size(); ++i) + { + Entity entity1 = (Entity)list.get(i); + + if (!entity1.isDead && entity1.preventEntitySpawning && entity1 != p_72917_2_) + { + return false; + } + } + + return true; + } + + /** + * Returns true if there are any blocks in the region constrained by an AxisAlignedBB + */ + public boolean checkBlockCollision(AxisAlignedBB p_72829_1_) + { + int i = MathHelper.floor_double(p_72829_1_.minX); + int j = MathHelper.floor_double(p_72829_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72829_1_.minY); + int l = MathHelper.floor_double(p_72829_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72829_1_.minZ); + int j1 = MathHelper.floor_double(p_72829_1_.maxZ + 1.0D); + + if (p_72829_1_.minX < 0.0D) + { + --i; + } + + if (p_72829_1_.minY < 0.0D) + { + --k; + } + + if (p_72829_1_.minZ < 0.0D) + { + --i1; + } + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlock(k1, l1, i2); + + if (block.getMaterial() != Material.air) + { + return true; + } + } + } + } + + return false; + } + + /** + * Returns if any of the blocks within the aabb are liquids. Args: aabb + */ + public boolean isAnyLiquid(AxisAlignedBB p_72953_1_) + { + int i = MathHelper.floor_double(p_72953_1_.minX); + int j = MathHelper.floor_double(p_72953_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72953_1_.minY); + int l = MathHelper.floor_double(p_72953_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72953_1_.minZ); + int j1 = MathHelper.floor_double(p_72953_1_.maxZ + 1.0D); + + if (p_72953_1_.minX < 0.0D) + { + --i; + } + + if (p_72953_1_.minY < 0.0D) + { + --k; + } + + if (p_72953_1_.minZ < 0.0D) + { + --i1; + } + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlock(k1, l1, i2); + + if (block.getMaterial().isLiquid()) + { + return true; + } + } + } + } + + return false; + } + + public boolean func_147470_e(AxisAlignedBB p_147470_1_) + { + int i = MathHelper.floor_double(p_147470_1_.minX); + int j = MathHelper.floor_double(p_147470_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_147470_1_.minY); + int l = MathHelper.floor_double(p_147470_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_147470_1_.minZ); + int j1 = MathHelper.floor_double(p_147470_1_.maxZ + 1.0D); + + if (this.checkChunksExist(i, k, i1, j, l, j1)) + { + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlock(k1, l1, i2); + + if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) + { + return true; + } + else + { + if (block.isBurning(this, k1, l1, i2)) return true; + } + } + } + } + } + + return false; + } + + /** + * handles the acceleration of an object whilst in water. Not sure if it is used elsewhere. + */ + public boolean handleMaterialAcceleration(AxisAlignedBB p_72918_1_, Material p_72918_2_, Entity p_72918_3_) + { + int i = MathHelper.floor_double(p_72918_1_.minX); + int j = MathHelper.floor_double(p_72918_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72918_1_.minY); + int l = MathHelper.floor_double(p_72918_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72918_1_.minZ); + int j1 = MathHelper.floor_double(p_72918_1_.maxZ + 1.0D); + + if (!this.checkChunksExist(i, k, i1, j, l, j1)) + { + return false; + } + else + { + boolean flag = false; + Vec3 vec3 = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlock(k1, l1, i2); + + if (block.getMaterial() == p_72918_2_) + { + double d0 = (double)((float)(l1 + 1) - BlockLiquid.getLiquidHeightPercent(this.getBlockMetadata(k1, l1, i2))); + + if ((double)l >= d0) + { + flag = true; + block.velocityToAddToEntity(this, k1, l1, i2, p_72918_3_, vec3); + } + } + } + } + } + + if (vec3.lengthVector() > 0.0D && p_72918_3_.isPushedByWater()) + { + vec3 = vec3.normalize(); + double d1 = 0.014D; + p_72918_3_.motionX += vec3.xCoord * d1; + p_72918_3_.motionY += vec3.yCoord * d1; + p_72918_3_.motionZ += vec3.zCoord * d1; + } + + return flag; + } + } + + /** + * Returns true if the given bounding box contains the given material + */ + public boolean isMaterialInBB(AxisAlignedBB p_72875_1_, Material p_72875_2_) + { + int i = MathHelper.floor_double(p_72875_1_.minX); + int j = MathHelper.floor_double(p_72875_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72875_1_.minY); + int l = MathHelper.floor_double(p_72875_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72875_1_.minZ); + int j1 = MathHelper.floor_double(p_72875_1_.maxZ + 1.0D); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + if (this.getBlock(k1, l1, i2).getMaterial() == p_72875_2_) + { + return true; + } + } + } + } + + return false; + } + + /** + * checks if the given AABB is in the material given. Used while swimming. + */ + public boolean isAABBInMaterial(AxisAlignedBB p_72830_1_, Material p_72830_2_) + { + int i = MathHelper.floor_double(p_72830_1_.minX); + int j = MathHelper.floor_double(p_72830_1_.maxX + 1.0D); + int k = MathHelper.floor_double(p_72830_1_.minY); + int l = MathHelper.floor_double(p_72830_1_.maxY + 1.0D); + int i1 = MathHelper.floor_double(p_72830_1_.minZ); + int j1 = MathHelper.floor_double(p_72830_1_.maxZ + 1.0D); + + for (int k1 = i; k1 < j; ++k1) + { + for (int l1 = k; l1 < l; ++l1) + { + for (int i2 = i1; i2 < j1; ++i2) + { + Block block = this.getBlock(k1, l1, i2); + + if (block.getMaterial() == p_72830_2_) + { + int j2 = this.getBlockMetadata(k1, l1, i2); + double d0 = (double)(l1 + 1); + + if (j2 < 8) + { + d0 = (double)(l1 + 1) - (double)j2 / 8.0D; + } + + if (d0 >= p_72830_1_.minY) + { + return true; + } + } + } + } + } + + return false; + } + + /** + * Creates an explosion. Args: entity, x, y, z, strength + */ + public Explosion createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_) + { + return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_); + } + + /** + * returns a new explosion. Does initiation (at time of writing Explosion is not finished) + */ + public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + { + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + explosion.isFlaming = p_72885_9_; + explosion.isSmoking = p_72885_10_; + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.doExplosionA(); + explosion.doExplosionB(true); + return explosion; + } + + /** + * Gets the percentage of real blocks within within a bounding box, along a specified vector. + */ + public float getBlockDensity(Vec3 p_72842_1_, AxisAlignedBB p_72842_2_) + { + double d0 = 1.0D / ((p_72842_2_.maxX - p_72842_2_.minX) * 2.0D + 1.0D); + double d1 = 1.0D / ((p_72842_2_.maxY - p_72842_2_.minY) * 2.0D + 1.0D); + double d2 = 1.0D / ((p_72842_2_.maxZ - p_72842_2_.minZ) * 2.0D + 1.0D); + + if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) + { + int i = 0; + int j = 0; + + for (float f = 0.0F; f <= 1.0F; f = (float)((double)f + d0)) + { + for (float f1 = 0.0F; f1 <= 1.0F; f1 = (float)((double)f1 + d1)) + { + for (float f2 = 0.0F; f2 <= 1.0F; f2 = (float)((double)f2 + d2)) + { + double d3 = p_72842_2_.minX + (p_72842_2_.maxX - p_72842_2_.minX) * (double)f; + double d4 = p_72842_2_.minY + (p_72842_2_.maxY - p_72842_2_.minY) * (double)f1; + double d5 = p_72842_2_.minZ + (p_72842_2_.maxZ - p_72842_2_.minZ) * (double)f2; + + if (this.rayTraceBlocks(Vec3.createVectorHelper(d3, d4, d5), p_72842_1_) == null) + { + ++i; + } + + ++j; + } + } + } + + return (float)i / (float)j; + } + else + { + return 0.0F; + } + } + + /** + * If the block in the given direction of the given coordinate is fire, extinguish it. Args: Player, X,Y,Z, + * blockDirection + */ + public boolean extinguishFire(EntityPlayer player, int x, int y, int z, int side) + { + if (side == 0) + { + --y; + } + + if (side == 1) + { + ++y; + } + + if (side == 2) + { + --z; + } + + if (side == 3) + { + ++z; + } + + if (side == 4) + { + --x; + } + + if (side == 5) + { + ++x; + } + + if (this.getBlock(x, y, z) == Blocks.fire) + { + this.playAuxSFXAtEntity(player, 1004, x, y, z, 0); + this.setBlockToAir(x, y, z); + return true; + } + else + { + return false; + } + } + + /** + * This string is 'All: (number of loaded entities)' Viewable by press ing F3 + */ + @SideOnly(Side.CLIENT) + public String getDebugLoadedEntities() + { + return "All: " + this.loadedEntityList.size(); + } + + /** + * Returns the name of the current chunk provider, by calling chunkprovider.makeString() + */ + @SideOnly(Side.CLIENT) + public String getProviderName() + { + return this.chunkProvider.makeString(); + } + + public TileEntity getTileEntity(int x, int y, int z) + { + if (y >= 0 && y < 256) + { + TileEntity tileentity = null; + int l; + TileEntity tileentity1; + + if (this.field_147481_N) + { + for (l = 0; l < this.addedTileEntityList.size(); ++l) + { + tileentity1 = (TileEntity)this.addedTileEntityList.get(l); + + if (!tileentity1.isInvalid() && tileentity1.xCoord == x && tileentity1.yCoord == y && tileentity1.zCoord == z) + { + tileentity = tileentity1; + break; + } + } + } + + if (tileentity == null) + { + Chunk chunk = this.getChunkFromChunkCoords(x >> 4, z >> 4); + + if (chunk != null) + { + tileentity = chunk.func_150806_e(x & 15, y, z & 15); + } + } + + if (tileentity == null) + { + for (l = 0; l < this.addedTileEntityList.size(); ++l) + { + tileentity1 = (TileEntity)this.addedTileEntityList.get(l); + + if (!tileentity1.isInvalid() && tileentity1.xCoord == x && tileentity1.yCoord == y && tileentity1.zCoord == z) + { + tileentity = tileentity1; + break; + } + } + } + + return tileentity; + } + else + { + return null; + } + } + + public void setTileEntity(int x, int y, int z, TileEntity tileEntityIn) + { + if (tileEntityIn == null || tileEntityIn.isInvalid()) + { + return; + } + + if (tileEntityIn.canUpdate()) + { + if (this.field_147481_N) + { + Iterator iterator = this.addedTileEntityList.iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity1 = (TileEntity)iterator.next(); + + if (tileentity1.xCoord == x && tileentity1.yCoord == y && tileentity1.zCoord == z) + { + tileentity1.invalidate(); + iterator.remove(); + } + } + + this.addedTileEntityList.add(tileEntityIn); + } + else + { + this.loadedTileEntityList.add(tileEntityIn); + } + } + Chunk chunk = this.getChunkFromChunkCoords(x >> 4, z >> 4); + if (chunk != null) + { + chunk.func_150812_a(x & 15, y, z & 15, tileEntityIn); + } + //notify tile changes + func_147453_f(x, y, z, getBlock(x, y, z)); + } + + public void removeTileEntity(int x, int y, int z) + { + Chunk chunk = getChunkFromChunkCoords(x >> 4, z >> 4); + if (chunk != null) chunk.removeTileEntity(x & 15, y, z & 15); + func_147453_f(x, y, z, getBlock(x, y, z)); + } + + public void func_147457_a(TileEntity tileEntityIn) + { + this.field_147483_b.add(tileEntityIn); + } + + public boolean func_147469_q(int x, int y, int z) + { + AxisAlignedBB axisalignedbb = this.getBlock(x, y, z).getCollisionBoundingBoxFromPool(this, x, y, z); + return axisalignedbb != null && axisalignedbb.getAverageEdgeLength() >= 1.0D; + } + + /** + * Returns true if the block at the given coordinate has a solid (buildable) top surface. + */ + public static boolean doesBlockHaveSolidTopSurface(IBlockAccess worldIn, int x, int y, int z) + { + Block block = worldIn.getBlock(x, y, z); + return block.isSideSolid(worldIn, x, y, z, ForgeDirection.UP); + } + + /** + * Checks if the block is a solid, normal cube. If the chunk does not exist, or is not loaded, it returns the + * boolean parameter + */ + public boolean isBlockNormalCubeDefault(int x, int y, int z, boolean def) + { + if (x >= -30000000 && z >= -30000000 && x < 30000000 && z < 30000000) + { + Chunk chunk = this.chunkProvider.provideChunk(x >> 4, z >> 4); + + if (chunk != null && !chunk.isEmpty()) + { + Block block = this.getBlock(x, y, z); + return block.isNormalCube(this, x, y, z); + } + else + { + return def; + } + } + else + { + return def; + } + } + + /** + * Called on construction of the World class to setup the initial skylight values + */ + public void calculateInitialSkylight() + { + int i = this.calculateSkylightSubtracted(1.0F); + + if (i != this.skylightSubtracted) + { + this.skylightSubtracted = i; + } + } + + /** + * Set which types of mobs are allowed to spawn (peaceful vs hostile). + */ + public void setAllowedSpawnTypes(boolean hostile, boolean peaceful) + { + provider.setAllowedSpawnTypes(hostile, peaceful); + } + + /** + * Runs a single tick for the world + */ + public void tick() + { + this.updateWeather(); + } + + /** + * Called from World constructor to set rainingStrength and thunderingStrength + */ + private void calculateInitialWeather() + { + provider.calculateInitialWeather(); + } + + public void calculateInitialWeatherBody() + { + if (this.worldInfo.isRaining()) + { + this.rainingStrength = 1.0F; + + if (this.worldInfo.isThundering()) + { + this.thunderingStrength = 1.0F; + } + } + } + + /** + * Updates all weather states. + */ + protected void updateWeather() + { + provider.updateWeather(); + } + + public void updateWeatherBody() + { + if (!this.provider.hasNoSky) + { + if (!this.isRemote) + { + int i = this.worldInfo.getThunderTime(); + + if (i <= 0) + { + if (this.worldInfo.isThundering()) + { + this.worldInfo.setThunderTime(this.rand.nextInt(12000) + 3600); + } + else + { + this.worldInfo.setThunderTime(this.rand.nextInt(168000) + 12000); + } + } + else + { + --i; + this.worldInfo.setThunderTime(i); + + if (i <= 0) + { + this.worldInfo.setThundering(!this.worldInfo.isThundering()); + } + } + + this.prevThunderingStrength = this.thunderingStrength; + + if (this.worldInfo.isThundering()) + { + this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D); + } + else + { + this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D); + } + + this.thunderingStrength = MathHelper.clamp_float(this.thunderingStrength, 0.0F, 1.0F); + int j = this.worldInfo.getRainTime(); + + if (j <= 0) + { + if (this.worldInfo.isRaining()) + { + this.worldInfo.setRainTime(this.rand.nextInt(12000) + 12000); + } + else + { + this.worldInfo.setRainTime(this.rand.nextInt(168000) + 12000); + } + } + else + { + --j; + this.worldInfo.setRainTime(j); + + if (j <= 0) + { + this.worldInfo.setRaining(!this.worldInfo.isRaining()); + } + } + + this.prevRainingStrength = this.rainingStrength; + + if (this.worldInfo.isRaining()) + { + this.rainingStrength = (float)((double)this.rainingStrength + 0.01D); + } + else + { + this.rainingStrength = (float)((double)this.rainingStrength - 0.01D); + } + + this.rainingStrength = MathHelper.clamp_float(this.rainingStrength, 0.0F, 1.0F); + } + } + } + + protected void setActivePlayerChunksAndCheckLight() + { + this.activeChunkSet.clear(); + this.theProfiler.startSection("buildList"); + this.activeChunkSet.addAll(getPersistentChunks().keySet()); + int i; + EntityPlayer entityplayer; + int j; + int k; + int l; + + for (i = 0; i < this.playerEntities.size(); ++i) + { + entityplayer = (EntityPlayer)this.playerEntities.get(i); + j = MathHelper.floor_double(entityplayer.posX / 16.0D); + k = MathHelper.floor_double(entityplayer.posZ / 16.0D); + l = this.func_152379_p(); + + for (int i1 = -l; i1 <= l; ++i1) + { + for (int j1 = -l; j1 <= l; ++j1) + { + this.activeChunkSet.add(new ChunkCoordIntPair(i1 + j, j1 + k)); + } + } + } + + this.theProfiler.endSection(); + + if (this.ambientTickCountdown > 0) + { + --this.ambientTickCountdown; + } + + this.theProfiler.startSection("playerCheckLight"); + + if (!this.playerEntities.isEmpty()) + { + i = this.rand.nextInt(this.playerEntities.size()); + entityplayer = (EntityPlayer)this.playerEntities.get(i); + j = MathHelper.floor_double(entityplayer.posX) + this.rand.nextInt(11) - 5; + k = MathHelper.floor_double(entityplayer.posY) + this.rand.nextInt(11) - 5; + l = MathHelper.floor_double(entityplayer.posZ) + this.rand.nextInt(11) - 5; + this.func_147451_t(j, k, l); + } + + this.theProfiler.endSection(); + } + + protected abstract int func_152379_p(); + + protected void func_147467_a(int p_147467_1_, int p_147467_2_, Chunk p_147467_3_) + { + this.theProfiler.endStartSection("moodSound"); + + if (this.ambientTickCountdown == 0 && !this.isRemote) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int k = this.updateLCG >> 2; + int l = k & 15; + int i1 = k >> 8 & 15; + int j1 = k >> 16 & 255; + Block block = p_147467_3_.getBlock(l, j1, i1); + l += p_147467_1_; + i1 += p_147467_2_; + + if (block.getMaterial() == Material.air && this.getFullBlockLightValue(l, j1, i1) <= this.rand.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, l, j1, i1) <= 0) + { + EntityPlayer entityplayer = this.getClosestPlayer((double)l + 0.5D, (double)j1 + 0.5D, (double)i1 + 0.5D, 8.0D); + + if (entityplayer != null && entityplayer.getDistanceSq((double)l + 0.5D, (double)j1 + 0.5D, (double)i1 + 0.5D) > 4.0D) + { + this.playSoundEffect((double)l + 0.5D, (double)j1 + 0.5D, (double)i1 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); + this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; + } + } + } + + this.theProfiler.endStartSection("checkLight"); + p_147467_3_.enqueueRelightChecks(); + } + + protected void func_147456_g() + { + this.setActivePlayerChunksAndCheckLight(); + } + + /** + * checks to see if a given block is both water and is cold enough to freeze + */ + public boolean isBlockFreezable(int x, int y, int z) + { + return this.canBlockFreeze(x, y, z, false); + } + + /** + * checks to see if a given block is both water and has at least one immediately adjacent non-water block + */ + public boolean isBlockFreezableNaturally(int x, int y, int z) + { + return this.canBlockFreeze(x, y, z, true); + } + + /** + * checks to see if a given block is both water, and cold enough to freeze - if the par4 boolean is set, this will + * only return true if there is a non-water block immediately adjacent to the specified block + */ + public boolean canBlockFreeze(int x, int y, int z, boolean byWater) + { + return provider.canBlockFreeze(x, y, z, byWater); + } + + public boolean canBlockFreezeBody(int x, int y, int z, boolean byWater) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(x, z); + float f = biomegenbase.getFloatTemperature(x, y, z); + + if (f > 0.15F) + { + return false; + } + else + { + if (y >= 0 && y < 256 && this.getSavedLightValue(EnumSkyBlock.Block, x, y, z) < 10) + { + Block block = this.getBlock(x, y, z); + + if ((block == Blocks.water || block == Blocks.flowing_water) && this.getBlockMetadata(x, y, z) == 0) + { + if (!byWater) + { + return true; + } + + boolean flag1 = true; + + if (flag1 && this.getBlock(x - 1, y, z).getMaterial() != Material.water) + { + flag1 = false; + } + + if (flag1 && this.getBlock(x + 1, y, z).getMaterial() != Material.water) + { + flag1 = false; + } + + if (flag1 && this.getBlock(x, y, z - 1).getMaterial() != Material.water) + { + flag1 = false; + } + + if (flag1 && this.getBlock(x, y, z + 1).getMaterial() != Material.water) + { + flag1 = false; + } + + if (!flag1) + { + return true; + } + } + } + + return false; + } + } + + public boolean func_147478_e(int x, int y, int z, boolean checkLight) + { + return provider.canSnowAt(x, y, z, checkLight); + } + + public boolean canSnowAtBody(int x, int y, int z, boolean checkLight) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(x, z); + float f = biomegenbase.getFloatTemperature(x, y, z); + + if (f > 0.15F) + { + return false; + } + else if (!checkLight) + { + return true; + } + else + { + if (y >= 0 && y < 256 && this.getSavedLightValue(EnumSkyBlock.Block, x, y, z) < 10) + { + Block block = this.getBlock(x, y, z); + + if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, x, y, z)) + { + return true; + } + } + + return false; + } + } + + public boolean func_147451_t(int x, int y, int z) + { + boolean flag = false; + + if (!this.provider.hasNoSky) + { + flag |= this.updateLightByType(EnumSkyBlock.Sky, x, y, z); + } + + flag |= this.updateLightByType(EnumSkyBlock.Block, x, y, z); + return flag; + } + + private int computeLightValue(int x, int y, int z, EnumSkyBlock p_98179_4_) + { + if (p_98179_4_ == EnumSkyBlock.Sky && this.canBlockSeeTheSky(x, y, z)) + { + return 15; + } + else + { + Block block = this.getBlock(x, y, z); + int blockLight = block.getLightValue(this, x, y, z); + int l = p_98179_4_ == EnumSkyBlock.Sky ? 0 : blockLight; + int i1 = block.getLightOpacity(this, x, y, z); + + if (i1 >= 15 && blockLight > 0) + { + i1 = 1; + } + + if (i1 < 1) + { + i1 = 1; + } + + if (i1 >= 15) + { + return 0; + } + else if (l >= 14) + { + return l; + } + else + { + for (int j1 = 0; j1 < 6; ++j1) + { + int k1 = x + Facing.offsetsXForSide[j1]; + int l1 = y + Facing.offsetsYForSide[j1]; + int i2 = z + Facing.offsetsZForSide[j1]; + int j2 = this.getSavedLightValue(p_98179_4_, k1, l1, i2) - i1; + + if (j2 > l) + { + l = j2; + } + + if (l >= 14) + { + return l; + } + } + + return l; + } + } + } + + public boolean updateLightByType(EnumSkyBlock p_147463_1_, int p_147463_2_, int p_147463_3_, int p_147463_4_) + { + if (!this.doChunksNearChunkExist(p_147463_2_, p_147463_3_, p_147463_4_, 17)) + { + return false; + } + else + { + int l = 0; + int i1 = 0; + this.theProfiler.startSection("getBrightness"); + int j1 = this.getSavedLightValue(p_147463_1_, p_147463_2_, p_147463_3_, p_147463_4_); + int k1 = this.computeLightValue(p_147463_2_, p_147463_3_, p_147463_4_, p_147463_1_); + int l1; + int i2; + int j2; + int k2; + int l2; + int i3; + int j3; + int k3; + int l3; + + if (k1 > j1) + { + this.lightUpdateBlockList[i1++] = 133152; + } + else if (k1 < j1) + { + this.lightUpdateBlockList[i1++] = 133152 | j1 << 18; + + while (l < i1) + { + l1 = this.lightUpdateBlockList[l++]; + i2 = (l1 & 63) - 32 + p_147463_2_; + j2 = (l1 >> 6 & 63) - 32 + p_147463_3_; + k2 = (l1 >> 12 & 63) - 32 + p_147463_4_; + l2 = l1 >> 18 & 15; + i3 = this.getSavedLightValue(p_147463_1_, i2, j2, k2); + + if (i3 == l2) + { + this.setLightValue(p_147463_1_, i2, j2, k2, 0); + + if (l2 > 0) + { + j3 = MathHelper.abs_int(i2 - p_147463_2_); + k3 = MathHelper.abs_int(j2 - p_147463_3_); + l3 = MathHelper.abs_int(k2 - p_147463_4_); + + if (j3 + k3 + l3 < 17) + { + for (int i4 = 0; i4 < 6; ++i4) + { + int j4 = i2 + Facing.offsetsXForSide[i4]; + int k4 = j2 + Facing.offsetsYForSide[i4]; + int l4 = k2 + Facing.offsetsZForSide[i4]; + int i5 = Math.max(1, this.getBlock(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); + i3 = this.getSavedLightValue(p_147463_1_, j4, k4, l4); + + if (i3 == l2 - i5 && i1 < this.lightUpdateBlockList.length) + { + this.lightUpdateBlockList[i1++] = j4 - p_147463_2_ + 32 | k4 - p_147463_3_ + 32 << 6 | l4 - p_147463_4_ + 32 << 12 | l2 - i5 << 18; + } + } + } + } + } + } + + l = 0; + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("checkedPosition < toCheckCount"); + + while (l < i1) + { + l1 = this.lightUpdateBlockList[l++]; + i2 = (l1 & 63) - 32 + p_147463_2_; + j2 = (l1 >> 6 & 63) - 32 + p_147463_3_; + k2 = (l1 >> 12 & 63) - 32 + p_147463_4_; + l2 = this.getSavedLightValue(p_147463_1_, i2, j2, k2); + i3 = this.computeLightValue(i2, j2, k2, p_147463_1_); + + if (i3 != l2) + { + this.setLightValue(p_147463_1_, i2, j2, k2, i3); + + if (i3 > l2) + { + j3 = Math.abs(i2 - p_147463_2_); + k3 = Math.abs(j2 - p_147463_3_); + l3 = Math.abs(k2 - p_147463_4_); + boolean flag = i1 < this.lightUpdateBlockList.length - 6; + + if (j3 + k3 + l3 < 17 && flag) + { + if (this.getSavedLightValue(p_147463_1_, i2 - 1, j2, k2) < i3) + { + this.lightUpdateBlockList[i1++] = i2 - 1 - p_147463_2_ + 32 + (j2 - p_147463_3_ + 32 << 6) + (k2 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, i2 + 1, j2, k2) < i3) + { + this.lightUpdateBlockList[i1++] = i2 + 1 - p_147463_2_ + 32 + (j2 - p_147463_3_ + 32 << 6) + (k2 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, i2, j2 - 1, k2) < i3) + { + this.lightUpdateBlockList[i1++] = i2 - p_147463_2_ + 32 + (j2 - 1 - p_147463_3_ + 32 << 6) + (k2 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, i2, j2 + 1, k2) < i3) + { + this.lightUpdateBlockList[i1++] = i2 - p_147463_2_ + 32 + (j2 + 1 - p_147463_3_ + 32 << 6) + (k2 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, i2, j2, k2 - 1) < i3) + { + this.lightUpdateBlockList[i1++] = i2 - p_147463_2_ + 32 + (j2 - p_147463_3_ + 32 << 6) + (k2 - 1 - p_147463_4_ + 32 << 12); + } + + if (this.getSavedLightValue(p_147463_1_, i2, j2, k2 + 1) < i3) + { + this.lightUpdateBlockList[i1++] = i2 - p_147463_2_ + 32 + (j2 - p_147463_3_ + 32 << 6) + (k2 + 1 - p_147463_4_ + 32 << 12); + } + } + } + } + } + + this.theProfiler.endSection(); + return true; + } + } + + /** + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean p_72955_1_) + { + return false; + } + + public List getPendingBlockUpdates(Chunk p_72920_1_, boolean p_72920_2_) + { + return null; + } + + /** + * Will get all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb + */ + public List getEntitiesWithinAABBExcludingEntity(Entity p_72839_1_, AxisAlignedBB p_72839_2_) + { + return this.getEntitiesWithinAABBExcludingEntity(p_72839_1_, p_72839_2_, (IEntitySelector)null); + } + + public List getEntitiesWithinAABBExcludingEntity(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) + { + ArrayList arraylist = new ArrayList(); + int i = MathHelper.floor_double((p_94576_2_.minX - MAX_ENTITY_RADIUS) / 16.0D); + int j = MathHelper.floor_double((p_94576_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D); + int k = MathHelper.floor_double((p_94576_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D); + int l = MathHelper.floor_double((p_94576_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D); + + for (int i1 = i; i1 <= j; ++i1) + { + for (int j1 = k; j1 <= l; ++j1) + { + if (this.chunkExists(i1, j1)) + { + this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(p_94576_1_, p_94576_2_, arraylist, p_94576_3_); + } + } + } + + return arraylist; + } + + /** + * Returns all entities of the specified class type which intersect with the AABB. Args: entityClass, aabb + */ + public List getEntitiesWithinAABB(Class p_72872_1_, AxisAlignedBB p_72872_2_) + { + return this.selectEntitiesWithinAABB(p_72872_1_, p_72872_2_, (IEntitySelector)null); + } + + public List selectEntitiesWithinAABB(Class clazz, AxisAlignedBB bb, IEntitySelector selector) + { + int i = MathHelper.floor_double((bb.minX - MAX_ENTITY_RADIUS) / 16.0D); + int j = MathHelper.floor_double((bb.maxX + MAX_ENTITY_RADIUS) / 16.0D); + int k = MathHelper.floor_double((bb.minZ - MAX_ENTITY_RADIUS) / 16.0D); + int l = MathHelper.floor_double((bb.maxZ + MAX_ENTITY_RADIUS) / 16.0D); + ArrayList arraylist = new ArrayList(); + + for (int i1 = i; i1 <= j; ++i1) + { + for (int j1 = k; j1 <= l; ++j1) + { + if (this.chunkExists(i1, j1)) + { + this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(clazz, bb, arraylist, selector); + } + } + } + + return arraylist; + } + + public Entity findNearestEntityWithinAABB(Class p_72857_1_, AxisAlignedBB p_72857_2_, Entity p_72857_3_) + { + List list = this.getEntitiesWithinAABB(p_72857_1_, p_72857_2_); + Entity entity1 = null; + double d0 = Double.MAX_VALUE; + + for (int i = 0; i < list.size(); ++i) + { + Entity entity2 = (Entity)list.get(i); + + if (entity2 != p_72857_3_) + { + double d1 = p_72857_3_.getDistanceSqToEntity(entity2); + + if (d1 <= d0) + { + entity1 = entity2; + d0 = d1; + } + } + } + + return entity1; + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public abstract Entity getEntityByID(int p_73045_1_); + + /** + * Accessor for world Loaded Entity List + */ + @SideOnly(Side.CLIENT) + public List getLoadedEntityList() + { + return this.loadedEntityList; + } + + /** + * Args: X, Y, Z, tile entity Marks the chunk the tile entity is in as modified. This is essential as chunks that + * are not marked as modified may be rolled back when exiting the game. + */ + public void markTileEntityChunkModified(int p_147476_1_, int p_147476_2_, int p_147476_3_, TileEntity p_147476_4_) + { + if (this.blockExists(p_147476_1_, p_147476_2_, p_147476_3_)) + { + this.getChunkFromBlockCoords(p_147476_1_, p_147476_3_).setChunkModified(); + } + } + + /** + * Counts how many entities of an entity class exist in the world. Args: entityClass + */ + public int countEntities(Class p_72907_1_) + { + int i = 0; + + for (int j = 0; j < this.loadedEntityList.size(); ++j) + { + Entity entity = (Entity)this.loadedEntityList.get(j); + + if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(entity.getClass())) + { + ++i; + } + } + + return i; + } + + /** + * adds entities to the loaded entities list, and loads thier skins. + */ + public void addLoadedEntities(List p_72868_1_) + { + for (int i = 0; i < p_72868_1_.size(); ++i) + { + Entity entity = (Entity)p_72868_1_.get(i); + if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) + { + loadedEntityList.add(entity); + this.onEntityAdded(entity); + } + } + } + + /** + * Adds a list of entities to be unloaded on the next pass of World.updateEntities() + */ + public void unloadEntities(List p_72828_1_) + { + this.unloadedEntityList.addAll(p_72828_1_); + } + + /** + * Returns true if the given Entity can be placed on the given side of the given block position. + */ + public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_) + { + Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); + AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.getCollisionBoundingBoxFromPool(this, p_147472_2_, p_147472_3_, p_147472_4_); + return axisalignedbb != null && !this.checkNoEntityCollision(axisalignedbb, p_147472_7_) ? false : (block1.getMaterial() == Material.circuits && p_147472_1_ == Blocks.anvil ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.canReplace(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); + } + + public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) + { + this.theProfiler.startSection("pathfind"); + int i = MathHelper.floor_double(p_72865_1_.posX); + int j = MathHelper.floor_double(p_72865_1_.posY + 1.0D); + int k = MathHelper.floor_double(p_72865_1_.posZ); + int l = (int)(p_72865_3_ + 16.0F); + int i1 = i - l; + int j1 = j - l; + int k1 = k - l; + int l1 = i + l; + int i2 = j + l; + int j2 = k + l; + ChunkCache chunkcache = new ChunkCache(this, i1, j1, k1, l1, i2, j2, 0); + PathEntity pathentity = (new PathFinder(chunkcache, p_72865_4_, p_72865_5_, p_72865_6_, p_72865_7_)).createEntityPathTo(p_72865_1_, p_72865_2_, p_72865_3_); + this.theProfiler.endSection(); + return pathentity; + } + + public PathEntity getEntityPathToXYZ(Entity p_72844_1_, int p_72844_2_, int p_72844_3_, int p_72844_4_, float p_72844_5_, boolean p_72844_6_, boolean p_72844_7_, boolean p_72844_8_, boolean p_72844_9_) + { + this.theProfiler.startSection("pathfind"); + int l = MathHelper.floor_double(p_72844_1_.posX); + int i1 = MathHelper.floor_double(p_72844_1_.posY); + int j1 = MathHelper.floor_double(p_72844_1_.posZ); + int k1 = (int)(p_72844_5_ + 8.0F); + int l1 = l - k1; + int i2 = i1 - k1; + int j2 = j1 - k1; + int k2 = l + k1; + int l2 = i1 + k1; + int i3 = j1 + k1; + ChunkCache chunkcache = new ChunkCache(this, l1, i2, j2, k2, l2, i3, 0); + PathEntity pathentity = (new PathFinder(chunkcache, p_72844_6_, p_72844_7_, p_72844_8_, p_72844_9_)).createEntityPathTo(p_72844_1_, p_72844_2_, p_72844_3_, p_72844_4_, p_72844_5_); + this.theProfiler.endSection(); + return pathentity; + } + + /** + * Is this block powering in the specified direction Args: x, y, z, direction + */ + public int isBlockProvidingPowerTo(int x, int y, int z, int directionIn) + { + return this.getBlock(x, y, z).isProvidingStrongPower(this, x, y, z, directionIn); + } + + /** + * Returns the highest redstone signal strength powering the given block. Args: X, Y, Z. + */ + public int getBlockPowerInput(int x, int y, int z) + { + byte b0 = 0; + int l = Math.max(b0, this.isBlockProvidingPowerTo(x, y - 1, z, 0)); + + if (l >= 15) + { + return l; + } + else + { + l = Math.max(l, this.isBlockProvidingPowerTo(x, y + 1, z, 1)); + + if (l >= 15) + { + return l; + } + else + { + l = Math.max(l, this.isBlockProvidingPowerTo(x, y, z - 1, 2)); + + if (l >= 15) + { + return l; + } + else + { + l = Math.max(l, this.isBlockProvidingPowerTo(x, y, z + 1, 3)); + + if (l >= 15) + { + return l; + } + else + { + l = Math.max(l, this.isBlockProvidingPowerTo(x - 1, y, z, 4)); + + if (l >= 15) + { + return l; + } + else + { + l = Math.max(l, this.isBlockProvidingPowerTo(x + 1, y, z, 5)); + return l >= 15 ? l : l; + } + } + } + } + } + } + + /** + * Returns the indirect signal strength being outputted by the given block in the *opposite* of the given direction. + * Args: X, Y, Z, direction + */ + public boolean getIndirectPowerOutput(int x, int y, int z, int directionIn) + { + return this.getIndirectPowerLevelTo(x, y, z, directionIn) > 0; + } + + /** + * Gets the power level from a certain block face. Args: x, y, z, direction + */ + public int getIndirectPowerLevelTo(int x, int y, int z, int directionIn) + { + Block block = this.getBlock(x, y, z); + return block.shouldCheckWeakPower(this, x, y, z, directionIn) ? this.getBlockPowerInput(x, y, z) : block.isProvidingWeakPower(this, x, y, z, directionIn); + } + + /** + * Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by + * items like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z + */ + public boolean isBlockIndirectlyGettingPowered(int x, int y, int z) + { + return this.getIndirectPowerLevelTo(x, y - 1, z, 0) > 0 ? true : (this.getIndirectPowerLevelTo(x, y + 1, z, 1) > 0 ? true : (this.getIndirectPowerLevelTo(x, y, z - 1, 2) > 0 ? true : (this.getIndirectPowerLevelTo(x, y, z + 1, 3) > 0 ? true : (this.getIndirectPowerLevelTo(x - 1, y, z, 4) > 0 ? true : this.getIndirectPowerLevelTo(x + 1, y, z, 5) > 0)))); + } + + public int getStrongestIndirectPower(int x, int y, int z) + { + int l = 0; + + for (int i1 = 0; i1 < 6; ++i1) + { + int j1 = this.getIndirectPowerLevelTo(x + Facing.offsetsXForSide[i1], y + Facing.offsetsYForSide[i1], z + Facing.offsetsZForSide[i1], i1); + + if (j1 >= 15) + { + return 15; + } + + if (j1 > l) + { + l = j1; + } + } + + return l; + } + + /** + * Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored). + * Args: entity, dist + */ + public EntityPlayer getClosestPlayerToEntity(Entity entityIn, double distance) + { + return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); + } + + /** + * Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not + * limit the distance). Args: x, y, z, dist + */ + public EntityPlayer getClosestPlayer(double x, double y, double z, double distance) + { + double d4 = -1.0D; + EntityPlayer entityplayer = null; + + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); + double d5 = entityplayer1.getDistanceSq(x, y, z); + + if ((distance < 0.0D || d5 < distance * distance) && (d4 == -1.0D || d5 < d4)) + { + d4 = d5; + entityplayer = entityplayer1; + } + } + + return entityplayer; + } + + /** + * Returns the closest vulnerable player to this entity within the given radius, or null if none is found + */ + public EntityPlayer getClosestVulnerablePlayerToEntity(Entity entityIn, double distance) + { + return this.getClosestVulnerablePlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); + } + + /** + * Returns the closest vulnerable player within the given radius, or null if none is found. + */ + public EntityPlayer getClosestVulnerablePlayer(double p_72846_1_, double p_72846_3_, double p_72846_5_, double p_72846_7_) + { + double d4 = -1.0D; + EntityPlayer entityplayer = null; + + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); + + if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive()) + { + double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); + double d6 = p_72846_7_; + + if (entityplayer1.isSneaking()) + { + d6 = p_72846_7_ * 0.800000011920929D; + } + + if (entityplayer1.isInvisible()) + { + float f = entityplayer1.getArmorVisibility(); + + if (f < 0.1F) + { + f = 0.1F; + } + + d6 *= (double)(0.7F * f); + } + + if ((p_72846_7_ < 0.0D || d5 < d6 * d6) && (d4 == -1.0D || d5 < d4)) + { + d4 = d5; + entityplayer = entityplayer1; + } + } + } + + return entityplayer; + } + + /** + * Find a player by name in this world. + */ + public EntityPlayer getPlayerEntityByName(String name) + { + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + + if (name.equals(entityplayer.getCommandSenderName())) + { + return entityplayer; + } + } + + return null; + } + + public EntityPlayer func_152378_a(UUID uuid) + { + for (int i = 0; i < this.playerEntities.size(); ++i) + { + EntityPlayer entityplayer = (EntityPlayer)this.playerEntities.get(i); + + if (uuid.equals(entityplayer.getUniqueID())) + { + return entityplayer; + } + } + + return null; + } + + /** + * If on MP, sends a quitting packet. + */ + @SideOnly(Side.CLIENT) + public void sendQuittingDisconnectingPacket() {} + + /** + * Checks whether the session lock file was modified by another process + */ + public void checkSessionLock() throws MinecraftException + { + this.saveHandler.checkSessionLock(); + } + + @SideOnly(Side.CLIENT) + public void func_82738_a(long p_82738_1_) + { + this.worldInfo.incrementTotalWorldTime(p_82738_1_); + } + + /** + * Retrieve the world seed from level.dat + */ + public long getSeed() + { + return provider.getSeed(); + } + + public long getTotalWorldTime() + { + return this.worldInfo.getWorldTotalTime(); + } + + public long getWorldTime() + { + return provider.getWorldTime(); + } + + /** + * Sets the world time. + */ + public void setWorldTime(long time) + { + provider.setWorldTime(time); + } + + /** + * Returns the coordinates of the spawn point + */ + public ChunkCoordinates getSpawnPoint() + { + return provider.getSpawnPoint(); + } + + public void setSpawnLocation(int p_72950_1_, int p_72950_2_, int p_72950_3_) + { + provider.setSpawnPoint(p_72950_1_, p_72950_2_, p_72950_3_); + } + + /** + * spwans an entity and loads surrounding chunks + */ + @SideOnly(Side.CLIENT) + public void joinEntityInSurroundings(Entity entityIn) + { + int i = MathHelper.floor_double(entityIn.posX / 16.0D); + int j = MathHelper.floor_double(entityIn.posZ / 16.0D); + byte b0 = 2; + + for (int k = i - b0; k <= i + b0; ++k) + { + for (int l = j - b0; l <= j + b0; ++l) + { + this.getChunkFromChunkCoords(k, l); + } + } + + if (!this.loadedEntityList.contains(entityIn)) + { + if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entityIn, this))) + { + this.loadedEntityList.add(entityIn); + } + } + } + + /** + * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. + */ + public boolean canMineBlock(EntityPlayer player, int x, int y, int z) + { + return provider.canMineBlock(player, x, y, z); + } + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) + { + return true; + } + + /** + * sends a Packet 38 (Entity Status) to all tracked players of that entity + */ + public void setEntityState(Entity entityIn, byte p_72960_2_) {} + + /** + * gets the IChunkProvider this world uses. + */ + public IChunkProvider getChunkProvider() + { + return this.chunkProvider; + } + + /** + * Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will + * have its onBlockEvent handler called with the given parameters. Args: X,Y,Z, Block, EventID, EventParameter + */ + public void addBlockEvent(int x, int y, int z, Block blockIn, int eventId, int eventParameter) + { + blockIn.onBlockEventReceived(this, x, y, z, eventId, eventParameter); + } + + /** + * Returns this world's current save handler + */ + public ISaveHandler getSaveHandler() + { + return this.saveHandler; + } + + /** + * Gets the World's WorldInfo instance + */ + public WorldInfo getWorldInfo() + { + return this.worldInfo; + } + + /** + * Gets the GameRules instance. + */ + public GameRules getGameRules() + { + return this.worldInfo.getGameRulesInstance(); + } + + /** + * Updates the flag that indicates whether or not all players in the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() {} + + public float getWeightedThunderStrength(float p_72819_1_) + { + return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); + } + + /** + * Sets the strength of the thunder. + */ + @SideOnly(Side.CLIENT) + public void setThunderStrength(float p_147442_1_) + { + this.prevThunderingStrength = p_147442_1_; + this.thunderingStrength = p_147442_1_; + } + + /** + * Not sure about this actually. Reverting this one myself. + */ + public float getRainStrength(float p_72867_1_) + { + return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * p_72867_1_; + } + + /** + * Sets the strength of the rain. + */ + @SideOnly(Side.CLIENT) + public void setRainStrength(float strength) + { + this.prevRainingStrength = strength; + this.rainingStrength = strength; + } + + /** + * Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9 + */ + public boolean isThundering() + { + return (double)this.getWeightedThunderStrength(1.0F) > 0.9D; + } + + /** + * Returns true if the current rain strength is greater than 0.2 + */ + public boolean isRaining() + { + return (double)this.getRainStrength(1.0F) > 0.2D; + } + + public boolean canLightningStrikeAt(int x, int y, int z) + { + if (!this.isRaining()) + { + return false; + } + else if (!this.canBlockSeeTheSky(x, y, z)) + { + return false; + } + else if (this.getPrecipitationHeight(x, z) > y) + { + return false; + } + else + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(x, z); + return biomegenbase.getEnableSnow() ? false : (this.func_147478_e(x, y, z, false) ? false : biomegenbase.canSpawnLightningBolt()); + } + } + + /** + * Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high + */ + public boolean isBlockHighHumidity(int x, int y, int z) + { + return provider.isBlockHighHumidity(x, y, z); + } + + /** + * Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same + * id. + */ + public void setItemData(String p_72823_1_, WorldSavedData p_72823_2_) + { + this.mapStorage.setData(p_72823_1_, p_72823_2_); + } + + /** + * Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating + * the given Class, or returns null if none such file exists. args: Class to instantiate, String dataid + */ + public WorldSavedData loadItemData(Class p_72943_1_, String p_72943_2_) + { + return this.mapStorage.loadData(p_72943_1_, p_72943_2_); + } + + /** + * Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the + * 'idcounts' file. + */ + public int getUniqueDataId(String p_72841_1_) + { + return this.mapStorage.getUniqueDataId(p_72841_1_); + } + + public void playBroadcastSound(int p_82739_1_, int p_82739_2_, int p_82739_3_, int p_82739_4_, int p_82739_5_) + { + for (int j1 = 0; j1 < this.worldAccesses.size(); ++j1) + { + ((IWorldAccess)this.worldAccesses.get(j1)).broadcastSound(p_82739_1_, p_82739_2_, p_82739_3_, p_82739_4_, p_82739_5_); + } + } + + /** + * See description for func_72706_a. + */ + public void playAuxSFX(int p_72926_1_, int x, int y, int z, int p_72926_5_) + { + this.playAuxSFXAtEntity((EntityPlayer)null, p_72926_1_, x, y, z, p_72926_5_); + } + + /** + * See description for playAuxSFX. + */ + public void playAuxSFXAtEntity(EntityPlayer player, int p_72889_2_, int x, int y, int z, int p_72889_6_) + { + try + { + for (int j1 = 0; j1 < this.worldAccesses.size(); ++j1) + { + ((IWorldAccess)this.worldAccesses.get(j1)).playAuxSFX(player, p_72889_2_, x, y, z, p_72889_6_); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Playing level event"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Level event being played"); + crashreportcategory.addCrashSection("Block coordinates", CrashReportCategory.getLocationInfo(x, y, z)); + crashreportcategory.addCrashSection("Event source", player); + crashreportcategory.addCrashSection("Event type", Integer.valueOf(p_72889_2_)); + crashreportcategory.addCrashSection("Event data", Integer.valueOf(p_72889_6_)); + throw new ReportedException(crashreport); + } + } + + /** + * Returns current world height. + */ + public int getHeight() + { + return provider.getHeight(); + } + + /** + * Returns current world height. + */ + public int getActualHeight() + { + return provider.getActualHeight(); + } + + /** + * puts the World Random seed to a specific state dependant on the inputs + */ + public Random setRandomSeed(int p_72843_1_, int p_72843_2_, int p_72843_3_) + { + long l = (long)p_72843_1_ * 341873128712L + (long)p_72843_2_ * 132897987541L + this.getWorldInfo().getSeed() + (long)p_72843_3_; + this.rand.setSeed(l); + return this.rand; + } + + /** + * Returns the location of the closest structure of the specified type. If not found returns null. + */ + public ChunkPosition findClosestStructure(String type, int x, int y, int z) + { + return this.getChunkProvider().func_147416_a(this, type, x, y, z); + } + + /** + * set by !chunk.getAreLevelsEmpty + */ + @SideOnly(Side.CLIENT) + public boolean extendedLevelsInChunkCache() + { + return false; + } + + /** + * Returns horizon height for use in rendering the sky. + */ + @SideOnly(Side.CLIENT) + public double getHorizon() + { + return provider.getHorizon(); + } + + /** + * Adds some basic stats of the world to the given crash report. + */ + public CrashReportCategory addWorldInfoToCrashReport(CrashReport report) + { + CrashReportCategory crashreportcategory = report.makeCategoryDepth("Affected level", 1); + crashreportcategory.addCrashSection("Level name", this.worldInfo == null ? "????" : this.worldInfo.getWorldName()); + crashreportcategory.addCrashSectionCallable("All players", new Callable() + { + private static final String __OBFID = "CL_00000143"; + public String call() + { + return World.this.playerEntities.size() + " total; " + World.this.playerEntities.toString(); + } + }); + crashreportcategory.addCrashSectionCallable("Chunk stats", new Callable() + { + private static final String __OBFID = "CL_00000144"; + public String call() + { + return World.this.chunkProvider.makeString(); + } + }); + + try + { + this.worldInfo.addToCrashReport(crashreportcategory); + } + catch (Throwable throwable) + { + crashreportcategory.addCrashSectionThrowable("Level Data Unobtainable", throwable); + } + + return crashreportcategory; + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + public void destroyBlockInWorldPartially(int p_147443_1_, int x, int y, int z, int blockDamage) + { + for (int j1 = 0; j1 < this.worldAccesses.size(); ++j1) + { + IWorldAccess iworldaccess = (IWorldAccess)this.worldAccesses.get(j1); + iworldaccess.destroyBlockPartially(p_147443_1_, x, y, z, blockDamage); + } + } + + /** + * returns a calendar object containing the current date + */ + public Calendar getCurrentDate() + { + if (this.getTotalWorldTime() % 600L == 0L) + { + this.theCalendar.setTimeInMillis(MinecraftServer.getSystemTimeMillis()); + } + + return this.theCalendar; + } + + @SideOnly(Side.CLIENT) + public void makeFireworks(double x, double y, double z, double motionX, double motionY, double motionZ, NBTTagCompound compund) {} + + public Scoreboard getScoreboard() + { + return this.worldScoreboard; + } + + public void func_147453_f(int x, int yPos, int z, Block blockIn) + { + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { + int i1 = x + dir.offsetX; + int y = yPos + dir.offsetY; + int j1 = z + dir.offsetZ; + Block block1 = this.getBlock(i1, y, j1); + + block1.onNeighborChange(this, i1, y, j1, x, yPos, z); + if (block1.isNormalCube(this, i1, y, j1)) + { + i1 += dir.offsetX; + y += dir.offsetY; + j1 += dir.offsetZ; + Block block2 = this.getBlock(i1, y, j1); + + if (block2.getWeakChanges(this, i1, y, j1)) + { + block2.onNeighborChange(this, i1, y, j1, x, yPos, z); + } + } + } + } + + public float func_147462_b(double x, double y, double z) + { + return this.func_147473_B(MathHelper.floor_double(x), MathHelper.floor_double(y), MathHelper.floor_double(z)); + } + + public float func_147473_B(int x, int y, int z) + { + float f = 0.0F; + boolean flag = this.difficultySetting == EnumDifficulty.HARD; + + if (this.blockExists(x, y, z)) + { + float f1 = this.getCurrentMoonPhaseFactor(); + f += MathHelper.clamp_float((float)this.getChunkFromBlockCoords(x, z).inhabitedTime / 3600000.0F, 0.0F, 1.0F) * (flag ? 1.0F : 0.75F); + f += f1 * 0.25F; + } + + if (this.difficultySetting == EnumDifficulty.EASY || this.difficultySetting == EnumDifficulty.PEACEFUL) + { + f *= (float)this.difficultySetting.getDifficultyId() / 2.0F; + } + + return MathHelper.clamp_float(f, 0.0F, flag ? 1.5F : 1.0F); + } + + public void func_147450_X() + { + Iterator iterator = this.worldAccesses.iterator(); + + while (iterator.hasNext()) + { + IWorldAccess iworldaccess = (IWorldAccess)iterator.next(); + iworldaccess.onStaticEntitiesChanged(); + } + } + + + /* ======================================== FORGE START =====================================*/ + /** + * Adds a single TileEntity to the world. + * @param entity The TileEntity to be added. + */ + public void addTileEntity(TileEntity entity) + { + List dest = field_147481_N ? addedTileEntityList : loadedTileEntityList; + if(entity.canUpdate()) + { + dest.add(entity); + } + } + + /** + * Determine if the given block is considered solid on the + * specified side. Used by placement logic. + * + * @param x Block X Position + * @param y Block Y Position + * @param z Block Z Position + * @param side The Side in question + * @return True if the side is solid + */ + public boolean isSideSolid(int x, int y, int z, ForgeDirection side) + { + return isSideSolid(x, y, z, side, false); + } + + /** + * Determine if the given block is considered solid on the + * specified side. Used by placement logic. + * + * @param x Block X Position + * @param y Block Y Position + * @param z Block Z Position + * @param side The Side in question + * @param _default The default to return if the block doesn't exist. + * @return True if the side is solid + */ + @Override + public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) + { + if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) + { + return _default; + } + + Chunk chunk = this.chunkProvider.provideChunk(x >> 4, z >> 4); + if (chunk == null || chunk.isEmpty()) + { + return _default; + } + return getBlock(x, y, z).isSideSolid(this, x, y, z, side); + } + + /** + * Get the persistent chunks for this world + * + * @return + */ + public ImmutableSetMultimap getPersistentChunks() + { + return ForgeChunkManager.getPersistentChunksFor(this); + } + + /** + * Readded as it was removed, very useful helper function + * + * @param x X position + * @param y Y Position + * @param z Z Position + * @return The blocks light opacity + */ + public int getBlockLightOpacity(int x, int y, int z) + { + if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) + { + return 0; + } + + if (y < 0 || y >= 256) + { + return 0; + } + + return getChunkFromChunkCoords(x >> 4, z >> 4).func_150808_b(x & 15, y, z & 15); + } + + /** + * Returns a count of entities that classify themselves as the specified creature type. + */ + public int countEntities(EnumCreatureType type, boolean forSpawnCount) + { + int count = 0; + for (int x = 0; x < loadedEntityList.size(); x++) + { + if (((Entity)loadedEntityList.get(x)).isCreatureType(type, forSpawnCount)) + { + count++; + } + } + return count; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldManager.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldManager.java new file mode 100644 index 0000000..de6fd6a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldManager.java @@ -0,0 +1,130 @@ +package net.minecraft.world; + +import java.util.Iterator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.server.S25PacketBlockBreakAnim; +import net.minecraft.network.play.server.S28PacketEffect; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import net.minecraft.server.MinecraftServer; + +public class WorldManager implements IWorldAccess +{ + /** Reference to the MinecraftServer object. */ + private MinecraftServer mcServer; + /** The WorldServer object. */ + private WorldServer theWorldServer; + private static final String __OBFID = "CL_00001433"; + + public WorldManager(MinecraftServer p_i1517_1_, WorldServer p_i1517_2_) + { + this.mcServer = p_i1517_1_; + this.theWorldServer = p_i1517_2_; + } + + /** + * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ + */ + public void spawnParticle(String p_72708_1_, double p_72708_2_, double p_72708_4_, double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_) {} + + /** + * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any + * necessary textures. On server worlds, adds the entity to the entity tracker. + */ + public void onEntityCreate(Entity p_72703_1_) + { + this.theWorldServer.getEntityTracker().addEntityToTracker(p_72703_1_); + } + + /** + * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded + * textures. On server worlds, removes the entity from the entity tracker. + */ + public void onEntityDestroy(Entity p_72709_1_) + { + this.theWorldServer.getEntityTracker().removeEntityFromAllTrackingPlayers(p_72709_1_); + } + + /** + * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch + */ + public void playSound(String soundName, double x, double y, double z, float volume, float pitch) + { + this.mcServer.getConfigurationManager().sendToAllNear(x, y, z, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.theWorldServer.provider.dimensionId, new S29PacketSoundEffect(soundName, x, y, z, volume, pitch)); + } + + /** + * Plays sound to all near players except the player reference given + */ + public void playSoundToNearExcept(EntityPlayer p_85102_1_, String p_85102_2_, double p_85102_3_, double p_85102_5_, double p_85102_7_, float p_85102_9_, float p_85102_10_) + { + this.mcServer.getConfigurationManager().sendToAllNearExcept(p_85102_1_, p_85102_3_, p_85102_5_, p_85102_7_, p_85102_9_ > 1.0F ? (double)(16.0F * p_85102_9_) : 16.0D, this.theWorldServer.provider.dimensionId, new S29PacketSoundEffect(p_85102_2_, p_85102_3_, p_85102_5_, p_85102_7_, p_85102_9_, p_85102_10_)); + } + + /** + * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, + * min z, max x, max y, max z + */ + public void markBlockRangeForRenderUpdate(int p_147585_1_, int p_147585_2_, int p_147585_3_, int p_147585_4_, int p_147585_5_, int p_147585_6_) {} + + /** + * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), + * including the tile entity description packet if applicable. Args: x, y, z + */ + public void markBlockForUpdate(int p_147586_1_, int p_147586_2_, int p_147586_3_) + { + this.theWorldServer.getPlayerManager().markBlockForUpdate(p_147586_1_, p_147586_2_, p_147586_3_); + } + + /** + * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. + */ + public void markBlockForRenderUpdate(int p_147588_1_, int p_147588_2_, int p_147588_3_) {} + + /** + * Plays the specified record. Arg: recordName, x, y, z + */ + public void playRecord(String p_72702_1_, int p_72702_2_, int p_72702_3_, int p_72702_4_) {} + + /** + * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). + */ + public void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_) + { + this.mcServer.getConfigurationManager().sendToAllNearExcept(p_72706_1_, (double)p_72706_3_, (double)p_72706_4_, (double)p_72706_5_, 64.0D, this.theWorldServer.provider.dimensionId, new S28PacketEffect(p_72706_2_, p_72706_3_, p_72706_4_, p_72706_5_, p_72706_6_, false)); + } + + public void broadcastSound(int p_82746_1_, int p_82746_2_, int p_82746_3_, int p_82746_4_, int p_82746_5_) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new S28PacketEffect(p_82746_1_, p_82746_2_, p_82746_3_, p_82746_4_, p_82746_5_, true)); + } + + /** + * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed + * value + */ + public void destroyBlockPartially(int p_147587_1_, int p_147587_2_, int p_147587_3_, int p_147587_4_, int p_147587_5_) + { + Iterator iterator = this.mcServer.getConfigurationManager().playerEntityList.iterator(); + + while (iterator.hasNext()) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)iterator.next(); + + if (entityplayermp != null && entityplayermp.worldObj == this.theWorldServer && entityplayermp.getEntityId() != p_147587_1_) + { + double d0 = (double)p_147587_2_ - entityplayermp.posX; + double d1 = (double)p_147587_3_ - entityplayermp.posY; + double d2 = (double)p_147587_4_ - entityplayermp.posZ; + + if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) + { + entityplayermp.playerNetServerHandler.sendPacket(new S25PacketBlockBreakAnim(p_147587_1_, p_147587_2_, p_147587_3_, p_147587_4_, p_147587_5_)); + } + } + } + } + + public void onStaticEntitiesChanged() {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldProvider.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProvider.java new file mode 100644 index 0000000..de49167 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProvider.java @@ -0,0 +1,578 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderFlat; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.client.IRenderHandler; +import net.minecraftforge.common.DimensionManager; + +public abstract class WorldProvider +{ + public static final float[] moonPhaseFactors = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; + /** world object being used */ + public World worldObj; + public WorldType terrainType; + public String field_82913_c; + /** World chunk manager being used to generate chunks */ + public WorldChunkManager worldChunkMgr; + /** States whether the Hell world provider is used(true) or if the normal world provider is used(false) */ + public boolean isHellWorld; + /** A boolean that tells if a world does not have a sky. Used in calculating weather and skylight */ + public boolean hasNoSky; + /** Light to brightness conversion table */ + public float[] lightBrightnessTable = new float[16]; + /** The id for the dimension (ex. -1: Nether, 0: Overworld, 1: The End) */ + public int dimensionId; + /** Array for sunrise/sunset colors (RGBA) */ + private float[] colorsSunriseSunset = new float[4]; + private static final String __OBFID = "CL_00000386"; + + /** + * associate an existing world with a World provider, and setup its lightbrightness table + */ + public final void registerWorld(World p_76558_1_) + { + this.worldObj = p_76558_1_; + this.terrainType = p_76558_1_.getWorldInfo().getTerrainType(); + this.field_82913_c = p_76558_1_.getWorldInfo().getGeneratorOptions(); + this.registerWorldChunkManager(); + this.generateLightBrightnessTable(); + } + + /** + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() + { + float f = 0.0F; + + for (int i = 0; i <= 15; ++i) + { + float f1 = 1.0F - (float)i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + } + + /** + * creates a new world chunk manager for WorldProvider + */ + protected void registerWorldChunkManager() + { + this.worldChunkMgr = terrainType.getChunkManager(worldObj); + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() + { + return terrainType.getChunkGenerator(worldObj, field_82913_c); + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) + { + return this.worldObj.getTopBlock(p_76566_1_, p_76566_2_) == Blocks.grass; + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) + { + int j = (int)(p_76563_1_ % 24000L); + float f1 = ((float)j + p_76563_3_) / 24000.0F - 0.25F; + + if (f1 < 0.0F) + { + ++f1; + } + + if (f1 > 1.0F) + { + --f1; + } + + float f2 = f1; + f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D); + f1 = f2 + (f1 - f2) / 3.0F; + return f1; + } + + public int getMoonPhase(long p_76559_1_) + { + return (int)(p_76559_1_ / 24000L % 8L + 8L) % 8; + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() + { + return true; + } + + /** + * Returns array with sunrise/sunset colors + */ + @SideOnly(Side.CLIENT) + public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) + { + float f2 = 0.4F; + float f3 = MathHelper.cos(p_76560_1_ * (float)Math.PI * 2.0F) - 0.0F; + float f4 = -0.0F; + + if (f3 >= f4 - f2 && f3 <= f4 + f2) + { + float f5 = (f3 - f4) / f2 * 0.5F + 0.5F; + float f6 = 1.0F - (1.0F - MathHelper.sin(f5 * (float)Math.PI)) * 0.99F; + f6 *= f6; + this.colorsSunriseSunset[0] = f5 * 0.3F + 0.7F; + this.colorsSunriseSunset[1] = f5 * f5 * 0.7F + 0.2F; + this.colorsSunriseSunset[2] = f5 * f5 * 0.0F + 0.2F; + this.colorsSunriseSunset[3] = f6; + return this.colorsSunriseSunset; + } + else + { + return null; + } + } + + /** + * Return Vec3D with biome specific fog color + */ + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + float f2 = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + float f3 = 0.7529412F; + float f4 = 0.84705883F; + float f5 = 1.0F; + f3 *= f2 * 0.94F + 0.06F; + f4 *= f2 * 0.94F + 0.06F; + f5 *= f2 * 0.91F + 0.09F; + return Vec3.createVectorHelper((double)f3, (double)f4, (double)f5); + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() + { + return true; + } + + public static WorldProvider getProviderForDimension(int p_76570_0_) + { + return DimensionManager.createProviderFor(p_76570_0_); + } + + /** + * the y level at which clouds are rendered. + */ + @SideOnly(Side.CLIENT) + public float getCloudHeight() + { + return this.terrainType.getCloudHeight(); + } + + @SideOnly(Side.CLIENT) + public boolean isSkyColored() + { + return true; + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() + { + return null; + } + + public int getAverageGroundLevel() + { + return this.terrainType.getMinimumSpawnHeight(this.worldObj); + } + + /** + * returns true if this dimension is supposed to display void particles and pull in the far plane based on the + * user's Y offset. + */ + @SideOnly(Side.CLIENT) + public boolean getWorldHasVoidParticles() + { + return this.terrainType.hasVoidParticles(this.hasNoSky); + } + + /** + * Returns a double value representing the Y value relative to the top of the map at which void fog is at its + * maximum. The default factor of 0.03125 relative to 256, for example, means the void fog will be at its maximum at + * (256*0.03125), or 8. + */ + @SideOnly(Side.CLIENT) + public double getVoidFogYFactor() + { + return this.terrainType.voidFadeMagnitude(); + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + @SideOnly(Side.CLIENT) + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) + { + return false; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public abstract String getDimensionName(); + + /*======================================= Forge Start =========================================*/ + private IRenderHandler skyRenderer = null; + private IRenderHandler cloudRenderer = null; + private IRenderHandler weatherRenderer = null; + + /** + * Sets the providers current dimension ID, used in default getSaveFolder() + * Added to allow default providers to be registered for multiple dimensions. + * + * @param dim Dimension ID + */ + public void setDimension(int dim) + { + this.dimensionId = dim; + } + + /** + * Returns the sub-folder of the world folder that this WorldProvider saves to. + * EXA: DIM1, DIM-1 + * @return The sub-folder name to save this world's chunks to. + */ + public String getSaveFolder() + { + return (dimensionId == 0 ? null : "DIM" + dimensionId); + } + + /** + * A message to display to the user when they transfer to this dimension. + * + * @return The message to be displayed + */ + public String getWelcomeMessage() + { + if (this instanceof WorldProviderEnd) + { + return "Entering the End"; + } + else if (this instanceof WorldProviderHell) + { + return "Entering the Nether"; + } + return null; + } + + /** + * A Message to display to the user when they transfer out of this dismension. + * + * @return The message to be displayed + */ + public String getDepartMessage() + { + if (this instanceof WorldProviderEnd) + { + return "Leaving the End"; + } + else if (this instanceof WorldProviderHell) + { + return "Leaving the Nether"; + } + return null; + } + + /** + * The dimensions movement factor. Relative to normal overworld. + * It is applied to the players position when they transfer dimensions. + * Exa: Nether movement is 8.0 + * @return The movement factor + */ + public double getMovementFactor() + { + if (this instanceof WorldProviderHell) + { + return 8.0; + } + return 1.0; + } + + @SideOnly(Side.CLIENT) + public IRenderHandler getSkyRenderer() + { + return this.skyRenderer; + } + + @SideOnly(Side.CLIENT) + public void setSkyRenderer(IRenderHandler skyRenderer) + { + this.skyRenderer = skyRenderer; + } + + @SideOnly(Side.CLIENT) + public IRenderHandler getCloudRenderer() + { + return cloudRenderer; + } + + @SideOnly(Side.CLIENT) + public void setCloudRenderer(IRenderHandler renderer) + { + cloudRenderer = renderer; + } + + @SideOnly(Side.CLIENT) + public IRenderHandler getWeatherRenderer() + { + return weatherRenderer; + } + + @SideOnly(Side.CLIENT) + public void setWeatherRenderer(IRenderHandler renderer) + { + weatherRenderer = renderer; + } + + public ChunkCoordinates getRandomizedSpawnPoint() + { + ChunkCoordinates chunkcoordinates = new ChunkCoordinates(this.worldObj.getSpawnPoint()); + + boolean isAdventure = worldObj.getWorldInfo().getGameType() == GameType.ADVENTURE; + int spawnFuzz = terrainType.getSpawnFuzz(); + int spawnFuzzHalf = spawnFuzz / 2; + + if (!hasNoSky && !isAdventure && net.minecraftforge.common.ForgeModContainer.defaultHasSpawnFuzz) + { + chunkcoordinates.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; + chunkcoordinates.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; + chunkcoordinates.posY = this.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); + } + + return chunkcoordinates; + } + + /** + * Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether. + * + * @param entity The entity holding the map, playername, or frame-ENTITYID + * @param x X Position + * @param y Y Position + * @param z Z Postion + * @return True to 'spin' the cursor + */ + public boolean shouldMapSpin(String entity, double x, double y, double z) + { + return dimensionId < 0; + } + + /** + * Determines the dimension the player will be respawned in, typically this brings them back to the overworld. + * + * @param player The player that is respawning + * @return The dimension to respawn the player in + */ + public int getRespawnDimension(EntityPlayerMP player) + { + return 0; + } + + /*======================================= Start Moved From World =========================================*/ + + public BiomeGenBase getBiomeGenForCoords(int x, int z) + { + return worldObj.getBiomeGenForCoordsBody(x, z); + } + + public boolean isDaytime() + { + return worldObj.skylightSubtracted < 4; + } + + /** + * The current sun brightness factor for this dimension. + * 0.0f means no light at all, and 1.0f means maximum sunlight. + * This will be used for the "calculateSkylightSubtracted" + * which is for Sky light value calculation. + * + * @return The current brightness factor + * */ + public float getSunBrightnessFactor(float par1) + { + return worldObj.getSunBrightnessFactor(par1); + } + + /** + * Calculates the current moon phase factor. + * This factor is effective for slimes. + * (This method do not affect the moon rendering) + * */ + public float getCurrentMoonPhaseFactor() + { + return worldObj.getCurrentMoonPhaseFactorBody(); + } + + @SideOnly(Side.CLIENT) + public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) + { + return worldObj.getSkyColorBody(cameraEntity, partialTicks); + } + + @SideOnly(Side.CLIENT) + public Vec3 drawClouds(float partialTicks) + { + return worldObj.drawCloudsBody(partialTicks); + } + + /** + * Gets the Sun Brightness for rendering sky. + * */ + @SideOnly(Side.CLIENT) + public float getSunBrightness(float par1) + { + return worldObj.getSunBrightnessBody(par1); + } + + /** + * Gets the Star Brightness for rendering sky. + * */ + @SideOnly(Side.CLIENT) + public float getStarBrightness(float par1) + { + return worldObj.getStarBrightnessBody(par1); + } + + public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) + { + worldObj.spawnHostileMobs = allowHostile; + worldObj.spawnPeacefulMobs = allowPeaceful; + } + + public void calculateInitialWeather() + { + worldObj.calculateInitialWeatherBody(); + } + + public void updateWeather() + { + worldObj.updateWeatherBody(); + } + + public boolean canBlockFreeze(int x, int y, int z, boolean byWater) + { + return worldObj.canBlockFreezeBody(x, y, z, byWater); + } + + public boolean canSnowAt(int x, int y, int z, boolean checkLight) + { + return worldObj.canSnowAtBody(x, y, z, checkLight); + } + + public void setWorldTime(long time) + { + worldObj.worldInfo.setWorldTime(time); + } + + public long getSeed() + { + return worldObj.worldInfo.getSeed(); + } + + public long getWorldTime() + { + return worldObj.worldInfo.getWorldTime(); + } + + public ChunkCoordinates getSpawnPoint() + { + WorldInfo info = worldObj.worldInfo; + return new ChunkCoordinates(info.getSpawnX(), info.getSpawnY(), info.getSpawnZ()); + } + + public void setSpawnPoint(int x, int y, int z) + { + worldObj.worldInfo.setSpawnPosition(x, y, z); + } + + public boolean canMineBlock(EntityPlayer player, int x, int y, int z) + { + return worldObj.canMineBlockBody(player, x, y, z); + } + + public boolean isBlockHighHumidity(int x, int y, int z) + { + return worldObj.getBiomeGenForCoords(x, z).isHighHumidity(); + } + + public int getHeight() + { + return 256; + } + + public int getActualHeight() + { + return hasNoSky ? 128 : 256; + } + + public double getHorizon() + { + return worldObj.worldInfo.getTerrainType().getHorizon(worldObj); + } + + public void resetRainAndThunder() + { + worldObj.worldInfo.setRainTime(0); + worldObj.worldInfo.setRaining(false); + worldObj.worldInfo.setThunderTime(0); + worldObj.worldInfo.setThundering(false); + } + + public boolean canDoLightning(Chunk chunk) + { + return true; + } + + public boolean canDoRainSnowIce(Chunk chunk) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderEnd.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderEnd.java new file mode 100644 index 0000000..c64fb67 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderEnd.java @@ -0,0 +1,148 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderEnd; + +public class WorldProviderEnd extends WorldProvider +{ + private static final String __OBFID = "CL_00000389"; + + /** + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() + { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F); + this.dimensionId = 1; + this.hasNoSky = true; + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() + { + return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) + { + return 0.0F; + } + + /** + * Returns array with sunrise/sunset colors + */ + @SideOnly(Side.CLIENT) + public float[] calcSunriseSunsetColors(float p_76560_1_, float p_76560_2_) + { + return null; + } + + /** + * Return Vec3D with biome specific fog color + */ + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + int i = 10518688; + float f2 = MathHelper.cos(p_76562_1_ * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + float f3 = (float)(i >> 16 & 255) / 255.0F; + float f4 = (float)(i >> 8 & 255) / 255.0F; + float f5 = (float)(i & 255) / 255.0F; + f3 *= f2 * 0.0F + 0.15F; + f4 *= f2 * 0.0F + 0.15F; + f5 *= f2 * 0.0F + 0.15F; + return Vec3.createVectorHelper((double)f3, (double)f4, (double)f5); + } + + @SideOnly(Side.CLIENT) + public boolean isSkyColored() + { + return false; + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() + { + return false; + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() + { + return false; + } + + /** + * the y level at which clouds are rendered. + */ + @SideOnly(Side.CLIENT) + public float getCloudHeight() + { + return 8.0F; + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) + { + return this.worldObj.getTopBlock(p_76566_1_, p_76566_2_).getMaterial().blocksMovement(); + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() + { + return new ChunkCoordinates(100, 50, 0); + } + + public int getAverageGroundLevel() + { + return 50; + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + @SideOnly(Side.CLIENT) + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) + { + return true; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() + { + return "The End"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderHell.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderHell.java new file mode 100644 index 0000000..864a544 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderHell.java @@ -0,0 +1,105 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderHell; + +public class WorldProviderHell extends WorldProvider +{ + private static final String __OBFID = "CL_00000387"; + + /** + * creates a new world chunk manager for WorldProvider + */ + public void registerWorldChunkManager() + { + this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F); + this.isHellWorld = true; + this.hasNoSky = true; + this.dimensionId = -1; + } + + /** + * Return Vec3D with biome specific fog color + */ + @SideOnly(Side.CLIENT) + public Vec3 getFogColor(float p_76562_1_, float p_76562_2_) + { + return Vec3.createVectorHelper(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D); + } + + /** + * Creates the light to brightness table + */ + protected void generateLightBrightnessTable() + { + float f = 0.1F; + + for (int i = 0; i <= 15; ++i) + { + float f1 = 1.0F - (float)i / 15.0F; + this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f; + } + } + + /** + * Returns a new chunk provider which generates chunks for this world + */ + public IChunkProvider createChunkGenerator() + { + return new ChunkProviderHell(this.worldObj, this.worldObj.getSeed()); + } + + /** + * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. + */ + public boolean isSurfaceWorld() + { + return false; + } + + /** + * Will check if the x, z position specified is alright to be set as the map spawn point + */ + public boolean canCoordinateBeSpawn(int p_76566_1_, int p_76566_2_) + { + return false; + } + + /** + * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) + */ + public float calculateCelestialAngle(long p_76563_1_, float p_76563_3_) + { + return 0.5F; + } + + /** + * True if the player can respawn in this dimension (true = overworld, false = nether). + */ + public boolean canRespawnHere() + { + return false; + } + + /** + * Returns true if the given X,Z coordinate should show environmental fog. + */ + @SideOnly(Side.CLIENT) + public boolean doesXZShowFog(int p_76568_1_, int p_76568_2_) + { + return true; + } + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() + { + return "Nether"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderSurface.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderSurface.java new file mode 100644 index 0000000..643a811 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldProviderSurface.java @@ -0,0 +1,14 @@ +package net.minecraft.world; + +public class WorldProviderSurface extends WorldProvider +{ + private static final String __OBFID = "CL_00000388"; + + /** + * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". + */ + public String getDimensionName() + { + return "Overworld"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldSavedData.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldSavedData.java new file mode 100644 index 0000000..87753d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldSavedData.java @@ -0,0 +1,51 @@ +package net.minecraft.world; + +import net.minecraft.nbt.NBTTagCompound; + +public abstract class WorldSavedData +{ + /** The name of the map data nbt */ + public final String mapName; + /** Whether this MapDataBase needs saving to disk. */ + private boolean dirty; + private static final String __OBFID = "CL_00000580"; + + public WorldSavedData(String p_i2141_1_) + { + this.mapName = p_i2141_1_; + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public abstract void readFromNBT(NBTTagCompound p_76184_1_); + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public abstract void writeToNBT(NBTTagCompound p_76187_1_); + + /** + * Marks this MapDataBase dirty, to be saved to disk when the level next saves. + */ + public void markDirty() + { + this.setDirty(true); + } + + /** + * Sets the dirty state of this MapDataBase, whether it needs saving to disk. + */ + public void setDirty(boolean p_76186_1_) + { + this.dirty = p_76186_1_; + } + + /** + * Whether this MapDataBase needs saving to disk. + */ + public boolean isDirty() + { + return this.dirty; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldServer.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldServer.java new file mode 100644 index 0000000..54c1f09 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldServer.java @@ -0,0 +1,1157 @@ +package net.minecraft.world; + +import com.google.common.collect.Lists; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import net.minecraft.block.Block; +import net.minecraft.block.BlockEventData; +import net.minecraft.block.material.Material; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityTracker; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.INpc; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityWaterMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.network.play.server.S19PacketEntityStatus; +import net.minecraft.network.play.server.S24PacketBlockAction; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.network.play.server.S2APacketParticles; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity; +import net.minecraft.profiler.Profiler; +import net.minecraft.scoreboard.ScoreboardSaveData; +import net.minecraft.scoreboard.ServerScoreboard; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.management.PlayerManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.IntHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.BONUS_CHEST; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.world.WorldEvent; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class WorldServer extends World +{ + private static final Logger logger = LogManager.getLogger(); + private final MinecraftServer mcServer; + private final EntityTracker theEntityTracker; + private final PlayerManager thePlayerManager; + private Set pendingTickListEntriesHashSet; + /** All work to do in future ticks. */ + private TreeSet pendingTickListEntriesTreeSet; + public ChunkProviderServer theChunkProviderServer; + /** Whether or not level saving is enabled */ + public boolean levelSaving; + /** is false if there are no players */ + private boolean allPlayersSleeping; + private int updateEntityTick; + /** the teleporter to use when the entity is being transferred into the dimension */ + private final Teleporter worldTeleporter; + private final SpawnerAnimals animalSpawner = new SpawnerAnimals(); + private WorldServer.ServerBlockEventList[] field_147490_S = new WorldServer.ServerBlockEventList[] {new WorldServer.ServerBlockEventList(null), new WorldServer.ServerBlockEventList(null)}; + private int blockEventCacheIndex; + public static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.stick, 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.planks), 0, 1, 3, 10), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log), 0, 1, 3, 10), new WeightedRandomChestContent(Items.stone_axe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_axe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.stone_pickaxe, 0, 1, 1, 3), new WeightedRandomChestContent(Items.wooden_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.apple, 0, 2, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 2, 3, 3), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.log2), 0, 1, 3, 10)}; + private List pendingTickListEntriesThisTick = new ArrayList(); + /** An IntHashMap of entity IDs (integers) to their Entity objects. */ + private IntHashMap entityIdMap; + private static final String __OBFID = "CL_00001437"; + + /** Stores the recently processed (lighting) chunks */ + protected Set doneChunks = new HashSet(); + public List customTeleporters = new ArrayList(); + + public WorldServer(MinecraftServer p_i45284_1_, ISaveHandler p_i45284_2_, String p_i45284_3_, int p_i45284_4_, WorldSettings p_i45284_5_, Profiler p_i45284_6_) + { + super(p_i45284_2_, p_i45284_3_, p_i45284_5_, WorldProvider.getProviderForDimension(p_i45284_4_), p_i45284_6_); + this.mcServer = p_i45284_1_; + this.theEntityTracker = new EntityTracker(this); + this.thePlayerManager = new PlayerManager(this); + + if (this.entityIdMap == null) + { + this.entityIdMap = new IntHashMap(); + } + + if (this.pendingTickListEntriesHashSet == null) + { + this.pendingTickListEntriesHashSet = new HashSet(); + } + + if (this.pendingTickListEntriesTreeSet == null) + { + this.pendingTickListEntriesTreeSet = new TreeSet(); + } + + this.worldTeleporter = new Teleporter(this); + this.worldScoreboard = new ServerScoreboard(p_i45284_1_); + ScoreboardSaveData scoreboardsavedata = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard"); + + if (scoreboardsavedata == null) + { + scoreboardsavedata = new ScoreboardSaveData(); + this.mapStorage.setData("scoreboard", scoreboardsavedata); + } + + if (!(this instanceof WorldServerMulti)) //Forge: We fix the global mapStorage, which causes us to share scoreboards early. So don't associate the save data with the temporary scoreboard + { + scoreboardsavedata.func_96499_a(this.worldScoreboard); + } + ((ServerScoreboard)this.worldScoreboard).func_96547_a(scoreboardsavedata); + DimensionManager.setWorld(p_i45284_4_, this); + } + + /** + * Runs a single tick for the world + */ + public void tick() + { + super.tick(); + + if (this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting != EnumDifficulty.HARD) + { + this.difficultySetting = EnumDifficulty.HARD; + } + + this.provider.worldChunkMgr.cleanupCache(); + + if (this.areAllPlayersAsleep()) + { + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) + { + long i = this.worldInfo.getWorldTime() + 24000L; + this.worldInfo.setWorldTime(i - i % 24000L); + } + + this.wakeAllPlayers(); + } + + this.theProfiler.startSection("mobSpawner"); + + if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) + { + this.animalSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L); + } + + this.theProfiler.endStartSection("chunkSource"); + this.chunkProvider.unloadQueuedChunks(); + int j = this.calculateSkylightSubtracted(1.0F); + + if (j != this.skylightSubtracted) + { + this.skylightSubtracted = j; + } + + this.worldInfo.incrementTotalWorldTime(this.worldInfo.getWorldTotalTime() + 1L); + + if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) + { + this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L); + } + + this.theProfiler.endStartSection("tickPending"); + this.tickUpdates(false); + this.theProfiler.endStartSection("tickBlocks"); + this.func_147456_g(); + this.theProfiler.endStartSection("chunkMap"); + this.thePlayerManager.updatePlayerInstances(); + this.theProfiler.endStartSection("village"); + this.villageCollectionObj.tick(); + this.villageSiegeObj.tick(); + this.theProfiler.endStartSection("portalForcer"); + this.worldTeleporter.removeStalePortalLocations(this.getTotalWorldTime()); + for (Teleporter tele : customTeleporters) + { + tele.removeStalePortalLocations(getTotalWorldTime()); + } + this.theProfiler.endSection(); + this.func_147488_Z(); + } + + /** + * only spawns creatures allowed by the chunkProvider + */ + public BiomeGenBase.SpawnListEntry spawnRandomCreature(EnumCreatureType p_73057_1_, int p_73057_2_, int p_73057_3_, int p_73057_4_) + { + List list = this.getChunkProvider().getPossibleCreatures(p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_); + list = ForgeEventFactory.getPotentialSpawns(this, p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_, list); + return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.getRandomItem(this.rand, list) : null; + } + + /** + * Updates the flag that indicates whether or not all players in the world are sleeping. + */ + public void updateAllPlayersSleepingFlag() + { + this.allPlayersSleeping = !this.playerEntities.isEmpty(); + Iterator iterator = this.playerEntities.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (!entityplayer.isPlayerSleeping()) + { + this.allPlayersSleeping = false; + break; + } + } + } + + protected void wakeAllPlayers() + { + this.allPlayersSleeping = false; + Iterator iterator = this.playerEntities.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (entityplayer.isPlayerSleeping()) + { + entityplayer.wakeUpPlayer(false, false, true); + } + } + + this.resetRainAndThunder(); + } + + private void resetRainAndThunder() + { + provider.resetRainAndThunder(); + } + + public boolean areAllPlayersAsleep() + { + if (this.allPlayersSleeping && !this.isRemote) + { + Iterator iterator = this.playerEntities.iterator(); + EntityPlayer entityplayer; + + do + { + if (!iterator.hasNext()) + { + return true; + } + + entityplayer = (EntityPlayer)iterator.next(); + } + while (entityplayer.isPlayerFullyAsleep()); + + return false; + } + else + { + return false; + } + } + + /** + * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. + */ + @SideOnly(Side.CLIENT) + public void setSpawnLocation() + { + if (this.worldInfo.getSpawnY() <= 0) + { + this.worldInfo.setSpawnY(64); + } + + int i = this.worldInfo.getSpawnX(); + int j = this.worldInfo.getSpawnZ(); + int k = 0; + + while (this.getTopBlock(i, j).getMaterial() == Material.air) + { + i += this.rand.nextInt(8) - this.rand.nextInt(8); + j += this.rand.nextInt(8) - this.rand.nextInt(8); + ++k; + + if (k == 10000) + { + break; + } + } + + this.worldInfo.setSpawnX(i); + this.worldInfo.setSpawnZ(j); + } + + protected void func_147456_g() + { + super.func_147456_g(); + int i = 0; + int j = 0; + Iterator iterator = this.activeChunkSet.iterator(); + + while (iterator.hasNext()) + { + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair)iterator.next(); + int k = chunkcoordintpair.chunkXPos * 16; + int l = chunkcoordintpair.chunkZPos * 16; + this.theProfiler.startSection("getChunk"); + Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos); + this.func_147467_a(k, l, chunk); + this.theProfiler.endStartSection("tickChunk"); + chunk.func_150804_b(false); + this.theProfiler.endStartSection("thunder"); + int i1; + int j1; + int k1; + int l1; + + if (provider.canDoLightning(chunk) && this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + i1 = this.updateLCG >> 2; + j1 = k + (i1 & 15); + k1 = l + (i1 >> 8 & 15); + l1 = this.getPrecipitationHeight(j1, k1); + + if (this.canLightningStrikeAt(j1, l1, k1)) + { + this.addWeatherEffect(new EntityLightningBolt(this, (double)j1, (double)l1, (double)k1)); + } + } + + this.theProfiler.endStartSection("iceandsnow"); + + if (provider.canDoRainSnowIce(chunk) && this.rand.nextInt(16) == 0) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + i1 = this.updateLCG >> 2; + j1 = i1 & 15; + k1 = i1 >> 8 & 15; + l1 = this.getPrecipitationHeight(j1 + k, k1 + l); + + if (this.isBlockFreezableNaturally(j1 + k, l1 - 1, k1 + l)) + { + this.setBlock(j1 + k, l1 - 1, k1 + l, Blocks.ice); + } + + if (this.isRaining() && this.func_147478_e(j1 + k, l1, k1 + l, true)) + { + this.setBlock(j1 + k, l1, k1 + l, Blocks.snow_layer); + } + + if (this.isRaining()) + { + BiomeGenBase biomegenbase = this.getBiomeGenForCoords(j1 + k, k1 + l); + + if (biomegenbase.canSpawnLightningBolt()) + { + this.getBlock(j1 + k, l1 - 1, k1 + l).fillWithRain(this, j1 + k, l1 - 1, k1 + l); + } + } + } + + this.theProfiler.endStartSection("tickBlocks"); + ExtendedBlockStorage[] aextendedblockstorage = chunk.getBlockStorageArray(); + j1 = aextendedblockstorage.length; + + for (k1 = 0; k1 < j1; ++k1) + { + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage[k1]; + + if (extendedblockstorage != null && extendedblockstorage.getNeedsRandomTick()) + { + for (int i3 = 0; i3 < 3; ++i3) + { + this.updateLCG = this.updateLCG * 3 + 1013904223; + int i2 = this.updateLCG >> 2; + int j2 = i2 & 15; + int k2 = i2 >> 8 & 15; + int l2 = i2 >> 16 & 15; + ++j; + Block block = extendedblockstorage.getBlockByExtId(j2, l2, k2); + + if (block.getTickRandomly()) + { + ++i; + block.updateTick(this, j2 + k, l2 + extendedblockstorage.getYLocation(), k2 + l, this.rand); + } + } + } + } + + this.theProfiler.endSection(); + } + } + + /** + * Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, Block + */ + public boolean isBlockTickScheduledThisTick(int p_147477_1_, int p_147477_2_, int p_147477_3_, Block p_147477_4_) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(p_147477_1_, p_147477_2_, p_147477_3_, p_147477_4_); + return this.pendingTickListEntriesThisTick.contains(nextticklistentry); + } + + /** + * Schedules a tick to a block with a delay (Most commonly the tick rate) + */ + public void scheduleBlockUpdate(int p_147464_1_, int p_147464_2_, int p_147464_3_, Block p_147464_4_, int p_147464_5_) + { + this.scheduleBlockUpdateWithPriority(p_147464_1_, p_147464_2_, p_147464_3_, p_147464_4_, p_147464_5_, 0); + } + + public void scheduleBlockUpdateWithPriority(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(p_147454_1_, p_147454_2_, p_147454_3_, p_147454_4_); + //Keeping here as a note for future when it may be restored. + //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); + //byte b0 = isForced ? 0 : 8; + byte b0 = 0; + + if (this.scheduledUpdatesAreImmediate && p_147454_4_.getMaterial() != Material.air) + { + if (p_147454_4_.func_149698_L()) + { + b0 = 8; + + if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) + { + Block block1 = this.getBlock(nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord); + + if (block1.getMaterial() != Material.air && block1 == nextticklistentry.func_151351_a()) + { + block1.updateTick(this, nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord, this.rand); + } + } + + return; + } + + p_147454_5_ = 1; + } + + if (this.checkChunksExist(p_147454_1_ - b0, p_147454_2_ - b0, p_147454_3_ - b0, p_147454_1_ + b0, p_147454_2_ + b0, p_147454_3_ + b0)) + { + if (p_147454_4_.getMaterial() != Material.air) + { + nextticklistentry.setScheduledTime((long)p_147454_5_ + this.worldInfo.getWorldTotalTime()); + nextticklistentry.setPriority(p_147454_6_); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) + { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + } + } + + public void func_147446_b(int p_147446_1_, int p_147446_2_, int p_147446_3_, Block p_147446_4_, int p_147446_5_, int p_147446_6_) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(p_147446_1_, p_147446_2_, p_147446_3_, p_147446_4_); + nextticklistentry.setPriority(p_147446_6_); + + if (p_147446_4_.getMaterial() != Material.air) + { + nextticklistentry.setScheduledTime((long)p_147446_5_ + this.worldInfo.getWorldTotalTime()); + } + + if (!this.pendingTickListEntriesHashSet.contains(nextticklistentry)) + { + this.pendingTickListEntriesHashSet.add(nextticklistentry); + this.pendingTickListEntriesTreeSet.add(nextticklistentry); + } + } + + /** + * Updates (and cleans up) entities and tile entities + */ + public void updateEntities() + { + if (this.playerEntities.isEmpty() && getPersistentChunks().isEmpty()) + { + if (this.updateEntityTick++ >= 1200) + { + return; + } + } + else + { + this.resetUpdateEntityTick(); + } + + super.updateEntities(); + } + + /** + * Resets the updateEntityTick field to 0 + */ + public void resetUpdateEntityTick() + { + this.updateEntityTick = 0; + } + + /** + * Runs through the list of updates to run and ticks them + */ + public boolean tickUpdates(boolean p_72955_1_) + { + int i = this.pendingTickListEntriesTreeSet.size(); + + if (i != this.pendingTickListEntriesHashSet.size()) + { + throw new IllegalStateException("TickNextTick list out of synch"); + } + else + { + if (i > 1000) + { + i = 1000; + } + + this.theProfiler.startSection("cleaning"); + NextTickListEntry nextticklistentry; + + for (int j = 0; j < i; ++j) + { + nextticklistentry = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first(); + + if (!p_72955_1_ && nextticklistentry.scheduledTime > this.worldInfo.getWorldTotalTime()) + { + break; + } + + this.pendingTickListEntriesTreeSet.remove(nextticklistentry); + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + this.pendingTickListEntriesThisTick.add(nextticklistentry); + } + + this.theProfiler.endSection(); + this.theProfiler.startSection("ticking"); + Iterator iterator = this.pendingTickListEntriesThisTick.iterator(); + + while (iterator.hasNext()) + { + nextticklistentry = (NextTickListEntry)iterator.next(); + iterator.remove(); + //Keeping here as a note for future when it may be restored. + //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); + //byte b0 = isForced ? 0 : 8; + byte b0 = 0; + + if (this.checkChunksExist(nextticklistentry.xCoord - b0, nextticklistentry.yCoord - b0, nextticklistentry.zCoord - b0, nextticklistentry.xCoord + b0, nextticklistentry.yCoord + b0, nextticklistentry.zCoord + b0)) + { + Block block = this.getBlock(nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord); + + if (block.getMaterial() != Material.air && Block.isEqualTo(block, nextticklistentry.func_151351_a())) + { + try + { + block.updateTick(this, nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord, this.rand); + } + catch (Throwable throwable1) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception while ticking a block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being ticked"); + int k; + + try + { + k = this.getBlockMetadata(nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord); + } + catch (Throwable throwable) + { + k = -1; + } + + CrashReportCategory.func_147153_a(crashreportcategory, nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord, block, k); + throw new ReportedException(crashreport); + } + } + } + else + { + this.scheduleBlockUpdate(nextticklistentry.xCoord, nextticklistentry.yCoord, nextticklistentry.zCoord, nextticklistentry.func_151351_a(), 0); + } + } + + this.theProfiler.endSection(); + this.pendingTickListEntriesThisTick.clear(); + return !this.pendingTickListEntriesTreeSet.isEmpty(); + } + } + + public List getPendingBlockUpdates(Chunk p_72920_1_, boolean p_72920_2_) + { + ArrayList arraylist = null; + ChunkCoordIntPair chunkcoordintpair = p_72920_1_.getChunkCoordIntPair(); + int i = (chunkcoordintpair.chunkXPos << 4) - 2; + int j = i + 16 + 2; + int k = (chunkcoordintpair.chunkZPos << 4) - 2; + int l = k + 16 + 2; + + for (int i1 = 0; i1 < 2; ++i1) + { + Iterator iterator; + + if (i1 == 0) + { + iterator = this.pendingTickListEntriesTreeSet.iterator(); + } + else + { + iterator = this.pendingTickListEntriesThisTick.iterator(); + + if (!this.pendingTickListEntriesThisTick.isEmpty()) + { + logger.debug("toBeTicked = " + this.pendingTickListEntriesThisTick.size()); + } + } + + while (iterator.hasNext()) + { + NextTickListEntry nextticklistentry = (NextTickListEntry)iterator.next(); + + if (nextticklistentry.xCoord >= i && nextticklistentry.xCoord < j && nextticklistentry.zCoord >= k && nextticklistentry.zCoord < l) + { + if (p_72920_2_) + { + this.pendingTickListEntriesHashSet.remove(nextticklistentry); + iterator.remove(); + } + + if (arraylist == null) + { + arraylist = new ArrayList(); + } + + arraylist.add(nextticklistentry); + } + } + } + + return arraylist; + } + + /** + * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. + * Args: entity, forceUpdate + */ + public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) + { + if (!this.mcServer.getCanSpawnAnimals() && (p_72866_1_ instanceof EntityAnimal || p_72866_1_ instanceof EntityWaterMob)) + { + p_72866_1_.setDead(); + } + + if (!this.mcServer.getCanSpawnNPCs() && p_72866_1_ instanceof INpc) + { + p_72866_1_.setDead(); + } + + super.updateEntityWithOptionalForce(p_72866_1_, p_72866_2_); + } + + /** + * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? + */ + protected IChunkProvider createChunkProvider() + { + IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider); + this.theChunkProviderServer = new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator()); + return this.theChunkProviderServer; + } + + public List func_147486_a(int p_147486_1_, int p_147486_2_, int p_147486_3_, int p_147486_4_, int p_147486_5_, int p_147486_6_) + { + ArrayList arraylist = new ArrayList(); + + for(int x = (p_147486_1_ >> 4); x <= (p_147486_4_ >> 4); x++) + { + for(int z = (p_147486_3_ >> 4); z <= (p_147486_6_ >> 4); z++) + { + Chunk chunk = getChunkFromChunkCoords(x, z); + if (chunk != null) + { + for(Object obj : chunk.chunkTileEntityMap.values()) + { + TileEntity entity = (TileEntity)obj; + if (!entity.isInvalid()) + { + if (entity.xCoord >= p_147486_1_ && entity.yCoord >= p_147486_2_ && entity.zCoord >= p_147486_3_ && + entity.xCoord <= p_147486_4_ && entity.yCoord <= p_147486_5_ && entity.zCoord <= p_147486_6_) + { + arraylist.add(entity); + } + } + } + } + } + } + + return arraylist; + } + + /** + * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. + */ + public boolean canMineBlock(EntityPlayer player, int x, int y, int z) + { + return super.canMineBlock(player, x, y, z); + } + + public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) + { + return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer); + } + + protected void initialize(WorldSettings p_72963_1_) + { + if (this.entityIdMap == null) + { + this.entityIdMap = new IntHashMap(); + } + + if (this.pendingTickListEntriesHashSet == null) + { + this.pendingTickListEntriesHashSet = new HashSet(); + } + + if (this.pendingTickListEntriesTreeSet == null) + { + this.pendingTickListEntriesTreeSet = new TreeSet(); + } + + this.createSpawnPosition(p_72963_1_); + super.initialize(p_72963_1_); + } + + /** + * creates a spawn position at random within 256 blocks of 0,0 + */ + protected void createSpawnPosition(WorldSettings p_73052_1_) + { + if (!this.provider.canRespawnHere()) + { + this.worldInfo.setSpawnPosition(0, this.provider.getAverageGroundLevel(), 0); + } + else + { + if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; + this.findingSpawnPoint = true; + WorldChunkManager worldchunkmanager = this.provider.worldChunkMgr; + List list = worldchunkmanager.getBiomesToSpawnIn(); + Random random = new Random(this.getSeed()); + ChunkPosition chunkposition = worldchunkmanager.findBiomePosition(0, 0, 256, list, random); + int i = 0; + int j = this.provider.getAverageGroundLevel(); + int k = 0; + + if (chunkposition != null) + { + i = chunkposition.chunkPosX; + k = chunkposition.chunkPosZ; + } + else + { + logger.warn("Unable to find spawn biome"); + } + + int l = 0; + + while (!this.provider.canCoordinateBeSpawn(i, k)) + { + i += random.nextInt(64) - random.nextInt(64); + k += random.nextInt(64) - random.nextInt(64); + ++l; + + if (l == 1000) + { + break; + } + } + + this.worldInfo.setSpawnPosition(i, j, k); + this.findingSpawnPoint = false; + + if (p_73052_1_.isBonusChestEnabled()) + { + this.createBonusChest(); + } + } + } + + /** + * Creates the bonus chest in the world. + */ + protected void createBonusChest() + { + WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand)); + + for (int i = 0; i < 10; ++i) + { + int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); + int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); + int l = this.getTopSolidOrLiquidBlock(j, k) + 1; + + if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k)) + { + break; + } + } + } + + /** + * Gets the hard-coded portal location to use when entering this dimension. + */ + public ChunkCoordinates getEntrancePortalLocation() + { + return this.provider.getEntrancePortalLocation(); + } + + /** + * Saves all chunks to disk while updating progress bar. + */ + public void saveAllChunks(boolean p_73044_1_, IProgressUpdate p_73044_2_) throws MinecraftException + { + if (this.chunkProvider.canSave()) + { + if (p_73044_2_ != null) + { + p_73044_2_.displayProgressMessage("Saving level"); + } + + this.saveLevel(); + + if (p_73044_2_ != null) + { + p_73044_2_.resetProgresAndWorkingMessage("Saving chunks"); + } + + this.chunkProvider.saveChunks(p_73044_1_, p_73044_2_); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Save(this)); + ArrayList arraylist = Lists.newArrayList(this.theChunkProviderServer.func_152380_a()); + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + Chunk chunk = (Chunk)iterator.next(); + + if (chunk != null && !this.thePlayerManager.func_152621_a(chunk.xPosition, chunk.zPosition)) + { + this.theChunkProviderServer.unloadChunksIfNotNearSpawn(chunk.xPosition, chunk.zPosition); + } + } + } + } + + /** + * saves chunk data - currently only called during execution of the Save All command + */ + public void saveChunkData() + { + if (this.chunkProvider.canSave()) + { + this.chunkProvider.saveExtraData(); + } + } + + /** + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException + { + this.checkSessionLock(); + this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); + this.mapStorage.saveAllData(); + this.perWorldStorage.saveAllData(); + } + + public void onEntityAdded(Entity p_72923_1_) + { + super.onEntityAdded(p_72923_1_); + this.entityIdMap.addKey(p_72923_1_.getEntityId(), p_72923_1_); + Entity[] aentity = p_72923_1_.getParts(); + + if (aentity != null) + { + for (int i = 0; i < aentity.length; ++i) + { + this.entityIdMap.addKey(aentity[i].getEntityId(), aentity[i]); + } + } + } + + public void onEntityRemoved(Entity p_72847_1_) + { + super.onEntityRemoved(p_72847_1_); + this.entityIdMap.removeObject(p_72847_1_.getEntityId()); + Entity[] aentity = p_72847_1_.getParts(); + + if (aentity != null) + { + for (int i = 0; i < aentity.length; ++i) + { + this.entityIdMap.removeObject(aentity[i].getEntityId()); + } + } + } + + /** + * Returns the Entity with the given ID, or null if it doesn't exist in this World. + */ + public Entity getEntityByID(int p_73045_1_) + { + return (Entity)this.entityIdMap.lookup(p_73045_1_); + } + + /** + * adds a lightning bolt to the list of lightning bolts in this world. + */ + public boolean addWeatherEffect(Entity p_72942_1_) + { + if (super.addWeatherEffect(p_72942_1_)) + { + this.mcServer.getConfigurationManager().sendToAllNear(p_72942_1_.posX, p_72942_1_.posY, p_72942_1_.posZ, 512.0D, this.provider.dimensionId, new S2CPacketSpawnGlobalEntity(p_72942_1_)); + return true; + } + else + { + return false; + } + } + + /** + * sends a Packet 38 (Entity Status) to all tracked players of that entity + */ + public void setEntityState(Entity entityIn, byte p_72960_2_) + { + this.getEntityTracker().func_151248_b(entityIn, new S19PacketEntityStatus(entityIn, p_72960_2_)); + } + + /** + * returns a new explosion. Does initiation (at time of writing Explosion is not finished) + */ + public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) + { + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + explosion.isFlaming = p_72885_9_; + explosion.isSmoking = p_72885_10_; + if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.doExplosionA(); + explosion.doExplosionB(false); + + if (!p_72885_10_) + { + explosion.affectedBlockPositions.clear(); + } + + Iterator iterator = this.playerEntities.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer = (EntityPlayer)iterator.next(); + + if (entityplayer.getDistanceSq(p_72885_2_, p_72885_4_, p_72885_6_) < 4096.0D) + { + ((EntityPlayerMP)entityplayer).playerNetServerHandler.sendPacket(new S27PacketExplosion(p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, explosion.affectedBlockPositions, (Vec3)explosion.func_77277_b().get(entityplayer))); + } + } + + return explosion; + } + + /** + * Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will + * have its onBlockEvent handler called with the given parameters. Args: X,Y,Z, Block, EventID, EventParameter + */ + public void addBlockEvent(int x, int y, int z, Block blockIn, int eventId, int eventParameter) + { + BlockEventData blockeventdata = new BlockEventData(x, y, z, blockIn, eventId, eventParameter); + Iterator iterator = this.field_147490_S[this.blockEventCacheIndex].iterator(); + BlockEventData blockeventdata1; + + do + { + if (!iterator.hasNext()) + { + this.field_147490_S[this.blockEventCacheIndex].add(blockeventdata); + return; + } + + blockeventdata1 = (BlockEventData)iterator.next(); + } + while (!blockeventdata1.equals(blockeventdata)); + } + + private void func_147488_Z() + { + while (!this.field_147490_S[this.blockEventCacheIndex].isEmpty()) + { + int i = this.blockEventCacheIndex; + this.blockEventCacheIndex ^= 1; + Iterator iterator = this.field_147490_S[i].iterator(); + + while (iterator.hasNext()) + { + BlockEventData blockeventdata = (BlockEventData)iterator.next(); + + if (this.func_147485_a(blockeventdata)) + { + this.mcServer.getConfigurationManager().sendToAllNear((double)blockeventdata.func_151340_a(), (double)blockeventdata.func_151342_b(), (double)blockeventdata.func_151341_c(), 64.0D, this.provider.dimensionId, new S24PacketBlockAction(blockeventdata.func_151340_a(), blockeventdata.func_151342_b(), blockeventdata.func_151341_c(), blockeventdata.getBlock(), blockeventdata.getEventID(), blockeventdata.getEventParameter())); + } + } + + this.field_147490_S[i].clear(); + } + } + + private boolean func_147485_a(BlockEventData p_147485_1_) + { + Block block = this.getBlock(p_147485_1_.func_151340_a(), p_147485_1_.func_151342_b(), p_147485_1_.func_151341_c()); + return block == p_147485_1_.getBlock() ? block.onBlockEventReceived(this, p_147485_1_.func_151340_a(), p_147485_1_.func_151342_b(), p_147485_1_.func_151341_c(), p_147485_1_.getEventID(), p_147485_1_.getEventParameter()) : false; + } + + /** + * Syncs all changes to disk and wait for completion. + */ + public void flush() + { + this.saveHandler.flush(); + } + + /** + * Updates all weather states. + */ + protected void updateWeather() + { + boolean flag = this.isRaining(); + super.updateWeather(); + + if (this.prevRainingStrength != this.rainingStrength) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); + } + + if (this.prevThunderingStrength != this.thunderingStrength) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); + } + + /*The function in use here has been replaced in order to only send the weather info to players in the correct dimension, + rather than to all players on the server. This is what causes the client-side rain, as the + client believes that it has started raining locally, rather than in another dimension. + */ + if (flag != this.isRaining()) + { + if (flag) + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(2, 0.0F), this.provider.dimensionId); + } + else + { + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(1, 0.0F), this.provider.dimensionId); + } + + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId); + this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId); + } + } + + protected int func_152379_p() + { + return this.mcServer.getConfigurationManager().getViewDistance(); + } + + public MinecraftServer func_73046_m() + { + return this.mcServer; + } + + /** + * Gets the EntityTracker + */ + public EntityTracker getEntityTracker() + { + return this.theEntityTracker; + } + + public PlayerManager getPlayerManager() + { + return this.thePlayerManager; + } + + public Teleporter getDefaultTeleporter() + { + return this.worldTeleporter; + } + + public void func_147487_a(String p_147487_1_, double p_147487_2_, double p_147487_4_, double p_147487_6_, int p_147487_8_, double p_147487_9_, double p_147487_11_, double p_147487_13_, double p_147487_15_) + { + S2APacketParticles s2apacketparticles = new S2APacketParticles(p_147487_1_, (float)p_147487_2_, (float)p_147487_4_, (float)p_147487_6_, (float)p_147487_9_, (float)p_147487_11_, (float)p_147487_13_, (float)p_147487_15_, p_147487_8_); + + for (int j = 0; j < this.playerEntities.size(); ++j) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntities.get(j); + ChunkCoordinates chunkcoordinates = entityplayermp.getPlayerCoordinates(); + double d7 = p_147487_2_ - (double)chunkcoordinates.posX; + double d8 = p_147487_4_ - (double)chunkcoordinates.posY; + double d9 = p_147487_6_ - (double)chunkcoordinates.posZ; + double d10 = d7 * d7 + d8 * d8 + d9 * d9; + + if (d10 <= 256.0D) + { + entityplayermp.playerNetServerHandler.sendPacket(s2apacketparticles); + } + } + } + + public File getChunkSaveLocation() + { + return ((AnvilChunkLoader)theChunkProviderServer.currentChunkLoader).chunkSaveLocation; + } + + static class ServerBlockEventList extends ArrayList + { + private static final String __OBFID = "CL_00001439"; + + private ServerBlockEventList() {} + + ServerBlockEventList(Object p_i1521_1_) + { + this(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldServerMulti.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldServerMulti.java new file mode 100644 index 0000000..de01af8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldServerMulti.java @@ -0,0 +1,27 @@ +package net.minecraft.world; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.storage.DerivedWorldInfo; +import net.minecraft.world.storage.ISaveHandler; + +public class WorldServerMulti extends WorldServer +{ + private static final String __OBFID = "CL_00001430"; + + public WorldServerMulti(MinecraftServer p_i45283_1_, ISaveHandler p_i45283_2_, String p_i45283_3_, int p_i45283_4_, WorldSettings p_i45283_5_, WorldServer p_i45283_6_, Profiler p_i45283_7_) + { + super(p_i45283_1_, p_i45283_2_, p_i45283_3_, p_i45283_4_, p_i45283_5_, p_i45283_7_); + this.mapStorage = p_i45283_6_.mapStorage; + this.worldScoreboard = p_i45283_6_.getScoreboard(); + this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); + } + + /** + * Saves the chunks to disk. + */ + protected void saveLevel() throws MinecraftException + { + this.perWorldStorage.saveAllData(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldSettings.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldSettings.java new file mode 100644 index 0000000..c1f5cb0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldSettings.java @@ -0,0 +1,255 @@ +package net.minecraft.world; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.world.storage.WorldInfo; + +public final class WorldSettings +{ + /** The seed for the map. */ + private final long seed; + /** The EnumGameType. */ + private final WorldSettings.GameType theGameType; + /** Switch for the map features. 'true' for enabled, 'false' for disabled. */ + private final boolean mapFeaturesEnabled; + /** True if hardcore mode is enabled */ + private final boolean hardcoreEnabled; + private final WorldType terrainType; + /** True if Commands (cheats) are allowed. */ + private boolean commandsAllowed; + /** True if the Bonus Chest is enabled. */ + private boolean bonusChestEnabled; + private String field_82751_h; + private static final String __OBFID = "CL_00000147"; + + public WorldSettings(long p_i1957_1_, WorldSettings.GameType p_i1957_3_, boolean p_i1957_4_, boolean p_i1957_5_, WorldType p_i1957_6_) + { + this.field_82751_h = ""; + this.seed = p_i1957_1_; + this.theGameType = p_i1957_3_; + this.mapFeaturesEnabled = p_i1957_4_; + this.hardcoreEnabled = p_i1957_5_; + this.terrainType = p_i1957_6_; + } + + public WorldSettings(WorldInfo p_i1958_1_) + { + this(p_i1958_1_.getSeed(), p_i1958_1_.getGameType(), p_i1958_1_.isMapFeaturesEnabled(), p_i1958_1_.isHardcoreModeEnabled(), p_i1958_1_.getTerrainType()); + } + + /** + * Enables the bonus chest. + */ + public WorldSettings enableBonusChest() + { + this.bonusChestEnabled = true; + return this; + } + + public WorldSettings func_82750_a(String p_82750_1_) + { + this.field_82751_h = p_82750_1_; + return this; + } + + /** + * Enables Commands (cheats). + */ + @SideOnly(Side.CLIENT) + public WorldSettings enableCommands() + { + this.commandsAllowed = true; + return this; + } + + /** + * Returns true if the Bonus Chest is enabled. + */ + public boolean isBonusChestEnabled() + { + return this.bonusChestEnabled; + } + + /** + * Returns the seed for the world. + */ + public long getSeed() + { + return this.seed; + } + + /** + * Gets the game type. + */ + public WorldSettings.GameType getGameType() + { + return this.theGameType; + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean getHardcoreEnabled() + { + return this.hardcoreEnabled; + } + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() + { + return this.mapFeaturesEnabled; + } + + public WorldType getTerrainType() + { + return this.terrainType; + } + + /** + * Returns true if Commands (cheats) are allowed. + */ + public boolean areCommandsAllowed() + { + return this.commandsAllowed; + } + + /** + * Gets the GameType by ID + */ + public static WorldSettings.GameType getGameTypeById(int p_77161_0_) + { + return WorldSettings.GameType.getByID(p_77161_0_); + } + + public String func_82749_j() + { + return this.field_82751_h; + } + + public static enum GameType + { + NOT_SET(-1, ""), + SURVIVAL(0, "survival"), + CREATIVE(1, "creative"), + ADVENTURE(2, "adventure"); + int id; + String name; + + private static final String __OBFID = "CL_00000148"; + + private GameType(int p_i1956_3_, String p_i1956_4_) + { + this.id = p_i1956_3_; + this.name = p_i1956_4_; + } + + /** + * Returns the ID of this game type + */ + public int getID() + { + return this.id; + } + + /** + * Returns the name of this game type + */ + public String getName() + { + return this.name; + } + + /** + * Configures the player capabilities based on the game type + */ + public void configurePlayerCapabilities(PlayerCapabilities p_77147_1_) + { + if (this == CREATIVE) + { + p_77147_1_.allowFlying = true; + p_77147_1_.isCreativeMode = true; + p_77147_1_.disableDamage = true; + } + else + { + p_77147_1_.allowFlying = false; + p_77147_1_.isCreativeMode = false; + p_77147_1_.disableDamage = false; + p_77147_1_.isFlying = false; + } + + p_77147_1_.allowEdit = !this.isAdventure(); + } + + /** + * Returns true if this is the ADVENTURE game type + */ + public boolean isAdventure() + { + return this == ADVENTURE; + } + + /** + * Returns true if this is the CREATIVE game type + */ + public boolean isCreative() + { + return this == CREATIVE; + } + + /** + * Returns true if this is the SURVIVAL or ADVENTURE game type + */ + @SideOnly(Side.CLIENT) + public boolean isSurvivalOrAdventure() + { + return this == SURVIVAL || this == ADVENTURE; + } + + /** + * Returns the game type with the specified ID, or SURVIVAL if none found. Args: id + */ + public static WorldSettings.GameType getByID(int p_77146_0_) + { + WorldSettings.GameType[] agametype = values(); + int j = agametype.length; + + for (int k = 0; k < j; ++k) + { + WorldSettings.GameType gametype = agametype[k]; + + if (gametype.id == p_77146_0_) + { + return gametype; + } + } + + return SURVIVAL; + } + + /** + * Returns the game type with the specified name, or SURVIVAL if none found. This is case sensitive. Args: name + */ + @SideOnly(Side.CLIENT) + public static WorldSettings.GameType getByName(String p_77142_0_) + { + WorldSettings.GameType[] agametype = values(); + int i = agametype.length; + + for (int j = 0; j < i; ++j) + { + WorldSettings.GameType gametype = agametype[j]; + + if (gametype.name.equals(p_77142_0_)) + { + return gametype; + } + } + + return SURVIVAL; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/WorldType.java b/build/rfg/minecraft-src/java/net/minecraft/world/WorldType.java new file mode 100644 index 0000000..8e9f889 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/WorldType.java @@ -0,0 +1,319 @@ +package net.minecraft.world; + +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiCreateFlatWorld; +import net.minecraft.client.gui.GuiCreateWorld; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderFlat; +import net.minecraft.world.gen.ChunkProviderGenerate; +import net.minecraft.world.gen.FlatGeneratorInfo; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.GenLayerBiome; +import net.minecraft.world.gen.layer.GenLayerBiomeEdge; +import net.minecraft.world.gen.layer.GenLayerZoom; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class WorldType +{ + /** List of world types. */ + public static WorldType[] worldTypes = new WorldType[16]; + /** Default world type. */ + public static final WorldType DEFAULT = (new WorldType(0, "default", 1)).setVersioned(); + /** Flat world type. */ + public static final WorldType FLAT = new WorldType(1, "flat"); + /** Large Biome world Type. */ + public static final WorldType LARGE_BIOMES = new WorldType(2, "largeBiomes"); + /** amplified world type */ + public static final WorldType AMPLIFIED = (new WorldType(3, "amplified")).setNotificationData(); + /** Default (1.1) world type. */ + public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false); + /** ID for this world type. */ + private final int worldTypeId; + /** 'default' or 'flat' */ + private final String worldType; + /** The int version of the ChunkProvider that generated this world. */ + private final int generatorVersion; + /** Whether this world type can be generated. Normally true; set to false for out-of-date generator versions. */ + private boolean canBeCreated; + /** Whether this WorldType has a version or not. */ + private boolean isWorldTypeVersioned; + private boolean hasNotificationData; + private static final String __OBFID = "CL_00000150"; + + private WorldType(int p_i1959_1_, String p_i1959_2_) + { + this(p_i1959_1_, p_i1959_2_, 0); + } + + private WorldType(int id, String name, int version) + { + if (name.length() > 16) throw new IllegalArgumentException("World type names must not be longer then 16: " + name.length()); + this.worldType = name; + this.generatorVersion = version; + this.canBeCreated = true; + this.worldTypeId = id; + worldTypes[id] = this; + } + + public String getWorldTypeName() + { + return this.worldType; + } + + /** + * Gets the translation key for the name of this world type. + */ + @SideOnly(Side.CLIENT) + public String getTranslateName() + { + return "generator." + this.worldType; + } + + @SideOnly(Side.CLIENT) + public String func_151359_c() + { + return this.getTranslateName() + ".info"; + } + + /** + * Returns generatorVersion. + */ + public int getGeneratorVersion() + { + return this.generatorVersion; + } + + public WorldType getWorldTypeForGeneratorVersion(int version) + { + return this == DEFAULT && version == 0 ? DEFAULT_1_1 : this; + } + + /** + * Sets canBeCreated to the provided value, and returns this. + */ + private WorldType setCanBeCreated(boolean enable) + { + this.canBeCreated = enable; + return this; + } + + /** + * Gets whether this WorldType can be used to generate a new world. + */ + @SideOnly(Side.CLIENT) + public boolean getCanBeCreated() + { + return this.canBeCreated; + } + + /** + * Flags this world type as having an associated version. + */ + private WorldType setVersioned() + { + this.isWorldTypeVersioned = true; + return this; + } + + /** + * Returns true if this world Type has a version associated with it. + */ + public boolean isVersioned() + { + return this.isWorldTypeVersioned; + } + + public static WorldType parseWorldType(String type) + { + for (int i = 0; i < worldTypes.length; ++i) + { + if (worldTypes[i] != null && worldTypes[i].worldType.equalsIgnoreCase(type)) + { + return worldTypes[i]; + } + } + + return null; + } + + public int getWorldTypeID() + { + return this.worldTypeId; + } + + /** + * returns true if selecting this worldtype from the customize menu should display the generator.[worldtype].info + * message + */ + @SideOnly(Side.CLIENT) + public boolean showWorldInfoNotice() + { + return this.hasNotificationData; + } + + /** + * enables the display of generator.[worldtype].info message on the customize world menu + */ + private WorldType setNotificationData() + { + this.hasNotificationData = true; + return this; + } + + public WorldChunkManager getChunkManager(World world) + { + if (this == FLAT) + { + FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.createFlatGeneratorFromString(world.getWorldInfo().getGeneratorOptions()); + return new WorldChunkManagerHell(BiomeGenBase.getBiome(flatgeneratorinfo.getBiome()), 0.5F); + } + else + { + return new WorldChunkManager(world); + } + } + + public IChunkProvider getChunkGenerator(World world, String generatorOptions) + { + return (this == FLAT ? new ChunkProviderFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions) : new ChunkProviderGenerate(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled())); + } + + public int getMinimumSpawnHeight(World world) + { + return this == FLAT ? 4 : 64; + } + + public double getHorizon(World world) + { + return this == FLAT ? 0.0D : 63.0D; + } + + public boolean hasVoidParticles(boolean flag) + { + return this != FLAT && !flag; + } + + public double voidFadeMagnitude() + { + return this == FLAT ? 1.0D : 0.03125D; + } + +/* public BiomeGenBase[] getBiomesForWorldType() { + return biomesForWorldType; + } + + public void addNewBiome(BiomeGenBase biome) + { + Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); + newBiomesForWorld.add(biome); + biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); + } + + public void removeBiome(BiomeGenBase biome) + { + Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); + newBiomesForWorld.remove(biome); + biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); + } +*/ + public boolean handleSlimeSpawnReduction(Random random, World world) + { + return this == FLAT ? random.nextInt(4) != 1 : false; + } + + /*=================================================== FORGE START ======================================*/ + private static int getNextID() + { + for (int x = 0; x < worldTypes.length; x++) + { + if (worldTypes[x] == null) + { + return x; + } + } + + int oldLen = worldTypes.length; + worldTypes = Arrays.copyOf(worldTypes, oldLen + 16); + return oldLen; + } + + /** + * Creates a new world type, the ID is hidden and should not be referenced by modders. + * It will automatically expand the underlying workdType array if there are no IDs left. + * @param name + */ + public WorldType(String name) + { + this(getNextID(), name); + } + + /** + * Called when 'Create New World' button is pressed before starting game + */ + public void onGUICreateWorldPress() { } + + /** + * Gets the spawn fuzz for players who join the world. + * Useful for void world types. + * @return Fuzz for entity initial spawn in blocks. + */ + public int getSpawnFuzz() + { + return net.minecraftforge.common.ForgeModContainer.defaultSpawnFuzz; + } + + /** + * Called when the 'Customize' button is pressed on world creation GUI + * @param instance The minecraft instance + * @param guiCreateWorld the createworld GUI + */ + @SideOnly(Side.CLIENT) + public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld) + { + if (this == FLAT) + { + instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); + } + } + + /** + * Should world creation GUI show 'Customize' button for this world type? + * @return if this world type has customization parameters + */ + public boolean isCustomizable() + { + return this == FLAT; + } + + + /** + * Get the height to render the clouds for this world type + * @return The height to render clouds at + */ + public float getCloudHeight() + { + return 128.0F; + } + + /** + * Creates the GenLayerBiome used for generating the world + * + * @param worldSeed The world seed + * @param parentLayer The parent layer to feed into any layer you return + * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome + */ + public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer) + { + GenLayer ret = new GenLayerBiome(200L, parentLayer, this); + ret = GenLayerZoom.magnify(1000L, ret, 2); + ret = new GenLayerBiomeEdge(1000L, ret); + return ret; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeCache.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeCache.java new file mode 100644 index 0000000..dfc4f4e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeCache.java @@ -0,0 +1,119 @@ +package net.minecraft.world.biome; + +import java.util.ArrayList; +import java.util.List; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.LongHashMap; + +public class BiomeCache +{ + /** Reference to the WorldChunkManager */ + private final WorldChunkManager chunkManager; + /** The last time this BiomeCache was cleaned, in milliseconds. */ + private long lastCleanupTime; + /** The map of keys to BiomeCacheBlocks. Keys are based on the chunk x, z coordinates as (x | z << 32). */ + private LongHashMap cacheMap = new LongHashMap(); + /** The list of cached BiomeCacheBlocks */ + private List cache = new ArrayList(); + private static final String __OBFID = "CL_00000162"; + + public BiomeCache(WorldChunkManager p_i1973_1_) + { + this.chunkManager = p_i1973_1_; + } + + /** + * Returns a biome cache block at location specified. + */ + public BiomeCache.Block getBiomeCacheBlock(int p_76840_1_, int p_76840_2_) + { + p_76840_1_ >>= 4; + p_76840_2_ >>= 4; + long k = (long)p_76840_1_ & 4294967295L | ((long)p_76840_2_ & 4294967295L) << 32; + BiomeCache.Block block = (BiomeCache.Block)this.cacheMap.getValueByKey(k); + + if (block == null) + { + block = new BiomeCache.Block(p_76840_1_, p_76840_2_); + this.cacheMap.add(k, block); + this.cache.add(block); + } + + block.lastAccessTime = MinecraftServer.getSystemTimeMillis(); + return block; + } + + /** + * Returns the BiomeGenBase related to the x, z position from the cache. + */ + public BiomeGenBase getBiomeGenAt(int p_76837_1_, int p_76837_2_) + { + return this.getBiomeCacheBlock(p_76837_1_, p_76837_2_).getBiomeGenAt(p_76837_1_, p_76837_2_); + } + + /** + * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. + */ + public void cleanupCache() + { + long i = MinecraftServer.getSystemTimeMillis(); + long j = i - this.lastCleanupTime; + + if (j > 7500L || j < 0L) + { + this.lastCleanupTime = i; + + for (int k = 0; k < this.cache.size(); ++k) + { + BiomeCache.Block block = (BiomeCache.Block)this.cache.get(k); + long l = i - block.lastAccessTime; + + if (l > 30000L || l < 0L) + { + this.cache.remove(k--); + long i1 = (long)block.xPosition & 4294967295L | ((long)block.zPosition & 4294967295L) << 32; + this.cacheMap.remove(i1); + } + } + } + } + + /** + * Returns the array of cached biome types in the BiomeCacheBlock at the given location. + */ + public BiomeGenBase[] getCachedBiomes(int p_76839_1_, int p_76839_2_) + { + return this.getBiomeCacheBlock(p_76839_1_, p_76839_2_).biomes; + } + + public class Block + { + /** An array of chunk rainfall values saved by this cache. */ + public float[] rainfallValues = new float[256]; + /** The array of biome types stored in this BiomeCacheBlock. */ + public BiomeGenBase[] biomes = new BiomeGenBase[256]; + /** The x coordinate of the BiomeCacheBlock. */ + public int xPosition; + /** The z coordinate of the BiomeCacheBlock. */ + public int zPosition; + /** The last time this BiomeCacheBlock was accessed, in milliseconds. */ + public long lastAccessTime; + private static final String __OBFID = "CL_00000163"; + + public Block(int p_i1972_2_, int p_i1972_3_) + { + this.xPosition = p_i1972_2_; + this.zPosition = p_i1972_3_; + BiomeCache.this.chunkManager.getRainfall(this.rainfallValues, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16); + BiomeCache.this.chunkManager.getBiomeGenAt(this.biomes, p_i1972_2_ << 4, p_i1972_3_ << 4, 16, 16, false); + } + + /** + * Returns the BiomeGenBase related to the x, z position from the cache block. + */ + public BiomeGenBase getBiomeGenAt(int p_76885_1_, int p_76885_2_) + { + return this.biomes[p_76885_1_ & 15 | (p_76885_2_ & 15) << 4]; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeDecorator.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeDecorator.java new file mode 100644 index 0000000..817c60a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeDecorator.java @@ -0,0 +1,417 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCactus; +import net.minecraft.world.gen.feature.WorldGenClay; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenLiquids; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenSand; +import net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.minecraft.world.gen.feature.WorldGenerator; + +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; + +public class BiomeDecorator +{ + /** The world the BiomeDecorator is currently decorating */ + public World currentWorld; + /** The Biome Decorator's random number generator. */ + public Random randomGenerator; + /** The X-coordinate of the chunk currently being decorated */ + public int chunk_X; + /** The Z-coordinate of the chunk currently being decorated */ + public int chunk_Z; + /** The clay generator. */ + public WorldGenerator clayGen = new WorldGenClay(4); + /** The sand generator. */ + public WorldGenerator sandGen; + /** The gravel generator. */ + public WorldGenerator gravelAsSandGen; + /** The dirt generator. */ + public WorldGenerator dirtGen; + public WorldGenerator gravelGen; + public WorldGenerator coalGen; + public WorldGenerator ironGen; + /** Field that holds gold WorldGenMinable */ + public WorldGenerator goldGen; + /** Field that holds redstone WorldGenMinable */ + public WorldGenerator redstoneGen; + /** Field that holds diamond WorldGenMinable */ + public WorldGenerator diamondGen; + /** Field that holds Lapis WorldGenMinable */ + public WorldGenerator lapisGen; + public WorldGenFlowers yellowFlowerGen; + /** Field that holds mushroomBrown WorldGenFlowers */ + public WorldGenerator mushroomBrownGen; + /** Field that holds mushroomRed WorldGenFlowers */ + public WorldGenerator mushroomRedGen; + /** Field that holds big mushroom generator */ + public WorldGenerator bigMushroomGen; + /** Field that holds WorldGenReed */ + public WorldGenerator reedGen; + /** Field that holds WorldGenCactus */ + public WorldGenerator cactusGen; + /** The water lily generation! */ + public WorldGenerator waterlilyGen; + /** Amount of waterlilys per chunk. */ + public int waterlilyPerChunk; + /** The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. */ + public int treesPerChunk; + /** + * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since + * it attempts to generate them at a random altitude. + */ + public int flowersPerChunk; + /** The amount of tall grass to generate per chunk. */ + public int grassPerChunk; + /** The number of dead bushes to generate per chunk. Used in deserts and swamps. */ + public int deadBushPerChunk; + /** + * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 + * this number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. + */ + public int mushroomsPerChunk; + /** The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. */ + public int reedsPerChunk; + /** The number of cactus plants to generate per chunk. Cacti only work on sand. */ + public int cactiPerChunk; + /** The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. */ + public int sandPerChunk; + /** + * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There + * appear to be two separate fields for this. + */ + public int sandPerChunk2; + /** The number of clay patches to generate per chunk. Only generates when part of it is underwater. */ + public int clayPerChunk; + /** Amount of big mushrooms per chunk */ + public int bigMushroomsPerChunk; + /** True if decorator should generate surface lava & water */ + public boolean generateLakes; + private static final String __OBFID = "CL_00000164"; + + public BiomeDecorator() + { + this.sandGen = new WorldGenSand(Blocks.sand, 7); + this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6); + this.dirtGen = new WorldGenMinable(Blocks.dirt, 32); + this.gravelGen = new WorldGenMinable(Blocks.gravel, 32); + this.coalGen = new WorldGenMinable(Blocks.coal_ore, 16); + this.ironGen = new WorldGenMinable(Blocks.iron_ore, 8); + this.goldGen = new WorldGenMinable(Blocks.gold_ore, 8); + this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore, 7); + this.diamondGen = new WorldGenMinable(Blocks.diamond_ore, 7); + this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6); + this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower); + this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom); + this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom); + this.bigMushroomGen = new WorldGenBigMushroom(); + this.reedGen = new WorldGenReed(); + this.cactusGen = new WorldGenCactus(); + this.waterlilyGen = new WorldGenWaterlily(); + this.flowersPerChunk = 2; + this.grassPerChunk = 1; + this.sandPerChunk = 1; + this.sandPerChunk2 = 3; + this.clayPerChunk = 1; + this.generateLakes = true; + } + + public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) + { + if (this.currentWorld != null) + { + throw new RuntimeException("Already decorating!!"); + } + else + { + this.currentWorld = p_150512_1_; + this.randomGenerator = p_150512_2_; + this.chunk_X = p_150512_4_; + this.chunk_Z = p_150512_5_; + this.genDecorations(p_150512_3_); + this.currentWorld = null; + this.randomGenerator = null; + } + } + + protected void genDecorations(BiomeGenBase p_150513_1_) + { + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); + this.generateOres(); + int i; + int j; + int k; + + boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); + for (i = 0; doGen && i < this.sandPerChunk2; ++i) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.sandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); + for (i = 0; doGen && i < this.clayPerChunk; ++i) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.clayGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); + for (i = 0; doGen && i < this.sandPerChunk; ++i) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + i = this.treesPerChunk; + + if (this.randomGenerator.nextInt(10) == 0) + { + ++i; + } + + int l; + int i1; + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); + for (j = 0; doGen && j < i; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = this.currentWorld.getHeightValue(k, l); + WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator); + worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D); + + if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) + { + worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l); + } + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM); + for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); + for (j = 0; doGen && j < this.flowersPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32); + String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l); + BlockFlower blockflower = BlockFlower.func_149857_e(s); + + if (blockflower.getMaterial() != Material.air) + { + this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s)); + this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); + for (j = 0; doGen && j < this.grassPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator); + worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); + for (j = 0; doGen && j < this.deadBushPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); + for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + + for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) + { + ; + } + + this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); + for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) + { + if (this.randomGenerator.nextInt(4) == 0) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = this.currentWorld.getHeightValue(k, l); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + if (this.randomGenerator.nextInt(8) == 0) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + } + + if (doGen && this.randomGenerator.nextInt(4) == 0) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + } + + if (doGen && this.randomGenerator.nextInt(8) == 0) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); + for (j = 0; doGen && j < this.reedsPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + for (j = 0; doGen && j < 10; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN); + if (doGen && this.randomGenerator.nextInt(32) == 0) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); + for (j = 0; doGen && j < this.cactiPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); + if (doGen && this.generateLakes) + { + for (j = 0; j < 50; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); + i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1); + } + + for (j = 0; j < 20; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); + i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1); + } + } + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); + } + + /** + * Standard ore generation helper. Generates most ores. + */ + protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) + { + for (int l = 0; l < p_76795_1_; ++l) + { + int i1 = this.chunk_X + this.randomGenerator.nextInt(16); + int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_; + int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76795_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); + } + } + + /** + * Standard ore generation helper. Generates Lapis Lazuli. + */ + protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) + { + for (int l = 0; l < p_76793_1_; ++l) + { + int i1 = this.chunk_X + this.randomGenerator.nextInt(16); + int j1 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_) + (p_76793_3_ - p_76793_4_); + int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); + } + } + + /** + * Generates ores in the current chunk + */ + protected void generateOres() + { + MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); + if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) + this.genStandardOre1(20, this.dirtGen, 0, 256); + if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen, chunk_X, chunk_Z, GRAVEL)) + this.genStandardOre1(10, this.gravelGen, 0, 256); + if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL)) + this.genStandardOre1(20, this.coalGen, 0, 128); + if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON)) + this.genStandardOre1(20, this.ironGen, 0, 64); + if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD)) + this.genStandardOre1(2, this.goldGen, 0, 32); + if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE)) + this.genStandardOre1(8, this.redstoneGen, 0, 16); + if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND)) + this.genStandardOre1(1, this.diamondGen, 0, 16); + if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS)) + this.genStandardOre2(1, this.lapisGen, 16, 16); + MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); + } + + private int nextInt(int i) { + if (i <= 1) + return 0; + return this.randomGenerator.nextInt(i); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeEndDecorator.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeEndDecorator.java new file mode 100644 index 0000000..a820f74 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeEndDecorator.java @@ -0,0 +1,37 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.boss.EntityDragon; +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenSpikes; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeEndDecorator extends BiomeDecorator +{ + protected WorldGenerator spikeGen; + private static final String __OBFID = "CL_00000188"; + + public BiomeEndDecorator() + { + this.spikeGen = new WorldGenSpikes(Blocks.end_stone); + } + + protected void genDecorations(BiomeGenBase p_150513_1_) + { + this.generateOres(); + + if (this.randomGenerator.nextInt(5) == 0) + { + int i = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + int j = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + int k = this.currentWorld.getTopSolidOrLiquidBlock(i, j); + this.spikeGen.generate(this.currentWorld, this.randomGenerator, i, k, j); + } + + if (this.chunk_X == 0 && this.chunk_Z == 0) + { + EntityDragon entitydragon = new EntityDragon(this.currentWorld); + entitydragon.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); + this.currentWorld.spawnEntityInWorld(entitydragon); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBase.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBase.java new file mode 100644 index 0000000..ce5516b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBase.java @@ -0,0 +1,771 @@ +package net.minecraft.world.biome; + +import com.google.common.collect.Sets; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.Set; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.ColorizerFoliage; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigTree; +import net.minecraft.world.gen.feature.WorldGenDoublePlant; +import net.minecraft.world.gen.feature.WorldGenSwamp; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; + +public abstract class BiomeGenBase +{ + private static final Logger logger = LogManager.getLogger(); + protected static final BiomeGenBase.Height height_Default = new BiomeGenBase.Height(0.1F, 0.2F); + protected static final BiomeGenBase.Height height_ShallowWaters = new BiomeGenBase.Height(-0.5F, 0.0F); + protected static final BiomeGenBase.Height height_Oceans = new BiomeGenBase.Height(-1.0F, 0.1F); + protected static final BiomeGenBase.Height height_DeepOceans = new BiomeGenBase.Height(-1.8F, 0.1F); + protected static final BiomeGenBase.Height height_LowPlains = new BiomeGenBase.Height(0.125F, 0.05F); + protected static final BiomeGenBase.Height height_MidPlains = new BiomeGenBase.Height(0.2F, 0.2F); + protected static final BiomeGenBase.Height height_LowHills = new BiomeGenBase.Height(0.45F, 0.3F); + protected static final BiomeGenBase.Height height_HighPlateaus = new BiomeGenBase.Height(1.5F, 0.025F); + protected static final BiomeGenBase.Height height_MidHills = new BiomeGenBase.Height(1.0F, 0.5F); + protected static final BiomeGenBase.Height height_Shores = new BiomeGenBase.Height(0.0F, 0.025F); + protected static final BiomeGenBase.Height height_RockyWaters = new BiomeGenBase.Height(0.1F, 0.8F); + protected static final BiomeGenBase.Height height_LowIslands = new BiomeGenBase.Height(0.2F, 0.3F); + protected static final BiomeGenBase.Height height_PartiallySubmerged = new BiomeGenBase.Height(-0.2F, 0.1F); + /** An array of all the biomes, indexed by biome id. */ + private static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; + public static final Set explorationBiomesList = Sets.newHashSet(); + public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setHeight(height_Oceans); + public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains"); + public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowPlains); + public static final BiomeGenBase extremeHills = (new BiomeGenHills(3, false)).setColor(6316128).setBiomeName("Extreme Hills").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase forest = (new BiomeGenForest(4, 0)).setColor(353825).setBiomeName("Forest"); + public static final BiomeGenBase taiga = (new BiomeGenTaiga(5, 0)).setColor(747097).setBiomeName("Taiga").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_MidPlains); + public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").func_76733_a(9154376).setHeight(height_PartiallySubmerged).setTemperatureRainfall(0.8F, 0.9F); + public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setHeight(height_ShallowWaters); + public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); + /** Is the biome used for sky world. */ + public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain(); + public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setHeight(height_Oceans).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setHeight(height_ShallowWaters).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase icePlains = (new BiomeGenSnow(12, false)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(height_LowPlains); + public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13, false)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setHeight(height_LowHills).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_LowIslands); + public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setHeight(height_Shores); + /** Beach biome. */ + public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setHeight(height_Shores); + /** Desert Hills biome. */ + public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setHeight(height_LowHills); + /** Forest Hills biome. */ + public static final BiomeGenBase forestHills = (new BiomeGenForest(18, 0)).setColor(2250012).setBiomeName("ForestHills").setHeight(height_LowHills); + /** Taiga Hills biome. */ + public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19, 0)).setColor(1456435).setBiomeName("TaigaHills").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(height_LowHills); + /** Extreme Hills Edge biome. */ + public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20, true)).setColor(7501978).setBiomeName("Extreme Hills Edge").setHeight(height_MidHills.attenuate()).setTemperatureRainfall(0.2F, 0.3F); + /** Jungle biome identifier */ + public static final BiomeGenBase jungle = (new BiomeGenJungle(21, false)).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.9F); + public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22, false)).setColor(2900485).setBiomeName("JungleHills").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.9F).setHeight(height_LowHills); + public static final BiomeGenBase jungleEdge = (new BiomeGenJungle(23, true)).setColor(6458135).setBiomeName("JungleEdge").func_76733_a(5470985).setTemperatureRainfall(0.95F, 0.8F); + public static final BiomeGenBase deepOcean = (new BiomeGenOcean(24)).setColor(48).setBiomeName("Deep Ocean").setHeight(height_DeepOceans); + public static final BiomeGenBase stoneBeach = (new BiomeGenStoneBeach(25)).setColor(10658436).setBiomeName("Stone Beach").setTemperatureRainfall(0.2F, 0.3F).setHeight(height_RockyWaters); + public static final BiomeGenBase coldBeach = (new BiomeGenBeach(26)).setColor(16445632).setBiomeName("Cold Beach").setTemperatureRainfall(0.05F, 0.3F).setHeight(height_Shores).setEnableSnow(); + public static final BiomeGenBase birchForest = (new BiomeGenForest(27, 2)).setBiomeName("Birch Forest").setColor(3175492); + public static final BiomeGenBase birchForestHills = (new BiomeGenForest(28, 2)).setBiomeName("Birch Forest Hills").setColor(2055986).setHeight(height_LowHills); + public static final BiomeGenBase roofedForest = (new BiomeGenForest(29, 3)).setColor(4215066).setBiomeName("Roofed Forest"); + public static final BiomeGenBase coldTaiga = (new BiomeGenTaiga(30, 0)).setColor(3233098).setBiomeName("Cold Taiga").func_76733_a(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_MidPlains).func_150563_c(16777215); + public static final BiomeGenBase coldTaigaHills = (new BiomeGenTaiga(31, 0)).setColor(2375478).setBiomeName("Cold Taiga Hills").func_76733_a(5159473).setEnableSnow().setTemperatureRainfall(-0.5F, 0.4F).setHeight(height_LowHills).func_150563_c(16777215); + public static final BiomeGenBase megaTaiga = (new BiomeGenTaiga(32, 1)).setColor(5858897).setBiomeName("Mega Taiga").func_76733_a(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_MidPlains); + public static final BiomeGenBase megaTaigaHills = (new BiomeGenTaiga(33, 1)).setColor(4542270).setBiomeName("Mega Taiga Hills").func_76733_a(5159473).setTemperatureRainfall(0.3F, 0.8F).setHeight(height_LowHills); + public static final BiomeGenBase extremeHillsPlus = (new BiomeGenHills(34, true)).setColor(5271632).setBiomeName("Extreme Hills+").setHeight(height_MidHills).setTemperatureRainfall(0.2F, 0.3F); + public static final BiomeGenBase savanna = (new BiomeGenSavanna(35)).setColor(12431967).setBiomeName("Savanna").setTemperatureRainfall(1.2F, 0.0F).setDisableRain().setHeight(height_LowPlains); + public static final BiomeGenBase savannaPlateau = (new BiomeGenSavanna(36)).setColor(10984804).setBiomeName("Savanna Plateau").setTemperatureRainfall(1.0F, 0.0F).setDisableRain().setHeight(height_HighPlateaus); + public static final BiomeGenBase mesa = (new BiomeGenMesa(37, false, false)).setColor(14238997).setBiomeName("Mesa"); + public static final BiomeGenBase mesaPlateau_F = (new BiomeGenMesa(38, false, true)).setColor(11573093).setBiomeName("Mesa Plateau F").setHeight(height_HighPlateaus); + public static final BiomeGenBase mesaPlateau = (new BiomeGenMesa(39, false, false)).setColor(13274213).setBiomeName("Mesa Plateau").setHeight(height_HighPlateaus); + protected static final NoiseGeneratorPerlin temperatureNoise; + protected static final NoiseGeneratorPerlin plantNoise; + protected static final WorldGenDoublePlant genTallFlowers; + public String biomeName; + public int color; + public int field_150609_ah; + /** The block expected to be on the top of this biome */ + public Block topBlock; + public int field_150604_aj; + /** The block to fill spots in when not on the top */ + public Block fillerBlock; + public int field_76754_C; + /** + * The median height from which this biome will be generated. Values between -2 and 2 loosely represent y=0 and + * y=128 respectively. + */ + public float rootHeight; + /** + * Determines the maximum degree of departure from the rootHeight of the biome, positive or negative. Low values + * result in flatter terrain, where high values create steep peaks and trenches. + */ + public float heightVariation; + /** The temperature of this biome. */ + public float temperature; + /** The rainfall in this biome. */ + public float rainfall; + /** Color tint applied to water depending on biome */ + public int waterColorMultiplier; + /** The biome decorator. */ + public BiomeDecorator theBiomeDecorator; + /** Holds the classes of IMobs (hostile mobs) that can be spawned in the biome. */ + protected List spawnableMonsterList; + /** Holds the classes of any creature that can be spawned in the biome as friendly creature. */ + protected List spawnableCreatureList; + /** Holds the classes of any aquatic creature that can be spawned in the water of the biome. */ + protected List spawnableWaterCreatureList; + protected List spawnableCaveCreatureList; + /** Set to true if snow is enabled for this biome. */ + protected boolean enableSnow; + /** Is true (default) if the biome support rain (desert and nether can't have rain) */ + protected boolean enableRain; + /** The id number to this biome, and its index in the biomeList array. */ + public final int biomeID; + /** The tree generator. */ + protected WorldGenTrees worldGeneratorTrees; + /** The big tree generator. */ + protected WorldGenBigTree worldGeneratorBigTree; + /** The swamp tree generator. */ + protected WorldGenSwamp worldGeneratorSwamp; + private static final String __OBFID = "CL_00000158"; + + public BiomeGenBase(int p_i1971_1_) + { + this(p_i1971_1_, true); + } + public BiomeGenBase(int p_i1971_1_, boolean register) + { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + this.field_76754_C = 5169201; + this.rootHeight = height_Default.rootHeight; + this.heightVariation = height_Default.variation; + this.temperature = 0.5F; + this.rainfall = 0.5F; + this.waterColorMultiplier = 16777215; + this.spawnableMonsterList = new ArrayList(); + this.spawnableCreatureList = new ArrayList(); + this.spawnableWaterCreatureList = new ArrayList(); + this.spawnableCaveCreatureList = new ArrayList(); + this.enableRain = true; + this.worldGeneratorTrees = new WorldGenTrees(false); + this.worldGeneratorBigTree = new WorldGenBigTree(false); + this.worldGeneratorSwamp = new WorldGenSwamp(); + this.biomeID = p_i1971_1_; + if (register) + biomeList[p_i1971_1_] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + this.addDefaultFlowers(); + } + + /** + * Allocate a new BiomeDecorator for this BiomeGenBase + */ + public BiomeDecorator createBiomeDecorator() + { + return getModdedBiomeDecorator(new BiomeDecorator()); + } + + /** + * Sets the temperature and rainfall of this biome. + */ + public BiomeGenBase setTemperatureRainfall(float p_76732_1_, float p_76732_2_) + { + if (p_76732_1_ > 0.1F && p_76732_1_ < 0.2F) + { + throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); + } + else + { + this.temperature = p_76732_1_; + this.rainfall = p_76732_2_; + return this; + } + } + + public final BiomeGenBase setHeight(BiomeGenBase.Height p_150570_1_) + { + this.rootHeight = p_150570_1_.rootHeight; + this.heightVariation = p_150570_1_.variation; + return this; + } + + /** + * Disable the rain for the biome. + */ + public BiomeGenBase setDisableRain() + { + this.enableRain = false; + return this; + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(p_150567_1_.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) + { + return new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) + { + return p_150572_1_.nextInt(3) > 0 ? BlockFlower.field_149858_b[0] : BlockFlower.field_149859_a[0]; + } + + /** + * sets enableSnow to true during biome initialization. returns BiomeGenBase. + */ + public BiomeGenBase setEnableSnow() + { + this.enableSnow = true; + return this; + } + + public BiomeGenBase setBiomeName(String p_76735_1_) + { + this.biomeName = p_76735_1_; + return this; + } + + public BiomeGenBase func_76733_a(int p_76733_1_) + { + this.field_76754_C = p_76733_1_; + return this; + } + + public BiomeGenBase setColor(int p_76739_1_) + { + this.func_150557_a(p_76739_1_, false); + return this; + } + + public BiomeGenBase func_150563_c(int p_150563_1_) + { + this.field_150609_ah = p_150563_1_; + return this; + } + + public BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) + { + this.color = p_150557_1_; + + if (p_150557_2_) + { + this.field_150609_ah = (p_150557_1_ & 16711422) >> 1; + } + else + { + this.field_150609_ah = p_150557_1_; + } + + return this; + } + + /** + * takes temperature, returns color + */ + @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float p_76731_1_) + { + p_76731_1_ /= 3.0F; + + if (p_76731_1_ < -1.0F) + { + p_76731_1_ = -1.0F; + } + + if (p_76731_1_ > 1.0F) + { + p_76731_1_ = 1.0F; + } + + return Color.getHSBColor(0.62222224F - p_76731_1_ * 0.05F, 0.5F + p_76731_1_ * 0.1F, 1.0F).getRGB(); + } + + /** + * Returns the correspondent list of the EnumCreatureType informed. + */ + public List getSpawnableList(EnumCreatureType p_76747_1_) + { + return p_76747_1_ == EnumCreatureType.monster ? this.spawnableMonsterList : (p_76747_1_ == EnumCreatureType.creature ? this.spawnableCreatureList : (p_76747_1_ == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (p_76747_1_ == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); + } + + /** + * Returns true if the biome have snowfall instead a normal rain. + */ + public boolean getEnableSnow() + { + return this.func_150559_j(); + } + + /** + * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled. + */ + public boolean canSpawnLightningBolt() + { + return this.func_150559_j() ? false : this.enableRain; + } + + /** + * Checks to see if the rainfall level of the biome is extremely high + */ + public boolean isHighHumidity() + { + return this.rainfall > 0.85F; + } + + /** + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() + { + return 0.1F; + } + + /** + * Gets an integer representation of this biome's rainfall + */ + public final int getIntRainfall() + { + return (int)(this.rainfall * 65536.0F); + } + + /** + * Gets a floating point representation of this biome's rainfall + */ + @SideOnly(Side.CLIENT) + public final float getFloatRainfall() + { + return this.rainfall; + } + + /** + * Gets a floating point representation of this biome's temperature + */ + public final float getFloatTemperature(int p_150564_1_, int p_150564_2_, int p_150564_3_) + { + if (p_150564_2_ > 64) + { + float f = (float)temperatureNoise.func_151601_a((double)p_150564_1_ * 1.0D / 8.0D, (double)p_150564_3_ * 1.0D / 8.0D) * 4.0F; + return this.temperature - (f + (float)p_150564_2_ - 64.0F) * 0.05F / 30.0F; + } + else + { + return this.temperature; + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + this.theBiomeDecorator.decorateChunk(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1)); + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) + { + double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1)); + } + + public boolean func_150559_j() + { + return this.enableSnow; + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + public final void genBiomeTerrain(World p_150560_1_, Random p_150560_2_, Block[] p_150560_3_, byte[] p_150560_4_, int p_150560_5_, int p_150560_6_, double p_150560_7_) + { + boolean flag = true; + Block block = this.topBlock; + byte b0 = (byte)(this.field_150604_aj & 255); + Block block1 = this.fillerBlock; + int k = -1; + int l = (int)(p_150560_7_ / 3.0D + 3.0D + p_150560_2_.nextDouble() * 0.25D); + int i1 = p_150560_5_ & 15; + int j1 = p_150560_6_ & 15; + int k1 = p_150560_3_.length / 256; + + for (int l1 = 255; l1 >= 0; --l1) + { + int i2 = (j1 * 16 + i1) * k1 + l1; + + if (l1 <= 0 + p_150560_2_.nextInt(5)) + { + p_150560_3_[i2] = Blocks.bedrock; + } + else + { + Block block2 = p_150560_3_[i2]; + + if (block2 != null && block2.getMaterial() != Material.air) + { + if (block2 == Blocks.stone) + { + if (k == -1) + { + if (l <= 0) + { + block = null; + b0 = 0; + block1 = Blocks.stone; + } + else if (l1 >= 59 && l1 <= 64) + { + block = this.topBlock; + b0 = (byte)(this.field_150604_aj & 255); + block1 = this.fillerBlock; + } + + if (l1 < 63 && (block == null || block.getMaterial() == Material.air)) + { + if (this.getFloatTemperature(p_150560_5_, l1, p_150560_6_) < 0.15F) + { + block = Blocks.ice; + b0 = 0; + } + else + { + block = Blocks.water; + b0 = 0; + } + } + + k = l; + + if (l1 >= 62) + { + p_150560_3_[i2] = block; + p_150560_4_[i2] = b0; + } + else if (l1 < 56 - l) + { + block = null; + block1 = Blocks.stone; + p_150560_3_[i2] = Blocks.gravel; + } + else + { + p_150560_3_[i2] = block1; + } + } + else if (k > 0) + { + --k; + p_150560_3_[i2] = block1; + + if (k == 0 && block1 == Blocks.sand) + { + k = p_150560_2_.nextInt(4) + Math.max(0, l1 - 63); + block1 = Blocks.sandstone; + } + } + } + } + else + { + k = -1; + } + } + } + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + return new BiomeGenMutated(this.biomeID + 128, this); + } + + public Class getBiomeClass() + { + return this.getClass(); + } + + /** + * returns true if the biome specified is equal to this biome + */ + public boolean isEqualTo(BiomeGenBase p_150569_1_) + { + return p_150569_1_ == this ? true : (p_150569_1_ == null ? false : this.getBiomeClass() == p_150569_1_.getBiomeClass()); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return (double)this.temperature < 0.2D ? BiomeGenBase.TempCategory.COLD : ((double)this.temperature < 1.0D ? BiomeGenBase.TempCategory.MEDIUM : BiomeGenBase.TempCategory.WARM); + } + + public static BiomeGenBase[] getBiomeGenArray() + { + return biomeList; + } + + /** + * return the biome specified by biomeID, or 0 (ocean) if out of bounds + */ + public static BiomeGenBase getBiome(int p_150568_0_) + { + if (p_150568_0_ >= 0 && p_150568_0_ <= biomeList.length) + { + return biomeList[p_150568_0_]; + } + else + { + logger.warn("Biome ID is out of bounds: " + p_150568_0_ + ", defaulting to 0 (Ocean)"); + return ocean; + } + } + + /* ========================================= FORGE START ======================================*/ + protected List flowers = new ArrayList(); + + public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) + { + return new DeferredBiomeDecorator(original); + } + + public int getWaterColorMultiplier() + { + BiomeEvent.GetWaterColor event = new BiomeEvent.GetWaterColor(this, waterColorMultiplier); + MinecraftForge.EVENT_BUS.post(event); + return event.newColor; + } + + public int getModdedBiomeGrassColor(int original) + { + BiomeEvent.GetGrassColor event = new BiomeEvent.GetGrassColor(this, original); + MinecraftForge.EVENT_BUS.post(event); + return event.newColor; + } + + public int getModdedBiomeFoliageColor(int original) + { + BiomeEvent.GetFoliageColor event = new BiomeEvent.GetFoliageColor(this, original); + MinecraftForge.EVENT_BUS.post(event); + return event.newColor; + } + + /** + * Weighted random holder class used to hold possible flowers + * that can spawn in this biome when bonemeal is used on grass. + */ + public static class FlowerEntry extends WeightedRandom.Item + { + public final Block block; + public final int metadata; + public FlowerEntry(Block block, int meta, int weight) + { + super(weight); + this.block = block; + this.metadata = meta; + } + } + + /** + * Adds the default flowers, as of 1.7, it is 2 yellow, and 1 red. I chose 10 to allow some wiggle room in the numbers. + */ + public void addDefaultFlowers() + { + this.flowers.add(new FlowerEntry(Blocks.yellow_flower, 0, 20)); + this.flowers.add(new FlowerEntry(Blocks.red_flower, 0, 10)); + } + + /** Register a new plant to be planted when bonemeal is used on grass. + * @param block The block to place. + * @param metadata The metadata to set for the block when being placed. + * @param weight The weight of the plant, where red flowers are + * 10 and yellow flowers are 20. + */ + public void addFlower(Block block, int metadata, int weight) + { + this.flowers.add(new FlowerEntry(block, metadata, weight)); + } + + public void plantFlower(World world, Random rand, int x, int y, int z) + { + BiomeGenBase biome = world.getBiomeGenForCoords(x, z); + String flowername = biome.func_150572_a(rand, x, y, z); + + FlowerEntry flower = (FlowerEntry)WeightedRandom.getRandomItem(rand, flowers); + if (flower == null || flower.block == null || !flower.block.canBlockStay(world, x, y, z)) + { + return; + } + + world.setBlock(x, y, z, flower.block, flower.metadata, 3); + } + + + /* ========================================= FORGE END ======================================*/ + + static + { + plains.createMutation(); + desert.createMutation(); + forest.createMutation(); + taiga.createMutation(); + swampland.createMutation(); + icePlains.createMutation(); + jungle.createMutation(); + jungleEdge.createMutation(); + coldTaiga.createMutation(); + savanna.createMutation(); + savannaPlateau.createMutation(); + mesa.createMutation(); + mesaPlateau_F.createMutation(); + mesaPlateau.createMutation(); + birchForest.createMutation(); + birchForestHills.createMutation(); + roofedForest.createMutation(); + megaTaiga.createMutation(); + extremeHills.createMutation(); + extremeHillsPlus.createMutation(); + biomeList[megaTaigaHills.biomeID + 128] = biomeList[megaTaiga.biomeID + 128]; + BiomeGenBase[] var0 = biomeList; + int var1 = var0.length; + + for (int var2 = 0; var2 < var1; ++var2) + { + BiomeGenBase var3 = var0[var2]; + + if (var3 != null && var3.biomeID < 128) + { + explorationBiomesList.add(var3); + } + } + + explorationBiomesList.remove(hell); + explorationBiomesList.remove(sky); + explorationBiomesList.remove(frozenOcean); + explorationBiomesList.remove(extremeHillsEdge); + temperatureNoise = new NoiseGeneratorPerlin(new Random(1234L), 1); + plantNoise = new NoiseGeneratorPerlin(new Random(2345L), 1); + genTallFlowers = new WorldGenDoublePlant(); + } + + public static class Height + { + public float rootHeight; + public float variation; + private static final String __OBFID = "CL_00000159"; + + public Height(float p_i45371_1_, float p_i45371_2_) + { + this.rootHeight = p_i45371_1_; + this.variation = p_i45371_2_; + } + + /** + * Reduces the baseHeight by 20%, and the variation intensity by 40%, and returns the resulting Height + * object + */ + public BiomeGenBase.Height attenuate() + { + return new BiomeGenBase.Height(this.rootHeight * 0.8F, this.variation * 0.6F); + } + } + + public static class SpawnListEntry extends WeightedRandom.Item + { + /** Holds the class of the entity to be spawned. */ + public Class entityClass; + public int minGroupCount; + public int maxGroupCount; + private static final String __OBFID = "CL_00000161"; + + public SpawnListEntry(Class p_i1970_1_, int p_i1970_2_, int p_i1970_3_, int p_i1970_4_) + { + super(p_i1970_2_); + this.entityClass = p_i1970_1_; + this.minGroupCount = p_i1970_3_; + this.maxGroupCount = p_i1970_4_; + } + + public String toString() + { + return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight; + } + } + + public static enum TempCategory + { + OCEAN, + COLD, + MEDIUM, + WARM; + + private static final String __OBFID = "CL_00000160"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBeach.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBeach.java new file mode 100644 index 0000000..99ee293 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenBeach.java @@ -0,0 +1,20 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenBeach extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000157"; + + public BiomeGenBeach(int p_i1969_1_) + { + super(p_i1969_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.fillerBlock = Blocks.sand; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenDesert.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenDesert.java new file mode 100644 index 0000000..a173f3f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenDesert.java @@ -0,0 +1,37 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDesertWells; + +public class BiomeGenDesert extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000167"; + + public BiomeGenDesert(int p_i1977_1_) + { + super(p_i1977_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.fillerBlock = Blocks.sand; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 2; + this.theBiomeDecorator.reedsPerChunk = 50; + this.theBiomeDecorator.cactiPerChunk = 10; + this.spawnableCreatureList.clear(); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + + if (p_76728_2_.nextInt(1000) == 0) + { + int k = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int l = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + WorldGenDesertWells worldgendesertwells = new WorldGenDesertWells(); + worldgendesertwells.generate(p_76728_1_, p_76728_2_, k, p_76728_1_.getHeightValue(k, l) + 1, l); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenEnd.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenEnd.java new file mode 100644 index 0000000..69adf55 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenEnd.java @@ -0,0 +1,33 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.init.Blocks; + +public class BiomeGenEnd extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000187"; + + public BiomeGenEnd(int p_i1990_1_) + { + super(p_i1990_1_); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = Blocks.dirt; + this.fillerBlock = Blocks.dirt; + this.theBiomeDecorator = new BiomeEndDecorator(); + } + + /** + * takes temperature, returns color + */ + @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float p_76731_1_) + { + return 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenForest.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenForest.java new file mode 100644 index 0000000..acbb6de --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenForest.java @@ -0,0 +1,245 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCanopyTree; +import net.minecraft.world.gen.feature.WorldGenForest; + +public class BiomeGenForest extends BiomeGenBase +{ + private int field_150632_aF; + protected static final WorldGenForest field_150629_aC = new WorldGenForest(false, true); + protected static final WorldGenForest field_150630_aD = new WorldGenForest(false, false); + protected static final WorldGenCanopyTree field_150631_aE = new WorldGenCanopyTree(false); + private static final String __OBFID = "CL_00000170"; + + public BiomeGenForest(int p_i45377_1_, int p_i45377_2_) + { + super(p_i45377_1_); + this.field_150632_aF = p_i45377_2_; + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 2; + + if (this.field_150632_aF == 1) + { + this.theBiomeDecorator.treesPerChunk = 6; + this.theBiomeDecorator.flowersPerChunk = 100; + this.theBiomeDecorator.grassPerChunk = 1; + } + + this.func_76733_a(5159473); + this.setTemperatureRainfall(0.7F, 0.8F); + + if (this.field_150632_aF == 2) + { + this.field_150609_ah = 353825; + this.color = 3175492; + this.setTemperatureRainfall(0.6F, 0.6F); + } + + if (this.field_150632_aF == 0) + { + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 5, 4, 4)); + } + + if (this.field_150632_aF == 3) + { + this.theBiomeDecorator.treesPerChunk = -999; + } + + if (this.field_150632_aF == 1) + { + this.flowers.clear(); + for (int x = 0; x < BlockFlower.field_149859_a.length; x++) + { + this.addFlower(Blocks.red_flower, x == 1 ? 0 : x, 10); + } + } + } + + public BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) + { + if (this.field_150632_aF == 2) + { + this.field_150609_ah = 353825; + this.color = p_150557_1_; + + if (p_150557_2_) + { + this.field_150609_ah = (this.field_150609_ah & 16711422) >> 1; + } + + return this; + } + else + { + return super.func_150557_a(p_150557_1_, p_150557_2_); + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(this.field_150632_aF == 3 && p_150567_1_.nextInt(3) > 0 ? field_150631_aE : (this.field_150632_aF != 2 && p_150567_1_.nextInt(5) != 0 ? this.worldGeneratorTrees : field_150630_aD)); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) + { + if (this.field_150632_aF == 1) + { + double d0 = MathHelper.clamp_double((1.0D + plantNoise.func_151601_a((double)p_150572_2_ / 48.0D, (double)p_150572_4_ / 48.0D)) / 2.0D, 0.0D, 0.9999D); + int l = (int)(d0 * (double)BlockFlower.field_149859_a.length); + + if (l == 1) + { + l = 0; + } + + return BlockFlower.field_149859_a[l]; + } + else + { + return super.func_150572_a(p_150572_1_, p_150572_2_, p_150572_3_, p_150572_4_); + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + int k; + int l; + int i1; + int j1; + int k1; + + if (this.field_150632_aF == 3) + { + for (k = 0; k < 4; ++k) + { + for (l = 0; l < 4; ++l) + { + i1 = p_76728_3_ + k * 4 + 1 + 8 + p_76728_2_.nextInt(3); + j1 = p_76728_4_ + l * 4 + 1 + 8 + p_76728_2_.nextInt(3); + k1 = p_76728_1_.getHeightValue(i1, j1); + + if (p_76728_2_.nextInt(20) == 0) + { + WorldGenBigMushroom worldgenbigmushroom = new WorldGenBigMushroom(); + worldgenbigmushroom.generate(p_76728_1_, p_76728_2_, i1, k1, j1); + } + else + { + WorldGenAbstractTree worldgenabstracttree = this.func_150567_a(p_76728_2_); + worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D); + + if (worldgenabstracttree.generate(p_76728_1_, p_76728_2_, i1, k1, j1)) + { + worldgenabstracttree.func_150524_b(p_76728_1_, p_76728_2_, i1, k1, j1); + } + } + } + } + } + + k = p_76728_2_.nextInt(5) - 3; + + if (this.field_150632_aF == 1) + { + k += 2; + } + + l = 0; + + while (l < k) + { + i1 = p_76728_2_.nextInt(3); + + if (i1 == 0) + { + genTallFlowers.func_150548_a(1); + } + else if (i1 == 1) + { + genTallFlowers.func_150548_a(4); + } + else if (i1 == 2) + { + genTallFlowers.func_150548_a(5); + } + + j1 = 0; + + while (true) + { + if (j1 < 5) + { + k1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int i2 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int l1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(k1, i2) + 32); + + if (!genTallFlowers.generate(p_76728_1_, p_76728_2_, k1, l1, i2)) + { + ++j1; + continue; + } + } + + ++l; + break; + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + int l = super.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_3_); + return this.field_150632_aF == 3 ? (l & 16711422) + 2634762 >> 1 : l; + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + if (this.biomeID == BiomeGenBase.forest.biomeID) + { + BiomeGenForest biomegenforest = new BiomeGenForest(this.biomeID + 128, 1); + biomegenforest.setHeight(new BiomeGenBase.Height(this.rootHeight, this.heightVariation + 0.2F)); + biomegenforest.setBiomeName("Flower Forest"); + biomegenforest.func_150557_a(6976549, true); + biomegenforest.func_76733_a(8233509); + return biomegenforest; + } + else + { + return this.biomeID != BiomeGenBase.birchForest.biomeID && this.biomeID != BiomeGenBase.birchForestHills.biomeID ? new BiomeGenMutated(this.biomeID + 128, this) + { + private static final String __OBFID = "CL_00000172"; + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + this.baseBiome.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + }: new BiomeGenMutated(this.biomeID + 128, this) + { + private static final String __OBFID = "CL_00001861"; + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return p_150567_1_.nextBoolean() ? BiomeGenForest.field_150629_aC : BiomeGenForest.field_150630_aD; + } + }; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHell.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHell.java new file mode 100644 index 0000000..c3b9918 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHell.java @@ -0,0 +1,22 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; + +public class BiomeGenHell extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000173"; + + public BiomeGenHell(int p_i1981_1_) + { + super(p_i1981_1_); + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCaveCreatureList.clear(); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHills.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHills.java new file mode 100644 index 0000000..1423473 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenHills.java @@ -0,0 +1,114 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenHills extends BiomeGenBase +{ + private WorldGenerator theWorldGenerator; + private WorldGenTaiga2 field_150634_aD; + private int field_150635_aE; + private int field_150636_aF; + private int field_150637_aG; + private int field_150638_aH; + private static final String __OBFID = "CL_00000168"; + + public BiomeGenHills(int p_i45373_1_, boolean p_i45373_2_) + { + super(p_i45373_1_); + this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg, 8); + this.field_150634_aD = new WorldGenTaiga2(false); + this.field_150635_aE = 0; + this.field_150636_aF = 1; + this.field_150637_aG = 2; + this.field_150638_aH = this.field_150635_aE; + + if (p_i45373_2_) + { + this.theBiomeDecorator.treesPerChunk = 3; + this.field_150638_aH = this.field_150636_aF; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(p_150567_1_.nextInt(3) > 0 ? this.field_150634_aD : super.func_150567_a(p_150567_1_)); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + int k = 3 + p_76728_2_.nextInt(6); + int l; + int i1; + int j1; + + for (l = 0; l < k; ++l) + { + i1 = p_76728_3_ + p_76728_2_.nextInt(16); + j1 = p_76728_2_.nextInt(28) + 4; + int k1 = p_76728_4_ + p_76728_2_.nextInt(16); + + if (p_76728_1_.getBlock(i1, j1, k1).isReplaceableOreGen(p_76728_1_, i1, j1, k1, Blocks.stone)) + { + p_76728_1_.setBlock(i1, j1, k1, Blocks.emerald_ore, 0, 2); + } + } + + for (k = 0; k < 7; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16); + i1 = p_76728_2_.nextInt(64); + j1 = p_76728_4_ + p_76728_2_.nextInt(16); + this.theWorldGenerator.generate(p_76728_1_, p_76728_2_, l, i1, j1); + } + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if ((p_150573_7_ < -1.0D || p_150573_7_ > 2.0D) && this.field_150638_aH == this.field_150637_aG) + { + this.topBlock = Blocks.gravel; + this.fillerBlock = Blocks.gravel; + } + else if (p_150573_7_ > 1.0D && this.field_150638_aH != this.field_150636_aF) + { + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + } + + this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + /** + * this creates a mutation specific to Hills biomes + */ + public BiomeGenHills mutateHills(BiomeGenBase p_150633_1_) + { + this.field_150638_aH = this.field_150637_aG; + this.func_150557_a(p_150633_1_.color, true); + this.setBiomeName(p_150633_1_.biomeName + " M"); + this.setHeight(new BiomeGenBase.Height(p_150633_1_.rootHeight, p_150633_1_.heightVariation)); + this.setTemperatureRainfall(p_150633_1_.temperature, p_150633_1_.rainfall); + return this; + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + return (new BiomeGenHills(this.biomeID + 128, false)).mutateHills(this); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenJungle.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenJungle.java new file mode 100644 index 0000000..3799bcb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenJungle.java @@ -0,0 +1,79 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.entity.passive.EntityChicken; +import net.minecraft.entity.passive.EntityOcelot; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import net.minecraft.world.gen.feature.WorldGenMelon; +import net.minecraft.world.gen.feature.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenVines; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenJungle extends BiomeGenBase +{ + private boolean field_150614_aC; + private static final String __OBFID = "CL_00000175"; + + public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_) + { + super(p_i45379_1_); + this.field_150614_aC = p_i45379_2_; + + if (p_i45379_2_) + { + this.theBiomeDecorator.treesPerChunk = 2; + } + else + { + this.theBiomeDecorator.treesPerChunk = 50; + } + + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.flowersPerChunk = 4; + + if (!p_i45379_2_) + { + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1)); + } + + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(p_150567_1_.nextInt(10) == 0 ? this.worldGeneratorBigTree : (p_150567_1_.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (!this.field_150614_aC && p_150567_1_.nextInt(3) == 0 ? new WorldGenMegaJungle(false, 10, 20, 3, 3) : new WorldGenTrees(false, 4 + p_150567_1_.nextInt(7), 3, 3, true)))); + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) + { + return p_76730_1_.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + int k = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int l = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int height = p_76728_1_.getHeightValue(k, l) * 2; //This was the original input for the nextInt below. But it could == 0, which crashes nextInt + if (height < 1) height = 1; + int i1 = p_76728_2_.nextInt(height); + (new WorldGenMelon()).generate(p_76728_1_, p_76728_2_, k, i1, l); + WorldGenVines worldgenvines = new WorldGenVines(); + + for (l = 0; l < 50; ++l) + { + i1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + short short1 = 128; + int j1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + worldgenvines.generate(p_76728_1_, p_76728_2_, i1, short1, j1); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMesa.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMesa.java new file mode 100644 index 0000000..9c0955f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMesa.java @@ -0,0 +1,380 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Arrays; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGeneratorPerlin; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMesa extends BiomeGenBase +{ + private byte[] field_150621_aC; + private long field_150622_aD; + private NoiseGeneratorPerlin field_150623_aE; + private NoiseGeneratorPerlin field_150624_aF; + private NoiseGeneratorPerlin field_150625_aG; + private boolean field_150626_aH; + private boolean field_150620_aI; + private static final String __OBFID = "CL_00000176"; + + public BiomeGenMesa(int p_i45380_1_, boolean p_i45380_2_, boolean p_i45380_3_) + { + super(p_i45380_1_); + this.field_150626_aH = p_i45380_2_; + this.field_150620_aI = p_i45380_3_; + this.setDisableRain(); + this.setTemperatureRainfall(2.0F, 0.0F); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.sand; + this.field_150604_aj = 1; + this.fillerBlock = Blocks.stained_hardened_clay; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 20; + this.theBiomeDecorator.reedsPerChunk = 3; + this.theBiomeDecorator.cactiPerChunk = 5; + this.theBiomeDecorator.flowersPerChunk = 0; + this.spawnableCreatureList.clear(); + + if (p_i45380_3_) + { + this.theBiomeDecorator.treesPerChunk = 5; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return this.worldGeneratorTrees; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + if (this.field_150621_aC == null || this.field_150622_aD != p_150573_1_.getSeed()) + { + this.func_150619_a(p_150573_1_.getSeed()); + } + + if (this.field_150623_aE == null || this.field_150624_aF == null || this.field_150622_aD != p_150573_1_.getSeed()) + { + Random random1 = new Random(this.field_150622_aD); + this.field_150623_aE = new NoiseGeneratorPerlin(random1, 4); + this.field_150624_aF = new NoiseGeneratorPerlin(random1, 1); + } + + this.field_150622_aD = p_150573_1_.getSeed(); + double d5 = 0.0D; + int k; + int l; + + if (this.field_150626_aH) + { + k = (p_150573_5_ & -16) + (p_150573_6_ & 15); + l = (p_150573_6_ & -16) + (p_150573_5_ & 15); + double d1 = Math.min(Math.abs(p_150573_7_), this.field_150623_aE.func_151601_a((double)k * 0.25D, (double)l * 0.25D)); + + if (d1 > 0.0D) + { + double d2 = 0.001953125D; + double d3 = Math.abs(this.field_150624_aF.func_151601_a((double)k * d2, (double)l * d2)); + d5 = d1 * d1 * 2.5D; + double d4 = Math.ceil(d3 * 50.0D) + 14.0D; + + if (d5 > d4) + { + d5 = d4; + } + + d5 += 64.0D; + } + } + + k = p_150573_5_ & 15; + l = p_150573_6_ & 15; + boolean flag = true; + Block block = Blocks.stained_hardened_clay; + Block block2 = this.fillerBlock; + int i1 = (int)(p_150573_7_ / 3.0D + 3.0D + p_150573_2_.nextDouble() * 0.25D); + boolean flag1 = Math.cos(p_150573_7_ / 3.0D * Math.PI) > 0.0D; + int j1 = -1; + boolean flag2 = false; + int k1 = p_150573_3_.length / 256; + + for (int l1 = 255; l1 >= 0; --l1) + { + int i2 = (l * 16 + k) * k1 + l1; + + if ((p_150573_3_[i2] == null || p_150573_3_[i2].getMaterial() == Material.air) && l1 < (int)d5) + { + p_150573_3_[i2] = Blocks.stone; + } + + if (l1 <= 0 + p_150573_2_.nextInt(5)) + { + p_150573_3_[i2] = Blocks.bedrock; + } + else + { + Block block1 = p_150573_3_[i2]; + + if (block1 != null && block1.getMaterial() != Material.air) + { + if (block1 == Blocks.stone) + { + byte b0; + + if (j1 == -1) + { + flag2 = false; + + if (i1 <= 0) + { + block = null; + block2 = Blocks.stone; + } + else if (l1 >= 59 && l1 <= 64) + { + block = Blocks.stained_hardened_clay; + block2 = this.fillerBlock; + } + + if (l1 < 63 && (block == null || block.getMaterial() == Material.air)) + { + block = Blocks.water; + } + + j1 = i1 + Math.max(0, l1 - 63); + + if (l1 >= 62) + { + if (this.field_150620_aI && l1 > 86 + i1 * 2) + { + if (flag1) + { + p_150573_3_[i2] = Blocks.dirt; + p_150573_4_[i2] = 1; + } + else + { + p_150573_3_[i2] = Blocks.grass; + } + } + else if (l1 > 66 + i1) + { + b0 = 16; + + if (l1 >= 64 && l1 <= 127) + { + if (!flag1) + { + b0 = this.func_150618_d(p_150573_5_, l1, p_150573_6_); + } + } + else + { + b0 = 1; + } + + if (b0 < 16) + { + p_150573_3_[i2] = Blocks.stained_hardened_clay; + p_150573_4_[i2] = (byte)b0; + } + else + { + p_150573_3_[i2] = Blocks.hardened_clay; + } + } + else + { + p_150573_3_[i2] = this.topBlock; + p_150573_4_[i2] = (byte)this.field_150604_aj; + flag2 = true; + } + } + else + { + p_150573_3_[i2] = block2; + + if (block2 == Blocks.stained_hardened_clay) + { + p_150573_4_[i2] = 1; + } + } + } + else if (j1 > 0) + { + --j1; + + if (flag2) + { + p_150573_3_[i2] = Blocks.stained_hardened_clay; + p_150573_4_[i2] = 1; + } + else + { + b0 = this.func_150618_d(p_150573_5_, l1, p_150573_6_); + + if (b0 < 16) + { + p_150573_3_[i2] = Blocks.stained_hardened_clay; + p_150573_4_[i2] = b0; + } + else + { + p_150573_3_[i2] = Blocks.hardened_clay; + } + } + } + } + } + else + { + j1 = -1; + } + } + } + } + + public void func_150619_a(long p_150619_1_) + { + this.field_150621_aC = new byte[64]; + Arrays.fill(this.field_150621_aC, (byte)16); + Random random = new Random(p_150619_1_); + this.field_150625_aG = new NoiseGeneratorPerlin(random, 1); + int j; + + for (j = 0; j < 64; ++j) + { + j += random.nextInt(5) + 1; + + if (j < 64) + { + this.field_150621_aC[j] = 1; + } + } + + j = random.nextInt(4) + 2; + int k; + int l; + int i1; + int j1; + + for (k = 0; k < j; ++k) + { + l = random.nextInt(3) + 1; + i1 = random.nextInt(64); + + for (j1 = 0; i1 + j1 < 64 && j1 < l; ++j1) + { + this.field_150621_aC[i1 + j1] = 4; + } + } + + k = random.nextInt(4) + 2; + int k1; + + for (l = 0; l < k; ++l) + { + i1 = random.nextInt(3) + 2; + j1 = random.nextInt(64); + + for (k1 = 0; j1 + k1 < 64 && k1 < i1; ++k1) + { + this.field_150621_aC[j1 + k1] = 12; + } + } + + l = random.nextInt(4) + 2; + + for (i1 = 0; i1 < l; ++i1) + { + j1 = random.nextInt(3) + 1; + k1 = random.nextInt(64); + + for (int l1 = 0; k1 + l1 < 64 && l1 < j1; ++l1) + { + this.field_150621_aC[k1 + l1] = 14; + } + } + + i1 = random.nextInt(3) + 3; + j1 = 0; + + for (k1 = 0; k1 < i1; ++k1) + { + byte b0 = 1; + j1 += random.nextInt(16) + 4; + + for (int i2 = 0; j1 + i2 < 64 && i2 < b0; ++i2) + { + this.field_150621_aC[j1 + i2] = 0; + + if (j1 + i2 > 1 && random.nextBoolean()) + { + this.field_150621_aC[j1 + i2 - 1] = 8; + } + + if (j1 + i2 < 63 && random.nextBoolean()) + { + this.field_150621_aC[j1 + i2 + 1] = 8; + } + } + } + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) + { + return 10387789; + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + return 9470285; + } + + public byte func_150618_d(int p_150618_1_, int p_150618_2_, int p_150618_3_) + { + int l = (int)Math.round(this.field_150625_aG.func_151601_a((double)p_150618_1_ * 1.0D / 512.0D, (double)p_150618_1_ * 1.0D / 512.0D) * 2.0D); + return this.field_150621_aC[(p_150618_2_ + l + 64) % 64]; + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + boolean flag = this.biomeID == BiomeGenBase.mesa.biomeID; + BiomeGenMesa biomegenmesa = new BiomeGenMesa(this.biomeID + 128, flag, this.field_150620_aI); + + if (!flag) + { + biomegenmesa.setHeight(height_LowHills); + biomegenmesa.setBiomeName(this.biomeName + " M"); + } + else + { + biomegenmesa.setBiomeName(this.biomeName + " (Bryce)"); + } + + biomegenmesa.func_150557_a(this.color, true); + return biomegenmesa; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java new file mode 100644 index 0000000..17ce4c7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMushroomIsland.java @@ -0,0 +1,24 @@ +package net.minecraft.world.biome; + +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.init.Blocks; + +public class BiomeGenMushroomIsland extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000177"; + + public BiomeGenMushroomIsland(int p_i1984_1_) + { + super(p_i1984_1_); + this.theBiomeDecorator.treesPerChunk = -100; + this.theBiomeDecorator.flowersPerChunk = -100; + this.theBiomeDecorator.grassPerChunk = -100; + this.theBiomeDecorator.mushroomsPerChunk = 1; + this.theBiomeDecorator.bigMushroomsPerChunk = 1; + this.topBlock = Blocks.mycelium; + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMutated.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMutated.java new file mode 100644 index 0000000..1fa3a12 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenMutated.java @@ -0,0 +1,100 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenMutated extends BiomeGenBase +{ + protected BiomeGenBase baseBiome; + private static final String __OBFID = "CL_00000178"; + + public BiomeGenMutated(int p_i45381_1_, BiomeGenBase p_i45381_2_) + { + super(p_i45381_1_); + this.baseBiome = p_i45381_2_; + this.func_150557_a(p_i45381_2_.color, true); + this.biomeName = p_i45381_2_.biomeName + " M"; + this.topBlock = p_i45381_2_.topBlock; + this.fillerBlock = p_i45381_2_.fillerBlock; + this.field_76754_C = p_i45381_2_.field_76754_C; + this.rootHeight = p_i45381_2_.rootHeight; + this.heightVariation = p_i45381_2_.heightVariation; + this.temperature = p_i45381_2_.temperature; + this.rainfall = p_i45381_2_.rainfall; + this.waterColorMultiplier = p_i45381_2_.waterColorMultiplier; + this.enableSnow = p_i45381_2_.enableSnow; + this.enableRain = p_i45381_2_.enableRain; + this.spawnableCreatureList = new ArrayList(p_i45381_2_.spawnableCreatureList); + this.spawnableMonsterList = new ArrayList(p_i45381_2_.spawnableMonsterList); + this.spawnableCaveCreatureList = new ArrayList(p_i45381_2_.spawnableCaveCreatureList); + this.spawnableWaterCreatureList = new ArrayList(p_i45381_2_.spawnableWaterCreatureList); + this.temperature = p_i45381_2_.temperature; + this.rainfall = p_i45381_2_.rainfall; + this.rootHeight = p_i45381_2_.rootHeight + 0.1F; + this.heightVariation = p_i45381_2_.heightVariation + 0.2F; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + this.baseBiome.theBiomeDecorator.decorateChunk(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + this.baseBiome.genTerrainBlocks(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + /** + * returns the chance a creature has to spawn. + */ + public float getSpawningChance() + { + return this.baseBiome.getSpawningChance(); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return this.baseBiome.func_150567_a(p_150567_1_); + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) + { + return this.baseBiome.getBiomeFoliageColor(p_150571_1_, p_150571_2_, p_150571_2_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + return this.baseBiome.getBiomeGrassColor(p_150558_1_, p_150558_2_, p_150558_2_); + } + + public Class getBiomeClass() + { + return this.baseBiome.getBiomeClass(); + } + + /** + * returns true if the biome specified is equal to this biome + */ + public boolean isEqualTo(BiomeGenBase p_150569_1_) + { + return this.baseBiome.isEqualTo(p_150569_1_); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return this.baseBiome.getTempCategory(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenOcean.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenOcean.java new file mode 100644 index 0000000..e72d0a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenOcean.java @@ -0,0 +1,26 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class BiomeGenOcean extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000179"; + + public BiomeGenOcean(int p_i1985_1_) + { + super(p_i1985_1_); + this.spawnableCreatureList.clear(); + } + + public BiomeGenBase.TempCategory getTempCategory() + { + return BiomeGenBase.TempCategory.OCEAN; + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + super.genTerrainBlocks(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenPlains.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenPlains.java new file mode 100644 index 0000000..6760483 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenPlains.java @@ -0,0 +1,112 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.BlockFlower; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class BiomeGenPlains extends BiomeGenBase +{ + protected boolean field_150628_aC; + private static final String __OBFID = "CL_00000180"; + + public BiomeGenPlains(int p_i1986_1_) + { + super(p_i1986_1_); + this.setTemperatureRainfall(0.8F, 0.4F); + this.setHeight(height_LowPlains); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6)); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + this.flowers.clear(); + this.addFlower(Blocks.red_flower, 4, 3); + this.addFlower(Blocks.red_flower, 5, 3); + this.addFlower(Blocks.red_flower, 6, 3); + this.addFlower(Blocks.red_flower, 7, 3); + this.addFlower(Blocks.red_flower, 0, 20); + this.addFlower(Blocks.red_flower, 3, 20); + this.addFlower(Blocks.red_flower, 8, 20); + this.addFlower(Blocks.yellow_flower, 0, 30); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) + { + double d0 = plantNoise.func_151601_a((double)p_150572_2_ / 200.0D, (double)p_150572_4_ / 200.0D); + int l; + + if (d0 < -0.8D) + { + l = p_150572_1_.nextInt(4); + return BlockFlower.field_149859_a[4 + l]; + } + else if (p_150572_1_.nextInt(3) > 0) + { + l = p_150572_1_.nextInt(3); + return l == 0 ? BlockFlower.field_149859_a[0] : (l == 1 ? BlockFlower.field_149859_a[3] : BlockFlower.field_149859_a[8]); + } + else + { + return BlockFlower.field_149858_b[0]; + } + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + double d0 = plantNoise.func_151601_a((double)(p_76728_3_ + 8) / 200.0D, (double)(p_76728_4_ + 8) / 200.0D); + int k; + int l; + int i1; + int j1; + + if (d0 < -0.8D) + { + this.theBiomeDecorator.flowersPerChunk = 15; + this.theBiomeDecorator.grassPerChunk = 5; + } + else + { + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; + genTallFlowers.func_150548_a(2); + + for (k = 0; k < 7; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + j1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(l, i1) + 32); + genTallFlowers.generate(p_76728_1_, p_76728_2_, l, j1, i1); + } + } + + if (this.field_150628_aC) + { + genTallFlowers.func_150548_a(0); + + for (k = 0; k < 10; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + j1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(l, i1) + 32); + genTallFlowers.generate(p_76728_1_, p_76728_2_, l, j1, i1); + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + BiomeGenPlains biomegenplains = new BiomeGenPlains(this.biomeID + 128); + biomegenplains.setBiomeName("Sunflower Plains"); + biomegenplains.field_150628_aC = true; + biomegenplains.setColor(9286496); + biomegenplains.field_150609_ah = 14273354; + return biomegenplains; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenRiver.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenRiver.java new file mode 100644 index 0000000..68a45a9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenRiver.java @@ -0,0 +1,12 @@ +package net.minecraft.world.biome; + +public class BiomeGenRiver extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000181"; + + public BiomeGenRiver(int p_i1987_1_) + { + super(p_i1987_1_); + this.spawnableCreatureList.clear(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSavanna.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSavanna.java new file mode 100644 index 0000000..575351d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSavanna.java @@ -0,0 +1,95 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenSavannaTree; + +public class BiomeGenSavanna extends BiomeGenBase +{ + private static final WorldGenSavannaTree field_150627_aC = new WorldGenSavannaTree(false); + private static final String __OBFID = "CL_00000182"; + + public BiomeGenSavanna(int p_i45383_1_) + { + super(p_i45383_1_); + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 1, 2, 6)); + this.theBiomeDecorator.treesPerChunk = 1; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 20; + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)(p_150567_1_.nextInt(5) > 0 ? field_150627_aC : this.worldGeneratorTrees); + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + BiomeGenSavanna.Mutated mutated = new BiomeGenSavanna.Mutated(this.biomeID + 128, this); + mutated.temperature = (this.temperature + 1.0F) * 0.5F; + mutated.rootHeight = this.rootHeight * 0.5F + 0.3F; + mutated.heightVariation = this.heightVariation * 0.5F + 1.2F; + return mutated; + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + genTallFlowers.func_150548_a(2); + + for (int k = 0; k < 7; ++k) + { + int l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int j1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(l, i1) + 32); + genTallFlowers.generate(p_76728_1_, p_76728_2_, l, j1, i1); + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public static class Mutated extends BiomeGenMutated + { + private static final String __OBFID = "CL_00000183"; + + public Mutated(int p_i45382_1_, BiomeGenBase p_i45382_2_) + { + super(p_i45382_1_, p_i45382_2_); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 2; + this.theBiomeDecorator.grassPerChunk = 5; + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if (p_150573_7_ > 1.75D) + { + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + } + else if (p_150573_7_ > -0.5D) + { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 1; + } + + this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + this.theBiomeDecorator.decorateChunk(p_76728_1_, p_76728_2_, this, p_76728_3_, p_76728_4_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSnow.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSnow.java new file mode 100644 index 0000000..da1c182 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSnow.java @@ -0,0 +1,73 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenIcePath; +import net.minecraft.world.gen.feature.WorldGenIceSpike; +import net.minecraft.world.gen.feature.WorldGenTaiga2; + +public class BiomeGenSnow extends BiomeGenBase +{ + private boolean field_150615_aC; + private WorldGenIceSpike field_150616_aD = new WorldGenIceSpike(); + private WorldGenIcePath field_150617_aE = new WorldGenIcePath(4); + private static final String __OBFID = "CL_00000174"; + + public BiomeGenSnow(int p_i45378_1_, boolean p_i45378_2_) + { + super(p_i45378_1_); + this.field_150615_aC = p_i45378_2_; + + if (p_i45378_2_) + { + this.topBlock = Blocks.snow; + } + + this.spawnableCreatureList.clear(); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + if (this.field_150615_aC) + { + int k; + int l; + int i1; + + for (k = 0; k < 3; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + this.field_150616_aD.generate(p_76728_1_, p_76728_2_, l, p_76728_1_.getHeightValue(l, i1), i1); + } + + for (k = 0; k < 2; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + this.field_150617_aE.generate(p_76728_1_, p_76728_2_, l, p_76728_1_.getHeightValue(l, i1), i1); + } + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return new WorldGenTaiga2(false); + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + BiomeGenBase biomegenbase = (new BiomeGenSnow(this.biomeID + 128, true)).func_150557_a(13828095, true).setBiomeName(this.biomeName + " Spikes").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F).setHeight(new BiomeGenBase.Height(this.rootHeight + 0.1F, this.heightVariation + 0.1F)); + biomegenbase.rootHeight = this.rootHeight + 0.3F; + biomegenbase.heightVariation = this.heightVariation + 0.4F; + return biomegenbase; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenStoneBeach.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenStoneBeach.java new file mode 100644 index 0000000..4aadb58 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenStoneBeach.java @@ -0,0 +1,20 @@ +package net.minecraft.world.biome; + +import net.minecraft.init.Blocks; + +public class BiomeGenStoneBeach extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000184"; + + public BiomeGenStoneBeach(int p_i45384_1_) + { + super(p_i45384_1_); + this.spawnableCreatureList.clear(); + this.topBlock = Blocks.stone; + this.fillerBlock = Blocks.stone; + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 0; + this.theBiomeDecorator.reedsPerChunk = 0; + this.theBiomeDecorator.cactiPerChunk = 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSwamp.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSwamp.java new file mode 100644 index 0000000..1b0c692 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenSwamp.java @@ -0,0 +1,99 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.material.Material; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class BiomeGenSwamp extends BiomeGenBase +{ + private static final String __OBFID = "CL_00000185"; + + protected BiomeGenSwamp(int p_i1988_1_) + { + super(p_i1988_1_); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 1; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 8; + this.theBiomeDecorator.reedsPerChunk = 10; + this.theBiomeDecorator.clayPerChunk = 1; + this.theBiomeDecorator.waterlilyPerChunk = 4; + this.theBiomeDecorator.sandPerChunk2 = 0; + this.theBiomeDecorator.sandPerChunk = 0; + this.theBiomeDecorator.grassPerChunk = 5; + this.waterColorMultiplier = 14745518; + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); + this.flowers.clear(); + this.addFlower(Blocks.red_flower, 1, 10); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return this.worldGeneratorSwamp; + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) + { + return BlockFlower.field_149859_a[1]; + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + double d1 = plantNoise.func_151601_a((double)p_150573_5_ * 0.25D, (double)p_150573_6_ * 0.25D); + + if (d1 > 0.0D) + { + int k = p_150573_5_ & 15; + int l = p_150573_6_ & 15; + int i1 = p_150573_3_.length / 256; + + for (int j1 = 255; j1 >= 0; --j1) + { + int k1 = (l * 16 + k) * i1 + j1; + + if (p_150573_3_[k1] == null || p_150573_3_[k1].getMaterial() != Material.air) + { + if (j1 == 62 && p_150573_3_[k1] != Blocks.water) + { + p_150573_3_[k1] = Blocks.water; + + if (d1 < 0.12D) + { + p_150573_3_[k1 + 1] = Blocks.waterlily; + } + } + + break; + } + } + } + + this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + /** + * Provides the basic grass color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + double d0 = plantNoise.func_151601_a((double)p_150558_1_ * 0.0225D, (double)p_150558_3_ * 0.0225D); + return d0 < -0.1D ? 5011004 : 6975545; + } + + /** + * Provides the basic foliage color based on the biome temperature and rainfall + */ + @SideOnly(Side.CLIENT) + public int getBiomeFoliageColor(int p_150571_1_, int p_150571_2_, int p_150571_3_) + { + return 6975545; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenTaiga.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenTaiga.java new file mode 100644 index 0000000..c6b3be0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/BiomeGenTaiga.java @@ -0,0 +1,123 @@ +package net.minecraft.world.biome; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBlockBlob; +import net.minecraft.world.gen.feature.WorldGenMegaPineTree; +import net.minecraft.world.gen.feature.WorldGenTaiga1; +import net.minecraft.world.gen.feature.WorldGenTaiga2; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class BiomeGenTaiga extends BiomeGenBase +{ + private static final WorldGenTaiga1 field_150639_aC = new WorldGenTaiga1(); + private static final WorldGenTaiga2 field_150640_aD = new WorldGenTaiga2(false); + private static final WorldGenMegaPineTree field_150641_aE = new WorldGenMegaPineTree(false, false); + private static final WorldGenMegaPineTree field_150642_aF = new WorldGenMegaPineTree(false, true); + private static final WorldGenBlockBlob field_150643_aG = new WorldGenBlockBlob(Blocks.mossy_cobblestone, 0); + private int field_150644_aH; + private static final String __OBFID = "CL_00000186"; + + public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_) + { + super(p_i45385_1_); + this.field_150644_aH = p_i45385_2_; + this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + + if (p_i45385_2_ != 1 && p_i45385_2_ != 2) + { + this.theBiomeDecorator.grassPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 1; + } + else + { + this.theBiomeDecorator.grassPerChunk = 7; + this.theBiomeDecorator.deadBushPerChunk = 1; + this.theBiomeDecorator.mushroomsPerChunk = 3; + } + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) + { + return (WorldGenAbstractTree)((this.field_150644_aH == 1 || this.field_150644_aH == 2) && p_150567_1_.nextInt(3) == 0 ? (this.field_150644_aH != 2 && p_150567_1_.nextInt(13) != 0 ? field_150641_aE : field_150642_aF) : (p_150567_1_.nextInt(3) == 0 ? field_150639_aC : field_150640_aD)); + } + + /** + * Gets a WorldGen appropriate for this biome. + */ + public WorldGenerator getRandomWorldGenForGrass(Random p_76730_1_) + { + return p_76730_1_.nextInt(5) > 0 ? new WorldGenTallGrass(Blocks.tallgrass, 2) : new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + public void decorate(World p_76728_1_, Random p_76728_2_, int p_76728_3_, int p_76728_4_) + { + int k; + int l; + int i1; + int j1; + + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) + { + k = p_76728_2_.nextInt(3); + + for (l = 0; l < k; ++l) + { + i1 = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + j1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + int k1 = p_76728_1_.getHeightValue(i1, j1); + field_150643_aG.generate(p_76728_1_, p_76728_2_, i1, k1, j1); + } + } + + genTallFlowers.func_150548_a(3); + + for (k = 0; k < 7; ++k) + { + l = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + i1 = p_76728_4_ + p_76728_2_.nextInt(16) + 8; + j1 = p_76728_2_.nextInt(p_76728_1_.getHeightValue(l, i1) + 32); + genTallFlowers.generate(p_76728_1_, p_76728_2_, l, j1, i1); + } + + super.decorate(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + } + + public void genTerrainBlocks(World p_150573_1_, Random p_150573_2_, Block[] p_150573_3_, byte[] p_150573_4_, int p_150573_5_, int p_150573_6_, double p_150573_7_) + { + if (this.field_150644_aH == 1 || this.field_150644_aH == 2) + { + this.topBlock = Blocks.grass; + this.field_150604_aj = 0; + this.fillerBlock = Blocks.dirt; + + if (p_150573_7_ > 1.75D) + { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 1; + } + else if (p_150573_7_ > -0.95D) + { + this.topBlock = Blocks.dirt; + this.field_150604_aj = 2; + } + } + + this.genBiomeTerrain(p_150573_1_, p_150573_2_, p_150573_3_, p_150573_4_, p_150573_5_, p_150573_6_, p_150573_7_); + } + + /** + * Creates a mutated version of the biome and places it into the biomeList with an index equal to the original plus + * 128 + */ + public BiomeGenBase createMutation() + { + return this.biomeID == BiomeGenBase.megaTaiga.biomeID ? (new BiomeGenTaiga(this.biomeID + 128, 2)).func_150557_a(5858897, true).setBiomeName("Mega Spruce Taiga").func_76733_a(5159473).setTemperatureRainfall(0.25F, 0.8F).setHeight(new BiomeGenBase.Height(this.rootHeight, this.heightVariation)) : super.createMutation(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManager.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManager.java new file mode 100644 index 0000000..019d1eb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManager.java @@ -0,0 +1,284 @@ +package net.minecraft.world.biome; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.WorldTypeEvent; +import static net.minecraft.world.biome.BiomeGenBase.*; + +public class WorldChunkManager +{ + public static ArrayList allowedBiomes = new ArrayList(Arrays.asList(forest, plains, taiga, taigaHills, forestHills, jungle, jungleHills)); + private GenLayer genBiomes; + /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */ + private GenLayer biomeIndexLayer; + /** The BiomeCache object for this world. */ + private BiomeCache biomeCache; + /** A list of biomes that the player can spawn in. */ + private List biomesToSpawnIn; + private static final String __OBFID = "CL_00000166"; + + protected WorldChunkManager() + { + this.biomeCache = new BiomeCache(this); + this.biomesToSpawnIn = new ArrayList(); + this.biomesToSpawnIn.addAll(allowedBiomes); + } + + public WorldChunkManager(long p_i1975_1_, WorldType p_i1975_3_) + { + this(); + GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(p_i1975_1_, p_i1975_3_); + agenlayer = getModdedBiomeGenerators(p_i1975_3_, p_i1975_1_, agenlayer); + this.genBiomes = agenlayer[0]; + this.biomeIndexLayer = agenlayer[1]; + } + + public WorldChunkManager(World p_i1976_1_) + { + this(p_i1976_1_.getSeed(), p_i1976_1_.getWorldInfo().getTerrainType()); + } + + /** + * Gets the list of valid biomes for the player to spawn in. + */ + public List getBiomesToSpawnIn() + { + return this.biomesToSpawnIn; + } + + /** + * Returns the BiomeGenBase related to the x, z position on the world. + */ + public BiomeGenBase getBiomeGenAt(int p_76935_1_, int p_76935_2_) + { + return this.biomeCache.getBiomeGenAt(p_76935_1_, p_76935_2_); + } + + /** + * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] p_76936_1_, int p_76936_2_, int p_76936_3_, int p_76936_4_, int p_76936_5_) + { + IntCache.resetIntCache(); + + if (p_76936_1_ == null || p_76936_1_.length < p_76936_4_ * p_76936_5_) + { + p_76936_1_ = new float[p_76936_4_ * p_76936_5_]; + } + + int[] aint = this.biomeIndexLayer.getInts(p_76936_2_, p_76936_3_, p_76936_4_, p_76936_5_); + + for (int i1 = 0; i1 < p_76936_4_ * p_76936_5_; ++i1) + { + try + { + float f = (float)BiomeGenBase.getBiome(aint[i1]).getIntRainfall() / 65536.0F; + + if (f > 1.0F) + { + f = 1.0F; + } + + p_76936_1_[i1] = f; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("DownfallBlock"); + crashreportcategory.addCrashSection("biome id", Integer.valueOf(i1)); + crashreportcategory.addCrashSection("downfalls[] size", Integer.valueOf(p_76936_1_.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(p_76936_2_)); + crashreportcategory.addCrashSection("z", Integer.valueOf(p_76936_3_)); + crashreportcategory.addCrashSection("w", Integer.valueOf(p_76936_4_)); + crashreportcategory.addCrashSection("h", Integer.valueOf(p_76936_5_)); + throw new ReportedException(crashreport); + } + } + + return p_76936_1_; + } + + /** + * Return an adjusted version of a given temperature based on the y height + */ + @SideOnly(Side.CLIENT) + public float getTemperatureAtHeight(float p_76939_1_, int p_76939_2_) + { + return p_76939_1_; + } + + /** + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] p_76937_1_, int p_76937_2_, int p_76937_3_, int p_76937_4_, int p_76937_5_) + { + IntCache.resetIntCache(); + + if (p_76937_1_ == null || p_76937_1_.length < p_76937_4_ * p_76937_5_) + { + p_76937_1_ = new BiomeGenBase[p_76937_4_ * p_76937_5_]; + } + + int[] aint = this.genBiomes.getInts(p_76937_2_, p_76937_3_, p_76937_4_, p_76937_5_); + + try + { + for (int i1 = 0; i1 < p_76937_4_ * p_76937_5_; ++i1) + { + p_76937_1_[i1] = BiomeGenBase.getBiome(aint[i1]); + } + + return p_76937_1_; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("RawBiomeBlock"); + crashreportcategory.addCrashSection("biomes[] size", Integer.valueOf(p_76937_1_.length)); + crashreportcategory.addCrashSection("x", Integer.valueOf(p_76937_2_)); + crashreportcategory.addCrashSection("z", Integer.valueOf(p_76937_3_)); + crashreportcategory.addCrashSection("w", Integer.valueOf(p_76937_4_)); + crashreportcategory.addCrashSection("h", Integer.valueOf(p_76937_5_)); + throw new ReportedException(crashreport); + } + } + + /** + * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the + * WorldChunkManager Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] p_76933_1_, int p_76933_2_, int p_76933_3_, int p_76933_4_, int p_76933_5_) + { + return this.getBiomeGenAt(p_76933_1_, p_76933_2_, p_76933_3_, p_76933_4_, p_76933_5_, true); + } + + /** + * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, + * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] p_76931_1_, int p_76931_2_, int p_76931_3_, int p_76931_4_, int p_76931_5_, boolean p_76931_6_) + { + IntCache.resetIntCache(); + + if (p_76931_1_ == null || p_76931_1_.length < p_76931_4_ * p_76931_5_) + { + p_76931_1_ = new BiomeGenBase[p_76931_4_ * p_76931_5_]; + } + + if (p_76931_6_ && p_76931_4_ == 16 && p_76931_5_ == 16 && (p_76931_2_ & 15) == 0 && (p_76931_3_ & 15) == 0) + { + BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(p_76931_2_, p_76931_3_); + System.arraycopy(abiomegenbase1, 0, p_76931_1_, 0, p_76931_4_ * p_76931_5_); + return p_76931_1_; + } + else + { + int[] aint = this.biomeIndexLayer.getInts(p_76931_2_, p_76931_3_, p_76931_4_, p_76931_5_); + + for (int i1 = 0; i1 < p_76931_4_ * p_76931_5_; ++i1) + { + p_76931_1_[i1] = BiomeGenBase.getBiome(aint[i1]); + } + + return p_76931_1_; + } + } + + /** + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) + { + IntCache.resetIntCache(); + int l = p_76940_1_ - p_76940_3_ >> 2; + int i1 = p_76940_2_ - p_76940_3_ >> 2; + int j1 = p_76940_1_ + p_76940_3_ >> 2; + int k1 = p_76940_2_ + p_76940_3_ >> 2; + int l1 = j1 - l + 1; + int i2 = k1 - i1 + 1; + int[] aint = this.genBiomes.getInts(l, i1, l1, i2); + + try + { + for (int j2 = 0; j2 < l1 * i2; ++j2) + { + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[j2]); + + if (!p_76940_4_.contains(biomegenbase)) + { + return false; + } + } + + return true; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer"); + crashreportcategory.addCrashSection("Layer", this.genBiomes.toString()); + crashreportcategory.addCrashSection("x", Integer.valueOf(p_76940_1_)); + crashreportcategory.addCrashSection("z", Integer.valueOf(p_76940_2_)); + crashreportcategory.addCrashSection("radius", Integer.valueOf(p_76940_3_)); + crashreportcategory.addCrashSection("allowed", p_76940_4_); + throw new ReportedException(crashreport); + } + } + + public ChunkPosition findBiomePosition(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) + { + IntCache.resetIntCache(); + int l = p_150795_1_ - p_150795_3_ >> 2; + int i1 = p_150795_2_ - p_150795_3_ >> 2; + int j1 = p_150795_1_ + p_150795_3_ >> 2; + int k1 = p_150795_2_ + p_150795_3_ >> 2; + int l1 = j1 - l + 1; + int i2 = k1 - i1 + 1; + int[] aint = this.genBiomes.getInts(l, i1, l1, i2); + ChunkPosition chunkposition = null; + int j2 = 0; + + for (int k2 = 0; k2 < l1 * i2; ++k2) + { + int l2 = l + k2 % l1 << 2; + int i3 = i1 + k2 / l1 << 2; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(aint[k2]); + + if (p_150795_4_.contains(biomegenbase) && (chunkposition == null || p_150795_5_.nextInt(j2 + 1) == 0)) + { + chunkposition = new ChunkPosition(l2, 0, i3); + ++j2; + } + } + + return chunkposition; + } + + /** + * Calls the WorldChunkManager's biomeCache.cleanupCache() + */ + public void cleanupCache() + { + this.biomeCache.cleanupCache(); + } + + public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) + { + WorldTypeEvent.InitBiomeGens event = new WorldTypeEvent.InitBiomeGens(worldType, seed, original); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.newBiomeGens; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManagerHell.java b/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManagerHell.java new file mode 100644 index 0000000..90a9d4e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/biome/WorldChunkManagerHell.java @@ -0,0 +1,94 @@ +package net.minecraft.world.biome; + +import java.util.Arrays; +import java.util.List; +import java.util.Random; +import net.minecraft.world.ChunkPosition; + +public class WorldChunkManagerHell extends WorldChunkManager +{ + /** The biome generator object. */ + private BiomeGenBase biomeGenerator; + /** The rainfall in the world */ + private float rainfall; + private static final String __OBFID = "CL_00000169"; + + public WorldChunkManagerHell(BiomeGenBase p_i45374_1_, float p_i45374_2_) + { + this.biomeGenerator = p_i45374_1_; + this.rainfall = p_i45374_2_; + } + + /** + * Returns the BiomeGenBase related to the x, z position on the world. + */ + public BiomeGenBase getBiomeGenAt(int p_76935_1_, int p_76935_2_) + { + return this.biomeGenerator; + } + + /** + * Returns an array of biomes for the location input. + */ + public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] p_76937_1_, int p_76937_2_, int p_76937_3_, int p_76937_4_, int p_76937_5_) + { + if (p_76937_1_ == null || p_76937_1_.length < p_76937_4_ * p_76937_5_) + { + p_76937_1_ = new BiomeGenBase[p_76937_4_ * p_76937_5_]; + } + + Arrays.fill(p_76937_1_, 0, p_76937_4_ * p_76937_5_, this.biomeGenerator); + return p_76937_1_; + } + + /** + * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. + */ + public float[] getRainfall(float[] p_76936_1_, int p_76936_2_, int p_76936_3_, int p_76936_4_, int p_76936_5_) + { + if (p_76936_1_ == null || p_76936_1_.length < p_76936_4_ * p_76936_5_) + { + p_76936_1_ = new float[p_76936_4_ * p_76936_5_]; + } + + Arrays.fill(p_76936_1_, 0, p_76936_4_ * p_76936_5_, this.rainfall); + return p_76936_1_; + } + + /** + * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the + * WorldChunkManager Args: oldBiomeList, x, z, width, depth + */ + public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] p_76933_1_, int p_76933_2_, int p_76933_3_, int p_76933_4_, int p_76933_5_) + { + if (p_76933_1_ == null || p_76933_1_.length < p_76933_4_ * p_76933_5_) + { + p_76933_1_ = new BiomeGenBase[p_76933_4_ * p_76933_5_]; + } + + Arrays.fill(p_76933_1_, 0, p_76933_4_ * p_76933_5_, this.biomeGenerator); + return p_76933_1_; + } + + /** + * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, + * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) + */ + public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] p_76931_1_, int p_76931_2_, int p_76931_3_, int p_76931_4_, int p_76931_5_, boolean p_76931_6_) + { + return this.loadBlockGeneratorData(p_76931_1_, p_76931_2_, p_76931_3_, p_76931_4_, p_76931_5_); + } + + public ChunkPosition findBiomePosition(int p_150795_1_, int p_150795_2_, int p_150795_3_, List p_150795_4_, Random p_150795_5_) + { + return p_150795_4_.contains(this.biomeGenerator) ? new ChunkPosition(p_150795_1_ - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1), 0, p_150795_2_ - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1)) : null; + } + + /** + * checks given Chunk's Biomes against List of allowed ones + */ + public boolean areBiomesViable(int p_76940_1_, int p_76940_2_, int p_76940_3_, List p_76940_4_) + { + return p_76940_4_.contains(this.biomeGenerator); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/Chunk.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/Chunk.java new file mode 100644 index 0000000..467e26c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/Chunk.java @@ -0,0 +1,1660 @@ +package net.minecraft.world.chunk; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.command.IEntitySelector; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.EntityEvent; +import net.minecraftforge.event.world.ChunkEvent; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Chunk +{ + private static final Logger logger = LogManager.getLogger(); + /** Determines if the chunk is lit or not at a light value greater than 0. */ + public static boolean isLit; + /** + * Used to store block IDs, block MSBs, Sky-light maps, Block-light maps, and metadata. Each entry corresponds to a + * logical segment of 16x16x16 blocks, stacked vertically. + */ + private ExtendedBlockStorage[] storageArrays; + /** Contains a 16x16 mapping on the X/Z plane of the biome ID to which each colum belongs. */ + private byte[] blockBiomeArray; + /** A map, similar to heightMap, that tracks how far down precipitation can fall. */ + public int[] precipitationHeightMap; + /** Which columns need their skylightMaps updated. */ + public boolean[] updateSkylightColumns; + /** Whether or not this Chunk is currently loaded into the World */ + public boolean isChunkLoaded; + /** Reference to the World object. */ + public World worldObj; + public int[] heightMap; + /** The x coordinate of the chunk. */ + public final int xPosition; + /** The z coordinate of the chunk. */ + public final int zPosition; + private boolean isGapLightingUpdated; + /** A Map of ChunkPositions to TileEntities in this chunk */ + public Map chunkTileEntityMap; + /** Array of Lists containing the entities in this Chunk. Each List represents a 16 block subchunk. */ + public List[] entityLists; + /** Boolean value indicating if the terrain is populated. */ + public boolean isTerrainPopulated; + public boolean isLightPopulated; + public boolean field_150815_m; + /** Set to true if the chunk has been modified and needs to be updated internally. */ + public boolean isModified; + /** Whether this Chunk has any Entities and thus requires saving on every tick */ + public boolean hasEntities; + /** The time according to World.worldTime when this chunk was last saved */ + public long lastSaveTime; + /** + * Updates to this chunk will not be sent to clients if this is false. This field is set to true the first time the + * chunk is sent to a client, and never set to false. + */ + public boolean sendUpdates; + /** Lowest value in the heightmap. */ + public int heightMapMinimum; + /** the cumulative number of ticks players have been in this chunk */ + public long inhabitedTime; + /** Contains the current round-robin relight check index, and is implied as the relight check location as well. */ + private int queuedLightChecks; + private static final String __OBFID = "CL_00000373"; + + public Chunk(World p_i1995_1_, int p_i1995_2_, int p_i1995_3_) + { + this.storageArrays = new ExtendedBlockStorage[16]; + this.blockBiomeArray = new byte[256]; + this.precipitationHeightMap = new int[256]; + this.updateSkylightColumns = new boolean[256]; + this.chunkTileEntityMap = new HashMap(); + this.queuedLightChecks = 4096; + this.entityLists = new List[16]; + this.worldObj = p_i1995_1_; + this.xPosition = p_i1995_2_; + this.zPosition = p_i1995_3_; + this.heightMap = new int[256]; + + for (int k = 0; k < this.entityLists.length; ++k) + { + this.entityLists[k] = new ArrayList(); + } + + Arrays.fill(this.precipitationHeightMap, -999); + Arrays.fill(this.blockBiomeArray, (byte) - 1); + } + + public Chunk(World p_i45446_1_, Block[] p_i45446_2_, int p_i45446_3_, int p_i45446_4_) + { + this(p_i45446_1_, p_i45446_3_, p_i45446_4_); + int k = p_i45446_2_.length / 256; + boolean flag = !p_i45446_1_.provider.hasNoSky; + + for (int l = 0; l < 16; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + for (int j1 = 0; j1 < k; ++j1) + { + Block block = p_i45446_2_[l << 11 | i1 << 7 | j1]; + + if (block != null && block.getMaterial() != Material.air) + { + int k1 = j1 >> 4; + + if (this.storageArrays[k1] == null) + { + this.storageArrays[k1] = new ExtendedBlockStorage(k1 << 4, flag); + } + + this.storageArrays[k1].func_150818_a(l, j1 & 15, i1, block); + } + } + } + } + } + + public Chunk(World p_i45447_1_, Block[] p_i45447_2_, byte[] p_i45447_3_, int p_i45447_4_, int p_i45447_5_) + { + this(p_i45447_1_, p_i45447_4_, p_i45447_5_); + int k = p_i45447_2_.length / 256; + boolean flag = !p_i45447_1_.provider.hasNoSky; + + for (int l = 0; l < 16; ++l) + { + for (int i1 = 0; i1 < 16; ++i1) + { + for (int j1 = 0; j1 < k; ++j1) + { + int k1 = l * k * 16 | i1 * k | j1; + Block block = p_i45447_2_[k1]; + + if (block != null && block != Blocks.air) + { + int l1 = j1 >> 4; + + if (this.storageArrays[l1] == null) + { + this.storageArrays[l1] = new ExtendedBlockStorage(l1 << 4, flag); + } + + this.storageArrays[l1].func_150818_a(l, j1 & 15, i1, block); + this.storageArrays[l1].setExtBlockMetadata(l, j1 & 15, i1, p_i45447_3_[k1]); + } + } + } + } + } + + /** + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int x, int z) + { + return x == this.xPosition && z == this.zPosition; + } + + /** + * Returns the value in the height map at this x, z coordinate in the chunk + */ + public int getHeightValue(int x, int z) + { + return this.heightMap[z << 4 | x]; + } + + /** + * Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block. + */ + public int getTopFilledSegment() + { + for (int i = this.storageArrays.length - 1; i >= 0; --i) + { + if (this.storageArrays[i] != null) + { + return this.storageArrays[i].getYLocation(); + } + } + + return 0; + } + + /** + * Returns the ExtendedBlockStorage array for this Chunk. + */ + public ExtendedBlockStorage[] getBlockStorageArray() + { + return this.storageArrays; + } + + /** + * Generates the height map for a chunk from scratch + */ + @SideOnly(Side.CLIENT) + public void generateHeightMap() + { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) + { + int k = 0; + + while (k < 16) + { + this.precipitationHeightMap[j + (k << 4)] = -999; + int l = i + 16 - 1; + + while (true) + { + if (l > 0) + { + Block block = this.getBlock(j, l - 1, k); + + if (func_150808_b(j, l - 1, k) == 0) + { + --l; + continue; + } + + this.heightMap[k << 4 | j] = l; + + if (l < this.heightMapMinimum) + { + this.heightMapMinimum = l; + } + } + + ++k; + break; + } + } + } + + this.isModified = true; + } + + /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() + { + int i = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; + + for (int j = 0; j < 16; ++j) + { + int k = 0; + + while (k < 16) + { + this.precipitationHeightMap[j + (k << 4)] = -999; + int l = i + 16 - 1; + + while (true) + { + if (l > 0) + { + if (this.func_150808_b(j, l - 1, k) == 0) + { + --l; + continue; + } + + this.heightMap[k << 4 | j] = l; + + if (l < this.heightMapMinimum) + { + this.heightMapMinimum = l; + } + } + + if (!this.worldObj.provider.hasNoSky) + { + l = 15; + int i1 = i + 16 - 1; + + do + { + int j1 = this.func_150808_b(j, i1, k); + + if (j1 == 0 && l != 15) + { + j1 = 1; + } + + l -= j1; + + if (l > 0) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[i1 >> 4]; + + if (extendedblockstorage != null) + { + extendedblockstorage.setExtSkylightValue(j, i1 & 15, k, l); + this.worldObj.func_147479_m((this.xPosition << 4) + j, i1, (this.zPosition << 4) + k); + } + } + + --i1; + } + while (i1 > 0 && l > 0); + } + + ++k; + break; + } + } + } + + this.isModified = true; + } + + /** + * Propagates a given sky-visible block's light value downward and upward to neighboring blocks as necessary. + */ + private void propagateSkylightOcclusion(int p_76595_1_, int p_76595_2_) + { + this.updateSkylightColumns[p_76595_1_ + p_76595_2_ * 16] = true; + this.isGapLightingUpdated = true; + } + + private void recheckGaps(boolean p_150803_1_) + { + this.worldObj.theProfiler.startSection("recheckGaps"); + + if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) + { + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + if (this.updateSkylightColumns[i + j * 16]) + { + this.updateSkylightColumns[i + j * 16] = false; + int k = this.getHeightValue(i, j); + int l = this.xPosition * 16 + i; + int i1 = this.zPosition * 16 + j; + int j1 = this.worldObj.getChunkHeightMapMinimum(l - 1, i1); + int k1 = this.worldObj.getChunkHeightMapMinimum(l + 1, i1); + int l1 = this.worldObj.getChunkHeightMapMinimum(l, i1 - 1); + int i2 = this.worldObj.getChunkHeightMapMinimum(l, i1 + 1); + + if (k1 < j1) + { + j1 = k1; + } + + if (l1 < j1) + { + j1 = l1; + } + + if (i2 < j1) + { + j1 = i2; + } + + this.checkSkylightNeighborHeight(l, i1, j1); + this.checkSkylightNeighborHeight(l - 1, i1, k); + this.checkSkylightNeighborHeight(l + 1, i1, k); + this.checkSkylightNeighborHeight(l, i1 - 1, k); + this.checkSkylightNeighborHeight(l, i1 + 1, k); + + if (p_150803_1_) + { + this.worldObj.theProfiler.endSection(); + return; + } + } + } + } + + this.isGapLightingUpdated = false; + } + + this.worldObj.theProfiler.endSection(); + } + + /** + * Checks the height of a block next to a sky-visible block and schedules a lighting update as necessary. + */ + private void checkSkylightNeighborHeight(int p_76599_1_, int p_76599_2_, int p_76599_3_) + { + int l = this.worldObj.getHeightValue(p_76599_1_, p_76599_2_); + + if (l > p_76599_3_) + { + this.updateSkylightNeighborHeight(p_76599_1_, p_76599_2_, p_76599_3_, l + 1); + } + else if (l < p_76599_3_) + { + this.updateSkylightNeighborHeight(p_76599_1_, p_76599_2_, l, p_76599_3_ + 1); + } + } + + private void updateSkylightNeighborHeight(int p_76609_1_, int p_76609_2_, int p_76609_3_, int p_76609_4_) + { + if (p_76609_4_ > p_76609_3_ && this.worldObj.doChunksNearChunkExist(p_76609_1_, 0, p_76609_2_, 16)) + { + for (int i1 = p_76609_3_; i1 < p_76609_4_; ++i1) + { + this.worldObj.updateLightByType(EnumSkyBlock.Sky, p_76609_1_, i1, p_76609_2_); + } + + this.isModified = true; + } + } + + /** + * Initiates the recalculation of both the block-light and sky-light for a given block inside a chunk. + */ + private void relightBlock(int p_76615_1_, int p_76615_2_, int p_76615_3_) + { + int l = this.heightMap[p_76615_3_ << 4 | p_76615_1_] & 255; + int i1 = l; + + if (p_76615_2_ > l) + { + i1 = p_76615_2_; + } + + while (i1 > 0 && this.func_150808_b(p_76615_1_, i1 - 1, p_76615_3_) == 0) + { + --i1; + } + + if (i1 != l) + { + this.worldObj.markBlocksDirtyVertical(p_76615_1_ + this.xPosition * 16, p_76615_3_ + this.zPosition * 16, i1, l); + this.heightMap[p_76615_3_ << 4 | p_76615_1_] = i1; + int j1 = this.xPosition * 16 + p_76615_1_; + int k1 = this.zPosition * 16 + p_76615_3_; + int l1; + int i2; + + if (!this.worldObj.provider.hasNoSky) + { + ExtendedBlockStorage extendedblockstorage; + + if (i1 < l) + { + for (l1 = i1; l1 < l; ++l1) + { + extendedblockstorage = this.storageArrays[l1 >> 4]; + + if (extendedblockstorage != null) + { + extendedblockstorage.setExtSkylightValue(p_76615_1_, l1 & 15, p_76615_3_, 15); + this.worldObj.func_147479_m((this.xPosition << 4) + p_76615_1_, l1, (this.zPosition << 4) + p_76615_3_); + } + } + } + else + { + for (l1 = l; l1 < i1; ++l1) + { + extendedblockstorage = this.storageArrays[l1 >> 4]; + + if (extendedblockstorage != null) + { + extendedblockstorage.setExtSkylightValue(p_76615_1_, l1 & 15, p_76615_3_, 0); + this.worldObj.func_147479_m((this.xPosition << 4) + p_76615_1_, l1, (this.zPosition << 4) + p_76615_3_); + } + } + } + + l1 = 15; + + while (i1 > 0 && l1 > 0) + { + --i1; + i2 = this.func_150808_b(p_76615_1_, i1, p_76615_3_); + + if (i2 == 0) + { + i2 = 1; + } + + l1 -= i2; + + if (l1 < 0) + { + l1 = 0; + } + + ExtendedBlockStorage extendedblockstorage1 = this.storageArrays[i1 >> 4]; + + if (extendedblockstorage1 != null) + { + extendedblockstorage1.setExtSkylightValue(p_76615_1_, i1 & 15, p_76615_3_, l1); + } + } + } + + l1 = this.heightMap[p_76615_3_ << 4 | p_76615_1_]; + i2 = l; + int j2 = l1; + + if (l1 < l) + { + i2 = l1; + j2 = l; + } + + if (l1 < this.heightMapMinimum) + { + this.heightMapMinimum = l1; + } + + if (!this.worldObj.provider.hasNoSky) + { + this.updateSkylightNeighborHeight(j1 - 1, k1, i2, j2); + this.updateSkylightNeighborHeight(j1 + 1, k1, i2, j2); + this.updateSkylightNeighborHeight(j1, k1 - 1, i2, j2); + this.updateSkylightNeighborHeight(j1, k1 + 1, i2, j2); + this.updateSkylightNeighborHeight(j1, k1, i2, j2); + } + + this.isModified = true; + } + } + + public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) + { + int x = (xPosition << 4) + p_150808_1_; + int z = (zPosition << 4) + p_150808_3_; + return this.getBlock(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(worldObj, x, p_150808_2_, z); + } + + /** + * Returns the block corresponding to the given coordinates inside a chunk. + */ + public Block getBlock(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_) + { + Block block = Blocks.air; + + if (p_150810_2_ >> 4 < this.storageArrays.length) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_150810_2_ >> 4]; + + if (extendedblockstorage != null) + { + try + { + block = extendedblockstorage.getBlockByExtId(p_150810_1_, p_150810_2_ & 15, p_150810_3_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Block being got"); + crashreportcategory.addCrashSectionCallable("Location", new Callable() + { + private static final String __OBFID = "CL_00000374"; + public String call() + { + return CrashReportCategory.getLocationInfo(p_150810_1_, p_150810_2_, p_150810_3_); + } + }); + throw new ReportedException(crashreport); + } + } + } + + return block; + } + + /** + * Return the metadata corresponding to the given coordinates inside a chunk. + */ + public int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_) + { + if (p_76628_2_ >> 4 >= this.storageArrays.length) + { + return 0; + } + else + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_76628_2_ >> 4]; + return extendedblockstorage != null ? extendedblockstorage.getExtBlockMetadata(p_76628_1_, p_76628_2_ & 15, p_76628_3_) : 0; + } + } + + public boolean func_150807_a(int p_150807_1_, int p_150807_2_, int p_150807_3_, Block p_150807_4_, int p_150807_5_) + { + int i1 = p_150807_3_ << 4 | p_150807_1_; + + if (p_150807_2_ >= this.precipitationHeightMap[i1] - 1) + { + this.precipitationHeightMap[i1] = -999; + } + + int j1 = this.heightMap[i1]; + Block block1 = this.getBlock(p_150807_1_, p_150807_2_, p_150807_3_); + int k1 = this.getBlockMetadata(p_150807_1_, p_150807_2_, p_150807_3_); + + if (block1 == p_150807_4_ && k1 == p_150807_5_) + { + return false; + } + else + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_150807_2_ >> 4]; + boolean flag = false; + + if (extendedblockstorage == null) + { + if (p_150807_4_ == Blocks.air) + { + return false; + } + + extendedblockstorage = this.storageArrays[p_150807_2_ >> 4] = new ExtendedBlockStorage(p_150807_2_ >> 4 << 4, !this.worldObj.provider.hasNoSky); + flag = p_150807_2_ >= j1; + } + + int l1 = this.xPosition * 16 + p_150807_1_; + int i2 = this.zPosition * 16 + p_150807_3_; + + int k2 = block1.getLightOpacity(this.worldObj, l1, p_150807_2_, i2); + + if (!this.worldObj.isRemote) + { + block1.onBlockPreDestroy(this.worldObj, l1, p_150807_2_, i2, k1); + } + + extendedblockstorage.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_); + extendedblockstorage.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); // This line duplicates the one below, so breakBlock fires with valid worldstate + + if (!this.worldObj.isRemote) + { + block1.breakBlock(this.worldObj, l1, p_150807_2_, i2, block1, k1); + // After breakBlock a phantom TE might have been created with incorrect meta. This attempts to kill that phantom TE so the normal one can be create properly later + TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); + if (te != null && te.shouldRefresh(block1, getBlock(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F), k1, getBlockMetadata(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F), worldObj, l1, p_150807_2_, i2)) + { + this.removeTileEntity(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); + } + } + else if (block1.hasTileEntity(k1)) + { + TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); + if (te != null && te.shouldRefresh(block1, p_150807_4_, k1, p_150807_5_, worldObj, l1, p_150807_2_, i2)) + { + this.worldObj.removeTileEntity(l1, p_150807_2_, i2); + } + } + + if (extendedblockstorage.getBlockByExtId(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) + { + return false; + } + else + { + extendedblockstorage.setExtBlockMetadata(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); + + if (flag) + { + this.generateSkylightMap(); + } + else + { + int j2 = p_150807_4_.getLightOpacity(this.worldObj, l1, p_150807_2_, i2); + + if (j2 > 0) + { + if (p_150807_2_ >= j1) + { + this.relightBlock(p_150807_1_, p_150807_2_ + 1, p_150807_3_); + } + } + else if (p_150807_2_ == j1 - 1) + { + this.relightBlock(p_150807_1_, p_150807_2_, p_150807_3_); + } + + if (j2 != k2 && (j2 < k2 || this.getSavedLightValue(EnumSkyBlock.Sky, p_150807_1_, p_150807_2_, p_150807_3_) > 0 || this.getSavedLightValue(EnumSkyBlock.Block, p_150807_1_, p_150807_2_, p_150807_3_) > 0)) + { + this.propagateSkylightOcclusion(p_150807_1_, p_150807_3_); + } + } + + TileEntity tileentity; + + if (!this.worldObj.isRemote) + { + p_150807_4_.onBlockAdded(this.worldObj, l1, p_150807_2_, i2); + } + + if (p_150807_4_.hasTileEntity(p_150807_5_)) + { + tileentity = this.func_150806_e(p_150807_1_, p_150807_2_, p_150807_3_); + + if (tileentity != null) + { + tileentity.updateContainingBlockInfo(); + tileentity.blockMetadata = p_150807_5_; + } + } + + this.isModified = true; + return true; + } + } + } + + /** + * Set the metadata of a block in the chunk + */ + public boolean setBlockMetadata(int p_76589_1_, int p_76589_2_, int p_76589_3_, int p_76589_4_) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_76589_2_ >> 4]; + + if (extendedblockstorage == null) + { + return false; + } + else + { + int i1 = extendedblockstorage.getExtBlockMetadata(p_76589_1_, p_76589_2_ & 15, p_76589_3_); + + if (i1 == p_76589_4_) + { + return false; + } + else + { + this.isModified = true; + extendedblockstorage.setExtBlockMetadata(p_76589_1_, p_76589_2_ & 15, p_76589_3_, p_76589_4_); + + if (extendedblockstorage.getBlockByExtId(p_76589_1_, p_76589_2_ & 15, p_76589_3_).hasTileEntity(p_76589_4_)) + { + TileEntity tileentity = this.func_150806_e(p_76589_1_, p_76589_2_, p_76589_3_); + + if (tileentity != null) + { + tileentity.updateContainingBlockInfo(); + tileentity.blockMetadata = p_76589_4_; + } + } + + return true; + } + } + } + + /** + * Gets the amount of light saved in this block (doesn't adjust for daylight) + */ + public int getSavedLightValue(EnumSkyBlock p_76614_1_, int p_76614_2_, int p_76614_3_, int p_76614_4_) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_76614_3_ >> 4]; + return extendedblockstorage == null ? (this.canBlockSeeTheSky(p_76614_2_, p_76614_3_, p_76614_4_) ? p_76614_1_.defaultLightValue : 0) : (p_76614_1_ == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : extendedblockstorage.getExtSkylightValue(p_76614_2_, p_76614_3_ & 15, p_76614_4_)) : (p_76614_1_ == EnumSkyBlock.Block ? extendedblockstorage.getExtBlocklightValue(p_76614_2_, p_76614_3_ & 15, p_76614_4_) : p_76614_1_.defaultLightValue)); + } + + /** + * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a + * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_76633_1_, int p_76633_2_, int p_76633_3_, int p_76633_4_, int p_76633_5_) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_76633_3_ >> 4]; + + if (extendedblockstorage == null) + { + extendedblockstorage = this.storageArrays[p_76633_3_ >> 4] = new ExtendedBlockStorage(p_76633_3_ >> 4 << 4, !this.worldObj.provider.hasNoSky); + this.generateSkylightMap(); + } + + this.isModified = true; + + if (p_76633_1_ == EnumSkyBlock.Sky) + { + if (!this.worldObj.provider.hasNoSky) + { + extendedblockstorage.setExtSkylightValue(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_); + } + } + else if (p_76633_1_ == EnumSkyBlock.Block) + { + extendedblockstorage.setExtBlocklightValue(p_76633_2_, p_76633_3_ & 15, p_76633_4_, p_76633_5_); + } + } + + /** + * Gets the amount of light on a block taking into account sunlight + */ + public int getBlockLightValue(int p_76629_1_, int p_76629_2_, int p_76629_3_, int p_76629_4_) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[p_76629_2_ >> 4]; + + if (extendedblockstorage == null) + { + return !this.worldObj.provider.hasNoSky && p_76629_4_ < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - p_76629_4_ : 0; + } + else + { + int i1 = this.worldObj.provider.hasNoSky ? 0 : extendedblockstorage.getExtSkylightValue(p_76629_1_, p_76629_2_ & 15, p_76629_3_); + + if (i1 > 0) + { + isLit = true; + } + + i1 -= p_76629_4_; + int j1 = extendedblockstorage.getExtBlocklightValue(p_76629_1_, p_76629_2_ & 15, p_76629_3_); + + if (j1 > i1) + { + i1 = j1; + } + + return i1; + } + } + + /** + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity p_76612_1_) + { + this.hasEntities = true; + int i = MathHelper.floor_double(p_76612_1_.posX / 16.0D); + int j = MathHelper.floor_double(p_76612_1_.posZ / 16.0D); + + if (i != this.xPosition || j != this.zPosition) + { + logger.warn("Wrong location! " + p_76612_1_ + " (at " + i + ", " + j + " instead of " + this.xPosition + ", " + this.zPosition + ")"); + Thread.dumpStack(); + } + + int k = MathHelper.floor_double(p_76612_1_.posY / 16.0D); + + if (k < 0) + { + k = 0; + } + + if (k >= this.entityLists.length) + { + k = this.entityLists.length - 1; + } + + MinecraftForge.EVENT_BUS.post(new EntityEvent.EnteringChunk(p_76612_1_, this.xPosition, this.zPosition, p_76612_1_.chunkCoordX, p_76612_1_.chunkCoordZ)); + p_76612_1_.addedToChunk = true; + p_76612_1_.chunkCoordX = this.xPosition; + p_76612_1_.chunkCoordY = k; + p_76612_1_.chunkCoordZ = this.zPosition; + this.entityLists[k].add(p_76612_1_); + } + + /** + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity p_76622_1_) + { + this.removeEntityAtIndex(p_76622_1_, p_76622_1_.chunkCoordY); + } + + /** + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity p_76608_1_, int p_76608_2_) + { + if (p_76608_2_ < 0) + { + p_76608_2_ = 0; + } + + if (p_76608_2_ >= this.entityLists.length) + { + p_76608_2_ = this.entityLists.length - 1; + } + + this.entityLists[p_76608_2_].remove(p_76608_1_); + } + + /** + * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) + */ + public boolean canBlockSeeTheSky(int p_76619_1_, int p_76619_2_, int p_76619_3_) + { + return p_76619_2_ >= this.heightMap[p_76619_3_ << 4 | p_76619_1_]; + } + + public TileEntity func_150806_e(int p_150806_1_, int p_150806_2_, int p_150806_3_) + { + ChunkPosition chunkposition = new ChunkPosition(p_150806_1_, p_150806_2_, p_150806_3_); + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); + + if (tileentity != null && tileentity.isInvalid()) + { + chunkTileEntityMap.remove(chunkposition); + tileentity = null; + } + + if (tileentity == null) + { + Block block = this.getBlock(p_150806_1_, p_150806_2_, p_150806_3_); + int meta = this.getBlockMetadata(p_150806_1_, p_150806_2_, p_150806_3_); + + if (!block.hasTileEntity(meta)) + { + return null; + } + + tileentity = block.createTileEntity(worldObj, meta); + this.worldObj.setTileEntity(this.xPosition * 16 + p_150806_1_, p_150806_2_, this.zPosition * 16 + p_150806_3_, tileentity); + } + + return tileentity; + } + + public void addTileEntity(TileEntity p_150813_1_) + { + int i = p_150813_1_.xCoord - this.xPosition * 16; + int j = p_150813_1_.yCoord; + int k = p_150813_1_.zCoord - this.zPosition * 16; + this.func_150812_a(i, j, k, p_150813_1_); + + if (this.isChunkLoaded) + { + this.worldObj.addTileEntity(p_150813_1_); + } + } + + public void func_150812_a(int p_150812_1_, int p_150812_2_, int p_150812_3_, TileEntity p_150812_4_) + { + ChunkPosition chunkposition = new ChunkPosition(p_150812_1_, p_150812_2_, p_150812_3_); + p_150812_4_.setWorldObj(this.worldObj); + p_150812_4_.xCoord = this.xPosition * 16 + p_150812_1_; + p_150812_4_.yCoord = p_150812_2_; + p_150812_4_.zCoord = this.zPosition * 16 + p_150812_3_; + + int metadata = getBlockMetadata(p_150812_1_, p_150812_2_, p_150812_3_); + if (this.getBlock(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) + { + if (this.chunkTileEntityMap.containsKey(chunkposition)) + { + ((TileEntity)this.chunkTileEntityMap.get(chunkposition)).invalidate(); + } + + p_150812_4_.validate(); + this.chunkTileEntityMap.put(chunkposition, p_150812_4_); + } + } + + public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_) + { + ChunkPosition chunkposition = new ChunkPosition(p_150805_1_, p_150805_2_, p_150805_3_); + + if (this.isChunkLoaded) + { + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.remove(chunkposition); + + if (tileentity != null) + { + tileentity.invalidate(); + } + } + } + + /** + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() + { + this.isChunkLoaded = true; + this.worldObj.func_147448_a(this.chunkTileEntityMap.values()); + + for (int i = 0; i < this.entityLists.length; ++i) + { + Iterator iterator = this.entityLists[i].iterator(); + + while (iterator.hasNext()) + { + Entity entity = (Entity)iterator.next(); + entity.onChunkLoad(); + } + + this.worldObj.addLoadedEntities(this.entityLists[i]); + } + MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(this)); + } + + /** + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() + { + this.isChunkLoaded = false; + Iterator iterator = this.chunkTileEntityMap.values().iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); + this.worldObj.func_147457_a(tileentity); + } + + for (int i = 0; i < this.entityLists.length; ++i) + { + this.worldObj.unloadEntities(this.entityLists[i]); + } + MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this)); + } + + /** + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() + { + this.isModified = true; + } + + /** + * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity + * Args: entity, aabb, listToFill + */ + public void getEntitiesWithinAABBForEntity(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) + { + int i = MathHelper.floor_double((p_76588_2_.minY - World.MAX_ENTITY_RADIUS) / 16.0D); + int j = MathHelper.floor_double((p_76588_2_.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) + { + List list1 = this.entityLists[k]; + + for (int l = 0; l < list1.size(); ++l) + { + Entity entity1 = (Entity)list1.get(l); + + if (entity1 != p_76588_1_ && entity1.boundingBox.intersectsWith(p_76588_2_) && (p_76588_4_ == null || p_76588_4_.isEntityApplicable(entity1))) + { + p_76588_3_.add(entity1); + Entity[] aentity = entity1.getParts(); + + if (aentity != null) + { + for (int i1 = 0; i1 < aentity.length; ++i1) + { + entity1 = aentity[i1]; + + if (entity1 != p_76588_1_ && entity1.boundingBox.intersectsWith(p_76588_2_) && (p_76588_4_ == null || p_76588_4_.isEntityApplicable(entity1))) + { + p_76588_3_.add(entity1); + } + } + } + } + } + } + } + + /** + * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill + */ + public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) + { + int i = MathHelper.floor_double((p_76618_2_.minY - World.MAX_ENTITY_RADIUS) / 16.0D); + int j = MathHelper.floor_double((p_76618_2_.maxY + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1); + j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1); + + for (int k = i; k <= j; ++k) + { + List list1 = this.entityLists[k]; + + for (int l = 0; l < list1.size(); ++l) + { + Entity entity = (Entity)list1.get(l); + + if (p_76618_1_.isAssignableFrom(entity.getClass()) && entity.boundingBox.intersectsWith(p_76618_2_) && (p_76618_4_ == null || p_76618_4_.isEntityApplicable(entity))) + { + p_76618_3_.add(entity); + } + } + } + } + + /** + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean p_76601_1_) + { + if (p_76601_1_) + { + if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) + { + return true; + } + } + else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) + { + return true; + } + + return this.isModified; + } + + public Random getRandomWithSeed(long p_76617_1_) + { + return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_); + } + + public boolean isEmpty() + { + return false; + } + + public void populateChunk(IChunkProvider p_76624_1_, IChunkProvider p_76624_2_, int p_76624_3_, int p_76624_4_) + { + if (!this.isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_)) + { + p_76624_1_.populate(p_76624_2_, p_76624_3_, p_76624_4_); + } + + if (p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_) && !p_76624_1_.provideChunk(p_76624_3_ - 1, p_76624_4_).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ + 1) && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ + 1)) + { + p_76624_1_.populate(p_76624_2_, p_76624_3_ - 1, p_76624_4_); + } + + if (p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ - 1) && !p_76624_1_.provideChunk(p_76624_3_, p_76624_4_ - 1).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ + 1, p_76624_4_)) + { + p_76624_1_.populate(p_76624_2_, p_76624_3_, p_76624_4_ - 1); + } + + if (p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_ - 1) && !p_76624_1_.provideChunk(p_76624_3_ - 1, p_76624_4_ - 1).isTerrainPopulated && p_76624_1_.chunkExists(p_76624_3_, p_76624_4_ - 1) && p_76624_1_.chunkExists(p_76624_3_ - 1, p_76624_4_)) + { + p_76624_1_.populate(p_76624_2_, p_76624_3_ - 1, p_76624_4_ - 1); + } + } + + /** + * Gets the height to which rain/snow will fall. Calculates it if not already stored. + */ + public int getPrecipitationHeight(int p_76626_1_, int p_76626_2_) + { + int k = p_76626_1_ | p_76626_2_ << 4; + int l = this.precipitationHeightMap[k]; + + if (l == -999) + { + int i1 = this.getTopFilledSegment() + 15; + l = -1; + + while (i1 > 0 && l == -1) + { + Block block = this.getBlock(p_76626_1_, i1, p_76626_2_); + Material material = block.getMaterial(); + + if (!material.blocksMovement() && !material.isLiquid()) + { + --i1; + } + else + { + l = i1 + 1; + } + } + + this.precipitationHeightMap[k] = l; + } + + return l; + } + + public void func_150804_b(boolean p_150804_1_) + { + if (this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky && !p_150804_1_) + { + this.recheckGaps(this.worldObj.isRemote); + } + + this.field_150815_m = true; + + if (!this.isLightPopulated && this.isTerrainPopulated) + { + this.func_150809_p(); + } + } + + public boolean func_150802_k() + { + return this.field_150815_m && this.isTerrainPopulated && this.isLightPopulated; + } + + /** + * Gets a ChunkCoordIntPair representing the Chunk's position. + */ + public ChunkCoordIntPair getChunkCoordIntPair() + { + return new ChunkCoordIntPair(this.xPosition, this.zPosition); + } + + /** + * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty + * (true) or not (false). + */ + public boolean getAreLevelsEmpty(int p_76606_1_, int p_76606_2_) + { + if (p_76606_1_ < 0) + { + p_76606_1_ = 0; + } + + if (p_76606_2_ >= 256) + { + p_76606_2_ = 255; + } + + for (int k = p_76606_1_; k <= p_76606_2_; k += 16) + { + ExtendedBlockStorage extendedblockstorage = this.storageArrays[k >> 4]; + + if (extendedblockstorage != null && !extendedblockstorage.isEmpty()) + { + return false; + } + } + + return true; + } + + public void setStorageArrays(ExtendedBlockStorage[] p_76602_1_) + { + this.storageArrays = p_76602_1_; + } + + /** + * Initialise this chunk with new binary data + */ + @SideOnly(Side.CLIENT) + public void fillChunk(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_) + { + Iterator iterator = chunkTileEntityMap.values().iterator(); + while(iterator.hasNext()) + { + TileEntity tileEntity = (TileEntity)iterator.next(); + tileEntity.updateContainingBlockInfo(); + tileEntity.getBlockMetadata(); + tileEntity.getBlockType(); + } + + int k = 0; + boolean flag1 = !this.worldObj.provider.hasNoSky; + int l; + + for (l = 0; l < this.storageArrays.length; ++l) + { + if ((p_76607_2_ & 1 << l) != 0) + { + if (this.storageArrays[l] == null) + { + this.storageArrays[l] = new ExtendedBlockStorage(l << 4, flag1); + } + + byte[] abyte1 = this.storageArrays[l].getBlockLSBArray(); + System.arraycopy(p_76607_1_, k, abyte1, 0, abyte1.length); + k += abyte1.length; + } + else if (p_76607_4_ && this.storageArrays[l] != null) + { + this.storageArrays[l] = null; + } + } + + NibbleArray nibblearray; + + for (l = 0; l < this.storageArrays.length; ++l) + { + if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null) + { + nibblearray = this.storageArrays[l].getMetadataArray(); + System.arraycopy(p_76607_1_, k, nibblearray.data, 0, nibblearray.data.length); + k += nibblearray.data.length; + } + } + + for (l = 0; l < this.storageArrays.length; ++l) + { + if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null) + { + nibblearray = this.storageArrays[l].getBlocklightArray(); + System.arraycopy(p_76607_1_, k, nibblearray.data, 0, nibblearray.data.length); + k += nibblearray.data.length; + } + } + + if (flag1) + { + for (l = 0; l < this.storageArrays.length; ++l) + { + if ((p_76607_2_ & 1 << l) != 0 && this.storageArrays[l] != null) + { + nibblearray = this.storageArrays[l].getSkylightArray(); + System.arraycopy(p_76607_1_, k, nibblearray.data, 0, nibblearray.data.length); + k += nibblearray.data.length; + } + } + } + + for (l = 0; l < this.storageArrays.length; ++l) + { + if ((p_76607_3_ & 1 << l) != 0) + { + if (this.storageArrays[l] == null) + { + k += 2048; + } + else + { + nibblearray = this.storageArrays[l].getBlockMSBArray(); + + if (nibblearray == null) + { + nibblearray = this.storageArrays[l].createBlockMSBArray(); + } + + System.arraycopy(p_76607_1_, k, nibblearray.data, 0, nibblearray.data.length); + k += nibblearray.data.length; + } + } + else if (p_76607_4_ && this.storageArrays[l] != null && this.storageArrays[l].getBlockMSBArray() != null) + { + this.storageArrays[l].clearMSBArray(); + } + } + + if (p_76607_4_) + { + System.arraycopy(p_76607_1_, k, this.blockBiomeArray, 0, this.blockBiomeArray.length); + int i1 = k + this.blockBiomeArray.length; + } + + for (l = 0; l < this.storageArrays.length; ++l) + { + if (this.storageArrays[l] != null && (p_76607_2_ & 1 << l) != 0) + { + this.storageArrays[l].removeInvalidBlocks(); + } + } + + this.isLightPopulated = true; + this.isTerrainPopulated = true; + this.generateHeightMap(); + List invalidList = new ArrayList(); + iterator = this.chunkTileEntityMap.values().iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); + int x = tileentity.xCoord & 15; + int y = tileentity.yCoord; + int z = tileentity.zCoord & 15; + Block block = tileentity.getBlockType(); + if ((block != getBlock(x, y, z) || tileentity.blockMetadata != this.getBlockMetadata(x, y, z)) && tileentity.shouldRefresh(block, getBlock(x, y, z), tileentity.blockMetadata, this.getBlockMetadata(x, y, z), worldObj, x, y, z)) + { + invalidList.add(tileentity); + } + tileentity.updateContainingBlockInfo(); + } + + for (TileEntity te : invalidList) + { + te.invalidate(); + } + } + + /** + * This method retrieves the biome at a set of coordinates + */ + public BiomeGenBase getBiomeGenForWorldCoords(int p_76591_1_, int p_76591_2_, WorldChunkManager p_76591_3_) + { + int k = this.blockBiomeArray[p_76591_2_ << 4 | p_76591_1_] & 255; + + if (k == 255) + { + BiomeGenBase biomegenbase = p_76591_3_.getBiomeGenAt((this.xPosition << 4) + p_76591_1_, (this.zPosition << 4) + p_76591_2_); + k = biomegenbase.biomeID; + this.blockBiomeArray[p_76591_2_ << 4 | p_76591_1_] = (byte)(k & 255); + } + + return BiomeGenBase.getBiome(k) == null ? BiomeGenBase.plains : BiomeGenBase.getBiome(k); + } + + /** + * Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs. + */ + public byte[] getBiomeArray() + { + return this.blockBiomeArray; + } + + /** + * Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to + * biome IDs. + */ + public void setBiomeArray(byte[] p_76616_1_) + { + this.blockBiomeArray = p_76616_1_; + } + + /** + * Resets the relight check index to 0 for this Chunk. + */ + public void resetRelightChecks() + { + this.queuedLightChecks = 0; + } + + /** + * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 + * blocks at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via + * (4096/(8*16))/20, to re-check all blocks in a chunk, which could explain both lagging light updates in certain + * cases as well as Nether relight + */ + public void enqueueRelightChecks() + { + for (int i = 0; i < 8; ++i) + { + if (this.queuedLightChecks >= 4096) + { + return; + } + + int j = this.queuedLightChecks % 16; + int k = this.queuedLightChecks / 16 % 16; + int l = this.queuedLightChecks / 256; + ++this.queuedLightChecks; + int i1 = (this.xPosition << 4) + k; + int j1 = (this.zPosition << 4) + l; + + for (int k1 = 0; k1 < 16; ++k1) + { + int l1 = (j << 4) + k1; + + if (this.storageArrays[j] == null && (k1 == 0 || k1 == 15 || k == 0 || k == 15 || l == 0 || l == 15) || this.storageArrays[j] != null && this.storageArrays[j].getBlockByExtId(k, k1, l).getMaterial() == Material.air) + { + if (this.worldObj.getBlock(i1, l1 - 1, j1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1, l1 - 1, j1); + } + + if (this.worldObj.getBlock(i1, l1 + 1, j1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1, l1 + 1, j1); + } + + if (this.worldObj.getBlock(i1 - 1, l1, j1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1 - 1, l1, j1); + } + + if (this.worldObj.getBlock(i1 + 1, l1, j1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1 + 1, l1, j1); + } + + if (this.worldObj.getBlock(i1, l1, j1 - 1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1, l1, j1 - 1); + } + + if (this.worldObj.getBlock(i1, l1, j1 + 1).getLightValue() > 0) + { + this.worldObj.func_147451_t(i1, l1, j1 + 1); + } + + this.worldObj.func_147451_t(i1, l1, j1); + } + } + } + } + + public void func_150809_p() + { + this.isTerrainPopulated = true; + this.isLightPopulated = true; + + if (!this.worldObj.provider.hasNoSky) + { + if (this.worldObj.checkChunksExist(this.xPosition * 16 - 1, 0, this.zPosition * 16 - 1, this.xPosition * 16 + 1, 63, this.zPosition * 16 + 1)) + { + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + if (!this.func_150811_f(i, j)) + { + this.isLightPopulated = false; + break; + } + } + } + + if (this.isLightPopulated) + { + Chunk chunk = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16 - 1, this.zPosition * 16); + chunk.func_150801_a(3); + chunk = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16 + 16, this.zPosition * 16); + chunk.func_150801_a(1); + chunk = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16, this.zPosition * 16 - 1); + chunk.func_150801_a(0); + chunk = this.worldObj.getChunkFromBlockCoords(this.xPosition * 16, this.zPosition * 16 + 16); + chunk.func_150801_a(2); + } + } + else + { + this.isLightPopulated = false; + } + } + } + + private void func_150801_a(int p_150801_1_) + { + if (this.isTerrainPopulated) + { + int j; + + if (p_150801_1_ == 3) + { + for (j = 0; j < 16; ++j) + { + this.func_150811_f(15, j); + } + } + else if (p_150801_1_ == 1) + { + for (j = 0; j < 16; ++j) + { + this.func_150811_f(0, j); + } + } + else if (p_150801_1_ == 0) + { + for (j = 0; j < 16; ++j) + { + this.func_150811_f(j, 15); + } + } + else if (p_150801_1_ == 2) + { + for (j = 0; j < 16; ++j) + { + this.func_150811_f(j, 0); + } + } + } + } + + private boolean func_150811_f(int p_150811_1_, int p_150811_2_) + { + int k = this.getTopFilledSegment(); + boolean flag = false; + boolean flag1 = false; + int l; + + for (l = k + 16 - 1; l > 63 || l > 0 && !flag1; --l) + { + int i1 = this.func_150808_b(p_150811_1_, l, p_150811_2_); + + if (i1 == 255 && l < 63) + { + flag1 = true; + } + + if (!flag && i1 > 0) + { + flag = true; + } + else if (flag && i1 == 0 && !this.worldObj.func_147451_t(this.xPosition * 16 + p_150811_1_, l, this.zPosition * 16 + p_150811_2_)) + { + return false; + } + } + + for (; l > 0; --l) + { + if (this.getBlock(p_150811_1_, l, p_150811_2_).getLightValue() > 0) + { + this.worldObj.func_147451_t(this.xPosition * 16 + p_150811_1_, l, this.zPosition * 16 + p_150811_2_); + } + } + + return true; + } + + /** + * Retrieves the tile entity, WITHOUT creating it. + * Good for checking if it exists. + * + * @param x + * @param y + * @param z + * @return The tile entity at the specified location, if it exists and is valid. + */ + public TileEntity getTileEntityUnsafe(int x, int y, int z) + { + ChunkPosition chunkposition = new ChunkPosition(x, y, z); + TileEntity tileentity = (TileEntity)this.chunkTileEntityMap.get(chunkposition); + + if (tileentity != null && tileentity.isInvalid()) + { + chunkTileEntityMap.remove(chunkposition); + tileentity = null; + } + + return tileentity; + } + + /** + * Removes the tile entity at the specified position, only if it's + * marked as invalid. + * + * @param x + * @param y + * @param z + */ + public void removeInvalidTileEntity(int x, int y, int z) + { + ChunkPosition position = new ChunkPosition(x, y, z); + if (isChunkLoaded) + { + TileEntity entity = (TileEntity)chunkTileEntityMap.get(position); + if (entity != null && entity.isInvalid()) + { + chunkTileEntityMap.remove(position); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/EmptyChunk.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/EmptyChunk.java new file mode 100644 index 0000000..a814321 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/EmptyChunk.java @@ -0,0 +1,194 @@ +package net.minecraft.world.chunk; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; + +public class EmptyChunk extends Chunk +{ + private static final String __OBFID = "CL_00000372"; + + public EmptyChunk(World p_i1994_1_, int p_i1994_2_, int p_i1994_3_) + { + super(p_i1994_1_, p_i1994_2_, p_i1994_3_); + } + + /** + * Checks whether the chunk is at the X/Z location specified + */ + public boolean isAtLocation(int x, int z) + { + return x == this.xPosition && z == this.zPosition; + } + + /** + * Returns the value in the height map at this x, z coordinate in the chunk + */ + public int getHeightValue(int x, int z) + { + return 0; + } + + /** + * Generates the initial skylight map for the chunk upon generation or load. + */ + public void generateSkylightMap() {} + + /** + * Generates the height map for a chunk from scratch + */ + @SideOnly(Side.CLIENT) + public void generateHeightMap() {} + + /** + * Returns the block corresponding to the given coordinates inside a chunk. + */ + public Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_) + { + return Blocks.air; + } + + public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) + { + return 255; + } + + public boolean func_150807_a(int p_150807_1_, int p_150807_2_, int p_150807_3_, Block p_150807_4_, int p_150807_5_) + { + return true; + } + + /** + * Return the metadata corresponding to the given coordinates inside a chunk. + */ + public int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_) + { + return 0; + } + + /** + * Set the metadata of a block in the chunk + */ + public boolean setBlockMetadata(int p_76589_1_, int p_76589_2_, int p_76589_3_, int p_76589_4_) + { + return false; + } + + /** + * Gets the amount of light saved in this block (doesn't adjust for daylight) + */ + public int getSavedLightValue(EnumSkyBlock p_76614_1_, int p_76614_2_, int p_76614_3_, int p_76614_4_) + { + return 0; + } + + /** + * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a + * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue + */ + public void setLightValue(EnumSkyBlock p_76633_1_, int p_76633_2_, int p_76633_3_, int p_76633_4_, int p_76633_5_) {} + + /** + * Gets the amount of light on a block taking into account sunlight + */ + public int getBlockLightValue(int p_76629_1_, int p_76629_2_, int p_76629_3_, int p_76629_4_) + { + return 0; + } + + /** + * Adds an entity to the chunk. Args: entity + */ + public void addEntity(Entity p_76612_1_) {} + + /** + * removes entity using its y chunk coordinate as its index + */ + public void removeEntity(Entity p_76622_1_) {} + + /** + * Removes entity at the specified index from the entity array. + */ + public void removeEntityAtIndex(Entity p_76608_1_, int p_76608_2_) {} + + /** + * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) + */ + public boolean canBlockSeeTheSky(int p_76619_1_, int p_76619_2_, int p_76619_3_) + { + return false; + } + + public TileEntity func_150806_e(int p_150806_1_, int p_150806_2_, int p_150806_3_) + { + return null; + } + + public void addTileEntity(TileEntity p_150813_1_) {} + + public void func_150812_a(int p_150812_1_, int p_150812_2_, int p_150812_3_, TileEntity p_150812_4_) {} + + public void removeTileEntity(int p_150805_1_, int p_150805_2_, int p_150805_3_) {} + + /** + * Called when this Chunk is loaded by the ChunkProvider + */ + public void onChunkLoad() {} + + /** + * Called when this Chunk is unloaded by the ChunkProvider + */ + public void onChunkUnload() {} + + /** + * Sets the isModified flag for this Chunk + */ + public void setChunkModified() {} + + /** + * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity + * Args: entity, aabb, listToFill + */ + public void getEntitiesWithinAABBForEntity(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) {} + + /** + * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill + */ + public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) {} + + /** + * Returns true if this Chunk needs to be saved + */ + public boolean needsSaving(boolean p_76601_1_) + { + return false; + } + + public Random getRandomWithSeed(long p_76617_1_) + { + return new Random(this.worldObj.getSeed() + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ p_76617_1_); + } + + public boolean isEmpty() + { + return true; + } + + /** + * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty + * (true) or not (false). + */ + public boolean getAreLevelsEmpty(int p_76606_1_, int p_76606_2_) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/IChunkProvider.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/IChunkProvider.java new file mode 100644 index 0000000..e38958f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/IChunkProvider.java @@ -0,0 +1,69 @@ +package net.minecraft.world.chunk; + +import java.util.List; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public interface IChunkProvider +{ + /** + * Checks to see if a chunk exists at x, y + */ + boolean chunkExists(int p_73149_1_, int p_73149_2_); + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + Chunk provideChunk(int p_73154_1_, int p_73154_2_); + + /** + * loads or generates the chunk at the chunk location specified + */ + Chunk loadChunk(int p_73158_1_, int p_73158_2_); + + /** + * Populates chunk with ores etc etc + */ + void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_); + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_); + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + boolean unloadQueuedChunks(); + + /** + * Returns if the IChunkProvider supports saving. + */ + boolean canSave(); + + /** + * Converts the instance data to a readable string. + */ + String makeString(); + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_); + + ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_); + + int getLoadedChunkCount(); + + void recreateStructures(int p_82695_1_, int p_82695_2_); + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + void saveExtraData(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/NibbleArray.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/NibbleArray.java new file mode 100644 index 0000000..5217a09 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/NibbleArray.java @@ -0,0 +1,59 @@ +package net.minecraft.world.chunk; + +public class NibbleArray +{ + /** + * Byte array of data stored in this holder. Possibly a light map or some chunk data. Data is accessed in 4-bit + * pieces. + */ + public final byte[] data; + /** Log base 2 of the chunk height (128); applied as a shift on Z coordinate */ + private final int depthBits; + /** Log base 2 of the chunk height (128) * width (16); applied as a shift on X coordinate */ + private final int depthBitsPlusFour; + private static final String __OBFID = "CL_00000371"; + + public NibbleArray(int p_i1992_1_, int p_i1992_2_) + { + this.data = new byte[p_i1992_1_ >> 1]; + this.depthBits = p_i1992_2_; + this.depthBitsPlusFour = p_i1992_2_ + 4; + } + + public NibbleArray(byte[] p_i1993_1_, int p_i1993_2_) + { + this.data = p_i1993_1_; + this.depthBits = p_i1993_2_; + this.depthBitsPlusFour = p_i1993_2_ + 4; + } + + /** + * Returns the nibble of data corresponding to the passed in x, y, z. y is at most 6 bits, z is at most 4. + */ + public int get(int p_76582_1_, int p_76582_2_, int p_76582_3_) + { + int l = p_76582_2_ << this.depthBitsPlusFour | p_76582_3_ << this.depthBits | p_76582_1_; + int i1 = l >> 1; + int j1 = l & 1; + return j1 == 0 ? this.data[i1] & 15 : this.data[i1] >> 4 & 15; + } + + /** + * Arguments are x, y, z, val. Sets the nibble of data at x << 11 | z << 7 | y to val. + */ + public void set(int p_76581_1_, int p_76581_2_, int p_76581_3_, int p_76581_4_) + { + int i1 = p_76581_2_ << this.depthBitsPlusFour | p_76581_3_ << this.depthBits | p_76581_1_; + int j1 = i1 >> 1; + int k1 = i1 & 1; + + if (k1 == 0) + { + this.data[j1] = (byte)(this.data[j1] & 240 | p_76581_4_ & 15); + } + else + { + this.data[j1] = (byte)(this.data[j1] & 15 | (p_76581_4_ & 15) << 4); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java new file mode 100644 index 0000000..63278ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilChunkLoader.java @@ -0,0 +1,563 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.NextTickListEntry; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.NibbleArray; +import net.minecraft.world.storage.IThreadedFileIO; +import net.minecraft.world.storage.ThreadedFileIOBase; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.ChunkDataEvent; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import cpw.mods.fml.common.FMLLog; + +public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO +{ + private static final Logger logger = LogManager.getLogger(); + private List chunksToRemove = new ArrayList(); + private Set pendingAnvilChunksCoordinates = new HashSet(); + private Object syncLockObject = new Object(); + /** Save directory for chunks using the Anvil format */ + public final File chunkSaveLocation; + private static final String __OBFID = "CL_00000384"; + + public AnvilChunkLoader(File p_i2003_1_) + { + this.chunkSaveLocation = p_i2003_1_; + } + + public boolean chunkExists(World world, int i, int j) + { + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + + synchronized (this.syncLockObject) + { + if (this.pendingAnvilChunksCoordinates.contains(chunkcoordintpair)) + { + Iterator iter = this.chunksToRemove.iterator(); + while (iter.hasNext()) + { + PendingChunk pendingChunk = (PendingChunk)iter.next(); + if (pendingChunk.chunkCoordinate.equals(chunkcoordintpair)) + { + return true; + } + } + } + } + + return RegionFileCache.createOrLoadRegionFile(this.chunkSaveLocation, i, j).chunkExists(i & 31, j & 31); + } + + /** + * Loads the specified(XZ) chunk into the specified world. + */ + public Chunk loadChunk(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.getCompoundTag("Level"), chunk); + return chunk; + } + + return null; + } + + public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException + { + NBTTagCompound nbttagcompound = null; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_75815_2_, p_75815_3_); + Object object = this.syncLockObject; + + synchronized (this.syncLockObject) + { + if (this.pendingAnvilChunksCoordinates.contains(chunkcoordintpair)) + { + Iterator iter = this.chunksToRemove.iterator(); + while (iter.hasNext()) + { + PendingChunk pendingChunk = (PendingChunk)iter.next(); + if (pendingChunk.chunkCoordinate.equals(chunkcoordintpair)) + { + nbttagcompound = pendingChunk.nbtTags; + break; + } + } + } + } + + if (nbttagcompound == null) + { + DataInputStream datainputstream = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, p_75815_2_, p_75815_3_); + + if (datainputstream == null) + { + return null; + } + + nbttagcompound = CompressedStreamTools.read(datainputstream); + } + + return this.checkedReadChunkFromNBT__Async(p_75815_1_, p_75815_2_, p_75815_3_, nbttagcompound); + } + + /** + * Wraps readChunkFromNBT. Checks the coordinates and several NBT tags. + */ + protected Chunk checkedReadChunkFromNBT(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_); + + if (data != null) + { + Chunk chunk = (Chunk) data[0]; + return chunk; + } + + return null; + } + + protected Object[] checkedReadChunkFromNBT__Async(World p_75822_1_, int p_75822_2_, int p_75822_3_, NBTTagCompound p_75822_4_) + { + if (!p_75822_4_.hasKey("Level", 10)) + { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing level data, skipping"); + return null; + } + else if (!p_75822_4_.getCompoundTag("Level").hasKey("Sections", 9)) + { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is missing block data, skipping"); + return null; + } + else + { + Chunk chunk = this.readChunkFromNBT(p_75822_1_, p_75822_4_.getCompoundTag("Level")); + + if (!chunk.isAtLocation(p_75822_2_, p_75822_3_)) + { + logger.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is in the wrong location; relocating. (Expected " + p_75822_2_ + ", " + p_75822_3_ + ", got " + chunk.xPosition + ", " + chunk.zPosition + ")"); + p_75822_4_.setInteger("xPos", p_75822_2_); + p_75822_4_.setInteger("zPos", p_75822_3_); + // Have to move tile entities since we don't load them at this stage + NBTTagList tileEntities = p_75822_4_.getCompoundTag("Level").getTagList("TileEntities", 10); + + if (tileEntities != null) + { + for (int te = 0; te < tileEntities.tagCount(); te++) + { + NBTTagCompound tileEntity = (NBTTagCompound) tileEntities.getCompoundTagAt(te); + int x = tileEntity.getInteger("x") - chunk.xPosition * 16; + int z = tileEntity.getInteger("z") - chunk.zPosition * 16; + tileEntity.setInteger("x", p_75822_2_ * 16 + x); + tileEntity.setInteger("z", p_75822_3_ * 16 + z); + } + } + + chunk = this.readChunkFromNBT(p_75822_1_, p_75822_4_.getCompoundTag("Level")); + } + + 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; + } + } + + public void saveChunk(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException + { + p_75816_1_.checkSessionLock(); + + try + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound.setTag("Level", nbttagcompound1); + this.writeChunkToNBT(p_75816_2_, p_75816_1_, nbttagcompound1); + MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); + this.addChunkToPending(p_75816_2_.getChunkCoordIntPair(), nbttagcompound); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + protected void addChunkToPending(ChunkCoordIntPair p_75824_1_, NBTTagCompound p_75824_2_) + { + Object object = this.syncLockObject; + + synchronized (this.syncLockObject) + { + if (this.pendingAnvilChunksCoordinates.contains(p_75824_1_)) + { + for (int i = 0; i < this.chunksToRemove.size(); ++i) + { + if (((AnvilChunkLoader.PendingChunk)this.chunksToRemove.get(i)).chunkCoordinate.equals(p_75824_1_)) + { + this.chunksToRemove.set(i, new AnvilChunkLoader.PendingChunk(p_75824_1_, p_75824_2_)); + return; + } + } + } + + this.chunksToRemove.add(new AnvilChunkLoader.PendingChunk(p_75824_1_, p_75824_2_)); + this.pendingAnvilChunksCoordinates.add(p_75824_1_); + ThreadedFileIOBase.threadedIOInstance.queueIO(this); + } + } + + /** + * Returns a boolean stating if the write was unsuccessful. + */ + public boolean writeNextIO() + { + AnvilChunkLoader.PendingChunk pendingchunk = null; + Object object = this.syncLockObject; + + synchronized (this.syncLockObject) + { + if (this.chunksToRemove.isEmpty()) + { + return false; + } + + pendingchunk = (AnvilChunkLoader.PendingChunk)this.chunksToRemove.remove(0); + this.pendingAnvilChunksCoordinates.remove(pendingchunk.chunkCoordinate); + } + + if (pendingchunk != null) + { + try + { + this.writeChunkNBTTags(pendingchunk); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + return true; + } + + private void writeChunkNBTTags(AnvilChunkLoader.PendingChunk p_75821_1_) throws IOException + { + DataOutputStream dataoutputstream = RegionFileCache.getChunkOutputStream(this.chunkSaveLocation, p_75821_1_.chunkCoordinate.chunkXPos, p_75821_1_.chunkCoordinate.chunkZPos); + CompressedStreamTools.write(p_75821_1_.nbtTags, dataoutputstream); + dataoutputstream.close(); + } + + /** + * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. + * Currently unused. + */ + public void saveExtraChunkData(World p_75819_1_, Chunk p_75819_2_) {} + + /** + * Called every World.tick() + */ + public void chunkTick() {} + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unused. + */ + public void saveExtraData() + { + while (this.writeNextIO()) + { + ; + } + } + + /** + * Writes the Chunk passed as an argument to the NBTTagCompound also passed, using the World argument to retrieve + * the Chunk's last update time. + */ + private void writeChunkToNBT(Chunk p_75820_1_, World p_75820_2_, NBTTagCompound p_75820_3_) + { + p_75820_3_.setByte("V", (byte)1); + p_75820_3_.setInteger("xPos", p_75820_1_.xPosition); + p_75820_3_.setInteger("zPos", p_75820_1_.zPosition); + p_75820_3_.setLong("LastUpdate", p_75820_2_.getTotalWorldTime()); + p_75820_3_.setIntArray("HeightMap", p_75820_1_.heightMap); + p_75820_3_.setBoolean("TerrainPopulated", p_75820_1_.isTerrainPopulated); + p_75820_3_.setBoolean("LightPopulated", p_75820_1_.isLightPopulated); + p_75820_3_.setLong("InhabitedTime", p_75820_1_.inhabitedTime); + ExtendedBlockStorage[] aextendedblockstorage = p_75820_1_.getBlockStorageArray(); + NBTTagList nbttaglist = new NBTTagList(); + boolean flag = !p_75820_2_.provider.hasNoSky; + ExtendedBlockStorage[] aextendedblockstorage1 = aextendedblockstorage; + int i = aextendedblockstorage.length; + NBTTagCompound nbttagcompound1; + + for (int j = 0; j < i; ++j) + { + ExtendedBlockStorage extendedblockstorage = aextendedblockstorage1[j]; + + if (extendedblockstorage != null) + { + nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Y", (byte)(extendedblockstorage.getYLocation() >> 4 & 255)); + nbttagcompound1.setByteArray("Blocks", extendedblockstorage.getBlockLSBArray()); + + if (extendedblockstorage.getBlockMSBArray() != null) + { + nbttagcompound1.setByteArray("Add", extendedblockstorage.getBlockMSBArray().data); + } + + nbttagcompound1.setByteArray("Data", extendedblockstorage.getMetadataArray().data); + nbttagcompound1.setByteArray("BlockLight", extendedblockstorage.getBlocklightArray().data); + + if (flag) + { + nbttagcompound1.setByteArray("SkyLight", extendedblockstorage.getSkylightArray().data); + } + else + { + nbttagcompound1.setByteArray("SkyLight", new byte[extendedblockstorage.getBlocklightArray().data.length]); + } + + nbttaglist.appendTag(nbttagcompound1); + } + } + + p_75820_3_.setTag("Sections", nbttaglist); + p_75820_3_.setByteArray("Biomes", p_75820_1_.getBiomeArray()); + p_75820_1_.hasEntities = false; + NBTTagList nbttaglist2 = new NBTTagList(); + Iterator iterator1; + + for (i = 0; i < p_75820_1_.entityLists.length; ++i) + { + iterator1 = p_75820_1_.entityLists[i].iterator(); + + while (iterator1.hasNext()) + { + Entity entity = (Entity)iterator1.next(); + nbttagcompound1 = new NBTTagCompound(); + + try + { + if (entity.writeToNBTOptional(nbttagcompound1)) + { + p_75820_1_.hasEntities = true; + nbttaglist2.appendTag(nbttagcompound1); + } + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, + "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", + entity.getClass().getName()); + } + } + } + + p_75820_3_.setTag("Entities", nbttaglist2); + NBTTagList nbttaglist3 = new NBTTagList(); + iterator1 = p_75820_1_.chunkTileEntityMap.values().iterator(); + + while (iterator1.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator1.next(); + nbttagcompound1 = new NBTTagCompound(); + try { + tileentity.writeToNBT(nbttagcompound1); + nbttaglist3.appendTag(nbttagcompound1); + } + catch (Exception e) + { + FMLLog.log(Level.ERROR, e, + "A TileEntity type %s has throw an exception trying to write state. It will not persist. Report this to the mod author", + tileentity.getClass().getName()); + } + } + + p_75820_3_.setTag("TileEntities", nbttaglist3); + List list = p_75820_2_.getPendingBlockUpdates(p_75820_1_, false); + + if (list != null) + { + long k = p_75820_2_.getTotalWorldTime(); + NBTTagList nbttaglist1 = new NBTTagList(); + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) + { + NextTickListEntry nextticklistentry = (NextTickListEntry)iterator.next(); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setInteger("i", Block.getIdFromBlock(nextticklistentry.func_151351_a())); + nbttagcompound2.setInteger("x", nextticklistentry.xCoord); + nbttagcompound2.setInteger("y", nextticklistentry.yCoord); + nbttagcompound2.setInteger("z", nextticklistentry.zCoord); + nbttagcompound2.setInteger("t", (int)(nextticklistentry.scheduledTime - k)); + nbttagcompound2.setInteger("p", nextticklistentry.priority); + nbttaglist1.appendTag(nbttagcompound2); + } + + p_75820_3_.setTag("TileTicks", nbttaglist1); + } + } + + /** + * Reads the data stored in the passed NBTTagCompound and creates a Chunk with that data in the passed World. + * Returns the created Chunk. + */ + private Chunk readChunkFromNBT(World p_75823_1_, NBTTagCompound p_75823_2_) + { + int i = p_75823_2_.getInteger("xPos"); + int j = p_75823_2_.getInteger("zPos"); + Chunk chunk = new Chunk(p_75823_1_, i, j); + chunk.heightMap = p_75823_2_.getIntArray("HeightMap"); + chunk.isTerrainPopulated = p_75823_2_.getBoolean("TerrainPopulated"); + chunk.isLightPopulated = p_75823_2_.getBoolean("LightPopulated"); + chunk.inhabitedTime = p_75823_2_.getLong("InhabitedTime"); + NBTTagList nbttaglist = p_75823_2_.getTagList("Sections", 10); + byte b0 = 16; + ExtendedBlockStorage[] aextendedblockstorage = new ExtendedBlockStorage[b0]; + boolean flag = !p_75823_1_.provider.hasNoSky; + + for (int k = 0; k < nbttaglist.tagCount(); ++k) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(k); + byte b1 = nbttagcompound1.getByte("Y"); + ExtendedBlockStorage extendedblockstorage = new ExtendedBlockStorage(b1 << 4, flag); + extendedblockstorage.setBlockLSBArray(nbttagcompound1.getByteArray("Blocks")); + + if (nbttagcompound1.hasKey("Add", 7)) + { + extendedblockstorage.setBlockMSBArray(new NibbleArray(nbttagcompound1.getByteArray("Add"), 4)); + } + + extendedblockstorage.setBlockMetadataArray(new NibbleArray(nbttagcompound1.getByteArray("Data"), 4)); + extendedblockstorage.setBlocklightArray(new NibbleArray(nbttagcompound1.getByteArray("BlockLight"), 4)); + + if (flag) + { + extendedblockstorage.setSkylightArray(new NibbleArray(nbttagcompound1.getByteArray("SkyLight"), 4)); + } + + extendedblockstorage.removeInvalidBlocks(); + aextendedblockstorage[b1] = extendedblockstorage; + } + + chunk.setStorageArrays(aextendedblockstorage); + + if (p_75823_2_.hasKey("Biomes", 7)) + { + chunk.setBiomeArray(p_75823_2_.getByteArray("Biomes")); + } + + // End this method here and split off entity loading to another method + return chunk; + } + + public void loadEntities(World p_75823_1_, NBTTagCompound p_75823_2_, Chunk chunk) + { + NBTTagList nbttaglist1 = p_75823_2_.getTagList("Entities", 10); + + if (nbttaglist1 != null) + { + for (int l = 0; l < nbttaglist1.tagCount(); ++l) + { + NBTTagCompound nbttagcompound3 = nbttaglist1.getCompoundTagAt(l); + Entity entity2 = EntityList.createEntityFromNBT(nbttagcompound3, p_75823_1_); + chunk.hasEntities = true; + + if (entity2 != null) + { + chunk.addEntity(entity2); + Entity entity = entity2; + + for (NBTTagCompound nbttagcompound2 = nbttagcompound3; nbttagcompound2.hasKey("Riding", 10); nbttagcompound2 = nbttagcompound2.getCompoundTag("Riding")) + { + Entity entity1 = EntityList.createEntityFromNBT(nbttagcompound2.getCompoundTag("Riding"), p_75823_1_); + + if (entity1 != null) + { + chunk.addEntity(entity1); + entity.mountEntity(entity1); + } + + entity = entity1; + } + } + } + } + + NBTTagList nbttaglist2 = p_75823_2_.getTagList("TileEntities", 10); + + if (nbttaglist2 != null) + { + for (int i1 = 0; i1 < nbttaglist2.tagCount(); ++i1) + { + NBTTagCompound nbttagcompound4 = nbttaglist2.getCompoundTagAt(i1); + TileEntity tileentity = TileEntity.createAndLoadEntity(nbttagcompound4); + + if (tileentity != null) + { + chunk.addTileEntity(tileentity); + } + } + } + + if (p_75823_2_.hasKey("TileTicks", 9)) + { + NBTTagList nbttaglist3 = p_75823_2_.getTagList("TileTicks", 10); + + if (nbttaglist3 != null) + { + for (int j1 = 0; j1 < nbttaglist3.tagCount(); ++j1) + { + NBTTagCompound nbttagcompound5 = nbttaglist3.getCompoundTagAt(j1); + p_75823_1_.func_147446_b(nbttagcompound5.getInteger("x"), nbttagcompound5.getInteger("y"), nbttagcompound5.getInteger("z"), Block.getBlockById(nbttagcompound5.getInteger("i")), nbttagcompound5.getInteger("t"), nbttagcompound5.getInteger("p")); + } + } + } + + // return chunk; + } + + static class PendingChunk + { + public final ChunkCoordIntPair chunkCoordinate; + public final NBTTagCompound nbtTags; + private static final String __OBFID = "CL_00000385"; + + public PendingChunk(ChunkCoordIntPair p_i2002_1_, NBTTagCompound p_i2002_2_) + { + this.chunkCoordinate = p_i2002_1_; + this.nbtTags = p_i2002_2_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java new file mode 100644 index 0000000..ae3a633 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveConverter.java @@ -0,0 +1,304 @@ +package net.minecraft.world.chunk.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.biome.WorldChunkManagerHell; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveFormatComparator; +import net.minecraft.world.storage.SaveFormatOld; +import net.minecraft.world.storage.WorldInfo; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class AnvilSaveConverter extends SaveFormatOld +{ + private static final Logger logger = LogManager.getLogger(); + private static final String __OBFID = "CL_00000582"; + + public AnvilSaveConverter(File p_i2144_1_) + { + super(p_i2144_1_); + } + + @SideOnly(Side.CLIENT) + public String func_154333_a() + { + return "Anvil"; + } + + @SideOnly(Side.CLIENT) + public List getSaveList() throws AnvilConverterException + { + if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) + { + ArrayList arraylist = new ArrayList(); + File[] afile = this.savesDirectory.listFiles(); + File[] afile1 = afile; + int i = afile.length; + + for (int j = 0; j < i; ++j) + { + File file1 = afile1[j]; + + if (file1.isDirectory()) + { + String s = file1.getName(); + WorldInfo worldinfo = this.getWorldInfo(s); + + if (worldinfo != null && (worldinfo.getSaveVersion() == 19132 || worldinfo.getSaveVersion() == 19133)) + { + boolean flag = worldinfo.getSaveVersion() != this.getSaveVersion(); + String s1 = worldinfo.getWorldName(); + + if (s1 == null || MathHelper.stringNullOrLengthZero(s1)) + { + s1 = s; + } + + long k = 0L; + arraylist.add(new SaveFormatComparator(s, s1, worldinfo.getLastTimePlayed(), k, worldinfo.getGameType(), flag, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed())); + } + } + } + + return arraylist; + } + else + { + throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!"); + } + } + + protected int getSaveVersion() + { + return 19133; + } + + public void flushCache() + { + RegionFileCache.clearRegionFileReferences(); + } + + /** + * Returns back a loader for the specified save directory + */ + public ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_) + { + return new AnvilSaveHandler(this.savesDirectory, p_75804_1_, p_75804_2_); + } + + @SideOnly(Side.CLIENT) + public boolean func_154334_a(String p_154334_1_) + { + WorldInfo worldinfo = this.getWorldInfo(p_154334_1_); + return worldinfo != null && worldinfo.getSaveVersion() == 19132; + } + + /** + * Checks if the save directory uses the old map format + */ + public boolean isOldMapFormat(String p_75801_1_) + { + WorldInfo worldinfo = this.getWorldInfo(p_75801_1_); + return worldinfo != null && worldinfo.getSaveVersion() != this.getSaveVersion(); + } + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + public boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_) + { + p_75805_2_.setLoadingProgress(0); + ArrayList arraylist = new ArrayList(); + ArrayList arraylist1 = new ArrayList(); + ArrayList arraylist2 = new ArrayList(); + File file1 = new File(this.savesDirectory, p_75805_1_); + File file2 = new File(file1, "DIM-1"); + File file3 = new File(file1, "DIM1"); + logger.info("Scanning folders..."); + this.addRegionFilesToCollection(file1, arraylist); + + if (file2.exists()) + { + this.addRegionFilesToCollection(file2, arraylist1); + } + + if (file3.exists()) + { + this.addRegionFilesToCollection(file3, arraylist2); + } + + int i = arraylist.size() + arraylist1.size() + arraylist2.size(); + logger.info("Total conversion count is " + i); + WorldInfo worldinfo = this.getWorldInfo(p_75805_1_); + Object object = null; + + if (worldinfo.getTerrainType() == WorldType.FLAT) + { + object = new WorldChunkManagerHell(BiomeGenBase.plains, 0.5F); + } + else + { + object = new WorldChunkManager(worldinfo.getSeed(), worldinfo.getTerrainType()); + } + + this.convertFile(new File(file1, "region"), arraylist, (WorldChunkManager)object, 0, i, p_75805_2_); + this.convertFile(new File(file2, "region"), arraylist1, new WorldChunkManagerHell(BiomeGenBase.hell, 0.0F), arraylist.size(), i, p_75805_2_); + this.convertFile(new File(file3, "region"), arraylist2, new WorldChunkManagerHell(BiomeGenBase.sky, 0.0F), arraylist.size() + arraylist1.size(), i, p_75805_2_); + worldinfo.setSaveVersion(19133); + + if (worldinfo.getTerrainType() == WorldType.DEFAULT_1_1) + { + worldinfo.setTerrainType(WorldType.DEFAULT); + } + + this.createFile(p_75805_1_); + ISaveHandler isavehandler = this.getSaveLoader(p_75805_1_, false); + isavehandler.saveWorldInfo(worldinfo); + return true; + } + + /** + * par: filename for the level.dat_mcr backup + */ + private void createFile(String p_75809_1_) + { + File file1 = new File(this.savesDirectory, p_75809_1_); + + if (!file1.exists()) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + else + { + File file2 = new File(file1, "level.dat"); + + if (!file2.exists()) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + else + { + File file3 = new File(file1, "level.dat_mcr"); + + if (!file2.renameTo(file3)) + { + logger.warn("Unable to create level.dat_mcr backup"); + } + } + } + } + + private void convertFile(File p_75813_1_, Iterable p_75813_2_, WorldChunkManager p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate p_75813_6_) + { + Iterator iterator = p_75813_2_.iterator(); + + while (iterator.hasNext()) + { + File file2 = (File)iterator.next(); + this.convertChunks(p_75813_1_, file2, p_75813_3_, p_75813_4_, p_75813_5_, p_75813_6_); + ++p_75813_4_; + int k = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_); + p_75813_6_.setLoadingProgress(k); + } + } + + /** + * copies a 32x32 chunk set from par2File to par1File, via AnvilConverterData + */ + private void convertChunks(File p_75811_1_, File p_75811_2_, WorldChunkManager p_75811_3_, int p_75811_4_, int p_75811_5_, IProgressUpdate p_75811_6_) + { + try + { + String s = p_75811_2_.getName(); + RegionFile regionfile = new RegionFile(p_75811_2_); + RegionFile regionfile1 = new RegionFile(new File(p_75811_1_, s.substring(0, s.length() - ".mcr".length()) + ".mca")); + + for (int k = 0; k < 32; ++k) + { + int l; + + for (l = 0; l < 32; ++l) + { + if (regionfile.isChunkSaved(k, l) && !regionfile1.isChunkSaved(k, l)) + { + DataInputStream datainputstream = regionfile.getChunkDataInputStream(k, l); + + if (datainputstream == null) + { + logger.warn("Failed to fetch input stream"); + } + else + { + NBTTagCompound nbttagcompound = CompressedStreamTools.read(datainputstream); + datainputstream.close(); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Level"); + ChunkLoader.AnvilConverterData anvilconverterdata = ChunkLoader.load(nbttagcompound1); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + NBTTagCompound nbttagcompound3 = new NBTTagCompound(); + nbttagcompound2.setTag("Level", nbttagcompound3); + ChunkLoader.convertToAnvilFormat(anvilconverterdata, nbttagcompound3, p_75811_3_); + DataOutputStream dataoutputstream = regionfile1.getChunkDataOutputStream(k, l); + CompressedStreamTools.write(nbttagcompound2, dataoutputstream); + dataoutputstream.close(); + } + } + } + + l = (int)Math.round(100.0D * (double)(p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + int i1 = (int)Math.round(100.0D * (double)((k + 1) * 32 + p_75811_4_ * 1024) / (double)(p_75811_5_ * 1024)); + + if (i1 > l) + { + p_75811_6_.setLoadingProgress(i1); + } + } + + regionfile.close(); + regionfile1.close(); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + /** + * filters the files in the par1 directory, and adds them to the par2 collections + */ + private void addRegionFilesToCollection(File p_75810_1_, Collection p_75810_2_) + { + File file2 = new File(p_75810_1_, "region"); + File[] afile = file2.listFiles(new FilenameFilter() + { + private static final String __OBFID = "CL_00000583"; + public boolean accept(File p_accept_1_, String p_accept_2_) + { + return p_accept_2_.endsWith(".mcr"); + } + }); + + if (afile != null) + { + Collections.addAll(p_75810_2_, afile); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java new file mode 100644 index 0000000..d4d1d31 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/AnvilSaveHandler.java @@ -0,0 +1,66 @@ +package net.minecraft.world.chunk.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.ThreadedFileIOBase; +import net.minecraft.world.storage.WorldInfo; + +public class AnvilSaveHandler extends SaveHandler +{ + private static final String __OBFID = "CL_00000581"; + + public AnvilSaveHandler(File p_i2142_1_, String p_i2142_2_, boolean p_i2142_3_) + { + super(p_i2142_1_, p_i2142_2_, p_i2142_3_); + } + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) + { + File file1 = this.getWorldDirectory(); + File file2; + + if (p_75763_1_.getSaveFolder() != null) + { + file2 = new File(file1, p_75763_1_.getSaveFolder()); + file2.mkdirs(); + return new AnvilChunkLoader(file2); + } + else + { + return new AnvilChunkLoader(file1); + } + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) + { + p_75755_1_.setSaveVersion(19133); + super.saveWorldInfoWithPlayer(p_75755_1_, p_75755_2_); + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() + { + try + { + ThreadedFileIOBase.threadedIOInstance.waitForFinish(); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + + RegionFileCache.clearRegionFileReferences(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ChunkLoader.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ChunkLoader.java new file mode 100644 index 0000000..fdbb697 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ChunkLoader.java @@ -0,0 +1,166 @@ +package net.minecraft.world.chunk.storage; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraft.world.chunk.NibbleArray; + +public class ChunkLoader +{ + private static final String __OBFID = "CL_00000379"; + + public static ChunkLoader.AnvilConverterData load(NBTTagCompound p_76691_0_) + { + int i = p_76691_0_.getInteger("xPos"); + int j = p_76691_0_.getInteger("zPos"); + ChunkLoader.AnvilConverterData anvilconverterdata = new ChunkLoader.AnvilConverterData(i, j); + anvilconverterdata.blocks = p_76691_0_.getByteArray("Blocks"); + anvilconverterdata.data = new NibbleArrayReader(p_76691_0_.getByteArray("Data"), 7); + anvilconverterdata.skyLight = new NibbleArrayReader(p_76691_0_.getByteArray("SkyLight"), 7); + anvilconverterdata.blockLight = new NibbleArrayReader(p_76691_0_.getByteArray("BlockLight"), 7); + anvilconverterdata.heightmap = p_76691_0_.getByteArray("HeightMap"); + anvilconverterdata.terrainPopulated = p_76691_0_.getBoolean("TerrainPopulated"); + anvilconverterdata.entities = p_76691_0_.getTagList("Entities", 10); + anvilconverterdata.field_151564_i = p_76691_0_.getTagList("TileEntities", 10); + anvilconverterdata.field_151563_j = p_76691_0_.getTagList("TileTicks", 10); + + try + { + anvilconverterdata.lastUpdated = p_76691_0_.getLong("LastUpdate"); + } + catch (ClassCastException classcastexception) + { + anvilconverterdata.lastUpdated = (long)p_76691_0_.getInteger("LastUpdate"); + } + + return anvilconverterdata; + } + + public static void convertToAnvilFormat(ChunkLoader.AnvilConverterData p_76690_0_, NBTTagCompound p_76690_1_, WorldChunkManager p_76690_2_) + { + p_76690_1_.setInteger("xPos", p_76690_0_.x); + p_76690_1_.setInteger("zPos", p_76690_0_.z); + p_76690_1_.setLong("LastUpdate", p_76690_0_.lastUpdated); + int[] aint = new int[p_76690_0_.heightmap.length]; + + for (int i = 0; i < p_76690_0_.heightmap.length; ++i) + { + aint[i] = p_76690_0_.heightmap[i]; + } + + p_76690_1_.setIntArray("HeightMap", aint); + p_76690_1_.setBoolean("TerrainPopulated", p_76690_0_.terrainPopulated); + NBTTagList nbttaglist = new NBTTagList(); + int k; + + for (int j = 0; j < 8; ++j) + { + boolean flag = true; + + for (k = 0; k < 16 && flag; ++k) + { + int l = 0; + + while (l < 16 && flag) + { + int i1 = 0; + + while (true) + { + if (i1 < 16) + { + int j1 = k << 11 | i1 << 7 | l + (j << 4); + byte b0 = p_76690_0_.blocks[j1]; + + if (b0 == 0) + { + ++i1; + continue; + } + + flag = false; + } + + ++l; + break; + } + } + } + + if (!flag) + { + byte[] abyte1 = new byte[4096]; + NibbleArray nibblearray = new NibbleArray(abyte1.length, 4); + NibbleArray nibblearray1 = new NibbleArray(abyte1.length, 4); + NibbleArray nibblearray2 = new NibbleArray(abyte1.length, 4); + + for (int k2 = 0; k2 < 16; ++k2) + { + for (int k1 = 0; k1 < 16; ++k1) + { + for (int l1 = 0; l1 < 16; ++l1) + { + int i2 = k2 << 11 | l1 << 7 | k1 + (j << 4); + byte b1 = p_76690_0_.blocks[i2]; + abyte1[k1 << 8 | l1 << 4 | k2] = (byte)(b1 & 255); + nibblearray.set(k2, k1, l1, p_76690_0_.data.get(k2, k1 + (j << 4), l1)); + nibblearray1.set(k2, k1, l1, p_76690_0_.skyLight.get(k2, k1 + (j << 4), l1)); + nibblearray2.set(k2, k1, l1, p_76690_0_.blockLight.get(k2, k1 + (j << 4), l1)); + } + } + } + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Y", (byte)(j & 255)); + nbttagcompound1.setByteArray("Blocks", abyte1); + nbttagcompound1.setByteArray("Data", nibblearray.data); + nbttagcompound1.setByteArray("SkyLight", nibblearray1.data); + nbttagcompound1.setByteArray("BlockLight", nibblearray2.data); + nbttaglist.appendTag(nbttagcompound1); + } + } + + p_76690_1_.setTag("Sections", nbttaglist); + byte[] abyte = new byte[256]; + + for (int j2 = 0; j2 < 16; ++j2) + { + for (k = 0; k < 16; ++k) + { + abyte[k << 4 | j2] = (byte)(p_76690_2_.getBiomeGenAt(p_76690_0_.x << 4 | j2, p_76690_0_.z << 4 | k).biomeID & 255); + } + } + + p_76690_1_.setByteArray("Biomes", abyte); + p_76690_1_.setTag("Entities", p_76690_0_.entities); + p_76690_1_.setTag("TileEntities", p_76690_0_.field_151564_i); + + if (p_76690_0_.field_151563_j != null) + { + p_76690_1_.setTag("TileTicks", p_76690_0_.field_151563_j); + } + } + + public static class AnvilConverterData + { + public long lastUpdated; + public boolean terrainPopulated; + public byte[] heightmap; + public NibbleArrayReader blockLight; + public NibbleArrayReader skyLight; + public NibbleArrayReader data; + public byte[] blocks; + public NBTTagList entities; + public NBTTagList field_151564_i; + public NBTTagList field_151563_j; + public final int x; + public final int z; + private static final String __OBFID = "CL_00000380"; + + public AnvilConverterData(int p_i1999_1_, int p_i1999_2_) + { + this.x = p_i1999_1_; + this.z = p_i1999_2_; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java new file mode 100644 index 0000000..4703f3a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/ExtendedBlockStorage.java @@ -0,0 +1,300 @@ +package net.minecraft.world.chunk.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.chunk.NibbleArray; + +public class ExtendedBlockStorage +{ + /** Contains the bottom-most Y block represented by this ExtendedBlockStorage. Typically a multiple of 16. */ + private int yBase; + /** A total count of the number of non-air blocks in this block storage's Chunk. */ + private int blockRefCount; + /** + * Contains the number of blocks in this block storage's parent chunk that require random ticking. Used to cull the + * Chunk from random tick updates for performance reasons. + */ + private int tickRefCount; + /** Contains the least significant 8 bits of each block ID belonging to this block storage's parent Chunk. */ + private byte[] blockLSBArray; + /** Contains the most significant 4 bits of each block ID belonging to this block storage's parent Chunk. */ + private NibbleArray blockMSBArray; + /** Stores the metadata associated with blocks in this ExtendedBlockStorage. */ + private NibbleArray blockMetadataArray; + /** The NibbleArray containing a block of Block-light data. */ + private NibbleArray blocklightArray; + /** The NibbleArray containing a block of Sky-light data. */ + private NibbleArray skylightArray; + private static final String __OBFID = "CL_00000375"; + + public ExtendedBlockStorage(int p_i1997_1_, boolean p_i1997_2_) + { + this.yBase = p_i1997_1_; + this.blockLSBArray = new byte[4096]; + this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4); + this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4); + + if (p_i1997_2_) + { + this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4); + } + } + + /** + * Returns the block for a location in a chunk, with the extended ID merged from a byte array and a NibbleArray to + * form a full 12-bit block ID. + */ + public Block getBlockByExtId(int p_150819_1_, int p_150819_2_, int p_150819_3_) + { + int l = this.blockLSBArray[p_150819_2_ << 8 | p_150819_3_ << 4 | p_150819_1_] & 255; + + if (this.blockMSBArray != null) + { + l |= this.blockMSBArray.get(p_150819_1_, p_150819_2_, p_150819_3_) << 8; + } + + return Block.getBlockById(l); + } + + public void func_150818_a(int p_150818_1_, int p_150818_2_, int p_150818_3_, Block p_150818_4_) + { + int l = this.blockLSBArray[p_150818_2_ << 8 | p_150818_3_ << 4 | p_150818_1_] & 255; + + if (this.blockMSBArray != null) + { + l |= this.blockMSBArray.get(p_150818_1_, p_150818_2_, p_150818_3_) << 8; + } + + Block block1 = Block.getBlockById(l); + + if (block1 != Blocks.air) + { + --this.blockRefCount; + + if (block1.getTickRandomly()) + { + --this.tickRefCount; + } + } + + if (p_150818_4_ != Blocks.air) + { + ++this.blockRefCount; + + if (p_150818_4_.getTickRandomly()) + { + ++this.tickRefCount; + } + } + + int i1 = Block.getIdFromBlock(p_150818_4_); + this.blockLSBArray[p_150818_2_ << 8 | p_150818_3_ << 4 | p_150818_1_] = (byte)(i1 & 255); + + if (i1 > 255) + { + if (this.blockMSBArray == null) + { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + } + + this.blockMSBArray.set(p_150818_1_, p_150818_2_, p_150818_3_, (i1 & 3840) >> 8); + } + else if (this.blockMSBArray != null) + { + this.blockMSBArray.set(p_150818_1_, p_150818_2_, p_150818_3_, 0); + } + } + + /** + * Returns the metadata associated with the block at the given coordinates in this ExtendedBlockStorage. + */ + public int getExtBlockMetadata(int p_76665_1_, int p_76665_2_, int p_76665_3_) + { + return this.blockMetadataArray.get(p_76665_1_, p_76665_2_, p_76665_3_); + } + + /** + * Sets the metadata of the Block at the given coordinates in this ExtendedBlockStorage to the given metadata. + */ + public void setExtBlockMetadata(int p_76654_1_, int p_76654_2_, int p_76654_3_, int p_76654_4_) + { + this.blockMetadataArray.set(p_76654_1_, p_76654_2_, p_76654_3_, p_76654_4_); + } + + /** + * Returns whether or not this block storage's Chunk is fully empty, based on its internal reference count. + */ + public boolean isEmpty() + { + return this.blockRefCount == 0; + } + + /** + * Returns whether or not this block storage's Chunk will require random ticking, used to avoid looping through + * random block ticks when there are no blocks that would randomly tick. + */ + public boolean getNeedsRandomTick() + { + return this.tickRefCount > 0; + } + + /** + * Returns the Y location of this ExtendedBlockStorage. + */ + public int getYLocation() + { + return this.yBase; + } + + /** + * Sets the saved Sky-light value in the extended block storage structure. + */ + public void setExtSkylightValue(int p_76657_1_, int p_76657_2_, int p_76657_3_, int p_76657_4_) + { + this.skylightArray.set(p_76657_1_, p_76657_2_, p_76657_3_, p_76657_4_); + } + + /** + * Gets the saved Sky-light value in the extended block storage structure. + */ + public int getExtSkylightValue(int p_76670_1_, int p_76670_2_, int p_76670_3_) + { + return this.skylightArray.get(p_76670_1_, p_76670_2_, p_76670_3_); + } + + /** + * Sets the saved Block-light value in the extended block storage structure. + */ + public void setExtBlocklightValue(int p_76677_1_, int p_76677_2_, int p_76677_3_, int p_76677_4_) + { + this.blocklightArray.set(p_76677_1_, p_76677_2_, p_76677_3_, p_76677_4_); + } + + /** + * Gets the saved Block-light value in the extended block storage structure. + */ + public int getExtBlocklightValue(int p_76674_1_, int p_76674_2_, int p_76674_3_) + { + return this.blocklightArray.get(p_76674_1_, p_76674_2_, p_76674_3_); + } + + public void removeInvalidBlocks() + { + this.blockRefCount = 0; + this.tickRefCount = 0; + + for (int i = 0; i < 16; ++i) + { + for (int j = 0; j < 16; ++j) + { + for (int k = 0; k < 16; ++k) + { + Block block = this.getBlockByExtId(i, j, k); + + if (block != Blocks.air) + { + ++this.blockRefCount; + + if (block.getTickRandomly()) + { + ++this.tickRefCount; + } + } + } + } + } + } + + public byte[] getBlockLSBArray() + { + return this.blockLSBArray; + } + + @SideOnly(Side.CLIENT) + public void clearMSBArray() + { + this.blockMSBArray = null; + } + + /** + * Returns the block ID MSB (bits 11..8) array for this storage array's Chunk. + */ + public NibbleArray getBlockMSBArray() + { + return this.blockMSBArray; + } + + public NibbleArray getMetadataArray() + { + return this.blockMetadataArray; + } + + /** + * Returns the NibbleArray instance containing Block-light data. + */ + public NibbleArray getBlocklightArray() + { + return this.blocklightArray; + } + + /** + * Returns the NibbleArray instance containing Sky-light data. + */ + public NibbleArray getSkylightArray() + { + return this.skylightArray; + } + + /** + * Sets the array of block ID least significant bits for this ExtendedBlockStorage. + */ + public void setBlockLSBArray(byte[] p_76664_1_) + { + this.blockLSBArray = p_76664_1_; + } + + /** + * Sets the array of blockID most significant bits (blockMSBArray) for this ExtendedBlockStorage. + */ + public void setBlockMSBArray(NibbleArray p_76673_1_) + { + this.blockMSBArray = p_76673_1_; + } + + /** + * Sets the NibbleArray of block metadata (blockMetadataArray) for this ExtendedBlockStorage. + */ + public void setBlockMetadataArray(NibbleArray p_76668_1_) + { + this.blockMetadataArray = p_76668_1_; + } + + /** + * Sets the NibbleArray instance used for Block-light values in this particular storage block. + */ + public void setBlocklightArray(NibbleArray p_76659_1_) + { + this.blocklightArray = p_76659_1_; + } + + /** + * Sets the NibbleArray instance used for Sky-light values in this particular storage block. + */ + public void setSkylightArray(NibbleArray p_76666_1_) + { + this.skylightArray = p_76666_1_; + } + + /** + * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created + * NibbleArray instance. + */ + @SideOnly(Side.CLIENT) + public NibbleArray createBlockMSBArray() + { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + return this.blockMSBArray; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/IChunkLoader.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/IChunkLoader.java new file mode 100644 index 0000000..2a582b8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/IChunkLoader.java @@ -0,0 +1,33 @@ +package net.minecraft.world.chunk.storage; + +import java.io.IOException; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public interface IChunkLoader +{ + /** + * Loads the specified(XZ) chunk into the specified world. + */ + Chunk loadChunk(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException; + + void saveChunk(World p_75816_1_, Chunk p_75816_2_) throws MinecraftException, IOException; + + /** + * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. + * Currently unused. + */ + void saveExtraChunkData(World p_75819_1_, Chunk p_75819_2_); + + /** + * Called every World.tick() + */ + void chunkTick(); + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unused. + */ + void saveExtraData(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java new file mode 100644 index 0000000..b721616 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/NibbleArrayReader.java @@ -0,0 +1,24 @@ +package net.minecraft.world.chunk.storage; + +public class NibbleArrayReader +{ + public final byte[] data; + private final int depthBits; + private final int depthBitsPlusFour; + private static final String __OBFID = "CL_00000376"; + + public NibbleArrayReader(byte[] p_i1998_1_, int p_i1998_2_) + { + this.data = p_i1998_1_; + this.depthBits = p_i1998_2_; + this.depthBitsPlusFour = p_i1998_2_ + 4; + } + + public int get(int p_76686_1_, int p_76686_2_, int p_76686_3_) + { + int l = p_76686_1_ << this.depthBitsPlusFour | p_76686_3_ << this.depthBits | p_76686_2_; + int i1 = l >> 1; + int j1 = l & 1; + return j1 == 0 ? this.data[i1] & 15 : this.data[i1] >> 4 & 15; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFile.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFile.java new file mode 100644 index 0000000..eaabf10 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFile.java @@ -0,0 +1,405 @@ +package net.minecraft.world.chunk.storage; + +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.ArrayList; +import java.util.zip.DeflaterOutputStream; +import java.util.zip.GZIPInputStream; +import java.util.zip.InflaterInputStream; +import net.minecraft.server.MinecraftServer; + +public class RegionFile +{ + private static final byte[] emptySector = new byte[4096]; + private final File fileName; + private RandomAccessFile dataFile; + private final int[] offsets = new int[1024]; + private final int[] chunkTimestamps = new int[1024]; + private ArrayList sectorFree; + /** McRegion sizeDelta */ + private int sizeDelta; + private long lastModified; + private static final String __OBFID = "CL_00000381"; + + public RegionFile(File p_i2001_1_) + { + this.fileName = p_i2001_1_; + this.sizeDelta = 0; + + try + { + if (p_i2001_1_.exists()) + { + this.lastModified = p_i2001_1_.lastModified(); + } + + this.dataFile = new RandomAccessFile(p_i2001_1_, "rw"); + int i; + + if (this.dataFile.length() < 4096L) + { + for (i = 0; i < 1024; ++i) + { + this.dataFile.writeInt(0); + } + + for (i = 0; i < 1024; ++i) + { + this.dataFile.writeInt(0); + } + + this.sizeDelta += 8192; + } + + if ((this.dataFile.length() & 4095L) != 0L) + { + for (i = 0; (long)i < (this.dataFile.length() & 4095L); ++i) + { + this.dataFile.write(0); + } + } + + i = (int)this.dataFile.length() / 4096; + this.sectorFree = new ArrayList(i); + int j; + + for (j = 0; j < i; ++j) + { + this.sectorFree.add(Boolean.valueOf(true)); + } + + this.sectorFree.set(0, Boolean.valueOf(false)); + this.sectorFree.set(1, Boolean.valueOf(false)); + this.dataFile.seek(0L); + int k; + + for (j = 0; j < 1024; ++j) + { + k = this.dataFile.readInt(); + this.offsets[j] = k; + + if (k != 0 && (k >> 8) + (k & 255) <= this.sectorFree.size()) + { + for (int l = 0; l < (k & 255); ++l) + { + this.sectorFree.set((k >> 8) + l, Boolean.valueOf(false)); + } + } + } + + for (j = 0; j < 1024; ++j) + { + k = this.dataFile.readInt(); + this.chunkTimestamps[j] = k; + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + // This is a copy (sort of) of the method below it, make sure they stay in sync + public synchronized boolean chunkExists(int x, int z) + { + if (this.outOfBounds(x, z)) return false; + + try + { + int offset = this.getOffset(x, z); + + if (offset == 0) return false; + + int sectorNumber = offset >> 8; + int numSectors = offset & 255; + + if (sectorNumber + numSectors > this.sectorFree.size()) return false; + + this.dataFile.seek((long)(sectorNumber * 4096)); + int length = this.dataFile.readInt(); + + if (length > 4096 * numSectors || length <= 0) return false; + + byte version = this.dataFile.readByte(); + + if (version == 1 || version == 2) return true; + } + catch (IOException ioexception) + { + return false; + } + + return false; + } + + /** + * args: x, y - get uncompressed chunk stream from the region file + */ + public synchronized DataInputStream getChunkDataInputStream(int p_76704_1_, int p_76704_2_) + { + if (this.outOfBounds(p_76704_1_, p_76704_2_)) + { + return null; + } + else + { + try + { + int k = this.getOffset(p_76704_1_, p_76704_2_); + + if (k == 0) + { + return null; + } + else + { + int l = k >> 8; + int i1 = k & 255; + + if (l + i1 > this.sectorFree.size()) + { + return null; + } + else + { + this.dataFile.seek((long)(l * 4096)); + int j1 = this.dataFile.readInt(); + + if (j1 > 4096 * i1) + { + return null; + } + else if (j1 <= 0) + { + return null; + } + else + { + byte b0 = this.dataFile.readByte(); + byte[] abyte; + + if (b0 == 1) + { + abyte = new byte[j1 - 1]; + this.dataFile.read(abyte); + return new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(abyte)))); + } + else if (b0 == 2) + { + abyte = new byte[j1 - 1]; + this.dataFile.read(abyte); + return new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(abyte)))); + } + else + { + return null; + } + } + } + } + } + catch (IOException ioexception) + { + return null; + } + } + } + + /** + * args: x, z - get an output stream used to write chunk data, data is on disk when the returned stream is closed + */ + public DataOutputStream getChunkDataOutputStream(int p_76710_1_, int p_76710_2_) + { + return this.outOfBounds(p_76710_1_, p_76710_2_) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFile.ChunkBuffer(p_76710_1_, p_76710_2_))); + } + + /** + * args: x, z, data, length - write chunk data at (x, z) to disk + */ + protected synchronized void write(int p_76706_1_, int p_76706_2_, byte[] p_76706_3_, int p_76706_4_) + { + try + { + int l = this.getOffset(p_76706_1_, p_76706_2_); + int i1 = l >> 8; + int j1 = l & 255; + int k1 = (p_76706_4_ + 5) / 4096 + 1; + + if (k1 >= 256) + { + return; + } + + if (i1 != 0 && j1 == k1) + { + this.write(i1, p_76706_3_, p_76706_4_); + } + else + { + int l1; + + for (l1 = 0; l1 < j1; ++l1) + { + this.sectorFree.set(i1 + l1, Boolean.valueOf(true)); + } + + l1 = this.sectorFree.indexOf(Boolean.valueOf(true)); + int i2 = 0; + int j2; + + if (l1 != -1) + { + for (j2 = l1; j2 < this.sectorFree.size(); ++j2) + { + if (i2 != 0) + { + if (((Boolean)this.sectorFree.get(j2)).booleanValue()) + { + ++i2; + } + else + { + i2 = 0; + } + } + else if (((Boolean)this.sectorFree.get(j2)).booleanValue()) + { + l1 = j2; + i2 = 1; + } + + if (i2 >= k1) + { + break; + } + } + } + + if (i2 >= k1) + { + i1 = l1; + this.setOffset(p_76706_1_, p_76706_2_, l1 << 8 | k1); + + for (j2 = 0; j2 < k1; ++j2) + { + this.sectorFree.set(i1 + j2, Boolean.valueOf(false)); + } + + this.write(i1, p_76706_3_, p_76706_4_); + } + else + { + this.dataFile.seek(this.dataFile.length()); + i1 = this.sectorFree.size(); + + for (j2 = 0; j2 < k1; ++j2) + { + this.dataFile.write(emptySector); + this.sectorFree.add(Boolean.valueOf(false)); + } + + this.sizeDelta += 4096 * k1; + this.write(i1, p_76706_3_, p_76706_4_); + this.setOffset(p_76706_1_, p_76706_2_, i1 << 8 | k1); + } + } + + this.setChunkTimestamp(p_76706_1_, p_76706_2_, (int)(MinecraftServer.getSystemTimeMillis() / 1000L)); + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + /** + * args: sectorNumber, data, length - write the chunk data to this RegionFile + */ + private void write(int p_76712_1_, byte[] p_76712_2_, int p_76712_3_) throws IOException + { + this.dataFile.seek((long)(p_76712_1_ * 4096)); + this.dataFile.writeInt(p_76712_3_ + 1); + this.dataFile.writeByte(2); + this.dataFile.write(p_76712_2_, 0, p_76712_3_); + } + + /** + * args: x, z - check region bounds + */ + private boolean outOfBounds(int p_76705_1_, int p_76705_2_) + { + return p_76705_1_ < 0 || p_76705_1_ >= 32 || p_76705_2_ < 0 || p_76705_2_ >= 32; + } + + /** + * args: x, y - get chunk's offset in region file + */ + private int getOffset(int p_76707_1_, int p_76707_2_) + { + return this.offsets[p_76707_1_ + p_76707_2_ * 32]; + } + + /** + * args: x, z, - true if chunk has been saved / converted + */ + public boolean isChunkSaved(int p_76709_1_, int p_76709_2_) + { + return this.getOffset(p_76709_1_, p_76709_2_) != 0; + } + + /** + * args: x, z, offset - sets the chunk's offset in the region file + */ + private void setOffset(int p_76711_1_, int p_76711_2_, int p_76711_3_) throws IOException + { + this.offsets[p_76711_1_ + p_76711_2_ * 32] = p_76711_3_; + this.dataFile.seek((long)((p_76711_1_ + p_76711_2_ * 32) * 4)); + this.dataFile.writeInt(p_76711_3_); + } + + /** + * args: x, z, timestamp - sets the chunk's write timestamp + */ + private void setChunkTimestamp(int p_76713_1_, int p_76713_2_, int p_76713_3_) throws IOException + { + this.chunkTimestamps[p_76713_1_ + p_76713_2_ * 32] = p_76713_3_; + this.dataFile.seek((long)(4096 + (p_76713_1_ + p_76713_2_ * 32) * 4)); + this.dataFile.writeInt(p_76713_3_); + } + + /** + * close this RegionFile and prevent further writes + */ + public void close() throws IOException + { + if (this.dataFile != null) + { + this.dataFile.close(); + } + } + + class ChunkBuffer extends ByteArrayOutputStream + { + private int chunkX; + private int chunkZ; + private static final String __OBFID = "CL_00000382"; + + public ChunkBuffer(int p_i2000_2_, int p_i2000_3_) + { + super(8096); + this.chunkX = p_i2000_2_; + this.chunkZ = p_i2000_3_; + } + + public void close() throws IOException + { + RegionFile.this.write(this.chunkX, this.chunkZ, this.buf, this.count); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFileCache.java b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFileCache.java new file mode 100644 index 0000000..770de49 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/chunk/storage/RegionFileCache.java @@ -0,0 +1,89 @@ +package net.minecraft.world.chunk.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +public class RegionFileCache +{ + /** A map containing Files as keys and RegionFiles as values */ + private static final Map regionsByFilename = new HashMap(); + private static final String __OBFID = "CL_00000383"; + + public static synchronized RegionFile createOrLoadRegionFile(File p_76550_0_, int p_76550_1_, int p_76550_2_) + { + File file2 = new File(p_76550_0_, "region"); + File file3 = new File(file2, "r." + (p_76550_1_ >> 5) + "." + (p_76550_2_ >> 5) + ".mca"); + RegionFile regionfile = (RegionFile)regionsByFilename.get(file3); + + if (regionfile != null) + { + return regionfile; + } + else + { + if (!file2.exists()) + { + file2.mkdirs(); + } + + if (regionsByFilename.size() >= 256) + { + clearRegionFileReferences(); + } + + RegionFile regionfile1 = new RegionFile(file3); + regionsByFilename.put(file3, regionfile1); + return regionfile1; + } + } + + /** + * Saves the current Chunk Map Cache + */ + public static synchronized void clearRegionFileReferences() + { + Iterator iterator = regionsByFilename.values().iterator(); + + while (iterator.hasNext()) + { + RegionFile regionfile = (RegionFile)iterator.next(); + + try + { + if (regionfile != null) + { + regionfile.close(); + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + } + } + + regionsByFilename.clear(); + } + + /** + * Returns an input stream for the specified chunk. Args: worldDir, chunkX, chunkZ + */ + public static DataInputStream getChunkInputStream(File p_76549_0_, int p_76549_1_, int p_76549_2_) + { + RegionFile regionfile = createOrLoadRegionFile(p_76549_0_, p_76549_1_, p_76549_2_); + return regionfile.getChunkDataInputStream(p_76549_1_ & 31, p_76549_2_ & 31); + } + + /** + * Returns an output stream for the specified chunk. Args: worldDir, chunkX, chunkZ + */ + public static DataOutputStream getChunkOutputStream(File p_76552_0_, int p_76552_1_, int p_76552_2_) + { + RegionFile regionfile = createOrLoadRegionFile(p_76552_0_, p_76552_1_, p_76552_2_); + return regionfile.getChunkDataOutputStream(p_76552_1_ & 31, p_76552_2_ & 31); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldManager.java b/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldManager.java new file mode 100644 index 0000000..704bba7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldManager.java @@ -0,0 +1,147 @@ +package net.minecraft.world.demo; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; + +public class DemoWorldManager extends ItemInWorldManager +{ + private boolean field_73105_c; + private boolean demoTimeExpired; + private int field_73104_e; + private int field_73102_f; + private static final String __OBFID = "CL_00001429"; + + public DemoWorldManager(World p_i1513_1_) + { + super(p_i1513_1_); + } + + public void updateBlockRemoving() + { + super.updateBlockRemoving(); + ++this.field_73102_f; + long i = this.theWorld.getTotalWorldTime(); + long j = i / 24000L + 1L; + + if (!this.field_73105_c && this.field_73102_f > 20) + { + this.field_73105_c = true; + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 0.0F)); + } + + this.demoTimeExpired = i > 120500L; + + if (this.demoTimeExpired) + { + ++this.field_73104_e; + } + + if (i % 24000L == 500L) + { + if (j <= 6L) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day." + j, new Object[0])); + } + } + else if (j == 1L) + { + if (i == 100L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 101.0F)); + } + else if (i == 175L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 102.0F)); + } + else if (i == 250L) + { + this.thisPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(5, 103.0F)); + } + } + else if (j == 5L && i % 24000L == 22000L) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.day.warning", new Object[0])); + } + } + + /** + * Sends a message to the player reminding them that this is the demo version + */ + private void sendDemoReminder() + { + if (this.field_73104_e > 100) + { + this.thisPlayerMP.addChatMessage(new ChatComponentTranslation("demo.reminder", new Object[0])); + this.field_73104_e = 0; + } + } + + /** + * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific + * side. tryHarvestBlock can also be the result of this call + */ + public void onBlockClicked(int p_73074_1_, int p_73074_2_, int p_73074_3_, int p_73074_4_) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + } + else + { + super.onBlockClicked(p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + } + } + + public void uncheckedTryHarvestBlock(int p_73082_1_, int p_73082_2_, int p_73082_3_) + { + if (!this.demoTimeExpired) + { + super.uncheckedTryHarvestBlock(p_73082_1_, p_73082_2_, p_73082_3_); + } + } + + /** + * Attempts to harvest a block at the given coordinate + */ + public boolean tryHarvestBlock(int p_73084_1_, int p_73084_2_, int p_73084_3_) + { + return this.demoTimeExpired ? false : super.tryHarvestBlock(p_73084_1_, p_73084_2_, p_73084_3_); + } + + /** + * Attempts to right-click use an item by the given EntityPlayer in the given World + */ + public boolean tryUseItem(EntityPlayer p_73085_1_, World p_73085_2_, ItemStack p_73085_3_) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + return false; + } + else + { + return super.tryUseItem(p_73085_1_, p_73085_2_, p_73085_3_); + } + } + + /** + * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, + * xOffset, yOffset, zOffset + */ + public boolean activateBlockOrUseItem(EntityPlayer player, World worldIn, ItemStack stack, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) + { + if (this.demoTimeExpired) + { + this.sendDemoReminder(); + return false; + } + else + { + return super.activateBlockOrUseItem(player, worldIn, stack, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldServer.java b/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldServer.java new file mode 100644 index 0000000..4f16b6c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/demo/DemoWorldServer.java @@ -0,0 +1,20 @@ +package net.minecraft.world.demo; + +import net.minecraft.profiler.Profiler; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; +import net.minecraft.world.storage.ISaveHandler; + +public class DemoWorldServer extends WorldServer +{ + private static final long demoWorldSeed = (long)"North Carolina".hashCode(); + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); + private static final String __OBFID = "CL_00001428"; + + public DemoWorldServer(MinecraftServer p_i45282_1_, ISaveHandler p_i45282_2_, String p_i45282_3_, int p_i45282_4_, Profiler p_i45282_5_) + { + super(p_i45282_1_, p_i45282_2_, p_i45282_3_, p_i45282_4_, demoWorldSettings, p_i45282_5_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderEnd.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderEnd.java new file mode 100644 index 0000000..d11e849 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderEnd.java @@ -0,0 +1,454 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +import net.minecraftforge.common.*; +import cpw.mods.fml.common.eventhandler.Event.*; +import net.minecraftforge.event.terraingen.*; + +public class ChunkProviderEnd implements IChunkProvider +{ + private Random endRNG; + private NoiseGeneratorOctaves noiseGen1; + private NoiseGeneratorOctaves noiseGen2; + private NoiseGeneratorOctaves noiseGen3; + public NoiseGeneratorOctaves noiseGen4; + public NoiseGeneratorOctaves noiseGen5; + private World endWorld; + private double[] densities; + /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + int[][] field_73203_h = new int[32][32]; + private static final String __OBFID = "CL_00000397"; + + public ChunkProviderEnd(World p_i2007_1_, long p_i2007_2_) + { + this.endWorld = p_i2007_1_; + this.endRNG = new Random(p_i2007_2_); + this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); + this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); + this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); + this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + + NoiseGenerator[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5}; + noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2007_1_, this.endRNG, noiseGens); + this.noiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; + this.noiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; + this.noiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; + this.noiseGen4 = (NoiseGeneratorOctaves)noiseGens[3]; + this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; + } + + public void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_) + { + byte b0 = 2; + int k = b0 + 1; + byte b1 = 33; + int l = b0 + 1; + this.densities = this.initializeNoiseField(this.densities, p_147420_1_ * b0, 0, p_147420_2_ * b0, k, b1, l); + + for (int i1 = 0; i1 < b0; ++i1) + { + for (int j1 = 0; j1 < b0; ++j1) + { + for (int k1 = 0; k1 < 32; ++k1) + { + double d0 = 0.25D; + double d1 = this.densities[((i1 + 0) * l + j1 + 0) * b1 + k1 + 0]; + double d2 = this.densities[((i1 + 0) * l + j1 + 1) * b1 + k1 + 0]; + double d3 = this.densities[((i1 + 1) * l + j1 + 0) * b1 + k1 + 0]; + double d4 = this.densities[((i1 + 1) * l + j1 + 1) * b1 + k1 + 0]; + double d5 = (this.densities[((i1 + 0) * l + j1 + 0) * b1 + k1 + 1] - d1) * d0; + double d6 = (this.densities[((i1 + 0) * l + j1 + 1) * b1 + k1 + 1] - d2) * d0; + double d7 = (this.densities[((i1 + 1) * l + j1 + 0) * b1 + k1 + 1] - d3) * d0; + double d8 = (this.densities[((i1 + 1) * l + j1 + 1) * b1 + k1 + 1] - d4) * d0; + + for (int l1 = 0; l1 < 4; ++l1) + { + double d9 = 0.125D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int i2 = 0; i2 < 8; ++i2) + { + int j2 = i2 + i1 * 8 << 11 | 0 + j1 * 8 << 7 | k1 * 4 + l1; + short short1 = 128; + double d14 = 0.125D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int k2 = 0; k2 < 8; ++k2) + { + Block block = null; + + if (d15 > 0.0D) + { + block = Blocks.end_stone; + } + + p_147420_3_[j2] = block; + j2 += short1; + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + @Deprecated // Supply metadata to the below function. + public void func_147421_b(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_) + { + replaceBiomeBlocks(p_147421_1_, p_147421_2_, p_147421_3_, p_147421_4_, new byte[p_147421_3_.length]); + } + public void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta) + { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147421_1_, p_147421_2_, p_147421_3_, meta, p_147421_4_, this.endWorld); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return; + + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) + { + byte b0 = 1; + int i1 = -1; + Block block = Blocks.end_stone; + Block block1 = Blocks.end_stone; + + for (int j1 = 127; j1 >= 0; --j1) + { + int k1 = (l * 16 + k) * 128 + j1; + Block block2 = p_147421_3_[k1]; + + if (block2 != null && block2.getMaterial() != Material.air) + { + if (block2 == Blocks.stone) + { + if (i1 == -1) + { + if (b0 <= 0) + { + block = null; + block1 = Blocks.end_stone; + } + + i1 = b0; + + if (j1 >= 0) + { + p_147421_3_[k1] = block; + } + else + { + p_147421_3_[k1] = block1; + } + } + else if (i1 > 0) + { + --i1; + p_147421_3_[k1] = block1; + } + } + } + else + { + i1 = -1; + } + } + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + this.endRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[32768]; + byte[] meta = new byte[ablock.length]; + this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.func_147420_a(p_73154_1_, p_73154_2_, ablock, this.biomesForGeneration); + this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, this.biomesForGeneration, meta); + Chunk chunk = new Chunk(this.endWorld, ablock, meta, p_73154_1_, p_73154_2_); + byte[] abyte = chunk.getBiomeArray(); + + for (int k = 0; k < abyte.length; ++k) + { + abyte[k] = (byte)this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + /** + * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) + { + ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return event.noisefield; + + if (p_73187_1_ == null) + { + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; + } + + double d0 = 684.412D; + double d1 = 684.412D; + this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 1.121D, 1.121D, 0.5D); + this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, p_73187_2_, p_73187_4_, p_73187_5_, p_73187_7_, 200.0D, 200.0D, 0.5D); + d0 *= 2.0D; + this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0 / 80.0D, d1 / 160.0D, d0 / 80.0D); + this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0, d1, d0); + this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_, d0, d1, d0); + int k1 = 0; + int l1 = 0; + + for (int i2 = 0; i2 < p_73187_5_; ++i2) + { + for (int j2 = 0; j2 < p_73187_7_; ++j2) + { + double d2 = (this.noiseData4[l1] + 256.0D) / 512.0D; + + if (d2 > 1.0D) + { + d2 = 1.0D; + } + + double d3 = this.noiseData5[l1] / 8000.0D; + + if (d3 < 0.0D) + { + d3 = -d3 * 0.3D; + } + + d3 = d3 * 3.0D - 2.0D; + float f = (float)(i2 + p_73187_2_ - 0) / 1.0F; + float f1 = (float)(j2 + p_73187_4_ - 0) / 1.0F; + float f2 = 100.0F - MathHelper.sqrt_float(f * f + f1 * f1) * 8.0F; + + if (f2 > 80.0F) + { + f2 = 80.0F; + } + + if (f2 < -100.0F) + { + f2 = -100.0F; + } + + if (d3 > 1.0D) + { + d3 = 1.0D; + } + + d3 /= 8.0D; + d3 = 0.0D; + + if (d2 < 0.0D) + { + d2 = 0.0D; + } + + d2 += 0.5D; + d3 = d3 * (double)p_73187_6_ / 16.0D; + ++l1; + double d4 = (double)p_73187_6_ / 2.0D; + + for (int k2 = 0; k2 < p_73187_6_; ++k2) + { + double d5 = 0.0D; + double d6 = ((double)k2 - d4) * 8.0D / d2; + + if (d6 < 0.0D) + { + d6 *= -1.0D; + } + + double d7 = this.noiseData2[k1] / 512.0D; + double d8 = this.noiseData3[k1] / 512.0D; + double d9 = (this.noiseData1[k1] / 10.0D + 1.0D) / 2.0D; + + if (d9 < 0.0D) + { + d5 = d7; + } + else if (d9 > 1.0D) + { + d5 = d8; + } + else + { + d5 = d7 + (d8 - d7) * d9; + } + + d5 -= 8.0D; + d5 += (double)f2; + byte b0 = 2; + double d10; + + if (k2 > p_73187_6_ / 2 - b0) + { + d10 = (double)((float)(k2 - (p_73187_6_ / 2 - b0)) / 64.0F); + + if (d10 < 0.0D) + { + d10 = 0.0D; + } + + if (d10 > 1.0D) + { + d10 = 1.0D; + } + + d5 = d5 * (1.0D - d10) + -3000.0D * d10; + } + + b0 = 8; + + if (k2 < b0) + { + d10 = (double)((float)(b0 - k2) / ((float)b0 - 1.0F)); + d5 = d5 * (1.0D - d10) + -30.0D * d10; + } + + p_73187_1_[k1] = d5; + ++k1; + } + } + } + + return p_73187_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.fallInstantly = true; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); + + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.endWorld.getBiomeGenForCoords(k + 16, l + 16); + biomegenbase.decorate(this.endWorld, this.endWorld.rand, k, l); + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false)); + + BlockFalling.fallInstantly = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "RandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + BiomeGenBase biomegenbase = this.endWorld.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return biomegenbase.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderFlat.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderFlat.java new file mode 100644 index 0000000..b7084e2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderFlat.java @@ -0,0 +1,327 @@ +package net.minecraft.world.gen; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.ExtendedBlockStorage; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenVillage; + +public class ChunkProviderFlat implements IChunkProvider +{ + private World worldObj; + private Random random; + private final Block[] cachedBlockIDs = new Block[256]; + private final byte[] cachedBlockMetadata = new byte[256]; + private final FlatGeneratorInfo flatWorldGenInfo; + private final List structureGenerators = new ArrayList(); + private final boolean hasDecoration; + private final boolean hasDungeons; + private WorldGenLakes waterLakeGenerator; + private WorldGenLakes lavaLakeGenerator; + private static final String __OBFID = "CL_00000391"; + + public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_) + { + this.worldObj = p_i2004_1_; + this.random = new Random(p_i2004_2_); + this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(p_i2004_5_); + + if (p_i2004_4_) + { + Map map = this.flatWorldGenInfo.getWorldFeatures(); + + if (map.containsKey("village")) + { + Map map1 = (Map)map.get("village"); + + if (!map1.containsKey("size")) + { + map1.put("size", "1"); + } + + this.structureGenerators.add(new MapGenVillage(map1)); + } + + if (map.containsKey("biome_1")) + { + this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1"))); + } + + if (map.containsKey("mineshaft")) + { + this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft"))); + } + + if (map.containsKey("stronghold")) + { + this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold"))); + } + } + + this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) + { + this.waterLakeGenerator = new WorldGenLakes(Blocks.water); + } + + if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) + { + this.lavaLakeGenerator = new WorldGenLakes(Blocks.lava); + } + + this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); + Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator(); + + while (iterator.hasNext()) + { + FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next(); + + for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j) + { + this.cachedBlockIDs[j] = flatlayerinfo.func_151536_b(); + this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta(); + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + Chunk chunk = new Chunk(this.worldObj, p_73154_1_, p_73154_2_); + int l; + + for (int k = 0; k < this.cachedBlockIDs.length; ++k) + { + Block block = this.cachedBlockIDs[k]; + + if (block != null) + { + l = k >> 4; + ExtendedBlockStorage extendedblockstorage = chunk.getBlockStorageArray()[l]; + + if (extendedblockstorage == null) + { + extendedblockstorage = new ExtendedBlockStorage(k, !this.worldObj.provider.hasNoSky); + chunk.getBlockStorageArray()[l] = extendedblockstorage; + } + + for (int i1 = 0; i1 < 16; ++i1) + { + for (int j1 = 0; j1 < 16; ++j1) + { + extendedblockstorage.func_150818_a(i1, k & 15, j1, block); + extendedblockstorage.setExtBlockMetadata(i1, k & 15, j1, this.cachedBlockMetadata[k]); + } + } + } + } + + chunk.generateSkylightMap(); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + byte[] abyte = chunk.getBiomeArray(); + + for (l = 0; l < abyte.length; ++l) + { + abyte[l] = (byte)abiomegenbase[l].biomeID; + } + + Iterator iterator = this.structureGenerators.iterator(); + + while (iterator.hasNext()) + { + MapGenBase mapgenbase = (MapGenBase)iterator.next(); + mapgenbase.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, (Block[])null); + } + + chunk.generateSkylightMap(); + return chunk; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); + boolean flag = false; + this.random.setSeed(this.worldObj.getSeed()); + long i1 = this.random.nextLong() / 2L * 2L + 1L; + long j1 = this.random.nextLong() / 2L * 2L + 1L; + this.random.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.worldObj.getSeed()); + Iterator iterator = this.structureGenerators.iterator(); + + while (iterator.hasNext()) + { + MapGenStructure mapgenstructure = (MapGenStructure)iterator.next(); + boolean flag1 = mapgenstructure.generateStructuresInChunk(this.worldObj, this.random, p_73153_2_, p_73153_3_); + + if (mapgenstructure instanceof MapGenVillage) + { + flag |= flag1; + } + } + + int l1; + int i2; + int j2; + + if (this.waterLakeGenerator != null && !flag && this.random.nextInt(4) == 0) + { + l1 = k + this.random.nextInt(16) + 8; + i2 = this.random.nextInt(256); + j2 = l + this.random.nextInt(16) + 8; + this.waterLakeGenerator.generate(this.worldObj, this.random, l1, i2, j2); + } + + if (this.lavaLakeGenerator != null && !flag && this.random.nextInt(8) == 0) + { + l1 = k + this.random.nextInt(16) + 8; + i2 = this.random.nextInt(this.random.nextInt(248) + 8); + j2 = l + this.random.nextInt(16) + 8; + + if (i2 < 63 || this.random.nextInt(10) == 0) + { + this.lavaLakeGenerator.generate(this.worldObj, this.random, l1, i2, j2); + } + } + + if (this.hasDungeons) + { + for (l1 = 0; l1 < 8; ++l1) + { + i2 = k + this.random.nextInt(16) + 8; + j2 = this.random.nextInt(256); + int k1 = l + this.random.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.random, i2, j2, k1); + } + } + + if (this.hasDecoration) + { + biomegenbase.decorate(this.worldObj, this.random, k, l); + } + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "FlatLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return biomegenbase.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + if ("Stronghold".equals(p_147416_2_)) + { + Iterator iterator = this.structureGenerators.iterator(); + + while (iterator.hasNext()) + { + MapGenStructure mapgenstructure = (MapGenStructure)iterator.next(); + + if (mapgenstructure instanceof MapGenStronghold) + { + return mapgenstructure.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_); + } + } + } + + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) + { + Iterator iterator = this.structureGenerators.iterator(); + + while (iterator.hasNext()) + { + MapGenStructure mapgenstructure = (MapGenStructure)iterator.next(); + mapgenstructure.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderGenerate.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderGenerate.java new file mode 100644 index 0000000..7c5dd08 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderGenerate.java @@ -0,0 +1,544 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.feature.WorldGenLakes; +import net.minecraft.world.gen.structure.MapGenMineshaft; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.MapGenVillage; + +import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*; +import net.minecraftforge.common.*; +import cpw.mods.fml.common.eventhandler.Event.*; +import net.minecraftforge.event.terraingen.*; + +public class ChunkProviderGenerate implements IChunkProvider +{ + /** RNG. */ + private Random rand; + private NoiseGeneratorOctaves field_147431_j; + private NoiseGeneratorOctaves field_147432_k; + private NoiseGeneratorOctaves field_147429_l; + private NoiseGeneratorPerlin field_147430_m; + /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen5; + /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; + /** Reference to the World object. */ + private World worldObj; + /** are map structures going to be generated (e.g. strongholds) */ + private final boolean mapFeaturesEnabled; + private WorldType field_147435_p; + private final double[] field_147434_q; + private final float[] parabolicField; + private double[] stoneNoise = new double[256]; + private MapGenBase caveGenerator = new MapGenCaves(); + /** Holds Stronghold Generator */ + private MapGenStronghold strongholdGenerator = new MapGenStronghold(); + /** Holds Village Generator */ + private MapGenVillage villageGenerator = new MapGenVillage(); + /** Holds Mineshaft Generator */ + private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); + /** Holds ravine generator */ + private MapGenBase ravineGenerator = new MapGenRavine(); + /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; + double[] field_147427_d; + double[] field_147428_e; + double[] field_147425_f; + double[] field_147426_g; + int[][] field_73219_j = new int[32][32]; + private static final String __OBFID = "CL_00000396"; + + { + caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE); + strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD); + villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE); + mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT); + scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); + ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); + } + + public ChunkProviderGenerate(World p_i2006_1_, long p_i2006_2_, boolean p_i2006_4_) + { + this.worldObj = p_i2006_1_; + this.mapFeaturesEnabled = p_i2006_4_; + this.field_147435_p = p_i2006_1_.getWorldInfo().getTerrainType(); + this.rand = new Random(p_i2006_2_); + this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); + this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); + this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); + this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); + this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); + this.field_147434_q = new double[825]; + this.parabolicField = new float[25]; + + for (int j = -2; j <= 2; ++j) + { + for (int k = -2; k <= 2; ++k) + { + float f = 10.0F / MathHelper.sqrt_float((float)(j * j + k * k) + 0.2F); + this.parabolicField[j + 2 + (k + 2) * 5] = f; + } + } + + NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, noiseGen6, mobSpawnerNoise}; + noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2006_1_, this.rand, noiseGens); + this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; + this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; + this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; + this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; + this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; + this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; + this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6]; + } + + public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) + { + byte b0 = 63; + this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10); + this.func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4); + + for (int k = 0; k < 4; ++k) + { + int l = k * 5; + int i1 = (k + 1) * 5; + + for (int j1 = 0; j1 < 4; ++j1) + { + int k1 = (l + j1) * 33; + int l1 = (l + j1 + 1) * 33; + int i2 = (i1 + j1) * 33; + int j2 = (i1 + j1 + 1) * 33; + + for (int k2 = 0; k2 < 32; ++k2) + { + double d0 = 0.125D; + double d1 = this.field_147434_q[k1 + k2]; + double d2 = this.field_147434_q[l1 + k2]; + double d3 = this.field_147434_q[i2 + k2]; + double d4 = this.field_147434_q[j2 + k2]; + double d5 = (this.field_147434_q[k1 + k2 + 1] - d1) * d0; + double d6 = (this.field_147434_q[l1 + k2 + 1] - d2) * d0; + double d7 = (this.field_147434_q[i2 + k2 + 1] - d3) * d0; + double d8 = (this.field_147434_q[j2 + k2 + 1] - d4) * d0; + + for (int l2 = 0; l2 < 8; ++l2) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int i3 = 0; i3 < 4; ++i3) + { + int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2; + short short1 = 256; + j3 -= short1; + double d14 = 0.25D; + double d16 = (d11 - d10) * d14; + double d15 = d10 - d16; + + for (int k3 = 0; k3 < 4; ++k3) + { + if ((d15 += d16) > 0.0D) + { + p_147424_3_[j3 += short1] = Blocks.stone; + } + else if (k2 * 8 + l2 < b0) + { + p_147424_3_[j3 += short1] = Blocks.water; + } + else + { + p_147424_3_[j3 += short1] = null; + } + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) + { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, this.worldObj); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return; + + double d0 = 0.03125D; + this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) + { + BiomeGenBase biomegenbase = p_147422_5_[l + k * 16]; + biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[l + k * 16]); + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + this.rand.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[65536]; + byte[] abyte = new byte[65536]; + this.func_147424_a(p_73154_1_, p_73154_2_, ablock); + this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); + this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + + if (this.mapFeaturesEnabled) + { + this.mineshaftGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.villageGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.strongholdGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + } + + Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); + byte[] abyte1 = chunk.getBiomeArray(); + + for (int k = 0; k < abyte1.length; ++k) + { + abyte1[k] = (byte)this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) + { + double d0 = 684.412D; + double d1 = 684.412D; + double d2 = 512.0D; + double d3 = 512.0D; + this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D); + this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D); + this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + boolean flag1 = false; + boolean flag = false; + int l = 0; + int i1 = 0; + double d4 = 8.5D; + + for (int j1 = 0; j1 < 5; ++j1) + { + for (int k1 = 0; k1 < 5; ++k1) + { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + byte b0 = 2; + BiomeGenBase biomegenbase = this.biomesForGeneration[j1 + 2 + (k1 + 2) * 10]; + + for (int l1 = -b0; l1 <= b0; ++l1) + { + for (int i2 = -b0; i2 <= b0; ++i2) + { + BiomeGenBase biomegenbase1 = this.biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10]; + float f3 = biomegenbase1.rootHeight; + float f4 = biomegenbase1.heightVariation; + + if (this.field_147435_p == WorldType.AMPLIFIED && f3 > 0.0F) + { + f3 = 1.0F + f3 * 2.0F; + f4 = 1.0F + f4 * 4.0F; + } + + float f5 = this.parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F); + + if (biomegenbase1.rootHeight > biomegenbase.rootHeight) + { + f5 /= 2.0F; + } + + f += f4 * f5; + f1 += f3 * f5; + f2 += f5; + } + } + + f /= f2; + f1 /= f2; + f = f * 0.9F + 0.1F; + f1 = (f1 * 4.0F - 1.0F) / 8.0F; + double d12 = this.field_147426_g[i1] / 8000.0D; + + if (d12 < 0.0D) + { + d12 = -d12 * 0.3D; + } + + d12 = d12 * 3.0D - 2.0D; + + if (d12 < 0.0D) + { + d12 /= 2.0D; + + if (d12 < -1.0D) + { + d12 = -1.0D; + } + + d12 /= 1.4D; + d12 /= 2.0D; + } + else + { + if (d12 > 1.0D) + { + d12 = 1.0D; + } + + d12 /= 8.0D; + } + + ++i1; + double d13 = (double)f1; + double d14 = (double)f; + d13 += d12 * 0.2D; + d13 = d13 * 8.5D / 8.0D; + double d5 = 8.5D + d13 * 4.0D; + + for (int j2 = 0; j2 < 33; ++j2) + { + double d6 = ((double)j2 - d5) * 12.0D * 128.0D / 256.0D / d14; + + if (d6 < 0.0D) + { + d6 *= 4.0D; + } + + double d7 = this.field_147428_e[l] / 512.0D; + double d8 = this.field_147425_f[l] / 512.0D; + double d9 = (this.field_147427_d[l] / 10.0D + 1.0D) / 2.0D; + double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6; + + if (j2 > 29) + { + double d11 = (double)((float)(j2 - 29) / 3.0F); + d10 = d10 * (1.0D - d11) + -10.0D * d11; + } + + this.field_147434_q[l] = d10; + ++l; + } + } + } + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.fallInstantly = true; + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); + this.rand.setSeed(this.worldObj.getSeed()); + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.worldObj.getSeed()); + boolean flag = false; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); + + if (this.mapFeaturesEnabled) + { + this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + flag = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, p_73153_2_, p_73153_3_); + } + + int k1; + int l1; + int i2; + + if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag && this.rand.nextInt(4) == 0 + && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) + { + k1 = k + this.rand.nextInt(16) + 8; + l1 = this.rand.nextInt(256); + i2 = l + this.rand.nextInt(16) + 8; + (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2); + } + + if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAVA) && !flag && this.rand.nextInt(8) == 0) + { + k1 = k + this.rand.nextInt(16) + 8; + l1 = this.rand.nextInt(this.rand.nextInt(248) + 8); + i2 = l + this.rand.nextInt(16) + 8; + + if (l1 < 63 || this.rand.nextInt(10) == 0) + { + (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); + } + } + + boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, DUNGEON); + for (k1 = 0; doGen && k1 < 8; ++k1) + { + l1 = k + this.rand.nextInt(16) + 8; + i2 = this.rand.nextInt(256); + int j2 = l + this.rand.nextInt(16) + 8; + (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2); + } + + biomegenbase.decorate(this.worldObj, this.rand, k, l); + if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ANIMALS)) + { + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); + } + k += 8; + l += 8; + + doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ICE); + for (k1 = 0; doGen && k1 < 16; ++k1) + { + for (l1 = 0; l1 < 16; ++l1) + { + i2 = this.worldObj.getPrecipitationHeight(k + k1, l + l1); + + if (this.worldObj.isBlockFreezable(k1 + k, i2 - 1, l1 + l)) + { + this.worldObj.setBlock(k1 + k, i2 - 1, l1 + l, Blocks.ice, 0, 2); + } + + if (this.worldObj.func_147478_e(k1 + k, i2, l1 + l, true)) + { + this.worldObj.setBlock(k1 + k, i2, l1 + l, Blocks.snow_layer, 0, 2); + } + } + } + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); + + BlockFalling.fallInstantly = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "RandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return p_73155_1_ == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(p_73155_2_, p_73155_3_, p_73155_4_) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : biomegenbase.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + return "Stronghold".equals(p_147416_2_) && this.strongholdGenerator != null ? this.strongholdGenerator.func_151545_a(p_147416_1_, p_147416_3_, p_147416_4_, p_147416_5_) : null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) + { + if (this.mapFeaturesEnabled) + { + this.mineshaftGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + this.villageGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + this.strongholdGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderHell.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderHell.java new file mode 100644 index 0000000..b771a85 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderHell.java @@ -0,0 +1,633 @@ +package net.minecraft.world.gen; + +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.feature.WorldGenFire; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenGlowStone1; +import net.minecraft.world.gen.feature.WorldGenGlowStone2; +import net.minecraft.world.gen.feature.WorldGenHellLava; +import net.minecraft.world.gen.feature.WorldGenMinable; +import net.minecraft.world.gen.structure.MapGenNetherBridge; + +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*; +import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; +import net.minecraftforge.common.*; +import cpw.mods.fml.common.eventhandler.Event.*; +import net.minecraftforge.event.terraingen.*; + +public class ChunkProviderHell implements IChunkProvider +{ + private Random hellRNG; + /** A NoiseGeneratorOctaves used in generating nether terrain */ + private NoiseGeneratorOctaves netherNoiseGen1; + private NoiseGeneratorOctaves netherNoiseGen2; + private NoiseGeneratorOctaves netherNoiseGen3; + /** Determines whether slowsand or gravel can be generated at a location */ + private NoiseGeneratorOctaves slowsandGravelNoiseGen; + /** Determines whether something other than nettherack can be generated at a location */ + private NoiseGeneratorOctaves netherrackExculsivityNoiseGen; + public NoiseGeneratorOctaves netherNoiseGen6; + public NoiseGeneratorOctaves netherNoiseGen7; + /** Is the world that the nether is getting generated. */ + private World worldObj; + private double[] noiseField; + public MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); + /** Holds the noise used to determine whether slowsand can be generated at a location */ + private double[] slowsandNoise = new double[256]; + private double[] gravelNoise = new double[256]; + /** Holds the noise used to determine whether something other than netherrack can be generated at a location */ + private double[] netherrackExclusivityNoise = new double[256]; + private MapGenBase netherCaveGenerator = new MapGenCavesHell(); + double[] noiseData1; + double[] noiseData2; + double[] noiseData3; + double[] noiseData4; + double[] noiseData5; + private static final String __OBFID = "CL_00000392"; + + { + genNetherBridge = (MapGenNetherBridge) TerrainGen.getModdedMapGen(genNetherBridge, NETHER_BRIDGE); + netherCaveGenerator = TerrainGen.getModdedMapGen(netherCaveGenerator, NETHER_CAVE); + } + + public ChunkProviderHell(World p_i2005_1_, long p_i2005_2_) + { + this.worldObj = p_i2005_1_; + this.hellRNG = new Random(p_i2005_2_); + this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); + this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); + this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); + this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); + this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + + NoiseGenerator[] noiseGens = {netherNoiseGen1, netherNoiseGen2, netherNoiseGen3, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, netherNoiseGen6, netherNoiseGen7}; + noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2005_1_, this.hellRNG, noiseGens); + this.netherNoiseGen1 = (NoiseGeneratorOctaves)noiseGens[0]; + this.netherNoiseGen2 = (NoiseGeneratorOctaves)noiseGens[1]; + this.netherNoiseGen3 = (NoiseGeneratorOctaves)noiseGens[2]; + this.slowsandGravelNoiseGen = (NoiseGeneratorOctaves)noiseGens[3]; + this.netherrackExculsivityNoiseGen = (NoiseGeneratorOctaves)noiseGens[4]; + this.netherNoiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; + this.netherNoiseGen7 = (NoiseGeneratorOctaves)noiseGens[6]; + } + + public void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_) + { + byte b0 = 4; + byte b1 = 32; + int k = b0 + 1; + byte b2 = 17; + int l = b0 + 1; + this.noiseField = this.initializeNoiseField(this.noiseField, p_147419_1_ * b0, 0, p_147419_2_ * b0, k, b2, l); + + for (int i1 = 0; i1 < b0; ++i1) + { + for (int j1 = 0; j1 < b0; ++j1) + { + for (int k1 = 0; k1 < 16; ++k1) + { + double d0 = 0.125D; + double d1 = this.noiseField[((i1 + 0) * l + j1 + 0) * b2 + k1 + 0]; + double d2 = this.noiseField[((i1 + 0) * l + j1 + 1) * b2 + k1 + 0]; + double d3 = this.noiseField[((i1 + 1) * l + j1 + 0) * b2 + k1 + 0]; + double d4 = this.noiseField[((i1 + 1) * l + j1 + 1) * b2 + k1 + 0]; + double d5 = (this.noiseField[((i1 + 0) * l + j1 + 0) * b2 + k1 + 1] - d1) * d0; + double d6 = (this.noiseField[((i1 + 0) * l + j1 + 1) * b2 + k1 + 1] - d2) * d0; + double d7 = (this.noiseField[((i1 + 1) * l + j1 + 0) * b2 + k1 + 1] - d3) * d0; + double d8 = (this.noiseField[((i1 + 1) * l + j1 + 1) * b2 + k1 + 1] - d4) * d0; + + for (int l1 = 0; l1 < 8; ++l1) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int i2 = 0; i2 < 4; ++i2) + { + int j2 = i2 + i1 * 4 << 11 | 0 + j1 * 4 << 7 | k1 * 8 + l1; + short short1 = 128; + double d14 = 0.25D; + double d15 = d10; + double d16 = (d11 - d10) * d14; + + for (int k2 = 0; k2 < 4; ++k2) + { + Block block = null; + + if (k1 * 8 + l1 < b1) + { + block = Blocks.lava; + } + + if (d15 > 0.0D) + { + block = Blocks.netherrack; + } + + p_147419_3_[j2] = block; + j2 += short1; + d15 += d16; + } + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + @Deprecated //You should provide meatadata and biome data in the below method + public void func_147418_b(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_) + { + replaceBiomeBlocks(p_147418_1_, p_147418_2_, p_147418_3_, new byte[p_147418_3_.length], null); + } + public void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes) + { + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147418_1_, p_147418_2_, p_147418_3_, meta, biomes, this.worldObj); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return; + + byte b0 = 64; + double d0 = 0.03125D; + this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); + this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, p_147418_1_ * 16, 109, p_147418_2_ * 16, 16, 1, 16, d0, 1.0D, d0); + this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, d0 * 2.0D, d0 * 2.0D, d0 * 2.0D); + + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) + { + boolean flag = this.slowsandNoise[k + l * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + boolean flag1 = this.gravelNoise[k + l * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; + int i1 = (int)(this.netherrackExclusivityNoise[k + l * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D); + int j1 = -1; + Block block = Blocks.netherrack; + Block block1 = Blocks.netherrack; + + for (int k1 = 127; k1 >= 0; --k1) + { + int l1 = (l * 16 + k) * 128 + k1; + + if (k1 < 127 - this.hellRNG.nextInt(5) && k1 > 0 + this.hellRNG.nextInt(5)) + { + Block block2 = p_147418_3_[l1]; + + if (block2 != null && block2.getMaterial() != Material.air) + { + if (block2 == Blocks.netherrack) + { + if (j1 == -1) + { + if (i1 <= 0) + { + block = null; + block1 = Blocks.netherrack; + } + else if (k1 >= b0 - 4 && k1 <= b0 + 1) + { + block = Blocks.netherrack; + block1 = Blocks.netherrack; + + if (flag1) + { + block = Blocks.gravel; + block1 = Blocks.netherrack; + } + + if (flag) + { + block = Blocks.soul_sand; + block1 = Blocks.soul_sand; + } + } + + if (k1 < b0 && (block == null || block.getMaterial() == Material.air)) + { + block = Blocks.lava; + } + + j1 = i1; + + if (k1 >= b0 - 1) + { + p_147418_3_[l1] = block; + } + else + { + p_147418_3_[l1] = block1; + } + } + else if (j1 > 0) + { + --j1; + p_147418_3_[l1] = block1; + } + } + } + else + { + j1 = -1; + } + } + else + { + p_147418_3_[l1] = Blocks.bedrock; + } + } + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + return this.provideChunk(p_73158_1_, p_73158_2_); + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + this.hellRNG.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[32768]; + byte[] meta = new byte[ablock.length]; + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); //Forge Move up to allow for passing to replaceBiomeBlocks + this.func_147419_a(p_73154_1_, p_73154_2_, ablock); + this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, meta, abiomegenbase); + this.netherCaveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + this.genNetherBridge.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); + Chunk chunk = new Chunk(this.worldObj, ablock, meta, p_73154_1_, p_73154_2_); + byte[] abyte = chunk.getBiomeArray(); + + for (int k = 0; k < abyte.length; ++k) + { + abyte[k] = (byte)abiomegenbase[k].biomeID; + } + + chunk.resetRelightChecks(); + return chunk; + } + + /** + * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the + * size. + */ + private double[] initializeNoiseField(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) + { + ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) return event.noisefield; + + if (p_73164_1_ == null) + { + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; + } + + double d0 = 684.412D; + double d1 = 2053.236D; + this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 1.0D, 0.0D, 1.0D); + this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, 1, p_73164_7_, 100.0D, 0.0D, 100.0D); + this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0 / 80.0D, d1 / 60.0D, d0 / 80.0D); + this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0); + this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_, d0, d1, d0); + int k1 = 0; + int l1 = 0; + double[] adouble1 = new double[p_73164_6_]; + int i2; + + for (i2 = 0; i2 < p_73164_6_; ++i2) + { + adouble1[i2] = Math.cos((double)i2 * Math.PI * 6.0D / (double)p_73164_6_) * 2.0D; + double d2 = (double)i2; + + if (i2 > p_73164_6_ / 2) + { + d2 = (double)(p_73164_6_ - 1 - i2); + } + + if (d2 < 4.0D) + { + d2 = 4.0D - d2; + adouble1[i2] -= d2 * d2 * d2 * 10.0D; + } + } + + for (i2 = 0; i2 < p_73164_5_; ++i2) + { + for (int k2 = 0; k2 < p_73164_7_; ++k2) + { + double d3 = (this.noiseData4[l1] + 256.0D) / 512.0D; + + if (d3 > 1.0D) + { + d3 = 1.0D; + } + + double d4 = 0.0D; + double d5 = this.noiseData5[l1] / 8000.0D; + + if (d5 < 0.0D) + { + d5 = -d5; + } + + d5 = d5 * 3.0D - 3.0D; + + if (d5 < 0.0D) + { + d5 /= 2.0D; + + if (d5 < -1.0D) + { + d5 = -1.0D; + } + + d5 /= 1.4D; + d5 /= 2.0D; + d3 = 0.0D; + } + else + { + if (d5 > 1.0D) + { + d5 = 1.0D; + } + + d5 /= 6.0D; + } + + d3 += 0.5D; + d5 = d5 * (double)p_73164_6_ / 16.0D; + ++l1; + + for (int j2 = 0; j2 < p_73164_6_; ++j2) + { + double d6 = 0.0D; + double d7 = adouble1[j2]; + double d8 = this.noiseData2[k1] / 512.0D; + double d9 = this.noiseData3[k1] / 512.0D; + double d10 = (this.noiseData1[k1] / 10.0D + 1.0D) / 2.0D; + + if (d10 < 0.0D) + { + d6 = d8; + } + else if (d10 > 1.0D) + { + d6 = d9; + } + else + { + d6 = d8 + (d9 - d8) * d10; + } + + d6 -= d7; + double d11; + + if (j2 > p_73164_6_ - 4) + { + d11 = (double)((float)(j2 - (p_73164_6_ - 4)) / 3.0F); + d6 = d6 * (1.0D - d11) + -10.0D * d11; + } + + if ((double)j2 < d4) + { + d11 = (d4 - (double)j2) / 4.0D; + + if (d11 < 0.0D) + { + d11 = 0.0D; + } + + if (d11 > 1.0D) + { + d11 = 1.0D; + } + + d6 = d6 * (1.0D - d11) + -10.0D * d11; + } + + p_73164_1_[k1] = d6; + ++k1; + } + } + } + + return p_73164_1_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return true; + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.fallInstantly = true; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); + + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, p_73153_2_, p_73153_3_); + int i1; + int j1; + int k1; + int l1; + + boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, NETHER_LAVA); + for (i1 = 0; doGen && i1 < 8; ++i1) + { + j1 = k + this.hellRNG.nextInt(16) + 8; + k1 = this.hellRNG.nextInt(120) + 4; + l1 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenHellLava(Blocks.flowing_lava, false)).generate(this.worldObj, this.hellRNG, j1, k1, l1); + } + + i1 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; + int i2; + + doGen = TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, FIRE); + for (j1 = 0; doGen && j1 < i1; ++j1) + { + k1 = k + this.hellRNG.nextInt(16) + 8; + l1 = this.hellRNG.nextInt(120) + 4; + i2 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenFire()).generate(this.worldObj, this.hellRNG, k1, l1, i2); + } + + i1 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); + + doGen = TerrainGen.populate(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false, GLOWSTONE); + for (j1 = 0; doGen && j1 < i1; ++j1) + { + k1 = k + this.hellRNG.nextInt(16) + 8; + l1 = this.hellRNG.nextInt(120) + 4; + i2 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, k1, l1, i2); + } + + for (j1 = 0; doGen && j1 < 10; ++j1) + { + k1 = k + this.hellRNG.nextInt(16) + 8; + l1 = this.hellRNG.nextInt(128); + i2 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, k1, l1, i2); + } + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, hellRNG, k, l)); + + doGen = TerrainGen.decorate(worldObj, hellRNG, k, l, SHROOM); + if (doGen && this.hellRNG.nextInt(1) == 0) + { + j1 = k + this.hellRNG.nextInt(16) + 8; + k1 = this.hellRNG.nextInt(128); + l1 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenFlowers(Blocks.brown_mushroom)).generate(this.worldObj, this.hellRNG, j1, k1, l1); + } + + if (doGen && this.hellRNG.nextInt(1) == 0) + { + j1 = k + this.hellRNG.nextInt(16) + 8; + k1 = this.hellRNG.nextInt(128); + l1 = l + this.hellRNG.nextInt(16) + 8; + (new WorldGenFlowers(Blocks.red_mushroom)).generate(this.worldObj, this.hellRNG, j1, k1, l1); + } + + WorldGenMinable worldgenminable = new WorldGenMinable(Blocks.quartz_ore, 13, Blocks.netherrack); + int j2; + + doGen = TerrainGen.generateOre(worldObj, hellRNG, worldgenminable, k, l, QUARTZ); + for (k1 = 0; doGen && k1 < 16; ++k1) + { + l1 = k + this.hellRNG.nextInt(16); + i2 = this.hellRNG.nextInt(108) + 10; + j2 = l + this.hellRNG.nextInt(16); + worldgenminable.generate(this.worldObj, this.hellRNG, l1, i2, j2); + } + + for (k1 = 0; k1 < 16; ++k1) + { + l1 = k + this.hellRNG.nextInt(16); + i2 = this.hellRNG.nextInt(108) + 10; + j2 = l + this.hellRNG.nextInt(16); + (new WorldGenHellLava(Blocks.flowing_lava, true)).generate(this.worldObj, this.hellRNG, l1, i2, j2); + } + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, hellRNG, k, l)); + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, hellRNG, p_73153_2_, p_73153_3_, false)); + + BlockFalling.fallInstantly = false; + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() {} + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + return false; + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return true; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "HellRandomLevelSource"; + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + if (p_73155_1_ == EnumCreatureType.monster) + { + if (this.genNetherBridge.hasStructureAt(p_73155_2_, p_73155_3_, p_73155_4_)) + { + return this.genNetherBridge.getSpawnList(); + } + + if (this.genNetherBridge.func_142038_b(p_73155_2_, p_73155_3_, p_73155_4_) && this.worldObj.getBlock(p_73155_2_, p_73155_3_ - 1, p_73155_4_) == Blocks.nether_brick) + { + return this.genNetherBridge.getSpawnList(); + } + } + + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(p_73155_2_, p_73155_4_); + return biomegenbase.getSpawnableList(p_73155_1_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + return null; + } + + public int getLoadedChunkCount() + { + return 0; + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) + { + this.genNetherBridge.func_151539_a(this, this.worldObj, p_82695_1_, p_82695_2_, (Block[])null); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderServer.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderServer.java new file mode 100644 index 0000000..2f0fe84 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/ChunkProviderServer.java @@ -0,0 +1,447 @@ +package net.minecraft.world.gen; + +import com.google.common.collect.Lists; +import cpw.mods.fml.common.registry.GameRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IProgressUpdate; +import net.minecraft.util.LongHashMap; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.EmptyChunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.chunkio.ChunkIOExecutor; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ChunkProviderServer implements IChunkProvider +{ + private static final Logger logger = LogManager.getLogger(); + /** + * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in, + * first out) + */ + private Set chunksToUnload = Collections.newSetFromMap(new ConcurrentHashMap()); + private Chunk defaultEmptyChunk; + public IChunkProvider currentChunkProvider; + public IChunkLoader currentChunkLoader; + /** if this is false, the defaultEmptyChunk will be returned by the provider */ + public boolean loadChunkOnProvideRequest = true; + public LongHashMap loadedChunkHashMap = new LongHashMap(); + public List loadedChunks = new ArrayList(); + public WorldServer worldObj; + private Set loadingChunks = com.google.common.collect.Sets.newHashSet(); + private static final String __OBFID = "CL_00001436"; + + public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) + { + this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0); + this.worldObj = p_i1520_1_; + this.currentChunkLoader = p_i1520_2_; + this.currentChunkProvider = p_i1520_3_; + } + + /** + * Checks to see if a chunk exists at x, y + */ + public boolean chunkExists(int p_73149_1_, int p_73149_2_) + { + return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(p_73149_1_, p_73149_2_)); + } + + public List func_152380_a() + { + return this.loadedChunks; + } + + /** + * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is + * outside 200 blocks (x or z) of the spawn + */ + public void unloadChunksIfNotNearSpawn(int p_73241_1_, int p_73241_2_) + { + if (this.worldObj.provider.canRespawnHere() && DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)) + { + ChunkCoordinates chunkcoordinates = this.worldObj.getSpawnPoint(); + int k = p_73241_1_ * 16 + 8 - chunkcoordinates.posX; + int l = p_73241_2_ * 16 + 8 - chunkcoordinates.posZ; + short short1 = 128; + + if (k < -short1 || k > short1 || l < -short1 || l > short1) + { + this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_))); + } + } + else + { + this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_))); + } + } + + /** + * marks all chunks for unload, ignoring those near the spawn + */ + public void unloadAllChunks() + { + Iterator iterator = this.loadedChunks.iterator(); + + while (iterator.hasNext()) + { + Chunk chunk = (Chunk)iterator.next(); + this.unloadChunksIfNotNearSpawn(chunk.xPosition, chunk.zPosition); + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + public Chunk loadChunk(int p_73158_1_, int p_73158_2_) + { + return loadChunk(p_73158_1_, p_73158_2_, null); + } + + public Chunk loadChunk(int par1, int par2, Runnable runnable) + { + long k = ChunkCoordIntPair.chunkXZ2Int(par1, par2); + this.chunksToUnload.remove(Long.valueOf(k)); + Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k); + AnvilChunkLoader loader = null; + + if (this.currentChunkLoader instanceof AnvilChunkLoader) + { + loader = (AnvilChunkLoader) this.currentChunkLoader; + } + + // We can only use the queue for already generated chunks + if (chunk == null && loader != null && loader.chunkExists(this.worldObj, par1, par2)) + { + if (runnable != null) + { + ChunkIOExecutor.queueChunkLoad(this.worldObj, loader, this, par1, par2, runnable); + return null; + } + else + { + chunk = ChunkIOExecutor.syncChunkLoad(this.worldObj, loader, this, par1, par2); + } + } + else if (chunk == null) + { + chunk = this.originalLoadChunk(par1, par2); + } + + // If we didn't load the chunk async and have a callback run it now + if (runnable != null) + { + runnable.run(); + } + + return chunk; + } + + public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_) + { + long k = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_); + this.chunksToUnload.remove(Long.valueOf(k)); + Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(k); + + if (chunk == null) + { + boolean added = loadingChunks.add(k); + if (!added) + { + cpw.mods.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in dimension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, worldObj.provider.dimensionId); + } + chunk = ForgeChunkManager.fetchDormantChunk(k, this.worldObj); + if (chunk == null) + { + chunk = this.safeLoadChunk(p_73158_1_, p_73158_2_); + } + + if (chunk == null) + { + if (this.currentChunkProvider == null) + { + chunk = this.defaultEmptyChunk; + } + else + { + try + { + chunk = this.currentChunkProvider.provideChunk(p_73158_1_, p_73158_2_); + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated"); + crashreportcategory.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(p_73158_1_), Integer.valueOf(p_73158_2_)})); + crashreportcategory.addCrashSection("Position hash", Long.valueOf(k)); + crashreportcategory.addCrashSection("Generator", this.currentChunkProvider.makeString()); + throw new ReportedException(crashreport); + } + } + } + + this.loadedChunkHashMap.add(k, chunk); + this.loadedChunks.add(chunk); + loadingChunks.remove(k); + chunk.onChunkLoad(); + chunk.populateChunk(this, this, p_73158_1_, p_73158_2_); + } + + return chunk; + } + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + public Chunk provideChunk(int p_73154_1_, int p_73154_2_) + { + Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(p_73154_1_, p_73154_2_)); + return chunk == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(p_73154_1_, p_73154_2_)) : chunk; + } + + /** + * used by loadChunk, but catches any exceptions if the load fails. + */ + private Chunk safeLoadChunk(int p_73239_1_, int p_73239_2_) + { + if (this.currentChunkLoader == null) + { + return null; + } + else + { + try + { + Chunk chunk = this.currentChunkLoader.loadChunk(this.worldObj, p_73239_1_, p_73239_2_); + + if (chunk != null) + { + chunk.lastSaveTime = this.worldObj.getTotalWorldTime(); + + if (this.currentChunkProvider != null) + { + this.currentChunkProvider.recreateStructures(p_73239_1_, p_73239_2_); + } + } + + return chunk; + } + catch (Exception exception) + { + logger.error("Couldn\'t load chunk", exception); + return null; + } + } + } + + /** + * used by saveChunks, but catches any exceptions if the save fails. + */ + private void safeSaveExtraChunkData(Chunk p_73243_1_) + { + if (this.currentChunkLoader != null) + { + try + { + this.currentChunkLoader.saveExtraChunkData(this.worldObj, p_73243_1_); + } + catch (Exception exception) + { + logger.error("Couldn\'t save entities", exception); + } + } + } + + /** + * used by saveChunks, but catches any exceptions if the save fails. + */ + private void safeSaveChunk(Chunk p_73242_1_) + { + if (this.currentChunkLoader != null) + { + try + { + p_73242_1_.lastSaveTime = this.worldObj.getTotalWorldTime(); + this.currentChunkLoader.saveChunk(this.worldObj, p_73242_1_); + } + catch (IOException ioexception) + { + logger.error("Couldn\'t save chunk", ioexception); + } + catch (MinecraftException minecraftexception) + { + logger.error("Couldn\'t save chunk; already in use by another instance of Minecraft?", minecraftexception); + } + } + } + + /** + * Populates chunk with ores etc etc + */ + public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + Chunk chunk = this.provideChunk(p_73153_2_, p_73153_3_); + + if (!chunk.isTerrainPopulated) + { + chunk.func_150809_p(); + + if (this.currentChunkProvider != null) + { + this.currentChunkProvider.populate(p_73153_1_, p_73153_2_, p_73153_3_); + GameRegistry.generateWorld(p_73153_2_, p_73153_3_, worldObj, currentChunkProvider, p_73153_1_); + chunk.setChunkModified(); + } + } + } + + /** + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. + * Return true if all chunks have been saved. + */ + public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) + { + int i = 0; + ArrayList arraylist = Lists.newArrayList(this.loadedChunks); + + for (int j = 0; j < arraylist.size(); ++j) + { + Chunk chunk = (Chunk)arraylist.get(j); + + if (p_73151_1_) + { + this.safeSaveExtraChunkData(chunk); + } + + if (chunk.needsSaving(p_73151_1_)) + { + this.safeSaveChunk(chunk); + chunk.isModified = false; + ++i; + + if (i == 24 && !p_73151_1_) + { + return false; + } + } + } + + return true; + } + + /** + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * unimplemented. + */ + public void saveExtraData() + { + if (this.currentChunkLoader != null) + { + this.currentChunkLoader.saveExtraData(); + } + } + + /** + * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. + */ + public boolean unloadQueuedChunks() + { + if (!this.worldObj.levelSaving) + { + for (ChunkCoordIntPair forced : this.worldObj.getPersistentChunks().keySet()) + { + this.chunksToUnload.remove(ChunkCoordIntPair.chunkXZ2Int(forced.chunkXPos, forced.chunkZPos)); + } + + for (int i = 0; i < 100; ++i) + { + if (!this.chunksToUnload.isEmpty()) + { + Long olong = (Long)this.chunksToUnload.iterator().next(); + Chunk chunk = (Chunk)this.loadedChunkHashMap.getValueByKey(olong.longValue()); + + if (chunk != null) + { + chunk.onChunkUnload(); + this.safeSaveChunk(chunk); + this.safeSaveExtraChunkData(chunk); + this.loadedChunks.remove(chunk); + ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.chunkXZ2Int(chunk.xPosition, chunk.zPosition), chunk); + if(loadedChunks.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)){ + DimensionManager.unloadWorld(this.worldObj.provider.dimensionId); + return currentChunkProvider.unloadQueuedChunks(); + } + } + + this.chunksToUnload.remove(olong); + this.loadedChunkHashMap.remove(olong.longValue()); + } + } + + if (this.currentChunkLoader != null) + { + this.currentChunkLoader.chunkTick(); + } + } + + return this.currentChunkProvider.unloadQueuedChunks(); + } + + /** + * Returns if the IChunkProvider supports saving. + */ + public boolean canSave() + { + return !this.worldObj.levelSaving; + } + + /** + * Converts the instance data to a readable string. + */ + public String makeString() + { + return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size(); + } + + /** + * Returns a list of creatures of the specified type that can spawn at the given location. + */ + public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) + { + return this.currentChunkProvider.getPossibleCreatures(p_73155_1_, p_73155_2_, p_73155_3_, p_73155_4_); + } + + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) + { + return this.currentChunkProvider.func_147416_a(p_147416_1_, p_147416_2_, p_147416_3_, p_147416_4_, p_147416_5_); + } + + public int getLoadedChunkCount() + { + return this.loadedChunkHashMap.getNumHashElements(); + } + + public void recreateStructures(int p_82695_1_, int p_82695_2_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatGeneratorInfo.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatGeneratorInfo.java new file mode 100644 index 0000000..ad6db8e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatGeneratorInfo.java @@ -0,0 +1,324 @@ +package net.minecraft.world.gen; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.biome.BiomeGenBase; + +public class FlatGeneratorInfo +{ + /** List of layers on this preset. */ + private final List flatLayers = new ArrayList(); + /** List of world features enabled on this preset. */ + private final Map worldFeatures = new HashMap(); + private int biomeToUse; + private static final String __OBFID = "CL_00000440"; + + /** + * Return the biome used on this preset. + */ + public int getBiome() + { + return this.biomeToUse; + } + + /** + * Set the biome used on this preset. + */ + public void setBiome(int p_82647_1_) + { + this.biomeToUse = p_82647_1_; + } + + /** + * Return the list of world features enabled on this preset. + */ + public Map getWorldFeatures() + { + return this.worldFeatures; + } + + /** + * Return the list of layers on this preset. + */ + public List getFlatLayers() + { + return this.flatLayers; + } + + public void func_82645_d() + { + int i = 0; + FlatLayerInfo flatlayerinfo; + + for (Iterator iterator = this.flatLayers.iterator(); iterator.hasNext(); i += flatlayerinfo.getLayerCount()) + { + flatlayerinfo = (FlatLayerInfo)iterator.next(); + flatlayerinfo.setMinY(i); + } + } + + public String toString() + { + StringBuilder stringbuilder = new StringBuilder(); + stringbuilder.append(2); + stringbuilder.append(";"); + int i; + + for (i = 0; i < this.flatLayers.size(); ++i) + { + if (i > 0) + { + stringbuilder.append(","); + } + + stringbuilder.append(((FlatLayerInfo)this.flatLayers.get(i)).toString()); + } + + stringbuilder.append(";"); + stringbuilder.append(this.biomeToUse); + + if (!this.worldFeatures.isEmpty()) + { + stringbuilder.append(";"); + i = 0; + Iterator iterator = this.worldFeatures.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (i++ > 0) + { + stringbuilder.append(","); + } + + stringbuilder.append(((String)entry.getKey()).toLowerCase()); + Map map = (Map)entry.getValue(); + + if (!map.isEmpty()) + { + stringbuilder.append("("); + int j = 0; + Iterator iterator1 = map.entrySet().iterator(); + + while (iterator1.hasNext()) + { + Entry entry1 = (Entry)iterator1.next(); + + if (j++ > 0) + { + stringbuilder.append(" "); + } + + stringbuilder.append((String)entry1.getKey()); + stringbuilder.append("="); + stringbuilder.append((String)entry1.getValue()); + } + + stringbuilder.append(")"); + } + } + } + else + { + stringbuilder.append(";"); + } + + return stringbuilder.toString(); + } + + private static FlatLayerInfo func_82646_a(String p_82646_0_, int p_82646_1_) + { + String[] astring = p_82646_0_.split("x", 2); + int j = 1; + int l = 0; + + if (astring.length == 2) + { + try + { + j = Integer.parseInt(astring[0]); + + if (p_82646_1_ + j >= 256) + { + j = 256 - p_82646_1_; + } + + if (j < 0) + { + j = 0; + } + } + catch (Throwable throwable) + { + return null; + } + } + + int k; + + try + { + String s1 = astring[astring.length - 1]; + astring = s1.split(":", 2); + k = Integer.parseInt(astring[0]); + + if (astring.length > 1) + { + l = Integer.parseInt(astring[1]); + } + + if (Block.getBlockById(k) == Blocks.air) + { + k = 0; + l = 0; + } + + if (l < 0 || l > 15) + { + l = 0; + } + } + catch (Throwable throwable1) + { + return null; + } + + FlatLayerInfo flatlayerinfo = new FlatLayerInfo(j, Block.getBlockById(k), l); + flatlayerinfo.setMinY(p_82646_1_); + return flatlayerinfo; + } + + private static List func_82652_b(String p_82652_0_) + { + if (p_82652_0_ != null && p_82652_0_.length() >= 1) + { + ArrayList arraylist = new ArrayList(); + String[] astring = p_82652_0_.split(","); + int i = 0; + String[] astring1 = astring; + int j = astring.length; + + for (int k = 0; k < j; ++k) + { + String s1 = astring1[k]; + FlatLayerInfo flatlayerinfo = func_82646_a(s1, i); + + if (flatlayerinfo == null) + { + return null; + } + + arraylist.add(flatlayerinfo); + i += flatlayerinfo.getLayerCount(); + } + + return arraylist; + } + else + { + return null; + } + } + + public static FlatGeneratorInfo createFlatGeneratorFromString(String p_82651_0_) + { + if (p_82651_0_ == null) + { + return getDefaultFlatGenerator(); + } + else + { + String[] astring = p_82651_0_.split(";", -1); + int i = astring.length == 1 ? 0 : MathHelper.parseIntWithDefault(astring[0], 0); + + if (i >= 0 && i <= 2) + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + int j = astring.length == 1 ? 0 : 1; + List list = func_82652_b(astring[j++]); + + if (list != null && !list.isEmpty()) + { + flatgeneratorinfo.getFlatLayers().addAll(list); + flatgeneratorinfo.func_82645_d(); + int k = BiomeGenBase.plains.biomeID; + + if (i > 0 && astring.length > j) + { + k = MathHelper.parseIntWithDefault(astring[j++], k); + } + + flatgeneratorinfo.setBiome(k); + + if (i > 0 && astring.length > j) + { + String[] astring1 = astring[j++].toLowerCase().split(","); + String[] astring2 = astring1; + int l = astring1.length; + + for (int i1 = 0; i1 < l; ++i1) + { + String s1 = astring2[i1]; + String[] astring3 = s1.split("\\(", 2); + HashMap hashmap = new HashMap(); + + if (astring3[0].length() > 0) + { + flatgeneratorinfo.getWorldFeatures().put(astring3[0], hashmap); + + if (astring3.length > 1 && astring3[1].endsWith(")") && astring3[1].length() > 1) + { + String[] astring4 = astring3[1].substring(0, astring3[1].length() - 1).split(" "); + + for (int j1 = 0; j1 < astring4.length; ++j1) + { + String[] astring5 = astring4[j1].split("=", 2); + + if (astring5.length == 2) + { + hashmap.put(astring5[0], astring5[1]); + } + } + } + } + } + } + else + { + flatgeneratorinfo.getWorldFeatures().put("village", new HashMap()); + } + + return flatgeneratorinfo; + } + else + { + return getDefaultFlatGenerator(); + } + } + else + { + return getDefaultFlatGenerator(); + } + } + } + + public static FlatGeneratorInfo getDefaultFlatGenerator() + { + FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo(); + flatgeneratorinfo.setBiome(BiomeGenBase.plains.biomeID); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.bedrock)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(2, Blocks.dirt)); + flatgeneratorinfo.getFlatLayers().add(new FlatLayerInfo(1, Blocks.grass)); + flatgeneratorinfo.func_82645_d(); + flatgeneratorinfo.getWorldFeatures().put("village", new HashMap()); + return flatgeneratorinfo; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatLayerInfo.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatLayerInfo.java new file mode 100644 index 0000000..2c9a808 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/FlatLayerInfo.java @@ -0,0 +1,81 @@ +package net.minecraft.world.gen; + +import net.minecraft.block.Block; + +public class FlatLayerInfo +{ + private Block field_151537_a; + /** Amount of layers for this set of layers. */ + private int layerCount; + /** Block metadata used on this set of laeyrs. */ + private int layerFillBlockMeta; + private int layerMinimumY; + private static final String __OBFID = "CL_00000441"; + + public FlatLayerInfo(int p_i45467_1_, Block p_i45467_2_) + { + this.layerCount = 1; + this.layerCount = p_i45467_1_; + this.field_151537_a = p_i45467_2_; + } + + public FlatLayerInfo(int p_i45468_1_, Block p_i45468_2_, int p_i45468_3_) + { + this(p_i45468_1_, p_i45468_2_); + this.layerFillBlockMeta = p_i45468_3_; + } + + /** + * Return the amount of layers for this set of layers. + */ + public int getLayerCount() + { + return this.layerCount; + } + + public Block func_151536_b() + { + return this.field_151537_a; + } + + /** + * Return the block metadata used on this set of layers. + */ + public int getFillBlockMeta() + { + return this.layerFillBlockMeta; + } + + /** + * Return the minimum Y coordinate for this layer, set during generation. + */ + public int getMinY() + { + return this.layerMinimumY; + } + + /** + * Set the minimum Y coordinate for this layer. + */ + public void setMinY(int p_82660_1_) + { + this.layerMinimumY = p_82660_1_; + } + + public String toString() + { + String s = Integer.toString(Block.getIdFromBlock(this.field_151537_a)); + + if (this.layerCount > 1) + { + s = this.layerCount + "x" + s; + } + + if (this.layerFillBlockMeta > 0) + { + s = s + ":" + this.layerFillBlockMeta; + } + + return s; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenBase.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenBase.java new file mode 100644 index 0000000..657b621 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenBase.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +public class MapGenBase +{ + /** The number of Chunks to gen-check in any given direction. */ + protected int range = 8; + /** The RNG used by the MapGen classes. */ + protected Random rand = new Random(); + /** This world object. */ + protected World worldObj; + private static final String __OBFID = "CL_00000394"; + + public void func_151539_a(IChunkProvider p_151539_1_, World p_151539_2_, int p_151539_3_, int p_151539_4_, Block[] p_151539_5_) + { + int k = this.range; + this.worldObj = p_151539_2_; + this.rand.setSeed(p_151539_2_.getSeed()); + long l = this.rand.nextLong(); + long i1 = this.rand.nextLong(); + + for (int j1 = p_151539_3_ - k; j1 <= p_151539_3_ + k; ++j1) + { + for (int k1 = p_151539_4_ - k; k1 <= p_151539_4_ + k; ++k1) + { + long l1 = (long)j1 * l; + long i2 = (long)k1 * i1; + this.rand.setSeed(l1 ^ i2 ^ p_151539_2_.getSeed()); + this.func_151538_a(p_151539_2_, j1, k1, p_151539_3_, p_151539_4_, p_151539_5_); + } + } + } + + protected void func_151538_a(World worldIn, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCaves.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCaves.java new file mode 100644 index 0000000..7ec5260 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCaves.java @@ -0,0 +1,301 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenCaves extends MapGenBase +{ + private static final String __OBFID = "CL_00000393"; + + protected void func_151542_a(long p_151542_1_, int p_151542_3_, int p_151542_4_, Block[] p_151542_5_, double p_151542_6_, double p_151542_8_, double p_151542_10_) + { + this.func_151541_a(p_151542_1_, p_151542_3_, p_151542_4_, p_151542_5_, p_151542_6_, p_151542_8_, p_151542_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_151541_a(long p_151541_1_, int p_151541_3_, int p_151541_4_, Block[] p_151541_5_, double p_151541_6_, double p_151541_8_, double p_151541_10_, float p_151541_12_, float p_151541_13_, float p_151541_14_, int p_151541_15_, int p_151541_16_, double p_151541_17_) + { + double d4 = (double)(p_151541_3_ * 16 + 8); + double d5 = (double)(p_151541_4_ * 16 + 8); + float f3 = 0.0F; + float f4 = 0.0F; + Random random = new Random(p_151541_1_); + + if (p_151541_16_ <= 0) + { + int j1 = this.range * 16 - 16; + p_151541_16_ = j1 - random.nextInt(j1 / 4); + } + + boolean flag2 = false; + + if (p_151541_15_ == -1) + { + p_151541_15_ = p_151541_16_ / 2; + flag2 = true; + } + + int k1 = random.nextInt(p_151541_16_ / 2) + p_151541_16_ / 4; + + for (boolean flag = random.nextInt(6) == 0; p_151541_15_ < p_151541_16_; ++p_151541_15_) + { + double d6 = 1.5D + (double)(MathHelper.sin((float)p_151541_15_ * (float)Math.PI / (float)p_151541_16_) * p_151541_12_ * 1.0F); + double d7 = d6 * p_151541_17_; + float f5 = MathHelper.cos(p_151541_14_); + float f6 = MathHelper.sin(p_151541_14_); + p_151541_6_ += (double)(MathHelper.cos(p_151541_13_) * f5); + p_151541_8_ += (double)f6; + p_151541_10_ += (double)(MathHelper.sin(p_151541_13_) * f5); + + if (flag) + { + p_151541_14_ *= 0.92F; + } + else + { + p_151541_14_ *= 0.7F; + } + + p_151541_14_ += f4 * 0.1F; + p_151541_13_ += f3 * 0.1F; + f4 *= 0.9F; + f3 *= 0.75F; + f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (!flag2 && p_151541_15_ == k1 && p_151541_12_ > 1.0F && p_151541_16_ > 0) + { + this.func_151541_a(random.nextLong(), p_151541_3_, p_151541_4_, p_151541_5_, p_151541_6_, p_151541_8_, p_151541_10_, random.nextFloat() * 0.5F + 0.5F, p_151541_13_ - ((float)Math.PI / 2F), p_151541_14_ / 3.0F, p_151541_15_, p_151541_16_, 1.0D); + this.func_151541_a(random.nextLong(), p_151541_3_, p_151541_4_, p_151541_5_, p_151541_6_, p_151541_8_, p_151541_10_, random.nextFloat() * 0.5F + 0.5F, p_151541_13_ + ((float)Math.PI / 2F), p_151541_14_ / 3.0F, p_151541_15_, p_151541_16_, 1.0D); + return; + } + + if (flag2 || random.nextInt(4) != 0) + { + double d8 = p_151541_6_ - d4; + double d9 = p_151541_10_ - d5; + double d10 = (double)(p_151541_16_ - p_151541_15_); + double d11 = (double)(p_151541_12_ + 2.0F + 16.0F); + + if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) + { + return; + } + + if (p_151541_6_ >= d4 - 16.0D - d6 * 2.0D && p_151541_10_ >= d5 - 16.0D - d6 * 2.0D && p_151541_6_ <= d4 + 16.0D + d6 * 2.0D && p_151541_10_ <= d5 + 16.0D + d6 * 2.0D) + { + int i4 = MathHelper.floor_double(p_151541_6_ - d6) - p_151541_3_ * 16 - 1; + int l1 = MathHelper.floor_double(p_151541_6_ + d6) - p_151541_3_ * 16 + 1; + int j4 = MathHelper.floor_double(p_151541_8_ - d7) - 1; + int i2 = MathHelper.floor_double(p_151541_8_ + d7) + 1; + int k4 = MathHelper.floor_double(p_151541_10_ - d6) - p_151541_4_ * 16 - 1; + int j2 = MathHelper.floor_double(p_151541_10_ + d6) - p_151541_4_ * 16 + 1; + + if (i4 < 0) + { + i4 = 0; + } + + if (l1 > 16) + { + l1 = 16; + } + + if (j4 < 1) + { + j4 = 1; + } + + if (i2 > 248) + { + i2 = 248; + } + + if (k4 < 0) + { + k4 = 0; + } + + if (j2 > 16) + { + j2 = 16; + } + + boolean flag3 = false; + int k2; + int j3; + + for (k2 = i4; !flag3 && k2 < l1; ++k2) + { + for (int l2 = k4; !flag3 && l2 < j2; ++l2) + { + for (int i3 = i2 + 1; !flag3 && i3 >= j4 - 1; --i3) + { + j3 = (k2 * 16 + l2) * 256 + i3; + + if (i3 >= 0 && i3 < 256) + { + Block block = p_151541_5_[j3]; + + if (isOceanBlock(p_151541_5_, j3, k2, i3, l2, p_151541_3_, p_151541_4_)) + { + flag3 = true; + } + + if (i3 != j4 - 1 && k2 != i4 && k2 != l1 - 1 && l2 != k4 && l2 != j2 - 1) + { + i3 = j4; + } + } + } + } + } + + if (!flag3) + { + for (k2 = i4; k2 < l1; ++k2) + { + double d13 = ((double)(k2 + p_151541_3_ * 16) + 0.5D - p_151541_6_) / d6; + + for (j3 = k4; j3 < j2; ++j3) + { + double d14 = ((double)(j3 + p_151541_4_ * 16) + 0.5D - p_151541_10_) / d6; + int k3 = (k2 * 16 + j3) * 256 + i2; + boolean flag1 = false; + + if (d13 * d13 + d14 * d14 < 1.0D) + { + for (int l3 = i2 - 1; l3 >= j4; --l3) + { + double d12 = ((double)l3 + 0.5D - p_151541_8_) / d7; + + if (d12 > -0.7D && d13 * d13 + d12 * d12 + d14 * d14 < 1.0D) + { + Block block1 = p_151541_5_[k3]; + + if (isTopBlock(p_151541_5_, k3, k2, l3, j3, p_151541_3_, p_151541_4_)) + { + flag1 = true; + } + digBlock(p_151541_5_, k3, k2, l3, j3, p_151541_3_, p_151541_4_, flag1); + } + + --k3; + } + } + } + } + + if (flag2) + { + break; + } + } + } + } + } + } + + protected void func_151538_a(World worldIn, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) + { + int i1 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(15) + 1) + 1); + + if (this.rand.nextInt(7) != 0) + { + i1 = 0; + } + + for (int j1 = 0; j1 < i1; ++j1) + { + double d0 = (double)(p_151538_2_ * 16 + this.rand.nextInt(16)); + double d1 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8); + double d2 = (double)(p_151538_3_ * 16 + this.rand.nextInt(16)); + int k1 = 1; + + if (this.rand.nextInt(4) == 0) + { + this.func_151542_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, d0, d1, d2); + k1 += this.rand.nextInt(4); + } + + for (int l1 = 0; l1 < k1; ++l1) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + + if (this.rand.nextInt(10) == 0) + { + f2 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + + this.func_151541_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, d0, d1, d2, f2, f, f1, 0, 0, 1.0D); + } + } + } + + protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { + return data[index] == Blocks.flowing_water || data[index] == Blocks.water; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(BiomeGenBase biome) + { + if (biome == BiomeGenBase.mushroomIsland) return true; + if (biome == BiomeGenBase.beach) return true; + if (biome == BiomeGenBase.desert) return true; + return false; + } + + //Determine if the block at the specified location is the top block for the biome, we take into account + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { + BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); + return (isExceptionBiome(biome) ? data[index] == Blocks.grass : data[index] == biome.topBlock); + } + + /** + * Digs out the current block, default implementation removes stone, filler, and top block + * Sets the block to lava if y is less then 10, and air other wise. + * If setting to air, it also checks to see if we've broken the surface and if so + * tries to make the floor the biome's top block + * + * @param data Block data array + * @param index Pre-calculated index into block data + * @param x local X position + * @param y local Y position + * @param z local Z position + * @param chunkX Chunk X position + * @param chunkZ Chunk Y position + * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. + */ + protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { + BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); + Block top = (isExceptionBiome(biome) ? Blocks.grass : biome.topBlock); + Block filler = (isExceptionBiome(biome) ? Blocks.dirt : biome.fillerBlock); + Block block = data[index]; + + if (block == Blocks.stone || block == filler || block == top) + { + if (y < 10) + { + data[index] = Blocks.lava; + } + else + { + data[index] = null; + + if (foundTop && data[index - 1] == filler) + { + data[index - 1] = top; + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCavesHell.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCavesHell.java new file mode 100644 index 0000000..2a0d685 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenCavesHell.java @@ -0,0 +1,227 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class MapGenCavesHell extends MapGenBase +{ + private static final String __OBFID = "CL_00000395"; + + protected void func_151544_a(long p_151544_1_, int p_151544_3_, int p_151544_4_, Block[] p_151544_5_, double p_151544_6_, double p_151544_8_, double p_151544_10_) + { + this.func_151543_a(p_151544_1_, p_151544_3_, p_151544_4_, p_151544_5_, p_151544_6_, p_151544_8_, p_151544_10_, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void func_151543_a(long p_151543_1_, int p_151543_3_, int p_151543_4_, Block[] p_151543_5_, double p_151543_6_, double p_151543_8_, double p_151543_10_, float p_151543_12_, float p_151543_13_, float p_151543_14_, int p_151543_15_, int p_151543_16_, double p_151543_17_) + { + double d4 = (double)(p_151543_3_ * 16 + 8); + double d5 = (double)(p_151543_4_ * 16 + 8); + float f3 = 0.0F; + float f4 = 0.0F; + Random random = new Random(p_151543_1_); + + if (p_151543_16_ <= 0) + { + int j1 = this.range * 16 - 16; + p_151543_16_ = j1 - random.nextInt(j1 / 4); + } + + boolean flag1 = false; + + if (p_151543_15_ == -1) + { + p_151543_15_ = p_151543_16_ / 2; + flag1 = true; + } + + int k1 = random.nextInt(p_151543_16_ / 2) + p_151543_16_ / 4; + + for (boolean flag = random.nextInt(6) == 0; p_151543_15_ < p_151543_16_; ++p_151543_15_) + { + double d6 = 1.5D + (double)(MathHelper.sin((float)p_151543_15_ * (float)Math.PI / (float)p_151543_16_) * p_151543_12_ * 1.0F); + double d7 = d6 * p_151543_17_; + float f5 = MathHelper.cos(p_151543_14_); + float f6 = MathHelper.sin(p_151543_14_); + p_151543_6_ += (double)(MathHelper.cos(p_151543_13_) * f5); + p_151543_8_ += (double)f6; + p_151543_10_ += (double)(MathHelper.sin(p_151543_13_) * f5); + + if (flag) + { + p_151543_14_ *= 0.92F; + } + else + { + p_151543_14_ *= 0.7F; + } + + p_151543_14_ += f4 * 0.1F; + p_151543_13_ += f3 * 0.1F; + f4 *= 0.9F; + f3 *= 0.75F; + f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (!flag1 && p_151543_15_ == k1 && p_151543_12_ > 1.0F) + { + this.func_151543_a(random.nextLong(), p_151543_3_, p_151543_4_, p_151543_5_, p_151543_6_, p_151543_8_, p_151543_10_, random.nextFloat() * 0.5F + 0.5F, p_151543_13_ - ((float)Math.PI / 2F), p_151543_14_ / 3.0F, p_151543_15_, p_151543_16_, 1.0D); + this.func_151543_a(random.nextLong(), p_151543_3_, p_151543_4_, p_151543_5_, p_151543_6_, p_151543_8_, p_151543_10_, random.nextFloat() * 0.5F + 0.5F, p_151543_13_ + ((float)Math.PI / 2F), p_151543_14_ / 3.0F, p_151543_15_, p_151543_16_, 1.0D); + return; + } + + if (flag1 || random.nextInt(4) != 0) + { + double d8 = p_151543_6_ - d4; + double d9 = p_151543_10_ - d5; + double d10 = (double)(p_151543_16_ - p_151543_15_); + double d11 = (double)(p_151543_12_ + 2.0F + 16.0F); + + if (d8 * d8 + d9 * d9 - d10 * d10 > d11 * d11) + { + return; + } + + if (p_151543_6_ >= d4 - 16.0D - d6 * 2.0D && p_151543_10_ >= d5 - 16.0D - d6 * 2.0D && p_151543_6_ <= d4 + 16.0D + d6 * 2.0D && p_151543_10_ <= d5 + 16.0D + d6 * 2.0D) + { + int i4 = MathHelper.floor_double(p_151543_6_ - d6) - p_151543_3_ * 16 - 1; + int l1 = MathHelper.floor_double(p_151543_6_ + d6) - p_151543_3_ * 16 + 1; + int j4 = MathHelper.floor_double(p_151543_8_ - d7) - 1; + int i2 = MathHelper.floor_double(p_151543_8_ + d7) + 1; + int k4 = MathHelper.floor_double(p_151543_10_ - d6) - p_151543_4_ * 16 - 1; + int j2 = MathHelper.floor_double(p_151543_10_ + d6) - p_151543_4_ * 16 + 1; + + if (i4 < 0) + { + i4 = 0; + } + + if (l1 > 16) + { + l1 = 16; + } + + if (j4 < 1) + { + j4 = 1; + } + + if (i2 > 120) + { + i2 = 120; + } + + if (k4 < 0) + { + k4 = 0; + } + + if (j2 > 16) + { + j2 = 16; + } + + boolean flag2 = false; + int k2; + int j3; + + for (k2 = i4; !flag2 && k2 < l1; ++k2) + { + for (int l2 = k4; !flag2 && l2 < j2; ++l2) + { + for (int i3 = i2 + 1; !flag2 && i3 >= j4 - 1; --i3) + { + j3 = (k2 * 16 + l2) * 128 + i3; + + if (i3 >= 0 && i3 < 128) + { + Block block = p_151543_5_[j3]; + + if (block == Blocks.flowing_lava || block == Blocks.lava) + { + flag2 = true; + } + + if (i3 != j4 - 1 && k2 != i4 && k2 != l1 - 1 && l2 != k4 && l2 != j2 - 1) + { + i3 = j4; + } + } + } + } + } + + if (!flag2) + { + for (k2 = i4; k2 < l1; ++k2) + { + double d13 = ((double)(k2 + p_151543_3_ * 16) + 0.5D - p_151543_6_) / d6; + + for (j3 = k4; j3 < j2; ++j3) + { + double d14 = ((double)(j3 + p_151543_4_ * 16) + 0.5D - p_151543_10_) / d6; + int k3 = (k2 * 16 + j3) * 128 + i2; + + for (int l3 = i2 - 1; l3 >= j4; --l3) + { + double d12 = ((double)l3 + 0.5D - p_151543_8_) / d7; + + if (d12 > -0.7D && d13 * d13 + d12 * d12 + d14 * d14 < 1.0D) + { + Block block1 = p_151543_5_[k3]; + + if (block1 == Blocks.netherrack || block1 == Blocks.dirt || block1 == Blocks.grass) + { + p_151543_5_[k3] = null; + } + } + + --k3; + } + } + } + + if (flag1) + { + break; + } + } + } + } + } + } + + protected void func_151538_a(World worldIn, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) + { + int i1 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); + + if (this.rand.nextInt(5) != 0) + { + i1 = 0; + } + + for (int j1 = 0; j1 < i1; ++j1) + { + double d0 = (double)(p_151538_2_ * 16 + this.rand.nextInt(16)); + double d1 = (double)this.rand.nextInt(128); + double d2 = (double)(p_151538_3_ * 16 + this.rand.nextInt(16)); + int k1 = 1; + + if (this.rand.nextInt(4) == 0) + { + this.func_151544_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, d0, d1, d2); + k1 += this.rand.nextInt(4); + } + + for (int l1 = 0; l1 < k1; ++l1) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + this.func_151543_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, d0, d1, d2, f2 * 2.0F, f, f1, 0, 0, 0.5D); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenRavine.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenRavine.java new file mode 100644 index 0000000..a14a130 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/MapGenRavine.java @@ -0,0 +1,275 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenRavine extends MapGenBase +{ + private float[] field_75046_d = new float[1024]; + private static final String __OBFID = "CL_00000390"; + + protected void func_151540_a(long p_151540_1_, int p_151540_3_, int p_151540_4_, Block[] p_151540_5_, double p_151540_6_, double p_151540_8_, double p_151540_10_, float p_151540_12_, float p_151540_13_, float p_151540_14_, int p_151540_15_, int p_151540_16_, double p_151540_17_) + { + Random random = new Random(p_151540_1_); + double d4 = (double)(p_151540_3_ * 16 + 8); + double d5 = (double)(p_151540_4_ * 16 + 8); + float f3 = 0.0F; + float f4 = 0.0F; + + if (p_151540_16_ <= 0) + { + int j1 = this.range * 16 - 16; + p_151540_16_ = j1 - random.nextInt(j1 / 4); + } + + boolean flag1 = false; + + if (p_151540_15_ == -1) + { + p_151540_15_ = p_151540_16_ / 2; + flag1 = true; + } + + float f5 = 1.0F; + + for (int k1 = 0; k1 < 256; ++k1) + { + if (k1 == 0 || random.nextInt(3) == 0) + { + f5 = 1.0F + random.nextFloat() * random.nextFloat() * 1.0F; + } + + this.field_75046_d[k1] = f5 * f5; + } + + for (; p_151540_15_ < p_151540_16_; ++p_151540_15_) + { + double d12 = 1.5D + (double)(MathHelper.sin((float)p_151540_15_ * (float)Math.PI / (float)p_151540_16_) * p_151540_12_ * 1.0F); + double d6 = d12 * p_151540_17_; + d12 *= (double)random.nextFloat() * 0.25D + 0.75D; + d6 *= (double)random.nextFloat() * 0.25D + 0.75D; + float f6 = MathHelper.cos(p_151540_14_); + float f7 = MathHelper.sin(p_151540_14_); + p_151540_6_ += (double)(MathHelper.cos(p_151540_13_) * f6); + p_151540_8_ += (double)f7; + p_151540_10_ += (double)(MathHelper.sin(p_151540_13_) * f6); + p_151540_14_ *= 0.7F; + p_151540_14_ += f4 * 0.05F; + p_151540_13_ += f3 * 0.05F; + f4 *= 0.8F; + f3 *= 0.5F; + f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (flag1 || random.nextInt(4) != 0) + { + double d7 = p_151540_6_ - d4; + double d8 = p_151540_10_ - d5; + double d9 = (double)(p_151540_16_ - p_151540_15_); + double d10 = (double)(p_151540_12_ + 2.0F + 16.0F); + + if (d7 * d7 + d8 * d8 - d9 * d9 > d10 * d10) + { + return; + } + + if (p_151540_6_ >= d4 - 16.0D - d12 * 2.0D && p_151540_10_ >= d5 - 16.0D - d12 * 2.0D && p_151540_6_ <= d4 + 16.0D + d12 * 2.0D && p_151540_10_ <= d5 + 16.0D + d12 * 2.0D) + { + int i4 = MathHelper.floor_double(p_151540_6_ - d12) - p_151540_3_ * 16 - 1; + int l1 = MathHelper.floor_double(p_151540_6_ + d12) - p_151540_3_ * 16 + 1; + int j4 = MathHelper.floor_double(p_151540_8_ - d6) - 1; + int i2 = MathHelper.floor_double(p_151540_8_ + d6) + 1; + int k4 = MathHelper.floor_double(p_151540_10_ - d12) - p_151540_4_ * 16 - 1; + int j2 = MathHelper.floor_double(p_151540_10_ + d12) - p_151540_4_ * 16 + 1; + + if (i4 < 0) + { + i4 = 0; + } + + if (l1 > 16) + { + l1 = 16; + } + + if (j4 < 1) + { + j4 = 1; + } + + if (i2 > 248) + { + i2 = 248; + } + + if (k4 < 0) + { + k4 = 0; + } + + if (j2 > 16) + { + j2 = 16; + } + + boolean flag2 = false; + int k2; + int j3; + + for (k2 = i4; !flag2 && k2 < l1; ++k2) + { + for (int l2 = k4; !flag2 && l2 < j2; ++l2) + { + for (int i3 = i2 + 1; !flag2 && i3 >= j4 - 1; --i3) + { + j3 = (k2 * 16 + l2) * 256 + i3; + + if (i3 >= 0 && i3 < 256) + { + Block block = p_151540_5_[j3]; + + if (isOceanBlock(p_151540_5_, j3, k2, i3, l2, p_151540_3_, p_151540_4_)) + { + flag2 = true; + } + + if (i3 != j4 - 1 && k2 != i4 && k2 != l1 - 1 && l2 != k4 && l2 != j2 - 1) + { + i3 = j4; + } + } + } + } + } + + if (!flag2) + { + for (k2 = i4; k2 < l1; ++k2) + { + double d13 = ((double)(k2 + p_151540_3_ * 16) + 0.5D - p_151540_6_) / d12; + + for (j3 = k4; j3 < j2; ++j3) + { + double d14 = ((double)(j3 + p_151540_4_ * 16) + 0.5D - p_151540_10_) / d12; + int k3 = (k2 * 16 + j3) * 256 + i2; + boolean flag = false; + + if (d13 * d13 + d14 * d14 < 1.0D) + { + for (int l3 = i2 - 1; l3 >= j4; --l3) + { + double d11 = ((double)l3 + 0.5D - p_151540_8_) / d6; + + if ((d13 * d13 + d14 * d14) * (double)this.field_75046_d[l3] + d11 * d11 / 6.0D < 1.0D) + { + Block block1 = p_151540_5_[k3]; + + if (isTopBlock(p_151540_5_, k3, k2, l3, j3, p_151540_3_, p_151540_4_)) + { + flag = true; + } + + digBlock(p_151540_5_, k3, k2, l3, j3, p_151540_3_, p_151540_4_, flag); + } + + --k3; + } + } + } + } + + if (flag1) + { + break; + } + } + } + } + } + } + + protected void func_151538_a(World worldIn, int p_151538_2_, int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) + { + if (this.rand.nextInt(50) == 0) + { + double d0 = (double)(p_151538_2_ * 16 + this.rand.nextInt(16)); + double d1 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); + double d2 = (double)(p_151538_3_ * 16 + this.rand.nextInt(16)); + byte b0 = 1; + + for (int i1 = 0; i1 < b0; ++i1) + { + float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; + this.func_151540_a(this.rand.nextLong(), p_151538_4_, p_151538_5_, p_151538_6_, d0, d1, d2, f2, f, f1, 0, 0, 3.0D); + } + } + } + + protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { + return data[index] == Blocks.water || data[index] == Blocks.flowing_water; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(BiomeGenBase biome) + { + if (biome == BiomeGenBase.mushroomIsland) return true; + if (biome == BiomeGenBase.beach) return true; + if (biome == BiomeGenBase.desert) return true; + return false; + } + + //Determine if the block at the specified location is the top block for the biome, we take into account + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) + { + BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); + return (isExceptionBiome(biome) ? data[index] == Blocks.grass : data[index] == biome.topBlock); + } + + /** + * Digs out the current block, default implementation removes stone, filler, and top block + * Sets the block to lava if y is less then 10, and air other wise. + * If setting to air, it also checks to see if we've broken the surface and if so + * tries to make the floor the biome's top block + * + * @param data Block data array + * @param index Pre-calculated index into block data + * @param x local X position + * @param y local Y position + * @param z local Z position + * @param chunkX Chunk X position + * @param chunkZ Chunk Y position + * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. + */ + protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { + BiomeGenBase biome = worldObj.getBiomeGenForCoords(x + chunkX * 16, z + chunkZ * 16); + Block top = (isExceptionBiome(biome) ? Blocks.grass : biome.topBlock); + Block filler = (isExceptionBiome(biome) ? Blocks.dirt : biome.fillerBlock); + Block block = data[index]; + + if (block == Blocks.stone || block == filler || block == top) + { + if (y < 10) + { + data[index] = Blocks.flowing_lava; + } + else + { + data[index] = null; + + if (foundTop && data[index - 1] == filler) + { + data[index - 1] = top; + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGenerator.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGenerator.java new file mode 100644 index 0000000..cbb096c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGenerator.java @@ -0,0 +1,6 @@ +package net.minecraft.world.gen; + +public abstract class NoiseGenerator +{ + private static final String __OBFID = "CL_00000538"; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorImproved.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorImproved.java new file mode 100644 index 0000000..4f1b98f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorImproved.java @@ -0,0 +1,214 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorImproved extends NoiseGenerator +{ + private int[] permutations; + public double xCoord; + public double yCoord; + public double zCoord; + private static final double[] field_152381_e = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152382_f = new double[] {1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D}; + private static final double[] field_152383_g = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + private static final double[] field_152384_h = new double[] {1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 0.0D, -1.0D, 0.0D}; + private static final double[] field_152385_i = new double[] {0.0D, 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, -1.0D, -1.0D, 1.0D, 1.0D, -1.0D, -1.0D, 0.0D, 1.0D, 0.0D, -1.0D}; + private static final String __OBFID = "CL_00000534"; + + public NoiseGeneratorImproved() + { + this(new Random()); + } + + public NoiseGeneratorImproved(Random p_i45469_1_) + { + this.permutations = new int[512]; + this.xCoord = p_i45469_1_.nextDouble() * 256.0D; + this.yCoord = p_i45469_1_.nextDouble() * 256.0D; + this.zCoord = p_i45469_1_.nextDouble() * 256.0D; + int i; + + for (i = 0; i < 256; this.permutations[i] = i++) + { + ; + } + + for (i = 0; i < 256; ++i) + { + int j = p_i45469_1_.nextInt(256 - i) + i; + int k = this.permutations[i]; + this.permutations[i] = this.permutations[j]; + this.permutations[j] = k; + this.permutations[i + 256] = this.permutations[i]; + } + } + + public final double lerp(double p_76311_1_, double p_76311_3_, double p_76311_5_) + { + return p_76311_3_ + p_76311_1_ * (p_76311_5_ - p_76311_3_); + } + + public final double func_76309_a(int p_76309_1_, double p_76309_2_, double p_76309_4_) + { + int j = p_76309_1_ & 15; + return field_152384_h[j] * p_76309_2_ + field_152385_i[j] * p_76309_4_; + } + + public final double grad(int p_76310_1_, double p_76310_2_, double p_76310_4_, double p_76310_6_) + { + int j = p_76310_1_ & 15; + return field_152381_e[j] * p_76310_2_ + field_152382_f[j] * p_76310_4_ + field_152383_g[j] * p_76310_6_; + } + + /** + * pars: noiseArray , xOffset , yOffset , zOffset , xSize , ySize , zSize , xScale, yScale , zScale , noiseScale. + * noiseArray should be xSize*ySize*zSize in size + */ + public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) + { + int l; + int i1; + double d9; + double d11; + int l1; + double d12; + int i2; + int j2; + double d13; + int k5; + int j6; + + if (p_76308_9_ == 1) + { + boolean flag7 = false; + boolean flag8 = false; + boolean flag = false; + boolean flag9 = false; + double d21 = 0.0D; + double d22 = 0.0D; + k5 = 0; + double d23 = 1.0D / p_76308_17_; + + for (int j1 = 0; j1 < p_76308_8_; ++j1) + { + d9 = p_76308_2_ + (double)j1 * p_76308_11_ + this.xCoord; + int i6 = (int)d9; + + if (d9 < (double)i6) + { + --i6; + } + + int k1 = i6 & 255; + d9 -= (double)i6; + d11 = d9 * d9 * d9 * (d9 * (d9 * 6.0D - 15.0D) + 10.0D); + + for (l1 = 0; l1 < p_76308_10_; ++l1) + { + d12 = p_76308_6_ + (double)l1 * p_76308_15_ + this.zCoord; + i2 = (int)d12; + + if (d12 < (double)i2) + { + --i2; + } + + j2 = i2 & 255; + d12 -= (double)i2; + d13 = d12 * d12 * d12 * (d12 * (d12 * 6.0D - 15.0D) + 10.0D); + l = this.permutations[k1] + 0; + int i4 = this.permutations[l] + j2; + int j4 = this.permutations[k1 + 1] + 0; + i1 = this.permutations[j4] + j2; + d21 = this.lerp(d11, this.func_76309_a(this.permutations[i4], d9, d12), this.grad(this.permutations[i1], d9 - 1.0D, 0.0D, d12)); + d22 = this.lerp(d11, this.grad(this.permutations[i4 + 1], d9, 0.0D, d12 - 1.0D), this.grad(this.permutations[i1 + 1], d9 - 1.0D, 0.0D, d12 - 1.0D)); + double d24 = this.lerp(d13, d21, d22); + j6 = k5++; + p_76308_1_[j6] += d24 * d23; + } + } + } + else + { + l = 0; + double d7 = 1.0D / p_76308_17_; + i1 = -1; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + boolean flag4 = false; + boolean flag5 = false; + boolean flag6 = false; + double d8 = 0.0D; + d9 = 0.0D; + double d10 = 0.0D; + d11 = 0.0D; + + for (l1 = 0; l1 < p_76308_8_; ++l1) + { + d12 = p_76308_2_ + (double)l1 * p_76308_11_ + this.xCoord; + i2 = (int)d12; + + if (d12 < (double)i2) + { + --i2; + } + + j2 = i2 & 255; + d12 -= (double)i2; + d13 = d12 * d12 * d12 * (d12 * (d12 * 6.0D - 15.0D) + 10.0D); + + for (int k2 = 0; k2 < p_76308_10_; ++k2) + { + double d14 = p_76308_6_ + (double)k2 * p_76308_15_ + this.zCoord; + int l2 = (int)d14; + + if (d14 < (double)l2) + { + --l2; + } + + int i3 = l2 & 255; + d14 -= (double)l2; + double d15 = d14 * d14 * d14 * (d14 * (d14 * 6.0D - 15.0D) + 10.0D); + + for (int j3 = 0; j3 < p_76308_9_; ++j3) + { + double d16 = p_76308_4_ + (double)j3 * p_76308_13_ + this.yCoord; + int k3 = (int)d16; + + if (d16 < (double)k3) + { + --k3; + } + + int l3 = k3 & 255; + d16 -= (double)k3; + double d17 = d16 * d16 * d16 * (d16 * (d16 * 6.0D - 15.0D) + 10.0D); + + if (j3 == 0 || l3 != i1) + { + i1 = l3; + int k4 = this.permutations[j2] + l3; + int l4 = this.permutations[k4] + i3; + int i5 = this.permutations[k4 + 1] + i3; + int j5 = this.permutations[j2 + 1] + l3; + k5 = this.permutations[j5] + i3; + int l5 = this.permutations[j5 + 1] + i3; + d8 = this.lerp(d13, this.grad(this.permutations[l4], d12, d16, d14), this.grad(this.permutations[k5], d12 - 1.0D, d16, d14)); + d9 = this.lerp(d13, this.grad(this.permutations[i5], d12, d16 - 1.0D, d14), this.grad(this.permutations[l5], d12 - 1.0D, d16 - 1.0D, d14)); + d10 = this.lerp(d13, this.grad(this.permutations[l4 + 1], d12, d16, d14 - 1.0D), this.grad(this.permutations[k5 + 1], d12 - 1.0D, d16, d14 - 1.0D)); + d11 = this.lerp(d13, this.grad(this.permutations[i5 + 1], d12, d16 - 1.0D, d14 - 1.0D), this.grad(this.permutations[l5 + 1], d12 - 1.0D, d16 - 1.0D, d14 - 1.0D)); + } + + double d18 = this.lerp(d17, d8, d9); + double d19 = this.lerp(d17, d10, d11); + double d20 = this.lerp(d15, d18, d19); + j6 = l++; + p_76308_1_[j6] += d20 * d7; + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java new file mode 100644 index 0000000..b4e4611 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorOctaves.java @@ -0,0 +1,71 @@ +package net.minecraft.world.gen; + +import java.util.Random; +import net.minecraft.util.MathHelper; + +public class NoiseGeneratorOctaves extends NoiseGenerator +{ + /** Collection of noise generation functions. Output is combined to produce different octaves of noise. */ + private NoiseGeneratorImproved[] generatorCollection; + private int octaves; + private static final String __OBFID = "CL_00000535"; + + public NoiseGeneratorOctaves(Random p_i2111_1_, int p_i2111_2_) + { + this.octaves = p_i2111_2_; + this.generatorCollection = new NoiseGeneratorImproved[p_i2111_2_]; + + for (int j = 0; j < p_i2111_2_; ++j) + { + this.generatorCollection[j] = new NoiseGeneratorImproved(p_i2111_1_); + } + } + + /** + * pars:(par2,3,4=noiseOffset ; so that adjacent noise segments connect) (pars5,6,7=x,y,zArraySize),(pars8,10,12 = + * x,y,z noiseScale) + */ + public double[] generateNoiseOctaves(double[] p_76304_1_, int p_76304_2_, int p_76304_3_, int p_76304_4_, int p_76304_5_, int p_76304_6_, int p_76304_7_, double p_76304_8_, double p_76304_10_, double p_76304_12_) + { + if (p_76304_1_ == null) + { + p_76304_1_ = new double[p_76304_5_ * p_76304_6_ * p_76304_7_]; + } + else + { + for (int k1 = 0; k1 < p_76304_1_.length; ++k1) + { + p_76304_1_[k1] = 0.0D; + } + } + + double d6 = 1.0D; + + for (int l1 = 0; l1 < this.octaves; ++l1) + { + double d3 = (double)p_76304_2_ * d6 * p_76304_8_; + double d4 = (double)p_76304_3_ * d6 * p_76304_10_; + double d5 = (double)p_76304_4_ * d6 * p_76304_12_; + long i2 = MathHelper.floor_double_long(d3); + long j2 = MathHelper.floor_double_long(d5); + d3 -= (double)i2; + d5 -= (double)j2; + i2 %= 16777216L; + j2 %= 16777216L; + d3 += (double)i2; + d5 += (double)j2; + this.generatorCollection[l1].populateNoiseArray(p_76304_1_, d3, d4, d5, p_76304_5_, p_76304_6_, p_76304_7_, p_76304_8_ * d6, p_76304_10_ * d6, p_76304_12_ * d6, d6); + d6 /= 2.0D; + } + + return p_76304_1_; + } + + /** + * Bouncer function to the main one with some default arguments. + */ + public double[] generateNoiseOctaves(double[] p_76305_1_, int p_76305_2_, int p_76305_3_, int p_76305_4_, int p_76305_5_, double p_76305_6_, double p_76305_8_, double p_76305_10_) + { + return this.generateNoiseOctaves(p_76305_1_, p_76305_2_, 10, p_76305_3_, p_76305_4_, 1, p_76305_5_, p_76305_6_, 1.0D, p_76305_8_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java new file mode 100644 index 0000000..c697881 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorPerlin.java @@ -0,0 +1,67 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorPerlin extends NoiseGenerator +{ + private NoiseGeneratorSimplex[] field_151603_a; + private int field_151602_b; + private static final String __OBFID = "CL_00000536"; + + public NoiseGeneratorPerlin(Random p_i45470_1_, int p_i45470_2_) + { + this.field_151602_b = p_i45470_2_; + this.field_151603_a = new NoiseGeneratorSimplex[p_i45470_2_]; + + for (int j = 0; j < p_i45470_2_; ++j) + { + this.field_151603_a[j] = new NoiseGeneratorSimplex(p_i45470_1_); + } + } + + public double func_151601_a(double p_151601_1_, double p_151601_3_) + { + double d2 = 0.0D; + double d3 = 1.0D; + + for (int i = 0; i < this.field_151602_b; ++i) + { + d2 += this.field_151603_a[i].func_151605_a(p_151601_1_ * d3, p_151601_3_ * d3) / d3; + d3 /= 2.0D; + } + + return d2; + } + + public double[] func_151599_a(double[] p_151599_1_, double p_151599_2_, double p_151599_4_, int p_151599_6_, int p_151599_7_, double p_151599_8_, double p_151599_10_, double p_151599_12_) + { + return this.func_151600_a(p_151599_1_, p_151599_2_, p_151599_4_, p_151599_6_, p_151599_7_, p_151599_8_, p_151599_10_, p_151599_12_, 0.5D); + } + + public double[] func_151600_a(double[] p_151600_1_, double p_151600_2_, double p_151600_4_, int p_151600_6_, int p_151600_7_, double p_151600_8_, double p_151600_10_, double p_151600_12_, double p_151600_14_) + { + if (p_151600_1_ != null && p_151600_1_.length >= p_151600_6_ * p_151600_7_) + { + for (int k = 0; k < p_151600_1_.length; ++k) + { + p_151600_1_[k] = 0.0D; + } + } + else + { + p_151600_1_ = new double[p_151600_6_ * p_151600_7_]; + } + + double d7 = 1.0D; + double d6 = 1.0D; + + for (int l = 0; l < this.field_151602_b; ++l) + { + this.field_151603_a[l].func_151606_a(p_151600_1_, p_151600_2_, p_151600_4_, p_151600_6_, p_151600_7_, p_151600_8_ * d6 * d7, p_151600_10_ * d6 * d7, 0.55D / d7); + d6 *= p_151600_12_; + d7 *= p_151600_14_; + } + + return p_151600_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java new file mode 100644 index 0000000..cafca4d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/NoiseGeneratorSimplex.java @@ -0,0 +1,218 @@ +package net.minecraft.world.gen; + +import java.util.Random; + +public class NoiseGeneratorSimplex +{ + private static int[][] field_151611_e = new int[][] {{1, 1, 0}, { -1, 1, 0}, {1, -1, 0}, { -1, -1, 0}, {1, 0, 1}, { -1, 0, 1}, {1, 0, -1}, { -1, 0, -1}, {0, 1, 1}, {0, -1, 1}, {0, 1, -1}, {0, -1, -1}}; + public static final double field_151614_a = Math.sqrt(3.0D); + private int[] field_151608_f; + public double field_151612_b; + public double field_151613_c; + public double field_151610_d; + private static final double field_151609_g = 0.5D * (field_151614_a - 1.0D); + private static final double field_151615_h = (3.0D - field_151614_a) / 6.0D; + private static final String __OBFID = "CL_00000537"; + + public NoiseGeneratorSimplex() + { + this(new Random()); + } + + public NoiseGeneratorSimplex(Random p_i45471_1_) + { + this.field_151608_f = new int[512]; + this.field_151612_b = p_i45471_1_.nextDouble() * 256.0D; + this.field_151613_c = p_i45471_1_.nextDouble() * 256.0D; + this.field_151610_d = p_i45471_1_.nextDouble() * 256.0D; + int i; + + for (i = 0; i < 256; this.field_151608_f[i] = i++) + { + ; + } + + for (i = 0; i < 256; ++i) + { + int j = p_i45471_1_.nextInt(256 - i) + i; + int k = this.field_151608_f[i]; + this.field_151608_f[i] = this.field_151608_f[j]; + this.field_151608_f[j] = k; + this.field_151608_f[i + 256] = this.field_151608_f[i]; + } + } + + private static int func_151607_a(double p_151607_0_) + { + return p_151607_0_ > 0.0D ? (int)p_151607_0_ : (int)p_151607_0_ - 1; + } + + private static double func_151604_a(int[] p_151604_0_, double p_151604_1_, double p_151604_3_) + { + return (double)p_151604_0_[0] * p_151604_1_ + (double)p_151604_0_[1] * p_151604_3_; + } + + public double func_151605_a(double p_151605_1_, double p_151605_3_) + { + double d5 = 0.5D * (field_151614_a - 1.0D); + double d6 = (p_151605_1_ + p_151605_3_) * d5; + int i = func_151607_a(p_151605_1_ + d6); + int j = func_151607_a(p_151605_3_ + d6); + double d7 = (3.0D - field_151614_a) / 6.0D; + double d8 = (double)(i + j) * d7; + double d9 = (double)i - d8; + double d10 = (double)j - d8; + double d11 = p_151605_1_ - d9; + double d12 = p_151605_3_ - d10; + byte b0; + byte b1; + + if (d11 > d12) + { + b0 = 1; + b1 = 0; + } + else + { + b0 = 0; + b1 = 1; + } + + double d13 = d11 - (double)b0 + d7; + double d14 = d12 - (double)b1 + d7; + double d15 = d11 - 1.0D + 2.0D * d7; + double d16 = d12 - 1.0D + 2.0D * d7; + int k = i & 255; + int l = j & 255; + int i1 = this.field_151608_f[k + this.field_151608_f[l]] % 12; + int j1 = this.field_151608_f[k + b0 + this.field_151608_f[l + b1]] % 12; + int k1 = this.field_151608_f[k + 1 + this.field_151608_f[l + 1]] % 12; + double d17 = 0.5D - d11 * d11 - d12 * d12; + double d2; + + if (d17 < 0.0D) + { + d2 = 0.0D; + } + else + { + d17 *= d17; + d2 = d17 * d17 * func_151604_a(field_151611_e[i1], d11, d12); + } + + double d18 = 0.5D - d13 * d13 - d14 * d14; + double d3; + + if (d18 < 0.0D) + { + d3 = 0.0D; + } + else + { + d18 *= d18; + d3 = d18 * d18 * func_151604_a(field_151611_e[j1], d13, d14); + } + + double d19 = 0.5D - d15 * d15 - d16 * d16; + double d4; + + if (d19 < 0.0D) + { + d4 = 0.0D; + } + else + { + d19 *= d19; + d4 = d19 * d19 * func_151604_a(field_151611_e[k1], d15, d16); + } + + return 70.0D * (d2 + d3 + d4); + } + + public void func_151606_a(double[] p_151606_1_, double p_151606_2_, double p_151606_4_, int p_151606_6_, int p_151606_7_, double p_151606_8_, double p_151606_10_, double p_151606_12_) + { + int k = 0; + + for (int l = 0; l < p_151606_7_; ++l) + { + double d5 = (p_151606_4_ + (double)l) * p_151606_10_ + this.field_151613_c; + + for (int i1 = 0; i1 < p_151606_6_; ++i1) + { + double d6 = (p_151606_2_ + (double)i1) * p_151606_8_ + this.field_151612_b; + double d10 = (d6 + d5) * field_151609_g; + int j1 = func_151607_a(d6 + d10); + int k1 = func_151607_a(d5 + d10); + double d11 = (double)(j1 + k1) * field_151615_h; + double d12 = (double)j1 - d11; + double d13 = (double)k1 - d11; + double d14 = d6 - d12; + double d15 = d5 - d13; + byte b0; + byte b1; + + if (d14 > d15) + { + b0 = 1; + b1 = 0; + } + else + { + b0 = 0; + b1 = 1; + } + + double d16 = d14 - (double)b0 + field_151615_h; + double d17 = d15 - (double)b1 + field_151615_h; + double d18 = d14 - 1.0D + 2.0D * field_151615_h; + double d19 = d15 - 1.0D + 2.0D * field_151615_h; + int l1 = j1 & 255; + int i2 = k1 & 255; + int j2 = this.field_151608_f[l1 + this.field_151608_f[i2]] % 12; + int k2 = this.field_151608_f[l1 + b0 + this.field_151608_f[i2 + b1]] % 12; + int l2 = this.field_151608_f[l1 + 1 + this.field_151608_f[i2 + 1]] % 12; + double d20 = 0.5D - d14 * d14 - d15 * d15; + double d7; + + if (d20 < 0.0D) + { + d7 = 0.0D; + } + else + { + d20 *= d20; + d7 = d20 * d20 * func_151604_a(field_151611_e[j2], d14, d15); + } + + double d21 = 0.5D - d16 * d16 - d17 * d17; + double d8; + + if (d21 < 0.0D) + { + d8 = 0.0D; + } + else + { + d21 *= d21; + d8 = d21 * d21 * func_151604_a(field_151611_e[k2], d16, d17); + } + + double d22 = 0.5D - d18 * d18 - d19 * d19; + double d9; + + if (d22 < 0.0D) + { + d9 = 0.0D; + } + else + { + d22 *= d22; + d9 = d22 * d22 * func_151604_a(field_151611_e[l2], d18, d19); + } + + int i3 = k++; + p_151606_1_[i3] += 70.0D * (d7 + d8 + d9) * p_151606_12_; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java new file mode 100644 index 0000000..fee014e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenAbstractTree.java @@ -0,0 +1,30 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public abstract class WorldGenAbstractTree extends WorldGenerator +{ + private static final String __OBFID = "CL_00000399"; + + public WorldGenAbstractTree(boolean p_i45448_1_) + { + super(p_i45448_1_); + } + + protected boolean func_150523_a(Block p_150523_1_) + { + return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log || p_150523_1_ == Blocks.log2 || p_150523_1_ == Blocks.sapling || p_150523_1_ == Blocks.vine; + } + + public void func_150524_b(World p_150524_1_, Random p_150524_2_, int p_150524_3_, int p_150524_4_, int p_150524_5_) {} + + protected boolean isReplaceable(World world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + return block.isAir(world, x, y, z) || block.isLeaves(world, x, y, z) || block.isWood(world, x, y, z) || func_150523_a(block); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java new file mode 100644 index 0000000..21dfb1c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigMushroom.java @@ -0,0 +1,214 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenBigMushroom extends WorldGenerator +{ + /** The mushroom type. 0 for brown, 1 for red. */ + private int mushroomType = -1; + private static final String __OBFID = "CL_00000415"; + + public WorldGenBigMushroom(int p_i2017_1_) + { + super(true); + this.mushroomType = p_i2017_1_; + } + + public WorldGenBigMushroom() + { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(2); + + if (this.mushroomType >= 0) + { + l = this.mushroomType; + } + + int i1 = p_76484_2_.nextInt(3) + 4; + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + i1 + 1 < 256) + { + int k1; + int l1; + + for (int j1 = p_76484_4_; j1 <= p_76484_4_ + 1 + i1; ++j1) + { + byte b0 = 3; + + if (j1 <= p_76484_4_ + 3) + { + b0 = 0; + } + + for (k1 = p_76484_3_ - b0; k1 <= p_76484_3_ + b0 && flag; ++k1) + { + for (l1 = p_76484_5_ - b0; l1 <= p_76484_5_ + b0 && flag; ++l1) + { + if (j1 >= 0 && j1 < 256) + { + Block block = p_76484_1_.getBlock(k1, j1, l1); + + if (!block.isAir(p_76484_1_, k1, j1, l1) && !block.isLeaves(p_76484_1_, k1, j1, l1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if (block1 != Blocks.dirt && block1 != Blocks.grass && block1 != Blocks.mycelium) + { + return false; + } + else + { + int k2 = p_76484_4_ + i1; + + if (l == 1) + { + k2 = p_76484_4_ + i1 - 3; + } + + for (k1 = k2; k1 <= p_76484_4_ + i1; ++k1) + { + l1 = 1; + + if (k1 < p_76484_4_ + i1) + { + ++l1; + } + + if (l == 0) + { + l1 = 3; + } + + for (int l2 = p_76484_3_ - l1; l2 <= p_76484_3_ + l1; ++l2) + { + for (int i2 = p_76484_5_ - l1; i2 <= p_76484_5_ + l1; ++i2) + { + int j2 = 5; + + if (l2 == p_76484_3_ - l1) + { + --j2; + } + + if (l2 == p_76484_3_ + l1) + { + ++j2; + } + + if (i2 == p_76484_5_ - l1) + { + j2 -= 3; + } + + if (i2 == p_76484_5_ + l1) + { + j2 += 3; + } + + if (l == 0 || k1 < p_76484_4_ + i1) + { + if ((l2 == p_76484_3_ - l1 || l2 == p_76484_3_ + l1) && (i2 == p_76484_5_ - l1 || i2 == p_76484_5_ + l1)) + { + continue; + } + + if (l2 == p_76484_3_ - (l1 - 1) && i2 == p_76484_5_ - l1) + { + j2 = 1; + } + + if (l2 == p_76484_3_ - l1 && i2 == p_76484_5_ - (l1 - 1)) + { + j2 = 1; + } + + if (l2 == p_76484_3_ + (l1 - 1) && i2 == p_76484_5_ - l1) + { + j2 = 3; + } + + if (l2 == p_76484_3_ + l1 && i2 == p_76484_5_ - (l1 - 1)) + { + j2 = 3; + } + + if (l2 == p_76484_3_ - (l1 - 1) && i2 == p_76484_5_ + l1) + { + j2 = 7; + } + + if (l2 == p_76484_3_ - l1 && i2 == p_76484_5_ + (l1 - 1)) + { + j2 = 7; + } + + if (l2 == p_76484_3_ + (l1 - 1) && i2 == p_76484_5_ + l1) + { + j2 = 9; + } + + if (l2 == p_76484_3_ + l1 && i2 == p_76484_5_ + (l1 - 1)) + { + j2 = 9; + } + } + + if (j2 == 5 && k1 < p_76484_4_ + i1) + { + j2 = 0; + } + + if ((j2 != 0 || p_76484_4_ >= p_76484_4_ + i1 - 1) && p_76484_1_.getBlock(l2, k1, i2).canBeReplacedByLeaves(p_76484_1_, l2, k1, i2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, l2, k1, i2, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), j2); + } + } + } + } + + for (k1 = 0; k1 < i1; ++k1) + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k1, p_76484_5_); + + if (block2.canBeReplacedByLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Block.getBlockById(Block.getIdFromBlock(Blocks.brown_mushroom_block) + l), 10); + } + } + + return true; + } + } + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigTree.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigTree.java new file mode 100644 index 0000000..f56afb0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBigTree.java @@ -0,0 +1,505 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenBigTree extends WorldGenAbstractTree +{ + /** + * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 + * and 2 for 1, and 0 and 1 for 2. + */ + static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; + /** random seed for GenBigTree */ + Random rand = new Random(); + /** Reference to the World object. */ + World worldObj; + int[] basePos = new int[] {0, 0, 0}; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchDensity = 1.0D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + /** Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. */ + int trunkSize = 1; + /** Sets the limit of the random value used to initialize the height limit. */ + int heightLimitLimit = 12; + /** Sets the distance limit for how far away the generator will populate leaves from the base leaf node. */ + int leafDistanceLimit = 4; + /** Contains a list of a points at which to generate groups of leaves. */ + int[][] leafNodes; + private static final String __OBFID = "CL_00000400"; + + public WorldGenBigTree(boolean p_i2008_1_) + { + super(p_i2008_1_); + } + + /** + * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. + */ + void generateLeafNodeList() + { + this.height = (int)((double)this.heightLimit * this.heightAttenuation); + + if (this.height >= this.heightLimit) + { + this.height = this.heightLimit - 1; + } + + int i = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); + + if (i < 1) + { + i = 1; + } + + int[][] aint = new int[i * this.heightLimit][4]; + int j = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; + int k = 1; + int l = this.basePos[1] + this.height; + int i1 = j - this.basePos[1]; + aint[0][0] = this.basePos[0]; + aint[0][1] = j; + aint[0][2] = this.basePos[2]; + aint[0][3] = l; + --j; + + while (i1 >= 0) + { + int j1 = 0; + float f = this.layerSize(i1); + + if (f < 0.0F) + { + --j; + --i1; + } + else + { + for (double d0 = 0.5D; j1 < i; ++j1) + { + double d1 = this.scaleWidth * (double)f * ((double)this.rand.nextFloat() + 0.328D); + double d2 = (double)this.rand.nextFloat() * 2.0D * Math.PI; + int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double)this.basePos[0] + d0); + int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double)this.basePos[2] + d0); + int[] aint1 = new int[] {k1, j, l1}; + int[] aint2 = new int[] {k1, j + this.leafDistanceLimit, l1}; + + if (this.checkBlockLine(aint1, aint2) == -1) + { + int[] aint3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; + double d3 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - aint1[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - aint1[2]), 2.0D)); + double d4 = d3 * this.branchSlope; + + if ((double)aint1[1] - d4 > (double)l) + { + aint3[1] = l; + } + else + { + aint3[1] = (int)((double)aint1[1] - d4); + } + + if (this.checkBlockLine(aint3, aint1) == -1) + { + aint[k][0] = k1; + aint[k][1] = j; + aint[k][2] = l1; + aint[k][3] = aint3[1]; + ++k; + } + } + } + + --j; + --i1; + } + } + + this.leafNodes = new int[k][4]; + System.arraycopy(aint, 0, this.leafNodes, 0, k); + } + + void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_) + { + int l = (int)((double)p_150529_4_ + 0.618D); + byte b1 = otherCoordPairs[p_150529_5_]; + byte b2 = otherCoordPairs[p_150529_5_ + 3]; + int[] aint = new int[] {p_150529_1_, p_150529_2_, p_150529_3_}; + int[] aint1 = new int[] {0, 0, 0}; + int i1 = -l; + int j1 = -l; + + for (aint1[p_150529_5_] = aint[p_150529_5_]; i1 <= l; ++i1) + { + aint1[b1] = aint[b1] + i1; + j1 = -l; + + while (j1 <= l) + { + double d0 = Math.pow((double)Math.abs(i1) + 0.5D, 2.0D) + Math.pow((double)Math.abs(j1) + 0.5D, 2.0D); + + if (d0 > (double)(p_150529_4_ * p_150529_4_)) + { + ++j1; + } + else + { + aint1[b2] = aint[b2] + j1; + Block block1 = this.worldObj.getBlock(aint1[0], aint1[1], aint1[2]); + + if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2])) + { + ++j1; + } + else + { + this.setBlockAndNotifyAdequately(this.worldObj, aint1[0], aint1[1], aint1[2], p_150529_6_, 0); + ++j1; + } + } + } + } + } + + /** + * Gets the rough size of a layer of the tree. + */ + float layerSize(int p_76490_1_) + { + if ((double)p_76490_1_ < (double)((float)this.heightLimit) * 0.3D) + { + return -1.618F; + } + else + { + float f = (float)this.heightLimit / 2.0F; + float f1 = (float)this.heightLimit / 2.0F - (float)p_76490_1_; + float f2; + + if (f1 == 0.0F) + { + f2 = f; + } + else if (Math.abs(f1) >= f) + { + f2 = 0.0F; + } + else + { + f2 = (float)Math.sqrt(Math.pow((double)Math.abs(f), 2.0D) - Math.pow((double)Math.abs(f1), 2.0D)); + } + + f2 *= 0.5F; + return f2; + } + } + + float leafSize(int p_76495_1_) + { + return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + /** + * Generates the leaves surrounding an individual entry in the leafNodes list. + */ + void generateLeafNode(int p_76491_1_, int p_76491_2_, int p_76491_3_) + { + int l = p_76491_2_; + + for (int i1 = p_76491_2_ + this.leafDistanceLimit; l < i1; ++l) + { + float f = this.leafSize(l - p_76491_2_); + this.func_150529_a(p_76491_1_, l, p_76491_3_, f, (byte)1, Blocks.leaves); + } + } + + void func_150530_a(int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_) + { + int[] aint2 = new int[] {0, 0, 0}; + byte b0 = 0; + byte b1; + + for (b1 = 0; b0 < 3; ++b0) + { + aint2[b0] = p_150530_2_[b0] - p_150530_1_[b0]; + + if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) + { + b1 = b0; + } + } + + if (aint2[b1] != 0) + { + byte b2 = otherCoordPairs[b1]; + byte b3 = otherCoordPairs[b1 + 3]; + byte b4; + + if (aint2[b1] > 0) + { + b4 = 1; + } + else + { + b4 = -1; + } + + double d0 = (double)aint2[b2] / (double)aint2[b1]; + double d1 = (double)aint2[b3] / (double)aint2[b1]; + int[] aint3 = new int[] {0, 0, 0}; + int i = 0; + + for (int j = aint2[b1] + b4; i != j; i += b4) + { + aint3[b1] = MathHelper.floor_double((double)(p_150530_1_[b1] + i) + 0.5D); + aint3[b2] = MathHelper.floor_double((double)p_150530_1_[b2] + (double)i * d0 + 0.5D); + aint3[b3] = MathHelper.floor_double((double)p_150530_1_[b3] + (double)i * d1 + 0.5D); + byte b5 = 0; + int k = Math.abs(aint3[0] - p_150530_1_[0]); + int l = Math.abs(aint3[2] - p_150530_1_[2]); + int i1 = Math.max(k, l); + + if (i1 > 0) + { + if (k == i1) + { + b5 = 4; + } + else if (l == i1) + { + b5 = 8; + } + } + + this.setBlockAndNotifyAdequately(this.worldObj, aint3[0], aint3[1], aint3[2], p_150530_3_, b5); + } + } + } + + /** + * Generates the leaf portion of the tree as specified by the leafNodes list. + */ + void generateLeaves() + { + int i = 0; + + for (int j = this.leafNodes.length; i < j; ++i) + { + int k = this.leafNodes[i][0]; + int l = this.leafNodes[i][1]; + int i1 = this.leafNodes[i][2]; + this.generateLeafNode(k, l, i1); + } + } + + /** + * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int p_76493_1_) + { + return (double)p_76493_1_ >= (double)this.heightLimit * 0.2D; + } + + /** + * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a + * field that is always 1 to 2. + */ + void generateTrunk() + { + int i = this.basePos[0]; + int j = this.basePos[1]; + int k = this.basePos[1] + this.height; + int l = this.basePos[2]; + int[] aint = new int[] {i, j, l}; + int[] aint1 = new int[] {i, k, l}; + this.func_150530_a(aint, aint1, Blocks.log); + + if (this.trunkSize == 2) + { + ++aint[0]; + ++aint1[0]; + this.func_150530_a(aint, aint1, Blocks.log); + ++aint[2]; + ++aint1[2]; + this.func_150530_a(aint, aint1, Blocks.log); + aint[0] += -1; + aint1[0] += -1; + this.func_150530_a(aint, aint1, Blocks.log); + } + } + + /** + * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() + { + int i = 0; + int j = this.leafNodes.length; + + for (int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; i < j; ++i) + { + int[] aint1 = this.leafNodes[i]; + int[] aint2 = new int[] {aint1[0], aint1[1], aint1[2]}; + aint[1] = aint1[3]; + int k = aint[1] - this.basePos[1]; + + if (this.leafNodeNeedsBase(k)) + { + this.func_150530_a(aint, aint2, Blocks.log); + } + } + } + + /** + * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. + */ + int checkBlockLine(int[] p_76496_1_, int[] p_76496_2_) + { + int[] aint2 = new int[] {0, 0, 0}; + byte b0 = 0; + byte b1; + + for (b1 = 0; b0 < 3; ++b0) + { + aint2[b0] = p_76496_2_[b0] - p_76496_1_[b0]; + + if (Math.abs(aint2[b0]) > Math.abs(aint2[b1])) + { + b1 = b0; + } + } + + if (aint2[b1] == 0) + { + return -1; + } + else + { + byte b2 = otherCoordPairs[b1]; + byte b3 = otherCoordPairs[b1 + 3]; + byte b4; + + if (aint2[b1] > 0) + { + b4 = 1; + } + else + { + b4 = -1; + } + + double d0 = (double)aint2[b2] / (double)aint2[b1]; + double d1 = (double)aint2[b3] / (double)aint2[b1]; + int[] aint3 = new int[] {0, 0, 0}; + int i = 0; + int j; + + for (j = aint2[b1] + b4; i != j; i += b4) + { + aint3[b1] = p_76496_1_[b1] + i; + aint3[b2] = MathHelper.floor_double((double)p_76496_1_[b2] + (double)i * d0); + aint3[b3] = MathHelper.floor_double((double)p_76496_1_[b3] + (double)i * d1); + Block block = this.worldObj.getBlock(aint3[0], aint3[1], aint3[2]); + + if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2])) + { + break; + } + } + + return i == j ? -1 : Math.abs(i); + } + } + + /** + * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height + * limit, is valid. + */ + boolean validTreeLocation() + { + int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; + int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; + Block block = this.worldObj.getBlock(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); + + boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (!isSoil) + { + return false; + } + else + { + int i = this.checkBlockLine(aint, aint1); + + if (i == -1) + { + return true; + } + else if (i < 6) + { + return false; + } + else + { + this.heightLimit = i; + return true; + } + } + } + + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) + { + this.heightLimitLimit = (int)(p_76487_1_ * 12.0D); + + if (p_76487_1_ > 0.5D) + { + this.leafDistanceLimit = 5; + } + + this.scaleWidth = p_76487_3_; + this.leafDensity = p_76487_5_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + this.worldObj = p_76484_1_; + long l = p_76484_2_.nextLong(); + this.rand.setSeed(l); + this.basePos[0] = p_76484_3_; + this.basePos[1] = p_76484_4_; + this.basePos[2] = p_76484_5_; + + if (this.heightLimit == 0) + { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) + { + this.worldObj = null; //Fix vanilla Mem leak, holds latest world + return false; + } + else + { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + this.worldObj = null; //Fix vanilla Mem leak, holds latest world + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java new file mode 100644 index 0000000..fe2d4b1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenBlockBlob.java @@ -0,0 +1,84 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenBlockBlob extends WorldGenerator +{ + private Block field_150545_a; + private int field_150544_b; + private static final String __OBFID = "CL_00000402"; + + public WorldGenBlockBlob(Block p_i45450_1_, int p_i45450_2_) + { + super(false); + this.field_150545_a = p_i45450_1_; + this.field_150544_b = p_i45450_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + while (true) + { + if (p_76484_4_ > 3) + { + label63: + { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_)) + { + Block block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + if (block == Blocks.grass || block == Blocks.dirt || block == Blocks.stone) + { + break label63; + } + } + + --p_76484_4_; + continue; + } + } + + if (p_76484_4_ <= 3) + { + return false; + } + + int k2 = this.field_150544_b; + + for (int l = 0; k2 >= 0 && l < 3; ++l) + { + int i1 = k2 + p_76484_2_.nextInt(2); + int j1 = k2 + p_76484_2_.nextInt(2); + int k1 = k2 + p_76484_2_.nextInt(2); + float f = (float)(i1 + j1 + k1) * 0.333F + 0.5F; + + for (int l1 = p_76484_3_ - i1; l1 <= p_76484_3_ + i1; ++l1) + { + for (int i2 = p_76484_5_ - k1; i2 <= p_76484_5_ + k1; ++i2) + { + for (int j2 = p_76484_4_ - j1; j2 <= p_76484_4_ + j1; ++j2) + { + float f1 = (float)(l1 - p_76484_3_); + float f2 = (float)(i2 - p_76484_5_); + float f3 = (float)(j2 - p_76484_4_); + + if (f1 * f1 + f2 * f2 + f3 * f3 <= f * f) + { + p_76484_1_.setBlock(l1, j2, i2, this.field_150545_a, 0, 4); + } + } + } + } + + p_76484_3_ += -(k2 + 1) + p_76484_2_.nextInt(2 + k2 * 2); + p_76484_5_ += -(k2 + 1) + p_76484_2_.nextInt(2 + k2 * 2); + p_76484_4_ += 0 - p_76484_2_.nextInt(2); + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCactus.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCactus.java new file mode 100644 index 0000000..10dc117 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCactus.java @@ -0,0 +1,35 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenCactus extends WorldGenerator +{ + private static final String __OBFID = "CL_00000404"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 10; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1)) + { + int l1 = 1 + p_76484_2_.nextInt(p_76484_2_.nextInt(3) + 1); + + for (int i2 = 0; i2 < l1; ++i2) + { + if (Blocks.cactus.canBlockStay(p_76484_1_, i1, j1 + i2, k1)) + { + p_76484_1_.setBlock(i1, j1 + i2, k1, Blocks.cactus, 0, 2); + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java new file mode 100644 index 0000000..6e781c6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenCanopyTree.java @@ -0,0 +1,220 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenCanopyTree extends WorldGenAbstractTree +{ + private static final String __OBFID = "CL_00000430"; + + public WorldGenCanopyTree(boolean p_i45461_1_) + { + super(p_i45461_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(3) + p_76484_2_.nextInt(2) + 6; + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == p_76484_4_) + { + b0 = 0; + } + + if (i1 >= p_76484_4_ + 1 + l - 2) + { + b0 = 2; + } + + for (j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) + { + for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = p_76484_1_.getBlock(j1, i1, k1); + + if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); + onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4); + k1 = 2 - p_76484_2_.nextInt(3); + int k3 = p_76484_3_; + int l1 = p_76484_5_; + int i2 = 0; + int j2; + int k2; + + for (j2 = 0; j2 < l; ++j2) + { + k2 = p_76484_4_ + j2; + + if (j2 >= j1 && k1 > 0) + { + k3 += Direction.offsetX[j3]; + l1 += Direction.offsetZ[j3]; + --k1; + } + + Block block1 = p_76484_1_.getBlock(k3, k2, l1); + + if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, k3, k2, l1, Blocks.log2, 1); + this.setBlockAndNotifyAdequately(p_76484_1_, k3 + 1, k2, l1, Blocks.log2, 1); + this.setBlockAndNotifyAdequately(p_76484_1_, k3, k2, l1 + 1, Blocks.log2, 1); + this.setBlockAndNotifyAdequately(p_76484_1_, k3 + 1, k2, l1 + 1, Blocks.log2, 1); + i2 = k2; + } + } + + for (j2 = -2; j2 <= 0; ++j2) + { + for (k2 = -2; k2 <= 0; ++k2) + { + byte b1 = -1; + this.func_150526_a(p_76484_1_, k3 + j2, i2 + b1, l1 + k2); + this.func_150526_a(p_76484_1_, 1 + k3 - j2, i2 + b1, l1 + k2); + this.func_150526_a(p_76484_1_, k3 + j2, i2 + b1, 1 + l1 - k2); + this.func_150526_a(p_76484_1_, 1 + k3 - j2, i2 + b1, 1 + l1 - k2); + + if ((j2 > -2 || k2 > -1) && (j2 != -1 || k2 != -2)) + { + byte b2 = 1; + this.func_150526_a(p_76484_1_, k3 + j2, i2 + b2, l1 + k2); + this.func_150526_a(p_76484_1_, 1 + k3 - j2, i2 + b2, l1 + k2); + this.func_150526_a(p_76484_1_, k3 + j2, i2 + b2, 1 + l1 - k2); + this.func_150526_a(p_76484_1_, 1 + k3 - j2, i2 + b2, 1 + l1 - k2); + } + } + } + + if (p_76484_2_.nextBoolean()) + { + this.func_150526_a(p_76484_1_, k3, i2 + 2, l1); + this.func_150526_a(p_76484_1_, k3 + 1, i2 + 2, l1); + this.func_150526_a(p_76484_1_, k3 + 1, i2 + 2, l1 + 1); + this.func_150526_a(p_76484_1_, k3, i2 + 2, l1 + 1); + } + + for (j2 = -3; j2 <= 4; ++j2) + { + for (k2 = -3; k2 <= 4; ++k2) + { + if ((j2 != -3 || k2 != -3) && (j2 != -3 || k2 != 4) && (j2 != 4 || k2 != -3) && (j2 != 4 || k2 != 4) && (Math.abs(j2) < 3 || Math.abs(k2) < 3)) + { + this.func_150526_a(p_76484_1_, k3 + j2, i2, l1 + k2); + } + } + } + + for (j2 = -1; j2 <= 2; ++j2) + { + for (k2 = -1; k2 <= 2; ++k2) + { + if ((j2 < 0 || j2 > 1 || k2 < 0 || k2 > 1) && p_76484_2_.nextInt(3) <= 0) + { + int l3 = p_76484_2_.nextInt(3) + 2; + int l2; + + for (l2 = 0; l2 < l3; ++l2) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + j2, i2 - l2 - 1, p_76484_5_ + k2, Blocks.log2, 1); + } + + int i3; + + for (l2 = -1; l2 <= 1; ++l2) + { + for (i3 = -1; i3 <= 1; ++i3) + { + this.func_150526_a(p_76484_1_, k3 + j2 + l2, i2 - 0, l1 + k2 + i3); + } + } + + for (l2 = -2; l2 <= 2; ++l2) + { + for (i3 = -2; i3 <= 2; ++i3) + { + if (Math.abs(l2) != 2 || Math.abs(i3) != 2) + { + this.func_150526_a(p_76484_1_, k3 + j2 + l2, i2 - 1, l1 + k2 + i3); + } + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + private void func_150526_a(World p_150526_1_, int p_150526_2_, int p_150526_3_, int p_150526_4_) + { + Block block = p_150526_1_.getBlock(p_150526_2_, p_150526_3_, p_150526_4_); + + if (block.isAir(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_)) + { + this.setBlockAndNotifyAdequately(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.leaves2, 1); + } + } + + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { + world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenClay.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenClay.java new file mode 100644 index 0000000..355808e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenClay.java @@ -0,0 +1,58 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenClay extends WorldGenerator +{ + private Block field_150546_a; + /** The number of blocks to generate. */ + private int numberOfBlocks; + private static final String __OBFID = "CL_00000405"; + + public WorldGenClay(int p_i2011_1_) + { + this.field_150546_a = Blocks.clay; + this.numberOfBlocks = p_i2011_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.water) + { + return false; + } + else + { + int l = p_76484_2_.nextInt(this.numberOfBlocks - 2) + 2; + byte b0 = 1; + + for (int i1 = p_76484_3_ - l; i1 <= p_76484_3_ + l; ++i1) + { + for (int j1 = p_76484_5_ - l; j1 <= p_76484_5_ + l; ++j1) + { + int k1 = i1 - p_76484_3_; + int l1 = j1 - p_76484_5_; + + if (k1 * k1 + l1 * l1 <= l * l) + { + for (int i2 = p_76484_4_ - b0; i2 <= p_76484_4_ + b0; ++i2) + { + Block block = p_76484_1_.getBlock(i1, i2, j1); + + if (block == Blocks.dirt || block == Blocks.clay) + { + p_76484_1_.setBlock(i1, i2, j1, this.field_150546_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java new file mode 100644 index 0000000..0c2faee --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDeadBush.java @@ -0,0 +1,46 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + +public class WorldGenDeadBush extends WorldGenerator +{ + private Block field_150547_a; + private static final String __OBFID = "CL_00000406"; + + public WorldGenDeadBush(Block p_i45451_1_) + { + this.field_150547_a = p_i45451_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + Block block; + + do + { + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } + --p_76484_4_; + } while (p_76484_4_ > 0); + + for (int l = 0; l < 4; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && this.field_150547_a.canBlockStay(p_76484_1_, i1, j1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, this.field_150547_a, 0, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java new file mode 100644 index 0000000..fe7dc2d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDesertWells.java @@ -0,0 +1,97 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenDesertWells extends WorldGenerator +{ + private static final String __OBFID = "CL_00000407"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) + { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.sand) + { + return false; + } + else + { + int l; + int i1; + + for (l = -2; l <= 2; ++l) + { + for (i1 = -2; i1 <= 2; ++i1) + { + if (p_76484_1_.isAirBlock(p_76484_3_ + l, p_76484_4_ - 1, p_76484_5_ + i1) && p_76484_1_.isAirBlock(p_76484_3_ + l, p_76484_4_ - 2, p_76484_5_ + i1)) + { + return false; + } + } + } + + for (l = -1; l <= 0; ++l) + { + for (i1 = -2; i1 <= 2; ++i1) + { + for (int j1 = -2; j1 <= 2; ++j1) + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + l, p_76484_5_ + j1, Blocks.sandstone, 0, 2); + } + } + } + + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1, Blocks.flowing_water, 0, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1, Blocks.flowing_water, 0, 2); + + for (l = -2; l <= 2; ++l) + { + for (i1 = -2; i1 <= 2; ++i1) + { + if (l == -2 || l == 2 || i1 == -2 || i1 == 2) + { + p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 1, p_76484_5_ + i1, Blocks.sandstone, 0, 2); + } + } + } + + p_76484_1_.setBlock(p_76484_3_ + 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_ - 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ + 2, Blocks.stone_slab, 1, 2); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ - 2, Blocks.stone_slab, 1, 2); + + for (l = -1; l <= 1; ++l) + { + for (i1 = -1; i1 <= 1; ++i1) + { + if (l == 0 && i1 == 0) + { + p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 4, p_76484_5_ + i1, Blocks.sandstone, 0, 2); + } + else + { + p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 4, p_76484_5_ + i1, Blocks.stone_slab, 1, 2); + } + } + } + + for (l = 1; l <= 3; ++l) + { + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + l, p_76484_5_ - 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + l, p_76484_5_ + 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + l, p_76484_5_ - 1, Blocks.sandstone, 0, 2); + p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + l, p_76484_5_ + 1, Blocks.sandstone, 0, 2); + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java new file mode 100644 index 0000000..99a6193 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDoublePlant.java @@ -0,0 +1,36 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenDoublePlant extends WorldGenerator +{ + private int field_150549_a; + private static final String __OBFID = "CL_00000408"; + + public void func_150548_a(int p_150548_1_) + { + this.field_150549_a = p_150548_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + boolean flag = false; + + for (int l = 0; l < 64; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && (!p_76484_1_.provider.hasNoSky || j1 < 254) && Blocks.double_plant.canPlaceBlockAt(p_76484_1_, i1, j1, k1)) + { + Blocks.double_plant.func_149889_c(p_76484_1_, i1, j1, k1, this.field_150549_a, 2); + flag = true; + } + } + + return flag; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDungeons.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDungeons.java new file mode 100644 index 0000000..9eefd7e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenDungeons.java @@ -0,0 +1,177 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.DungeonHooks; +import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST;; + +public class WorldGenDungeons extends WorldGenerator +{ + public static final WeightedRandomChestContent[] field_111189_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 1, 10), new WeightedRandomChestContent(Items.wheat, 0, 1, 4, 10), new WeightedRandomChestContent(Items.gunpowder, 0, 1, 4, 10), new WeightedRandomChestContent(Items.string, 0, 1, 4, 10), new WeightedRandomChestContent(Items.bucket, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.redstone, 0, 1, 4, 10), new WeightedRandomChestContent(Items.record_13, 0, 1, 1, 10), new WeightedRandomChestContent(Items.record_cat, 0, 1, 1, 10), new WeightedRandomChestContent(Items.name_tag, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 2), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private static final String __OBFID = "CL_00000425"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + byte b0 = 3; + int l = p_76484_2_.nextInt(2) + 2; + int i1 = p_76484_2_.nextInt(2) + 2; + int j1 = 0; + int k1; + int l1; + int i2; + + for (k1 = p_76484_3_ - l - 1; k1 <= p_76484_3_ + l + 1; ++k1) + { + for (l1 = p_76484_4_ - 1; l1 <= p_76484_4_ + b0 + 1; ++l1) + { + for (i2 = p_76484_5_ - i1 - 1; i2 <= p_76484_5_ + i1 + 1; ++i2) + { + Material material = p_76484_1_.getBlock(k1, l1, i2).getMaterial(); + + if (l1 == p_76484_4_ - 1 && !material.isSolid()) + { + return false; + } + + if (l1 == p_76484_4_ + b0 + 1 && !material.isSolid()) + { + return false; + } + + if ((k1 == p_76484_3_ - l - 1 || k1 == p_76484_3_ + l + 1 || i2 == p_76484_5_ - i1 - 1 || i2 == p_76484_5_ + i1 + 1) && l1 == p_76484_4_ && p_76484_1_.isAirBlock(k1, l1, i2) && p_76484_1_.isAirBlock(k1, l1 + 1, i2)) + { + ++j1; + } + } + } + } + + if (j1 >= 1 && j1 <= 5) + { + for (k1 = p_76484_3_ - l - 1; k1 <= p_76484_3_ + l + 1; ++k1) + { + for (l1 = p_76484_4_ + b0; l1 >= p_76484_4_ - 1; --l1) + { + for (i2 = p_76484_5_ - i1 - 1; i2 <= p_76484_5_ + i1 + 1; ++i2) + { + if (k1 != p_76484_3_ - l - 1 && l1 != p_76484_4_ - 1 && i2 != p_76484_5_ - i1 - 1 && k1 != p_76484_3_ + l + 1 && l1 != p_76484_4_ + b0 + 1 && i2 != p_76484_5_ + i1 + 1) + { + p_76484_1_.setBlockToAir(k1, l1, i2); + } + else if (l1 >= 0 && !p_76484_1_.getBlock(k1, l1 - 1, i2).getMaterial().isSolid()) + { + p_76484_1_.setBlockToAir(k1, l1, i2); + } + else if (p_76484_1_.getBlock(k1, l1, i2).getMaterial().isSolid()) + { + if (l1 == p_76484_4_ - 1 && p_76484_2_.nextInt(4) != 0) + { + p_76484_1_.setBlock(k1, l1, i2, Blocks.mossy_cobblestone, 0, 2); + } + else + { + p_76484_1_.setBlock(k1, l1, i2, Blocks.cobblestone, 0, 2); + } + } + } + } + } + + k1 = 0; + + while (k1 < 2) + { + l1 = 0; + + while (true) + { + if (l1 < 3) + { + label101: + { + i2 = p_76484_3_ + p_76484_2_.nextInt(l * 2 + 1) - l; + int j2 = p_76484_5_ + p_76484_2_.nextInt(i1 * 2 + 1) - i1; + + if (p_76484_1_.isAirBlock(i2, p_76484_4_, j2)) + { + int k2 = 0; + + if (p_76484_1_.getBlock(i2 - 1, p_76484_4_, j2).getMaterial().isSolid()) + { + ++k2; + } + + if (p_76484_1_.getBlock(i2 + 1, p_76484_4_, j2).getMaterial().isSolid()) + { + ++k2; + } + + if (p_76484_1_.getBlock(i2, p_76484_4_, j2 - 1).getMaterial().isSolid()) + { + ++k2; + } + + if (p_76484_1_.getBlock(i2, p_76484_4_, j2 + 1).getMaterial().isSolid()) + { + ++k2; + } + + if (k2 == 1) + { + p_76484_1_.setBlock(i2, p_76484_4_, j2, Blocks.chest, 0, 2); + TileEntityChest tileentitychest = (TileEntityChest)p_76484_1_.getTileEntity(i2, p_76484_4_, j2); + + if (tileentitychest != null) + { + WeightedRandomChestContent.generateChestContents(p_76484_2_, ChestGenHooks.getItems(DUNGEON_CHEST, p_76484_2_), tileentitychest, ChestGenHooks.getCount(DUNGEON_CHEST, p_76484_2_)); + } + + break label101; + } + } + + ++l1; + continue; + } + } + + ++k1; + break; + } + } + + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)p_76484_1_.getTileEntity(p_76484_3_, p_76484_4_, p_76484_5_); + + if (tileentitymobspawner != null) + { + tileentitymobspawner.func_145881_a().setEntityName(this.pickMobSpawner(p_76484_2_)); + } + else + { + System.err.println("Failed to fetch mob spawner entity at (" + p_76484_3_ + ", " + p_76484_4_ + ", " + p_76484_5_ + ")"); + } + + return true; + } + else + { + return false; + } + } + + /** + * Randomly decides which spawner to use in a dungeon + */ + private String pickMobSpawner(Random p_76543_1_) + { + return DungeonHooks.getRandomDungeonMob(p_76543_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFire.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFire.java new file mode 100644 index 0000000..b5805ca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFire.java @@ -0,0 +1,27 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenFire extends WorldGenerator +{ + private static final String __OBFID = "CL_00000412"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 64; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && p_76484_1_.getBlock(i1, j1 - 1, k1) == Blocks.netherrack) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.fire, 0, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFlowers.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFlowers.java new file mode 100644 index 0000000..44cb8b6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenFlowers.java @@ -0,0 +1,40 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public class WorldGenFlowers extends WorldGenerator +{ + private Block field_150552_a; + private int field_150551_b; + private static final String __OBFID = "CL_00000410"; + + public WorldGenFlowers(Block p_i45452_1_) + { + this.field_150552_a = p_i45452_1_; + } + + public void func_150550_a(Block p_150550_1_, int p_150550_2_) + { + this.field_150552_a = p_150550_1_; + this.field_150551_b = p_150550_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 64; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && (!p_76484_1_.provider.hasNoSky || j1 < 255) && this.field_150552_a.canBlockStay(p_76484_1_, i1, j1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, this.field_150552_a, this.field_150551_b, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenForest.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenForest.java new file mode 100644 index 0000000..e719ad9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenForest.java @@ -0,0 +1,136 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenForest extends WorldGenAbstractTree +{ + private boolean field_150531_a; + private static final String __OBFID = "CL_00000401"; + + public WorldGenForest(boolean p_i45449_1_, boolean p_i45449_2_) + { + super(p_i45449_1_); + this.field_150531_a = p_i45449_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(3) + 5; + + if (this.field_150531_a) + { + l += p_76484_2_.nextInt(7); + } + + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == p_76484_4_) + { + b0 = 0; + } + + if (i1 >= p_76484_4_ + 1 + l - 2) + { + b0 = 2; + } + + for (j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) + { + for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = p_76484_1_.getBlock(j1, i1, k1); + + if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int k2; + + for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) + { + j1 = k2 - (p_76484_4_ + l); + k1 = 1 - j1 / 2; + + for (int l2 = p_76484_3_ - k1; l2 <= p_76484_3_ + k1; ++l2) + { + int l1 = l2 - p_76484_3_; + + for (int i2 = p_76484_5_ - k1; i2 <= p_76484_5_ + k1; ++i2) + { + int j2 = i2 - p_76484_5_; + + if (Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) + { + Block block1 = p_76484_1_.getBlock(l2, k2, i2); + + if (block1.isAir(p_76484_1_, l2, k2, i2) || block1.isLeaves(p_76484_1_, l2, k2, i2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, l2, k2, i2, Blocks.leaves, 2); + } + } + } + } + } + + for (k2 = 0; k2 < l; ++k2) + { + Block block3 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + + if (block3.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block3.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.log, 2); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java new file mode 100644 index 0000000..ff3eda7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone1.java @@ -0,0 +1,87 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenGlowStone1 extends WorldGenerator +{ + private static final String __OBFID = "CL_00000419"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) + { + return false; + } + else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) + { + return false; + } + else + { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.glowstone, 0, 2); + + for (int l = 0; l < 1500; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ - p_76484_2_.nextInt(12); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.getBlock(i1, j1, k1).getMaterial() == Material.air) + { + int l1 = 0; + + for (int i2 = 0; i2 < 6; ++i2) + { + Block block = null; + + if (i2 == 0) + { + block = p_76484_1_.getBlock(i1 - 1, j1, k1); + } + + if (i2 == 1) + { + block = p_76484_1_.getBlock(i1 + 1, j1, k1); + } + + if (i2 == 2) + { + block = p_76484_1_.getBlock(i1, j1 - 1, k1); + } + + if (i2 == 3) + { + block = p_76484_1_.getBlock(i1, j1 + 1, k1); + } + + if (i2 == 4) + { + block = p_76484_1_.getBlock(i1, j1, k1 - 1); + } + + if (i2 == 5) + { + block = p_76484_1_.getBlock(i1, j1, k1 + 1); + } + + if (block == Blocks.glowstone) + { + ++l1; + } + } + + if (l1 == 1) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.glowstone, 0, 2); + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java new file mode 100644 index 0000000..2c53569 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenGlowStone2.java @@ -0,0 +1,87 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenGlowStone2 extends WorldGenerator +{ + private static final String __OBFID = "CL_00000413"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (!p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) + { + return false; + } + else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) + { + return false; + } + else + { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.glowstone, 0, 2); + + for (int l = 0; l < 1500; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ - p_76484_2_.nextInt(12); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.getBlock(i1, j1, k1).getMaterial() == Material.air) + { + int l1 = 0; + + for (int i2 = 0; i2 < 6; ++i2) + { + Block block = null; + + if (i2 == 0) + { + block = p_76484_1_.getBlock(i1 - 1, j1, k1); + } + + if (i2 == 1) + { + block = p_76484_1_.getBlock(i1 + 1, j1, k1); + } + + if (i2 == 2) + { + block = p_76484_1_.getBlock(i1, j1 - 1, k1); + } + + if (i2 == 3) + { + block = p_76484_1_.getBlock(i1, j1 + 1, k1); + } + + if (i2 == 4) + { + block = p_76484_1_.getBlock(i1, j1, k1 - 1); + } + + if (i2 == 5) + { + block = p_76484_1_.getBlock(i1, j1, k1 + 1); + } + + if (block == Blocks.glowstone) + { + ++l1; + } + } + + if (l1 == 1) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.glowstone, 0, 2); + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHellLava.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHellLava.java new file mode 100644 index 0000000..1b46949 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHellLava.java @@ -0,0 +1,98 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenHellLava extends WorldGenerator +{ + private Block field_150553_a; + private boolean field_94524_b; + private static final String __OBFID = "CL_00000414"; + + public WorldGenHellLava(Block p_i45453_1_, boolean p_i45453_2_) + { + this.field_150553_a = p_i45453_1_; + this.field_94524_b = p_i45453_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.netherrack) + { + return false; + } + else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.air && p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.netherrack) + { + return false; + } + else + { + int l = 0; + + if (p_76484_1_.getBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_) == Blocks.netherrack) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_) == Blocks.netherrack) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1) == Blocks.netherrack) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1) == Blocks.netherrack) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == Blocks.netherrack) + { + ++l; + } + + int i1 = 0; + + if (p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_)) + { + ++i1; + } + + if (!this.field_94524_b && l == 4 && i1 == 1 || l == 5) + { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, this.field_150553_a, 0, 2); + p_76484_1_.scheduledUpdatesAreImmediate = true; + this.field_150553_a.updateTick(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, p_76484_2_); + p_76484_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java new file mode 100644 index 0000000..1a39c58 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenHugeTrees.java @@ -0,0 +1,173 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public abstract class WorldGenHugeTrees extends WorldGenAbstractTree +{ + /** The base height of the tree */ + protected final int baseHeight; + /** Sets the metadata for the wood blocks used */ + protected final int woodMetadata; + /** Sets the metadata for the leaves used in huge trees */ + protected final int leavesMetadata; + protected int field_150538_d; + private static final String __OBFID = "CL_00000423"; + + public WorldGenHugeTrees(boolean p_i45458_1_, int p_i45458_2_, int p_i45458_3_, int p_i45458_4_, int p_i45458_5_) + { + super(p_i45458_1_); + this.baseHeight = p_i45458_2_; + this.field_150538_d = p_i45458_3_; + this.woodMetadata = p_i45458_4_; + this.leavesMetadata = p_i45458_5_; + } + + protected int func_150533_a(Random p_150533_1_) + { + int i = p_150533_1_.nextInt(3) + this.baseHeight; + + if (this.field_150538_d > 1) + { + i += p_150533_1_.nextInt(this.field_150538_d); + } + + return i; + } + + private boolean func_150536_b(World p_150536_1_, Random p_150536_2_, int p_150536_3_, int p_150536_4_, int p_150536_5_, int p_150536_6_) + { + boolean flag = true; + + if (p_150536_4_ >= 1 && p_150536_4_ + p_150536_6_ + 1 <= 256) + { + for (int i1 = p_150536_4_; i1 <= p_150536_4_ + 1 + p_150536_6_; ++i1) + { + byte b0 = 2; + + if (i1 == p_150536_4_) + { + b0 = 1; + } + + if (i1 >= p_150536_4_ + 1 + p_150536_6_ - 2) + { + b0 = 2; + } + + for (int j1 = p_150536_3_ - b0; j1 <= p_150536_3_ + b0 && flag; ++j1) + { + for (int k1 = p_150536_5_ - b0; k1 <= p_150536_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = p_150536_1_.getBlock(j1, i1, k1); + + if (!this.isReplaceable(p_150536_1_, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + return flag; + } + else + { + return false; + } + } + + private boolean func_150532_c(World p_150532_1_, Random p_150532_2_, int p_150532_3_, int p_150532_4_, int p_150532_5_) + { + Block block = p_150532_1_.getBlock(p_150532_3_, p_150532_4_ - 1, p_150532_5_); + + boolean isSoil = block.canSustainPlant(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_150532_4_ >= 2) + { + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); + onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); + return true; + } + else + { + return false; + } + } + + protected boolean func_150537_a(World p_150537_1_, Random p_150537_2_, int p_150537_3_, int p_150537_4_, int p_150537_5_, int p_150537_6_) + { + return this.func_150536_b(p_150537_1_, p_150537_2_, p_150537_3_, p_150537_4_, p_150537_5_, p_150537_6_) && this.func_150532_c(p_150537_1_, p_150537_2_, p_150537_3_, p_150537_4_, p_150537_5_); + } + + protected void func_150535_a(World p_150535_1_, int p_150535_2_, int p_150535_3_, int p_150535_4_, int p_150535_5_, Random p_150535_6_) + { + int i1 = p_150535_5_ * p_150535_5_; + + for (int j1 = p_150535_2_ - p_150535_5_; j1 <= p_150535_2_ + p_150535_5_ + 1; ++j1) + { + int k1 = j1 - p_150535_2_; + + for (int l1 = p_150535_4_ - p_150535_5_; l1 <= p_150535_4_ + p_150535_5_ + 1; ++l1) + { + int i2 = l1 - p_150535_4_; + int j2 = k1 - 1; + int k2 = i2 - 1; + + if (k1 * k1 + i2 * i2 <= i1 || j2 * j2 + k2 * k2 <= i1 || k1 * k1 + k2 * k2 <= i1 || j2 * j2 + i2 * i2 <= i1) + { + Block block = p_150535_1_.getBlock(j1, p_150535_3_, l1); + + if (block.isAir(p_150535_1_, j1, p_150535_3_, l1) || block.isLeaves(p_150535_1_, j1, p_150535_3_, l1)) + { + this.setBlockAndNotifyAdequately(p_150535_1_, j1, p_150535_3_, l1, Blocks.leaves, this.leavesMetadata); + } + } + } + } + } + + protected void func_150534_b(World p_150534_1_, int p_150534_2_, int p_150534_3_, int p_150534_4_, int p_150534_5_, Random p_150534_6_) + { + int i1 = p_150534_5_ * p_150534_5_; + + for (int j1 = p_150534_2_ - p_150534_5_; j1 <= p_150534_2_ + p_150534_5_; ++j1) + { + int k1 = j1 - p_150534_2_; + + for (int l1 = p_150534_4_ - p_150534_5_; l1 <= p_150534_4_ + p_150534_5_; ++l1) + { + int i2 = l1 - p_150534_4_; + + if (k1 * k1 + i2 * i2 <= i1) + { + Block block = p_150534_1_.getBlock(j1, p_150534_3_, l1); + + if (block.isAir(p_150534_1_, j1, p_150534_3_, l1) || block.isLeaves(p_150534_1_, j1, p_150534_3_, l1)) + { + this.setBlockAndNotifyAdequately(p_150534_1_, j1, p_150534_3_, l1, Blocks.leaves, this.leavesMetadata); + } + } + } + } + } + + //Just a helper macro + private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) + { + world.getBlock(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIcePath.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIcePath.java new file mode 100644 index 0000000..8cc7f0c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIcePath.java @@ -0,0 +1,61 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenIcePath extends WorldGenerator +{ + private Block field_150555_a; + private int field_150554_b; + private static final String __OBFID = "CL_00000416"; + + public WorldGenIcePath(int p_i45454_1_) + { + this.field_150555_a = Blocks.packed_ice; + this.field_150554_b = p_i45454_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) + { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.snow) + { + return false; + } + else + { + int l = p_76484_2_.nextInt(this.field_150554_b - 2) + 2; + byte b0 = 1; + + for (int i1 = p_76484_3_ - l; i1 <= p_76484_3_ + l; ++i1) + { + for (int j1 = p_76484_5_ - l; j1 <= p_76484_5_ + l; ++j1) + { + int k1 = i1 - p_76484_3_; + int l1 = j1 - p_76484_5_; + + if (k1 * k1 + l1 * l1 <= l * l) + { + for (int i2 = p_76484_4_ - b0; i2 <= p_76484_4_ + b0; ++i2) + { + Block block = p_76484_1_.getBlock(i1, i2, j1); + + if (block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + p_76484_1_.setBlock(i1, i2, j1, this.field_150555_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java new file mode 100644 index 0000000..9197bd4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenIceSpike.java @@ -0,0 +1,132 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenIceSpike extends WorldGenerator +{ + private static final String __OBFID = "CL_00000417"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2) + { + --p_76484_4_; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.snow) + { + return false; + } + else + { + p_76484_4_ += p_76484_2_.nextInt(4); + int l = p_76484_2_.nextInt(4) + 7; + int i1 = l / 4 + p_76484_2_.nextInt(2); + + if (i1 > 1 && p_76484_2_.nextInt(60) == 0) + { + p_76484_4_ += 10 + p_76484_2_.nextInt(30); + } + + int j1; + int k1; + int l1; + + for (j1 = 0; j1 < l; ++j1) + { + float f = (1.0F - (float)j1 / (float)l) * (float)i1; + k1 = MathHelper.ceiling_float_int(f); + + for (l1 = -k1; l1 <= k1; ++l1) + { + float f1 = (float)MathHelper.abs_int(l1) - 0.25F; + + for (int i2 = -k1; i2 <= k1; ++i2) + { + float f2 = (float)MathHelper.abs_int(i2) - 0.25F; + + if ((l1 == 0 && i2 == 0 || f1 * f1 + f2 * f2 <= f * f) && (l1 != -k1 && l1 != k1 && i2 != -k1 && i2 != k1 || p_76484_2_.nextFloat() <= 0.75F)) + { + Block block = p_76484_1_.getBlock(p_76484_3_ + l1, p_76484_4_ + j1, p_76484_5_ + i2); + + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + this.func_150515_a(p_76484_1_, p_76484_3_ + l1, p_76484_4_ + j1, p_76484_5_ + i2, Blocks.packed_ice); + } + + if (j1 != 0 && k1 > 1) + { + block = p_76484_1_.getBlock(p_76484_3_ + l1, p_76484_4_ - j1, p_76484_5_ + i2); + + if (block.getMaterial() == Material.air || block == Blocks.dirt || block == Blocks.snow || block == Blocks.ice) + { + this.func_150515_a(p_76484_1_, p_76484_3_ + l1, p_76484_4_ - j1, p_76484_5_ + i2, Blocks.packed_ice); + } + } + } + } + } + } + + j1 = i1 - 1; + + if (j1 < 0) + { + j1 = 0; + } + else if (j1 > 1) + { + j1 = 1; + } + + for (int j2 = -j1; j2 <= j1; ++j2) + { + k1 = -j1; + + while (k1 <= j1) + { + l1 = p_76484_4_ - 1; + int k2 = 50; + + if (Math.abs(j2) == 1 && Math.abs(k1) == 1) + { + k2 = p_76484_2_.nextInt(5); + } + + while (true) + { + if (l1 > 50) + { + Block block1 = p_76484_1_.getBlock(p_76484_3_ + j2, l1, p_76484_5_ + k1); + + if (block1.getMaterial() == Material.air || block1 == Blocks.dirt || block1 == Blocks.snow || block1 == Blocks.ice || block1 == Blocks.packed_ice) + { + this.func_150515_a(p_76484_1_, p_76484_3_ + j2, l1, p_76484_5_ + k1, Blocks.packed_ice); + --l1; + --k2; + + if (k2 <= 0) + { + l1 -= p_76484_2_.nextInt(5) + 1; + k2 = p_76484_2_.nextInt(5); + } + + continue; + } + } + + ++k1; + break; + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLakes.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLakes.java new file mode 100644 index 0000000..21d5f34 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLakes.java @@ -0,0 +1,175 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class WorldGenLakes extends WorldGenerator +{ + private Block field_150556_a; + private static final String __OBFID = "CL_00000418"; + + public WorldGenLakes(Block p_i45455_1_) + { + this.field_150556_a = p_i45455_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + p_76484_3_ -= 8; + + for (p_76484_5_ -= 8; p_76484_4_ > 5 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_); --p_76484_4_) + { + ; + } + + if (p_76484_4_ <= 4) + { + return false; + } + else + { + p_76484_4_ -= 4; + boolean[] aboolean = new boolean[2048]; + int l = p_76484_2_.nextInt(4) + 4; + int i1; + + for (i1 = 0; i1 < l; ++i1) + { + double d0 = p_76484_2_.nextDouble() * 6.0D + 3.0D; + double d1 = p_76484_2_.nextDouble() * 4.0D + 2.0D; + double d2 = p_76484_2_.nextDouble() * 6.0D + 3.0D; + double d3 = p_76484_2_.nextDouble() * (16.0D - d0 - 2.0D) + 1.0D + d0 / 2.0D; + double d4 = p_76484_2_.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; + double d5 = p_76484_2_.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; + + for (int k1 = 1; k1 < 15; ++k1) + { + for (int l1 = 1; l1 < 15; ++l1) + { + for (int i2 = 1; i2 < 7; ++i2) + { + double d6 = ((double)k1 - d3) / (d0 / 2.0D); + double d7 = ((double)i2 - d4) / (d1 / 2.0D); + double d8 = ((double)l1 - d5) / (d2 / 2.0D); + double d9 = d6 * d6 + d7 * d7 + d8 * d8; + + if (d9 < 1.0D) + { + aboolean[(k1 * 16 + l1) * 8 + i2] = true; + } + } + } + } + } + + int j1; + int j2; + boolean flag; + + for (i1 = 0; i1 < 16; ++i1) + { + for (j2 = 0; j2 < 16; ++j2) + { + for (j1 = 0; j1 < 8; ++j1) + { + flag = !aboolean[(i1 * 16 + j2) * 8 + j1] && (i1 < 15 && aboolean[((i1 + 1) * 16 + j2) * 8 + j1] || i1 > 0 && aboolean[((i1 - 1) * 16 + j2) * 8 + j1] || j2 < 15 && aboolean[(i1 * 16 + j2 + 1) * 8 + j1] || j2 > 0 && aboolean[(i1 * 16 + (j2 - 1)) * 8 + j1] || j1 < 7 && aboolean[(i1 * 16 + j2) * 8 + j1 + 1] || j1 > 0 && aboolean[(i1 * 16 + j2) * 8 + (j1 - 1)]); + + if (flag) + { + Material material = p_76484_1_.getBlock(p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2).getMaterial(); + + if (j1 >= 4 && material.isLiquid()) + { + return false; + } + + if (j1 < 4 && !material.isSolid() && p_76484_1_.getBlock(p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2) != this.field_150556_a) + { + return false; + } + } + } + } + } + + for (i1 = 0; i1 < 16; ++i1) + { + for (j2 = 0; j2 < 16; ++j2) + { + for (j1 = 0; j1 < 8; ++j1) + { + if (aboolean[(i1 * 16 + j2) * 8 + j1]) + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2, j1 >= 4 ? Blocks.air : this.field_150556_a, 0, 2); + } + } + } + } + + for (i1 = 0; i1 < 16; ++i1) + { + for (j2 = 0; j2 < 16; ++j2) + { + for (j1 = 4; j1 < 8; ++j1) + { + if (aboolean[(i1 * 16 + j2) * 8 + j1] && p_76484_1_.getBlock(p_76484_3_ + i1, p_76484_4_ + j1 - 1, p_76484_5_ + j2) == Blocks.dirt && p_76484_1_.getSavedLightValue(EnumSkyBlock.Sky, p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2) > 0) + { + BiomeGenBase biomegenbase = p_76484_1_.getBiomeGenForCoords(p_76484_3_ + i1, p_76484_5_ + j2); + + if (biomegenbase.topBlock == Blocks.mycelium) + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + j1 - 1, p_76484_5_ + j2, Blocks.mycelium, 0, 2); + } + else + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + j1 - 1, p_76484_5_ + j2, Blocks.grass, 0, 2); + } + } + } + } + } + + if (this.field_150556_a.getMaterial() == Material.lava) + { + for (i1 = 0; i1 < 16; ++i1) + { + for (j2 = 0; j2 < 16; ++j2) + { + for (j1 = 0; j1 < 8; ++j1) + { + flag = !aboolean[(i1 * 16 + j2) * 8 + j1] && (i1 < 15 && aboolean[((i1 + 1) * 16 + j2) * 8 + j1] || i1 > 0 && aboolean[((i1 - 1) * 16 + j2) * 8 + j1] || j2 < 15 && aboolean[(i1 * 16 + j2 + 1) * 8 + j1] || j2 > 0 && aboolean[(i1 * 16 + (j2 - 1)) * 8 + j1] || j1 < 7 && aboolean[(i1 * 16 + j2) * 8 + j1 + 1] || j1 > 0 && aboolean[(i1 * 16 + j2) * 8 + (j1 - 1)]); + + if (flag && (j1 < 4 || p_76484_2_.nextInt(2) != 0) && p_76484_1_.getBlock(p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2).getMaterial().isSolid()) + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + j1, p_76484_5_ + j2, Blocks.stone, 0, 2); + } + } + } + } + } + + if (this.field_150556_a.getMaterial() == Material.water) + { + for (i1 = 0; i1 < 16; ++i1) + { + for (j2 = 0; j2 < 16; ++j2) + { + byte b0 = 4; + + if (p_76484_1_.isBlockFreezable(p_76484_3_ + i1, p_76484_4_ + b0, p_76484_5_ + j2)) + { + p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + b0, p_76484_5_ + j2, Blocks.ice, 0, 2); + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLiquids.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLiquids.java new file mode 100644 index 0000000..3d266c5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenLiquids.java @@ -0,0 +1,90 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenLiquids extends WorldGenerator +{ + private Block field_150521_a; + private static final String __OBFID = "CL_00000434"; + + public WorldGenLiquids(Block p_i45465_1_) + { + this.field_150521_a = p_i45465_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_) != Blocks.stone) + { + return false; + } + else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) != Blocks.stone) + { + return false; + } + else if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.air && p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.stone) + { + return false; + } + else + { + int l = 0; + + if (p_76484_1_.getBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_) == Blocks.stone) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_) == Blocks.stone) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1) == Blocks.stone) + { + ++l; + } + + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1) == Blocks.stone) + { + ++l; + } + + int i1 = 0; + + if (p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1)) + { + ++i1; + } + + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1)) + { + ++i1; + } + + if (l == 3 && i1 == 1) + { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, this.field_150521_a, 0, 2); + p_76484_1_.scheduledUpdatesAreImmediate = true; + this.field_150521_a.updateTick(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, p_76484_2_); + p_76484_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java new file mode 100644 index 0000000..c631a3b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaJungle.java @@ -0,0 +1,155 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMegaJungle extends WorldGenHugeTrees +{ + private static final String __OBFID = "CL_00000420"; + + public WorldGenMegaJungle(boolean p_i45456_1_, int p_i45456_2_, int p_i45456_3_, int p_i45456_4_, int p_i45456_5_) + { + super(p_i45456_1_, p_i45456_2_, p_i45456_3_, p_i45456_4_, p_i45456_5_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = this.func_150533_a(p_76484_2_); + + if (!this.func_150537_a(p_76484_1_, p_76484_2_, p_76484_3_, p_76484_4_, p_76484_5_, l)) + { + return false; + } + else + { + this.func_150543_c(p_76484_1_, p_76484_3_, p_76484_5_, p_76484_4_ + l, 2, p_76484_2_); + + for (int i1 = p_76484_4_ + l - 2 - p_76484_2_.nextInt(4); i1 > p_76484_4_ + l / 2; i1 -= 2 + p_76484_2_.nextInt(4)) + { + float f = p_76484_2_.nextFloat() * (float)Math.PI * 2.0F; + int j1 = p_76484_3_ + (int)(0.5F + MathHelper.cos(f) * 4.0F); + int k1 = p_76484_5_ + (int)(0.5F + MathHelper.sin(f) * 4.0F); + int l1; + + for (l1 = 0; l1 < 5; ++l1) + { + j1 = p_76484_3_ + (int)(1.5F + MathHelper.cos(f) * (float)l1); + k1 = p_76484_5_ + (int)(1.5F + MathHelper.sin(f) * (float)l1); + this.setBlockAndNotifyAdequately(p_76484_1_, j1, i1 - 3 + l1 / 2, k1, Blocks.log, this.woodMetadata); + } + + l1 = 1 + p_76484_2_.nextInt(2); + int i2 = i1; + + for (int j2 = i1 - l1; j2 <= i2; ++j2) + { + int k2 = j2 - i2; + this.func_150534_b(p_76484_1_, j1, j2, k1, 1 - k2, p_76484_2_); + } + } + + for (int l2 = 0; l2 < l; ++l2) + { + Block block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + l2, p_76484_5_); + + if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_, Blocks.log, this.woodMetadata); + + if (l2 > 0) + { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + l2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + l2, p_76484_5_, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + l2, p_76484_5_ - 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ - 1, Blocks.vine, 1); + } + } + } + + if (l2 < l - 1) + { + block = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_); + + if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_, Blocks.log, this.woodMetadata); + + if (l2 > 0) + { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 2, p_76484_4_ + l2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 2, p_76484_4_ + l2, p_76484_5_, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ - 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ - 1, Blocks.vine, 1); + } + } + } + + block = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1); + + if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + + if (l2 > 0) + { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 2, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 2, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 2, Blocks.vine, 4); + } + } + } + + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1); + + if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + + if (l2 > 0) + { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 2, Blocks.vine, 4); + } + } + } + } + } + + return true; + } + } + + private void func_150543_c(World p_150543_1_, int p_150543_2_, int p_150543_3_, int p_150543_4_, int p_150543_5_, Random p_150543_6_) + { + byte b0 = 2; + + for (int i1 = p_150543_4_ - b0; i1 <= p_150543_4_; ++i1) + { + int j1 = i1 - p_150543_4_; + this.func_150535_a(p_150543_1_, p_150543_2_, i1, p_150543_3_, p_150543_5_ + 1 - j1, p_150543_6_); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java new file mode 100644 index 0000000..51232e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java @@ -0,0 +1,149 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenMegaPineTree extends WorldGenHugeTrees +{ + private boolean field_150542_e; + private static final String __OBFID = "CL_00000421"; + + public WorldGenMegaPineTree(boolean p_i45457_1_, boolean p_i45457_2_) + { + super(p_i45457_1_, 13, 15, 1, 1); + this.field_150542_e = p_i45457_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = this.func_150533_a(p_76484_2_); + + if (!this.func_150537_a(p_76484_1_, p_76484_2_, p_76484_3_, p_76484_4_, p_76484_5_, l)) + { + return false; + } + else + { + this.func_150541_c(p_76484_1_, p_76484_3_, p_76484_5_, p_76484_4_ + l, 0, p_76484_2_); + + for (int i1 = 0; i1 < l; ++i1) + { + Block block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + i1, p_76484_5_); + + if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_, Blocks.log, this.woodMetadata); + } + + if (i1 < l - 1) + { + block = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_); + + if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_, Blocks.log, this.woodMetadata); + } + + block = p_76484_1_.getBlock(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1); + + if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + } + + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1); + + if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.log, this.woodMetadata); + } + } + } + + return true; + } + } + + private void func_150541_c(World p_150541_1_, int p_150541_2_, int p_150541_3_, int p_150541_4_, int p_150541_5_, Random p_150541_6_) + { + int i1 = p_150541_6_.nextInt(5); + + if (this.field_150542_e) + { + i1 += this.baseHeight; + } + else + { + i1 += 3; + } + + int j1 = 0; + + for (int k1 = p_150541_4_ - i1; k1 <= p_150541_4_; ++k1) + { + int l1 = p_150541_4_ - k1; + int i2 = p_150541_5_ + MathHelper.floor_float((float)l1 / (float)i1 * 3.5F); + this.func_150535_a(p_150541_1_, p_150541_2_, k1, p_150541_3_, i2 + (l1 > 0 && i2 == j1 && (k1 & 1) == 0 ? 1 : 0), p_150541_6_); + j1 = i2; + } + } + + public void func_150524_b(World p_150524_1_, Random p_150524_2_, int p_150524_3_, int p_150524_4_, int p_150524_5_) + { + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 1, p_150524_4_, p_150524_5_ - 1); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ + 2, p_150524_4_, p_150524_5_ - 1); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 1, p_150524_4_, p_150524_5_ + 2); + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ + 2, p_150524_4_, p_150524_5_ + 2); + + for (int l = 0; l < 5; ++l) + { + int i1 = p_150524_2_.nextInt(64); + int j1 = i1 % 8; + int k1 = i1 / 8; + + if (j1 == 0 || j1 == 7 || k1 == 0 || k1 == 7) + { + this.func_150539_c(p_150524_1_, p_150524_2_, p_150524_3_ - 3 + j1, p_150524_4_, p_150524_5_ - 3 + k1); + } + } + } + + private void func_150539_c(World p_150539_1_, Random p_150539_2_, int p_150539_3_, int p_150539_4_, int p_150539_5_) + { + for (int l = -2; l <= 2; ++l) + { + for (int i1 = -2; i1 <= 2; ++i1) + { + if (Math.abs(l) != 2 || Math.abs(i1) != 2) + { + this.func_150540_a(p_150539_1_, p_150539_3_ + l, p_150539_4_, p_150539_5_ + i1); + } + } + } + } + + private void func_150540_a(World p_150540_1_, int p_150540_2_, int p_150540_3_, int p_150540_4_) + { + for (int l = p_150540_3_ + 2; l >= p_150540_3_ - 3; --l) + { + Block block = p_150540_1_.getBlock(p_150540_2_, l, p_150540_4_); + + if (block.canSustainPlant(p_150540_1_, p_150540_2_, l, p_150540_4_, ForgeDirection.UP, (BlockSapling)Blocks.sapling)) + { + this.setBlockAndNotifyAdequately(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.dirt, 2); + break; + } + + if (block.isAir(p_150540_1_, p_150540_2_, l, p_150540_4_) && l < p_150540_3_) + { + break; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMelon.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMelon.java new file mode 100644 index 0000000..510aae9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMelon.java @@ -0,0 +1,27 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenMelon extends WorldGenerator +{ + private static final String __OBFID = "CL_00000424"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 64; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (Blocks.melon_block.canPlaceBlockAt(p_76484_1_, i1, j1, k1) && p_76484_1_.getBlock(i1, j1 - 1, k1) == Blocks.grass) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.melon_block, 0, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMinable.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMinable.java new file mode 100644 index 0000000..8294621 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenMinable.java @@ -0,0 +1,90 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class WorldGenMinable extends WorldGenerator +{ + private Block field_150519_a; + /** The number of blocks to generate. */ + private int numberOfBlocks; + private Block field_150518_c; + private static final String __OBFID = "CL_00000426"; + private int mineableBlockMeta; + + public WorldGenMinable(Block p_i45459_1_, int p_i45459_2_) + { + this(p_i45459_1_, p_i45459_2_, Blocks.stone); + } + + public WorldGenMinable(Block p_i45460_1_, int p_i45460_2_, Block p_i45460_3_) + { + this.field_150519_a = p_i45460_1_; + this.numberOfBlocks = p_i45460_2_; + this.field_150518_c = p_i45460_3_; + } + + public WorldGenMinable(Block block, int meta, int number, Block target) + { + this(block, number, target); + this.mineableBlockMeta = meta; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + float f = p_76484_2_.nextFloat() * (float)Math.PI; + double d0 = (double)((float)(p_76484_3_ + 8) + MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F); + double d1 = (double)((float)(p_76484_3_ + 8) - MathHelper.sin(f) * (float)this.numberOfBlocks / 8.0F); + double d2 = (double)((float)(p_76484_5_ + 8) + MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F); + double d3 = (double)((float)(p_76484_5_ + 8) - MathHelper.cos(f) * (float)this.numberOfBlocks / 8.0F); + double d4 = (double)(p_76484_4_ + p_76484_2_.nextInt(3) - 2); + double d5 = (double)(p_76484_4_ + p_76484_2_.nextInt(3) - 2); + + for (int l = 0; l <= this.numberOfBlocks; ++l) + { + double d6 = d0 + (d1 - d0) * (double)l / (double)this.numberOfBlocks; + double d7 = d4 + (d5 - d4) * (double)l / (double)this.numberOfBlocks; + double d8 = d2 + (d3 - d2) * (double)l / (double)this.numberOfBlocks; + double d9 = p_76484_2_.nextDouble() * (double)this.numberOfBlocks / 16.0D; + double d10 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + double d11 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + int i1 = MathHelper.floor_double(d6 - d10 / 2.0D); + int j1 = MathHelper.floor_double(d7 - d11 / 2.0D); + int k1 = MathHelper.floor_double(d8 - d10 / 2.0D); + int l1 = MathHelper.floor_double(d6 + d10 / 2.0D); + int i2 = MathHelper.floor_double(d7 + d11 / 2.0D); + int j2 = MathHelper.floor_double(d8 + d10 / 2.0D); + + for (int k2 = i1; k2 <= l1; ++k2) + { + double d12 = ((double)k2 + 0.5D - d6) / (d10 / 2.0D); + + if (d12 * d12 < 1.0D) + { + for (int l2 = j1; l2 <= i2; ++l2) + { + double d13 = ((double)l2 + 0.5D - d7) / (d11 / 2.0D); + + if (d12 * d12 + d13 * d13 < 1.0D) + { + for (int i3 = k1; i3 <= j2; ++i3) + { + double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); + + if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && p_76484_1_.getBlock(k2, l2, i3).isReplaceableOreGen(p_76484_1_, k2, l2, i3, field_150518_c)) + { + p_76484_1_.setBlock(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); + } + } + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java new file mode 100644 index 0000000..1a97f20 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenPumpkin.java @@ -0,0 +1,27 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenPumpkin extends WorldGenerator +{ + private static final String __OBFID = "CL_00000428"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 64; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && p_76484_1_.getBlock(i1, j1 - 1, k1) == Blocks.grass && Blocks.pumpkin.canPlaceBlockAt(p_76484_1_, i1, j1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.pumpkin, p_76484_2_.nextInt(4), 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenReed.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenReed.java new file mode 100644 index 0000000..5d13009 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenReed.java @@ -0,0 +1,36 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenReed extends WorldGenerator +{ + private static final String __OBFID = "CL_00000429"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 20; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int j1 = p_76484_4_; + int k1 = p_76484_5_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + + if (p_76484_1_.isAirBlock(i1, p_76484_4_, k1) && (p_76484_1_.getBlock(i1 - 1, p_76484_4_ - 1, k1).getMaterial() == Material.water || p_76484_1_.getBlock(i1 + 1, p_76484_4_ - 1, k1).getMaterial() == Material.water || p_76484_1_.getBlock(i1, p_76484_4_ - 1, k1 - 1).getMaterial() == Material.water || p_76484_1_.getBlock(i1, p_76484_4_ - 1, k1 + 1).getMaterial() == Material.water)) + { + int l1 = 2 + p_76484_2_.nextInt(p_76484_2_.nextInt(3) + 1); + + for (int i2 = 0; i2 < l1; ++i2) + { + if (Blocks.reeds.canBlockStay(p_76484_1_, i1, j1 + i2, k1)) + { + p_76484_1_.setBlock(i1, j1 + i2, k1, Blocks.reeds, 0, 2); + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSand.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSand.java new file mode 100644 index 0000000..d7b4b73 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSand.java @@ -0,0 +1,58 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenSand extends WorldGenerator +{ + private Block field_150517_a; + /** The maximum radius used when generating a patch of blocks. */ + private int radius; + private static final String __OBFID = "CL_00000431"; + + public WorldGenSand(Block p_i45462_1_, int p_i45462_2_) + { + this.field_150517_a = p_i45462_1_; + this.radius = p_i45462_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_).getMaterial() != Material.water) + { + return false; + } + else + { + int l = p_76484_2_.nextInt(this.radius - 2) + 2; + byte b0 = 2; + + for (int i1 = p_76484_3_ - l; i1 <= p_76484_3_ + l; ++i1) + { + for (int j1 = p_76484_5_ - l; j1 <= p_76484_5_ + l; ++j1) + { + int k1 = i1 - p_76484_3_; + int l1 = j1 - p_76484_5_; + + if (k1 * k1 + l1 * l1 <= l * l) + { + for (int i2 = p_76484_4_ - b0; i2 <= p_76484_4_ + b0; ++i2) + { + Block block = p_76484_1_.getBlock(i1, i2, j1); + + if (block == Blocks.dirt || block == Blocks.grass) + { + p_76484_1_.setBlock(i1, i2, j1, this.field_150517_a, 0, 2); + } + } + } + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java new file mode 100644 index 0000000..058c2a3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSavannaTree.java @@ -0,0 +1,208 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenSavannaTree extends WorldGenAbstractTree +{ + private static final String __OBFID = "CL_00000432"; + + public WorldGenSavannaTree(boolean p_i45463_1_) + { + super(p_i45463_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(3) + p_76484_2_.nextInt(3) + 5; + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == p_76484_4_) + { + b0 = 0; + } + + if (i1 >= p_76484_4_ + 1 + l - 2) + { + b0 = 2; + } + + for (j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) + { + for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = p_76484_1_.getBlock(j1, i1, k1); + + if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block3 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block3.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block3.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4) - 1; + k1 = 3 - p_76484_2_.nextInt(3); + int k3 = p_76484_3_; + int l1 = p_76484_5_; + int i2 = 0; + int j2; + int k2; + + for (j2 = 0; j2 < l; ++j2) + { + k2 = p_76484_4_ + j2; + + if (j2 >= j1 && k1 > 0) + { + k3 += Direction.offsetX[j3]; + l1 += Direction.offsetZ[j3]; + --k1; + } + + Block block1 = p_76484_1_.getBlock(k3, k2, l1); + + if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, k3, k2, l1, Blocks.log2, 0); + i2 = k2; + } + } + + for (j2 = -1; j2 <= 1; ++j2) + { + for (k2 = -1; k2 <= 1; ++k2) + { + this.func_150525_a(p_76484_1_, k3 + j2, i2 + 1, l1 + k2); + } + } + + this.func_150525_a(p_76484_1_, k3 + 2, i2 + 1, l1); + this.func_150525_a(p_76484_1_, k3 - 2, i2 + 1, l1); + this.func_150525_a(p_76484_1_, k3, i2 + 1, l1 + 2); + this.func_150525_a(p_76484_1_, k3, i2 + 1, l1 - 2); + + for (j2 = -3; j2 <= 3; ++j2) + { + for (k2 = -3; k2 <= 3; ++k2) + { + if (Math.abs(j2) != 3 || Math.abs(k2) != 3) + { + this.func_150525_a(p_76484_1_, k3 + j2, i2, l1 + k2); + } + } + } + + k3 = p_76484_3_; + l1 = p_76484_5_; + j2 = p_76484_2_.nextInt(4); + + if (j2 != j3) + { + k2 = j1 - p_76484_2_.nextInt(2) - 1; + int l3 = 1 + p_76484_2_.nextInt(3); + i2 = 0; + int l2; + int i3; + + for (l2 = k2; l2 < l && l3 > 0; --l3) + { + if (l2 >= 1) + { + i3 = p_76484_4_ + l2; + k3 += Direction.offsetX[j2]; + l1 += Direction.offsetZ[j2]; + Block block2 = p_76484_1_.getBlock(k3, i3, l1); + + if (block2.isAir(p_76484_1_, k3, i3, l1) || block2.isLeaves(p_76484_1_, k3, i3, l1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, k3, i3, l1, Blocks.log2, 0); + i2 = i3; + } + } + + ++l2; + } + + if (i2 > 0) + { + for (l2 = -1; l2 <= 1; ++l2) + { + for (i3 = -1; i3 <= 1; ++i3) + { + this.func_150525_a(p_76484_1_, k3 + l2, i2 + 1, l1 + i3); + } + } + + for (l2 = -2; l2 <= 2; ++l2) + { + for (i3 = -2; i3 <= 2; ++i3) + { + if (Math.abs(l2) != 2 || Math.abs(i3) != 2) + { + this.func_150525_a(p_76484_1_, k3 + l2, i2, l1 + i3); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + private void func_150525_a(World p_150525_1_, int p_150525_2_, int p_150525_3_, int p_150525_4_) + { + Block block = p_150525_1_.getBlock(p_150525_2_, p_150525_3_, p_150525_4_); + + if (block.isAir(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_) || block.isLeaves(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_)) + { + this.setBlockAndNotifyAdequately(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.leaves2, 0); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenShrub.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenShrub.java new file mode 100644 index 0000000..e25d959 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenShrub.java @@ -0,0 +1,69 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenShrub extends WorldGenTrees +{ + private int field_150528_a; + private int field_150527_b; + private static final String __OBFID = "CL_00000411"; + + public WorldGenShrub(int p_i2015_1_, int p_i2015_2_) + { + super(false); + this.field_150527_b = p_i2015_1_; + this.field_150528_a = p_i2015_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + Block block; + + do + { + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } + --p_76484_4_; + } while (p_76484_4_ > 0); + + Block block1 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + + if (block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, ForgeDirection.UP, (IPlantable)Blocks.sapling)) + { + ++p_76484_4_; + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, Blocks.log, this.field_150527_b); + + for (int l = p_76484_4_; l <= p_76484_4_ + 2; ++l) + { + int i1 = l - p_76484_4_; + int j1 = 2 - i1; + + for (int k1 = p_76484_3_ - j1; k1 <= p_76484_3_ + j1; ++k1) + { + int l1 = k1 - p_76484_3_; + + for (int i2 = p_76484_5_ - j1; i2 <= p_76484_5_ + j1; ++i2) + { + int j2 = i2 - p_76484_5_; + + if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_76484_2_.nextInt(2) != 0) && p_76484_1_.getBlock(k1, l, i2).canBeReplacedByLeaves(p_76484_1_, k1, l, i2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, k1, l, i2, Blocks.leaves, this.field_150528_a); + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSpikes.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSpikes.java new file mode 100644 index 0000000..9b19a6a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSpikes.java @@ -0,0 +1,72 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityEnderCrystal; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenSpikes extends WorldGenerator +{ + private Block field_150520_a; + private static final String __OBFID = "CL_00000433"; + + public WorldGenSpikes(Block p_i45464_1_) + { + this.field_150520_a = p_i45464_1_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == this.field_150520_a) + { + int l = p_76484_2_.nextInt(32) + 6; + int i1 = p_76484_2_.nextInt(4) + 1; + int j1; + int k1; + int l1; + int i2; + + for (j1 = p_76484_3_ - i1; j1 <= p_76484_3_ + i1; ++j1) + { + for (k1 = p_76484_5_ - i1; k1 <= p_76484_5_ + i1; ++k1) + { + l1 = j1 - p_76484_3_; + i2 = k1 - p_76484_5_; + + if (l1 * l1 + i2 * i2 <= i1 * i1 + 1 && p_76484_1_.getBlock(j1, p_76484_4_ - 1, k1) != this.field_150520_a) + { + return false; + } + } + } + + for (j1 = p_76484_4_; j1 < p_76484_4_ + l && j1 < 256; ++j1) + { + for (k1 = p_76484_3_ - i1; k1 <= p_76484_3_ + i1; ++k1) + { + for (l1 = p_76484_5_ - i1; l1 <= p_76484_5_ + i1; ++l1) + { + i2 = k1 - p_76484_3_; + int j2 = l1 - p_76484_5_; + + if (i2 * i2 + j2 * j2 <= i1 * i1 + 1) + { + p_76484_1_.setBlock(k1, j1, l1, Blocks.obsidian, 0, 2); + } + } + } + } + + EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(p_76484_1_); + entityendercrystal.setLocationAndAngles((double)((float)p_76484_3_ + 0.5F), (double)(p_76484_4_ + l), (double)((float)p_76484_5_ + 0.5F), p_76484_2_.nextFloat() * 360.0F, 0.0F); + p_76484_1_.spawnEntityInWorld(entityendercrystal); + p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + l, p_76484_5_, Blocks.bedrock, 0, 2); + return true; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSwamp.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSwamp.java new file mode 100644 index 0000000..cbfe696 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenSwamp.java @@ -0,0 +1,195 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenSwamp extends WorldGenAbstractTree +{ + private static final String __OBFID = "CL_00000436"; + + public WorldGenSwamp() + { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l; + + for (l = p_76484_2_.nextInt(4) + 5; p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_).getMaterial() == Material.water; --p_76484_4_) + { + ; + } + + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == p_76484_4_) + { + b0 = 0; + } + + if (i1 >= p_76484_4_ + 1 + l - 2) + { + b0 = 3; + } + + for (j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) + { + for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = p_76484_1_.getBlock(j1, i1, k1); + + if (!(block.isAir(p_76484_1_, j1, i1, k1) || block.isLeaves(p_76484_1_, j1, i1, k1))) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { + flag = false; + } + else if (i1 > p_76484_4_) + { + flag = false; + } + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int l1; + int k2; + int l2; + + for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) + { + j1 = k2 - (p_76484_4_ + l); + k1 = 2 - j1 / 2; + + for (l2 = p_76484_3_ - k1; l2 <= p_76484_3_ + k1; ++l2) + { + l1 = l2 - p_76484_3_; + + for (int i2 = p_76484_5_ - k1; i2 <= p_76484_5_ + k1; ++i2) + { + int j2 = i2 - p_76484_5_; + + if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) && p_76484_1_.getBlock(l2, k2, i2).canBeReplacedByLeaves(p_76484_1_, l2, k2, i2)) + { + this.func_150515_a(p_76484_1_, l2, k2, i2, Blocks.leaves); + } + } + } + } + + for (k2 = 0; k2 < l; ++k2) + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + + if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2 == Blocks.flowing_water || block2 == Blocks.water) + { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.log); + } + } + + for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) + { + j1 = k2 - (p_76484_4_ + l); + k1 = 2 - j1 / 2; + + for (l2 = p_76484_3_ - k1; l2 <= p_76484_3_ + k1; ++l2) + { + for (l1 = p_76484_5_ - k1; l1 <= p_76484_5_ + k1; ++l1) + { + if (p_76484_1_.getBlock(l2, k2, l1).isLeaves(p_76484_1_, l2, k2, l1)) + { + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(l2 - 1, k2, l1).isAir(p_76484_1_, l2 - 1, k2, l1)) + { + this.generateVines(p_76484_1_, l2 - 1, k2, l1, 8); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(l2 + 1, k2, l1).isAir(p_76484_1_, l2 + 1, k2, l1)) + { + this.generateVines(p_76484_1_, l2 + 1, k2, l1, 2); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(l2, k2, l1 - 1).isAir(p_76484_1_, l2, k2, l1 - 1)) + { + this.generateVines(p_76484_1_, l2, k2, l1 - 1, 1); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(l2, k2, l1 + 1).isAir(p_76484_1_, l2, k2, l1 + 1)) + { + this.generateVines(p_76484_1_, l2, k2, l1 + 1, 4); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + /** + * Generates vines at the given position until it hits a block. + */ + private void generateVines(World p_76536_1_, int p_76536_2_, int p_76536_3_, int p_76536_4_, int p_76536_5_) + { + this.setBlockAndNotifyAdequately(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_, Blocks.vine, p_76536_5_); + int i1 = 4; + + while (true) + { + --p_76536_3_; + + if (!(p_76536_1_.getBlock(p_76536_2_, p_76536_3_, p_76536_4_).isAir(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_)) || i1 <= 0) + { + return; + } + + this.setBlockAndNotifyAdequately(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_, Blocks.vine, p_76536_5_); + --i1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java new file mode 100644 index 0000000..8c61ec6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga1.java @@ -0,0 +1,132 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenTaiga1 extends WorldGenAbstractTree +{ + private static final String __OBFID = "CL_00000427"; + + public WorldGenTaiga1() + { + super(false); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(5) + 7; + int i1 = l - p_76484_2_.nextInt(2) - 3; + int j1 = l - i1; + int k1 = 1 + p_76484_2_.nextInt(j1 + 1); + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int i2; + int j2; + int i3; + + for (int l1 = p_76484_4_; l1 <= p_76484_4_ + 1 + l && flag; ++l1) + { + boolean flag1 = true; + + if (l1 - p_76484_4_ < i1) + { + i3 = 0; + } + else + { + i3 = k1; + } + + for (i2 = p_76484_3_ - i3; i2 <= p_76484_3_ + i3 && flag; ++i2) + { + for (j2 = p_76484_5_ - i3; j2 <= p_76484_5_ + i3 && flag; ++j2) + { + if (l1 >= 0 && l1 < 256) + { + Block block = p_76484_1_.getBlock(i2, l1, j2); + + if (!this.isReplaceable(p_76484_1_, i2, l1, j2)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + i3 = 0; + + for (i2 = p_76484_4_ + l; i2 >= p_76484_4_ + i1; --i2) + { + for (j2 = p_76484_3_ - i3; j2 <= p_76484_3_ + i3; ++j2) + { + int j3 = j2 - p_76484_3_; + + for (int k2 = p_76484_5_ - i3; k2 <= p_76484_5_ + i3; ++k2) + { + int l2 = k2 - p_76484_5_; + + if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && p_76484_1_.getBlock(j2, i2, k2).canBeReplacedByLeaves(p_76484_1_, j2, i2, k2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, j2, i2, k2, Blocks.leaves, 1); + } + } + } + + if (i3 >= 1 && i2 == p_76484_4_ + i1 + 1) + { + --i3; + } + else if (i3 < k1) + { + ++i3; + } + } + + for (i2 = 0; i2 < l - 1; ++i2) + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + i2, p_76484_5_); + + if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_, Blocks.log, 1); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java new file mode 100644 index 0000000..0b3fa04 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTaiga2.java @@ -0,0 +1,146 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenTaiga2 extends WorldGenAbstractTree +{ + private static final String __OBFID = "CL_00000435"; + + public WorldGenTaiga2(boolean p_i2025_1_) + { + super(p_i2025_1_); + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(4) + 6; + int i1 = 1 + p_76484_2_.nextInt(2); + int j1 = l - i1; + int k1 = 2 + p_76484_2_.nextInt(2); + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + int i2; + int l3; + + for (int l1 = p_76484_4_; l1 <= p_76484_4_ + 1 + l && flag; ++l1) + { + boolean flag1 = true; + + if (l1 - p_76484_4_ < i1) + { + l3 = 0; + } + else + { + l3 = k1; + } + + for (i2 = p_76484_3_ - l3; i2 <= p_76484_3_ + l3 && flag; ++i2) + { + for (int j2 = p_76484_5_ - l3; j2 <= p_76484_5_ + l3 && flag; ++j2) + { + if (l1 >= 0 && l1 < 256) + { + Block block = p_76484_1_.getBlock(i2, l1, j2); + + if (!block.isAir(p_76484_1_, i2, l1, j2) && !block.isLeaves(p_76484_1_, i2, l1, j2)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + l3 = p_76484_2_.nextInt(2); + i2 = 1; + byte b0 = 0; + int k2; + int i4; + + for (i4 = 0; i4 <= j1; ++i4) + { + k2 = p_76484_4_ + l - i4; + + for (int l2 = p_76484_3_ - l3; l2 <= p_76484_3_ + l3; ++l2) + { + int i3 = l2 - p_76484_3_; + + for (int j3 = p_76484_5_ - l3; j3 <= p_76484_5_ + l3; ++j3) + { + int k3 = j3 - p_76484_5_; + + if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && p_76484_1_.getBlock(l2, k2, j3).canBeReplacedByLeaves(p_76484_1_, l2, k2, j3)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, l2, k2, j3, Blocks.leaves, 1); + } + } + } + + if (l3 >= i2) + { + l3 = b0; + b0 = 1; + ++i2; + + if (i2 > k1) + { + i2 = k1; + } + } + else + { + ++l3; + } + } + + i4 = p_76484_2_.nextInt(3); + + for (k2 = 0; k2 < l - i4; ++k2) + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + + if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.log, 1); + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java new file mode 100644 index 0000000..b68a0b5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTallGrass.java @@ -0,0 +1,48 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.world.World; + +public class WorldGenTallGrass extends WorldGenerator +{ + private Block field_150522_a; + private int tallGrassMetadata; + private static final String __OBFID = "CL_00000437"; + + public WorldGenTallGrass(Block p_i45466_1_, int p_i45466_2_) + { + this.field_150522_a = p_i45466_1_; + this.tallGrassMetadata = p_i45466_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + Block block; + + do + { + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) + { + break; + } + --p_76484_4_; + } while (p_76484_4_ > 0); + + for (int l = 0; l < 128; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && this.field_150522_a.canBlockStay(p_76484_1_, i1, j1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, this.field_150522_a, this.tallGrassMetadata, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTrees.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTrees.java new file mode 100644 index 0000000..06905ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenTrees.java @@ -0,0 +1,250 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenTrees extends WorldGenAbstractTree +{ + /** The minimum height of a generated tree. */ + private final int minTreeHeight; + /** True if this tree should grow Vines. */ + private final boolean vinesGrow; + /** The metadata value of the wood to use in tree generation. */ + private final int metaWood; + /** The metadata value of the leaves to use in tree generation. */ + private final int metaLeaves; + private static final String __OBFID = "CL_00000438"; + + public WorldGenTrees(boolean p_i2027_1_) + { + this(p_i2027_1_, 4, 0, 0, false); + } + + public WorldGenTrees(boolean p_i2028_1_, int p_i2028_2_, int p_i2028_3_, int p_i2028_4_, boolean p_i2028_5_) + { + super(p_i2028_1_); + this.minTreeHeight = p_i2028_2_; + this.metaWood = p_i2028_3_; + this.metaLeaves = p_i2028_4_; + this.vinesGrow = p_i2028_5_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_2_.nextInt(3) + this.minTreeHeight; + boolean flag = true; + + if (p_76484_4_ >= 1 && p_76484_4_ + l + 1 <= 256) + { + byte b0; + int k1; + Block block; + + for (int i1 = p_76484_4_; i1 <= p_76484_4_ + 1 + l; ++i1) + { + b0 = 1; + + if (i1 == p_76484_4_) + { + b0 = 0; + } + + if (i1 >= p_76484_4_ + 1 + l - 2) + { + b0 = 2; + } + + for (int j1 = p_76484_3_ - b0; j1 <= p_76484_3_ + b0 && flag; ++j1) + { + for (k1 = p_76484_5_ - b0; k1 <= p_76484_5_ + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + block = p_76484_1_.getBlock(j1, i1, k1); + + if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block2 = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + + boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && p_76484_4_ < 256 - l - 1) + { + block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + b0 = 3; + byte b1 = 0; + int l1; + int i2; + int j2; + int i3; + + for (k1 = p_76484_4_ - b0 + l; k1 <= p_76484_4_ + l; ++k1) + { + i3 = k1 - (p_76484_4_ + l); + l1 = b1 + 1 - i3 / 2; + + for (i2 = p_76484_3_ - l1; i2 <= p_76484_3_ + l1; ++i2) + { + j2 = i2 - p_76484_3_; + + for (int k2 = p_76484_5_ - l1; k2 <= p_76484_5_ + l1; ++k2) + { + int l2 = k2 - p_76484_5_; + + if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || p_76484_2_.nextInt(2) != 0 && i3 != 0) + { + Block block1 = p_76484_1_.getBlock(i2, k1, k2); + + if (block1.isAir(p_76484_1_, i2, k1, k2) || block1.isLeaves(p_76484_1_, i2, k1, k2)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, i2, k1, k2, Blocks.leaves, this.metaLeaves); + } + } + } + } + } + + for (k1 = 0; k1 < l; ++k1) + { + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_ + k1, p_76484_5_); + + if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Blocks.log, this.metaWood); + + if (this.vinesGrow && k1 > 0) + { + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ - 1, p_76484_4_ + k1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ - 1, p_76484_4_ + k1, p_76484_5_, Blocks.vine, 8); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_ + 1, p_76484_4_ + k1, p_76484_5_)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + k1, p_76484_5_, Blocks.vine, 2); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + k1, p_76484_5_ - 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_ - 1, Blocks.vine, 1); + } + + if (p_76484_2_.nextInt(3) > 0 && p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_ + k1, p_76484_5_ + 1)) + { + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_ + 1, Blocks.vine, 4); + } + } + } + } + + if (this.vinesGrow) + { + for (k1 = p_76484_4_ - 3 + l; k1 <= p_76484_4_ + l; ++k1) + { + i3 = k1 - (p_76484_4_ + l); + l1 = 2 - i3 / 2; + + for (i2 = p_76484_3_ - l1; i2 <= p_76484_3_ + l1; ++i2) + { + for (j2 = p_76484_5_ - l1; j2 <= p_76484_5_ + l1; ++j2) + { + if (p_76484_1_.getBlock(i2, k1, j2).isLeaves(p_76484_1_, i2, k1, j2)) + { + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(i2 - 1, k1, j2).isAir(p_76484_1_, i2 - 1, k1, j2)) + { + this.growVines(p_76484_1_, i2 - 1, k1, j2, 8); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(i2 + 1, k1, j2).isAir(p_76484_1_, i2 + 1, k1, j2)) + { + this.growVines(p_76484_1_, i2 + 1, k1, j2, 2); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(i2, k1, j2 - 1).isAir(p_76484_1_, i2, k1, j2 - 1)) + { + this.growVines(p_76484_1_, i2, k1, j2 - 1, 1); + } + + if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.getBlock(i2, k1, j2 + 1).isAir(p_76484_1_, i2, k1, j2 + 1)) + { + this.growVines(p_76484_1_, i2, k1, j2 + 1, 4); + } + } + } + } + } + + if (p_76484_2_.nextInt(5) == 0 && l > 5) + { + for (k1 = 0; k1 < 2; ++k1) + { + for (i3 = 0; i3 < 4; ++i3) + { + if (p_76484_2_.nextInt(4 - k1) == 0) + { + l1 = p_76484_2_.nextInt(3); + this.setBlockAndNotifyAdequately(p_76484_1_, p_76484_3_ + Direction.offsetX[Direction.rotateOpposite[i3]], p_76484_4_ + l - 5 + k1, p_76484_5_ + Direction.offsetZ[Direction.rotateOpposite[i3]], Blocks.cocoa, l1 << 2 | i3); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + /** + * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length + */ + private void growVines(World p_76529_1_, int p_76529_2_, int p_76529_3_, int p_76529_4_, int p_76529_5_) + { + this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_); + int i1 = 4; + + while (true) + { + --p_76529_3_; + + if (!p_76529_1_.getBlock(p_76529_2_, p_76529_3_, p_76529_4_).isAir(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_) || i1 <= 0) + { + return; + } + + this.setBlockAndNotifyAdequately(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_, Blocks.vine, p_76529_5_); + --i1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenVines.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenVines.java new file mode 100644 index 0000000..e5b5bbb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenVines.java @@ -0,0 +1,39 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.util.Facing; +import net.minecraft.world.World; + +public class WorldGenVines extends WorldGenerator +{ + private static final String __OBFID = "CL_00000439"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + int l = p_76484_3_; + + for (int i1 = p_76484_5_; p_76484_4_ < 128; ++p_76484_4_) + { + if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_)) + { + for (int j1 = 2; j1 <= 5; ++j1) + { + if (Blocks.vine.canPlaceBlockOnSide(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, j1)) + { + p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.vine, 1 << Direction.facingToDirection[Facing.oppositeSide[j1]], 2); + break; + } + } + } + else + { + p_76484_3_ = l + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + p_76484_5_ = i1 + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java new file mode 100644 index 0000000..57ca2bb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenWaterlily.java @@ -0,0 +1,27 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class WorldGenWaterlily extends WorldGenerator +{ + private static final String __OBFID = "CL_00000189"; + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + for (int l = 0; l < 10; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + int j1 = p_76484_4_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int k1 = p_76484_5_ + p_76484_2_.nextInt(8) - p_76484_2_.nextInt(8); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && Blocks.waterlily.canPlaceBlockAt(p_76484_1_, i1, j1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.waterlily, 0, 2); + } + } + + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenerator.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenerator.java new file mode 100644 index 0000000..8e889ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGenerator.java @@ -0,0 +1,49 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.world.World; + +public abstract class WorldGenerator +{ + /** + * Sets wither or not the generator should notify blocks of blocks it changes. When the world is first generated, + * this is false, when saplings grow, this is true. + */ + private final boolean doBlockNotify; + private static final String __OBFID = "CL_00000409"; + + public WorldGenerator() + { + this.doBlockNotify = false; + } + + public WorldGenerator(boolean p_i2013_1_) + { + this.doBlockNotify = p_i2013_1_; + } + + public abstract boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_); + + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + public void setScale(double p_76487_1_, double p_76487_3_, double p_76487_5_) {} + + protected void func_150515_a(World p_150515_1_, int p_150515_2_, int p_150515_3_, int p_150515_4_, Block p_150515_5_) + { + this.setBlockAndNotifyAdequately(p_150515_1_, p_150515_2_, p_150515_3_, p_150515_4_, p_150515_5_, 0); + } + + protected void setBlockAndNotifyAdequately(World p_150516_1_, int p_150516_2_, int p_150516_3_, int p_150516_4_, Block p_150516_5_, int p_150516_6_) + { + if (this.doBlockNotify) + { + p_150516_1_.setBlock(p_150516_2_, p_150516_3_, p_150516_4_, p_150516_5_, p_150516_6_, 3); + } + else + { + p_150516_1_.setBlock(p_150516_2_, p_150516_3_, p_150516_4_, p_150516_5_, p_150516_6_, 2); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java new file mode 100644 index 0000000..b0fadd7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java @@ -0,0 +1,87 @@ +package net.minecraft.world.gen.feature; + +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class WorldGeneratorBonusChest extends WorldGenerator +{ + /** Instance of WeightedRandomChestContent what will randomly generate items into the Bonus Chest. */ + private final WeightedRandomChestContent[] theBonusChestGenerator; + /** Value of this int will determine how much items gonna generate in Bonus Chest. */ + private final int itemsToGenerateInBonusChest; + private static final String __OBFID = "CL_00000403"; + + public WorldGeneratorBonusChest(WeightedRandomChestContent[] p_i2010_1_, int p_i2010_2_) + { + this.theBonusChestGenerator = p_i2010_1_; + this.itemsToGenerateInBonusChest = p_i2010_2_; + } + + public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + Block block; + + do + { + block = p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_); + if (!block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) && !block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_)) break; + p_76484_4_--; + } while (p_76484_4_ > 1); + + if (p_76484_4_ < 1) + { + return false; + } + else + { + ++p_76484_4_; + + for (int l = 0; l < 4; ++l) + { + int i1 = p_76484_3_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + int j1 = p_76484_4_ + p_76484_2_.nextInt(3) - p_76484_2_.nextInt(3); + int k1 = p_76484_5_ + p_76484_2_.nextInt(4) - p_76484_2_.nextInt(4); + + if (p_76484_1_.isAirBlock(i1, j1, k1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, i1, j1 - 1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1, Blocks.chest, 0, 2); + TileEntityChest tileentitychest = (TileEntityChest)p_76484_1_.getTileEntity(i1, j1, k1); + + if (tileentitychest != null && tileentitychest != null) + { + WeightedRandomChestContent.generateChestContents(p_76484_2_, this.theBonusChestGenerator, tileentitychest, this.itemsToGenerateInBonusChest); + } + + if (p_76484_1_.isAirBlock(i1 - 1, j1, k1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, i1 - 1, j1 - 1, k1)) + { + p_76484_1_.setBlock(i1 - 1, j1, k1, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(i1 + 1, j1, k1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, i1 - 1, j1 - 1, k1)) + { + p_76484_1_.setBlock(i1 + 1, j1, k1, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(i1, j1, k1 - 1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, i1 - 1, j1 - 1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1 - 1, Blocks.torch, 0, 2); + } + + if (p_76484_1_.isAirBlock(i1, j1, k1 + 1) && World.doesBlockHaveSolidTopSurface(p_76484_1_, i1 - 1, j1 - 1, k1)) + { + p_76484_1_.setBlock(i1, j1, k1 + 1, Blocks.torch, 0, 2); + } + + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayer.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayer.java new file mode 100644 index 0000000..6f5e651 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayer.java @@ -0,0 +1,265 @@ +package net.minecraft.world.gen.layer; + +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.util.ReportedException; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; + +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.*; + +public abstract class GenLayer +{ + /** seed from World#getWorldSeed that is used in the LCG prng */ + private long worldGenSeed; + /** parent GenLayer that was provided via the constructor */ + protected GenLayer parent; + /** + * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate + * pseudorandom numbers + */ + private long chunkSeed; + /** base seed to the LCG prng provided via the constructor */ + protected long baseSeed; + private static final String __OBFID = "CL_00000559"; + + /** + * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the + * first. + */ + public static GenLayer[] initializeAllBiomeGenerators(long p_75901_0_, WorldType p_75901_2_) + { + boolean flag = false; + GenLayerIsland genlayerisland = new GenLayerIsland(1L); + GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland); + GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom); + GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland); + genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom); + genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland); + genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland); + GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland); + GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean); + genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddsnow); + GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, GenLayerEdge.Mode.COOL_WARM); + genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE); + genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL); + genlayerzoom = new GenLayerZoom(2002L, genlayeredge); + genlayerzoom = new GenLayerZoom(2003L, genlayerzoom); + genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom); + GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland); + GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland); + GenLayer genlayer2 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0); + byte b0 = 4; + + if (p_75901_2_ == WorldType.LARGE_BIOMES) + { + b0 = 6; + } + + if (flag) + { + b0 = 4; + } + b0 = getModdedBiomeSize(p_75901_2_, b0); + + GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer2, 0); + GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer); + Object object = p_75901_2_.getBiomeLayer(p_75901_0_, genlayer2); + + GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1); + genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2); + genlayer = GenLayerZoom.magnify(1000L, genlayer, b0); + GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer); + GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver); + object = new GenLayerRareBiome(1001L, genlayerhills); + + for (int j = 0; j < b0; ++j) + { + object = new GenLayerZoom((long)(1000 + j), (GenLayer)object); + + if (j == 0) + { + object = new GenLayerAddIsland(3L, (GenLayer)object); + } + + if (j == 1) + { + object = new GenLayerShore(1000L, (GenLayer)object); + } + } + + GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayer)object); + GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth); + GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, genlayerrivermix); + genlayerrivermix.initWorldGenSeed(p_75901_0_); + genlayervoronoizoom.initWorldGenSeed(p_75901_0_); + return new GenLayer[] {genlayerrivermix, genlayervoronoizoom, genlayerrivermix}; + } + + public GenLayer(long p_i2125_1_) + { + this.baseSeed = p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; + this.baseSeed += p_i2125_1_; + } + + /** + * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long p_75905_1_) + { + this.worldGenSeed = p_75905_1_; + + if (this.parent != null) + { + this.parent.initWorldGenSeed(p_75905_1_); + } + + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; + this.worldGenSeed += this.baseSeed; + } + + /** + * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates. + */ + public void initChunkSeed(long p_75903_1_, long p_75903_3_) + { + this.chunkSeed = this.worldGenSeed; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_1_; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += p_75903_3_; + } + + /** + * returns a LCG pseudo random number from [0, x). Args: int x + */ + protected int nextInt(int p_75902_1_) + { + int j = (int)((this.chunkSeed >> 24) % (long)p_75902_1_); + + if (j < 0) + { + j += p_75902_1_; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += this.worldGenSeed; + return j; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public abstract int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight); + + /** + * returns true if the biomeIDs are equal, or returns the result of the comparison as per BiomeGenBase.isEqualTo + */ + protected static boolean compareBiomesById(final int biomeIDA, final int biomeIDB) + { + if (biomeIDA == biomeIDB) + { + return true; + } + else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID) + { + try + { + return BiomeGenBase.getBiome(biomeIDA) != null && BiomeGenBase.getBiome(biomeIDB) != null ? BiomeGenBase.getBiome(biomeIDA).isEqualTo(BiomeGenBase.getBiome(biomeIDB)) : false; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Comparing biomes"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Biomes being compared"); + crashreportcategory.addCrashSection("Biome A ID", Integer.valueOf(biomeIDA)); + crashreportcategory.addCrashSection("Biome B ID", Integer.valueOf(biomeIDB)); + crashreportcategory.addCrashSectionCallable("Biome A", new Callable() + { + private static final String __OBFID = "CL_00000560"; + public String call() + { + return String.valueOf(BiomeGenBase.getBiome(biomeIDA)); + } + }); + crashreportcategory.addCrashSectionCallable("Biome B", new Callable() + { + private static final String __OBFID = "CL_00000561"; + public String call() + { + return String.valueOf(BiomeGenBase.getBiome(biomeIDB)); + } + }); + throw new ReportedException(crashreport); + } + } + else + { + return biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID; + } + } + + /** + * returns true if the biomeId is one of the various ocean biomes. + */ + protected static boolean isBiomeOceanic(int p_151618_0_) + { + return BiomeManager.oceanBiomes.contains(BiomeGenBase.getBiome(p_151618_0_)); + } + + /** + * selects a random integer from a set of provided integers + */ + protected int selectRandom(int ... p_151619_1_) + { + return p_151619_1_[this.nextInt(p_151619_1_.length)]; + } + + /** + * returns the most frequently occurring number of the set, or a random number from those provided + */ + protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) + { + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); + } + + /* ======================================== FORGE START =====================================*/ + protected long nextLong(long par1) + { + long j = (this.chunkSeed >> 24) % par1; + + if (j < 0) + { + j += par1; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; + this.chunkSeed += this.worldGenSeed; + return j; + } + + public static byte getModdedBiomeSize(WorldType worldType, byte original) + { + WorldTypeEvent.BiomeSize event = new WorldTypeEvent.BiomeSize(worldType, original); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.newSize; + } + /* ========================================= FORGE END ======================================*/ +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java new file mode 100644 index 0000000..83ad7f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddIsland.java @@ -0,0 +1,102 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddIsland extends GenLayer +{ + private static final String __OBFID = "CL_00000551"; + + public GenLayerAddIsland(long p_i2119_1_, GenLayer p_i2119_3_) + { + super(p_i2119_1_); + this.parent = p_i2119_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 0 + (i2 + 0) * k1]; + int l2 = aint[j2 + 2 + (i2 + 0) * k1]; + int i3 = aint[j2 + 0 + (i2 + 2) * k1]; + int j3 = aint[j2 + 2 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long)(j2 + areaX), (long)(i2 + areaY)); + + if (k3 == 0 && (k2 != 0 || l2 != 0 || i3 != 0 || j3 != 0)) + { + int l3 = 1; + int i4 = 1; + + if (k2 != 0 && this.nextInt(l3++) == 0) + { + i4 = k2; + } + + if (l2 != 0 && this.nextInt(l3++) == 0) + { + i4 = l2; + } + + if (i3 != 0 && this.nextInt(l3++) == 0) + { + i4 = i3; + } + + if (j3 != 0 && this.nextInt(l3++) == 0) + { + i4 = j3; + } + + if (this.nextInt(3) == 0) + { + aint1[j2 + i2 * areaWidth] = i4; + } + else if (i4 == 4) + { + aint1[j2 + i2 * areaWidth] = 4; + } + else + { + aint1[j2 + i2 * areaWidth] = 0; + } + } + else if (k3 > 0 && (k2 == 0 || l2 == 0 || i3 == 0 || j3 == 0)) + { + if (this.nextInt(5) == 0) + { + if (k3 == 4) + { + aint1[j2 + i2 * areaWidth] = 4; + } + else + { + aint1[j2 + i2 * areaWidth] = 0; + } + } + else + { + aint1[j2 + i2 * areaWidth] = k3; + } + } + else + { + aint1[j2 + i2 * areaWidth] = k3; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java new file mode 100644 index 0000000..98c1390 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddMushroomIsland.java @@ -0,0 +1,52 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerAddMushroomIsland extends GenLayer +{ + private static final String __OBFID = "CL_00000552"; + + public GenLayerAddMushroomIsland(long p_i2120_1_, GenLayer p_i2120_3_) + { + super(p_i2120_1_); + this.parent = p_i2120_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 0 + (i2 + 0) * k1]; + int l2 = aint[j2 + 2 + (i2 + 0) * k1]; + int i3 = aint[j2 + 0 + (i2 + 2) * k1]; + int j3 = aint[j2 + 2 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long)(j2 + areaX), (long)(i2 + areaY)); + + if (k3 == 0 && k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0 && this.nextInt(100) == 0) + { + aint1[j2 + i2 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; + } + else + { + aint1[j2 + i2 * areaWidth] = k3; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java new file mode 100644 index 0000000..434e515 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerAddSnow.java @@ -0,0 +1,62 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerAddSnow extends GenLayer +{ + private static final String __OBFID = "CL_00000553"; + + public GenLayerAddSnow(long p_i2121_1_, GenLayer p_i2121_3_) + { + super(p_i2121_1_); + this.parent = p_i2121_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 1 + (i2 + 1) * k1]; + this.initChunkSeed((long)(j2 + areaX), (long)(i2 + areaY)); + + if (k2 == 0) + { + aint1[j2 + i2 * areaWidth] = 0; + } + else + { + int l2 = this.nextInt(6); + byte b0; + + if (l2 == 0) + { + b0 = 4; + } + else if (l2 <= 1) + { + b0 = 3; + } + else + { + b0 = 1; + } + + aint1[j2 + i2 * areaWidth] = b0; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiome.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiome.java new file mode 100644 index 0000000..28cd0ec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiome.java @@ -0,0 +1,139 @@ +package net.minecraft.world.gen.layer; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeManager; +import net.minecraftforge.common.BiomeManager.BiomeEntry; + +public class GenLayerBiome extends GenLayer +{ + private List[] biomes = new ArrayList[BiomeManager.BiomeType.values().length]; + + private static final String __OBFID = "CL_00000555"; + + public GenLayerBiome(long p_i2122_1_, GenLayer p_i2122_3_, WorldType p_i2122_4_) + { + super(p_i2122_1_); + + this.parent = p_i2122_3_; + + for (BiomeManager.BiomeType type : BiomeManager.BiomeType.values()) + { + com.google.common.collect.ImmutableList biomesToAdd = BiomeManager.getBiomes(type); + int idx = type.ordinal(); + + if (biomes[idx] == null) biomes[idx] = new ArrayList(); + if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd); + } + + int desertIdx = BiomeManager.BiomeType.DESERT.ordinal(); + + if (p_i2122_4_ == WorldType.DEFAULT_1_1) + { + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.desert, 10)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.forest, 10)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.extremeHills, 10)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.swampland, 10)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.plains, 10)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.taiga, 10)); + } + else + { + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.desert, 30)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.savanna, 20)); + biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.plains, 10)); + } + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + int k1 = aint[j1 + i1 * areaWidth]; + int l1 = (k1 & 3840) >> 8; + k1 &= -3841; + + if (isBiomeOceanic(k1)) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else if (k1 == BiomeGenBase.mushroomIsland.biomeID) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else if (k1 == 1) + { + if (l1 > 0) + { + if (this.nextInt(3) == 0) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.mesaPlateau.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.mesaPlateau_F.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = getWeightedBiomeEntry(BiomeManager.BiomeType.DESERT).biome.biomeID; + } + } + else if (k1 == 2) + { + if (l1 > 0) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.jungle.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = getWeightedBiomeEntry(BiomeManager.BiomeType.WARM).biome.biomeID; + } + } + else if (k1 == 3) + { + if (l1 > 0) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.megaTaiga.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = getWeightedBiomeEntry(BiomeManager.BiomeType.COOL).biome.biomeID; + } + } + else if (k1 == 4) + { + aint1[j1 + i1 * areaWidth] = getWeightedBiomeEntry(BiomeManager.BiomeType.ICY).biome.biomeID; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID; + } + } + } + + return aint1; + } + + protected BiomeEntry getWeightedBiomeEntry(BiomeManager.BiomeType type) + { + List biomeList = biomes[type.ordinal()]; + int totalWeight = WeightedRandom.getTotalWeight(biomeList); + int weight = BiomeManager.isTypeListModded(type)?nextInt(totalWeight):nextInt(totalWeight / 10) * 10; + return (BiomeEntry)WeightedRandom.getItem(biomeList, weight); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java new file mode 100644 index 0000000..2693c1a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerBiomeEdge.java @@ -0,0 +1,157 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerBiomeEdge extends GenLayer +{ + private static final String __OBFID = "CL_00000554"; + + public GenLayerBiomeEdge(long p_i45475_1_, GenLayer p_i45475_3_) + { + super(p_i45475_1_); + this.parent = p_i45475_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + int k1 = aint[j1 + 1 + (i1 + 1) * (areaWidth + 2)]; + + if (!this.func_151636_a(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.extremeHills.biomeID, BiomeGenBase.extremeHillsEdge.biomeID) && !this.func_151635_b(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.mesaPlateau_F.biomeID, BiomeGenBase.mesa.biomeID) && !this.func_151635_b(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.mesaPlateau.biomeID, BiomeGenBase.mesa.biomeID) && !this.func_151635_b(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.megaTaiga.biomeID, BiomeGenBase.taiga.biomeID)) + { + int l1; + int i2; + int j2; + int k2; + + if (k1 == BiomeGenBase.desert.biomeID) + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (l1 != BiomeGenBase.icePlains.biomeID && i2 != BiomeGenBase.icePlains.biomeID && j2 != BiomeGenBase.icePlains.biomeID && k2 != BiomeGenBase.icePlains.biomeID) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.extremeHillsPlus.biomeID; + } + } + else if (k1 == BiomeGenBase.swampland.biomeID) + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (l1 != BiomeGenBase.desert.biomeID && i2 != BiomeGenBase.desert.biomeID && j2 != BiomeGenBase.desert.biomeID && k2 != BiomeGenBase.desert.biomeID && l1 != BiomeGenBase.coldTaiga.biomeID && i2 != BiomeGenBase.coldTaiga.biomeID && j2 != BiomeGenBase.coldTaiga.biomeID && k2 != BiomeGenBase.coldTaiga.biomeID && l1 != BiomeGenBase.icePlains.biomeID && i2 != BiomeGenBase.icePlains.biomeID && j2 != BiomeGenBase.icePlains.biomeID && k2 != BiomeGenBase.icePlains.biomeID) + { + if (l1 != BiomeGenBase.jungle.biomeID && k2 != BiomeGenBase.jungle.biomeID && i2 != BiomeGenBase.jungle.biomeID && j2 != BiomeGenBase.jungle.biomeID) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.jungleEdge.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.plains.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k1; + } + } + } + } + + return aint1; + } + + private boolean func_151636_a(int[] p_151636_1_, int[] p_151636_2_, int p_151636_3_, int p_151636_4_, int p_151636_5_, int p_151636_6_, int p_151636_7_, int p_151636_8_) + { + if (!compareBiomesById(p_151636_6_, p_151636_7_)) + { + return false; + } + else + { + int k1 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 - 1) * (p_151636_5_ + 2)]; + int l1 = p_151636_1_[p_151636_3_ + 1 + 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int i2 = p_151636_1_[p_151636_3_ + 1 - 1 + (p_151636_4_ + 1) * (p_151636_5_ + 2)]; + int j2 = p_151636_1_[p_151636_3_ + 1 + (p_151636_4_ + 1 + 1) * (p_151636_5_ + 2)]; + + if (this.func_151634_b(k1, p_151636_7_) && this.func_151634_b(l1, p_151636_7_) && this.func_151634_b(i2, p_151636_7_) && this.func_151634_b(j2, p_151636_7_)) + { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_6_; + } + else + { + p_151636_2_[p_151636_3_ + p_151636_4_ * p_151636_5_] = p_151636_8_; + } + + return true; + } + } + + private boolean func_151635_b(int[] p_151635_1_, int[] p_151635_2_, int p_151635_3_, int p_151635_4_, int p_151635_5_, int p_151635_6_, int p_151635_7_, int p_151635_8_) + { + if (p_151635_6_ != p_151635_7_) + { + return false; + } + else + { + int k1 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 - 1) * (p_151635_5_ + 2)]; + int l1 = p_151635_1_[p_151635_3_ + 1 + 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int i2 = p_151635_1_[p_151635_3_ + 1 - 1 + (p_151635_4_ + 1) * (p_151635_5_ + 2)]; + int j2 = p_151635_1_[p_151635_3_ + 1 + (p_151635_4_ + 1 + 1) * (p_151635_5_ + 2)]; + + if (compareBiomesById(k1, p_151635_7_) && compareBiomesById(l1, p_151635_7_) && compareBiomesById(i2, p_151635_7_) && compareBiomesById(j2, p_151635_7_)) + { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_6_; + } + else + { + p_151635_2_[p_151635_3_ + p_151635_4_ * p_151635_5_] = p_151635_8_; + } + + return true; + } + } + + private boolean func_151634_b(int p_151634_1_, int p_151634_2_) + { + if (compareBiomesById(p_151634_1_, p_151634_2_)) + { + return true; + } + else if (BiomeGenBase.getBiome(p_151634_1_) != null && BiomeGenBase.getBiome(p_151634_2_) != null) + { + BiomeGenBase.TempCategory tempcategory = BiomeGenBase.getBiome(p_151634_1_).getTempCategory(); + BiomeGenBase.TempCategory tempcategory1 = BiomeGenBase.getBiome(p_151634_2_).getTempCategory(); + return tempcategory == tempcategory1 || tempcategory == BiomeGenBase.TempCategory.MEDIUM || tempcategory1 == BiomeGenBase.TempCategory.MEDIUM; + } + else + { + return false; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java new file mode 100644 index 0000000..26fcabe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerDeepOcean.java @@ -0,0 +1,72 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerDeepOcean extends GenLayer +{ + private static final String __OBFID = "CL_00000546"; + + public GenLayerDeepOcean(long p_i45472_1_, GenLayer p_i45472_3_) + { + super(p_i45472_1_); + this.parent = p_i45472_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 1 + (i2 + 1 - 1) * (areaWidth + 2)]; + int l2 = aint[j2 + 1 + 1 + (i2 + 1) * (areaWidth + 2)]; + int i3 = aint[j2 + 1 - 1 + (i2 + 1) * (areaWidth + 2)]; + int j3 = aint[j2 + 1 + (i2 + 1 + 1) * (areaWidth + 2)]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + int l3 = 0; + + if (k2 == 0) + { + ++l3; + } + + if (l2 == 0) + { + ++l3; + } + + if (i3 == 0) + { + ++l3; + } + + if (j3 == 0) + { + ++l3; + } + + if (k3 == 0 && l3 > 3) + { + aint1[j2 + i2 * areaWidth] = BiomeGenBase.deepOcean.biomeID; + } + else + { + aint1[j2 + i2 * areaWidth] = k3; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerEdge.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerEdge.java new file mode 100644 index 0000000..527dbd6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerEdge.java @@ -0,0 +1,176 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerEdge extends GenLayer +{ + private final GenLayerEdge.Mode field_151627_c; + private static final String __OBFID = "CL_00000547"; + + public GenLayerEdge(long p_i45474_1_, GenLayer p_i45474_3_, GenLayerEdge.Mode p_i45474_4_) + { + super(p_i45474_1_); + this.parent = p_i45474_3_; + this.field_151627_c = p_i45474_4_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + switch (GenLayerEdge.SwitchMode.field_151642_a[this.field_151627_c.ordinal()]) + { + case 1: + default: + return this.getIntsCoolWarm(areaX, areaY, areaWidth, areaHeight); + case 2: + return this.getIntsHeatIce(areaX, areaY, areaWidth, areaHeight); + case 3: + return this.getIntsSpecial(areaX, areaY, areaWidth, areaHeight); + } + } + + private int[] getIntsCoolWarm(int p_151626_1_, int p_151626_2_, int p_151626_3_, int p_151626_4_) + { + int i1 = p_151626_1_ - 1; + int j1 = p_151626_2_ - 1; + int k1 = 1 + p_151626_3_ + 1; + int l1 = 1 + p_151626_4_ + 1; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(p_151626_3_ * p_151626_4_); + + for (int i2 = 0; i2 < p_151626_4_; ++i2) + { + for (int j2 = 0; j2 < p_151626_3_; ++j2) + { + this.initChunkSeed((long)(j2 + p_151626_1_), (long)(i2 + p_151626_2_)); + int k2 = aint[j2 + 1 + (i2 + 1) * k1]; + + if (k2 == 1) + { + int l2 = aint[j2 + 1 + (i2 + 1 - 1) * k1]; + int i3 = aint[j2 + 1 + 1 + (i2 + 1) * k1]; + int j3 = aint[j2 + 1 - 1 + (i2 + 1) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1 + 1) * k1]; + boolean flag = l2 == 3 || i3 == 3 || j3 == 3 || k3 == 3; + boolean flag1 = l2 == 4 || i3 == 4 || j3 == 4 || k3 == 4; + + if (flag || flag1) + { + k2 = 2; + } + } + + aint1[j2 + i2 * p_151626_3_] = k2; + } + } + + return aint1; + } + + private int[] getIntsHeatIce(int p_151624_1_, int p_151624_2_, int p_151624_3_, int p_151624_4_) + { + int i1 = p_151624_1_ - 1; + int j1 = p_151624_2_ - 1; + int k1 = 1 + p_151624_3_ + 1; + int l1 = 1 + p_151624_4_ + 1; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(p_151624_3_ * p_151624_4_); + + for (int i2 = 0; i2 < p_151624_4_; ++i2) + { + for (int j2 = 0; j2 < p_151624_3_; ++j2) + { + int k2 = aint[j2 + 1 + (i2 + 1) * k1]; + + if (k2 == 4) + { + int l2 = aint[j2 + 1 + (i2 + 1 - 1) * k1]; + int i3 = aint[j2 + 1 + 1 + (i2 + 1) * k1]; + int j3 = aint[j2 + 1 - 1 + (i2 + 1) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1 + 1) * k1]; + boolean flag = l2 == 2 || i3 == 2 || j3 == 2 || k3 == 2; + boolean flag1 = l2 == 1 || i3 == 1 || j3 == 1 || k3 == 1; + + if (flag1 || flag) + { + k2 = 3; + } + } + + aint1[j2 + i2 * p_151624_3_] = k2; + } + } + + return aint1; + } + + private int[] getIntsSpecial(int p_151625_1_, int p_151625_2_, int p_151625_3_, int p_151625_4_) + { + int[] aint = this.parent.getInts(p_151625_1_, p_151625_2_, p_151625_3_, p_151625_4_); + int[] aint1 = IntCache.getIntCache(p_151625_3_ * p_151625_4_); + + for (int i1 = 0; i1 < p_151625_4_; ++i1) + { + for (int j1 = 0; j1 < p_151625_3_; ++j1) + { + this.initChunkSeed((long)(j1 + p_151625_1_), (long)(i1 + p_151625_2_)); + int k1 = aint[j1 + i1 * p_151625_3_]; + + if (k1 != 0 && this.nextInt(13) == 0) + { + k1 |= 1 + this.nextInt(15) << 8 & 3840; + } + + aint1[j1 + i1 * p_151625_3_] = k1; + } + } + + return aint1; + } + + public static enum Mode + { + COOL_WARM, + HEAT_ICE, + SPECIAL; + + private static final String __OBFID = "CL_00000549"; + } + + static final class SwitchMode + { + static final int[] field_151642_a = new int[GenLayerEdge.Mode.values().length]; + private static final String __OBFID = "CL_00000548"; + + static + { + try + { + field_151642_a[GenLayerEdge.Mode.COOL_WARM.ordinal()] = 1; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + field_151642_a[GenLayerEdge.Mode.HEAT_ICE.ordinal()] = 2; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + field_151642_a[GenLayerEdge.Mode.SPECIAL.ordinal()] = 3; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java new file mode 100644 index 0000000..64e91a5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerFuzzyZoom.java @@ -0,0 +1,19 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerFuzzyZoom extends GenLayerZoom +{ + private static final String __OBFID = "CL_00000556"; + + public GenLayerFuzzyZoom(long p_i2123_1_, GenLayer p_i2123_3_) + { + super(p_i2123_1_, p_i2123_3_); + } + + /** + * returns the most frequently occurring number of the set, or a random number from those provided + */ + protected int selectModeOrRandom(int p_151617_1_, int p_151617_2_, int p_151617_3_, int p_151617_4_) + { + return this.selectRandom(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerHills.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerHills.java new file mode 100644 index 0000000..a521545 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerHills.java @@ -0,0 +1,200 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class GenLayerHills extends GenLayer +{ + private static final Logger logger = LogManager.getLogger(); + private GenLayer field_151628_d; + private static final String __OBFID = "CL_00000563"; + + public GenLayerHills(long p_i45479_1_, GenLayer p_i45479_3_, GenLayer p_i45479_4_) + { + super(p_i45479_1_); + this.parent = p_i45479_3_; + this.field_151628_d = p_i45479_4_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = this.field_151628_d.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + int k1 = aint[j1 + 1 + (i1 + 1) * (areaWidth + 2)]; + int l1 = aint1[j1 + 1 + (i1 + 1) * (areaWidth + 2)]; + boolean flag = (l1 - 2) % 29 == 0; + + if (k1 > 255) + { + logger.debug("old! " + k1); + } + + if (k1 != 0 && l1 >= 2 && (l1 - 2) % 29 == 1 && k1 < 128) + { + if (BiomeGenBase.getBiome(k1 + 128) != null) + { + aint2[j1 + i1 * areaWidth] = k1 + 128; + } + else + { + aint2[j1 + i1 * areaWidth] = k1; + } + } + else if (this.nextInt(3) != 0 && !flag) + { + aint2[j1 + i1 * areaWidth] = k1; + } + else + { + int i2 = k1; + int j2; + + if (k1 == BiomeGenBase.desert.biomeID) + { + i2 = BiomeGenBase.desertHills.biomeID; + } + else if (k1 == BiomeGenBase.forest.biomeID) + { + i2 = BiomeGenBase.forestHills.biomeID; + } + else if (k1 == BiomeGenBase.birchForest.biomeID) + { + i2 = BiomeGenBase.birchForestHills.biomeID; + } + else if (k1 == BiomeGenBase.roofedForest.biomeID) + { + i2 = BiomeGenBase.plains.biomeID; + } + else if (k1 == BiomeGenBase.taiga.biomeID) + { + i2 = BiomeGenBase.taigaHills.biomeID; + } + else if (k1 == BiomeGenBase.megaTaiga.biomeID) + { + i2 = BiomeGenBase.megaTaigaHills.biomeID; + } + else if (k1 == BiomeGenBase.coldTaiga.biomeID) + { + i2 = BiomeGenBase.coldTaigaHills.biomeID; + } + else if (k1 == BiomeGenBase.plains.biomeID) + { + if (this.nextInt(3) == 0) + { + i2 = BiomeGenBase.forestHills.biomeID; + } + else + { + i2 = BiomeGenBase.forest.biomeID; + } + } + else if (k1 == BiomeGenBase.icePlains.biomeID) + { + i2 = BiomeGenBase.iceMountains.biomeID; + } + else if (k1 == BiomeGenBase.jungle.biomeID) + { + i2 = BiomeGenBase.jungleHills.biomeID; + } + else if (k1 == BiomeGenBase.ocean.biomeID) + { + i2 = BiomeGenBase.deepOcean.biomeID; + } + else if (k1 == BiomeGenBase.extremeHills.biomeID) + { + i2 = BiomeGenBase.extremeHillsPlus.biomeID; + } + else if (k1 == BiomeGenBase.savanna.biomeID) + { + i2 = BiomeGenBase.savannaPlateau.biomeID; + } + else if (compareBiomesById(k1, BiomeGenBase.mesaPlateau_F.biomeID)) + { + i2 = BiomeGenBase.mesa.biomeID; + } + else if (k1 == BiomeGenBase.deepOcean.biomeID && this.nextInt(3) == 0) + { + j2 = this.nextInt(2); + + if (j2 == 0) + { + i2 = BiomeGenBase.plains.biomeID; + } + else + { + i2 = BiomeGenBase.forest.biomeID; + } + } + + if (flag && i2 != k1) + { + if (BiomeGenBase.getBiome(i2 + 128) != null) + { + i2 += 128; + } + else + { + i2 = k1; + } + } + + if (i2 == k1) + { + aint2[j1 + i1 * areaWidth] = k1; + } + else + { + j2 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + int k2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + int l2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + int i3 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + int j3 = 0; + + if (compareBiomesById(j2, k1)) + { + ++j3; + } + + if (compareBiomesById(k2, k1)) + { + ++j3; + } + + if (compareBiomesById(l2, k1)) + { + ++j3; + } + + if (compareBiomesById(i3, k1)) + { + ++j3; + } + + if (j3 >= 3) + { + aint2[j1 + i1 * areaWidth] = i2; + } + else + { + aint2[j1 + i1 * areaWidth] = k1; + } + } + } + } + } + + return aint2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerIsland.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerIsland.java new file mode 100644 index 0000000..7527312 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerIsland.java @@ -0,0 +1,36 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerIsland extends GenLayer +{ + private static final String __OBFID = "CL_00000558"; + + public GenLayerIsland(long p_i2124_1_) + { + super(p_i2124_1_); + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(areaX + j1), (long)(areaY + i1)); + aint[j1 + i1 * areaWidth] = this.nextInt(10) == 0 ? 1 : 0; + } + } + + if (areaX > -areaWidth && areaX <= 0 && areaY > -areaHeight && areaY <= 0) + { + aint[-areaX + -areaY * areaWidth] = 1; + } + + return aint; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java new file mode 100644 index 0000000..272b0e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRareBiome.java @@ -0,0 +1,51 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRareBiome extends GenLayer +{ + private static final String __OBFID = "CL_00000562"; + + public GenLayerRareBiome(long p_i45478_1_, GenLayer p_i45478_3_) + { + super(p_i45478_1_); + this.parent = p_i45478_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + int k1 = aint[j1 + 1 + (i1 + 1) * (areaWidth + 2)]; + + if (this.nextInt(57) == 0) + { + if (k1 == BiomeGenBase.plains.biomeID) + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.plains.biomeID + 128; + } + else + { + aint1[j1 + i1 * areaWidth] = k1; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k1; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java new file mode 100644 index 0000000..d64aac3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRemoveTooMuchOcean.java @@ -0,0 +1,47 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRemoveTooMuchOcean extends GenLayer +{ + private static final String __OBFID = "CL_00000564"; + + public GenLayerRemoveTooMuchOcean(long p_i45480_1_, GenLayer p_i45480_3_) + { + super(p_i45480_1_); + this.parent = p_i45480_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 1 + (i2 + 1 - 1) * (areaWidth + 2)]; + int l2 = aint[j2 + 1 + 1 + (i2 + 1) * (areaWidth + 2)]; + int i3 = aint[j2 + 1 - 1 + (i2 + 1) * (areaWidth + 2)]; + int j3 = aint[j2 + 1 + (i2 + 1 + 1) * (areaWidth + 2)]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + aint1[j2 + i2 * areaWidth] = k3; + this.initChunkSeed((long)(j2 + areaX), (long)(i2 + areaY)); + + if (k3 == 0 && k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0 && this.nextInt(2) == 0) + { + aint1[j2 + i2 * areaWidth] = 1; + } + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiver.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiver.java new file mode 100644 index 0000000..1f1844c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiver.java @@ -0,0 +1,56 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiver extends GenLayer +{ + private static final String __OBFID = "CL_00000566"; + + public GenLayerRiver(long p_i2128_1_, GenLayer p_i2128_3_) + { + super(p_i2128_1_); + super.parent = p_i2128_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = this.func_151630_c(aint[j2 + 0 + (i2 + 1) * k1]); + int l2 = this.func_151630_c(aint[j2 + 2 + (i2 + 1) * k1]); + int i3 = this.func_151630_c(aint[j2 + 1 + (i2 + 0) * k1]); + int j3 = this.func_151630_c(aint[j2 + 1 + (i2 + 2) * k1]); + int k3 = this.func_151630_c(aint[j2 + 1 + (i2 + 1) * k1]); + + if (k3 == k2 && k3 == i3 && k3 == l2 && k3 == j3) + { + aint1[j2 + i2 * areaWidth] = -1; + } + else + { + aint1[j2 + i2 * areaWidth] = BiomeGenBase.river.biomeID; + } + } + } + + return aint1; + } + + private int func_151630_c(int p_151630_1_) + { + return p_151630_1_ >= 2 ? 2 + (p_151630_1_ & 1) : p_151630_1_; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java new file mode 100644 index 0000000..9889a38 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverInit.java @@ -0,0 +1,33 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerRiverInit extends GenLayer +{ + private static final String __OBFID = "CL_00000565"; + + public GenLayerRiverInit(long p_i2127_1_, GenLayer p_i2127_3_) + { + super(p_i2127_1_); + this.parent = p_i2127_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + aint1[j1 + i1 * areaWidth] = aint[j1 + i1 * areaWidth] > 0 ? this.nextInt(299999) + 2 : 0; + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java new file mode 100644 index 0000000..a384424 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerRiverMix.java @@ -0,0 +1,71 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; + +public class GenLayerRiverMix extends GenLayer +{ + private GenLayer biomePatternGeneratorChain; + private GenLayer riverPatternGeneratorChain; + private static final String __OBFID = "CL_00000567"; + + public GenLayerRiverMix(long p_i2129_1_, GenLayer p_i2129_3_, GenLayer p_i2129_4_) + { + super(p_i2129_1_); + this.biomePatternGeneratorChain = p_i2129_3_; + this.riverPatternGeneratorChain = p_i2129_4_; + } + + /** + * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an + * argument). + */ + public void initWorldGenSeed(long p_75905_1_) + { + this.biomePatternGeneratorChain.initWorldGenSeed(p_75905_1_); + this.riverPatternGeneratorChain.initWorldGenSeed(p_75905_1_); + super.initWorldGenSeed(p_75905_1_); + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.biomePatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint1 = this.riverPatternGeneratorChain.getInts(areaX, areaY, areaWidth, areaHeight); + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaWidth * areaHeight; ++i1) + { + if (aint[i1] != BiomeGenBase.ocean.biomeID && aint[i1] != BiomeGenBase.deepOcean.biomeID) + { + if (aint1[i1] == BiomeGenBase.river.biomeID) + { + if (aint[i1] == BiomeGenBase.icePlains.biomeID) + { + aint2[i1] = BiomeGenBase.frozenRiver.biomeID; + } + else if (aint[i1] != BiomeGenBase.mushroomIsland.biomeID && aint[i1] != BiomeGenBase.mushroomIslandShore.biomeID) + { + aint2[i1] = aint1[i1] & 255; + } + else + { + aint2[i1] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } + else + { + aint2[i1] = aint[i1]; + } + } + else + { + aint2[i1] = aint[i1]; + } + } + + return aint2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerShore.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerShore.java new file mode 100644 index 0000000..1e2266a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerShore.java @@ -0,0 +1,173 @@ +package net.minecraft.world.gen.layer; + +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenJungle; +import net.minecraft.world.biome.BiomeGenMesa; + +public class GenLayerShore extends GenLayer +{ + private static final String __OBFID = "CL_00000568"; + + public GenLayerShore(long p_i2130_1_, GenLayer p_i2130_3_) + { + super(p_i2130_1_); + this.parent = p_i2130_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int[] aint = this.parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i1 = 0; i1 < areaHeight; ++i1) + { + for (int j1 = 0; j1 < areaWidth; ++j1) + { + this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY)); + int k1 = aint[j1 + 1 + (i1 + 1) * (areaWidth + 2)]; + BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k1); + int l1; + int i2; + int j2; + int k2; + + if (k1 == BiomeGenBase.mushroomIsland.biomeID) + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (l1 != BiomeGenBase.ocean.biomeID && i2 != BiomeGenBase.ocean.biomeID && j2 != BiomeGenBase.ocean.biomeID && k2 != BiomeGenBase.ocean.biomeID) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID; + } + } + else if (biomegenbase != null && biomegenbase.getBiomeClass() == BiomeGenJungle.class) + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (this.func_151631_c(l1) && this.func_151631_c(i2) && this.func_151631_c(j2) && this.func_151631_c(k2)) + { + if (!isBiomeOceanic(l1) && !isBiomeOceanic(i2) && !isBiomeOceanic(j2) && !isBiomeOceanic(k2)) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.beach.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.jungleEdge.biomeID; + } + } + else if (k1 != BiomeGenBase.extremeHills.biomeID && k1 != BiomeGenBase.extremeHillsPlus.biomeID && k1 != BiomeGenBase.extremeHillsEdge.biomeID) + { + if (biomegenbase != null && biomegenbase.func_150559_j()) + { + this.func_151632_a(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.coldBeach.biomeID); + } + else if (k1 != BiomeGenBase.mesa.biomeID && k1 != BiomeGenBase.mesaPlateau_F.biomeID) + { + if (k1 != BiomeGenBase.ocean.biomeID && k1 != BiomeGenBase.deepOcean.biomeID && k1 != BiomeGenBase.river.biomeID && k1 != BiomeGenBase.swampland.biomeID) + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (!isBiomeOceanic(l1) && !isBiomeOceanic(i2) && !isBiomeOceanic(j2) && !isBiomeOceanic(k2)) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.beach.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k1; + } + } + else + { + l1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)]; + i2 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)]; + j2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)]; + k2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)]; + + if (!isBiomeOceanic(l1) && !isBiomeOceanic(i2) && !isBiomeOceanic(j2) && !isBiomeOceanic(k2)) + { + if (this.func_151633_d(l1) && this.func_151633_d(i2) && this.func_151633_d(j2) && this.func_151633_d(k2)) + { + aint1[j1 + i1 * areaWidth] = k1; + } + else + { + aint1[j1 + i1 * areaWidth] = BiomeGenBase.desert.biomeID; + } + } + else + { + aint1[j1 + i1 * areaWidth] = k1; + } + } + } + else + { + this.func_151632_a(aint, aint1, j1, i1, areaWidth, k1, BiomeGenBase.stoneBeach.biomeID); + } + } + } + + return aint1; + } + + private void func_151632_a(int[] p_151632_1_, int[] p_151632_2_, int p_151632_3_, int p_151632_4_, int p_151632_5_, int p_151632_6_, int p_151632_7_) + { + if (isBiomeOceanic(p_151632_6_)) + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } + else + { + int j1 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 - 1) * (p_151632_5_ + 2)]; + int k1 = p_151632_1_[p_151632_3_ + 1 + 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int l1 = p_151632_1_[p_151632_3_ + 1 - 1 + (p_151632_4_ + 1) * (p_151632_5_ + 2)]; + int i2 = p_151632_1_[p_151632_3_ + 1 + (p_151632_4_ + 1 + 1) * (p_151632_5_ + 2)]; + + if (!isBiomeOceanic(j1) && !isBiomeOceanic(k1) && !isBiomeOceanic(l1) && !isBiomeOceanic(i2)) + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_6_; + } + else + { + p_151632_2_[p_151632_3_ + p_151632_4_ * p_151632_5_] = p_151632_7_; + } + } + } + + private boolean func_151631_c(int p_151631_1_) + { + return BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).getBiomeClass() == BiomeGenJungle.class ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_); + } + + private boolean func_151633_d(int p_151633_1_) + { + return BiomeGenBase.getBiome(p_151633_1_) != null && BiomeGenBase.getBiome(p_151633_1_) instanceof BiomeGenMesa; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerSmooth.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerSmooth.java new file mode 100644 index 0000000..449dee2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerSmooth.java @@ -0,0 +1,68 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerSmooth extends GenLayer +{ + private static final String __OBFID = "CL_00000569"; + + public GenLayerSmooth(long p_i2131_1_, GenLayer p_i2131_3_) + { + super(p_i2131_1_); + super.parent = p_i2131_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX - 1; + int j1 = areaY - 1; + int k1 = areaWidth + 2; + int l1 = areaHeight + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); + + for (int i2 = 0; i2 < areaHeight; ++i2) + { + for (int j2 = 0; j2 < areaWidth; ++j2) + { + int k2 = aint[j2 + 0 + (i2 + 1) * k1]; + int l2 = aint[j2 + 2 + (i2 + 1) * k1]; + int i3 = aint[j2 + 1 + (i2 + 0) * k1]; + int j3 = aint[j2 + 1 + (i2 + 2) * k1]; + int k3 = aint[j2 + 1 + (i2 + 1) * k1]; + + if (k2 == l2 && i3 == j3) + { + this.initChunkSeed((long)(j2 + areaX), (long)(i2 + areaY)); + + if (this.nextInt(2) == 0) + { + k3 = k2; + } + else + { + k3 = i3; + } + } + else + { + if (k2 == l2) + { + k3 = k2; + } + + if (i3 == j3) + { + k3 = i3; + } + } + + aint1[j2 + i2 * areaWidth] = k3; + } + } + + return aint1; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java new file mode 100644 index 0000000..36f9d79 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerVoronoiZoom.java @@ -0,0 +1,98 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerVoronoiZoom extends GenLayer +{ + private static final String __OBFID = "CL_00000571"; + + public GenLayerVoronoiZoom(long p_i2133_1_, GenLayer p_i2133_3_) + { + super(p_i2133_1_); + super.parent = p_i2133_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + areaX -= 2; + areaY -= 2; + int i1 = areaX >> 2; + int j1 = areaY >> 2; + int k1 = (areaWidth >> 2) + 2; + int l1 = (areaHeight >> 2) + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int i2 = k1 - 1 << 2; + int j2 = l1 - 1 << 2; + int[] aint1 = IntCache.getIntCache(i2 * j2); + int l2; + + for (int k2 = 0; k2 < l1 - 1; ++k2) + { + l2 = 0; + int i3 = aint[l2 + 0 + (k2 + 0) * k1]; + + for (int j3 = aint[l2 + 0 + (k2 + 1) * k1]; l2 < k1 - 1; ++l2) + { + double d0 = 3.6D; + this.initChunkSeed((long)(l2 + i1 << 2), (long)(k2 + j1 << 2)); + double d1 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d2 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long)(l2 + i1 + 1 << 2), (long)(k2 + j1 << 2)); + double d3 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d4 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + this.initChunkSeed((long)(l2 + i1 << 2), (long)(k2 + j1 + 1 << 2)); + double d5 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D; + double d6 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + this.initChunkSeed((long)(l2 + i1 + 1 << 2), (long)(k2 + j1 + 1 << 2)); + double d7 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + double d8 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * 3.6D + 4.0D; + int k3 = aint[l2 + 1 + (k2 + 0) * k1] & 255; + int l3 = aint[l2 + 1 + (k2 + 1) * k1] & 255; + + for (int i4 = 0; i4 < 4; ++i4) + { + int j4 = ((k2 << 2) + i4) * i2 + (l2 << 2); + + for (int k4 = 0; k4 < 4; ++k4) + { + double d9 = ((double)i4 - d2) * ((double)i4 - d2) + ((double)k4 - d1) * ((double)k4 - d1); + double d10 = ((double)i4 - d4) * ((double)i4 - d4) + ((double)k4 - d3) * ((double)k4 - d3); + double d11 = ((double)i4 - d6) * ((double)i4 - d6) + ((double)k4 - d5) * ((double)k4 - d5); + double d12 = ((double)i4 - d8) * ((double)i4 - d8) + ((double)k4 - d7) * ((double)k4 - d7); + + if (d9 < d10 && d9 < d11 && d9 < d12) + { + aint1[j4++] = i3; + } + else if (d10 < d9 && d10 < d11 && d10 < d12) + { + aint1[j4++] = k3; + } + else if (d11 < d9 && d11 < d10 && d11 < d12) + { + aint1[j4++] = j3; + } + else + { + aint1[j4++] = l3; + } + } + } + + i3 = k3; + j3 = l3; + } + } + + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (l2 = 0; l2 < areaHeight; ++l2) + { + System.arraycopy(aint1, (l2 + (areaY & 3)) * i2 + (areaX & 3), aint2, l2 * areaWidth, areaWidth); + } + + return aint2; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerZoom.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerZoom.java new file mode 100644 index 0000000..ad911c5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/GenLayerZoom.java @@ -0,0 +1,73 @@ +package net.minecraft.world.gen.layer; + +public class GenLayerZoom extends GenLayer +{ + private static final String __OBFID = "CL_00000572"; + + public GenLayerZoom(long p_i2134_1_, GenLayer p_i2134_3_) + { + super(p_i2134_1_); + super.parent = p_i2134_3_; + } + + /** + * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall + * amounts, or biomeList[] indices based on the particular GenLayer subclass. + */ + public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) + { + int i1 = areaX >> 1; + int j1 = areaY >> 1; + int k1 = (areaWidth >> 1) + 2; + int l1 = (areaHeight >> 1) + 2; + int[] aint = this.parent.getInts(i1, j1, k1, l1); + int i2 = k1 - 1 << 1; + int j2 = l1 - 1 << 1; + int[] aint1 = IntCache.getIntCache(i2 * j2); + int l2; + + for (int k2 = 0; k2 < l1 - 1; ++k2) + { + l2 = (k2 << 1) * i2; + int i3 = 0; + int j3 = aint[i3 + 0 + (k2 + 0) * k1]; + + for (int k3 = aint[i3 + 0 + (k2 + 1) * k1]; i3 < k1 - 1; ++i3) + { + this.initChunkSeed((long)(i3 + i1 << 1), (long)(k2 + j1 << 1)); + int l3 = aint[i3 + 1 + (k2 + 0) * k1]; + int i4 = aint[i3 + 1 + (k2 + 1) * k1]; + aint1[l2] = j3; + aint1[l2++ + i2] = this.selectRandom(new int[] {j3, k3}); + aint1[l2] = this.selectRandom(new int[] {j3, l3}); + aint1[l2++ + i2] = this.selectModeOrRandom(j3, l3, k3, i4); + j3 = l3; + k3 = i4; + } + } + + int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight); + + for (l2 = 0; l2 < areaHeight; ++l2) + { + System.arraycopy(aint1, (l2 + (areaY & 1)) * i2 + (areaX & 1), aint2, l2 * areaWidth, areaWidth); + } + + return aint2; + } + + /** + * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify + */ + public static GenLayer magnify(long p_75915_0_, GenLayer p_75915_2_, int p_75915_3_) + { + Object object = p_75915_2_; + + for (int k = 0; k < p_75915_3_; ++k) + { + object = new GenLayerZoom(p_75915_0_ + (long)k, (GenLayer)object); + } + + return (GenLayer)object; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/IntCache.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/IntCache.java new file mode 100644 index 0000000..586996f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/layer/IntCache.java @@ -0,0 +1,96 @@ +package net.minecraft.world.gen.layer; + +import java.util.ArrayList; +import java.util.List; + +public class IntCache +{ + private static int intCacheSize = 256; + /** A list of pre-allocated int[256] arrays that are currently unused and can be returned by getIntCache() */ + private static List freeSmallArrays = new ArrayList(); + /** + * A list of pre-allocated int[256] arrays that were previously returned by getIntCache() and which will not be re- + * used again until resetIntCache() is called. + */ + private static List inUseSmallArrays = new ArrayList(); + /** A list of pre-allocated int[cacheSize] arrays that are currently unused and can be returned by getIntCache() */ + private static List freeLargeArrays = new ArrayList(); + /** + * A list of pre-allocated int[cacheSize] arrays that were previously returned by getIntCache() and which will not + * be re-used again until resetIntCache() is called. + */ + private static List inUseLargeArrays = new ArrayList(); + private static final String __OBFID = "CL_00000557"; + + public static synchronized int[] getIntCache(int p_76445_0_) + { + int[] aint; + + if (p_76445_0_ <= 256) + { + if (freeSmallArrays.isEmpty()) + { + aint = new int[256]; + inUseSmallArrays.add(aint); + return aint; + } + else + { + aint = (int[])freeSmallArrays.remove(freeSmallArrays.size() - 1); + inUseSmallArrays.add(aint); + return aint; + } + } + else if (p_76445_0_ > intCacheSize) + { + intCacheSize = p_76445_0_; + freeLargeArrays.clear(); + inUseLargeArrays.clear(); + aint = new int[intCacheSize]; + inUseLargeArrays.add(aint); + return aint; + } + else if (freeLargeArrays.isEmpty()) + { + aint = new int[intCacheSize]; + inUseLargeArrays.add(aint); + return aint; + } + else + { + aint = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); + inUseLargeArrays.add(aint); + return aint; + } + } + + /** + * Mark all pre-allocated arrays as available for re-use by moving them to the appropriate free lists. + */ + public static synchronized void resetIntCache() + { + if (!freeLargeArrays.isEmpty()) + { + freeLargeArrays.remove(freeLargeArrays.size() - 1); + } + + if (!freeSmallArrays.isEmpty()) + { + freeSmallArrays.remove(freeSmallArrays.size() - 1); + } + + freeLargeArrays.addAll(inUseLargeArrays); + freeSmallArrays.addAll(inUseSmallArrays); + inUseLargeArrays.clear(); + inUseSmallArrays.clear(); + } + + /** + * Gets a human-readable string that indicates the sizes of all the cache fields. Basically a synchronized static + * toString. + */ + public static synchronized String getCacheSizes() + { + return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java new file mode 100644 index 0000000..7f11fc8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java @@ -0,0 +1,724 @@ +package net.minecraft.world.gen.structure; + +import java.util.Random; +import net.minecraft.block.BlockLever; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Direction; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; + +public class ComponentScatteredFeaturePieces +{ + private static final String __OBFID = "CL_00000473"; + + public static void registerScatteredFeaturePieces() + { + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.DesertPyramid.class, "TeDP"); + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.JunglePyramid.class, "TeJP"); + MapGenStructureIO.func_143031_a(ComponentScatteredFeaturePieces.SwampHut.class, "TeSH"); + } + + public static class DesertPyramid extends ComponentScatteredFeaturePieces.Feature + { + private boolean[] field_74940_h = new boolean[4]; + /** List of items to generate in chests of Temples. */ + public static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private static final String __OBFID = "CL_00000476"; + + public DesertPyramid() {} + + public DesertPyramid(Random p_i2062_1_, int p_i2062_2_, int p_i2062_3_) + { + super(p_i2062_1_, p_i2062_2_, 64, p_i2062_3_, 21, 15, 21); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("hasPlacedChest0", this.field_74940_h[0]); + p_143012_1_.setBoolean("hasPlacedChest1", this.field_74940_h[1]); + p_143012_1_.setBoolean("hasPlacedChest2", this.field_74940_h[2]); + p_143012_1_.setBoolean("hasPlacedChest3", this.field_74940_h[3]); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_74940_h[0] = p_143011_1_.getBoolean("hasPlacedChest0"); + this.field_74940_h[1] = p_143011_1_.getBoolean("hasPlacedChest1"); + this.field_74940_h[2] = p_143011_1_.getBoolean("hasPlacedChest2"); + this.field_74940_h[3] = p_143011_1_.getBoolean("hasPlacedChest3"); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Blocks.sandstone, Blocks.sandstone, false); + int i; + + for (i = 1; i <= 9; ++i) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, i, i, this.scatteredFeatureSizeX - 1 - i, i, this.scatteredFeatureSizeZ - 1 - i, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i + 1, i, i + 1, this.scatteredFeatureSizeX - 2 - i, i, this.scatteredFeatureSizeZ - 2 - i, Blocks.air, Blocks.air, false); + } + + int j; + + for (i = 0; i < this.scatteredFeatureSizeX; ++i) + { + for (j = 0; j < this.scatteredFeatureSizeZ; ++j) + { + byte b0 = -5; + this.func_151554_b(p_74875_1_, Blocks.sandstone, 0, i, b0, j, p_74875_3_); + } + } + + i = this.getMetadataWithOffset(Blocks.sandstone_stairs, 3); + j = this.getMetadataWithOffset(Blocks.sandstone_stairs, 2); + int k1 = this.getMetadataWithOffset(Blocks.sandstone_stairs, 0); + int k = this.getMetadataWithOffset(Blocks.sandstone_stairs, 1); + byte b1 = 1; + byte b2 = 11; + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 9, 4, Blocks.sandstone, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 10, 1, 3, 10, 3, Blocks.sandstone, Blocks.sandstone, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, 2, 10, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, j, 2, 10, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k1, 0, 10, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k, 4, 10, 2, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Blocks.sandstone, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Blocks.sandstone, Blocks.sandstone, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, this.scatteredFeatureSizeX - 3, 10, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, j, this.scatteredFeatureSizeX - 3, 10, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k1, this.scatteredFeatureSizeX - 5, 10, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k, this.scatteredFeatureSizeX - 1, 10, 2, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 0, 0, 12, 4, 4, Blocks.sandstone, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 1, 0, 11, 3, 4, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 9, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 9, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 9, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 10, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 11, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 11, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 11, 1, 1, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 8, 3, 3, Blocks.sandstone, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 2, 8, 2, 2, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 1, 1, 16, 3, 3, Blocks.sandstone, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 1, 2, 16, 2, 2, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 4, 9, 11, 4, 11, Blocks.air, Blocks.air, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, 1, 8, 8, 3, 8, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 12, 1, 8, 12, 3, 8, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, 1, 12, 8, 3, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 12, 1, 12, 12, 3, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 5, 4, 4, 11, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 7, 9, 6, 7, 11, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 5, 5, 9, 5, 7, 11, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 5, 5, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 5, 6, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 6, 6, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 6, 5, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 6, 6, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, this.scatteredFeatureSizeX - 7, 6, 10, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 4, 4, 2, 6, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, 2, 4, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, 2, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, this.scatteredFeatureSizeX - 3, 4, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, i, this.scatteredFeatureSizeX - 3, 3, 4, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 3, 2, 2, 3, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Blocks.sandstone, Blocks.sandstone, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, 0, 1, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, 0, this.scatteredFeatureSizeX - 2, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 1, 1, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 1, this.scatteredFeatureSizeX - 2, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k, 2, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone_stairs, k1, this.scatteredFeatureSizeX - 3, 1, 2, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 5, 4, 3, 18, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 5, 4, 2, 16, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, Blocks.air, Blocks.air, false); + int l; + + for (l = 5; l <= 17; l += 2) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 4, 1, l, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 4, 2, l, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, this.scatteredFeatureSizeX - 5, 1, l, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, this.scatteredFeatureSizeX - 5, 2, l, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 10, 0, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 10, 0, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 9, 0, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 11, 0, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 8, 0, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 12, 0, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 7, 0, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 13, 0, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 9, 0, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 11, 0, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 10, 0, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 10, 0, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b2, 10, 0, 10, p_74875_3_); + + for (l = 0; l <= this.scatteredFeatureSizeX - 1; l += this.scatteredFeatureSizeX - 1) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 4, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, l, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 5, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 5, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 6, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, l, 6, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 6, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 7, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 7, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 7, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 8, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 8, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 8, 3, p_74875_3_); + } + + for (l = 2; l <= this.scatteredFeatureSizeX - 3; l += this.scatteredFeatureSizeX - 3 - 2) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l - 1, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l + 1, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l - 1, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l + 1, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l - 1, 4, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, l, 4, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l + 1, 4, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l - 1, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l + 1, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l - 1, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, l, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l + 1, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l - 1, 7, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l, 7, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, l + 1, 7, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l - 1, 8, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l, 8, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, l + 1, 8, 0, p_74875_3_); + } + + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, 4, 0, 12, 6, 0, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 8, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 12, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 9, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 10, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, b1, 11, 5, 0, p_74875_3_); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, -14, 8, 12, -11, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, -10, 8, 12, -10, 12, Blocks.sandstone, 1, Blocks.sandstone, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 8, -9, 8, 12, -9, 12, Blocks.sandstone, 2, Blocks.sandstone, 2, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, -8, 8, 12, -1, 12, Blocks.sandstone, Blocks.sandstone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, -11, 9, 11, -1, 11, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_pressure_plate, 0, 10, -11, 10, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, -13, 9, 11, -13, 11, Blocks.tnt, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 8, -11, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 8, -10, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 7, -10, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 7, -11, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 12, -11, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 12, -10, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 13, -10, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 13, -11, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, -11, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, -10, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 10, -10, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 10, -11, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, -11, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, -10, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 1, 10, -10, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sandstone, 2, 10, -11, 13, p_74875_3_); + + for (l = 0; l < 4; ++l) + { + if (!this.field_74940_h[l]) + { + int i1 = Direction.offsetX[l] * 2; + int j1 = Direction.offsetZ[l] * 2; + this.field_74940_h[l] = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 10 + i1, -11, 10 + j1, ChestGenHooks.getItems(PYRAMID_DESERT_CHEST, p_74875_2_), ChestGenHooks.getCount(PYRAMID_DESERT_CHEST, p_74875_2_)); + } + } + + return true; + } + } + + abstract static class Feature extends StructureComponent + { + /** The size of the bounding box for this feature in the X axis */ + protected int scatteredFeatureSizeX; + /** The size of the bounding box for this feature in the Y axis */ + protected int scatteredFeatureSizeY; + /** The size of the bounding box for this feature in the Z axis */ + protected int scatteredFeatureSizeZ; + protected int field_74936_d = -1; + private static final String __OBFID = "CL_00000479"; + + public Feature() {} + + protected Feature(Random p_i2065_1_, int p_i2065_2_, int p_i2065_3_, int p_i2065_4_, int p_i2065_5_, int p_i2065_6_, int p_i2065_7_) + { + super(0); + this.scatteredFeatureSizeX = p_i2065_5_; + this.scatteredFeatureSizeY = p_i2065_6_; + this.scatteredFeatureSizeZ = p_i2065_7_; + this.coordBaseMode = p_i2065_1_.nextInt(4); + + switch (this.coordBaseMode) + { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_5_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_7_ - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(p_i2065_2_, p_i2065_3_, p_i2065_4_, p_i2065_2_ + p_i2065_7_ - 1, p_i2065_3_ + p_i2065_6_ - 1, p_i2065_4_ + p_i2065_5_ - 1); + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + p_143012_1_.setInteger("Width", this.scatteredFeatureSizeX); + p_143012_1_.setInteger("Height", this.scatteredFeatureSizeY); + p_143012_1_.setInteger("Depth", this.scatteredFeatureSizeZ); + p_143012_1_.setInteger("HPos", this.field_74936_d); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + this.scatteredFeatureSizeX = p_143011_1_.getInteger("Width"); + this.scatteredFeatureSizeY = p_143011_1_.getInteger("Height"); + this.scatteredFeatureSizeZ = p_143011_1_.getInteger("Depth"); + this.field_74936_d = p_143011_1_.getInteger("HPos"); + } + + protected boolean func_74935_a(World p_74935_1_, StructureBoundingBox p_74935_2_, int p_74935_3_) + { + if (this.field_74936_d >= 0) + { + return true; + } + else + { + int j = 0; + int k = 0; + + for (int l = this.boundingBox.minZ; l <= this.boundingBox.maxZ; ++l) + { + for (int i1 = this.boundingBox.minX; i1 <= this.boundingBox.maxX; ++i1) + { + if (p_74935_2_.isVecInside(i1, 64, l)) + { + j += Math.max(p_74935_1_.getTopSolidOrLiquidBlock(i1, l), p_74935_1_.provider.getAverageGroundLevel()); + ++k; + } + } + } + + if (k == 0) + { + return false; + } + else + { + this.field_74936_d = j / k; + this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + p_74935_3_, 0); + return true; + } + } + } + } + + public static class JunglePyramid extends ComponentScatteredFeaturePieces.Feature + { + private boolean field_74947_h; + private boolean field_74948_i; + private boolean field_74945_j; + private boolean field_74946_k; + /** List of Chest contents to be generated in the Jungle Pyramid chests. */ + public static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 2, 7, 15), new WeightedRandomChestContent(Items.emerald, 0, 1, 3, 2), new WeightedRandomChestContent(Items.bone, 0, 4, 6, 20), new WeightedRandomChestContent(Items.rotten_flesh, 0, 3, 7, 16), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + /** List of Dispenser contents to be generated in the Jungle Pyramid dispensers. */ + public static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.arrow, 0, 2, 7, 30)}; + /** List of random stones to be generated in the Jungle Pyramid. */ + private static ComponentScatteredFeaturePieces.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new ComponentScatteredFeaturePieces.JunglePyramid.Stones(null); + private static final String __OBFID = "CL_00000477"; + + public JunglePyramid() {} + + public JunglePyramid(Random p_i2064_1_, int p_i2064_2_, int p_i2064_3_) + { + super(p_i2064_1_, p_i2064_2_, 64, p_i2064_3_, 12, 10, 15); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("placedMainChest", this.field_74947_h); + p_143012_1_.setBoolean("placedHiddenChest", this.field_74948_i); + p_143012_1_.setBoolean("placedTrap1", this.field_74945_j); + p_143012_1_.setBoolean("placedTrap2", this.field_74946_k); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_74947_h = p_143011_1_.getBoolean("placedMainChest"); + this.field_74948_i = p_143011_1_.getBoolean("placedHiddenChest"); + this.field_74945_j = p_143011_1_.getBoolean("placedTrap1"); + this.field_74946_k = p_143011_1_.getBoolean("placedTrap2"); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (!this.func_74935_a(p_74875_1_, p_74875_3_, 0)) + { + return false; + } + else + { + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + int k = this.getMetadataWithOffset(Blocks.stone_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.stone_stairs, 1); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 2, 9, 2, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 12, 9, 2, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 1, 3, 2, 2, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 1, 3, 9, 2, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 1, 10, 6, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 13, 10, 6, 13, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 2, 1, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 10, 3, 2, 10, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 3, 2, 9, 3, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 6, 2, 9, 6, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 3, 7, 3, 8, 7, 11, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 8, 4, 7, 8, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithAir(p_74875_1_, p_74875_3_, 3, 1, 3, 8, 2, 11); + this.fillWithAir(p_74875_1_, p_74875_3_, 4, 3, 6, 7, 3, 9); + this.fillWithAir(p_74875_1_, p_74875_3_, 2, 4, 2, 9, 5, 12); + this.fillWithAir(p_74875_1_, p_74875_3_, 4, 6, 5, 7, 6, 9); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 7, 6, 6, 7, 8); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 1, 2, 6, 2, 2); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 2, 12, 6, 2, 12); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 5, 1, 6, 5, 1); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 5, 13, 6, 5, 13); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 5, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, 5, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 5, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 10, 5, 9, p_74875_3_); + int i1; + + for (i1 = 0; i1 <= 14; i1 += 14) + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 4, i1, 2, 5, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 4, i1, 4, 5, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 4, i1, 7, 5, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 4, i1, 9, 5, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 6, 0, 6, 6, 0, false, p_74875_2_, junglePyramidsRandomScatteredStones); + + for (i1 = 0; i1 <= 11; i1 += 11) + { + for (int j1 = 2; j1 <= 12; j1 += 2) + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, i1, 4, j1, i1, 5, j1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, i1, 6, 5, i1, 6, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, i1, 6, 9, i1, 6, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 7, 2, 2, 9, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 7, 2, 9, 9, 2, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, 7, 12, 2, 9, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, 7, 12, 9, 9, 12, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 9, 4, 4, 9, 4, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 9, 4, 7, 9, 4, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 9, 10, 4, 9, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 9, 10, 7, 9, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 9, 7, 6, 9, 7, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 5, 9, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 6, 9, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, j, 5, 9, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, j, 6, 9, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 4, 0, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 5, 0, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 6, 0, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 7, 0, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 4, 1, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 4, 2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 4, 3, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 7, 1, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 7, 2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 7, 3, 10, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 9, 4, 1, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, 1, 9, 7, 1, 9, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 10, 7, 2, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 4, 5, 6, 4, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, k, 4, 4, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, l, 7, 4, 5, p_74875_3_); + + for (i1 = 0; i1 < 4; ++i1) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, j, 5, 0 - i1, 6 + i1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, j, 6, 0 - i1, 6 + i1, p_74875_3_); + this.fillWithAir(p_74875_1_, p_74875_3_, 5, 0 - i1, 7 + i1, 6, 0 - i1, 9 + i1); + } + + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 12, 10, -1, 13); + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 1, 3, -1, 13); + this.fillWithAir(p_74875_1_, p_74875_3_, 1, -3, 1, 9, -1, 5); + + for (i1 = 1; i1 <= 13; i1 += 2) + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, -3, i1, 1, -2, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + for (i1 = 2; i1 <= 12; i1 += 2) + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, -1, i1, 3, -1, i1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, -2, 1, 5, -2, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 7, -2, 1, 9, -2, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 6, -3, 1, 6, -3, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 6, -1, 1, 6, -1, 1, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire_hook, this.getMetadataWithOffset(Blocks.tripwire_hook, 3) | 4, 1, -3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire_hook, this.getMetadataWithOffset(Blocks.tripwire_hook, 1) | 4, 4, -3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire, 4, 2, -3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire, 4, 3, -3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 5, -3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 4, -3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 3, -3, 1, p_74875_3_); + + ChestGenHooks dispenser = ChestGenHooks.getInfo(PYRAMID_JUNGLE_DISPENSER); + ChestGenHooks chest = ChestGenHooks.getInfo(PYRAMID_JUNGLE_CHEST); + + if (!this.field_74945_j) + { + this.field_74945_j = this.generateStructureDispenserContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.vine, 15, 3, -2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire_hook, this.getMetadataWithOffset(Blocks.tripwire_hook, 2) | 4, 7, -3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire_hook, this.getMetadataWithOffset(Blocks.tripwire_hook, 0) | 4, 7, -3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire, 4, 7, -3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire, 4, 7, -3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.tripwire, 4, 7, -3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 8, -3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 9, -3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 9, -3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 9, -3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 9, -2, 4, p_74875_3_); + + if (!this.field_74946_k) + { + this.field_74946_k = this.generateStructureDispenserContents(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.vine, 15, 8, -1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.vine, 15, 8, -2, 3, p_74875_3_); + + if (!this.field_74947_h) + { + this.field_74947_h = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 9, -3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 8, -3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 4, -3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 5, -2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 5, -1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 6, -3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 7, -2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 7, -1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 8, -3, 5, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, -1, 1, 9, -1, 5, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithAir(p_74875_1_, p_74875_3_, 8, -3, 8, 10, -1, 10); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 3, 8, -2, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 3, 9, -2, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 3, 10, -2, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.lever, BlockLever.invertMetadata(this.getMetadataWithOffset(Blocks.lever, 2)), 8, -2, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.lever, BlockLever.invertMetadata(this.getMetadataWithOffset(Blocks.lever, 2)), 9, -2, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.lever, BlockLever.invertMetadata(this.getMetadataWithOffset(Blocks.lever, 2)), 10, -2, 12, p_74875_3_); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, -3, 8, 8, -3, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 10, -3, 8, 10, -3, 10, false, p_74875_2_, junglePyramidsRandomScatteredStones); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.mossy_cobblestone, 0, 10, -2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 8, -2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 8, -2, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.redstone_wire, 0, 10, -1, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sticky_piston, 1, 9, -2, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sticky_piston, this.getMetadataWithOffset(Blocks.sticky_piston, 4), 10, -2, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.sticky_piston, this.getMetadataWithOffset(Blocks.sticky_piston, 4), 10, -1, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.unpowered_repeater, this.getMetadataWithOffset(Blocks.unpowered_repeater, 2), 10, -2, 10, p_74875_3_); + + if (!this.field_74948_i) + { + this.field_74948_i = this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); + } + + return true; + } + } + + static class Stones extends StructureComponent.BlockSelector + { + private static final String __OBFID = "CL_00000478"; + + private Stones() {} + + /** + * picks Block Ids and Metadata (Silverfish) + */ + public void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) + { + if (p_75062_1_.nextFloat() < 0.4F) + { + this.field_151562_a = Blocks.cobblestone; + } + else + { + this.field_151562_a = Blocks.mossy_cobblestone; + } + } + + Stones(Object p_i2063_1_) + { + this(); + } + } + } + + public static class SwampHut extends ComponentScatteredFeaturePieces.Feature + { + /** Whether this swamp hut has a witch. */ + private boolean hasWitch; + private static final String __OBFID = "CL_00000480"; + + public SwampHut() {} + + public SwampHut(Random p_i2066_1_, int p_i2066_2_, int p_i2066_3_) + { + super(p_i2066_1_, p_i2066_2_, 64, p_i2066_3_, 7, 5, 9); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Witch", this.hasWitch); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.hasWitch = p_143011_1_.getBoolean("Witch"); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (!this.func_74935_a(p_74875_1_, p_74875_3_, 0)) + { + return false; + } + else + { + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 5, 1, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 1, 4, 2, 5, 4, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 2, 1, 0, 4, 1, 0, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 2, 2, 2, 3, 3, 2, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 1, 2, 3, 1, 3, 6, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 5, 2, 3, 5, 3, 6, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 2, 2, 7, 4, 3, 7, Blocks.planks, 1, Blocks.planks, 1, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 2, 1, 3, 2, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 0, 2, 5, 3, 2, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 7, 1, 3, 7, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 0, 7, 5, 3, 7, Blocks.log, Blocks.log, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 2, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 3, 3, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 5, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 5, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.flower_pot, 7, 1, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.crafting_table, 0, 3, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cauldron, 0, 4, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 5, 2, 1, p_74875_3_); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + int k = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + int l = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 0, 4, 1, 6, 4, 1, Blocks.spruce_stairs, i, Blocks.spruce_stairs, i, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 0, 4, 2, 0, 4, 7, Blocks.spruce_stairs, k, Blocks.spruce_stairs, k, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 6, 4, 2, 6, 4, 7, Blocks.spruce_stairs, j, Blocks.spruce_stairs, j, false); + this.fillWithMetadataBlocks(p_74875_1_, p_74875_3_, 0, 4, 8, 6, 4, 8, Blocks.spruce_stairs, l, Blocks.spruce_stairs, l, false); + int i1; + int j1; + + for (i1 = 2; i1 <= 7; i1 += 5) + { + for (j1 = 1; j1 <= 5; j1 += 4) + { + this.func_151554_b(p_74875_1_, Blocks.log, 0, j1, -1, i1, p_74875_3_); + } + } + + if (!this.hasWitch) + { + i1 = this.getXWithOffset(2, 5); + j1 = this.getYWithOffset(2); + int k1 = this.getZWithOffset(2, 5); + + if (p_74875_3_.isVecInside(i1, j1, k1)) + { + this.hasWitch = true; + EntityWitch entitywitch = new EntityWitch(p_74875_1_); + entitywitch.setLocationAndAngles((double)i1 + 0.5D, (double)j1, (double)k1 + 0.5D, 0.0F, 0.0F); + entitywitch.onSpawnWithEgg((IEntityLivingData)null); + p_74875_1_.spawnEntityInWorld(entitywitch); + } + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenMineshaft.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenMineshaft.java new file mode 100644 index 0000000..54a2fd2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenMineshaft.java @@ -0,0 +1,44 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import net.minecraft.util.MathHelper; + +public class MapGenMineshaft extends MapGenStructure +{ + private double field_82673_e = 0.004D; + private static final String __OBFID = "CL_00000443"; + + public MapGenMineshaft() {} + + public String func_143025_a() + { + return "Mineshaft"; + } + + public MapGenMineshaft(Map p_i2034_1_) + { + Iterator iterator = p_i2034_1_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((String)entry.getKey()).equals("chance")) + { + this.field_82673_e = MathHelper.parseDoubleWithDefault((String)entry.getValue(), this.field_82673_e); + } + } + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(p_75047_1_), Math.abs(p_75047_2_)); + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + return new StructureMineshaftStart(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java new file mode 100644 index 0000000..77cb476 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java @@ -0,0 +1,75 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import net.minecraft.entity.monster.EntityBlaze; +import net.minecraft.entity.monster.EntityMagmaCube; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenNetherBridge extends MapGenStructure +{ + private List spawnList = new ArrayList(); + private static final String __OBFID = "CL_00000451"; + + public MapGenNetherBridge() + { + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); + this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); + } + + public String func_143025_a() + { + return "Fortress"; + } + + public List getSpawnList() + { + return this.spawnList; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + int k = p_75047_1_ >> 4; + int l = p_75047_2_ >> 4; + this.rand.setSeed((long)(k ^ l << 4) ^ this.worldObj.getSeed()); + this.rand.nextInt(); + return this.rand.nextInt(3) != 0 ? false : (p_75047_1_ != (k << 4) + 4 + this.rand.nextInt(8) ? false : p_75047_2_ == (l << 4) + 4 + this.rand.nextInt(8)); + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + return new MapGenNetherBridge.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } + + public static class Start extends StructureStart + { + private static final String __OBFID = "CL_00000452"; + + public Start() {} + + public Start(World p_i2040_1_, Random p_i2040_2_, int p_i2040_3_, int p_i2040_4_) + { + super(p_i2040_3_, p_i2040_4_); + StructureNetherBridgePieces.Start start = new StructureNetherBridgePieces.Start(p_i2040_2_, (p_i2040_3_ << 4) + 2, (p_i2040_4_ << 4) + 2); + this.components.add(start); + start.buildComponent(start, this.components, p_i2040_2_); + ArrayList arraylist = start.field_74967_d; + + while (!arraylist.isEmpty()) + { + int k = p_i2040_2_.nextInt(arraylist.size()); + StructureComponent structurecomponent = (StructureComponent)arraylist.remove(k); + structurecomponent.buildComponent(start, this.components, p_i2040_2_); + } + + this.updateBoundingBox(); + this.setRandomHeight(p_i2040_1_, p_i2040_2_, 48, 70); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java new file mode 100644 index 0000000..3ce304c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenScatteredFeature.java @@ -0,0 +1,158 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenScatteredFeature extends MapGenStructure +{ + private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); + /** contains possible spawns for scattered features */ + private List scatteredFeatureSpawnList; + /** the maximum distance between scattered features */ + private int maxDistanceBetweenScatteredFeatures; + /** the minimum distance between scattered features */ + private int minDistanceBetweenScatteredFeatures; + private static final String __OBFID = "CL_00000471"; + + public MapGenScatteredFeature() + { + this.scatteredFeatureSpawnList = new ArrayList(); + this.maxDistanceBetweenScatteredFeatures = 32; + this.minDistanceBetweenScatteredFeatures = 8; + this.scatteredFeatureSpawnList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + + public MapGenScatteredFeature(Map p_i2061_1_) + { + this(); + Iterator iterator = p_i2061_1_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((String)entry.getKey()).equals("distance")) + { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, this.minDistanceBetweenScatteredFeatures + 1); + } + } + } + + public String func_143025_a() + { + return "Temple"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + int k = p_75047_1_; + int l = p_75047_2_; + + if (p_75047_1_ < 0) + { + p_75047_1_ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + if (p_75047_2_ < 0) + { + p_75047_2_ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + int i1 = p_75047_1_ / this.maxDistanceBetweenScatteredFeatures; + int j1 = p_75047_2_ / this.maxDistanceBetweenScatteredFeatures; + Random random = this.worldObj.setRandomSeed(i1, j1, 14357617); + i1 *= this.maxDistanceBetweenScatteredFeatures; + j1 *= this.maxDistanceBetweenScatteredFeatures; + i1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + j1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + + if (k == i1 && l == j1) + { + BiomeGenBase biomegenbase = this.worldObj.getWorldChunkManager().getBiomeGenAt(k * 16 + 8, l * 16 + 8); + Iterator iterator = biomelist.iterator(); + + while (iterator.hasNext()) + { + BiomeGenBase biomegenbase1 = (BiomeGenBase)iterator.next(); + + if (biomegenbase == biomegenbase1) + { + return true; + } + } + } + + return false; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + return new MapGenScatteredFeature.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); + } + + public boolean func_143030_a(int p_143030_1_, int p_143030_2_, int p_143030_3_) + { + StructureStart structurestart = this.func_143028_c(p_143030_1_, p_143030_2_, p_143030_3_); + + if (structurestart != null && structurestart instanceof MapGenScatteredFeature.Start && !structurestart.components.isEmpty()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.components.getFirst(); + return structurecomponent instanceof ComponentScatteredFeaturePieces.SwampHut; + } + else + { + return false; + } + } + + /** + * returns possible spawns for scattered features + */ + public List getScatteredFeatureSpawnList() + { + return this.scatteredFeatureSpawnList; + } + + public static class Start extends StructureStart + { + private static final String __OBFID = "CL_00000472"; + + public Start() {} + + public Start(World p_i2060_1_, Random p_i2060_2_, int p_i2060_3_, int p_i2060_4_) + { + super(p_i2060_3_, p_i2060_4_); + BiomeGenBase biomegenbase = p_i2060_1_.getBiomeGenForCoords(p_i2060_3_ * 16 + 8, p_i2060_4_ * 16 + 8); + + if (biomegenbase != BiomeGenBase.jungle && biomegenbase != BiomeGenBase.jungleHills) + { + if (biomegenbase == BiomeGenBase.swampland) + { + ComponentScatteredFeaturePieces.SwampHut swamphut = new ComponentScatteredFeaturePieces.SwampHut(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(swamphut); + } + else + { + ComponentScatteredFeaturePieces.DesertPyramid desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(desertpyramid); + } + } + else + { + ComponentScatteredFeaturePieces.JunglePyramid junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid(p_i2060_2_, p_i2060_3_ * 16, p_i2060_4_ * 16); + this.components.add(junglepyramid); + } + + this.updateBoundingBox(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStronghold.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStronghold.java new file mode 100644 index 0000000..1393906 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStronghold.java @@ -0,0 +1,194 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.util.MathHelper; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeManager; + +public class MapGenStronghold extends MapGenStructure +{ + public final List field_151546_e; + /** is spawned false and set true once the defined BiomeGenBases were compared with the present ones */ + private boolean ranBiomeCheck; + private ChunkCoordIntPair[] structureCoords; + private double field_82671_h; + private int field_82672_i; + private static final String __OBFID = "CL_00000481"; + + public MapGenStronghold() + { + this.structureCoords = new ChunkCoordIntPair[3]; + this.field_82671_h = 32.0D; + this.field_82672_i = 3; + this.field_151546_e = new ArrayList(); + BiomeGenBase[] abiomegenbase = BiomeGenBase.getBiomeGenArray(); + int i = abiomegenbase.length; + + for (int j = 0; j < i; ++j) + { + BiomeGenBase biomegenbase = abiomegenbase[j]; + + if (biomegenbase != null && biomegenbase.rootHeight > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) + { + this.field_151546_e.add(biomegenbase); + } + } + for (BiomeGenBase biome : BiomeManager.strongHoldBiomes) + { + if (!this.field_151546_e.contains(biome)) + { + this.field_151546_e.add(biome); + } + } + } + + public MapGenStronghold(Map p_i2068_1_) + { + this(); + Iterator iterator = p_i2068_1_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((String)entry.getKey()).equals("distance")) + { + this.field_82671_h = MathHelper.parseDoubleWithDefaultAndMax((String)entry.getValue(), this.field_82671_h, 1.0D); + } + else if (((String)entry.getKey()).equals("count")) + { + this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.structureCoords.length, 1)]; + } + else if (((String)entry.getKey()).equals("spread")) + { + this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82672_i, 1); + } + } + } + + public String func_143025_a() + { + return "Stronghold"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + if (!this.ranBiomeCheck) + { + Random random = new Random(); + random.setSeed(this.worldObj.getSeed()); + double d0 = random.nextDouble() * Math.PI * 2.0D; + int l = 1; + + for (int i1 = 0; i1 < this.structureCoords.length; ++i1) + { + double d1 = (1.25D * (double)l + random.nextDouble()) * this.field_82671_h * (double)l; + int j1 = (int)Math.round(Math.cos(d0) * d1); + int k1 = (int)Math.round(Math.sin(d0) * d1); + ChunkPosition chunkposition = this.worldObj.getWorldChunkManager().findBiomePosition((j1 << 4) + 8, (k1 << 4) + 8, 112, this.field_151546_e, random); + + if (chunkposition != null) + { + j1 = chunkposition.chunkPosX >> 4; + k1 = chunkposition.chunkPosZ >> 4; + } + + this.structureCoords[i1] = new ChunkCoordIntPair(j1, k1); + d0 += (Math.PI * 2D) * (double)l / (double)this.field_82672_i; + + if (i1 == this.field_82672_i) + { + l += 2 + random.nextInt(5); + this.field_82672_i += 1 + random.nextInt(2); + } + } + + this.ranBiomeCheck = true; + } + + ChunkCoordIntPair[] achunkcoordintpair = this.structureCoords; + int l1 = achunkcoordintpair.length; + + for (int k = 0; k < l1; ++k) + { + ChunkCoordIntPair chunkcoordintpair = achunkcoordintpair[k]; + + if (p_75047_1_ == chunkcoordintpair.chunkXPos && p_75047_2_ == chunkcoordintpair.chunkZPos) + { + return true; + } + } + + return false; + } + + /** + * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() + { + ArrayList arraylist = new ArrayList(); + ChunkCoordIntPair[] achunkcoordintpair = this.structureCoords; + int i = achunkcoordintpair.length; + + for (int j = 0; j < i; ++j) + { + ChunkCoordIntPair chunkcoordintpair = achunkcoordintpair[j]; + + if (chunkcoordintpair != null) + { + arraylist.add(chunkcoordintpair.func_151349_a(64)); + } + } + + return arraylist; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + MapGenStronghold.Start start; + + for (start = new MapGenStronghold.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); start.getComponents().isEmpty() || ((StructureStrongholdPieces.Stairs2)start.getComponents().get(0)).strongholdPortalRoom == null; start = new MapGenStronghold.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_)) + { + ; + } + + return start; + } + + public static class Start extends StructureStart + { + private static final String __OBFID = "CL_00000482"; + + public Start() {} + + public Start(World p_i2067_1_, Random p_i2067_2_, int p_i2067_3_, int p_i2067_4_) + { + super(p_i2067_3_, p_i2067_4_); + StructureStrongholdPieces.prepareStructurePieces(); + StructureStrongholdPieces.Stairs2 stairs2 = new StructureStrongholdPieces.Stairs2(0, p_i2067_2_, (p_i2067_3_ << 4) + 2, (p_i2067_4_ << 4) + 2); + this.components.add(stairs2); + stairs2.buildComponent(stairs2, this.components, p_i2067_2_); + List list = stairs2.field_75026_c; + + while (!list.isEmpty()) + { + int k = p_i2067_2_.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent)list.remove(k); + structurecomponent.buildComponent(stairs2, this.components, p_i2067_2_); + } + + this.updateBoundingBox(); + this.markAvailableHeight(p_i2067_1_, p_i2067_2_, 10); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructure.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructure.java new file mode 100644 index 0000000..3a4c7cd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructure.java @@ -0,0 +1,304 @@ +package net.minecraft.world.gen.structure; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.Callable; +import net.minecraft.block.Block; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ReportedException; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraft.world.gen.MapGenBase; + +public abstract class MapGenStructure extends MapGenBase +{ + private MapGenStructureData field_143029_e; + /** + * Used to store a list of all structures that have been recursively generated. Used so that during recursive + * generation, the structure generator can avoid generating structures that intersect ones that have already been + * placed. + */ + protected Map structureMap = new HashMap(); + private static final String __OBFID = "CL_00000505"; + + public abstract String func_143025_a(); + + protected final void func_151538_a(World worldIn, final int p_151538_2_, final int p_151538_3_, int p_151538_4_, int p_151538_5_, Block[] p_151538_6_) + { + this.func_143027_a(worldIn); + + if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)))) + { + this.rand.nextInt(); + + try + { + if (this.canSpawnStructureAtCoords(p_151538_2_, p_151538_3_)) + { + StructureStart structurestart = this.getStructureStart(p_151538_2_, p_151538_3_); + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)), structurestart); + this.func_143026_a(p_151538_2_, p_151538_3_, structurestart); + } + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception preparing structure feature"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Feature being prepared"); + crashreportcategory.addCrashSectionCallable("Is feature chunk", new Callable() + { + private static final String __OBFID = "CL_00000506"; + public String call() + { + return MapGenStructure.this.canSpawnStructureAtCoords(p_151538_2_, p_151538_3_) ? "True" : "False"; + } + }); + crashreportcategory.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(p_151538_2_), Integer.valueOf(p_151538_3_)})); + crashreportcategory.addCrashSectionCallable("Chunk pos hash", new Callable() + { + private static final String __OBFID = "CL_00000507"; + public String call() + { + return String.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_151538_2_, p_151538_3_)); + } + }); + crashreportcategory.addCrashSectionCallable("Structure type", new Callable() + { + private static final String __OBFID = "CL_00000508"; + public String call() + { + return MapGenStructure.this.getClass().getCanonicalName(); + } + }); + throw new ReportedException(crashreport); + } + } + } + + /** + * Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts. + */ + public boolean generateStructuresInChunk(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_) + { + this.func_143027_a(p_75051_1_); + int k = (p_75051_3_ << 4) + 8; + int l = (p_75051_4_ << 4) + 8; + boolean flag = false; + Iterator iterator = this.structureMap.values().iterator(); + + while (iterator.hasNext()) + { + StructureStart structurestart = (StructureStart)iterator.next(); + + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().intersectsWith(k, l, k + 15, l + 15)) + { + structurestart.generateStructure(p_75051_1_, p_75051_2_, new StructureBoundingBox(k, l, k + 15, l + 15)); + flag = true; + this.func_143026_a(structurestart.func_143019_e(), structurestart.func_143018_f(), structurestart); + } + } + + return flag; + } + + /** + * Returns true if the structure generator has generated a structure located at the given position tuple. + */ + public boolean hasStructureAt(int p_75048_1_, int p_75048_2_, int p_75048_3_) + { + this.func_143027_a(this.worldObj); + return this.func_143028_c(p_75048_1_, p_75048_2_, p_75048_3_) != null; + } + + protected StructureStart func_143028_c(int p_143028_1_, int p_143028_2_, int p_143028_3_) + { + Iterator iterator = this.structureMap.values().iterator(); + + while (iterator.hasNext()) + { + StructureStart structurestart = (StructureStart)iterator.next(); + + if (structurestart.isSizeableStructure() && structurestart.getBoundingBox().intersectsWith(p_143028_1_, p_143028_3_, p_143028_1_, p_143028_3_)) + { + Iterator iterator1 = structurestart.getComponents().iterator(); + + while (iterator1.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator1.next(); + + if (structurecomponent.getBoundingBox().isVecInside(p_143028_1_, p_143028_2_, p_143028_3_)) + { + return structurestart; + } + } + } + } + + return null; + } + + public boolean func_142038_b(int p_142038_1_, int p_142038_2_, int p_142038_3_) + { + this.func_143027_a(this.worldObj); + Iterator iterator = this.structureMap.values().iterator(); + StructureStart structurestart; + + do + { + if (!iterator.hasNext()) + { + return false; + } + + structurestart = (StructureStart)iterator.next(); + } + while (!structurestart.isSizeableStructure()); + + return structurestart.getBoundingBox().intersectsWith(p_142038_1_, p_142038_3_, p_142038_1_, p_142038_3_); + } + + public ChunkPosition func_151545_a(World p_151545_1_, int p_151545_2_, int p_151545_3_, int p_151545_4_) + { + this.worldObj = p_151545_1_; + this.func_143027_a(p_151545_1_); + this.rand.setSeed(p_151545_1_.getSeed()); + long l = this.rand.nextLong(); + long i1 = this.rand.nextLong(); + long j1 = (long)(p_151545_2_ >> 4) * l; + long k1 = (long)(p_151545_4_ >> 4) * i1; + this.rand.setSeed(j1 ^ k1 ^ p_151545_1_.getSeed()); + this.func_151538_a(p_151545_1_, p_151545_2_ >> 4, p_151545_4_ >> 4, 0, 0, (Block[])null); + double d0 = Double.MAX_VALUE; + ChunkPosition chunkposition = null; + Iterator iterator = this.structureMap.values().iterator(); + ChunkPosition chunkposition1; + int l1; + int i2; + int j2; + double d1; + + while (iterator.hasNext()) + { + StructureStart structurestart = (StructureStart)iterator.next(); + + if (structurestart.isSizeableStructure()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.getComponents().get(0); + chunkposition1 = structurecomponent.func_151553_a(); + l1 = chunkposition1.chunkPosX - p_151545_2_; + i2 = chunkposition1.chunkPosY - p_151545_3_; + j2 = chunkposition1.chunkPosZ - p_151545_4_; + d1 = (double)(l1 * l1 + i2 * i2 + j2 * j2); + + if (d1 < d0) + { + d0 = d1; + chunkposition = chunkposition1; + } + } + } + + if (chunkposition != null) + { + return chunkposition; + } + else + { + List list = this.getCoordList(); + + if (list != null) + { + ChunkPosition chunkposition2 = null; + Iterator iterator1 = list.iterator(); + + while (iterator1.hasNext()) + { + chunkposition1 = (ChunkPosition)iterator1.next(); + l1 = chunkposition1.chunkPosX - p_151545_2_; + i2 = chunkposition1.chunkPosY - p_151545_3_; + j2 = chunkposition1.chunkPosZ - p_151545_4_; + d1 = (double)(l1 * l1 + i2 * i2 + j2 * j2); + + if (d1 < d0) + { + d0 = d1; + chunkposition2 = chunkposition1; + } + } + + return chunkposition2; + } + else + { + return null; + } + } + } + + /** + * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this + * structure generator. + */ + protected List getCoordList() + { + return null; + } + + private void func_143027_a(World p_143027_1_) + { + if (this.field_143029_e == null) + { + this.field_143029_e = (MapGenStructureData)p_143027_1_.perWorldStorage.loadData(MapGenStructureData.class, this.func_143025_a()); + + if (this.field_143029_e == null) + { + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); + p_143027_1_.perWorldStorage.setData(this.func_143025_a(), this.field_143029_e); + } + else + { + NBTTagCompound nbttagcompound = this.field_143029_e.func_143041_a(); + Iterator iterator = nbttagcompound.func_150296_c().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTBase nbtbase = nbttagcompound.getTag(s); + + if (nbtbase.getId() == 10) + { + NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase; + + if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ")) + { + int i = nbttagcompound1.getInteger("ChunkX"); + int j = nbttagcompound1.getInteger("ChunkZ"); + StructureStart structurestart = MapGenStructureIO.func_143035_a(nbttagcompound1, p_143027_1_); + + if (structurestart != null) + { + this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart); + } + } + } + } + } + } + } + + private void func_143026_a(int p_143026_1_, int p_143026_2_, StructureStart p_143026_3_) + { + this.field_143029_e.func_143043_a(p_143026_3_.func_143021_a(p_143026_1_, p_143026_2_), p_143026_1_, p_143026_2_); + this.field_143029_e.markDirty(); + } + + protected abstract boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_); + + protected abstract StructureStart getStructureStart(int p_75049_1_, int p_75049_2_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureData.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureData.java new file mode 100644 index 0000000..8942125 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureData.java @@ -0,0 +1,46 @@ +package net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + +public class MapGenStructureData extends WorldSavedData +{ + private NBTTagCompound field_143044_a = new NBTTagCompound(); + private static final String __OBFID = "CL_00000510"; + + public MapGenStructureData(String p_i43001_1_) + { + super(p_i43001_1_); + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound p_76184_1_) + { + this.field_143044_a = p_76184_1_.getCompoundTag("Features"); + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound p_76187_1_) + { + p_76187_1_.setTag("Features", this.field_143044_a); + } + + public void func_143043_a(NBTTagCompound p_143043_1_, int p_143043_2_, int p_143043_3_) + { + this.field_143044_a.setTag(func_143042_b(p_143043_2_, p_143043_3_), p_143043_1_); + } + + public static String func_143042_b(int p_143042_0_, int p_143042_1_) + { + return "[" + p_143042_0_ + "," + p_143042_1_ + "]"; + } + + public NBTTagCompound func_143041_a() + { + return this.field_143044_a; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureIO.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureIO.java new file mode 100644 index 0000000..fe492d7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenStructureIO.java @@ -0,0 +1,116 @@ +package net.minecraft.world.gen.structure; + +import java.util.HashMap; +import java.util.Map; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class MapGenStructureIO +{ + private static final Logger logger = LogManager.getLogger(); + private static Map field_143040_a = new HashMap(); + private static Map field_143038_b = new HashMap(); + private static Map field_143039_c = new HashMap(); + private static Map field_143037_d = new HashMap(); + private static final String __OBFID = "CL_00000509"; + + public static void registerStructure(Class p_143034_0_, String p_143034_1_) + { + field_143040_a.put(p_143034_1_, p_143034_0_); + field_143038_b.put(p_143034_0_, p_143034_1_); + } + + public static void func_143031_a(Class p_143031_0_, String p_143031_1_) + { + field_143039_c.put(p_143031_1_, p_143031_0_); + field_143037_d.put(p_143031_0_, p_143031_1_); + } + + public static String func_143033_a(StructureStart p_143033_0_) + { + return (String)field_143038_b.get(p_143033_0_.getClass()); + } + + public static String func_143036_a(StructureComponent p_143036_0_) + { + return (String)field_143037_d.get(p_143036_0_.getClass()); + } + + public static StructureStart func_143035_a(NBTTagCompound p_143035_0_, World p_143035_1_) + { + StructureStart structurestart = null; + + try + { + Class oclass = (Class)field_143040_a.get(p_143035_0_.getString("id")); + + if (oclass != null) + { + structurestart = (StructureStart)oclass.newInstance(); + } + } + catch (Exception exception) + { + logger.warn("Failed Start with id " + p_143035_0_.getString("id")); + exception.printStackTrace(); + } + + if (structurestart != null) + { + structurestart.func_143020_a(p_143035_1_, p_143035_0_); + } + else + { + logger.warn("Skipping Structure with id " + p_143035_0_.getString("id")); + } + + return structurestart; + } + + public static StructureComponent func_143032_b(NBTTagCompound p_143032_0_, World p_143032_1_) + { + StructureComponent structurecomponent = null; + + try + { + Class oclass = (Class)field_143039_c.get(p_143032_0_.getString("id")); + + if (oclass != null) + { + structurecomponent = (StructureComponent)oclass.newInstance(); + } + } + catch (Exception exception) + { + logger.warn("Failed Piece with id " + p_143032_0_.getString("id")); + exception.printStackTrace(); + } + + if (structurecomponent != null) + { + structurecomponent.func_143009_a(p_143032_1_, p_143032_0_); + } + else + { + logger.warn("Skipping Piece with id " + p_143032_0_.getString("id")); + } + + return structurecomponent; + } + + static + { + registerStructure(StructureMineshaftStart.class, "Mineshaft"); + registerStructure(MapGenVillage.Start.class, "Village"); + registerStructure(MapGenNetherBridge.Start.class, "Fortress"); + registerStructure(MapGenStronghold.Start.class, "Stronghold"); + registerStructure(MapGenScatteredFeature.Start.class, "Temple"); + StructureMineshaftPieces.registerStructurePieces(); + StructureVillagePieces.registerVillagePieces(); + StructureNetherBridgePieces.registerNetherFortressPieces(); + StructureStrongholdPieces.registerStrongholdPieces(); + ComponentScatteredFeaturePieces.registerScatteredFeaturePieces(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenVillage.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenVillage.java new file mode 100644 index 0000000..462bfe4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/MapGenVillage.java @@ -0,0 +1,170 @@ +package net.minecraft.world.gen.structure; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Map.Entry; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +public class MapGenVillage extends MapGenStructure +{ + /** A list of all the biomes villages can spawn in. */ + public static List villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.savanna}); + /** World terrain type, 0 for normal, 1 for flat map */ + private int terrainType; + private int field_82665_g; + private int field_82666_h; + private static final String __OBFID = "CL_00000514"; + + public MapGenVillage() + { + this.field_82665_g = 32; + this.field_82666_h = 8; + } + + public MapGenVillage(Map p_i2093_1_) + { + this(); + Iterator iterator = p_i2093_1_.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((String)entry.getKey()).equals("size")) + { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.terrainType, 0); + } + else if (((String)entry.getKey()).equals("distance")) + { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82665_g, this.field_82666_h + 1); + } + } + } + + public String func_143025_a() + { + return "Village"; + } + + protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) + { + int k = p_75047_1_; + int l = p_75047_2_; + + if (p_75047_1_ < 0) + { + p_75047_1_ -= this.field_82665_g - 1; + } + + if (p_75047_2_ < 0) + { + p_75047_2_ -= this.field_82665_g - 1; + } + + int i1 = p_75047_1_ / this.field_82665_g; + int j1 = p_75047_2_ / this.field_82665_g; + Random random = this.worldObj.setRandomSeed(i1, j1, 10387312); + i1 *= this.field_82665_g; + j1 *= this.field_82665_g; + i1 += random.nextInt(this.field_82665_g - this.field_82666_h); + j1 += random.nextInt(this.field_82665_g - this.field_82666_h); + + if (k == i1 && l == j1) + { + boolean flag = this.worldObj.getWorldChunkManager().areBiomesViable(k * 16 + 8, l * 16 + 8, 0, villageSpawnBiomes); + + if (flag) + { + return true; + } + } + + return false; + } + + protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) + { + return new MapGenVillage.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_, this.terrainType); + } + + public static class Start extends StructureStart + { + /** well ... thats what it does */ + private boolean hasMoreThanTwoComponents; + private static final String __OBFID = "CL_00000515"; + + public Start() {} + + public Start(World p_i2092_1_, Random p_i2092_2_, int p_i2092_3_, int p_i2092_4_, int p_i2092_5_) + { + super(p_i2092_3_, p_i2092_4_); + List list = StructureVillagePieces.getStructureVillageWeightedPieceList(p_i2092_2_, p_i2092_5_); + StructureVillagePieces.Start start = new StructureVillagePieces.Start(p_i2092_1_.getWorldChunkManager(), 0, p_i2092_2_, (p_i2092_3_ << 4) + 2, (p_i2092_4_ << 4) + 2, list, p_i2092_5_); + this.components.add(start); + start.buildComponent(start, this.components, p_i2092_2_); + List list1 = start.field_74930_j; + List list2 = start.field_74932_i; + int l; + + while (!list1.isEmpty() || !list2.isEmpty()) + { + StructureComponent structurecomponent; + + if (list1.isEmpty()) + { + l = p_i2092_2_.nextInt(list2.size()); + structurecomponent = (StructureComponent)list2.remove(l); + structurecomponent.buildComponent(start, this.components, p_i2092_2_); + } + else + { + l = p_i2092_2_.nextInt(list1.size()); + structurecomponent = (StructureComponent)list1.remove(l); + structurecomponent.buildComponent(start, this.components, p_i2092_2_); + } + } + + this.updateBoundingBox(); + l = 0; + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent1 = (StructureComponent)iterator.next(); + + if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) + { + ++l; + } + } + + this.hasMoreThanTwoComponents = l > 2; + } + + /** + * currently only defined for Villages, returns true if Village has more than 2 non-road components + */ + public boolean isSizeableStructure() + { + return this.hasMoreThanTwoComponents; + } + + public void func_143022_a(NBTTagCompound p_143022_1_) + { + super.func_143022_a(p_143022_1_); + p_143022_1_.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + public void func_143017_b(NBTTagCompound p_143017_1_) + { + super.func_143017_b(p_143017_1_); + this.hasMoreThanTwoComponents = p_143017_1_.getBoolean("Valid"); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureBoundingBox.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureBoundingBox.java new file mode 100644 index 0000000..a6d0b33 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureBoundingBox.java @@ -0,0 +1,192 @@ +package net.minecraft.world.gen.structure; + +import net.minecraft.nbt.NBTTagIntArray; + +public class StructureBoundingBox +{ + /** The first x coordinate of a bounding box. */ + public int minX; + /** The first y coordinate of a bounding box. */ + public int minY; + /** The first z coordinate of a bounding box. */ + public int minZ; + /** The second x coordinate of a bounding box. */ + public int maxX; + /** The second y coordinate of a bounding box. */ + public int maxY; + /** The second z coordinate of a bounding box. */ + public int maxZ; + private static final String __OBFID = "CL_00000442"; + + public StructureBoundingBox() {} + + public StructureBoundingBox(int[] p_i43000_1_) + { + if (p_i43000_1_.length == 6) + { + this.minX = p_i43000_1_[0]; + this.minY = p_i43000_1_[1]; + this.minZ = p_i43000_1_[2]; + this.maxX = p_i43000_1_[3]; + this.maxY = p_i43000_1_[4]; + this.maxZ = p_i43000_1_[5]; + } + } + + /** + * returns a new StructureBoundingBox with MAX values + */ + public static StructureBoundingBox getNewBoundingBox() + { + return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); + } + + /** + * used to project a possible new component Bounding Box - to check if it would cut anything already spawned + */ + public static StructureBoundingBox getComponentToAddBoundingBox(int p_78889_0_, int p_78889_1_, int p_78889_2_, int p_78889_3_, int p_78889_4_, int p_78889_5_, int p_78889_6_, int p_78889_7_, int p_78889_8_, int p_78889_9_) + { + switch (p_78889_9_) + { + case 0: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_8_ - 1 + p_78889_5_); + case 1: + return new StructureBoundingBox(p_78889_0_ - p_78889_8_ + 1 + p_78889_5_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_3_, p_78889_0_ + p_78889_5_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_6_ - 1 + p_78889_3_); + case 2: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ - p_78889_8_ + 1 + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_5_); + case 3: + return new StructureBoundingBox(p_78889_0_ + p_78889_5_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_3_, p_78889_0_ + p_78889_8_ - 1 + p_78889_5_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_6_ - 1 + p_78889_3_); + default: + return new StructureBoundingBox(p_78889_0_ + p_78889_3_, p_78889_1_ + p_78889_4_, p_78889_2_ + p_78889_5_, p_78889_0_ + p_78889_6_ - 1 + p_78889_3_, p_78889_1_ + p_78889_7_ - 1 + p_78889_4_, p_78889_2_ + p_78889_8_ - 1 + p_78889_5_); + } + } + + public StructureBoundingBox(StructureBoundingBox p_i2031_1_) + { + this.minX = p_i2031_1_.minX; + this.minY = p_i2031_1_.minY; + this.minZ = p_i2031_1_.minZ; + this.maxX = p_i2031_1_.maxX; + this.maxY = p_i2031_1_.maxY; + this.maxZ = p_i2031_1_.maxZ; + } + + public StructureBoundingBox(int p_i2032_1_, int p_i2032_2_, int p_i2032_3_, int p_i2032_4_, int p_i2032_5_, int p_i2032_6_) + { + this.minX = p_i2032_1_; + this.minY = p_i2032_2_; + this.minZ = p_i2032_3_; + this.maxX = p_i2032_4_; + this.maxY = p_i2032_5_; + this.maxZ = p_i2032_6_; + } + + public StructureBoundingBox(int p_i2033_1_, int p_i2033_2_, int p_i2033_3_, int p_i2033_4_) + { + this.minX = p_i2033_1_; + this.minZ = p_i2033_2_; + this.maxX = p_i2033_3_; + this.maxZ = p_i2033_4_; + this.minY = 1; + this.maxY = 512; + } + + /** + * Returns whether the given bounding box intersects with this one. Args: structureboundingbox + */ + public boolean intersectsWith(StructureBoundingBox p_78884_1_) + { + return this.maxX >= p_78884_1_.minX && this.minX <= p_78884_1_.maxX && this.maxZ >= p_78884_1_.minZ && this.minZ <= p_78884_1_.maxZ && this.maxY >= p_78884_1_.minY && this.minY <= p_78884_1_.maxY; + } + + /** + * Discover if a coordinate is inside the bounding box area. + */ + public boolean intersectsWith(int p_78885_1_, int p_78885_2_, int p_78885_3_, int p_78885_4_) + { + return this.maxX >= p_78885_1_ && this.minX <= p_78885_3_ && this.maxZ >= p_78885_2_ && this.minZ <= p_78885_4_; + } + + /** + * Expands a bounding box's dimensions to include the supplied bounding box. + */ + public void expandTo(StructureBoundingBox p_78888_1_) + { + this.minX = Math.min(this.minX, p_78888_1_.minX); + this.minY = Math.min(this.minY, p_78888_1_.minY); + this.minZ = Math.min(this.minZ, p_78888_1_.minZ); + this.maxX = Math.max(this.maxX, p_78888_1_.maxX); + this.maxY = Math.max(this.maxY, p_78888_1_.maxY); + this.maxZ = Math.max(this.maxZ, p_78888_1_.maxZ); + } + + /** + * Offsets the current bounding box by the specified coordinates. Args: x, y, z + */ + public void offset(int p_78886_1_, int p_78886_2_, int p_78886_3_) + { + this.minX += p_78886_1_; + this.minY += p_78886_2_; + this.minZ += p_78886_3_; + this.maxX += p_78886_1_; + this.maxY += p_78886_2_; + this.maxZ += p_78886_3_; + } + + /** + * Returns true if block is inside bounding box + */ + public boolean isVecInside(int p_78890_1_, int p_78890_2_, int p_78890_3_) + { + return p_78890_1_ >= this.minX && p_78890_1_ <= this.maxX && p_78890_3_ >= this.minZ && p_78890_3_ <= this.maxZ && p_78890_2_ >= this.minY && p_78890_2_ <= this.maxY; + } + + /** + * Returns width of a bounding box + */ + public int getXSize() + { + return this.maxX - this.minX + 1; + } + + /** + * Returns height of a bounding box + */ + public int getYSize() + { + return this.maxY - this.minY + 1; + } + + /** + * Returns length of a bounding box + */ + public int getZSize() + { + return this.maxZ - this.minZ + 1; + } + + public int getCenterX() + { + return this.minX + (this.maxX - this.minX + 1) / 2; + } + + public int getCenterY() + { + return this.minY + (this.maxY - this.minY + 1) / 2; + } + + public int getCenterZ() + { + return this.minZ + (this.maxZ - this.minZ + 1) / 2; + } + + public String toString() + { + return "(" + this.minX + ", " + this.minY + ", " + this.minZ + "; " + this.maxX + ", " + this.maxY + ", " + this.maxZ + ")"; + } + + public NBTTagIntArray func_151535_h() + { + return new NBTTagIntArray(new int[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureComponent.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureComponent.java new file mode 100644 index 0000000..47dcb41 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureComponent.java @@ -0,0 +1,871 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDoor; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.tileentity.TileEntityDispenser; +import net.minecraft.util.Direction; +import net.minecraft.util.Facing; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +public abstract class StructureComponent +{ + protected StructureBoundingBox boundingBox; + /** switches the Coordinate System base off the Bounding Box */ + protected int coordBaseMode; + /** The type ID of this component. */ + protected int componentType; + private static final String __OBFID = "CL_00000511"; + + public StructureComponent() {} + + protected StructureComponent(int p_i2091_1_) + { + this.componentType = p_i2091_1_; + this.coordBaseMode = -1; + } + + public NBTTagCompound func_143010_b() + { + if (MapGenStructureIO.func_143036_a(this) == null) // Friendlier error then the Null Stirng error below. + { + throw new RuntimeException("StructureComponent \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); + } + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setString("id", MapGenStructureIO.func_143036_a(this)); + nbttagcompound.setTag("BB", this.boundingBox.func_151535_h()); + nbttagcompound.setInteger("O", this.coordBaseMode); + nbttagcompound.setInteger("GD", this.componentType); + this.func_143012_a(nbttagcompound); + return nbttagcompound; + } + + protected abstract void func_143012_a(NBTTagCompound p_143012_1_); + + public void func_143009_a(World p_143009_1_, NBTTagCompound p_143009_2_) + { + if (p_143009_2_.hasKey("BB")) + { + this.boundingBox = new StructureBoundingBox(p_143009_2_.getIntArray("BB")); + } + + this.coordBaseMode = p_143009_2_.getInteger("O"); + this.componentType = p_143009_2_.getInteger("GD"); + this.func_143011_b(p_143009_2_); + } + + protected abstract void func_143011_b(NBTTagCompound p_143011_1_); + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) {} + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at + * the end, it adds Fences... + */ + public abstract boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_); + + public StructureBoundingBox getBoundingBox() + { + return this.boundingBox; + } + + /** + * Returns the component type ID of this component. + */ + public int getComponentType() + { + return this.componentType; + } + + /** + * Discover if bounding box can fit within the current bounding box object. + */ + public static StructureComponent findIntersecting(List p_74883_0_, StructureBoundingBox p_74883_1_) + { + Iterator iterator = p_74883_0_.iterator(); + StructureComponent structurecomponent; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + structurecomponent = (StructureComponent)iterator.next(); + } + while (structurecomponent.getBoundingBox() == null || !structurecomponent.getBoundingBox().intersectsWith(p_74883_1_)); + + return structurecomponent; + } + + public ChunkPosition func_151553_a() + { + return new ChunkPosition(this.boundingBox.getCenterX(), this.boundingBox.getCenterY(), this.boundingBox.getCenterZ()); + } + + /** + * checks the entire StructureBoundingBox for Liquids + */ + protected boolean isLiquidInStructureBoundingBox(World p_74860_1_, StructureBoundingBox p_74860_2_) + { + int i = Math.max(this.boundingBox.minX - 1, p_74860_2_.minX); + int j = Math.max(this.boundingBox.minY - 1, p_74860_2_.minY); + int k = Math.max(this.boundingBox.minZ - 1, p_74860_2_.minZ); + int l = Math.min(this.boundingBox.maxX + 1, p_74860_2_.maxX); + int i1 = Math.min(this.boundingBox.maxY + 1, p_74860_2_.maxY); + int j1 = Math.min(this.boundingBox.maxZ + 1, p_74860_2_.maxZ); + int k1; + int l1; + + for (k1 = i; k1 <= l; ++k1) + { + for (l1 = k; l1 <= j1; ++l1) + { + if (p_74860_1_.getBlock(k1, j, l1).getMaterial().isLiquid()) + { + return true; + } + + if (p_74860_1_.getBlock(k1, i1, l1).getMaterial().isLiquid()) + { + return true; + } + } + } + + for (k1 = i; k1 <= l; ++k1) + { + for (l1 = j; l1 <= i1; ++l1) + { + if (p_74860_1_.getBlock(k1, l1, k).getMaterial().isLiquid()) + { + return true; + } + + if (p_74860_1_.getBlock(k1, l1, j1).getMaterial().isLiquid()) + { + return true; + } + } + } + + for (k1 = k; k1 <= j1; ++k1) + { + for (l1 = j; l1 <= i1; ++l1) + { + if (p_74860_1_.getBlock(i, l1, k1).getMaterial().isLiquid()) + { + return true; + } + + if (p_74860_1_.getBlock(l, l1, k1).getMaterial().isLiquid()) + { + return true; + } + } + } + + return false; + } + + protected int getXWithOffset(int p_74865_1_, int p_74865_2_) + { + switch (this.coordBaseMode) + { + case 0: + case 2: + return this.boundingBox.minX + p_74865_1_; + case 1: + return this.boundingBox.maxX - p_74865_2_; + case 3: + return this.boundingBox.minX + p_74865_2_; + default: + return p_74865_1_; + } + } + + protected int getYWithOffset(int p_74862_1_) + { + return this.coordBaseMode == -1 ? p_74862_1_ : p_74862_1_ + this.boundingBox.minY; + } + + protected int getZWithOffset(int p_74873_1_, int p_74873_2_) + { + switch (this.coordBaseMode) + { + case 0: + return this.boundingBox.minZ + p_74873_2_; + case 1: + case 3: + return this.boundingBox.minZ + p_74873_1_; + case 2: + return this.boundingBox.maxZ - p_74873_2_; + default: + return p_74873_2_; + } + } + + /** + * Returns the direction-shifted metadata for blocks that require orientation, e.g. doors, stairs, ladders. + */ + protected int getMetadataWithOffset(Block p_151555_1_, int p_151555_2_) + { + if (p_151555_1_ == Blocks.rail) + { + if (this.coordBaseMode == 1 || this.coordBaseMode == 3) + { + if (p_151555_2_ == 1) + { + return 0; + } + + return 1; + } + } + else if (p_151555_1_ != Blocks.wooden_door && p_151555_1_ != Blocks.iron_door) + { + if (p_151555_1_ != Blocks.stone_stairs && p_151555_1_ != Blocks.oak_stairs && p_151555_1_ != Blocks.nether_brick_stairs && p_151555_1_ != Blocks.stone_brick_stairs && p_151555_1_ != Blocks.sandstone_stairs) + { + if (p_151555_1_ == Blocks.ladder) + { + if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 2) + { + return 3; + } + + if (p_151555_2_ == 3) + { + return 2; + } + } + else if (this.coordBaseMode == 1) + { + if (p_151555_2_ == 2) + { + return 4; + } + + if (p_151555_2_ == 3) + { + return 5; + } + + if (p_151555_2_ == 4) + { + return 2; + } + + if (p_151555_2_ == 5) + { + return 3; + } + } + else if (this.coordBaseMode == 3) + { + if (p_151555_2_ == 2) + { + return 5; + } + + if (p_151555_2_ == 3) + { + return 4; + } + + if (p_151555_2_ == 4) + { + return 2; + } + + if (p_151555_2_ == 5) + { + return 3; + } + } + } + else if (p_151555_1_ == Blocks.stone_button) + { + if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 3) + { + return 4; + } + + if (p_151555_2_ == 4) + { + return 3; + } + } + else if (this.coordBaseMode == 1) + { + if (p_151555_2_ == 3) + { + return 1; + } + + if (p_151555_2_ == 4) + { + return 2; + } + + if (p_151555_2_ == 2) + { + return 3; + } + + if (p_151555_2_ == 1) + { + return 4; + } + } + else if (this.coordBaseMode == 3) + { + if (p_151555_2_ == 3) + { + return 2; + } + + if (p_151555_2_ == 4) + { + return 1; + } + + if (p_151555_2_ == 2) + { + return 3; + } + + if (p_151555_2_ == 1) + { + return 4; + } + } + } + else if (p_151555_1_ != Blocks.tripwire_hook && !(p_151555_1_ instanceof BlockDirectional)) + { + if (p_151555_1_ == Blocks.piston || p_151555_1_ == Blocks.sticky_piston || p_151555_1_ == Blocks.lever || p_151555_1_ == Blocks.dispenser) + { + if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 2 || p_151555_2_ == 3) + { + return Facing.oppositeSide[p_151555_2_]; + } + } + else if (this.coordBaseMode == 1) + { + if (p_151555_2_ == 2) + { + return 4; + } + + if (p_151555_2_ == 3) + { + return 5; + } + + if (p_151555_2_ == 4) + { + return 2; + } + + if (p_151555_2_ == 5) + { + return 3; + } + } + else if (this.coordBaseMode == 3) + { + if (p_151555_2_ == 2) + { + return 5; + } + + if (p_151555_2_ == 3) + { + return 4; + } + + if (p_151555_2_ == 4) + { + return 2; + } + + if (p_151555_2_ == 5) + { + return 3; + } + } + } + } + else if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 0 || p_151555_2_ == 2) + { + return Direction.rotateOpposite[p_151555_2_]; + } + } + else if (this.coordBaseMode == 1) + { + if (p_151555_2_ == 2) + { + return 1; + } + + if (p_151555_2_ == 0) + { + return 3; + } + + if (p_151555_2_ == 1) + { + return 2; + } + + if (p_151555_2_ == 3) + { + return 0; + } + } + else if (this.coordBaseMode == 3) + { + if (p_151555_2_ == 2) + { + return 3; + } + + if (p_151555_2_ == 0) + { + return 1; + } + + if (p_151555_2_ == 1) + { + return 2; + } + + if (p_151555_2_ == 3) + { + return 0; + } + } + } + else if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 2) + { + return 3; + } + + if (p_151555_2_ == 3) + { + return 2; + } + } + else if (this.coordBaseMode == 1) + { + if (p_151555_2_ == 0) + { + return 2; + } + + if (p_151555_2_ == 1) + { + return 3; + } + + if (p_151555_2_ == 2) + { + return 0; + } + + if (p_151555_2_ == 3) + { + return 1; + } + } + else if (this.coordBaseMode == 3) + { + if (p_151555_2_ == 0) + { + return 2; + } + + if (p_151555_2_ == 1) + { + return 3; + } + + if (p_151555_2_ == 2) + { + return 1; + } + + if (p_151555_2_ == 3) + { + return 0; + } + } + } + else if (this.coordBaseMode == 0) + { + if (p_151555_2_ == 0) + { + return 2; + } + + if (p_151555_2_ == 2) + { + return 0; + } + } + else + { + if (this.coordBaseMode == 1) + { + return p_151555_2_ + 1 & 3; + } + + if (this.coordBaseMode == 3) + { + return p_151555_2_ + 3 & 3; + } + } + + return p_151555_2_; + } + + /** + * current Position depends on currently set Coordinates mode, is computed here + */ + protected void placeBlockAtCurrentPosition(World p_151550_1_, Block p_151550_2_, int p_151550_3_, int p_151550_4_, int p_151550_5_, int p_151550_6_, StructureBoundingBox p_151550_7_) + { + int i1 = this.getXWithOffset(p_151550_4_, p_151550_6_); + int j1 = this.getYWithOffset(p_151550_5_); + int k1 = this.getZWithOffset(p_151550_4_, p_151550_6_); + + if (p_151550_7_.isVecInside(i1, j1, k1)) + { + p_151550_1_.setBlock(i1, j1, k1, p_151550_2_, p_151550_3_, 2); + } + } + + protected Block getBlockAtCurrentPosition(World p_151548_1_, int p_151548_2_, int p_151548_3_, int p_151548_4_, StructureBoundingBox p_151548_5_) + { + int l = this.getXWithOffset(p_151548_2_, p_151548_4_); + int i1 = this.getYWithOffset(p_151548_3_); + int j1 = this.getZWithOffset(p_151548_2_, p_151548_4_); + return !p_151548_5_.isVecInside(l, i1, j1) ? Blocks.air : p_151548_1_.getBlock(l, i1, j1); + } + + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ) + */ + protected void fillWithAir(World p_74878_1_, StructureBoundingBox p_74878_2_, int p_74878_3_, int p_74878_4_, int p_74878_5_, int p_74878_6_, int p_74878_7_, int p_74878_8_) + { + for (int k1 = p_74878_4_; k1 <= p_74878_7_; ++k1) + { + for (int l1 = p_74878_3_; l1 <= p_74878_6_; ++l1) + { + for (int i2 = p_74878_5_; i2 <= p_74878_8_; ++i2) + { + this.placeBlockAtCurrentPosition(p_74878_1_, Blocks.air, 0, l1, k1, i2, p_74878_2_); + } + } + } + } + + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ, int placeBlock, int replaceBlock, boolean alwaysreplace) + */ + protected void fillWithBlocks(World p_151549_1_, StructureBoundingBox p_151549_2_, int p_151549_3_, int p_151549_4_, int p_151549_5_, int p_151549_6_, int p_151549_7_, int p_151549_8_, Block p_151549_9_, Block p_151549_10_, boolean p_151549_11_) + { + for (int k1 = p_151549_4_; k1 <= p_151549_7_; ++k1) + { + for (int l1 = p_151549_3_; l1 <= p_151549_6_; ++l1) + { + for (int i2 = p_151549_5_; i2 <= p_151549_8_; ++i2) + { + if (!p_151549_11_ || this.getBlockAtCurrentPosition(p_151549_1_, l1, k1, i2, p_151549_2_).getMaterial() != Material.air) + { + if (k1 != p_151549_4_ && k1 != p_151549_7_ && l1 != p_151549_3_ && l1 != p_151549_6_ && i2 != p_151549_5_ && i2 != p_151549_8_) + { + this.placeBlockAtCurrentPosition(p_151549_1_, p_151549_10_, 0, l1, k1, i2, p_151549_2_); + } + else + { + this.placeBlockAtCurrentPosition(p_151549_1_, p_151549_9_, 0, l1, k1, i2, p_151549_2_); + } + } + } + } + } + } + + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ, Block placeBlock, int placeBlockMetadata, Block replaceBlock, int replaceBlockMetadata, boolean + * alwaysreplace) + */ + protected void fillWithMetadataBlocks(World p_151556_1_, StructureBoundingBox p_151556_2_, int p_151556_3_, int p_151556_4_, int p_151556_5_, int p_151556_6_, int p_151556_7_, int p_151556_8_, Block p_151556_9_, int p_151556_10_, Block p_151556_11_, int p_151556_12_, boolean p_151556_13_) + { + for (int i2 = p_151556_4_; i2 <= p_151556_7_; ++i2) + { + for (int j2 = p_151556_3_; j2 <= p_151556_6_; ++j2) + { + for (int k2 = p_151556_5_; k2 <= p_151556_8_; ++k2) + { + if (!p_151556_13_ || this.getBlockAtCurrentPosition(p_151556_1_, j2, i2, k2, p_151556_2_).getMaterial() != Material.air) + { + if (i2 != p_151556_4_ && i2 != p_151556_7_ && j2 != p_151556_3_ && j2 != p_151556_6_ && k2 != p_151556_5_ && k2 != p_151556_8_) + { + this.placeBlockAtCurrentPosition(p_151556_1_, p_151556_11_, p_151556_12_, j2, i2, k2, p_151556_2_); + } + else + { + this.placeBlockAtCurrentPosition(p_151556_1_, p_151556_9_, p_151556_10_, j2, i2, k2, p_151556_2_); + } + } + } + } + } + } + + /** + * arguments: World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ, boolean alwaysreplace, Random rand, StructurePieceBlockSelector blockselector + */ + protected void fillWithRandomizedBlocks(World p_74882_1_, StructureBoundingBox p_74882_2_, int p_74882_3_, int p_74882_4_, int p_74882_5_, int p_74882_6_, int p_74882_7_, int p_74882_8_, boolean p_74882_9_, Random p_74882_10_, StructureComponent.BlockSelector p_74882_11_) + { + for (int k1 = p_74882_4_; k1 <= p_74882_7_; ++k1) + { + for (int l1 = p_74882_3_; l1 <= p_74882_6_; ++l1) + { + for (int i2 = p_74882_5_; i2 <= p_74882_8_; ++i2) + { + if (!p_74882_9_ || this.getBlockAtCurrentPosition(p_74882_1_, l1, k1, i2, p_74882_2_).getMaterial() != Material.air) + { + p_74882_11_.selectBlocks(p_74882_10_, l1, k1, i2, k1 == p_74882_4_ || k1 == p_74882_7_ || l1 == p_74882_3_ || l1 == p_74882_6_ || i2 == p_74882_5_ || i2 == p_74882_8_); + this.placeBlockAtCurrentPosition(p_74882_1_, p_74882_11_.func_151561_a(), p_74882_11_.getSelectedBlockMetaData(), l1, k1, i2, p_74882_2_); + } + } + } + } + } + + /** + * arguments: World worldObj, StructureBoundingBox structBB, Random rand, float randLimit, int minX, int minY, int + * minZ, int maxX, int maxY, int maxZ, Block placeBlock, Block replaceBlock, boolean alwaysreplace + */ + protected void randomlyFillWithBlocks(World p_151551_1_, StructureBoundingBox p_151551_2_, Random p_151551_3_, float p_151551_4_, int p_151551_5_, int p_151551_6_, int p_151551_7_, int p_151551_8_, int p_151551_9_, int p_151551_10_, Block p_151551_11_, Block p_151551_12_, boolean p_151551_13_) + { + for (int k1 = p_151551_6_; k1 <= p_151551_9_; ++k1) + { + for (int l1 = p_151551_5_; l1 <= p_151551_8_; ++l1) + { + for (int i2 = p_151551_7_; i2 <= p_151551_10_; ++i2) + { + if (p_151551_3_.nextFloat() <= p_151551_4_ && (!p_151551_13_ || this.getBlockAtCurrentPosition(p_151551_1_, l1, k1, i2, p_151551_2_).getMaterial() != Material.air)) + { + if (k1 != p_151551_6_ && k1 != p_151551_9_ && l1 != p_151551_5_ && l1 != p_151551_8_ && i2 != p_151551_7_ && i2 != p_151551_10_) + { + this.placeBlockAtCurrentPosition(p_151551_1_, p_151551_12_, 0, l1, k1, i2, p_151551_2_); + } + else + { + this.placeBlockAtCurrentPosition(p_151551_1_, p_151551_11_, 0, l1, k1, i2, p_151551_2_); + } + } + } + } + } + } + + protected void func_151552_a(World p_151552_1_, StructureBoundingBox p_151552_2_, Random p_151552_3_, float p_151552_4_, int p_151552_5_, int p_151552_6_, int p_151552_7_, Block p_151552_8_, int p_151552_9_) + { + if (p_151552_3_.nextFloat() < p_151552_4_) + { + this.placeBlockAtCurrentPosition(p_151552_1_, p_151552_8_, p_151552_9_, p_151552_5_, p_151552_6_, p_151552_7_, p_151552_2_); + } + } + + protected void func_151547_a(World p_151547_1_, StructureBoundingBox p_151547_2_, int p_151547_3_, int p_151547_4_, int p_151547_5_, int p_151547_6_, int p_151547_7_, int p_151547_8_, Block p_151547_9_, boolean p_151547_10_) + { + float f = (float)(p_151547_6_ - p_151547_3_ + 1); + float f1 = (float)(p_151547_7_ - p_151547_4_ + 1); + float f2 = (float)(p_151547_8_ - p_151547_5_ + 1); + float f3 = (float)p_151547_3_ + f / 2.0F; + float f4 = (float)p_151547_5_ + f2 / 2.0F; + + for (int k1 = p_151547_4_; k1 <= p_151547_7_; ++k1) + { + float f5 = (float)(k1 - p_151547_4_) / f1; + + for (int l1 = p_151547_3_; l1 <= p_151547_6_; ++l1) + { + float f6 = ((float)l1 - f3) / (f * 0.5F); + + for (int i2 = p_151547_5_; i2 <= p_151547_8_; ++i2) + { + float f7 = ((float)i2 - f4) / (f2 * 0.5F); + + if (!p_151547_10_ || this.getBlockAtCurrentPosition(p_151547_1_, l1, k1, i2, p_151547_2_).getMaterial() != Material.air) + { + float f8 = f6 * f6 + f5 * f5 + f7 * f7; + + if (f8 <= 1.05F) + { + this.placeBlockAtCurrentPosition(p_151547_1_, p_151547_9_, 0, l1, k1, i2, p_151547_2_); + } + } + } + } + } + } + + /** + * Deletes all continuous blocks from selected position upwards. Stops at hitting air. + */ + protected void clearCurrentPositionBlocksUpwards(World p_74871_1_, int p_74871_2_, int p_74871_3_, int p_74871_4_, StructureBoundingBox p_74871_5_) + { + int l = this.getXWithOffset(p_74871_2_, p_74871_4_); + int i1 = this.getYWithOffset(p_74871_3_); + int j1 = this.getZWithOffset(p_74871_2_, p_74871_4_); + + if (p_74871_5_.isVecInside(l, i1, j1)) + { + while (!p_74871_1_.isAirBlock(l, i1, j1) && i1 < 255) + { + p_74871_1_.setBlock(l, i1, j1, Blocks.air, 0, 2); + ++i1; + } + } + } + + protected void func_151554_b(World p_151554_1_, Block p_151554_2_, int p_151554_3_, int p_151554_4_, int p_151554_5_, int p_151554_6_, StructureBoundingBox p_151554_7_) + { + int i1 = this.getXWithOffset(p_151554_4_, p_151554_6_); + int j1 = this.getYWithOffset(p_151554_5_); + int k1 = this.getZWithOffset(p_151554_4_, p_151554_6_); + + if (p_151554_7_.isVecInside(i1, j1, k1)) + { + while ((p_151554_1_.isAirBlock(i1, j1, k1) || p_151554_1_.getBlock(i1, j1, k1).getMaterial().isLiquid()) && j1 > 1) + { + p_151554_1_.setBlock(i1, j1, k1, p_151554_2_, p_151554_3_, 2); + --j1; + } + } + } + + /** + * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. + */ + protected boolean generateStructureChestContents(World p_74879_1_, StructureBoundingBox p_74879_2_, Random p_74879_3_, int p_74879_4_, int p_74879_5_, int p_74879_6_, WeightedRandomChestContent[] p_74879_7_, int p_74879_8_) + { + int i1 = this.getXWithOffset(p_74879_4_, p_74879_6_); + int j1 = this.getYWithOffset(p_74879_5_); + int k1 = this.getZWithOffset(p_74879_4_, p_74879_6_); + + if (p_74879_2_.isVecInside(i1, j1, k1) && p_74879_1_.getBlock(i1, j1, k1) != Blocks.chest) + { + p_74879_1_.setBlock(i1, j1, k1, Blocks.chest, 0, 2); + TileEntityChest tileentitychest = (TileEntityChest)p_74879_1_.getTileEntity(i1, j1, k1); + + if (tileentitychest != null) + { + WeightedRandomChestContent.generateChestContents(p_74879_3_, p_74879_7_, tileentitychest, p_74879_8_); + } + + return true; + } + else + { + return false; + } + } + + /** + * Used to generate dispenser contents for structures. ex: Jungle Temples. + */ + protected boolean generateStructureDispenserContents(World p_74869_1_, StructureBoundingBox p_74869_2_, Random p_74869_3_, int p_74869_4_, int p_74869_5_, int p_74869_6_, int p_74869_7_, WeightedRandomChestContent[] p_74869_8_, int p_74869_9_) + { + int j1 = this.getXWithOffset(p_74869_4_, p_74869_6_); + int k1 = this.getYWithOffset(p_74869_5_); + int l1 = this.getZWithOffset(p_74869_4_, p_74869_6_); + + if (p_74869_2_.isVecInside(j1, k1, l1) && p_74869_1_.getBlock(j1, k1, l1) != Blocks.dispenser) + { + p_74869_1_.setBlock(j1, k1, l1, Blocks.dispenser, this.getMetadataWithOffset(Blocks.dispenser, p_74869_7_), 2); + TileEntityDispenser tileentitydispenser = (TileEntityDispenser)p_74869_1_.getTileEntity(j1, k1, l1); + + if (tileentitydispenser != null) + { + WeightedRandomChestContent.generateDispenserContents(p_74869_3_, p_74869_8_, tileentitydispenser, p_74869_9_); + } + + return true; + } + else + { + return false; + } + } + + protected void placeDoorAtCurrentPosition(World p_74881_1_, StructureBoundingBox p_74881_2_, Random p_74881_3_, int p_74881_4_, int p_74881_5_, int p_74881_6_, int p_74881_7_) + { + int i1 = this.getXWithOffset(p_74881_4_, p_74881_6_); + int j1 = this.getYWithOffset(p_74881_5_); + int k1 = this.getZWithOffset(p_74881_4_, p_74881_6_); + + if (p_74881_2_.isVecInside(i1, j1, k1)) + { + ItemDoor.placeDoorBlock(p_74881_1_, i1, j1, k1, p_74881_7_, Blocks.wooden_door); + } + } + + public abstract static class BlockSelector + { + protected Block field_151562_a; + protected int selectedBlockMetaData; + private static final String __OBFID = "CL_00000512"; + + protected BlockSelector() + { + this.field_151562_a = Blocks.air; + } + + /** + * picks Block Ids and Metadata (Silverfish) + */ + public abstract void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_); + + public Block func_151561_a() + { + return this.field_151562_a; + } + + public int getSelectedBlockMetaData() + { + return this.selectedBlockMetaData; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java new file mode 100644 index 0000000..0469ca0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftPieces.java @@ -0,0 +1,845 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityMinecartChest; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; + +public class StructureMineshaftPieces +{ + /** List of contents that can generate in Mineshafts. */ + public static final WeightedRandomChestContent[] mineshaftChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.dye, 4, 4, 9, 5), new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 3), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.rail), 0, 4, 8, 1), new WeightedRandomChestContent(Items.melon_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.pumpkin_seeds, 0, 2, 4, 10), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1)}; + private static final String __OBFID = "CL_00000444"; + + public static void registerStructurePieces() + { + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Corridor.class, "MSCorridor"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Cross.class, "MSCrossing"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Room.class, "MSRoom"); + MapGenStructureIO.func_143031_a(StructureMineshaftPieces.Stairs.class, "MSStairs"); + } + + private static StructureComponent getRandomComponent(List p_78815_0_, Random p_78815_1_, int p_78815_2_, int p_78815_3_, int p_78815_4_, int p_78815_5_, int p_78815_6_) + { + int j1 = p_78815_1_.nextInt(100); + StructureBoundingBox structureboundingbox; + + if (j1 >= 80) + { + structureboundingbox = StructureMineshaftPieces.Cross.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (structureboundingbox != null) + { + return new StructureMineshaftPieces.Cross(p_78815_6_, p_78815_1_, structureboundingbox, p_78815_5_); + } + } + else if (j1 >= 70) + { + structureboundingbox = StructureMineshaftPieces.Stairs.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (structureboundingbox != null) + { + return new StructureMineshaftPieces.Stairs(p_78815_6_, p_78815_1_, structureboundingbox, p_78815_5_); + } + } + else + { + structureboundingbox = StructureMineshaftPieces.Corridor.findValidPlacement(p_78815_0_, p_78815_1_, p_78815_2_, p_78815_3_, p_78815_4_, p_78815_5_); + + if (structureboundingbox != null) + { + return new StructureMineshaftPieces.Corridor(p_78815_6_, p_78815_1_, structureboundingbox, p_78815_5_); + } + } + + return null; + } + + private static StructureComponent getNextMineShaftComponent(StructureComponent p_78817_0_, List p_78817_1_, Random p_78817_2_, int p_78817_3_, int p_78817_4_, int p_78817_5_, int p_78817_6_, int p_78817_7_) + { + if (p_78817_7_ > 8) + { + return null; + } + else if (Math.abs(p_78817_3_ - p_78817_0_.getBoundingBox().minX) <= 80 && Math.abs(p_78817_5_ - p_78817_0_.getBoundingBox().minZ) <= 80) + { + StructureComponent structurecomponent1 = getRandomComponent(p_78817_1_, p_78817_2_, p_78817_3_, p_78817_4_, p_78817_5_, p_78817_6_, p_78817_7_ + 1); + + if (structurecomponent1 != null) + { + p_78817_1_.add(structurecomponent1); + structurecomponent1.buildComponent(p_78817_0_, p_78817_1_, p_78817_2_); + } + + return structurecomponent1; + } + else + { + return null; + } + } + + public static class Corridor extends StructureComponent + { + private boolean hasRails; + private boolean hasSpiders; + private boolean spawnerPlaced; + /** A count of the different sections of this mine. The space between ceiling supports. */ + private int sectionCount; + private static final String __OBFID = "CL_00000445"; + + public Corridor() {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + p_143012_1_.setBoolean("hr", this.hasRails); + p_143012_1_.setBoolean("sc", this.hasSpiders); + p_143012_1_.setBoolean("hps", this.spawnerPlaced); + p_143012_1_.setInteger("Num", this.sectionCount); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + this.hasRails = p_143011_1_.getBoolean("hr"); + this.hasSpiders = p_143011_1_.getBoolean("sc"); + this.spawnerPlaced = p_143011_1_.getBoolean("hps"); + this.sectionCount = p_143011_1_.getInteger("Num"); + } + + public Corridor(int p_i2035_1_, Random p_i2035_2_, StructureBoundingBox p_i2035_3_, int p_i2035_4_) + { + super(p_i2035_1_); + this.coordBaseMode = p_i2035_4_; + this.boundingBox = p_i2035_3_; + this.hasRails = p_i2035_2_.nextInt(3) == 0; + this.hasSpiders = !this.hasRails && p_i2035_2_.nextInt(23) == 0; + + if (this.coordBaseMode != 2 && this.coordBaseMode != 0) + { + this.sectionCount = p_i2035_3_.getXSize() / 5; + } + else + { + this.sectionCount = p_i2035_3_.getZSize() / 5; + } + } + + public static StructureBoundingBox findValidPlacement(List p_74954_0_, Random p_74954_1_, int p_74954_2_, int p_74954_3_, int p_74954_4_, int p_74954_5_) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_74954_2_, p_74954_3_, p_74954_4_, p_74954_2_, p_74954_3_ + 2, p_74954_4_); + int i1; + + for (i1 = p_74954_1_.nextInt(3) + 2; i1 > 0; --i1) + { + int j1 = i1 * 5; + + switch (p_74954_5_) + { + case 0: + structureboundingbox.maxX = p_74954_2_ + 2; + structureboundingbox.maxZ = p_74954_4_ + (j1 - 1); + break; + case 1: + structureboundingbox.minX = p_74954_2_ - (j1 - 1); + structureboundingbox.maxZ = p_74954_4_ + 2; + break; + case 2: + structureboundingbox.maxX = p_74954_2_ + 2; + structureboundingbox.minZ = p_74954_4_ - (j1 - 1); + break; + case 3: + structureboundingbox.maxX = p_74954_2_ + (j1 - 1); + structureboundingbox.maxZ = p_74954_4_ + 2; + } + + if (StructureComponent.findIntersecting(p_74954_0_, structureboundingbox) == null) + { + break; + } + } + + return i1 > 0 ? structureboundingbox : null; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + int i = this.getComponentType(); + int j = p_74861_3_.nextInt(4); + + switch (this.coordBaseMode) + { + case 0: + if (j <= 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ - 3, 1, i); + } + else + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ - 3, 3, i); + } + + break; + case 1: + if (j <= 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, 2, i); + } + else + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, 0, i); + } + + break; + case 2: + if (j <= 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, 1, i); + } + else + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, 3, i); + } + + break; + case 3: + if (j <= 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, i); + } + else if (j == 2) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.minZ - 1, 2, i); + } + else + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + p_74861_3_.nextInt(3), this.boundingBox.maxZ + 1, 0, i); + } + } + + if (i < 8) + { + int k; + int l; + + if (this.coordBaseMode != 2 && this.coordBaseMode != 0) + { + for (k = this.boundingBox.minX + 3; k + 3 <= this.boundingBox.maxX; k += 5) + { + l = p_74861_3_.nextInt(5); + + if (l == 0) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, k, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, i + 1); + } + else if (l == 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, k, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, i + 1); + } + } + } + else + { + for (k = this.boundingBox.minZ + 3; k + 3 <= this.boundingBox.maxZ; k += 5) + { + l = p_74861_3_.nextInt(5); + + if (l == 0) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, k, 1, i + 1); + } + else if (l == 1) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, k, 3, i + 1); + } + } + } + } + } + + /** + * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. + */ + protected boolean generateStructureChestContents(World p_74879_1_, StructureBoundingBox p_74879_2_, Random p_74879_3_, int p_74879_4_, int p_74879_5_, int p_74879_6_, WeightedRandomChestContent[] p_74879_7_, int p_74879_8_) + { + int i1 = this.getXWithOffset(p_74879_4_, p_74879_6_); + int j1 = this.getYWithOffset(p_74879_5_); + int k1 = this.getZWithOffset(p_74879_4_, p_74879_6_); + + if (p_74879_2_.isVecInside(i1, j1, k1) && p_74879_1_.getBlock(i1, j1, k1).getMaterial() == Material.air) + { + int l1 = p_74879_3_.nextBoolean() ? 1 : 0; + p_74879_1_.setBlock(i1, j1, k1, Blocks.rail, this.getMetadataWithOffset(Blocks.rail, l1), 2); + EntityMinecartChest entityminecartchest = new EntityMinecartChest(p_74879_1_, (double)((float)i1 + 0.5F), (double)((float)j1 + 0.5F), (double)((float)k1 + 0.5F)); + WeightedRandomChestContent.generateChestContents(p_74879_3_, p_74879_7_, entityminecartchest, p_74879_8_); + p_74879_1_.spawnEntityInWorld(entityminecartchest); + return true; + } + else + { + return false; + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + boolean flag = false; + boolean flag1 = true; + boolean flag2 = false; + boolean flag3 = true; + int i = this.sectionCount * 5 - 1; + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 2, 1, i, Blocks.air, Blocks.air, false); + this.randomlyFillWithBlocks(p_74875_1_, p_74875_3_, p_74875_2_, 0.8F, 0, 2, 0, 2, 2, i, Blocks.air, Blocks.air, false); + + if (this.hasSpiders) + { + this.randomlyFillWithBlocks(p_74875_1_, p_74875_3_, p_74875_2_, 0.6F, 0, 0, 0, 2, 1, i, Blocks.web, Blocks.air, false); + } + + int j; + int k; + + for (j = 0; j < this.sectionCount; ++j) + { + k = 2 + j * 5; + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, k, 0, 1, k, Blocks.fence, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 0, k, 2, 1, k, Blocks.fence, Blocks.air, false); + + if (p_74875_2_.nextInt(4) == 0) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, k, 0, 2, k, Blocks.planks, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 2, k, 2, 2, k, Blocks.planks, Blocks.air, false); + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, k, 2, 2, k, Blocks.planks, Blocks.air, false); + } + + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k - 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k - 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 0, 2, k + 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 2, 2, k + 1, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k - 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k - 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 0, 2, k + 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 2, 2, k + 2, Blocks.web, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k - 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k + 1, Blocks.torch, 0); + + ChestGenHooks info = ChestGenHooks.getInfo(MINESHAFT_CORRIDOR); + if (p_74875_2_.nextInt(100) == 0) + { + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + if (p_74875_2_.nextInt(100) == 0) + { + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + if (this.hasSpiders && !this.spawnerPlaced) + { + int l = this.getYWithOffset(0); + int i1 = k - 1 + p_74875_2_.nextInt(3); + int j1 = this.getXWithOffset(1, i1); + i1 = this.getZWithOffset(1, i1); + + if (p_74875_3_.isVecInside(j1, l, i1)) + { + this.spawnerPlaced = true; + p_74875_1_.setBlock(j1, l, i1, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)p_74875_1_.getTileEntity(j1, l, i1); + + if (tileentitymobspawner != null) + { + tileentitymobspawner.func_145881_a().setEntityName("CaveSpider"); + } + } + } + } + + for (j = 0; j <= 2; ++j) + { + for (k = 0; k <= i; ++k) + { + byte b0 = -1; + Block block1 = this.getBlockAtCurrentPosition(p_74875_1_, j, b0, k, p_74875_3_); + + if (block1.getMaterial() == Material.air) + { + byte b1 = -1; + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, j, b1, k, p_74875_3_); + } + } + } + + if (this.hasRails) + { + for (j = 0; j <= i; ++j) + { + Block block = this.getBlockAtCurrentPosition(p_74875_1_, 1, -1, j, p_74875_3_); + + if (block.getMaterial() != Material.air && block.func_149730_j()) + { + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.7F, 1, 0, j, Blocks.rail, this.getMetadataWithOffset(Blocks.rail, 0)); + } + } + } + + return true; + } + } + } + + public static class Cross extends StructureComponent + { + private int corridorDirection; + private boolean isMultipleFloors; + private static final String __OBFID = "CL_00000446"; + + public Cross() {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + p_143012_1_.setBoolean("tf", this.isMultipleFloors); + p_143012_1_.setInteger("D", this.corridorDirection); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + this.isMultipleFloors = p_143011_1_.getBoolean("tf"); + this.corridorDirection = p_143011_1_.getInteger("D"); + } + + public Cross(int p_i2036_1_, Random p_i2036_2_, StructureBoundingBox p_i2036_3_, int p_i2036_4_) + { + super(p_i2036_1_); + this.corridorDirection = p_i2036_4_; + this.boundingBox = p_i2036_3_; + this.isMultipleFloors = p_i2036_3_.getYSize() > 3; + } + + public static StructureBoundingBox findValidPlacement(List p_74951_0_, Random p_74951_1_, int p_74951_2_, int p_74951_3_, int p_74951_4_, int p_74951_5_) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_74951_2_, p_74951_3_, p_74951_4_, p_74951_2_, p_74951_3_ + 2, p_74951_4_); + + if (p_74951_1_.nextInt(4) == 0) + { + structureboundingbox.maxY += 4; + } + + switch (p_74951_5_) + { + case 0: + structureboundingbox.minX = p_74951_2_ - 1; + structureboundingbox.maxX = p_74951_2_ + 3; + structureboundingbox.maxZ = p_74951_4_ + 4; + break; + case 1: + structureboundingbox.minX = p_74951_2_ - 4; + structureboundingbox.minZ = p_74951_4_ - 1; + structureboundingbox.maxZ = p_74951_4_ + 3; + break; + case 2: + structureboundingbox.minX = p_74951_2_ - 1; + structureboundingbox.maxX = p_74951_2_ + 3; + structureboundingbox.minZ = p_74951_4_ - 4; + break; + case 3: + structureboundingbox.maxX = p_74951_2_ + 4; + structureboundingbox.minZ = p_74951_4_ - 1; + structureboundingbox.maxZ = p_74951_4_ + 3; + } + + return StructureComponent.findIntersecting(p_74951_0_, structureboundingbox) != null ? null : structureboundingbox; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + int i = this.getComponentType(); + + switch (this.corridorDirection) + { + case 0: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, i); + break; + case 1: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, i); + break; + case 2: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, i); + break; + case 3: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, i); + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, i); + } + + if (this.isMultipleFloors) + { + if (p_74861_3_.nextBoolean()) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, i); + } + + if (p_74861_3_.nextBoolean()) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, i); + } + + if (p_74861_3_.nextBoolean()) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, i); + } + + if (p_74861_3_.nextBoolean()) + { + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, i); + } + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + if (this.isMultipleFloors) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.air, Blocks.air, false); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Blocks.planks, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Blocks.planks, Blocks.air, false); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) + { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) + { + if (this.getBlockAtCurrentPosition(p_74875_1_, i, this.boundingBox.minY - 1, j, p_74875_3_).getMaterial() == Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, i, this.boundingBox.minY - 1, j, p_74875_3_); + } + } + } + + return true; + } + } + } + + public static class Room extends StructureComponent + { + /** List of other Mineshaft components linked to this room. */ + private List roomsLinkedToTheRoom = new LinkedList(); + private static final String __OBFID = "CL_00000447"; + + public Room() {} + + public Room(int p_i2037_1_, Random p_i2037_2_, int p_i2037_3_, int p_i2037_4_) + { + super(p_i2037_1_); + this.boundingBox = new StructureBoundingBox(p_i2037_3_, 50, p_i2037_4_, p_i2037_3_ + 7 + p_i2037_2_.nextInt(6), 54 + p_i2037_2_.nextInt(6), p_i2037_4_ + 7 + p_i2037_2_.nextInt(6)); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + int i = this.getComponentType(); + int k = this.boundingBox.getYSize() - 3 - 1; + + if (k <= 0) + { + k = 1; + } + + int j; + StructureComponent structurecomponent1; + StructureBoundingBox structureboundingbox; + + for (j = 0; j < this.boundingBox.getXSize(); j += 4) + { + j += p_74861_3_.nextInt(this.boundingBox.getXSize()); + + if (j + 3 > this.boundingBox.getXSize()) + { + break; + } + + structurecomponent1 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + j, this.boundingBox.minY + p_74861_3_.nextInt(k) + 1, this.boundingBox.minZ - 1, 2, i); + + if (structurecomponent1 != null) + { + structureboundingbox = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, structureboundingbox.minY, this.boundingBox.minZ, structureboundingbox.maxX, structureboundingbox.maxY, this.boundingBox.minZ + 1)); + } + } + + for (j = 0; j < this.boundingBox.getXSize(); j += 4) + { + j += p_74861_3_.nextInt(this.boundingBox.getXSize()); + + if (j + 3 > this.boundingBox.getXSize()) + { + break; + } + + structurecomponent1 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + j, this.boundingBox.minY + p_74861_3_.nextInt(k) + 1, this.boundingBox.maxZ + 1, 0, i); + + if (structurecomponent1 != null) + { + structureboundingbox = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(structureboundingbox.minX, structureboundingbox.minY, this.boundingBox.maxZ - 1, structureboundingbox.maxX, structureboundingbox.maxY, this.boundingBox.maxZ)); + } + } + + for (j = 0; j < this.boundingBox.getZSize(); j += 4) + { + j += p_74861_3_.nextInt(this.boundingBox.getZSize()); + + if (j + 3 > this.boundingBox.getZSize()) + { + break; + } + + structurecomponent1 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74861_3_.nextInt(k) + 1, this.boundingBox.minZ + j, 1, i); + + if (structurecomponent1 != null) + { + structureboundingbox = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, structureboundingbox.minY, structureboundingbox.minZ, this.boundingBox.minX + 1, structureboundingbox.maxY, structureboundingbox.maxZ)); + } + } + + for (j = 0; j < this.boundingBox.getZSize(); j += 4) + { + j += p_74861_3_.nextInt(this.boundingBox.getZSize()); + + if (j + 3 > this.boundingBox.getZSize()) + { + break; + } + + structurecomponent1 = StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74861_3_.nextInt(k) + 1, this.boundingBox.minZ + j, 3, i); + + if (structurecomponent1 != null) + { + structureboundingbox = structurecomponent1.getBoundingBox(); + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, structureboundingbox.minY, structureboundingbox.minZ, this.boundingBox.maxX, structureboundingbox.maxY, structureboundingbox.maxZ)); + } + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Blocks.dirt, Blocks.air, true); + this.fillWithBlocks(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, Blocks.air, Blocks.air, false); + Iterator iterator = this.roomsLinkedToTheRoom.iterator(); + + while (iterator.hasNext()) + { + StructureBoundingBox structureboundingbox1 = (StructureBoundingBox)iterator.next(); + this.fillWithBlocks(p_74875_1_, p_74875_3_, structureboundingbox1.minX, structureboundingbox1.maxY - 2, structureboundingbox1.minZ, structureboundingbox1.maxX, structureboundingbox1.maxY, structureboundingbox1.maxZ, Blocks.air, Blocks.air, false); + } + + this.func_151547_a(p_74875_1_, p_74875_3_, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, Blocks.air, false); + return true; + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.roomsLinkedToTheRoom.iterator(); + + while (iterator.hasNext()) + { + StructureBoundingBox structureboundingbox = (StructureBoundingBox)iterator.next(); + nbttaglist.appendTag(structureboundingbox.func_151535_h()); + } + + p_143012_1_.setTag("Entrances", nbttaglist); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + NBTTagList nbttaglist = p_143011_1_.getTagList("Entrances", 11); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + this.roomsLinkedToTheRoom.add(new StructureBoundingBox(nbttaglist.func_150306_c(i))); + } + } + } + + public static class Stairs extends StructureComponent + { + private static final String __OBFID = "CL_00000449"; + + public Stairs() {} + + public Stairs(int p_i2038_1_, Random p_i2038_2_, StructureBoundingBox p_i2038_3_, int p_i2038_4_) + { + super(p_i2038_1_); + this.coordBaseMode = p_i2038_4_; + this.boundingBox = p_i2038_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) {} + + protected void func_143011_b(NBTTagCompound p_143011_1_) {} + + /** + * Trys to find a valid place to put this component. + */ + public static StructureBoundingBox findValidPlacement(List p_74950_0_, Random p_74950_1_, int p_74950_2_, int p_74950_3_, int p_74950_4_, int p_74950_5_) + { + StructureBoundingBox structureboundingbox = new StructureBoundingBox(p_74950_2_, p_74950_3_ - 5, p_74950_4_, p_74950_2_, p_74950_3_ + 2, p_74950_4_); + + switch (p_74950_5_) + { + case 0: + structureboundingbox.maxX = p_74950_2_ + 2; + structureboundingbox.maxZ = p_74950_4_ + 8; + break; + case 1: + structureboundingbox.minX = p_74950_2_ - 8; + structureboundingbox.maxZ = p_74950_4_ + 2; + break; + case 2: + structureboundingbox.maxX = p_74950_2_ + 2; + structureboundingbox.minZ = p_74950_4_ - 8; + break; + case 3: + structureboundingbox.maxX = p_74950_2_ + 8; + structureboundingbox.maxZ = p_74950_4_ + 2; + } + + return StructureComponent.findIntersecting(p_74950_0_, structureboundingbox) != null ? null : structureboundingbox; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + int i = this.getComponentType(); + + switch (this.coordBaseMode) + { + case 0: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, i); + break; + case 1: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, i); + break; + case 2: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, i); + break; + case 3: + StructureMineshaftPieces.getNextMineShaftComponent(p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, i); + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 2, 7, 1, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 7, 2, 2, 8, Blocks.air, Blocks.air, false); + + for (int i = 0; i < 5; ++i) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5 - i - (i < 4 ? 1 : 0), 2 + i, 2, 7 - i, 2 + i, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java new file mode 100644 index 0000000..2657214 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureMineshaftStart.java @@ -0,0 +1,21 @@ +package net.minecraft.world.gen.structure; + +import java.util.Random; +import net.minecraft.world.World; + +public class StructureMineshaftStart extends StructureStart +{ + private static final String __OBFID = "CL_00000450"; + + public StructureMineshaftStart() {} + + public StructureMineshaftStart(World p_i2039_1_, Random p_i2039_2_, int p_i2039_3_, int p_i2039_4_) + { + super(p_i2039_3_, p_i2039_4_); + StructureMineshaftPieces.Room room = new StructureMineshaftPieces.Room(0, p_i2039_2_, (p_i2039_3_ << 4) + 2, (p_i2039_4_ << 4) + 2); + this.components.add(room); + room.buildComponent(room, this.components, p_i2039_2_); + this.updateBoundingBox(); + this.markAvailableHeight(p_i2039_1_, p_i2039_2_, 10); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java new file mode 100644 index 0000000..084f59e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureNetherBridgePieces.java @@ -0,0 +1,1566 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; + +public class StructureNetherBridgePieces +{ + private static final StructureNetherBridgePieces.PieceWeight[] primaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Straight.class, 30, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing3.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing.class, 10, 4), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Stairs.class, 10, 3), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Throne.class, 5, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Entrance.class, 5, 1)}; + private static final StructureNetherBridgePieces.PieceWeight[] secondaryComponents = new StructureNetherBridgePieces.PieceWeight[] {new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor5.class, 25, 0, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Crossing2.class, 15, 5), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor2.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor.class, 5, 10), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor3.class, 10, 3, true), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.Corridor4.class, 7, 2), new StructureNetherBridgePieces.PieceWeight(StructureNetherBridgePieces.NetherStalkRoom.class, 5, 2)}; + private static final String __OBFID = "CL_00000453"; + + public static void registerNetherFortressPieces() + { + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing3.class, "NeBCr"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.End.class, "NeBEF"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Straight.class, "NeBS"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor3.class, "NeCCS"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor4.class, "NeCTB"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Entrance.class, "NeCE"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing2.class, "NeSCSC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor.class, "NeSCLT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor5.class, "NeSC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Corridor2.class, "NeSCRT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.NetherStalkRoom.class, "NeCSR"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Throne.class, "NeMT"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Crossing.class, "NeRC"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Stairs.class, "NeSR"); + MapGenStructureIO.func_143031_a(StructureNetherBridgePieces.Start.class, "NeStart"); + } + + private static StructureNetherBridgePieces.Piece createNextComponentRandom(StructureNetherBridgePieces.PieceWeight p_78738_0_, List p_78738_1_, Random p_78738_2_, int p_78738_3_, int p_78738_4_, int p_78738_5_, int p_78738_6_, int p_78738_7_) + { + Class oclass = p_78738_0_.weightClass; + Object object = null; + + if (oclass == StructureNetherBridgePieces.Straight.class) + { + object = StructureNetherBridgePieces.Straight.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing3.class) + { + object = StructureNetherBridgePieces.Crossing3.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing.class) + { + object = StructureNetherBridgePieces.Crossing.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Stairs.class) + { + object = StructureNetherBridgePieces.Stairs.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Throne.class) + { + object = StructureNetherBridgePieces.Throne.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Entrance.class) + { + object = StructureNetherBridgePieces.Entrance.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor5.class) + { + object = StructureNetherBridgePieces.Corridor5.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor2.class) + { + object = StructureNetherBridgePieces.Corridor2.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor.class) + { + object = StructureNetherBridgePieces.Corridor.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor3.class) + { + object = StructureNetherBridgePieces.Corridor3.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Corridor4.class) + { + object = StructureNetherBridgePieces.Corridor4.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.Crossing2.class) + { + object = StructureNetherBridgePieces.Crossing2.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + else if (oclass == StructureNetherBridgePieces.NetherStalkRoom.class) + { + object = StructureNetherBridgePieces.NetherStalkRoom.createValidComponent(p_78738_1_, p_78738_2_, p_78738_3_, p_78738_4_, p_78738_5_, p_78738_6_, p_78738_7_); + } + + return (StructureNetherBridgePieces.Piece)object; + } + + public static class Corridor extends StructureNetherBridgePieces.Piece + { + private boolean field_111021_b; + private static final String __OBFID = "CL_00000461"; + + public Corridor() {} + + public Corridor(int p_i2049_1_, Random p_i2049_2_, StructureBoundingBox p_i2049_3_, int p_i2049_4_) + { + super(p_i2049_1_); + this.coordBaseMode = p_i2049_4_; + this.boundingBox = p_i2049_3_; + this.field_111021_b = p_i2049_2_.nextInt(3) == 0; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_111021_b = p_143011_1_.getBoolean("Chest"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.field_111021_b); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Corridor createValidComponent(List p_74978_0_, Random p_74978_1_, int p_74978_2_, int p_74978_3_, int p_74978_4_, int p_74978_5_, int p_74978_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74978_2_, p_74978_3_, p_74978_4_, -1, 0, 0, 5, 7, 5, p_74978_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74978_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor(p_74978_6_, p_74978_1_, structureboundingbox, p_74978_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 4, 3, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + int i; + int j; + + if (this.field_111021_b) + { + i = this.getYWithOffset(2); + j = this.getXWithOffset(3, 3); + int k = this.getZWithOffset(3, 3); + + if (p_74875_3_.isVecInside(j, i, k)) + { + this.field_111021_b = false; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (i = 0; i <= 4; ++i) + { + for (j = 0; j <= 4; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor2 extends StructureNetherBridgePieces.Piece + { + private boolean field_111020_b; + private static final String __OBFID = "CL_00000463"; + + public Corridor2() {} + + public Corridor2(int p_i2051_1_, Random p_i2051_2_, StructureBoundingBox p_i2051_3_, int p_i2051_4_) + { + super(p_i2051_1_); + this.coordBaseMode = p_i2051_4_; + this.boundingBox = p_i2051_3_; + this.field_111020_b = p_i2051_2_.nextInt(3) == 0; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_111020_b = p_143011_1_.getBoolean("Chest"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.field_111020_b); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Corridor2 createValidComponent(List p_74980_0_, Random p_74980_1_, int p_74980_2_, int p_74980_3_, int p_74980_4_, int p_74980_5_, int p_74980_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74980_2_, p_74980_3_, p_74980_4_, -1, 0, 0, 5, 7, 5, p_74980_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74980_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor2(p_74980_6_, p_74980_1_, structureboundingbox, p_74980_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 4, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 4, 1, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 3, 4, 3, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick, false); + int i; + int j; + + if (this.field_111020_b) + { + i = this.getYWithOffset(2); + j = this.getXWithOffset(1, 3); + int k = this.getZWithOffset(1, 3); + + if (p_74875_3_.isVecInside(j, i, k)) + { + this.field_111020_b = false; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 1, 2, 3, field_111019_a, 2 + p_74875_2_.nextInt(4)); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (i = 0; i <= 4; ++i) + { + for (j = 0; j <= 4; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor3 extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000457"; + + public Corridor3() {} + + public Corridor3(int p_i2045_1_, Random p_i2045_2_, StructureBoundingBox p_i2045_3_, int p_i2045_4_) + { + super(p_i2045_1_); + this.coordBaseMode = p_i2045_4_; + this.boundingBox = p_i2045_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Corridor3 createValidComponent(List p_74982_0_, Random p_74982_1_, int p_74982_2_, int p_74982_3_, int p_74982_4_, int p_74982_5_, int p_74982_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74982_2_, p_74982_3_, p_74982_4_, -1, -7, 0, 5, 14, 10, p_74982_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74982_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor3(p_74982_6_, p_74982_1_, structureboundingbox, p_74982_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + int i = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 2); + + for (int j = 0; j <= 9; ++j) + { + int k = Math.max(1, 7 - j); + int l = Math.min(Math.max(k + 5, 14 - j), 13); + int i1 = j; + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, j, 4, k, j, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, k + 1, j, 3, l - 1, j, Blocks.air, Blocks.air, false); + + if (j <= 6) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, i, 1, k + 1, j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, i, 2, k + 1, j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, i, 3, k + 1, j, p_74875_3_); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, l, j, 4, l, j, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, k + 1, j, 0, l - 1, j, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, k + 1, j, 4, l - 1, j, Blocks.nether_brick, Blocks.nether_brick, false); + + if ((j & 1) == 0) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, k + 2, j, 0, k + 3, j, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, k + 2, j, 4, k + 3, j, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + for (int j1 = 0; j1 <= 4; ++j1) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, j1, -1, i1, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor4 extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000458"; + + public Corridor4() {} + + public Corridor4(int p_i2046_1_, Random p_i2046_2_, StructureBoundingBox p_i2046_3_, int p_i2046_4_) + { + super(p_i2046_1_); + this.coordBaseMode = p_i2046_4_; + this.boundingBox = p_i2046_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + byte b0 = 1; + + if (this.coordBaseMode == 1 || this.coordBaseMode == 2) + { + b0 = 5; + } + + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, b0, p_74861_3_.nextInt(8) > 0); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, b0, p_74861_3_.nextInt(8) > 0); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Corridor4 createValidComponent(List p_74985_0_, Random p_74985_1_, int p_74985_2_, int p_74985_3_, int p_74985_4_, int p_74985_5_, int p_74985_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74985_2_, p_74985_3_, p_74985_4_, -3, 0, 0, 9, 7, 9, p_74985_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74985_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor4(p_74985_6_, p_74985_1_, structureboundingbox, p_74985_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 8, 5, 8, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 0, 8, 6, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 2, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 2, 0, 8, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 0, 1, 4, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 3, 0, 7, 4, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 4, 8, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 4, 2, 2, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 1, 4, 7, 2, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 8, 8, 3, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 6, 0, 3, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 3, 6, 8, 3, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 4, 0, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 3, 4, 8, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 5, 2, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 3, 5, 7, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 5, 1, 5, 5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 4, 5, 7, 5, 5, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int i = 0; i <= 5; ++i) + { + for (int j = 0; j <= 8; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, j, -1, i, p_74875_3_); + } + } + + return true; + } + } + + public static class Corridor5 extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000462"; + + public Corridor5() {} + + public Corridor5(int p_i2050_1_, Random p_i2050_2_, StructureBoundingBox p_i2050_3_, int p_i2050_4_) + { + super(p_i2050_1_); + this.coordBaseMode = p_i2050_4_; + this.boundingBox = p_i2050_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Corridor5 createValidComponent(List p_74981_0_, Random p_74981_1_, int p_74981_2_, int p_74981_3_, int p_74981_4_, int p_74981_5_, int p_74981_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74981_2_, p_74981_3_, p_74981_4_, -1, 0, 0, 5, 7, 5, p_74981_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74981_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Corridor5(p_74981_6_, p_74981_1_, structureboundingbox, p_74981_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 3, 0, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 3, 4, 4, 3, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000468"; + + public Crossing() {} + + public Crossing(int p_i2057_1_, Random p_i2057_2_, StructureBoundingBox p_i2057_3_, int p_i2057_4_) + { + super(p_i2057_1_); + this.coordBaseMode = p_i2057_4_; + this.boundingBox = p_i2057_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 2, 0, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 2, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 2, false); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Crossing createValidComponent(List p_74974_0_, Random p_74974_1_, int p_74974_2_, int p_74974_3_, int p_74974_4_, int p_74974_5_, int p_74974_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74974_2_, p_74974_3_, p_74974_4_, -2, 0, 0, 7, 9, 7, p_74974_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74974_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing(p_74974_6_, p_74974_1_, structureboundingbox, p_74974_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 6, 1, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 7, 6, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 1, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 6, 1, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 2, 0, 6, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 2, 6, 6, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 6, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 5, 0, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 2, 0, 6, 6, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 2, 5, 6, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 6, 0, 4, 6, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 6, 6, 4, 6, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 6, 4, 5, 6, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 2, 0, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 2, 0, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 6, 2, 6, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 5, 2, 6, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int i = 0; i <= 6; ++i) + { + for (int j = 0; j <= 6; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing2 extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000460"; + + public Crossing2() {} + + public Crossing2(int p_i2048_1_, Random p_i2048_2_, StructureBoundingBox p_i2048_3_, int p_i2048_4_) + { + super(p_i2048_1_); + this.coordBaseMode = p_i2048_4_; + this.boundingBox = p_i2048_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 0, true); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, 1, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Crossing2 createValidComponent(List p_74979_0_, Random p_74979_1_, int p_74979_2_, int p_74979_3_, int p_74979_4_, int p_74979_5_, int p_74979_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74979_2_, p_74979_3_, p_74979_4_, -1, 0, 0, 5, 7, 5, p_74979_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74979_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing2(p_74979_6_, p_74979_1_, structureboundingbox, p_74979_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 4, 5, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 4, 0, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 4, 4, 5, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 0, 4, 6, 4, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 4; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Crossing3 extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000454"; + + public Crossing3() {} + + public Crossing3(int p_i2041_1_, Random p_i2041_2_, StructureBoundingBox p_i2041_3_, int p_i2041_4_) + { + super(p_i2041_1_); + this.coordBaseMode = p_i2041_4_; + this.boundingBox = p_i2041_3_; + } + + protected Crossing3(Random p_i2042_1_, int p_i2042_2_, int p_i2042_3_) + { + super(0); + this.coordBaseMode = p_i2042_1_.nextInt(4); + + switch (this.coordBaseMode) + { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(p_i2042_2_, 64, p_i2042_3_, p_i2042_2_ + 19 - 1, 73, p_i2042_3_ + 19 - 1); + } + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 8, 3, false); + this.getNextComponentX((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 3, 8, false); + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 3, 8, false); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Crossing3 createValidComponent(List p_74966_0_, Random p_74966_1_, int p_74966_2_, int p_74966_3_, int p_74966_4_, int p_74966_5_, int p_74966_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74966_2_, p_74966_3_, p_74966_4_, -8, -3, 0, 19, 10, 19, p_74966_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74966_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Crossing3(p_74966_6_, p_74966_1_, structureboundingbox, p_74966_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 3, 0, 11, 4, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 7, 18, 4, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 7, 18, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 8, 18, 7, 10, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 5, 0, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 5, 11, 7, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 0, 11, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 11, 11, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 7, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 7, 18, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 11, 7, 5, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 11, 18, 5, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 2, 0, 11, 2, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 2, 13, 11, 2, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 0, 0, 11, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 0, 15, 11, 1, 18, Blocks.nether_brick, Blocks.nether_brick, false); + int i; + int j; + + for (i = 7; i <= 11; ++i) + { + for (j = 0; j <= 2; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, 18 - j, p_74875_3_); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 7, 5, 2, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 13, 2, 7, 18, 2, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 7, 3, 1, 11, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 15, 0, 7, 18, 1, 11, Blocks.nether_brick, Blocks.nether_brick, false); + + for (i = 0; i <= 2; ++i) + { + for (j = 7; j <= 11; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 18 - i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class End extends StructureNetherBridgePieces.Piece + { + private int fillSeed; + private static final String __OBFID = "CL_00000455"; + + public End() {} + + public End(int p_i2043_1_, Random p_i2043_2_, StructureBoundingBox p_i2043_3_, int p_i2043_4_) + { + super(p_i2043_1_); + this.coordBaseMode = p_i2043_4_; + this.boundingBox = p_i2043_3_; + this.fillSeed = p_i2043_2_.nextInt(); + } + + public static StructureNetherBridgePieces.End func_74971_a(List p_74971_0_, Random p_74971_1_, int p_74971_2_, int p_74971_3_, int p_74971_4_, int p_74971_5_, int p_74971_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74971_2_, p_74971_3_, p_74971_4_, -1, -3, 0, 5, 10, 8, p_74971_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74971_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.End(p_74971_6_, p_74971_1_, structureboundingbox, p_74971_5_) : null; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.fillSeed = p_143011_1_.getInteger("Seed"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Seed", this.fillSeed); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + Random random1 = new Random((long)this.fillSeed); + int i; + int j; + int k; + + for (i = 0; i <= 4; ++i) + { + for (j = 3; j <= 4; ++j) + { + k = random1.nextInt(8); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, j, 0, i, j, k, Blocks.nether_brick, Blocks.nether_brick, false); + } + } + + i = random1.nextInt(8); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 0, 5, i, Blocks.nether_brick, Blocks.nether_brick, false); + i = random1.nextInt(8); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 0, 4, 5, i, Blocks.nether_brick, Blocks.nether_brick, false); + + for (i = 0; i <= 4; ++i) + { + j = random1.nextInt(5); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 2, 0, i, 2, j, Blocks.nether_brick, Blocks.nether_brick, false); + } + + for (i = 0; i <= 4; ++i) + { + for (j = 0; j <= 1; ++j) + { + k = random1.nextInt(3); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, j, 0, i, j, k, Blocks.nether_brick, Blocks.nether_brick, false); + } + } + + return true; + } + } + + public static class Entrance extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000459"; + + public Entrance() {} + + public Entrance(int p_i2047_1_, Random p_i2047_2_, StructureBoundingBox p_i2047_3_, int p_i2047_4_) + { + super(p_i2047_1_); + this.coordBaseMode = p_i2047_4_; + this.boundingBox = p_i2047_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 3, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Entrance createValidComponent(List p_74984_0_, Random p_74984_1_, int p_74984_2_, int p_74984_3_, int p_74984_4_, int p_74984_5_, int p_74984_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74984_2_, p_74984_3_, p_74984_4_, -5, -3, 0, 13, 14, 13, p_74984_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74984_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Entrance(p_74984_6_, p_74984_1_, structureboundingbox, p_74984_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 0, 12, 4, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 12, 13, 12, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 1, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 0, 12, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 11, 4, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 11, 10, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 9, 11, 7, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 9, 0, 7, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 11, 2, 10, 12, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 8, 0, 7, 8, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + int i; + + for (i = 1; i <= 11; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, i, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, i, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 0, 13, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 12, 13, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, i + 1, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, i + 1, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, i + 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, i + 1, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, 0, p_74875_3_); + + for (i = 3; i <= 9; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 7, i, 1, 8, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 7, i, 11, 8, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 8, 2, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 4, 12, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 0, 8, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 9, 8, 1, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 4, 3, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 0, 4, 12, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + int j; + + for (i = 4; i <= 8; ++i) + { + for (j = 0; j <= 2; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, 12 - j, p_74875_3_); + } + } + + for (i = 0; i <= 2; ++i) + { + for (j = 4; j <= 8; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 12 - i, -1, j, p_74875_3_); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 5, 5, 7, 5, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 1, 6, 6, 4, 6, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 6, 0, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.flowing_lava, 0, 6, 5, 6, p_74875_3_); + i = this.getXWithOffset(6, 6); + j = this.getYWithOffset(5); + int k = this.getZWithOffset(6, 6); + + if (p_74875_3_.isVecInside(i, j, k)) + { + p_74875_1_.scheduledUpdatesAreImmediate = true; + Blocks.flowing_lava.updateTick(p_74875_1_, i, j, k, p_74875_2_); + p_74875_1_.scheduledUpdatesAreImmediate = false; + } + + return true; + } + } + + public static class NetherStalkRoom extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000464"; + + public NetherStalkRoom() {} + + public NetherStalkRoom(int p_i2052_1_, Random p_i2052_2_, StructureBoundingBox p_i2052_3_, int p_i2052_4_) + { + super(p_i2052_1_); + this.coordBaseMode = p_i2052_4_; + this.boundingBox = p_i2052_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 3, true); + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 5, 11, true); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.NetherStalkRoom createValidComponent(List p_74977_0_, Random p_74977_1_, int p_74977_2_, int p_74977_3_, int p_74977_4_, int p_74977_5_, int p_74977_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74977_2_, p_74977_3_, p_74977_4_, -5, -3, 0, 13, 14, 13, p_74977_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74977_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.NetherStalkRoom(p_74977_6_, p_74977_1_, structureboundingbox, p_74977_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 0, 12, 4, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 12, 13, 12, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 1, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 5, 0, 12, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 11, 4, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 11, 10, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 9, 11, 7, 12, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 0, 10, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 9, 0, 7, 12, 1, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 11, 2, 10, 12, 10, Blocks.nether_brick, Blocks.nether_brick, false); + int i; + + for (i = 1; i <= 11; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 10, 0, i, 11, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 10, 12, i, 11, 12, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 10, i, 0, 11, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 10, i, 12, 11, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, i, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, i, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 0, 13, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 12, 13, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, i + 1, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, i + 1, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, i + 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, i + 1, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 0, 13, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 12, 13, 0, p_74875_3_); + + for (i = 3; i <= 9; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 7, i, 1, 8, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 11, 7, i, 11, 8, i, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + } + + i = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 3); + int j; + int k; + int l; + + for (j = 0; j <= 6; ++j) + { + k = j + 4; + + for (l = 5; l <= 7; ++l) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, i, l, 5 + j, k, p_74875_3_); + } + + if (k >= 5 && k <= 8) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 5, k, 7, j + 4, k, Blocks.nether_brick, Blocks.nether_brick, false); + } + else if (k >= 9 && k <= 10) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 8, k, 7, j + 4, k, Blocks.nether_brick, Blocks.nether_brick, false); + } + + if (j >= 1) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 6 + j, k, 7, 9 + j, k, Blocks.air, Blocks.air, false); + } + } + + for (j = 5; j <= 7; ++j) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, i, j, 12, 11, p_74875_3_); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 6, 7, 5, 7, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 6, 7, 7, 7, 7, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 13, 12, 7, 13, 12, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 2, 3, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 9, 3, 5, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 4, 2, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 5, 2, 10, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 5, 9, 10, 5, 10, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 5, 4, 10, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + j = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 0); + k = this.getMetadataWithOffset(Blocks.nether_brick_stairs, 1); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, k, 4, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, k, 4, 5, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, k, 4, 5, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, k, 4, 5, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, j, 8, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, j, 8, 5, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, j, 8, 5, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_stairs, j, 8, 5, 10, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 4, 4, 4, 4, 8, Blocks.soul_sand, Blocks.soul_sand, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 4, 4, 9, 4, 8, Blocks.soul_sand, Blocks.soul_sand, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 5, 4, 4, 5, 8, Blocks.nether_wart, Blocks.nether_wart, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 4, 9, 5, 8, Blocks.nether_wart, Blocks.nether_wart, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 0, 8, 2, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 4, 12, 2, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 0, 8, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 9, 8, 1, 12, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 4, 3, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 0, 4, 12, 1, 8, Blocks.nether_brick, Blocks.nether_brick, false); + int i1; + + for (l = 4; l <= 8; ++l) + { + for (i1 = 0; i1 <= 2; ++i1) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, l, -1, i1, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, l, -1, 12 - i1, p_74875_3_); + } + } + + for (l = 0; l <= 2; ++l) + { + for (i1 = 4; i1 <= 8; ++i1) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, l, -1, i1, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, 12 - l, -1, i1, p_74875_3_); + } + } + + return true; + } + } + + abstract static class Piece extends StructureComponent + { + protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 5), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 5), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 15), new WeightedRandomChestContent(Items.golden_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.flint_and_steel, 0, 1, 1, 5), new WeightedRandomChestContent(Items.nether_wart, 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 10), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 8), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 5), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 3)}; + private static final String __OBFID = "CL_00000466"; + + public Piece() {} + + protected Piece(int p_i2054_1_) + { + super(p_i2054_1_); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) {} + + protected void func_143012_a(NBTTagCompound p_143012_1_) {} + + private int getTotalWeight(List p_74960_1_) + { + boolean flag = false; + int i = 0; + StructureNetherBridgePieces.PieceWeight pieceweight; + + for (Iterator iterator = p_74960_1_.iterator(); iterator.hasNext(); i += pieceweight.field_78826_b) + { + pieceweight = (StructureNetherBridgePieces.PieceWeight)iterator.next(); + + if (pieceweight.field_78824_d > 0 && pieceweight.field_78827_c < pieceweight.field_78824_d) + { + flag = true; + } + } + + return flag ? i : -1; + } + + private StructureNetherBridgePieces.Piece getNextComponent(StructureNetherBridgePieces.Start p_74959_1_, List p_74959_2_, List p_74959_3_, Random p_74959_4_, int p_74959_5_, int p_74959_6_, int p_74959_7_, int p_74959_8_, int p_74959_9_) + { + int j1 = this.getTotalWeight(p_74959_2_); + boolean flag = j1 > 0 && p_74959_9_ <= 30; + int k1 = 0; + + while (k1 < 5 && flag) + { + ++k1; + int l1 = p_74959_4_.nextInt(j1); + Iterator iterator = p_74959_2_.iterator(); + + while (iterator.hasNext()) + { + StructureNetherBridgePieces.PieceWeight pieceweight = (StructureNetherBridgePieces.PieceWeight)iterator.next(); + l1 -= pieceweight.field_78826_b; + + if (l1 < 0) + { + if (!pieceweight.func_78822_a(p_74959_9_) || pieceweight == p_74959_1_.theNetherBridgePieceWeight && !pieceweight.field_78825_e) + { + break; + } + + StructureNetherBridgePieces.Piece piece = StructureNetherBridgePieces.createNextComponentRandom(pieceweight, p_74959_3_, p_74959_4_, p_74959_5_, p_74959_6_, p_74959_7_, p_74959_8_, p_74959_9_); + + if (piece != null) + { + ++pieceweight.field_78827_c; + p_74959_1_.theNetherBridgePieceWeight = pieceweight; + + if (!pieceweight.func_78823_a()) + { + p_74959_2_.remove(pieceweight); + } + + return piece; + } + } + } + } + + return StructureNetherBridgePieces.End.func_74971_a(p_74959_3_, p_74959_4_, p_74959_5_, p_74959_6_, p_74959_7_, p_74959_8_, p_74959_9_); + } + + /** + * Finds a random component to tack on to the bridge. Or builds the end. + */ + private StructureComponent getNextComponent(StructureNetherBridgePieces.Start p_74962_1_, List p_74962_2_, Random p_74962_3_, int p_74962_4_, int p_74962_5_, int p_74962_6_, int p_74962_7_, int p_74962_8_, boolean p_74962_9_) + { + if (Math.abs(p_74962_4_ - p_74962_1_.getBoundingBox().minX) <= 112 && Math.abs(p_74962_6_ - p_74962_1_.getBoundingBox().minZ) <= 112) + { + List list1 = p_74962_1_.primaryWeights; + + if (p_74962_9_) + { + list1 = p_74962_1_.secondaryWeights; + } + + StructureNetherBridgePieces.Piece piece = this.getNextComponent(p_74962_1_, list1, p_74962_2_, p_74962_3_, p_74962_4_, p_74962_5_, p_74962_6_, p_74962_7_, p_74962_8_ + 1); + + if (piece != null) + { + p_74962_2_.add(piece); + p_74962_1_.field_74967_d.add(piece); + } + + return piece; + } + else + { + return StructureNetherBridgePieces.End.func_74971_a(p_74962_2_, p_74962_3_, p_74962_4_, p_74962_5_, p_74962_6_, p_74962_7_, p_74962_8_); + } + } + + /** + * Gets the next component in any cardinal direction + */ + protected StructureComponent getNextComponentNormal(StructureNetherBridgePieces.Start p_74963_1_, List p_74963_2_, Random p_74963_3_, int p_74963_4_, int p_74963_5_, boolean p_74963_6_) + { + switch (this.coordBaseMode) + { + case 0: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + case 1: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + case 2: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.minX + p_74963_4_, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), p_74963_6_); + case 3: + return this.getNextComponent(p_74963_1_, p_74963_2_, p_74963_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74963_5_, this.boundingBox.minZ + p_74963_4_, this.coordBaseMode, this.getComponentType(), p_74963_6_); + default: + return null; + } + } + + /** + * Gets the next component in the +/- X direction + */ + protected StructureComponent getNextComponentX(StructureNetherBridgePieces.Start p_74961_1_, List p_74961_2_, Random p_74961_3_, int p_74961_4_, int p_74961_5_, boolean p_74961_6_) + { + switch (this.coordBaseMode) + { + case 0: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, 1, this.getComponentType(), p_74961_6_); + case 1: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, 2, this.getComponentType(), p_74961_6_); + case 2: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ + p_74961_5_, 1, this.getComponentType(), p_74961_6_); + case 3: + return this.getNextComponent(p_74961_1_, p_74961_2_, p_74961_3_, this.boundingBox.minX + p_74961_5_, this.boundingBox.minY + p_74961_4_, this.boundingBox.minZ - 1, 2, this.getComponentType(), p_74961_6_); + default: + return null; + } + } + + /** + * Gets the next component in the +/- Z direction + */ + protected StructureComponent getNextComponentZ(StructureNetherBridgePieces.Start p_74965_1_, List p_74965_2_, Random p_74965_3_, int p_74965_4_, int p_74965_5_, boolean p_74965_6_) + { + switch (this.coordBaseMode) + { + case 0: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, 3, this.getComponentType(), p_74965_6_); + case 1: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType(), p_74965_6_); + case 2: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74965_4_, this.boundingBox.minZ + p_74965_5_, 3, this.getComponentType(), p_74965_6_); + case 3: + return this.getNextComponent(p_74965_1_, p_74965_2_, p_74965_3_, this.boundingBox.minX + p_74965_5_, this.boundingBox.minY + p_74965_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType(), p_74965_6_); + default: + return null; + } + } + + /** + * Checks if the bounding box's minY is > 10 + */ + protected static boolean isAboveGround(StructureBoundingBox p_74964_0_) + { + return p_74964_0_ != null && p_74964_0_.minY > 10; + } + } + + static class PieceWeight + { + /** The class of the StructureComponent to which this weight corresponds. */ + public Class weightClass; + public final int field_78826_b; + public int field_78827_c; + public int field_78824_d; + public boolean field_78825_e; + private static final String __OBFID = "CL_00000467"; + + public PieceWeight(Class p_i2055_1_, int p_i2055_2_, int p_i2055_3_, boolean p_i2055_4_) + { + this.weightClass = p_i2055_1_; + this.field_78826_b = p_i2055_2_; + this.field_78824_d = p_i2055_3_; + this.field_78825_e = p_i2055_4_; + } + + public PieceWeight(Class p_i2056_1_, int p_i2056_2_, int p_i2056_3_) + { + this(p_i2056_1_, p_i2056_2_, p_i2056_3_, false); + } + + public boolean func_78822_a(int p_78822_1_) + { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + + public boolean func_78823_a() + { + return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; + } + } + + public static class Stairs extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000469"; + + public Stairs() {} + + public Stairs(int p_i2058_1_, Random p_i2058_2_, StructureBoundingBox p_i2058_3_, int p_i2058_4_) + { + super(p_i2058_1_); + this.coordBaseMode = p_i2058_4_; + this.boundingBox = p_i2058_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentZ((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 6, 2, false); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Stairs createValidComponent(List p_74973_0_, Random p_74973_1_, int p_74973_2_, int p_74973_3_, int p_74973_4_, int p_74973_5_, int p_74973_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74973_2_, p_74973_3_, p_74973_4_, -2, 0, 0, 7, 11, 7, p_74973_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74973_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Stairs(p_74973_6_, p_74973_1_, structureboundingbox, p_74973_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 6, 1, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 10, 6, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 1, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 2, 0, 6, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 1, 0, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 2, 1, 6, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 6, 5, 8, 6, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 2, 0, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 3, 2, 6, 5, 2, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 3, 4, 6, 5, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick, 0, 5, 2, 5, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 2, 5, 4, 3, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 2, 5, 3, 4, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 2, 5, 2, 5, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 5, 1, 6, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 7, 1, 5, 7, 4, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 8, 2, 6, 8, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 6, 0, 4, 8, 0, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 5, 0, 4, 5, 0, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + + for (int i = 0; i <= 6; ++i) + { + for (int j = 0; j <= 6; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } + + public static class Start extends StructureNetherBridgePieces.Crossing3 + { + /** Instance of StructureNetherBridgePieceWeight. */ + public StructureNetherBridgePieces.PieceWeight theNetherBridgePieceWeight; + /** Contains the list of valid piece weights for the set of nether bridge structure pieces. */ + public List primaryWeights; + /** Contains the list of valid piece weights for the secondary set of nether bridge structure pieces. */ + public List secondaryWeights; + public ArrayList field_74967_d = new ArrayList(); + private static final String __OBFID = "CL_00000470"; + + public Start() {} + + public Start(Random p_i2059_1_, int p_i2059_2_, int p_i2059_3_) + { + super(p_i2059_1_, p_i2059_2_, p_i2059_3_); + this.primaryWeights = new ArrayList(); + StructureNetherBridgePieces.PieceWeight[] apieceweight = StructureNetherBridgePieces.primaryComponents; + int k = apieceweight.length; + int l; + StructureNetherBridgePieces.PieceWeight pieceweight; + + for (l = 0; l < k; ++l) + { + pieceweight = apieceweight[l]; + pieceweight.field_78827_c = 0; + this.primaryWeights.add(pieceweight); + } + + this.secondaryWeights = new ArrayList(); + apieceweight = StructureNetherBridgePieces.secondaryComponents; + k = apieceweight.length; + + for (l = 0; l < k; ++l) + { + pieceweight = apieceweight[l]; + pieceweight.field_78827_c = 0; + this.secondaryWeights.add(pieceweight); + } + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + } + } + + public static class Straight extends StructureNetherBridgePieces.Piece + { + private static final String __OBFID = "CL_00000456"; + + public Straight() {} + + public Straight(int p_i2044_1_, Random p_i2044_2_, StructureBoundingBox p_i2044_3_, int p_i2044_4_) + { + super(p_i2044_1_); + this.coordBaseMode = p_i2044_4_; + this.boundingBox = p_i2044_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureNetherBridgePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 1, 3, false); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Straight createValidComponent(List p_74983_0_, Random p_74983_1_, int p_74983_2_, int p_74983_3_, int p_74983_4_, int p_74983_5_, int p_74983_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74983_2_, p_74983_3_, p_74983_4_, -1, -3, 0, 5, 10, 19, p_74983_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74983_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Straight(p_74983_6_, p_74983_1_, structureboundingbox, p_74983_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 0, 4, 4, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 0, 3, 7, 18, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 0, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 0, 4, 5, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 4, 2, 5, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 13, 4, 2, 18, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 1, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 15, 4, 1, 18, Blocks.nether_brick, Blocks.nether_brick, false); + + for (int i = 0; i <= 4; ++i) + { + for (int j = 0; j <= 2; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, 18 - j, p_74875_3_); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 4, 0, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 14, 0, 4, 14, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 17, 0, 4, 17, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 4, 1, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 4, 4, 4, 4, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 3, 14, 4, 4, 14, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 17, 4, 4, 17, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + return true; + } + } + + public static class Throne extends StructureNetherBridgePieces.Piece + { + private boolean hasSpawner; + private static final String __OBFID = "CL_00000465"; + + public Throne() {} + + public Throne(int p_i2053_1_, Random p_i2053_2_, StructureBoundingBox p_i2053_3_, int p_i2053_4_) + { + super(p_i2053_1_); + this.coordBaseMode = p_i2053_4_; + this.boundingBox = p_i2053_3_; + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.hasSpawner = p_143011_1_.getBoolean("Mob"); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Mob", this.hasSpawner); + } + + /** + * Creates and returns a new component piece. Or null if it could not find enough room to place it. + */ + public static StructureNetherBridgePieces.Throne createValidComponent(List p_74975_0_, Random p_74975_1_, int p_74975_2_, int p_74975_3_, int p_74975_4_, int p_74975_5_, int p_74975_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74975_2_, p_74975_3_, p_74975_4_, -2, 0, 0, 7, 8, 9, p_74975_5_); + return isAboveGround(structureboundingbox) && StructureComponent.findIntersecting(p_74975_0_, structureboundingbox) == null ? new StructureNetherBridgePieces.Throne(p_74975_6_, p_74975_1_, structureboundingbox, p_74975_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 6, 7, 7, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 5, 1, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 1, 5, 2, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 2, 5, 3, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 3, 5, 4, 7, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 0, 1, 4, 2, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 2, 0, 5, 4, 2, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 2, 1, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 5, 2, 5, 5, 3, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 3, 0, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 5, 3, 6, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 8, 5, 5, 8, Blocks.nether_brick, Blocks.nether_brick, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 1, 6, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.nether_brick_fence, 0, 5, 6, 3, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 3, 0, 6, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 6, 3, 6, 6, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 6, 8, 5, 7, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 8, 8, 4, 8, 8, Blocks.nether_brick_fence, Blocks.nether_brick_fence, false); + int i; + int j; + + if (!this.hasSpawner) + { + i = this.getYWithOffset(5); + j = this.getXWithOffset(3, 5); + int k = this.getZWithOffset(3, 5); + + if (p_74875_3_.isVecInside(j, i, k)) + { + this.hasSpawner = true; + p_74875_1_.setBlock(j, i, k, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)p_74875_1_.getTileEntity(j, i, k); + + if (tileentitymobspawner != null) + { + tileentitymobspawner.func_145881_a().setEntityName("Blaze"); + } + } + } + + for (i = 0; i <= 6; ++i) + { + for (j = 0; j <= 6; ++j) + { + this.func_151554_b(p_74875_1_, Blocks.nether_brick, 0, i, -1, j, p_74875_3_); + } + } + + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStart.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStart.java new file mode 100644 index 0000000..f015d44 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStart.java @@ -0,0 +1,187 @@ +package net.minecraft.world.gen.structure; + +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Random; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public abstract class StructureStart +{ + /** List of all StructureComponents that are part of this structure */ + protected LinkedList components = new LinkedList(); + protected StructureBoundingBox boundingBox; + private int field_143024_c; + private int field_143023_d; + private static final String __OBFID = "CL_00000513"; + + public StructureStart() {} + + public StructureStart(int p_i43002_1_, int p_i43002_2_) + { + this.field_143024_c = p_i43002_1_; + this.field_143023_d = p_i43002_2_; + } + + public StructureBoundingBox getBoundingBox() + { + return this.boundingBox; + } + + public LinkedList getComponents() + { + return this.components; + } + + /** + * Keeps iterating Structure Pieces and spawning them until the checks tell it to stop + */ + public void generateStructure(World p_75068_1_, Random p_75068_2_, StructureBoundingBox p_75068_3_) + { + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + + if (structurecomponent.getBoundingBox().intersectsWith(p_75068_3_) && !structurecomponent.addComponentParts(p_75068_1_, p_75068_2_, p_75068_3_)) + { + iterator.remove(); + } + } + } + + /** + * Calculates total bounding box based on components' bounding boxes and saves it to boundingBox + */ + protected void updateBoundingBox() + { + this.boundingBox = StructureBoundingBox.getNewBoundingBox(); + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + this.boundingBox.expandTo(structurecomponent.getBoundingBox()); + } + } + + public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) + { + if (MapGenStructureIO.func_143033_a(this) == null) // 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(); + nbttagcompound.setString("id", MapGenStructureIO.func_143033_a(this)); + nbttagcompound.setInteger("ChunkX", p_143021_1_); + nbttagcompound.setInteger("ChunkZ", p_143021_2_); + nbttagcompound.setTag("BB", this.boundingBox.func_151535_h()); + NBTTagList nbttaglist = new NBTTagList(); + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + nbttaglist.appendTag(structurecomponent.func_143010_b()); + } + + nbttagcompound.setTag("Children", nbttaglist); + this.func_143022_a(nbttagcompound); + return nbttagcompound; + } + + public void func_143022_a(NBTTagCompound p_143022_1_) {} + + public void func_143020_a(World p_143020_1_, NBTTagCompound p_143020_2_) + { + this.field_143024_c = p_143020_2_.getInteger("ChunkX"); + this.field_143023_d = p_143020_2_.getInteger("ChunkZ"); + + if (p_143020_2_.hasKey("BB")) + { + this.boundingBox = new StructureBoundingBox(p_143020_2_.getIntArray("BB")); + } + + NBTTagList nbttaglist = p_143020_2_.getTagList("Children", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.getCompoundTagAt(i), p_143020_1_); + if (tmp != null) this.components.add(tmp); //Forge: Prevent NPEs further down the line when a component can't be loaded. + } + + this.func_143017_b(p_143020_2_); + } + + public void func_143017_b(NBTTagCompound p_143017_1_) {} + + /** + * offsets the structure Bounding Boxes up to a certain height, typically 63 - 10 + */ + protected void markAvailableHeight(World p_75067_1_, Random p_75067_2_, int p_75067_3_) + { + int j = 63 - p_75067_3_; + int k = this.boundingBox.getYSize() + 1; + + if (k < j) + { + k += p_75067_2_.nextInt(j - k); + } + + int l = k - this.boundingBox.maxY; + this.boundingBox.offset(0, l, 0); + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + structurecomponent.getBoundingBox().offset(0, l, 0); + } + } + + protected void setRandomHeight(World p_75070_1_, Random p_75070_2_, int p_75070_3_, int p_75070_4_) + { + int k = p_75070_4_ - p_75070_3_ + 1 - this.boundingBox.getYSize(); + boolean flag = true; + int i1; + + if (k > 1) + { + i1 = p_75070_3_ + p_75070_2_.nextInt(k); + } + else + { + i1 = p_75070_3_; + } + + int l = i1 - this.boundingBox.minY; + this.boundingBox.offset(0, l, 0); + Iterator iterator = this.components.iterator(); + + while (iterator.hasNext()) + { + StructureComponent structurecomponent = (StructureComponent)iterator.next(); + structurecomponent.getBoundingBox().offset(0, l, 0); + } + } + + /** + * currently only defined for Villages, returns true if Village has more than 2 non-road components + */ + public boolean isSizeableStructure() + { + return true; + } + + public int func_143019_e() + { + return this.field_143024_c; + } + + public int func_143018_f() + { + return this.field_143023_d; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java new file mode 100644 index 0000000..989e973 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureStrongholdPieces.java @@ -0,0 +1,1790 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; + +import net.minecraftforge.common.ChestGenHooks; +import static net.minecraftforge.common.ChestGenHooks.*; + +public class StructureStrongholdPieces +{ + private static final StructureStrongholdPieces.PieceWeight[] pieceWeightArray = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) + { + private static final String __OBFID = "CL_00000484"; + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 4; + } + }, new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.PortalRoom.class, 20, 1) + { + private static final String __OBFID = "CL_00000485"; + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return super.canSpawnMoreStructuresOfType(p_75189_1_) && p_75189_1_ > 5; + } + } + }; + private static List structurePieceList; + private static Class strongComponentType; + static int totalWeight; + private static final StructureStrongholdPieces.Stones strongholdStones = new StructureStrongholdPieces.Stones(null); + private static final String __OBFID = "CL_00000483"; + + public static void registerStrongholdPieces() + { + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.ChestCorridor.class, "SHCC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Corridor.class, "SHFC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Crossing.class, "SH5C"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.LeftTurn.class, "SHLT"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Library.class, "SHLi"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.PortalRoom.class, "SHPR"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Prison.class, "SHPH"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.RightTurn.class, "SHRT"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.RoomCrossing.class, "SHRC"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Stairs.class, "SHSD"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Stairs2.class, "SHStart"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.Straight.class, "SHS"); + MapGenStructureIO.func_143031_a(StructureStrongholdPieces.StairsStraight.class, "SHSSD"); + } + + /** + * sets up Arrays with the Structure pieces and their weights + */ + public static void prepareStructurePieces() + { + structurePieceList = new ArrayList(); + StructureStrongholdPieces.PieceWeight[] apieceweight = pieceWeightArray; + int i = apieceweight.length; + + for (int j = 0; j < i; ++j) + { + StructureStrongholdPieces.PieceWeight pieceweight = apieceweight[j]; + pieceweight.instancesSpawned = 0; + structurePieceList.add(pieceweight); + } + + strongComponentType = null; + } + + private static boolean canAddStructurePieces() + { + boolean flag = false; + totalWeight = 0; + StructureStrongholdPieces.PieceWeight pieceweight; + + for (Iterator iterator = structurePieceList.iterator(); iterator.hasNext(); totalWeight += pieceweight.pieceWeight) + { + pieceweight = (StructureStrongholdPieces.PieceWeight)iterator.next(); + + if (pieceweight.instancesLimit > 0 && pieceweight.instancesSpawned < pieceweight.instancesLimit) + { + flag = true; + } + } + + return flag; + } + + /** + * translates the PieceWeight class to the Component class + */ + private static StructureStrongholdPieces.Stronghold getStrongholdComponentFromWeightedPiece(Class p_75200_0_, List p_75200_1_, Random p_75200_2_, int p_75200_3_, int p_75200_4_, int p_75200_5_, int p_75200_6_, int p_75200_7_) + { + Object object = null; + + if (p_75200_0_ == StructureStrongholdPieces.Straight.class) + { + object = StructureStrongholdPieces.Straight.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.Prison.class) + { + object = StructureStrongholdPieces.Prison.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.LeftTurn.class) + { + object = StructureStrongholdPieces.LeftTurn.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.RightTurn.class) + { + object = StructureStrongholdPieces.RightTurn.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.RoomCrossing.class) + { + object = StructureStrongholdPieces.RoomCrossing.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.StairsStraight.class) + { + object = StructureStrongholdPieces.StairsStraight.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.Stairs.class) + { + object = StructureStrongholdPieces.Stairs.getStrongholdStairsComponent(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.Crossing.class) + { + object = StructureStrongholdPieces.Crossing.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.ChestCorridor.class) + { + object = StructureStrongholdPieces.ChestCorridor.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.Library.class) + { + object = StructureStrongholdPieces.Library.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + else if (p_75200_0_ == StructureStrongholdPieces.PortalRoom.class) + { + object = StructureStrongholdPieces.PortalRoom.findValidPlacement(p_75200_1_, p_75200_2_, p_75200_3_, p_75200_4_, p_75200_5_, p_75200_6_, p_75200_7_); + } + + return (StructureStrongholdPieces.Stronghold)object; + } + + private static StructureStrongholdPieces.Stronghold getNextComponent(StructureStrongholdPieces.Stairs2 p_75201_0_, List p_75201_1_, Random p_75201_2_, int p_75201_3_, int p_75201_4_, int p_75201_5_, int p_75201_6_, int p_75201_7_) + { + if (!canAddStructurePieces()) + { + return null; + } + else + { + if (strongComponentType != null) + { + StructureStrongholdPieces.Stronghold stronghold = getStrongholdComponentFromWeightedPiece(strongComponentType, p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_, p_75201_7_); + strongComponentType = null; + + if (stronghold != null) + { + return stronghold; + } + } + + int k1 = 0; + + while (k1 < 5) + { + ++k1; + int j1 = p_75201_2_.nextInt(totalWeight); + Iterator iterator = structurePieceList.iterator(); + + while (iterator.hasNext()) + { + StructureStrongholdPieces.PieceWeight pieceweight = (StructureStrongholdPieces.PieceWeight)iterator.next(); + j1 -= pieceweight.pieceWeight; + + if (j1 < 0) + { + if (!pieceweight.canSpawnMoreStructuresOfType(p_75201_7_) || pieceweight == p_75201_0_.strongholdPieceWeight) + { + break; + } + + StructureStrongholdPieces.Stronghold stronghold1 = getStrongholdComponentFromWeightedPiece(pieceweight.pieceClass, p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_, p_75201_7_); + + if (stronghold1 != null) + { + ++pieceweight.instancesSpawned; + p_75201_0_.strongholdPieceWeight = pieceweight; + + if (!pieceweight.canSpawnMoreStructures()) + { + structurePieceList.remove(pieceweight); + } + + return stronghold1; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureStrongholdPieces.Corridor.func_74992_a(p_75201_1_, p_75201_2_, p_75201_3_, p_75201_4_, p_75201_5_, p_75201_6_); + + if (structureboundingbox != null && structureboundingbox.minY > 1) + { + return new StructureStrongholdPieces.Corridor(p_75201_7_, p_75201_2_, structureboundingbox, p_75201_6_); + } + else + { + return null; + } + } + } + + private static StructureComponent getNextValidComponent(StructureStrongholdPieces.Stairs2 p_75196_0_, List p_75196_1_, Random p_75196_2_, int p_75196_3_, int p_75196_4_, int p_75196_5_, int p_75196_6_, int p_75196_7_) + { + if (p_75196_7_ > 50) + { + return null; + } + else if (Math.abs(p_75196_3_ - p_75196_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75196_5_ - p_75196_0_.getBoundingBox().minZ) <= 112) + { + StructureStrongholdPieces.Stronghold stronghold = getNextComponent(p_75196_0_, p_75196_1_, p_75196_2_, p_75196_3_, p_75196_4_, p_75196_5_, p_75196_6_, p_75196_7_ + 1); + + if (stronghold != null) + { + p_75196_1_.add(stronghold); + p_75196_0_.field_75026_c.add(stronghold); + } + + return stronghold; + } + else + { + return null; + } + } + + public static class ChestCorridor extends StructureStrongholdPieces.Stronghold + { + /** List of items that Stronghold chests can contain. */ + public static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.ender_pearl, 0, 1, 1, 10), new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Items.golden_apple, 0, 1, 1, 1), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 1), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private boolean hasMadeChest; + private static final String __OBFID = "CL_00000487"; + + public ChestCorridor() {} + + public ChestCorridor(int p_i2071_1_, Random p_i2071_2_, StructureBoundingBox p_i2071_3_, int p_i2071_4_) + { + super(p_i2071_1_); + this.coordBaseMode = p_i2071_4_; + this.field_143013_d = this.getRandomDoor(p_i2071_2_); + this.boundingBox = p_i2071_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.hasMadeChest); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.hasMadeChest = p_143011_1_.getBoolean("Chest"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.ChestCorridor findValidPlacement(List p_75000_0_, Random p_75000_1_, int p_75000_2_, int p_75000_3_, int p_75000_4_, int p_75000_5_, int p_75000_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75000_2_, p_75000_3_, p_75000_4_, -1, -1, 0, 5, 5, 7, p_75000_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75000_0_, structureboundingbox) == null ? new StructureStrongholdPieces.ChestCorridor(p_75000_6_, p_75000_1_, structureboundingbox, p_75000_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 6, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 2, 3, 1, 4, Blocks.stonebrick, Blocks.stonebrick, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 5, 3, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 5, 3, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 5, 3, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 5, 3, 2, 4, p_74875_3_); + int i; + + for (i = 2; i <= 4; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 5, 2, 1, i, p_74875_3_); + } + + if (!this.hasMadeChest) + { + i = this.getYWithOffset(2); + int j = this.getXWithOffset(3, 3); + int k = this.getZWithOffset(3, 3); + + if (p_74875_3_.isVecInside(j, i, k)) + { + this.hasMadeChest = true; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, ChestGenHooks.getItems(STRONGHOLD_CORRIDOR, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CORRIDOR, p_74875_2_)); + } + } + + return true; + } + } + } + + public static class Corridor extends StructureStrongholdPieces.Stronghold + { + private int field_74993_a; + private static final String __OBFID = "CL_00000488"; + + public Corridor() {} + + public Corridor(int p_i2072_1_, Random p_i2072_2_, StructureBoundingBox p_i2072_3_, int p_i2072_4_) + { + super(p_i2072_1_); + this.coordBaseMode = p_i2072_4_; + this.boundingBox = p_i2072_3_; + this.field_74993_a = p_i2072_4_ != 2 && p_i2072_4_ != 0 ? p_i2072_3_.getXSize() : p_i2072_3_.getZSize(); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Steps", this.field_74993_a); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_74993_a = p_143011_1_.getInteger("Steps"); + } + + public static StructureBoundingBox func_74992_a(List p_74992_0_, Random p_74992_1_, int p_74992_2_, int p_74992_3_, int p_74992_4_, int p_74992_5_) + { + boolean flag = true; + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, 4, p_74992_5_); + StructureComponent structurecomponent = StructureComponent.findIntersecting(p_74992_0_, structureboundingbox); + + if (structurecomponent == null) + { + return null; + } + else + { + if (structurecomponent.getBoundingBox().minY == structureboundingbox.minY) + { + for (int i1 = 3; i1 >= 1; --i1) + { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, i1 - 1, p_74992_5_); + + if (!structurecomponent.getBoundingBox().intersectsWith(structureboundingbox)) + { + return StructureBoundingBox.getComponentToAddBoundingBox(p_74992_2_, p_74992_3_, p_74992_4_, -1, -1, 0, 5, 5, i1, p_74992_5_); + } + } + } + + return null; + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + for (int i = 0; i < this.field_74993_a; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 0, 0, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 0, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 0, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 0, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 4, 0, i, p_74875_3_); + + for (int j = 1; j <= 3; ++j) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 0, j, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, j, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, j, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 3, j, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 4, j, i, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 0, 4, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 4, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 4, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 4, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 4, 4, i, p_74875_3_); + } + + return true; + } + } + } + + public static class Crossing extends StructureStrongholdPieces.Stronghold + { + private boolean field_74996_b; + private boolean field_74997_c; + private boolean field_74995_d; + private boolean field_74999_h; + private static final String __OBFID = "CL_00000489"; + + public Crossing() {} + + public Crossing(int p_i2073_1_, Random p_i2073_2_, StructureBoundingBox p_i2073_3_, int p_i2073_4_) + { + super(p_i2073_1_); + this.coordBaseMode = p_i2073_4_; + this.field_143013_d = this.getRandomDoor(p_i2073_2_); + this.boundingBox = p_i2073_3_; + this.field_74996_b = p_i2073_2_.nextBoolean(); + this.field_74997_c = p_i2073_2_.nextBoolean(); + this.field_74995_d = p_i2073_2_.nextBoolean(); + this.field_74999_h = p_i2073_2_.nextInt(3) > 0; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("leftLow", this.field_74996_b); + p_143012_1_.setBoolean("leftHigh", this.field_74997_c); + p_143012_1_.setBoolean("rightLow", this.field_74995_d); + p_143012_1_.setBoolean("rightHigh", this.field_74999_h); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_74996_b = p_143011_1_.getBoolean("leftLow"); + this.field_74997_c = p_143011_1_.getBoolean("leftHigh"); + this.field_74995_d = p_143011_1_.getBoolean("rightLow"); + this.field_74999_h = p_143011_1_.getBoolean("rightHigh"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + int i = 3; + int j = 5; + + if (this.coordBaseMode == 1 || this.coordBaseMode == 2) + { + i = 8 - i; + j = 8 - j; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 5, 1); + + if (this.field_74996_b) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, i, 1); + } + + if (this.field_74997_c) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, j, 7); + } + + if (this.field_74995_d) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, i, 1); + } + + if (this.field_74999_h) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, j, 7); + } + } + + public static StructureStrongholdPieces.Crossing findValidPlacement(List p_74994_0_, Random p_74994_1_, int p_74994_2_, int p_74994_3_, int p_74994_4_, int p_74994_5_, int p_74994_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74994_2_, p_74994_3_, p_74994_4_, -4, -3, 0, 10, 9, 11, p_74994_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74994_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Crossing(p_74994_6_, p_74994_1_, structureboundingbox, p_74994_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 9, 8, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 3, 0); + + if (this.field_74996_b) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, 1, 0, 5, 3, Blocks.air, Blocks.air, false); + } + + if (this.field_74995_d) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 3, 1, 9, 5, 3, Blocks.air, Blocks.air, false); + } + + if (this.field_74997_c) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 7, 0, 7, 9, Blocks.air, Blocks.air, false); + } + + if (this.field_74999_h) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 5, 7, 9, 7, 9, Blocks.air, Blocks.air, false); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 1, 10, 7, 3, 10, Blocks.air, Blocks.air, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 2, 1, 8, 2, 6, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 5, 4, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, 1, 5, 8, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 4, 7, 3, 4, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 3, 5, 3, 3, 6, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 4, 3, 3, 4, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 6, 3, 4, 6, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 5, 1, 7, 7, 1, 8, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 1, 9, 7, 1, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 2, 7, 7, 2, 7, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 7, 4, 5, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 5, 7, 8, 5, 9, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 5, 7, 7, 5, 9, Blocks.double_stone_slab, Blocks.double_stone_slab, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 6, 5, 6, p_74875_3_); + return true; + } + } + } + + public static class LeftTurn extends StructureStrongholdPieces.Stronghold + { + private static final String __OBFID = "CL_00000490"; + + public LeftTurn() {} + + public LeftTurn(int p_i2074_1_, Random p_i2074_2_, StructureBoundingBox p_i2074_3_, int p_i2074_4_) + { + super(p_i2074_1_); + this.coordBaseMode = p_i2074_4_; + this.field_143013_d = this.getRandomDoor(p_i2074_2_); + this.boundingBox = p_i2074_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + else + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + } + + public static StructureStrongholdPieces.LeftTurn findValidPlacement(List p_75010_0_, Random p_75010_1_, int p_75010_2_, int p_75010_3_, int p_75010_4_, int p_75010_5_, int p_75010_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75010_2_, p_75010_3_, p_75010_4_, -1, -1, 0, 5, 5, 5, p_75010_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75010_0_, structureboundingbox) == null ? new StructureStrongholdPieces.LeftTurn(p_75010_6_, p_75010_1_, structureboundingbox, p_75010_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.air, Blocks.air, false); + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + public static class Library extends StructureStrongholdPieces.Stronghold + { + /** List of items that Stronghold Library chests can contain. */ + public static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.book, 0, 1, 3, 20), new WeightedRandomChestContent(Items.paper, 0, 2, 7, 20), new WeightedRandomChestContent(Items.map, 0, 1, 1, 1), new WeightedRandomChestContent(Items.compass, 0, 1, 1, 1)}; + private boolean isLargeRoom; + private static final String __OBFID = "CL_00000491"; + + public Library() {} + + public Library(int p_i2075_1_, Random p_i2075_2_, StructureBoundingBox p_i2075_3_, int p_i2075_4_) + { + super(p_i2075_1_); + this.coordBaseMode = p_i2075_4_; + this.field_143013_d = this.getRandomDoor(p_i2075_2_); + this.boundingBox = p_i2075_3_; + this.isLargeRoom = p_i2075_3_.getYSize() > 6; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Tall", this.isLargeRoom); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.isLargeRoom = p_143011_1_.getBoolean("Tall"); + } + + public static StructureStrongholdPieces.Library findValidPlacement(List p_75006_0_, Random p_75006_1_, int p_75006_2_, int p_75006_3_, int p_75006_4_, int p_75006_5_, int p_75006_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75006_2_, p_75006_3_, p_75006_4_, -4, -1, 0, 14, 11, 15, p_75006_5_); + + if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_75006_0_, structureboundingbox) != null) + { + structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75006_2_, p_75006_3_, p_75006_4_, -4, -1, 0, 14, 6, 15, p_75006_5_); + + if (!canStrongholdGoDeeper(structureboundingbox) || StructureComponent.findIntersecting(p_75006_0_, structureboundingbox) != null) + { + return null; + } + } + + return new StructureStrongholdPieces.Library(p_75006_6_, p_75006_1_, structureboundingbox, p_75006_5_); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + byte b0 = 11; + + if (!this.isLargeRoom) + { + b0 = 6; + } + + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 13, b0 - 1, 14, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 1, 0); + this.randomlyFillWithBlocks(p_74875_1_, p_74875_3_, p_74875_2_, 0.07F, 2, 1, 1, 11, 4, 13, Blocks.web, Blocks.web, false); + boolean flag = true; + boolean flag1 = true; + int i; + + for (i = 1; i <= 13; ++i) + { + if ((i - 1) % 4 == 0) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, i, 1, 4, i, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 1, i, 12, 4, i, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 11, 3, i, p_74875_3_); + + if (this.isLargeRoom) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 6, i, 1, 9, i, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 6, i, 12, 9, i, Blocks.planks, Blocks.planks, false); + } + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, i, 1, 4, i, Blocks.bookshelf, Blocks.bookshelf, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 1, i, 12, 4, i, Blocks.bookshelf, Blocks.bookshelf, false); + + if (this.isLargeRoom) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 6, i, 1, 9, i, Blocks.bookshelf, Blocks.bookshelf, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 6, i, 12, 9, i, Blocks.bookshelf, Blocks.bookshelf, false); + } + } + } + + for (i = 3; i < 12; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, i, 4, 3, i, Blocks.bookshelf, Blocks.bookshelf, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 1, i, 7, 3, i, Blocks.bookshelf, Blocks.bookshelf, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 1, i, 10, 3, i, Blocks.bookshelf, Blocks.bookshelf, false); + } + + if (this.isLargeRoom) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 1, 3, 5, 13, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 5, 1, 12, 5, 13, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 1, 9, 5, 2, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 12, 9, 5, 13, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 9, 5, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 5, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 9, 5, 10, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 6, 2, 3, 6, 12, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 6, 2, 10, 6, 10, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 6, 2, 9, 6, 2, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 6, 12, 8, 6, 12, Blocks.fence, Blocks.fence, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 9, 6, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 8, 6, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 9, 6, 10, p_74875_3_); + i = this.getMetadataWithOffset(Blocks.ladder, 3); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 1, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 2, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 3, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 4, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 5, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 6, 13, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 10, 7, 13, p_74875_3_); + byte b1 = 7; + byte b2 = 7; + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 1, 9, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1, 9, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 1, 8, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1, 8, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 1, 7, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1, 7, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 2, 7, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 + 1, 7, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 1, 7, b2 - 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1 - 1, 7, b2 + 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1, 7, b2 - 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, b1, 7, b2 + 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1 - 2, 8, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1 + 1, 8, b2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1 - 1, 8, b2 - 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1 - 1, 8, b2 + 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1, 8, b2 - 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, b1, 8, b2 + 1, p_74875_3_); + } + + ChestGenHooks info = ChestGenHooks.getInfo(STRONGHOLD_LIBRARY); + + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + + if (this.isLargeRoom) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 12, 9, 1, p_74875_3_); + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + return true; + } + } + } + + static class PieceWeight + { + public Class pieceClass; + /** + * This basically keeps track of the 'epicness' of a structure. Epic structure components have a higher + * 'weight', and Structures may only grow up to a certain 'weight' before generation is stopped + */ + public final int pieceWeight; + public int instancesSpawned; + /** How many Structure Pieces of this type may spawn in a structure */ + public int instancesLimit; + private static final String __OBFID = "CL_00000492"; + + public PieceWeight(Class p_i2076_1_, int p_i2076_2_, int p_i2076_3_) + { + this.pieceClass = p_i2076_1_; + this.pieceWeight = p_i2076_2_; + this.instancesLimit = p_i2076_3_; + } + + public boolean canSpawnMoreStructuresOfType(int p_75189_1_) + { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + + public boolean canSpawnMoreStructures() + { + return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; + } + } + + public static class PortalRoom extends StructureStrongholdPieces.Stronghold + { + private boolean hasSpawner; + private static final String __OBFID = "CL_00000493"; + + public PortalRoom() {} + + public PortalRoom(int p_i2077_1_, Random p_i2077_2_, StructureBoundingBox p_i2077_3_, int p_i2077_4_) + { + super(p_i2077_1_); + this.coordBaseMode = p_i2077_4_; + this.boundingBox = p_i2077_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Mob", this.hasSpawner); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.hasSpawner = p_143011_1_.getBoolean("Mob"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + if (p_74861_1_ != null) + { + ((StructureStrongholdPieces.Stairs2)p_74861_1_).strongholdPortalRoom = this; + } + } + + public static StructureStrongholdPieces.PortalRoom findValidPlacement(List p_75004_0_, Random p_75004_1_, int p_75004_2_, int p_75004_3_, int p_75004_4_, int p_75004_5_, int p_75004_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75004_2_, p_75004_3_, p_75004_4_, -4, -1, 0, 11, 8, 16, p_75004_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75004_0_, structureboundingbox) == null ? new StructureStrongholdPieces.PortalRoom(p_75004_6_, p_75004_1_, structureboundingbox, p_75004_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 10, 7, 15, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.GRATES, 4, 1, 0); + byte b0 = 6; + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, b0, 1, 1, b0, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 9, b0, 1, 9, b0, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, b0, 1, 8, b0, 2, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 2, b0, 14, 8, b0, 14, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 2, 1, 4, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 8, 1, 1, 9, 1, 4, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 1, 1, 3, Blocks.flowing_lava, Blocks.flowing_lava, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 1, 1, 9, 1, 3, Blocks.flowing_lava, Blocks.flowing_lava, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 3, 1, 8, 7, 1, 12, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 9, 6, 1, 11, Blocks.flowing_lava, Blocks.flowing_lava, false); + int i; + + for (i = 3; i < 14; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 3, i, 0, 4, i, Blocks.iron_bars, Blocks.iron_bars, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 3, i, 10, 4, i, Blocks.iron_bars, Blocks.iron_bars, false); + } + + for (i = 2; i < 9; i += 2) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, i, 3, 15, i, 4, 15, Blocks.iron_bars, Blocks.iron_bars, false); + } + + i = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 3); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 5, 6, 1, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 2, 6, 6, 2, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 3, 7, 6, 3, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + + for (int j = 4; j <= 6; ++j) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_brick_stairs, i, j, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_brick_stairs, i, j, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_brick_stairs, i, j, 3, 6, p_74875_3_); + } + + byte b4 = 2; + byte b1 = 0; + byte b2 = 3; + byte b3 = 1; + + switch (this.coordBaseMode) + { + case 0: + b4 = 0; + b1 = 2; + break; + case 1: + b4 = 1; + b1 = 3; + b2 = 0; + b3 = 2; + case 2: + default: + break; + case 3: + b4 = 3; + b1 = 1; + b2 = 0; + b3 = 2; + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b4 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b4 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b4 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b1 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b1 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b1 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b2 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b2 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b2 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b3 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b3 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.end_portal_frame, b3 + (p_74875_2_.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, p_74875_3_); + + if (!this.hasSpawner) + { + int i1 = this.getYWithOffset(3); + int k = this.getXWithOffset(5, 6); + int l = this.getZWithOffset(5, 6); + + if (p_74875_3_.isVecInside(k, i1, l)) + { + this.hasSpawner = true; + p_74875_1_.setBlock(k, i1, l, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)p_74875_1_.getTileEntity(k, i1, l); + + if (tileentitymobspawner != null) + { + tileentitymobspawner.func_145881_a().setEntityName("Silverfish"); + } + } + } + + return true; + } + } + + public static class Prison extends StructureStrongholdPieces.Stronghold + { + private static final String __OBFID = "CL_00000494"; + + public Prison() {} + + public Prison(int p_i2078_1_, Random p_i2078_2_, StructureBoundingBox p_i2078_3_, int p_i2078_4_) + { + super(p_i2078_1_); + this.coordBaseMode = p_i2078_4_; + this.field_143013_d = this.getRandomDoor(p_i2078_2_); + this.boundingBox = p_i2078_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.Prison findValidPlacement(List p_75016_0_, Random p_75016_1_, int p_75016_2_, int p_75016_3_, int p_75016_4_, int p_75016_5_, int p_75016_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75016_2_, p_75016_3_, p_75016_4_, -1, -1, 0, 9, 5, 11, p_75016_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75016_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Prison(p_75016_6_, p_75016_1_, structureboundingbox, p_75016_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 4, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 10, 3, 3, 10, Blocks.air, Blocks.air, false); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 1, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 3, 4, 3, 3, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 7, 4, 3, 7, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 4, 1, 9, 4, 3, 9, false, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 4, 4, 3, 6, Blocks.iron_bars, Blocks.iron_bars, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 1, 5, 7, 3, 5, Blocks.iron_bars, Blocks.iron_bars, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_bars, 0, 4, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_bars, 0, 4, 3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_door, this.getMetadataWithOffset(Blocks.iron_door, 3), 4, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_door, this.getMetadataWithOffset(Blocks.iron_door, 3) + 8, 4, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_door, this.getMetadataWithOffset(Blocks.iron_door, 3), 4, 1, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_door, this.getMetadataWithOffset(Blocks.iron_door, 3) + 8, 4, 2, 8, p_74875_3_); + return true; + } + } + } + + public static class RightTurn extends StructureStrongholdPieces.LeftTurn + { + private static final String __OBFID = "CL_00000495"; + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + else + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + + if (this.coordBaseMode != 2 && this.coordBaseMode != 3) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.air, Blocks.air, false); + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + public static class RoomCrossing extends StructureStrongholdPieces.Stronghold + { + /** Items that could generate in the chest that is located in Stronghold Room Crossing. */ + public static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.redstone, 0, 4, 9, 5), new WeightedRandomChestContent(Items.coal, 0, 3, 8, 10), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 1)}; + protected int roomType; + private static final String __OBFID = "CL_00000496"; + + public RoomCrossing() {} + + public RoomCrossing(int p_i2079_1_, Random p_i2079_2_, StructureBoundingBox p_i2079_3_, int p_i2079_4_) + { + super(p_i2079_1_); + this.coordBaseMode = p_i2079_4_; + this.field_143013_d = this.getRandomDoor(p_i2079_2_); + this.boundingBox = p_i2079_3_; + this.roomType = p_i2079_2_.nextInt(5); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Type", this.roomType); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.roomType = p_143011_1_.getInteger("Type"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 4, 1); + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 4); + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 4); + } + + public static StructureStrongholdPieces.RoomCrossing findValidPlacement(List p_75012_0_, Random p_75012_1_, int p_75012_2_, int p_75012_3_, int p_75012_4_, int p_75012_5_, int p_75012_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75012_2_, p_75012_3_, p_75012_4_, -4, -1, 0, 11, 7, 11, p_75012_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75012_0_, structureboundingbox) == null ? new StructureStrongholdPieces.RoomCrossing(p_75012_6_, p_75012_1_, structureboundingbox, p_75012_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 10, 6, 10, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 4, 1, 0); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 10, 6, 3, 10, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 4, 0, 3, 6, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 1, 4, 10, 3, 6, Blocks.air, Blocks.air, false); + int i; + + switch (this.roomType) + { + case 0: + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 4, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 6, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 5, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 5, 3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 4, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 6, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 5, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 5, 1, 6, p_74875_3_); + break; + case 1: + for (i = 0; i < 5; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 1, 3 + i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 7, 1, 3 + i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3 + i, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3 + i, 1, 7, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 5, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.flowing_water, 0, 5, 4, 5, p_74875_3_); + break; + case 2: + for (i = 1; i <= 9; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 1, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 9, 3, i, p_74875_3_); + } + + for (i = 1; i <= 9; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, i, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, i, 3, 9, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 5, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 5, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 5, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 5, 3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, 3, 5, p_74875_3_); + + for (i = 1; i <= 3; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, i, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, i, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, i, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, i, 6, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 5, 3, 5, p_74875_3_); + + for (i = 2; i <= 8; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 2, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 3, 3, i, p_74875_3_); + + if (i <= 3 || i >= 7) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 4, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 5, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 6, 3, i, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 7, 3, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 3, i, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, this.getMetadataWithOffset(Blocks.ladder, 4), 9, 3, 3, p_74875_3_); + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, ChestGenHooks.getItems(STRONGHOLD_CROSSING, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CROSSING, p_74875_2_)); + } + + return true; + } + } + } + + public static class Stairs extends StructureStrongholdPieces.Stronghold + { + private boolean field_75024_a; + private static final String __OBFID = "CL_00000498"; + + public Stairs() {} + + public Stairs(int p_i2081_1_, Random p_i2081_2_, int p_i2081_3_, int p_i2081_4_) + { + super(p_i2081_1_); + this.field_75024_a = true; + this.coordBaseMode = p_i2081_2_.nextInt(4); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + + switch (this.coordBaseMode) + { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(p_i2081_3_, 64, p_i2081_4_, p_i2081_3_ + 5 - 1, 74, p_i2081_4_ + 5 - 1); + } + } + + public Stairs(int p_i2082_1_, Random p_i2082_2_, StructureBoundingBox p_i2082_3_, int p_i2082_4_) + { + super(p_i2082_1_); + this.field_75024_a = false; + this.coordBaseMode = p_i2082_4_; + this.field_143013_d = this.getRandomDoor(p_i2082_2_); + this.boundingBox = p_i2082_3_; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Source", this.field_75024_a); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.field_75024_a = p_143011_1_.getBoolean("Source"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + if (this.field_75024_a) + { + StructureStrongholdPieces.strongComponentType = StructureStrongholdPieces.Crossing.class; + } + + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + /** + * performs some checks, then gives out a fresh Stairs component + */ + public static StructureStrongholdPieces.Stairs getStrongholdStairsComponent(List p_75022_0_, Random p_75022_1_, int p_75022_2_, int p_75022_3_, int p_75022_4_, int p_75022_5_, int p_75022_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75022_2_, p_75022_3_, p_75022_4_, -1, -7, 0, 5, 11, 5, p_75022_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75022_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Stairs(p_75022_6_, p_75022_1_, structureboundingbox, p_75022_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 10, 4, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 7, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 4); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 6, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 5, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 1, 6, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 1, 5, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 3, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 3, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 1, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_slab, 0, 1, 1, 3, p_74875_3_); + return true; + } + } + } + + public static class Stairs2 extends StructureStrongholdPieces.Stairs + { + public StructureStrongholdPieces.PieceWeight strongholdPieceWeight; + public StructureStrongholdPieces.PortalRoom strongholdPortalRoom; + public List field_75026_c = new ArrayList(); + private static final String __OBFID = "CL_00000499"; + + public Stairs2() {} + + public Stairs2(int p_i2083_1_, Random p_i2083_2_, int p_i2083_3_, int p_i2083_4_) + { + super(0, p_i2083_2_, p_i2083_3_, p_i2083_4_); + } + + public ChunkPosition func_151553_a() + { + return this.strongholdPortalRoom != null ? this.strongholdPortalRoom.func_151553_a() : super.func_151553_a(); + } + } + + public static class StairsStraight extends StructureStrongholdPieces.Stronghold + { + private static final String __OBFID = "CL_00000501"; + + public StairsStraight() {} + + public StairsStraight(int p_i2085_1_, Random p_i2085_2_, StructureBoundingBox p_i2085_3_, int p_i2085_4_) + { + super(p_i2085_1_); + this.coordBaseMode = p_i2085_4_; + this.field_143013_d = this.getRandomDoor(p_i2085_2_); + this.boundingBox = p_i2085_3_; + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + } + + public static StructureStrongholdPieces.StairsStraight findValidPlacement(List p_75028_0_, Random p_75028_1_, int p_75028_2_, int p_75028_3_, int p_75028_4_, int p_75028_5_, int p_75028_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75028_2_, p_75028_3_, p_75028_4_, -1, -7, 0, 5, 11, 8, p_75028_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75028_0_, structureboundingbox) == null ? new StructureStrongholdPieces.StairsStraight(p_75028_6_, p_75028_1_, structureboundingbox, p_75028_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 10, 7, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 7, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 7); + int i = this.getMetadataWithOffset(Blocks.stone_stairs, 2); + + for (int j = 0; j < 6; ++j) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 1, 6 - j, 1 + j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 2, 6 - j, 1 + j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, i, 3, 6 - j, 1 + j, p_74875_3_); + + if (j < 5) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 1, 5 - j, 1 + j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 2, 5 - j, 1 + j, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stonebrick, 0, 3, 5 - j, 1 + j, p_74875_3_); + } + } + + return true; + } + } + } + + static class Stones extends StructureComponent.BlockSelector + { + private static final String __OBFID = "CL_00000497"; + + private Stones() {} + + /** + * picks Block Ids and Metadata (Silverfish) + */ + public void selectBlocks(Random p_75062_1_, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) + { + if (p_75062_5_) + { + this.field_151562_a = Blocks.stonebrick; + float f = p_75062_1_.nextFloat(); + + if (f < 0.2F) + { + this.selectedBlockMetaData = 2; + } + else if (f < 0.5F) + { + this.selectedBlockMetaData = 1; + } + else if (f < 0.55F) + { + this.field_151562_a = Blocks.monster_egg; + this.selectedBlockMetaData = 2; + } + else + { + this.selectedBlockMetaData = 0; + } + } + else + { + this.field_151562_a = Blocks.air; + this.selectedBlockMetaData = 0; + } + } + + Stones(Object p_i2080_1_) + { + this(); + } + } + + public static class Straight extends StructureStrongholdPieces.Stronghold + { + private boolean expandsX; + private boolean expandsZ; + private static final String __OBFID = "CL_00000500"; + + public Straight() {} + + public Straight(int p_i2084_1_, Random p_i2084_2_, StructureBoundingBox p_i2084_3_, int p_i2084_4_) + { + super(p_i2084_1_); + this.coordBaseMode = p_i2084_4_; + this.field_143013_d = this.getRandomDoor(p_i2084_2_); + this.boundingBox = p_i2084_3_; + this.expandsX = p_i2084_2_.nextInt(2) == 0; + this.expandsZ = p_i2084_2_.nextInt(2) == 0; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Left", this.expandsX); + p_143012_1_.setBoolean("Right", this.expandsZ); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.expandsX = p_143011_1_.getBoolean("Left"); + this.expandsZ = p_143011_1_.getBoolean("Right"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + this.getNextComponentNormal((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 1); + + if (this.expandsX) + { + this.getNextComponentX((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 2); + } + + if (this.expandsZ) + { + this.getNextComponentZ((StructureStrongholdPieces.Stairs2)p_74861_1_, p_74861_2_, p_74861_3_, 1, 2); + } + } + + public static StructureStrongholdPieces.Straight findValidPlacement(List p_75018_0_, Random p_75018_1_, int p_75018_2_, int p_75018_3_, int p_75018_4_, int p_75018_5_, int p_75018_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_75018_2_, p_75018_3_, p_75018_4_, -1, -1, 0, 5, 5, 7, p_75018_5_); + return canStrongholdGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_75018_0_, structureboundingbox) == null ? new StructureStrongholdPieces.Straight(p_75018_6_, p_75018_1_, structureboundingbox, p_75018_5_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.isLiquidInStructureBoundingBox(p_74875_1_, p_74875_3_)) + { + return false; + } + else + { + this.fillWithRandomizedBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 4, 6, true, p_74875_2_, StructureStrongholdPieces.strongholdStones); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, this.field_143013_d, 1, 1, 0); + this.placeDoor(p_74875_1_, p_74875_2_, p_74875_3_, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 1, 2, 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 3, 2, 1, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 1, 2, 5, Blocks.torch, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.1F, 3, 2, 5, Blocks.torch, 0); + + if (this.expandsX) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 2, 0, 3, 4, Blocks.air, Blocks.air, false); + } + + if (this.expandsZ) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 2, 4, 3, 4, Blocks.air, Blocks.air, false); + } + + return true; + } + } + } + + public abstract static class Stronghold extends StructureComponent + { + protected StructureStrongholdPieces.Stronghold.Door field_143013_d; + private static final String __OBFID = "CL_00000503"; + + public Stronghold() + { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + } + + protected Stronghold(int p_i2087_1_) + { + super(p_i2087_1_); + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.OPENING; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + p_143012_1_.setString("EntryDoor", this.field_143013_d.name()); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + this.field_143013_d = StructureStrongholdPieces.Stronghold.Door.valueOf(p_143011_1_.getString("EntryDoor")); + } + + /** + * builds a door of the enumerated types (empty opening is a door) + */ + protected void placeDoor(World p_74990_1_, Random p_74990_2_, StructureBoundingBox p_74990_3_, StructureStrongholdPieces.Stronghold.Door p_74990_4_, int p_74990_5_, int p_74990_6_, int p_74990_7_) + { + switch (StructureStrongholdPieces.SwitchDoor.doorEnum[p_74990_4_.ordinal()]) + { + case 1: + default: + this.fillWithBlocks(p_74990_1_, p_74990_3_, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_5_ + 3 - 1, p_74990_6_ + 3 - 1, p_74990_7_, Blocks.air, Blocks.air, false); + break; + case 2: + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.wooden_door, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.wooden_door, 8, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + break; + case 3: + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.air, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.air, 0, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_bars, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + break; + case 4: + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 1, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 2, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stonebrick, 0, p_74990_5_ + 2, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_door, 0, p_74990_5_ + 1, p_74990_6_, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.iron_door, 8, p_74990_5_ + 1, p_74990_6_ + 1, p_74990_7_, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stone_button, this.getMetadataWithOffset(Blocks.stone_button, 4), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ + 1, p_74990_3_); + this.placeBlockAtCurrentPosition(p_74990_1_, Blocks.stone_button, this.getMetadataWithOffset(Blocks.stone_button, 3), p_74990_5_ + 2, p_74990_6_ + 1, p_74990_7_ - 1, p_74990_3_); + } + } + + protected StructureStrongholdPieces.Stronghold.Door getRandomDoor(Random p_74988_1_) + { + int i = p_74988_1_.nextInt(5); + + switch (i) + { + case 0: + case 1: + default: + return StructureStrongholdPieces.Stronghold.Door.OPENING; + case 2: + return StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR; + case 3: + return StructureStrongholdPieces.Stronghold.Door.GRATES; + case 4: + return StructureStrongholdPieces.Stronghold.Door.IRON_DOOR; + } + } + + /** + * Gets the next component in any cardinal direction + */ + protected StructureComponent getNextComponentNormal(StructureStrongholdPieces.Stairs2 p_74986_1_, List p_74986_2_, Random p_74986_3_, int p_74986_4_, int p_74986_5_) + { + switch (this.coordBaseMode) + { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.minX + p_74986_4_, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74986_1_, p_74986_2_, p_74986_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74986_5_, this.boundingBox.minZ + p_74986_4_, this.coordBaseMode, this.getComponentType()); + default: + return null; + } + } + + /** + * Gets the next component in the +/- X direction + */ + protected StructureComponent getNextComponentX(StructureStrongholdPieces.Stairs2 p_74989_1_, List p_74989_2_, Random p_74989_3_, int p_74989_4_, int p_74989_5_) + { + switch (this.coordBaseMode) + { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, 1, this.getComponentType()); + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ + p_74989_5_, 1, this.getComponentType()); + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74989_1_, p_74989_2_, p_74989_3_, this.boundingBox.minX + p_74989_5_, this.boundingBox.minY + p_74989_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + default: + return null; + } + } + + /** + * Gets the next component in the +/- Z direction + */ + protected StructureComponent getNextComponentZ(StructureStrongholdPieces.Stairs2 p_74987_1_, List p_74987_2_, Random p_74987_3_, int p_74987_4_, int p_74987_5_) + { + switch (this.coordBaseMode) + { + case 0: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, 3, this.getComponentType()); + case 1: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + case 2: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74987_4_, this.boundingBox.minZ + p_74987_5_, 3, this.getComponentType()); + case 3: + return StructureStrongholdPieces.getNextValidComponent(p_74987_1_, p_74987_2_, p_74987_3_, this.boundingBox.minX + p_74987_5_, this.boundingBox.minY + p_74987_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + default: + return null; + } + } + + /** + * returns false if the Structure Bounding Box goes below 10 + */ + protected static boolean canStrongholdGoDeeper(StructureBoundingBox p_74991_0_) + { + return p_74991_0_ != null && p_74991_0_.minY > 10; + } + + public static enum Door + { + OPENING, + WOOD_DOOR, + GRATES, + IRON_DOOR; + + private static final String __OBFID = "CL_00000504"; + } + } + + static final class SwitchDoor + { + static final int[] doorEnum = new int[StructureStrongholdPieces.Stronghold.Door.values().length]; + private static final String __OBFID = "CL_00000486"; + + static + { + try + { + doorEnum[StructureStrongholdPieces.Stronghold.Door.OPENING.ordinal()] = 1; + } + catch (NoSuchFieldError var4) + { + ; + } + + try + { + doorEnum[StructureStrongholdPieces.Stronghold.Door.WOOD_DOOR.ordinal()] = 2; + } + catch (NoSuchFieldError var3) + { + ; + } + + try + { + doorEnum[StructureStrongholdPieces.Stronghold.Door.GRATES.ordinal()] = 3; + } + catch (NoSuchFieldError var2) + { + ; + } + + try + { + doorEnum[StructureStrongholdPieces.Stronghold.Door.IRON_DOOR.ordinal()] = 4; + } + catch (NoSuchFieldError var1) + { + ; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureVillagePieces.java b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureVillagePieces.java new file mode 100644 index 0000000..5ffad84 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/gen/structure/StructureVillagePieces.java @@ -0,0 +1,2017 @@ +package net.minecraft.world.gen.structure; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import cpw.mods.fml.common.eventhandler.Event.Result; +import cpw.mods.fml.common.registry.VillagerRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.BiomeEvent; +import static net.minecraftforge.common.ChestGenHooks.*; + +public class StructureVillagePieces +{ + private static final String __OBFID = "CL_00000516"; + + public static void registerVillagePieces() + { + MapGenStructureIO.func_143031_a(StructureVillagePieces.House1.class, "ViBH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Field1.class, "ViDF"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Field2.class, "ViF"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Torch.class, "ViL"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Hall.class, "ViPH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House4Garden.class, "ViSH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.WoodHut.class, "ViSmH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Church.class, "ViST"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House2.class, "ViS"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Start.class, "ViStart"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Path.class, "ViSR"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.House3.class, "ViTRH"); + MapGenStructureIO.func_143031_a(StructureVillagePieces.Well.class, "ViW"); + } + + public static List getStructureVillageWeightedPieceList(Random p_75084_0_, int p_75084_1_) + { + ArrayList arraylist = new ArrayList(); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House4Garden.class, 4, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Church.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 1 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House1.class, 20, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.WoodHut.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 5 + p_75084_1_ * 3))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Hall.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 2 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field1.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 1 + p_75084_1_, 4 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.getRandomIntegerInRange(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.getRandomIntegerInRange(p_75084_0_, 0, 1 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.getRandomIntegerInRange(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); + VillagerRegistry.addExtraVillageComponents(arraylist, p_75084_0_, p_75084_1_); + + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + if (((StructureVillagePieces.PieceWeight)iterator.next()).villagePiecesLimit == 0) + { + iterator.remove(); + } + } + + return arraylist; + } + + private static int func_75079_a(List p_75079_0_) + { + boolean flag = false; + int i = 0; + StructureVillagePieces.PieceWeight pieceweight; + + for (Iterator iterator = p_75079_0_.iterator(); iterator.hasNext(); i += pieceweight.villagePieceWeight) + { + pieceweight = (StructureVillagePieces.PieceWeight)iterator.next(); + + if (pieceweight.villagePiecesLimit > 0 && pieceweight.villagePiecesSpawned < pieceweight.villagePiecesLimit) + { + flag = true; + } + } + + return flag ? i : -1; + } + + private static StructureVillagePieces.Village func_75083_a(StructureVillagePieces.Start p_75083_0_, StructureVillagePieces.PieceWeight p_75083_1_, List p_75083_2_, Random p_75083_3_, int p_75083_4_, int p_75083_5_, int p_75083_6_, int p_75083_7_, int p_75083_8_) + { + Class oclass = p_75083_1_.villagePieceClass; + Object object = null; + + if (oclass == StructureVillagePieces.House4Garden.class) + { + object = StructureVillagePieces.House4Garden.func_74912_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.Church.class) + { + object = StructureVillagePieces.Church.func_74919_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.House1.class) + { + object = StructureVillagePieces.House1.func_74898_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.WoodHut.class) + { + object = StructureVillagePieces.WoodHut.func_74908_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.Hall.class) + { + object = StructureVillagePieces.Hall.func_74906_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.Field1.class) + { + object = StructureVillagePieces.Field1.func_74900_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.Field2.class) + { + object = StructureVillagePieces.Field2.func_74902_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.House2.class) + { + object = StructureVillagePieces.House2.func_74915_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else if (oclass == StructureVillagePieces.House3.class) + { + object = StructureVillagePieces.House3.func_74921_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + else + { + object = VillagerRegistry.getVillageComponent(p_75083_1_, p_75083_0_ , p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } + + return (StructureVillagePieces.Village)object; + } + + /** + * attempts to find a next Village Component to be spawned + */ + private static StructureVillagePieces.Village getNextVillageComponent(StructureVillagePieces.Start p_75081_0_, List p_75081_1_, Random p_75081_2_, int p_75081_3_, int p_75081_4_, int p_75081_5_, int p_75081_6_, int p_75081_7_) + { + int j1 = func_75079_a(p_75081_0_.structureVillageWeightedPieceList); + + if (j1 <= 0) + { + return null; + } + else + { + int k1 = 0; + + while (k1 < 5) + { + ++k1; + int l1 = p_75081_2_.nextInt(j1); + Iterator iterator = p_75081_0_.structureVillageWeightedPieceList.iterator(); + + while (iterator.hasNext()) + { + StructureVillagePieces.PieceWeight pieceweight = (StructureVillagePieces.PieceWeight)iterator.next(); + l1 -= pieceweight.villagePieceWeight; + + if (l1 < 0) + { + if (!pieceweight.canSpawnMoreVillagePiecesOfType(p_75081_7_) || pieceweight == p_75081_0_.structVillagePieceWeight && p_75081_0_.structureVillageWeightedPieceList.size() > 1) + { + break; + } + + StructureVillagePieces.Village village = func_75083_a(p_75081_0_, pieceweight, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_, p_75081_7_); + + if (village != null) + { + ++pieceweight.villagePiecesSpawned; + p_75081_0_.structVillagePieceWeight = pieceweight; + + if (!pieceweight.canSpawnMoreVillagePieces()) + { + p_75081_0_.structureVillageWeightedPieceList.remove(pieceweight); + } + + return village; + } + } + } + } + + StructureBoundingBox structureboundingbox = StructureVillagePieces.Torch.func_74904_a(p_75081_0_, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_); + + if (structureboundingbox != null) + { + return new StructureVillagePieces.Torch(p_75081_0_, p_75081_7_, p_75081_2_, structureboundingbox, p_75081_6_); + } + else + { + return null; + } + } + } + + /** + * attempts to find a next Structure Component to be spawned, private Village function + */ + private static StructureComponent getNextVillageStructureComponent(StructureVillagePieces.Start p_75077_0_, List p_75077_1_, Random p_75077_2_, int p_75077_3_, int p_75077_4_, int p_75077_5_, int p_75077_6_, int p_75077_7_) + { + if (p_75077_7_ > 50) + { + return null; + } + else if (Math.abs(p_75077_3_ - p_75077_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75077_5_ - p_75077_0_.getBoundingBox().minZ) <= 112) + { + StructureVillagePieces.Village village = getNextVillageComponent(p_75077_0_, p_75077_1_, p_75077_2_, p_75077_3_, p_75077_4_, p_75077_5_, p_75077_6_, p_75077_7_ + 1); + + if (village != null) + { + int j1 = (village.boundingBox.minX + village.boundingBox.maxX) / 2; + int k1 = (village.boundingBox.minZ + village.boundingBox.maxZ) / 2; + int l1 = village.boundingBox.maxX - village.boundingBox.minX; + int i2 = village.boundingBox.maxZ - village.boundingBox.minZ; + int j2 = l1 > i2 ? l1 : i2; + + if (p_75077_0_.getWorldChunkManager().areBiomesViable(j1, k1, j2 / 2 + 4, MapGenVillage.villageSpawnBiomes)) + { + p_75077_1_.add(village); + p_75077_0_.field_74932_i.add(village); + return village; + } + } + + return null; + } + else + { + return null; + } + } + + private static StructureComponent getNextComponentVillagePath(StructureVillagePieces.Start p_75080_0_, List p_75080_1_, Random p_75080_2_, int p_75080_3_, int p_75080_4_, int p_75080_5_, int p_75080_6_, int p_75080_7_) + { + if (p_75080_7_ > 3 + p_75080_0_.terrainType) + { + return null; + } + else if (Math.abs(p_75080_3_ - p_75080_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75080_5_ - p_75080_0_.getBoundingBox().minZ) <= 112) + { + StructureBoundingBox structureboundingbox = StructureVillagePieces.Path.func_74933_a(p_75080_0_, p_75080_1_, p_75080_2_, p_75080_3_, p_75080_4_, p_75080_5_, p_75080_6_); + + if (structureboundingbox != null && structureboundingbox.minY > 10) + { + StructureVillagePieces.Path path = new StructureVillagePieces.Path(p_75080_0_, p_75080_7_, p_75080_2_, structureboundingbox, p_75080_6_); + int j1 = (path.boundingBox.minX + path.boundingBox.maxX) / 2; + int k1 = (path.boundingBox.minZ + path.boundingBox.maxZ) / 2; + int l1 = path.boundingBox.maxX - path.boundingBox.minX; + int i2 = path.boundingBox.maxZ - path.boundingBox.minZ; + int j2 = l1 > i2 ? l1 : i2; + + if (p_75080_0_.getWorldChunkManager().areBiomesViable(j1, k1, j2 / 2 + 4, MapGenVillage.villageSpawnBiomes)) + { + p_75080_1_.add(path); + p_75080_0_.field_74930_j.add(path); + return path; + } + } + + return null; + } + else + { + return null; + } + } + + public static class Church extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000525"; + + public Church() {} + + public Church(StructureVillagePieces.Start p_i2102_1_, int p_i2102_2_, Random p_i2102_3_, StructureBoundingBox p_i2102_4_, int p_i2102_5_) + { + super(p_i2102_1_, p_i2102_2_); + this.coordBaseMode = p_i2102_5_; + this.boundingBox = p_i2102_4_; + } + + public static StructureVillagePieces.Church func_74919_a(StructureVillagePieces.Start p_74919_0_, List p_74919_1_, Random p_74919_2_, int p_74919_3_, int p_74919_4_, int p_74919_5_, int p_74919_6_, int p_74919_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74919_3_, p_74919_4_, p_74919_5_, 0, 0, 0, 5, 12, 9, p_74919_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74919_1_, structureboundingbox) == null ? new StructureVillagePieces.Church(p_74919_0_, p_74919_7_, p_74919_2_, structureboundingbox, p_74919_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 3, 7, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 1, 3, 9, 3, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 3, 0, 8, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 0, 3, 10, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 10, 3, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 10, 3, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 4, 0, 4, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 4, 4, 4, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 8, 3, 4, 8, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 4, 3, 10, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 5, 3, 5, 7, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 9, 0, 4, 9, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 0, 4, 4, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 11, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 11, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 2, 11, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 2, 11, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 1, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 1, 1, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 2, 1, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 3, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 3, 1, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 1, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 2, 1, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 3, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 1), 1, 2, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 0), 3, 2, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 6, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 7, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 6, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 7, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 6, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 7, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 6, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 7, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 3, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 4, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 1, 4, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 3, 4, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 4, 5, p_74875_3_); + int i = this.getMetadataWithOffset(Blocks.ladder, 4); + int j; + + for (j = 1; j <= 9; ++j) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 3, j, 3, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + for (j = 0; j < 9; ++j) + { + for (int k = 0; k < 5; ++k) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, k, 12, j, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, k, -1, j, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 2, 1, 2, 1); + return true; + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) + { + return 2; + } + } + + public static class Field1 extends StructureVillagePieces.Village + { + /** First crop type for this field. */ + private Block cropTypeA; + /** Second crop type for this field. */ + private Block cropTypeB; + /** Third crop type for this field. */ + private Block cropTypeC; + /** Fourth crop type for this field. */ + private Block cropTypeD; + private static final String __OBFID = "CL_00000518"; + + public Field1() {} + + public Field1(StructureVillagePieces.Start p_i2095_1_, int p_i2095_2_, Random p_i2095_3_, StructureBoundingBox p_i2095_4_, int p_i2095_5_) + { + super(p_i2095_1_, p_i2095_2_); + this.coordBaseMode = p_i2095_5_; + this.boundingBox = p_i2095_4_; + this.cropTypeA = this.func_151559_a(p_i2095_3_); + this.cropTypeB = this.func_151559_a(p_i2095_3_); + this.cropTypeC = this.func_151559_a(p_i2095_3_); + this.cropTypeD = this.func_151559_a(p_i2095_3_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + p_143012_1_.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + p_143012_1_.setInteger("CC", Block.blockRegistry.getIDForObject(this.cropTypeC)); + p_143012_1_.setInteger("CD", Block.blockRegistry.getIDForObject(this.cropTypeD)); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.cropTypeA = Block.getBlockById(p_143011_1_.getInteger("CA")); + this.cropTypeB = Block.getBlockById(p_143011_1_.getInteger("CB")); + this.cropTypeC = Block.getBlockById(p_143011_1_.getInteger("CC")); + this.cropTypeD = Block.getBlockById(p_143011_1_.getInteger("CD")); + } + + private Block func_151559_a(Random p_151559_1_) + { + switch (p_151559_1_.nextInt(5)) + { + case 0: + return Blocks.carrots; + case 1: + return Blocks.potatoes; + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field1 func_74900_a(StructureVillagePieces.Start p_74900_0_, List p_74900_1_, Random p_74900_2_, int p_74900_3_, int p_74900_4_, int p_74900_5_, int p_74900_6_, int p_74900_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74900_3_, p_74900_4_, p_74900_5_, 0, 0, 0, 13, 4, 9, p_74900_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74900_1_, structureboundingbox) == null ? new StructureVillagePieces.Field1(p_74900_0_, p_74900_7_, p_74900_2_, structureboundingbox, p_74900_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 12, 4, 8, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 1, 5, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 0, 1, 8, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 10, 0, 1, 11, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 0, 0, 6, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 12, 0, 0, 12, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 11, 0, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 8, 11, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 0, 1, 3, 0, 7, Blocks.water, Blocks.water, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 0, 1, 9, 0, 7, Blocks.water, Blocks.water, false); + int i; + + for (i = 1; i <= 7; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 1, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 2, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 4, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 5, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeC, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 7, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeC, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 8, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeD, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 10, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeD, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 11, 1, i, p_74875_3_); + } + + for (i = 0; i < 9; ++i) + { + for (int j = 0; j < 13; ++j) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 4, i, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.dirt, 0, j, -1, i, p_74875_3_); + } + } + + return true; + } + } + + public static class Field2 extends StructureVillagePieces.Village + { + /** First crop type for this field. */ + private Block cropTypeA; + /** Second crop type for this field. */ + private Block cropTypeB; + private static final String __OBFID = "CL_00000519"; + + public Field2() {} + + public Field2(StructureVillagePieces.Start p_i2096_1_, int p_i2096_2_, Random p_i2096_3_, StructureBoundingBox p_i2096_4_, int p_i2096_5_) + { + super(p_i2096_1_, p_i2096_2_); + this.coordBaseMode = p_i2096_5_; + this.boundingBox = p_i2096_4_; + this.cropTypeA = this.func_151560_a(p_i2096_3_); + this.cropTypeB = this.func_151560_a(p_i2096_3_); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("CA", Block.blockRegistry.getIDForObject(this.cropTypeA)); + p_143012_1_.setInteger("CB", Block.blockRegistry.getIDForObject(this.cropTypeB)); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.cropTypeA = Block.getBlockById(p_143011_1_.getInteger("CA")); + this.cropTypeB = Block.getBlockById(p_143011_1_.getInteger("CB")); + } + + private Block func_151560_a(Random p_151560_1_) + { + switch (p_151560_1_.nextInt(5)) + { + case 0: + return Blocks.carrots; + case 1: + return Blocks.potatoes; + default: + return Blocks.wheat; + } + } + + public static StructureVillagePieces.Field2 func_74902_a(StructureVillagePieces.Start p_74902_0_, List p_74902_1_, Random p_74902_2_, int p_74902_3_, int p_74902_4_, int p_74902_5_, int p_74902_6_, int p_74902_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74902_3_, p_74902_4_, p_74902_5_, 0, 0, 0, 7, 4, 9, p_74902_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74902_1_, structureboundingbox) == null ? new StructureVillagePieces.Field2(p_74902_0_, p_74902_7_, p_74902_2_, structureboundingbox, p_74902_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 6, 4, 8, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 0, 1, 5, 0, 7, Blocks.farmland, Blocks.farmland, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 0, 0, 6, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 5, 0, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 8, 5, 0, 8, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 0, 1, 3, 0, 7, Blocks.water, Blocks.water, false); + int i; + + for (i = 1; i <= 7; ++i) + { + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 1, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeA, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 2, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 4, 1, i, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, this.cropTypeB, MathHelper.getRandomIntegerInRange(p_74875_2_, 2, 7), 5, 1, i, p_74875_3_); + } + + for (i = 0; i < 9; ++i) + { + for (int j = 0; j < 7; ++j) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 4, i, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.dirt, 0, j, -1, i, p_74875_3_); + } + } + + return true; + } + } + + public static class Hall extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000522"; + + public Hall() {} + + public Hall(StructureVillagePieces.Start p_i2099_1_, int p_i2099_2_, Random p_i2099_3_, StructureBoundingBox p_i2099_4_, int p_i2099_5_) + { + super(p_i2099_1_, p_i2099_2_); + this.coordBaseMode = p_i2099_5_; + this.boundingBox = p_i2099_4_; + } + + public static StructureVillagePieces.Hall func_74906_a(StructureVillagePieces.Start p_74906_0_, List p_74906_1_, Random p_74906_2_, int p_74906_3_, int p_74906_4_, int p_74906_5_, int p_74906_6_, int p_74906_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74906_3_, p_74906_4_, p_74906_5_, 0, 0, 0, 9, 7, 11, p_74906_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74906_1_, structureboundingbox) == null ? new StructureVillagePieces.Hall(p_74906_0_, p_74906_7_, p_74906_2_, structureboundingbox, p_74906_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 4, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 1, 6, 8, 4, 10, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 0, 6, 8, 0, 10, Blocks.dirt, Blocks.dirt, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, 0, 6, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 1, 6, 2, 1, 10, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 1, 6, 8, 1, 10, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 10, 7, 1, 10, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 7, 0, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 0, 0, 8, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 7, 1, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 5, 7, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 5, 7, 3, 5, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 1, 8, 4, 1, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 4, 8, 4, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 2, 8, 5, 3, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 0, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 0, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 4, 3, p_74875_3_); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + int k; + int l; + + for (k = -1; k <= 2; ++k) + { + for (l = 0; l <= 8; ++l) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, i, l, 4 + k, k, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, j, l, 4 + k, 5 - k, p_74875_3_); + } + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 2, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wooden_pressure_plate, 0, 2, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 1, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), 2, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), 1, 1, 3, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 0, 1, 7, 0, 3, Blocks.double_stone_slab, Blocks.double_stone_slab, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.double_stone_slab, 0, 6, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.double_stone_slab, 0, 6, 1, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 6, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 6, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 6, 3, 4, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 6, 1, 5, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + for (k = 0; k < 5; ++k) + { + for (l = 0; l < 9; ++l) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, l, 7, k, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, l, -1, k, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 4, 1, 2, 2); + return true; + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) + { + return p_74888_1_ == 0 ? 4 : 0; + } + } + + public static class House1 extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000517"; + + public House1() {} + + public House1(StructureVillagePieces.Start p_i2094_1_, int p_i2094_2_, Random p_i2094_3_, StructureBoundingBox p_i2094_4_, int p_i2094_5_) + { + super(p_i2094_1_, p_i2094_2_); + this.coordBaseMode = p_i2094_5_; + this.boundingBox = p_i2094_4_; + } + + public static StructureVillagePieces.House1 func_74898_a(StructureVillagePieces.Start p_74898_0_, List p_74898_1_, Random p_74898_2_, int p_74898_3_, int p_74898_4_, int p_74898_5_, int p_74898_6_, int p_74898_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74898_3_, p_74898_4_, p_74898_5_, 0, 0, 0, 9, 9, 6, p_74898_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74898_1_, structureboundingbox) == null ? new StructureVillagePieces.House1(p_74898_0_, p_74898_7_, p_74898_2_, structureboundingbox, p_74898_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 8, 0, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 8, 5, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 6, 1, 8, 6, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 7, 2, 8, 7, 3, Blocks.cobblestone, Blocks.cobblestone, false); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + int k; + int l; + + for (k = -1; k <= 2; ++k) + { + for (l = 0; l <= 8; ++l) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, i, l, 6 + k, k, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, j, l, 6 + k, 5 - k, p_74875_3_); + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 5, 8, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 1, 0, 8, 1, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 1, 0, 7, 1, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 0, 0, 4, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 5, 0, 4, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 2, 5, 8, 4, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 2, 0, 8, 4, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 2, 1, 0, 4, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 5, 7, 4, 5, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 2, 1, 8, 4, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 4, 0, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 6, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 3, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 6, 2, 5, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 1, 7, 4, 1, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 4, 7, 4, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 3, 4, 7, 3, 4, Blocks.bookshelf, Blocks.bookshelf, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 7, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 0), 7, 1, 3, p_74875_3_); + k = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, k, 6, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, k, 5, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, k, 4, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, k, 3, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 6, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wooden_pressure_plate, 0, 6, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wooden_pressure_plate, 0, 4, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.crafting_table, 0, 7, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 1, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 1, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 1, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 1, 0, -1, p_74875_3_); + } + + for (l = 0; l < 6; ++l) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, i1, 9, l, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, i1, -1, l, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 2, 1, 2, 1); + return true; + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) + { + return 1; + } + } + + public static class House2 extends StructureVillagePieces.Village + { + /** List of items that Village's Blacksmith chest can contain. */ + public static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.diamond, 0, 1, 3, 3), new WeightedRandomChestContent(Items.iron_ingot, 0, 1, 5, 10), new WeightedRandomChestContent(Items.gold_ingot, 0, 1, 3, 5), new WeightedRandomChestContent(Items.bread, 0, 1, 3, 15), new WeightedRandomChestContent(Items.apple, 0, 1, 3, 15), new WeightedRandomChestContent(Items.iron_pickaxe, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_sword, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_chestplate, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_helmet, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_leggings, 0, 1, 1, 5), new WeightedRandomChestContent(Items.iron_boots, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.obsidian), 0, 3, 7, 5), new WeightedRandomChestContent(Item.getItemFromBlock(Blocks.sapling), 0, 3, 7, 5), new WeightedRandomChestContent(Items.saddle, 0, 1, 1, 3), new WeightedRandomChestContent(Items.iron_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.golden_horse_armor, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond_horse_armor, 0, 1, 1, 1)}; + private boolean hasMadeChest; + private static final String __OBFID = "CL_00000526"; + + public House2() {} + + public House2(StructureVillagePieces.Start p_i2103_1_, int p_i2103_2_, Random p_i2103_3_, StructureBoundingBox p_i2103_4_, int p_i2103_5_) + { + super(p_i2103_1_, p_i2103_2_); + this.coordBaseMode = p_i2103_5_; + this.boundingBox = p_i2103_4_; + } + + public static StructureVillagePieces.House2 func_74915_a(StructureVillagePieces.Start p_74915_0_, List p_74915_1_, Random p_74915_2_, int p_74915_3_, int p_74915_4_, int p_74915_5_, int p_74915_6_, int p_74915_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74915_3_, p_74915_4_, p_74915_5_, 0, 0, 0, 10, 6, 7, p_74915_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74915_1_, structureboundingbox) == null ? new StructureVillagePieces.House2(p_74915_0_, p_74915_7_, p_74915_2_, structureboundingbox, p_74915_6_) : null; + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Chest", this.hasMadeChest); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.hasMadeChest = p_143011_1_.getBoolean("Chest"); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 9, 4, 6, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 9, 0, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 0, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 0, 9, 5, 6, Blocks.stone_slab, Blocks.stone_slab, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 1, 8, 5, 5, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 4, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 0, 3, 4, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 6, 0, 4, 6, Blocks.log, Blocks.log, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 3, 3, 1, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 2, 3, 3, 2, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 3, 5, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 5, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 6, 5, 3, 6, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 1, 0, 5, 3, 0, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 9, 1, 0, 9, 3, 0, Blocks.fence, Blocks.fence, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 1, 4, 9, 4, 6, Blocks.cobblestone, Blocks.cobblestone, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.flowing_lava, 0, 7, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.flowing_lava, 0, 8, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_bars, 0, 9, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.iron_bars, 0, 9, 2, 4, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 2, 4, 8, 2, 5, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 6, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.furnace, 0, 6, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.furnace, 0, 6, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.double_stone_slab, 0, 8, 1, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 2, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wooden_pressure_plate, 0, 2, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 1, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), 2, 1, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), 1, 1, 4, p_74875_3_); + int i; + int j; + + if (!this.hasMadeChest) + { + i = this.getYWithOffset(1); + j = this.getXWithOffset(5, 5); + int k = this.getZWithOffset(5, 5); + + if (p_74875_3_.isVecInside(j, i, k)) + { + this.hasMadeChest = true; + this.generateStructureChestContents(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, ChestGenHooks.getItems(VILLAGE_BLACKSMITH, p_74875_2_), ChestGenHooks.getCount(VILLAGE_BLACKSMITH, p_74875_2_)); + } + } + + for (i = 6; i <= 8; ++i) + { + if (this.getBlockAtCurrentPosition(p_74875_1_, i, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, i, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), i, 0, -1, p_74875_3_); + } + } + + for (i = 0; i < 7; ++i) + { + for (j = 0; j < 10; ++j) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 6, i, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, j, -1, i, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 7, 1, 1, 1); + return true; + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) + { + return 3; + } + } + + public static class House3 extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000530"; + + public House3() {} + + public House3(StructureVillagePieces.Start p_i2106_1_, int p_i2106_2_, Random p_i2106_3_, StructureBoundingBox p_i2106_4_, int p_i2106_5_) + { + super(p_i2106_1_, p_i2106_2_); + this.coordBaseMode = p_i2106_5_; + this.boundingBox = p_i2106_4_; + } + + public static StructureVillagePieces.House3 func_74921_a(StructureVillagePieces.Start p_74921_0_, List p_74921_1_, Random p_74921_2_, int p_74921_3_, int p_74921_4_, int p_74921_5_, int p_74921_6_, int p_74921_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74921_3_, p_74921_4_, p_74921_5_, 0, 0, 0, 9, 7, 12, p_74921_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74921_1_, structureboundingbox) == null ? new StructureVillagePieces.House3(p_74921_0_, p_74921_7_, p_74921_2_, structureboundingbox, p_74921_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 7, 4, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 1, 6, 8, 4, 10, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 0, 5, 8, 0, 10, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 7, 0, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 0, 3, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 8, 0, 0, 8, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 0, 7, 2, 0, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 5, 2, 1, 5, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 2, 0, 6, 2, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 0, 10, 7, 3, 10, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 2, 5, 2, 3, 5, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 1, 8, 4, 1, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 4, 3, 4, 4, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 5, 2, 8, 5, 3, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 0, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 0, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 4, 4, p_74875_3_); + int i = this.getMetadataWithOffset(Blocks.oak_stairs, 3); + int j = this.getMetadataWithOffset(Blocks.oak_stairs, 2); + int k; + int l; + + for (k = -1; k <= 2; ++k) + { + for (l = 0; l <= 8; ++l) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, i, l, 4 + k, k, p_74875_3_); + + if ((k > -1 || l <= 1) && (k > 0 || l <= 3) && (k > 1 || l <= 4 || l >= 6)) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, j, l, 4 + k, 5 - k, p_74875_3_); + } + } + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 4, 5, 3, 4, 10, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 7, 4, 2, 7, 4, 10, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 5, 4, 4, 5, 10, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 6, 5, 4, 6, 5, 10, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 5, 6, 3, 5, 6, 10, Blocks.planks, Blocks.planks, false); + k = this.getMetadataWithOffset(Blocks.oak_stairs, 0); + int i1; + + for (l = 4; l >= 1; --l) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, l, 2 + l, 7 - l, p_74875_3_); + + for (i1 = 8 - l; i1 <= 10; ++i1) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, k, l, 2 + l, i1, p_74875_3_); + } + } + + l = this.getMetadataWithOffset(Blocks.oak_stairs, 1); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 6, 6, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 7, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, l, 6, 6, 4, p_74875_3_); + int j1; + + for (i1 = 6; i1 <= 8; ++i1) + { + for (j1 = 5; j1 <= 10; ++j1) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.oak_stairs, l, i1, 12 - i1, j1, p_74875_3_); + } + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 4, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 6, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 8, 2, 5, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 8, 2, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 8, 2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 2, 2, 6, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 7, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 8, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 2, 2, 9, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 4, 4, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 5, 4, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 6, 4, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 5, 5, 10, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 2, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, -1, 3, 2, -1, Blocks.air, Blocks.air, false); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + for (i1 = 0; i1 < 5; ++i1) + { + for (j1 = 0; j1 < 9; ++j1) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j1, 7, i1, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, j1, -1, i1, p_74875_3_); + } + } + + for (i1 = 5; i1 < 11; ++i1) + { + for (j1 = 2; j1 < 9; ++j1) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j1, 7, i1, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, j1, -1, i1, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 4, 1, 2, 2); + return true; + } + } + + public static class House4Garden extends StructureVillagePieces.Village + { + private boolean isRoofAccessible; + private static final String __OBFID = "CL_00000523"; + + public House4Garden() {} + + public House4Garden(StructureVillagePieces.Start p_i2100_1_, int p_i2100_2_, Random p_i2100_3_, StructureBoundingBox p_i2100_4_, int p_i2100_5_) + { + super(p_i2100_1_, p_i2100_2_); + this.coordBaseMode = p_i2100_5_; + this.boundingBox = p_i2100_4_; + this.isRoofAccessible = p_i2100_3_.nextBoolean(); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setBoolean("Terrace", this.isRoofAccessible); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.isRoofAccessible = p_143011_1_.getBoolean("Terrace"); + } + + public static StructureVillagePieces.House4Garden func_74912_a(StructureVillagePieces.Start p_74912_0_, List p_74912_1_, Random p_74912_2_, int p_74912_3_, int p_74912_4_, int p_74912_5_, int p_74912_6_, int p_74912_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74912_3_, p_74912_4_, p_74912_5_, 0, 0, 0, 5, 6, 5, p_74912_6_); + return StructureComponent.findIntersecting(p_74912_1_, structureboundingbox) != null ? null : new StructureVillagePieces.House4Garden(p_74912_0_, p_74912_7_, p_74912_2_, structureboundingbox, p_74912_6_); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 4, 0, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 4, 0, 4, 4, 4, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 1, 3, 4, 3, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 0, 3, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 1, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.cobblestone, 0, 4, 3, 4, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 4, 1, 1, 4, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 4, 3, 3, 4, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 2, 2, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 4, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 1, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 1, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 1, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 2, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 3, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 3, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.planks, 0, 3, 1, 0, p_74875_3_); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 2, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 2, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 2, 0, -1, p_74875_3_); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 3, 3, Blocks.air, Blocks.air, false); + + if (this.isRoofAccessible) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 0, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 2, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 3, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 5, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 0, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 2, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 3, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 5, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 5, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 5, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 0, 5, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 0, 5, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 0, 5, 3, p_74875_3_); + } + + int i; + + if (this.isRoofAccessible) + { + i = this.getMetadataWithOffset(Blocks.ladder, 3); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 3, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 3, 2, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 3, 3, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.ladder, i, 3, 4, 3, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 3, 1, p_74875_3_); + + for (i = 0; i < 5; ++i) + { + for (int j = 0; j < 5; ++j) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 6, i, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, j, -1, i, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 1, 1, 2, 1); + return true; + } + } + + public static class Path extends StructureVillagePieces.Road + { + private int averageGroundLevel; + private static final String __OBFID = "CL_00000528"; + + public Path() {} + + public Path(StructureVillagePieces.Start p_i2105_1_, int p_i2105_2_, Random p_i2105_3_, StructureBoundingBox p_i2105_4_, int p_i2105_5_) + { + super(p_i2105_1_, p_i2105_2_); + this.coordBaseMode = p_i2105_5_; + this.boundingBox = p_i2105_4_; + this.averageGroundLevel = Math.max(p_i2105_4_.getXSize(), p_i2105_4_.getZSize()); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("Length", this.averageGroundLevel); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.averageGroundLevel = p_143011_1_.getInteger("Length"); + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + boolean flag = false; + int i; + StructureComponent structurecomponent1; + + for (i = p_74861_3_.nextInt(5); i < this.averageGroundLevel - 8; i += 2 + p_74861_3_.nextInt(5)) + { + structurecomponent1 = this.getNextComponentNN((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, i); + + if (structurecomponent1 != null) + { + i += Math.max(structurecomponent1.boundingBox.getXSize(), structurecomponent1.boundingBox.getZSize()); + flag = true; + } + } + + for (i = p_74861_3_.nextInt(5); i < this.averageGroundLevel - 8; i += 2 + p_74861_3_.nextInt(5)) + { + structurecomponent1 = this.getNextComponentPP((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, 0, i); + + if (structurecomponent1 != null) + { + i += Math.max(structurecomponent1.boundingBox.getXSize(), structurecomponent1.boundingBox.getZSize()); + flag = true; + } + } + + if (flag && p_74861_3_.nextInt(3) > 0) + { + switch (this.coordBaseMode) + { + case 0: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); + break; + case 1: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); + break; + case 2: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); + break; + case 3: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); + } + } + + if (flag && p_74861_3_.nextInt(3) > 0) + { + switch (this.coordBaseMode) + { + case 0: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); + break; + case 1: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + break; + case 2: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); + break; + case 3: + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + } + } + } + + public static StructureBoundingBox func_74933_a(StructureVillagePieces.Start p_74933_0_, List p_74933_1_, Random p_74933_2_, int p_74933_3_, int p_74933_4_, int p_74933_5_, int p_74933_6_) + { + for (int i1 = 7 * MathHelper.getRandomIntegerInRange(p_74933_2_, 3, 5); i1 >= 7; i1 -= 7) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74933_3_, p_74933_4_, p_74933_5_, 0, 0, 0, 3, 3, i1, p_74933_6_); + + if (StructureComponent.findIntersecting(p_74933_1_, structureboundingbox) == null) + { + return structureboundingbox; + } + } + + return null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + Block block = this.func_151558_b(Blocks.gravel, 0); + + for (int i = this.boundingBox.minX; i <= this.boundingBox.maxX; ++i) + { + for (int j = this.boundingBox.minZ; j <= this.boundingBox.maxZ; ++j) + { + if (p_74875_3_.isVecInside(i, 64, j)) + { + int k = p_74875_1_.getTopSolidOrLiquidBlock(i, j) - 1; + p_74875_1_.setBlock(i, k, j, block, 0, 2); + } + } + } + + return true; + } + } + + public static class PieceWeight + { + /** The Class object for the represantation of this village piece. */ + public Class villagePieceClass; + public final int villagePieceWeight; + public int villagePiecesSpawned; + public int villagePiecesLimit; + private static final String __OBFID = "CL_00000521"; + + public PieceWeight(Class p_i2098_1_, int p_i2098_2_, int p_i2098_3_) + { + this.villagePieceClass = p_i2098_1_; + this.villagePieceWeight = p_i2098_2_; + this.villagePiecesLimit = p_i2098_3_; + } + + public boolean canSpawnMoreVillagePiecesOfType(int p_75085_1_) + { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + + public boolean canSpawnMoreVillagePieces() + { + return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; + } + } + + public abstract static class Road extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000532"; + + public Road() {} + + protected Road(StructureVillagePieces.Start p_i2108_1_, int p_i2108_2_) + { + super(p_i2108_1_, p_i2108_2_); + } + } + + public static class Start extends StructureVillagePieces.Well + { + public WorldChunkManager worldChunkMngr; + /** Boolean that determines if the village is in a desert or not. */ + public boolean inDesert; + /** World terrain type, 0 for normal, 1 for flap map */ + public int terrainType; + public StructureVillagePieces.PieceWeight structVillagePieceWeight; + /** + * Contains List of all spawnable Structure Piece Weights. If no more Pieces of a type can be spawned, they + * are removed from this list + */ + public List structureVillageWeightedPieceList; + public List field_74932_i = new ArrayList(); + public List field_74930_j = new ArrayList(); + private static final String __OBFID = "CL_00000527"; + public BiomeGenBase biome; + + public Start() {} + + public Start(WorldChunkManager p_i2104_1_, int p_i2104_2_, Random p_i2104_3_, int p_i2104_4_, int p_i2104_5_, List p_i2104_6_, int p_i2104_7_) + { + super((StructureVillagePieces.Start)null, 0, p_i2104_3_, p_i2104_4_, p_i2104_5_); + this.worldChunkMngr = p_i2104_1_; + this.structureVillageWeightedPieceList = p_i2104_6_; + this.terrainType = p_i2104_7_; + BiomeGenBase biomegenbase = p_i2104_1_.getBiomeGenAt(p_i2104_4_, p_i2104_5_); + this.inDesert = biomegenbase == BiomeGenBase.desert || biomegenbase == BiomeGenBase.desertHills; + this.biome = biomegenbase; + } + + public WorldChunkManager getWorldChunkManager() + { + return this.worldChunkMngr; + } + } + + public static class Torch extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000520"; + + public Torch() {} + + public Torch(StructureVillagePieces.Start p_i2097_1_, int p_i2097_2_, Random p_i2097_3_, StructureBoundingBox p_i2097_4_, int p_i2097_5_) + { + super(p_i2097_1_, p_i2097_2_); + this.coordBaseMode = p_i2097_5_; + this.boundingBox = p_i2097_4_; + } + + public static StructureBoundingBox func_74904_a(StructureVillagePieces.Start p_74904_0_, List p_74904_1_, Random p_74904_2_, int p_74904_3_, int p_74904_4_, int p_74904_5_, int p_74904_6_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74904_3_, p_74904_4_, p_74904_5_, 0, 0, 0, 3, 4, 2, p_74904_6_); + return StructureComponent.findIntersecting(p_74904_1_, structureboundingbox) != null ? null : structureboundingbox; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 2, 3, 1, Blocks.air, Blocks.air, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 0, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 2, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wool, 15, 1, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 0, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 1, 3, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 2, 3, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.torch, 0, 1, 3, -1, p_74875_3_); + return true; + } + } + + public abstract static class Village extends StructureComponent + { + protected int field_143015_k = -1; + /** The number of villagers that have been spawned in this component. */ + private int villagersSpawned; + private boolean field_143014_b; + private static final String __OBFID = "CL_00000531"; + private StructureVillagePieces.Start startPiece; + + public Village() {} + + protected Village(StructureVillagePieces.Start p_i2107_1_, int p_i2107_2_) + { + super(p_i2107_2_); + + if (p_i2107_1_ != null) + { + this.field_143014_b = p_i2107_1_.inDesert; + startPiece = p_i2107_1_; + } + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + p_143012_1_.setInteger("HPos", this.field_143015_k); + p_143012_1_.setInteger("VCount", this.villagersSpawned); + p_143012_1_.setBoolean("Desert", this.field_143014_b); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + this.field_143015_k = p_143011_1_.getInteger("HPos"); + this.villagersSpawned = p_143011_1_.getInteger("VCount"); + this.field_143014_b = p_143011_1_.getBoolean("Desert"); + } + + /** + * Gets the next village component, with the bounding box shifted -1 in the X and Z direction. + */ + protected StructureComponent getNextComponentNN(StructureVillagePieces.Start p_74891_1_, List p_74891_2_, Random p_74891_3_, int p_74891_4_, int p_74891_5_) + { + switch (this.coordBaseMode) + { + case 0: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType()); + case 1: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + case 2: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX - 1, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ + p_74891_5_, 1, this.getComponentType()); + case 3: + return StructureVillagePieces.getNextVillageStructureComponent(p_74891_1_, p_74891_2_, p_74891_3_, this.boundingBox.minX + p_74891_5_, this.boundingBox.minY + p_74891_4_, this.boundingBox.minZ - 1, 2, this.getComponentType()); + default: + return null; + } + } + + /** + * Gets the next village component, with the bounding box shifted +1 in the X and Z direction. + */ + protected StructureComponent getNextComponentPP(StructureVillagePieces.Start p_74894_1_, List p_74894_2_, Random p_74894_3_, int p_74894_4_, int p_74894_5_) + { + switch (this.coordBaseMode) + { + case 0: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType()); + case 1: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + case 2: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.maxX + 1, this.boundingBox.minY + p_74894_4_, this.boundingBox.minZ + p_74894_5_, 3, this.getComponentType()); + case 3: + return StructureVillagePieces.getNextVillageStructureComponent(p_74894_1_, p_74894_2_, p_74894_3_, this.boundingBox.minX + p_74894_5_, this.boundingBox.minY + p_74894_4_, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + default: + return null; + } + } + + /** + * Discover the y coordinate that will serve as the ground level of the supplied BoundingBox. (A median of + * all the levels in the BB's horizontal rectangle). + */ + protected int getAverageGroundLevel(World p_74889_1_, StructureBoundingBox p_74889_2_) + { + int i = 0; + int j = 0; + + for (int k = this.boundingBox.minZ; k <= this.boundingBox.maxZ; ++k) + { + for (int l = this.boundingBox.minX; l <= this.boundingBox.maxX; ++l) + { + if (p_74889_2_.isVecInside(l, 64, k)) + { + i += Math.max(p_74889_1_.getTopSolidOrLiquidBlock(l, k), p_74889_1_.provider.getAverageGroundLevel()); + ++j; + } + } + } + + if (j == 0) + { + return -1; + } + else + { + return i / j; + } + } + + protected static boolean canVillageGoDeeper(StructureBoundingBox p_74895_0_) + { + return p_74895_0_ != null && p_74895_0_.minY > 10; + } + + /** + * Spawns a number of villagers in this component. Parameters: world, component bounding box, x offset, y + * offset, z offset, number of villagers + */ + protected void spawnVillagers(World p_74893_1_, StructureBoundingBox p_74893_2_, int p_74893_3_, int p_74893_4_, int p_74893_5_, int p_74893_6_) + { + if (this.villagersSpawned < p_74893_6_) + { + for (int i1 = this.villagersSpawned; i1 < p_74893_6_; ++i1) + { + int j1 = this.getXWithOffset(p_74893_3_ + i1, p_74893_5_); + int k1 = this.getYWithOffset(p_74893_4_); + int l1 = this.getZWithOffset(p_74893_3_ + i1, p_74893_5_); + + if (!p_74893_2_.isVecInside(j1, k1, l1)) + { + break; + } + + ++this.villagersSpawned; + EntityVillager entityvillager = new EntityVillager(p_74893_1_, this.getVillagerType(i1)); + entityvillager.setLocationAndAngles((double)j1 + 0.5D, (double)k1, (double)l1 + 0.5D, 0.0F, 0.0F); + p_74893_1_.spawnEntityInWorld(entityvillager); + } + } + } + + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType(int p_74888_1_) + { + return 0; + } + + protected Block func_151558_b(Block p_151558_1_, int p_151558_2_) + { + BiomeEvent.GetVillageBlockID event = new BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_151558_1_, p_151558_2_); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + if (event.getResult() == Result.DENY) return event.replacement; + if (this.field_143014_b) + { + if (p_151558_1_ == Blocks.log || p_151558_1_ == Blocks.log2) + { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.cobblestone) + { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.planks) + { + return Blocks.sandstone; + } + + if (p_151558_1_ == Blocks.oak_stairs) + { + return Blocks.sandstone_stairs; + } + + if (p_151558_1_ == Blocks.stone_stairs) + { + return Blocks.sandstone_stairs; + } + + if (p_151558_1_ == Blocks.gravel) + { + return Blocks.sandstone; + } + } + + return p_151558_1_; + } + + protected int func_151557_c(Block p_151557_1_, int p_151557_2_) + { + BiomeEvent.GetVillageBlockMeta event = new BiomeEvent.GetVillageBlockMeta(startPiece == null ? null : startPiece.biome, p_151557_1_, p_151557_2_); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + if (event.getResult() == Result.DENY) return event.replacement; + if (this.field_143014_b) + { + if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2) + { + return 0; + } + + if (p_151557_1_ == Blocks.cobblestone) + { + return 0; + } + + if (p_151557_1_ == Blocks.planks) + { + return 2; + } + } + + return p_151557_2_; + } + + /** + * current Position depends on currently set Coordinates mode, is computed here + */ + protected void placeBlockAtCurrentPosition(World p_151550_1_, Block p_151550_2_, int p_151550_3_, int p_151550_4_, int p_151550_5_, int p_151550_6_, StructureBoundingBox p_151550_7_) + { + Block block1 = this.func_151558_b(p_151550_2_, p_151550_3_); + int i1 = this.func_151557_c(p_151550_2_, p_151550_3_); + super.placeBlockAtCurrentPosition(p_151550_1_, block1, i1, p_151550_4_, p_151550_5_, p_151550_6_, p_151550_7_); + } + + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int + * maxY, int maxZ, int placeBlock, int replaceBlock, boolean alwaysreplace) + */ + protected void fillWithBlocks(World p_151549_1_, StructureBoundingBox p_151549_2_, int p_151549_3_, int p_151549_4_, int p_151549_5_, int p_151549_6_, int p_151549_7_, int p_151549_8_, Block p_151549_9_, Block p_151549_10_, boolean p_151549_11_) + { + Block block2 = this.func_151558_b(p_151549_9_, 0); + int k1 = this.func_151557_c(p_151549_9_, 0); + Block block3 = this.func_151558_b(p_151549_10_, 0); + int l1 = this.func_151557_c(p_151549_10_, 0); + super.fillWithMetadataBlocks(p_151549_1_, p_151549_2_, p_151549_3_, p_151549_4_, p_151549_5_, p_151549_6_, p_151549_7_, p_151549_8_, block2, k1, block3, l1, p_151549_11_); + } + + protected void func_151554_b(World p_151554_1_, Block p_151554_2_, int p_151554_3_, int p_151554_4_, int p_151554_5_, int p_151554_6_, StructureBoundingBox p_151554_7_) + { + Block block1 = this.func_151558_b(p_151554_2_, p_151554_3_); + int i1 = this.func_151557_c(p_151554_2_, p_151554_3_); + super.func_151554_b(p_151554_1_, block1, i1, p_151554_4_, p_151554_5_, p_151554_6_, p_151554_7_); + } + } + + public static class Well extends StructureVillagePieces.Village + { + private static final String __OBFID = "CL_00000533"; + + public Well() {} + + public Well(StructureVillagePieces.Start p_i2109_1_, int p_i2109_2_, Random p_i2109_3_, int p_i2109_4_, int p_i2109_5_) + { + super(p_i2109_1_, p_i2109_2_); + this.coordBaseMode = p_i2109_3_.nextInt(4); + + switch (this.coordBaseMode) + { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(p_i2109_4_, 64, p_i2109_5_, p_i2109_4_ + 6 - 1, 78, p_i2109_5_ + 6 - 1); + } + } + + /** + * Initiates construction of the Structure Component picked, at the current Location of StructGen + */ + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); + StructureVillagePieces.getNextComponentVillagePath((StructureVillagePieces.Start)p_74861_1_, p_74861_2_, p_74861_3_, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 4, 12, 4, Blocks.cobblestone, Blocks.flowing_water, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 12, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 3, 12, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 12, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 3, 12, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 13, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 14, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 13, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 14, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 13, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 14, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 13, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 14, 4, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 15, 1, 4, 15, 4, Blocks.cobblestone, Blocks.cobblestone, false); + + for (int i = 0; i <= 5; ++i) + { + for (int j = 0; j <= 5; ++j) + { + if (j == 0 || j == 5 || i == 0 || i == 5) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.gravel, 0, j, 11, i, p_74875_3_); + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 12, i, p_74875_3_); + } + } + } + + return true; + } + } + + public static class WoodHut extends StructureVillagePieces.Village + { + private boolean isTallHouse; + private int tablePosition; + private static final String __OBFID = "CL_00000524"; + + public WoodHut() {} + + public WoodHut(StructureVillagePieces.Start p_i2101_1_, int p_i2101_2_, Random p_i2101_3_, StructureBoundingBox p_i2101_4_, int p_i2101_5_) + { + super(p_i2101_1_, p_i2101_2_); + this.coordBaseMode = p_i2101_5_; + this.boundingBox = p_i2101_4_; + this.isTallHouse = p_i2101_3_.nextBoolean(); + this.tablePosition = p_i2101_3_.nextInt(3); + } + + protected void func_143012_a(NBTTagCompound p_143012_1_) + { + super.func_143012_a(p_143012_1_); + p_143012_1_.setInteger("T", this.tablePosition); + p_143012_1_.setBoolean("C", this.isTallHouse); + } + + protected void func_143011_b(NBTTagCompound p_143011_1_) + { + super.func_143011_b(p_143011_1_); + this.tablePosition = p_143011_1_.getInteger("T"); + this.isTallHouse = p_143011_1_.getBoolean("C"); + } + + public static StructureVillagePieces.WoodHut func_74908_a(StructureVillagePieces.Start p_74908_0_, List p_74908_1_, Random p_74908_2_, int p_74908_3_, int p_74908_4_, int p_74908_5_, int p_74908_6_, int p_74908_7_) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p_74908_3_, p_74908_4_, p_74908_5_, 0, 0, 0, 4, 6, 5, p_74908_6_); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(p_74908_1_, structureboundingbox) == null ? new StructureVillagePieces.WoodHut(p_74908_0_, p_74908_7_, p_74908_2_, structureboundingbox, p_74908_6_) : null; + } + + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes + * Mineshafts at the end, it adds Fences... + */ + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 1, 3, 5, 4, Blocks.air, Blocks.air, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 0, 0, 3, 0, 4, Blocks.cobblestone, Blocks.cobblestone, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 2, 0, 3, Blocks.dirt, Blocks.dirt, false); + + if (this.isTallHouse) + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 4, 1, 2, 4, 3, Blocks.log, Blocks.log, false); + } + else + { + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 5, 1, 2, 5, 3, Blocks.log, Blocks.log, false); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 1, 4, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 2, 4, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 1, 4, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 2, 4, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 4, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 0, 4, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 3, 4, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 3, 4, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.log, 0, 3, 4, 3, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 0, 0, 3, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 0, 3, 3, 0, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 4, 0, 3, 4, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 4, 3, 3, 4, Blocks.log, Blocks.log, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 0, 1, 1, 0, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 3, 1, 1, 3, 3, 3, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 0, 2, 3, 0, Blocks.planks, Blocks.planks, false); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 1, 4, 2, 3, 4, Blocks.planks, Blocks.planks, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 0, 2, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.glass_pane, 0, 3, 2, 2, p_74875_3_); + + if (this.tablePosition > 0) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, this.tablePosition, 1, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.wooden_pressure_plate, 0, this.tablePosition, 2, 3, p_74875_3_); + } + + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 1, 0, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 1, 2, 0, p_74875_3_); + this.placeDoorAtCurrentPosition(p_74875_1_, p_74875_3_, p_74875_2_, 1, 1, 0, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + if (this.getBlockAtCurrentPosition(p_74875_1_, 1, 0, -1, p_74875_3_).getMaterial() == Material.air && this.getBlockAtCurrentPosition(p_74875_1_, 1, -1, -1, p_74875_3_).getMaterial() != Material.air) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 1, 0, -1, p_74875_3_); + } + + for (int i = 0; i < 5; ++i) + { + for (int j = 0; j < 4; ++j) + { + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 6, i, p_74875_3_); + this.func_151554_b(p_74875_1_, Blocks.cobblestone, 0, j, -1, i, p_74875_3_); + } + } + + this.spawnVillagers(p_74875_1_, p_74875_3_, 1, 1, 2, 1); + return true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/DerivedWorldInfo.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/DerivedWorldInfo.java new file mode 100644 index 0000000..a797169 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/DerivedWorldInfo.java @@ -0,0 +1,278 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class DerivedWorldInfo extends WorldInfo +{ + /** Instance of WorldInfo. */ + private final WorldInfo theWorldInfo; + private static final String __OBFID = "CL_00000584"; + + public DerivedWorldInfo(WorldInfo p_i2145_1_) + { + this.theWorldInfo = p_i2145_1_; + } + + /** + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() + { + return this.theWorldInfo.getNBTTagCompound(); + } + + /** + * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound p_76082_1_) + { + return this.theWorldInfo.cloneNBTCompound(p_76082_1_); + } + + /** + * Returns the seed of current world. + */ + public long getSeed() + { + return this.theWorldInfo.getSeed(); + } + + /** + * Returns the x spawn position + */ + public int getSpawnX() + { + return this.theWorldInfo.getSpawnX(); + } + + /** + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() + { + return this.theWorldInfo.getSpawnY(); + } + + /** + * Returns the z spawn position + */ + public int getSpawnZ() + { + return this.theWorldInfo.getSpawnZ(); + } + + public long getWorldTotalTime() + { + return this.theWorldInfo.getWorldTotalTime(); + } + + /** + * Get current world time + */ + public long getWorldTime() + { + return this.theWorldInfo.getWorldTime(); + } + + @SideOnly(Side.CLIENT) + public long getSizeOnDisk() + { + return this.theWorldInfo.getSizeOnDisk(); + } + + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + + /** + * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer + * WorldProvider.dimensionID accessed from World.provider.dimensionID + */ + public int getVanillaDimension() + { + return this.theWorldInfo.getVanillaDimension(); + } + + /** + * Get current world name + */ + public String getWorldName() + { + return this.theWorldInfo.getWorldName(); + } + + /** + * Returns the save version of this world + */ + public int getSaveVersion() + { + return this.theWorldInfo.getSaveVersion(); + } + + /** + * Return the last time the player was in this world. + */ + @SideOnly(Side.CLIENT) + public long getLastTimePlayed() + { + return this.theWorldInfo.getLastTimePlayed(); + } + + /** + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() + { + return this.theWorldInfo.isThundering(); + } + + /** + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() + { + return this.theWorldInfo.getThunderTime(); + } + + /** + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() + { + return this.theWorldInfo.isRaining(); + } + + /** + * Return the number of ticks until rain. + */ + public int getRainTime() + { + return this.theWorldInfo.getRainTime(); + } + + /** + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() + { + return this.theWorldInfo.getGameType(); + } + + /** + * Set the x spawn position to the passed in value + */ + @SideOnly(Side.CLIENT) + public void setSpawnX(int p_76058_1_) {} + + /** + * Sets the y spawn position + */ + @SideOnly(Side.CLIENT) + public void setSpawnY(int p_76056_1_) {} + + public void incrementTotalWorldTime(long p_82572_1_) {} + + /** + * Set the z spawn position to the passed in value + */ + @SideOnly(Side.CLIENT) + public void setSpawnZ(int p_76087_1_) {} + + /** + * Set current world time + */ + public void setWorldTime(long p_76068_1_) {} + + /** + * Sets the spawn zone position. Args: x, y, z + */ + public void setSpawnPosition(int p_76081_1_, int p_76081_2_, int p_76081_3_) {} + + public void setWorldName(String p_76062_1_) {} + + /** + * Sets the save version of the world + */ + public void setSaveVersion(int p_76078_1_) {} + + /** + * Sets whether it is thundering or not. + */ + public void setThundering(boolean p_76069_1_) {} + + /** + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int p_76090_1_) {} + + /** + * Sets whether it is raining or not. + */ + public void setRaining(boolean p_76084_1_) {} + + /** + * Sets the number of ticks until rain. + */ + public void setRainTime(int p_76080_1_) {} + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() + { + return this.theWorldInfo.isMapFeaturesEnabled(); + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() + { + return this.theWorldInfo.isHardcoreModeEnabled(); + } + + public WorldType getTerrainType() + { + return this.theWorldInfo.getTerrainType(); + } + + public void setTerrainType(WorldType p_76085_1_) {} + + /** + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() + { + return this.theWorldInfo.areCommandsAllowed(); + } + + /** + * Returns true if the World is initialized. + */ + public boolean isInitialized() + { + return this.theWorldInfo.isInitialized(); + } + + /** + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean p_76091_1_) {} + + /** + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() + { + return this.theWorldInfo.getGameRulesInstance(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/IPlayerFileData.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/IPlayerFileData.java new file mode 100644 index 0000000..c3fb643 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/IPlayerFileData.java @@ -0,0 +1,22 @@ +package net.minecraft.world.storage; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public interface IPlayerFileData +{ + /** + * Writes the player data to disk from the specified PlayerEntityMP. + */ + void writePlayerData(EntityPlayer p_75753_1_); + + /** + * Reads the player data from disk into the specified PlayerEntityMP. + */ + NBTTagCompound readPlayerData(EntityPlayer p_75752_1_); + + /** + * Returns an array of usernames for which player.dat exists for. + */ + String[] getAvailablePlayerDat(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveFormat.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveFormat.java new file mode 100644 index 0000000..25fc41b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveFormat.java @@ -0,0 +1,65 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.util.IProgressUpdate; + +public interface ISaveFormat +{ + @SideOnly(Side.CLIENT) + String func_154333_a(); + + /** + * Returns back a loader for the specified save directory + */ + ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_); + + @SideOnly(Side.CLIENT) + List getSaveList() throws AnvilConverterException; + + void flushCache(); + + /** + * gets the world info + */ + @SideOnly(Side.CLIENT) + WorldInfo getWorldInfo(String p_75803_1_); + + @SideOnly(Side.CLIENT) + boolean func_154335_d(String p_154335_1_); + + /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + boolean deleteWorldDirectory(String p_75802_1_); + + /** + * @args: Takes two arguments - first the name of the directory containing the world and second the new name for + * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory + * containing the world data. + */ + @SideOnly(Side.CLIENT) + void renameWorld(String p_75806_1_, String p_75806_2_); + + @SideOnly(Side.CLIENT) + boolean func_154334_a(String p_154334_1_); + + /** + * Checks if the save directory uses the old map format + */ + boolean isOldMapFormat(String p_75801_1_); + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_); + + /** + * Return whether the given world can be loaded. + */ + @SideOnly(Side.CLIENT) + boolean canLoadWorld(String p_90033_1_); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveHandler.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveHandler.java new file mode 100644 index 0000000..85f5341 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ISaveHandler.java @@ -0,0 +1,60 @@ +package net.minecraft.world.storage; + +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +public interface ISaveHandler +{ + /** + * Loads and returns the world info + */ + WorldInfo loadWorldInfo(); + + /** + * Checks the session lock to prevent save collisions + */ + void checkSessionLock() throws MinecraftException; + + /** + * Returns the chunk loader with the provided world provider + */ + IChunkLoader getChunkLoader(WorldProvider p_75763_1_); + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_); + + /** + * Saves the passed in world info. + */ + void saveWorldInfo(WorldInfo p_75761_1_); + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + IPlayerFileData getSaveHandler(); + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + void flush(); + + /** + * Gets the File object corresponding to the base directory of this world. + */ + File getWorldDirectory(); + + /** + * Gets the file location of the given map + */ + File getMapFileFromName(String p_75758_1_); + + /** + * Returns the name of the directory where world information is saved. + */ + String getWorldDirectoryName(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/IThreadedFileIO.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/IThreadedFileIO.java new file mode 100644 index 0000000..70982f7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/IThreadedFileIO.java @@ -0,0 +1,9 @@ +package net.minecraft.world.storage; + +public interface IThreadedFileIO +{ + /** + * Returns a boolean stating if the write was unsuccessful. + */ + boolean writeNextIO(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapData.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapData.java new file mode 100644 index 0000000..30fbb06 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapData.java @@ -0,0 +1,428 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.*; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + +public class MapData extends WorldSavedData +{ + public int xCenter; + public int zCenter; + public int dimension; + public byte scale; + /** colours */ + public byte[] colors = new byte[16384]; + /** Holds a reference to the MapInfo of the players who own a copy of the map */ + public List playersArrayList = new ArrayList(); + /** Holds a reference to the players who own a copy of the map and a reference to their MapInfo */ + private Map playersHashMap = new HashMap(); + public Map playersVisibleOnMap = new LinkedHashMap(); + private static final String __OBFID = "CL_00000577"; + + public MapData(String p_i2140_1_) + { + super(p_i2140_1_); + } + + /** + * reads in data from the NBTTagCompound into this MapDataBase + */ + public void readFromNBT(NBTTagCompound p_76184_1_) + { + NBTBase dimension = p_76184_1_.getTag("dimension"); + + if (dimension instanceof NBTTagByte) + { + this.dimension = ((NBTTagByte)dimension).func_150290_f(); + } + else + { + this.dimension = ((NBTTagInt)dimension).func_150287_d(); + } + + this.xCenter = p_76184_1_.getInteger("xCenter"); + this.zCenter = p_76184_1_.getInteger("zCenter"); + this.scale = p_76184_1_.getByte("scale"); + + if (this.scale < 0) + { + this.scale = 0; + } + + if (this.scale > 4) + { + this.scale = 4; + } + + short short1 = p_76184_1_.getShort("width"); + short short2 = p_76184_1_.getShort("height"); + + if (short1 == 128 && short2 == 128) + { + this.colors = p_76184_1_.getByteArray("colors"); + } + else + { + byte[] abyte = p_76184_1_.getByteArray("colors"); + this.colors = new byte[16384]; + int i = (128 - short1) / 2; + int j = (128 - short2) / 2; + + for (int k = 0; k < short2; ++k) + { + int l = k + j; + + if (l >= 0 || l < 128) + { + for (int i1 = 0; i1 < short1; ++i1) + { + int j1 = i1 + i; + + if (j1 >= 0 || j1 < 128) + { + this.colors[j1 + l * 128] = abyte[i1 + k * short1]; + } + } + } + } + } + } + + /** + * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities + */ + public void writeToNBT(NBTTagCompound p_76187_1_) + { + p_76187_1_.setInteger("dimension", this.dimension); + p_76187_1_.setInteger("xCenter", this.xCenter); + p_76187_1_.setInteger("zCenter", this.zCenter); + p_76187_1_.setByte("scale", this.scale); + p_76187_1_.setShort("width", (short)128); + p_76187_1_.setShort("height", (short)128); + p_76187_1_.setByteArray("colors", this.colors); + } + + /** + * Adds the player passed to the list of visible players and checks to see which players are visible + */ + public void updateVisiblePlayers(EntityPlayer p_76191_1_, ItemStack p_76191_2_) + { + if (!this.playersHashMap.containsKey(p_76191_1_)) + { + MapData.MapInfo mapinfo = new MapData.MapInfo(p_76191_1_); + this.playersHashMap.put(p_76191_1_, mapinfo); + this.playersArrayList.add(mapinfo); + } + + if (!p_76191_1_.inventory.hasItemStack(p_76191_2_)) + { + this.playersVisibleOnMap.remove(p_76191_1_.getCommandSenderName()); + } + + for (int i = 0; i < this.playersArrayList.size(); ++i) + { + MapData.MapInfo mapinfo1 = (MapData.MapInfo)this.playersArrayList.get(i); + + if (!mapinfo1.entityplayerObj.isDead && (mapinfo1.entityplayerObj.inventory.hasItemStack(p_76191_2_) || p_76191_2_.isOnItemFrame())) + { + if (!p_76191_2_.isOnItemFrame() && mapinfo1.entityplayerObj.dimension == this.dimension) + { + this.func_82567_a(0, mapinfo1.entityplayerObj.worldObj, mapinfo1.entityplayerObj.getCommandSenderName(), mapinfo1.entityplayerObj.posX, mapinfo1.entityplayerObj.posZ, (double)mapinfo1.entityplayerObj.rotationYaw); + } + } + else + { + this.playersHashMap.remove(mapinfo1.entityplayerObj); + this.playersArrayList.remove(mapinfo1); + } + } + + if (p_76191_2_.isOnItemFrame()) + { + this.func_82567_a(1, p_76191_1_.worldObj, "frame-" + p_76191_2_.getItemFrame().getEntityId(), (double)p_76191_2_.getItemFrame().field_146063_b, (double)p_76191_2_.getItemFrame().field_146062_d, (double)(p_76191_2_.getItemFrame().hangingDirection * 90)); + } + } + + private void func_82567_a(int p_82567_1_, World p_82567_2_, String p_82567_3_, double p_82567_4_, double p_82567_6_, double p_82567_8_) + { + int j = 1 << this.scale; + float f = (float)(p_82567_4_ - (double)this.xCenter) / (float)j; + float f1 = (float)(p_82567_6_ - (double)this.zCenter) / (float)j; + byte b0 = (byte)((int)((double)(f * 2.0F) + 0.5D)); + byte b1 = (byte)((int)((double)(f1 * 2.0F) + 0.5D)); + byte b3 = 63; + byte b2; + + if (f >= (float)(-b3) && f1 >= (float)(-b3) && f <= (float)b3 && f1 <= (float)b3) + { + p_82567_8_ += p_82567_8_ < 0.0D ? -8.0D : 8.0D; + b2 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); + + if (p_82567_2_.provider.shouldMapSpin(p_82567_3_, p_82567_4_, p_82567_6_, p_82567_8_)) + { + int k = (int)(p_82567_2_.getWorldInfo().getWorldTime() / 10L); + b2 = (byte)(k * k * 34187121 + k * 121 >> 15 & 15); + } + } + else + { + if (Math.abs(f) >= 320.0F || Math.abs(f1) >= 320.0F) + { + this.playersVisibleOnMap.remove(p_82567_3_); + return; + } + + p_82567_1_ = 6; + b2 = 0; + + if (f <= (float)(-b3)) + { + b0 = (byte)((int)((double)(b3 * 2) + 2.5D)); + } + + if (f1 <= (float)(-b3)) + { + b1 = (byte)((int)((double)(b3 * 2) + 2.5D)); + } + + if (f >= (float)b3) + { + b0 = (byte)(b3 * 2 + 1); + } + + if (f1 >= (float)b3) + { + b1 = (byte)(b3 * 2 + 1); + } + } + + this.playersVisibleOnMap.put(p_82567_3_, new MapData.MapCoord((byte)p_82567_1_, b0, b1, b2)); + } + + /** + * Get byte array of packet data to send to players on map for updating map data + */ + public byte[] getUpdatePacketData(ItemStack p_76193_1_, World p_76193_2_, EntityPlayer p_76193_3_) + { + MapData.MapInfo mapinfo = (MapData.MapInfo)this.playersHashMap.get(p_76193_3_); + return mapinfo == null ? null : mapinfo.getPlayersOnMap(p_76193_1_); + } + + /** + * Marks a vertical range of pixels as being modified so they will be resent to clients. Parameters: X, lowest Y, + * highest Y + */ + public void setColumnDirty(int p_76194_1_, int p_76194_2_, int p_76194_3_) + { + super.markDirty(); + + for (int l = 0; l < this.playersArrayList.size(); ++l) + { + MapData.MapInfo mapinfo = (MapData.MapInfo)this.playersArrayList.get(l); + + if (mapinfo.field_76209_b[p_76194_1_] < 0 || mapinfo.field_76209_b[p_76194_1_] > p_76194_2_) + { + mapinfo.field_76209_b[p_76194_1_] = p_76194_2_; + } + + if (mapinfo.field_76210_c[p_76194_1_] < 0 || mapinfo.field_76210_c[p_76194_1_] < p_76194_3_) + { + mapinfo.field_76210_c[p_76194_1_] = p_76194_3_; + } + } + } + + /** + * Updates the client's map with information from other players in MP + */ + @SideOnly(Side.CLIENT) + public void updateMPMapData(byte[] p_76192_1_) + { + int i; + + if (p_76192_1_[0] == 0) + { + i = p_76192_1_[1] & 255; + int j = p_76192_1_[2] & 255; + + for (int k = 0; k < p_76192_1_.length - 3; ++k) + { + this.colors[(k + j) * 128 + i] = p_76192_1_[k + 3]; + } + + this.markDirty(); + } + else if (p_76192_1_[0] == 1) + { + this.playersVisibleOnMap.clear(); + + for (i = 0; i < (p_76192_1_.length - 1) / 3; ++i) + { + byte b2 = (byte)(p_76192_1_[i * 3 + 1] >> 4); + byte b3 = p_76192_1_[i * 3 + 2]; + byte b0 = p_76192_1_[i * 3 + 3]; + byte b1 = (byte)(p_76192_1_[i * 3 + 1] & 15); + this.playersVisibleOnMap.put("icon-" + i, new MapData.MapCoord(b2, b3, b0, b1)); + } + } + else if (p_76192_1_[0] == 2) + { + this.scale = p_76192_1_[1]; + } + } + + public MapData.MapInfo func_82568_a(EntityPlayer p_82568_1_) + { + MapData.MapInfo mapinfo = (MapData.MapInfo)this.playersHashMap.get(p_82568_1_); + + if (mapinfo == null) + { + mapinfo = new MapData.MapInfo(p_82568_1_); + this.playersHashMap.put(p_82568_1_, mapinfo); + this.playersArrayList.add(mapinfo); + } + + return mapinfo; + } + + public class MapCoord + { + public byte iconSize; + public byte centerX; + public byte centerZ; + public byte iconRotation; + private static final String __OBFID = "CL_00000579"; + + public MapCoord(byte p_i2139_2_, byte p_i2139_3_, byte p_i2139_4_, byte p_i2139_5_) + { + this.iconSize = p_i2139_2_; + this.centerX = p_i2139_3_; + this.centerZ = p_i2139_4_; + this.iconRotation = p_i2139_5_; + } + } + + public class MapInfo + { + /** Reference for EntityPlayer object in MapInfo */ + public final EntityPlayer entityplayerObj; + public int[] field_76209_b = new int[128]; + public int[] field_76210_c = new int[128]; + /** updated by x = mod(x*11,128) +1 x-1 is used to index field_76209_b and field_76210_c */ + private int currentRandomNumber; + private int ticksUntilPlayerLocationMapUpdate; + /** a cache of the result from getPlayersOnMap so that it is not resent when nothing changes */ + private byte[] lastPlayerLocationOnMap; + public int field_82569_d; + private boolean field_82570_i; + private static final String __OBFID = "CL_00000578"; + + public MapInfo(EntityPlayer p_i2138_2_) + { + this.entityplayerObj = p_i2138_2_; + + for (int i = 0; i < this.field_76209_b.length; ++i) + { + this.field_76209_b[i] = 0; + this.field_76210_c[i] = 127; + } + } + + /** + * returns a 1+players*3 array, of x,y, and color . the name of this function may be partially wrong, as there + * is a second branch to the code here + */ + public byte[] getPlayersOnMap(ItemStack p_76204_1_) + { + byte[] abyte; + + if (!this.field_82570_i) + { + abyte = new byte[] {(byte)2, MapData.this.scale}; + this.field_82570_i = true; + return abyte; + } + else + { + int i; + int i1; + + if (--this.ticksUntilPlayerLocationMapUpdate < 0) + { + this.ticksUntilPlayerLocationMapUpdate = 4; + abyte = new byte[MapData.this.playersVisibleOnMap.size() * 3 + 1]; + abyte[0] = 1; + i = 0; + + for (Iterator iterator = MapData.this.playersVisibleOnMap.values().iterator(); iterator.hasNext(); ++i) + { + MapData.MapCoord mapcoord = (MapData.MapCoord)iterator.next(); + abyte[i * 3 + 1] = (byte)(mapcoord.iconSize << 4 | mapcoord.iconRotation & 15); + abyte[i * 3 + 2] = mapcoord.centerX; + abyte[i * 3 + 3] = mapcoord.centerZ; + } + + boolean flag = !p_76204_1_.isOnItemFrame(); + + if (this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == abyte.length) + { + for (i1 = 0; i1 < abyte.length; ++i1) + { + if (abyte[i1] != this.lastPlayerLocationOnMap[i1]) + { + flag = false; + break; + } + } + } + else + { + flag = false; + } + + if (!flag) + { + this.lastPlayerLocationOnMap = abyte; + return abyte; + } + } + + for (int k = 0; k < 1; ++k) + { + i = this.currentRandomNumber++ * 11 % 128; + + if (this.field_76209_b[i] >= 0) + { + int l = this.field_76210_c[i] - this.field_76209_b[i] + 1; + i1 = this.field_76209_b[i]; + byte[] abyte1 = new byte[l + 3]; + abyte1[0] = 0; + abyte1[1] = (byte)i; + abyte1[2] = (byte)i1; + + for (int j = 0; j < abyte1.length - 3; ++j) + { + abyte1[j + 3] = MapData.this.colors[(j + i1) * 128 + i]; + } + + this.field_76210_c[i] = -1; + this.field_76209_b[i] = -1; + return abyte1; + } + } + + return null; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapStorage.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapStorage.java new file mode 100644 index 0000000..8790994 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/MapStorage.java @@ -0,0 +1,252 @@ +package net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagShort; +import net.minecraft.world.WorldSavedData; + +public class MapStorage +{ + private ISaveHandler saveHandler; + /** Map of item data String id to loaded MapDataBases */ + private Map loadedDataMap = new HashMap(); + /** List of loaded MapDataBases. */ + private List loadedDataList = new ArrayList(); + /** Map of MapDataBase id String prefixes ('map' etc) to max known unique Short id (the 0 part etc) for that prefix */ + private Map idCounts = new HashMap(); + private static final String __OBFID = "CL_00000604"; + + public MapStorage(ISaveHandler p_i2162_1_) + { + this.saveHandler = p_i2162_1_; + this.loadIdCounts(); + } + + /** + * Loads an existing MapDataBase corresponding to the given String id from disk, instantiating the given Class, or + * returns null if none such file exists. args: Class to instantiate, String dataid + */ + public WorldSavedData loadData(Class p_75742_1_, String p_75742_2_) + { + WorldSavedData worldsaveddata = (WorldSavedData)this.loadedDataMap.get(p_75742_2_); + + if (worldsaveddata != null) + { + return worldsaveddata; + } + else + { + if (this.saveHandler != null) + { + try + { + File file1 = this.saveHandler.getMapFileFromName(p_75742_2_); + + if (file1 != null && file1.exists()) + { + try + { + worldsaveddata = (WorldSavedData)p_75742_1_.getConstructor(new Class[] {String.class}).newInstance(new Object[] {p_75742_2_}); + } + catch (Exception exception) + { + throw new RuntimeException("Failed to instantiate " + p_75742_1_.toString(), exception); + } + + FileInputStream fileinputstream = new FileInputStream(file1); + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); + fileinputstream.close(); + worldsaveddata.readFromNBT(nbttagcompound.getCompoundTag("data")); + } + } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + + if (worldsaveddata != null) + { + this.loadedDataMap.put(p_75742_2_, worldsaveddata); + this.loadedDataList.add(worldsaveddata); + } + + return worldsaveddata; + } + } + + /** + * Assigns the given String id to the given MapDataBase, removing any existing ones of the same id. + */ + public void setData(String p_75745_1_, WorldSavedData p_75745_2_) + { + if (p_75745_2_ == null) + { + throw new RuntimeException("Can\'t set null data"); + } + else + { + if (this.loadedDataMap.containsKey(p_75745_1_)) + { + this.loadedDataList.remove(this.loadedDataMap.remove(p_75745_1_)); + } + + this.loadedDataMap.put(p_75745_1_, p_75745_2_); + this.loadedDataList.add(p_75745_2_); + } + } + + /** + * Saves all dirty loaded MapDataBases to disk. + */ + public void saveAllData() + { + for (int i = 0; i < this.loadedDataList.size(); ++i) + { + WorldSavedData worldsaveddata = (WorldSavedData)this.loadedDataList.get(i); + + if (worldsaveddata.isDirty()) + { + this.saveData(worldsaveddata); + worldsaveddata.setDirty(false); + } + } + } + + /** + * Saves the given MapDataBase to disk. + */ + private void saveData(WorldSavedData p_75747_1_) + { + if (this.saveHandler != null) + { + try + { + File file1 = this.saveHandler.getMapFileFromName(p_75747_1_.mapName); + + if (file1 != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + p_75747_1_.writeToNBT(nbttagcompound); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("data", nbttagcompound); + FileOutputStream fileoutputstream = new FileOutputStream(file1); + CompressedStreamTools.writeCompressed(nbttagcompound1, fileoutputstream); + fileoutputstream.close(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + + /** + * Loads the idCounts Map from the 'idcounts' file. + */ + private void loadIdCounts() + { + try + { + this.idCounts.clear(); + + if (this.saveHandler == null) + { + return; + } + + File file1 = this.saveHandler.getMapFileFromName("idcounts"); + + if (file1 != null && file1.exists()) + { + DataInputStream datainputstream = new DataInputStream(new FileInputStream(file1)); + NBTTagCompound nbttagcompound = CompressedStreamTools.read(datainputstream); + datainputstream.close(); + Iterator iterator = nbttagcompound.func_150296_c().iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + NBTBase nbtbase = nbttagcompound.getTag(s); + + if (nbtbase instanceof NBTTagShort) + { + NBTTagShort nbttagshort = (NBTTagShort)nbtbase; + short short1 = nbttagshort.func_150289_e(); + this.idCounts.put(s, Short.valueOf(short1)); + } + } + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + /** + * Returns an unique new data id for the given prefix and saves the idCounts map to the 'idcounts' file. + */ + public int getUniqueDataId(String p_75743_1_) + { + Short oshort = (Short)this.idCounts.get(p_75743_1_); + + if (oshort == null) + { + oshort = Short.valueOf((short)0); + } + else + { + oshort = Short.valueOf((short)(oshort.shortValue() + 1)); + } + + this.idCounts.put(p_75743_1_, oshort); + + if (this.saveHandler == null) + { + return oshort.shortValue(); + } + else + { + try + { + File file1 = this.saveHandler.getMapFileFromName("idcounts"); + + if (file1 != null) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + Iterator iterator = this.idCounts.keySet().iterator(); + + while (iterator.hasNext()) + { + String s1 = (String)iterator.next(); + short short1 = ((Short)this.idCounts.get(s1)).shortValue(); + nbttagcompound.setShort(s1, short1); + } + + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); + CompressedStreamTools.write(nbttagcompound, dataoutputstream); + dataoutputstream.close(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + + return oshort.shortValue(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatComparator.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatComparator.java new file mode 100644 index 0000000..cfb3415 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatComparator.java @@ -0,0 +1,96 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.WorldSettings; + +@SideOnly(Side.CLIENT) +public class SaveFormatComparator implements Comparable +{ + /** the file name of this save */ + private final String fileName; + /** the displayed name of this save file */ + private final String displayName; + private final long lastTimePlayed; + private final long sizeOnDisk; + private final boolean requiresConversion; + /** Instance of EnumGameType. */ + private final WorldSettings.GameType theEnumGameType; + private final boolean hardcore; + private final boolean cheatsEnabled; + private static final String __OBFID = "CL_00000601"; + + public SaveFormatComparator(String p_i2161_1_, String p_i2161_2_, long p_i2161_3_, long p_i2161_5_, WorldSettings.GameType p_i2161_7_, boolean p_i2161_8_, boolean p_i2161_9_, boolean p_i2161_10_) + { + this.fileName = p_i2161_1_; + this.displayName = p_i2161_2_; + this.lastTimePlayed = p_i2161_3_; + this.sizeOnDisk = p_i2161_5_; + this.theEnumGameType = p_i2161_7_; + this.requiresConversion = p_i2161_8_; + this.hardcore = p_i2161_9_; + this.cheatsEnabled = p_i2161_10_; + } + + /** + * return the file name + */ + public String getFileName() + { + return this.fileName; + } + + /** + * return the display name of the save + */ + public String getDisplayName() + { + return this.displayName; + } + + public long func_154336_c() + { + return this.sizeOnDisk; + } + + public boolean requiresConversion() + { + return this.requiresConversion; + } + + public long getLastTimePlayed() + { + return this.lastTimePlayed; + } + + public int compareTo(SaveFormatComparator p_compareTo_1_) + { + return this.lastTimePlayed < p_compareTo_1_.lastTimePlayed ? 1 : (this.lastTimePlayed > p_compareTo_1_.lastTimePlayed ? -1 : this.fileName.compareTo(p_compareTo_1_.fileName)); + } + + /** + * Gets the EnumGameType. + */ + public WorldSettings.GameType getEnumGameType() + { + return this.theEnumGameType; + } + + public boolean isHardcoreModeEnabled() + { + return this.hardcore; + } + + /** + * @return {@code true} if cheats are enabled for this world + */ + public boolean getCheatsEnabled() + { + return this.cheatsEnabled; + } + + public int compareTo(Object p_compareTo_1_) + { + return this.compareTo((SaveFormatComparator)p_compareTo_1_); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatOld.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatOld.java new file mode 100644 index 0000000..cad618c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveFormatOld.java @@ -0,0 +1,278 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.AnvilConverterException; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IProgressUpdate; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveFormatOld implements ISaveFormat +{ + private static final Logger logger = LogManager.getLogger(); + /** Reference to the File object representing the directory for the world saves */ + public final File savesDirectory; + private static final String __OBFID = "CL_00000586"; + + public SaveFormatOld(File p_i2147_1_) + { + if (!p_i2147_1_.exists()) + { + p_i2147_1_.mkdirs(); + } + + this.savesDirectory = p_i2147_1_; + } + + @SideOnly(Side.CLIENT) + public String func_154333_a() + { + return "Old Format"; + } + + @SideOnly(Side.CLIENT) + public List getSaveList() throws AnvilConverterException + { + ArrayList arraylist = new ArrayList(); + + for (int i = 0; i < 5; ++i) + { + String s = "World" + (i + 1); + WorldInfo worldinfo = this.getWorldInfo(s); + + if (worldinfo != null) + { + arraylist.add(new SaveFormatComparator(s, "", worldinfo.getLastTimePlayed(), worldinfo.getSizeOnDisk(), worldinfo.getGameType(), false, worldinfo.isHardcoreModeEnabled(), worldinfo.areCommandsAllowed())); + } + } + + return arraylist; + } + + public void flushCache() {} + + /** + * gets the world info + */ + public WorldInfo getWorldInfo(String p_75803_1_) + { + File file1 = new File(this.savesDirectory, p_75803_1_); + + if (!file1.exists()) + { + return null; + } + else + { + File file2 = new File(file1, "level.dat"); + NBTTagCompound nbttagcompound; + NBTTagCompound nbttagcompound1; + + if (file2.exists()) + { + try + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } + catch (Exception exception1) + { + logger.error("Exception reading " + file2, exception1); + } + } + + file2 = new File(file1, "level.dat_old"); + + if (file2.exists()) + { + try + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + return new WorldInfo(nbttagcompound1); + } + catch (Exception exception) + { + logger.error("Exception reading " + file2, exception); + } + } + + return null; + } + } + + /** + * @args: Takes two arguments - first the name of the directory containing the world and second the new name for + * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory + * containing the world data. + */ + @SideOnly(Side.CLIENT) + public void renameWorld(String p_75806_1_, String p_75806_2_) + { + File file1 = new File(this.savesDirectory, p_75806_1_); + + if (file1.exists()) + { + File file2 = new File(file1, "level.dat"); + + if (file2.exists()) + { + try + { + NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file2)); + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + nbttagcompound1.setString("LevelName", p_75806_2_); + CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file2)); + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + } + } + + @SideOnly(Side.CLIENT) + public boolean func_154335_d(String p_154335_1_) + { + File file1 = new File(this.savesDirectory, p_154335_1_); + + if (file1.exists()) + { + return false; + } + else + { + try + { + file1.mkdir(); + file1.delete(); + return true; + } + catch (Throwable throwable) + { + logger.warn("Couldn\'t make new level", throwable); + return false; + } + } + } + + /** + * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting + * the associated directory recursively. + */ + public boolean deleteWorldDirectory(String p_75802_1_) + { + File file1 = new File(this.savesDirectory, p_75802_1_); + + if (!file1.exists()) + { + return true; + } + else + { + logger.info("Deleting level " + p_75802_1_); + + for (int i = 1; i <= 5; ++i) + { + logger.info("Attempt " + i + "..."); + + if (deleteFiles(file1.listFiles())) + { + break; + } + + logger.warn("Unsuccessful in deleting contents."); + + if (i < 5) + { + try + { + Thread.sleep(500L); + } + catch (InterruptedException interruptedexception) + { + ; + } + } + } + + return file1.delete(); + } + } + + /** + * @args: Takes one argument - the list of files and directories to delete. @desc: Deletes the files and directory + * listed in the list recursively. + */ + protected static boolean deleteFiles(File[] p_75807_0_) + { + for (int i = 0; i < p_75807_0_.length; ++i) + { + File file1 = p_75807_0_[i]; + logger.debug("Deleting " + file1); + + if (file1.isDirectory() && !deleteFiles(file1.listFiles())) + { + logger.warn("Couldn\'t delete directory " + file1); + return false; + } + + if (!file1.delete()) + { + logger.warn("Couldn\'t delete file " + file1); + return false; + } + } + + return true; + } + + /** + * Returns back a loader for the specified save directory + */ + public ISaveHandler getSaveLoader(String p_75804_1_, boolean p_75804_2_) + { + return new SaveHandler(this.savesDirectory, p_75804_1_, p_75804_2_); + } + + @SideOnly(Side.CLIENT) + public boolean func_154334_a(String p_154334_1_) + { + return false; + } + + /** + * Checks if the save directory uses the old map format + */ + public boolean isOldMapFormat(String p_75801_1_) + { + return false; + } + + /** + * Converts the specified map to the new map format. Args: worldName, loadingScreen + */ + public boolean convertMapFormat(String p_75805_1_, IProgressUpdate p_75805_2_) + { + return false; + } + + /** + * Return whether the given world can be loaded. + */ + @SideOnly(Side.CLIENT) + public boolean canLoadWorld(String p_90033_1_) + { + File file1 = new File(this.savesDirectory, p_90033_1_); + return file1.isDirectory(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandler.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandler.java new file mode 100644 index 0000000..ce08452 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandler.java @@ -0,0 +1,389 @@ +package net.minecraft.world.storage; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.StartupQuery; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SaveHandler implements ISaveHandler, IPlayerFileData +{ + private static final Logger logger = LogManager.getLogger(); + /** The directory in which to save world data. */ + private final File worldDirectory; + /** The directory in which to save player data. */ + private final File playersDirectory; + private final File mapDataDir; + /** The time in milliseconds when this field was initialized. Stored in the session lock file. */ + private final long initializationTime = MinecraftServer.getSystemTimeMillis(); + /** The directory name of the world */ + private final String saveDirectoryName; + private static final String __OBFID = "CL_00000585"; + + public SaveHandler(File p_i2146_1_, String p_i2146_2_, boolean p_i2146_3_) + { + this.worldDirectory = new File(p_i2146_1_, p_i2146_2_); + this.worldDirectory.mkdirs(); + this.playersDirectory = new File(this.worldDirectory, "playerdata"); + this.mapDataDir = new File(this.worldDirectory, "data"); + this.mapDataDir.mkdirs(); + this.saveDirectoryName = p_i2146_2_; + + if (p_i2146_3_) + { + this.playersDirectory.mkdirs(); + } + + this.setSessionLock(); + } + + /** + * Creates a session lock file for this process + */ + private void setSessionLock() + { + try + { + File file1 = new File(this.worldDirectory, "session.lock"); + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(file1)); + + try + { + dataoutputstream.writeLong(this.initializationTime); + } + finally + { + dataoutputstream.close(); + } + } + catch (IOException ioexception) + { + ioexception.printStackTrace(); + throw new RuntimeException("Failed to check session lock, aborting"); + } + } + + /** + * Gets the File object corresponding to the base directory of this world. + */ + public File getWorldDirectory() + { + return this.worldDirectory; + } + + /** + * Checks the session lock to prevent save collisions + */ + public void checkSessionLock() throws MinecraftException + { + try + { + File file1 = new File(this.worldDirectory, "session.lock"); + DataInputStream datainputstream = new DataInputStream(new FileInputStream(file1)); + + try + { + if (datainputstream.readLong() != this.initializationTime) + { + throw new MinecraftException("The save is being accessed from another location, aborting"); + } + } + finally + { + datainputstream.close(); + } + } + catch (IOException ioexception) + { + throw new MinecraftException("Failed to check session lock, aborting"); + } + } + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) + { + throw new RuntimeException("Old Chunk Storage is no longer supported."); + } + + /** + * Loads and returns the world info + */ + public WorldInfo loadWorldInfo() + { + File file1 = new File(this.worldDirectory, "level.dat"); + NBTTagCompound nbttagcompound; + NBTTagCompound nbttagcompound1; + + WorldInfo worldInfo = null; + + if (file1.exists()) + { + try + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + worldInfo = new WorldInfo(nbttagcompound1); + FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); + return worldInfo; + } + catch (StartupQuery.AbortedException e) + { + throw e; + } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + + FMLCommonHandler.instance().confirmBackupLevelDatUse(this); + file1 = new File(this.worldDirectory, "level.dat_old"); + + if (file1.exists()) + { + try + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + nbttagcompound1 = nbttagcompound.getCompoundTag("Data"); + worldInfo = new WorldInfo(nbttagcompound1); + FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); + return worldInfo; + } + catch (StartupQuery.AbortedException e) + { + throw e; + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + return null; + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) + { + NBTTagCompound nbttagcompound1 = p_75755_1_.cloneNBTCompound(p_75755_2_); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setTag("Data", nbttagcompound1); + + FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound2); + + try + { + File file1 = new File(this.worldDirectory, "level.dat_new"); + File file2 = new File(this.worldDirectory, "level.dat_old"); + File file3 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(nbttagcompound2, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file3.renameTo(file2); + + if (file3.exists()) + { + file3.delete(); + } + + file1.renameTo(file3); + + if (file1.exists()) + { + file1.delete(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + /** + * Saves the passed in world info. + */ + public void saveWorldInfo(WorldInfo p_75761_1_) + { + NBTTagCompound nbttagcompound = p_75761_1_.getNBTTagCompound(); + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setTag("Data", nbttagcompound); + + FMLCommonHandler.instance().handleWorldDataSave(this, p_75761_1_, nbttagcompound1); + + try + { + File file1 = new File(this.worldDirectory, "level.dat_new"); + File file2 = new File(this.worldDirectory, "level.dat_old"); + File file3 = new File(this.worldDirectory, "level.dat"); + CompressedStreamTools.writeCompressed(nbttagcompound1, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file3.renameTo(file2); + + if (file3.exists()) + { + file3.delete(); + } + + file1.renameTo(file3); + + if (file1.exists()) + { + file1.delete(); + } + } + catch (Exception exception) + { + exception.printStackTrace(); + } + } + + /** + * Writes the player data to disk from the specified PlayerEntityMP. + */ + public void writePlayerData(EntityPlayer p_75753_1_) + { + try + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + p_75753_1_.writeToNBT(nbttagcompound); + File file1 = new File(this.playersDirectory, p_75753_1_.getUniqueID().toString() + ".dat.tmp"); + File file2 = new File(this.playersDirectory, p_75753_1_.getUniqueID().toString() + ".dat"); + CompressedStreamTools.writeCompressed(nbttagcompound, new FileOutputStream(file1)); + + if (file2.exists()) + { + file2.delete(); + } + + file1.renameTo(file2); + net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_75753_1_, this.playersDirectory, p_75753_1_.getUniqueID().toString()); + } + catch (Exception exception) + { + logger.warn("Failed to save player data for " + p_75753_1_.getCommandSenderName()); + } + } + + /** + * Reads the player data from disk into the specified PlayerEntityMP. + */ + public NBTTagCompound readPlayerData(EntityPlayer p_75752_1_) + { + NBTTagCompound nbttagcompound = null; + + try + { + File file1 = new File(this.playersDirectory, p_75752_1_.getUniqueID().toString() + ".dat"); + + if (file1.exists() && file1.isFile()) + { + nbttagcompound = CompressedStreamTools.readCompressed(new FileInputStream(file1)); + } + } + catch (Exception exception) + { + logger.warn("Failed to load player data for " + p_75752_1_.getCommandSenderName()); + } + + if (nbttagcompound != null) + { + p_75752_1_.readFromNBT(nbttagcompound); + } + + net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, playersDirectory, p_75752_1_.getUniqueID().toString()); + return nbttagcompound; + } + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + public IPlayerFileData getSaveHandler() + { + return this; + } + + /** + * Returns an array of usernames for which player.dat exists for. + */ + public String[] getAvailablePlayerDat() + { + String[] astring = this.playersDirectory.list(); + + for (int i = 0; i < astring.length; ++i) + { + if (astring[i].endsWith(".dat")) + { + astring[i] = astring[i].substring(0, astring[i].length() - 4); + } + } + + return astring; + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() {} + + /** + * Gets the file location of the given map + */ + public File getMapFileFromName(String p_75758_1_) + { + return new File(this.mapDataDir, p_75758_1_ + ".dat"); + } + + /** + * Returns the name of the directory where world information is saved. + */ + public String getWorldDirectoryName() + { + return this.saveDirectoryName; + } + + public NBTTagCompound getPlayerNBT(EntityPlayerMP player) + { + try + { + File file1 = new File(this.playersDirectory, player.getUniqueID().toString() + ".dat"); + + if (file1.exists() && file1.isFile()) + { + return CompressedStreamTools.readCompressed(new FileInputStream(file1)); + } + } + catch (Exception exception) + { + logger.warn("Failed to load player data for " + player.getCommandSenderName()); + } + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandlerMP.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandlerMP.java new file mode 100644 index 0000000..632a0dd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/SaveHandlerMP.java @@ -0,0 +1,83 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import java.io.File; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.chunk.storage.IChunkLoader; + +@SideOnly(Side.CLIENT) +public class SaveHandlerMP implements ISaveHandler +{ + private static final String __OBFID = "CL_00000602"; + + /** + * Loads and returns the world info + */ + public WorldInfo loadWorldInfo() + { + return null; + } + + /** + * Checks the session lock to prevent save collisions + */ + public void checkSessionLock() throws MinecraftException {} + + /** + * Returns the chunk loader with the provided world provider + */ + public IChunkLoader getChunkLoader(WorldProvider p_75763_1_) + { + return null; + } + + /** + * Saves the given World Info with the given NBTTagCompound as the Player. + */ + public void saveWorldInfoWithPlayer(WorldInfo p_75755_1_, NBTTagCompound p_75755_2_) {} + + /** + * Saves the passed in world info. + */ + public void saveWorldInfo(WorldInfo p_75761_1_) {} + + /** + * returns null if no saveHandler is relevent (eg. SMP) + */ + public IPlayerFileData getSaveHandler() + { + return null; + } + + /** + * Called to flush all changes to disk, waiting for them to complete. + */ + public void flush() {} + + /** + * Gets the file location of the given map + */ + public File getMapFileFromName(String p_75758_1_) + { + return null; + } + + /** + * Returns the name of the directory where world information is saved. + */ + public String getWorldDirectoryName() + { + return "none"; + } + + /** + * Gets the File object corresponding to the base directory of this world. + */ + public File getWorldDirectory() + { + return null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/ThreadedFileIOBase.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ThreadedFileIOBase.java new file mode 100644 index 0000000..16d5e39 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/ThreadedFileIOBase.java @@ -0,0 +1,92 @@ +package net.minecraft.world.storage; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ThreadedFileIOBase implements Runnable +{ + /** Instance of ThreadedFileIOBase */ + public static final ThreadedFileIOBase threadedIOInstance = new ThreadedFileIOBase(); + private List threadedIOQueue = Collections.synchronizedList(new ArrayList()); + private volatile long writeQueuedCounter; + private volatile long savedIOCounter; + private volatile boolean isThreadWaiting; + private static final String __OBFID = "CL_00000605"; + + private ThreadedFileIOBase() + { + Thread thread = new Thread(this, "File IO Thread"); + thread.setPriority(1); + thread.start(); + } + + public void run() + { + while (true) + this.processQueue(); + } + + /** + * Process the items that are in the queue + */ + private void processQueue() + { + for (int i = 0; i < this.threadedIOQueue.size(); ++i) + { + IThreadedFileIO ithreadedfileio = (IThreadedFileIO)this.threadedIOQueue.get(i); + boolean flag = ithreadedfileio.writeNextIO(); + + if (!flag) + { + this.threadedIOQueue.remove(i--); + ++this.savedIOCounter; + } + + try + { + Thread.sleep(this.isThreadWaiting ? 0L : 10L); + } + catch (InterruptedException interruptedexception1) + { + interruptedexception1.printStackTrace(); + } + } + + if (this.threadedIOQueue.isEmpty()) + { + try + { + Thread.sleep(25L); + } + catch (InterruptedException interruptedexception) + { + interruptedexception.printStackTrace(); + } + } + } + + /** + * threaded io + */ + public void queueIO(IThreadedFileIO p_75735_1_) + { + if (!this.threadedIOQueue.contains(p_75735_1_)) + { + ++this.writeQueuedCounter; + this.threadedIOQueue.add(p_75735_1_); + } + } + + public void waitForFinish() throws InterruptedException + { + this.isThreadWaiting = true; + + while (this.writeQueuedCounter != this.savedIOCounter) + { + Thread.sleep(10L); + } + + this.isThreadWaiting = false; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraft/world/storage/WorldInfo.java b/build/rfg/minecraft-src/java/net/minecraft/world/storage/WorldInfo.java new file mode 100644 index 0000000..68a7d7a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraft/world/storage/WorldInfo.java @@ -0,0 +1,682 @@ +package net.minecraft.world.storage; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Map; +import java.util.concurrent.Callable; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.GameRules; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.WorldType; + +public class WorldInfo +{ + /** Holds the seed of the currently world. */ + private long randomSeed; + private WorldType terrainType; + private String generatorOptions; + /** The spawn zone position X coordinate. */ + private int spawnX; + /** The spawn zone position Y coordinate. */ + private int spawnY; + /** The spawn zone position Z coordinate. */ + private int spawnZ; + /** Total time for this world. */ + private long totalTime; + /** The current world time in ticks, ranging from 0 to 23999. */ + private long worldTime; + /** The last time the player was in this world. */ + private long lastTimePlayed; + /** The size of entire save of current world on the disk, isn't exactly. */ + private long sizeOnDisk; + private NBTTagCompound playerTag; + private int dimension; + /** The name of the save defined at world creation. */ + private String levelName; + /** Introduced in beta 1.3, is the save version for future control. */ + private int saveVersion; + /** True if it's raining, false otherwise. */ + private boolean raining; + /** Number of ticks until next rain. */ + private int rainTime; + /** Is thunderbolts failing now? */ + private boolean thundering; + /** Number of ticks untils next thunderbolt. */ + private int thunderTime; + /** The Game Type. */ + private WorldSettings.GameType theGameType; + /** Whether the map features (e.g. strongholds) generation is enabled or disabled. */ + private boolean mapFeaturesEnabled; + /** Hardcore mode flag */ + private boolean hardcore; + private boolean allowCommands; + private boolean initialized; + private GameRules theGameRules; + private Map additionalProperties; + private static final String __OBFID = "CL_00000587"; + + protected WorldInfo() + { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + } + + public WorldInfo(NBTTagCompound p_i2157_1_) + { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2157_1_.getLong("RandomSeed"); + + if (p_i2157_1_.hasKey("generatorName", 8)) + { + String s = p_i2157_1_.getString("generatorName"); + this.terrainType = WorldType.parseWorldType(s); + + if (this.terrainType == null) + { + this.terrainType = WorldType.DEFAULT; + } + else if (this.terrainType.isVersioned()) + { + int i = 0; + + if (p_i2157_1_.hasKey("generatorVersion", 99)) + { + i = p_i2157_1_.getInteger("generatorVersion"); + } + + this.terrainType = this.terrainType.getWorldTypeForGeneratorVersion(i); + } + + if (p_i2157_1_.hasKey("generatorOptions", 8)) + { + this.generatorOptions = p_i2157_1_.getString("generatorOptions"); + } + } + + this.theGameType = WorldSettings.GameType.getByID(p_i2157_1_.getInteger("GameType")); + + if (p_i2157_1_.hasKey("MapFeatures", 99)) + { + this.mapFeaturesEnabled = p_i2157_1_.getBoolean("MapFeatures"); + } + else + { + this.mapFeaturesEnabled = true; + } + + this.spawnX = p_i2157_1_.getInteger("SpawnX"); + this.spawnY = p_i2157_1_.getInteger("SpawnY"); + this.spawnZ = p_i2157_1_.getInteger("SpawnZ"); + this.totalTime = p_i2157_1_.getLong("Time"); + + if (p_i2157_1_.hasKey("DayTime", 99)) + { + this.worldTime = p_i2157_1_.getLong("DayTime"); + } + else + { + this.worldTime = this.totalTime; + } + + this.lastTimePlayed = p_i2157_1_.getLong("LastPlayed"); + this.sizeOnDisk = p_i2157_1_.getLong("SizeOnDisk"); + this.levelName = p_i2157_1_.getString("LevelName"); + this.saveVersion = p_i2157_1_.getInteger("version"); + this.rainTime = p_i2157_1_.getInteger("rainTime"); + this.raining = p_i2157_1_.getBoolean("raining"); + this.thunderTime = p_i2157_1_.getInteger("thunderTime"); + this.thundering = p_i2157_1_.getBoolean("thundering"); + this.hardcore = p_i2157_1_.getBoolean("hardcore"); + + if (p_i2157_1_.hasKey("initialized", 99)) + { + this.initialized = p_i2157_1_.getBoolean("initialized"); + } + else + { + this.initialized = true; + } + + if (p_i2157_1_.hasKey("allowCommands", 99)) + { + this.allowCommands = p_i2157_1_.getBoolean("allowCommands"); + } + else + { + this.allowCommands = this.theGameType == WorldSettings.GameType.CREATIVE; + } + + if (p_i2157_1_.hasKey("Player", 10)) + { + this.playerTag = p_i2157_1_.getCompoundTag("Player"); + this.dimension = this.playerTag.getInteger("Dimension"); + } + + if (p_i2157_1_.hasKey("GameRules", 10)) + { + this.theGameRules.readGameRulesFromNBT(p_i2157_1_.getCompoundTag("GameRules")); + } + } + + public WorldInfo(WorldSettings p_i2158_1_, String p_i2158_2_) + { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2158_1_.getSeed(); + this.theGameType = p_i2158_1_.getGameType(); + this.mapFeaturesEnabled = p_i2158_1_.isMapFeaturesEnabled(); + this.levelName = p_i2158_2_; + this.hardcore = p_i2158_1_.getHardcoreEnabled(); + this.terrainType = p_i2158_1_.getTerrainType(); + this.generatorOptions = p_i2158_1_.func_82749_j(); + this.allowCommands = p_i2158_1_.areCommandsAllowed(); + this.initialized = false; + } + + public WorldInfo(WorldInfo p_i2159_1_) + { + this.terrainType = WorldType.DEFAULT; + this.generatorOptions = ""; + this.theGameRules = new GameRules(); + this.randomSeed = p_i2159_1_.randomSeed; + this.terrainType = p_i2159_1_.terrainType; + this.generatorOptions = p_i2159_1_.generatorOptions; + this.theGameType = p_i2159_1_.theGameType; + this.mapFeaturesEnabled = p_i2159_1_.mapFeaturesEnabled; + this.spawnX = p_i2159_1_.spawnX; + this.spawnY = p_i2159_1_.spawnY; + this.spawnZ = p_i2159_1_.spawnZ; + this.totalTime = p_i2159_1_.totalTime; + this.worldTime = p_i2159_1_.worldTime; + this.lastTimePlayed = p_i2159_1_.lastTimePlayed; + this.sizeOnDisk = p_i2159_1_.sizeOnDisk; + this.playerTag = p_i2159_1_.playerTag; + this.dimension = p_i2159_1_.dimension; + this.levelName = p_i2159_1_.levelName; + this.saveVersion = p_i2159_1_.saveVersion; + this.rainTime = p_i2159_1_.rainTime; + this.raining = p_i2159_1_.raining; + this.thunderTime = p_i2159_1_.thunderTime; + this.thundering = p_i2159_1_.thundering; + this.hardcore = p_i2159_1_.hardcore; + this.allowCommands = p_i2159_1_.allowCommands; + this.initialized = p_i2159_1_.initialized; + this.theGameRules = p_i2159_1_.theGameRules; + } + + /** + * Gets the NBTTagCompound for the worldInfo + */ + public NBTTagCompound getNBTTagCompound() + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound, this.playerTag); + return nbttagcompound; + } + + /** + * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" + */ + public NBTTagCompound cloneNBTCompound(NBTTagCompound p_76082_1_) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + this.updateTagCompound(nbttagcompound1, p_76082_1_); + return nbttagcompound1; + } + + private void updateTagCompound(NBTTagCompound p_76064_1_, NBTTagCompound p_76064_2_) + { + p_76064_1_.setLong("RandomSeed", this.randomSeed); + p_76064_1_.setString("generatorName", this.terrainType.getWorldTypeName()); + p_76064_1_.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); + p_76064_1_.setString("generatorOptions", this.generatorOptions); + p_76064_1_.setInteger("GameType", this.theGameType.getID()); + p_76064_1_.setBoolean("MapFeatures", this.mapFeaturesEnabled); + p_76064_1_.setInteger("SpawnX", this.spawnX); + p_76064_1_.setInteger("SpawnY", this.spawnY); + p_76064_1_.setInteger("SpawnZ", this.spawnZ); + p_76064_1_.setLong("Time", this.totalTime); + p_76064_1_.setLong("DayTime", this.worldTime); + p_76064_1_.setLong("SizeOnDisk", this.sizeOnDisk); + p_76064_1_.setLong("LastPlayed", MinecraftServer.getSystemTimeMillis()); + p_76064_1_.setString("LevelName", this.levelName); + p_76064_1_.setInteger("version", this.saveVersion); + p_76064_1_.setInteger("rainTime", this.rainTime); + p_76064_1_.setBoolean("raining", this.raining); + p_76064_1_.setInteger("thunderTime", this.thunderTime); + p_76064_1_.setBoolean("thundering", this.thundering); + p_76064_1_.setBoolean("hardcore", this.hardcore); + p_76064_1_.setBoolean("allowCommands", this.allowCommands); + p_76064_1_.setBoolean("initialized", this.initialized); + p_76064_1_.setTag("GameRules", this.theGameRules.writeGameRulesToNBT()); + + if (p_76064_2_ != null) + { + p_76064_1_.setTag("Player", p_76064_2_); + } + } + + /** + * Returns the seed of current world. + */ + public long getSeed() + { + return this.randomSeed; + } + + /** + * Returns the x spawn position + */ + public int getSpawnX() + { + return this.spawnX; + } + + /** + * Return the Y axis spawning point of the player. + */ + public int getSpawnY() + { + return this.spawnY; + } + + /** + * Returns the z spawn position + */ + public int getSpawnZ() + { + return this.spawnZ; + } + + public long getWorldTotalTime() + { + return this.totalTime; + } + + /** + * Get current world time + */ + public long getWorldTime() + { + return this.worldTime; + } + + @SideOnly(Side.CLIENT) + public long getSizeOnDisk() + { + return this.sizeOnDisk; + } + + /** + * Returns the player's NBTTagCompound to be loaded + */ + public NBTTagCompound getPlayerNBTTagCompound() + { + return this.playerTag; + } + + /** + * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer + * WorldProvider.dimensionID accessed from World.provider.dimensionID + */ + public int getVanillaDimension() + { + return this.dimension; + } + + /** + * Set the x spawn position to the passed in value + */ + @SideOnly(Side.CLIENT) + public void setSpawnX(int p_76058_1_) + { + this.spawnX = p_76058_1_; + } + + /** + * Sets the y spawn position + */ + @SideOnly(Side.CLIENT) + public void setSpawnY(int p_76056_1_) + { + this.spawnY = p_76056_1_; + } + + public void incrementTotalWorldTime(long p_82572_1_) + { + this.totalTime = p_82572_1_; + } + + /** + * Set the z spawn position to the passed in value + */ + @SideOnly(Side.CLIENT) + public void setSpawnZ(int p_76087_1_) + { + this.spawnZ = p_76087_1_; + } + + /** + * Set current world time + */ + public void setWorldTime(long p_76068_1_) + { + this.worldTime = p_76068_1_; + } + + /** + * Sets the spawn zone position. Args: x, y, z + */ + public void setSpawnPosition(int p_76081_1_, int p_76081_2_, int p_76081_3_) + { + this.spawnX = p_76081_1_; + this.spawnY = p_76081_2_; + this.spawnZ = p_76081_3_; + } + + /** + * Get current world name + */ + public String getWorldName() + { + return this.levelName; + } + + public void setWorldName(String p_76062_1_) + { + this.levelName = p_76062_1_; + } + + /** + * Returns the save version of this world + */ + public int getSaveVersion() + { + return this.saveVersion; + } + + /** + * Sets the save version of the world + */ + public void setSaveVersion(int p_76078_1_) + { + this.saveVersion = p_76078_1_; + } + + /** + * Return the last time the player was in this world. + */ + @SideOnly(Side.CLIENT) + public long getLastTimePlayed() + { + return this.lastTimePlayed; + } + + /** + * Returns true if it is thundering, false otherwise. + */ + public boolean isThundering() + { + return this.thundering; + } + + /** + * Sets whether it is thundering or not. + */ + public void setThundering(boolean p_76069_1_) + { + this.thundering = p_76069_1_; + } + + /** + * Returns the number of ticks until next thunderbolt. + */ + public int getThunderTime() + { + return this.thunderTime; + } + + /** + * Defines the number of ticks until next thunderbolt. + */ + public void setThunderTime(int p_76090_1_) + { + this.thunderTime = p_76090_1_; + } + + /** + * Returns true if it is raining, false otherwise. + */ + public boolean isRaining() + { + return this.raining; + } + + /** + * Sets whether it is raining or not. + */ + public void setRaining(boolean p_76084_1_) + { + this.raining = p_76084_1_; + } + + /** + * Return the number of ticks until rain. + */ + public int getRainTime() + { + return this.rainTime; + } + + /** + * Sets the number of ticks until rain. + */ + public void setRainTime(int p_76080_1_) + { + this.rainTime = p_76080_1_; + } + + /** + * Gets the GameType. + */ + public WorldSettings.GameType getGameType() + { + return this.theGameType; + } + + /** + * Get whether the map features (e.g. strongholds) generation is enabled or disabled. + */ + public boolean isMapFeaturesEnabled() + { + return this.mapFeaturesEnabled; + } + + /** + * Sets the GameType. + */ + public void setGameType(WorldSettings.GameType p_76060_1_) + { + this.theGameType = p_76060_1_; + } + + /** + * Returns true if hardcore mode is enabled, otherwise false + */ + public boolean isHardcoreModeEnabled() + { + return this.hardcore; + } + + public WorldType getTerrainType() + { + return this.terrainType; + } + + public void setTerrainType(WorldType p_76085_1_) + { + this.terrainType = p_76085_1_; + } + + public String getGeneratorOptions() + { + return this.generatorOptions; + } + + /** + * Returns true if commands are allowed on this World. + */ + public boolean areCommandsAllowed() + { + return this.allowCommands; + } + + /** + * Returns true if the World is initialized. + */ + public boolean isInitialized() + { + return this.initialized; + } + + /** + * Sets the initialization status of the World. + */ + public void setServerInitialized(boolean p_76091_1_) + { + this.initialized = p_76091_1_; + } + + /** + * Gets the GameRules class Instance. + */ + public GameRules getGameRulesInstance() + { + return this.theGameRules; + } + + /** + * Adds this WorldInfo instance to the crash report. + */ + public void addToCrashReport(CrashReportCategory p_85118_1_) + { + p_85118_1_.addCrashSectionCallable("Level seed", new Callable() + { + private static final String __OBFID = "CL_00000588"; + public String call() + { + return String.valueOf(WorldInfo.this.getSeed()); + } + }); + p_85118_1_.addCrashSectionCallable("Level generator", new Callable() + { + private static final String __OBFID = "CL_00000589"; + public String call() + { + return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[] {Integer.valueOf(WorldInfo.this.terrainType.getWorldTypeID()), WorldInfo.this.terrainType.getWorldTypeName(), Integer.valueOf(WorldInfo.this.terrainType.getGeneratorVersion()), Boolean.valueOf(WorldInfo.this.mapFeaturesEnabled)}); + } + }); + p_85118_1_.addCrashSectionCallable("Level generator options", new Callable() + { + private static final String __OBFID = "CL_00000590"; + public String call() + { + return WorldInfo.this.generatorOptions; + } + }); + p_85118_1_.addCrashSectionCallable("Level spawn location", new Callable() + { + private static final String __OBFID = "CL_00000591"; + public String call() + { + return CrashReportCategory.getLocationInfo(WorldInfo.this.spawnX, WorldInfo.this.spawnY, WorldInfo.this.spawnZ); + } + }); + p_85118_1_.addCrashSectionCallable("Level time", new Callable() + { + private static final String __OBFID = "CL_00000592"; + public String call() + { + return String.format("%d game time, %d day time", new Object[] {Long.valueOf(WorldInfo.this.totalTime), Long.valueOf(WorldInfo.this.worldTime)}); + } + }); + p_85118_1_.addCrashSectionCallable("Level dimension", new Callable() + { + private static final String __OBFID = "CL_00000593"; + public String call() + { + return String.valueOf(WorldInfo.this.dimension); + } + }); + p_85118_1_.addCrashSectionCallable("Level storage version", new Callable() + { + private static final String __OBFID = "CL_00000594"; + public String call() + { + String s = "Unknown?"; + + try + { + switch (WorldInfo.this.saveVersion) + { + case 19132: + s = "McRegion"; + break; + case 19133: + s = "Anvil"; + } + } + catch (Throwable throwable) + { + ; + } + + return String.format("0x%05X - %s", new Object[] {Integer.valueOf(WorldInfo.this.saveVersion), s}); + } + }); + p_85118_1_.addCrashSectionCallable("Level weather", new Callable() + { + private static final String __OBFID = "CL_00000595"; + public String call() + { + return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[] {Integer.valueOf(WorldInfo.this.rainTime), Boolean.valueOf(WorldInfo.this.raining), Integer.valueOf(WorldInfo.this.thunderTime), Boolean.valueOf(WorldInfo.this.thundering)}); + } + }); + p_85118_1_.addCrashSectionCallable("Level game mode", new Callable() + { + private static final String __OBFID = "CL_00000597"; + public String call() + { + return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[] {WorldInfo.this.theGameType.getName(), Integer.valueOf(WorldInfo.this.theGameType.getID()), Boolean.valueOf(WorldInfo.this.hardcore), Boolean.valueOf(WorldInfo.this.allowCommands)}); + } + }); + } + + /** + * 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(Map additionalProperties) + { + // one time set for this + if (this.additionalProperties == null) + { + this.additionalProperties = additionalProperties; + } + } + + public NBTBase getAdditionalProperty(String additionalProperty) + { + return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FMLForgePlugin.java b/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FMLForgePlugin.java new file mode 100644 index 0000000..c8dd550 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FMLForgePlugin.java @@ -0,0 +1,43 @@ +package net.minecraftforge.classloading; + +import java.io.File; +import java.util.Map; + +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; + +public class FMLForgePlugin implements IFMLLoadingPlugin +{ + public static boolean RUNTIME_DEOBF = false; + public static File forgeLocation; + + @Override + public String[] getASMTransformerClass() + { + return new String[] { "net.minecraftforge.classloading.FluidIdTransformer" }; + } + + @Override + public String getModContainerClass() + { + return "net.minecraftforge.common.ForgeModContainer"; + } + + @Override + public String getSetupClass() + { + return null; + } + + @Override + public void injectData(Map data) + { + RUNTIME_DEOBF = (Boolean)data.get("runtimeDeobfuscationEnabled"); + forgeLocation = (File)data.get("coremodLocation"); + } + + @Override + public String getAccessTransformerClass() + { + return "net.minecraftforge.transformers.ForgeAccessTransformer"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FluidIdTransformer.java b/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FluidIdTransformer.java new file mode 100644 index 0000000..138dd32 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/classloading/FluidIdTransformer.java @@ -0,0 +1,56 @@ +package net.minecraftforge.classloading; + +import java.util.ListIterator; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +import cpw.mods.fml.common.FMLLog; + +public class FluidIdTransformer implements IClassTransformer { + private static final String FLUID_TYPE = "net/minecraftforge/fluids/FluidStack"; + private static final String GETID_NAME = "getFluidID"; + private static final String LEGACY_FIELDNAME = "fluidID"; + private static final String GETID_DESC = "()I"; + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if (basicClass == null) + return null; + ClassNode classNode = new ClassNode(); + ClassReader classReader = new ClassReader(basicClass); + classReader.accept(classNode, 0); + + for (MethodNode m: classNode.methods) + { + for (ListIterator it = m.instructions.iterator(); it.hasNext(); ) + { + AbstractInsnNode insnNode = it.next(); + if (insnNode.getType() == AbstractInsnNode.FIELD_INSN) + { + FieldInsnNode fi = (FieldInsnNode)insnNode; + if (FLUID_TYPE.equals(fi.owner) && LEGACY_FIELDNAME.equals(fi.name) && fi.getOpcode() == Opcodes.GETFIELD) + { + FMLLog.fine("Method %s.%s%s: Replacing GETFIELD fluidID with INVOKEVIRTUAL getFluidID", name, m.name, m.desc); + it.remove(); + MethodInsnNode replace = new MethodInsnNode(Opcodes.INVOKEVIRTUAL, FLUID_TYPE, GETID_NAME, GETID_DESC, false); + it.add(replace); + } + } + } + } + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + return writer.toByteArray(); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/ClientCommandHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/ClientCommandHandler.java new file mode 100644 index 0000000..08bd913 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/ClientCommandHandler.java @@ -0,0 +1,140 @@ +package net.minecraftforge.client; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.command.CommandException; +import net.minecraft.command.CommandHandler; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.CommandEvent; +import cpw.mods.fml.client.FMLClientHandler; +import net.minecraft.util.EnumChatFormatting; +import static net.minecraft.util.EnumChatFormatting.*; + +/** + * The class that handles client-side chat commands. You should register any + * commands that you want handled on the client with this command handler. + * + * If there is a command with the same name registered both on the server and + * client, the client takes precedence! + * + */ +public class ClientCommandHandler extends CommandHandler +{ + public static final ClientCommandHandler instance = new ClientCommandHandler(); + + public String[] latestAutoComplete = null; + + /** + * @return 1 if successfully executed, -1 if no permission or wrong usage, + * 0 if it doesn't exist or it was canceled (it's sent to the server) + */ + @Override + public int executeCommand(ICommandSender sender, String message) + { + message = message.trim(); + + if (message.startsWith("/")) + { + message = message.substring(1); + } + + String[] temp = message.split(" "); + String[] args = new String[temp.length - 1]; + String commandName = temp[0]; + System.arraycopy(temp, 1, args, 0, args.length); + ICommand icommand = (ICommand) getCommands().get(commandName); + + try + { + if (icommand == null) + { + return 0; + } + + if (icommand.canCommandSenderUseCommand(sender)) + { + CommandEvent event = new CommandEvent(icommand, sender, args); + if (MinecraftForge.EVENT_BUS.post(event)) + { + if (event.exception != null) + { + throw event.exception; + } + return 0; + } + + icommand.processCommand(sender, args); + return 1; + } + else + { + sender.addChatMessage(format(RED, "commands.generic.permission")); + } + } + catch (WrongUsageException wue) + { + sender.addChatMessage(format(RED, "commands.generic.usage", format(RED, wue.getMessage(), wue.getErrorOjbects()))); + } + catch (CommandException ce) + { + sender.addChatMessage(format(RED, ce.getMessage(), ce.getErrorOjbects())); + } + catch (Throwable t) + { + sender.addChatMessage(format(RED, "commands.generic.exception")); + t.printStackTrace(); + } + + return -1; + } + + //Couple of helpers because the mcp names are stupid and long... + private ChatComponentTranslation format(EnumChatFormatting color, String str, Object... args) + { + ChatComponentTranslation ret = new ChatComponentTranslation(str, args); + ret.getChatStyle().setColor(color); + return ret; + } + + public void autoComplete(String leftOfCursor, String full) + { + latestAutoComplete = null; + + if (leftOfCursor.charAt(0) == '/') + { + leftOfCursor = leftOfCursor.substring(1); + + Minecraft mc = FMLClientHandler.instance().getClient(); + if (mc.currentScreen instanceof GuiChat) + { + @SuppressWarnings("unchecked") + List commands = getPossibleCommands(mc.thePlayer, leftOfCursor); + if (commands != null && !commands.isEmpty()) + { + if (leftOfCursor.indexOf(' ') == -1) + { + for (int i = 0; i < commands.size(); i++) + { + commands.set(i, GRAY + "/" + commands.get(i) + RESET); + } + } + else + { + for (int i = 0; i < commands.size(); i++) + { + commands.set(i, GRAY + commands.get(i) + RESET); + } + } + + latestAutoComplete = commands.toArray(new String[commands.size()]); + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/EnumHelperClient.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/EnumHelperClient.java new file mode 100644 index 0000000..d76f4dd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/EnumHelperClient.java @@ -0,0 +1,41 @@ +package net.minecraftforge.client; + +import net.minecraft.util.Util.EnumOS; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraft.client.settings.GameSettings.Options; +import net.minecraft.item.EnumRarity; +import net.minecraftforge.common.util.EnumHelper; + +import net.minecraft.client.settings.GameSettings.Options; +import net.minecraft.util.Util.EnumOS; +import net.minecraft.world.WorldSettings.GameType; +public class EnumHelperClient extends EnumHelper +{ + @SuppressWarnings("rawtypes") + private static Class[][] clentTypes = + { + {GameType.class, int.class, String.class}, + {Options.class, String.class, boolean.class, boolean.class}, + {EnumOS.class} + }; + + public static GameType addGameType(String name, int id, String displayName) + { + return addEnum(GameType.class, name, id, displayName); + } + + public static Options addOptions(String name, String langName, boolean isSlider, boolean isToggle) + { + return addEnum(Options.class, name, langName, isSlider, isToggle); + } + + public static EnumOS addOS2(String name) + { + return addEnum(EnumOS.class, name); + } + + public static > T addEnum(Class enumType, String enumName, Object... paramValues) + { + return addEnum(clentTypes, enumType, enumName, paramValues); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/ForgeHooksClient.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/ForgeHooksClient.java new file mode 100644 index 0000000..42a3244 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/ForgeHooksClient.java @@ -0,0 +1,500 @@ +package net.minecraftforge.client; + +import java.util.Random; + +import javax.imageio.ImageIO; + +import net.minecraftforge.client.event.MouseEvent; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundEventAccessorComposite; +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraftforge.client.event.FOVUpdateEvent; + +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.opengl.PixelFormat; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLLog; +import net.minecraft.client.Minecraft; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.ChunkCache; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.RenderHandEvent; +import net.minecraftforge.client.event.RenderWorldEvent; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.client.event.sound.PlaySoundEvent17; +import net.minecraftforge.common.ForgeModContainer; +import net.minecraftforge.common.ForgeVersion; +import net.minecraftforge.common.ForgeVersion.Status; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.RenderBlockFluid; +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; +import static net.minecraftforge.common.ForgeVersion.Status.*; + +public class ForgeHooksClient +{ + //private static final ResourceLocation ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + static TextureManager engine() + { + return FMLClientHandler.instance().getClient().renderEngine; + } + + public static String getArmorTexture(Entity entity, ItemStack armor, String _default, int slot, String type) + { + String result = armor.getItem().getArmorTexture(armor, entity, slot, type); + return result != null ? result : _default; + } + + public static boolean renderEntityItem(EntityItem entity, ItemStack item, float bobing, float rotation, Random random, TextureManager engine, RenderBlocks renderBlocks, int count) + { + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY); + if (customRenderer == null) + { + return false; + } + + if (customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_ROTATION)) + { + GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); + } + if (!customRenderer.shouldUseRenderHelper(ENTITY, item, ENTITY_BOBBING)) + { + GL11.glTranslatef(0.0F, -bobing, 0.0F); + } + boolean is3D = customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D); + + engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + Block block = item.getItem() instanceof ItemBlock ? Block.getBlockFromItem(item.getItem()) : null; + if (is3D || (block != null && RenderBlocks.renderItemIn3d(block.getRenderType()))) + { + int renderType = (block != null ? block.getRenderType() : 1); + float scale = (renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2 ? 0.5F : 0.25F); + boolean blend = block != null && block.getRenderBlockPass() > 0; + + if (RenderItem.renderInFrame) + { + GL11.glScalef(1.25F, 1.25F, 1.25F); + GL11.glTranslatef(0.0F, 0.05F, 0.0F); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + + if (blend) + { + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + + GL11.glScalef(scale, scale, scale); + + for(int j = 0; j < count; j++) + { + GL11.glPushMatrix(); + if (j > 0) + { + GL11.glTranslatef( + ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale, + ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale, + ((random.nextFloat() * 2.0F - 1.0F) * 0.2F) / scale); + } + customRenderer.renderItem(ENTITY, item, renderBlocks, entity); + GL11.glPopMatrix(); + } + + if (blend) + { + GL11.glDisable(GL11.GL_BLEND); + } + } + else + { + GL11.glScalef(0.5F, 0.5F, 0.5F); + customRenderer.renderItem(ENTITY, item, renderBlocks, entity); + } + return true; + } + + public static boolean renderInventoryItem(RenderBlocks renderBlocks, TextureManager engine, ItemStack item, boolean inColor, float zLevel, float x, float y) + { + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, INVENTORY); + if (customRenderer == null) + { + return false; + } + + engine.bindTexture(item.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture); + if (customRenderer.shouldUseRenderHelper(INVENTORY, item, INVENTORY_BLOCK)) + { + GL11.glPushMatrix(); + GL11.glTranslatef(x - 2, y + 3, -3.0F + zLevel); + GL11.glScalef(10F, 10F, 10F); + GL11.glTranslatef(1.0F, 0.5F, 1.0F); + GL11.glScalef(1.0F, 1.0F, -1F); + GL11.glRotatef(210F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); + + if(inColor) + { + int color = item.getItem().getColorFromItemStack(item, 0); + float r = (float)(color >> 16 & 0xff) / 255F; + float g = (float)(color >> 8 & 0xff) / 255F; + float b = (float)(color & 0xff) / 255F; + GL11.glColor4f(r, g, b, 1.0F); + } + + GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F); + renderBlocks.useInventoryTint = inColor; + customRenderer.renderItem(INVENTORY, item, renderBlocks); + renderBlocks.useInventoryTint = true; + GL11.glPopMatrix(); + } + else + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glPushMatrix(); + GL11.glTranslatef(x, y, -3.0F + zLevel); + + if (inColor) + { + int color = item.getItem().getColorFromItemStack(item, 0); + float r = (float)(color >> 16 & 255) / 255.0F; + float g = (float)(color >> 8 & 255) / 255.0F; + float b = (float)(color & 255) / 255.0F; + GL11.glColor4f(r, g, b, 1.0F); + } + + customRenderer.renderItem(INVENTORY, item, renderBlocks); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + } + + return true; + } + + public static void renderEffectOverlay(TextureManager manager, RenderItem render) + { + } + + public static void renderEquippedItem(ItemRenderType type, IItemRenderer customRenderer, RenderBlocks renderBlocks, EntityLivingBase entity, ItemStack item) + { + if (customRenderer.shouldUseRenderHelper(type, item, EQUIPPED_BLOCK)) + { + GL11.glPushMatrix(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + customRenderer.renderItem(type, item, renderBlocks, entity); + GL11.glPopMatrix(); + } + else + { + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glTranslatef(0.0F, -0.3F, 0.0F); + GL11.glScalef(1.5F, 1.5F, 1.5F); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + customRenderer.renderItem(type, item, renderBlocks, entity); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + //Optifine Helper Functions u.u, these are here specifically for Optifine + //Note: When using Optfine, these methods are invoked using reflection, which + //incurs a major performance penalty. + public static void orientBedCamera(Minecraft mc, EntityLivingBase entity) + { + int x = MathHelper.floor_double(entity.posX); + int y = MathHelper.floor_double(entity.posY); + int z = MathHelper.floor_double(entity.posZ); + Block block = mc.theWorld.getBlock(x, y, z); + + if (block != null && block.isBed(mc.theWorld, x, y, z, entity)) + { + GL11.glRotatef((float)(block.getBedDirection(mc.theWorld, x, y, z) * 90), 0.0F, 1.0F, 0.0F); + } + } + + public static boolean onDrawBlockHighlight(RenderGlobal context, EntityPlayer player, MovingObjectPosition target, int subID, ItemStack currentItem, float partialTicks) + { + return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, player, target, subID, currentItem, partialTicks)); + } + + public static void dispatchRenderLast(RenderGlobal context, float partialTicks) + { + MinecraftForge.EVENT_BUS.post(new RenderWorldLastEvent(context, partialTicks)); + } + + public static boolean renderFirstPersonHand(RenderGlobal context, float partialTicks, int renderPass) + { + return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(context, partialTicks, renderPass)); + } + + public static void onTextureStitchedPre(TextureMap map) + { + MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Pre(map)); + } + + public static void onTextureStitchedPost(TextureMap map) + { + MinecraftForge.EVENT_BUS.post(new TextureStitchEvent.Post(map)); + + FluidRegistry.WATER.setIcons(BlockLiquid.getLiquidIcon("water_still"), BlockLiquid.getLiquidIcon("water_flow")); + FluidRegistry.LAVA.setIcons(BlockLiquid.getLiquidIcon("lava_still"), BlockLiquid.getLiquidIcon("lava_flow")); + } + + /** + * This is added for Optifine's convenience. And to explode if a ModMaker is developing. + * @param texture + */ + public static void onTextureLoadPre(String texture) + { + if (Tessellator.renderingWorldRenderer) + { + FMLLog.warning("Warning: Texture %s not preloaded, will cause render glitches!", texture); + if (Tessellator.class.getPackage() != null) + { + if (Tessellator.class.getPackage().getName().startsWith("net.minecraft.")) + { + Minecraft mc = FMLClientHandler.instance().getClient(); + if (mc.ingameGUI != null) + { + mc.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("forge.texture.preload.warning", texture)); + } + } + } + } + } + + static int renderPass = -1; + public static void setRenderPass(int pass) + { + renderPass = pass; + } + + public static ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int slotID, ModelBiped _default) + { + ModelBiped modelbiped = itemStack.getItem().getArmorModel(entityLiving, itemStack, slotID); + return modelbiped == null ? _default : modelbiped; + } + + static int stencilBits = 0; + public static void createDisplay() throws LWJGLException + { + ImageIO.setUseCache(false); //Disable on-disc stream cache should speed up texture pack reloading. + PixelFormat format = new PixelFormat().withDepthBits(24); + if (!Boolean.parseBoolean(System.getProperty("forge.forceDisplayStencil", "false"))) + { + //Creating the display with Stencil bits causes issues on some displays. + //According to ChickenBones, Mumfrey and Pig The only real use is in the FBO. + //So lets default to normal init to fix the issues yet add the bits to the FBO. + Display.create(format); + stencilBits = 0; + return; + } + try + { + //TODO: Figure out how to determine the max bits. + Display.create(format.withStencilBits(8)); + stencilBits = 8; + } + catch(LWJGLException e) + { + Display.create(format); + stencilBits = 0; + } + } + + //This properly moves the domain, if provided, to the front of the string before concatenating + public static String fixDomain(String base, String complex) + { + int idx = complex.indexOf(':'); + if (idx == -1) + { + return base + complex; + } + + String name = complex.substring(idx + 1, complex.length()); + if (idx > 1) + { + String domain = complex.substring(0, idx); + return domain + ':' + base + name; + } + else + { + return base + name; + } + } + + public static boolean postMouseEvent() + { + return MinecraftForge.EVENT_BUS.post(new MouseEvent()); + } + + public static float getOffsetFOV(EntityPlayerSP entity, float fov) + { + FOVUpdateEvent fovUpdateEvent = new FOVUpdateEvent(entity, fov); + MinecraftForge.EVENT_BUS.post(fovUpdateEvent); + return fovUpdateEvent.newfov; + } + + private static int skyX, skyZ; + + private static boolean skyInit; + private static int skyRGBMultiplier; + + public static int getSkyBlendColour(World world, int playerX, int playerY, int playerZ) + { + if (playerX == skyX && playerZ == skyZ && skyInit) + { + return skyRGBMultiplier; + } + skyInit = true; + + GameSettings settings = Minecraft.getMinecraft().gameSettings; + int[] ranges = ForgeModContainer.blendRanges; + int distance = 0; + if (settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) + { + distance = ranges[settings.renderDistanceChunks]; + } + + int r = 0; + int g = 0; + int b = 0; + + int divider = 0; + for (int x = -distance; x <= distance; ++x) + { + for (int z = -distance; z <= distance; ++z) + { + BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z); + int colour = biome.getSkyColorByTemp(biome.getFloatTemperature(playerX + x, playerY, playerZ + z)); + r += (colour & 0xFF0000) >> 16; + g += (colour & 0x00FF00) >> 8; + b += colour & 0x0000FF; + divider++; + } + } + + int multiplier = (r / divider & 255) << 16 | (g / divider & 255) << 8 | b / divider & 255; + + skyX = playerX; + skyZ = playerZ; + skyRGBMultiplier = multiplier; + return skyRGBMultiplier; + } + /** + * Initialization of Forge Renderers. + */ + static + { + FluidRegistry.renderIdFluid = RenderingRegistry.getNextAvailableRenderId(); + RenderingRegistry.registerBlockHandler(RenderBlockFluid.instance); + } + + public static void renderMainMenu(GuiMainMenu gui, FontRenderer font, int width, int height) + { + Status status = ForgeVersion.getStatus(); + if (status == BETA || status == BETA_OUTDATED) + { + // render a warning at the top of the screen, + String line = I18n.format("forge.update.beta.1", EnumChatFormatting.RED, EnumChatFormatting.RESET); + gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (0 * (font.FONT_HEIGHT + 1)), -1); + line = I18n.format("forge.update.beta.2"); + gui.drawString(font, line, (width - font.getStringWidth(line)) / 2, 4 + (1 * (font.FONT_HEIGHT + 1)), -1); + } + + String line = null; + switch(status) + { + //case FAILED: line = " Version check failed"; break; + //case UP_TO_DATE: line = "Forge up to date"}; break; + //case AHEAD: line = "Using non-recommended Forge build, issues may arise."}; break; + case OUTDATED: + case BETA_OUTDATED: line = I18n.format("forge.update.newversion", ForgeVersion.getTarget()); break; + default: break; + } + + if (line != null) + { + // if we have a line, render it in the bottom right, above Mojang's copyright line + gui.drawString(font, line, width - font.getStringWidth(line) - 2, height - (2 * (font.FONT_HEIGHT + 1)), -1); + } + } + + public static ISound playSound(SoundManager manager, ISound sound) + { + SoundEventAccessorComposite accessor = manager.sndHandler.getSound(sound.getPositionedSoundLocation()); + PlaySoundEvent17 e = new PlaySoundEvent17(manager, sound, (accessor == null ? null : accessor.getSoundCategory())); + MinecraftForge.EVENT_BUS.post(e); + return e.result; + } + + static RenderBlocks worldRendererRB; + static int worldRenderPass; + + public static int getWorldRenderPass() + { + return worldRenderPass; + } + + public static void setWorldRendererRB(RenderBlocks renderBlocks) + { + worldRendererRB = renderBlocks; + } + + public static void onPreRenderWorld(WorldRenderer worldRenderer, int pass) + { + if(worldRendererRB != null) + { + worldRenderPass = pass; + MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Pre(worldRenderer, (ChunkCache)worldRendererRB.blockAccess, worldRendererRB, pass)); + } + } + + public static void onPostRenderWorld(WorldRenderer worldRenderer, int pass) + { + if(worldRendererRB != null) + { + MinecraftForge.EVENT_BUS.post(new RenderWorldEvent.Post(worldRenderer, (ChunkCache)worldRendererRB.blockAccess, worldRendererRB, pass)); + worldRenderPass = -1; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/GuiIngameForge.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/GuiIngameForge.java new file mode 100644 index 0000000..af6b433 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/GuiIngameForge.java @@ -0,0 +1,911 @@ +package net.minecraftforge.client; + +import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.GuiPlayerInfo; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.Direction; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.FoodStats; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class GuiIngameForge extends GuiIngame +{ + //private static final ResourceLocation VIGNETTE = new ResourceLocation("textures/misc/vignette.png"); + private static final ResourceLocation WIDGITS = new ResourceLocation("textures/gui/widgets.png"); + //private static final ResourceLocation PUMPKIN_BLUR = new ResourceLocation("textures/misc/pumpkinblur.png"); + + private static final int WHITE = 0xFFFFFF; + + //Flags to toggle the rendering of certain aspects of the HUD, valid conditions + //must be met for them to render normally. If those conditions are met, but this flag + //is false, they will not be rendered. + public static boolean renderHelmet = true; + public static boolean renderPortal = true; + public static boolean renderHotbar = true; + public static boolean renderCrosshairs = true; + public static boolean renderBossHealth = true; + public static boolean renderHealth = true; + public static boolean renderArmor = true; + public static boolean renderFood = true; + public static boolean renderHealthMount = true; + public static boolean renderAir = true; + public static boolean renderExperiance = true; + public static boolean renderJumpBar = true; + public static boolean renderObjective = true; + + public static int left_height = 39; + public static int right_height = 39; + + private ScaledResolution res = null; + private FontRenderer fontrenderer = null; + private RenderGameOverlayEvent eventParent; + private static final String MC_VERSION = MinecraftForge.MC_VERSION; + + public GuiIngameForge(Minecraft mc) + { + super(mc); + } + + /** + * Render the ingame overlay with quick icon bar, ... + */ + @Override + public void renderGameOverlay(float partialTicks, boolean hasScreen, int mouseX, int mouseY) + { + res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + eventParent = new RenderGameOverlayEvent(partialTicks, res, mouseX, mouseY); + int width = res.getScaledWidth(); + int height = res.getScaledHeight(); + renderHealthMount = mc.thePlayer.ridingEntity instanceof EntityLivingBase; + renderFood = mc.thePlayer.ridingEntity == null; + renderJumpBar = mc.thePlayer.isRidingHorse(); + + right_height = 39; + left_height = 39; + + if (pre(ALL)) return; + + fontrenderer = mc.fontRenderer; + mc.entityRenderer.setupOverlayRendering(); + GL11.glEnable(GL11.GL_BLEND); + + if (Minecraft.isFancyGraphicsEnabled()) + { + renderVignette(mc.thePlayer.getBrightness(partialTicks), width, height); + } + else + { + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + } + + if (renderHelmet) renderHelmet(res, partialTicks, hasScreen, mouseX, mouseY); + + if (renderPortal && !mc.thePlayer.isPotionActive(Potion.confusion)) + { + renderPortal(width, height, partialTicks); + } + + if (!mc.playerController.enableEverythingIsScrewedUpMode()) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + zLevel = -90.0F; + rand.setSeed((long)(updateCounter * 312871)); + + if (renderCrosshairs) renderCrosshairs(width, height); + if (renderBossHealth) renderBossHealth(); + + if (this.mc.playerController.shouldDrawHUD()) + { + if (renderHealth) renderHealth(width, height); + if (renderArmor) renderArmor(width, height); + if (renderFood) renderFood(width, height); + if (renderHealthMount) renderHealthMount(width, height); + if (renderAir) renderAir(width, height); + } + if (renderHotbar) renderHotbar(width, height, partialTicks); + } + + if (renderJumpBar) + { + renderJumpBar(width, height); + } + else if (renderExperiance) + { + renderExperience(width, height); + } + + renderSleepFade(width, height); + renderToolHightlight(width, height); + renderHUDText(width, height); + renderRecordOverlay(width, height, partialTicks); + + ScoreObjective objective = mc.theWorld.getScoreboard().func_96539_a(1); + if (renderObjective && objective != null) + { + this.func_96136_a(objective, height, width, fontrenderer); + } + + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + + renderChat(width, height); + + renderPlayerList(width, height); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + post(ALL); + } + + public ScaledResolution getResolution() + { + return res; + } + + protected void renderHotbar(int width, int height, float partialTicks) + { + if (pre(HOTBAR)) return; + mc.mcProfiler.startSection("actionBar"); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(WIDGITS); + + InventoryPlayer inv = mc.thePlayer.inventory; + drawTexturedModalRect(width / 2 - 91, height - 22, 0, 0, 182, 22); + drawTexturedModalRect(width / 2 - 91 - 1 + inv.currentItem * 20, height - 22 - 1, 0, 22, 24, 22); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + + for (int i = 0; i < 9; ++i) + { + int x = width / 2 - 90 + i * 20 + 2; + int z = height - 16 - 3; + renderInventorySlot(i, x, z, partialTicks); + } + + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + mc.mcProfiler.endSection(); + post(HOTBAR); + } + + protected void renderCrosshairs(int width, int height) + { + if (pre(CROSSHAIRS)) return; + bind(Gui.icons); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + drawTexturedModalRect(width / 2 - 7, height / 2 - 7, 0, 0, 16, 16); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GL11.glDisable(GL11.GL_BLEND); + post(CROSSHAIRS); + } + + /** + * Renders dragon's (boss) health on the HUD + */ + @Override + protected void renderBossHealth() + { + if (pre(BOSSHEALTH)) return; + mc.mcProfiler.startSection("bossHealth"); + GL11.glEnable(GL11.GL_BLEND); + super.renderBossHealth(); + GL11.glDisable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + post(BOSSHEALTH); + } + + private void renderHelmet(ScaledResolution res, float partialTicks, boolean hasScreen, int mouseX, int mouseY) + { + if (pre(HELMET)) return; + + ItemStack itemstack = this.mc.thePlayer.inventory.armorItemInSlot(3); + + if (this.mc.gameSettings.thirdPersonView == 0 && itemstack != null && itemstack.getItem() != null) + { + if (itemstack.getItem() == Item.getItemFromBlock(Blocks.pumpkin)) + { + renderPumpkinBlur(res.getScaledWidth(), res.getScaledHeight()); + } + else + { + itemstack.getItem().renderHelmetOverlay(itemstack, mc.thePlayer, res, partialTicks, hasScreen, mouseX, mouseY); + } + } + + post(HELMET); + } + + protected void renderArmor(int width, int height) + { + if (pre(ARMOR)) return; + mc.mcProfiler.startSection("armor"); + + GL11.glEnable(GL11.GL_BLEND); + int left = width / 2 - 91; + int top = height - left_height; + + int level = ForgeHooks.getTotalArmorValue(mc.thePlayer); + for (int i = 1; level > 0 && i < 20; i += 2) + { + if (i < level) + { + drawTexturedModalRect(left, top, 34, 9, 9, 9); + } + else if (i == level) + { + drawTexturedModalRect(left, top, 25, 9, 9, 9); + } + else if (i > level) + { + drawTexturedModalRect(left, top, 16, 9, 9, 9); + } + left += 8; + } + left_height += 10; + + GL11.glDisable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + post(ARMOR); + } + + protected void renderPortal(int width, int height, float partialTicks) + { + if (pre(PORTAL)) return; + + float f1 = mc.thePlayer.prevTimeInPortal + (mc.thePlayer.timeInPortal - mc.thePlayer.prevTimeInPortal) * partialTicks; + + if (f1 > 0.0F) + { + func_130015_b(f1, width, height); + } + + post(PORTAL); + } + + protected void renderAir(int width, int height) + { + if (pre(AIR)) return; + mc.mcProfiler.startSection("air"); + GL11.glEnable(GL11.GL_BLEND); + int left = width / 2 + 91; + int top = height - right_height; + + if (mc.thePlayer.isInsideOfMaterial(Material.water)) + { + int air = mc.thePlayer.getAir(); + int full = MathHelper.ceiling_double_int((double)(air - 2) * 10.0D / 300.0D); + int partial = MathHelper.ceiling_double_int((double)air * 10.0D / 300.0D) - full; + + for (int i = 0; i < full + partial; ++i) + { + drawTexturedModalRect(left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9); + } + right_height += 10; + } + + GL11.glDisable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + post(AIR); + } + + public void renderHealth(int width, int height) + { + bind(icons); + if (pre(HEALTH)) return; + mc.mcProfiler.startSection("health"); + GL11.glEnable(GL11.GL_BLEND); + + boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1; + + if (mc.thePlayer.hurtResistantTime < 10) + { + highlight = false; + } + + IAttributeInstance attrMaxHealth = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); + int health = MathHelper.ceiling_float_int(mc.thePlayer.getHealth()); + int healthLast = MathHelper.ceiling_float_int(mc.thePlayer.prevHealth); + float healthMax = (float)attrMaxHealth.getAttributeValue(); + float absorb = this.mc.thePlayer.getAbsorptionAmount(); + + int healthRows = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F / 10.0F); + int rowHeight = Math.max(10 - (healthRows - 2), 3); + + this.rand.setSeed((long)(updateCounter * 312871)); + + int left = width / 2 - 91; + int top = height - left_height; + left_height += (healthRows * rowHeight); + if (rowHeight != 10) left_height += 10 - rowHeight; + + int regen = -1; + if (mc.thePlayer.isPotionActive(Potion.regeneration)) + { + regen = updateCounter % 25; + } + + final int TOP = 9 * (mc.theWorld.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0); + final int BACKGROUND = (highlight ? 25 : 16); + int MARGIN = 16; + if (mc.thePlayer.isPotionActive(Potion.poison)) MARGIN += 36; + else if (mc.thePlayer.isPotionActive(Potion.wither)) MARGIN += 72; + float absorbRemaining = absorb; + + for (int i = MathHelper.ceiling_float_int((healthMax + absorb) / 2.0F) - 1; i >= 0; --i) + { + //int b0 = (highlight ? 1 : 0); + int row = MathHelper.ceiling_float_int((float)(i + 1) / 10.0F) - 1; + int x = left + i % 10 * 8; + int y = top - row * rowHeight; + + if (health <= 4) y += rand.nextInt(2); + if (i == regen) y -= 2; + + drawTexturedModalRect(x, y, BACKGROUND, TOP, 9, 9); + + if (highlight) + { + if (i * 2 + 1 < healthLast) + drawTexturedModalRect(x, y, MARGIN + 54, TOP, 9, 9); //6 + else if (i * 2 + 1 == healthLast) + drawTexturedModalRect(x, y, MARGIN + 63, TOP, 9, 9); //7 + } + + if (absorbRemaining > 0.0F) + { + if (absorbRemaining == absorb && absorb % 2.0F == 1.0F) + drawTexturedModalRect(x, y, MARGIN + 153, TOP, 9, 9); //17 + else + drawTexturedModalRect(x, y, MARGIN + 144, TOP, 9, 9); //16 + absorbRemaining -= 2.0F; + } + else + { + if (i * 2 + 1 < health) + drawTexturedModalRect(x, y, MARGIN + 36, TOP, 9, 9); //4 + else if (i * 2 + 1 == health) + drawTexturedModalRect(x, y, MARGIN + 45, TOP, 9, 9); //5 + } + } + + GL11.glDisable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + post(HEALTH); + } + + public void renderFood(int width, int height) + { + if (pre(FOOD)) return; + mc.mcProfiler.startSection("food"); + + GL11.glEnable(GL11.GL_BLEND); + int left = width / 2 + 91; + int top = height - right_height; + right_height += 10; + boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic + + FoodStats stats = mc.thePlayer.getFoodStats(); + int level = stats.getFoodLevel(); + int levelLast = stats.getPrevFoodLevel(); + + for (int i = 0; i < 10; ++i) + { + int idx = i * 2 + 1; + int x = left - i * 8 - 9; + int y = top; + int icon = 16; + byte backgound = 0; + + if (mc.thePlayer.isPotionActive(Potion.hunger)) + { + icon += 36; + backgound = 13; + } + if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this + + if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) + { + y = top + (rand.nextInt(3) - 1); + } + + drawTexturedModalRect(x, y, 16 + backgound * 9, 27, 9, 9); + + if (unused) + { + if (idx < levelLast) + drawTexturedModalRect(x, y, icon + 54, 27, 9, 9); + else if (idx == levelLast) + drawTexturedModalRect(x, y, icon + 63, 27, 9, 9); + } + + if (idx < level) + drawTexturedModalRect(x, y, icon + 36, 27, 9, 9); + else if (idx == level) + drawTexturedModalRect(x, y, icon + 45, 27, 9, 9); + } + GL11.glDisable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + post(FOOD); + } + + protected void renderSleepFade(int width, int height) + { + if (mc.thePlayer.getSleepTimer() > 0) + { + mc.mcProfiler.startSection("sleep"); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_ALPHA_TEST); + int sleepTime = mc.thePlayer.getSleepTimer(); + float opacity = (float)sleepTime / 100.0F; + + if (opacity > 1.0F) + { + opacity = 1.0F - (float)(sleepTime - 100) / 10.0F; + } + + int color = (int)(220.0F * opacity) << 24 | 1052704; + drawRect(0, 0, width, height, color); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_DEPTH_TEST); + mc.mcProfiler.endSection(); + } + } + + protected void renderExperience(int width, int height) + { + bind(icons); + if (pre(EXPERIENCE)) return; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + + if (mc.playerController.gameIsSurvivalOrAdventure()) + { + mc.mcProfiler.startSection("expBar"); + int cap = this.mc.thePlayer.xpBarCap(); + int left = width / 2 - 91; + + if (cap > 0) + { + short barWidth = 182; + int filled = (int)(mc.thePlayer.experience * (float)(barWidth + 1)); + int top = height - 32 + 3; + drawTexturedModalRect(left, top, 0, 64, barWidth, 5); + + if (filled > 0) + { + drawTexturedModalRect(left, top, 0, 69, filled, 5); + } + } + + this.mc.mcProfiler.endSection(); + + + if (mc.playerController.gameIsSurvivalOrAdventure() && mc.thePlayer.experienceLevel > 0) + { + mc.mcProfiler.startSection("expLevel"); + boolean flag1 = false; + int color = flag1 ? 16777215 : 8453920; + String text = "" + mc.thePlayer.experienceLevel; + int x = (width - fontrenderer.getStringWidth(text)) / 2; + int y = height - 31 - 4; + fontrenderer.drawString(text, x + 1, y, 0); + fontrenderer.drawString(text, x - 1, y, 0); + fontrenderer.drawString(text, x, y + 1, 0); + fontrenderer.drawString(text, x, y - 1, 0); + fontrenderer.drawString(text, x, y, color); + mc.mcProfiler.endSection(); + } + } + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + post(EXPERIENCE); + } + + protected void renderJumpBar(int width, int height) + { + bind(icons); + if (pre(JUMPBAR)) return; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + + mc.mcProfiler.startSection("jumpBar"); + float charge = mc.thePlayer.getHorseJumpPower(); + final int barWidth = 182; + int x = (width / 2) - (barWidth / 2); + int filled = (int)(charge * (float)(barWidth + 1)); + int top = height - 32 + 3; + + drawTexturedModalRect(x, top, 0, 84, barWidth, 5); + + if (filled > 0) + { + this.drawTexturedModalRect(x, top, 0, 89, filled, 5); + } + + GL11.glEnable(GL11.GL_BLEND); + mc.mcProfiler.endSection(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + post(JUMPBAR); + } + + protected void renderToolHightlight(int width, int height) + { + if (this.mc.gameSettings.heldItemTooltips) + { + mc.mcProfiler.startSection("toolHighlight"); + + if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) + { + String name = this.highlightingItemStack.getDisplayName(); + + int opacity = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); + if (opacity > 255) opacity = 255; + + if (opacity > 0) + { + int y = height - 59; + if (!mc.playerController.shouldDrawHUD()) y += 14; + + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + FontRenderer font = highlightingItemStack.getItem().getFontRenderer(highlightingItemStack); + if (font != null) + { + int x = (width - font.getStringWidth(name)) / 2; + font.drawStringWithShadow(name, x, y, WHITE | (opacity << 24)); + } + else + { + int x = (width - fontrenderer.getStringWidth(name)) / 2; + fontrenderer.drawStringWithShadow(name, x, y, WHITE | (opacity << 24)); + } + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + mc.mcProfiler.endSection(); + } + } + + protected void renderHUDText(int width, int height) + { + mc.mcProfiler.startSection("forgeHudText"); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + ArrayList left = new ArrayList(); + ArrayList right = new ArrayList(); + + if (mc.isDemo()) + { + long time = mc.theWorld.getTotalWorldTime(); + if (time >= 120500L) + { + right.add(I18n.format("demo.demoExpired")); + } + else + { + right.add(I18n.format("demo.remainingTime", StringUtils.ticksToElapsedTime((int)(120500L - time)))); + } + } + + + if (this.mc.gameSettings.showDebugInfo && !pre(DEBUG)) + { + mc.mcProfiler.startSection("debug"); + GL11.glPushMatrix(); + left.add("Minecraft " + MC_VERSION + " (" + this.mc.debug + ")"); + left.add(mc.debugInfoRenders()); + left.add(mc.getEntityDebug()); + left.add(mc.debugInfoEntities()); + left.add(mc.getWorldProviderName()); + left.add(null); //Spacer + + long max = Runtime.getRuntime().maxMemory(); + long total = Runtime.getRuntime().totalMemory(); + long free = Runtime.getRuntime().freeMemory(); + long used = total - free; + + right.add("Used memory: " + used * 100L / max + "% (" + used / 1024L / 1024L + "MB) of " + max / 1024L / 1024L + "MB"); + right.add("Allocated memory: " + total * 100L / max + "% (" + total / 1024L / 1024L + "MB)"); + + int x = MathHelper.floor_double(mc.thePlayer.posX); + int y = MathHelper.floor_double(mc.thePlayer.posY); + int z = MathHelper.floor_double(mc.thePlayer.posZ); + float yaw = mc.thePlayer.rotationYaw; + int heading = MathHelper.floor_double((double)(mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + left.add(String.format("x: %.5f (%d) // c: %d (%d)", mc.thePlayer.posX, x, x >> 4, x & 15)); + left.add(String.format("y: %.3f (feet pos, %.3f eyes pos)", mc.thePlayer.boundingBox.minY, mc.thePlayer.posY)); + left.add(String.format("z: %.5f (%d) // c: %d (%d)", mc.thePlayer.posZ, z, z >> 4, z & 15)); + left.add(String.format("f: %d (%s) / %f", heading, Direction.directions[heading], MathHelper.wrapAngleTo180_float(yaw))); + + if (mc.theWorld != null && mc.theWorld.blockExists(x, y, z)) + { + Chunk chunk = this.mc.theWorld.getChunkFromBlockCoords(x, z); + left.add(String.format("lc: %d b: %s bl: %d sl: %d rl: %d", + chunk.getTopFilledSegment() + 15, + chunk.getBiomeGenForWorldCoords(x & 15, z & 15, mc.theWorld.getWorldChunkManager()).biomeName, + chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15), + chunk.getSavedLightValue(EnumSkyBlock.Sky, x & 15, y, z & 15), + chunk.getBlockLightValue(x & 15, y, z & 15, 0))); + } + else + { + left.add(null); + } + + left.add(String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", mc.thePlayer.capabilities.getWalkSpeed(), mc.thePlayer.capabilities.getFlySpeed(), mc.thePlayer.onGround, mc.theWorld.getHeightValue(x, z))); + if (mc.entityRenderer != null && mc.entityRenderer.isShaderActive()) + { + left.add(String.format("shader: %s", mc.entityRenderer.getShaderGroup().getShaderGroupName())); + } + + right.add(null); + for (String brand : FMLCommonHandler.instance().getBrandings(false)) + { + right.add(brand); + } + GL11.glPopMatrix(); + mc.mcProfiler.endSection(); + post(DEBUG); + } + + RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(eventParent, left, right); + if (!MinecraftForge.EVENT_BUS.post(event)) + { + for (int x = 0; x < left.size(); x++) + { + String msg = left.get(x); + if (msg == null) continue; + fontrenderer.drawStringWithShadow(msg, 2, 2 + x * 10, WHITE); + } + + for (int x = 0; x < right.size(); x++) + { + String msg = right.get(x); + if (msg == null) continue; + int w = fontrenderer.getStringWidth(msg); + fontrenderer.drawStringWithShadow(msg, width - w - 10, 2 + x * 10, WHITE); + } + } + + mc.mcProfiler.endSection(); + post(TEXT); + } + + protected void renderRecordOverlay(int width, int height, float partialTicks) + { + if (recordPlayingUpFor > 0) + { + mc.mcProfiler.startSection("overlayMessage"); + float hue = (float)recordPlayingUpFor - partialTicks; + int opacity = (int)(hue * 256.0F / 20.0F); + if (opacity > 255) opacity = 255; + + if (opacity > 0) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)(width / 2), (float)(height - 48), 0.0F); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + int color = (recordIsPlaying ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE); + fontrenderer.drawString(recordPlaying, -fontrenderer.getStringWidth(recordPlaying) / 2, -4, color | (opacity << 24)); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + mc.mcProfiler.endSection(); + } + } + + protected void renderChat(int width, int height) + { + mc.mcProfiler.startSection("chat"); + + RenderGameOverlayEvent.Chat event = new RenderGameOverlayEvent.Chat(eventParent, 0, height - 48); + if (MinecraftForge.EVENT_BUS.post(event)) return; + + GL11.glPushMatrix(); + GL11.glTranslatef((float)event.posX, (float)event.posY, 0.0F); + persistantChatGUI.drawChat(updateCounter); + GL11.glPopMatrix(); + + post(CHAT); + + mc.mcProfiler.endSection(); + } + + @SuppressWarnings("unchecked") + protected void renderPlayerList(int width, int height) + { + ScoreObjective scoreobjective = this.mc.theWorld.getScoreboard().func_96539_a(0); + NetHandlerPlayClient handler = mc.thePlayer.sendQueue; + + if (mc.gameSettings.keyBindPlayerList.getIsKeyPressed() && (!mc.isIntegratedServerRunning() || handler.playerInfoList.size() > 1 || scoreobjective != null)) + { + if (pre(PLAYER_LIST)) return; + this.mc.mcProfiler.startSection("playerList"); + List players = (List)handler.playerInfoList; + int maxPlayers = handler.currentServerMaxPlayers; + int rows = maxPlayers; + int columns = 1; + + for (columns = 1; rows > 20; rows = (maxPlayers + columns - 1) / columns) + { + columns++; + } + + int columnWidth = 300 / columns; + + if (columnWidth > 150) + { + columnWidth = 150; + } + + int left = (width - columns * columnWidth) / 2; + byte border = 10; + drawRect(left - 1, border - 1, left + columnWidth * columns, border + 9 * rows, Integer.MIN_VALUE); + + for (int i = 0; i < maxPlayers; i++) + { + int xPos = left + i % columns * columnWidth; + int yPos = border + i / columns * 9; + drawRect(xPos, yPos, xPos + columnWidth - 1, yPos + 8, 553648127); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); + + if (i < players.size()) + { + GuiPlayerInfo player = (GuiPlayerInfo)players.get(i); + ScorePlayerTeam team = mc.theWorld.getScoreboard().getPlayersTeam(player.name); + String displayName = ScorePlayerTeam.formatPlayerName(team, player.name); + fontrenderer.drawStringWithShadow(displayName, xPos, yPos, 16777215); + + if (scoreobjective != null) + { + int endX = xPos + fontrenderer.getStringWidth(displayName) + 5; + int maxX = xPos + columnWidth - 12 - 5; + + if (maxX - endX > 5) + { + Score score = scoreobjective.getScoreboard().func_96529_a(player.name, scoreobjective); + String scoreDisplay = EnumChatFormatting.YELLOW + "" + score.getScorePoints(); + fontrenderer.drawStringWithShadow(scoreDisplay, maxX - fontrenderer.getStringWidth(scoreDisplay), yPos, 16777215); + } + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + mc.getTextureManager().bindTexture(Gui.icons); + int pingIndex = 4; + int ping = player.responseTime; + if (ping < 0) pingIndex = 5; + else if (ping < 150) pingIndex = 0; + else if (ping < 300) pingIndex = 1; + else if (ping < 600) pingIndex = 2; + else if (ping < 1000) pingIndex = 3; + + zLevel += 100.0F; + drawTexturedModalRect(xPos + columnWidth - 12, yPos, 0, 176 + pingIndex * 8, 10, 8); + zLevel -= 100.0F; + } + } + post(PLAYER_LIST); + } + } + + protected void renderHealthMount(int width, int height) + { + Entity tmp = mc.thePlayer.ridingEntity; + if (!(tmp instanceof EntityLivingBase)) return; + + bind(icons); + + if (pre(HEALTHMOUNT)) return; + + boolean unused = false; + int left_align = width / 2 + 91; + + mc.mcProfiler.endStartSection("mountHealth"); + GL11.glEnable(GL11.GL_BLEND); + EntityLivingBase mount = (EntityLivingBase)tmp; + int health = (int)Math.ceil((double)mount.getHealth()); + float healthMax = mount.getMaxHealth(); + int hearts = (int)(healthMax + 0.5F) / 2; + + if (hearts > 30) hearts = 30; + + final int MARGIN = 52; + final int BACKGROUND = MARGIN + (unused ? 1 : 0); + final int HALF = MARGIN + 45; + final int FULL = MARGIN + 36; + + for (int heart = 0; hearts > 0; heart += 20) + { + int top = height - right_height; + + int rowCount = Math.min(hearts, 10); + hearts -= rowCount; + + for (int i = 0; i < rowCount; ++i) + { + int x = left_align - i * 8 - 9; + drawTexturedModalRect(x, top, BACKGROUND, 9, 9, 9); + + if (i * 2 + 1 + heart < health) + drawTexturedModalRect(x, top, FULL, 9, 9, 9); + else if (i * 2 + 1 + heart == health) + drawTexturedModalRect(x, top, HALF, 9, 9, 9); + } + + right_height += 10; + } + GL11.glDisable(GL11.GL_BLEND); + post(HEALTHMOUNT); + } + + //Helper macros + private boolean pre(ElementType type) + { + return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(eventParent, type)); + } + private void post(ElementType type) + { + MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(eventParent, type)); + } + private void bind(ResourceLocation res) + { + mc.getTextureManager().bindTexture(res); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/IItemRenderer.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/IItemRenderer.java new file mode 100644 index 0000000..e4528c4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/IItemRenderer.java @@ -0,0 +1,134 @@ +package net.minecraftforge.client; + +import net.minecraft.item.ItemStack; + +public interface IItemRenderer +{ + public enum ItemRenderType + { + /** + * Called to render an in-world item, e.g. one that has been thrown or + * dropped. The appropriate OpenGL transformations and scaling have already + * been applied, so Tessellator location (0,0,0) is the center of the + * EntityItem. + * + * Data parameters: + * RenderBlocks render - The RenderBlocks instance + * EntityItem entity - The in-world item to be rendered + */ + ENTITY, + + /** + * Called to render an item currently held in-hand by a living entity. If + * rendering as a 3D block, the item will be rotated to a 45-degree angle. + * To render a 2D texture with some thickness (like default items), see + * net.minecraft.src.ItemRenderer. In either case, rendering should be done + * in local coordinates from (0,0,0)-(1,1,1). + * + * Data parameters: + * RenderBlocks render - The RenderBlocks instance + * EntityLiving entity - The entity holding this item + */ + EQUIPPED, + + /** + * Called to render an item currently held in-hand by a living entity in + * first person. If rendering as a 3D block, the item will be rotated to a + * 45-degree angle. To render a 2D texture with some thickness, see + * net.minecraft.src.ItemRenderer. In either case, rendering should be done + * in local coordinates from (0,0,0)-(1,1,1). + * + * Data parameters: + * RenderBlocks render - The RenderBlocks instance + * EntityLiving entity - The entity holding this item + */ + EQUIPPED_FIRST_PERSON, + + /** + * Called to render an item in a GUI inventory slot. If rendering as a 3D + * block, the appropriate OpenGL translations and scaling have already been + * applied, and the rendering should be done in local coordinates from + * (0,0,0)-(1,1,1). If rendering as a 2D texture, the rendering should be in + * GUI pixel coordinates from (0, 0, 0)-(16, 16, 0). + * + * Data parameters: + * RenderBlocks render - The RenderBlocks instance + */ + INVENTORY, + + /** + * The render type used for when a ItemMap is rendered in first person, + * All appropriate rotations have been applied, and the player's hands, + * and the map BG are already rendered. + * + * Data Parameters: + * EntityPlayer player - The player holding the map + * RenderEngine engine - The RenderEngine instance + * MapData mapData - The map data + */ + FIRST_PERSON_MAP + } + + public enum ItemRendererHelper + { + /** + * Determines if a rotation effect should be used when rendering an + * EntityItem, like most default blocks do. + */ + ENTITY_ROTATION, + + /** + * Determines if an up-and-down bobbing effect should be used when + * rendering an EntityItem, like most default items do. + */ + ENTITY_BOBBING, + + /** + * Determines if the currently equipped item should be rendered as a 3D + * block or as a 2D texture. + */ + EQUIPPED_BLOCK, + + /** + * Determines if the item should equate to a block that has + * RenderBlocks.renderItemIn3d return true + */ + BLOCK_3D, + + /** + * Determines if the item should be rendered in GUI inventory slots as a 3D + * block or as a 2D texture. + */ + INVENTORY_BLOCK + } + + /** + * Checks if this renderer should handle a specific item's render type + * @param item The item we are trying to render + * @param type A render type to check if this renderer handles + * @return true if this renderer should handle the given render type, + * otherwise false + */ + public boolean handleRenderType(ItemStack item, ItemRenderType type); + + /** + * Checks if certain helper functionality should be executed for this renderer. + * See ItemRendererHelper for more info + * + * @param type The render type + * @param item The ItemStack being rendered + * @param helper The type of helper functionality to be ran + * @return True to run the helper functionality, false to not. + */ + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper); + + /** + * Called to do the actual rendering, see ItemRenderType for details on when specific + * types are run, and what extra data is passed into the data parameter. + * + * @param type The render type + * @param item The ItemStack being rendered + * @param data Extra Type specific data + */ + public void renderItem(ItemRenderType type, ItemStack item, Object... data); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderContextHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderContextHandler.java new file mode 100644 index 0000000..caaa3dc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderContextHandler.java @@ -0,0 +1,16 @@ +/* + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ +package net.minecraftforge.client; + +public interface IRenderContextHandler +{ + /** Run before the specified rendering context. + */ + public void beforeRenderContext(); + + /** Run after the specified rendering context. + */ + public void afterRenderContext(); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderHandler.java new file mode 100644 index 0000000..f8bf077 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/IRenderHandler.java @@ -0,0 +1,12 @@ +package net.minecraftforge.client; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; + +public abstract class IRenderHandler +{ + @SideOnly(Side.CLIENT) + public abstract void render(float partialTicks, WorldClient world, Minecraft mc); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/MinecraftForgeClient.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/MinecraftForgeClient.java new file mode 100644 index 0000000..0c24085 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/MinecraftForgeClient.java @@ -0,0 +1,88 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.client; + +import java.util.BitSet; +import java.util.IdentityHashMap; + +import com.google.common.collect.Maps; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; + +public class MinecraftForgeClient +{ + private static IdentityHashMap customItemRenderers = Maps.newIdentityHashMap(); + + /** + * Register a custom renderer for a specific item. This can be used to + * render the item in-world as an EntityItem, when the item is equipped, or + * when the item is in an inventory slot. + * @param itemID The item ID (shifted index) to handle rendering. + * @param renderer The IItemRenderer interface that handles rendering for + * this item. + */ + public static void registerItemRenderer(Item item, IItemRenderer renderer) + { + customItemRenderers.put(item, renderer); + } + + public static IItemRenderer getItemRenderer(ItemStack item, ItemRenderType type) + { + IItemRenderer renderer = customItemRenderers.get(item.getItem()); + if (renderer != null && renderer.handleRenderType(item, type)) + { + return renderer; + } + return null; + } + + public static int getRenderPass() + { + return ForgeHooksClient.renderPass; + } + + public static int getStencilBits() + { + return ForgeHooksClient.stencilBits; + } + + + private static BitSet stencilBits = new BitSet(getStencilBits()); + static + { + stencilBits.set(0,getStencilBits()); + } + + /** + * Reserve a stencil bit for use in rendering + * + * @return A bit or -1 if no further stencil bits are available + */ + public static int reserveStencilBit() + { + int bit = stencilBits.nextSetBit(0); + if (bit >= 0) + { + stencilBits.clear(bit); + } + return bit; + } + + /** + * Release the stencil bit for other use + * + * @param bit The bit from {@link #reserveStencilBit()} + */ + public static void releaseStencilBit(int bit) + { + if (bit >= 0 && bit < getStencilBits()) + { + stencilBits.set(bit); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java new file mode 100644 index 0000000..60d494b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/ClientChatReceivedEvent.java @@ -0,0 +1,15 @@ +package net.minecraftforge.client.event; + +import net.minecraft.util.IChatComponent; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +@Cancelable +public class ClientChatReceivedEvent extends Event +{ + public IChatComponent message; + public ClientChatReceivedEvent(IChatComponent message) + { + this.message = message; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java new file mode 100644 index 0000000..fa27b38 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/DrawBlockHighlightEvent.java @@ -0,0 +1,30 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.client.renderer.RenderGlobal; + +@Cancelable +public class DrawBlockHighlightEvent extends Event +{ + public final RenderGlobal context; + public final EntityPlayer player; + public final MovingObjectPosition target; + public final int subID; + public final ItemStack currentItem; + public final float partialTicks; + + public DrawBlockHighlightEvent(RenderGlobal context, EntityPlayer player, MovingObjectPosition target, int subID, ItemStack currentItem, float partialTicks) + { + this.context = context; + this.player = player; + this.target = target; + this.subID = subID; + this.currentItem = currentItem; + this.partialTicks= partialTicks; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/EntityViewRenderEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/EntityViewRenderEvent.java new file mode 100644 index 0000000..4cf5268 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/EntityViewRenderEvent.java @@ -0,0 +1,80 @@ +package net.minecraftforge.client.event; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.entity.EntityLivingBase; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.Result; + +/** + * Event that hooks into EntityRenderer, allowing any feature to customize visual attributes of + * fog the player sees. + */ +public abstract class EntityViewRenderEvent extends Event +{ + public final EntityRenderer renderer; + public final EntityLivingBase entity; + public final Block block; + public final double renderPartialTicks; + + public EntityViewRenderEvent(EntityRenderer renderer, EntityLivingBase entity, Block block, double renderPartialTicks) + { + this.renderer = renderer; + this.entity = entity; + this.block = block; + this.renderPartialTicks = renderPartialTicks; + } + + /** + * Event that allows any feature to customize the fog density the player sees. + * NOTE: In order to make this event have an effect, you must cancel the event + */ + @Cancelable + public static class FogDensity extends EntityViewRenderEvent + { + public float density; + + public FogDensity(EntityRenderer renderer, EntityLivingBase entity, Block block, double renderPartialTicks, float density) + { + super(renderer, entity, block, renderPartialTicks); + this.density = density; + } + } + + /** + * Event that allows any feature to customize the rendering of fog. + */ + @HasResult + public static class RenderFogEvent extends EntityViewRenderEvent + { + public final int fogMode; + public final float farPlaneDistance; + + public RenderFogEvent(EntityRenderer renderer, EntityLivingBase entity, Block block, double renderPartialTicks, int fogMode, float farPlaneDistance) + { + super(renderer, entity, block, renderPartialTicks); + this.fogMode = fogMode; + this.farPlaneDistance = farPlaneDistance; + } + } + + /** + * Event that allows any feature to customize the color of fog the player sees. + * NOTE: Any change made to one of the color variables will affect the result seen in-game. + */ + public static class FogColors extends EntityViewRenderEvent + { + public float red; + public float green; + public float blue; + + public FogColors(EntityRenderer renderer, EntityLivingBase entity, Block block, double renderPartialTicks, float red, float green, float blue) + { + super(renderer, entity, block, renderPartialTicks); + this.red = red; + this.green = green; + this.blue = blue; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/FOVUpdateEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/FOVUpdateEvent.java new file mode 100644 index 0000000..4b6def0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/FOVUpdateEvent.java @@ -0,0 +1,22 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.entity.EntityPlayerSP; + +/** + * Author: MachineMuse (Claire Semple) + * Created: 6:07 PM, 9/5/13 + */ +public class FOVUpdateEvent extends Event +{ + public final EntityPlayerSP entity; + public final float fov; + public float newfov; + + public FOVUpdateEvent(EntityPlayerSP entity, float fov) + { + this.entity = entity; + this.fov = fov; + this.newfov = fov; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiOpenEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiOpenEvent.java new file mode 100644 index 0000000..8f546b2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiOpenEvent.java @@ -0,0 +1,22 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.gui.GuiScreen; + +/** + * This event is called before any Gui will open. + * If you don't want this to happen, cancel the event. + * If you want to override this Gui, simply set the gui variable to your own Gui. + * + * @author jk-5 + */ +@Cancelable +public class GuiOpenEvent extends Event +{ + public GuiScreen gui; + public GuiOpenEvent(GuiScreen gui) + { + this.gui = gui; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiScreenEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiScreenEvent.java new file mode 100644 index 0000000..c1e44ff --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/GuiScreenEvent.java @@ -0,0 +1,179 @@ +package net.minecraftforge.client.event; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Event classes for GuiScreen events. + * + * @author bspkrs + */ +@SideOnly(Side.CLIENT) +public class GuiScreenEvent extends Event +{ + /** + * The GuiScreen object generating this event. + */ + public final GuiScreen gui; + + public GuiScreenEvent(GuiScreen gui) + { + this.gui = gui; + } + + public static class InitGuiEvent extends GuiScreenEvent + { + /** + * The {@code buttonList} field from the GuiScreen object referenced by {@code gui}. + */ + public List buttonList; + + public InitGuiEvent(GuiScreen gui, List buttonList) + { + super(gui); + this.buttonList = buttonList; + } + + /** + * This event fires just after initializing {@code GuiScreen.mc}, {@code GuiScreen.fontRendererObj}, + * {@code GuiScreen.width}, and {@code GuiScreen.height}, and just before calling {@code GuiScreen.buttonList.clear()} + * and {@code GuiScreen.initGui()}. To skip or override a screen's initGui() method cancel the event.

+ * + * If canceled the following lines are skipped in {@code GuiScreen.setWorldAndResolution()}:
+ * {@code this.buttonList.clear();}
+ * {@code this.initGui();}
+ * + * @author bspkrs + */ + @Cancelable + public static class Pre extends InitGuiEvent + { + public Pre(GuiScreen gui, List buttonList) + { + super(gui, buttonList); + } + } + + /** + * This event fires right after {@code GuiScreen.initGui()}. + * This is a good place to alter a GuiScreen's component layout if desired. + * + * @author bspkrs + */ + public static class Post extends InitGuiEvent + { + public Post(GuiScreen gui, List buttonList) + { + super(gui, buttonList); + } + } + } + + public static class DrawScreenEvent extends GuiScreenEvent + { + /** + * The x coordinate of the mouse pointer on the screen. + */ + public final int mouseX; + /** + * The y coordinate of the mouse pointer on the screen. + */ + public final int mouseY; + /** + * Partial render ticks elapsed. + */ + public final float renderPartialTicks; + + public DrawScreenEvent(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks) + { + super(gui); + this.mouseX = mouseX; + this.mouseY = mouseY; + this.renderPartialTicks = renderPartialTicks; + } + + /** + * This event fires just before {@code GuiScreen.drawScreen()} is called. + * Cancel this event to skip {@code GuiScreen.drawScreen()}. + * + * @author bspkrs + */ + @Cancelable + public static class Pre extends DrawScreenEvent + { + public Pre(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks) + { + super(gui, mouseX, mouseY, renderPartialTicks); + } + } + + /** + * This event fires just after {@code GuiScreen.drawScreen()} is called. + * + * @author bspkrs + */ + public static class Post extends DrawScreenEvent + { + public Post(GuiScreen gui, int mouseX, int mouseY, float renderPartialTicks) + { + super(gui, mouseX, mouseY, renderPartialTicks); + } + } + } + + public static class ActionPerformedEvent extends GuiScreenEvent + { + /** + * The button that was clicked. + */ + public GuiButton button; + /** + * A COPY of the {@code buttonList} field from the GuiScreen referenced by {@code gui}. + */ + public List buttonList; + + public ActionPerformedEvent(GuiScreen gui, GuiButton button, List buttonList) + { + super(gui); + this.button = button; + this.buttonList = new ArrayList(buttonList); + } + + /** + * This event fires once it has been determined that a GuiButton object has been clicked. + * Cancel this event to bypass {@code GuiScreen.actionPerformed()}. + * Replace button with a different button from buttonList to have that button's action executed. + * + * @author bspkrs + */ + @Cancelable + public static class Pre extends ActionPerformedEvent + { + public Pre(GuiScreen gui, GuiButton button, List buttonList) + { + super(gui, button, buttonList); + } + } + + /** + * This event fires after {@code GuiScreen.actionPerformed()} provided that the active + * screen has not been changed as a result of {@code GuiScreen.actionPerformed()}. + * + * @author bspkrs + */ + public static class Post extends ActionPerformedEvent + { + public Post(GuiScreen gui, GuiButton button, List buttonList) + { + super(gui, button, buttonList); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/MouseEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/MouseEvent.java new file mode 100644 index 0000000..43b5418 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/MouseEvent.java @@ -0,0 +1,35 @@ +package net.minecraftforge.client.event; + +import org.lwjgl.input.Mouse; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * Author: MachineMuse (Claire Semple) + * Created: 2:46 PM, 9/4/13 + */ +@Cancelable +public class MouseEvent extends Event +{ + public final int x; + public final int y; + public final int dx; + public final int dy; + public final int dwheel; + public final int button; + public final boolean buttonstate; + public final long nanoseconds; + + public MouseEvent() + { + this.x = Mouse.getEventX(); + this.y = Mouse.getEventY(); + this.dx = Mouse.getEventDX(); + this.dy = Mouse.getEventDY(); + this.dwheel = Mouse.getEventDWheel(); + this.button = Mouse.getEventButton(); + this.buttonstate = Mouse.getEventButtonState(); + this.nanoseconds = Mouse.getEventNanoseconds(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java new file mode 100644 index 0000000..78963d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderBlockOverlayEvent.java @@ -0,0 +1,51 @@ +package net.minecraftforge.client.event; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * Called when a block's texture is going to be overlaid on the player's HUD. Cancel this event to prevent the overlay. + */ +@Cancelable +public class RenderBlockOverlayEvent extends Event { + + public static enum OverlayType { + FIRE, BLOCK, WATER + } + + /** + * The player which the overlay will apply to + */ + public final EntityPlayer player; + public final float renderPartialTicks; + /** + * The type of overlay to occur + */ + public final OverlayType overlayType; + /** + * If the overlay type is BLOCK, then this is the block which the overlay is getting it's icon from + */ + public final Block blockForOverlay; + public final int blockX; + public final int blockY; + public final int blockZ; + + public RenderBlockOverlayEvent(EntityPlayer player, float renderPartialTicks, OverlayType type, Block block, int blockX, int blockY, int blockZ) + { + this.player = player; + this.renderPartialTicks = renderPartialTicks; + this.overlayType = type; + if (this.overlayType == OverlayType.BLOCK) + this.blockForOverlay = block; + else + this.blockForOverlay = null; + this.blockX = blockX; + this.blockY = blockY; + this.blockZ = blockZ; + + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java new file mode 100644 index 0000000..c86d6e7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java @@ -0,0 +1,99 @@ +package net.minecraftforge.client.event; + +import java.util.ArrayList; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +import net.minecraft.client.gui.ScaledResolution; + +@Cancelable +public class RenderGameOverlayEvent extends Event +{ + public static enum ElementType + { + ALL, + HELMET, + PORTAL, + CROSSHAIRS, + BOSSHEALTH, + ARMOR, + HEALTH, + FOOD, + AIR, + HOTBAR, + EXPERIENCE, + TEXT, + HEALTHMOUNT, + JUMPBAR, + CHAT, + PLAYER_LIST, + DEBUG + } + + public final float partialTicks; + public final ScaledResolution resolution; + public final int mouseX; + public final int mouseY; + public final ElementType type; + + public RenderGameOverlayEvent(float partialTicks, ScaledResolution resolution, int mouseX, int mouseY) + { + this.partialTicks = partialTicks; + this.resolution = resolution; + this.mouseX = mouseX; + this.mouseY = mouseY; + this.type = null; + } + + private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type) + { + this.partialTicks = parent.partialTicks; + this.resolution = parent.resolution; + this.mouseX = parent.mouseX; + this.mouseY = parent.mouseY; + this.type = type; + } + + public static class Pre extends RenderGameOverlayEvent + { + public Pre(RenderGameOverlayEvent parent, ElementType type) + { + super(parent, type); + } + } + + public static class Post extends RenderGameOverlayEvent + { + public Post(RenderGameOverlayEvent parent, ElementType type) + { + super(parent, type); + } + @Override public boolean isCancelable(){ return false; } + } + + public static class Text extends Pre + { + public final ArrayList left; + public final ArrayList right; + public Text(RenderGameOverlayEvent parent, ArrayList left, ArrayList right) + { + super(parent, ElementType.TEXT); + this.left = left; + this.right = right; + } + } + + public static class Chat extends Pre + { + public int posX; + public int posY; + + public Chat(RenderGameOverlayEvent parent, int posX, int posY) + { + super(parent, ElementType.CHAT); + this.posX = posX; + this.posY = posY; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderHandEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderHandEvent.java new file mode 100644 index 0000000..cb33d02 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderHandEvent.java @@ -0,0 +1,19 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.renderer.RenderGlobal; + +@Cancelable +public class RenderHandEvent extends Event +{ + public final RenderGlobal context; + public final float partialTicks; + public final int renderPass; + public RenderHandEvent(RenderGlobal context, float partialTicks, int renderPass) + { + this.context = context; + this.partialTicks = partialTicks; + this.renderPass = renderPass; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java new file mode 100644 index 0000000..c3b8d7f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderItemInFrameEvent.java @@ -0,0 +1,27 @@ +package net.minecraftforge.client.event; + +import net.minecraft.client.renderer.tileentity.RenderItemFrame; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * This event is called when an item is rendered in an item frame. + * + * You can set canceled to do no further vanilla processing. + */ +@Cancelable +public class RenderItemInFrameEvent extends Event +{ + public final ItemStack item; + public final EntityItemFrame entityItemFrame; + public final RenderItemFrame renderer; + + public RenderItemInFrameEvent(EntityItemFrame itemFrame, RenderItemFrame renderItemFrame) + { + item = itemFrame.getDisplayedItem(); + entityItemFrame = itemFrame; + renderer = renderItemFrame; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderLivingEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderLivingEvent.java new file mode 100644 index 0000000..1f27b9b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderLivingEvent.java @@ -0,0 +1,49 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; + +public abstract class RenderLivingEvent extends Event +{ + public final EntityLivingBase entity; + public final RendererLivingEntity renderer; + public final double x; + public final double y; + public final double z; + + public RenderLivingEvent(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z) + { + this.entity = entity; + this.renderer = renderer; + this.x = x; + this.y = y; + this.z = z; + } + + @Cancelable + public static class Pre extends RenderLivingEvent + { + public Pre(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); } + } + public static class Post extends RenderLivingEvent + { + public Post(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); } + } + + public abstract static class Specials extends RenderLivingEvent + { + public Specials(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); } + + @Cancelable + public static class Pre extends Specials + { + public Pre(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); } + } + public static class Post extends Specials + { + public Post(EntityLivingBase entity, RendererLivingEntity renderer, double x, double y, double z){ super(entity, renderer, x, y, z); } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderPlayerEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderPlayerEvent.java new file mode 100644 index 0000000..dd4885d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderPlayerEvent.java @@ -0,0 +1,70 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.PlayerEvent; + +public abstract class RenderPlayerEvent extends PlayerEvent +{ + public final RenderPlayer renderer; + public final float partialRenderTick; + + public RenderPlayerEvent(EntityPlayer player, RenderPlayer renderer, float partialRenderTick) + { + super(player); + this.renderer = renderer; + this.partialRenderTick = partialRenderTick; + } + + @Cancelable + public static class Pre extends RenderPlayerEvent + { + public Pre(EntityPlayer player, RenderPlayer renderer, float tick){ super(player, renderer, tick); } + } + + public static class Post extends RenderPlayerEvent + { + public Post(EntityPlayer player, RenderPlayer renderer, float tick){ super(player, renderer, tick); } + } + + public abstract static class Specials extends RenderPlayerEvent + { + public Specials(EntityPlayer player, RenderPlayer renderer, float partialTicks) + { + super(player, renderer, partialTicks); + } + + @Cancelable + public static class Pre extends Specials + { + public boolean renderHelmet = true; + public boolean renderCape = true; + public boolean renderItem = true; + public Pre(EntityPlayer player, RenderPlayer renderer, float partialTicks){ super(player, renderer, partialTicks); } + } + + public static class Post extends Specials + { + public Post(EntityPlayer player, RenderPlayer renderer, float partialTicks){ super(player, renderer, partialTicks); } + } + } + + public static class SetArmorModel extends RenderPlayerEvent + { + /** + * Setting this to any value besides -1 will result in the function being + * Immediately exited with the return value specified. + */ + public int result = -1; + public final int slot; + public final ItemStack stack; + public SetArmorModel(EntityPlayer player, RenderPlayer renderer, int slot, float partialTick, ItemStack stack) + { + super(player, renderer, partialTick); + this.slot = slot; + this.stack = stack; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldEvent.java new file mode 100644 index 0000000..1ee4c7c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldEvent.java @@ -0,0 +1,39 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.WorldRenderer; +import net.minecraft.world.ChunkCache; + +public abstract class RenderWorldEvent extends Event +{ + public final WorldRenderer renderer; + public final ChunkCache chunkCache; + public final RenderBlocks renderBlocks; + public final int pass; + + public RenderWorldEvent(WorldRenderer renderer, ChunkCache chunkCache, RenderBlocks renderBlocks, int pass) + { + this.renderer = renderer; + this.chunkCache = chunkCache; + this.renderBlocks = renderBlocks; + this.pass = pass; + } + + /** + * Fired when 16x16x16 chunk area is being redrawn. + * Fired after GL state is setup, before tessellator is started. + */ + public static class Pre extends RenderWorldEvent + { + public Pre(WorldRenderer renderer, ChunkCache chunkCache, RenderBlocks renderBlocks, int pass){ super(renderer, chunkCache, renderBlocks, pass); } + } + + /** + * Fired after the tessellator is stopped, before the display list is ended. + */ + public static class Post extends RenderWorldEvent + { + public Post(WorldRenderer renderer, ChunkCache chunkCache, RenderBlocks renderBlocks, int pass){ super(renderer, chunkCache, renderBlocks, pass); } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldLastEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldLastEvent.java new file mode 100644 index 0000000..0b52bf9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/RenderWorldLastEvent.java @@ -0,0 +1,15 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.renderer.RenderGlobal; + +public class RenderWorldLastEvent extends Event +{ + public final RenderGlobal context; + public final float partialTicks; + public RenderWorldLastEvent(RenderGlobal context, float partialTicks) + { + this.context = context; + this.partialTicks = partialTicks; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/TextureStitchEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/TextureStitchEvent.java new file mode 100644 index 0000000..c1438ce --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/TextureStitchEvent.java @@ -0,0 +1,35 @@ +package net.minecraftforge.client.event; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.renderer.texture.TextureMap; + + +public class TextureStitchEvent extends Event +{ + public final TextureMap map; + + public TextureStitchEvent(TextureMap map) + { + this.map = map; + } + + /** + * Fired when the TextureMap is told to refresh it's stitched texture. + * Called after the Stitched list is cleared, but before any blocks or items + * add themselves to the list. + */ + public static class Pre extends TextureStitchEvent + { + public Pre(TextureMap map){ super(map); } + } + + /** + * This event is fired once the texture map has loaded all textures and + * stitched them together. All Icons should have there locations defined + * by the time this is fired. + */ + public static class Post extends TextureStitchEvent + { + public Post(TextureMap map){ super(map); } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java new file mode 100644 index 0000000..77a2ad8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayBackgroundMusicEvent.java @@ -0,0 +1,16 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +/** + * Raised when the SoundManager tries to play a Background Music file, + * If you return null from this function it will prevent the sound from being played, + * you can return a different entry if you want to change the sound being played. + */ +@Deprecated // Remove in 1.8 +public class PlayBackgroundMusicEvent extends SoundResultEvent +{ + public PlayBackgroundMusicEvent(SoundManager manager, SoundPoolEntry entry) + { super(manager, entry, null, 0.0f, 0.0f); } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java new file mode 100644 index 0000000..591c093 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectEvent.java @@ -0,0 +1,11 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +@Deprecated //Remove in 1.8 +public class PlaySoundEffectEvent extends SoundResultEvent +{ + public PlaySoundEffectEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch) + { super(manager, source, name, volume, pitch); } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java new file mode 100644 index 0000000..85f90cb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEffectSourceEvent.java @@ -0,0 +1,16 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; + +@Deprecated //Remove in 1.8 +public class PlaySoundEffectSourceEvent extends SoundEvent +{ + public final SoundManager manager; + public final String name; + public PlaySoundEffectSourceEvent(SoundManager manager, String name) + { + super(manager); + this.manager = manager; + this.name = name; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java new file mode 100644 index 0000000..5a70ac0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent.java @@ -0,0 +1,25 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +/*** + * Raised when the SoundManager tries to play a normal sound. + * + * If you return null from this function it will prevent the sound from being played, + * you can return a different entry if you want to change the sound being played. + */ +@Deprecated // Switch with PlaySoundEvent17 in 1.8 +public class PlaySoundEvent extends SoundResultEvent +{ + public final float x; + public final float y; + public final float z; + public PlaySoundEvent(SoundManager manager, SoundPoolEntry source, String name, float x, float y, float z, float volume, float pitch) + { + super(manager, source, name, volume, pitch); + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent17.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent17.java new file mode 100644 index 0000000..4085924 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundEvent17.java @@ -0,0 +1,30 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundCategory; +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +/*** + * Raised when the SoundManager tries to play a normal sound. + * + * If you return null from this function it will prevent the sound from being played, + * you can return a different entry if you want to change the sound being played. + */ +//TODO: Replace PlaySoundEvent in 1.8 +public class PlaySoundEvent17 extends SoundEvent +{ + public final String name; + public final ISound sound; + public final SoundCategory category; + public ISound result; + + public PlaySoundEvent17(SoundManager manager, ISound sound, SoundCategory category) + { + super(manager); + this.sound = sound; + this.category = category; + this.name = sound.getPositionedSoundLocation().getResourcePath(); + this.result = sound; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.java new file mode 100644 index 0000000..0bfeeec --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlaySoundSourceEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundManager; +import net.minecraftforge.client.event.sound.SoundEvent.SoundSourceEvent; + +public class PlaySoundSourceEvent extends SoundSourceEvent +{ + @Deprecated + public final SoundManager manager; + @Deprecated + public final String name; + @Deprecated + public final float x; + @Deprecated + public final float y; + @Deprecated + public final float z; + + @Deprecated + public PlaySoundSourceEvent(SoundManager manager, String name, float x, float y, float z) + { + super(manager, null, null); + this.manager = manager; + this.name = name; + this.x = x; + this.y = y; + this.z = z; + } + + public PlaySoundSourceEvent(SoundManager manager, ISound sound, String uuid) + { + super(manager, sound, uuid); + this.name = sound.getPositionedSoundLocation().getResourcePath(); + this.manager = manager; + this.x = this.y = this.z = 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java new file mode 100644 index 0000000..9dda41e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingEvent.java @@ -0,0 +1,27 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +/** + * Raised when the SoundManager tries to play a 'Streaming' file, + * in vanilla it is only the Jukebox that uses this function. + * + * If you return null from this function it will prevent the sound from being played, + * you can return a different entry if you want to change the sound being played. + * + */ +@Deprecated +public class PlayStreamingEvent extends SoundResultEvent +{ + public final float x; + public final float y; + public final float z; + public PlayStreamingEvent(SoundManager manager, SoundPoolEntry source, String name, float x, float y, float z) + { + super(manager, source, name, 0.0f, 0.0f); + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.java new file mode 100644 index 0000000..a04bebe --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/PlayStreamingSourceEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundManager; +import net.minecraftforge.client.event.sound.SoundEvent.SoundSourceEvent; + +public class PlayStreamingSourceEvent extends SoundSourceEvent +{ + @Deprecated + public final SoundManager manager; + @Deprecated + public final String name; + @Deprecated + public final float x; + @Deprecated + public final float y; + @Deprecated + public final float z; + + @Deprecated + public PlayStreamingSourceEvent(SoundManager manager, String name, float x, float y, float z) + { + super(manager, null, null); + this.manager = manager; + this.name = name; + this.x = x; + this.y = y; + this.z = z; + } + + public PlayStreamingSourceEvent(SoundManager manager, ISound sound, String uuid) + { + super(manager, sound, uuid); + this.x = this.y = this.z = 0; + this.manager = null; + this.name = sound.getPositionedSoundLocation().getResourcePath(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundEvent.java new file mode 100644 index 0000000..b232d99 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.client.event.sound; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.client.audio.ISound; +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; +import net.minecraftforge.common.MinecraftForge; + +public class SoundEvent extends Event +{ + public final SoundManager manager; + public SoundEvent(SoundManager manager) + { + this.manager = manager; + } + + @Deprecated + public static SoundPoolEntry getResult(SoundResultEvent event) + { + MinecraftForge.EVENT_BUS.post(event); + return event.result; + } + + public static class SoundSourceEvent extends SoundEvent + { + public final ISound sound; + public final String uuid; + public final String name; + + public SoundSourceEvent(SoundManager manager, ISound sound, String uuid) + { + super(manager); + this.name = sound.getPositionedSoundLocation().getResourcePath(); + this.sound = sound; + this.uuid = uuid; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java new file mode 100644 index 0000000..1f5dc25 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundLoadEvent.java @@ -0,0 +1,18 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; + +/** + * Raised by the SoundManager.loadSoundSettings, this would be a good place for + * adding your custom sounds to the SoundPool. + */ +public class SoundLoadEvent extends SoundEvent +{ + @Deprecated + public final SoundManager manager; + public SoundLoadEvent(SoundManager manager) + { + super(manager); + this.manager = manager; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundResultEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundResultEvent.java new file mode 100644 index 0000000..5cf75d6 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundResultEvent.java @@ -0,0 +1,26 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; +import net.minecraft.client.audio.SoundPoolEntry; + +@Deprecated //Remove in 1.8 +public abstract class SoundResultEvent extends SoundEvent +{ + public final SoundManager manager; + public final SoundPoolEntry source; + public final String name; + public final float volume; + public final float pitch; + public SoundPoolEntry result; + + public SoundResultEvent(SoundManager manager, SoundPoolEntry source, String name, float volume, float pitch) + { + super(manager); + this.manager = manager; + this.source = source; + this.name = name; + this.volume = volume; + this.pitch = pitch; + this.result = source; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java new file mode 100644 index 0000000..9208277 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/event/sound/SoundSetupEvent.java @@ -0,0 +1,18 @@ +package net.minecraftforge.client.event.sound; + +import net.minecraft.client.audio.SoundManager; + +/** + * This event is raised by the SoundManager when it does its first setup of the + * SoundSystemConfig's codecs, use this function to add your own codecs. + */ +public class SoundSetupEvent extends SoundEvent +{ + @Deprecated + public final SoundManager manager; + public SoundSetupEvent(SoundManager manager) + { + super(manager); + this.manager = manager; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/gui/ForgeGuiFactory.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/gui/ForgeGuiFactory.java new file mode 100644 index 0000000..b29121e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/gui/ForgeGuiFactory.java @@ -0,0 +1,352 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.client.gui; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.regex.Pattern; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.I18n; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.ForgeModContainer; +import net.minecraftforge.common.config.ConfigCategory; +import net.minecraftforge.common.config.ConfigElement; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; +import cpw.mods.fml.client.IModGuiFactory; +import cpw.mods.fml.client.IModGuiFactory.RuntimeOptionCategoryElement; +import cpw.mods.fml.client.IModGuiFactory.RuntimeOptionGuiHandler; +import cpw.mods.fml.client.config.ConfigGuiType; +import cpw.mods.fml.client.config.DummyConfigElement; +import cpw.mods.fml.client.config.DummyConfigElement.DummyCategoryElement; +import cpw.mods.fml.client.config.GuiButtonExt; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.GuiConfigEntries; +import cpw.mods.fml.client.config.GuiConfigEntries.CategoryEntry; +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.config.GuiConfigEntries.SelectValueEntry; +import cpw.mods.fml.client.config.GuiConfigEntries.BooleanEntry; +import cpw.mods.fml.client.config.HoverChecker; +import cpw.mods.fml.client.config.IConfigElement; +import cpw.mods.fml.client.config.GuiConfigEntries.ListEntryBase; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * This is the base GuiConfig screen class that all the other Forge-specific config screens will be called from. + * Since Forge has multiple config files I thought I would use that opportunity to show some of the ways + * that the config GUI system can be extended to create custom config GUIs that have additional features + * over the base functionality of just displaying Properties and ConfigCategories. + * + * The concepts implemented here are: + * - using custom IConfigEntry objects to define child-screens that have specific Properties listed + * - using custom IConfigEntry objects to define a dummy property that can be used to generate new ConfigCategory objects + * - defining the configID string for a GuiConfig object so that the config changed events will be posted when that GuiConfig screen is closed + * (the configID string is optional; if it is not defined the config changed events will be posted when the top-most GuiConfig screen + * is closed, eg when the parent is null or is not an instance of GuiConfig) + * - overriding the IConfigEntry.enabled() method to control the enabled state of one list entry based on the value of another entry + * - overriding the IConfigEntry.onGuiClosed() method to perform custom actions when the screen that owns the entry is closed (in this + * case a new ConfigCategory is added to the Configuration object) + * + * The config file structure looks like this: + * forge.cfg (general settings all in one category) + * forgeChunkLoading.cfg + * - Forge (category) + * - defaults (category) + * - [optional mod override categories]... + * + * The GUI structure is this: + * Base Screen + * - General Settings (from forge.cfg) + * - Chunk Loader Settings (from forgeChunkLoading.cfg) + * - Defaults (these elements are listed directly on this screen) + * - Mod Overrides + * - Add New Mod Override + * - Mod1 + * - Mod2 + * - etc. + * + * Other things to check out: + * ForgeModContainer.syncConfig() + * ForgeModContainer.onConfigChanged() + * ForgeChunkManager.syncConfigDefaults() + * ForgeChunkManager.loadConfiguration() + */ +public class ForgeGuiFactory implements IModGuiFactory +{ + @Override + public void initialize(Minecraft minecraftInstance) {} + + @Override + public Class mainConfigGuiClass() { return ForgeConfigGui.class; } + + @Override + public Set runtimeGuiCategories() { return null; } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { return null; } + + public static class ForgeConfigGui extends GuiConfig + { + public ForgeConfigGui(GuiScreen parentScreen) + { + super(parentScreen, getConfigElements(), "Forge", false, false, I18n.format("forge.configgui.forgeConfigTitle")); + } + + private static List getConfigElements() + { + List list = new ArrayList(); + list.add(new DummyCategoryElement("forgeCfg", "forge.configgui.ctgy.forgeGeneralConfig", GeneralEntry.class)); + list.add(new DummyCategoryElement("forgeChunkLoadingCfg", "forge.configgui.ctgy.forgeChunkLoadingConfig", ChunkLoaderEntry.class)); + return list; + } + + /** + * This custom list entry provides the General Settings entry on the Minecraft Forge Configuration screen. + * It extends the base Category entry class and defines the IConfigElement objects that will be used to build the child screen. + */ + public static class GeneralEntry extends CategoryEntry + { + public GeneralEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + @Override + protected GuiScreen buildChildScreen() + { + // This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent + // GuiConfig object's entryList will also be refreshed to reflect the changes. + return new GuiConfig(this.owningScreen, + (new ConfigElement(ForgeModContainer.getConfig().getCategory(Configuration.CATEGORY_GENERAL))).getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ForgeModContainer.getConfig().toString())); + } + } + + /** + * This custom list entry provides the Forge Chunk Manager Config entry on the Minecraft Forge Configuration screen. + * It extends the base Category entry class and defines the IConfigElement objects that will be used to build the child screen. + */ + public static class ChunkLoaderEntry extends CategoryEntry + { + public ChunkLoaderEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + @Override + protected GuiScreen buildChildScreen() + { + List list = new ArrayList(); + + list.add(new DummyCategoryElement("forgeChunkLoadingModCfg", "forge.configgui.ctgy.forgeChunkLoadingModConfig", + ModOverridesEntry.class)); + list.addAll((new ConfigElement(ForgeChunkManager.getDefaultsCategory())).getChildElements()); + + // This GuiConfig object specifies the configID of the object and as such will force-save when it is closed. The parent + // GuiConfig object's propertyList will also be refreshed to reflect the changes. + return new GuiConfig(this.owningScreen, list, this.owningScreen.modID, "chunkLoader", + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ForgeChunkManager.getConfig().toString()), + I18n.format("forge.configgui.ctgy.forgeChunkLoadingConfig")); + } + } + + /** + * This custom list entry provides the Mod Overrides entry on the Forge Chunk Loading config screen. + * It extends the base Category entry class and defines the IConfigElement objects that will be used to build the child screen. + * In this case it adds the custom entry for adding a new mod override and lists the existing mod overrides. + */ + public static class ModOverridesEntry extends CategoryEntry + { + public ModOverridesEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + /** + * This method is called in the constructor and is used to set the childScreen field. + */ + @Override + protected GuiScreen buildChildScreen() + { + List list = new ArrayList(); + + list.add(new DummyCategoryElement("addForgeChunkLoadingModCfg", "forge.configgui.ctgy.forgeChunkLoadingAddModConfig", + AddModOverrideEntry.class)); + for (ConfigCategory cc : ForgeChunkManager.getModCategories()) + list.add(new ConfigElement(cc)); + + return new GuiConfig(this.owningScreen, list, this.owningScreen.modID, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, this.owningScreen.title, + I18n.format("forge.configgui.ctgy.forgeChunkLoadingModConfig")); + } + + /** + * By overriding the enabled() method and checking the value of the "enabled" entry this entry is enabled/disabled based on the value of + * the other entry. + */ + @Override + public boolean enabled() + { + for (IConfigEntry entry : this.owningEntryList.listEntries) + { + if (entry.getName().equals("enabled") && entry instanceof BooleanEntry) + { + return Boolean.valueOf(entry.getCurrentValue().toString()); + } + } + + return true; + } + + /** + * Check to see if the child screen's entry list has changed. + */ + @Override + public boolean isChanged() + { + if (childScreen instanceof GuiConfig) + { + GuiConfig child = (GuiConfig) childScreen; + return child.entryList.listEntries.size() != child.initEntries.size() || child.entryList.hasChangedEntry(true); + } + return false; + } + + /** + * Since adding a new entry to the child screen is what constitutes a change here, reset the child + * screen listEntries to the saved list. + */ + @Override + public void undoChanges() + { + if (childScreen instanceof GuiConfig) + { + GuiConfig child = (GuiConfig) childScreen; + for (IConfigEntry ice : child.entryList.listEntries) + if (!child.initEntries.contains(ice) && ForgeChunkManager.getConfig().hasCategory(ice.getName())) + ForgeChunkManager.getConfig().removeCategory(ForgeChunkManager.getConfig().getCategory(ice.getName())); + + child.entryList.listEntries = new ArrayList(child.initEntries); + } + } + } + + /** + * This custom list entry provides a button that will open to a screen that will allow a user to define a new mod override. + */ + public static class AddModOverrideEntry extends CategoryEntry + { + public AddModOverrideEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + @Override + protected GuiScreen buildChildScreen() + { + List list = new ArrayList(); + + list.add(new DummyConfigElement("modID", "", ConfigGuiType.STRING, "forge.configgui.modID").setCustomListEntryClass(ModIDEntry.class)); + list.add(new ConfigElement(new Property("maximumTicketCount", "200", Property.Type.INTEGER, "forge.configgui.maximumTicketCount"))); + list.add(new ConfigElement(new Property("maximumChunksPerTicket", "25", Property.Type.INTEGER, "forge.configgui.maximumChunksPerTicket"))); + + return new GuiConfig(this.owningScreen, list, this.owningScreen.modID, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, this.owningScreen.title, + I18n.format("forge.configgui.ctgy.forgeChunkLoadingAddModConfig")); + } + + @Override + public boolean isChanged() + { + return false; + } + } + + /** + * This custom list entry provides a Mod ID selector. The control is a button that opens a list of values to select from. + * This entry also overrides onGuiClosed() to run code to save the data to a new ConfigCategory when the user is done. + */ + public static class ModIDEntry extends SelectValueEntry + { + public ModIDEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop, getSelectableValues()); + if (this.selectableValues.size() == 0) + this.btnValue.enabled = false; + } + + private static Map getSelectableValues() + { + Map selectableValues = new TreeMap(); + + for (ModContainer mod : Loader.instance().getActiveModList()) + // only add mods to the list that have a non-immutable ModContainer + if (!mod.isImmutable() && mod.getMod() != null) + selectableValues.put(mod.getModId(), mod.getName()); + + return selectableValues; + } + + /** + * By overriding onGuiClosed() for this entry we can perform additional actions when the user is done such as saving + * a new ConfigCategory object to the Configuration object. + */ + @Override + public void onGuiClosed() + { + Object modObject = Loader.instance().getModObjectList().get(Loader.instance().getIndexedModList().get(currentValue)); + int maxTickets = 200; + int maxChunks = 25; + if (modObject != null) + { + this.owningEntryList.saveConfigElements(); + for(IConfigElement ice : this.owningScreen.configElements) + if ("maximumTicketCount".equals(ice.getName())) + maxTickets = Integer.valueOf(ice.get().toString()); + else if ("maximumChunksPerTicket".equals(ice.getName())) + maxChunks = Integer.valueOf(ice.get().toString()); + + ForgeChunkManager.addConfigProperty(modObject, "maximumTicketCount", String.valueOf(maxTickets), Property.Type.INTEGER); + ForgeChunkManager.addConfigProperty(modObject, "maximumChunksPerTicket", String.valueOf(maxChunks), Property.Type.INTEGER); + + if (this.owningScreen.parentScreen instanceof GuiConfig) + { + GuiConfig superParent = (GuiConfig) this.owningScreen.parentScreen; + ConfigCategory modCtgy = ForgeChunkManager.getConfigFor(modObject); + modCtgy.setPropertyOrder(ForgeChunkManager.MOD_PROP_ORDER); + ConfigElement modConfig = new ConfigElement(modCtgy); + + boolean found = false; + for (IConfigElement ice : superParent.configElements) + if (ice.getName().equals(currentValue)) + found = true; + + if (!found) + superParent.configElements.add(modConfig); + + superParent.needsRefresh = true; + superParent.initGui(); + } + } + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/AdvancedModelLoader.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/AdvancedModelLoader.java new file mode 100644 index 0000000..af5ce13 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/AdvancedModelLoader.java @@ -0,0 +1,79 @@ +package net.minecraftforge.client.model; +// TODO: Move this package to net.minecraftforge.model in 1.8 + +import java.util.Collection; +import java.util.Map; + +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.obj.ObjModelLoader; +import net.minecraftforge.client.model.techne.TechneModelLoader; + +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Common interface for advanced model loading from files, based on file suffix + * Model support can be queried through the {@link #getSupportedSuffixes()} method. + * Instances can be created by calling {@link #loadModel(String)} with a class-loadable-path + * + * @author cpw + * + */ +@SideOnly(Side.CLIENT) +public class AdvancedModelLoader { + private static Map instances = Maps.newHashMap(); + + /** + * Register a new model handler + * @param modelHandler The model handler to register + */ + public static void registerModelHandler(IModelCustomLoader modelHandler) + { + for (String suffix : modelHandler.getSuffixes()) + { + instances.put(suffix, modelHandler); + } + } + + /** + * Load the model from the supplied classpath resolvable resource name + * @param resource The resource name + * @return A model + * @throws IllegalArgumentException if the resource name cannot be understood + * @throws ModelFormatException if the underlying model handler cannot parse the model format + */ + public static IModelCustom loadModel(ResourceLocation resource) throws IllegalArgumentException, ModelFormatException + { + String name = resource.getResourcePath(); + int i = name.lastIndexOf('.'); + if (i == -1) + { + FMLLog.severe("The resource name %s is not valid", resource); + throw new IllegalArgumentException("The resource name is not valid"); + } + String suffix = name.substring(i+1); + IModelCustomLoader loader = instances.get(suffix); + if (loader == null) + { + FMLLog.severe("The resource name %s is not supported", resource); + throw new IllegalArgumentException("The resource name is not supported"); + } + + return loader.loadInstance(resource); + } + + public static Collection getSupportedSuffixes() + { + return instances.keySet(); + } + + + static + { + registerModelHandler(new ObjModelLoader()); + registerModelHandler(new TechneModelLoader()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustom.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustom.java new file mode 100644 index 0000000..11ac82f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustom.java @@ -0,0 +1,17 @@ +package net.minecraftforge.client.model; + +import static cpw.mods.fml.relauncher.Side.CLIENT; +import cpw.mods.fml.relauncher.SideOnly; + +public interface IModelCustom +{ + String getType(); + @SideOnly(CLIENT) + void renderAll(); + @SideOnly(CLIENT) + void renderOnly(String... groupNames); + @SideOnly(CLIENT) + void renderPart(String partName); + @SideOnly(CLIENT) + void renderAllExcept(String... excludedGroupNames); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustomLoader.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustomLoader.java new file mode 100644 index 0000000..78a8c9c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/IModelCustomLoader.java @@ -0,0 +1,29 @@ +package net.minecraftforge.client.model; + +import net.minecraft.util.ResourceLocation; + +/** + * Instances of this class act as factories for their model type + * + * @author cpw + * + */ +public interface IModelCustomLoader { + /** + * Get the main type name for this loader + * @return the type name + */ + String getType(); + /** + * Get resource suffixes this model loader recognizes + * @return a list of suffixes + */ + String[] getSuffixes(); + /** + * Load a model instance from the supplied path + * @param resource The ResourceLocation of the model + * @return A model instance + * @throws ModelFormatException if the model format is not correct + */ + IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException; +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/ModelFormatException.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/ModelFormatException.java new file mode 100644 index 0000000..a8bd24a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/ModelFormatException.java @@ -0,0 +1,33 @@ +package net.minecraftforge.client.model; + +/** + * Thrown if there is a problem parsing the model + * + * @author cpw + * + */ +public class ModelFormatException extends RuntimeException { + + private static final long serialVersionUID = 2023547503969671835L; + + public ModelFormatException() + { + super(); + } + + public ModelFormatException(String message, Throwable cause) + { + super(message, cause); + } + + public ModelFormatException(String message) + { + super(message); + } + + public ModelFormatException(Throwable cause) + { + super(cause); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Face.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Face.java new file mode 100644 index 0000000..bc73325 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Face.java @@ -0,0 +1,84 @@ +package net.minecraftforge.client.model.obj; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.Vec3; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class Face +{ + public Vertex[] vertices; + public Vertex[] vertexNormals; + public Vertex faceNormal; + public TextureCoordinate[] textureCoordinates; + + @SideOnly(Side.CLIENT) + public void addFaceForRender(Tessellator tessellator) + { + addFaceForRender(tessellator, 0.0005F); + } + + @SideOnly(Side.CLIENT) + public void addFaceForRender(Tessellator tessellator, float textureOffset) + { + if (faceNormal == null) + { + faceNormal = this.calculateFaceNormal(); + } + + tessellator.setNormal(faceNormal.x, faceNormal.y, faceNormal.z); + + float averageU = 0F; + float averageV = 0F; + + if ((textureCoordinates != null) && (textureCoordinates.length > 0)) + { + for (int i = 0; i < textureCoordinates.length; ++i) + { + averageU += textureCoordinates[i].u; + averageV += textureCoordinates[i].v; + } + + averageU = averageU / textureCoordinates.length; + averageV = averageV / textureCoordinates.length; + } + + float offsetU, offsetV; + + for (int i = 0; i < vertices.length; ++i) + { + + if ((textureCoordinates != null) && (textureCoordinates.length > 0)) + { + offsetU = textureOffset; + offsetV = textureOffset; + + if (textureCoordinates[i].u > averageU) + { + offsetU = -offsetU; + } + if (textureCoordinates[i].v > averageV) + { + offsetV = -offsetV; + } + + tessellator.addVertexWithUV(vertices[i].x, vertices[i].y, vertices[i].z, textureCoordinates[i].u + offsetU, textureCoordinates[i].v + offsetV); + } + else + { + tessellator.addVertex(vertices[i].x, vertices[i].y, vertices[i].z); + } + } + } + + public Vertex calculateFaceNormal() + { + Vec3 v1 = Vec3.createVectorHelper(vertices[1].x - vertices[0].x, vertices[1].y - vertices[0].y, vertices[1].z - vertices[0].z); + Vec3 v2 = Vec3.createVectorHelper(vertices[2].x - vertices[0].x, vertices[2].y - vertices[0].y, vertices[2].z - vertices[0].z); + Vec3 normalVector = null; + + normalVector = v1.crossProduct(v2).normalize(); + + return new Vertex((float) normalVector.xCoord, (float) normalVector.yCoord, (float) normalVector.zCoord); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/GroupObject.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/GroupObject.java new file mode 100644 index 0000000..e7c1f1e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/GroupObject.java @@ -0,0 +1,54 @@ +package net.minecraftforge.client.model.obj; + +import java.util.ArrayList; + +import net.minecraft.client.renderer.Tessellator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class GroupObject +{ + public String name; + public ArrayList faces = new ArrayList(); + public int glDrawingMode; + + public GroupObject() + { + this(""); + } + + public GroupObject(String name) + { + this(name, -1); + } + + public GroupObject(String name, int glDrawingMode) + { + this.name = name; + this.glDrawingMode = glDrawingMode; + } + + @SideOnly(Side.CLIENT) + public void render() + { + if (faces.size() > 0) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(glDrawingMode); + render(tessellator); + tessellator.draw(); + } + } + + @SideOnly(Side.CLIENT) + public void render(Tessellator tessellator) + { + if (faces.size() > 0) + { + for (Face face : faces) + { + face.addFaceForRender(tessellator); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/ObjModelLoader.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/ObjModelLoader.java new file mode 100644 index 0000000..6ee8ee3 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/ObjModelLoader.java @@ -0,0 +1,29 @@ +package net.minecraftforge.client.model.obj; + +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.client.model.IModelCustomLoader; +import net.minecraftforge.client.model.ModelFormatException; + +public class ObjModelLoader implements IModelCustomLoader +{ + + @Override + public String getType() + { + return "OBJ model"; + } + + private static final String[] types = { "obj" }; + @Override + public String[] getSuffixes() + { + return types; + } + + @Override + public IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException + { + return new WavefrontObject(resource); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/TextureCoordinate.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/TextureCoordinate.java new file mode 100644 index 0000000..a1a257c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/TextureCoordinate.java @@ -0,0 +1,21 @@ +package net.minecraftforge.client.model.obj; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class TextureCoordinate +{ + public float u, v, w; + + public TextureCoordinate(float u, float v) + { + this(u, v, 0F); + } + + public TextureCoordinate(float u, float v, float w) + { + this.u = u; + this.v = v; + this.w = w; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Vertex.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Vertex.java new file mode 100644 index 0000000..4dddeaf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/Vertex.java @@ -0,0 +1,21 @@ +package net.minecraftforge.client.model.obj; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class Vertex +{ + public float x, y, z; + + public Vertex(float x, float y) + { + this(x, y, 0F); + } + + public Vertex(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/WavefrontObject.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/WavefrontObject.java new file mode 100644 index 0000000..dc5b48d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/obj/WavefrontObject.java @@ -0,0 +1,660 @@ +package net.minecraftforge.client.model.obj; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.resources.IResource; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.client.model.ModelFormatException; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * Wavefront Object importer + * Based heavily off of the specifications found at http://en.wikipedia.org/wiki/Wavefront_.obj_file + */ +public class WavefrontObject implements IModelCustom +{ + private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(v( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)"); + private static Pattern vertexNormalPattern = Pattern.compile("(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *\\n)|(vn( (\\-){0,1}\\d+(\\.\\d+)?){3,4} *$)"); + private static Pattern textureCoordinatePattern = Pattern.compile("(vt( (\\-){0,1}\\d+\\.\\d+){2,3} *\\n)|(vt( (\\-){0,1}\\d+(\\.\\d+)?){2,3} *$)"); + private static Pattern face_V_VT_VN_Pattern = Pattern.compile("(f( \\d+/\\d+/\\d+){3,4} *\\n)|(f( \\d+/\\d+/\\d+){3,4} *$)"); + private static Pattern face_V_VT_Pattern = Pattern.compile("(f( \\d+/\\d+){3,4} *\\n)|(f( \\d+/\\d+){3,4} *$)"); + private static Pattern face_V_VN_Pattern = Pattern.compile("(f( \\d+//\\d+){3,4} *\\n)|(f( \\d+//\\d+){3,4} *$)"); + private static Pattern face_V_Pattern = Pattern.compile("(f( \\d+){3,4} *\\n)|(f( \\d+){3,4} *$)"); + private static Pattern groupObjectPattern = Pattern.compile("([go]( [\\w\\d\\.]+) *\\n)|([go]( [\\w\\d\\.]+) *$)"); + + private static Matcher vertexMatcher, vertexNormalMatcher, textureCoordinateMatcher; + private static Matcher face_V_VT_VN_Matcher, face_V_VT_Matcher, face_V_VN_Matcher, face_V_Matcher; + private static Matcher groupObjectMatcher; + + public ArrayList vertices = new ArrayList(); + public ArrayList vertexNormals = new ArrayList(); + public ArrayList textureCoordinates = new ArrayList(); + public ArrayList groupObjects = new ArrayList(); + private GroupObject currentGroupObject; + private String fileName; + + public WavefrontObject(ResourceLocation resource) throws ModelFormatException + { + this.fileName = resource.toString(); + + try + { + IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resource); + loadObjModel(res.getInputStream()); + } + catch (IOException e) + { + throw new ModelFormatException("IO Exception reading model format", e); + } + } + + public WavefrontObject(String filename, InputStream inputStream) throws ModelFormatException + { + this.fileName = filename; + loadObjModel(inputStream); + } + + private void loadObjModel(InputStream inputStream) throws ModelFormatException + { + BufferedReader reader = null; + + String currentLine = null; + int lineCount = 0; + + try + { + reader = new BufferedReader(new InputStreamReader(inputStream)); + + while ((currentLine = reader.readLine()) != null) + { + lineCount++; + currentLine = currentLine.replaceAll("\\s+", " ").trim(); + + if (currentLine.startsWith("#") || currentLine.length() == 0) + { + continue; + } + else if (currentLine.startsWith("v ")) + { + Vertex vertex = parseVertex(currentLine, lineCount); + if (vertex != null) + { + vertices.add(vertex); + } + } + else if (currentLine.startsWith("vn ")) + { + Vertex vertex = parseVertexNormal(currentLine, lineCount); + if (vertex != null) + { + vertexNormals.add(vertex); + } + } + else if (currentLine.startsWith("vt ")) + { + TextureCoordinate textureCoordinate = parseTextureCoordinate(currentLine, lineCount); + if (textureCoordinate != null) + { + textureCoordinates.add(textureCoordinate); + } + } + else if (currentLine.startsWith("f ")) + { + + if (currentGroupObject == null) + { + currentGroupObject = new GroupObject("Default"); + } + + Face face = parseFace(currentLine, lineCount); + + if (face != null) + { + currentGroupObject.faces.add(face); + } + } + else if (currentLine.startsWith("g ") | currentLine.startsWith("o ")) + { + GroupObject group = parseGroupObject(currentLine, lineCount); + + if (group != null) + { + if (currentGroupObject != null) + { + groupObjects.add(currentGroupObject); + } + } + + currentGroupObject = group; + } + } + + groupObjects.add(currentGroupObject); + } + catch (IOException e) + { + throw new ModelFormatException("IO Exception reading model format", e); + } + finally + { + try + { + reader.close(); + } + catch (IOException e) + { + // hush + } + + try + { + inputStream.close(); + } + catch (IOException e) + { + // hush + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderAll() + { + Tessellator tessellator = Tessellator.instance; + + if (currentGroupObject != null) + { + tessellator.startDrawing(currentGroupObject.glDrawingMode); + } + else + { + tessellator.startDrawing(GL11.GL_TRIANGLES); + } + tessellateAll(tessellator); + + tessellator.draw(); + } + + @SideOnly(Side.CLIENT) + public void tessellateAll(Tessellator tessellator) + { + for (GroupObject groupObject : groupObjects) + { + groupObject.render(tessellator); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderOnly(String... groupNames) + { + for (GroupObject groupObject : groupObjects) + { + for (String groupName : groupNames) + { + if (groupName.equalsIgnoreCase(groupObject.name)) + { + groupObject.render(); + } + } + } + } + + @SideOnly(Side.CLIENT) + public void tessellateOnly(Tessellator tessellator, String... groupNames) { + for (GroupObject groupObject : groupObjects) + { + for (String groupName : groupNames) + { + if (groupName.equalsIgnoreCase(groupObject.name)) + { + groupObject.render(tessellator); + } + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderPart(String partName) + { + for (GroupObject groupObject : groupObjects) + { + if (partName.equalsIgnoreCase(groupObject.name)) + { + groupObject.render(); + } + } + } + + @SideOnly(Side.CLIENT) + public void tessellatePart(Tessellator tessellator, String partName) { + for (GroupObject groupObject : groupObjects) + { + if (partName.equalsIgnoreCase(groupObject.name)) + { + groupObject.render(tessellator); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void renderAllExcept(String... excludedGroupNames) + { + for (GroupObject groupObject : groupObjects) + { + boolean skipPart=false; + for (String excludedGroupName : excludedGroupNames) + { + if (excludedGroupName.equalsIgnoreCase(groupObject.name)) + { + skipPart=true; + } + } + if(!skipPart) + { + groupObject.render(); + } + } + } + + @SideOnly(Side.CLIENT) + public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames) + { + boolean exclude; + for (GroupObject groupObject : groupObjects) + { + exclude=false; + for (String excludedGroupName : excludedGroupNames) + { + if (excludedGroupName.equalsIgnoreCase(groupObject.name)) + { + exclude=true; + } + } + if(!exclude) + { + groupObject.render(tessellator); + } + } + } + + private Vertex parseVertex(String line, int lineCount) throws ModelFormatException + { + Vertex vertex = null; + + if (isValidVertexLine(line)) + { + line = line.substring(line.indexOf(" ") + 1); + String[] tokens = line.split(" "); + + try + { + if (tokens.length == 2) + { + return new Vertex(Float.parseFloat(tokens[0]), Float.parseFloat(tokens[1])); + } + else if (tokens.length == 3) + { + return new Vertex(Float.parseFloat(tokens[0]), Float.parseFloat(tokens[1]), Float.parseFloat(tokens[2])); + } + } + catch (NumberFormatException e) + { + throw new ModelFormatException(String.format("Number formatting error at line %d",lineCount), e); + } + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + + return vertex; + } + + private Vertex parseVertexNormal(String line, int lineCount) throws ModelFormatException + { + Vertex vertexNormal = null; + + if (isValidVertexNormalLine(line)) + { + line = line.substring(line.indexOf(" ") + 1); + String[] tokens = line.split(" "); + + try + { + if (tokens.length == 3) + return new Vertex(Float.parseFloat(tokens[0]), Float.parseFloat(tokens[1]), Float.parseFloat(tokens[2])); + } + catch (NumberFormatException e) + { + throw new ModelFormatException(String.format("Number formatting error at line %d",lineCount), e); + } + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + + return vertexNormal; + } + + private TextureCoordinate parseTextureCoordinate(String line, int lineCount) throws ModelFormatException + { + TextureCoordinate textureCoordinate = null; + + if (isValidTextureCoordinateLine(line)) + { + line = line.substring(line.indexOf(" ") + 1); + String[] tokens = line.split(" "); + + try + { + if (tokens.length == 2) + return new TextureCoordinate(Float.parseFloat(tokens[0]), 1 - Float.parseFloat(tokens[1])); + else if (tokens.length == 3) + return new TextureCoordinate(Float.parseFloat(tokens[0]), 1 - Float.parseFloat(tokens[1]), Float.parseFloat(tokens[2])); + } + catch (NumberFormatException e) + { + throw new ModelFormatException(String.format("Number formatting error at line %d",lineCount), e); + } + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + + return textureCoordinate; + } + + private Face parseFace(String line, int lineCount) throws ModelFormatException + { + Face face = null; + + if (isValidFaceLine(line)) + { + face = new Face(); + + String trimmedLine = line.substring(line.indexOf(" ") + 1); + String[] tokens = trimmedLine.split(" "); + String[] subTokens = null; + + if (tokens.length == 3) + { + if (currentGroupObject.glDrawingMode == -1) + { + currentGroupObject.glDrawingMode = GL11.GL_TRIANGLES; + } + else if (currentGroupObject.glDrawingMode != GL11.GL_TRIANGLES) + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Invalid number of points for face (expected 4, found " + tokens.length + ")"); + } + } + else if (tokens.length == 4) + { + if (currentGroupObject.glDrawingMode == -1) + { + currentGroupObject.glDrawingMode = GL11.GL_QUADS; + } + else if (currentGroupObject.glDrawingMode != GL11.GL_QUADS) + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Invalid number of points for face (expected 3, found " + tokens.length + ")"); + } + } + + // f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ... + if (isValidFace_V_VT_VN_Line(line)) + { + face.vertices = new Vertex[tokens.length]; + face.textureCoordinates = new TextureCoordinate[tokens.length]; + face.vertexNormals = new Vertex[tokens.length]; + + for (int i = 0; i < tokens.length; ++i) + { + subTokens = tokens[i].split("/"); + + face.vertices[i] = vertices.get(Integer.parseInt(subTokens[0]) - 1); + face.textureCoordinates[i] = textureCoordinates.get(Integer.parseInt(subTokens[1]) - 1); + face.vertexNormals[i] = vertexNormals.get(Integer.parseInt(subTokens[2]) - 1); + } + + face.faceNormal = face.calculateFaceNormal(); + } + // f v1/vt1 v2/vt2 v3/vt3 ... + else if (isValidFace_V_VT_Line(line)) + { + face.vertices = new Vertex[tokens.length]; + face.textureCoordinates = new TextureCoordinate[tokens.length]; + + for (int i = 0; i < tokens.length; ++i) + { + subTokens = tokens[i].split("/"); + + face.vertices[i] = vertices.get(Integer.parseInt(subTokens[0]) - 1); + face.textureCoordinates[i] = textureCoordinates.get(Integer.parseInt(subTokens[1]) - 1); + } + + face.faceNormal = face.calculateFaceNormal(); + } + // f v1//vn1 v2//vn2 v3//vn3 ... + else if (isValidFace_V_VN_Line(line)) + { + face.vertices = new Vertex[tokens.length]; + face.vertexNormals = new Vertex[tokens.length]; + + for (int i = 0; i < tokens.length; ++i) + { + subTokens = tokens[i].split("//"); + + face.vertices[i] = vertices.get(Integer.parseInt(subTokens[0]) - 1); + face.vertexNormals[i] = vertexNormals.get(Integer.parseInt(subTokens[1]) - 1); + } + + face.faceNormal = face.calculateFaceNormal(); + } + // f v1 v2 v3 ... + else if (isValidFace_V_Line(line)) + { + face.vertices = new Vertex[tokens.length]; + + for (int i = 0; i < tokens.length; ++i) + { + face.vertices[i] = vertices.get(Integer.parseInt(tokens[i]) - 1); + } + + face.faceNormal = face.calculateFaceNormal(); + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + + return face; + } + + private GroupObject parseGroupObject(String line, int lineCount) throws ModelFormatException + { + GroupObject group = null; + + if (isValidGroupObjectLine(line)) + { + String trimmedLine = line.substring(line.indexOf(" ") + 1); + + if (trimmedLine.length() > 0) + { + group = new GroupObject(trimmedLine); + } + } + else + { + throw new ModelFormatException("Error parsing entry ('" + line + "'" + ", line " + lineCount + ") in file '" + fileName + "' - Incorrect format"); + } + + return group; + } + + /*** + * Verifies that the given line from the model file is a valid vertex + * @param line the line being validated + * @return true if the line is a valid vertex, false otherwise + */ + private static boolean isValidVertexLine(String line) + { + if (vertexMatcher != null) + { + vertexMatcher.reset(); + } + + vertexMatcher = vertexPattern.matcher(line); + return vertexMatcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid vertex normal + * @param line the line being validated + * @return true if the line is a valid vertex normal, false otherwise + */ + private static boolean isValidVertexNormalLine(String line) + { + if (vertexNormalMatcher != null) + { + vertexNormalMatcher.reset(); + } + + vertexNormalMatcher = vertexNormalPattern.matcher(line); + return vertexNormalMatcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid texture coordinate + * @param line the line being validated + * @return true if the line is a valid texture coordinate, false otherwise + */ + private static boolean isValidTextureCoordinateLine(String line) + { + if (textureCoordinateMatcher != null) + { + textureCoordinateMatcher.reset(); + } + + textureCoordinateMatcher = textureCoordinatePattern.matcher(line); + return textureCoordinateMatcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid face that is described by vertices, texture coordinates, and vertex normals + * @param line the line being validated + * @return true if the line is a valid face that matches the format "f v1/vt1/vn1 ..." (with a minimum of 3 points in the face, and a maximum of 4), false otherwise + */ + private static boolean isValidFace_V_VT_VN_Line(String line) + { + if (face_V_VT_VN_Matcher != null) + { + face_V_VT_VN_Matcher.reset(); + } + + face_V_VT_VN_Matcher = face_V_VT_VN_Pattern.matcher(line); + return face_V_VT_VN_Matcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid face that is described by vertices and texture coordinates + * @param line the line being validated + * @return true if the line is a valid face that matches the format "f v1/vt1 ..." (with a minimum of 3 points in the face, and a maximum of 4), false otherwise + */ + private static boolean isValidFace_V_VT_Line(String line) + { + if (face_V_VT_Matcher != null) + { + face_V_VT_Matcher.reset(); + } + + face_V_VT_Matcher = face_V_VT_Pattern.matcher(line); + return face_V_VT_Matcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid face that is described by vertices and vertex normals + * @param line the line being validated + * @return true if the line is a valid face that matches the format "f v1//vn1 ..." (with a minimum of 3 points in the face, and a maximum of 4), false otherwise + */ + private static boolean isValidFace_V_VN_Line(String line) + { + if (face_V_VN_Matcher != null) + { + face_V_VN_Matcher.reset(); + } + + face_V_VN_Matcher = face_V_VN_Pattern.matcher(line); + return face_V_VN_Matcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid face that is described by only vertices + * @param line the line being validated + * @return true if the line is a valid face that matches the format "f v1 ..." (with a minimum of 3 points in the face, and a maximum of 4), false otherwise + */ + private static boolean isValidFace_V_Line(String line) + { + if (face_V_Matcher != null) + { + face_V_Matcher.reset(); + } + + face_V_Matcher = face_V_Pattern.matcher(line); + return face_V_Matcher.matches(); + } + + /*** + * Verifies that the given line from the model file is a valid face of any of the possible face formats + * @param line the line being validated + * @return true if the line is a valid face that matches any of the valid face formats, false otherwise + */ + private static boolean isValidFaceLine(String line) + { + return isValidFace_V_VT_VN_Line(line) || isValidFace_V_VT_Line(line) || isValidFace_V_VN_Line(line) || isValidFace_V_Line(line); + } + + /*** + * Verifies that the given line from the model file is a valid group (or object) + * @param line the line being validated + * @return true if the line is a valid group (or object), false otherwise + */ + private static boolean isValidGroupObjectLine(String line) + { + if (groupObjectMatcher != null) + { + groupObjectMatcher.reset(); + } + + groupObjectMatcher = groupObjectPattern.matcher(line); + return groupObjectMatcher.matches(); + } + + @Override + public String getType() + { + return "obj"; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModel.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModel.java new file mode 100644 index 0000000..211f14a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModel.java @@ -0,0 +1,365 @@ +package net.minecraftforge.client.model.techne; + +import java.awt.Dimension; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipInputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.resources.IResource; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.client.model.ModelFormatException; + +/** + * Techne model importer, based on iChun's Hats importer + */ +@SideOnly(Side.CLIENT) +public class TechneModel extends ModelBase implements IModelCustom { + public static final List cubeTypes = Arrays.asList( + "d9e621f7-957f-4b77-b1ae-20dcd0da7751", + "de81aa14-bd60-4228-8d8d-5238bcd3caaa" + ); + + private String fileName; + private Map zipContents = new HashMap(); + + private Map parts = new LinkedHashMap(); + private String texture = null; + private Dimension textureDims = null; + private int textureName; + private boolean textureNameSet = false; + + public TechneModel(ResourceLocation resource) throws ModelFormatException + { + this.fileName = resource.toString(); + + try + { + IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resource); + loadTechneModel(res.getInputStream()); + } + catch (IOException e) + { + throw new ModelFormatException("IO Exception reading model format", e); + } + } + + private void loadTechneModel(InputStream stream) throws ModelFormatException + { + try + { + ZipInputStream zipInput = new ZipInputStream(stream); + + ZipEntry entry; + while ((entry = zipInput.getNextEntry()) != null) + { + byte[] data = new byte[(int) entry.getSize()]; + // For some reason, using read(byte[]) makes reading stall upon reaching a 0x1E byte + int i = 0; + while (zipInput.available() > 0 && i < data.length) + { + data[i++] = (byte)zipInput.read(); + } + zipContents.put(entry.getName(), data); + } + + byte[] modelXml = zipContents.get("model.xml"); + if (modelXml == null) + { + throw new ModelFormatException("Model " + fileName + " contains no model.xml file"); + } + + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document document = documentBuilder.parse(new ByteArrayInputStream(modelXml)); + + NodeList nodeListTechne = document.getElementsByTagName("Techne"); + if (nodeListTechne.getLength() < 1) + { + throw new ModelFormatException("Model " + fileName + " contains no Techne tag"); + } + + NodeList nodeListModel = document.getElementsByTagName("Model"); + if (nodeListModel.getLength() < 1) + { + throw new ModelFormatException("Model " + fileName + " contains no Model tag"); + } + + NamedNodeMap modelAttributes = nodeListModel.item(0).getAttributes(); + if (modelAttributes == null) + { + throw new ModelFormatException("Model " + fileName + " contains a Model tag with no attributes"); + } + + Node modelTexture = modelAttributes.getNamedItem("texture"); + if (modelTexture != null) + { + texture = modelTexture.getTextContent(); + } + + NodeList textureDim = document.getElementsByTagName("TextureSize"); + if (textureDim.getLength() > 0) + { + try + { + String[] tmp = textureDim.item(0).getTextContent().split(","); + if (tmp.length == 2) + { + this.textureDims = new Dimension(Integer.parseInt(tmp[0]), Integer.parseInt(tmp[1])); + } + } + catch (NumberFormatException e) + { + throw new ModelFormatException("Model " + fileName + " contains a TextureSize tag with invalid data"); + } + } + + NodeList shapes = document.getElementsByTagName("Shape"); + for (int i = 0; i < shapes.getLength(); i++) + { + Node shape = shapes.item(i); + NamedNodeMap shapeAttributes = shape.getAttributes(); + if (shapeAttributes == null) + { + throw new ModelFormatException("Shape #" + (i + 1) + " in " + fileName + " has no attributes"); + } + + Node name = shapeAttributes.getNamedItem("name"); + String shapeName = null; + if (name != null) + { + shapeName = name.getNodeValue(); + } + if (shapeName == null) + { + shapeName = "Shape #" + (i + 1); + } + + String shapeType = null; + Node type = shapeAttributes.getNamedItem("type"); + if (type != null) + { + shapeType = type.getNodeValue(); + } + if (shapeType != null && !cubeTypes.contains(shapeType)) + { + FMLLog.warning("Model shape [" + shapeName + "] in " + fileName + " is not a cube, ignoring"); + continue; + } + + try + { + boolean mirrored = false; + String[] offset = new String[3]; + String[] position = new String[3]; + String[] rotation = new String[3]; + String[] size = new String[3]; + String[] textureOffset = new String[2]; + + NodeList shapeChildren = shape.getChildNodes(); + for (int j = 0; j < shapeChildren.getLength(); j++) + { + Node shapeChild = shapeChildren.item(j); + + String shapeChildName = shapeChild.getNodeName(); + String shapeChildValue = shapeChild.getTextContent(); + if (shapeChildValue != null) + { + shapeChildValue = shapeChildValue.trim(); + + if (shapeChildName.equals("IsMirrored")) + { + mirrored = !shapeChildValue.equals("False"); + } + else if (shapeChildName.equals("Offset")) + { + offset = shapeChildValue.split(","); + } + else if (shapeChildName.equals("Position")) + { + position = shapeChildValue.split(","); + } + else if (shapeChildName.equals("Rotation")) + { + rotation = shapeChildValue.split(","); + } + else if (shapeChildName.equals("Size")) + { + size = shapeChildValue.split(","); + } + else if (shapeChildName.equals("TextureOffset")) + { + textureOffset = shapeChildValue.split(","); + } + } + } + + // That's what the ModelBase subclassing is needed for + ModelRenderer cube = new ModelRenderer(this, Integer.parseInt(textureOffset[0]), Integer.parseInt(textureOffset[1])); + cube.mirror = mirrored; + cube.addBox(Float.parseFloat(offset[0]), Float.parseFloat(offset[1]), Float.parseFloat(offset[2]), Integer.parseInt(size[0]), Integer.parseInt(size[1]), Integer.parseInt(size[2])); + cube.setRotationPoint(Float.parseFloat(position[0]), Float.parseFloat(position[1]) - 23.4F, Float.parseFloat(position[2])); + + cube.rotateAngleX = (float)Math.toRadians(Float.parseFloat(rotation[0])); + cube.rotateAngleY = (float)Math.toRadians(Float.parseFloat(rotation[1])); + cube.rotateAngleZ = (float)Math.toRadians(Float.parseFloat(rotation[2])); + + if (this.textureDims != null) + { + cube.setTextureSize((int)textureDims.getWidth(), (int)textureDims.getHeight()); + } + + parts.put(shapeName, cube); + } + catch (NumberFormatException e) + { + FMLLog.warning("Model shape [" + shapeName + "] in " + fileName + " contains malformed integers within its data, ignoring"); + e.printStackTrace(); + } + } + } + catch (ZipException e) + { + throw new ModelFormatException("Model " + fileName + " is not a valid zip file"); + } + catch (IOException e) + { + throw new ModelFormatException("Model " + fileName + " could not be read", e); + } + catch (ParserConfigurationException e) + { + // hush + } + catch (SAXException e) + { + throw new ModelFormatException("Model " + fileName + " contains invalid XML", e); + } + } + + private void bindTexture() + { + /* TODO: Update to 1.6 + if (texture != null) + { + if (!textureNameSet) + { + try + { + byte[] textureEntry = zipContents.get(texture); + if (textureEntry == null) + { + throw new ModelFormatException("Model " + fileName + " has no such texture " + texture); + } + + BufferedImage image = ImageIO.read(new ByteArrayInputStream(textureEntry)); + textureName = Minecraft.getMinecraft().renderEngine.allocateAndSetupTexture(image); + textureNameSet = true; + } + catch (ZipException e) + { + throw new ModelFormatException("Model " + fileName + " is not a valid zip file"); + } + catch (IOException e) + { + throw new ModelFormatException("Texture for model " + fileName + " could not be read", e); + } + } + + if (textureNameSet) + { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureName); + Minecraft.getMinecraft().renderEngine.resetBoundTexture(); + } + } + */ + } + + @Override + public String getType() + { + return "tcn"; + } + + @Override + public void renderAll() + { + bindTexture(); + + for (ModelRenderer part : parts.values()) + { + part.renderWithRotation(1.0F); + } + } + + @Override + public void renderPart(String partName) + { + ModelRenderer part = parts.get(partName); + if (part != null) + { + bindTexture(); + + part.renderWithRotation(1.0F); + } + } + + @Override + public void renderOnly(String... groupNames) + { + bindTexture(); + for (ModelRenderer part : parts.values()) + { + for (String groupName : groupNames) + { + if (groupName.equalsIgnoreCase(part.boxName)) + { + part.render(1.0f); + } + } + } + } + + @Override + public void renderAllExcept(String... excludedGroupNames) + { + for (ModelRenderer part : parts.values()) + { + boolean skipPart=false; + for (String excludedGroupName : excludedGroupNames) + { + if (excludedGroupName.equalsIgnoreCase(part.boxName)) + { + skipPart=true; + } + } + if(!skipPart) + { + part.render(1.0f); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModelLoader.java b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModelLoader.java new file mode 100644 index 0000000..4527e0e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/client/model/techne/TechneModelLoader.java @@ -0,0 +1,29 @@ +package net.minecraftforge.client.model.techne; + +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.client.model.IModelCustomLoader; +import net.minecraftforge.client.model.ModelFormatException; + +public class TechneModelLoader implements IModelCustomLoader { + + @Override + public String getType() + { + return "Techne model"; + } + + private static final String[] types = { "tcn" }; + @Override + public String[] getSuffixes() + { + return types; + } + + @Override + public IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException + { + return new TechneModel(resource); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/AchievementPage.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/AchievementPage.java new file mode 100644 index 0000000..1530f6e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/AchievementPage.java @@ -0,0 +1,108 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import net.minecraft.stats.Achievement; + +public class AchievementPage +{ + private String name; + private LinkedList achievements; + + public AchievementPage(String name, Achievement... achievements) + { + this.name = name; + this.achievements = new LinkedList(Arrays.asList(achievements)); + } + + public String getName() + { + return name; + } + + public List getAchievements() + { + return achievements; + } + + private static LinkedList achievementPages = new LinkedList(); + + /** + * Registers an achievement page. + * @param page The page. + */ + public static void registerAchievementPage(AchievementPage page) + { + if (getAchievementPage(page.getName()) != null) + { + throw new RuntimeException("Duplicate achievement page name \"" + page.getName() + "\"!"); + } + achievementPages.add(page); + } + + /** + * Will return an achievement page by its index on the list. + * @param index The page's index. + * @return the achievement page corresponding to the index or null if invalid index + */ + public static AchievementPage getAchievementPage(int index) + { + return achievementPages.get(index); + } + + /** + * Will return an achievement page by its name. + * @param name The page's name. + * @return the achievement page with the given name or null if no such page + */ + public static AchievementPage getAchievementPage(String name) + { + for (AchievementPage page : achievementPages) + { + if (page.getName().equals(name)) + { + return page; + } + } + return null; + } + + /** + * Will return the list of achievement pages. + * @return the list's size + */ + public static Set getAchievementPages() + { + return new HashSet(achievementPages); + } + + /** + * Will return whether an achievement is in any page or not. + * @param achievement The achievement. + */ + public static boolean isAchievementInPages(Achievement achievement) + { + for (AchievementPage page : achievementPages) + { + if (page.getAchievements().contains(achievement)) + { + return true; + } + } + return false; + } + + public static String getTitle(int index) + { + return index == -1 ? "Minecraft" : getAchievementPage(index).getName(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeDictionary.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeDictionary.java new file mode 100644 index 0000000..df9ce44 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeDictionary.java @@ -0,0 +1,500 @@ +package net.minecraftforge.common; + +import java.util.*; + +import cpw.mods.fml.common.FMLLog; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.*; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.event.terraingen.DeferredBiomeDecorator; +import static net.minecraft.world.biome.BiomeGenBase.*; +import static net.minecraftforge.common.BiomeDictionary.Type.*; + +public class BiomeDictionary +{ + public enum Type + { + /*Temperature-based tags. Specifying neither implies a biome is temperate*/ + HOT, + COLD, + /*Tags specifying the amount of vegetation a biome has. Specifying neither implies a biome to have moderate amounts*/ + SPARSE, + DENSE, + /*Tags specifying how moist a biome is. Specifying neither implies the biome as having moderate humidity*/ + WET, + DRY, + /*Tree-based tags, SAVANNA refers to dry, desert-like trees (Such as Acacia), CONIFEROUS refers to snowy trees (Such as Spruce) and JUNGLE refers to jungle trees. + * Specifying no tag implies a biome has temperate trees (Such as Oak)*/ + SAVANNA, + CONIFEROUS, + JUNGLE, + + /*Tags specifying the nature of a biome*/ + SPOOKY, + DEAD, + LUSH, + NETHER, + END, + MUSHROOM, + MAGICAL, + + OCEAN, + RIVER, + /**A general tag for all water-based biomes. Shown as present if OCEAN or RIVER are.**/ + WATER(OCEAN, RIVER), + + /*Generic types which a biome can be*/ + MESA, + FOREST, + PLAINS, + MOUNTAIN, + HILLS, + SWAMP, + SANDY, + SNOWY, + WASTELAND, + BEACH, + + /*Deprecated tags, kept for compatibility*/ + @Deprecated + /**Replaced by SANDY**/ + DESERT(SANDY), + @Deprecated + /**Replaced by SNOWY**/ + FROZEN(SNOWY); + + private List subTags; + + private Type(Type... subTags) + { + this.subTags = Arrays.asList(subTags); + } + + private boolean hasSubTags() + { + return subTags != null && !subTags.isEmpty(); + } + + /** + * Retrieves a Type value by name, + * if one does not exist already it creates one. + * This can be used as interm measure for modders to + * add there own category of Biome. + * + * There are NO naming conventions besides: + * MUST be all upper case (enforced by name.toUpper()) + * NO Special characters. {Unenforced, just don't be a pain, if it becomes a issue I WILL + * make this RTE with no worry about backwards compatibility} + * + * Note: For performance sake, the return value of this function SHOULD be cached. + * Two calls with the same name SHOULD return the same value. + * + * + * @param name The name of this Type + * @return An instance of Type for this name. + */ + public static Type getType(String name, Type... subTypes) + { + name = name.toUpperCase(); + for (Type t : values()) + { + if (t.name().equals(name)) + return t; + } + Type ret = EnumHelper.addEnum(Type.class, name, new Class[]{Type[].class}, new Object[]{subTypes}); + if (ret.ordinal() >= typeInfoList.length) + { + typeInfoList = Arrays.copyOf(typeInfoList, ret.ordinal()); + } + return ret; + } + } + + private static final int BIOME_LIST_SIZE = BiomeGenBase.getBiomeGenArray().length; + private static BiomeInfo[] biomeList = new BiomeInfo[BIOME_LIST_SIZE]; + @SuppressWarnings("unchecked") + private static ArrayList[] typeInfoList = new ArrayList[Type.values().length]; + + private static class BiomeInfo + { + public EnumSet typeList; + + public BiomeInfo(Type[] types) + { + typeList = EnumSet.noneOf(Type.class); + for(Type t : types) + { + typeList.add(t); + } + } + } + + static + { + registerVanillaBiomes(); + } + + /** + * Registers a biome with a specific biome type + * + * @param biome the biome to be registered + * @param type the type to register the biome as + * @return returns true if the biome was registered successfully + */ + public static boolean registerBiomeType(BiomeGenBase biome, Type ... types) + { + types = listSubTags(types); + + if(BiomeGenBase.getBiomeGenArray()[biome.biomeID] != null) + { + for(Type type : types) + { + if(typeInfoList[type.ordinal()] == null) + { + typeInfoList[type.ordinal()] = new ArrayList(); + } + + typeInfoList[type.ordinal()].add(biome); + } + + if(biomeList[biome.biomeID] == null) + { + biomeList[biome.biomeID] = new BiomeInfo(types); + } + else + { + for(Type type : types) + { + biomeList[biome.biomeID].typeList.add(type); + } + } + + return true; + } + + return false; + } + + /** + * Returns a list of biomes registered with a specific type + * + * @param type the Type to look for + * @return a list of biomes of the specified type, null if there are none + */ + public static BiomeGenBase[] getBiomesForType(Type type) + { + if(typeInfoList[type.ordinal()] != null) + { + return (BiomeGenBase[])typeInfoList[type.ordinal()].toArray(new BiomeGenBase[0]); + } + + return new BiomeGenBase[0]; + } + + /** + * Gets a list of Types that a specific biome is registered with + * + * @param biome the biome to check + * @return the list of types, null if there are none + */ + public static Type[] getTypesForBiome(BiomeGenBase biome) + { + checkRegistration(biome); + + if(biomeList[biome.biomeID] != null) + { + return (Type[])biomeList[biome.biomeID].typeList.toArray(new Type[0]); + } + + return new Type[0]; + } + + /** + * Checks to see if two biomes are registered as having the same type + * + * @param biomeA + * @param biomeB + * @return returns true if a common type is found, false otherwise + */ + public static boolean areBiomesEquivalent(BiomeGenBase biomeA, BiomeGenBase biomeB) + { + int a = biomeA.biomeID; + int b = biomeB.biomeID; + + checkRegistration(biomeA); + checkRegistration(biomeB); + + if(biomeList[a] != null && biomeList[b] != null) + { + for(Type type : biomeList[a].typeList) + { + if(containsType(biomeList[b], type)) + { + return true; + } + } + } + + return false; + } + + /** + * Checks to see if the given biome is registered as being a specific type + * + * @param biome the biome to be considered + * @param type the type to check for + * @return returns true if the biome is registered as being of type type, false otherwise + */ + public static boolean isBiomeOfType(BiomeGenBase biome, Type type) + { + checkRegistration(biome); + + if(biomeList[biome.biomeID] != null) + { + return containsType(biomeList[biome.biomeID], type); + } + + return false; + } + + /** + * Checks to see if the given biome has been registered as being of any type + * @param biome the biome to consider + * @return returns true if the biome has been registered, false otherwise + */ + public static boolean isBiomeRegistered(BiomeGenBase biome) + { + return biomeList[biome.biomeID] != null; + } + + public static boolean isBiomeRegistered(int biomeID) + { + return biomeList[biomeID] != null; + } + + public static void registerAllBiomes() + { + FMLLog.warning("Redundant call to BiomeDictionary.registerAllBiomes ignored"); + } + /** + * Loops through the biome list and automatically adds tags to any biome that does not have any + * This is called by Forge at postinit time. It will additionally dispatch any deferred decorator + * creation events. + * + * DO NOT call this during world generation + */ + public static void registerAllBiomesAndGenerateEvents() + { + for(int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) + { + BiomeGenBase biome = BiomeGenBase.getBiomeGenArray()[i]; + + if(biome == null) + { + continue; + } + + if (biome.theBiomeDecorator instanceof DeferredBiomeDecorator) + { + DeferredBiomeDecorator decorator = (DeferredBiomeDecorator) biome.theBiomeDecorator; + decorator.fireCreateEventAndReplace(biome); + } + + checkRegistration(biome); + } + } + + /** + * Automatically looks for and registers a given biome with appropriate tags + * This method is called automatically if a biome has not been registered with any tags, + * And another method requests information about it + * + * @param biome the biome to be considered + */ + public static void makeBestGuess(BiomeGenBase biome) + { + if (biome.theBiomeDecorator.treesPerChunk >= 3) + { + if (biome.isHighHumidity() && biome.temperature >= 0.9F) + { + BiomeDictionary.registerBiomeType(biome, JUNGLE); + } + else if (!biome.isHighHumidity()) + { + BiomeDictionary.registerBiomeType(biome, FOREST); + + if (biome.temperature <= 0.2f) + { + BiomeDictionary.registerBiomeType(biome, CONIFEROUS); + } + } + } + else if(biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F) + { + if(!biome.isHighHumidity() || biome.rootHeight >= 0.0F) + { + BiomeDictionary.registerBiomeType(biome, PLAINS); + } + } + + if (biome.rainfall > 0.85f) + { + BiomeDictionary.registerBiomeType(biome, WET); + } + + if (biome.rainfall < 0.15f) + { + BiomeDictionary.registerBiomeType(biome, DRY); + } + + if (biome.temperature > 0.85f) + { + BiomeDictionary.registerBiomeType(biome, HOT); + } + + if (biome.temperature < 0.15f) + { + BiomeDictionary.registerBiomeType(biome, COLD); + } + + if (biome.theBiomeDecorator.treesPerChunk > 0 && biome.theBiomeDecorator.treesPerChunk < 3) + { + BiomeDictionary.registerBiomeType(biome, SPARSE); + } + else if (biome.theBiomeDecorator.treesPerChunk >= 10) + { + BiomeDictionary.registerBiomeType(biome, DENSE); + } + + if (biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)) + { + BiomeDictionary.registerBiomeType(biome, SWAMP); + } + + if (biome.rootHeight <= -0.5F) + { + if (biome.heightVariation == 0.0F) + { + BiomeDictionary.registerBiomeType(biome, RIVER); + } + else + { + BiomeDictionary.registerBiomeType(biome, OCEAN); + } + } + + if (biome.heightVariation >= 0.4F && biome.heightVariation < 1.5F) + { + BiomeDictionary.registerBiomeType(biome, HILLS); + } + + if (biome.heightVariation >= 1.5F) + { + BiomeDictionary.registerBiomeType(biome, MOUNTAIN); + } + + if (biome.getEnableSnow()) + { + BiomeDictionary.registerBiomeType(biome, SNOWY); + } + + if (biome.topBlock != Blocks.sand && biome.temperature >= 1.0f && biome.rainfall < 0.2f) + { + BiomeDictionary.registerBiomeType(biome, SAVANNA); + } + + if (biome.topBlock == Blocks.sand ) + { + BiomeDictionary.registerBiomeType(biome, SANDY); + } + else if (biome.topBlock == Blocks.hardened_clay) + { + BiomeDictionary.registerBiomeType(biome, MESA); + } + else if (biome.topBlock == Blocks.mycelium) + { + BiomeDictionary.registerBiomeType(biome, MUSHROOM); + } + } + + //Internal implementation + private static void checkRegistration(BiomeGenBase biome) + { + if(!isBiomeRegistered(biome)) + { + makeBestGuess(biome); + } + } + + private static boolean containsType(BiomeInfo info, Type type) + { + if (type.hasSubTags()) + { + for (Type remappedType : listSubTags(type)) + { + if (info.typeList.contains(remappedType)) return true; + } + + return false; + } + + return info.typeList.contains(type); + } + + private static Type[] listSubTags(Type... types) + { + List subTags = new ArrayList(); + + for (Type type : types) + { + if (type.hasSubTags()) subTags.addAll(type.subTags); + else subTags.add(type); + } + + return subTags.toArray(new Type[subTags.size()]); + } + + private static void registerVanillaBiomes() + { + registerBiomeType(ocean, OCEAN ); + registerBiomeType(plains, PLAINS ); + registerBiomeType(desert, HOT, DRY, SANDY ); + registerBiomeType(extremeHills, MOUNTAIN, HILLS ); + registerBiomeType(forest, FOREST ); + registerBiomeType(taiga, COLD, CONIFEROUS, FOREST ); + registerBiomeType(taigaHills, COLD, CONIFEROUS, FOREST, HILLS ); + registerBiomeType(swampland, WET, SWAMP ); + registerBiomeType(river, RIVER ); + registerBiomeType(frozenOcean, COLD, OCEAN, SNOWY ); + registerBiomeType(frozenRiver, COLD, RIVER, SNOWY ); + registerBiomeType(icePlains, COLD, SNOWY, WASTELAND ); + registerBiomeType(iceMountains, COLD, SNOWY, MOUNTAIN ); + registerBiomeType(beach, BEACH ); + registerBiomeType(desertHills, HOT, DRY, SANDY, HILLS ); + registerBiomeType(jungle, HOT, WET, DENSE, JUNGLE ); + registerBiomeType(jungleHills, HOT, WET, DENSE, JUNGLE, HILLS); + registerBiomeType(forestHills, FOREST, HILLS ); + registerBiomeType(sky, COLD, DRY, END ); + registerBiomeType(hell, HOT, DRY, NETHER ); + registerBiomeType(mushroomIsland, MUSHROOM ); + registerBiomeType(extremeHillsEdge, MOUNTAIN ); + registerBiomeType(mushroomIslandShore, MUSHROOM, BEACH ); + registerBiomeType(jungleEdge, HOT, WET, JUNGLE, FOREST ); + registerBiomeType(deepOcean, OCEAN ); + registerBiomeType(stoneBeach, BEACH ); + registerBiomeType(coldBeach, COLD, BEACH, SNOWY ); + registerBiomeType(birchForest, FOREST ); + registerBiomeType(birchForestHills, FOREST, HILLS ); + registerBiomeType(roofedForest, SPOOKY, DENSE, FOREST ); + registerBiomeType(coldTaiga, COLD, CONIFEROUS, FOREST, SNOWY ); + registerBiomeType(coldTaigaHills, COLD, CONIFEROUS, FOREST, SNOWY, HILLS); + registerBiomeType(megaTaiga, COLD, CONIFEROUS, FOREST ); + registerBiomeType(megaTaigaHills, COLD, CONIFEROUS, FOREST, HILLS ); + registerBiomeType(extremeHillsPlus, MOUNTAIN, FOREST, SPARSE ); + registerBiomeType(savanna, HOT, SAVANNA, PLAINS, SPARSE ); + registerBiomeType(savannaPlateau, HOT, SAVANNA, PLAINS, SPARSE ); + registerBiomeType(mesa, MESA, SANDY ); + registerBiomeType(mesaPlateau_F, MESA, SPARSE, SANDY ); + registerBiomeType(mesaPlateau, MESA, SANDY ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeManager.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeManager.java new file mode 100644 index 0000000..be95bd7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/BiomeManager.java @@ -0,0 +1,297 @@ +package net.minecraftforge.common; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import com.google.common.collect.ImmutableList; + +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.biome.WorldChunkManager; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.util.EnumHelper; + +public class BiomeManager +{ + private static TrackedList[] biomes = setupBiomes(); + + /* + * These lists should no longer be accessed directly. Instead, use the appropriate add, remove and get methods within this class. + */ + @Deprecated + public static List desertBiomes = biomes[BiomeType.DESERT.ordinal()]; + @Deprecated + public static List warmBiomes = biomes[BiomeType.WARM.ordinal()]; + @Deprecated + public static List coolBiomes = biomes[BiomeType.COOL.ordinal()]; + @Deprecated + public static List icyBiomes = biomes[BiomeType.ICY.ordinal()]; + + private static boolean isModded = false; + + public static List oceanBiomes = new ArrayList(); + + public static ArrayList strongHoldBiomes = new ArrayList(); + public static ArrayList strongHoldBiomesBlackList = new ArrayList(); + + static + { + oceanBiomes.add(BiomeGenBase.ocean); + oceanBiomes.add(BiomeGenBase.deepOcean); + oceanBiomes.add(BiomeGenBase.frozenOcean); + } + + private static TrackedList[] setupBiomes() + { + TrackedList[] currentBiomes = new TrackedList[BiomeType.values().length]; + List list = new ArrayList(); + + list.add(new BiomeEntry(BiomeGenBase.forest, 10)); + list.add(new BiomeEntry(BiomeGenBase.roofedForest, 10)); + list.add(new BiomeEntry(BiomeGenBase.extremeHills, 10)); + list.add(new BiomeEntry(BiomeGenBase.plains, 10)); + list.add(new BiomeEntry(BiomeGenBase.birchForest, 10)); + list.add(new BiomeEntry(BiomeGenBase.swampland, 10)); + + currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList(list); + list.clear(); + + list.add(new BiomeEntry(BiomeGenBase.forest, 10)); + list.add(new BiomeEntry(BiomeGenBase.extremeHills, 10)); + list.add(new BiomeEntry(BiomeGenBase.taiga, 10)); + list.add(new BiomeEntry(BiomeGenBase.plains, 10)); + + currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList(list); + list.clear(); + + list.add(new BiomeEntry(BiomeGenBase.icePlains, 30)); + list.add(new BiomeEntry(BiomeGenBase.coldTaiga, 10)); + + currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList(list); + list.clear(); + + currentBiomes[BiomeType.DESERT.ordinal()] = new TrackedList(list); + + return currentBiomes; + } + + @SuppressWarnings("unchecked") + public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn) + { + if (!MapGenVillage.villageSpawnBiomes.contains(biome)) + { + ArrayList biomes = new ArrayList(MapGenVillage.villageSpawnBiomes); + biomes.add(biome); + MapGenVillage.villageSpawnBiomes = biomes; + } + } + + @SuppressWarnings("unchecked") + public static void removeVillageBiome(BiomeGenBase biome) + { + if (MapGenVillage.villageSpawnBiomes.contains(biome)) + { + ArrayList biomes = new ArrayList(MapGenVillage.villageSpawnBiomes); + biomes.remove(biome); + MapGenVillage.villageSpawnBiomes = biomes; + } + } + + public static void addStrongholdBiome(BiomeGenBase biome) + { + if (!strongHoldBiomes.contains(biome)) + { + strongHoldBiomes.add(biome); + } + } + + public static void removeStrongholdBiome(BiomeGenBase biome) + { + if (!strongHoldBiomesBlackList.contains(biome)) + { + strongHoldBiomesBlackList.add(biome); + } + } + + public static void addSpawnBiome(BiomeGenBase biome) + { + if (!WorldChunkManager.allowedBiomes.contains(biome)) + { + WorldChunkManager.allowedBiomes.add(biome); + } + } + + public static void removeSpawnBiome(BiomeGenBase biome) + { + if (WorldChunkManager.allowedBiomes.contains(biome)) + { + WorldChunkManager.allowedBiomes.remove(biome); + } + } + + public static void addBiome(BiomeType type, BiomeEntry entry) + { + isModded = true; + + int idx = type.ordinal(); + List list = idx > biomes.length ? null : biomes[idx]; + if (list != null) list.add(entry); + } + + public static void removeBiome(BiomeType type, BiomeEntry entry) + { + isModded = true; + + int idx = type.ordinal(); + List list = idx > biomes.length ? null : biomes[idx]; + + if (list != null && list.contains(entry)) + { + list.remove(entry); + } + } + + public static ImmutableList getBiomes(BiomeType type) + { + int idx = type.ordinal(); + List list = idx > biomes.length ? null : biomes[idx]; + + return list != null ? ImmutableList.copyOf(list) : null; + } + + public static boolean isTypeListModded(BiomeType type) + { + int idx = type.ordinal(); + TrackedList list = idx > biomes.length ? null : biomes[idx]; + + if (list != null) return list.isModded(); + + return false; + } + + public static enum BiomeType + { + DESERT, WARM, COOL, ICY; + + public static BiomeType getType(String name) + { + name = name.toUpperCase(); + + for (BiomeType t : values()) + { + if (t.name().equals(name)) return t; + } + + BiomeType ret = EnumHelper.addEnum(BiomeType.class, name, BiomeType.class); + + if (ret.ordinal() >= biomes.length) + { + biomes = Arrays.copyOf(biomes, ret.ordinal()); + } + + return ret; + } + } + + public static class BiomeEntry extends WeightedRandom.Item + { + public final BiomeGenBase biome; + + public BiomeEntry(BiomeGenBase biome, int weight) + { + super(weight); + + this.biome = biome; + } + } + + private static class TrackedList extends ArrayList + { + private boolean isModded = false; + + public TrackedList(Collection c) + { + super(c); + } + + @Override + public E set(int index, E element) + { + isModded = true; + return super.set(index, element); + } + + @Override + public boolean add(E e) + { + isModded = true; + return super.add(e); + } + + @Override + public void add(int index, E element) + { + isModded = true; + super.add(index, element); + } + + @Override + public E remove(int index) + { + isModded = true; + return super.remove(index); + } + + @Override + public boolean remove(Object o) + { + isModded = true; + return super.remove(o); + } + + @Override + public void clear() + { + isModded = true; + super.clear(); + } + + @Override + public boolean addAll(Collection c) + { + isModded = true; + return super.addAll(c); + } + + @Override + public boolean addAll(int index, Collection c) + { + isModded = true; + return super.addAll(index, c); + } + + @Override + public boolean removeAll(Collection c) + { + isModded = true; + return super.removeAll(c); + } + + @Override + public boolean retainAll(Collection c) + { + isModded = true; + return super.retainAll(c); + } + + public boolean isModded() + { + return isModded; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ChestGenHooks.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ChestGenHooks.java new file mode 100644 index 0000000..4e00c7d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ChestGenHooks.java @@ -0,0 +1,250 @@ +package net.minecraftforge.common; + +import java.util.*; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.WorldServer; +import net.minecraft.world.gen.feature.WorldGenDungeons; +import net.minecraft.world.gen.structure.*; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces.DesertPyramid; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces.JunglePyramid; +import net.minecraft.world.gen.structure.StructureStrongholdPieces.ChestCorridor; +import net.minecraft.world.gen.structure.StructureStrongholdPieces.Library; +import net.minecraft.world.gen.structure.StructureStrongholdPieces.RoomCrossing; +import net.minecraft.world.gen.structure.StructureVillagePieces.House2; +import net.minecraftforge.oredict.OreDictionary; + +public class ChestGenHooks +{ + //Currently implemented categories for chests/dispensers, Dungeon loot is still in DungeonHooks + public static final String MINESHAFT_CORRIDOR = "mineshaftCorridor"; + public static final String PYRAMID_DESERT_CHEST = "pyramidDesertyChest"; + public static final String PYRAMID_JUNGLE_CHEST = "pyramidJungleChest"; + public static final String PYRAMID_JUNGLE_DISPENSER = "pyramidJungleDispenser"; + public static final String STRONGHOLD_CORRIDOR = "strongholdCorridor"; + public static final String STRONGHOLD_LIBRARY = "strongholdLibrary"; + public static final String STRONGHOLD_CROSSING = "strongholdCrossing"; + public static final String VILLAGE_BLACKSMITH = "villageBlacksmith"; + public static final String BONUS_CHEST = "bonusChest"; + public static final String DUNGEON_CHEST = "dungeonChest"; + + private static final HashMap chestInfo = new HashMap(); + private static boolean hasInit = false; + static + { + init(); + } + + private static void init() + { + if (hasInit) + { + return; + } + + hasInit = true; + + addInfo(MINESHAFT_CORRIDOR, StructureMineshaftPieces.mineshaftChestContents, 3, 7); + addInfo(PYRAMID_DESERT_CHEST, DesertPyramid.itemsToGenerateInTemple, 2, 7); + addInfo(PYRAMID_JUNGLE_CHEST, JunglePyramid.junglePyramidsChestContents, 2, 7); + addInfo(PYRAMID_JUNGLE_DISPENSER, JunglePyramid.junglePyramidsDispenserContents, 2, 2); + addInfo(STRONGHOLD_CORRIDOR, ChestCorridor.strongholdChestContents, 2, 4); + addInfo(STRONGHOLD_LIBRARY, Library.strongholdLibraryChestContents, 1, 5); + addInfo(STRONGHOLD_CROSSING, RoomCrossing.strongholdRoomCrossingChestContents, 1, 5); + addInfo(VILLAGE_BLACKSMITH, House2.villageBlacksmithChestContents, 3, 9); + addInfo(BONUS_CHEST, WorldServer.bonusChestContent, 10, 10); + addInfo(DUNGEON_CHEST, WorldGenDungeons.field_111189_a, 8, 8); + + ItemStack book = new ItemStack(Items.enchanted_book, 1, 0); + WeightedRandomChestContent tmp = new WeightedRandomChestContent(book, 1, 1, 1); + getInfo(MINESHAFT_CORRIDOR ).addItem(tmp); + getInfo(PYRAMID_DESERT_CHEST).addItem(tmp); + getInfo(PYRAMID_JUNGLE_CHEST).addItem(tmp); + getInfo(STRONGHOLD_CORRIDOR ).addItem(tmp); + getInfo(STRONGHOLD_LIBRARY ).addItem(new WeightedRandomChestContent(book, 1, 5, 2)); + getInfo(STRONGHOLD_CROSSING ).addItem(tmp); + getInfo(DUNGEON_CHEST ).addItem(tmp); + } + + static void addDungeonLoot(ChestGenHooks dungeon, ItemStack item, int weight, int min, int max) + { + dungeon.addItem(new WeightedRandomChestContent(item, min, max, weight)); + } + + private static void addInfo(String category, WeightedRandomChestContent[] items, int min, int max) + { + chestInfo.put(category, new ChestGenHooks(category, items, min, max)); + } + + /** + * Retrieves, or creates the info class for the specified category. + * + * @param category The category name + * @return A instance of ChestGenHooks for the specified category. + */ + public static ChestGenHooks getInfo(String category) + { + if (!chestInfo.containsKey(category)) + { + chestInfo.put(category, new ChestGenHooks(category)); + } + return chestInfo.get(category); + } + + /** + * Generates an array of items based on the input min/max count. + * If the stack can not hold the total amount, it will be split into + * stacks of size 1. + * + * @param rand A random number generator + * @param source Source item stack + * @param min Minimum number of items + * @param max Maximum number of items + * @return An array containing the generated item stacks + */ + public static ItemStack[] generateStacks(Random rand, ItemStack source, int min, int max) + { + int count = min + (rand.nextInt(max - min + 1)); + + ItemStack[] ret; + if (source.getItem() == null) + { + ret = new ItemStack[0]; + } + else if (count > source.getMaxStackSize()) + { + ret = new ItemStack[count]; + for (int x = 0; x < count; x++) + { + ret[x] = source.copy(); + ret[x].stackSize = 1; + } + } + else + { + ret = new ItemStack[1]; + ret[0] = source.copy(); + ret[0].stackSize = count; + } + return ret; + } + + //shortcut functions, See the non-static versions below + public static WeightedRandomChestContent[] getItems(String category, Random rnd){ return getInfo(category).getItems(rnd); } + public static int getCount(String category, Random rand){ return getInfo(category).getCount(rand); } + public static void addItem(String category, WeightedRandomChestContent item){ getInfo(category).addItem(item); } + public static void removeItem(String category, ItemStack item){ getInfo(category).removeItem(item); } + public static ItemStack getOneItem(String category, Random rand){ return getInfo(category).getOneItem(rand); } + + private String category; + private int countMin = 0; + private int countMax = 0; + private ArrayList contents = new ArrayList(); + + public ChestGenHooks(String category) + { + this.category = category; + } + + public ChestGenHooks(String category, WeightedRandomChestContent[] items, int min, int max) + { + this(category); + for (WeightedRandomChestContent item : items) + { + contents.add(item); + } + countMin = min; + countMax = max; + } + + /** + * Adds a new entry into the possible items to generate. + * + * @param item The item to add. + */ + public void addItem(WeightedRandomChestContent item) + { + contents.add(item); + } + + /** + * Removes all items that match the input item stack, Only metadata and item ID are checked. + * If the input item has a metadata of -1, all metadatas will match. + * + * @param item The item to check + */ + public void removeItem(ItemStack item) + { + Iterator itr = contents.iterator(); + while(itr.hasNext()) + { + WeightedRandomChestContent cont = itr.next(); + if (item.isItemEqual(cont.theItemId) || (item.getItemDamage() == OreDictionary.WILDCARD_VALUE && item.getItem() == cont.theItemId.getItem())) + { + itr.remove(); + } + } + } + + /** + * Gets an array of all random objects that are associated with this category. + * + * @return The random objects + */ + public WeightedRandomChestContent[] getItems(Random rnd) + { + ArrayList ret = new ArrayList(); + + for (WeightedRandomChestContent orig : contents) + { + Item item = orig.theItemId.getItem(); + + if (item != null) + { + WeightedRandomChestContent n = item.getChestGenBase(this, rnd, orig); + if (n != null) + { + ret.add(n); + } + } + } + + return ret.toArray(new WeightedRandomChestContent[ret.size()]); + } + + /** + * Gets a random number between countMin and countMax. + * + * @param rand A RNG + * @return A random number where countMin <= num <= countMax + */ + public int getCount(Random rand) + { + return countMin < countMax ? countMin + rand.nextInt(countMax - countMin) : countMin; + } + + /** + * Returns a single ItemStack from the possible items in this registry, + * Useful if you just want a quick and dirty random Item. + * + * @param rand A Random Number gen + * @return A single ItemStack, or null if it could not get one. + */ + public ItemStack getOneItem(Random rand) + { + WeightedRandomChestContent[] items = getItems(rand); + WeightedRandomChestContent item = (WeightedRandomChestContent)WeightedRandom.getRandomItem(rand, items); + ItemStack[] stacks = ChestGenHooks.generateStacks(rand, item.theItemId, item.theMinimumChanceToGenerateItem, item.theMaximumChanceToGenerateItem); + return (stacks.length > 0 ? stacks[0] : null); + } + + //Accessors + public int getMin(){ return countMin; } + public int getMax(){ return countMax; } + public void setMin(int value){ countMin = value; } + public void setMax(int value){ countMax = value; } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/DimensionManager.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/DimensionManager.java new file mode 100644 index 0000000..130646b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/DimensionManager.java @@ -0,0 +1,428 @@ +package net.minecraftforge.common; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Hashtable; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentMap; + +import org.apache.logging.log4j.Level; + +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Lists; +import com.google.common.collect.MapMaker; +import com.google.common.collect.Multiset; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.MinecraftException; +import net.minecraft.world.World; +import net.minecraft.world.WorldManager; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldProviderEnd; +import net.minecraft.world.WorldProviderHell; +import net.minecraft.world.WorldProviderSurface; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldServerMulti; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.storage.SaveHandler; +import net.minecraftforge.event.world.WorldEvent; + +public class DimensionManager +{ + private static Hashtable> providers = new Hashtable>(); + private static Hashtable spawnSettings = new Hashtable(); + private static Hashtable worlds = new Hashtable(); + private static boolean hasInit = false; + private static Hashtable dimensions = new Hashtable(); + private static ArrayList unloadQueue = new ArrayList(); + private static BitSet dimensionMap = new BitSet(Long.SIZE << 4); + private static ConcurrentMap weakWorldMap = new MapMaker().weakKeys().weakValues().makeMap(); + private static Multiset leakedWorlds = HashMultiset.create(); + + public static boolean registerProviderType(int id, Class provider, boolean keepLoaded) + { + if (providers.containsKey(id)) + { + return false; + } + providers.put(id, provider); + spawnSettings.put(id, keepLoaded); + return true; + } + + /** + * Unregisters a Provider type, and returns a array of all dimensions that are + * registered to this provider type. + * If the return size is greater then 0, it is required that the caller either + * change those dimensions's registered type, or replace this type before the + * world is attempted to load, else the loader will throw an exception. + * + * @param id The provider type ID to unreigster + * @return An array containing all dimension IDs still registered to this provider type. + */ + public static int[] unregisterProviderType(int id) + { + if (!providers.containsKey(id)) + { + return new int[0]; + } + providers.remove(id); + spawnSettings.remove(id); + + int[] ret = new int[dimensions.size()]; + int x = 0; + for (Map.Entry ent : dimensions.entrySet()) + { + if (ent.getValue() == id) + { + ret[x++] = ent.getKey(); + } + } + + return Arrays.copyOf(ret, x); + } + + public static void init() + { + if (hasInit) + { + return; + } + + hasInit = true; + + registerProviderType( 0, WorldProviderSurface.class, true); + registerProviderType(-1, WorldProviderHell.class, true); + registerProviderType( 1, WorldProviderEnd.class, false); + registerDimension( 0, 0); + registerDimension(-1, -1); + registerDimension( 1, 1); + } + + public static void registerDimension(int id, int providerType) + { + if (!providers.containsKey(providerType)) + { + throw new IllegalArgumentException(String.format("Failed to register dimension for id %d, provider type %d does not exist", id, providerType)); + } + if (dimensions.containsKey(id)) + { + throw new IllegalArgumentException(String.format("Failed to register dimension for id %d, One is already registered", id)); + } + dimensions.put(id, providerType); + if (id >= 0) + { + dimensionMap.set(id); + } + } + + /** + * For unregistering a dimension when the save is changed (disconnected from a server or loaded a new save + */ + public static void unregisterDimension(int id) + { + if (!dimensions.containsKey(id)) + { + throw new IllegalArgumentException(String.format("Failed to unregister dimension for id %d; No provider registered", id)); + } + dimensions.remove(id); + } + + public static boolean isDimensionRegistered(int dim) + { + return dimensions.containsKey(dim); + } + + public static int getProviderType(int dim) + { + if (!dimensions.containsKey(dim)) + { + throw new IllegalArgumentException(String.format("Could not get provider type for dimension %d, does not exist", dim)); + } + return dimensions.get(dim); + } + + public static WorldProvider getProvider(int dim) + { + return getWorld(dim).provider; + } + + public static Integer[] getIDs(boolean check) + { + if (check) + { + List allWorlds = Lists.newArrayList(weakWorldMap.keySet()); + allWorlds.removeAll(worlds.values()); + for (ListIterator li = allWorlds.listIterator(); li.hasNext(); ) + { + World w = li.next(); + leakedWorlds.add(System.identityHashCode(w)); + } + for (World w : allWorlds) + { + int leakCount = leakedWorlds.count(System.identityHashCode(w)); + if (leakCount == 5) + { + FMLLog.fine("The world %x (%s) may have leaked: first encounter (5 occurences).\n", System.identityHashCode(w), w.getWorldInfo().getWorldName()); + } + else if (leakCount % 5 == 0) + { + FMLLog.fine("The world %x (%s) may have leaked: seen %d times.\n", System.identityHashCode(w), w.getWorldInfo().getWorldName(), leakCount); + } + } + } + return getIDs(); + } + public static Integer[] getIDs() + { + return worlds.keySet().toArray(new Integer[worlds.size()]); //Only loaded dims, since usually used to cycle through loaded worlds + } + + public static void setWorld(int id, WorldServer world) + { + if (world != null) + { + worlds.put(id, world); + weakWorldMap.put(world, world); + MinecraftServer.getServer().worldTickTimes.put(id, new long[100]); + FMLLog.info("Loading dimension %d (%s) (%s)", id, world.getWorldInfo().getWorldName(), world.func_73046_m()); + } + else + { + worlds.remove(id); + MinecraftServer.getServer().worldTickTimes.remove(id); + FMLLog.info("Unloading dimension %d", id); + } + + ArrayList tmp = new ArrayList(); + if (worlds.get( 0) != null) + tmp.add(worlds.get( 0)); + if (worlds.get(-1) != null) + tmp.add(worlds.get(-1)); + if (worlds.get( 1) != null) + tmp.add(worlds.get( 1)); + + for (Entry entry : worlds.entrySet()) + { + int dim = entry.getKey(); + if (dim >= -1 && dim <= 1) + { + continue; + } + tmp.add(entry.getValue()); + } + + MinecraftServer.getServer().worldServers = tmp.toArray(new WorldServer[tmp.size()]); + } + + public static void initDimension(int dim) { + WorldServer overworld = getWorld(0); + if (overworld == null) + { + throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!"); + } + try + { + DimensionManager.getProviderType(dim); + } + catch (Exception e) + { + System.err.println("Cannot Hotload Dim: " + e.getMessage()); + return; // If a provider hasn't been registered then we can't hotload the dim + } + MinecraftServer mcServer = overworld.func_73046_m(); + ISaveHandler savehandler = overworld.getSaveHandler(); + WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo()); + + WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.getWorldInfo().getWorldName(), dim, worldSettings, overworld, mcServer.theProfiler)); + world.addWorldAccess(new WorldManager(mcServer, world)); + MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + if (!mcServer.isSinglePlayer()) + { + world.getWorldInfo().setGameType(mcServer.getGameType()); + } + + mcServer.func_147139_a(mcServer.func_147135_j()); + } + + public static WorldServer getWorld(int id) + { + return worlds.get(id); + } + + public static WorldServer[] getWorlds() + { + return worlds.values().toArray(new WorldServer[worlds.size()]); + } + + public static boolean shouldLoadSpawn(int dim) + { + int id = getProviderType(dim); + return spawnSettings.containsKey(id) && spawnSettings.get(id); + } + + static + { + init(); + } + + /** + * Not public API: used internally to get dimensions that should load at + * server startup + */ + public static Integer[] getStaticDimensionIDs() + { + return dimensions.keySet().toArray(new Integer[dimensions.keySet().size()]); + } + public static WorldProvider createProviderFor(int dim) + { + try + { + if (dimensions.containsKey(dim)) + { + WorldProvider provider = providers.get(getProviderType(dim)).newInstance(); + provider.setDimension(dim); + return provider; + } + else + { + throw new RuntimeException(String.format("No WorldProvider bound for dimension %d", dim)); //It's going to crash anyway at this point. Might as well be informative + } + } + catch (Exception e) + { + FMLCommonHandler.instance().getFMLLogger().log(Level.ERROR, String.format("An error occured trying to create an instance of WorldProvider %d (%s)", + dim, providers.get(getProviderType(dim)).getSimpleName()),e); + throw new RuntimeException(e); + } + } + + public static void unloadWorld(int id) { + unloadQueue.add(id); + } + + /* + * To be called by the server at the appropriate time, do not call from mod code. + */ + public static void unloadWorlds(Hashtable worldTickTimes) { + for (int id : unloadQueue) { + WorldServer w = worlds.get(id); + try { + if (w != null) + { + w.saveAllChunks(true, null); + } + else + { + FMLLog.warning("Unexpected world unload - world %d is already unloaded", id); + } + } catch (MinecraftException e) { + e.printStackTrace(); + } + finally + { + if (w != null) + { + MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); + w.flush(); + setWorld(id, null); + } + } + } + unloadQueue.clear(); + } + + /** + * Return the next free dimension ID. Note: you are not guaranteed a contiguous + * block of free ids. Always call for each individual ID you wish to get. + * @return the next free dimension ID + */ + public static int getNextFreeDimId() { + int next = 0; + while (true) + { + next = dimensionMap.nextClearBit(next); + if (dimensions.containsKey(next)) + { + dimensionMap.set(next); + } + else + { + return next; + } + } + } + + public static NBTTagCompound saveDimensionDataMap() + { + int[] data = new int[(dimensionMap.length() + Integer.SIZE - 1 )/ Integer.SIZE]; + NBTTagCompound dimMap = new NBTTagCompound(); + for (int i = 0; i < data.length; i++) + { + int val = 0; + for (int j = 0; j < Integer.SIZE; j++) + { + val |= dimensionMap.get(i * Integer.SIZE + j) ? (1 << j) : 0; + } + data[i] = val; + } + dimMap.setIntArray("DimensionArray", data); + return dimMap; + } + + public static void loadDimensionDataMap(NBTTagCompound compoundTag) + { + dimensionMap.clear(); + if (compoundTag == null) + { + for (Integer id : dimensions.keySet()) + { + if (id >= 0) + { + dimensionMap.set(id); + } + } + } + else + { + int[] intArray = compoundTag.getIntArray("DimensionArray"); + for (int i = 0; i < intArray.length; i++) + { + for (int j = 0; j < Integer.SIZE; j++) + { + dimensionMap.set(i * Integer.SIZE + j, (intArray[i] & (1 << j)) != 0); + } + } + } + } + + /** + * Return the current root directory for the world save. Accesses getSaveHandler from the overworld + * @return the root directory of the save + */ + public static File getCurrentSaveRootDirectory() + { + if (DimensionManager.getWorld(0) != null) + { + return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory(); + } + else if (MinecraftServer.getServer() != null) + { + MinecraftServer srv = MinecraftServer.getServer(); + SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false); + return saveHandler.getWorldDirectory(); + } + else + { + return null; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/DungeonHooks.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/DungeonHooks.java new file mode 100644 index 0000000..4666d07 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/DungeonHooks.java @@ -0,0 +1,102 @@ +package net.minecraftforge.common; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.util.WeightedRandom; + +public class DungeonHooks +{ + private static ArrayList dungeonMobs = new ArrayList(); + + /** + * Adds a mob to the possible list of creatures the spawner will create. + * If the mob is already in the spawn list, the rarity will be added to the existing one, + * causing the mob to be more common. + * + * @param name The name of the monster, use the same name used when registering the entity. + * @param rarity The rarity of selecting this mob over others. Must be greater then 0. + * Vanilla Minecraft has the following mobs: + * Spider 100 + * Skeleton 100 + * Zombie 200 + * Meaning, Zombies are twice as common as spiders or skeletons. + * @return The new rarity of the monster, + */ + public static float addDungeonMob(String name, int rarity) + { + if (rarity <= 0) + { + throw new IllegalArgumentException("Rarity must be greater then zero"); + } + + for (DungeonMob mob : dungeonMobs) + { + if (name.equals(mob.type)) + { + return mob.itemWeight += rarity; + } + } + + dungeonMobs.add(new DungeonMob(rarity, name)); + return rarity; + } + + /** + * Will completely remove a Mob from the dungeon spawn list. + * + * @param name The name of the mob to remove + * @return The rarity of the removed mob, prior to being removed. + */ + public static int removeDungeonMob(String name) + { + for (DungeonMob mob : dungeonMobs) + { + if (name.equals(mob.type)) + { + dungeonMobs.remove(mob); + return mob.itemWeight; + } + } + return 0; + } + + /** + * Gets a random mob name from the list. + * @param rand World generation random number generator + * @return The mob name + */ + public static String getRandomDungeonMob(Random rand) + { + DungeonMob mob = (DungeonMob)WeightedRandom.getRandomItem(rand, dungeonMobs); + if (mob == null) + { + return ""; + } + return mob.type; + } + + + public static class DungeonMob extends WeightedRandom.Item + { + public String type; + public DungeonMob(int weight, String type) + { + super(weight); + this.type = type; + } + + @Override + public boolean equals(Object target) + { + return target instanceof DungeonMob && type.equals(((DungeonMob)target).type); + } + } + + static + { + addDungeonMob("Skeleton", 100); + addDungeonMob("Zombie", 200); + addDungeonMob("Spider", 100); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/EnumPlantType.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/EnumPlantType.java new file mode 100644 index 0000000..3622e6c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/EnumPlantType.java @@ -0,0 +1,12 @@ +package net.minecraftforge.common; + +public enum EnumPlantType +{ + Plains, + Desert, + Beach, + Cave, + Water, + Nether, + Crop +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/FishingHooks.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/FishingHooks.java new file mode 100644 index 0000000..22d35a9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/FishingHooks.java @@ -0,0 +1,114 @@ +package net.minecraftforge.common; + +import com.google.common.base.Predicate; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.projectile.EntityFishHook; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatList; +import net.minecraft.util.MathHelper; +import net.minecraft.util.WeightedRandom; +import net.minecraft.util.WeightedRandomFishable; + +public class FishingHooks +{ + private static ArrayList fish = new ArrayList(); + private static ArrayList junk = new ArrayList(); + private static ArrayList treasure = new ArrayList(); + + public static void addFish(WeightedRandomFishable item) { fish.add(item); } + public static void addJunk(WeightedRandomFishable item) { junk.add(item); } + public static void addTreasure(WeightedRandomFishable item) { treasure.add(item); } + + public static void removeFish(Predicate test) { remove(fish.iterator(), test); } + public static void removeJunk(Predicate test) { remove(junk.iterator(), test); } + public static void removeTreasure(Predicate test) { remove(treasure.iterator(), test); } + + public static ItemStack getRandomFishable(Random rand, float chance) + { + return getRandomFishable(rand, chance, 0, 0); + } + + public static ItemStack getRandomFishable(Random rand, float chance, int luck, int speed) + { + float junkChance = 0.1F - luck * 0.025F - speed * 0.01F; + float treasureChance = 0.05F + luck * 0.01F - speed * 0.01F; + junkChance = MathHelper.clamp_float(junkChance, 0.0F, 1.0F); + treasureChance = MathHelper.clamp_float(treasureChance, 0.0F, 1.0F); + + if (chance < junkChance) + { + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(rand, junk)).func_150708_a(rand); + } + + chance -= junkChance; + if (chance < treasureChance) + { + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(rand, treasure)).func_150708_a(rand); + } + + chance -= treasureChance; + // this is done in EntityFishHook.func_146033_f. more loot types expected? + { + return ((WeightedRandomFishable)WeightedRandom.getRandomItem(rand, fish)).func_150708_a(rand); + } + } + + public static FishableCategory getFishableCategory(float chance, int luck, int speed) + { + float junkChance = 0.1F - luck * 0.025F - speed * 0.01F; + float treasureChance = 0.05F + luck * 0.01F - speed * 0.01F; + junkChance = MathHelper.clamp_float(junkChance, 0.0F, 1.0F); + treasureChance = MathHelper.clamp_float(treasureChance, 0.0F, 1.0F); + + if (chance < junkChance) + { + return FishableCategory.JUNK; + } + + chance -= junkChance; + if (chance < treasureChance) + { + return FishableCategory.TREASURE; + } + + chance -= treasureChance; + // this is done in EntityFishHook.func_146033_f. more loot types expected? + { + return FishableCategory.FISH; + } + } + + private static void remove(Iterator iter, Predicate test) + { + while (iter.hasNext()) + if (!test.apply(iter.next())) + iter.remove(); + } + + static + { + fish.addAll(EntityFishHook.field_146036_f); + junk.addAll(EntityFishHook.field_146039_d); + treasure.addAll(EntityFishHook.field_146041_e); + } + + public static enum FishableCategory + { + JUNK(StatList.field_151183_A), + TREASURE(StatList.field_151184_B), + FISH(StatList.fishCaughtStat); + + public final StatBase stat; + + FishableCategory(StatBase stat) + { + this.stat = stat; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeChunkManager.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeChunkManager.java new file mode 100644 index 0000000..28af99e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeChunkManager.java @@ -0,0 +1,1074 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import org.apache.logging.log4j.Level; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.MapMaker; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.common.collect.SetMultimap; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.config.ConfigCategory; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; +import net.minecraftforge.common.util.Constants; + +/** + * Manages chunkloading for mods. + * + * The basic principle is a ticket based system. + * 1. Mods register a callback {@link #setForcedChunkLoadingCallback(Object, LoadingCallback)} + * 2. Mods ask for a ticket {@link #requestTicket(Object, World, Type)} and then hold on to that ticket. + * 3. Mods request chunks to stay loaded {@link #forceChunk(Ticket, ChunkCoordIntPair)} or remove chunks from force loading {@link #unforceChunk(Ticket, ChunkCoordIntPair)}. + * 4. When a world unloads, the tickets associated with that world are saved by the chunk manager. + * 5. When a world loads, saved tickets are offered to the mods associated with the tickets. The {@link Ticket#getModData()} that is set by the mod should be used to re-register + * chunks to stay loaded (and maybe take other actions). + * + * The chunkloading is configurable at runtime. The file "config/forgeChunkLoading.cfg" contains both default configuration for chunkloading, and a sample individual mod + * specific override section. + * + * @author cpw + * + */ +public class ForgeChunkManager +{ + private static int defaultMaxCount; + private static int defaultMaxChunks; + private static boolean overridesEnabled; + + private static Map> tickets = new MapMaker().weakKeys().makeMap(); + private static Map ticketConstraints = Maps.newHashMap(); + private static Map chunkConstraints = Maps.newHashMap(); + + private static SetMultimap playerTickets = HashMultimap.create(); + + private static Map callbacks = Maps.newHashMap(); + + private static Map> forcedChunks = new MapMaker().weakKeys().makeMap(); + private static BiMap pendingEntities = HashBiMap.create(); + + private static Map> dormantChunkCache = new MapMaker().weakKeys().makeMap(); + + private static File cfgFile; + private static Configuration config; + private static int playerTicketLength; + private static int dormantChunkCacheSize; + + public static final List MOD_PROP_ORDER = new ArrayList(2); + + private static Set warnedMods = Sets.newHashSet(); + + static + { + MOD_PROP_ORDER.add("maximumTicketCount"); + MOD_PROP_ORDER.add("maximumChunksPerTicket"); + } + + /** + * All mods requiring chunkloading need to implement this to handle the + * re-registration of chunk tickets at world loading time + * + * @author cpw + * + */ + public interface LoadingCallback + { + /** + * Called back when tickets are loaded from the world to allow the + * mod to re-register the chunks associated with those tickets. The list supplied + * here is truncated to length prior to use. Tickets unwanted by the + * mod must be disposed of manually unless the mod is an OrderedLoadingCallback instance + * in which case, they will have been disposed of by the earlier callback. + * + * @param tickets The tickets to re-register. The list is immutable and cannot be manipulated directly. Copy it first. + * @param world the world + */ + public void ticketsLoaded(List tickets, World world); + } + + /** + * This is a special LoadingCallback that can be implemented as well as the + * LoadingCallback to provide access to additional behaviour. + * Specifically, this callback will fire prior to Forge dropping excess + * tickets. Tickets in the returned list are presumed ordered and excess will + * be truncated from the returned list. + * This allows the mod to control not only if they actually want a ticket but + * also their preferred ticket ordering. + * + * @author cpw + * + */ + public interface OrderedLoadingCallback extends LoadingCallback + { + /** + * Called back when tickets are loaded from the world to allow the + * mod to decide if it wants the ticket still, and prioritise overflow + * based on the ticket count. + * WARNING: You cannot force chunks in this callback, it is strictly for allowing the mod + * to be more selective in which tickets it wishes to preserve in an overflow situation + * + * @param tickets The tickets that you will want to select from. The list is immutable and cannot be manipulated directly. Copy it first. + * @param world The world + * @param maxTicketCount The maximum number of tickets that will be allowed. + * @return A list of the tickets this mod wishes to continue using. This list will be truncated + * to "maxTicketCount" size after the call returns and then offered to the other callback + * method + */ + public List ticketsLoaded(List tickets, World world, int maxTicketCount); + } + + public interface PlayerOrderedLoadingCallback extends LoadingCallback + { + /** + * Called back when tickets are loaded from the world to allow the + * mod to decide if it wants the ticket still. + * This is for player bound tickets rather than mod bound tickets. It is here so mods can + * decide they want to dump all player tickets + * + * WARNING: You cannot force chunks in this callback, it is strictly for allowing the mod + * to be more selective in which tickets it wishes to preserve + * + * @param tickets The tickets that you will want to select from. The list is immutable and cannot be manipulated directly. Copy it first. + * @param world The world + * @return A list of the tickets this mod wishes to use. This list will subsequently be offered + * to the main callback for action + */ + public ListMultimap playerTicketsLoaded(ListMultimap tickets, World world); + } + public enum Type + { + + /** + * For non-entity registrations + */ + NORMAL, + /** + * For entity registrations + */ + ENTITY + } + public static class Ticket + { + private String modId; + private Type ticketType; + private LinkedHashSet requestedChunks; + private NBTTagCompound modData; + public final World world; + private int maxDepth; + //private String entityClazz; + private int entityChunkX; + private int entityChunkZ; + private Entity entity; + private String player; + + Ticket(String modId, Type type, World world) + { + this.modId = modId; + this.ticketType = type; + this.world = world; + this.maxDepth = getMaxChunkDepthFor(modId); + this.requestedChunks = Sets.newLinkedHashSet(); + } + + Ticket(String modId, Type type, World world, String player) + { + this(modId, type, world); + if (player != null) + { + this.player = player; + } + else + { + FMLLog.log(Level.ERROR, "Attempt to create a player ticket without a valid player"); + throw new RuntimeException(); + } + } + /** + * The chunk list depth can be manipulated up to the maximal grant allowed for the mod. This value is configurable. Once the maximum is reached, + * the least recently forced chunk, by original registration time, is removed from the forced chunk list. + * + * @param depth The new depth to set + */ + public void setChunkListDepth(int depth) + { + if (depth > getMaxChunkDepthFor(modId) || (depth <= 0 && getMaxChunkDepthFor(modId) > 0)) + { + FMLLog.warning("The mod %s tried to modify the chunk ticket depth to: %d, its allowed maximum is: %d", modId, depth, getMaxChunkDepthFor(modId)); + } + else + { + this.maxDepth = depth; + } + } + + /** + * Gets the current max depth for this ticket. + * Should be the same as getMaxChunkListDepth() + * unless setChunkListDepth has been called. + * + * @return Current max depth + */ + public int getChunkListDepth() + { + return maxDepth; + } + + /** + * Get the maximum chunk depth size + * + * @return The maximum chunk depth size + */ + public int getMaxChunkListDepth() + { + return getMaxChunkDepthFor(modId); + } + + /** + * Bind the entity to the ticket for {@link Type#ENTITY} type tickets. Other types will throw a runtime exception. + * + * @param entity The entity to bind + */ + public void bindEntity(Entity entity) + { + if (ticketType!=Type.ENTITY) + { + throw new RuntimeException("Cannot bind an entity to a non-entity ticket"); + } + this.entity = entity; + } + + /** + * Retrieve the {@link NBTTagCompound} that stores mod specific data for the chunk ticket. + * Example data to store would be a TileEntity or Block location. This is persisted with the ticket and + * provided to the {@link LoadingCallback} for the mod. It is recommended to use this to recover + * useful state information for the forced chunks. + * + * @return The custom compound tag for mods to store additional chunkloading data + */ + public NBTTagCompound getModData() + { + if (this.modData == null) + { + this.modData = new NBTTagCompound(); + } + return modData; + } + + /** + * Get the entity associated with this {@link Type#ENTITY} type ticket + * @return the entity + */ + public Entity getEntity() + { + return entity; + } + + /** + * Is this a player associated ticket rather than a mod associated ticket? + */ + public boolean isPlayerTicket() + { + return player != null; + } + + /** + * Get the player associated with this ticket + */ + public String getPlayerName() + { + return player; + } + + /** + * Get the associated mod id + */ + public String getModId() + { + return modId; + } + + /** + * Gets the ticket type + */ + public Type getType() + { + return ticketType; + } + + /** + * Gets a list of requested chunks for this ticket. + */ + public ImmutableSet getChunkList() + { + return ImmutableSet.copyOf(requestedChunks); + } + } + + public static class ForceChunkEvent extends Event { + public final Ticket ticket; + public final ChunkCoordIntPair location; + + public ForceChunkEvent(Ticket ticket, ChunkCoordIntPair location) + { + this.ticket = ticket; + this.location = location; + } + } + + public static class UnforceChunkEvent extends Event { + public final Ticket ticket; + public final ChunkCoordIntPair location; + + public UnforceChunkEvent(Ticket ticket, ChunkCoordIntPair location) + { + this.ticket = ticket; + this.location = location; + } + } + + + /** + * Allows dynamically loading world mods to test if there are chunk tickets in the world + * Mods that add dynamically generated worlds (like Mystcraft) should call this method + * to determine if the world should be loaded during server starting. + * + * @param chunkDir The chunk directory to test: should be equivalent to {@link WorldServer#getChunkSaveLocation()} + * @return if there are tickets outstanding for this world or not + */ + public static boolean savedWorldHasForcedChunkTickets(File chunkDir) + { + File chunkLoaderData = new File(chunkDir, "forcedchunks.dat"); + + if (chunkLoaderData.exists() && chunkLoaderData.isFile()) + { + ; + try + { + NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData); + return forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND).tagCount() > 0; + } + catch (IOException e) + { + } + } + return false; + } + + static void loadWorld(World world) + { + ArrayListMultimap newTickets = ArrayListMultimap.create(); + tickets.put(world, newTickets); + + forcedChunks.put(world, ImmutableSetMultimap.of()); + + if (!(world instanceof WorldServer)) + { + return; + } + + dormantChunkCache.put(world, CacheBuilder.newBuilder().maximumSize(dormantChunkCacheSize).build()); + WorldServer worldServer = (WorldServer) world; + File chunkDir = worldServer.getChunkSaveLocation(); + File chunkLoaderData = new File(chunkDir, "forcedchunks.dat"); + + if (chunkLoaderData.exists() && chunkLoaderData.isFile()) + { + ArrayListMultimap loadedTickets = ArrayListMultimap.create(); + Map> playerLoadedTickets = Maps.newHashMap(); + NBTTagCompound forcedChunkData; + try + { + forcedChunkData = CompressedStreamTools.read(chunkLoaderData); + } + catch (IOException e) + { + FMLLog.log(Level.WARN, e, "Unable to read forced chunk data at %s - it will be ignored", chunkLoaderData.getAbsolutePath()); + return; + } + NBTTagList ticketList = forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND); + for (int i = 0; i < ticketList.tagCount(); i++) + { + NBTTagCompound ticketHolder = (NBTTagCompound)ticketList.getCompoundTagAt(i); + String modId = ticketHolder.getString("Owner"); + boolean isPlayer = "Forge".equals(modId); + + if (!isPlayer && !Loader.isModLoaded(modId)) + { + FMLLog.warning("Found chunkloading data for mod %s which is currently not available or active - it will be removed from the world save", modId); + continue; + } + + if (!isPlayer && !callbacks.containsKey(modId)) + { + FMLLog.warning("The mod %s has registered persistent chunkloading data but doesn't seem to want to be called back with it - it will be removed from the world save", modId); + continue; + } + + NBTTagList tickets = ticketHolder.getTagList("Tickets", Constants.NBT.TAG_COMPOUND); + for (int j = 0; j < tickets.tagCount(); j++) + { + NBTTagCompound ticket = (NBTTagCompound) tickets.getCompoundTagAt(j); + modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId; + Type type = Type.values()[ticket.getByte("Type")]; + //byte ticketChunkDepth = ticket.getByte("ChunkListDepth"); + Ticket tick = new Ticket(modId, type, world); + if (ticket.hasKey("ModData")) + { + tick.modData = ticket.getCompoundTag("ModData"); + } + if (ticket.hasKey("Player")) + { + tick.player = ticket.getString("Player"); + if (!playerLoadedTickets.containsKey(tick.modId)) + { + playerLoadedTickets.put(modId, ArrayListMultimap.create()); + } + playerLoadedTickets.get(tick.modId).put(tick.player, tick); + } + else + { + loadedTickets.put(modId, tick); + } + if (type == Type.ENTITY) + { + tick.entityChunkX = ticket.getInteger("chunkX"); + tick.entityChunkZ = ticket.getInteger("chunkZ"); + UUID uuid = new UUID(ticket.getLong("PersistentIDMSB"), ticket.getLong("PersistentIDLSB")); + // add the ticket to the "pending entity" list + pendingEntities.put(uuid, tick); + } + } + } + + for (Ticket tick : ImmutableSet.copyOf(pendingEntities.values())) + { + if (tick.ticketType == Type.ENTITY && tick.entity == null) + { + // force the world to load the entity's chunk + // the load will come back through the loadEntity method and attach the entity + // to the ticket + world.getChunkFromChunkCoords(tick.entityChunkX, tick.entityChunkZ); + } + } + for (Ticket tick : ImmutableSet.copyOf(pendingEntities.values())) + { + if (tick.ticketType == Type.ENTITY && tick.entity == null) + { + FMLLog.warning("Failed to load persistent chunkloading entity %s from store.", pendingEntities.inverse().get(tick)); + loadedTickets.remove(tick.modId, tick); + } + } + pendingEntities.clear(); + // send callbacks + for (String modId : loadedTickets.keySet()) + { + LoadingCallback loadingCallback = callbacks.get(modId); + if (loadingCallback == null) + { + continue; + } + int maxTicketLength = getMaxTicketLengthFor(modId); + List tickets = loadedTickets.get(modId); + if (loadingCallback instanceof OrderedLoadingCallback) + { + OrderedLoadingCallback orderedLoadingCallback = (OrderedLoadingCallback) loadingCallback; + tickets = orderedLoadingCallback.ticketsLoaded(ImmutableList.copyOf(tickets), world, maxTicketLength); + } + if (tickets.size() > maxTicketLength) + { + FMLLog.warning("The mod %s has too many open chunkloading tickets %d. Excess will be dropped", modId, tickets.size()); + tickets.subList(maxTicketLength, tickets.size()).clear(); + } + ForgeChunkManager.tickets.get(world).putAll(modId, tickets); + loadingCallback.ticketsLoaded(ImmutableList.copyOf(tickets), world); + } + for (String modId : playerLoadedTickets.keySet()) + { + LoadingCallback loadingCallback = callbacks.get(modId); + if (loadingCallback == null) + { + continue; + } + ListMultimap tickets = playerLoadedTickets.get(modId); + if (loadingCallback instanceof PlayerOrderedLoadingCallback) + { + PlayerOrderedLoadingCallback orderedLoadingCallback = (PlayerOrderedLoadingCallback) loadingCallback; + tickets = orderedLoadingCallback.playerTicketsLoaded(ImmutableListMultimap.copyOf(tickets), world); + playerTickets.putAll(tickets); + } + ForgeChunkManager.tickets.get(world).putAll("Forge", tickets.values()); + loadingCallback.ticketsLoaded(ImmutableList.copyOf(tickets.values()), world); + } + } + } + + static void unloadWorld(World world) + { + // World save fires before this event so the chunk loading info will be done + if (!(world instanceof WorldServer)) + { + return; + } + + forcedChunks.remove(world); + dormantChunkCache.remove(world); + // integrated server is shutting down + if (!MinecraftServer.getServer().isServerRunning()) + { + playerTickets.clear(); + tickets.clear(); + } + } + + /** + * Set a chunkloading callback for the supplied mod object + * + * @param mod The mod instance registering the callback + * @param callback The code to call back when forced chunks are loaded + */ + public static void setForcedChunkLoadingCallback(Object mod, LoadingCallback callback) + { + ModContainer container = getContainer(mod); + if (container == null) + { + FMLLog.warning("Unable to register a callback for an unknown mod %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod)); + return; + } + + callbacks.put(container.getModId(), callback); + } + + /** + * Discover the available tickets for the mod in the world + * + * @param mod The mod that will own the tickets + * @param world The world + * @return The count of tickets left for the mod in the supplied world + */ + public static int ticketCountAvailableFor(Object mod, World world) + { + ModContainer container = getContainer(mod); + if (container!=null) + { + String modId = container.getModId(); + int allowedCount = getMaxTicketLengthFor(modId); + return allowedCount - tickets.get(world).get(modId).size(); + } + else + { + return 0; + } + } + + private static ModContainer getContainer(Object mod) + { + ModContainer container = Loader.instance().getModObjectList().inverse().get(mod); + return container; + } + + public static int getMaxTicketLengthFor(String modId) + { + int allowedCount = ticketConstraints.containsKey(modId) && overridesEnabled ? ticketConstraints.get(modId) : defaultMaxCount; + return allowedCount; + } + + public static int getMaxChunkDepthFor(String modId) + { + int allowedCount = chunkConstraints.containsKey(modId) && overridesEnabled ? chunkConstraints.get(modId) : defaultMaxChunks; + return allowedCount; + } + + public static int ticketCountAvailableFor(String username) + { + return playerTicketLength - playerTickets.get(username).size(); + } + + public static Ticket requestPlayerTicket(Object mod, String player, World world, Type type) + { + ModContainer mc = getContainer(mod); + if (mc == null) + { + FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod)); + return null; + } + if (playerTickets.get(player).size()>playerTicketLength) + { + FMLLog.warning("Unable to assign further chunkloading tickets to player %s (on behalf of mod %s)", player, mc.getModId()); + return null; + } + Ticket ticket = new Ticket(mc.getModId(),type,world,player); + playerTickets.put(player, ticket); + tickets.get(world).put("Forge", ticket); + return ticket; + } + /** + * Request a chunkloading ticket of the appropriate type for the supplied mod + * + * @param mod The mod requesting a ticket + * @param world The world in which it is requesting the ticket + * @param type The type of ticket + * @return A ticket with which to register chunks for loading, or null if no further tickets are available + */ + public static Ticket requestTicket(Object mod, World world, Type type) + { + ModContainer container = getContainer(mod); + if (container == null) + { + FMLLog.log(Level.ERROR, "Failed to locate the container for mod instance %s (%s : %x)", mod, mod.getClass().getName(), System.identityHashCode(mod)); + return null; + } + String modId = container.getModId(); + if (!callbacks.containsKey(modId)) + { + FMLLog.severe("The mod %s has attempted to request a ticket without a listener in place", modId); + throw new RuntimeException("Invalid ticket request"); + } + + int allowedCount = getMaxTicketLengthFor(modId); + + if (tickets.get(world).get(modId).size() >= allowedCount) + { + if (!warnedMods.contains(modId)) + { + FMLLog.info("The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d", modId, allowedCount); + warnedMods.add(modId); + } + return null; + } + Ticket ticket = new Ticket(modId, type, world); + tickets.get(world).put(modId, ticket); + + return ticket; + } + + /** + * Release the ticket back to the system. This will also unforce any chunks held by the ticket so that they can be unloaded and/or stop ticking. + * + * @param ticket The ticket to release + */ + public static void releaseTicket(Ticket ticket) + { + if (ticket == null) + { + return; + } + if (ticket.isPlayerTicket() ? !playerTickets.containsValue(ticket) : !tickets.get(ticket.world).containsEntry(ticket.modId, ticket)) + { + return; + } + if (ticket.requestedChunks!=null) + { + for (ChunkCoordIntPair chunk : ImmutableSet.copyOf(ticket.requestedChunks)) + { + unforceChunk(ticket, chunk); + } + } + if (ticket.isPlayerTicket()) + { + playerTickets.remove(ticket.player, ticket); + tickets.get(ticket.world).remove("Forge",ticket); + } + else + { + tickets.get(ticket.world).remove(ticket.modId, ticket); + } + } + + /** + * Force the supplied chunk coordinate to be loaded by the supplied ticket. If the ticket's {@link Ticket#maxDepth} is exceeded, the least + * recently registered chunk is unforced and may be unloaded. + * It is safe to force the chunk several times for a ticket, it will not generate duplication or change the ordering. + * + * @param ticket The ticket registering the chunk + * @param chunk The chunk to force + */ + public static void forceChunk(Ticket ticket, ChunkCoordIntPair chunk) + { + if (ticket == null || chunk == null) + { + return; + } + if (ticket.ticketType == Type.ENTITY && ticket.entity == null) + { + throw new RuntimeException("Attempted to use an entity ticket to force a chunk, without an entity"); + } + if (ticket.isPlayerTicket() ? !playerTickets.containsValue(ticket) : !tickets.get(ticket.world).containsEntry(ticket.modId, ticket)) + { + FMLLog.severe("The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted.", ticket.modId); + return; + } + ticket.requestedChunks.add(chunk); + MinecraftForge.EVENT_BUS.post(new ForceChunkEvent(ticket, chunk)); + + ImmutableSetMultimap newMap = ImmutableSetMultimap.builder().putAll(forcedChunks.get(ticket.world)).put(chunk, ticket).build(); + forcedChunks.put(ticket.world, newMap); + if (ticket.maxDepth > 0 && ticket.requestedChunks.size() > ticket.maxDepth) + { + ChunkCoordIntPair removed = ticket.requestedChunks.iterator().next(); + unforceChunk(ticket,removed); + } + } + + /** + * Reorganize the internal chunk list so that the chunk supplied is at the *end* of the list + * This helps if you wish to guarantee a certain "automatic unload ordering" for the chunks + * in the ticket list + * + * @param ticket The ticket holding the chunk list + * @param chunk The chunk you wish to push to the end (so that it would be unloaded last) + */ + public static void reorderChunk(Ticket ticket, ChunkCoordIntPair chunk) + { + if (ticket == null || chunk == null || !ticket.requestedChunks.contains(chunk)) + { + return; + } + ticket.requestedChunks.remove(chunk); + ticket.requestedChunks.add(chunk); + } + /** + * Unforce the supplied chunk, allowing it to be unloaded and stop ticking. + * + * @param ticket The ticket holding the chunk + * @param chunk The chunk to unforce + */ + public static void unforceChunk(Ticket ticket, ChunkCoordIntPair chunk) + { + if (ticket == null || chunk == null) + { + return; + } + ticket.requestedChunks.remove(chunk); + MinecraftForge.EVENT_BUS.post(new UnforceChunkEvent(ticket, chunk)); + LinkedHashMultimap copy = LinkedHashMultimap.create(forcedChunks.get(ticket.world)); + copy.remove(chunk, ticket); + ImmutableSetMultimap newMap = ImmutableSetMultimap.copyOf(copy); + forcedChunks.put(ticket.world,newMap); + } + + static void loadConfiguration() + { + ticketConstraints.clear(); + chunkConstraints.clear(); + for (String mod : config.getCategoryNames()) + { + if (mod.equals("Forge") || mod.equals("defaults")) + { + continue; + } + Property modTC = config.get(mod, "maximumTicketCount", 200); + Property modCPT = config.get(mod, "maximumChunksPerTicket", 25); + ticketConstraints.put(mod, modTC.getInt(200)); + chunkConstraints.put(mod, modCPT.getInt(25)); + } + if (config.hasChanged()) + { + config.save(); + } + } + + /** + * The list of persistent chunks in the world. This set is immutable. + * @param world + * @return the list of persistent chunks in the world + */ + public static ImmutableSetMultimap getPersistentChunksFor(World world) + { + return forcedChunks.containsKey(world) ? forcedChunks.get(world) : ImmutableSetMultimap.of(); + } + + static void saveWorld(World world) + { + // only persist persistent worlds + if (!(world instanceof WorldServer)) + { + return; + } + WorldServer worldServer = (WorldServer) world; + File chunkDir = worldServer.getChunkSaveLocation(); + File chunkLoaderData = new File(chunkDir, "forcedchunks.dat"); + + NBTTagCompound forcedChunkData = new NBTTagCompound(); + NBTTagList ticketList = new NBTTagList(); + forcedChunkData.setTag("TicketList", ticketList); + + Multimap ticketSet = tickets.get(worldServer); + if (ticketSet == null) return; + for (String modId : ticketSet.keySet()) + { + NBTTagCompound ticketHolder = new NBTTagCompound(); + ticketList.appendTag(ticketHolder); + + ticketHolder.setString("Owner", modId); + NBTTagList tickets = new NBTTagList(); + ticketHolder.setTag("Tickets", tickets); + + for (Ticket tick : ticketSet.get(modId)) + { + NBTTagCompound ticket = new NBTTagCompound(); + ticket.setByte("Type", (byte) tick.ticketType.ordinal()); + ticket.setByte("ChunkListDepth", (byte) tick.maxDepth); + if (tick.isPlayerTicket()) + { + ticket.setString("ModId", tick.modId); + ticket.setString("Player", tick.player); + } + if (tick.modData != null) + { + ticket.setTag("ModData", tick.modData); + } + if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeToNBTOptional(new NBTTagCompound())) + { + ticket.setInteger("chunkX", MathHelper.floor_double(tick.entity.chunkCoordX)); + ticket.setInteger("chunkZ", MathHelper.floor_double(tick.entity.chunkCoordZ)); + ticket.setLong("PersistentIDMSB", tick.entity.getPersistentID().getMostSignificantBits()); + ticket.setLong("PersistentIDLSB", tick.entity.getPersistentID().getLeastSignificantBits()); + tickets.appendTag(ticket); + } + else if (tick.ticketType != Type.ENTITY) + { + tickets.appendTag(ticket); + } + } + } + try + { + CompressedStreamTools.write(forcedChunkData, chunkLoaderData); + } + catch (IOException e) + { + FMLLog.log(Level.WARN, e, "Unable to write forced chunk data to %s - chunkloading won't work", chunkLoaderData.getAbsolutePath()); + return; + } + } + + static void loadEntity(Entity entity) + { + UUID id = entity.getPersistentID(); + Ticket tick = pendingEntities.get(id); + if (tick != null) + { + tick.bindEntity(entity); + pendingEntities.remove(id); + } + } + + public static void putDormantChunk(long coords, Chunk chunk) + { + Cache cache = dormantChunkCache.get(chunk.worldObj); + if (cache != null) + { + cache.put(coords, chunk); + } + } + + @SuppressWarnings("unchecked") + public static Chunk fetchDormantChunk(long coords, World world) + { + Cache cache = dormantChunkCache.get(world); + if (cache == null) + { + return null; + } + Chunk chunk = cache.getIfPresent(coords); + if (chunk != null) + { + for (List eList : (List[])chunk.entityLists) + { + for (Entity e: eList) + { + e.resetEntityId(); + } + } + } + return chunk; + } + + static void captureConfig(File configDir) + { + cfgFile = new File(configDir,"forgeChunkLoading.cfg"); + config = new Configuration(cfgFile, true); + try + { + config.load(); + } + catch (Exception e) + { + File dest = new File(cfgFile.getParentFile(),"forgeChunkLoading.cfg.bak"); + if (dest.exists()) + { + dest.delete(); + } + cfgFile.renameTo(dest); + FMLLog.log(Level.ERROR, e, "A critical error occured reading the forgeChunkLoading.cfg file, defaults will be used - the invalid file is backed up at forgeChunkLoading.cfg.bak"); + } + syncConfigDefaults(); + } + + /** + * Synchronizes the local fields with the values in the Configuration object. + */ + public static void syncConfigDefaults() + { + // By adding a property order list we are defining the order that the properties will appear both in the config file and on the GUIs. + // Property order lists are defined per-ConfigCategory. + List propOrder = new ArrayList(); + + config.setCategoryComment("defaults", "Default configuration for forge chunk loading control") + .setCategoryRequiresWorldRestart("defaults", true); + + Property temp = config.get("defaults", "enabled", true); + temp.comment = "Are mod overrides enabled?"; + temp.setLanguageKey("forge.configgui.enableModOverrides"); + overridesEnabled = temp.getBoolean(true); + propOrder.add("enabled"); + + temp = config.get("defaults", "maximumChunksPerTicket", 25); + temp.comment = "The default maximum number of chunks a mod can force, per ticket, \n" + + "for a mod without an override. This is the maximum number of chunks a single ticket can force."; + temp.setLanguageKey("forge.configgui.maximumChunksPerTicket"); + temp.setMinValue(0); + defaultMaxChunks = temp.getInt(25); + propOrder.add("maximumChunksPerTicket"); + + temp = config.get("defaults", "maximumTicketCount", 200); + temp.comment = "The default maximum ticket count for a mod which does not have an override\n" + + "in this file. This is the number of chunk loading requests a mod is allowed to make."; + temp.setLanguageKey("forge.configgui.maximumTicketCount"); + temp.setMinValue(0); + defaultMaxCount = temp.getInt(200); + propOrder.add("maximumTicketCount"); + + temp = config.get("defaults", "playerTicketCount", 500); + temp.comment = "The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it."; + temp.setLanguageKey("forge.configgui.playerTicketCount"); + temp.setMinValue(0); + playerTicketLength = temp.getInt(500); + propOrder.add("playerTicketCount"); + + temp = config.get("defaults", "dormantChunkCacheSize", 0); + temp.comment = "Unloaded chunks can first be kept in a dormant cache for quicker\n" + + "loading times. Specify the size (in chunks) of that cache here"; + temp.setLanguageKey("forge.configgui.dormantChunkCacheSize"); + temp.setMinValue(0); + dormantChunkCacheSize = temp.getInt(0); + propOrder.add("dormantChunkCacheSize"); + FMLLog.info("Configured a dormant chunk cache size of %d", temp.getInt(0)); + + config.setCategoryPropertyOrder("defaults", propOrder); + + config.addCustomCategoryComment("Forge", "Sample mod specific control section.\n" + + "Copy this section and rename the with the modid for the mod you wish to override.\n" + + "A value of zero in either entry effectively disables any chunkloading capabilities\n" + + "for that mod"); + + temp = config.get("Forge", "maximumTicketCount", 200); + temp.comment = "Maximum ticket count for the mod. Zero disables chunkloading capabilities."; + temp = config.get("Forge", "maximumChunksPerTicket", 25); + temp.comment = "Maximum chunks per ticket for the mod."; + for (String mod : config.getCategoryNames()) + { + if (mod.equals("Forge") || mod.equals("defaults")) + { + continue; + } + config.get(mod, "maximumTicketCount", 200).setLanguageKey("forge.configgui.maximumTicketCount").setMinValue(0); + config.get(mod, "maximumChunksPerTicket", 25).setLanguageKey("forge.configgui.maximumChunksPerTicket").setMinValue(0); + } + + if (config.hasChanged()) + { + config.save(); + } + } + + public static Configuration getConfig() + { + return config; + } + + public static ConfigCategory getDefaultsCategory() + { + return config.getCategory("defaults"); + } + + public static List getModCategories() + { + List list = new ArrayList(); + for (String mod : config.getCategoryNames()) + { + if (mod.equals("Forge") || mod.equals("defaults")) + { + continue; + } + list.add(config.getCategory(mod)); + } + return list; + } + + public static ConfigCategory getConfigFor(Object mod) + { + ModContainer container = getContainer(mod); + if (container != null) + { + return config.getCategory(container.getModId()); + } + + return null; + } + + public static void addConfigProperty(Object mod, String propertyName, String value, Property.Type type) + { + ModContainer container = getContainer(mod); + if (container != null) + { + ConfigCategory cat = config.getCategory(container.getModId()); + Property prop = new Property(propertyName, value, type).setLanguageKey("forge.configgui." + propertyName); + if (type == Property.Type.INTEGER) + { + prop.setMinValue(0); + } + cat.put(propertyName, prop); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeHooks.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeHooks.java new file mode 100644 index 0000000..0369b8f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeHooks.java @@ -0,0 +1,615 @@ +package net.minecraftforge.common; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.relauncher.ReflectionHelper; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.event.ClickEvent; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemBucket; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityNote; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings.GameType; +import net.minecraftforge.event.AnvilUpdateEvent; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.ServerChatEvent; +import net.minecraftforge.event.entity.item.ItemTossEvent; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingFallEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; +import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent; +import net.minecraftforge.event.entity.player.AnvilRepairEvent; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.event.world.NoteBlockEvent; +import static net.minecraft.init.Blocks.*; + +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.WorldSettings.GameType; +public class ForgeHooks +{ + static class SeedEntry extends WeightedRandom.Item + { + public final ItemStack seed; + public SeedEntry(ItemStack seed, int weight) + { + super(weight); + this.seed = seed; + } + } + static final List seedList = new ArrayList(); + + public static ItemStack getGrassSeed(World world) + { + SeedEntry entry = (SeedEntry)WeightedRandom.getRandomItem(world.rand, seedList); + if (entry == null || entry.seed == null) + { + return null; + } + return entry.seed.copy(); + } + + private static boolean toolInit = false; + //static HashSet toolEffectiveness = new HashSet(); + + public static boolean canHarvestBlock(Block block, EntityPlayer player, int metadata) + { + if (block.getMaterial().isToolNotRequired()) + { + return true; + } + + ItemStack stack = player.inventory.getCurrentItem(); + String tool = block.getHarvestTool(metadata); + if (stack == null || tool == null) + { + return player.canHarvestBlock(block); + } + + int toolLevel = stack.getItem().getHarvestLevel(stack, tool); + if (toolLevel < 0) + { + return player.canHarvestBlock(block); + } + + return toolLevel >= block.getHarvestLevel(metadata); + } + + public static boolean canToolHarvestBlock(Block block, int metadata, ItemStack stack) + { + String tool = block.getHarvestTool(metadata); + if (stack == null || tool == null) return false; + return stack.getItem().getHarvestLevel(stack, tool) >= block.getHarvestLevel(metadata); + } + + public static float blockStrength(Block block, EntityPlayer player, World world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + float hardness = block.getBlockHardness(world, x, y, z); + if (hardness < 0.0F) + { + return 0.0F; + } + + if (!canHarvestBlock(block, player, metadata)) + { + return player.getBreakSpeed(block, true, metadata, x, y, z) / hardness / 100F; + } + else + { + return player.getBreakSpeed(block, false, metadata, x, y, z) / hardness / 30F; + } + } + + public static boolean isToolEffective(ItemStack stack, Block block, int metadata) + { + for (String type : stack.getItem().getToolClasses(stack)) + { + if (block.isToolEffective(type, metadata)) + return true; + } + return false; + } + + static void initTools() + { + if (toolInit) + { + return; + } + toolInit = true; + + Set blocks = ReflectionHelper.getPrivateValue(ItemPickaxe.class, null, 0); + for (Block block : blocks) + { + block.setHarvestLevel("pickaxe", 0); + } + + blocks = ReflectionHelper.getPrivateValue(ItemSpade.class, null, 0); + for (Block block : blocks) + { + block.setHarvestLevel("shovel", 0); + } + + blocks = ReflectionHelper.getPrivateValue(ItemAxe.class, null, 0); + for (Block block : blocks) + { + block.setHarvestLevel("axe", 0); + } + + Blocks.obsidian.setHarvestLevel("pickaxe", 3); + for (Block block : new Block[]{emerald_ore, emerald_block, diamond_ore, diamond_block, gold_ore, gold_block, redstone_ore, lit_redstone_ore}) + { + block.setHarvestLevel("pickaxe", 2); + } + Blocks.iron_ore.setHarvestLevel("pickaxe", 1); + Blocks.iron_block.setHarvestLevel("pickaxe", 1); + Blocks.lapis_ore.setHarvestLevel("pickaxe", 1); + Blocks.lapis_block.setHarvestLevel("pickaxe", 1); + Blocks.quartz_ore.setHarvestLevel("pickaxe", 0); + } + + public static int getTotalArmorValue(EntityPlayer player) + { + int ret = 0; + for (int x = 0; x < player.inventory.armorInventory.length; x++) + { + ItemStack stack = player.inventory.armorInventory[x]; + if (stack != null && stack.getItem() instanceof ISpecialArmor) + { + ret += ((ISpecialArmor)stack.getItem()).getArmorDisplay(player, stack, x); + } + else if (stack != null && stack.getItem() instanceof ItemArmor) + { + ret += ((ItemArmor)stack.getItem()).damageReduceAmount; + } + } + return ret; + } + + static + { + seedList.add(new SeedEntry(new ItemStack(Items.wheat_seeds), 10)); + initTools(); + } + + /** + * Called when a player uses 'pick block', calls new Entity and Block hooks. + */ + public static boolean onPickBlock(MovingObjectPosition target, EntityPlayer player, World world) + { + ItemStack result = null; + boolean isCreative = player.capabilities.isCreativeMode; + + if (target.typeOfHit == MovingObjectType.BLOCK) + { + int x = target.blockX; + int y = target.blockY; + int z = target.blockZ; + Block block = world.getBlock(x, y, z); + + if (block.isAir(world, x, y, z)) + { + return false; + } + + result = block.getPickBlock(target, world, x, y, z, player); + } + else + { + if (target.typeOfHit != MovingObjectType.ENTITY || target.entityHit == null || !isCreative) + { + return false; + } + + result = target.entityHit.getPickedResult(target); + } + + if (result == null) + { + return false; + } + + for (int x = 0; x < 9; x++) + { + ItemStack stack = player.inventory.getStackInSlot(x); + if (stack != null && stack.isItemEqual(result) && ItemStack.areItemStackTagsEqual(stack, result)) + { + player.inventory.currentItem = x; + return true; + } + } + + if (!isCreative) + { + return false; + } + + int slot = player.inventory.getFirstEmptyStack(); + if (slot < 0 || slot >= 9) + { + slot = player.inventory.currentItem; + } + + player.inventory.setInventorySlotContents(slot, result); + player.inventory.currentItem = slot; + return true; + } + + //Optifine Helper Functions u.u, these are here specifically for Optifine + //Note: When using Optfine, these methods are invoked using reflection, which + //incurs a major performance penalty. + public static void onLivingSetAttackTarget(EntityLivingBase entity, EntityLivingBase target) + { + MinecraftForge.EVENT_BUS.post(new LivingSetAttackTargetEvent(entity, target)); + } + + public static boolean onLivingUpdate(EntityLivingBase entity) + { + return MinecraftForge.EVENT_BUS.post(new LivingUpdateEvent(entity)); + } + + public static boolean onLivingAttack(EntityLivingBase entity, DamageSource src, float amount) + { + return MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount)); + } + + public static float onLivingHurt(EntityLivingBase entity, DamageSource src, float amount) + { + LivingHurtEvent event = new LivingHurtEvent(entity, src, amount); + return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.ammount); + } + + public static boolean onLivingDeath(EntityLivingBase entity, DamageSource src) + { + return MinecraftForge.EVENT_BUS.post(new LivingDeathEvent(entity, src)); + } + + public static boolean onLivingDrops(EntityLivingBase entity, DamageSource source, ArrayList drops, int lootingLevel, boolean recentlyHit, int specialDropValue) + { + return MinecraftForge.EVENT_BUS.post(new LivingDropsEvent(entity, source, drops, lootingLevel, recentlyHit, specialDropValue)); + } + + public static float onLivingFall(EntityLivingBase entity, float distance) + { + LivingFallEvent event = new LivingFallEvent(entity, distance); + return (MinecraftForge.EVENT_BUS.post(event) ? 0.0f : event.distance); + } + + public static boolean isLivingOnLadder(Block block, World world, int x, int y, int z, EntityLivingBase entity) + { + if (!ForgeModContainer.fullBoundingBoxLadders) + { + return block != null && block.isLadder(world, x, y, z, entity); + } + else + { + AxisAlignedBB bb = entity.boundingBox; + int mX = MathHelper.floor_double(bb.minX); + int mY = MathHelper.floor_double(bb.minY); + int mZ = MathHelper.floor_double(bb.minZ); + for (int y2 = mY; y2 < bb.maxY; y2++) + { + for (int x2 = mX; x2 < bb.maxX; x2++) + { + for (int z2 = mZ; z2 < bb.maxZ; z2++) + { + block = world.getBlock(x2, y2, z2); + if (block != null && block.isLadder(world, x2, y2, z2, entity)) + { + return true; + } + } + } + } + return false; + } + } + + public static void onLivingJump(EntityLivingBase entity) + { + MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity)); + } + + public static EntityItem onPlayerTossEvent(EntityPlayer player, ItemStack item, boolean includeName) + { + player.captureDrops = true; + EntityItem ret = player.func_146097_a(item, false, includeName); + player.capturedDrops.clear(); + player.captureDrops = false; + + if (ret == null) + { + return null; + } + + ItemTossEvent event = new ItemTossEvent(ret, player); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return null; + } + + player.joinEntityItemWithWorld(event.entityItem); + return event.entityItem; + } + + public static float getEnchantPower(World world, int x, int y, int z) + { + return world.getBlock(x, y, z).getEnchantPowerBonus(world, x, y, z); + } + + public static ChatComponentTranslation onServerChatEvent(NetHandlerPlayServer net, String raw, ChatComponentTranslation comp) + { + ServerChatEvent event = new ServerChatEvent(net.playerEntity, raw, comp); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return null; + } + return event.component; + } + + public static IChatComponent newChatWithLinks(String string) + { + // Includes ipv4 and domain pattern + // Matches an ip (xx.xxx.xx.xxx) or a domain (something.com) with or + // without a protocol or path. + final Pattern URL_PATTERN = Pattern.compile( + // schema ipv4 OR namespace port path ends + // |-----------------| |-------------------------| |----------------------------| |---------| |--| |---------------| + "((?:[a-z0-9]{2,}:\\/\\/)?(?:(?:[0-9]{1,3}\\.){3}[0-9]{1,3}|(?:[-\\w_\\.]{1,}\\.[a-z]{2,}?))(?::[0-9]{1,5})?.*?(?=[!\"\u00A7 \n]|$))", + Pattern.CASE_INSENSITIVE); + IChatComponent ichat = new ChatComponentText(""); + Matcher matcher = URL_PATTERN.matcher(string); + int lastEnd = 0; + String remaining = string; + + // Find all urls + while (matcher.find()) + { + int start = matcher.start(); + int end = matcher.end(); + + // Append the previous left overs. + ichat.appendText(string.substring(lastEnd, start)); + lastEnd = end; + String url = string.substring(start, end); + IChatComponent link = new ChatComponentText(url); + + // Add schema so client doesn't crash. + if (URI.create(url).getScheme() == null) + { + url = "http://" + url; + } + + // Set the click event and append the link. + ClickEvent click = new ClickEvent(ClickEvent.Action.OPEN_URL, url); + link.getChatStyle().setChatClickEvent(click); + ichat.appendSibling(link); + } + + // Append the rest of the message. + ichat.appendText(string.substring(lastEnd)); + return ichat; + } + + public static boolean canInteractWith(EntityPlayer player, Container openContainer) + { + PlayerOpenContainerEvent event = new PlayerOpenContainerEvent(player, openContainer); + MinecraftForge.EVENT_BUS.post(event); + return event.getResult() == Event.Result.DEFAULT ? event.canInteractWith : event.getResult() == Event.Result.ALLOW ? true : false; + } + + public static BlockEvent.BreakEvent onBlockBreakEvent(World world, GameType gameType, EntityPlayerMP entityPlayer, int x, int y, int z) + { + // Logic from tryHarvestBlock for pre-canceling the event + boolean preCancelEvent = false; + if (gameType.isAdventure() && !entityPlayer.isCurrentToolAdventureModeExempt(x, y, z)) + { + preCancelEvent = true; + } + else if (gameType.isCreative() && entityPlayer.getHeldItem() != null && entityPlayer.getHeldItem().getItem() instanceof ItemSword) + { + preCancelEvent = true; + } + + // Tell client the block is gone immediately then process events + if (world.getTileEntity(x, y, z) == null) + { + S23PacketBlockChange packet = new S23PacketBlockChange(x, y, z, world); + packet.field_148883_d = Blocks.air; + packet.field_148884_e = 0; + entityPlayer.playerNetServerHandler.sendPacket(packet); + } + + // Post the block break event + Block block = world.getBlock(x, y, z); + int blockMetadata = world.getBlockMetadata(x, y, z); + BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, block, blockMetadata, entityPlayer); + event.setCanceled(preCancelEvent); + MinecraftForge.EVENT_BUS.post(event); + + // Handle if the event is canceled + if (event.isCanceled()) + { + // Let the client know the block still exists + entityPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world)); + + // Update any tile entity data for this block + TileEntity tileentity = world.getTileEntity(x, y, z); + if (tileentity != null) + { + Packet pkt = tileentity.getDescriptionPacket(); + if (pkt != null) + { + entityPlayer.playerNetServerHandler.sendPacket(pkt); + } + } + } + return event; + } + + public static boolean onPlaceItemIntoWorld(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + // handle all placement events here + int meta = itemstack.getItemDamage(); + int size = itemstack.stackSize; + NBTTagCompound nbt = null; + if (itemstack.getTagCompound() != null) + { + nbt = (NBTTagCompound)itemstack.getTagCompound().copy(); + } + + if (!(itemstack.getItem() instanceof ItemBucket)) // if not bucket + { + world.captureBlockSnapshots = true; + } + + boolean flag = itemstack.getItem().onItemUse(itemstack, player, world, x, y, z, side, hitX, hitY, hitZ); + world.captureBlockSnapshots = false; + + if (flag) + { + // save new item data + int newMeta = itemstack.getItemDamage(); + int newSize = itemstack.stackSize; + NBTTagCompound newNBT = null; + if (itemstack.getTagCompound() != null) + { + newNBT = (NBTTagCompound)itemstack.getTagCompound().copy(); + } + net.minecraftforge.event.world.BlockEvent.PlaceEvent placeEvent = null; + List blockSnapshots = (List) world.capturedBlockSnapshots.clone(); + world.capturedBlockSnapshots.clear(); + + // make sure to set pre-placement item data for event + itemstack.setItemDamage(meta); + itemstack.stackSize = size; + if (nbt != null) + { + itemstack.setTagCompound(nbt); + } + if (blockSnapshots.size() > 1) + { + placeEvent = ForgeEventFactory.onPlayerMultiBlockPlace(player, blockSnapshots, net.minecraftforge.common.util.ForgeDirection.getOrientation(side)); + } + else if (blockSnapshots.size() == 1) + { + placeEvent = ForgeEventFactory.onPlayerBlockPlace(player, blockSnapshots.get(0), net.minecraftforge.common.util.ForgeDirection.getOrientation(side)); + } + + if (placeEvent != null && (placeEvent.isCanceled())) + { + flag = false; // cancel placement + // revert back all captured blocks + for (net.minecraftforge.common.util.BlockSnapshot blocksnapshot : blockSnapshots) + { + world.restoringBlockSnapshots = true; + blocksnapshot.restore(true, false); + world.restoringBlockSnapshots = false; + } + } + else + { + // Change the stack to its new content + itemstack.setItemDamage(newMeta); + itemstack.stackSize = newSize; + if (nbt != null) + { + itemstack.setTagCompound(newNBT); + } + + for (net.minecraftforge.common.util.BlockSnapshot blocksnapshot : blockSnapshots) + { + int blockX = blocksnapshot.x; + int blockY = blocksnapshot.y; + int blockZ = blocksnapshot.z; + int metadata = world.getBlockMetadata(blockX, blockY, blockZ); + int updateFlag = blocksnapshot.flag; + Block oldBlock = blocksnapshot.replacedBlock; + Block newBlock = world.getBlock(blockX, blockY, blockZ); + if (newBlock != null && !(newBlock.hasTileEntity(metadata))) // Containers get placed automatically + { + newBlock.onBlockAdded(world, blockX, blockY, blockZ); + } + + world.markAndNotifyBlock(blockX, blockY, blockZ, null, oldBlock, newBlock, updateFlag); + } + player.addStat(StatList.objectUseStats[Item.getIdFromItem(itemstack.getItem())], 1); + } + } + world.capturedBlockSnapshots.clear(); + + return flag; + } + + public static boolean onAnvilChange(ContainerRepair container, ItemStack left, ItemStack right, IInventory outputSlot, String name, int baseCost) + { + AnvilUpdateEvent e = new AnvilUpdateEvent(left, right, name, baseCost); + if (MinecraftForge.EVENT_BUS.post(e)) return false; + if (e.output == null) return true; + + outputSlot.setInventorySlotContents(0, e.output); + container.maximumCost = e.cost; + container.stackSizeToBeUsedInRepair = e.materialCost; + return false; + } + + public static float onAnvilRepair(EntityPlayer player, ItemStack output, ItemStack left, ItemStack right) + { + AnvilRepairEvent e = new AnvilRepairEvent(player, left, right, output); + MinecraftForge.EVENT_BUS.post(e); + return e.breakChance; + } + + public static boolean onNoteChange(TileEntityNote te, byte old) + { + NoteBlockEvent.Change e = new NoteBlockEvent.Change(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.getBlockMetadata(), old, te.note); + if (MinecraftForge.EVENT_BUS.post(e)) + { + te.note = old; + return false; + } + te.note = (byte)e.getVanillaNoteId(); + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeInternalHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeInternalHandler.java new file mode 100644 index 0000000..a3a5ed9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeInternalHandler.java @@ -0,0 +1,80 @@ +package net.minecraftforge.common; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.util.FakePlayerFactory; +import net.minecraftforge.event.entity.*; +import net.minecraftforge.event.world.WorldEvent; + +public class ForgeInternalHandler +{ + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onEntityJoinWorld(EntityJoinWorldEvent event) + { + if (!event.world.isRemote) + { + ForgeChunkManager.loadEntity(event.entity); + } + + Entity entity = event.entity; + if (entity.getClass().equals(EntityItem.class)) + { + ItemStack stack = entity.getDataWatcher().getWatchableObjectItemStack(10); + + if (stack == null) + { + //entity.setDead(); + //event.setCanceled(true); + return; + } + + Item item = stack.getItem(); + if (item == null) + { + FMLLog.warning("Attempted to add a EntityItem to the world with a invalid item at " + + "(%2.2f, %2.2f, %2.2f), this is most likely a config issue between you and the server. Please double check your configs", + entity.posX, entity.posY, entity.posZ); + entity.setDead(); + event.setCanceled(true); + return; + } + + if (item.hasCustomEntity(stack)) + { + Entity newEntity = item.createEntity(event.world, entity, stack); + if (newEntity != null) + { + entity.setDead(); + event.setCanceled(true); + event.world.spawnEntityInWorld(newEntity); + } + } + } + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onDimensionLoad(WorldEvent.Load event) + { + ForgeChunkManager.loadWorld(event.world); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onDimensionSave(WorldEvent.Save event) + { + ForgeChunkManager.saveWorld(event.world); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onDimensionUnload(WorldEvent.Unload event) + { + ForgeChunkManager.unloadWorld(event.world); + if (event.world instanceof WorldServer) + FakePlayerFactory.unloadWorld((WorldServer)event.world); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeModContainer.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeModContainer.java new file mode 100644 index 0000000..eb9b3df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeModContainer.java @@ -0,0 +1,394 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common; + +import static net.minecraftforge.common.ForgeVersion.buildVersion; +import static net.minecraftforge.common.ForgeVersion.majorVersion; +import static net.minecraftforge.common.ForgeVersion.minorVersion; +import static net.minecraftforge.common.ForgeVersion.revisionVersion; +import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL; + +import java.io.File; +import java.security.cert.Certificate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.storage.SaveHandler; +import net.minecraft.world.storage.WorldInfo; +import net.minecraftforge.classloading.FMLForgePlugin; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; +import net.minecraftforge.common.network.ForgeNetworkHandler; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.server.command.ForgeCommand; + +import com.google.common.collect.ImmutableList; +import com.google.common.eventbus.EventBus; +import com.google.common.eventbus.Subscribe; + +import cpw.mods.fml.client.FMLFileResourcePack; +import cpw.mods.fml.client.FMLFolderResourcePack; +import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent; +import cpw.mods.fml.common.DummyModContainer; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.WorldAccessContainer; +import cpw.mods.fml.common.event.FMLConstructionEvent; +import cpw.mods.fml.common.event.FMLLoadCompleteEvent; +import cpw.mods.fml.common.event.FMLModIdMappingEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; +import cpw.mods.fml.common.network.NetworkRegistry; + +public class ForgeModContainer extends DummyModContainer implements WorldAccessContainer +{ + public static int clumpingThreshold = 64; + public static boolean removeErroringEntities = false; + public static boolean removeErroringTileEntities = false; + public static boolean disableStitchedFileSaving = false; + public static boolean fullBoundingBoxLadders = false; + public static double zombieSummonBaseChance = 0.1; + public static int[] blendRanges = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }; + public static float zombieBabyChance = 0.05f; + public static boolean shouldSortRecipies = true; + public static boolean disableVersionCheck = false; + public static int defaultSpawnFuzz = 20; + public static boolean defaultHasSpawnFuzz = true; + + private static Configuration config; + + public ForgeModContainer() + { + super(new ModMetadata()); + ModMetadata meta = getMetadata(); + meta.modId = "Forge"; + meta.name = "Minecraft Forge"; + meta.version = String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion); + meta.credits = "Made possible with help from many people"; + meta.authorList = Arrays.asList("LexManos", "Eloraam", "Spacetoad"); + meta.description = "Minecraft Forge is a common open source API allowing a broad range of mods " + + "to work cooperatively together. It allows many mods to be created without " + + "them editing the main Minecraft code."; + meta.url = "http://MinecraftForge.net"; + meta.updateUrl = "http://MinecraftForge.net/forum/index.php/topic,5.0.html"; + meta.screenshots = new String[0]; + meta.logoFile = "/forge_logo.png"; + + config = null; + File cfgFile = new File(Loader.instance().getConfigDir(), "forge.cfg"); + config = new Configuration(cfgFile); + + syncConfig(true); + } + + @Override + public String getGuiClassName() + { + return "net.minecraftforge.client.gui.ForgeGuiFactory"; + } + + public static Configuration getConfig() + { + return config; + } + + /** + * Synchronizes the local fields with the values in the Configuration object. + */ + private static void syncConfig(boolean load) + { + // By adding a property order list we are defining the order that the properties will appear both in the config file and on the GUIs. + // Property order lists are defined per-ConfigCategory. + List propOrder = new ArrayList(); + + if (!config.isChild) + { + if (load) + { + config.load(); + } + Property enableGlobalCfg = config.get(Configuration.CATEGORY_GENERAL, "enableGlobalConfig", false).setShowInGui(false); + if (enableGlobalCfg.getBoolean(false)) + { + Configuration.enableGlobalConfig(); + } + } + + Property prop; + + prop = config.get(CATEGORY_GENERAL, "disableVersionCheck", false); + prop.comment = "Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github."; + // Language keys are a good idea to implement if you are using config GUIs. This allows you to use a .lang file that will hold the + // "pretty" version of the property name as well as allow others to provide their own localizations. + // This language key is also used to get the tooltip for a property. The tooltip language key is langKey + ".tooltip". + // If no tooltip language key is defined in your .lang file, the tooltip will default to the property comment field. + prop.setLanguageKey("forge.configgui.disableVersionCheck"); + disableVersionCheck = prop.getBoolean(disableVersionCheck); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "clumpingThreshold", 64, + "Controls the number threshold at which Packet51 is preferred over Packet52, default and minimum 64, maximum 1024", 64, 1024); + prop.setLanguageKey("forge.configgui.clumpingThreshold").setRequiresWorldRestart(true); + clumpingThreshold = prop.getInt(64); + if (clumpingThreshold > 1024 || clumpingThreshold < 64) + { + clumpingThreshold = 64; + prop.set(64); + } + propOrder.add(prop.getName()); + + prop = config.get(CATEGORY_GENERAL, "sortRecipies", true); + prop.comment = "Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI."; + prop.setLanguageKey("forge.configgui.sortRecipies").setRequiresMcRestart(true); + shouldSortRecipies = prop.getBoolean(shouldSortRecipies); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "removeErroringEntities", false); + prop.comment = "Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES."; + prop.setLanguageKey("forge.configgui.removeErroringEntities").setRequiresWorldRestart(true); + removeErroringEntities = prop.getBoolean(false); + propOrder.add(prop.getName()); + + if (removeErroringEntities) + { + FMLLog.warning("Enabling removal of erroring Entities - USE AT YOUR OWN RISK"); + } + + prop = config.get(Configuration.CATEGORY_GENERAL, "removeErroringTileEntities", false); + prop.comment = "Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES."; + prop.setLanguageKey("forge.configgui.removeErroringTileEntities").setRequiresWorldRestart(true); + removeErroringTileEntities = prop.getBoolean(false); + propOrder.add(prop.getName()); + + if (removeErroringTileEntities) + { + FMLLog.warning("Enabling removal of erroring Tile Entities - USE AT YOUR OWN RISK"); + } + + //prop = config.get(Configuration.CATEGORY_GENERAL, "disableStitchedFileSaving", true); + //prop.comment = "Set this to just disable the texture stitcher from writing the 'debug.stitched_{name}.png file to disc. Just a small performance tweak. Default: true"; + //disableStitchedFileSaving = prop.getBoolean(true); + + prop = config.get(Configuration.CATEGORY_GENERAL, "fullBoundingBoxLadders", false); + prop.comment = "Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticable differences in mechanics so default is vanilla behavior. Default: false"; + prop.setLanguageKey("forge.configgui.fullBoundingBoxLadders").setRequiresWorldRestart(true); + fullBoundingBoxLadders = prop.getBoolean(false); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "biomeSkyBlendRange", new int[] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34 }); + prop.comment = "Control the range of sky blending for colored skies in biomes."; + prop.setLanguageKey("forge.configgui.biomeSkyBlendRange"); + blendRanges = prop.getIntList(); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBaseSummonChance", 0.1, + "Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic.", 0.0D, 1.0D); + prop.setLanguageKey("forge.configgui.zombieBaseSummonChance").setRequiresWorldRestart(true); + zombieSummonBaseChance = prop.getDouble(0.1); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "zombieBabyChance", 0.05, + "Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic.", 0.0D, 1.0D); + prop.setLanguageKey("forge.configgui.zombieBabyChance").setRequiresWorldRestart(true); + zombieBabyChance = (float) prop.getDouble(0.05); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "defaultSpawnFuzz", 20, + "The spawn fuzz when a player respawns in the world, this is controlable by WorldType, this config option is for the default overworld.", + 1, Integer.MAX_VALUE); + prop.setLanguageKey("forge.configgui.spawnfuzz").setRequiresWorldRestart(false); + defaultSpawnFuzz = prop.getInt(20); + propOrder.add(prop.getName()); + + prop = config.get(Configuration.CATEGORY_GENERAL, "spawnHasFuzz", Boolean.TRUE, + "If the overworld has ANY spawn fuzz at all. If not, the spawn will always be the exact same location."); + prop.setLanguageKey("forge.configgui.hasspawnfuzz").setRequiresWorldRestart(false); + defaultHasSpawnFuzz = prop.getBoolean(Boolean.TRUE); + propOrder.add(prop.getName()); + + config.setCategoryPropertyOrder(CATEGORY_GENERAL, propOrder); + + if (config.hasChanged()) + { + config.save(); + } + } + + /** + * By subscribing to the OnConfigChangedEvent we are able to execute code when our config screens are closed. + * This implementation uses the optional configID string to handle multiple Configurations using one event handler. + */ + @SubscribeEvent + public void onConfigChanged(OnConfigChangedEvent event) + { + if (getMetadata().modId.equals(event.modID) && !event.isWorldRunning) + { + if (Configuration.CATEGORY_GENERAL.equals(event.configID)) + { + syncConfig(false); + } + else if ("chunkLoader".equals(event.configID)) + { + ForgeChunkManager.syncConfigDefaults(); + ForgeChunkManager.loadConfiguration(); + } + } + } + + @SubscribeEvent + public void playerLogin(PlayerEvent.PlayerLoggedInEvent event) + { + UsernameCache.setUsername(event.player.getGameProfile().getId(), event.player.getGameProfile().getName()); + } + + @Override + public boolean registerBus(EventBus bus, LoadController controller) + { + bus.register(this); + return true; + } + + @Subscribe + public void modConstruction(FMLConstructionEvent evt) + { + NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData()); + ForgeNetworkHandler.registerChannel(this, evt.getSide()); + } + + @Subscribe + public void preInit(FMLPreInitializationEvent evt) + { + MinecraftForge.EVENT_BUS.register(MinecraftForge.INTERNAL_HANDLER); + ForgeChunkManager.captureConfig(evt.getModConfigurationDirectory()); + FMLCommonHandler.instance().bus().register(this); + + if (!ForgeModContainer.disableVersionCheck) + { + ForgeVersion.startVersionCheck(); + } + } + + @Subscribe + public void postInit(FMLPostInitializationEvent evt) + { + BiomeDictionary.registerAllBiomesAndGenerateEvents(); + ForgeChunkManager.loadConfiguration(); + } + + @Subscribe + public void onAvailable(FMLLoadCompleteEvent evt) + { + if (shouldSortRecipies) + { + RecipeSorter.sortCraftManager(); + } + FluidRegistry.validateFluidRegistry(); + } + + @Subscribe + public void serverStarting(FMLServerStartingEvent evt) + { + evt.registerServerCommand(new ForgeCommand(evt.getServer())); + } + @Override + public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info) + { + NBTTagCompound forgeData = new NBTTagCompound(); + NBTTagCompound dimData = DimensionManager.saveDimensionDataMap(); + forgeData.setTag("DimensionData", dimData); + FluidRegistry.writeDefaultFluidList(forgeData); + return forgeData; + } + + @Override + public void readData(SaveHandler handler, WorldInfo info, Map propertyMap, NBTTagCompound tag) + { + DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompoundTag("DimensionData") : null); + FluidRegistry.loadFluidDefaults(tag); + } + + @Subscribe + public void mappingChanged(FMLModIdMappingEvent evt) + { + Blocks.fire.rebuildFireInfo(); + OreDictionary.rebakeMap(); + } + + + @Override + public File getSource() + { + return FMLForgePlugin.forgeLocation; + } + @Override + public Class getCustomResourcePackClass() + { + if (getSource().isDirectory()) + { + return FMLFolderResourcePack.class; + } + else + { + return FMLFileResourcePack.class; + } + } + + @Override + public List getOwnedPackages() + { + // All the packages which are part of forge. Only needs updating if new logic is added + // that requires event handlers + return ImmutableList.of( + "net.minecraftforge.classloading", + "net.minecraftforge.client", + "net.minecraftforge.client.event", + "net.minecraftforge.client.event.sound", + "net.minecraftforge.client.model", + "net.minecraftforge.client.model.obj", + "net.minecraftforge.client.model.techne", + "net.minecraftforge.common", + "net.minecraftforge.common.config", + "net.minecraftforge.common.network", + "net.minecraftforge.common.util", + "net.minecraftforge.event", + "net.minecraftforge.event.brewing", + "net.minecraftforge.event.entity", + "net.minecraftforge.event.entity.item", + "net.minecraftforge.event.entity.living", + "net.minecraftforge.event.entity.minecart", + "net.minecraftforge.event.entity.player", + "net.minecraftforge.event.terraingen", + "net.minecraftforge.event.world", + "net.minecraftforge.fluids", + "net.minecraftforge.oredict", + "net.minecraftforge.server", + "net.minecraftforge.server.command", + "net.minecraftforge.transformers" + ); + } + + + + @Override + public Certificate getSigningCertificate() + { + Certificate[] certificates = getClass().getProtectionDomain().getCodeSource().getCertificates(); + return certificates != null ? certificates[0] : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeVersion.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeVersion.java new file mode 100644 index 0000000..032edd5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ForgeVersion.java @@ -0,0 +1,148 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common; +import static net.minecraftforge.common.ForgeVersion.Status.*; + +import java.io.InputStream; +import java.net.URL; +import java.util.Map; + +import com.google.common.io.ByteStreams; +import com.google.gson.Gson; + +import cpw.mods.fml.common.versioning.ArtifactVersion; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; + +public class ForgeVersion +{ + //This number is incremented every time we remove deprecated code/major API changes, never reset + public static final int majorVersion = 10; + //This number is incremented every minecraft release, never reset + public static final int minorVersion = 13; + //This number is incremented every time a interface changes or new major feature is added, and reset every Minecraft version + public static final int revisionVersion = 4; + //This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code. + public static final int buildVersion = 1614; + + private static Status status = PENDING; + private static String target = null; + + public static int getMajorVersion() + { + return majorVersion; + } + + public static int getMinorVersion() + { + return minorVersion; + } + + public static int getRevisionVersion() + { + return revisionVersion; + } + + public static int getBuildVersion() + { + return buildVersion; + } + + public static Status getStatus() + { + return status; + } + + public static String getTarget() + { + return target; + } + + public static String getVersion() + { + return String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion); + } + + public static enum Status + { + PENDING, + FAILED, + UP_TO_DATE, + OUTDATED, + AHEAD, + BETA, + BETA_OUTDATED + } + + public static void startVersionCheck() + { + new Thread("Forge Version Check") + { + @SuppressWarnings("unchecked") + @Override + public void run() + { + try + { + URL url = new URL("http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json"); + InputStream con = url.openStream(); + String data = new String(ByteStreams.toByteArray(con)); + con.close(); + + Map json = new Gson().fromJson(data, Map.class); + //String homepage = (String)json.get("homepage"); + Map promos = (Map)json.get("promos"); + + String rec = promos.get(MinecraftForge.MC_VERSION + "-recommended"); + String lat = promos.get(MinecraftForge.MC_VERSION + "-latest"); + ArtifactVersion current = new DefaultArtifactVersion(getVersion()); + + if (rec != null) + { + ArtifactVersion recommended = new DefaultArtifactVersion(rec); + int diff = recommended.compareTo(current); + + if (diff == 0) + status = UP_TO_DATE; + else if (diff < 0) + { + status = AHEAD; + if (lat != null) + { + if (current.compareTo(new DefaultArtifactVersion(lat)) < 0) + { + status = OUTDATED; + target = lat; + } + } + } + else + { + status = OUTDATED; + target = rec; + } + } + else if (lat != null) + { + if (current.compareTo(new DefaultArtifactVersion(lat)) < 0) + { + status = BETA_OUTDATED; + target = lat; + } + else + status = BETA; + } + else + status = BETA; + } + catch (Exception e) + { + e.printStackTrace(); + status = FAILED; + } + } + }.start(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/IExtendedEntityProperties.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/IExtendedEntityProperties.java new file mode 100644 index 0000000..13a66bd --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/IExtendedEntityProperties.java @@ -0,0 +1,39 @@ +package net.minecraftforge.common; + +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +/** + * Allows for custom entity data and logic to be hooked to existing entity classes. + * + * @author cpw, mithion + * + */ +public interface IExtendedEntityProperties { + /** + * Called when the entity that this class is attached to is saved. + * Any custom entity data that needs saving should be saved here. + * @param compound The compound to save to. + */ + public void saveNBTData(NBTTagCompound compound); + + /** + * Called when the entity that this class is attached to is loaded. + * In order to hook into this, you will need to subscribe to the EntityConstructing event. + * Otherwise, you will need to initialize manually. + * @param compound The compound to load from. + */ + public void loadNBTData(NBTTagCompound compound); + + /** + * Used to initialize the extended properties with the entity that this is attached to, as well + * as the world object. + * Called automatically if you register with the EntityConstructing event. + * May be called multiple times if the extended properties is moved over to a new entity. + * Such as when a player switches dimension {Minecraft re-creates the player entity} + * @param entity The entity that this extended properties is attached to + * @param world The world in which the entity exists + */ + public void init(Entity entity, World world); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/IMinecartCollisionHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/IMinecartCollisionHandler.java new file mode 100644 index 0000000..9fde1a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/IMinecartCollisionHandler.java @@ -0,0 +1,49 @@ +package net.minecraftforge.common; + +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; + +/** + * This class defines a replacement for the default minecart collision code. + * Only one handler can be registered at a time. It it registered with EntityMinecart.registerCollisionHandler(). + * If you use this, make it a configuration option. + * @author CovertJaguar + */ +public interface IMinecartCollisionHandler +{ + + /** + * This basically replaces the function of the same name in EnityMinecart. + * Code in IMinecartHooks.applyEntityCollisionHook is still run. + * @param cart The cart that called the collision. + * @param other The object it collided with. + */ + public void onEntityCollision(EntityMinecart cart, Entity other); + + /** + * This function replaced the function of the same name in EntityMinecart. + * It is used to define whether minecarts collide with specific entities, + * for example items. + * @param cart The cart for which the collision box was requested. + * @param other The entity requesting the collision box. + * @return The collision box or null. + */ + public AxisAlignedBB getCollisionBox(EntityMinecart cart, Entity other); + + /** + * This function is used to define the box used for detecting minecart collisions. + * It is generally bigger that the normal collision box. + * @param cart The cart for which the collision box was requested. + * @return The collision box, cannot be null. + */ + public AxisAlignedBB getMinecartCollisionBox(EntityMinecart cart); + + /** + * This function replaces the function of the same name in EntityMinecart. + * It defines whether minecarts are solid to the player. + * @param cart The cart for which the bounding box was requested. + * @return The bounding box or null. + */ + public AxisAlignedBB getBoundingBox(EntityMinecart cart); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/IPlantable.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/IPlantable.java new file mode 100644 index 0000000..d316bf7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/IPlantable.java @@ -0,0 +1,11 @@ +package net.minecraftforge.common; + +import net.minecraft.block.Block; +import net.minecraft.world.IBlockAccess; + +public interface IPlantable +{ + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z); + public Block getPlant(IBlockAccess world, int x, int y, int z); + public int getPlantMetadata(IBlockAccess world, int x, int y, int z); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/IShearable.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/IShearable.java new file mode 100644 index 0000000..fb60806 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/IShearable.java @@ -0,0 +1,52 @@ +package net.minecraftforge.common; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; + +/** + * + * This allows for mods to create there own Shear-like items + * and have them interact with Blocks/Entities without extra work. + * Also, if your block/entity supports the Shears, this allows you + * to support mod-shears as well. + * + */ +public interface IShearable +{ + /** + * Checks if the object is currently shearable + * Example: Sheep return false when they have no wool + * + * @param item The itemstack that is being used, Possible to be null + * @param world The current world + * @param x The X Position + * @param y The Y Position + * @param z The Z Position + * @return If this is shearable, and onSheared should be called. + */ + public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z); + + /** + * Performs the shear function on this object. + * This is called for both client, and server. + * The object should perform all actions related to being sheared, + * except for dropping of the items, and removal of the block. + * As those are handled by ItemShears itself. + * + * Returns a list of items that resulted from the shearing process. + * + * For entities, they should trust there internal location information + * over the values passed into this function. + * + * @param item The itemstack that is being used, Possible to be null + * @param world The current world + * @param x The X Position + * @param y The Y Position + * @param z The Z Position + * @param fortune The fortune level of the shears being used + * @return A ArrayList containing all items from this shearing. Possible to be null. + */ + public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/ISpecialArmor.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/ISpecialArmor.java new file mode 100644 index 0000000..9060468 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/ISpecialArmor.java @@ -0,0 +1,319 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common; + +import java.util.ArrayList; +import java.util.Arrays; + +import net.minecraft.util.DamageSource; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; + +/** + * This interface is to be implemented by ItemArmor classes. It will allow to + * modify computation of damage and health loss. Computation will be called + * before the actual armor computation, which can then be cancelled. + * + * @see ItemArmor + */ +public interface ISpecialArmor +{ + /** + * Retrieves the modifiers to be used when calculating armor damage. + * + * Armor will higher priority will have damage applied to them before + * lower priority ones. If there are multiple pieces of armor with the + * same priority, damage will be distributed between them based on there + * absorption ratio. + * + * @param player The entity wearing the armor. + * @param armor The ItemStack of the armor item itself. + * @param source The source of the damage, which can be used to alter armor + * properties based on the type or source of damage. + * @param damage The total damage being applied to the entity + * @param slot The armor slot the item is in. + * @return A ArmorProperties instance holding information about how the armor effects damage. + */ + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot); + + /** + * Get the displayed effective armor. + * + * @param player The player wearing the armor. + * @param armor The ItemStack of the armor item itself. + * @param slot The armor slot the item is in. + * @return The number of armor points for display, 2 per shield. + */ + public abstract int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot); + + /** + * Applies damage to the ItemStack. The mod is responsible for reducing the + * item durability and stack size. If the stack is depleted it will be cleaned + * up automatically. + * + * @param entity The entity wearing the armor + * @param stack The ItemStack of the armor item itself. + * @param source The source of the damage, which can be used to alter armor + * properties based on the type or source of damage. + * @param damage The amount of damage being applied to the armor + * @param slot The armor slot the item is in. + */ + public abstract void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot); + + public static class ArmorProperties implements Comparable + { + public int Priority = 0; + public int AbsorbMax = Integer.MAX_VALUE; + public double AbsorbRatio = 0; + public int Slot = 0; + private static final boolean DEBUG = false; //Only enable this if you wish to be spamed with debugging information. + //Left it in because I figured it'd be useful for modders developing custom armor. + + public ArmorProperties(int priority, double ratio, int max) + { + Priority = priority; + AbsorbRatio = ratio; + AbsorbMax = max; + } + + /** + * Gathers and applies armor reduction to damage being dealt to a entity. + * + * @param entity The Entity being damage + * @param inventory An array of armor items + * @param source The damage source type + * @param damage The total damage being done + * @return The left over damage that has not been absorbed by the armor + */ + public static float ApplyArmor(EntityLivingBase entity, ItemStack[] inventory, DamageSource source, double damage) + { + if (DEBUG) + { + System.out.println("Start: " + damage + " " + (damage * 25)); + } + damage *= 25; + ArrayList dmgVals = new ArrayList(); + for (int x = 0; x < inventory.length; x++) + { + ItemStack stack = inventory[x]; + if (stack == null) + { + continue; + } + ArmorProperties prop = null; + if (stack.getItem() instanceof ISpecialArmor) + { + ISpecialArmor armor = (ISpecialArmor)stack.getItem(); + prop = armor.getProperties(entity, stack, source, damage / 25D, x).copy(); + } + else if (stack.getItem() instanceof ItemArmor && !source.isUnblockable()) + { + ItemArmor armor = (ItemArmor)stack.getItem(); + prop = new ArmorProperties(0, armor.damageReduceAmount / 25D, armor.getMaxDamage() + 1 - stack.getItemDamage()); + } + if (prop != null) + { + prop.Slot = x; + dmgVals.add(prop); + } + } + if (dmgVals.size() > 0) + { + ArmorProperties[] props = dmgVals.toArray(new ArmorProperties[dmgVals.size()]); + StandardizeList(props, damage); + int level = props[0].Priority; + double ratio = 0; + for (ArmorProperties prop : props) + { + if (level != prop.Priority) + { + damage -= (damage * ratio); + ratio = 0; + level = prop.Priority; + } + ratio += prop.AbsorbRatio; + + double absorb = damage * prop.AbsorbRatio; + if (absorb > 0) + { + ItemStack stack = inventory[prop.Slot]; + int itemDamage = (int)(absorb / 25D < 1 ? 1 : absorb / 25D); + if (stack.getItem() instanceof ISpecialArmor) + { + ((ISpecialArmor)stack.getItem()).damageArmor(entity, stack, source, itemDamage, prop.Slot); + } + else + { + if (DEBUG) + { + System.out.println("Item: " + stack.toString() + " Absorbed: " + (absorb / 25D) + " Damaged: " + itemDamage); + } + stack.damageItem(itemDamage, entity); + } + if (stack.stackSize <= 0) + { + /*if (entity instanceof EntityPlayer) + { + stack.onItemDestroyedByUse((EntityPlayer)entity); + }*/ + inventory[prop.Slot] = null; + } + } + } + damage -= (damage * ratio); + } + if (DEBUG) + { + System.out.println("Return: " + (int)(damage / 25.0F) + " " + damage); + } + return (float)(damage / 25.0F); + } + + /** + * Sorts and standardizes the distribution of damage over armor. + * + * @param armor The armor information + * @param damage The total damage being received + */ + private static void StandardizeList(ArmorProperties[] armor, double damage) + { + Arrays.sort(armor); + + int start = 0; + double total = 0; + int priority = armor[0].Priority; + int pStart = 0; + boolean pChange = false; + boolean pFinished = false; + + if (DEBUG) + { + for (ArmorProperties prop : armor) + { + System.out.println(prop); + } + System.out.println("========================"); + } + + for (int x = 0; x < armor.length; x++) + { + total += armor[x].AbsorbRatio; + if (x == armor.length - 1 || armor[x].Priority != priority) + { + if (armor[x].Priority != priority) + { + total -= armor[x].AbsorbRatio; + x--; + pChange = true; + } + if (total > 1) + { + for (int y = start; y <= x; y++) + { + double newRatio = armor[y].AbsorbRatio / total; + if (newRatio * damage > armor[y].AbsorbMax) + { + armor[y].AbsorbRatio = (double)armor[y].AbsorbMax / damage; + total = 0; + for (int z = pStart; z <= y; z++) + { + total += armor[z].AbsorbRatio; + } + start = y + 1; + x = y; + break; + } + else + { + armor[y].AbsorbRatio = newRatio; + pFinished = true; + } + } + if (pChange && pFinished) + { + damage -= (damage * total); + total = 0; + start = x + 1; + priority = armor[start].Priority; + pStart = start; + pChange = false; + pFinished = false; + if (damage <= 0) + { + for (int y = x + 1; y < armor.length; y++) + { + armor[y].AbsorbRatio = 0; + } + break; + } + } + } + else + { + for (int y = start; y <= x; y++) + { + total -= armor[y].AbsorbRatio; + if (damage * armor[y].AbsorbRatio > armor[y].AbsorbMax) + { + armor[y].AbsorbRatio = (double)armor[y].AbsorbMax / damage; + } + total += armor[y].AbsorbRatio; + } + damage -= (damage * total); + total = 0; + if (x != armor.length - 1) + { + start = x + 1; + priority = armor[start].Priority; + pStart = start; + pChange = false; + if (damage <= 0) + { + for (int y = x + 1; y < armor.length; y++) + { + armor[y].AbsorbRatio = 0; + } + break; + } + } + } + } + } + if (DEBUG) + { + for (ArmorProperties prop : armor) + { + System.out.println(prop); + } + } + } + + @Override + public int compareTo(ArmorProperties o) + { + if (o.Priority != Priority) + { + return o.Priority - Priority; + } + double left = ( AbsorbRatio == 0 ? 0 : AbsorbMax * 100.0D / AbsorbRatio); + double right = (o.AbsorbRatio == 0 ? 0 : o.AbsorbMax * 100.0D / o.AbsorbRatio); + return (int)(left - right); + } + + @Override + public String toString() + { + return String.format("%d, %d, %f, %d", Priority, AbsorbMax, AbsorbRatio, (AbsorbRatio == 0 ? 0 : (int)(AbsorbMax * 100.0D / AbsorbRatio))); + } + + public ArmorProperties copy() + { + return new ArmorProperties(Priority, AbsorbRatio, AbsorbMax); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/MinecraftForge.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/MinecraftForge.java new file mode 100644 index 0000000..7a84441 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/MinecraftForge.java @@ -0,0 +1,170 @@ +package net.minecraftforge.common; + +import java.util.concurrent.Callable; + +import com.google.common.collect.ObjectArrays; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.EventBus; +import cpw.mods.fml.relauncher.Side; +import net.minecraft.crash.CrashReport; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.ForgeHooks.SeedEntry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.oredict.OreDictionary; + +public class MinecraftForge +{ + /** + * The core Forge EventBusses, all events for Forge will be fired on these, + * you should use this to register all your listeners. + * This replaces every register*Handler() function in the old version of Forge. + * TERRAIN_GEN_BUS for terrain gen events + * ORE_GEN_BUS for ore gen events + * EVENT_BUS for everything else + */ + public static final EventBus EVENT_BUS = new EventBus(); + public static final EventBus TERRAIN_GEN_BUS = new EventBus(); + public static final EventBus ORE_GEN_BUS = new EventBus(); + public static final String MC_VERSION = Loader.MC_VERSION; + + static final ForgeInternalHandler INTERNAL_HANDLER = new ForgeInternalHandler(); + + /** + * Register a new seed to be dropped when breaking tall grass. + * + * @param seed The item to drop as a seed. + * @param weight The relative probability of the seeds, + * where wheat seeds are 10. + */ + public static void addGrassSeed(ItemStack seed, int weight) + { + ForgeHooks.seedList.add(new SeedEntry(seed, weight)); + } + + /** + * Method invoked by FML before any other mods are loaded. + */ + public static void initialize() + { + FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion()); + + OreDictionary.getOreName(0); + + //Force these classes to be defined, Should prevent derp error hiding. + CrashReport fake = new CrashReport("ThisIsFake", new Exception("Not real")); + //Lets init World's crash report inner classes to prevent them from hiding errors. + String[] handlers = { + "net.minecraft.world.World$1", + "net.minecraft.world.World$2", + "net.minecraft.world.World$3", + "net.minecraft.world.World$4", + "net.minecraft.world.chunk.Chunk$1", + "net.minecraft.crash.CrashReportCategory$1", + "net.minecraft.crash.CrashReportCategory$2", + "net.minecraft.crash.CrashReportCategory$3", + "net.minecraft.entity.Entity$1", + "net.minecraft.entity.Entity$2", + "net.minecraft.entity.EntityTracker$1", + "net.minecraft.world.gen.layer.GenLayer$1", + "net.minecraft.world.gen.layer.GenLayer$2", + "net.minecraft.entity.player.InventoryPlayer$1", + "net.minecraft.world.gen.structure.MapGenStructure$1", + "net.minecraft.world.gen.structure.MapGenStructure$2", + "net.minecraft.world.gen.structure.MapGenStructure$3", + "net.minecraft.server.MinecraftServer$3", + "net.minecraft.server.MinecraftServer$4", + "net.minecraft.server.MinecraftServer$5", + "net.minecraft.nbt.NBTTagCompound$1", + "net.minecraft.nbt.NBTTagCompound$2", + "net.minecraft.network.NetHandlerPlayServer$2", + "net.minecraft.network.NetworkSystem$3", + "net.minecraft.tileentity.TileEntity$1", + "net.minecraft.tileentity.TileEntity$2", + "net.minecraft.tileentity.TileEntity$3", + "net.minecraft.world.storage.WorldInfo$1", + "net.minecraft.world.storage.WorldInfo$2", + "net.minecraft.world.storage.WorldInfo$3", + "net.minecraft.world.storage.WorldInfo$4", + "net.minecraft.world.storage.WorldInfo$5", + "net.minecraft.world.storage.WorldInfo$6", + "net.minecraft.world.storage.WorldInfo$7", + "net.minecraft.world.storage.WorldInfo$8", + "net.minecraft.world.storage.WorldInfo$9" + }; + String[] client = { + "net.minecraft.client.Minecraft$3", + "net.minecraft.client.Minecraft$4", + "net.minecraft.client.Minecraft$5", + "net.minecraft.client.Minecraft$6", + "net.minecraft.client.Minecraft$7", + "net.minecraft.client.Minecraft$8", + "net.minecraft.client.Minecraft$9", + "net.minecraft.client.Minecraft$10", + "net.minecraft.client.Minecraft$11", + "net.minecraft.client.Minecraft$12", + "net.minecraft.client.Minecraft$13", + "net.minecraft.client.Minecraft$14", + "net.minecraft.client.Minecraft$15", + "net.minecraft.client.multiplayer.WorldClient$1", + "net.minecraft.client.multiplayer.WorldClient$2", + "net.minecraft.client.multiplayer.WorldClient$3", + "net.minecraft.client.multiplayer.WorldClient$4", + "net.minecraft.client.particle,EffectRenderer$1", + "net.minecraft.client.particle,EffectRenderer$2", + "net.minecraft.client.particle,EffectRenderer$3", + "net.minecraft.client.particle,EffectRenderer$4", + "net.minecraft.client.renderer.EntityRenderer$1", + "net.minecraft.client.renderer.EntityRenderer$2", + "net.minecraft.client.renderer.EntityRenderer$3", + "net.minecraft.server.integrated.IntegratedServer$1", + "net.minecraft.server.integrated.IntegratedServer$2", + "net.minecraft.client.renderer.RenderGlobal$1", + "net.minecraft.client.renderer.entity.RenderItem$1", + "net.minecraft.client.renderer.entity.RenderItem$2", + "net.minecraft.client.renderer.entity.RenderItem$3", + "net.minecraft.client.renderer.entity.RenderItem$4", + "net.minecraft.client.renderer.texture.TextureAtlasSprite$1", + "net.minecraft.client.renderer.texture.TextureManager$1", + "net.minecraft.client.renderer.texture.TextureMap$1", + "net.minecraft.client.renderer.texture.TextureMap$2", + "net.minecraft.client.renderer.texture.TextureMap$3" + }; + String[] server = { + "net.minecraft.server.dedicated.DedicatedServer$3", + "net.minecraft.server.dedicated.DedicatedServer$4" + }; + if (FMLCommonHandler.instance().getSide() == Side.CLIENT) + handlers = ObjectArrays.concat(handlers, client, String.class); + else + handlers = ObjectArrays.concat(handlers, server, String.class); + + //FMLLog.info("Preloading CrashReport classes", ForgeVersion.getVersion()); + for (String s : handlers) + { + //FMLLog.info("\t" + s); + try + { + Class cls = Class.forName(s, false, MinecraftForge.class.getClassLoader()); + if (cls != null && !Callable.class.isAssignableFrom(cls)) + { + //FMLLog.info("\t% s is not a instance of callable!", s); + } + } + catch (Exception e){} + } + + UsernameCache.load(); + // Load before all the mods, so MC owns the MC fluids + FluidRegistry.validateFluidRegistry(); + } + + + + public static String getBrandingVersion() + { + return "Minecraft Forge "+ ForgeVersion.getVersion(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/UsernameCache.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/UsernameCache.java new file mode 100644 index 0000000..aac029b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/UsernameCache.java @@ -0,0 +1,202 @@ +package net.minecraftforge.common; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.charset.Charset; +import java.util.Map; +import java.util.UUID; + +import javax.annotation.Nullable; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonSyntaxException; + +import cpw.mods.fml.relauncher.FMLInjectionData; + +/** + * Caches player's last known usernames + *

+ * Modders should use {@link #getLastKnownUsername(UUID)} to determine a players + * last known username.
+ * For convenience, {@link #getMap()} is provided to get an immutable copy of + * the caches underlying map. + */ +public final class UsernameCache { + + private static Map map = Maps.newHashMap(); + + private static final Charset charset = Charsets.UTF_8; + + private static final File saveFile = new File( /* The minecraft dir */(File) FMLInjectionData.data()[6], "usernamecache.json"); + private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + private static final Logger log = LogManager.getLogger(UsernameCache.class); + + private UsernameCache() {} + + /** + * Set a player's current username + * + * @param uuid + * the player's {@link java.util.UUID UUID} + * @param username + * the player's username + */ + protected static void setUsername(UUID uuid, String username) + { + checkNotNull(uuid); + checkNotNull(username); + + if (username.equals(map.get(uuid))) return; + + map.put(uuid, username); + save(); + } + + /** + * Remove a player's username from the cache + * + * @param uuid + * the player's {@link java.util.UUID UUID} + * @return if the cache contained the user + */ + protected static boolean removeUsername(UUID uuid) + { + checkNotNull(uuid); + + if (map.remove(uuid) != null) + { + save(); + return true; + } + + return false; + } + + /** + * Get the player's last known username + *

+ * May be null + * + * @param uuid + * the player's {@link java.util.UUID UUID} + * @return the player's last known username, or null if the + * cache doesn't have a record of the last username + */ + @Nullable + public static String getLastKnownUsername(UUID uuid) + { + checkNotNull(uuid); + return map.get(uuid); + } + + /** + * Check if the cache contains the given player's username + * + * @param uuid + * the player's {@link java.util.UUID UUID} + * @return if the cache contains a username for the given player + */ + public static boolean containsUUID(UUID uuid) + { + checkNotNull(uuid); + return map.containsKey(uuid); + } + + /** + * Get an immutable copy of the cache's underlying map + * + * @return the map + */ + public static Map getMap() + { + return ImmutableMap.copyOf(map); + } + + /** + * Save the cache to file + */ + protected static void save() + { + new SaveThread(gson.toJson(map)).start(); + } + + /** + * Load the cache from file + */ + protected static void load() + { + if (!saveFile.exists()) return; + + try + { + + String json = Files.toString(saveFile, charset); + Type type = new TypeToken>() {}.getType(); + + map = gson.fromJson(json, type); + } + catch (JsonSyntaxException e) + { + log.error("Could not parse username cache file as valid json, deleting file", e); + saveFile.delete(); + } + catch (IOException e) + { + log.error("Failed to read username cache file from disk, deleting file", e); + saveFile.delete(); + } + finally + { + // Can sometimes occur when the json file is malformed + if (map == null) + { + map = Maps.newHashMap(); + } + } + } + + /** + * Used for saving the {@link com.google.gson.Gson#toJson(Object) Gson} + * representation of the cache to disk + */ + private static class SaveThread extends Thread { + + /** The data that will be saved to disk */ + private final String data; + + public SaveThread(String data) + { + this.data = data; + } + + @Override + public void run() + { + try + { + // Make sure we don't save when another thread is still saving + synchronized (saveFile) + { + Files.write(data, saveFile, charset); + } + } + catch (IOException e) + { + log.error("Failed to save username cache to file!", e); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/WorldSpecificSaveHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/WorldSpecificSaveHandler.java new file mode 100644 index 0000000..9948906 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/WorldSpecificSaveHandler.java @@ -0,0 +1,49 @@ +package net.minecraftforge.common; + +import java.io.File; + +import net.minecraft.world.chunk.storage.IChunkLoader; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.ISaveHandler; +import net.minecraft.world.MinecraftException; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.storage.WorldInfo; +import net.minecraft.world.WorldProvider; +import net.minecraft.world.WorldServer; + +//Class used internally to provide the world specific data directories. + +public class WorldSpecificSaveHandler implements ISaveHandler +{ + private WorldServer world; + private ISaveHandler parent; + private File dataDir; + + public WorldSpecificSaveHandler(WorldServer world, ISaveHandler parent) + { + this.world = world; + this.parent = parent; + dataDir = new File(world.getChunkSaveLocation(), "data"); + dataDir.mkdirs(); + } + + @Override public WorldInfo loadWorldInfo() { return parent.loadWorldInfo(); } + @Override public void checkSessionLock() throws MinecraftException { parent.checkSessionLock(); } + @Override public IChunkLoader getChunkLoader(WorldProvider var1) { return parent.getChunkLoader(var1); } + @Override public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { parent.saveWorldInfoWithPlayer(var1, var2); } + @Override public void saveWorldInfo(WorldInfo var1){ parent.saveWorldInfo(var1); } + @Override public IPlayerFileData getSaveHandler() { return parent.getSaveHandler(); } + @Override public void flush() { parent.flush(); } + @Override public String getWorldDirectoryName() { return parent.getWorldDirectoryName(); } + @Override public File getWorldDirectory() { return parent.getWorldDirectory(); } + + /** + * Gets the file location of the given map + */ + @Override + public File getMapFileFromName(String name) + { + return new File(dataDir, name + ".dat"); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java new file mode 100644 index 0000000..e4cda1d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOExecutor.java @@ -0,0 +1,32 @@ +package net.minecraftforge.common.chunkio; + +import net.minecraftforge.common.util.AsynchronousExecutor; + +public class ChunkIOExecutor { + static final int BASE_THREADS = 1; + static final int PLAYERS_PER_THREAD = 50; + + private static final AsynchronousExecutor instance = new AsynchronousExecutor(new ChunkIOProvider(), BASE_THREADS); + + public static net.minecraft.world.chunk.Chunk syncChunkLoad(net.minecraft.world.World world, net.minecraft.world.chunk.storage.AnvilChunkLoader loader, net.minecraft.world.gen.ChunkProviderServer provider, int x, int z) { + return instance.getSkipQueue(new QueuedChunk(x, z, loader, world, provider)); + } + + public static void queueChunkLoad(net.minecraft.world.World world, net.minecraft.world.chunk.storage.AnvilChunkLoader loader, net.minecraft.world.gen.ChunkProviderServer provider, int x, int z, Runnable runnable) { + instance.add(new QueuedChunk(x, z, loader, world, provider), runnable); + } + + // Abuses the fact that hashCode and equals for QueuedChunk only use world and coords + public static void dropQueuedChunkLoad(net.minecraft.world.World world, int x, int z, Runnable runnable) { + instance.drop(new QueuedChunk(x, z, null, world, null), runnable); + } + + public static void adjustPoolSize(int players) { + int size = Math.max(BASE_THREADS, (int) Math.ceil(players / PLAYERS_PER_THREAD)); + instance.setActiveThreads(size); + } + + public static void tick() { + instance.finishActive(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java new file mode 100644 index 0000000..f4982c9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/ChunkIOProvider.java @@ -0,0 +1,64 @@ +package net.minecraftforge.common.chunkio; + + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.AsynchronousExecutor; +import net.minecraftforge.event.world.ChunkDataEvent; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicInteger; + +class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider { + private final AtomicInteger threadNumber = new AtomicInteger(1); + + // async stuff + public net.minecraft.world.chunk.Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException { + net.minecraft.world.chunk.storage.AnvilChunkLoader loader = queuedChunk.loader; + Object[] data = null; + try { + data = loader.loadChunk__Async(queuedChunk.world, queuedChunk.x, queuedChunk.z); + } catch (IOException e) { + e.printStackTrace(); + } + + if (data != null) { + queuedChunk.compound = (net.minecraft.nbt.NBTTagCompound) data[1]; + return (net.minecraft.world.chunk.Chunk) data[0]; + } + + return null; + } + + // sync stuff + public void callStage2(QueuedChunk queuedChunk, net.minecraft.world.chunk.Chunk chunk) throws RuntimeException { + if(chunk == null) { + // If the chunk loading failed just do it synchronously (may generate) + queuedChunk.provider.originalLoadChunk(queuedChunk.x, queuedChunk.z); + return; + } + + queuedChunk.loader.loadEntities(queuedChunk.world, queuedChunk.compound.getCompoundTag("Level"), chunk); + MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, queuedChunk.compound)); // Don't call ChunkDataEvent.Load async + chunk.lastSaveTime = queuedChunk.provider.worldObj.getTotalWorldTime(); + queuedChunk.provider.loadedChunkHashMap.add(ChunkCoordIntPair.chunkXZ2Int(queuedChunk.x, queuedChunk.z), chunk); + queuedChunk.provider.loadedChunks.add(chunk); + chunk.onChunkLoad(); + + if (queuedChunk.provider.currentChunkProvider != null) { + queuedChunk.provider.currentChunkProvider.recreateStructures(queuedChunk.x, queuedChunk.z); + } + + chunk.populateChunk(queuedChunk.provider, queuedChunk.provider, queuedChunk.x, queuedChunk.z); + } + + public void callStage3(QueuedChunk queuedChunk, net.minecraft.world.chunk.Chunk chunk, Runnable runnable) throws RuntimeException { + runnable.run(); + } + + public Thread newThread(Runnable runnable) { + Thread thread = new Thread(runnable, "Chunk I/O Executor Thread-" + threadNumber.getAndIncrement()); + thread.setDaemon(true); + return thread; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/QueuedChunk.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/QueuedChunk.java new file mode 100644 index 0000000..d796c77 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/chunkio/QueuedChunk.java @@ -0,0 +1,52 @@ +package net.minecraftforge.common.chunkio; + + +class QueuedChunk { + final int x; + final int z; + final net.minecraft.world.chunk.storage.AnvilChunkLoader loader; + final net.minecraft.world.World world; + final net.minecraft.world.gen.ChunkProviderServer provider; + net.minecraft.nbt.NBTTagCompound compound; + + public QueuedChunk(int x, int z, net.minecraft.world.chunk.storage.AnvilChunkLoader loader, net.minecraft.world.World world, net.minecraft.world.gen.ChunkProviderServer provider) { + this.x = x; + this.z = z; + this.loader = loader; + this.world = world; + this.provider = provider; + } + + @Override + public int hashCode() { + return (x * 31 + z * 29) ^ world.hashCode(); + } + + @Override + public boolean equals(Object object) { + if (object instanceof QueuedChunk) { + QueuedChunk other = (QueuedChunk) object; + return x == other.x && z == other.z && world == other.world; + } + + return false; + } + + @Override + public String toString() + { + StringBuilder result = new StringBuilder(); + String NEW_LINE = System.getProperty("line.separator"); + + result.append(this.getClass().getName() + " {" + NEW_LINE); + result.append(" x: " + x + NEW_LINE); + result.append(" z: " + z + NEW_LINE); + result.append(" loader: " + loader + NEW_LINE ); + result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE); + result.append(" dimension: " + world.provider.dimensionId + NEW_LINE); + result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE); + result.append("}"); + + return result.toString(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigCategory.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigCategory.java new file mode 100644 index 0000000..15913d5 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigCategory.java @@ -0,0 +1,426 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common.config; + +import static net.minecraftforge.common.config.Configuration.COMMENT_SEPARATOR; +import static net.minecraftforge.common.config.Configuration.NEW_LINE; +import static net.minecraftforge.common.config.Configuration.allowedProperties; + +import java.io.BufferedWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import com.google.common.base.Splitter; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; + +public class ConfigCategory implements Map +{ + private String name; + private String comment; + private String languagekey; + private ArrayList children = new ArrayList(); + private Map properties = new TreeMap(); + private int propNumber = 0; + public final ConfigCategory parent; + private boolean changed = false; + private boolean requiresWorldRestart = false; + private boolean showInGui = true; + private boolean requiresMcRestart = false; + private Class customEntryClass = null; + private List propertyOrder = null; + + public ConfigCategory(String name) + { + this(name, null); + } + + public ConfigCategory(String name, ConfigCategory parent) + { + this.name = name; + this.parent = parent; + if (parent != null) + { + parent.children.add(this); + } + } + + @Override + public boolean equals(Object obj) + { + if (obj instanceof ConfigCategory) + { + ConfigCategory cat = (ConfigCategory)obj; + return name.equals(cat.name) && children.equals(cat.children); + } + + return false; + } + + public String getName() + { + return name; + } + + public String getQualifiedName() + { + return getQualifiedName(name, parent); + } + + public static String getQualifiedName(String name, ConfigCategory parent) + { + return (parent == null ? name : parent.getQualifiedName() + Configuration.CATEGORY_SPLITTER + name); + } + + public ConfigCategory getFirstParent() + { + return (parent == null ? this : parent.getFirstParent()); + } + + public boolean isChild() + { + return parent != null; + } + + public Map getValues() + { + return ImmutableMap.copyOf(properties); + } + + public List getOrderedValues() + { + if (this.propertyOrder != null) + { + ArrayList set = new ArrayList(); + for (String key : this.propertyOrder) + if (properties.containsKey(key)) + set.add(properties.get(key)); + + return ImmutableList.copyOf(set); + } + else + return ImmutableList.copyOf(properties.values()); + } + + public ConfigCategory setConfigEntryClass(Class clazz) + { + this.customEntryClass = clazz; + return this; + } + + public Class getConfigEntryClass() + { + return this.customEntryClass; + } + + public ConfigCategory setLanguageKey(String languagekey) + { + this.languagekey = languagekey; + return this; + } + + public String getLanguagekey() + { + if (this.languagekey != null) + return this.languagekey; + else + return getQualifiedName(); + } + + public void setComment(String comment) + { + this.comment = comment; + } + + public String getComment() + { + return this.comment; + } + + /** + * Sets the flag for whether or not this category can be edited while a world is running. Care should be taken to ensure + * that only properties that are truly dynamic can be changed from the in-game options menu. Only set this flag to + * true if all child properties/categories are unable to be modified while a world is running. + */ + public ConfigCategory setRequiresWorldRestart(boolean requiresWorldRestart) + { + this.requiresWorldRestart = requiresWorldRestart; + return this; + } + + /** + * Returns whether or not this category is able to be edited while a world is running using the in-game Mod Options screen + * as well as the Mods list screen, or only from the Mods list screen. + */ + public boolean requiresWorldRestart() + { + return this.requiresWorldRestart; + } + + /** + * Sets whether or not this ConfigCategory should be allowed to show on config GUIs. + * Defaults to true. + */ + public ConfigCategory setShowInGui(boolean showInGui) + { + this.showInGui = showInGui; + return this; + } + + /** + * Gets whether or not this ConfigCategory should be allowed to show on config GUIs. + * Defaults to true unless set to false. + */ + public boolean showInGui() + { + return showInGui; + } + + /** + * Sets whether or not this ConfigCategory requires Minecraft to be restarted when changed. + * Defaults to false. Only set this flag to true if ALL child properties/categories require + * Minecraft to be restarted when changed. Setting this flag will also prevent modification + * of the child properties/categories while a world is running. + */ + public ConfigCategory setRequiresMcRestart(boolean requiresMcRestart) + { + this.requiresMcRestart = this.requiresWorldRestart = requiresMcRestart; + return this; + } + + /** + * Gets whether or not this ConfigCategory requires Minecraft to be restarted when changed. + * Defaults to false unless set to true. + */ + public boolean requiresMcRestart() + { + return this.requiresMcRestart; + } + + public ConfigCategory setPropertyOrder(List propertyOrder) + { + this.propertyOrder = propertyOrder; + for (String s : properties.keySet()) + if (!propertyOrder.contains(s)) + propertyOrder.add(s); + return this; + } + + public List getPropertyOrder() + { + if (this.propertyOrder != null) + return ImmutableList.copyOf(this.propertyOrder); + else + return ImmutableList.copyOf(properties.keySet()); + } + + public boolean containsKey(String key) + { + return properties.containsKey(key); + } + + public Property get(String key) + { + return properties.get(key); + } + + private void write(BufferedWriter out, String... data) throws IOException + { + write(out, true, data); + } + + private void write(BufferedWriter out, boolean new_line, String... data) throws IOException + { + for (int x = 0; x < data.length; x++) + { + out.write(data[x]); + } + if (new_line) out.write(NEW_LINE); + } + + public void write(BufferedWriter out, int indent) throws IOException + { + String pad0 = getIndent(indent); + String pad1 = getIndent(indent + 1); + String pad2 = getIndent(indent + 2); + + if (comment != null && !comment.isEmpty()) + { + write(out, pad0, COMMENT_SEPARATOR); + write(out, pad0, "# ", name); + write(out, pad0, "#--------------------------------------------------------------------------------------------------------#"); + Splitter splitter = Splitter.onPattern("\r?\n"); + + for (String line : splitter.split(comment)) + { + write(out, pad0, "# ", line); + } + + write(out, pad0, COMMENT_SEPARATOR, NEW_LINE); + } + + String displayName = name; + + if (!allowedProperties.matchesAllOf(name)) + { + displayName = '"' + name + '"'; + } + + write(out, pad0, displayName, " {"); + + Property[] props = getOrderedValues().toArray(new Property[] {}); + + for (int x = 0; x < props.length; x++) + { + Property prop = props[x]; + + if (prop.comment != null && !prop.comment.isEmpty()) + { + if (x != 0) + { + out.newLine(); + } + + Splitter splitter = Splitter.onPattern("\r?\n"); + for (String commentLine : splitter.split(prop.comment)) + { + write(out, pad1, "# ", commentLine); + } + } + + String propName = prop.getName(); + + if (!allowedProperties.matchesAllOf(propName)) + { + propName = '"' + propName + '"'; + } + + if (prop.isList()) + { + char type = prop.getType().getID(); + + write(out, pad1, String.valueOf(type), ":", propName, " <"); + + for (String line : prop.getStringList()) + { + write(out, pad2, line); + } + + write(out, pad1, " >"); + } + else if (prop.getType() == null) + { + write(out, pad1, propName, "=", prop.getString()); + } + else + { + char type = prop.getType().getID(); + write(out, pad1, String.valueOf(type), ":", propName, "=", prop.getString()); + } + } + + if (children.size() > 0) + out.newLine(); + + for (ConfigCategory child : children) + { + child.write(out, indent + 1); + } + + write(out, pad0, "}", NEW_LINE); + } + + private String getIndent(int indent) + { + StringBuilder buf = new StringBuilder(""); + for (int x = 0; x < indent; x++) + { + buf.append(" "); + } + return buf.toString(); + } + + public boolean hasChanged() + { + if (changed) return true; + for (Property prop : properties.values()) + { + if (prop.hasChanged()) return true; + } + return false; + } + + void resetChangedState() + { + changed = false; + for (Property prop : properties.values()) + { + prop.resetChangedState(); + } + } + + + //Map bouncer functions for compatibility with older mods, to be removed once all mods stop using it. + @Override public int size(){ return properties.size(); } + @Override public boolean isEmpty() { return properties.isEmpty(); } + @Override public boolean containsKey(Object key) { return properties.containsKey(key); } + @Override public boolean containsValue(Object value){ return properties.containsValue(value); } + @Override public Property get(Object key) { return properties.get(key); } + @Override public Property put(String key, Property value) + { + changed = true; + if (this.propertyOrder != null && !this.propertyOrder.contains(key)) + this.propertyOrder.add(key); + return properties.put(key, value); + } + @Override public Property remove(Object key) + { + changed = true; + return properties.remove(key); + } + @Override public void putAll(Map m) + { + changed = true; + if (this.propertyOrder != null) + for (String key : m.keySet()) + if (!this.propertyOrder.contains(key)) + this.propertyOrder.add(key); + properties.putAll(m); + } + @Override public void clear() + { + changed = true; + properties.clear(); + } + @Override public Set keySet() { return properties.keySet(); } + @Override public Collection values() { return properties.values(); } + + @Override //Immutable copy, changes will NOT be reflected in this category + public Set> entrySet() + { + return ImmutableSet.copyOf(properties.entrySet()); + } + + public Set getChildren(){ return ImmutableSet.copyOf(children); } + + public void removeChild(ConfigCategory child) + { + if (children.contains(child)) + { + children.remove(child); + changed = true; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigElement.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigElement.java new file mode 100644 index 0000000..7dd641c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/ConfigElement.java @@ -0,0 +1,359 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Pattern; + +import cpw.mods.fml.client.config.ConfigGuiType; +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.config.GuiEditArrayEntries.IArrayEntry; +import cpw.mods.fml.client.config.IConfigElement; + +/** + * This class bridges the gap between the FML config GUI classes and the Forge Configuration classes. + */ +public class ConfigElement implements IConfigElement +{ + private Property prop; + private Property.Type type; + private boolean isProperty; + private ConfigCategory ctgy; + private boolean categoriesFirst = true; + + public ConfigElement(ConfigCategory ctgy) + { + this.ctgy = ctgy; + isProperty = false; + } + + public ConfigElement(Property prop) + { + this.prop = prop; + this.type = prop.getType(); + this.isProperty = true; + } + + public ConfigElement listCategoriesFirst(boolean categoriesFirst) + { + this.categoriesFirst = categoriesFirst; + return this; + } + + @Override + public List getChildElements() + { + if (!isProperty) + { + List elements = new ArrayList(); + Iterator ccI = ctgy.getChildren().iterator(); + Iterator pI = ctgy.getOrderedValues().iterator(); + int index = 0; + + if (categoriesFirst) + while (ccI.hasNext()) + { + ConfigElement temp = new ConfigElement(ccI.next()); + if (temp.showInGui()) // don't bother adding elements that shouldn't show + elements.add(temp); + } + + while (pI.hasNext()) + { + ConfigElement temp = getTypedElement(pI.next()); + if (temp.showInGui()) + elements.add(temp); + } + + if (!categoriesFirst) + while (ccI.hasNext()) + { + ConfigElement temp = new ConfigElement(ccI.next()); + if (temp.showInGui()) + elements.add(temp); + } + + return elements; + } + return null; + } + + public static ConfigElement getTypedElement(Property prop) + { + switch (getType(prop)) + { + case BOOLEAN: + return new ConfigElement(prop); + case DOUBLE: + return new ConfigElement(prop); + case INTEGER: + return new ConfigElement(prop); + default: + return new ConfigElement(prop); + } + } + + @Override + public String getName() + { + return isProperty ? prop.getName() : ctgy.getName(); + } + + @Override + public boolean isProperty() + { + return isProperty; + } + + @Override + public Class getConfigEntryClass() + { + return isProperty ? prop.getConfigEntryClass() : ctgy.getConfigEntryClass(); + } + + @Override + public Class getArrayEntryClass() + { + return isProperty ? prop.getArrayEntryClass() : null; + } + + @Override + public String getQualifiedName() + { + return isProperty ? prop.getName() : ctgy.getQualifiedName(); + } + + @Override + public ConfigGuiType getType() + { + return isProperty ? getType(this.prop) : ConfigGuiType.CONFIG_CATEGORY; + } + + public static ConfigGuiType getType(Property prop) + { + return prop.getType() == Property.Type.BOOLEAN ? ConfigGuiType.BOOLEAN : prop.getType() == Property.Type.DOUBLE ? ConfigGuiType.DOUBLE : + prop.getType() == Property.Type.INTEGER ? ConfigGuiType.INTEGER : prop.getType() == Property.Type.COLOR ? ConfigGuiType.COLOR : + prop.getType() == Property.Type.MOD_ID ? ConfigGuiType.MOD_ID : ConfigGuiType.STRING; + } + + @Override + public boolean isList() + { + return isProperty && prop.isList(); + } + + @Override + public boolean isListLengthFixed() + { + return isProperty && prop.isListLengthFixed(); + } + + @Override + public int getMaxListLength() + { + return isProperty ? prop.getMaxListLength() : -1; + } + + @Override + public String getComment() + { + return isProperty ? prop.comment : ctgy.getComment(); + } + + @Override + public boolean isDefault() + { + return !isProperty || prop.isDefault(); + } + + @Override + public void setToDefault() + { + if (isProperty) + prop.setToDefault(); + } + + @Override + public boolean requiresWorldRestart() + { + return isProperty ? prop.requiresWorldRestart() : ctgy.requiresWorldRestart(); + } + + @Override + public boolean showInGui() + { + return isProperty ? prop.showInGui() : ctgy.showInGui(); + } + + @Override + public boolean requiresMcRestart() + { + return isProperty ? prop.requiresMcRestart() : ctgy.requiresMcRestart(); + } + + @Override + public String[] getValidValues() + { + return isProperty ? prop.getValidValues() : null; + } + + @Override + public String getLanguageKey() + { + return isProperty ? prop.getLanguageKey() : ctgy.getLanguagekey(); + } + + @Override + public Object getDefault() + { + return isProperty ? (T) prop.getDefault() : null; + } + + @Override + public Object[] getDefaults() + { + if (isProperty) + { + String[] aVal = prop.getDefaults(); + if (type == Property.Type.BOOLEAN) + { + Boolean[] ba = new Boolean[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ba[i] = Boolean.valueOf(aVal[i]); + return ba; + } + else if (type == Property.Type.DOUBLE) + { + Double[] da = new Double[aVal.length]; + for(int i = 0; i < aVal.length; i++) + da[i] = Double.valueOf(aVal[i].toString()); + return da; + } + else if (type == Property.Type.INTEGER) + { + Integer[] ia = new Integer[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ia[i] = Integer.valueOf(aVal[i].toString()); + return ia; + } + else + return aVal; + } + return null; + } + + @Override + public Pattern getValidationPattern() + { + return isProperty ? prop.getValidationPattern() : null; + } + + @Override + public Object get() + { + return isProperty ? (T) prop.getString() : null; + } + + @Override + public Object[] getList() + { + if (isProperty) + { + String[] aVal = prop.getStringList(); + if (type == Property.Type.BOOLEAN) + { + Boolean[] ba = new Boolean[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ba[i] = Boolean.valueOf(aVal[i]); + return ba; + } + else if (type == Property.Type.DOUBLE) + { + Double[] da = new Double[aVal.length]; + for(int i = 0; i < aVal.length; i++) + da[i] = Double.valueOf(aVal[i].toString()); + return da; + } + else if (type == Property.Type.INTEGER) + { + Integer[] ia = new Integer[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ia[i] = Integer.valueOf(aVal[i].toString()); + return ia; + } + else + return aVal; + } + return null; + } + + @Override + public void set(T value) + { + if (isProperty) + { + if (type == Property.Type.BOOLEAN) + prop.set(Boolean.parseBoolean(value.toString())); + else if (type == Property.Type.DOUBLE) + prop.set(Double.parseDouble(value.toString())); + else if (type == Property.Type.INTEGER) + prop.set(Integer.parseInt(value.toString())); + else + prop.set(value.toString()); + } + } + + @Override + public void set(T[] aVal) + { + if (isProperty) + { + if (type == Property.Type.BOOLEAN) + { + boolean[] ba = new boolean[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ba[i] = Boolean.valueOf(aVal[i].toString()); + prop.set(ba); + } + else if (type == Property.Type.DOUBLE) + { + double[] da = new double[aVal.length]; + for(int i = 0; i < aVal.length; i++) + da[i] = Double.valueOf(aVal[i].toString()); + prop.set(da); + } + else if (type == Property.Type.INTEGER) + { + int[] ia = new int[aVal.length]; + for(int i = 0; i < aVal.length; i++) + ia[i] = Integer.valueOf(aVal[i].toString()); + prop.set(ia); + } + else + { + String[] is = new String[aVal.length]; + for(int i = 0; i < aVal.length; i++) + is[i] = aVal[i].toString(); + prop.set(is); + } + } + } + + @Override + public T getMinValue() + { + return isProperty ? (T) prop.getMinValue() : null; + } + + @Override + public T getMaxValue() + { + return isProperty ? (T) prop.getMaxValue() : null; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Configuration.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Configuration.java new file mode 100644 index 0000000..849986d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Configuration.java @@ -0,0 +1,1723 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common.config; + +import static net.minecraftforge.common.config.Property.Type.BOOLEAN; +import static net.minecraftforge.common.config.Property.Type.DOUBLE; +import static net.minecraftforge.common.config.Property.Type.INTEGER; +import static net.minecraftforge.common.config.Property.Type.STRING; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.PushbackInputStream; +import java.io.Reader; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.google.common.base.CharMatcher; +import com.google.common.collect.ImmutableSet; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.FMLInjectionData; + +/** + * This class offers advanced configurations capabilities, allowing to provide + * various categories for configuration variables. + */ +public class Configuration +{ + public static final String CATEGORY_GENERAL = "general"; + public static final String ALLOWED_CHARS = "._-"; + public static final String DEFAULT_ENCODING = "UTF-8"; + public static final String CATEGORY_SPLITTER = "."; + public static final String NEW_LINE; + public static final String COMMENT_SEPARATOR = "##########################################################################################################"; + private static final String CONFIG_VERSION_MARKER = "~CONFIG_VERSION"; + private static final Pattern CONFIG_START = Pattern.compile("START: \"([^\\\"]+)\""); + private static final Pattern CONFIG_END = Pattern.compile("END: \"([^\\\"]+)\""); + public static final CharMatcher allowedProperties = CharMatcher.JAVA_LETTER_OR_DIGIT.or(CharMatcher.anyOf(ALLOWED_CHARS)); + private static Configuration PARENT = null; + + File file; + + private Map categories = new TreeMap(); + private Map children = new TreeMap(); + + private boolean caseSensitiveCustomCategories; + public String defaultEncoding = DEFAULT_ENCODING; + private String fileName = null; + public boolean isChild = false; + private boolean changed = false; + private String definedConfigVersion = null; + private String loadedConfigVersion = null; + + static + { + NEW_LINE = System.getProperty("line.separator"); + } + + public Configuration(){} + + /** + * Create a configuration file for the file given in parameter. + */ + public Configuration(File file) + { + this(file, null); + } + + /** + * Create a configuration file for the file given in parameter with the provided config version number. + */ + public Configuration(File file, String configVersion) + { + this.file = file; + this.definedConfigVersion = configVersion; + String basePath = ((File)(FMLInjectionData.data()[6])).getAbsolutePath().replace(File.separatorChar, '/').replace("/.", ""); + String path = file.getAbsolutePath().replace(File.separatorChar, '/').replace("/./", "/").replace(basePath, ""); + if (PARENT != null) + { + PARENT.setChild(path, this); + isChild = true; + } + else + { + fileName = path; + try + { + load(); + } + catch (Throwable e) + { + File fileBak = new File(file.getAbsolutePath() + "_" + + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".errored"); + FMLLog.severe("An exception occurred while loading config file %s. This file will be renamed to %s " + + "and a new config file will be generated.", file.getName(), fileBak.getName()); + e.printStackTrace(); + + file.renameTo(fileBak); + load(); + } + } + } + + public Configuration(File file, String configVersion, boolean caseSensitiveCustomCategories) + { + this(file, configVersion); + this.caseSensitiveCustomCategories = caseSensitiveCustomCategories; + } + + public Configuration(File file, boolean caseSensitiveCustomCategories) + { + this(file, null, caseSensitiveCustomCategories); + } + + @Override + public String toString() + { + return file.getAbsolutePath(); + } + + public String getDefinedConfigVersion() + { + return this.definedConfigVersion; + } + + public String getLoadedConfigVersion() + { + return this.loadedConfigVersion; + } + + /****************************************************************************************************************** + * + * BOOLEAN gets + * + *****************************************************************************************************************/ + + /** + * Gets a boolean Property object without a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @return a boolean Property object without a comment + */ + public Property get(String category, String key, boolean defaultValue) + { + return get(category, key, defaultValue, (String) null); + } + + /** + * Gets a boolean Property object with a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @return a boolean Property object without a comment + */ + public Property get(String category, String key, boolean defaultValue, String comment) + { + Property prop = get(category, key, Boolean.toString(defaultValue), comment, BOOLEAN); + prop.setDefaultValue(Boolean.toString(defaultValue)); + + if (!prop.isBooleanValue()) + { + prop.setValue(defaultValue); + } + return prop; + + } + + /** + * Gets a boolean array Property without a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @return a boolean array Property without a comment using these defaults: isListLengthFixed = false, maxListLength = -1 + */ + public Property get(String category, String key, boolean[] defaultValues) + { + return get(category, key, defaultValues, (String) null); + } + + /** + * Gets a boolean array Property with a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @return a boolean array Property with a comment using these defaults: isListLengthFixed = false, maxListLength = -1 + */ + public Property get(String category, String key, boolean[] defaultValues, String comment) + { + return get(category, key, defaultValues, comment, false, -1); + } + + /** + * Gets a boolean array Property with all settings defined. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param isListLengthFixed boolean for whether this array is required to be a specific length (defined by the default value array + * length or maxListLength) + * @param maxListLength the maximum length of this array, use -1 for no max length + * @return a boolean array Property with all settings defined + */ + public Property get(String category, String key, boolean[] defaultValues, String comment, + boolean isListLengthFixed, int maxListLength) + { + String[] values = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + { + values[i] = Boolean.toString(defaultValues[i]); + } + + Property prop = get(category, key, values, comment, BOOLEAN); + prop.setDefaultValues(values); + prop.setIsListLengthFixed(isListLengthFixed); + prop.setMaxListLength(maxListLength); + + if (!prop.isBooleanList()) + { + prop.setValues(values); + } + + return prop; + } + + /* **************************************************************************************************************** + * + * INTEGER gets + * + *****************************************************************************************************************/ + + /** + * Gets an integer Property object without a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @return an integer Property object with default bounds of Integer.MIN_VALUE and Integer.MAX_VALUE + */ + public Property get(String category, String key, int defaultValue) + { + return get(category, key, defaultValue, (String) null, Integer.MIN_VALUE, Integer.MAX_VALUE); + } + + /** + * Gets an integer Property object with a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @return an integer Property object with default bounds of Integer.MIN_VALUE and Integer.MAX_VALUE + */ + public Property get(String category, String key, int defaultValue, String comment) + { + return get(category, key, defaultValue, comment, Integer.MIN_VALUE, Integer.MAX_VALUE); + } + + /** + * Gets an integer Property object with the defined comment, minimum and maximum bounds. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @return an integer Property object with the defined comment, minimum and maximum bounds + */ + public Property get(String category, String key, int defaultValue, String comment, int minValue, int maxValue) + { + Property prop = get(category, key, Integer.toString(defaultValue), comment, INTEGER); + prop.setDefaultValue(Integer.toString(defaultValue)); + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + + if (!prop.isIntValue()) + { + prop.setValue(defaultValue); + } + return prop; + } + + /** + * Gets an integer array Property object without a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @return an integer array Property object with default bounds of Integer.MIN_VALUE and Integer.MAX_VALUE, isListLengthFixed = false, + * maxListLength = -1 + */ + public Property get(String category, String key, int[] defaultValues) + { + return get(category, key, defaultValues, (String) null); + } + + /** + * Gets an integer array Property object with a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @return an integer array Property object with default bounds of Integer.MIN_VALUE and Integer.MAX_VALUE, isListLengthFixed = false, + * maxListLength = -1 + */ + public Property get(String category, String key, int[] defaultValues, String comment) + { + return get(category, key, defaultValues, comment, Integer.MIN_VALUE, Integer.MAX_VALUE, false, -1); + } + + /** + * Gets an integer array Property object with the defined comment, minimum and maximum bounds. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @return an integer array Property object with the defined comment, minimum and maximum bounds, isListLengthFixed + * = false, maxListLength = -1 + */ + public Property get(String category, String key, int[] defaultValues, String comment, int minValue, int maxValue) + { + return get(category, key, defaultValues, comment, minValue, maxValue, false, -1); + } + + /** + * Gets an integer array Property object with all settings defined. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @param isListLengthFixed boolean for whether this array is required to be a specific length (defined by the default value array + * length or maxListLength) + * @param maxListLength the maximum length of this array, use -1 for no max length + * @return an integer array Property object with all settings defined + */ + public Property get(String category, String key, int[] defaultValues, String comment, int minValue, int maxValue, + boolean isListLengthFixed, int maxListLength) + { + String[] values = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + { + values[i] = Integer.toString(defaultValues[i]); + } + + Property prop = get(category, key, values, comment, INTEGER); + prop.setDefaultValues(values); + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + prop.setIsListLengthFixed(isListLengthFixed); + prop.setMaxListLength(maxListLength); + + if (!prop.isIntList()) + { + prop.setValues(values); + } + + return prop; + } + + /* **************************************************************************************************************** + * + * DOUBLE gets + * + *****************************************************************************************************************/ + + /** + * Gets a double Property object without a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @return a double Property object with default bounds of Double.MIN_VALUE and Double.MAX_VALUE + */ + public Property get(String category, String key, double defaultValue) + { + return get(category, key, defaultValue, (String) null); + } + + /** + * Gets a double Property object with a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @return a double Property object with default bounds of Double.MIN_VALUE and Double.MAX_VALUE + */ + public Property get(String category, String key, double defaultValue, String comment) + { + return get(category, key, defaultValue, comment, -Double.MAX_VALUE, Double.MAX_VALUE); + } + + /** + * Gets a double Property object with the defined comment, minimum and maximum bounds + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @return a double Property object with the defined comment, minimum and maximum bounds + */ + public Property get(String category, String key, double defaultValue, String comment, double minValue, double maxValue) + { + Property prop = get(category, key, Double.toString(defaultValue), comment, DOUBLE); + prop.setDefaultValue(Double.toString(defaultValue)); + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + + if (!prop.isDoubleValue()) + { + prop.setValue(defaultValue); + } + return prop; + } + + /** + * Gets a double array Property object without a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @return a double array Property object with default bounds of Double.MIN_VALUE and Double.MAX_VALUE, isListLengthFixed = false, + * maxListLength = -1 + */ + public Property get(String category, String key, double[] defaultValues) + { + return get(category, key, defaultValues, null); + } + + /** + * Gets a double array Property object without a comment using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @return a double array Property object with default bounds of Double.MIN_VALUE and Double.MAX_VALUE, isListLengthFixed = false, + * maxListLength = -1 + */ + public Property get(String category, String key, double[] defaultValues, String comment) + { + return get(category, key, defaultValues, comment, -Double.MAX_VALUE, Double.MAX_VALUE, false, -1); + } + + /** + * Gets a double array Property object with the defined comment, minimum and maximum bounds. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @return a double array Property object with the defined comment, minimum and maximum bounds, isListLengthFixed = + * false, maxListLength = -1 + */ + public Property get(String category, String key, double[] defaultValues, String comment, double minValue, double maxValue) + { + return get(category, key, defaultValues, comment, minValue, maxValue, false, -1); + } + + /** + * Gets a double array Property object with all settings defined. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param minValue minimum boundary + * @param maxValue maximum boundary + * @param isListLengthFixed boolean for whether this array is required to be a specific length (defined by the default value array + * length or maxListLength) + * @param maxListLength the maximum length of this array, use -1 for no max length + * @return a double array Property object with all settings defined + */ + public Property get(String category, String key, double[] defaultValues, String comment, double minValue, double maxValue, + boolean isListLengthFixed, int maxListLength) + { + String[] values = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + { + values[i] = Double.toString(defaultValues[i]); + } + + + Property prop = get(category, key, values, comment, DOUBLE); + prop.setDefaultValues(values); + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + prop.setIsListLengthFixed(isListLengthFixed); + prop.setMaxListLength(maxListLength); + + if (!prop.isDoubleList()) + { + prop.setValues(values); + } + + return prop; + } + + /* **************************************************************************************************************** + * + * STRING gets + * + *****************************************************************************************************************/ + + /** + * Gets a string Property without a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @return a string Property with validationPattern = null, validValues = null + */ + public Property get(String category, String key, String defaultValue) + { + return get(category, key, defaultValue, (String) null); + } + + /** + * Gets a string Property with a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @return a string Property with validationPattern = null, validValues = null + */ + public Property get(String category, String key, String defaultValue, String comment) + { + return get(category, key, defaultValue, comment, STRING); + } + + /** + * Gets a string Property with a comment using the defined validationPattern and otherwise default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @param validationPattern a Pattern object for input validation + * @return a string Property with the defined validationPattern, validValues = null + */ + public Property get(String category, String key, String defaultValue, String comment, Pattern validationPattern) + { + Property prop = get(category, key, defaultValue, comment, STRING); + prop.setValidationPattern(validationPattern); + return prop; + } + + /** + * Gets a string Property with a comment using the defined validValues array and otherwise default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @param validValues an array of valid values that this Property can be set to. If an array is provided the Config GUI control will be + * a value cycle button. + * @return a string Property with the defined validValues array, validationPattern = null + */ + public Property get(String category, String key, String defaultValue, String comment, String[] validValues) + { + Property prop = get(category, key, defaultValue, comment, STRING); + prop.setValidValues(validValues); + return prop; + } + + /** + * Gets a string array Property without a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @return a string array Property with validationPattern = null, isListLengthFixed = false, maxListLength = -1 + */ + public Property get(String category, String key, String[] defaultValues) + { + return get(category, key, defaultValues, (String) null, false, -1, (Pattern) null); + } + + /** + * Gets a string array Property with a comment using the default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @return a string array Property with validationPattern = null, isListLengthFixed = false, maxListLength = -1 + */ + public Property get(String category, String key, String[] defaultValues, String comment) + { + return get(category, key, defaultValues, comment, false, -1, (Pattern) null); + } + + /** + * Gets a string array Property with a comment using the defined validationPattern and otherwise default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param validationPattern a Pattern object for input validation + * @return a string array Property with the defined validationPattern, isListLengthFixed = false, maxListLength = -1 + */ + public Property get(String category, String key, String[] defaultValues, String comment, Pattern validationPattern) + { + return get(category, key, defaultValues, comment, false, -1, validationPattern); + } + + /** + * Gets a string array Property with a comment with all settings defined. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param isListLengthFixed boolean for whether this array is required to be a specific length (defined by the default value array + * length or maxListLength) + * @param maxListLength the maximum length of this array, use -1 for no max length + * @param validationPattern a Pattern object for input validation + * @return a string array Property with a comment with all settings defined + */ + public Property get(String category, String key, String[] defaultValues, String comment, + boolean isListLengthFixed, int maxListLength, Pattern validationPattern) + { + Property prop = get(category, key, defaultValues, comment, STRING); + prop.setIsListLengthFixed(isListLengthFixed); + prop.setMaxListLength(maxListLength); + prop.setValidationPattern(validationPattern); + return prop; + } + + /* **************************************************************************************************************** + * + * GENERIC gets + * + *****************************************************************************************************************/ + + /** + * Gets a Property object of the specified type using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValue the default value + * @param comment a String comment + * @param type a Property.Type enum value + * @return a Property object of the specified type using default settings + */ + public Property get(String category, String key, String defaultValue, String comment, Property.Type type) + { + if (!caseSensitiveCustomCategories) + { + category = category.toLowerCase(Locale.ENGLISH); + } + + ConfigCategory cat = getCategory(category); + + if (cat.containsKey(key)) + { + Property prop = cat.get(key); + + if (prop.getType() == null) + { + prop = new Property(prop.getName(), prop.getString(), type); + cat.put(key, prop); + } + + prop.setDefaultValue(defaultValue); + prop.comment = comment; + return prop; + } + else if (defaultValue != null) + { + Property prop = new Property(key, defaultValue, type); + prop.setValue(defaultValue); //Set and mark as dirty to signify it should save + cat.put(key, prop); + prop.setDefaultValue(defaultValue); + prop.comment = comment; + return prop; + } + else + { + return null; + } + } + + /** + * Gets a list (array) Property object of the specified type using default settings. + * + * @param category the config category + * @param key the Property key value + * @param defaultValues an array containing the default values + * @param comment a String comment + * @param type a Property.Type enum value + * @return a list (array) Property object of the specified type using default settings + */ + public Property get(String category, String key, String[] defaultValues, String comment, Property.Type type) + { + if (!caseSensitiveCustomCategories) + { + category = category.toLowerCase(Locale.ENGLISH); + } + + ConfigCategory cat = getCategory(category); + + if (cat.containsKey(key)) + { + Property prop = cat.get(key); + + if (prop.getType() == null) + { + prop = new Property(prop.getName(), prop.getString(), type); + cat.put(key, prop); + } + + prop.setDefaultValues(defaultValues); + prop.comment = comment; + + return prop; + } + else if (defaultValues != null) + { + Property prop = new Property(key, defaultValues, type); + prop.setDefaultValues(defaultValues); + prop.comment = comment; + cat.put(key, prop); + return prop; + } + else + { + return null; + } + } + + /* **************************************************************************************************************** + * + * Other methods + * + *************************************************************************************************************** */ + + public boolean hasCategory(String category) + { + return categories.get(category) != null; + } + + public boolean hasKey(String category, String key) + { + ConfigCategory cat = categories.get(category); + return cat != null && cat.containsKey(key); + } + + public void load() + { + if (PARENT != null && PARENT != this) + { + return; + } + + BufferedReader buffer = null; + UnicodeInputStreamReader input = null; + try + { + if (file.getParentFile() != null) + { + file.getParentFile().mkdirs(); + } + + if (!file.exists()) + { + // Either a previous load attempt failed or the file is new; clear maps + categories.clear(); + children.clear(); + if (!file.createNewFile()) + return; + } + + if (file.canRead()) + { + input = new UnicodeInputStreamReader(new FileInputStream(file), defaultEncoding); + defaultEncoding = input.getEncoding(); + buffer = new BufferedReader(input); + + String line; + ConfigCategory currentCat = null; + Property.Type type = null; + ArrayList tmpList = null; + int lineNum = 0; + String name = null; + loadedConfigVersion = null; + + while (true) + { + lineNum++; + line = buffer.readLine(); + + if (line == null) + { + if (lineNum == 1) + loadedConfigVersion = definedConfigVersion; + break; + } + + Matcher start = CONFIG_START.matcher(line); + Matcher end = CONFIG_END.matcher(line); + + if (start.matches()) + { + fileName = start.group(1); + categories = new TreeMap(); + continue; + } + else if (end.matches()) + { + fileName = end.group(1); + Configuration child = new Configuration(); + child.categories = categories; + this.children.put(fileName, child); + continue; + } + + int nameStart = -1, nameEnd = -1; + boolean skip = false; + boolean quoted = false; + boolean isFirstNonWhitespaceCharOnLine = true; + + for (int i = 0; i < line.length() && !skip; ++i) + { + if (Character.isLetterOrDigit(line.charAt(i)) || ALLOWED_CHARS.indexOf(line.charAt(i)) != -1 || (quoted && line.charAt(i) != '"')) + { + if (nameStart == -1) + { + nameStart = i; + } + + nameEnd = i; + isFirstNonWhitespaceCharOnLine = false; + } + else if (Character.isWhitespace(line.charAt(i))) + { + // ignore space charaters + } + else + { + switch (line.charAt(i)) + { + case '#': + if (tmpList != null) // allow special characters as part of string lists + break; + skip = true; + continue; + + case '"': + if (tmpList != null) // allow special characters as part of string lists + break; + if (quoted) + { + quoted = false; + } + if (!quoted && nameStart == -1) + { + quoted = true; + } + break; + + case '{': + if (tmpList != null) // allow special characters as part of string lists + break; + name = line.substring(nameStart, nameEnd + 1); + String qualifiedName = ConfigCategory.getQualifiedName(name, currentCat); + + ConfigCategory cat = categories.get(qualifiedName); + if (cat == null) + { + currentCat = new ConfigCategory(name, currentCat); + categories.put(qualifiedName, currentCat); + } + else + { + currentCat = cat; + } + name = null; + + break; + + case '}': + if (tmpList != null) // allow special characters as part of string lists + break; + if (currentCat == null) + { + throw new RuntimeException(String.format("Config file corrupt, attepted to close to many categories '%s:%d'", fileName, lineNum)); + } + currentCat = currentCat.parent; + break; + + case '=': + if (tmpList != null) // allow special characters as part of string lists + break; + name = line.substring(nameStart, nameEnd + 1); + + if (currentCat == null) + { + throw new RuntimeException(String.format("'%s' has no scope in '%s:%d'", name, fileName, lineNum)); + } + + Property prop = new Property(name, line.substring(i + 1), type, true); + i = line.length(); + + currentCat.put(name, prop); + + break; + + case ':': + if (tmpList != null) // allow special characters as part of string lists + break; + type = Property.Type.tryParse(line.substring(nameStart, nameEnd + 1).charAt(0)); + nameStart = nameEnd = -1; + break; + + case '<': + if ((tmpList != null && i + 1 == line.length()) || (tmpList == null && i + 1 != line.length())) + { + throw new RuntimeException(String.format("Malformed list property \"%s:%d\"", fileName, lineNum)); + } + else if (i + 1 == line.length()) + { + name = line.substring(nameStart, nameEnd + 1); + + if (currentCat == null) + { + throw new RuntimeException(String.format("'%s' has no scope in '%s:%d'", name, fileName, lineNum)); + } + + tmpList = new ArrayList(); + + skip = true; + } + + break; + + case '>': + if (tmpList == null) + { + throw new RuntimeException(String.format("Malformed list property \"%s:%d\"", fileName, lineNum)); + } + + if (isFirstNonWhitespaceCharOnLine) + { + currentCat.put(name, new Property(name, tmpList.toArray(new String[tmpList.size()]), type)); + name = null; + tmpList = null; + type = null; + } // else allow special characters as part of string lists + break; + + case '~': + if (tmpList != null) // allow special characters as part of string lists + break; + + if (line.startsWith(CONFIG_VERSION_MARKER)) + { + int colon = line.indexOf(':'); + if (colon != -1) + loadedConfigVersion = line.substring(colon + 1).trim(); + + skip = true; + } + break; + + default: + if (tmpList != null) // allow special characters as part of string lists + break; + throw new RuntimeException(String.format("Unknown character '%s' in '%s:%d'", line.charAt(i), fileName, lineNum)); + } + isFirstNonWhitespaceCharOnLine = false; + } + } + + if (quoted) + { + throw new RuntimeException(String.format("Unmatched quote in '%s:%d'", fileName, lineNum)); + } + else if (tmpList != null && !skip) + { + tmpList.add(line.trim()); + } + } + } + } + catch (IOException e) + { + e.printStackTrace(); + } + finally + { + if (buffer != null) + { + try + { + buffer.close(); + } catch (IOException e){} + } + if (input != null) + { + try + { + input.close(); + } catch (IOException e){} + } + } + + resetChangedState(); + } + + public void save() + { + if (PARENT != null && PARENT != this) + { + PARENT.save(); + return; + } + + try + { + if (file.getParentFile() != null) + { + file.getParentFile().mkdirs(); + } + + if (!file.exists() && !file.createNewFile()) + { + return; + } + + if (file.canWrite()) + { + FileOutputStream fos = new FileOutputStream(file); + BufferedWriter buffer = new BufferedWriter(new OutputStreamWriter(fos, defaultEncoding)); + + buffer.write("# Configuration file" + NEW_LINE + NEW_LINE); + + if (this.definedConfigVersion != null) + buffer.write(CONFIG_VERSION_MARKER + ": " + this.definedConfigVersion + NEW_LINE + NEW_LINE); + + if (children.isEmpty()) + { + save(buffer); + } + else + { + for (Map.Entry entry : children.entrySet()) + { + buffer.write("START: \"" + entry.getKey() + "\"" + NEW_LINE); + entry.getValue().save(buffer); + buffer.write("END: \"" + entry.getKey() + "\"" + NEW_LINE + NEW_LINE); + } + } + + buffer.close(); + fos.close(); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + private void save(BufferedWriter out) throws IOException + { + for (ConfigCategory cat : categories.values()) + { + if (!cat.isChild()) + { + cat.write(out, 0); + out.newLine(); + } + } + } + + public ConfigCategory getCategory(String category) + { + ConfigCategory ret = categories.get(category); + + if (ret == null) + { + if (category.contains(CATEGORY_SPLITTER)) + { + String[] hierarchy = category.split("\\"+CATEGORY_SPLITTER); + ConfigCategory parent = categories.get(hierarchy[0]); + + if (parent == null) + { + parent = new ConfigCategory(hierarchy[0]); + categories.put(parent.getQualifiedName(), parent); + changed = true; + } + + for (int i = 1; i < hierarchy.length; i++) + { + String name = ConfigCategory.getQualifiedName(hierarchy[i], parent); + ConfigCategory child = categories.get(name); + + if (child == null) + { + child = new ConfigCategory(hierarchy[i], parent); + categories.put(name, child); + changed = true; + } + + ret = child; + parent = child; + } + } + else + { + ret = new ConfigCategory(category); + categories.put(category, ret); + changed = true; + } + } + + return ret; + } + + public void removeCategory(ConfigCategory category) + { + for (ConfigCategory child : category.getChildren()) + { + removeCategory(child); + } + + if (categories.containsKey(category.getQualifiedName())) + { + categories.remove(category.getQualifiedName()); + if (category.parent != null) + { + category.parent.removeChild(category); + } + changed = true; + } + } + + /** + * Adds a comment to the specified ConfigCategory object + * + * @param category the config category + * @param comment a String comment + */ + public Configuration setCategoryComment(String category, String comment) + { + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setComment(comment); + return this; + } + + public void addCustomCategoryComment(String category, String comment) + { + this.setCategoryComment(category, comment); + } + + /** + * Adds a language key to the specified ConfigCategory object + * + * @param category the config category + * @param langKey a language key string such as configcategory.general + */ + public Configuration setCategoryLanguageKey(String category, String langKey) + { + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setLanguageKey(langKey); + return this; + } + + /** + * Sets the custom IConfigEntry class that should be used in place of the standard entry class (which is just a button that + * navigates into the category). This class MUST provide a constructor with the following parameter types: {@code GuiConfig} (the parent + * GuiConfig screen will be provided), {@code GuiPropertyList} (the parent GuiPropertyList will be provided), {@code IConfigElement} + * (the IConfigElement for this Property will be provided). + */ + public Configuration setCategoryConfigEntryClass(String category, Class clazz) + { + + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setConfigEntryClass(clazz); + return this; + } + + /** + * Sets the flag for whether or not this category can be edited while a world is running. Care should be taken to ensure + * that only properties that are truly dynamic can be changed from the in-game options menu. Only set this flag to + * true if all child properties/categories are unable to be modified while a world is running. + */ + public Configuration setCategoryRequiresWorldRestart(String category, boolean requiresWorldRestart) + { + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setRequiresWorldRestart(requiresWorldRestart); + return this; + } + + /** + * Sets whether or not this ConfigCategory requires Minecraft to be restarted when changed. + * Defaults to false. Only set this flag to true if ALL child properties/categories require + * Minecraft to be restarted when changed. Setting this flag will also prevent modification + * of the child properties/categories while a world is running. + */ + public Configuration setCategoryRequiresMcRestart(String category, boolean requiresMcRestart) + { + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setRequiresMcRestart(requiresMcRestart); + return this; + } + + /** + * Sets the order that direct child properties of this config category will be written to the config file and will be displayed in + * config GUIs. + */ + public Configuration setCategoryPropertyOrder(String category, List propOrder) + { + if (!caseSensitiveCustomCategories) + category = category.toLowerCase(Locale.ENGLISH); + getCategory(category).setPropertyOrder(propOrder); + return this; + } + + private void setChild(String name, Configuration child) + { + if (!children.containsKey(name)) + { + children.put(name, child); + changed = true; + } + else + { + Configuration old = children.get(name); + child.categories = old.categories; + child.fileName = old.fileName; + old.changed = true; + } + } + + public static void enableGlobalConfig() + { + PARENT = new Configuration(new File(Loader.instance().getConfigDir(), "global.cfg")); + PARENT.load(); + } + + public static class UnicodeInputStreamReader extends Reader + { + private final InputStreamReader input; + private final String defaultEnc; + + public UnicodeInputStreamReader(InputStream source, String encoding) throws IOException + { + defaultEnc = encoding; + String enc = encoding; + byte[] data = new byte[4]; + + PushbackInputStream pbStream = new PushbackInputStream(source, data.length); + int read = pbStream.read(data, 0, data.length); + int size = 0; + + int bom16 = (data[0] & 0xFF) << 8 | (data[1] & 0xFF); + int bom24 = bom16 << 8 | (data[2] & 0xFF); + int bom32 = bom24 << 8 | (data[3] & 0xFF); + + if (bom24 == 0xEFBBBF) + { + enc = "UTF-8"; + size = 3; + } + else if (bom16 == 0xFEFF) + { + enc = "UTF-16BE"; + size = 2; + } + else if (bom16 == 0xFFFE) + { + enc = "UTF-16LE"; + size = 2; + } + else if (bom32 == 0x0000FEFF) + { + enc = "UTF-32BE"; + size = 4; + } + else if (bom32 == 0xFFFE0000) //This will never happen as it'll be caught by UTF-16LE, + { //but if anyone ever runs across a 32LE file, i'd like to disect it. + enc = "UTF-32LE"; + size = 4; + } + + if (size < read) + { + pbStream.unread(data, size, read - size); + } + + this.input = new InputStreamReader(pbStream, enc); + } + + public String getEncoding() + { + return input.getEncoding(); + } + + @Override + public int read(char[] cbuf, int off, int len) throws IOException + { + return input.read(cbuf, off, len); + } + + @Override + public void close() throws IOException + { + input.close(); + } + } + + public boolean hasChanged() + { + if (changed) return true; + + for (ConfigCategory cat : categories.values()) + { + if (cat.hasChanged()) return true; + } + + for (Configuration child : children.values()) + { + if (child.hasChanged()) return true; + } + + return false; + } + + private void resetChangedState() + { + changed = false; + for (ConfigCategory cat : categories.values()) + { + cat.resetChangedState(); + } + + for (Configuration child : children.values()) + { + child.resetChangedState(); + } + } + + public Set getCategoryNames() + { + return ImmutableSet.copyOf(categories.keySet()); + } + + /** + * Renames a property in a given category. + * + * @param category the category in which the property resides + * @param oldPropName the existing property name + * @param newPropName the new property name + * @return true if the category and property exist, false otherwise + */ + public boolean renameProperty(String category, String oldPropName, String newPropName) + { + if (hasCategory(category)) + { + if (getCategory(category).containsKey(oldPropName) && !oldPropName.equalsIgnoreCase(newPropName)) + { + get(category, newPropName, getCategory(category).get(oldPropName).getString(), ""); + getCategory(category).remove(oldPropName); + return true; + } + } + return false; + } + + /** + * Moves a property from one category to another. + * + * @param oldCategory the category the property currently resides in + * @param propName the name of the property to move + * @param newCategory the category the property should be moved to + * @return true if the old category and property exist, false otherwise + */ + public boolean moveProperty(String oldCategory, String propName, String newCategory) + { + if (!oldCategory.equals(newCategory)) + if (hasCategory(oldCategory)) + if (getCategory(oldCategory).containsKey(propName)) + { + getCategory(newCategory).put(propName, getCategory(oldCategory).remove(propName)); + return true; + } + return false; + } + + /** + * Copies property objects from another Configuration object to this one using the list of category names. Properties that only exist in the + * "from" object are ignored. Pass null for the ctgys array to include all categories. + */ + public void copyCategoryProps(Configuration fromConfig, String[] ctgys) + { + if (ctgys == null) + ctgys = this.getCategoryNames().toArray(new String[this.getCategoryNames().size()]); + + for (String ctgy : ctgys) + if (fromConfig.hasCategory(ctgy) && this.hasCategory(ctgy)) + { + ConfigCategory thiscc = this.getCategory(ctgy); + ConfigCategory fromcc = fromConfig.getCategory(ctgy); + for (Entry entry : thiscc.getValues().entrySet()) + if (fromcc.containsKey(entry.getKey())) + thiscc.put(entry.getKey(), fromcc.get(entry.getKey())); + } + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment) + { + return getString(name, category, defaultValue, comment, name, null); + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @param langKey A language key used for localization of GUIs + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment, String langKey) + { + return getString(name, category, defaultValue, comment, langKey, null); + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment, Pattern pattern) + { + return getString(name, category, defaultValue, comment, name, pattern); + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @param langKey A language key used for localization of GUIs + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment, String langKey, Pattern pattern) + { + Property prop = this.get(category, name, defaultValue); + prop.setLanguageKey(langKey); + prop.setValidationPattern(pattern); + prop.comment = comment + " [default: " + defaultValue + "]"; + return prop.getString(); + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @param validValues A list of valid values that this property can be set to. + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment, String[] validValues) + { + return getString(name, category, defaultValue, comment, validValues, name); + } + + /** + * Creates a string property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @param validValues A list of valid values that this property can be set to. + * @param langKey A language key used for localization of GUIs + * @return The value of the new string property. + */ + public String getString(String name, String category, String defaultValue, String comment, String[] validValues, String langKey) + { + Property prop = this.get(category, name, defaultValue); + prop.setValidValues(validValues); + prop.setLanguageKey(langKey); + prop.comment = comment + " [default: " + defaultValue + "]"; + return prop.getString(); + } + + /** + * Creates a string list property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new string property. + */ + public String[] getStringList(String name, String category, String[] defaultValues, String comment) + { + return getStringList(name, category, defaultValues, comment, (String[]) null, name); + } + + /** + * Creates a string list property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new string property. + */ + public String[] getStringList(String name, String category, String[] defaultValue, String comment, String[] validValues) + { + return getStringList(name, category, defaultValue, comment, validValues, name); + } + + /** + * Creates a string list property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new string property. + */ + public String[] getStringList(String name, String category, String[] defaultValue, String comment, String[] validValues, String langKey) + { + Property prop = this.get(category, name, defaultValue); + prop.setLanguageKey(langKey); + prop.setValidValues(validValues); + prop.comment = comment + " [default: " + prop.getDefault() + "]"; + return prop.getStringList(); + } + + /** + * Creates a boolean property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @return The value of the new boolean property. + */ + public boolean getBoolean(String name, String category, boolean defaultValue, String comment) + { + return getBoolean(name, category, defaultValue, comment, name); + } + + /** + * Creates a boolean property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param comment A brief description what the property does. + * @param langKey A language key used for localization of GUIs + * @return The value of the new boolean property. + */ + public boolean getBoolean(String name, String category, boolean defaultValue, String comment, String langKey) + { + Property prop = this.get(category, name, defaultValue); + prop.setLanguageKey(langKey); + prop.comment = comment + " [default: " + defaultValue + "]"; + return prop.getBoolean(defaultValue); + } + + /** + * Creates a integer property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param minValue Minimum value of the property. + * @param maxValue Maximum value of the property. + * @param comment A brief description what the property does. + * @return The value of the new integer property. + */ + public int getInt(String name, String category, int defaultValue, int minValue, int maxValue, String comment) + { + return getInt(name, category, defaultValue, minValue, maxValue, comment, name); + } + + /** + * Creates a integer property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param minValue Minimum value of the property. + * @param maxValue Maximum value of the property. + * @param comment A brief description what the property does. + * @param langKey A language key used for localization of GUIs + * @return The value of the new integer property. + */ + public int getInt(String name, String category, int defaultValue, int minValue, int maxValue, String comment, String langKey) + { + Property prop = this.get(category, name, defaultValue); + prop.setLanguageKey(langKey); + prop.comment = comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]"; + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + return prop.getInt(defaultValue) < minValue ? minValue : (prop.getInt(defaultValue) > maxValue ? maxValue : prop.getInt(defaultValue)); + } + + /** + * Creates a float property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param minValue Minimum value of the property. + * @param maxValue Maximum value of the property. + * @param comment A brief description what the property does. + * @return The value of the new float property. + */ + public float getFloat(String name, String category, float defaultValue, float minValue, float maxValue, String comment) + { + return getFloat(name, category, defaultValue, minValue, maxValue, comment, name); + } + + /** + * Creates a float property. + * + * @param name Name of the property. + * @param category Category of the property. + * @param defaultValue Default value of the property. + * @param minValue Minimum value of the property. + * @param maxValue Maximum value of the property. + * @param comment A brief description what the property does. + * @param langKey A language key used for localization of GUIs + * @return The value of the new float property. + */ + public float getFloat(String name, String category, float defaultValue, float minValue, float maxValue, String comment, String langKey) + { + Property prop = this.get(category, name, Float.toString(defaultValue), name); + prop.setLanguageKey(langKey); + prop.comment = comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]"; + prop.setMinValue(minValue); + prop.setMaxValue(maxValue); + try + { + return Float.parseFloat(prop.getString()) < minValue ? minValue : (Float.parseFloat(prop.getString()) > maxValue ? maxValue : Float.parseFloat(prop.getString())); + } + catch (Exception e) + { + e.printStackTrace(); + } + return defaultValue; + } + + public File getConfigFile() + { + return file; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Property.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Property.java new file mode 100644 index 0000000..8616986 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/config/Property.java @@ -0,0 +1,1143 @@ +/** + * This software is provided under the terms of the Minecraft Forge Public + * License v1.0. + */ + +package net.minecraftforge.common.config; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.regex.Pattern; + +import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; +import cpw.mods.fml.client.config.GuiEditArrayEntries.IArrayEntry; + +public class Property +{ + public enum Type + { + STRING, + INTEGER, + BOOLEAN, + DOUBLE, + COLOR, + MOD_ID; + + public static Type tryParse(char id) + { + for (int x = 0; x < values().length; x++) + { + if (values()[x].getID() == id) + { + return values()[x]; + } + } + + return STRING; + } + + public char getID() + { + return name().charAt(0); + } + } + + private String name; + private String value; + private String defaultValue; + public String comment; + private String[] values; + private String[] defaultValues; + private String[] validValues; + private String langKey; + private String minValue; + private String maxValue; + + private Class configEntryClass = null; + private Class arrayEntryClass = null; + + private boolean requiresWorldRestart = false; + private boolean showInGui = true; + private boolean requiresMcRestart = false; + private Pattern validationPattern; + private final boolean wasRead; + private final boolean isList; + private boolean isListLengthFixed = false; + private int maxListLength = -1; + private final Type type; + private boolean changed = false; + + public Property(String name, String value, Type type) + { + this(name, value, type, false, new String[0], name); + } + + public Property(String name, String value, Type type, boolean read) + { + this(name, value, type, read, new String[0], name); + } + + public Property(String name, String value, Type type, String[] validValues) + { + this(name, value, type, false, validValues, name); + } + + public Property(String name, String value, Type type, String langKey) + { + this(name, value, type, false, new String[0], langKey); + } + + public Property(String name, String value, Type type, boolean read, String langKey) + { + this(name, value, type, read, new String[0], langKey); + } + + public Property(String name, String value, Type type, String[] validValues, String langKey) + { + this(name, value, type, false, validValues, langKey); + } + + Property(String name, String value, Type type, boolean read, String[] validValues, String langKey) + { + setName(name); + this.value = value; + this.values = new String[0]; + this.type = type; + wasRead = read; + isList = false; + this.defaultValue = value; + this.defaultValues = new String[0]; + this.validValues = validValues; + this.isListLengthFixed = false; + this.maxListLength = -1; + this.minValue = String.valueOf(Integer.MIN_VALUE); + this.maxValue = String.valueOf(Integer.MAX_VALUE); + this.langKey = langKey; + this.comment = ""; + } + + public Property(String name, String[] values, Type type) + { + this(name, values, type, false); + } + + Property(String name, String[] values, Type type, boolean read) + { + this(name, values, type, read, new String[0], name); + } + + public Property(String name, String[] values, Type type, String langKey) + { + this(name, values, type, false, langKey); + } + + Property(String name, String[] values, Type type, boolean read, String langKey) + { + this(name, values, type, read, new String[0], langKey); + } + + Property(String name, String[] values, Type type, boolean read, String[] validValues, String langKey) + { + setName(name); + this.type = type; + this.values = Arrays.copyOf(values, values.length); + wasRead = read; + isList = true; + this.value = ""; + this.defaultValue = ""; + for (String s : values) + this.defaultValue += ", [" + s + "]"; + this.defaultValue = this.defaultValue.replaceFirst(", ", ""); + this.defaultValues = Arrays.copyOf(values, values.length); + this.validValues = validValues; + this.isListLengthFixed = false; + this.maxListLength = -1; + this.minValue = String.valueOf(Integer.MIN_VALUE); + this.maxValue = String.valueOf(Integer.MAX_VALUE); + this.langKey = langKey; + this.comment = ""; + } + + /** + * Returns whether or not this Property is defaulted. + * + * @return true if the current value(s) is(are) deeply equal to the default value(s) + */ + public boolean isDefault() + { + if (this.isBooleanList()) + { + if (values.length == defaultValues.length) + { + for (int i = 0; i < values.length; i++) + if (Boolean.parseBoolean(values[i]) != Boolean.parseBoolean(defaultValues[i])) + return false; + + return true; + } + else + return false; + } + + if (this.isIntList()) + { + if (values.length == defaultValues.length) + { + for (int i = 0; i < values.length; i++) + if (Integer.parseInt(values[i]) != Integer.parseInt(defaultValues[i])) + return false; + + return true; + } + else + return false; + } + + if (this.isDoubleList()) + { + if (values.length == defaultValues.length) + { + for (int i = 0; i < values.length; i++) + if (Double.parseDouble(values[i]) != Double.parseDouble(defaultValues[i])) + return false; + + return true; + } + else + return false; + } + + if (this.isList()) + { + if (values.length == defaultValues.length) + { + for (int i = 0; i < values.length; i++) + if (!values[i].equals(defaultValues[i])) + return false; + + return true; + } + else + return false; + } + + if (this.type == Type.BOOLEAN && this.isBooleanValue()) + return Boolean.parseBoolean(value) == Boolean.parseBoolean(defaultValue); + + if (this.type == Type.INTEGER && this.isIntValue()) + return Integer.parseInt(value) == Integer.parseInt(defaultValue); + + if (this.type == Type.DOUBLE && this.isDoubleValue()) + return Double.parseDouble(value) == Double.parseDouble(defaultValue); + + return value.equals(defaultValue); + } + + /** + * Sets the current value(s) of this Property to the default value(s). + */ + public Property setToDefault() + { + this.value = this.defaultValue; + this.values = Arrays.copyOf(this.defaultValues, this.defaultValues.length); + return this; + } + + /** + * Gets the raw String default value of this Property. Check for isList() == false first. + * + * @return the default value String + */ + public String getDefault() + { + return defaultValue; + } + + /** + * Gets the raw String[] default values of this Property. Check for isList() == true first. + * + * @return the default values String[] + */ + public String[] getDefaults() + { + return Arrays.copyOf(this.defaultValues, this.defaultValues.length); + } + + /** + * Sets the flag for whether or not this Property can be edited while a world is running. Care should be taken to ensure + * that only properties that are truly dynamic can be changed from the in-game options menu. When set to false the Property will be + * editable from both the main menu Mods list config screen and the in-game Mod Options config screen. When set to true the Property + * will only be editable from the main menu Mods list config screen. + */ + public Property setRequiresWorldRestart(boolean requiresWorldRestart) + { + this.requiresWorldRestart = requiresWorldRestart; + return this; + } + + /** + * Returns whether or not this Property is able to be edited while a world is running using the in-game Mod Options screen + * as well as the Mods list screen, or only from the Mods list screen. Setting this flag to true will disable editing of + * this property while a world is running. + */ + public boolean requiresWorldRestart() + { + return this.requiresWorldRestart; + } + + /** + * Sets whether or not this Property should be allowed to show on config GUIs. + * Defaults to true. + */ + public Property setShowInGui(boolean showInGui) + { + this.showInGui = showInGui; + return this; + } + + /** + * Gets whether or not this Property should be allowed to show on config GUIs. + * Defaults to true unless set to false. + */ + public boolean showInGui() + { + return showInGui; + } + + /** + * Sets whether or not this Property requires Minecraft to be restarted when changed. + * Defaults to false. Setting this flag to true will also disable editing of + * this property while a world is running. + */ + public Property setRequiresMcRestart(boolean requiresMcRestart) + { + this.requiresMcRestart = this.requiresWorldRestart = requiresMcRestart; + return this; + } + + /** + * Gets whether or not this Property requires Minecraft to be restarted when changed. + * Defaults to false unless set to true. + */ + public boolean requiresMcRestart() + { + return this.requiresMcRestart; + } + + /** + * Sets the maximum length of this list/array Property. Only important if isList() == true. If the current values array or default + * values array is longer than the new maximum it will be resized. If calling both this method and setIsListLengthFixed(true), this + * method should be called afterwards (but is not required). + */ + public Property setMaxListLength(int max) + { + this.maxListLength = max; + if (this.maxListLength != -1) + { + if (values != null && values.length != maxListLength) + if (this.isListLengthFixed || values.length > maxListLength) + values = Arrays.copyOf(values, maxListLength); + + if (defaultValues != null && defaultValues.length != maxListLength) + if (this.isListLengthFixed || defaultValues.length > maxListLength) + defaultValues = Arrays.copyOf(defaultValues, maxListLength); + } + return this; + } + + /** + * Gets the maximum length of this list/array Property. Only important if isList() == true. + */ + public int getMaxListLength() + { + return this.maxListLength; + } + + /** + * Sets the flag for whether this list/array Property has a fixed length. Only important if isList() == true. If calling both this + * method and setMaxListLength(), this method should be called first (but is not required). + */ + public Property setIsListLengthFixed(boolean isListLengthFixed) + { + this.isListLengthFixed = isListLengthFixed; + return this; + } + + /** + * Returns whether or not this list/array has a fixed length. Only important if isList() == true. + */ + public boolean isListLengthFixed() + { + return this.isListLengthFixed; + } + + /** + * Sets a custom IConfigEntry class that should be used in place of the standard entry class for this Property type. This class + * MUST provide a constructor with the following parameter types: {@code GuiConfig} (the owning GuiConfig screen will be provided), + * {@code GuiConfigEntries} (the owning GuiConfigEntries will be provided), {@code IConfigElement} (the IConfigElement for this Property + * will be provided). + */ + public Property setConfigEntryClass(Class clazz) + { + this.configEntryClass = clazz; + return this; + } + + /** + * Gets the custom IConfigEntry class that should be used in place of the standard entry class for this Property type, or null if + * none has been set. + * + * @return a class that implements IConfigEntry + */ + public Class getConfigEntryClass() + { + return this.configEntryClass; + } + + /** + * Sets a custom IGuiEditListEntry class that should be used in place of the standard entry class for this Property type. This class + * MUST provide a constructor with the following parameter types: {@code GuiEditList} (the owning GuiEditList screen will be provided), + * {@code GuiPropertyList} (the parent GuiPropertyList will be provided), {@code IConfigProperty} (the IConfigProperty for this Property + * will be provided). + * + * @param clazz a class that implements IConfigEntry + */ + public Property setArrayEntryClass(Class clazz) + { + this.arrayEntryClass = clazz; + return this; + } + + /** + * Gets the custom IArrayEntry class that should be used in place of the standard entry class for this Property type, or null if + * none has been set. + * + * @return a class that implements IArrayEntry + */ + public Class getArrayEntryClass() + { + return this.arrayEntryClass; + } + + /** + * Sets a regex Pattern object used to validate user input for formatted String or String[] properties. + * + * @param validationPattern + */ + public Property setValidationPattern(Pattern validationPattern) + { + this.validationPattern = validationPattern; + return this; + } + + /** + * Gets the Pattern object used to validate user input for this Property. + * + * @return the user input validation Pattern object, or null if none is set + */ + public Pattern getValidationPattern() + { + return this.validationPattern; + } + + /** + * Sets the localization language key for this Property so that the config GUI screens are nice and pretty <3. The string languageKey + + * ".tooltip" is used for tooltips when a user hovers the mouse over a GUI property label. + * + * @param langKey a string language key such as myawesomemod.config.myPropName + */ + public Property setLanguageKey(String langKey) + { + this.langKey = langKey; + return this; + } + + /** + * Gets the language key string for this Property. + * + * @return the language key + */ + public String getLanguageKey() + { + return this.langKey; + } + + /** + * Sets the default string value of this Property. + * + * @param defaultValue a String value + */ + public Property setDefaultValue(String defaultValue) + { + this.defaultValue = defaultValue; + return this; + } + + /** + * Sets the default String[] values of this Property. + * + * @param defaultValues an array of String values + */ + public Property setDefaultValues(String[] defaultValues) + { + this.defaultValue = ""; + for (String s : defaultValues) + this.defaultValue += ", [" + s + "]"; + this.defaultValue = this.defaultValue.replaceFirst(", ", ""); + this.defaultValues = Arrays.copyOf(defaultValues, defaultValues.length); + return this; + } + + /** + * Sets the default int value of this Property. + * + * @param defaultValue an int value + */ + public Property setDefaultValue(int defaultValue) + { + setDefaultValue(Integer.toString(defaultValue)); + return this; + } + + /** + * Sets the default int[] values of this Property. + * + * @param defaultValues an array of int values + */ + public Property setDefaultValues(int[] defaultValues) + { + String[] temp = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + temp[i] = Integer.toString(defaultValues[i]); + + setDefaultValues(temp); + return this; + } + + /** + * Sets the default double value of this Property. + * + * @param defaultValue a double value + */ + public Property setDefaultValue(double defaultValue) + { + setDefaultValue(Double.toString(defaultValue)); + return this; + } + + /** + * Sets the default double[] values of this Property + * + * @param defaultValues an array of double values + */ + public Property setDefaultValues(double[] defaultValues) + { + String[] temp = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + temp[i] = Double.toString(defaultValues[i]); + + setDefaultValues(temp); + return this; + } + + /** + * Sets the default boolean value of this Property. + * + * @param defaultValue a boolean value + */ + public Property setDefaultValue(boolean defaultValue) + { + setDefaultValue(Boolean.toString(defaultValue)); + return this; + } + + /** + * Sets the default boolean[] values of this Property. + * + * @param defaultValues an array of boolean values + */ + public Property setDefaultValues(boolean[] defaultValues) + { + String[] temp = new String[defaultValues.length]; + for (int i = 0; i < defaultValues.length; i++) + temp[i] = Boolean.toString(defaultValues[i]); + + setDefaultValues(temp); + return this; + } + + /** + * Sets the minimum int value of this Property. + * + * @param minValue an int value + */ + public Property setMinValue(int minValue) + { + this.minValue = Integer.toString(minValue); + return this; + } + + /** + * Sets the maximum int value of this Property. + * + * @param maxValue an int value + */ + public Property setMaxValue(int maxValue) + { + this.maxValue = Integer.toString(maxValue); + return this; + } + + /** + * Sets the minimum double value of this Property. + * + * @param minValue a double value + */ + public Property setMinValue(double minValue) + { + this.minValue = Double.toString(minValue); + return this; + } + + /** + * Sets the maximum double value of this Property. + * + * @param maxValue a double value + */ + public Property setMaxValue(double maxValue) + { + this.maxValue = Double.toString(maxValue); + return this; + } + + /** + * Gets the minimum value. + * + * @return the minimum value bound + */ + public String getMinValue() + { + return minValue; + } + + /** + * Gets the maximum value. + * + * @return the maximum value bound + */ + public String getMaxValue() + { + return maxValue; + } + + /** + * Returns the value in this property as it's raw string. + * + * @return current value + */ + public String getString() + { + return value; + } + + /** + * Sets the array of valid values that this String Property can be set to. When an array of valid values is defined for a Property the + * GUI control for that property will be a value cycle button. + * + * @param validValues a String array of valid values + */ + public Property setValidValues(String[] validValues) + { + this.validValues = validValues; + return this; + } + + /** + * Gets the array of valid values that this String Property can be set to, or null if not defined. + * + * @return a String array of valid values + */ + public String[] getValidValues() + { + return this.validValues; + } + + /** + * Returns the value in this property as an integer, + * if the value is not a valid integer, it will return the initially provided default. + * + * @return The value + */ + public int getInt() + { + try + { + return Integer.parseInt(value); + } + catch (NumberFormatException e) + { + return Integer.parseInt(defaultValue); + } + } + + /** + * Returns the value in this property as an integer, + * if the value is not a valid integer, it will return the + * provided default. + * + * @param _default The default to provide if the current value is not a valid integer + * @return The value + */ + public int getInt(int _default) + { + try + { + return Integer.parseInt(value); + } + catch (NumberFormatException e) + { + return _default; + } + } + + /** + * Checks if the current value stored in this property can be converted to an integer. + * @return True if the type of the Property is an Integer + */ + public boolean isIntValue() + { + try + { + Integer.parseInt(value); + return true; + } + catch (NumberFormatException e) + { + return false; + } + } + + /** + * Returns the value in this property as a boolean, + * if the value is not a valid boolean, it will return the + * provided default. + * + * @param _default The default to provide + * @return The value as a boolean, or the default + */ + public boolean getBoolean(boolean _default) + { + if (isBooleanValue()) + { + return Boolean.parseBoolean(value); + } + else + { + return _default; + } + } + + /** + * Returns the value in this property as a boolean, if the value is not a valid boolean, it will return the provided default. + * + * @return The value as a boolean, or the default + */ + public boolean getBoolean() + { + if (isBooleanValue()) + { + return Boolean.parseBoolean(value); + } + else + { + return Boolean.parseBoolean(defaultValue); + } + } + + /** + * Checks if the current value held by this property is a valid boolean value. + * + * @return True if it is a boolean value + */ + public boolean isBooleanValue() + { + return ("true".equals(value.toLowerCase()) || "false".equals(value.toLowerCase())); + } + + /** + * Checks if the current value held by this property is a valid double value. + * @return True if the value can be converted to an double + */ + public boolean isDoubleValue() + { + try + { + Double.parseDouble(value); + return true; + } + catch (NumberFormatException e) + { + return false; + } + } + + /** + * Returns the value in this property as a double, + * if the value is not a valid double, it will return the + * provided default. + * + * @param _default The default to provide if the current value is not a valid double + * @return The value + */ + public double getDouble(double _default) + { + try + { + return Double.parseDouble(value); + } + catch (NumberFormatException e) + { + return _default; + } + } + + /** + * Returns the value in this property as a double, if the value is not a valid double, it will return the provided default. + * + * @param _default The default to provide if the current value is not a valid double + * @return The value + */ + public double getDouble() + { + try + { + return Double.parseDouble(value); + } + catch (NumberFormatException e) + { + return Double.parseDouble(defaultValue); + } + } + + public String[] getStringList() + { + return values; + } + + /** + * Returns the integer value of all values that can + * be parsed in the list. + * + * @return Array of length 0 if none of the values could be parsed. + */ + public int[] getIntList() + { + ArrayList nums = new ArrayList(); + + for (String value : values) + { + try + { + nums.add(Integer.parseInt(value)); + } + catch (NumberFormatException e){} + } + + int[] primitives = new int[nums.size()]; + + for (int i = 0; i < nums.size(); i++) + { + primitives[i] = nums.get(i); + } + + return primitives; + } + + /** + * Checks if all of the current values stored in this property can be converted to an integer. + * @return True if the type of the Property is an Integer List + */ + public boolean isIntList() + { + if (isList && type == Type.INTEGER) + for (String value : values) + { + try + { + Integer.parseInt(value); + } + catch (NumberFormatException e) + { + return false; + } + } + return isList && type == Type.INTEGER; + } + + /** + * Returns the boolean value of all values that can + * be parsed in the list. + * + * @return Array of length 0 if none of the values could be parsed. + */ + public boolean[] getBooleanList() + { + ArrayList tmp = new ArrayList(); + for (String value : values) + { + try + { + tmp.add(Boolean.parseBoolean(value)); + } + catch (NumberFormatException e){} + } + + boolean[] primitives = new boolean[tmp.size()]; + + for (int i = 0; i < tmp.size(); i++) + { + primitives[i] = tmp.get(i); + } + + return primitives; + } + + /** + * Checks if all of current values stored in this property can be converted to a boolean. + * @return True if it is a boolean value + */ + public boolean isBooleanList() + { + if (isList && type == Type.BOOLEAN) + for (String value : values) + { + if (!"true".equalsIgnoreCase(value) && !"false".equalsIgnoreCase(value)) + { + return false; + } + } + + return isList && type == Type.BOOLEAN; + } + + /** + * Returns the double value of all values that can + * be parsed in the list. + * + * @return Array of length 0 if none of the values could be parsed. + */ + public double[] getDoubleList() + { + ArrayList tmp = new ArrayList(); + for (String value : values) + { + try + { + tmp.add(Double.parseDouble(value)); + } + catch (NumberFormatException e) {} + } + + double[] primitives = new double[tmp.size()]; + + for (int i = 0; i < tmp.size(); i++) + { + primitives[i] = tmp.get(i); + } + + return primitives; + } + + /** + * Checks if all of the current values stored in this property can be converted to a double. + * @return True if the type of the Property is a double List + */ + public boolean isDoubleList() + { + if (isList && type == Type.DOUBLE) + for (String value : values) + { + try + { + Double.parseDouble(value); + } + catch (NumberFormatException e) + { + return false; + } + } + + return isList && type == Type.DOUBLE; + } + + /** + * Gets the name/key for this Property. + * + * @return the Property name + */ + public String getName() + { + return name; + } + + /** + * Sets the name/key for this Property. + * + * @param name a name + */ + public void setName(String name) + { + this.name = name; + } + + /** + * Determines if this config value was just created, or if it was read from the config file. + * This is useful for mods who auto-assign their blocks to determine if the ID returned is + * a configured one, or a automatically generated one. + * + * @return True if this property was loaded from the config file with a value + */ + public boolean wasRead() + { + return wasRead; + } + + /** + * Gets the Property.Type enum value for this Property. + * + * @return the Property's type + */ + public Type getType() + { + return type; + } + + /** + * Returns whether or not this Property is a list/array. + * + * @return true if this Property is a list/array, false otherwise + */ + public boolean isList() + { + return isList; + } + + /** + * Gets the changed status of this Property. + * + * @return true if this Property has changed, false otherwise + */ + public boolean hasChanged(){ return changed; } + void resetChangedState(){ changed = false; } + + /** + * Sets the value of this Property to the provided String value. + */ + public Property setValue(String value) + { + this.value = value; + changed = true; + return this; + } + + public void set(String value) + { + this.setValue(value); + } + + /** + * Sets the values of this Property to the provided String[] values. + */ + public Property setValues(String[] values) + { + this.values = Arrays.copyOf(values, values.length); + changed = true; + return this; + } + + public void set(String[] values) + { + this.setValues(values); + } + + /** + * Sets the value of this Property to the provided int value. + */ + public Property setValue(int value) + { + setValue(Integer.toString(value)); + return this; + } + + /** + * Sets the value of this Property to the provided boolean value. + */ + public Property setValue(boolean value) + { + setValue(Boolean.toString(value)); + return this; + } + + /** + * Sets the value of this Property to the provided double value. + */ + public Property setValue(double value) + { + setValue(Double.toString(value)); + return this; + } + + /** + * Sets the values of this Property to the provided boolean[] values. + */ + public Property setValues(boolean[] values) + { + this.values = new String[values.length]; + for (int i = 0; i < values.length; i++) + this.values[i] = String.valueOf(values[i]); + changed = true; + return this; + } + + public void set(boolean[] values) + { + this.setValues(values); + } + + /** + * Sets the values of this Property to the provided int[] values. + */ + public Property setValues(int[] values) + { + this.values = new String[values.length]; + for (int i = 0; i < values.length; i++) + this.values[i] = String.valueOf(values[i]); + changed = true; + return this; + } + + public void set(int[] values) + { + this.setValues(values); + } + + /** + * Sets the values of this Property to the provided double[] values. + */ + public Property setValues(double[] values) + { + this.values = new String[values.length]; + for (int i = 0; i < values.length; i++) + this.values[i] = String.valueOf(values[i]); + changed = true; + return this; + } + + public void set(double[] values) + { + this.setValues(values); + } + public void set(int value){ set(Integer.toString(value)); } + public void set(boolean value){ set(Boolean.toString(value)); } + public void set(double value){ set(Double.toString(value)); } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/DimensionMessageHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/DimensionMessageHandler.java new file mode 100644 index 0000000..35b5000 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/DimensionMessageHandler.java @@ -0,0 +1,26 @@ +package net.minecraftforge.common.network; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.network.ForgeMessage.DimensionRegisterMessage; +import org.apache.logging.log4j.Level; +import cpw.mods.fml.common.FMLLog; + +public class DimensionMessageHandler extends SimpleChannelInboundHandler{ + @Override + protected void channelRead0(ChannelHandlerContext ctx, DimensionRegisterMessage msg) throws Exception + { + if (!DimensionManager.isDimensionRegistered(msg.dimensionId)) + { + DimensionManager.registerDimension(msg.dimensionId, msg.providerId); + } + } + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "DimensionMessageHandler exception"); + super.exceptionCaught(ctx, cause); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.java new file mode 100644 index 0000000..07eb22f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/FluidIdRegistryMessageHandler.java @@ -0,0 +1,24 @@ +package net.minecraftforge.common.network; + +import net.minecraftforge.fluids.FluidRegistry; + +import org.apache.logging.log4j.Level; + +import cpw.mods.fml.common.FMLLog; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; + +public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler { + @Override + protected void channelRead0(ChannelHandlerContext ctx, ForgeMessage.FluidIdMapMessage msg) throws Exception + { + FluidRegistry.initFluidIDs(msg.fluidIds, msg.defaultFluids); + } + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception + { + FMLLog.log(Level.ERROR, cause, "FluidIdRegistryMessageHandler exception"); + super.exceptionCaught(ctx, cause); + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeMessage.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeMessage.java new file mode 100644 index 0000000..ee504c2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeMessage.java @@ -0,0 +1,96 @@ +package net.minecraftforge.common.network; + +import java.util.Map; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.network.ByteBufUtils; +import io.netty.buffer.ByteBuf; + +public abstract class ForgeMessage { + public static class DimensionRegisterMessage extends ForgeMessage { + /** The dimension ID to register on client */ + int dimensionId; + /** The provider ID to register with dimension on client */ + int providerId; + + public DimensionRegisterMessage(){} + public DimensionRegisterMessage(int dimensionId, int providerId) + { + this.dimensionId = dimensionId; + this.providerId = providerId; + } + + @Override + void toBytes(ByteBuf bytes) + { + bytes.writeInt(this.dimensionId); + bytes.writeInt(this.providerId); + } + + @Override + void fromBytes(ByteBuf bytes) + { + dimensionId = bytes.readInt(); + providerId = bytes.readInt(); + } + } + + public static class FluidIdMapMessage extends ForgeMessage { + BiMap fluidIds = HashBiMap.create(); + Set defaultFluids = Sets.newHashSet(); + @Override + void toBytes(ByteBuf bytes) + { + Map ids = FluidRegistry.getRegisteredFluidIDsByFluid(); + bytes.writeInt(ids.size()); + for (Map.Entry entry : ids.entrySet()) + { + ByteBufUtils.writeUTF8String(bytes,entry.getKey().getName()); + bytes.writeInt(entry.getValue()); + } + for (Map.Entry entry : ids.entrySet()) + { + String defaultName = FluidRegistry.getDefaultFluidName(entry.getKey()); + ByteBufUtils.writeUTF8String(bytes, defaultName); + } + } + + @Override + void fromBytes(ByteBuf bytes) + { + int listSize = bytes.readInt(); + for (int i = 0; i < listSize; i++) { + String fluidName = ByteBufUtils.readUTF8String(bytes); + int fluidId = bytes.readInt(); + fluidIds.put(FluidRegistry.getFluid(fluidName), fluidId); + } + // do we have a defaults list? + + if (bytes.isReadable()) + { + for (int i = 0; i < listSize; i++) + { + defaultFluids.add(ByteBufUtils.readUTF8String(bytes)); + } + } + else + { + FMLLog.getLogger().log(Level.INFO, "Legacy server message contains no default fluid list - there may be problems with fluids"); + defaultFluids.clear(); + } + } + } + + abstract void toBytes(ByteBuf bytes); + abstract void fromBytes(ByteBuf bytes); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeNetworkHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeNetworkHandler.java new file mode 100644 index 0000000..d00bd91 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeNetworkHandler.java @@ -0,0 +1,38 @@ +package net.minecraftforge.common.network; + +import java.util.EnumMap; +import net.minecraftforge.common.ForgeModContainer; +import cpw.mods.fml.common.network.FMLEmbeddedChannel; +import cpw.mods.fml.common.network.FMLOutboundHandler; +import cpw.mods.fml.common.network.FMLOutboundHandler.OutboundTarget; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ForgeNetworkHandler +{ + private static EnumMap channelPair; + + public static void registerChannel(ForgeModContainer forgeModContainer, Side side) + { + channelPair = NetworkRegistry.INSTANCE.newChannel(forgeModContainer, "FORGE", new ForgeRuntimeCodec()); + if (side == Side.CLIENT) + { + addClientHandlers(); + } + + FMLEmbeddedChannel serverChannel = channelPair.get(Side.SERVER); + serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.NOWHERE); + String handlerName = serverChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class); + serverChannel.pipeline().addAfter(handlerName, "ServerToClientConnection", new ServerToClientConnectionEstablishedHandler()); + } + + @SideOnly(Side.CLIENT) + private static void addClientHandlers() + { + FMLEmbeddedChannel clientChannel = channelPair.get(Side.CLIENT); + String handlerName = clientChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class); + clientChannel.pipeline().addAfter(handlerName, "DimensionHandler", new DimensionMessageHandler()); + clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler()); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeRuntimeCodec.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeRuntimeCodec.java new file mode 100644 index 0000000..ac215e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ForgeRuntimeCodec.java @@ -0,0 +1,24 @@ +package net.minecraftforge.common.network; + +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec; + +public class ForgeRuntimeCodec extends FMLIndexedMessageToMessageCodec { + public ForgeRuntimeCodec() + { + addDiscriminator(1, ForgeMessage.DimensionRegisterMessage.class); + addDiscriminator(2, ForgeMessage.FluidIdMapMessage.class); + } + @Override + public void encodeInto(ChannelHandlerContext ctx, ForgeMessage msg, ByteBuf target) throws Exception + { + msg.toBytes(target); + } + + @Override + public void decodeInto(ChannelHandlerContext ctx, ByteBuf source, ForgeMessage msg) + { + msg.fromBytes(source); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.java new file mode 100644 index 0000000..1da67a0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/network/ServerToClientConnectionEstablishedHandler.java @@ -0,0 +1,19 @@ +package net.minecraftforge.common.network; + +import cpw.mods.fml.common.network.NetworkHandshakeEstablished; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; + +public class ServerToClientConnectionEstablishedHandler extends ChannelInboundHandlerAdapter { + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception + { + if (evt instanceof NetworkHandshakeEstablished) + { + ctx.writeAndFlush(new ForgeMessage.FluidIdMapMessage()); + return; + } + // pass it forward + ctx.fireUserEventTriggered(evt); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/AsynchronousExecutor.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/AsynchronousExecutor.java new file mode 100644 index 0000000..0029488 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/AsynchronousExecutor.java @@ -0,0 +1,361 @@ +package net.minecraftforge.common.util; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; + +import cpw.mods.fml.common.FMLLog; + + +/** + * Executes tasks using a multi-stage process executor. Synchronous executions are via {@link AsynchronousExecutor#finishActive()} or the {@link AsynchronousExecutor#get(Object)} methods. + *

  • Stage 1 creates the object from a parameter, and is usually called asynchronously. + *
  • Stage 2 takes the parameter and object from stage 1 and does any synchronous processing to prepare it. + *
  • Stage 3 takes the parameter and object from stage 1, as well as a callback that was registered, and performs any synchronous calculations. + * + * @param

    The type of parameter you provide to make the object that will be created. It should implement {@link Object#hashCode()} and {@link Object#equals(Object)} if you want to get the value early. + * @param The type of object you provide. This is created in stage 1, and passed to stage 2, 3, and returned if get() is called. + * @param The type of callback you provide. You may register many of these to be passed to the provider in stage 3, one at a time. + * @param A type of exception you may throw and expect to be handled by the main thread + * @author Wesley Wolfe (c) 2012, 2014 + */ +public final class AsynchronousExecutor { + + public static interface CallBackProvider extends ThreadFactory { + + /** + * Normally an asynchronous call, but can be synchronous + * + * @param parameter parameter object provided + * @return the created object + */ + T callStage1(P parameter) throws E; + + /** + * Synchronous call + * + * @param parameter parameter object provided + * @param object the previously created object + */ + void callStage2(P parameter, T object) throws E; + + /** + * Synchronous call, called multiple times, once per registered callback + * + * @param parameter parameter object provided + * @param object the previously created object + * @param callback the current callback to execute + */ + void callStage3(P parameter, T object, C callback) throws E; + } + + @SuppressWarnings("rawtypes") + static final AtomicIntegerFieldUpdater STATE_FIELD = AtomicIntegerFieldUpdater.newUpdater(AsynchronousExecutor.Task.class, "state"); + + @SuppressWarnings({ "unchecked", "rawtypes" }) + private static boolean set(AsynchronousExecutor.Task $this, int expected, int value) { + return STATE_FIELD.compareAndSet($this, expected, value); + } + + class Task implements Runnable { + static final int PENDING = 0x0; + static final int STAGE_1_ASYNC = PENDING + 1; + static final int STAGE_1_SYNC = STAGE_1_ASYNC + 1; + static final int STAGE_1_COMPLETE = STAGE_1_SYNC + 1; + static final int FINISHED = STAGE_1_COMPLETE + 1; + + volatile int state = PENDING; + final P parameter; + T object; + final List callbacks = new LinkedList(); + E t = null; + + Task(final P parameter) { + this.parameter = parameter; + } + + public void run() { + if (initAsync()) { + finished.add(this); + } + } + + boolean initAsync() { + if (set(this, PENDING, STAGE_1_ASYNC)) { + boolean ret = true; + + try { + init(); + } finally { + if (set(this, STAGE_1_ASYNC, STAGE_1_COMPLETE)) { + // No one is/will be waiting + } else { + // We know that the sync thread will be waiting + synchronized (this) { + if (state != STAGE_1_SYNC) { + // They beat us to the synchronized block + this.notifyAll(); + } else { + // We beat them to the synchronized block + } + state = STAGE_1_COMPLETE; // They're already synchronized, atomic locks are not needed + } + // We want to return false, because we know a synchronous task already handled the finish() + ret = false; // Don't return inside finally; VERY bad practice. + } + } + + return ret; + } else { + return false; + } + } + + void initSync() { + if (set(this, PENDING, STAGE_1_COMPLETE)) { + // If we succeed that variable switch, good as done + init(); + } else if (set(this, STAGE_1_ASYNC, STAGE_1_SYNC)) { + // Async thread is running, but this shouldn't be likely; we need to sync to wait on them because of it. + synchronized (this) { + if (set(this, STAGE_1_SYNC, PENDING)) { // They might NOT synchronized yet, atomic lock IS needed + // We are the first into the lock + while (state != STAGE_1_COMPLETE) { + try { + this.wait(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("Unable to handle interruption on " + parameter, e); + } + } + } else { + // They beat us to the synchronized block + } + } + } else { + // Async thread is not pending, the more likely situation for a task not pending + } + } + + @SuppressWarnings("unchecked") + void init() { + try { + object = provider.callStage1(parameter); + } catch (final Throwable t) { + this.t = (E) t; + } + } + + @SuppressWarnings("unchecked") + T get() throws E { + initSync(); + if (callbacks.isEmpty()) { + // 'this' is a placeholder to prevent callbacks from being empty during finish call + // See get method below + callbacks.add((C) this); + } + finish(); + return object; + } + + void finish() throws E { + switch (state) { + default: + case PENDING: + case STAGE_1_ASYNC: + case STAGE_1_SYNC: + throw new IllegalStateException("Attempting to finish unprepared(" + state + ") task(" + parameter + ")"); + case STAGE_1_COMPLETE: + try { + if (t != null) { + throw t; + } + if (callbacks.isEmpty()) { + return; + } + + final CallBackProvider provider = AsynchronousExecutor.this.provider; + final P parameter = this.parameter; + final T object = this.object; + + provider.callStage2(parameter, object); + for (C callback : callbacks) { + if (callback == this) { + // 'this' is a placeholder to prevent callbacks from being empty on a get() call + // See get method above + continue; + } + provider.callStage3(parameter, object, callback); + } + } finally { + tasks.remove(parameter); + state = FINISHED; + } + case FINISHED: + } + } + + boolean drop() { + if (set(this, PENDING, FINISHED)) { + // If we succeed that variable switch, good as forgotten + tasks.remove(parameter); + return true; + } else { + // We need the async thread to finish normally to properly dispose of the task + return false; + } + } + } + + final CallBackProvider provider; + final Queue finished = new ConcurrentLinkedQueue(); + final Map tasks = new HashMap(); + final ThreadPoolExecutor pool; + + /** + * Uses a thread pool to pass executions to the provider. + * @see AsynchronousExecutor + */ + public AsynchronousExecutor(final CallBackProvider provider, final int coreSize) { + if (provider == null) { + throw new IllegalArgumentException("Provider cannot be null"); + } + this.provider = provider; + + // We have an unbound queue size so do not need a max thread size + pool = new ThreadPoolExecutor(coreSize, Integer.MAX_VALUE, 60l, TimeUnit.SECONDS, new LinkedBlockingQueue(), provider); + } + + /** + * Adds a callback to the parameter provided, adding parameter to the queue if needed. + *

    + * This should always be synchronous. + */ + public void add(P parameter, C callback) { + Task task = tasks.get(parameter); + if (task == null) { + tasks.put(parameter, task = new Task(parameter)); + pool.execute(task); + } + task.callbacks.add(callback); + } + + /** + * This removes a particular callback from the specified parameter. + *

    + * If no callbacks remain for a given parameter, then the {@link CallBackProvider CallBackProvider's} stages may be omitted from execution. + * Stage 3 will have no callbacks, stage 2 will be skipped unless a {@link #get(Object)} is used, and stage 1 will be avoided on a best-effort basis. + *

    + * Subsequent calls to {@link #getSkipQueue(Object)} will always work. + *

    + * Subsequent calls to {@link #get(Object)} might work. + *

    + * This should always be synchronous + * @return true if no further execution for the parameter is possible, such that, no exceptions will be thrown in {@link #finishActive()} for the parameter, and {@link #get(Object)} will throw an {@link IllegalStateException}, false otherwise + * @throws IllegalStateException if parameter is not in the queue anymore + * @throws IllegalStateException if the callback was not specified for given parameter + */ + public boolean drop(P parameter, C callback) throws IllegalStateException { + final Task task = tasks.get(parameter); + if (task == null) { + // Print debug info for QueuedChunk and avoid crash + //throw new IllegalStateException("Unknown " + parameter); + FMLLog.info("Unknown %s", parameter); + FMLLog.info("This should not happen. Please report this error to Forge."); + return false; + } + if (!task.callbacks.remove(callback)) { + throw new IllegalStateException("Unknown " + callback + " for " + parameter); + } + if (task.callbacks.isEmpty()) { + return task.drop(); + } + return false; + } + + /** + * This method attempts to skip the waiting period for said parameter. + *

    + * This should always be synchronous. + * @throws IllegalStateException if the parameter is not in the queue anymore, or sometimes if called from asynchronous thread + */ + public T get(P parameter) throws E, IllegalStateException { + final Task task = tasks.get(parameter); + if (task == null) { + throw new IllegalStateException("Unknown " + parameter); + } + return task.get(); + } + + /** + * Processes a parameter as if it was in the queue, without ever passing to another thread. + */ + public T getSkipQueue(P parameter) throws E { + return skipQueue(parameter); + } + + /** + * Processes a parameter as if it was in the queue, without ever passing to another thread. + */ + public T getSkipQueue(P parameter, C callback) throws E { + final T object = skipQueue(parameter); + provider.callStage3(parameter, object, callback); + return object; + } + + /** + * Processes a parameter as if it was in the queue, without ever passing to another thread. + */ + public T getSkipQueue(P parameter, C...callbacks) throws E { + final CallBackProvider provider = this.provider; + final T object = skipQueue(parameter); + for (C callback : callbacks) { + provider.callStage3(parameter, object, callback); + } + return object; + } + + /** + * Processes a parameter as if it was in the queue, without ever passing to another thread. + */ + public T getSkipQueue(P parameter, Iterable callbacks) throws E { + final CallBackProvider provider = this.provider; + final T object = skipQueue(parameter); + for (C callback : callbacks) { + provider.callStage3(parameter, object, callback); + } + return object; + } + + private T skipQueue(P parameter) throws E { + Task task = tasks.get(parameter); + if (task != null) { + return task.get(); + } + T object = provider.callStage1(parameter); + provider.callStage2(parameter, object); + return object; + } + + /** + * This is the 'heartbeat' that should be called synchronously to finish any pending tasks + */ + public void finishActive() throws E { + final Queue finished = this.finished; + while (!finished.isEmpty()) { + finished.poll().finish(); + } + } + + public void setActiveThreads(final int coreSize) { + pool.setCorePoolSize(coreSize); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/BlockSnapshot.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/BlockSnapshot.java new file mode 100644 index 0000000..91f7606 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/BlockSnapshot.java @@ -0,0 +1,312 @@ +package net.minecraftforge.common.util; + + +import java.io.Serializable; + +import net.minecraft.block.Block; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.DimensionManager; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; + +/** + * Represents a captured snapshot of a block which will not change + * automatically. + *

    + * Unlike Block, which only one object can exist per coordinate, BlockSnapshot + * can exist multiple times for any given Block. + */ +@SuppressWarnings("serial") +public class BlockSnapshot implements Serializable +{ + private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockSnapshot", "false")); + + public final int x; + public final int y; + public final int z; + public final int dimId; + public transient Block replacedBlock; + public final int meta; + public int flag; + private final NBTTagCompound nbt; + public transient World world; + public final UniqueIdentifier blockIdentifier; + + public BlockSnapshot(World world, int x, int y, int z, Block block, int meta) + { + this.world = world; + this.dimId = world.provider.dimensionId; + this.x = x; + this.y = y; + this.z = z; + this.replacedBlock = block; + this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(block); + this.meta = meta; + this.flag = 3; + TileEntity te = world.getTileEntity(x, y, z); + if (te != null) + { + nbt = new NBTTagCompound(); + te.writeToNBT(nbt); + } + else nbt = null; + if (DEBUG) + { + System.out.printf("Created BlockSnapshot - [World: %s ][Location: %d,%d,%d ][Block: %s ][Meta: %d ]", world.getWorldInfo().getWorldName(), x, y, z, block, meta); + } + } + + public BlockSnapshot(World world, int x, int y, int z, Block block, int meta, NBTTagCompound nbt) + { + this.world = world; + this.dimId = world.provider.dimensionId; + this.x = x; + this.y = y; + this.z = z; + this.replacedBlock = block; + this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(block); + this.meta = meta; + this.flag = 3; + this.nbt = nbt; + if (DEBUG) + { + System.out.printf("Created BlockSnapshot - [World: %s ][Location: %d,%d,%d ][Block: %s ][Meta: %d ]", world.getWorldInfo().getWorldName(), x, y, z, block, meta); + } + } + + public BlockSnapshot(World world, int x, int y, int z, Block block, int meta, int flag) + { + this(world, x, y, z, block, meta); + this.flag = flag; + } + + /** + * Raw constructor designed for serialization usages. + */ + public BlockSnapshot(int dimension, int x, int y, int z, String modid, String blockName, int meta, int flag, NBTTagCompound nbt) + { + this.dimId = dimension; + this.x = x; + this.y = y; + this.z = z; + this.meta = meta; + this.flag = flag; + this.blockIdentifier = new UniqueIdentifier(modid + ":" + blockName); + this.nbt = nbt; + } + + public static BlockSnapshot getBlockSnapshot(World world, int x, int y, int z) + { + return new BlockSnapshot(world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y,z)); + } + + public static BlockSnapshot getBlockSnapshot(World world, int x, int y, int z, int flag) + { + return new BlockSnapshot(world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y,z), flag); + } + + public static BlockSnapshot readFromNBT(NBTTagCompound tag) + { + NBTTagCompound nbt = tag.getBoolean("hasTE") ? null : tag.getCompoundTag("tileEntity"); + + return new BlockSnapshot( + tag.getInteger("dimension"), + tag.getInteger("posX"), + tag.getInteger("posY"), + tag.getInteger("posZ"), + tag.getString("blockMod"), + tag.getString("blockName"), + tag.getInteger("metadata"), + tag.getInteger("flag"), + nbt); + } + + public Block getCurrentBlock() + { + return world.getBlock(x, y, z); + } + + public World getWorld() + { + if (this.world == null) + { + this.world = DimensionManager.getWorld(dimId); + } + return this.world; + } + + public Block getReplacedBlock() + { + if (this.replacedBlock == null) + { + this.replacedBlock = GameRegistry.findBlock(this.blockIdentifier.modId, this.blockIdentifier.name); + } + return this.replacedBlock; + } + + public TileEntity getTileEntity() + { + if (nbt != null) + return TileEntity.createAndLoadEntity(nbt); + else return null; + } + + public boolean restore() + { + return restore(false); + } + + public boolean restore(boolean force) + { + return restore(force, true); + } + + public boolean restore(boolean force, boolean applyPhysics) + { + if (getCurrentBlock() != getReplacedBlock() || world.getBlockMetadata(x & 15, y, z & 15) != meta) + { + if (force) + { + world.setBlock(x, y, z, getReplacedBlock(), meta, applyPhysics ? 3 : 2); + } + else + { + return false; + } + } + + world.setBlockMetadataWithNotify(x, y, z, meta, applyPhysics ? 3 : 2); + world.markBlockForUpdate(x, y, z); + TileEntity te = null; + if (nbt != null) + { + te = world.getTileEntity(x, y, z); + if (te != null) + { + te.readFromNBT(nbt); + } + } + + if (DEBUG) + { + System.out.printf("Restored BlockSnapshot with data [World: %s ][Location: %d,%d,%d ][Meta: %d ][Block: %s ][TileEntity: %s ][force: %s ][applyPhysics: %s]", world.getWorldInfo().getWorldName(), x, y, z, meta, getReplacedBlock(), te, force, applyPhysics); + } + return true; + } + + public boolean restoreToLocation(World world, int x, int y, int z, boolean force, boolean applyPhysics) + { + if (getCurrentBlock() != getReplacedBlock() || world.getBlockMetadata(x & 15, y, z & 15) != meta) + { + if (force) + { + world.setBlock(x, y, z, getReplacedBlock(), meta, applyPhysics ? 3 : 2); + } + else + { + return false; + } + } + + world.setBlockMetadataWithNotify(x, y, z, meta, applyPhysics ? 3 : 2); + world.markBlockForUpdate(x, y, z); + TileEntity te = null; + if (nbt != null) + { + te = world.getTileEntity(x, y, z); + if (te != null) + { + te.readFromNBT(nbt); + } + } + + if (DEBUG) + { + System.out.printf("Restored BlockSnapshot with data [World: %s ][Location: %d,%d,%d ][Meta: %d ][Block: %s ][TileEntity: %s ][force: %s ][applyPhysics: %s]", world.getWorldInfo().getWorldName(), x, y, z, meta, getReplacedBlock(), te, force, applyPhysics); + } + return true; + } + + public void writeToNBT(NBTTagCompound compound) + { + compound.setString("blockMod", blockIdentifier.modId); + compound.setString("blockName", blockIdentifier.name); + compound.setInteger("posX", x); + compound.setInteger("posY", y); + compound.setInteger("posZ", z); + compound.setInteger("flag", flag); + compound.setInteger("dimension", dimId); + compound.setInteger("metadata", meta); + + compound.setBoolean("hasTE", nbt != null); + + if (nbt != null) + { + compound.setTag("tileEntity", nbt); + } + } + + @Override + public boolean equals(Object obj) + { + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + final BlockSnapshot other = (BlockSnapshot) obj; + if (this.x != other.x) + { + return false; + } + if (this.y != other.y) + { + return false; + } + if (this.z != other.z) + { + return false; + } + if (this.meta != other.meta) + { + return false; + } + if (this.dimId != other.dimId) + { + return false; + } + if (this.nbt != other.nbt && (this.nbt == null || !this.nbt.equals(other.nbt))) + { + return false; + } + if (this.world != other.world && (this.world == null || !this.world.equals(other.world))) + { + return false; + } + if (this.blockIdentifier != other.blockIdentifier && (this.blockIdentifier == null || !this.blockIdentifier.equals(other.blockIdentifier))) + { + return false; + } + return true; + } + + @Override + public int hashCode() + { + int hash = 7; + hash = 73 * hash + this.x; + hash = 73 * hash + this.y; + hash = 73 * hash + this.z; + hash = 73 * hash + this.meta; + hash = 73 * hash + this.dimId; + hash = 73 * hash + (this.nbt != null ? this.nbt.hashCode() : 0); + hash = 73 * hash + (this.world != null ? this.world.hashCode() : 0); + hash = 73 * hash + (this.blockIdentifier != null ? this.blockIdentifier.hashCode() : 0); + return hash; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ChunkCoordComparator.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ChunkCoordComparator.java new file mode 100644 index 0000000..bb87e90 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ChunkCoordComparator.java @@ -0,0 +1,60 @@ +package net.minecraftforge.common.util; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.ChunkCoordIntPair; + +// Sorter to load nearby chunks first +public class ChunkCoordComparator implements java.util.Comparator +{ + private int x; + private int z; + + public ChunkCoordComparator(EntityPlayerMP entityplayer) + { + x = (int) entityplayer.posX >> 4; + z = (int) entityplayer.posZ >> 4; + } + + public int compare(ChunkCoordIntPair a, ChunkCoordIntPair b) + { + if (a.equals(b)) + { + return 0; + } + + // Subtract current position to set center point + int ax = a.chunkXPos - this.x; + int az = a.chunkZPos - this.z; + int bx = b.chunkXPos - this.x; + int bz = b.chunkZPos - this.z; + int result = ((ax - bx) * (ax + bx)) + ((az - bz) * (az + bz)); + + if (result != 0) + { + return result; + } + + if (ax < 0) + { + if (bx < 0) + { + return bz - az; + } + else + { + return -1; + } + } + else + { + if (bx < 0) + { + return 1; + } + else + { + return az - bz; + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/Constants.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/Constants.java new file mode 100644 index 0000000..1eed8ae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/Constants.java @@ -0,0 +1,32 @@ +package net.minecraftforge.common.util; + +/** + * A class containing constants for magic numbers used in the minecraft codebase. + * Everything here should be checked each update, and have a comment relating to where to check it. + */ +public class Constants +{ + /** + * NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId, + * table used in NBTBase.func_150283_g + * + * Main use is checking tag type in NBTTagCompound.hasKey(String, int) + * + */ + public static class NBT + { + public static final int TAG_END = 0; + public static final int TAG_BYTE = 1; + public static final int TAG_SHORT = 2; + public static final int TAG_INT = 3; + public static final int TAG_LONG = 4; + public static final int TAG_FLOAT = 5; + public static final int TAG_DOUBLE = 6; + public static final int TAG_BYTE_ARRAY = 7; + public static final int TAG_STRING = 8; + public static final int TAG_LIST = 9; + public static final int TAG_COMPOUND = 10; + public static final int TAG_INT_ARRAY = 11; + public static final int TAG_ANY_NUMERIC = 99; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/EnumHelper.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/EnumHelper.java new file mode 100644 index 0000000..a261b5b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/EnumHelper.java @@ -0,0 +1,298 @@ +package net.minecraftforge.common.util; + +import java.lang.reflect.*; +import java.util.*; + +import cpw.mods.fml.common.FMLLog; +import net.minecraft.block.BlockPressurePlate.Sensitivity; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnumEnchantmentType; +import net.minecraft.entity.Entity.EnumEntitySize; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityPainting.EnumArt; +import net.minecraft.entity.player.EntityPlayer.EnumStatus; +import net.minecraft.item.EnumAction; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door; +import net.minecraftforge.classloading.FMLForgePlugin; + +import net.minecraft.block.BlockPressurePlate.Sensitivity; +import net.minecraft.entity.Entity.EnumEntitySize; +import net.minecraft.entity.item.EntityPainting.EnumArt; +import net.minecraft.entity.player.EntityPlayer.EnumStatus; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.gen.structure.StructureStrongholdPieces.Stronghold.Door; +public class EnumHelper +{ + private static Object reflectionFactory = null; + private static Method newConstructorAccessor = null; + private static Method newInstance = null; + private static Method newFieldAccessor = null; + private static Method fieldAccessorSet = null; + private static boolean isSetup = false; + + //Some enums are decompiled with extra arguments, so lets check for that + @SuppressWarnings("rawtypes") + private static Class[][] commonTypes = + { + {EnumAction.class}, + {ArmorMaterial.class, int.class, int[].class, int.class}, + {EnumArt.class, String.class, int.class, int.class, int.class, int.class}, + {EnumCreatureAttribute.class}, + {EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}, + {Door.class}, + {EnumEnchantmentType.class}, + {EnumEntitySize.class}, + {Sensitivity.class}, + {MovingObjectType.class}, + {EnumSkyBlock.class, int.class}, + {EnumStatus.class}, + {ToolMaterial.class, int.class, int.class, float.class, float.class, int.class}, + {EnumRarity.class, EnumChatFormatting.class, String.class} + }; + + public static EnumAction addAction(String name) + { + return addEnum(EnumAction.class, name); + } + public static ArmorMaterial addArmorMaterial(String name, int durability, int[] reductionAmounts, int enchantability) + { + return addEnum(ArmorMaterial.class, name, durability, reductionAmounts, enchantability); + } + public static EnumArt addArt(String name, String tile, int sizeX, int sizeY, int offsetX, int offsetY) + { + return addEnum(EnumArt.class, name, tile, sizeX, sizeY, offsetX, offsetY); + } + public static EnumCreatureAttribute addCreatureAttribute(String name) + { + return addEnum(EnumCreatureAttribute.class, name); + } + @SuppressWarnings("rawtypes") + public static EnumCreatureType addCreatureType(String name, Class typeClass, int maxNumber, Material material, boolean peaceful, boolean animal) + { + return addEnum(EnumCreatureType.class, name, typeClass, maxNumber, material, peaceful, animal); + } + public static Door addDoor(String name) + { + return addEnum(Door.class, name); + } + public static EnumEnchantmentType addEnchantmentType(String name) + { + return addEnum(EnumEnchantmentType.class, name); + } + public static EnumEntitySize addEntitySize(String name) + { + return addEnum(EnumEntitySize.class, name); + } + public static Sensitivity addSensitivity(String name) + { + return addEnum(Sensitivity.class, name); + } + public static MovingObjectType addMovingObjectType(String name) + { + return addEnum(MovingObjectType.class, name); + } + public static EnumSkyBlock addSkyBlock(String name, int lightValue) + { + return addEnum(EnumSkyBlock.class, name, lightValue); + } + public static EnumStatus addStatus(String name) + { + return addEnum(EnumStatus.class, name); + } + public static ToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability) + { + return addEnum(ToolMaterial.class, name, harvestLevel, maxUses, efficiency, damage, enchantability); + } + public static EnumRarity addRarity(String name, EnumChatFormatting color, String displayName) + { + return addEnum(EnumRarity.class, name, color, displayName); + } + + private static void setup() + { + if (isSetup) + { + return; + } + + try + { + Method getReflectionFactory = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("getReflectionFactory"); + reflectionFactory = getReflectionFactory.invoke(null); + newConstructorAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newConstructorAccessor", Constructor.class); + newInstance = Class.forName("sun.reflect.ConstructorAccessor").getDeclaredMethod("newInstance", Object[].class); + newFieldAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newFieldAccessor", Field.class, boolean.class); + fieldAccessorSet = Class.forName("sun.reflect.FieldAccessor").getDeclaredMethod("set", Object.class, Object.class); + } + catch (Exception e) + { + e.printStackTrace(); + } + + isSetup = true; + } + + /* + * Everything below this is found at the site below, and updated to be able to compile in Eclipse/Java 1.6+ + * Also modified for use in decompiled code. + * Found at: http://niceideas.ch/roller2/badtrash/entry/java_create_enum_instances_dynamically + */ + private static Object getConstructorAccessor(Class enumClass, Class[] additionalParameterTypes) throws Exception + { + Class[] parameterTypes = new Class[additionalParameterTypes.length + 2]; + parameterTypes[0] = String.class; + parameterTypes[1] = int.class; + System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length); + return newConstructorAccessor.invoke(reflectionFactory, enumClass.getDeclaredConstructor(parameterTypes)); + } + + private static < T extends Enum> T makeEnum(Class enumClass, String value, int ordinal, Class[] additionalTypes, Object[] additionalValues) throws Exception + { + Object[] parms = new Object[additionalValues.length + 2]; + parms[0] = value; + parms[1] = Integer.valueOf(ordinal); + System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length); + return enumClass.cast(newInstance.invoke(getConstructorAccessor(enumClass, additionalTypes), new Object[] {parms})); + } + + public static void setFailsafeFieldValue(Field field, Object target, Object value) throws Exception + { + field.setAccessible(true); + Field modifiersField = Field.class.getDeclaredField("modifiers"); + modifiersField.setAccessible(true); + modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); + Object fieldAccessor = newFieldAccessor.invoke(reflectionFactory, field, false); + fieldAccessorSet.invoke(fieldAccessor, target, value); + } + + private static void blankField(Class enumClass, String fieldName) throws Exception + { + for (Field field : Class.class.getDeclaredFields()) + { + if (field.getName().contains(fieldName)) + { + field.setAccessible(true); + setFailsafeFieldValue(field, enumClass, null); + break; + } + } + } + + private static void cleanEnumCache(Class enumClass) throws Exception + { + blankField(enumClass, "enumConstantDirectory"); + blankField(enumClass, "enumConstants"); + } + + public static > T addEnum(Class enumType, String enumName, Object... paramValues) + { + setup(); + return addEnum(commonTypes, enumType, enumName, paramValues); + } + + @SuppressWarnings("rawtypes") + public static > T addEnum(Class[][] map, Class enumType, String enumName, Object... paramValues) + { + for (Class[] lookup : map) + { + if (lookup[0] == enumType) + { + Class[] paramTypes = new Class[lookup.length - 1]; + if (paramTypes.length > 0) + { + System.arraycopy(lookup, 1, paramTypes, 0, paramTypes.length); + } + return addEnum(enumType, enumName, paramTypes, paramValues); + } + } + return null; + } + + @SuppressWarnings("unchecked") + public static > T addEnum(Class enumType, String enumName, Class[] paramTypes, Object[] paramValues) + { + if (!isSetup) + { + setup(); + } + + Field valuesField = null; + Field[] fields = enumType.getDeclaredFields(); + + for (Field field : fields) + { + String name = field.getName(); + if (name.equals("$VALUES") || name.equals("ENUM$VALUES")) //Added 'ENUM$VALUES' because Eclipse's internal compiler doesn't follow standards + { + valuesField = field; + break; + } + } + + int flags = (FMLForgePlugin.RUNTIME_DEOBF ? Modifier.PUBLIC : Modifier.PRIVATE) | Modifier.STATIC | Modifier.FINAL | 0x1000 /*SYNTHETIC*/; + if (valuesField == null) + { + String valueType = String.format("[L%s;", enumType.getName().replace('.', '/')); + + for (Field field : fields) + { + if ((field.getModifiers() & flags) == flags && + field.getType().getName().replace('.', '/').equals(valueType)) //Apparently some JVMs return .'s and some don't.. + { + valuesField = field; + break; + } + } + } + + if (valuesField == null) + { + FMLLog.severe("Could not find $VALUES field for enum: %s", enumType.getName()); + FMLLog.severe("Runtime Deobf: %s", FMLForgePlugin.RUNTIME_DEOBF); + FMLLog.severe("Flags: %s", String.format("%16s", Integer.toBinaryString(flags)).replace(' ', '0')); + FMLLog.severe("Fields:"); + for (Field field : fields) + { + String mods = String.format("%16s", Integer.toBinaryString(field.getModifiers())).replace(' ', '0'); + FMLLog.severe(" %s %s: %s", mods, field.getName(), field.getType().getName()); + } + return null; + } + + valuesField.setAccessible(true); + + try + { + T[] previousValues = (T[])valuesField.get(enumType); + List values = new ArrayList(Arrays.asList(previousValues)); + T newValue = (T)makeEnum(enumType, enumName, values.size(), paramTypes, paramValues); + values.add(newValue); + setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0))); + cleanEnumCache(enumType); + + return newValue; + } + catch (Exception e) + { + e.printStackTrace(); + throw new RuntimeException(e.getMessage(), e); + } + } + + static + { + if (!isSetup) + { + setup(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayer.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayer.java new file mode 100644 index 0000000..de67b0b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayer.java @@ -0,0 +1,40 @@ +package net.minecraftforge.common.util; + +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.client.C15PacketClientSettings; +import net.minecraft.server.management.ItemInWorldManager; +import net.minecraft.stats.StatBase; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +//Preliminary, simple Fake Player class +public class FakePlayer extends EntityPlayerMP +{ + public FakePlayer(WorldServer world, GameProfile name) + { + super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, name, new ItemInWorldManager(world)); + } + + @Override public boolean canCommandSenderUseCommand(int i, String s){ return false; } + @Override public ChunkCoordinates getPlayerCoordinates() + { + return new ChunkCoordinates(0,0,0); + } + + @Override public void addChatComponentMessage(IChatComponent chatmessagecomponent){} + @Override public void addStat(StatBase par1StatBase, int par2){} + @Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){} + @Override public boolean isEntityInvulnerable(){ return true; } + @Override public boolean canAttackPlayer(EntityPlayer player){ return false; } + @Override public void onDeath(DamageSource source){ return; } + @Override public void onUpdate(){ return; } + @Override public void travelToDimension(int dim){ return; } + @Override public void func_147100_a(C15PacketClientSettings pkt){ return; } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayerFactory.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayerFactory.java new file mode 100644 index 0000000..6962456 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/FakePlayerFactory.java @@ -0,0 +1,59 @@ +package net.minecraftforge.common.util; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.UUID; + +import com.google.common.collect.Maps; +import com.mojang.authlib.GameProfile; + +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.DimensionManager; + +//To be expanded for generic Mod fake players? +public class FakePlayerFactory +{ + private static GameProfile MINECRAFT = new GameProfile(UUID.fromString("41C82C87-7AfB-4024-BA57-13D2C99CAE77"), "[Minecraft]"); + // Map of all active fake player usernames to their entities + private static Map fakePlayers = Maps.newHashMap(); + private static FakePlayer MINECRAFT_PLAYER = null; + + public static FakePlayer getMinecraft(WorldServer world) + { + if (MINECRAFT_PLAYER == null) + { + MINECRAFT_PLAYER = FakePlayerFactory.get(world, MINECRAFT); + } + return MINECRAFT_PLAYER; + } + + /** + * Get a fake player with a given username, + * Mods should either hold weak references to the return value, or listen for a + * WorldEvent.Unload and kill all references to prevent worlds staying in memory. + */ + public static FakePlayer get(WorldServer world, GameProfile username) + { + if (!fakePlayers.containsKey(username)) + { + FakePlayer fakePlayer = new FakePlayer(world, username); + fakePlayers.put(username, fakePlayer); + } + + return fakePlayers.get(username); + } + + public static void unloadWorld(WorldServer world) + { + Iterator> itr = fakePlayers.entrySet().iterator(); + while (itr.hasNext()) + { + Entry entry = itr.next(); + if (entry.getValue().worldObj == world) + { + itr.remove(); + } + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ForgeDirection.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ForgeDirection.java new file mode 100644 index 0000000..c110476 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/ForgeDirection.java @@ -0,0 +1,71 @@ +package net.minecraftforge.common.util; + +public enum ForgeDirection +{ + /** -Y */ + DOWN(0, -1, 0), + + /** +Y */ + UP(0, 1, 0), + + /** -Z */ + NORTH(0, 0, -1), + + /** +Z */ + SOUTH(0, 0, 1), + + /** -X */ + WEST(-1, 0, 0), + + /** +X */ + EAST(1, 0, 0), + + /** + * Used only by getOrientation, for invalid inputs + */ + UNKNOWN(0, 0, 0); + + public final int offsetX; + public final int offsetY; + public final int offsetZ; + public final int flag; + public static final ForgeDirection[] VALID_DIRECTIONS = {DOWN, UP, NORTH, SOUTH, WEST, EAST}; + public static final int[] OPPOSITES = {1, 0, 3, 2, 5, 4, 6}; + // Left hand rule rotation matrix for all possible axes of rotation + public static final int[][] ROTATION_MATRIX = { + {0, 1, 4, 5, 3, 2, 6}, + {0, 1, 5, 4, 2, 3, 6}, + {5, 4, 2, 3, 0, 1, 6}, + {4, 5, 2, 3, 1, 0, 6}, + {2, 3, 1, 0, 4, 5, 6}, + {3, 2, 0, 1, 4, 5, 6}, + {0, 1, 2, 3, 4, 5, 6}, + }; + + private ForgeDirection(int x, int y, int z) + { + offsetX = x; + offsetY = y; + offsetZ = z; + flag = 1 << ordinal(); + } + + public static ForgeDirection getOrientation(int id) + { + if (id >= 0 && id < VALID_DIRECTIONS.length) + { + return VALID_DIRECTIONS[id]; + } + return UNKNOWN; + } + + public ForgeDirection getOpposite() + { + return getOrientation(OPPOSITES[ordinal()]); + } + + public ForgeDirection getRotation(ForgeDirection axis) + { + return getOrientation(ROTATION_MATRIX[axis.ordinal()][ordinal()]); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/common/util/RotationHelper.java b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/RotationHelper.java new file mode 100644 index 0000000..b6ae8e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/common/util/RotationHelper.java @@ -0,0 +1,439 @@ +package net.minecraftforge.common.util; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.block.BlockBed; +import net.minecraft.block.BlockButton; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockCocoa; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockEndPortalFrame; +import net.minecraft.block.BlockEnderChest; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.BlockHopper; +import net.minecraft.block.BlockHugeMushroom; +import net.minecraft.block.BlockLadder; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockLog; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; +import net.minecraft.block.BlockPumpkin; +import net.minecraft.block.BlockRail; +import net.minecraft.block.BlockRailDetector; +import net.minecraft.block.BlockRailPowered; +import net.minecraft.block.BlockRedstoneComparator; +import net.minecraft.block.BlockRedstoneRepeater; +import net.minecraft.block.BlockSkull; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.BlockTrapDoor; +import net.minecraft.block.BlockTripWireHook; +import net.minecraft.block.BlockVine; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +import java.util.HashMap; +import java.util.Map; + +import static net.minecraftforge.common.util.ForgeDirection.*; + +/** + * This class is a helper function for vanilla blocks, and should not be called by Modders. + * Refer to block.rotateBlock and block.getValidRotations instead. + * + */ +public class RotationHelper { + /** + * Some blocks have the same rotation. + * The first of these blocks (sorted by itemID) should be listed as a type. + * Some of the types aren't actual blocks (helper types). + */ + private static enum BlockType { + LOG, + DISPENSER, + BED, + RAIL, + RAIL_POWERED, + RAIL_ASCENDING, + RAIL_CORNER, + TORCH, + STAIR, + CHEST, + SIGNPOST, + DOOR, + LEVER, + BUTTON, + REDSTONE_REPEATER, + TRAPDOOR, + MUSHROOM_CAP, + MUSHROOM_CAP_CORNER, + MUSHROOM_CAP_SIDE, + VINE, + SKULL, + ANVIL + } + + private static final ForgeDirection[] UP_DOWN_AXES = new ForgeDirection[] { UP, DOWN }; + private static final Map> MAPPINGS = new HashMap>(); + + public static ForgeDirection[] getValidVanillaBlockRotations(Block block) + { + return (block instanceof BlockBed || + block instanceof BlockPumpkin || + block instanceof BlockFenceGate || + block instanceof BlockEndPortalFrame || + block instanceof BlockTripWireHook || + block instanceof BlockCocoa || + block instanceof BlockRailPowered || + block instanceof BlockRailDetector || + block instanceof BlockStairs || + block instanceof BlockChest || + block instanceof BlockEnderChest || + block instanceof BlockFurnace || + block instanceof BlockLadder || + block == Blocks.wall_sign || + block == Blocks.standing_sign || + block instanceof BlockDoor || + block instanceof BlockRail || + block instanceof BlockButton || + block instanceof BlockRedstoneRepeater || + block instanceof BlockRedstoneComparator || + block instanceof BlockTrapDoor || + block instanceof BlockHugeMushroom || + block instanceof BlockVine || + block instanceof BlockSkull || + block instanceof BlockAnvil) ? UP_DOWN_AXES : VALID_DIRECTIONS; + } + + public static boolean rotateVanillaBlock(Block block, World worldObj, int x, int y, int z, ForgeDirection axis) + { + if (worldObj.isRemote) + { + return false; + } + + if (axis == UP || axis == DOWN) + { + if (block instanceof BlockBed || block instanceof BlockPumpkin || block instanceof BlockFenceGate || block instanceof BlockEndPortalFrame || block instanceof BlockTripWireHook || block instanceof BlockCocoa) + { + return rotateBlock(worldObj, x, y, z, axis, 0x3, BlockType.BED); + } + if (block instanceof BlockRail) + { + return rotateBlock(worldObj, x, y, z, axis, 0xF, BlockType.RAIL); + } + if (block instanceof BlockRailPowered || block instanceof BlockRailDetector) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.RAIL_POWERED); + } + if (block instanceof BlockStairs) + { + return rotateBlock(worldObj, x, y, z, axis, 0x3, BlockType.STAIR); + } + if (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockFurnace || block instanceof BlockLadder || block == Blocks.wall_sign) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.CHEST); + } + if (block == Blocks.standing_sign) + { + return rotateBlock(worldObj, x, y, z, axis, 0xF, BlockType.SIGNPOST); + } + if (block instanceof BlockDoor) + { + return rotateBlock(worldObj, x, y, z, axis, 0x3, BlockType.DOOR); + } + if (block instanceof BlockButton) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.BUTTON); + } + if (block instanceof BlockRedstoneRepeater || block instanceof BlockRedstoneComparator) + { + return rotateBlock(worldObj, x, y, z, axis, 0x3, BlockType.REDSTONE_REPEATER); + } + if (block instanceof BlockTrapDoor) + { + return rotateBlock(worldObj, x, y, z, axis, 0x3, BlockType.TRAPDOOR); + } + if (block instanceof BlockHugeMushroom) + { + return rotateBlock(worldObj, x, y, z, axis, 0xF, BlockType.MUSHROOM_CAP); + } + if (block instanceof BlockVine) + { + return rotateBlock(worldObj, x, y, z, axis, 0xF, BlockType.VINE); + } + if (block instanceof BlockSkull) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.SKULL); + } + if (block instanceof BlockAnvil) + { + return rotateBlock(worldObj, x, y, z, axis, 0x1, BlockType.ANVIL); + } + } + + if (block instanceof BlockLog) + { + return rotateBlock(worldObj, x, y, z, axis, 0xC, BlockType.LOG); + } + if (block instanceof BlockDispenser || block instanceof BlockPistonBase || block instanceof BlockPistonExtension || block instanceof BlockHopper) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.DISPENSER); + } + if (block instanceof BlockTorch) + { + return rotateBlock(worldObj, x, y, z, axis, 0xF, BlockType.TORCH); + } + if (block instanceof BlockLever) + { + return rotateBlock(worldObj, x, y, z, axis, 0x7, BlockType.LEVER); + } + + return false; + } + + private static boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis, int mask, BlockType blockType) + { + int rotMeta = worldObj.getBlockMetadata(x, y, z); + if (blockType == BlockType.DOOR && (rotMeta & 0x8) == 0x8) + { + return false; + } + int masked = rotMeta & ~mask; + int meta = rotateMetadata(axis, blockType, rotMeta & mask); + if (meta == -1) + { + return false; + } + worldObj.setBlockMetadataWithNotify(x, y, z, meta & mask | masked, 3); + return true; + } + + private static int rotateMetadata(ForgeDirection axis, BlockType blockType, int meta) + { + if (blockType == BlockType.RAIL || blockType == BlockType.RAIL_POWERED) + { + if (meta == 0x0 || meta == 0x1) + { + return ~meta & 0x1; + } + if (meta >= 0x2 && meta <= 0x5) + { + blockType = BlockType.RAIL_ASCENDING; + } + if (meta >= 0x6 && meta <= 0x9 && blockType == BlockType.RAIL) + { + blockType = BlockType.RAIL_CORNER; + } + } + if (blockType == BlockType.SIGNPOST) + { + return (axis == UP) ? (meta + 0x4) % 0x10 : (meta + 0xC) % 0x10; + } + if (blockType == BlockType.LEVER && (axis == UP || axis == DOWN)) + { + switch (meta) + { + case 0x5: + return 0x6; + case 0x6: + return 0x5; + case 0x7: + return 0x0; + case 0x0: + return 0x7; + } + } + if (blockType == BlockType.MUSHROOM_CAP) + { + if (meta % 0x2 == 0) + { + blockType = BlockType.MUSHROOM_CAP_SIDE; + } + else + { + blockType = BlockType.MUSHROOM_CAP_CORNER; + } + } + if (blockType == BlockType.VINE) + { + return ((meta << 1) | ((meta & 0x8) >> 3)); + } + + ForgeDirection orientation = metadataToDirection(blockType, meta); + ForgeDirection rotated = orientation.getRotation(axis); + return directionToMetadata(blockType, rotated); + } + + private static ForgeDirection metadataToDirection(BlockType blockType, int meta) + { + if (blockType == BlockType.LEVER) + { + if (meta == 0x6) + { + meta = 0x5; + } + else if (meta == 0x0) + { + meta = 0x7; + } + } + + if (MAPPINGS.containsKey(blockType)) + { + BiMap biMap = MAPPINGS.get(blockType); + if (biMap.containsKey(meta)) + { + return biMap.get(meta); + } + } + + if (blockType == BlockType.TORCH) + { + return ForgeDirection.getOrientation(6 - meta); + } + if (blockType == BlockType.STAIR) + { + return ForgeDirection.getOrientation(5 - meta); + } + if (blockType == BlockType.CHEST || blockType == BlockType.DISPENSER || blockType == BlockType.SKULL) + { + return ForgeDirection.getOrientation(meta); + } + if (blockType == BlockType.BUTTON) + { + return ForgeDirection.getOrientation(6 - meta); + } + if (blockType == BlockType.TRAPDOOR) + { + return ForgeDirection.getOrientation(meta + 2).getOpposite(); + } + + return ForgeDirection.UNKNOWN; + } + + private static int directionToMetadata(BlockType blockType, ForgeDirection direction) + { + if ((blockType == BlockType.LOG || blockType == BlockType.ANVIL) && (direction.offsetX + direction.offsetY + direction.offsetZ) < 0) + { + direction = direction.getOpposite(); + } + + if (MAPPINGS.containsKey(blockType)) + { + BiMap biMap = MAPPINGS.get(blockType).inverse(); + if (biMap.containsKey(direction)) + { + return biMap.get(direction); + } + } + + if (blockType == BlockType.TORCH) + { + if (direction.ordinal() >= 1) + { + return 6 - direction.ordinal(); + } + } + if (blockType == BlockType.STAIR) + { + return 5 - direction.ordinal(); + } + if (blockType == BlockType.CHEST || blockType == BlockType.DISPENSER || blockType == BlockType.SKULL) + { + return direction.ordinal(); + } + if (blockType == BlockType.BUTTON) + { + if (direction.ordinal() >= 2) + { + return 6 - direction.ordinal(); + } + } + if (blockType == BlockType.TRAPDOOR) + { + return direction.getOpposite().ordinal() - 2; + } + + return -1; + } + + static + { + BiMap biMap; + + biMap = HashBiMap.create(3); + biMap.put(0x0, UP); + biMap.put(0x4, EAST); + biMap.put(0x8, SOUTH); + MAPPINGS.put(BlockType.LOG, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x0, SOUTH); + biMap.put(0x1, WEST); + biMap.put(0x2, NORTH); + biMap.put(0x3, EAST); + MAPPINGS.put(BlockType.BED, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x2, EAST); + biMap.put(0x3, WEST); + biMap.put(0x4, NORTH); + biMap.put(0x5, SOUTH); + MAPPINGS.put(BlockType.RAIL_ASCENDING, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x6, WEST); + biMap.put(0x7, NORTH); + biMap.put(0x8, EAST); + biMap.put(0x9, SOUTH); + MAPPINGS.put(BlockType.RAIL_CORNER, biMap); + + biMap = HashBiMap.create(6); + biMap.put(0x1, EAST); + biMap.put(0x2, WEST); + biMap.put(0x3, SOUTH); + biMap.put(0x4, NORTH); + biMap.put(0x5, UP); + biMap.put(0x7, DOWN); + MAPPINGS.put(BlockType.LEVER, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x0, WEST); + biMap.put(0x1, NORTH); + biMap.put(0x2, EAST); + biMap.put(0x3, SOUTH); + MAPPINGS.put(BlockType.DOOR, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x0, NORTH); + biMap.put(0x1, EAST); + biMap.put(0x2, SOUTH); + biMap.put(0x3, WEST); + MAPPINGS.put(BlockType.REDSTONE_REPEATER, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x1, EAST); + biMap.put(0x3, SOUTH); + biMap.put(0x7, NORTH); + biMap.put(0x9, WEST); + MAPPINGS.put(BlockType.MUSHROOM_CAP_CORNER, biMap); + + biMap = HashBiMap.create(4); + biMap.put(0x2, NORTH); + biMap.put(0x4, WEST); + biMap.put(0x6, EAST); + biMap.put(0x8, SOUTH); + MAPPINGS.put(BlockType.MUSHROOM_CAP_SIDE, biMap); + + biMap = HashBiMap.create(2); + biMap.put(0x0, SOUTH); + biMap.put(0x1, EAST); + MAPPINGS.put(BlockType.ANVIL, biMap); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/AnvilUpdateEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/AnvilUpdateEvent.java new file mode 100644 index 0000000..bc52335 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/AnvilUpdateEvent.java @@ -0,0 +1,32 @@ +package net.minecraftforge.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.item.ItemStack; + +/** + * + * AnvilUpdateEvent is fired when a player places items in both the left and right slots of a anvil. + * If the event is canceled, vanilla behavior will not run, and the output will be set to null. + * If the event is not canceled, but the output is not null, it will set the output and not run vanilla behavior. + * if the output is null, and the event is not canceled, vanilla behavior will execute. + */ +@Cancelable +public class AnvilUpdateEvent extends Event +{ + public final ItemStack left; // The left side of the input + public final ItemStack right; // The right side of the input + public final String name; // The name to set the item, if the user specified one. + public ItemStack output; // Set this to set the output stack + public int cost; // The base cost, set this to change it if output != null + public int materialCost; // The number of items from the right slot to be consumed during the repair. Leave as 0 to consume the entire stack. + + public AnvilUpdateEvent(ItemStack left, ItemStack right, String name, int cost) + { + this.left = left; + this.right = right; + this.name = name; + this.cost = cost; + this.materialCost = 0; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/CommandEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/CommandEvent.java new file mode 100644 index 0000000..4d89dd7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/CommandEvent.java @@ -0,0 +1,40 @@ +package net.minecraftforge.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; + +/** + * CommandEvent is fired whenever a command is scheduled to be executed. + * This event is fired during the invocation of CommandHandler#executeCommand(ICommandSender, String) + * and ClientCommandHandler#executeCommand(ICommandSender, String).
    + *
    + * {@link #command} contains the instance of ICommand which is representative of the currently executing command.
    + * {@link #sender} contains the instance of ICommandSender for the given command sender.
    + * {@link #parameters} contains the arguments passed for the command execution.
    + * {@link #exception} begins null, but can be populated with an exception to be thrown within the command.
    + *
    + * This event is {@link Cancelable}.
    + * If the event is canceled, the execution of the command does not occur.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +@Cancelable +public class CommandEvent extends Event +{ + + public final ICommand command; + public final ICommandSender sender; + public String[] parameters; + public Throwable exception; + + public CommandEvent(ICommand command, ICommandSender sender, String[] parameters) + { + this.command = command; + this.sender = sender; + this.parameters = parameters; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/ForgeEventFactory.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/ForgeEventFactory.java new file mode 100644 index 0000000..feefd98 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/ForgeEventFactory.java @@ -0,0 +1,293 @@ +package net.minecraftforge.event; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.common.eventhandler.Event.Result; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityBrewingStand; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.storage.IPlayerFileData; +import net.minecraft.world.storage.SaveHandler; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.BlockSnapshot; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.brewing.PotionBrewEvent; +import net.minecraftforge.event.brewing.PotionBrewedEvent; +import net.minecraftforge.event.entity.EntityStruckByLightningEvent; +import net.minecraftforge.event.entity.living.LivingHealEvent; +import net.minecraftforge.event.entity.living.LivingPackSizeEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent; +import net.minecraftforge.event.entity.living.LivingSpawnEvent.AllowDespawn; +import net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import net.minecraftforge.event.entity.player.PlayerUseItemEvent; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.event.world.BlockEvent.MultiPlaceEvent; +import net.minecraftforge.event.world.BlockEvent.PlaceEvent; +import net.minecraftforge.event.world.ExplosionEvent; +import net.minecraftforge.event.world.WorldEvent; + +public class ForgeEventFactory +{ + + public static MultiPlaceEvent onPlayerMultiBlockPlace(EntityPlayer player, List blockSnapshots, ForgeDirection direction) + { + Block placedAgainst = blockSnapshots.get(0).world.getBlock(blockSnapshots.get(0).x + direction.getOpposite().offsetX, blockSnapshots.get(0).y + direction.getOpposite().offsetY, blockSnapshots.get(0).z + direction.getOpposite().offsetZ); + + MultiPlaceEvent event = new MultiPlaceEvent(blockSnapshots, placedAgainst, player); + MinecraftForge.EVENT_BUS.post(event); + return event; + } + + public static PlaceEvent onPlayerBlockPlace(EntityPlayer player, BlockSnapshot blockSnapshot, ForgeDirection direction) + { + Block placedAgainst = blockSnapshot.world.getBlock(blockSnapshot.x + direction.getOpposite().offsetX, blockSnapshot.y + direction.getOpposite().offsetY, blockSnapshot.z + direction.getOpposite().offsetZ); + + PlaceEvent event = new PlaceEvent(blockSnapshot, placedAgainst, player); + MinecraftForge.EVENT_BUS.post(event); + return event; + } + + public static boolean doPlayerHarvestCheck(EntityPlayer player, Block block, boolean success) + { + PlayerEvent.HarvestCheck event = new PlayerEvent.HarvestCheck(player, block, success); + MinecraftForge.EVENT_BUS.post(event); + return event.success; + } + + @Deprecated // Location version below + public static float getBreakSpeed(EntityPlayer player, Block block, int metadata, float original) + { + return getBreakSpeed(player, block, metadata, original, 0, -1, 0); + } + + public static float getBreakSpeed(EntityPlayer player, Block block, int metadata, float original, int x, int y, int z) + { + PlayerEvent.BreakSpeed event = new PlayerEvent.BreakSpeed(player, block, metadata, original, x, y, z); + return (MinecraftForge.EVENT_BUS.post(event) ? -1 : event.newSpeed); + } + + @Deprecated + public static PlayerInteractEvent onPlayerInteract(EntityPlayer player, Action action, int x, int y, int z, int face) + { + return onPlayerInteract(player, action, x, y, z, face, null); + } + public static PlayerInteractEvent onPlayerInteract(EntityPlayer player, Action action, int x, int y, int z, int face, World world) + { + PlayerInteractEvent event = new PlayerInteractEvent(player, action, x, y, z, face, world); + MinecraftForge.EVENT_BUS.post(event); + return event; + } + + public static void onPlayerDestroyItem(EntityPlayer player, ItemStack stack) + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, stack)); + } + + public static Result canEntitySpawn(EntityLiving entity, World world, float x, float y, float z) + { + LivingSpawnEvent.CheckSpawn event = new LivingSpawnEvent.CheckSpawn(entity, world, x, y, z); + MinecraftForge.EVENT_BUS.post(event); + return event.getResult(); + } + + public static boolean doSpecialSpawn(EntityLiving entity, World world, float x, float y, float z) + { + return MinecraftForge.EVENT_BUS.post(new LivingSpawnEvent.SpecialSpawn(entity, world, x, y, z)); + } + + public static Result canEntityDespawn(EntityLiving entity) + { + AllowDespawn event = new AllowDespawn(entity); + MinecraftForge.EVENT_BUS.post(event); + return event.getResult(); + } + + public static List getPotentialSpawns(WorldServer world, EnumCreatureType type, int x, int y, int z, List oldList) + { + WorldEvent.PotentialSpawns event = new WorldEvent.PotentialSpawns(world, type, x, y, z, oldList); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return null; + } + return event.list; + } + + public static int getFuelBurnTime(ItemStack fuel) + { + FuelBurnTimeEvent event = new FuelBurnTimeEvent(fuel); + MinecraftForge.EVENT_BUS.post(event); + return event.getResult() == Result.DEFAULT ? -1 : event.burnTime; + } + + public static int getMaxSpawnPackSize(EntityLiving entity) + { + LivingPackSizeEvent maxCanSpawnEvent = new LivingPackSizeEvent(entity); + MinecraftForge.EVENT_BUS.post(maxCanSpawnEvent); + return maxCanSpawnEvent.getResult() == Result.ALLOW ? maxCanSpawnEvent.maxPackSize : entity.getMaxSpawnedInChunk(); + } + + public static String getPlayerDisplayName(EntityPlayer player, String username) + { + PlayerEvent.NameFormat event = new PlayerEvent.NameFormat(player, username); + MinecraftForge.EVENT_BUS.post(event); + return event.displayname; + } + + public static float fireBlockHarvesting(ArrayList drops, World world, Block block, int x, int y, int z, int meta, int fortune, float dropChance, boolean silkTouch, EntityPlayer player) + { + BlockEvent.HarvestDropsEvent event = new BlockEvent.HarvestDropsEvent(x, y, z, world, block, meta, fortune, dropChance, drops, player, silkTouch); + MinecraftForge.EVENT_BUS.post(event); + return event.dropChance; + } + + public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, EntityPlayer entityPlayer, List toolTip, boolean showAdvancedItemTooltips) + { + ItemTooltipEvent event = new ItemTooltipEvent(itemStack, entityPlayer, toolTip, showAdvancedItemTooltips); + MinecraftForge.EVENT_BUS.post(event); + return event; + } + + public static SummonAidEvent fireZombieSummonAid(EntityZombie zombie, World world, int x, int y, int z, EntityLivingBase attacker, double summonChance) + { + SummonAidEvent summonEvent = new SummonAidEvent(zombie, world, x, y, z, attacker, summonChance); + MinecraftForge.EVENT_BUS.post(summonEvent); + return summonEvent; + } + + public static boolean onEntityStruckByLightning(Entity entity, EntityLightningBolt bolt) + { + return MinecraftForge.EVENT_BUS.post(new EntityStruckByLightningEvent(entity, bolt)); + } + + public static int onItemUseStart(EntityPlayer player, ItemStack item, int duration) + { + PlayerUseItemEvent event = new PlayerUseItemEvent.Start(player, item, duration); + return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.duration; + } + + public static int onItemUseTick(EntityPlayer player, ItemStack item, int duration) + { + PlayerUseItemEvent event = new PlayerUseItemEvent.Tick(player, item, duration); + return MinecraftForge.EVENT_BUS.post(event) ? -1 : event.duration; + } + + public static boolean onUseItemStop(EntityPlayer player, ItemStack item, int duration) + { + return MinecraftForge.EVENT_BUS.post(new PlayerUseItemEvent.Stop(player, item, duration)); + } + + public static ItemStack onItemUseFinish(EntityPlayer player, ItemStack item, int duration, ItemStack result) + { + PlayerUseItemEvent.Finish event = new PlayerUseItemEvent.Finish(player, item, duration, result); + MinecraftForge.EVENT_BUS.post(event); + return event.result; + } + + public static void onStartEntityTracking(Entity entity, EntityPlayer player) + { + MinecraftForge.EVENT_BUS.post(new PlayerEvent.StartTracking(player, entity)); + } + + public static void onStopEntityTracking(Entity entity, EntityPlayer player) + { + MinecraftForge.EVENT_BUS.post(new PlayerEvent.StopTracking(player, entity)); + } + + public static void firePlayerLoadingEvent(EntityPlayer player, File playerDirectory, String uuidString) + { + MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, playerDirectory, uuidString)); + } + + public static void firePlayerSavingEvent(EntityPlayer player, File playerDirectory, String uuidString) + { + MinecraftForge.EVENT_BUS.post(new PlayerEvent.SaveToFile(player, playerDirectory, uuidString)); + } + + public static void firePlayerLoadingEvent(EntityPlayer player, IPlayerFileData playerFileData, String uuidString) + { + SaveHandler sh = (SaveHandler) playerFileData; + File dir = ObfuscationReflectionHelper.getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_"+"75771_c"); + MinecraftForge.EVENT_BUS.post(new PlayerEvent.LoadFromFile(player, dir, uuidString)); + } + + public static boolean onExplosionStart(World world, Explosion explosion) + { + return MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Start(world, explosion)); + } + + public static void onExplosionDetonate(World world, Explosion explosion, List list, double diameter) + { + //Filter entities to only those who are effected, to prevent modders from seeing more then will be hurt. + /* Enable this if we get issues with modders looping to much. + Iterator itr = list.iterator(); + while (itr.hasNext()) + { + Entity e = itr.next(); + double dist = e.getDistance(explosion.explosionX, explosion.explosionY, explosion.explosionZ) / diameter; + if (dist > 1.0F) itr.remove(); + } + */ + MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list)); + } + + public static boolean onCreateWorldSpawn(World world, WorldSettings settings) + { + return MinecraftForge.EVENT_BUS.post(new WorldEvent.CreateSpawnPosition(world, settings)); + } + + public static float onLivingHeal(EntityLivingBase entity, float amount) + { + LivingHealEvent event = new LivingHealEvent(entity, amount); + return (MinecraftForge.EVENT_BUS.post(event) ? 0 : event.amount); + } + + public static boolean onPotionAttemptBreaw(ItemStack[] stacks) + { + ItemStack[] tmp = new ItemStack[stacks.length]; + for (int x = 0; x < tmp.length; x++) + tmp[x] = ItemStack.copyItemStack(stacks[x]); + + PotionBrewEvent.Pre event = new PotionBrewEvent.Pre(tmp); + if (MinecraftForge.EVENT_BUS.post(event)) + { + boolean changed = false; + for (int x = 0; x < stacks.length; x++) + { + changed |= ItemStack.areItemStacksEqual(tmp[x], stacks[x]); + stacks[x] = event.getItem(x); + } + if (changed) + onPotionBrewed(stacks); + return true; + } + return false; + } + + public static void onPotionBrewed(ItemStack[] brewingItemStacks) + { + MinecraftForge.EVENT_BUS.post(new PotionBrewEvent.Post(brewingItemStacks)); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/FuelBurnTimeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/FuelBurnTimeEvent.java new file mode 100644 index 0000000..8c253e0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/FuelBurnTimeEvent.java @@ -0,0 +1,32 @@ +package net.minecraftforge.event; + +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; + +/** + * FuelBurnTimeEvent is fired whenever a furnace needs the burn time of a fuel.
    + * Normally, a registered {@link cpw.mods.fml.common.IFuelHandler} is preferred, but + * this is useful in the rare situation where IFuelHandler is not effective.
    + *
    + * {@link Result#DEFAULT} allows the normal fuel handling code to proceed. + * {@link Result#ALLOW} or {@link Result#DENY} uses the value of {@link #burnTime} + * for the given {@link fuel}, bypassing both vanilla and IFuelHandler determinations. + *
    + * {@link #fuel} contains the potential fuel.
    + * {@link #burnTime} the results if set by an event handler.
    + *
    + * This event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@HasResult +@Deprecated //Remove in 1.8 +public class FuelBurnTimeEvent extends Event +{ + public final ItemStack fuel; + public int burnTime; + + public FuelBurnTimeEvent(ItemStack fuel) + { + this.fuel = fuel; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/ServerChatEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/ServerChatEvent.java new file mode 100644 index 0000000..4a78783 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/ServerChatEvent.java @@ -0,0 +1,39 @@ +package net.minecraftforge.event; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.ChatComponentTranslation; + +/** + * ServerChatEvent is fired whenever a C01PacketChatMessage is processed.
    + * This event is fired via {@link ForgeHooks#onServerChatEvent(net.minecraft.network.NetHandlerPlayServer, String, ChatComponentTranslation)}, + * which is executed by the NetHandlerPlayServer#processChatMessage(net.minecraft.network.play.client.C01PacketChatMessage)
    + *
    + * {@link #username} contains the username of the player sending the chat message.
    + * {@link #message} contains the message being sent.
    + * {@link #player} the instance of EntityPlayerMP for the player sending the chat message.
    + * {@link #component} contains the instance of ChatComponentTranslation for the sent message.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the chat message is never distributed to all clients.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class ServerChatEvent extends Event +{ + public final String message, username; + public final EntityPlayerMP player; + public ChatComponentTranslation component; + public ServerChatEvent(EntityPlayerMP player, String message, ChatComponentTranslation component) + { + super(); + this.message = message; + this.player = player; + this.username = player.getGameProfile().getName(); + this.component = component; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewEvent.java new file mode 100644 index 0000000..1c26cd9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewEvent.java @@ -0,0 +1,83 @@ +package net.minecraftforge.event.brewing; + +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; + + +public class PotionBrewEvent extends Event +{ + private ItemStack[] stacks; + + protected PotionBrewEvent(ItemStack[] stacks) + { + this.stacks = stacks; + } + + public ItemStack getItem(int index) + { + if (index >= stacks.length) return null; + return stacks[index]; + } + + public void setItem(int index, ItemStack stack) + { + if (index < stacks.length) + { + stacks[index] = stack; + } + } + + public int getLength() + { + return stacks.length; + } + + /** + * PotionBrewEvent.Pre is fired before vanilla brewing takes place. + * All changes made to the event's array will be made to the TileEntity if the event is canceled. + *
    + * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
    + *
    + * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
    + *
    + * This event is {@link Cancelable}.
    + * If the event is not canceled, the vanilla brewing will take place instead of modded brewing. + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + *
    + * If this event is canceled, and items have been modified, PotionBrewEvent.Post will automatically be fired. + **/ + @Cancelable + public static class Pre extends PotionBrewEvent + { + public Pre(ItemStack[] stacks) + { + super(stacks); + } + } + + /** + * PotionBrewEvent.Post is fired when a potion is brewed in the brewing stand. + *
    + * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
    + *
    + * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Post extends PotionBrewedEvent + { + public Post(ItemStack[] stacks) + { + super(stacks); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java new file mode 100644 index 0000000..9540f0c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/brewing/PotionBrewedEvent.java @@ -0,0 +1,34 @@ +package net.minecraftforge.event.brewing; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.item.ItemStack; + +/** + * PotionBrewedEvent is fired when a potion is brewed in the brewing stand. + *
    + * The event is fired during the TileEntityBrewingStand#brewPotions() method invocation.
    + *
    + * {@link #brewingStacks} contains the itemstack array from the TileEntityBrewer holding all items in Brewer.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +@Deprecated //Remove in 1.8.1 +public class PotionBrewedEvent extends PotionBrewEvent +{ + /** + * The brewing stacks in the brewing stand. Each index has the possibility to be null, so make sure you check. + * Changing this array to another one has no effect. + */ + @Deprecated + public ItemStack[] brewingStacks; + public PotionBrewedEvent(ItemStack[] brewingStacks) + { + super(brewingStacks); + this.brewingStacks = brewingStacks; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityEvent.java new file mode 100644 index 0000000..c261fb8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityEvent.java @@ -0,0 +1,91 @@ +package net.minecraftforge.event.entity; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.Entity; + +/** + * EntityEvent is fired when an event involving any Entity occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #entity} contains the entity that caused this event to occur.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class EntityEvent extends Event +{ + public final Entity entity; + + public EntityEvent(Entity entity) + { + this.entity = entity; + } + + /** + * EntityConstructing is fired when an Entity is being created.
    + * This event is fired within the constructor of the Entity.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class EntityConstructing extends EntityEvent + { + public EntityConstructing(Entity entity) + { + super(entity); + } + } + + /** + * CanUpdate is fired when an Entity is being created.
    + * This event is fired whenever vanilla Minecraft determines that an entity
    + * cannot update in World#updateEntityWithOptionalForce(net.minecraft.entity.Entity, boolean)
    + *
    + * {@link CanUpdate#canUpdate} contains the boolean value of whether this entity can update.
    + * If the modder decides that this Entity can be updated, they may change canUpdate to true,
    + * and the entity with then be updated.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class CanUpdate extends EntityEvent + { + public boolean canUpdate = false; + public CanUpdate(Entity entity) + { + super(entity); + } + } + + /** + * EnteringChunk is fired when an Entity enters a chunk.
    + * This event is fired whenever vanilla Minecraft determines that an entity
    + * is entering a chunk in Chunk#addEntity(net.minecraft.entity.Entity)
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult} + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class EnteringChunk extends EntityEvent + { + public int newChunkX; + public int newChunkZ; + public int oldChunkX; + public int oldChunkZ; + + public EnteringChunk(Entity entity, int newChunkX, int newChunkZ, int oldChunkX, int oldChunkZ) + { + super(entity); + this.newChunkX = newChunkX; + this.newChunkZ = newChunkZ; + this.oldChunkX = oldChunkX; + this.oldChunkZ = oldChunkZ; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java new file mode 100644 index 0000000..17a808a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityJoinWorldEvent.java @@ -0,0 +1,32 @@ +package net.minecraftforge.event.entity; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +/** + * EntityJoinWorldEvent is fired when an Entity joins the world.
    + * This event is fired whenever an Entity is added to the world in + * World#addLoadedEntities(java.util.List), World#joinEntityInSurroundings(Entity), and World#spawnEntityInWorld(Entity).
    + *
    + * {@link #world} contains the world in which the entity is to join.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity is not added to the world.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class EntityJoinWorldEvent extends EntityEvent +{ + + public final World world; + + public EntityJoinWorldEvent(Entity entity, World world) + { + super(entity); + this.world = world; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java new file mode 100644 index 0000000..65b3b26 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/EntityStruckByLightningEvent.java @@ -0,0 +1,31 @@ +package net.minecraftforge.event.entity; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.Entity; +import net.minecraft.entity.effect.EntityLightningBolt; + +/** + * EntityStruckByLightningEvent is fired when an Entity is about to be struck by lightening.
    + * This event is fired whenever an EntityLightningBolt is updated to strike an Entity in + * EntityLightningBolt#onUpdate() via {@link ForgeEventFactory#onEntityStruckByLightning(Entity, EntityLightningBolt)}.
    + *
    + * {@link #lightning} contains the instance of EntityLightningBolt attempting to strike an entity.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity is not struck by the lightening.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +@Cancelable +public class EntityStruckByLightningEvent extends EntityEvent +{ + public final EntityLightningBolt lightning; + + public EntityStruckByLightningEvent(Entity entity, EntityLightningBolt lightning) + { + super(entity); + this.lightning = lightning; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java new file mode 100644 index 0000000..0d18623 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/PlaySoundAtEntityEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.event.entity; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.Entity; + +/** + * PlaySoundAtEntityEvent is fired a sound is to be played at an Entity
    + * This event is fired whenever a sound is set to be played at an Entity such as in + * EntityPlayerSP#playSound(String, float, float), World#playSoundAtEntity(Entity, String, float, float), + * and World#playerSoundToNearExcept(EntityPlayer, String, float, float).
    + *
    + * {@link #name} contains the name of the sound to be played at the Entity.
    + * {@link #volume} contains the volume at which the sound is to be played.
    + * {@link #pitch} contains the pitch at which the sound is to be played.
    + * Changing the {@link #name} field will cause the sound of this name to be played instead of the originally intended sound.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the sound is not played.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +@Cancelable +public class PlaySoundAtEntityEvent extends EntityEvent +{ + public String name; + public final float volume; + public final float pitch; + + public PlaySoundAtEntityEvent(Entity entity, String name, float volume, float pitch) + { + super(entity); + this.name = name; + this.volume = volume; + this.pitch = pitch; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemEvent.java new file mode 100644 index 0000000..e9667a2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemEvent.java @@ -0,0 +1,29 @@ +package net.minecraftforge.event.entity.item; + +import net.minecraft.entity.item.EntityItem; +import net.minecraftforge.event.entity.EntityEvent; + +/** + * Base class for all EntityItem events. Contains a reference to the + * EntityItem of interest. For most EntityItem events, there's little to no + * additional useful data from the firing method that isn't already contained + * within the EntityItem instance. + */ +public class ItemEvent extends EntityEvent +{ + /** + * The relevant EntityItem for this event, already cast for you. + */ + public final EntityItem entityItem; + + /** + * Creates a new event for an EntityItem. + * + * @param itemEntity The EntityItem for this event + */ + public ItemEvent(EntityItem itemEntity) + { + super(itemEntity); + this.entityItem = itemEntity; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java new file mode 100644 index 0000000..affe251 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemExpireEvent.java @@ -0,0 +1,29 @@ +package net.minecraftforge.event.entity.item; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.item.EntityItem; + +/** + * Event that is fired when an EntityItem's age has reached its maximum + * lifespan. Canceling this event will prevent the EntityItem from being + * flagged as dead, thus staying it's removal from the world. If canceled + * it will add more time to the entitie's life equal to extraLife. + */ +@Cancelable +public class ItemExpireEvent extends ItemEvent +{ + + public int extraLife; + + /** + * Creates a new event for an expiring EntityItem. + * + * @param entityItem The EntityItem being deleted. + * @param extraLife The amount of time to be added to this entities lifespan if the event is canceled. + */ + public ItemExpireEvent(EntityItem entityItem, int extraLife) + { + super(entityItem); + this.extraLife = extraLife; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemTossEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemTossEvent.java new file mode 100644 index 0000000..f61cd54 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/item/ItemTossEvent.java @@ -0,0 +1,33 @@ +package net.minecraftforge.event.entity.item; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; + +/** + * Event that is fired whenever a player tosses (Q) an item or drag-n-drops a + * stack of items outside the inventory GUI screens. Canceling the event will + * stop the items from entering the world, but will not prevent them being + * removed from the inventory - and thus removed from the system. + */ +@Cancelable +public class ItemTossEvent extends ItemEvent +{ + + /** + * The player tossing the item. + */ + public final EntityPlayer player; + + /** + * Creates a new event for EntityItems tossed by a player. + * + * @param entityItem The EntityItem being tossed. + * @param player The player tossing the item. + */ + public ItemTossEvent(EntityItem entityItem, EntityPlayer player) + { + super(entityItem); + this.player = player; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java new file mode 100644 index 0000000..80664d0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/EnderTeleportEvent.java @@ -0,0 +1,28 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.EntityLivingBase; + +/** + * Event for when an Enderman teleports or an ender pearl is used. Can be used to either modify the target position, or cancel the teleport outright. + * @author Mithion + * + */ +@Cancelable +public class EnderTeleportEvent extends LivingEvent +{ + + public double targetX; + public double targetY; + public double targetZ; + public float attackDamage; + + public EnderTeleportEvent(EntityLivingBase entity, double targetX, double targetY, double targetZ, float attackDamage) + { + super(entity); + this.targetX = targetX; + this.targetY = targetY; + this.targetZ = targetZ; + this.attackDamage = attackDamage; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java new file mode 100644 index 0000000..be2df7e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingAttackEvent.java @@ -0,0 +1,36 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.util.DamageSource; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingAttackEvent is fired when a living Entity is attacked.
    + * This event is fired whenever an Entity is attacked in + * EntityLivingBase#attackEntityFrom(DamageSource, float) and + * EntityPlayer#attackEntityFrom(DamageSource, float).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingAttack(EntityLivingBase, DamageSource, float)}.
    + *
    + * {@link #source} contains the DamageSource of the attack.
    + * {@link #amount} contains the amount of damage dealt to the entity.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity does not take attack damage.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingAttackEvent extends LivingEvent +{ + public final DamageSource source; + public final float ammount; + public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float ammount) + { + super(entity); + this.source = source; + this.ammount = ammount; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java new file mode 100644 index 0000000..afc8ddf --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java @@ -0,0 +1,34 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.util.DamageSource; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingDeathEvent is fired when an Entity dies.
    + * This event is fired whenever an Entity dies in + * EntityLivingBase#onDeath(DamageSource), + * EntityPlayer#onDeath(DamageSource), and + * EntityPlayerMP#onDeath(DamageSource).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingDeath(EntityLivingBase, DamageSource)}.
    + *
    + * {@link #source} contains the DamageSource that caused the entity to die.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity does not die.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingDeathEvent extends LivingEvent +{ + public final DamageSource source; + public LivingDeathEvent(EntityLivingBase entity, DamageSource source) + { + super(entity); + this.source = source; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java new file mode 100644 index 0000000..ec21a31 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingDropsEvent.java @@ -0,0 +1,48 @@ +package net.minecraftforge.event.entity.living; + +import java.util.ArrayList; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.util.DamageSource; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingDropsEvent is fired when an Entity's death causes dropped items to appear.
    + * This event is fired whenever an Entity dies and drops items in + * EntityLivingBase#onDeath(DamageSource).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingDrops(EntityLivingBase, DamageSource, ArrayList, int, boolean, int)}.
    + *
    + * {@link #source} contains the DamageSource that caused the drop to occur.
    + * {@link #drops} contains the ArrayList of EntityItems that will be dropped.
    + * {@link #lootingLevel} contains the amount of loot that will be dropped.
    + * {@link #recentlyHit} determines whether the Entity doing the drop has recently been damaged.
    + * {@link #specialDropValue} contains the special drop value for this even.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity does not drop anything.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingDropsEvent extends LivingEvent +{ + public final DamageSource source; + public final ArrayList drops; + public final int lootingLevel; + public final boolean recentlyHit; + public final int specialDropValue; + + public LivingDropsEvent(EntityLivingBase entity, DamageSource source, ArrayList drops, int lootingLevel, boolean recentlyHit, int specialDropValue) + { + super(entity); + this.source = source; + this.drops = drops; + this.lootingLevel = lootingLevel; + this.recentlyHit = recentlyHit; + this.specialDropValue = specialDropValue; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingEvent.java new file mode 100644 index 0000000..0d41e7d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingEvent.java @@ -0,0 +1,61 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.event.entity.EntityEvent; + +/** + * LivingEvent is fired whenever an event involving Living entities occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class LivingEvent extends EntityEvent +{ + public final EntityLivingBase entityLiving; + public LivingEvent(EntityLivingBase entity) + { + super(entity); + entityLiving = entity; + } + + /** + * LivingUpdateEvent is fired when an Entity is updated.
    + * This event is fired whenever an Entity is updated in + * EntityLivingBase#onUpdate().
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingUpdate(EntityLivingBase)}.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity does not update.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + @Cancelable + public static class LivingUpdateEvent extends LivingEvent + { + public LivingUpdateEvent(EntityLivingBase e){ super(e); } + } + + /** + * LivingJumpEvent is fired when an Entity jumps.
    + * This event is fired whenever an Entity jumps in + * EntityLivingBase#jump(), EntityMagmaCube#jump(), + * and EntityHorse#jump().
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingJump(EntityLivingBase)}.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + public static class LivingJumpEvent extends LivingEvent + { + public LivingJumpEvent(EntityLivingBase e){ super(e); } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingFallEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingFallEvent.java new file mode 100644 index 0000000..d958f2d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingFallEvent.java @@ -0,0 +1,31 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingFallEvent is fired when an Entity is set to be falling.
    + * This event is fired whenever an Entity is set to fall in + * EntityLivingBase#fall(float).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingFall(EntityLivingBase, float)}.
    + *
    + * {@link #distance} contains the distance the Entity is to fall. If this event is canceled, this value is set to 0.0F. + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity does not fall.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingFallEvent extends LivingEvent +{ + public float distance; + public LivingFallEvent(EntityLivingBase entity, float distance) + { + super(entity); + this.distance = distance; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHealEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHealEvent.java new file mode 100644 index 0000000..d780177 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHealEvent.java @@ -0,0 +1,30 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingHealEvent is fired when an Entity is set to be healed.
    + * This event is fired whenever an Entity is healed in EntityLivingBase#heal(float)
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingHeal(EntityLivingBase, float)}.
    + *
    + * {@link #amount} contains the amount of healing done to the Entity that was healed.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity is not healed.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingHealEvent extends LivingEvent +{ + public float amount; + public LivingHealEvent(EntityLivingBase entity, float amount) + { + super(entity); + this.amount = amount; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java new file mode 100644 index 0000000..9755c89 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingHurtEvent.java @@ -0,0 +1,37 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.util.DamageSource; +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingHurtEvent is fired when an Entity is set to be hurt.
    + * This event is fired whenever an Entity is hurt in + * EntityLivingBase#damageEntity(DamageSource, float) and + * EntityPlayer#damageEntity(DamageSource, float).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingHurt(EntityLivingBase, DamageSource, float)}.
    + *
    + * {@link #source} contains the DamageSource that caused this Entity to be hurt.
    + * {@link #amount} contains the amount of damage dealt to the Entity that was hurt.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity is not hurt.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class LivingHurtEvent extends LivingEvent +{ + public final DamageSource source; + public float ammount; + public LivingHurtEvent(EntityLivingBase entity, DamageSource source, float ammount) + { + super(entity); + this.source = source; + this.ammount = ammount; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java new file mode 100644 index 0000000..3b81257 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingPackSizeEvent.java @@ -0,0 +1,23 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.entity.EntityLiving; + +@HasResult +public class LivingPackSizeEvent extends LivingEvent +{ + /** + * This event is fired when the spawning system determines the + * maximum amount of the selected entity that can spawn at the same + * time. + * + * If you set the result to 'ALLOW', it means that you want to return + * the value of maxPackSize as the maximum pack size for current entity. + */ + public int maxPackSize; + + public LivingPackSizeEvent(EntityLiving entity) + { + super(entity); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java new file mode 100644 index 0000000..288360e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSetAttackTargetEvent.java @@ -0,0 +1,31 @@ +package net.minecraftforge.event.entity.living; + +import net.minecraft.entity.EntityLivingBase; + +/** + * LivingSetAttackTargetEvent is fired when an Entity sets a target to attack.
    + * This event is fired whenever an Entity sets a target to attack in + * EntityLiving#setAttackTarget(EntityLivingBase) and + * EntityLivingBase#setRevengeTarget(EntityLivingBase).
    + *
    + * This event is fired via the {@link ForgeHooks#onLivingSetAttackTarget(EntityLivingBase, EntityLivingBase)}.
    + *
    + * {@link #target} contains the newly targeted Entity.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class LivingSetAttackTargetEvent extends LivingEvent +{ + + public final EntityLivingBase target; + public LivingSetAttackTargetEvent(EntityLivingBase entity, EntityLivingBase target) + { + super(entity); + this.target = target; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java new file mode 100644 index 0000000..56c9c36 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/LivingSpawnEvent.java @@ -0,0 +1,99 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.entity.EntityLiving; +import net.minecraft.world.World; + +/** + * LivingSpawnEvent is fired whenever a living Entity is spawned.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #world} contains the world in which this living Entity is being spawned.
    + * {@link #x} contains the x-coordinate this entity is being spawned at.
    + * {@link #y} contains the y-coordinate this entity is being spawned at.
    + * {@link #z} contains the z-coordinate this entity is being spawned at.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class LivingSpawnEvent extends LivingEvent +{ + public final World world; + public final float x; + public final float y; + public final float z; + + public LivingSpawnEvent(EntityLiving entity, World world, float x, float y, float z) + { + super(entity); + this.world = world; + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Fires before mob spawn events. + * + * Result is significant: + * DEFAULT: use vanilla spawn rules + * ALLOW: allow the spawn + * DENY: deny the spawn + * + */ + @HasResult + public static class CheckSpawn extends LivingSpawnEvent + { + public CheckSpawn(EntityLiving entity, World world, float x, float y, float z) + { + super(entity, world, x, y, z); + } + } + + /** + * SpecialSpawn is fired when an Entity is to be spawned from a mob spawner.
    + * This event is fired whenever an Entity is spawned in a mob spawner in
    + * SpawnerAnimals#findChunksForSpawning(WorldServer, boolean, boolean, boolean).
    + *
    + * This event is fired via the {@link ForgeHooks#doSpecialSpawn(EntityLiving, World, float, float, float)}.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the Entity is not spawned.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + @Cancelable + public static class SpecialSpawn extends LivingSpawnEvent + { + public SpecialSpawn(EntityLiving entity, World world, float x, float y, float z) + { + super(entity, world, x, y, z); + } + } + + /** + * Fired each tick for despawnable mobs to allow control over despawning. + * {@link Result#DEFAULT} will pass the mob on to vanilla despawn mechanics. + * {@link Result#ALLOW} will force the mob to despawn. + * {@link Result#DENY} will force the mob to remain. + * This is fired every tick for every despawnable entity. Be efficient in your handlers. + * + * Note: this is not fired if the mob is definitely going to otherwise despawn. It is fired to check if + * the mob can be allowed to despawn. See {@link EntityLiving#despawnEntity} + * + * @author cpw + * + */ + @HasResult + public static class AllowDespawn extends LivingSpawnEvent + { + public AllowDespawn(EntityLiving entity) + { + super(entity, entity.worldObj, (float)entity.posX, (float)entity.posY, (float)entity.posZ); + } + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/ZombieEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/ZombieEvent.java new file mode 100644 index 0000000..70ae493 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/living/ZombieEvent.java @@ -0,0 +1,77 @@ +package net.minecraftforge.event.entity.living; + +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.EntityEvent; + +/** + * ZombieEvent is fired whenever a zombie is spawned for aid. + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class. + * + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class ZombieEvent extends EntityEvent { + + public ZombieEvent(EntityZombie entity) + { + super(entity); + } + + public EntityZombie getSummoner() + { + return (EntityZombie) entity; + } + + /** + * SummonAidEvent is fired when a Zombie Entity is summoned. + * This event is fired whenever a Zombie Entity is summoned in + * EntityZombie#attackEntityFrom(DamageSource, float). + * + * This event is fired via the {@link ForgeHooks#fireZombieSummonAid(EntityZombie, World, int, int, int, EntityLivingBase, double)}. + * + * {@link #customSummonedAid} remains null, but can be populated with a custom EntityZombie which will be spawned. + * {@link #world} contains the world that this summoning is occurring in. + * {@link #x} contains the x-coordinate at which this summoning event is occurring. + * {@link #y} contains the y-coordinate at which this summoning event is occurring. + * {@link #z} contains the z-coordinate at which this summoning event is occurring. + * {@link #attacker} contains the living Entity that attacked and caused this event to fire. + * {@link #summonChance} contains the likelihood that a Zombie would successfully be summoned. + * + * This event is not {@link Cancelable}. + * + * This event has a result. {@link HasResult} + * {@link Result#ALLOW} Zombie is summoned. + * {@link Result#DENY} Zombie is not summoned. + * + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + @HasResult + public static class SummonAidEvent extends ZombieEvent { + /** + * Populate this field to have a custom zombie instead of a normal zombie summoned + */ + public EntityZombie customSummonedAid; + + public final World world; + public final int x; + public final int y; + public final int z; + public final EntityLivingBase attacker; + public final double summonChance; + + public SummonAidEvent(EntityZombie entity, World world, int x, int y, int z, EntityLivingBase attacker, double summonChance) + { + super(entity); + this.world = world; + this.x = x; + this.y = y; + this.z = z; + this.attacker = attacker; + this.summonChance = summonChance; + } + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java new file mode 100644 index 0000000..85a85ad --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartCollisionEvent.java @@ -0,0 +1,28 @@ +package net.minecraftforge.event.entity.minecart; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityMinecart; + +/** + * MinecartCollisionEvent is fired when a minecart collides with an Entity. + * This event is fired whenever a minecraft collides in + * EntityMinecart#applyEntityCollision(Entity). + * + * {@link #collider} contains the Entity the Minecart collided with. + * + * This event is not {@link Cancelable}. + * + * This event does not have a result. {@link HasResult} + * + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class MinecartCollisionEvent extends MinecartEvent +{ + public final Entity collider; + + public MinecartCollisionEvent(EntityMinecart minecart, Entity collider) + { + super(minecart); + this.collider = collider; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java new file mode 100644 index 0000000..9703a5d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartEvent.java @@ -0,0 +1,24 @@ +package net.minecraftforge.event.entity.minecart; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraftforge.event.entity.EntityEvent; + +/** + * MinecartEvent is fired whenever an event involving minecart entities occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will
    + * receive every child event of this class.
    + *
    + * {@link #minecart} contains the minecart entity involved with this event.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class MinecartEvent extends EntityEvent +{ + public final EntityMinecart minecart; + + public MinecartEvent(EntityMinecart minecart) + { + super(minecart); + this.minecart = minecart; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java new file mode 100644 index 0000000..7534ddc --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartInteractEvent.java @@ -0,0 +1,34 @@ +package net.minecraftforge.event.entity.minecart; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.entity.player.EntityPlayer; + +/** + * MinecartInteractEvent is fired when a player interacts with a minecart.
    + * This event is fired whenever a player interacts with a minecart in + * EntityMinecartContainer#interactFirst(EntityPlayer), + * EntityMinecartEmpty#interactFirst(EntityPlayer) + * EntityMinecartFurnace#interactFirst(EntityPlayer) + * EntityMinecartHopper#interactFirst(EntityPlayer).
    + *
    + * {@link #player} contains the EntityPlayer that is involved with this minecart interaction.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not interact with the minecart.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class MinecartInteractEvent extends MinecartEvent +{ + public final EntityPlayer player; + + public MinecartInteractEvent(EntityMinecart minecart, EntityPlayer player) + { + super(minecart); + this.player = player; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java new file mode 100644 index 0000000..53be2df --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/minecart/MinecartUpdateEvent.java @@ -0,0 +1,33 @@ +package net.minecraftforge.event.entity.minecart; + +import net.minecraft.entity.item.EntityMinecart; + +/** + * MinecartUpdateEvent is fired when a minecart is updated.
    + * This event is fired whenever a minecart is updated in + * EntityMinecart#onUpdate().
    + *
    + * {@link #x} contains the x-coordinate of the minecart Entity.
    + * {@link #y} contains the y-coordinate of the minecart Entity.
    + * {@link #z} contains the z-coordinate of the minecart Entity.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class MinecartUpdateEvent extends MinecartEvent +{ + public final float x; + public final float y; + public final float z; + + public MinecartUpdateEvent(EntityMinecart minecart, float x, float y, float z) + { + super(minecart); + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AchievementEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AchievementEvent.java new file mode 100644 index 0000000..30f360e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AchievementEvent.java @@ -0,0 +1,20 @@ +package net.minecraftforge.event.entity.player; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.Achievement; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * When the player receives an achievement. If canceled the player will not receive anything. + */ +@Cancelable +public class AchievementEvent extends PlayerEvent { + + public final Achievement achievement; + public AchievementEvent(EntityPlayer player, Achievement achievement) + { + super(player); + this.achievement = achievement; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java new file mode 100644 index 0000000..e08ece9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AnvilRepairEvent.java @@ -0,0 +1,29 @@ +package net.minecraftforge.event.entity.player; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class AnvilRepairEvent extends PlayerEvent +{ + /** + * Fired when the player removes a "repaired" item from the Anvil's Output slot. + * + * breakChance specifies as a percentage the chance that the anvil will be "damaged" when used. + * + * ItemStacks are the inputs/output from the anvil. They cannot be edited. + */ + + public final ItemStack left; // The left side of the input + public final ItemStack right; // The right side of the input + public final ItemStack output; // Set this to set the output stack + public float breakChance; // Anvil's chance to break (reduced by 1 durability) when this is complete. Default is 12% (0.12f) + + public AnvilRepairEvent(EntityPlayer player, ItemStack output, ItemStack left, ItemStack right) + { + super(player); + this.output = output; + this.left = left; + this.right = right; + this.breakChance = 0.12f; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java new file mode 100644 index 0000000..832c1de --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowLooseEvent.java @@ -0,0 +1,34 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +/** + * ArrowLooseEvent is fired when a player stops using a bow.
    + * This event is fired whenever a player stops using a bow in + * ItemBow#onPlayerStoppedUsing(ItemStack, World, EntityPlayer, int).
    + *
    + * {@link #bow} contains the ItemBow ItemStack that was used in this event.
    + * {@link #charge} contains the value for how much the player had charged before stopping the shot.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not stop using the bow.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class ArrowLooseEvent extends PlayerEvent +{ + public final ItemStack bow; + public int charge; + + public ArrowLooseEvent(EntityPlayer player, ItemStack bow, int charge) + { + super(player); + this.bow = bow; + this.charge = charge; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java new file mode 100644 index 0000000..ceaedf1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ArrowNockEvent.java @@ -0,0 +1,31 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +/** + * ArrowNockEvent is fired when a player begins using a bow.
    + * This event is fired whenever a player begins using a bow in + * ItemBow#onItemRightClick(ItemStack, World, EntityPlayer).
    + *
    + * {@link #result} contains the resulting ItemStack due to the use of the bow.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not begin using the bow.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class ArrowNockEvent extends PlayerEvent +{ + public ItemStack result; + + public ArrowNockEvent(EntityPlayer player, ItemStack result) + { + super(player); + this.result = result; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java new file mode 100644 index 0000000..0e9405a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/AttackEntityEvent.java @@ -0,0 +1,30 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +/** + * AttackEntityEvent is fired when a player attacks an Entity.
    + * This event is fired whenever a player attacks an Entity in + * EntityPlayer#attackTargetEntityWithCurrentItem(Entity).
    + *
    + * {@link #target} contains the Entity that was damaged by the player.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not attack the Entity.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class AttackEntityEvent extends PlayerEvent +{ + public final Entity target; + public AttackEntityEvent(EntityPlayer player, Entity target) + { + super(player); + this.target = target; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/BonemealEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/BonemealEvent.java new file mode 100644 index 0000000..0a7cef7 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/BonemealEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +@Cancelable +@Event.HasResult +public class BonemealEvent extends PlayerEvent +{ + /** + * This event is called when a player attempts to use Bonemeal on a block. + * It can be canceled to completely prevent any further processing. + * + * You can also set the result to ALLOW to mark the event as processed + * and use up a bonemeal from the stack but do no further processing. + * + * setResult(ALLOW) is the same as the old setHandeled() + */ + + public final World world; + public final Block block; + public final int x; + public final int y; + public final int z; + + public BonemealEvent(EntityPlayer player, World world, Block block, int x, int y, int z) + { + super(player); + this.world = world; + this.block = block; + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java new file mode 100644 index 0000000..5d47938 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityInteractEvent.java @@ -0,0 +1,31 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +/** + * EntityInteractEvent is fired when a player interacts with an Entity.
    + * This event is fired whenever a player interacts with an Entity in + * EntityPlayer#interactWith(Entity).
    + *
    + * {@link #target} contains the Entity the player interacted with.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not interact with the Entity.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class EntityInteractEvent extends PlayerEvent +{ + public final Entity target; + public EntityInteractEvent(EntityPlayer player, Entity target) + { + super(player); + this.target = target; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java new file mode 100644 index 0000000..7753c28 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/EntityItemPickupEvent.java @@ -0,0 +1,29 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; + +@Cancelable +@Event.HasResult +public class EntityItemPickupEvent extends PlayerEvent +{ + /** + * This event is called when a player collides with a EntityItem on the ground. + * The event can be canceled, and no further processing will be done. + * + * You can set the result of this event to ALLOW which will trigger the + * processing of achievements, FML's event, play the sound, and kill the + * entity if all the items are picked up. + * + * setResult(ALLOW) is the same as the old setHandled() + */ + public final EntityItem item; + + public EntityItemPickupEvent(EntityPlayer player, EntityItem item) + { + super(player); + this.item = item; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/FillBucketEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/FillBucketEvent.java new file mode 100644 index 0000000..f2ee1f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/FillBucketEvent.java @@ -0,0 +1,37 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +@Cancelable +@Event.HasResult +public class FillBucketEvent extends PlayerEvent +{ + /** + * This event is fired when a player attempts to use a Empty bucket, it + * can be canceled to completely prevent any further processing. + * + * If you set the result to 'ALLOW', it means that you have processed + * the event and wants the basic functionality of adding the new + * ItemStack to your inventory and reducing the stack size to process. + * setResult(ALLOW) is the same as the old setHandeled(); + */ + + public final ItemStack current; + public final World world; + public final MovingObjectPosition target; + + public ItemStack result; + + public FillBucketEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target) + { + super(player); + this.current = current; + this.world = world; + this.target = target; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java new file mode 100644 index 0000000..7194aba --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/ItemTooltipEvent.java @@ -0,0 +1,32 @@ +package net.minecraftforge.event.entity.player; + +import java.util.List; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public class ItemTooltipEvent extends PlayerEvent +{ + /** + * Whether the advanced information on item tooltips is being shown, toggled by F3+H. + */ + public final boolean showAdvancedItemTooltips; + /** + * The {@link ItemStack} with the tooltip. + */ + public final ItemStack itemStack; + /** + * The {@link ItemStack} tooltip. + */ + public final List toolTip; + + /** + * This event is fired in {@link ItemStack#getTooltip(EntityPlayer, boolean)}, which in turn is called from it's respective GUIContainer. + */ + public ItemTooltipEvent(ItemStack itemStack, EntityPlayer entityPlayer, List toolTip, boolean showAdvancedItemTooltips) + { + super(entityPlayer); + this.itemStack = itemStack; + this.toolTip = toolTip; + this.showAdvancedItemTooltips = showAdvancedItemTooltips; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java new file mode 100644 index 0000000..9833558 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDestroyItemEvent.java @@ -0,0 +1,34 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +/** + * PlayerDestroyItemEvent is fired when a player destroys an item.
    + * This event is fired whenever a player destroys an item in + * PlayerControllerMP#onPlayerRightClick(EntityPlayer, World, ItemStack, int, int, int, int, Vec3), + * PlayerControllerMP#sendUseItem(EntityPlayer, World, ItemStack), + * EntityPlayer#destroyCurrentEquippedItem(), + * SlotCrafting#onPickupFromSlot(EntityPlayer, ItemStack), + * ItemInWorldManager#tryUseItem(EntityPlayer, World, ItemStack), + * and ItemInWorldManager#activateBlockOrUseItem(EntityPlayer, World, ItemStack, int, int, int, int, float, float, float).
    + *
    + * {@link #original} contains the original ItemStack before the item was destroyed.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class PlayerDestroyItemEvent extends PlayerEvent +{ + public final ItemStack original; + public PlayerDestroyItemEvent(EntityPlayer player, ItemStack original) + { + super(player); + this.original = original; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java new file mode 100644 index 0000000..6181b70 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerDropsEvent.java @@ -0,0 +1,39 @@ +package net.minecraftforge.event.entity.player; + +import java.util.ArrayList; + +import cpw.mods.fml.common.eventhandler.Cancelable; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import net.minecraftforge.event.entity.living.LivingDropsEvent; + +/** + * Child class of LivingDropEvent that is fired specifically when a + * player dies. Canceling the event will prevent ALL drops from entering the + * world. + */ +@Cancelable +public class PlayerDropsEvent extends LivingDropsEvent +{ + public final EntityPlayer entityPlayer; + + /** + * Creates a new event containing all the items that will drop into the + * world when a player dies. + * @param entity The dying player. + * @param source The source of the damage which is killing the player. + * @param drops List of all drops entering the world. + */ + public PlayerDropsEvent(EntityPlayer entity, DamageSource source, ArrayList drops, boolean recentlyHit) + { + super(entity, source, drops, + (source.getEntity() instanceof EntityPlayer) ? + EnchantmentHelper.getLootingModifier(((EntityPlayer)source.getEntity())) : 0, + recentlyHit, 0); + + this.entityPlayer = entity; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerEvent.java new file mode 100644 index 0000000..522fdeb --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerEvent.java @@ -0,0 +1,277 @@ +package net.minecraftforge.event.entity.player; + +import java.io.File; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.living.LivingEvent; + +/** + * PlayerEvent is fired whenever an event involving Living entities occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class PlayerEvent extends LivingEvent +{ + public final EntityPlayer entityPlayer; + public PlayerEvent(EntityPlayer player) + { + super(player); + entityPlayer = player; + } + + /** + * HarvestCheck is fired when a player attempts to harvest a block.
    + * This event is fired whenever a player attempts to harvest a block in + * EntityPlayer#canHarvestBlock(Block).
    + *
    + * This event is fired via the {@link ForgeEventFactory#doPlayerHarvestCheck(EntityPlayer, Block, boolean)}.
    + *
    + * {@link #block} contains the Block that is being checked for harvesting.
    + * {@link #success} contains the boolean value for whether the Block will be successfully harvested.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + public static class HarvestCheck extends PlayerEvent + { + public final Block block; + public boolean success; + + public HarvestCheck(EntityPlayer player, Block block, boolean success) + { + super(player); + this.block = block; + this.success = success; + } + } + + /** + * BreakSpeed is fired when a player attempts to harvest a block.
    + * This event is fired whenever a player attempts to harvest a block in + * EntityPlayer#canHarvestBlock(Block).
    + *
    + * This event is fired via the {@link ForgeEventFactory#getBreakSpeed(EntityPlayer, Block, int, float, int, int, int)}.
    + *
    + * {@link #block} contains the block being broken.
    + * {@link #metadata} contains the metadata of the block being broken.
    + * {@link #originalSpeed} contains the original speed at which the player broke the block.
    + * {@link #newSpeed} contains the newSpeed at which the player will break the block.
    + * {@link #x} contains the x-coordinate at which this event is occurring.
    + * {@link #y} contains the y-coordinate at which this event is occurring.
    + * {@link #z} contains the z-coordinate at which this event is occurring.
    + *
    + * This event is {@link Cancelable}.
    + * If it is canceled, the player is unable to break the block.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + @Cancelable + public static class BreakSpeed extends PlayerEvent + { + public final Block block; + public final int metadata; + public final float originalSpeed; + public float newSpeed = 0.0f; + public final int x; + public final int y; // -1 notes unknown location + public final int z; + + @Deprecated + public BreakSpeed(EntityPlayer player, Block block, int metadata, float original) + { + this(player, block, metadata, original, 0, -1, 0); + } + + public BreakSpeed(EntityPlayer player, Block block, int metadata, float original, int x, int y, int z) + { + super(player); + this.block = block; + this.metadata = metadata; + this.originalSpeed = original; + this.newSpeed = original; + this.x = x; + this.y = y; + this.z = z; + } + } + + /** + * NameFormat is fired when a player's display name is retrieved.
    + * This event is fired whenever a player's name is retrieved in + * EntityPlayer#getDisplayName() or EntityPlayer#refreshDisplayName().
    + *
    + * This event is fired via the {@link ForgeEventFactory#getPlayerDisplayName(EntityPlayer, String)}.
    + *
    + * {@link #username} contains the username of the player. + * {@link #displayname} contains the display name of the player. + *
    + * This event is not {@link Cancelable}. + *
    + * This event does not have a result. {@link HasResult} + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ + public static class NameFormat extends PlayerEvent + { + public final String username; + public String displayname; + + public NameFormat(EntityPlayer player, String username) { + super(player); + this.username = username; + this.displayname = username; + } + } + + /** + * Fired when the EntityPlayer is cloned, typically caused by the network sending a RESPAWN_PLAYER event. + * Either caused by death, or by traveling from the End to the overworld. + */ + public static class Clone extends PlayerEvent + { + /** + * The old EntityPlayer that this new entity is a clone of. + */ + public final EntityPlayer original; + /** + * True if this event was fired because the player died. + * False if it was fired because the entity switched dimensions. + */ + public final boolean wasDeath; + + public Clone(EntityPlayer _new, EntityPlayer oldPlayer, boolean wasDeath) + { + super(_new); + this.original = oldPlayer; + this.wasDeath = wasDeath; + } + } + + /** + * Fired when an Entity is started to be "tracked" by this player (the player receives updates about this entity, e.g. motion). + * + */ + public static class StartTracking extends PlayerEvent { + + /** + * The Entity now being tracked. + */ + public final Entity target; + + public StartTracking(EntityPlayer player, Entity target) + { + super(player); + this.target = target; + } + + } + + /** + * Fired when an Entity is stopped to be "tracked" by this player (the player no longer receives updates about this entity, e.g. motion). + * + */ + public static class StopTracking extends PlayerEvent { + + /** + * The Entity no longer being tracked. + */ + public final Entity target; + + public StopTracking(EntityPlayer player, Entity target) + { + super(player); + this.target = target; + } + + } + + /** + * The player is being loaded from the world save. Note that the + * player won't have been added to the world yet. Intended to + * allow mods to load an additional file from the players directory + * containing additional mod related player data. + */ + public static class LoadFromFile extends PlayerEvent { + /** + * The directory where player data is being stored. Use this + * to locate your mod additional file. + */ + public final File playerDirectory; + /** + * The UUID is the standard for player related file storage. + * It is broken out here for convenience for quick file generation. + */ + public final String playerUUID; + + public LoadFromFile(EntityPlayer player, File originDirectory, String playerUUID) + { + super(player); + this.playerDirectory = originDirectory; + this.playerUUID = playerUUID; + } + + /** + * Construct and return a recommended file for the supplied suffix + * @param suffix The suffix to use. + * @return + */ + public File getPlayerFile(String suffix) + { + if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved"); + return new File(this.playerDirectory, this.playerUUID+"."+suffix); + } + } + /** + * The player is being saved to the world store. Note that the + * player may be in the process of logging out or otherwise departing + * from the world. Don't assume it's association with the world. + * This allows mods to load an additional file from the players directory + * containing additional mod related player data. + *
    + * Use this event to save the additional mod related player data to the world. + * + *
    + * WARNING: Do not overwrite the player's .dat file here. You will + * corrupt the world state. + */ + public static class SaveToFile extends PlayerEvent { + /** + * The directory where player data is being stored. Use this + * to locate your mod additional file. + */ + public final File playerDirectory; + /** + * The UUID is the standard for player related file storage. + * It is broken out here for convenience for quick file generation. + */ + public final String playerUUID; + + public SaveToFile(EntityPlayer player, File originDirectory, String playerUUID) + { + super(player); + this.playerDirectory = originDirectory; + this.playerUUID = playerUUID; + } + + /** + * Construct and return a recommended file for the supplied suffix + * @param suffix The suffix to use. + * @return + */ + public File getPlayerFile(String suffix) + { + if ("dat".equals(suffix)) throw new IllegalArgumentException("The suffix 'dat' is reserved"); + return new File(this.playerDirectory, this.playerUUID+"."+suffix); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.java new file mode 100644 index 0000000..4335c12 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerFlyableFallEvent.java @@ -0,0 +1,21 @@ +package net.minecraftforge.event.entity.player; + +import net.minecraft.entity.player.EntityPlayer; + +/** + * Occurs when a player falls, but is able to fly. Doesn't need to be cancelable, this is mainly for notification purposes. + * @author Mithion + * + */ +public class PlayerFlyableFallEvent extends PlayerEvent +{ + + public float distance; + + public PlayerFlyableFallEvent(EntityPlayer player, float f) + { + super(player); + this.distance = f; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java new file mode 100644 index 0000000..45c5b2d --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerInteractEvent.java @@ -0,0 +1,79 @@ +package net.minecraftforge.event.entity.player; + +import static cpw.mods.fml.common.eventhandler.Event.Result.DEFAULT; +import static cpw.mods.fml.common.eventhandler.Event.Result.DENY; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import cpw.mods.fml.common.eventhandler.Cancelable; + +/** + * PlayerInteractEvent is fired when a player interacts in some way. + *
    + * This event is fired whenever a player interacts in + * Minecraft#func_147121_ag(), + * NetHandlerPlayServer#processPlayerBlockPlacement(C08PacketPlayerBlockPlacement), + * ItemInWorldManager#activateBlockOrUseItem(EntityPlayer, World, ItemStack, int, int, int, int, float, float, float), + * ItemInWorldManager#onBlockClicked(int, int, int, int).
    + *
    + * This event is fired via the {@link ForgeEventFactory#onPlayerInteract(EntityPlayer, Action, int, int, int, int)}. + *
    + * {@link #action} contains the Action the player performed durin this interaction.
    + * {@link #x} contains the x-coordinate of where this event occurred.
    + * {@link #y} contains the y-coordinate of where this event occurred.
    + * {@link #z} contains the z-coordinate of where this event occurred.
    + * {@link #face} contains the face of the block that was interacted with.
    + * {@link #world} contains the world in which this event is occurring.
    + *
    + * This event is {@link Cancelable}.
    + * If this event is canceled, the player does not interact.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +@Cancelable +public class PlayerInteractEvent extends PlayerEvent +{ + public static enum Action + { + RIGHT_CLICK_AIR, + RIGHT_CLICK_BLOCK, + LEFT_CLICK_BLOCK + } + + public final Action action; + public final int x; + public final int y; + public final int z; + public final int face; + public final World world; + + public Result useBlock = DEFAULT; + public Result useItem = DEFAULT; + + @Deprecated + public PlayerInteractEvent(EntityPlayer player, Action action, int x, int y, int z, int face) + { + this(player, action, x, y, z, face, player.worldObj); + } + + public PlayerInteractEvent(EntityPlayer player, Action action, int x, int y, int z, int face, World world) + { + super(player); + this.action = action; + this.x = x; + this.y = y; + this.z = z; + this.face = face; + if (face == -1) useBlock = DENY; + this.world = world; + } + + @Override + public void setCanceled(boolean cancel) + { + super.setCanceled(cancel); + useBlock = (cancel ? DENY : useBlock == DENY ? DEFAULT : useBlock); + useItem = (cancel ? DENY : useItem == DENY ? DEFAULT : useItem); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java new file mode 100644 index 0000000..9e80a59 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerOpenContainerEvent.java @@ -0,0 +1,29 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + +@HasResult +public class PlayerOpenContainerEvent extends PlayerEvent +{ + + public final boolean canInteractWith; + + /** + * This event is fired when a player attempts to view a container during + * player tick. + * + * setResult ALLOW to allow the container to stay open + * setResult DENY to force close the container (denying access) + * + * DEFAULT is vanilla behaviour + * + */ + + public PlayerOpenContainerEvent(EntityPlayer player, Container openContainer) + { + super(player); + this.canInteractWith = openContainer.canInteractWith(player); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java new file mode 100644 index 0000000..07e4dd9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerPickupXpEvent.java @@ -0,0 +1,21 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; + +/** + * This event is called when a player collides with a EntityXPOrb on the ground. + * The event can be canceled, and no further processing will be done. + */ +@Cancelable +public class PlayerPickupXpEvent extends PlayerEvent +{ + public final EntityXPOrb orb; + + public PlayerPickupXpEvent(EntityPlayer player, EntityXPOrb orb) + { + super(player); + this.orb = orb; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java new file mode 100644 index 0000000..b0c6248 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerSleepInBedEvent.java @@ -0,0 +1,36 @@ +package net.minecraftforge.event.entity.player; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayer.EnumStatus; + +import net.minecraft.entity.player.EntityPlayer.EnumStatus; +/** + * PlayerSleepInBedEvent is fired when a player sleeps in a bed. + *
    + * This event is fired whenever a player sleeps in a bed in + * EntityPlayer#sleepInBedAt(int, int, int).
    + *
    + * {@link #result} contains whether the player is able to sleep.
    + *
    + * This event is not {@link Cancelable}. + *
    + * This event does not have a result. {@link HasResult} + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + **/ +public class PlayerSleepInBedEvent extends PlayerEvent +{ + public EnumStatus result = null; + public final int x; + public final int y; + public final int z; + + public PlayerSleepInBedEvent(EntityPlayer player, int x, int y, int z) + { + super(player); + this.x = x; + this.y = y; + this.z = z; + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerUseItemEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerUseItemEvent.java new file mode 100644 index 0000000..b7a1a42 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerUseItemEvent.java @@ -0,0 +1,94 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public abstract class PlayerUseItemEvent extends PlayerEvent +{ + public final ItemStack item; + public int duration; + + private PlayerUseItemEvent(EntityPlayer player, ItemStack item, int duration) + { + super(player); + this.item = item; + this.duration = duration; + } + + /** + * Fired when a player starts 'using' an item, typically when they hold right mouse. + * Examples: + * Drawing a bow + * Eating Food + * Drinking Potions/Milk + * Guarding with a sword + * + * Cancel the event, or set the duration or <= 0 to prevent it from processing. + * + */ + @Cancelable + public static class Start extends PlayerUseItemEvent + { + public Start(EntityPlayer player, ItemStack item, int duration) + { + super(player, item, duration); + } + } + + /** + * Fired every tick that a player is 'using' an item, see {@link Start} for info. + * + * Cancel the event, or set the duration or <= 0 to cause the player to stop using the item. + * + */ + @Cancelable + public static class Tick extends PlayerUseItemEvent + { + public Tick(EntityPlayer player, ItemStack item, int duration) + { + super(player, item, duration); + } + } + + /** + * Fired when a player stops using an item without the use duration timing out. + * Example: + * Stop eating 1/2 way through + * Stop defending with sword + * Stop drawing bow. This case would fire the arrow + * + * Duration on this event is how long the item had left in it's count down before 'finishing' + * + * Canceling this event will prevent the Item from being notified that it has stopped being used, + * The only vanilla item this would effect are bows, and it would cause them NOT to fire there arrow. + */ + @Cancelable + public static class Stop extends PlayerUseItemEvent + { + public Stop(EntityPlayer player, ItemStack item, int duration) + { + super(player, item, duration); + } + } + + /** + * Fired after an item has fully finished being used. + * The item has been notified that it was used, and the item/result stacks reflect after that state. + * This means that when this is fired for a Potion, the potion effect has already been applied. + * + * If you wish to cancel those effects, you should cancel one of the above events. + * + * The result item stack is the stack that is placed in the player's inventory in replacement of the stack that is currently being used. + * + */ + public static class Finish extends PlayerUseItemEvent + { + public ItemStack result; + public Finish(EntityPlayer player, ItemStack item, int duration, ItemStack result) + { + super(player, item, duration); + this.result = result; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java new file mode 100644 index 0000000..d1a40c8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/PlayerWakeUpEvent.java @@ -0,0 +1,42 @@ +package net.minecraftforge.event.entity.player; + +import net.minecraft.entity.player.EntityPlayer; + +/** + * This event is fired when the player is waking up.
    + * This is merely for purposes of listening for this to happen.
    + * There is nothing that can be manipulated with this event. + */ +public class PlayerWakeUpEvent extends PlayerEvent +{ + @Deprecated //ToDo: Remove in 1.8 + public PlayerWakeUpEvent(EntityPlayer player) + { + this(player, false, false, false); + } + /** + * Used for the 'wake up animation'. + * This is false if the player is considered 'sleepy' and the overlay should slowly fade away. + */ + public final boolean wakeImmediatly; + + /** + * Indicates if the server should be notified of sleeping changes. + * This will only be false if the server is considered 'up to date' already, because, for example, it initiated the call. + */ + public final boolean updateWorld; + + /** + * Indicates if the player's sleep was considered successful. + * In vanilla, this is used to determine if the spawn chunk is to be set to the bed's position. + */ + public final boolean setSpawn; + + public PlayerWakeUpEvent(EntityPlayer player, boolean wakeImmediatly, boolean updateWorld, boolean setSpawn) + { + super(player); + this.wakeImmediatly = wakeImmediatly; + this.updateWorld = updateWorld; + this.setSpawn = setSpawn; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/UseHoeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/UseHoeEvent.java new file mode 100644 index 0000000..38b9d67 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/entity/player/UseHoeEvent.java @@ -0,0 +1,38 @@ +package net.minecraftforge.event.entity.player; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +@Cancelable +@Event.HasResult +public class UseHoeEvent extends PlayerEvent +{ + /** + * This event is fired when a player attempts to use a Hoe on a block, it + * can be canceled to completely prevent any further processing. + * + * You can also set the result to ALLOW to mark the event as processed + * and damage the hoe. + * + * setResult(ALLOW) is the same as the old setHandeled(); + */ + + public final ItemStack current; + public final World world; + public final int x; + public final int y; + public final int z; + + public UseHoeEvent(EntityPlayer player, ItemStack current, World world, int x, int y, int z) + { + super(player); + this.current = current; + this.world = world; + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/BiomeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/BiomeEvent.java new file mode 100644 index 0000000..faba777 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/BiomeEvent.java @@ -0,0 +1,146 @@ +package net.minecraftforge.event.terraingen; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.block.Block; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.biome.BiomeGenBase; + +/** + * BiomeEvent is fired whenever an event involving biomes occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ +public class BiomeEvent extends Event +{ + public final BiomeGenBase biome; + + public BiomeEvent(BiomeGenBase biome) + { + this.biome = biome; + } + + /** + * CreateDecorator is fired when a BiomeDecorator is created.
    + * This event is fired whenever a BiomeDecorator is created in + * DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).
    + *
    + * {@link #originalBiomeDecorator} contains the original BiomeDecorator that would be used in vanilla. + * {@link #newBiomeDecorator} contains the new BiomeDecoration to be used by Minecraft. + *
    + * This event is not {@link Cancelable}. + *
    + * This event does not have a result. {@link HasResult} + *
    + * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ + public static class CreateDecorator extends BiomeEvent + { + public final BiomeDecorator originalBiomeDecorator; + public BiomeDecorator newBiomeDecorator; + + public CreateDecorator(BiomeGenBase biome, BiomeDecorator original) + { + super(biome); + originalBiomeDecorator = original; + newBiomeDecorator = original; + } + } + + /** + * BiomeColor is fired whenever an event involving biome colors occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ + public static class BiomeColor extends BiomeEvent + { + public final int originalColor; + public int newColor; + + public BiomeColor(BiomeGenBase biome, int original) + { + super(biome); + originalColor = original; + newColor = original; + } + } + + /** + * This event is fired when the village generator attempts to choose a block ID + * based on the village's biome. + * + * You can cancel the event to override default values + */ + @HasResult + public static class GetVillageBlockID extends BiomeEvent + { + public final Block original; + public final int type; + public Block replacement; + + public GetVillageBlockID(BiomeGenBase biome, Block original, int type) + { + super(biome); + this.original = original; + this.type = type; + } + } + + /** + * This event is fired when the village generator attempts to choose a block + * metadata based on the village's biome. + * + * You can set the result to DENY to prevent the default block metadata selection. + */ + @HasResult + public static class GetVillageBlockMeta extends BiomeEvent + { + public final Block original; + public final int type; + public int replacement; + + public GetVillageBlockMeta(BiomeGenBase biome, Block original, int type) + { + super(biome); + this.original = original; + this.type = type; + } + } + + /** + * This event is fired when a biome is queried for its grass color. + */ + public static class GetGrassColor extends BiomeColor + { + public GetGrassColor(BiomeGenBase biome, int original) + { + super(biome, original); + } + } + + /** + * This event is fired when a biome is queried for its grass color. + */ + public static class GetFoliageColor extends BiomeColor + { + public GetFoliageColor(BiomeGenBase biome, int original) + { + super(biome, original); + } + } + + /** + * This event is fired when a biome is queried for its water color. + */ + public static class GetWaterColor extends BiomeColor + { + public GetWaterColor(BiomeGenBase biome, int original) + { + super(biome, original); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java new file mode 100644 index 0000000..da09fae --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/ChunkProviderEvent.java @@ -0,0 +1,89 @@ +package net.minecraftforge.event.terraingen; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.IChunkProvider; + +public class ChunkProviderEvent extends Event +{ + + public final IChunkProvider chunkProvider; + + public ChunkProviderEvent(IChunkProvider chunkProvider) + { + this.chunkProvider = chunkProvider; + } + + /** + * This event is fired when a chunks blocks are replaced by a biomes top and + * filler blocks. + * + * You can set the result to DENY to prevent the default replacement. + */ + @HasResult + public static class ReplaceBiomeBlocks extends ChunkProviderEvent + { + public final int chunkX; + public final int chunkZ; + public final Block[] blockArray; + public final byte[] metaArray; // CAN BE NULL + public final BiomeGenBase[] biomeArray; + public final World world; // CAN BE NULL + + @Deprecated // TODO: Remove in 1.8 + public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, BiomeGenBase[] biomeArray) + { + this(chunkProvider, chunkX, chunkZ, blockArray, new byte[256], biomeArray, null); + } + + @Deprecated // TODO: Remove in 1.8 + public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray) + { + this(chunkProvider, chunkZ, chunkZ, blockArray, metaArray, biomeArray, null); + } + + public ReplaceBiomeBlocks(IChunkProvider chunkProvider, int chunkX, int chunkZ, Block[] blockArray, byte[] metaArray, BiomeGenBase[] biomeArray, World world) + { + super(chunkProvider); + this.chunkX = chunkX; + this.chunkZ = chunkZ; + this.blockArray = blockArray; + this.biomeArray = biomeArray; + this.metaArray = metaArray; + this.world = world; + } + + } + + /** + * This event is fired before a chunks terrain noise field is initialized. + * + * You can set the result to DENY to substitute your own noise field. + */ + @HasResult + public static class InitNoiseField extends ChunkProviderEvent + { + public double[] noisefield; + public final int posX; + public final int posY; + public final int posZ; + public final int sizeX; + public final int sizeY; + public final int sizeZ; + + public InitNoiseField(IChunkProvider chunkProvider, double[] noisefield, int posX, int posY, int posZ, int sizeX, int sizeY, int sizeZ) + { + super(chunkProvider); + this.noisefield = noisefield; + this.posX = posX; + this.posY = posY; + this.posZ = posZ; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.sizeZ = sizeZ; + } + + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java new file mode 100644 index 0000000..640ab8c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DecorateBiomeEvent.java @@ -0,0 +1,82 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.world.World; + +/**DecorateBiomeEvent is fired when a BiomeDecorator is created. + *
    + * This event is fired whenever a BiomeDecorator is created in + * DeferredBiomeDecorator#fireCreateEventAndReplace(BiomeGenBase).
    + *
    + * {@link #world} contains the world that is being decorated.
    + * {@link #rand} contains an instane of Random to be used.
    + * {@link #chunkX} contains the x-coordinate of the Chunk being decorated.
    + * {@link #chunkZ} contains the z-coordinate of the Chunk being decorated.
    + *
    + * This event is not {@link Cancelable}. + *
    + * This event does not have a result. {@link HasResult} + *
    + * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}. + **/ +public class DecorateBiomeEvent extends Event +{ + public final World world; + public final Random rand; + public final int chunkX; + public final int chunkZ; + + public DecorateBiomeEvent(World world, Random rand, int worldX, int worldZ) + { + this.world = world; + this.rand = rand; + this.chunkX = worldX; + this.chunkZ = worldZ; + } + + /** + * This event is fired before a chunk is decorated with a biome feature. + */ + public static class Pre extends DecorateBiomeEvent + { + public Pre(World world, Random rand, int worldX, int worldZ) + { + super(world, rand, worldX, worldZ); + } + } + + /** + * This event is fired after a chunk is decorated with a biome feature. + */ + public static class Post extends DecorateBiomeEvent + { + public Post(World world, Random rand, int worldX, int worldZ) + { + super(world, rand, worldX, worldZ); + } + } + + /** + * This event is fired when a chunk is decorated with a biome feature. + * + * You can set the result to DENY to prevent the default biome decoration. + */ + @HasResult + public static class Decorate extends DecorateBiomeEvent + { + /** Use CUSTOM to filter custom event types + */ + public static enum EventType { BIG_SHROOM, CACTUS, CLAY, DEAD_BUSH, LILYPAD, FLOWERS, GRASS, LAKE, PUMPKIN, REED, SAND, SAND_PASS2, SHROOM, TREE, CUSTOM } + + public final EventType type; + + public Decorate(World world, Random rand, int worldX, int worldZ, EventType type) + { + super(world, rand, worldX, worldZ); + this.type = type; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java new file mode 100644 index 0000000..903f7d1 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/DeferredBiomeDecorator.java @@ -0,0 +1,46 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.MinecraftForge; + +public class DeferredBiomeDecorator extends BiomeDecorator { + private BiomeDecorator wrapped; + + public DeferredBiomeDecorator(BiomeDecorator wrappedOriginal) + { + this.wrapped = wrappedOriginal; + } + + @Override + public void decorateChunk(World par1World, Random par2Random, BiomeGenBase biome, int par3, int par4) + { + fireCreateEventAndReplace(biome); + // On first call to decorate, we fire and substitute ourselves, if we haven't already done so + biome.theBiomeDecorator.decorateChunk(par1World, par2Random, biome, par3, par4); + } + public void fireCreateEventAndReplace(BiomeGenBase biome) + { + // Copy any configuration from us to the real instance. + wrapped.bigMushroomsPerChunk = bigMushroomsPerChunk; + wrapped.cactiPerChunk = cactiPerChunk; + wrapped.clayPerChunk = clayPerChunk; + wrapped.deadBushPerChunk = deadBushPerChunk; + wrapped.flowersPerChunk = flowersPerChunk; + wrapped.generateLakes = generateLakes; + wrapped.grassPerChunk = grassPerChunk; + wrapped.mushroomsPerChunk = mushroomsPerChunk; + wrapped.reedsPerChunk = reedsPerChunk; + wrapped.sandPerChunk = sandPerChunk; + wrapped.sandPerChunk2 = sandPerChunk2; + wrapped.treesPerChunk = treesPerChunk; + wrapped.waterlilyPerChunk = waterlilyPerChunk; + + BiomeEvent.CreateDecorator event = new BiomeEvent.CreateDecorator(biome, wrapped); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + biome.theBiomeDecorator = event.newBiomeDecorator; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java new file mode 100644 index 0000000..b4b1871 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitMapGenEvent.java @@ -0,0 +1,22 @@ +package net.minecraftforge.event.terraingen; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.world.gen.MapGenBase; + +public class InitMapGenEvent extends Event +{ + /** Use CUSTOM to filter custom event types + */ + public static enum EventType { CAVE, MINESHAFT, NETHER_BRIDGE, NETHER_CAVE, RAVINE, SCATTERED_FEATURE, STRONGHOLD, VILLAGE, CUSTOM } + + public final EventType type; + public final MapGenBase originalGen; + public MapGenBase newGen; + + InitMapGenEvent(EventType type, MapGenBase original) + { + this.type = type; + this.originalGen = original; + this.newGen = original; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitNoiseGensEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitNoiseGensEvent.java new file mode 100644 index 0000000..ae4af86 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/InitNoiseGensEvent.java @@ -0,0 +1,22 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.gen.NoiseGenerator; +import net.minecraftforge.event.world.*; + +public class InitNoiseGensEvent extends WorldEvent +{ + public final Random rand; + public final NoiseGenerator[] originalNoiseGens; + public NoiseGenerator[] newNoiseGens; + + public InitNoiseGensEvent(World world, Random rand, NoiseGenerator[] original) + { + super(world); + this.rand = rand; + originalNoiseGens = original; + newNoiseGens = original.clone(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/OreGenEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/OreGenEvent.java new file mode 100644 index 0000000..e5076f2 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/OreGenEvent.java @@ -0,0 +1,105 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +/** + * OreGenEvent is fired when an event involving ore generation occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #world} contains the world this event is occurring in.
    + * {@link #rand} contains an instance of random that can be used in this event.
    + * {@link #worldX} contains the x-coordinate of the block position currently being populated with ores.
    + * {@link #worldZ} contains the z-coordinate of the block position currently being populated with ores.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#ORE_GEN_BUS}.
    + **/ +public class OreGenEvent extends Event +{ + public final World world; + public final Random rand; + public final int worldX; + public final int worldZ; + + public OreGenEvent(World world, Random rand, int worldX, int worldZ) + { + this.world = world; + this.rand = rand; + this.worldX = worldX; + this.worldZ = worldZ; + } + + /** + * OreGenEvent.Pre is fired just before a chunk is populated with ores.
    + * This event is fired just before ore generation in + * BiomeDecorator#generateOres().
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
    + **/ + public static class Pre extends OreGenEvent + { + public Pre(World world, Random rand, int worldX, int worldZ) + { + super(world, rand, worldX, worldZ); + } + } + + /** + * OreGenEvent.Post is fired just after a chunk is populated with ores.
    + * This event is fired just after ore generation in + * BiomeDecorator#generateOres().
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
    + **/ + public static class Post extends OreGenEvent + { + public Post(World world, Random rand, int worldX, int worldZ) + { + super(world, rand, worldX, worldZ); + } + } + + /** + * GenerateMinable is fired when a mineable block is generated in a chunk.
    + * This event is fired just after ore generation in + * BiomeDecorator#generateOres().
    + *
    + * {@link #type} contains the enum value for the Ore attempting to be generated.
    + * {@link #generator} contains the WorldGenerator generating this ore.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event has a result. {@link HasResult}
    + * This result determines whether the ore is allowed to be generated.
    + *
    + * This event is fired on the {@link MinecraftForge#ORE_GEN_BUS}.
    + **/ + @HasResult + public static class GenerateMinable extends OreGenEvent + { + public static enum EventType { COAL, DIAMOND, DIRT, GOLD, GRAVEL, IRON, LAPIS, REDSTONE, QUARTZ, CUSTOM } + + public final EventType type; + public final WorldGenerator generator; + + public GenerateMinable(World world, Random rand, WorldGenerator generator, int worldX, int worldZ, EventType type) + { + super(world, rand, worldX, worldZ); + this.generator = generator; + this.type = type; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java new file mode 100644 index 0000000..b0d495b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/PopulateChunkEvent.java @@ -0,0 +1,114 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + +/** + * PopulateChunkEvent is fired when an event involving chunk terrain feature population occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #world} contains the world this event is occurring in.
    + * {@link #rand} contains an instance of random that can be used in this event.
    + * {@link #chunkX} contains the x-coordinate of the chunk currently being populated with a terrain feature.
    + * {@link #chunkZ} contains the z-coordinate of the chunk currently being populated with ores.
    + * {@link #hasVillageGenerated} contains the boolean value stating if the chunk already has a village spawned in it.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}, except {@link Populate}, which fires on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
    + **/ +public class PopulateChunkEvent extends ChunkProviderEvent +{ + public final World world; + public final Random rand; + public final int chunkX; + public final int chunkZ; + public final boolean hasVillageGenerated; + + public PopulateChunkEvent(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) + { + super(chunkProvider); + this.world = world; + this.rand = rand; + this.chunkX = chunkX; + this.chunkZ = chunkZ; + this.hasVillageGenerated = hasVillageGenerated; + } + + /** + * PopulateChunkEvent.Pre is fired just before a chunk is populated a terrain feature.
    + * This event is fired just before terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Pre extends PopulateChunkEvent + { + public Pre(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) + { + super(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated); + } + } + + /** + * PopulateChunkEvent.Post is fired just after a chunk is populated with a terrain feature.
    + * This event is fired just after terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Post extends PopulateChunkEvent + { + public Post(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) + { + super(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated); + } + } + + /** + * PopulateChunkEvent.Populate is fired when a chunk is populated with a terrain feature.
    + * This event is fired during terrain feature generation in + * ChunkProviderEnd#populate(IChunkProvider, int, int), + * ChunkProviderGenerate#populate(IChunkProvider, int, int), + * and ChunkProviderHell#populate(IChunkProvider, int, int).
    + *
    + * {@link #type} contains the enum value for the terrain feature being generated.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event has a result. {@link HasResult}
    + * This result determines if the chunk is populated with the terrain feature.
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + @HasResult + public static class Populate extends PopulateChunkEvent + { + /** Use CUSTOM to filter custom event types + */ + public static enum EventType { DUNGEON, FIRE, GLOWSTONE, ICE, LAKE, LAVA, NETHER_LAVA, ANIMALS, CUSTOM } + + public final EventType type; + + public Populate(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated, EventType type) + { + super(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated); + this.type = type; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java new file mode 100644 index 0000000..1a72675 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/SaplingGrowTreeEvent.java @@ -0,0 +1,42 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.Event.HasResult; +import net.minecraft.world.World; +import net.minecraftforge.event.world.WorldEvent; + +/** + * SaplingGrowTreeEvent is fired when a spling grows into a tree.
    + * This event is fired during sapling growth in + * BlockSapling#func_149878_d(World, int, int, int, Random).
    + *
    + * {@link #x} contains the x-coordinate of the growing sapling.
    + * {@link #y} contains the y-coordinate of the growing sapling.
    + * {@link #z} contains the z-coordinate of the growing sapling.
    + * {@link #rand} contains an instance of Random for use.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event has a result. {@link HasResult}
    + * This result determines if the sapling is allowed to grow.
    + *
    + * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
    + **/ +@HasResult +public class SaplingGrowTreeEvent extends WorldEvent +{ + public final int x; + public final int y; + public final int z; + public final Random rand; + + public SaplingGrowTreeEvent(World world, Random rand, int x, int y, int z) + { + super(world); + this.rand = rand; + this.x = x; + this.y = y; + this.z = z; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/TerrainGen.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/TerrainGen.java new file mode 100644 index 0000000..2f6cdca --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/TerrainGen.java @@ -0,0 +1,60 @@ +package net.minecraftforge.event.terraingen; + +import java.util.Random; + +import cpw.mods.fml.common.eventhandler.Event.*; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.NoiseGenerator; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.*; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent.*; +import net.minecraftforge.event.terraingen.OreGenEvent.*; +import net.minecraftforge.event.terraingen.PopulateChunkEvent.*; + +public abstract class TerrainGen +{ + public static NoiseGenerator[] getModdedNoiseGenerators(World world, Random rand, NoiseGenerator[] original) + { + InitNoiseGensEvent event = new InitNoiseGensEvent(world, rand, original); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.newNoiseGens; + } + + public static MapGenBase getModdedMapGen(MapGenBase original, InitMapGenEvent.EventType type) + { + InitMapGenEvent event = new InitMapGenEvent(type, original); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.newGen; + } + + public static boolean populate(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated, Populate.EventType type) + { + PopulateChunkEvent.Populate event = new PopulateChunkEvent.Populate(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated, type); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.getResult() != Result.DENY; + } + + public static boolean decorate(World world, Random rand, int chunkX, int chunkZ, Decorate.EventType type) + { + Decorate event = new Decorate(world, rand, chunkX, chunkZ, type); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.getResult() != Result.DENY; + } + + public static boolean generateOre(World world, Random rand, WorldGenerator generator, int worldX, int worldZ, GenerateMinable.EventType type) + { + GenerateMinable event = new GenerateMinable(world, rand, generator, worldX, worldZ, type); + MinecraftForge.ORE_GEN_BUS.post(event); + return event.getResult() != Result.DENY; + } + + public static boolean saplingGrowTree(World world, Random rand, int x, int y, int z) + { + SaplingGrowTreeEvent event = new SaplingGrowTreeEvent(world, rand, x, y, z); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.getResult() != Result.DENY; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java new file mode 100644 index 0000000..3147951 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/terraingen/WorldTypeEvent.java @@ -0,0 +1,83 @@ +package net.minecraftforge.event.terraingen; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.WorldType; + +/** + * WorldTypeEvent is fired when an event involving the world occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #worldType} contains the WorldType of the world this event is occurring in.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
    + **/ +public class WorldTypeEvent extends Event +{ + public final WorldType worldType; + + public WorldTypeEvent(WorldType worldType) + { + this.worldType = worldType; + } + + /** + * BiomeSize is fired when vanilla Minecraft attempts to generate biomes.
    + * This event is fired during biome generation in + * GenLayer#initializeAllBiomeGenerators(long, WorldType).
    + *
    + * {@link #originalSize} the original size of the Biome.
    + * {@link #newSize} the new size of the biome. Initially set to the {@link #originalSize}.
    + * If {@link #newSize} is set to a new value, that value will be used for the Biome size.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
    + **/ + public static class BiomeSize extends WorldTypeEvent + { + public final byte originalSize; + public byte newSize; + + public BiomeSize(WorldType worldType, byte original) + { + super(worldType); + originalSize = original; + newSize = original; + } + } + + /** + * InitBiomeGens is fired when vanilla Minecraft attempts to initialize the biome generators.
    + * This event is fired just during biome generator initialization in + * WorldChunkManager#WorldChunkManager(long, WorldType).
    + *
    + * {@link #seed} the seed of the world.
    + * {@link #originalBiomeGens} the array of GenLayers original intended for this Biome generation.
    + * {@link #newBiomeGens} the array of GenLayers that will now be used for this Biome generation.
    + * If {@link #newBiomeGens} is set to a new value, that value will be used for the Biome generator.
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}.
    + **/ + public static class InitBiomeGens extends WorldTypeEvent + { + public final long seed; + public final GenLayer[] originalBiomeGens; + public GenLayer[] newBiomeGens; + + public InitBiomeGens(WorldType worldType, long seed, GenLayer[] original) + { + super(worldType); + this.seed = seed; + originalBiomeGens = original; + newBiomeGens = original.clone(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/BlockEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/BlockEvent.java new file mode 100644 index 0000000..af06f19 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/BlockEvent.java @@ -0,0 +1,180 @@ +package net.minecraftforge.event.world; + +import java.util.ArrayList; +import java.util.List; + +import com.google.common.collect.ImmutableList; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.block.Block; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.util.BlockSnapshot; + +public class BlockEvent extends Event { + private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockEvent", "false")); + + public final int x; + public final int y; + public final int z; + public final World world; + public final Block block; + public final int blockMetadata; + public BlockEvent(int x, int y, int z, World world, Block block, int blockMetadata) + { + this.x = x; + this.y = y; + this.z = z; + this.world = world; + this.block = block; + this.blockMetadata = blockMetadata; + } + + /** + * Fired when a block is about to drop it's harvested items. The {@link #drops} array can be amended, as can the {@link #dropChance}. + * Note well: the {@link #harvester} player field is null in a variety of scenarios. Code expecting null. + * + * The {@link #dropChance} is used to determine which items in this array will actually drop, compared to a random number. If you wish, you + * can pre-filter yourself, and set {@link #dropChance} to 1.0f to always drop the contents of the {@link #drops} array. + * + * {@link #isSilkTouching} is set if this is considered a silk touch harvesting operation, vs a normal harvesting operation. Act accordingly. + * + * @author cpw + */ + public static class HarvestDropsEvent extends BlockEvent { + public final int fortuneLevel; + public final ArrayList drops; + public final boolean isSilkTouching; + public float dropChance; // Change to e.g. 1.0f, if you manipulate the list and want to guarantee it always drops + public final EntityPlayer harvester; // May be null for non-player harvesting such as explosions or machines + + public HarvestDropsEvent(int x, int y, int z, World world, Block block, int blockMetadata, int fortuneLevel, float dropChance, ArrayList drops, EntityPlayer harvester, boolean isSilkTouching) + { + super(x, y, z, world, block, blockMetadata); + this.fortuneLevel = fortuneLevel; + this.dropChance = dropChance; + this.drops = drops; + this.isSilkTouching = isSilkTouching; + this.harvester = harvester; + } + } + + /** + * Event that is fired when an Block is about to be broken by a player + * Canceling this event will prevent the Block from being broken. + */ + @Cancelable + public static class BreakEvent extends BlockEvent + { + /** Reference to the Player who broke the block. If no player is available, use a EntityFakePlayer */ + private final EntityPlayer player; + private int exp; + + public BreakEvent(int x, int y, int z, World world, Block block, int blockMetadata, EntityPlayer player) + { + super(x, y, z, world, block, blockMetadata); + this.player = player; + + if (block == null || !ForgeHooks.canHarvestBlock(block, player, blockMetadata) || // Handle empty block or player unable to break block scenario + block.canSilkHarvest(world, player, x, y, z, blockMetadata) && EnchantmentHelper.getSilkTouchModifier(player)) // If the block is being silk harvested, the exp dropped is 0 + { + this.exp = 0; + } + else + { + int meta = block.getDamageValue(world, x, y, z); + int bonusLevel = EnchantmentHelper.getFortuneModifier(player); + this.exp = block.getExpDrop(world, meta, bonusLevel); + } + } + + public EntityPlayer getPlayer() + { + return player; + } + + /** + * Get the experience dropped by the block after the event has processed + * + * @return The experience to drop or 0 if the event was canceled + */ + public int getExpToDrop() + { + return this.isCanceled() ? 0 : exp; + } + + /** + * Set the amount of experience dropped by the block after the event has processed + * + * @param exp 1 or higher to drop experience, else nothing will drop + */ + public void setExpToDrop(int exp) + { + this.exp = exp; + } + } + + /** + * Called when a block is placed by a player. + * + * If a Block Place event is cancelled, the block will not be placed. + */ + @Cancelable + public static class PlaceEvent extends BlockEvent { + + public final EntityPlayer player; + public final ItemStack itemInHand; + public final BlockSnapshot blockSnapshot; + public final Block placedBlock; + public final Block placedAgainst; + + public PlaceEvent(BlockSnapshot blockSnapshot, Block placedAgainst, EntityPlayer player) { + super(blockSnapshot.x, blockSnapshot.y, blockSnapshot.z, blockSnapshot.world, blockSnapshot.getCurrentBlock(), blockSnapshot.meta); + this.player = player; + this.itemInHand = player.getCurrentEquippedItem(); + this.blockSnapshot = blockSnapshot; + this.placedBlock = blockSnapshot.getCurrentBlock(); + this.placedAgainst = placedAgainst; + if (DEBUG) + { + System.out.printf("Created PlaceEvent - [PlacedBlock: %s ][PlacedAgainst: %s ][ItemStack: %s ][Player: %s ]\n", placedBlock, placedAgainst, player.getCurrentEquippedItem(), player); + } + } + } + + /** + * Fired when a single block placement action of a player triggers the + * creation of multiple blocks(e.g. placing a bed block). The block returned + * by {@link #block} and its related methods is the block where + * the placed block would exist if the placement only affected a single + * block. + */ + @Cancelable + public static class MultiPlaceEvent extends PlaceEvent { + private final List blockSnapshots; + + public MultiPlaceEvent(List blockSnapshots, Block placedAgainst, EntityPlayer player) { + super(blockSnapshots.get(0), placedAgainst, player); + this.blockSnapshots = ImmutableList.copyOf(blockSnapshots); + if (DEBUG) + { + System.out.printf("Created MultiPlaceEvent - [PlacedAgainst: %s ][ItemInHand: %s ][Player: %s ]\n", placedAgainst, this.itemInHand, player); + } + } + + /** + * Gets a list of blocksnapshots for all blocks which were replaced by the + * placement of the new blocks. Most of these blocks will just be of type AIR. + * + * @return immutable list of replaced BlockSnapshots + */ + public List getReplacedBlockSnapshots() { + return blockSnapshots; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkDataEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkDataEvent.java new file mode 100644 index 0000000..c9dd5f8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkDataEvent.java @@ -0,0 +1,67 @@ +package net.minecraftforge.event.world; + +import net.minecraft.world.chunk.Chunk; +import net.minecraft.nbt.NBTTagCompound; + +/** + * ChunkDataEvent is fired when an event involving chunk data occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #data} contains the NBTTagCompound containing the chunk data for this event.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class ChunkDataEvent extends ChunkEvent +{ + private final NBTTagCompound data; + + public ChunkDataEvent(Chunk chunk, NBTTagCompound data) + { + super(chunk); + this.data = data; + } + + public NBTTagCompound getData() + { + return data; + } + + /** + * ChunkDataEvent.Load is fired when vanilla Minecraft attempts to load Chunk data.
    + * This event is fired during chunk loading in + * ChunkIOProvider#callStage2(QueuedChunk, Chunk).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Load extends ChunkDataEvent + { + public Load(Chunk chunk, NBTTagCompound data) + { + super(chunk, data); + } + } + + /** + * ChunkDataEvent.Save is fired when vanilla Minecraft attempts to save Chunk data.
    + * This event is fired during chunk saving in + * AnvilChunkLoader#saveChunk(World, Chunk).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Save extends ChunkDataEvent + { + public Save(Chunk chunk, NBTTagCompound data) + { + super(chunk, data); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkEvent.java new file mode 100644 index 0000000..ecd15e4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkEvent.java @@ -0,0 +1,67 @@ +package net.minecraftforge.event.world; + +import net.minecraft.world.chunk.Chunk; + +/** + * ChunkEvent is fired when an event involving a chunk occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #chunk} contains the Chunk this event is affecting.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class ChunkEvent extends WorldEvent +{ + private final Chunk chunk; + + public ChunkEvent(Chunk chunk) + { + super(chunk.worldObj); + this.chunk = chunk; + } + + public Chunk getChunk() + { + return chunk; + } + + /** + * ChunkEvent.Load is fired when vanilla Minecraft attempts to load a Chunk into the world.
    + * This event is fired during chunk loading in
    + * ChunkProviderClient#loadChunk(int, int),
    + * Chunk.onChunkLoad().
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Load extends ChunkEvent + { + public Load(Chunk chunk) + { + super(chunk); + } + } + + /** + * ChunkEvent.Unload is fired when vanilla Minecraft attempts to unload a Chunk from the world.
    + * This event is fired during chunk unloading in
    + * Chunk.onChunkUnload().
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Unload extends ChunkEvent + { + public Unload(Chunk chunk) + { + super(chunk); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkWatchEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkWatchEvent.java new file mode 100644 index 0000000..156a7b4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ChunkWatchEvent.java @@ -0,0 +1,59 @@ +package net.minecraftforge.event.world; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.entity.player.EntityPlayerMP; + +/** + * ChunkWatchEvent is fired when an event involving a chunk being watched occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #chunk} contains the ChunkCoordIntPair of the Chunk this event is affecting.
    + * {@link #player} contains the EntityPlayer that is involved with this chunk being watched.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class ChunkWatchEvent extends Event +{ + public final ChunkCoordIntPair chunk; + public final EntityPlayerMP player; + + public ChunkWatchEvent(ChunkCoordIntPair chunk, EntityPlayerMP player) + { + this.chunk = chunk; + this.player = player; + } + + /** + * ChunkWatchEvent.Watch is fired when an EntityPlayer begins watching a chunk.
    + * This event is fired when a chunk is added to the watched chunks of an EntityPlayer in + * EntityPlayerMP#onUpdate().
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Watch extends ChunkWatchEvent + { + public Watch(ChunkCoordIntPair chunk, EntityPlayerMP player) { super(chunk, player); } + } + + /** + * ChunkWatchEvent.UnWatch is fired when an EntityPlayer stops watching a chunk.
    + * This event is fired when a chunk is removed from the watched chunks of an EntityPlayer in + * PlayerInstance#removePlayer(EntityPlayerMP).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class UnWatch extends ChunkWatchEvent + { + public UnWatch(ChunkCoordIntPair chunkLocation, EntityPlayerMP player) { super(chunkLocation, player); } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ExplosionEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ExplosionEvent.java new file mode 100644 index 0000000..9ca0e57 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/ExplosionEvent.java @@ -0,0 +1,76 @@ +package net.minecraftforge.event.world; + +import java.util.List; + +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.Entity; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +/** ExplosionEvent triggers when an explosion happens in the world.
    + *
    + * ExplosionEvent.Start is fired before the explosion actually occurs.
    + * ExplosionEvent.Detonate is fired once the explosion has a list of affected blocks and entities.
    + *
    + * ExplosionEvent.Start is {@link Cancelable}.
    + * ExplosionEvent.Detonate can modify the affected blocks and entities.
    + * Children do not use {@link HasResult}.
    + * Children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + */ +public class ExplosionEvent extends Event +{ + public final World world; + public final Explosion explosion; + + public ExplosionEvent(World world, Explosion explosion) + { + this.world = world; + this.explosion = explosion; + } + + /** ExplosionEvent.Start is fired before the explosion actually occurs. Canceling this event will stop the explosion.
    + *
    + * This event is {@link Cancelable}.
    + * This event does not use {@link HasResult}.
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + */ + @Cancelable + public static class Start extends ExplosionEvent + { + public Start(World world, Explosion explosion) + { + super(world, explosion); + } + } + + /** ExplosionEvent.Detonate is fired once the explosion has a list of affected blocks and entities. These lists can be modified to change the outcome.
    + *
    + * This event is not {@link Cancelable}.
    + * This event does not use {@link HasResult}.
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + */ + public static class Detonate extends ExplosionEvent + { + private final List entityList; + + public Detonate(World world, Explosion explosion, List entityList) + { + super(world, explosion); + this.entityList = entityList; + } + + /** return the list of blocks affected by the explosion. */ + public List getAffectedBlocks() + { + return explosion.affectedBlockPositions; + } + + /** return the list of entities affected by the explosion. */ + public List getAffectedEntities() + { + return entityList; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/NoteBlockEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/NoteBlockEvent.java new file mode 100644 index 0000000..6916ca0 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/NoteBlockEvent.java @@ -0,0 +1,165 @@ +package net.minecraftforge.event.world; + +import com.google.common.base.Preconditions; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** + * Base class for Noteblock Events + * + */ +public class NoteBlockEvent extends BlockEvent +{ + private int noteId; + + NoteBlockEvent(World world, int x, int y, int z, int meta, int note) + { + super(x, y, z, world, Blocks.noteblock, meta); + this.noteId = note; + } + + /** + * Get the Note the Noteblock is tuned to + * @return the Note + */ + public Note getNote() + { + return Note.fromId(noteId); + } + + /** + * Get the Octave of the note this Noteblock is tuned to + * @return the Octave + */ + public Octave getOctave() + { + return Octave.fromId(noteId); + } + + /** + * get the vanilla note-id, which contains information about both Note and Octave. Most modders should not need this. + * @return an ID for the note + */ + public int getVanillaNoteId() + { + return noteId; + } + + /** + * Set Note and Octave for this event.
    + * If octave is Octave.HIGH, note may only be Note.F_SHARP + * @param note the Note + * @param octave the Octave + */ + public void setNote(Note note, Octave octave) + { + Preconditions.checkArgument(octave != Octave.HIGH || note == Note.F_SHARP, "Octave.HIGH is only valid for Note.F_SHARP!"); + this.noteId = note.ordinal() + octave.ordinal() * 12; + } + + /** + * Fired when a Noteblock plays it's note. You can override the note and instrument + * Canceling this event will stop the note from playing. + */ + @Cancelable + public static class Play extends NoteBlockEvent + { + public Instrument instrument; + + public Play(World world, int x, int y, int z, int meta, int note, int instrument) + { + super(world, x, y, z, meta, note); + this.instrument = Instrument.fromId(instrument); + } + } + + /** + * Fired when a Noteblock is changed. You can adjust the note it will change to via {@link #setNote(Note, Octave)}. + * Canceling this event will not change the note and also stop the Noteblock from playing it's note. + */ + @Cancelable + public static class Change extends NoteBlockEvent + { + public final Note oldNote; + public final Octave oldOctave; + + public Change(World world, int x, int y, int z, int meta, int oldNote, int newNote) + { + super(world, x, y, z, meta, newNote); + this.oldNote = Note.fromId(oldNote); + this.oldOctave = Octave.fromId(oldNote); + } + } + + /** + * Describes the types of musical Instruments that can be played by a Noteblock. + * The Instrument being played can be overridden with {@link NoteBlockEvent.Play#setInstrument(Instrument)} + */ + public static enum Instrument + { + PIANO, + BASSDRUM, + SNARE, + CLICKS, + BASSGUITAR; + + // cache to avoid creating a new array every time + private static final Instrument[] values = values(); + + static Instrument fromId(int id) + { + return id < 0 || id > 4 ? PIANO : values[id]; + } + } + + /** + * Information about the pitch of a Noteblock note. + * For altered notes such as G-Sharp / A-Flat the Sharp variant is used here. + * + */ + public static enum Note + { + F_SHARP, + G, + G_SHARP, + A, + A_SHARP, + B, + C, + C_SHARP, + D, + D_SHARP, + E, + F; + + private static final Note[] values = values(); + + static Note fromId(int id) + { + return values[id % 12]; + } + } + + /** + * Describes the Octave of a Note being played by a Noteblock. + * Together with {@link Note} it fully describes the note. + * + */ + public static enum Octave + { + LOW, + MID, + HIGH; // only valid for F_SHARP + + static Octave fromId(int id) + { + return id < 12 ? LOW : id == 24 ? HIGH : MID; + } + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/event/world/WorldEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/WorldEvent.java new file mode 100644 index 0000000..a7ee21c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/event/world/WorldEvent.java @@ -0,0 +1,133 @@ +package net.minecraftforge.event.world; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.World; +import net.minecraft.world.WorldSettings; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +/** + * WorldEvent is fired when an event involving the world occurs.
    + * If a method utilizes this {@link Event} as its parameter, the method will + * receive every child event of this class.
    + *
    + * {@link #world} contains the World this event is occuring in.
    + *
    + * All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ +public class WorldEvent extends Event +{ + public final World world; + + public WorldEvent(World world) + { + this.world = world; + } + + /** + * WorldEvent.Load is fired when Minecraft loads a world.
    + * This event is fired when a world is loaded in + * WorldClient#WorldClient(NetHandlerPlayClient, WorldSettings, int, EnumDifficulty, Profiler), + * MinecraftServer#loadAllWorlds(String, String, long, WorldType, String), + * DimensionManager#initDimension(int), + * and ForgeInternalHandler#onDimensionLoad(Load).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Load extends WorldEvent + { + public Load(World world) { super(world); } + } + + /** + * WorldEvent.Unload is fired when Minecraft unloads a world.
    + * This event is fired when a world is unloaded in + * Minecraft#loadWorld(WorldClient, String), + * MinecraftServer#deleteWorldAndStopServer(), + * MinecraftServer#stopServer(), + * DimensionManager#unloadWorlds(Hashtable), + * ForgeInternalHandler#onDimensionUnload(Unload).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Unload extends WorldEvent + { + public Unload(World world) { super(world); } + } + + /** + * WorldEvent.Save is fired when Minecraft saves a world.
    + * This event is fired when a world is saved in + * WorldServer#saveAllChunks(boolean, IProgressUpdate), + * ForgeInternalHandler#onDimensionSave(Save).
    + *
    + * This event is not {@link Cancelable}.
    + *
    + * This event does not have a result. {@link HasResult}
    + *
    + * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
    + **/ + public static class Save extends WorldEvent + { + public Save(World world) { super(world); } + } + + /** + * Called by WorldServer to gather a list of all possible entities that can spawn at the specified location. + * Canceling the event will result in a empty list, meaning no entity will be spawned. + */ + @Cancelable + public static class PotentialSpawns extends WorldEvent + { + public final EnumCreatureType type; + public final int x; + public final int y; + public final int z; + public final List list; + + public PotentialSpawns(World world, EnumCreatureType type, int x, int y, int z, List oldList) + { + super(world); + this.x = x; + this.y = y; + this.z = z; + this.type = type; + if (oldList != null) + { + this.list = oldList; + } + else + { + this.list = new ArrayList(); + } + } + } + + /** + * Called by WorldServer when it attempts to create a spawnpoint for a dimension. + * Canceling the event will prevent the vanilla code from running. + */ + @Cancelable + public static class CreateSpawnPosition extends WorldEvent + { + public final WorldSettings settings; + public CreateSpawnPosition(World world, WorldSettings ws) + { + super(world); + this.settings = ws; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidBase.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidBase.java new file mode 100644 index 0000000..28af01f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidBase.java @@ -0,0 +1,532 @@ +package net.minecraftforge.fluids; + +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +import com.google.common.collect.Maps; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** + * This is a base implementation for Fluid blocks. + * + * It is highly recommended that you extend this class or one of the Forge-provided child classes. + * + * @author King Lemming, OvermindDL1 + * + */ +public abstract class BlockFluidBase extends Block implements IFluidBlock +{ + protected final static Map defaultDisplacements = Maps.newHashMap(); + + static + { + defaultDisplacements.put(Blocks.wooden_door, false); + defaultDisplacements.put(Blocks.iron_door, false); + defaultDisplacements.put(Blocks.standing_sign, false); + defaultDisplacements.put(Blocks.wall_sign, false); + defaultDisplacements.put(Blocks.reeds, false); + } + protected Map displacements = Maps.newHashMap(); + + protected int quantaPerBlock = 8; + protected float quantaPerBlockFloat = 8F; + protected int density = 1; + protected int densityDir = -1; + protected int temperature = 300; + + protected int tickRate = 20; + protected int renderPass = 1; + protected int maxScaledLight = 0; + + protected final String fluidName; + + /** + * This is the fluid used in the constructor. Use this reference to configure things + * like icons for your block. It might not be active in the registry, so do + * NOT expose it. + */ + protected final Fluid definedFluid; + + public BlockFluidBase(Fluid fluid, Material material) + { + super(material); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setTickRandomly(true); + this.disableStats(); + + this.fluidName = fluid.getName(); + this.density = fluid.density; + this.temperature = fluid.temperature; + this.maxScaledLight = fluid.luminosity; + this.tickRate = fluid.viscosity / 200; + this.densityDir = fluid.density > 0 ? -1 : 1; + fluid.setBlock(this); + + this.definedFluid = fluid; + displacements.putAll(defaultDisplacements); + } + + public BlockFluidBase setQuantaPerBlock(int quantaPerBlock) + { + if (quantaPerBlock > 16 || quantaPerBlock < 1) quantaPerBlock = 8; + this.quantaPerBlock = quantaPerBlock; + this.quantaPerBlockFloat = quantaPerBlock; + return this; + } + + public BlockFluidBase setDensity(int density) + { + if (density == 0) density = 1; + this.density = density; + this.densityDir = density > 0 ? -1 : 1; + return this; + } + + public BlockFluidBase setTemperature(int temperature) + { + this.temperature = temperature; + return this; + } + + public BlockFluidBase setTickRate(int tickRate) + { + if (tickRate <= 0) tickRate = 20; + this.tickRate = tickRate; + return this; + } + + public BlockFluidBase setRenderPass(int renderPass) + { + this.renderPass = renderPass; + return this; + } + + public BlockFluidBase setMaxScaledLight(int maxScaledLight) + { + this.maxScaledLight = maxScaledLight; + return this; + } + + /** + * Returns true if the block at (x, y, z) is displaceable. Does not displace the block. + */ + public boolean canDisplace(IBlockAccess world, int x, int y, int z) + { + if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true; + + Block block = world.getBlock(x, y, z); + + if (block == this) + { + return false; + } + + if (displacements.containsKey(block)) + { + return displacements.get(block); + } + + Material material = block.getMaterial(); + if (material.blocksMovement() || material == Material.portal) + { + return false; + } + + int density = getDensity(world, x, y, z); + if (density == Integer.MAX_VALUE) + { + return true; + } + + if (this.density > density) + { + return true; + } + else + { + return false; + } + } + + /** + * Attempt to displace the block at (x, y, z), return true if it was displaced. + */ + public boolean displaceIfPossible(World world, int x, int y, int z) + { + if (world.getBlock(x, y, z).isAir(world, x, y, z)) + { + return true; + } + + Block block = world.getBlock(x, y, z); + if (block == this) + { + return false; + } + + if (displacements.containsKey(block)) + { + if (displacements.get(block)) + { + block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + return true; + } + return false; + } + + Material material = block.getMaterial(); + if (material.blocksMovement() || material == Material.portal) + { + return false; + } + + int density = getDensity(world, x, y, z); + if (density == Integer.MAX_VALUE) + { + block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + return true; + } + + if (this.density > density) + { + return true; + } + else + { + return false; + } + } + + public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z); + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + @Override + public abstract boolean canCollideCheck(int meta, boolean fullHit); + + public abstract int getMaxRenderHeightMeta(); + + /* BLOCK FUNCTIONS */ + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + @Override + public void onBlockAdded(World world, int x, int y, int z) + { + world.scheduleBlockUpdate(x, y, z, this, tickRate); + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor Block + */ + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + world.scheduleBlockUpdate(x, y, z, this, tickRate); + } + + // Used to prevent updates on chunk generation + @Override + public boolean func_149698_L() + { + return false; + } + + /** + * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z + */ + @Override + public boolean canPlaceBlockAt(World world, int x, int y, int z) + { + return canDisplace(world, x, y, z); + } + + @Override + public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) + { + return true; + } + + /** + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) + */ + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) + { + return null; + } + + @Override + public Item getItemDropped(int par1, Random par2Random, int par3) + { + return null; + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + @Override + public int quantityDropped(Random par1Random) + { + return 0; + } + + /** + * How many world ticks before ticking + */ + @Override + public int tickRate(World world) + { + return tickRate; + } + + /** + * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d + */ + @Override + public void velocityToAddToEntity(World world, int x, int y, int z, Entity entity, Vec3 vec) + { + if (densityDir > 0) return; + Vec3 vec_flow = this.getFlowVector(world, x, y, z); + vec.xCoord += vec_flow.xCoord * (quantaPerBlock * 4); + vec.yCoord += vec_flow.yCoord * (quantaPerBlock * 4); + vec.zCoord += vec_flow.zCoord * (quantaPerBlock * 4); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + if (maxScaledLight == 0) + { + return super.getLightValue(world, x, y, z); + } + int data = world.getBlockMetadata(x, y, z); + return (int) (data / quantaPerBlockFloat * maxScaledLight); + } + + /** + * The type of render function that is called for this block + */ + @Override + public int getRenderType() + { + return FluidRegistry.renderIdFluid; + } + + /** + * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. + */ + @Override + public boolean isOpaqueCube() + { + return false; + } + + /** + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) + */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + /* Never used...? + @Override + public float getBlockBrightness(World world, int x, int y, int z) + { + float lightThis = world.getLightBrightness(x, y, z); + float lightUp = world.getLightBrightness(x, y + 1, z); + return lightThis > lightUp ? lightThis : lightUp; + } + */ + + /** + * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z + */ + @Override + public int getMixedBrightnessForBlock(IBlockAccess world, int x, int y, int z) + { + int lightThis = world.getLightBrightnessForSkyBlocks(x, y, z, 0); + int lightUp = world.getLightBrightnessForSkyBlocks(x, y + 1, z, 0); + int lightThisBase = lightThis & 255; + int lightUpBase = lightUp & 255; + int lightThisExt = lightThis >> 16 & 255; + int lightUpExt = lightUp >> 16 & 255; + return (lightThisBase > lightUpBase ? lightThisBase : lightUpBase) | + ((lightThisExt > lightUpExt ? lightThisExt : lightUpExt) << 16); + } + + /** + * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha + */ + @Override + public int getRenderBlockPass() + { + return renderPass; + } + + /** + * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given + * coordinates. Args: blockAccess, x, y, z, side + */ + @Override + public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) + { + Block block = world.getBlock(x, y, z); + if (block != this) + { + return !block.isOpaqueCube(); + } + return block.getMaterial() == this.getMaterial() ? false : super.shouldSideBeRendered(world, x, y, z, side); + } + + /* FLUID FUNCTIONS */ + public static final int getDensity(IBlockAccess world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + if (!(block instanceof BlockFluidBase)) + { + return Integer.MAX_VALUE; + } + return ((BlockFluidBase)block).density; + } + + public static final int getTemperature(IBlockAccess world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + if (!(block instanceof BlockFluidBase)) + { + return Integer.MAX_VALUE; + } + return ((BlockFluidBase)block).temperature; + } + + public static double getFlowDirection(IBlockAccess world, int x, int y, int z) + { + Block block = world.getBlock(x, y, z); + if (!block.getMaterial().isLiquid()) + { + return -1000.0; + } + Vec3 vec = ((BlockFluidBase) block).getFlowVector(world, x, y, z); + return vec.xCoord == 0.0D && vec.zCoord == 0.0D ? -1000.0D : Math.atan2(vec.zCoord, vec.xCoord) - Math.PI / 2D; + } + + public final int getQuantaValueBelow(IBlockAccess world, int x, int y, int z, int belowThis) + { + int quantaRemaining = getQuantaValue(world, x, y, z); + if (quantaRemaining >= belowThis) + { + return -1; + } + return quantaRemaining; + } + + public final int getQuantaValueAbove(IBlockAccess world, int x, int y, int z, int aboveThis) + { + int quantaRemaining = getQuantaValue(world, x, y, z); + if (quantaRemaining <= aboveThis) + { + return -1; + } + return quantaRemaining; + } + + public final float getQuantaPercentage(IBlockAccess world, int x, int y, int z) + { + int quantaRemaining = getQuantaValue(world, x, y, z); + return quantaRemaining / quantaPerBlockFloat; + } + + public Vec3 getFlowVector(IBlockAccess world, int x, int y, int z) + { + Vec3 vec = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + int decay = quantaPerBlock - getQuantaValue(world, x, y, z); + + for (int side = 0; side < 4; ++side) + { + int x2 = x; + int z2 = z; + + switch (side) + { + case 0: --x2; break; + case 1: --z2; break; + case 2: ++x2; break; + case 3: ++z2; break; + } + + int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2); + if (otherDecay >= quantaPerBlock) + { + if (!world.getBlock(x2, y, z2).getMaterial().blocksMovement()) + { + otherDecay = quantaPerBlock - getQuantaValue(world, x2, y - 1, z2); + if (otherDecay >= 0) + { + int power = otherDecay - (decay - quantaPerBlock); + vec = vec.addVector((x2 - x) * power, (y - y) * power, (z2 - z) * power); + } + } + } + else if (otherDecay >= 0) + { + int power = otherDecay - decay; + vec = vec.addVector((x2 - x) * power, (y - y) * power, (z2 - z) * power); + } + } + + if (world.getBlock(x, y + 1, z) == this) + { + boolean flag = + isBlockSolid(world, x, y, z - 1, 2) || + isBlockSolid(world, x, y, z + 1, 3) || + isBlockSolid(world, x - 1, y, z, 4) || + isBlockSolid(world, x + 1, y, z, 5) || + isBlockSolid(world, x, y + 1, z - 1, 2) || + isBlockSolid(world, x, y + 1, z + 1, 3) || + isBlockSolid(world, x - 1, y + 1, z, 4) || + isBlockSolid(world, x + 1, y + 1, z, 5); + + if (flag) + { + vec = vec.normalize().addVector(0.0D, -6.0D, 0.0D); + } + } + vec = vec.normalize(); + return vec; + } + + /* IFluidBlock */ + @Override + public Fluid getFluid() + { + return FluidRegistry.getFluid(fluidName); + } + + @Override + public float getFilledPercentage(World world, int x, int y, int z) + { + int quantaRemaining = getQuantaValue(world, x, y, z) + 1; + float remaining = quantaRemaining / quantaPerBlockFloat; + if (remaining > 1) remaining = 1.0f; + return remaining * (density > 0 ? 1 : -1); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidClassic.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidClassic.java new file mode 100644 index 0000000..117d0a4 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidClassic.java @@ -0,0 +1,362 @@ +package net.minecraftforge.fluids; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** + * This is a fluid block implementation which emulates vanilla Minecraft fluid behavior. + * + * It is highly recommended that you use/extend this class for "classic" fluid blocks. + * + * @author King Lemming + * + */ +public class BlockFluidClassic extends BlockFluidBase +{ + protected boolean[] isOptimalFlowDirection = new boolean[4]; + protected int[] flowCost = new int[4]; + + protected FluidStack stack; + public BlockFluidClassic(Fluid fluid, Material material) + { + super(fluid, material); + stack = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME); + } + + public BlockFluidClassic setFluidStack(FluidStack stack) + { + this.stack = stack; + return this; + } + + public BlockFluidClassic setFluidStackAmount(int amount) + { + this.stack.amount = amount; + return this; + } + + @Override + public int getQuantaValue(IBlockAccess world, int x, int y, int z) + { + if (world.getBlock(x, y, z) == Blocks.air) + { + return 0; + } + + if (world.getBlock(x, y, z) != this) + { + return -1; + } + + int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z); + return quantaRemaining; + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + @Override + public boolean canCollideCheck(int meta, boolean fullHit) + { + return fullHit && meta == 0; + } + + @Override + public int getMaxRenderHeightMeta() + { + return 0; + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + if (maxScaledLight == 0) + { + return super.getLightValue(world, x, y, z); + } + int data = quantaPerBlock - world.getBlockMetadata(x, y, z) - 1; + return (int) (data / quantaPerBlockFloat * maxScaledLight); + } + + /** + * Ticks the block if it's been scheduled + */ + @Override + public void updateTick(World world, int x, int y, int z, Random rand) + { + int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z); + int expQuanta = -101; + + // check adjacent block levels if non-source + if (quantaRemaining < quantaPerBlock) + { + int y2 = y - densityDir; + + if (world.getBlock(x, y2, z ) == this || + world.getBlock(x - 1, y2, z ) == this || + world.getBlock(x + 1, y2, z ) == this || + world.getBlock(x, y2, z - 1) == this || + world.getBlock(x, y2, z + 1) == this) + { + expQuanta = quantaPerBlock - 1; + } + else + { + int maxQuanta = -100; + maxQuanta = getLargerQuanta(world, x - 1, y, z, maxQuanta); + maxQuanta = getLargerQuanta(world, x + 1, y, z, maxQuanta); + maxQuanta = getLargerQuanta(world, x, y, z - 1, maxQuanta); + maxQuanta = getLargerQuanta(world, x, y, z + 1, maxQuanta); + + expQuanta = maxQuanta - 1; + } + + // decay calculation + if (expQuanta != quantaRemaining) + { + quantaRemaining = expQuanta; + + if (expQuanta <= 0) + { + world.setBlock(x, y, z, Blocks.air); + } + else + { + world.setBlockMetadataWithNotify(x, y, z, quantaPerBlock - expQuanta, 3); + world.scheduleBlockUpdate(x, y, z, this, tickRate); + world.notifyBlocksOfNeighborChange(x, y, z, this); + } + } + } + // This is a "source" block, set meta to zero, and send a server only update + else if (quantaRemaining >= quantaPerBlock) + { + world.setBlockMetadataWithNotify(x, y, z, 0, 2); + } + + // Flow vertically if possible + if (canDisplace(world, x, y + densityDir, z)) + { + flowIntoBlock(world, x, y + densityDir, z, 1); + return; + } + + // Flow outward if possible + int flowMeta = quantaPerBlock - quantaRemaining + 1; + if (flowMeta >= quantaPerBlock) + { + return; + } + + if (isSourceBlock(world, x, y, z) || !isFlowingVertically(world, x, y, z)) + { + if (world.getBlock(x, y - densityDir, z) == this) + { + flowMeta = 1; + } + boolean flowTo[] = getOptimalFlowDirections(world, x, y, z); + + if (flowTo[0]) flowIntoBlock(world, x - 1, y, z, flowMeta); + if (flowTo[1]) flowIntoBlock(world, x + 1, y, z, flowMeta); + if (flowTo[2]) flowIntoBlock(world, x, y, z - 1, flowMeta); + if (flowTo[3]) flowIntoBlock(world, x, y, z + 1, flowMeta); + } + } + + public boolean isFlowingVertically(IBlockAccess world, int x, int y, int z) + { + return world.getBlock(x, y + densityDir, z) == this || + (world.getBlock(x, y, z) == this && canFlowInto(world, x, y + densityDir, z)); + } + + public boolean isSourceBlock(IBlockAccess world, int x, int y, int z) + { + return world.getBlock(x, y, z) == this && world.getBlockMetadata(x, y, z) == 0; + } + + protected boolean[] getOptimalFlowDirections(World world, int x, int y, int z) + { + for (int side = 0; side < 4; side++) + { + flowCost[side] = 1000; + + int x2 = x; + int y2 = y; + int z2 = z; + + switch (side) + { + case 0: --x2; break; + case 1: ++x2; break; + case 2: --z2; break; + case 3: ++z2; break; + } + + if (!canFlowInto(world, x2, y2, z2) || isSourceBlock(world, x2, y2, z2)) + { + continue; + } + + if (canFlowInto(world, x2, y2 + densityDir, z2)) + { + flowCost[side] = 0; + } + else + { + flowCost[side] = calculateFlowCost(world, x2, y2, z2, 1, side); + } + } + + int min = flowCost[0]; + for (int side = 1; side < 4; side++) + { + if (flowCost[side] < min) + { + min = flowCost[side]; + } + } + for (int side = 0; side < 4; side++) + { + isOptimalFlowDirection[side] = flowCost[side] == min; + } + return isOptimalFlowDirection; + } + + protected int calculateFlowCost(World world, int x, int y, int z, int recurseDepth, int side) + { + int cost = 1000; + for (int adjSide = 0; adjSide < 4; adjSide++) + { + if ((adjSide == 0 && side == 1) || + (adjSide == 1 && side == 0) || + (adjSide == 2 && side == 3) || + (adjSide == 3 && side == 2)) + { + continue; + } + + int x2 = x; + int y2 = y; + int z2 = z; + + switch (adjSide) + { + case 0: --x2; break; + case 1: ++x2; break; + case 2: --z2; break; + case 3: ++z2; break; + } + + if (!canFlowInto(world, x2, y2, z2) || isSourceBlock(world, x2, y2, z2)) + { + continue; + } + + if (canFlowInto(world, x2, y2 + densityDir, z2)) + { + return recurseDepth; + } + + if (recurseDepth >= 4) + { + continue; + } + + int min = calculateFlowCost(world, x2, y2, z2, recurseDepth + 1, adjSide); + if (min < cost) + { + cost = min; + } + } + return cost; + } + + protected void flowIntoBlock(World world, int x, int y, int z, int meta) + { + if (meta < 0) return; + if (displaceIfPossible(world, x, y, z)) + { + world.setBlock(x, y, z, this, meta, 3); + } + } + + protected boolean canFlowInto(IBlockAccess world, int x, int y, int z) + { + if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true; + + Block block = world.getBlock(x, y, z); + if (block == this) + { + return true; + } + + if (displacements.containsKey(block)) + { + return displacements.get(block); + } + + Material material = block.getMaterial(); + if (material.blocksMovement() || + material == Material.water || + material == Material.lava || + material == Material.portal) + { + return false; + } + + int density = getDensity(world, x, y, z); + if (density == Integer.MAX_VALUE) + { + return true; + } + + if (this.density > density) + { + return true; + } + else + { + return false; + } + } + + protected int getLargerQuanta(IBlockAccess world, int x, int y, int z, int compare) + { + int quantaRemaining = getQuantaValue(world, x, y, z); + if (quantaRemaining <= 0) + { + return compare; + } + return quantaRemaining >= compare ? quantaRemaining : compare; + } + + /* IFluidBlock */ + @Override + public FluidStack drain(World world, int x, int y, int z, boolean doDrain) + { + if (!isSourceBlock(world, x, y, z)) + { + return null; + } + + if (doDrain) + { + world.setBlock(x, y, z, Blocks.air); + } + + return stack.copy(); + } + + @Override + public boolean canDrain(World world, int x, int y, int z) + { + return isSourceBlock(world, x, y, z); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidFinite.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidFinite.java new file mode 100644 index 0000000..c0eca93 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/BlockFluidFinite.java @@ -0,0 +1,336 @@ + +package net.minecraftforge.fluids; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** + * This is a cellular-automata based finite fluid block implementation. + * + * It is highly recommended that you use/extend this class for finite fluid blocks. + * + * @author OvermindDL1, KingLemming + * + */ +public class BlockFluidFinite extends BlockFluidBase +{ + public BlockFluidFinite(Fluid fluid, Material material) + { + super(fluid, material); + } + + @Override + public int getQuantaValue(IBlockAccess world, int x, int y, int z) + { + if (world.getBlock(x, y, z).isAir(world, x, y, z)) + { + return 0; + } + + if (world.getBlock(x, y, z) != this) + { + return -1; + } + + int quantaRemaining = world.getBlockMetadata(x, y, z) + 1; + return quantaRemaining; + } + + /** + * Returns whether this block is collideable based on the arguments passed in + * @param par1 block metaData + * @param par2 whether the player right-clicked while holding a boat + */ + @Override + public boolean canCollideCheck(int meta, boolean fullHit) + { + return fullHit && meta == quantaPerBlock - 1; + } + + @Override + public int getMaxRenderHeightMeta() + { + return quantaPerBlock - 1; + } + + /** + * Ticks the block if it's been scheduled + */ + @Override + public void updateTick(World world, int x, int y, int z, Random rand) + { + boolean changed = false; + int quantaRemaining = world.getBlockMetadata(x, y, z) + 1; + + // Flow vertically if possible + int prevRemaining = quantaRemaining; + quantaRemaining = tryToFlowVerticallyInto(world, x, y, z, quantaRemaining); + + if (quantaRemaining < 1) + { + return; + } + else if (quantaRemaining != prevRemaining) + { + changed = true; + if (quantaRemaining == 1) + { + world.setBlockMetadataWithNotify(x, y, z, quantaRemaining - 1, 2); + return; + } + } + else if (quantaRemaining == 1) + { + return; + } + + // Flow out if possible + int lowerthan = quantaRemaining - 1; + if (displaceIfPossible(world, x, y, z - 1)) world.setBlock(x, y, z - 1, Blocks.air); + if (displaceIfPossible(world, x, y, z + 1)) world.setBlock(x, y, z + 1, Blocks.air); + if (displaceIfPossible(world, x - 1, y, z )) world.setBlock(x - 1, y, z, Blocks.air); + if (displaceIfPossible(world, x + 1, y, z )) world.setBlock(x + 1, y, z, Blocks.air); + int north = getQuantaValueBelow(world, x, y, z - 1, lowerthan); + int south = getQuantaValueBelow(world, x, y, z + 1, lowerthan); + int west = getQuantaValueBelow(world, x - 1, y, z, lowerthan); + int east = getQuantaValueBelow(world, x + 1, y, z, lowerthan); + int total = quantaRemaining; + int count = 1; + + if (north >= 0) + { + count++; + total += north; + } + + if (south >= 0) + { + count++; + total += south; + } + + if (west >= 0) + { + count++; + total += west; + } + + if (east >= 0) + { + ++count; + total += east; + } + + if (count == 1) + { + if (changed) + { + world.setBlockMetadataWithNotify(x, y, z, quantaRemaining - 1, 2); + } + return; + } + + int each = total / count; + int rem = total % count; + if (north >= 0) + { + int newnorth = each; + if (rem == count || rem > 1 && rand.nextInt(count - rem) != 0) + { + ++newnorth; + --rem; + } + + if (newnorth != north) + { + if (newnorth == 0) + { + world.setBlock(x, y, z - 1, Blocks.air); + } + else + { + world.setBlock(x, y, z - 1, this, newnorth - 1, 2); + } + world.scheduleBlockUpdate(x, y, z - 1, this, tickRate); + } + --count; + } + + if (south >= 0) + { + int newsouth = each; + if (rem == count || rem > 1 && rand.nextInt(count - rem) != 0) + { + ++newsouth; + --rem; + } + + if (newsouth != south) + { + if (newsouth == 0) + { + world.setBlock(x, y, z + 1, Blocks.air); + } + else + { + world.setBlock(x, y, z + 1, this, newsouth - 1, 2); + } + world.scheduleBlockUpdate(x, y, z + 1, this, tickRate); + } + --count; + } + + if (west >= 0) + { + int newwest = each; + if (rem == count || rem > 1 && rand.nextInt(count - rem) != 0) + { + ++newwest; + --rem; + } + if (newwest != west) + { + if (newwest == 0) + { + world.setBlock(x - 1, y, z, Blocks.air); + } + else + { + world.setBlock(x - 1, y, z, this, newwest - 1, 2); + } + world.scheduleBlockUpdate(x - 1, y, z, this, tickRate); + } + --count; + } + + if (east >= 0) + { + int neweast = each; + if (rem == count || rem > 1 && rand.nextInt(count - rem) != 0) + { + ++neweast; + --rem; + } + + if (neweast != east) + { + if (neweast == 0) + { + world.setBlock(x + 1, y, z, Blocks.air); + } + else + { + world.setBlock(x + 1, y, z, this, neweast - 1, 2); + } + world.scheduleBlockUpdate(x + 1, y, z, this, tickRate); + } + --count; + } + + if (rem > 0) + { + ++each; + } + world.setBlockMetadataWithNotify(x, y, z, each - 1, 2); + } + + public int tryToFlowVerticallyInto(World world, int x, int y, int z, int amtToInput) + { + int otherY = y + densityDir; + if (otherY < 0 || otherY >= world.getHeight()) + { + world.setBlock(x, y, z, Blocks.air); + return 0; + } + + int amt = getQuantaValueBelow(world, x, otherY, z, quantaPerBlock); + if (amt >= 0) + { + amt += amtToInput; + if (amt > quantaPerBlock) + { + world.setBlock(x, otherY, z, this, quantaPerBlock - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + return amt - quantaPerBlock; + } + else if (amt > 0) + { + world.setBlock(x, otherY, z, this, amt - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.setBlock(x, y, z, Blocks.air); + return 0; + } + return amtToInput; + } + else + { + int density_other = getDensity(world, x, otherY, z); + if (density_other == Integer.MAX_VALUE) + { + if (displaceIfPossible(world, x, otherY, z)) + { + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.setBlock(x, y, z, Blocks.air); + return 0; + } + else + { + return amtToInput; + } + } + + if (densityDir < 0) + { + if (density_other < density) // then swap + { + BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z); + int otherData = world.getBlockMetadata(x, otherY, z); + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.setBlock(x, y, z, block, otherData, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world)); + return 0; + } + } + else + { + if (density_other > density) + { + BlockFluidBase block = (BlockFluidBase)world.getBlock(x, otherY, z); + int otherData = world.getBlockMetadata(x, otherY, z); + world.setBlock(x, otherY, z, this, amtToInput - 1, 3); + world.setBlock(x, y, z, block, otherData, 3); + world.scheduleBlockUpdate(x, otherY, z, this, tickRate); + world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world)); + return 0; + } + } + return amtToInput; + } + } + + /* IFluidBlock */ + @Override + public FluidStack drain(World world, int x, int y, int z, boolean doDrain) + { + if (doDrain) + { + world.setBlock(x, y, z, Blocks.air); + } + + return new FluidStack(getFluid(), + MathHelper.floor_float(getQuantaPercentage(world, x, y, z) * FluidContainerRegistry.BUCKET_VOLUME)); + } + + @Override + public boolean canDrain(World world, int x, int y, int z) + { + return true; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/Fluid.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/Fluid.java new file mode 100644 index 0000000..da1d610 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/Fluid.java @@ -0,0 +1,318 @@ +package net.minecraftforge.fluids; + +import java.util.Locale; +import java.util.Map; + +import com.google.common.collect.Maps; + +import net.minecraft.block.Block; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeModContainer; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.LoaderException; +import net.minecraft.item.EnumRarity; + +/** + * Minecraft Forge Fluid Implementation + * + * This class is a fluid (liquid or gas) equivalent to "Item." It describes the nature of a fluid + * and contains its general properties. + * + * These properties do not have inherent gameplay mechanics - they are provided so that mods may + * choose to take advantage of them. + * + * Fluid implementations are not required to actively use these properties, nor are objects + * interfacing with fluids required to make use of them, but it is encouraged. + * + * The default values can be used as a reference point for mods adding fluids such as oil or heavy + * water. + * + * @author King Lemming + * + */ +public class Fluid +{ + /** The unique identification name for this fluid. */ + protected final String fluidName; + + /** The unlocalized name of this fluid. */ + protected String unlocalizedName; + + /** The Icons for this fluid. */ + protected IIcon stillIcon; + protected IIcon flowingIcon; + + /** + * The light level emitted by this fluid. + * + * Default value is 0, as most fluids do not actively emit light. + */ + protected int luminosity = 0; + + /** + * Density of the fluid - completely arbitrary; negative density indicates that the fluid is + * lighter than air. + * + * Default value is approximately the real-life density of water in kg/m^3. + */ + protected int density = 1000; + + /** + * Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is + * hotter than air. + * + * Default value is approximately the real-life room temperature of water in degrees Kelvin. + */ + protected int temperature = 300; + + /** + * Viscosity ("thickness") of the fluid - completely arbitrary; negative values are not + * permissible. + * + * Default value is approximately the real-life density of water in m/s^2 (x10^-3). + * + * Higher viscosity means that a fluid flows more slowly, like molasses. + * Lower viscosity means that a fluid flows more quickly, like helium. + * + */ + protected int viscosity = 1000; + + /** + * This indicates if the fluid is gaseous. + * + * Useful for rendering the fluid in containers and the world. + * + * Generally this is associated with negative density fluids. + */ + protected boolean isGaseous; + + /** + * The rarity of the fluid. + * + * Used primarily in tool tips. + */ + protected EnumRarity rarity = EnumRarity.common; + + /** + * If there is a Block implementation of the Fluid, the Block is linked here. + * + * The default value of null should remain for any Fluid without a Block implementation. + */ + protected Block block = null; + + public Fluid(String fluidName) + { + this.fluidName = fluidName.toLowerCase(Locale.ENGLISH); + this.unlocalizedName = fluidName; + } + + public Fluid setUnlocalizedName(String unlocalizedName) + { + this.unlocalizedName = unlocalizedName; + return this; + } + + public Fluid setBlock(Block block) + { + if (this.block == null || this.block == block) + { + this.block = block; + } + else + { + FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to the Block " + + this.block + ". You may have duplicate Fluid Blocks as a result. It *may* be possible to configure your mods to avoid this."); + } + return this; + } + + public Fluid setLuminosity(int luminosity) + { + this.luminosity = luminosity; + return this; + } + + public Fluid setDensity(int density) + { + this.density = density; + return this; + } + + public Fluid setTemperature(int temperature) + { + this.temperature = temperature; + return this; + } + + public Fluid setViscosity(int viscosity) + { + this.viscosity = viscosity; + return this; + } + + public Fluid setGaseous(boolean isGaseous) + { + this.isGaseous = isGaseous; + return this; + } + + public Fluid setRarity(EnumRarity rarity) + { + this.rarity = rarity; + return this; + } + + public final String getName() + { + return this.fluidName; + } + + public final int getID() + { + return FluidRegistry.getFluidID(this.fluidName); + } + + public final Block getBlock() + { + return block; + } + + public final boolean canBePlacedInWorld() + { + return block != null; + } + + /** + * Returns the localized name of this fluid. + */ + public String getLocalizedName(FluidStack stack) + { + return getLocalizedName(); + } + + /** + * Use the FluidStack sensitive version above + */ + @Deprecated + public String getLocalizedName() + { + String s = this.getUnlocalizedName(); + return s == null ? "" : StatCollector.translateToLocal(s); + } + + /** + * A FluidStack sensitive version of getUnlocalizedName + */ + public String getUnlocalizedName(FluidStack stack) + { + return this.getUnlocalizedName(); + } + + /** + * Returns the unlocalized name of this fluid. + */ + public String getUnlocalizedName() + { + return "fluid." + this.unlocalizedName; + } + + /** + * Returns 0 for "/terrain.png". ALL FLUID TEXTURES MUST BE ON THIS SHEET. + */ + public final int getSpriteNumber() + { + return 0; + } + + /* Default Accessors */ + public final int getLuminosity() + { + return this.luminosity; + } + + public final int getDensity() + { + return this.density; + } + + public final int getTemperature() + { + return this.temperature; + } + + public final int getViscosity() + { + return this.viscosity; + } + + public final boolean isGaseous() + { + return this.isGaseous; + } + + public EnumRarity getRarity() + { + return rarity; + } + + public int getColor() + { + return 0xFFFFFF; + } + + public final Fluid setStillIcon(IIcon stillIcon) + { + this.stillIcon = stillIcon; + return this; + } + + public final Fluid setFlowingIcon(IIcon flowingIcon) + { + this.flowingIcon = flowingIcon; + return this; + } + + public final Fluid setIcons(IIcon stillIcon, IIcon flowingIcon) + { + return this.setStillIcon(stillIcon).setFlowingIcon(flowingIcon); + } + + public final Fluid setIcons(IIcon commonIcon) + { + return this.setStillIcon(commonIcon).setFlowingIcon(commonIcon); + } + + public IIcon getIcon(){ return getStillIcon(); } + + public IIcon getStillIcon() + { + return this.stillIcon; + } + + public IIcon getFlowingIcon() + { + return this.flowingIcon; + } + + /* Stack-based Accessors */ + public int getLuminosity(FluidStack stack){ return getLuminosity(); } + public int getDensity(FluidStack stack){ return getDensity(); } + public int getTemperature(FluidStack stack){ return getTemperature(); } + public int getViscosity(FluidStack stack){ return getViscosity(); } + public boolean isGaseous(FluidStack stack){ return isGaseous(); } + public EnumRarity getRarity(FluidStack stack){ return getRarity(); } + public int getColor(FluidStack stack){ return getColor(); } + public IIcon getIcon(FluidStack stack){ return getIcon(); } + /* World-based Accessors */ + public int getLuminosity(World world, int x, int y, int z){ return getLuminosity(); } + public int getDensity(World world, int x, int y, int z){ return getDensity(); } + public int getTemperature(World world, int x, int y, int z){ return getTemperature(); } + public int getViscosity(World world, int x, int y, int z){ return getViscosity(); } + public boolean isGaseous(World world, int x, int y, int z){ return isGaseous(); } + public EnumRarity getRarity(World world, int x, int y, int z){ return getRarity(); } + public int getColor(World world, int x, int y, int z){ return getColor(); } + public IIcon getIcon(World world, int x, int y, int z){ return getIcon(); } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidContainerRegistry.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidContainerRegistry.java new file mode 100644 index 0000000..c19fb22 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidContainerRegistry.java @@ -0,0 +1,400 @@ + +package net.minecraftforge.fluids; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; + +/** + * Register simple items that contain fluids here. Useful for buckets, bottles, and things that have + * ID/metadata mappings. + * + * For more complex items, use {@link IFluidContainerItem} instead. + * + * @author King Lemming + * + */ +public abstract class FluidContainerRegistry +{ + // Holder object that implements HashCode for an ItemStack, + // the local maps are not guaranteed to have the same internal generic structure, + // but the external interface for checking ItemStacks will still exist. + private static class ContainerKey + { + ItemStack container; + FluidStack stack; + private ContainerKey(ItemStack container) + { + this.container = container; + } + private ContainerKey(ItemStack container, FluidStack stack) + { + this(container); + this.stack = stack; + } + @Override + public int hashCode() + { + int code = 1; + code = 31*code + container.getItem().hashCode(); + code = 31*code + container.getItemDamage(); + if (stack != null) + code = 31*code + stack.getFluid().hashCode(); + return code; + } + @Override + public boolean equals(Object o) + { + if (!(o instanceof ContainerKey)) return false; + ContainerKey ck = (ContainerKey)o; + if (container.getItem() != ck.container.getItem()) return false; + if (container.getItemDamage() != ck.container.getItemDamage()) return false; + if (stack == null && ck.stack != null) return false; + if (stack != null && ck.stack == null) return false; + if (stack == null && ck.stack == null) return true; + if (stack.getFluid() != ck.stack.getFluid()) return false; + return true; + } + } + + private static Map containerFluidMap = Maps.newHashMap(); + private static Map filledContainerMap = Maps.newHashMap(); + private static Set emptyContainers = Sets.newHashSet(); + + public static final int BUCKET_VOLUME = 1000; + public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.bucket); + public static final ItemStack EMPTY_BOTTLE = new ItemStack(Items.glass_bottle); + private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Items.bucket); + + static + { + registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.water_bucket), EMPTY_BUCKET); + registerFluidContainer(FluidRegistry.LAVA, new ItemStack(Items.lava_bucket), EMPTY_BUCKET); + registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.potionitem), EMPTY_BOTTLE); + } + + private FluidContainerRegistry(){} + + /** + * Register a new fluid containing item. + * + * @param stack + * FluidStack containing the type and amount of the fluid stored in the item. + * @param filledContainer + * ItemStack representing the container when it is full. + * @param emptyContainer + * ItemStack representing the container when it is empty. + * @return True if container was successfully registered; false if it already is. + */ + public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer) + { + return registerFluidContainer(new FluidContainerData(stack, filledContainer, emptyContainer)); + } + + /** + * Register a new fluid containing item. The item is assumed to hold 1000 mB of fluid. Also + * registers the Fluid if possible. + * + * @param fluid + * Fluid type that is stored in the item. + * @param filledContainer + * ItemStack representing the container when it is full. + * @param emptyContainer + * ItemStack representing the container when it is empty. + * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed. + */ + public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer, ItemStack emptyContainer) + { + if (!FluidRegistry.isFluidRegistered(fluid)) + { + FluidRegistry.registerFluid(fluid); + } + return registerFluidContainer(new FluidStack(fluid, BUCKET_VOLUME), filledContainer, emptyContainer); + } + + /** + * Register a new fluid containing item that does not have an empty container. + * + * @param stack + * FluidStack containing the type and amount of the fluid stored in the item. + * @param filledContainer + * ItemStack representing the container when it is full. + * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed. + */ + public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer) + { + return registerFluidContainer(new FluidContainerData(stack, filledContainer, null, true)); + } + + /** + * Register a new fluid containing item that does not have an empty container. The item is + * assumed to hold 1000 mB of fluid. Also registers the Fluid if possible. + * + * @param fluid + * Fluid type that is stored in the item. + * @param filledContainer + * ItemStack representing the container when it is full. + * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed. + */ + public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer) + { + if (!FluidRegistry.isFluidRegistered(fluid)) + { + FluidRegistry.registerFluid(fluid); + } + return registerFluidContainer(new FluidStack(fluid, BUCKET_VOLUME), filledContainer); + } + + /** + * Register a new fluid containing item. + * + * @param data + * See {@link FluidContainerData}. + * @return True if container was successfully registered; false if it already is, or an invalid parameter was passed. + */ + public static boolean registerFluidContainer(FluidContainerData data) + { + if (isFilledContainer(data.filledContainer) || data.filledContainer == null) + { + return false; + } + if (data.fluid == null || data.fluid.getFluid() == null) + { + FMLLog.bigWarning("Invalid registration attempt for a fluid container item %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", data.filledContainer.getItem().getUnlocalizedName(data.filledContainer)); + return false; + } + containerFluidMap.put(new ContainerKey(data.filledContainer), data); + + if (data.emptyContainer != null && data.emptyContainer != NULL_EMPTYCONTAINER) + { + filledContainerMap.put(new ContainerKey(data.emptyContainer, data.fluid), data); + emptyContainers.add(new ContainerKey(data.emptyContainer)); + } + + MinecraftForge.EVENT_BUS.post(new FluidContainerRegisterEvent(data)); + return true; + } + + /** + * Determines the fluid type and amount inside a container. + * + * @param container + * The fluid container. + * @return FluidStack representing stored fluid. + */ + public static FluidStack getFluidForFilledItem(ItemStack container) + { + if (container == null) + { + return null; + } + + FluidContainerData data = containerFluidMap.get(new ContainerKey(container)); + return data == null ? null : data.fluid.copy(); + } + + /** + * Attempts to fill an empty container with a fluid. + * + * NOTE: Returns null on fail, NOT the empty container. + * + * @param fluid + * FluidStack containing the type and amount of fluid to fill. + * @param container + * ItemStack representing the empty container. + * @return Filled container if successful, otherwise null. + */ + public static ItemStack fillFluidContainer(FluidStack fluid, ItemStack container) + { + if (container == null || fluid == null) + { + return null; + } + + FluidContainerData data = filledContainerMap.get(new ContainerKey(container, fluid)); + if (data != null && fluid.amount >= data.fluid.amount) + { + return data.filledContainer.copy(); + } + return null; + } + + /** + * Attempts to empty a full container. + * + * @param container + * ItemStack representing the full container. + * @return Empty container if successful, otherwise null. + */ + public static ItemStack drainFluidContainer(ItemStack container) + { + if (container == null) + { + return null; + } + + FluidContainerData data = containerFluidMap.get(new ContainerKey(container)); + if (data != null) + { + return data.emptyContainer.copy(); + } + + return null; + } + + /** + * Determines the capacity of a full container. + * + * @param container + * The full container. + * @return The containers capacity, or 0 if the ItemStack does not represent + * a registered container. + */ + public static int getContainerCapacity(ItemStack container) + { + return getContainerCapacity(null, container); + } + + /** + * Determines the capacity of a container. + * + * @param fluid + * FluidStack containing the type of fluid the capacity should be + * determined for (ignored for full containers). + * @param container + * The container (full or empty). + * @return The containers capacity, or 0 if the ItemStack does not represent + * a registered container or the FluidStack is not registered with + * the empty container. + */ + public static int getContainerCapacity(FluidStack fluid, ItemStack container) + { + if (container == null) + { + return 0; + } + + FluidContainerData data = containerFluidMap.get(new ContainerKey(container)); + + if (data != null) + { + return data.fluid.amount; + } + + if (fluid != null) + { + data = filledContainerMap.get(new ContainerKey(container, fluid)); + + if (data != null) + { + return data.fluid.amount; + } + } + + return 0; + } + + /** + * Determines if a container holds a specific fluid. + */ + public static boolean containsFluid(ItemStack container, FluidStack fluid) + { + if (container == null || fluid == null) + { + return false; + } + + FluidContainerData data = containerFluidMap.get(new ContainerKey(container)); + return data == null ? false : data.fluid.containsFluid(fluid); + } + + public static boolean isBucket(ItemStack container) + { + if (container == null) + { + return false; + } + + if (container.isItemEqual(EMPTY_BUCKET)) + { + return true; + } + + FluidContainerData data = containerFluidMap.get(new ContainerKey(container)); + return data != null && data.emptyContainer.isItemEqual(EMPTY_BUCKET); + } + + public static boolean isContainer(ItemStack container) + { + return isEmptyContainer(container) || isFilledContainer(container); + } + + public static boolean isEmptyContainer(ItemStack container) + { + return container != null && emptyContainers.contains(new ContainerKey(container)); + } + + public static boolean isFilledContainer(ItemStack container) + { + return container != null && getFluidForFilledItem(container) != null; + } + + public static FluidContainerData[] getRegisteredFluidContainerData() + { + return containerFluidMap.values().toArray(new FluidContainerData[containerFluidMap.size()]); + } + + /** + * Wrapper class for the registry entries. Ensures that none of the attempted registrations + * contain null references unless permitted. + */ + public static class FluidContainerData + { + public final FluidStack fluid; + public final ItemStack filledContainer; + public final ItemStack emptyContainer; + + public FluidContainerData(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer) + { + this(stack, filledContainer, emptyContainer, false); + } + + public FluidContainerData(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer, boolean nullEmpty) + { + this.fluid = stack; + this.filledContainer = filledContainer; + this.emptyContainer = emptyContainer == null ? NULL_EMPTYCONTAINER : emptyContainer; + + if (stack == null || filledContainer == null || emptyContainer == null && !nullEmpty) + { + throw new RuntimeException("Invalid FluidContainerData - a parameter was null."); + } + } + + public FluidContainerData copy() + { + return new FluidContainerData(fluid, filledContainer, emptyContainer, true); + } + } + + public static class FluidContainerRegisterEvent extends Event + { + public final FluidContainerData data; + + public FluidContainerRegisterEvent(FluidContainerData data) + { + this.data = data.copy(); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidEvent.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidEvent.java new file mode 100644 index 0000000..3361575 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidEvent.java @@ -0,0 +1,123 @@ + +package net.minecraftforge.fluids; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +public class FluidEvent extends Event +{ + public final FluidStack fluid; + public final int x; + public final int y; + public final int z; + public final World world; + + public FluidEvent(FluidStack fluid, World world, int x, int y, int z) + { + this.fluid = fluid; + this.world = world; + this.x = x; + this.y = y; + this.z = z; + } + + /** + * Mods should fire this event when they move fluids around. + * + * @author cpw + * + */ + public static class FluidMotionEvent extends FluidEvent + { + public FluidMotionEvent(FluidStack fluid, World world, int x, int y, int z) + { + super(fluid, world, x, y, z); + } + } + + /** + * Mods should fire this event when a fluid is {@link IFluidTank#fill(FluidStack, boolean)} + * their tank implementation. {@link FluidTank} does. + * + * @author cpw + * + */ + public static class FluidFillingEvent extends FluidEvent + { + public final IFluidTank tank; + public final int amount; + + /** + * @deprecated Will be removed in 1.8 + * + */ + @Deprecated + public FluidFillingEvent(FluidStack fluid, World world, int x, int y, int z, IFluidTank tank) + { + this(fluid, world, x, y, z, tank, -1); + } + + public FluidFillingEvent(FluidStack fluid, World world, int x, int y, int z, IFluidTank tank, int amount) + { + super(fluid, world, x, y, z); + this.tank = tank; + this.amount = amount; + } + } + + /** + * Mods should fire this event when a fluid is {@link IFluidTank#drain(int, boolean)} from their + * tank. + * + * @author cpw + * + */ + public static class FluidDrainingEvent extends FluidEvent + { + public final IFluidTank tank; + public final int amount; + + /** + * @deprecated Will be removed in 1.8 + * + */ + @Deprecated + public FluidDrainingEvent(FluidStack fluid, World world, int x, int y, int z, IFluidTank tank) + { + this(fluid, world, x, y, z, tank, -1); + } + + public FluidDrainingEvent(FluidStack fluid, World world, int x, int y, int z, IFluidTank tank, int amount) + { + super(fluid, world, x, y, z); + this.amount = amount; + this.tank = tank; + } + } + + /** + * Mods should fire this event when a fluid "spills", for example, if a block containing fluid + * is broken. + * + * @author cpw + * + */ + public static class FluidSpilledEvent extends FluidEvent + { + public FluidSpilledEvent(FluidStack fluid, World world, int x, int y, int z) + { + super(fluid, world, x, y, z); + } + } + + /** + * A handy shortcut for firing the various fluid events. + * + * @param event + */ + public static final void fireEvent(FluidEvent event) + { + MinecraftForge.EVENT_BUS.post(event); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidRegistry.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidRegistry.java new file mode 100644 index 0000000..beadb22 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidRegistry.java @@ -0,0 +1,397 @@ +package net.minecraftforge.fluids; + +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.MinecraftForge; + +import com.google.common.base.Strings; +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.registry.RegistryDelegate; + +/** + * Handles Fluid registrations. Fluids MUST be registered in order to function. + * + * @author King Lemming, CovertJaguar (LiquidDictionary) + * + */ +public abstract class FluidRegistry +{ + static int maxID = 0; + + static BiMap fluids = HashBiMap.create(); + static BiMap fluidIDs = HashBiMap.create(); + static BiMap fluidNames = HashBiMap.create(); //Caching this just makes some other calls faster + static BiMap fluidBlocks; + + // the globally unique fluid map - only used to associate non-defaults during world/server loading + static BiMap masterFluidReference = HashBiMap.create(); + static BiMap defaultFluidName = HashBiMap.create(); + static Map delegates = Maps.newHashMap(); + + public static final Fluid WATER = new Fluid("water") { + @Override + public String getLocalizedName() { + return StatCollector.translateToLocal("tile.water.name"); + } + }.setBlock(Blocks.water).setUnlocalizedName(Blocks.water.getUnlocalizedName()); + + public static final Fluid LAVA = new Fluid("lava") { + @Override + public String getLocalizedName() { + return StatCollector.translateToLocal("tile.lava.name"); + } + }.setBlock(Blocks.lava).setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300).setUnlocalizedName(Blocks.lava.getUnlocalizedName()); + + public static int renderIdFluid = -1; + + static + { + registerFluid(WATER); + registerFluid(LAVA); + } + + private FluidRegistry(){} + + /** + * Called by Forge to prepare the ID map for server -> client sync. + * Modders, DO NOT call this. + */ + public static void initFluidIDs(BiMap newfluidIDs, Set defaultNames) + { + maxID = newfluidIDs.size(); + loadFluidDefaults(newfluidIDs, defaultNames); + } + + /** + * Called by forge to load default fluid IDs from the world or from server -> client for syncing + * DO NOT call this and expect useful behaviour. + * @param newfluidIDs + */ + private static void loadFluidDefaults(BiMap localFluidIDs, Set defaultNames) + { + // If there's an empty set of default names, use the defaults as defined locally + if (defaultNames.isEmpty()) { + defaultNames.addAll(defaultFluidName.values()); + } + BiMap localFluids = HashBiMap.create(fluids); + for (String defaultName : defaultNames) + { + Fluid fluid = masterFluidReference.get(defaultName); + if (fluid == null) { + String derivedName = defaultName.split(":",2)[1]; + String localDefault = defaultFluidName.get(derivedName); + if (localDefault == null) { + FMLLog.getLogger().log(Level.ERROR, "The fluid {} (specified as {}) is missing from this instance - it will be removed", derivedName, defaultName); + continue; + } + fluid = masterFluidReference.get(localDefault); + FMLLog.getLogger().log(Level.ERROR, "The fluid {} specified as default is not present - it will be reverted to default {}", defaultName, localDefault); + } + FMLLog.getLogger().log(Level.DEBUG, "The fluid {} has been selected as the default fluid for {}", defaultName, fluid.getName()); + Fluid oldFluid = localFluids.put(fluid.getName(), fluid); + Integer id = localFluidIDs.remove(oldFluid); + localFluidIDs.put(fluid, id); + } + BiMap localFluidNames = HashBiMap.create(); + for (Entry e : localFluidIDs.entrySet()) { + localFluidNames.put(e.getValue(), e.getKey().getName()); + } + fluidIDs = localFluidIDs; + fluids = localFluids; + fluidNames = localFluidNames; + fluidBlocks = null; + for (FluidDelegate fd : delegates.values()) + { + fd.rebind(); + } + } + + /** + * Register a new Fluid. If a fluid with the same name already exists, registration the alternative fluid is tracked + * in case it is the default in another place + * + * @param fluid + * The fluid to register. + * @return True if the fluid was registered as the current default fluid, false if it was only registered as an alternative + */ + public static boolean registerFluid(Fluid fluid) + { + masterFluidReference.put(uniqueName(fluid), fluid); + delegates.put(fluid, new FluidDelegate(fluid, fluid.getName())); + if (fluids.containsKey(fluid.getName())) + { + return false; + } + fluids.put(fluid.getName(), fluid); + maxID++; + fluidIDs.put(fluid, maxID); + fluidNames.put(maxID, fluid.getName()); + defaultFluidName.put(fluid.getName(), uniqueName(fluid)); + + MinecraftForge.EVENT_BUS.post(new FluidRegisterEvent(fluid.getName(), maxID)); + return true; + } + + private static String uniqueName(Fluid fluid) + { + ModContainer activeModContainer = Loader.instance().activeModContainer(); + String activeModContainerName = activeModContainer == null ? "minecraft" : activeModContainer.getModId(); + return activeModContainerName+":"+fluid.getName(); + } + + /** + * Is the supplied fluid the current default fluid for it's name + * @param fluid the fluid we're testing + * @return if the fluid is default + */ + public static boolean isFluidDefault(Fluid fluid) + { + return fluids.containsValue(fluid); + } + + /** + * Does the supplied fluid have an entry for it's name (whether or not the fluid itself is default) + * @param fluid the fluid we're testing + * @return if the fluid's name has a registration entry + */ + public static boolean isFluidRegistered(Fluid fluid) + { + return fluid != null && fluids.containsKey(fluid.getName()); + } + + public static boolean isFluidRegistered(String fluidName) + { + return fluids.containsKey(fluidName); + } + + public static Fluid getFluid(String fluidName) + { + return fluids.get(fluidName); + } + + public static Fluid getFluid(int fluidID) + { + return fluidIDs.inverse().get(fluidID); + } + + public static int getFluidID(Fluid fluid) + { + return fluidIDs.get(fluid); + } + + public static int getFluidID(String fluidName) + { + return fluidIDs.get(getFluid(fluidName)); + } + + @Deprecated //Remove in 1.8.3 + public static String getFluidName(int fluidID) + { + return fluidNames.get(fluidID); + } + + public static String getFluidName(Fluid fluid) + { + return fluids.inverse().get(fluid); + } + + public static String getFluidName(FluidStack stack) + { + return getFluidName(stack.getFluid()); + } + + public static FluidStack getFluidStack(String fluidName, int amount) + { + if (!fluids.containsKey(fluidName)) + { + return null; + } + return new FluidStack(getFluid(fluidName), amount); + } + + /** + * Returns a read-only map containing Fluid Names and their associated Fluids. + */ + public static Map getRegisteredFluids() + { + return ImmutableMap.copyOf(fluids); + } + + /** + * Returns a read-only map containing Fluid Names and their associated IDs. + */ + @Deprecated //Change return type to in 1.8.3 + public static Map getRegisteredFluidIDs() + { + return ImmutableMap.copyOf(fluidNames.inverse()); + } + + /** + * Returns a read-only map containing Fluid IDs and their associated Fluids. + * In 1.8.3, this will change to just 'getRegisteredFluidIDs' + */ + public static Map getRegisteredFluidIDsByFluid() + { + return ImmutableMap.copyOf(fluidIDs); + } + + public static Fluid lookupFluidForBlock(Block block) + { + if (fluidBlocks == null) + { + BiMap tmp = HashBiMap.create(); + for (Fluid fluid : fluids.values()) + { + if (fluid.canBePlacedInWorld() && fluid.getBlock() != null) + { + tmp.put(fluid.getBlock(), fluid); + } + } + fluidBlocks = tmp; + } + return fluidBlocks.get(block); + } + + public static class FluidRegisterEvent extends Event + { + public final String fluidName; + public final int fluidID; + + public FluidRegisterEvent(String fluidName, int fluidID) + { + this.fluidName = fluidName; + this.fluidID = fluidID; + } + } + + public static int getMaxID() + { + return maxID; + } + + public static String getDefaultFluidName(Fluid key) + { + String name = masterFluidReference.inverse().get(key); + if (Strings.isNullOrEmpty(name)) { + FMLLog.getLogger().log(Level.ERROR, "The fluid registry is corrupted. A fluid {} {} is not properly registered. The mod that registered this is broken", key.getClass().getName(), key.getName()); + throw new IllegalStateException("The fluid registry is corrupted"); + } + return name; + } + + public static void loadFluidDefaults(NBTTagCompound tag) + { + Set defaults = Sets.newHashSet(); + if (tag.hasKey("DefaultFluidList",9)) + { + FMLLog.getLogger().log(Level.DEBUG, "Loading persistent fluid defaults from world"); + NBTTagList tl = tag.getTagList("DefaultFluidList", 8); + for (int i = 0; i < tl.tagCount(); i++) + { + defaults.add(tl.getStringTagAt(i)); + } + } + else + { + FMLLog.getLogger().log(Level.DEBUG, "World is missing persistent fluid defaults - using local defaults"); + } + loadFluidDefaults(HashBiMap.create(fluidIDs), defaults); + } + + public static void writeDefaultFluidList(NBTTagCompound forgeData) + { + NBTTagList tagList = new NBTTagList(); + + for (Entry def : fluids.entrySet()) + { + tagList.appendTag(new NBTTagString(getDefaultFluidName(def.getValue()))); + } + + forgeData.setTag("DefaultFluidList", tagList); + } + + public static void validateFluidRegistry() + { + Set illegalFluids = Sets.newHashSet(); + for (Fluid f : fluids.values()) + { + if (!masterFluidReference.containsValue(f)) + { + illegalFluids.add(f); + } + } + + if (!illegalFluids.isEmpty()) + { + FMLLog.getLogger().log(Level.FATAL, "The fluid registry is corrupted. Something has inserted a fluid without registering it"); + FMLLog.getLogger().log(Level.FATAL, "There is {} unregistered fluids", illegalFluids.size()); + for (Fluid f: illegalFluids) + { + FMLLog.getLogger().log(Level.FATAL, " Fluid name : {}, type: {}", f.getName(), f.getClass().getName()); + } + FMLLog.getLogger().log(Level.FATAL, "The mods that own these fluids need to register them properly"); + throw new IllegalStateException("The fluid map contains fluids unknown to the master fluid registry"); + } + } + + static RegistryDelegate makeDelegate(Fluid fl) + { + return delegates.get(fl); + } + + + private static class FluidDelegate implements RegistryDelegate + { + private String name; + private Fluid fluid; + + FluidDelegate(Fluid fluid, String name) + { + this.fluid = fluid; + this.name = name; + } + + @Override + public Fluid get() + { + return fluid; + } + + @Override + public String name() + { + return name; + } + + @Override + public Class type() + { + return Fluid.class; + } + + void rebind() + { + fluid = fluids.get(name); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidStack.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidStack.java new file mode 100644 index 0000000..75d2c3e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidStack.java @@ -0,0 +1,239 @@ + +package net.minecraftforge.fluids; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.registry.RegistryDelegate; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +/** + * ItemStack substitute for Fluids. + * + * NOTE: Equality is based on the Fluid, not the amount. Use + * {@link #isFluidStackIdentical(FluidStack)} to determine if FluidID, Amount and NBT Tag are all + * equal. + * + * @author King Lemming, SirSengir (LiquidStack) + * + */ +public class FluidStack +{ + /** + * This field will be removed in 1.8. It may be incorrect after a world is loaded. Code should always + * use {@link #getFluid()} instead. That will always reflect the correct value. + */ + @Deprecated + public final Fluid fluid; + public int amount; + public NBTTagCompound tag; + private RegistryDelegate fluidDelegate; + + public FluidStack(Fluid fluid, int amount) + { + if (fluid == null) + { + FMLLog.bigWarning("Null fluid supplied to fluidstack. Did you try and create a stack for an unregistered fluid?"); + throw new IllegalArgumentException("Cannot create a fluidstack from a null fluid"); + } + else if (!FluidRegistry.isFluidRegistered(fluid)) + { + FMLLog.bigWarning("Failed attempt to create a FluidStack for an unregistered Fluid %s (type %s)", fluid.getName(), fluid.getClass().getName()); + throw new IllegalArgumentException("Cannot create a fluidstack from an unregistered fluid"); + } + this.fluidDelegate = FluidRegistry.makeDelegate(fluid); + this.amount = amount; + this.fluid = fluid; + } + + public FluidStack(Fluid fluid, int amount, NBTTagCompound nbt) + { + this(fluid, amount); + + if (nbt != null) + { + tag = (NBTTagCompound) nbt.copy(); + } + } + + public FluidStack(FluidStack stack, int amount) + { + this(stack.getFluid(), amount, stack.tag); + } + + // To be removed in 1.8 + @Deprecated + public FluidStack(int fluidID, int amount) + { + this(FluidRegistry.getFluid(fluidID), amount); + } + + // To be removed in 1.8 + @Deprecated + public FluidStack(int fluidID, int amount, NBTTagCompound nbt) + { + this(FluidRegistry.getFluid(fluidID), amount, nbt); + } + + /** + * This provides a safe method for retrieving a FluidStack - if the Fluid is invalid, the stack + * will return as null. + */ + public static FluidStack loadFluidStackFromNBT(NBTTagCompound nbt) + { + if (nbt == null) + { + return null; + } + String fluidName = nbt.getString("FluidName"); + + if (fluidName == null || FluidRegistry.getFluid(fluidName) == null) + { + return null; + } + FluidStack stack = new FluidStack(FluidRegistry.getFluid(fluidName), nbt.getInteger("Amount")); + + if (nbt.hasKey("Tag")) + { + stack.tag = nbt.getCompoundTag("Tag"); + } + return stack; + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + nbt.setString("FluidName", FluidRegistry.getFluidName(getFluid())); + nbt.setInteger("Amount", amount); + + if (tag != null) + { + nbt.setTag("Tag", tag); + } + return nbt; + } + + public final Fluid getFluid() + { + return fluidDelegate.get(); + } + + public final int getFluidID() + { + return FluidRegistry.getFluidID(getFluid()); + } + + public String getLocalizedName() + { + return this.getFluid().getLocalizedName(this); + } + + public String getUnlocalizedName() + { + return this.getFluid().getUnlocalizedName(this); + } + + /** + * @return A copy of this FluidStack + */ + public FluidStack copy() + { + return new FluidStack(getFluid(), amount, tag); + } + + /** + * Determines if the FluidIDs and NBT Tags are equal. This does not check amounts. + * + * @param other + * The FluidStack for comparison + * @return true if the Fluids (IDs and NBT Tags) are the same + */ + public boolean isFluidEqual(FluidStack other) + { + return other != null && getFluid() == other.getFluid() && isFluidStackTagEqual(other); + } + + private boolean isFluidStackTagEqual(FluidStack other) + { + return tag == null ? other.tag == null : other.tag == null ? false : tag.equals(other.tag); + } + + /** + * Determines if the NBT Tags are equal. Useful if the FluidIDs are known to be equal. + */ + public static boolean areFluidStackTagsEqual(FluidStack stack1, FluidStack stack2) + { + return stack1 == null && stack2 == null ? true : stack1 == null || stack2 == null ? false : stack1.isFluidStackTagEqual(stack2); + } + + /** + * Determines if the Fluids are equal and this stack is larger. + * + * @param other + * @return true if this FluidStack contains the other FluidStack (same fluid and >= amount) + */ + public boolean containsFluid(FluidStack other) + { + return isFluidEqual(other) && amount >= other.amount; + } + + /** + * Determines if the FluidIDs, Amounts, and NBT Tags are all equal. + * + * @param other + * - the FluidStack for comparison + * @return true if the two FluidStacks are exactly the same + */ + public boolean isFluidStackIdentical(FluidStack other) + { + return isFluidEqual(other) && amount == other.amount; + } + + /** + * Determines if the FluidIDs and NBT Tags are equal compared to a registered container + * ItemStack. This does not check amounts. + * + * @param other + * The ItemStack for comparison + * @return true if the Fluids (IDs and NBT Tags) are the same + */ + public boolean isFluidEqual(ItemStack other) + { + if (other == null) + { + return false; + } + + if (other.getItem() instanceof IFluidContainerItem) + { + return isFluidEqual(((IFluidContainerItem) other.getItem()).getFluid(other)); + } + + return isFluidEqual(FluidContainerRegistry.getFluidForFilledItem(other)); + } + + @Override + public final int hashCode() + { + int code = 1; + code = 31*code + getFluid().hashCode(); + code = 31*code + amount; + if (tag != null) + code = 31*code + tag.hashCode(); + return code; + } + + /** + * Default equality comparison for a FluidStack. Same functionality as isFluidEqual(). + * + * This is included for use in data structures. + */ + @Override + public final boolean equals(Object o) + { + if (!(o instanceof FluidStack)) + { + return false; + } + + return isFluidEqual((FluidStack) o); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTank.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTank.java new file mode 100644 index 0000000..5f4922a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTank.java @@ -0,0 +1,188 @@ + +package net.minecraftforge.fluids; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +/** + * Reference implementation of {@link IFluidTank}. Use/extend this or implement your own. + * + * @author King Lemming, cpw (LiquidTank) + * + */ +public class FluidTank implements IFluidTank +{ + protected FluidStack fluid; + protected int capacity; + protected TileEntity tile; + + public FluidTank(int capacity) + { + this(null, capacity); + } + + public FluidTank(FluidStack stack, int capacity) + { + this.fluid = stack; + this.capacity = capacity; + } + + public FluidTank(Fluid fluid, int amount, int capacity) + { + this(new FluidStack(fluid, amount), capacity); + } + + public FluidTank readFromNBT(NBTTagCompound nbt) + { + if (!nbt.hasKey("Empty")) + { + FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt); + setFluid(fluid); + } + else + { + setFluid(null); + } + return this; + } + + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + if (fluid != null) + { + fluid.writeToNBT(nbt); + } + else + { + nbt.setString("Empty", ""); + } + return nbt; + } + + public void setFluid(FluidStack fluid) + { + this.fluid = fluid; + } + + public void setCapacity(int capacity) + { + this.capacity = capacity; + } + + /* IFluidTank */ + @Override + public FluidStack getFluid() + { + return fluid; + } + + @Override + public int getFluidAmount() + { + if (fluid == null) + { + return 0; + } + return fluid.amount; + } + + @Override + public int getCapacity() + { + return capacity; + } + + @Override + public FluidTankInfo getInfo() + { + return new FluidTankInfo(this); + } + + @Override + public int fill(FluidStack resource, boolean doFill) + { + if (resource == null) + { + return 0; + } + + if (!doFill) + { + if (fluid == null) + { + return Math.min(capacity, resource.amount); + } + + if (!fluid.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(capacity - fluid.amount, resource.amount); + } + + if (fluid == null) + { + fluid = new FluidStack(resource, Math.min(capacity, resource.amount)); + + if (tile != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, fluid.amount)); + } + return fluid.amount; + } + + if (!fluid.isFluidEqual(resource)) + { + return 0; + } + int filled = capacity - fluid.amount; + + if (resource.amount < filled) + { + fluid.amount += resource.amount; + filled = resource.amount; + } + else + { + fluid.amount = capacity; + } + + if (tile != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, filled)); + } + return filled; + } + + @Override + public FluidStack drain(int maxDrain, boolean doDrain) + { + if (fluid == null) + { + return null; + } + + int drained = maxDrain; + if (fluid.amount < drained) + { + drained = fluid.amount; + } + + FluidStack stack = new FluidStack(fluid, drained); + if (doDrain) + { + fluid.amount -= drained; + if (fluid.amount <= 0) + { + fluid = null; + } + + if (tile != null) + { + FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, this, drained)); + } + } + return stack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTankInfo.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTankInfo.java new file mode 100644 index 0000000..62898b9 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/FluidTankInfo.java @@ -0,0 +1,25 @@ +package net.minecraftforge.fluids; + +/** + * Wrapper class used to encapsulate information about an IFluidTank. + * + * @author King Lemming + * + */ +public final class FluidTankInfo +{ + public final FluidStack fluid; + public final int capacity; + + public FluidTankInfo(FluidStack fluid, int capacity) + { + this.fluid = fluid; + this.capacity = capacity; + } + + public FluidTankInfo(IFluidTank tank) + { + this.fluid = tank.getFluid(); + this.capacity = tank.getCapacity(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidBlock.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidBlock.java new file mode 100644 index 0000000..a81a62c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidBlock.java @@ -0,0 +1,51 @@ +package net.minecraftforge.fluids; + +import net.minecraft.world.World; + +/** + * Implement this interface on Block classes which represent world-placeable Fluids. + * + * NOTE: Using/extending the reference implementations {@link BlockFluidBase} is encouraged. + * + * @author King Lemming + * + */ +public interface IFluidBlock +{ + /** + * Returns the Fluid associated with this Block. + */ + Fluid getFluid(); + + /** + * Attempt to drain the block. This method should be called by devices such as pumps. + * + * NOTE: The block is intended to handle its own state changes. + * + * @param doDrain + * If false, the drain will only be simulated. + * @return + */ + FluidStack drain(World world, int x, int y, int z, boolean doDrain); + + /** + * Check to see if a block can be drained. This method should be called by devices such as + * pumps. + * + * @param doDrain + * If false, the drain will only be simulated. + * @return + */ + boolean canDrain(World world, int x, int y, int z); + + /** + * Returns the amount of a single block is filled. Value between 0 and 1. + * 1 meaning the entire 1x1x1 cube is full, 0 meaning completely empty. + * + * If the return value is negative. It will be treated as filling the block + * from the top down instead of bottom up. + * + * @return + */ + float getFilledPercentage(World world, int x, int y, int z); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidContainerItem.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidContainerItem.java new file mode 100644 index 0000000..b116f69 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidContainerItem.java @@ -0,0 +1,59 @@ +package net.minecraftforge.fluids; + +import net.minecraft.item.ItemStack; + +/** + * Implement this interface on Item classes that support external manipulation of their internal + * fluid storage. + * + * A reference implementation is provided {@link ItemFluidContainer}. + * + * NOTE: Use of NBT data on the containing ItemStack is encouraged. + * + * @author King Lemming + * + */ +public interface IFluidContainerItem +{ + /** + * + * @param container + * ItemStack which is the fluid container. + * @return FluidStack representing the fluid in the container, null if the container is empty. + */ + FluidStack getFluid(ItemStack container); + + /** + * + * @param container + * ItemStack which is the fluid container. + * @return Capacity of this fluid container. + */ + int getCapacity(ItemStack container); + + /** + * + * @param container + * ItemStack which is the fluid container. + * @param resource + * FluidStack attempting to fill the container. + * @param doFill + * If false, the fill will only be simulated. + * @return Amount of fluid that was (or would have been, if simulated) filled into the + * container. + */ + int fill(ItemStack container, FluidStack resource, boolean doFill); + + /** + * + * @param container + * ItemStack which is the fluid container. + * @param maxDrain + * Maximum amount of fluid to be removed from the container. + * @param doFill + * If false, the drain will only be simulated. + * @return Amount of fluid that was (or would have been, if simulated) drained from the + * container. + */ + FluidStack drain(ItemStack container, int maxDrain, boolean doDrain); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidHandler.java new file mode 100644 index 0000000..7e1967c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidHandler.java @@ -0,0 +1,82 @@ +package net.minecraftforge.fluids; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Implement this interface on TileEntities which should handle fluids, generally storing them in + * one or more internal {@link IFluidTank} objects. + * + * A reference implementation is provided {@link TileFluidHandler}. + * + * @author King Lemming + * + */ +public interface IFluidHandler +{ + /** + * Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler. + * + * @param from + * Orientation the Fluid is pumped in from. + * @param resource + * FluidStack representing the Fluid and maximum amount of fluid to be filled. + * @param doFill + * If false, fill will only be simulated. + * @return Amount of resource that was (or would have been, if simulated) filled. + */ + int fill(ForgeDirection from, FluidStack resource, boolean doFill); + + /** + * Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. + * + * @param from + * Orientation the Fluid is drained to. + * @param resource + * FluidStack representing the Fluid and maximum amount of fluid to be drained. + * @param doDrain + * If false, drain will only be simulated. + * @return FluidStack representing the Fluid and amount that was (or would have been, if + * simulated) drained. + */ + FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain); + + /** + * Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. + * + * This method is not Fluid-sensitive. + * + * @param from + * Orientation the fluid is drained to. + * @param maxDrain + * Maximum amount of fluid to drain. + * @param doDrain + * If false, drain will only be simulated. + * @return FluidStack representing the Fluid and amount that was (or would have been, if + * simulated) drained. + */ + FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain); + + /** + * Returns true if the given fluid can be inserted into the given direction. + * + * More formally, this should return true if fluid is able to enter from the given direction. + */ + boolean canFill(ForgeDirection from, Fluid fluid); + + /** + * Returns true if the given fluid can be extracted from the given direction. + * + * More formally, this should return true if fluid is able to leave from the given direction. + */ + boolean canDrain(ForgeDirection from, Fluid fluid); + + /** + * Returns an array of objects which represent the internal tanks. These objects cannot be used + * to manipulate the internal tanks. See {@link FluidTankInfo}. + * + * @param from + * Orientation determining which tanks should be queried. + * @return Info for the relevant internal tanks. + */ + FluidTankInfo[] getTankInfo(ForgeDirection from); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidTank.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidTank.java new file mode 100644 index 0000000..fc59451 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/IFluidTank.java @@ -0,0 +1,57 @@ +package net.minecraftforge.fluids; + +/** + * A tank is the unit of interaction with Fluid inventories. + * + * A reference implementation can be found at {@link FluidTank}. + * + * @author King Lemming, cpw (ILiquidTank) + * + */ +public interface IFluidTank +{ + /** + * @return FluidStack representing the fluid in the tank, null if the tank is empty. + */ + FluidStack getFluid(); + + /** + * @return Current amount of fluid in the tank. + */ + int getFluidAmount(); + + /** + * @return Capacity of this fluid tank. + */ + int getCapacity(); + + /** + * Returns a wrapper object {@link FluidTankInfo } containing the capacity of the tank and the + * FluidStack it holds. + * + * Should prevent manipulation of the IFluidTank. See {@link FluidTank}. + * + * @return State information for the IFluidTank. + */ + FluidTankInfo getInfo(); + + /** + * + * @param resource + * FluidStack attempting to fill the tank. + * @param doFill + * If false, the fill will only be simulated. + * @return Amount of fluid that was accepted by the tank. + */ + int fill(FluidStack resource, boolean doFill); + + /** + * + * @param maxDrain + * Maximum amount of fluid to be removed from the container. + * @param doFill + * If false, the fill will only be simulated. + * @return Amount of fluid that was removed from the tank. + */ + FluidStack drain(int maxDrain, boolean doDrain); +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/ItemFluidContainer.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/ItemFluidContainer.java new file mode 100644 index 0000000..633ba2f --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/ItemFluidContainer.java @@ -0,0 +1,159 @@ +package net.minecraftforge.fluids; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +/** + * Reference implementation of {@link IFluidContainerItem}. Use/extend this or implement your own. + * + * @author King Lemming + * + */ +public class ItemFluidContainer extends Item implements IFluidContainerItem +{ + protected int capacity; + + public ItemFluidContainer(int itemID) + { + super(); + } + + public ItemFluidContainer(int itemID, int capacity) + { + super(); + this.capacity = capacity; + } + + public ItemFluidContainer setCapacity(int capacity) + { + this.capacity = capacity; + return this; + } + + /* IFluidContainerItem */ + @Override + public FluidStack getFluid(ItemStack container) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + } + + @Override + public int getCapacity(ItemStack container) + { + return capacity; + } + + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) + { + if (resource == null) + { + return 0; + } + + if (!doFill) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return Math.min(capacity, resource.amount); + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + + if (stack == null) + { + return Math.min(capacity, resource.amount); + } + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(capacity - stack.amount, resource.amount); + } + + if (container.stackTagCompound == null) + { + container.stackTagCompound = new NBTTagCompound(); + } + + if (!container.stackTagCompound.hasKey("Fluid")) + { + NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound()); + + if (capacity < resource.amount) + { + fluidTag.setInteger("Amount", capacity); + container.stackTagCompound.setTag("Fluid", fluidTag); + return capacity; + } + + container.stackTagCompound.setTag("Fluid", fluidTag); + return resource.amount; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + int filled = capacity - stack.amount; + if (resource.amount < filled) + { + stack.amount += resource.amount; + filled = resource.amount; + } + else + { + stack.amount = capacity; + } + + container.stackTagCompound.setTag("Fluid", stack.writeToNBT(fluidTag)); + return filled; + } + + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + if (stack == null) + { + return null; + } + + int currentAmount = stack.amount; + stack.amount = Math.min(stack.amount, maxDrain); + if (doDrain) + { + if (currentAmount == stack.amount) + { + container.stackTagCompound.removeTag("Fluid"); + + if (container.stackTagCompound.hasNoTags()) + { + container.stackTagCompound = null; + } + return stack; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + fluidTag.setInteger("Amount", currentAmount - stack.amount); + container.stackTagCompound.setTag("Fluid", fluidTag); + } + return stack; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/RenderBlockFluid.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/RenderBlockFluid.java new file mode 100644 index 0000000..b1a058a --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/RenderBlockFluid.java @@ -0,0 +1,357 @@ +package net.minecraftforge.fluids; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +/** + * Default renderer for Forge fluid blocks. + * + * @author King Lemming + * + */ +public class RenderBlockFluid implements ISimpleBlockRenderingHandler +{ + public static RenderBlockFluid instance = new RenderBlockFluid(); + + static final float LIGHT_Y_NEG = 0.5F; + static final float LIGHT_Y_POS = 1.0F; + static final float LIGHT_XZ_NEG = 0.8F; + static final float LIGHT_XZ_POS = 0.6F; + static final double RENDER_OFFSET = 0.0010000000474974513D; + + public float getFluidHeightAverage(float[] flow) + { + float total = 0; + int count = 0; + + float end = 0; + + for (int i = 0; i < flow.length; i++) + { + if (flow[i] >= 0.875F && end != 1F) + { + end = flow[i]; + } + + if (flow[i] >= 0) + { + total += flow[i]; + count++; + } + } + + if (end == 0) + end = total / count; + + return end; + } + + public float getFluidHeightForRender(IBlockAccess world, int x, int y, int z, BlockFluidBase block) + { + if (world.getBlock(x, y, z) == block) + { + Block verticalOrigin = world.getBlock(x, y - block.densityDir, z); + if (verticalOrigin.getMaterial().isLiquid() || verticalOrigin instanceof IFluidBlock) + { + return 1; + } + + if (world.getBlockMetadata(x, y, z) == block.getMaxRenderHeightMeta()) + { + return 0.875F; + } + } + return !world.getBlock(x, y, z).getMaterial().isSolid() && world.getBlock(x, y - block.densityDir, z) == block ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F; + } + + /* ISimpleBlockRenderingHandler */ + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer){} + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) + { + if (!(block instanceof BlockFluidBase)) + { + return false; + } + + Tessellator tessellator = Tessellator.instance; + int color = block.colorMultiplier(world, x, y, z); + float red = (color >> 16 & 255) / 255.0F; + float green = (color >> 8 & 255) / 255.0F; + float blue = (color & 255) / 255.0F; + + BlockFluidBase theFluid = (BlockFluidBase) block; + int bMeta = world.getBlockMetadata(x, y, z); + + boolean renderTop = world.getBlock(x, y - theFluid.densityDir, z) != theFluid; + + boolean renderBottom = block.shouldSideBeRendered(world, x, y + theFluid.densityDir, z, 0) && world.getBlock(x, y + theFluid.densityDir, z) != theFluid; + + boolean[] renderSides = new boolean[] + { + block.shouldSideBeRendered(world, x, y, z - 1, 2), + block.shouldSideBeRendered(world, x, y, z + 1, 3), + block.shouldSideBeRendered(world, x - 1, y, z, 4), + block.shouldSideBeRendered(world, x + 1, y, z, 5) + }; + + if (!renderTop && !renderBottom && !renderSides[0] && !renderSides[1] && !renderSides[2] && !renderSides[3]) + { + return false; + } + else + { + boolean rendered = false; + double heightNW, heightSW, heightSE, heightNE; + float flow11 = getFluidHeightForRender(world, x, y, z, theFluid); + + if (flow11 != 1) + { + float flow00 = getFluidHeightForRender(world, x - 1, y, z - 1, theFluid); + float flow01 = getFluidHeightForRender(world, x - 1, y, z, theFluid); + float flow02 = getFluidHeightForRender(world, x - 1, y, z + 1, theFluid); + float flow10 = getFluidHeightForRender(world, x, y, z - 1, theFluid); + float flow12 = getFluidHeightForRender(world, x, y, z + 1, theFluid); + float flow20 = getFluidHeightForRender(world, x + 1, y, z - 1, theFluid); + float flow21 = getFluidHeightForRender(world, x + 1, y, z, theFluid); + float flow22 = getFluidHeightForRender(world, x + 1, y, z + 1, theFluid); + + heightNW = getFluidHeightAverage(new float[]{ flow00, flow01, flow10, flow11 }); + heightSW = getFluidHeightAverage(new float[]{ flow01, flow02, flow12, flow11 }); + heightSE = getFluidHeightAverage(new float[]{ flow12, flow21, flow22, flow11 }); + heightNE = getFluidHeightAverage(new float[]{ flow10, flow20, flow21, flow11 }); + } + else + { + heightNW = flow11; + heightSW = flow11; + heightSE = flow11; + heightNE = flow11; + } + + boolean rises = theFluid.densityDir == 1; + if (renderer.renderAllFaces || renderTop) + { + rendered = true; + IIcon iconStill = getIcon(block.getIcon(1, bMeta)); + float flowDir = (float) BlockFluidBase.getFlowDirection(world, x, y, z); + + if (flowDir > -999.0F) + { + iconStill = getIcon(block.getIcon(2, bMeta)); + } + + heightNW -= RENDER_OFFSET; + heightSW -= RENDER_OFFSET; + heightSE -= RENDER_OFFSET; + heightNE -= RENDER_OFFSET; + + double u1, u2, u3, u4, v1, v2, v3, v4; + + if (flowDir < -999.0F) + { + u2 = iconStill.getInterpolatedU(0.0D); + v2 = iconStill.getInterpolatedV(0.0D); + u1 = u2; + v1 = iconStill.getInterpolatedV(16.0D); + u4 = iconStill.getInterpolatedU(16.0D); + v4 = v1; + u3 = u4; + v3 = v2; + } + else + { + float xFlow = MathHelper.sin(flowDir) * 0.25F; + float zFlow = MathHelper.cos(flowDir) * 0.25F; + u2 = iconStill.getInterpolatedU(8.0F + (-zFlow - xFlow) * 16.0F); + v2 = iconStill.getInterpolatedV(8.0F + (-zFlow + xFlow) * 16.0F); + u1 = iconStill.getInterpolatedU(8.0F + (-zFlow + xFlow) * 16.0F); + v1 = iconStill.getInterpolatedV(8.0F + (zFlow + xFlow) * 16.0F); + u4 = iconStill.getInterpolatedU(8.0F + (zFlow + xFlow) * 16.0F); + v4 = iconStill.getInterpolatedV(8.0F + (zFlow - xFlow) * 16.0F); + u3 = iconStill.getInterpolatedU(8.0F + (zFlow - xFlow) * 16.0F); + v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F); + } + + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue); + + if (!rises) + { + tessellator.addVertexWithUV(x + 0, y + heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + + tessellator.addVertexWithUV(x + 0, y + heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); + } + else + { + tessellator.addVertexWithUV(x + 1, y + 1 - heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + + tessellator.addVertexWithUV(x + 1, y + 1 - heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); + } + } + + if (renderer.renderAllFaces || renderBottom) + { + rendered = true; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); + if (!rises) + { + tessellator.setColorOpaque_F(LIGHT_Y_NEG * red, LIGHT_Y_NEG * green, LIGHT_Y_NEG * blue); + renderer.renderFaceYNeg(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(0, bMeta))); + } + else + { + tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue); + renderer.renderFaceYPos(block, x, y + RENDER_OFFSET, z, getIcon(block.getIcon(1, bMeta))); + } + } + + for (int side = 0; side < 4; ++side) + { + int x2 = x; + int z2 = z; + + switch (side) + { + case 0: --z2; break; + case 1: ++z2; break; + case 2: --x2; break; + case 3: ++x2; break; + } + + IIcon iconFlow = getIcon(block.getIcon(side + 2, bMeta)); + if (renderer.renderAllFaces || renderSides[side]) + { + rendered = true; + + double ty1; + double tx1; + double ty2; + double tx2; + double tz1; + double tz2; + + if (side == 0) + { + ty1 = heightNW; + ty2 = heightNE; + tx1 = x; + tx2 = x + 1; + tz1 = z + RENDER_OFFSET; + tz2 = z + RENDER_OFFSET; + } + else if (side == 1) + { + ty1 = heightSE; + ty2 = heightSW; + tx1 = x + 1; + tx2 = x; + tz1 = z + 1 - RENDER_OFFSET; + tz2 = z + 1 - RENDER_OFFSET; + } + else if (side == 2) + { + ty1 = heightSW; + ty2 = heightNW; + tx1 = x + RENDER_OFFSET; + tx2 = x + RENDER_OFFSET; + tz1 = z + 1; + tz2 = z; + } + else + { + ty1 = heightNE; + ty2 = heightSE; + tx1 = x + 1 - RENDER_OFFSET; + tx2 = x + 1 - RENDER_OFFSET; + tz1 = z; + tz2 = z + 1; + } + + float u1Flow = iconFlow.getInterpolatedU(0.0D); + float u2Flow = iconFlow.getInterpolatedU(8.0D); + float v1Flow = iconFlow.getInterpolatedV((1.0D - ty1) * 16.0D * 0.5D); + float v2Flow = iconFlow.getInterpolatedV((1.0D - ty2) * 16.0D * 0.5D); + float v3Flow = iconFlow.getInterpolatedV(8.0D); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x2, y, z2)); + float sideLighting = 1.0F; + + if (side < 2) + { + sideLighting = LIGHT_XZ_NEG; + } + else + { + sideLighting = LIGHT_XZ_POS; + } + + tessellator.setColorOpaque_F(LIGHT_Y_POS * sideLighting * red, LIGHT_Y_POS * sideLighting * green, LIGHT_Y_POS * sideLighting * blue); + + if (!rises) + { + tessellator.addVertexWithUV(tx1, y + ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); + tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); + tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + + tessellator.addVertexWithUV(tx1, y + ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); + } + else + { + tessellator.addVertexWithUV(tx1, y + 1 - 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); + tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + + tessellator.addVertexWithUV(tx1, y + 1 - 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); + tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); + } + } + } + renderer.renderMinY = 0; + renderer.renderMaxY = 1; + return rendered; + } + } + + @Override + public boolean shouldRender3DInInventory(int modelId){ return false; } + @Override + public int getRenderId() + { + return FluidRegistry.renderIdFluid; + } + + + private IIcon getIcon(IIcon icon) + { + if (icon != null) return icon; + return ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/fluids/TileFluidHandler.java b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/TileFluidHandler.java new file mode 100644 index 0000000..f03eec8 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/fluids/TileFluidHandler.java @@ -0,0 +1,72 @@ + +package net.minecraftforge.fluids; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +/** + * Reference Tile Entity implementation of {@link IFluidHandler}. Use/extend this or write your own. + * + * @author King Lemming + * + */ +public class TileFluidHandler extends TileEntity implements IFluidHandler +{ + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + tank.readFromNBT(tag); + } + + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + tank.writeToNBT(tag); + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/oredict/OreDictionary.java b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/OreDictionary.java new file mode 100644 index 0000000..e0453db --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/OreDictionary.java @@ -0,0 +1,687 @@ +package net.minecraftforge.oredict; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.RandomAccess; +import java.util.Map.Entry; +import java.util.Set; + +import org.apache.logging.log4j.Level; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraftforge.common.MinecraftForge; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.registry.GameData; + +public class OreDictionary +{ + private static boolean hasInit = false; + private static List idToName = new ArrayList(); + private static Map nameToId = new HashMap(128); + private static List> idToStack = Lists.newArrayList(); //ToDo: Unqualify to List when possible {1.8} + private static List> idToStackUn = Lists.newArrayList(); //ToDo: Unqualify to List when possible {1.8} + private static Map> stackToId = Maps.newHashMapWithExpectedSize(96); // Calculated from 128 * 0.75 + public static final ArrayList EMPTY_LIST = new UnmodifiableArrayList(Lists.newArrayList()); //ToDo: Unqualify to List when possible {1.8} + + /** + * Minecraft changed from -1 to Short.MAX_VALUE in 1.5 release for the "block wildcard". Use this in case it + * changes again. + */ + public static final int WILDCARD_VALUE = Short.MAX_VALUE; + + static { + initVanillaEntries(); + } + + @SuppressWarnings("unchecked") + public static void initVanillaEntries() + { + if (!hasInit) + { + registerOre("logWood", new ItemStack(Blocks.log, 1, WILDCARD_VALUE)); + registerOre("logWood", new ItemStack(Blocks.log2, 1, WILDCARD_VALUE)); + registerOre("plankWood", new ItemStack(Blocks.planks, 1, WILDCARD_VALUE)); + registerOre("slabWood", new ItemStack(Blocks.wooden_slab, 1, WILDCARD_VALUE)); + registerOre("stairWood", Blocks.oak_stairs); + registerOre("stairWood", Blocks.spruce_stairs); + registerOre("stairWood", Blocks.birch_stairs); + registerOre("stairWood", Blocks.jungle_stairs); + registerOre("stairWood", Blocks.acacia_stairs); + registerOre("stairWood", Blocks.dark_oak_stairs); + registerOre("stickWood", Items.stick); + registerOre("treeSapling", new ItemStack(Blocks.sapling, 1, WILDCARD_VALUE)); + registerOre("treeLeaves", new ItemStack(Blocks.leaves, 1, WILDCARD_VALUE)); + registerOre("treeLeaves", new ItemStack(Blocks.leaves2, 1, WILDCARD_VALUE)); + registerOre("oreGold", Blocks.gold_ore); + registerOre("oreIron", Blocks.iron_ore); + registerOre("oreLapis", Blocks.lapis_ore); + registerOre("oreDiamond", Blocks.diamond_ore); + registerOre("oreRedstone", Blocks.redstone_ore); + registerOre("oreEmerald", Blocks.emerald_ore); + registerOre("oreQuartz", Blocks.quartz_ore); + registerOre("oreCoal", Blocks.coal_ore); + registerOre("blockGold", Blocks.gold_block); + registerOre("blockIron", Blocks.iron_block); + registerOre("blockLapis", Blocks.lapis_block); + registerOre("blockDiamond", Blocks.diamond_block); + registerOre("blockRedstone", Blocks.redstone_block); + registerOre("blockEmerald", Blocks.emerald_block); + registerOre("blockQuartz", Blocks.quartz_block); + registerOre("blockCoal", Blocks.coal_block); + registerOre("blockGlassColorless", Blocks.glass); + registerOre("blockGlass", Blocks.glass); + registerOre("blockGlass", new ItemStack(Blocks.stained_glass, 1, WILDCARD_VALUE)); + //blockGlass{Color} is added below with dyes + registerOre("paneGlassColorless", Blocks.glass_pane); + registerOre("paneGlass", Blocks.glass_pane); + registerOre("paneGlass", new ItemStack(Blocks.stained_glass_pane, 1, WILDCARD_VALUE)); + //paneGlass{Color} is added below with dyes + registerOre("ingotIron", Items.iron_ingot); + registerOre("ingotGold", Items.gold_ingot); + registerOre("ingotBrick", Items.brick); + registerOre("ingotBrickNether", Items.netherbrick); + registerOre("nuggetGold", Items.gold_nugget); + registerOre("gemDiamond", Items.diamond); + registerOre("gemEmerald", Items.emerald); + registerOre("gemQuartz", Items.quartz); + registerOre("dustRedstone", Items.redstone); + registerOre("dustGlowstone", Items.glowstone_dust); + registerOre("gemLapis", new ItemStack(Items.dye, 1, 4)); + registerOre("slimeball", Items.slime_ball); + registerOre("glowstone", Blocks.glowstone); + registerOre("cropWheat", Items.wheat); + registerOre("cropPotato", Items.potato); + registerOre("cropCarrot", Items.carrot); + registerOre("stone", Blocks.stone); + registerOre("cobblestone", Blocks.cobblestone); + registerOre("sandstone", new ItemStack(Blocks.sandstone, 1, WILDCARD_VALUE)); + registerOre("sand", new ItemStack(Blocks.sand, 1, WILDCARD_VALUE)); + registerOre("dye", new ItemStack(Items.dye, 1, WILDCARD_VALUE)); + registerOre("record", Items.record_13); + registerOre("record", Items.record_cat); + registerOre("record", Items.record_blocks); + registerOre("record", Items.record_chirp); + registerOre("record", Items.record_far); + registerOre("record", Items.record_mall); + registerOre("record", Items.record_mellohi); + registerOre("record", Items.record_stal); + registerOre("record", Items.record_strad); + registerOre("record", Items.record_ward); + registerOre("record", Items.record_11); + registerOre("record", Items.record_wait); + } + + // Build our list of items to replace with ore tags + Map replacements = new HashMap(); + replacements.put(new ItemStack(Items.stick), "stickWood"); + replacements.put(new ItemStack(Blocks.planks), "plankWood"); + replacements.put(new ItemStack(Blocks.planks, 1, WILDCARD_VALUE), "plankWood"); + replacements.put(new ItemStack(Blocks.stone), "stone"); + replacements.put(new ItemStack(Blocks.stone, 1, WILDCARD_VALUE), "stone"); + replacements.put(new ItemStack(Blocks.cobblestone), "cobblestone"); + replacements.put(new ItemStack(Blocks.cobblestone, 1, WILDCARD_VALUE), "cobblestone"); + replacements.put(new ItemStack(Items.gold_ingot), "ingotGold"); + replacements.put(new ItemStack(Items.iron_ingot), "ingotIron"); + replacements.put(new ItemStack(Items.diamond), "gemDiamond"); + replacements.put(new ItemStack(Items.emerald), "gemEmerald"); + replacements.put(new ItemStack(Items.redstone), "dustRedstone"); + replacements.put(new ItemStack(Items.glowstone_dust), "dustGlowstone"); + replacements.put(new ItemStack(Blocks.glowstone), "glowstone"); + replacements.put(new ItemStack(Items.slime_ball), "slimeball"); + replacements.put(new ItemStack(Blocks.glass), "blockGlassColorless"); + + // Register dyes + String[] dyes = + { + "Black", + "Red", + "Green", + "Brown", + "Blue", + "Purple", + "Cyan", + "LightGray", + "Gray", + "Pink", + "Lime", + "Yellow", + "LightBlue", + "Magenta", + "Orange", + "White" + }; + + for(int i = 0; i < 16; i++) + { + ItemStack dye = new ItemStack(Items.dye, 1, i); + ItemStack block = new ItemStack(Blocks.stained_glass, 1, 15 - i); + ItemStack pane = new ItemStack(Blocks.stained_glass_pane, 1, 15 - i); + if (!hasInit) + { + registerOre("dye" + dyes[i], dye); + registerOre("blockGlass" + dyes[i], block); + registerOre("paneGlass" + dyes[i], pane); + } + replacements.put(dye, "dye" + dyes[i]); + replacements.put(block, "blockGlass" + dyes[i]); + replacements.put(pane, "paneGlass" + dyes[i]); + } + hasInit = true; + + ItemStack[] replaceStacks = replacements.keySet().toArray(new ItemStack[replacements.keySet().size()]); + + // Ignore recipes for the following items + ItemStack[] exclusions = new ItemStack[] + { + new ItemStack(Blocks.lapis_block), + new ItemStack(Items.cookie), + new ItemStack(Blocks.stonebrick), + new ItemStack(Blocks.stone_slab, 1, WILDCARD_VALUE), + new ItemStack(Blocks.stone_stairs), + new ItemStack(Blocks.cobblestone_wall), + new ItemStack(Blocks.oak_stairs), + new ItemStack(Blocks.spruce_stairs), + new ItemStack(Blocks.birch_stairs), + new ItemStack(Blocks.jungle_stairs), + new ItemStack(Blocks.acacia_stairs), + new ItemStack(Blocks.dark_oak_stairs), + new ItemStack(Blocks.glass_pane) + }; + + List recipes = CraftingManager.getInstance().getRecipeList(); + List recipesToRemove = new ArrayList(); + List recipesToAdd = new ArrayList(); + + // Search vanilla recipes for recipes to replace + for(Object obj : recipes) + { + if(obj instanceof ShapedRecipes) + { + ShapedRecipes recipe = (ShapedRecipes)obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions, output)) + { + continue; + } + + if(containsMatch(true, recipe.recipeItems, replaceStacks)) + { + recipesToRemove.add(recipe); + recipesToAdd.add(new ShapedOreRecipe(recipe, replacements)); + } + } + else if(obj instanceof ShapelessRecipes) + { + ShapelessRecipes recipe = (ShapelessRecipes)obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions, output)) + { + continue; + } + + if(containsMatch(true, (ItemStack[])recipe.recipeItems.toArray(new ItemStack[recipe.recipeItems.size()]), replaceStacks)) + { + recipesToRemove.add((IRecipe)obj); + IRecipe newRecipe = new ShapelessOreRecipe(recipe, replacements); + recipesToAdd.add(newRecipe); + } + } + } + + recipes.removeAll(recipesToRemove); + recipes.addAll(recipesToAdd); + if (recipesToRemove.size() > 0) + { + FMLLog.info("Replaced %d ore recipies", recipesToRemove.size()); + } + } + + /** + * Gets the integer ID for the specified ore name. + * If the name does not have a ID it assigns it a new one. + * + * @param name The unique name for this ore 'oreIron', 'ingotIron', etc.. + * @return A number representing the ID for this ore type + */ + public static int getOreID(String name) + { + Integer val = nameToId.get(name); + if (val == null) + { + idToName.add(name); + val = idToName.size() - 1; //0 indexed + nameToId.put(name, val); + idToStack.add(new ArrayList()); + idToStackUn.add(new UnmodifiableArrayList(idToStack.get(val))); + } + return val; + } + + /** + * Reverse of getOreID, will not create new entries. + * + * @param id The ID to translate to a string + * @return The String name, or "Unknown" if not found. + */ + public static String getOreName(int id) + { + return (id >= 0 && id < idToName.size()) ? idToName.get(id) : "Unknown"; + } + + /** + * Gets the integer ID for the specified item stack. + * If the item stack is not linked to any ore, this will return -1 and no new entry will be created. + * + * @param stack The item stack of the ore. + * @return A number representing the ID for this ore type, or -1 if couldn't find it. + */ + @Deprecated // Use getOreIds below for more accuracy + public static int getOreID(ItemStack stack) + { + if (stack == null || stack.getItem() == null) return -1; + + // HACK: use the registry name's ID. It is unique and it knows about substitutions. Fallback to a -1 value (what Item.getIDForItem would have returned) in the case where the registry is not aware of the item yet + // IT should be noted that -1 will fail the gate further down, if an entry already exists with value -1 for this name. This is what is broken and being warned about. + // APPARENTLY it's quite common to do this. OreDictionary should be considered alongside Recipes - you can't make them properly until you've registered with the game. + String registryName = stack.getItem().delegate.name(); + int id; + if (registryName == null) + { + FMLLog.log(Level.DEBUG, "Attempted to find the oreIDs for an unregistered object (%s). This won't work very well.", stack); + return -1; + } + else + { + id = GameData.getItemRegistry().getId(registryName); + } + List ids = stackToId.get(id); //Try the wildcard first + if (ids == null || ids.size() == 0) + { + ids = stackToId.get(id | ((stack.getItemDamage() + 1) << 16)); // Mow the Meta specific one, +1 so that meta 0 is significant + } + return (ids != null && ids.size() > 0) ? ids.get(0) : -1; + } + + /** + * Gets all the integer ID for the ores that the specified item stakc is registered to. + * If the item stack is not linked to any ore, this will return an empty array and no new entry will be created. + * + * @param stack The item stack of the ore. + * @return An array of ids that this ore is registerd as. + */ + public static int[] getOreIDs(ItemStack stack) + { + if (stack == null || stack.getItem() == null) return new int[0]; + + Set set = new HashSet(); + + // HACK: use the registry name's ID. It is unique and it knows about substitutions. Fallback to a -1 value (what Item.getIDForItem would have returned) in the case where the registry is not aware of the item yet + // IT should be noted that -1 will fail the gate further down, if an entry already exists with value -1 for this name. This is what is broken and being warned about. + // APPARENTLY it's quite common to do this. OreDictionary should be considered alongside Recipes - you can't make them properly until you've registered with the game. + String registryName = stack.getItem().delegate.name(); + int id; + if (registryName == null) + { + FMLLog.log(Level.DEBUG, "Attempted to find the oreIDs for an unregistered object (%s). This won't work very well.", stack); + return new int[0]; + } + else + { + id = GameData.getItemRegistry().getId(registryName); + } + List ids = stackToId.get(id); + if (ids != null) set.addAll(ids); + ids = stackToId.get(id | ((stack.getItemDamage() + 1) << 16)); + if (ids != null) set.addAll(ids); + + Integer[] tmp = set.toArray(new Integer[set.size()]); + int[] ret = new int[tmp.length]; + for (int x = 0; x < tmp.length; x++) + ret[x] = tmp[x]; + return ret; + } + + /** + * Retrieves the ArrayList of items that are registered to this ore type. + * Creates the list as empty if it did not exist. + * + * The returned List is unmodifiable, but will be updated if a new ore + * is registered using registerOre + * + * @param name The ore name, directly calls getOreID + * @return An arrayList containing ItemStacks registered for this ore + */ + public static ArrayList getOres(String name) //TODO: 1.8 ArrayList -> List + { + return getOres(getOreID(name)); + } + + /** + * Retrieves the List of items that are registered to this ore type at this instant. + * If the flag is TRUE, then it will create the list as empty if it did not exist. + * + * This option should be used by modders who are doing blanket scans in postInit. + * It greatly reduces clutter in the OreDictionary is the responsible and proper + * way to use the dictionary in a large number of cases. + * + * The other function above is utilized in OreRecipe and is required for the + * operation of that code. + * + * @param name The ore name, directly calls getOreID if the flag is TRUE + * @param alwaysCreateEntry Flag - should a new entry be created if empty + * @return An arraylist containing ItemStacks registered for this ore + */ + public static List getOres(String name, boolean alwaysCreateEntry) + { + if (alwaysCreateEntry) { + return getOres(getOreID(name)); + } + return nameToId.get(name) != null ? getOres(getOreID(name)) : EMPTY_LIST; + } + + /** + * Returns whether or not an oreName exists in the dictionary. + * This function can be used to safely query the Ore Dictionary without + * adding needless clutter to the underlying map structure. + * + * Please use this when possible and appropriate. + * + * @param name The ore name + * @return Whether or not that name is in the Ore Dictionary. + */ + public static boolean doesOreNameExist(String name) + { + return nameToId.get(name) != null; + } + + /** + * Retrieves a list of all unique ore names that are already registered. + * + * @return All unique ore names that are currently registered. + */ + public static String[] getOreNames() + { + return idToName.toArray(new String[idToName.size()]); + } + + /** + * Retrieves the ArrayList of items that are registered to this ore type. + * Creates the list as empty if it did not exist. + * + * Warning: In 1.8, the return value will become a immutible list, + * and this function WILL NOT create the entry if the ID doesn't exist, + * IDs are intended to be internal OreDictionary things and modders + * should not ever code them in. + * + * @param id The ore ID, see getOreID + * @return An List containing ItemStacks registered for this ore + */ + @Deprecated // Use the named version not int + public static ArrayList getOres(Integer id) //TODO: delete in 1.8 in favor of unboxed version below + { + return getOres((int)id.intValue()); + } + private static ArrayList getOres(int id) //TODO: change to ImmutibleList in 1.8, also make private + { + while (idToName.size() < id + 1) // TODO: Remove this in 1.8, this is only for backwards compatibility + { + String name = "Filler: " + idToName.size(); + idToName.add(name); + nameToId.put(name, idToName.size() - 1); //0 indexed + idToStack.add(null); + idToStackUn.add(EMPTY_LIST); + } + return idToStackUn.size() > id ? idToStackUn.get(id) : EMPTY_LIST; + } + + private static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets) + { + for (ItemStack input : inputs) + { + for (ItemStack target : targets) + { + if (itemMatches(target, input, strict)) + { + return true; + } + } + } + return false; + } + + private static boolean containsMatch(boolean strict, List inputs, ItemStack... targets) + { + for (ItemStack input : inputs) + { + for (ItemStack target : targets) + { + if (itemMatches(target, input, strict)) + { + return true; + } + } + } + return false; + } + + public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict) + { + if (input == null && target != null || input != null && target == null) + { + return false; + } + return (target.getItem() == input.getItem() && ((target.getItemDamage() == WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage())); + } + + //Convenience functions that make for cleaner code mod side. They all drill down to registerOre(String, int, ItemStack) + public static void registerOre(String name, Item ore){ registerOre(name, new ItemStack(ore)); } + public static void registerOre(String name, Block ore){ registerOre(name, new ItemStack(ore)); } + public static void registerOre(String name, ItemStack ore){ registerOreImpl(name, ore); } + @Deprecated //Use named, not ID in 1.8+ + public static void registerOre(int id, Item ore){ registerOre(id, new ItemStack(ore)); } + @Deprecated //Use named, not ID in 1.8+ + public static void registerOre(int id, Block ore){ registerOre(id, new ItemStack(ore)); } + @Deprecated //Use named, not ID in 1.8+ + public static void registerOre(int id, ItemStack ore){ registerOreImpl(getOreName(id), ore); } + + /** + * Registers a ore item into the dictionary. + * Raises the registerOre function in all registered handlers. + * + * @param name The name of the ore + * @param id The ID of the ore + * @param ore The ore's ItemStack + */ + private static void registerOreImpl(String name, ItemStack ore) + { + if (name == null || name.isEmpty() || "Unknown".equals(name)) return; //prevent bad IDs. + if (ore == null || ore.getItem() == null) + { + FMLLog.bigWarning("Invalid registration attempt for an Ore Dictionary item with name %s has occurred. The registration has been denied to prevent crashes. The mod responsible for the registration needs to correct this.", name); + return; //prevent bad ItemStacks. + } + + int oreID = getOreID(name); + // HACK: use the registry name's ID. It is unique and it knows about substitutions. Fallback to a -1 value (what Item.getIDForItem would have returned) in the case where the registry is not aware of the item yet + // IT should be noted that -1 will fail the gate further down, if an entry already exists with value -1 for this name. This is what is broken and being warned about. + // APPARENTLY it's quite common to do this. OreDictionary should be considered alongside Recipes - you can't make them properly until you've registered with the game. + String registryName = ore.getItem().delegate.name(); + int hash; + if (registryName == null) + { + FMLLog.bigWarning("A broken ore dictionary registration with name %s has occurred. It adds an item (type: %s) which is currently unknown to the game registry. This dictionary item can only support a single value when" + + " registered with ores like this, and NO I am not going to turn this spam off. Just register your ore dictionary entries after the GameRegistry.\n" + + "TO USERS: YES this is a BUG in the mod "+Loader.instance().activeModContainer().getName()+" report it to them!", name, ore.getItem().getClass()); + hash = -1; + } + else + { + hash = GameData.getItemRegistry().getId(registryName); + } + if (ore.getItemDamage() != WILDCARD_VALUE) + { + hash |= ((ore.getItemDamage() + 1) << 16); // +1 so 0 is significant + } + + //Add things to the baked version, and prevent duplicates + List ids = stackToId.get(hash); + if (ids != null && ids.contains(oreID)) return; + if (ids == null) + { + ids = Lists.newArrayList(); + stackToId.put(hash, ids); + } + ids.add(oreID); + + //Add to the unbaked version + ore = ore.copy(); + idToStack.get(oreID).add(ore); + MinecraftForge.EVENT_BUS.post(new OreRegisterEvent(name, ore)); + } + + public static class OreRegisterEvent extends Event + { + public final String Name; + public final ItemStack Ore; + + public OreRegisterEvent(String name, ItemStack ore) + { + this.Name = name; + this.Ore = ore; + } + } + + public static void rebakeMap() + { + //System.out.println("Baking OreDictionary:"); + stackToId.clear(); + for (int id = 0; id < idToStack.size(); id++) + { + List ores = idToStack.get(id); + if (ores == null) continue; + for (ItemStack ore : ores) + { + // HACK: use the registry name's ID. It is unique and it knows about substitutions + String name = ore.getItem().delegate.name(); + int hash; + if (name == null) + { + FMLLog.log(Level.DEBUG, "Defaulting unregistered ore dictionary entry for ore dictionary %s: type %s to -1", getOreName(id), ore.getItem().getClass()); + hash = -1; + } + else + { + hash = GameData.getItemRegistry().getId(name); + } + if (ore.getItemDamage() != WILDCARD_VALUE) + { + hash |= ((ore.getItemDamage() + 1) << 16); // +1 so meta 0 is significant + } + List ids = stackToId.get(hash); + if (ids == null) + { + ids = Lists.newArrayList(); + stackToId.put(hash, ids); + } + ids.add(id); + //System.out.println(id + " " + getOreName(id) + " " + Integer.toHexString(hash) + " " + ore); + } + } + } + + + //Pulled from Collections.UnmodifiableList, as we need to explicitly subclass ArrayList for backward compatibility. + //Delete this class in 1.8 when we loose the ArrayList specific return types. + private static class UnmodifiableArrayList extends ArrayList + { + final ArrayList list; + + UnmodifiableArrayList(ArrayList list) + { + super(0); + this.list = list; + } + + public ListIterator listIterator() {return listIterator(0); } + public boolean equals(Object o) { return o == this || list.equals(o); } + public int hashCode() { return list.hashCode(); } + public E get(int index) { return list.get(index); } + public int indexOf(Object o) { return list.indexOf(o); } + public int lastIndexOf(Object o) { return list.lastIndexOf(o); } + public int size() { return list.size(); } + public boolean isEmpty() { return list.isEmpty(); } + public boolean contains(Object o) { return list.contains(o); } + public Object[] toArray() { return list.toArray(); } + public T[] toArray(T[] a) { return list.toArray(a); } + public String toString() { return list.toString(); } + public boolean containsAll(Collection coll) { return list.containsAll(coll); } + + public E set(int index, E element) { throw new UnsupportedOperationException(); } + public void add(int index, E element) { throw new UnsupportedOperationException(); } + public E remove(int index) { throw new UnsupportedOperationException(); } + public boolean add(E e) { throw new UnsupportedOperationException(); } + public boolean remove(Object o) { throw new UnsupportedOperationException(); } + public void clear() { throw new UnsupportedOperationException(); } + public boolean removeAll(Collection coll) { throw new UnsupportedOperationException(); } + public boolean retainAll(Collection coll) { throw new UnsupportedOperationException(); } + public boolean addAll(Collection coll) { throw new UnsupportedOperationException(); } + public boolean addAll(int index, Collection c) { throw new UnsupportedOperationException(); } + + public ListIterator listIterator(final int index) + { + return new ListIterator() + { + private final ListIterator i = list.listIterator(index); + public boolean hasNext() {return i.hasNext();} + public E next() {return i.next();} + public boolean hasPrevious() {return i.hasPrevious();} + public E previous() {return i.previous();} + public int nextIndex() {return i.nextIndex();} + public int previousIndex() {return i.previousIndex();} + + public void remove() { throw new UnsupportedOperationException(); } + public void set(E e) { throw new UnsupportedOperationException(); } + public void add(E e) { throw new UnsupportedOperationException(); } + }; + } + + public List subList(int fromIndex, int toIndex) + { + return Collections.unmodifiableList(list.subList(fromIndex, toIndex)); + } + + public Iterator iterator() + { + return new Iterator() + { + private final Iterator i = list.iterator(); + + public boolean hasNext() { return i.hasNext(); } + public E next() { return i.next(); } + public void remove() { throw new UnsupportedOperationException(); } + }; + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/oredict/RecipeSorter.java b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/RecipeSorter.java new file mode 100644 index 0000000..0057513 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/RecipeSorter.java @@ -0,0 +1,273 @@ +package net.minecraftforge.oredict; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.toposort.TopologicalSort; +import cpw.mods.fml.common.toposort.TopologicalSort.DirectedGraph; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.RecipeBookCloning; +import net.minecraft.item.crafting.RecipeFireworks; +import net.minecraft.item.crafting.RecipesArmorDyes; +import net.minecraft.item.crafting.RecipesMapCloning; +import net.minecraft.item.crafting.RecipesMapExtending; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import static net.minecraftforge.oredict.RecipeSorter.Category.*; + +@SuppressWarnings("rawtypes") +public class RecipeSorter implements Comparator +{ + public enum Category + { + UNKNOWN, + SHAPELESS, + SHAPED + }; + + private static class SortEntry + { + private String name; + private Class cls; + private Category cat; + List before = Lists.newArrayList(); + List after = Lists.newArrayList(); + + private SortEntry(String name, Class cls, Category cat, String deps) + { + this.name = name; + this.cls = cls; + this.cat = cat; + parseDepends(deps); + } + + private void parseDepends(String deps) + { + if (deps.isEmpty()) return; + for (String dep : deps.split(" ")) + { + if (dep.startsWith("before:")) + { + before.add(dep.substring(7)); + } + else if (dep.startsWith("after:")) + { + after.add(dep.substring(6)); + } + else + { + throw new IllegalArgumentException("Invalid dependancy: " + dep); + } + } + } + + @Override + public String toString() + { + StringBuilder buf = new StringBuilder(); + buf.append("RecipeEntry(\"").append(name).append("\", "); + buf.append(cat.name()).append(", "); + buf.append(cls == null ? "" : cls.getName()).append(")"); + + if (before.size() > 0) + { + buf.append(" Before: ").append(Joiner.on(", ").join(before)); + } + + if (after.size() > 0) + { + buf.append(" After: ").append(Joiner.on(", ").join(after)); + } + + return buf.toString(); + } + + @Override + public int hashCode() + { + return name.hashCode(); + } + }; + + private static Map categories = Maps.newHashMap(); + //private static Map types = Maps.newHashMap(); + private static Map entries = Maps.newHashMap(); + private static Map priorities = Maps.newHashMap(); + + public static RecipeSorter INSTANCE = new RecipeSorter(); + private static boolean isDirty = true; + + private static SortEntry before = new SortEntry("Before", null, UNKNOWN, ""); + private static SortEntry after = new SortEntry("After", null, UNKNOWN, ""); + + private RecipeSorter() + { + register("minecraft:shaped", ShapedRecipes.class, SHAPED, "before:minecraft:shapeless"); + register("minecraft:mapextending", RecipesMapExtending.class, SHAPED, "after:minecraft:shaped before:minecraft:shapeless"); + register("minecraft:shapeless", ShapelessRecipes.class, SHAPELESS, "after:minecraft:shaped"); + register("minecraft:bookcloning", RecipeBookCloning.class, SHAPELESS, "after:minecraft:shapeless"); //Size 9 + register("minecraft:fireworks", RecipeFireworks.class, SHAPELESS, "after:minecraft:shapeless"); //Size 10 + register("minecraft:armordyes", RecipesArmorDyes.class, SHAPELESS, "after:minecraft:shapeless"); //Size 10 + register("minecraft:mapcloning", RecipesMapCloning.class, SHAPELESS, "after:minecraft:shapeless"); //Size 10 + + register("forge:shapedore", ShapedOreRecipe.class, SHAPED, "after:minecraft:shaped before:minecraft:shapeless"); + register("forge:shapelessore", ShapelessOreRecipe.class, SHAPELESS, "after:minecraft:shapeless"); + } + + @Override + public int compare(IRecipe r1, IRecipe r2) + { + Category c1 = getCategory(r1); + Category c2 = getCategory(r2); + if (c1 == SHAPELESS && c2 == SHAPED) return 1; + if (c1 == SHAPED && c2 == SHAPELESS) return -1; + if (r2.getRecipeSize() < r1.getRecipeSize()) return -1; + if (r2.getRecipeSize() > r1.getRecipeSize()) return 1; + return getPriority(r2) - getPriority(r1); // high priority value first! + } + + private static Set warned = Sets.newHashSet(); + @SuppressWarnings("unchecked") + public static void sortCraftManager() + { + bake(); + FMLLog.fine("Sorting recipies"); + warned.clear(); + Collections.sort(CraftingManager.getInstance().getRecipeList(), INSTANCE); + } + + public static void register(String name, Class recipe, Category category, String dependancies) + { + assert(category != UNKNOWN) : "Category must not be unknown!"; + isDirty = true; + + SortEntry entry = new SortEntry(name, recipe, category, dependancies); + entries.put(name, entry); + setCategory(recipe, category); + } + + public static void setCategory(Class recipe, Category category) + { + assert(category != UNKNOWN) : "Category must not be unknown!"; + categories.put(recipe, category); + } + + public static Category getCategory(IRecipe recipe) + { + return getCategory(recipe.getClass()); + } + + public static Category getCategory(Class recipe) + { + Class cls = recipe; + Category ret = categories.get(cls); + + if (ret == null) + { + while (cls != Object.class) + { + cls = cls.getSuperclass(); + ret = categories.get(cls); + if (ret != null) + { + categories.put(recipe, ret); + return ret; + } + } + } + + return ret == null ? UNKNOWN : ret; + } + + private static int getPriority(IRecipe recipe) + { + Class cls = recipe.getClass(); + Integer ret = priorities.get(cls); + + if (ret == null) + { + if (!warned.contains(cls)) + { + FMLLog.info(" Unknown recipe class! %s Modder please refer to %s", cls.getName(), RecipeSorter.class.getName()); + warned.add(cls); + } + cls = cls.getSuperclass(); + while (cls != Object.class) + { + ret = priorities.get(cls); + if (ret != null) + { + priorities.put(recipe.getClass(), ret); + FMLLog.fine(" Parent Found: %d - %s", ret.intValue(), cls.getName()); + return ret.intValue(); + } + } + } + + return ret == null ? 0 : ret.intValue(); + } + + private static void bake() + { + if (!isDirty) return; + FMLLog.fine("Forge RecipeSorter Baking:"); + DirectedGraph sorter = new DirectedGraph(); + sorter.addNode(before); + sorter.addNode(after); + sorter.addEdge(before, after); + + for (Map.Entry entry : entries.entrySet()) + { + sorter.addNode(entry.getValue()); + } + + for (Map.Entry e : entries.entrySet()) + { + SortEntry entry = e.getValue(); + boolean postAdded = false; + + sorter.addEdge(before, entry); + for (String dep : entry.after) + { + if (entries.containsKey(dep)) + { + sorter.addEdge(entries.get(dep), entry); + } + } + + for (String dep : entry.before) + { + postAdded = true; + sorter.addEdge(entry, after); + if (entries.containsKey(dep)) + { + sorter.addEdge(entry, entries.get(dep)); + } + } + + if (!postAdded) + { + sorter.addEdge(entry, after); + } + } + + + List sorted = TopologicalSort.topologicalSort(sorter); + int x = sorted.size(); + for (SortEntry entry : sorted) + { + FMLLog.fine(" %d: %s", x, entry); + priorities.put(entry.cls, x--); + } + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapedOreRecipe.java b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapedOreRecipe.java new file mode 100644 index 0000000..6abb50e --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapedOreRecipe.java @@ -0,0 +1,267 @@ +package net.minecraftforge.oredict; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.world.World; + +public class ShapedOreRecipe implements IRecipe +{ + //Added in for future ease of change, but hard coded for now. + private static final int MAX_CRAFT_GRID_WIDTH = 3; + private static final int MAX_CRAFT_GRID_HEIGHT = 3; + + private ItemStack output = null; + private Object[] input = null; + private int width = 0; + private int height = 0; + private boolean mirrored = true; + + public ShapedOreRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); } + public ShapedOreRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); } + public ShapedOreRecipe(ItemStack result, Object... recipe) + { + output = result.copy(); + + String shape = ""; + int idx = 0; + + if (recipe[idx] instanceof Boolean) + { + mirrored = (Boolean)recipe[idx]; + if (recipe[idx+1] instanceof Object[]) + { + recipe = (Object[])recipe[idx+1]; + } + else + { + idx = 1; + } + } + + if (recipe[idx] instanceof String[]) + { + String[] parts = ((String[])recipe[idx++]); + + for (String s : parts) + { + width = s.length(); + shape += s; + } + + height = parts.length; + } + else + { + while (recipe[idx] instanceof String) + { + String s = (String)recipe[idx++]; + shape += s; + width = s.length(); + height++; + } + } + + if (width * height != shape.length()) + { + String ret = "Invalid shaped ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + + HashMap itemMap = new HashMap(); + + for (; idx < recipe.length; idx += 2) + { + Character chr = (Character)recipe[idx]; + Object in = recipe[idx + 1]; + + if (in instanceof ItemStack) + { + itemMap.put(chr, ((ItemStack)in).copy()); + } + else if (in instanceof Item) + { + itemMap.put(chr, new ItemStack((Item)in)); + } + else if (in instanceof Block) + { + itemMap.put(chr, new ItemStack((Block)in, 1, OreDictionary.WILDCARD_VALUE)); + } + else if (in instanceof String) + { + itemMap.put(chr, OreDictionary.getOres((String)in)); + } + else + { + String ret = "Invalid shaped ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + } + + input = new Object[width * height]; + int x = 0; + for (char chr : shape.toCharArray()) + { + input[x++] = itemMap.get(chr); + } + } + + ShapedOreRecipe(ShapedRecipes recipe, Map replacements) + { + output = recipe.getRecipeOutput(); + width = recipe.recipeWidth; + height = recipe.recipeHeight; + + input = new Object[recipe.recipeItems.length]; + + for(int i = 0; i < input.length; i++) + { + ItemStack ingred = recipe.recipeItems[i]; + + if(ingred == null) continue; + + input[i] = recipe.recipeItems[i]; + + for(Entry replace : replacements.entrySet()) + { + if(OreDictionary.itemMatches(replace.getKey(), ingred, true)) + { + input[i] = OreDictionary.getOres(replace.getValue()); + break; + } + } + } + } + + /** + * Returns an Item that is the result of this recipe + */ + @Override + public ItemStack getCraftingResult(InventoryCrafting var1){ return output.copy(); } + + /** + * Returns the size of the recipe area + */ + @Override + public int getRecipeSize(){ return input.length; } + + @Override + public ItemStack getRecipeOutput(){ return output; } + + /** + * Used to check if a recipe matches current crafting inventory + */ + @Override + public boolean matches(InventoryCrafting inv, World world) + { + for (int x = 0; x <= MAX_CRAFT_GRID_WIDTH - width; x++) + { + for (int y = 0; y <= MAX_CRAFT_GRID_HEIGHT - height; ++y) + { + if (checkMatch(inv, x, y, false)) + { + return true; + } + + if (mirrored && checkMatch(inv, x, y, true)) + { + return true; + } + } + } + + return false; + } + + @SuppressWarnings("unchecked") + private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror) + { + for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) + { + for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++) + { + int subX = x - startX; + int subY = y - startY; + Object target = null; + + if (subX >= 0 && subY >= 0 && subX < width && subY < height) + { + if (mirror) + { + target = input[width - subX - 1 + subY * width]; + } + else + { + target = input[subX + subY * width]; + } + } + + ItemStack slot = inv.getStackInRowAndColumn(x, y); + + if (target instanceof ItemStack) + { + if (!OreDictionary.itemMatches((ItemStack)target, slot, false)) + { + return false; + } + } + else if (target instanceof ArrayList) + { + boolean matched = false; + + Iterator itr = ((ArrayList)target).iterator(); + while (itr.hasNext() && !matched) + { + matched = OreDictionary.itemMatches(itr.next(), slot, false); + } + + if (!matched) + { + return false; + } + } + else if (target == null && slot != null) + { + return false; + } + } + } + + return true; + } + + public ShapedOreRecipe setMirrored(boolean mirror) + { + mirrored = mirror; + return this; + } + + /** + * Returns the input for this recipe, any mod accessing this value should never + * manipulate the values in this array as it will effect the recipe itself. + * @return The recipes input vales. + */ + public Object[] getInput() + { + return this.input; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapelessOreRecipe.java b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapelessOreRecipe.java new file mode 100644 index 0000000..1b3f23b --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/oredict/ShapelessOreRecipe.java @@ -0,0 +1,158 @@ +package net.minecraftforge.oredict; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraft.world.World; + +public class ShapelessOreRecipe implements IRecipe +{ + private ItemStack output = null; + private ArrayList input = new ArrayList(); + + public ShapelessOreRecipe(Block result, Object... recipe){ this(new ItemStack(result), recipe); } + public ShapelessOreRecipe(Item result, Object... recipe){ this(new ItemStack(result), recipe); } + + public ShapelessOreRecipe(ItemStack result, Object... recipe) + { + output = result.copy(); + for (Object in : recipe) + { + if (in instanceof ItemStack) + { + input.add(((ItemStack)in).copy()); + } + else if (in instanceof Item) + { + input.add(new ItemStack((Item)in)); + } + else if (in instanceof Block) + { + input.add(new ItemStack((Block)in)); + } + else if (in instanceof String) + { + input.add(OreDictionary.getOres((String)in)); + } + else + { + String ret = "Invalid shapeless ore recipe: "; + for (Object tmp : recipe) + { + ret += tmp + ", "; + } + ret += output; + throw new RuntimeException(ret); + } + } + } + + @SuppressWarnings("unchecked") + ShapelessOreRecipe(ShapelessRecipes recipe, Map replacements) + { + output = recipe.getRecipeOutput(); + + for(ItemStack ingred : ((List)recipe.recipeItems)) + { + Object finalObj = ingred; + for(Entry replace : replacements.entrySet()) + { + if(OreDictionary.itemMatches(replace.getKey(), ingred, false)) + { + finalObj = OreDictionary.getOres(replace.getValue()); + break; + } + } + input.add(finalObj); + } + } + + /** + * Returns the size of the recipe area + */ + @Override + public int getRecipeSize(){ return input.size(); } + + @Override + public ItemStack getRecipeOutput(){ return output; } + + /** + * Returns an Item that is the result of this recipe + */ + @Override + public ItemStack getCraftingResult(InventoryCrafting var1){ return output.copy(); } + + /** + * Used to check if a recipe matches current crafting inventory + */ + @SuppressWarnings("unchecked") + @Override + public boolean matches(InventoryCrafting var1, World world) + { + ArrayList required = new ArrayList(input); + + for (int x = 0; x < var1.getSizeInventory(); x++) + { + ItemStack slot = var1.getStackInSlot(x); + + if (slot != null) + { + boolean inRecipe = false; + Iterator req = required.iterator(); + + while (req.hasNext()) + { + boolean match = false; + + Object next = req.next(); + + if (next instanceof ItemStack) + { + match = OreDictionary.itemMatches((ItemStack)next, slot, false); + } + else if (next instanceof ArrayList) + { + Iterator itr = ((ArrayList)next).iterator(); + while (itr.hasNext() && !match) + { + match = OreDictionary.itemMatches(itr.next(), slot, false); + } + } + + if (match) + { + inRecipe = true; + required.remove(next); + break; + } + } + + if (!inRecipe) + { + return false; + } + } + } + + return required.isEmpty(); + } + + /** + * Returns the input for this recipe, any mod accessing this value should never + * manipulate the values in this array as it will effect the recipe itself. + * @return The recipes input vales. + */ + public ArrayList getInput() + { + return this.input; + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/server/ForgeTimeTracker.java b/build/rfg/minecraft-src/java/net/minecraftforge/server/ForgeTimeTracker.java new file mode 100644 index 0000000..2644a80 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/server/ForgeTimeTracker.java @@ -0,0 +1,113 @@ +package net.minecraftforge.server; + +import java.lang.ref.WeakReference; +import java.util.Arrays; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import com.google.common.collect.MapMaker; + +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; + +public class ForgeTimeTracker { + public static boolean tileEntityTracking; + public static int tileEntityTrackingDuration; + public static long tileEntityTrackingTime; + + private Map tileEntityTimings; + private Map entityTimings; + + private static final ForgeTimeTracker INSTANCE = new ForgeTimeTracker(); + + private WeakReference tile; + private WeakReference entity; + + private long timing; + + private ForgeTimeTracker() + { + MapMaker mm = new MapMaker(); + mm.weakKeys(); + tileEntityTimings = mm.makeMap(); + entityTimings = mm.makeMap(); + } + + + private void trackTileStart(TileEntity tileEntity, long nanoTime) + { + if (tileEntityTrackingTime == 0) + { + tileEntityTrackingTime = nanoTime; + } + else if (tileEntityTrackingTime + tileEntityTrackingDuration < nanoTime) + { + tileEntityTracking = false; + tileEntityTrackingTime = 0; + + return; + } + tile = new WeakReference(tileEntity); + timing = nanoTime; + } + + + private void trackTileEnd(TileEntity tileEntity, long nanoTime) + { + if (tile == null || tile.get() != tileEntity) + { + tile = null; + // race, exit + return; + } + int[] timings = tileEntityTimings.get(tileEntity); + if (timings == null) + { + timings = new int[101]; + tileEntityTimings.put(tileEntity, timings); + } + int idx = timings[100] = (timings[100] + 1) % 100; + timings[idx] = (int) (nanoTime - timing); + } + + public static ImmutableMap getTileTimings() + { + return INSTANCE.buildImmutableTileEntityTimingMap(); + } + + private ImmutableMap buildImmutableTileEntityTimingMap() + { + Builder builder = ImmutableMap.builder(); + for (Entry entry : tileEntityTimings.entrySet()) + { + builder.put(entry.getKey(), Arrays.copyOfRange(entry.getValue(), 0, 100)); + } + return builder.build(); + } + + + public static void trackStart(TileEntity tileEntity) + { + if (!tileEntityTracking) return; + INSTANCE.trackTileStart(tileEntity, System.nanoTime()); + } + + public static void trackEnd(TileEntity tileEntity) + { + if (!tileEntityTracking) return; + INSTANCE.trackTileEnd(tileEntity, System.nanoTime()); + } + + public static void trackStart(Entity par1Entity) + { + + } + + public static void trackEnd(Entity par1Entity) + { + + } + +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/server/command/ForgeCommand.java b/build/rfg/minecraft-src/java/net/minecraftforge/server/command/ForgeCommand.java new file mode 100644 index 0000000..129461c --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/server/command/ForgeCommand.java @@ -0,0 +1,147 @@ +package net.minecraftforge.server.command; + +import java.lang.ref.WeakReference; +import java.text.DecimalFormat; +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.server.ForgeTimeTracker; + +public class ForgeCommand extends CommandBase { + + private static final DecimalFormat timeFormatter = new DecimalFormat("########0.000"); + private WeakReference server; + + public ForgeCommand(MinecraftServer server) + { + this.server = new WeakReference(server); + } + + @Override + public String getCommandName() + { + return "forge"; + } + + @Override + public String getCommandUsage(ICommandSender icommandsender) + { + return "commands.forge.usage"; + } + + /** + * Return the required permission level for this command. + */ + @Override + public int getRequiredPermissionLevel() + { + return 2; + } + @Override + public void processCommand(ICommandSender sender, String[] args) + { + if (args.length == 0) + { + throw new WrongUsageException("commands.forge.usage"); + } + else if ("help".equals(args[0])) + { + throw new WrongUsageException("commands.forge.usage"); + } + else if ("tps".equals(args[0])) + { + displayTPS(sender,args); + } + else if ("tpslog".equals(args[0])) + { + doTPSLog(sender,args); + } + else if ("track".equals(args[0])) + { + handleTracking(sender, args); + } + else + { + throw new WrongUsageException("commands.forge.usage"); + } + } + + private void handleTracking(ICommandSender sender, String[] args) + { + if (args.length != 3) + { + throw new WrongUsageException("commands.forge.usage.tracking"); + } + String type = args[1]; + int duration = parseIntBounded(sender, args[2], 1, 60); + + if ("te".equals(type)) + { + doTurnOnTileEntityTracking(sender, duration); + } + else + { + throw new WrongUsageException("commands.forge.usage.tracking"); + } + } + + private void doTurnOnTileEntityTracking(ICommandSender sender, int duration) + { + ForgeTimeTracker.tileEntityTrackingDuration = duration; + ForgeTimeTracker.tileEntityTracking = true; + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tracking.te.enabled", duration)); + } + + private void doTPSLog(ICommandSender sender, String[] args) + { + + } + + private void displayTPS(ICommandSender sender, String[] args) + { + int dim = 0; + boolean summary = true; + if (args.length > 1) + { + dim = parseInt(sender, args[1]); + summary = false; + } + if (summary) + { + for (Integer dimId : DimensionManager.getIDs()) + { + double worldTickTime = ForgeCommand.mean(this.getServer().worldTickTimes.get(dimId)) * 1.0E-6D; + double worldTPS = Math.min(1000.0/worldTickTime, 20); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dimId), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); + } + double meanTickTime = ForgeCommand.mean(this.getServer().tickTimeArray) * 1.0E-6D; + double meanTPS = Math.min(1000.0/meanTickTime, 20); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary","Overall", timeFormatter.format(meanTickTime), timeFormatter.format(meanTPS))); + } + else + { + double worldTickTime = ForgeCommand.mean(this.getServer().worldTickTimes.get(dim)) * 1.0E-6D; + double worldTPS = Math.min(1000.0/worldTickTime, 20); + sender.addChatMessage(new ChatComponentTranslation("commands.forge.tps.summary",String.format("Dim %d", dim), timeFormatter.format(worldTickTime), timeFormatter.format(worldTPS))); + } + } + + private static long mean(long[] values) + { + long sum = 0l; + for (long v : values) + { + sum+=v; + } + + return sum / values.length; + } + + private MinecraftServer getServer() + { + return this.server.get(); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/net/minecraftforge/transformers/ForgeAccessTransformer.java b/build/rfg/minecraft-src/java/net/minecraftforge/transformers/ForgeAccessTransformer.java new file mode 100644 index 0000000..b7eff70 --- /dev/null +++ b/build/rfg/minecraft-src/java/net/minecraftforge/transformers/ForgeAccessTransformer.java @@ -0,0 +1,13 @@ +package net.minecraftforge.transformers; + +import java.io.IOException; + +import cpw.mods.fml.common.asm.transformers.AccessTransformer; + +public class ForgeAccessTransformer extends AccessTransformer +{ + public ForgeAccessTransformer() throws IOException + { + super("forge_at.cfg"); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/java/paulscode/sound/codecs/CodecIBXM.java b/build/rfg/minecraft-src/java/paulscode/sound/codecs/CodecIBXM.java new file mode 100644 index 0000000..89365b2 --- /dev/null +++ b/build/rfg/minecraft-src/java/paulscode/sound/codecs/CodecIBXM.java @@ -0,0 +1,650 @@ +package paulscode.sound.codecs; + +import java.io.DataInputStream; +import java.io.InputStream; +import java.io.IOException; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.ShortBuffer; + +import javax.sound.sampled.AudioFormat; + +import paulscode.sound.ICodec; +import paulscode.sound.SoundBuffer; +import paulscode.sound.SoundSystemConfig; +import paulscode.sound.SoundSystemLogger; +import ibxm.FastTracker2; +import ibxm.IBXM; +import ibxm.Module; +import ibxm.ProTracker; +import ibxm.ScreamTracker3; + +/** + * The CodecIBXM class provides an ICodec interface for reading from MOD/S3M/XM + * files via the IBXM library. + * SoundSystem CodecIBXM Class License:

    + * You are free to use this class for any purpose, commercial or otherwise. + * You may modify this class or source code, and distribute it any way you + * like, provided the following conditions are met: + *
    + * 1) You may not falsely claim to be the author of this class or any + * unmodified portion of it. + *
    + * 2) You may not copyright this class or a modified version of it and then + * sue me for copyright infringement. + *
    + * 3) If you modify the source code, you must clearly document the changes + * made before redistributing the modified source code, so other users know + * it is not the original code. + *
    + * 4) You are not required to give me credit for this class in any derived + * work, but if you do, you must also mention my website: + * http://www.paulscode.com + *
    + * 5) I the author will not be responsible for any damages (physical, + * financial, or otherwise) caused by the use if this class or any portion + * of it. + *
    + * 6) I the author do not guarantee, warrant, or make any representations, + * either expressed or implied, regarding the use of this class or any + * portion of it. + *

    + * Author: Paul Lamb + *
    + * http://www.paulscode.com + *


    + * + * This software is based on or using the IBXM library available from + * http://www.geocities.com/sunet2000/ + *

    + *
    + * IBXM is copyright (c) 2007, Martin Cameron, and is licensed under the BSD + * License. + *

    + * All rights reserved. + *

    + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + *

    + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. Redistributions in binary + * form must reproduce the above copyright notice, this list of conditions and + * the following disclaimer in the documentation and/or other materials + * provided with the distribution. Neither the name of mumart nor the names of + * its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + *

    + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *


    + */ +public class CodecIBXM implements ICodec +{ +/** + * Used to return a current value from one of the synchronized + * boolean-interface methods. + */ + private static final boolean GET = false; + +/** + * Used to set the value in one of the synchronized boolean-interface methods. + */ + private static final boolean SET = true; + +/** + * Used when a parameter for one of the synchronized boolean-interface methods + * is not aplicable. + */ + private static final boolean XXX = false; + +/** + * True if there is no more data to read in. + */ + private boolean endOfStream = false; + +/** + * True if the stream has finished initializing. + */ + private boolean initialized = false; + +/** + * Format the converted audio will be in. + */ + private AudioFormat myAudioFormat = null; + +/** + * True if the using library requires data read by this codec to be + * reverse-ordered before returning it from methods read() and readAll(). + */ + private boolean reverseBytes = false; + +/** + * IBXM decoder. + */ + private IBXM ibxm; + +/** + * Module instance to be played. + */ + private Module module; + +/** + * Duration of the audio (in frames). + */ + private int songDuration; + +/** + * Audio read position (in frames). + */ + private int playPosition; + +/** + * Processes status messages, warnings, and error messages. + */ + private SoundSystemLogger logger; + +/** + * Constructor: Grabs a handle to the logger. + */ + public CodecIBXM() + { + logger = SoundSystemConfig.getLogger(); + } + +/** + * Tells this codec when it will need to reverse the byte order of + * the data before returning it in the read() and readAll() methods. The + * IBXM library produces audio data in a format that some external audio + * libraries require to be reversed. Derivatives of the Library and Source + * classes for audio libraries which require this type of data to be reversed + * will call the reverseByteOrder() method. + * @param b True if the calling audio library requires byte-reversal. + */ + @Override + public void reverseByteOrder( boolean b ) + { + reverseBytes = b; + } + +/** + * Prepares an audio stream to read from. If another stream is already opened, + * it will be closed and a new audio stream opened in its place. + * @param url URL to an audio file to stream from. + * @return False if an error occurred or if end of stream was reached. + */ + @Override + public boolean initialize( URL url ) + { + initialized( SET, false ); + cleanup(); + + if( url == null ) + { + errorMessage( "url null in method 'initialize'" ); + cleanup(); + return false; + } + + InputStream is = null; + + try + { + is = url.openStream(); + } + catch( IOException ioe ) + { + errorMessage( "Unable to open stream in method 'initialize'" ); + printStackTrace( ioe ); + return false; + } + + if( ibxm == null ) + ibxm = new IBXM( 48000 ); + if( myAudioFormat == null ) + myAudioFormat = new AudioFormat( 48000, 16, 2, true, true ); + + try + { + setModule( loadModule( is ) ); + } + catch( IllegalArgumentException iae ) + { + errorMessage( "Illegal argument in method 'initialize'" ); + printStackTrace( iae ); + if( is != null ) + { + try + { + is.close(); + } + catch( IOException ioe ) + {} + } + return false; + } + catch( IOException ioe ) + { + errorMessage( "Error loading module in method 'initialize'" ); + printStackTrace( ioe ); + if( is != null ) + { + try + { + is.close(); + } + catch( IOException ioe2 ) + {} + } + return false; + } + + if( is != null ) + { + try + { + is.close(); + } + catch( IOException ioe ) + {} + } + + endOfStream( SET, false ); + initialized( SET, true ); + return true; + } + +/** + * Returns false if the stream is busy initializing. + * @return True if steam is initialized. + */ + @Override + public boolean initialized() + { + return initialized( GET, XXX ); + } + +/** + * Reads in one stream buffer worth of audio data. See + * {@link paulscode.sound.SoundSystemConfig SoundSystemConfig} for more + * information about accessing and changing default settings. + * @return The audio data wrapped into a SoundBuffer context. + */ + @Override + public SoundBuffer read() + { + if( endOfStream( GET, XXX ) ) + return null; + + if( module == null ) + { + errorMessage( "Module null in method 'read'" ); + return null; + } + + // Check to make sure there is an audio format: + if( myAudioFormat == null ) + { + errorMessage( "Audio Format null in method 'read'" ); + return null; + } + + int bufferFrameSize = (int) SoundSystemConfig.getStreamingBufferSize() + / 4; + + int frames = songDuration - playPosition; + if( frames > bufferFrameSize ) + frames = bufferFrameSize; + + if( frames <= 0 ) + { + endOfStream( SET, true ); + return null; + } + byte[] outputBuffer = new byte[ frames * 4 ]; + + ibxm.get_audio( outputBuffer, frames ); + + playPosition += frames; + if( playPosition >= songDuration ) + { + endOfStream( SET, true ); + } + + // Reverse the byte order if necessary: + if( reverseBytes ) + reverseBytes( outputBuffer, 0, frames * 4 ); + + // Wrap the data into a SoundBuffer: + SoundBuffer buffer = new SoundBuffer( outputBuffer, myAudioFormat ); + + return buffer; + } + +/** + * Reads in all the audio data from the stream (up to the default + * "maximum file size". See + * {@link paulscode.sound.SoundSystemConfig SoundSystemConfig} for more + * information about accessing and changing default settings. + * @return the audio data wrapped into a SoundBuffer context. + */ + @Override + public SoundBuffer readAll() + { + if( module == null ) + { + errorMessage( "Module null in method 'readAll'" ); + return null; + } + + // Check to make sure there is an audio format: + if( myAudioFormat == null ) + { + errorMessage( "Audio Format null in method 'readAll'" ); + return null; + } + + int bufferFrameSize = (int) SoundSystemConfig.getFileChunkSize() + / 4; + + byte[] outputBuffer = new byte[ bufferFrameSize * 4 ]; + + // Buffer to contain the audio data: + byte[] fullBuffer = null; + // frames of audio data: + int frames; + // bytes of audio data: + int totalBytes = 0; + + while( (!endOfStream(GET, XXX)) && + (totalBytes < SoundSystemConfig.getMaxFileSize()) ) + { + frames = songDuration - playPosition; + if( frames > bufferFrameSize ) + frames = bufferFrameSize; + ibxm.get_audio( outputBuffer, frames ); + totalBytes += (frames * 4); + + fullBuffer = appendByteArrays( fullBuffer, outputBuffer, + frames * 4 ); + + playPosition += frames; + if( playPosition >= songDuration ) + { + endOfStream( SET, true ); + } + } + + // Reverse the byte order if necessary: + if( reverseBytes ) + reverseBytes( fullBuffer, 0, totalBytes ); + + // Wrap the data into a SoundBuffer: + SoundBuffer buffer = new SoundBuffer( fullBuffer, myAudioFormat ); + + return buffer; + } + +/** + * Returns false if there is still more data available to be read in. + * @return True if end of stream was reached. + */ + @Override + public boolean endOfStream() + { + return endOfStream( GET, XXX ); + } + +/** + * Closes the audio stream and remove references to all instantiated objects. + */ + @Override + public void cleanup() + { +// if( ibxm != null ) +// ibxm.seek( 0 ); + playPosition = 0; + } + +/** + * Returns the audio format of the data being returned by the read() and + * readAll() methods. + * @return Information wrapped into an AudioFormat context. + */ + @Override + public AudioFormat getAudioFormat() + { + return myAudioFormat; + } + +/** + * Decodes the data in the specified InputStream into an instance of + * ibxm.Module. + * @param input an InputStream containing the module file to be decoded. + * @throws IllegalArgumentException if the data is not recognised as a module file. + */ + private static Module loadModule( InputStream input ) + throws IllegalArgumentException, IOException + { + DataInputStream data_input_stream = new DataInputStream( input ); + + // Check if data is in XM format: + byte[] xm_header = new byte[ 60 ]; + data_input_stream.readFully( xm_header ); + if( FastTracker2.is_xm( xm_header ) ) + return FastTracker2.load_xm( xm_header, data_input_stream ); + + // Check if data is in ScreamTracker 3 format: + byte[] s3m_header = new byte[ 96 ]; + System.arraycopy( xm_header, 0, s3m_header, 0, 60 ); + data_input_stream.readFully( s3m_header, 60, 36 ); + if( ScreamTracker3.is_s3m( s3m_header ) ) + return ScreamTracker3.load_s3m( s3m_header, data_input_stream ); + + // Check if data is in ProTracker format: + byte[] mod_header = new byte[ 1084 ]; + System.arraycopy( s3m_header, 0, mod_header, 0, 96 ); + data_input_stream.readFully( mod_header, 96, 988 ); + return ProTracker.load_mod( mod_header, data_input_stream ); + } + +/** + * Sets the Module instance to be played. + */ + private void setModule( Module m ) + { + if( m != null ) + module = m; + ibxm.set_module( module ); + songDuration = ibxm.calculate_song_duration(); + } + +/** + * Internal method for synchronizing access to the boolean 'initialized'. + * @param action GET or SET. + * @param value New value if action == SET, or XXX if action == GET. + * @return True if steam is initialized. + */ + private synchronized boolean initialized( boolean action, boolean value ) + { + if( action == SET ) + initialized = value; + return initialized; + } + +/** + * Internal method for synchronizing access to the boolean 'endOfStream'. + * @param action GET or SET. + * @param value New value if action == SET, or XXX if action == GET. + * @return True if end of stream was reached. + */ + private synchronized boolean endOfStream( boolean action, boolean value ) + { + if( action == SET ) + endOfStream = value; + return endOfStream; + } + +/** + * Trims down the size of the array if it is larger than the specified + * maximum length. + * @param array Array containing audio data. + * @param maxLength Maximum size this array may be. + * @return New array. + */ + private static byte[] trimArray( byte[] array, int maxLength ) + { + byte[] trimmedArray = null; + if( array != null && array.length > maxLength ) + { + trimmedArray = new byte[maxLength]; + System.arraycopy( array, 0, trimmedArray, 0, maxLength ); + } + return trimmedArray; + } + +/** + * Reverse-orders all bytes contained in the specified array. + * @param buffer Array containing audio data. + */ + public static void reverseBytes( byte[] buffer ) + { + reverseBytes( buffer, 0, buffer.length ); + } + +/** + * Reverse-orders the specified range of bytes contained in the specified array. + * @param buffer Array containing audio data. + * @param offset Array index to begin. + * @param size number of bytes to reverse-order. + */ + public static void reverseBytes( byte[] buffer, int offset, int size ) + { + + byte b; + for( int i = offset; i < ( offset + size ); i += 2 ) + { + b = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = b; + } + } + +/** + * Converts sound bytes to little-endian format. + * @param audio_bytes The original wave data + * @param two_bytes_data For stereo sounds. + * @return byte array containing the converted data. + */ + private static byte[] convertAudioBytes( byte[] audio_bytes, + boolean two_bytes_data ) + { + ByteBuffer dest = ByteBuffer.allocateDirect( audio_bytes.length ); + dest.order( ByteOrder.nativeOrder() ); + ByteBuffer src = ByteBuffer.wrap( audio_bytes ); + src.order( ByteOrder.LITTLE_ENDIAN ); + if( two_bytes_data ) + { + ShortBuffer dest_short = dest.asShortBuffer(); + ShortBuffer src_short = src.asShortBuffer(); + while( src_short.hasRemaining() ) + { + dest_short.put(src_short.get()); + } + } + else + { + while( src.hasRemaining() ) + { + dest.put( src.get() ); + } + } + dest.rewind(); + + if( !dest.hasArray() ) + { + byte[] arrayBackedBuffer = new byte[dest.capacity()]; + dest.get( arrayBackedBuffer ); + dest.clear(); + + return arrayBackedBuffer; + } + + return dest.array(); + } + +/** + * Creates a new array with the second array appended to the end of the first + * array. + * @param arrayOne The first array. + * @param arrayTwo The second array. + * @param length How many bytes to append from the second array. + * @return Byte array containing information from both arrays. + */ + private static byte[] appendByteArrays( byte[] arrayOne, byte[] arrayTwo, + int length ) + { + byte[] newArray; + if( arrayOne == null && arrayTwo == null ) + { + // no data, just return + return null; + } + else if( arrayOne == null ) + { + // create the new array, same length as arrayTwo: + newArray = new byte[ length ]; + // fill the new array with the contents of arrayTwo: + System.arraycopy( arrayTwo, 0, newArray, 0, length ); + arrayTwo = null; + } + else if( arrayTwo == null ) + { + // create the new array, same length as arrayOne: + newArray = new byte[ arrayOne.length ]; + // fill the new array with the contents of arrayOne: + System.arraycopy( arrayOne, 0, newArray, 0, arrayOne.length ); + arrayOne = null; + } + else + { + // create the new array large enough to hold both arrays: + newArray = new byte[ arrayOne.length + length ]; + System.arraycopy( arrayOne, 0, newArray, 0, arrayOne.length ); + // fill the new array with the contents of both arrays: + System.arraycopy( arrayTwo, 0, newArray, arrayOne.length, + length ); + arrayOne = null; + arrayTwo = null; + } + + return newArray; + } + +/** + * Prints an error message. + * @param message Message to print. + */ + private void errorMessage( String message ) + { + logger.errorMessage( "CodecWav", message, 0 ); + } + +/** + * Prints an exception's error message followed by the stack trace. + * @param e Exception containing the information to print. + */ + private void printStackTrace( Exception e ) + { + logger.printStackTrace( e, 1 ); + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/Log4j-config.xsd b/build/rfg/minecraft-src/resources/Log4j-config.xsd new file mode 100644 index 0000000..a19e125 --- /dev/null +++ b/build/rfg/minecraft-src/resources/Log4j-config.xsd @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/rfg/minecraft-src/resources/Log4j-events.dtd b/build/rfg/minecraft-src/resources/Log4j-events.dtd new file mode 100644 index 0000000..91af8c7 --- /dev/null +++ b/build/rfg/minecraft-src/resources/Log4j-events.dtd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/rfg/minecraft-src/resources/Log4j-events.xsd b/build/rfg/minecraft-src/resources/Log4j-events.xsd new file mode 100644 index 0000000..2310227 --- /dev/null +++ b/build/rfg/minecraft-src/resources/Log4j-events.xsd @@ -0,0 +1,74 @@ + + + + + + + Log4J 2.0 XML Schema for XML log event files. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/rfg/minecraft-src/resources/assets/fml/lang/en_US.lang b/build/rfg/minecraft-src/resources/assets/fml/lang/en_US.lang new file mode 100644 index 0000000..d57f99f --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/fml/lang/en_US.lang @@ -0,0 +1,82 @@ +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point! SIMPSON'S INDIVIDUAL STRINGETTES! THE NOW STRING! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default: %s] +fml.configgui.tooltip.defaultNumeric=[range: %s ~ %s, default: %s] diff --git a/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.gif b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.gif new file mode 100644 index 0000000..b316837 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.gif differ diff --git a/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.png b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.png new file mode 100644 index 0000000..1be137a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/forge.png differ diff --git a/build/rfg/minecraft-src/resources/assets/fml/textures/gui/icons.png b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/icons.png new file mode 100644 index 0000000..20bb91e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/fml/textures/gui/icons.png differ diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/af_ZA.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/af_ZA.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/af_ZA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ar_SA.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ar_SA.lang new file mode 100644 index 0000000..74c99f9 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ar_SA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=استخدم /forge الأوامر الفرعية المتاحة "tps" و "tack" +commands.forge.usage.tracking=استخدم forge track / . الأنواع المقبولة Tile Entities) te). يجب أن تكون المدة أقل من 60. +commands.forge.tps.summary=%s \: تعني وقت الدقز \: %d ميللي ثانية. Mean TPS\:%d + +commands.forge.tracking.te.enabled=بلاط تعقب الكيان ممكن ل %d ثوان. +forge.texture.preload.warning=تحذير\: النسيج %s لم يتم تحميله مسبقا، مما سيؤدي لأخطاء في التجسيد\! +forge.client.shutdown.internal=يتم إغلاق السيرفر الداخلي... +forge.update.newversion=إصدار جديد من فورج موجود\: %s +forge.update.beta.1=%sتحذير\:%s نسخة بيتا من فورج +forge.update.beta.2=مشاكل كبيرة قد تظهر، تأك\\ قبل الإبلاغ. + +forge.configgui.forgeConfigTitle=خيارات ماينكرافت فورج +forge.configgui.ctgy.forgeGeneralConfig.tooltip=هنا يمكنك أن تغير الخيارات الموجودة في forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=الخيارات العامة +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=هنا حيث يمكنك تعديل الإعدادات المحتواة في forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/br_FR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/br_FR.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/br_FR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ca_ES.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ca_ES.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ca_ES.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/cs_CZ.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/cs_CZ.lang new file mode 100644 index 0000000..4bf54fe --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/cs_CZ.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Použijte /forge . Podpříkazy jsou tps, track +commands.forge.usage.tracking=Použijte /forge track . Platné typy jsou te (Tile Entity). Trvání je < 60. +commands.forge.tps.summary=%s \: Průměrná délka ticku\: %d ms. Průměrný počet ticků za vteřinu (TPS)\: %d + +commands.forge.tracking.te.enabled=Sledování Tile Entit zapnuto na %d sekund. +forge.texture.preload.warning=Upozornění\: Textura %s nebyla načtena, to může způsobit chyby v grafice\! +forge.client.shutdown.internal=Vypínám interní server... +forge.update.newversion=Je k dispozici nová verze Forge\: %s +forge.update.beta.1=%sVarování\: %sForge Beta +forge.update.beta.2=Mohou se vyskytnout vážné problémy, prosím hlaste pouze reprodukovatelné chyby. + +forge.configgui.forgeConfigTitle=Nastavení Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Zde můžete upravovat nastavení uložená ve forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Obecná nastavení +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Zde můžete upravovat nastavení uložená ve forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Výchozí nastavení Forge Chunk Loaderu +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Zde můžete nastavit volby pro každou modifikaci (mod), tyto volby se použijí místo výchozích. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Umožňují změnit nastavení pro každou modifikaci (mod) zvlášť, tato nastavení přepíší výchozí. Hodnota nula v jakékoliv položce způsobí zakázání načítání chunků pro danou modifikaci. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Ovládá rozsah prolínání barev oblohy u biomů. +forge.configgui.biomeSkyBlendRange=Rozsah prolínání barev oblohy +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Vypnout kontrolu verze Forge +forge.configgui.enableGlobalConfig=Povolit globální nastavení +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Nastavte tuto položku na true, pokud chcete vynutit spadnutí v případě pokusu o propojení více než jednoho bloku ke stejné tekutině. +forge.configgui.forceDuplicateFluidBlockCrash=Vynutit spadnutí při duplikaci bloku tekutiny +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Odstranit entity způsobující chyby +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Odstranit blokové entity způsobující chyby +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Řazení receptů +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Šance na zombie dítě +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Šance vyvolání zombie +forge.configgui.stencilbits=Povolit GL Stencil bity +forge.configgui.spawnfuzz=Rozptyl průměru oživení + +forge.configgui.modID.tooltip=ID modu pro který chcete přidat přepisovací volby. +forge.configgui.modID=ID modu +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Povolit přepisovací pravidla modifikací +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/da_DK.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/da_DK.lang new file mode 100644 index 0000000..84796df --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/da_DK.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Gennemsnitlig tick tid\: %d ms. Gennemsnitlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forudindlæst, dette vil foresage grafiske fejl\! +forge.client.shutdown.internal=Lukker intern server... +forge.update.newversion=Ny Forge version tilgængelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan finde sted, tjek før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge Konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Her kan du redigere de indstillinger, der findes i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle indstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Her kan du redigere de indstillinger, der findes i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Kontroller rækkevidden af himmel blanding for farvede himle i biomer. +forge.configgui.biomeSkyBlendRange=Biome Himmelblandings Rækkevidde +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Pakkesammenklumpningstærskel +forge.configgui.disableVersionCheck.tooltip=Set til sand for at deaktivere Forge's verions tjeknings mekanik. Forge henter en lille json fil fra vores server for versionsinformation. For flere detaljer se ForgeVersion klassen på vores github. +forge.configgui.disableVersionCheck=Deaktiver Forge Versionstjek +forge.configgui.enableGlobalConfig=Aktiver Global Konfiguration +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set dette til sand for at fremtvinge et crash hvis mere end en block førsoger at koble tilbage til den samme væske. +forge.configgui.forceDuplicateFluidBlockCrash=Tving Duplikat Væske Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sorter Opskrifter +forge.configgui.zombieBabyChance.tooltip=Chancen hvorpå en zombie (eller underklasse) er en baby. Tillader ændringen af zombie spawn mekanikken. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Grundlæggende zombie fremmanings spawn chance. Tillader ændringen af bonus zombie fremmaningsmekanikken. +forge.configgui.zombieBaseSummonChance=Zombie Fremmanings Chance +forge.configgui.stencilbits=Aktiver GL Stencil Bits +forge.configgui.spawnfuzz=Genoplivningsvariations Diameter + +forge.configgui.modID.tooltip=Mod ID'en du ønsker at overskrive indstillinger for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Aktiver den indstilling for at tillade definitionen af brugerdefinerede pr. mod indstillinger. +forge.configgui.enableModOverrides=Aktiver Mod Overskrivning +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Billet Begrænsning +forge.configgui.playerTicketCount.tooltip=Mængden af billeter en spiller kan tildeles i stedet for et mod. Dette er delt over alle mods, og det er op til mods'ene at bruge det. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/de_DE.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/de_DE.lang new file mode 100644 index 0000000..8972140 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/de_DE.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Verwende /forge . Mögliche Befehle sind\: tps, track +commands.forge.usage.tracking=Verwende /forge track . Gültige Typen sind te (Tile Entities). Dauer ist < 60. +commands.forge.tps.summary=%s \: Durchschnittliche Zeit pro Tick\: %d ms. Durchschnittliche TPS\: %d + +commands.forge.tracking.te.enabled=Tile-Entity-Tracking für %d Sekunden aktiviert. +forge.texture.preload.warning=Warnung\: Textur %s nicht geladen, dies wird Rendering-Fehler verursachen\! +forge.client.shutdown.internal=Interner Server wird heruntergefahren... +forge.update.newversion=Neue Forge-Version verfügbar\: %s +forge.update.beta.1=%sWARNUNG\: %sForge Beta +forge.update.beta.2=Größere Probleme könnten auftreten, bitte nur reproduzierbare Fehler melden. + +forge.configgui.forgeConfigTitle=Minecraft Forge-Konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Hier kannst du die in forge.cfg gespeicherten Einstellungen bearbeiten. +forge.configgui.ctgy.forgeGeneralConfig=Allgemeine Einstellungen +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Hier können sie die in forgeChunkLoading.cfg gespeicherten Einstellungen bearbeiten. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Standard Einstellungen +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Hier kannst du mod-spezifische Einstellungen überschreiben, welche statt des Standards genutzt werden. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod-Überschreibung +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Erlaubt dir, mod-spezifische Einstellungen festzulegen, welche die Standardwerte überschreiben. Ein Wert von 0 deaktiviert effektiv jede Chunkloading Fähigkeiten einer Mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Füge neue Mod-Überschreibung hinzu +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Bestimmt die Reichweite für Überblendung des gefärbten Himmels in Biomen. +forge.configgui.biomeSkyBlendRange=Reichweite der Biom-Himmelsüberblendung +forge.configgui.clumpingThreshold.tooltip=Bestimmt die Schwelle, ab der Packet51 statt Packet52 bevorzugt wird. +forge.configgui.clumpingThreshold=Schwelle der Packet-Gruppierung +forge.configgui.disableVersionCheck.tooltip=Setze diesen Wert auf true, um die Versionsüberprüfung von Forge zu deaktivieren. Forge ruft eine kleine JSON-Datei mit Versionsinformationen auf unserem Server ab. Die ForgeVersion-Klasse auf GitHub enthält weitere Details. +forge.configgui.disableVersionCheck=Deaktiviere den Forge Versions-Check +forge.configgui.enableGlobalConfig=Nutze globale Konfiguration +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Setz dies auf true um einen Absturz zu erzwingen, wenn mehr als ein Block versucht sich zu einer Flüssigkeit zu verbinden. +forge.configgui.forceDuplicateFluidBlockCrash=Erzwinge einen Crash bei doppelt registrierten Flüssigkeitsblöcken +forge.configgui.fullBoundingBoxLadders.tooltip=Setze diesen Wert auf true, damit die ganze Kollisionsbox eines Entitys statt nur der aktuelle Block bei Leitern überprüft wird. Verursacht bemerkbare Unterschiede in der Spielmechanik, weshalb Vanilla das Standardverhalten vorgibt. +forge.configgui.fullBoundingBoxLadders=Leitern mit gesamter Kollisionsbox +forge.configgui.removeErroringEntities.tooltip=Setze dies auf true, um jeden Entity, welcher einen Fehler während seiner Update-Methode erzeugt, zu löschen, anstatt dass der Server geschlossen wird und ein Absturzbericht erzeugt wird. SEI GEWARNT, DIES KÖNNTE EIN CHAOS ERZEUGEN. BENUTZE ES SPARSAM, WIR ÜBERNEHMEN KEINERLEI HAFTUNG BEI SCHÄDEN. +forge.configgui.removeErroringEntities=Entferne fehlerhafte Entities +forge.configgui.removeErroringTileEntities.tooltip=Setze diesen Wert auf true, damit alle TileEntities, die Fehler bei ihrer Aktualisierung verursachen, gelöscht werden und der Server nicht abstürzt. DIESE EINSTELLUNG KANN ALLES ZERSTÖREN, VERWENDE SIE DESHALB MIT VORSICHT. WIR ÜBERNEHMEN KEINERLEI HAFTUNG BEI SCHÄDEN. +forge.configgui.removeErroringTileEntities=Entferne fehlerhafte Tile Entities +forge.configgui.sortRecipies.tooltip=Setze diesen Wert auf true, damit Forge Crafting-Rezepte nach dem letzten Ladeschritt sortiert. Kann Asynchronität bei widersprüchlichen Rezepten verursachen. MINECRAFT MUSS NEUGESTARTET WERDEN, WENN DIESE EINSTELLUNG IN DER GUI GEÄNDERT WIRD. +forge.configgui.sortRecipies=Rezepte sortieren +forge.configgui.zombieBabyChance.tooltip=Wahrscheinlichkeit, dass ein Zombie (oder Unterklasse) ein Baby ist. Erlaubt das Ändern des Zombie-Spawning-Verhaltens. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Basiswahrscheinlichkeit für das Spawnen von Zombie-Verstärkung. Ermöglicht die Änderung des Mechanismus zur Bonus-Zombie-Verstärkung. +forge.configgui.zombieBaseSummonChance=Zombie Spawn Chance +forge.configgui.stencilbits=GL-Stencil-Bits aktivieren +forge.configgui.spawnfuzz=Respawn-Durchmesser + +forge.configgui.modID.tooltip=Die Mod-ID, für die du eigene Einstellungen setzen willst. +forge.configgui.modID=Mod-ID +forge.configgui.dormantChunkCacheSize.tooltip=Night geladene Chunks können zuerst in einem ruhenden Cache belassen werden, um schnellere Ladezeiten zu erreichen. Lege die Größe (in Chunks) dieses Cache hier fest. +forge.configgui.dormantChunkCacheSize=Größe des ruhenden Chunk-Caches +forge.configgui.enableModOverrides.tooltip=Aktiviere diese Einstellung, um eigene Mod-spezifische Einstellungen zu definieren. +forge.configgui.enableModOverrides=Mod-Overrides aktivieren +forge.configgui.maximumChunksPerTicket.tooltip=Dies ist die maximale Anzahl an Chunks, die ein einzelnes Ticket erzwingen kann. +forge.configgui.maximumChunksPerTicket=Chunks pro Ticket Limit +forge.configgui.maximumTicketCount.tooltip=Dies ist die Anzahl an Chunk-Ladeanfragen, die eine Mod machen darf. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=Die Anzahl der Tickets, die einem Spieler statt einer Mod zugeordnet werden können. Dieser Wert wird von allen Mods geteilt und muss von diesen verwendet werden. +forge.configgui.playerTicketCount=Spieler Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/el_GR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/el_GR.lang new file mode 100644 index 0000000..68c7145 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/el_GR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Χρησιμοποιήστε /forge . Οι υποεντολές είναι tps, track +commands.forge.usage.tracking=Χρησιμοποιήστε /forge track . Έγκυροι τύποι είναι te (Tile Entities).H Διάρκεια είναι <60. +commands.forge.tps.summary=%s \: Μέσος χρόνος tick \: %d ms. Μέσος TPS\: %d + +commands.forge.tracking.te.enabled=Εντοπισμός Tile Entity ενεργοποιημένος για %d δευτερόλεπτα. +forge.texture.preload.warning=Προειδοποίηση\: Το Texture %s δεν είναι προφορτωμένο και αυτό θα προκαλέσει πρόβληματα στο render\! +forge.client.shutdown.internal=Τερματισμός του εσωτερικού διακομιστή... +forge.update.newversion=Νέα έκδοση του Forge διαθέσιμη\: %s +forge.update.beta.1=%sΠΡΟΣΟΧΗ\:%sForge Beta +forge.update.beta.2=Σοβαρά προβλήματα μπορεί να προκύψουν, επαληθεύστε πριν το αναφέρεται. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Από εδώ μπορείτε να επεξεργαστείτε τις ρυθμίσεις που περιέχονται στο forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Γενικές Ρυθμίσεις +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Απενεργοποίηση ελέγχου έκδοσης Forge +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ταξινόμηση Συνταγών +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/en_US.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/en_US.lang new file mode 100644 index 0000000..aade6ab --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/en_US.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with no defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/es_ES.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/es_ES.lang new file mode 100644 index 0000000..ed708dd --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/es_ES.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Utilice /forge . Los subcomandos son tps, track +commands.forge.usage.tracking=Use /forge track . Los tipos válidos son te (Tile Entities). La duración es < 60. +commands.forge.tps.summary=%s \: Tiempo medio por tick\: %d ms. TPS medio\: %d + +commands.forge.tracking.te.enabled=Seguimiento de Tile Entity activado por %d segundos. +forge.texture.preload.warning=ADVERTENCIA\: Textura %s no precargada, causará fallos gráficos\! +forge.client.shutdown.internal=Apagando el servidor interno... +forge.update.newversion=Nueva versión de Forge disponible\: %s +forge.update.beta.1=%sADVERTENCIA\: %sForge Beta +forge.update.beta.2=Problemas mayores pueden surgir, verificar antes de reportar. + +forge.configgui.forgeConfigTitle=Configuración de Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aquí es donde puedes editar la configuración contenida en forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Configuración General +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aquí es donde puedes editar la configuración contenida en forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configuración Por Defecto Del Cargador De Divisiones De Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aquí es donde puedes definir ajustes específicos de modificaciones, que se utilizarán en lugar de los predeterminados. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Sobrecarga Por Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir una modificación por cada mod respecto de los valores por defecto. Un valor en cero en cualquiera de los campos previene al mod de cargar divisiones de el mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Agregar Sobrecarga Por Mod +forge.configgui.ctgy.VersionCheckConfig=Ajustes de comprobación de versiones + +forge.configgui.biomeSkyBlendRange.tooltip=Controla el rango de la mezcla para cielos colorizados por biomas. +forge.configgui.biomeSkyBlendRange=Rango De Mezcla Del Cielo Por Bioma +forge.configgui.clumpingThreshold.tooltip=Controla el umbral en el cual un Packet51 es preferido sobre un Packet52. +forge.configgui.clumpingThreshold=Umbral De Corte De Paquete +forge.configgui.disableVersionCheck.tooltip=Establecer en true para deshabilitar la comprobación de la versión de Forge. Forge consulta un pequeño archivo json en nuestro servidor para obtener información de la versión. Para mas detalles puede consultar la clase ForgeVersion en nuestro repositorio github. +forge.configgui.disableVersionCheck=Deshabilitar La Comprobación De Versión De Forge +forge.configgui.enableGlobalConfig=Habilitar La Configuración Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Al establecer esta opción en true se fuerza la detención si más de un líquido intenta ocupar el mismo bloque al mismo tiempo. +forge.configgui.forceDuplicateFluidBlockCrash=Forzar Detención En Duplicación De Bloque Liquido +forge.configgui.fullBoundingBoxLadders.tooltip=Al establecer esta opción en true se comprobará la colisión de la entidad en una caja para escaleras de mano en lugar de el bloque en el que estén. Provoca diferencias notables en la su funcionamiento, por lo que por defecto su comportamiento es el predeterminado. +forge.configgui.fullBoundingBoxLadders=Colisión de la entidad en una caja para escaleras de mano +forge.configgui.removeErroringEntities.tooltip=Al establecer esta opción en true se elimina cualquier entidad que muestre un error en su método de actualización en vez de cerrar el servidor e informar en el registro de cuelgues. ADVERTENCIA\: ESTO PUEDE CAUSAR ERRORES IRREVERSIBLES. USAR CON PRECAUCIÓN, NO NOS HACEMOS RESPONSABLES DE CUALQUIER DAÑO OCASIONADO. +forge.configgui.removeErroringEntities=Quitar Entidades con Errores +forge.configgui.removeErroringTileEntities.tooltip=Al establecer esta opción en true se elimina cualquier TileEntity que muestre un error en su método de actualización en vez de cerrar el servidor e informar en el registro de cuelgues. ADVERTENCIA\: ESTO PUEDE CAUSAR ERRORES IRREVERSIBLES. USAR CON PRECAUCIÓN, NO NOS HACEMOS RESPONSABLES DE CUALQUIER DAÑO OCASIONADO. +forge.configgui.removeErroringTileEntities=Quitar Tile Entities con Errores +forge.configgui.sortRecipies.tooltip=Poner en true para permitir el ordenamiento post inicializacion de recetas de crafteo usando el clasificador de Forge. Puede causar un desempate en recetas con conflictos. SE DEBE REINICIAR MINECRAFT SI HUBO CAMBIOS EN EL INTERFAZ DE CONFIGURACION "CONFIG GUI". +forge.configgui.sortRecipies=Ordenar Recetas +forge.configgui.zombieBabyChance.tooltip=Probabilidad de que un zombie (o subclase) sea un bebé. Permite cambiar la mecanica de generación de zombies. +forge.configgui.zombieBabyChance=Probablildad de Zombie bebé +forge.configgui.zombieBaseSummonChance.tooltip=Probabilidad base de generación de zombis. Permite cambiar la función de generación adicional de zombis. +forge.configgui.zombieBaseSummonChance=Probabilidad de invocación de zombie +forge.configgui.stencilbits=Activar plantillas de bits GL +forge.configgui.spawnfuzz=Diámetro de regeneración + +forge.configgui.modID.tooltip=la ID del mod que quieres definir anula la configuración. +forge.configgui.modID=ID del mod +forge.configgui.dormantChunkCacheSize.tooltip=Las porciones de terreno que no se hayan cargado se pueden conservar en una caché latente para cargarlas más rápido la próxima vez. Especifica el tamaño (en porciones de terreno) de la caché aquí. +forge.configgui.dormantChunkCacheSize=Tamaño de la caché latente de porciones de terreno +forge.configgui.enableModOverrides.tooltip=Activa esta opción para permitir personalizaciones. +forge.configgui.enableModOverrides=Activar sustitución de mods +forge.configgui.maximumChunksPerTicket.tooltip=Este es el número máximo de porciones de terreno que un solo tique puede forzar. +forge.configgui.maximumChunksPerTicket=Límite de porciones de terreno por tique +forge.configgui.maximumTicketCount.tooltip=Este es el número solicitudes de carga de porciones de terreno que un mod puede hacer. +forge.configgui.maximumTicketCount=Límite de tique de mod +forge.configgui.playerTicketCount.tooltip=El número de tiques que un jugador puede asignar en lugar de un mod. Esto es general para todos los mods y depende de ellos para usarse. +forge.configgui.playerTicketCount=Límite de tiques de jugador + +fml.config.sample.basicDouble.tooltip=Una propiedad doble sin límites definidos. +fml.config.sample.basicDouble=Doble sin límites +fml.config.sample.basicInteger.tooltip=Una propiedad de entero sin límites definidos. +fml.config.sample.basicInteger=Entero sin límites +fml.config.sample.basicString.tooltip=Propiedad de cadena básica. El usuario puede escribir cualquier cosa en este cuadro de texto. +fml.config.sample.basicString=Cadena básica +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/fa_IR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/fa_IR.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/fa_IR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/fi_FI.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/fi_FI.lang new file mode 100644 index 0000000..594b353 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/fi_FI.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Käytä /forge . Alikomentoja ovat tps ja track +commands.forge.usage.tracking=Käytä /forge track . Hyväksytyt tyypit ovat te (Tile Entities). Kestoaika on oltava alle 60.  +commands.forge.tps.summary=%s \: Keskimääräinen päivityksen kesto\: %d ms. Keskimääräinen määrä päivityksiä sekunnissa\: %d + +commands.forge.tracking.te.enabled=Palikkaentiteetin seuranta käytössä %d sekunnin ajan. +forge.texture.preload.warning=Varoitus\: Tekstuuri %s ei ole ennalta ladattu. Tämä aiheuttaa renderöintivirheitä\! +forge.client.shutdown.internal=Sammutetaan sisäistä palvelinta... +forge.update.newversion=Uusi Forge versio saatavilla\: %s +forge.update.beta.1=%sVAROITUS\: %sForge Beta +forge.update.beta.2=Suuria ongelmia voi syntyä, varmista ennen raportointia. + +forge.configgui.forgeConfigTitle=Minecraft Forge Asetukset +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Täällä voit muokata asetuksia, jotka ovat forge.cfg\:ssä. +forge.configgui.ctgy.forgeGeneralConfig=Yleiset Asetukset +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Täällä voit muokata asetuksia, jotka ovat forgeChunkLoading.cfg\:ssä. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader oletusasetukset +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Täällä voit määrittää modikohtaiset asetukset, joita käytetään oletusasetusten sijasta. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Modien Asetusten Ohitukset +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Tämä antaa sinun määrittää mod-kohtaisia asetuksia, jotka ohittavat oletusasetukset. Jos arvo on nolla kummassakaan kohdassa, kyseisen modin maailmanlatauskyky poistuu. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Lisää uusi ohitus modille +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Hallitse taivaan värien sekoittamisaluetta, jos eri väriset taivaat eri biomeille ovat käytössä. +forge.configgui.biomeSkyBlendRange=Biomi Taivaan Sekoitus Alue +forge.configgui.clumpingThreshold.tooltip=Määrittää numeerisen rajan, jossa Paketilla 51 on etusija Pakettiin 52 verrattuna. +forge.configgui.clumpingThreshold=Pakettien yhdistämiskynnys +forge.configgui.disableVersionCheck.tooltip=Asettamalla arvoksi tosi (true), voit poistaa käytöstä Forgen versiontarkistusmekaniikan. Forge hakee pienen json tiedoston meidän palvelimiltamme versiotietoja varten. Jos haluat lisää tietoja, katso ForgeVersion-luokkaa githubissamme. +forge.configgui.disableVersionCheck=Poista käytöstä Forgen versiontarkistus +forge.configgui.enableGlobalConfig=Aktivoi globaalit asetukset +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Asettamalla arvoksi tosi (true), voit pakottaa kaatumisen siinä tapauksessa, että useampi kuin yksi palikka yrittää yhdistää samaan nestepalikkaan. +forge.configgui.forceDuplicateFluidBlockCrash=Pakota kaatuminen nestepalikan tuplaantuessa +forge.configgui.fullBoundingBoxLadders.tooltip=Asettamalla arvoksi tosi (true), tikkaita noustessa koko olennon törmäyslaatikko tarkastetaan tikkaiden varalta sen sijaan, että tarkastettaisiin vain se palikka missä olento on. Aiheuttaa huomattavia eroja mekaniikoissa, joten oletus on tavallisen Minecraftin mekaniikka. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Aseta tämän arvoksi tosi (true) poistaaksesi kaikki entiteetit, jotka heittävät virheitä päivitysmetodeistaan ilman palvelimen sammuttamista ja ongelman raportoimista kaatumislokiin. VAROITUS\: TÄMÄ SAATTAA HAJOITTAA KAIKEN, JOTEN KÄYTÄ SITÄ VAROVASTI. ME EMME OLE VASTUUSSA VAHINGOISTA. +forge.configgui.removeErroringEntities=Poista virheitä heittävät entiteetit +forge.configgui.removeErroringTileEntities.tooltip=Aseta tämän arvoksi tosi (true) poistaaksesi kaikki palikkaentiteetit, jotka heittävät virheitä päivitysmetodeistaan ilman palvelimen sammuttamista ja ongelman raportoimista kaatumislokiin. VAROITUS\: TÄMÄ SAATTAA HAJOITTAA KAIKEN, JOTEN KÄYTÄ SITÄ VAROVASTI. ME EMME OLE VASTUUSSA VAHINGOISTA. +forge.configgui.removeErroringTileEntities=Poista virheitä heittävät palikkaentiteetit +forge.configgui.sortRecipies.tooltip=Asettamalla arvoksi tosi (true) voit aktivoida reseptien järjestelemisen jälkialustuksen jälkeen Forgen järjestelijällä. Tämä saattaa aiheuttaa synkronointiongelmia ristiriitaisissa resepteissä. MINECRAFT ON KÄYNNISTETTÄVÄ UUDELLEEN, JOS TÄTÄ MUUTETAAN PELIN SISÄLTÄ KÄSIN. +forge.configgui.sortRecipies=Järjestä reseptit +forge.configgui.zombieBabyChance.tooltip=Mahdollisuus, että zombi (tai sen alaluokka) on vauva. Antaa muuttaa zombien syntymismekaniikkaa. +forge.configgui.zombieBabyChance=Vauvazombien mahdollisuus +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombien kutsumismahdollisuus +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=Sen modin ID, jolle haluat antaa omat asetukset. +forge.configgui.modID=Modin tunnus +forge.configgui.dormantChunkCacheSize.tooltip=Muistista poistetut chunkit voidaan pitää välimuistissa nopeampaa lataamista varten, Määritä välimuistin koko (chunkkeina) tähän. +forge.configgui.dormantChunkCacheSize=Chunk-välimuistin koko +forge.configgui.enableModOverrides.tooltip=Aktivoi tämä asetus, jos haluat asettaa tietyille modeille eri asetukset. +forge.configgui.enableModOverrides=Aktivoi Modien Ohitukset +forge.configgui.maximumChunksPerTicket.tooltip=Tämä on maksimimäärä chunkkeja, jota yksittäinen lippu voi pakottaa. +forge.configgui.maximumChunksPerTicket=Maksimimäärä chunkkeja lippua kohden +forge.configgui.maximumTicketCount.tooltip=Tämä on määrä chunkkien latauspyyntöjä, jota yksittäinen modi saa tehdä. +forge.configgui.maximumTicketCount=Maksimimäärä lippuja modia kohden +forge.configgui.playerTicketCount.tooltip=Tämä on määrä lippuja, jotka voidaan asettaa pelaajalle modin sijasta. Tämä jaetaan kaikille modeille ja sen käyttö riippuu modeista. +forge.configgui.playerTicketCount=Maksimimäärä lippuja pelaajaa kohden + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/fr_FR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/fr_FR.lang new file mode 100644 index 0000000..a832f93 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/fr_FR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Utilisez /forge . Les sous-commandes sont tps, track +commands.forge.usage.tracking=Utilisez /forge track . Les types valides sont te (Tile Entities). La durée doit être inférieur à 60. +commands.forge.tps.summary=commands.forge.tps.summary\=%s \: Durée de tick \: %d ms. TPS moyen \: %d + +commands.forge.tracking.te.enabled=Pistage des Tile Entity activé pour %d secondes. +forge.texture.preload.warning=Attention \: La texture %s n'est pas préchargée, cela causera des bugs de rendu \! +forge.client.shutdown.internal=Arrêt du serveur interne... +forge.update.newversion=Une nouvelle version de Forge est disponible \: %s +forge.update.beta.1=%sAVERTISSEMENT \: %sForge Beta +forge.update.beta.2=Des problèmes majeurs peuvent survenir, vérifiez avant de les signaler. + +forge.configgui.forgeConfigTitle=Configuration de Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Vous pouvez modifier ici les paramètres contenu dans le fichier forge.cfg . +forge.configgui.ctgy.forgeGeneralConfig=Paramètres généraux +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=C'est ici que vous pouvez modifier les paramètres contenus dans le fichier forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Paramètres par défaut de Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=C'est ici que vous pouvez définir les paramètres de remplacement spécifiques aux mods qui seront utilisés au lieu de ceux par défaut. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Remplacements de mods +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Vous permet de définir les paramètres spécifiques aux mods qui remplaceront ceux par défaut. Une valeur de zéro dans chaque entrée désactive efficacement n'importe quelles capacités de chargement de chunk pour ce mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Ajout d'un nouveau remplacement de mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Contrôle l'étendue de fondu de couleur du ciel pour les cieux colorés dans les biomes. +forge.configgui.biomeSkyBlendRange=Étendue de fondu du ciel des biomes +forge.configgui.clumpingThreshold.tooltip=Contrôle le seuil du nombre auquel Packet51 est préféré sur Packet52. +forge.configgui.clumpingThreshold=Seuil d'amas de paquets +forge.configgui.disableVersionCheck.tooltip=Mettez ceci à "true" pour désactiver les mécanismes de vérification de la version de Forge. Forge interroge un petit fichier json sur notre serveur pour les informations de version. Pour plus de détails, consultez la classe ForgeVersion dans notre Github. +forge.configgui.disableVersionCheck=Désactiver la vérification de la version de Forge +forge.configgui.enableGlobalConfig=Activer la configuration globale +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Mettez ceci à "true" pour forcer un plantage si plus d'un bloc tente de se relier au même fluide. +forge.configgui.forceDuplicateFluidBlockCrash=Forcer le plantage de duplication de bloc de fluide +forge.configgui.fullBoundingBoxLadders.tooltip=Mettez ceci à "true" pour vérifier la boîte de collision de l'entité entière pour les échelles au lieu de juste le bloc où elles sont. Cause des différences notables dans les mécanismes et le comportement vanilla est par défaut. +forge.configgui.fullBoundingBoxLadders=Échelles à boîte de collision complète +forge.configgui.removeErroringEntities.tooltip=Mettez ceci à "true" pour enlever n'importe quelle entité qui lance une erreur dans sa méthode de mise à jour au lieu de fermer le serveur et de créer un log de plantage. SOYEZ PRÉVENU(E) QUE CELA PEUT TOUT BOUSILLER. UTILISEZ AVEC PRÉCAUTION. NOUS NE SOMMES PAS RESPONSABLES DES DÉGÂTS ENGENDRÉS. +forge.configgui.removeErroringEntities=Enlever les entités causant une erreur +forge.configgui.removeErroringTileEntities.tooltip=Mettez ceci à "true" pour enlever n'importe quelle entité de bloc qui lance une erreur dans sa méthode de mise à jour au lieu de fermer le serveur et de créer un log de plantage. SOYEZ PRÉVENU(E) QUE CELA PEUT TOUT BOUSILLER. UTILISEZ AVEC PRÉCAUTION. NOUS NE SOMMES PAS RESPONSABLES DES DÉGÂTS ENGENDRÉS. +forge.configgui.removeErroringTileEntities=Enlever les entités de bloc causant une erreur +forge.configgui.sortRecipies.tooltip=Mettez ceci à "true" pour activer le tri de post-initialisation des recettes de fabrication qui utilisent la trieuse de Forge. Cela peut causer de la désynchronisation sur les recettes en conflits. VOUS DEVEZ REDÉMARRER MINECRAFT SI L'OPTION A ÉTÉ CHANGÉE DEPUIS L'INTERFACE DE CONFIGURATION. +forge.configgui.sortRecipies=Tri des recettes +forge.configgui.zombieBabyChance.tooltip=Chance qu'un zombie (ou une sous-classe) soit un bébé. Permet de changer le mécanisme de spawn des zombies. +forge.configgui.zombieBabyChance=Chance d'avoir un bébé zombie +forge.configgui.zombieBaseSummonChance.tooltip=Chance de spawner des zombies de renforts. Permet de changer le mécanisme de renforts de zombies. +forge.configgui.zombieBaseSummonChance=Chance d'avoir un zombie de renfort +forge.configgui.stencilbits=Activer les bits de stencil d'OpenGL +forge.configgui.spawnfuzz=Respawn du fuzz diamètre + +forge.configgui.modID.tooltip=L'ID du mod que vous voulez définir les paramètres de remplacement. +forge.configgui.modID=ID du mod +forge.configgui.dormantChunkCacheSize.tooltip=Les chunks déchargés peuvent d'abord être gardés dans une cache mémoire dormante pour des temps de chargement plus rapides. Spécifiez la taille (en chunks) de cette cache ici. +forge.configgui.dormantChunkCacheSize=Taille de la mémoire cache dormante des chunks +forge.configgui.enableModOverrides.tooltip=Activez ce paramètre pour permettre les paramètres personnalisés par mod d'être définis. +forge.configgui.enableModOverrides=Activer les remplacements de mods +forge.configgui.maximumChunksPerTicket.tooltip=C'est le nombre maximal de chunks qu'un seul billet peut forcer. +forge.configgui.maximumChunksPerTicket=Limite de chunks par billet +forge.configgui.maximumTicketCount.tooltip=Ceci est le nombre de requêtes de chargement de chunk qu'un mod est permis de faire. +forge.configgui.maximumTicketCount=Limite de billets par mod +forge.configgui.playerTicketCount.tooltip=Ceci est le nombre de billets qui peuvent être assignés à un joueur au lieu d'un mod. Ceci est partagé parmi tous les mods et c'est aux mods de l'utiliser. +forge.configgui.playerTicketCount=Limite de billets par joueur + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/he_IL.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/he_IL.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/he_IL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/hu_HU.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/hu_HU.lang new file mode 100644 index 0000000..a94c131 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/hu_HU.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Használd a /forge parancsot. Alparancsok\: tps, track +commands.forge.usage.tracking=Használd a /forge track . Elfogadható típusok az entitások. Az időtartam kisebb mint 60. \n +commands.forge.tps.summary=%s \: Átlagos tick idő\: %d ms. Átlagos TPS\: %d + +commands.forge.tracking.te.enabled=Entitások figyelése aktiválva %d másodpercre. +forge.texture.preload.warning=Figyelem\: A(z) %s textúra nem lett betöltve, ami megjelenítési hibákat okozhat\! +forge.client.shutdown.internal=Integrált szerver leállítása... +forge.update.newversion=Új forge verzió elérhető\: %s +forge.update.beta.1=%s Figyelem\: %s Béta Forge Verzió +forge.update.beta.2=Hibák előfordulhatnak, bizonyosodj meg felőle, hogy tényleg hiba e. + +forge.configgui.forgeConfigTitle=Minecraft Forge konfiguráció +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Itt tudod módosítani a forge.cfg beállításait. +forge.configgui.ctgy.forgeGeneralConfig=Általános beállítások +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Itt tudod módosítani a forgeChunkLoading.cfg beállításait. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Betöltő alapbeállítások +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Itt tudod beállítani modonként a felülíró beállításokat, így ezeket fogja használni az alap beállítások helyett. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod felülírások +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Modonkénti felülírási beállításokat tudsz beállítani az alapértékek helyett. A nulla érték tejlesen kikapcsolja a chunk betöltési képességeit a kiválasztott modnak. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=Új mod felülírás hozzáadása +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Az ég színének éghajlatonkénti elmosásának a távolságát módosító szám. +forge.configgui.biomeSkyBlendRange=Éghajlat égi színének elmosási távolsága +forge.configgui.clumpingThreshold.tooltip=A küszöbérték számát módosítja ami a 51. Packet-hez rendeli az 52. Packet helyett. +forge.configgui.clumpingThreshold=Packet halmozási küszöb +forge.configgui.disableVersionCheck.tooltip=Tedd "true"-ra hogy bekapcsold a forge verzió ellenőrzését, ami egy kis json fájlon keresztül történik a fájlszerverünkön keresztül. Részletekért lást a "ForgeVersion" nevű class fájlt a github oldalunkon. +forge.configgui.disableVersionCheck=Forge verzióellenőrzés kikapcsolása +forge.configgui.enableGlobalConfig=Globális configuráció engedélyezése +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Engedélyezd ezt, hogy egy kényszerített crash-t okozz ha 1-nél több blokk ugyanarra a Folyadékra utal rá. +forge.configgui.forceDuplicateFluidBlockCrash=Folyadék blokk crash kényszerítése +forge.configgui.fullBoundingBoxLadders.tooltip=Engedélyezd ezt, hogy a minecraft az entititások hitboxát is ellenőrizze, ahelyett, hogy csak a blokkokéval vetné össze. Észrevehető változásokat okozhat 1-2 dologban, ugyanúgy mint a vanilla minecraft működésében is. +forge.configgui.fullBoundingBoxLadders=Teljes határoló dobozú létrák +forge.configgui.removeErroringEntities.tooltip=Tedd ezt igazzá, hogy eltávolítsd azokat az entititásokat, amik hibát jeleznek az helyett, hogy bezárnák a szervert és kicrashelnék azt. FIGYELEM\: TÖNKRE TEHET BÁRMIT, SEMMI FELELŐSSÉGET NEM VÁLLALUNK. +forge.configgui.removeErroringEntities=Hibás entititások eltávolítása +forge.configgui.removeErroringTileEntities.tooltip=Tedd ezt igazzá, hogy eltávolítsd azokat a blokk entititásokat, amik hibát jeleznek az helyett, hogy bezárnák a szervert és kicrashelnék azt. FIGYELEM\: TÖNKRE TEHET BÁRMIT, SEMMI FELELŐSSÉGET NEM VÁLLALUNK. +forge.configgui.removeErroringTileEntities=Hibás blokk entititások eltávolítása +forge.configgui.sortRecipies.tooltip=Tedd igazzá, hogy engedélyezd a késői recept rendezést a Forge recept rendező segítségével. Deszinkronizációt okozhat egyező receptek esetén. ÚJRA KELL INDÍTANI A MC-T HA A JÁTÉKON BELÜL VÁLTOZTATTAD MEG EZT A BEÁLLÍTÁST. +forge.configgui.sortRecipies=Receptek rendezése +forge.configgui.zombieBabyChance.tooltip=Esély egy zombi(vagy olyan fajta) élőlény bébi lesz. Ezzel tudod módosítani a zombi spawnolási mechanikát. +forge.configgui.zombieBabyChance=Pici zombi esély +forge.configgui.zombieBaseSummonChance.tooltip=Alap zombi spawnolási esély. Ezzel tudod személyre szabni a zombik spawnolási mechanikáját. +forge.configgui.zombieBaseSummonChance=Zombi spawnolási esélye +forge.configgui.stencilbits=Gl Stencil Bit-ek engedélyezése +forge.configgui.spawnfuzz=Respawn távolság átmérője + +forge.configgui.modID.tooltip=A mod ID-je amit akarsz a felülíró beállítások definiálására. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=A kitöltött chunkokat egy gyorsítótárba lehet helyezni a gyorsabb betöltődés érdekében. itt betudod állítani a tár méretét. +forge.configgui.dormantChunkCacheSize=Chunk gyorsítótár mérete +forge.configgui.enableModOverrides.tooltip=Engedélyezd ezt, hogy engedélyezt a modonkénti beállítások módosítását. +forge.configgui.enableModOverrides=Mod felülírások engedélyezése +forge.configgui.maximumChunksPerTicket.tooltip=Ez a maximum szám, amit egy darab chunk 1 db "ticket"-et tud kényszeríteni. +forge.configgui.maximumChunksPerTicket=Chunkonkénti "ticket" limit +forge.configgui.maximumTicketCount.tooltip=Ez a szám ami a azoknak a chunkoknak a számát adja meg, amit 1 mod betölthet. +forge.configgui.maximumTicketCount=Mod "ticket" limit +forge.configgui.playerTicketCount.tooltip=A maximum "ticket" szám, amit 1 playerhez köthet a mod. Ezek az összes mod között megosztva vannak és használhatják is azokat. +forge.configgui.playerTicketCount=Játékos "ticket" limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/it_IT.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/it_IT.lang new file mode 100644 index 0000000..14b5705 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/it_IT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Usa /forge . I subcomandi sono tps, track +commands.forge.usage.tracking=Usa /forge track . I tipi validi sono le entità piatte. La durata deve essere < 60. +commands.forge.tps.summary=%s \: Tempo medio dei tick\: %d ms. TPS medi\: %d + +commands.forge.tracking.te.enabled=Tracciamento delle entità piatte abilitata per %d secondi. +forge.texture.preload.warning=Attenzione\: La grafica %s non è pre-caricata, questo causerà errori nel rendering\! +forge.client.shutdown.internal=Spegnendo server interno.... +forge.update.newversion=Nuova versione di Forge è uscita\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Altri problemi possono sorgere, controlla prima di segnalare. + +forge.configgui.forgeConfigTitle=Configurazione Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Quì è dove puoi modificare le impostazioni contenute in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Impostazioni Generali +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Quì è dove puoi modificare le impostazioni contenute in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Impostazioni di Default +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Quì è dove puoi definire le impostazioni mod-specific che saranno utilizzate invece di quelle di default. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Sostituzioni Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Quì è dove puoi definire le impostazioni mod-specific che saranno utilizzate invece di quelle di default. Un valore pari a zero in qualuncue entrata disabiliterà tutte le capacità di ChunkLoading per quella mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Aggiungi Nuova Mod Sustitutiva +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controlla il gamma di Sky Blending per i cieli colorati nei biomi. +forge.configgui.biomeSkyBlendRange=Gamma Miscela Cielo del Bioma +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ja_JP.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ja_JP.lang new file mode 100644 index 0000000..26e7ddb --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ja_JP.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge を使用しましょう。Subcommand(サブコマンド) は tps と track です。 +commands.forge.usage.tracking=/forge track を使用しましょう。有効な type(種類) は、te (TileEntities) です。 Duration(継続時間) は60より小さい値です。 +commands.forge.tps.summary=%s\: 1tickあたりの時間\: %d ms. 1秒あたりのtick数(TPS)\: %d + +commands.forge.tracking.te.enabled=タイルエンティティのトラッキングを %d 秒間有効にします。 +forge.texture.preload.warning=警告\: テクスチャである %s がプリロードされなかったので描画がおかしくなってしまいます! +forge.client.shutdown.internal=内部サーバーを終了中... +forge.update.newversion=新しいバージョンの Forge がリリースされています\: %s +forge.update.beta.1=%s警告\: %s Forge ベータ +forge.update.beta.2=主要な問題は、報告する前に検証してください。 + +forge.configgui.forgeConfigTitle=Minecraft Forge 設定 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=ここでは forge.cfg に含まれる設定を編集することができます。 +forge.configgui.ctgy.forgeGeneralConfig=一般設定 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=ここでは forgeChunkLoading.cfg に含まれる設定を編集することができます。 +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge チャンクローダー デフォルト設定 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=ここではデフォルトの代わりに使用するMod固有の優先設定を定義することができます。 +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod オーバーライド +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=デフォルトを上書きするMod固有の設定を定義することができます。いずれかの項目に0の値を設定すると、実際にそのModのチャンク読み込み機能を無効にします。 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ 新しいModオーバーライドを追加 +forge.configgui.ctgy.VersionCheckConfig=バージョンチェック設定 + +forge.configgui.biomeSkyBlendRange.tooltip=バイオームでの色のついた空の混合範囲を制御します。 +forge.configgui.biomeSkyBlendRange=バイオームの空の混合範囲 +forge.configgui.clumpingThreshold.tooltip=Packet51 が Packet52 よりも優先される数のしきい値を制御します。 +forge.configgui.clumpingThreshold=パケットクランピングのしきい値 +forge.configgui.disableVersionCheck.tooltip=Forgeのバージョンチェック機能を無効にする場合はtrueに設定します。Forgeは、バージョン情報を取得するためにサーバー上にある小さなjsonファイルを照会します。詳細については、githubのForgeVersionクラスをご覧ください。 +forge.configgui.disableVersionCheck=Forge のバージョンチェックを無効化 +forge.configgui.enableGlobalConfig=グローバル設定を有効化 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=複数のブロックが同じ流体にリンクしようとした場合に、強制的にクラッシュさせるにはtrueに設定します。 +forge.configgui.forceDuplicateFluidBlockCrash=液体ブロックのクラッシュの強制欺瞞 +forge.configgui.fullBoundingBoxLadders.tooltip=ブロックだけではなく、はしごのエンティティ全体の当たり判定をチェックするためにはこれをtrueに設定します。デフォルトではバニラの動作であるため、力学の顕著な差異を引き起こします。 +forge.configgui.fullBoundingBoxLadders=はしごの全体の当たり判定 +forge.configgui.removeErroringEntities.tooltip=サーバーを閉じてクラッシュログを報告する代わりに、エラーをその更新メソッドでスローさせてすべてのエンティティを削除するにはこれをtrueに設定します。注意\: これはすべてを台無しにする可能性があり、使用する際に警告が表示されますが、私達はゲームデータが破損しても一切責任を負いかねます。 +forge.configgui.removeErroringEntities=おかしなエンティティを削除 +forge.configgui.removeErroringTileEntities.tooltip=サーバーを閉じてクラッシュログを報告する代わりに、エラーをその更新メソッドでスローさせてすべてのTileEntityを削除するにはこれをtrueに設定します。注意\: これはすべてを台無しにする可能性があり、使用する際に警告が表示されますが、私達はゲームデータが破損しても一切責任を負いかねます。 +forge.configgui.removeErroringTileEntities=おかしなタイルエンティティを削除 +forge.configgui.sortRecipies.tooltip=Forgeのソーターを使用して、クラフトレシピのポスト初期のソートを有効にするには、trueに設定します。これは競合するレシピに同期ずれが発生する可能性があります。ConfigのGUIから変更した場合は、Minecraftを再起動する必要があります。 +forge.configgui.sortRecipies=レシピを並び替え +forge.configgui.zombieBabyChance.tooltip=ゾンビ(またはサブクラス)が赤ちゃんである確率。ゾンビのスポーン方法を変更することができます。 +forge.configgui.zombieBabyChance=赤ちゃんゾンビの確率 +forge.configgui.zombieBaseSummonChance.tooltip=通常のゾンビの召喚スポーン確率。ボーナスゾンビの召喚方法を変更することができます。 +forge.configgui.zombieBaseSummonChance=ゾンビの召喚確率 +forge.configgui.stencilbits=GL Stencil Bits を有効化 +forge.configgui.spawnfuzz=リスポーン位置の直径 + +forge.configgui.modID.tooltip=優先設定を定義した Mod の ID。 +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=アンロードされたチャンクの読み込み時間を速くするために、休止状態のキャッシュに保持することができます。ここでそのキャッシュのサイズ(チャンク)を指定します。 +forge.configgui.dormantChunkCacheSize=休止させるチャンクのキャッシュサイズ +forge.configgui.enableModOverrides.tooltip=Mod 毎に設定のカスタムを定義することを許可するにはこの設定を有効にします。 +forge.configgui.enableModOverrides=Mod オーバーライドを有効化 +forge.configgui.maximumChunksPerTicket.tooltip=これは、シングルチケットが強制することができるチャンクの最大数です。 +forge.configgui.maximumChunksPerTicket=チャンク毎のチケット最大数 +forge.configgui.maximumTicketCount.tooltip=これは、Mod を作成するために許可されているチャンクの読み込み要求数です。 +forge.configgui.maximumTicketCount=Mod チケット制限 +forge.configgui.playerTicketCount.tooltip=Mod の代わりにプレイヤーが割り当てることができるチケットの数。これは、すべての Mod の間で共有され、Mod が自由に使用することができます。 +forge.configgui.playerTicketCount=プレイヤーチケットの数 + +fml.config.sample.basicDouble.tooltip=定義されていない制限を持つ二重のプロパティです。 +fml.config.sample.basicDouble=制限無しの二重 +fml.config.sample.basicInteger.tooltip=定義されていない制限を持つ整数のプロパティです。 +fml.config.sample.basicInteger=制限無しの整数 +fml.config.sample.basicString.tooltip=基本的な文字列プロパティです。このテキストボックスに何か入力できます。 +fml.config.sample.basicString=基本的な文字列 +fml.config.sample.booleanList.tooltip=最大長ではないブーリアンリストは、延長または短縮することができます。 +fml.config.sample.booleanList=基本的なブーリアンリスト +fml.config.sample.booleanListFixed.tooltip=8の固定長のブーリアンリストです。 +fml.config.sample.booleanListFixed=固定長のブーリアンリスト +fml.config.sample.booleanListMax.tooltip=10の最大長のブーリアンリストです。 +fml.config.sample.booleanListMax=最大長のブーリアンリスト +fml.config.sample.boundedDouble.tooltip=定義された制限を持つ二重のプロパティです。 +fml.config.sample.boundedDouble=制限有りの二重 +fml.config.sample.boundedInteger.tooltip=定義されている制限を持つ整数のプロパティです。 +fml.config.sample.boundedInteger=制限有りの整数 +fml.config.sample.chatColorPicker.tooltip=フォントのカラーコードの選択が可能になる特別なプロパティです。 +fml.config.sample.chatColorPicker=チャットカラーピッカー +fml.config.sample.ctgy.lists.tooltip=プレイするたの様々な配列プロパティの制御を提供します。 +fml.config.sample.ctgy.lists=サンプルの配列制御 +fml.config.sample.ctgy.numbers.tooltip=調整するための数値制御のリストを提供します。 +fml.config.sample.ctgy.numbers=サンプルの数値制御 +fml.config.sample.ctgy.strings.tooltip=プレイするための異なる文字列タイプの制御のリストを提供します。 +fml.config.sample.ctgy.strings=サンプルの文字列制御 +fml.config.sample.cycleString.tooltip=切り替え可能な有効値のリストを定義している文字列のプロパティです。 +fml.config.sample.cycleString=値の文字列の切り替え +fml.config.sample.doubleList.tooltip=最大長ではない二重リストは、延長または短縮することができます。 +fml.config.sample.doubleList=基本的な二重リスト +fml.config.sample.doubleListBounded.tooltip=特定の上限値を持つ二重のリストです。 +fml.config.sample.doubleListBounded=上限値を持つ二重リスト +fml.config.sample.doubleListFixed.tooltip=10の固定長を持つ二重のリストです。 +fml.config.sample.doubleListFixed=固定長の二重リスト +fml.config.sample.doubleListMax.tooltip=15の最大長を持つ二重のリストです。 +fml.config.sample.doubleListMax=最大長の二重リスト +fml.config.sample.imABoolean.tooltip=かなりのものだ... 私はブーリアン制御器です。 +fml.config.sample.imABoolean=私はブーリアンです +fml.config.sample.imADouble.tooltip=私は2人います。確かではないですが、もしかしたらCIAとKGBの両方の役割を果たすかもしれません。 +fml.config.sample.imADouble=私は二重です +fml.config.sample.imAString.tooltip=ああ。私達はあなたの粉石けんがみんなに知りわたってもおかしくないと思うよ。 \n<*文字列じゃなくて、ですか?*> \n文字列と粉石けん... なにか違うかい?僕達はなんでも販売できるんだ。 \n<*そうなんですか。もしかして、文字列を大量に持っていて、それを他の人にも教えようと思っているんですか...?*> \nもちろんさ!全国規模でやるつもりだよ。便利だし、文字列に異常はないし。 \n<*えっと、それ大変だと思うんですが。全国というと122,000マイル、つまり3インチの長さですよね。便利ではないし、むしろかなり極悪な計画じゃないですか。*> \nいや、それは僕達からのセールスポイントさ!シンプソンさんのそれぞれの文字列だよ!切り取ればいいだけで、扱いやすいし、それにちょうどいい長さだからね!シンプソン様と呼んでもいいくらいだ! +fml.config.sample.imAString=私は文字列です +fml.config.sample.imAnInteger.tooltip=私は整数だと言いましたか?まあ、そういうことにしましょうか。 +fml.config.sample.imAnInteger=私は整数です +fml.config.sample.integerList.tooltip=最大長ではない整数のリストは、延長または短縮できます。 +fml.config.sample.integerList=基本的な整数リスト +fml.config.sample.integerListBounded.tooltip=特定の上限値を持つ整数のリストです。 +fml.config.sample.integerListBounded=上限値を持つ整数リスト +fml.config.sample.integerListFixed.tooltip=10の固定長を持つ整数のリストです。 +fml.config.sample.integerListFixed=固定長の整数リスト +fml.config.sample.integerListMax.tooltip=15の最大長を持つ整数のリストです。 +fml.config.sample.integerListMax=最大長の整数リスト +fml.config.sample.modIDSelector.tooltip=導入されているすべてのModからMod IDを選択することができる特別のプロパティです。これは、カスタムコードで使用することができる可能性が多いです。バイオームの選択、エンティティの選択、アイテムの選択、ブロックの選択など... +fml.config.sample.modIDSelector=Mod IDセレクター +fml.config.sample.patternString.tooltip=パターンオブジェクトを使用して検証された文字列のプロパティです。 +fml.config.sample.patternString=パターン検証済みの文字列 +fml.config.sample.sliderDouble.tooltip=スライダーコントロールを使用した、定義されている制限を持つ二重のプロパティです。 +fml.config.sample.sliderDouble=スライダー二重 +fml.config.sample.sliderInteger.tooltip=スライダーコントロールを使用した、定義されている制限を持つ整数のプロパティです。 +fml.config.sample.sliderInteger=スライダーの整数 +fml.config.sample.stringList.tooltip=検証していない基本的な文字列のリストです。 +fml.config.sample.stringList=基本的な文字列リスト +fml.config.sample.stringListFixed.tooltip=7の固定長を持つ文字列のリストです。 +fml.config.sample.stringListFixed=固定長の文字列リスト +fml.config.sample.stringListMax.tooltip=15の最大長を持つ文字列のリストです。 +fml.config.sample.stringListMax=最大長の文字列リスト +fml.config.sample.stringListPattern.tooltip=パターンオブジェクトを使用して、それぞれの値を検証する文字列です。 +fml.config.sample.stringListPattern=パターン検証済みの文字列リスト +fml.config.sample.title=これは、設定GUIの動作をプレイするためです。変更は保存されません。 + +fml.configgui.applyGlobally=グローバルに適応する +fml.configgui.confirmRestartMessage=解りました +fml.configgui.gameRestartRequired=1つ以上変更された設定は、有効にするためにMinecraftを再起動する必要があります。 +fml.configgui.gameRestartTitle=Minecraftの再起動が必要です +fml.configgui.sampletext=サンプルテキスト +fml.configgui.tooltip.addNewEntryAbove=上の新しいエントリーを追加する +fml.configgui.tooltip.applyGlobally=グローバルに変更の取り消しまたは初期値に戻すことを適応します。 +fml.configgui.tooltip.removeEntry=エントリーを削除する +fml.configgui.tooltip.resetAll=すべてをリセットします。「グローバルに適応する」のチェックボックスにチェックがある場合、小画面の値も元に戻ります。 +fml.configgui.tooltip.resetToDefault=初期値に戻す +fml.configgui.tooltip.undoAll=すべての変更を元に戻します。「グローバルに適応する」のチェックボックスにチェックがある場合、小画面への変更も元に戻ります。 +fml.configgui.tooltip.undoChanges=変更を元に戻す +fml.configgui.tooltip.default=[初期値\: %s] +fml.configgui.tooltip.defaultNumeric=[範囲\: %s~%s, 初期値\: %s] + +fml.menu.mods=Mod +fml.menu.mods.normal=ノーマル +fml.menu.mods.search=検索\: +fml.menu.modoptions=Mod設定... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ko_KR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ko_KR.lang new file mode 100644 index 0000000..5e7c2bc --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ko_KR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/Forge 를 사용하세요. 하위 명령은 tps 과 track 입니다 +commands.forge.usage.tracking=/forge track <유형><기간>을 사용하세요. 사용할 수 있는 유형들\: (Tile Entities). <기간>은 60 이하여야 합니다.  +commands.forge.tps.summary=%s \: 1틱당 평균 시간\: %d ms. 평균 TPS\: %d + +commands.forge.tracking.te.enabled=타일 엔터티 추적이 %d초 동안 활성화 되었습니다. +forge.texture.preload.warning=경고\: 텍스쳐 %s가 미리 로드되지 않았습니다, 렌더링 오류가 발생할 것입니다\! +forge.client.shutdown.internal=내부 서버를 종료합니다... +forge.update.newversion=사용 가능한 새로운 Forge 버전\: %s +forge.update.beta.1=%s주의\: %sForge 베타 +forge.update.beta.2=주요 문제가 발생할 수 있습니다, 보고하기 전에 확인해 주세요 + +forge.configgui.forgeConfigTitle=Minecraft Forge 구성 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=여기서 forge.cfg에 지정되어 있는 설정들을 편집할 수 있습니다. +forge.configgui.ctgy.forgeGeneralConfig=일반 설정 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=여기서 forgeChunkLoading.cfg에 지정되어 있는 컨피그 설정들을 편집할 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingConfig=포지 청크로더 기본 설정 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=여기서 기본값 대신에 사용할 모드 재정의 설정을 규정할 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingModConfig=모드 재정의 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=기본값을 대체할 청크로딩 관련 모드 재정의 설정을 규정할 수 있게 해 줍니다. 여기에 0의 값을 지정함으로서 해당모드가 청크를 로딩할 수 없게 만들 수 있습니다. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=새로운 모드 재정의 추가 +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=바이옴의 하늘 색깔 혼합 범위를 조정 +forge.configgui.biomeSkyBlendRange=바이옴 하늘 혼합 범위 +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Forge 버전 확인 비활성화 +forge.configgui.enableGlobalConfig=전역 설정 활성화 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=오류가 나는 엔티티 제거 +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=제작법 분류 +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=좀비 소환 확률 +forge.configgui.stencilbits=GL 스텐실 비트 활성화 +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=모드 재정의 활성화 +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=티켓 당 청크 제한 +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=모드 티켓 제한 +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=플레이어 티켓 제한 + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/lt_LT.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/lt_LT.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/lt_LT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/nb_NO.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/nb_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/nb_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/nl_NL.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/nl_NL.lang new file mode 100644 index 0000000..b747856 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/nl_NL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Gebruik /forge . Subcommando's zijn tps, track +commands.forge.usage.tracking=Gebruik /forge track . Geldige soorten zijn te (Tile Entities). Tijd moet <60 zijn. +commands.forge.tps.summary=%s \: Gemiddelde tick tijd\: %d ms. Gemiddelde TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity volgen is ingeschakeld voor %d seconden. +forge.texture.preload.warning=Waarschuwing\: Texture %s is niet voorgeladen, zal render glitches veroorzaken\! +forge.client.shutdown.internal=Interne server wordt afgesloten... +forge.update.newversion=Nieuwe Forge versie beschikbaar\: %s +forge.update.beta.1=%sWAARSCHUWING\: %sForge Beta +forge.update.beta.2=Grote problemen kunnen bovenkomen, controleer voor te rapporteren. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuratie +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Hier kun je de instellingen uit forge.cfg aanpassen. +forge.configgui.ctgy.forgeGeneralConfig=Algemene Instellingen +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Hier kun je de instellingen uit forgeChunkLoading.cfg aanpassen. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Lader Standaard Instellingen +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dit is waar je mod-specifieke overschrijvende instellingen kan definiëren die gebruikt zullen worden in plaats van de standaardwaarden. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod overschrijvingen +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Staat je toe om mod-specifieke instellingen te definiëren die de standaardwaarden overschrijden. Een waarde van nul in eender item schakelt de chunkladermogelijkheden van die mod uit. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Voeg een nieuwe mod overschrijving toe +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Bestuur het bereik van de luchtmenging voor gekleurde luchten in biomes. +forge.configgui.biomeSkyBlendRange=Biome Luchtmenging Grootte +forge.configgui.clumpingThreshold.tooltip=Bepaalt de drempel waarbij Packet51 over Packet52 verkozen wordt. +forge.configgui.clumpingThreshold=Pakket Klonteren Limiet +forge.configgui.disableVersionCheck.tooltip=Zet op true om de versie controles van Forge uit te schakelen. Forge vraagt een klein json bestand op van onze server voor versie informatie. Voor meer info zie de ForgeVersion class in onze github. +forge.configgui.disableVersionCheck=Zet Forge's versie check uit +forge.configgui.enableGlobalConfig=Globale Configuratie Inschakelen +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Zet dit op true om een crash te forceren als meer dan één blok probeert te linken als dezelfde Vloeistof. +forge.configgui.forceDuplicateFluidBlockCrash=Forceer Duplicaat Vloeistof Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Zet dit op true om de hele entiteit botsingsdoos te controleren voor ladders in plaats van enkel de blok waar deze in is. Veroorzaakt opmerkelijke verschillen in mechaniek dus standaard is vanilla. +forge.configgui.fullBoundingBoxLadders=Volledige Botsingsdoos Ladders +forge.configgui.removeErroringEntities.tooltip=Zet dit op true om elke entiteit te verwijderen die een fout maakt in zijn update methode in plaats van de server te sluiten en een crash te rapporteren. LET OP DIT KAN ALLES VERKNOEIEN GEBRUIK ZELDEN WIJ ZIJN NIET VERANTWOORDELIJK VOOR SCHADE. +forge.configgui.removeErroringEntities=Verwijder Foutmeldende Entiteiten +forge.configgui.removeErroringTileEntities.tooltip=Zet dit op true om elke tegelentiteit te verwijderen die een fout maakt in zijn update methode in plaats van de server te sluiten en een crash te rapporteren. LET OP DIT KAN ALLES VERKNOEIEN GEBRUIK ZELDEN WIJ ZIJN NIET VERANTWOORDELIJK VOOR SCHADE. +forge.configgui.removeErroringTileEntities=Verwijder Crashende Tile Entities +forge.configgui.sortRecipies.tooltip=Zet dit op true om het post-initialisatie sorteren van vervaardigingsrecepten door Forge's sorteerder te activeren. Kan desynchronizatie veroorzaken op conflicterende recepten. MINECRAFT MOET OPNIEUW OPGESTART WORDEN INDIEN VERANDERD IN HET CONFIGURATIESCHERM. +forge.configgui.sortRecipies=Sorteer Recepten +forge.configgui.zombieBabyChance.tooltip=Kans dat een zombie (of een subclass ervan) een baby is. Laat wijzigingen in het zombie spawn systeem toe. +forge.configgui.zombieBabyChance=Zombie Baby Kans +forge.configgui.zombieBaseSummonChance.tooltip=Basis Zombie oproepingskans. Staat toe de bonus zombie oproepingsmechaniek te veranderen. +forge.configgui.zombieBaseSummonChance=Zombie Oproep Kans +forge.configgui.stencilbits=Schakel GL Stencil Bits in +forge.configgui.spawnfuzz=Respawn de Fuzz Diameter + +forge.configgui.modID.tooltip=Het Mod ID waar U overschrijfinstellingen voor wilt definiëren. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=ongeladen chunks kunnen eerst worden bewaard in een dormant cache voor snellere laadtijden. geef de grote van de cache in chucks. +forge.configgui.dormantChunkCacheSize=De Cache grote van een Dormant Chunk +forge.configgui.enableModOverrides.tooltip=Schakel deze instelling in om aangepaste instellingen voor individuele Mods te definiëren. +forge.configgui.enableModOverrides=sta Mod Overrides toe +forge.configgui.maximumChunksPerTicket.tooltip=Dit is de maximale aantal chunks dat een ticket kan forceren. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limiet +forge.configgui.maximumTicketCount.tooltip=Dit is het aantal aanvragen om een Chunk te laden dat een Mod is toegestaan te doen. +forge.configgui.maximumTicketCount=Mod Ticket limiet +forge.configgui.playerTicketCount.tooltip=Het aantal tickets dat een speler kan toewijzen in plaats van een mod. dit is van invloed op alle mods en het aan de mod zelf om het te gebruiken. +forge.configgui.playerTicketCount=Speler Ticket Limiet + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/nn_NO.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/nn_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/nn_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/no_NO.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/no_NO.lang new file mode 100644 index 0000000..f6f334c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/no_NO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Bruk /forge . Underkommandoer er tps, track +commands.forge.usage.tracking=Bruk /forge track . Gyldige typer er te (Tile Entities). Varighet er < 60. +commands.forge.tps.summary=%s \: Gjennomsnittlig tikktid\: %d ms. Gjennomsnittlig TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity-sporing aktivert i %d sekunder. +forge.texture.preload.warning=Advarsel\: Tekstur %s ikke forhåndslastet, dette vil føre til grafiske feil\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=Ny Forge-versjon tilgjengelig\: %s +forge.update.beta.1=%sADVARSEL\: %sForge Beta +forge.update.beta.2=Store problemer kan oppstå, kontroller før du rapporterer. + +forge.configgui.forgeConfigTitle=Minecraft Forge-konfigurasjon +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Dette er stedet du kan endre innstillingene i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Generelle innstillinger +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Dette er stedet du kan endre innstillingene i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinnstillinger for Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Dette er stedet du kan definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Lar deg definere mod-spesifikke innstillinger som vil overstyre standardinnstillingene. Verdien null i en av oppføringene vil deaktivere chunklastingskapabilitetene for den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Kontrollerer verditerskelen for når Packet51 foretrekkes over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/pl_PL.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/pl_PL.lang new file mode 100644 index 0000000..0063ab6 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/pl_PL.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Użyj /forge . Podpolecenia to\: tps, track +commands.forge.usage.tracking=Użyj /forge track . Poprawne typy\: (Tile Entities). Czas trwania musi być mniejszy niż 60.  +commands.forge.tps.summary=%s \: Średni czas tick'u\: %d ms. Średni TPS\: %d + +commands.forge.tracking.te.enabled=Śledzenie Tile Entity włączone na %d sekund. +forge.texture.preload.warning=Uwaga\: Tekstura %s nie została wczytana, wystąpią błędy renderowania\! +forge.client.shutdown.internal=Zamykanie serwera wewnętrznego... +forge.update.newversion=Nowa wersja Forge\: %s +forge.update.beta.1=%sOstrzeżenie\: %sForge Beta +forge.update.beta.2=Mogą pojawić się poważne błędy. Wymagana jest dokładna weryfikacja przed dokonaniem zgłoszenia. + +forge.configgui.forgeConfigTitle=Konfiguracja Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Tutaj można edytować ustawienia z forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Główne ustawienia +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Tutaj można edytować ustawienia z forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Domyślne ustawienia Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Tutaj można zdefiniować ustawienia dla poszczególnych modyfikacji, które zostaną użyte zamiast domyślnych. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Modyfikacja zastępuje +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Pozwala zdefiniować ustawienia dla poszczególnych modyfikacji, które zastępują domyślne. Wartość zero w jakimkolwiek polu wyłącza możliwość wczytywania chunk'ów dla danej modyfikacji. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Dodaj nową modyfikację zastępująca +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Kontrola poziomu mieszania kolorów nieba w biomach. +forge.configgui.biomeSkyBlendRange=Poziom mieszania kolorów nieba w biomach +forge.configgui.clumpingThreshold.tooltip=Określa wartość progową, w której Packet51 jest mianowany przez Packet52. +forge.configgui.clumpingThreshold=Pakiet grupowania progu +forge.configgui.disableVersionCheck.tooltip=Ustaw na 'true' aby wyłączyć mechanizm sprawdzania wersji Forge, który odbywa się poprzez zapytanie o mały plik json na danym serwerze z informacją o wersji. Więcej szczegółów znajduje się w klasie ForgeVersion na oficjalnym GitGub'ie Minecraft Forge. +forge.configgui.disableVersionCheck=Wyłącz sprawdzanie wersji Minecraft Forge +forge.configgui.enableGlobalConfig=Włącz ustawienia globalne +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Ustaw na 'true', aby wymusić błąd, gdy więcej niż jeden blok odnosi się do tej samej cieczy. +forge.configgui.forceDuplicateFluidBlockCrash=Poziom błędu cieczy wywołujący awarię +forge.configgui.fullBoundingBoxLadders.tooltip=Ustaw na 'true', aby sprawdzać całe pole ograniczające entity dla drabinek, zamiast tylko bloku, w którym są. Powoduje zauważalne zmiany w mechanice gry, dlatego domyślnie jest wyłączone. +forge.configgui.fullBoundingBoxLadders=Pełny wymiar pola drabiny +forge.configgui.removeErroringEntities.tooltip=Ustaw na 'true', aby usunąć dowolny Entity, który zgłasza błąd w metodzie aktualizacji zamiast zamykania serwera oraz zgłasza awarię. UWAGA\! MOŻE TO POWAŻNIE USZKODZIĆ ZNACZNĄ CZĘŚĆ GRY\! MINECRAFT FORGE NIE BIERZE ODPOWIEDZIALNOŚCI ZA EWENTUALNE SZKODY. +forge.configgui.removeErroringEntities=Usuń wszystkie błędne entity +forge.configgui.removeErroringTileEntities.tooltip=Ustaw na 'true', aby usunąć dowolny TileEntity, który zgłasza błąd w metodzie aktualizacji zamiast zamykania serwera oraz zgłasza awarię. UWAGA\! MOŻE TO POWAŻNIE USZKODZIĆ ZNACZNĄ CZĘŚĆ GRY\! MINECRAFT FORGE NIE BIERZE ODPOWIEDZIALNOŚCI ZA EWENTUALNE SZKODY. +forge.configgui.removeErroringTileEntities=Usuń błędy Tile Entities +forge.configgui.sortRecipies.tooltip=Ustaw na 'true', aby włączyć automatyczne sortowanie receptur przez specjalne narzędzia Forge. Może spowodować utratę synchronizacji przy sprzecznych recepturach. WYMAGA PONOWNEGO URUCHOMIENIA GRY MINECRAFT, JEŻELI ZMIANA DOTYCZY RÓWNIEŻ KONFIGURACJI GUI. +forge.configgui.sortRecipies=Sortowanie receptur +forge.configgui.zombieBabyChance.tooltip=Szansa na stworzenie zombie (lub podklasy) jako dziecko. Pozwala na zmianę mechaniki powstawania zombie. +forge.configgui.zombieBabyChance=Szansa na zombie dziecko +forge.configgui.zombieBaseSummonChance.tooltip=Podstawowa szansa na tworzenie się zombie. Pozwala na zmianę dodatkowej mechaniki tworzenia się zombie. +forge.configgui.zombieBaseSummonChance=Szansa na tworzenie się zombie +forge.configgui.stencilbits=Włącz schemat GL bitów +forge.configgui.spawnfuzz=Odradzanie średniego rozmycia + +forge.configgui.modID.tooltip=ID modyfikacji, które chcesz zastosować, zastępuję ustawienia. +forge.configgui.modID=ID modyfikacji +forge.configgui.dormantChunkCacheSize.tooltip=Niezaładowane chunk'i mogą być pierwotnie przechowywane w zwolnionej pamięci podręcznej. Określ ilość chunk'ów, które mogą być przechowywane w ten sposób. +forge.configgui.dormantChunkCacheSize=Bezczynna pamięć podręczna chunk'u +forge.configgui.enableModOverrides.tooltip=Włącz, aby ustawić niestandardową konfigurację domyślą dla modyfikacji. +forge.configgui.enableModOverrides=Włącz tryb nadpisywania modyfikacji +forge.configgui.maximumChunksPerTicket.tooltip=Maksymalna liczba chunk'ów, którą może wymusić dany tick. +forge.configgui.maximumChunksPerTicket=Limit ticket'ów na chunk +forge.configgui.maximumTicketCount.tooltip=Jest to liczba załadowanych chunk'ów, które są dopuszczone do tworzenia przez modyfikację. +forge.configgui.maximumTicketCount=Limit ticket'ów modyfikacji +forge.configgui.playerTicketCount.tooltip=Liczba tick'ów, które gracz może mieć przyporządkowane zamiast modyfikacji. Jest to współużytkowanie przez wszystkie modyfikacje. +forge.configgui.playerTicketCount=Limit tick'ów określonych przez gracza + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/pt_BR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/pt_BR.lang new file mode 100644 index 0000000..279fd53 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/pt_BR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcomandos são tps, track +commands.forge.usage.tracking=Use /forge track . Tipos válidos são\: te (Tile Entities). Duração é < 60. +commands.forge.tps.summary=%s \: Tempo médio por tick\: %d ms. TPS médio\: %d + +commands.forge.tracking.te.enabled=Rastreamento de Tile Entities habilitado por %d segundos. +forge.texture.preload.warning=Aviso\: A textura %s não foi pré-carregada, isso irá causar erros de renderização\! +forge.client.shutdown.internal=Desligando servidor interno... +forge.update.newversion=Nova versão do Forge está disponível\: %s +forge.update.beta.1=%sAVISO\: %sBeta do Forge +forge.update.beta.2=Problemas graves podem estar presentes, verifique-os antes de relatar. + +forge.configgui.forgeConfigTitle=Configuração do Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aqui é aonde você pode editar as opçoes contidas em forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Configurações Gerais +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aqui é aonde você pode editar as opçoes contidas em forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configurações Padrões do Carregador de Chunks do Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aqui é aonde você pode definir opções específicas de um mod que serão usadas ao invés das padrões. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Substituições de Mod +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir configurações para mods específicos que irão substituir as padrão. Um valor de zero em qualquer entrada desativa a funcionalidade de chunkloading para esse mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adicionar Nova Substituição de Mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controle a gama de mistura do céu para céus coloridos em biomas. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controla o número limite em que o Packet51 é preferido sob o Packet52. +forge.configgui.clumpingThreshold=Limite de Aglutinação de Pacotes +forge.configgui.disableVersionCheck.tooltip=Defina como verdadeiro para desabilitar as mecânicas de verificação da versão do Forge. O Forge requer um pequeno arquivo json no nosso servidor para informação das versões. Para mais detalhes, veja a classe ForgeVersion no nosso github. +forge.configgui.disableVersionCheck=Desabilitar Checagem de Versão do Forge +forge.configgui.enableGlobalConfig=Habilitar a Configuração Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Marque para forçar um crash se mais de um bloco tentar referenciar o mesmo Fluido. +forge.configgui.forceDuplicateFluidBlockCrash=Forçar Crash para Blocos Fluidos Duplicados +forge.configgui.fullBoundingBoxLadders.tooltip=Marque para checar toda a caixa de colisão da entidade em escadas ao invés de apenas o bloco em que ela está. Causa diferenças visíveis nas mecânicas, por isso o comportamento padrão é o do Minecraft clássico. +forge.configgui.fullBoundingBoxLadders=Caixa de Colisão Completa para Escadas +forge.configgui.removeErroringEntities.tooltip=Marque para remover qualquer Entidade que lance um erro ao ser atualizada, ao invés em vez de encerrar o servidor e relatar o erro. NOTE QUE ISTO PODE QUEBRAR TUDO, USE COM MODERAÇÃO, NÓS NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringEntities=Remover Entidades com Erros +forge.configgui.removeErroringTileEntities.tooltip=Marque para remover qualquer TileEntity que lance um erro ao ser atualizada, ao invés em vez de encerrar o servidor e relatar o erro. NOTE QUE ISTO PODE QUEBRAR TUDO, USE COM MODERAÇÃO, NÓS NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringTileEntities=Remover Tile Entities com Erros +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ordenar Receitas +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Chance de Bebê Zumbi +forge.configgui.zombieBaseSummonChance.tooltip=Chance inicial de evocar zombies bebés. Permite alterar as mecânicas de evocação de zombies. +forge.configgui.zombieBaseSummonChance=Chance de Invocação de Zumbi +forge.configgui.stencilbits=Ativar GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=O ID do mod para que você quer definir as configurações de substituição. +forge.configgui.modID=ID do Mod +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Tamanho da Cache Dormente de Chunks +forge.configgui.enableModOverrides.tooltip=Habilite esta configuração para permitir configurações por mod personalizadas de serem definidas. +forge.configgui.enableModOverrides=Habilitar Substituições de Mod +forge.configgui.maximumChunksPerTicket.tooltip=Este é o máximo de chunks que um ticket pode forçar a ficarem carregados. +forge.configgui.maximumChunksPerTicket=Limite de Chunks por Ticket +forge.configgui.maximumTicketCount.tooltip=Este é o número das solicitações de carregamento de chunk que um mod pode fazer. +forge.configgui.maximumTicketCount=Limite de Tickets por Mod +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Limite de Tickets por Jogador + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/pt_PT.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/pt_PT.lang new file mode 100644 index 0000000..c346119 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/pt_PT.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Usa /forge . Sub-comandos disponíveis são tps, track +commands.forge.usage.tracking=Usa /forge track . Tipos válidos são\: te (Tile Entities). Duração é < 60.  +commands.forge.tps.summary=%s \: Tempo por tick\: %d ms. TPS\: %d + +commands.forge.tracking.te.enabled=A monitorização de Tile Entities foi ativada por %d segundos. +forge.texture.preload.warning=Aviso\: A textura %s não foi previamente carregada, irá causar erros de renderização\! +forge.client.shutdown.internal=A encerrar o servidor interno... +forge.update.newversion=Uma nova versão do Forge está disponível\: %s +forge.update.beta.1=%sAVISO\: %sBeta do Forge +forge.update.beta.2=Erros podem estar presentes, verifica-os antes de os reportar. + +forge.configgui.forgeConfigTitle=Configurações do Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aqui podes editar as configurações do forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Confgurações Gerais +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aqui podes editar as configurações do forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Configurações Padrão do Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aqui podes definir configurações específicas a mods que substituirão as padrão. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Substituições em Mods +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Permite definir configurações para mods específicos que irão substituir as padrão. Um valor de zero em qualquer entrada desativa a funcionalidade de chunkloading para esse mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adicionar Nova Substituição +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controla o número limite em que o Packet51 é preferido sob o Packet52. +forge.configgui.clumpingThreshold=Limite de Compressão de Pacotes +forge.configgui.disableVersionCheck.tooltip=Marca isto para desativar a verificação de novas versões do Forge. O Forge apenas pede um pequeno ficheiro json no nosso servidor para obter informação sobre a versão. Para mais informações, vê a classe ForgeVersion no nosso github. +forge.configgui.disableVersionCheck=Desativar Verificação de Versões do Forge +forge.configgui.enableGlobalConfig=Ativar Configuração Global +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Marca isto para forçar um crash se mais que um bloco tentar usar o mesmo Fluido. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Marca isto para marcar toda a área de colisão da entidade para as escadas, em vez de apenas o bloco onde elas estão. Esta opção bastantes diferenças nas mecânicas do jogo, por isso o padrão está definido para o vanilla. +forge.configgui.fullBoundingBoxLadders=Escadas com Maior Área de Colisão +forge.configgui.removeErroringEntities.tooltip=Marca isto para remover qualquer Entity que lance um erro ao ser atualizada, em vez de encerrar o servidor e reportar o erro. NOTA QUE ISTO PODE CORRER MUITO MAL, USA COM MODERAÇÃO. NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringEntities=Remover Entities Corrompidas +forge.configgui.removeErroringTileEntities.tooltip=Marca isto para remover qualquer TileEntity que lance um erro ao ser atualizada, em vez de encerrar o servidor e reportar o erro. NOTA QUE ISTO PODE CORRER MUITO MAL, USA COM MODERAÇÃO. NÃO SOMOS RESPONSÁVEIS POR QUAISQUER DANOS PROVOCADOS. +forge.configgui.removeErroringTileEntities=Remover Tile Entities Corrompidas +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Ordenar Receitas +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Chance de Evocar Zombie Bebé +forge.configgui.zombieBaseSummonChance.tooltip=Chance inicial de evocar zombies bebés. Permite alterar as mecânicas de evocação de zombies. +forge.configgui.zombieBaseSummonChance=Chance de Evocar Zombie +forge.configgui.stencilbits=Ativar GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=ID do mod +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Tamanho da Cache Dormente de Chunks +forge.configgui.enableModOverrides.tooltip=Ativa esta opção para permitir configurações individuais para cada mod. +forge.configgui.enableModOverrides=Ativar Substituições para Mods +forge.configgui.maximumChunksPerTicket.tooltip=Este é o máximo de chunks que um ticket pode forçar a ficarem carregados. +forge.configgui.maximumChunksPerTicket=Limite de Chunks por Ticket +forge.configgui.maximumTicketCount.tooltip=Este é o número de pedidos para carregar chunks que um mod pode fazer. +forge.configgui.maximumTicketCount=Limite de Tickets por Mod +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Limite de Tickets por Jogador + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ro_RO.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ro_RO.lang new file mode 100644 index 0000000..eeb95a1 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ro_RO.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Folosește /forge . Subcomenzile sunt tps, track +commands.forge.usage.tracking=Folosește /forge track . Tipurile valide sunt te (Tile Entities). Durata este < 60. +commands.forge.tps.summary=%s \: Timp mediu pentru momente\: %d ms. TPS mediu\: %d + +commands.forge.tracking.te.enabled=Urmărirea pentru Tile Entities activată pentru %d secunde. +forge.texture.preload.warning=Atenție\: Textura %s nu este preîncărcată, va cauza erori de randare\! +forge.client.shutdown.internal=Se oprește serverul intern... +forge.update.newversion=Versiune nouă de Forge disponibilă\: %s +forge.update.beta.1=%sATENȚIE\: %sForge Beta +forge.update.beta.2=Se poate să apară probleme majore, verifică înainte de a semnala. + +forge.configgui.forgeConfigTitle=Configurare Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Aici poți modifica setările aflate în forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Setări generale +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Aici poți modifica setările aflate în forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Setări implicite Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Aici poți defini setări de înlocuire specifice fiecărui mod care vor fi folosite în loc de cele implicite. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Înlocuiri de moduri +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Îți permite să definești setări specifice fiecărui mod care vor înlocui implicitele. O valoare de zero în oricare intrare dezactivează efectiv capacitățile de încărcare de chunkuri pentru acel mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Adaugă o înlocuire nouă de moduri +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Controlează distanța contopirii cerului pentru ceruri colorate în biomuri. +forge.configgui.biomeSkyBlendRange=Distanța contopirii cerurilor biomurilor +forge.configgui.clumpingThreshold.tooltip=Controlează pragul numeric la care Packet51 este preferat decât Packet52. +forge.configgui.clumpingThreshold=Pragul alipirii packetelor +forge.configgui.disableVersionCheck.tooltip=Setează la true pentru a dezactiva mecanica Forge de verificare a versiunii. Forge interoghează un fișier mic json pe serverul nostru pentru informații despre versiune. Pentru mai multe detalii vezi clasa ForgeVersion în github-ul nostru. +forge.configgui.disableVersionCheck=Dezactivează verificarea versiunii Forge +forge.configgui.enableGlobalConfig=Activează configurarea globală +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Setează la true pentru a forța un crash dacă mai mult de un bloc încearcă să lege înapoi la același Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Forțează crash la duplicarea blocului fluid +forge.configgui.fullBoundingBoxLadders.tooltip=Setează la true pentru a verifica coliziunea întregii cutii de încadrare a entității în loc de numai blocul pe care se află. Provoacă diferențe notabile de funcționare, deci comportamentul implicit este cel din vanilla. +forge.configgui.fullBoundingBoxLadders=Toată cutia de încadrare pentru scări +forge.configgui.removeErroringEntities.tooltip=Setează la true pentru a elimina orice entitate care aruncă o eroare în metoda sa de actualizare în loc de a închide serverul și de a semnala un crash log. ATENȚIE ACEST LUCRU AR PUTEA STRICA TOTUL FOLOSEȘTE CU MODERAȚIE NU SUNTEM RESPONSABILI PENTRU DAUNE. +forge.configgui.removeErroringEntities=Elimină entitățile cu erori +forge.configgui.removeErroringTileEntities.tooltip=Setează la true pentru a elimina orice entitate de bloc care aruncă o eroare în metoda sa de actualizare în loc de a închide serverul și de a semnala un crash log. ATENȚIE ACEST LUCRU AR PUTEA STRICA TOTUL FOLOSEȘTE CU MODERAȚIE NU SUNTEM RESPONSABILI PENTRU DAUNE. +forge.configgui.removeErroringTileEntities=Elimină entitățile de bloc cu erori +forge.configgui.sortRecipies.tooltip=Setează la true pentru a activa sortarea rețetelor de fabricare după inițializare folosind sortatorul Forge. Poate cauza desincronizare la rețete contradictorii. TREBUIE SĂ REPORNEȘTI MINECRAFT DACĂ SCHIMBI OPȚIUNEA DE LA INTERFAȚA DE CONFIGURARE. +forge.configgui.sortRecipies=Sortează rețetele +forge.configgui.zombieBabyChance.tooltip=Șansa ca un zombi (sau o subclasă) să fie copil. Permite schimbarea mecanicii de apariție a zombilor. +forge.configgui.zombieBabyChance=Șansă de copii zombi +forge.configgui.zombieBaseSummonChance.tooltip=Șansa de bază de apariție a zombilor invocați. Permite schimbarea mecanicii de invocare a zombilor bonus. +forge.configgui.zombieBaseSummonChance=Șansa de invocare a zombilor +forge.configgui.stencilbits=Activează GL Stencil Bits +forge.configgui.spawnfuzz=Diametrul variației la reapariție + +forge.configgui.modID.tooltip=ID-ul de mod pentru care vrei să definești setări de înlocuire. +forge.configgui.modID=ID de mod +forge.configgui.dormantChunkCacheSize.tooltip=Chunkurile descărcate pot fi păstrate la început într-un cache latent pentru încărcare mai rapidă. Specifică mărimea (în chunkuri) a acelui cache aici. +forge.configgui.dormantChunkCacheSize=Mărimea cache-ului pentru chunkuri latente +forge.configgui.enableModOverrides.tooltip=Activează această setare pentru a permite definirea setărilor personalizate pentru fiecare mod. +forge.configgui.enableModOverrides=Activează înlocuiri de moduri +forge.configgui.maximumChunksPerTicket.tooltip=Acesta este numărul maxim de chunkuri pe care le poate forța un singur bilet. +forge.configgui.maximumChunksPerTicket=Limita chunkurilor pe bilet +forge.configgui.maximumTicketCount.tooltip=Acesta este numărul de solicitări de încărcare de chunkuri pe care are voie să le facă un mod. +forge.configgui.maximumTicketCount=Limită de bilete pe mod +forge.configgui.playerTicketCount.tooltip=Numărul de bilete care pot fi atribuite unui jucător în loc de unui mod. Acesta este același pentru toate modurile și folosirea lui este la latitudinea modurilor. +forge.configgui.playerTicketCount=Limită de bilete pe jucător + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/ru_RU.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/ru_RU.lang new file mode 100644 index 0000000..2cab39a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/ru_RU.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Используйте /forge <подкоманда>. Подкоманды\: tps, track +commands.forge.usage.tracking=Используйте /forge track <тип> <длительность>. Допустимые типы - TE (Tile Entities). Длительность < 60. +commands.forge.tps.summary=%s\: Cреднее время тика\: %d мс. Средний TPS\: %d + +commands.forge.tracking.te.enabled=Отслеживание Tile Entity включено на %d секунд. +forge.texture.preload.warning=Предупреждение\: Текстура %s не предзагружена, это может вызвать ошибки отображения\! +forge.client.shutdown.internal=Остановка внутренного сервера... +forge.update.newversion=Доступна новая версия Forge\: %s +forge.update.beta.1=%sПРЕДУПРЕЖДЕНИЕ\: %sForge Beta +forge.update.beta.2=Возможны серьёзные проблемы, проверьте их перед отправкой отчёта. + +forge.configgui.forgeConfigTitle=Конфигурация Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Здесь вы можете изменять настройки, хранимые в файле forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Общие настройки +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Здесь вы можете изменять настройки, хранимые в forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Настройки по умолчанию для загрузчика чанков Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Здесь вы можете устанавливать настройки модов, которые будут использоваться вместо параметров по умолчанию. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Переопределение настроек модов +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Позволяет установить настройки модов, переопределяющие параметры по умолчанию. Значение ноль в любом пункте отключит возможность загрузки чанков для этого мода. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Новое переопределение +forge.configgui.ctgy.VersionCheckConfig=Проверьте параметры версии + +forge.configgui.biomeSkyBlendRange.tooltip=Контролирует диапазон размытия цветного неба в биомах. +forge.configgui.biomeSkyBlendRange=Диапазон смешивания цветов неба +forge.configgui.clumpingThreshold.tooltip=Контролирует порог предпочтения пакета 51 перед пакетом 52. +forge.configgui.clumpingThreshold=Порог объединения пакетов +forge.configgui.disableVersionCheck.tooltip=Отметьте для отключения проверки версии Forge. Forge запрашивает маленький json файл с нашего сервера для получения информации о версии. Подробности можно найти в классе ForgeVersion на странице проекта на GitHub. +forge.configgui.disableVersionCheck=Отключить проверку обновлений Forge +forge.configgui.enableGlobalConfig=Включить глобальные настройки +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Отметьте это для принудительного выхода при попытки связать один тип жидкости с более чем одним блоком. +forge.configgui.forceDuplicateFluidBlockCrash=Принудительный выход при дубликатах блоков жидкости +forge.configgui.fullBoundingBoxLadders.tooltip=Установите значение true для полной проверки столкновений сущностей с лестницами вместо простой проверки на их нахождение в блоке. Вызывает значительные изменения в механике. +forge.configgui.fullBoundingBoxLadders=Полные области соприкосновения у лестниц +forge.configgui.removeErroringEntities.tooltip=Отметьте это для удаления любой сущности из мира, вызывающей ошибку, вместо полной остановки сервера. БУДЬТЕ ОСТОРОЖНЫ, ЭТО МОЖЕТ СЛОМАТЬ ВСЁ\! ИСПОЛЬЗУЙТЕ С УМОМ. МЫ НЕ НЕСЁМ ОТВЕТСТВЕННОСТИ ЗА УЩЕРБ. +forge.configgui.removeErroringEntities=Удаление сбойных сущностей +forge.configgui.removeErroringTileEntities.tooltip=Отметьте это для удаления любого блока из мира, вызывающего ошибку, вместо полной остановки сервера. БУДЬТЕ ОСТОРОЖНЫ, ЭТО МОЖЕТ СЛОМАТЬ ВСЁ\! ИСПОЛЬЗУЙТЕ С УМОМ. МЫ НЕ НЕСЁМ ОТВЕТСТВЕННОСТИ ЗА УЩЕРБ. +forge.configgui.removeErroringTileEntities=Удаление сбойных блоков +forge.configgui.sortRecipies.tooltip=Отметьте для включения сортировки рецептов крафта в фазе пост-инициализации. Может вызвать десинхронизацию у конфликтующих рецептов. НЕОБХОДИМО ПЕРЕЗАПУСТИТЬ MINECRAFT ЕСЛИ ЭТО БЫЛО ИЗМЕНЕНО ИЗ ИНТЕРФЕЙСА. +forge.configgui.sortRecipies=Отсортировать рецепты +forge.configgui.zombieBabyChance.tooltip=Шанс спавна ребёнка у зомби (или одного из его подкласса). Позволяет изменить механизм спавна зомби. +forge.configgui.zombieBabyChance=Шанс зомби-ребёнка +forge.configgui.zombieBaseSummonChance.tooltip=Базовый шанс спавна зомби. Позволяет изменить механику бонусного шанса при спавне зомби. +forge.configgui.zombieBaseSummonChance=Шанс спавна зомби +forge.configgui.stencilbits=Включить GL Stencil Bits +forge.configgui.spawnfuzz=Диаметр защиты точки респауна + +forge.configgui.modID.tooltip=ID мода, настройки которого Вы хотите переопределить. +forge.configgui.modID=ID мода +forge.configgui.dormantChunkCacheSize.tooltip=Выгруженные чанки могут быть помещены в кеш для ускорения будущих загрузок. Укажите размер (в чанках) для этого кеша. +forge.configgui.dormantChunkCacheSize=Размер кеша "спящих" чанков +forge.configgui.enableModOverrides.tooltip=Отметьте это для возможности определения настроек для модов в отдельности. +forge.configgui.enableModOverrides=Включить переопределение настроек модов +forge.configgui.maximumChunksPerTicket.tooltip=Максимальное количество чанков на один запрос, которые будут загружены по запросу модов. +forge.configgui.maximumChunksPerTicket=Лимит чанков на один запрос +forge.configgui.maximumTicketCount.tooltip=Количество запросов на поддержание чанков в загруженом состоянии, которое будет дозволен запросить мод. +forge.configgui.maximumTicketCount=Лимит запросов для мода +forge.configgui.playerTicketCount.tooltip=Количество запросов, которые будут присвоены игроку вместо мода. Этот лимит разделяется между всеми модами. +forge.configgui.playerTicketCount=Лимит запросов на игрока + +fml.config.sample.basicDouble.tooltip=Двойная собственность без каких-либо определенных границ. +fml.config.sample.basicDouble=Неограниченный Двойной +fml.config.sample.basicInteger.tooltip=Целочисленное свойство, без каких-либо определенных границ. +fml.config.sample.basicInteger=Безграничное Целое Число +fml.config.sample.basicString.tooltip=Основное свойство строки. Пользователь может ввести что-нибудь в этом текстовом поле. +fml.config.sample.basicString=Основная Строка +fml.config.sample.booleanList.tooltip=Логическое список нет макс. длины и может быть удлинена или укорочена. +fml.config.sample.booleanList=Основной Логический Список +fml.config.sample.booleanListFixed.tooltip=Логическое список, который имеет фиксированную длину 8. +fml.config.sample.booleanListFixed=Логическое список фиксированной длины +fml.config.sample.booleanListMax.tooltip=Логическое список, который имеет макс. длину 10. +fml.config.sample.booleanListMax=Макс. Длина Логического Списка +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/sl_SI.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/sl_SI.lang new file mode 100644 index 0000000..0cc46dd --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/sl_SI.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Uporabite /forge . Subcommande so tps, track +commands.forge.usage.tracking=Uporabite /forge tracj . Veljavni so Tile Entetiji. Dolžina je <60. +commands.forge.tps.summary=%s\: Dejanski tick čas\: %d ms. Dejanski TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity sledenje vklopljeno za %d sekund. +forge.texture.preload.warning=Pozor\: Grafika %s ni naložena v naprej, to zna povzročiti render težave\! +forge.client.shutdown.internal=Izklapljam notranji strežnik... +forge.update.newversion=Nova verzija Forge je navoljo\: %s +forge.update.beta.1=%sPozor\: %sForge Beta +forge.update.beta.2=Pojavijo se lahko večje težave, preverite preden poročate. + +forge.configgui.forgeConfigTitle=Minecraft Forge Nastavitve +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Tukaj lahko urejate nastavitve, ki se nahajajo v forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Globalne nastavitve +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Tukaj lahko urejate nastavitve, ki se nahajajo v forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Prevzete Nastavitve +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Tukaj lahko urejate nastavitve specifičnih modov. Te bodo uporabljene namesto prevzetih nastavitev. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Prepis Modov +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/sr_SP.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/sr_SP.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/sr_SP.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/sv_SE.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/sv_SE.lang new file mode 100644 index 0000000..2f56c19 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/sv_SE.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Använd /forge . Kommandon är tps, track +commands.forge.usage.tracking=Använd /forge track . Godkända typer är te (Tile Entities). Varaktighet ska vara < 60. +commands.forge.tps.summary=%s \: Medel uppdateringstid\: %d ms. Medel TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity spårning aktiverad i %d sekunder. +forge.texture.preload.warning=Varning\: Textur %s förladdades inte och kommer orsaka renderingsbuggar\! +forge.client.shutdown.internal=Stänger av intern server... +forge.update.newversion=Ny Forge version är tillgänglig\: %s +forge.update.beta.1=%sVarning\: %sForge Beta +forge.update.beta.2=Stora problem kan orsakas, vänligen verifiera innan du rapporterar. + +forge.configgui.forgeConfigTitle=Minecraft Forge konfiguration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Här kan du redigera de inställningar som finns i forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Allmänna inställningar +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Här kan du redigera de inställningar som finns i forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Standardinställningar för Forge Chunk Loader +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Här kan du definiera mod-specifika inställningar som åsidosätter defaultinställningarna. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod-specifika åsidosättningar +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Här kan du definiera mod-specifika inställningar som åsidosätter defaultinställningarna. Värdet noll kommer att inaktivera chunk-loading för den modden. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Lägg till ny åsidosättning för mod +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Styr omfånget av färgblandning för färgad himmel i biomer. +forge.configgui.biomeSkyBlendRange=Färgblandning för himmel +forge.configgui.clumpingThreshold.tooltip=Styr tröskelvärdet där Packet51 är att föredra framför Packet52. +forge.configgui.clumpingThreshold=Tröskelvärde för Packet Clumping +forge.configgui.disableVersionCheck.tooltip=Sätt till sant för att inaktivera Forge's versionscheckningsmekanik där Forge frågar efter en liten json fil. För mer information se klassen ForgeVersion i våran github. +forge.configgui.disableVersionCheck=Stäng av versionskoll +forge.configgui.enableGlobalConfig=Aktivera globala inställningar +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Sätt till sant för att skapa en krasch om mer än ett block försöker länka tillbaka till samma vätska. +forge.configgui.forceDuplicateFluidBlockCrash=Forcera Krasch för Multipla Vätskeblock +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/tr_TR.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/tr_TR.lang new file mode 100644 index 0000000..5912c6c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/tr_TR.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge 'ı kullanın. Alt komutlar tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Geçersiz Kılımları +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Hata veren blok-canlıları kaldır +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombi bebek şansı +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombi çağrılma şansı +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod kimliği +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Mod geçersiz kılmaları etkinleştir +forge.configgui.maximumChunksPerTicket.tooltip=Bu tek bir biletin yapabileceği maksimum chunk değeridir. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod bilet limiti +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Oyuncu bilet limiti + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=Anladım +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Örnek metin +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Varsayılana Geri Dön +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Değişiklikleri geri al +fml.configgui.tooltip.default=[Varsayılan\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Modlar +fml.menu.mods.normal=Normal +fml.menu.mods.search=Arama\: +fml.menu.modoptions=Mod seçenekleri... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/uk_UA.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/uk_UA.lang new file mode 100644 index 0000000..a9d6778 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/uk_UA.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Використовуйте /forge <підкоманда>. Підкоманди такі як tps та track +commands.forge.usage.tracking=Використовуйте /forge track <тип> <тривалість>. Допустимі типи - TE (Tile Entities). Тривалість від < 60. +commands.forge.tps.summary=%s \: Середня тривалість тіку\: %d мс. Середнє TPS\: %d + +commands.forge.tracking.te.enabled=Відстеження Tile Entity увімкнено на %d секунд. +forge.texture.preload.warning=Застереження\: Текстура %s попередньо не завантажена, це може викликати помилки відображення\! +forge.client.shutdown.internal=Завершення роботи сервера... +forge.update.newversion=Доступна нова версія Forge\: %s +forge.update.beta.1=%sУвага\: %sForge Beta +forge.update.beta.2=Можуть виникнути серйозні проблеми. Переконайтеся у правильності ваших дій перед надсиланням звіту. + +forge.configgui.forgeConfigTitle=Конфігурації Minecraft Forge +forge.configgui.ctgy.forgeGeneralConfig.tooltip=Звідси ви можете редагувати параметри, які знаходяться у forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=Загальні налаштування +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=Звідси ви можете редагувати параметри, які знаходяться у forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Стандартні налаштування провантажувача чанків Forge +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=Звідси ви можете зробити специфічні налаштування для модів, які будуть використовуватися замість стандартних налаштувань. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Перезапис моду +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Дозволяє робити специфічні налаштування для моду, які будуть використовуватися замість стандартних налаштувань. Нульове значення вимикає всі "chunkloading" для цього моду. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Додано новий перезапис моду +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Налаштування кольору неба у біомах. +forge.configgui.biomeSkyBlendRange=Діапазон кольору неба біому +forge.configgui.clumpingThreshold.tooltip=Контроль кількості порогів, при якому Packet51 є кращим, ніж Packet52. +forge.configgui.clumpingThreshold=Поріг для пакетного злипання +forge.configgui.disableVersionCheck.tooltip=Встановіть значення "true", щоб відключити перевірку версій Forge. Forge перевіряє наявність нових версій шукаючи невеликий json файл на нашому сервері. Для більшої інформації завітайте на проект у GitHub. +forge.configgui.disableVersionCheck=Вимкнути перевірку наявності нових версія Forge +forge.configgui.enableGlobalConfig=Увімкнути глобальні конфігурації +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Встановіть значення "true", для примусової зупинки клієнту при спробі об'єднати один тип рідини з більше ніж з одним блоком. +forge.configgui.forceDuplicateFluidBlockCrash=Примусова зупинка при дублювання блоків рідини +forge.configgui.fullBoundingBoxLadders.tooltip=Встановіть значення "true", для повної перевірки зіткнень об'єктів з драбинами, замість звичайної перевірки знаходження в блоці. Викликає значні відмінності в механіці гри. +forge.configgui.fullBoundingBoxLadders=Повні області зіткнень з драбинами +forge.configgui.removeErroringEntities.tooltip=Встановіть значення "true", для видалення будь-якого об'єкта, який спричиняє помилки у світі, замість повної зупинки серверу. БУДЬТЕ ОБЕРЕЖНИМИ З ЦІЄЮ ФУНКЦІЄЮ, МИ НЕ НЕСЕМО ВІДПОВІДАЛЬНОСТІ ЗА ЗЛАМАНИЙ СЕРВЕР. +forge.configgui.removeErroringEntities=Видаляє об'єкти, які викликають помилки +forge.configgui.removeErroringTileEntities.tooltip=Встановіть значення "true", для видалення будь-якого об'єкта, який спричиняє помилки у світі, замість повної зупинки серверу. БУДЬТЕ ОБЕРЕЖНИМИ З ЦІЄЮ ФУНКЦІЄЮ, МИ НЕ НЕСЕМО ВІДПОВІДАЛЬНОСТІ ЗА ЗЛАМАНИЙ СЕРВЕР. +forge.configgui.removeErroringTileEntities=Видаляє об'єкти, які спричиняють збої +forge.configgui.sortRecipies.tooltip=Встановіть значення "true", щоб увімкнути пост-ініціалізацію сортування для сортування рецептів використовуючи Forge сортувальник. Це може викликати десинхронізацію з деякими рецептами. НЕОБХІДНО ПЕРЕЗАВАНТАЖИТИ MINECRAFT, ЯКЩО ВИ НЕ РОБИТЕ ЗМІНИ З CONFIG GUI. +forge.configgui.sortRecipies=Сортування рецептів +forge.configgui.zombieBabyChance.tooltip=Ймовірність спавну зомбі дитини (або його підкласу). Дозволяє змінювати механіку спавну зомбі. +forge.configgui.zombieBabyChance=Ймовірність спавну дитя зомбі +forge.configgui.zombieBaseSummonChance.tooltip=Ймовірність автоматичного спавну зомбі. Дозволяє редагувати механіка вторинного спавну зомбі. +forge.configgui.zombieBaseSummonChance=Ймовірність спавну зомбі +forge.configgui.stencilbits=Увімкнути GL Stencil Bits +forge.configgui.spawnfuzz=Діаметр захисту респавну + +forge.configgui.modID.tooltip=ID моду, налаштування якого ви хочете перевизначити. +forge.configgui.modID=ID моду +forge.configgui.dormantChunkCacheSize.tooltip=Вивантажені чанки можуть бути збережені у неактивному кеші для швидкого завантаження. Вкажіть розмір (у чанках) для цього кешу. +forge.configgui.dormantChunkCacheSize=Розмір кешу для бездіяльних чанків +forge.configgui.enableModOverrides.tooltip=Увімкніть цей параметр, щоб дозволити визначати налаштування моду. +forge.configgui.enableModOverrides=Увімкнути перезапис модів +forge.configgui.maximumChunksPerTicket.tooltip=Максимальна кількість чанків, які будуть завантажені по запиту моду. +forge.configgui.maximumChunksPerTicket=Ліміт чанків на один запит +forge.configgui.maximumTicketCount.tooltip=Це кількість завантажених чаків, які роблять запит на мод. +forge.configgui.maximumTicketCount=Ліміт запитів на мод +forge.configgui.playerTicketCount.tooltip=Кількість запитів, які можуть бути призначені гравцю замість моду. Налаштування є загальним для всіх модів. +forge.configgui.playerTicketCount=Ліміт запитів на гравця + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/vi_VN.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/vi_VN.lang new file mode 100644 index 0000000..410e4da --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/vi_VN.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=Use /forge . Subcommands are tps, track +commands.forge.usage.tracking=Use /forge track . Valid types are te (Tile Entities). Duration is < 60. +commands.forge.tps.summary=%s \: Mean tick time\: %d ms. Mean TPS\: %d + +commands.forge.tracking.te.enabled=Tile Entity tracking enabled for %d seconds. +forge.texture.preload.warning=Warning\: Texture %s not preloaded, will cause render glitches\! +forge.client.shutdown.internal=Shutting down internal server... +forge.update.newversion=New Forge version available\: %s +forge.update.beta.1=%sWARNING\: %sForge Beta +forge.update.beta.2=Major issues may arise, verify before reporting. + +forge.configgui.forgeConfigTitle=Minecraft Forge Configuration +forge.configgui.ctgy.forgeGeneralConfig.tooltip=This is where you can edit the settings contained in forge.cfg. +forge.configgui.ctgy.forgeGeneralConfig=General Settings +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=This is where you can edit the settings contained in forgeChunkLoading.cfg. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge Chunk Loader Default Settings +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=This is where you can define mod-specific override settings that will be used instead of the defaults. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod Overrides +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=Allows you to define mod-specific settings that will override the defaults. A value of zero in either entry effectively disables any chunkloading capabilities for that mod. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=Sort Recipes +forge.configgui.zombieBabyChance.tooltip=Chance that a zombie (or subclass) is a baby. Allows changing the zombie spawning mechanic. +forge.configgui.zombieBabyChance=Zombie Baby Chance +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=Zombie Summon Chance +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=Enable this setting to allow custom per-mod settings to be defined. +forge.configgui.enableModOverrides=Enable Mod Overrides +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=Chunks Per Ticket Limit +forge.configgui.maximumTicketCount.tooltip=This is the number of chunk loading requests a mod is allowed to make. +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/zh_CN.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/zh_CN.lang new file mode 100644 index 0000000..f1aa1b0 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/zh_CN.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=/forge <子指令>. 用法说明\: 子指令有tps, track +commands.forge.usage.tracking=/forge track <类型> <持续时间>. 用法说明\: 有效类型有te (方块实体).有效持续时间要小于60. +commands.forge.tps.summary=%s \: 平均游戏刻耗时\: %d ms. 平均TPS\: %d + +commands.forge.tracking.te.enabled=实体附加值追踪已启用了 %d 秒. +forge.texture.preload.warning=警告\: %s 材质未被预加载, 将会导致渲染错误\! +forge.client.shutdown.internal=正在关闭内置服务端... +forge.update.newversion=新的Forge版本已可用\: %s +forge.update.beta.1=%s警告\: %sForge为Beta版 +forge.update.beta.2=可能会出现重要问题, 请在报告前进行确认. + +forge.configgui.forgeConfigTitle=Minecraft Forge配置 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=你可以在此编辑forge.cfg里的设置. +forge.configgui.ctgy.forgeGeneralConfig=通用设置 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=你可以在此编辑forgeChunkLoading.cfg里的设置. +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge区块加载器默认设置 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=在这里你可以自定义会被优先采用的指定Mod的设置项以替代默认值. +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod设置项覆盖 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=允许你自定义指定Mod中将会覆盖默认值的设置. 两项中任意一项取值为0会有效地禁用有关那个Mod的任何可能的区块加载. +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ 添加新的Mod设置项覆盖 +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=控制不同生物群系中已着色天空之间的天空混色取值范围. +forge.configgui.biomeSkyBlendRange=生物群系天空混色取值范围 +forge.configgui.clumpingThreshold.tooltip=控制使Packet51优先于Packet52被选择的数字临界值. +forge.configgui.clumpingThreshold=Packet成簇临界值 +forge.configgui.disableVersionCheck.tooltip=设置为true会禁用Forge版本检测机制. Forge会在我们的服务器上对比查询一个比较小的json文件以获取版本信息. 想获取更多细节请参见在我们GitHub上的ForgeVersion类. +forge.configgui.disableVersionCheck=禁用Forge版本检测 +forge.configgui.enableGlobalConfig=启用全局配置 +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=将该项设为true会在多于一个方块试图链接到同一流体时强制崩溃. +forge.configgui.forceDuplicateFluidBlockCrash=复制流体方块时强制崩溃 +forge.configgui.fullBoundingBoxLadders.tooltip=设置该项为true会检测整个实体是否碰到了梯子,而不仅仅是检测它们在梯子方块内. 会在机制上导致显著差别所以默认值为Minecraft原生行为. +forge.configgui.fullBoundingBoxLadders=对梯子的完全碰撞箱 +forge.configgui.removeErroringEntities.tooltip=设置该项为true时, 如果某个实体在更新时产生了错误, 它将会被移除, 而不是关闭服务端并记录一个崩溃日志. §o小心, 这可能会产生很严重的后果. 请谨慎使用, 我们不会对任何损失负责.§r§e +forge.configgui.removeErroringEntities=移除出现错误的实体 +forge.configgui.removeErroringTileEntities.tooltip=设置该项为true时, 如果某个方块实体在更新时产生了错误, 它将会被移除, 而不是关闭服务端并记录一个崩溃日志. §o小心, 这可能会产生很严重的后果. 请谨慎使用, 我们不会对任何损失负责.§r§e +forge.configgui.removeErroringTileEntities=移除出现错误的方块实体 +forge.configgui.sortRecipies.tooltip=设置为true会启用使用了Forge整理器的后初始化合成表整理. 可能会在冲突的合成表上造成不同步. §o如果是在Config GUI进行的更改那么必须重启Minecraft.§r§e +forge.configgui.sortRecipies=整理合成表 +forge.configgui.zombieBabyChance.tooltip=幼年僵尸在所有僵尸(包括僵尸的子类)中的出现概率. 更改此项可以修改僵尸生成机制. +forge.configgui.zombieBabyChance=幼年僵尸概率 +forge.configgui.zombieBaseSummonChance.tooltip=僵尸召唤的基础生成概率. 更改此项可以更改额外生成僵尸的机制. +forge.configgui.zombieBaseSummonChance=僵尸召唤概率 +forge.configgui.stencilbits=启用GL模版位元 +forge.configgui.spawnfuzz=重生点范围模糊半径 + +forge.configgui.modID.tooltip=你想要为其定义设置项覆盖的Mod的ID. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=未加载区块会被首先保留在一个未被使用的缓存内以使加载耗时更短. 请在这里明确其大小(单位为区块数). +forge.configgui.dormantChunkCacheSize=休眠区块缓存大小 +forge.configgui.enableModOverrides.tooltip=启用该项设置会允许自定义为每个Mod单独配置的设置. +forge.configgui.enableModOverrides=启用Mod设置项覆盖 +forge.configgui.maximumChunksPerTicket.tooltip=该项为单独一个标签可以影响的最大区块数目. +forge.configgui.maximumChunksPerTicket=每个标签内的区块数限制 +forge.configgui.maximumTicketCount.tooltip=该项为一个Mod的区块加载请求能够被允许提出的最大数量. +forge.configgui.maximumTicketCount=Mod标签数量限制 +forge.configgui.playerTicketCount.tooltip=可以分配给一个玩家而不是一个Mod的最大标签数量. 该项对所有Mod共享, 由使用它的Mod的不同而确定. +forge.configgui.playerTicketCount=玩家标签数量限制 + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/forge/lang/zh_TW.lang b/build/rfg/minecraft-src/resources/assets/forge/lang/zh_TW.lang new file mode 100644 index 0000000..7509e30 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/forge/lang/zh_TW.lang @@ -0,0 +1,149 @@ +#X-Generator: crowdin.com +commands.forge.usage=使用 /forge 。subcommand 為 tps 和 track +commands.forge.usage.tracking=使用 /forge track 。有效的 type 為 te (實體附加值)。duration 小於 60。 +commands.forge.tps.summary=%s:平均一刻時間:%d ms。平均每秒刻數:%d + +commands.forge.tracking.te.enabled=已開啟實體附加值追蹤 %d 秒。 +forge.texture.preload.warning=警告:材質 %s 未被預載,可能會導致畫面異常! +forge.client.shutdown.internal=正在停止內部伺服器… +forge.update.newversion=已有新的Forge版本:%s +forge.update.beta.1=%s警告:%sForge為Beta版 +forge.update.beta.2=可能會出現重要問題,請在報告前進行確認。 + +forge.configgui.forgeConfigTitle=Minecraft Forge 設定 +forge.configgui.ctgy.forgeGeneralConfig.tooltip=你可以在此編輯forge.cfg內的設定 +forge.configgui.ctgy.forgeGeneralConfig=通用設定 +forge.configgui.ctgy.forgeChunkLoadingConfig.tooltip=你可以在此編輯forgeChunkLoading.cfg內的設定。 +forge.configgui.ctgy.forgeChunkLoadingConfig=Forge資料塊載入器預設設定 +forge.configgui.ctgy.forgeChunkLoadingModConfig.tooltip=在此你可以針對個別Mod定義覆蓋預設值的設定。 +forge.configgui.ctgy.forgeChunkLoadingModConfig=Mod設定覆蓋 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig.tooltip=允許你定義可覆蓋Mod預設值的設定。任何值為零的設定將禁止該mod載入資料塊。 +forge.configgui.ctgy.forgeChunkLoadingAddModConfig=+ Add New Mod Override +forge.configgui.ctgy.VersionCheckConfig=Version Check Settings + +forge.configgui.biomeSkyBlendRange.tooltip=Control the range of sky blending for colored skies in biomes. +forge.configgui.biomeSkyBlendRange=Biome Sky Blend Range +forge.configgui.clumpingThreshold.tooltip=Controls the number threshold at which Packet51 is preferred over Packet52. +forge.configgui.clumpingThreshold=Packet Clumping Threshold +forge.configgui.disableVersionCheck.tooltip=Set to true to disable Forge's version check mechanics. Forge queries a small json file on our server for version information. For more details see the ForgeVersion class in our github. +forge.configgui.disableVersionCheck=Disable Forge Version Check +forge.configgui.enableGlobalConfig=Enable Global Config +forge.configgui.forceDuplicateFluidBlockCrash.tooltip=Set this to true to force a crash if more than one block attempts to link back to the same Fluid. +forge.configgui.forceDuplicateFluidBlockCrash=Force Dupe Fluid Block Crash +forge.configgui.fullBoundingBoxLadders.tooltip=Set this to true to check the entire entity's collision bounding box for ladders instead of just the block they are in. Causes noticeable differences in mechanics so default is vanilla behavior. +forge.configgui.fullBoundingBoxLadders=Full Bounding Box Ladders +forge.configgui.removeErroringEntities.tooltip=Set this to true to remove any Entity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringEntities=Remove Erroring Entities +forge.configgui.removeErroringTileEntities.tooltip=Set this to true to remove any TileEntity that throws an error in its update method instead of closing the server and reporting a crash log. BE WARNED THIS COULD SCREW UP EVERYTHING USE SPARINGLY WE ARE NOT RESPONSIBLE FOR DAMAGES. +forge.configgui.removeErroringTileEntities=Remove Erroring Tile Entities +forge.configgui.sortRecipies.tooltip=Set to true to enable the post initialization sorting of crafting recipes using Forge's sorter. May cause desyncing on conflicting recipies. MUST RESTART MINECRAFT IF CHANGED FROM THE CONFIG GUI. +forge.configgui.sortRecipies=排序合成公式 +forge.configgui.zombieBabyChance.tooltip=殭屍(與衍生怪)是小殭屍的機率。 能更改殭屍出現的機制。 +forge.configgui.zombieBabyChance=招喚小殭屍機率 +forge.configgui.zombieBaseSummonChance.tooltip=Base zombie summoning spawn chance. Allows changing the bonus zombie summoning mechanic. +forge.configgui.zombieBaseSummonChance=招喚殭屍機率 +forge.configgui.stencilbits=Enable GL Stencil Bits +forge.configgui.spawnfuzz=Respawn Fuzz Diameter + +forge.configgui.modID.tooltip=The mod ID that you want to define override settings for. +forge.configgui.modID=Mod ID +forge.configgui.dormantChunkCacheSize.tooltip=Unloaded chunks can first be kept in a dormant cache for quicker loading times. Specify the size (in chunks) of that cache here. +forge.configgui.dormantChunkCacheSize=Dormant Chunk Cache Size +forge.configgui.enableModOverrides.tooltip=啟用這個選項能讓你定義個別mod的設定。 +forge.configgui.enableModOverrides=啟用Mod設定覆蓋 +forge.configgui.maximumChunksPerTicket.tooltip=This is the maximum number of chunks a single ticket can force. +forge.configgui.maximumChunksPerTicket=每刻資料塊數上限 +forge.configgui.maximumTicketCount.tooltip=這是每個 mod 每刻最多可以要求多少個資料塊載入。 +forge.configgui.maximumTicketCount=Mod Ticket Limit +forge.configgui.playerTicketCount.tooltip=The number of tickets a player can be assigned instead of a mod. This is shared across all mods and it is up to the mods to use it. +forge.configgui.playerTicketCount=Player Ticket Limit + +fml.config.sample.basicDouble.tooltip=A double property with no defined bounds. +fml.config.sample.basicDouble=Unbounded Double +fml.config.sample.basicInteger.tooltip=An integer property with no defined bounds. +fml.config.sample.basicInteger=Unbounded Integer +fml.config.sample.basicString.tooltip=A basic string property. The user can enter anything in this textbox. +fml.config.sample.basicString=Basic String +fml.config.sample.booleanList.tooltip=A boolean list with no max length and can be lengthened or shortened. +fml.config.sample.booleanList=Basic Boolean List +fml.config.sample.booleanListFixed.tooltip=A boolean list that has a fixed length of 8. +fml.config.sample.booleanListFixed=Fixed Length Boolean List +fml.config.sample.booleanListMax.tooltip=A boolean list that has a max length of 10. +fml.config.sample.booleanListMax=Max Length Boolean List +fml.config.sample.boundedDouble.tooltip=A double property with defined bounds. +fml.config.sample.boundedDouble=Bounded Double +fml.config.sample.boundedInteger.tooltip=An integer property with defined bounds. +fml.config.sample.boundedInteger=Bounded Integer +fml.config.sample.chatColorPicker.tooltip=A special property that allows the user to select a font color code. +fml.config.sample.chatColorPicker=Chat Color Picker +fml.config.sample.ctgy.lists.tooltip=Provides a variety of array-property controls to play with. +fml.config.sample.ctgy.lists=Sample Array Controls +fml.config.sample.ctgy.numbers.tooltip=Provides a listing of the numeric controls for toying with. +fml.config.sample.ctgy.numbers=Sample Numeric Controls +fml.config.sample.ctgy.strings.tooltip=Provides a listing of the different String-type controls to play with. +fml.config.sample.ctgy.strings=Sample String Controls +fml.config.sample.cycleString.tooltip=A string property that has a defined list of valid values that can be cycled through. +fml.config.sample.cycleString=Cycle Value String +fml.config.sample.doubleList.tooltip=A double list with no max length and can be lengthened or shortened. +fml.config.sample.doubleList=Basic Double List +fml.config.sample.doubleListBounded.tooltip=A double list with specific value bounds. +fml.config.sample.doubleListBounded=Double List with Value Bounds +fml.config.sample.doubleListFixed.tooltip=A double list that has a fixed length of 10. +fml.config.sample.doubleListFixed=Fixed Length Double List +fml.config.sample.doubleListMax.tooltip=A double list that has a max length of 15. +fml.config.sample.doubleListMax=Max Length Double List +fml.config.sample.imABoolean.tooltip=Yep, that's pretty much it... I'm a Boolean control. +fml.config.sample.imABoolean=I'm a Boolean +fml.config.sample.imADouble.tooltip=There are two of me. Or maybe I work for both the CIA and the KGB. Not sure. +fml.config.sample.imADouble=I'm a Double +fml.config.sample.imAString.tooltip=Aah. Now, I understand you want us to advertise your washing powder. \n<*String.*> \nString, washing powder, what's the difference? We can sell anything. \n<*Good. Well I have this large quantity of string, 122,000 miles of it to be exact, which I inherited, and I thought if I advertised it...*> \nOf course\! A national campaign. Useful stuff, string, no trouble there. \n<*Ah, but there's a snag, you see. Due to bad planning, the 122,000 miles is in three inch lengths. So it's not very useful.*> \nWell, that's our selling point\! SIMPSON'S INDIVIDUAL STRINGETTES\! THE NOW STRING\! READY CUT, EASY TO HANDLE, SIMPSON'S INDIVIDUAL EMPEROR STRINGETTES - JUST THE RIGHT LENGTH\! +fml.config.sample.imAString=I'm a String +fml.config.sample.imAnInteger.tooltip=Did I say that I'm an Integer? Oh, I see. +fml.config.sample.imAnInteger=I'm an Integer +fml.config.sample.integerList.tooltip=An integer list with no max length and can be lengthened or shortened. +fml.config.sample.integerList=Basic Integer List +fml.config.sample.integerListBounded.tooltip=An integer list with specific value bounds. +fml.config.sample.integerListBounded=Integer List with Value Bounds +fml.config.sample.integerListFixed.tooltip=An integer list that has a fixed length of 10. +fml.config.sample.integerListFixed=Fixed Length Integer List +fml.config.sample.integerListMax.tooltip=An integer list that has a max length of 15. +fml.config.sample.integerListMax=Max Length Integer List +fml.config.sample.modIDSelector.tooltip=A special property that allows the user to select a mod ID from a list of all installed mods. There are many possibilities for how this could be used with a little custom code\: selecting biomes, selecting entities, selecting items, selecting blocks, etc. +fml.config.sample.modIDSelector=Mod ID Selector +fml.config.sample.patternString.tooltip=A string property that is validated using a Pattern object. +fml.config.sample.patternString=Pattern Validated String +fml.config.sample.sliderDouble.tooltip=A double property with defined bounds using a slider control. +fml.config.sample.sliderDouble=Slider Double +fml.config.sample.sliderInteger.tooltip=An integer property with defined bounds using a slider control. +fml.config.sample.sliderInteger=Slider Integer +fml.config.sample.stringList.tooltip=A basic string list with no validation. +fml.config.sample.stringList=Basic String List +fml.config.sample.stringListFixed.tooltip=A string list that has a fixed length of 7. +fml.config.sample.stringListFixed=Fixed Length String List +fml.config.sample.stringListMax.tooltip=A string list that has a max length of 15. +fml.config.sample.stringListMax=Max Length String List +fml.config.sample.stringListPattern.tooltip=A string list that validates each value using a Pattern object. +fml.config.sample.stringListPattern=Pattern Validated String List +fml.config.sample.title=This is for playing with the Config GUI behavior. Changes are not saved. + +fml.configgui.applyGlobally=Apply globally +fml.configgui.confirmRestartMessage=I Understand +fml.configgui.gameRestartRequired=One or more changed settings requires that Minecraft be restarted before taking effect. +fml.configgui.gameRestartTitle=Minecraft Restart Required +fml.configgui.sampletext=Sample Text +fml.configgui.tooltip.addNewEntryAbove=Add New Entry Above +fml.configgui.tooltip.applyGlobally=Apply Undo Changes or Reset to Default globally. +fml.configgui.tooltip.removeEntry=Remove Entry +fml.configgui.tooltip.resetAll=Reset All to Default. If the Apply globally checkbox is checked values on child screens will also be reset. +fml.configgui.tooltip.resetToDefault=Reset to Default +fml.configgui.tooltip.undoAll=Undo All Changes. If the Apply globally checkbox is checked changes to child screens will also be undone. +fml.configgui.tooltip.undoChanges=Undo Changes +fml.configgui.tooltip.default=[default\: %s] +fml.configgui.tooltip.defaultNumeric=[range\: %s ~ %s, default\: %s] + +fml.menu.mods=Mods +fml.menu.mods.normal=Normal +fml.menu.mods.search=Search\: +fml.menu.modoptions=Mod Options... + + diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/font/glyph_sizes.bin b/build/rfg/minecraft-src/resources/assets/minecraft/font/glyph_sizes.bin new file mode 100644 index 0000000..69c857e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/font/glyph_sizes.bin differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/lang/en_US.lang b/build/rfg/minecraft-src/resources/assets/minecraft/lang/en_US.lang new file mode 100644 index 0000000..628a2a6 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/lang/en_US.lang @@ -0,0 +1,1692 @@ + +language.name=English +language.region=US +language.code=en_US + +gui.done=Done +gui.cancel=Cancel +gui.back=Back +gui.toMenu=Back to title screen +gui.up=Up +gui.down=Down +gui.yes=Yes +gui.no=No + +translation.test.none=Hello, world! +translation.test.complex=Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again! +translation.test.escape=%%s %%%s %%%%s %%%%%s +translation.test.invalid=hi % +translation.test.invalid2=hi % s +translation.test.args=%s %s +translation.test.world=world + +menu.game=Game menu +menu.singleplayer=Singleplayer +menu.multiplayer=Multiplayer +menu.online=Minecraft Realms +menu.options=Options... +menu.quit=Quit Game +menu.returnToMenu=Save and Quit to Title +menu.disconnect=Disconnect +menu.returnToGame=Back to Game +menu.switchingLevel=Switching worlds +menu.generatingLevel=Generating world +menu.loadingLevel=Loading world +menu.generatingTerrain=Building terrain +menu.convertingLevel=Converting world +menu.simulating=Simulating the world for a bit +menu.respawning=Respawning +menu.shareToLan=Open to LAN + +selectWorld.title=Select World +selectWorld.empty=empty +selectWorld.world=World +selectWorld.select=Play Selected World +selectWorld.create=Create New World +selectWorld.recreate=Re-Create +selectWorld.createDemo=Play New Demo World +selectWorld.delete=Delete +selectWorld.rename=Rename +selectWorld.deleteQuestion=Are you sure you want to delete this world? +selectWorld.deleteWarning=will be lost forever! (A long time!) +selectWorld.deleteButton=Delete +selectWorld.renameButton=Rename +selectWorld.renameTitle=Rename World +selectWorld.conversion=Must be converted! +selectWorld.newWorld=New World +selectWorld.newWorld.copyOf=Copy of %s +selectWorld.enterName=World Name +selectWorld.resultFolder=Will be saved in: +selectWorld.enterSeed=Seed for the World Generator +selectWorld.seedInfo=Leave blank for a random seed +selectWorld.cheats=Cheats +selectWorld.customizeType=Customize + +createWorld.customize.presets=Presets +createWorld.customize.presets.title=Select a Preset +createWorld.customize.presets.select=Use Preset +createWorld.customize.presets.share=Want to share your preset with someone? Use the below box! +createWorld.customize.presets.list=Alternatively, here's some we made earlier! +createWorld.customize.flat.title=Superflat Customization +createWorld.customize.flat.tile=Layer Material +createWorld.customize.flat.height=Height +createWorld.customize.flat.addLayer=Add Layer +createWorld.customize.flat.editLayer=Edit Layer +createWorld.customize.flat.removeLayer=Remove Layer +createWorld.customize.flat.layer.top=Top - %d +createWorld.customize.flat.layer=%d +createWorld.customize.flat.layer.bottom=Bottom - %d + +gameMode.survival=Survival Mode +gameMode.creative=Creative Mode +gameMode.adventure=Adventure Mode +gameMode.hardcore=Hardcore Mode! +gameMode.changed=Your game mode has been updated + +selectWorld.gameMode=Game Mode +selectWorld.gameMode.survival=Survival +selectWorld.gameMode.survival.line1=Search for resources, crafting, gain +selectWorld.gameMode.survival.line2=levels, health and hunger +selectWorld.gameMode.creative=Creative +selectWorld.gameMode.creative.line1=Unlimited resources, free flying and +selectWorld.gameMode.creative.line2=destroy blocks instantly +selectWorld.gameMode.hardcore=Hardcore +selectWorld.gameMode.hardcore.line1=Same as survival mode, locked at hardest +selectWorld.gameMode.hardcore.line2=difficulty, and one life only +selectWorld.gameMode.adventure=Adventure +selectWorld.gameMode.adventure.line1=Same as survival mode, but blocks can't +selectWorld.gameMode.adventure.line2=be added or removed +selectWorld.moreWorldOptions=More World Options... +selectWorld.mapFeatures=Generate Structures: +selectWorld.mapFeatures.info=Villages, dungeons etc +selectWorld.mapType=World Type: +selectWorld.mapType.normal=Normal +selectWorld.allowCommands=Allow Cheats: +selectWorld.allowCommands.info=Commands like /gamemode, /xp +selectWorld.hardcoreMode=Hardcore: +selectWorld.hardcoreMode.info=World is deleted upon death +selectWorld.bonusItems=Bonus Chest: + +generator.default=Default +generator.flat=Superflat +generator.largeBiomes=Large Biomes +generator.amplified=Amplified + +generator.amplified.info=Notice: Just for fun, requires beefy computer + +selectServer.title=Select Server +selectServer.empty=empty +selectServer.select=Join Server +selectServer.direct=Direct Connect +selectServer.edit=Edit +selectServer.delete=Delete +selectServer.add=Add server +selectServer.defaultName=Minecraft Server +selectServer.deleteQuestion=Are you sure you want to remove this server? +selectServer.deleteWarning=will be lost forever! (A long time!) +selectServer.deleteButton=Delete +selectServer.refresh=Refresh +selectServer.hiddenAddress=(Hidden) +addServer.title=Edit Server Info +addServer.enterName=Server Name +addServer.enterIp=Server Address +addServer.add=Done +addServer.hideAddress=Hide Address +addServer.resourcePack=Server Resource Packs +addServer.resourcePack.enabled=Enabled +addServer.resourcePack.disabled=Disabled +addServer.resourcePack.prompt=Prompt +lanServer.title=LAN World +lanServer.scanning=Scanning for games on your local network +lanServer.start=Start LAN World +lanServer.otherPlayers=Settings for Other Players +mcoServer.title=Minecraft Online World + +multiplayer.title=Play Multiplayer +multiplayer.connect=Connect +multiplayer.info1=Minecraft Multiplayer is currently not finished, but there +multiplayer.info2=is some buggy early testing going on. +multiplayer.ipinfo=Enter the IP of a server to connect to it: +multiplayer.texturePrompt.line1=This server recommends the use of a custom resource pack. +multiplayer.texturePrompt.line2=Would you like to download and install it automagically? +multiplayer.downloadingTerrain=Downloading terrain +multiplayer.downloadingStats=Downloading statistics & achievements... +multiplayer.stopSleeping=Leave Bed +multiplayer.player.joined=%s joined the game +multiplayer.player.joined.renamed=%s (formerly known as %s) joined the game +multiplayer.player.left=%s left the game + +chat.cannotSend=Cannot send chat message +chat.type.text=<%s> %s +chat.type.emote=* %s %s +chat.type.announcement=[%s] %s +chat.type.admin=[%s: %s] +chat.type.achievement=%s has just earned the achievement %s +chat.link.confirm=Are you sure you want to open the following website? +chat.link.warning=Never open links from people that you don't trust! +chat.copy=Copy to Clipboard +chat.link.confirmTrusted=Do you want to open this link or copy it to your clipboard? +chat.link.open=Open in browser + +chat.stream.text=(%s) <%s> %s +chat.stream.emote=(%s) * %s %s + +menu.playdemo=Play Demo World +menu.resetdemo=Reset Demo World + +demo.day.1=This demo will last five game days, do your best! +demo.day.2=Day Two +demo.day.3=Day Three +demo.day.4=Day Four +demo.day.5=This is your last day! +demo.day.warning=Your time is almost up! +demo.day.6=You have passed your fifth day, use F2 to save a screenshot of your creation +demo.reminder=The demo time has expired, buy the game to continue or start a new world! +demo.remainingTime=Remaining time: %s +demo.demoExpired=Demo time's up! +demo.help.movement=Use %1$s, %2$s, %3$s, %4$s and the mouse to move around +demo.help.movementShort=Move by pressing %1$s, %2$s, %3$s, %4$s +demo.help.movementMouse=Look around using the mouse +demo.help.jump=Jump by pressing %1$s +demo.help.inventory=Use %1$s to open your inventory +demo.help.title=Minecraft Demo Mode +demo.help.fullWrapped=This demo will last 5 ingame days (about 1 hour and 40 minutes of real time). Check the achievements for hints! Have fun! +demo.help.buy=Purchase Now! +demo.help.later=Continue Playing! + +connect.connecting=Connecting to the server... +connect.authorizing=Logging in... +connect.failed=Failed to connect to the server + +disconnect.genericReason=%s +disconnect.disconnected=Disconnected by Server +disconnect.lost=Connection Lost +disconnect.kicked=Was kicked from the game +disconnect.timeout=Timed out +disconnect.closed=Connection closed +disconnect.loginFailed=Failed to login +disconnect.loginFailedInfo=Failed to login: %s +disconnect.loginFailedInfo.serversUnavailable=The authentication are currently down for maintenance. +disconnect.loginFailedInfo.invalidSession=Invalid session (Try restarting your game) +disconnect.quitting=Quitting +disconnect.endOfStream=End of stream +disconnect.overflow=Buffer overflow +disconnect.spam=Kicked for spamming + +soundCategory.master=Master Volume +soundCategory.music=Music +soundCategory.record=Jukebox/Noteblocks +soundCategory.weather=Weather +soundCategory.hostile=Hostile Creatures +soundCategory.neutral=Friendly Creatures +soundCategory.player=Players +soundCategory.block=Blocks +soundCategory.ambient=Ambient/Environment + +record.nowPlaying=Now playing: %s + +options.off=OFF +options.on=ON +options.visible=Shown +options.hidden=Hidden +options.title=Options +options.controls=Controls... +options.video=Video Settings... +options.language=Language... +options.stream=Broadcast Settings... +options.sounds=Music & Sounds... +options.sounds.title=Music & Sound Options +options.languageWarning=Language translations may not be 100%% accurate +options.videoTitle=Video Settings +options.music=Music +options.sound=Sound +options.invertMouse=Invert Mouse +options.fov=FOV +options.fov.min=Normal +options.fov.max=Quake Pro +options.saturation=Saturation +options.gamma=Brightness +options.gamma.min=Moody +options.gamma.max=Bright +options.sensitivity=Sensitivity +options.sensitivity.min=*yawn* +options.sensitivity.max=HYPERSPEED!!! +options.renderDistance=Render Distance +options.renderDistance.tiny=Tiny +options.renderDistance.short=Short +options.renderDistance.normal=Normal +options.renderDistance.far=Far +options.viewBobbing=View Bobbing +options.ao=Smooth Lighting +options.ao.off=OFF +options.ao.min=Minimum +options.ao.max=Maximum +options.anaglyph=3D Anaglyph +options.framerateLimit=Max Framerate +options.framerateLimit.max=Unlimited +options.difficulty=Difficulty +options.difficulty.peaceful=Peaceful +options.difficulty.easy=Easy +options.difficulty.normal=Normal +options.difficulty.hard=Hard +options.difficulty.hardcore=Hardcore +options.graphics=Graphics +options.graphics.fancy=Fancy +options.graphics.fast=Fast +options.guiScale=GUI Scale +options.guiScale.auto=Auto +options.guiScale.small=Small +options.guiScale.normal=Normal +options.guiScale.large=Large +options.advancedOpengl=Advanced OpenGL +options.fboEnable=Enable FBOs +options.postProcessEnable=Enable Post-Processing +options.aoDesc0=Enable faux ambient occlusion on blocks. +options.aoDesc1= +options.framerateLimitDesc0=Selects the maximum frame rate: +options.framerateLimitDesc1=35fps, 120fps, or 200+fps. +options.viewBobbingDesc0=Enables view-bob when moving. +options.viewBobbingDesc1= +options.renderCloudsDesc0=Enables the rendering of clouds. +options.renderCloudsDesc1= +options.graphicsDesc0='Fancy': Enables extra transparency. +options.graphicsDesc1='Fast': Suggested for lower-end hardware. +options.renderDistanceDesc0=Maximum render distance. Smaller values +options.renderDistanceDesc1=run better on lower-end hardware. +options.particlesDesc0=Selects the overall amount of particles. +options.particlesDesc1=On lower-end hardware, less is better. +options.advancedOpenglDesc0=Enables occlusion queries. On AMD and Intel +options.advancedOpenglDesc1=hardware, this may decrease performance. +options.fboEnableDesc0=Enables the use of Framebuffer Objects. +options.fboEnableDesc1=Necessary for certain Minecraft features. +options.postProcessEnableDesc0=Enables post-processing. Disabling will +options.postProcessEnableDesc1=result in reduction in Awesome Levels. +options.renderClouds=Clouds +options.qualityButton=Video Quality Settings... +options.qualityVideoTitle=Video Quality Settings +options.performanceButton=Video Performance Settings... +options.performanceVideoTitle=Video Performance Settings +options.advancedButton=Advanced Video Settings... +options.advancedVideoTitle=Advanced Video Settings +options.postButton=Post-Processing Settings... +options.postVideoTitle=Post-Processing Settings +options.farWarning1=A 64 bit Java installation is recommended +options.farWarning2=for 'Far' render distance (you have 32 bit) +options.particles=Particles +options.particles.all=All +options.particles.decreased=Decreased +options.particles.minimal=Minimal +options.multiplayer.title=Multiplayer Settings... +options.chat.title=Chat Settings... +options.chat.visibility=Chat +options.chat.visibility.full=Shown +options.chat.visibility.system=Commands Only +options.chat.visibility.hidden=Hidden +options.chat.color=Colors +options.chat.opacity=Opacity +options.chat.links=Web Links +options.chat.links.prompt=Prompt on Links +options.chat.scale=Scale +options.chat.width=Width +options.chat.height.focused=Focused Height +options.chat.height.unfocused=Unfocused Height +options.showCape=Show Cape +options.snooper=Allow Snooper +options.snooper.view=Snooper Settings... +options.snooper.title=Machine Specs Collection +options.snooper.desc=We want to collect information about your machine to help improve Minecraft by knowing what we can support and where the biggest problems are. All of this information is completely anonymous and viewable below. We promise we won't do anything bad with this data, but if you want to opt out then feel free to toggle it off! +options.resourcepack=Resource Packs... +options.fullscreen=Fullscreen +options.vsync=Use VSync +options.touchscreen=Touchscreen Mode + +options.mipmapLevels=Mipmap Levels +options.anisotropicFiltering=Anisotropic Filtering +options.forceUnicodeFont=Force Unicode Font + +options.stream.title=Twitch Broadcast Settings +options.stream.bytesPerPixel=Quality +options.stream.micVolumne=Mic Volume +options.stream.micToggleBehavior=Push To +options.stream.mic_toggle.mute=Mute +options.stream.mic_toggle.talk=Talk +options.stream.systemVolume=System Volume +options.stream.kbps=Bandwidth +options.stream.fps=Framerate +options.stream.sendMetadata=Send Metadata +options.stream.compression=Compression +options.stream.compression.low=Low +options.stream.compression.medium=Medium +options.stream.compression.high=High +options.stream.estimation=Estimated resolution: %dx%d +options.stream.changes=You may need to restart your stream for these changes to take place. +options.stream.ingestSelection=Broadcast Server List +options.stream.ingest.title=Twitch Broadcast Servers +options.stream.ingest.reset=Reset Preference +options.stream.chat.title=Twitch Chat Settings +options.stream.chat.enabled=Enable +options.stream.chat.enabled.streaming=Whilst Streaming +options.stream.chat.enabled.always=Always +options.stream.chat.enabled.never=Never +options.stream.chat.userFilter=User Filter +options.stream.chat.userFilter.all=All Viewers +options.stream.chat.userFilter.subs=Subscribers +options.stream.chat.userFilter.mods=Moderators + +title.oldgl1=Old graphics card detected; this may prevent you from +title.oldgl2=playing in the future as OpenGL 2.0 will be required. + +controls.title=Controls +controls.reset=Reset +controls.resetAll=Reset Keys + +key.sprint=Sprint +key.forward=Walk Forwards +key.left=Strafe Left +key.back=Walk Backwards +key.right=Strafe Right +key.jump=Jump +key.inventory=Inventory +key.drop=Drop Item +key.chat=Open Chat +key.sneak=Sneak +key.playerlist=List Players +key.attack=Attack/Destroy +key.use=Use Item/Place Block +key.pickItem=Pick Block +key.mouseButton=Button %1$s +key.command=Open Command +key.screenshot=Take Screenshot +key.togglePerspective=Toggle Perspective +key.smoothCamera=Toggle Cinematic Camera +key.fullscreen=Toggle Fullscreen +key.hotbar.1=Hotbar Slot 1 +key.hotbar.2=Hotbar Slot 2 +key.hotbar.3=Hotbar Slot 3 +key.hotbar.4=Hotbar Slot 4 +key.hotbar.5=Hotbar Slot 5 +key.hotbar.6=Hotbar Slot 6 +key.hotbar.7=Hotbar Slot 7 +key.hotbar.8=Hotbar Slot 8 +key.hotbar.9=Hotbar Slot 9 +key.streamStartStop=Start/Stop Stream +key.streamPauseUnpause=Pause/Unpause Stream +key.streamCommercial=Show Stream Commercials +key.streamToggleMic=Push To Talk/Mute + +key.categories.movement=Movement +key.categories.misc=Miscellaneous +key.categories.multiplayer=Multiplayer +key.categories.gameplay=Gameplay +key.categories.ui=Game Interface +key.categories.inventory=Inventory +key.categories.stream=Streaming + +resourcePack.openFolder=Open resource pack folder +resourcePack.title=Select Resource Packs +resourcePack.available.title=Available Resource Packs +resourcePack.selected.title=Selected Resource Packs +resourcePack.folderInfo=(Place resource pack files here) + +sign.edit=Edit sign message + +book.pageIndicator=Page %1$s of %2$s +book.byAuthor=by %1$s +book.signButton=Sign +book.editTitle=Enter Book Title: +book.finalizeButton=Sign and Close +book.finalizeWarning=Note! When you sign the book, it will no longer be editable. + +tile.stone.name=Stone +tile.hayBlock.name=Hay Bale +tile.grass.name=Grass Block +tile.dirt.default.name=Dirt +tile.dirt.podzol.name=Podzol +tile.stonebrick.name=Cobblestone +tile.wood.name=Wooden Planks +tile.wood.oak.name=Oak Wood Planks +tile.wood.spruce.name=Spruce Wood Planks +tile.wood.birch.name=Birch Wood Planks +tile.wood.jungle.name=Jungle Wood Planks +tile.wood.acacia.name=Acacia Wood Planks +tile.wood.big_oak.name=Dark Oak Wood Planks +tile.sapling.oak.name=Oak Sapling +tile.sapling.spruce.name=Spruce Sapling +tile.sapling.birch.name=Birch Sapling +tile.sapling.jungle.name=Jungle Sapling +tile.sapling.acacia.name=Acacia Sapling +tile.sapling.roofed_oak.name=Dark Oak Sapling +tile.deadbush.name=Dead Bush +tile.bedrock.name=Bedrock +tile.water.name=Water +tile.lava.name=Lava +tile.sand.default.name=Sand +tile.sand.red.name=Red Sand +tile.sandStone.name=Sandstone +tile.sandStone.default.name=Sandstone +tile.sandStone.chiseled.name=Chiseled Sandstone +tile.sandStone.smooth.name=Smooth Sandstone +tile.gravel.name=Gravel +tile.oreGold.name=Gold Ore +tile.oreIron.name=Iron Ore +tile.oreCoal.name=Coal Ore +tile.log.name=Wood +tile.log.oak.name=Oak Wood +tile.log.spruce.name=Spruce Wood +tile.log.birch.name=Birch Wood +tile.log.jungle.name=Jungle Wood +tile.log.acacia.name=Acacia Wood +tile.log.big_oak.name=Dark Oak Wood +tile.leaves.name=Leaves +tile.leaves.oak.name=Oak Leaves +tile.leaves.spruce.name=Spruce Leaves +tile.leaves.birch.name=Birch Leaves +tile.leaves.jungle.name=Jungle Leaves +tile.leaves.acacia.name=Acacia Leaves +tile.leaves.big_oak.name=Dark Oak Leaves +tile.tallgrass.name=Grass +tile.tallgrass.shrub.name=Shrub +tile.tallgrass.grass.name=Grass +tile.tallgrass.fern.name=Fern +tile.sponge.name=Sponge +tile.glass.name=Glass +tile.stainedGlass.name=Stained Glass +tile.stainedGlass.black.name=Black Stained Glass +tile.stainedGlass.red.name=Red Stained Glass +tile.stainedGlass.green.name=Green Stained Glass +tile.stainedGlass.brown.name=Brown Stained Glass +tile.stainedGlass.blue.name=Blue Stained Glass +tile.stainedGlass.purple.name=Purple Stained Glass +tile.stainedGlass.cyan.name=Cyan Stained Glass +tile.stainedGlass.silver.name=Light Gray Stained Glass +tile.stainedGlass.gray.name=Gray Stained Glass +tile.stainedGlass.pink.name=Pink Stained Glass +tile.stainedGlass.lime.name=Lime Stained Glass +tile.stainedGlass.yellow.name=Yellow Stained Glass +tile.stainedGlass.lightBlue.name=Light Blue Stained Glass +tile.stainedGlass.magenta.name=Magenta Stained Glass +tile.stainedGlass.orange.name=Orange Stained Glass +tile.stainedGlass.white.name=White Stained Glass +tile.thinStainedGlass.name=Stained Glass Pane +tile.thinStainedGlass.black.name=Black Stained Glass Pane +tile.thinStainedGlass.red.name=Red Stained Glass Pane +tile.thinStainedGlass.green.name=Green Stained Glass Pane +tile.thinStainedGlass.brown.name=Brown Stained Glass Pane +tile.thinStainedGlass.blue.name=Blue Stained Glass Pane +tile.thinStainedGlass.purple.name=Purple Stained Glass Pane +tile.thinStainedGlass.cyan.name=Cyan Stained Glass Pane +tile.thinStainedGlass.silver.name=Light Gray Stained Glass Pane +tile.thinStainedGlass.gray.name=Gray Stained Glass Pane +tile.thinStainedGlass.pink.name=Pink Stained Glass Pane +tile.thinStainedGlass.lime.name=Lime Stained Glass Pane +tile.thinStainedGlass.yellow.name=Yellow Stained Glass Pane +tile.thinStainedGlass.lightBlue.name=Light Blue Stained Glass Pane +tile.thinStainedGlass.magenta.name=Magenta Stained Glass Pane +tile.thinStainedGlass.orange.name=Orange Stained Glass Pane +tile.thinStainedGlass.white.name=White Stained Glass Pane +tile.thinGlass.name=Glass Pane +tile.cloth.name=Wool +tile.flower1.dandelion.name=Dandelion +tile.flower2.poppy.name=Poppy +tile.flower2.blueOrchid.name=Blue Orchid +tile.flower2.allium.name=Allium +tile.flower2.houstonia.name=Azure Bluet +tile.flower2.tulipRed.name=Red Tulip +tile.flower2.tulipOrange.name=Orange Tulip +tile.flower2.tulipWhite.name=White Tulip +tile.flower2.tulipPink.name=Pink Tulip +tile.flower2.oxeyeDaisy.name=Oxeye Daisy +tile.doublePlant.sunflower.name=Sunflower +tile.doublePlant.syringa.name=Lilac +tile.doublePlant.grass.name=Double Tallgrass +tile.doublePlant.fern.name=Large Fern +tile.doublePlant.rose.name=Rose Bush +tile.doublePlant.paeonia.name=Peony +tile.mushroom.name=Mushroom +tile.blockGold.name=Block of Gold +tile.blockIron.name=Block of Iron +tile.stoneSlab.stone.name=Stone Slab +tile.stoneSlab.sand.name=Sandstone Slab +tile.stoneSlab.wood.name=Wooden Slab +tile.stoneSlab.cobble.name=Cobblestone Slab +tile.stoneSlab.brick.name=Bricks Slab +tile.stoneSlab.smoothStoneBrick.name=Stone Bricks Slab +tile.stoneSlab.netherBrick.name=Nether Brick Slab +tile.stoneSlab.quartz.name=Quartz Slab +tile.woodSlab.oak.name=Oak Wood Slab +tile.woodSlab.spruce.name=Spruce Wood Slab +tile.woodSlab.birch.name=Birch Wood Slab +tile.woodSlab.jungle.name=Jungle Wood Slab +tile.woodSlab.acacia.name=Acacia Wood Slab +tile.woodSlab.big_oak.name=Dark Oak Wood Slab +tile.brick.name=Bricks +tile.tnt.name=TNT +tile.bookshelf.name=Bookshelf +tile.stoneMoss.name=Moss Stone +tile.obsidian.name=Obsidian +tile.torch.name=Torch +tile.fire.name=Fire +tile.mobSpawner.name=Monster Spawner +tile.stairsWood.name=Oak Wood Stairs +tile.stairsWoodSpruce.name=Spruce Wood Stairs +tile.stairsWoodBirch.name=Birch Wood Stairs +tile.stairsWoodJungle.name=Jungle Wood Stairs +tile.stairsWoodAcacia.name=Acacia Wood Stairs +tile.stairsWoodDarkOak.name=Dark Oak Wood Stairs +tile.chest.name=Chest +tile.chestTrap.name=Trapped Chest +tile.redstoneDust.name=Redstone Dust +tile.oreDiamond.name=Diamond Ore +tile.blockCoal.name=Block of Coal +tile.blockDiamond.name=Block of Diamond +tile.workbench.name=Crafting Table +tile.crops.name=Crops +tile.farmland.name=Farmland +tile.furnace.name=Furnace +tile.sign.name=Sign +tile.doorWood.name=Wooden Door +tile.ladder.name=Ladder +tile.rail.name=Rail +tile.goldenRail.name=Powered Rail +tile.activatorRail.name=Activator Rail +tile.detectorRail.name=Detector Rail +tile.stairsStone.name=Stone Stairs +tile.stairsSandStone.name=Sandstone Stairs +tile.lever.name=Lever +tile.pressurePlate.name=Pressure Plate +tile.weightedPlate_light.name=Weighted Pressure Plate (Light) +tile.weightedPlate_heavy.name=Weighted Pressure Plate (Heavy) +tile.doorIron.name=Iron Door +tile.oreRedstone.name=Redstone Ore +tile.notGate.name=Redstone Torch +tile.button.name=Button +tile.snow.name=Snow +tile.woolCarpet.black.name=Black Carpet +tile.woolCarpet.red.name=Red Carpet +tile.woolCarpet.green.name=Green Carpet +tile.woolCarpet.brown.name=Brown Carpet +tile.woolCarpet.blue.name=Blue Carpet +tile.woolCarpet.purple.name=Purple Carpet +tile.woolCarpet.cyan.name=Cyan Carpet +tile.woolCarpet.silver.name=Light Gray Carpet +tile.woolCarpet.gray.name=Gray Carpet +tile.woolCarpet.pink.name=Pink Carpet +tile.woolCarpet.lime.name=Lime Carpet +tile.woolCarpet.yellow.name=Yellow Carpet +tile.woolCarpet.lightBlue.name=Light Blue Carpet +tile.woolCarpet.magenta.name=Magenta Carpet +tile.woolCarpet.orange.name=Orange Carpet +tile.woolCarpet.white.name=Carpet +tile.ice.name=Ice +tile.icePacked.name=Packed Ice +tile.cactus.name=Cactus +tile.clay.name=Clay +tile.clayHardenedStained.black.name=Black Stained Clay +tile.clayHardenedStained.red.name=Red Stained Clay +tile.clayHardenedStained.green.name=Green Stained Clay +tile.clayHardenedStained.brown.name=Brown Stained Clay +tile.clayHardenedStained.blue.name=Blue Stained Clay +tile.clayHardenedStained.purple.name=Purple Stained Clay +tile.clayHardenedStained.cyan.name=Cyan Stained Clay +tile.clayHardenedStained.silver.name=Light Gray Stained Clay +tile.clayHardenedStained.gray.name=Gray Stained Clay +tile.clayHardenedStained.pink.name=Pink Stained Clay +tile.clayHardenedStained.lime.name=Lime Stained Clay +tile.clayHardenedStained.yellow.name=Yellow Stained Clay +tile.clayHardenedStained.lightBlue.name=Light Blue Stained Clay +tile.clayHardenedStained.magenta.name=Magenta Stained Clay +tile.clayHardenedStained.orange.name=Orange Stained Clay +tile.clayHardenedStained.white.name=White Stained Clay +tile.clayHardened.name=Hardened Clay +tile.reeds.name=Sugar cane +tile.jukebox.name=Jukebox +tile.fence.name=Fence +tile.fenceGate.name=Fence Gate +tile.pumpkin.name=Pumpkin +tile.litpumpkin.name=Jack o'Lantern +tile.hellrock.name=Netherrack +tile.hellsand.name=Soul Sand +tile.lightgem.name=Glowstone +tile.portal.name=Portal +tile.cloth.black.name=Black Wool +tile.cloth.red.name=Red Wool +tile.cloth.green.name=Green Wool +tile.cloth.brown.name=Brown Wool +tile.cloth.blue.name=Blue Wool +tile.cloth.purple.name=Purple Wool +tile.cloth.cyan.name=Cyan Wool +tile.cloth.silver.name=Light Gray Wool +tile.cloth.gray.name=Gray Wool +tile.cloth.pink.name=Pink Wool +tile.cloth.lime.name=Lime Wool +tile.cloth.yellow.name=Yellow Wool +tile.cloth.lightBlue.name=Light Blue Wool +tile.cloth.magenta.name=Magenta Wool +tile.cloth.orange.name=Orange Wool +tile.cloth.white.name=Wool +tile.oreLapis.name=Lapis Lazuli Ore +tile.blockLapis.name=Lapis Lazuli Block +tile.dispenser.name=Dispenser +tile.dropper.name=Dropper +tile.musicBlock.name=Note Block +tile.cake.name=Cake +tile.bed.name=Bed +tile.bed.occupied=This bed is occupied +tile.bed.noSleep=You can only sleep at night +tile.bed.notSafe=You may not rest now, there are monsters nearby +tile.bed.notValid=Your home bed was missing or obstructed +tile.lockedchest.name=Locked chest +tile.trapdoor.name=Trapdoor +tile.web.name=Cobweb +tile.stonebricksmooth.name=Stone Bricks +tile.stonebricksmooth.default.name=Stone Bricks +tile.stonebricksmooth.mossy.name=Mossy Stone Bricks +tile.stonebricksmooth.cracked.name=Cracked Stone Bricks +tile.stonebricksmooth.chiseled.name=Chiseled Stone Bricks +tile.monsterStoneEgg.stone.name=Stone Monster Egg +tile.monsterStoneEgg.cobble.name=Cobblestone Monster Egg +tile.monsterStoneEgg.brick.name=Stone Brick Monster Egg +tile.monsterStoneEgg.mossybrick.name=Mossy Stone Brick Monster Egg +tile.monsterStoneEgg.crackedbrick.name=Cracked Stone Brick Monster Egg +tile.monsterStoneEgg.chiseledbrick.name=Chiseled Stone Brick Monster Egg +tile.pistonBase.name=Piston +tile.pistonStickyBase.name=Sticky Piston +tile.fenceIron.name=Iron Bars +tile.melon.name=Melon +tile.stairsBrick.name=Brick Stairs +tile.stairsStoneBrickSmooth.name=Stone Brick Stairs +tile.vine.name=Vines +tile.netherBrick.name=Nether Brick +tile.netherFence.name=Nether Brick Fence +tile.stairsNetherBrick.name=Nether Brick Stairs +tile.netherStalk.name=Nether Wart +tile.cauldron.name=Cauldron +tile.enchantmentTable.name=Enchantment Table +tile.anvil.name=Anvil +tile.anvil.intact.name=Anvil +tile.anvil.slightlyDamaged.name=Slightly Damaged Anvil +tile.anvil.veryDamaged.name=Very Damaged Anvil +tile.whiteStone.name=End Stone +tile.endPortalFrame.name=End Portal +tile.mycel.name=Mycelium +tile.waterlily.name=Lily Pad +tile.dragonEgg.name=Dragon Egg +tile.redstoneLight.name=Redstone Lamp +tile.cocoa.name=Cocoa +tile.enderChest.name=Ender Chest +tile.oreRuby.name=Ruby Ore +tile.oreEmerald.name=Emerald Ore +tile.blockEmerald.name=Block of Emerald +tile.blockRedstone.name=Block of Redstone +tile.tripWire.name=Tripwire +tile.tripWireSource.name=Tripwire Hook +tile.commandBlock.name=Command Block +tile.beacon.name=Beacon +tile.beacon.primary=Primary Power +tile.beacon.secondary=Secondary Power +tile.cobbleWall.normal.name=Cobblestone Wall +tile.cobbleWall.mossy.name=Mossy Cobblestone Wall +tile.carrots.name=Carrots +tile.potatoes.name=Potatoes +tile.daylightDetector.name=Daylight Sensor +tile.netherquartz.name=Nether Quartz Ore +tile.hopper.name=Hopper +tile.quartzBlock.default.name=Block of Quartz +tile.quartzBlock.chiseled.name=Chiseled Quartz Block +tile.quartzBlock.lines.name=Pillar Quartz Block +tile.stairsQuartz.name=Quartz Stairs + +item.nameTag.name=Name Tag +item.leash.name=Lead +item.shovelIron.name=Iron Shovel +item.pickaxeIron.name=Iron Pickaxe +item.hatchetIron.name=Iron Axe +item.flintAndSteel.name=Flint and Steel +item.apple.name=Apple +item.cookie.name=Cookie +item.bow.name=Bow +item.arrow.name=Arrow +item.coal.name=Coal +item.charcoal.name=Charcoal +item.diamond.name=Diamond +item.emerald.name=Emerald +item.ingotIron.name=Iron Ingot +item.ingotGold.name=Gold Ingot +item.swordIron.name=Iron Sword +item.swordWood.name=Wooden Sword +item.shovelWood.name=Wooden Shovel +item.pickaxeWood.name=Wooden Pickaxe +item.hatchetWood.name=Wooden Axe +item.swordStone.name=Stone Sword +item.shovelStone.name=Stone Shovel +item.pickaxeStone.name=Stone Pickaxe +item.hatchetStone.name=Stone Axe +item.swordDiamond.name=Diamond Sword +item.shovelDiamond.name=Diamond Shovel +item.pickaxeDiamond.name=Diamond Pickaxe +item.hatchetDiamond.name=Diamond Axe +item.stick.name=Stick +item.bowl.name=Bowl +item.mushroomStew.name=Mushroom Stew +item.swordGold.name=Golden Sword +item.shovelGold.name=Golden Shovel +item.pickaxeGold.name=Golden Pickaxe +item.hatchetGold.name=Golden Axe +item.string.name=String +item.feather.name=Feather +item.sulphur.name=Gunpowder +item.hoeWood.name=Wooden Hoe +item.hoeStone.name=Stone Hoe +item.hoeIron.name=Iron Hoe +item.hoeDiamond.name=Diamond Hoe +item.hoeGold.name=Golden Hoe +item.seeds.name=Seeds +item.seeds_pumpkin.name=Pumpkin Seeds +item.seeds_melon.name=Melon Seeds +item.melon.name=Melon +item.wheat.name=Wheat +item.bread.name=Bread +item.helmetCloth.name=Leather Cap +item.chestplateCloth.name=Leather Tunic +item.leggingsCloth.name=Leather Pants +item.bootsCloth.name=Leather Boots +item.helmetChain.name=Chain Helmet +item.chestplateChain.name=Chain Chestplate +item.leggingsChain.name=Chain Leggings +item.bootsChain.name=Chain Boots +item.helmetIron.name=Iron Helmet +item.chestplateIron.name=Iron Chestplate +item.leggingsIron.name=Iron Leggings +item.bootsIron.name=Iron Boots +item.helmetDiamond.name=Diamond Helmet +item.chestplateDiamond.name=Diamond Chestplate +item.leggingsDiamond.name=Diamond Leggings +item.bootsDiamond.name=Diamond Boots +item.helmetGold.name=Golden Helmet +item.chestplateGold.name=Golden Chestplate +item.leggingsGold.name=Golden Leggings +item.bootsGold.name=Golden Boots +item.flint.name=Flint +item.porkchopRaw.name=Raw Porkchop +item.porkchopCooked.name=Cooked Porkchop +item.chickenRaw.name=Raw Chicken +item.chickenCooked.name=Cooked Chicken +item.beefRaw.name=Raw Beef +item.beefCooked.name=Steak +item.painting.name=Painting +item.frame.name=Item Frame +item.appleGold.name=Golden Apple +item.sign.name=Sign +item.doorWood.name=Wooden Door +item.bucket.name=Bucket +item.bucketWater.name=Water Bucket +item.bucketLava.name=Lava Bucket +item.minecart.name=Minecart +item.saddle.name=Saddle +item.doorIron.name=Iron Door +item.redstone.name=Redstone +item.snowball.name=Snowball +item.boat.name=Boat +item.leather.name=Leather +item.milk.name=Milk +item.brick.name=Brick +item.clay.name=Clay +item.reeds.name=Sugar Canes +item.paper.name=Paper +item.book.name=Book +item.slimeball.name=Slimeball +item.minecartChest.name=Minecart with Chest +item.minecartFurnace.name=Minecart with Furnace +item.minecartTnt.name=Minecart with TNT +item.minecartHopper.name=Minecart with Hopper +item.minecartCommandBlock.name=Minecart with Command Block +item.egg.name=Egg +item.compass.name=Compass +item.fishingRod.name=Fishing Rod +item.clock.name=Clock +item.yellowDust.name=Glowstone Dust +item.fish.cod.raw.name=Raw Fish +item.fish.salmon.raw.name=Raw Salmon +item.fish.pufferfish.raw.name=Pufferfish +item.fish.clownfish.raw.name=Clownfish +item.fish.cod.cooked.name=Cooked Fish +item.fish.salmon.cooked.name=Cooked Salmon +item.record.name=Music Disc +item.record.13.desc=C418 - 13 +item.record.cat.desc=C418 - cat +item.record.blocks.desc=C418 - blocks +item.record.chirp.desc=C418 - chirp +item.record.far.desc=C418 - far +item.record.mall.desc=C418 - mall +item.record.mellohi.desc=C418 - mellohi +item.record.stal.desc=C418 - stal +item.record.strad.desc=C418 - strad +item.record.ward.desc=C418 - ward +item.record.11.desc=C418 - 11 +item.record.wait.desc=C418 - wait +item.bone.name=Bone +item.dyePowder.black.name=Ink Sac +item.dyePowder.red.name=Rose Red +item.dyePowder.green.name=Cactus Green +item.dyePowder.brown.name=Cocoa Beans +item.dyePowder.blue.name=Lapis Lazuli +item.dyePowder.purple.name=Purple Dye +item.dyePowder.cyan.name=Cyan Dye +item.dyePowder.silver.name=Light Gray Dye +item.dyePowder.gray.name=Gray Dye +item.dyePowder.pink.name=Pink Dye +item.dyePowder.lime.name=Lime Dye +item.dyePowder.yellow.name=Dandelion Yellow +item.dyePowder.lightBlue.name=Light Blue Dye +item.dyePowder.magenta.name=Magenta Dye +item.dyePowder.orange.name=Orange Dye +item.dyePowder.white.name=Bone Meal +item.sugar.name=Sugar +item.cake.name=Cake +item.bed.name=Bed +item.diode.name=Redstone Repeater +item.comparator.name=Redstone Comparator +item.map.name=Map +item.leaves.name=Leaves +item.shears.name=Shears +item.rottenFlesh.name=Rotten Flesh +item.enderPearl.name=Ender Pearl +item.blazeRod.name=Blaze Rod +item.ghastTear.name=Ghast Tear +item.netherStalkSeeds.name=Nether Wart +item.potion.name=Potion +item.emptyPotion.name=Water Bottle +item.goldNugget.name=Gold Nugget +item.glassBottle.name=Glass Bottle +item.spiderEye.name=Spider Eye +item.fermentedSpiderEye.name=Fermented Spider Eye +item.blazePowder.name=Blaze Powder +item.magmaCream.name=Magma Cream +item.cauldron.name=Cauldron +item.brewingStand.name=Brewing Stand +item.eyeOfEnder.name=Eye of Ender +item.speckledMelon.name=Glistering Melon +item.monsterPlacer.name=Spawn +item.expBottle.name=Bottle o' Enchanting +item.fireball.name=Fire Charge +item.writingBook.name=Book and Quill +item.writtenBook.name=Written Book +item.ruby.name=Ruby +item.flowerPot.name=Flower Pot +item.emptyMap.name=Empty Map +item.carrots.name=Carrot +item.carrotGolden.name=Golden Carrot +item.potato.name=Potato +item.potatoBaked.name=Baked Potato +item.potatoPoisonous.name=Poisonous Potato +item.skull.skeleton.name=Skeleton Skull +item.skull.wither.name=Wither Skeleton Skull +item.skull.zombie.name=Zombie Head +item.skull.char.name=Head +item.skull.player.name=%s's Head +item.skull.creeper.name=Creeper Head +item.carrotOnAStick.name=Carrot on a Stick +item.netherStar.name=Nether Star +item.pumpkinPie.name=Pumpkin Pie +item.enchantedBook.name=Enchanted Book +item.fireworks.name=Firework Rocket +item.fireworks.flight=Flight Duration: +item.fireworksCharge.name=Firework Star +item.fireworksCharge.black=Black +item.fireworksCharge.red=Red +item.fireworksCharge.green=Green +item.fireworksCharge.brown=Brown +item.fireworksCharge.blue=Blue +item.fireworksCharge.purple=Purple +item.fireworksCharge.cyan=Cyan +item.fireworksCharge.silver=Light Gray +item.fireworksCharge.gray=Gray +item.fireworksCharge.pink=Pink +item.fireworksCharge.lime=Lime +item.fireworksCharge.yellow=Yellow +item.fireworksCharge.lightBlue=Light Blue +item.fireworksCharge.magenta=Magenta +item.fireworksCharge.orange=Orange +item.fireworksCharge.white=White +item.fireworksCharge.customColor=Custom +item.fireworksCharge.fadeTo=Fade to +item.fireworksCharge.flicker=Twinkle +item.fireworksCharge.trail=Trail +item.fireworksCharge.type.0=Small Ball +item.fireworksCharge.type.1=Large Ball +item.fireworksCharge.type.2=Star-shaped +item.fireworksCharge.type.3=Creeper-shaped +item.fireworksCharge.type.4=Burst +item.fireworksCharge.type=Unknown Shape +item.netherbrick.name=Nether Brick +item.netherquartz.name=Nether Quartz +item.horsearmormetal.name=Iron Horse Armor +item.horsearmorgold.name=Gold Horse Armor +item.horsearmordiamond.name=Diamond Horse Armor + +container.inventory=Inventory +container.hopper=Item Hopper +container.crafting=Crafting +container.dispenser=Dispenser +container.dropper=Dropper +container.furnace=Furnace +container.enchant=Enchant +container.repair=Repair & Name +container.repair.cost=Enchantment Cost: %1$d +container.repair.expensive=Too Expensive! +container.creative=Item Selection +container.brewing=Brewing Stand +container.chest=Chest +container.chestDouble=Large Chest +container.minecart=Minecart +container.enderchest=Ender Chest + +item.dyed=Dyed +item.unbreakable=Unbreakable + +entity.Item.name=Item +entity.XPOrb.name=Experience Orb +entity.SmallFireball.name=Small Fireball +entity.Fireball.name=Fireball + +entity.Arrow.name=Arrow +entity.Snowball.name=Snowball +entity.Painting.name=Painting + +entity.Mob.name=Mob +entity.Monster.name=Monster + +entity.Creeper.name=Creeper +entity.Skeleton.name=Skeleton +entity.Spider.name=Spider +entity.Giant.name=Giant +entity.Zombie.name=Zombie +entity.Slime.name=Slime +entity.Ghast.name=Ghast +entity.PigZombie.name=Zombie Pigman +entity.Enderman.name=Enderman +entity.Silverfish.name=Silverfish +entity.CaveSpider.name=Cave Spider +entity.Blaze.name=Blaze +entity.LavaSlime.name=Magma Cube +entity.MushroomCow.name=Mooshroom +entity.Villager.name=Villager +entity.VillagerGolem.name=Iron Golem +entity.SnowMan.name=Snow Golem +entity.EnderDragon.name=Ender Dragon +entity.WitherBoss.name=Wither +entity.Witch.name=Witch + +entity.Pig.name=Pig +entity.Sheep.name=Sheep +entity.Cow.name=Cow +entity.Chicken.name=Chicken +entity.Squid.name=Squid +entity.Wolf.name=Wolf +entity.Ozelot.name=Ocelot +entity.Cat.name=Cat +entity.Bat.name=Bat +entity.EntityHorse.name=Horse +entity.horse.name=Horse +entity.donkey.name=Donkey +entity.mule.name=Mule +entity.skeletonhorse.name=Skeleton Horse +entity.zombiehorse.name=Zombie Horse + +entity.PrimedTnt.name=Block of TNT +entity.FallingSand.name=Falling Block + +entity.Minecart.name=Minecart +entity.Boat.name=Boat + +entity.Arrow.name=arrow +entity.generic.name=unknown + +death.fell.accident.ladder=%1$s fell off a ladder +death.fell.accident.vines=%1$s fell off some vines +death.fell.accident.water=%1$s fell out of the water +death.fell.accident.generic=%1$s fell from a high place +death.fell.killer=%1$s was doomed to fall +death.fell.assist=%1$s was doomed to fall by %2$s +death.fell.assist.item=%1$s was doomed to fall by %2$s using %3$s +death.fell.finish=%1$s fell too far and was finished by %2$s +death.fell.finish.item=%1$s fell too far and was finished by %2$s using %3$s + +death.attack.inFire=%1$s went up in flames +death.attack.inFire.player=%1$s walked into fire whilst fighting %2$s +death.attack.onFire=%1$s burned to death +death.attack.onFire.player=%1$s was burnt to a crisp whilst fighting %2$s +death.attack.lava=%1$s tried to swim in lava +death.attack.lava.player=%1$s tried to swim in lava to escape %2$s +death.attack.inWall=%1$s suffocated in a wall +death.attack.drown=%1$s drowned +death.attack.drown.player=%1$s drowned whilst trying to escape %2$s +death.attack.starve=%1$s starved to death +death.attack.cactus=%1$s was pricked to death +death.attack.cactus.player=%1$s walked into a cactus whilst trying to escape %2$s +death.attack.generic=%1$s died +death.attack.explosion=%1$s blew up +death.attack.explosion.player=%1$s was blown up by %2$s +death.attack.magic=%1$s was killed by magic +death.attack.wither=%1$s withered away +death.attack.anvil=%1$s was squashed by a falling anvil +death.attack.fallingBlock=%1$s was squashed by a falling block +death.attack.mob=%1$s was slain by %2$s +death.attack.player=%1$s was slain by %2$s +death.attack.player.item=%1$s was slain by %2$s using %3$s +death.attack.arrow=%1$s was shot by %2$s +death.attack.arrow.item=%1$s was shot by %2$s using %3$s +death.attack.fireball=%1$s was fireballed by %2$s +death.attack.fireball.item=%1$s was fireballed by %2$s using %3$s +death.attack.thrown=%1$s was pummeled by %2$s +death.attack.thrown.item=%1$s was pummeled by %2$s using %3$s +death.attack.indirectMagic=%1$s was killed by %2$s using magic +death.attack.indirectMagic.item=%1$s was killed by %2$s using %3$s +death.attack.thorns=%1$s was killed trying to hurt %2$s +death.attack.fall=%1$s hit the ground too hard +death.attack.outOfWorld=%1$s fell out of the world + +deathScreen.respawn=Respawn +deathScreen.deleteWorld=Delete world +deathScreen.titleScreen=Title screen +deathScreen.score=Score +deathScreen.title.hardcore=Game over! +deathScreen.hardcoreInfo=You cannot respawn in hardcore mode! +deathScreen.title=You died! +deathScreen.leaveServer=Leave server +deathScreen.quit.confirm=Are you sure you want to quit? + +potion.effects.whenDrank=When Applied: +potion.empty=No Effects +potion.moveSpeed=Speed +potion.moveSlowdown=Slowness +potion.digSpeed=Haste +potion.digSlowDown=Mining Fatigue +potion.damageBoost=Strength +potion.weakness=Weakness +potion.heal=Instant Health +potion.harm=Instant Damage +potion.jump=Jump Boost +potion.confusion=Nausea +potion.regeneration=Regeneration +potion.resistance=Resistance +potion.fireResistance=Fire Resistance +potion.waterBreathing=Water Breathing +potion.invisibility=Invisibility +potion.blindness=Blindness +potion.nightVision=Night Vision +potion.hunger=Hunger +potion.poison=Poison +potion.wither=Wither +potion.healthBoost=Health Boost +potion.absorption=Absorption +potion.saturation=Saturation + +potion.moveSpeed.postfix=Potion of Swiftness +potion.moveSlowdown.postfix=Potion of Slowness +potion.digSpeed.postfix=Potion of Haste +potion.digSlowDown.postfix=Potion of Dullness +potion.damageBoost.postfix=Potion of Strength +potion.weakness.postfix=Potion of Weakness +potion.heal.postfix=Potion of Healing +potion.harm.postfix=Potion of Harming +potion.jump.postfix=Potion of Leaping +potion.confusion.postfix=Potion of Nausea +potion.regeneration.postfix=Potion of Regeneration +potion.resistance.postfix=Potion of Resistance +potion.fireResistance.postfix=Potion of Fire Resistance +potion.waterBreathing.postfix=Potion of Water Breathing +potion.invisibility.postfix=Potion of Invisibility +potion.blindness.postfix=Potion of Blindness +potion.nightVision.postfix=Potion of Night Vision +potion.hunger.postfix=Potion of Hunger +potion.poison.postfix=Potion of Poison +potion.wither.postfix=Potion of Decay +potion.healthBoost.postfix=Potion of Health Boost +potion.absorption.postfix=Potion of Absorption +potion.saturation.postfix=Potion of Saturation + +potion.potency.0= +potion.potency.1=II +potion.potency.2=III +potion.potency.3=IV + +potion.prefix.grenade=Splash +potion.prefix.mundane=Mundane +potion.prefix.uninteresting=Uninteresting +potion.prefix.bland=Bland +potion.prefix.clear=Clear +potion.prefix.milky=Milky +potion.prefix.diffuse=Diffuse +potion.prefix.artless=Artless +potion.prefix.thin=Thin +potion.prefix.awkward=Awkward +potion.prefix.flat=Flat +potion.prefix.bulky=Bulky +potion.prefix.bungling=Bungling +potion.prefix.buttered=Buttered +potion.prefix.smooth=Smooth +potion.prefix.suave=Suave +potion.prefix.debonair=Debonair +potion.prefix.thick=Thick +potion.prefix.elegant=Elegant +potion.prefix.fancy=Fancy +potion.prefix.charming=Charming +potion.prefix.dashing=Dashing +potion.prefix.refined=Refined +potion.prefix.cordial=Cordial +potion.prefix.sparkling=Sparkling +potion.prefix.potent=Potent +potion.prefix.foul=Foul +potion.prefix.odorless=Odorless +potion.prefix.rank=Rank +potion.prefix.harsh=Harsh +potion.prefix.acrid=Acrid +potion.prefix.gross=Gross +potion.prefix.stinky=Stinky + +enchantment.damage.all=Sharpness +enchantment.damage.undead=Smite +enchantment.damage.arthropods=Bane of Arthropods +enchantment.knockback=Knockback +enchantment.fire=Fire Aspect +enchantment.protect.all=Protection +enchantment.protect.fire=Fire Protection +enchantment.protect.fall=Feather Falling +enchantment.protect.explosion=Blast Protection +enchantment.protect.projectile=Projectile Protection +enchantment.oxygen=Respiration +enchantment.waterWorker=Aqua Affinity +enchantment.digging=Efficiency +enchantment.untouching=Silk Touch +enchantment.durability=Unbreaking +enchantment.lootBonus=Looting +enchantment.lootBonusDigger=Fortune +enchantment.lootBonusFishing=Luck of the Sea +enchantment.fishingSpeed=Lure +enchantment.arrowDamage=Power +enchantment.arrowFire=Flame +enchantment.arrowKnockback=Punch +enchantment.arrowInfinite=Infinity +enchantment.thorns=Thorns + +enchantment.level.1=I +enchantment.level.2=II +enchantment.level.3=III +enchantment.level.4=IV +enchantment.level.5=V +enchantment.level.6=VI +enchantment.level.7=VII +enchantment.level.8=VIII +enchantment.level.9=IX +enchantment.level.10=X + +gui.achievements=Achievements +gui.stats=Statistics + +stats.tooltip.type.achievement=Achievement +stats.tooltip.type.statistic=Statistic +stat.generalButton=General +stat.blocksButton=Blocks +stat.itemsButton=Items +stat.mobsButton=Mobs + +stat.used=Times Used +stat.mined=Times Mined +stat.depleted=Times Depleted +stat.crafted=Times Crafted +stat.entityKills=You killed %d %s +stat.entityKilledBy=%s killed you %d time(s) +stat.entityKills.none=You have never killed %s +stat.entityKilledBy.none=You have never been killed by %s + +stat.startGame=Times played +stat.createWorld=Worlds created +stat.loadWorld=Saves loaded +stat.joinMultiplayer=Multiplayer joins +stat.leaveGame=Games quit + +stat.playOneMinute=Minutes Played + +stat.walkOneCm=Distance Walked +stat.fallOneCm=Distance Fallen +stat.swimOneCm=Distance Swum +stat.flyOneCm=Distance Flown +stat.climbOneCm=Distance Climbed +stat.diveOneCm=Distance Dove +stat.minecartOneCm=Distance by Minecart +stat.boatOneCm=Distance by Boat +stat.pigOneCm=Distance by Pig +stat.horseOneCm=Distance by Horse +stat.jump=Jumps +stat.drop=Items Dropped + +stat.damageDealt=Damage Dealt +stat.damageTaken=Damage Taken +stat.deaths=Number of Deaths +stat.mobKills=Mob Kills +stat.animalsBred=Animals Bred +stat.playerKills=Player Kills +stat.fishCaught=Fish Caught +stat.treasureFished=Treasure Fished +stat.junkFished=Junk Fished + +stat.mineBlock=%1$s Mined +stat.craftItem=%1$s Crafted +stat.useItem=%1$s Used +stat.breakItem=%1$s Depleted + +achievement.get=Achievement get! + +achievement.taken=Taken! +achievement.unknown=??? + +achievement.requires=Requires '%1$s' +achievement.openInventory=Taking Inventory +achievement.openInventory.desc=Press '%1$s' to open your inventory. +achievement.mineWood=Getting Wood +achievement.mineWood.desc=Attack a tree until a block of wood pops out +achievement.buildWorkBench=Benchmarking +achievement.buildWorkBench.desc=Craft a workbench with four blocks of planks +achievement.buildPickaxe=Time to Mine! +achievement.buildPickaxe.desc=Use planks and sticks to make a pickaxe +achievement.buildFurnace=Hot Topic +achievement.buildFurnace.desc=Construct a furnace out of eight stone blocks +achievement.acquireIron=Acquire Hardware +achievement.acquireIron.desc=Smelt an iron ingot +achievement.buildHoe=Time to Farm! +achievement.buildHoe.desc=Use planks and sticks to make a hoe +achievement.makeBread=Bake Bread +achievement.makeBread.desc=Turn wheat into bread +achievement.bakeCake=The Lie +achievement.bakeCake.desc=Wheat, sugar, milk and eggs! +achievement.buildBetterPickaxe=Getting an Upgrade +achievement.buildBetterPickaxe.desc=Construct a better pickaxe +achievement.cookFish=Delicious Fish +achievement.cookFish.desc=Catch and cook fish! +achievement.onARail=On A Rail +achievement.onARail.desc=Travel by minecart at least 1 km from where you started +achievement.buildSword=Time to Strike! +achievement.buildSword.desc=Use planks and sticks to make a sword +achievement.killEnemy=Monster Hunter +achievement.killEnemy.desc=Attack and destroy a monster +achievement.killCow=Cow Tipper +achievement.killCow.desc=Harvest some leather +achievement.breedCow=Repopulation +achievement.breedCow.desc=Breed two cows with wheat +achievement.flyPig=When Pigs Fly +achievement.flyPig.desc=Fly a pig off a cliff +achievement.snipeSkeleton=Sniper Duel +achievement.snipeSkeleton.desc=Kill a skeleton with an arrow from more than 50 meters +achievement.diamonds=DIAMONDS! +achievement.diamonds.desc=Acquire diamonds with your iron tools +achievement.diamondsToYou=Diamonds to you! +achievement.diamondsToYou.desc=Throw diamonds at another player. +achievement.portal=We Need to Go Deeper +achievement.portal.desc=Build a portal to the Nether +achievement.ghast=Return to Sender +achievement.ghast.desc=Destroy a Ghast with a fireball +achievement.blazeRod=Into Fire +achievement.blazeRod.desc=Relieve a Blaze of its rod +achievement.potion=Local Brewery +achievement.potion.desc=Brew a potion +achievement.theEnd=The End? +achievement.theEnd.desc=Locate the End +achievement.theEnd2=The End. +achievement.theEnd2.desc=Defeat the Ender Dragon +achievement.spawnWither=The Beginning? +achievement.spawnWither.desc=Spawn the Wither +achievement.killWither=The Beginning. +achievement.killWither.desc=Kill the Wither +achievement.fullBeacon=Beaconator +achievement.fullBeacon.desc=Create a full beacon +achievement.exploreAllBiomes=Adventuring Time +achievement.exploreAllBiomes.desc=Discover all biomes +achievement.enchantments=Enchanter +achievement.enchantments.desc=Use a book, obsidian and diamonds to construct an enchantment table +achievement.overkill=Overkill +achievement.overkill.desc=Deal eight hearts of damage in a single hit +achievement.bookcase=Librarian +achievement.bookcase.desc=Build some bookshelves to improve your enchantment table + +commands.generic.exception=An unknown error occurred while attempting to perform this command +commands.generic.permission=You do not have permission to use this command +commands.generic.syntax=Invalid command syntax +commands.generic.player.notFound=That player cannot be found +commands.generic.notFound=Unknown command. Try /help for a list of commands +commands.generic.num.invalid='%s' is not a valid number +commands.generic.boolean.invalid='%s' is not true or false +commands.generic.num.tooSmall=The number you have entered (%d) is too small, it must be at least %d +commands.generic.num.tooBig=The number you have entered (%d) is too big, it must be at most %d +commands.generic.double.tooSmall=The number you have entered (%.2f) is too small, it must be at least %.2f +commands.generic.double.tooBig=The number you have entered (%.2f) is too big, it must be at most %.2f +commands.generic.usage=Usage: %s +commands.generic.deprecatedId=Warning: Using numeric IDs will not be supported in the future. Please use names, such as '%s' + +commands.setidletimeout.usage=/setidletimeout +commands.setidletimeout.success=Successfully set the idle timeout to %d minutes. +commands.xp.failure.widthdrawXp=Cannot give player negative experience points +commands.xp.success=Given %d experience to %s +commands.xp.success.levels=Given %d levels to %s +commands.xp.success.negative.levels=Taken %d levels from %s +commands.xp.usage=/xp [player] OR /xp L [player] +commands.playsound.usage=/playsound [x] [y] [z] [volume] [pitch] [minimumVolume] +commands.playsound.success=Played sound '%s' to %s +commands.playsound.playerTooFar=Player %s is too far away to hear the sound +commands.give.usage=/give [amount] [data] [dataTag] +commands.give.notFound=There is no such item with ID %d +commands.give.success=Given %s * %d to %s +commands.give.tagError=Data tag parsing failed: %s +commands.summon.usage=/summon [x] [y] [z] [dataTag] +commands.summon.success=Object successfully summoned +commands.summon.failed=Unable to summon object +commands.summon.tagError=Data tag parsing failed: %s +commands.summon.outOfWorld=Cannot summon the object out of the world +commands.testforblock.usage=/testforblock [dataValue] [dataTag] +commands.testforblock.failed.tile=The block at %d,%d,%d is %s (expected: %s). +commands.testforblock.failed.data=The block at %d,%d,%d had the data value of %s (expected: %s). +commands.testforblock.failed.nbt=The block at %d,%d,%d did not have the required NBT keys. +commands.testforblock.failed.tileEntity=The block at %d,%d,%d is not a tile entity and cannot support tag matching. +commands.testforblock.success=Successfully found the block at %d,%d,%d. +commands.testforblock.outOfWorld=Cannot test for block outside of the world +commands.setblock.usage=/setblock [dataValue] [oldBlockHandling] [dataTag] +commands.setblock.success=Block placed +commands.setblock.failed=Unable to place block +commands.setblock.tagError=Data tag parsing failed: %s +commands.setblock.outOfWorld=Cannot place block outside of the world +commands.setblock.notFound=There is no such block with ID/name %s +commands.setblock.noChange=The block couldn't be placed +commands.effect.usage=/effect [seconds] [amplifier] +commands.effect.notFound=There is no such mob effect with ID %d +commands.effect.success=Given %1$s (ID %2$d) * %3$d to %4$s for %5$d seconds +commands.effect.success.removed=Took %1$s from %2$s +commands.effect.success.removed.all=Took all effects from %s +commands.effect.failure.notActive=Couldn't take %1$s from %2$s as they do not have the effect +commands.effect.failure.notActive.all=Couldn't take any effects from %s as they do not have any +commands.enchant.usage=/enchant [level] +commands.enchant.notFound=There is no such enchantment with ID %d +commands.enchant.noItem=The target doesn't hold an item +commands.enchant.cantEnchant=The selected enchantment can't be added to the target item +commands.enchant.cantCombine=%1$s can't be combined with %2$s +commands.enchant.success=Enchanting succeeded +commands.clear.usage=/clear [item] [data] +commands.clear.success=Cleared the inventory of %s, removing %d items +commands.clear.failure=Could not clear the inventory of %s, no items to remove +commands.downfall.usage=/toggledownfall +commands.downfall.success=Toggled downfall +commands.time.usage=/time +commands.time.added=Added %d to the time +commands.time.set=Set the time to %d +commands.players.usage=/list +commands.players.list=There are %d/%d players online: +commands.banlist.ips=There are %d total banned IP addresses: +commands.banlist.players=There are %d total banned players: +commands.banlist.usage=/banlist [ips|players] +commands.kill.usage=/kill +commands.kill.success=Ouch! That looked like it hurt +commands.kick.success=Kicked %s from the game +commands.kick.success.reason=Kicked %s from the game: '%s' +commands.kick.usage=/kick [reason ...] +commands.op.success=Opped %s +commands.op.failed=Could not op %s +commands.op.usage=/op +commands.deop.success=De-opped %s +commands.deop.failed=Could not de-op %s +commands.deop.usage=/deop +commands.say.usage=/say +commands.ban.success=Banned player %s +commands.ban.failed=Could not ban player %s +commands.ban.usage=/ban [reason ...] +commands.unban.success=Unbanned player %s +commands.unban.failed=Could not unban player %s +commands.unban.usage=/pardon +commands.banip.invalid=You have entered an invalid IP address or a player that is not online +commands.banip.success=Banned IP address %s +commands.banip.success.players=Banned IP address %s belonging to %s +commands.banip.usage=/ban-ip [reason ...] +commands.unbanip.invalid=You have entered an invalid IP address +commands.unbanip.success=Unbanned IP address %s +commands.unbanip.usage=/pardon-ip
    +commands.save.usage=/save-all +commands.save-on.alreadyOn=Saving is already turned on. +commands.save-on.usage=/save-on +commands.save-off.alreadyOff=Saving is already turned off. +commands.save-off.usage=/save-off +commands.save.enabled=Turned on world auto-saving +commands.save.disabled=Turned off world auto-saving +commands.save.start=Saving... +commands.save.success=Saved the world +commands.save.failed=Saving failed: %s +commands.stop.usage=/stop +commands.stop.start=Stopping the server +commands.tp.success=Teleported %s to %s +commands.tp.success.coordinates=Teleported %s to %.2f,%.2f,%.2f +commands.tp.usage=/tp [target player] OR /tp [target player] +commands.tp.notSameDimension=Unable to teleport because players are not in the same dimension +commands.whitelist.list=There are %d (out of %d seen) whitelisted players: +commands.whitelist.enabled=Turned on the whitelist +commands.whitelist.disabled=Turned off the whitelist +commands.whitelist.reloaded=Reloaded the whitelist +commands.whitelist.add.success=Added %s to the whitelist +commands.whitelist.add.failed=Could not add %s to the whitelist +commands.whitelist.add.usage=/whitelist add +commands.whitelist.remove.success=Removed %s from the whitelist +commands.whitelist.remove.failed=Could not remove %s from the whitelist +commands.whitelist.remove.usage=/whitelist remove +commands.whitelist.usage=/whitelist +commands.scoreboard.usage=/scoreboard +commands.scoreboard.teamNotFound=No team was found by the name '%s' +commands.scoreboard.objectiveNotFound=No objective was found by the name '%s' +commands.scoreboard.objectiveReadOnly=The objective '%s' is read-only and cannot be set +commands.scoreboard.objectives.usage=/scoreboard objectives +commands.scoreboard.objectives.setdisplay.usage=/scoreboard objectives setdisplay [objective] +commands.scoreboard.objectives.setdisplay.invalidSlot=No such display slot '%s' +commands.scoreboard.objectives.setdisplay.successCleared=Cleared objective display slot '%s' +commands.scoreboard.objectives.setdisplay.successSet=Set the display objective in slot '%s' to '%s' +commands.scoreboard.objectives.add.usage=/scoreboard objectives add [display name ...] +commands.scoreboard.objectives.add.wrongType=Invalid objective criteria type '%s' +commands.scoreboard.objectives.add.alreadyExists=An objective with the name '%s' already exists +commands.scoreboard.objectives.add.tooLong=The name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.displayTooLong=The display name '%s' is too long for an objective, it can be at most %d characters long +commands.scoreboard.objectives.add.success=Added new objective '%s' successfully +commands.scoreboard.objectives.remove.usage=/scoreboard objectives remove +commands.scoreboard.objectives.remove.success=Removed objective '%s' successfully +commands.scoreboard.objectives.list.count=Showing %d objective(s) on scoreboard: +commands.scoreboard.objectives.list.entry=- %s: displays as '%s' and is type '%s' +commands.scoreboard.objectives.list.empty=There are no objectives on the scoreboard +commands.scoreboard.players.usage=/scoreboard players +commands.scoreboard.players.set.success=Set score of %s for player %s to %d +commands.scoreboard.players.set.usage=/scoreboard players set +commands.scoreboard.players.add.usage=/scoreboard players add +commands.scoreboard.players.remove.usage=/scoreboard players remove +commands.scoreboard.players.reset.usage=/scoreboard players reset +commands.scoreboard.players.reset.success=Reset all scores of player %s +commands.scoreboard.players.list.usage=/scoreboard players list [name] +commands.scoreboard.players.list.count=Showing %d tracked players on the scoreboard: +commands.scoreboard.players.list.empty=There are no tracked players on the scoreboard +commands.scoreboard.players.list.player.count=Showing %d tracked objective(s) for %s: +commands.scoreboard.players.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.players.list.player.empty=Player %s has no scores recorded +commands.scoreboard.teams.usage=/scoreboard teams +commands.scoreboard.teams.add.usage=/scoreboard teams add [display name ...] +commands.scoreboard.teams.add.alreadyExists=A team with the name '%s' already exists +commands.scoreboard.teams.add.tooLong=The name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.displayTooLong=The display name '%s' is too long for a team, it can be at most %d characters long +commands.scoreboard.teams.add.success=Added new team '%s' successfully +commands.scoreboard.teams.list.usage=/scoreboard teams list [name] +commands.scoreboard.teams.list.count=Showing %d teams on the scoreboard: +commands.scoreboard.teams.list.entry=- %1$s: '%2$s' has %3$d players +commands.scoreboard.teams.list.empty=There are no teams registered on the scoreboard +commands.scoreboard.teams.list.player.count=Showing %d player(s) in team %s: +commands.scoreboard.teams.list.player.entry=- %2$s: %1$d (%3$s) +commands.scoreboard.teams.list.player.empty=Team %s has no players +commands.scoreboard.teams.empty.usage=/scoreboard teams empty +commands.scoreboard.teams.empty.alreadyEmpty=Team %s is already empty, cannot remove nonexistant players +commands.scoreboard.teams.empty.success=Removed all %d player(s) from team %s +commands.scoreboard.teams.remove.usage=/scoreboard teams remove +commands.scoreboard.teams.remove.success=Removed team %s +commands.scoreboard.teams.join.usage=/scoreboard teams join [player] +commands.scoreboard.teams.join.success=Added %d player(s) to team %s: %s +commands.scoreboard.teams.join.failure=Could not add %d player(s) to team %s: %s +commands.scoreboard.teams.leave.usage=/scoreboard teams leave [player] +commands.scoreboard.teams.leave.success=Removed %d player(s) from their teams: %s +commands.scoreboard.teams.leave.failure=Could not remove %d player(s) from their teams: %s +commands.scoreboard.teams.leave.noTeam=You are not in a team +commands.scoreboard.teams.option.usage=/scoreboard teams option +commands.scoreboard.teams.option.noValue=Valid values for option %s are: %s +commands.scoreboard.teams.option.success=Set option %s for team %s to %s +commands.gamemode.success.self=Set own game mode to %s +commands.gamemode.success.other=Set %s's game mode to %s +commands.gamemode.usage=/gamemode [player] +commands.defaultgamemode.usage=/defaultgamemode +commands.defaultgamemode.success=The world's default game mode is now %s +commands.me.usage=/me +commands.help.header=--- Showing help page %d of %d (/help ) --- +commands.help.footer=Tip: Use the key while typing a command to auto-complete the command or its arguments +commands.help.usage=/help [page|command name] +commands.publish.usage=/publish +commands.publish.started=Local game hosted on port %s +commands.publish.failed=Unable to host local game +commands.debug.start=Started debug profiling +commands.debug.stop=Stopped debug profiling after %.2f seconds (%d ticks) +commands.debug.notStarted=Can't stop profiling when we haven't started yet! +commands.debug.usage=/debug +commands.tellraw.usage=/tellraw +commands.tellraw.jsonException=Invalid json: %s +commands.message.usage=/tell +commands.message.sameTarget=You can't send a private message to yourself! +commands.message.display.outgoing=You whisper to %s: %s +commands.message.display.incoming=%s whispers to you: %s +commands.difficulty.usage=/difficulty +commands.difficulty.success=Set game difficulty to %s +commands.spawnpoint.usage=/spawnpoint OR /spawnpoint OR /spawnpoint +commands.spawnpoint.success=Set %s's spawn point to (%d, %d, %d) +commands.setworldspawn.usage=/setworldspawn OR /setworldspawn +commands.setworldspawn.success=Set the world spawn point to (%d, %d, %d) +commands.gamerule.usage=/gamerule OR /gamerule +commands.gamerule.success=Game rule has been updated +commands.gamerule.norule=No game rule called '%s' is available +commands.weather.usage=/weather [duration in seconds] +commands.weather.clear=Changing to clear weather +commands.weather.rain=Changing to rainy weather +commands.weather.thunder=Changing to rain and thunder +commands.testfor.usage=/testfor +commands.testfor.failed=/testfor is only usable by commandblocks with analog output +commands.seed.usage=/seed +commands.seed.success=Seed: %s +commands.spreadplayers.usage=/spreadplayers +commands.spreadplayers.spreading.teams=Spreading %s teams %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.spreading.players=Spreading %s players %s blocks around %s,%s (min %s blocks apart) +commands.spreadplayers.success.teams=Successfully spread %s teams around %s,%s +commands.spreadplayers.success.players=Successfully spread %s players around %s,%s +commands.spreadplayers.info.teams=(Average distance between teams is %s blocks apart after %s iterations) +commands.spreadplayers.info.players=(Average distance between players is %s blocks apart after %s iterations) +commands.spreadplayers.failure.teams=Could not spread %s teams around %s,%s (too many players for space - try using spread of at most %s) +commands.spreadplayers.failure.players=Could not spread %s players around %s,%s (too many players for space - try using spread of at most %s) +commands.achievement.usage=/achievement give [player] +commands.achievement.unknownAchievement=Unknown achievement or statistic '%s' +commands.achievement.give.success.all=Successfully given all achievements to %s +commands.achievement.give.success.one=Successfully given %s the stat %s +commands.achievement.statTooLow=Player %s does not have the stat %s + +itemGroup.buildingBlocks=Building Blocks +itemGroup.decorations=Decoration Blocks +itemGroup.redstone=Redstone +itemGroup.transportation=Transportation +itemGroup.misc=Miscellaneous +itemGroup.search=Search Items +itemGroup.food=Foodstuffs +itemGroup.tools=Tools +itemGroup.combat=Combat +itemGroup.brewing=Brewing +itemGroup.materials=Materials +itemGroup.inventory=Survival Inventory + +inventory.binSlot=Destroy Item + +advMode.setCommand=Set Console Command for Block +advMode.setCommand.success=Command set: %s +advMode.command=Console Command +advMode.nearestPlayer=Use "@p" to target nearest player +advMode.randomPlayer=Use "@r" to target random player +advMode.allPlayers=Use "@a" to target all players +advMode.previousOutput=Previous Output + +advMode.notEnabled=Command blocks are not enabled on this server +advMode.notAllowed=Must be an opped player in creative mode + +mount.onboard=Press %1$s to dismount + +build.tooHigh=Height limit for building is %s blocks + +attribute.modifier.plus.0=+%d %s +attribute.modifier.plus.1=+%d%% %s +attribute.modifier.plus.2=+%d%% %s +attribute.modifier.take.0=-%d %s +attribute.modifier.take.1=-%d%% %s +attribute.modifier.take.2=-%d%% %s + +attribute.name.horse.jumpStrength=Horse Jump Strength +attribute.name.zombie.spawnReinforcements=Zombie Reinforcements +attribute.name.generic.maxHealth=Max Health +attribute.name.generic.followRange=Mob Follow Range +attribute.name.generic.knockbackResistance=Knockback Resistance +attribute.name.generic.movementSpeed=Speed +attribute.name.generic.attackDamage=Attack Damage + +screenshot.success=Saved screenshot as %s +screenshot.failure=Couldn't save screenshot: %s + +stream.user.mode.moderator=Moderator +stream.user.mode.moderator.self=Moderator on your channel +stream.user.mode.moderator.other=Moderator on %s's channel +stream.user.mode.broadcaster=Broadcaster +stream.user.mode.broadcaster.self=Broadcaster (You!) +stream.user.mode.broadcaster.other=Broadcaster +stream.user.mode.administrator=Twitch Administrator +stream.user.mode.staff=Twitch Staff +stream.user.mode.banned=Banned +stream.user.mode.banned.self=Banned on your channel +stream.user.mode.banned.other=Banned on %s's channel +stream.user.subscription.subscriber=Subscriber +stream.user.subscription.subscriber.self=Subscriber to your channel +stream.user.subscription.subscriber.other=Subscriber to %s's channel +stream.user.subscription.turbo=Twitch Turbo + +stream.unavailable.title=Twitch Broadcasting Unavailable +stream.unavailable.report_to_mojang=Report to Mojang + +stream.confirm_start=Are you sure you want to start broadcasting? + +stream.unavailable.account_not_bound=Before you can broadcast Minecraft through Twitch, you will need to link your Twitch account on mojang.com. Would you like to do that now? +stream.unavailable.account_not_bound.okay=Link Accounts +stream.unavailable.account_not_migrated=Before you can broadcast Minecraft through Twitch, you will need to migrate your Minecraft account to a Mojang account. Would you like to do that now? +stream.unavailable.account_not_migrated.okay=Migrate Account +stream.unavailable.failed_auth=Authentication to Twitch failed. Please go to mojang.com and rebind your Twitch account. +stream.unavailable.failed_auth.okay=Rebind Accounts +stream.unavailable.failed_auth_error=Unable to authenticate to Twitch. Please try again later. +stream.unavailable.initialization_failure=Unable to initialize the Twitch SDK. +stream.unavailable.initialization_failure.extra=(Reason: %s) +stream.unavailable.library_arch_mismatch=The custom java version used to launch Minecraft has a different architecture than the one used to run the launcher. Please make sure these are the same, either 32-bit or 64-bit for both. +stream.unavailable.library_failure=Unable to load the libraries needed for the integrated Twitch broadcasting service. +stream.unavailable.no_fbo=Your video card needs to support at least OpenGL version 3.0 or support Framebuffer Objects via an extension to use the integrated Twitch broadcasting. +stream.unavailable.no_fbo.version=You are currently using: %s +stream.unavailable.no_fbo.blend=Separate blending support via EXT is: %s +stream.unavailable.no_fbo.arb=Framebuffer object support via ARB is: %s +stream.unavailable.no_fbo.ext=Framebuffer object support via EXT is: %s +stream.unavailable.not_supported.windows=Unfortunately the integrated Twitch broadcasting requires a newer version of Windows than you are on. You must have at least Windows Vista or newer. +stream.unavailable.not_supported.mac=Unfortunately the integrated Twitch broadcasting on Mac requires a version of OSX newer than the one you are on. You must use 10.7 (Mac OS X Lion) or newer to be able to use this service. Would you like to visit apple.com to learn about upgrading? +stream.unavailable.not_supported.mac.okay=Upgrade +stream.unavailable.not_supported.other=Unfortunately the integrated Twitch broadcasting service requires Windows (Vista or newer) or Mac OS X (10.7/Lion or newer) +stream.unavailable.unknown=Unfortunately you cannot broadcast to Twitch at this time. And we don't know why :'( +stream.unavailable.unknown.chat=Could not start stream: %s + +stream.unavailable.soundflower.chat=Soundflower is required to be able to stream on Mac. %s +stream.unavailable.soundflower.chat.link=Please click here to install it. + +stream.userinfo.chatTooltip=Click to manage user +stream.userinfo.timeout=Timeout +stream.userinfo.ban=Ban +stream.userinfo.unban=Unban +stream.userinfo.mod=Promote to Moderator +stream.userinfo.unmod=Demote from Moderator diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/antialias.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/antialias.json new file mode 100644 index 0000000..bc31af3 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/antialias.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "antialias", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/art.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/art.json new file mode 100644 index 0000000..6d6c7ec --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/art.json @@ -0,0 +1,64 @@ +{ + "targets": [ + "0", + "1" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "0" + }, + { + "name": "outline_watercolor", + "intarget": "0", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "1", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.8, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "1", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 0.8 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "outline_combine", + "intarget": "0", + "outtarget": "1", + "auxtargets": [ + { + "name": "OutlineSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "blit", + "intarget": "1", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bits.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bits.json new file mode 100644 index 0000000..7236746 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bits.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bits", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs.json new file mode 100644 index 0000000..d6260aa --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs2.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs2.json new file mode 100644 index 0000000..3464ae3 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blobs2.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blobs2", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blur.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blur.json new file mode 100644 index 0000000..bca04d5 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/blur.json @@ -0,0 +1,37 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 20.0 ] + } + ] + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bumpy.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bumpy.json new file mode 100644 index 0000000..0870985 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/bumpy.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "bumpy", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/color_convolve.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/color_convolve.json new file mode 100644 index 0000000..9f00212 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/color_convolve.json @@ -0,0 +1,20 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { "name": "Saturation", "values": [ 1.4 ] } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/deconverge.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/deconverge.json new file mode 100644 index 0000000..4eb2b8d --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/deconverge.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "deconverge", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/desaturate.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/desaturate.json new file mode 100644 index 0000000..675018f --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/desaturate.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "Saturation", + "values": [ 0.2 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/flip.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/flip.json new file mode 100644 index 0000000..e382435 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/flip.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "flip", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/fxaa.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/fxaa.json new file mode 100644 index 0000000..83292b7 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/fxaa.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "fxaa", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/green.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/green.json new file mode 100644 index 0000000..5d0af6c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/green.json @@ -0,0 +1,41 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "color_convolve", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "RedMatrix", + "values": [ 0.0, 0.0, 0.0 ] + }, + { + "name": "GreenMatrix", + "values": [ 0.3, 0.59, 0.11 ] + }, + { + "name": "BlueMatrix", + "values": [ 0.0, 0.0, 0.0 ] + } + ] + }, + { + "name": "bits", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/invert.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/invert.json new file mode 100644 index 0000000..2ab63fb --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/invert.json @@ -0,0 +1,23 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "invert", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "InverseAmount", + "values": [ 0.8 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/notch.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/notch.json new file mode 100644 index 0000000..164943c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/notch.json @@ -0,0 +1,26 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "notch", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "DitherSampler", + "id": "dither", + "width": 4, + "height": 4, + "bilinear": false + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/ntsc.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/ntsc.json new file mode 100644 index 0000000..abc005b --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/ntsc.json @@ -0,0 +1,92 @@ +{ + "targets": [ + "swap", + "swap2", + "previous" + ], + "passes": [ + { + "name": "ntsc_encode", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "ntsc_decode", + "intarget": "swap", + "outtarget": "swap2", + "auxtargets": [ + { + "name": "BaseSampler", + "id": "minecraft:main" + } + ] + }, + { + "name": "color_convolve", + "intarget": "swap2", + "outtarget": "swap" + }, + { + "name": "deconverge", + "intarget": "swap", + "outtarget": "minecraft:main" + }, + { + "name": "blur", + "intarget": "minecraft:main", + "outtarget": "swap", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 1.0, 0.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "blur", + "intarget": "swap", + "outtarget": "minecraft:main", + "uniforms": [ + { + "name": "BlurDir", + "values": [ 0.0, 1.0 ] + }, + { + "name": "Radius", + "values": [ 10.0 ] + } + ] + }, + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "phosphor", + "intarget": "swap", + "outtarget": "minecraft:main", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.4, 0.4, 0.4 ] + } + ] + }, + { + "name": "blit", + "intarget": "minecraft:main", + "outtarget": "previous" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/outline.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/outline.json new file mode 100644 index 0000000..e299c0f --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/outline.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "outline", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/pencil.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/pencil.json new file mode 100644 index 0000000..1fc5b13 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/pencil.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "outline_soft", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/phosphor.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/phosphor.json new file mode 100644 index 0000000..0fa09c4 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/phosphor.json @@ -0,0 +1,35 @@ +{ + "targets": [ + "swap", + "previous" + ], + "passes": [ + { + "name": "phosphor", + "intarget": "minecraft:main", + "outtarget": "swap", + "auxtargets": [ + { + "name": "PrevSampler", + "id": "previous" + } + ], + "uniforms": [ + { + "name": "Phosphor", + "values": [ 0.95, 0.95, 0.95 ] + } + ] + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "previous" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/scan_pincushion.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/scan_pincushion.json new file mode 100644 index 0000000..b5d0a3e --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/scan_pincushion.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "scan_pincushion", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/sobel.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/sobel.json new file mode 100644 index 0000000..5c390a4 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/sobel.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "sobel", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/wobble.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/wobble.json new file mode 100644 index 0000000..1fc4534 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/post/wobble.json @@ -0,0 +1,17 @@ +{ + "targets": [ + "swap" + ], + "passes": [ + { + "name": "wobble", + "intarget": "minecraft:main", + "outtarget": "swap" + }, + { + "name": "blit", + "intarget": "swap", + "outtarget": "minecraft:main" + } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.fsh new file mode 100644 index 0000000..44b4141 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.fsh @@ -0,0 +1,29 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D (DiffuseSampler, texCoord); + vec4 u1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y )); + vec4 u2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, -oneTexel.y * 2.0)); + vec4 d1 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y )); + vec4 d2 = texture2D (DiffuseSampler, texCoord + vec2 ( 0.0, oneTexel.y * 2.0)); + vec4 l1 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x, 0.0)); + vec4 l2 = texture2D (DiffuseSampler, texCoord + vec2 (-oneTexel.x * 2.0, 0.0)); + vec4 r1 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x, 0.0)); + vec4 r2 = texture2D (DiffuseSampler, texCoord + vec2 ( oneTexel.x * 2.0, 0.0)); + + vec4 v1 = mix (c, mix (l1, l2, 0.667), 0.75); + vec4 v2 = mix (c, mix (r1, r2, 0.667), 0.75); + vec4 v3 = mix (c, mix (u1, u2, 0.667), 0.75); + vec4 v4 = mix (c, mix (d1, d2, 0.667), 0.75); + + vec4 v5 = mix (v1, v2, 0.5); + vec4 v6 = mix (v3, v4, 0.5); + + vec4 color = mix (v5, v6, 0.5); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.json new file mode 100644 index 0000000..6916fd9 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/antialias.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "antialias", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.fsh new file mode 100644 index 0000000..96ef3cb --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Resolution = 4.0; +uniform float Saturation = 1.5; +uniform float MosaicSize = 8.0; + +void main() { + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + + baseTexel = baseTexel - fract(baseTexel * Resolution) / Resolution; + float luma = dot(baseTexel.rgb, vec3(0.3, 0.59, 0.11)); + vec3 chroma = (baseTexel.rgb - luma) * Saturation; + baseTexel = vec4(luma + chroma, baseTexel.a); + + gl_FragColor = baseTexel; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.json new file mode 100644 index 0000000..c19239b --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bits.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "bits", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Resolution", "type": "float", "count": 1, "values": [ 4.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.5 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 8.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.fsh new file mode 100644 index 0000000..a0d5e79 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.fsh @@ -0,0 +1,9 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +void main(){ + gl_FragColor = texture2D(DiffuseSampler, texCoord); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.json new file mode 100644 index 0000000..a61043e --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.json @@ -0,0 +1,17 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.vsh new file mode 100644 index 0000000..01a16db --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blit.vsh @@ -0,0 +1,16 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.fsh new file mode 100644 index 0000000..82a1cc7 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.fsh @@ -0,0 +1,43 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 v1 = min(l, r); + vec4 v2 = min(u, d); + vec4 v3 = min(v1, v2); + + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 dr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 dl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + + vec4 v4 = min(ul, dr); + vec4 v5 = min(ur, dl); + vec4 v6 = min(v4, v5); + + vec4 v7 = min(v3, v6); + + vec4 uu = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y * 2.0)); + vec4 dd = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y * 2.0)); + vec4 ll = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x * 2.0, 0.0)); + vec4 rr = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x * 2.0, 0.0)); + + vec4 v8 = min(uu, dd); + vec4 v9 = min(ll, rr); + vec4 v10 = min(v8, v9); + + vec4 v11 = min(v7, v10); + + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 color = min(c, v11); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.json new file mode 100644 index 0000000..6a5f245 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.fsh new file mode 100644 index 0000000..1fb217d --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.fsh @@ -0,0 +1,30 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float Radius; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 maxVal = c; + for(float u = 0.0; u <= Radius; u += 1.0) { + for(float v = 0.0; v <= Radius; v += 1.0) { + float weight = (((sqrt(u * u + v * v) / (Radius)) > 1.0) ? 0.0 : 1.0); + + vec4 s0 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, -v * oneTexel.y)); + vec4 s1 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, v * oneTexel.y)); + vec4 s2 = texture2D(DiffuseSampler, texCoord + vec2(-u * oneTexel.x, v * oneTexel.y)); + vec4 s3 = texture2D(DiffuseSampler, texCoord + vec2( u * oneTexel.x, -v * oneTexel.y)); + + vec4 o0 = max(s0, s1); + vec4 o1 = max(s2, s3); + vec4 tempMax = max(o0, o1); + maxVal = mix(maxVal, max(maxVal, tempMax), weight); + } + } + + gl_FragColor = vec4(maxVal.rgb, c.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.json new file mode 100644 index 0000000..6df4594 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blobs2.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blobs", + "fragment": "blobs2", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 7.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bloom.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bloom.json new file mode 100644 index 0000000..4dd764f --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bloom.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "CycleSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.fsh new file mode 100644 index 0000000..1178391 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec2 BlurDir; +uniform float Radius; + +void main() { + vec4 blurred = vec4(0.0); + float totalStrength = 0.0; + for(float r = -Radius; r <= Radius; r += 1.0) { + float strength = abs(1.0 - r / Radius); + strength = strength * strength; + totalStrength = totalStrength + strength; + blurred = blurred + texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir) * strength; + } + gl_FragColor = vec4(blurred.rgb / totalStrength, texture2D(DiffuseSampler, texCoord).a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.json new file mode 100644 index 0000000..51a2323 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/blur.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "blur", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "BlurDir", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Radius", "type": "float", "count": 1, "values": [ 5.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.fsh new file mode 100644 index 0000000..56fd5a9 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.fsh @@ -0,0 +1,34 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 c = texture2D(DiffuseSampler, texCoord); + vec4 u = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 d = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 l = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 r = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + + vec4 nc = normalize(c); + vec4 nu = normalize(u); + vec4 nd = normalize(d); + vec4 nl = normalize(l); + vec4 nr = normalize(r); + + float du = dot(nc, nu); + float dd = dot(nc, nd); + float dl = dot(nc, nl); + float dr = dot(nc, nr); + + float i = 64.0; + + float f = 1.0; + f += (du * i) - (dd * i); + f += (dr * i) - (dl * i); + + vec4 color = c * clamp(f, 0.5, 2); + gl_FragColor = vec4(color.rgb, c.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.json new file mode 100644 index 0000000..59cae19 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "bumpy", + "fragment": "bumpy", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.vsh new file mode 100644 index 0000000..3ece274 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/bumpy.vsh @@ -0,0 +1,17 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.fsh new file mode 100644 index 0000000..bfc3de5 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.fsh @@ -0,0 +1,36 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Gray = vec3(0.3, 0.59, 0.11); +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); +uniform vec3 Offset = vec3(0.0, 0.0, 0.0); +uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0); +uniform float Saturation = 1.8; + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + // Color Matrix + float RedValue = dot(InTexel.rgb, RedMatrix); + float GreenValue = dot(InTexel.rgb, GreenMatrix); + float BlueValue = dot(InTexel.rgb, BlueMatrix); + vec3 OutColor = vec3(RedValue, GreenValue, BlueValue); + + // Offset & Scale + OutColor = (OutColor * ColorScale) + Offset; + + // Saturation + float Luma = dot(OutColor, Gray); + vec3 Chroma = OutColor - Luma; + OutColor = (Chroma * Saturation) + Luma; + + gl_FragColor = vec4(OutColor, InTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.json new file mode 100644 index 0000000..e3a32c2 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/color_convolve.json @@ -0,0 +1,25 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "color_convolve", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Gray", "type": "float", "count": 3, "values": [ 0.3, 0.59, 0.11 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 0.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] }, + { "name": "Offset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] }, + { "name": "ColorScale", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "Saturation", "type": "float", "count": 1, "values": [ 1.8 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.fsh new file mode 100644 index 0000000..6b5a207 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.fsh @@ -0,0 +1,28 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 ConvergeX = vec3(-1.0, 0.0, 0.5); +uniform vec3 ConvergeY = vec3( 0.0, -1.0, 0.5); +uniform vec3 RadialConvergeX = vec3(1.0, 1.0, 1.0); +uniform vec3 RadialConvergeY = vec3(1.0, 1.0, 1.0); + +void main() { + vec3 CoordX = texCoord.x * RadialConvergeX; + vec3 CoordY = texCoord.y * RadialConvergeY; + + CoordX += ConvergeX * oneTexel.x - (RadialConvergeX - 1.0) * 0.5; + CoordY += ConvergeY * oneTexel.y - (RadialConvergeY - 1.0) * 0.5; + + float RedValue = texture2D(DiffuseSampler, vec2(CoordX.x, CoordY.x)).r; + float GreenValue = texture2D(DiffuseSampler, vec2(CoordX.y, CoordY.y)).g; + float BlueValue = texture2D(DiffuseSampler, vec2(CoordX.z, CoordY.z)).b; + float AlphaValue = texture2D(DiffuseSampler, texCoord).a; + + gl_FragColor = vec4(RedValue, GreenValue, BlueValue, AlphaValue); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.json new file mode 100644 index 0000000..e23e9c5 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/deconverge.json @@ -0,0 +1,22 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "deconverge", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ConvergeX", "type": "float", "count": 3, "values": [ -4.0, 0.0, 2.0 ] }, + { "name": "ConvergeY", "type": "float", "count": 3, "values": [ 0.0, -4.0, 2.0 ] }, + { "name": "RadialConvergeX", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] }, + { "name": "RadialConvergeY", "type": "float", "count": 3, "values": [ 1.0, 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.fsh new file mode 100644 index 0000000..5502444 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.fsh @@ -0,0 +1,17 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +void main() { + vec3 Texel0 = texture2D(DiffuseSampler, texCoord).rgb; + vec3 Texel1 = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)).rgb; + vec3 Texel2 = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)).rgb; + vec3 Texel3 = texture2D(DiffuseSampler, texCoord + oneTexel).rgb; + + gl_FragColor = vec4((Texel0 + Texel1 + Texel2 + Texel3) * 0.25, Texel0.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.json new file mode 100644 index 0000000..9099ec1 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "downscale", + "fragment": "downscale", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.vsh new file mode 100644 index 0000000..ec09759 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/downscale.vsh @@ -0,0 +1,19 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + texCoord = outPos.xy * 0.5 + 0.5; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.json new file mode 100644 index 0000000..de87ed0 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "flip", + "fragment": "blit", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "ScreenSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.vsh new file mode 100644 index 0000000..bd0a4d3 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/flip.vsh @@ -0,0 +1,22 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; +uniform vec2 ScreenSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 inOutRatio = OutSize / InSize; + vec2 inScreenRatio = ScreenSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * inOutRatio.x; + texCoord.y = texCoord.y * inOutRatio.y; + texCoord.y -= 1.0 - inScreenRatio.y; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.fsh new file mode 100644 index 0000000..6fd9f80 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.fsh @@ -0,0 +1,84 @@ +#extension GL_EXT_gpu_shader4 : enable + +uniform sampler2D DiffuseSampler; +uniform vec2 OutSize; + +uniform float VxOffset; +uniform float SpanMax; +uniform float ReduceMul; + +varying vec2 texCoord; +varying vec4 posPos; + +#define FxaaTex(t, p) texture2D(t, p) + +#if __VERSION__ >= 130 + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) textureOffset(t, p, o) +#elif defined(GL_EXT_gpu_shader4) + #define OffsetVec(a, b) ivec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o) +#else + #define OffsetVec(a, b) vec2(a, b) + #define FxaaTexOff(t, p, o, r) texture2D(t, p + o * r) +#endif + +vec3 FxaaPixelShader( + vec4 posPos, // Output of FxaaVertexShader interpolated across screen. + sampler2D tex, // Input texture. + vec2 rcpFrame) // Constant {1.0/frameWidth, 1.0/frameHeight}. +{ + + #define FXAA_REDUCE_MIN (1.0/128.0) + //#define FXAA_REDUCE_MUL (1.0/8.0) + //#define FXAA_SPAN_MAX 8.0 + + vec3 rgbNW = FxaaTex(tex, posPos.zw).xyz; + vec3 rgbNE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,0), rcpFrame.xy).xyz; + vec3 rgbSW = FxaaTexOff(tex, posPos.zw, OffsetVec(0,1), rcpFrame.xy).xyz; + vec3 rgbSE = FxaaTexOff(tex, posPos.zw, OffsetVec(1,1), rcpFrame.xy).xyz; + + vec3 rgbM = FxaaTex(tex, posPos.xy).xyz; + + vec3 luma = vec3(0.299, 0.587, 0.114); + float lumaNW = dot(rgbNW, luma); + float lumaNE = dot(rgbNE, luma); + float lumaSW = dot(rgbSW, luma); + float lumaSE = dot(rgbSE, luma); + float lumaM = dot(rgbM, luma); + + float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE))); + float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE))); + + vec2 dir; + dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE)); + dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE)); + + float dirReduce = max( + (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * ReduceMul), + FXAA_REDUCE_MIN); + float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce); + dir = min(vec2( SpanMax, SpanMax), + max(vec2(-SpanMax, -SpanMax), + dir * rcpDirMin)) * rcpFrame.xy; + + vec3 rgbA = (1.0/2.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(1.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(2.0/3.0 - 0.5)).xyz); + vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * ( + FxaaTex(tex, posPos.xy + dir * vec2(0.0/3.0 - 0.5)).xyz + + FxaaTex(tex, posPos.xy + dir * vec2(3.0/3.0 - 0.5)).xyz); + + float lumaB = dot(rgbB, luma); + + if ((lumaB < lumaMin) || (lumaB > lumaMax)) { + return rgbA; + } else { + return rgbB; + } +} + +void main() { + vec4 baseTexel = texture2D(DiffuseSampler, posPos.xy); + gl_FragColor = vec4(FxaaPixelShader(posPos, DiffuseSampler, 1.0 / OutSize), baseTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.json new file mode 100644 index 0000000..eb85073 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "fxaa", + "fragment": "fxaa", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "SpanMax", "type": "float", "count": 1, "values": [ 8.0 ] }, + { "name": "SubPixelShift", "type": "float", "count": 1, "values": [ 0.25 ] }, + { "name": "ReduceMul", "type": "float", "count": 1, "values": [ 0.125 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.vsh new file mode 100644 index 0000000..9fe81ea --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/fxaa.vsh @@ -0,0 +1,21 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 OutSize; + +uniform float SubPixelShift; + +varying vec2 texCoord; +varying vec4 posPos; + +void main() { + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; + posPos.xy = texCoord.xy; + posPos.zw = texCoord.xy - (1.0/OutSize * vec2(0.5 + SubPixelShift)); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.fsh new file mode 100644 index 0000000..ab2b43b --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.fsh @@ -0,0 +1,14 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; + +uniform float InverseAmount; + +void main(){ + vec4 diffuseColor = texture2D(DiffuseSampler, texCoord); + vec4 invertColor = 1.0 - diffuseColor; + vec4 outColor = mix(diffuseColor, invertColor, InverseAmount); + gl_FragColor = vec4(outColor.rgb, diffuseColor.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.json new file mode 100644 index 0000000..f9ab649 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "invert", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "InverseAmount", "type": "float", "count": 1, "values": [ 0.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.vsh new file mode 100644 index 0000000..5110ef5 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/invert.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + vec2 sizeRatio = OutSize / InSize; + texCoord = Position.xy / OutSize; + texCoord.x = texCoord.x * sizeRatio.x; + texCoord.y = texCoord.y * sizeRatio.y; + texCoord.y = sizeRatio.y - texCoord.y; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.fsh new file mode 100644 index 0000000..a732194 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.fsh @@ -0,0 +1,23 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DitherSampler; + +varying vec2 texCoord; + +uniform vec2 InSize; + +void main() { + vec2 halfSize = InSize * 0.5; + + vec2 steppedCoord = texCoord; + steppedCoord.x = float(int(steppedCoord.x*halfSize.x)) / halfSize.x; + steppedCoord.y = float(int(steppedCoord.y*halfSize.y)) / halfSize.y; + + vec4 noise = texture2D(DitherSampler, steppedCoord * halfSize / 4.0); + vec4 col = texture2D(DiffuseSampler, steppedCoord) + noise * vec4(1.0/12.0, 1.0/12.0, 1.0/6.0, 1.0); + float r = float(int(col.r*8.0))/8.0; + float g = float(int(col.g*8.0))/8.0; + float b = float(int(col.b*4.0))/4.0; + gl_FragColor = vec4(r, g, b, col.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.json new file mode 100644 index 0000000..e6ff9a8 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/notch.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "notch", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DitherSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.fsh new file mode 100644 index 0000000..57d3dd5 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.fsh @@ -0,0 +1,132 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D BaseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 One = vec4(1.0); + +const float Pi = 3.1415926535; +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float NotchWidth = 2.0; +const float NotchUpperFrequency = 3.59754545 + NotchWidth; +const float NotchLowerFrequency = 3.59754545 - NotchWidth; +const float YFrequency = 6.0; +const float IFrequency = 1.2; +const float QFrequency = 0.6; +const float ScanTime = 52.6; +const vec3 YIQ2R = vec3(1.0, 0.956, 0.621); +const vec3 YIQ2G = vec3(1.0, -0.272, -0.647); +const vec3 YIQ2B = vec3(1.0, -1.106, 1.703); +const vec4 MinC = vec4(-1.1183); +const vec4 CRange = vec4(3.2366); +const float Pi2Length = Pi2 / 83.0; +const vec4 NotchOffset = vec4(0.0, 1.0, 2.0, 3.0); +const vec4 W = vec4(Pi2 * CCFrequency * ScanTime); + +void main() { + vec4 YAccum = Zero; + vec4 IAccum = Zero; + vec4 QAccum = Zero; + float QuadXSize = InSize.x * 4.0; + float TimePerSample = ScanTime / QuadXSize; + + // Frequency cutoffs for the individual portions of the signal that we extract. + // Y1 and Y2 are the positive and negative frequency limits of the notch filter on Y. + // Y3 is the center of the frequency response of the Y filter. + // I is the center of the frequency response of the I filter. + // Q is the center of the frequency response of the Q filter. + float Fc_y1 = NotchLowerFrequency * TimePerSample; + float Fc_y2 = NotchUpperFrequency * TimePerSample; + float Fc_y3 = YFrequency * TimePerSample; + float Fc_i = IFrequency * TimePerSample; + float Fc_q = QFrequency * TimePerSample; + float Pi2Fc_y1 = Fc_y1 * Pi2; + float Pi2Fc_y2 = Fc_y2 * Pi2; + float Pi2Fc_y3 = Fc_y3 * Pi2; + float Pi2Fc_i = Fc_i * Pi2; + float Pi2Fc_q = Fc_q * Pi2; + float Fc_y1_2 = Fc_y1 * 2.0; + float Fc_y2_2 = Fc_y2 * 2.0; + float Fc_y3_2 = Fc_y3 * 2.0; + float Fc_i_2 = Fc_i * 2.0; + float Fc_q_2 = Fc_q * 2.0; + vec4 CoordY = vec4(texCoord.y); + + vec4 BaseTexel = texture2D(DiffuseSampler, texCoord); + // 83 composite samples wide, 4 composite pixels per texel + for (float n = -41.0; n < 42.0; n += 4.0) + { + vec4 n4 = n + NotchOffset; + vec4 CoordX = texCoord.x + oneTexel.x * n4 * 0.25; + vec2 TexCoord = vec2(CoordX.x, CoordY.y); + vec4 C = texture2D(DiffuseSampler, TexCoord) * CRange + MinC; + vec4 WT = W * (CoordX + A2 * CoordY * InSize.y + B); + vec4 Cosine = 0.54 + 0.46 * cos(Pi2Length * n4); + + vec4 SincYIn1 = Pi2Fc_y1 * n4; + vec4 SincYIn2 = Pi2Fc_y2 * n4; + vec4 SincYIn3 = Pi2Fc_y3 * n4; + vec4 SincY1 = sin(SincYIn1) / SincYIn1; + vec4 SincY2 = sin(SincYIn2) / SincYIn2; + vec4 SincY3 = sin(SincYIn3) / SincYIn3; + + // These zero-checks could be made more efficient, but we are trying to support + // downlevel GLSL + if(SincYIn1.x == 0.0) SincY1.x = 1.0; + if(SincYIn1.y == 0.0) SincY1.y = 1.0; + if(SincYIn1.z == 0.0) SincY1.z = 1.0; + if(SincYIn1.w == 0.0) SincY1.w = 1.0; + if(SincYIn2.x == 0.0) SincY2.x = 1.0; + if(SincYIn2.y == 0.0) SincY2.y = 1.0; + if(SincYIn2.z == 0.0) SincY2.z = 1.0; + if(SincYIn2.w == 0.0) SincY2.w = 1.0; + if(SincYIn3.x == 0.0) SincY3.x = 1.0; + if(SincYIn3.y == 0.0) SincY3.y = 1.0; + if(SincYIn3.z == 0.0) SincY3.z = 1.0; + if(SincYIn3.w == 0.0) SincY3.w = 1.0; + vec4 IdealY = (Fc_y1_2 * SincY1 - Fc_y2_2 * SincY2) + Fc_y3_2 * SincY3; + vec4 FilterY = Cosine * IdealY; + + vec4 SincIIn = Pi2Fc_i * n4; + vec4 SincI = sin(SincIIn) / SincIIn; + if(SincIIn.x == 0.0) SincI.x = 1.0; + if(SincIIn.y == 0.0) SincI.y = 1.0; + if(SincIIn.z == 0.0) SincI.z = 1.0; + if(SincIIn.w == 0.0) SincI.w = 1.0; + vec4 IdealI = Fc_i_2 * SincI; + vec4 FilterI = Cosine * IdealI; + + vec4 SincQIn = Pi2Fc_q * n4; + vec4 SincQ = sin(SincQIn) / SincQIn; + if(SincQIn.x == 0.0) SincQ.x = 1.0; + if(SincQIn.y == 0.0) SincQ.y = 1.0; + if(SincQIn.z == 0.0) SincQ.z = 1.0; + if(SincQIn.w == 0.0) SincQ.w = 1.0; + vec4 IdealQ = Fc_q_2 * SincQ; + vec4 FilterQ = Cosine * IdealQ; + + YAccum += C * FilterY; + IAccum += C * cos(WT) * FilterI; + QAccum += C * sin(WT) * FilterQ; + } + + float Y = dot(YAccum, One); + float I = dot(IAccum, One) * 2.0; + float Q = dot(QAccum, One) * 2.0; + + vec3 YIQ = vec3(Y, I, Q); + vec3 OutRGB = vec3(dot(YIQ, YIQ2R), dot(YIQ, YIQ2G), dot(YIQ, YIQ2B)); + + gl_FragColor = vec4(OutRGB, BaseTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.json new file mode 100644 index 0000000..2870923 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_decode.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_decode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "BaseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.fsh new file mode 100644 index 0000000..450bc6d --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.fsh @@ -0,0 +1,50 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const float Pi2 = 6.283185307; + +const vec4 A2 = vec4(1.0); +const vec4 B = vec4(0.5); +const float P = 1.0; +const float CCFrequency = 3.59754545; +const float ScanTime = 52.6; +const float Pi2ScanTime = Pi2 * ScanTime; +const vec4 YTransform = vec4(0.299, 0.587, 0.114, 0.0); +const vec4 ITransform = vec4(0.595716, -0.274453, -0.321263, 0.0); +const vec4 QTransform = vec4(0.211456, -0.522591, 0.31135, 0.0); +const vec4 MinC = vec4(-1.1183); +const vec4 InvCRange = vec4(1.0 / 3.2366); + +void main() { + vec2 InverseP = vec2(P, 0.0) * oneTexel; + + // UVs for four linearly-interpolated samples spread 0.25 texels apart + vec2 C0 = texCoord; + vec2 C1 = texCoord + InverseP * 0.25; + vec2 C2 = texCoord + InverseP * 0.50; + vec2 C3 = texCoord + InverseP * 0.75; + vec4 Cx = vec4(C0.x, C1.x, C2.x, C3.x); + vec4 Cy = vec4(C0.y, C1.y, C2.y, C3.y); + + vec4 Texel0 = texture2D(DiffuseSampler, C0); + vec4 Texel1 = texture2D(DiffuseSampler, C1); + vec4 Texel2 = texture2D(DiffuseSampler, C2); + vec4 Texel3 = texture2D(DiffuseSampler, C3); + + // Calculate the expected time of the sample. + vec4 T = A2 * Cy * vec4(InSize.y) + B + Cx; + vec4 W = vec4(Pi2ScanTime * CCFrequency); + vec4 TW = T * W; + vec4 Y = vec4(dot(Texel0, YTransform), dot(Texel1, YTransform), dot(Texel2, YTransform), dot(Texel3, YTransform)); + vec4 I = vec4(dot(Texel0, ITransform), dot(Texel1, ITransform), dot(Texel2, ITransform), dot(Texel3, ITransform)); + vec4 Q = vec4(dot(Texel0, QTransform), dot(Texel1, QTransform), dot(Texel2, QTransform), dot(Texel3, QTransform)); + + vec4 Encoded = Y + I * cos(TW) + Q * sin(TW); + gl_FragColor = (Encoded - MinC) * InvCRange; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.json new file mode 100644 index 0000000..2cda4df --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/ntsc_encode.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "ntsc_encode", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.fsh new file mode 100644 index 0000000..6285820 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.fsh @@ -0,0 +1,21 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 uDiff = center - up; + vec4 dDiff = center - down; + vec4 lDiff = center - left; + vec4 rDiff = center - right; + vec4 sum = uDiff + dDiff + lDiff + rDiff; + vec3 clamped = clamp(center.rgb - sum.rgb, 0.0, 1.0); + gl_FragColor = vec4(clamped, center.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.json new file mode 100644 index 0000000..7d41382 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.fsh new file mode 100644 index 0000000..d4b7682 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.fsh @@ -0,0 +1,13 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OutlineSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 diffuseTexel = texture2D(DiffuseSampler, texCoord); + vec4 outlineTexel = texture2D(OutlineSampler, texCoord); + gl_FragColor = vec4(diffuseTexel.rgb + diffuseTexel.rgb * outlineTexel.rgb * vec3(0.75), diffuseTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.json new file mode 100644 index 0000000..d52f4a3 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_combine.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_combine", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "OutlineSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.fsh new file mode 100644 index 0000000..92031c1 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.fsh @@ -0,0 +1,46 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; +uniform float LumaLevel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 uDiff = abs(center - up); + vec4 dDiff = abs(center - down); + vec4 lDiff = abs(center - left); + vec4 rDiff = abs(center - right); + vec4 u2Diff = abs(center - up2); + vec4 d2Diff = abs(center - down2); + vec4 l2Diff = abs(center - left2); + vec4 r2Diff = abs(center - right2); + vec4 sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff; + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float sumLuma = 1.0 - dot(clamp(sum, 0.0, 1.0), gray); + + // Get luminance of center pixel and adjust + float centerLuma = dot(center + (center - pow(center, vec4(LumaRamp))), gray); + + // Quantize the luma value + centerLuma = centerLuma - fract(centerLuma * LumaLevel) / LumaLevel; + + // Re-scale to full range + centerLuma = centerLuma * (LumaLevel / (LumaLevel - 1.0)); + + // Blend with outline + centerLuma = centerLuma * sumLuma; + + gl_FragColor = vec4(centerLuma, centerLuma, centerLuma, center.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.json new file mode 100644 index 0000000..c58bb5d --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_soft.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_soft", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] }, + { "name": "LumaLevel", "type": "float", "count": 1, "values": [ 4.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.fsh new file mode 100644 index 0000000..b7d47d2 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.fsh @@ -0,0 +1,41 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform float LumaRamp; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 up = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y)); + vec4 up2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, -oneTexel.y) * 2.0); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0)); + vec4 down2 = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, 0.0) * 2.0); + vec4 left = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0)); + vec4 left2 = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, 0.0) * 2.0); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y)); + vec4 right2 = texture2D(DiffuseSampler, texCoord + vec2( 0.0, oneTexel.y) * 2.0); + vec4 ul = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, -oneTexel.y)); + vec4 ur = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, -oneTexel.y)); + vec4 bl = texture2D(DiffuseSampler, texCoord + vec2(-oneTexel.x, oneTexel.y)); + vec4 br = texture2D(DiffuseSampler, texCoord + vec2( oneTexel.x, oneTexel.y)); + vec4 gray = vec4(0.3, 0.59, 0.11, 0.0); + float uDiff = dot(abs(center - up), gray); + float dDiff = dot(abs(center - down), gray); + float lDiff = dot(abs(center - left), gray); + float rDiff = dot(abs(center - right), gray); + float u2Diff = dot(abs(center - up2), gray); + float d2Diff = dot(abs(center - down2), gray); + float l2Diff = dot(abs(center - left2), gray); + float r2Diff = dot(abs(center - right2), gray); + float ulDiff = dot(abs(center - ul), gray); + float urDiff = dot(abs(center - ur), gray); + float blDiff = dot(abs(center - bl), gray); + float brDiff = dot(abs(center - br), gray); + float sum = uDiff + dDiff + lDiff + rDiff + u2Diff + d2Diff + l2Diff + r2Diff + ulDiff + urDiff + blDiff + brDiff; + float sumLuma = clamp(sum, 0.0, 1.0); + + gl_FragColor = vec4(sumLuma, sumLuma, sumLuma, center.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.json new file mode 100644 index 0000000..2954352 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/outline_watercolor.json @@ -0,0 +1,19 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "outline_watercolor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "LumaRamp", "type": "float", "count": 1, "values": [ 16.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.fsh new file mode 100644 index 0000000..311d26d --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.fsh @@ -0,0 +1,26 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D OverlaySampler; + +uniform vec2 InSize; + +varying vec2 texCoord; + +uniform float MosaicSize = 1.0; +uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0); +uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0); +uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0); + +void main(){ + vec2 mosaicInSize = InSize / MosaicSize; + vec2 fractPix = fract(texCoord * mosaicInSize) / mosaicInSize; + + vec4 baseTexel = texture2D(DiffuseSampler, texCoord - fractPix); + float red = dot(baseTexel.rgb, RedMatrix); + float green = dot(baseTexel.rgb, GreenMatrix); + float blue = dot(baseTexel.rgb, BlueMatrix); + + vec4 overlayTexel = texture2D(OverlaySampler, vec2(texCoord.x, 1.0 - texCoord.y)); + gl_FragColor = mix(vec4(red, green, blue, baseTexel.a), overlayTexel, overlayTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.json new file mode 100644 index 0000000..ceb8d0f --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/overlay.json @@ -0,0 +1,23 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "blit", + "fragment": "overlay", + "attributes": [ "Position" ], + "samplers": [ + { "name": "OverlaySampler" }, + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "MosaicSize", "type": "float", "count": 1, "values": [ 1.0 ] }, + { "name": "RedMatrix", "type": "float", "count": 3, "values": [ 1.0, 0.0, 0.0 ] }, + { "name": "GreenMatrix", "type": "float", "count": 3, "values": [ 0.0, 1.0, 1.0 ] }, + { "name": "BlueMatrix", "type": "float", "count": 3, "values": [ 0.0, 0.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.fsh new file mode 100644 index 0000000..7721436 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.fsh @@ -0,0 +1,19 @@ +#version 120 + +uniform sampler2D DiffuseSampler; +uniform sampler2D PrevSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform vec3 Phosphor = vec3(0.7, 0.7, 0.7); +uniform float LerpFactor = 1.0; + +void main() { + vec4 CurrTexel = texture2D(DiffuseSampler, texCoord); + vec4 PrevTexel = texture2D(PrevSampler, texCoord); + + gl_FragColor = vec4(max(PrevTexel.rgb * Phosphor, CurrTexel.rgb), CurrTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.json new file mode 100644 index 0000000..c3a01f2 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/phosphor.json @@ -0,0 +1,20 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "phosphor", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "PrevSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Phosphor", "type": "float", "count": 3, "values": [ 0.3, 0.3, 0.3 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.fsh new file mode 100644 index 0000000..0911697 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.fsh @@ -0,0 +1,64 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +const vec4 Zero = vec4(0.0); +const vec4 Half = vec4(0.5); +const vec4 One = vec4(1.0); +const vec4 Two = vec4(2.0); + +const float Pi = 3.1415926535; +const float PincushionAmount = 0.02; +const float CurvatureAmount = 0.02; +const float ScanlineAmount = 0.8; +const float ScanlineScale = 1.0; +const float ScanlineHeight = 1.0; +const float ScanlineBrightScale = 1.0; +const float ScanlineBrightOffset = 0.0; +const float ScanlineOffset = 0.0; +const vec3 Floor = vec3(0.05, 0.05, 0.05); +const vec3 Power = vec3(0.8, 0.8, 0.8); + +void main() { + vec4 InTexel = texture2D(DiffuseSampler, texCoord); + + vec2 PinUnitCoord = texCoord * Two.xy - One.xy; + float PincushionR2 = pow(length(PinUnitCoord), 2.0); + vec2 PincushionCurve = PinUnitCoord * PincushionAmount * PincushionR2; + vec2 ScanCoord = texCoord; + + ScanCoord *= One.xy - PincushionAmount * 0.2; + ScanCoord += PincushionAmount * 0.1; + ScanCoord += PincushionCurve; + + vec2 CurvatureClipCurve = PinUnitCoord * CurvatureAmount * PincushionR2; + vec2 ScreenClipCoord = texCoord; + ScreenClipCoord -= Half.xy; + ScreenClipCoord *= One.xy - CurvatureAmount * 0.2; + ScreenClipCoord += Half.xy; + ScreenClipCoord += CurvatureClipCurve; + + // -- Alpha Clipping -- + if (ScanCoord.x < 0.0) discard; + if (ScanCoord.y < 0.0) discard; + if (ScanCoord.x > 1.0) discard; + if (ScanCoord.y > 1.0) discard; + + // -- Scanline Simulation -- + float InnerSine = ScanCoord.y * InSize.y * ScanlineScale * 0.25; + float ScanBrightMod = sin(InnerSine * Pi + ScanlineOffset * InSize.y * 0.25); + float ScanBrightness = mix(1.0, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0) * 0.5, ScanlineAmount); + vec3 ScanlineTexel = InTexel.rgb * ScanBrightness; + + // -- Color Compression (increasing the floor of the signal without affecting the ceiling) -- + ScanlineTexel = Floor + (One.xyz - Floor) * ScanlineTexel; + + ScanlineTexel.rgb = pow(ScanlineTexel.rgb, Power); + + gl_FragColor = vec4(ScanlineTexel.rgb, InTexel.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.json new file mode 100644 index 0000000..9c7f9a3 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/scan_pincushion.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "scan_pincushion", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.fsh new file mode 100644 index 0000000..b17c769 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.fsh @@ -0,0 +1,20 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 center = texture2D(DiffuseSampler, texCoord); + vec4 left = texture2D(DiffuseSampler, texCoord - vec2(oneTexel.x, 0.0)); + vec4 right = texture2D(DiffuseSampler, texCoord + vec2(oneTexel.x, 0.0)); + vec4 up = texture2D(DiffuseSampler, texCoord - vec2(0.0, oneTexel.y)); + vec4 down = texture2D(DiffuseSampler, texCoord + vec2(0.0, oneTexel.y)); + vec4 leftDiff = center - left; + vec4 rightDiff = center - right; + vec4 upDiff = center - up; + vec4 downDiff = center - down; + vec4 total = clamp(leftDiff + rightDiff + upDiff + downDiff, 0.0, 1.0); + gl_FragColor = vec4(total.rgb, center.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.json new file mode 100644 index 0000000..dc2fc17 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.json @@ -0,0 +1,18 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "sobel", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.vsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.vsh new file mode 100644 index 0000000..21b1736 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/sobel.vsh @@ -0,0 +1,20 @@ +#version 120 + +attribute vec4 Position; + +uniform mat4 ProjMat; +uniform vec2 InSize; +uniform vec2 OutSize; + +varying vec2 texCoord; +varying vec2 oneTexel; + +void main(){ + vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); + gl_Position = vec4(outPos.xy, 0.2, 1.0); + + oneTexel = 1.0 / InSize; + + texCoord = Position.xy / OutSize; + texCoord.y = 1.0 - texCoord.y; +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.fsh b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.fsh new file mode 100644 index 0000000..a124319 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.fsh @@ -0,0 +1,58 @@ +#version 120 + +uniform sampler2D DiffuseSampler; + +varying vec2 texCoord; +varying vec2 oneTexel; + +uniform vec2 InSize; + +uniform float Time; +uniform vec2 Frequency; +uniform vec2 WobbleAmount; + +vec3 hue(float h) +{ + float r = abs(h * 6.0 - 3.0) - 1.0; + float g = 2 - abs(h * 6.0 - 2.0); + float b = 2 - abs(h * 6.0 - 4.0); + return clamp(vec3(r,g,b), 0.0, 1.0); +} + +vec3 HSVtoRGB(vec3 hsv) { + return ((hue(hsv.x) - 1.0) * hsv.y + 1.0) * hsv.z; +} + +vec3 RGBtoHSV(vec3 rgb) { + vec3 hsv = vec3(0.0); + hsv.z = max(rgb.r, max(rgb.g, rgb.b)); + float min = min(rgb.r, min(rgb.g, rgb.b)); + float c = hsv.z - min; + + if (c != 0) + { + hsv.y = c / hsv.z; + vec3 delta = (hsv.z - rgb) / c; + delta.rgb -= delta.brg; + delta.rg += vec2(2.0, 4.0); + if (rgb.r >= hsv.z) { + hsv.x = delta.b; + } else if (rgb.g >= hsv.z) { + hsv.x = delta.r; + } else { + hsv.x = delta.g; + } + hsv.x = fract(hsv.x / 6.0); + } + return hsv; +} + +void main() { + float xOffset = sin(texCoord.y * Frequency.x + Time * 3.1415926535 * 2.0) * WobbleAmount.x; + float yOffset = cos(texCoord.x * Frequency.y + Time * 3.1415926535 * 2.0) * WobbleAmount.y; + vec2 offset = vec2(xOffset, yOffset); + vec4 rgb = texture2D(DiffuseSampler, texCoord + offset); + vec3 hsv = RGBtoHSV(rgb.rgb); + hsv.x = fract(hsv.x + Time); + gl_FragColor = vec4(HSVtoRGB(hsv), rgb.a); +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.json b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.json new file mode 100644 index 0000000..d8e9945 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/shaders/program/wobble.json @@ -0,0 +1,21 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "sobel", + "fragment": "wobble", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, + { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, + { "name": "Frequency", "type": "float", "count": 2, "values": [ 512.0, 288.0 ] }, + { "name": "WobbleAmount", "type": "float", "count": 2, "values": [ 0.002, 0.002 ] } + ] +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/texts/credits.txt b/build/rfg/minecraft-src/resources/assets/minecraft/texts/credits.txt new file mode 100644 index 0000000..7396a16 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/texts/credits.txt @@ -0,0 +1,66 @@ +[C]§f=============== +[C]§eMinecraft Credits +[C]§f=============== + +§7Created by: +§f Markus Persson + +§7Game design, programming and graphics: +§f Markus Persson +§f Jens Bergensten +§f Nathan Adams + +§7Programming: +§f Erik Broes + +§7Music and sound: +§f Daniel Rosenfeld + +§7Ingame artwork and paintings: +§f Kristoffer Zetterstrand + +§7End game narrative: +§f Julian Gough + +§7Website development: +§f Tobias Möllstam +§f Daniel Frisk +§f Leonard Axelsson +§f Jens Bergensten +§f Markus Persson + +§7Logo and promotional artwork: +§f Markus Toivonen + +§7Business and administration: +§f Carl Manneh +§f Daniel Kaplan + +§7Director of fun: +§f Lydia Winters + +§7Number crunching and statistics: +§f Patrick Geuder + +§7Additional programming: +§f Paul Spooner +§f Ryan 'Scaevolus' Hitchman +§f Elliot 'Hippoplatimus' Segal + +§7Developers of Mo' Creatures (horses etc): +§f John Olarte (DrZhark) +§f Kent Christian Jensen +§f Dan Roque + +§7Technologies used: +§f Java by Oracle +§f LWJGL by many talented people +§f "3d Sound System" by Paul Lamb +§f JOrbis by JCraft + + + + + + +§f"Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." §7- Unknown \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/texts/end.txt b/build/rfg/minecraft-src/resources/assets/minecraft/texts/end.txt new file mode 100644 index 0000000..7277524 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/texts/end.txt @@ -0,0 +1,151 @@ +§3I see the player you mean. + +§2PLAYERNAME? + +§3Yes. Take care. It has reached a higher level now. It can read our thoughts. + +§2That doesn't matter. It thinks we are part of the game. + +§3I like this player. It played well. It did not give up. + +§2It is reading our thoughts as though they were words on a screen. + +§3That is how it chooses to imagine many things, when it is deep in the dream of a game. + +§2Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. + +§3They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. + +§2What did this player dream? + +§3This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. + +§2Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? + +§3It worked, with a million others, to sculpt a true world in a fold of the §f§k§a§b§3, and created a §f§k§a§b§3 for §f§k§a§b§3, in the §f§k§a§b§3. + +§2It cannot read that thought. + +§3No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. + +§2Does it know that we love it? That the universe is kind? + +§3Sometimes, through the noise of its thoughts, it hears the universe, yes. + +§2But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. + +§3To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. + +§2Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. + +§3It reads our thoughts. + +§2Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely §f§k§a§b§2 and §f§k§a§b§2, I wish to tell them that they are §f§k§a§b§2 in the §f§k§a§b§2. They see so little of reality, in their long dream. + +§3And yet they play the game. + +§2But it would be so easy to tell them... + +§3Too strong for this dream. To tell them how to live is to prevent them living. + +§2I will not tell the player how to live. + +§3The player is growing restless. + +§2I will tell the player a story. + +§3But not the truth. + +§2No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. + +§3Give it a body, again. + +§2Yes. Player... + +§3Use its name. + +§2PLAYERNAME. Player of games. + +§3Good. + +§2Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. + +§3Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. + +§2We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. + +§2Once upon a time, there was a player. + +§3The player was you, PLAYERNAME. + +§2Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. + +§2Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. + +§3Sometimes the player dreamed it was lost in a story. + +§2Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. + +§3Sometimes the player dreamed it watched words on a screen. + +§2Let's go back. + +§2The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. + +§2And the player awoke, from the warm, dark world of its mother's body, into the long dream. + +§2And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. + +§3You are the player. The story. The program. The human. Made from nothing but milk and love. + +§2Let's go further back. + +§2The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... + +§3Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". + +§2Sometimes it called them "planets" and "stars". + +§2Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. + +§3You are the player, reading words... + +§2Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive + +§3You. You. You are alive. + +§2and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees + +§3and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again + +§2and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream + +§3and the universe said I love you + +§2and the universe said you have played the game well + +§3and the universe said everything you need is within you + +§2and the universe said you are stronger than you know + +§3and the universe said you are the daylight + +§2and the universe said you are the night + +§3and the universe said the darkness you fight is within you + +§2and the universe said the light you seek is within you + +§3and the universe said you are not alone + +§2and the universe said you are not separate from every other thing + +§3and the universe said you are the universe tasting itself, talking to itself, reading its own code + +§2and the universe said I love you because you are love. + +§3And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. + +§3You are the player. + +§2Wake up. diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/texts/splashes.txt b/build/rfg/minecraft-src/resources/assets/minecraft/texts/splashes.txt new file mode 100644 index 0000000..061ae98 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/texts/splashes.txt @@ -0,0 +1,322 @@ +As seen on TV! +Awesome! +100% pure! +May contain nuts! +Better than Prey! +More polygons! +Sexy! +Limited edition! +Flashing letters! +Made by Notch! +It's here! +Best in class! +It's finished! +Kind of dragon free! +Excitement! +More than 500 sold! +One of a kind! +Heaps of hits on YouTube! +Indev! +Spiders everywhere! +Check it out! +Holy cow, man! +It's a game! +Made in Sweden! +Uses LWJGL! +Reticulating splines! +Minecraft! +Yaaay! +Singleplayer! +Keyboard compatible! +Undocumented! +Ingots! +Exploding creepers! +That's no moon! +l33t! +Create! +Survive! +Dungeon! +Exclusive! +The bee's knees! +Down with O.P.P.! +Closed source! +Classy! +Wow! +Not on steam! +Oh man! +Awesome community! +Pixels! +Teetsuuuuoooo! +Kaaneeeedaaaa! +Now with difficulty! +Enhanced! +90% bug free! +Pretty! +12 herbs and spices! +Fat free! +Absolutely no memes! +Free dental! +Ask your doctor! +Minors welcome! +Cloud computing! +Legal in Finland! +Hard to label! +Technically good! +Bringing home the bacon! +Indie! +GOTY! +Ceci n'est pas une title screen! +Euclidian! +Now in 3D! +Inspirational! +Herregud! +Complex cellular automata! +Yes, sir! +Played by cowboys! +OpenGL 1.2! +Thousands of colors! +Try it! +Age of Wonders is better! +Try the mushroom stew! +Sensational! +Hot tamale, hot hot tamale! +Play him off, keyboard cat! +Guaranteed! +Macroscopic! +Bring it on! +Random splash! +Call your mother! +Monster infighting! +Loved by millions! +Ultimate edition! +Freaky! +You've got a brand new key! +Water proof! +Uninflammable! +Whoa, dude! +All inclusive! +Tell your friends! +NP is not in P! +Notch <3 ez! +Music by C418! +Livestreamed! +Haunted! +Polynomial! +Terrestrial! +All is full of love! +Full of stars! +Scientific! +Cooler than Spock! +Collaborate and listen! +Never dig down! +Take frequent breaks! +Not linear! +Han shot first! +Nice to meet you! +Buckets of lava! +Ride the pig! +Larger than Earth! +sqrt(-1) love you! +Phobos anomaly! +Punching wood! +Falling off cliffs! +0% sugar! +150% hyperbole! +Synecdoche! +Let's danec! +Seecret Friday update! +Reference implementation! +Lewd with two dudes with food! +Kiss the sky! +20 GOTO 10! +Verlet intregration! +Peter Griffin! +Do not distribute! +Cogito ergo sum! +4815162342 lines of code! +A skeleton popped out! +The Work of Notch! +The sum of its parts! +BTAF used to be good! +I miss ADOM! +umop-apisdn! +OICU812! +Bring me Ray Cokes! +Finger-licking! +Thematic! +Pneumatic! +Sublime! +Octagonal! +Une baguette! +Gargamel plays it! +Rita is the new top dog! +SWM forever! +Representing Edsbyn! +Matt Damon! +Supercalifragilisticexpialidocious! +Consummate V's! +Cow Tools! +Double buffered! +Fan fiction! +Flaxkikare! +Jason! Jason! Jason! +Hotter than the sun! +Internet enabled! +Autonomous! +Engage! +Fantasy! +DRR! DRR! DRR! +Kick it root down! +Regional resources! +Woo, facepunch! +Woo, somethingawful! +Woo, /v/! +Woo, tigsource! +Woo, minecraftforum! +Woo, worldofminecraft! +Woo, reddit! +Woo, 2pp! +Google anlyticsed! +Now supports åäö! +Give us Gordon! +Tip your waiter! +Very fun! +12345 is a bad password! +Vote for net neutrality! +Lives in a pineapple under the sea! +MAP11 has two names! +Omnipotent! +Gasp! +...! +Bees, bees, bees, bees! +Jag känner en bot! +This text is hard to read if you play the game at the default resolution, but at 1080p it's fine! +Haha, LOL! +Hampsterdance! +Switches and ores! +Menger sponge! +idspispopd! +Eple (original edit)! +So fresh, so clean! +Slow acting portals! +Try the Nether! +Don't look directly at the bugs! +Oh, ok, Pigmen! +Finally with ladders! +Scary! +Play Minecraft, Watch Topgear, Get Pig! +Twittered about! +Jump up, jump up, and get down! +Joel is neat! +A riddle, wrapped in a mystery! +Huge tracts of land! +Welcome to your Doom! +Stay a while, stay forever! +Stay a while and listen! +Treatment for your rash! +"Autological" is! +Information wants to be free! +"Almost never" is an interesting concept! +Lots of truthiness! +The creeper is a spy! +Turing complete! +It's groundbreaking! +Let our battle's begin! +The sky is the limit! +Jeb has amazing hair! +Ryan also has amazing hair! +Casual gaming! +Undefeated! +Kinda like Lemmings! +Follow the train, CJ! +Leveraging synergy! +This message will never appear on the splash screen, isn't that weird? +DungeonQuest is unfair! +110813! +90210! +Check out the far lands! +Tyrion would love it! +Also try VVVVVV! +Also try Super Meat Boy! +Also try Terraria! +Also try Mount And Blade! +Also try Project Zomboid! +Also try World of Goo! +Also try Limbo! +Also try Pixeljunk Shooter! +Also try Braid! +That's super! +Bread is pain! +Read more books! +Khaaaaaaaaan! +Less addictive than TV Tropes! +More addictive than lemonade! +Bigger than a bread box! +Millions of peaches! +Fnord! +This is my true form! +Totally forgot about Dre! +Don't bother with the clones! +Pumpkinhead! +Hobo humping slobo babe! +Made by Jeb! +Has an ending! +Finally complete! +Feature packed! +Boots with the fur! +Stop, hammertime! +Testificates! +Conventional! +Homeomorphic to a 3-sphere! +Doesn't avoid double negatives! +Place ALL the blocks! +Does barrel rolls! +Meeting expectations! +PC gaming since 1873! +Ghoughpteighbteau tchoghs! +Déjà vu! +Déjà vu! +Got your nose! +Haley loves Elan! +Afraid of the big, black bat! +Doesn't use the U-word! +Child's play! +See you next Friday or so! +From the streets of Södermalm! +150 bpm for 400000 minutes! +Technologic! +Funk soul brother! +Pumpa kungen! +日本ハロー! +한국 안녕하세요! +Helo Cymru! +Cześć Polsko! +你好中国! +Привет Россия! +Γεια σου Ελλάδα! +My life for Aiur! +Lennart lennart = new Lennart(); +I see your vocabulary has improved! +Who put it there? +You can't explain that! +if not ok then return end +§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac +§kFUNKY LOL +SOPA means LOSER in Swedish! +Big Pointy Teeth! +Bekarton guards the gate! +Mmmph, mmph! +Don't feed avocados to parrots! +Swords for everyone! +Plz reply to my tweet! +.party()! +Take her pillow! +Put that cookie down! +Pretty scary! +I have a suggestion. +Now with extra hugs! +Now java 6! +Woah. +HURNERJSGER? +What's up, Doc? +Now contains 32 random daily cats! \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_base.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_base.png new file mode 100644 index 0000000..cfc1fc8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_base.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png new file mode 100644 index 0000000..395dea4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png new file mode 100644 index 0000000..eddc47f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png new file mode 100644 index 0000000..6cade1f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/anvil_top_damaged_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/beacon.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/beacon.png new file mode 100644 index 0000000..a69e59d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/beacon.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_end.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_end.png new file mode 100644 index 0000000..6e1a4be Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_end.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_side.png new file mode 100644 index 0000000..3ce06f3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_top.png new file mode 100644 index 0000000..b96d357 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_feet_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_end.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_end.png new file mode 100644 index 0000000..b684c9a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_end.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_side.png new file mode 100644 index 0000000..3270b4a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_top.png new file mode 100644 index 0000000..2ab1090 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bed_head_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bedrock.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bedrock.png new file mode 100644 index 0000000..1643c99 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bedrock.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bookshelf.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bookshelf.png new file mode 100644 index 0000000..4c87f0f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/bookshelf.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand.png new file mode 100644 index 0000000..60832aa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand_base.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand_base.png new file mode 100644 index 0000000..0742fbf Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brewing_stand_base.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brick.png new file mode 100644 index 0000000..fd6959c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/brick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_bottom.png new file mode 100644 index 0000000..6f10bc0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_side.png new file mode 100644 index 0000000..9c55503 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_top.png new file mode 100644 index 0000000..f182e84 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cactus_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_bottom.png new file mode 100644 index 0000000..d93b15a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_inner.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_inner.png new file mode 100644 index 0000000..ce7ce69 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_inner.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_side.png new file mode 100644 index 0000000..343a023 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_top.png new file mode 100644 index 0000000..2947892 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cake_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_3.png new file mode 100644 index 0000000..2391be8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/carrots_stage_3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_bottom.png new file mode 100644 index 0000000..fb31385 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_inner.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_inner.png new file mode 100644 index 0000000..d5a30dd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_inner.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_side.png new file mode 100644 index 0000000..72b0e5a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cauldron_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/clay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/clay.png new file mode 100644 index 0000000..c19e031 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/clay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_block.png new file mode 100644 index 0000000..024404b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_ore.png new file mode 100644 index 0000000..49486d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/coal_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone.png new file mode 100644 index 0000000..da3498c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png new file mode 100644 index 0000000..29449e3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cobblestone_mossy.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png new file mode 100644 index 0000000..25892eb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png new file mode 100644 index 0000000..d0098ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png new file mode 100644 index 0000000..db28c7b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/cocoa_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/command_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/command_block.png new file mode 100644 index 0000000..4459675 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/command_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_off.png new file mode 100644 index 0000000..c9527bc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_on.png new file mode 100644 index 0000000..2e4fb7a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/comparator_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_front.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_front.png new file mode 100644 index 0000000..11986a4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_front.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_side.png new file mode 100644 index 0000000..1c678b4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_top.png new file mode 100644 index 0000000..5cd53a5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/crafting_table_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_side.png new file mode 100644 index 0000000..ac273ea Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_top.png new file mode 100644 index 0000000..3bfb2da Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/daylight_detector_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/deadbush.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/deadbush.png new file mode 100644 index 0000000..c64e079 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/deadbush.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_0.png new file mode 100644 index 0000000..f65b7ed Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_1.png new file mode 100644 index 0000000..7c91596 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_2.png new file mode 100644 index 0000000..dadd6b0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_3.png new file mode 100644 index 0000000..52a40b6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_4.png new file mode 100644 index 0000000..e37c88a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_5.png new file mode 100644 index 0000000..9590d2f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_6.png new file mode 100644 index 0000000..8e490c0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_7.png new file mode 100644 index 0000000..0b40c78 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_8.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_8.png new file mode 100644 index 0000000..c0bf1de Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_8.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_9.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_9.png new file mode 100644 index 0000000..e3185f8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/destroy_stage_9.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_block.png new file mode 100644 index 0000000..f2e2e77 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_ore.png new file mode 100644 index 0000000..735ecda Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/diamond_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt.png new file mode 100644 index 0000000..617d353 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png new file mode 100644 index 0000000..5921d37 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png new file mode 100644 index 0000000..ebeda86 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dirt_podzol_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png new file mode 100644 index 0000000..3e09fde Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_horizontal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png new file mode 100644 index 0000000..87a7837 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dispenser_front_vertical.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_lower.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_lower.png new file mode 100644 index 0000000..dbc33ab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_lower.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_upper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_upper.png new file mode 100644 index 0000000..56878fe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_iron_upper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_lower.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_lower.png new file mode 100644 index 0000000..cc61731 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_lower.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_upper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_upper.png new file mode 100644 index 0000000..93319d5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/door_wood_upper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png new file mode 100644 index 0000000..6a5fa6a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png new file mode 100644 index 0000000..393144c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_fern_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png new file mode 100644 index 0000000..ec717f9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png new file mode 100644 index 0000000..113d2b3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_grass_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png new file mode 100644 index 0000000..21285f5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png new file mode 100644 index 0000000..bc68241 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_paeonia_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png new file mode 100644 index 0000000..4d59f44 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png new file mode 100644 index 0000000..028aa80 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_rose_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png new file mode 100644 index 0000000..d488923 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_back.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png new file mode 100644 index 0000000..8a12ebe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png new file mode 100644 index 0000000..699e34f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_front.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png new file mode 100644 index 0000000..4d14203 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_sunflower_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png new file mode 100644 index 0000000..5b880b5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png new file mode 100644 index 0000000..b00751f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/double_plant_syringa_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dragon_egg.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dragon_egg.png new file mode 100644 index 0000000..02af123 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dragon_egg.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png new file mode 100644 index 0000000..7d5f260 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_horizontal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png new file mode 100644 index 0000000..68a56c8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/dropper_front_vertical.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_block.png new file mode 100644 index 0000000..dc214ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_ore.png new file mode 100644 index 0000000..a26c35f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/emerald_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png new file mode 100644 index 0000000..0f492aa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_side.png new file mode 100644 index 0000000..f2f4614 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_top.png new file mode 100644 index 0000000..0d5f68f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/enchanting_table_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/end_stone.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/end_stone.png new file mode 100644 index 0000000..c2a91e3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/end_stone.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_eye.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_eye.png new file mode 100644 index 0000000..afa1d5d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_eye.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_side.png new file mode 100644 index 0000000..e6cb567 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_top.png new file mode 100644 index 0000000..35215a5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/endframe_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_dry.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_dry.png new file mode 100644 index 0000000..d03a0f4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_dry.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_wet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_wet.png new file mode 100644 index 0000000..f8d460d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/farmland_wet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fern.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fern.png new file mode 100644 index 0000000..fd76950 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fern.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png new file mode 100644 index 0000000..cf8910f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta new file mode 100644 index 0000000..7644671 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_0.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frames": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ] + } +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png new file mode 100644 index 0000000..6db92ac Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/fire_layer_1.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_allium.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_allium.png new file mode 100644 index 0000000..b7b5a45 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_allium.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png new file mode 100644 index 0000000..51d7fd9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_blue_orchid.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_dandelion.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_dandelion.png new file mode 100644 index 0000000..873e3f5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_dandelion.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_houstonia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_houstonia.png new file mode 100644 index 0000000..2f9127d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_houstonia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png new file mode 100644 index 0000000..6d48913 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_oxeye_daisy.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_paeonia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_paeonia.png new file mode 100644 index 0000000..01a92ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_paeonia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_pot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_pot.png new file mode 100644 index 0000000..09c2523 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_pot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_rose.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_rose.png new file mode 100644 index 0000000..895d78f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_rose.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png new file mode 100644 index 0000000..6715a62 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png new file mode 100644 index 0000000..a757bf5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_red.png new file mode 100644 index 0000000..3048b63 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_white.png new file mode 100644 index 0000000..6aa12a9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/flower_tulip_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_off.png new file mode 100644 index 0000000..0570c3a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_on.png new file mode 100644 index 0000000..92c89f3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_front_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_side.png new file mode 100644 index 0000000..115f73d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_top.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/furnace_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass.png new file mode 100644 index 0000000..acadb01 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_black.png new file mode 100644 index 0000000..06f3427 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_blue.png new file mode 100644 index 0000000..38885de Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_brown.png new file mode 100644 index 0000000..259b61c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_cyan.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_cyan.png new file mode 100644 index 0000000..d30caa4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_cyan.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_gray.png new file mode 100644 index 0000000..3f07a5d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_green.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_green.png new file mode 100644 index 0000000..7c1f4e6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_green.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_light_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_light_blue.png new file mode 100644 index 0000000..b62703d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_light_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_lime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_lime.png new file mode 100644 index 0000000..f1d3c46 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_lime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_magenta.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_magenta.png new file mode 100644 index 0000000..5cd9945 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_magenta.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_orange.png new file mode 100644 index 0000000..3a29e31 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top.png new file mode 100644 index 0000000..02de587 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png new file mode 100644 index 0000000..43d60c5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png new file mode 100644 index 0000000..55c614f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png new file mode 100644 index 0000000..cbd791a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png new file mode 100644 index 0000000..9a34b84 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_cyan.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png new file mode 100644 index 0000000..bb06114 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png new file mode 100644 index 0000000..a7d9fc7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_green.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png new file mode 100644 index 0000000..6a0e661 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_light_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png new file mode 100644 index 0000000..0607d75 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_lime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png new file mode 100644 index 0000000..5419e52 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_magenta.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png new file mode 100644 index 0000000..2866571 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png new file mode 100644 index 0000000..6b6cd76 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png new file mode 100644 index 0000000..23e208e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_purple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png new file mode 100644 index 0000000..22b69db Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png new file mode 100644 index 0000000..f226ecc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_silver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png new file mode 100644 index 0000000..9a273c3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png new file mode 100644 index 0000000..1c8580f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pane_top_yellow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pink.png new file mode 100644 index 0000000..42d8739 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_purple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_purple.png new file mode 100644 index 0000000..fcae3d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_purple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_red.png new file mode 100644 index 0000000..db4c5eb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_silver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_silver.png new file mode 100644 index 0000000..8461664 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_silver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_white.png new file mode 100644 index 0000000..696c5aa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_yellow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_yellow.png new file mode 100644 index 0000000..8e48e12 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glass_yellow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glowstone.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glowstone.png new file mode 100644 index 0000000..c7253b3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/glowstone.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_block.png new file mode 100644 index 0000000..174002e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_ore.png new file mode 100644 index 0000000..b1a7a55 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gold_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side.png new file mode 100644 index 0000000..a4975e5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_overlay.png new file mode 100644 index 0000000..fc3fa9d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_snowed.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_snowed.png new file mode 100644 index 0000000..41f6197 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_side_snowed.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_top.png new file mode 100644 index 0000000..eaa7e45 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/grass_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gravel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gravel.png new file mode 100644 index 0000000..388e5c5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/gravel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay.png new file mode 100644 index 0000000..2446380 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png new file mode 100644 index 0000000..59da22c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png new file mode 100644 index 0000000..7e38e27 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png new file mode 100644 index 0000000..f81745f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png new file mode 100644 index 0000000..b05428c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_cyan.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png new file mode 100644 index 0000000..8f86904 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png new file mode 100644 index 0000000..e89162e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_green.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png new file mode 100644 index 0000000..3d9ebea Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_light_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png new file mode 100644 index 0000000..b459a0b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_lime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png new file mode 100644 index 0000000..9663106 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_magenta.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png new file mode 100644 index 0000000..40929db Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png new file mode 100644 index 0000000..c21c0aa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png new file mode 100644 index 0000000..edece94 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_purple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png new file mode 100644 index 0000000..6561d12 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png new file mode 100644 index 0000000..eae07f2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_silver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png new file mode 100644 index 0000000..8066af0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png new file mode 100644 index 0000000..5da4687 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hardened_clay_stained_yellow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_side.png new file mode 100644 index 0000000..a2b32db Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_top.png new file mode 100644 index 0000000..1d35593 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hay_block_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_inside.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_inside.png new file mode 100644 index 0000000..24e8eae Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_inside.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_outside.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_outside.png new file mode 100644 index 0000000..50ed8d5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_outside.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_top.png new file mode 100644 index 0000000..3ed6171 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/hopper_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice.png new file mode 100644 index 0000000..ac946e9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice_packed.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice_packed.png new file mode 100644 index 0000000..50f0f34 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ice_packed.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_bars.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_bars.png new file mode 100644 index 0000000..732807f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_bars.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_block.png new file mode 100644 index 0000000..7816799 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_ore.png new file mode 100644 index 0000000..250d8bb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/iron_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/itemframe_background.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/itemframe_background.png new file mode 100644 index 0000000..b40ad65 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/itemframe_background.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_side.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_top.png new file mode 100644 index 0000000..92ddb15 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/jukebox_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ladder.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ladder.png new file mode 100644 index 0000000..e2ec5f2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/ladder.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_block.png new file mode 100644 index 0000000..0271489 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_ore.png new file mode 100644 index 0000000..6144236 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lapis_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png new file mode 100644 index 0000000..af07f91 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png new file mode 100644 index 0000000..78bb29d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta new file mode 100644 index 0000000..7ceb363 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lava_still.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_acacia_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_big_oak_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_birch_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle.png new file mode 100644 index 0000000..e0cb935 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png new file mode 100644 index 0000000..110a618 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_jungle_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak.png new file mode 100644 index 0000000..a6773af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png new file mode 100644 index 0000000..e91ed32 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_oak_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce.png new file mode 100644 index 0000000..602eab8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png new file mode 100644 index 0000000..2e5228e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/leaves_spruce_opaque.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lever.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lever.png new file mode 100644 index 0000000..051187f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/lever.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia.png new file mode 100644 index 0000000..d221210 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia_top.png new file mode 100644 index 0000000..3d44878 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_acacia_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak.png new file mode 100644 index 0000000..d4da03e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak_top.png new file mode 100644 index 0000000..99137b6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_big_oak_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch.png new file mode 100644 index 0000000..bfb209d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch_top.png new file mode 100644 index 0000000..f9b94f4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_birch_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle.png new file mode 100644 index 0000000..0b7120a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle_top.png new file mode 100644 index 0000000..26b0361 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_jungle_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak.png new file mode 100644 index 0000000..914cb5f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak_top.png new file mode 100644 index 0000000..7a44e77 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_oak_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce.png new file mode 100644 index 0000000..dc1aa2f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce_top.png new file mode 100644 index 0000000..280c64e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/log_spruce_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_side.png new file mode 100644 index 0000000..ec7b430 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_connected.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_connected.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_stem_disconnected.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_top.png new file mode 100644 index 0000000..65cf169 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/melon_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mob_spawner.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mob_spawner.png new file mode 100644 index 0000000..7d55217 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mob_spawner.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png new file mode 100644 index 0000000..f0e7a04 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_inside.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png new file mode 100644 index 0000000..1f52ba8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png new file mode 100644 index 0000000..66cf12c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png new file mode 100644 index 0000000..83c0840 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_block_skin_stem.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_brown.png new file mode 100644 index 0000000..bf33d34 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_red.png new file mode 100644 index 0000000..1b332b7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mushroom_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_side.png new file mode 100644 index 0000000..5547425 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_top.png new file mode 100644 index 0000000..088a825 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/mycelium_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_brick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_brick.png new file mode 100644 index 0000000..caaf66f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_brick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png new file mode 100644 index 0000000..514a95b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png new file mode 100644 index 0000000..b4ad0d1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png new file mode 100644 index 0000000..b9b6743 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/nether_wart_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/netherrack.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/netherrack.png new file mode 100644 index 0000000..88129c4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/netherrack.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/noteblock.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/noteblock.png new file mode 100644 index 0000000..a3c27c1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/noteblock.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/obsidian.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/obsidian.png new file mode 100644 index 0000000..ff0a683 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/obsidian.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_bottom.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_inner.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_inner.png new file mode 100644 index 0000000..1043929 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_inner.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_side.png new file mode 100644 index 0000000..634f54a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_normal.png new file mode 100644 index 0000000..eeaadab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_sticky.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_sticky.png new file mode 100644 index 0000000..6ddd4ad Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/piston_top_sticky.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_acacia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_acacia.png new file mode 100644 index 0000000..6858c51 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_acacia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_big_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_big_oak.png new file mode 100644 index 0000000..e3fd4ea Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_big_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_birch.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_birch.png new file mode 100644 index 0000000..b113e3a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_birch.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_jungle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_jungle.png new file mode 100644 index 0000000..e3fe82d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_jungle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_oak.png new file mode 100644 index 0000000..346f77d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_spruce.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_spruce.png new file mode 100644 index 0000000..f45fa94 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/planks_spruce.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png new file mode 100644 index 0000000..96859e2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/portal.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png new file mode 100644 index 0000000..c1ef732 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png new file mode 100644 index 0000000..1275f4f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png new file mode 100644 index 0000000..b7347df Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png new file mode 100644 index 0000000..d7e8185 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/potatoes_stage_3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png new file mode 100644 index 0000000..ecef025 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png new file mode 100644 index 0000000..907f499 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_face_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_side.png new file mode 100644 index 0000000..75dfc47 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png new file mode 100644 index 0000000..6a5c10e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_connected.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png new file mode 100644 index 0000000..38065ef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_stem_disconnected.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_top.png new file mode 100644 index 0000000..297ce3c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/pumpkin_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png new file mode 100644 index 0000000..7e16c7c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png new file mode 100644 index 0000000..80465a1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png new file mode 100644 index 0000000..44073e5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_chiseled_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines.png new file mode 100644 index 0000000..184ecd2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png new file mode 100644 index 0000000..6d20379 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_lines_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_side.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_top.png new file mode 100644 index 0000000..a2cd2ca Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_block_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_ore.png new file mode 100644 index 0000000..4d758c1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/quartz_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator.png new file mode 100644 index 0000000..ce115ba Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator_powered.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator_powered.png new file mode 100644 index 0000000..a3aaca9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_activator_powered.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector.png new file mode 100644 index 0000000..92c1466 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector_powered.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector_powered.png new file mode 100644 index 0000000..a1c6e6b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_detector_powered.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden.png new file mode 100644 index 0000000..1fc52c3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden_powered.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden_powered.png new file mode 100644 index 0000000..bd343be Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_golden_powered.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal.png new file mode 100644 index 0000000..d609236 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal_turned.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal_turned.png new file mode 100644 index 0000000..f394a23 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/rail_normal_turned.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/red_sand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/red_sand.png new file mode 100644 index 0000000..b216a42 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/red_sand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_block.png new file mode 100644 index 0000000..fcf6b40 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png new file mode 100644 index 0000000..dcec893 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_cross_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line.png new file mode 100644 index 0000000..ff0fb23 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png new file mode 100644 index 0000000..96729e1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_dust_line_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png new file mode 100644 index 0000000..522765b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png new file mode 100644 index 0000000..9562ef3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_lamp_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_ore.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_ore.png new file mode 100644 index 0000000..575a488 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_ore.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_off.png new file mode 100644 index 0000000..635eabd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_on.png new file mode 100644 index 0000000..2983d6c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/redstone_torch_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/reeds.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/reeds.png new file mode 100644 index 0000000..64bbfe0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/reeds.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_off.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_off.png new file mode 100644 index 0000000..8634669 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_off.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_on.png new file mode 100644 index 0000000..d71d0d9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/repeater_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sand.png new file mode 100644 index 0000000..86b9654 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_bottom.png new file mode 100644 index 0000000..e102220 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_carved.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_carved.png new file mode 100644 index 0000000..9bd7fa1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_carved.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_normal.png new file mode 100644 index 0000000..1b79145 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_smooth.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_smooth.png new file mode 100644 index 0000000..ef118bd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_smooth.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_top.png new file mode 100644 index 0000000..bb5b157 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sandstone_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_acacia.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_acacia.png new file mode 100644 index 0000000..a1215cb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_acacia.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_birch.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_birch.png new file mode 100644 index 0000000..b0dacc5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_birch.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_jungle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_jungle.png new file mode 100644 index 0000000..4e10b35 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_jungle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_oak.png new file mode 100644 index 0000000..1bf1bfa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png new file mode 100644 index 0000000..dcf5588 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_roofed_oak.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_spruce.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_spruce.png new file mode 100644 index 0000000..5767d48 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sapling_spruce.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/snow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/snow.png new file mode 100644 index 0000000..5c146cd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/snow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/soul_sand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/soul_sand.png new file mode 100644 index 0000000..fca7e8f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/soul_sand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sponge.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sponge.png new file mode 100644 index 0000000..a850804 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/sponge.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone.png new file mode 100644 index 0000000..87e19ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_side.png new file mode 100644 index 0000000..fe2a204 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_top.png new file mode 100644 index 0000000..090657d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stone_slab_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick.png new file mode 100644 index 0000000..69138cf Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_carved.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_carved.png new file mode 100644 index 0000000..b7e88db Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_carved.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png new file mode 100644 index 0000000..918a884 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_cracked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png new file mode 100644 index 0000000..5b9fe37 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/stonebrick_mossy.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tallgrass.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tallgrass.png new file mode 100644 index 0000000..65209fa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tallgrass.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_bottom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_bottom.png new file mode 100644 index 0000000..cc2e586 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_bottom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_side.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_side.png new file mode 100644 index 0000000..21109fb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_side.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_top.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_top.png new file mode 100644 index 0000000..ceb44b6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/tnt_top.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/torch_on.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/torch_on.png new file mode 100644 index 0000000..a2ce41b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/torch_on.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trapdoor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trapdoor.png new file mode 100644 index 0000000..a7dcccc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trapdoor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire.png new file mode 100644 index 0000000..6a9a72b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire_source.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire_source.png new file mode 100644 index 0000000..fbd464d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/trip_wire_source.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/vine.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/vine.png new file mode 100644 index 0000000..df5e435 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/vine.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png new file mode 100644 index 0000000..e72280c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png new file mode 100644 index 0000000..c7e90b0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/waterlily.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/waterlily.png new file mode 100644 index 0000000..f6c84f8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/waterlily.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/web.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/web.png new file mode 100644 index 0000000..7c097f1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/web.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_0.png new file mode 100644 index 0000000..185af6f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_1.png new file mode 100644 index 0000000..67588c1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_2.png new file mode 100644 index 0000000..3d33792 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_3.png new file mode 100644 index 0000000..4649f78 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_4.png new file mode 100644 index 0000000..ac04b52 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_5.png new file mode 100644 index 0000000..1ea81ac Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_6.png new file mode 100644 index 0000000..cb5f195 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_7.png new file mode 100644 index 0000000..7acafb3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wheat_stage_7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_black.png new file mode 100644 index 0000000..b74d5c9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_blue.png new file mode 100644 index 0000000..ce9515f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_brown.png new file mode 100644 index 0000000..b4dc3c5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png new file mode 100644 index 0000000..ca0800a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_cyan.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_gray.png new file mode 100644 index 0000000..6409ff2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_green.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_green.png new file mode 100644 index 0000000..a7be6d7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_green.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png new file mode 100644 index 0000000..72d9d9e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_light_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_lime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_lime.png new file mode 100644 index 0000000..bf56389 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_lime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png new file mode 100644 index 0000000..3af6747 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_magenta.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_orange.png new file mode 100644 index 0000000..eefe6de Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_pink.png new file mode 100644 index 0000000..c2785af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_purple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_purple.png new file mode 100644 index 0000000..76f68d6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_purple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_red.png new file mode 100644 index 0000000..0cff7a9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_silver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_silver.png new file mode 100644 index 0000000..756d9b0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_silver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_white.png new file mode 100644 index 0000000..abc7999 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png new file mode 100644 index 0000000..4babaaa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/blocks/wool_colored_yellow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/foliage.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/foliage.png new file mode 100644 index 0000000..dcc119e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/foliage.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/grass.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/grass.png new file mode 100644 index 0000000..484a9a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/colormap/grass.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/effect/dither.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/effect/dither.png new file mode 100644 index 0000000..19ba7e4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/effect/dither.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/arrow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/arrow.png new file mode 100644 index 0000000..3afa604 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/arrow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/bat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/bat.png new file mode 100644 index 0000000..803860e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/bat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/beacon_beam.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/beacon_beam.png new file mode 100644 index 0000000..67545b4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/beacon_beam.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/blaze.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/blaze.png new file mode 100644 index 0000000..19cdbb5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/blaze.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/boat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/boat.png new file mode 100644 index 0000000..9b58965 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/boat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/black.png new file mode 100644 index 0000000..422908f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/ocelot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/ocelot.png new file mode 100644 index 0000000..6b5064e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/ocelot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/red.png new file mode 100644 index 0000000..17b6de5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/siamese.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/siamese.png new file mode 100644 index 0000000..cfed948 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cat/siamese.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas.png new file mode 100644 index 0000000..4459112 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas_double.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas_double.png new file mode 100644 index 0000000..9e44eeb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/christmas_double.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/ender.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/ender.png new file mode 100644 index 0000000..3631d0d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/ender.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal.png new file mode 100644 index 0000000..2e3d7fd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal_double.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal_double.png new file mode 100644 index 0000000..0168338 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/normal_double.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped.png new file mode 100644 index 0000000..3aef190 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped_double.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped_double.png new file mode 100644 index 0000000..00eebe5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chest/trapped_double.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chicken.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chicken.png new file mode 100644 index 0000000..e24d550 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/chicken.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/cow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/cow.png new file mode 100644 index 0000000..f1320c3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/cow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/mooshroom.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/mooshroom.png new file mode 100644 index 0000000..905f160 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/cow/mooshroom.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper.png new file mode 100644 index 0000000..abdb540 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png new file mode 100644 index 0000000..119f6ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/creeper/creeper_armor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enchanting_table_book.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enchanting_table_book.png new file mode 100644 index 0000000..619e7a5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enchanting_table_book.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/end_portal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/end_portal.png new file mode 100644 index 0000000..d5d8569 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/end_portal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png new file mode 100644 index 0000000..8b3668a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png new file mode 100644 index 0000000..1259a5d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/endercrystal/endercrystal_beam.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon.png new file mode 100644 index 0000000..b8a680c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png new file mode 100644 index 0000000..ca5c949 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_exploding.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png new file mode 100644 index 0000000..147b303 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderdragon/dragon_eyes.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman.png new file mode 100644 index 0000000..ab23cb9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png new file mode 100644 index 0000000..0804402 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/enderman/enderman_eyes.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/experience_orb.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/experience_orb.png new file mode 100644 index 0000000..92f9d0f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/experience_orb.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/explosion.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/explosion.png new file mode 100644 index 0000000..c309409 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/explosion.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast.png new file mode 100644 index 0000000..dd63bc1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png new file mode 100644 index 0000000..5d9be29 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/ghast/ghast_shooting.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png new file mode 100644 index 0000000..39068f2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_diamond.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png new file mode 100644 index 0000000..4a0786d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_gold.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png new file mode 100644 index 0000000..533b2dd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/armor/horse_armor_iron.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/donkey.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/donkey.png new file mode 100644 index 0000000..b94bc63 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/donkey.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_black.png new file mode 100644 index 0000000..dde716e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_brown.png new file mode 100644 index 0000000..ec0158f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png new file mode 100644 index 0000000..40322ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_chestnut.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_creamy.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_creamy.png new file mode 100644 index 0000000..bc42bcc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_creamy.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png new file mode 100644 index 0000000..b38e914 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_darkbrown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_gray.png new file mode 100644 index 0000000..4987532 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png new file mode 100644 index 0000000..7320648 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_blackdots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png new file mode 100644 index 0000000..b1f0a69 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png new file mode 100644 index 0000000..20e1954 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitedots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png new file mode 100644 index 0000000..baa2c06 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_markings_whitefield.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png new file mode 100644 index 0000000..29d4ed5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_skeleton.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_white.png new file mode 100644 index 0000000..e90e6e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_zombie.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_zombie.png new file mode 100644 index 0000000..22d55fa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/horse_zombie.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/mule.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/mule.png new file mode 100644 index 0000000..241bdaa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/horse/mule.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/iron_golem.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/iron_golem.png new file mode 100644 index 0000000..f9f6465 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/iron_golem.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/lead_knot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/lead_knot.png new file mode 100644 index 0000000..ab4d3b3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/lead_knot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/minecart.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/minecart.png new file mode 100644 index 0000000..7ad7b54 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/minecart.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig.png new file mode 100644 index 0000000..0a9532f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig_saddle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig_saddle.png new file mode 100644 index 0000000..640ea76 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/pig/pig_saddle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep.png new file mode 100644 index 0000000..d9fe93f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png new file mode 100644 index 0000000..623340b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sheep/sheep_fur.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sign.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sign.png new file mode 100644 index 0000000..e22e2f7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/sign.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/silverfish.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/silverfish.png new file mode 100644 index 0000000..416fa16 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/silverfish.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/skeleton.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/skeleton.png new file mode 100644 index 0000000..184b585 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/skeleton.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png new file mode 100644 index 0000000..b0db19d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/skeleton/wither_skeleton.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/magmacube.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/magmacube.png new file mode 100644 index 0000000..c1b397f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/magmacube.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/slime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/slime.png new file mode 100644 index 0000000..96edcf6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/slime/slime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/snowman.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/snowman.png new file mode 100644 index 0000000..568d5f6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/snowman.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/cave_spider.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/cave_spider.png new file mode 100644 index 0000000..934f1ea Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/cave_spider.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/spider.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/spider.png new file mode 100644 index 0000000..3a8c779 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider/spider.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider_eyes.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider_eyes.png new file mode 100644 index 0000000..6b80a06 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/spider_eyes.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/squid.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/squid.png new file mode 100644 index 0000000..f285388 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/squid.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/steve.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/steve.png new file mode 100644 index 0000000..6650185 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/steve.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/butcher.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/butcher.png new file mode 100644 index 0000000..f1c07d4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/butcher.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/farmer.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/farmer.png new file mode 100644 index 0000000..970c179 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/farmer.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/librarian.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/librarian.png new file mode 100644 index 0000000..b071cd3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/librarian.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/priest.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/priest.png new file mode 100644 index 0000000..35054ce Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/priest.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/smith.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/smith.png new file mode 100644 index 0000000..965da7f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/smith.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/villager.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/villager.png new file mode 100644 index 0000000..52de8e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/villager/villager.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/witch.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/witch.png new file mode 100644 index 0000000..2403570 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/witch.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither.png new file mode 100644 index 0000000..0882d05 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_armor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_armor.png new file mode 100644 index 0000000..a6b5cf5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_armor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png new file mode 100644 index 0000000..717750b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wither/wither_invulnerable.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf.png new file mode 100644 index 0000000..f37ef81 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png new file mode 100644 index 0000000..7891ce9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_angry.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png new file mode 100644 index 0000000..ae1c920 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_collar.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png new file mode 100644 index 0000000..f1236d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/wolf/wolf_tame.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie.png new file mode 100644 index 0000000..22ff8f9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png new file mode 100644 index 0000000..349f9c2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie/zombie_villager.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie_pigman.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie_pigman.png new file mode 100644 index 0000000..e95cc4c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/entity/zombie_pigman.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/clouds.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/clouds.png new file mode 100644 index 0000000..a67c44d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/clouds.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/end_sky.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/end_sky.png new file mode 100644 index 0000000..094b309 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/end_sky.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/moon_phases.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/moon_phases.png new file mode 100644 index 0000000..cdba8d1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/moon_phases.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/rain.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/rain.png new file mode 100644 index 0000000..2dc4b1c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/rain.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/snow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/snow.png new file mode 100644 index 0000000..1898903 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/snow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/sun.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/sun.png new file mode 100644 index 0000000..08de644 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/environment/sun.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii.png new file mode 100644 index 0000000..587966d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii_sga.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii_sga.png new file mode 100644 index 0000000..f443b4a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/ascii_sga.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_00.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_00.png new file mode 100644 index 0000000..44fd12f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_00.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_01.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_01.png new file mode 100644 index 0000000..ddac030 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_01.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_02.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_02.png new file mode 100644 index 0000000..dc1335a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_02.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_03.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_03.png new file mode 100644 index 0000000..6ff0257 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_03.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_04.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_04.png new file mode 100644 index 0000000..be3e833 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_04.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_05.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_05.png new file mode 100644 index 0000000..9b58804 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_05.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_06.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_06.png new file mode 100644 index 0000000..ed74e78 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_06.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_07.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_07.png new file mode 100644 index 0000000..b532177 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_07.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_09.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_09.png new file mode 100644 index 0000000..083b911 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_09.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0a.png new file mode 100644 index 0000000..0190c11 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0b.png new file mode 100644 index 0000000..4d0af48 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0c.png new file mode 100644 index 0000000..773297d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0d.png new file mode 100644 index 0000000..5f52231 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0e.png new file mode 100644 index 0000000..531ca7d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0f.png new file mode 100644 index 0000000..7b879fc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_0f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_10.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_10.png new file mode 100644 index 0000000..53f056c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_10.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_11.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_11.png new file mode 100644 index 0000000..a9d5c11 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_11.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_12.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_12.png new file mode 100644 index 0000000..d20a864 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_12.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_13.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_13.png new file mode 100644 index 0000000..bbb0641 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_13.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_14.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_14.png new file mode 100644 index 0000000..ffd8e42 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_14.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_15.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_15.png new file mode 100644 index 0000000..ccfcae6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_15.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_16.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_16.png new file mode 100644 index 0000000..d02c557 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_16.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_17.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_17.png new file mode 100644 index 0000000..fed5b6e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_17.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_18.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_18.png new file mode 100644 index 0000000..97394d0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_18.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_19.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_19.png new file mode 100644 index 0000000..6929413 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_19.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1a.png new file mode 100644 index 0000000..d3a1b98 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1b.png new file mode 100644 index 0000000..9e0adf7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1c.png new file mode 100644 index 0000000..14d4890 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1d.png new file mode 100644 index 0000000..1924226 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1e.png new file mode 100644 index 0000000..cce20e3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1f.png new file mode 100644 index 0000000..bdaf22f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_1f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_20.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_20.png new file mode 100644 index 0000000..ba948e9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_20.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_21.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_21.png new file mode 100644 index 0000000..998f2f9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_21.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_22.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_22.png new file mode 100644 index 0000000..c3fd5dd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_22.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_23.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_23.png new file mode 100644 index 0000000..9c2b2dc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_23.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_24.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_24.png new file mode 100644 index 0000000..d6cc8ae Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_24.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_25.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_25.png new file mode 100644 index 0000000..ee7535d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_25.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_26.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_26.png new file mode 100644 index 0000000..93aa960 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_26.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_27.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_27.png new file mode 100644 index 0000000..92f4501 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_27.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_28.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_28.png new file mode 100644 index 0000000..5f96e1b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_28.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_29.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_29.png new file mode 100644 index 0000000..4558220 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_29.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2a.png new file mode 100644 index 0000000..87e0e0c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2b.png new file mode 100644 index 0000000..722edf0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2c.png new file mode 100644 index 0000000..51830f7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2d.png new file mode 100644 index 0000000..dfafa53 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2e.png new file mode 100644 index 0000000..2aea04b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2f.png new file mode 100644 index 0000000..bff5f8e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_2f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_30.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_30.png new file mode 100644 index 0000000..5ccba75 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_30.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_31.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_31.png new file mode 100644 index 0000000..44fc5e5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_31.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_32.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_32.png new file mode 100644 index 0000000..4858d08 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_32.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_33.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_33.png new file mode 100644 index 0000000..ab67072 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_33.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_34.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_34.png new file mode 100644 index 0000000..fd8fca9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_34.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_35.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_35.png new file mode 100644 index 0000000..603dc02 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_35.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_36.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_36.png new file mode 100644 index 0000000..778c190 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_36.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_37.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_37.png new file mode 100644 index 0000000..3032a23 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_37.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_38.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_38.png new file mode 100644 index 0000000..9b637bd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_38.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_39.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_39.png new file mode 100644 index 0000000..2f93850 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_39.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3a.png new file mode 100644 index 0000000..cdf4944 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3b.png new file mode 100644 index 0000000..10e8502 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3c.png new file mode 100644 index 0000000..022fea5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3d.png new file mode 100644 index 0000000..01ea1d1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3e.png new file mode 100644 index 0000000..3bdf7f8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3f.png new file mode 100644 index 0000000..3fd5249 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_3f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_40.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_40.png new file mode 100644 index 0000000..544f89e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_40.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_41.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_41.png new file mode 100644 index 0000000..729fdaf Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_41.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_42.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_42.png new file mode 100644 index 0000000..755e546 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_42.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_43.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_43.png new file mode 100644 index 0000000..6069d0d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_43.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_44.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_44.png new file mode 100644 index 0000000..845c364 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_44.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_45.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_45.png new file mode 100644 index 0000000..294c78d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_45.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_46.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_46.png new file mode 100644 index 0000000..ee5e629 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_46.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_47.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_47.png new file mode 100644 index 0000000..55cb0c0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_47.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_48.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_48.png new file mode 100644 index 0000000..7652211 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_48.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_49.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_49.png new file mode 100644 index 0000000..b736232 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_49.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4a.png new file mode 100644 index 0000000..d3419bd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4b.png new file mode 100644 index 0000000..5e02ad3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4c.png new file mode 100644 index 0000000..11c6b31 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4d.png new file mode 100644 index 0000000..3eb224a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4e.png new file mode 100644 index 0000000..11a78ba Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4f.png new file mode 100644 index 0000000..b4c9fab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_4f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_50.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_50.png new file mode 100644 index 0000000..ff73d23 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_50.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_51.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_51.png new file mode 100644 index 0000000..6e0eae9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_51.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_52.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_52.png new file mode 100644 index 0000000..6f10fcb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_52.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_53.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_53.png new file mode 100644 index 0000000..60d478e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_53.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_54.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_54.png new file mode 100644 index 0000000..ac75bdd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_54.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_55.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_55.png new file mode 100644 index 0000000..3d122d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_55.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_56.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_56.png new file mode 100644 index 0000000..576d07f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_56.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_57.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_57.png new file mode 100644 index 0000000..545da73 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_57.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_58.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_58.png new file mode 100644 index 0000000..941542e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_58.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_59.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_59.png new file mode 100644 index 0000000..56f0102 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_59.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5a.png new file mode 100644 index 0000000..c14f1b1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5b.png new file mode 100644 index 0000000..f418e4c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5c.png new file mode 100644 index 0000000..e7efae6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5d.png new file mode 100644 index 0000000..7355fd3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5e.png new file mode 100644 index 0000000..abfd3af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5f.png new file mode 100644 index 0000000..5a64b50 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_5f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_60.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_60.png new file mode 100644 index 0000000..8166f15 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_60.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_61.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_61.png new file mode 100644 index 0000000..d11cd8a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_61.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_62.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_62.png new file mode 100644 index 0000000..f7b9a5b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_62.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_63.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_63.png new file mode 100644 index 0000000..5d4a8cc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_63.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_64.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_64.png new file mode 100644 index 0000000..bc43210 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_64.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_65.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_65.png new file mode 100644 index 0000000..42144c1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_65.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_66.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_66.png new file mode 100644 index 0000000..a65f25e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_66.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_67.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_67.png new file mode 100644 index 0000000..a115bb8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_67.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_68.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_68.png new file mode 100644 index 0000000..d47938b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_68.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_69.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_69.png new file mode 100644 index 0000000..c36e640 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_69.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6a.png new file mode 100644 index 0000000..5265d07 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6b.png new file mode 100644 index 0000000..6f207cc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6c.png new file mode 100644 index 0000000..6ffad7e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6d.png new file mode 100644 index 0000000..0fa88e3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6e.png new file mode 100644 index 0000000..301513e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6f.png new file mode 100644 index 0000000..a24cfff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_6f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_70.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_70.png new file mode 100644 index 0000000..2cec746 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_70.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_71.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_71.png new file mode 100644 index 0000000..1592ff4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_71.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_72.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_72.png new file mode 100644 index 0000000..856eedc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_72.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_73.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_73.png new file mode 100644 index 0000000..a7a2151 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_73.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_74.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_74.png new file mode 100644 index 0000000..a1b034a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_74.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_75.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_75.png new file mode 100644 index 0000000..512dc16 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_75.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_76.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_76.png new file mode 100644 index 0000000..12a45ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_76.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_77.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_77.png new file mode 100644 index 0000000..d763fba Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_77.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_78.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_78.png new file mode 100644 index 0000000..846c060 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_78.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_79.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_79.png new file mode 100644 index 0000000..f887cae Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_79.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7a.png new file mode 100644 index 0000000..90d5561 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7b.png new file mode 100644 index 0000000..2932cee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7c.png new file mode 100644 index 0000000..416a21b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7d.png new file mode 100644 index 0000000..2e12e13 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7e.png new file mode 100644 index 0000000..952bfab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7f.png new file mode 100644 index 0000000..d3d275c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_7f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_80.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_80.png new file mode 100644 index 0000000..044ac3e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_80.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_81.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_81.png new file mode 100644 index 0000000..913a4ca Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_81.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_82.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_82.png new file mode 100644 index 0000000..19b8ded Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_82.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_83.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_83.png new file mode 100644 index 0000000..ef2d794 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_83.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_84.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_84.png new file mode 100644 index 0000000..74a6a53 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_84.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_85.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_85.png new file mode 100644 index 0000000..73cb2f9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_85.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_86.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_86.png new file mode 100644 index 0000000..135d6fc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_86.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_87.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_87.png new file mode 100644 index 0000000..bef88db Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_87.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_88.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_88.png new file mode 100644 index 0000000..698ff80 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_88.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_89.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_89.png new file mode 100644 index 0000000..a3820ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_89.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8a.png new file mode 100644 index 0000000..beb9024 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8b.png new file mode 100644 index 0000000..7f978ab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8c.png new file mode 100644 index 0000000..3ed4594 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8d.png new file mode 100644 index 0000000..8d79123 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8e.png new file mode 100644 index 0000000..d82000b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8f.png new file mode 100644 index 0000000..b8c8328 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_8f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_90.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_90.png new file mode 100644 index 0000000..132974b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_90.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_91.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_91.png new file mode 100644 index 0000000..b8e09ae Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_91.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_92.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_92.png new file mode 100644 index 0000000..9244661 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_92.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_93.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_93.png new file mode 100644 index 0000000..f71d835 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_93.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_94.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_94.png new file mode 100644 index 0000000..fa68d81 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_94.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_95.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_95.png new file mode 100644 index 0000000..346bc36 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_95.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_96.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_96.png new file mode 100644 index 0000000..bbd1772 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_96.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_97.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_97.png new file mode 100644 index 0000000..2fd136b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_97.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_98.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_98.png new file mode 100644 index 0000000..9319c0b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_98.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_99.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_99.png new file mode 100644 index 0000000..2bb7f3e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_99.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9a.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9a.png new file mode 100644 index 0000000..cbdd91e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9a.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9b.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9b.png new file mode 100644 index 0000000..8a96209 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9b.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9c.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9c.png new file mode 100644 index 0000000..8e977ff Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9c.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9d.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9d.png new file mode 100644 index 0000000..5041d6a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9d.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9e.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9e.png new file mode 100644 index 0000000..1cb0a5b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9e.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9f.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9f.png new file mode 100644 index 0000000..d987326 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_9f.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a0.png new file mode 100644 index 0000000..8c47db0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a1.png new file mode 100644 index 0000000..5ede7e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a2.png new file mode 100644 index 0000000..a8c6ac1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a3.png new file mode 100644 index 0000000..7cc8448 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a4.png new file mode 100644 index 0000000..dc00e27 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a5.png new file mode 100644 index 0000000..eccfa47 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a6.png new file mode 100644 index 0000000..dcac87f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a7.png new file mode 100644 index 0000000..76c1ce2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a8.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a8.png new file mode 100644 index 0000000..a022390 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a8.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a9.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a9.png new file mode 100644 index 0000000..a35159a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_a9.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_aa.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_aa.png new file mode 100644 index 0000000..da1b615 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_aa.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ab.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ab.png new file mode 100644 index 0000000..0e45eae Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ab.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ac.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ac.png new file mode 100644 index 0000000..04d4d59 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ac.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ad.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ad.png new file mode 100644 index 0000000..3834337 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ad.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ae.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ae.png new file mode 100644 index 0000000..1445e68 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ae.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_af.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_af.png new file mode 100644 index 0000000..ea945dc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_af.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b0.png new file mode 100644 index 0000000..84b4885 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b1.png new file mode 100644 index 0000000..5f64672 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b2.png new file mode 100644 index 0000000..8551db8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b3.png new file mode 100644 index 0000000..b954159 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b4.png new file mode 100644 index 0000000..65991a4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b5.png new file mode 100644 index 0000000..3e6391b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b6.png new file mode 100644 index 0000000..df7c0f7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b7.png new file mode 100644 index 0000000..9142cad Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b8.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b8.png new file mode 100644 index 0000000..5b18d12 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b8.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b9.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b9.png new file mode 100644 index 0000000..0d212f0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_b9.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ba.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ba.png new file mode 100644 index 0000000..696cca9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ba.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bb.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bb.png new file mode 100644 index 0000000..5a2544c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bb.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bc.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bc.png new file mode 100644 index 0000000..df37526 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bc.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bd.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bd.png new file mode 100644 index 0000000..aed7803 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bd.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_be.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_be.png new file mode 100644 index 0000000..0da2254 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_be.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bf.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bf.png new file mode 100644 index 0000000..1f6a248 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_bf.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c0.png new file mode 100644 index 0000000..0610d67 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c1.png new file mode 100644 index 0000000..a95ca9b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c2.png new file mode 100644 index 0000000..f6a8961 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c3.png new file mode 100644 index 0000000..6470dd8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c4.png new file mode 100644 index 0000000..e8c3105 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c5.png new file mode 100644 index 0000000..d89f288 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c6.png new file mode 100644 index 0000000..004091d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c7.png new file mode 100644 index 0000000..f64f6b4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c8.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c8.png new file mode 100644 index 0000000..75f8a50 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c8.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c9.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c9.png new file mode 100644 index 0000000..fbd9435 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_c9.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ca.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ca.png new file mode 100644 index 0000000..112b9c6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ca.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cb.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cb.png new file mode 100644 index 0000000..c0549b5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cb.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cc.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cc.png new file mode 100644 index 0000000..0684431 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cc.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cd.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cd.png new file mode 100644 index 0000000..9fdc54d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cd.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ce.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ce.png new file mode 100644 index 0000000..958a96b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ce.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cf.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cf.png new file mode 100644 index 0000000..4106f1b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_cf.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d0.png new file mode 100644 index 0000000..546b014 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d1.png new file mode 100644 index 0000000..6d67bf1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d2.png new file mode 100644 index 0000000..c4ae511 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d3.png new file mode 100644 index 0000000..576c9ea Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d4.png new file mode 100644 index 0000000..14be6c7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d5.png new file mode 100644 index 0000000..3c41836 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d6.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d6.png new file mode 100644 index 0000000..27424b1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d6.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d7.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d7.png new file mode 100644 index 0000000..d8772d8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_d7.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_f9.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_f9.png new file mode 100644 index 0000000..e723235 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_f9.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fa.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fa.png new file mode 100644 index 0000000..d78dcfe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fa.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fb.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fb.png new file mode 100644 index 0000000..5423c86 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fb.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fc.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fc.png new file mode 100644 index 0000000..8034140 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fc.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fd.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fd.png new file mode 100644 index 0000000..c31bd6f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fd.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fe.png new file mode 100644 index 0000000..42ed33e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_fe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ff.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ff.png new file mode 100644 index 0000000..f0ff742 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/font/unicode_page_ff.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_background.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_background.png new file mode 100644 index 0000000..921bce0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_background.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png new file mode 100644 index 0000000..8c4ae79 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/achievement/achievement_icons.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/book.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/book.png new file mode 100644 index 0000000..3e4ba4e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/book.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/anvil.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/anvil.png new file mode 100644 index 0000000..34e8f9f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/anvil.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/beacon.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/beacon.png new file mode 100644 index 0000000..f51a2ef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/beacon.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/brewing_stand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/brewing_stand.png new file mode 100644 index 0000000..e7dc203 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/brewing_stand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/crafting_table.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/crafting_table.png new file mode 100644 index 0000000..254dacc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/crafting_table.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png new file mode 100644 index 0000000..c8d53a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_inventory.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png new file mode 100644 index 0000000..cc250e5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_item_search.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png new file mode 100644 index 0000000..38421f7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tab_items.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png new file mode 100644 index 0000000..1c44093 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/creative_inventory/tabs.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/dispenser.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/dispenser.png new file mode 100644 index 0000000..0a6ebe7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/dispenser.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/enchanting_table.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/enchanting_table.png new file mode 100644 index 0000000..59aeb04 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/enchanting_table.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/furnace.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/furnace.png new file mode 100644 index 0000000..2255d0a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/furnace.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/generic_54.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/generic_54.png new file mode 100644 index 0000000..0b880ef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/generic_54.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/hopper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/hopper.png new file mode 100644 index 0000000..3d00547 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/hopper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/horse.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/horse.png new file mode 100644 index 0000000..194cc6b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/horse.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/inventory.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/inventory.png new file mode 100644 index 0000000..d553c4f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/inventory.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/stats_icons.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/stats_icons.png new file mode 100644 index 0000000..f13323b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/stats_icons.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/villager.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/villager.png new file mode 100644 index 0000000..3211a7a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/container/villager.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/demo_background.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/demo_background.png new file mode 100644 index 0000000..a7fd8be Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/demo_background.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/icons.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/icons.png new file mode 100644 index 0000000..8aec716 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/icons.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/options_background.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/options_background.png new file mode 100644 index 0000000..cae5528 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/options_background.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/resource_packs.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/resource_packs.png new file mode 100644 index 0000000..15a80bd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/resource_packs.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/stream_indicator.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/stream_indicator.png new file mode 100644 index 0000000..b426b7e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/stream_indicator.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_0.png new file mode 100644 index 0000000..27f015d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_1.png new file mode 100644 index 0000000..c16841a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_2.png new file mode 100644 index 0000000..0436d77 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_3.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_3.png new file mode 100644 index 0000000..2c7ad77 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_3.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_4.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_4.png new file mode 100644 index 0000000..0390096 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_4.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_5.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_5.png new file mode 100644 index 0000000..0331ad4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/background/panorama_5.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/minecraft.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/minecraft.png new file mode 100644 index 0000000..b393bd9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/minecraft.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/mojang.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/mojang.png new file mode 100644 index 0000000..a82cf6c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/title/mojang.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/widgets.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/widgets.png new file mode 100644 index 0000000..e1194d4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/gui/widgets.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple.png new file mode 100644 index 0000000..3e2ee59 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple_golden.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple_golden.png new file mode 100644 index 0000000..6201989 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/apple_golden.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/arrow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/arrow.png new file mode 100644 index 0000000..4f748a0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/arrow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bed.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bed.png new file mode 100644 index 0000000..22a4cf0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bed.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_cooked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_cooked.png new file mode 100644 index 0000000..a1c765a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_cooked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_raw.png new file mode 100644 index 0000000..82af4e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/beef_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_powder.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_powder.png new file mode 100644 index 0000000..89c57d6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_powder.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_rod.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_rod.png new file mode 100644 index 0000000..7050e10 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/blaze_rod.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/boat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/boat.png new file mode 100644 index 0000000..235e0a2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/boat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bone.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bone.png new file mode 100644 index 0000000..3faca89 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bone.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_enchanted.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_enchanted.png new file mode 100644 index 0000000..44215f6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_enchanted.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_normal.png new file mode 100644 index 0000000..f791ae4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_writable.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_writable.png new file mode 100644 index 0000000..fa95246 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_writable.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_written.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_written.png new file mode 100644 index 0000000..b2a2aa8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/book_written.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_0.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_0.png new file mode 100644 index 0000000..2022aab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_0.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_1.png new file mode 100644 index 0000000..a132079 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_2.png new file mode 100644 index 0000000..d459e68 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_pulling_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_standby.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_standby.png new file mode 100644 index 0000000..d709b9c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bow_standby.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bowl.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bowl.png new file mode 100644 index 0000000..63d16ad Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bowl.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bread.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bread.png new file mode 100644 index 0000000..c833604 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bread.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brewing_stand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brewing_stand.png new file mode 100644 index 0000000..97db9af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brewing_stand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brick.png new file mode 100644 index 0000000..11e74be Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/brick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_empty.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_empty.png new file mode 100644 index 0000000..f8e5369 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_empty.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_lava.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_lava.png new file mode 100644 index 0000000..13a1957 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_lava.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_milk.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_milk.png new file mode 100644 index 0000000..c77d92c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_milk.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_water.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_water.png new file mode 100644 index 0000000..2f36acc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/bucket_water.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cake.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cake.png new file mode 100644 index 0000000..46e94b8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cake.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot.png new file mode 100644 index 0000000..2d08aab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_golden.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_golden.png new file mode 100644 index 0000000..e0f1ea6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_golden.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_on_a_stick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_on_a_stick.png new file mode 100644 index 0000000..9e88571 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/carrot_on_a_stick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cauldron.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cauldron.png new file mode 100644 index 0000000..e3186eb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cauldron.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_boots.png new file mode 100644 index 0000000..54a4a15 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_chestplate.png new file mode 100644 index 0000000..cd2115a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_helmet.png new file mode 100644 index 0000000..a143338 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_leggings.png new file mode 100644 index 0000000..dae4b26 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chainmail_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/charcoal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/charcoal.png new file mode 100644 index 0000000..20d5b25 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/charcoal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_cooked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_cooked.png new file mode 100644 index 0000000..890b5b3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_cooked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_raw.png new file mode 100644 index 0000000..6d25922 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/chicken_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clay_ball.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clay_ball.png new file mode 100644 index 0000000..5103d6c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clay_ball.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png new file mode 100644 index 0000000..069a0ab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/clock.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/coal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/coal.png new file mode 100644 index 0000000..5563b6f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/coal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/comparator.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/comparator.png new file mode 100644 index 0000000..28b8eec Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/comparator.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png new file mode 100644 index 0000000..9dcbdfe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/compass.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cookie.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cookie.png new file mode 100644 index 0000000..01fe56b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/cookie.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond.png new file mode 100644 index 0000000..10e70a0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_axe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_axe.png new file mode 100644 index 0000000..7627f87 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_axe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_boots.png new file mode 100644 index 0000000..70d9e5f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_chestplate.png new file mode 100644 index 0000000..afdff93 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_helmet.png new file mode 100644 index 0000000..1c88592 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_hoe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_hoe.png new file mode 100644 index 0000000..c9a97e0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_hoe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_horse_armor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_horse_armor.png new file mode 100644 index 0000000..b281aad Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_horse_armor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_leggings.png new file mode 100644 index 0000000..a99c896 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_pickaxe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_pickaxe.png new file mode 100644 index 0000000..c279828 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_pickaxe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_shovel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_shovel.png new file mode 100644 index 0000000..e4a8992 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_shovel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_sword.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_sword.png new file mode 100644 index 0000000..2a1552d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/diamond_sword.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_iron.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_iron.png new file mode 100644 index 0000000..67877ab Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_iron.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_wood.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_wood.png new file mode 100644 index 0000000..750307f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/door_wood.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_black.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_black.png new file mode 100644 index 0000000..909bea5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_black.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_blue.png new file mode 100644 index 0000000..4713983 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_brown.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_brown.png new file mode 100644 index 0000000..62eae8d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_brown.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_cyan.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_cyan.png new file mode 100644 index 0000000..7b10c11 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_cyan.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_gray.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_gray.png new file mode 100644 index 0000000..4fce7e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_gray.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_green.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_green.png new file mode 100644 index 0000000..009e058 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_green.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_light_blue.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_light_blue.png new file mode 100644 index 0000000..a8b45c9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_light_blue.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_lime.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_lime.png new file mode 100644 index 0000000..7a78764 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_lime.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_magenta.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_magenta.png new file mode 100644 index 0000000..ea7342a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_magenta.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_orange.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_orange.png new file mode 100644 index 0000000..677a1aa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_orange.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_pink.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_pink.png new file mode 100644 index 0000000..1acc483 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_pink.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_purple.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_purple.png new file mode 100644 index 0000000..7d201c2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_purple.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_red.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_red.png new file mode 100644 index 0000000..2d1a742 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_red.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_silver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_silver.png new file mode 100644 index 0000000..fa9e501 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_silver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_white.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_white.png new file mode 100644 index 0000000..5b1833b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_white.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_yellow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_yellow.png new file mode 100644 index 0000000..95e0673 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/dye_powder_yellow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/egg.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/egg.png new file mode 100644 index 0000000..a6fe2bf Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/egg.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/emerald.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/emerald.png new file mode 100644 index 0000000..98d953e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/emerald.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png new file mode 100644 index 0000000..fd7e05f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png new file mode 100644 index 0000000..6e632b9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png new file mode 100644 index 0000000..3a455f3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png new file mode 100644 index 0000000..28b2c49 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/empty_armor_slot_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_eye.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_eye.png new file mode 100644 index 0000000..8c4ef4e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_eye.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_pearl.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_pearl.png new file mode 100644 index 0000000..4b752a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ender_pearl.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/experience_bottle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/experience_bottle.png new file mode 100644 index 0000000..ae4214f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/experience_bottle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/feather.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/feather.png new file mode 100644 index 0000000..d4c3be5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/feather.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireball.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireball.png new file mode 100644 index 0000000..d62a6f4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireball.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks.png new file mode 100644 index 0000000..f1e07fd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge.png new file mode 100644 index 0000000..43a4a21 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png new file mode 100644 index 0000000..d8b91a9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fireworks_charge_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_clownfish_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_clownfish_raw.png new file mode 100644 index 0000000..41df72f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_clownfish_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_cooked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_cooked.png new file mode 100644 index 0000000..87564c7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_cooked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_raw.png new file mode 100644 index 0000000..32996bf Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_cod_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png new file mode 100644 index 0000000..aadbd88 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_pufferfish_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_cooked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_cooked.png new file mode 100644 index 0000000..fb765ed Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_cooked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_raw.png new file mode 100644 index 0000000..68bcd69 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fish_salmon_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_cast.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_cast.png new file mode 100644 index 0000000..a5ab378 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_cast.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_uncast.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_uncast.png new file mode 100644 index 0000000..d4b53f0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/fishing_rod_uncast.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint.png new file mode 100644 index 0000000..5f51093 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint_and_steel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint_and_steel.png new file mode 100644 index 0000000..77bc340 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flint_and_steel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flower_pot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flower_pot.png new file mode 100644 index 0000000..c4f26d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/flower_pot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ghast_tear.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ghast_tear.png new file mode 100644 index 0000000..e5c741f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ghast_tear.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/glowstone_dust.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/glowstone_dust.png new file mode 100644 index 0000000..edd93a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/glowstone_dust.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_axe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_axe.png new file mode 100644 index 0000000..0f47b60 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_axe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_boots.png new file mode 100644 index 0000000..f6033d2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_chestplate.png new file mode 100644 index 0000000..e36076a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_helmet.png new file mode 100644 index 0000000..9eb89a0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_hoe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_hoe.png new file mode 100644 index 0000000..1685d47 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_hoe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_horse_armor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_horse_armor.png new file mode 100644 index 0000000..7c5c3a5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_horse_armor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_ingot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_ingot.png new file mode 100644 index 0000000..ea781e7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_ingot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_leggings.png new file mode 100644 index 0000000..da23771 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_nugget.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_nugget.png new file mode 100644 index 0000000..3a9a2fe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_nugget.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_pickaxe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_pickaxe.png new file mode 100644 index 0000000..ecccafe Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_pickaxe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_shovel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_shovel.png new file mode 100644 index 0000000..150cbb9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_shovel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_sword.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_sword.png new file mode 100644 index 0000000..0ddef04 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gold_sword.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gunpowder.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gunpowder.png new file mode 100644 index 0000000..73cadec Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/gunpowder.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/hopper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/hopper.png new file mode 100644 index 0000000..f8b244f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/hopper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_axe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_axe.png new file mode 100644 index 0000000..8bf133e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_axe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_boots.png new file mode 100644 index 0000000..b69ca05 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_chestplate.png new file mode 100644 index 0000000..e7993ce Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_helmet.png new file mode 100644 index 0000000..65e64cc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_hoe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_hoe.png new file mode 100644 index 0000000..28d4c36 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_hoe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_horse_armor.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_horse_armor.png new file mode 100644 index 0000000..5d697d1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_horse_armor.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_ingot.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_ingot.png new file mode 100644 index 0000000..3833fa0 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_ingot.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_leggings.png new file mode 100644 index 0000000..ad53673 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_pickaxe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_pickaxe.png new file mode 100644 index 0000000..d21440b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_pickaxe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_shovel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_shovel.png new file mode 100644 index 0000000..079b236 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_shovel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_sword.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_sword.png new file mode 100644 index 0000000..4d49c5a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/iron_sword.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/item_frame.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/item_frame.png new file mode 100644 index 0000000..261c98a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/item_frame.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/lead.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/lead.png new file mode 100644 index 0000000..0ef5312 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/lead.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather.png new file mode 100644 index 0000000..13dc199 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots.png new file mode 100644 index 0000000..31c2132 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots_overlay.png new file mode 100644 index 0000000..b6896d8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_boots_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate.png new file mode 100644 index 0000000..e534aef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png new file mode 100644 index 0000000..125fd34 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_chestplate_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet.png new file mode 100644 index 0000000..da2cfa8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet_overlay.png new file mode 100644 index 0000000..8040d77 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_helmet_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings.png new file mode 100644 index 0000000..3ff24ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings_overlay.png new file mode 100644 index 0000000..813ba26 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/leather_leggings_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/magma_cream.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/magma_cream.png new file mode 100644 index 0000000..b2be210 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/magma_cream.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_empty.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_empty.png new file mode 100644 index 0000000..8dc6e58 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_empty.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_filled.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_filled.png new file mode 100644 index 0000000..1381e21 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/map_filled.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon.png new file mode 100644 index 0000000..590f47a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon_speckled.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon_speckled.png new file mode 100644 index 0000000..dee1bf5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/melon_speckled.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_chest.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_chest.png new file mode 100644 index 0000000..78a3778 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_chest.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_command_block.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_command_block.png new file mode 100644 index 0000000..c597ee7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_command_block.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_furnace.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_furnace.png new file mode 100644 index 0000000..5478f25 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_furnace.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_hopper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_hopper.png new file mode 100644 index 0000000..8a138fb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_hopper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_normal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_normal.png new file mode 100644 index 0000000..2046f2b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_normal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_tnt.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_tnt.png new file mode 100644 index 0000000..561279b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/minecart_tnt.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/mushroom_stew.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/mushroom_stew.png new file mode 100644 index 0000000..5598bc7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/mushroom_stew.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/name_tag.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/name_tag.png new file mode 100644 index 0000000..a88f559 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/name_tag.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_star.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_star.png new file mode 100644 index 0000000..6b848af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_star.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_wart.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_wart.png new file mode 100644 index 0000000..09da1e3 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/nether_wart.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/netherbrick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/netherbrick.png new file mode 100644 index 0000000..e9c14ed Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/netherbrick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/painting.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/painting.png new file mode 100644 index 0000000..b394f30 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/painting.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/paper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/paper.png new file mode 100644 index 0000000..a1d9c7e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/paper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_cooked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_cooked.png new file mode 100644 index 0000000..605d3f5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_cooked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_raw.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_raw.png new file mode 100644 index 0000000..7e83c1a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/porkchop_raw.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato.png new file mode 100644 index 0000000..c1d8541 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_baked.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_baked.png new file mode 100644 index 0000000..e4d765b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_baked.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_poisonous.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_poisonous.png new file mode 100644 index 0000000..6f154af Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potato_poisonous.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_drinkable.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_empty.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_empty.png new file mode 100644 index 0000000..87339d7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_empty.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_splash.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_splash.png new file mode 100644 index 0000000..03b1f90 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_bottle_splash.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_overlay.png new file mode 100644 index 0000000..1e6165e Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/potion_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/pumpkin_pie.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/pumpkin_pie.png new file mode 100644 index 0000000..c21a032 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/pumpkin_pie.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quartz.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quartz.png new file mode 100644 index 0000000..e403446 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quartz.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quiver.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quiver.png new file mode 100644 index 0000000..818f728 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/quiver.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_11.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_11.png new file mode 100644 index 0000000..07ac487 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_11.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_13.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_13.png new file mode 100644 index 0000000..ead0c61 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_13.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_blocks.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_blocks.png new file mode 100644 index 0000000..3732d6c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_blocks.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_cat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_cat.png new file mode 100644 index 0000000..b3527ef Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_cat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_chirp.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_chirp.png new file mode 100644 index 0000000..1b24e11 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_chirp.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_far.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_far.png new file mode 100644 index 0000000..2320efd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_far.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mall.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mall.png new file mode 100644 index 0000000..811d046 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mall.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mellohi.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mellohi.png new file mode 100644 index 0000000..879b6a4 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_mellohi.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_stal.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_stal.png new file mode 100644 index 0000000..c650d21 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_stal.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_strad.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_strad.png new file mode 100644 index 0000000..72d6e32 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_strad.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_wait.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_wait.png new file mode 100644 index 0000000..5306b51 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_wait.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_ward.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_ward.png new file mode 100644 index 0000000..b33b93d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/record_ward.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/redstone_dust.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/redstone_dust.png new file mode 100644 index 0000000..6da938b Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/redstone_dust.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/reeds.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/reeds.png new file mode 100644 index 0000000..40872c6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/reeds.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/repeater.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/repeater.png new file mode 100644 index 0000000..7a07381 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/repeater.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/rotten_flesh.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/rotten_flesh.png new file mode 100644 index 0000000..3f39998 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/rotten_flesh.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ruby.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ruby.png new file mode 100644 index 0000000..4f288d9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/ruby.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/saddle.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/saddle.png new file mode 100644 index 0000000..b12eafa Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/saddle.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_melon.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_melon.png new file mode 100644 index 0000000..ef84499 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_melon.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_pumpkin.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_pumpkin.png new file mode 100644 index 0000000..8d8f076 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_pumpkin.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_wheat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_wheat.png new file mode 100644 index 0000000..83d23a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/seeds_wheat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/shears.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/shears.png new file mode 100644 index 0000000..f9c6de1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/shears.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sign.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sign.png new file mode 100644 index 0000000..9b6e2ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sign.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_creeper.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_creeper.png new file mode 100644 index 0000000..c195fd5 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_creeper.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_skeleton.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_skeleton.png new file mode 100644 index 0000000..bf383fc Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_skeleton.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_steve.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_steve.png new file mode 100644 index 0000000..e56f406 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_steve.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_wither.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_wither.png new file mode 100644 index 0000000..3571603 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_wither.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_zombie.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_zombie.png new file mode 100644 index 0000000..67d1347 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/skull_zombie.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/slimeball.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/slimeball.png new file mode 100644 index 0000000..46478ee Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/slimeball.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/snowball.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/snowball.png new file mode 100644 index 0000000..340c639 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/snowball.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg.png new file mode 100644 index 0000000..23259c7 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg_overlay.png new file mode 100644 index 0000000..83ec78f Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spawn_egg_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye.png new file mode 100644 index 0000000..35d8584 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye_fermented.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye_fermented.png new file mode 100644 index 0000000..226ffb8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/spider_eye_fermented.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stick.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stick.png new file mode 100644 index 0000000..6f8ce13 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stick.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_axe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_axe.png new file mode 100644 index 0000000..fb33584 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_axe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_hoe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_hoe.png new file mode 100644 index 0000000..d46b272 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_hoe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_pickaxe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_pickaxe.png new file mode 100644 index 0000000..19a8e50 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_pickaxe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_shovel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_shovel.png new file mode 100644 index 0000000..8e1c0c2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_shovel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_sword.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_sword.png new file mode 100644 index 0000000..5810dfd Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/stone_sword.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/string.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/string.png new file mode 100644 index 0000000..0b04ddb Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/string.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sugar.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sugar.png new file mode 100644 index 0000000..0864df9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/sugar.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wheat.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wheat.png new file mode 100644 index 0000000..bbd2fd9 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wheat.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_axe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_axe.png new file mode 100644 index 0000000..3a19203 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_axe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_hoe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_hoe.png new file mode 100644 index 0000000..de1c7a6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_hoe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_pickaxe.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_pickaxe.png new file mode 100644 index 0000000..ebc6756 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_pickaxe.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_shovel.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_shovel.png new file mode 100644 index 0000000..b057911 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_shovel.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_sword.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_sword.png new file mode 100644 index 0000000..c04dc0a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/items/wood_sword.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_background.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_background.png new file mode 100644 index 0000000..2783b50 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_background.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_icons.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_icons.png new file mode 100644 index 0000000..c2f35b8 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/map/map_icons.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png new file mode 100644 index 0000000..f9ca97c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta new file mode 100644 index 0000000..e38a5ad --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/enchanted_item_glint.png.mcmeta @@ -0,0 +1,5 @@ +{ + "texture": { + "blur": true + } +} diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png new file mode 100644 index 0000000..d9725ce Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/pumpkinblur.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png new file mode 100644 index 0000000..b09fd47 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png.mcmeta new file mode 100644 index 0000000..8c6c7d1 --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/shadow.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "clamp": true + } +} + diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/underwater.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/underwater.png new file mode 100644 index 0000000..2fc23b1 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/underwater.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/unknown_pack.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/unknown_pack.png new file mode 100644 index 0000000..16afade Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/unknown_pack.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png new file mode 100644 index 0000000..9c14e2d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png.mcmeta b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png.mcmeta new file mode 100644 index 0000000..2077f3c --- /dev/null +++ b/build/rfg/minecraft-src/resources/assets/minecraft/textures/misc/vignette.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": true + } +} + diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png new file mode 100644 index 0000000..9f84c18 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png new file mode 100644 index 0000000..117811c Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/chainmail_layer_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png new file mode 100644 index 0000000..14fecf2 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png new file mode 100644 index 0000000..2cca056 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/diamond_layer_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_1.png new file mode 100644 index 0000000..6802e06 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_2.png new file mode 100644 index 0000000..a7cf835 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/gold_layer_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_1.png new file mode 100644 index 0000000..6da6e84 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_2.png new file mode 100644 index 0000000..fab422a Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/iron_layer_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1.png new file mode 100644 index 0000000..ebcfc41 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png new file mode 100644 index 0000000..546397d Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_1_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2.png new file mode 100644 index 0000000..8d8bba6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png new file mode 100644 index 0000000..5655659 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/models/armor/leather_layer_2_overlay.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png new file mode 100644 index 0000000..d7df7f6 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/painting/paintings_kristoffer_zetterstrand.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/footprint.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/footprint.png new file mode 100644 index 0000000..8d23f64 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/footprint.png differ diff --git a/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/particles.png b/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/particles.png new file mode 100644 index 0000000..eec1f89 Binary files /dev/null and b/build/rfg/minecraft-src/resources/assets/minecraft/textures/particle/particles.png differ diff --git a/build/rfg/minecraft-src/resources/deobfuscation_data-1.7.10.lzma b/build/rfg/minecraft-src/resources/deobfuscation_data-1.7.10.lzma new file mode 100644 index 0000000..c451403 Binary files /dev/null and b/build/rfg/minecraft-src/resources/deobfuscation_data-1.7.10.lzma differ diff --git a/build/rfg/minecraft-src/resources/fml_at.cfg b/build/rfg/minecraft-src/resources/fml_at.cfg new file mode 100644 index 0000000..58fda4c --- /dev/null +++ b/build/rfg/minecraft-src/resources/fml_at.cfg @@ -0,0 +1,118 @@ +#Main FML Access Transformer configuration file +# TileEntity addMapping +public net.minecraft.tileentity.TileEntity func_145826_a(Ljava/lang/Class;Ljava/lang/String;)V +# EntityList addMappings +public net.minecraft.entity.EntityList func_75618_a(Ljava/lang/Class;Ljava/lang/String;I)V +public net.minecraft.entity.EntityList func_75614_a(Ljava/lang/Class;Ljava/lang/String;III)V +public net.minecraft.entity.EntityList field_75625_b #nameToClassMap +public net.minecraft.entity.EntityList field_75626_c #classToNameMap +public net.minecraft.entity.EntityList field_75623_d #idToClassMap +## RenderManager +public net.minecraft.client.renderer.entity.RenderManager field_78729_o #renderers +## RenderBlocks - everything +public net.minecraft.client.renderer.RenderBlocks * # all fields +public net.minecraft.client.renderer.RenderBlocks *() # all methods +##RenderPlayer +##public-f bht.h #FD:RenderPlayer/field_77110_j #armorlist # -- MISSING MAPPING +##RenderBiped +public-f net.minecraft.client.renderer.entity.RenderBiped field_82424_k #armorlist +##StringTranslate +##public bp.b #FD:StringTranslate/field_74815_b # -- MISSING MAPPING +##public bp.e #FD:StringTranslate/field_74813_d # -- MISSING MAPPING +## TileEntityRendererDispatcher +public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher field_147559_m +## CraftingManager - make the add recipe methods public +public net.minecraft.item.crafting.CraftingManager func_92103_a(Lnet.minecraft.item.ItemStack;[Ljava/lang/Object;)Lnet.minecraft.item.crafting.ShapedRecipes; +public net.minecraft.item.crafting.CraftingManager func_77596_b(Lnet.minecraft.item.ItemStack;[Ljava/lang/Object;)V +## WeightedRandomItem +public net.minecraft.util.WeightedRandom$Item field_76292_a #probability +## ItemStack +##public+f tv.c #FD:ItemStack/field_77993_c #itemId +## StatBase +#public ku.a #FD:StatBase/field_75978_a #statName +## NetLoginHandler +#public jy.a(Ljy;Z)Z #MD:NetLoginHandler/func_72531_a #'complete connection' +#public jy.g #FD:NetLoginHandler/field_72543_h #userName +## EntityPlayerMP getNextWindowId +public net.minecraft.entity.player.EntityPlayerMP func_71117_bO()V +public net.minecraft.entity.player.EntityPlayerMP field_71139_cq +## EntityAITaskEntry +public net.minecraft.entity.ai.EntityAITasks$EntityAITaskEntry +## EntityAITasks +#public pt.a #FD:EntityAITasks/field_75782_a #taskList +## BlockChest +#public ank.m(Labw;III)Z #MD:BlockChest/func_72292_n #isOcelotBlockingChest +## EntityLiving +##public ng.aU #FD:EntityLiving/field_70736_aM #carryoverDamage # -- MISSING MAPPING +public net.minecraft.entity.EntityLiving field_70714_bg #tasks +public net.minecraft.entity.EntityLiving field_70715_bh #targetTasks +##public ng.bG #FD:EntityLiving/field_70703_bu #isJumping # -- MISSING MAPPING +## EntityAIOcelotSit +#protected qg.a(Labw;III)Z #MD:EntityAIOcelotSit/func_75398_a #nearestSittableBlock +#protected qg.f()Z #MD:EntityAIOcelotSit/func_75399_f #isblocksittable +## CallableMinecraftVersion - sanity check the MC version +#public c #CL:CallableMinecraftVersion +#public c.(Lb;)V #MD:CallableMinecraftVersion/(Lnet/minecraft/src/CrashReport;) #constructor +## EntityAnimal +#public rp.bp #FD:EntityAnimal/field_70881_d #inLove +## WorldType +#public acg.(ILjava/lang/String;)V #MD:WorldType/(ILjava/lang/String;) +#public acg.(ILjava/lang/String;I)V #MD:WorldType/(ILjava/lang/String;I) +## ComponentVillage +#public ajm #CL:ComponentVillage +## StructureStart +#public aiv.a #FD:StructureStart/field_75075_a +## EntityVillager - minmax lists +public net.minecraft.entity.passive.EntityVillager func_146091_a(Lnet/minecraft/village/MerchantRecipeList;Lnet/minecraft/item/Item;Ljava/util/Random;F)V # buy +public net.minecraft.entity.passive.EntityVillager func_146089_b(Lnet/minecraft/village/MerchantRecipeList;Lnet/minecraft/item/Item;Ljava/util/Random;F)V # sell +public net.minecraft.entity.passive.EntityVillager field_70958_bB +public net.minecraft.entity.passive.EntityVillager field_70960_bC +## GuiButtonMerchant +#public axx #CL:GuiButtonMerchant +# GuiScreen +public net.minecraft.client.gui.GuiScreen field_146297_k # minecraft instance - public because gui's outside access it +# Minecraft +#public atv.D #FD:Minecraft/field_71425_J #running +public net.minecraft.client.Minecraft field_71446_o # textureManager +public net.minecraft.client.Minecraft field_110450_ap # mcDefaultResourcePack +public net.minecraft.client.Minecraft func_71370_a(II)V # resize +public net.minecraft.client.Minecraft func_71357_I()V # loadScreen +## ItemBlock +public net.minecraft.item.ItemBlock field_150939_a +## DedicatedServer +public net.minecraft.server.dedicated.DedicatedServer field_71341_l # pendingCommandList +## SaveFormatOld +public net.minecraft.world.storage.SaveFormatOld field_75808_a # savesDirectory + +protected net.minecraft.util.ObjectIntIdentityMap field_148749_a # internal map +protected net.minecraft.util.ObjectIntIdentityMap field_148748_b # internal index list +protected-f net.minecraft.util.RegistryNamespaced field_148759_a # identitymap +protected net.minecraft.util.RegistryNamespaced func_148755_c(Ljava/lang/String;)Ljava/lang/String; # prefix if necessary + +# GuiButton +public net.minecraft.client.gui.GuiButton field_146120_f # width - needed for config GUI stuff +public net.minecraft.client.gui.GuiButton field_146121_g # height - needed for config GUI stuff +# GuiTextField +public-f net.minecraft.client.gui.GuiTextField field_146209_f # xPosition - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146210_g # yPosition - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146218_h # width - needed for config GUI stuff +public-f net.minecraft.client.gui.GuiTextField field_146219_i # height - needed for config GUI stuff +# GuiSlot +public net.minecraft.client.gui.GuiSlot field_148149_f # slotHeight - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148151_d # right - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148152_e # left - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148153_b # top - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148154_c # bottom - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148155_a # width - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148158_l # height - needed for config GUI stuff +public net.minecraft.client.gui.GuiSlot field_148160_j # headerPadding - needed for config GUI stuff + +# Font renderer +protected net.minecraft.client.gui.FontRenderer field_78288_b # FONT_HEIGHT +protected net.minecraft.client.gui.FontRenderer field_78286_d # charWidth +protected net.minecraft.client.gui.FontRenderer field_78287_e # glyphWidth +protected net.minecraft.client.gui.FontRenderer field_111273_g # locationFontTexture +protected net.minecraft.client.gui.FontRenderer field_78295_j # posX +protected net.minecraft.client.gui.FontRenderer field_78296_k # posY +protected net.minecraft.client.gui.FontRenderer func_78266_a(IZ)F # renderDefaultChar +protected net.minecraft.client.gui.FontRenderer func_78277_a(CZ)F # renderUnicodeChar diff --git a/build/rfg/minecraft-src/resources/fml_marker.cfg b/build/rfg/minecraft-src/resources/fml_marker.cfg new file mode 100644 index 0000000..bfd4e92 --- /dev/null +++ b/build/rfg/minecraft-src/resources/fml_marker.cfg @@ -0,0 +1,3 @@ +# Marker interfaces to add to minecraft - helps in bukkit and client/server unification +# Only runs at runtime because it's not necessary at compile time +# has deobf and obf mappings so it runs OK in mcp diff --git a/build/rfg/minecraft-src/resources/fmlversion.properties b/build/rfg/minecraft-src/resources/fmlversion.properties new file mode 100644 index 0000000..fa4de18 --- /dev/null +++ b/build/rfg/minecraft-src/resources/fmlversion.properties @@ -0,0 +1,6 @@ +fmlbuild.major.number=7 +fmlbuild.minor.number=99 +fmlbuild.revision.number=40 +fmlbuild.build.number=1614 +fmlbuild.mcversion=1.7.10 +fmlbuild.mcpversion=9.05 diff --git a/build/rfg/minecraft-src/resources/forge_at.cfg b/build/rfg/minecraft-src/resources/forge_at.cfg new file mode 100644 index 0000000..06028ee --- /dev/null +++ b/build/rfg/minecraft-src/resources/forge_at.cfg @@ -0,0 +1,191 @@ +#Main Forge Access Transformer configuration file +# Tessellator +#public-f bfq.a #FD:Tessellator/field_78398_a #instance +#public bfq.u #FD:Tessellator/field_78409_u #drawMode +#public bfq.v #FD:Tessellator/field_78408_v #xOffset +#public bfq.w #FD:Tessellator/field_78407_w #yOffset +#public bfq.x #FD:Tessellator/field_78417_x #zOffset +#public bfq.z #FD:Tessellator/field_78415_z #isDrawing +# EntityFishHook +public net.minecraft.entity.projectile.EntityFishHook field_146041_e +public net.minecraft.entity.projectile.EntityFishHook field_146036_f +public net.minecraft.entity.projectile.EntityFishHook field_146039_d +# ItemPickaxe +public net.minecraft.item.ItemPickaxe (Lnet.minecraft.item.Item$ToolMaterial;) +public net.minecraft.item.ItemAxe (Lnet.minecraft.item.Item$ToolMaterial;) +public net.minecraft.item.ItemSpade (Lnet.minecraft.item.Item$ToolMaterial;) +# ItemTool +#public xj.a #FD:ItemTool/field_77864_a #efficiencyOnProperMaterial +#public xj.d #FD:ItemTool/field_77865_bY #damageVsEntity +# EntityEnderman +#public tg.br #FD:EntityEnderman/field_70827_d #carriableBlocks +# RenderGlobal +#public bfl.k #FD:RenderGlobal/field_72769_h #theWorld +#public bfl.l #FD:RenderGlobal/field_72770_i #renderEngine +#public bfl.t #FD:RenderGlobal/field_72777_q #mc +#public bfl.u #FD:RenderGlobal/field_72776_r #globalRenderBlocks +#public bfl.H #FD:RenderGlobal/field_72738_E #damagedBlocks +# SoundManager +public net.minecraft.client.audio.SoundManager field_148622_c #sndHandler +# EntityMinecart +#protected st.* #FD:EntityMinecart/* # All private -> protected +# Block +public net.minecraft.block.Block (Lnet/minecraft/src/Material;)V +public net.minecraft.block.Block func_149658_d(Ljava/lang/String;)Lnet.minecraft.block.Block; #setIconName +public net.minecraft.block.Block func_149672_a(Lnet.minecraft.block.Block$SoundType;)Lnet.minecraft.block.Block; #setStepSound +public net.minecraft.block.Block func_149752_b(F)Lnet.minecraft.block.Block; #setResistance +public net.minecraft.block.Block func_149711_c(F)Lnet.minecraft.block.Block; #setHardness +public net.minecraft.block.Block func_149713_g(I)Lnet.minecraft.block.Block; #setLightOpacity +public net.minecraft.block.Block func_149715_a(F)Lnet.minecraft.block.Block; #setLightValue +public net.minecraft.block.Block func_149722_s()Lnet.minecraft.block.Block; #setBlockUnbreakable +public net.minecraft.block.Block func_149675_a(Z)Lnet.minecraft.block.Block; #setTickRandomly +public net.minecraft.block.Block func_149676_a(FFFFFF)V #setBlockBounds +public net.minecraft.block.Block func_149657_c(Lnet/minecraft/world/World;IIII)V # dropXpOnBlockBreak +# NetServerHandler +#public ka.f #FD:NetServerHandler/field_72572_g #playerInAirTime +# TileEntity +#public asp.k #FD:TileEntity/field_70331_k #worldObj +# BlockLeavesBase +#public arh.d #FD:BlockLeavesBase/field_72131_c #graphicsLevel +# Item +public net.minecraft.item.Item func_77656_e(I)Lnet.minecraft.item.Item; #setMaxDamage +public-f net.minecraft.item.Item func_77650_f(Lnet.minecraft.item.ItemStack;)Lnet.minecraft.util.IIcon; #getIcon is Final for unknown reason +public net.minecraft.item.Item func_77627_a(Z)Lnet.minecraft.item.Item; #setHasSubtypes +public net.minecraft.item.Item func_77631_c(Ljava.lang.String;)Lnet.minecraft.item.Item; #setPotionEffect +public net.minecraft.item.Item func_111206_d(Ljava.lang.String;)Lnet.minecraft.item.Item; #setTextureName +# RailLogic +#public amz #CL:BlockBaseRailLogic +#public amz.a()I #MD:BlockBaseRailLogic/func_94505_a #getNAdjacentTiles +# EntityPlayer +public net.minecraft.entity.player.EntityPlayer func_71012_a(Lnet/minecraft/entity/item/EntityItem;)V #joinEntityItemWithWorld +public net.minecraft.client.entity.EntityClientPlayerMP func_71012_a(Lnet/minecraft/entity/item/EntityItem;)V #joinEntityItemWithWorld +public net.minecraft.entity.player.EntityPlayer func_71053_j()V #closeScreen +#public uf.b #FD:EntityPlayer/field_71076_b #sleepTimer +# World Gen Chests Related +public net.minecraft.util.WeightedRandomChestContent * +public net.minecraft.world.WorldServer field_73069_S +public net.minecraft.world.gen.structure.StructureMineshaftPieces field_78818_a +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$DesertPyramid field_74941_i +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$JunglePyramid field_74943_l +public net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces$JunglePyramid field_74944_m +public net.minecraft.world.gen.structure.StructureStrongholdPieces$ChestCorridor field_75003_a +public net.minecraft.world.gen.structure.StructureStrongholdPieces$Library field_75007_b +public net.minecraft.world.gen.structure.StructureStrongholdPieces$RoomCrossing field_75014_c +public net.minecraft.world.gen.structure.StructureVillagePieces$House2 field_74918_a +public net.minecraft.world.gen.feature.WorldGenDungeons field_111189_a +# Save Location +public net.minecraft.world.chunk.storage.AnvilChunkLoader field_75825_d # chunkSaveLocation +public net.minecraft.world.gen.ChunkProviderServer field_73247_e # currentChunkLoader +# PlayerManager +#public jp.a(IIZ)Ljq; #MD:PlayerManager/func_72690_a #getOrCreateChunkWatcher +# PlayerInstance +#public jq #CL:PlayerInstance +# World +public-f net.minecraft.world.World field_72982_D #villageCollectionObj +#public abw.G #FD:World/field_72993_I #activeChunkSet +# EntityLiving +#public og.b #FD:EntityLiving/field_70728_aV #experienceValue +#public og.d #FD:EntityLiving/field_70715_bh #targetTasks +# GuiFlatPresets +#public avz.a(Ljava/lang/String;ILacq;Ljava/util/List;[Lagd;)V #MD:GuiFlatPresets/func_82294_a +#public avz.a(Ljava/lang/String;ILacq;[Lagd;)V #MD:GuiFlatPresets/func_82297_a +# BiomeGenBase +public net.minecraft.world.biome.BiomeGenBase *() #Everything protected->public +public net.minecraft.world.biome.BiomeGenForest *() +public net.minecraft.world.biome.BiomeGenHills *() +public net.minecraft.world.biome.BiomeGenMesa *() +public net.minecraft.world.biome.BiomeGenPlains *() +public net.minecraft.world.biome.BiomeGenSavanna *() +public net.minecraft.world.biome.BiomeGenSnow *() +public net.minecraft.world.biome.BiomeGenTaiga *() +# Map Gen Biome Lists +public+f net.minecraft.world.gen.structure.MapGenStronghold field_151546_e +# MapGenVillage +public-f net.minecraft.world.gen.structure.MapGenVillage field_75055_e #villageSpawnBiomes +# ShapedRecipes +public+f net.minecraft.item.crafting.ShapedRecipes field_77574_d #recipeItems +public+f net.minecraft.item.crafting.ShapedRecipes field_77576_b #recipeWidth +public+f net.minecraft.item.crafting.ShapedRecipes field_77577_c #recipeHeight +# ShapelessRecipes +public net.minecraft.item.crafting.ShapelessRecipes field_77579_b #recipeItems +# GuiContainer +#protected awy.a(Lwe;)V #MD:GuiContainer/func_74192_a #drawSlotInventory +# ContainerPlayer +#protected vv.h #FD:ContainerPlayer/field_82862_h #player +# ContainerRepair +public net.minecraft.inventory.ContainerRepair field_82856_l #ContainerRepair/stackSizeToBeUsedInRepair +# BlockButton +#protected anf.n(Labw;III)V #MD:BlockButton/func_82535_o #checkActivation +#protected-f anf.a #FD:BlockButton/field_82537_a #sensible +# BiomeDecorator +public net.minecraft.world.biome.BiomeDecorator * +# CreativeTabs +public-f net.minecraft.creativetab.CreativeTabs field_78032_a # creativeTabArray non-final +# Packet +#public ey.a(IZZLjava/lang/Class;)V #MD:Packet/func_73285_a #addIdClassMapping +# SaveHandler +#public alq.b()Ljava/io/File; #MD:SaveHandler/func_75765_b +# World stuff +public net.minecraft.world.World field_73003_n #prevRainingStrength +public net.minecraft.world.World field_73004_o #rainingStrength +public net.minecraft.world.World field_73017_q #thunderingStrength +public net.minecraft.world.World field_73018_p #prevThunderingStrength +public net.minecraft.world.World func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.world.World func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +public net.minecraft.world.WorldServer func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.world.WorldServer func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +public net.minecraft.client.multiplayer.WorldClient func_72923_a(Lnet/minecraft/entity/Entity;)V #onEntityAdded +public net.minecraft.client.multiplayer.WorldClient func_72847_b(Lnet/minecraft/entity/Entity;)V #onEntityRemoved +# WorldServer +#public js.N #FD:WorldServer/field_73068_P #allPlayersSleeping +# TextureMap +#public bik.g #FD:TextureMap/field_94255_a +#public bik.h #FD:TextureMap/field_94254_c +# Potion +#public ni.b(II)Lni; #MD:Potion/func_76399_b #setIconIndex +# PotionHelper +#public zp.m #FD:PotionHelper/field_77927_l #potionRequirements +#public zp.n #FD:PotionHelper/field_77928_m #potionAmplifiers +# PotionEffect +#public nj.b #FD:PotionEffect/field_76460_b #duration +# BlockFluid +#protected apc.a #FD:BlockFluid/field_94425_a #theIcon +# GuiIngame +protected net.minecraft.client.gui.GuiIngame * +protected net.minecraft.client.gui.GuiIngame *() +# ItemStack +default net.minecraft.item.ItemStack field_77991_e +# GuiSlot +#protected awg.b(IIII)V #MD:GuiSlot/func_77206_b #overlayBackground +# EntityPlayer +#public uf.bu #FD:EntityPlayer/field_71092_bJ #username +# MapGenStructureIO +public net.minecraft.world.gen.structure.MapGenStructureIO func_143034_b(Ljava/lang/Class;Ljava/lang/String;)V # registerStart +public net.minecraft.world.gen.structure.MapGenStructureIO func_143031_a(Ljava/lang/Class;Ljava/lang/String;)V # registerPiece +# Stronghold +public net.minecraft.world.gen.structure.StructureStrongholdPieces$Stronghold +# Packets +public net.minecraft.network.play.server.S23PacketBlockChange field_148883_d # Block +public net.minecraft.network.play.server.S23PacketBlockChange field_148884_e # Metadata +# WorldType +public-f net.minecraft.world.WorldType field_77139_a #worldTypes +# DamageSource +public net.minecraft.util.DamageSource *() #All methods public, most are already +# ItemBlock +public net.minecraft.item.ItemBlock field_150939_a # block +# EntityAITasks +public net.minecraft.entity.ai.EntityAITasks field_75782_a # taskEntries +# EntityXPOrb +public net.minecraft.entity.item.EntityXPOrb field_70530_e # xpValue +# Village +public net.minecraft.world.gen.structure.StructureVillagePieces$Village +# RenderPlayer +public net.minecraft.client.renderer.entity.RenderBiped field_77071_a #modelBipedMain +public net.minecraft.client.renderer.entity.RenderPlayer field_77109_a #modelBipedMain +public net.minecraft.client.renderer.entity.RenderPlayer field_77108_b #modelArmorChestplate +public net.minecraft.client.renderer.entity.RenderPlayer field_77111_i #modelArmor +# ChunkProviderServer +public net.minecraft.world.gen.ChunkProviderServer field_73246_d # currentChunkProvider +public net.minecraft.world.gen.ChunkProviderServer field_73244_f # loadedChunkHashMap +public net.minecraft.world.gen.ChunkProviderServer field_73245_g # loadedChunks +public net.minecraft.world.gen.ChunkProviderServer field_73251_h # worldObj diff --git a/build/rfg/minecraft-src/resources/forge_logo.png b/build/rfg/minecraft-src/resources/forge_logo.png new file mode 100644 index 0000000..19a02ca Binary files /dev/null and b/build/rfg/minecraft-src/resources/forge_logo.png differ diff --git a/build/rfg/minecraft-src/resources/lgpl-3.0.txt b/build/rfg/minecraft-src/resources/lgpl-3.0.txt new file mode 100644 index 0000000..02bbb60 --- /dev/null +++ b/build/rfg/minecraft-src/resources/lgpl-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/build/rfg/minecraft-src/resources/log4j2.xml b/build/rfg/minecraft-src/resources/log4j2.xml new file mode 100644 index 0000000..482e65a --- /dev/null +++ b/build/rfg/minecraft-src/resources/log4j2.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/rfg/minecraft-src/resources/mcplogo.png b/build/rfg/minecraft-src/resources/mcplogo.png new file mode 100644 index 0000000..8ebae88 Binary files /dev/null and b/build/rfg/minecraft-src/resources/mcplogo.png differ diff --git a/build/rfg/minecraft-src/resources/mcpmod.info b/build/rfg/minecraft-src/resources/mcpmod.info new file mode 100644 index 0000000..5dc569b --- /dev/null +++ b/build/rfg/minecraft-src/resources/mcpmod.info @@ -0,0 +1,17 @@ +[ +{ + "modid": "mcp", + "name": "Minecraft Coder Pack", + "description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.", + "version": "9.05", + "mcversion": "1.7.10", + "logoFile": "/mcplogo.png", + "url": "http://mcp.ocean-labs.de/", + "updateUrl": "", + "authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"], + "credits": "Made by the MCP team", + "parent": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/build/rfg/minecraft-src/resources/pack.png b/build/rfg/minecraft-src/resources/pack.png new file mode 100644 index 0000000..cfaa986 Binary files /dev/null and b/build/rfg/minecraft-src/resources/pack.png differ diff --git a/build/rfg/minecraft-src/resources/packaged.exc b/build/rfg/minecraft-src/resources/packaged.exc new file mode 100644 index 0000000..2601f33 --- /dev/null +++ b/build/rfg/minecraft-src/resources/packaged.exc @@ -0,0 +1,19 @@ +net/minecraft/client/particle/EntityDiggingFX.(Lnet/minecraft/world/World;DDDDDDLnet/minecraft/block/Block;II)V=|p_i1234_1_,p_i1234_2_,p_i1234_4_,p_i1234_6_,p_i1234_8_,p_i1234_10_,p_i1234_12_,p_i1234_14_,p_i1234_15_,side +net/minecraft/client/renderer/ItemRenderer.renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V=|p_78443_1_,p_78443_2_,p_78443_3_,type +net/minecraft/client/renderer/RenderGlobal.drawBlockDamageTexture(Lnet/minecraft/client/renderer/Tessellator;Lnet/minecraft/entity/EntityLivingBase;F)V=|p_72717_1_,p_72717_2_,p_72717_3_ +net/minecraft/client/renderer/entity/RenderItem.renderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V=|p_77020_1_,p_77020_2_,p_77020_3_,p_77020_4_,p_77020_5_,p_77020_6_,p_77020_7_,pass +net/minecraft/client/renderer/entity/RenderItem.renderItemIntoGUI(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;IIZ)V=|p_77015_1_,p_77015_2_,p_77015_3_,p_77015_4_,p_77015_5_,renderEffect +net/minecraft/server/management/ServerConfigurationManager.transferPlayerToDimension(Lnet/minecraft/entity/player/EntityPlayerMP;ILnet/minecraft/world/Teleporter;)V=|p_72356_1_,p_72356_2_,teleporter +net/minecraft/server/management/ServerConfigurationManager.transferEntityToWorld(Lnet/minecraft/entity/Entity;ILnet/minecraft/world/WorldServer;Lnet/minecraft/world/WorldServer;Lnet/minecraft/world/Teleporter;)V=|p_82448_1_,p_82448_2_,p_82448_3_,p_82448_4_,teleporter +net/minecraft/world/World.getBiomeGenForCoordsBody(II)Lnet/minecraft/world/biome/BiomeGenBase;=|p_72807_1_,p_72807_2_ +net/minecraft/world/World.getSunBrightnessFactor(F)F=|p_72967_1_ +net/minecraft/world/World.getSunBrightnessBody(F)F=|p_72971_1_ +net/minecraft/world/World.getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/Vec3;=|p_72833_1_,p_72833_2_ +net/minecraft/world/World.drawCloudsBody(F)Lnet/minecraft/util/Vec3;=|p_72824_1_ +net/minecraft/world/World.canBlockFreezeBody(IIIZ)Z=|p_72834_1_,p_72834_2_,p_72834_3_,p_72834_4_ +net/minecraft/world/biome/BiomeGenBase.(IZ)V=|p_i1971_1_,register +net/minecraft/world/chunk/storage/AnvilChunkLoader.loadChunk__Async(Lnet/minecraft/world/World;II)[Ljava/lang/Object;=|p_75815_1_,p_75815_2_,p_75815_3_ +net/minecraft/world/chunk/storage/AnvilChunkLoader.checkedReadChunkFromNBT__Async(Lnet/minecraft/world/World;IILnet/minecraft/nbt/NBTTagCompound;)[Ljava/lang/Object;=|p_75822_1_,p_75822_2_,p_75822_3_,p_75822_4_ +net/minecraft/world/chunk/storage/AnvilChunkLoader.loadEntities(Lnet/minecraft/world/World;Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/chunk/Chunk;)V=|p_75823_1_,p_75823_2_,chunk +net/minecraft/world/gen/ChunkProviderServer.loadChunk(II;Ljava/lang/Runnable;)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1,p_73158_2,runnable +net/minecraft/world/gen/ChunkProviderServer.originalLoadChunk(II)Lnet/minecraft/world/chunk/Chunk;=|p_73158_1_,p_73158_2_ diff --git a/build/rfg/minecraft-src/resources/packaged.srg b/build/rfg/minecraft-src/resources/packaged.srg new file mode 100644 index 0000000..e8eb7d4 --- /dev/null +++ b/build/rfg/minecraft-src/resources/packaged.srg @@ -0,0 +1 @@ +MD: net/minecraft/server/management/ServerConfigurationManager/initializeConnectionToPlayer (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V net/minecraft/server/management/ServerConfigurationManager/func_72355_a (Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;Lnet/minecraft/network/NetHandlerPlayServer;)V diff --git a/build/rfg/minecraft-src/resources/yggdrasil_session_pubkey.der b/build/rfg/minecraft-src/resources/yggdrasil_session_pubkey.der new file mode 100644 index 0000000..9c79a3a Binary files /dev/null and b/build/rfg/minecraft-src/resources/yggdrasil_session_pubkey.der differ diff --git a/build/rfg/recompiled_minecraft-1.7.10.jar b/build/rfg/recompiled_minecraft-1.7.10.jar new file mode 100644 index 0000000..9bac684 Binary files /dev/null and b/build/rfg/recompiled_minecraft-1.7.10.jar differ diff --git a/build/tmp/.cache/expanded.lock b/build/tmp/.cache/expanded.lock new file mode 100644 index 0000000..d57f19d Binary files /dev/null and b/build/tmp/.cache/expanded.lock differ diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/Block.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/Block.java.patch new file mode 100644 index 0000000..285581f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/Block.java.patch @@ -0,0 +1,1312 @@ +--- ../src-base/minecraft/net/minecraft/block/Block.java ++++ ../src-work/minecraft/net/minecraft/block/Block.java +@@ -3,24 +3,36 @@ + import cpw.mods.fml.common.registry.GameData; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++ ++import java.util.ArrayList; ++import java.util.HashMap; + import java.util.Iterator; + import java.util.List; + import java.util.Random; ++ + import net.minecraft.block.material.MapColor; + import net.minecraft.block.material.Material; ++import net.minecraft.client.particle.EffectRenderer; + import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.creativetab.CreativeTabs; + import net.minecraft.enchantment.EnchantmentHelper; + import net.minecraft.entity.Entity; + import net.minecraft.entity.EntityLivingBase; ++import net.minecraft.entity.EnumCreatureType; ++import net.minecraft.entity.boss.EntityDragon; ++import net.minecraft.entity.boss.EntityWither; + import net.minecraft.entity.item.EntityItem; + import net.minecraft.entity.item.EntityXPOrb; + import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.init.Blocks; + import net.minecraft.item.Item; ++import net.minecraft.item.ItemBlock; + import net.minecraft.item.ItemStack; + import net.minecraft.stats.StatList; ++import net.minecraft.tileentity.TileEntity; + import net.minecraft.tileentity.TileEntitySign; + import net.minecraft.util.AxisAlignedBB; ++import net.minecraft.util.ChunkCoordinates; + import net.minecraft.util.IIcon; + import net.minecraft.util.MovingObjectPosition; + import net.minecraft.util.RegistryNamespaced; +@@ -30,6 +42,15 @@ + import net.minecraft.world.Explosion; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraft.world.WorldProviderEnd; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.IPlantable; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.common.util.ForgeDirection; ++import net.minecraftforge.common.util.RotationHelper; ++import net.minecraftforge.event.ForgeEventFactory; ++import static net.minecraftforge.common.util.ForgeDirection.*; + + public class Block + { +@@ -112,7 +133,8 @@ + + public static Block func_149729_e(int p_149729_0_) + { +- return (Block)field_149771_c.func_148754_a(p_149729_0_); ++ Block ret = (Block)field_149771_c.func_148754_a(p_149729_0_); ++ return ret == null ? Blocks.field_150350_a : ret; + } + + public static Block func_149634_a(Item p_149634_0_) +@@ -483,9 +505,10 @@ + return this.field_149789_z; + } + ++ @Deprecated //Forge: New Metadata sensitive version. + public boolean func_149716_u() + { +- return this.field_149758_A; ++ return hasTileEntity(0); + } + + public final void func_149676_a(float p_149676_1_, float p_149676_2_, float p_149676_3_, float p_149676_4_, float p_149676_5_, float p_149676_6_) +@@ -502,13 +525,13 @@ + public int func_149677_c(IBlockAccess p_149677_1_, int p_149677_2_, int p_149677_3_, int p_149677_4_) + { + Block block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); +- int l = p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); ++ int l = p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); + + if (l == 0 && block instanceof BlockSlab) + { + --p_149677_3_; + block = p_149677_1_.func_147439_a(p_149677_2_, p_149677_3_, p_149677_4_); +- return p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.func_149750_m()); ++ return p_149677_1_.func_72802_i(p_149677_2_, p_149677_3_, p_149677_4_, block.getLightValue(p_149677_1_, p_149677_2_, p_149677_3_, p_149677_4_)); + } + else + { +@@ -597,7 +620,13 @@ + + public void func_149726_b(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {} + +- public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {} ++ public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) ++ { ++ if (hasTileEntity(p_149749_6_) && !(this instanceof BlockContainer)) ++ { ++ p_149749_1_.func_147475_p(p_149749_2_, p_149749_3_, p_149749_4_); ++ } ++ } + + public int func_149745_a(Random p_149745_1_) + { +@@ -611,8 +640,7 @@ + + public float func_149737_a(EntityPlayer p_149737_1_, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) + { +- float f = this.func_149712_f(p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); +- return f < 0.0F ? 0.0F : (!p_149737_1_.func_146099_a(this) ? p_149737_1_.func_146096_a(this, false) / f / 100.0F : p_149737_1_.func_146096_a(this, true) / f / 30.0F); ++ return ForgeHooks.blockStrength(this, p_149737_1_, p_149737_2_, p_149737_3_, p_149737_4_, p_149737_5_); + } + + public final void func_149697_b(World p_149697_1_, int p_149697_2_, int p_149697_3_, int p_149697_4_, int p_149697_5_, int p_149697_6_) +@@ -622,20 +650,16 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { +- if (!p_149690_1_.field_72995_K) ++ if (!p_149690_1_.field_72995_K && !p_149690_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe + { +- int j1 = this.func_149679_a(p_149690_7_, p_149690_1_.field_73012_v); ++ ArrayList items = getDrops(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_); ++ p_149690_6_ = ForgeEventFactory.fireBlockHarvesting(items, p_149690_1_, this, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_, p_149690_6_, false, harvesters.get()); + +- for (int k1 = 0; k1 < j1; ++k1) ++ for (ItemStack item : items) + { + if (p_149690_1_.field_73012_v.nextFloat() <= p_149690_6_) + { +- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_); +- +- if (item != null) +- { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_))); +- } ++ this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, item); + } + } + } +@@ -643,8 +667,13 @@ + + protected void func_149642_a(World p_149642_1_, int p_149642_2_, int p_149642_3_, int p_149642_4_, ItemStack p_149642_5_) + { +- if (!p_149642_1_.field_72995_K && p_149642_1_.func_82736_K().func_82766_b("doTileDrops")) ++ if (!p_149642_1_.field_72995_K && p_149642_1_.func_82736_K().func_82766_b("doTileDrops") && !p_149642_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe + { ++ if (captureDrops.get()) ++ { ++ capturedDrops.get().add(p_149642_5_); ++ return; ++ } + float f = 0.7F; + double d0 = (double)(p_149642_1_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; + double d1 = (double)(p_149642_1_.field_73012_v.nextFloat() * f) + (double)(1.0F - f) * 0.5D; +@@ -829,7 +858,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j(); ++ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + public boolean func_149727_a(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) +@@ -922,25 +951,35 @@ + p_149636_2_.func_71064_a(StatList.field_75934_C[func_149682_b(this)], 1); + p_149636_2_.func_71020_j(0.025F); + +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_)) ++ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_)) + { ++ ArrayList items = new ArrayList(); + ItemStack itemstack = this.func_149644_j(p_149636_6_); + + if (itemstack != null) + { +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); ++ items.add(itemstack); + } ++ ++ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_); ++ for (ItemStack is : items) ++ { ++ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); ++ } + } + else + { ++ harvesters.set(p_149636_2_); + int i1 = EnchantmentHelper.func_77517_e(p_149636_2_); + this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); ++ harvesters.set(null); + } + } + + protected boolean func_149700_E() + { +- return this.func_149686_d() && !this.field_149758_A; ++ Integer meta = silk_check_meta.get(); ++ return this.func_149686_d() && !this.hasTileEntity(meta == null ? 0 : meta); + } + + protected ItemStack func_149644_j(int p_149644_1_) +@@ -1116,6 +1155,1104 @@ + return null; + } + ++ /* ======================================== FORGE START =====================================*/ ++ //For ForgeInternal use Only! ++ protected ThreadLocal harvesters = new ThreadLocal(); ++ private ThreadLocal silk_check_meta = new ThreadLocal(); ++ /** ++ * Get a light value for the block at the specified coordinates, normal ranges are between 0 and 15 ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return The light value ++ */ ++ public int getLightValue(IBlockAccess world, int x, int y, int z) ++ { ++ Block block = world.func_147439_a(x, y, z); ++ if (block != this) ++ { ++ return block.getLightValue(world, x, y, z); ++ } ++ return func_149750_m(); ++ } ++ ++ /** ++ * Checks if a player or entity can use this block to 'climb' like a ladder. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @param entity The entity trying to use the ladder, CAN be null. ++ * @return True if the block should act like a ladder ++ */ ++ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) ++ { ++ return false; ++ } ++ ++ /** ++ * Return true if the block is a normal, solid cube. This ++ * determines indirect power state, entity ejection from blocks, and a few ++ * others. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return True if the block is a full cube ++ */ ++ public boolean isNormalCube(IBlockAccess world, int x, int y, int z) ++ { ++ return func_149688_o().func_76218_k() && func_149686_d() && !func_149744_f(); ++ } ++ ++ /** ++ * Checks if the block is a solid face on the given side, used by placement logic. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @param side The side to check ++ * @return True if the block is solid on the specified side. ++ */ ++ public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) ++ { ++ int meta = world.func_72805_g(x, y, z); ++ ++ if (this instanceof BlockSlab) ++ { ++ return (((meta & 8) == 8 && (side == UP)) || func_149730_j()); ++ } ++ else if (this instanceof BlockFarmland) ++ { ++ return (side != DOWN && side != UP); ++ } ++ else if (this instanceof BlockStairs) ++ { ++ boolean flipped = ((meta & 4) != 0); ++ return ((meta & 3) + side.ordinal() == 5) || (side == UP && flipped); ++ } ++ else if (this instanceof BlockSnow) ++ { ++ return (meta & 7) == 7; ++ } ++ else if (this instanceof BlockHopper && side == UP) ++ { ++ return true; ++ } ++ else if (this instanceof BlockCompressedPowered) ++ { ++ return true; ++ } ++ return isNormalCube(world, x, y, z); ++ } ++ ++ /** ++ * Determines if a new block can be replace the space occupied by this one, ++ * Used in the player's placement code to make the block act like water, and lava. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return True if the block is replaceable by another block ++ */ ++ public boolean isReplaceable(IBlockAccess world, int x, int y, int z) ++ { ++ return field_149764_J.func_76222_j(); ++ } ++ ++ /** ++ * Determines if this block should set fire and deal fire damage ++ * to entities coming into contact with it. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return True if the block should deal damage ++ */ ++ public boolean isBurning(IBlockAccess world, int x, int y, int z) ++ { ++ return false; ++ } ++ ++ /** ++ * Determines this block should be treated as an air block ++ * by the rest of the code. This method is primarily ++ * useful for creating pure logic-blocks that will be invisible ++ * to the player and otherwise interact as air would. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return True if the block considered air ++ */ ++ public boolean isAir(IBlockAccess world, int x, int y, int z) ++ { ++ return func_149688_o() == Material.field_151579_a; ++ } ++ ++ /** ++ * Determines if the player can harvest this block, obtaining it's drops when the block is destroyed. ++ * ++ * @param player The player damaging the block, may be null ++ * @param meta The block's current metadata ++ * @return True to spawn the drops ++ */ ++ public boolean canHarvestBlock(EntityPlayer player, int meta) ++ { ++ return ForgeHooks.canHarvestBlock(this, player, meta); ++ } ++ ++ /** ++ * Called when a player removes a block. This is responsible for ++ * actually destroying the block, and the block is intact at time of call. ++ * This is called regardless of whether the player can harvest the block or ++ * not. ++ * ++ * Return true if the block is actually destroyed. ++ * ++ * Note: When used in multiplayer, this is called on both client and ++ * server sides! ++ * ++ * @param world The current world ++ * @param player The player damaging the block, may be null ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @param willHarvest True if Block.harvestBlock will be called after this, if the return in true. ++ * Can be useful to delay the destruction of tile entities till after harvestBlock ++ * @return True if the block is actually destroyed. ++ */ ++ public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) ++ { ++ return removedByPlayer(world, player, x, y, z); ++ } ++ ++ @Deprecated ++ public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) ++ { ++ return world.func_147468_f(x, y, z); ++ } ++ ++ /** ++ * Chance that fire will spread and consume this block. ++ * 300 being a 100% chance, 0, being a 0% chance. ++ * ++ * @param world The current world ++ * @param x The blocks X position ++ * @param y The blocks Y position ++ * @param z The blocks Z position ++ * @param face The face that the fire is coming from ++ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire ++ */ ++ public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) ++ { ++ return Blocks.field_150480_ab.getFlammability(this); ++ } ++ ++ /** ++ * Called when fire is updating, checks if a block face can catch fire. ++ * ++ * ++ * @param world The current world ++ * @param x The blocks X position ++ * @param y The blocks Y position ++ * @param z The blocks Z position ++ * @param face The face that the fire is coming from ++ * @return True if the face can be on fire, false otherwise. ++ */ ++ public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) ++ { ++ return getFlammability(world, x, y, z, face) > 0; ++ } ++ ++ /** ++ * Called when fire is updating on a neighbor block. ++ * The higher the number returned, the faster fire will spread around this block. ++ * ++ * @param world The current world ++ * @param x The blocks X position ++ * @param y The blocks Y position ++ * @param z The blocks Z position ++ * @param face The face that the fire is coming from ++ * @return A number that is used to determine the speed of fire growth around the block ++ */ ++ public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) ++ { ++ return Blocks.field_150480_ab.getEncouragement(this); ++ } ++ ++ /** ++ * Currently only called by fire when it is on top of this block. ++ * Returning true will prevent the fire from naturally dying during updating. ++ * Also prevents firing from dying from rain. ++ * ++ * @param world The current world ++ * @param x The blocks X position ++ * @param y The blocks Y position ++ * @param z The blocks Z position ++ * @param metadata The blocks current metadata ++ * @param side The face that the fire is coming from ++ * @return True if this block sustains fire, meaning it will never go out. ++ */ ++ public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) ++ { ++ if (this == Blocks.field_150424_aL && side == UP) ++ { ++ return true; ++ } ++ if ((world.field_73011_w instanceof WorldProviderEnd) && this == Blocks.field_150357_h && side == UP) ++ { ++ return true; ++ } ++ return false; ++ } ++ ++ private boolean isTileProvider = this instanceof ITileEntityProvider; ++ /** ++ * Called throughout the code as a replacement for block instanceof BlockContainer ++ * Moving this to the Block base class allows for mods that wish to extend vanilla ++ * blocks, and also want to have a tile entity on that block, may. ++ * ++ * Return true from this function to specify this block has a tile entity. ++ * ++ * @param metadata Metadata of the current block ++ * @return True if block has a tile entity, false otherwise ++ */ ++ public boolean hasTileEntity(int metadata) ++ { ++ return isTileProvider; ++ } ++ ++ /** ++ * Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity ++ * Return the same thing you would from that function. ++ * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider ++ * ++ * @param metadata The Metadata of the current block ++ * @return A instance of a class extending TileEntity ++ */ ++ public TileEntity createTileEntity(World world, int metadata) ++ { ++ if (isTileProvider) ++ { ++ return ((ITileEntityProvider)this).func_149915_a(world, metadata); ++ } ++ return null; ++ } ++ ++ /** ++ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) ++ * version in 1.1. ++ * ++ * @param meta Blocks Metadata ++ * @param fortune Current item fortune level ++ * @param random Random number generator ++ * @return The number of items to drop ++ */ ++ public int quantityDropped(int meta, int fortune, Random random) ++ { ++ return func_149679_a(fortune, random); ++ } ++ ++ /** ++ * This returns a complete list of items dropped from this block. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param metadata Current metadata ++ * @param fortune Breakers fortune level ++ * @return A ArrayList containing all items this block drops ++ */ ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ ++ int count = quantityDropped(metadata, fortune, world.field_73012_v); ++ for(int i = 0; i < count; i++) ++ { ++ Item item = func_149650_a(metadata, world.field_73012_v, fortune); ++ if (item != null) ++ { ++ ret.add(new ItemStack(item, 1, func_149692_a(metadata))); ++ } ++ } ++ return ret; ++ } ++ ++ /** ++ * Return true from this function if the player with silk touch can harvest this block directly, and not it's normal drops. ++ * ++ * @param world The world ++ * @param player The player doing the harvesting ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param metadata The metadata ++ * @return True if the block can be directly harvested using silk touch ++ */ ++ public boolean canSilkHarvest(World world, EntityPlayer player, int x, int y, int z, int metadata) ++ { ++ silk_check_meta.set(metadata);; ++ boolean ret = this.func_149700_E(); ++ silk_check_meta.set(null); ++ return ret; ++ } ++ ++ /** ++ * Determines if a specified mob type can spawn on this block, returning false will ++ * prevent any mob from spawning on the block. ++ * ++ * @param type The Mob Category Type ++ * @param world The current world ++ * @param x The X Position ++ * @param y The Y Position ++ * @param z The Z Position ++ * @return True to allow a mob of the specified category to spawn, false to prevent it. ++ */ ++ public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) ++ { ++ int meta = world.func_72805_g(x, y, z); ++ if (this instanceof BlockSlab) ++ { ++ return (((meta & 8) == 8) || func_149730_j()); ++ } ++ else if (this instanceof BlockStairs) ++ { ++ return ((meta & 4) != 0); ++ } ++ return isSideSolid(world, x, y, z, UP); ++ } ++ ++ /** ++ * Determines if this block is classified as a Bed, Allowing ++ * players to sleep in it, though the block has to specifically ++ * perform the sleeping functionality in it's activated event. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param player The player or camera entity, null in some cases. ++ * @return True to treat this as a bed ++ */ ++ public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player) ++ { ++ return this == Blocks.field_150324_C; ++ } ++ ++ /** ++ * Returns the position that the player is moved to upon ++ * waking up, or respawning at the bed. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param player The player or camera entity, null in some cases. ++ * @return The spawn position ++ */ ++ public ChunkCoordinates getBedSpawnPosition(IBlockAccess world, int x, int y, int z, EntityPlayer player) ++ { ++ if (world instanceof World) ++ return BlockBed.func_149977_a((World)world, x, y, z, 0); ++ return null; ++ } ++ ++ /** ++ * Called when a user either starts or stops sleeping in the bed. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param player The player or camera entity, null in some cases. ++ * @param occupied True if we are occupying the bed, or false if they are stopping use of the bed ++ */ ++ public void setBedOccupied(IBlockAccess world, int x, int y, int z, EntityPlayer player, boolean occupied) ++ { ++ if (world instanceof World) ++ BlockBed.func_149979_a((World)world, x, y, z, occupied); ++ } ++ ++ /** ++ * Returns the direction of the block. Same values that ++ * are returned by BlockDirectional ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return Bed direction ++ */ ++ public int getBedDirection(IBlockAccess world, int x, int y, int z) ++ { ++ return BlockBed.func_149895_l(world.func_72805_g(x, y, z)); ++ } ++ ++ /** ++ * Determines if the current block is the foot half of the bed. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return True if the current block is the foot side of a bed. ++ */ ++ public boolean isBedFoot(IBlockAccess world, int x, int y, int z) ++ { ++ return BlockBed.func_149975_b(world.func_72805_g(x, y, z)); ++ } ++ ++ /** ++ * Called when a leaf should start its decay process. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ */ ++ public void beginLeavesDecay(World world, int x, int y, int z){} ++ ++ /** ++ * Determines if this block can prevent leaves connected to it from decaying. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return true if the presence this block can prevent leaves from decaying. ++ */ ++ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) ++ { ++ return false; ++ } ++ ++ /** ++ * Determines if this block is considered a leaf block, used to apply the leaf decay and generation system. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return true if this block is considered leaves. ++ */ ++ public boolean isLeaves(IBlockAccess world, int x, int y, int z) ++ { ++ return func_149688_o() == Material.field_151584_j; ++ } ++ ++ /** ++ * Used during tree growth to determine if newly generated leaves can replace this block. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return true if this block can be replaced by growing leaves. ++ */ ++ public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) ++ { ++ return !func_149730_j(); ++ } ++ ++ /** ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return true if the block is wood (logs) ++ */ ++ public boolean isWood(IBlockAccess world, int x, int y, int z) ++ { ++ return false; ++ } ++ ++ /** ++ * Determines if the current block is replaceable by Ore veins during world generation. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param target The generic target block the gen is looking for, Standards define stone ++ * for overworld generation, and neatherack for the nether. ++ * @return True to allow this block to be replaced by a ore ++ */ ++ public boolean isReplaceableOreGen(World world, int x, int y, int z, Block target) ++ { ++ return this == target; ++ } ++ ++ /** ++ * Location sensitive version of getExplosionRestance ++ * ++ * @param par1Entity The entity that caused the explosion ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param explosionX Explosion source X Position ++ * @param explosionY Explosion source X Position ++ * @param explosionZ Explosion source X Position ++ * @return The amount of the explosion absorbed. ++ */ ++ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) ++ { ++ return func_149638_a(par1Entity); ++ } ++ ++ /** ++ * Called when the block is destroyed by an explosion. ++ * Useful for allowing the block to take into account tile entities, ++ * metadata, etc. when exploded, before it is removed. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param Explosion The explosion instance affecting the block ++ */ ++ public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) ++ { ++ world.func_147468_f(x, y, z); ++ func_149723_a(world, x, y, z, explosion); ++ } ++ ++ /** ++ * Determine if this block can make a redstone connection on the side provided, ++ * Useful to control which sides are inputs and outputs for redstone wires. ++ * ++ * Side: ++ * -1: UP ++ * 0: NORTH ++ * 1: EAST ++ * 2: SOUTH ++ * 3: WEST ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param side The side that is trying to make the connection ++ * @return True to make the connection ++ */ ++ public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) ++ { ++ return func_149744_f() && side != -1; ++ } ++ ++ /** ++ * Determines if a torch can be placed on the top surface of this block. ++ * Useful for creating your own block that torches can be on, such as fences. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return True to allow the torch to be placed ++ */ ++ public boolean canPlaceTorchOnTop(World world, int x, int y, int z) ++ { ++ if (isSideSolid(world, x, y, z, UP)) ++ { ++ return true; ++ } ++ else ++ { ++ return this == Blocks.field_150422_aJ || this == Blocks.field_150386_bk || this == Blocks.field_150359_w || this == Blocks.field_150463_bK; ++ } ++ } ++ ++ /** ++ * Determines if this block should render in this pass. ++ * ++ * @param pass The pass in question ++ * @return True to render ++ */ ++ public boolean canRenderInPass(int pass) ++ { ++ return pass == func_149701_w(); ++ } ++ ++ /** ++ * Called when a user uses the creative pick block button on this block ++ * ++ * @param target The full target the player is looking at ++ * @return A ItemStack to add to the player's inventory, Null if nothing should be added. ++ */ ++ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) ++ { ++ return getPickBlock(target, world, x, y, z); ++ } ++ @Deprecated ++ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) ++ { ++ Item item = func_149694_d(world, x, y, z); ++ ++ if (item == null) ++ { ++ return null; ++ } ++ ++ Block block = item instanceof ItemBlock && !func_149648_K() ? Block.func_149634_a(item) : this; ++ return new ItemStack(item, 1, block.func_149643_k(world, x, y, z)); ++ } ++ ++ /** ++ * Used by getTopSolidOrLiquidBlock while placing biome decorations, villages, etc ++ * Also used to determine if the player can spawn on this block. ++ * ++ * @return False to disallow spawning ++ */ ++ public boolean isFoliage(IBlockAccess world, int x, int y, int z) ++ { ++ return false; ++ } ++ ++ /** ++ * Spawn a digging particle effect in the world, this is a wrapper ++ * around EffectRenderer.addBlockHitEffects to allow the block more ++ * control over the particles. Useful when you have entirely different ++ * texture sheets for different sides/locations in the world. ++ * ++ * @param world The current world ++ * @param target The target the player is looking at {x/y/z/side/sub} ++ * @param effectRenderer A reference to the current effect renderer. ++ * @return True to prevent vanilla digging particles form spawning. ++ */ ++ @SideOnly(Side.CLIENT) ++ public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) ++ { ++ return false; ++ } ++ ++ /** ++ * Spawn particles for when the block is destroyed. Due to the nature ++ * of how this is invoked, the x/y/z locations are not always guaranteed ++ * to host your block. So be sure to do proper sanity checks before assuming ++ * that the location is this block. ++ * ++ * @param world The current world ++ * @param x X position to spawn the particle ++ * @param y Y position to spawn the particle ++ * @param z Z position to spawn the particle ++ * @param meta The metadata for the block before it was destroyed. ++ * @param effectRenderer A reference to the current effect renderer. ++ * @return True to prevent vanilla break particles from spawning. ++ */ ++ @SideOnly(Side.CLIENT) ++ public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) ++ { ++ return false; ++ } ++ ++ /** ++ * Determines if this block can support the passed in plant, allowing it to be planted and grow. ++ * Some examples: ++ * Reeds check if its a reed, or if its sand/dirt/grass and adjacent to water ++ * Cacti checks if its a cacti, or if its sand ++ * Nether types check for soul sand ++ * Crops check for tilled soil ++ * Caves check if it's a solid surface ++ * Plains check if its grass or dirt ++ * Water check if its still water ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z position ++ * @param direction The direction relative to the given position the plant wants to be, typically its UP ++ * @param plantable The plant that wants to check ++ * @return True to allow the plant to be planted/stay. ++ */ ++ public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) ++ { ++ Block plant = plantable.getPlant(world, x, y + 1, z); ++ EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z); ++ ++ if (plant == Blocks.field_150434_aF && this == Blocks.field_150434_aF) ++ { ++ return true; ++ } ++ ++ if (plant == Blocks.field_150436_aH && this == Blocks.field_150436_aH) ++ { ++ return true; ++ } ++ ++ if (plantable instanceof BlockBush && ((BlockBush)plantable).func_149854_a(this)) ++ { ++ return true; ++ } ++ ++ switch (plantType) ++ { ++ case Desert: return this == Blocks.field_150354_m; ++ case Nether: return this == Blocks.field_150425_aM; ++ case Crop: return this == Blocks.field_150458_ak; ++ case Cave: return isSideSolid(world, x, y, z, UP); ++ case Plains: return this == Blocks.field_150349_c || this == Blocks.field_150346_d || this == Blocks.field_150458_ak; ++ case Water: return world.func_147439_a(x, y, z).func_149688_o() == Material.field_151586_h && world.func_72805_g(x, y, z) == 0; ++ case Beach: ++ boolean isBeach = this == Blocks.field_150349_c || this == Blocks.field_150346_d || this == Blocks.field_150354_m; ++ boolean hasWater = (world.func_147439_a(x - 1, y, z ).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x + 1, y, z ).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x, y, z - 1).func_149688_o() == Material.field_151586_h || ++ world.func_147439_a(x, y, z + 1).func_149688_o() == Material.field_151586_h); ++ return isBeach && hasWater; ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Called when a plant grows on this block, only implemented for saplings using the WorldGen*Trees classes right now. ++ * Modder may implement this for custom plants. ++ * This does not use ForgeDirection, because large/huge trees can be located in non-representable direction, ++ * so the source location is specified. ++ * Currently this just changes the block to dirt if it was grass. ++ * ++ * Note: This happens DURING the generation, the generation may not be complete when this is called. ++ * ++ * @param world Current world ++ * @param x Soil X ++ * @param y Soil Y ++ * @param z Soil Z ++ * @param sourceX Plant growth location X ++ * @param sourceY Plant growth location Y ++ * @param sourceZ Plant growth location Z ++ */ ++ public void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) ++ { ++ if (this == Blocks.field_150349_c || this == Blocks.field_150458_ak) ++ { ++ world.func_147465_d(x, y, z, Blocks.field_150346_d, 0, 2); ++ } ++ } ++ ++ /** ++ * Checks if this soil is fertile, typically this means that growth rates ++ * of plants on this soil will be slightly sped up. ++ * Only vanilla case is tilledField when it is within range of water. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z position ++ * @return True if the soil should be considered fertile. ++ */ ++ public boolean isFertile(World world, int x, int y, int z) ++ { ++ if (this == Blocks.field_150458_ak) ++ { ++ return world.func_72805_g(x, y, z) > 0; ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Location aware and overrideable version of the lightOpacity array, ++ * return the number to subtract from the light value when it passes through this block. ++ * ++ * This is not guaranteed to have the tile entity in place before this is called, so it is ++ * Recommended that you have your tile entity call relight after being placed if you ++ * rely on it for light info. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z position ++ * @return The amount of light to block, 0 for air, 255 for fully opaque. ++ */ ++ public int getLightOpacity(IBlockAccess world, int x, int y, int z) ++ { ++ return func_149717_k(); ++ } ++ ++ /** ++ * Determines if this block is can be destroyed by the specified entities normal behavior. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z position ++ * @return True to allow the ender dragon to destroy this block ++ */ ++ public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) ++ { ++ if (entity instanceof EntityWither) ++ { ++ return this != Blocks.field_150357_h && this != Blocks.field_150384_bq && this != Blocks.field_150378_br && this != Blocks.field_150483_bI; ++ } ++ else if (entity instanceof EntityDragon) ++ { ++ return this != Blocks.field_150343_Z && this != Blocks.field_150377_bs && this != Blocks.field_150357_h; ++ } ++ ++ return true; ++ } ++ ++ /** ++ * Determines if this block can be used as the base of a beacon. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z position ++ * @param beaconX Beacons X Position ++ * @param beaconY Beacons Y Position ++ * @param beaconZ Beacons Z Position ++ * @return True, to support the beacon, and make it active with this block. ++ */ ++ public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) ++ { ++ return this == Blocks.field_150475_bE || this == Blocks.field_150340_R || this == Blocks.field_150484_ah || this == Blocks.field_150339_S; ++ } ++ ++ /** ++ * Rotate the block. For vanilla blocks this rotates around the axis passed in (generally, it should be the "face" that was hit). ++ * Note: for mod blocks, this is up to the block and modder to decide. It is not mandated that it be a rotation around the ++ * face, but could be a rotation to orient *to* that face, or a visiting of possible rotations. ++ * The method should return true if the rotation was successful though. ++ * ++ * @param worldObj The world ++ * @param x X position ++ * @param y Y position ++ * @param z Z position ++ * @param axis The axis to rotate around ++ * @return True if the rotation was successful, False if the rotation failed, or is not possible ++ */ ++ public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) ++ { ++ return RotationHelper.rotateVanillaBlock(this, worldObj, x, y, z, axis); ++ } ++ ++ /** ++ * Get the rotations that can apply to the block at the specified coordinates. Null means no rotations are possible. ++ * Note, this is up to the block to decide. It may not be accurate or representative. ++ * @param worldObj The world ++ * @param x X position ++ * @param y Y position ++ * @param z Z position ++ * @return An array of valid axes to rotate around, or null for none or unknown ++ */ ++ public ForgeDirection[] getValidRotations(World worldObj, int x, int y, int z) ++ { ++ return RotationHelper.getValidVanillaBlockRotations(this); ++ } ++ ++ /** ++ * Determines the amount of enchanting power this block can provide to an enchanting table. ++ * @param world The World ++ * @param x X position ++ * @param y Y position ++ * @param z Z position ++ * @return The amount of enchanting power this block produces. ++ */ ++ public float getEnchantPowerBonus(World world, int x, int y, int z) ++ { ++ return this == Blocks.field_150342_X ? 1 : 0; ++ } ++ ++ /** ++ * Common way to recolour a block with an external tool ++ * @param world The world ++ * @param x X ++ * @param y Y ++ * @param z Z ++ * @param side The side hit with the colouring tool ++ * @param colour The colour to change to ++ * @return If the recolouring was successful ++ */ ++ public boolean recolourBlock(World world, int x, int y, int z, ForgeDirection side, int colour) ++ { ++ if (this == Blocks.field_150325_L) ++ { ++ int meta = world.func_72805_g(x, y, z); ++ if (meta != colour) ++ { ++ world.func_72921_c(x, y, z, colour, 3); ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ /** ++ * Gathers how much experience this block drops when broken. ++ * ++ * @param world The world ++ * @param metadata ++ * @param fortune ++ * @return Amount of XP from breaking this block. ++ */ ++ public int getExpDrop(IBlockAccess world, int metadata, int fortune) ++ { ++ return 0; ++ } ++ ++ /** ++ * Called when a tile entity on a side of this block changes is created or is destroyed. ++ * @param world The world ++ * @param x The x position of this block instance ++ * @param y The y position of this block instance ++ * @param z The z position of this block instance ++ * @param tileX The x position of the tile that changed ++ * @param tileY The y position of the tile that changed ++ * @param tileZ The z position of the tile that changed ++ */ ++ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) ++ { ++ } ++ ++ /** ++ * Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules. ++ * @param world The world ++ * @param x The x position of this block instance ++ * @param y The y position of this block instance ++ * @param z The z position of this block instance ++ * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side ++ * @return Whether Block#isProvidingWeakPower should be called when determining indirect power ++ */ ++ public boolean shouldCheckWeakPower(IBlockAccess world, int x, int y, int z, int side) ++ { ++ return func_149721_r(); ++ } ++ ++ /** ++ * If this block should be notified of weak changes. ++ * Weak changes are changes 1 block away through a solid block. ++ * Similar to comparators. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @param side The side to check ++ * @return true To be notified of changes ++ */ ++ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) ++ { ++ return false; ++ } ++ ++ private String[] harvestTool = new String[16]; ++ private int[] harvestLevel = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; ++ /** ++ * Sets or removes the tool and level required to harvest this block. ++ * ++ * @param toolClass Class ++ * @param level Harvest level: ++ * Wood: 0 ++ * Stone: 1 ++ * Iron: 2 ++ * Diamond: 3 ++ * Gold: 0 ++ */ ++ public void setHarvestLevel(String toolClass, int level) ++ { ++ for (int m = 0; m < 16; m++) ++ { ++ setHarvestLevel(toolClass, level, m); ++ } ++ } ++ ++ /** ++ * Sets or removes the tool and level required to harvest this block. ++ * ++ * @param toolClass Class ++ * @param level Harvest level: ++ * Wood: 0 ++ * Stone: 1 ++ * Iron: 2 ++ * Diamond: 3 ++ * Gold: 0 ++ * @param metadata The specific metadata to set ++ */ ++ public void setHarvestLevel(String toolClass, int level, int metadata) ++ { ++ this.harvestTool[metadata] = toolClass; ++ this.harvestLevel[metadata] = level; ++ } ++ ++ /** ++ * Queries the class of tool required to harvest this block, if null is returned ++ * we assume that anything can harvest this block. ++ * ++ * @param metadata ++ * @return ++ */ ++ public String getHarvestTool(int metadata) ++ { ++ return harvestTool[metadata]; ++ } ++ ++ /** ++ * Queries the harvest level of this item stack for the specifred tool class, ++ * Returns -1 if this tool is not of the specified type ++ * ++ * @param stack This item stack instance ++ * @return Harvest level, or -1 if not the specified tool type. ++ */ ++ public int getHarvestLevel(int metadata) ++ { ++ return harvestLevel[metadata]; ++ } ++ ++ /** ++ * Checks if the specified tool type is efficient on this block, ++ * meaning that it digs at full speed. ++ * ++ * @param type ++ * @param metadata ++ * @return ++ */ ++ public boolean isToolEffective(String type, int metadata) ++ { ++ if ("pickaxe".equals(type) && (this == Blocks.field_150450_ax || this == Blocks.field_150439_ay || this == Blocks.field_150343_Z)) ++ return false; ++ if (harvestTool[metadata] == null) return false; ++ return harvestTool[metadata].equals(type); ++ } ++ ++ ++ // For Inernal use only to capture droped items inside getDrops ++ protected ThreadLocal captureDrops = new ThreadLocal() ++ { ++ @Override protected Boolean initialValue() { return false; } ++ }; ++ protected ThreadLocal> capturedDrops = new ThreadLocal>() ++ { ++ @Override protected List initialValue() { return new ArrayList(); } ++ }; ++ protected List captureDrops(boolean start) ++ { ++ if (start) ++ { ++ captureDrops.set(true); ++ capturedDrops.get().clear(); ++ return null; ++ } ++ else ++ { ++ captureDrops.set(false); ++ return capturedDrops.get(); ++ } ++ } ++ /* ========================================= FORGE END ======================================*/ ++ + public static class SoundType + { + public final String field_150501_a; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockBush.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockBush.java.patch new file mode 100644 index 0000000..04a0d41 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockBush.java.patch @@ -0,0 +1,73 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockBush.java ++++ ../src-work/minecraft/net/minecraft/block/BlockBush.java +@@ -6,8 +6,13 @@ + import net.minecraft.init.Blocks; + import net.minecraft.util.AxisAlignedBB; + import net.minecraft.world.World; ++import net.minecraft.world.IBlockAccess; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.util.ForgeDirection; ++import net.minecraftforge.common.IPlantable; ++import static net.minecraftforge.common.EnumPlantType.*; + +-public class BlockBush extends Block ++public class BlockBush extends Block implements IPlantable + { + private static final String __OBFID = "CL_00000208"; + +@@ -27,7 +32,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149854_a(p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_)); ++ return super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && this.func_149718_j(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_); + } + + protected boolean func_149854_a(Block p_149854_1_) +@@ -57,7 +62,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { +- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_).canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); + } + + public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) +@@ -79,4 +84,37 @@ + { + return 1; + } ++ ++ @Override ++ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) ++ { ++ if (this == Blocks.field_150464_aj) return Crop; ++ if (this == Blocks.field_150459_bM) return Crop; ++ if (this == Blocks.field_150469_bN) return Crop; ++ if (this == Blocks.field_150394_bc) return Crop; ++ if (this == Blocks.field_150393_bb) return Crop; ++ if (this == Blocks.field_150330_I) return Desert; ++ if (this == Blocks.field_150392_bi) return Water; ++ if (this == Blocks.field_150337_Q) return Cave; ++ if (this == Blocks.field_150338_P) return Cave; ++ if (this == Blocks.field_150388_bm) return Nether; ++ if (this == Blocks.field_150345_g) return Plains; ++ if (this == Blocks.field_150329_H) return Plains; ++ if (this == Blocks.field_150398_cm) return Plains; ++ if (this == Blocks.field_150328_O) return Plains; ++ if (this == Blocks.field_150327_N) return Plains; ++ return Plains; ++ } ++ ++ @Override ++ public Block getPlant(IBlockAccess world, int x, int y, int z) ++ { ++ return this; ++ } ++ ++ @Override ++ public int getPlantMetadata(IBlockAccess world, int x, int y, int z) ++ { ++ return world.func_72805_g(x, y, z); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockButton.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockButton.java.patch new file mode 100644 index 0000000..c460728 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockButton.java.patch @@ -0,0 +1,100 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockButton.java ++++ ../src-work/minecraft/net/minecraft/block/BlockButton.java +@@ -14,6 +14,9 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + public abstract class BlockButton extends Block + { + private final boolean field_150047_a; +@@ -49,12 +52,19 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + { +- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); ++ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); ++ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || ++ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || ++ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST)) || ++ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST)); + } + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); ++ return (p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST)) || ++ (p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST)) || ++ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH)) || ++ (p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH)); + } + + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -63,19 +73,21 @@ + int k1 = j1 & 8; + j1 &= 7; + +- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) ++ ForgeDirection dir = ForgeDirection.getOrientation(p_149660_5_); ++ ++ if (dir == NORTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) + { + j1 = 4; + } +- else if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) ++ else if (dir == SOUTH && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) + { + j1 = 3; + } +- else if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ else if (dir == WEST && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) + { + j1 = 2; + } +- else if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ else if (dir == EAST && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) + { + j1 = 1; + } +@@ -89,7 +101,11 @@ + + private int func_150045_e(World p_150045_1_, int p_150045_2_, int p_150045_3_, int p_150045_4_) + { +- return p_150045_1_.func_147439_a(p_150045_2_ - 1, p_150045_3_, p_150045_4_).func_149721_r() ? 1 : (p_150045_1_.func_147439_a(p_150045_2_ + 1, p_150045_3_, p_150045_4_).func_149721_r() ? 2 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ - 1).func_149721_r() ? 3 : (p_150045_1_.func_147439_a(p_150045_2_, p_150045_3_, p_150045_4_ + 1).func_149721_r() ? 4 : 1))); ++ if (p_150045_1_.isSideSolid(p_150045_2_ - 1, p_150045_3_, p_150045_4_, EAST)) return 1; ++ if (p_150045_1_.isSideSolid(p_150045_2_ + 1, p_150045_3_, p_150045_4_, WEST)) return 2; ++ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ - 1, SOUTH)) return 3; ++ if (p_150045_1_.isSideSolid(p_150045_2_, p_150045_3_, p_150045_4_ + 1, NORTH)) return 4; ++ return 1; + } + + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -99,22 +115,22 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7; + boolean flag = false; + +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) + { + flag = true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCactus.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCactus.java.patch new file mode 100644 index 0000000..b79414a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCactus.java.patch @@ -0,0 +1,49 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockCactus.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCactus.java +@@ -11,9 +11,13 @@ + import net.minecraft.util.AxisAlignedBB; + import net.minecraft.util.DamageSource; + import net.minecraft.util.IIcon; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.util.ForgeDirection; ++import net.minecraftforge.common.IPlantable; + +-public class BlockCactus extends Block ++public class BlockCactus extends Block implements IPlantable + { + @SideOnly(Side.CLIENT) + private IIcon field_150041_a; +@@ -125,7 +129,7 @@ + else + { + Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); +- return block == Blocks.field_150434_aF || block == Blocks.field_150354_m; ++ return block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); + } + } + +@@ -141,4 +145,22 @@ + this.field_150041_a = p_149651_1_.func_94245_a(this.func_149641_N() + "_top"); + this.field_150040_b = p_149651_1_.func_94245_a(this.func_149641_N() + "_bottom"); + } ++ ++ @Override ++ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) ++ { ++ return EnumPlantType.Desert; ++ } ++ ++ @Override ++ public Block getPlant(IBlockAccess world, int x, int y, int z) ++ { ++ return this; ++ } ++ ++ @Override ++ public int getPlantMetadata(IBlockAccess world, int x, int y, int z) ++ { ++ return -1; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockChest.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockChest.java.patch new file mode 100644 index 0000000..a953bc4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockChest.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockChest.java ++++ ../src-work/minecraft/net/minecraft/block/BlockChest.java +@@ -24,6 +24,8 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + public class BlockChest extends BlockContainer + { + private final Random field_149955_b = new Random(); +@@ -408,7 +410,7 @@ + { + return null; + } +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_).func_149721_r()) ++ else if (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_, DOWN)) + { + return null; + } +@@ -416,19 +418,19 @@ + { + return null; + } +- else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_ - 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ - 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ - 1, p_149951_3_, p_149951_4_))) + { + return null; + } +- else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_ + 1, p_149951_3_, p_149951_4_) == this && (p_149951_1_.isSideSolid(p_149951_2_ + 1, p_149951_3_ + 1, p_149951_4_, DOWN) || func_149953_o(p_149951_1_, p_149951_2_ + 1, p_149951_3_, p_149951_4_))) + { + return null; + } +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ - 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ - 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ - 1))) + { + return null; + } +- else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1).func_149721_r() || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) ++ else if (p_149951_1_.func_147439_a(p_149951_2_, p_149951_3_, p_149951_4_ + 1) == this && (p_149951_1_.isSideSolid(p_149951_2_, p_149951_3_ + 1, p_149951_4_ + 1, DOWN) || func_149953_o(p_149951_1_, p_149951_2_, p_149951_3_, p_149951_4_ + 1))) + { + return null; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCocoa.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCocoa.java.patch new file mode 100644 index 0000000..5e271ea --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCocoa.java.patch @@ -0,0 +1,46 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockCocoa.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCocoa.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.client.renderer.texture.IIconRegister; +@@ -160,6 +161,13 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ } ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int p_149690_5_, int fortune) ++ { ++ ArrayList dropped = super.getDrops(world, x, y, z, p_149690_5_, fortune); + int j1 = func_149987_c(p_149690_5_); + byte b0 = 1; + +@@ -170,8 +178,9 @@ + + for (int k1 = 0; k1 < b0; ++k1) + { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151100_aR, 1, 3)); ++ dropped.add(new ItemStack(Items.field_151100_aR, 1, 3)); + } ++ return dropped; + } + + @SideOnly(Side.CLIENT) +@@ -216,4 +225,10 @@ + ++j1; + p_149853_1_.func_72921_c(p_149853_3_, p_149853_4_, p_149853_5_, j1 << 2 | i1, 2); + } ++ ++ @Override ++ public Item func_149650_a(int par1, Random par2Random, int par3) ++ { ++ return null; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCrops.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCrops.java.patch new file mode 100644 index 0000000..16dd140 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCrops.java.patch @@ -0,0 +1,79 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockCrops.java ++++ ../src-work/minecraft/net/minecraft/block/BlockCrops.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.creativetab.CreativeTabs; +@@ -12,6 +13,7 @@ + import net.minecraft.util.IIcon; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class BlockCrops extends BlockBush implements IGrowable + { +@@ -89,11 +91,11 @@ + { + float f1 = 0.0F; + +- if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1) == Blocks.field_150458_ak) ++ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).canSustainPlant(p_149864_1_, l, p_149864_3_ - 1, i1, ForgeDirection.UP, this)) + { + f1 = 1.0F; + +- if (p_149864_1_.func_72805_g(l, p_149864_3_ - 1, i1) > 0) ++ if (p_149864_1_.func_147439_a(l, p_149864_3_ - 1, i1).isFertile(p_149864_1_, l, p_149864_3_ - 1, i1)) + { + f1 = 3.0F; + } +@@ -145,22 +147,6 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); +- +- if (!p_149690_1_.field_72995_K) +- { +- if (p_149690_5_ >= 7) +- { +- int j1 = 3 + p_149690_7_; +- +- for (int k1 = 0; k1 < j1; ++k1) +- { +- if (p_149690_1_.field_73012_v.nextInt(15) <= p_149690_5_) +- { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(this.func_149866_i(), 1, 0)); +- } +- } +- } +- } + } + + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -204,4 +190,23 @@ + { + this.func_149863_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + } ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); ++ ++ if (metadata >= 7) ++ { ++ for (int i = 0; i < 3 + fortune; ++i) ++ { ++ if (world.field_73012_v.nextInt(15) <= metadata) ++ { ++ ret.add(new ItemStack(this.func_149866_i(), 1, 0)); ++ } ++ } ++ } ++ ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDeadBush.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDeadBush.java.patch new file mode 100644 index 0000000..5a46765 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDeadBush.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockDeadBush.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDeadBush.java +@@ -1,5 +1,7 @@ + package net.minecraft.block; + ++import java.util.ArrayList; ++import java.util.Arrays; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.entity.player.EntityPlayer; +@@ -8,9 +10,11 @@ + import net.minecraft.item.Item; + import net.minecraft.item.ItemStack; + import net.minecraft.stats.StatList; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + +-public class BlockDeadBush extends BlockBush ++public class BlockDeadBush extends BlockBush implements IShearable + { + private static final String __OBFID = "CL_00000224"; + +@@ -33,14 +37,15 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + { +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) + { +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150330_I, 1, p_149636_6_)); +- } +- else +- { + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } ++ ++ @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; } ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ return new ArrayList(Arrays.asList(new ItemStack(Blocks.field_150330_I, 1, world.func_72805_g(x, y, z)))); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoor.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoor.java.patch new file mode 100644 index 0000000..554d64c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoor.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockDoor.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDoor.java +@@ -249,7 +249,7 @@ + { + if (this.field_149764_J == Material.field_151573_f) + { +- return true; ++ return false; //Allow items to interact with the door + } + else + { +@@ -367,7 +367,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_3_ >= 255 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); ++ return p_149742_3_ >= p_149742_1_.func_72800_K() - 1 ? false : World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && super.func_149742_c(p_149742_1_, p_149742_2_, p_149742_3_ + 1, p_149742_4_); + } + + public int func_149656_h() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoublePlant.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoublePlant.java.patch new file mode 100644 index 0000000..0170e39 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoublePlant.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockDoublePlant.java ++++ ../src-work/minecraft/net/minecraft/block/BlockDoublePlant.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.List; + import java.util.Random; + import net.minecraft.block.material.Material; +@@ -18,8 +19,9 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + +-public class BlockDoublePlant extends BlockBush implements IGrowable ++public class BlockDoublePlant extends BlockBush implements IGrowable, IShearable + { + public static final String[] field_149892_a = new String[] {"sunflower", "syringa", "grass", "fern", "rose", "paeonia"}; + @SideOnly(Side.CLIENT) +@@ -81,6 +83,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { ++ if (p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_, p_149718_4_) != this) return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check. + int l = p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_, p_149718_4_); + return func_149887_c(l) ? p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this : p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ + 1, p_149718_4_) == this && super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } +@@ -262,4 +265,22 @@ + int l = this.func_149885_e(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + this.func_149642_a(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, new ItemStack(this, 1, l)); + } ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ int metadata = world.func_72805_g(x, y, z); ++ int type = func_149890_d(metadata); ++ return func_149887_c(metadata) && (type == 3 || type == 4); ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ int type = func_149890_d(world.func_72805_g(x, y, z)); ++ if (type == 3 || type == 2) ++ ret.add(new ItemStack(Blocks.field_150329_H, 2, type == 3 ? 2 : 1)); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFalling.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFalling.java.patch new file mode 100644 index 0000000..c38ada9 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFalling.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockFalling.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFalling.java +@@ -84,7 +84,7 @@ + { + Block block = p_149831_0_.func_147439_a(p_149831_1_, p_149831_2_, p_149831_3_); + +- if (block.field_149764_J == Material.field_151579_a) ++ if (block.isAir(p_149831_0_, p_149831_1_, p_149831_2_, p_149831_3_)) + { + return true; + } +@@ -94,6 +94,7 @@ + } + else + { ++ //TODO: King, take a look here when doing liquids! + Material material = block.field_149764_J; + return material == Material.field_151586_h ? true : material == Material.field_151587_i; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFarmland.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFarmland.java.patch new file mode 100644 index 0000000..d964fd5 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFarmland.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockFarmland.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFarmland.java +@@ -12,6 +12,8 @@ + import net.minecraft.util.AxisAlignedBB; + import net.minecraft.util.IIcon; + import net.minecraft.world.World; ++import net.minecraftforge.common.IPlantable; ++import net.minecraftforge.common.util.ForgeDirection; + + public class BlockFarmland extends Block + { +@@ -94,7 +96,7 @@ + { + Block block = p_149822_1_.func_147439_a(l, p_149822_3_ + 1, i1); + +- if (block == Blocks.field_150464_aj || block == Blocks.field_150394_bc || block == Blocks.field_150393_bb || block == Blocks.field_150469_bN || block == Blocks.field_150459_bM) ++ if (block instanceof IPlantable && canSustainPlant(p_149822_1_, p_149822_2_, p_149822_3_, p_149822_4_, ForgeDirection.UP, (IPlantable)block)) + { + return true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFire.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFire.java.patch new file mode 100644 index 0000000..362ffb8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFire.java.patch @@ -0,0 +1,309 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockFire.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFire.java +@@ -2,7 +2,10 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.IdentityHashMap; ++import java.util.Map.Entry; + import java.util.Random; ++import com.google.common.collect.Maps; + import net.minecraft.block.material.MapColor; + import net.minecraft.block.material.Material; + import net.minecraft.client.renderer.texture.IIconRegister; +@@ -12,11 +15,15 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + import net.minecraft.world.WorldProviderEnd; ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; + + public class BlockFire extends Block + { +- private int[] field_149849_a = new int[256]; +- private int[] field_149848_b = new int[256]; ++ @Deprecated ++ private int[] field_149849_a = new int[4096]; ++ @Deprecated ++ private int[] field_149848_b = new int[4096]; + @SideOnly(Side.CLIENT) + private IIcon[] field_149850_M; + private static final String __OBFID = "CL_00000245"; +@@ -54,10 +61,10 @@ + Blocks.field_150480_ab.func_149842_a(func_149682_b(Blocks.field_150404_cg), 60, 20); + } + ++ @Deprecated // Use setFireInfo + public void func_149842_a(int p_149842_1_, int p_149842_2_, int p_149842_3_) + { +- this.field_149849_a[p_149842_1_] = p_149842_2_; +- this.field_149848_b[p_149842_1_] = p_149842_3_; ++ this.setFireInfo((Block)Block.field_149771_c.func_148754_a(p_149842_1_), p_149842_2_, p_149842_3_); + } + + public AxisAlignedBB func_149668_a(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) +@@ -94,13 +101,8 @@ + { + if (p_149674_1_.func_82736_K().func_82766_b("doFireTick")) + { +- boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150424_aL; ++ boolean flag = p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); + +- if (p_149674_1_.field_73011_w instanceof WorldProviderEnd && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ - 1, p_149674_4_) == Blocks.field_150357_h) +- { +- flag = true; +- } +- + if (!this.func_149742_c(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) + { + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); +@@ -128,7 +130,7 @@ + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); + } + } +- else if (!flag && !this.func_149844_e(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) && l == 15 && p_149674_5_.nextInt(4) == 0) ++ else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0) + { + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); + } +@@ -142,12 +144,12 @@ + b0 = -50; + } + +- this.func_149841_a(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l); +- this.func_149841_a(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l); ++ this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST ); ++ this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST ); ++ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP ); ++ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN ); ++ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH); ++ this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH); + + for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1) + { +@@ -201,10 +203,16 @@ + return false; + } + ++ @Deprecated + private void func_149841_a(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_) + { +- int j1 = this.field_149848_b[Block.func_149682_b(p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_))]; ++ this.tryCatchFire(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, p_149841_5_, p_149841_6_, p_149841_7_, UP); ++ } + ++ private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face) ++ { ++ int j1 = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); ++ + if (p_149841_6_.nextInt(p_149841_5_) < j1) + { + boolean flag = p_149841_1_.func_147439_a(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.field_150335_W; +@@ -234,7 +242,12 @@ + + private boolean func_149847_e(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) + { +- return this.func_149844_e(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_) ? true : (this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1) ? true : this.func_149844_e(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1))))); ++ return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) || ++ this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) || ++ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) || ++ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) || ++ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) || ++ this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH); + } + + private int func_149845_m(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) +@@ -247,12 +260,13 @@ + } + else + { +- int l = this.func_149846_a(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, b0); +- l = this.func_149846_a(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l); +- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l); +- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l); +- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l); +- l = this.func_149846_a(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l); ++ int l = b0; ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST ); ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST ); ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP ); ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN ); ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH); ++ l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH); + return l; + } + } +@@ -262,15 +276,16 @@ + return false; + } + ++ @Deprecated + public boolean func_149844_e(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) + { +- return this.field_149849_a[Block.func_149682_b(p_149844_1_.func_147439_a(p_149844_2_, p_149844_3_, p_149844_4_))] > 0; ++ return canCatchFire(p_149844_1_, p_149844_2_, p_149844_3_, p_149844_4_, UP); + } + ++ @Deprecated + public int func_149846_a(World p_149846_1_, int p_149846_2_, int p_149846_3_, int p_149846_4_, int p_149846_5_) + { +- int i1 = this.field_149849_a[Block.func_149682_b(p_149846_1_.func_147439_a(p_149846_2_, p_149846_3_, p_149846_4_))]; +- return i1 > p_149846_5_ ? i1 : p_149846_5_; ++ return getChanceToEncourageFire(p_149846_1_, p_149846_2_, p_149846_3_, p_149846_4_, p_149846_5_, UP); + } + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) +@@ -314,9 +329,9 @@ + float f1; + float f2; + +- if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_)) ++ if (!World.func_147466_a(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)) + { +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)) + { + for (l = 0; l < 2; ++l) + { +@@ -327,7 +342,7 @@ + } + } + +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)) + { + for (l = 0; l < 2; ++l) + { +@@ -338,7 +353,7 @@ + } + } + +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)) + { + for (l = 0; l < 2; ++l) + { +@@ -349,7 +364,7 @@ + } + } + +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)) + { + for (l = 0; l < 2; ++l) + { +@@ -360,7 +375,7 @@ + } + } + +- if (Blocks.field_150480_ab.func_149844_e(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)) + { + for (l = 0; l < 2; ++l) + { +@@ -405,4 +420,101 @@ + { + return MapColor.field_151656_f; + } ++ ++ /*================================= Forge Start ======================================*/ ++ private static class FireInfo ++ { ++ private int encouragement = 0; ++ private int flammibility = 0; ++ } ++ private IdentityHashMap blockInfo = Maps.newIdentityHashMap(); ++ ++ public void setFireInfo(Block block, int encouragement, int flammibility) ++ { ++ if (block == Blocks.field_150350_a) throw new IllegalArgumentException("Tried to set air on fire... This is bad."); ++ int id = Block.func_149682_b(block); ++ this.field_149849_a[id] = encouragement; ++ this.field_149848_b[id] = flammibility; ++ ++ FireInfo info = getInfo(block, true); ++ info.encouragement = encouragement; ++ info.flammibility = flammibility; ++ } ++ ++ private FireInfo getInfo(Block block, boolean garentee) ++ { ++ FireInfo ret = blockInfo.get(block); ++ if (ret == null && garentee) ++ { ++ ret = new FireInfo(); ++ blockInfo.put(block, ret); ++ } ++ return ret; ++ } ++ ++ public void rebuildFireInfo() ++ { ++ for (int x = 0; x < 4096; x++) ++ { ++ //If we care.. we could detect changes in here and make sure we keep them, however ++ //it's my thinking that anyone who hacks into the private variables should DIAF and we don't care about them. ++ field_149849_a[x] = 0; ++ field_149848_b[x] = 0; ++ } ++ ++ for (Entry e : blockInfo.entrySet()) ++ { ++ int id = Block.func_149682_b(e.getKey()); ++ if (id >= 0 && id < 4096) ++ { ++ field_149849_a[id] = e.getValue().encouragement; ++ field_149848_b[id] = e.getValue().flammibility; ++ } ++ } ++ } ++ ++ public int getFlammability(Block block) ++ { ++ int id = Block.func_149682_b(block); ++ return id >= 0 && id < 4096 ? field_149848_b[id] : 0; ++ } ++ ++ public int getEncouragement(Block block) ++ { ++ int id = Block.func_149682_b(block); ++ return id >= 0 && id < 4096 ? field_149849_a[id] : 0; ++ } ++ ++ /** ++ * Side sensitive version that calls the block function. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param face The side the fire is coming from ++ * @return True if the face can catch fire. ++ */ ++ public boolean canCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) ++ { ++ return world.func_147439_a(x, y, z).isFlammable(world, x, y, z, face); ++ } ++ ++ /** ++ * Side sensitive version that calls the block function. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @param oldChance The previous maximum chance. ++ * @param face The side the fire is coming from ++ * @return The chance of the block catching fire, or oldChance if it is higher ++ */ ++ public int getChanceToEncourageFire(IBlockAccess world, int x, int y, int z, int oldChance, ForgeDirection face) ++ { ++ int newChance = world.func_147439_a(x, y, z).getFireSpreadSpeed(world, x, y, z, face); ++ return (newChance > oldChance ? newChance : oldChance); ++ } ++ /*================================= Forge Start ======================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFlowerPot.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFlowerPot.java.patch new file mode 100644 index 0000000..637b3bf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFlowerPot.java.patch @@ -0,0 +1,53 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockFlowerPot.java ++++ ../src-work/minecraft/net/minecraft/block/BlockFlowerPot.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.entity.player.EntityPlayer; +@@ -138,13 +139,6 @@ + + public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { +- TileEntityFlowerPot tileentityflowerpot = this.func_149929_e(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_); +- +- if (tileentityflowerpot != null && tileentityflowerpot.func_145965_a() != null) +- { +- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, new ItemStack(tileentityflowerpot.func_145965_a(), 1, tileentityflowerpot.func_145966_b())); +- } +- + super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + +@@ -231,4 +225,28 @@ + + return new TileEntityFlowerPot(Item.func_150898_a((Block)object), b0); + } ++ ++ /*============================FORGE START=====================================*/ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); ++ TileEntityFlowerPot te = this.func_149929_e(world, x, y, z); ++ if (te != null && te.func_145965_a() != null) ++ ret.add(new ItemStack(te.func_145965_a(), 1, te.func_145966_b())); ++ return ret; ++ } ++ @Override ++ public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) ++ { ++ if (willHarvest) return true; //If it will harvest, delay deletion of the block until after getDrops ++ return super.removedByPlayer(world, player, x, y, z, willHarvest); ++ } ++ @Override ++ public void func_149636_a(World world, EntityPlayer player, int x, int y, int z, int meta) ++ { ++ super.func_149636_a(world, player, x, y, z, meta); ++ world.func_147468_f(x, y, z); ++ } ++ /*===========================FORGE END==========================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockGrass.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockGrass.java.patch new file mode 100644 index 0000000..48d3edd --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockGrass.java.patch @@ -0,0 +1,37 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockGrass.java ++++ ../src-work/minecraft/net/minecraft/block/BlockGrass.java +@@ -43,7 +43,7 @@ + { + if (!p_149674_1_.field_72995_K) + { +- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) ++ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) + { + p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d); + } +@@ -56,7 +56,7 @@ + int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); + +- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) ++ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) + { + p_149674_1_.func_147449_b(i1, j1, k1, Blocks.field_150349_c); + } +@@ -184,15 +184,7 @@ + } + else + { +- String s = p_149853_1_.func_72807_a(i1, k1).func_150572_a(p_149853_2_, i1, j1, k1); +- field_149992_a.debug("Flower in " + p_149853_1_.func_72807_a(i1, k1).field_76791_y + ": " + s); +- BlockFlower blockflower = BlockFlower.func_149857_e(s); +- +- if (blockflower != null && blockflower.func_149718_j(p_149853_1_, i1, j1, k1)) +- { +- int i2 = BlockFlower.func_149856_f(s); +- p_149853_1_.func_147465_d(i1, j1, k1, blockflower, i2, 3); +- } ++ p_149853_1_.func_72807_a(i1, k1).plantFlower(p_149853_1_, p_149853_2_, i1, j1, k1); + } + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockIce.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockIce.java.patch new file mode 100644 index 0000000..8f0df8f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockIce.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockIce.java ++++ ../src-work/minecraft/net/minecraft/block/BlockIce.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; +@@ -13,6 +14,7 @@ + import net.minecraft.world.EnumSkyBlock; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.event.ForgeEventFactory; + + public class BlockIce extends BlockBreakable + { +@@ -43,14 +45,16 @@ + p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); + p_149636_2_.func_71020_j(0.025F); + +- if (this.func_149700_E() && EnchantmentHelper.func_77502_d(p_149636_2_)) ++ if (this.canSilkHarvest(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_) && EnchantmentHelper.func_77502_d(p_149636_2_)) + { ++ ArrayList items = new ArrayList(); + ItemStack itemstack = this.func_149644_j(p_149636_6_); + +- if (itemstack != null) +- { +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, itemstack); +- } ++ if (itemstack != null) items.add(itemstack); ++ ++ ForgeEventFactory.fireBlockHarvesting(items, p_149636_1_, this, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, 0, 1.0f, true, p_149636_2_); ++ for (ItemStack is : items) ++ this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, is); + } + else + { +@@ -61,7 +65,9 @@ + } + + int i1 = EnchantmentHelper.func_77517_e(p_149636_2_); ++ harvesters.set(p_149636_2_); + this.func_149697_b(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_, i1); ++ harvesters.set(null); + Material material = p_149636_1_.func_147439_a(p_149636_3_, p_149636_4_ - 1, p_149636_5_).func_149688_o(); + + if (material.func_76230_c() || material.func_76224_d()) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLadder.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLadder.java.patch new file mode 100644 index 0000000..c586c85 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLadder.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLadder.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLadder.java +@@ -5,10 +5,14 @@ + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; ++import net.minecraft.entity.EntityLivingBase; + import net.minecraft.util.AxisAlignedBB; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + public class BlockLadder extends Block + { + private static final String __OBFID = "CL_00000262"; +@@ -79,29 +83,32 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); ++ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || ++ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); + } + + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) + { + int j1 = p_149660_9_; + +- if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) ++ if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) + { + j1 = 2; + } + +- if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) ++ if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) + { + j1 = 3; + } + +- if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) + { + j1 = 4; + } + +- if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) + { + j1 = 5; + } +@@ -114,22 +121,22 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_); + boolean flag = false; + +- if (l == 2 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r()) ++ if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH)) + { + flag = true; + } + +- if (l == 3 && p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r()) ++ if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH)) + { + flag = true; + } + +- if (l == 4 && p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r()) ++ if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST)) + { + flag = true; + } + +- if (l == 5 && p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r()) ++ if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST)) + { + flag = true; + } +@@ -147,4 +154,10 @@ + { + return 1; + } ++ ++ @Override ++ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLeaves.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLeaves.java.patch new file mode 100644 index 0000000..570196d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLeaves.java.patch @@ -0,0 +1,171 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLeaves.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLeaves.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; +@@ -15,8 +16,9 @@ + import net.minecraft.world.ColorizerFoliage; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + +-public abstract class BlockLeaves extends BlockLeavesBase ++public abstract class BlockLeaves extends BlockLeavesBase implements IShearable + { + int[] field_150128_a; + @SideOnly(Side.CLIENT) +@@ -82,10 +84,10 @@ + { + for (int l1 = -b0; l1 <= b0; ++l1) + { +- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) ++ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); ++ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) + { +- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); ++ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + } + } + } +@@ -127,9 +129,9 @@ + { + Block block = p_149674_1_.func_147439_a(p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2); + +- if (block != Blocks.field_150364_r && block != Blocks.field_150363_s) ++ if (!block.canSustainLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) + { +- if (block.func_149688_o() == Material.field_151584_j) ++ if (block.isLeaves(p_149674_1_, p_149674_2_ + l1, p_149674_3_ + i2, p_149674_4_ + j2)) + { + this.field_150128_a[(l1 + k1) * j1 + (i2 + k1) * b1 + j2 + k1] = -2; + } +@@ -236,40 +238,7 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { +- if (!p_149690_1_.field_72995_K) +- { +- int j1 = this.func_150123_b(p_149690_5_); +- +- if (p_149690_7_ > 0) +- { +- j1 -= 2 << p_149690_7_; +- +- if (j1 < 10) +- { +- j1 = 10; +- } +- } +- +- if (p_149690_1_.field_73012_v.nextInt(j1) == 0) +- { +- Item item = this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_); +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(item, 1, this.func_149692_a(p_149690_5_))); +- } +- +- j1 = 200; +- +- if (p_149690_7_ > 0) +- { +- j1 -= 10 << p_149690_7_; +- +- if (j1 < 40) +- { +- j1 = 40; +- } +- } +- +- this.func_150124_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, j1); +- } ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, 1.0f, p_149690_7_); + } + + protected void func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {} +@@ -281,13 +250,7 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + { +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) + { +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.func_150898_a(this), 1, p_149636_6_ & 3)); +- } +- else +- { + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } +@@ -318,4 +281,67 @@ + } + + public abstract String[] func_150125_e(); ++ ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z) & 3)); ++ return ret; ++ } ++ ++ @Override ++ public void beginLeavesDecay(World world, int x, int y, int z) ++ { ++ ++ int i2 = world.func_72805_g(x, y, z); ++ ++ if ((i2 & 8) == 0) ++ { ++ world.func_72921_c(x, y, z, i2 | 8, 4); ++ } ++ world.func_72921_c(x, y, z, world.func_72805_g(x, y, z) | 8, 4); ++ } ++ ++ @Override ++ public boolean isLeaves(IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ int chance = this.func_150123_b(metadata); ++ ++ if (fortune > 0) ++ { ++ chance -= 2 << fortune; ++ if (chance < 10) chance = 10; ++ } ++ ++ if (world.field_73012_v.nextInt(chance) == 0) ++ ret.add(new ItemStack(this.func_149650_a(metadata, world.field_73012_v, fortune), 1, this.func_149692_a(metadata))); ++ ++ chance = 200; ++ if (fortune > 0) ++ { ++ chance -= 10 << fortune; ++ if (chance < 40) chance = 40; ++ } ++ ++ this.captureDrops(true); ++ this.func_150124_c(world, x, y, z, metadata, chance); // Dammet mojang ++ ret.addAll(this.captureDrops(false)); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLever.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLever.java.patch new file mode 100644 index 0000000..940121e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLever.java.patch @@ -0,0 +1,128 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLever.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLever.java +@@ -10,6 +10,9 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + public class BlockLever extends Block + { + private static final String __OBFID = "CL_00000264"; +@@ -42,12 +45,23 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + { +- return p_149707_5_ == 0 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_ + 1, p_149707_4_).func_149721_r() ? true : (p_149707_5_ == 1 && World.func_147466_a(p_149707_1_, p_149707_2_, p_149707_3_ - 1, p_149707_4_) ? true : (p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())))); ++ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); ++ return (dir == DOWN && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ + 1, p_149707_4_, DOWN )) || ++ (dir == UP && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_ - 1, p_149707_4_, UP )) || ++ (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || ++ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || ++ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) || ++ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); + } + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r() ? true : (World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ + 1, p_149742_4_).func_149721_r())))); ++ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || ++ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ - 1, p_149742_4_, UP ) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_ + 1, p_149742_4_, DOWN ); + } + + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -56,32 +70,32 @@ + int j1 = p_149660_9_ & 7; + byte b0 = -1; + +- if (p_149660_5_ == 0 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_ + 1, p_149660_4_).func_149721_r()) ++ if (p_149660_5_ == 0 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ + 1, p_149660_4_, DOWN)) + { + b0 = 0; + } + +- if (p_149660_5_ == 1 && World.func_147466_a(p_149660_1_, p_149660_2_, p_149660_3_ - 1, p_149660_4_)) ++ if (p_149660_5_ == 1 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_ - 1, p_149660_4_, UP)) + { + b0 = 5; + } + +- if (p_149660_5_ == 2 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ + 1).func_149721_r()) ++ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH)) + { + b0 = 4; + } + +- if (p_149660_5_ == 3 && p_149660_1_.func_147439_a(p_149660_2_, p_149660_3_, p_149660_4_ - 1).func_149721_r()) ++ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH)) + { + b0 = 3; + } + +- if (p_149660_5_ == 4 && p_149660_1_.func_147439_a(p_149660_2_ + 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST)) + { + b0 = 2; + } + +- if (p_149660_5_ == 5 && p_149660_1_.func_147439_a(p_149660_2_ - 1, p_149660_3_, p_149660_4_).func_149721_r()) ++ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST)) + { + b0 = 1; + } +@@ -147,42 +161,42 @@ + int l = p_149695_1_.func_72805_g(p_149695_2_, p_149695_3_, p_149695_4_) & 7; + boolean flag = false; + +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 1) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && l == 1) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && l == 2) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && l == 2) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && l == 3) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && l == 3) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && l == 4) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && l == 4) + { + flag = true; + } + +- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 5) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 5) + { + flag = true; + } + +- if (!World.func_147466_a(p_149695_1_, p_149695_2_, p_149695_3_ - 1, p_149695_4_) && l == 6) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ - 1, p_149695_4_, UP) && l == 6) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 0) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 0) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_ + 1, p_149695_4_).func_149721_r() && l == 7) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_ + 1, p_149695_4_, DOWN) && l == 7) + { + flag = true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLiquid.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLiquid.java.patch new file mode 100644 index 0000000..002dbc4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLiquid.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLiquid.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLiquid.java +@@ -67,7 +67,7 @@ + { + for (int l1 = -1; l1 <= 1; ++l1) + { +- int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).field_76759_H; ++ int i2 = p_149720_1_.func_72807_a(p_149720_2_ + l1, p_149720_4_ + k1).getWaterColorMultiplier(); + l += (i2 & 16711680) >> 16; + i1 += (i2 & 65280) >> 8; + j1 += i2 & 255; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLog.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLog.java.patch new file mode 100644 index 0000000..3fe642a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLog.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockLog.java ++++ ../src-work/minecraft/net/minecraft/block/BlockLog.java +@@ -7,6 +7,7 @@ + import net.minecraft.creativetab.CreativeTabs; + import net.minecraft.item.Item; + import net.minecraft.util.IIcon; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + + public abstract class BlockLog extends BlockRotatedPillar +@@ -53,14 +54,10 @@ + { + for (int l1 = -b0; l1 <= b0; ++l1) + { +- if (p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1).func_149688_o() == Material.field_151584_j) ++ Block block = p_149749_1_.func_147439_a(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); ++ if (block.isLeaves(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1)) + { +- int i2 = p_149749_1_.func_72805_g(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); +- +- if ((i2 & 8) == 0) +- { +- p_149749_1_.func_72921_c(p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1, i2 | 8, 4); +- } ++ block.beginLeavesDecay(p_149749_1_, p_149749_2_ + j1, p_149749_3_ + k1, p_149749_4_ + l1); + } + } + } +@@ -79,4 +76,16 @@ + { + return this.field_150166_b[p_150161_1_ % this.field_150166_b.length]; + } ++ ++ @Override ++ public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ @Override ++ public boolean isWood(IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMobSpawner.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMobSpawner.java.patch new file mode 100644 index 0000000..a5892b9 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMobSpawner.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockMobSpawner.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMobSpawner.java +@@ -7,6 +7,7 @@ + import net.minecraft.item.Item; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.tileentity.TileEntityMobSpawner; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + + public class BlockMobSpawner extends BlockContainer +@@ -36,10 +37,15 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); +- int j1 = 15 + p_149690_1_.field_73012_v.nextInt(15) + p_149690_1_.field_73012_v.nextInt(15); +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); + } + ++ private Random rand = new Random(); ++ @Override ++ public int getExpDrop(IBlockAccess world, int metadata, int fortune) ++ { ++ return 15 + rand.nextInt(15) + rand.nextInt(15); ++ } ++ + public boolean func_149662_c() + { + return false; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMushroom.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMushroom.java.patch new file mode 100644 index 0000000..666debf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMushroom.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockMushroom.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMushroom.java +@@ -4,6 +4,7 @@ + import net.minecraft.init.Blocks; + import net.minecraft.world.World; + import net.minecraft.world.gen.feature.WorldGenBigMushroom; ++import net.minecraftforge.common.util.ForgeDirection; + + public class BlockMushroom extends BlockBush implements IGrowable + { +@@ -85,7 +86,7 @@ + if (p_149718_3_ >= 0 && p_149718_3_ < 256) + { + Block block = p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_); +- return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && this.func_149854_a(block); ++ return block == Blocks.field_150391_bh || block == Blocks.field_150346_d && p_149718_1_.func_72805_g(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == 2 || p_149718_1_.func_72883_k(p_149718_2_, p_149718_3_, p_149718_4_) < 13 && block.canSustainPlant(p_149718_1_, p_149718_2_, p_149718_3_ - 1, p_149718_4_, ForgeDirection.UP, this); + } + else + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMycelium.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMycelium.java.patch new file mode 100644 index 0000000..db2d47e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMycelium.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockMycelium.java ++++ ../src-work/minecraft/net/minecraft/block/BlockMycelium.java +@@ -37,7 +37,7 @@ + { + if (!p_149674_1_.field_72995_K) + { +- if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.func_147439_a(p_149674_2_, p_149674_3_ + 1, p_149674_4_).func_149717_k() > 2) ++ if (p_149674_1_.func_72957_l(p_149674_2_, p_149674_3_ + 1, p_149674_4_) < 4 && p_149674_1_.getBlockLightOpacity(p_149674_2_, p_149674_3_ + 1, p_149674_4_) > 2) + { + p_149674_1_.func_147449_b(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.field_150346_d); + } +@@ -50,7 +50,7 @@ + int k1 = p_149674_4_ + p_149674_5_.nextInt(3) - 1; + Block block = p_149674_1_.func_147439_a(i1, j1 + 1, k1); + +- if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && block.func_149717_k() <= 2) ++ if (p_149674_1_.func_147439_a(i1, j1, k1) == Blocks.field_150346_d && p_149674_1_.func_72805_g(i1, j1, k1) == 0 && p_149674_1_.func_72957_l(i1, j1 + 1, k1) >= 4 && p_149674_1_.getBlockLightOpacity(i1, j1 + 1, k1) <= 2) + { + p_149674_1_.func_147449_b(i1, j1, k1, this); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNetherWart.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNetherWart.java.patch new file mode 100644 index 0000000..52c7094 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNetherWart.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockNetherWart.java ++++ ../src-work/minecraft/net/minecraft/block/BlockNetherWart.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.creativetab.CreativeTabs; +@@ -11,6 +12,7 @@ + import net.minecraft.item.ItemStack; + import net.minecraft.util.IIcon; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class BlockNetherWart extends BlockBush + { +@@ -33,7 +35,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { +- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } + + public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) +@@ -60,9 +62,12 @@ + return 6; + } + ++ @SuppressWarnings("unused") + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { +- if (!p_149690_1_.field_72995_K) ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ ++ if (false && !p_149690_1_.field_72995_K) + { + int j1 = 1; + +@@ -109,4 +114,23 @@ + this.field_149883_a[i] = p_149651_1_.func_94245_a(this.func_149641_N() + "_stage_" + i); + } + } ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ int count = 1; ++ ++ if (metadata >= 3) ++ { ++ count = 2 + world.field_73012_v.nextInt(3) + (fortune > 0 ? world.field_73012_v.nextInt(fortune + 1) : 0); ++ } ++ ++ for (int i = 0; i < count; i++) ++ { ++ ret.add(new ItemStack(Items.field_151075_bm)); ++ } ++ ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNote.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNote.java.patch new file mode 100644 index 0000000..2ad648f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNote.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockNote.java ++++ ../src-work/minecraft/net/minecraft/block/BlockNote.java +@@ -45,7 +45,9 @@ + + if (tileentitynote != null) + { ++ int old = tileentitynote.field_145879_a; + tileentitynote.func_145877_a(); ++ if (old == tileentitynote.field_145879_a) return false; + tileentitynote.func_145878_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + } + +@@ -73,6 +75,11 @@ + + public boolean func_149696_a(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) + { ++ int meta = p_149696_1_.func_72805_g(p_149696_2_, p_149696_3_, p_149696_4_); ++ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, meta, p_149696_6_, p_149696_5_); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false; ++ p_149696_5_ = e.instrument.ordinal(); ++ p_149696_6_ = e.getVanillaNoteId(); + float f = (float)Math.pow(2.0D, (double)(p_149696_6_ - 12) / 12.0D); + String s = "harp"; + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockOre.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockOre.java.patch new file mode 100644 index 0000000..7ab4689 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockOre.java.patch @@ -0,0 +1,58 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockOre.java ++++ ../src-work/minecraft/net/minecraft/block/BlockOre.java +@@ -7,6 +7,7 @@ + import net.minecraft.init.Items; + import net.minecraft.item.Item; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + + public class BlockOre extends Block +@@ -51,34 +52,40 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ } + +- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this)) ++ private Random rand = new Random(); ++ @Override ++ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) ++ { ++ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) + { + int j1 = 0; + + if (this == Blocks.field_150365_q) + { +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 0, 2); ++ j1 = MathHelper.func_76136_a(rand, 0, 2); + } + else if (this == Blocks.field_150482_ag) + { +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7); ++ j1 = MathHelper.func_76136_a(rand, 3, 7); + } + else if (this == Blocks.field_150412_bA) + { +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 3, 7); ++ j1 = MathHelper.func_76136_a(rand, 3, 7); + } + else if (this == Blocks.field_150369_x) + { +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5); ++ j1 = MathHelper.func_76136_a(rand, 2, 5); + } + else if (this == Blocks.field_150449_bY) + { +- j1 = MathHelper.func_76136_a(p_149690_1_.field_73012_v, 2, 5); ++ j1 = MathHelper.func_76136_a(rand, 2, 5); + } + +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); ++ return j1; + } ++ return 0; + } + + public int func_149692_a(int p_149692_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPane.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPane.java.patch new file mode 100644 index 0000000..24b8608 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPane.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockPane.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPane.java +@@ -15,6 +15,8 @@ + import net.minecraft.util.IIcon; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; + + public class BlockPane extends Block + { +@@ -62,10 +64,10 @@ + + public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) + { +- boolean flag = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ - 1)); +- boolean flag1 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_, p_149743_3_, p_149743_4_ + 1)); +- boolean flag2 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ - 1, p_149743_3_, p_149743_4_)); +- boolean flag3 = this.func_150098_a(p_149743_1_.func_147439_a(p_149743_2_ + 1, p_149743_3_, p_149743_4_)); ++ boolean flag = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ - 1, NORTH); ++ boolean flag1 = this.canPaneConnectTo(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_ + 1, SOUTH); ++ boolean flag2 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ - 1, p_149743_3_, p_149743_4_, WEST ); ++ boolean flag3 = this.canPaneConnectTo(p_149743_1_, p_149743_2_ + 1, p_149743_3_, p_149743_4_, EAST ); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { +@@ -117,10 +119,10 @@ + float f1 = 0.5625F; + float f2 = 0.4375F; + float f3 = 0.5625F; +- boolean flag = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ - 1)); +- boolean flag1 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_, p_149719_3_, p_149719_4_ + 1)); +- boolean flag2 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ - 1, p_149719_3_, p_149719_4_)); +- boolean flag3 = this.func_150098_a(p_149719_1_.func_147439_a(p_149719_2_ + 1, p_149719_3_, p_149719_4_)); ++ boolean flag = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ - 1, NORTH); ++ boolean flag1 = this.canPaneConnectTo(p_149719_1_, p_149719_2_, p_149719_3_, p_149719_4_ + 1, SOUTH); ++ boolean flag2 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ - 1, p_149719_3_, p_149719_4_, WEST ); ++ boolean flag3 = this.canPaneConnectTo(p_149719_1_, p_149719_2_ + 1, p_149719_3_, p_149719_4_, EAST ); + + if ((!flag2 || !flag3) && (flag2 || flag3 || flag || flag1)) + { +@@ -186,4 +188,10 @@ + this.field_149761_L = p_149651_1_.func_94245_a(this.field_150101_M); + this.field_150102_N = p_149651_1_.func_94245_a(this.field_150100_a); + } ++ ++ public boolean canPaneConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) ++ { ++ return func_150098_a(world.func_147439_a(x, y, z)) || ++ world.isSideSolid(x, y, z, dir.getOpposite(), false); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonBase.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonBase.java.patch new file mode 100644 index 0000000..4fe844e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonBase.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockPistonBase.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPistonBase.java +@@ -11,6 +11,7 @@ + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.item.ItemStack; ++import net.minecraft.server.management.PlayerManager; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.tileentity.TileEntityPiston; + import net.minecraft.util.AxisAlignedBB; +@@ -360,7 +361,8 @@ + return false; + } + +- return !(p_150080_0_ instanceof ITileEntityProvider); ++ return !(p_150080_1_.func_147439_a(p_150080_2_, p_150080_3_, p_150080_4_).hasTileEntity(p_150080_1_.func_72805_g(p_150080_2_, p_150080_3_, p_150080_4_))); ++ + } + } + +@@ -375,14 +377,14 @@ + { + if (l1 < 13) + { +- if (j1 <= 0 || j1 >= 255) ++ if (j1 <= 0 || j1 >= p_150077_0_.func_72800_K()) + { + return false; + } + + Block block = p_150077_0_.func_147439_a(i1, j1, k1); + +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(p_150077_0_, i1, j1, k1)) + { + if (!func_150080_a(block, p_150077_0_, i1, j1, k1, true)) + { +@@ -420,14 +422,14 @@ + { + if (l1 < 13) + { +- if (j1 <= 0 || j1 >= 255) ++ if (j1 <= 0 || j1 >= p_150079_1_.func_72800_K()) + { + return false; + } + + Block block = p_150079_1_.func_147439_a(i1, j1, k1); + +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(p_150079_1_, i1, j1, k1)) + { + if (!func_150080_a(block, p_150079_1_, i1, j1, k1, true)) + { +@@ -448,7 +450,9 @@ + continue; + } + +- block.func_149697_b(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), 0); ++ //With our change to how snowballs are dropped this needs to disallow to mimic vanilla behavior. ++ float chance = block instanceof BlockSnow ? -1.0f : 1.0f; ++ block.func_149690_a(p_150079_1_, i1, j1, k1, p_150079_1_.func_72805_g(i1, j1, k1), chance, 0); + p_150079_1_.func_147468_f(i1, j1, k1); + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonMoving.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonMoving.java.patch new file mode 100644 index 0000000..97245a1 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonMoving.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockPistonMoving.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPistonMoving.java +@@ -2,11 +2,13 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.item.Item; ++import net.minecraft.item.ItemStack; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.tileentity.TileEntityPiston; + import net.minecraft.util.AxisAlignedBB; +@@ -90,15 +92,7 @@ + + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { +- if (!p_149690_1_.field_72995_K) +- { +- TileEntityPiston tileentitypiston = this.func_149963_e(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_); +- +- if (tileentitypiston != null) +- { +- tileentitypiston.func_145861_a().func_149697_b(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, tileentitypiston.func_145832_p(), 0); +- } +- } ++ super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + } + + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -231,4 +225,13 @@ + { + this.field_149761_L = p_149651_1_.func_94245_a("piston_top_normal"); + } ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ TileEntityPiston te = this.func_149963_e(world, x, y, z); ++ if (te != null) ++ return te.func_145861_a().getDrops(world, x, y, z, te.func_145832_p(), 0); ++ return new ArrayList(); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPotato.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPotato.java.patch new file mode 100644 index 0000000..7c89fb3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPotato.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockPotato.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPotato.java +@@ -1,5 +1,6 @@ + package net.minecraft.block; + ++import java.util.ArrayList; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.renderer.texture.IIconRegister; +@@ -46,14 +47,15 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ } + +- if (!p_149690_1_.field_72995_K) +- { +- if (p_149690_5_ >= 7 && p_149690_1_.field_73012_v.nextInt(50) == 0) +- { +- this.func_149642_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, new ItemStack(Items.field_151170_bI)); +- } +- } ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) ++ { ++ ArrayList ret = super.getDrops(world, x, y, z, metadata, fortune); ++ if (metadata >= 7 && world.field_73012_v.nextInt(50) == 0) ++ ret.add(new ItemStack(Items.field_151170_bI)); ++ return ret; + } + + @SideOnly(Side.CLIENT) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPumpkin.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPumpkin.java.patch new file mode 100644 index 0000000..ae47c33 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPumpkin.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockPumpkin.java ++++ ../src-work/minecraft/net/minecraft/block/BlockPumpkin.java +@@ -113,7 +113,7 @@ + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).field_149764_J.func_76222_j() && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); ++ return p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_).isReplaceable(p_149742_1_, p_149742_2_, p_149742_3_, p_149742_4_) && World.func_147466_a(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); + } + + public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRailBase.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRailBase.java.patch new file mode 100644 index 0000000..0d5dcaf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRailBase.java.patch @@ -0,0 +1,208 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockRailBase.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRailBase.java +@@ -5,6 +5,7 @@ + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; ++import net.minecraft.entity.item.EntityMinecart; + import net.minecraft.init.Blocks; + import net.minecraft.util.AxisAlignedBB; + import net.minecraft.util.MovingObjectPosition; +@@ -25,7 +26,7 @@ + + public static final boolean func_150051_a(Block p_150051_0_) + { +- return p_150051_0_ == Blocks.field_150448_aq || p_150051_0_ == Blocks.field_150318_D || p_150051_0_ == Blocks.field_150319_E || p_150051_0_ == Blocks.field_150408_cc; ++ return p_150051_0_ instanceof BlockRailBase; + } + + protected BlockRailBase(boolean p_i45389_1_) +@@ -78,7 +79,7 @@ + + public int func_149645_b() + { +- return 9; ++ return renderType; + } + + public int func_149745_a(Random p_149745_1_) +@@ -193,6 +194,111 @@ + } + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Return true if the rail can make corners. ++ * Used by placement logic. ++ * @param world The world. ++ * @param x The rail X coordinate. ++ * @param y The rail Y coordinate. ++ * @param z The rail Z coordinate. ++ * @return True if the rail can make corners. ++ */ ++ public boolean isFlexibleRail(IBlockAccess world, int y, int x, int z) ++ { ++ return !func_150050_e(); ++ } ++ ++ /** ++ * Returns true if the rail can make up and down slopes. ++ * Used by placement logic. ++ * @param world The world. ++ * @param x The rail X coordinate. ++ * @param y The rail Y coordinate. ++ * @param z The rail Z coordinate. ++ * @return True if the rail can make slopes. ++ */ ++ public boolean canMakeSlopes(IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ /** ++ * Return the rail's metadata (without the power bit if the rail uses one). ++ * Can be used to make the cart think the rail something other than it is, ++ * for example when making diamond junctions or switches. ++ * The cart parameter will often be null unless it it called from EntityMinecart. ++ * ++ * Valid rail metadata is defined as follows: ++ * 0x0: flat track going North-South ++ * 0x1: flat track going West-East ++ * 0x2: track ascending to the East ++ * 0x3: track ascending to the West ++ * 0x4: track ascending to the North ++ * 0x5: track ascending to the South ++ * 0x6: WestNorth corner (connecting East and South) ++ * 0x7: EastNorth corner (connecting West and South) ++ * 0x8: EastSouth corner (connecting West and North) ++ * 0x9: WestSouth corner (connecting East and North) ++ * ++ * @param world The world. ++ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart. ++ * @param y The rail X coordinate. ++ * @param x The rail Y coordinate. ++ * @param z The rail Z coordinate. ++ * @return The metadata. ++ */ ++ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int x, int y, int z) ++ { ++ int meta = world.func_72805_g(x, y, z); ++ if(func_150050_e()) ++ { ++ meta = meta & 7; ++ } ++ return meta; ++ } ++ ++ /** ++ * Returns the max speed of the rail at the specified position. ++ * @param world The world. ++ * @param cart The cart on the rail, may be null. ++ * @param x The rail X coordinate. ++ * @param y The rail Y coordinate. ++ * @param z The rail Z coordinate. ++ * @return The max speed of the current rail. ++ */ ++ public float getRailMaxSpeed(World world, EntityMinecart cart, int y, int x, int z) ++ { ++ return 0.4f; ++ } ++ ++ /** ++ * This function is called by any minecart that passes over this rail. ++ * It is called once per update tick that the minecart is on the rail. ++ * @param world The world. ++ * @param cart The cart on the rail. ++ * @param y The rail X coordinate. ++ * @param x The rail Y coordinate. ++ * @param z The rail Z coordinate. ++ */ ++ public void onMinecartPass(World world, EntityMinecart cart, int y, int x, int z) ++ { ++ } ++ ++ /** ++ * Forge: Moved render type to a field and a setter. ++ * This allows for a mod to change the render type ++ * for vanilla rails, and any mod rails that extend ++ * this class. ++ */ ++ private int renderType = 9; ++ ++ public void setRenderType(int value) ++ { ++ renderType = value; ++ } ++ /* ======================================== FORGE END =====================================*/ ++ + public class Rail + { + private World field_150660_b; +@@ -202,6 +308,7 @@ + private final boolean field_150656_f; + private List field_150657_g = new ArrayList(); + private static final String __OBFID = "CL_00000196"; ++ private final boolean canMakeSlopes; + + public Rail(World p_i45388_2_, int p_i45388_3_, int p_i45388_4_, int p_i45388_5_) + { +@@ -209,19 +316,10 @@ + this.field_150661_c = p_i45388_3_; + this.field_150658_d = p_i45388_4_; + this.field_150659_e = p_i45388_5_; +- Block block = p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); +- int l = p_i45388_2_.func_72805_g(p_i45388_3_, p_i45388_4_, p_i45388_5_); +- +- if (((BlockRailBase)block).field_150053_a) +- { +- this.field_150656_f = true; +- l &= -9; +- } +- else +- { +- this.field_150656_f = false; +- } +- ++ BlockRailBase block = (BlockRailBase)p_i45388_2_.func_147439_a(p_i45388_3_, p_i45388_4_, p_i45388_5_); ++ int l = block.getBasicRailMetadata(p_i45388_2_, null, p_i45388_3_, p_i45388_4_, p_i45388_5_); ++ this.field_150656_f = !block.isFlexibleRail(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); ++ canMakeSlopes = block.canMakeSlopes(p_i45388_2_, p_i45388_3_, p_i45388_4_, p_i45388_5_); + this.func_150648_a(l); + } + +@@ -412,7 +510,7 @@ + } + } + +- if (b0 == 0) ++ if (b0 == 0 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) + { +@@ -425,7 +523,7 @@ + } + } + +- if (b0 == 1) ++ if (b0 == 1 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) + { +@@ -570,7 +668,7 @@ + } + } + +- if (b0 == 0) ++ if (b0 == 0 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c, this.field_150658_d + 1, this.field_150659_e - 1)) + { +@@ -583,7 +681,7 @@ + } + } + +- if (b0 == 1) ++ if (b0 == 1 && canMakeSlopes) + { + if (BlockRailBase.func_150049_b_(this.field_150660_b, this.field_150661_c + 1, this.field_150658_d + 1, this.field_150659_e)) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneComparator.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneComparator.java.patch new file mode 100644 index 0000000..706b86c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneComparator.java.patch @@ -0,0 +1,22 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneComparator.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneComparator.java +@@ -228,4 +228,19 @@ + { + return new TileEntityComparator(); + } ++ ++ @Override ++ public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) ++ { ++ if (y == tileY && world instanceof World) ++ { ++ func_149695_a((World)world, x, y, z, world.func_147439_a(tileX, tileY, tileZ)); ++ } ++ } ++ ++ @Override ++ public boolean getWeakChanges(IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneOre.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneOre.java.patch new file mode 100644 index 0000000..b9f957d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneOre.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneOre.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneOre.java +@@ -10,6 +10,7 @@ + import net.minecraft.init.Items; + import net.minecraft.item.Item; + import net.minecraft.item.ItemStack; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + + public class BlockRedstoneOre extends Block +@@ -88,12 +89,17 @@ + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); ++ } + +- if (this.func_149650_a(p_149690_5_, p_149690_1_.field_73012_v, p_149690_7_) != Item.func_150898_a(this)) ++ private Random rand = new Random(); ++ @Override // World, meta, fortune ++ public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_) ++ { ++ if (this.func_149650_a(p_149690_5_, rand, p_149690_7_) != Item.func_150898_a(this)) + { +- int j1 = 1 + p_149690_1_.field_73012_v.nextInt(5); +- this.func_149657_c(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, j1); ++ return 1 + rand.nextInt(5); + } ++ return 0; + } + + @SideOnly(Side.CLIENT) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneWire.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneWire.java.patch new file mode 100644 index 0000000..dc64874 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneWire.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneWire.java ++++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneWire.java +@@ -405,7 +405,7 @@ + } + else if (!Blocks.field_150413_aR.func_149907_e(block)) + { +- return block.func_149744_f() && p_150174_4_ != -1; ++ return block.canConnectRedstone(p_150174_0_, p_150174_1_, p_150174_2_, p_150174_3_, p_150174_4_); + } + else + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockReed.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockReed.java.patch new file mode 100644 index 0000000..0b6296a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockReed.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockReed.java ++++ ../src-work/minecraft/net/minecraft/block/BlockReed.java +@@ -11,7 +11,11 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + +-public class BlockReed extends Block ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.util.ForgeDirection; ++import net.minecraftforge.common.IPlantable; ++ ++public class BlockReed extends Block implements IPlantable + { + private static final String __OBFID = "CL_00000300"; + +@@ -57,7 +61,7 @@ + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { + Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block == this ? true : (block != Blocks.field_150349_c && block != Blocks.field_150346_d && block != Blocks.field_150354_m ? false : (p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_ - 1, p_149742_4_).func_149688_o() == Material.field_151586_h ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ - 1).func_149688_o() == Material.field_151586_h ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_ + 1).func_149688_o() == Material.field_151586_h)))); ++ return block.canSustainPlant(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_, ForgeDirection.UP, this); + } + + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -120,4 +124,22 @@ + { + return p_149720_1_.func_72807_a(p_149720_2_, p_149720_4_).func_150558_b(p_149720_2_, p_149720_3_, p_149720_4_); + } ++ ++ @Override ++ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) ++ { ++ return EnumPlantType.Beach; ++ } ++ ++ @Override ++ public Block getPlant(IBlockAccess world, int x, int y, int z) ++ { ++ return this; ++ } ++ ++ @Override ++ public int getPlantMetadata(IBlockAccess world, int x, int y, int z) ++ { ++ return world.func_72805_g(x, y, z); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSapling.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSapling.java.patch new file mode 100644 index 0000000..0a382e1 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSapling.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockSapling.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSapling.java +@@ -71,6 +71,7 @@ + + public void func_149878_d(World p_149878_1_, int p_149878_2_, int p_149878_3_, int p_149878_4_, Random p_149878_5_) + { ++ if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(p_149878_1_, p_149878_5_, p_149878_2_, p_149878_3_, p_149878_4_)) return; + int l = p_149878_1_.func_72805_g(p_149878_2_, p_149878_3_, p_149878_4_) & 7; + Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + int i1 = 0; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSkull.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSkull.java.patch new file mode 100644 index 0000000..2eeaf02 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSkull.java.patch @@ -0,0 +1,63 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockSkull.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSkull.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Iterator; + import java.util.Random; + import net.minecraft.block.material.Material; +@@ -109,8 +110,6 @@ + return p_149692_1_; + } + +- public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {} +- + public void func_149681_a(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) + { + if (p_149681_6_.field_71075_bZ.field_75098_d) +@@ -118,19 +117,28 @@ + p_149681_5_ |= 8; + p_149681_1_.func_72921_c(p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 4); + } ++ this.func_149697_b(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); + + super.func_149681_a(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + public void func_149749_a(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { +- if (!p_149749_1_.field_72995_K) ++ super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); ++ } ++ ++ @Override ++ public ArrayList getDrops(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, int p_149749_6_, int fortune) ++ { ++ ArrayList ret = new ArrayList(); + { + if ((p_149749_6_ & 8) == 0) + { + ItemStack itemstack = new ItemStack(Items.field_151144_bL, 1, this.func_149643_k(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_)); + TileEntitySkull tileentityskull = (TileEntitySkull)p_149749_1_.func_147438_o(p_149749_2_, p_149749_3_, p_149749_4_); + ++ if (tileentityskull == null) return ret; ++ + if (tileentityskull.func_145904_a() == 3 && tileentityskull.func_152108_a() != null) + { + itemstack.func_77982_d(new NBTTagCompound()); +@@ -139,11 +147,10 @@ + itemstack.func_77978_p().func_74782_a("SkullOwner", nbttagcompound); + } + +- this.func_149642_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, itemstack); ++ ret.add(itemstack); + } +- +- super.func_149749_a(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } ++ return ret; + } + + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSnow.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSnow.java.patch new file mode 100644 index 0000000..759c69a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSnow.java.patch @@ -0,0 +1,82 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockSnow.java ++++ ../src-work/minecraft/net/minecraft/block/BlockSnow.java +@@ -73,7 +73,7 @@ + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { + Block block = p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_ - 1, p_149742_4_); +- return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.func_149688_o() == Material.field_151584_j ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; ++ return block != Blocks.field_150432_aD && block != Blocks.field_150403_cj ? (block.isLeaves(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_) ? true : (block == this && (p_149742_1_.func_72805_g(p_149742_2_, p_149742_3_ - 1, p_149742_4_) & 7) == 7 ? true : block.func_149662_c() && block.field_149764_J.func_76230_c())) : false; + } + + public void func_149695_a(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) +@@ -85,7 +85,6 @@ + { + if (!this.func_149742_c(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) + { +- this.func_149697_b(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_, p_150155_1_.func_72805_g(p_150155_2_, p_150155_3_, p_150155_4_), 0); + p_150155_1_.func_147468_f(p_150155_2_, p_150155_3_, p_150155_4_); + return false; + } +@@ -97,10 +96,8 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + { +- int i1 = p_149636_6_ & 7; +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Items.field_151126_ay, i1 + 1, 0)); ++ super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + p_149636_1_.func_147468_f(p_149636_3_, p_149636_4_, p_149636_5_); +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); + } + + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) +@@ -110,14 +107,13 @@ + + public int func_149745_a(Random p_149745_1_) + { +- return 0; ++ return 1; + } + + public void func_149674_a(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + { + if (p_149674_1_.func_72972_b(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) + { +- this.func_149697_b(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_1_.func_72805_g(p_149674_2_, p_149674_3_, p_149674_4_), 0); + p_149674_1_.func_147468_f(p_149674_2_, p_149674_3_, p_149674_4_); + } + } +@@ -127,4 +123,34 @@ + { + return p_149646_5_ == 1 ? true : super.func_149646_a(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_); + } ++ ++ /** ++ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand) ++ * version in 1.1. ++ * ++ * @param meta Blocks Metadata ++ * @param fortune Current item fortune level ++ * @param random Random number generator ++ * @return The number of items to drop ++ */ ++ public int quantityDropped(int meta, int fortune, Random random) ++ { ++ return (meta & 7) + 1; ++ } ++ ++ /** ++ * Determines if a new block can be replace the space occupied by this one, ++ * Used in the player's placement code to make the block act like water, and lava. ++ * ++ * @param world The current world ++ * @param x X Position ++ * @param y Y position ++ * @param z Z position ++ * @return True if the block is replaceable by another block ++ */ ++ public boolean isReplaceable(IBlockAccess world, int x, int y, int z) ++ { ++ int meta = world.func_72805_g(x, y, z); ++ return meta >= 7 ? false : field_149764_J.func_76222_j(); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockStem.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockStem.java.patch new file mode 100644 index 0000000..2bafd66 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockStem.java.patch @@ -0,0 +1,79 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockStem.java ++++ ../src-work/minecraft/net/minecraft/block/BlockStem.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.client.renderer.texture.IIconRegister; +@@ -14,6 +15,7 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import static net.minecraftforge.common.util.ForgeDirection.*; + + public class BlockStem extends BlockBush implements IGrowable + { +@@ -101,7 +103,7 @@ + + Block block = p_149674_1_.func_147439_a(j1, p_149674_3_ - 1, k1); + +- if (p_149674_1_.func_147439_a(j1, p_149674_3_, k1).field_149764_J == Material.field_151579_a && (block == Blocks.field_150458_ak || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) ++ if (p_149674_1_.func_147437_c(j1, p_149674_3_, k1) && (block.canSustainPlant(p_149674_1_, j1, p_149674_3_ - 1, k1, UP, this) || block == Blocks.field_150346_d || block == Blocks.field_150349_c)) + { + p_149674_1_.func_147449_b(j1, p_149674_3_, k1, this.field_149877_a); + } +@@ -144,11 +146,11 @@ + Block block8 = p_149875_1_.func_147439_a(l, p_149875_3_ - 1, i1); + float f1 = 0.0F; + +- if (block8 == Blocks.field_150458_ak) ++ if (block8.canSustainPlant(p_149875_1_, l, p_149875_3_ - 1, i1, UP, this)) + { + f1 = 1.0F; + +- if (p_149875_1_.func_72805_g(l, p_149875_3_ - 1, i1) > 0) ++ if (block8.isFertile(p_149875_1_, l, p_149875_3_ - 1, i1)) + { + f1 = 3.0F; + } +@@ -211,11 +213,12 @@ + return l < 7 ? -1 : (p_149873_1_.func_147439_a(p_149873_2_ - 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 0 : (p_149873_1_.func_147439_a(p_149873_2_ + 1, p_149873_3_, p_149873_4_) == this.field_149877_a ? 1 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ - 1) == this.field_149877_a ? 2 : (p_149873_1_.func_147439_a(p_149873_2_, p_149873_3_, p_149873_4_ + 1) == this.field_149877_a ? 3 : -1)))); + } + ++ @SuppressWarnings("unused") + public void func_149690_a(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + super.func_149690_a(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_); + +- if (!p_149690_1_.field_72995_K) ++ if (false && !p_149690_1_.field_72995_K) + { + Item item = null; + +@@ -282,4 +285,23 @@ + { + this.func_149874_m(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_); + } ++ ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ ++ Item item = null; ++ item = field_149877_a == Blocks.field_150423_aK ? Items.field_151080_bb : item; ++ item = field_149877_a == Blocks.field_150440_ba ? Items.field_151081_bc : item; ++ ++ for (int i = 0; item != null && i < 3; i++) ++ { ++ if (world.field_73012_v.nextInt(15) <= meta) ++ ret.add(new ItemStack(item)); ++ } ++ ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTallGrass.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTallGrass.java.patch new file mode 100644 index 0000000..4874336 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTallGrass.java.patch @@ -0,0 +1,83 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockTallGrass.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTallGrass.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.List; + import java.util.Random; + import net.minecraft.block.material.Material; +@@ -17,8 +18,10 @@ + import net.minecraft.world.ColorizerGrass; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.IShearable; + +-public class BlockTallGrass extends BlockBush implements IGrowable ++public class BlockTallGrass extends BlockBush implements IGrowable, IShearable + { + private static final String[] field_149871_a = new String[] {"deadbush", "tallgrass", "fern"}; + @SideOnly(Side.CLIENT) +@@ -53,7 +56,7 @@ + + public boolean func_149718_j(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { +- return this.func_149854_a(p_149718_1_.func_147439_a(p_149718_2_, p_149718_3_ - 1, p_149718_4_)); ++ return super.func_149718_j(p_149718_1_, p_149718_2_, p_149718_3_, p_149718_4_); + } + + @SideOnly(Side.CLIENT) +@@ -71,7 +74,7 @@ + + public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { +- return p_149650_2_.nextInt(8) == 0 ? Items.field_151014_N : null; ++ return null; + } + + public int func_149679_a(int p_149679_1_, Random p_149679_2_) +@@ -81,13 +84,7 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + { +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) + { +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150329_H, 1, p_149636_6_)); +- } +- else +- { + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } +@@ -143,4 +140,28 @@ + Blocks.field_150398_cm.func_149889_c(p_149853_1_, p_149853_3_, p_149853_4_, p_149853_5_, b0, 2); + } + } ++ ++ @Override ++ public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ if (world.field_73012_v.nextInt(8) != 0) return ret; ++ ItemStack seed = ForgeHooks.getGrassSeed(world); ++ if (seed != null) ret.add(seed); ++ return ret; ++ } ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ ret.add(new ItemStack(this, 1, world.func_72805_g(x, y, z))); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTorch.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTorch.java.patch new file mode 100644 index 0000000..046a08b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTorch.java.patch @@ -0,0 +1,108 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockTorch.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTorch.java +@@ -10,6 +10,7 @@ + import net.minecraft.util.MovingObjectPosition; + import net.minecraft.util.Vec3; + import net.minecraft.world.World; ++import static net.minecraftforge.common.util.ForgeDirection.*; + + public class BlockTorch extends Block + { +@@ -51,13 +52,17 @@ + else + { + Block block = p_150107_1_.func_147439_a(p_150107_2_, p_150107_3_, p_150107_4_); +- return block == Blocks.field_150422_aJ || block == Blocks.field_150386_bk || block == Blocks.field_150359_w || block == Blocks.field_150463_bK; ++ return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_); + } + } + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147445_c(p_149742_2_ - 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_ + 1, p_149742_3_, p_149742_4_, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ - 1, true) ? true : (p_149742_1_.func_147445_c(p_149742_2_, p_149742_3_, p_149742_4_ + 1, true) ? true : this.func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_)))); ++ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST, true) || ++ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST, true) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH, true) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH, true) || ++ func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_); + } + + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) +@@ -69,22 +74,22 @@ + j1 = 5; + } + +- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) ++ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) + { + j1 = 4; + } + +- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) ++ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) + { + j1 = 3; + } + +- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) ++ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) + { + j1 = 2; + } + +- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) ++ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) + { + j1 = 1; + } +@@ -106,19 +111,19 @@ + { + if (p_149726_1_.func_72805_g(p_149726_2_, p_149726_3_, p_149726_4_) == 0) + { +- if (p_149726_1_.func_147445_c(p_149726_2_ - 1, p_149726_3_, p_149726_4_, true)) ++ if (p_149726_1_.isSideSolid(p_149726_2_ - 1, p_149726_3_, p_149726_4_, EAST, true)) + { + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 1, 2); + } +- else if (p_149726_1_.func_147445_c(p_149726_2_ + 1, p_149726_3_, p_149726_4_, true)) ++ else if (p_149726_1_.isSideSolid(p_149726_2_ + 1, p_149726_3_, p_149726_4_, WEST, true)) + { + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 2, 2); + } +- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ - 1, true)) ++ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ - 1, SOUTH, true)) + { + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 3, 2); + } +- else if (p_149726_1_.func_147445_c(p_149726_2_, p_149726_3_, p_149726_4_ + 1, true)) ++ else if (p_149726_1_.isSideSolid(p_149726_2_, p_149726_3_, p_149726_4_ + 1, NORTH, true)) + { + p_149726_1_.func_72921_c(p_149726_2_, p_149726_3_, p_149726_4_, 4, 2); + } +@@ -143,22 +148,22 @@ + int l = p_150108_1_.func_72805_g(p_150108_2_, p_150108_3_, p_150108_4_); + boolean flag = false; + +- if (!p_150108_1_.func_147445_c(p_150108_2_ - 1, p_150108_3_, p_150108_4_, true) && l == 1) ++ if (!p_150108_1_.isSideSolid(p_150108_2_ - 1, p_150108_3_, p_150108_4_, EAST, true) && l == 1) + { + flag = true; + } + +- if (!p_150108_1_.func_147445_c(p_150108_2_ + 1, p_150108_3_, p_150108_4_, true) && l == 2) ++ if (!p_150108_1_.isSideSolid(p_150108_2_ + 1, p_150108_3_, p_150108_4_, WEST, true) && l == 2) + { + flag = true; + } + +- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ - 1, true) && l == 3) ++ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ - 1, SOUTH, true) && l == 3) + { + flag = true; + } + +- if (!p_150108_1_.func_147445_c(p_150108_2_, p_150108_3_, p_150108_4_ + 1, true) && l == 4) ++ if (!p_150108_1_.isSideSolid(p_150108_2_, p_150108_3_, p_150108_4_ + 1, NORTH, true) && l == 4) + { + flag = true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTrapDoor.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTrapDoor.java.patch new file mode 100644 index 0000000..764ccd8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTrapDoor.java.patch @@ -0,0 +1,49 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockTrapDoor.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTrapDoor.java +@@ -11,9 +11,12 @@ + import net.minecraft.util.Vec3; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class BlockTrapDoor extends Block + { ++ /** Set this to allow trapdoors to remain free-floating */ ++ public static boolean disableValidation = false; + private static final String __OBFID = "CL_00000327"; + + protected BlockTrapDoor(Material p_i45434_1_) +@@ -163,7 +166,7 @@ + --i1; + } + +- if (!func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1))) ++ if (!(func_150119_a(p_149695_1_.func_147439_a(i1, p_149695_3_, j1)) || p_149695_1_.isSideSolid(i1, p_149695_3_, j1, ForgeDirection.getOrientation((l & 3) + 2)))) + { + p_149695_1_.func_147468_f(p_149695_2_, p_149695_3_, p_149695_4_); + this.func_149697_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); +@@ -218,6 +221,7 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + { ++ if (disableValidation) return true; + if (p_149707_5_ == 0) + { + return false; +@@ -248,7 +252,7 @@ + --p_149707_2_; + } + +- return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)); ++ return func_150119_a(p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_)) || p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_, ForgeDirection.UP); + } + } + +@@ -259,6 +263,7 @@ + + private static boolean func_150119_a(Block p_150119_0_) + { ++ if (disableValidation) return true; + return p_150119_0_.field_149764_J.func_76218_k() && p_150119_0_.func_149686_d() || p_150119_0_ == Blocks.field_150426_aN || p_150119_0_ instanceof BlockSlab || p_150119_0_ instanceof BlockStairs; + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTripWireHook.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTripWireHook.java.patch new file mode 100644 index 0000000..d2686df --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTripWireHook.java.patch @@ -0,0 +1,96 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockTripWireHook.java ++++ ../src-work/minecraft/net/minecraft/block/BlockTripWireHook.java +@@ -9,6 +9,9 @@ + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; + ++import net.minecraftforge.common.util.ForgeDirection; ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + public class BlockTripWireHook extends Block + { + private static final String __OBFID = "CL_00000329"; +@@ -47,34 +50,41 @@ + + public boolean func_149707_d(World p_149707_1_, int p_149707_2_, int p_149707_3_, int p_149707_4_, int p_149707_5_) + { +- return p_149707_5_ == 2 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ + 1).func_149721_r() ? true : (p_149707_5_ == 3 && p_149707_1_.func_147439_a(p_149707_2_, p_149707_3_, p_149707_4_ - 1).func_149721_r() ? true : (p_149707_5_ == 4 && p_149707_1_.func_147439_a(p_149707_2_ + 1, p_149707_3_, p_149707_4_).func_149721_r() ? true : p_149707_5_ == 5 && p_149707_1_.func_147439_a(p_149707_2_ - 1, p_149707_3_, p_149707_4_).func_149721_r())); ++ ForgeDirection dir = ForgeDirection.getOrientation(p_149707_5_); ++ return (dir == NORTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ + 1, NORTH)) || ++ (dir == SOUTH && p_149707_1_.isSideSolid(p_149707_2_, p_149707_3_, p_149707_4_ - 1, SOUTH)) || ++ (dir == WEST && p_149707_1_.isSideSolid(p_149707_2_ + 1, p_149707_3_, p_149707_4_, WEST )) || ++ (dir == EAST && p_149707_1_.isSideSolid(p_149707_2_ - 1, p_149707_3_, p_149707_4_, EAST )); + } + + public boolean func_149742_c(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) + { +- return p_149742_1_.func_147439_a(p_149742_2_ - 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_ + 1, p_149742_3_, p_149742_4_).func_149721_r() ? true : (p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ - 1).func_149721_r() ? true : p_149742_1_.func_147439_a(p_149742_2_, p_149742_3_, p_149742_4_ + 1).func_149721_r())); ++ return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) || ++ p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) || ++ p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH); + } + + public int func_149660_a(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_) + { + byte b0 = 0; + +- if (p_149660_5_ == 2 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ + 1, true)) ++ if (p_149660_5_ == 2 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH, true)) + { + b0 = 2; + } + +- if (p_149660_5_ == 3 && p_149660_1_.func_147445_c(p_149660_2_, p_149660_3_, p_149660_4_ - 1, true)) ++ if (p_149660_5_ == 3 && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH, true)) + { + b0 = 0; + } + +- if (p_149660_5_ == 4 && p_149660_1_.func_147445_c(p_149660_2_ + 1, p_149660_3_, p_149660_4_, true)) ++ if (p_149660_5_ == 4 && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST, true)) + { + b0 = 1; + } + +- if (p_149660_5_ == 5 && p_149660_1_.func_147445_c(p_149660_2_ - 1, p_149660_3_, p_149660_4_, true)) ++ if (p_149660_5_ == 5 && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST, true)) + { + b0 = 3; + } +@@ -97,22 +107,22 @@ + int i1 = l & 3; + boolean flag = false; + +- if (!p_149695_1_.func_147439_a(p_149695_2_ - 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 3) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST) && i1 == 3) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_ + 1, p_149695_3_, p_149695_4_).func_149721_r() && i1 == 1) ++ if (!p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST) && i1 == 1) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ - 1).func_149721_r() && i1 == 0) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH) && i1 == 0) + { + flag = true; + } + +- if (!p_149695_1_.func_147439_a(p_149695_2_, p_149695_3_, p_149695_4_ + 1).func_149721_r() && i1 == 2) ++ if (!p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH) && i1 == 2) + { + flag = true; + } +@@ -133,7 +143,7 @@ + boolean flag3 = (p_150136_6_ & 8) == 8; + boolean flag4 = !p_150136_5_; + boolean flag5 = false; +- boolean flag6 = !World.func_147466_a(p_150136_1_, p_150136_2_, p_150136_3_ - 1, p_150136_4_); ++ boolean flag6 = !p_150136_1_.isSideSolid(p_150136_2_, p_150136_3_ - 1, p_150136_4_, UP); + int l1 = Direction.field_71583_a[k1]; + int i2 = Direction.field_71581_b[k1]; + int j2 = 0; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockVine.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockVine.java.patch new file mode 100644 index 0000000..8f92202 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockVine.java.patch @@ -0,0 +1,61 @@ +--- ../src-base/minecraft/net/minecraft/block/BlockVine.java ++++ ../src-work/minecraft/net/minecraft/block/BlockVine.java +@@ -2,9 +2,11 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; ++import net.minecraft.entity.EntityLivingBase; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.init.Items; +@@ -16,8 +18,10 @@ + import net.minecraft.world.ColorizerFoliage; + import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.IShearable; + +-public class BlockVine extends Block ++public class BlockVine extends Block implements IShearable + { + private static final String __OBFID = "CL_00000330"; + +@@ -375,14 +379,28 @@ + + public void func_149636_a(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) + { +- if (!p_149636_1_.field_72995_K && p_149636_2_.func_71045_bC() != null && p_149636_2_.func_71045_bC().func_77973_b() == Items.field_151097_aZ) + { +- p_149636_2_.func_71064_a(StatList.field_75934_C[Block.func_149682_b(this)], 1); +- this.func_149642_a(p_149636_1_, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Blocks.field_150395_bd, 1, 0)); +- } +- else +- { + super.func_149636_a(p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); + } + } ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ return true; ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ ret.add(new ItemStack(this, 1)); ++ return ret; ++ } ++ ++ @Override ++ public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/Minecraft.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/Minecraft.java.patch new file mode 100644 index 0000000..abbd9f7 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/Minecraft.java.patch @@ -0,0 +1,272 @@ +--- ../src-base/minecraft/net/minecraft/client/Minecraft.java ++++ ../src-work/minecraft/net/minecraft/client/Minecraft.java +@@ -276,7 +276,6 @@ + this.func_71389_H(); + this.field_71449_j = p_i1103_1_; + field_147123_G.info("Setting user: " + p_i1103_1_.func_111285_a()); +- field_147123_G.info("(Session ID is " + p_i1103_1_.func_111286_b() + ")"); + this.field_71459_aj = p_i1103_5_; + this.field_71443_c = p_i1103_2_; + this.field_71440_d = p_i1103_3_; +@@ -430,7 +429,7 @@ + + try + { +- Display.create((new PixelFormat()).withDepthBits(24)); ++ net.minecraftforge.client.ForgeHooksClient.createDisplay(); + } + catch (LWJGLException lwjglexception) + { +@@ -552,7 +551,7 @@ + cpw.mods.fml.common.ProgressManager.pop(bar); + FMLClientHandler.instance().finishMinecraftLoading(); + this.func_71361_d("Post startup"); +- this.field_71456_v = new GuiIngame(this); ++ this.field_71456_v = new net.minecraftforge.client.GuiIngameForge(this); + + if (this.field_71475_ae != null) + { +@@ -772,11 +771,6 @@ + + public void func_147108_a(GuiScreen p_147108_1_) + { +- if (this.field_71462_r != null) +- { +- this.field_71462_r.func_146281_b(); +- } +- + if (p_147108_1_ == null && this.field_71441_e == null) + { + p_147108_1_ = new GuiMainMenu(); +@@ -786,6 +780,17 @@ + p_147108_1_ = new GuiGameOver(); + } + ++ GuiScreen old = this.field_71462_r; ++ net.minecraftforge.client.event.GuiOpenEvent event = new net.minecraftforge.client.event.GuiOpenEvent(p_147108_1_); ++ ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; ++ ++ p_147108_1_ = event.gui; ++ if (old != null && p_147108_1_ != old) ++ { ++ old.func_146281_b(); ++ } ++ + if (p_147108_1_ instanceof GuiMainMenu) + { + this.field_71474_y.field_74330_P = false; +@@ -1353,7 +1358,7 @@ + + if (this.field_71439_g.func_82246_f(i, j, k)) + { +- this.field_71452_i.func_78867_a(i, j, k, this.field_71476_x.field_72310_e); ++ this.field_71452_i.addBlockHitEffects(i, j, k, this.field_71476_x); + this.field_71439_g.func_71038_i(); + } + } +@@ -1434,11 +1439,12 @@ + int j = this.field_71476_x.field_72312_c; + int k = this.field_71476_x.field_72309_d; + +- if (this.field_71441_e.func_147439_a(i, j, k).func_149688_o() != Material.field_151579_a) ++ if (!this.field_71441_e.func_147439_a(i, j, k).isAir(field_71441_e, i, j, k)) + { + int l = itemstack != null ? itemstack.field_77994_a : 0; + +- if (this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f)) ++ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, i, j, k, this.field_71476_x.field_72310_e, this.field_71441_e).isCanceled(); ++ if (result && this.field_71442_b.func_78760_a(this.field_71439_g, this.field_71441_e, itemstack, i, j, k, this.field_71476_x.field_72310_e, this.field_71476_x.field_72307_f)) + { + flag = false; + this.field_71439_g.func_71038_i(); +@@ -1465,7 +1471,8 @@ + { + ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g(); + +- if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) ++ boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, this.field_71441_e).isCanceled(); ++ if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1)) + { + this.field_71460_t.field_78516_c.func_78445_c(); + } +@@ -1677,6 +1684,8 @@ + + while (Mouse.next()) + { ++ if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue; ++ + j = Mouse.getEventButton(); + KeyBinding.func_74510_a(j - 100, Mouse.getEventButtonState()); + +@@ -2139,6 +2148,11 @@ + + public void func_71353_a(WorldClient p_71353_1_, String p_71353_2_) + { ++ if (field_71441_e != null) ++ { ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(field_71441_e)); ++ } ++ + if (p_71353_1_ == null) + { + NetHandlerPlayClient nethandlerplayclient = this.func_147114_u(); +@@ -2151,6 +2165,18 @@ + if (this.field_71437_Z != null) + { + this.field_71437_Z.func_71263_m(); ++ if (field_71461_s != null) ++ { ++ 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; +@@ -2299,113 +2325,10 @@ + if (this.field_71476_x != null) + { + boolean flag = this.field_71439_g.field_71075_bZ.field_75098_d; +- int i = 0; +- boolean flag1 = false; +- Item item; + int j; + +- if (this.field_71476_x.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) +- { +- j = this.field_71476_x.field_72311_b; +- int k = this.field_71476_x.field_72312_c; +- int l = this.field_71476_x.field_72309_d; +- Block block = this.field_71441_e.func_147439_a(j, k, l); +- +- if (block.func_149688_o() == Material.field_151579_a) +- { +- return; +- } +- +- item = block.func_149694_d(this.field_71441_e, j, k, l); +- +- if (item == null) +- { +- return; +- } +- +- flag1 = item.func_77614_k(); +- Block block1 = item instanceof ItemBlock && !block.func_149648_K() ? Block.func_149634_a(item) : block; +- i = block1.func_149643_k(this.field_71441_e, j, k, l); +- } +- else +- { +- if (this.field_71476_x.field_72313_a != MovingObjectPosition.MovingObjectType.ENTITY || this.field_71476_x.field_72308_g == null || !flag) +- { +- return; +- } +- +- if (this.field_71476_x.field_72308_g instanceof EntityPainting) +- { +- item = Items.field_151159_an; +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityLeashKnot) +- { +- item = Items.field_151058_ca; +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityItemFrame) +- { +- EntityItemFrame entityitemframe = (EntityItemFrame)this.field_71476_x.field_72308_g; +- ItemStack itemstack = entityitemframe.func_82335_i(); +- +- if (itemstack == null) +- { +- item = Items.field_151160_bD; +- } +- else +- { +- item = itemstack.func_77973_b(); +- i = itemstack.func_77960_j(); +- flag1 = true; +- } +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityMinecart) +- { +- EntityMinecart entityminecart = (EntityMinecart)this.field_71476_x.field_72308_g; +- +- if (entityminecart.func_94087_l() == 2) +- { +- item = Items.field_151109_aJ; +- } +- else if (entityminecart.func_94087_l() == 1) +- { +- item = Items.field_151108_aI; +- } +- else if (entityminecart.func_94087_l() == 3) +- { +- item = Items.field_151142_bV; +- } +- else if (entityminecart.func_94087_l() == 5) +- { +- item = Items.field_151140_bW; +- } +- else if (entityminecart.func_94087_l() == 6) +- { +- item = Items.field_151095_cc; +- } +- else +- { +- item = Items.field_151143_au; +- } +- } +- else if (this.field_71476_x.field_72308_g instanceof EntityBoat) +- { +- item = Items.field_151124_az; +- } +- else +- { +- item = Items.field_151063_bx; +- i = EntityList.func_75619_a(this.field_71476_x.field_72308_g); +- flag1 = true; +- +- if (i <= 0 || !EntityList.field_75627_a.containsKey(Integer.valueOf(i))) +- { +- return; +- } +- } +- } +- +- this.field_71439_g.field_71071_by.func_146030_a(item, i, flag1, flag); +- ++ if (!net.minecraftforge.common.ForgeHooks.onPickBlock(this.field_71476_x, this.field_71439_g, this.field_71441_e)) return; ++ // We delete this code wholly instead of commenting it out, to make sure we detect changes in it between MC versions + if (flag) + { + j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + this.field_71439_g.field_71071_by.field_70461_c; +@@ -2671,8 +2594,15 @@ + p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N())); + } + ++ //Forge: Adds a optimization to the getGLMaximumTextureSize, only calculate it once. ++ private static int max_texture_size = -1; + public static int func_71369_N() + { ++ if (max_texture_size != -1) ++ { ++ return max_texture_size; ++ } ++ + for (int i = 16384; i > 0; i >>= 1) + { + GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, i, i, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); +@@ -2680,6 +2610,7 @@ + + if (j != 0) + { ++ max_texture_size = i; + return i; + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/audio/SoundManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/audio/SoundManager.java.patch new file mode 100644 index 0000000..6265a0c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/audio/SoundManager.java.patch @@ -0,0 +1,52 @@ +--- ../src-base/minecraft/net/minecraft/client/audio/SoundManager.java ++++ ../src-work/minecraft/net/minecraft/client/audio/SoundManager.java +@@ -35,6 +35,10 @@ + import paulscode.sound.codecs.CodecJOrbis; + import paulscode.sound.libraries.LibraryLWJGLOpenAL; + ++import net.minecraftforge.client.*; ++import net.minecraftforge.client.event.sound.*; ++import net.minecraftforge.common.MinecraftForge; ++ + @SideOnly(Side.CLIENT) + public class SoundManager + { +@@ -69,6 +73,7 @@ + { + SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); + SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); ++ MinecraftForge.EVENT_BUS.post(new SoundSetupEvent(this)); + } + catch (SoundSystemException soundsystemexception) + { +@@ -80,6 +85,7 @@ + { + this.func_148613_b(); + this.func_148608_i(); ++ MinecraftForge.EVENT_BUS.post(new SoundLoadEvent(this)); + } + + private synchronized void func_148608_i() +@@ -302,6 +308,9 @@ + } + else + { ++ p_148611_1_ = ForgeHooksClient.playSound(this, p_148611_1_); ++ if (p_148611_1_ == null) return; ++ + SoundEventAccessorComposite soundeventaccessorcomposite = this.field_148622_c.func_147680_a(p_148611_1_.func_147650_b()); + + if (soundeventaccessorcomposite == null) +@@ -343,10 +352,12 @@ + if (soundpoolentry.func_148648_d()) + { + this.field_148620_e.newStreamingSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); ++ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, p_148611_1_, s)); + } + else + { + this.field_148620_e.newSource(false, s, func_148612_a(resourcelocation), resourcelocation.toString(), flag, p_148611_1_.func_147649_g(), p_148611_1_.func_147654_h(), p_148611_1_.func_147651_i(), p_148611_1_.func_147656_j().func_148586_a(), f1); ++ MinecraftForge.EVENT_BUS.post(new PlaySoundSourceEvent(this, p_148611_1_, s)); + } + + field_148621_b.debug(field_148623_a, "Playing sound {} for event {} as channel {}", new Object[] {soundpoolentry.func_148652_a(), soundeventaccessorcomposite.func_148729_c(), s}); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch new file mode 100644 index 0000000..ad795cf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java ++++ ../src-work/minecraft/net/minecraft/client/entity/EntityOtherPlayerMP.java +@@ -151,7 +151,8 @@ + } + } + +- public float func_70047_e() ++ @Override ++ public float getDefaultEyeHeight() + { + return 1.82F; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityPlayerSP.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityPlayerSP.java.patch new file mode 100644 index 0000000..694d608 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityPlayerSP.java.patch @@ -0,0 +1,85 @@ +--- ../src-base/minecraft/net/minecraft/client/entity/EntityPlayerSP.java ++++ ../src-work/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +@@ -50,6 +50,9 @@ + import net.minecraft.util.ResourceLocation; + import net.minecraft.util.Session; + import net.minecraft.world.World; ++import net.minecraftforge.client.ForgeHooksClient; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.PlaySoundAtEntityEvent; + + @SideOnly(Side.CLIENT) + public class EntityPlayerSP extends AbstractClientPlayer +@@ -325,7 +328,7 @@ + f *= 1.0F - f1 * 0.15F; + } + +- return f; ++ return ForgeHooksClient.getOffsetFOV(this, f); + } + + public void func_71053_j() +@@ -479,20 +482,45 @@ + return this.field_70170_p.func_147439_a(p_71153_1_, p_71153_2_, p_71153_3_).func_149721_r(); + } + ++ private boolean isHeadspaceFree(int x, int y, int z, int height) ++ { ++ for (int i1 = 0; i1 < height; i1++) ++ { ++ if (func_71153_f(x, y + i1, z + 1)) 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) ++ { ++ return false; ++ } + int i = MathHelper.func_76128_c(p_145771_1_); + int j = MathHelper.func_76128_c(p_145771_3_); + int k = MathHelper.func_76128_c(p_145771_5_); + double d3 = p_145771_1_ - (double)i; + double d4 = p_145771_5_ - (double)k; + +- if (this.func_71153_f(i, j, k) || this.func_71153_f(i, j + 1, k)) ++ int entHeight = Math.max(Math.round(this.field_70131_O), 1); ++ ++ boolean inTranslucentBlock = true; ++ ++ for (int i1 = 0; i1 < entHeight; i1++) + { +- boolean flag = !this.func_71153_f(i - 1, j, k) && !this.func_71153_f(i - 1, j + 1, k); +- boolean flag1 = !this.func_71153_f(i + 1, j, k) && !this.func_71153_f(i + 1, j + 1, k); +- boolean flag2 = !this.func_71153_f(i, j, k - 1) && !this.func_71153_f(i, j + 1, k - 1); +- boolean flag3 = !this.func_71153_f(i, j, k + 1) && !this.func_71153_f(i, j + 1, k + 1); ++ if (!this.func_71153_f(i, j + i1, k)) ++ { ++ inTranslucentBlock = false; ++ } ++ } ++ ++ if (inTranslucentBlock) ++ { ++ boolean flag = !isHeadspaceFree(i - 1, j, k, entHeight); ++ boolean flag1 = !isHeadspaceFree(i + 1, j, k, entHeight); ++ boolean flag2 = !isHeadspaceFree(i, j, k - 1, entHeight); ++ boolean flag3 = !isHeadspaceFree(i, j, k + 1, entHeight); + byte b0 = -1; + double d5 = 9999.0D; + +@@ -576,6 +604,12 @@ + + public void func_85030_a(String p_85030_1_, float p_85030_2_, float p_85030_3_) + { ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(this, p_85030_1_, p_85030_2_, p_85030_3_); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return; ++ } ++ p_85030_1_ = event.name; + this.field_70170_p.func_72980_b(this.field_70165_t, this.field_70163_u - (double)this.field_70129_M, this.field_70161_v, p_85030_1_, p_85030_2_, p_85030_3_, false); + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiChat.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiChat.java.patch new file mode 100644 index 0000000..f21e7fa --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiChat.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiChat.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiChat.java +@@ -138,6 +138,7 @@ + public void func_146403_a(String p_146403_1_) + { + this.field_146297_k.field_71456_v.func_146158_b().func_146239_a(p_146403_1_); ++ if (net.minecraftforge.client.ClientCommandHandler.instance.func_71556_a(field_146297_k.field_71439_g, p_146403_1_) != 0) return; + this.field_146297_k.field_71439_g.func_71165_d(p_146403_1_); + } + +@@ -330,13 +331,14 @@ + this.field_146297_k.field_71456_v.func_146158_b().func_146234_a(new ChatComponentText(stringbuilder.toString()), 1); + } + +- this.field_146415_a.func_146191_b((String)this.field_146412_t.get(this.field_146413_s++)); ++ this.field_146415_a.func_146191_b(EnumChatFormatting.func_110646_a((String)this.field_146412_t.get(this.field_146413_s++))); + } + + private void func_146405_a(String p_146405_1_, String p_146405_2_) + { + if (p_146405_1_.length() >= 1) + { ++ net.minecraftforge.client.ClientCommandHandler.instance.autoComplete(p_146405_1_, p_146405_2_); + this.field_146297_k.field_71439_g.field_71174_a.func_147297_a(new C14PacketTabComplete(p_146405_1_)); + this.field_146414_r = true; + } +@@ -458,6 +460,13 @@ + String[] astring1 = p_146406_1_; + int i = p_146406_1_.length; + ++ String[] complete = net.minecraftforge.client.ClientCommandHandler.instance.latestAutoComplete; ++ if (complete != null) ++ { ++ astring1 = com.google.common.collect.ObjectArrays.concat(complete, astring1, String.class); ++ i = astring1.length; ++ } ++ + for (int j = 0; j < i; ++j) + { + String s = astring1[j]; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiCreateWorld.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiCreateWorld.java.patch new file mode 100644 index 0000000..717664a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +@@ -320,7 +320,7 @@ + } + else if (p_146284_1_.field_146127_k == 8) + { +- this.field_146297_k.func_147108_a(new GuiCreateFlatWorld(this, this.field_146334_a)); ++ WorldType.field_77139_a[field_146331_K].onCustomizeButton(field_146297_k, this); + } + } + } +@@ -338,7 +338,7 @@ + this.field_146326_C.field_146125_m = this.field_146344_y; + this.field_146320_D.field_146125_m = this.field_146344_y; + this.field_146321_E.field_146125_m = this.field_146344_y; +- this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K] == WorldType.field_77138_c; ++ this.field_146322_F.field_146125_m = this.field_146344_y && WorldType.field_77139_a[this.field_146331_K].isCustomizable(); + + if (this.field_146344_y) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiIngameMenu.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiIngameMenu.java.patch new file mode 100644 index 0000000..4437d09 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiIngameMenu.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java +@@ -59,9 +59,11 @@ + 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 GuiAchievements(this, this.field_146297_k.field_71439_g.func_146107_m())); + 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: diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiMainMenu.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiMainMenu.java.patch new file mode 100644 index 0000000..43aaffc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java +@@ -25,6 +25,7 @@ + import net.minecraft.world.demo.DemoWorldServer; + import net.minecraft.world.storage.ISaveFormat; + import net.minecraft.world.storage.WorldInfo; ++import net.minecraftforge.client.ForgeHooksClient; + import org.apache.commons.io.Charsets; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -507,6 +508,7 @@ + this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215); + } + } ++ ForgeHooksClient.renderMainMenu(this, field_146289_q, field_146294_l, field_146295_m); + String s1 = "Copyright Mojang AB. Do not distribute!"; + this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1); + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiNewChat.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiNewChat.java.patch new file mode 100644 index 0000000..25cd758 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiNewChat.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiNewChat.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiNewChat.java +@@ -99,6 +99,7 @@ + byte b0 = 0; + int j2 = -j1 * 9; + func_73734_a(b0, j2 - 9, b0 + i1 + 4, j2, i2 / 2 << 24); ++ GL11.glEnable(GL11.GL_BLEND); // FORGE: BugFix MC-36812 Chat Opacity Broken in 1.7.x + String s = chatline.func_151461_a().func_150254_d(); + this.field_146247_f.field_71466_p.func_78261_a(s, b0, j2 - 8, 16777215 + (i2 << 24)); + GL11.glDisable(GL11.GL_ALPHA_TEST); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiScreen.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiScreen.java.patch new file mode 100644 index 0000000..986a5b8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiScreen.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiScreen.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiScreen.java +@@ -17,6 +17,10 @@ + import net.minecraft.client.renderer.entity.RenderItem; + import net.minecraft.item.ItemStack; + import net.minecraft.util.EnumChatFormatting; ++import net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent; ++import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent; ++import net.minecraftforge.common.MinecraftForge; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.GL11; +@@ -111,7 +115,8 @@ + } + } + +- this.func_146283_a(list, p_146285_2_, p_146285_3_); ++ FontRenderer font = p_146285_1_.func_77973_b().getFontRenderer(p_146285_1_); ++ drawHoveringText(list, p_146285_2_, p_146285_3_, (font == null ? field_146289_q : font)); + } + + protected void func_146279_a(String p_146279_1_, int p_146279_2_, int p_146279_3_) +@@ -121,6 +126,11 @@ + + protected void func_146283_a(List p_146283_1_, int p_146283_2_, int p_146283_3_) + { ++ drawHoveringText(p_146283_1_, p_146283_2_, p_146283_3_, field_146289_q); ++ } ++ ++ protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font) ++ { + if (!p_146283_1_.isEmpty()) + { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); +@@ -133,7 +143,7 @@ + while (iterator.hasNext()) + { + String s = (String)iterator.next(); +- int l = this.field_146289_q.func_78256_a(s); ++ int l = font.func_78256_a(s); + + if (l > k) + { +@@ -178,7 +188,7 @@ + for (int i2 = 0; i2 < p_146283_1_.size(); ++i2) + { + String s1 = (String)p_146283_1_.get(i2); +- this.field_146289_q.func_78261_a(s1, j2, k2, -1); ++ font.func_78261_a(s1, j2, k2, -1); + + if (i2 == 0) + { +@@ -207,9 +217,14 @@ + + if (guibutton.func_146116_c(this.field_146297_k, p_73864_1_, p_73864_2_)) + { +- this.field_146290_a = guibutton; +- guibutton.func_146113_a(this.field_146297_k.func_147118_V()); +- this.func_146284_a(guibutton); ++ ActionPerformedEvent.Pre event = new ActionPerformedEvent.Pre(this, guibutton, this.field_146292_n); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ break; ++ this.field_146290_a = event.button; ++ event.button.func_146113_a(this.field_146297_k.func_147118_V()); ++ this.func_146284_a(event.button); ++ if (this.equals(this.field_146297_k.field_71462_r)) ++ MinecraftForge.EVENT_BUS.post(new ActionPerformedEvent.Post(this, event.button, this.field_146292_n)); + } + } + } +@@ -234,8 +249,12 @@ + this.field_146289_q = p_146280_1_.field_71466_p; + this.field_146294_l = p_146280_2_; + this.field_146295_m = p_146280_3_; +- this.field_146292_n.clear(); +- this.func_73866_w_(); ++ if (!MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Pre(this, this.field_146292_n))) ++ { ++ this.field_146292_n.clear(); ++ this.func_73866_w_(); ++ } ++ MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Post(this, this.field_146292_n)); + } + + public void func_73866_w_() {} diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSleepMP.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSleepMP.java.patch new file mode 100644 index 0000000..8efe42e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSleepMP.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiSleepMP.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiSleepMP.java +@@ -33,7 +33,7 @@ + + if (!s.isEmpty()) + { +- this.field_146297_k.field_71439_g.func_71165_d(s); ++ this.func_146403_a(s); // Forge: fix vanilla not adding messages to the sent list while sleeping + } + + this.field_146415_a.func_146180_a(""); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSlot.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSlot.java.patch new file mode 100644 index 0000000..cdfaaa2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSlot.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiSlot.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiSlot.java +@@ -294,16 +294,7 @@ + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator tessellator = Tessellator.field_78398_a; +- this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- float f1 = 32.0F; +- tessellator.func_78382_b(); +- tessellator.func_78378_d(2105376); +- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); +- tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); +- tessellator.func_78381_a(); ++ drawContainerBackground(tessellator); + l1 = this.field_148152_e + this.field_148155_a / 2 - this.func_148139_c() / 2 + 2; + i2 = this.field_148153_b + 4 - (int)this.field_148169_q; + +@@ -475,4 +466,18 @@ + { + return this.field_148149_f; + } ++ ++ protected void drawContainerBackground(Tessellator tessellator) ++ { ++ this.field_148161_k.func_110434_K().func_110577_a(Gui.field_110325_k); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ float f1 = 32.0F; ++ tessellator.func_78382_b(); ++ tessellator.func_78378_d(2105376); ++ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148154_c, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148154_c + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148151_d, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148151_d / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); ++ tessellator.func_78374_a((double)this.field_148152_e, (double)this.field_148153_b, 0.0D, (double)((float)this.field_148152_e / f1), (double)((float)(this.field_148153_b + (int)this.field_148169_q) / f1)); ++ tessellator.func_78381_a(); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/achievement/GuiAchievements.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/achievement/GuiAchievements.java.patch new file mode 100644 index 0000000..9313947 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/achievement/GuiAchievements.java.patch @@ -0,0 +1,127 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java ++++ ../src-work/minecraft/net/minecraft/client/gui/achievement/GuiAchievements.java +@@ -24,6 +24,9 @@ + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; ++import java.util.LinkedList; ++import java.util.List; ++import net.minecraftforge.common.AchievementPage; + + @SideOnly(Side.CLIENT) + public class GuiAchievements extends GuiScreen implements IProgressMeter +@@ -50,6 +53,10 @@ + private boolean field_146558_F = true; + private static final String __OBFID = "CL_00000722"; + ++ private int currentPage = -1; ++ private GuiButton button; ++ private LinkedList minecraftAchievements = new LinkedList(); ++ + public GuiAchievements(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) + { + this.field_146562_a = p_i45026_1_; +@@ -58,6 +65,14 @@ + short short2 = 141; + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.field_76004_f.field_75993_a * 24 - short1 / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.field_76004_f.field_75991_b * 24 - short2 / 2); ++ minecraftAchievements.clear(); ++ for (Object achievement : AchievementList.field_76007_e) ++ { ++ if (!AchievementPage.isAchievementInPages((Achievement)achievement)) ++ { ++ minecraftAchievements.add((Achievement)achievement); ++ } ++ } + } + + public void func_73866_w_() +@@ -65,6 +80,7 @@ + this.field_146297_k.func_147114_u().func_147297_a(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.field_146292_n.clear(); + this.field_146292_n.add(new GuiOptionButton(1, this.field_146294_l / 2 + 24, this.field_146295_m / 2 + 74, 80, 20, I18n.func_135052_a("gui.done", new Object[0]))); ++ this.field_146292_n.add(button = new GuiButton(2, (field_146294_l - field_146555_f) / 2 + 24, field_146295_m / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); + } + + protected void func_146284_a(GuiButton p_146284_1_) +@@ -75,6 +91,16 @@ + { + this.field_146297_k.func_147108_a(this.field_146562_a); + } ++ ++ if (p_146284_1_.field_146127_k == 2) ++ { ++ currentPage++; ++ if (currentPage >= AchievementPage.getAchievementPages().size()) ++ { ++ currentPage = -1; ++ } ++ button.field_146126_j = AchievementPage.getTitle(currentPage); ++ } + } + } + +@@ -260,7 +286,9 @@ + GL11.glDepthFunc(GL11.GL_GEQUAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)k1, (float)l1, -200.0F); +- GL11.glScalef(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); ++ // FIXES models rendering weirdly in the acheivements pane ++ // see https://github.com/MinecraftForge/MinecraftForge/commit/1b7ce7592caafb760ec93066184182ae0711e793#commitcomment-10512284 ++ GL11.glScalef(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +@@ -339,11 +367,12 @@ + int j4; + int l4; + +- for (i3 = 0; i3 < AchievementList.field_76007_e.size(); ++i3) ++ List achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); ++ for (i3 = 0; i3 < achievementList.size(); ++i3) + { +- Achievement achievement1 = (Achievement)AchievementList.field_76007_e.get(i3); ++ Achievement achievement1 = achievementList.get(i3); + +- if (achievement1.field_75992_c != null) ++ if (achievement1.field_75992_c != null && achievementList.contains(achievement1.field_75992_c)) + { + j3 = achievement1.field_75993_a * 24 - k + 11; + k3 = achievement1.field_75991_b * 24 - l + 11; +@@ -400,9 +429,9 @@ + int i5; + int j5; + +- for (l4 = 0; l4 < AchievementList.field_76007_e.size(); ++l4) ++ for (l4 = 0; l4 < achievementList.size(); ++l4) + { +- Achievement achievement2 = (Achievement)AchievementList.field_76007_e.get(l4); ++ Achievement achievement2 = (Achievement)achievementList.get(l4); + i5 = achievement2.field_75993_a * 24 - k; + j5 = achievement2.field_75991_b * 24 - l; + +@@ -444,6 +473,7 @@ + + this.field_146297_k.func_110434_K().func_110577_a(field_146561_C); + ++ GL11.glEnable(GL11.GL_BLEND);// Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it. + if (achievement2.func_75984_f()) + { + this.func_73729_b(i5 - 2, j5 - 2, 26, 202, 26, 26); +@@ -452,6 +482,7 @@ + { + this.func_73729_b(i5 - 2, j5 - 2, 0, 202, 26, 26); + } ++ GL11.glDisable(GL11.GL_BLEND); //Forge: Cleanup states we set. + + if (!this.field_146556_E.func_77442_b(achievement2)) + { +@@ -460,7 +491,7 @@ + renderitem.field_77024_a = false; + } + +- GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure Lighting is disabled. Fixes MC-33065 + GL11.glEnable(GL11.GL_CULL_FACE); + renderitem.func_82406_b(this.field_146297_k.field_71466_p, this.field_146297_k.func_110434_K(), achievement2.field_75990_d, i5 + 3, j5 + 3); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainer.java.patch new file mode 100644 index 0000000..955cd84 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainer.java.patch @@ -0,0 +1,55 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +@@ -6,6 +6,7 @@ + import java.util.Iterator; + import java.util.Set; + import net.minecraft.client.Minecraft; ++import net.minecraft.client.gui.FontRenderer; + import net.minecraft.client.gui.GuiScreen; + import net.minecraft.client.renderer.OpenGlHelper; + import net.minecraft.client.renderer.RenderHelper; +@@ -112,7 +113,11 @@ + } + } + ++ //Forge: Force lighting to be disabled as there are some issue where lighting would ++ //incorrectly be applied based on items that are in the inventory. ++ GL11.glDisable(GL11.GL_LIGHTING); + this.func_146979_b(p_73863_1_, p_73863_2_); ++ GL11.glEnable(GL11.GL_LIGHTING); + InventoryPlayer inventoryplayer = this.field_146297_k.field_71439_g.field_71071_by; + ItemStack itemstack = this.field_147012_x == null ? inventoryplayer.func_70445_o() : this.field_147012_x; + +@@ -176,8 +181,11 @@ + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + this.field_73735_i = 200.0F; + field_146296_j.field_77023_b = 200.0F; +- field_146296_j.func_82406_b(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_); +- field_146296_j.func_94148_a(this.field_146289_q, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); ++ FontRenderer font = null; ++ if (p_146982_1_ != null) font = p_146982_1_.func_77973_b().getFontRenderer(p_146982_1_); ++ if (font == null) font = field_146289_q; ++ field_146296_j.func_82406_b(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_); ++ field_146296_j.func_94148_a(font, this.field_146297_k.func_110434_K(), p_146982_1_, p_146982_2_, p_146982_3_ - (this.field_147012_x == null ? 0 : 8), p_146982_4_); + this.field_73735_i = 0.0F; + field_146296_j.field_77023_b = 0.0F; + } +@@ -243,8 +251,10 @@ + if (iicon != null) + { + GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_BLEND); // Forge: Blending needs to be enabled for this. + this.field_146297_k.func_110434_K().func_110577_a(TextureMap.field_110576_c); + this.func_94065_a(i, j, iicon, 16, 16); ++ GL11.glDisable(GL11.GL_BLEND); // Forge: And clean that up + GL11.glEnable(GL11.GL_LIGHTING); + flag1 = true; + } +@@ -458,6 +468,7 @@ + + protected void func_146286_b(int p_146286_1_, int p_146286_2_, int p_146286_3_) + { ++ super.func_146286_b(p_146286_1_, p_146286_2_, p_146286_3_); //Forge, Call parent to release buttons + Slot slot = this.func_146975_c(p_146286_1_, p_146286_2_); + int l = this.field_147003_i; + int i1 = this.field_147009_r; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch new file mode 100644 index 0000000..6cd5a29 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch @@ -0,0 +1,277 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java ++++ ../src-work/minecraft/net/minecraft/client/gui/inventory/GuiContainerCreative.java +@@ -49,6 +49,8 @@ + private boolean field_147057_D; + private CreativeCrafting field_147059_E; + private static final String __OBFID = "CL_00000752"; ++ private static int tabPage = 0; ++ private int maxPages = 0; + + public GuiContainerCreative(EntityPlayer p_i1088_1_) + { +@@ -185,7 +187,7 @@ + return; + } + +- if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2)) ++ if (itemstack1 != null && itemstack2 != null && itemstack1.func_77969_a(itemstack2) && ItemStack.func_77970_a(itemstack1, itemstack2)) //Forge: Bugfix, Compare NBT data, allow for deletion of enchanted books, MC-12770 + { + if (p_146984_3_ == 0) + { +@@ -260,6 +262,13 @@ + this.func_147050_b(CreativeTabs.field_78032_a[i]); + this.field_147059_E = new CreativeCrafting(this.field_146297_k); + this.field_146297_k.field_71439_g.field_71069_bz.func_75132_a(this.field_147059_E); ++ int tabCount = CreativeTabs.field_78032_a.length; ++ if (tabCount > 12) ++ { ++ field_146292_n.add(new GuiButton(101, field_147003_i, field_147009_r - 50, 20, 20, "<")); ++ field_146292_n.add(new GuiButton(102, field_147003_i + field_146999_f - 20, field_147009_r - 50, 20, 20, ">")); ++ maxPages = ((tabCount - 12) / 10) + 1; ++ } + } + else + { +@@ -281,7 +290,7 @@ + + protected void func_73869_a(char p_73869_1_, int p_73869_2_) + { +- if (field_147058_w != CreativeTabs.field_78027_g.func_78021_a()) ++ if (!CreativeTabs.field_78032_a[field_147058_w].hasSearchBar()) + { + if (GameSettings.func_100015_a(this.field_146297_k.field_71474_y.field_74310_D)) + { +@@ -318,6 +327,15 @@ + { + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; + containercreative.field_148330_a.clear(); ++ ++ CreativeTabs tab = CreativeTabs.field_78032_a[field_147058_w]; ++ if (tab.hasSearchBar() && tab != CreativeTabs.field_78027_g) ++ { ++ tab.func_78018_a(containercreative.field_148330_a); ++ updateFilteredItems(containercreative); ++ return; ++ } ++ + Iterator iterator = Item.field_150901_e.iterator(); + + while (iterator.hasNext()) +@@ -329,10 +347,17 @@ + item.func_150895_a(item, (CreativeTabs)null, containercreative.field_148330_a); + } + } ++ updateFilteredItems(containercreative); ++ } + ++ //split from above for custom search tabs ++ private void updateFilteredItems(GuiContainerCreative.ContainerCreative containercreative) ++ { ++ Iterator iterator; + Enchantment[] aenchantment = Enchantment.field_77331_b; + int j = aenchantment.length; + ++ if (CreativeTabs.field_78032_a[field_147058_w] != CreativeTabs.field_78027_g) j = 0; //Forge: Don't add enchants to custom tabs. + for (int i = 0; i < j; ++i) + { + Enchantment enchantment = aenchantment[i]; +@@ -383,7 +408,7 @@ + { + CreativeTabs creativetabs = CreativeTabs.field_78032_a[field_147058_w]; + +- if (creativetabs.func_78019_g()) ++ if (creativetabs != null && creativetabs.func_78019_g()) + { + GL11.glDisable(GL11.GL_BLEND); + this.field_146289_q.func_78276_b(I18n.func_135052_a(creativetabs.func_78024_c(), new Object[0]), 8, 6, 4210752); +@@ -403,7 +428,7 @@ + { + CreativeTabs creativetabs = acreativetabs[k1]; + +- if (this.func_147049_a(creativetabs, l, i1)) ++ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) + { + return; + } +@@ -426,7 +451,7 @@ + { + CreativeTabs creativetabs = acreativetabs[k1]; + +- if (this.func_147049_a(creativetabs, l, i1)) ++ if (creativetabs != null && this.func_147049_a(creativetabs, l, i1)) + { + this.func_147050_b(creativetabs); + return; +@@ -439,11 +464,13 @@ + + private boolean func_147055_p() + { ++ if (CreativeTabs.field_78032_a[field_147058_w] == null) return false; + return field_147058_w != CreativeTabs.field_78036_m.func_78021_a() && CreativeTabs.field_78032_a[field_147058_w].func_78017_i() && ((GuiContainerCreative.ContainerCreative)this.field_147002_h).func_148328_e(); + } + + private void func_147050_b(CreativeTabs p_147050_1_) + { ++ if (p_147050_1_ == null) return; + int i = field_147058_w; + field_147058_w = p_147050_1_.func_78021_a(); + GuiContainerCreative.ContainerCreative containercreative = (GuiContainerCreative.ContainerCreative)this.field_147002_h; +@@ -512,12 +539,14 @@ + + if (this.field_147062_A != null) + { +- if (p_147050_1_ == CreativeTabs.field_78027_g) ++ if (p_147050_1_.hasSearchBar()) + { + this.field_147062_A.func_146189_e(true); + this.field_147062_A.func_146205_d(false); + this.field_147062_A.func_146195_b(true); + this.field_147062_A.func_146180_a(""); ++ this.field_147062_A.field_146218_h = p_147050_1_.getSearchbarWidth(); ++ this.field_147062_A.field_146209_f = this.field_147003_i + (82 /*default left*/ + 89 /*default width*/) - this.field_147062_A.field_146218_h; + this.func_147053_i(); + } + else +@@ -608,23 +637,45 @@ + + super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); + CreativeTabs[] acreativetabs = CreativeTabs.field_78032_a; +- int i2 = acreativetabs.length; ++ int start = tabPage * 10; ++ int i2 = Math.min(acreativetabs.length, ((tabPage + 1) * 10) + 2); ++ if (tabPage != 0) start += 2; ++ boolean rendered = false; + +- for (int j2 = 0; j2 < i2; ++j2) ++ for (int j2 = start; j2 < i2; ++j2) + { + CreativeTabs creativetabs = acreativetabs[j2]; + ++ if (creativetabs == null) continue; + if (this.func_147052_b(creativetabs, p_73863_1_, p_73863_2_)) + { ++ rendered = true; + break; + } + } + ++ if (!rendered && func_147052_b(CreativeTabs.field_78027_g, p_73863_1_, p_73863_2_)) ++ { ++ func_147052_b(CreativeTabs.field_78036_m, p_73863_1_, p_73863_2_); ++ } ++ + if (this.field_147064_C != null && field_147058_w == CreativeTabs.field_78036_m.func_78021_a() && this.func_146978_c(this.field_147064_C.field_75223_e, this.field_147064_C.field_75221_f, 16, 16, p_73863_1_, p_73863_2_)) + { + this.func_146279_a(I18n.func_135052_a("inventory.binSlot", new Object[0]), p_73863_1_, p_73863_2_); + } + ++ if (maxPages != 0) ++ { ++ String page = String.format("%d / %d", tabPage + 1, maxPages + 1); ++ int width = field_146289_q.func_78256_a(page); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ this.field_73735_i = 300.0F; ++ field_146296_j.field_77023_b = 300.0F; ++ field_146289_q.func_78276_b(page, field_147003_i + (field_146999_f / 2) - (width / 2), field_147009_r - 44, -1); ++ this.field_73735_i = 0.0F; ++ field_146296_j.field_77023_b = 0.0F; ++ } ++ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + } +@@ -693,17 +744,37 @@ + int k = acreativetabs.length; + int l; + +- for (l = 0; l < k; ++l) ++ int start = tabPage * 10; ++ k = Math.min(acreativetabs.length, ((tabPage + 1) * 10 + 2)); ++ if (tabPage != 0) start += 2; ++ ++ for (l = start; l < k; ++l) + { + CreativeTabs creativetabs1 = acreativetabs[l]; + this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); + ++ if (creativetabs1 == null) continue; ++ + if (creativetabs1.func_78021_a() != field_147058_w) + { + this.func_147051_a(creativetabs1); + } + } + ++ if (tabPage != 0) ++ { ++ if (creativetabs != CreativeTabs.field_78027_g) ++ { ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78027_g); ++ } ++ if (creativetabs != CreativeTabs.field_78036_m) ++ { ++ this.field_146297_k.func_110434_K().func_110577_a(field_147061_u); ++ func_147051_a(CreativeTabs.field_78036_m); ++ } ++ } ++ + this.field_146297_k.func_110434_K().func_110577_a(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + creativetabs.func_78015_f())); + this.func_73729_b(this.field_147003_i, this.field_147009_r, 0, 0, this.field_146999_f, this.field_147000_g); + this.field_147062_A.func_146194_f(); +@@ -718,6 +789,14 @@ + this.func_73729_b(i1, k + (int)((float)(l - k - 17) * this.field_147067_x), 232 + (this.func_147055_p() ? 0 : 12), 0, 12, 15); + } + ++ if (creativetabs == null || creativetabs.getTabPage() != tabPage) ++ { ++ if (creativetabs != CreativeTabs.field_78027_g && creativetabs != CreativeTabs.field_78036_m) ++ { ++ return; ++ } ++ } ++ + this.func_147051_a(creativetabs); + + if (creativetabs == CreativeTabs.field_78036_m) +@@ -728,6 +807,15 @@ + + protected boolean func_147049_a(CreativeTabs p_147049_1_, int p_147049_2_, int p_147049_3_) + { ++ if (p_147049_1_.getTabPage() != tabPage) ++ { ++ if (p_147049_1_ != CreativeTabs.field_78027_g && ++ p_147049_1_ != CreativeTabs.field_78036_m) ++ { ++ return false; ++ } ++ } ++ + int k = p_147049_1_.func_78020_k(); + int l = 28 * k; + byte b0 = 0; +@@ -828,6 +916,8 @@ + } + + GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glColor3f(1F, 1F, 1F); //Forge: Reset color in case Items change it. ++ GL11.glEnable(GL11.GL_BLEND); //Forge: Make sure blend is enabled else tabs show a white border. + this.func_73729_b(l, i1, j, k, 28, b0); + this.field_73735_i = 100.0F; + field_146296_j.field_77023_b = 100.0F; +@@ -854,6 +944,15 @@ + { + this.field_146297_k.func_147108_a(new GuiStats(this, this.field_146297_k.field_71439_g.func_146107_m())); + } ++ ++ if (p_146284_1_.field_146127_k == 101) ++ { ++ tabPage = Math.max(tabPage - 1, 0); ++ } ++ else if (p_146284_1_.field_146127_k == 102) ++ { ++ tabPage = Math.min(tabPage + 1, maxPages); ++ } + } + + public int func_147056_g() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBase.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBase.java.patch new file mode 100644 index 0000000..3a4d6c6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBase.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelBase.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBase.java +@@ -10,7 +10,6 @@ + import net.minecraft.entity.Entity; + import net.minecraft.entity.EntityLivingBase; + +-@SideOnly(Side.CLIENT) + public abstract class ModelBase + { + public float field_78095_p; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBox.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBox.java.patch new file mode 100644 index 0000000..436e212 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBox.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelBox.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelBox.java +@@ -4,7 +4,6 @@ + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.renderer.Tessellator; + +-@SideOnly(Side.CLIENT) + public class ModelBox + { + private PositionTextureVertex[] field_78253_h; +@@ -77,6 +76,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_78245_a(Tessellator p_78245_1_, float p_78245_2_) + { + for (int i = 0; i < this.field_78254_i.length; ++i) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelRenderer.java.patch new file mode 100644 index 0000000..86bde1f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelRenderer.java.patch @@ -0,0 +1,42 @@ +--- ../src-base/minecraft/net/minecraft/client/model/ModelRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/model/ModelRenderer.java +@@ -8,7 +8,6 @@ + import net.minecraft.client.renderer.Tessellator; + import org.lwjgl.opengl.GL11; + +-@SideOnly(Side.CLIENT) + public class ModelRenderer + { + public float field_78801_a; +@@ -102,6 +101,7 @@ + this.field_78798_e = p_78793_3_; + } + ++ @SideOnly(Side.CLIENT) + public void func_78785_a(float p_78785_1_) + { + if (!this.field_78807_k) +@@ -184,6 +184,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_78791_b(float p_78791_1_) + { + if (!this.field_78807_k) +@@ -219,6 +220,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + public void func_78794_c(float p_78794_1_) + { + if (!this.field_78807_k) +@@ -260,6 +262,7 @@ + } + } + ++ @SideOnly(Side.CLIENT) + private void func_78788_d(float p_78788_1_) + { + this.field_78811_r = GLAllocation.func_74526_a(1); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/PositionTextureVertex.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/PositionTextureVertex.java.patch new file mode 100644 index 0000000..8d92e8a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/PositionTextureVertex.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/client/model/PositionTextureVertex.java ++++ ../src-work/minecraft/net/minecraft/client/model/PositionTextureVertex.java +@@ -1,10 +1,7 @@ + package net.minecraft.client.model; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.util.Vec3; + +-@SideOnly(Side.CLIENT) + public class PositionTextureVertex + { + public Vec3 field_78243_a; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/TexturedQuad.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/TexturedQuad.java.patch new file mode 100644 index 0000000..c318d7e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/TexturedQuad.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/model/TexturedQuad.java ++++ ../src-work/minecraft/net/minecraft/client/model/TexturedQuad.java +@@ -1,11 +1,8 @@ + package net.minecraft.client.model; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.renderer.Tessellator; + import net.minecraft.util.Vec3; + +-@SideOnly(Side.CLIENT) + public class TexturedQuad + { + public PositionTextureVertex[] field_78239_a; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch new file mode 100644 index 0000000..d575e9c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/ChunkProviderClient.java +@@ -56,6 +56,7 @@ + Chunk chunk = new Chunk(this.field_73235_d, p_73158_1_, p_73158_2_); + this.field_73236_b.func_76163_a(ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_), chunk); + this.field_73237_c.add(chunk); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkEvent.Load(chunk)); + chunk.field_76636_d = true; + return chunk; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch new file mode 100644 index 0000000..aeca0ef --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch @@ -0,0 +1,85 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/PlayerControllerMP.java +@@ -28,6 +28,10 @@ + import net.minecraft.world.World; + import net.minecraft.world.WorldSettings; + ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; ++ + @SideOnly(Side.CLIENT) + public class PlayerControllerMP + { +@@ -88,6 +92,12 @@ + + public boolean func_78751_a(int p_78751_1_, int p_78751_2_, int p_78751_3_, int p_78751_4_) + { ++ ItemStack stack = field_78776_a.field_71439_g.func_71045_bC(); ++ if (stack != null && stack.func_77973_b() != null && stack.func_77973_b().onBlockStartBreak(stack, p_78751_1_, p_78751_2_, p_78751_3_, field_78776_a.field_71439_g)) ++ { ++ return false; ++ } ++ + if (this.field_78779_k.func_82752_c() && !this.field_78776_a.field_71439_g.func_82246_f(p_78751_1_, p_78751_2_, p_78751_3_)) + { + return false; +@@ -109,7 +119,7 @@ + { + worldclient.func_72926_e(2001, p_78751_1_, p_78751_2_, p_78751_3_, Block.func_149682_b(block) + (worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_) << 12)); + int i1 = worldclient.func_72805_g(p_78751_1_, p_78751_2_, p_78751_3_); +- boolean flag = worldclient.func_147468_f(p_78751_1_, p_78751_2_, p_78751_3_); ++ boolean flag = block.removedByPlayer(worldclient, field_78776_a.field_71439_g, p_78751_1_, p_78751_2_, p_78751_3_); + + if (flag) + { +@@ -304,11 +314,18 @@ + float f2 = (float)p_78760_8_.field_72449_c - (float)p_78760_6_; + boolean flag = false; + +- if ((!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null) && p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2)) ++ if (p_78760_3_ != null && ++ p_78760_3_.func_77973_b() != null && ++ p_78760_3_.func_77973_b().onItemUseFirst(p_78760_3_, p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2)) + { +- flag = true; ++ return true; + } + ++ if (!p_78760_1_.func_70093_af() || p_78760_1_.func_70694_bm() == null || p_78760_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_)) ++ { ++ flag = p_78760_2_.func_147439_a(p_78760_4_, p_78760_5_, p_78760_6_).func_149727_a(p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_1_, p_78760_7_, f, f1, f2); ++ } ++ + if (!flag && p_78760_3_ != null && p_78760_3_.func_77973_b() instanceof ItemBlock) + { + ItemBlock itemblock = (ItemBlock)p_78760_3_.func_77973_b(); +@@ -340,7 +357,15 @@ + } + else + { +- return p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2); ++ if (!p_78760_3_.func_77943_a(p_78760_1_, p_78760_2_, p_78760_4_, p_78760_5_, p_78760_6_, p_78760_7_, f, f1, f2)) ++ { ++ return false; ++ } ++ if (p_78760_3_.field_77994_a <= 0) ++ { ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78760_1_, p_78760_3_)); ++ } ++ return true; + } + } + +@@ -359,9 +384,10 @@ + { + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = itemstack1; + +- if (itemstack1.field_77994_a == 0) ++ if (itemstack1.field_77994_a <= 0) + { + p_78769_1_.field_71071_by.field_70462_a[p_78769_1_.field_71071_by.field_70461_c] = null; ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(p_78769_1_, itemstack1)); + } + + return true; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/WorldClient.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/WorldClient.java.patch new file mode 100644 index 0000000..84ebab8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/WorldClient.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/client/multiplayer/WorldClient.java ++++ ../src-work/minecraft/net/minecraft/client/multiplayer/WorldClient.java +@@ -34,6 +34,9 @@ + import net.minecraft.world.chunk.IChunkProvider; + import net.minecraft.world.storage.SaveHandlerMP; + ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.world.WorldEvent; ++ + @SideOnly(Side.CLIENT) + public class WorldClient extends World + { +@@ -51,8 +54,11 @@ + super(new SaveHandlerMP(), "MpServer", WorldProvider.func_76570_a(p_i45063_3_), p_i45063_2_, p_i45063_5_); + this.field_73035_a = p_i45063_1_; + this.field_73013_u = p_i45063_4_; +- this.func_72950_A(8, 64, 8); + this.field_72988_C = p_i45063_1_.field_147305_a; ++ this.field_72995_K = true; ++ this.finishSetup(); ++ this.func_72950_A(8, 64, 8); ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this)); + } + + public void func_72835_b() +@@ -261,6 +267,12 @@ + + protected void func_72979_l() + { ++ super.func_72979_l(); ++ } ++ ++ @Override ++ public void updateWeatherBody() ++ { + if (!this.field_73011_w.field_76576_e) + { + ; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/network/NetHandlerPlayClient.java.patch new file mode 100644 index 0000000..35603e8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -0,0 +1,57 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +@@ -196,6 +196,8 @@ + import net.minecraft.world.storage.ISaveHandler; + import net.minecraft.world.storage.MapData; + import net.minecraft.world.storage.MapStorage; ++import net.minecraftforge.client.event.ClientChatReceivedEvent; ++import net.minecraftforge.common.MinecraftForge; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -390,7 +392,8 @@ + + public void func_147286_a(S11PacketSpawnExperienceOrb p_147286_1_) + { +- EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d(), (double)p_147286_1_.func_148983_e(), (double)p_147286_1_.func_148982_f(), p_147286_1_.func_148986_g()); ++ EntityXPOrb entityxporb = new EntityXPOrb(this.field_147300_g, (double)p_147286_1_.func_148984_d() / 32.0D, (double)p_147286_1_.func_148983_e() / 32.0D, (double)p_147286_1_.func_148982_f() / 32.0D, p_147286_1_.func_148986_g()); ++ // FORGE: BugFix MC-12013 Wrong XP orb clientside spawn position + entityxporb.field_70118_ct = p_147286_1_.func_148984_d(); + entityxporb.field_70117_cu = p_147286_1_.func_148983_e(); + entityxporb.field_70116_cv = p_147286_1_.func_148982_f(); +@@ -687,7 +690,11 @@ + + public void func_147251_a(S02PacketChat p_147251_1_) + { +- this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(p_147251_1_.func_148915_c()); ++ ClientChatReceivedEvent event = new ClientChatReceivedEvent(p_147251_1_.func_148915_c()); ++ if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null) ++ { ++ this.field_147299_f.field_71456_v.func_146158_b().func_146227_a(event.message); ++ } + } + + public void func_147279_a(S0BPacketAnimation p_147279_1_) +@@ -735,6 +742,11 @@ + float f = (float)(p_147281_1_.func_149028_l() * 360) / 256.0F; + float f1 = (float)(p_147281_1_.func_149030_m() * 360) / 256.0F; + EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.func_75616_a(p_147281_1_.func_149025_e(), this.field_147299_f.field_71441_e); ++ if (entitylivingbase == null) ++ { ++ cpw.mods.fml.common.FMLLog.info("Server attempted to spawn an unknown entity using ID: {0} at ({1}, {2}, {3}) Skipping!", p_147281_1_.func_149025_e(), d0, d1, d2); ++ return; ++ } + entitylivingbase.field_70118_ct = p_147281_1_.func_149023_f(); + entitylivingbase.field_70117_cu = p_147281_1_.func_149034_g(); + entitylivingbase.field_70116_cv = p_147281_1_.func_149029_h(); +@@ -1127,6 +1139,10 @@ + { + tileentity.func_145839_a(p_147273_1_.func_148857_g()); + } ++ else ++ { ++ tileentity.onDataPacket(field_147302_e, p_147273_1_); ++ } + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EffectRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EffectRenderer.java.patch new file mode 100644 index 0000000..d53bc94 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EffectRenderer.java.patch @@ -0,0 +1,74 @@ +--- ../src-base/minecraft/net/minecraft/client/particle/EffectRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/particle/EffectRenderer.java +@@ -16,9 +16,11 @@ + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.entity.Entity; + import net.minecraft.util.MathHelper; ++import net.minecraft.util.MovingObjectPosition; + import net.minecraft.util.ReportedException; + import net.minecraft.util.ResourceLocation; + import net.minecraft.world.World; ++ + import org.lwjgl.opengl.GL11; + + @SideOnly(Side.CLIENT) +@@ -70,7 +72,10 @@ + + try + { +- entityfx.func_70071_h_(); ++ if (entityfx != null) ++ { ++ entityfx.func_70071_h_(); ++ } + } + catch (Throwable throwable) + { +@@ -95,7 +100,7 @@ + throw new ReportedException(crashreport); + } + +- if (entityfx.field_70128_L) ++ if (entityfx == null || entityfx.field_70128_L) + { + this.field_78876_b[i].remove(j--); + } +@@ -144,6 +149,7 @@ + for (int j = 0; j < this.field_78876_b[i].size(); ++j) + { + final EntityFX entityfx = (EntityFX)this.field_78876_b[i].get(j); ++ if (entityfx == null) continue; + tessellator.func_78380_c(entityfx.func_70070_b(p_78874_2_)); + + try +@@ -200,6 +206,7 @@ + for (int i = 0; i < list.size(); ++i) + { + EntityFX entityfx = (EntityFX)list.get(i); ++ if (entityfx == null) continue; + tessellator.func_78380_c(entityfx.func_70070_b(p_78872_2_)); + entityfx.func_70539_a(tessellator, p_78872_2_, f2, f6, f3, f4, f5); + } +@@ -218,7 +225,7 @@ + + public void func_147215_a(int p_147215_1_, int p_147215_2_, int p_147215_3_, Block p_147215_4_, int p_147215_5_) + { +- if (p_147215_4_.func_149688_o() != Material.field_151579_a) ++ if (!p_147215_4_.isAir(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_) && !p_147215_4_.addDestroyEffects(field_78878_a, p_147215_1_, p_147215_2_, p_147215_3_, p_147215_5_, this)) + { + byte b0 = 4; + +@@ -287,4 +294,13 @@ + { + return "" + (this.field_78876_b[0].size() + this.field_78876_b[1].size() + this.field_78876_b[2].size()); + } ++ ++ public void addBlockHitEffects(int x, int y, int z, MovingObjectPosition target) ++ { ++ Block block = field_78878_a.func_147439_a(x, y, z); ++ if (block != null && !block.addHitEffects(field_78878_a, target, this)) ++ { ++ func_78867_a(x, y, z, target.field_72310_e); ++ } ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EntityDiggingFX.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EntityDiggingFX.java.patch new file mode 100644 index 0000000..ebe4cec --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EntityDiggingFX.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/client/particle/EntityDiggingFX.java ++++ ../src-work/minecraft/net/minecraft/client/particle/EntityDiggingFX.java +@@ -12,20 +12,27 @@ + { + private Block field_145784_a; + private static final String __OBFID = "CL_00000932"; ++ private int side; + + public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_) + { ++ this(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_, p_i1234_14_, p_i1234_15_, p_i1234_1_.field_73012_v.nextInt(6)); ++ } ++ ++ public EntityDiggingFX(World p_i1234_1_, double p_i1234_2_, double p_i1234_4_, double p_i1234_6_, double p_i1234_8_, double p_i1234_10_, double p_i1234_12_, Block p_i1234_14_, int p_i1234_15_, int side) ++ { + super(p_i1234_1_, p_i1234_2_, p_i1234_4_, p_i1234_6_, p_i1234_8_, p_i1234_10_, p_i1234_12_); + this.field_145784_a = p_i1234_14_; +- this.func_110125_a(p_i1234_14_.func_149691_a(0, p_i1234_15_)); ++ this.func_110125_a(p_i1234_14_.func_149691_a(side, p_i1234_15_)); + this.field_70545_g = p_i1234_14_.field_149763_I; + this.field_70552_h = this.field_70553_i = this.field_70551_j = 0.6F; + this.field_70544_f /= 2.0F; ++ this.side = side; + } + + public EntityDiggingFX func_70596_a(int p_70596_1_, int p_70596_2_, int p_70596_3_) + { +- if (this.field_145784_a == Blocks.field_150349_c) ++ if (this.field_145784_a == Blocks.field_150349_c && this.side != 1) + { + return this; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/EntityRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/EntityRenderer.java.patch new file mode 100644 index 0000000..5f225cb --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -0,0 +1,203 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java +@@ -51,6 +51,12 @@ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GLContext; + import org.lwjgl.util.glu.Project; ++import net.minecraftforge.client.ForgeHooksClient; ++import net.minecraftforge.client.IRenderHandler; ++import net.minecraftforge.client.event.DrawBlockHighlightEvent; ++import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent; ++import net.minecraftforge.client.event.RenderWorldLastEvent; ++import net.minecraftforge.common.MinecraftForge; + + @SideOnly(Side.CLIENT) + public class EntityRenderer implements IResourceManagerReloadListener +@@ -358,7 +364,7 @@ + + if (d3 < d2 || d2 == 0.0D) + { +- if (entity == this.field_78531_r.field_71451_h.field_70154_o) ++ if (entity == this.field_78531_r.field_71451_h.field_70154_o && !entity.canRiderInteract()) + { + if (d2 == 0.0D) + { +@@ -392,8 +398,15 @@ + + private void func_78477_e() + { +- EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h; +- this.field_78501_T = entityplayersp.func_71151_f(); ++ if (field_78531_r.field_71451_h instanceof EntityPlayerSP) ++ { ++ EntityPlayerSP entityplayersp = (EntityPlayerSP)this.field_78531_r.field_71451_h; ++ this.field_78501_T = entityplayersp.func_71151_f(); ++ } ++ else ++ { ++ this.field_78501_T = field_78531_r.field_71439_g.func_71151_f(); ++ } + this.field_78506_S = this.field_78507_R; + this.field_78507_R += (this.field_78501_T - this.field_78507_R) * 0.5F; + +@@ -416,7 +429,7 @@ + } + else + { +- EntityPlayer entityplayer = (EntityPlayer)this.field_78531_r.field_71451_h; ++ EntityLivingBase entityplayer = (EntityLivingBase)this.field_78531_r.field_71451_h; + float f1 = 70.0F; + + if (p_78481_2_) +@@ -497,15 +510,7 @@ + + if (!this.field_78531_r.field_71474_y.field_74325_U) + { +- Block block = this.field_78531_r.field_71441_e.func_147439_a(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v)); +- +- if (block == Blocks.field_150324_C) +- { +- int i = this.field_78531_r.field_71441_e.func_72805_g(MathHelper.func_76128_c(entitylivingbase.field_70165_t), MathHelper.func_76128_c(entitylivingbase.field_70163_u), MathHelper.func_76128_c(entitylivingbase.field_70161_v)); +- int j = i & 3; +- GL11.glRotatef((float)(j * 90), 0.0F, 1.0F, 0.0F); +- } +- ++ ForgeHooksClient.orientBedCamera(field_78531_r, entitylivingbase); + GL11.glRotatef(entitylivingbase.field_70126_B + (entitylivingbase.field_70177_z - entitylivingbase.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F); + GL11.glRotatef(entitylivingbase.field_70127_C + (entitylivingbase.field_70125_A - entitylivingbase.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F); + } +@@ -1052,7 +1057,9 @@ + + try + { +- this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_); ++ if (!MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Pre(this.field_78531_r.field_71462_r, k, l, p_78480_1_))) ++ this.field_78531_r.field_71462_r.func_73863_a(k, l, p_78480_1_); ++ MinecraftForge.EVENT_BUS.post(new DrawScreenEvent.Post(this.field_78531_r.field_71462_r, k, l, p_78480_1_)); + } + catch (Throwable throwable) + { +@@ -1213,7 +1220,10 @@ + GL11.glPushMatrix(); + RenderHelper.func_74519_b(); + this.field_78531_r.field_71424_I.func_76318_c("entities"); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); + renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_); ++ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); ++ //ToDo: Try and figure out how to make particles render sorted correctly.. {They render behind water} + RenderHelper.func_74518_a(); + this.func_78483_a((double)p_78471_1_); + GL11.glMatrixMode(GL11.GL_MODELVIEW); +@@ -1225,7 +1235,10 @@ + entityplayer = (EntityPlayer)entitylivingbase; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.field_78531_r.field_71424_I.func_76318_c("outline"); +- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_)) ++ { ++ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } +@@ -1238,14 +1251,17 @@ + entityplayer = (EntityPlayer)entitylivingbase; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.field_78531_r.field_71424_I.func_76318_c("outline"); +- renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ if (!ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.field_71071_by.func_70448_g(), p_78471_1_)) ++ { ++ renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_78471_1_); ++ } + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + this.field_78531_r.field_71424_I.func_76318_c("destroyProgress"); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.func_148821_a(770, 1, 1, 0); +- renderglobal.func_72717_a(Tessellator.field_78398_a, (EntityPlayer)entitylivingbase, p_78471_1_); ++ renderglobal.drawBlockDamageTexture(Tessellator.field_78398_a, entitylivingbase, p_78471_1_); + GL11.glDisable(GL11.GL_BLEND); + + if (this.field_78532_q == 0) +@@ -1313,6 +1329,16 @@ + renderglobal.func_72719_a(entitylivingbase, 1, (double)p_78471_1_); + } + ++ if (this.field_78532_q == 0) //Only render if render pass 0 happens as well. ++ { ++ RenderHelper.func_74519_b(); ++ this.field_78531_r.field_71424_I.func_76318_c("entities"); ++ ForgeHooksClient.setRenderPass(1); ++ renderglobal.func_147589_a(entitylivingbase, frustrum, p_78471_1_); ++ ForgeHooksClient.setRenderPass(-1); ++ RenderHelper.func_74518_a(); ++ } ++ + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); +@@ -1324,9 +1350,12 @@ + this.func_82829_a(renderglobal, p_78471_1_); + } + ++ this.field_78531_r.field_71424_I.func_76318_c("FRenderLast"); ++ ForgeHooksClient.dispatchRenderLast(renderglobal, p_78471_1_); ++ + this.field_78531_r.field_71424_I.func_76318_c("hand"); + +- if (this.field_78503_V == 1.0D) ++ if (!ForgeHooksClient.renderFirstPersonHand(renderglobal, p_78471_1_, j) && this.field_78503_V == 1.0D) + { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + this.func_78476_b(p_78471_1_, j); +@@ -1442,6 +1471,13 @@ + + protected void func_78474_d(float p_78474_1_) + { ++ IRenderHandler renderer = null; ++ if ((renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer()) != null) ++ { ++ renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r); ++ return; ++ } ++ + float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); + + if (f1 > 0.0F) +@@ -1791,6 +1827,13 @@ + this.field_78533_p = f7; + } + ++ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entitylivingbase, block, p_78466_1_, this.field_78518_n, this.field_78519_o, this.field_78533_p); ++ MinecraftForge.EVENT_BUS.post(event); ++ ++ this.field_78518_n = event.red; ++ this.field_78533_p = event.blue; ++ this.field_78519_o = event.green; ++ + GL11.glClearColor(this.field_78518_n, this.field_78519_o, this.field_78533_p, 0.0F); + } + +@@ -1826,6 +1869,13 @@ + Block block = ActiveRenderInfo.func_151460_a(this.field_78531_r.field_71441_e, entitylivingbase, p_78468_2_); + float f1; + ++ net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity(this, entitylivingbase, block, p_78468_2_, 0.1F); ++ ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ GL11.glFogf(GL11.GL_FOG_DENSITY, event.density); ++ } ++ else + if (entitylivingbase.func_70644_a(Potion.field_76440_q)) + { + f1 = 5.0F; +@@ -1930,6 +1980,7 @@ + GL11.glFogf(GL11.GL_FOG_START, f1 * 0.05F); + GL11.glFogf(GL11.GL_FOG_END, Math.min(f1, 192.0F) * 0.5F); + } ++ MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.EntityViewRenderEvent.RenderFogEvent(this, entitylivingbase, block, p_78468_2_, p_78468_1_, f1)); + } + + GL11.glEnable(GL11.GL_COLOR_MATERIAL); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch new file mode 100644 index 0000000..b7e41be --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/InventoryEffectRenderer.java +@@ -75,6 +75,8 @@ + this.func_73729_b(i + 6, j + 7, 0 + l % 8 * 18, 198 + l / 8 * 18, 18, 18); + } + ++ potion.renderInventoryEffect(i, j, potioneffect, field_146297_k); ++ if (!potion.shouldRenderInvText(potioneffect)) continue; + String s1 = I18n.func_135052_a(potion.func_76393_a(), new Object[0]); + + if (potioneffect.func_76458_c() == 1) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/ItemRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/ItemRenderer.java.patch new file mode 100644 index 0000000..3d876c1 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/ItemRenderer.java.patch @@ -0,0 +1,167 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/ItemRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/ItemRenderer.java +@@ -20,6 +20,7 @@ + import net.minecraft.item.Item; + import net.minecraft.item.ItemBlock; + import net.minecraft.item.ItemCloth; ++import net.minecraft.item.ItemMap; + import net.minecraft.item.ItemStack; + import net.minecraft.util.IIcon; + import net.minecraft.util.MathHelper; +@@ -28,6 +29,13 @@ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + ++import net.minecraftforge.client.ForgeHooksClient; ++import net.minecraftforge.client.IItemRenderer; ++import net.minecraftforge.client.IItemRenderer.ItemRenderType; ++import net.minecraftforge.client.MinecraftForgeClient; ++import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; ++import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; ++ + @SideOnly(Side.CLIENT) + public class ItemRenderer + { +@@ -49,6 +57,11 @@ + + public void func_78443_a(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_) + { ++ this.renderItem(p_78443_1_, p_78443_2_, p_78443_3_, EQUIPPED); ++ } ++ ++ public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type) ++ { + GL11.glPushMatrix(); + TextureManager texturemanager = this.field_78455_a.func_110434_K(); + Item item = p_78443_2_.func_77973_b(); +@@ -60,7 +73,13 @@ + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.func_148821_a(770, 771, 1, 0); + } +- ++ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type); ++ if (customRenderer != null) ++ { ++ texturemanager.func_110577_a(texturemanager.func_130087_a(p_78443_2_.func_94608_d())); ++ ForgeHooksClient.renderEquippedItem(type, customRenderer, field_147720_h, p_78443_1_, p_78443_2_); ++ } ++ else + if (p_78443_2_.func_94608_d() == 0 && item instanceof ItemBlock && RenderBlocks.func_147739_a(block.func_149645_b())) + { + texturemanager.func_110577_a(texturemanager.func_130087_a(0)); +@@ -104,7 +123,7 @@ + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + func_78439_a(tessellator, f1, f2, f, f3, iicon.func_94211_a(), iicon.func_94216_b(), 0.0625F); + +- if (p_78443_2_.func_77962_s() && p_78443_3_ == 0) ++ if (p_78443_2_.hasEffect(p_78443_3_)) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); +@@ -282,7 +301,7 @@ + Render render; + RenderPlayer renderplayer; + +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151098_aY) ++ if (itemstack != null && itemstack.func_77973_b() instanceof ItemMap) + { + GL11.glPushMatrix(); + f13 = 0.8F; +@@ -349,12 +368,21 @@ + tessellator.func_78374_a((double)(128 + b0), (double)(0 - b0), 0.0D, 1.0D, 0.0D); + tessellator.func_78374_a((double)(0 - b0), (double)(0 - b0), 0.0D, 0.0D, 0.0D); + tessellator.func_78381_a(); +- MapData mapdata = Items.field_151098_aY.func_77873_a(itemstack, this.field_78455_a.field_71441_e); + +- if (mapdata != null) ++ IItemRenderer custom = MinecraftForgeClient.getItemRenderer(itemstack, FIRST_PERSON_MAP); ++ MapData mapdata = ((ItemMap)itemstack.func_77973_b()).func_77873_a(itemstack, this.field_78455_a.field_71441_e); ++ ++ if (custom == null) + { +- this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false); ++ if (mapdata != null) ++ { ++ this.field_78455_a.field_71460_t.func_147701_i().func_148250_a(mapdata, false); ++ } + } ++ else ++ { ++ custom.renderItem(FIRST_PERSON_MAP, itemstack, field_78455_a.field_71439_g, field_78455_a.func_110434_K(), mapdata); ++ } + + GL11.glPopMatrix(); + } +@@ -455,17 +483,20 @@ + + if (itemstack.func_77973_b().func_77623_v()) + { +- this.func_78443_a(entityclientplayermp, itemstack, 0); +- int k1 = itemstack.func_77973_b().func_82790_a(itemstack, 1); +- f10 = (float)(k1 >> 16 & 255) / 255.0F; +- f11 = (float)(k1 >> 8 & 255) / 255.0F; +- f12 = (float)(k1 & 255) / 255.0F; +- GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F); +- this.func_78443_a(entityclientplayermp, itemstack, 1); ++ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); ++ for (int x = 1; x < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); x++) ++ { ++ int k1 = itemstack.func_77973_b().func_82790_a(itemstack, x); ++ f10 = (float)(k1 >> 16 & 255) / 255.0F; ++ f11 = (float)(k1 >> 8 & 255) / 255.0F; ++ f12 = (float)(k1 & 255) / 255.0F; ++ GL11.glColor4f(1.0F * f10, 1.0F * f11, 1.0F * f12, 1.0F); ++ this.renderItem(entityclientplayermp, itemstack, x, EQUIPPED_FIRST_PERSON); ++ } + } + else + { +- this.func_78443_a(entityclientplayermp, itemstack, 0); ++ this.renderItem(entityclientplayermp, itemstack, 0, EQUIPPED_FIRST_PERSON); + } + + GL11.glPopMatrix(); +@@ -516,6 +547,7 @@ + + if (this.field_78455_a.field_71439_g.func_70027_ad()) + { ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.FIRE, Blocks.field_150480_ab, MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v)))) + this.func_78442_d(p_78447_1_); + } + +@@ -525,9 +557,11 @@ + int j = MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u); + int k = MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v); + Block block = this.field_78455_a.field_71441_e.func_147439_a(i, j, k); ++ int block2_X = i, block2_Y = j, block2_Z = k; + + if (this.field_78455_a.field_71441_e.func_147439_a(i, j, k).func_149721_r()) + { ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, i, j, k))) + this.func_78446_a(p_78447_1_, block.func_149733_h(2)); + } + else +@@ -544,18 +578,23 @@ + if (this.field_78455_a.field_71441_e.func_147439_a(i1, j1, k1).func_149721_r()) + { + block = this.field_78455_a.field_71441_e.func_147439_a(i1, j1, k1); ++ block2_X = i; ++ block2_Y = j; ++ block2_Z = k; + } + } + } + + if (block.func_149688_o() != Material.field_151579_a) + { ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.BLOCK, block, block2_X, block2_Y, block2_Z))) + this.func_78446_a(p_78447_1_, block.func_149733_h(2)); + } + } + + if (this.field_78455_a.field_71439_g.func_70055_a(Material.field_151586_h)) + { ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderBlockOverlayEvent(this.field_78455_a.field_71439_g, p_78447_1_, net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType.WATER, Blocks.field_150355_j, MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70165_t), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70163_u), MathHelper.func_76128_c(this.field_78455_a.field_71439_g.field_70161_v)))) + this.func_78448_c(p_78447_1_); + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/OpenGlHelper.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/OpenGlHelper.java.patch new file mode 100644 index 0000000..c022c25 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/OpenGlHelper.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/OpenGlHelper.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/OpenGlHelper.java +@@ -54,6 +54,10 @@ + private static String field_153196_B = ""; + private static final String __OBFID = "CL_00001179"; + ++ /* Stores the last values sent into setLightmapTextureCoords */ ++ public static float lastBrightnessX = 0.0f; ++ public static float lastBrightnessY = 0.0f; ++ + public static void func_77474_a() + { + ContextCapabilities contextcapabilities = GLContext.getCapabilities(); +@@ -688,6 +692,12 @@ + { + GL13.glMultiTexCoord2f(p_77475_0_, p_77475_1_, p_77475_2_); + } ++ ++ if (p_77475_0_ == field_77476_b) ++ { ++ lastBrightnessX = p_77475_1_; ++ lastBrightnessY = p_77475_2_; ++ } + } + + public static void func_148821_a(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderBlocks.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderBlocks.java.patch new file mode 100644 index 0000000..3a26f28 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -0,0 +1,143 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java +@@ -52,6 +52,8 @@ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + ++import static net.minecraftforge.common.util.ForgeDirection.*; ++ + @SideOnly(Side.CLIENT) + public class RenderBlocks + { +@@ -339,9 +341,9 @@ + public boolean func_147773_v(Block p_147773_1_, int p_147773_2_, int p_147773_3_, int p_147773_4_) + { + Tessellator tessellator = Tessellator.field_78398_a; +- int l = this.field_147845_a.func_72805_g(p_147773_2_, p_147773_3_, p_147773_4_); +- int i1 = BlockBed.func_149895_l(l); +- boolean flag = BlockBed.func_149975_b(l); ++ Block bed = this.field_147845_a.func_147439_a(p_147773_2_, p_147773_3_, p_147773_4_); ++ int i1 = bed.getBedDirection(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); ++ boolean flag = bed.isBedFoot(field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_); + float f = 0.5F; + float f1 = 1.0F; + float f2 = 0.8F; +@@ -350,6 +352,7 @@ + tessellator.func_78380_c(j1); + tessellator.func_78386_a(f, f, f); + IIcon iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 0); ++ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + double d0 = (double)iicon.func_94209_e(); + double d1 = (double)iicon.func_94212_f(); + double d2 = (double)iicon.func_94206_g(); +@@ -366,6 +369,7 @@ + tessellator.func_78380_c(p_147773_1_.func_149677_c(this.field_147845_a, p_147773_2_, p_147773_3_ + 1, p_147773_4_)); + tessellator.func_78386_a(f1, f1, f1); + iicon = this.func_147793_a(p_147773_1_, this.field_147845_a, p_147773_2_, p_147773_3_, p_147773_4_, 1); ++ if (func_147744_b()) iicon = field_147840_d; //BugFix Proper breaking texture on underside + d0 = (double)iicon.func_94209_e(); + d1 = (double)iicon.func_94212_f(); + d2 = (double)iicon.func_94206_g(); +@@ -2040,7 +2044,7 @@ + double d10; + double d11; + +- if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_)) ++ if (!World.func_147466_a(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_) && !Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) + { + float f2 = 0.2F; + float f1 = 0.0625F; +@@ -2060,7 +2064,7 @@ + d0 = d5; + } + +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) + { + tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1), d2, d3); +@@ -2072,7 +2076,7 @@ + tessellator.func_78374_a((double)((float)p_147801_2_ + f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 1), d2, d1); + } + +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) + { + tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 1 - 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d0, d3); +@@ -2084,7 +2088,7 @@ + tessellator.func_78374_a((double)((float)(p_147801_2_ + 1) - f2), (double)((float)p_147801_3_ + f + f1), (double)(p_147801_4_ + 0), d0, d1); + } + +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) + { + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 0), d2, d3); +@@ -2096,7 +2100,7 @@ + tessellator.func_78374_a((double)(p_147801_2_ + 0), (double)((float)p_147801_3_ + f + f1), (double)((float)p_147801_4_ + f2), d2, d1); + } + +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) + { + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)(p_147801_3_ + 0) + f1), (double)(p_147801_4_ + 1 - 0), d0, d3); +@@ -2108,7 +2112,7 @@ + tessellator.func_78374_a((double)(p_147801_2_ + 1), (double)((float)p_147801_3_ + f + f1), (double)((float)(p_147801_4_ + 1) - f2), d0, d1); + } + +- if (Blocks.field_150480_ab.func_149844_e(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_)) ++ if (Blocks.field_150480_ab.canCatchFire(this.field_147845_a, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) + { + d5 = (double)p_147801_2_ + 0.5D + 0.5D; + d6 = (double)p_147801_2_ + 0.5D - 0.5D; +@@ -2724,10 +2728,10 @@ + double d16 = (double)p_147733_2_ + 0.5D + 0.0625D; + double d17 = (double)p_147733_4_ + 0.5D - 0.0625D; + double d18 = (double)p_147733_4_ + 0.5D + 0.0625D; +- boolean flag = flag5 ? ((BlockStainedGlassPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_, p_147733_3_, p_147733_4_ - 1)) : ((BlockPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_, p_147733_3_, p_147733_4_ - 1)); +- boolean flag1 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_, p_147733_3_, p_147733_4_ + 1)) : ((BlockPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_, p_147733_3_, p_147733_4_ + 1)); +- boolean flag2 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_ - 1, p_147733_3_, p_147733_4_)) : ((BlockPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_ - 1, p_147733_3_, p_147733_4_)); +- boolean flag3 = flag5 ? ((BlockStainedGlassPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_ + 1, p_147733_3_, p_147733_4_)) : ((BlockPane)p_147733_1_).func_150098_a(this.field_147845_a.func_147439_a(p_147733_2_ + 1, p_147733_3_, p_147733_4_)); ++ boolean flag = ((BlockPane)p_147733_1_).canPaneConnectTo(this.field_147845_a, p_147733_2_, p_147733_3_, p_147733_4_ - 1, NORTH); ++ boolean flag1 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.field_147845_a, p_147733_2_, p_147733_3_, p_147733_4_ + 1, SOUTH); ++ boolean flag2 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.field_147845_a, p_147733_2_ - 1, p_147733_3_, p_147733_4_, WEST ); ++ boolean flag3 = ((BlockPane)p_147733_1_).canPaneConnectTo(this.field_147845_a, p_147733_2_ + 1, p_147733_3_, p_147733_4_, EAST ); + double d19 = 0.001D; + double d20 = 0.999D; + double d21 = 0.001D; +@@ -3121,10 +3125,10 @@ + double d16 = (double)p_147767_2_ + 0.5D + 0.0625D; + double d17 = (double)p_147767_4_ + 0.5D - 0.0625D; + double d18 = (double)p_147767_4_ + 0.5D + 0.0625D; +- boolean flag = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ - 1)); +- boolean flag1 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_, p_147767_3_, p_147767_4_ + 1)); +- boolean flag2 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ - 1, p_147767_3_, p_147767_4_)); +- boolean flag3 = p_147767_1_.func_150098_a(this.field_147845_a.func_147439_a(p_147767_2_ + 1, p_147767_3_, p_147767_4_)); ++ boolean flag = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ - 1, NORTH); ++ boolean flag1 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_, p_147767_3_, p_147767_4_ + 1, SOUTH); ++ boolean flag2 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ - 1, p_147767_3_, p_147767_4_, WEST ); ++ boolean flag3 = p_147767_1_.canPaneConnectTo(this.field_147845_a, p_147767_2_ + 1, p_147767_3_, p_147767_4_, EAST ); + boolean flag4 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ + 1, p_147767_4_, 1); + boolean flag5 = p_147767_1_.func_149646_a(this.field_147845_a, p_147767_2_, p_147767_3_ - 1, p_147767_4_, 0); + double d19 = 0.01D; +@@ -8247,4 +8251,18 @@ + + return (IIcon)p_147758_1_; + } ++ ++ /*==================================== FORGE START ===========================================*/ ++ private static RenderBlocks instance; ++ /** ++ * Returns a single lazy loaded instance of RenderBlocks, for use in mods who ++ * don't care about the interaction of other objects on the current state of the RenderBlocks they are using. ++ * @return A global instance of RenderBlocks ++ */ ++ public static RenderBlocks getInstance() ++ { ++ if (instance == null) instance = new RenderBlocks(); ++ return instance; ++ } ++ /*==================================== FORGE END =============================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderGlobal.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderGlobal.java.patch new file mode 100644 index 0000000..25e522e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -0,0 +1,130 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java +@@ -79,6 +79,9 @@ + import org.lwjgl.opengl.ARBOcclusionQuery; + import org.lwjgl.opengl.GL11; + ++import net.minecraftforge.client.IRenderHandler; ++import net.minecraftforge.client.MinecraftForgeClient; ++ + @SideOnly(Side.CLIENT) + public class RenderGlobal implements IWorldAccess + { +@@ -376,8 +379,10 @@ + + public void func_147589_a(EntityLivingBase p_147589_1_, ICamera p_147589_2_, float p_147589_3_) + { ++ int pass = MinecraftForgeClient.getRenderPass(); + if (this.field_72740_G > 0) + { ++ if (pass > 0) return; + --this.field_72740_G; + } + else +@@ -388,9 +393,12 @@ + this.field_72769_h.field_72984_F.func_76320_a("prepare"); + TileEntityRendererDispatcher.field_147556_a.func_147542_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, p_147589_3_); + RenderManager.field_78727_a.func_147938_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.field_71451_h, this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_147589_3_); ++ if (pass == 0) // no indentation to shrink patch ++ { + this.field_72748_H = 0; + this.field_72749_I = 0; + this.field_72750_J = 0; ++ } + EntityLivingBase entitylivingbase1 = this.field_72777_q.field_71451_h; + double d3 = entitylivingbase1.field_70142_S + (entitylivingbase1.field_70165_t - entitylivingbase1.field_70142_S) * (double)p_147589_3_; + double d4 = entitylivingbase1.field_70137_T + (entitylivingbase1.field_70163_u - entitylivingbase1.field_70137_T) * (double)p_147589_3_; +@@ -419,13 +427,17 @@ + this.field_72777_q.field_71460_t.func_78463_b((double)p_147589_3_); + this.field_72769_h.field_72984_F.func_76318_c("global"); + List list = this.field_72769_h.func_72910_y(); ++ if (pass == 0) // no indentation for smaller patch size ++ { + this.field_72748_H = list.size(); ++ } + int i; + Entity entity; + + for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) + { + entity = (Entity)this.field_72769_h.field_73007_j.get(i); ++ if (!entity.shouldRenderInPass(pass)) continue; + ++this.field_72749_I; + + if (entity.func_145770_h(d0, d1, d2)) +@@ -439,6 +451,7 @@ + for (i = 0; i < list.size(); ++i) + { + entity = (Entity)list.get(i); ++ if (!entity.shouldRenderInPass(pass)) continue; + boolean flag = entity.func_145770_h(d0, d1, d2) && (entity.field_70158_ak || p_147589_2_.func_78546_a(entity.field_70121_D) || entity.field_70153_n == this.field_72777_q.field_71439_g); + + if (!flag && entity instanceof EntityLiving) +@@ -464,7 +477,11 @@ + + for (i = 0; i < this.field_147598_a.size(); ++i) + { +- TileEntityRendererDispatcher.field_147556_a.func_147544_a((TileEntity)this.field_147598_a.get(i), p_147589_3_); ++ TileEntity tile = (TileEntity)this.field_147598_a.get(i); ++ if (tile.shouldRenderInPass(pass) && p_147589_2_.func_78546_a(tile.getRenderBoundingBox())) ++ { ++ TileEntityRendererDispatcher.field_147556_a.func_147544_a(tile, p_147589_3_); ++ } + } + + this.field_72777_q.field_71460_t.func_78483_a((double)p_147589_3_); +@@ -941,6 +958,12 @@ + + public void func_72714_a(float p_72714_1_) + { ++ IRenderHandler skyProvider = null; ++ if ((skyProvider = this.field_72777_q.field_71441_e.field_73011_w.getSkyRenderer()) != null) ++ { ++ skyProvider.render(p_72714_1_, this.field_72769_h, field_72777_q); ++ return; ++ } + if (this.field_72777_q.field_71441_e.field_73011_w.field_76574_g == 1) + { + GL11.glDisable(GL11.GL_FOG); +@@ -1179,6 +1202,12 @@ + + public void func_72718_b(float p_72718_1_) + { ++ IRenderHandler renderer = null; ++ if ((renderer = field_72769_h.field_73011_w.getCloudRenderer()) != null) ++ { ++ renderer.render(p_72718_1_, field_72769_h, field_72777_q); ++ return; ++ } + if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) + { + if (this.field_72777_q.field_71474_y.field_74347_j) +@@ -1579,6 +1608,11 @@ + + public void func_72717_a(Tessellator p_72717_1_, EntityPlayer p_72717_2_, float p_72717_3_) + { ++ drawBlockDamageTexture(p_72717_1_, (EntityLivingBase)p_72717_2_, p_72717_3_); ++ } ++ ++ public void drawBlockDamageTexture(Tessellator p_72717_1_, EntityLivingBase p_72717_2_, float p_72717_3_) ++ { + double d0 = p_72717_2_.field_70142_S + (p_72717_2_.field_70165_t - p_72717_2_.field_70142_S) * (double)p_72717_3_; + double d1 = p_72717_2_.field_70137_T + (p_72717_2_.field_70163_u - p_72717_2_.field_70137_T) * (double)p_72717_3_; + double d2 = p_72717_2_.field_70136_U + (p_72717_2_.field_70161_v - p_72717_2_.field_70136_U) * (double)p_72717_3_; +@@ -1798,12 +1832,15 @@ + { + ItemRecord itemrecord = ItemRecord.func_150926_b(p_72702_1_); + ++ ResourceLocation resource = null; + if (itemrecord != null) + { + this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i()); ++ resource = itemrecord.getRecordResource(p_72702_1_); + } + +- PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(new ResourceLocation(p_72702_1_), (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_); ++ if (resource == null) resource = new ResourceLocation(p_72702_1_); ++ PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, (float)p_72702_2_, (float)p_72702_3_, (float)p_72702_4_); + this.field_147593_P.put(chunkcoordinates, positionedsoundrecord); + this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/Tessellator.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/Tessellator.java.patch new file mode 100644 index 0000000..dbc672f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/Tessellator.java.patch @@ -0,0 +1,145 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/Tessellator.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/Tessellator.java +@@ -7,6 +7,7 @@ + import java.nio.FloatBuffer; + import java.nio.IntBuffer; + import java.nio.ShortBuffer; ++import java.util.Arrays; + import java.util.PriorityQueue; + import net.minecraft.client.shader.TesselatorVertexState; + import net.minecraft.client.util.QuadComparator; +@@ -15,10 +16,17 @@ + @SideOnly(Side.CLIENT) + public class Tessellator + { +- private ByteBuffer field_78394_d; +- private IntBuffer field_147568_c; +- private FloatBuffer field_147566_d; +- private ShortBuffer field_147567_e; ++ private static int nativeBufferSize = 0x200000; ++ private static int trivertsInBuffer = (nativeBufferSize / 48) * 6; ++ public static boolean renderingWorldRenderer = false; ++ public boolean defaultTexture = false; ++ private int rawBufferSize = 0; ++ public int textureID = 0; ++ ++ private static ByteBuffer field_78394_d = GLAllocation.func_74524_c(nativeBufferSize * 4); ++ private static IntBuffer field_147568_c = field_78394_d.asIntBuffer(); ++ private static FloatBuffer field_147566_d = field_78394_d.asFloatBuffer(); ++ private static ShortBuffer field_147567_e = field_78394_d.asShortBuffer(); + private int[] field_78405_h; + private int field_78406_i; + private double field_78403_j; +@@ -44,14 +52,17 @@ + + private Tessellator(int p_i1250_1_) + { +- this.field_78388_E = p_i1250_1_; +- this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4); +- this.field_147568_c = this.field_78394_d.asIntBuffer(); +- this.field_147566_d = this.field_78394_d.asFloatBuffer(); +- this.field_147567_e = this.field_78394_d.asShortBuffer(); +- this.field_78405_h = new int[p_i1250_1_]; + } + ++ public Tessellator() ++ { ++ } ++ ++ static ++ { ++ field_78398_a.defaultTexture = true; ++ } ++ + public int func_78381_a() + { + if (!this.field_78415_z) +@@ -62,12 +73,15 @@ + { + this.field_78415_z = false; + +- if (this.field_78406_i > 0) ++ int offs = 0; ++ while (offs < field_78406_i) + { ++ int vtc = Math.min(field_78406_i - offs, nativeBufferSize >> 5); + this.field_147568_c.clear(); +- this.field_147568_c.put(this.field_78405_h, 0, this.field_147569_p); ++ this.field_147568_c.put(this.field_78405_h, offs * 8, vtc * 8); + this.field_78394_d.position(0); +- this.field_78394_d.limit(this.field_147569_p * 4); ++ this.field_78394_d.limit(vtc * 32); ++ offs += vtc; + + if (this.field_78400_o) + { +@@ -102,7 +116,7 @@ + this.field_147566_d.position(0); + GL11.glVertexPointer(3, 32, this.field_147566_d); + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); +- GL11.glDrawArrays(this.field_78409_u, 0, this.field_78406_i); ++ GL11.glDrawArrays(this.field_78409_u, 0, vtc); + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.field_78400_o) +@@ -128,6 +142,12 @@ + } + } + ++ if (rawBufferSize > 0x20000 && field_147569_p < (rawBufferSize << 3)) ++ { ++ rawBufferSize = 0x10000; ++ field_78405_h = new int[rawBufferSize]; ++ } ++ + int i = this.field_147569_p * 4; + this.func_78379_d(); + return i; +@@ -162,6 +182,14 @@ + + public void func_147565_a(TesselatorVertexState p_147565_1_) + { ++ while (p_147565_1_.func_147572_a().length > rawBufferSize && rawBufferSize > 0) ++ { ++ rawBufferSize <<= 1; ++ } ++ if (rawBufferSize > field_78405_h.length) ++ { ++ field_78405_h = new int[rawBufferSize]; ++ } + System.arraycopy(p_147565_1_.func_147572_a(), 0, this.field_78405_h, 0, p_147565_1_.func_147572_a().length); + this.field_147569_p = p_147565_1_.func_147576_b(); + this.field_78406_i = p_147565_1_.func_147575_c(); +@@ -301,6 +329,19 @@ + + public void func_78377_a(double p_78377_1_, double p_78377_3_, double p_78377_5_) + { ++ if (field_147569_p >= rawBufferSize - 32) ++ { ++ if (rawBufferSize == 0) ++ { ++ rawBufferSize = 0x10000; ++ field_78405_h = new int[rawBufferSize]; ++ } ++ else ++ { ++ rawBufferSize *= 2; ++ field_78405_h = Arrays.copyOf(field_78405_h, rawBufferSize); ++ } ++ } + ++this.field_78411_s; + + if (this.field_78400_o) +@@ -329,12 +370,6 @@ + this.field_78405_h[this.field_147569_p + 2] = Float.floatToRawIntBits((float)(p_78377_5_ + this.field_78417_x)); + this.field_147569_p += 8; + ++this.field_78406_i; +- +- if (this.field_78406_i % 4 == 0 && this.field_147569_p >= this.field_78388_E - 32) +- { +- this.func_78381_a(); +- this.field_78415_z = true; +- } + } + + public void func_78378_d(int p_78378_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/WorldRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/WorldRenderer.java.patch new file mode 100644 index 0000000..db5e237 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/WorldRenderer.java.patch @@ -0,0 +1,85 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/WorldRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/WorldRenderer.java +@@ -28,7 +28,7 @@ + private TesselatorVertexState field_147894_y; + public World field_78924_a; + private int field_78942_y = -1; +- private static Tessellator field_78941_z = Tessellator.field_78398_a; ++ //private static Tessellator tessellator = Tessellator.instance; + public static int field_78922_b; + public int field_78923_c; + public int field_78920_d; +@@ -132,6 +132,7 @@ + { + ++field_78922_b; + RenderBlocks renderblocks = new RenderBlocks(chunkcache); ++ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(renderblocks); + this.field_78917_C = 0; + this.field_147894_y = null; + +@@ -157,7 +158,7 @@ + this.func_147890_b(k2); + } + +- if (k2 == 0 && block.func_149716_u()) ++ if (k2 == 0 && block.hasTileEntity(chunkcache.func_72805_g(j3, l2, i3))) + { + TileEntity tileentity = chunkcache.func_147438_o(j3, l2, i3); + +@@ -173,7 +174,9 @@ + { + flag = true; + } +- else if (k3 == k2) ++ ++ if (!block.canRenderInPass(k2)) continue; ++ + { + flag1 |= renderblocks.func_147805_b(block, j3, l2, i3); + +@@ -210,6 +213,7 @@ + break; + } + } ++ net.minecraftforge.client.ForgeHooksClient.setWorldRendererRB(null); + } + + HashSet hashset1 = new HashSet(); +@@ -232,21 +236,23 @@ + GL11.glTranslatef(-8.0F, -8.0F, -8.0F); + GL11.glScalef(f, f, f); + GL11.glTranslatef(8.0F, 8.0F, 8.0F); +- field_78941_z.func_78382_b(); +- field_78941_z.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e)); ++ net.minecraftforge.client.ForgeHooksClient.onPreRenderWorld(this, p_147890_1_); ++ Tessellator.field_78398_a.func_78382_b(); ++ Tessellator.field_78398_a.func_78373_b((double)(-this.field_78923_c), (double)(-this.field_78920_d), (double)(-this.field_78921_e)); + } + + private void func_147891_a(int p_147891_1_, EntityLivingBase p_147891_2_) + { + if (p_147891_1_ == 1 && !this.field_78928_m[p_147891_1_]) + { +- this.field_147894_y = field_78941_z.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v); ++ this.field_147894_y = Tessellator.field_78398_a.func_147564_a((float)p_147891_2_.field_70165_t, (float)p_147891_2_.field_70163_u, (float)p_147891_2_.field_70161_v); + } + +- this.field_78917_C += field_78941_z.func_78381_a(); ++ this.field_78917_C += Tessellator.field_78398_a.func_78381_a(); ++ net.minecraftforge.client.ForgeHooksClient.onPostRenderWorld(this, p_147891_1_); + GL11.glPopMatrix(); + GL11.glEndList(); +- field_78941_z.func_78373_b(0.0D, 0.0D, 0.0D); ++ Tessellator.field_78398_a.func_78373_b(0.0D, 0.0D, 0.0D); + } + + public void func_147889_b(EntityLivingBase p_147889_1_) +@@ -254,7 +260,7 @@ + if (this.field_147894_y != null && !this.field_78928_m[1]) + { + this.func_147890_b(1); +- field_78941_z.func_147565_a(this.field_147894_y); ++ Tessellator.field_78398_a.func_147565_a(this.field_147894_y); + this.func_147891_a(1, p_147889_1_); + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderBiped.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderBiped.java.patch new file mode 100644 index 0000000..2dbec6b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderBiped.java.patch @@ -0,0 +1,122 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderBiped.java +@@ -54,11 +54,13 @@ + this.field_82425_h = new ModelBiped(0.5F); + } + ++ @Deprecated //Use the more sensitive version getArmorResource below + public static ResourceLocation func_110857_a(ItemArmor p_110857_0_, int p_110857_1_) + { + return func_110858_a(p_110857_0_, p_110857_1_, (String)null); + } + ++ @Deprecated //Use the more sensitive version getArmorResource below + public static ResourceLocation func_110858_a(ItemArmor p_110858_0_, int p_110858_1_, String p_110858_2_) + { + String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {field_82424_k[p_110858_0_.field_77880_c], Integer.valueOf(p_110858_1_ == 2 ? 2 : 1), p_110858_2_ == null ? "" : String.format("_%s", new Object[]{p_110858_2_})}); +@@ -84,7 +86,7 @@ + if (item instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)item; +- this.func_110776_a(func_110857_a(itemarmor, p_77032_2_)); ++ this.func_110776_a(getArmorResource(p_77032_1_, itemstack, p_77032_2_, null)); + ModelBiped modelbiped = p_77032_2_ == 2 ? this.field_82425_h : this.field_82423_g; + modelbiped.field_78116_c.field_78806_j = p_77032_2_ == 0; + modelbiped.field_78114_d.field_78806_j = p_77032_2_ == 0; +@@ -93,14 +95,16 @@ + modelbiped.field_78113_g.field_78806_j = p_77032_2_ == 1; + modelbiped.field_78123_h.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3; + modelbiped.field_78124_i.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3; ++ modelbiped = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_77032_1_, itemstack, p_77032_2_, modelbiped); + this.func_77042_a(modelbiped); + modelbiped.field_78095_p = this.field_77045_g.field_78095_p; + modelbiped.field_78093_q = this.field_77045_g.field_78093_q; + modelbiped.field_78091_s = this.field_77045_g.field_78091_s; + +- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH) ++ //Move out of if to allow for more then just CLOTH to have color ++ int j = itemarmor.func_82814_b(itemstack); ++ if (j != -1) + { +- int j = itemarmor.func_82814_b(itemstack); + float f1 = (float)(j >> 16 & 255) / 255.0F; + float f2 = (float)(j >> 8 & 255) / 255.0F; + float f3 = (float)(j & 255) / 255.0F; +@@ -138,7 +142,7 @@ + + if (item instanceof ItemArmor) + { +- this.func_110776_a(func_110858_a((ItemArmor)item, p_82408_2_, "overlay")); ++ this.func_110776_a(getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); + float f1 = 1.0F; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } +@@ -189,9 +193,12 @@ + this.field_77071_a.field_78116_c.func_78794_c(0.0625F); + item = itemstack1.func_77973_b(); + ++ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack1, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); ++ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack1, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); ++ + if (item instanceof ItemBlock) + { +- if (RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) + { + f1 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); +@@ -243,7 +250,10 @@ + this.field_77071_a.field_78112_f.func_78794_c(0.0625F); + GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); + +- if (item instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b())) ++ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); ++ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); ++ ++ if (item instanceof ItemBlock && (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(item).func_149645_b()))) + { + f1 = 0.5F; + GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); +@@ -292,7 +302,7 @@ + + if (itemstack.func_77973_b().func_77623_v()) + { +- for (i = 0; i <= 1; ++i) ++ for (i = 0; i < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++i) + { + int j = itemstack.func_77973_b().func_82790_a(itemstack, i); + f5 = (float)(j >> 16 & 255) / 255.0F; +@@ -350,4 +360,33 @@ + { + this.func_76986_a((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } ++ ++ /*=================================== FORGE START =========================================*/ ++ /** ++ * More generic ForgeHook version of the above function, it allows for Items to have more control over what texture they provide. ++ * ++ * @param entity Entity wearing the armor ++ * @param stack ItemStack for the armor ++ * @param slot Slot ID that the item is in ++ * @param type Subtype, can be null or "overlay" ++ * @return ResourceLocation pointing at the armor's texture ++ */ ++ public static ResourceLocation getArmorResource(Entity entity, ItemStack stack, int slot, String type) ++ { ++ ItemArmor item = (ItemArmor)stack.func_77973_b(); ++ String s1 = String.format("textures/models/armor/%s_layer_%d%s.png", ++ field_82424_k[item.field_77880_c], (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); ++ ++ s1 = net.minecraftforge.client.ForgeHooksClient.getArmorTexture(entity, stack, s1, slot, type); ++ ResourceLocation resourcelocation = (ResourceLocation)field_110859_k.get(s1); ++ ++ if (resourcelocation == null) ++ { ++ resourcelocation = new ResourceLocation(s1); ++ field_110859_k.put(s1, resourcelocation); ++ } ++ ++ return resourcelocation; ++ } ++ /*=================================== FORGE END ===========================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderItem.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderItem.java.patch new file mode 100644 index 0000000..c1a6d7b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderItem.java.patch @@ -0,0 +1,332 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderItem.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderItem.java +@@ -18,6 +18,7 @@ + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.entity.Entity; + import net.minecraft.entity.item.EntityItem; ++import net.minecraft.item.Item; + import net.minecraft.item.ItemBlock; + import net.minecraft.item.ItemCloth; + import net.minecraft.item.ItemStack; +@@ -28,6 +29,8 @@ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + ++import net.minecraftforge.client.ForgeHooksClient; ++ + @SideOnly(Side.CLIENT) + public class RenderItem extends Render + { +@@ -55,7 +58,7 @@ + TextureUtil.func_152777_a(false, false, 1.0F); + this.field_77025_h.setSeed(187L); + GL11.glPushMatrix(); +- float f2 = MathHelper.func_76126_a(((float)p_76986_1_.field_70292_b + p_76986_9_) / 10.0F + p_76986_1_.field_70290_d) * 0.1F + 0.1F; ++ float f2 = shouldBob() ? MathHelper.func_76126_a(((float)p_76986_1_.field_70292_b + p_76986_9_) / 10.0F + p_76986_1_.field_70290_d) * 0.1F + 0.1F : 0F; + float f3 = (((float)p_76986_1_.field_70292_b + p_76986_9_) / 20.0F + p_76986_1_.field_70290_d) * (180F / (float)Math.PI); + byte b0 = 1; + +@@ -79,12 +82,19 @@ + b0 = 5; + } + ++ b0 = getMiniBlockCount(itemstack, b0); ++ + GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + f2, (float)p_76986_6_); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f6; + float f7; + int k; + ++ if (ForgeHooksClient.renderEntityItem(p_76986_1_, itemstack, f2, f3, field_77025_h, field_76990_c.field_78724_e, field_147909_c, b0)) ++ { ++ ; ++ } ++ else // Code Style break here to prevent the patch from editing this line + if (itemstack.func_94608_d() == 0 && itemstack.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) + { + Block block = Block.func_149634_a(itemstack.func_77973_b()); +@@ -139,7 +149,7 @@ + { + float f5; + +- if (itemstack.func_94608_d() == 1 && itemstack.func_77973_b().func_77623_v()) ++ if (/*itemstack.getItemSpriteNumber() == 1 &&*/ itemstack.func_77973_b().func_77623_v()) + { + if (field_82407_g) + { +@@ -151,10 +161,10 @@ + GL11.glScalef(0.5F, 0.5F, 0.5F); + } + +- for (int j = 0; j <= 1; ++j) ++ for (int j = 0; j < itemstack.func_77973_b().getRenderPasses(itemstack.func_77960_j()); ++j) + { + this.field_77025_h.setSeed(187L); +- IIcon iicon1 = itemstack.func_77973_b().func_77618_c(itemstack.func_77960_j(), j); ++ IIcon iicon1 = itemstack.func_77973_b().getIcon(itemstack, j); + + if (this.field_77024_a) + { +@@ -163,11 +173,11 @@ + f6 = (float)(k >> 8 & 255) / 255.0F; + f7 = (float)(k & 255) / 255.0F; + GL11.glColor4f(f5, f6, f7, 1.0F); +- this.func_77020_a(p_76986_1_, iicon1, b0, p_76986_9_, f5, f6, f7); ++ this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, f5, f6, f7, j); + } + else + { +- this.func_77020_a(p_76986_1_, iicon1, b0, p_76986_9_, 1.0F, 1.0F, 1.0F); ++ this.renderDroppedItem(p_76986_1_, iicon1, b0, p_76986_9_, 1.0F, 1.0F, 1.0F, j); + } + } + } +@@ -226,6 +236,11 @@ + + private void func_77020_a(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_) + { ++ this.renderDroppedItem(p_77020_1_, p_77020_2_, p_77020_3_, p_77020_4_, p_77020_5_, p_77020_6_, p_77020_7_, 0); ++ } ++ ++ private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_, int pass) ++ { + Tessellator tessellator = Tessellator.field_78398_a; + + if (p_77020_2_ == null) +@@ -280,11 +295,24 @@ + b0 = 4; + } + ++ b0 = getMiniItemCount(itemstack, b0); ++ + GL11.glTranslatef(-f7, -f8, -((f9 + f10) * (float)b0 / 2.0F)); + + for (int k = 0; k < b0; ++k) + { +- GL11.glTranslatef(0.0F, 0.0F, f9 + f10); ++ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... ++ if (k > 0 && shouldSpreadItems()) ++ { ++ float x = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ float y = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ float z = (field_77025_h.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; ++ GL11.glTranslatef(x, y, f9 + f10); ++ } ++ else ++ { ++ GL11.glTranslatef(0f, 0f, f9 + f10); ++ } + + if (itemstack.func_94608_d() == 0) + { +@@ -298,7 +326,7 @@ + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + ItemRenderer.func_78439_a(tessellator, f15, f4, f14, f5, ((IIcon)p_77020_2_).func_94211_a(), ((IIcon)p_77020_2_).func_94216_b(), f9); + +- if (itemstack.func_77962_s()) ++ if (itemstack.hasEffect(pass)) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); +@@ -366,6 +394,11 @@ + + public void func_77015_a(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_) + { ++ this.renderItemIntoGUI(p_77015_1_, p_77015_2_, p_77015_3_, p_77015_4_, p_77015_5_, false); ++ } ++ ++ public void renderItemIntoGUI(FontRenderer p_77015_1_, TextureManager p_77015_2_, ItemStack p_77015_3_, int p_77015_4_, int p_77015_5_, boolean renderEffect) ++ { + int k = p_77015_3_.func_77960_j(); + Object object = p_77015_3_.func_77954_c(); + int l; +@@ -442,11 +475,13 @@ + GL11.glColorMask(true, true, true, true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); +- OpenGlHelper.func_148821_a(770, 771, 1, 0); + +- for (l = 0; l <= 1; ++l) ++ Item item = p_77015_3_.func_77973_b(); ++ for (l = 0; l < item.getRenderPasses(k); ++l) + { +- IIcon iicon = p_77015_3_.func_77973_b().func_77618_c(k, l); ++ OpenGlHelper.func_148821_a(770, 771, 1, 0); ++ p_77015_2_.func_110577_a(item.func_94901_k() == 0 ? TextureMap.field_110575_b : TextureMap.field_110576_c); ++ IIcon iicon = item.getIcon(p_77015_3_, l); + int i1 = p_77015_3_.func_77973_b().func_82790_a(p_77015_3_, l); + f = (float)(i1 >> 16 & 255) / 255.0F; + float f1 = (float)(i1 >> 8 & 255) / 255.0F; +@@ -457,7 +492,18 @@ + GL11.glColor4f(f, f1, f2, 1.0F); + } + ++ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, ad renderEffect can derp them up. ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ + this.func_94149_a(p_77015_4_, p_77015_5_, iicon, 16, 16); ++ ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ ++ if (renderEffect && p_77015_3_.hasEffect(l)) ++ { ++ renderEffect(p_77015_2_, p_77015_4_, p_77015_5_); ++ } + } + + GL11.glEnable(GL11.GL_LIGHTING); +@@ -485,14 +531,27 @@ + GL11.glColor4f(f3, f4, f, 1.0F); + } + ++ GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure that render states are reset, a renderEffect can derp them up. ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ + this.func_94149_a(p_77015_4_, p_77015_5_, (IIcon)object, 16, 16); ++ + GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); ++ ++ if (renderEffect && p_77015_3_.hasEffect(0)) ++ { ++ renderEffect(p_77015_2_, p_77015_4_, p_77015_5_); ++ } ++ GL11.glEnable(GL11.GL_LIGHTING); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + } + ++ @SuppressWarnings("unused") + public void func_82406_b(FontRenderer p_82406_1_, TextureManager p_82406_2_, final ItemStack p_82406_3_, int p_82406_4_, int p_82406_5_) + { + if (p_82406_3_ != null) +@@ -501,7 +560,10 @@ + + try + { +- this.func_77015_a(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_); ++ if (!ForgeHooksClient.renderInventoryItem(this.field_147909_c, p_82406_2_, p_82406_3_, field_77024_a, field_77023_b, (float)p_82406_4_, (float)p_82406_5_)) ++ { ++ this.renderItemIntoGUI(p_82406_1_, p_82406_2_, p_82406_3_, p_82406_4_, p_82406_5_, true); ++ } + } + catch (Throwable throwable) + { +@@ -542,7 +604,8 @@ + throw new ReportedException(crashreport); + } + +- if (p_82406_3_.func_77962_s()) ++ // Forge: Bugfix, Move this to a per-render pass, modders must handle themselves ++ if (false && p_82406_3_.func_77962_s()) + { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); +@@ -562,6 +625,23 @@ + } + } + ++ public void renderEffect(TextureManager manager, int x, int y) ++ { ++ GL11.glDepthFunc(GL11.GL_EQUAL); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDepthMask(false); ++ manager.func_110577_a(field_110798_h); ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); ++ this.func_77018_a(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); ++ GL11.glDepthMask(true); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glDepthFunc(GL11.GL_LEQUAL); ++ } ++ + private void func_77018_a(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) + { + for (int j1 = 0; j1 < 2; ++j1) +@@ -608,10 +688,11 @@ + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + +- if (p_94148_3_.func_77951_h()) ++ if (p_94148_3_.func_77973_b().showDurabilityBar(p_94148_3_)) + { +- int j1 = (int)Math.round(13.0D - (double)p_94148_3_.func_77952_i() * 13.0D / (double)p_94148_3_.func_77958_k()); +- int k = (int)Math.round(255.0D - (double)p_94148_3_.func_77952_i() * 255.0D / (double)p_94148_3_.func_77958_k()); ++ double health = p_94148_3_.func_77973_b().getDurabilityForDisplay(p_94148_3_); ++ int j1 = (int)Math.round(13.0D - health * 13.0D); ++ int k = (int)Math.round(255.0D - health * 255.0D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDisable(GL11.GL_TEXTURE_2D); +@@ -623,7 +704,7 @@ + this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 13, 2, 0); + this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, 12, 1, i1); + this.func_77017_a(tessellator, p_94148_4_ + 2, p_94148_5_ + 13, j1, 1, l); +- GL11.glEnable(GL11.GL_BLEND); ++ //GL11.glEnable(GL11.GL_BLEND); // Forge: Disable Bled because it screws with a lot of things down the line. + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_LIGHTING); +@@ -664,4 +745,54 @@ + { + this.func_76986_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } ++ ++ /*==================================== FORGE START ===========================================*/ ++ ++ /** ++ * Items should spread out when rendered in 3d? ++ * @return ++ */ ++ public boolean shouldSpreadItems() ++ { ++ return true; ++ } ++ ++ /** ++ * Items should have a bob effect ++ * @return ++ */ ++ public boolean shouldBob() ++ { ++ return true; ++ } ++ ++ public byte getMiniBlockCount(ItemStack stack, byte original) ++ { ++ return original; ++ } ++ ++ /** ++ * Allows for a subclass to override how many rendered items appear in a ++ * "mini item 3d stack" ++ * @param stack The item stack ++ * @param original The default amount vanilla would use ++ * @return ++ */ ++ public byte getMiniItemCount(ItemStack stack, byte original) ++ { ++ return original; ++ } ++ ++ private static RenderItem instance; ++ /** ++ * Returns a single lazy loaded instance of RenderItem, for use in mods who ++ * don't care about the interaction of other objects on the current state of the RenderItem they are using. ++ * @return A global instance of RenderItem ++ */ ++ public static RenderItem getInstance() ++ { ++ if (instance == null) instance = new RenderItem(); ++ return instance; ++ } ++ /*==================================== FORGE END =============================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderManager.java.patch new file mode 100644 index 0000000..c23b896 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderManager.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java +@@ -212,11 +212,13 @@ + if (p_147938_4_.func_70608_bn()) + { + Block block = p_147938_1_.func_147439_a(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v)); ++ int x = MathHelper.func_76128_c(p_147938_4_.field_70165_t); ++ int y = MathHelper.func_76128_c(p_147938_4_.field_70163_u); ++ int z = MathHelper.func_76128_c(p_147938_4_.field_70161_v); + +- if (block == Blocks.field_150324_C) ++ if (block.isBed(p_147938_1_, x, y, z, p_147938_4_)) + { +- int i = p_147938_1_.func_72805_g(MathHelper.func_76128_c(p_147938_4_.field_70165_t), MathHelper.func_76128_c(p_147938_4_.field_70163_u), MathHelper.func_76128_c(p_147938_4_.field_70161_v)); +- int j = i & 3; ++ int j = block.getBedDirection(p_147938_1_, x, y, z); + this.field_78735_i = (float)(j * 90 + 180); + this.field_78732_j = 0.0F; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderPlayer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderPlayer.java.patch new file mode 100644 index 0000000..d98717b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderPlayer.java.patch @@ -0,0 +1,143 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderPlayer.java +@@ -50,6 +50,13 @@ + { + ItemStack itemstack = p_77032_1_.field_71071_by.func_70440_f(3 - p_77032_2_); + ++ net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel event = new net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel(p_77032_1_, this, 3 - p_77032_2_, p_77032_3_, itemstack); ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); ++ if (event.result != -1) ++ { ++ return event.result; ++ } ++ + if (itemstack != null) + { + Item item = itemstack.func_77973_b(); +@@ -57,7 +64,7 @@ + if (item instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor)item; +- this.func_110776_a(RenderBiped.func_110857_a(itemarmor, p_77032_2_)); ++ this.func_110776_a(RenderBiped.getArmorResource(p_77032_1_, itemstack, p_77032_2_, null)); + ModelBiped modelbiped = p_77032_2_ == 2 ? this.field_77111_i : this.field_77108_b; + modelbiped.field_78116_c.field_78806_j = p_77032_2_ == 0; + modelbiped.field_78114_d.field_78806_j = p_77032_2_ == 0; +@@ -66,14 +73,16 @@ + modelbiped.field_78113_g.field_78806_j = p_77032_2_ == 1; + modelbiped.field_78123_h.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3; + modelbiped.field_78124_i.field_78806_j = p_77032_2_ == 2 || p_77032_2_ == 3; ++ modelbiped = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_77032_1_, itemstack, p_77032_2_, modelbiped); + this.func_77042_a(modelbiped); + modelbiped.field_78095_p = this.field_77045_g.field_78095_p; + modelbiped.field_78093_q = this.field_77045_g.field_78093_q; + modelbiped.field_78091_s = this.field_77045_g.field_78091_s; + +- if (itemarmor.func_82812_d() == ItemArmor.ArmorMaterial.CLOTH) ++ //Move outside if to allow for more then just CLOTH ++ int j = itemarmor.func_82814_b(itemstack); ++ if (j != -1) + { +- int j = itemarmor.func_82814_b(itemstack); + float f1 = (float)(j >> 16 & 255) / 255.0F; + float f2 = (float)(j >> 8 & 255) / 255.0F; + float f3 = (float)(j & 255) / 255.0F; +@@ -111,7 +120,7 @@ + + if (item instanceof ItemArmor) + { +- this.func_110776_a(RenderBiped.func_110858_a((ItemArmor)item, p_82408_2_, "overlay")); ++ this.func_110776_a(RenderBiped.getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } +@@ -119,6 +128,7 @@ + + public void func_76986_a(AbstractClientPlayer p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Pre(p_76986_1_, this, p_76986_9_))) return; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + ItemStack itemstack = p_76986_1_.field_71071_by.func_70448_g(); + this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = itemstack != null ? 1 : 0; +@@ -149,6 +159,7 @@ + this.field_77108_b.field_78118_o = this.field_77111_i.field_78118_o = this.field_77109_a.field_78118_o = false; + this.field_77108_b.field_78117_n = this.field_77111_i.field_78117_n = this.field_77109_a.field_78117_n = false; + this.field_77108_b.field_78120_m = this.field_77111_i.field_78120_m = this.field_77109_a.field_78120_m = 0; ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Post(p_76986_1_, this, p_76986_9_)); + } + + protected ResourceLocation func_110775_a(AbstractClientPlayer p_110775_1_) +@@ -158,12 +169,14 @@ + + protected void func_77029_c(AbstractClientPlayer p_77029_1_, float p_77029_2_) + { ++ net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre event = new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre(p_77029_1_, this, p_77029_2_); ++ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) return; + GL11.glColor3f(1.0F, 1.0F, 1.0F); + super.func_77029_c(p_77029_1_, p_77029_2_); + super.func_85093_e(p_77029_1_, p_77029_2_); + ItemStack itemstack = p_77029_1_.field_71071_by.func_70440_f(3); + +- if (itemstack != null) ++ if (itemstack != null && event.renderHelmet) + { + GL11.glPushMatrix(); + this.field_77109_a.field_78116_c.func_78794_c(0.0625F); +@@ -171,7 +184,10 @@ + + if (itemstack.func_77973_b() instanceof ItemBlock) + { +- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) ++ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); ++ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); ++ ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) + { + f1 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); +@@ -232,6 +248,7 @@ + } + + boolean flag = p_77029_1_.func_152122_n(); ++ flag = event.renderCape && flag; + float f4; + + if (flag && !p_77029_1_.func_82150_aj() && !p_77029_1_.func_82238_cc()) +@@ -283,7 +300,7 @@ + + ItemStack itemstack1 = p_77029_1_.field_71071_by.func_70448_g(); + +- if (itemstack1 != null) ++ if (itemstack1 != null && event.renderItem) + { + GL11.glPushMatrix(); + this.field_77109_a.field_78112_f.func_78794_c(0.0625F); +@@ -301,7 +318,10 @@ + enumaction = itemstack1.func_77975_n(); + } + +- if (itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b())) ++ net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(itemstack1, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); ++ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, itemstack1, net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); ++ ++ if (is3D || itemstack1.func_77973_b() instanceof ItemBlock && RenderBlocks.func_147739_a(Block.func_149634_a(itemstack1.func_77973_b()).func_149645_b())) + { + f2 = 0.5F; + GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); +@@ -358,7 +378,7 @@ + + if (itemstack1.func_77973_b().func_77623_v()) + { +- for (k = 0; k <= 1; ++k) ++ for (k = 0; k < itemstack1.func_77973_b().getRenderPasses(itemstack1.func_77960_j()); ++k) + { + int i = itemstack1.func_77973_b().func_82790_a(itemstack1, k); + f12 = (float)(i >> 16 & 255) / 255.0F; +@@ -380,6 +400,7 @@ + + GL11.glPopMatrix(); + } ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderPlayerEvent.Specials.Post(p_77029_1_, this, p_77029_2_)); + } + + protected void func_77041_b(AbstractClientPlayer p_77041_1_, float p_77041_2_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch new file mode 100644 index 0000000..3a7a58b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch @@ -0,0 +1,25 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderSnowMan.java +@@ -13,6 +13,10 @@ + import net.minecraft.item.ItemStack; + import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; ++import net.minecraftforge.client.IItemRenderer; ++import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; ++import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; ++import net.minecraftforge.client.MinecraftForgeClient; + + @SideOnly(Side.CLIENT) + public class RenderSnowMan extends RenderLiving +@@ -38,7 +42,10 @@ + GL11.glPushMatrix(); + this.field_77094_a.field_78195_c.func_78794_c(0.0625F); + +- if (RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) ++ IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED); ++ boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D)); ++ ++ if (is3D || RenderBlocks.func_147739_a(Block.func_149634_a(itemstack.func_77973_b()).func_149645_b())) + { + float f1 = 0.625F; + GL11.glTranslatef(0.0F, -0.34375F, 0.0F); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch new file mode 100644 index 0000000..a0a91f6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch @@ -0,0 +1,63 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RendererLivingEntity.java +@@ -20,6 +20,9 @@ + import net.minecraft.util.ResourceLocation; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; ++import net.minecraftforge.client.event.RenderLivingEvent; ++import net.minecraftforge.common.MinecraftForge; ++ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + +@@ -32,6 +35,9 @@ + protected ModelBase field_77046_h; + private static final String __OBFID = "CL_00001012"; + ++ public static float NAME_TAG_RANGE = 64.0f; ++ public static float NAME_TAG_RANGE_SNEAK = 32.0f; ++ + public RendererLivingEntity(ModelBase p_i1261_1_, float p_i1261_2_) + { + this.field_77045_g = p_i1261_1_; +@@ -62,6 +68,7 @@ + + public void func_76986_a(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { ++ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_))) return; + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + this.field_77045_g.field_78095_p = this.func_77040_d(p_76986_1_, p_76986_9_); +@@ -271,6 +278,7 @@ + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + this.func_77033_b(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); ++ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(p_76986_1_, this, p_76986_2_, p_76986_4_, p_76986_6_)); + } + + protected void func_77036_a(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) +@@ -416,6 +424,7 @@ + + protected void func_77033_b(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_) + { ++ if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Pre(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_))) return; + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + + if (this.func_110813_b(p_77033_1_)) +@@ -423,7 +432,7 @@ + float f = 1.6F; + float f1 = 0.016666668F * f; + double d3 = p_77033_1_.func_70068_e(this.field_76990_c.field_78734_h); +- float f2 = p_77033_1_.func_70093_af() ? 32.0F : 64.0F; ++ float f2 = p_77033_1_.func_70093_af() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE; + + if (d3 < (double)(f2 * f2)) + { +@@ -467,6 +476,7 @@ + } + } + } ++ MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Specials.Post(p_77033_1_, this, p_77033_2_, p_77033_4_, p_77033_6_)); + } + + protected boolean func_110813_b(EntityLivingBase p_110813_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch new file mode 100644 index 0000000..6b84351 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch @@ -0,0 +1,46 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureAtlasSprite.java +@@ -8,12 +8,14 @@ + import java.util.Iterator; + import java.util.List; + import java.util.concurrent.Callable; ++import net.minecraft.client.resources.IResourceManager; + import net.minecraft.client.resources.data.AnimationFrame; + import net.minecraft.client.resources.data.AnimationMetadataSection; + import net.minecraft.crash.CrashReport; + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.util.IIcon; + import net.minecraft.util.ReportedException; ++import net.minecraft.util.ResourceLocation; + + @SideOnly(Side.CLIENT) + public class TextureAtlasSprite implements IIcon +@@ -427,4 +429,28 @@ + { + return "TextureAtlasSprite{name=\'" + this.field_110984_i + '\'' + ", frameCount=" + this.field_110976_a.size() + ", rotated=" + this.field_130222_e + ", x=" + this.field_110975_c + ", y=" + this.field_110974_d + ", height=" + this.field_130224_d + ", width=" + this.field_130223_c + ", u0=" + this.field_110979_l + ", u1=" + this.field_110980_m + ", v0=" + this.field_110977_n + ", v1=" + this.field_110978_o + '}'; + } ++ ++ /** ++ * The result of this function determines is the below 'load' function is called, and the ++ * default vanilla loading code is bypassed completely. ++ * @param manager ++ * @param location ++ * @return True to use your own custom load code and bypass vanilla loading. ++ */ ++ public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) ++ { ++ return false; ++ } ++ ++ /** ++ * Load the specified resource as this sprite's data. ++ * Returning false from this function will prevent this icon from being stitched onto the master texture. ++ * @param manager Main resource manager ++ * @param location File resource location ++ * @return False to prevent this Icon from being stitched ++ */ ++ public boolean load(IResourceManager manager, ResourceLocation location) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureMap.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureMap.java.patch new file mode 100644 index 0000000..75ee568 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -0,0 +1,97 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +@@ -29,6 +29,7 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.util.ReportedException; + import net.minecraft.util.ResourceLocation; ++import net.minecraftforge.client.ForgeHooksClient; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -98,11 +99,14 @@ + + public void func_110571_b(IResourceManager p_110571_1_) + { ++ func_110573_f(); //Re-gather list of Icons, allows for addition/removal of blocks/items after this map was initially constructed. ++ + int i = Minecraft.func_71369_N(); + Stitcher stitcher = new Stitcher(i, i, true, 0, this.field_147636_j); + this.field_94252_e.clear(); + this.field_94258_i.clear(); + int j = Integer.MAX_VALUE; ++ ForgeHooksClient.onTextureStitchedPre(this); + cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Texture Loading", skipFirst ? 0 : this.field_110574_e.size()); + Iterator iterator = this.field_110574_e.entrySet().iterator(); + TextureAtlasSprite textureatlassprite; +@@ -115,6 +119,16 @@ + ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); + bar.step(resourcelocation1.func_110623_a()); + ++ if (textureatlassprite.hasCustomLoader(p_110571_1_, resourcelocation)) ++ { ++ if (!textureatlassprite.load(p_110571_1_, resourcelocation)) ++ { ++ j = Math.min(j, Math.min(textureatlassprite.func_94211_a(), textureatlassprite.func_94216_b())); ++ stitcher.func_110934_a(textureatlassprite); ++ } ++ continue; ++ } ++ + try + { + IResource iresource = p_110571_1_.func_110536_a(resourcelocation1); +@@ -294,6 +308,7 @@ + textureatlassprite = (TextureAtlasSprite)iterator2.next(); + textureatlassprite.func_94217_a(this.field_94249_f); + } ++ ForgeHooksClient.onTextureStitchedPost(this); + cpw.mods.fml.common.ProgressManager.pop(bar); + } + +@@ -368,7 +383,7 @@ + { + throw new IllegalArgumentException("Name cannot be null!"); + } +- else if (p_94245_1_.indexOf(47) == -1 && p_94245_1_.indexOf(92) == -1) ++ else if (p_94245_1_.indexOf(92) == -1) // Disable backslashes (\) in texture asset paths. + { + Object object = (TextureAtlasSprite)this.field_110574_e.get(p_94245_1_); + +@@ -424,4 +439,37 @@ + { + this.field_147637_k = p_147632_1_; + } ++ ++ //=================================================================================================== ++ // Forge Start ++ //=================================================================================================== ++ /** ++ * Grabs the registered entry for the specified name, returning null if there was not a entry. ++ * Opposed to registerIcon, this will not instantiate the entry, useful to test if a mapping exists. ++ * ++ * @param name The name of the entry to find ++ * @return The registered entry, null if nothing was registered. ++ */ ++ public TextureAtlasSprite getTextureExtry(String name) ++ { ++ return (TextureAtlasSprite)field_110574_e.get(name); ++ } ++ ++ /** ++ * Adds a texture registry entry to this map for the specified name if one does not already exist. ++ * Returns false if the map already contains a entry for the specified name. ++ * ++ * @param name Entry name ++ * @param entry Entry instance ++ * @return True if the entry was added to the map, false otherwise. ++ */ ++ public boolean setTextureEntry(String name, TextureAtlasSprite entry) ++ { ++ if (!field_110574_e.containsKey(name)) ++ { ++ field_110574_e.put(name, entry); ++ return true; ++ } ++ return false; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch new file mode 100644 index 0000000..1093c06 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/RenderItemFrame.java +@@ -176,6 +176,9 @@ + GL11.glTranslatef(0.16F, -0.16F, 0.0F); + } + ++ net.minecraftforge.client.event.RenderItemInFrameEvent event = new net.minecraftforge.client.event.RenderItemInFrameEvent(p_82402_1_, this); ++ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event)) ++ { + if (item == Items.field_151098_aY) + { + this.field_76990_c.field_78724_e.func_110577_a(field_110789_a); +@@ -244,6 +247,7 @@ + } + } + } ++ } + + GL11.glPopMatrix(); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch new file mode 100644 index 0000000..c5ccfbc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java +@@ -1,5 +1,6 @@ + package net.minecraft.client.renderer.tileentity; + ++import cpw.mods.fml.common.FMLLog; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.Calendar; +@@ -52,7 +53,14 @@ + + if (block instanceof BlockChest && i == 0) + { ++ try ++ { + ((BlockChest)block).func_149954_e(p_147500_1_.func_145831_w(), p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e); ++ } ++ catch (ClassCastException e) ++ { ++ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest", p_147500_1_.field_145851_c, p_147500_1_.field_145848_d, p_147500_1_.field_145849_e); ++ } + i = p_147500_1_.func_145832_p(); + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/shader/Framebuffer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/shader/Framebuffer.java.patch new file mode 100644 index 0000000..a0449e2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/shader/Framebuffer.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/shader/Framebuffer.java ++++ ../src-work/minecraft/net/minecraft/client/shader/Framebuffer.java +@@ -117,8 +117,17 @@ + if (this.field_147619_e) + { + OpenGlHelper.func_153176_h(OpenGlHelper.field_153199_f, this.field_147624_h); ++ if (net.minecraftforge.client.MinecraftForgeClient.getStencilBits() == 0) ++ { + OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, 33190, this.field_147622_a, this.field_147620_b); + OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, OpenGlHelper.field_153201_h, OpenGlHelper.field_153199_f, this.field_147624_h); ++ } ++ else ++ { ++ OpenGlHelper.func_153186_a(OpenGlHelper.field_153199_f, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.field_147622_a, this.field_147620_b); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); ++ OpenGlHelper.func_153190_b(OpenGlHelper.field_153198_e, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.field_153199_f, this.field_147624_h); ++ } + } + + this.func_147614_f(); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandEnchant.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandEnchant.java.patch new file mode 100644 index 0000000..7e5175c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandEnchant.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/command/CommandEnchant.java ++++ ../src-work/minecraft/net/minecraft/command/CommandEnchant.java +@@ -76,7 +76,7 @@ + { + Enchantment enchantment1 = Enchantment.field_77331_b[short1]; + +- if (!enchantment1.func_77326_a(enchantment)) ++ if (!enchantment1.func_77326_a(enchantment) || !enchantment.func_77326_a(enchantment1)) //Forge BugFix: Let Both enchantments veto being together + { + throw new CommandException("commands.enchant.cantCombine", new Object[] {enchantment.func_77316_c(j), enchantment1.func_77316_c(nbttaglist.func_150305_b(k).func_74765_d("lvl"))}); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandHandler.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandHandler.java.patch new file mode 100644 index 0000000..78f0141 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandHandler.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/command/CommandHandler.java ++++ ../src-work/minecraft/net/minecraft/command/CommandHandler.java +@@ -14,6 +14,9 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.CommandEvent; ++ + public class CommandHandler implements ICommandManager + { + private static final Logger field_147175_a = LogManager.getLogger(); +@@ -47,6 +50,16 @@ + + if (icommand.func_71519_b(p_71556_1_)) + { ++ CommandEvent event = new CommandEvent(icommand, p_71556_1_, astring); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ if (event.exception != null) ++ { ++ throw event.exception; ++ } ++ return 1; ++ } ++ + if (i > -1) + { + EntityPlayerMP[] aentityplayermp = PlayerSelector.func_82380_c(p_71556_1_, astring[i]); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/crash/CrashReportCategory.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/crash/CrashReportCategory.java.patch new file mode 100644 index 0000000..2294ae8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/crash/CrashReportCategory.java.patch @@ -0,0 +1,16 @@ +--- ../src-base/minecraft/net/minecraft/crash/CrashReportCategory.java ++++ ../src-work/minecraft/net/minecraft/crash/CrashReportCategory.java +@@ -127,8 +127,11 @@ + } + else + { +- this.field_85075_d = new StackTraceElement[astacktraceelement.length - 3 - p_85073_1_]; +- System.arraycopy(astacktraceelement, 3 + p_85073_1_, this.field_85075_d, 0, this.field_85075_d.length); ++ int len = astacktraceelement.length - 3 - p_85073_1_; ++ // Really Mojang, Still, god damn... ++ if (len <= 0) len = astacktraceelement.length; ++ this.field_85075_d = new StackTraceElement[len]; ++ System.arraycopy(astacktraceelement, astacktraceelement.length - len, this.field_85075_d, 0, this.field_85075_d.length); + return this.field_85075_d.length; + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/creativetab/CreativeTabs.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/creativetab/CreativeTabs.java.patch new file mode 100644 index 0000000..5cf367d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/creativetab/CreativeTabs.java.patch @@ -0,0 +1,107 @@ +--- ../src-base/minecraft/net/minecraft/creativetab/CreativeTabs.java ++++ ../src-work/minecraft/net/minecraft/creativetab/CreativeTabs.java +@@ -138,8 +138,22 @@ + private ItemStack field_151245_t; + private static final String __OBFID = "CL_00000005"; + ++ public CreativeTabs(String lable) ++ { ++ this(getNextID(), lable); ++ } ++ + public CreativeTabs(int p_i1853_1_, String p_i1853_2_) + { ++ if (p_i1853_1_ >= field_78032_a.length) ++ { ++ CreativeTabs[] tmp = new CreativeTabs[p_i1853_1_ + 1]; ++ for (int x = 0; x < field_78032_a.length; x++) ++ { ++ tmp[x] = field_78032_a[x]; ++ } ++ field_78032_a = tmp; ++ } + this.field_78033_n = p_i1853_1_; + this.field_78034_o = p_i1853_2_; + field_78032_a[p_i1853_1_] = this; +@@ -222,12 +236,20 @@ + @SideOnly(Side.CLIENT) + public int func_78020_k() + { ++ if (field_78033_n > 11) ++ { ++ return ((field_78033_n - 12) % 10) % 5; ++ } + return this.field_78033_n % 6; + } + + @SideOnly(Side.CLIENT) + public boolean func_78023_l() + { ++ if (field_78033_n > 11) ++ { ++ return ((field_78033_n - 12) % 10) < 5; ++ } + return this.field_78033_n < 6; + } + +@@ -278,10 +300,18 @@ + { + Item item = (Item)iterator.next(); + +- if (item != null && item.func_77640_w() == this) ++ if (item == null) + { +- item.func_150895_a(item, this, p_78018_1_); ++ continue; + } ++ ++ for (CreativeTabs tab : item.getCreativeTabs()) ++ { ++ if (tab == this) ++ { ++ item.func_150895_a(item, this, p_78018_1_); ++ } ++ } + } + + if (this.func_111225_m() != null) +@@ -319,4 +349,39 @@ + } + } + } ++ ++ public int getTabPage() ++ { ++ if (field_78033_n > 11) ++ { ++ return ((field_78033_n - 12) / 10) + 1; ++ } ++ return 0; ++ } ++ ++ public static int getNextID() ++ { ++ return field_78032_a.length; ++ } ++ ++ /** ++ * Determines if the search bar should be shown for this tab. ++ * ++ * @return True to show the bar ++ */ ++ public boolean hasSearchBar() ++ { ++ return field_78033_n == CreativeTabs.field_78027_g.field_78033_n; ++ } ++ ++ /** ++ * Gets the width of the search bar of the creative tab, use this if your ++ * creative tab name overflows together with a custom texture. ++ * ++ * @return The width of the search bar, 89 by default ++ */ ++ public int getSearchbarWidth() ++ { ++ return 89; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/Enchantment.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/Enchantment.java.patch new file mode 100644 index 0000000..94cf163 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/Enchantment.java.patch @@ -0,0 +1,57 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/Enchantment.java ++++ ../src-work/minecraft/net/minecraft/enchantment/Enchantment.java +@@ -50,7 +50,7 @@ + + if (field_77331_b[p_i1926_1_] != null) + { +- throw new IllegalArgumentException("Duplicate enchantment id!"); ++ throw new IllegalArgumentException("Duplicate enchantment id! " + this.getClass() + " and " + field_77331_b[p_i1926_1_].getClass() + " Enchantment ID:" + p_i1926_1_); + } + else + { +@@ -124,6 +124,45 @@ + + public void func_151367_b(EntityLivingBase p_151367_1_, Entity p_151367_2_, int p_151367_3_) {} + ++ /** ++ * This applies specifically to applying at the enchanting table. The other method {@link #canApply(ItemStack)} ++ * applies for all possible enchantments. ++ * @param stack ++ * @return ++ */ ++ public boolean canApplyAtEnchantingTable(ItemStack stack) ++ { ++ return func_92089_a(stack); ++ } ++ ++ private static final java.lang.reflect.Field bookSetter = Enchantment.class.getDeclaredFields()[1]; ++ /** ++ * Add to the list of enchantments applicable by the anvil from a book ++ * ++ * @param enchantment ++ */ ++ public static void addToBookList(Enchantment enchantment) ++ { ++ try ++ { ++ net.minecraftforge.common.util.EnumHelper.setFailsafeFieldValue(bookSetter, null, ++ com.google.common.collect.ObjectArrays.concat(field_92090_c, enchantment)); ++ } ++ catch (Exception e) ++ { ++ throw new RuntimeException(e); //Rethrow see what happens ++ } ++ } ++ ++ /** ++ * Is this enchantment allowed to be enchanted on books via Enchantment Table ++ * @return false to disable the vanilla feature ++ */ ++ public boolean isAllowedOnBooks() ++ { ++ return true; ++ } ++ + static + { + ArrayList var0 = new ArrayList(); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/EnchantmentHelper.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/EnchantmentHelper.java.patch new file mode 100644 index 0000000..f400f35 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/EnchantmentHelper.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentHelper.java ++++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentHelper.java +@@ -293,7 +293,7 @@ + public static int func_77514_a(Random p_77514_0_, int p_77514_1_, int p_77514_2_, ItemStack p_77514_3_) + { + Item item = p_77514_3_.func_77973_b(); +- int k = item.func_77619_b(); ++ int k = item.getItemEnchantability(p_77514_3_); + + if (k <= 0) + { +@@ -346,7 +346,7 @@ + public static List func_77513_b(Random p_77513_0_, ItemStack p_77513_1_, int p_77513_2_) + { + Item item = p_77513_1_.func_77973_b(); +- int j = item.func_77619_b(); ++ int j = item.getItemEnchantability(p_77513_1_); + + if (j <= 0) + { +@@ -393,7 +393,9 @@ + { + EnchantmentData enchantmentdata1 = (EnchantmentData)iterator1.next(); + +- if (enchantmentdata1.field_76302_b.func_77326_a(Enchantment.field_77331_b[integer.intValue()])) ++ Enchantment e1 = enchantmentdata1.field_76302_b; ++ Enchantment e2 = Enchantment.field_77331_b[integer.intValue()]; ++ if (e1.func_77326_a(e2) && e2.func_77326_a(e1)) //Forge BugFix: Let Both enchantments veto being together + { + continue; + } +@@ -435,7 +437,8 @@ + { + Enchantment enchantment = aenchantment[k]; + +- if (enchantment != null && (enchantment.field_77351_y.func_77557_a(item) || flag)) ++ if (enchantment == null) continue; ++ if (enchantment.canApplyAtEnchantingTable(p_77505_1_) || ((item == Items.field_151122_aG) && enchantment.isAllowedOnBooks())) + { + for (int l = enchantment.func_77319_d(); l <= enchantment.func_77325_b(); ++l) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/Entity.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/Entity.java.patch new file mode 100644 index 0000000..82cb0dd --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/Entity.java.patch @@ -0,0 +1,372 @@ +--- ../src-base/minecraft/net/minecraft/entity/Entity.java ++++ ../src-work/minecraft/net/minecraft/entity/Entity.java +@@ -1,7 +1,10 @@ + package net.minecraft.entity; + ++import cpw.mods.fml.common.FMLLog; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; ++import java.util.HashMap; + import java.util.List; + import java.util.Random; + import java.util.UUID; +@@ -13,9 +16,14 @@ + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.enchantment.EnchantmentProtection; + import net.minecraft.entity.effect.EntityLightningBolt; ++import net.minecraft.entity.item.EntityBoat; + import net.minecraft.entity.item.EntityItem; ++import net.minecraft.entity.item.EntityItemFrame; ++import net.minecraft.entity.item.EntityMinecart; ++import net.minecraft.entity.item.EntityPainting; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; ++import net.minecraft.init.Items; + import net.minecraft.item.Item; + import net.minecraft.item.ItemStack; + import net.minecraft.nbt.NBTTagCompound; +@@ -30,12 +38,17 @@ + import net.minecraft.util.Direction; + import net.minecraft.util.IChatComponent; + import net.minecraft.util.MathHelper; ++import net.minecraft.util.MovingObjectPosition; + import net.minecraft.util.ReportedException; + import net.minecraft.util.StatCollector; + import net.minecraft.util.Vec3; + import net.minecraft.world.Explosion; + import net.minecraft.world.World; + import net.minecraft.world.WorldServer; ++import net.minecraftforge.common.IExtendedEntityProperties; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.EntityEvent; ++import net.minecraftforge.fluids.IFluidBlock; + + public abstract class Entity + { +@@ -116,7 +129,14 @@ + protected UUID field_96093_i; + public Entity.EnumEntitySize field_70168_am; + private static final String __OBFID = "CL_00001533"; ++ /** Forge: Used to store custom data for each entity. */ ++ private NBTTagCompound customEntityData; ++ public boolean captureDrops = false; ++ public ArrayList capturedDrops = new ArrayList(); ++ private UUID persistentID; + ++ protected HashMap extendedProperties; ++ + public int func_145782_y() + { + return this.field_145783_c; +@@ -153,6 +173,15 @@ + this.field_70180_af.func_75682_a(0, Byte.valueOf((byte)0)); + this.field_70180_af.func_75682_a(1, Short.valueOf((short)300)); + this.func_70088_a(); ++ ++ extendedProperties = new HashMap(); ++ ++ MinecraftForge.EVENT_BUS.post(new EntityEvent.EntityConstructing(this)); ++ ++ for (IExtendedEntityProperties props : this.extendedProperties.values()) ++ { ++ props.init(this, p_i1582_1_); ++ } + } + + protected abstract void func_70088_a(); +@@ -991,9 +1020,22 @@ + + if (block.func_149688_o() == p_70055_1_) + { +- float f = BlockLiquid.func_149801_b(this.field_70170_p.func_72805_g(i, j, k)) - 0.11111111F; +- float f1 = (float)(j + 1) - f; +- return d0 < (double)f1; ++ double filled = 1.0f; //If it's not a liquid assume it's a solid block ++ if (block instanceof IFluidBlock) ++ { ++ filled = ((IFluidBlock)block).getFilledPercentage(field_70170_p, i, j, k); ++ } ++ ++ if (filled < 0) ++ { ++ filled *= -1; ++ //filled -= 0.11111111F; //Why this is needed.. not sure... ++ return d0 > (double)(j + (1 - filled)); ++ } ++ else ++ { ++ return d0 < (double)(j + filled); ++ } + } + else + { +@@ -1278,8 +1320,27 @@ + p_70109_1_.func_74768_a("PortalCooldown", this.field_71088_bW); + p_70109_1_.func_74772_a("UUIDMost", this.func_110124_au().getMostSignificantBits()); + p_70109_1_.func_74772_a("UUIDLeast", this.func_110124_au().getLeastSignificantBits()); +- this.func_70014_b(p_70109_1_); ++ if (customEntityData != null) ++ { ++ p_70109_1_.func_74782_a("ForgeData", customEntityData); ++ } + ++ for (String identifier : this.extendedProperties.keySet()) ++ { ++ try ++ { ++ IExtendedEntityProperties props = this.extendedProperties.get(identifier); ++ props.saveNBTData(p_70109_1_); ++ } ++ catch (Throwable t) ++ { ++ FMLLog.severe("Failed to save extended properties for %s. This is a mod issue.", identifier); ++ t.printStackTrace(); ++ } ++ } ++ ++ this.func_70014_b(p_70109_1_); ++ + if (this.field_70154_o != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); +@@ -1345,6 +1406,30 @@ + + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.func_70101_b(this.field_70177_z, this.field_70125_A); ++ if (p_70020_1_.func_74764_b("ForgeData")) ++ { ++ customEntityData = p_70020_1_.func_74775_l("ForgeData"); ++ } ++ ++ for (String identifier : this.extendedProperties.keySet()) ++ { ++ try ++ { ++ IExtendedEntityProperties props = this.extendedProperties.get(identifier); ++ props.loadNBTData(p_70020_1_); ++ } ++ catch (Throwable t) ++ { ++ FMLLog.severe("Failed to load extended properties for %s. This is a mod issue.", identifier); ++ t.printStackTrace(); ++ } ++ } ++ ++ //Rawr, legacy code, Vanilla added a UUID, keep this so older maps will convert properly ++ if (p_70020_1_.func_74764_b("PersistentIDMSB") && p_70020_1_.func_74764_b("PersistentIDLSB")) ++ { ++ this.field_96093_i = new UUID(p_70020_1_.func_74763_f("PersistentIDMSB"), p_70020_1_.func_74763_f("PersistentIDLSB")); ++ } + this.func_70037_a(p_70020_1_); + + if (this.func_142008_O()) +@@ -1423,7 +1508,14 @@ + { + EntityItem entityitem = new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)p_70099_2_, this.field_70161_v, p_70099_1_); + entityitem.field_145804_b = 10; +- this.field_70170_p.func_72838_d(entityitem); ++ if (captureDrops) ++ { ++ capturedDrops.add(entityitem); ++ } ++ else ++ { ++ this.field_70170_p.func_72838_d(entityitem); ++ } + return entityitem; + } + else +@@ -1687,7 +1779,7 @@ + + public boolean func_70115_ae() + { +- return this.field_70154_o != null; ++ return this.field_70154_o != null && field_70154_o.shouldRiderSit(); + } + + public boolean func_70093_af() +@@ -1988,7 +2080,7 @@ + + public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_) + { +- return p_145772_6_.func_149638_a(this); ++ return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, field_70165_t, field_70163_u + func_70047_e(), field_70161_v); + } + + public boolean func_145774_a(Explosion p_145774_1_, World p_145774_2_, int p_145774_3_, int p_145774_4_, int p_145774_5_, Block p_145774_6_, float p_145774_7_) +@@ -2058,6 +2150,174 @@ + + public void func_145781_i(int p_145781_1_) {} + ++ /* ================================== Forge Start =====================================*/ ++ /** ++ * Returns a NBTTagCompound that can be used to store custom data for this entity. ++ * It will be written, and read from disc, so it persists over world saves. ++ * @return A NBTTagCompound ++ */ ++ public NBTTagCompound getEntityData() ++ { ++ if (customEntityData == null) ++ { ++ customEntityData = new NBTTagCompound(); ++ } ++ return customEntityData; ++ } ++ ++ /** ++ * Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position. ++ * @return false to prevent an entity that is mounted to this entity from displaying the 'sitting' animation. ++ */ ++ public boolean shouldRiderSit() ++ { ++ return true; ++ } ++ ++ /** ++ * Called when a user uses the creative pick block button on this entity. ++ * ++ * @param target The full target the player is looking at ++ * @return A ItemStack to add to the player's inventory, Null if nothing should be added. ++ */ ++ public ItemStack getPickedResult(MovingObjectPosition target) ++ { ++ if (this instanceof EntityPainting) ++ { ++ return new ItemStack(Items.field_151159_an); ++ } ++ else if (this instanceof EntityLeashKnot) ++ { ++ return new ItemStack(Items.field_151058_ca); ++ } ++ else if (this instanceof EntityItemFrame) ++ { ++ ItemStack held = ((EntityItemFrame)this).func_82335_i(); ++ if (held == null) ++ { ++ return new ItemStack(Items.field_151160_bD); ++ } ++ else ++ { ++ return held.func_77946_l(); ++ } ++ } ++ else if (this instanceof EntityMinecart) ++ { ++ return ((EntityMinecart)this).getCartItem(); ++ } ++ else if (this instanceof EntityBoat) ++ { ++ return new ItemStack(Items.field_151124_az); ++ } ++ else ++ { ++ int id = EntityList.func_75619_a(this); ++ if (id > 0 && EntityList.field_75627_a.containsKey(id)) ++ { ++ return new ItemStack(Items.field_151063_bx, 1, id); ++ } ++ } ++ return null; ++ } ++ ++ public UUID getPersistentID() ++ { ++ return field_96093_i; ++ } ++ ++ /** ++ * Reset the entity ID to a new value. Not to be used from Mod code ++ */ ++ public final void resetEntityId() ++ { ++ this.field_145783_c = field_70152_a++; ++ } ++ ++ public boolean shouldRenderInPass(int pass) ++ { ++ return pass == 0; ++ } ++ ++ /** ++ * Returns true if the entity is of the @link{EnumCreatureType} provided ++ * @param type The EnumCreatureType type this entity is evaluating ++ * @param forSpawnCount If this is being invoked to check spawn count caps. ++ * @return If the creature is of the type provided ++ */ ++ public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) ++ { ++ return type.func_75598_a().isAssignableFrom(this.getClass()); ++ } ++ ++ /** ++ * Register the instance of IExtendedProperties into the entity's collection. ++ * @param identifier The identifier which you can use to retrieve these properties for the entity. ++ * @param properties The instanceof IExtendedProperties to register ++ * @return The identifier that was used to register the extended properties. Empty String indicates an error. If your requested key already existed, this will return a modified one that is unique. ++ */ ++ public String registerExtendedProperties(String identifier, IExtendedEntityProperties properties) ++ { ++ if (identifier == null) ++ { ++ FMLLog.warning("Someone is attempting to register extended properties using a null identifier. This is not allowed. Aborting. This may have caused instability."); ++ return ""; ++ } ++ if (properties == null) ++ { ++ FMLLog.warning("Someone is attempting to register null extended properties. This is not allowed. Aborting. This may have caused instability."); ++ return ""; ++ } ++ ++ String baseIdentifier = identifier; ++ int identifierModCount = 1; ++ while (this.extendedProperties.containsKey(identifier)) ++ { ++ identifier = String.format("%s%d", baseIdentifier, identifierModCount++); ++ } ++ ++ if (baseIdentifier != identifier) ++ { ++ FMLLog.info("An attempt was made to register exended properties using an existing key. The duplicate identifier (%s) has been remapped to %s.", baseIdentifier, identifier); ++ } ++ ++ this.extendedProperties.put(identifier, properties); ++ return identifier; ++ } ++ ++ /** ++ * Gets the extended properties identified by the passed in key ++ * @param identifier The key that identifies the extended properties. ++ * @return The instance of IExtendedProperties that was found, or null. ++ */ ++ public IExtendedEntityProperties getExtendedProperties(String identifier) ++ { ++ return this.extendedProperties.get(identifier); ++ } ++ ++ /** ++ * If a rider of this entity can interact with this entity. Should return true on the ++ * ridden entity if so. ++ * ++ * @return if the entity can be interacted with from a rider ++ */ ++ public boolean canRiderInteract() ++ { ++ return false; ++ } ++ ++ /** ++ * If the rider should be dismounted from the entity when the entity goes under water ++ * ++ * @param rider The entity that is riding ++ * @return if the entity should be dismounted when under water ++ */ ++ public boolean shouldDismountInWater(Entity rider) ++ { ++ return this instanceof EntityLivingBase; ++ } ++ /* ================================== Forge End =====================================*/ ++ + public static enum EnumEntitySize + { + SIZE_1, diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityList.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityList.java.patch new file mode 100644 index 0000000..f1c7ee4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityList.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityList.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityList.java +@@ -84,6 +84,7 @@ + + public static void func_75618_a(Class p_75618_0_, String p_75618_1_, int p_75618_2_) + { ++ if (p_75618_2_ < 0 || p_75618_2_ > 255) throw new IllegalArgumentException("Attempted to register a entity with invalid ID: " + p_75618_2_ + " Name: " + p_75618_1_ + " Class: " + p_75618_0_); + if (field_75625_b.containsKey(p_75618_1_)) + { + throw new IllegalArgumentException("ID is already registered: " + p_75618_1_); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLiving.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLiving.java.patch new file mode 100644 index 0000000..6ad55fe --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLiving.java.patch @@ -0,0 +1,51 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java +@@ -34,6 +34,9 @@ + import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.World; + import net.minecraft.world.WorldServer; ++import net.minecraftforge.common.ForgeHooks; ++import cpw.mods.fml.common.eventhandler.Event.Result; ++import net.minecraftforge.event.ForgeEventFactory; + + public abstract class EntityLiving extends EntityLivingBase + { +@@ -117,6 +120,7 @@ + public void func_70624_b(EntityLivingBase p_70624_1_) + { + this.field_70696_bz = p_70624_1_; ++ ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_); + } + + public boolean func_70686_a(Class p_70686_1_) +@@ -476,10 +480,22 @@ + + protected void func_70623_bb() + { ++ Result result = null; + if (this.field_82179_bU) + { + this.field_70708_bq = 0; + } ++ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT) ++ { ++ if (result == Result.DENY) ++ { ++ this.field_70708_bq = 0; ++ } ++ else ++ { ++ this.func_70106_y(); ++ } ++ } + else + { + EntityPlayer entityplayer = this.field_70170_p.func_72890_a(this, -1.0D); +@@ -642,7 +658,6 @@ + return this.field_70170_p.func_72855_b(this.field_70121_D) && this.field_70170_p.func_72945_a(this, this.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(this.field_70121_D); + } + +- @SideOnly(Side.CLIENT) + public float func_70603_bj() + { + return 1.0F; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLivingBase.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLivingBase.java.patch new file mode 100644 index 0000000..49586bc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLivingBase.java.patch @@ -0,0 +1,232 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityLivingBase.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityLivingBase.java +@@ -19,6 +19,7 @@ + import net.minecraft.entity.item.EntityItem; + import net.minecraft.entity.item.EntityXPOrb; + import net.minecraft.entity.monster.EntityZombie; ++import net.minecraft.entity.passive.EntityPig; + import net.minecraft.entity.passive.EntityWolf; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.entity.player.EntityPlayerMP; +@@ -48,6 +49,7 @@ + import net.minecraft.util.Vec3; + import net.minecraft.world.World; + import net.minecraft.world.WorldServer; ++import net.minecraftforge.common.ForgeHooks; + + public abstract class EntityLivingBase extends Entity + { +@@ -225,7 +227,7 @@ + } + } + +- if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o instanceof EntityLivingBase) ++ if (!this.field_70170_p.field_72995_K && this.func_70115_ae() && this.field_70154_o != null && field_70154_o.shouldDismountInWater(this)) + { + this.func_70078_a((Entity)null); + } +@@ -374,6 +376,7 @@ + { + this.field_70755_b = p_70604_1_; + this.field_70756_c = this.field_70173_aa; ++ ForgeHooks.onLivingSetAttackTarget(this, p_70604_1_); + } + + public EntityLivingBase func_110144_aD() +@@ -661,7 +664,6 @@ + return this.func_70668_bt() == EnumCreatureAttribute.UNDEAD; + } + +- @SideOnly(Side.CLIENT) + public void func_70618_n(int p_70618_1_) + { + this.field_70713_bf.remove(Integer.valueOf(p_70618_1_)); +@@ -710,6 +712,8 @@ + + public void func_70691_i(float p_70691_1_) + { ++ p_70691_1_ = net.minecraftforge.event.ForgeEventFactory.onLivingHeal(this, p_70691_1_); ++ if (p_70691_1_ <= 0) return; + float f1 = this.func_110143_aJ(); + + if (f1 > 0.0F) +@@ -730,6 +734,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) + { ++ if (ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_85032_ar()) + { + return false; +@@ -796,9 +801,9 @@ + this.field_70718_bc = 100; + this.field_70717_bb = (EntityPlayer)entity; + } +- else if (entity instanceof EntityWolf) ++ else if (entity instanceof net.minecraft.entity.passive.EntityTameable) + { +- EntityWolf entitywolf = (EntityWolf)entity; ++ net.minecraft.entity.passive.EntityTameable entitywolf = (net.minecraft.entity.passive.EntityTameable)entity; + + if (entitywolf.func_70909_n()) + { +@@ -883,6 +888,7 @@ + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + Entity entity = p_70645_1_.func_76346_g(); + EntityLivingBase entitylivingbase = this.func_94060_bK(); + +@@ -908,6 +914,10 @@ + i = EnchantmentHelper.func_77519_f((EntityLivingBase)entity); + } + ++ captureDrops = true; ++ capturedDrops.clear(); ++ int j = 0; ++ + if (this.func_146066_aG() && this.field_70170_p.func_82736_K().func_82766_b("doMobLoot")) + { + this.func_70628_a(this.field_70718_bc > 0, i); +@@ -915,7 +925,7 @@ + + if (this.field_70718_bc > 0) + { +- int j = this.field_70146_Z.nextInt(200) - i; ++ j = this.field_70146_Z.nextInt(200) - i; + + if (j < 5) + { +@@ -923,6 +933,16 @@ + } + } + } ++ ++ captureDrops = false; ++ ++ if (!ForgeHooks.onLivingDrops(this, p_70645_1_, capturedDrops, i, field_70718_bc > 0, j)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ field_70170_p.func_72838_d(item); ++ } ++ } + } + + this.field_70170_p.func_72960_a(this, (byte)3); +@@ -971,7 +991,7 @@ + int j = MathHelper.func_76128_c(this.field_70121_D.field_72338_b); + int k = MathHelper.func_76128_c(this.field_70161_v); + Block block = this.field_70170_p.func_147439_a(i, j, k); +- return block == Blocks.field_150468_ap || block == Blocks.field_150395_bd; ++ return ForgeHooks.isLivingOnLadder(block, field_70170_p, i, j, k, this); + } + + public boolean func_70089_S() +@@ -981,6 +1001,8 @@ + + protected void func_70069_a(float p_70069_1_) + { ++ p_70069_1_ = ForgeHooks.onLivingFall(this, p_70069_1_); ++ if (p_70069_1_ <= 0) return; + super.func_70069_a(p_70069_1_); + PotionEffect potioneffect = this.func_70660_b(Potion.field_76430_j); + float f1 = potioneffect != null ? (float)(potioneffect.func_76458_c() + 1) : 0.0F; +@@ -1060,7 +1082,7 @@ + { + if (this instanceof EntityZombie) + { +- p_70672_2_ = p_70672_2_; ++ //par2 = par2; // Forge: Noop Warning + } + + int i; +@@ -1104,6 +1126,8 @@ + { + if (!this.func_85032_ar()) + { ++ p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + 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 f1 = p_70665_2_; +@@ -1152,6 +1176,17 @@ + + public void func_71038_i() + { ++ ItemStack stack = this.func_70694_bm(); ++ ++ if (stack != null && stack.func_77973_b() != null) ++ { ++ Item item = stack.func_77973_b(); ++ if (item.onEntitySwing(this, stack)) ++ { ++ return; ++ } ++ } ++ + if (!this.field_82175_bq || this.field_110158_av >= this.func_82166_i() / 2 || this.field_110158_av < 0) + { + this.field_110158_av = -1; +@@ -1347,6 +1382,7 @@ + } + + this.field_70160_al = true; ++ ForgeHooks.onLivingJump(this); + } + + public void func_70612_e(float p_70612_1_, float p_70612_2_) +@@ -1521,6 +1557,7 @@ + + public void func_70071_h_() + { ++ if (ForgeHooks.onLivingUpdate(this)) return; + super.func_70071_h_(); + + if (!this.field_70170_p.field_72995_K) +@@ -2007,6 +2044,44 @@ + return this.func_96124_cp() != null ? this.func_96124_cp().func_142054_a(p_142012_1_) : false; + } + ++ /*** ++ * Removes all potion effects that have curativeItem as a curative item for its effect ++ * @param curativeItem The itemstack we are using to cure potion effects ++ */ ++ public void curePotionEffects(ItemStack curativeItem) ++ { ++ Iterator potionKey = field_70713_bf.keySet().iterator(); ++ ++ if (field_70170_p.field_72995_K) ++ { ++ return; ++ } ++ ++ while (potionKey.hasNext()) ++ { ++ Integer key = potionKey.next(); ++ PotionEffect effect = (PotionEffect)field_70713_bf.get(key); ++ ++ if (effect.isCurativeItem(curativeItem)) ++ { ++ potionKey.remove(); ++ func_70688_c(effect); ++ } ++ } ++ } ++ ++ /** ++ * Returns true if the entity's rider (EntityPlayer) should face forward when mounted. ++ * currently only used in vanilla code by pigs. ++ * ++ * @param player The player who is riding the entity. ++ * @return If the player should orient the same direction as this entity. ++ */ ++ public boolean shouldRiderFaceForward(EntityPlayer player) ++ { ++ return this instanceof EntityPig; ++ } ++ + public void func_152111_bt() {} + + public void func_152112_bu() {} diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTracker.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTracker.java.patch new file mode 100644 index 0000000..0945a9e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTracker.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java +@@ -337,4 +337,23 @@ + } + } + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ ++ // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily ++ /** ++ * Get all players tracking the given Entity. The Entity must be part of the World that this Tracker belongs to. ++ * @param entity the Entity ++ * @return all players tracking the Entity ++ */ ++ public Set getTrackingPlayers(Entity entity) ++ { ++ EntityTrackerEntry entry = (EntityTrackerEntry) field_72794_c.func_76041_a(entity.func_145782_y()); ++ if (entry == null) ++ return java.util.Collections.emptySet(); ++ else ++ return java.util.Collections.unmodifiableSet(entry.field_73134_o); ++ } ++ ++ /* ======================================== FORGE END =====================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTrackerEntry.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTrackerEntry.java.patch new file mode 100644 index 0000000..b34ba7a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java +@@ -436,12 +436,14 @@ + p_73117_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(this.field_73132_a.func_145782_y(), potioneffect)); + } + } ++ net.minecraftforge.event.ForgeEventFactory.onStartEntityTracking(field_73132_a, p_73117_1_); + } + } + else if (this.field_73134_o.contains(p_73117_1_)) + { + this.field_73134_o.remove(p_73117_1_); + p_73117_1_.func_152339_d(this.field_73132_a); ++ net.minecraftforge.event.ForgeEventFactory.onStopEntityTracking(field_73132_a, p_73117_1_); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch new file mode 100644 index 0000000..1df3009 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java ++++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIAttackOnCollide.java +@@ -3,6 +3,7 @@ + import net.minecraft.entity.EntityCreature; + import net.minecraft.entity.EntityLivingBase; + import net.minecraft.pathfinding.PathEntity; ++import net.minecraft.pathfinding.PathPoint; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; + +@@ -21,6 +22,8 @@ + private double field_151496_k; + private static final String __OBFID = "CL_00001595"; + ++ private int failedPathFindingPenalty; ++ + public EntityAIAttackOnCollide(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) + { + this(p_i1635_1_, p_i1635_3_, p_i1635_5_); +@@ -54,8 +57,16 @@ + } + else + { +- this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); +- return this.field_75438_g != null; ++ if (-- this.field_75445_i <= 0) ++ { ++ this.field_75438_g = this.field_75441_b.func_70661_as().func_75494_a(entitylivingbase); ++ this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ return this.field_75438_g != null; ++ } ++ else ++ { ++ return true; ++ } + } + } + +@@ -89,8 +100,25 @@ + this.field_151497_i = entitylivingbase.field_70165_t; + this.field_151495_j = entitylivingbase.field_70121_D.field_72338_b; + this.field_151496_k = entitylivingbase.field_70161_v; +- this.field_75445_i = 4 + this.field_75441_b.func_70681_au().nextInt(7); ++ this.field_75445_i = failedPathFindingPenalty + 4 + this.field_75441_b.func_70681_au().nextInt(7); + ++ if (this.field_75441_b.func_70661_as().func_75505_d() != null) ++ { ++ PathPoint finalPathPoint = this.field_75441_b.func_70661_as().func_75505_d().func_75870_c(); ++ if (finalPathPoint != null && entitylivingbase.func_70092_e(finalPathPoint.field_75839_a, finalPathPoint.field_75837_b, finalPathPoint.field_75838_c) < 1) ++ { ++ failedPathFindingPenalty = 0; ++ } ++ else ++ { ++ failedPathFindingPenalty += 10; ++ } ++ } ++ else ++ { ++ failedPathFindingPenalty += 10; ++ } ++ + if (d0 > 1024.0D) + { + this.field_75445_i += 10; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityDragon.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityDragon.java.patch new file mode 100644 index 0000000..82e4e99 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityDragon.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityDragon.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityDragon.java +@@ -477,9 +477,9 @@ + { + Block block = this.field_70170_p.func_147439_a(k1, l1, i2); + +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_70170_p, k1, l1, i2)) + { +- if (block != Blocks.field_150343_Z && block != Blocks.field_150377_bs && block != Blocks.field_150357_h && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) ++ if (block.canEntityDestroy(field_70170_p, k1, l1, i2, this) && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) + { + flag1 = this.field_70170_p.func_147468_f(k1, l1, i2) || flag1; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityWither.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityWither.java.patch new file mode 100644 index 0000000..e2accd9 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityWither.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/EntityWither.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/EntityWither.java +@@ -347,7 +347,7 @@ + int l = j1 + i2; + Block block = this.field_70170_p.func_147439_a(j2, k, l); + +- if (block.func_149688_o() != Material.field_151579_a && block != Blocks.field_150357_h && block != Blocks.field_150384_bq && block != Blocks.field_150378_br && block != Blocks.field_150483_bI) ++ if (!block.isAir(field_70170_p, j2, k, l) && block.canEntityDestroy(field_70170_p, j2, k, l, this)) + { + flag = this.field_70170_p.func_147480_a(j2, k, l, true) || flag; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/effect/EntityLightningBolt.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/effect/EntityLightningBolt.java.patch new file mode 100644 index 0000000..4d83b19 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/effect/EntityLightningBolt.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java ++++ ../src-work/minecraft/net/minecraft/entity/effect/EntityLightningBolt.java +@@ -102,7 +102,8 @@ + for (int l = 0; l < list.size(); ++l) + { + Entity entity = (Entity)list.get(l); +- entity.func_70077_a(this); ++ if (!net.minecraftforge.event.ForgeEventFactory.onEntityStruckByLightning(entity, this)) ++ entity.func_70077_a(this); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityEnderPearl.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityEnderPearl.java.patch new file mode 100644 index 0000000..d0c5756 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityEnderPearl.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderPearl.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderPearl.java +@@ -9,6 +9,8 @@ + import net.minecraft.util.DamageSource; + import net.minecraft.util.MovingObjectPosition; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.living.EnderTeleportEvent; + + public class EntityEnderPearl extends EntityThrowable + { +@@ -50,14 +52,18 @@ + + if (entityplayermp.field_71135_a.func_147362_b().func_150724_d() && entityplayermp.field_70170_p == this.field_70170_p) + { ++ EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.field_70165_t, this.field_70163_u, this.field_70161_v, 5.0F); ++ if (!MinecraftForge.EVENT_BUS.post(event)) ++ { // Don't indent to lower patch size + if (this.func_85052_h().func_70115_ae()) + { + this.func_85052_h().func_70078_a((Entity)null); + } + +- this.func_85052_h().func_70634_a(this.field_70165_t, this.field_70163_u, this.field_70161_v); ++ this.func_85052_h().func_70634_a(event.targetX, event.targetY, event.targetZ); + this.func_85052_h().field_70143_R = 0.0F; +- this.func_85052_h().func_70097_a(DamageSource.field_76379_h, 5.0F); ++ this.func_85052_h().func_70097_a(DamageSource.field_76379_h, event.attackDamage); ++ } + } + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityItem.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityItem.java.patch new file mode 100644 index 0000000..18ff726 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityItem.java.patch @@ -0,0 +1,138 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java +@@ -14,10 +14,13 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.util.StatCollector; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.item.ItemExpireEvent; ++import net.minecraftforge.event.entity.player.EntityItemPickupEvent; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +- + import cpw.mods.fml.common.FMLCommonHandler; ++import cpw.mods.fml.common.eventhandler.Event.Result; + + public class EntityItem extends Entity + { +@@ -30,6 +33,11 @@ + public float field_70290_d; + private static final String __OBFID = "CL_00001669"; + ++ /** ++ * The maximum age of this EntityItem. The item is expired once this is reached. ++ */ ++ public int lifespan = 6000; ++ + public EntityItem(World p_i1709_1_, double p_i1709_2_, double p_i1709_4_, double p_i1709_6_) + { + super(p_i1709_1_); +@@ -46,8 +54,9 @@ + + public EntityItem(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) + { +- this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); ++ this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_); + this.func_92058_a(p_i1710_8_); ++ this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.func_77973_b().getEntityLifespan(p_i1710_8_, p_i1710_1_)); + } + + protected boolean func_70041_e_() +@@ -71,6 +80,15 @@ + + public void func_70071_h_() + { ++ ItemStack stack = this.func_70096_w().func_82710_f(10); ++ if (stack != null && stack.func_77973_b() != null) ++ { ++ if (stack.func_77973_b().onEntityItemUpdate(this)) ++ { ++ return; ++ } ++ } ++ + if (this.func_92059_d() == null) + { + this.func_70106_y(); +@@ -126,8 +144,30 @@ + + ++this.field_70292_b; + +- if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) ++ ItemStack item = func_70096_w().func_82710_f(10); ++ ++ if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) + { ++ if (item != null) ++ { ++ ItemExpireEvent event = new ItemExpireEvent(this, (item.func_77973_b() == null ? 6000 : item.func_77973_b().getEntityLifespan(item, field_70170_p))); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ lifespan += event.extraLife; ++ } ++ else ++ { ++ this.func_70106_y(); ++ } ++ } ++ else ++ { ++ this.func_70106_y(); ++ } ++ } ++ ++ if (item != null && item.field_77994_a <= 0) ++ { + this.func_70106_y(); + } + } +@@ -242,6 +282,7 @@ + { + p_70014_1_.func_74777_a("Health", (short)((byte)this.field_70291_e)); + p_70014_1_.func_74777_a("Age", (short)this.field_70292_b); ++ p_70014_1_.func_74768_a("Lifespan", lifespan); + + if (this.func_145800_j() != null) + { +@@ -277,20 +318,39 @@ + NBTTagCompound nbttagcompound1 = p_70037_1_.func_74775_l("Item"); + this.func_92058_a(ItemStack.func_77949_a(nbttagcompound1)); + +- if (this.func_92059_d() == null) ++ ItemStack item = func_70096_w().func_82710_f(10); ++ ++ if (item == null || item.field_77994_a <= 0) + { + this.func_70106_y(); + } ++ ++ if (p_70037_1_.func_74764_b("Lifespan")) ++ { ++ lifespan = p_70037_1_.func_74762_e("Lifespan"); ++ } + } + + public void func_70100_b_(EntityPlayer p_70100_1_) + { + if (!this.field_70170_p.field_72995_K) + { ++ if (this.field_145804_b > 0) ++ { ++ return; ++ } ++ ++ EntityItemPickupEvent event = new EntityItemPickupEvent(p_70100_1_, this); ++ ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return; ++ } ++ + ItemStack itemstack = this.func_92059_d(); + int i = itemstack.field_77994_a; + +- if (this.field_145804_b == 0 && (this.field_145802_g == null || 6000 - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) ++ if (this.field_145804_b <= 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_70005_c_())) && (event.getResult() == Result.ALLOW || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack))) + { + if (itemstack.func_77973_b() == Item.func_150898_a(Blocks.field_150364_r)) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecart.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecart.java.patch new file mode 100644 index 0000000..0eb507c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecart.java.patch @@ -0,0 +1,510 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecart.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecart.java +@@ -23,6 +23,10 @@ + import net.minecraft.util.Vec3; + import net.minecraft.world.World; + import net.minecraft.world.WorldServer; ++import net.minecraftforge.common.IMinecartCollisionHandler; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.minecart.MinecartCollisionEvent; ++import net.minecraftforge.event.entity.minecart.MinecartUpdateEvent; + + public abstract class EntityMinecart extends Entity + { +@@ -43,6 +47,20 @@ + private double field_70506_as; + private static final String __OBFID = "CL_00001670"; + ++ /* Forge: Minecart Compatibility Layer Integration. */ ++ public static float defaultMaxSpeedAirLateral = 0.4f; ++ public static float defaultMaxSpeedAirVertical = -1f; ++ public static double defaultDragAir = 0.94999998807907104D; ++ protected boolean canUseRail = true; ++ protected boolean canBePushed = true; ++ private static IMinecartCollisionHandler collisionHandler = null; ++ ++ /* Instance versions of the above physics properties */ ++ private float currentSpeedRail = getMaxCartSpeedOnRail(); ++ protected float maxSpeedAirLateral = defaultMaxSpeedAirLateral; ++ protected float maxSpeedAirVertical = defaultMaxSpeedAirVertical; ++ protected double dragAir = defaultDragAir; ++ + public EntityMinecart(World p_i1712_1_) + { + super(p_i1712_1_); +@@ -89,17 +107,25 @@ + + public AxisAlignedBB func_70114_g(Entity p_70114_1_) + { ++ if (getCollisionHandler() != null) ++ { ++ return getCollisionHandler().getCollisionBox(this, p_70114_1_); ++ } + return p_70114_1_.func_70104_M() ? p_70114_1_.field_70121_D : null; + } + + public AxisAlignedBB func_70046_E() + { ++ if (getCollisionHandler() != null) ++ { ++ return getCollisionHandler().getBoundingBox(this); ++ } + return null; + } + + public boolean func_70104_M() + { +- return true; ++ return canBePushed; + } + + public EntityMinecart(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) +@@ -302,19 +328,20 @@ + double d2 = 0.0078125D; + Block block = this.field_70170_p.func_147439_a(l, i, i1); + +- if (BlockRailBase.func_150051_a(block)) ++ if (canUseRail() && BlockRailBase.func_150051_a(block)) + { +- int j = this.field_70170_p.func_72805_g(l, i, i1); +- this.func_145821_a(l, i, i1, d0, d2, block, j); ++ float railMaxSpeed = ((BlockRailBase)block).getRailMaxSpeed(field_70170_p, this, l, i, i1); ++ double maxSpeed = Math.min(railMaxSpeed, getCurrentCartSpeedCapOnRail()); ++ this.func_145821_a(l, i, i1, maxSpeed, getSlopeAdjustment(), block, ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, l, i, i1)); + + if (block == Blocks.field_150408_cc) + { +- this.func_96095_a(l, i, i1, (j & 8) != 0); ++ this.func_96095_a(l, i, i1, (field_70170_p.func_72805_g(l, i, i1) & 8) != 0); + } + } + else + { +- this.func_94088_b(d0); ++ this.func_94088_b(field_70122_E ? d0 : getMaxSpeedAirLateral()); + } + + this.func_145775_I(); +@@ -341,8 +368,19 @@ + } + + this.func_70101_b(this.field_70177_z, this.field_70125_A); +- List list = this.field_70170_p.func_72839_b(this, this.field_70121_D.func_72314_b(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + ++ AxisAlignedBB box; ++ if (getCollisionHandler() != null) ++ { ++ box = getCollisionHandler().getMinecartCollisionBox(this); ++ } ++ else ++ { ++ box = field_70121_D.func_72314_b(0.2D, 0.0D, 0.2D); ++ } ++ ++ List list = this.field_70170_p.func_72839_b(this, box); ++ + if (list != null && !list.isEmpty()) + { + for (int k = 0; k < list.size(); ++k) +@@ -365,6 +403,8 @@ + + this.field_70153_n = null; + } ++ ++ MinecraftForge.EVENT_BUS.post(new MinecartUpdateEvent(this, l, i, i1)); + } + } + +@@ -392,6 +432,17 @@ + this.field_70179_y = p_94088_1_; + } + ++ double moveY = field_70181_x; ++ if(getMaxSpeedAirVertical() > 0 && field_70181_x > getMaxSpeedAirVertical()) ++ { ++ moveY = getMaxSpeedAirVertical(); ++ if(Math.abs(field_70159_w) < 0.3f && Math.abs(field_70179_y) < 0.3f) ++ { ++ moveY = 0.15f; ++ field_70181_x = moveY; ++ } ++ } ++ + if (this.field_70122_E) + { + this.field_70159_w *= 0.5D; +@@ -399,13 +450,13 @@ + this.field_70179_y *= 0.5D; + } + +- this.func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y); ++ this.func_70091_d(this.field_70159_w, moveY, this.field_70179_y); + + if (!this.field_70122_E) + { +- this.field_70159_w *= 0.949999988079071D; +- this.field_70181_x *= 0.949999988079071D; +- this.field_70179_y *= 0.949999988079071D; ++ this.field_70159_w *= getDragAir(); ++ this.field_70181_x *= getDragAir(); ++ this.field_70179_y *= getDragAir(); + } + } + +@@ -419,7 +470,7 @@ + + if (p_145821_8_ == Blocks.field_150318_D) + { +- flag = (p_145821_9_ & 8) != 0; ++ flag = (field_70170_p.func_72805_g(p_145821_1_, p_145821_2_, p_145821_3_) & 8) != 0; + flag1 = !flag; + } + +@@ -498,7 +549,7 @@ + } + } + +- if (flag1) ++ if (flag1 && shouldDoRailFunctions()) + { + d7 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); + +@@ -546,37 +597,9 @@ + this.field_70165_t = d8 + d2 * d7; + this.field_70161_v = d9 + d3 * d7; + this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)this.field_70129_M, this.field_70161_v); +- d12 = this.field_70159_w; +- d13 = this.field_70179_y; + +- if (this.field_70153_n != null) +- { +- d12 *= 0.75D; +- d13 *= 0.75D; +- } ++ moveMinecartOnRail(p_145821_1_, p_145821_2_, p_145821_3_, p_145821_4_); + +- if (d12 < -p_145821_4_) +- { +- d12 = -p_145821_4_; +- } +- +- if (d12 > p_145821_4_) +- { +- d12 = p_145821_4_; +- } +- +- if (d13 < -p_145821_4_) +- { +- d13 = -p_145821_4_; +- } +- +- if (d13 > p_145821_4_) +- { +- d13 = p_145821_4_; +- } +- +- this.func_70091_d(d12, 0.0D, d13); +- + if (aint[0][1] != 0 && MathHelper.func_76128_c(this.field_70165_t) - p_145821_1_ == aint[0][0] && MathHelper.func_76128_c(this.field_70161_v) - p_145821_3_ == aint[0][2]) + { + this.func_70107_b(this.field_70165_t, this.field_70163_u + (double)aint[0][1], this.field_70161_v); +@@ -613,8 +636,13 @@ + this.field_70179_y = d6 * (double)(i1 - p_145821_3_); + } + +- if (flag) ++ if(shouldDoRailFunctions()) + { ++ ((BlockRailBase)p_145821_8_).onMinecartPass(field_70170_p, this, p_145821_1_, p_145821_2_, p_145821_3_); ++ } ++ ++ if (flag && shouldDoRailFunctions()) ++ { + double d15 = Math.sqrt(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y); + + if (d15 > 0.01D) +@@ -684,13 +712,8 @@ + } + else + { +- int l = this.field_70170_p.func_72805_g(i, j, k); ++ int l = ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, i, j, k); + +- if (((BlockRailBase)block).func_150050_e()) +- { +- l &= 7; +- } +- + p_70495_3_ = (double)j; + + if (l >= 2 && l <= 5) +@@ -735,14 +758,9 @@ + + if (BlockRailBase.func_150051_a(block)) + { +- int l = this.field_70170_p.func_72805_g(i, j, k); ++ int l = ((BlockRailBase)block).getBasicRailMetadata(field_70170_p, this, i, j, k); + p_70489_3_ = (double)j; + +- if (((BlockRailBase)block).func_150050_e()) +- { +- l &= 7; +- } +- + if (l >= 2 && l <= 5) + { + p_70489_3_ = (double)(j + 1); +@@ -838,11 +856,17 @@ + + public void func_70108_f(Entity p_70108_1_) + { ++ MinecraftForge.EVENT_BUS.post(new MinecartCollisionEvent(this, p_70108_1_)); ++ if (getCollisionHandler() != null) ++ { ++ getCollisionHandler().onEntityCollision(this, p_70108_1_); ++ return; ++ } + if (!this.field_70170_p.field_72995_K) + { + if (p_70108_1_ != this.field_70153_n) + { +- if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && this.func_94087_l() == 0 && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) ++ if (p_70108_1_ instanceof EntityLivingBase && !(p_70108_1_ instanceof EntityPlayer) && !(p_70108_1_ instanceof EntityIronGolem) && canBeRidden() && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.01D && this.field_70153_n == null && p_70108_1_.field_70154_o == null) + { + p_70108_1_.func_70078_a(this); + } +@@ -888,7 +912,7 @@ + double d7 = p_70108_1_.field_70159_w + this.field_70159_w; + double d8 = p_70108_1_.field_70179_y + this.field_70179_y; + +- if (((EntityMinecart)p_70108_1_).func_94087_l() == 2 && this.func_94087_l() != 2) ++ if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) + { + this.field_70159_w *= 0.20000000298023224D; + this.field_70179_y *= 0.20000000298023224D; +@@ -896,7 +920,7 @@ + p_70108_1_.field_70159_w *= 0.949999988079071D; + p_70108_1_.field_70179_y *= 0.949999988079071D; + } +- else if (((EntityMinecart)p_70108_1_).func_94087_l() != 2 && this.func_94087_l() == 2) ++ else if (((EntityMinecart)p_70108_1_).isPoweredCart() && !isPoweredCart()) + { + p_70108_1_.field_70159_w *= 0.20000000298023224D; + p_70108_1_.field_70179_y *= 0.20000000298023224D; +@@ -1065,4 +1089,216 @@ + { + return this.field_94102_c; + } ++ /* =================================== FORGE START ===========================================*/ ++ /** ++ * Moved to allow overrides. ++ * This code handles minecart movement and speed capping when on a rail. ++ */ ++ public void moveMinecartOnRail(int x, int y, int z, double par4){ ++ double d12 = this.field_70159_w; ++ double d13 = this.field_70179_y; ++ ++ if (this.field_70153_n != null) ++ { ++ d12 *= 0.75D; ++ d13 *= 0.75D; ++ } ++ ++ if (d12 < -par4) ++ { ++ d12 = -par4; ++ } ++ ++ if (d12 > par4) ++ { ++ d12 = par4; ++ } ++ ++ if (d13 < -par4) ++ { ++ d13 = -par4; ++ } ++ ++ if (d13 > par4) ++ { ++ d13 = par4; ++ } ++ ++ this.func_70091_d(d12, 0.0D, d13); ++ } ++ ++ /** ++ * Gets the current global Minecart Collision handler if none ++ * is registered, returns null ++ * @return The collision handler or null ++ */ ++ public static IMinecartCollisionHandler getCollisionHandler() ++ { ++ return collisionHandler; ++ } ++ ++ /** ++ * Sets the global Minecart Collision handler, overwrites any ++ * that is currently set. ++ * @param handler The new handler ++ */ ++ public static void setCollisionHandler(IMinecartCollisionHandler handler) ++ { ++ collisionHandler = handler; ++ } ++ ++ /** ++ * This function returns an ItemStack that represents this cart. ++ * This should be an ItemStack that can be used by the player to place the cart, ++ * but is not necessary the item the cart drops when destroyed. ++ * @return An ItemStack that can be used to place the cart. ++ */ ++ public ItemStack getCartItem() ++ { ++ if (this instanceof EntityMinecartFurnace) ++ { ++ return new ItemStack(Items.field_151109_aJ); ++ } ++ else if (this instanceof EntityMinecartChest) ++ { ++ return new ItemStack(Items.field_151108_aI); ++ } ++ else if (this instanceof EntityMinecartTNT) ++ { ++ return new ItemStack(Items.field_151142_bV); ++ } ++ else if (this instanceof EntityMinecartHopper) ++ { ++ return new ItemStack(Items.field_151140_bW); ++ } ++ else if (this instanceof EntityMinecartCommandBlock) ++ { ++ return new ItemStack(Items.field_151095_cc); ++ } ++ return new ItemStack(Items.field_151143_au); ++ } ++ ++ /** ++ * Returns true if this cart can currently use rails. ++ * This function is mainly used to gracefully detach a minecart from a rail. ++ * @return True if the minecart can use rails. ++ */ ++ public boolean canUseRail() ++ { ++ return canUseRail; ++ } ++ ++ /** ++ * Set whether the minecart can use rails. ++ * This function is mainly used to gracefully detach a minecart from a rail. ++ * @param use Whether the minecart can currently use rails. ++ */ ++ public void setCanUseRail(boolean use) ++ { ++ canUseRail = use; ++ } ++ ++ /** ++ * Return false if this cart should not call onMinecartPass() and should ignore Powered Rails. ++ * @return True if this cart should call onMinecartPass(). ++ */ ++ public boolean shouldDoRailFunctions() ++ { ++ return true; ++ } ++ ++ /** ++ * Returns true if this cart is self propelled. ++ * @return True if powered. ++ */ ++ public boolean isPoweredCart() ++ { ++ return func_94087_l()== 2; ++ } ++ ++ /** ++ * Returns true if this cart can be ridden by an Entity. ++ * @return True if this cart can be ridden. ++ */ ++ public boolean canBeRidden() ++ { ++ if(this instanceof EntityMinecartEmpty) ++ { ++ return true; ++ } ++ return false; ++ } ++ ++ /** ++ * Getters/setters for physics variables ++ */ ++ ++ /** ++ * Returns the carts max speed when traveling on rails. Carts going faster ++ * than 1.1 cause issues with chunk loading. Carts cant traverse slopes or ++ * corners at greater than 0.5 - 0.6. This value is compared with the rails ++ * max speed and the carts current speed cap to determine the carts current ++ * max speed. A normal rail's max speed is 0.4. ++ * ++ * @return Carts max speed. ++ */ ++ public float getMaxCartSpeedOnRail() ++ { ++ return 1.2f; ++ } ++ ++ /** ++ * Returns the current speed cap for the cart when traveling on rails. This ++ * functions differs from getMaxCartSpeedOnRail() in that it controls ++ * current movement and cannot be overridden. The value however can never be ++ * higher than getMaxCartSpeedOnRail(). ++ * ++ * @return ++ */ ++ public final float getCurrentCartSpeedCapOnRail() ++ { ++ return currentSpeedRail; ++ } ++ ++ public final void setCurrentCartSpeedCapOnRail(float value) ++ { ++ value = Math.min(value, getMaxCartSpeedOnRail()); ++ currentSpeedRail = value; ++ } ++ ++ public float getMaxSpeedAirLateral() ++ { ++ return maxSpeedAirLateral; ++ } ++ ++ public void setMaxSpeedAirLateral(float value) ++ { ++ maxSpeedAirLateral = value; ++ } ++ ++ public float getMaxSpeedAirVertical() ++ { ++ return maxSpeedAirVertical; ++ } ++ ++ public void setMaxSpeedAirVertical(float value) ++ { ++ maxSpeedAirVertical = value; ++ } ++ ++ public double getDragAir() ++ { ++ return dragAir; ++ } ++ ++ public void setDragAir(double value) ++ { ++ dragAir = value; ++ } ++ ++ public double getSlopeAdjustment() ++ { ++ return 0.0078125D; ++ } ++ /* =================================== FORGE END ===========================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartContainer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartContainer.java.patch new file mode 100644 index 0000000..14d600c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartContainer.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartContainer.java +@@ -234,6 +234,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) + { + p_130002_1_.func_71007_a(this); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartEmpty.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartEmpty.java.patch new file mode 100644 index 0000000..7c4ed91 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartEmpty.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartEmpty.java +@@ -19,6 +19,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (this.field_70153_n != null && this.field_70153_n instanceof EntityPlayer && this.field_70153_n != p_130002_1_) + { + return true; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartFurnace.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartFurnace.java.patch new file mode 100644 index 0000000..324b3a1 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartFurnace.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartFurnace.java +@@ -122,6 +122,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + ItemStack itemstack = p_130002_1_.field_71071_by.func_70448_g(); + + if (itemstack != null && itemstack.func_77973_b() == Items.field_151044_h) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartHopper.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartHopper.java.patch new file mode 100644 index 0000000..1c80d61 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartHopper.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityMinecartHopper.java +@@ -50,6 +50,7 @@ + + public boolean func_130002_c(EntityPlayer p_130002_1_) + { ++ if(net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, p_130002_1_))) return true; + if (!this.field_70170_p.field_72995_K) + { + p_130002_1_.func_96125_a(this); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityXPOrb.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityXPOrb.java.patch new file mode 100644 index 0000000..e259f17 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityXPOrb.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityXPOrb.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityXPOrb.java +@@ -9,6 +9,8 @@ + import net.minecraft.util.DamageSource; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.PlayerPickupXpEvent; + + public class EntityXPOrb extends Entity + { +@@ -204,6 +206,7 @@ + { + if (this.field_70532_c == 0 && p_70100_1_.field_71090_bL == 0) + { ++ if (MinecraftForge.EVENT_BUS.post(new PlayerPickupXpEvent(p_70100_1_, this))) return; + p_70100_1_.field_71090_bL = 2; + this.field_70170_p.func_72956_a(p_70100_1_, "random.orb", 0.1F, 0.5F * ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.8F)); + p_70100_1_.func_71001_a(this, 1); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityEnderman.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityEnderman.java.patch new file mode 100644 index 0000000..60db956 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityEnderman.java.patch @@ -0,0 +1,88 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityEnderman.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityEnderman.java +@@ -1,6 +1,8 @@ + package net.minecraft.entity.monster; + ++import java.util.IdentityHashMap; + import java.util.UUID; ++import com.google.common.collect.Maps; + import net.minecraft.block.Block; + import net.minecraft.block.material.Material; + import net.minecraft.entity.Entity; +@@ -19,11 +21,14 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.util.Vec3; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.living.EnderTeleportEvent; + + public class EntityEnderman extends EntityMob + { + private static final UUID field_110192_bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); + private static final AttributeModifier field_110193_bq = (new AttributeModifier(field_110192_bp, "Attacking speed boost", 6.199999809265137D, 0)).func_111168_a(false); ++ @Deprecated //DO NOT TOUCH THIS EVER + private static boolean[] field_70827_d = new boolean[256]; + private int field_70828_e; + private int field_70826_g; +@@ -154,7 +159,7 @@ + j = MathHelper.func_76128_c(this.field_70161_v - 2.0D + this.field_70146_Z.nextDouble() * 4.0D); + block = this.field_70170_p.func_147439_a(k, i, j); + +- if (field_70827_d[Block.func_149682_b(block)]) ++ if (EntityEnderman.getCarriable(block)) + { + this.func_146081_a(block); + this.func_70817_b(this.field_70170_p.func_72805_g(k, i, j)); +@@ -265,12 +270,16 @@ + + protected boolean func_70825_j(double p_70825_1_, double p_70825_3_, double p_70825_5_) + { ++ EnderTeleportEvent event = new EnderTeleportEvent(this, p_70825_1_, p_70825_3_, p_70825_5_, 0); ++ if (MinecraftForge.EVENT_BUS.post(event)){ ++ return false; ++ } + double d3 = this.field_70165_t; + double d4 = this.field_70163_u; + double d5 = this.field_70161_v; +- this.field_70165_t = p_70825_1_; +- this.field_70163_u = p_70825_3_; +- this.field_70161_v = p_70825_5_; ++ this.field_70165_t = event.targetX; ++ this.field_70163_u = event.targetY; ++ this.field_70161_v = event.targetZ; + boolean flag = false; + int i = MathHelper.func_76128_c(this.field_70165_t); + int j = MathHelper.func_76128_c(this.field_70163_u); +@@ -415,7 +424,7 @@ + } + } + +- return false; ++ return super.func_70097_a(p_70097_1_, p_70097_2_); + } + else + { +@@ -450,5 +459,23 @@ + field_70827_d[Block.func_149682_b(Blocks.field_150423_aK)] = true; + field_70827_d[Block.func_149682_b(Blocks.field_150440_ba)] = true; + field_70827_d[Block.func_149682_b(Blocks.field_150391_bh)] = true; ++ for (int x = 0; x < field_70827_d.length; x++) ++ { ++ if (field_70827_d[x]) setCarriable(Block.func_149729_e(x), true); ++ } + } ++ ++ /*===================================== Forge Start ==============================*/ ++ private static IdentityHashMap carriable; ++ public static void setCarriable(Block block, boolean canCarry) ++ { ++ if (carriable == null) carriable = new IdentityHashMap(4096); ++ carriable.put(block, canCarry); ++ } ++ public static boolean getCarriable(Block block) ++ { ++ Boolean ret = carriable.get(block); ++ return ret != null ? ret : false; ++ } ++ /*===================================== Forge End ==============================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityMagmaCube.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityMagmaCube.java.patch new file mode 100644 index 0000000..4c1c213 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityMagmaCube.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityMagmaCube.java +@@ -99,6 +99,7 @@ + { + this.field_70181_x = (double)(0.42F + (float)this.func_70809_q() * 0.1F); + this.field_70160_al = true; ++ net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + protected void func_70069_a(float p_70069_1_) {} diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityZombie.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityZombie.java.patch new file mode 100644 index 0000000..6fc5675 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityZombie.java.patch @@ -0,0 +1,74 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntityZombie.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntityZombie.java +@@ -41,6 +41,10 @@ + import net.minecraft.util.MathHelper; + import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeModContainer; ++import cpw.mods.fml.common.eventhandler.Event.Result; ++import net.minecraftforge.event.ForgeEventFactory; ++import net.minecraftforge.event.entity.living.ZombieEvent.SummonAidEvent; + + public class EntityZombie extends EntityMob + { +@@ -78,7 +82,7 @@ + this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(40.0D); + this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a(0.23000000417232513D); + this.func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(3.0D); +- this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * 0.10000000149011612D); ++ this.func_110140_aT().func_111150_b(field_110186_bp).func_111128_a(this.field_70146_Z.nextDouble() * ForgeModContainer.zombieSummonBaseChance); + } + + protected void func_70088_a() +@@ -233,12 +237,28 @@ + entitylivingbase = (EntityLivingBase)p_70097_1_.func_76346_g(); + } + +- if (entitylivingbase != null && this.field_70170_p.field_73013_u == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) ++ ++ int i = MathHelper.func_76128_c(this.field_70165_t); ++ int j = MathHelper.func_76128_c(this.field_70163_u); ++ int k = MathHelper.func_76128_c(this.field_70161_v); ++ ++ SummonAidEvent summonAid = ForgeEventFactory.fireZombieSummonAid(this, field_70170_p, i, j, k, entitylivingbase, this.func_110148_a(field_110186_bp).func_111126_e()); ++ ++ if (summonAid.getResult() == Result.DENY) + { +- int i = MathHelper.func_76128_c(this.field_70165_t); +- int j = MathHelper.func_76128_c(this.field_70163_u); +- int k = MathHelper.func_76128_c(this.field_70161_v); +- EntityZombie entityzombie = new EntityZombie(this.field_70170_p); ++ return true; ++ } ++ else if (summonAid.getResult() == Result.ALLOW || entitylivingbase != null && this.field_70170_p.field_73013_u == EnumDifficulty.HARD && (double)this.field_70146_Z.nextFloat() < this.func_110148_a(field_110186_bp).func_111126_e()) ++ { ++ EntityZombie entityzombie; ++ if (summonAid.customSummonedAid != null && summonAid.getResult() == Result.ALLOW) ++ { ++ entityzombie = summonAid.customSummonedAid; ++ } ++ else ++ { ++ entityzombie = new EntityZombie(this.field_70170_p); ++ } + + for (int l = 0; l < 50; ++l) + { +@@ -253,7 +273,7 @@ + if (this.field_70170_p.func_72855_b(entityzombie.field_70121_D) && this.field_70170_p.func_72945_a(entityzombie, entityzombie.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(entityzombie.field_70121_D)) + { + this.field_70170_p.func_72838_d(entityzombie); +- entityzombie.func_70624_b(entitylivingbase); ++ if (entitylivingbase != null) entityzombie.func_70624_b(entitylivingbase); + entityzombie.func_110161_a((IEntityLivingData)null); + this.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); + entityzombie.func_110148_a(field_110186_bp).func_111121_a(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); +@@ -439,7 +459,7 @@ + + if (p_110161_1_1 == null) + { +- p_110161_1_1 = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < 0.05F, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, null); ++ p_110161_1_1 = new EntityZombie.GroupData(this.field_70170_p.field_73012_v.nextFloat() < ForgeModContainer.zombieBabyChance, this.field_70170_p.field_73012_v.nextFloat() < 0.05F, null); + } + + if (p_110161_1_1 instanceof EntityZombie.GroupData) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityHorse.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityHorse.java.patch new file mode 100644 index 0000000..72f00a7 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityHorse.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityHorse.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityHorse.java +@@ -1227,6 +1227,7 @@ + } + + this.field_110277_bt = 0.0F; ++ net.minecraftforge.common.ForgeHooks.onLivingJump(this); + } + + this.field_70138_W = 1.0F; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityMooshroom.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityMooshroom.java.patch new file mode 100644 index 0000000..0a33c19 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityMooshroom.java.patch @@ -0,0 +1,86 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityMooshroom.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityMooshroom.java +@@ -1,14 +1,18 @@ + package net.minecraft.entity.passive; + ++import java.util.ArrayList; ++ + import net.minecraft.entity.EntityAgeable; + import net.minecraft.entity.item.EntityItem; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.init.Items; + import net.minecraft.item.ItemStack; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + +-public class EntityMooshroom extends EntityCow ++public class EntityMooshroom extends EntityCow implements IShearable + { + private static final String __OBFID = "CL_00001645"; + +@@ -37,32 +41,7 @@ + } + } + +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && this.func_70874_b() >= 0) + { +- this.func_70106_y(); +- this.field_70170_p.func_72869_a("largeexplode", this.field_70165_t, this.field_70163_u + (double)(this.field_70131_O / 2.0F), this.field_70161_v, 0.0D, 0.0D, 0.0D); +- +- if (!this.field_70170_p.field_72995_K) +- { +- EntityCow entitycow = new EntityCow(this.field_70170_p); +- entitycow.func_70012_b(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A); +- entitycow.func_70606_j(this.func_110143_aJ()); +- entitycow.field_70761_aq = this.field_70761_aq; +- this.field_70170_p.func_72838_d(entitycow); +- +- for (int i = 0; i < 5; ++i) +- { +- this.field_70170_p.func_72838_d(new EntityItem(this.field_70170_p, this.field_70165_t, this.field_70163_u + (double)this.field_70131_O, this.field_70161_v, new ItemStack(Blocks.field_150337_Q))); +- } +- +- itemstack.func_77972_a(1, p_70085_1_); +- this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); +- } +- +- return true; +- } +- else +- { + return super.func_70085_c(p_70085_1_); + } + } +@@ -71,4 +50,30 @@ + { + return new EntityMooshroom(this.field_70170_p); + } ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ return func_70874_b() >= 0; ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ func_70106_y(); ++ EntityCow entitycow = new EntityCow(field_70170_p); ++ entitycow.func_70012_b(field_70165_t, field_70163_u, field_70161_v, field_70177_z, field_70125_A); ++ entitycow.func_70606_j(this.func_110143_aJ()); ++ entitycow.field_70761_aq = field_70761_aq; ++ field_70170_p.func_72838_d(entitycow); ++ field_70170_p.func_72869_a("largeexplode", field_70165_t, field_70163_u + (double)(field_70131_O / 2.0F), field_70161_v, 0.0D, 0.0D, 0.0D); ++ ++ ArrayList ret = new ArrayList(); ++ for (int i = 0; i < 5; i++) ++ { ++ ret.add(new ItemStack(Blocks.field_150337_Q)); ++ } ++ func_85030_a("mob.sheep.shear", 1.0F, 1.0F); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityOcelot.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityOcelot.java.patch new file mode 100644 index 0000000..f110d1d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityOcelot.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityOcelot.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityOcelot.java +@@ -281,7 +281,7 @@ + + Block block = this.field_70170_p.func_147439_a(i, j - 1, k); + +- if (block == Blocks.field_150349_c || block.func_149688_o() == Material.field_151584_j) ++ if (block == Blocks.field_150349_c || block.isLeaves(field_70170_p, i, j - 1, k)) + { + return true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntitySheep.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntitySheep.java.patch new file mode 100644 index 0000000..98dd31c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntitySheep.java.patch @@ -0,0 +1,77 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java +@@ -2,6 +2,7 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.ArrayList; + import java.util.Random; + import net.minecraft.block.Block; + import net.minecraft.entity.EntityAgeable; +@@ -27,9 +28,11 @@ + import net.minecraft.item.crafting.CraftingManager; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + +-public class EntitySheep extends EntityAnimal ++public class EntitySheep extends EntityAnimal implements IShearable + { + private final InventoryCrafting field_90016_e = new InventoryCrafting(new Container() + { +@@ -124,28 +127,6 @@ + + public boolean func_70085_c(EntityPlayer p_70085_1_) + { +- ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); +- +- if (itemstack != null && itemstack.func_77973_b() == Items.field_151097_aZ && !this.func_70892_o() && !this.func_70631_g_()) +- { +- if (!this.field_70170_p.field_72995_K) +- { +- this.func_70893_e(true); +- int i = 1 + this.field_70146_Z.nextInt(3); +- +- for (int j = 0; j < i; ++j) +- { +- EntityItem entityitem = this.func_70099_a(new ItemStack(Item.func_150898_a(Blocks.field_150325_L), 1, this.func_70896_n()), 1.0F); +- entityitem.field_70181_x += (double)(this.field_70146_Z.nextFloat() * 0.05F); +- entityitem.field_70159_w += (double)((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.1F); +- entityitem.field_70179_y += (double)((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.1F); +- } +- } +- +- itemstack.func_77972_a(1, p_70085_1_); +- this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); +- } +- + return super.func_70085_c(p_70085_1_); + } + +@@ -290,4 +271,24 @@ + { + return 15 - ((EntitySheep)p_90013_1_).func_70896_n(); + } ++ ++ @Override ++ public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) ++ { ++ return !func_70892_o() && !func_70631_g_(); ++ } ++ ++ @Override ++ public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) ++ { ++ ArrayList ret = new ArrayList(); ++ func_70893_e(true); ++ int i = 1 + field_70146_Z.nextInt(3); ++ for (int j = 0; j < i; j++) ++ { ++ ret.add(new ItemStack(Blocks.field_150325_L, 1, func_70896_n())); ++ } ++ this.func_85030_a("mob.sheep.shear", 1.0F, 1.0F); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityVillager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityVillager.java.patch new file mode 100644 index 0000000..4785b4f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityVillager.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java +@@ -180,7 +180,7 @@ + ItemStack itemstack = p_70085_1_.field_71071_by.func_70448_g(); + boolean flag = itemstack != null && itemstack.func_77973_b() == Items.field_151063_bx; + +- if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_()) ++ if (!flag && this.func_70089_S() && !this.func_70940_q() && !this.func_70631_g_() && !p_70085_1_.func_70093_af()) + { + if (!this.field_70170_p.field_72995_K) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayer.java.patch new file mode 100644 index 0000000..70a5570 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayer.java.patch @@ -0,0 +1,679 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java +@@ -8,9 +8,12 @@ + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.Collection; ++import java.util.HashMap; + import java.util.Iterator; + import java.util.List; + import java.util.UUID; ++import java.util.Map.Entry; ++ + import net.minecraft.block.Block; + import net.minecraft.block.BlockBed; + import net.minecraft.block.material.Material; +@@ -77,8 +80,24 @@ + import net.minecraft.world.WorldSettings; + import net.minecraft.world.chunk.IChunkProvider; + ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.ISpecialArmor.ArmorProperties; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.ForgeEventFactory; ++import net.minecraftforge.event.entity.living.LivingHurtEvent; ++import net.minecraftforge.event.entity.player.AttackEntityEvent; ++import net.minecraftforge.event.entity.player.EntityInteractEvent; ++import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; ++import net.minecraftforge.event.entity.player.PlayerDropsEvent; ++import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent; ++import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; ++ + public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender + { ++ public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; ++ private HashMap spawnChunkMap = new HashMap(); ++ private HashMap spawnForcedMap = new HashMap(); ++ + public InventoryPlayer field_71071_by = new InventoryPlayer(this); + private InventoryEnderChest field_71078_a = new InventoryEnderChest(); + public Container field_71069_bz; +@@ -129,6 +148,7 @@ + this.func_70012_b((double)chunkcoordinates.field_71574_a + 0.5D, (double)(chunkcoordinates.field_71572_b + 1), (double)chunkcoordinates.field_71573_c + 0.5D, 0.0F, 0.0F); + this.field_70741_aB = 180.0F; + this.field_70174_ab = 20; ++ this.eyeHeight = this.getDefaultEyeHeight(); + } + + protected void func_110147_ax() +@@ -172,7 +192,8 @@ + { + if (this.field_71074_e != null) + { +- this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); ++ if (!ForgeEventFactory.onUseItemStop(this, field_71074_e, field_71072_f)) ++ this.field_71074_e.func_77974_b(this.field_70170_p, this, this.field_71072_f); + } + + this.func_71041_bz(); +@@ -203,14 +224,23 @@ + + if (itemstack == this.field_71074_e) + { +- if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) ++ field_71072_f = ForgeEventFactory.onItemUseTick(this, field_71074_e, field_71072_f); ++ if (field_71072_f <= 0) + { +- this.func_71010_c(itemstack, 5); ++ this.func_71036_o(); + } +- +- if (--this.field_71072_f == 0 && !this.field_70170_p.field_72995_K) ++ else + { +- this.func_71036_o(); ++ field_71074_e.func_77973_b().onUsingTick(field_71074_e, this, field_71072_f); ++ if (this.field_71072_f <= 25 && this.field_71072_f % 4 == 0) ++ { ++ this.func_71010_c(itemstack, 5); ++ } ++ ++ if (--this.field_71072_f == 0 && !this.field_70170_p.field_72995_K) ++ { ++ this.func_71036_o(); ++ } + } + } + else +@@ -257,7 +287,7 @@ + + super.func_70071_h_(); + +- if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !ForgeHooks.canInteractWith(this, this.field_71070_bA)) + { + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; +@@ -388,11 +418,13 @@ + int i = this.field_71074_e.field_77994_a; + ItemStack itemstack = this.field_71074_e.func_77950_b(this.field_70170_p, this); + ++ itemstack = ForgeEventFactory.onItemUseFinish(this, field_71074_e, field_71072_f, itemstack); ++ + if (itemstack != this.field_71074_e || itemstack != null && itemstack.field_77994_a != i) + { + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = itemstack; + +- if (itemstack.field_77994_a == 0) ++ if (itemstack != null && itemstack.field_77994_a == 0) + { + this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = null; + } +@@ -466,11 +498,11 @@ + this.field_71109_bG = 0.0F; + this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2); + +- if (this.field_70154_o instanceof EntityPig) ++ if (this.field_70154_o instanceof EntityLivingBase && ((EntityLivingBase)field_70154_o).shouldRiderFaceForward(this)) + { + this.field_70125_A = f1; + this.field_70177_z = f; +- this.field_70761_aq = ((EntityPig)this.field_70154_o).field_70761_aq; ++ this.field_70761_aq = ((EntityLivingBase)this.field_70154_o).field_70761_aq; + } + } + } +@@ -595,11 +627,15 @@ + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + super.func_70645_a(p_70645_1_); + this.func_70105_a(0.2F, 0.2F); + this.func_70107_b(this.field_70165_t, this.field_70163_u, this.field_70161_v); + this.field_70181_x = 0.10000000149011612D; + ++ captureDrops = true; ++ capturedDrops.clear(); ++ + if (this.func_70005_c_().equals("Notch")) + { + this.func_146097_a(new ItemStack(Items.field_151034_e, 1), true, false); +@@ -610,6 +646,20 @@ + this.field_71071_by.func_70436_m(); + } + ++ captureDrops = false; ++ ++ if (!field_70170_p.field_72995_K) ++ { ++ PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); ++ if (!MinecraftForge.EVENT_BUS.post(event)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ func_71012_a(item); ++ } ++ } ++ } ++ + if (p_70645_1_ != null) + { + this.field_70159_w = (double)(-MathHelper.func_76134_b((this.field_70739_aP + this.field_70177_z) * (float)Math.PI / 180.0F) * 0.1F); +@@ -661,12 +711,25 @@ + + public EntityItem func_71040_bB(boolean p_71040_1_) + { +- return this.func_146097_a(this.field_71071_by.func_70298_a(this.field_71071_by.field_70461_c, p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1), false, true); ++ ItemStack stack = field_71071_by.func_70448_g(); ++ ++ if (stack == null) ++ { ++ return null; ++ } ++ ++ if (stack.func_77973_b().onDroppedByPlayer(stack, this)) ++ { ++ int count = p_71040_1_ && this.field_71071_by.func_70448_g() != null ? this.field_71071_by.func_70448_g().field_77994_a : 1; ++ return ForgeHooks.onPlayerTossEvent(this, field_71071_by.func_70298_a(field_71071_by.field_70461_c, count), true); ++ } ++ ++ return null; + } + + public EntityItem func_71019_a(ItemStack p_71019_1_, boolean p_71019_2_) + { +- return this.func_146097_a(p_71019_1_, false, false); ++ return ForgeHooks.onPlayerTossEvent(this, p_71019_1_, false); + } + + public EntityItem func_146097_a(ItemStack p_146097_1_, boolean p_146097_2_, boolean p_146097_3_) +@@ -722,13 +785,31 @@ + + public void func_71012_a(EntityItem p_71012_1_) + { ++ if (captureDrops) ++ { ++ capturedDrops.add(p_71012_1_); ++ return; ++ } + this.field_70170_p.func_72838_d(p_71012_1_); + } + ++ @Deprecated //Metadata sensitive version, named getBreakSpeed + public float func_146096_a(Block p_146096_1_, boolean p_146096_2_) + { +- float f = this.field_71071_by.func_146023_a(p_146096_1_); ++ return getBreakSpeed(p_146096_1_, p_146096_2_, 0, 0, -1, 0); ++ } + ++ @Deprecated //Location Specifc, one below, remove in 1.8 ++ public float getBreakSpeed(Block p_146096_1_, boolean p_146096_2_, int meta) ++ { ++ return getBreakSpeed(p_146096_1_, p_146096_2_, meta, 0, -1, 0); ++ } ++ ++ public float getBreakSpeed(Block p_146096_1_, boolean p_146096_2_, int meta, int x, int y, int z) ++ { ++ ItemStack stack = field_71071_by.func_70448_g(); ++ float f = (stack == null ? 1.0F : stack.func_77973_b().getDigSpeed(stack, p_146096_1_, meta)); ++ + if (f > 1.0F) + { + int i = EnchantmentHelper.func_77509_b(this); +@@ -738,7 +819,9 @@ + { + float f1 = (float)(i * i + 1); + +- if (!itemstack.func_150998_b(p_146096_1_) && f <= 1.0F) ++ boolean canHarvest = ForgeHooks.canToolHarvestBlock(p_146096_1_, meta, itemstack); ++ ++ if (!canHarvest && f <= 1.0F) + { + f += f1 * 0.08F; + } +@@ -769,12 +852,13 @@ + f /= 5.0F; + } + +- return f; ++ f = ForgeEventFactory.getBreakSpeed(this, p_146096_1_, meta, f, x, y, z); ++ return (f < 0 ? 0 : f); + } + + public boolean func_146099_a(Block p_146099_1_) + { +- return this.field_71071_by.func_146025_b(p_146099_1_); ++ return ForgeEventFactory.doPlayerHarvestCheck(this, p_146099_1_, this.field_71071_by.func_146025_b(p_146099_1_)); + } + + public void func_70037_a(NBTTagCompound p_70037_1_) +@@ -803,6 +887,16 @@ + this.field_82248_d = p_70037_1_.func_74767_n("SpawnForced"); + } + ++ NBTTagList spawnlist = null; ++ spawnlist = p_70037_1_.func_150295_c("Spawns", 10); ++ for (int i = 0; i < spawnlist.func_74745_c(); i++) ++ { ++ NBTTagCompound spawndata = (NBTTagCompound)spawnlist.func_150305_b(i); ++ int spawndim = spawndata.func_74762_e("Dim"); ++ this.spawnChunkMap.put(spawndim, new ChunkCoordinates(spawndata.func_74762_e("SpawnX"), spawndata.func_74762_e("SpawnY"), spawndata.func_74762_e("SpawnZ"))); ++ this.spawnForcedMap.put(spawndim, spawndata.func_74767_n("SpawnForced")); ++ } ++ + this.field_71100_bB.func_75112_a(p_70037_1_); + this.field_71075_bZ.func_75095_b(p_70037_1_); + +@@ -833,6 +927,23 @@ + p_70014_1_.func_74757_a("SpawnForced", this.field_82248_d); + } + ++ NBTTagList spawnlist = new NBTTagList(); ++ for (Entry entry : this.spawnChunkMap.entrySet()) ++ { ++ ChunkCoordinates spawn = entry.getValue(); ++ if (spawn == null) continue; ++ Boolean forced = spawnForcedMap.get(entry.getKey()); ++ if (forced == null) forced = false; ++ NBTTagCompound spawndata = new NBTTagCompound(); ++ spawndata.func_74768_a("Dim", entry.getKey()); ++ spawndata.func_74768_a("SpawnX", spawn.field_71574_a); ++ spawndata.func_74768_a("SpawnY", spawn.field_71572_b); ++ spawndata.func_74768_a("SpawnZ", spawn.field_71573_c); ++ spawndata.func_74757_a("SpawnForced", forced); ++ spawnlist.func_74742_a(spawndata); ++ } ++ p_70014_1_.func_74782_a("Spawns", spawnlist); ++ + this.field_71100_bB.func_75117_b(p_70014_1_); + this.field_71075_bZ.func_75091_a(p_70014_1_); + p_70014_1_.func_74782_a("EnderItems", this.field_71078_a.func_70487_g()); +@@ -854,7 +965,7 @@ + + public float func_70047_e() + { +- return 0.12F; ++ return eyeHeight; + } + + protected void func_71061_d_() +@@ -864,6 +975,7 @@ + + public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) + { ++ if (ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; + if (this.func_85032_ar()) + { + return false; +@@ -965,12 +1077,15 @@ + { + if (!this.func_85032_ar()) + { ++ p_70665_2_ = ForgeHooks.onLivingHurt(this, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + if (!p_70665_1_.func_76363_c() && this.func_70632_aY() && p_70665_2_ > 0.0F) + { + p_70665_2_ = (1.0F + p_70665_2_) * 0.5F; + } + +- p_70665_2_ = this.func_70655_b(p_70665_1_, p_70665_2_); ++ p_70665_2_ = ArmorProperties.ApplyArmor(this, field_71071_by.field_70460_b, p_70665_1_, p_70665_2_); ++ if (p_70665_2_ <= 0) return; + p_70665_2_ = this.func_70672_c(p_70665_1_, p_70665_2_); + float f1 = p_70665_2_; + p_70665_2_ = Math.max(p_70665_2_ - this.func_110139_bj(), 0.0F); +@@ -1004,6 +1119,7 @@ + + public boolean func_70998_m(Entity p_70998_1_) + { ++ if (MinecraftForge.EVENT_BUS.post(new EntityInteractEvent(this, p_70998_1_))) return false; + ItemStack itemstack = this.func_71045_bC(); + ItemStack itemstack1 = itemstack != null ? itemstack.func_77946_l() : null; + +@@ -1054,7 +1170,9 @@ + + public void func_71028_bD() + { ++ ItemStack orig = func_71045_bC(); + this.field_71071_by.func_70299_a(this.field_71071_by.field_70461_c, (ItemStack)null); ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this, orig)); + } + + public double func_70033_W() +@@ -1064,6 +1182,15 @@ + + public void func_71059_n(Entity p_71059_1_) + { ++ if (MinecraftForge.EVENT_BUS.post(new AttackEntityEvent(this, p_71059_1_))) ++ { ++ return; ++ } ++ ItemStack stack = func_71045_bC(); ++ if (stack != null && stack.func_77973_b().onLeftClickEntity(stack, this, p_71059_1_)) ++ { ++ return; ++ } + if (p_71059_1_.func_70075_an()) + { + if (!p_71059_1_.func_85031_j(this)) +@@ -1211,6 +1338,12 @@ + + public EntityPlayer.EnumStatus func_71018_a(int p_71018_1_, int p_71018_2_, int p_71018_3_) + { ++ PlayerSleepInBedEvent event = new PlayerSleepInBedEvent(this, p_71018_1_, p_71018_2_, p_71018_3_); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.result != null) ++ { ++ return event.result; ++ } + if (!this.field_70170_p.field_72995_K) + { + if (this.func_70608_bn() || !this.func_70089_S()) +@@ -1253,8 +1386,7 @@ + + if (this.field_70170_p.func_72899_e(p_71018_1_, p_71018_2_, p_71018_3_)) + { +- int i1 = this.field_70170_p.func_72805_g(p_71018_1_, p_71018_2_, p_71018_3_); +- int l = BlockBed.func_149895_l(i1); ++ int l = field_70170_p.func_147439_a(p_71018_1_, p_71018_2_, p_71018_3_).getBedDirection(field_70170_p, p_71018_1_, p_71018_2_, p_71018_3_); + float f1 = 0.5F; + float f = 0.5F; + +@@ -1317,15 +1449,17 @@ + + public void func_70999_a(boolean p_70999_1_, boolean p_70999_2_, boolean p_70999_3_) + { ++ MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerWakeUpEvent(this, p_70999_1_, p_70999_2_, p_70999_3_)); + this.func_70105_a(0.6F, 1.8F); + this.func_71061_d_(); + ChunkCoordinates chunkcoordinates = this.field_71081_bT; + ChunkCoordinates chunkcoordinates1 = this.field_71081_bT; ++ Block block = (chunkcoordinates == null ? null : field_70170_p.func_147439_a(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c)); + +- if (chunkcoordinates != null && this.field_70170_p.func_147439_a(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c) == Blocks.field_150324_C) ++ if (chunkcoordinates != null && block.isBed(field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this)) + { +- BlockBed.func_149979_a(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, false); +- chunkcoordinates1 = BlockBed.func_149977_a(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, 0); ++ block.setBedOccupied(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this, false); ++ chunkcoordinates1 = block.getBedSpawnPosition(this.field_70170_p, chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c, this); + + if (chunkcoordinates1 == null) + { +@@ -1359,7 +1493,7 @@ + + private boolean func_71065_l() + { +- return this.field_70170_p.func_147439_a(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c) == Blocks.field_150324_C; ++ return this.field_70170_p.func_147439_a(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c).isBed(field_70170_p, field_71081_bT.field_71574_a, field_71081_bT.field_71572_b, field_71081_bT.field_71573_c, this); + } + + public static ChunkCoordinates func_71056_a(World p_71056_0_, ChunkCoordinates p_71056_1_, boolean p_71056_2_) +@@ -1370,9 +1504,9 @@ + ichunkprovider.func_73158_c(p_71056_1_.field_71574_a - 3 >> 4, p_71056_1_.field_71573_c + 3 >> 4); + ichunkprovider.func_73158_c(p_71056_1_.field_71574_a + 3 >> 4, p_71056_1_.field_71573_c + 3 >> 4); + +- if (p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c) == Blocks.field_150324_C) ++ if (p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c).isBed(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, null)) + { +- ChunkCoordinates chunkcoordinates1 = BlockBed.func_149977_a(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, 0); ++ ChunkCoordinates chunkcoordinates1 = p_71056_0_.func_147439_a(p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c).getBedSpawnPosition(p_71056_0_, p_71056_1_.field_71574_a, p_71056_1_.field_71572_b, p_71056_1_.field_71573_c, null); + return chunkcoordinates1; + } + else +@@ -1390,8 +1524,10 @@ + { + if (this.field_71081_bT != null) + { +- int i = this.field_70170_p.func_72805_g(this.field_71081_bT.field_71574_a, this.field_71081_bT.field_71572_b, this.field_71081_bT.field_71573_c); +- int j = BlockBed.func_149895_l(i); ++ int x = field_71081_bT.field_71574_a; ++ int y = field_71081_bT.field_71572_b; ++ int z = field_71081_bT.field_71573_c; ++ int j = field_70170_p.func_147439_a(x, y, z).getBedDirection(field_70170_p, x, y, z); + + switch (j) + { +@@ -1447,18 +1583,25 @@ + + public void func_146105_b(IChatComponent p_146105_1_) {} + ++ @Deprecated + public ChunkCoordinates func_70997_bJ() + { +- return this.field_71077_c; ++ return getBedLocation(this.field_71093_bK); + } + ++ @Deprecated + public boolean func_82245_bX() + { +- return this.field_82248_d; ++ return isSpawnForced(this.field_71093_bK); + } + + public void func_71063_a(ChunkCoordinates p_71063_1_, boolean p_71063_2_) + { ++ if (this.field_71093_bK != 0) ++ { ++ setSpawnChunk(p_71063_1_, p_71063_2_, this.field_71093_bK); ++ return; ++ } + if (p_71063_1_ != null) + { + this.field_71077_c = new ChunkCoordinates(p_71063_1_); +@@ -1632,6 +1775,10 @@ + + super.func_70069_a(p_70069_1_); + } ++ else ++ { ++ MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_)); ++ } + } + + protected String func_146067_o(int p_146067_1_) +@@ -1674,11 +1821,6 @@ + } + else + { +- if (p_70620_1_.func_77973_b().func_77623_v()) +- { +- return p_70620_1_.func_77973_b().func_77618_c(p_70620_1_.func_77960_j(), p_70620_2_); +- } +- + if (this.field_71074_e != null && p_70620_1_.func_77973_b() == Items.field_151031_f) + { + int j = p_70620_1_.func_77988_m() - this.field_71072_f; +@@ -1698,6 +1840,7 @@ + return Items.field_151031_f.func_94599_c(0); + } + } ++ iicon = p_70620_1_.func_77973_b().getIcon(p_70620_1_, p_70620_2_, this, field_71074_e, field_71072_f); + } + + return iicon; +@@ -1781,6 +1924,8 @@ + { + if (p_71008_1_ != this.field_71074_e) + { ++ p_71008_2_ = ForgeEventFactory.onItemUseStart(this, p_71008_1_, p_71008_2_); ++ if (p_71008_2_ <= 0) return; + this.field_71074_e = p_71008_1_; + this.field_71072_f = p_71008_2_; + +@@ -1864,6 +2009,10 @@ + this.field_71106_cc = p_71049_1_.field_71106_cc; + this.func_85040_s(p_71049_1_.func_71037_bA()); + this.field_82152_aq = p_71049_1_.field_82152_aq; ++ //Copy and re-init ExtendedProperties when switching dimensions. ++ this.extendedProperties = p_71049_1_.extendedProperties; ++ for (net.minecraftforge.common.IExtendedEntityProperties p : this.extendedProperties.values()) ++ p.init(this, this.field_70170_p); + } + else if (this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) + { +@@ -1875,6 +2024,18 @@ + } + + this.field_71078_a = p_71049_1_.field_71078_a; ++ ++ this.spawnChunkMap = p_71049_1_.spawnChunkMap; ++ this.spawnForcedMap = p_71049_1_.spawnForcedMap; ++ ++ //Copy over a section of the Entity Data from the old player. ++ //Allows mods to specify data that persists after players respawn. ++ NBTTagCompound old = p_71049_1_.getEntityData(); ++ if (old.func_74764_b(PERSISTED_NBT_TAG)) ++ { ++ getEntityData().func_74782_a(PERSISTED_NBT_TAG, old.func_74775_l(PERSISTED_NBT_TAG)); ++ } ++ MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerEvent.Clone(this, p_71049_1_, !p_71049_2_)); + } + + protected boolean func_70041_e_() +@@ -1913,7 +2074,14 @@ + + public void func_70062_b(int p_70062_1_, ItemStack p_70062_2_) + { +- this.field_71071_by.field_70460_b[p_70062_1_] = p_70062_2_; ++ if (p_70062_1_ == 0) ++ { ++ this.field_71071_by.field_70462_a[this.field_71071_by.field_70461_c] = p_70062_2_; ++ } ++ else ++ { ++ this.field_71071_by.field_70460_b[p_70062_1_ - 1] = p_70062_2_; ++ } + } + + @SideOnly(Side.CLIENT) +@@ -1958,7 +2126,7 @@ + + public IChatComponent func_145748_c_() + { +- ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.func_70005_c_())); ++ ChatComponentText chatcomponenttext = new ChatComponentText(ScorePlayerTeam.func_96667_a(this.func_96124_cp(), this.getDisplayName())); + chatcomponenttext.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.func_70005_c_() + " ")); + return chatcomponenttext; + } +@@ -2041,6 +2209,118 @@ + FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); + } + ++ /* ======================================== FORGE START =====================================*/ ++ @SideOnly(Side.CLIENT) ++ @Override ++ public Vec3 func_70666_h(float par1) ++ { ++ if (par1 == 1.0F) ++ { ++ return Vec3.func_72443_a(this.field_70165_t, this.field_70163_u + (this.func_70047_e() - this.getDefaultEyeHeight()), this.field_70161_v); ++ } ++ else ++ { ++ double d0 = this.field_70169_q + (this.field_70165_t - this.field_70169_q) * (double)par1; ++ double d1 = this.field_70167_r + (this.field_70163_u - this.field_70167_r) * (double)par1 + (this.func_70047_e() - this.getDefaultEyeHeight()); ++ double d2 = this.field_70166_s + (this.field_70161_v - this.field_70166_s) * (double)par1; ++ return Vec3.func_72443_a(d0, d1, d2); ++ } ++ } ++ ++ /** ++ * A dimension aware version of getBedLocation. ++ * @param dimension The dimension to get the bed spawn for ++ * @return The player specific spawn location for the dimension. May be null. ++ */ ++ public ChunkCoordinates getBedLocation(int dimension) ++ { ++ return dimension == 0 ? field_71077_c : spawnChunkMap.get(dimension); ++ } ++ ++ /** ++ * 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 ++ * @return The player specific spawn location for the dimension. May be null. ++ */ ++ public boolean isSpawnForced(int dimension) ++ { ++ if (dimension == 0) return this.field_82248_d; ++ Boolean forced = this.spawnForcedMap.get(dimension); ++ return forced == null ? false : forced; ++ } ++ ++ /** ++ * A dimension aware version of setSpawnChunk. ++ * This functions identically, but allows you to specify which dimension to affect, rather than affecting the player's current dimension. ++ * @param chunkCoordinates 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 ++ */ ++ public void setSpawnChunk(ChunkCoordinates chunkCoordinates, boolean forced, int dimension) ++ { ++ if (dimension == 0) ++ { ++ if (chunkCoordinates != null) ++ { ++ field_71077_c = new ChunkCoordinates(chunkCoordinates); ++ field_82248_d = forced; ++ } ++ else ++ { ++ field_71077_c = null; ++ field_82248_d = false; ++ } ++ return; ++ } ++ ++ if (chunkCoordinates != null) ++ { ++ spawnChunkMap.put(dimension, new ChunkCoordinates(chunkCoordinates)); ++ spawnForcedMap.put(dimension, forced); ++ } ++ else ++ { ++ spawnChunkMap.remove(dimension); ++ spawnForcedMap.remove(dimension); ++ } ++ } ++ ++ public float eyeHeight; ++ private String displayname; ++ ++ /** ++ * Returns the default eye height of the player ++ * @return player default eye height ++ */ ++ public float getDefaultEyeHeight() ++ { ++ return 0.12F; ++ } ++ ++ /** ++ * Get the currently computed display name, cached for efficiency. ++ * @return the current display name ++ */ ++ public String getDisplayName() ++ { ++ if(this.displayname == null) ++ { ++ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); ++ } ++ return this.displayname; ++ } ++ ++ /** ++ * Force the displayed name to refresh ++ */ ++ public void refreshDisplayName() ++ { ++ this.displayname = ForgeEventFactory.getPlayerDisplayName(this, this.func_70005_c_()); ++ } ++ /* ======================================== FORGE END =====================================*/ ++ + public static enum EnumStatus + { + OK, diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayerMP.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayerMP.java.patch new file mode 100644 index 0000000..e68a921 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -0,0 +1,123 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java +@@ -100,6 +100,12 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import net.minecraft.entity.item.EntityItem; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.PlayerDropsEvent; ++import net.minecraftforge.event.world.ChunkWatchEvent; ++ + public class EntityPlayerMP extends EntityPlayer implements ICrafting + { + private static final Logger field_147102_bM = LogManager.getLogger(); +@@ -132,19 +138,11 @@ + super(p_i45285_2_, p_i45285_3_); + p_i45285_4_.field_73090_b = this; + this.field_71134_c = p_i45285_4_; +- ChunkCoordinates chunkcoordinates = p_i45285_2_.func_72861_E(); ++ ChunkCoordinates chunkcoordinates = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint(); + int i = chunkcoordinates.field_71574_a; + int j = chunkcoordinates.field_71573_c; + int k = chunkcoordinates.field_71572_b; + +- if (!p_i45285_2_.field_73011_w.field_76576_e && p_i45285_2_.func_72912_H().func_76077_q() != WorldSettings.GameType.ADVENTURE) +- { +- int l = Math.max(5, p_i45285_1_.func_82357_ak() - 6); +- i += this.field_70146_Z.nextInt(l * 2) - l; +- j += this.field_70146_Z.nextInt(l * 2) - l; +- k = p_i45285_2_.func_72825_h(i, j); +- } +- + this.field_71133_b = p_i45285_1_; + this.field_147103_bO = p_i45285_1_.func_71203_ab().func_152602_a(this); + this.field_70138_W = 0.0F; +@@ -198,7 +196,7 @@ + + public float func_70047_e() + { +- return 1.62F; ++ return super.func_70047_e(); + } + + public void func_70071_h_() +@@ -213,7 +211,7 @@ + + this.field_71070_bA.func_75142_b(); + +- if (!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this)) ++ if (!this.field_70170_p.field_72995_K && !ForgeHooks.canInteractWith(this, this.field_71070_bA)) + { + this.func_71053_j(); + this.field_71070_bA = this.field_71069_bz; +@@ -255,7 +253,8 @@ + if (chunk.func_150802_k()) + { + arraylist.add(chunk); +- arraylist1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 16, 256, chunkcoordintpair.field_77275_b * 16 + 16)); ++ arraylist1.addAll(((WorldServer)this.field_70170_p).func_147486_a(chunkcoordintpair.field_77276_a * 16, 0, chunkcoordintpair.field_77275_b * 16, chunkcoordintpair.field_77276_a * 16 + 15, 256, chunkcoordintpair.field_77275_b * 16 + 15)); ++ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it. + iterator1.remove(); + } + } +@@ -283,6 +282,7 @@ + { + chunk = (Chunk)iterator2.next(); + this.func_71121_q().func_73039_n().func_85172_a(this, chunk); ++ MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(chunk.func_76632_l(), this)); + } + } + } +@@ -402,11 +402,25 @@ + + public void func_70645_a(DamageSource p_70645_1_) + { ++ if (ForgeHooks.onLivingDeath(this, p_70645_1_)) return; + this.field_71133_b.func_71203_ab().func_148539_a(this.func_110142_aN().func_151521_b()); + + if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory")) + { ++ captureDrops = true; ++ capturedDrops.clear(); ++ + this.field_71071_by.func_70436_m(); ++ ++ captureDrops = false; ++ PlayerDropsEvent event = new PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0); ++ if (!MinecraftForge.EVENT_BUS.post(event)) ++ { ++ for (EntityItem item : capturedDrops) ++ { ++ func_71012_a(item); ++ } ++ } + } + + Collection collection = this.field_70170_p.func_96441_U().func_96520_a(IScoreObjectiveCriteria.field_96642_c); +@@ -806,6 +820,7 @@ + { + if (p_71064_1_ != null) + { ++ if (p_71064_1_.func_75967_d() && MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) p_71064_1_))) return; + this.field_147103_bO.func_150871_b(this, p_71064_1_, p_71064_2_); + Iterator iterator = this.func_96123_co().func_96520_a(p_71064_1_.func_150952_k()).iterator(); + +@@ -1021,4 +1036,16 @@ + { + return this.field_143005_bX; + } ++ ++ /* ===================================== FORGE START =====================================*/ ++ /** ++ * Returns the default eye height of the player ++ * @return player default eye height ++ */ ++ @Override ++ public float getDefaultEyeHeight() ++ { ++ return 1.62F; ++ } ++ /* ===================================== FORGE END =====================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/InventoryPlayer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/InventoryPlayer.java.patch new file mode 100644 index 0000000..864d4ab --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/InventoryPlayer.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java +@@ -311,6 +311,14 @@ + this.field_70462_a[i].func_77945_a(this.field_70458_d.field_70170_p, this.field_70458_d, i, this.field_70461_c == i); + } + } ++ ++ for (int i = 0; i < field_70460_b.length; i++) ++ { ++ if (field_70460_b[i] != null) ++ { ++ field_70460_b[i].func_77973_b().onArmorTick(field_70458_d.field_70170_p, field_70458_d, field_70460_b[i]); ++ } ++ } + } + + public boolean func_146026_a(Item p_146026_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/projectile/EntityFishHook.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/projectile/EntityFishHook.java.patch new file mode 100644 index 0000000..f432aff --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/projectile/EntityFishHook.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityFishHook.java ++++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityFishHook.java +@@ -551,6 +551,12 @@ + float f = this.field_70170_p.field_73012_v.nextFloat(); + int i = EnchantmentHelper.func_151386_g(this.field_146042_b); + int j = EnchantmentHelper.func_151387_h(this.field_146042_b); ++ if (true) ++ { ++ this.field_146042_b.func_71064_a(net.minecraftforge.common.FishingHooks.getFishableCategory(f, i, j).stat, 1); ++ return net.minecraftforge.common.FishingHooks.getRandomFishable(this.field_70146_Z, f, i, j); ++ } ++ + float f1 = 0.1F - (float)i * 0.025F - (float)j * 0.01F; + float f2 = 0.05F + (float)i * 0.01F - (float)j * 0.01F; + f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBeacon.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBeacon.java.patch new file mode 100644 index 0000000..561e6c8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBeacon.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerBeacon.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerBeacon.java +@@ -156,7 +156,7 @@ + + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return p_75214_1_ == null ? false : p_75214_1_.func_77973_b() == Items.field_151166_bC || p_75214_1_.func_77973_b() == Items.field_151045_i || p_75214_1_.func_77973_b() == Items.field_151043_k || p_75214_1_.func_77973_b() == Items.field_151042_j; ++ return p_75214_1_ != null && p_75214_1_.func_77973_b() != null && p_75214_1_.func_77973_b().isBeaconPayment(p_75214_1_); + } + + public int func_75219_a() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBrewingStand.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBrewingStand.java.patch new file mode 100644 index 0000000..805491a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBrewingStand.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerBrewingStand.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerBrewingStand.java +@@ -5,6 +5,7 @@ + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.entity.player.InventoryPlayer; + import net.minecraft.init.Items; ++import net.minecraft.item.ItemPotion; + import net.minecraft.item.ItemStack; + import net.minecraft.stats.AchievementList; + import net.minecraft.tileentity.TileEntityBrewingStand; +@@ -194,7 +195,7 @@ + + public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { +- if (p_82870_2_.func_77973_b() == Items.field_151068_bn && p_82870_2_.func_77960_j() > 0) ++ if (p_82870_2_.func_77973_b() instanceof ItemPotion && p_82870_2_.func_77960_j() > 0) + { + this.field_75244_a.func_71064_a(AchievementList.field_76001_A, 1); + } +@@ -204,7 +205,7 @@ + + public static boolean func_75243_a_(ItemStack p_75243_0_) + { +- return p_75243_0_ != null && (p_75243_0_.func_77973_b() == Items.field_151068_bn || p_75243_0_.func_77973_b() == Items.field_151069_bo); ++ return p_75243_0_ != null && (p_75243_0_.func_77973_b() instanceof ItemPotion || p_75243_0_.func_77973_b() == Items.field_151069_bo); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerEnchantment.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerEnchantment.java.patch new file mode 100644 index 0000000..e47ea37 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerEnchantment.java.patch @@ -0,0 +1,71 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerEnchantment.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerEnchantment.java +@@ -12,6 +12,7 @@ + import net.minecraft.init.Items; + import net.minecraft.item.ItemStack; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeHooks; + + public class ContainerEnchantment extends Container + { +@@ -116,6 +117,7 @@ + { + i = 0; + int j; ++ float power = 0; + + for (j = -1; j <= 1; ++j) + { +@@ -123,37 +125,15 @@ + { + if ((j != 0 || k != 0) && this.field_75172_h.func_147437_c(this.field_75173_i + k, this.field_75170_j, this.field_75171_k + j) && this.field_75172_h.func_147437_c(this.field_75173_i + k, this.field_75170_j + 1, this.field_75171_k + j)) + { +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j, this.field_75171_k + j * 2) == Blocks.field_150342_X) +- { +- ++i; +- } ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j, field_75171_k + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j + 1, field_75171_k + j * 2); + +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j + 1, this.field_75171_k + j * 2) == Blocks.field_150342_X) +- { +- ++i; +- } +- + if (k != 0 && j != 0) + { +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j, this.field_75171_k + j) == Blocks.field_150342_X) +- { +- ++i; +- } +- +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k * 2, this.field_75170_j + 1, this.field_75171_k + j) == Blocks.field_150342_X) +- { +- ++i; +- } +- +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k, this.field_75170_j, this.field_75171_k + j * 2) == Blocks.field_150342_X) +- { +- ++i; +- } +- +- if (this.field_75172_h.func_147439_a(this.field_75173_i + k, this.field_75170_j + 1, this.field_75171_k + j * 2) == Blocks.field_150342_X) +- { +- ++i; +- } ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j, field_75171_k + j ); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k * 2, field_75170_j + 1, field_75171_k + j ); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k, field_75170_j, field_75171_k + j * 2); ++ power += ForgeHooks.getEnchantPower(field_75172_h, field_75173_i + k, field_75170_j + 1, field_75171_k + j * 2); + } + } + } +@@ -161,7 +141,7 @@ + + for (j = 0; j < 3; ++j) + { +- this.field_75167_g[j] = EnchantmentHelper.func_77514_a(this.field_75169_l, j, i, itemstack); ++ this.field_75167_g[j] = EnchantmentHelper.func_77514_a(this.field_75169_l, j, (int)power, itemstack); + } + + this.func_75142_b(); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerPlayer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerPlayer.java.patch new file mode 100644 index 0000000..71e2843 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerPlayer.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerPlayer.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerPlayer.java +@@ -48,7 +48,8 @@ + } + public boolean func_75214_a(ItemStack p_75214_1_) + { +- return p_75214_1_ == null ? false : (p_75214_1_.func_77973_b() instanceof ItemArmor ? ((ItemArmor)p_75214_1_.func_77973_b()).field_77881_a == k : (p_75214_1_.func_77973_b() != Item.func_150898_a(Blocks.field_150423_aK) && p_75214_1_.func_77973_b() != Items.field_151144_bL ? false : k == 0)); ++ if (p_75214_1_ == null) return false; ++ return p_75214_1_.func_77973_b().isValidArmor(p_75214_1_, k, field_82862_h); + } + @SideOnly(Side.CLIENT) + public IIcon func_75212_b() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerRepair.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerRepair.java.patch new file mode 100644 index 0000000..ad320cf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerRepair.java.patch @@ -0,0 +1,55 @@ +--- ../src-base/minecraft/net/minecraft/inventory/ContainerRepair.java ++++ ../src-work/minecraft/net/minecraft/inventory/ContainerRepair.java +@@ -12,6 +12,7 @@ + import net.minecraft.init.Items; + import net.minecraft.item.ItemStack; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeHooks; + import org.apache.commons.lang3.StringUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -66,6 +67,8 @@ + p_82870_1_.func_82242_a(-ContainerRepair.this.field_82854_e); + } + ++ float breakChance = ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerRepair.this.field_82853_g.func_70301_a(0), ContainerRepair.this.field_82853_g.func_70301_a(1)); ++ + ContainerRepair.this.field_82853_g.func_70299_a(0, (ItemStack)null); + + if (ContainerRepair.this.field_82856_l > 0) +@@ -89,7 +92,7 @@ + + ContainerRepair.this.field_82854_e = 0; + +- if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i1800_2_.field_72995_K && p_i1800_2_.func_147439_a(p_i1800_3_, p_i1800_4_, p_i1800_5_) == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < 0.12F) ++ if (!p_82870_1_.field_71075_bZ.field_75098_d && !p_i1800_2_.field_72995_K && p_i1800_2_.func_147439_a(p_i1800_3_, p_i1800_4_, p_i1800_5_) == Blocks.field_150467_bQ && p_82870_1_.func_70681_au().nextFloat() < breakChance) + { + int i1 = p_i1800_2_.func_72805_g(p_i1800_3_, p_i1800_4_, p_i1800_5_); + int k = i1 & 3; +@@ -170,6 +173,7 @@ + + if (itemstack2 != null) + { ++ if (!ForgeHooks.onAnvilChange(this, itemstack, itemstack2, field_82852_f, field_82857_m, k2)) return; + flag = itemstack2.func_77973_b() == Items.field_151134_bR && Items.field_151134_bR.func_92110_g(itemstack2).func_74745_c() > 0; + + if (itemstack1.func_77984_f() && itemstack1.func_77973_b().func_82789_a(itemstack, itemstack2)) +@@ -258,7 +262,8 @@ + { + int j2 = ((Integer)iterator.next()).intValue(); + +- if (j2 != i1 && !enchantment.func_77326_a(Enchantment.field_77331_b[j2])) ++ Enchantment e2 = Enchantment.field_77331_b[j2]; ++ if (j2 != i1 && !(enchantment.func_77326_a(e2) && e2.func_77326_a(enchantment))) //Forge BugFix: Let Both enchantments veto being together + { + flag1 = false; + i += i2; +@@ -373,6 +378,8 @@ + k2 = Math.max(1, k2 / 2); + } + ++ if (flag && !itemstack1.func_77973_b().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; ++ + this.field_82854_e = k2 + i; + + if (i <= 0) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/Slot.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/Slot.java.patch new file mode 100644 index 0000000..c9851f7 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/Slot.java.patch @@ -0,0 +1,84 @@ +--- ../src-base/minecraft/net/minecraft/inventory/Slot.java ++++ ../src-work/minecraft/net/minecraft/inventory/Slot.java +@@ -2,9 +2,11 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import net.minecraft.client.renderer.texture.TextureMap; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.item.ItemStack; + import net.minecraft.util.IIcon; ++import net.minecraft.util.ResourceLocation; + + public class Slot + { +@@ -15,6 +17,13 @@ + public int field_75221_f; + private static final String __OBFID = "CL_00001762"; + ++ /** Position within background texture file, normally -1 which causes no background to be drawn. */ ++ protected IIcon backgroundIcon = null; ++ ++ /** Background texture file assigned to this slot, if any. Vanilla "/gui/items.png" is used if this is null. */ ++ @SideOnly(Side.CLIENT) ++ protected ResourceLocation texture; ++ + public Slot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) + { + this.field_75224_c = p_i1824_1_; +@@ -97,7 +106,7 @@ + @SideOnly(Side.CLIENT) + public IIcon func_75212_b() + { +- return null; ++ return backgroundIcon; + } + + @SideOnly(Side.CLIENT) +@@ -105,4 +114,46 @@ + { + return true; + } ++ ++ /*========================================= FORGE START =====================================*/ ++ /** ++ * Gets the path of the texture file to use for the background image of this slot when drawing the GUI. ++ * @return String: The texture file that will be used in GuiContainer.drawSlotInventory for the slot background. ++ */ ++ @SideOnly(Side.CLIENT) ++ public ResourceLocation getBackgroundIconTexture() ++ { ++ return (texture == null ? TextureMap.field_110576_c : texture); ++ } ++ ++ /** ++ * Sets which icon index to use as the background image of the slot when it's empty. ++ * @param icon The icon to use, null for none ++ */ ++ public void setBackgroundIcon(IIcon icon) ++ { ++ backgroundIcon = icon; ++ } ++ ++ /** ++ * Sets the texture file to use for the background image of the slot when it's empty. ++ * @param textureFilename String: Path of texture file to use, or null to use "/gui/items.png" ++ */ ++ @SideOnly(Side.CLIENT) ++ public void setBackgroundIconTexture(ResourceLocation texture) ++ { ++ this.texture = texture; ++ } ++ ++ /** ++ * Retrieves the index in the inventory for this slot, this value should typically not ++ * be used, but can be useful for some occasions. ++ * ++ * @return Index in associated inventory for this slot. ++ */ ++ public int getSlotIndex() ++ { ++ return field_75225_a; ++ } ++ /*========================================= FORGE END =====================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/SlotCrafting.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/SlotCrafting.java.patch new file mode 100644 index 0000000..5126d65 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/SlotCrafting.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java +@@ -10,6 +10,8 @@ + import net.minecraft.item.ItemStack; + import net.minecraft.item.ItemSword; + import net.minecraft.stats.AchievementList; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; + + public class SlotCrafting extends Slot + { +@@ -115,10 +117,16 @@ + { + this.field_75239_a.func_70298_a(i, 1); + +- if (itemstack1.func_77973_b().func_77634_r()) ++ if (itemstack1.func_77973_b().hasContainerItem(itemstack1)) + { +- ItemStack itemstack2 = new ItemStack(itemstack1.func_77973_b().func_77668_q()); ++ ItemStack itemstack2 = itemstack1.func_77973_b().getContainerItem(itemstack1); + ++ if (itemstack2 != null && itemstack2.func_77984_f() && itemstack2.func_77960_j() > itemstack2.func_77958_k()) ++ { ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(field_75238_b, itemstack2)); ++ continue; ++ } ++ + if (!itemstack1.func_77973_b().func_77630_h(itemstack1) || !this.field_75238_b.field_71071_by.func_70441_a(itemstack2)) + { + if (this.field_75239_a.func_70301_a(i) == null) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/Item.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/Item.java.patch new file mode 100644 index 0000000..becb4c0 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/Item.java.patch @@ -0,0 +1,756 @@ +--- ../src-base/minecraft/net/minecraft/item/Item.java ++++ ../src-work/minecraft/net/minecraft/item/Item.java +@@ -7,10 +7,12 @@ + import cpw.mods.fml.common.registry.GameData; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.util.HashMap; + import java.util.HashSet; + import java.util.Iterator; + import java.util.List; + import java.util.Random; ++import java.util.Set; + import java.util.UUID; + import net.minecraft.block.Block; + import net.minecraft.block.BlockDirt; +@@ -27,13 +29,18 @@ + import net.minecraft.block.BlockWall; + import net.minecraft.block.BlockWood; + import net.minecraft.block.material.Material; ++import net.minecraft.client.gui.FontRenderer; ++import net.minecraft.client.gui.ScaledResolution; ++import net.minecraft.client.model.ModelBiped; + import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.creativetab.CreativeTabs; + import net.minecraft.entity.Entity; + import net.minecraft.entity.EntityLivingBase; ++import net.minecraft.entity.item.EntityItem; + import net.minecraft.entity.item.EntityItemFrame; + import net.minecraft.entity.item.EntityPainting; + import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.entity.player.EntityPlayerMP; + import net.minecraft.init.Blocks; + import net.minecraft.init.Items; + import net.minecraft.potion.Potion; +@@ -44,7 +51,10 @@ + import net.minecraft.util.RegistryNamespaced; + import net.minecraft.util.StatCollector; + import net.minecraft.util.Vec3; ++import net.minecraft.util.WeightedRandomChestContent; + import net.minecraft.world.World; ++import net.minecraftforge.common.ChestGenHooks; ++import net.minecraftforge.common.util.EnumHelper; + + public class Item + { +@@ -64,7 +74,7 @@ + protected String field_111218_cA; + private static final String __OBFID = "CL_00000041"; + +- public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ++ public final cpw.mods.fml.common.registry.RegistryDelegate delegate = + ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)field_150901_e).getDelegate(this, Item.class); + public static int func_150891_b(Item p_150891_0_) + { +@@ -450,6 +460,7 @@ + return p_77654_1_; + } + ++ @Deprecated + public int func_77639_j() + { + return this.field_77777_bU; +@@ -568,6 +579,7 @@ + return this.field_77700_c; + } + ++ @Deprecated // Use ItemStack sensitive version below. + public boolean func_77634_r() + { + return this.field_77700_c != null; +@@ -625,6 +637,7 @@ + } + + @SideOnly(Side.CLIENT) ++ @Deprecated + public boolean func_77636_d(ItemStack p_77636_1_) + { + return p_77636_1_.func_77948_v(); +@@ -637,7 +650,7 @@ + + public boolean func_77616_k(ItemStack p_77616_1_) + { +- return this.func_77639_j() == 1 && this.func_77645_m(); ++ return this.getItemStackLimit(p_77616_1_) == 1 && this.func_77645_m(); + } + + protected MovingObjectPosition func_77621_a(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) +@@ -646,7 +659,7 @@ + float f1 = p_77621_2_.field_70127_C + (p_77621_2_.field_70125_A - p_77621_2_.field_70127_C) * f; + float f2 = p_77621_2_.field_70126_B + (p_77621_2_.field_70177_z - p_77621_2_.field_70126_B) * f; + double d0 = p_77621_2_.field_70169_q + (p_77621_2_.field_70165_t - p_77621_2_.field_70169_q) * (double)f; +- double d1 = p_77621_2_.field_70167_r + (p_77621_2_.field_70163_u - p_77621_2_.field_70167_r) * (double)f + 1.62D - (double)p_77621_2_.field_70129_M; ++ double d1 = p_77621_2_.field_70167_r + (p_77621_2_.field_70163_u - p_77621_2_.field_70167_r) * (double)f + (double)(p_77621_1_.field_72995_K ? p_77621_2_.func_70047_e() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.func_70047_e()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences + double d2 = p_77621_2_.field_70166_s + (p_77621_2_.field_70161_v - p_77621_2_.field_70166_s) * (double)f; + Vec3 vec3 = Vec3.func_72443_a(d0, d1, d2); + float f3 = MathHelper.func_76134_b(-f2 * 0.017453292F - (float)Math.PI); +@@ -656,6 +669,10 @@ + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; ++ if (p_77621_2_ instanceof EntityPlayerMP) ++ { ++ d3 = ((EntityPlayerMP)p_77621_2_).field_71134_c.getBlockReachDistance(); ++ } + Vec3 vec31 = vec3.func_72441_c((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); + } +@@ -711,6 +728,7 @@ + this.field_77791_bV = p_94581_1_.func_94245_a(this.func_111208_A()); + } + ++ @Deprecated + public Multimap func_111205_h() + { + return HashMultimap.create(); +@@ -728,6 +746,591 @@ + return this.field_111218_cA == null ? "MISSING_ICON_ITEM_" + field_150901_e.func_148757_b(this) + "_" + this.field_77774_bZ : this.field_111218_cA; + } + ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * ItemStack sensitive version of getItemAttributeModifiers ++ */ ++ public Multimap getAttributeModifiers(ItemStack stack) ++ { ++ return this.func_111205_h(); ++ } ++ ++ /** ++ * Called when a player drops the item into the world, ++ * returning false from this will prevent the item from ++ * being removed from the players inventory and spawning ++ * in the world ++ * ++ * @param player The player that dropped the item ++ * @param item The item stack, before the item is removed. ++ */ ++ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player) ++ { ++ return true; ++ } ++ ++ /** ++ * This is called when the item is used, before the block is activated. ++ * @param stack The Item Stack ++ * @param player The Player that used the item ++ * @param world The Current World ++ * @param x Target X Position ++ * @param y Target Y Position ++ * @param z Target Z Position ++ * @param side The side of the target hit ++ * @return Return true to prevent any further processing. ++ */ ++ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) ++ { ++ return false; ++ } ++ ++ /** ++ * Metadata-sensitive version of getStrVsBlock ++ * @param itemstack The Item Stack ++ * @param block The block the item is trying to break ++ * @param metadata The items current metadata ++ * @return The damage strength ++ */ ++ public float getDigSpeed(ItemStack itemstack, Block block, int metadata) ++ { ++ return func_150893_a(itemstack, block); ++ } ++ ++ protected boolean canRepair = true; ++ /** ++ * Called by CraftingManager to determine if an item is reparable. ++ * @return True if reparable ++ */ ++ public boolean isRepairable() ++ { ++ return canRepair && func_77645_m(); ++ } ++ ++ /** ++ * Call to disable repair recipes. ++ * @return The current Item instance ++ */ ++ public Item setNoRepair() ++ { ++ canRepair = false; ++ return this; ++ } ++ ++ /** ++ * Called before a block is broken. Return true to prevent default block harvesting. ++ * ++ * Note: In SMP, this is called on both client and server sides! ++ * ++ * @param itemstack The current ItemStack ++ * @param X The X Position ++ * @param Y The X Position ++ * @param Z The X Position ++ * @param player The Player that is wielding the item ++ * @return True to prevent harvesting, false to continue as normal ++ */ ++ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) ++ { ++ return false; ++ } ++ ++ /** ++ * Called each tick while using an item. ++ * @param stack The Item being used ++ * @param player The Player using the item ++ * @param count The amount of time in tick the item has been used for continuously ++ */ ++ public void onUsingTick(ItemStack stack, EntityPlayer player, int count) ++ { ++ } ++ ++ /** ++ * Called when the player Left Clicks (attacks) an entity. ++ * Processed before damage is done, if return value is true further processing is canceled ++ * and the entity is not attacked. ++ * ++ * @param stack The Item being used ++ * @param player The player that is attacking ++ * @param entity The entity being attacked ++ * @return True to cancel the rest of the interaction. ++ */ ++ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) ++ { ++ return false; ++ } ++ ++ /** ++ * Player, Render pass, and item usage sensitive version of getIconIndex. ++ * ++ * @param stack The item stack to get the icon for. (Usually this, and usingItem will be the same if usingItem is not null) ++ * @param renderPass The pass to get the icon for, 0 is default. ++ * @param player The player holding the item ++ * @param usingItem The item the player is actively using. Can be null if not using anything. ++ * @param useRemaining The ticks remaining for the active item. ++ * @return The icon index ++ */ ++ public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) ++ { ++ return getIcon(stack, renderPass); ++ } ++ ++ /** ++ * Returns the number of render passes/layers this item has. ++ * Usually equates to ItemRenderer.renderItem being called for this many passes. ++ * Does not get called unless requiresMultipleRenderPasses() is true; ++ * ++ * @param metadata The item's metadata ++ * @return The number of passes to run. ++ */ ++ public int getRenderPasses(int metadata) ++ { ++ return func_77623_v() ? 2 : 1; ++ } ++ ++ /** ++ * ItemStack sensitive version of getContainerItem. ++ * Returns a full ItemStack instance of the result. ++ * ++ * @param itemStack The current ItemStack ++ * @return The resulting ItemStack ++ */ ++ public ItemStack getContainerItem(ItemStack itemStack) ++ { ++ if (!hasContainerItem(itemStack)) ++ { ++ return null; ++ } ++ return new ItemStack(func_77668_q()); ++ } ++ ++ /** ++ * ItemStack sensitive version of hasContainerItem ++ * @param stack The current item stack ++ * @return True if this item has a 'container' ++ */ ++ public boolean hasContainerItem(ItemStack stack) ++ { ++ return func_77634_r(); ++ } ++ ++ /** ++ * Retrieves the normal 'lifespan' of this item when it is dropped on the ground as a EntityItem. ++ * This is in ticks, standard result is 6000, or 5 mins. ++ * ++ * @param itemStack The current ItemStack ++ * @param world The world the entity is in ++ * @return The normal lifespan in ticks. ++ */ ++ public int getEntityLifespan(ItemStack itemStack, World world) ++ { ++ return 6000; ++ } ++ ++ /** ++ * Determines if this Item has a special entity for when they are in the world. ++ * Is called when a EntityItem is spawned in the world, if true and Item#createCustomEntity ++ * returns non null, the EntityItem will be destroyed and the new Entity will be added to the world. ++ * ++ * @param stack The current item stack ++ * @return True of the item has a custom entity, If true, Item#createCustomEntity will be called ++ */ ++ public boolean hasCustomEntity(ItemStack stack) ++ { ++ return false; ++ } ++ ++ /** ++ * This function should return a new entity to replace the dropped item. ++ * Returning null here will not kill the EntityItem and will leave it to function normally. ++ * Called when the item it placed in a world. ++ * ++ * @param world The world object ++ * @param location The EntityItem object, useful for getting the position of the entity ++ * @param itemstack The current item stack ++ * @return A new Entity object to spawn or null ++ */ ++ public Entity createEntity(World world, Entity location, ItemStack itemstack) ++ { ++ return null; ++ } ++ ++ /** ++ * Called by the default implemetation of EntityItem's onUpdate method, allowing for cleaner ++ * control over the update of the item without having to write a subclass. ++ * ++ * @param entityItem The entity Item ++ * @return Return true to skip any further update code. ++ */ ++ public boolean onEntityItemUpdate(EntityItem entityItem) ++ { ++ return false; ++ } ++ ++ /** ++ * Gets a list of tabs that items belonging to this class can display on, ++ * combined properly with getSubItems allows for a single item to span ++ * many sub-items across many tabs. ++ * ++ * @return A list of all tabs that this item could possibly be one. ++ */ ++ public CreativeTabs[] getCreativeTabs() ++ { ++ return new CreativeTabs[]{ func_77640_w() }; ++ } ++ ++ /** ++ * Determines the base experience for a player when they remove this item from a furnace slot. ++ * This number must be between 0 and 1 for it to be valid. ++ * This number will be multiplied by the stack size to get the total experience. ++ * ++ * @param item The item stack the player is picking up. ++ * @return The amount to award for each item. ++ */ ++ public float getSmeltingExperience(ItemStack item) ++ { ++ return -1; //-1 will default to the old lookups. ++ } ++ ++ /** ++ * Return the correct icon for rendering based on the supplied ItemStack and render pass. ++ * ++ * Defers to {@link #getIconFromDamageForRenderPass(int, int)} ++ * @param stack to render for ++ * @param pass the multi-render pass ++ * @return the icon ++ */ ++ public IIcon getIcon(ItemStack stack, int pass) ++ { ++ return func_77618_c(stack.func_77960_j(), pass); ++ } ++ ++ /** ++ * Generates the base Random item for a specific instance of the chest gen, ++ * Enchanted books use this to pick a random enchantment. ++ * ++ * @param chest The chest category to generate for ++ * @param rnd World RNG ++ * @param original Original result registered with the chest gen hooks. ++ * @return New values to use as the random item, typically this will be original ++ */ ++ public WeightedRandomChestContent getChestGenBase(ChestGenHooks chest, Random rnd, WeightedRandomChestContent original) ++ { ++ if (this instanceof ItemEnchantedBook) ++ { ++ return ((ItemEnchantedBook)this).func_92112_a(rnd, ++ original.field_76295_d, ++ original.field_76296_e, original.field_76292_a); ++ } ++ return original; ++ } ++ ++ /** ++ * ++ * Should this item, when held, allow sneak-clicks to pass through to the underlying block? ++ * ++ * @param world The world ++ * @param x The X Position ++ * @param y The X Position ++ * @param z The X Position ++ * @param player The Player that is wielding the item ++ * @return ++ */ ++ public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) ++ { ++ return false; ++ } ++ ++ /** ++ * Called to tick armor in the armor slot. Override to do something ++ * ++ * @param world ++ * @param player ++ * @param itemStack ++ */ ++ public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) ++ { ++ ++ } ++ ++ /** ++ * Determines if the specific ItemStack can be placed in the specified armor slot. ++ * ++ * @param stack The ItemStack ++ * @param armorType Armor slot ID: 0: Helmet, 1: Chest, 2: Legs, 3: Boots ++ * @param entity The entity trying to equip the armor ++ * @return True if the given ItemStack can be inserted in the slot ++ */ ++ public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) ++ { ++ if (this instanceof ItemArmor) ++ { ++ return ((ItemArmor)this).field_77881_a == armorType; ++ } ++ ++ if (armorType == 0) ++ { ++ return this == Item.func_150898_a(Blocks.field_150423_aK) || this == Items.field_151144_bL; ++ } ++ ++ return false; ++ } ++ ++ /** ++ * Allow or forbid the specific book/item combination as an anvil enchant ++ * ++ * @param stack The item ++ * @param book The book ++ * @return if the enchantment is allowed ++ */ ++ public boolean isBookEnchantable(ItemStack stack, ItemStack book) ++ { ++ return true; ++ } ++ ++ /** ++ * Called by RenderBiped and RenderPlayer to determine the armor texture that ++ * should be use for the currently equiped item. ++ * This will only be called on instances of ItemArmor. ++ * ++ * Returning null from this function will use the default value. ++ * ++ * @param stack ItemStack for the equpt armor ++ * @param entity The entity wearing the armor ++ * @param slot The slot the armor is in ++ * @param type The subtype, can be null or "overlay" ++ * @return Path of texture to bind, or null to use default ++ */ ++ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) ++ { ++ return null; ++ } ++ ++ /** ++ * Returns the font renderer used to render tooltips and overlays for this item. ++ * Returning null will use the standard font renderer. ++ * ++ * @param stack The current item stack ++ * @return A instance of FontRenderer or null to use default ++ */ ++ @SideOnly(Side.CLIENT) ++ public FontRenderer getFontRenderer(ItemStack stack) ++ { ++ return null; ++ } ++ ++ /** ++ * Override this method to have an item handle its own armor rendering. ++ * ++ * @param entityLiving The entity wearing the armor ++ * @param itemStack The itemStack to render the model of ++ * @param armorSlot 0=head, 1=torso, 2=legs, 3=feet ++ * ++ * @return A ModelBiped to render instead of the default ++ */ ++ @SideOnly(Side.CLIENT) ++ public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) ++ { ++ return null; ++ } ++ ++ /** ++ * Called when a entity tries to play the 'swing' animation. ++ * ++ * @param entityLiving The entity swinging the item. ++ * @param stack The Item stack ++ * @return True to cancel any further processing by EntityLiving ++ */ ++ public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) ++ { ++ return false; ++ } ++ ++ /** ++ * Called when the client starts rendering the HUD, for whatever item the player currently has as a helmet. ++ * This is where pumpkins would render there overlay. ++ * ++ * @param stack The ItemStack that is equipped ++ * @param player Reference to the current client entity ++ * @param resolution Resolution information about the current viewport and configured GUI Scale ++ * @param partialTicks Partial ticks for the renderer, useful for interpolation ++ * @param hasScreen If the player has a screen up, which will be rendered after this. ++ * @param mouseX Mouse's X position on screen ++ * @param mouseY Mouse's Y position on screen ++ */ ++ @SideOnly(Side.CLIENT) ++ public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){} ++ ++ /** ++ * Return the itemDamage represented by this ItemStack. Defaults to the itemDamage field on ItemStack, but can be overridden here for other sources such as NBT. ++ * ++ * @param stack The itemstack that is damaged ++ * @return the damage value ++ */ ++ public int getDamage(ItemStack stack) ++ { ++ return stack.field_77991_e; ++ } ++ ++ @Deprecated // This isn't 'display' its normal Damage, the above function is 'Aux' data, but the same value. ++ public int getDisplayDamage(ItemStack stack) ++ { ++ return stack.field_77991_e; ++ } ++ ++ /** ++ * Determines if the durability bar should be rendered for this item. ++ * Defaults to vanilla stack.isDamaged behavior. ++ * But modders can use this for any data they wish. ++ * ++ * @param stack The current Item Stack ++ * @return True if it should render the 'durability' bar. ++ */ ++ public boolean showDurabilityBar(ItemStack stack) ++ { ++ return stack.func_77951_h(); ++ } ++ ++ /** ++ * Queries the percentage of the 'Durability' bar that should be drawn. ++ * ++ * @param stack The current ItemStack ++ * @return 1.0 for 100% 0 for 0% ++ */ ++ public double getDurabilityForDisplay(ItemStack stack) ++ { ++ return (double)stack.func_77952_i() / (double)stack.func_77958_k(); ++ } ++ ++ /** ++ * Return the maxDamage for this ItemStack. Defaults to the maxDamage field in this item, ++ * but can be overridden here for other sources such as NBT. ++ * ++ * @param stack The itemstack that is damaged ++ * @return the damage value ++ */ ++ public int getMaxDamage(ItemStack stack) ++ { ++ return func_77612_l(); ++ } ++ ++ /** ++ * Return if this itemstack is damaged. Note only called if {@link #isDamageable()} is true. ++ * @param stack the stack ++ * @return if the stack is damaged ++ */ ++ public boolean isDamaged(ItemStack stack) ++ { ++ return stack.field_77991_e > 0; ++ } ++ ++ /** ++ * Set the damage for this itemstack. Note, this method is responsible for zero checking. ++ * @param stack the stack ++ * @param damage the new damage value ++ */ ++ public void setDamage(ItemStack stack, int damage) ++ { ++ stack.field_77991_e = damage; ++ ++ if (stack.field_77991_e < 0) ++ { ++ stack.field_77991_e = 0; ++ } ++ } ++ ++ /** ++ * ItemStack sensitive version of {@link #canHarvestBlock(Block)} ++ * @param par1Block The block trying to harvest ++ * @param itemStack The itemstack used to harvest the block ++ * @return true if can harvest the block ++ */ ++ public boolean canHarvestBlock(Block par1Block, ItemStack itemStack) ++ { ++ return func_150897_b(par1Block); ++ } ++ ++ /** ++ * Render Pass sensitive version of hasEffect() ++ */ ++ @SideOnly(Side.CLIENT) ++ public boolean hasEffect(ItemStack par1ItemStack, int pass) ++ { ++ return func_77636_d(par1ItemStack) && (pass == 0 || this != Items.field_151068_bn); ++ } ++ ++ /** ++ * Gets the maximum number of items that this stack should be able to hold. ++ * This is a ItemStack (and thus NBT) sensitive version of Item.getItemStackLimit() ++ * ++ * @param stack The ItemStack ++ * @return THe maximum number this item can be stacked to ++ */ ++ public int getItemStackLimit(ItemStack stack) ++ { ++ return this.func_77639_j(); ++ } ++ ++ private HashMap toolClasses = new HashMap(); ++ /** ++ * Sets or removes the harvest level for the specified tool class. ++ * ++ * @param toolClass Class ++ * @param level Harvest level: ++ * Wood: 0 ++ * Stone: 1 ++ * Iron: 2 ++ * Diamond: 3 ++ * Gold: 0 ++ */ ++ public void setHarvestLevel(String toolClass, int level) ++ { ++ if (level < 0) ++ toolClasses.remove(toolClass); ++ else ++ toolClasses.put(toolClass, level); ++ } ++ ++ public Set getToolClasses(ItemStack stack) ++ { ++ return toolClasses.keySet(); ++ } ++ ++ /** ++ * Queries the harvest level of this item stack for the specifred tool class, ++ * Returns -1 if this tool is not of the specified type ++ * ++ * @param stack This item stack instance ++ * @param toolClass Tool Class ++ * @return Harvest level, or -1 if not the specified tool type. ++ */ ++ public int getHarvestLevel(ItemStack stack, String toolClass) ++ { ++ Integer ret = toolClasses.get(toolClass); ++ return ret == null ? -1 : ret; ++ } ++ ++ /** ++ * ItemStack sensitive version of getItemEnchantability ++ * ++ * @param stack The ItemStack ++ * @return the item echantability value ++ */ ++ public int getItemEnchantability(ItemStack stack) ++ { ++ return func_77619_b(); ++ } ++ ++ /** ++ * Whether this Item can be used as a payment to activate the vanilla beacon. ++ * @param stack the ItemStack ++ * @return true if this Item can be used ++ */ ++ public boolean isBeaconPayment(ItemStack stack) ++ { ++ return this == Items.field_151166_bC || this == Items.field_151045_i || this == Items.field_151043_k || this == Items.field_151042_j; ++ } ++ /* ======================================== FORGE END =====================================*/ ++ + public static enum ToolMaterial + { + WOOD(0, 59, 2.0F, 0.0F, 15), +@@ -743,6 +1346,10 @@ + + private static final String __OBFID = "CL_00000042"; + ++ //Added by forge for custom Tool materials. ++ @Deprecated public Item customCraftingMaterial = null; ++ private ItemStack repairMaterial = null; ++ + private ToolMaterial(int p_i1874_3_, int p_i1874_4_, float p_i1874_5_, float p_i1874_6_, int p_i1874_7_) + { + this.field_78001_f = p_i1874_3_; +@@ -777,9 +1384,36 @@ + return this.field_78008_j; + } + ++ @Deprecated // Use getRepairItemStack below + public Item func_150995_f() + { +- return this == WOOD ? Item.func_150898_a(Blocks.field_150344_f) : (this == STONE ? Item.func_150898_a(Blocks.field_150347_e) : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == EMERALD ? Items.field_151045_i : null)))); ++ switch (this) ++ { ++ case WOOD: return Item.func_150898_a(Blocks.field_150344_f); ++ case STONE: return Item.func_150898_a(Blocks.field_150347_e); ++ case GOLD: return Items.field_151043_k; ++ case IRON: return Items.field_151042_j; ++ case EMERALD: return Items.field_151045_i; ++ default: return customCraftingMaterial; ++ } + } ++ ++ public ToolMaterial setRepairItem(ItemStack stack) ++ { ++ if (this.repairMaterial != null || customCraftingMaterial != null) throw new RuntimeException("Can not change already set repair material"); ++ if (this == WOOD || this == STONE || this == GOLD || this == IRON || this == EMERALD) throw new RuntimeException("Can not change vanilla tool repair materials"); ++ this.repairMaterial = stack; ++ this.customCraftingMaterial = stack.func_77973_b(); ++ return this; ++ } ++ ++ public ItemStack getRepairItemStack() ++ { ++ if (repairMaterial != null) return repairMaterial; ++ Item ret = this.func_150995_f(); ++ if (ret == null) return null; ++ repairMaterial = new ItemStack(ret, 1, net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE); ++ return repairMaterial; ++ } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemArmor.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemArmor.java.patch new file mode 100644 index 0000000..1976ac8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemArmor.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemArmor.java ++++ ../src-work/minecraft/net/minecraft/item/ItemArmor.java +@@ -40,7 +40,7 @@ + if (list.size() > 0) + { + EntityLivingBase entitylivingbase = (EntityLivingBase)list.get(0); +- int l = entitylivingbase instanceof EntityPlayer ? 1 : 0; ++ int l = 0;// Forge: We fix the indexes. Mojang Stop hard coding this! + int i1 = EntityLiving.func_82159_b(p_82487_2_); + ItemStack itemstack1 = p_82487_2_.func_77946_l(); + itemstack1.field_77994_a = 1; +@@ -221,7 +221,7 @@ + + if (itemstack1 == null) + { +- p_77659_3_.func_70062_b(i, p_77659_1_.func_77946_l()); ++ p_77659_3_.func_70062_b(i + 1, p_77659_1_.func_77946_l()); //Forge: Vanilla bug fix associated with fixed setCurrentItemOrArmor indexs for players. + p_77659_1_.field_77994_a = 0; + } + +@@ -259,6 +259,9 @@ + + private static final String __OBFID = "CL_00001768"; + ++ //Added by forge for custom Armor materials. ++ public Item customCraftingMaterial = null; ++ + private ArmorMaterial(int p_i1827_3_, int[] p_i1827_4_, int p_i1827_5_) + { + this.field_78048_f = p_i1827_3_; +@@ -283,7 +286,12 @@ + + public Item func_151685_b() + { +- return this == CLOTH ? Items.field_151116_aA : (this == CHAIN ? Items.field_151042_j : (this == GOLD ? Items.field_151043_k : (this == IRON ? Items.field_151042_j : (this == DIAMOND ? Items.field_151045_i : null)))); ++ return this == CLOTH ? Items.field_151116_aA : ++ (this == CHAIN ? Items.field_151042_j : ++ (this == GOLD ? Items.field_151043_k : ++ (this == IRON ? Items.field_151042_j : ++ (this == DIAMOND ? Items.field_151045_i : ++ customCraftingMaterial)))); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBlock.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBlock.java.patch new file mode 100644 index 0000000..b553347 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBlock.java.patch @@ -0,0 +1,66 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBlock.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBlock.java +@@ -50,7 +50,7 @@ + { + p_77648_7_ = 1; + } +- else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I) ++ else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I && !block.isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) + { + if (p_77648_7_ == 0) + { +@@ -100,14 +100,8 @@ + int i1 = this.func_77647_b(p_77648_1_.func_77960_j()); + int j1 = this.field_150939_a.func_149660_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, i1); + +- if (p_77648_3_.func_147465_d(p_77648_4_, p_77648_5_, p_77648_6_, this.field_150939_a, j1, 3)) ++ if (placeBlockAt(p_77648_1_, p_77648_2_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_8_, p_77648_9_, p_77648_10_, j1)) + { +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_150939_a) +- { +- this.field_150939_a.func_149689_a(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_, p_77648_1_); +- this.field_150939_a.func_149714_e(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, j1); +- } +- + p_77648_3_.func_72908_a((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), this.field_150939_a.field_149762_H.func_150496_b(), (this.field_150939_a.field_149762_H.func_150497_c() + 1.0F) / 2.0F, this.field_150939_a.field_149762_H.func_150494_d() * 0.8F); + --p_77648_1_.field_77994_a; + } +@@ -129,7 +123,7 @@ + { + p_150936_5_ = 1; + } +- else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I) ++ else if (block != Blocks.field_150395_bd && block != Blocks.field_150329_H && block != Blocks.field_150330_I && !block.isReplaceable(p_150936_1_, p_150936_2_, p_150936_3_, p_150936_4_)) + { + if (p_150936_5_ == 0) + { +@@ -197,4 +191,29 @@ + this.field_150938_b = p_94581_1_.func_94245_a(s); + } + } ++ ++ /** ++ * 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, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) ++ { ++ ++ if (!world.func_147465_d(x, y, z, field_150939_a, metadata, 3)) ++ { ++ return false; ++ } ++ ++ if (world.func_147439_a(x, y, z) == field_150939_a) ++ { ++ field_150939_a.func_149689_a(world, x, y, z, player, stack); ++ field_150939_a.func_149714_e(world, x, y, z, metadata); ++ } ++ ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBow.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBow.java.patch new file mode 100644 index 0000000..8f47865 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBow.java.patch @@ -0,0 +1,48 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBow.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBow.java +@@ -11,6 +11,9 @@ + import net.minecraft.init.Items; + import net.minecraft.util.IIcon; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.ArrowLooseEvent; ++import net.minecraftforge.event.entity.player.ArrowNockEvent; + + public class ItemBow extends Item + { +@@ -28,11 +31,20 @@ + + public void func_77615_a(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) + { ++ int j = this.func_77626_a(p_77615_1_) - p_77615_4_; ++ ++ ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.isCanceled()) ++ { ++ return; ++ } ++ j = event.charge; ++ + boolean flag = p_77615_3_.field_71075_bZ.field_75098_d || EnchantmentHelper.func_77506_a(Enchantment.field_77342_w.field_77352_x, p_77615_1_) > 0; + + if (flag || p_77615_3_.field_71071_by.func_146028_b(Items.field_151032_g)) + { +- int j = this.func_77626_a(p_77615_1_) - p_77615_4_; + float f = (float)j / 20.0F; + f = (f * f + f * 2.0F) / 3.0F; + +@@ -108,6 +120,13 @@ + + public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { ++ ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.isCanceled()) ++ { ++ return event.result; ++ } ++ + if (p_77659_3_.field_71075_bZ.field_75098_d || p_77659_3_.field_71071_by.func_146028_b(Items.field_151032_g)) + { + p_77659_3_.func_71008_a(p_77659_1_, this.func_77626_a(p_77659_1_)); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucket.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucket.java.patch new file mode 100644 index 0000000..bff933b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucket.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBucket.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucket.java +@@ -8,6 +8,9 @@ + import net.minecraft.init.Items; + import net.minecraft.util.MovingObjectPosition; + import net.minecraft.world.World; ++import cpw.mods.fml.common.eventhandler.Event; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.FillBucketEvent; + + public class ItemBucket extends Item + { +@@ -32,6 +35,31 @@ + } + else + { ++ FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return p_77659_1_; ++ } ++ ++ if (event.getResult() == Event.Result.ALLOW) ++ { ++ if (p_77659_3_.field_71075_bZ.field_75098_d) ++ { ++ return p_77659_1_; ++ } ++ ++ if (--p_77659_1_.field_77994_a <= 0) ++ { ++ return event.result; ++ } ++ ++ if (!p_77659_3_.field_71071_by.func_70441_a(event.result)) ++ { ++ p_77659_3_.func_71019_a(event.result, false); ++ } ++ ++ return p_77659_1_; ++ } + if (movingobjectposition.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.field_72311_b; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucketMilk.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucketMilk.java.patch new file mode 100644 index 0000000..30a8765 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucketMilk.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java ++++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java +@@ -24,7 +24,7 @@ + + if (!p_77654_2_.field_72995_K) + { +- p_77654_3_.func_70674_bp(); ++ p_77654_3_.curePotionEffects(p_77654_1_); + } + + return p_77654_1_.field_77994_a <= 0 ? new ItemStack(Items.field_151133_ar) : p_77654_1_; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemDye.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemDye.java.patch new file mode 100644 index 0000000..e1f4cf4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemDye.java.patch @@ -0,0 +1,77 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemDye.java ++++ ../src-work/minecraft/net/minecraft/item/ItemDye.java +@@ -1,5 +1,6 @@ + package net.minecraft.item; + ++import cpw.mods.fml.common.eventhandler.Event.Result; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.List; +@@ -17,6 +18,10 @@ + import net.minecraft.util.IIcon; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraft.world.WorldServer; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.common.util.FakePlayerFactory; ++import net.minecraftforge.event.entity.player.BonemealEvent; + + public class ItemDye extends Item + { +@@ -57,7 +62,7 @@ + { + if (p_77648_1_.func_77960_j() == 15) + { +- if (func_150919_a(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_)) ++ if (applyBonemeal(p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_2_)) + { + if (!p_77648_3_.field_72995_K) + { +@@ -125,8 +130,30 @@ + + public static boolean func_150919_a(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_) + { ++ if (p_150919_1_ instanceof WorldServer) ++ return applyBonemeal(p_150919_0_, p_150919_1_, p_150919_2_, p_150919_3_, p_150919_4_, FakePlayerFactory.getMinecraft((WorldServer)p_150919_1_)); ++ return false; ++ } ++ ++ public static boolean applyBonemeal(ItemStack p_150919_0_, World p_150919_1_, int p_150919_2_, int p_150919_3_, int p_150919_4_, EntityPlayer player) ++ { + Block block = p_150919_1_.func_147439_a(p_150919_2_, p_150919_3_, p_150919_4_); + ++ BonemealEvent event = new BonemealEvent(player, p_150919_1_, block, p_150919_2_, p_150919_3_, p_150919_4_); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return false; ++ } ++ ++ if (event.getResult() == Result.ALLOW) ++ { ++ if (!p_150919_1_.field_72995_K) ++ { ++ p_150919_0_.field_77994_a--; ++ } ++ return true; ++ } ++ + if (block instanceof IGrowable) + { + IGrowable igrowable = (IGrowable)block; +@@ -172,6 +199,16 @@ + p_150918_0_.func_72869_a("happyVillager", (double)((float)p_150918_1_ + field_77697_d.nextFloat()), (double)p_150918_2_ + (double)field_77697_d.nextFloat() * block.func_149669_A(), (double)((float)p_150918_3_ + field_77697_d.nextFloat()), d0, d1, d2); + } + } ++ else ++ { ++ for (int i1 = 0; i1 < p_150918_4_; ++i1) ++ { ++ double d0 = field_77697_d.nextGaussian() * 0.02D; ++ double d1 = field_77697_d.nextGaussian() * 0.02D; ++ double d2 = field_77697_d.nextGaussian() * 0.02D; ++ p_150918_0_.func_72869_a("happyVillager", (double)((float)p_150918_1_ + field_77697_d.nextFloat()), (double)p_150918_2_ + (double)field_77697_d.nextFloat() * 1.0f, (double)((float)p_150918_3_ + field_77697_d.nextFloat()), d0, d1, d2); ++ } ++ } + } + + public boolean func_111207_a(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemFlintAndSteel.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemFlintAndSteel.java.patch new file mode 100644 index 0000000..572f937 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemFlintAndSteel.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java ++++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java +@@ -55,7 +55,7 @@ + } + else + { +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).func_149688_o() == Material.field_151579_a) ++ if (p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_, p_77648_6_)) + { + p_77648_3_.func_72908_a((double)p_77648_4_ + 0.5D, (double)p_77648_5_ + 0.5D, (double)p_77648_6_ + 0.5D, "fire.ignite", 1.0F, field_77697_d.nextFloat() * 0.4F + 0.8F); + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.field_150480_ab); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemHoe.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemHoe.java.patch new file mode 100644 index 0000000..4cd7962 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemHoe.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemHoe.java ++++ ../src-work/minecraft/net/minecraft/item/ItemHoe.java +@@ -1,5 +1,6 @@ + package net.minecraft.item; + ++import cpw.mods.fml.common.eventhandler.Event.Result; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.block.Block; +@@ -8,6 +9,8 @@ + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.player.UseHoeEvent; + + public class ItemHoe extends Item + { +@@ -30,9 +33,21 @@ + } + else + { ++ UseHoeEvent event = new UseHoeEvent(p_77648_2_, p_77648_1_, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return false; ++ } ++ ++ if (event.getResult() == Result.ALLOW) ++ { ++ p_77648_1_.func_77972_a(1, p_77648_2_); ++ return true; ++ } ++ + Block block = p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_); + +- if (p_77648_7_ != 0 && p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_).func_149688_o() == Material.field_151579_a && (block == Blocks.field_150349_c || block == Blocks.field_150346_d)) ++ if (p_77648_7_ != 0 && p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.field_150349_c || block == Blocks.field_150346_d)) + { + Block block1 = Blocks.field_150458_ak; + p_77648_3_.func_72908_a((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.field_149762_H.func_150498_e(), (block1.field_149762_H.func_150497_c() + 1.0F) / 2.0F, block1.field_149762_H.func_150494_d() * 0.8F); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemLilyPad.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemLilyPad.java.patch new file mode 100644 index 0000000..1196c91 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemLilyPad.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemLilyPad.java ++++ ../src-work/minecraft/net/minecraft/item/ItemLilyPad.java +@@ -46,7 +46,14 @@ + + if (p_77659_2_.func_147439_a(i, j, k).func_149688_o() == Material.field_151586_h && p_77659_2_.func_72805_g(i, j, k) == 0 && p_77659_2_.func_147437_c(i, j + 1, k)) + { ++ // special case for handling block placement with water lilies ++ net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(p_77659_2_, i, j + 1, k); + p_77659_2_.func_147449_b(i, j + 1, k, Blocks.field_150392_bi); ++ if (net.minecraftforge.event.ForgeEventFactory.onPlayerBlockPlace(p_77659_3_, blocksnapshot, net.minecraftforge.common.util.ForgeDirection.UP).isCanceled()) ++ { ++ blocksnapshot.restore(true, false); ++ return p_77659_1_; ++ } + + if (!p_77659_3_.field_71075_bZ.field_75098_d) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemRecord.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemRecord.java.patch new file mode 100644 index 0000000..1ae2786 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemRecord.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemRecord.java ++++ ../src-work/minecraft/net/minecraft/item/ItemRecord.java +@@ -10,6 +10,7 @@ + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.util.IIcon; ++import net.minecraft.util.ResourceLocation; + import net.minecraft.util.StatCollector; + import net.minecraft.world.World; + +@@ -24,7 +25,7 @@ + this.field_150929_a = p_i45350_1_; + this.field_77777_bU = 1; + this.func_77637_a(CreativeTabs.field_78026_f); +- field_150928_b.put(p_i45350_1_, this); ++ field_150928_b.put("records." + p_i45350_1_, this); //Forge Bug Fix: RenderGlobal adds a "records." when looking up below. + } + + @SideOnly(Side.CLIENT) +@@ -77,4 +78,15 @@ + { + return (ItemRecord)field_150928_b.get(p_150926_0_); + } ++ ++ /** ++ * Retrieves the resource location of the sound to play for this record. ++ * ++ * @param name The name of the record to play ++ * @return The resource location for the audio, null to use default. ++ */ ++ public ResourceLocation getRecordResource(String name) ++ { ++ return new ResourceLocation(name); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeedFood.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeedFood.java.patch new file mode 100644 index 0000000..687666d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeedFood.java.patch @@ -0,0 +1,49 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSeedFood.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeedFood.java +@@ -2,9 +2,13 @@ + + import net.minecraft.block.Block; + import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.IPlantable; ++import net.minecraftforge.common.util.ForgeDirection; + +-public class ItemSeedFood extends ItemFood ++public class ItemSeedFood extends ItemFood implements IPlantable + { + private Block field_150908_b; + private Block field_82809_c; +@@ -25,7 +29,7 @@ + } + else if (p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) + { +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_82809_c && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) ++ if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) + { + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150908_b); + --p_77648_1_.field_77994_a; +@@ -41,4 +45,22 @@ + return false; + } + } ++ ++ @Override ++ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) ++ { ++ return EnumPlantType.Crop; ++ } ++ ++ @Override ++ public Block getPlant(IBlockAccess world, int x, int y, int z) ++ { ++ return field_150908_b; ++ } ++ ++ @Override ++ public int getPlantMetadata(IBlockAccess world, int x, int y, int z) ++ { ++ return 0; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeeds.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeeds.java.patch new file mode 100644 index 0000000..697ffac --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeeds.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSeeds.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSeeds.java +@@ -3,9 +3,14 @@ + import net.minecraft.block.Block; + import net.minecraft.creativetab.CreativeTabs; + import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.init.Blocks; ++import net.minecraft.world.IBlockAccess; + import net.minecraft.world.World; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.IPlantable; ++import net.minecraftforge.common.util.ForgeDirection; + +-public class ItemSeeds extends Item ++public class ItemSeeds extends Item implements IPlantable + { + private Block field_150925_a; + private Block field_77838_b; +@@ -26,7 +31,7 @@ + } + else if (p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.func_82247_a(p_77648_4_, p_77648_5_ + 1, p_77648_6_, p_77648_7_, p_77648_1_)) + { +- if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_) == this.field_77838_b && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) ++ if (p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).canSustainPlant(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, ForgeDirection.UP, this) && p_77648_3_.func_147437_c(p_77648_4_, p_77648_5_ + 1, p_77648_6_)) + { + p_77648_3_.func_147449_b(p_77648_4_, p_77648_5_ + 1, p_77648_6_, this.field_150925_a); + --p_77648_1_.field_77994_a; +@@ -42,4 +47,22 @@ + return false; + } + } ++ ++ @Override ++ public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) ++ { ++ return field_150925_a == Blocks.field_150388_bm ? EnumPlantType.Nether : EnumPlantType.Crop; ++ } ++ ++ @Override ++ public Block getPlant(IBlockAccess world, int x, int y, int z) ++ { ++ return field_150925_a; ++ } ++ ++ @Override ++ public int getPlantMetadata(IBlockAccess world, int x, int y, int z) ++ { ++ return 0; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemShears.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemShears.java.patch new file mode 100644 index 0000000..fdded4d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemShears.java.patch @@ -0,0 +1,108 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemShears.java ++++ ../src-work/minecraft/net/minecraft/item/ItemShears.java +@@ -1,11 +1,20 @@ + package net.minecraft.item; + ++import java.util.ArrayList; ++import java.util.Random; ++ + import net.minecraft.block.Block; + import net.minecraft.block.material.Material; + import net.minecraft.creativetab.CreativeTabs; ++import net.minecraft.enchantment.Enchantment; ++import net.minecraft.enchantment.EnchantmentHelper; + import net.minecraft.entity.EntityLivingBase; ++import net.minecraft.entity.item.EntityItem; ++import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; ++import net.minecraft.stats.StatList; + import net.minecraft.world.World; ++import net.minecraftforge.common.IShearable; + + public class ItemShears extends Item + { +@@ -20,13 +29,12 @@ + + public boolean func_150894_a(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) + { +- if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.field_150321_G && p_150894_3_ != Blocks.field_150329_H && p_150894_3_ != Blocks.field_150395_bd && p_150894_3_ != Blocks.field_150473_bD) ++ if (p_150894_3_.func_149688_o() != Material.field_151584_j && p_150894_3_ != Blocks.field_150321_G && p_150894_3_ != Blocks.field_150329_H && p_150894_3_ != Blocks.field_150395_bd && p_150894_3_ != Blocks.field_150473_bD && !(p_150894_3_ instanceof IShearable)) + { + return super.func_150894_a(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); + } + else + { +- p_150894_1_.func_77972_a(1, p_150894_7_); + return true; + } + } +@@ -40,4 +48,69 @@ + { + return p_150893_2_ != Blocks.field_150321_G && p_150893_2_.func_149688_o() != Material.field_151584_j ? (p_150893_2_ == Blocks.field_150325_L ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; + } ++ ++ @Override ++ public boolean func_111207_a(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) ++ { ++ if (entity.field_70170_p.field_72995_K) ++ { ++ return false; ++ } ++ if (entity instanceof IShearable) ++ { ++ IShearable target = (IShearable)entity; ++ if (target.isShearable(itemstack, entity.field_70170_p, (int)entity.field_70165_t, (int)entity.field_70163_u, (int)entity.field_70161_v)) ++ { ++ ArrayList drops = target.onSheared(itemstack, entity.field_70170_p, (int)entity.field_70165_t, (int)entity.field_70163_u, (int)entity.field_70161_v, ++ EnchantmentHelper.func_77506_a(Enchantment.field_77346_s.field_77352_x, itemstack)); ++ ++ Random rand = new Random(); ++ for(ItemStack stack : drops) ++ { ++ EntityItem ent = entity.func_70099_a(stack, 1.0F); ++ ent.field_70181_x += rand.nextFloat() * 0.05F; ++ ent.field_70159_w += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ ent.field_70179_y += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ++ } ++ itemstack.func_77972_a(1, entity); ++ } ++ return true; ++ } ++ return false; ++ } ++ ++ @Override ++ public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) ++ { ++ if (player.field_70170_p.field_72995_K) ++ { ++ return false; ++ } ++ Block block = player.field_70170_p.func_147439_a(x, y, z); ++ if (block instanceof IShearable) ++ { ++ IShearable target = (IShearable)block; ++ if (target.isShearable(itemstack, player.field_70170_p, x, y, z)) ++ { ++ ArrayList drops = target.onSheared(itemstack, player.field_70170_p, x, y, z, ++ EnchantmentHelper.func_77506_a(Enchantment.field_77346_s.field_77352_x, itemstack)); ++ Random rand = new Random(); ++ ++ for(ItemStack stack : drops) ++ { ++ float f = 0.7F; ++ double d = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; ++ EntityItem entityitem = new EntityItem(player.field_70170_p, (double)x + d, (double)y + d1, (double)z + d2, stack); ++ entityitem.field_145804_b = 10; ++ player.field_70170_p.func_72838_d(entityitem); ++ } ++ ++ itemstack.func_77972_a(1, player); ++ player.func_71064_a(StatList.field_75934_C[Block.func_149682_b(block)], 1); ++ } ++ } ++ return false; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSkull.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSkull.java.patch new file mode 100644 index 0000000..c97b41a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSkull.java.patch @@ -0,0 +1,32 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSkull.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSkull.java +@@ -36,11 +36,16 @@ + + public boolean func_77648_a(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { ++ if(p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).isReplaceable(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_7_ != 0) ++ { ++ p_77648_7_ = 1; ++ p_77648_5_--; ++ } + if (p_77648_7_ == 0) + { + return false; + } +- else if (!p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).func_149688_o().func_76220_a()) ++ else if (!p_77648_3_.func_147439_a(p_77648_4_, p_77648_5_, p_77648_6_).func_149688_o().func_76220_a() && !p_77648_3_.isSideSolid(p_77648_4_, p_77648_5_, p_77648_6_, net.minecraftforge.common.util.ForgeDirection.getOrientation(p_77648_7_))) + { + return false; + } +@@ -71,8 +76,11 @@ + ++p_77648_4_; + } + ++ } ++ { + if (!p_77648_3_.field_72995_K) + { ++ if (!Blocks.field_150465_bP.func_149707_d(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_)) return false; + p_77648_3_.func_147465_d(p_77648_4_, p_77648_5_, p_77648_6_, Blocks.field_150465_bP, p_77648_7_, 2); + int i1 = 0; + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemStack.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemStack.java.patch new file mode 100644 index 0000000..f0d3176 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemStack.java.patch @@ -0,0 +1,129 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemStack.java ++++ ../src-work/minecraft/net/minecraft/item/ItemStack.java +@@ -33,6 +33,7 @@ + import net.minecraft.util.IIcon; + import net.minecraft.util.StatCollector; + import net.minecraft.world.World; ++import net.minecraftforge.event.ForgeEventFactory; + + public final class ItemStack + { +@@ -124,6 +125,7 @@ + + public boolean func_77943_a(EntityPlayer p_77943_1_, World p_77943_2_, int p_77943_3_, int p_77943_4_, int p_77943_5_, int p_77943_6_, float p_77943_7_, float p_77943_8_, float p_77943_9_) + { ++ if (!p_77943_2_.field_72995_K) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(this, p_77943_1_, p_77943_2_, p_77943_3_, p_77943_4_, p_77943_5_, p_77943_6_, p_77943_7_, p_77943_8_, p_77943_9_); + boolean flag = this.func_77973_b().func_77648_a(this, p_77943_1_, p_77943_2_, p_77943_3_, p_77943_4_, p_77943_5_, p_77943_6_, p_77943_7_, p_77943_8_, p_77943_9_); + + if (flag) +@@ -182,7 +184,7 @@ + + public int func_77976_d() + { +- return this.func_77973_b().func_77639_j(); ++ return this.func_77973_b().getItemStackLimit(this); + } + + public boolean func_77985_e() +@@ -192,7 +194,7 @@ + + public boolean func_77984_f() + { +- return this.field_151002_e.func_77612_l() <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable"); ++ return this.field_151002_e.getMaxDamage(this) <= 0 ? false : !this.func_77942_o() || !this.func_77978_p().func_74767_n("Unbreakable"); + } + + public boolean func_77981_g() +@@ -202,32 +204,27 @@ + + public boolean func_77951_h() + { +- return this.func_77984_f() && this.field_77991_e > 0; ++ return this.func_77984_f() && func_77973_b().isDamaged(this); + } + + public int func_77952_i() + { +- return this.field_77991_e; ++ return func_77973_b().getDisplayDamage(this); + } + + public int func_77960_j() + { +- return this.field_77991_e; ++ return func_77973_b().getDamage(this); + } + + public void func_77964_b(int p_77964_1_) + { +- this.field_77991_e = p_77964_1_; +- +- if (this.field_77991_e < 0) +- { +- this.field_77991_e = 0; +- } ++ func_77973_b().setDamage(this, p_77964_1_); + } + + public int func_77958_k() + { +- return this.field_151002_e.func_77612_l(); ++ return func_77973_b().getMaxDamage(this); + } + + public boolean func_96631_a(int p_96631_1_, Random p_96631_2_) +@@ -259,8 +256,8 @@ + } + } + +- this.field_77991_e += p_96631_1_; +- return this.field_77991_e > this.func_77958_k(); ++ func_77964_b(func_77960_j() + p_96631_1_); //Redirect through Item's callback if applicable. ++ return func_77960_j() > func_77958_k(); + } + } + +@@ -319,7 +316,7 @@ + + public boolean func_150998_b(Block p_150998_1_) + { +- return this.field_151002_e.func_150897_b(p_150998_1_); ++ return func_77973_b().canHarvestBlock(p_150998_1_, this); + } + + public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_) +@@ -626,16 +623,24 @@ + { + arraylist.add("Durability: " + (this.func_77958_k() - this.func_77952_i()) + " / " + this.func_77958_k()); + } ++ ForgeEventFactory.onItemTooltip(this, p_82840_1_, arraylist, p_82840_2_); + + return arraylist; + } + ++ @Deprecated + @SideOnly(Side.CLIENT) + public boolean func_77962_s() + { +- return this.func_77973_b().func_77636_d(this); ++ return hasEffect(0); + } + ++ @SideOnly(Side.CLIENT) ++ public boolean hasEffect(int pass) ++ { ++ return this.func_77973_b().hasEffect(this, pass); ++ } ++ + public EnumRarity func_77953_t() + { + return this.func_77973_b().func_77613_e(this); +@@ -737,7 +742,7 @@ + } + else + { +- object = this.func_77973_b().func_111205_h(); ++ object = this.func_77973_b().getAttributeModifiers(this); + } + + return (Multimap)object; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSword.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSword.java.patch new file mode 100644 index 0000000..91ad36c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSword.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemSword.java ++++ ../src-work/minecraft/net/minecraft/item/ItemSword.java +@@ -101,7 +101,9 @@ + + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) + { +- return this.field_150933_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_150933_b.getRepairItemStack(); ++ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); + } + + public Multimap func_111205_h() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemTool.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemTool.java.patch new file mode 100644 index 0000000..6eff871 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemTool.java.patch @@ -0,0 +1,85 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemTool.java ++++ ../src-work/minecraft/net/minecraft/item/ItemTool.java +@@ -1,5 +1,6 @@ + package net.minecraft.item; + ++import com.google.common.collect.ImmutableSet; + import com.google.common.collect.Multimap; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; +@@ -10,6 +11,7 @@ + import net.minecraft.entity.SharedMonsterAttributes; + import net.minecraft.entity.ai.attributes.AttributeModifier; + import net.minecraft.world.World; ++import net.minecraftforge.common.ForgeHooks; + + public class ItemTool extends Item + { +@@ -28,6 +30,18 @@ + this.field_77864_a = p_i45333_2_.func_77998_b(); + this.field_77865_bY = p_i45333_1_ + p_i45333_2_.func_78000_c(); + this.func_77637_a(CreativeTabs.field_78040_i); ++ if (this instanceof ItemPickaxe) ++ { ++ toolClass = "pickaxe"; ++ } ++ else if (this instanceof ItemAxe) ++ { ++ toolClass = "axe"; ++ } ++ else if (this instanceof ItemSpade) ++ { ++ toolClass = "shovel"; ++ } + } + + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) +@@ -74,7 +88,9 @@ + + public boolean func_82789_a(ItemStack p_82789_1_, ItemStack p_82789_2_) + { +- return this.field_77862_b.func_150995_f() == p_82789_2_.func_77973_b() ? true : super.func_82789_a(p_82789_1_, p_82789_2_); ++ ItemStack mat = this.field_77862_b.getRepairItemStack(); ++ if (mat != null && net.minecraftforge.oredict.OreDictionary.itemMatches(mat, p_82789_2_, false)) return true; ++ return super.func_82789_a(p_82789_1_, p_82789_2_); + } + + public Multimap func_111205_h() +@@ -83,4 +99,37 @@ + multimap.put(SharedMonsterAttributes.field_111264_e.func_111108_a(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.field_77865_bY, 0)); + return multimap; + } ++ ++ /*===================================== FORGE START =================================*/ ++ private String toolClass; ++ @Override ++ public int getHarvestLevel(ItemStack stack, String toolClass) ++ { ++ int level = super.getHarvestLevel(stack, toolClass); ++ if (level == -1 && toolClass != null && toolClass.equals(this.toolClass)) ++ { ++ return this.field_77862_b.func_77996_d(); ++ } ++ else ++ { ++ return level; ++ } ++ } ++ ++ @Override ++ public Set getToolClasses(ItemStack stack) ++ { ++ return toolClass != null ? ImmutableSet.of(toolClass) : super.getToolClasses(stack); ++ } ++ ++ @Override ++ public float getDigSpeed(ItemStack stack, Block block, int meta) ++ { ++ if (ForgeHooks.isToolEffective(stack, block, meta)) ++ { ++ return field_77864_a; ++ } ++ return super.getDigSpeed(stack, block, meta); ++ } ++ /*===================================== FORGE END =================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/CraftingManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/CraftingManager.java.patch new file mode 100644 index 0000000..ed515cb --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/CraftingManager.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/crafting/CraftingManager.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/CraftingManager.java +@@ -299,7 +299,7 @@ + } + } + +- if (i == 2 && itemstack.func_77973_b() == itemstack1.func_77973_b() && itemstack.field_77994_a == 1 && itemstack1.field_77994_a == 1 && itemstack.func_77973_b().func_77645_m()) ++ if (i == 2 && itemstack.func_77973_b() == itemstack1.func_77973_b() && itemstack.field_77994_a == 1 && itemstack1.field_77994_a == 1 && itemstack.func_77973_b().isRepairable()) + { + Item item = itemstack.func_77973_b(); + int j1 = item.func_77612_l() - itemstack.func_77952_i(); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/FurnaceRecipes.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/FurnaceRecipes.java.patch new file mode 100644 index 0000000..d5a9159 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/FurnaceRecipes.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/FurnaceRecipes.java +@@ -107,6 +107,9 @@ + + public float func_151398_b(ItemStack p_151398_1_) + { ++ float ret = p_151398_1_.func_77973_b().getSmeltingExperience(p_151398_1_); ++ if (ret != -1) return ret; ++ + Iterator iterator = this.field_77605_c.entrySet().iterator(); + Entry entry; + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/RecipeFireworks.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/RecipeFireworks.java.patch new file mode 100644 index 0000000..ebb53f2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/RecipeFireworks.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/item/crafting/RecipeFireworks.java ++++ ../src-work/minecraft/net/minecraft/item/crafting/RecipeFireworks.java +@@ -89,9 +89,9 @@ + { + this.field_92102_a = new ItemStack(Items.field_151152_bP); + ++ nbttagcompound = new NBTTagCompound(); + if (l > 0) + { +- nbttagcompound = new NBTTagCompound(); + nbttagcompound1 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + +@@ -108,8 +108,8 @@ + nbttagcompound1.func_74782_a("Explosions", nbttaglist); + nbttagcompound1.func_74774_a("Flight", (byte)j); + nbttagcompound.func_74782_a("Fireworks", nbttagcompound1); +- this.field_92102_a.func_77982_d(nbttagcompound); + } ++ this.field_92102_a.func_77982_d(nbttagcompound); //Forge BugFix: NPE Protection + + return true; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/CompressedStreamTools.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/CompressedStreamTools.java.patch new file mode 100644 index 0000000..749a98d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/CompressedStreamTools.java.patch @@ -0,0 +1,58 @@ +--- ../src-base/minecraft/net/minecraft/nbt/CompressedStreamTools.java ++++ ../src-work/minecraft/net/minecraft/nbt/CompressedStreamTools.java +@@ -1,7 +1,5 @@ + package net.minecraft.nbt; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedInputStream; + import java.io.BufferedOutputStream; + import java.io.ByteArrayInputStream; +@@ -91,7 +89,6 @@ + return bytearrayoutputstream.toByteArray(); + } + +- @SideOnly(Side.CLIENT) + public static void func_74793_a(NBTTagCompound p_74793_0_, File p_74793_1_) throws IOException + { + File file2 = new File(p_74793_1_.getAbsolutePath() + "_tmp"); +@@ -156,6 +153,7 @@ + private static NBTBase func_152455_a(DataInput p_152455_0_, int p_152455_1_, NBTSizeTracker p_152455_2_) throws IOException + { + byte b0 = p_152455_0_.readByte(); ++ p_152455_2_.func_152450_a(8); // Forge: Count everything! + + if (b0 == 0) + { +@@ -163,7 +161,8 @@ + } + else + { +- p_152455_0_.readUTF(); ++ NBTSizeTracker.readUTF(p_152455_2_, p_152455_0_.readUTF()); //Forge: Count this string. ++ p_152455_2_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(b0); + + try +@@ -182,7 +181,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public static void func_74795_b(NBTTagCompound p_74795_0_, File p_74795_1_) throws IOException + { + DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(p_74795_1_)); +@@ -197,13 +195,11 @@ + } + } + +- @SideOnly(Side.CLIENT) + public static NBTTagCompound func_74797_a(File p_74797_0_) throws IOException + { + return func_152458_a(p_74797_0_, NBTSizeTracker.field_152451_a); + } + +- @SideOnly(Side.CLIENT) + public static NBTTagCompound func_152458_a(File p_152458_0_, NBTSizeTracker p_152458_1_) throws IOException + { + if (!p_152458_0_.exists()) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTSizeTracker.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTSizeTracker.java.patch new file mode 100644 index 0000000..c7720b7 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTSizeTracker.java.patch @@ -0,0 +1,37 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTSizeTracker.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTSizeTracker.java +@@ -25,4 +25,34 @@ + throw new RuntimeException("Tried to read NBT tag that was too big; tried to allocate: " + this.field_152453_c + "bytes where max allowed: " + this.field_152452_b); + } + } ++ ++ /* ++ * UTF8 is not a simple encoding system, each character can be either ++ * 1, 2, or 3 bytes. Depending on where it's numerical value falls. ++ * We have to count up each character individually to see the true ++ * length of the data. ++ * ++ * Basic concept is that it uses the MSB of each byte as a 'read more' signal. ++ * So it has to shift each 7-bit segment. ++ * ++ * This will accurately count the correct byte length to encode this string, plus the 2 bytes for it's length prefix. ++ */ ++ public static void readUTF(NBTSizeTracker tracker, String data) ++ { ++ tracker.func_152450_a(16); //Header length ++ if (data == null) ++ return; ++ ++ int len = data.length(); ++ int utflen = 0; ++ ++ for (int i = 0; i < len; i++) ++ { ++ int c = data.charAt(i); ++ if ((c >= 0x0001) && (c <= 0x007F)) utflen += 1; ++ else if (c > 0x07FF) utflen += 3; ++ else utflen += 2; ++ } ++ tracker.func_152450_a(8 * utflen); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagByteArray.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagByteArray.java.patch new file mode 100644 index 0000000..ead6ffc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagByteArray.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagByteArray.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagByteArray.java +@@ -25,6 +25,7 @@ + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException + { ++ p_152446_3_.func_152450_a(32); //Forge: Count the length as well + int j = p_152446_1_.readInt(); + p_152446_3_.func_152450_a((long)(8 * j)); + this.field_74754_a = new byte[j]; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagCompound.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagCompound.java.patch new file mode 100644 index 0000000..f98f85e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagCompound.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagCompound.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagCompound.java +@@ -48,7 +48,7 @@ + while ((b0 = func_152447_a(p_152446_1_, p_152446_3_)) != 0) + { + String s = func_152448_b(p_152446_1_, p_152446_3_); +- p_152446_3_.func_152450_a((long)(16 * s.length())); ++ NBTSizeTracker.readUTF(p_152446_3_, s); // Forge: Correctly read String length including header. + NBTBase nbtbase = func_152449_a(b0, s, p_152446_1_, p_152446_2_ + 1, p_152446_3_); + this.field_74784_a.put(s, nbtbase); + } +@@ -379,6 +379,7 @@ + + private static byte func_152447_a(DataInput p_152447_0_, NBTSizeTracker p_152447_1_) throws IOException + { ++ p_152447_1_.func_152450_a(8); + return p_152447_0_.readByte(); + } + +@@ -389,6 +390,7 @@ + + static NBTBase func_152449_a(byte p_152449_0_, String p_152449_1_, DataInput p_152449_2_, int p_152449_3_, NBTSizeTracker p_152449_4_) + { ++ p_152449_4_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(p_152449_0_); + + try diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagIntArray.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagIntArray.java.patch new file mode 100644 index 0000000..40a4b4c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagIntArray.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagIntArray.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagIntArray.java +@@ -29,6 +29,7 @@ + + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException + { ++ p_152446_3_.func_152450_a(32); //Forge: Count the length as well + int j = p_152446_1_.readInt(); + p_152446_3_.func_152450_a((long)(32 * j)); + this.field_74749_a = new int[j]; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagList.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagList.java.patch new file mode 100644 index 0000000..7fc49f2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagList.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagList.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagList.java +@@ -1,7 +1,5 @@ + package net.minecraft.nbt; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; + import java.io.DataInput; + import java.io.DataOutput; + import java.io.IOException; +@@ -45,11 +43,13 @@ + { + p_152446_3_.func_152450_a(8L); + this.field_74746_b = p_152446_1_.readByte(); ++ p_152446_3_.func_152450_a(32); //Forge: Count the length as well + int j = p_152446_1_.readInt(); + this.field_74747_a = new ArrayList(); + + for (int k = 0; k < j; ++k) + { ++ p_152446_3_.func_152450_a(32); //Forge: 4 extra bytes for the object allocation. + NBTBase nbtbase = NBTBase.func_150284_a(this.field_74746_b); + nbtbase.func_152446_a(p_152446_1_, p_152446_2_ + 1, p_152446_3_); + this.field_74747_a.add(nbtbase); +@@ -91,7 +91,6 @@ + this.field_74747_a.add(p_74742_1_); + } + +- @SideOnly(Side.CLIENT) + public void func_150304_a(int p_150304_1_, NBTBase p_150304_2_) + { + if (p_150304_1_ >= 0 && p_150304_1_ < this.field_74747_a.size()) +@@ -114,7 +113,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public NBTBase func_74744_a(int p_74744_1_) + { + return (NBTBase)this.field_74747_a.remove(p_74744_1_); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagString.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagString.java.patch new file mode 100644 index 0000000..56efede --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagString.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/nbt/NBTTagString.java ++++ ../src-work/minecraft/net/minecraft/nbt/NBTTagString.java +@@ -32,7 +32,7 @@ + void func_152446_a(DataInput p_152446_1_, int p_152446_2_, NBTSizeTracker p_152446_3_) throws IOException + { + this.field_74751_a = p_152446_1_.readUTF(); +- p_152446_3_.func_152450_a((long)(16 * this.field_74751_a.length())); ++ NBTSizeTracker.readUTF(p_152446_3_, field_74751_a); // Forge: Correctly read String length including header. + } + + public byte func_74732_a() diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/NetHandlerPlayServer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/NetHandlerPlayServer.java.patch new file mode 100644 index 0000000..9738d4c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -0,0 +1,173 @@ +--- ../src-base/minecraft/net/minecraft/network/NetHandlerPlayServer.java ++++ ../src-work/minecraft/net/minecraft/network/NetHandlerPlayServer.java +@@ -86,6 +86,14 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.MinecraftForge; ++import cpw.mods.fml.common.eventhandler.Event; ++import net.minecraftforge.event.ForgeEventFactory; ++import net.minecraftforge.event.ServerChatEvent; ++import net.minecraftforge.event.entity.player.PlayerInteractEvent; ++import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; ++ + public class NetHandlerPlayServer implements INetHandlerPlayServer + { + private static final Logger field_147370_c = LogManager.getLogger(); +@@ -222,6 +230,11 @@ + this.field_147369_b.field_70154_o.func_70043_V(); + } + ++ if (!this.field_147380_r) //Fixes teleportation kick while riding entities ++ { ++ return; ++ } ++ + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); + + if (this.field_147380_r) +@@ -299,9 +312,10 @@ + d4 = d1 - this.field_147369_b.field_70165_t; + double d5 = d2 - this.field_147369_b.field_70163_u; + double d6 = d3 - this.field_147369_b.field_70161_v; +- double d7 = Math.min(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w)); +- double d8 = Math.min(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x)); +- double d9 = Math.min(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y)); ++ //BUGFIX: min -> max, grabs the highest distance ++ double d7 = Math.max(Math.abs(d4), Math.abs(this.field_147369_b.field_70159_w)); ++ double d8 = Math.max(Math.abs(d5), Math.abs(this.field_147369_b.field_70181_x)); ++ double d9 = Math.max(Math.abs(d6), Math.abs(this.field_147369_b.field_70179_y)); + double d10 = d7 * d7 + d8 * d8 + d9 * d9; + + if (d10 > 100.0D && (!this.field_147367_d.func_71264_H() || !this.field_147367_d.func_71214_G().equals(this.field_147369_b.func_70005_c_()))) +@@ -319,6 +333,11 @@ + this.field_147369_b.func_70664_aZ(); + } + ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ { ++ return; ++ } ++ + this.field_147369_b.func_70091_d(d4, d5, d6); + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + this.field_147369_b.func_71000_j(d4, d5, d6); +@@ -341,10 +360,15 @@ + field_147370_c.warn(this.field_147369_b.func_70005_c_() + " moved wrongly!"); + } + ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ { ++ return; ++ } ++ + this.field_147369_b.func_70080_a(d1, d2, d3, f1, f2); + boolean flag2 = worldserver.func_72945_a(this.field_147369_b, this.field_147369_b.field_70121_D.func_72329_c().func_72331_e((double)f3, (double)f3, (double)f3)).isEmpty(); + +- if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn()) ++ if (flag && (flag1 || !flag2) && !this.field_147369_b.func_70608_bn() && !this.field_147369_b.field_70145_X) + { + this.func_147364_a(this.field_147373_o, this.field_147382_p, this.field_147381_q, f1, f2); + return; +@@ -352,7 +376,7 @@ + + AxisAlignedBB axisalignedbb = this.field_147369_b.field_70121_D.func_72329_c().func_72314_b((double)f3, (double)f3, (double)f3).func_72321_a(0.0D, -0.55D, 0.0D); + +- if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb)) ++ if (!this.field_147367_d.func_71231_X() && !this.field_147369_b.field_71134_c.func_73083_d() && !worldserver.func_72829_c(axisalignedbb) && !this.field_147369_b.field_71075_bZ.field_75101_c) + { + if (d11 >= -0.03125D) + { +@@ -371,6 +395,11 @@ + this.field_147365_f = 0; + } + ++ if (!this.field_147380_r) //Fixes "Moved Too Fast" kick when being teleported while moving ++ { ++ return; ++ } ++ + this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); + this.field_147367_d.func_71203_ab().func_72358_d(this.field_147369_b); + this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - d0, p_147347_1_.func_149465_i()); +@@ -439,7 +468,10 @@ + double d2 = this.field_147369_b.field_70161_v - ((double)k + 0.5D); + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + +- if (d3 > 36.0D) ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1; ++ dist *= dist; ++ ++ if (d3 > dist) + { + return; + } +@@ -487,6 +519,7 @@ + WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); + ItemStack itemstack = this.field_147369_b.field_71071_by.func_70448_g(); + boolean flag = false; ++ boolean placeResult = true; + int i = p_147346_1_.func_149576_c(); + int j = p_147346_1_.func_149571_d(); + int k = p_147346_1_.func_149570_e(); +@@ -500,7 +533,11 @@ + return; + } + +- this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_147369_b, PlayerInteractEvent.Action.RIGHT_CLICK_AIR, 0, 0, 0, -1, worldserver); ++ if (event.useItem != Event.Result.DENY) ++ { ++ this.field_147369_b.field_71134_c.func_73085_a(this.field_147369_b, worldserver, itemstack); ++ } + } + else if (p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z() - 1 && (p_147346_1_.func_149568_f() == 1 || p_147346_1_.func_149571_d() >= this.field_147367_d.func_71207_Z())) + { +@@ -511,9 +548,15 @@ + } + else + { +- if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64.0D && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b)) ++ double dist = field_147369_b.field_71134_c.getBlockReachDistance() + 1; ++ dist *= dist; ++ if (this.field_147380_r && this.field_147369_b.func_70092_e((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && !this.field_147367_d.func_96290_a(worldserver, i, j, k, this.field_147369_b)) + { +- this.field_147369_b.field_71134_c.func_73078_a(this.field_147369_b, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j()); ++ // record block place result so we can update client itemstack size if place event was cancelled. ++ if (!this.field_147369_b.field_71134_c.func_73078_a(this.field_147369_b, worldserver, itemstack, i, j, k, l, p_147346_1_.func_149573_h(), p_147346_1_.func_149569_i(), p_147346_1_.func_149575_j())) ++ { ++ placeResult = false; ++ } + } + + flag = true; +@@ -572,7 +615,7 @@ + this.field_147369_b.field_71070_bA.func_75142_b(); + this.field_147369_b.field_71137_h = false; + +- if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g())) ++ if (!ItemStack.func_77989_b(this.field_147369_b.field_71071_by.func_70448_g(), p_147346_1_.func_149574_g()) || !placeResult) // force client itemstack update if place event was cancelled + { + this.func_147359_a(new S2FPacketSetSlot(this.field_147369_b.field_71070_bA.field_75152_c, slot.field_75222_d, this.field_147369_b.field_71071_by.func_70448_g())); + } +@@ -676,7 +719,9 @@ + } + else + { +- ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), s}); ++ ChatComponentTranslation chatcomponenttranslation1 = new ChatComponentTranslation("chat.type.text", new Object[] {this.field_147369_b.func_145748_c_(), ForgeHooks.newChatWithLinks(s)}); // Fixes chat links ++ chatcomponenttranslation1 = ForgeHooks.onServerChatEvent(this, s, chatcomponenttranslation1); ++ if (chatcomponenttranslation1 == null) return; + this.field_147367_d.func_71203_ab().func_148544_a(chatcomponenttranslation1, false); + } + +@@ -812,7 +857,7 @@ + return; + } + +- this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, 0, false); ++ this.field_147369_b = this.field_147367_d.func_71203_ab().func_72368_a(this.field_147369_b, field_147369_b.field_71093_bK, false); + } + + break; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S21PacketChunkData.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S21PacketChunkData.java.patch new file mode 100644 index 0000000..9dc0a82 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S21PacketChunkData.java.patch @@ -0,0 +1,79 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/S21PacketChunkData.java +@@ -3,6 +3,7 @@ + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; ++import java.util.concurrent.Semaphore; + import java.util.zip.DataFormatException; + import java.util.zip.Deflater; + import java.util.zip.Inflater; +@@ -26,6 +27,7 @@ + private int field_149285_h; + private static byte[] field_149286_i = new byte[196864]; + private static final String __OBFID = "CL_00001304"; ++ private Semaphore deflateGate; + + public S21PacketChunkData() {} + +@@ -35,17 +37,22 @@ + this.field_149282_b = p_i45196_1_.field_76647_h; + this.field_149279_g = p_i45196_2_; + S21PacketChunkData.Extracted extracted = func_149269_a(p_i45196_1_, p_i45196_2_, p_i45196_3_); +- Deflater deflater = new Deflater(-1); + this.field_149280_d = extracted.field_150281_c; + this.field_149283_c = extracted.field_150280_b; ++ this.field_149278_f = extracted.field_150282_a; ++ this.deflateGate = new Semaphore(1); ++ } + ++ private void deflate() ++ { ++ Deflater deflater = new Deflater(-1); + try + { +- this.field_149278_f = extracted.field_150282_a; +- deflater.setInput(extracted.field_150282_a, 0, extracted.field_150282_a.length); ++ deflater.setInput(this.field_149278_f, 0, this.field_149278_f.length); + deflater.finish(); +- this.field_149281_e = new byte[extracted.field_150282_a.length]; +- this.field_149285_h = deflater.deflate(this.field_149281_e); ++ byte[] deflated = new byte[this.field_149278_f.length]; ++ this.field_149285_h = deflater.deflate(deflated); ++ this.field_149281_e = deflated; + } + finally + { +@@ -75,13 +82,16 @@ + p_148837_1_.readBytes(field_149286_i, 0, this.field_149285_h); + int i = 0; + int j; ++ int msb = 0; //BugFix: MC does not read the MSB array from the packet properly, causing issues for servers that use blocks > 256 + + for (j = 0; j < 16; ++j) + { + i += this.field_149283_c >> j & 1; ++ msb += this.field_149283_c >> j & 1; + } + + j = 12288 * i; ++ j += 2048 * msb; + + if (this.field_149279_g) + { +@@ -108,6 +118,15 @@ + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { ++ if (this.field_149281_e == null) ++ { ++ deflateGate.acquireUninterruptibly(); ++ if (this.field_149281_e == null) ++ { ++ deflate(); ++ } ++ deflateGate.release(); ++ } + p_148840_1_.writeInt(this.field_149284_a); + p_148840_1_.writeInt(this.field_149282_b); + p_148840_1_.writeBoolean(this.field_149279_g); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch new file mode 100644 index 0000000..04eb440 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch @@ -0,0 +1,84 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/S26PacketMapChunkBulk.java +@@ -4,6 +4,7 @@ + import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; + import java.util.List; ++import java.util.concurrent.Semaphore; + import java.util.zip.DataFormatException; + import java.util.zip.Deflater; + import java.util.zip.Inflater; +@@ -25,6 +26,8 @@ + private boolean field_149267_h; + private static byte[] field_149268_i = new byte[0]; + private static final String __OBFID = "CL_00001306"; ++ private int maxLen = 0; ++ private Semaphore deflateGate; + + public S26PacketMapChunkBulk() {} + +@@ -43,15 +46,6 @@ + { + Chunk chunk = (Chunk)p_i45197_1_.get(k); + S21PacketChunkData.Extracted extracted = S21PacketChunkData.func_149269_a(chunk, true, 65535); +- +- if (field_149268_i.length < j + extracted.field_150282_a.length) +- { +- byte[] abyte = new byte[j + extracted.field_150282_a.length]; +- System.arraycopy(field_149268_i, 0, abyte, 0, field_149268_i.length); +- field_149268_i = abyte; +- } +- +- System.arraycopy(extracted.field_150282_a, 0, field_149268_i, j, extracted.field_150282_a.length); + j += extracted.field_150282_a.length; + this.field_149266_a[k] = chunk.field_76635_g; + this.field_149264_b[k] = chunk.field_76647_h; +@@ -59,15 +53,28 @@ + this.field_149262_d[k] = extracted.field_150281_c; + this.field_149260_f[k] = extracted.field_150282_a; + } ++ this.deflateGate = new Semaphore(1); ++ maxLen = j; ++ } + ++ private void deflate() ++ { ++ byte[] data = new byte[maxLen]; ++ int offset = 0; ++ for (int x = 0; x < field_149260_f.length; x++) ++ { ++ System.arraycopy(field_149260_f[x], 0, data, offset, field_149260_f[x].length); ++ offset += field_149260_f[x].length; ++ } + Deflater deflater = new Deflater(-1); + + try + { +- deflater.setInput(field_149268_i, 0, j); ++ deflater.setInput(data, 0, data.length); + deflater.finish(); +- this.field_149263_e = new byte[j]; +- this.field_149261_g = deflater.deflate(this.field_149263_e); ++ byte[] deflated = new byte[data.length]; ++ this.field_149261_g = deflater.deflate(deflated); ++ this.field_149263_e = deflated; + } + finally + { +@@ -148,6 +155,16 @@ + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { ++ if (this.field_149263_e == null) ++ { ++ deflateGate.acquireUninterruptibly(); ++ if (this.field_149263_e == null) ++ { ++ deflate(); ++ } ++ deflateGate.release(); ++ } ++ + p_148840_1_.writeShort(this.field_149266_a.length); + p_148840_1_.writeInt(this.field_149261_g); + p_148840_1_.writeBoolean(this.field_149267_h); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/Potion.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/Potion.java.patch new file mode 100644 index 0000000..32c3587 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/Potion.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/potion/Potion.java ++++ ../src-work/minecraft/net/minecraft/potion/Potion.java +@@ -307,4 +307,27 @@ + { + return p_111183_2_.func_111164_d() * (double)(p_111183_1_ + 1); + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ ++ /** ++ * If the standard PotionEffect text (name and duration) should be drawn when this potion is active. ++ * @param effect the active PotionEffect ++ * @return true to draw the standard text ++ */ ++ public boolean shouldRenderInvText(PotionEffect effect) ++ { ++ return true; ++ } ++ ++ /** ++ * 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 x the x coordinate ++ * @param y the y coordinate ++ * @param effect the active PotionEffect ++ * @param mc the Minecraft instance, for convenience ++ */ ++ @SideOnly(Side.CLIENT) ++ public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/PotionEffect.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/PotionEffect.java.patch new file mode 100644 index 0000000..1d789ea --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/PotionEffect.java.patch @@ -0,0 +1,105 @@ +--- ../src-base/minecraft/net/minecraft/potion/PotionEffect.java ++++ ../src-work/minecraft/net/minecraft/potion/PotionEffect.java +@@ -1,8 +1,13 @@ + package net.minecraft.potion; + ++import java.util.ArrayList; ++import java.util.List; ++ + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.entity.EntityLivingBase; ++import net.minecraft.init.Items; ++import net.minecraft.item.ItemStack; + import net.minecraft.nbt.NBTTagCompound; + + public class PotionEffect +@@ -15,6 +20,8 @@ + @SideOnly(Side.CLIENT) + private boolean field_100013_f; + private static final String __OBFID = "CL_00001529"; ++ /** List of ItemStack that can cure the potion effect **/ ++ private List curativeItems; + + public PotionEffect(int p_i1574_1_, int p_i1574_2_) + { +@@ -32,6 +39,8 @@ + this.field_76460_b = p_i1576_2_; + this.field_76461_c = p_i1576_3_; + this.field_82724_e = p_i1576_4_; ++ this.curativeItems = new ArrayList(); ++ this.curativeItems.add(new ItemStack(Items.field_151117_aB)); + } + + public PotionEffect(PotionEffect p_i1577_1_) +@@ -39,6 +48,7 @@ + this.field_76462_a = p_i1577_1_.field_76462_a; + this.field_76460_b = p_i1577_1_.field_76460_b; + this.field_76461_c = p_i1577_1_.field_76461_c; ++ this.curativeItems = p_i1577_1_.curativeItems; + } + + public void func_76452_a(PotionEffect p_76452_1_) +@@ -197,4 +207,62 @@ + { + return this.field_100013_f; + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ /*** ++ * Returns a list of curative items for the potion effect ++ * @return The list (ItemStack) of curative items for the potion effect ++ */ ++ public List getCurativeItems() ++ { ++ return this.curativeItems; ++ } ++ ++ /*** ++ * Checks the given ItemStack to see if it is in the list of curative items for the potion effect ++ * @param stack The ItemStack being checked against the list of curative items for the potion effect ++ * @return true if the given ItemStack is in the list of curative items for the potion effect, false otherwise ++ */ ++ public boolean isCurativeItem(ItemStack stack) ++ { ++ boolean found = false; ++ for (ItemStack curativeItem : this.curativeItems) ++ { ++ if (curativeItem.func_77969_a(stack)) ++ { ++ found = true; ++ } ++ } ++ ++ return found; ++ } ++ ++ /*** ++ * Sets the array of curative items for the potion effect ++ * @param curativeItems The list of ItemStacks being set to the potion effect ++ */ ++ public void setCurativeItems(List curativeItems) ++ { ++ this.curativeItems = curativeItems; ++ } ++ ++ /*** ++ * Adds the given stack to list of curative items for the potion effect ++ * @param stack The ItemStack being added to the curative item list ++ */ ++ public void addCurativeItem(ItemStack stack) ++ { ++ boolean found = false; ++ for (ItemStack curativeItem : this.curativeItems) ++ { ++ if (curativeItem.func_77969_a(stack)) ++ { ++ found = true; ++ } ++ } ++ if (!found) ++ { ++ this.curativeItems.add(stack); ++ } ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/MinecraftServer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/MinecraftServer.java.patch new file mode 100644 index 0000000..f0d5e0c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/MinecraftServer.java.patch @@ -0,0 +1,193 @@ +--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java ++++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java +@@ -27,6 +27,7 @@ + import java.util.Arrays; + import java.util.Collections; + import java.util.Date; ++import java.util.Hashtable; + import java.util.Iterator; + import java.util.List; + import java.util.Random; +@@ -75,6 +76,10 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import net.minecraftforge.common.DimensionManager; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.world.WorldEvent; ++ + public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage + { + private static final Logger field_147145_h = LogManager.getLogger(); +@@ -92,7 +97,7 @@ + @SideOnly(Side.SERVER) + private String field_71320_r; + private int field_71319_s = -1; +- public WorldServer[] field_71305_c; ++ public WorldServer[] field_71305_c = new WorldServer[0]; + private ServerConfigurationManager field_71318_t; + private boolean field_71317_u = true; + private boolean field_71316_v; +@@ -109,7 +114,8 @@ + private int field_71280_D; + private int field_143008_E = 0; + public final long[] field_71311_j = new long[100]; +- public long[][] field_71312_k; ++ //public long[][] timeOfLastDimensionTick; ++ public Hashtable worldTickTimes = new Hashtable(); + private KeyPair field_71292_I; + private String field_71293_J; + private String field_71294_K; +@@ -191,8 +197,6 @@ + { + this.func_71237_c(p_71247_1_); + this.func_71192_d("menu.loadingLevel"); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.field_71310_m.func_75804_a(p_71247_1_, true); + WorldInfo worldinfo = isavehandler.func_75757_d(); + WorldSettings worldsettings; +@@ -212,46 +216,21 @@ + worldsettings.func_77159_a(); + } + +- for (int j = 0; j < this.field_71305_c.length; ++j) ++ WorldServer overWorld = (func_71242_L() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, field_71304_b) : new WorldServer(this, isavehandler, p_71247_2_, 0, worldsettings, field_71304_b)); ++ for (int dim : DimensionManager.getStaticDimensionIDs()) + { +- byte b0 = 0; ++ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, worldsettings, overWorld, field_71304_b)); ++ world.func_72954_a(new WorldManager(this, world)); + +- if (j == 1) +- { +- b0 = -1; +- } +- +- if (j == 2) +- { +- b0 = 1; +- } +- +- if (j == 0) +- { +- if (this.func_71242_L()) +- { +- this.field_71305_c[j] = new DemoWorldServer(this, isavehandler, p_71247_2_, b0, this.field_71304_b); +- } +- else +- { +- this.field_71305_c[j] = new WorldServer(this, isavehandler, p_71247_2_, b0, worldsettings, this.field_71304_b); +- } +- } +- else +- { +- this.field_71305_c[j] = new WorldServerMulti(this, isavehandler, p_71247_2_, b0, worldsettings, this.field_71305_c[0], this.field_71304_b); +- } +- +- this.field_71305_c[j].func_72954_a(new WorldManager(this, this.field_71305_c[j])); +- + if (!this.func_71264_H()) + { +- this.field_71305_c[j].func_72912_H().func_76060_a(this.func_71265_f()); ++ world.func_72912_H().func_76060_a(this.func_71265_f()); + } + +- this.field_71318_t.func_72364_a(this.field_71305_c); ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + } + ++ this.field_71318_t.func_72364_a(new WorldServer[]{ overWorld }); + this.func_147139_a(this.func_147135_j()); + this.func_71222_d(); + } +@@ -320,6 +299,7 @@ + if (!this.field_71290_O) + { + WorldServer[] aworldserver = this.field_71305_c; ++ if (aworldserver == null) return; //Forge: Just in case, NPE protection as it has been encountered. + int i = aworldserver.length; + + for (int j = 0; j < i; ++j) +@@ -372,8 +352,15 @@ + for (int i = 0; i < this.field_71305_c.length; ++i) + { + WorldServer worldserver = this.field_71305_c[i]; ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); + worldserver.func_73041_k(); + } ++ ++ WorldServer[] tmp = field_71305_c; ++ for (WorldServer world : tmp) ++ { ++ DimensionManager.setWorld(world.field_73011_w.field_76574_g, null); ++ } + } + + if (this.field_71307_n.func_76468_d()) +@@ -606,15 +593,18 @@ + public void func_71190_q() + { + this.field_71304_b.func_76320_a("levels"); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(); + int i; + +- for (i = 0; i < this.field_71305_c.length; ++i) ++ Integer[] ids = DimensionManager.getIDs(this.field_71315_w % 200 == 0); ++ for (int x = 0; x < ids.length; x++) + { ++ int id = ids[x]; + long j = System.nanoTime(); + +- if (i == 0 || this.func_71255_r()) ++ if (id == 0 || this.func_71255_r()) + { +- WorldServer worldserver = this.field_71305_c[i]; ++ WorldServer worldserver = DimensionManager.getWorld(id); + this.field_71304_b.func_76320_a(worldserver.func_72912_H().func_76065_j()); + this.field_71304_b.func_76320_a("pools"); + this.field_71304_b.func_76319_b(); +@@ -660,9 +650,11 @@ + this.field_71304_b.func_76319_b(); + } + +- this.field_71312_k[i][this.field_71315_w % 100] = System.nanoTime() - j; ++ worldTickTimes.get(id)[this.field_71315_w % 100] = System.nanoTime() - j; + } + ++ this.field_71304_b.func_76318_c("dim_unloading"); ++ DimensionManager.unloadWorlds(worldTickTimes); + this.field_71304_b.func_76318_c("connection"); + this.func_147137_ag().func_151269_c(); + this.field_71304_b.func_76318_c("players"); +@@ -707,7 +699,13 @@ + + public WorldServer func_71218_a(int p_71218_1_) + { +- return p_71218_1_ == -1 ? this.field_71305_c[1] : (p_71218_1_ == 1 ? this.field_71305_c[2] : this.field_71305_c[0]); ++ WorldServer ret = DimensionManager.getWorld(p_71218_1_); ++ if (ret == null) ++ { ++ DimensionManager.initDimension(p_71218_1_); ++ ret = DimensionManager.getWorld(p_71218_1_); ++ } ++ return ret; + } + + public String func_71249_w() +@@ -971,6 +969,7 @@ + + if (worldserver != null) + { ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(worldserver)); + worldserver.func_73041_k(); + } + } +@@ -1451,7 +1450,6 @@ + this.field_147141_M = p_155759_1_; + } + +- @SideOnly(Side.SERVER) + public boolean func_71241_aa() + { + return this.field_71316_v; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/integrated/IntegratedServer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/integrated/IntegratedServer.java.patch new file mode 100644 index 0000000..3cbe147 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java ++++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java +@@ -23,6 +23,9 @@ + import net.minecraft.world.WorldType; + import net.minecraft.world.demo.DemoWorldServer; + import net.minecraft.world.storage.ISaveHandler; ++import net.minecraftforge.common.DimensionManager; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.world.WorldEvent; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -54,44 +57,23 @@ + protected void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) + { + this.func_71237_c(p_71247_1_); +- this.field_71305_c = new WorldServer[3]; +- this.field_71312_k = new long[this.field_71305_c.length][100]; + ISaveHandler isavehandler = this.func_71254_M().func_75804_a(p_71247_1_, true); + +- for (int j = 0; j < this.field_71305_c.length; ++j) ++ WorldServer overWorld = (func_71242_L() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, field_71304_b) : new WorldServer(this, isavehandler, p_71247_2_, 0, field_71350_m, field_71304_b)); ++ for (int dim : DimensionManager.getStaticDimensionIDs()) + { +- byte b0 = 0; ++ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, field_71350_m, overWorld, field_71304_b)); ++ world.func_72954_a(new WorldManager(this, world)); + +- if (j == 1) ++ if (!this.func_71264_H()) + { +- b0 = -1; ++ world.func_72912_H().func_76060_a(func_71265_f()); + } + +- if (j == 2) +- { +- b0 = 1; +- } +- +- if (j == 0) +- { +- if (this.func_71242_L()) +- { +- this.field_71305_c[j] = new DemoWorldServer(this, isavehandler, p_71247_2_, b0, this.field_71304_b); +- } +- else +- { +- this.field_71305_c[j] = new WorldServer(this, isavehandler, p_71247_2_, b0, this.field_71350_m, this.field_71304_b); +- } +- } +- else +- { +- this.field_71305_c[j] = new WorldServerMulti(this, isavehandler, p_71247_2_, b0, this.field_71350_m, this.field_71305_c[0], this.field_71304_b); +- } +- +- this.field_71305_c[j].func_72954_a(new WorldManager(this, this.field_71305_c[j])); +- this.func_71203_ab().func_72364_a(this.field_71305_c); ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world)); + } + ++ this.func_71203_ab().func_72364_a(new WorldServer[]{ overWorld }); + this.func_147139_a(this.func_147135_j()); + this.func_71222_d(); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ItemInWorldManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ItemInWorldManager.java.patch new file mode 100644 index 0000000..0ab1534 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -0,0 +1,258 @@ +--- ../src-base/minecraft/net/minecraft/server/management/ItemInWorldManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/ItemInWorldManager.java +@@ -7,12 +7,23 @@ + import net.minecraft.item.ItemStack; + import net.minecraft.item.ItemSword; + import net.minecraft.network.play.server.S23PacketBlockChange; ++import net.minecraft.tileentity.TileEntity; + import net.minecraft.world.World; + import net.minecraft.world.WorldServer; + import net.minecraft.world.WorldSettings; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.MinecraftForge; ++import cpw.mods.fml.common.eventhandler.Event; ++import net.minecraftforge.event.ForgeEventFactory; ++import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; ++import net.minecraftforge.event.entity.player.PlayerInteractEvent; ++import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; ++import net.minecraftforge.event.world.BlockEvent; + + public class ItemInWorldManager + { ++ /** Forge reach distance */ ++ private double blockReachDistance = 5.0d; + public World field_73092_a; + public EntityPlayerMP field_73090_b; + private WorldSettings.GameType field_73091_c; +@@ -126,6 +137,13 @@ + { + if (!this.field_73091_c.func_82752_c() || this.field_73090_b.func_82246_f(p_73074_1_, p_73074_2_, p_73074_3_)) + { ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(field_73090_b, Action.LEFT_CLICK_BLOCK, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_, field_73092_a); ++ if (event.isCanceled()) ++ { ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); ++ return; ++ } ++ + if (this.func_73083_d()) + { + if (!this.field_73092_a.func_72886_a((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_)) +@@ -135,19 +153,36 @@ + } + else + { +- this.field_73092_a.func_72886_a((EntityPlayer)null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); + this.field_73089_e = this.field_73100_i; + float f = 1.0F; + Block block = this.field_73092_a.func_147439_a(p_73074_1_, p_73074_2_, p_73074_3_); + +- if (block.func_149688_o() != Material.field_151579_a) ++ ++ if (!block.isAir(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_)) + { +- block.func_149699_a(this.field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_, this.field_73090_b); +- f = block.func_149737_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_73074_1_, p_73074_2_, p_73074_3_); ++ if (event.useBlock != Event.Result.DENY) ++ { ++ block.func_149699_a(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_, field_73090_b); ++ field_73092_a.func_72886_a(null, p_73074_1_, p_73074_2_, p_73074_3_, p_73074_4_); ++ } ++ else ++ { ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); ++ } ++ f = block.func_149737_a(field_73090_b, field_73090_b.field_70170_p, p_73074_1_, p_73074_2_, p_73074_3_); + } + +- if (block.func_149688_o() != Material.field_151579_a && f >= 1.0F) ++ if (event.useItem == Event.Result.DENY) + { ++ if (f >= 1.0f) ++ { ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73074_1_, p_73074_2_, p_73074_3_, field_73092_a)); ++ } ++ return; ++ } ++ ++ if (!block.isAir(field_73092_a, p_73074_1_, p_73074_2_, p_73074_3_) && f >= 1.0F) ++ { + this.func_73084_b(p_73074_1_, p_73074_2_, p_73074_3_); + } + else +@@ -171,7 +206,7 @@ + int l = this.field_73100_i - this.field_73089_e; + Block block = this.field_73092_a.func_147439_a(p_73082_1_, p_73082_2_, p_73082_3_); + +- if (block.func_149688_o() != Material.field_151579_a) ++ if (!block.isAir(field_73092_a, p_73082_1_, p_73082_2_, p_73082_3_)) + { + float f = block.func_149737_a(this.field_73090_b, this.field_73090_b.field_70170_p, p_73082_1_, p_73082_2_, p_73082_3_) * (float)(l + 1); + +@@ -202,10 +237,14 @@ + + private boolean func_73079_d(int p_73079_1_, int p_73079_2_, int p_73079_3_) + { ++ return removeBlock(p_73079_1_, p_73079_2_, p_73079_3_, false); ++ } ++ private boolean removeBlock(int p_73079_1_, int p_73079_2_, int p_73079_3_, boolean canHarvest) ++ { + Block block = this.field_73092_a.func_147439_a(p_73079_1_, p_73079_2_, p_73079_3_); + int l = this.field_73092_a.func_72805_g(p_73079_1_, p_73079_2_, p_73079_3_); + block.func_149681_a(this.field_73092_a, p_73079_1_, p_73079_2_, p_73079_3_, l, this.field_73090_b); +- boolean flag = this.field_73092_a.func_147468_f(p_73079_1_, p_73079_2_, p_73079_3_); ++ boolean flag = block.removedByPlayer(field_73092_a, field_73090_b, p_73079_1_, p_73079_2_, p_73079_3_, canHarvest); + + if (flag) + { +@@ -217,29 +256,32 @@ + + public boolean func_73084_b(int p_73084_1_, int p_73084_2_, int p_73084_3_) + { +- if (this.field_73091_c.func_82752_c() && !this.field_73090_b.func_82246_f(p_73084_1_, p_73084_2_, p_73084_3_)) ++ BlockEvent.BreakEvent event = ForgeHooks.onBlockBreakEvent(field_73092_a, field_73091_c, field_73090_b, p_73084_1_, p_73084_2_, p_73084_3_); ++ if (event.isCanceled()) + { + return false; + } +- else if (this.field_73091_c.func_77145_d() && this.field_73090_b.func_70694_bm() != null && this.field_73090_b.func_70694_bm().func_77973_b() instanceof ItemSword) +- { +- return false; +- } + else + { ++ ItemStack stack = field_73090_b.func_71045_bC(); ++ if (stack != null && stack.func_77973_b().onBlockStartBreak(stack, p_73084_1_, p_73084_2_, p_73084_3_, field_73090_b)) ++ { ++ return false; ++ } + Block block = this.field_73092_a.func_147439_a(p_73084_1_, p_73084_2_, p_73084_3_); + int l = this.field_73092_a.func_72805_g(p_73084_1_, p_73084_2_, p_73084_3_); + this.field_73092_a.func_72889_a(this.field_73090_b, 2001, p_73084_1_, p_73084_2_, p_73084_3_, Block.func_149682_b(block) + (this.field_73092_a.func_72805_g(p_73084_1_, p_73084_2_, p_73084_3_) << 12)); +- boolean flag = this.func_73079_d(p_73084_1_, p_73084_2_, p_73084_3_); ++ boolean flag = false; + + if (this.func_73083_d()) + { ++ flag = this.func_73079_d(p_73084_1_, p_73084_2_, p_73084_3_); + this.field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73084_1_, p_73084_2_, p_73084_3_, this.field_73092_a)); + } + else + { + ItemStack itemstack = this.field_73090_b.func_71045_bC(); +- boolean flag1 = this.field_73090_b.func_146099_a(block); ++ boolean flag1 = block.canHarvestBlock(field_73090_b, l); + + if (itemstack != null) + { +@@ -251,12 +293,18 @@ + } + } + ++ flag = this.removeBlock(p_73084_1_, p_73084_2_, p_73084_3_, flag1); + if (flag && flag1) + { + block.func_149636_a(this.field_73092_a, this.field_73090_b, p_73084_1_, p_73084_2_, p_73084_3_, l); + } + } + ++ // Drop experience ++ if (!this.func_73083_d() && flag && event != null) ++ { ++ block.func_149657_c(this.field_73092_a, p_73084_1_, p_73084_2_, p_73084_3_, event.getExpToDrop()); ++ } + return flag; + } + } +@@ -288,6 +336,7 @@ + if (itemstack1.field_77994_a == 0) + { + p_73085_1_.field_71071_by.field_70462_a[p_73085_1_.field_71071_by.field_70461_c] = null; ++ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(field_73090_b, itemstack1)); + } + + if (!p_73085_1_.func_71039_bw()) +@@ -301,31 +350,70 @@ + + public boolean func_73078_a(EntityPlayer p_73078_1_, World p_73078_2_, ItemStack p_73078_3_, int p_73078_4_, int p_73078_5_, int p_73078_6_, int p_73078_7_, float p_73078_8_, float p_73078_9_, float p_73078_10_) + { +- if ((!p_73078_1_.func_70093_af() || p_73078_1_.func_70694_bm() == null) && p_73078_2_.func_147439_a(p_73078_4_, p_73078_5_, p_73078_6_).func_149727_a(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) ++ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(p_73078_1_, Action.RIGHT_CLICK_BLOCK, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_2_); ++ if (event.isCanceled()) + { +- return true; ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, field_73092_a)); ++ return false; + } +- else if (p_73078_3_ == null) ++ ++ if (p_73078_3_ != null && p_73078_3_.func_77973_b().onItemUseFirst(p_73078_3_, p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_)) + { +- return false; ++ if (p_73078_3_.field_77994_a <= 0) ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_73078_3_); ++ return true; + } +- else if (this.func_73083_d()) ++ ++ Block block = p_73078_2_.func_147439_a(p_73078_4_, p_73078_5_, p_73078_6_); ++ boolean isAir = block.isAir(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_); ++ boolean useBlock = !p_73078_1_.func_70093_af() || p_73078_1_.func_70694_bm() == null; ++ if (!useBlock) useBlock = p_73078_1_.func_70694_bm().func_77973_b().doesSneakBypassUse(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_); ++ boolean result = false; ++ ++ if (useBlock) + { +- int i1 = p_73078_3_.func_77960_j(); +- int j1 = p_73078_3_.field_77994_a; +- boolean flag = p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); +- p_73078_3_.func_77964_b(i1); +- p_73078_3_.field_77994_a = j1; +- return flag; ++ if (event.useBlock != Event.Result.DENY) ++ { ++ result = block.func_149727_a(p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_1_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); ++ } ++ else ++ { ++ field_73090_b.field_71135_a.func_147359_a(new S23PacketBlockChange(p_73078_4_, p_73078_5_, p_73078_6_, field_73092_a)); ++ result = event.useItem != Event.Result.ALLOW; ++ } + } +- else ++ ++ if (p_73078_3_ != null && !result && event.useItem != Event.Result.DENY) + { +- return p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); ++ int meta = p_73078_3_.func_77960_j(); ++ int size = p_73078_3_.field_77994_a; ++ result = p_73078_3_.func_77943_a(p_73078_1_, p_73078_2_, p_73078_4_, p_73078_5_, p_73078_6_, p_73078_7_, p_73078_8_, p_73078_9_, p_73078_10_); ++ if (func_73083_d()) ++ { ++ p_73078_3_.func_77964_b(meta); ++ p_73078_3_.field_77994_a = size; ++ } ++ if (p_73078_3_.field_77994_a <= 0) ForgeEventFactory.onPlayerDestroyItem(field_73090_b, p_73078_3_); + } ++ ++ /* Re-enable if this causes bukkit incompatibility, or re-write client side to only send a single packet per right click. ++ if (par3ItemStack != null && ((!result && event.useItem != Event.Result.DENY) || event.useItem == Event.Result.ALLOW)) ++ { ++ this.tryUseItem(thisPlayerMP, par2World, par3ItemStack); ++ }*/ ++ return result; + } + + public void func_73080_a(WorldServer p_73080_1_) + { + this.field_73092_a = p_73080_1_; + } ++ ++ public double getBlockReachDistance() ++ { ++ return blockReachDistance; ++ } ++ public void setBlockReachDistance(double distance) ++ { ++ blockReachDistance = distance; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/PlayerManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/PlayerManager.java.patch new file mode 100644 index 0000000..f1af1d8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/PlayerManager.java.patch @@ -0,0 +1,230 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerManager.java +@@ -120,15 +120,24 @@ + int j = (int)p_72683_1_.field_70161_v >> 4; + p_72683_1_.field_71131_d = p_72683_1_.field_70165_t; + p_72683_1_.field_71132_e = p_72683_1_.field_70161_v; ++ // Load nearby chunks first ++ List chunkList = new ArrayList(); + + for (int k = i - this.field_72698_e; k <= i + this.field_72698_e; ++k) + { + for (int l = j - this.field_72698_e; l <= j + this.field_72698_e; ++l) + { +- this.func_72690_a(k, l, true).func_73255_a(p_72683_1_); ++ chunkList.add(new ChunkCoordIntPair(k, l)); + } + } + ++ java.util.Collections.sort(chunkList, new net.minecraftforge.common.util.ChunkCoordComparator(p_72683_1_)); ++ ++ for (ChunkCoordIntPair pair : chunkList) ++ { ++ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72683_1_); ++ } ++ + this.field_72699_b.add(p_72683_1_); + this.func_72691_b(p_72683_1_); + } +@@ -230,6 +239,7 @@ + int i1 = this.field_72698_e; + int j1 = i - k; + int k1 = j - l; ++ List chunksToLoad = new ArrayList(); + + if (j1 != 0 || k1 != 0) + { +@@ -239,7 +249,7 @@ + { + if (!this.func_72684_a(l1, i2, k, l, i1)) + { +- this.func_72690_a(l1, i2, true).func_73255_a(p_72685_1_); ++ chunksToLoad.add(new ChunkCoordIntPair(l1, i2)); + } + + if (!this.func_72684_a(l1 - j1, i2 - k1, i, j, i1)) +@@ -257,6 +267,18 @@ + this.func_72691_b(p_72685_1_); + p_72685_1_.field_71131_d = p_72685_1_.field_70165_t; + p_72685_1_.field_71132_e = p_72685_1_.field_70161_v; ++ // send nearest chunks first ++ java.util.Collections.sort(chunksToLoad, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); ++ ++ for (ChunkCoordIntPair pair : chunksToLoad) ++ { ++ this.func_72690_a(pair.field_77276_a, pair.field_77275_b, true).func_73255_a(p_72685_1_); ++ } ++ ++ if (i1 > 1 || i1 < -1 || j1 > 1 || j1 < -1) ++ { ++ java.util.Collections.sort(p_72685_1_.field_71129_f, new net.minecraftforge.common.util.ChunkCoordComparator(p_72685_1_)); ++ } + } + } + } +@@ -331,15 +353,24 @@ + private int field_73262_e; + private int field_73260_f; + private long field_111198_g; ++ private final java.util.HashMap players = new java.util.HashMap(); ++ private boolean loaded = false; ++ private Runnable loadedRunnable = new Runnable() ++ { ++ public void run() ++ { ++ PlayerInstance.this.loaded = true; ++ } ++ }; + private static final String __OBFID = "CL_00001435"; + + public PlayerInstance(int p_i1518_2_, int p_i1518_3_) + { + this.field_73264_c = new ChunkCoordIntPair(p_i1518_2_, p_i1518_3_); +- PlayerManager.this.func_72688_a().field_73059_b.func_73158_c(p_i1518_2_, p_i1518_3_); ++ PlayerManager.this.field_72701_a.field_73059_b.loadChunk(p_i1518_2_, p_i1518_3_, this.loadedRunnable); + } + +- public void func_73255_a(EntityPlayerMP p_73255_1_) ++ public void func_73255_a(final EntityPlayerMP p_73255_1_) + { + if (this.field_73263_b.contains(p_73255_1_)) + { +@@ -353,7 +384,26 @@ + } + + this.field_73263_b.add(p_73255_1_); +- p_73255_1_.field_71129_f.add(this.field_73264_c); ++ Runnable playerRunnable; ++ ++ if (this.loaded) ++ { ++ playerRunnable = null; ++ p_73255_1_.field_71129_f.add(this.field_73264_c); ++ } ++ else ++ { ++ playerRunnable = new Runnable() ++ { ++ public void run() ++ { ++ p_73255_1_.field_71129_f.add(PlayerInstance.this.field_73264_c); ++ } ++ }; ++ PlayerManager.this.func_72688_a().field_73059_b.loadChunk(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, playerRunnable); ++ } ++ ++ this.players.put(p_73255_1_, playerRunnable); + } + } + +@@ -361,6 +411,24 @@ + { + if (this.field_73263_b.contains(p_73252_1_)) + { ++ // If we haven't loaded yet don't load the chunk just so we can clean it up ++ if (!this.loaded) ++ { ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.players.get(p_73252_1_)); ++ this.field_73263_b.remove(p_73252_1_); ++ this.players.remove(p_73252_1_); ++ ++ if (this.field_73263_b.isEmpty()) ++ { ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.dropQueuedChunkLoad(PlayerManager.this.func_72688_a(), this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b, this.loadedRunnable); ++ long i = (long) this.field_73264_c.field_77276_a + 2147483647L | (long) this.field_73264_c.field_77275_b + 2147483647L << 32; ++ PlayerManager.this.field_72700_c.func_76159_d(i); ++ PlayerManager.this.field_111193_e.remove(this); ++ } ++ ++ return; ++ } ++ + Chunk chunk = PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b); + + if (chunk.func_150802_k()) +@@ -368,9 +436,12 @@ + p_73252_1_.field_71135_a.func_147359_a(new S21PacketChunkData(chunk, true, 0)); + } + ++ this.players.remove(p_73252_1_); + this.field_73263_b.remove(p_73252_1_); + p_73252_1_.field_71129_f.remove(this.field_73264_c); + ++ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.ChunkWatchEvent.UnWatch(field_73264_c, p_73252_1_)); ++ + if (this.field_73263_b.isEmpty()) + { + long i = (long)this.field_73264_c.field_77276_a + 2147483647L | (long)this.field_73264_c.field_77275_b + 2147483647L << 32; +@@ -408,7 +479,7 @@ + + this.field_73260_f |= 1 << (p_151253_2_ >> 4); + +- if (this.field_73262_e < 64) ++ //if (this.numberOfTilesToUpdate < 64) //Forge; Cache everything, so always run + { + short short1 = (short)(p_151253_1_ << 12 | p_151253_3_ << 8 | p_151253_2_); + +@@ -420,6 +491,10 @@ + } + } + ++ if (field_73262_e == field_151254_d.length) ++ { ++ field_151254_d = java.util.Arrays.copyOf(field_151254_d, field_151254_d.length << 1); ++ } + this.field_151254_d[this.field_73262_e++] = short1; + } + } +@@ -437,6 +512,7 @@ + } + } + ++ @SuppressWarnings("unused") + public void func_73254_a() + { + if (this.field_73262_e != 0) +@@ -452,7 +528,7 @@ + k = this.field_73264_c.field_77275_b * 16 + (this.field_151254_d[0] >> 8 & 15); + this.func_151251_a(new S23PacketBlockChange(i, j, k, PlayerManager.this.field_72701_a)); + +- if (PlayerManager.this.field_72701_a.func_147439_a(i, j, k).func_149716_u()) ++ if (PlayerManager.this.field_72701_a.func_147439_a(i, j, k).hasTileEntity(PlayerManager.this.field_72701_a.func_72805_g(i, j, k))) + { + this.func_151252_a(PlayerManager.this.field_72701_a.func_147438_o(i, j, k)); + } +@@ -461,13 +537,14 @@ + { + int l; + +- if (this.field_73262_e == 64) ++ if (this.field_73262_e >= net.minecraftforge.common.ForgeModContainer.clumpingThreshold) + { + i = this.field_73264_c.field_77276_a * 16; + j = this.field_73264_c.field_77275_b * 16; + this.func_151251_a(new S21PacketChunkData(PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b), false, this.field_73260_f)); + +- for (k = 0; k < 16; ++k) ++ // Forge: Grabs ALL tile entities is costly on a modded server, only send needed ones ++ for (k = 0; false && k < 16; ++k) + { + if ((this.field_73260_f & 1 << k) != 0) + { +@@ -484,14 +561,17 @@ + else + { + this.func_151251_a(new S22PacketMultiBlockChange(this.field_73262_e, this.field_151254_d, PlayerManager.this.field_72701_a.func_72964_e(this.field_73264_c.field_77276_a, this.field_73264_c.field_77275_b))); ++ } + ++ { //Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small ++ WorldServer world = PlayerManager.this.field_72701_a; + for (i = 0; i < this.field_73262_e; ++i) + { + j = this.field_73264_c.field_77276_a * 16 + (this.field_151254_d[i] >> 12 & 15); + k = this.field_151254_d[i] & 255; + l = this.field_73264_c.field_77275_b * 16 + (this.field_151254_d[i] >> 8 & 15); + +- if (PlayerManager.this.field_72701_a.func_147439_a(j, k, l).func_149716_u()) ++ if (world.func_147439_a(j, k, l).hasTileEntity(world.func_72805_g(j, k, l))) + { + this.func_151252_a(PlayerManager.this.field_72701_a.func_147438_o(j, k, l)); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ServerConfigurationManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ServerConfigurationManager.java.patch new file mode 100644 index 0000000..a959f9d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -0,0 +1,186 @@ +--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java +@@ -55,12 +55,15 @@ + import net.minecraft.util.EnumChatFormatting; + import net.minecraft.util.IChatComponent; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.Teleporter; + import net.minecraft.world.World; ++import net.minecraft.world.WorldProvider; + import net.minecraft.world.WorldServer; + import net.minecraft.world.WorldSettings; + import net.minecraft.world.demo.DemoWorldManager; + import net.minecraft.world.storage.IPlayerFileData; + import net.minecraft.world.storage.SaveHandler; ++import net.minecraftforge.common.chunkio.ChunkIOExecutor; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -109,7 +112,17 @@ + String s = gameprofile1 == null ? gameprofile.getName() : gameprofile1.getName(); + playerprofilecache.func_152649_a(gameprofile); + NBTTagCompound nbttagcompound = this.func_72380_a(p_72355_2_); +- p_72355_2_.func_70029_a(this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK)); ++ ++ World playerWorld = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); ++ if (playerWorld==null) ++ { ++ p_72355_2_.field_71093_bK=0; ++ playerWorld=this.field_72400_f.func_71218_a(0); ++ ChunkCoordinates spawnPoint = playerWorld.field_73011_w.getRandomizedSpawnPoint(); ++ p_72355_2_.func_70107_b(spawnPoint.field_71574_a, spawnPoint.field_71572_b, spawnPoint.field_71573_c); ++ } ++ ++ p_72355_2_.func_70029_a(playerWorld); + p_72355_2_.field_71134_c.func_73080_a((WorldServer)p_72355_2_.field_70170_p); + String s1 = "local"; + +@@ -243,6 +256,7 @@ + p_72380_1_.func_70020_e(nbttagcompound); + nbttagcompound1 = nbttagcompound; + field_148546_d.debug("loading single player"); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_72380_1_, this.field_72412_k, p_72380_1_.func_110124_au().toString()); + } + else + { +@@ -283,6 +297,7 @@ + this.func_148540_a(new S38PacketPlayerListItem(p_72377_1_.func_70005_c_(), true, 1000)); + this.field_72404_b.add(p_72377_1_); + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72377_1_.field_71093_bK); ++ ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + worldserver.func_72838_d(p_72377_1_); + this.func_72375_a(p_72377_1_, (WorldServer)null); + +@@ -315,6 +330,7 @@ + worldserver.func_73040_p().func_72695_c(p_72367_1_); + this.field_72404_b.remove(p_72367_1_); + this.field_148547_k.remove(p_72367_1_.func_110124_au()); ++ net.minecraftforge.common.chunkio.ChunkIOExecutor.adjustPoolSize(this.func_72394_k()); + this.func_148540_a(new S38PacketPlayerListItem(p_72367_1_.func_70005_c_(), false, 9999)); + } + +@@ -396,13 +412,23 @@ + + public EntityPlayerMP func_72368_a(EntityPlayerMP p_72368_1_, int p_72368_2_, boolean p_72368_3_) + { ++ World world = field_72400_f.func_71218_a(p_72368_2_); ++ if (world == null) ++ { ++ p_72368_2_ = 0; ++ } ++ else if (!world.field_73011_w.func_76567_e()) ++ { ++ p_72368_2_ = world.field_73011_w.getRespawnDimension(p_72368_1_); ++ } ++ + p_72368_1_.func_71121_q().func_73039_n().func_72787_a(p_72368_1_); + p_72368_1_.func_71121_q().func_73039_n().func_72790_b(p_72368_1_); + p_72368_1_.func_71121_q().func_73040_p().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_); +- ChunkCoordinates chunkcoordinates = p_72368_1_.func_70997_bJ(); +- boolean flag1 = p_72368_1_.func_82245_bX(); ++ ChunkCoordinates chunkcoordinates = p_72368_1_.getBedLocation(p_72368_2_); ++ boolean flag1 = p_72368_1_.isSpawnForced(p_72368_2_); + p_72368_1_.field_71093_bK = p_72368_2_; + Object object; + +@@ -418,6 +444,7 @@ + EntityPlayerMP entityplayermp1 = 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(), (ItemInWorldManager)object); + entityplayermp1.field_71135_a = p_72368_1_.field_71135_a; + entityplayermp1.func_71049_a(p_72368_1_, p_72368_3_); ++ entityplayermp1.field_71093_bK = p_72368_2_; + entityplayermp1.func_145769_d(p_72368_1_.func_145782_y()); + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK); + this.func_72381_a(entityplayermp1, p_72368_1_, worldserver); +@@ -462,14 +489,19 @@ + + public void func_72356_a(EntityPlayerMP p_72356_1_, int p_72356_2_) + { ++ transferPlayerToDimension(p_72356_1_, p_72356_2_, field_72400_f.func_71218_a(p_72356_2_).func_85176_s()); ++ } ++ ++ public void transferPlayerToDimension(EntityPlayerMP p_72356_1_, int p_72356_2_, Teleporter teleporter) ++ { + int j = p_72356_1_.field_71093_bK; + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); + p_72356_1_.field_71093_bK = p_72356_2_; + WorldServer worldserver1 = this.field_72400_f.func_71218_a(p_72356_1_.field_71093_bK); +- p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, p_72356_1_.field_70170_p.field_73013_u, p_72356_1_.field_70170_p.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); ++ p_72356_1_.field_71135_a.func_147359_a(new S07PacketRespawn(p_72356_1_.field_71093_bK, worldserver1.field_73013_u, worldserver1.func_72912_H().func_76067_t(), p_72356_1_.field_71134_c.func_73081_b())); // Forge: Use new dimensions information + worldserver.func_72973_f(p_72356_1_); + p_72356_1_.field_70128_L = false; +- this.func_82448_a(p_72356_1_, j, worldserver, worldserver1); ++ this.transferEntityToWorld(p_72356_1_, j, worldserver, worldserver1, teleporter); + this.func_72375_a(p_72356_1_, worldserver); + p_72356_1_.field_71135_a.func_147364_a(p_72356_1_.field_70165_t, p_72356_1_.field_70163_u, p_72356_1_.field_70161_v, p_72356_1_.field_70177_z, p_72356_1_.field_70125_A); + p_72356_1_.field_71134_c.func_73080_a(worldserver1); +@@ -487,38 +519,47 @@ + + public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) + { +- double d0 = p_82448_1_.field_70165_t; +- double d1 = p_82448_1_.field_70161_v; +- double d2 = 8.0D; ++ transferEntityToWorld(p_82448_1_, p_82448_2_, p_82448_3_, p_82448_4_, p_82448_4_.func_85176_s()); ++ } ++ ++ public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter) ++ { ++ WorldProvider pOld = p_82448_3_.field_73011_w; ++ WorldProvider pNew = p_82448_4_.field_73011_w; ++ double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor(); ++ double d0 = p_82448_1_.field_70165_t * moveFactor; ++ double d1 = p_82448_1_.field_70161_v * moveFactor; + double d3 = p_82448_1_.field_70165_t; + double d4 = p_82448_1_.field_70163_u; + double d5 = p_82448_1_.field_70161_v; + float f = p_82448_1_.field_70177_z; + p_82448_3_.field_72984_F.func_76320_a("moving"); + +- if (p_82448_1_.field_71093_bK == -1) ++ /* ++ if (par1Entity.dimension == -1) + { + d0 /= d2; + d1 /= d2; +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); ++ par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.isEntityAlive()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + } + } +- else if (p_82448_1_.field_71093_bK == 0) ++ else if (par1Entity.dimension == 0) + { + d0 *= d2; + d1 *= d2; +- p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); ++ par1Entity.setLocationAndAngles(d0, par1Entity.posY, d1, par1Entity.rotationYaw, par1Entity.rotationPitch); + +- if (p_82448_1_.func_70089_S()) ++ if (par1Entity.isEntityAlive()) + { +- p_82448_3_.func_72866_a(p_82448_1_, false); ++ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); + } + } +- else ++ */ ++ if (p_82448_1_.field_71093_bK == 1) + { + ChunkCoordinates chunkcoordinates; + +@@ -553,7 +594,7 @@ + if (p_82448_1_.func_70089_S()) + { + p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A); +- p_82448_4_.func_85176_s().func_77185_a(p_82448_1_, d3, d4, d5, f); ++ teleporter.func_77185_a(p_82448_1_, d3, d4, d5, f); + p_82448_4_.func_72838_d(p_82448_1_); + p_82448_4_.func_72866_a(p_82448_1_, false); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/stats/StatList.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/stats/StatList.java.patch new file mode 100644 index 0000000..2063268 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/stats/StatList.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/stats/StatList.java ++++ ../src-work/minecraft/net/minecraft/stats/StatList.java +@@ -94,7 +94,7 @@ + + if (item != null) + { +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these + field_75928_D[i] = (new StatCrafting("stat.craftItem." + i, new ChatComponentTranslation("stat.craftItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).func_75971_g(); + } + } +@@ -112,7 +112,7 @@ + + if (Item.func_150898_a(block) != null) + { +- int i = Block.func_149682_b(block); ++ int i = Block.func_149682_b(block); //TODO: Hook FML's stat change event and re-assign these + + if (block.func_149652_G()) + { +@@ -135,7 +135,7 @@ + + if (item != null) + { +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these + field_75929_E[i] = (new StatCrafting("stat.useItem." + i, new ChatComponentTranslation("stat.useItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).func_75971_g(); + + if (!(item instanceof ItemBlock)) +@@ -158,7 +158,7 @@ + + if (item != null) + { +- int i = Item.func_150891_b(item); ++ int i = Item.func_150891_b(item); //TODO: Hook FML's stat change event and re-assign these + + if (item.func_77645_m()) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntity.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntity.java.patch new file mode 100644 index 0000000..036b33e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntity.java.patch @@ -0,0 +1,107 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java +@@ -12,7 +12,10 @@ + import net.minecraft.crash.CrashReportCategory; + import net.minecraft.init.Blocks; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.network.NetworkManager; + import net.minecraft.network.Packet; ++import net.minecraft.network.play.server.S35PacketUpdateTileEntity; ++import net.minecraft.util.AxisAlignedBB; + import net.minecraft.world.World; + + import org.apache.logging.log4j.Level; +@@ -278,4 +281,93 @@ + func_145826_a(TileEntityComparator.class, "Comparator"); + func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); + } ++ ++ // -- BEGIN FORGE PATCHES -- ++ /** ++ * Determines if this TileEntity requires update calls. ++ * @return True if you want updateEntity() to be called, false if not ++ */ ++ public boolean canUpdate() ++ { ++ return true; ++ } ++ ++ /** ++ * Called when you receive a TileEntityData packet for the location this ++ * TileEntity is currently in. On the client, the NetworkManager will always ++ * be the remote server. On the server, it will be whomever is responsible for ++ * sending the packet. ++ * ++ * @param net The NetworkManager the packet originated from ++ * @param pkt The data packet ++ */ ++ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) ++ { ++ } ++ ++ /** ++ * Called when the chunk this TileEntity is on is Unloaded. ++ */ ++ public void onChunkUnload() ++ { ++ } ++ ++ private boolean isVanilla = getClass().getName().startsWith("net.minecraft.tileentity"); ++ /** ++ * Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes. ++ * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly. ++ * ++ * @param oldID The old ID of the block ++ * @param newID The new ID of the block (May be the same) ++ * @param oldMeta The old metadata of the block ++ * @param newMeta The new metadata of the block (May be the same) ++ * @param world Current world ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Position ++ * @return True to remove the old tile entity, false to keep it in tact {and create a new one if the new values specify to} ++ */ ++ public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) ++ { ++ return !isVanilla || (oldBlock != newBlock); ++ } ++ ++ public boolean shouldRenderInPass(int pass) ++ { ++ return pass == 0; ++ } ++ /** ++ * Sometimes default render bounding box: infinite in scope. Used to control rendering on {@link TileEntitySpecialRenderer}. ++ */ ++ public static final AxisAlignedBB INFINITE_EXTENT_AABB = AxisAlignedBB.func_72330_a(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY); ++ /** ++ * Return an {@link AxisAlignedBB} that controls the visible scope of a {@link TileEntitySpecialRenderer} associated with this {@link TileEntity} ++ * Defaults to the collision bounding box {@link Block#getCollisionBoundingBoxFromPool(World, int, int, int)} associated with the block ++ * at this location. ++ * ++ * @return an appropriately size {@link AxisAlignedBB} for the {@link TileEntity} ++ */ ++ @SideOnly(Side.CLIENT) ++ public AxisAlignedBB getRenderBoundingBox() ++ { ++ AxisAlignedBB bb = INFINITE_EXTENT_AABB; ++ Block type = func_145838_q(); ++ if (type == Blocks.field_150381_bn) ++ { ++ bb = AxisAlignedBB.func_72330_a(field_145851_c, field_145848_d, field_145849_e, field_145851_c + 1, field_145848_d + 1, field_145849_e + 1); ++ } ++ else if (type == Blocks.field_150486_ae || type == Blocks.field_150447_bR) ++ { ++ bb = AxisAlignedBB.func_72330_a(field_145851_c - 1, field_145848_d, field_145849_e - 1, field_145851_c + 2, field_145848_d + 2, field_145849_e + 2); ++ } ++ else if (type != null && type != Blocks.field_150461_bJ) ++ { ++ AxisAlignedBB cbb = type.func_149668_a(field_145850_b, field_145851_c, field_145848_d, field_145849_e); ++ if (cbb != null) ++ { ++ bb = cbb; ++ } ++ } ++ return bb; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBeacon.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBeacon.java.patch new file mode 100644 index 0000000..6b8861b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBeacon.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +@@ -110,7 +110,7 @@ + { + Block block = this.field_145850_b.func_147439_a(l, k, i1); + +- if (block != Blocks.field_150475_bE && block != Blocks.field_150340_R && block != Blocks.field_150484_ah && block != Blocks.field_150339_S) ++ if (!block.isBeaconBase(this.field_145850_b, l, k, i1, field_145851_c, field_145848_d, field_145849_e)) + { + flag = false; + break; +@@ -357,6 +357,6 @@ + + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) + { +- return p_94041_2_.func_77973_b() == Items.field_151166_bC || p_94041_2_.func_77973_b() == Items.field_151045_i || p_94041_2_.func_77973_b() == Items.field_151043_k || p_94041_2_.func_77973_b() == Items.field_151042_j; ++ return p_94041_2_.func_77973_b() != null && p_94041_2_.func_77973_b().isBeaconPayment(p_94041_2_); + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBrewingStand.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBrewingStand.java.patch new file mode 100644 index 0000000..979435f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBrewingStand.java.patch @@ -0,0 +1,56 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java +@@ -104,7 +104,7 @@ + + for (int i = 0; i < 3; ++i) + { +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) + { + int j = this.field_145945_j[i].func_77960_j(); + int k = this.func_145936_c(j, itemstack); +@@ -137,13 +137,14 @@ + + private void func_145940_l() + { ++ if (net.minecraftforge.event.ForgeEventFactory.onPotionAttemptBreaw(field_145945_j)) return; + if (this.func_145934_k()) + { + ItemStack itemstack = this.field_145945_j[3]; + + for (int i = 0; i < 3; ++i) + { +- if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() == Items.field_151068_bn) ++ if (this.field_145945_j[i] != null && this.field_145945_j[i].func_77973_b() instanceof ItemPotion) + { + int j = this.field_145945_j[i].func_77960_j(); + int k = this.func_145936_c(j, itemstack); +@@ -164,9 +165,9 @@ + } + } + +- if (itemstack.func_77973_b().func_77634_r()) ++ if (itemstack.func_77973_b().hasContainerItem(itemstack)) + { +- this.field_145945_j[3] = new ItemStack(itemstack.func_77973_b().func_77668_q()); ++ this.field_145945_j[3] = itemstack.func_77973_b().getContainerItem(itemstack); + } + else + { +@@ -177,6 +178,7 @@ + this.field_145945_j[3] = null; + } + } ++ net.minecraftforge.event.ForgeEventFactory.onPotionBrewed(field_145945_j); + } + } + +@@ -292,7 +294,7 @@ + + public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) + { +- return p_94041_1_ == 3 ? p_94041_2_.func_77973_b().func_150892_m(p_94041_2_) : p_94041_2_.func_77973_b() == Items.field_151068_bn || p_94041_2_.func_77973_b() == Items.field_151069_bo; ++ return p_94041_1_ == 3 ? p_94041_2_.func_77973_b().func_150892_m(p_94041_2_) : p_94041_2_.func_77973_b() instanceof ItemPotion || p_94041_2_.func_77973_b() == Items.field_151069_bo; + } + + @SideOnly(Side.CLIENT) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityFurnace.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityFurnace.java.patch new file mode 100644 index 0000000..022d08f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +@@ -219,8 +219,7 @@ + + if (this.field_145957_n[1].field_77994_a == 0) + { +- Item item = this.field_145957_n[1].func_77973_b().func_77668_q(); +- this.field_145957_n[1] = item != null ? new ItemStack(item) : null; ++ this.field_145957_n[1] = field_145957_n[1].func_77973_b().getContainerItem(field_145957_n[1]); + } + } + } +@@ -265,7 +264,11 @@ + else + { + ItemStack itemstack = FurnaceRecipes.func_77602_a().func_151395_a(this.field_145957_n[0]); +- return itemstack == null ? false : (this.field_145957_n[2] == null ? true : (!this.field_145957_n[2].func_77969_a(itemstack) ? false : (this.field_145957_n[2].field_77994_a < this.func_70297_j_() && this.field_145957_n[2].field_77994_a < this.field_145957_n[2].func_77976_d() ? true : this.field_145957_n[2].field_77994_a < itemstack.func_77976_d()))); ++ if (itemstack == null) return false; ++ if (this.field_145957_n[2] == null) return true; ++ if (!this.field_145957_n[2].func_77969_a(itemstack)) return false; ++ int result = field_145957_n[2].field_77994_a + itemstack.field_77994_a; ++ return result <= func_70297_j_() && result <= this.field_145957_n[2].func_77976_d(); //Forge BugFix: Make it respect stack sizes properly. + } + } + +@@ -281,7 +284,7 @@ + } + else if (this.field_145957_n[2].func_77973_b() == itemstack.func_77973_b()) + { +- ++this.field_145957_n[2].field_77994_a; ++ this.field_145957_n[2].field_77994_a += itemstack.field_77994_a; // Forge BugFix: Results may have multiple items + } + + --this.field_145957_n[0].field_77994_a; +@@ -301,6 +304,9 @@ + } + else + { ++ int moddedBurnTime = net.minecraftforge.event.ForgeEventFactory.getFuelBurnTime(p_145952_0_); ++ if (moddedBurnTime >= 0) return moddedBurnTime; ++ + Item item = p_145952_0_.func_77973_b(); + + if (item instanceof ItemBlock && Block.func_149634_a(item) != Blocks.field_150350_a) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityHopper.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityHopper.java.patch new file mode 100644 index 0000000..52c0c78 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityHopper.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java +@@ -518,17 +518,30 @@ + + if (itemstack1 == null) + { +- p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_); +- p_145899_1_ = null; ++ //Forge: BUGFIX: Again, make things respect max stack sizes. ++ int max = Math.min(p_145899_1_.func_77976_d(), p_145899_0_.func_70297_j_()); ++ if (max >= p_145899_1_.field_77994_a) ++ { ++ p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_); ++ p_145899_1_ = null; ++ } ++ else ++ { ++ p_145899_0_.func_70299_a(p_145899_2_, p_145899_1_.func_77979_a(max)); ++ } + flag = true; + } + else if (func_145894_a(itemstack1, p_145899_1_)) + { +- int k = p_145899_1_.func_77976_d() - itemstack1.field_77994_a; +- int l = Math.min(p_145899_1_.field_77994_a, k); +- p_145899_1_.field_77994_a -= l; +- itemstack1.field_77994_a += l; +- flag = l > 0; ++ //Forge: BUGFIX: Again, make things respect max stack sizes. ++ int max = Math.min(p_145899_1_.func_77976_d(), p_145899_0_.func_70297_j_()); ++ if (max > itemstack1.field_77994_a) ++ { ++ int l = Math.min(p_145899_1_.field_77994_a, max - itemstack1.field_77994_a); ++ p_145899_1_.field_77994_a -= l; ++ itemstack1.field_77994_a += l; ++ flag = l > 0; ++ } + } + + if (flag) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityNote.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityNote.java.patch new file mode 100644 index 0000000..908a0d8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityNote.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java +@@ -35,7 +35,9 @@ + + public void func_145877_a() + { ++ byte old = field_145879_a; + this.field_145879_a = (byte)((this.field_145879_a + 1) % 25); ++ if (!net.minecraftforge.common.ForgeHooks.onNoteChange(this, old)) return; + this.func_70296_d(); + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/MovingObjectPosition.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/MovingObjectPosition.java.patch new file mode 100644 index 0000000..183ba01 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/MovingObjectPosition.java.patch @@ -0,0 +1,15 @@ +--- ../src-base/minecraft/net/minecraft/util/MovingObjectPosition.java ++++ ../src-work/minecraft/net/minecraft/util/MovingObjectPosition.java +@@ -13,6 +13,12 @@ + public Entity field_72308_g; + private static final String __OBFID = "CL_00000610"; + ++ /** Used to determine what sub-segment is hit */ ++ public int subHit = -1; ++ ++ /** Used to add extra hit info */ ++ public Object hitInfo = null; ++ + public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) + { + this(p_i2303_1_, p_i2303_2_, p_i2303_3_, p_i2303_4_, p_i2303_5_, true); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Session.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Session.java.patch new file mode 100644 index 0000000..6f6c0e0 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Session.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/util/Session.java ++++ ../src-work/minecraft/net/minecraft/util/Session.java +@@ -19,6 +19,19 @@ + + public Session(String p_i1098_1_, String p_i1098_2_, String p_i1098_3_, String p_i1098_4_) + { ++ if (p_i1098_1_ == null || p_i1098_1_.isEmpty()) ++ { ++ p_i1098_1_ = "MissingName"; ++ p_i1098_2_ = p_i1098_3_ = "NotValid"; ++ System.out.println("========================================================="); ++ System.out.println("Warning the username was not set for this session, typically"); ++ System.out.println("this means you installed Forge incorrectly. We have set your"); ++ System.out.println("name to \"MissingName\" and your session to nothing. Please"); ++ System.out.println("check your instllation and post a console log from the launcher"); ++ System.out.println("when asking for help!"); ++ System.out.println("========================================================="); ++ ++ } + this.field_74286_b = p_i1098_1_; + this.field_148257_b = p_i1098_2_; + this.field_148258_c = p_i1098_3_; +@@ -54,7 +67,7 @@ + } + catch (IllegalArgumentException illegalargumentexception) + { +- return new GameProfile((UUID)null, this.func_111285_a()); ++ return new GameProfile(net.minecraft.entity.player.EntityPlayer.func_146094_a(new GameProfile((UUID)null, this.func_111285_a())), this.func_111285_a()); + } + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Vec3.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Vec3.java.patch new file mode 100644 index 0000000..e29f252 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Vec3.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/util/Vec3.java ++++ ../src-work/minecraft/net/minecraft/util/Vec3.java +@@ -1,8 +1,5 @@ + package net.minecraft.util; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; +- + public class Vec3 + { + public double field_72450_a; +@@ -45,7 +42,6 @@ + return this; + } + +- @SideOnly(Side.CLIENT) + public Vec3 func_72444_a(Vec3 p_72444_1_) + { + return func_72443_a(p_72444_1_.field_72450_a - this.field_72450_a, p_72444_1_.field_72448_b - this.field_72448_b, p_72444_1_.field_72449_c - this.field_72449_c); +@@ -62,7 +58,6 @@ + return this.field_72450_a * p_72430_1_.field_72450_a + this.field_72448_b * p_72430_1_.field_72448_b + this.field_72449_c * p_72430_1_.field_72449_c; + } + +- @SideOnly(Side.CLIENT) + public Vec3 func_72431_c(Vec3 p_72431_1_) + { + return func_72443_a(this.field_72448_b * p_72431_1_.field_72449_c - this.field_72449_c * p_72431_1_.field_72448_b, this.field_72449_c * p_72431_1_.field_72450_a - this.field_72450_a * p_72431_1_.field_72449_c, this.field_72450_a * p_72431_1_.field_72448_b - this.field_72448_b * p_72431_1_.field_72450_a); +@@ -178,7 +173,6 @@ + this.func_72439_b(d0, d1, d2); + } + +- @SideOnly(Side.CLIENT) + public void func_72446_c(float p_72446_1_) + { + float f1 = MathHelper.func_76134_b(p_72446_1_); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandom.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandom.java.patch new file mode 100644 index 0000000..afdf8c8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandom.java.patch @@ -0,0 +1,44 @@ +--- ../src-base/minecraft/net/minecraft/util/WeightedRandom.java ++++ ../src-work/minecraft/net/minecraft/util/WeightedRandom.java +@@ -27,10 +27,16 @@ + { + throw new IllegalArgumentException(); + } +- else ++ return getItem(p_76273_1_, p_76273_0_.nextInt(p_76273_2_)); ++ } ++ ++ //Forge: Added to allow custom random implementations, Modder is responsible for making sure the ++ //'weight' is under the totalWeight of the items. ++ public static WeightedRandom.Item getItem(Collection par1Collection, int weight) ++ { + { +- int j = p_76273_0_.nextInt(p_76273_2_); +- Iterator iterator = p_76273_1_.iterator(); ++ int j = weight; ++ Iterator iterator = par1Collection.iterator(); + WeightedRandom.Item item; + + do +@@ -75,11 +81,17 @@ + { + throw new IllegalArgumentException(); + } +- else ++ return getItem(p_76269_1_, p_76269_0_.nextInt(p_76269_2_)); ++ } ++ ++ //Forge: Added to allow custom random implementations, Modder is responsible for making sure the ++ //'weight' is under the totalWeight of the items. ++ public static WeightedRandom.Item getItem(WeightedRandom.Item[] par1ArrayOfWeightedRandomItem, int weight) ++ { + { +- int j = p_76269_0_.nextInt(p_76269_2_); +- WeightedRandom.Item[] aitem = p_76269_1_; +- int k = p_76269_1_.length; ++ int j = weight; ++ WeightedRandom.Item[] aitem = par1ArrayOfWeightedRandomItem; ++ int k = par1ArrayOfWeightedRandomItem.length; + + for (int l = 0; l < k; ++l) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandomChestContent.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandomChestContent.java.patch new file mode 100644 index 0000000..fc1bd1b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandomChestContent.java.patch @@ -0,0 +1,81 @@ +--- ../src-base/minecraft/net/minecraft/util/WeightedRandomChestContent.java ++++ ../src-work/minecraft/net/minecraft/util/WeightedRandomChestContent.java +@@ -5,6 +5,7 @@ + import net.minecraft.item.Item; + import net.minecraft.item.ItemStack; + import net.minecraft.tileentity.TileEntityDispenser; ++import net.minecraftforge.common.ChestGenHooks; + + public class WeightedRandomChestContent extends WeightedRandom.Item + { +@@ -34,23 +35,12 @@ + for (int j = 0; j < p_76293_3_; ++j) + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76274_a(p_76293_0_, p_76293_1_); +- int k = weightedrandomchestcontent.field_76295_d + p_76293_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_76293_0_, p_76293_2_); + +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= k) ++ for (ItemStack item : stacks) + { +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = k; +- p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), itemstack); ++ p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), item); + } +- else +- { +- for (int l = 0; l < k; ++l) +- { +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = 1; +- p_76293_2_.func_70299_a(p_76293_0_.nextInt(p_76293_2_.func_70302_i_()), itemstack1); +- } +- } + } + } + +@@ -60,22 +50,11 @@ + { + WeightedRandomChestContent weightedrandomchestcontent = (WeightedRandomChestContent)WeightedRandom.func_76274_a(p_150706_0_, p_150706_1_); + int k = weightedrandomchestcontent.field_76295_d + p_150706_0_.nextInt(weightedrandomchestcontent.field_76296_e - weightedrandomchestcontent.field_76295_d + 1); +- +- if (weightedrandomchestcontent.field_76297_b.func_77976_d() >= k) ++ ItemStack[] stacks = weightedrandomchestcontent.generateChestContent(p_150706_0_, p_150706_2_); ++ for (ItemStack item : stacks) + { +- ItemStack itemstack = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack.field_77994_a = k; +- p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), itemstack); ++ p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), item); + } +- else +- { +- for (int l = 0; l < k; ++l) +- { +- ItemStack itemstack1 = weightedrandomchestcontent.field_76297_b.func_77946_l(); +- itemstack1.field_77994_a = 1; +- p_150706_2_.func_70299_a(p_150706_0_.nextInt(p_150706_2_.func_70302_i_()), itemstack1); +- } +- } + } + } + +@@ -100,4 +79,17 @@ + + return aweightedrandomchestcontent1; + } ++ ++ // -- Forge hooks ++ /** ++ * Allow a mod to submit a custom implementation that can delegate item stack generation beyond simple stack lookup ++ * ++ * @param random The current random for generation ++ * @param newInventory The inventory being generated (do not populate it, but you can refer to it) ++ * @return An array of {@link ItemStack} to put into the chest ++ */ ++ protected ItemStack[] generateChestContent(Random random, IInventory newInventory) ++ { ++ return ChestGenHooks.generateStacks(random, field_76297_b, field_76295_d, field_76296_e); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/village/VillageCollection.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/village/VillageCollection.java.patch new file mode 100644 index 0000000..8e1f091 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/village/VillageCollection.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/village/VillageCollection.java ++++ ../src-work/minecraft/net/minecraft/village/VillageCollection.java +@@ -147,7 +147,7 @@ + { + Village village = (Village)iterator.next(); + int j = (int)village.func_75577_a().func_71569_e(villagedoorinfo.field_75481_a, villagedoorinfo.field_75479_b, villagedoorinfo.field_75480_c); +- int k = 32 + village.func_75568_b(); ++ float k = 32f + village.func_75568_b(); //BugFix: Avoid int wrapping + + if (j > k * k) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/ChunkCache.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/ChunkCache.java.patch new file mode 100644 index 0000000..f934257 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/ChunkCache.java.patch @@ -0,0 +1,56 @@ +--- ../src-base/minecraft/net/minecraft/world/ChunkCache.java ++++ ../src-work/minecraft/net/minecraft/world/ChunkCache.java +@@ -8,6 +8,7 @@ + import net.minecraft.tileentity.TileEntity; + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.chunk.Chunk; ++import net.minecraftforge.common.util.ForgeDirection; + + public class ChunkCache implements IBlockAccess + { +@@ -91,6 +92,8 @@ + { + int l = (p_147438_1_ >> 4) - this.field_72818_a; + int i1 = (p_147438_3_ >> 4) - this.field_72816_b; ++ if (l < 0 || l >= field_72817_c.length || i1 < 0 || i1 >= field_72817_c[l].length) return null; ++ if (field_72817_c[l][i1] == null) return null; + return this.field_72817_c[l][i1].func_150806_e(p_147438_1_ & 15, p_147438_2_, p_147438_3_ & 15); + } + +@@ -122,6 +125,8 @@ + { + int l = (p_72805_1_ >> 4) - this.field_72818_a; + int i1 = (p_72805_3_ >> 4) - this.field_72816_b; ++ if (l < 0 || l >= field_72817_c.length || i1 < 0 || i1 >= field_72817_c[l].length) return 0; ++ if (field_72817_c[l][i1] == null) return 0; + return this.field_72817_c[l][i1].func_76628_c(p_72805_1_ & 15, p_72805_2_, p_72805_3_ & 15); + } + } +@@ -137,10 +142,9 @@ + return this.field_72815_e.func_72807_a(p_72807_1_, p_72807_2_); + } + +- @SideOnly(Side.CLIENT) + public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) + { +- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; ++ return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); + } + + @SideOnly(Side.CLIENT) +@@ -241,4 +245,15 @@ + { + return 256; + } ++ ++ @Override ++ public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) ++ { ++ if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) ++ { ++ return _default; ++ } ++ ++ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/Explosion.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/Explosion.java.patch new file mode 100644 index 0000000..00ec8bc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/Explosion.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/world/Explosion.java ++++ ../src-work/minecraft/net/minecraft/world/Explosion.java +@@ -86,7 +86,7 @@ + + if (block.func_149688_o() != Material.field_151579_a) + { +- float f3 = this.field_77283_e != null ? this.field_77283_e.func_145772_a(this, this.field_77287_j, j1, k1, l1, block) : block.func_149638_a(this.field_77283_e); ++ float f3 = this.field_77283_e != null ? this.field_77283_e.func_145772_a(this, this.field_77287_j, j1, k1, l1, block) : block.getExplosionResistance(this.field_77283_e, field_77287_j, j1, k1, l1, field_77284_b, field_77285_c, field_77282_d); + f1 -= (f3 + 0.3F) * f2; + } + +@@ -113,6 +113,7 @@ + int l = MathHelper.func_76128_c(this.field_77282_d - (double)this.field_77280_f - 1.0D); + int j2 = MathHelper.func_76128_c(this.field_77282_d + (double)this.field_77280_f + 1.0D); + List list = this.field_77287_j.func_72839_b(this.field_77283_e, AxisAlignedBB.func_72330_a((double)i, (double)k, (double)l, (double)j, (double)i2, (double)j2)); ++ net.minecraftforge.event.ForgeEventFactory.onExplosionDetonate(this.field_77287_j, this, list, this.field_77280_f); + Vec3 vec3 = Vec3.func_72443_a(this.field_77284_b, this.field_77285_c, this.field_77282_d); + + for (int i1 = 0; i1 < list.size(); ++i1) +@@ -211,8 +212,7 @@ + block.func_149690_a(this.field_77287_j, i, j, k, this.field_77287_j.func_72805_g(i, j, k), 1.0F / this.field_77280_f, 0); + } + +- this.field_77287_j.func_147465_d(i, j, k, Blocks.field_150350_a, 0, 3); +- block.func_149723_a(this.field_77287_j, i, j, k, this); ++ block.onBlockExploded(this.field_77287_j, i, j, k, this); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/IBlockAccess.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/IBlockAccess.java.patch new file mode 100644 index 0000000..5dfdfa8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/IBlockAccess.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/world/IBlockAccess.java ++++ ../src-work/minecraft/net/minecraft/world/IBlockAccess.java +@@ -5,6 +5,7 @@ + import net.minecraft.block.Block; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.world.biome.BiomeGenBase; ++import net.minecraftforge.common.util.ForgeDirection; + + public interface IBlockAccess + { +@@ -19,7 +20,6 @@ + + int func_72879_k(int p_72879_1_, int p_72879_2_, int p_72879_3_, int p_72879_4_); + +- @SideOnly(Side.CLIENT) + boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_); + + @SideOnly(Side.CLIENT) +@@ -30,4 +30,16 @@ + + @SideOnly(Side.CLIENT) + boolean func_72806_N(); ++ ++ /** ++ * FORGE: isSideSolid, pulled up from {@link World} ++ * ++ * @param x X coord ++ * @param y Y coord ++ * @param z Z coord ++ * @param side Side ++ * @param _default default return value ++ * @return if the block is solid on the side ++ */ ++ boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/SpawnerAnimals.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/SpawnerAnimals.java.patch new file mode 100644 index 0000000..6735b00 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/SpawnerAnimals.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/world/SpawnerAnimals.java ++++ ../src-work/minecraft/net/minecraft/world/SpawnerAnimals.java +@@ -1,5 +1,7 @@ + package net.minecraft.world; + ++import java.util.ArrayList; ++import java.util.Collections; + import java.util.HashMap; + import java.util.Iterator; + import java.util.List; +@@ -17,6 +19,9 @@ + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.chunk.Chunk; + ++import cpw.mods.fml.common.eventhandler.Event.Result; ++import net.minecraftforge.event.ForgeEventFactory; ++ + public final class SpawnerAnimals + { + private HashMap field_77193_b = new HashMap(); +@@ -78,9 +83,12 @@ + { + EnumCreatureType enumcreaturetype = aenumcreaturetype[k3]; + +- if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_) && p_77192_1_.func_72907_a(enumcreaturetype.func_75598_a()) <= enumcreaturetype.func_75601_b() * this.field_77193_b.size() / 256) ++ if ((!enumcreaturetype.func_75599_d() || p_77192_3_) && (enumcreaturetype.func_75599_d() || p_77192_2_) && (!enumcreaturetype.func_82705_e() || p_77192_4_) && p_77192_1_.countEntities(enumcreaturetype, true) <= enumcreaturetype.func_75601_b() * this.field_77193_b.size() / 256) + { + Iterator iterator = this.field_77193_b.keySet().iterator(); ++ ArrayList tmp = new ArrayList(field_77193_b.keySet()); ++ Collections.shuffle(tmp); ++ iterator = tmp.iterator(); + label110: + + while (iterator.hasNext()) +@@ -158,13 +166,17 @@ + + entityliving.func_70012_b((double)f, (double)f1, (double)f2, p_77192_1_.field_73012_v.nextFloat() * 360.0F, 0.0F); + +- if (entityliving.func_70601_bi()) ++ Result canSpawn = ForgeEventFactory.canEntitySpawn(entityliving, p_77192_1_, f, f1, f2); ++ if (canSpawn == Result.ALLOW || (canSpawn == Result.DEFAULT && entityliving.func_70601_bi())) + { + ++i2; + p_77192_1_.func_72838_d(entityliving); +- ientitylivingdata = entityliving.func_110161_a(ientitylivingdata); ++ if (!ForgeEventFactory.doSpecialSpawn(entityliving, p_77192_1_, f, f1, f2)) ++ { ++ ientitylivingdata = entityliving.func_110161_a(ientitylivingdata); ++ } + +- if (i2 >= entityliving.func_70641_bl()) ++ if (j2 >= ForgeEventFactory.getMaxSpawnPackSize(entityliving)) + { + continue label110; + } +@@ -207,7 +219,8 @@ + else + { + Block block = p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ - 1, p_77190_4_); +- return block != Blocks.field_150357_h && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149721_r() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149688_o().func_76224_d() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ + 1, p_77190_4_).func_149721_r(); ++ boolean spawnBlock = block.canCreatureSpawn(p_77190_0_, p_77190_1_, p_77190_2_, p_77190_3_ - 1, p_77190_4_); ++ return spawnBlock && block != Blocks.field_150357_h && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149721_r() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_, p_77190_4_).func_149688_o().func_76224_d() && !p_77190_1_.func_147439_a(p_77190_2_, p_77190_3_ + 1, p_77190_4_).func_149721_r(); + } + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/World.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/World.java.patch new file mode 100644 index 0000000..99f2238 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/World.java.patch @@ -0,0 +1,1057 @@ +--- ../src-base/minecraft/net/minecraft/world/World.java ++++ ../src-work/minecraft/net/minecraft/world/World.java +@@ -52,8 +52,35 @@ + import net.minecraft.world.storage.MapStorage; + import net.minecraft.world.storage.WorldInfo; + ++import cpw.mods.fml.common.FMLLog; ++ ++import com.google.common.collect.ImmutableSetMultimap; ++ ++import net.minecraftforge.client.ForgeHooksClient; ++import net.minecraftforge.common.ForgeChunkManager; ++import net.minecraftforge.common.ForgeChunkManager.Ticket; ++import net.minecraftforge.common.ForgeModContainer; ++import net.minecraftforge.common.ForgeHooks; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.common.util.ForgeDirection; ++import net.minecraftforge.common.WorldSpecificSaveHandler; ++import net.minecraftforge.event.entity.EntityEvent; ++import net.minecraftforge.event.entity.EntityJoinWorldEvent; ++import net.minecraftforge.event.world.WorldEvent; ++import net.minecraftforge.event.entity.PlaySoundAtEntityEvent; ++import net.minecraft.entity.EnumCreatureType; ++ + public abstract class World implements IBlockAccess + { ++ /** ++ * Used in the getEntitiesWithinAABB functions to expand the search area for entities. ++ * Modders should change this variable to a higher value if it is less then the radius ++ * of one of there entities. ++ */ ++ public static double MAX_ENTITY_RADIUS = 2.0D; ++ ++ public final MapStorage perWorldStorage; ++ + public boolean field_72999_e; + public List field_72996_f = new ArrayList(); + protected List field_72997_g = new ArrayList(); +@@ -94,9 +121,17 @@ + private boolean field_147481_N; + int[] field_72994_J; + private static final String __OBFID = "CL_00000140"; ++ public boolean restoringBlockSnapshots = false; ++ public boolean captureBlockSnapshots = false; ++ public ArrayList capturedBlockSnapshots = new ArrayList(); + + public BiomeGenBase func_72807_a(final int p_72807_1_, final int p_72807_2_) + { ++ return field_73011_w.getBiomeGenForCoords(p_72807_1_, p_72807_2_); ++ } ++ ++ public BiomeGenBase getBiomeGenForCoordsBody(final int p_72807_1_, final int p_72807_2_) ++ { + if (this.func_72899_e(p_72807_1_, 0, p_72807_2_)) + { + Chunk chunk = this.func_72938_d(p_72807_1_, p_72807_2_); +@@ -143,7 +178,13 @@ + this.field_72984_F = p_i45368_5_; + this.field_72986_A = new WorldInfo(p_i45368_4_, p_i45368_2_); + this.field_73011_w = p_i45368_3_; +- this.field_72988_C = new MapStorage(p_i45368_1_); ++ perWorldStorage = new MapStorage((ISaveHandler)null); ++ } ++ ++ // Broken up so that the WorldClient gets the chance to set the mapstorage object before the dimension initializes ++ @SideOnly(Side.CLIENT) ++ protected void finishSetup() ++ { + VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages"); + + if (villagecollection == null) +@@ -157,7 +198,10 @@ + this.field_72982_D.func_82566_a(this); + } + +- p_i45368_3_.func_76558_a(this); ++ // Guarantee the dimension ID was not reset by the provider ++ int providerDim = this.field_73011_w.field_76574_g; ++ this.field_73011_w.func_76558_a(this); ++ this.field_73011_w.field_76574_g = providerDim; + this.field_73020_y = this.func_72970_h(); + this.func_72966_v(); + this.func_72947_a(); +@@ -172,7 +216,7 @@ + this.field_72994_J = new int[32768]; + this.field_73019_z = p_i45369_1_; + this.field_72984_F = p_i45369_5_; +- this.field_72988_C = new MapStorage(p_i45369_1_); ++ this.field_72988_C = getMapStorage(p_i45369_1_); + this.field_72986_A = p_i45369_1_.func_75757_d(); + + if (p_i45369_4_ != null) +@@ -200,6 +244,15 @@ + this.field_73011_w.func_76558_a(this); + this.field_73020_y = this.func_72970_h(); + ++ if (this instanceof WorldServer) ++ { ++ this.perWorldStorage = new MapStorage(new WorldSpecificSaveHandler((WorldServer)this, p_i45369_1_)); ++ } ++ else ++ { ++ this.perWorldStorage = new MapStorage((ISaveHandler)null); ++ } ++ + if (!this.field_72986_A.func_76070_v()) + { + try +@@ -225,12 +278,12 @@ + this.field_72986_A.func_76091_d(true); + } + +- VillageCollection villagecollection = (VillageCollection)this.field_72988_C.func_75742_a(VillageCollection.class, "villages"); ++ VillageCollection villagecollection = (VillageCollection)this.perWorldStorage.func_75742_a(VillageCollection.class, "villages"); + + if (villagecollection == null) + { + this.field_72982_D = new VillageCollection(this); +- this.field_72988_C.func_75745_a("villages", this.field_72982_D); ++ this.perWorldStorage.func_75745_a("villages", this.field_72982_D); + } + else + { +@@ -242,6 +295,20 @@ + this.func_72947_a(); + } + ++ private static MapStorage s_mapStorage; ++ private static ISaveHandler s_savehandler; ++ //Provides a solution for different worlds getting different copies of the same data, potentially rewriting the data or causing race conditions/stale data ++ //Buildcraft has suffered from the issue this fixes. If you load the same data from two different worlds they can get two different copies of the same object, thus the last saved gets final say. ++ private MapStorage getMapStorage(ISaveHandler savehandler) ++ { ++ if (s_savehandler != savehandler || s_mapStorage == null) ++ { ++ s_mapStorage = new MapStorage(savehandler); ++ s_savehandler = savehandler; ++ } ++ return s_mapStorage; ++ } ++ + protected abstract IChunkProvider func_72970_h(); + + protected void func_72963_a(WorldSettings p_72963_1_) +@@ -295,7 +362,8 @@ + + public boolean func_147437_c(int p_147437_1_, int p_147437_2_, int p_147437_3_) + { +- return this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_).func_149688_o() == Material.field_151579_a; ++ Block block = this.func_147439_a(p_147437_1_, p_147437_2_, p_147437_3_); ++ return block.isAir(this, p_147437_1_, p_147437_2_, p_147437_3_); + } + + public boolean func_72899_e(int p_72899_1_, int p_72899_2_, int p_72899_3_) +@@ -367,33 +435,35 @@ + { + Chunk chunk = this.func_72964_e(p_147465_1_ >> 4, p_147465_3_ >> 4); + Block block1 = null; ++ net.minecraftforge.common.util.BlockSnapshot blockSnapshot = null; + + if ((p_147465_6_ & 1) != 0) + { + block1 = chunk.func_150810_a(p_147465_1_ & 15, p_147465_2_, p_147465_3_ & 15); + } + ++ if (this.captureBlockSnapshots && !this.field_72995_K) ++ { ++ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, p_147465_1_, p_147465_2_, p_147465_3_, p_147465_6_); ++ this.capturedBlockSnapshots.add(blockSnapshot); ++ } ++ + boolean flag = chunk.func_150807_a(p_147465_1_ & 15, p_147465_2_, p_147465_3_ & 15, p_147465_4_, p_147465_5_); ++ ++ if (!flag && blockSnapshot != null) ++ { ++ this.capturedBlockSnapshots.remove(blockSnapshot); ++ blockSnapshot = null; ++ } ++ + this.field_72984_F.func_76320_a("checkLight"); + this.func_147451_t(p_147465_1_, p_147465_2_, p_147465_3_); + this.field_72984_F.func_76319_b(); + +- if (flag) ++ if (flag && blockSnapshot == null) // Don't notify clients or update physics while capturing blockstates + { +- if ((p_147465_6_ & 2) != 0 && (!this.field_72995_K || (p_147465_6_ & 4) == 0) && chunk.func_150802_k()) +- { +- this.func_147471_g(p_147465_1_, p_147465_2_, p_147465_3_); +- } +- +- if (!this.field_72995_K && (p_147465_6_ & 1) != 0) +- { +- this.func_147444_c(p_147465_1_, p_147465_2_, p_147465_3_, block1); +- +- if (p_147465_4_.func_149740_M()) +- { +- this.func_147453_f(p_147465_1_, p_147465_2_, p_147465_3_, p_147465_4_); +- } +- } ++ // Modularize client and physic updates ++ this.markAndNotifyBlock(p_147465_1_, p_147465_2_, p_147465_3_, chunk, block1, p_147465_4_, p_147465_6_); + } + + return flag; +@@ -405,6 +475,25 @@ + } + } + ++ // Split off from original setBlock(int p_147465_1_, int p_147465_2_, int p_147465_3_, Block p_147465_4_, int p_147465_5_, int p_147465_6_) method in order to directly send client and physic updates ++ public void markAndNotifyBlock(int x, int y, int z, Chunk chunk, Block oldBlock, Block newBlock, int flag) ++ { ++ if ((flag & 2) != 0 && (chunk == null || chunk.func_150802_k())) ++ { ++ this.func_147471_g(x, y, z); ++ } ++ ++ if (!this.field_72995_K && (flag & 1) != 0) ++ { ++ this.func_147444_c(x, y, z, oldBlock); ++ ++ if (newBlock.func_149740_M()) ++ { ++ this.func_147453_f(x, y, z, newBlock); ++ } ++ } ++ } ++ + public int func_72805_g(int p_72805_1_, int p_72805_2_, int p_72805_3_) + { + if (p_72805_1_ >= -30000000 && p_72805_3_ >= -30000000 && p_72805_1_ < 30000000 && p_72805_3_ < 30000000) +@@ -927,7 +1016,7 @@ + + public boolean func_72935_r() + { +- return this.field_73008_k < 4; ++ return field_73011_w.isDaytime(); + } + + public MovingObjectPosition func_72933_a(Vec3 p_72933_1_, Vec3 p_72933_2_) +@@ -1158,6 +1247,12 @@ + + public void func_72956_a(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_) + { ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_72956_1_, p_72956_2_, p_72956_3_, p_72956_4_); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return; ++ } ++ p_72956_2_ = event.name; + for (int i = 0; i < this.field_73021_x.size(); ++i) + { + ((IWorldAccess)this.field_73021_x.get(i)).func_72704_a(p_72956_2_, p_72956_1_.field_70165_t, p_72956_1_.field_70163_u - (double)p_72956_1_.field_70129_M, p_72956_1_.field_70161_v, p_72956_3_, p_72956_4_); +@@ -1166,6 +1261,12 @@ + + public void func_85173_a(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_) + { ++ PlaySoundAtEntityEvent event = new PlaySoundAtEntityEvent(p_85173_1_, p_85173_2_, p_85173_3_, p_85173_4_); ++ if (MinecraftForge.EVENT_BUS.post(event)) ++ { ++ return; ++ } ++ p_85173_2_ = event.name; + for (int i = 0; i < this.field_73021_x.size(); ++i) + { + ((IWorldAccess)this.field_73021_x.get(i)).func_85102_a(p_85173_1_, p_85173_2_, p_85173_1_.field_70165_t, p_85173_1_.field_70163_u - (double)p_85173_1_.field_70129_M, p_85173_1_.field_70161_v, p_85173_3_, p_85173_4_); +@@ -1206,6 +1307,9 @@ + + public boolean func_72838_d(Entity p_72838_1_) + { ++ // do not drop any items while restoring blocksnapshots. Prevents dupes ++ if (!this.field_72995_K && (p_72838_1_ == null || (p_72838_1_ instanceof net.minecraft.entity.item.EntityItem && this.restoringBlockSnapshots))) return false; ++ + int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D); + int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D); + boolean flag = p_72838_1_.field_98038_p; +@@ -1227,6 +1331,7 @@ + this.field_73010_i.add(entityplayer); + this.func_72854_c(); + } ++ if (MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(p_72838_1_, this)) && !flag) return false; + + this.func_72964_e(i, j).func_76612_a(p_72838_1_); + this.field_72996_f.add(p_72838_1_); +@@ -1398,6 +1503,20 @@ + + public int func_72967_a(float p_72967_1_) + { ++ float f2 = field_73011_w.getSunBrightnessFactor(p_72967_1_); ++ f2 = 1.0F - f2; ++ return (int)(f2 * 11.0F); ++ } ++ ++ /** ++ * The current sun brightness factor for this dimension. ++ * 0.0f means no light at all, and 1.0f means maximum sunlight. ++ * Highly recommended for sunlight detection like solar panel. ++ * ++ * @return The current brightness factor ++ * */ ++ public float getSunBrightnessFactor(float p_72967_1_) ++ { + float f1 = this.func_72826_c(p_72967_1_); + float f2 = 1.0F - (MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F); + +@@ -1414,11 +1533,9 @@ + f2 = 1.0F - f2; + f2 = (float)((double)f2 * (1.0D - (double)(this.func_72867_j(p_72967_1_) * 5.0F) / 16.0D)); + f2 = (float)((double)f2 * (1.0D - (double)(this.func_72819_i(p_72967_1_) * 5.0F) / 16.0D)); +- f2 = 1.0F - f2; +- return (int)(f2 * 11.0F); ++ return f2; + } + +- @SideOnly(Side.CLIENT) + public void func_72848_b(IWorldAccess p_72848_1_) + { + this.field_73021_x.remove(p_72848_1_); +@@ -1427,6 +1544,12 @@ + @SideOnly(Side.CLIENT) + public float func_72971_b(float p_72971_1_) + { ++ return field_73011_w.getSunBrightness(p_72971_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public float getSunBrightnessBody(float p_72971_1_) ++ { + float f1 = this.func_72826_c(p_72971_1_); + float f2 = 1.0F - (MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.2F); + +@@ -1449,6 +1572,12 @@ + @SideOnly(Side.CLIENT) + public Vec3 func_72833_a(Entity p_72833_1_, float p_72833_2_) + { ++ return field_73011_w.getSkyColor(p_72833_1_, p_72833_2_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3 getSkyColorBody(Entity p_72833_1_, float p_72833_2_) ++ { + float f1 = this.func_72826_c(p_72833_2_); + float f2 = MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + +@@ -1465,9 +1594,7 @@ + int i = MathHelper.func_76128_c(p_72833_1_.field_70165_t); + int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u); + int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v); +- BiomeGenBase biomegenbase = this.func_72807_a(i, k); +- float f3 = biomegenbase.func_150564_a(i, j, k); +- int l = biomegenbase.func_76731_a(f3); ++ int l = ForgeHooksClient.getSkyBlendColour(this, i, j, k); + float f4 = (float)(l >> 16 & 255) / 255.0F; + float f5 = (float)(l >> 8 & 255) / 255.0F; + float f6 = (float)(l & 255) / 255.0F; +@@ -1529,6 +1656,11 @@ + + public float func_130001_d() + { ++ return field_73011_w.getCurrentMoonPhaseFactor(); ++ } ++ ++ public float getCurrentMoonPhaseFactorBody() ++ { + return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())]; + } + +@@ -1541,6 +1673,12 @@ + @SideOnly(Side.CLIENT) + public Vec3 func_72824_f(float p_72824_1_) + { ++ return field_73011_w.drawClouds(p_72824_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3 drawCloudsBody(float p_72824_1_) ++ { + float f1 = this.func_72826_c(p_72824_1_); + float f2 = MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; + +@@ -1602,6 +1740,8 @@ + public int func_72825_h(int p_72825_1_, int p_72825_2_) + { + Chunk chunk = this.func_72938_d(p_72825_1_, p_72825_2_); ++ int x = p_72825_1_; ++ int z = p_72825_2_; + int k = chunk.func_76625_h() + 15; + p_72825_1_ &= 15; + +@@ -1609,7 +1749,7 @@ + { + Block block = chunk.func_150810_a(p_72825_1_, k, p_72825_2_); + +- if (block.func_149688_o().func_76230_c() && block.func_149688_o() != Material.field_151584_j) ++ if (block.func_149688_o().func_76230_c() && block.func_149688_o() != Material.field_151584_j && !block.isFoliage(this, x, k, z)) + { + return k + 1; + } +@@ -1621,7 +1761,13 @@ + @SideOnly(Side.CLIENT) + public float func_72880_h(float p_72880_1_) + { +- float f1 = this.func_72826_c(p_72880_1_); ++ return field_73011_w.getStarBrightness(p_72880_1_); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public float getStarBrightnessBody(float par1) ++ { ++ float f1 = this.func_72826_c(par1); + float f2 = 1.0F - (MathHelper.func_76134_b(f1 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); + + if (f2 < 0.0F) +@@ -1675,7 +1821,15 @@ + entity.func_85029_a(crashreportcategory); + } + +- throw new ReportedException(crashreport); ++ if (ForgeModContainer.removeErroringEntities) ++ { ++ FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.func_71502_e()); ++ func_72900_e(entity); ++ } ++ else ++ { ++ throw new ReportedException(crashreport); ++ } + } + + if (entity.field_70128_L) +@@ -1737,7 +1891,16 @@ + crashreport = CrashReport.func_85055_a(throwable1, "Ticking entity"); + crashreportcategory = crashreport.func_85058_a("Entity being ticked"); + entity.func_85029_a(crashreportcategory); +- throw new ReportedException(crashreport); ++ ++ if (ForgeModContainer.removeErroringEntities) ++ { ++ FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.func_71502_e()); ++ func_72900_e(entity); ++ } ++ else ++ { ++ throw new ReportedException(crashreport); ++ } + } + } + +@@ -1780,7 +1943,16 @@ + crashreport = CrashReport.func_85055_a(throwable, "Ticking block entity"); + crashreportcategory = crashreport.func_85058_a("Block entity being ticked"); + tileentity.func_145828_a(crashreportcategory); +- throw new ReportedException(crashreport); ++ if (ForgeModContainer.removeErroringTileEntities) ++ { ++ FMLLog.getLogger().log(org.apache.logging.log4j.Level.ERROR, crashreport.func_71502_e()); ++ tileentity.func_145843_s(); ++ func_147468_f(tileentity.field_145851_c, tileentity.field_145848_d, tileentity.field_145849_e); ++ } ++ else ++ { ++ throw new ReportedException(crashreport); ++ } + } + } + +@@ -1794,7 +1966,7 @@ + + if (chunk != null) + { +- chunk.func_150805_f(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); ++ chunk.removeInvalidTileEntity(tileentity.field_145851_c & 15, tileentity.field_145848_d, tileentity.field_145849_e & 15); + } + } + } +@@ -1802,6 +1974,10 @@ + + if (!this.field_147483_b.isEmpty()) + { ++ for (Object tile : field_147483_b) ++ { ++ ((TileEntity)tile).onChunkUnload(); ++ } + this.field_147482_g.removeAll(this.field_147483_b); + this.field_147483_b.clear(); + } +@@ -1822,18 +1998,18 @@ + { + this.field_147482_g.add(tileentity1); + } +- ++ } ++ else ++ { + if (this.func_72916_c(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4)) + { + Chunk chunk1 = this.func_72964_e(tileentity1.field_145851_c >> 4, tileentity1.field_145849_e >> 4); + + if (chunk1 != null) + { +- chunk1.func_150812_a(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15, tileentity1); ++ chunk1.removeInvalidTileEntity(tileentity1.field_145851_c & 15, tileentity1.field_145848_d, tileentity1.field_145849_e & 15); + } + } +- +- this.func_147471_g(tileentity1.field_145851_c, tileentity1.field_145848_d, tileentity1.field_145849_e); + } + } + +@@ -1846,14 +2022,11 @@ + + public void func_147448_a(Collection p_147448_1_) + { +- if (this.field_147481_N) ++ List dest = field_147481_N ? field_147484_a : field_147482_g; ++ for(TileEntity entity : (Collection)p_147448_1_) + { +- this.field_147484_a.addAll(p_147448_1_); ++ if(entity.canUpdate()) dest.add(entity); + } +- else +- { +- this.field_147482_g.addAll(p_147448_1_); +- } + } + + public void func_72870_g(Entity p_72870_1_) +@@ -1865,10 +2038,19 @@ + { + int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t); + int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v); +- byte b0 = 32; ++ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(i >> 4, j >> 4)); ++ byte b0 = isForced ? (byte)0 : 32; ++ boolean canUpdate = !p_72866_2_ || this.func_72904_c(i - b0, 0, j - b0, i + b0, 0, j + b0); + +- if (!p_72866_2_ || this.func_72904_c(i - b0, 0, j - b0, i + b0, 0, j + b0)) ++ if (!canUpdate) + { ++ EntityEvent.CanUpdate event = new EntityEvent.CanUpdate(p_72866_1_); ++ MinecraftForge.EVENT_BUS.post(event); ++ canUpdate = event.canUpdate; ++ } ++ ++ if (canUpdate) ++ { + p_72866_1_.field_70142_S = p_72866_1_.field_70165_t; + p_72866_1_.field_70137_T = p_72866_1_.field_70163_u; + p_72866_1_.field_70136_U = p_72866_1_.field_70161_v; +@@ -2086,6 +2268,10 @@ + { + return true; + } ++ else ++ { ++ if (block.isBurning(this, k1, l1, i2)) return true; ++ } + } + } + } +@@ -2222,6 +2408,7 @@ + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + explosion.field_77286_a = p_72885_9_; + explosion.field_82755_b = p_72885_10_; ++ if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.func_77278_a(); + explosion.func_77279_a(true); + return explosion; +@@ -2378,13 +2565,15 @@ + + public void func_147455_a(int p_147455_1_, int p_147455_2_, int p_147455_3_, TileEntity p_147455_4_) + { +- if (p_147455_4_ != null && !p_147455_4_.func_145837_r()) ++ if (p_147455_4_ == null || p_147455_4_.func_145837_r()) + { ++ return; ++ } ++ ++ if (p_147455_4_.canUpdate()) ++ { + if (this.field_147481_N) + { +- p_147455_4_.field_145851_c = p_147455_1_; +- p_147455_4_.field_145848_d = p_147455_2_; +- p_147455_4_.field_145849_e = p_147455_3_; + Iterator iterator = this.field_147484_a.iterator(); + + while (iterator.hasNext()) +@@ -2403,40 +2592,22 @@ + else + { + this.field_147482_g.add(p_147455_4_); +- Chunk chunk = this.func_72964_e(p_147455_1_ >> 4, p_147455_3_ >> 4); +- +- if (chunk != null) +- { +- chunk.func_150812_a(p_147455_1_ & 15, p_147455_2_, p_147455_3_ & 15, p_147455_4_); +- } + } + } ++ Chunk chunk = this.func_72964_e(p_147455_1_ >> 4, p_147455_3_ >> 4); ++ if (chunk != null) ++ { ++ chunk.func_150812_a(p_147455_1_ & 15, p_147455_2_, p_147455_3_ & 15, p_147455_4_); ++ } ++ //notify tile changes ++ func_147453_f(p_147455_1_, p_147455_2_, p_147455_3_, func_147439_a(p_147455_1_, p_147455_2_, p_147455_3_)); + } + + public void func_147475_p(int p_147475_1_, int p_147475_2_, int p_147475_3_) + { +- TileEntity tileentity = this.func_147438_o(p_147475_1_, p_147475_2_, p_147475_3_); +- +- if (tileentity != null && this.field_147481_N) +- { +- tileentity.func_145843_s(); +- this.field_147484_a.remove(tileentity); +- } +- else +- { +- if (tileentity != null) +- { +- this.field_147484_a.remove(tileentity); +- this.field_147482_g.remove(tileentity); +- } +- +- Chunk chunk = this.func_72964_e(p_147475_1_ >> 4, p_147475_3_ >> 4); +- +- if (chunk != null) +- { +- chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); +- } +- } ++ Chunk chunk = func_72964_e(p_147475_1_ >> 4, p_147475_3_ >> 4); ++ if (chunk != null) chunk.func_150805_f(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); ++ func_147453_f(p_147475_1_, p_147475_2_, p_147475_3_, func_147439_a(p_147475_1_, p_147475_2_, p_147475_3_)); + } + + public void func_147457_a(TileEntity p_147457_1_) +@@ -2453,8 +2624,7 @@ + public static boolean func_147466_a(IBlockAccess p_147466_0_, int p_147466_1_, int p_147466_2_, int p_147466_3_) + { + Block block = p_147466_0_.func_147439_a(p_147466_1_, p_147466_2_, p_147466_3_); +- int l = p_147466_0_.func_72805_g(p_147466_1_, p_147466_2_, p_147466_3_); +- return block.func_149688_o().func_76218_k() && block.func_149686_d() ? true : (block instanceof BlockStairs ? (l & 4) == 4 : (block instanceof BlockSlab ? (l & 8) == 8 : (block instanceof BlockHopper ? true : (block instanceof BlockSnow ? (l & 7) == 7 : false)))); ++ return block.isSideSolid(p_147466_0_, p_147466_1_, p_147466_2_, p_147466_3_, ForgeDirection.UP); + } + + public boolean func_147445_c(int p_147445_1_, int p_147445_2_, int p_147445_3_, boolean p_147445_4_) +@@ -2466,7 +2636,7 @@ + if (chunk != null && !chunk.func_76621_g()) + { + Block block = this.func_147439_a(p_147445_1_, p_147445_2_, p_147445_3_); +- return block.func_149688_o().func_76218_k() && block.func_149686_d(); ++ return block.isNormalCube(this, p_147445_1_, p_147445_2_, p_147445_3_); + } + else + { +@@ -2491,8 +2661,7 @@ + + public void func_72891_a(boolean p_72891_1_, boolean p_72891_2_) + { +- this.field_72985_G = p_72891_1_; +- this.field_72992_H = p_72891_2_; ++ field_73011_w.setAllowedSpawnTypes(p_72891_1_, p_72891_2_); + } + + public void func_72835_b() +@@ -2502,6 +2671,11 @@ + + private void func_72947_a() + { ++ field_73011_w.calculateInitialWeather(); ++ } ++ ++ public void calculateInitialWeatherBody() ++ { + if (this.field_72986_A.func_76059_o()) + { + this.field_73004_o = 1.0F; +@@ -2515,6 +2689,11 @@ + + protected void func_72979_l() + { ++ field_73011_w.updateWeather(); ++ } ++ ++ public void updateWeatherBody() ++ { + if (!this.field_73011_w.field_76576_e) + { + if (!this.field_72995_K) +@@ -2599,6 +2778,7 @@ + { + this.field_72993_I.clear(); + this.field_72984_F.func_76320_a("buildList"); ++ this.field_72993_I.addAll(getPersistentChunks().keySet()); + int i; + EntityPlayer entityplayer; + int j; +@@ -2693,6 +2873,11 @@ + + public boolean func_72834_c(int p_72834_1_, int p_72834_2_, int p_72834_3_, boolean p_72834_4_) + { ++ return field_73011_w.canBlockFreeze(p_72834_1_, p_72834_2_, p_72834_3_, p_72834_4_); ++ } ++ ++ public boolean canBlockFreezeBody(int p_72834_1_, int p_72834_2_, int p_72834_3_, boolean p_72834_4_) ++ { + BiomeGenBase biomegenbase = this.func_72807_a(p_72834_1_, p_72834_3_); + float f = biomegenbase.func_150564_a(p_72834_1_, p_72834_2_, p_72834_3_); + +@@ -2748,6 +2933,11 @@ + + public boolean func_147478_e(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) + { ++ return field_73011_w.canSnowAt(p_147478_1_, p_147478_2_, p_147478_3_, p_147478_4_); ++ } ++ ++ public boolean canSnowAtBody(int p_147478_1_, int p_147478_2_, int p_147478_3_, boolean p_147478_4_) ++ { + BiomeGenBase biomegenbase = this.func_72807_a(p_147478_1_, p_147478_3_); + float f = biomegenbase.func_150564_a(p_147478_1_, p_147478_2_, p_147478_3_); + +@@ -2797,10 +2987,11 @@ + else + { + Block block = this.func_147439_a(p_98179_1_, p_98179_2_, p_98179_3_); +- int l = p_98179_4_ == EnumSkyBlock.Sky ? 0 : block.func_149750_m(); +- int i1 = block.func_149717_k(); ++ int blockLight = block.getLightValue(this, p_98179_1_, p_98179_2_, p_98179_3_); ++ int l = p_98179_4_ == EnumSkyBlock.Sky ? 0 : blockLight; ++ int i1 = block.getLightOpacity(this, p_98179_1_, p_98179_2_, p_98179_3_); + +- if (i1 >= 15 && block.func_149750_m() > 0) ++ if (i1 >= 15 && blockLight > 0) + { + i1 = 1; + } +@@ -2900,7 +3091,7 @@ + int j4 = i2 + Facing.field_71586_b[i4]; + int k4 = j2 + Facing.field_71587_c[i4]; + int l4 = k2 + Facing.field_71585_d[i4]; +- int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).func_149717_k()); ++ int i5 = Math.max(1, this.func_147439_a(j4, k4, l4).getLightOpacity(this, j4, k4, l4)); + i3 = this.func_72972_b(p_147463_1_, j4, k4, l4); + + if (i3 == l2 - i5 && i1 < this.field_72994_J.length) +@@ -2998,10 +3189,10 @@ + public List func_94576_a(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) + { + ArrayList arraylist = new ArrayList(); +- int i = MathHelper.func_76128_c((p_94576_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_94576_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_94576_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_94576_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_94576_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_94576_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_94576_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_94576_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); + + for (int i1 = i; i1 <= j; ++i1) + { +@@ -3024,10 +3215,10 @@ + + public List func_82733_a(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_) + { +- int i = MathHelper.func_76128_c((p_82733_2_.field_72340_a - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_82733_2_.field_72336_d + 2.0D) / 16.0D); +- int k = MathHelper.func_76128_c((p_82733_2_.field_72339_c - 2.0D) / 16.0D); +- int l = MathHelper.func_76128_c((p_82733_2_.field_72334_f + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_82733_2_.field_72340_a - MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_82733_2_.field_72336_d + MAX_ENTITY_RADIUS) / 16.0D); ++ int k = MathHelper.func_76128_c((p_82733_2_.field_72339_c - MAX_ENTITY_RADIUS) / 16.0D); ++ int l = MathHelper.func_76128_c((p_82733_2_.field_72334_f + MAX_ENTITY_RADIUS) / 16.0D); + ArrayList arraylist = new ArrayList(); + + for (int i1 = i; i1 <= j; ++i1) +@@ -3104,11 +3295,14 @@ + + public void func_72868_a(List p_72868_1_) + { +- this.field_72996_f.addAll(p_72868_1_); +- + for (int i = 0; i < p_72868_1_.size(); ++i) + { +- this.func_72923_a((Entity)p_72868_1_.get(i)); ++ Entity entity = (Entity)p_72868_1_.get(i); ++ if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) ++ { ++ field_72996_f.add(entity); ++ this.func_72923_a(entity); ++ } + } + } + +@@ -3121,7 +3315,7 @@ + { + Block block1 = this.func_147439_a(p_147472_2_, p_147472_3_, p_147472_4_); + AxisAlignedBB axisalignedbb = p_147472_5_ ? null : p_147472_1_.func_149668_a(this, p_147472_2_, p_147472_3_, p_147472_4_); +- return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.field_150467_bQ ? true : block1.func_149688_o().func_76222_j() && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); ++ return axisalignedbb != null && !this.func_72917_a(axisalignedbb, p_147472_7_) ? false : (block1.func_149688_o() == Material.field_151594_q && p_147472_1_ == Blocks.field_150467_bQ ? true : block1.isReplaceable(this, p_147472_2_, p_147472_3_, p_147472_4_) && p_147472_1_.func_149705_a(this, p_147472_2_, p_147472_3_, p_147472_4_, p_147472_6_, p_147472_8_)); + } + + public PathEntity func_72865_a(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) +@@ -3226,7 +3420,8 @@ + + public int func_72878_l(int p_72878_1_, int p_72878_2_, int p_72878_3_, int p_72878_4_) + { +- return this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_).func_149721_r() ? this.func_94577_B(p_72878_1_, p_72878_2_, p_72878_3_) : this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_).func_149709_b(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); ++ Block block = this.func_147439_a(p_72878_1_, p_72878_2_, p_72878_3_); ++ return block.shouldCheckWeakPower(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_) ? this.func_94577_B(p_72878_1_, p_72878_2_, p_72878_3_) : block.func_149709_b(this, p_72878_1_, p_72878_2_, p_72878_3_, p_72878_4_); + } + + public boolean func_72864_z(int p_72864_1_, int p_72864_2_, int p_72864_3_) +@@ -3374,7 +3569,7 @@ + + public long func_72905_C() + { +- return this.field_72986_A.func_76063_b(); ++ return field_73011_w.getSeed(); + } + + public long func_82737_E() +@@ -3384,22 +3579,22 @@ + + public long func_72820_D() + { +- return this.field_72986_A.func_76073_f(); ++ return field_73011_w.getWorldTime(); + } + + public void func_72877_b(long p_72877_1_) + { +- this.field_72986_A.func_76068_b(p_72877_1_); ++ field_73011_w.setWorldTime(p_72877_1_); + } + + public ChunkCoordinates func_72861_E() + { +- return new ChunkCoordinates(this.field_72986_A.func_76079_c(), this.field_72986_A.func_76075_d(), this.field_72986_A.func_76074_e()); ++ return field_73011_w.getSpawnPoint(); + } + + public void func_72950_A(int p_72950_1_, int p_72950_2_, int p_72950_3_) + { +- this.field_72986_A.func_76081_a(p_72950_1_, p_72950_2_, p_72950_3_); ++ field_73011_w.setSpawnPoint(p_72950_1_, p_72950_2_, p_72950_3_); + } + + @SideOnly(Side.CLIENT) +@@ -3419,12 +3614,20 @@ + + if (!this.field_72996_f.contains(p_72897_1_)) + { +- this.field_72996_f.add(p_72897_1_); ++ if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(p_72897_1_, this))) ++ { ++ this.field_72996_f.add(p_72897_1_); ++ } + } + } + + public boolean func_72962_a(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) + { ++ return field_73011_w.canMineBlock(p_72962_1_, p_72962_2_, p_72962_3_, p_72962_4_); ++ } ++ ++ public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) ++ { + return true; + } + +@@ -3514,8 +3717,7 @@ + + public boolean func_72958_C(int p_72958_1_, int p_72958_2_, int p_72958_3_) + { +- BiomeGenBase biomegenbase = this.func_72807_a(p_72958_1_, p_72958_3_); +- return biomegenbase.func_76736_e(); ++ return field_73011_w.isBlockHighHumidity(p_72958_1_, p_72958_2_, p_72958_3_); + } + + public void func_72823_a(String p_72823_1_, WorldSavedData p_72823_2_) +@@ -3569,12 +3771,12 @@ + + public int func_72800_K() + { +- return 256; ++ return field_73011_w.getHeight(); + } + + public int func_72940_L() + { +- return this.field_73011_w.field_76576_e ? 128 : 256; ++ return field_73011_w.getActualHeight(); + } + + public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_) +@@ -3598,7 +3800,7 @@ + @SideOnly(Side.CLIENT) + public double func_72919_O() + { +- return this.field_72986_A.func_76067_t().getHorizon(this); ++ return field_73011_w.getHorizon(); + } + + public CrashReportCategory func_72914_a(CrashReport p_72914_1_) +@@ -3663,25 +3865,24 @@ + + public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_) + { +- for (int l = 0; l < 4; ++l) ++ for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) + { +- int i1 = p_147453_1_ + Direction.field_71583_a[l]; +- int j1 = p_147453_3_ + Direction.field_71581_b[l]; +- Block block1 = this.func_147439_a(i1, p_147453_2_, j1); ++ int i1 = p_147453_1_ + dir.offsetX; ++ int y = p_147453_2_ + dir.offsetY; ++ int j1 = p_147453_3_ + dir.offsetZ; ++ Block block1 = this.func_147439_a(i1, y, j1); + +- if (Blocks.field_150441_bU.func_149907_e(block1)) ++ block1.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); ++ if (block1.isNormalCube(this, i1, y, j1)) + { +- block1.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); +- } +- else if (block1.func_149721_r()) +- { +- i1 += Direction.field_71583_a[l]; +- j1 += Direction.field_71581_b[l]; +- Block block2 = this.func_147439_a(i1, p_147453_2_, j1); ++ i1 += dir.offsetX; ++ y += dir.offsetY; ++ j1 += dir.offsetZ; ++ Block block2 = this.func_147439_a(i1, y, j1); + +- if (Blocks.field_150441_bU.func_149907_e(block2)) ++ if (block2.getWeakChanges(this, i1, y, j1)) + { +- block2.func_149695_a(this, i1, p_147453_2_, j1, p_147453_4_); ++ block2.onNeighborChange(this, i1, y, j1, p_147453_1_, p_147453_2_, p_147453_3_); + } + } + } +@@ -3722,4 +3923,110 @@ + iworldaccess.func_147584_b(); + } + } ++ ++ ++ /* ======================================== FORGE START =====================================*/ ++ /** ++ * Adds a single TileEntity to the world. ++ * @param entity The TileEntity to be added. ++ */ ++ public void addTileEntity(TileEntity entity) ++ { ++ List dest = field_147481_N ? field_147484_a : field_147482_g; ++ if(entity.canUpdate()) ++ { ++ dest.add(entity); ++ } ++ } ++ ++ /** ++ * Determine if the given block is considered solid on the ++ * specified side. Used by placement logic. ++ * ++ * @param x Block X Position ++ * @param y Block Y Position ++ * @param z Block Z Position ++ * @param side The Side in question ++ * @return True if the side is solid ++ */ ++ public boolean isSideSolid(int x, int y, int z, ForgeDirection side) ++ { ++ return isSideSolid(x, y, z, side, false); ++ } ++ ++ /** ++ * Determine if the given block is considered solid on the ++ * specified side. Used by placement logic. ++ * ++ * @param x Block X Position ++ * @param y Block Y Position ++ * @param z Block Z Position ++ * @param side The Side in question ++ * @param _default The default to return if the block doesn't exist. ++ * @return True if the side is solid ++ */ ++ @Override ++ public boolean isSideSolid(int x, int y, int z, ForgeDirection side, boolean _default) ++ { ++ if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) ++ { ++ return _default; ++ } ++ ++ Chunk chunk = this.field_73020_y.func_73154_d(x >> 4, z >> 4); ++ if (chunk == null || chunk.func_76621_g()) ++ { ++ return _default; ++ } ++ return func_147439_a(x, y, z).isSideSolid(this, x, y, z, side); ++ } ++ ++ /** ++ * Get the persistent chunks for this world ++ * ++ * @return ++ */ ++ public ImmutableSetMultimap getPersistentChunks() ++ { ++ return ForgeChunkManager.getPersistentChunksFor(this); ++ } ++ ++ /** ++ * Readded as it was removed, very useful helper function ++ * ++ * @param x X position ++ * @param y Y Position ++ * @param z Z Position ++ * @return The blocks light opacity ++ */ ++ public int getBlockLightOpacity(int x, int y, int z) ++ { ++ if (x < -30000000 || z < -30000000 || x >= 30000000 || z >= 30000000) ++ { ++ return 0; ++ } ++ ++ if (y < 0 || y >= 256) ++ { ++ return 0; ++ } ++ ++ return func_72964_e(x >> 4, z >> 4).func_150808_b(x & 15, y, z & 15); ++ } ++ ++ /** ++ * Returns a count of entities that classify themselves as the specified creature type. ++ */ ++ public int countEntities(EnumCreatureType type, boolean forSpawnCount) ++ { ++ int count = 0; ++ for (int x = 0; x < field_72996_f.size(); x++) ++ { ++ if (((Entity)field_72996_f.get(x)).isCreatureType(type, forSpawnCount)) ++ { ++ count++; ++ } ++ } ++ return count; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldProvider.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldProvider.java.patch new file mode 100644 index 0000000..72b9ef5 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldProvider.java.patch @@ -0,0 +1,365 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProvider.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java +@@ -2,17 +2,25 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import net.minecraft.entity.Entity; ++import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.entity.player.EntityPlayerMP; + import net.minecraft.init.Blocks; + import net.minecraft.util.ChunkCoordinates; + import net.minecraft.util.MathHelper; + import net.minecraft.util.Vec3; ++import net.minecraft.world.WorldSettings.GameType; + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.biome.WorldChunkManager; + import net.minecraft.world.biome.WorldChunkManagerHell; ++import net.minecraft.world.chunk.Chunk; + import net.minecraft.world.chunk.IChunkProvider; + import net.minecraft.world.gen.ChunkProviderFlat; + import net.minecraft.world.gen.ChunkProviderGenerate; + import net.minecraft.world.gen.FlatGeneratorInfo; ++import net.minecraft.world.storage.WorldInfo; ++import net.minecraftforge.client.IRenderHandler; ++import net.minecraftforge.common.DimensionManager; + + public abstract class WorldProvider + { +@@ -149,13 +157,13 @@ + + public static WorldProvider func_76570_a(int p_76570_0_) + { +- return (WorldProvider)(p_76570_0_ == -1 ? new WorldProviderHell() : (p_76570_0_ == 0 ? new WorldProviderSurface() : (p_76570_0_ == 1 ? new WorldProviderEnd() : null))); ++ return DimensionManager.createProviderFor(p_76570_0_); + } + + @SideOnly(Side.CLIENT) + public float func_76571_f() + { +- return 128.0F; ++ return this.field_76577_b.getCloudHeight(); + } + + @SideOnly(Side.CLIENT) +@@ -193,4 +201,320 @@ + } + + public abstract String func_80007_l(); ++ ++ /*======================================= Forge Start =========================================*/ ++ private IRenderHandler skyRenderer = null; ++ private IRenderHandler cloudRenderer = null; ++ private IRenderHandler weatherRenderer = null; ++ ++ /** ++ * Sets the providers current dimension ID, used in default getSaveFolder() ++ * Added to allow default providers to be registered for multiple dimensions. ++ * ++ * @param dim Dimension ID ++ */ ++ public void setDimension(int dim) ++ { ++ this.field_76574_g = dim; ++ } ++ ++ /** ++ * Returns the sub-folder of the world folder that this WorldProvider saves to. ++ * EXA: DIM1, DIM-1 ++ * @return The sub-folder name to save this world's chunks to. ++ */ ++ public String getSaveFolder() ++ { ++ return (field_76574_g == 0 ? null : "DIM" + field_76574_g); ++ } ++ ++ /** ++ * A message to display to the user when they transfer to this dimension. ++ * ++ * @return The message to be displayed ++ */ ++ public String getWelcomeMessage() ++ { ++ if (this instanceof WorldProviderEnd) ++ { ++ return "Entering the End"; ++ } ++ else if (this instanceof WorldProviderHell) ++ { ++ return "Entering the Nether"; ++ } ++ return null; ++ } ++ ++ /** ++ * A Message to display to the user when they transfer out of this dismension. ++ * ++ * @return The message to be displayed ++ */ ++ public String getDepartMessage() ++ { ++ if (this instanceof WorldProviderEnd) ++ { ++ return "Leaving the End"; ++ } ++ else if (this instanceof WorldProviderHell) ++ { ++ return "Leaving the Nether"; ++ } ++ return null; ++ } ++ ++ /** ++ * The dimensions movement factor. Relative to normal overworld. ++ * It is applied to the players position when they transfer dimensions. ++ * Exa: Nether movement is 8.0 ++ * @return The movement factor ++ */ ++ public double getMovementFactor() ++ { ++ if (this instanceof WorldProviderHell) ++ { ++ return 8.0; ++ } ++ return 1.0; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public IRenderHandler getSkyRenderer() ++ { ++ return this.skyRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setSkyRenderer(IRenderHandler skyRenderer) ++ { ++ this.skyRenderer = skyRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public IRenderHandler getCloudRenderer() ++ { ++ return cloudRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setCloudRenderer(IRenderHandler renderer) ++ { ++ cloudRenderer = renderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public IRenderHandler getWeatherRenderer() ++ { ++ return weatherRenderer; ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public void setWeatherRenderer(IRenderHandler renderer) ++ { ++ weatherRenderer = renderer; ++ } ++ ++ public ChunkCoordinates getRandomizedSpawnPoint() ++ { ++ ChunkCoordinates chunkcoordinates = new ChunkCoordinates(this.field_76579_a.func_72861_E()); ++ ++ boolean isAdventure = field_76579_a.func_72912_H().func_76077_q() == GameType.ADVENTURE; ++ int spawnFuzz = field_76577_b.getSpawnFuzz(); ++ int spawnFuzzHalf = spawnFuzz / 2; ++ ++ if (!field_76576_e && !isAdventure && net.minecraftforge.common.ForgeModContainer.defaultHasSpawnFuzz) ++ { ++ chunkcoordinates.field_71574_a += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf; ++ chunkcoordinates.field_71573_c += this.field_76579_a.field_73012_v.nextInt(spawnFuzz) - spawnFuzzHalf; ++ chunkcoordinates.field_71572_b = this.field_76579_a.func_72825_h(chunkcoordinates.field_71574_a, chunkcoordinates.field_71573_c); ++ } ++ ++ return chunkcoordinates; ++ } ++ ++ /** ++ * Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether. ++ * ++ * @param entity The entity holding the map, playername, or frame-ENTITYID ++ * @param x X Position ++ * @param y Y Position ++ * @param z Z Postion ++ * @return True to 'spin' the cursor ++ */ ++ public boolean shouldMapSpin(String entity, double x, double y, double z) ++ { ++ return field_76574_g < 0; ++ } ++ ++ /** ++ * Determines the dimension the player will be respawned in, typically this brings them back to the overworld. ++ * ++ * @param player The player that is respawning ++ * @return The dimension to respawn the player in ++ */ ++ public int getRespawnDimension(EntityPlayerMP player) ++ { ++ return 0; ++ } ++ ++ /*======================================= Start Moved From World =========================================*/ ++ ++ public BiomeGenBase getBiomeGenForCoords(int x, int z) ++ { ++ return field_76579_a.getBiomeGenForCoordsBody(x, z); ++ } ++ ++ public boolean isDaytime() ++ { ++ return field_76579_a.field_73008_k < 4; ++ } ++ ++ /** ++ * The current sun brightness factor for this dimension. ++ * 0.0f means no light at all, and 1.0f means maximum sunlight. ++ * This will be used for the "calculateSkylightSubtracted" ++ * which is for Sky light value calculation. ++ * ++ * @return The current brightness factor ++ * */ ++ public float getSunBrightnessFactor(float par1) ++ { ++ return field_76579_a.getSunBrightnessFactor(par1); ++ } ++ ++ /** ++ * Calculates the current moon phase factor. ++ * This factor is effective for slimes. ++ * (This method do not affect the moon rendering) ++ * */ ++ public float getCurrentMoonPhaseFactor() ++ { ++ return field_76579_a.getCurrentMoonPhaseFactorBody(); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) ++ { ++ return field_76579_a.getSkyColorBody(cameraEntity, partialTicks); ++ } ++ ++ @SideOnly(Side.CLIENT) ++ public Vec3 drawClouds(float partialTicks) ++ { ++ return field_76579_a.drawCloudsBody(partialTicks); ++ } ++ ++ /** ++ * Gets the Sun Brightness for rendering sky. ++ * */ ++ @SideOnly(Side.CLIENT) ++ public float getSunBrightness(float par1) ++ { ++ return field_76579_a.getSunBrightnessBody(par1); ++ } ++ ++ /** ++ * Gets the Star Brightness for rendering sky. ++ * */ ++ @SideOnly(Side.CLIENT) ++ public float getStarBrightness(float par1) ++ { ++ return field_76579_a.getStarBrightnessBody(par1); ++ } ++ ++ public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) ++ { ++ field_76579_a.field_72985_G = allowHostile; ++ field_76579_a.field_72992_H = allowPeaceful; ++ } ++ ++ public void calculateInitialWeather() ++ { ++ field_76579_a.calculateInitialWeatherBody(); ++ } ++ ++ public void updateWeather() ++ { ++ field_76579_a.updateWeatherBody(); ++ } ++ ++ public boolean canBlockFreeze(int x, int y, int z, boolean byWater) ++ { ++ return field_76579_a.canBlockFreezeBody(x, y, z, byWater); ++ } ++ ++ public boolean canSnowAt(int x, int y, int z, boolean checkLight) ++ { ++ return field_76579_a.canSnowAtBody(x, y, z, checkLight); ++ } ++ ++ public void setWorldTime(long time) ++ { ++ field_76579_a.field_72986_A.func_76068_b(time); ++ } ++ ++ public long getSeed() ++ { ++ return field_76579_a.field_72986_A.func_76063_b(); ++ } ++ ++ public long getWorldTime() ++ { ++ return field_76579_a.field_72986_A.func_76073_f(); ++ } ++ ++ public ChunkCoordinates getSpawnPoint() ++ { ++ WorldInfo info = field_76579_a.field_72986_A; ++ return new ChunkCoordinates(info.func_76079_c(), info.func_76075_d(), info.func_76074_e()); ++ } ++ ++ public void setSpawnPoint(int x, int y, int z) ++ { ++ field_76579_a.field_72986_A.func_76081_a(x, y, z); ++ } ++ ++ public boolean canMineBlock(EntityPlayer player, int x, int y, int z) ++ { ++ return field_76579_a.canMineBlockBody(player, x, y, z); ++ } ++ ++ public boolean isBlockHighHumidity(int x, int y, int z) ++ { ++ return field_76579_a.func_72807_a(x, z).func_76736_e(); ++ } ++ ++ public int getHeight() ++ { ++ return 256; ++ } ++ ++ public int getActualHeight() ++ { ++ return field_76576_e ? 128 : 256; ++ } ++ ++ public double getHorizon() ++ { ++ return field_76579_a.field_72986_A.func_76067_t().getHorizon(field_76579_a); ++ } ++ ++ public void resetRainAndThunder() ++ { ++ field_76579_a.field_72986_A.func_76080_g(0); ++ field_76579_a.field_72986_A.func_76084_b(false); ++ field_76579_a.field_72986_A.func_76090_f(0); ++ field_76579_a.field_72986_A.func_76069_a(false); ++ } ++ ++ public boolean canDoLightning(Chunk chunk) ++ { ++ return true; ++ } ++ ++ public boolean canDoRainSnowIce(Chunk chunk) ++ { ++ return true; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServer.java.patch new file mode 100644 index 0000000..59b8965 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServer.java.patch @@ -0,0 +1,262 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldServer.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServer.java +@@ -3,6 +3,7 @@ + import com.google.common.collect.Lists; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++import java.io.File; + import java.util.ArrayList; + import java.util.HashSet; + import java.util.Iterator; +@@ -50,11 +51,19 @@ + import net.minecraft.world.biome.WorldChunkManager; + import net.minecraft.world.chunk.Chunk; + import net.minecraft.world.chunk.IChunkProvider; ++import net.minecraft.world.chunk.storage.AnvilChunkLoader; + import net.minecraft.world.chunk.storage.ExtendedBlockStorage; + import net.minecraft.world.chunk.storage.IChunkLoader; + import net.minecraft.world.gen.ChunkProviderServer; + import net.minecraft.world.gen.feature.WorldGeneratorBonusChest; + import net.minecraft.world.storage.ISaveHandler; ++import net.minecraftforge.common.ChestGenHooks; ++import static net.minecraftforge.common.ChestGenHooks.BONUS_CHEST; ++import net.minecraftforge.common.DimensionManager; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.ForgeEventFactory; ++import net.minecraftforge.event.world.WorldEvent; ++ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -79,6 +88,10 @@ + private IntHashMap field_73066_T; + private static final String __OBFID = "CL_00001437"; + ++ /** Stores the recently processed (lighting) chunks */ ++ protected Set doneChunks = new HashSet(); ++ public List customTeleporters = new ArrayList(); ++ + public WorldServer(MinecraftServer p_i45284_1_, ISaveHandler p_i45284_2_, String p_i45284_3_, int p_i45284_4_, WorldSettings p_i45284_5_, Profiler p_i45284_6_) + { + super(p_i45284_2_, p_i45284_3_, p_i45284_5_, WorldProvider.func_76570_a(p_i45284_4_), p_i45284_6_); +@@ -111,8 +124,12 @@ + this.field_72988_C.func_75745_a("scoreboard", scoreboardsavedata); + } + +- scoreboardsavedata.func_96499_a(this.field_96442_D); ++ if (!(this instanceof WorldServerMulti)) //Forge: We fix the global mapStorage, which causes us to share scoreboards early. So don't associate the save data with the temporary scoreboard ++ { ++ scoreboardsavedata.func_96499_a(this.field_96442_D); ++ } + ((ServerScoreboard)this.field_96442_D).func_96547_a(scoreboardsavedata); ++ DimensionManager.setWorld(p_i45284_4_, this); + } + + public void func_72835_b() +@@ -171,6 +188,10 @@ + this.field_72983_E.func_75528_a(); + this.field_72984_F.func_76318_c("portalForcer"); + this.field_85177_Q.func_85189_a(this.func_82737_E()); ++ for (Teleporter tele : customTeleporters) ++ { ++ tele.func_85189_a(func_82737_E()); ++ } + this.field_72984_F.func_76319_b(); + this.func_147488_Z(); + } +@@ -178,6 +199,7 @@ + public BiomeGenBase.SpawnListEntry func_73057_a(EnumCreatureType p_73057_1_, int p_73057_2_, int p_73057_3_, int p_73057_4_) + { + List list = this.func_72863_F().func_73155_a(p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_); ++ list = ForgeEventFactory.getPotentialSpawns(this, p_73057_1_, p_73057_2_, p_73057_3_, p_73057_4_, list); + return list != null && !list.isEmpty() ? (BiomeGenBase.SpawnListEntry)WeightedRandom.func_76271_a(this.field_73012_v, list) : null; + } + +@@ -218,10 +240,7 @@ + + private void func_73051_P() + { +- this.field_72986_A.func_76080_g(0); +- this.field_72986_A.func_76084_b(false); +- this.field_72986_A.func_76090_f(0); +- this.field_72986_A.func_76069_a(false); ++ field_73011_w.resetRainAndThunder(); + } + + public boolean func_73056_e() +@@ -301,7 +320,7 @@ + int k1; + int l1; + +- if (this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) ++ if (field_73011_w.canDoLightning(chunk) && this.field_73012_v.nextInt(100000) == 0 && this.func_72896_J() && this.func_72911_I()) + { + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + i1 = this.field_73005_l >> 2; +@@ -317,7 +336,7 @@ + + this.field_72984_F.func_76318_c("iceandsnow"); + +- if (this.field_73012_v.nextInt(16) == 0) ++ if (field_73011_w.canDoRainSnowIce(chunk) && this.field_73012_v.nextInt(16) == 0) + { + this.field_73005_l = this.field_73005_l * 3 + 1013904223; + i1 = this.field_73005_l >> 2; +@@ -393,6 +412,9 @@ + public void func_147454_a(int p_147454_1_, int p_147454_2_, int p_147454_3_, Block p_147454_4_, int p_147454_5_, int p_147454_6_) + { + NextTickListEntry nextticklistentry = new NextTickListEntry(p_147454_1_, p_147454_2_, p_147454_3_, p_147454_4_); ++ //Keeping here as a note for future when it may be restored. ++ //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); ++ //byte b0 = isForced ? 0 : 8; + byte b0 = 0; + + if (this.field_72999_e && p_147454_4_.func_149688_o() != Material.field_151579_a) +@@ -452,7 +474,7 @@ + + public void func_72939_s() + { +- if (this.field_73010_i.isEmpty()) ++ if (this.field_73010_i.isEmpty() && getPersistentChunks().isEmpty()) + { + if (this.field_80004_Q++ >= 1200) + { +@@ -512,6 +534,9 @@ + { + nextticklistentry = (NextTickListEntry)iterator.next(); + iterator.remove(); ++ //Keeping here as a note for future when it may be restored. ++ //boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(nextticklistentry.xCoord >> 4, nextticklistentry.zCoord >> 4)); ++ //byte b0 = isForced ? 0 : 8; + byte b0 = 0; + + if (this.func_72904_c(nextticklistentry.field_77183_a - b0, nextticklistentry.field_77181_b - b0, nextticklistentry.field_77182_c - b0, nextticklistentry.field_77183_a + b0, nextticklistentry.field_77181_b + b0, nextticklistentry.field_77182_c + b0)) +@@ -634,13 +659,26 @@ + { + ArrayList arraylist = new ArrayList(); + +- for (int k1 = 0; k1 < this.field_147482_g.size(); ++k1) ++ for(int x = (p_147486_1_ >> 4); x <= (p_147486_4_ >> 4); x++) + { +- TileEntity tileentity = (TileEntity)this.field_147482_g.get(k1); +- +- if (tileentity.field_145851_c >= p_147486_1_ && tileentity.field_145848_d >= p_147486_2_ && tileentity.field_145849_e >= p_147486_3_ && tileentity.field_145851_c < p_147486_4_ && tileentity.field_145848_d < p_147486_5_ && tileentity.field_145849_e < p_147486_6_) ++ for(int z = (p_147486_3_ >> 4); z <= (p_147486_6_ >> 4); z++) + { +- arraylist.add(tileentity); ++ Chunk chunk = func_72964_e(x, z); ++ if (chunk != null) ++ { ++ for(Object obj : chunk.field_150816_i.values()) ++ { ++ TileEntity entity = (TileEntity)obj; ++ if (!entity.func_145837_r()) ++ { ++ if (entity.field_145851_c >= p_147486_1_ && entity.field_145848_d >= p_147486_2_ && entity.field_145849_e >= p_147486_3_ && ++ entity.field_145851_c <= p_147486_4_ && entity.field_145848_d <= p_147486_5_ && entity.field_145849_e <= p_147486_6_) ++ { ++ arraylist.add(entity); ++ } ++ } ++ } ++ } + } + } + +@@ -649,9 +687,14 @@ + + public boolean func_72962_a(EntityPlayer p_72962_1_, int p_72962_2_, int p_72962_3_, int p_72962_4_) + { +- return !this.field_73061_a.func_96290_a(this, p_72962_2_, p_72962_3_, p_72962_4_, p_72962_1_); ++ return super.func_72962_a(p_72962_1_, p_72962_2_, p_72962_3_, p_72962_4_); + } + ++ public boolean canMineBlockBody(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) ++ { ++ return !this.field_73061_a.func_96290_a(this, par2, par3, par4, par1EntityPlayer); ++ } ++ + protected void func_72963_a(WorldSettings p_72963_1_) + { + if (this.field_73066_T == null) +@@ -681,6 +724,7 @@ + } + else + { ++ if (net.minecraftforge.event.ForgeEventFactory.onCreateWorldSpawn(this, p_73052_1_)) return; + this.field_72987_B = true; + WorldChunkManager worldchunkmanager = this.field_73011_w.field_76578_c; + List list = worldchunkmanager.func_76932_a(); +@@ -726,7 +770,7 @@ + + protected void func_73047_i() + { +- WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(field_73069_S, 10); ++ WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, field_73012_v), ChestGenHooks.getCount(BONUS_CHEST, field_73012_v)); + + for (int i = 0; i < 10; ++i) + { +@@ -763,6 +807,7 @@ + } + + this.field_73020_y.func_73151_a(p_73044_1_, p_73044_2_); ++ MinecraftForge.EVENT_BUS.post(new WorldEvent.Save(this)); + ArrayList arraylist = Lists.newArrayList(this.field_73059_b.func_152380_a()); + Iterator iterator = arraylist.iterator(); + +@@ -791,6 +836,7 @@ + this.func_72906_B(); + this.field_73019_z.func_75755_a(this.field_72986_A, this.field_73061_a.func_71203_ab().func_72378_q()); + this.field_72988_C.func_75744_a(); ++ this.perWorldStorage.func_75744_a(); + } + + public void func_72923_a(Entity p_72923_1_) +@@ -851,6 +897,7 @@ + Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); + explosion.field_77286_a = p_72885_9_; + explosion.field_82755_b = p_72885_10_; ++ if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; + explosion.func_77278_a(); + explosion.func_77279_a(false); + +@@ -941,19 +988,23 @@ + this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.field_76574_g); + } + ++ /*The function in use here has been replaced in order to only send the weather info to players in the correct dimension, ++ rather than to all players on the server. This is what causes the client-side rain, as the ++ client believes that it has started raining locally, rather than in another dimension. ++ */ + if (flag != this.func_72896_J()) + { + if (flag) + { +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(2, 0.0F)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(2, 0.0F), this.field_73011_w.field_76574_g); + } + else + { +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(1, 0.0F)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(1, 0.0F), this.field_73011_w.field_76574_g); + } + +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(7, this.field_73004_o)); +- this.field_73061_a.func_71203_ab().func_148540_a(new S2BPacketChangeGameState(8, this.field_73017_q)); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(7, this.field_73004_o), this.field_73011_w.field_76574_g); ++ this.field_73061_a.func_71203_ab().func_148537_a(new S2BPacketChangeGameState(8, this.field_73017_q), this.field_73011_w.field_76574_g); + } + } + +@@ -1002,6 +1053,11 @@ + } + } + ++ public File getChunkSaveLocation() ++ { ++ return ((AnvilChunkLoader)field_73059_b.field_73247_e).field_75825_d; ++ } ++ + static class ServerBlockEventList extends ArrayList + { + private static final String __OBFID = "CL_00001439"; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServerMulti.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServerMulti.java.patch new file mode 100644 index 0000000..1248350 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServerMulti.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java ++++ ../src-work/minecraft/net/minecraft/world/WorldServerMulti.java +@@ -17,5 +17,8 @@ + this.field_72986_A = new DerivedWorldInfo(p_i45283_6_.func_72912_H()); + } + +- protected void func_73042_a() throws MinecraftException {} ++ protected void func_73042_a() throws MinecraftException ++ { ++ this.perWorldStorage.func_75744_a(); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldType.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldType.java.patch new file mode 100644 index 0000000..76d0ee2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldType.java.patch @@ -0,0 +1,126 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldType.java ++++ ../src-work/minecraft/net/minecraft/world/WorldType.java +@@ -1,7 +1,11 @@ + package net.minecraft.world; + ++import java.util.Arrays; + import java.util.Random; + ++import net.minecraft.client.Minecraft; ++import net.minecraft.client.gui.GuiCreateFlatWorld; ++import net.minecraft.client.gui.GuiCreateWorld; + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.biome.WorldChunkManager; + import net.minecraft.world.biome.WorldChunkManagerHell; +@@ -9,6 +13,10 @@ + import net.minecraft.world.gen.ChunkProviderFlat; + import net.minecraft.world.gen.ChunkProviderGenerate; + import net.minecraft.world.gen.FlatGeneratorInfo; ++import net.minecraft.world.gen.layer.GenLayer; ++import net.minecraft.world.gen.layer.GenLayerBiome; ++import net.minecraft.world.gen.layer.GenLayerBiomeEdge; ++import net.minecraft.world.gen.layer.GenLayerZoom; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + +@@ -35,6 +43,7 @@ + + private WorldType(int p_i1960_1_, String p_i1960_2_, int p_i1960_3_) + { ++ if (p_i1960_2_.length() > 16) throw new IllegalArgumentException("World type names must not be longer then 16: " + p_i1960_2_.length()); + this.field_77133_f = p_i1960_2_; + this.field_77134_g = p_i1960_3_; + this.field_77140_h = true; +@@ -183,8 +192,92 @@ + return this == field_77138_c ? random.nextInt(4) != 1 : false; + } + ++ /*=================================================== FORGE START ======================================*/ ++ private static int getNextID() ++ { ++ for (int x = 0; x < field_77139_a.length; x++) ++ { ++ if (field_77139_a[x] == null) ++ { ++ return x; ++ } ++ } ++ ++ int oldLen = field_77139_a.length; ++ field_77139_a = Arrays.copyOf(field_77139_a, oldLen + 16); ++ return oldLen; ++ } ++ + /** ++ * Creates a new world type, the ID is hidden and should not be referenced by modders. ++ * It will automatically expand the underlying workdType array if there are no IDs left. ++ * @param name ++ */ ++ public WorldType(String name) ++ { ++ this(getNextID(), name); ++ } ++ ++ /** + * Called when 'Create New World' button is pressed before starting game + */ + public void onGUICreateWorldPress() { } ++ ++ /** ++ * Gets the spawn fuzz for players who join the world. ++ * Useful for void world types. ++ * @return Fuzz for entity initial spawn in blocks. ++ */ ++ public int getSpawnFuzz() ++ { ++ return net.minecraftforge.common.ForgeModContainer.defaultSpawnFuzz; ++ } ++ ++ /** ++ * Called when the 'Customize' button is pressed on world creation GUI ++ * @param instance The minecraft instance ++ * @param guiCreateWorld the createworld GUI ++ */ ++ @SideOnly(Side.CLIENT) ++ public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld) ++ { ++ if (this == field_77138_c) ++ { ++ instance.func_147108_a(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a)); ++ } ++ } ++ ++ /** ++ * Should world creation GUI show 'Customize' button for this world type? ++ * @return if this world type has customization parameters ++ */ ++ public boolean isCustomizable() ++ { ++ return this == field_77138_c; ++ } ++ ++ ++ /** ++ * Get the height to render the clouds for this world type ++ * @return The height to render clouds at ++ */ ++ public float getCloudHeight() ++ { ++ return 128.0F; ++ } ++ ++ /** ++ * Creates the GenLayerBiome used for generating the world ++ * ++ * @param worldSeed The world seed ++ * @param parentLayer The parent layer to feed into any layer you return ++ * @return A GenLayer that will return ints representing the Biomes to be generated, see GenLayerBiome ++ */ ++ public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer) ++ { ++ GenLayer ret = new GenLayerBiome(200L, parentLayer, this); ++ ret = GenLayerZoom.func_75915_a(1000L, ret, 2); ++ ret = new GenLayerBiomeEdge(1000L, ret); ++ return ret; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeDecorator.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeDecorator.java.patch new file mode 100644 index 0000000..b2535a3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeDecorator.java.patch @@ -0,0 +1,249 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeDecorator.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeDecorator.java +@@ -19,6 +19,11 @@ + import net.minecraft.world.gen.feature.WorldGenWaterlily; + import net.minecraft.world.gen.feature.WorldGenerator; + ++import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; ++import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; ++import net.minecraftforge.common.*; ++import net.minecraftforge.event.terraingen.*; ++ + public class BiomeDecorator + { + public World field_76815_a; +@@ -105,26 +110,30 @@ + + protected void func_150513_a(BiomeGenBase p_150513_1_) + { ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); + this.func_76797_b(); + int i; + int j; + int k; + +- for (i = 0; i < this.field_76805_H; ++i) ++ boolean doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SAND); ++ for (i = 0; doGen && i < this.field_76805_H; ++i) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76810_g.func_76484_a(this.field_76815_a, this.field_76813_b, j, this.field_76815_a.func_72825_h(j, k), k); + } + +- for (i = 0; i < this.field_76806_I; ++i) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, CLAY); ++ for (i = 0; doGen && i < this.field_76806_I; ++i) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76809_f.func_76484_a(this.field_76815_a, this.field_76813_b, j, this.field_76815_a.func_72825_h(j, k), k); + } + +- for (i = 0; i < this.field_76801_G; ++i) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SAND_PASS2); ++ for (i = 0; doGen && i < this.field_76801_G; ++i) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -141,7 +150,8 @@ + int l; + int i1; + +- for (j = 0; j < i; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, TREE); ++ for (j = 0; doGen && j < i; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +@@ -155,18 +165,20 @@ + } + } + +- for (j = 0; j < this.field_76807_J; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, BIG_SHROOM); ++ for (j = 0; doGen && j < this.field_76807_J; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + this.field_76826_u.func_76484_a(this.field_76815_a, this.field_76813_b, k, this.field_76815_a.func_72976_f(k, l), l); + } + +- for (j = 0; j < this.field_76802_A; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, FLOWERS); ++ for (j = 0; doGen && j < this.field_76802_A; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) + 32); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) + 32); + String s = p_150513_1_.func_150572_a(this.field_76813_b, k, i1, l); + BlockFlower blockflower = BlockFlower.func_149857_e(s); + +@@ -177,29 +189,32 @@ + } + } + +- for (j = 0; j < this.field_76803_B; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, GRASS); ++ for (j = 0; doGen && j < this.field_76803_B; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + WorldGenerator worldgenerator = p_150513_1_.func_76730_b(this.field_76813_b); + worldgenerator.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- for (j = 0; j < this.field_76804_C; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, DEAD_BUSH); ++ for (j = 0; doGen && j < this.field_76804_C; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + (new WorldGenDeadBush(Blocks.field_150330_I)).func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- for (j = 0; j < this.field_76833_y; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, LILYPAD); ++ for (j = 0; doGen && j < this.field_76833_y; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; + +- for (i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); i1 > 0 && this.field_76815_a.func_147437_c(k, i1 - 1, l); --i1) ++ for (i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); i1 > 0 && this.field_76815_a.func_147437_c(k, i1 - 1, l); --i1) + { + ; + } +@@ -207,7 +222,8 @@ + this.field_76834_x.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- for (j = 0; j < this.field_76798_D; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, SHROOM); ++ for (j = 0; doGen && j < this.field_76798_D; ++j) + { + if (this.field_76813_b.nextInt(4) == 0) + { +@@ -221,60 +237,64 @@ + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + this.field_76827_t.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + } + +- if (this.field_76813_b.nextInt(4) == 0) ++ if (doGen && this.field_76813_b.nextInt(4) == 0) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- l = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(j, k) * 2); ++ l = nextInt(this.field_76815_a.func_72976_f(j, k) * 2); + this.field_76828_s.func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); + } + +- if (this.field_76813_b.nextInt(8) == 0) ++ if (doGen && this.field_76813_b.nextInt(8) == 0) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- l = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(j, k) * 2); ++ l = nextInt(this.field_76815_a.func_72976_f(j, k) * 2); + this.field_76827_t.func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); + } + +- for (j = 0; j < this.field_76799_E; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, REED); ++ for (j = 0; doGen && j < this.field_76799_E; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + this.field_76825_v.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- for (j = 0; j < 10; ++j) ++ for (j = 0; doGen && j < 10; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + this.field_76825_v.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- if (this.field_76813_b.nextInt(32) == 0) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, PUMPKIN); ++ if (doGen && this.field_76813_b.nextInt(32) == 0) + { + j = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + k = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- l = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(j, k) * 2); ++ l = nextInt(this.field_76815_a.func_72976_f(j, k) * 2); + (new WorldGenPumpkin()).func_76484_a(this.field_76815_a, this.field_76813_b, j, l, k); + } + +- for (j = 0; j < this.field_76800_F; ++j) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, CACTUS); ++ for (j = 0; doGen && j < this.field_76800_F; ++j) + { + k = this.field_76814_c + this.field_76813_b.nextInt(16) + 8; + l = this.field_76811_d + this.field_76813_b.nextInt(16) + 8; +- i1 = this.field_76813_b.nextInt(this.field_76815_a.func_72976_f(k, l) * 2); ++ i1 = nextInt(this.field_76815_a.func_72976_f(k, l) * 2); + this.field_76824_w.func_76484_a(this.field_76815_a, this.field_76813_b, k, i1, l); + } + +- if (this.field_76808_K) ++ doGen = TerrainGen.decorate(field_76815_a, field_76813_b, field_76814_c, field_76811_d, LAKE); ++ if (doGen && this.field_76808_K) + { + for (j = 0; j < 50; ++j) + { +@@ -292,6 +312,8 @@ + (new WorldGenLiquids(Blocks.field_150356_k)).func_76484_a(this.field_76815_a, this.field_76813_b, k, l, i1); + } + } ++ ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); + } + + protected void func_76795_a(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) +@@ -318,13 +340,29 @@ + + protected void func_76797_b() + { ++ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76823_i, field_76814_c, field_76811_d, DIRT)) + this.func_76795_a(20, this.field_76823_i, 0, 256); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76820_j, field_76814_c, field_76811_d, GRAVEL)) + this.func_76795_a(10, this.field_76820_j, 0, 256); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76821_k, field_76814_c, field_76811_d, COAL)) + this.func_76795_a(20, this.field_76821_k, 0, 128); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76818_l, field_76814_c, field_76811_d, IRON)) + this.func_76795_a(20, this.field_76818_l, 0, 64); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76819_m, field_76814_c, field_76811_d, GOLD)) + this.func_76795_a(2, this.field_76819_m, 0, 32); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76816_n, field_76814_c, field_76811_d, REDSTONE)) + this.func_76795_a(8, this.field_76816_n, 0, 16); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76817_o, field_76814_c, field_76811_d, DIAMOND)) + this.func_76795_a(1, this.field_76817_o, 0, 16); ++ if (TerrainGen.generateOre(field_76815_a, field_76813_b, field_76831_p, field_76814_c, field_76811_d, LAPIS)) + this.func_76793_b(1, this.field_76831_p, 16, 16); ++ MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(field_76815_a, field_76813_b, field_76814_c, field_76811_d)); + } ++ ++ private int nextInt(int i) { ++ if (i <= 1) ++ return 0; ++ return this.field_76813_b.nextInt(i); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenBase.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenBase.java.patch new file mode 100644 index 0000000..a989915 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenBase.java.patch @@ -0,0 +1,152 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenBase.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenBase.java +@@ -42,6 +42,9 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import net.minecraftforge.common.*; ++import net.minecraftforge.event.terraingen.*; ++ + public abstract class BiomeGenBase + { + private static final Logger field_150586_aC = LogManager.getLogger(); +@@ -130,6 +133,10 @@ + + public BiomeGenBase(int p_i1971_1_) + { ++ this(p_i1971_1_, true); ++ } ++ public BiomeGenBase(int p_i1971_1_, boolean register) ++ { + this.field_76752_A = Blocks.field_150349_c; + this.field_150604_aj = 0; + this.field_76753_B = Blocks.field_150346_d; +@@ -148,6 +155,7 @@ + this.field_76758_O = new WorldGenBigTree(false); + this.field_76763_Q = new WorldGenSwamp(); + this.field_76756_M = p_i1971_1_; ++ if (register) + field_76773_a[p_i1971_1_] = this; + this.field_76760_I = this.func_76729_a(); + this.field_76762_K.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); +@@ -163,11 +171,12 @@ + this.field_76761_J.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); + this.field_76755_L.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.field_82914_M.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); ++ this.addDefaultFlowers(); + } + + public BiomeDecorator func_76729_a() + { +- return new BiomeDecorator(); ++ return getModdedBiomeDecorator(new BiomeDecorator()); + } + + public BiomeGenBase func_76732_a(float p_76732_1_, float p_76732_2_) +@@ -335,7 +344,7 @@ + { + double d0 = (double)MathHelper.func_76131_a(this.func_150564_a(p_150558_1_, p_150558_2_, p_150558_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerGrass.func_77480_a(d0, d1); ++ return getModdedBiomeGrassColor(ColorizerGrass.func_77480_a(d0, d1)); + } + + @SideOnly(Side.CLIENT) +@@ -343,7 +352,7 @@ + { + double d0 = (double)MathHelper.func_76131_a(this.func_150564_a(p_150571_1_, p_150571_2_, p_150571_3_), 0.0F, 1.0F); + double d1 = (double)MathHelper.func_76131_a(this.func_76727_i(), 0.0F, 1.0F); +- return ColorizerFoliage.func_77470_a(d0, d1); ++ return getModdedBiomeFoliageColor(ColorizerFoliage.func_77470_a(d0, d1)); + } + + public boolean func_150559_j() +@@ -490,6 +499,88 @@ + } + } + ++ /* ========================================= FORGE START ======================================*/ ++ protected List flowers = new ArrayList(); ++ ++ public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) ++ { ++ return new DeferredBiomeDecorator(original); ++ } ++ ++ public int getWaterColorMultiplier() ++ { ++ BiomeEvent.GetWaterColor event = new BiomeEvent.GetWaterColor(this, field_76759_H); ++ MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ public int getModdedBiomeGrassColor(int original) ++ { ++ BiomeEvent.GetGrassColor event = new BiomeEvent.GetGrassColor(this, original); ++ MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ public int getModdedBiomeFoliageColor(int original) ++ { ++ BiomeEvent.GetFoliageColor event = new BiomeEvent.GetFoliageColor(this, original); ++ MinecraftForge.EVENT_BUS.post(event); ++ return event.newColor; ++ } ++ ++ /** ++ * Weighted random holder class used to hold possible flowers ++ * that can spawn in this biome when bonemeal is used on grass. ++ */ ++ public static class FlowerEntry extends WeightedRandom.Item ++ { ++ public final Block block; ++ public final int metadata; ++ public FlowerEntry(Block block, int meta, int weight) ++ { ++ super(weight); ++ this.block = block; ++ this.metadata = meta; ++ } ++ } ++ ++ /** ++ * Adds the default flowers, as of 1.7, it is 2 yellow, and 1 red. I chose 10 to allow some wiggle room in the numbers. ++ */ ++ public void addDefaultFlowers() ++ { ++ this.flowers.add(new FlowerEntry(Blocks.field_150327_N, 0, 20)); ++ this.flowers.add(new FlowerEntry(Blocks.field_150328_O, 0, 10)); ++ } ++ ++ /** Register a new plant to be planted when bonemeal is used on grass. ++ * @param block The block to place. ++ * @param metadata The metadata to set for the block when being placed. ++ * @param weight The weight of the plant, where red flowers are ++ * 10 and yellow flowers are 20. ++ */ ++ public void addFlower(Block block, int metadata, int weight) ++ { ++ this.flowers.add(new FlowerEntry(block, metadata, weight)); ++ } ++ ++ public void plantFlower(World world, Random rand, int x, int y, int z) ++ { ++ BiomeGenBase biome = world.func_72807_a(x, z); ++ String flowername = biome.func_150572_a(rand, x, y, z); ++ ++ FlowerEntry flower = (FlowerEntry)WeightedRandom.func_76271_a(rand, flowers); ++ if (flower == null || flower.block == null || !flower.block.func_149718_j(world, x, y, z)) ++ { ++ return; ++ } ++ ++ world.func_147465_d(x, y, z, flower.block, flower.metadata, 3); ++ } ++ ++ ++ /* ========================================= FORGE END ======================================*/ ++ + static + { + field_76772_c.func_150566_k(); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenForest.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenForest.java.patch new file mode 100644 index 0000000..9645e31 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenForest.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenForest.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenForest.java +@@ -5,6 +5,7 @@ + import java.util.Random; + import net.minecraft.block.BlockFlower; + import net.minecraft.entity.passive.EntityWolf; ++import net.minecraft.init.Blocks; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; + import net.minecraft.world.gen.feature.WorldGenAbstractTree; +@@ -53,6 +54,15 @@ + { + this.field_76760_I.field_76832_z = -999; + } ++ ++ if (this.field_150632_aF == 1) ++ { ++ this.flowers.clear(); ++ for (int x = 0; x < BlockFlower.field_149859_a.length; x++) ++ { ++ this.addFlower(Blocks.field_150328_O, x == 1 ? 0 : x, 10); ++ } ++ } + } + + public BiomeGenBase func_150557_a(int p_150557_1_, boolean p_150557_2_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenHills.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenHills.java.patch new file mode 100644 index 0000000..4930e6e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenHills.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenHills.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenHills.java +@@ -55,7 +55,7 @@ + j1 = p_76728_2_.nextInt(28) + 4; + int k1 = p_76728_4_ + p_76728_2_.nextInt(16); + +- if (p_76728_1_.func_147439_a(i1, j1, k1) == Blocks.field_150348_b) ++ if (p_76728_1_.func_147439_a(i1, j1, k1).isReplaceableOreGen(p_76728_1_, i1, j1, k1, Blocks.field_150348_b)) + { + p_76728_1_.func_147465_d(i1, j1, k1, Blocks.field_150412_bA, 0, 2); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenJungle.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenJungle.java.patch new file mode 100644 index 0000000..497dbcd --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenJungle.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenJungle.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenJungle.java +@@ -59,7 +59,9 @@ + super.func_76728_a(p_76728_1_, p_76728_2_, p_76728_3_, p_76728_4_); + int k = p_76728_3_ + p_76728_2_.nextInt(16) + 8; + int l = p_76728_4_ + p_76728_2_.nextInt(16) + 8; +- int i1 = p_76728_2_.nextInt(p_76728_1_.func_72976_f(k, l) * 2); ++ int height = p_76728_1_.func_72976_f(k, l) * 2; //This was the original input for the nextInt below. But it could == 0, which crashes nextInt ++ if (height < 1) height = 1; ++ int i1 = p_76728_2_.nextInt(height); + (new WorldGenMelon()).func_76484_a(p_76728_1_, p_76728_2_, k, i1, l); + WorldGenVines worldgenvines = new WorldGenVines(); + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenPlains.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenPlains.java.patch new file mode 100644 index 0000000..b561647 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenPlains.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenPlains.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenPlains.java +@@ -3,6 +3,7 @@ + import java.util.Random; + import net.minecraft.block.BlockFlower; + import net.minecraft.entity.passive.EntityHorse; ++import net.minecraft.init.Blocks; + import net.minecraft.world.World; + + public class BiomeGenPlains extends BiomeGenBase +@@ -19,6 +20,15 @@ + this.field_76760_I.field_76832_z = -999; + this.field_76760_I.field_76802_A = 4; + this.field_76760_I.field_76803_B = 10; ++ this.flowers.clear(); ++ this.addFlower(Blocks.field_150328_O, 4, 3); ++ this.addFlower(Blocks.field_150328_O, 5, 3); ++ this.addFlower(Blocks.field_150328_O, 6, 3); ++ this.addFlower(Blocks.field_150328_O, 7, 3); ++ this.addFlower(Blocks.field_150328_O, 0, 20); ++ this.addFlower(Blocks.field_150328_O, 3, 20); ++ this.addFlower(Blocks.field_150328_O, 8, 20); ++ this.addFlower(Blocks.field_150327_N, 0, 30); + } + + public String func_150572_a(Random p_150572_1_, int p_150572_2_, int p_150572_3_, int p_150572_4_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenSwamp.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenSwamp.java.patch new file mode 100644 index 0000000..719c97a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenSwamp.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java ++++ ../src-work/minecraft/net/minecraft/world/biome/BiomeGenSwamp.java +@@ -30,6 +30,8 @@ + this.field_76760_I.field_76803_B = 5; + this.field_76759_H = 14745518; + this.field_76761_J.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1)); ++ this.flowers.clear(); ++ this.addFlower(Blocks.field_150328_O, 1, 10); + } + + public WorldGenAbstractTree func_150567_a(Random p_150567_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/WorldChunkManager.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/WorldChunkManager.java.patch new file mode 100644 index 0000000..474f786 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/WorldChunkManager.java.patch @@ -0,0 +1,58 @@ +--- ../src-base/minecraft/net/minecraft/world/biome/WorldChunkManager.java ++++ ../src-work/minecraft/net/minecraft/world/biome/WorldChunkManager.java +@@ -3,6 +3,7 @@ + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.ArrayList; ++import java.util.Arrays; + import java.util.List; + import java.util.Random; + import net.minecraft.crash.CrashReport; +@@ -13,9 +14,13 @@ + import net.minecraft.world.WorldType; + import net.minecraft.world.gen.layer.GenLayer; + import net.minecraft.world.gen.layer.IntCache; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.terraingen.WorldTypeEvent; ++import static net.minecraft.world.biome.BiomeGenBase.*; + + public class WorldChunkManager + { ++ public static ArrayList allowedBiomes = new ArrayList(Arrays.asList(field_76767_f, field_76772_c, field_76768_g, field_76784_u, field_76785_t, field_76782_w, field_76792_x)); + private GenLayer field_76944_d; + private GenLayer field_76945_e; + private BiomeCache field_76942_f; +@@ -26,19 +31,14 @@ + { + this.field_76942_f = new BiomeCache(this); + this.field_76943_g = new ArrayList(); +- this.field_76943_g.add(BiomeGenBase.field_76767_f); +- this.field_76943_g.add(BiomeGenBase.field_76772_c); +- this.field_76943_g.add(BiomeGenBase.field_76768_g); +- this.field_76943_g.add(BiomeGenBase.field_76784_u); +- this.field_76943_g.add(BiomeGenBase.field_76785_t); +- this.field_76943_g.add(BiomeGenBase.field_76782_w); +- this.field_76943_g.add(BiomeGenBase.field_76792_x); ++ this.field_76943_g.addAll(allowedBiomes); + } + + public WorldChunkManager(long p_i1975_1_, WorldType p_i1975_3_) + { + this(); + GenLayer[] agenlayer = GenLayer.func_75901_a(p_i1975_1_, p_i1975_3_); ++ agenlayer = getModdedBiomeGenerators(p_i1975_3_, p_i1975_1_, agenlayer); + this.field_76944_d = agenlayer[0]; + this.field_76945_e = agenlayer[1]; + } +@@ -242,4 +242,11 @@ + { + this.field_76942_f.func_76838_a(); + } ++ ++ public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) ++ { ++ WorldTypeEvent.InitBiomeGens event = new WorldTypeEvent.InitBiomeGens(worldType, seed, original); ++ MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ return event.newBiomeGens; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/Chunk.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/Chunk.java.patch new file mode 100644 index 0000000..ed5c14c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/Chunk.java.patch @@ -0,0 +1,323 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/Chunk.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/Chunk.java +@@ -29,6 +29,10 @@ + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.biome.WorldChunkManager; + import net.minecraft.world.chunk.storage.ExtendedBlockStorage; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.entity.EntityEvent; ++import net.minecraftforge.event.world.ChunkEvent; ++ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -194,7 +198,7 @@ + { + Block block = this.func_150810_a(j, l - 1, k); + +- if (block.func_149717_k() == 0) ++ if (func_150808_b(j, l - 1, k) == 0) + { + --l; + continue; +@@ -493,7 +497,9 @@ + + public int func_150808_b(int p_150808_1_, int p_150808_2_, int p_150808_3_) + { +- return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).func_149717_k(); ++ int x = (field_76635_g << 4) + p_150808_1_; ++ int z = (field_76647_h << 4) + p_150808_3_; ++ return this.func_150810_a(p_150808_1_, p_150808_2_, p_150808_3_).getLightOpacity(field_76637_e, x, p_150808_2_, z); + } + + public Block func_150810_a(final int p_150810_1_, final int p_150810_2_, final int p_150810_3_) +@@ -579,20 +585,33 @@ + int l1 = this.field_76635_g * 16 + p_150807_1_; + int i2 = this.field_76647_h * 16 + p_150807_3_; + ++ int k2 = block1.getLightOpacity(this.field_76637_e, l1, p_150807_2_, i2); ++ + if (!this.field_76637_e.field_72995_K) + { + block1.func_149725_f(this.field_76637_e, l1, p_150807_2_, i2, k1); + } + + extendedblockstorage.func_150818_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_4_); ++ extendedblockstorage.func_76654_b(p_150807_1_, p_150807_2_ & 15, p_150807_3_, p_150807_5_); // This line duplicates the one below, so breakBlock fires with valid worldstate + + if (!this.field_76637_e.field_72995_K) + { + block1.func_149749_a(this.field_76637_e, l1, p_150807_2_, i2, block1, k1); ++ // After breakBlock a phantom TE might have been created with incorrect meta. This attempts to kill that phantom TE so the normal one can be create properly later ++ TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); ++ if (te != null && te.shouldRefresh(block1, func_150810_a(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F), k1, func_76628_c(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F), field_76637_e, l1, p_150807_2_, i2)) ++ { ++ this.func_150805_f(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); ++ } + } +- else if (block1 instanceof ITileEntityProvider && block1 != p_150807_4_) ++ else if (block1.hasTileEntity(k1)) + { +- this.field_76637_e.func_147475_p(l1, p_150807_2_, i2); ++ TileEntity te = this.getTileEntityUnsafe(p_150807_1_ & 0x0F, p_150807_2_, p_150807_3_ & 0x0F); ++ if (te != null && te.shouldRefresh(block1, p_150807_4_, k1, p_150807_5_, field_76637_e, l1, p_150807_2_, i2)) ++ { ++ this.field_76637_e.func_147475_p(l1, p_150807_2_, i2); ++ } + } + + if (extendedblockstorage.func_150819_a(p_150807_1_, p_150807_2_ & 15, p_150807_3_) != p_150807_4_) +@@ -609,8 +628,7 @@ + } + else + { +- int j2 = p_150807_4_.func_149717_k(); +- int k2 = block1.func_149717_k(); ++ int j2 = p_150807_4_.getLightOpacity(this.field_76637_e, l1, p_150807_2_, i2); + + if (j2 > 0) + { +@@ -632,34 +650,19 @@ + + TileEntity tileentity; + +- if (block1 instanceof ITileEntityProvider) +- { +- tileentity = this.func_150806_e(p_150807_1_, p_150807_2_, p_150807_3_); +- +- if (tileentity != null) +- { +- tileentity.func_145836_u(); +- } +- } +- + if (!this.field_76637_e.field_72995_K) + { + p_150807_4_.func_149726_b(this.field_76637_e, l1, p_150807_2_, i2); + } + +- if (p_150807_4_ instanceof ITileEntityProvider) ++ if (p_150807_4_.hasTileEntity(p_150807_5_)) + { + tileentity = this.func_150806_e(p_150807_1_, p_150807_2_, p_150807_3_); + +- if (tileentity == null) +- { +- tileentity = ((ITileEntityProvider)p_150807_4_).func_149915_a(this.field_76637_e, p_150807_5_); +- this.field_76637_e.func_147455_a(l1, p_150807_2_, i2, tileentity); +- } +- + if (tileentity != null) + { + tileentity.func_145836_u(); ++ tileentity.field_145847_g = p_150807_5_; + } + } + +@@ -690,7 +693,7 @@ + this.field_76643_l = true; + extendedblockstorage.func_76654_b(p_76589_1_, p_76589_2_ & 15, p_76589_3_, p_76589_4_); + +- if (extendedblockstorage.func_150819_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_) instanceof ITileEntityProvider) ++ if (extendedblockstorage.func_150819_a(p_76589_1_, p_76589_2_ & 15, p_76589_3_).hasTileEntity(p_76589_4_)) + { + TileEntity tileentity = this.func_150806_e(p_76589_1_, p_76589_2_, p_76589_3_); + +@@ -790,6 +793,7 @@ + k = this.field_76645_j.length - 1; + } + ++ MinecraftForge.EVENT_BUS.post(new EntityEvent.EnteringChunk(p_76612_1_, this.field_76635_g, this.field_76647_h, p_76612_1_.field_70176_ah, p_76612_1_.field_70164_aj)); + p_76612_1_.field_70175_ag = true; + p_76612_1_.field_70176_ah = this.field_76635_g; + p_76612_1_.field_70162_ai = k; +@@ -827,28 +831,27 @@ + ChunkPosition chunkposition = new ChunkPosition(p_150806_1_, p_150806_2_, p_150806_3_); + TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); + ++ if (tileentity != null && tileentity.func_145837_r()) ++ { ++ field_150816_i.remove(chunkposition); ++ tileentity = null; ++ } ++ + if (tileentity == null) + { + Block block = this.func_150810_a(p_150806_1_, p_150806_2_, p_150806_3_); ++ int meta = this.func_76628_c(p_150806_1_, p_150806_2_, p_150806_3_); + +- if (!block.func_149716_u()) ++ if (!block.hasTileEntity(meta)) + { + return null; + } + +- tileentity = ((ITileEntityProvider)block).func_149915_a(this.field_76637_e, this.func_76628_c(p_150806_1_, p_150806_2_, p_150806_3_)); ++ tileentity = block.createTileEntity(field_76637_e, meta); + this.field_76637_e.func_147455_a(this.field_76635_g * 16 + p_150806_1_, p_150806_2_, this.field_76647_h * 16 + p_150806_3_, tileentity); + } + +- if (tileentity != null && tileentity.func_145837_r()) +- { +- this.field_150816_i.remove(chunkposition); +- return null; +- } +- else +- { +- return tileentity; +- } ++ return tileentity; + } + + public void func_150813_a(TileEntity p_150813_1_) +@@ -860,7 +863,7 @@ + + if (this.field_76636_d) + { +- this.field_76637_e.field_147482_g.add(p_150813_1_); ++ this.field_76637_e.addTileEntity(p_150813_1_); + } + } + +@@ -872,7 +875,8 @@ + p_150812_4_.field_145848_d = p_150812_2_; + p_150812_4_.field_145849_e = this.field_76647_h * 16 + p_150812_3_; + +- if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_) instanceof ITileEntityProvider) ++ int metadata = func_76628_c(p_150812_1_, p_150812_2_, p_150812_3_); ++ if (this.func_150810_a(p_150812_1_, p_150812_2_, p_150812_3_).hasTileEntity(metadata)) + { + if (this.field_150816_i.containsKey(chunkposition)) + { +@@ -916,6 +920,7 @@ + + this.field_76637_e.func_72868_a(this.field_76645_j[i]); + } ++ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Load(this)); + } + + public void func_76623_d() +@@ -933,6 +938,7 @@ + { + this.field_76637_e.func_72828_b(this.field_76645_j[i]); + } ++ MinecraftForge.EVENT_BUS.post(new ChunkEvent.Unload(this)); + } + + public void func_76630_e() +@@ -942,8 +948,8 @@ + + public void func_76588_a(Entity p_76588_1_, AxisAlignedBB p_76588_2_, List p_76588_3_, IEntitySelector p_76588_4_) + { +- int i = MathHelper.func_76128_c((p_76588_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_76588_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_76588_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_76588_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); + +@@ -979,8 +985,8 @@ + + public void func_76618_a(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_) + { +- int i = MathHelper.func_76128_c((p_76618_2_.field_72338_b - 2.0D) / 16.0D); +- int j = MathHelper.func_76128_c((p_76618_2_.field_72337_e + 2.0D) / 16.0D); ++ int i = MathHelper.func_76128_c((p_76618_2_.field_72338_b - World.MAX_ENTITY_RADIUS) / 16.0D); ++ int j = MathHelper.func_76128_c((p_76618_2_.field_72337_e + World.MAX_ENTITY_RADIUS) / 16.0D); + i = MathHelper.func_76125_a(i, 0, this.field_76645_j.length - 1); + j = MathHelper.func_76125_a(j, 0, this.field_76645_j.length - 1); + +@@ -1139,6 +1145,15 @@ + @SideOnly(Side.CLIENT) + public void func_76607_a(byte[] p_76607_1_, int p_76607_2_, int p_76607_3_, boolean p_76607_4_) + { ++ Iterator iterator = field_150816_i.values().iterator(); ++ while(iterator.hasNext()) ++ { ++ TileEntity tileEntity = (TileEntity)iterator.next(); ++ tileEntity.func_145836_u(); ++ tileEntity.func_145832_p(); ++ tileEntity.func_145838_q(); ++ } ++ + int k = 0; + boolean flag1 = !this.field_76637_e.field_73011_w.field_76576_e; + int l; +@@ -1241,13 +1256,27 @@ + this.field_150814_l = true; + this.field_76646_k = true; + this.func_76590_a(); +- Iterator iterator = this.field_150816_i.values().iterator(); ++ List invalidList = new ArrayList(); ++ iterator = this.field_150816_i.values().iterator(); + + while (iterator.hasNext()) + { + TileEntity tileentity = (TileEntity)iterator.next(); ++ int x = tileentity.field_145851_c & 15; ++ int y = tileentity.field_145848_d; ++ int z = tileentity.field_145849_e & 15; ++ Block block = tileentity.func_145838_q(); ++ if ((block != func_150810_a(x, y, z) || tileentity.field_145847_g != this.func_76628_c(x, y, z)) && tileentity.shouldRefresh(block, func_150810_a(x, y, z), tileentity.field_145847_g, this.func_76628_c(x, y, z), field_76637_e, x, y, z)) ++ { ++ invalidList.add(tileentity); ++ } + tileentity.func_145836_u(); + } ++ ++ for (TileEntity te : invalidList) ++ { ++ te.func_145843_s(); ++ } + } + + public BiomeGenBase func_76591_a(int p_76591_1_, int p_76591_2_, WorldChunkManager p_76591_3_) +@@ -1450,4 +1479,48 @@ + + return true; + } ++ ++ /** ++ * Retrieves the tile entity, WITHOUT creating it. ++ * Good for checking if it exists. ++ * ++ * @param x ++ * @param y ++ * @param z ++ * @return The tile entity at the specified location, if it exists and is valid. ++ */ ++ public TileEntity getTileEntityUnsafe(int x, int y, int z) ++ { ++ ChunkPosition chunkposition = new ChunkPosition(x, y, z); ++ TileEntity tileentity = (TileEntity)this.field_150816_i.get(chunkposition); ++ ++ if (tileentity != null && tileentity.func_145837_r()) ++ { ++ field_150816_i.remove(chunkposition); ++ tileentity = null; ++ } ++ ++ return tileentity; ++ } ++ ++ /** ++ * Removes the tile entity at the specified position, only if it's ++ * marked as invalid. ++ * ++ * @param x ++ * @param y ++ * @param z ++ */ ++ public void removeInvalidTileEntity(int x, int y, int z) ++ { ++ ChunkPosition position = new ChunkPosition(x, y, z); ++ if (field_76636_d) ++ { ++ TileEntity entity = (TileEntity)field_150816_i.get(position); ++ if (entity != null && entity.func_145837_r()) ++ { ++ field_150816_i.remove(position); ++ } ++ } ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch new file mode 100644 index 0000000..a2e8f71 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -0,0 +1,163 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +@@ -25,6 +25,8 @@ + import net.minecraft.world.chunk.NibbleArray; + import net.minecraft.world.storage.IThreadedFileIO; + import net.minecraft.world.storage.ThreadedFileIOBase; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.world.ChunkDataEvent; + + import org.apache.logging.log4j.Level; + import org.apache.logging.log4j.LogManager; +@@ -46,8 +48,46 @@ + this.field_75825_d = p_i2003_1_; + } + ++ public boolean chunkExists(World world, int i, int j) ++ { ++ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); ++ ++ synchronized (this.field_75827_c) ++ { ++ if (this.field_75826_b.contains(chunkcoordintpair)) ++ { ++ Iterator iter = this.field_75828_a.iterator(); ++ while (iter.hasNext()) ++ { ++ PendingChunk pendingChunk = (PendingChunk)iter.next(); ++ if (pendingChunk.field_76548_a.equals(chunkcoordintpair)) ++ { ++ return true; ++ } ++ } ++ } ++ } ++ ++ return RegionFileCache.func_76550_a(this.field_75825_d, i, j).chunkExists(i & 31, j & 31); ++ } ++ + 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; ++ } ++ ++ public Object[] loadChunk__Async(World p_75815_1_, int p_75815_2_, int p_75815_3_) throws IOException ++ { + NBTTagCompound nbttagcompound = null; + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_75815_2_, p_75815_3_); + Object object = this.field_75827_c; +@@ -56,11 +96,13 @@ + { + if (this.field_75826_b.contains(chunkcoordintpair)) + { +- for (int k = 0; k < this.field_75828_a.size(); ++k) ++ Iterator iter = this.field_75828_a.iterator(); ++ while (iter.hasNext()) + { +- if (((AnvilChunkLoader.PendingChunk)this.field_75828_a.get(k)).field_76548_a.equals(chunkcoordintpair)) ++ PendingChunk pendingChunk = (PendingChunk)iter.next(); ++ if (pendingChunk.field_76548_a.equals(chunkcoordintpair)) + { +- nbttagcompound = ((AnvilChunkLoader.PendingChunk)this.field_75828_a.get(k)).field_76547_b; ++ nbttagcompound = pendingChunk.field_76547_b; + break; + } + } +@@ -79,11 +121,24 @@ + nbttagcompound = 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); + } + + 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_); ++ ++ if (data != null) ++ { ++ Chunk chunk = (Chunk) data[0]; ++ return chunk; ++ } ++ ++ return null; ++ } ++ ++ 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 " + p_75822_2_ + "," + p_75822_3_ + " is missing level data, skipping"); +@@ -103,10 +158,30 @@ + field_151505_a.error("Chunk file at " + p_75822_2_ + "," + p_75822_3_ + " is in the wrong location; relocating. (Expected " + p_75822_2_ + ", " + p_75822_3_ + ", got " + chunk.field_76635_g + ", " + chunk.field_76647_h + ")"); + p_75822_4_.func_74768_a("xPos", p_75822_2_); + p_75822_4_.func_74768_a("zPos", p_75822_3_); ++ // Have to move tile entities since we don't load them at this stage ++ NBTTagList tileEntities = p_75822_4_.func_74775_l("Level").func_150295_c("TileEntities", 10); ++ ++ if (tileEntities != null) ++ { ++ for (int te = 0; te < tileEntities.func_74745_c(); te++) ++ { ++ NBTTagCompound tileEntity = (NBTTagCompound) tileEntities.func_150305_b(te); ++ int x = tileEntity.func_74762_e("x") - chunk.field_76635_g * 16; ++ int z = tileEntity.func_74762_e("z") - chunk.field_76647_h * 16; ++ tileEntity.func_74768_a("x", p_75822_2_ * 16 + x); ++ tileEntity.func_74768_a("z", p_75822_3_ * 16 + z); ++ } ++ } ++ + chunk = this.func_75823_a(p_75822_1_, p_75822_4_.func_74775_l("Level")); + } + +- 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; + } + } + +@@ -120,6 +195,7 @@ + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound.func_74782_a("Level", nbttagcompound1); + this.func_75820_a(p_75816_2_, p_75816_1_, nbttagcompound1); ++ MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Save(p_75816_2_, nbttagcompound)); + this.func_75824_a(p_75816_2_.func_76632_l(), nbttagcompound); + } + catch (Exception exception) +@@ -373,6 +449,12 @@ + chunk.func_76616_a(p_75823_2_.func_74770_j("Biomes")); + } + ++ // End this method here and split off entity loading to another method ++ return chunk; ++ } ++ ++ public void loadEntities(World p_75823_1_, NBTTagCompound p_75823_2_, Chunk chunk) ++ { + NBTTagList nbttaglist1 = p_75823_2_.func_150295_c("Entities", 10); + + if (nbttaglist1 != null) +@@ -434,7 +516,7 @@ + } + } + +- return chunk; ++ // return chunk; + } + + static class PendingChunk diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch new file mode 100644 index 0000000..dc00369 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilSaveHandler.java +@@ -23,18 +23,12 @@ + File file1 = this.func_75765_b(); + File file2; + +- if (p_75763_1_ instanceof WorldProviderHell) ++ if (p_75763_1_.getSaveFolder() != null) + { +- file2 = new File(file1, "DIM-1"); ++ file2 = new File(file1, p_75763_1_.getSaveFolder()); + file2.mkdirs(); + return new AnvilChunkLoader(file2); + } +- else if (p_75763_1_ instanceof WorldProviderEnd) +- { +- file2 = new File(file1, "DIM1"); +- file2.mkdirs(); +- return new AnvilChunkLoader(file2); +- } + else + { + return new AnvilChunkLoader(file1); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/RegionFile.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/RegionFile.java.patch new file mode 100644 index 0000000..623f8ca --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/RegionFile.java.patch @@ -0,0 +1,42 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/RegionFile.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/RegionFile.java +@@ -104,6 +104,39 @@ + } + } + ++ // This is a copy (sort of) of the method below it, make sure they stay in sync ++ public synchronized boolean chunkExists(int x, int z) ++ { ++ if (this.func_76705_d(x, z)) return false; ++ ++ try ++ { ++ int offset = this.func_76707_e(x, z); ++ ++ if (offset == 0) return false; ++ ++ int sectorNumber = offset >> 8; ++ int numSectors = offset & 255; ++ ++ if (sectorNumber + numSectors > this.field_76714_f.size()) return false; ++ ++ this.field_76719_c.seek((long)(sectorNumber * 4096)); ++ int length = this.field_76719_c.readInt(); ++ ++ if (length > 4096 * numSectors || length <= 0) return false; ++ ++ byte version = this.field_76719_c.readByte(); ++ ++ if (version == 1 || version == 2) return true; ++ } ++ catch (IOException ioexception) ++ { ++ return false; ++ } ++ ++ return false; ++ } ++ + public synchronized DataInputStream func_76704_a(int p_76704_1_, int p_76704_2_) + { + if (this.func_76705_d(p_76704_1_, p_76704_2_)) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderEnd.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderEnd.java.patch new file mode 100644 index 0000000..969358f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderEnd.java.patch @@ -0,0 +1,88 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderEnd.java +@@ -15,6 +15,10 @@ + import net.minecraft.world.chunk.Chunk; + import net.minecraft.world.chunk.IChunkProvider; + ++import net.minecraftforge.common.*; ++import cpw.mods.fml.common.eventhandler.Event.*; ++import net.minecraftforge.event.terraingen.*; ++ + public class ChunkProviderEnd implements IChunkProvider + { + private Random field_73204_i; +@@ -43,6 +47,14 @@ + this.field_73199_l = new NoiseGeneratorOctaves(this.field_73204_i, 8); + this.field_73196_a = new NoiseGeneratorOctaves(this.field_73204_i, 10); + this.field_73194_b = new NoiseGeneratorOctaves(this.field_73204_i, 16); ++ ++ NoiseGenerator[] noiseGens = {field_73201_j, field_73202_k, field_73199_l, field_73196_a, field_73194_b}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2007_1_, this.field_73204_i, noiseGens); ++ this.field_73201_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73202_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73199_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73196_a = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73194_b = (NoiseGeneratorOctaves)noiseGens[4]; + } + + public void func_147420_a(int p_147420_1_, int p_147420_2_, Block[] p_147420_3_, BiomeGenBase[] p_147420_4_) +@@ -113,8 +125,17 @@ + } + } + ++ @Deprecated // Supply metadata to the below function. + public void func_147421_b(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_) + { ++ replaceBiomeBlocks(p_147421_1_, p_147421_2_, p_147421_3_, p_147421_4_, new byte[p_147421_3_.length]); ++ } ++ public void replaceBiomeBlocks(int p_147421_1_, int p_147421_2_, Block[] p_147421_3_, BiomeGenBase[] p_147421_4_, byte[] meta) ++ { ++ ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147421_1_, p_147421_2_, p_147421_3_, meta, p_147421_4_, this.field_73200_m); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == Result.DENY) return; ++ + for (int k = 0; k < 16; ++k) + { + for (int l = 0; l < 16; ++l) +@@ -177,10 +198,11 @@ + { + this.field_73204_i.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[32768]; ++ byte[] meta = new byte[ablock.length]; + this.field_73198_o = this.field_73200_m.func_72959_q().func_76933_b(this.field_73198_o, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); + this.func_147420_a(p_73154_1_, p_73154_2_, ablock, this.field_73198_o); +- this.func_147421_b(p_73154_1_, p_73154_2_, ablock, this.field_73198_o); +- Chunk chunk = new Chunk(this.field_73200_m, ablock, p_73154_1_, p_73154_2_); ++ this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, this.field_73198_o, meta); ++ Chunk chunk = new Chunk(this.field_73200_m, ablock, meta, p_73154_1_, p_73154_2_); + byte[] abyte = chunk.func_76605_m(); + + for (int k = 0; k < abyte.length; ++k) +@@ -194,6 +216,10 @@ + + private double[] func_73187_a(double[] p_73187_1_, int p_73187_2_, int p_73187_3_, int p_73187_4_, int p_73187_5_, int p_73187_6_, int p_73187_7_) + { ++ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73187_1_, p_73187_2_, p_73187_3_, p_73187_4_, p_73187_5_, p_73187_6_, p_73187_7_); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == Result.DENY) return event.noisefield; ++ + if (p_73187_1_ == null) + { + p_73187_1_ = new double[p_73187_5_ * p_73187_6_ * p_73187_7_]; +@@ -335,10 +361,16 @@ + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.field_149832_M = true; ++ ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); ++ + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + BiomeGenBase biomegenbase = this.field_73200_m.func_72807_a(k + 16, l + 16); + biomegenbase.func_76728_a(this.field_73200_m, this.field_73200_m.field_73012_v, k, l); ++ ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73200_m, field_73200_m.field_73012_v, p_73153_2_, p_73153_3_, false)); ++ + BlockFalling.field_149832_M = false; + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderGenerate.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderGenerate.java.patch new file mode 100644 index 0000000..fbc9345 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderGenerate.java.patch @@ -0,0 +1,123 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderGenerate.java +@@ -22,6 +22,12 @@ + import net.minecraft.world.gen.structure.MapGenStronghold; + import net.minecraft.world.gen.structure.MapGenVillage; + ++import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*; ++import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*; ++import net.minecraftforge.common.*; ++import cpw.mods.fml.common.eventhandler.Event.*; ++import net.minecraftforge.event.terraingen.*; ++ + public class ChunkProviderGenerate implements IChunkProvider + { + private Random field_73220_k; +@@ -52,6 +58,15 @@ + int[][] field_73219_j = new int[32][32]; + private static final String __OBFID = "CL_00000396"; + ++ { ++ field_73226_t = TerrainGen.getModdedMapGen(field_73226_t, CAVE); ++ field_73225_u = (MapGenStronghold) TerrainGen.getModdedMapGen(field_73225_u, STRONGHOLD); ++ field_73224_v = (MapGenVillage) TerrainGen.getModdedMapGen(field_73224_v, VILLAGE); ++ field_73223_w = (MapGenMineshaft) TerrainGen.getModdedMapGen(field_73223_w, MINESHAFT); ++ field_73233_x = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(field_73233_x, SCATTERED_FEATURE); ++ field_73232_y = TerrainGen.getModdedMapGen(field_73232_y, RAVINE); ++ } ++ + public ChunkProviderGenerate(World p_i2006_1_, long p_i2006_2_, boolean p_i2006_4_) + { + this.field_73230_p = p_i2006_1_; +@@ -76,6 +91,16 @@ + this.field_147433_r[j + 2 + (k + 2) * 5] = f; + } + } ++ ++ NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, field_73214_a, field_73212_b, field_73213_c}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2006_1_, this.field_73220_k, noiseGens); ++ this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; ++ this.field_73214_a = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73212_b = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73213_c = (NoiseGeneratorOctaves)noiseGens[6]; + } + + public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) +@@ -157,6 +182,10 @@ + + public void func_147422_a(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) + { ++ ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_4_, p_147422_5_, this.field_73230_p); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == Result.DENY) return; ++ + double d0 = 0.03125D; + this.field_73227_s = this.field_147430_m.func_151599_a(this.field_73227_s, (double)(p_147422_1_ * 16), (double)(p_147422_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + +@@ -345,6 +374,8 @@ + this.field_73220_k.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.field_73230_p.func_72905_C()); + boolean flag = false; + ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); ++ + if (this.field_73229_q) + { + this.field_73223_w.func_75051_a(this.field_73230_p, this.field_73220_k, p_73153_2_, p_73153_3_); +@@ -357,7 +388,8 @@ + int l1; + int i2; + +- if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && !flag && this.field_73220_k.nextInt(4) == 0) ++ if (biomegenbase != BiomeGenBase.field_76769_d && biomegenbase != BiomeGenBase.field_76786_s && !flag && this.field_73220_k.nextInt(4) == 0 ++ && TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, LAKE)) + { + k1 = k + this.field_73220_k.nextInt(16) + 8; + l1 = this.field_73220_k.nextInt(256); +@@ -365,7 +397,7 @@ + (new WorldGenLakes(Blocks.field_150355_j)).func_76484_a(this.field_73230_p, this.field_73220_k, k1, l1, i2); + } + +- if (!flag && this.field_73220_k.nextInt(8) == 0) ++ if (TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, LAVA) && !flag && this.field_73220_k.nextInt(8) == 0) + { + k1 = k + this.field_73220_k.nextInt(16) + 8; + l1 = this.field_73220_k.nextInt(this.field_73220_k.nextInt(248) + 8); +@@ -377,7 +409,8 @@ + } + } + +- for (k1 = 0; k1 < 8; ++k1) ++ boolean doGen = TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, DUNGEON); ++ for (k1 = 0; doGen && k1 < 8; ++k1) + { + l1 = k + this.field_73220_k.nextInt(16) + 8; + i2 = this.field_73220_k.nextInt(256); +@@ -386,11 +419,15 @@ + } + + biomegenbase.func_76728_a(this.field_73230_p, this.field_73220_k, k, l); ++ if (TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, ANIMALS)) ++ { + SpawnerAnimals.func_77191_a(this.field_73230_p, biomegenbase, k + 8, l + 8, 16, 16, this.field_73220_k); ++ } + k += 8; + l += 8; + +- for (k1 = 0; k1 < 16; ++k1) ++ doGen = TerrainGen.populate(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag, ICE); ++ for (k1 = 0; doGen && k1 < 16; ++k1) + { + for (l1 = 0; l1 < 16; ++l1) + { +@@ -408,6 +445,8 @@ + } + } + ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73230_p, field_73220_k, p_73153_2_, p_73153_3_, flag)); ++ + BlockFalling.field_149832_M = false; + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderHell.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderHell.java.patch new file mode 100644 index 0000000..ad4cba8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderHell.java.patch @@ -0,0 +1,182 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderHell.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderHell.java +@@ -21,6 +21,14 @@ + import net.minecraft.world.gen.feature.WorldGenMinable; + import net.minecraft.world.gen.structure.MapGenNetherBridge; + ++import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; ++import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.*; ++import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*; ++import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; ++import net.minecraftforge.common.*; ++import cpw.mods.fml.common.eventhandler.Event.*; ++import net.minecraftforge.event.terraingen.*; ++ + public class ChunkProviderHell implements IChunkProvider + { + private Random field_73181_i; +@@ -45,6 +53,11 @@ + double[] field_73180_h; + private static final String __OBFID = "CL_00000392"; + ++ { ++ field_73172_c = (MapGenNetherBridge) TerrainGen.getModdedMapGen(field_73172_c, NETHER_BRIDGE); ++ field_73182_t = TerrainGen.getModdedMapGen(field_73182_t, NETHER_CAVE); ++ } ++ + public ChunkProviderHell(World p_i2005_1_, long p_i2005_2_) + { + this.field_73175_o = p_i2005_1_; +@@ -56,6 +69,16 @@ + this.field_73174_n = new NoiseGeneratorOctaves(this.field_73181_i, 4); + this.field_73173_a = new NoiseGeneratorOctaves(this.field_73181_i, 10); + this.field_73171_b = new NoiseGeneratorOctaves(this.field_73181_i, 16); ++ ++ NoiseGenerator[] noiseGens = {field_73178_j, field_73179_k, field_73176_l, field_73177_m, field_73174_n, field_73173_a, field_73171_b}; ++ noiseGens = TerrainGen.getModdedNoiseGenerators(p_i2005_1_, this.field_73181_i, noiseGens); ++ this.field_73178_j = (NoiseGeneratorOctaves)noiseGens[0]; ++ this.field_73179_k = (NoiseGeneratorOctaves)noiseGens[1]; ++ this.field_73176_l = (NoiseGeneratorOctaves)noiseGens[2]; ++ this.field_73177_m = (NoiseGeneratorOctaves)noiseGens[3]; ++ this.field_73174_n = (NoiseGeneratorOctaves)noiseGens[4]; ++ this.field_73173_a = (NoiseGeneratorOctaves)noiseGens[5]; ++ this.field_73171_b = (NoiseGeneratorOctaves)noiseGens[6]; + } + + public void func_147419_a(int p_147419_1_, int p_147419_2_, Block[] p_147419_3_) +@@ -132,8 +155,17 @@ + } + } + ++ @Deprecated //You should provide meatadata and biome data in the below method + public void func_147418_b(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_) + { ++ replaceBiomeBlocks(p_147418_1_, p_147418_2_, p_147418_3_, new byte[p_147418_3_.length], null); ++ } ++ public void replaceBiomeBlocks(int p_147418_1_, int p_147418_2_, Block[] p_147418_3_, byte[] meta, BiomeGenBase[] biomes) ++ { ++ ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147418_1_, p_147418_2_, p_147418_3_, meta, biomes, this.field_73175_o); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == Result.DENY) return; ++ + byte b0 = 64; + double d0 = 0.03125D; + this.field_73185_q = this.field_73177_m.func_76304_a(this.field_73185_q, p_147418_1_ * 16, p_147418_2_ * 16, 0, 16, 16, 1, d0, d0, 1.0D); +@@ -234,12 +266,13 @@ + { + this.field_73181_i.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); + Block[] ablock = new Block[32768]; ++ byte[] meta = new byte[ablock.length]; ++ BiomeGenBase[] abiomegenbase = this.field_73175_o.func_72959_q().func_76933_b((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); //Forge Move up to allow for passing to replaceBiomeBlocks + this.func_147419_a(p_73154_1_, p_73154_2_, ablock); +- this.func_147418_b(p_73154_1_, p_73154_2_, ablock); ++ this.replaceBiomeBlocks(p_73154_1_, p_73154_2_, ablock, meta, abiomegenbase); + this.field_73182_t.func_151539_a(this, this.field_73175_o, p_73154_1_, p_73154_2_, ablock); + this.field_73172_c.func_151539_a(this, this.field_73175_o, p_73154_1_, p_73154_2_, ablock); +- Chunk chunk = new Chunk(this.field_73175_o, ablock, p_73154_1_, p_73154_2_); +- BiomeGenBase[] abiomegenbase = this.field_73175_o.func_72959_q().func_76933_b((BiomeGenBase[])null, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); ++ Chunk chunk = new Chunk(this.field_73175_o, ablock, meta, p_73154_1_, p_73154_2_); + byte[] abyte = chunk.func_76605_m(); + + for (int k = 0; k < abyte.length; ++k) +@@ -253,6 +286,10 @@ + + private double[] func_73164_a(double[] p_73164_1_, int p_73164_2_, int p_73164_3_, int p_73164_4_, int p_73164_5_, int p_73164_6_, int p_73164_7_) + { ++ ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, p_73164_1_, p_73164_2_, p_73164_3_, p_73164_4_, p_73164_5_, p_73164_6_, p_73164_7_); ++ MinecraftForge.EVENT_BUS.post(event); ++ if (event.getResult() == Result.DENY) return event.noisefield; ++ + if (p_73164_1_ == null) + { + p_73164_1_ = new double[p_73164_5_ * p_73164_6_ * p_73164_7_]; +@@ -399,6 +436,9 @@ + public void func_73153_a(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) + { + BlockFalling.field_149832_M = true; ++ ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); ++ + int k = p_73153_2_ * 16; + int l = p_73153_3_ * 16; + this.field_73172_c.func_75051_a(this.field_73175_o, this.field_73181_i, p_73153_2_, p_73153_3_); +@@ -407,7 +447,8 @@ + int k1; + int l1; + +- for (i1 = 0; i1 < 8; ++i1) ++ boolean doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, NETHER_LAVA); ++ for (i1 = 0; doGen && i1 < 8; ++i1) + { + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(120) + 4; +@@ -418,7 +459,8 @@ + i1 = this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1) + 1; + int i2; + +- for (j1 = 0; j1 < i1; ++j1) ++ doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, FIRE); ++ for (j1 = 0; doGen && j1 < i1; ++j1) + { + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(120) + 4; +@@ -428,7 +470,8 @@ + + i1 = this.field_73181_i.nextInt(this.field_73181_i.nextInt(10) + 1); + +- for (j1 = 0; j1 < i1; ++j1) ++ doGen = TerrainGen.populate(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false, GLOWSTONE); ++ for (j1 = 0; doGen && j1 < i1; ++j1) + { + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(120) + 4; +@@ -436,7 +479,7 @@ + (new WorldGenGlowStone1()).func_76484_a(this.field_73175_o, this.field_73181_i, k1, l1, i2); + } + +- for (j1 = 0; j1 < 10; ++j1) ++ for (j1 = 0; doGen && j1 < 10; ++j1) + { + k1 = k + this.field_73181_i.nextInt(16) + 8; + l1 = this.field_73181_i.nextInt(128); +@@ -444,7 +487,10 @@ + (new WorldGenGlowStone2()).func_76484_a(this.field_73175_o, this.field_73181_i, k1, l1, i2); + } + +- if (this.field_73181_i.nextInt(1) == 0) ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(field_73175_o, field_73181_i, k, l)); ++ ++ doGen = TerrainGen.decorate(field_73175_o, field_73181_i, k, l, SHROOM); ++ if (doGen && this.field_73181_i.nextInt(1) == 0) + { + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(128); +@@ -452,7 +498,7 @@ + (new WorldGenFlowers(Blocks.field_150338_P)).func_76484_a(this.field_73175_o, this.field_73181_i, j1, k1, l1); + } + +- if (this.field_73181_i.nextInt(1) == 0) ++ if (doGen && this.field_73181_i.nextInt(1) == 0) + { + j1 = k + this.field_73181_i.nextInt(16) + 8; + k1 = this.field_73181_i.nextInt(128); +@@ -463,7 +509,8 @@ + WorldGenMinable worldgenminable = new WorldGenMinable(Blocks.field_150449_bY, 13, Blocks.field_150424_aL); + int j2; + +- for (k1 = 0; k1 < 16; ++k1) ++ doGen = TerrainGen.generateOre(field_73175_o, field_73181_i, worldgenminable, k, l, QUARTZ); ++ for (k1 = 0; doGen && k1 < 16; ++k1) + { + l1 = k + this.field_73181_i.nextInt(16); + i2 = this.field_73181_i.nextInt(108) + 10; +@@ -479,6 +526,9 @@ + (new WorldGenHellLava(Blocks.field_150356_k, true)).func_76484_a(this.field_73175_o, this.field_73181_i, l1, i2, j2); + } + ++ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(field_73175_o, field_73181_i, k, l)); ++ MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, field_73175_o, field_73181_i, p_73153_2_, p_73153_3_, false)); ++ + BlockFalling.field_149832_M = false; + } + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderServer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderServer.java.patch new file mode 100644 index 0000000..270087a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -0,0 +1,132 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +@@ -24,7 +24,12 @@ + import net.minecraft.world.chunk.Chunk; + import net.minecraft.world.chunk.EmptyChunk; + import net.minecraft.world.chunk.IChunkProvider; ++import net.minecraft.world.chunk.storage.AnvilChunkLoader; + import net.minecraft.world.chunk.storage.IChunkLoader; ++import net.minecraftforge.common.DimensionManager; ++import net.minecraftforge.common.ForgeChunkManager; ++import net.minecraftforge.common.chunkio.ChunkIOExecutor; ++ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -39,6 +44,7 @@ + public LongHashMap field_73244_f = new LongHashMap(); + public List field_73245_g = new ArrayList(); + public WorldServer field_73251_h; ++ private Set loadingChunks = com.google.common.collect.Sets.newHashSet(); + private static final String __OBFID = "CL_00001436"; + + public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_) +@@ -61,7 +67,7 @@ + + public void func_73241_b(int p_73241_1_, int p_73241_2_) + { +- if (this.field_73251_h.field_73011_w.func_76567_e()) ++ if (this.field_73251_h.field_73011_w.func_76567_e() && DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.field_76574_g)) + { + ChunkCoordinates chunkcoordinates = this.field_73251_h.func_72861_E(); + int k = p_73241_1_ * 16 + 8 - chunkcoordinates.field_71574_a; +@@ -92,13 +98,66 @@ + + public Chunk func_73158_c(int p_73158_1_, int p_73158_2_) + { ++ return loadChunk(p_73158_1_, p_73158_2_, null); ++ } ++ ++ public Chunk loadChunk(int par1, int par2, Runnable runnable) ++ { ++ long k = ChunkCoordIntPair.func_77272_a(par1, par2); ++ this.field_73248_b.remove(Long.valueOf(k)); ++ Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(k); ++ AnvilChunkLoader loader = null; ++ ++ if (this.field_73247_e instanceof AnvilChunkLoader) ++ { ++ loader = (AnvilChunkLoader) this.field_73247_e; ++ } ++ ++ // We can only use the queue for already generated chunks ++ if (chunk == null && loader != null && loader.chunkExists(this.field_73251_h, par1, par2)) ++ { ++ if (runnable != null) ++ { ++ ChunkIOExecutor.queueChunkLoad(this.field_73251_h, loader, this, par1, par2, runnable); ++ return null; ++ } ++ else ++ { ++ chunk = ChunkIOExecutor.syncChunkLoad(this.field_73251_h, loader, this, par1, par2); ++ } ++ } ++ else if (chunk == null) ++ { ++ chunk = this.originalLoadChunk(par1, par2); ++ } ++ ++ // If we didn't load the chunk async and have a callback run it now ++ if (runnable != null) ++ { ++ runnable.run(); ++ } ++ ++ return chunk; ++ } ++ ++ public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_) ++ { + long k = ChunkCoordIntPair.func_77272_a(p_73158_1_, p_73158_2_); + this.field_73248_b.remove(Long.valueOf(k)); + Chunk chunk = (Chunk)this.field_73244_f.func_76164_a(k); + + if (chunk == null) + { +- chunk = this.func_73239_e(p_73158_1_, p_73158_2_); ++ boolean added = loadingChunks.add(k); ++ if (!added) ++ { ++ cpw.mods.fml.common.FMLLog.bigWarning("There is an attempt to load a chunk (%d,%d) in dimension %d that is already being loaded. This will cause weird chunk breakages.", p_73158_1_, p_73158_2_, field_73251_h.field_73011_w.field_76574_g); ++ } ++ chunk = ForgeChunkManager.fetchDormantChunk(k, this.field_73251_h); ++ if (chunk == null) ++ { ++ chunk = this.func_73239_e(p_73158_1_, p_73158_2_); ++ } + + if (chunk == null) + { +@@ -126,6 +185,7 @@ + + this.field_73244_f.func_76163_a(k, chunk); + this.field_73245_g.add(chunk); ++ loadingChunks.remove(k); + chunk.func_76631_c(); + chunk.func_76624_a(this, this, p_73158_1_, p_73158_2_); + } +@@ -265,6 +325,11 @@ + { + if (!this.field_73251_h.field_73058_d) + { ++ for (ChunkCoordIntPair forced : this.field_73251_h.getPersistentChunks().keySet()) ++ { ++ this.field_73248_b.remove(ChunkCoordIntPair.func_77272_a(forced.field_77276_a, forced.field_77275_b)); ++ } ++ + for (int i = 0; i < 100; ++i) + { + if (!this.field_73248_b.isEmpty()) +@@ -278,6 +343,11 @@ + this.func_73242_b(chunk); + this.func_73243_a(chunk); + this.field_73245_g.remove(chunk); ++ ForgeChunkManager.putDormantChunk(ChunkCoordIntPair.func_77272_a(chunk.field_76635_g, chunk.field_76647_h), chunk); ++ if(field_73245_g.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.field_73251_h).size() == 0 && !DimensionManager.shouldLoadSpawn(this.field_73251_h.field_73011_w.field_76574_g)){ ++ DimensionManager.unloadWorld(this.field_73251_h.field_73011_w.field_76574_g); ++ return field_73246_d.func_73156_b(); ++ } + } + + this.field_73248_b.remove(olong); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenCaves.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenCaves.java.patch new file mode 100644 index 0000000..4f1f59f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenCaves.java.patch @@ -0,0 +1,116 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenCaves.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenCaves.java +@@ -5,6 +5,7 @@ + import net.minecraft.init.Blocks; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraft.world.biome.BiomeGenBase; + + public class MapGenCaves extends MapGenBase + { +@@ -139,7 +140,7 @@ + { + Block block = p_151541_5_[j3]; + +- if (block == Blocks.field_150358_i || block == Blocks.field_150355_j) ++ if (isOceanBlock(p_151541_5_, j3, k2, i3, l2, p_151541_3_, p_151541_4_)) + { + flag3 = true; + } +@@ -175,27 +176,11 @@ + { + Block block1 = p_151541_5_[k3]; + +- if (block1 == Blocks.field_150349_c) ++ if (isTopBlock(p_151541_5_, k3, k2, l3, j3, p_151541_3_, p_151541_4_)) + { + flag1 = true; + } +- +- if (block1 == Blocks.field_150348_b || block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) +- { +- if (l3 < 10) +- { +- p_151541_5_[k3] = Blocks.field_150353_l; +- } +- else +- { +- p_151541_5_[k3] = null; +- +- if (flag1 && p_151541_5_[k3 - 1] == Blocks.field_150346_d) +- { +- p_151541_5_[k3 - 1] = this.field_75039_c.func_72807_a(k2 + p_151541_3_ * 16, j3 + p_151541_4_ * 16).field_76752_A; +- } +- } +- } ++ digBlock(p_151541_5_, k3, k2, l3, j3, p_151541_3_, p_151541_4_, flag1); + } + + --k3; +@@ -251,4 +236,66 @@ + } + } + } ++ ++ protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ return data[index] == Blocks.field_150358_i || data[index] == Blocks.field_150355_j; ++ } ++ ++ //Exception biomes to make sure we generate like vanilla ++ private boolean isExceptionBiome(BiomeGenBase biome) ++ { ++ if (biome == BiomeGenBase.field_76789_p) return true; ++ if (biome == BiomeGenBase.field_76787_r) return true; ++ if (biome == BiomeGenBase.field_76769_d) return true; ++ return false; ++ } ++ ++ //Determine if the block at the specified location is the top block for the biome, we take into account ++ //Vanilla bugs to make sure that we generate the map the same way vanilla does. ++ private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ return (isExceptionBiome(biome) ? data[index] == Blocks.field_150349_c : data[index] == biome.field_76752_A); ++ } ++ ++ /** ++ * Digs out the current block, default implementation removes stone, filler, and top block ++ * Sets the block to lava if y is less then 10, and air other wise. ++ * If setting to air, it also checks to see if we've broken the surface and if so ++ * tries to make the floor the biome's top block ++ * ++ * @param data Block data array ++ * @param index Pre-calculated index into block data ++ * @param x local X position ++ * @param y local Y position ++ * @param z local Z position ++ * @param chunkX Chunk X position ++ * @param chunkZ Chunk Y position ++ * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. ++ */ ++ protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) ++ { ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ Block top = (isExceptionBiome(biome) ? Blocks.field_150349_c : biome.field_76752_A); ++ Block filler = (isExceptionBiome(biome) ? Blocks.field_150346_d : biome.field_76753_B); ++ Block block = data[index]; ++ ++ if (block == Blocks.field_150348_b || block == filler || block == top) ++ { ++ if (y < 10) ++ { ++ data[index] = Blocks.field_150353_l; ++ } ++ else ++ { ++ data[index] = null; ++ ++ if (foundTop && data[index - 1] == filler) ++ { ++ data[index - 1] = top; ++ } ++ } ++ } ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenRavine.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenRavine.java.patch new file mode 100644 index 0000000..95e70ae --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenRavine.java.patch @@ -0,0 +1,116 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/MapGenRavine.java ++++ ../src-work/minecraft/net/minecraft/world/gen/MapGenRavine.java +@@ -5,6 +5,7 @@ + import net.minecraft.init.Blocks; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraft.world.biome.BiomeGenBase; + + public class MapGenRavine extends MapGenBase + { +@@ -131,7 +132,7 @@ + { + Block block = p_151540_5_[j3]; + +- if (block == Blocks.field_150358_i || block == Blocks.field_150355_j) ++ if (isOceanBlock(p_151540_5_, j3, k2, i3, l2, p_151540_3_, p_151540_4_)) + { + flag2 = true; + } +@@ -167,27 +168,12 @@ + { + Block block1 = p_151540_5_[k3]; + +- if (block1 == Blocks.field_150349_c) ++ if (isTopBlock(p_151540_5_, k3, k2, l3, j3, p_151540_3_, p_151540_4_)) + { + flag = true; + } + +- if (block1 == Blocks.field_150348_b || block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) +- { +- if (l3 < 10) +- { +- p_151540_5_[k3] = Blocks.field_150356_k; +- } +- else +- { +- p_151540_5_[k3] = null; +- +- if (flag && p_151540_5_[k3 - 1] == Blocks.field_150346_d) +- { +- p_151540_5_[k3 - 1] = this.field_75039_c.func_72807_a(k2 + p_151540_3_ * 16, j3 + p_151540_4_ * 16).field_76752_A; +- } +- } +- } ++ digBlock(p_151540_5_, k3, k2, l3, j3, p_151540_3_, p_151540_4_, flag); + } + + --k3; +@@ -224,4 +210,66 @@ + } + } + } ++ ++ protected boolean isOceanBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ return data[index] == Blocks.field_150355_j || data[index] == Blocks.field_150358_i; ++ } ++ ++ //Exception biomes to make sure we generate like vanilla ++ private boolean isExceptionBiome(BiomeGenBase biome) ++ { ++ if (biome == BiomeGenBase.field_76789_p) return true; ++ if (biome == BiomeGenBase.field_76787_r) return true; ++ if (biome == BiomeGenBase.field_76769_d) return true; ++ return false; ++ } ++ ++ //Determine if the block at the specified location is the top block for the biome, we take into account ++ //Vanilla bugs to make sure that we generate the map the same way vanilla does. ++ private boolean isTopBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ) ++ { ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ return (isExceptionBiome(biome) ? data[index] == Blocks.field_150349_c : data[index] == biome.field_76752_A); ++ } ++ ++ /** ++ * Digs out the current block, default implementation removes stone, filler, and top block ++ * Sets the block to lava if y is less then 10, and air other wise. ++ * If setting to air, it also checks to see if we've broken the surface and if so ++ * tries to make the floor the biome's top block ++ * ++ * @param data Block data array ++ * @param index Pre-calculated index into block data ++ * @param x local X position ++ * @param y local Y position ++ * @param z local Z position ++ * @param chunkX Chunk X position ++ * @param chunkZ Chunk Y position ++ * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. ++ */ ++ protected void digBlock(Block[] data, int index, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) ++ { ++ BiomeGenBase biome = field_75039_c.func_72807_a(x + chunkX * 16, z + chunkZ * 16); ++ Block top = (isExceptionBiome(biome) ? Blocks.field_150349_c : biome.field_76752_A); ++ Block filler = (isExceptionBiome(biome) ? Blocks.field_150346_d : biome.field_76753_B); ++ Block block = data[index]; ++ ++ if (block == Blocks.field_150348_b || block == filler || block == top) ++ { ++ if (y < 10) ++ { ++ data[index] = Blocks.field_150356_k; ++ } ++ else ++ { ++ data[index] = null; ++ ++ if (foundTop && data[index - 1] == filler) ++ { ++ data[index - 1] = top; ++ } ++ } ++ } ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch new file mode 100644 index 0000000..a95f248 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenAbstractTree.java +@@ -21,4 +21,10 @@ + } + + public void func_150524_b(World p_150524_1_, Random p_150524_2_, int p_150524_3_, int p_150524_4_, int p_150524_5_) {} ++ ++ protected boolean isReplaceable(World world, int x, int y, int z) ++ { ++ Block block = world.func_147439_a(x, y, z); ++ return block.isAir(world, x, y, z) || block.isLeaves(world, x, y, z) || block.isWood(world, x, y, z) || func_150523_a(block); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch new file mode 100644 index 0000000..8774e79 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigMushroom.java +@@ -56,7 +56,7 @@ + { + Block block = p_76484_1_.func_147439_a(k1, j1, l1); + +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_76484_1_, k1, j1, l1) && !block.isLeaves(p_76484_1_, k1, j1, l1)) + { + flag = false; + } +@@ -183,7 +183,7 @@ + j2 = 0; + } + +- if ((j2 != 0 || p_76484_4_ >= p_76484_4_ + i1 - 1) && !p_76484_1_.func_147439_a(l2, k1, i2).func_149730_j()) ++ if ((j2 != 0 || p_76484_4_ >= p_76484_4_ + i1 - 1) && p_76484_1_.func_147439_a(l2, k1, i2).canBeReplacedByLeaves(p_76484_1_, l2, k1, i2)) + { + this.func_150516_a(p_76484_1_, l2, k1, i2, Block.func_149729_e(Block.func_149682_b(Blocks.field_150420_aW) + l), j2); + } +@@ -195,7 +195,7 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k1, p_76484_5_); + +- if (!block2.func_149730_j()) ++ if (block2.canBeReplacedByLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Block.func_149729_e(Block.func_149682_b(Blocks.field_150420_aW) + l), 10); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch new file mode 100644 index 0000000..765db1e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch @@ -0,0 +1,59 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenBigTree.java +@@ -2,10 +2,12 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenBigTree extends WorldGenAbstractTree + { +@@ -142,7 +144,7 @@ + aint1[b2] = aint[b2] + j1; + Block block1 = this.field_76506_c.func_147439_a(aint1[0], aint1[1], aint1[2]); + +- if (block1.func_149688_o() != Material.field_151579_a && block1.func_149688_o() != Material.field_151584_j) ++ if (!block1.isAir(field_76506_c, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(field_76506_c, aint1[0], aint1[1], aint1[2])) + { + ++j1; + } +@@ -374,7 +376,7 @@ + aint3[b3] = MathHelper.func_76128_c((double)p_76496_1_[b3] + (double)i * d1); + Block block = this.field_76506_c.func_147439_a(aint3[0], aint3[1], aint3[2]); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(field_76506_c, aint3[0], aint3[1], aint3[2])) + { + break; + } +@@ -390,7 +392,8 @@ + int[] aint1 = new int[] {this.field_76503_d[0], this.field_76503_d[1] + this.field_76504_e - 1, this.field_76503_d[2]}; + Block block = this.field_76506_c.func_147439_a(this.field_76503_d[0], this.field_76503_d[1] - 1, this.field_76503_d[2]); + +- if (block != Blocks.field_150346_d && block != Blocks.field_150349_c && block != Blocks.field_150458_ak) ++ boolean isSoil = block.canSustainPlant(field_76506_c, field_76503_d[0], field_76503_d[1] - 1, field_76503_d[2], ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (!isSoil) + { + return false; + } +@@ -443,6 +446,7 @@ + + if (!this.func_76497_e()) + { ++ this.field_76506_c = null; //Fix vanilla Mem leak, holds latest world + return false; + } + else +@@ -451,6 +455,7 @@ + this.func_76498_b(); + this.func_76499_c(); + this.func_76494_d(); ++ this.field_76506_c = null; //Fix vanilla Mem leak, holds latest world + return true; + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch new file mode 100644 index 0000000..7858d60 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch @@ -0,0 +1,69 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenCanopyTree.java +@@ -2,10 +2,12 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.util.Direction; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenCanopyTree extends WorldGenAbstractTree + { +@@ -48,7 +50,7 @@ + { + Block block = p_76484_1_.func_147439_a(j1, i1, k1); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } +@@ -69,12 +71,13 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.field_150346_d); +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, Blocks.field_150346_d); ++ onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_ + 1, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); ++ onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_ + 1, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4); + k1 = 2 - p_76484_2_.nextInt(3); +@@ -97,7 +100,7 @@ + + Block block1 = p_76484_1_.func_147439_a(k3, k2, l1); + +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) + { + this.func_150516_a(p_76484_1_, k3, k2, l1, Blocks.field_150363_s, 1); + this.func_150516_a(p_76484_1_, k3 + 1, k2, l1, Blocks.field_150363_s, 1); +@@ -203,9 +206,15 @@ + { + Block block = p_150526_1_.func_147439_a(p_150526_2_, p_150526_3_, p_150526_4_); + +- if (block.func_149688_o() == Material.field_151579_a) ++ if (block.isAir(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_)) + { + this.func_150516_a(p_150526_1_, p_150526_2_, p_150526_3_, p_150526_4_, Blocks.field_150361_u, 1); + } + } ++ ++ //Just a helper macro ++ private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) ++ { ++ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch new file mode 100644 index 0000000..012f190 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDeadBush.java +@@ -19,10 +19,15 @@ + { + Block block; + +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) ++ do + { ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) ++ { ++ break; ++ } + --p_76484_4_; +- } ++ } while (p_76484_4_ > 0); + + for (int l = 0; l < 4; ++l) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch new file mode 100644 index 0000000..27ac830 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenDungeons.java +@@ -8,6 +8,9 @@ + import net.minecraft.tileentity.TileEntityMobSpawner; + import net.minecraft.util.WeightedRandomChestContent; + import net.minecraft.world.World; ++import net.minecraftforge.common.ChestGenHooks; ++import net.minecraftforge.common.DungeonHooks; ++import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST;; + + public class WorldGenDungeons extends WorldGenerator + { +@@ -123,12 +126,11 @@ + if (k2 == 1) + { + p_76484_1_.func_147465_d(i2, p_76484_4_, j2, Blocks.field_150486_ae, 0, 2); +- WeightedRandomChestContent[] aweightedrandomchestcontent = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_76484_2_)}); + TileEntityChest tileentitychest = (TileEntityChest)p_76484_1_.func_147438_o(i2, p_76484_4_, j2); + + if (tileentitychest != null) + { +- WeightedRandomChestContent.func_76293_a(p_76484_2_, aweightedrandomchestcontent, tileentitychest, 8); ++ WeightedRandomChestContent.func_76293_a(p_76484_2_, ChestGenHooks.getItems(DUNGEON_CHEST, p_76484_2_), tileentitychest, ChestGenHooks.getCount(DUNGEON_CHEST, p_76484_2_)); + } + + break label101; +@@ -167,7 +169,6 @@ + + private String func_76543_b(Random p_76543_1_) + { +- int i = p_76543_1_.nextInt(4); +- return i == 0 ? "Skeleton" : (i == 1 ? "Zombie" : (i == 2 ? "Zombie" : (i == 3 ? "Spider" : ""))); ++ return DungeonHooks.getRandomDungeonMob(p_76543_1_); + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenForest.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenForest.java.patch new file mode 100644 index 0000000..ac5d841 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenForest.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenForest.java +@@ -2,9 +2,11 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenForest extends WorldGenAbstractTree + { +@@ -55,7 +57,7 @@ + { + Block block = p_76484_1_.func_147439_a(j1, i1, k1); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } +@@ -76,9 +78,10 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d || block2 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int k2; + + for (k2 = p_76484_4_ - 3 + l; k2 <= p_76484_4_ + l; ++k2) +@@ -98,7 +101,7 @@ + { + Block block1 = p_76484_1_.func_147439_a(l2, k2, i2); + +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, l2, k2, i2) || block1.isLeaves(p_76484_1_, l2, k2, i2)) + { + this.func_150516_a(p_76484_1_, l2, k2, i2, Blocks.field_150362_t, 2); + } +@@ -111,7 +114,7 @@ + { + Block block3 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + +- if (block3.func_149688_o() == Material.field_151579_a || block3.func_149688_o() == Material.field_151584_j) ++ if (block3.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block3.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r, 2); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch new file mode 100644 index 0000000..14eb8ef --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch @@ -0,0 +1,71 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenHugeTrees.java +@@ -2,9 +2,11 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public abstract class WorldGenHugeTrees extends WorldGenAbstractTree + { +@@ -63,7 +65,7 @@ + { + Block block = p_150536_1_.func_147439_a(j1, i1, k1); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_150536_1_, j1, i1, k1)) + { + flag = false; + } +@@ -88,12 +90,13 @@ + { + Block block = p_150532_1_.func_147439_a(p_150532_3_, p_150532_4_ - 1, p_150532_5_); + +- if ((block == Blocks.field_150349_c || block == Blocks.field_150346_d) && p_150532_4_ >= 2) ++ boolean isSoil = block.canSustainPlant(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_150532_4_ >= 2) + { +- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.field_150346_d, 0, 2); +- p_150532_1_.func_147465_d(p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, Blocks.field_150346_d, 0, 2); ++ onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); ++ onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_, p_150532_3_, p_150532_4_, p_150532_5_); ++ onPlantGrow(p_150532_1_, p_150532_3_, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); ++ onPlantGrow(p_150532_1_, p_150532_3_ + 1, p_150532_4_ - 1, p_150532_5_ + 1, p_150532_3_, p_150532_4_, p_150532_5_); + return true; + } + else +@@ -125,7 +128,7 @@ + { + Block block = p_150535_1_.func_147439_a(j1, p_150535_3_, l1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_150535_1_, j1, p_150535_3_, l1) || block.isLeaves(p_150535_1_, j1, p_150535_3_, l1)) + { + this.func_150516_a(p_150535_1_, j1, p_150535_3_, l1, Blocks.field_150362_t, this.field_76521_c); + } +@@ -150,7 +153,7 @@ + { + Block block = p_150534_1_.func_147439_a(j1, p_150534_3_, l1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_150534_1_, j1, p_150534_3_, l1) || block.isLeaves(p_150534_1_, j1, p_150534_3_, l1)) + { + this.func_150516_a(p_150534_1_, j1, p_150534_3_, l1, Blocks.field_150362_t, this.field_76521_c); + } +@@ -158,4 +161,10 @@ + } + } + } ++ ++ //Just a helper macro ++ private void onPlantGrow(World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ) ++ { ++ world.func_147439_a(x, y, z).onPlantGrow(world, x, y, z, sourceX, sourceY, sourceZ); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch new file mode 100644 index 0000000..603c443 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch @@ -0,0 +1,38 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaJungle.java +@@ -56,7 +56,7 @@ + { + Block block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + l2, p_76484_5_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); + +@@ -78,7 +78,7 @@ + { + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); + +@@ -98,7 +98,7 @@ + + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); + +@@ -118,7 +118,7 @@ + + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + l2, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); + diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch new file mode 100644 index 0000000..40006b9 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java +@@ -2,10 +2,12 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.util.MathHelper; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenMegaPineTree extends WorldGenHugeTrees + { +@@ -34,7 +36,7 @@ + { + Block block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i1, p_76484_5_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); + } +@@ -43,21 +45,21 @@ + { + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_, Blocks.field_150364_r, this.field_76520_b); + } + + block = p_76484_1_.func_147439_a(p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1)) + { + this.func_150516_a(p_76484_1_, p_76484_3_ + 1, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); + } + + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i1, p_76484_5_ + 1, Blocks.field_150364_r, this.field_76520_b); + } +@@ -132,13 +134,13 @@ + { + Block block = p_150540_1_.func_147439_a(p_150540_2_, l, p_150540_4_); + +- if (block == Blocks.field_150349_c || block == Blocks.field_150346_d) ++ if (block.canSustainPlant(p_150540_1_, p_150540_2_, l, p_150540_4_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g)) + { + this.func_150516_a(p_150540_1_, p_150540_2_, l, p_150540_4_, Blocks.field_150346_d, 2); + break; + } + +- if (block.func_149688_o() != Material.field_151579_a && l < p_150540_3_) ++ if (block.isAir(p_150540_1_, p_150540_2_, l, p_150540_4_) && l < p_150540_3_) + { + break; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMinable.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMinable.java.patch new file mode 100644 index 0000000..bac3c9b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMinable.java.patch @@ -0,0 +1,35 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenMinable.java +@@ -12,6 +12,7 @@ + private int field_76541_b; + private Block field_150518_c; + private static final String __OBFID = "CL_00000426"; ++ private int mineableBlockMeta; + + public WorldGenMinable(Block p_i45459_1_, int p_i45459_2_) + { +@@ -25,6 +26,12 @@ + this.field_150518_c = p_i45460_3_; + } + ++ public WorldGenMinable(Block block, int meta, int number, Block target) ++ { ++ this(block, number, target); ++ this.mineableBlockMeta = meta; ++ } ++ + public boolean func_76484_a(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) + { + float f = p_76484_2_.nextFloat() * (float)Math.PI; +@@ -66,9 +73,9 @@ + { + double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); + +- if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && p_76484_1_.func_147439_a(k2, l2, i3) == this.field_150518_c) ++ if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && p_76484_1_.func_147439_a(k2, l2, i3).isReplaceableOreGen(p_76484_1_, k2, l2, i3, field_150518_c)) + { +- p_76484_1_.func_147465_d(k2, l2, i3, this.field_150519_a, 0, 2); ++ p_76484_1_.func_147465_d(k2, l2, i3, this.field_150519_a, mineableBlockMeta, 2); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch new file mode 100644 index 0000000..34615fe --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch @@ -0,0 +1,64 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSavannaTree.java +@@ -2,10 +2,12 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.util.Direction; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenSavannaTree extends WorldGenAbstractTree + { +@@ -48,7 +50,7 @@ + { + Block block = p_76484_1_.func_147439_a(j1, i1, k1); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } +@@ -69,9 +71,10 @@ + { + Block block3 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block3 == Blocks.field_150349_c || block3 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block3.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block3.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int j3 = p_76484_2_.nextInt(4); + j1 = l - p_76484_2_.nextInt(4) - 1; + k1 = 3 - p_76484_2_.nextInt(3); +@@ -94,7 +97,7 @@ + + Block block1 = p_76484_1_.func_147439_a(k3, k2, l1); + +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, k3, k2, l1) || block1.isLeaves(p_76484_1_, k3, k2, l1)) + { + this.func_150516_a(p_76484_1_, k3, k2, l1, Blocks.field_150363_s, 0); + i2 = k2; +@@ -146,7 +149,7 @@ + l1 += Direction.field_71581_b[j2]; + Block block2 = p_76484_1_.func_147439_a(k3, i3, l1); + +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, k3, i3, l1) || block2.isLeaves(p_76484_1_, k3, i3, l1)) + { + this.func_150516_a(p_76484_1_, k3, i3, l1, Blocks.field_150363_s, 0); + i2 = i3; +@@ -197,7 +200,7 @@ + { + Block block = p_150525_1_.func_147439_a(p_150525_2_, p_150525_3_, p_150525_4_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_) || block.isLeaves(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_)) + { + this.func_150516_a(p_150525_1_, p_150525_2_, p_150525_3_, p_150525_4_, Blocks.field_150361_u, 0); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenShrub.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenShrub.java.patch new file mode 100644 index 0000000..64775e9 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenShrub.java.patch @@ -0,0 +1,43 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenShrub.java +@@ -5,6 +5,8 @@ + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.IPlantable; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenShrub extends WorldGenTrees + { +@@ -23,14 +25,19 @@ + { + Block block; + +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) ++ do + { ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) ++ { ++ break; ++ } + --p_76484_4_; +- } ++ } while (p_76484_4_ > 0); + + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); + +- if (block1 == Blocks.field_150346_d || block1 == Blocks.field_150349_c) ++ if (block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, ForgeDirection.UP, (IPlantable)Blocks.field_150345_g)) + { + ++p_76484_4_; + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_, Blocks.field_150364_r, this.field_150527_b); +@@ -48,7 +55,7 @@ + { + int j2 = i2 - p_76484_5_; + +- if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_76484_2_.nextInt(2) != 0) && !p_76484_1_.func_147439_a(k1, l, i2).func_149730_j()) ++ if ((Math.abs(l1) != j1 || Math.abs(j2) != j1 || p_76484_2_.nextInt(2) != 0) && p_76484_1_.func_147439_a(k1, l, i2).canBeReplacedByLeaves(p_76484_1_, k1, l, i2)) + { + this.func_150516_a(p_76484_1_, k1, l, i2, Blocks.field_150362_t, this.field_150528_a); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch new file mode 100644 index 0000000..d336c15 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenSwamp.java +@@ -2,9 +2,11 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenSwamp extends WorldGenAbstractTree + { +@@ -53,7 +55,7 @@ + { + Block block = p_76484_1_.func_147439_a(j1, i1, k1); + +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!(block.isAir(p_76484_1_, j1, i1, k1) || block.isLeaves(p_76484_1_, j1, i1, k1))) + { + if (block != Blocks.field_150355_j && block != Blocks.field_150358_i) + { +@@ -81,9 +83,10 @@ + { + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + int l1; + int k2; + int l2; +@@ -101,7 +104,7 @@ + { + int j2 = i2 - p_76484_5_; + +- if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) && !p_76484_1_.func_147439_a(l2, k2, i2).func_149730_j()) ++ if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || p_76484_2_.nextInt(2) != 0 && j1 != 0) && p_76484_1_.func_147439_a(l2, k2, i2).canBeReplacedByLeaves(p_76484_1_, l2, k2, i2)) + { + this.func_150515_a(p_76484_1_, l2, k2, i2, Blocks.field_150362_t); + } +@@ -113,7 +116,7 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2 == Blocks.field_150358_i || block2 == Blocks.field_150355_j) + { + this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r); + } +@@ -128,24 +131,24 @@ + { + for (l1 = p_76484_5_ - k1; l1 <= p_76484_5_ + k1; ++l1) + { +- if (p_76484_1_.func_147439_a(l2, k2, l1).func_149688_o() == Material.field_151584_j) ++ if (p_76484_1_.func_147439_a(l2, k2, l1).isLeaves(p_76484_1_, l2, k2, l1)) + { +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 - 1, k2, l1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 - 1, k2, l1).isAir(p_76484_1_, l2 - 1, k2, l1)) + { + this.func_76536_b(p_76484_1_, l2 - 1, k2, l1, 8); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 + 1, k2, l1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2 + 1, k2, l1).isAir(p_76484_1_, l2 + 1, k2, l1)) + { + this.func_76536_b(p_76484_1_, l2 + 1, k2, l1, 2); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 - 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 - 1).isAir(p_76484_1_, l2, k2, l1 - 1)) + { + this.func_76536_b(p_76484_1_, l2, k2, l1 - 1, 1); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 + 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(l2, k2, l1 + 1).isAir(p_76484_1_, l2, k2, l1 + 1)) + { + this.func_76536_b(p_76484_1_, l2, k2, l1 + 1, 4); + } +@@ -177,7 +180,7 @@ + { + --p_76536_3_; + +- if (p_76536_1_.func_147439_a(p_76536_2_, p_76536_3_, p_76536_4_).func_149688_o() != Material.field_151579_a || i1 <= 0) ++ if (!(p_76536_1_.func_147439_a(p_76536_2_, p_76536_3_, p_76536_4_).isAir(p_76536_1_, p_76536_2_, p_76536_3_, p_76536_4_)) || i1 <= 0) + { + return; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch new file mode 100644 index 0000000..df6c980 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga1.java +@@ -2,9 +2,11 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenTaiga1 extends WorldGenAbstractTree + { +@@ -50,7 +52,7 @@ + { + Block block = p_76484_1_.func_147439_a(i2, l1, j2); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_76484_1_, i2, l1, j2)) + { + flag = false; + } +@@ -71,9 +73,10 @@ + { + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + i3 = 0; + + for (i2 = p_76484_4_ + l; i2 >= p_76484_4_ + i1; --i2) +@@ -86,7 +89,7 @@ + { + int l2 = k2 - p_76484_5_; + +- if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && !p_76484_1_.func_147439_a(j2, i2, k2).func_149730_j()) ++ if ((Math.abs(j3) != i3 || Math.abs(l2) != i3 || i3 <= 0) && p_76484_1_.func_147439_a(j2, i2, k2).canBeReplacedByLeaves(p_76484_1_, j2, i2, k2)) + { + this.func_150516_a(p_76484_1_, j2, i2, k2, Blocks.field_150362_t, 1); + } +@@ -107,7 +110,7 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + i2, p_76484_5_); + +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + i2, p_76484_5_, Blocks.field_150364_r, 1); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch new file mode 100644 index 0000000..ae8da1c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch @@ -0,0 +1,54 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTaiga2.java +@@ -2,9 +2,11 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenTaiga2 extends WorldGenAbstractTree + { +@@ -49,7 +51,7 @@ + { + Block block = p_76484_1_.func_147439_a(i2, l1, j2); + +- if (block.func_149688_o() != Material.field_151579_a && block.func_149688_o() != Material.field_151584_j) ++ if (!block.isAir(p_76484_1_, i2, l1, j2) && !block.isLeaves(p_76484_1_, i2, l1, j2)) + { + flag = false; + } +@@ -70,9 +72,10 @@ + { + Block block1 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block1 == Blocks.field_150349_c || block1 == Blocks.field_150346_d || block1 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block1.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block1.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + l3 = p_76484_2_.nextInt(2); + i2 = 1; + byte b0 = 0; +@@ -91,7 +94,7 @@ + { + int k3 = j3 - p_76484_5_; + +- if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && !p_76484_1_.func_147439_a(l2, k2, j3).func_149730_j()) ++ if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) && p_76484_1_.func_147439_a(l2, k2, j3).canBeReplacedByLeaves(p_76484_1_, l2, k2, j3)) + { + this.func_150516_a(p_76484_1_, l2, k2, j3, Blocks.field_150362_t, 1); + } +@@ -121,7 +124,7 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k2, p_76484_5_); + +- if (block2.func_149688_o() == Material.field_151579_a || block2.func_149688_o() == Material.field_151584_j) ++ if (block2.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_) || block2.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k2, p_76484_5_, Blocks.field_150364_r, 1); + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch new file mode 100644 index 0000000..18be24a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTallGrass.java +@@ -21,10 +21,15 @@ + { + Block block; + +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 0) ++ do + { ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!(block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) || block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_))) ++ { ++ break; ++ } + --p_76484_4_; +- } ++ } while (p_76484_4_ > 0); + + for (int l = 0; l < 128; ++l) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTrees.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTrees.java.patch new file mode 100644 index 0000000..cc57247 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTrees.java.patch @@ -0,0 +1,94 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGenTrees.java +@@ -2,10 +2,12 @@ + + import java.util.Random; + import net.minecraft.block.Block; ++import net.minecraft.block.BlockSapling; + import net.minecraft.block.material.Material; + import net.minecraft.init.Blocks; + import net.minecraft.util.Direction; + import net.minecraft.world.World; ++import net.minecraftforge.common.util.ForgeDirection; + + public class WorldGenTrees extends WorldGenAbstractTree + { +@@ -62,7 +64,7 @@ + { + block = p_76484_1_.func_147439_a(j1, i1, k1); + +- if (!this.func_150523_a(block)) ++ if (!this.isReplaceable(p_76484_1_, j1, i1, k1)) + { + flag = false; + } +@@ -83,9 +85,10 @@ + { + Block block2 = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ - 1, p_76484_5_); + +- if ((block2 == Blocks.field_150349_c || block2 == Blocks.field_150346_d || block2 == Blocks.field_150458_ak) && p_76484_4_ < 256 - l - 1) ++ boolean isSoil = block2.canSustainPlant(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, ForgeDirection.UP, (BlockSapling)Blocks.field_150345_g); ++ if (isSoil && p_76484_4_ < 256 - l - 1) + { +- this.func_150515_a(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, Blocks.field_150346_d); ++ block2.onPlantGrow(p_76484_1_, p_76484_3_, p_76484_4_ - 1, p_76484_5_, p_76484_3_, p_76484_4_, p_76484_5_); + b0 = 3; + byte b1 = 0; + int l1; +@@ -110,7 +113,7 @@ + { + Block block1 = p_76484_1_.func_147439_a(i2, k1, k2); + +- if (block1.func_149688_o() == Material.field_151579_a || block1.func_149688_o() == Material.field_151584_j) ++ if (block1.isAir(p_76484_1_, i2, k1, k2) || block1.isLeaves(p_76484_1_, i2, k1, k2)) + { + this.func_150516_a(p_76484_1_, i2, k1, k2, Blocks.field_150362_t, this.field_76530_d); + } +@@ -123,7 +126,7 @@ + { + block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_ + k1, p_76484_5_); + +- if (block.func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) ++ if (block.isAir(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_) || block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_)) + { + this.func_150516_a(p_76484_1_, p_76484_3_, p_76484_4_ + k1, p_76484_5_, Blocks.field_150364_r, this.field_76532_c); + +@@ -163,24 +166,24 @@ + { + for (j2 = p_76484_5_ - l1; j2 <= p_76484_5_ + l1; ++j2) + { +- if (p_76484_1_.func_147439_a(i2, k1, j2).func_149688_o() == Material.field_151584_j) ++ if (p_76484_1_.func_147439_a(i2, k1, j2).isLeaves(p_76484_1_, i2, k1, j2)) + { +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 - 1, k1, j2).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 - 1, k1, j2).isAir(p_76484_1_, i2 - 1, k1, j2)) + { + this.func_76529_b(p_76484_1_, i2 - 1, k1, j2, 8); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 + 1, k1, j2).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2 + 1, k1, j2).isAir(p_76484_1_, i2 + 1, k1, j2)) + { + this.func_76529_b(p_76484_1_, i2 + 1, k1, j2, 2); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 - 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 - 1).isAir(p_76484_1_, i2, k1, j2 - 1)) + { + this.func_76529_b(p_76484_1_, i2, k1, j2 - 1, 1); + } + +- if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 + 1).func_149688_o() == Material.field_151579_a) ++ if (p_76484_2_.nextInt(4) == 0 && p_76484_1_.func_147439_a(i2, k1, j2 + 1).isAir(p_76484_1_, i2, k1, j2 + 1)) + { + this.func_76529_b(p_76484_1_, i2, k1, j2 + 1, 4); + } +@@ -228,7 +231,7 @@ + { + --p_76529_3_; + +- if (p_76529_1_.func_147439_a(p_76529_2_, p_76529_3_, p_76529_4_).func_149688_o() != Material.field_151579_a || i1 <= 0) ++ if (!p_76529_1_.func_147439_a(p_76529_2_, p_76529_3_, p_76529_4_).isAir(p_76529_1_, p_76529_2_, p_76529_3_, p_76529_4_) || i1 <= 0) + { + return; + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch new file mode 100644 index 0000000..1e5182e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java ++++ ../src-work/minecraft/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java +@@ -24,10 +24,12 @@ + { + Block block; + +- while (((block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_)).func_149688_o() == Material.field_151579_a || block.func_149688_o() == Material.field_151584_j) && p_76484_4_ > 1) ++ do + { +- --p_76484_4_; +- } ++ block = p_76484_1_.func_147439_a(p_76484_3_, p_76484_4_, p_76484_5_); ++ if (!block.isAir(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_) && !block.isLeaves(p_76484_1_, p_76484_3_, p_76484_4_, p_76484_5_)) break; ++ p_76484_4_--; ++ } while (p_76484_4_ > 1); + + if (p_76484_4_ < 1) + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayer.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayer.java.patch new file mode 100644 index 0000000..061709c --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayer.java.patch @@ -0,0 +1,69 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayer.java +@@ -7,6 +7,9 @@ + import net.minecraft.world.WorldType; + import net.minecraft.world.biome.BiomeGenBase; + ++import net.minecraftforge.common.*; ++import net.minecraftforge.event.terraingen.*; ++ + public abstract class GenLayer + { + private long field_75907_b; +@@ -48,17 +51,12 @@ + { + b0 = 4; + } ++ b0 = getModdedBiomeSize(p_75901_2_, b0); + + GenLayer genlayer = GenLayerZoom.func_75915_a(1000L, genlayer2, 0); + GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer); +- Object object = new GenLayerBiome(200L, genlayer2, p_75901_2_); ++ Object object = p_75901_2_.getBiomeLayer(p_75901_0_, genlayer2); + +- if (!flag) +- { +- GenLayer genlayer3 = GenLayerZoom.func_75915_a(1000L, (GenLayer)object, 2); +- object = new GenLayerBiomeEdge(1000L, genlayer3); +- } +- + GenLayer genlayer1 = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); + GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1); + genlayer = GenLayerZoom.func_75915_a(1000L, genlayerriverinit, 2); +@@ -192,7 +190,7 @@ + + protected static boolean func_151618_b(int p_151618_0_) + { +- return p_151618_0_ == BiomeGenBase.field_76771_b.field_76756_M || p_151618_0_ == BiomeGenBase.field_150575_M.field_76756_M || p_151618_0_ == BiomeGenBase.field_76776_l.field_76756_M; ++ return BiomeManager.oceanBiomes.contains(BiomeGenBase.func_150568_d(p_151618_0_)); + } + + protected int func_151619_a(int ... p_151619_1_) +@@ -204,4 +202,27 @@ + { + return p_151617_2_ == p_151617_3_ && p_151617_3_ == p_151617_4_ ? p_151617_2_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_3_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_1_ == p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_2_ && p_151617_3_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_3_ && p_151617_2_ != p_151617_4_ ? p_151617_1_ : (p_151617_1_ == p_151617_4_ && p_151617_2_ != p_151617_3_ ? p_151617_1_ : (p_151617_2_ == p_151617_3_ && p_151617_1_ != p_151617_4_ ? p_151617_2_ : (p_151617_2_ == p_151617_4_ && p_151617_1_ != p_151617_3_ ? p_151617_2_ : (p_151617_3_ == p_151617_4_ && p_151617_1_ != p_151617_2_ ? p_151617_3_ : this.func_151619_a(new int[] {p_151617_1_, p_151617_2_, p_151617_3_, p_151617_4_})))))))))); + } ++ ++ /* ======================================== FORGE START =====================================*/ ++ protected long nextLong(long par1) ++ { ++ long j = (this.field_75908_c >> 24) % par1; ++ ++ if (j < 0) ++ { ++ j += par1; ++ } ++ ++ this.field_75908_c *= this.field_75908_c * 6364136223846793005L + 1442695040888963407L; ++ this.field_75908_c += this.field_75907_b; ++ return j; ++ } ++ ++ public static byte getModdedBiomeSize(WorldType worldType, byte original) ++ { ++ WorldTypeEvent.BiomeSize event = new WorldTypeEvent.BiomeSize(worldType, original); ++ MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ return event.newSize; ++ } ++ /* ========================================= FORGE END ======================================*/ + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayerBiome.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayerBiome.java.patch new file mode 100644 index 0000000..deae9ef --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayerBiome.java.patch @@ -0,0 +1,111 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java ++++ ../src-work/minecraft/net/minecraft/world/gen/layer/GenLayerBiome.java +@@ -1,29 +1,52 @@ + package net.minecraft.world.gen.layer; + ++import java.util.ArrayList; ++import java.util.List; ++ ++import net.minecraft.util.WeightedRandom; + import net.minecraft.world.WorldType; + import net.minecraft.world.biome.BiomeGenBase; ++import net.minecraftforge.common.BiomeManager; ++import net.minecraftforge.common.BiomeManager.BiomeEntry; + + public class GenLayerBiome extends GenLayer + { +- private BiomeGenBase[] field_151623_c; +- private BiomeGenBase[] field_151621_d; +- private BiomeGenBase[] field_151622_e; +- private BiomeGenBase[] field_151620_f; ++ private List[] biomes = new ArrayList[BiomeManager.BiomeType.values().length]; ++ + private static final String __OBFID = "CL_00000555"; + + public GenLayerBiome(long p_i2122_1_, GenLayer p_i2122_3_, WorldType p_i2122_4_) + { + super(p_i2122_1_); +- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_76769_d, BiomeGenBase.field_150588_X, BiomeGenBase.field_150588_X, BiomeGenBase.field_76772_c}; +- this.field_151621_d = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_150585_R, BiomeGenBase.field_76770_e, BiomeGenBase.field_76772_c, BiomeGenBase.field_150583_P, BiomeGenBase.field_76780_h}; +- this.field_151622_e = new BiomeGenBase[] {BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76768_g, BiomeGenBase.field_76772_c}; +- this.field_151620_f = new BiomeGenBase[] {BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_76774_n, BiomeGenBase.field_150584_S}; ++ + this.field_75909_a = p_i2122_3_; +- ++ ++ for (BiomeManager.BiomeType type : BiomeManager.BiomeType.values()) ++ { ++ com.google.common.collect.ImmutableList biomesToAdd = BiomeManager.getBiomes(type); ++ int idx = type.ordinal(); ++ ++ if (biomes[idx] == null) biomes[idx] = new ArrayList(); ++ if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd); ++ } ++ ++ int desertIdx = BiomeManager.BiomeType.DESERT.ordinal(); ++ + if (p_i2122_4_ == WorldType.field_77136_e) + { +- this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.field_76769_d, BiomeGenBase.field_76767_f, BiomeGenBase.field_76770_e, BiomeGenBase.field_76780_h, BiomeGenBase.field_76772_c, BiomeGenBase.field_76768_g}; ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76769_d, 10)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76767_f, 10)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76770_e, 10)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76780_h, 10)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76772_c, 10)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76768_g, 10)); + } ++ else ++ { ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76769_d, 30)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_150588_X, 20)); ++ biomes[desertIdx].add(new BiomeEntry(BiomeGenBase.field_76772_c, 10)); ++ } + } + + public int[] func_75904_a(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) +@@ -63,7 +86,7 @@ + } + else + { +- aint1[j1 + i1 * p_75904_3_] = this.field_151623_c[this.func_75902_a(this.field_151623_c.length)].field_76756_M; ++ aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(BiomeManager.BiomeType.DESERT).biome.field_76756_M; + } + } + else if (k1 == 2) +@@ -74,7 +97,7 @@ + } + else + { +- aint1[j1 + i1 * p_75904_3_] = this.field_151621_d[this.func_75902_a(this.field_151621_d.length)].field_76756_M; ++ aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(BiomeManager.BiomeType.WARM).biome.field_76756_M; + } + } + else if (k1 == 3) +@@ -85,12 +108,12 @@ + } + else + { +- aint1[j1 + i1 * p_75904_3_] = this.field_151622_e[this.func_75902_a(this.field_151622_e.length)].field_76756_M; ++ aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(BiomeManager.BiomeType.COOL).biome.field_76756_M; + } + } + else if (k1 == 4) + { +- aint1[j1 + i1 * p_75904_3_] = this.field_151620_f[this.func_75902_a(this.field_151620_f.length)].field_76756_M; ++ aint1[j1 + i1 * p_75904_3_] = getWeightedBiomeEntry(BiomeManager.BiomeType.ICY).biome.field_76756_M; + } + else + { +@@ -101,4 +124,12 @@ + + return aint1; + } ++ ++ protected BiomeEntry getWeightedBiomeEntry(BiomeManager.BiomeType type) ++ { ++ List biomeList = biomes[type.ordinal()]; ++ int totalWeight = WeightedRandom.func_76272_a(biomeList); ++ int weight = BiomeManager.isTypeListModded(type)?func_75902_a(totalWeight):func_75902_a(totalWeight / 10) * 10; ++ return (BiomeEntry)WeightedRandom.getItem(biomeList, weight); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch new file mode 100644 index 0000000..48b80d6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch @@ -0,0 +1,62 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java +@@ -11,6 +11,9 @@ + import net.minecraft.util.WeightedRandomChestContent; + import net.minecraft.world.World; + ++import net.minecraftforge.common.ChestGenHooks; ++import static net.minecraftforge.common.ChestGenHooks.*; ++ + public class ComponentScatteredFeaturePieces + { + private static final String __OBFID = "CL_00000473"; +@@ -252,7 +255,7 @@ + { + int i1 = Direction.field_71583_a[l] * 2; + int j1 = Direction.field_71581_b[l] * 2; +- this.field_74940_h[l] = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + i1, -11, 10 + j1, WeightedRandomChestContent.func_92080_a(field_74941_i, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74940_h[l] = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 10 + i1, -11, 10 + j1, ChestGenHooks.getItems(PYRAMID_DESERT_CHEST, p_74875_2_), ChestGenHooks.getCount(PYRAMID_DESERT_CHEST, p_74875_2_)); + } + } + +@@ -508,9 +511,12 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150488_af, 0, 4, -3, 1, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150341_Y, 0, 3, -3, 1, p_74875_3_); + ++ ChestGenHooks dispenser = ChestGenHooks.getInfo(PYRAMID_JUNGLE_DISPENSER); ++ ChestGenHooks chest = ChestGenHooks.getInfo(PYRAMID_JUNGLE_CHEST); ++ + if (!this.field_74945_j) + { +- this.field_74945_j = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, field_74944_m, 2); ++ this.field_74945_j = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, -2, 1, 2, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); + } + + this.func_151550_a(p_74875_1_, Blocks.field_150395_bd, 15, 3, -2, 2, p_74875_3_); +@@ -527,7 +533,7 @@ + + if (!this.field_74946_k) + { +- this.field_74946_k = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, field_74944_m, 2); ++ this.field_74946_k = this.func_74869_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -2, 3, 4, dispenser.getItems(p_74875_2_), dispenser.getCount(p_74875_2_)); + } + + this.func_151550_a(p_74875_1_, Blocks.field_150395_bd, 15, 8, -1, 3, p_74875_3_); +@@ -535,7 +541,7 @@ + + if (!this.field_74947_h) + { +- this.field_74947_h = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, WeightedRandomChestContent.func_92080_a(field_74943_l, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74947_h = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 8, -3, 3, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); + } + + this.func_151550_a(p_74875_1_, Blocks.field_150341_Y, 0, 9, -3, 2, p_74875_3_); +@@ -568,7 +574,7 @@ + + if (!this.field_74948_i) + { +- this.field_74948_i = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, WeightedRandomChestContent.func_92080_a(field_74943_l, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(5)); ++ this.field_74948_i = this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 9, -3, 10, chest.getItems(p_74875_2_), chest.getCount(p_74875_2_)); + } + + return true; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStronghold.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStronghold.java.patch new file mode 100644 index 0000000..943c9e5 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStronghold.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStronghold.java +@@ -11,6 +11,7 @@ + import net.minecraft.world.ChunkPosition; + import net.minecraft.world.World; + import net.minecraft.world.biome.BiomeGenBase; ++import net.minecraftforge.common.BiomeManager; + + public class MapGenStronghold extends MapGenStructure + { +@@ -34,11 +35,18 @@ + { + BiomeGenBase biomegenbase = abiomegenbase[j]; + +- if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F) ++ if (biomegenbase != null && biomegenbase.field_76748_D > 0.0F && !BiomeManager.strongHoldBiomesBlackList.contains(biomegenbase)) + { + this.field_151546_e.add(biomegenbase); + } + } ++ for (BiomeGenBase biome : BiomeManager.strongHoldBiomes) ++ { ++ if (!this.field_151546_e.contains(biome)) ++ { ++ this.field_151546_e.add(biome); ++ } ++ } + } + + public MapGenStronghold(Map p_i2068_1_) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStructure.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStructure.java.patch new file mode 100644 index 0000000..a363382 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStructure.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/MapGenStructure.java +@@ -239,12 +239,12 @@ + { + if (this.field_143029_e == null) + { +- this.field_143029_e = (MapGenStructureData)p_143027_1_.func_72943_a(MapGenStructureData.class, this.func_143025_a()); ++ this.field_143029_e = (MapGenStructureData)p_143027_1_.perWorldStorage.func_75742_a(MapGenStructureData.class, this.func_143025_a()); + + if (this.field_143029_e == null) + { + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); +- p_143027_1_.func_72823_a(this.func_143025_a(), this.field_143029_e); ++ p_143027_1_.perWorldStorage.func_75745_a(this.func_143025_a(), this.field_143029_e); + } + else + { diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureComponent.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureComponent.java.patch new file mode 100644 index 0000000..5ecfdf6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureComponent.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureComponent.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureComponent.java +@@ -34,6 +34,10 @@ + + public NBTTagCompound func_143010_b() + { ++ if (MapGenStructureIO.func_143036_a(this) == null) // Friendlier error then the Null Stirng error below. ++ { ++ throw new RuntimeException("StructureComponent \"" + this.getClass().getName() + "\" missing ID Mapping, Modder see MapGenStructureIO"); ++ } + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143036_a(this)); + nbttagcompound.func_74782_a("BB", this.field_74887_e.func_151535_h()); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch new file mode 100644 index 0000000..7bcc3c8 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch @@ -0,0 +1,30 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureMineshaftPieces.java +@@ -16,6 +16,9 @@ + import net.minecraft.util.WeightedRandomChestContent; + import net.minecraft.world.World; + ++import net.minecraftforge.common.ChestGenHooks; ++import static net.minecraftforge.common.ChestGenHooks.*; ++ + public class StructureMineshaftPieces + { + public static final WeightedRandomChestContent[] field_78818_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Items.field_151042_j, 0, 1, 5, 10), new WeightedRandomChestContent(Items.field_151043_k, 0, 1, 3, 5), new WeightedRandomChestContent(Items.field_151137_ax, 0, 4, 9, 5), new WeightedRandomChestContent(Items.field_151100_aR, 4, 4, 9, 5), new WeightedRandomChestContent(Items.field_151045_i, 0, 1, 2, 3), new WeightedRandomChestContent(Items.field_151044_h, 0, 3, 8, 10), new WeightedRandomChestContent(Items.field_151025_P, 0, 1, 3, 15), new WeightedRandomChestContent(Items.field_151035_b, 0, 1, 1, 1), new WeightedRandomChestContent(Item.func_150898_a(Blocks.field_150448_aq), 0, 4, 8, 1), new WeightedRandomChestContent(Items.field_151081_bc, 0, 2, 4, 10), new WeightedRandomChestContent(Items.field_151080_bb, 0, 2, 4, 10), new WeightedRandomChestContent(Items.field_151141_av, 0, 1, 1, 3), new WeightedRandomChestContent(Items.field_151138_bX, 0, 1, 1, 1)}; +@@ -349,14 +352,15 @@ + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k - 1, Blocks.field_150478_aa, 0); + this.func_151552_a(p_74875_1_, p_74875_3_, p_74875_2_, 0.05F, 1, 2, k + 1, Blocks.field_150478_aa, 0); + ++ ChestGenHooks info = ChestGenHooks.getInfo(MINESHAFT_CORRIDOR); + if (p_74875_2_.nextInt(100) == 0) + { +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.field_78818_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 2, 0, k - 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + if (p_74875_2_.nextInt(100) == 0) + { +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.field_78818_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 3 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 0, 0, k + 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + if (this.field_74956_b && !this.field_74957_c) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStart.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStart.java.patch new file mode 100644 index 0000000..9615cd3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStart.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStart.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStart.java +@@ -62,6 +62,10 @@ + + public NBTTagCompound func_143021_a(int p_143021_1_, int p_143021_2_) + { ++ if (MapGenStructureIO.func_143033_a(this) == null) // 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(); + nbttagcompound.func_74778_a("id", MapGenStructureIO.func_143033_a(this)); + nbttagcompound.func_74768_a("ChunkX", p_143021_1_); +@@ -97,7 +101,8 @@ + + for (int i = 0; i < nbttaglist.func_74745_c(); ++i) + { +- this.field_75075_a.add(MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_)); ++ StructureComponent tmp = MapGenStructureIO.func_143032_b(nbttaglist.func_150305_b(i), p_143020_1_); ++ if (tmp != null) this.field_75075_a.add(tmp); //Forge: Prevent NPEs further down the line when a component can't be loaded. + } + + this.func_143017_b(p_143020_2_); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch new file mode 100644 index 0000000..a8950b6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureStrongholdPieces.java +@@ -12,6 +12,9 @@ + import net.minecraft.world.ChunkPosition; + import net.minecraft.world.World; + ++import net.minecraftforge.common.ChestGenHooks; ++import static net.minecraftforge.common.ChestGenHooks.*; ++ + public class StructureStrongholdPieces + { + private static final StructureStrongholdPieces.PieceWeight[] field_75205_b = new StructureStrongholdPieces.PieceWeight[] {new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Straight.class, 40, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Prison.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.LeftTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RightTurn.class, 20, 0), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.RoomCrossing.class, 10, 6), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.StairsStraight.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Stairs.class, 5, 5), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Crossing.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.ChestCorridor.class, 5, 4), new StructureStrongholdPieces.PieceWeight(StructureStrongholdPieces.Library.class, 10, 2) +@@ -305,7 +308,7 @@ + if (p_74875_3_.func_78890_b(j, i, k)) + { + this.field_75002_c = true; +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, WeightedRandomChestContent.func_92080_a(field_75003_a, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 2 + p_74875_2_.nextInt(2)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 2, 3, ChestGenHooks.getItems(STRONGHOLD_CORRIDOR, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CORRIDOR, p_74875_2_)); + } + } + +@@ -744,12 +747,14 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150478_aa, 0, b1, 8, b2 + 1, p_74875_3_); + } + +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, WeightedRandomChestContent.func_92080_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); ++ ChestGenHooks info = ChestGenHooks.getInfo(STRONGHOLD_LIBRARY); + ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 3, 5, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); ++ + if (this.field_75008_c) + { + this.func_151550_a(p_74875_1_, Blocks.field_150350_a, 0, 12, 9, 1, p_74875_3_); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, WeightedRandomChestContent.func_92080_a(field_75007_b, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92112_a(p_74875_2_, 1, 5, 2)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 12, 8, 1, info.getItems(p_74875_2_), info.getCount(p_74875_2_)); + } + + return true; +@@ -1160,7 +1165,7 @@ + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 1, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 2, 3, p_74875_3_); + this.func_151550_a(p_74875_1_, Blocks.field_150468_ap, this.func_151555_a(Blocks.field_150468_ap, 4), 9, 3, 3, p_74875_3_); +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, WeightedRandomChestContent.func_92080_a(field_75014_c, new WeightedRandomChestContent[] {Items.field_151134_bR.func_92114_b(p_74875_2_)}), 1 + p_74875_2_.nextInt(4)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 3, 4, 8, ChestGenHooks.getItems(STRONGHOLD_CROSSING, p_74875_2_), ChestGenHooks.getCount(STRONGHOLD_CROSSING, p_74875_2_)); + } + + return true; diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch new file mode 100644 index 0000000..69179e6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -0,0 +1,83 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +@@ -4,7 +4,7 @@ + import java.util.Iterator; + import java.util.List; + import java.util.Random; +- ++import cpw.mods.fml.common.eventhandler.Event.Result; + import cpw.mods.fml.common.registry.VillagerRegistry; + import net.minecraft.block.Block; + import net.minecraft.block.material.Material; +@@ -18,6 +18,10 @@ + import net.minecraft.world.World; + import net.minecraft.world.biome.BiomeGenBase; + import net.minecraft.world.biome.WorldChunkManager; ++import net.minecraftforge.common.ChestGenHooks; ++import net.minecraftforge.common.MinecraftForge; ++import net.minecraftforge.event.terraingen.BiomeEvent; ++import static net.minecraftforge.common.ChestGenHooks.*; + + public class StructureVillagePieces + { +@@ -927,7 +931,7 @@ + if (p_74875_3_.func_78890_b(j, i, k)) + { + this.field_74917_c = true; +- this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, field_74918_a, 3 + p_74875_2_.nextInt(6)); ++ this.func_74879_a(p_74875_1_, p_74875_3_, p_74875_2_, 5, 1, 5, ChestGenHooks.getItems(VILLAGE_BLACKSMITH, p_74875_2_), ChestGenHooks.getCount(VILLAGE_BLACKSMITH, p_74875_2_)); + } + } + +@@ -1424,6 +1428,7 @@ + public List field_74932_i = new ArrayList(); + public List field_74930_j = new ArrayList(); + private static final String __OBFID = "CL_00000527"; ++ public BiomeGenBase biome; + + public Start() {} + +@@ -1435,6 +1440,7 @@ + this.field_74928_c = p_i2104_7_; + BiomeGenBase biomegenbase = p_i2104_1_.func_76935_a(p_i2104_4_, p_i2104_5_); + this.field_74927_b = biomegenbase == BiomeGenBase.field_76769_d || biomegenbase == BiomeGenBase.field_76786_s; ++ this.biome = biomegenbase; + } + + public WorldChunkManager func_74925_d() +@@ -1495,6 +1501,7 @@ + private int field_74896_a; + private boolean field_143014_b; + private static final String __OBFID = "CL_00000531"; ++ private StructureVillagePieces.Start startPiece; + + public Village() {} + +@@ -1505,6 +1512,7 @@ + if (p_i2107_1_ != null) + { + this.field_143014_b = p_i2107_1_.field_74927_b; ++ startPiece = p_i2107_1_; + } + } + +@@ -1618,6 +1626,9 @@ + + protected Block func_151558_b(Block p_151558_1_, int p_151558_2_) + { ++ BiomeEvent.GetVillageBlockID event = new BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_151558_1_, p_151558_2_); ++ MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ if (event.getResult() == Result.DENY) return event.replacement; + if (this.field_143014_b) + { + if (p_151558_1_ == Blocks.field_150364_r || p_151558_1_ == Blocks.field_150363_s) +@@ -1656,6 +1667,9 @@ + + protected int func_151557_c(Block p_151557_1_, int p_151557_2_) + { ++ BiomeEvent.GetVillageBlockMeta event = new BiomeEvent.GetVillageBlockMeta(startPiece == null ? null : startPiece.biome, p_151557_1_, p_151557_2_); ++ MinecraftForge.TERRAIN_GEN_BUS.post(event); ++ if (event.getResult() == Result.DENY) return event.replacement; + if (this.field_143014_b) + { + if (p_151557_1_ == Blocks.field_150364_r || p_151557_1_ == Blocks.field_150363_s) diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/MapData.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/MapData.java.patch new file mode 100644 index 0000000..99d1166 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/MapData.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/MapData.java ++++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java +@@ -156,7 +156,7 @@ + p_82567_8_ += p_82567_8_ < 0.0D ? -8.0D : 8.0D; + b2 = (byte)((int)(p_82567_8_ * 16.0D / 360.0D)); + +- if (this.field_76200_c < 0) ++ if (p_82567_2_.field_73011_w.shouldMapSpin(p_82567_3_, p_82567_4_, p_82567_6_, p_82567_8_)) + { + int k = (int)(p_82567_2_.func_72912_H().func_76073_f() / 10L); + b2 = (byte)(k * k * 34187121 + k * 121 >> 15 & 15); diff --git a/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/SaveHandler.java.patch b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/SaveHandler.java.patch new file mode 100644 index 0000000..3e8518a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/SaveHandler.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java +@@ -256,6 +256,7 @@ + } + + file1.renameTo(file2); ++ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_75753_1_, this.field_75771_c, p_75753_1_.func_110124_au().toString()); + } + catch (Exception exception) + { +@@ -286,6 +287,7 @@ + p_75752_1_.func_70020_e(nbttagcompound); + } + ++ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_75752_1_, field_75771_c, p_75752_1_.func_110124_au().toString()); + return nbttagcompound; + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/block/Block.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/block/Block.java.patch new file mode 100644 index 0000000..5bc6e21 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/block/Block.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/block/Block.java ++++ ../src-work/minecraft/net/minecraft/block/Block.java +@@ -1,5 +1,6 @@ + package net.minecraft.block; + ++import cpw.mods.fml.common.registry.GameData; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.Iterator; +@@ -32,7 +33,7 @@ + + public class Block + { +- public static final RegistryNamespaced field_149771_c = new RegistryNamespacedDefaultedByKey("air"); ++ public static final RegistryNamespaced field_149771_c = GameData.getBlockRegistry(); + private CreativeTabs field_149772_a; + protected String field_149768_d; + public static final Block.SoundType field_149769_e = new Block.SoundType("stone", 1.0F, 1.0F); +@@ -102,6 +103,8 @@ + protected IIcon field_149761_L; + private static final String __OBFID = "CL_00000199"; + ++ public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ++ ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)field_149771_c).getDelegate(this, Block.class); + public static int func_149682_b(Block p_149682_0_) + { + return field_149771_c.func_148757_b(p_149682_0_); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/ClientBrandRetriever.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/ClientBrandRetriever.java.patch new file mode 100644 index 0000000..e5bebc3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/ClientBrandRetriever.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/client/ClientBrandRetriever.java ++++ ../src-work/minecraft/net/minecraft/client/ClientBrandRetriever.java +@@ -1,5 +1,6 @@ + package net.minecraft.client; + ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + +@@ -10,6 +11,6 @@ + + public static String getClientModName() + { +- return "vanilla"; ++ return FMLCommonHandler.instance().getModName(); + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/LoadingScreenRenderer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/LoadingScreenRenderer.java.patch new file mode 100644 index 0000000..80ad37a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/LoadingScreenRenderer.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/LoadingScreenRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/LoadingScreenRenderer.java +@@ -1,5 +1,6 @@ + package net.minecraft.client; + ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.gui.Gui; +@@ -138,6 +139,8 @@ + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + } + ++ if (!FMLClientHandler.instance().handleLoadingScreen(scaledresolution)) ++ { + Tessellator tessellator = Tessellator.field_78398_a; + this.field_73725_b.func_110434_K().func_110577_a(Gui.field_110325_k); + float f = 32.0F; +@@ -175,6 +178,7 @@ + OpenGlHelper.func_148821_a(770, 771, 1, 0); + this.field_73725_b.field_71466_p.func_78261_a(this.field_73726_c, (l - this.field_73725_b.field_71466_p.func_78256_a(this.field_73726_c)) / 2, i1 / 2 - 4 - 16, 16777215); + this.field_73725_b.field_71466_p.func_78261_a(this.field_73727_a, (l - this.field_73725_b.field_71466_p.func_78256_a(this.field_73727_a)) / 2, i1 / 2 - 4 + 8, 16777215); ++ } + this.field_146588_g.func_147609_e(); + + if (OpenGlHelper.func_148822_b()) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/Minecraft.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/Minecraft.java.patch new file mode 100644 index 0000000..5702cca --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/Minecraft.java.patch @@ -0,0 +1,199 @@ +--- ../src-base/minecraft/net/minecraft/client/Minecraft.java ++++ ../src-work/minecraft/net/minecraft/client/Minecraft.java +@@ -9,6 +9,9 @@ + import com.google.common.util.concurrent.ListenableFutureTask; + import com.mojang.authlib.minecraft.MinecraftSessionService; + import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; ++import cpw.mods.fml.client.FMLClientHandler; ++import cpw.mods.fml.common.FMLCommonHandler; ++import cpw.mods.fml.common.StartupQuery; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.util.concurrent.GenericFutureListener; +@@ -169,6 +172,8 @@ + import org.lwjgl.opengl.PixelFormat; + import org.lwjgl.util.glu.GLU; + ++import com.google.common.collect.MapDifference; ++ + @SideOnly(Side.CLIENT) + public class Minecraft implements IPlayerUsage + { +@@ -344,21 +349,23 @@ + File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); + System.out.println(p_71377_1_.func_71502_e()); + ++ int retVal; + if (p_71377_1_.func_71497_f() != null) + { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + p_71377_1_.func_71497_f()); +- System.exit(-1); ++ retVal = -1; + } + else if (p_71377_1_.func_147149_a(file2)) + { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + file2.getAbsolutePath()); +- System.exit(-1); ++ retVal = -1; + } + else + { + System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); +- System.exit(-2); ++ retVal = -2; + } ++ FMLCommonHandler.instance().handleExit(retVal); + } + + public void func_71367_a(String p_71367_1_, int p_71367_2_) +@@ -471,11 +478,11 @@ + this.field_110451_am = new SimpleReloadableResourceManager(this.field_110452_an); + this.field_135017_as = new LanguageManager(this.field_110452_an, this.field_71474_y.field_74363_ab); + this.field_110451_am.func_110542_a(this.field_135017_as); +- this.func_110436_a(); ++ FMLClientHandler.instance().beginMinecraftLoading(this, this.field_110449_ao, this.field_110451_am); + this.field_71446_o = new TextureManager(this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71446_o); + this.field_152350_aA = new SkinManager(this.field_71446_o, new File(this.field_110446_Y, "skins"), this.field_152355_az); +- this.func_71357_I(); ++ cpw.mods.fml.client.SplashProgress.drawVanillaScreen(); + this.field_147127_av = new SoundHandler(this.field_110451_am, this.field_71474_y); + this.field_110451_am.func_110542_a(this.field_147127_av); + this.field_147126_aw = new MusicTicker(this); +@@ -492,7 +499,10 @@ + this.field_110451_am.func_110542_a(this.field_71464_q); + this.field_110451_am.func_110542_a(new GrassColorReloadListener()); + this.field_110451_am.func_110542_a(new FoliageColorReloadListener()); ++ cpw.mods.fml.common.ProgressManager.ProgressBar bar= cpw.mods.fml.common.ProgressManager.push("Rendering Setup", 9, true); ++ bar.step("Loading Render Manager"); + RenderManager.field_78727_a.field_78721_f = new ItemRenderer(this); ++ bar.step("Loading Entity Renderer"); + this.field_71460_t = new EntityRenderer(this, this.field_110451_am); + this.field_110451_am.func_110542_a(this.field_71460_t); + AchievementList.field_76004_f.func_75988_a(new IStatStringFormat() +@@ -510,6 +520,7 @@ + } + } + }); ++ bar.step("Loading GL properties"); + this.field_71417_B = new MouseHelper(); + this.func_71361_d("Pre startup"); + GL11.glEnable(GL11.GL_TEXTURE_2D); +@@ -524,30 +535,39 @@ + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.func_71361_d("Startup"); ++ bar.step("Render Global instance"); + this.field_71438_f = new RenderGlobal(this); +- this.field_147128_au = new TextureMap(0, "textures/blocks"); ++ bar.step("Building Blocks Texture"); ++ this.field_147128_au = new TextureMap(0, "textures/blocks", true); ++ bar.step("Anisotropy and Mipmaps"); + this.field_147128_au.func_147632_b(this.field_71474_y.field_151443_J); + this.field_147128_au.func_147633_a(this.field_71474_y.field_151442_I); ++ bar.step("Loading Blocks Texture"); + this.field_71446_o.func_130088_a(TextureMap.field_110575_b, this.field_147128_au); +- this.field_71446_o.func_130088_a(TextureMap.field_110576_c, new TextureMap(1, "textures/items")); ++ bar.step("Loading Items Texture"); ++ this.field_71446_o.func_130088_a(TextureMap.field_110576_c, new TextureMap(1, "textures/items", true)); ++ bar.step("Viewport"); + GL11.glViewport(0, 0, this.field_71443_c, this.field_71440_d); + this.field_71452_i = new EffectRenderer(this.field_71441_e, this.field_71446_o); ++ cpw.mods.fml.common.ProgressManager.pop(bar); ++ FMLClientHandler.instance().finishMinecraftLoading(); + this.func_71361_d("Post startup"); + this.field_71456_v = new GuiIngame(this); + + if (this.field_71475_ae != null) + { +- this.func_147108_a(new GuiConnecting(new GuiMainMenu(), this, this.field_71475_ae, this.field_71477_af)); ++ FMLClientHandler.instance().connectToServerAtStartup(this.field_71475_ae, this.field_71477_af); + } + else + { + this.func_147108_a(new GuiMainMenu()); + } + +- this.field_71446_o.func_147645_c(this.field_152354_ay); ++ cpw.mods.fml.client.SplashProgress.clearVanillaResources(field_71446_o, field_152354_ay); + this.field_152354_ay = null; + this.field_71461_s = new LoadingScreenRenderer(this); + ++ FMLClientHandler.instance().onInitializationComplete(); + if (this.field_71474_y.field_74353_u && !this.field_71431_Q) + { + this.func_71352_k(); +@@ -970,9 +990,11 @@ + + if (!this.field_71454_w) + { ++ FMLCommonHandler.instance().onRenderTickStart(this.field_71428_T.field_74281_c); + this.field_71424_I.func_76318_c("gameRenderer"); + this.field_71460_t.func_78480_b(this.field_71428_T.field_74281_c); + this.field_71424_I.func_76319_b(); ++ FMLCommonHandler.instance().onRenderTickEnd(this.field_71428_T.field_74281_c); + } + + GL11.glFlush(); +@@ -1554,6 +1576,8 @@ + --this.field_71467_ac; + } + ++ FMLCommonHandler.instance().onPreClientTick(); ++ + this.field_71424_I.func_76320_a("gui"); + + if (!this.field_71445_n) +@@ -1698,6 +1722,7 @@ + this.field_71462_r.func_146274_d(); + } + } ++ FMLCommonHandler.instance().fireMouseInput(); + } + + if (this.field_71429_W > 0) +@@ -1835,6 +1860,7 @@ + } + } + } ++ FMLCommonHandler.instance().fireKeyInput(); + } + + for (j = 0; j < 9; ++j) +@@ -2025,12 +2051,15 @@ + this.field_71453_ak.func_74428_b(); + } + ++ FMLCommonHandler.instance().onPostClientTick(); ++ + this.field_71424_I.func_76319_b(); + this.field_71423_H = func_71386_F(); + } + + public void func_71371_a(String p_71371_1_, String p_71371_2_, WorldSettings p_71371_3_) + { ++ 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); +@@ -2066,6 +2095,12 @@ + + while (!this.field_71437_Z.func_71200_ad()) + { ++ if (!StartupQuery.check()) ++ { ++ func_71403_a(null); ++ func_147108_a(null); ++ return; ++ } + String s2 = this.field_71437_Z.func_71195_b_(); + + if (s2 != null) +@@ -2141,6 +2176,7 @@ + this.field_110448_aq.func_148529_f(); + this.func_71351_a((ServerData)null); + this.field_71455_al = false; ++ FMLClientHandler.instance().handleClientWorldClosing(this.field_71441_e); + } + + this.field_147127_av.func_147690_c(); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/FontRenderer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/FontRenderer.java.patch new file mode 100644 index 0000000..4aa0d6f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/FontRenderer.java.patch @@ -0,0 +1,124 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/FontRenderer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/FontRenderer.java +@@ -54,7 +54,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) + { +@@ -102,7 +102,7 @@ + + try + { +- bufferedimage = ImageIO.read(Minecraft.func_71410_x().func_110442_L().func_110536_a(this.field_111273_g).func_110527_b()); ++ bufferedimage = ImageIO.read(getResourceInputStream(this.field_111273_g)); + } + catch (IOException ioexception) + { +@@ -167,7 +167,7 @@ + { + try + { +- InputStream inputstream = Minecraft.func_71410_x().func_110442_L().func_110536_a(new ResourceLocation("font/glyph_sizes.bin")).func_110527_b(); ++ InputStream inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); + inputstream.read(this.field_78287_e); + } + catch (IOException ioexception) +@@ -186,7 +186,7 @@ + float f = (float)(p_78266_1_ % 16 * 8); + float f1 = (float)(p_78266_1_ / 16 * 8); + float f2 = p_78266_2_ ? 1.0F : 0.0F; +- this.field_78298_i.func_110577_a(this.field_111273_g); ++ bindTexture(this.field_111273_g); + float f3 = (float)this.field_78286_d[p_78266_1_] - 0.01F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(f / 128.0F, f1 / 128.0F); +@@ -213,7 +213,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_) +@@ -260,7 +260,7 @@ + + public int func_85187_a(String p_85187_1_, int p_85187_2_, int p_85187_3_, int p_85187_4_, boolean p_85187_5_) + { +- GL11.glEnable(GL11.GL_ALPHA_TEST); ++ enableAlpha(); + this.func_78265_b(); + int l; + +@@ -332,7 +332,7 @@ + + k = this.field_78285_g[j]; + this.field_78304_r = k; +- GL11.glColor4f((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.field_78305_q); ++ setColor((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.field_78305_q); + } + else if (j == 16) + { +@@ -361,7 +361,7 @@ + this.field_78299_w = false; + this.field_78300_v = false; + this.field_78301_u = false; +- GL11.glColor4f(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; +@@ -420,6 +420,15 @@ + ++f; + } + ++ doDraw(f); ++ } ++ } ++ } ++ ++ protected void doDraw(float f) ++ { ++ { ++ { + Tessellator tessellator; + + if (this.field_78299_w) +@@ -492,7 +501,7 @@ + this.field_78292_o = (float)(p_78258_4_ >> 8 & 255) / 255.0F; + this.field_78306_p = (float)(p_78258_4_ & 255) / 255.0F; + this.field_78305_q = (float)(p_78258_4_ >> 24 & 255) / 255.0F; +- GL11.glColor4f(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 = (float)p_78258_2_; + this.field_78296_k = (float)p_78258_3_; + this.func_78255_a(p_78258_1_, p_78258_5_); +@@ -829,4 +838,24 @@ + { + return this.field_78294_m; + } ++ ++ protected void setColor(float r, float g, float b, float a) ++ { ++ GL11.glColor4f(r, g, b, a); ++ } ++ ++ protected void enableAlpha() ++ { ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ ++ protected void bindTexture(ResourceLocation location) ++ { ++ field_78298_i.func_110577_a(location); ++ } ++ ++ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException ++ { ++ return Minecraft.func_71410_x().func_110442_L().func_110536_a(location).func_110527_b(); ++ } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiButton.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiButton.java.patch new file mode 100644 index 0000000..a48f520 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiButton.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiButton.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiButton.java +@@ -23,6 +23,7 @@ + public boolean field_146125_m; + protected boolean field_146123_n; + private static final String __OBFID = "CL_00000668"; ++ public int packedFGColour; + + public GuiButton(int p_i1020_1_, int p_i1020_2_, int p_i1020_3_, String p_i1020_4_) + { +@@ -76,8 +77,12 @@ + this.func_146119_b(p_146112_1_, p_146112_2_, p_146112_3_); + int l = 14737632; + +- if (!this.field_146124_l) ++ if (packedFGColour != 0) + { ++ l = packedFGColour; ++ } ++ else if (!this.field_146124_l) ++ { + l = 10526880; + } + else if (this.field_146123_n) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiCreateWorld.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiCreateWorld.java.patch new file mode 100644 index 0000000..ddf21ad --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiCreateWorld.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java +@@ -211,6 +211,8 @@ + } + } + ++ WorldType.field_77139_a[this.field_146331_K].onGUICreateWorldPress(); ++ + WorldSettings.GameType gametype = WorldSettings.GameType.func_77142_a(this.field_146342_r); + WorldSettings worldsettings = new WorldSettings(i, gametype, this.field_146341_s, this.field_146337_w, WorldType.field_77139_a[this.field_146331_K]); + worldsettings.func_82750_a(this.field_146334_a); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngame.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngame.java.patch new file mode 100644 index 0000000..9f790ee --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngame.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngame.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngame.java +@@ -1,5 +1,6 @@ + package net.minecraft.client.gui; + ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.awt.Color; +@@ -314,6 +315,11 @@ + this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 2, 14737632); + s = "Allocated memory: " + j5 * 100L / i5 + "% (" + j5 / 1024L / 1024L + "MB)"; + this.func_73731_b(fontrenderer, s, k - fontrenderer.func_78256_a(s) - 2, 12, 14737632); ++ int offset = 22; ++ for (String brd : FMLCommonHandler.instance().getBrandings(false)) ++ { ++ this.func_73731_b(fontrenderer, brd, k - fontrenderer.func_78256_a(brd) - 2, offset+=10, 14737632); ++ } + j3 = MathHelper.func_76128_c(this.field_73839_d.field_71439_g.field_70165_t); + k3 = MathHelper.func_76128_c(this.field_73839_d.field_71439_g.field_70163_u); + int l3 = MathHelper.func_76128_c(this.field_73839_d.field_71439_g.field_70161_v); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngameMenu.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngameMenu.java.patch new file mode 100644 index 0000000..5b0bf35 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngameMenu.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiIngameMenu.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiIngameMenu.java +@@ -1,5 +1,6 @@ + package net.minecraft.client.gui; + ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.gui.achievement.GuiAchievements; +@@ -29,8 +30,9 @@ + + this.field_146292_n.add(new GuiButton(4, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 24 + b0, I18n.func_135052_a("menu.returnToGame", new Object[0]))); + this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 96 + b0, 98, 20, I18n.func_135052_a("menu.options", new Object[0]))); ++ this.field_146292_n.add(new GuiButton(12, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + b0, 98, 20, "Mod Options...")); + GuiButton guibutton; +- this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 96 + b0, 98, 20, I18n.func_135052_a("menu.shareToLan", new Object[0]))); ++ this.field_146292_n.add(guibutton = new GuiButton(7, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 72 + b0, 200, 20, I18n.func_135052_a("menu.shareToLan", new Object[0]))); + this.field_146292_n.add(new GuiButton(5, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 48 + b0, 98, 20, I18n.func_135052_a("gui.achievements", new Object[0]))); + this.field_146292_n.add(new GuiButton(6, this.field_146294_l / 2 + 2, this.field_146295_m / 4 + 48 + b0, 98, 20, I18n.func_135052_a("gui.stats", new Object[0]))); + guibutton.field_146124_l = this.field_146297_k.func_71356_B() && !this.field_146297_k.func_71401_C().func_71344_c(); +@@ -64,6 +66,10 @@ + break; + case 7: + this.field_146297_k.func_147108_a(new GuiShareToLan(this)); ++ break; ++ case 12: ++ FMLClientHandler.instance().showInGameModOptions(this); ++ break; + } + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMainMenu.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMainMenu.java.patch new file mode 100644 index 0000000..b45766b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMainMenu.java.patch @@ -0,0 +1,72 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiMainMenu.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiMainMenu.java +@@ -1,5 +1,7 @@ + package net.minecraft.client.gui; + ++import cpw.mods.fml.client.GuiModList; ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedReader; +@@ -9,6 +11,7 @@ + import java.util.ArrayList; + import java.util.Calendar; + import java.util.Date; ++import java.util.List; + import java.util.Random; + import net.minecraft.client.Minecraft; + import net.minecraft.client.renderer.OpenGlHelper; +@@ -29,6 +32,9 @@ + import org.lwjgl.opengl.GLContext; + import org.lwjgl.util.glu.Project; + ++import com.google.common.base.Strings; ++import com.google.common.collect.Lists; ++ + @SideOnly(Side.CLIENT) + public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback + { +@@ -190,7 +196,13 @@ + { + this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 100, p_73969_1_, I18n.func_135052_a("menu.singleplayer", new Object[0]))); + this.field_146292_n.add(new GuiButton(2, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.func_135052_a("menu.multiplayer", new Object[0]))); +- this.field_146292_n.add(new GuiButton(14, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("menu.online", new Object[0]))); ++ GuiButton realmsButton = new GuiButton(14, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.func_135052_a("menu.online", new Object[0])); ++ GuiButton fmlModButton = new GuiButton(6, this.field_146294_l / 2 - 100, p_73969_1_ + p_73969_2_ * 2, "Mods"); ++ fmlModButton.field_146128_h = this.field_146294_l / 2 + 2; ++ realmsButton.field_146120_f = 98; ++ fmlModButton.field_146120_f = 98; ++ this.field_146292_n.add(realmsButton); ++ this.field_146292_n.add(fmlModButton); + } + + private void func_73972_b(int p_73972_1_, int p_73972_2_) +@@ -238,6 +250,11 @@ + this.field_146297_k.func_71400_g(); + } + ++ if (p_146284_1_.field_146127_k == 6) ++ { ++ this.field_146297_k.func_147108_a(new GuiModList(this)); ++ } ++ + if (p_146284_1_.field_146127_k == 11) + { + this.field_146297_k.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a); +@@ -481,7 +498,15 @@ + s = s + " Demo"; + } + +- this.func_73731_b(this.field_146289_q, s, 2, this.field_146295_m - 10, -1); ++ List brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true)); ++ for (int i = 0; i < brandings.size(); i++) ++ { ++ String brd = brandings.get(i); ++ if (!Strings.isNullOrEmpty(brd)) ++ { ++ this.func_73731_b(this.field_146289_q, brd, 2, this.field_146295_m - ( 10 + i * (this.field_146289_q.field_78288_b + 1)), 16777215); ++ } ++ } + String s1 = "Copyright Mojang AB. Do not distribute!"; + this.func_73731_b(this.field_146289_q, s1, this.field_146294_l - this.field_146289_q.func_78256_a(s1) - 2, this.field_146295_m - 10, -1); + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMultiplayer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMultiplayer.java.patch new file mode 100644 index 0000000..a65e90b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMultiplayer.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiMultiplayer.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiMultiplayer.java +@@ -2,6 +2,7 @@ + + import com.google.common.base.Splitter; + import com.google.common.collect.Lists; ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.List; +@@ -40,6 +41,7 @@ + public GuiMultiplayer(GuiScreen p_i1040_1_) + { + this.field_146798_g = p_i1040_1_; ++ FMLClientHandler.instance().setupServerList(); + } + + public void func_73866_w_() +@@ -366,7 +368,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_)); ++ FMLClientHandler.instance().connectToServer(this, p_146791_1_); + } + + public void func_146790_a(int p_146790_1_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiSelectWorld.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiSelectWorld.java.patch new file mode 100644 index 0000000..bd14fce --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiSelectWorld.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/GuiSelectWorld.java ++++ ../src-work/minecraft/net/minecraft/client/gui/GuiSelectWorld.java +@@ -1,5 +1,6 @@ + package net.minecraft.client.gui; + ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.text.DateFormat; +@@ -179,7 +180,7 @@ + + if (this.field_146297_k.func_71359_d().func_90033_f(s)) + { +- this.field_146297_k.func_71371_a(s, s1, (WorldSettings)null); ++ FMLClientHandler.instance().tryLoadExistingWorld(this, s, s1); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/ServerListEntryNormal.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/ServerListEntryNormal.java.patch new file mode 100644 index 0000000..d103b15 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/ServerListEntryNormal.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java ++++ ../src-work/minecraft/net/minecraft/client/gui/ServerListEntryNormal.java +@@ -2,6 +2,7 @@ + + import com.google.common.base.Charsets; + import com.google.common.util.concurrent.ThreadFactoryBuilder; ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.buffer.ByteBuf; +@@ -83,7 +84,7 @@ + boolean flag2 = this.field_148301_e.field_82821_f < 5; + boolean flag3 = flag1 || flag2; + this.field_148300_d.field_71466_p.func_78276_b(this.field_148301_e.field_78847_a, p_148279_2_ + 32 + 3, p_148279_3_ + 1, 16777215); +- List list = this.field_148300_d.field_71466_p.func_78271_c(this.field_148301_e.field_78843_d, p_148279_4_ - 32 - 2); ++ List list = this.field_148300_d.field_71466_p.func_78271_c(FMLClientHandler.instance().fixDescription(this.field_148301_e.field_78843_d), p_148279_4_ - 48 - 2); + + for (int l1 = 0; l1 < Math.min(list.size(), 2); ++l1) + { +@@ -174,6 +175,11 @@ + int k2 = p_148279_7_ - p_148279_2_; + int l2 = p_148279_8_ - p_148279_3_; + ++ String tooltip = FMLClientHandler.instance().enhanceServerListEntry(this, this.field_148301_e, p_148279_2_, p_148279_4_, p_148279_3_, k2, l2); ++ if (tooltip != null) ++ { ++ this.field_148303_c.func_146793_a(tooltip); ++ } else + if (k2 >= p_148279_4_ - 15 && k2 <= p_148279_4_ - 5 && l2 >= 0 && l2 <= 8) + { + this.field_148303_c.func_146793_a(s1); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerLoginClient.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerLoginClient.java.patch new file mode 100644 index 0000000..5162680 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerLoginClient.java.patch @@ -0,0 +1,41 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerLoginClient.java +@@ -5,6 +5,9 @@ + import com.mojang.authlib.exceptions.InvalidCredentialsException; + import com.mojang.authlib.minecraft.MinecraftSessionService; + import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; ++ ++import cpw.mods.fml.client.FMLClientHandler; ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.util.concurrent.Future; +@@ -23,6 +26,7 @@ + import net.minecraft.network.login.server.S00PacketDisconnect; + import net.minecraft.network.login.server.S01PacketEncryptionRequest; + import net.minecraft.network.login.server.S02PacketLoginSuccess; ++import net.minecraft.network.play.client.C17PacketCustomPayload; + import net.minecraft.util.ChatComponentTranslation; + import net.minecraft.util.CryptManager; + import net.minecraft.util.IChatComponent; +@@ -100,7 +104,7 @@ + + public void func_147390_a(S02PacketLoginSuccess p_147390_1_) + { +- this.field_147393_d.func_150723_a(EnumConnectionState.PLAY); ++ FMLNetworkHandler.fmlClientHandshake(this.field_147393_d); + } + + public void func_147231_a(IChatComponent p_147231_1_) +@@ -114,7 +118,10 @@ + + if (p_147232_2_ == EnumConnectionState.PLAY) + { +- this.field_147393_d.func_150719_a(new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d)); ++ NetHandlerPlayClient nhpc = new NetHandlerPlayClient(this.field_147394_b, this.field_147395_c, this.field_147393_d); ++ this.field_147393_d.func_150719_a(nhpc); ++ FMLClientHandler.instance().setPlayClient(nhpc); ++ + } + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerPlayClient.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerPlayClient.java.patch new file mode 100644 index 0000000..9580eba --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerPlayClient.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java ++++ ../src-work/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +@@ -2,6 +2,7 @@ + + import com.google.common.base.Charsets; + import com.mojang.authlib.GameProfile; ++import cpw.mods.fml.common.network.handshake.NetworkDispatcher; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.buffer.ByteBuf; +@@ -232,7 +233,7 @@ + public void func_147282_a(S01PacketJoinGame p_147282_1_) + { + this.field_147299_f.field_71442_b = new PlayerControllerMP(this.field_147299_f, this); +- this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), p_147282_1_.func_149194_f(), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); ++ this.field_147300_g = new WorldClient(this, new WorldSettings(0L, p_147282_1_.func_149198_e(), false, p_147282_1_.func_149195_d(), p_147282_1_.func_149196_i()), NetworkDispatcher.get(func_147298_b()).getOverrideDimension(p_147282_1_), p_147282_1_.func_149192_g(), this.field_147299_f.field_71424_I); + this.field_147300_g.field_72995_K = true; + this.field_147299_f.func_71403_a(this.field_147300_g); + this.field_147299_f.field_71439_g.field_71093_bK = p_147282_1_.func_149194_f(); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/OldServerPinger.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/OldServerPinger.java.patch new file mode 100644 index 0000000..73bd329 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/OldServerPinger.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/network/OldServerPinger.java ++++ ../src-work/minecraft/net/minecraft/client/network/OldServerPinger.java +@@ -4,6 +4,7 @@ + import com.google.common.base.Splitter; + import com.google.common.collect.Iterables; + import com.mojang.authlib.GameProfile; ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.bootstrap.Bootstrap; +@@ -147,6 +148,7 @@ + p_147224_1_.func_147407_a((String)null); + } + ++ FMLClientHandler.instance().bindServerListData(p_147224_1_, serverstatusresponse); + networkmanager.func_150725_a(new C01PacketPing(Minecraft.func_71386_F()), new GenericFutureListener[0]); + this.field_147403_d = true; + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/RenderBlocks.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/RenderBlocks.java.patch new file mode 100644 index 0000000..dcbf432 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/RenderBlocks.java.patch @@ -0,0 +1,102 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/RenderBlocks.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/RenderBlocks.java +@@ -40,6 +40,7 @@ + import net.minecraft.init.Blocks; + import net.minecraft.item.Item; + import net.minecraft.item.ItemBlock; ++import net.minecraft.src.FMLRenderAccessLibrary; + import net.minecraft.tileentity.TileEntity; + import net.minecraft.tileentity.TileEntityFlowerPot; + import net.minecraft.util.Direction; +@@ -245,7 +246,53 @@ + { + p_147805_1_.func_149719_a(this.field_147845_a, p_147805_2_, p_147805_3_, p_147805_4_); + this.func_147775_a(p_147805_1_); +- return l == 0 ? this.func_147784_q(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 4 ? this.func_147721_p(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 31 ? this.func_147742_r(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 1 ? this.func_147746_l(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 40 ? this.func_147774_a((BlockDoublePlant)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 2 ? this.func_147791_c(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 20 ? this.func_147726_j(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 11 ? this.func_147735_a((BlockFence)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 39 ? this.func_147779_s(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 5 ? this.func_147788_h(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 13 ? this.func_147755_t(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 9 ? this.func_147766_a((BlockRailBase)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 19 ? this.func_147724_m(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 23 ? this.func_147783_o(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 6 ? this.func_147796_n(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 3 ? this.func_147801_a((BlockFire)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 8 ? this.func_147794_i(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 7 ? this.func_147760_u(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 10 ? this.func_147722_a((BlockStairs)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 27 ? this.func_147802_a((BlockDragonEgg)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 32 ? this.func_147807_a((BlockWall)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 12 ? this.func_147790_e(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 29 ? this.func_147723_f(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 30 ? this.func_147756_g(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 14 ? this.func_147773_v(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 15 ? this.func_147759_a((BlockRedstoneRepeater)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 36 ? this.func_147748_a((BlockRedstoneDiode)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 37 ? this.func_147781_a((BlockRedstoneComparator)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 16 ? this.func_147731_b(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, false) : (l == 17 ? this.func_147809_c(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, true) : (l == 18 ? this.func_147767_a((BlockPane)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 41 ? this.func_147733_k(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 21 ? this.func_147776_a((BlockFenceGate)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 24 ? this.func_147785_a((BlockCauldron)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 33 ? this.func_147752_a((BlockFlowerPot)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 35 ? this.func_147725_a((BlockAnvil)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 25 ? this.func_147741_a((BlockBrewingStand)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 26 ? this.func_147743_a((BlockEndPortalFrame)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 28 ? this.func_147772_a((BlockCocoa)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 34 ? this.func_147797_a((BlockBeacon)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : (l == 38 ? this.func_147803_a((BlockHopper)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) : false)))))))))))))))))))))))))))))))))))))))); ++ ++ switch (l) ++ { ++ //regex: ' : \(l == ([\d]+) \?' replace: ';\ncase \1: return' ::: IMPORTANT: REMEMBER THIS ON FIRST line! ++ case 0 : return this.func_147784_q(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 4: return this.func_147721_p(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 31: return this.func_147742_r(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 1: return this.func_147746_l(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 40: return this.func_147774_a((BlockDoublePlant)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 2: return this.func_147791_c(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 20: return this.func_147726_j(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 11: return this.func_147735_a((BlockFence)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 39: return this.func_147779_s(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 5: return this.func_147788_h(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 13: return this.func_147755_t(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 9: return this.func_147766_a((BlockRailBase)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 19: return this.func_147724_m(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 23: return this.func_147783_o(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 6: return this.func_147796_n(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 3: return this.func_147801_a((BlockFire)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 8: return this.func_147794_i(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 7: return this.func_147760_u(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 10: return this.func_147722_a((BlockStairs)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 27: return this.func_147802_a((BlockDragonEgg)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 32: return this.func_147807_a((BlockWall)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 12: return this.func_147790_e(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 29: return this.func_147723_f(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 30: return this.func_147756_g(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 14: return this.func_147773_v(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 15: return this.func_147759_a((BlockRedstoneRepeater)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 36: return this.func_147748_a((BlockRedstoneDiode)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 37: return this.func_147781_a((BlockRedstoneComparator)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 16: return this.func_147731_b(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, false) ; ++ case 17: return this.func_147809_c(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, true) ; ++ case 18: return this.func_147767_a((BlockPane)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 41: return this.func_147733_k(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 21: return this.func_147776_a((BlockFenceGate)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 24: return this.func_147785_a((BlockCauldron)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 33: return this.func_147752_a((BlockFlowerPot)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 35: return this.func_147725_a((BlockAnvil)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 25: return this.func_147741_a((BlockBrewingStand)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 26: return this.func_147743_a((BlockEndPortalFrame)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 28: return this.func_147772_a((BlockCocoa)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 34: return this.func_147797_a((BlockBeacon)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ; ++ case 38: return this.func_147803_a((BlockHopper)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_); ++ default: return FMLRenderAccessLibrary.renderWorldBlock(this, field_147845_a, p_147805_2_, p_147805_3_, p_147805_4_, p_147805_1_, l); ++ } + } + } + +@@ -8089,6 +8136,10 @@ + this.func_147799_a((BlockHopper)p_147800_1_, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } ++ else ++ { ++ FMLRenderAccessLibrary.renderInventoryBlock(this, p_147800_1_, p_147800_2_, j); ++ } + } + else + { +@@ -8147,7 +8198,24 @@ + + public static boolean func_147739_a(int p_147739_0_) + { +- return p_147739_0_ == 0 ? true : (p_147739_0_ == 31 ? true : (p_147739_0_ == 39 ? true : (p_147739_0_ == 13 ? true : (p_147739_0_ == 10 ? true : (p_147739_0_ == 11 ? true : (p_147739_0_ == 27 ? true : (p_147739_0_ == 22 ? true : (p_147739_0_ == 21 ? true : (p_147739_0_ == 16 ? true : (p_147739_0_ == 26 ? true : (p_147739_0_ == 32 ? true : (p_147739_0_ == 34 ? true : (p_147739_0_ == 35 ? true : (p_147739_0_ == -1 ? false : false)))))))))))))); ++ switch (p_147739_0_) ++ { ++ case 0 : return true ; ++ case 31: return true ; ++ case 39: return true ; ++ case 13: return true ; ++ case 10: return true ; ++ case 11: return true ; ++ case 27: return true ; ++ case 22: return true ; ++ case 21: return true ; ++ case 16: return true ; ++ case 26: return true ; ++ case 32: return true ; ++ case 34: return true ; ++ case 35: return true ; ++ default: return FMLRenderAccessLibrary.renderItemAsFull3DBlock(p_147739_0_); ++ } + } + + public IIcon func_147793_a(Block p_147793_1_, IBlockAccess p_147793_2_, int p_147793_3_, int p_147793_4_, int p_147793_5_, int p_147793_6_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/entity/RenderVillager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/entity/RenderVillager.java.patch new file mode 100644 index 0000000..0d20093 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/entity/RenderVillager.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/entity/RenderVillager.java +@@ -1,5 +1,6 @@ + package net.minecraft.client.renderer.entity; + ++import cpw.mods.fml.common.registry.VillagerRegistry; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.client.model.ModelVillager; +@@ -53,7 +54,7 @@ + case 4: + return field_110906_m; + default: +- return field_110903_f; ++ return VillagerRegistry.getVillagerSkin(p_110775_1_.func_70946_n(), field_110903_f); + } + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/Stitcher.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/Stitcher.java.patch new file mode 100644 index 0000000..ab2cfc4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/Stitcher.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/Stitcher.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/Stitcher.java +@@ -60,6 +60,7 @@ + public void func_94305_f() + { + Stitcher.Holder[] aholder = (Stitcher.Holder[])this.field_94319_a.toArray(new Stitcher.Holder[this.field_94319_a.size()]); ++ cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Texture stitching", aholder.length); + Arrays.sort(aholder); + Stitcher.Holder[] aholder1 = aholder; + int i = aholder.length; +@@ -67,6 +68,7 @@ + for (int j = 0; j < i; ++j) + { + Stitcher.Holder holder = aholder1[j]; ++ bar.step(holder.func_98150_a().func_94215_i()); + + if (!this.func_94310_b(holder)) + { +@@ -80,6 +82,7 @@ + this.field_94318_c = MathHelper.func_151236_b(this.field_94318_c); + this.field_94315_d = MathHelper.func_151236_b(this.field_94315_d); + } ++ cpw.mods.fml.common.ProgressManager.pop(bar); + } + + public List func_94309_g() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureManager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureManager.java.patch new file mode 100644 index 0000000..364d0cd --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureManager.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureManager.java +@@ -162,12 +162,15 @@ + + public void func_110549_a(IResourceManager p_110549_1_) + { ++ cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Reloading Texture Manager", this.field_110585_a.keySet().size(), true); + Iterator iterator = this.field_110585_a.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); ++ bar.step(entry.getKey().toString()); + this.func_110579_a((ResourceLocation)entry.getKey(), (ITextureObject)entry.getValue()); + } ++ cpw.mods.fml.common.ProgressManager.pop(bar); + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureMap.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureMap.java.patch new file mode 100644 index 0000000..45412d2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureMap.java.patch @@ -0,0 +1,122 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureMap.java +@@ -35,6 +35,7 @@ + @SideOnly(Side.CLIENT) + public class TextureMap extends AbstractTexture implements ITickableTextureObject, IIconRegister + { ++ private static final boolean ENABLE_SKIP = Boolean.parseBoolean(System.getProperty("fml.skipFirstTextureLoad", "true")); + private static final Logger field_147635_d = LogManager.getLogger(); + public static final ResourceLocation field_110575_b = new ResourceLocation("textures/atlas/blocks.png"); + public static final ResourceLocation field_110576_c = new ResourceLocation("textures/atlas/items.png"); +@@ -47,12 +48,18 @@ + private int field_147637_k = 1; + private final TextureAtlasSprite field_94249_f = new TextureAtlasSprite("missingno"); + private static final String __OBFID = "CL_00001058"; ++ private boolean skipFirst = false; + + public TextureMap(int p_i1281_1_, String p_i1281_2_) + { ++ this(p_i1281_1_, p_i1281_2_, false); ++ } ++ public TextureMap(int p_i1281_1_, String p_i1281_2_, boolean skipFirst) ++ { + this.field_94255_a = p_i1281_1_; + this.field_94254_c = p_i1281_2_; + this.func_110573_f(); ++ this.skipFirst = skipFirst && ENABLE_SKIP; + } + + private void func_110569_e() +@@ -96,15 +103,17 @@ + this.field_94252_e.clear(); + this.field_94258_i.clear(); + int j = Integer.MAX_VALUE; ++ cpw.mods.fml.common.ProgressManager.ProgressBar bar = cpw.mods.fml.common.ProgressManager.push("Texture Loading", skipFirst ? 0 : this.field_110574_e.size()); + Iterator iterator = this.field_110574_e.entrySet().iterator(); + TextureAtlasSprite textureatlassprite; + +- while (iterator.hasNext()) ++ while (!skipFirst && iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + ResourceLocation resourcelocation = new ResourceLocation((String)entry.getKey()); + textureatlassprite = (TextureAtlasSprite)entry.getValue(); + ResourceLocation resourcelocation1 = this.func_147634_a(resourcelocation, 0); ++ bar.step(resourcelocation1.func_110623_a()); + + try + { +@@ -156,12 +165,14 @@ + } + catch (RuntimeException runtimeexception) + { +- field_147635_d.error("Unable to parse metadata from " + resourcelocation1, runtimeexception); ++ //logger.error("Unable to parse metadata from " + resourcelocation1, runtimeexception); ++ cpw.mods.fml.client.FMLClientHandler.instance().trackBrokenTexture(resourcelocation1, runtimeexception.getMessage()); + continue; + } + catch (IOException ioexception1) + { +- field_147635_d.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); ++ //logger.error("Using missing texture, unable to load " + resourcelocation1, ioexception1); ++ cpw.mods.fml.client.FMLClientHandler.instance().trackMissingTexture(resourcelocation1); + continue; + } + +@@ -169,6 +180,7 @@ + stitcher.func_110934_a(textureatlassprite); + } + ++ cpw.mods.fml.common.ProgressManager.pop(bar); + int i1 = MathHelper.func_151239_c(j); + + if (i1 < this.field_147636_j) +@@ -178,10 +190,12 @@ + } + + Iterator iterator1 = this.field_110574_e.values().iterator(); ++ bar = cpw.mods.fml.common.ProgressManager.push("Mipmap generation", skipFirst ? 0 : this.field_110574_e.size()); + +- while (iterator1.hasNext()) ++ while (!skipFirst && iterator1.hasNext()) + { + final TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)iterator1.next(); ++ bar.step(textureatlassprite1.func_94215_i()); + + try + { +@@ -222,9 +236,13 @@ + + this.field_94249_f.func_147963_d(this.field_147636_j); + stitcher.func_110934_a(this.field_94249_f); ++ cpw.mods.fml.common.ProgressManager.pop(bar); ++ skipFirst = false; ++ bar = cpw.mods.fml.common.ProgressManager.push("Texture creation", 3); + + try + { ++ bar.step("Stitching"); + stitcher.func_94305_f(); + } + catch (StitcherException stitcherexception) +@@ -233,10 +251,12 @@ + } + + field_147635_d.info("Created: {}x{} {}-atlas", new Object[] {Integer.valueOf(stitcher.func_110935_a()), Integer.valueOf(stitcher.func_110936_b()), this.field_94254_c}); ++ bar.step("Allocating GL texture"); + TextureUtil.func_147946_a(this.func_110552_b(), this.field_147636_j, stitcher.func_110935_a(), stitcher.func_110936_b(), (float)this.field_147637_k); + HashMap hashmap = Maps.newHashMap(this.field_110574_e); + Iterator iterator2 = stitcher.func_94309_g().iterator(); + ++ bar.step("Uploading GL texture"); + while (iterator2.hasNext()) + { + textureatlassprite = (TextureAtlasSprite)iterator2.next(); +@@ -274,6 +294,7 @@ + textureatlassprite = (TextureAtlasSprite)iterator2.next(); + textureatlassprite.func_94217_a(this.field_94249_f); + } ++ cpw.mods.fml.common.ProgressManager.pop(bar); + } + + private ResourceLocation func_147634_a(ResourceLocation p_147634_1_, int p_147634_2_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureUtil.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureUtil.java.patch new file mode 100644 index 0000000..8f7a190 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureUtil.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/texture/TextureUtil.java +@@ -201,8 +201,11 @@ + + public static void func_147946_a(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_, float p_147946_4_) + { ++ synchronized(cpw.mods.fml.client.SplashProgress.class) ++ { + func_147942_a(p_147946_0_); + func_94277_a(p_147946_0_); ++ } + + if (OpenGlHelper.field_148825_d) + { diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/AbstractResourcePack.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/AbstractResourcePack.java.patch new file mode 100644 index 0000000..feee903 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/AbstractResourcePack.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/AbstractResourcePack.java ++++ ../src-work/minecraft/net/minecraft/client/resources/AbstractResourcePack.java +@@ -58,7 +58,7 @@ + + protected void func_110594_c(String p_110594_1_) + { +- field_110598_a.warn("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {p_110594_1_, this.field_110597_b}); ++ field_110598_a.warn("ResourcePack: ignored non-lowercase namespace: {} in {}", new Object[] {p_110594_1_, this.field_110597_b}); + } + + public IMetadataSection func_135058_a(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/LanguageManager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/LanguageManager.java.patch new file mode 100644 index 0000000..62003bd --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/LanguageManager.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/LanguageManager.java ++++ ../src-work/minecraft/net/minecraft/client/resources/LanguageManager.java +@@ -3,6 +3,8 @@ + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.google.common.collect.Sets; ++ ++import cpw.mods.fml.common.registry.LanguageRegistry; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; +@@ -83,6 +85,7 @@ + } + + field_135049_a.func_135022_a(p_110549_1_, arraylist); ++ LanguageRegistry.instance().mergeLanguageTable(field_135049_a.field_135032_a, this.field_135048_c); + StringTranslate.func_135063_a(field_135049_a.field_135032_a); + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch new file mode 100644 index 0000000..b2b7984 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch @@ -0,0 +1,46 @@ +--- ../src-base/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java ++++ ../src-work/minecraft/net/minecraft/client/resources/SimpleReloadableResourceManager.java +@@ -95,6 +95,7 @@ + public void func_110541_a(List p_110541_1_) + { + this.func_110543_a(); ++ cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Loading Resources", p_110541_1_.size()+1, true); + field_147967_a.info("Reloading ResourceManager: " + field_130074_a.join(Iterables.transform(p_110541_1_, new Function() + { + private static final String __OBFID = "CL_00001092"; +@@ -112,26 +113,35 @@ + while (iterator.hasNext()) + { + IResourcePack iresourcepack = (IResourcePack)iterator.next(); ++ resReload.step(iresourcepack.func_130077_b()); + this.func_110545_a(iresourcepack); + } + ++ resReload.step("Reloading listeners"); + this.func_110544_b(); ++ cpw.mods.fml.common.ProgressManager.pop(resReload); + } + + public void func_110542_a(IResourceManagerReloadListener p_110542_1_) + { + this.field_110546_b.add(p_110542_1_); ++ cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Loading Resource", 1); ++ resReload.step(p_110542_1_.getClass()); + p_110542_1_.func_110549_a(this); ++ cpw.mods.fml.common.ProgressManager.pop(resReload); + } + + private void func_110544_b() + { + Iterator iterator = this.field_110546_b.iterator(); + ++ cpw.mods.fml.common.ProgressManager.ProgressBar resReload = cpw.mods.fml.common.ProgressManager.push("Reloading", this.field_110546_b.size()); + while (iterator.hasNext()) + { + IResourceManagerReloadListener iresourcemanagerreloadlistener = (IResourceManagerReloadListener)iterator.next(); ++ resReload.step(iresourcemanagerreloadlistener.getClass()); + iresourcemanagerreloadlistener.func_110549_a(this); + } ++ cpw.mods.fml.common.ProgressManager.pop(resReload); + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/settings/GameSettings.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/settings/GameSettings.java.patch new file mode 100644 index 0000000..0523168 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/settings/GameSettings.java.patch @@ -0,0 +1,19 @@ +--- ../src-base/minecraft/net/minecraft/client/settings/GameSettings.java ++++ ../src-work/minecraft/net/minecraft/client/settings/GameSettings.java +@@ -2,6 +2,8 @@ + + import com.google.common.collect.Maps; + import com.google.gson.Gson; ++ ++import cpw.mods.fml.client.FMLClientHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedReader; +@@ -1049,6 +1051,7 @@ + + public void func_74303_b() + { ++ if (FMLClientHandler.instance().isLoading()) return; + try + { + PrintWriter printwriter = new PrintWriter(new FileWriter(this.field_74354_ai)); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/crash/CrashReport.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/crash/CrashReport.java.patch new file mode 100644 index 0000000..8e949da --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/crash/CrashReport.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/crash/CrashReport.java ++++ ../src-work/minecraft/net/minecraft/crash/CrashReport.java +@@ -1,5 +1,6 @@ + package net.minecraft.crash; + ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.File; +@@ -140,6 +141,7 @@ + return IntCache.func_85144_b(); + } + }); ++ FMLCommonHandler.instance().enhanceCrashReport(this, this.field_85061_c); + } + + public String func_71501_a() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityList.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityList.java.patch new file mode 100644 index 0000000..5395ce3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityList.java.patch @@ -0,0 +1,55 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityList.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityList.java +@@ -5,6 +5,7 @@ + import java.util.LinkedHashMap; + import java.util.Map; + import java.util.Set; ++ + import net.minecraft.entity.ai.EntityMinecartMobSpawner; + import net.minecraft.entity.boss.EntityDragon; + import net.minecraft.entity.boss.EntityWither; +@@ -63,9 +64,13 @@ + import net.minecraft.stats.StatBase; + import net.minecraft.stats.StatList; + import net.minecraft.world.World; ++ ++import org.apache.logging.log4j.Level; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import cpw.mods.fml.common.FMLLog; ++ + public class EntityList + { + private static final Logger field_151516_b = LogManager.getLogger(); +@@ -145,9 +150,10 @@ + p_75615_0_.func_82580_o("Type"); + } + ++ Class oclass = null; + try + { +- Class oclass = (Class)field_75625_b.get(p_75615_0_.func_74779_i("id")); ++ oclass = (Class)field_75625_b.get(p_75615_0_.func_74779_i("id")); + + if (oclass != null) + { +@@ -161,7 +167,17 @@ + + if (entity != null) + { +- entity.func_70020_e(p_75615_0_); ++ try ++ { ++ entity.func_70020_e(p_75615_0_); ++ } ++ catch (Exception e) ++ { ++ FMLLog.log(Level.ERROR, e, ++ "An Entity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ p_75615_0_.func_74779_i("id"), oclass.getName()); ++ entity = null; ++ } + } + else + { diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTracker.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTracker.java.patch new file mode 100644 index 0000000..6ac693b --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTracker.java.patch @@ -0,0 +1,23 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java +@@ -39,6 +39,8 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import cpw.mods.fml.common.registry.EntityRegistry; ++ + public class EntityTracker + { + private static final Logger field_151249_a = LogManager.getLogger(); +@@ -56,6 +58,11 @@ + + public void func_72786_a(Entity p_72786_1_) + { ++ if (EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) ++ { ++ return; ++ } ++ + if (p_72786_1_ instanceof EntityPlayerMP) + { + this.func_72791_a(p_72786_1_, 512, 2); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTrackerEntry.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTrackerEntry.java.patch new file mode 100644 index 0000000..17616ed --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTrackerEntry.java.patch @@ -0,0 +1,39 @@ +--- ../src-base/minecraft/net/minecraft/entity/EntityTrackerEntry.java ++++ ../src-work/minecraft/net/minecraft/entity/EntityTrackerEntry.java +@@ -57,6 +57,8 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; ++ + public class EntityTrackerEntry + { + private static final Logger field_151262_p = LogManager.getLogger(); +@@ -377,6 +379,14 @@ + this.field_73138_k = this.field_73132_a.field_70181_x; + this.field_73135_l = this.field_73132_a.field_70179_y; + ++ int posX = MathHelper.func_76128_c(this.field_73132_a.field_70165_t * 32.0D); ++ int posY = MathHelper.func_76128_c(this.field_73132_a.field_70163_u * 32.0D); ++ int posZ = MathHelper.func_76128_c(this.field_73132_a.field_70161_v * 32.0D); ++ if (posX != this.field_73128_d || posY != this.field_73129_e || posZ != this.field_73126_f) ++ { ++ FMLNetworkHandler.makeEntitySpawnAdjustment(this.field_73132_a, p_73117_1_, this.field_73128_d, this.field_73129_e, this.field_73126_f); ++ } ++ + if (this.field_73143_t && !(packet instanceof S0FPacketSpawnMob)) + { + p_73117_1_.field_71135_a.func_147359_a(new S12PacketEntityVelocity(this.field_73132_a.func_145782_y(), this.field_73132_a.field_70159_w, this.field_73132_a.field_70181_x, this.field_73132_a.field_70179_y)); +@@ -456,6 +466,12 @@ + field_151262_p.warn("Fetching addPacket for removed entity"); + } + ++ Packet pkt = FMLNetworkHandler.getEntitySpawningPacket(this.field_73132_a); ++ ++ if (pkt != null) ++ { ++ return pkt; ++ } + if (this.field_73132_a instanceof EntityItem) + { + return new S0EPacketSpawnObject(this.field_73132_a, 2, 1); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/boss/IBossDisplayData.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/boss/IBossDisplayData.java.patch new file mode 100644 index 0000000..5d9aca6 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/boss/IBossDisplayData.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/entity/boss/IBossDisplayData.java ++++ ../src-work/minecraft/net/minecraft/entity/boss/IBossDisplayData.java +@@ -4,7 +4,6 @@ + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.util.IChatComponent; + +-@SideOnly(Side.CLIENT) + public interface IBossDisplayData + { + float func_110138_aP(); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/item/EntityItem.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/item/EntityItem.java.patch new file mode 100644 index 0000000..4798e9e --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/item/EntityItem.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/entity/item/EntityItem.java ++++ ../src-work/minecraft/net/minecraft/entity/item/EntityItem.java +@@ -17,6 +17,8 @@ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import cpw.mods.fml.common.FMLCommonHandler; ++ + public class EntityItem extends Entity + { + private static final Logger field_145803_d = LogManager.getLogger(); +@@ -325,6 +327,8 @@ + } + } + ++ FMLCommonHandler.instance().firePlayerItemPickupEvent(p_70100_1_, this); ++ + this.field_70170_p.func_72956_a(p_70100_1_, "random.pop", 0.2F, ((this.field_70146_Z.nextFloat() - this.field_70146_Z.nextFloat()) * 0.7F + 1.0F) * 2.0F); + p_70100_1_.func_71001_a(this, i); + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/monster/EntitySlime.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/monster/EntitySlime.java.patch new file mode 100644 index 0000000..4732480 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/monster/EntitySlime.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySlime.java ++++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySlime.java +@@ -247,7 +247,7 @@ + { + Chunk chunk = this.field_70170_p.func_72938_d(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70161_v)); + +- if (this.field_70170_p.func_72912_H().func_76067_t() == WorldType.field_77138_c && this.field_70146_Z.nextInt(4) != 1) ++ if (this.field_70170_p.func_72912_H().func_76067_t().handleSlimeSpawnReduction(field_70146_Z, field_70170_p)) + { + return false; + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/passive/EntityVillager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/passive/EntityVillager.java.patch new file mode 100644 index 0000000..f3665c4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/passive/EntityVillager.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/entity/passive/EntityVillager.java ++++ ../src-work/minecraft/net/minecraft/entity/passive/EntityVillager.java +@@ -1,5 +1,6 @@ + package net.minecraft.entity.passive; + ++import cpw.mods.fml.common.registry.VillagerRegistry; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.Collections; +@@ -422,6 +423,7 @@ + + MerchantRecipeList merchantrecipelist; + merchantrecipelist = new MerchantRecipeList(); ++ VillagerRegistry.manageVillagerTrades(merchantrecipelist, this, this.func_70946_n(), this.field_70146_Z); + int k; + label50: + +@@ -626,7 +628,7 @@ + public IEntityLivingData func_110161_a(IEntityLivingData p_110161_1_) + { + p_110161_1_ = super.func_110161_a(p_110161_1_); +- this.func_70938_b(this.field_70170_p.field_73012_v.nextInt(5)); ++ VillagerRegistry.applyRandomTrade(this, field_70170_p.field_73012_v); + return p_110161_1_; + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/player/EntityPlayer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/player/EntityPlayer.java.patch new file mode 100644 index 0000000..b3209c0 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/player/EntityPlayer.java.patch @@ -0,0 +1,40 @@ +--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayer.java ++++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayer.java +@@ -2,6 +2,9 @@ + + import com.google.common.base.Charsets; + import com.mojang.authlib.GameProfile; ++ ++import cpw.mods.fml.common.FMLCommonHandler; ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.Collection; +@@ -193,6 +196,7 @@ + + public void func_70071_h_() + { ++ FMLCommonHandler.instance().onPlayerPreTick(this); + if (this.field_71074_e != null) + { + ItemStack itemstack = this.field_71071_by.func_70448_g(); +@@ -316,6 +320,7 @@ + this.field_71100_bB.func_75118_a(this); + this.func_71064_a(StatList.field_75948_k, 1); + } ++ FMLCommonHandler.instance().onPlayerPostTick(this); + } + + public int func_82145_z() +@@ -2031,6 +2036,11 @@ + } + } + ++ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) ++ { ++ FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); ++ } ++ + public static enum EnumStatus + { + OK, diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotCrafting.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotCrafting.java.patch new file mode 100644 index 0000000..fe83af5 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotCrafting.java.patch @@ -0,0 +1,17 @@ +--- ../src-base/minecraft/net/minecraft/inventory/SlotCrafting.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotCrafting.java +@@ -1,5 +1,6 @@ + package net.minecraft.inventory; + ++import cpw.mods.fml.common.FMLCommonHandler; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Blocks; + import net.minecraft.init.Items; +@@ -103,6 +104,7 @@ + + public void func_82870_a(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { ++ FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, field_75239_a); + this.func_75208_c(p_82870_2_); + + for (int i = 0; i < this.field_75239_a.func_70302_i_(); ++i) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotFurnace.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotFurnace.java.patch new file mode 100644 index 0000000..3837df4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotFurnace.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/inventory/SlotFurnace.java ++++ ../src-work/minecraft/net/minecraft/inventory/SlotFurnace.java +@@ -1,5 +1,6 @@ + package net.minecraft.inventory; + ++import cpw.mods.fml.common.FMLCommonHandler; + import net.minecraft.entity.item.EntityXPOrb; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.init.Items; +@@ -83,6 +84,8 @@ + + this.field_75228_b = 0; + ++ FMLCommonHandler.instance().firePlayerSmeltedEvent(field_75229_a, p_75208_1_); ++ + if (p_75208_1_.func_77973_b() == Items.field_151042_j) + { + this.field_75229_a.func_71064_a(AchievementList.field_76016_k, 1); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/Item.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/Item.java.patch new file mode 100644 index 0000000..dd8c2a4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/Item.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/item/Item.java ++++ ../src-work/minecraft/net/minecraft/item/Item.java +@@ -3,6 +3,8 @@ + import com.google.common.collect.HashMultimap; + import com.google.common.collect.Multimap; + import com.google.common.collect.Sets; ++ ++import cpw.mods.fml.common.registry.GameData; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.HashSet; +@@ -46,7 +48,7 @@ + + public class Item + { +- public static final RegistryNamespaced field_150901_e = new RegistryNamespaced(); ++ public static final RegistryNamespaced field_150901_e = GameData.getItemRegistry(); + protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + private CreativeTabs field_77701_a; + protected static Random field_77697_d = new Random(); +@@ -62,6 +64,8 @@ + protected String field_111218_cA; + private static final String __OBFID = "CL_00000041"; + ++ public final cpw.mods.fml.common.registry.RegistryDelegate delegate = ++ ((cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry)field_150901_e).getDelegate(this, Item.class); + public static int func_150891_b(Item p_150891_0_) + { + return p_150891_0_ == null ? 0 : field_150901_e.func_148757_b(p_150891_0_); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemEmptyMap.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemEmptyMap.java.patch new file mode 100644 index 0000000..7138639 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemEmptyMap.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemEmptyMap.java ++++ ../src-work/minecraft/net/minecraft/item/ItemEmptyMap.java +@@ -25,7 +25,7 @@ + int i = 128 * (1 << mapdata.field_76197_d); + mapdata.field_76201_a = (int)(Math.round(p_77659_3_.field_70165_t / (double)i) * (long)i); + mapdata.field_76199_b = (int)(Math.round(p_77659_3_.field_70161_v / (double)i) * (long)i); +- mapdata.field_76200_c = (byte)p_77659_2_.field_73011_w.field_76574_g; ++ mapdata.field_76200_c = p_77659_2_.field_73011_w.field_76574_g; + mapdata.func_76185_a(); + --p_77659_1_.field_77994_a; + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemMap.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemMap.java.patch new file mode 100644 index 0000000..80875ee --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemMap.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemMap.java ++++ ../src-work/minecraft/net/minecraft/item/ItemMap.java +@@ -57,7 +57,7 @@ + int i = 128 * (1 << mapdata.field_76197_d); + mapdata.field_76201_a = Math.round((float)p_77873_2_.func_72912_H().func_76079_c() / (float)i) * i; + mapdata.field_76199_b = Math.round((float)(p_77873_2_.func_72912_H().func_76074_e() / i)) * i; +- mapdata.field_76200_c = (byte)p_77873_2_.field_73011_w.field_76574_g; ++ mapdata.field_76200_c = p_77873_2_.field_73011_w.field_76574_g; + mapdata.func_76185_a(); + p_77873_2_.func_72823_a(s, mapdata); + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemStack.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemStack.java.patch new file mode 100644 index 0000000..7e20471 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemStack.java.patch @@ -0,0 +1,45 @@ +--- ../src-base/minecraft/net/minecraft/item/ItemStack.java ++++ ../src-work/minecraft/net/minecraft/item/ItemStack.java +@@ -45,6 +45,7 @@ + private EntityItemFrame field_82843_f; + private static final String __OBFID = "CL_00000043"; + ++ private cpw.mods.fml.common.registry.RegistryDelegate delegate; + public ItemStack(Block p_i1876_1_) + { + this(p_i1876_1_, 1); +@@ -72,7 +73,7 @@ + + public ItemStack(Item p_i1881_1_, int p_i1881_2_, int p_i1881_3_) + { +- this.field_151002_e = p_i1881_1_; ++ func_150996_a(p_i1881_1_); + this.field_77994_a = p_i1881_2_; + this.field_77991_e = p_i1881_3_; + +@@ -106,7 +107,7 @@ + + public Item func_77973_b() + { +- return this.field_151002_e; ++ return this.delegate != null ? this.delegate.get() : null; + } + + @SideOnly(Side.CLIENT) +@@ -164,7 +165,7 @@ + + public void func_77963_c(NBTTagCompound p_77963_1_) + { +- this.field_151002_e = Item.func_150899_d(p_77963_1_.func_74765_d("id")); ++ func_150996_a(Item.func_150899_d(p_77963_1_.func_74765_d("id"))); + this.field_77994_a = p_77963_1_.func_74771_c("Count"); + this.field_77991_e = p_77963_1_.func_74765_d("Damage"); + +@@ -744,6 +745,7 @@ + + public void func_150996_a(Item p_150996_1_) + { ++ this.delegate = p_150996_1_ != null ? p_150996_1_.delegate : null; + this.field_151002_e = p_150996_1_; + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkManager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkManager.java.patch new file mode 100644 index 0000000..cbb30df --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkManager.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/network/NetworkManager.java ++++ ../src-work/minecraft/net/minecraft/network/NetworkManager.java +@@ -2,6 +2,8 @@ + + import com.google.common.collect.Queues; + import com.google.common.util.concurrent.ThreadFactoryBuilder; ++ ++import cpw.mods.fml.common.network.internal.FMLProxyPacket; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.bootstrap.Bootstrap; +@@ -142,7 +144,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 FMLProxyPacket)) + { + field_150735_g.debug("Disabled auto read"); + this.field_150746_k.config().setAutoRead(false); +@@ -150,7 +152,7 @@ + + if (this.field_150746_k.eventLoop().inEventLoop()) + { +- if (enumconnectionstate != enumconnectionstate1) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof FMLProxyPacket)) + { + this.func_150723_a(enumconnectionstate); + } +@@ -164,7 +166,7 @@ + private static final String __OBFID = "CL_00001241"; + public void run() + { +- if (enumconnectionstate != enumconnectionstate1) ++ if (enumconnectionstate != enumconnectionstate1 && !( p_150732_1_ instanceof FMLProxyPacket)) + { + NetworkManager.this.func_150723_a(enumconnectionstate); + } +@@ -315,6 +317,11 @@ + this.channelRead0(p_channelRead0_1_, (Packet)p_channelRead0_2_); + } + ++ public Channel channel() ++ { ++ return field_150746_k; ++ } ++ + static class InboundHandlerTuplePacketListener + { + private final Packet field_150774_a; diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkSystem.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkSystem.java.patch new file mode 100644 index 0000000..4f2a10a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkSystem.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/network/NetworkSystem.java ++++ ../src-work/minecraft/net/minecraft/network/NetworkSystem.java +@@ -1,6 +1,8 @@ + package net.minecraft.network; + + import com.google.common.util.concurrent.ThreadFactoryBuilder; ++ ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.bootstrap.ServerBootstrap; +@@ -84,7 +86,7 @@ + ; + } + +- p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new PingResponseHandler(NetworkSystem.this)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)); ++ p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(FMLNetworkHandler.READ_TIMEOUT)).addLast("legacy_query", new PingResponseHandler(NetworkSystem.this)).addLast("splitter", new MessageDeserializer2()).addLast("decoder", new MessageDeserializer(NetworkManager.field_152462_h)).addLast("prepender", new MessageSerializer2()).addLast("encoder", new MessageSerializer(NetworkManager.field_152462_h)); + NetworkManager networkmanager = new NetworkManager(false); + NetworkSystem.this.field_151272_f.add(networkmanager); + p_initChannel_1_.pipeline().addLast("packet_handler", networkmanager); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/ServerStatusResponse.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/ServerStatusResponse.java.patch new file mode 100644 index 0000000..bb67d40 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/ServerStatusResponse.java.patch @@ -0,0 +1,27 @@ +--- ../src-base/minecraft/net/minecraft/network/ServerStatusResponse.java ++++ ../src-work/minecraft/net/minecraft/network/ServerStatusResponse.java +@@ -8,6 +8,8 @@ + import com.google.gson.JsonSerializationContext; + import com.google.gson.JsonSerializer; + import com.mojang.authlib.GameProfile; ++import cpw.mods.fml.client.FMLClientHandler; ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + import java.lang.reflect.Type; + import java.util.UUID; + import net.minecraft.util.IChatComponent; +@@ -233,6 +235,7 @@ + serverstatusresponse.func_151320_a(JsonUtils.func_151200_h(jsonobject, "favicon")); + } + ++ FMLClientHandler.instance().captureAdditionalData(serverstatusresponse, jsonobject); + return serverstatusresponse; + } + +@@ -260,6 +263,7 @@ + jsonobject.addProperty("favicon", p_serialize_1_.func_151316_d()); + } + ++ FMLNetworkHandler.enhanceStatusQuery(jsonobject); + return jsonobject; + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch new file mode 100644 index 0000000..e9712dc --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java +@@ -27,23 +27,24 @@ + this.field_149172_a = p_i45190_1_; + this.field_149171_b = p_i45190_2_; + +- if (p_i45190_2_.length >= 1048576) ++ //TODO: Remove this when FML protocol is re-written. To restore vanilla compatibility. ++ if (p_i45190_2_.length > 0x1FFF9A) // Max size of ANY MC packet is 0x1FFFFF minus max size of this packet (101) + { +- throw new IllegalArgumentException("Payload may not be larger than 1048576 bytes"); ++ throw new IllegalArgumentException("Payload may not be larger than 2097050 bytes"); + } + } + + public void func_148837_a(PacketBuffer p_148837_1_) throws IOException + { + this.field_149172_a = p_148837_1_.func_150789_c(20); +- this.field_149171_b = new byte[p_148837_1_.readUnsignedShort()]; ++ this.field_149171_b = new byte[cpw.mods.fml.common.network.ByteBufUtils.readVarShort(p_148837_1_)]; + p_148837_1_.readBytes(this.field_149171_b); + } + + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.func_150785_a(this.field_149172_a); +- p_148840_1_.writeShort(this.field_149171_b.length); ++ cpw.mods.fml.common.network.ByteBufUtils.writeVarShort(p_148840_1_, this.field_149171_b.length); + p_148840_1_.writeBytes(this.field_149171_b); + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/realms/RealmsConnect.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/realms/RealmsConnect.java.patch new file mode 100644 index 0000000..10a6a68 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/realms/RealmsConnect.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/realms/RealmsConnect.java ++++ ../src-work/minecraft/net/minecraft/realms/RealmsConnect.java +@@ -40,6 +40,7 @@ + + try + { ++ cpw.mods.fml.client.FMLClientHandler.instance().connectToRealmsServer(p_connect_1_, p_connect_2_); + inetaddress = InetAddress.getByName(p_connect_1_); + + if (RealmsConnect.this.aborted) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/MinecraftServer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/MinecraftServer.java.patch new file mode 100644 index 0000000..118a095 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/MinecraftServer.java.patch @@ -0,0 +1,118 @@ +--- ../src-base/minecraft/net/minecraft/server/MinecraftServer.java ++++ ../src-work/minecraft/net/minecraft/server/MinecraftServer.java +@@ -5,6 +5,11 @@ + import com.mojang.authlib.GameProfileRepository; + import com.mojang.authlib.minecraft.MinecraftSessionService; + import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; ++ ++import cpw.mods.fml.common.FMLCommonHandler; ++import cpw.mods.fml.common.Loader; ++import cpw.mods.fml.common.LoaderState; ++import cpw.mods.fml.common.StartupQuery; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import io.netty.buffer.ByteBuf; +@@ -343,7 +348,7 @@ + + public void func_71260_j() + { +- if (!this.field_71290_O) ++ if (!this.field_71290_O && Loader.instance().hasReachedState(LoaderState.SERVER_STARTED) && !field_71316_v) // make sure the save is valid and we don't save twice + { + field_147145_h.info("Stopping server"); + +@@ -394,6 +399,7 @@ + { + if (this.func_71197_b()) + { ++ FMLCommonHandler.instance().handleServerStarted(); + long i = func_130071_aq(); + long l = 0L; + this.field_147147_p.func_151315_a(new ChatComponentText(this.field_71286_C)); +@@ -438,12 +444,20 @@ + Thread.sleep(Math.max(1L, 50L - l)); + this.field_71296_Q = true; + } ++ FMLCommonHandler.instance().handleServerStopping(); ++ FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + } + else + { ++ FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + this.func_71228_a((CrashReport)null); + } + } ++ catch (StartupQuery.AbortedException e) ++ { ++ // ignore silently ++ FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions ++ } + catch (Throwable throwable1) + { + field_147145_h.error("Encountered an unexpected exception", throwable1); +@@ -469,6 +483,7 @@ + field_147145_h.error("We were unable to save this crash report to disk."); + } + ++ FMLCommonHandler.instance().expectServerStopped(); // has to come before finalTick to avoid race conditions + this.func_71228_a(crashreport); + } + finally +@@ -484,6 +499,8 @@ + } + finally + { ++ FMLCommonHandler.instance().handleServerStopped(); ++ this.field_71316_v = true; + this.func_71240_o(); + } + } +@@ -529,6 +546,7 @@ + public void func_71217_p() + { + long i = System.nanoTime(); ++ FMLCommonHandler.instance().onPreServerTick(); + ++this.field_71315_w; + + if (this.field_71295_T) +@@ -582,6 +600,7 @@ + + this.field_71304_b.func_76319_b(); + this.field_71304_b.func_76319_b(); ++ FMLCommonHandler.instance().onPostServerTick(); + } + + public void func_71190_q() +@@ -608,6 +627,7 @@ + } + + this.field_71304_b.func_76320_a("tick"); ++ FMLCommonHandler.instance().onPreWorldTick(worldserver); + CrashReport crashreport; + + try +@@ -632,6 +652,7 @@ + throw new ReportedException(crashreport); + } + ++ FMLCommonHandler.instance().onPostWorldTick(worldserver); + this.field_71304_b.func_76319_b(); + this.field_71304_b.func_76320_a("tracker"); + worldserver.func_73039_n().func_72788_a(); +@@ -663,6 +684,7 @@ + + public void func_71256_s() + { ++ StartupQuery.reset(); + (new Thread("Server thread") + { + private static final String __OBFID = "CL_00001418"; +@@ -715,7 +737,7 @@ + + public String getServerModName() + { +- return "vanilla"; ++ return FMLCommonHandler.instance().getModName(); + } + + public CrashReport func_71230_b(CrashReport p_71230_1_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/dedicated/DedicatedServer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/dedicated/DedicatedServer.java.patch new file mode 100644 index 0000000..10c0aef --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -0,0 +1,51 @@ +--- ../src-base/minecraft/net/minecraft/server/dedicated/DedicatedServer.java ++++ ../src-work/minecraft/net/minecraft/server/dedicated/DedicatedServer.java +@@ -1,5 +1,6 @@ + package net.minecraft.server.dedicated; + ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedReader; +@@ -48,6 +49,7 @@ + private boolean field_71338_p; + private WorldSettings.GameType field_71337_q; + private boolean field_71335_s; ++ public static boolean allowPlayerLogins = false; + private static final String __OBFID = "CL_00001784"; + + public DedicatedServer(File p_i1508_1_) +@@ -112,6 +114,8 @@ + field_155771_h.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + } + ++ FMLCommonHandler.instance().onServerStart(this); ++ + field_155771_h.info("Loading properties"); + this.field_71340_o = new PropertyManager(new File("server.properties")); + this.field_154332_n = new ServerEula(new File("eula.txt")); +@@ -203,6 +207,7 @@ + } + else + { ++ FMLCommonHandler.instance().onServerStarted(); + this.func_152361_a(new DedicatedPlayerList(this)); + long j = System.nanoTime(); + +@@ -248,6 +253,7 @@ + this.func_71191_d((this.func_71207_Z() + 8) / 16 * 16); + this.func_71191_d(MathHelper.func_76125_a(this.func_71207_Z(), 64, 256)); + this.field_71340_o.func_73667_a("max-build-height", Integer.valueOf(this.func_71207_Z())); ++ if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; } + field_155771_h.info("Preparing level \"" + this.func_71270_I() + "\""); + this.func_71247_a(this.func_71270_I(), this.func_71270_I(), k, worldtype, s2); + long i1 = System.nanoTime() - j; +@@ -268,7 +274,7 @@ + this.field_71339_n.func_72602_a(); + } + +- return true; ++ return FMLCommonHandler.instance().handleServerStarting(this); + } + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/gui/MinecraftServerGui.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/gui/MinecraftServerGui.java.patch new file mode 100644 index 0000000..fe1cb72 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -0,0 +1,34 @@ +--- ../src-base/minecraft/net/minecraft/server/gui/MinecraftServerGui.java ++++ ../src-work/minecraft/net/minecraft/server/gui/MinecraftServerGui.java +@@ -13,6 +13,7 @@ + import java.awt.event.FocusEvent; + import java.awt.event.WindowAdapter; + import java.awt.event.WindowEvent; ++import java.util.concurrent.CountDownLatch; + import javax.swing.JComponent; + import javax.swing.JFrame; + import javax.swing.JPanel; +@@ -79,6 +80,7 @@ + System.exit(0); + } + }); ++ minecraftservergui.latch.countDown(); + } + + public MinecraftServerGui(DedicatedServer p_i2362_1_) +@@ -164,8 +166,15 @@ + return jpanel; + } + ++ private CountDownLatch latch = new CountDownLatch(1); + public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_) + { ++ try ++ { ++ latch.await(); ++ } catch (InterruptedException e) ++ { ++ } + if (!SwingUtilities.isEventDispatchThread()) + { + SwingUtilities.invokeLater(new Runnable() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/integrated/IntegratedServer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/integrated/IntegratedServer.java.patch new file mode 100644 index 0000000..e3d4c9f --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/integrated/IntegratedServer.java.patch @@ -0,0 +1,21 @@ +--- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java ++++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java +@@ -1,5 +1,6 @@ + package net.minecraft.server.integrated; + ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.File; +@@ -105,9 +106,10 @@ + this.func_71245_h(true); + field_147148_h.info("Generating keypair"); + this.func_71253_a(CryptManager.func_75891_b()); ++ if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; } + this.func_71247_a(this.func_71270_I(), this.func_71221_J(), this.field_71350_m.func_77160_d(), this.field_71350_m.func_77165_h(), this.field_71350_m.func_82749_j()); + this.func_71205_p(this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j()); +- return true; ++ return FMLCommonHandler.instance().handleServerStarting(this); + } + + public void func_71217_p() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/PlayerProfileCache.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/PlayerProfileCache.java.patch new file mode 100644 index 0000000..c94a084 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/PlayerProfileCache.java.patch @@ -0,0 +1,50 @@ +--- ../src-base/minecraft/net/minecraft/server/management/PlayerProfileCache.java ++++ ../src-work/minecraft/net/minecraft/server/management/PlayerProfileCache.java +@@ -224,26 +224,12 @@ + { + List list = null; + BufferedReader bufferedreader = null; +- label81: + { + try + { + bufferedreader = Files.newReader(this.field_152665_g, Charsets.UTF_8); + list = (List)this.field_152660_b.fromJson(bufferedreader, field_152666_h); +- break label81; +- } +- catch (FileNotFoundException filenotfoundexception) +- { +- ; +- } +- finally +- { +- IOUtils.closeQuietly(bufferedreader); +- } + +- return; +- } +- + if (list != null) + { + this.field_152661_c.clear(); +@@ -268,6 +254,20 @@ + } + } + } ++ } ++ catch (FileNotFoundException filenotfoundexception) ++ { ++ ; ++ } ++ catch (com.google.gson.JsonParseException parsefail) ++ { ++ // No op - the cache can quietly rebuild if it's junk ++ } ++ finally ++ { ++ IOUtils.closeQuietly(bufferedreader); ++ } ++ } + } + + public void func_152658_c() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/ServerConfigurationManager.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/ServerConfigurationManager.java.patch new file mode 100644 index 0000000..f0be5d4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/server/management/ServerConfigurationManager.java ++++ ../src-work/minecraft/net/minecraft/server/management/ServerConfigurationManager.java +@@ -4,6 +4,8 @@ + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; + import com.mojang.authlib.GameProfile; ++ ++import cpw.mods.fml.common.FMLCommonHandler; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.File; +@@ -58,6 +60,7 @@ + import net.minecraft.world.WorldSettings; + import net.minecraft.world.demo.DemoWorldManager; + import net.minecraft.world.storage.IPlayerFileData; ++import net.minecraft.world.storage.SaveHandler; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -98,7 +101,7 @@ + this.field_72405_c = 8; + } + +- public void func_72355_a(NetworkManager p_72355_1_, EntityPlayerMP p_72355_2_) ++ public void func_72355_a(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(); +@@ -119,7 +122,7 @@ + WorldServer worldserver = this.field_72400_f.func_71218_a(p_72355_2_.field_71093_bK); + ChunkCoordinates chunkcoordinates = worldserver.func_72861_E(); + 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; + nethandlerplayserver.func_147359_a(new S01PacketJoinGame(p_72355_2_.func_145782_y(), p_72355_2_.field_71134_c.func_73081_b(), worldserver.func_72912_H().func_76093_s(), worldserver.field_73011_w.field_76574_g, worldserver.field_73013_u, this.func_72352_l(), worldserver.func_72912_H().func_76067_t())); + nethandlerplayserver.func_147359_a(new S3FPacketCustomPayload("MC|Brand", this.func_72365_p().getServerModName().getBytes(Charsets.UTF_8))); + nethandlerplayserver.func_147359_a(new S05PacketSpawnPosition(chunkcoordinates.field_71574_a, chunkcoordinates.field_71572_b, chunkcoordinates.field_71573_c)); +@@ -161,6 +164,7 @@ + + p_72355_2_.func_71116_b(); + ++ FMLCommonHandler.instance().firePlayerLoggedIn(p_72355_2_); + if (nbttagcompound != null && nbttagcompound.func_150297_b("Riding", 10)) + { + Entity entity = EntityList.func_75615_a(nbttagcompound.func_74775_l("Riding"), worldserver); +@@ -248,8 +252,23 @@ + return nbttagcompound1; + } + ++ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) ++ { ++ // Hacky method to allow loading the NBT for a player prior to login ++ NBTTagCompound nbttagcompound = this.field_72400_f.field_71305_c[0].func_72912_H().func_76072_h(); ++ if (player.func_70005_c_().equals(this.field_72400_f.func_71214_G()) && nbttagcompound != null) ++ { ++ return nbttagcompound; ++ } ++ else ++ { ++ return ((SaveHandler)this.field_72412_k).getPlayerNBT(player); ++ } ++ } + protected void func_72391_b(EntityPlayerMP p_72391_1_) + { ++ if (p_72391_1_.field_71135_a == null) return; ++ + this.field_72412_k.func_75753_a(p_72391_1_); + StatisticsFile statisticsfile = (StatisticsFile)this.field_148547_k.get(p_72391_1_.func_110124_au()); + +@@ -281,6 +300,7 @@ + + public void func_72367_e(EntityPlayerMP p_72367_1_) + { ++ FMLCommonHandler.instance().firePlayerLoggedOut(p_72367_1_); + p_72367_1_.func_71029_a(StatList.field_75947_j); + this.func_72391_b(p_72367_1_); + WorldServer worldserver = p_72367_1_.func_71121_q(); +@@ -436,6 +456,7 @@ + this.field_72404_b.add(entityplayermp1); + entityplayermp1.func_71116_b(); + entityplayermp1.func_70606_j(entityplayermp1.func_110143_aJ()); ++ FMLCommonHandler.instance().firePlayerRespawnEvent(entityplayermp1); + return entityplayermp1; + } + +@@ -461,6 +482,7 @@ + PotionEffect potioneffect = (PotionEffect)iterator.next(); + p_72356_1_.field_71135_a.func_147359_a(new S1DPacketEntityEffect(p_72356_1_.func_145782_y(), potioneffect)); + } ++ FMLCommonHandler.instance().firePlayerChangedDimensionEvent(p_72356_1_, j, p_72356_2_); + } + + public void func_82448_a(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch new file mode 100644 index 0000000..d11069d --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch @@ -0,0 +1,24 @@ +--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java ++++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerHandshakeTCP.java +@@ -1,5 +1,6 @@ + package net.minecraft.server.network; + ++import cpw.mods.fml.common.FMLCommonHandler; + import io.netty.util.concurrent.GenericFutureListener; + import net.minecraft.network.EnumConnectionState; + import net.minecraft.network.NetworkManager; +@@ -24,6 +25,14 @@ + + public void func_147383_a(C00Handshake p_147383_1_) + { ++ if (!FMLCommonHandler.instance().shouldAllowPlayerLogins()) ++ { ++ ChatComponentText chatcomponenttext = new ChatComponentText("Server is still starting! Please wait before reconnecting."); ++ this.field_147386_b.func_150725_a(new S00PacketDisconnect(chatcomponenttext), new GenericFutureListener[0]); ++ this.field_147386_b.func_150718_a(chatcomponenttext); ++ return; ++ } ++ + switch (NetHandlerHandshakeTCP.SwitchEnumConnectionState.field_151291_a[p_147383_1_.func_149594_c().ordinal()]) + { + case 1: diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerLoginServer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerLoginServer.java.patch new file mode 100644 index 0000000..ca0d333 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerLoginServer.java.patch @@ -0,0 +1,29 @@ +--- ../src-base/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java ++++ ../src-work/minecraft/net/minecraft/server/network/NetHandlerLoginServer.java +@@ -3,6 +3,8 @@ + import com.google.common.base.Charsets; + import com.mojang.authlib.GameProfile; + import com.mojang.authlib.exceptions.AuthenticationUnavailableException; ++ ++import cpw.mods.fml.common.network.internal.FMLNetworkHandler; + import io.netty.util.concurrent.GenericFutureListener; + import java.math.BigInteger; + import java.security.PrivateKey; +@@ -58,7 +60,7 @@ + this.func_147326_c(); + } + +- if (this.field_147336_h++ == 600) ++ if (this.field_147336_h++ == FMLNetworkHandler.LOGIN_TIMEOUT) + { + this.func_147322_a("Took too long to log in"); + } +@@ -96,7 +98,7 @@ + { + this.field_147328_g = NetHandlerLoginServer.LoginState.ACCEPTED; + this.field_147333_a.func_150725_a(new S02PacketLoginSuccess(this.field_147337_i), new GenericFutureListener[0]); +- this.field_147327_f.func_71203_ab().func_72355_a(this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); ++ FMLNetworkHandler.fmlServerHandshake(this.field_147327_f.func_71203_ab(), this.field_147333_a, this.field_147327_f.func_71203_ab().func_148545_a(this.field_147337_i)); + } + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntity.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntity.java.patch new file mode 100644 index 0000000..7b3b322 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntity.java.patch @@ -0,0 +1,62 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java +@@ -1,10 +1,12 @@ + package net.minecraft.tileentity; + ++import cpw.mods.fml.common.FMLLog; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.util.HashMap; + import java.util.Map; + import java.util.concurrent.Callable; ++ + import net.minecraft.block.Block; + import net.minecraft.block.BlockJukebox; + import net.minecraft.crash.CrashReportCategory; +@@ -12,6 +14,8 @@ + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.Packet; + import net.minecraft.world.World; ++ ++import org.apache.logging.log4j.Level; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -87,9 +91,10 @@ + { + TileEntity tileentity = null; + ++ Class oclass = null; + try + { +- Class oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); ++ oclass = (Class)field_145855_i.get(p_145827_0_.func_74779_i("id")); + + if (oclass != null) + { +@@ -103,7 +108,17 @@ + + if (tileentity != null) + { ++ try ++ { + tileentity.func_145839_a(p_145827_0_); ++ } ++ catch (Exception ex) ++ { ++ FMLLog.log(Level.ERROR, ex, ++ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author", ++ p_145827_0_.func_74779_i("id"), oclass.getName()); ++ tileentity = null; ++ } + } + else + { +@@ -137,7 +152,6 @@ + } + } + +- @SideOnly(Side.CLIENT) + public double func_145835_a(double p_145835_1_, double p_145835_3_, double p_145835_5_) + { + double d3 = (double)this.field_145851_c + 0.5D - p_145835_1_; diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntityFurnace.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntityFurnace.java.patch new file mode 100644 index 0000000..fefdb72 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntityFurnace.java.patch @@ -0,0 +1,26 @@ +--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java ++++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java +@@ -1,5 +1,6 @@ + package net.minecraft.tileentity; + ++import cpw.mods.fml.common.registry.GameRegistry; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import net.minecraft.block.Block; +@@ -322,7 +323,15 @@ + } + } + +- return item instanceof ItemTool && ((ItemTool)item).func_77861_e().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).func_150932_j().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).func_77842_f().equals("WOOD") ? 200 : (item == Items.field_151055_y ? 100 : (item == Items.field_151044_h ? 1600 : (item == Items.field_151129_at ? 20000 : (item == Item.func_150898_a(Blocks.field_150345_g) ? 100 : (item == Items.field_151072_bj ? 2400 : 0))))))); ++ if (item instanceof ItemTool && ((ItemTool)item).func_77861_e().equals("WOOD")) return 200; ++ if (item instanceof ItemSword && ((ItemSword)item).func_150932_j().equals("WOOD")) return 200; ++ if (item instanceof ItemHoe && ((ItemHoe)item).func_77842_f().equals("WOOD")) return 200; ++ if (item == Items.field_151055_y) return 100; ++ if (item == Items.field_151044_h) return 1600; ++ if (item == Items.field_151129_at) return 20000; ++ if (item == Item.func_150898_a(Blocks.field_150345_g)) return 100; ++ if (item == Items.field_151072_bj) return 2400; ++ return GameRegistry.getFuelValue(p_145952_0_); + } + } + diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/MouseHelper.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/MouseHelper.java.patch new file mode 100644 index 0000000..55d49a5 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/MouseHelper.java.patch @@ -0,0 +1,10 @@ +--- ../src-base/minecraft/net/minecraft/util/MouseHelper.java ++++ ../src-work/minecraft/net/minecraft/util/MouseHelper.java +@@ -14,6 +14,7 @@ + + public void func_74372_a() + { ++ if (Boolean.parseBoolean(System.getProperty("fml.noGrab","false"))) return; + Mouse.setGrabbed(true); + this.field_74377_a = 0; + this.field_74375_b = 0; diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/ResourceLocation.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/ResourceLocation.java.patch new file mode 100644 index 0000000..6b8ed79 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/ResourceLocation.java.patch @@ -0,0 +1,13 @@ +--- ../src-base/minecraft/net/minecraft/util/ResourceLocation.java ++++ ../src-work/minecraft/net/minecraft/util/ResourceLocation.java +@@ -1,10 +1,7 @@ + package net.minecraft.util; + +-import cpw.mods.fml.relauncher.Side; +-import cpw.mods.fml.relauncher.SideOnly; + import org.apache.commons.lang3.Validate; + +-@SideOnly(Side.CLIENT) + public class ResourceLocation + { + private final String field_110626_a; diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/StringTranslate.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/StringTranslate.java.patch new file mode 100644 index 0000000..4a9a7aa --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/StringTranslate.java.patch @@ -0,0 +1,75 @@ +--- ../src-base/minecraft/net/minecraft/util/StringTranslate.java ++++ ../src-work/minecraft/net/minecraft/util/StringTranslate.java +@@ -3,10 +3,13 @@ + import com.google.common.base.Splitter; + import com.google.common.collect.Iterables; + import com.google.common.collect.Maps; ++ ++import cpw.mods.fml.common.registry.LanguageRegistry; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; + import java.io.InputStream; ++import java.util.HashMap; + import java.util.IllegalFormatException; + import java.util.Iterator; + import java.util.Map; +@@ -18,16 +21,35 @@ + { + private static final Pattern field_111053_a = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); + private static final Splitter field_135065_b = Splitter.on('=').limit(2); ++ private final Map field_74816_c; + private static StringTranslate field_74817_a = new StringTranslate(); +- private final Map field_74816_c = Maps.newHashMap(); + private long field_150511_e; + private static final String __OBFID = "CL_00001212"; + + public StringTranslate() + { ++ InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); ++ field_74816_c = Maps.newHashMap(); ++ inject(this, inputstream); ++ } ++ ++ public static void inject(InputStream inputstream) ++ { ++ inject(field_74817_a, inputstream); ++ } ++ ++ private static void inject(StringTranslate inst, InputStream inputstream) ++ { ++ HashMap map = parseLangFile(inputstream); ++ inst.field_74816_c.putAll(map); ++ inst.field_150511_e = System.currentTimeMillis(); ++ } ++ ++ public static HashMap parseLangFile(InputStream inputstream) ++ { ++ HashMap table = Maps.newHashMap(); + try + { +- InputStream inputstream = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); + Iterator iterator = IOUtils.readLines(inputstream, Charsets.UTF_8).iterator(); + + while (iterator.hasNext()) +@@ -42,17 +64,17 @@ + { + String s1 = astring[0]; + String s2 = field_111053_a.matcher(astring[1]).replaceAll("%$1s"); +- this.field_74816_c.put(s1, s2); ++ table.put(s1, s2); + } + } + } + +- this.field_150511_e = System.currentTimeMillis(); + } +- catch (IOException ioexception) ++ catch (Exception ioexception) + { + ; + } ++ return table; + } + + static StringTranslate func_74808_a() diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/World.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/World.java.patch new file mode 100644 index 0000000..516c116 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/World.java.patch @@ -0,0 +1,28 @@ +--- ../src-base/minecraft/net/minecraft/world/World.java ++++ ../src-work/minecraft/net/minecraft/world/World.java +@@ -1800,14 +1800,14 @@ + } + } + +- this.field_147481_N = false; +- + if (!this.field_147483_b.isEmpty()) + { + this.field_147482_g.removeAll(this.field_147483_b); + this.field_147483_b.clear(); + } + ++ this.field_147481_N = false; ++ + this.field_72984_F.func_76318_c("pendingBlockEntities"); + + if (!this.field_147484_a.isEmpty()) +@@ -3598,7 +3598,7 @@ + @SideOnly(Side.CLIENT) + public double func_72919_O() + { +- return this.field_72986_A.func_76067_t() == WorldType.field_77138_c ? 0.0D : 63.0D; ++ return this.field_72986_A.func_76067_t().getHorizon(this); + } + + public CrashReportCategory func_72914_a(CrashReport p_72914_1_) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldProvider.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldProvider.java.patch new file mode 100644 index 0000000..19c9ed2 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldProvider.java.patch @@ -0,0 +1,48 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldProvider.java ++++ ../src-work/minecraft/net/minecraft/world/WorldProvider.java +@@ -50,20 +50,12 @@ + + protected void func_76572_b() + { +- if (this.field_76579_a.func_72912_H().func_76067_t() == WorldType.field_77138_c) +- { +- FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.func_82651_a(this.field_76579_a.func_72912_H().func_82571_y()); +- this.field_76578_c = new WorldChunkManagerHell(BiomeGenBase.func_150568_d(flatgeneratorinfo.func_82648_a()), 0.5F); +- } +- else +- { +- this.field_76578_c = new WorldChunkManager(this.field_76579_a); +- } ++ this.field_76578_c = field_76577_b.getChunkManager(field_76579_a); + } + + public IChunkProvider func_76555_c() + { +- return (IChunkProvider)(this.field_76577_b == WorldType.field_77138_c ? new ChunkProviderFlat(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r(), this.field_82913_c) : new ChunkProviderGenerate(this.field_76579_a, this.field_76579_a.func_72905_C(), this.field_76579_a.func_72912_H().func_76089_r())); ++ return field_76577_b.getChunkGenerator(field_76579_a, field_82913_c); + } + + public boolean func_76566_a(int p_76566_1_, int p_76566_2_) +@@ -179,19 +171,19 @@ + + public int func_76557_i() + { +- return this.field_76577_b == WorldType.field_77138_c ? 4 : 64; ++ return this.field_76577_b.getMinimumSpawnHeight(this.field_76579_a); + } + + @SideOnly(Side.CLIENT) + public boolean func_76564_j() + { +- return this.field_76577_b != WorldType.field_77138_c && !this.field_76576_e; ++ return this.field_76577_b.hasVoidParticles(this.field_76576_e); + } + + @SideOnly(Side.CLIENT) + public double func_76565_k() + { +- return this.field_76577_b == WorldType.field_77138_c ? 1.0D : 0.03125D; ++ return this.field_76577_b.voidFadeMagnitude(); + } + + @SideOnly(Side.CLIENT) diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldType.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldType.java.patch new file mode 100644 index 0000000..facfd05 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldType.java.patch @@ -0,0 +1,88 @@ +--- ../src-base/minecraft/net/minecraft/world/WorldType.java ++++ ../src-work/minecraft/net/minecraft/world/WorldType.java +@@ -1,5 +1,14 @@ + package net.minecraft.world; + ++import java.util.Random; ++ ++import net.minecraft.world.biome.BiomeGenBase; ++import net.minecraft.world.biome.WorldChunkManager; ++import net.minecraft.world.biome.WorldChunkManagerHell; ++import net.minecraft.world.chunk.IChunkProvider; ++import net.minecraft.world.gen.ChunkProviderFlat; ++import net.minecraft.world.gen.ChunkProviderGenerate; ++import net.minecraft.world.gen.FlatGeneratorInfo; + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; + +@@ -112,4 +121,70 @@ + this.field_151361_l = true; + return this; + } ++ ++ public WorldChunkManager getChunkManager(World world) ++ { ++ if (this == field_77138_c) ++ { ++ FlatGeneratorInfo flatgeneratorinfo = FlatGeneratorInfo.func_82651_a(world.func_72912_H().func_82571_y()); ++ return new WorldChunkManagerHell(BiomeGenBase.func_150568_d(flatgeneratorinfo.func_82648_a()), 0.5F); ++ } ++ else ++ { ++ return new WorldChunkManager(world); ++ } ++ } ++ ++ public IChunkProvider getChunkGenerator(World world, String generatorOptions) ++ { ++ return (this == field_77138_c ? new ChunkProviderFlat(world, world.func_72905_C(), world.func_72912_H().func_76089_r(), generatorOptions) : new ChunkProviderGenerate(world, world.func_72905_C(), world.func_72912_H().func_76089_r())); ++ } ++ ++ public int getMinimumSpawnHeight(World world) ++ { ++ return this == field_77138_c ? 4 : 64; ++ } ++ ++ public double getHorizon(World world) ++ { ++ return this == field_77138_c ? 0.0D : 63.0D; ++ } ++ ++ public boolean hasVoidParticles(boolean flag) ++ { ++ return this != field_77138_c && !flag; ++ } ++ ++ public double voidFadeMagnitude() ++ { ++ return this == field_77138_c ? 1.0D : 0.03125D; ++ } ++ ++/* public BiomeGenBase[] getBiomesForWorldType() { ++ return biomesForWorldType; ++ } ++ ++ public void addNewBiome(BiomeGenBase biome) ++ { ++ Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); ++ newBiomesForWorld.add(biome); ++ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); ++ } ++ ++ public void removeBiome(BiomeGenBase biome) ++ { ++ Set newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType)); ++ newBiomesForWorld.remove(biome); ++ biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]); ++ } ++*/ ++ public boolean handleSlimeSpawnReduction(Random random, World world) ++ { ++ return this == field_77138_c ? random.nextInt(4) != 1 : false; ++ } ++ ++ /** ++ * Called when 'Create New World' button is pressed before starting game ++ */ ++ public void onGUICreateWorldPress() { } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch new file mode 100644 index 0000000..fb88bdf --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch @@ -0,0 +1,65 @@ +--- ../src-base/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java ++++ ../src-work/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java +@@ -9,6 +9,7 @@ + import java.util.Iterator; + import java.util.List; + import java.util.Set; ++ + import net.minecraft.block.Block; + import net.minecraft.entity.Entity; + import net.minecraft.entity.EntityList; +@@ -24,9 +25,13 @@ + import net.minecraft.world.chunk.NibbleArray; + import net.minecraft.world.storage.IThreadedFileIO; + import net.minecraft.world.storage.ThreadedFileIOBase; ++ ++import org.apache.logging.log4j.Level; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + ++import cpw.mods.fml.common.FMLLog; ++ + public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO + { + private static final Logger field_151505_a = LogManager.getLogger(); +@@ -260,11 +265,20 @@ + Entity entity = (Entity)iterator1.next(); + nbttagcompound1 = new NBTTagCompound(); + +- if (entity.func_70039_c(nbttagcompound1)) ++ try + { +- p_75820_1_.field_76644_m = true; +- nbttaglist2.func_74742_a(nbttagcompound1); ++ if (entity.func_70039_c(nbttagcompound1)) ++ { ++ p_75820_1_.field_76644_m = true; ++ nbttaglist2.func_74742_a(nbttagcompound1); ++ } + } ++ catch (Exception e) ++ { ++ FMLLog.log(Level.ERROR, e, ++ "An Entity type %s has thrown an exception trying to write state. It will not persist. Report this to the mod author", ++ entity.getClass().getName()); ++ } + } + } + +@@ -276,8 +290,16 @@ + { + TileEntity tileentity = (TileEntity)iterator1.next(); + nbttagcompound1 = new NBTTagCompound(); ++ try { + tileentity.func_145841_b(nbttagcompound1); + nbttaglist3.func_74742_a(nbttagcompound1); ++ } ++ catch (Exception e) ++ { ++ FMLLog.log(Level.ERROR, e, ++ "A TileEntity type %s has throw an exception trying to write state. It will not persist. Report this to the mod author", ++ tileentity.getClass().getName()); ++ } + } + + p_75820_3_.func_74782_a("TileEntities", nbttaglist3); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/ChunkProviderServer.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/ChunkProviderServer.java.patch new file mode 100644 index 0000000..6dc802a --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/ChunkProviderServer.java.patch @@ -0,0 +1,18 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java ++++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java +@@ -1,6 +1,7 @@ + package net.minecraft.world.gen; + + import com.google.common.collect.Lists; ++import cpw.mods.fml.common.registry.GameRegistry; + import java.io.IOException; + import java.util.ArrayList; + import java.util.Collections; +@@ -216,6 +217,7 @@ + if (this.field_73246_d != null) + { + this.field_73246_d.func_73153_a(p_73153_1_, p_73153_2_, p_73153_3_); ++ GameRegistry.generateWorld(p_73153_2_, p_73153_3_, field_73251_h, field_73246_d, p_73153_1_); + chunk.func_76630_e(); + } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch new file mode 100644 index 0000000..a40dab3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch @@ -0,0 +1,31 @@ +--- ../src-base/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java ++++ ../src-work/minecraft/net/minecraft/world/gen/structure/StructureVillagePieces.java +@@ -4,6 +4,8 @@ + import java.util.Iterator; + import java.util.List; + import java.util.Random; ++ ++import cpw.mods.fml.common.registry.VillagerRegistry; + import net.minecraft.block.Block; + import net.minecraft.block.material.Material; + import net.minecraft.entity.passive.EntityVillager; +@@ -50,6 +52,8 @@ + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.Field2.class, 3, MathHelper.func_76136_a(p_75084_0_, 2 + p_75084_1_, 4 + p_75084_1_ * 2))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House2.class, 15, MathHelper.func_76136_a(p_75084_0_, 0, 1 + p_75084_1_))); + arraylist.add(new StructureVillagePieces.PieceWeight(StructureVillagePieces.House3.class, 8, MathHelper.func_76136_a(p_75084_0_, 0 + p_75084_1_, 3 + p_75084_1_ * 2))); ++ VillagerRegistry.addExtraVillageComponents(arraylist, p_75084_0_, p_75084_1_); ++ + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) +@@ -123,6 +127,10 @@ + { + object = StructureVillagePieces.House3.func_74921_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); + } ++ else ++ { ++ object = VillagerRegistry.getVillageComponent(p_75083_1_, p_75083_0_ , p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_); ++ } + + return (StructureVillagePieces.Village)object; + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/MapData.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/MapData.java.patch new file mode 100644 index 0000000..9072ca1 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/MapData.java.patch @@ -0,0 +1,48 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/MapData.java ++++ ../src-work/minecraft/net/minecraft/world/storage/MapData.java +@@ -10,7 +10,7 @@ + import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.item.ItemStack; +-import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.nbt.*; + import net.minecraft.world.World; + import net.minecraft.world.WorldSavedData; + +@@ -18,7 +18,7 @@ + { + public int field_76201_a; + public int field_76199_b; +- public byte field_76200_c; ++ public int field_76200_c; + public byte field_76197_d; + public byte[] field_76198_e = new byte[16384]; + public List field_76196_g = new ArrayList(); +@@ -33,7 +33,17 @@ + + public void func_76184_a(NBTTagCompound p_76184_1_) + { +- this.field_76200_c = p_76184_1_.func_74771_c("dimension"); ++ NBTBase dimension = p_76184_1_.func_74781_a("dimension"); ++ ++ if (dimension instanceof NBTTagByte) ++ { ++ this.field_76200_c = ((NBTTagByte)dimension).func_150290_f(); ++ } ++ else ++ { ++ this.field_76200_c = ((NBTTagInt)dimension).func_150287_d(); ++ } ++ + this.field_76201_a = p_76184_1_.func_74762_e("xCenter"); + this.field_76199_b = p_76184_1_.func_74762_e("zCenter"); + this.field_76197_d = p_76184_1_.func_74771_c("scale"); +@@ -84,7 +94,7 @@ + + public void func_76187_b(NBTTagCompound p_76187_1_) + { +- p_76187_1_.func_74774_a("dimension", this.field_76200_c); ++ p_76187_1_.func_74768_a("dimension", this.field_76200_c); + p_76187_1_.func_74768_a("xCenter", this.field_76201_a); + p_76187_1_.func_74768_a("zCenter", this.field_76199_b); + p_76187_1_.func_74774_a("scale", this.field_76197_d); diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/SaveHandler.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/SaveHandler.java.patch new file mode 100644 index 0000000..48bf1c4 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/SaveHandler.java.patch @@ -0,0 +1,109 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/SaveHandler.java ++++ ../src-work/minecraft/net/minecraft/world/storage/SaveHandler.java +@@ -6,13 +6,18 @@ + import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.IOException; ++ ++import cpw.mods.fml.common.FMLCommonHandler; ++import cpw.mods.fml.common.StartupQuery; + import net.minecraft.entity.player.EntityPlayer; ++import net.minecraft.entity.player.EntityPlayerMP; + import net.minecraft.nbt.CompressedStreamTools; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.server.MinecraftServer; + import net.minecraft.world.MinecraftException; + import net.minecraft.world.WorldProvider; + import net.minecraft.world.chunk.storage.IChunkLoader; ++ + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -107,20 +112,29 @@ + NBTTagCompound nbttagcompound; + NBTTagCompound nbttagcompound1; + ++ WorldInfo worldInfo = null; ++ + if (file1.exists()) + { + try + { + nbttagcompound = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); + nbttagcompound1 = nbttagcompound.func_74775_l("Data"); +- return new WorldInfo(nbttagcompound1); ++ worldInfo = new WorldInfo(nbttagcompound1); ++ FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); ++ return worldInfo; + } ++ catch (StartupQuery.AbortedException e) ++ { ++ throw e; ++ } + catch (Exception exception1) + { + exception1.printStackTrace(); + } + } + ++ FMLCommonHandler.instance().confirmBackupLevelDatUse(this); + file1 = new File(this.field_75770_b, "level.dat_old"); + + if (file1.exists()) +@@ -129,8 +143,14 @@ + { + nbttagcompound = CompressedStreamTools.func_74796_a(new FileInputStream(file1)); + nbttagcompound1 = nbttagcompound.func_74775_l("Data"); +- return new WorldInfo(nbttagcompound1); ++ worldInfo = new WorldInfo(nbttagcompound1); ++ FMLCommonHandler.instance().handleWorldDataLoad(this, worldInfo, nbttagcompound); ++ return worldInfo; + } ++ catch (StartupQuery.AbortedException e) ++ { ++ throw e; ++ } + catch (Exception exception) + { + exception.printStackTrace(); +@@ -146,6 +166,8 @@ + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.func_74782_a("Data", nbttagcompound1); + ++ FMLCommonHandler.instance().handleWorldDataSave(this, p_75755_1_, nbttagcompound2); ++ + try + { + File file1 = new File(this.field_75770_b, "level.dat_new"); +@@ -184,6 +206,8 @@ + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.func_74782_a("Data", nbttagcompound); + ++ FMLCommonHandler.instance().handleWorldDataSave(this, p_75761_1_, nbttagcompound1); ++ + try + { + File file1 = new File(this.field_75770_b, "level.dat_new"); +@@ -296,4 +320,22 @@ + { + return this.field_75767_f; + } ++ ++ public NBTTagCompound getPlayerNBT(EntityPlayerMP player) ++ { ++ try ++ { ++ File file1 = new File(this.field_75771_c, player.func_110124_au().toString() + ".dat"); ++ ++ if (file1.exists() && file1.isFile()) ++ { ++ return CompressedStreamTools.func_74796_a(new FileInputStream(file1)); ++ } ++ } ++ catch (Exception exception) ++ { ++ field_151478_a.warn("Failed to load player data for " + player.func_70005_c_()); ++ } ++ return null; ++ } + } diff --git a/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/WorldInfo.java.patch b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/WorldInfo.java.patch new file mode 100644 index 0000000..609a7f3 --- /dev/null +++ b/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/WorldInfo.java.patch @@ -0,0 +1,47 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/WorldInfo.java ++++ ../src-work/minecraft/net/minecraft/world/storage/WorldInfo.java +@@ -2,8 +2,11 @@ + + import cpw.mods.fml.relauncher.Side; + import cpw.mods.fml.relauncher.SideOnly; ++ ++import java.util.Map; + import java.util.concurrent.Callable; + import net.minecraft.crash.CrashReportCategory; ++import net.minecraft.nbt.NBTBase; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.server.MinecraftServer; + import net.minecraft.world.GameRules; +@@ -36,6 +39,7 @@ + private boolean field_76110_t; + private boolean field_76109_u; + private GameRules field_82577_x; ++ private Map additionalProperties; + private static final String __OBFID = "CL_00000587"; + + protected WorldInfo() +@@ -532,4 +536,24 @@ + } + }); + } ++ ++ /** ++ * 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(Map additionalProperties) ++ { ++ // one time set for this ++ if (this.additionalProperties == null) ++ { ++ this.additionalProperties = additionalProperties; ++ } ++ } ++ ++ public NBTBase getAdditionalProperty(String additionalProperty) ++ { ++ return this.additionalProperties!=null? this.additionalProperties.get(additionalProperty) : null; ++ } + } diff --git a/build/tmp/compileInjectedTagsJava/previous-compilation-data.bin b/build/tmp/compileInjectedTagsJava/previous-compilation-data.bin new file mode 100644 index 0000000..10b5e81 Binary files /dev/null and b/build/tmp/compileInjectedTagsJava/previous-compilation-data.bin differ diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 0000000..4925ba9 Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/build/tmp/compileMcLauncherJava/previous-compilation-data.bin b/build/tmp/compileMcLauncherJava/previous-compilation-data.bin new file mode 100644 index 0000000..423640c Binary files /dev/null and b/build/tmp/compileMcLauncherJava/previous-compilation-data.bin differ diff --git a/build/tmp/compilePatchedMcJava/previous-compilation-data.bin b/build/tmp/compilePatchedMcJava/previous-compilation-data.bin new file mode 100644 index 0000000..96670dc Binary files /dev/null and b/build/tmp/compilePatchedMcJava/previous-compilation-data.bin differ diff --git a/build/tmp/deobfuscateMergedJarToSrg/transformed.json b/build/tmp/deobfuscateMergedJarToSrg/transformed.json new file mode 100644 index 0000000..3852d8a --- /dev/null +++ b/build/tmp/deobfuscateMergedJarToSrg/transformed.json @@ -0,0 +1,9034 @@ +{ + "net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState": { + "enclosingMethod": { + "owner": "net/minecraft/server/network/NetHandlerHandshakeTCP" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState", + "inner_name": "SwitchEnumConnectionState", + "outer_class": "net/minecraft/server/network/NetHandlerHandshakeTCP" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "54" + } + ] + }, + "net/minecraft/network/NetworkSystem$4": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151269_c", + "owner": "net/minecraft/network/NetworkSystem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkSystem$4", + "start": "154" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones", + "inner_name": "Stones", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1632" + } + ] + }, + "net/minecraft/network/NetworkSystem$2": { + "enclosingMethod": { + "desc": "()Ljava/net/SocketAddress;", + "name": "func_151270_a", + "owner": "net/minecraft/network/NetworkSystem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkSystem$2", + "start": "93" + } + ] + }, + "net/minecraft/network/NetworkSystem$3": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151269_c", + "owner": "net/minecraft/network/NetworkSystem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkSystem$3", + "start": "140" + } + ] + }, + "net/minecraft/client/audio/SoundList$SoundEntry$Type": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundList$SoundEntry" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/SoundList$SoundEntry$Type", + "inner_name": "Type", + "outer_class": "net/minecraft/client/audio/SoundList$SoundEntry", + "start": "88" + } + ] + }, + "net/minecraft/network/NetworkSystem$1": { + "enclosingMethod": { + "desc": "(Ljava/net/InetAddress;I)V", + "name": "func_151265_a", + "owner": "net/minecraft/network/NetworkSystem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkSystem$1", + "start": "51" + } + ] + }, + "net/minecraft/entity/passive/EntityHorse$GroupData": { + "enclosingMethod": { + "owner": "net/minecraft/entity/passive/EntityHorse" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/passive/EntityHorse$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/passive/EntityHorse" + } + ] + }, + "net/minecraft/network/NetHandlerPlayServer$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/network/Packet;)V", + "name": "func_147359_a", + "owner": "net/minecraft/network/NetHandlerPlayServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetHandlerPlayServer$2", + "start": "442" + } + ] + }, + "net/minecraft/network/NetHandlerPlayServer$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;)V", + "name": "func_147360_c", + "owner": "net/minecraft/network/NetHandlerPlayServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetHandlerPlayServer$1", + "start": "109" + } + ] + }, + "net/minecraft/realms/RealmsServerStatusPinger": { + "innerClasses": [ + { + "inner_class": "net/minecraft/realms/RealmsServerStatusPinger$1", + "start": "37" + } + ] + }, + "net/minecraft/item/ItemMinecart$1": { + "enclosingMethod": { + "owner": "net/minecraft/item/ItemMinecart" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/item/ItemMinecart$1", + "start": "16" + } + ] + }, + "net/minecraft/server/integrated/IntegratedServer$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/integrated/IntegratedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/integrated/IntegratedServer$1", + "start": "170" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Church": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Church", + "inner_name": "Church", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "813" + } + ] + }, + "net/minecraft/inventory/ContainerPlayer$1": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerPlayer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerPlayer$1", + "start": "43" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenVillage": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenVillage$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenVillage", + "start": "121" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureAtlasSprite$1": { + "enclosingMethod": { + "desc": "(I)V", + "name": "func_147963_d", + "owner": "net/minecraft/client/renderer/texture/TextureAtlasSprite" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureAtlasSprite$1", + "start": "253" + } + ] + }, + "net/minecraft/client/settings/GameSettings$Options$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/settings/GameSettings$Options" + }, + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/client/settings/GameSettings$Options$1", + "start": "114" + } + ] + }, + "net/minecraft/client/network/LanServerDetector": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$LanServerList", + "inner_name": "LanServerList", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "22" + }, + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$LanServer", + "inner_name": "LanServer", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "70" + }, + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$ThreadLanServerFind", + "inner_name": "ThreadLanServerFind", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "107" + } + ] + }, + "net/minecraft/entity/Entity": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/Entity$EnumEntitySize", + "inner_name": "EnumEntitySize", + "outer_class": "net/minecraft/entity/Entity", + "start": "120" + }, + { + "inner_class": "net/minecraft/entity/Entity$1", + "start": "1601" + }, + { + "inner_class": "net/minecraft/entity/Entity$2", + "start": "1608" + }, + { + "access": "1018", + "inner_class": "net/minecraft/entity/Entity$SwitchEnumEntitySize", + "inner_name": "SwitchEnumEntitySize", + "outer_class": "net/minecraft/entity/Entity" + } + ] + }, + "net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/server/S20PacketEntityProperties" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot", + "inner_name": "Snapshot", + "outer_class": "net/minecraft/network/play/server/S20PacketEntityProperties", + "start": "94" + } + ] + }, + "net/minecraft/server/integrated/IntegratedServer$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/integrated/IntegratedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/integrated/IntegratedServer$2", + "start": "177" + } + ] + }, + "net/minecraft/client/gui/GuiSnooper": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiSnooper$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiSnooper", + "start": "102" + } + ] + }, + "net/minecraft/client/network/LanServerDetector$LanServerList": { + "enclosingMethod": { + "owner": "net/minecraft/client/network/LanServerDetector" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$LanServerList", + "inner_name": "LanServerList", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "22" + } + ] + }, + "net/minecraft/client/shader/ShaderLoader$ShaderType": { + "enclosingMethod": { + "owner": "net/minecraft/client/shader/ShaderLoader" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/shader/ShaderLoader$ShaderType", + "inner_name": "ShaderType", + "outer_class": "net/minecraft/client/shader/ShaderLoader", + "start": "79" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$HurtIterator": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$HurtIterator", + "inner_name": "HurtIterator", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "181" + } + ] + }, + "net/minecraft/util/WeightedRandom$Item": { + "enclosingMethod": { + "owner": "net/minecraft/util/WeightedRandom" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/util/WeightedRandom$Item", + "inner_name": "Item", + "outer_class": "net/minecraft/util/WeightedRandom" + } + ] + }, + "net/minecraft/network/play/server/S21PacketChunkData": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S21PacketChunkData$Extracted", + "inner_name": "Extracted", + "outer_class": "net/minecraft/network/play/server/S21PacketChunkData" + } + ] + }, + "net/minecraft/world/chunk/storage/ChunkLoader": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData", + "inner_name": "AnvilConverterData", + "outer_class": "net/minecraft/world/chunk/storage/ChunkLoader" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight", + "inner_name": "Straight", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "365" + } + ] + }, + "net/minecraft/init/Bootstrap$9": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$9", + "start": "163" + } + ] + }, + "net/minecraft/init/Bootstrap$7": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$7", + "start": "110" + } + ] + }, + "net/minecraft/init/Bootstrap$8": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$8", + "start": "132" + } + ] + }, + "net/minecraft/init/Bootstrap$5": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$5", + "start": "63" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$5$1", + "start": "67" + } + ] + }, + "net/minecraft/init/Bootstrap$6": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$6", + "start": "89" + } + ] + }, + "net/minecraft/init/Bootstrap$3": { + "enclosingMethod": { + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$3", + "start": "38" + } + ] + }, + "net/minecraft/village/Village$VillageAgressor": { + "enclosingMethod": { + "owner": "net/minecraft/village/Village" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/village/Village$VillageAgressor", + "inner_name": "VillageAgressor", + "outer_class": "net/minecraft/village/Village" + } + ] + }, + "net/minecraft/client/main/Main$1$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/main/Main$1" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/main/Main$1$1", + "start": "24" + } + ] + }, + "net/minecraft/init/Bootstrap$4": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$4", + "start": "44" + } + ] + }, + "net/minecraft/init/Bootstrap$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$1", + "start": "23" + } + ] + }, + "net/minecraft/inventory/ContainerRepair$2": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerRepair" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerRepair$2", + "start": "64" + } + ] + }, + "net/minecraft/client/multiplayer/GuiConnecting$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;I)V", + "name": "func_146367_a", + "owner": "net/minecraft/client/multiplayer/GuiConnecting" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/GuiConnecting$1", + "start": "48" + } + ] + }, + "net/minecraft/init/Bootstrap$2": { + "enclosingMethod": { + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$2", + "start": "32" + } + ] + }, + "net/minecraft/inventory/ContainerRepair$1": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerRepair" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerRepair$1", + "start": "39" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "57" + } + ] + }, + "net/minecraft/client/gui/ServerListEntryNormal": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/ServerListEntryNormal$1", + "start": "66" + } + ] + }, + "net/minecraft/client/gui/GuiCreateFlatWorld$Details": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiCreateFlatWorld" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiCreateFlatWorld$Details", + "inner_name": "Details", + "outer_class": "net/minecraft/client/gui/GuiCreateFlatWorld", + "start": "140" + } + ] + }, + "net/minecraft/util/ChatStyle$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/util/ChatStyle" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/util/ChatStyle$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/util/ChatStyle", + "start": "246" + } + ] + }, + "net/minecraft/tileentity/TileEntity$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_145828_a", + "owner": "net/minecraft/tileentity/TileEntity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntity$3", + "start": "191" + } + ] + }, + "net/minecraft/client/gui/GuiKeyBindingList$KeyEntry": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiKeyBindingList" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$KeyEntry", + "inner_name": "KeyEntry", + "outer_class": "net/minecraft/client/gui/GuiKeyBindingList", + "start": "99" + } + ] + }, + "net/minecraft/tileentity/TileEntity$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_145828_a", + "owner": "net/minecraft/tileentity/TileEntity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntity$2", + "start": "179" + } + ] + }, + "net/minecraft/tileentity/TileEntity$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_145828_a", + "owner": "net/minecraft/tileentity/TileEntity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntity$1", + "start": "170" + } + ] + }, + "net/minecraft/event/ClickEvent": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/event/ClickEvent$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/event/ClickEvent", + "start": "52" + } + ] + }, + "net/minecraft/network/EnumConnectionState$4": { + "enclosingMethod": { + "owner": "net/minecraft/network/EnumConnectionState" + }, + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$4" + } + ] + }, + "net/minecraft/network/EnumConnectionState$3": { + "enclosingMethod": { + "owner": "net/minecraft/network/EnumConnectionState" + }, + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$3" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureMap$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/resources/IResourceManager;)V", + "name": "func_110571_b", + "owner": "net/minecraft/client/renderer/texture/TextureMap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$3", + "start": "184" + } + ] + }, + "net/minecraft/entity/passive/EntityHorse": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/passive/EntityHorse$1", + "start": "36" + }, + { + "access": "29", + "inner_class": "net/minecraft/entity/passive/EntityHorse$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/passive/EntityHorse" + } + ] + }, + "net/minecraft/client/renderer/entity/RenderItem$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;II)V", + "name": "func_82406_b", + "owner": "net/minecraft/client/renderer/entity/RenderItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$1", + "start": "405" + } + ] + }, + "net/minecraft/network/EnumConnectionState$2": { + "enclosingMethod": { + "owner": "net/minecraft/network/EnumConnectionState" + }, + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$2" + } + ] + }, + "net/minecraft/server/management/UserList$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/UserList" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/UserList$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/server/management/UserList", + "start": "139" + } + ] + }, + "net/minecraft/client/renderer/entity/RenderItem$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;II)V", + "name": "func_82406_b", + "owner": "net/minecraft/client/renderer/entity/RenderItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$2", + "start": "412" + } + ] + }, + "net/minecraft/dispenser/IBehaviorDispenseItem": { + "innerClasses": [ + { + "inner_class": "net/minecraft/dispenser/IBehaviorDispenseItem$1", + "start": "12" + } + ] + }, + "net/minecraft/network/EnumConnectionState$1": { + "enclosingMethod": { + "owner": "net/minecraft/network/EnumConnectionState" + }, + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$1" + } + ] + }, + "net/minecraft/client/renderer/entity/RenderItem$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;II)V", + "name": "func_82406_b", + "owner": "net/minecraft/client/renderer/entity/RenderItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$3", + "start": "419" + } + ] + }, + "net/minecraft/client/renderer/entity/RenderItem$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/gui/FontRenderer;Lnet/minecraft/client/renderer/texture/TextureManager;Lnet/minecraft/item/ItemStack;II)V", + "name": "func_82406_b", + "owner": "net/minecraft/client/renderer/entity/RenderItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$4", + "start": "426" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats$StatsBlock" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1", + "start": "558" + } + ] + }, + "net/minecraft/nbt/JsonToNBT$List": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/JsonToNBT" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$List", + "inner_name": "List", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "300" + } + ] + }, + "net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry": { + "enclosingMethod": { + "owner": "net/minecraft/entity/ai/EntityAITasks" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry", + "inner_name": "EntityAITaskEntry", + "outer_class": "net/minecraft/entity/ai/EntityAITasks" + } + ] + }, + "net/minecraft/util/LongHashMap$Entry": { + "enclosingMethod": { + "owner": "net/minecraft/util/LongHashMap" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/util/LongHashMap$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/util/LongHashMap", + "start": "189" + } + ] + }, + "net/minecraft/util/EnumTypeAdapterFactory$1": { + "enclosingMethod": { + "owner": "net/minecraft/util/EnumTypeAdapterFactory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/util/EnumTypeAdapterFactory$1", + "start": "36" + } + ] + }, + "net/minecraft/entity/EntityList$EntityEggInfo": { + "enclosingMethod": { + "owner": "net/minecraft/entity/EntityList" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/EntityList$EntityEggInfo", + "inner_name": "EntityEggInfo", + "outer_class": "net/minecraft/entity/EntityList" + } + ] + }, + "net/minecraft/network/play/client/C03PacketPlayer": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook", + "inner_name": "C06PacketPlayerPosLook", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "20" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition", + "inner_name": "C04PacketPlayerPosition", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "63" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook", + "inner_name": "C05PacketPlayerLook", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "98" + } + ] + }, + "net/minecraft/world/biome/BiomeGenForest": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/biome/BiomeGenForest$1", + "start": "166" + }, + { + "inner_class": "net/minecraft/world/biome/BiomeGenForest$2", + "start": "176" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor", + "inner_name": "ChestCorridor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "708" + } + ] + }, + "net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer": { + "enclosingMethod": { + "owner": "net/minecraft/world/chunk/storage/RegionFile" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer", + "inner_name": "ChunkBuffer", + "outer_class": "net/minecraft/world/chunk/storage/RegionFile", + "start": "232" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$ModifierDamage": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$ModifierDamage", + "inner_name": "ModifierDamage", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "123" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStronghold$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/MapGenStronghold" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenStronghold$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenStronghold" + } + ] + }, + "net/minecraft/server/gui/StatsComponent$1": { + "enclosingMethod": { + "owner": "net/minecraft/server/gui/StatsComponent" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/StatsComponent$1", + "start": "29" + } + ] + }, + "net/minecraft/world/gen/structure/StructureComponent$BlockSelector": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureComponent" + }, + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureComponent$BlockSelector", + "inner_name": "BlockSelector", + "outer_class": "net/minecraft/world/gen/structure/StructureComponent", + "start": "655" + } + ] + }, + "net/minecraft/world/gen/structure/StructureMineshaftPieces$Room": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureMineshaftPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Room", + "inner_name": "Room", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "86" + } + ] + }, + "net/minecraft/item/ItemFishFood": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/item/ItemFishFood$FishType", + "inner_name": "FishType", + "outer_class": "net/minecraft/item/ItemFishFood", + "start": "103" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsItem": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsItem$1", + "start": "445" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsItem", + "inner_name": "StatsItem", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "486" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsItem$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats$StatsItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsItem$1", + "start": "445" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door", + "inner_name": "Door", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold", + "start": "223" + }, + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold", + "inner_name": "Stronghold", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "229" + } + ] + }, + "net/minecraft/client/network/LanServerDetector$LanServer": { + "enclosingMethod": { + "owner": "net/minecraft/client/network/LanServerDetector" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$LanServer", + "inner_name": "LanServer", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "70" + } + ] + }, + "net/minecraft/inventory/ContainerBrewingStand$Ingredient": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerBrewingStand" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/inventory/ContainerBrewingStand$Ingredient", + "inner_name": "Ingredient", + "outer_class": "net/minecraft/inventory/ContainerBrewingStand", + "start": "157" + } + ] + }, + "net/minecraft/world/biome/BiomeGenBase$SpawnListEntry": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeGenBase" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$SpawnListEntry", + "inner_name": "SpawnListEntry", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "326" + } + ] + }, + "net/minecraft/client/gui/GuiScreenOptionsSounds$Button": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiScreenOptionsSounds" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiScreenOptionsSounds$Button", + "inner_name": "Button", + "outer_class": "net/minecraft/client/gui/GuiScreenOptionsSounds", + "start": "90" + } + ] + }, + "net/minecraft/entity/player/EntityPlayer$EnumStatus": { + "enclosingMethod": { + "owner": "net/minecraft/entity/player/EntityPlayer" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/player/EntityPlayer$EnumStatus", + "inner_name": "EnumStatus", + "outer_class": "net/minecraft/entity/player/EntityPlayer", + "start": "1030" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureAtlasSprite": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureAtlasSprite$1", + "start": "253" + } + ] + }, + "net/minecraft/world/biome/BiomeCache": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/biome/BiomeCache$Block", + "inner_name": "Block", + "outer_class": "net/minecraft/world/biome/BiomeCache", + "start": "31" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayerEdge": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/gen/layer/GenLayerEdge$Mode", + "inner_name": "Mode", + "outer_class": "net/minecraft/world/gen/layer/GenLayerEdge", + "start": "7" + }, + { + "access": "1018", + "inner_class": "net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode", + "inner_name": "SwitchMode", + "outer_class": "net/minecraft/world/gen/layer/GenLayerEdge" + } + ] + }, + "net/minecraft/client/network/NetHandlerLoginClient$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/network/login/server/S01PacketEncryptionRequest;)V", + "name": "func_147389_a", + "owner": "net/minecraft/client/network/NetHandlerLoginClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/NetHandlerLoginClient$1", + "start": "69" + } + ] + }, + "net/minecraft/client/multiplayer/GuiConnecting": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/GuiConnecting$1", + "start": "48" + } + ] + }, + "net/minecraft/client/audio/ISound$AttenuationType": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/ISound" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/ISound$AttenuationType", + "inner_name": "AttenuationType", + "outer_class": "net/minecraft/client/audio/ISound", + "start": "7" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut", + "inner_name": "SwampHut", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "638" + } + ] + }, + "net/minecraft/world/chunk/storage/AnvilSaveConverter": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/chunk/storage/AnvilSaveConverter$1", + "start": "235" + } + ] + }, + "net/minecraft/item/ItemArmor": { + "innerClasses": [ + { + "inner_class": "net/minecraft/item/ItemArmor$1", + "start": "37" + }, + { + "access": "4029", + "inner_class": "net/minecraft/item/ItemArmor$ArmorMaterial", + "inner_name": "ArmorMaterial", + "outer_class": "net/minecraft/item/ItemArmor", + "start": "60" + } + ] + }, + "net/minecraft/client/gui/MapItemRenderer$Instance": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/MapItemRenderer" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/MapItemRenderer$Instance", + "inner_name": "Instance", + "outer_class": "net/minecraft/client/gui/MapItemRenderer", + "start": "53" + } + ] + }, + "net/minecraft/network/NetworkStatistics$PacketStatData": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetworkStatistics" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkStatistics$PacketStatData", + "inner_name": "PacketStatData", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "159" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStructure": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$1", + "start": "50" + }, + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$2", + "start": "59" + }, + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$3", + "start": "66" + } + ] + }, + "net/minecraft/server/network/NetHandlerLoginServer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/network/NetHandlerLoginServer$1", + "start": "140" + }, + { + "access": "4028", + "inner_class": "net/minecraft/server/network/NetHandlerLoginServer$LoginState", + "inner_name": "LoginState", + "outer_class": "net/minecraft/server/network/NetHandlerLoginServer", + "start": "176" + } + ] + }, + "net/minecraft/server/network/NetHandlerLoginServer$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/network/login/client/C01PacketEncryptionResponse;)V", + "name": "func_147315_a", + "owner": "net/minecraft/server/network/NetHandlerLoginServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/network/NetHandlerLoginServer$1", + "start": "140" + } + ] + }, + "net/minecraft/block/material/Material": { + "innerClasses": [ + { + "inner_class": "net/minecraft/block/material/Material$1", + "start": "39" + } + ] + }, + "net/minecraft/client/gui/GuiFlatPresets$ListSlot": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiFlatPresets" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiFlatPresets$ListSlot", + "inner_name": "ListSlot", + "outer_class": "net/minecraft/client/gui/GuiFlatPresets", + "start": "211" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayer$2": { + "enclosingMethod": { + "desc": "(II)Z", + "name": "func_151616_a", + "owner": "net/minecraft/world/gen/layer/GenLayer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/layer/GenLayer$2", + "start": "175" + } + ] + }, + "net/minecraft/client/audio/SoundManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundManager$1", + "start": "85" + }, + { + "inner_class": "net/minecraft/client/audio/SoundManager$2", + "start": "360" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/audio/SoundManager$SoundSystemStarterThread", + "inner_name": "SoundSystemStarterThread", + "outer_class": "net/minecraft/client/audio/SoundManager", + "start": "417" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayer$1": { + "enclosingMethod": { + "desc": "(II)Z", + "name": "func_151616_a", + "owner": "net/minecraft/world/gen/layer/GenLayer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/layer/GenLayer$1", + "start": "169" + } + ] + }, + "net/minecraft/server/management/PlayerProfileCache": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PlayerProfileCache$1", + "start": "50" + }, + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerProfileCache$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/server/management/PlayerProfileCache", + "start": "210" + }, + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerProfileCache$ProfileEntry", + "inner_name": "ProfileEntry", + "outer_class": "net/minecraft/server/management/PlayerProfileCache", + "start": "257" + }, + { + "inner_class": "net/minecraft/server/management/PlayerProfileCache$2", + "start": "278" + } + ] + }, + "net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart": { + "enclosingMethod": { + "owner": "net/minecraft/tileentity/MobSpawnerBaseLogic" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart", + "inner_name": "WeightedRandomMinecart", + "outer_class": "net/minecraft/tileentity/MobSpawnerBaseLogic", + "start": "327" + } + ] + }, + "net/minecraft/client/stream/BroadcastController$BroadcastListener": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/BroadcastController" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/stream/BroadcastController$BroadcastListener", + "inner_name": "BroadcastListener", + "outer_class": "net/minecraft/client/stream/BroadcastController" + } + ] + }, + "net/minecraft/world/biome/BiomeGenSavanna$Mutated": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeGenSavanna" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenSavanna$Mutated", + "inner_name": "Mutated", + "outer_class": "net/minecraft/world/biome/BiomeGenSavanna", + "start": "69" + } + ] + }, + "net/minecraft/nbt/NBTBase$NBTPrimitive": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/NBTBase" + }, + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/nbt/NBTBase$NBTPrimitive", + "inner_name": "NBTPrimitive", + "outer_class": "net/minecraft/nbt/NBTBase" + } + ] + }, + "net/minecraft/network/play/client/C16PacketClientStatus": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/network/play/client/C16PacketClientStatus$EnumState", + "inner_name": "EnumState", + "outer_class": "net/minecraft/network/play/client/C16PacketClientStatus", + "start": "9" + } + ] + }, + "net/minecraft/block/BlockPortal$Size": { + "enclosingMethod": { + "owner": "net/minecraft/block/BlockPortal" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/BlockPortal$Size", + "inner_name": "Size", + "outer_class": "net/minecraft/block/BlockPortal", + "start": "205" + } + ] + }, + "net/minecraft/client/multiplayer/WorldClient$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/client/multiplayer/WorldClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$4", + "start": "312" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper": { + "innerClasses": [ + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$ModifierDamage", + "inner_name": "ModifierDamage", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "123" + }, + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$ModifierLiving", + "inner_name": "ModifierLiving", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "156" + }, + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$HurtIterator", + "inner_name": "HurtIterator", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "181" + }, + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$DamageIterator", + "inner_name": "DamageIterator", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "200" + }, + { + "access": "608", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$IModifier", + "inner_name": "IModifier", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper" + }, + { + "access": "1000", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$1" + } + ] + }, + "net/minecraft/client/multiplayer/WorldClient$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/client/multiplayer/WorldClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$1", + "start": "291" + } + ] + }, + "net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/server/S14PacketEntity" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook", + "inner_name": "S16PacketEntityLook", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "95" + } + ] + }, + "net/minecraft/util/MovingObjectPosition$MovingObjectType": { + "enclosingMethod": { + "owner": "net/minecraft/util/MovingObjectPosition" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/MovingObjectPosition$MovingObjectType", + "inner_name": "MovingObjectType", + "outer_class": "net/minecraft/util/MovingObjectPosition", + "start": "7" + } + ] + }, + "net/minecraft/client/multiplayer/WorldClient$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/client/multiplayer/WorldClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$3", + "start": "305" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureMap$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/resources/IResourceManager;)V", + "name": "func_110571_b", + "owner": "net/minecraft/client/renderer/texture/TextureMap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$1", + "start": "170" + } + ] + }, + "net/minecraft/client/multiplayer/WorldClient$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/client/multiplayer/WorldClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$2", + "start": "298" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureMap$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/resources/IResourceManager;)V", + "name": "func_110571_b", + "owner": "net/minecraft/client/renderer/texture/TextureMap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$2", + "start": "177" + } + ] + }, + "net/minecraft/block/BlockPressurePlate$Sensitivity": { + "enclosingMethod": { + "owner": "net/minecraft/block/BlockPressurePlate" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/block/BlockPressurePlate$Sensitivity", + "inner_name": "Sensitivity", + "outer_class": "net/minecraft/block/BlockPressurePlate", + "start": "12" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Road": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Road", + "inner_name": "Road", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces" + } + ] + }, + "net/minecraft/server/gui/StatsComponent": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/StatsComponent$1", + "start": "29" + } + ] + }, + "net/minecraft/server/management/PlayerProfileCache$ProfileEntry": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PlayerProfileCache" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerProfileCache$ProfileEntry", + "inner_name": "ProfileEntry", + "outer_class": "net/minecraft/server/management/PlayerProfileCache", + "start": "257" + } + ] + }, + "net/minecraft/realms/RealmsConnect": { + "innerClasses": [ + { + "inner_class": "net/minecraft/realms/RealmsConnect$1", + "start": "33" + } + ] + }, + "net/minecraft/block/BlockJukebox": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/BlockJukebox$TileEntityJukebox", + "inner_name": "TileEntityJukebox", + "outer_class": "net/minecraft/block/BlockJukebox", + "start": "20" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing", + "inner_name": "Crossing", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "626" + } + ] + }, + "net/minecraft/world/Teleporter$PortalPosition": { + "enclosingMethod": { + "owner": "net/minecraft/world/Teleporter" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/Teleporter$PortalPosition", + "inner_name": "PortalPosition", + "outer_class": "net/minecraft/world/Teleporter" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenScatteredFeature$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/MapGenScatteredFeature" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenScatteredFeature$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenScatteredFeature" + } + ] + }, + "net/minecraft/util/IChatComponent": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/util/IChatComponent$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/util/IChatComponent", + "start": "29" + } + ] + }, + "net/minecraft/client/renderer/EntityRenderer$1": { + "enclosingMethod": { + "desc": "(F)V", + "name": "func_78480_b", + "owner": "net/minecraft/client/renderer/EntityRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$1", + "start": "857" + } + ] + }, + "net/minecraft/client/gui/GuiOptions": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/GuiOptions$1", + "start": "67" + } + ] + }, + "net/minecraft/client/resources/data/IMetadataSerializer$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/data/IMetadataSerializer" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/client/resources/data/IMetadataSerializer$1" + } + ] + }, + "net/minecraft/inventory/ContainerBeacon": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/inventory/ContainerBeacon$BeaconSlot", + "inner_name": "BeaconSlot", + "outer_class": "net/minecraft/inventory/ContainerBeacon", + "start": "123" + } + ] + }, + "net/minecraft/client/gui/GuiScreenBook$NextPageButton": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiScreenBook" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiScreenBook$NextPageButton", + "inner_name": "NextPageButton", + "outer_class": "net/minecraft/client/gui/GuiScreenBook", + "start": "390" + } + ] + }, + "net/minecraft/network/NetHandlerPlayServer$SwitchEnumState": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetHandlerPlayServer" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/network/NetHandlerPlayServer$SwitchEnumState", + "inner_name": "SwitchEnumState", + "outer_class": "net/minecraft/network/NetHandlerPlayServer" + } + ] + }, + "net/minecraft/tileentity/MobSpawnerBaseLogic": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/tileentity/MobSpawnerBaseLogic$WeightedRandomMinecart", + "inner_name": "WeightedRandomMinecart", + "outer_class": "net/minecraft/tileentity/MobSpawnerBaseLogic", + "start": "327" + } + ] + }, + "net/minecraft/client/renderer/EntityRenderer$3": { + "enclosingMethod": { + "desc": "(F)V", + "name": "func_78480_b", + "owner": "net/minecraft/client/renderer/EntityRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$3", + "start": "871" + } + ] + }, + "net/minecraft/client/renderer/EntityRenderer$2": { + "enclosingMethod": { + "desc": "(F)V", + "name": "func_78480_b", + "owner": "net/minecraft/client/renderer/EntityRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$2", + "start": "864" + } + ] + }, + "net/minecraft/entity/passive/EntityHorse$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/passive/EntityHorse" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/passive/EntityHorse$1", + "start": "36" + } + ] + }, + "net/minecraft/entity/player/InventoryPlayer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/player/InventoryPlayer$1", + "start": "265" + } + ] + }, + "net/minecraft/client/resources/SkinManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SkinManager$1", + "start": "45" + }, + { + "inner_class": "net/minecraft/client/resources/SkinManager$2", + "start": "72" + }, + { + "inner_class": "net/minecraft/client/resources/SkinManager$3", + "start": "98" + }, + { + "access": "609", + "inner_class": "net/minecraft/client/resources/SkinManager$SkinAvailableCallback", + "inner_name": "SkinAvailableCallback", + "outer_class": "net/minecraft/client/resources/SkinManager" + } + ] + }, + "net/minecraft/client/renderer/RenderGlobal$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;DDDDDD)V", + "name": "func_72708_a", + "owner": "net/minecraft/client/renderer/RenderGlobal" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/RenderGlobal$1", + "start": "1532" + } + ] + }, + "net/minecraft/util/HttpUtil$DownloadListener": { + "enclosingMethod": { + "owner": "net/minecraft/util/HttpUtil" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/util/HttpUtil$DownloadListener", + "inner_name": "DownloadListener", + "outer_class": "net/minecraft/util/HttpUtil" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$DamageIterator": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$DamageIterator", + "inner_name": "DamageIterator", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "200" + } + ] + }, + "net/minecraft/client/resources/SimpleReloadableResourceManager$1": { + "enclosingMethod": { + "desc": "(Ljava/util/List;)V", + "name": "func_110541_a", + "owner": "net/minecraft/client/resources/SimpleReloadableResourceManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SimpleReloadableResourceManager$1", + "start": "81" + } + ] + }, + "net/minecraft/server/dedicated/DedicatedServer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$1", + "start": "63" + }, + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$2", + "start": "76" + }, + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$3", + "start": "249" + }, + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$4", + "start": "258" + } + ] + }, + "net/minecraft/profiler/Profiler": { + "innerClasses": [ + { + "access": "39", + "inner_class": "net/minecraft/profiler/Profiler$Result", + "inner_name": "Result", + "outer_class": "net/minecraft/profiler/Profiler", + "start": "16" + } + ] + }, + "net/minecraft/nbt/NBTBase": { + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/nbt/NBTBase$NBTPrimitive", + "inner_name": "NBTPrimitive", + "outer_class": "net/minecraft/nbt/NBTBase" + } + ] + }, + "net/minecraft/entity/EntityMinecartCommandBlock$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/EntityMinecartCommandBlock" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/EntityMinecartCommandBlock$1", + "start": "25" + } + ] + }, + "net/minecraft/world/chunk/Chunk$1": { + "enclosingMethod": { + "desc": "(III)Lnet/minecraft/block/Block;", + "name": "func_150810_a", + "owner": "net/minecraft/world/chunk/Chunk" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/chunk/Chunk$1", + "start": "368" + } + ] + }, + "net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/network/ServerStatusResponse$PlayerCountData" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData", + "start": "78" + } + ] + }, + "net/minecraft/client/network/NetHandlerLoginClient": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/NetHandlerLoginClient$1", + "start": "69" + } + ] + }, + "net/minecraft/server/management/PlayerManager": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerManager$PlayerInstance", + "inner_name": "PlayerInstance", + "outer_class": "net/minecraft/server/management/PlayerManager", + "start": "23" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsBlock": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsBlock$1", + "start": "558" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsBlock", + "inner_name": "StatsBlock", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "599" + } + ] + }, + "net/minecraft/server/network/NetHandlerHandshakeTCP": { + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/server/network/NetHandlerHandshakeTCP$SwitchEnumConnectionState", + "inner_name": "SwitchEnumConnectionState", + "outer_class": "net/minecraft/server/network/NetHandlerHandshakeTCP" + } + ] + }, + "net/minecraft/inventory/ContainerHorseInventory": { + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerHorseInventory$1", + "start": "24" + }, + { + "inner_class": "net/minecraft/inventory/ContainerHorseInventory$2", + "start": "30" + } + ] + }, + "net/minecraft/client/Minecraft$10": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$10", + "start": "1918" + } + ] + }, + "net/minecraft/stats/StatBase$2": { + "enclosingMethod": { + "owner": "net/minecraft/stats/StatBase" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/stats/StatBase$2", + "start": "71" + } + ] + }, + "net/minecraft/client/Minecraft$11": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$11", + "start": "1925" + } + ] + }, + "net/minecraft/stats/StatBase$1": { + "enclosingMethod": { + "owner": "net/minecraft/stats/StatBase" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/stats/StatBase$1", + "start": "62" + } + ] + }, + "net/minecraft/client/Minecraft$12": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$12", + "start": "1932" + } + ] + }, + "net/minecraft/stats/StatBase$4": { + "enclosingMethod": { + "owner": "net/minecraft/stats/StatBase" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/stats/StatBase$4", + "start": "109" + } + ] + }, + "net/minecraft/client/Minecraft$13": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$13", + "start": "1939" + } + ] + }, + "net/minecraft/stats/StatBase$3": { + "enclosingMethod": { + "owner": "net/minecraft/stats/StatBase" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/stats/StatBase$3", + "start": "93" + } + ] + }, + "net/minecraft/client/Minecraft$14": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$14", + "start": "1946" + } + ] + }, + "net/minecraft/entity/ai/EntityAIAvoidEntity$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/ai/EntityAIAvoidEntity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityAIAvoidEntity$1", + "start": "17" + } + ] + }, + "net/minecraft/client/Minecraft$15": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$15", + "start": "1960" + } + ] + }, + "net/minecraft/client/Minecraft$16": { + "enclosingMethod": { + "desc": "()V", + "name": "func_152348_aa", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$16", + "start": "2268" + } + ] + }, + "net/minecraft/event/ClickEvent$Action": { + "enclosingMethod": { + "owner": "net/minecraft/event/ClickEvent" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/event/ClickEvent$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/event/ClickEvent", + "start": "52" + } + ] + }, + "net/minecraft/profiler/PlayerUsageSnooper$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_76463_a", + "owner": "net/minecraft/profiler/PlayerUsageSnooper" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/profiler/PlayerUsageSnooper$1", + "start": "48" + } + ] + }, + "net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureMineshaftPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "621" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStronghold": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenStronghold$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenStronghold" + } + ] + }, + "net/minecraft/profiler/Profiler$Result": { + "enclosingMethod": { + "owner": "net/minecraft/profiler/Profiler" + }, + "innerClasses": [ + { + "access": "39", + "inner_class": "net/minecraft/profiler/Profiler$Result", + "inner_name": "Result", + "outer_class": "net/minecraft/profiler/Profiler", + "start": "16" + } + ] + }, + "net/minecraft/util/ChatComponentStyle$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/Iterable;)Ljava/util/Iterator;", + "name": "func_150262_a", + "owner": "net/minecraft/util/ChatComponentStyle" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/util/ChatComponentStyle$1", + "start": "84" + } + ] + }, + "net/minecraft/util/ChatComponentStyle$2": { + "enclosingMethod": { + "desc": "(Ljava/lang/Iterable;)Ljava/util/Iterator;", + "name": "func_150262_a", + "owner": "net/minecraft/util/ChatComponentStyle" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/util/ChatComponentStyle$2", + "start": "90" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones", + "inner_name": "Stones", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid", + "start": "612" + } + ] + }, + "net/minecraft/client/stream/IStream$AuthFailureReason": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/IStream" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/IStream$AuthFailureReason", + "inner_name": "AuthFailureReason", + "outer_class": "net/minecraft/client/stream/IStream", + "start": "11" + } + ] + }, + "net/minecraft/world/chunk/Chunk": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/chunk/Chunk$1", + "start": "368" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$ConversionError": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$ConversionError", + "inner_name": "ConversionError", + "outer_class": "net/minecraft/server/management/PreYggdrasilConverter" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "57" + }, + { + "access": "428", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece", + "inner_name": "Piece", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "148" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "334" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Straight", + "inner_name": "Straight", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "365" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$End", + "inner_name": "End", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "441" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3", + "inner_name": "Crossing3", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "541" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing", + "inner_name": "Crossing", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "626" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "704" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne", + "inner_name": "Throne", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "787" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance", + "inner_name": "Entrance", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "881" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom", + "inner_name": "NetherStalkRoom", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1009" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5", + "inner_name": "Corridor5", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1167" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2", + "inner_name": "Crossing2", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1234" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2", + "inner_name": "Corridor2", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1303" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1400" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3", + "inner_name": "Corridor3", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1494" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4", + "inner_name": "Corridor4", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1570" + } + ] + }, + "net/minecraft/tileentity/TileEntity": { + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntity$1", + "start": "170" + }, + { + "inner_class": "net/minecraft/tileentity/TileEntity$2", + "start": "179" + }, + { + "inner_class": "net/minecraft/tileentity/TileEntity$3", + "start": "191" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing", + "inner_name": "RoomCrossing", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "980" + } + ] + }, + "net/minecraft/client/stream/BroadcastController$BroadcastState": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/BroadcastController" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/BroadcastController$BroadcastState", + "inner_name": "BroadcastState", + "outer_class": "net/minecraft/client/stream/BroadcastController", + "start": "50" + } + ] + }, + "net/minecraft/command/IEntitySelector$ArmoredMob": { + "enclosingMethod": { + "owner": "net/minecraft/command/IEntitySelector" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/command/IEntitySelector$ArmoredMob", + "inner_name": "ArmoredMob", + "outer_class": "net/minecraft/command/IEntitySelector", + "start": "36" + } + ] + }, + "net/minecraft/client/gui/MapItemRenderer": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/MapItemRenderer$Instance", + "inner_name": "Instance", + "outer_class": "net/minecraft/client/gui/MapItemRenderer", + "start": "53" + }, + { + "access": "1000", + "inner_class": "net/minecraft/client/gui/MapItemRenderer$1" + } + ] + }, + "net/minecraft/client/renderer/EntityRenderer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$1", + "start": "857" + }, + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$2", + "start": "864" + }, + { + "inner_class": "net/minecraft/client/renderer/EntityRenderer$3", + "start": "871" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$End": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$End", + "inner_name": "End", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "441" + } + ] + }, + "net/minecraft/client/resources/ResourcePackRepository$Entry": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/ResourcePackRepository" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/client/resources/ResourcePackRepository", + "start": "187" + } + ] + }, + "net/minecraft/crash/CrashReportCategory$Entry": { + "enclosingMethod": { + "owner": "net/minecraft/crash/CrashReportCategory" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/crash/CrashReportCategory$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/crash/CrashReportCategory", + "start": "202" + } + ] + }, + "net/minecraft/client/stream/TwitchStream$1$1": { + "enclosingMethod": { + "desc": "()V", + "name": "run", + "owner": "net/minecraft/client/stream/TwitchStream$1" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/stream/TwitchStream$1$1", + "start": "99" + } + ] + }, + "net/minecraft/entity/EntityTracker$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/entity/Entity;IIZ)V", + "name": "func_72785_a", + "owner": "net/minecraft/entity/EntityTracker" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/EntityTracker$1", + "start": "88" + } + ] + }, + "net/minecraft/entity/Entity$SwitchEnumEntitySize": { + "enclosingMethod": { + "owner": "net/minecraft/entity/Entity" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/entity/Entity$SwitchEnumEntitySize", + "inner_name": "SwitchEnumEntitySize", + "outer_class": "net/minecraft/entity/Entity" + } + ] + }, + "net/minecraft/util/MovingObjectPosition": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/MovingObjectPosition$MovingObjectType", + "inner_name": "MovingObjectType", + "outer_class": "net/minecraft/util/MovingObjectPosition", + "start": "7" + } + ] + }, + "net/minecraft/util/IntHashMap$Entry": { + "enclosingMethod": { + "owner": "net/minecraft/util/IntHashMap" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/util/IntHashMap$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/util/IntHashMap", + "start": "190" + } + ] + }, + "net/minecraft/client/resources/SkinManager$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/SkinManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SkinManager$1", + "start": "45" + } + ] + }, + "net/minecraft/client/resources/SkinManager$2": { + "enclosingMethod": { + "desc": "(Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;Lcom/mojang/authlib/minecraft/MinecraftProfileTexture$Type;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;)Lnet/minecraft/util/ResourceLocation;", + "name": "func_152789_a", + "owner": "net/minecraft/client/resources/SkinManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SkinManager$2", + "start": "72" + } + ] + }, + "net/minecraft/client/resources/SkinManager$3": { + "enclosingMethod": { + "desc": "(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/resources/SkinManager$SkinAvailableCallback;Z)V", + "name": "func_152790_a", + "owner": "net/minecraft/client/resources/SkinManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SkinManager$3", + "start": "98" + }, + { + "inner_class": "net/minecraft/client/resources/SkinManager$3$1", + "start": "112" + } + ] + }, + "net/minecraft/entity/ai/EntityAINearestAttackableTarget": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget$1", + "start": "32" + }, + { + "access": "29", + "inner_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter", + "inner_name": "Sorter", + "outer_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget", + "start": "61" + } + ] + }, + "net/minecraft/entity/monster/EntityZombie$GroupData": { + "enclosingMethod": { + "owner": "net/minecraft/entity/monster/EntityZombie" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/entity/monster/EntityZombie$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/monster/EntityZombie" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "515" + } + ] + }, + "net/minecraft/client/resources/SkinManager$3$1": { + "enclosingMethod": { + "desc": "()V", + "name": "run", + "owner": "net/minecraft/client/resources/SkinManager$3" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SkinManager$3$1", + "start": "112" + } + ] + }, + "net/minecraft/client/gui/GuiOptionsRowList": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/gui/GuiOptionsRowList$Row", + "inner_name": "Row", + "outer_class": "net/minecraft/client/gui/GuiOptionsRowList", + "start": "67" + } + ] + }, + "net/minecraft/event/HoverEvent$Action": { + "enclosingMethod": { + "owner": "net/minecraft/event/HoverEvent" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/event/HoverEvent$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/event/HoverEvent", + "start": "52" + } + ] + }, + "net/minecraft/util/Util": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/Util$EnumOS", + "inner_name": "EnumOS", + "outer_class": "net/minecraft/util/Util", + "start": "7" + } + ] + }, + "net/minecraft/realms/RealmsConnect$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;I)V", + "name": "connect", + "owner": "net/minecraft/realms/RealmsConnect" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/realms/RealmsConnect$1", + "start": "33" + } + ] + }, + "net/minecraft/entity/ai/EntityMinecartMobSpawner$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/ai/EntityMinecartMobSpawner" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityMinecartMobSpawner$1", + "start": "16" + } + ] + }, + "net/minecraft/item/Item$ToolMaterial": { + "enclosingMethod": { + "owner": "net/minecraft/item/Item" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/item/Item$ToolMaterial", + "inner_name": "ToolMaterial", + "outer_class": "net/minecraft/item/Item", + "start": "71" + } + ] + }, + "net/minecraft/client/gui/stream/GuiIngestServers": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/stream/GuiIngestServers$ServerList", + "inner_name": "ServerList", + "outer_class": "net/minecraft/client/gui/stream/GuiIngestServers", + "start": "70" + } + ] + }, + "net/minecraft/entity/monster/EntityZombie$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/monster/EntityZombie" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/entity/monster/EntityZombie$1" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$5": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$5", + "start": "45" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$4": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$4", + "start": "39" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$3": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$3", + "start": "33" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$2": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$2", + "start": "22" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$9": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$9", + "start": "71" + } + ] + }, + "net/minecraft/command/IEntitySelector$3": { + "enclosingMethod": { + "owner": "net/minecraft/command/IEntitySelector" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/command/IEntitySelector$3", + "start": "23" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$8": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$8", + "start": "64" + } + ] + }, + "net/minecraft/command/IEntitySelector$2": { + "enclosingMethod": { + "owner": "net/minecraft/command/IEntitySelector" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/command/IEntitySelector$2", + "start": "17" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$7": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$7", + "start": "58" + } + ] + }, + "net/minecraft/command/IEntitySelector$1": { + "enclosingMethod": { + "owner": "net/minecraft/command/IEntitySelector" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/command/IEntitySelector$1", + "start": "11" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$6": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$6", + "start": "51" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Entrance", + "inner_name": "Entrance", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "881" + } + ] + }, + "net/minecraft/network/ServerStatusResponse$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/network/ServerStatusResponse" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "160" + } + ] + }, + "net/minecraft/world/Teleporter": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/Teleporter$PortalPosition", + "inner_name": "PortalPosition", + "outer_class": "net/minecraft/world/Teleporter" + } + ] + }, + "net/minecraft/client/audio/MusicTicker": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/MusicTicker$MusicType", + "inner_name": "MusicType", + "outer_class": "net/minecraft/client/audio/MusicTicker", + "start": "46" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$1": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$1", + "start": "16" + } + ] + }, + "net/minecraft/client/main/Main": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/main/Main$1", + "start": "20" + }, + { + "inner_class": "net/minecraft/client/main/Main$2", + "start": "103" + }, + { + "inner_class": "net/minecraft/client/main/Main$3", + "start": "140" + } + ] + }, + "net/minecraft/network/NetworkManager$2": { + "enclosingMethod": { + "desc": "(Ljava/net/InetAddress;I)Lnet/minecraft/network/NetworkManager;", + "name": "func_150726_a", + "owner": "net/minecraft/network/NetworkManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkManager$2", + "start": "207" + } + ] + }, + "net/minecraft/network/NetworkManager$3": { + "enclosingMethod": { + "desc": "(Ljava/net/SocketAddress;)Lnet/minecraft/network/NetworkManager;", + "name": "func_150722_a", + "owner": "net/minecraft/network/NetworkManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkManager$3", + "start": "243" + } + ] + }, + "net/minecraft/network/NetworkManager$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/network/Packet;[Lio/netty/util/concurrent/GenericFutureListener;)V", + "name": "func_150732_b", + "owner": "net/minecraft/network/NetworkManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkManager$1", + "start": "140" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom", + "inner_name": "PortalRoom", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1501" + } + ] + }, + "net/minecraft/client/gui/GuiMerchant": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiMerchant$MerchantButton", + "inner_name": "MerchantButton", + "outer_class": "net/minecraft/client/gui/GuiMerchant", + "start": "191" + } + ] + }, + "net/minecraft/network/ServerStatusResponse$PlayerCountData": { + "enclosingMethod": { + "owner": "net/minecraft/network/ServerStatusResponse" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData", + "inner_name": "PlayerCountData", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "63" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData", + "start": "78" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$2", + "start": "82" + } + ] + }, + "net/minecraft/client/audio/MusicTicker$MusicType": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/MusicTicker" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/MusicTicker$MusicType", + "inner_name": "MusicType", + "outer_class": "net/minecraft/client/audio/MusicTicker", + "start": "46" + } + ] + }, + "net/minecraft/nbt/NBTSizeTracker$1": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/NBTSizeTracker" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/nbt/NBTSizeTracker$1", + "start": "8" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$1": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$1", + "start": "76" + } + ] + }, + "net/minecraft/client/stream/BroadcastController$SwitchBroadcastState": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/BroadcastController" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/BroadcastController$SwitchBroadcastState", + "inner_name": "SwitchBroadcastState", + "outer_class": "net/minecraft/client/stream/BroadcastController" + } + ] + }, + "net/minecraft/client/stream/TwitchStream": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/stream/TwitchStream$1", + "start": "81" + } + ] + }, + "net/minecraft/inventory/ContainerBrewingStand$Potion": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerBrewingStand" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/inventory/ContainerBrewingStand$Potion", + "inner_name": "Potion", + "outer_class": "net/minecraft/inventory/ContainerBrewingStand", + "start": "131" + } + ] + }, + "net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk": { + "enclosingMethod": { + "owner": "net/minecraft/world/chunk/storage/AnvilChunkLoader" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk", + "inner_name": "PendingChunk", + "outer_class": "net/minecraft/world/chunk/storage/AnvilChunkLoader" + } + ] + }, + "net/minecraft/client/stream/ChatController$ChatListener": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/ChatController" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/stream/ChatController$ChatListener", + "inner_name": "ChatListener", + "outer_class": "net/minecraft/client/stream/ChatController" + } + ] + }, + "net/minecraft/entity/EntityMinecartCommandBlock": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/EntityMinecartCommandBlock$1", + "start": "25" + } + ] + }, + "net/minecraft/world/GameRules": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/GameRules$Value", + "inner_name": "Value", + "outer_class": "net/minecraft/world/GameRules", + "start": "121" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/layer/GenLayer$1", + "start": "169" + }, + { + "inner_class": "net/minecraft/world/gen/layer/GenLayer$2", + "start": "175" + } + ] + }, + "net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter": { + "enclosingMethod": { + "owner": "net/minecraft/entity/ai/EntityAINearestAttackableTarget" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget$Sorter", + "inner_name": "Sorter", + "outer_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget", + "start": "61" + } + ] + }, + "net/minecraft/entity/passive/EntitySheep$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/passive/EntitySheep" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/passive/EntitySheep$1", + "start": "31" + } + ] + }, + "net/minecraft/server/management/UserList$1": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/UserList" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/UserList$1", + "start": "161" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "54" + }, + { + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$1", + "start": "76" + }, + { + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$2", + "start": "82" + }, + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold", + "inner_name": "Stronghold", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "229" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "367" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "479" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2", + "inner_name": "Stairs2", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "565" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight", + "inner_name": "Straight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "599" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$ChestCorridor", + "inner_name": "ChestCorridor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "708" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight", + "inner_name": "StairsStraight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "795" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn", + "inner_name": "LeftTurn", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "862" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn", + "inner_name": "RightTurn", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "916" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$RoomCrossing", + "inner_name": "RoomCrossing", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "980" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison", + "inner_name": "Prison", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1127" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Library", + "inner_name": "Library", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1211" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing", + "inner_name": "Crossing", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1387" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$PortalRoom", + "inner_name": "PortalRoom", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1501" + }, + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stones", + "inner_name": "Stones", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1632" + }, + { + "access": "1018", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor", + "inner_name": "SwitchDoor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + } + ] + }, + "net/minecraft/crash/CrashReportCategory$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;IIILnet/minecraft/block/Block;I)V", + "name": "func_147153_a", + "owner": "net/minecraft/crash/CrashReportCategory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReportCategory$2", + "start": "165" + } + ] + }, + "net/minecraft/crash/CrashReportCategory$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;IIILnet/minecraft/block/Block;I)V", + "name": "func_147153_a", + "owner": "net/minecraft/crash/CrashReportCategory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReportCategory$1", + "start": "154" + } + ] + }, + "net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/client/C03PacketPlayer" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C04PacketPlayerPosition", + "inner_name": "C04PacketPlayerPosition", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "63" + } + ] + }, + "net/minecraft/crash/CrashReportCategory$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;IIILnet/minecraft/block/Block;I)V", + "name": "func_147153_a", + "owner": "net/minecraft/crash/CrashReportCategory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReportCategory$3", + "start": "176" + } + ] + }, + "net/minecraft/entity/DataWatcher$WatchableObject": { + "enclosingMethod": { + "owner": "net/minecraft/entity/DataWatcher" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/DataWatcher$WatchableObject", + "inner_name": "WatchableObject", + "outer_class": "net/minecraft/entity/DataWatcher", + "start": "323" + } + ] + }, + "net/minecraft/entity/player/EntityPlayer$EnumChatVisibility": { + "enclosingMethod": { + "owner": "net/minecraft/entity/player/EntityPlayer" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/player/EntityPlayer$EnumChatVisibility", + "inner_name": "EnumChatVisibility", + "outer_class": "net/minecraft/entity/player/EntityPlayer", + "start": "51" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$LeftTurn", + "inner_name": "LeftTurn", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "862" + } + ] + }, + "net/minecraft/client/gui/GuiSelectWorld": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiSelectWorld$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiSelectWorld", + "start": "201" + } + ] + }, + "net/minecraft/entity/EntityTracker": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/EntityTracker$1", + "start": "88" + } + ] + }, + "net/minecraft/nbt/NBTTagCompound$2": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;ILjava/lang/ClassCastException;)Lnet/minecraft/crash/CrashReport;", + "name": "func_82581_a", + "owner": "net/minecraft/nbt/NBTTagCompound" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/nbt/NBTTagCompound$2", + "start": "274" + } + ] + }, + "net/minecraft/nbt/JsonToNBT$Primitive": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/JsonToNBT" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$Primitive", + "inner_name": "Primitive", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "323" + } + ] + }, + "net/minecraft/client/gui/GuiLanguage": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiLanguage$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiLanguage", + "start": "100" + } + ] + }, + "net/minecraft/util/IChatComponent$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/util/IChatComponent" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/util/IChatComponent$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/util/IChatComponent", + "start": "29" + } + ] + }, + "net/minecraft/block/Block$SoundType": { + "enclosingMethod": { + "owner": "net/minecraft/block/Block" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/Block$SoundType", + "inner_name": "SoundType", + "outer_class": "net/minecraft/block/Block", + "start": "126" + } + ] + }, + "net/minecraft/nbt/NBTTagCompound$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;ILjava/lang/ClassCastException;)Lnet/minecraft/crash/CrashReport;", + "name": "func_82581_a", + "owner": "net/minecraft/nbt/NBTTagCompound" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/nbt/NBTTagCompound$1", + "start": "268" + } + ] + }, + "net/minecraft/network/NetHandlerPlayServer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetHandlerPlayServer$1", + "start": "109" + }, + { + "inner_class": "net/minecraft/network/NetHandlerPlayServer$2", + "start": "442" + }, + { + "access": "1018", + "inner_class": "net/minecraft/network/NetHandlerPlayServer$SwitchEnumState", + "inner_name": "SwitchEnumState", + "outer_class": "net/minecraft/network/NetHandlerPlayServer" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiBeacon$Button": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiBeacon" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$Button", + "inner_name": "Button", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "193" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$House2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House2", + "inner_name": "House2", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1540" + } + ] + }, + "net/minecraft/util/Session": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/Session$Type", + "inner_name": "Type", + "outer_class": "net/minecraft/util/Session", + "start": "54" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$House3": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House3", + "inner_name": "House3", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1356" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$House1": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House1", + "inner_name": "House1", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "952" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$IModifier": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "608", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$IModifier", + "inner_name": "IModifier", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper" + } + ] + }, + "net/minecraft/server/management/PlayerProfileCache$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PlayerProfileCache" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerProfileCache$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/server/management/PlayerProfileCache", + "start": "210" + } + ] + }, + "net/minecraft/server/management/UserList": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/UserList$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/server/management/UserList", + "start": "139" + }, + { + "inner_class": "net/minecraft/server/management/UserList$1", + "start": "161" + } + ] + }, + "net/minecraft/world/chunk/storage/AnvilSaveConverter$1": { + "enclosingMethod": { + "owner": "net/minecraft/world/chunk/storage/AnvilSaveConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/chunk/storage/AnvilSaveConverter$1", + "start": "235" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "334" + } + ] + }, + "net/minecraft/scoreboard/Score": { + "innerClasses": [ + { + "inner_class": "net/minecraft/scoreboard/Score$1", + "start": "9" + } + ] + }, + "net/minecraft/client/stream/ChatController": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/ChatController$ChatState", + "inner_name": "ChatState", + "outer_class": "net/minecraft/client/stream/ChatController", + "start": "37" + }, + { + "access": "609", + "inner_class": "net/minecraft/client/stream/ChatController$ChatListener", + "inner_name": "ChatListener", + "outer_class": "net/minecraft/client/stream/ChatController" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/ChatController$SwitchChatState", + "inner_name": "SwitchChatState", + "outer_class": "net/minecraft/client/stream/ChatController" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiBeacon" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton", + "inner_name": "ConfirmButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "260" + } + ] + }, + "net/minecraft/tileentity/TileEntityMobSpawner$1": { + "enclosingMethod": { + "owner": "net/minecraft/tileentity/TileEntityMobSpawner" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntityMobSpawner$1", + "start": "14" + } + ] + }, + "net/minecraft/util/EnumTypeAdapterFactory": { + "innerClasses": [ + { + "inner_class": "net/minecraft/util/EnumTypeAdapterFactory$1", + "start": "36" + } + ] + }, + "net/minecraft/network/EnumConnectionState": { + "innerClasses": [ + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$1" + }, + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$2" + }, + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$3" + }, + { + "access": "4000", + "inner_class": "net/minecraft/network/EnumConnectionState$4" + } + ] + }, + "net/minecraft/client/gui/GuiListExtended": { + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/gui/GuiListExtended$IGuiListEntry", + "inner_name": "IGuiListEntry", + "outer_class": "net/minecraft/client/gui/GuiListExtended" + } + ] + }, + "net/minecraft/client/gui/GuiKeyBindingList$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiKeyBindingList" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$1" + } + ] + }, + "net/minecraft/realms/RealmsServerStatusPinger$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;Lnet/minecraft/realms/ServerPing;)V", + "name": "pingServer", + "owner": "net/minecraft/realms/RealmsServerStatusPinger" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/realms/RealmsServerStatusPinger$1", + "start": "37" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Path": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Path", + "inner_name": "Path", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "550" + } + ] + }, + "net/minecraft/client/shader/ShaderLoader": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/shader/ShaderLoader$ShaderType", + "inner_name": "ShaderType", + "outer_class": "net/minecraft/client/shader/ShaderLoader", + "start": "79" + } + ] + }, + "net/minecraft/item/ItemArmor$1": { + "enclosingMethod": { + "owner": "net/minecraft/item/ItemArmor" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/item/ItemArmor$1", + "start": "37" + } + ] + }, + "net/minecraft/inventory/ContainerRepair": { + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerRepair$1", + "start": "39" + }, + { + "inner_class": "net/minecraft/inventory/ContainerRepair$2", + "start": "64" + } + ] + }, + "net/minecraft/util/LongHashMap": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/util/LongHashMap$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/util/LongHashMap", + "start": "189" + } + ] + }, + "net/minecraft/client/settings/GameSettings$SwitchOptions": { + "enclosingMethod": { + "owner": "net/minecraft/client/settings/GameSettings" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/settings/GameSettings$SwitchOptions", + "inner_name": "SwitchOptions", + "outer_class": "net/minecraft/client/settings/GameSettings" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenVillage$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/MapGenVillage" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenVillage$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenVillage", + "start": "121" + } + ] + }, + "net/minecraft/client/renderer/ThreadDownloadImageData$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_152433_a", + "owner": "net/minecraft/client/renderer/ThreadDownloadImageData" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/ThreadDownloadImageData$1", + "start": "103" + } + ] + }, + "net/minecraft/client/network/NetHandlerPlayClient": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/NetHandlerPlayClient$1", + "start": "1080" + } + ] + }, + "net/minecraft/block/BlockRailBase$Rail": { + "enclosingMethod": { + "owner": "net/minecraft/block/BlockRailBase" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/block/BlockRailBase$Rail", + "inner_name": "Rail", + "outer_class": "net/minecraft/block/BlockRailBase", + "start": "44" + } + ] + }, + "net/minecraft/client/resources/ResourcePackRepository": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$1", + "start": "32" + }, + { + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$2", + "start": "156" + }, + { + "access": "21", + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/client/resources/ResourcePackRepository", + "start": "187" + } + ] + }, + "net/minecraft/server/management/PlayerProfileCache$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/MinecraftServer;Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;", + "name": "func_152650_a", + "owner": "net/minecraft/server/management/PlayerProfileCache" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PlayerProfileCache$1", + "start": "50" + } + ] + }, + "net/minecraft/world/GameRules$Value": { + "enclosingMethod": { + "owner": "net/minecraft/world/GameRules" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/GameRules$Value", + "inner_name": "Value", + "outer_class": "net/minecraft/world/GameRules", + "start": "121" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$11": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$11", + "start": "86" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$12": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$12", + "start": "92" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs$10": { + "enclosingMethod": { + "owner": "net/minecraft/creativetab/CreativeTabs" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$10", + "start": "80" + } + ] + }, + "net/minecraft/server/management/PlayerProfileCache$2": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PlayerProfileCache" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PlayerProfileCache$2", + "start": "278" + } + ] + }, + "net/minecraft/util/ChatStyle$1": { + "enclosingMethod": { + "owner": "net/minecraft/util/ChatStyle" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/util/ChatStyle$1", + "start": "193" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenNetherBridge": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenNetherBridge$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenNetherBridge" + } + ] + }, + "net/minecraft/client/stream/ChatController$ChatState": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/ChatController" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/ChatController$ChatState", + "inner_name": "ChatState", + "outer_class": "net/minecraft/client/stream/ChatController", + "start": "37" + } + ] + }, + "net/minecraft/client/gui/GuiFlatPresets$LayerItem": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiFlatPresets" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiFlatPresets$LayerItem", + "inner_name": "LayerItem", + "outer_class": "net/minecraft/client/gui/GuiFlatPresets" + } + ] + }, + "net/minecraft/inventory/ContainerPlayer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerPlayer$1", + "start": "43" + } + ] + }, + "net/minecraft/server/MinecraftServer$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$4", + "start": "713" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/MinecraftServer;)Z", + "name": "func_152724_a", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$2", + "start": "85" + } + ] + }, + "net/minecraft/entity/player/EntityPlayer": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/player/EntityPlayer$EnumChatVisibility", + "inner_name": "EnumChatVisibility", + "outer_class": "net/minecraft/entity/player/EntityPlayer", + "start": "51" + }, + { + "access": "4029", + "inner_class": "net/minecraft/entity/player/EntityPlayer$EnumStatus", + "inner_name": "EnumStatus", + "outer_class": "net/minecraft/entity/player/EntityPlayer", + "start": "1030" + } + ] + }, + "net/minecraft/server/MinecraftServer$5": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$5", + "start": "721" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/MinecraftServer;Ljava/util/Collection;Lcom/mojang/authlib/ProfileLookupCallback;)V", + "name": "func_152717_a", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$1", + "start": "51" + } + ] + }, + "net/minecraft/server/MinecraftServer$6": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$6", + "start": "737" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/MinecraftServer;)Z", + "name": "func_152710_d", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$4", + "start": "212" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/MinecraftServer;)Z", + "name": "func_152718_c", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$3", + "start": "170" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$6": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/dedicated/DedicatedServer;Lnet/minecraft/server/dedicated/PropertyManager;)Z", + "name": "func_152723_a", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$6", + "start": "307" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Prison", + "inner_name": "Prison", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1127" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$5": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;)Ljava/lang/String;", + "name": "func_152719_a", + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$5", + "start": "255" + } + ] + }, + "net/minecraft/client/stream/IngestServerTester$IngestTestListener": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/IngestServerTester" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/stream/IngestServerTester$IngestTestListener", + "inner_name": "IngestTestListener", + "outer_class": "net/minecraft/client/stream/IngestServerTester" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter$7": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PreYggdrasilConverter" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$7", + "start": "422" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut", + "inner_name": "WoodHut", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1097" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Torch": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Torch", + "inner_name": "Torch", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1897" + } + ] + }, + "net/minecraft/server/MinecraftServer$1": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;)V", + "name": "func_71237_c", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$1", + "start": "139" + } + ] + }, + "net/minecraft/server/MinecraftServer$2": { + "enclosingMethod": { + "desc": "([Ljava/lang/String;)V", + "name": "main", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$2", + "start": "616" + } + ] + }, + "net/minecraft/client/resources/SimpleReloadableResourceManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/SimpleReloadableResourceManager$1", + "start": "81" + } + ] + }, + "net/minecraft/server/MinecraftServer$3": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71256_s", + "owner": "net/minecraft/server/MinecraftServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$3", + "start": "628" + } + ] + }, + "net/minecraft/client/multiplayer/ServerData": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/multiplayer/ServerData$ServerResourceMode", + "inner_name": "ServerResourceMode", + "outer_class": "net/minecraft/client/multiplayer/ServerData", + "start": "99" + } + ] + }, + "net/minecraft/client/particle/EffectRenderer$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/entity/Entity;F)V", + "name": "func_78874_a", + "owner": "net/minecraft/client/particle/EffectRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$4", + "start": "157" + } + ] + }, + "net/minecraft/client/particle/EffectRenderer$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/entity/Entity;F)V", + "name": "func_78874_a", + "owner": "net/minecraft/client/particle/EffectRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$3", + "start": "150" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid", + "inner_name": "JunglePyramid", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "394" + }, + { + "access": "28", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid$Stones", + "inner_name": "Stones", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid", + "start": "612" + } + ] + }, + "net/minecraft/client/particle/EffectRenderer$2": { + "enclosingMethod": { + "desc": "()V", + "name": "func_78868_a", + "owner": "net/minecraft/client/particle/EffectRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$2", + "start": "77" + } + ] + }, + "net/minecraft/client/particle/EffectRenderer$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_78868_a", + "owner": "net/minecraft/client/particle/EffectRenderer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$1", + "start": "70" + } + ] + }, + "net/minecraft/block/BlockPressurePlate": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/block/BlockPressurePlate$Sensitivity", + "inner_name": "Sensitivity", + "outer_class": "net/minecraft/block/BlockPressurePlate", + "start": "12" + } + ] + }, + "net/minecraft/entity/monster/EntitySpider$GroupData": { + "enclosingMethod": { + "owner": "net/minecraft/entity/monster/EntitySpider" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/monster/EntitySpider$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/monster/EntitySpider", + "start": "191" + } + ] + }, + "net/minecraft/util/WeightedRandom": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/util/WeightedRandom$Item", + "inner_name": "Item", + "outer_class": "net/minecraft/util/WeightedRandom" + } + ] + }, + "net/minecraft/client/audio/ISound": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/ISound$AttenuationType", + "inner_name": "AttenuationType", + "outer_class": "net/minecraft/client/audio/ISound", + "start": "7" + } + ] + }, + "net/minecraft/world/World$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/world/World" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/World$4", + "start": "2582" + } + ] + }, + "net/minecraft/world/World$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReportCategory;", + "name": "func_72914_a", + "owner": "net/minecraft/world/World" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/World$3", + "start": "2575" + } + ] + }, + "net/minecraft/tileentity/TileEntityCommandBlock$1": { + "enclosingMethod": { + "owner": "net/minecraft/tileentity/TileEntityCommandBlock" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntityCommandBlock$1", + "start": "17" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs2", + "inner_name": "Stairs2", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "565" + } + ] + }, + "net/minecraft/dispenser/IBehaviorDispenseItem$1": { + "enclosingMethod": { + "owner": "net/minecraft/dispenser/IBehaviorDispenseItem" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/dispenser/IBehaviorDispenseItem$1", + "start": "12" + } + ] + }, + "net/minecraft/client/gui/GuiCreateFlatWorld": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiCreateFlatWorld$Details", + "inner_name": "Details", + "outer_class": "net/minecraft/client/gui/GuiCreateFlatWorld", + "start": "140" + } + ] + }, + "net/minecraft/world/World$2": { + "enclosingMethod": { + "desc": "(IIILnet/minecraft/block/Block;)V", + "name": "func_147460_e", + "owner": "net/minecraft/world/World" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/World$2", + "start": "491" + } + ] + }, + "net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/server/S14PacketEntity" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove", + "inner_name": "S17PacketEntityLookMove", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "19" + } + ] + }, + "net/minecraft/world/World$1": { + "enclosingMethod": { + "desc": "(II)Lnet/minecraft/world/biome/BiomeGenBase;", + "name": "func_72807_a", + "owner": "net/minecraft/world/World" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/World$1", + "start": "120" + } + ] + }, + "net/minecraft/util/Util$EnumOS": { + "enclosingMethod": { + "owner": "net/minecraft/util/Util" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/Util$EnumOS", + "inner_name": "EnumOS", + "outer_class": "net/minecraft/util/Util", + "start": "7" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces" + }, + "innerClasses": [ + { + "access": "428", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature", + "inner_name": "Feature", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "55" + } + ] + }, + "net/minecraft/world/gen/structure/StructureComponent": { + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureComponent$BlockSelector", + "inner_name": "BlockSelector", + "outer_class": "net/minecraft/world/gen/structure/StructureComponent", + "start": "655" + } + ] + }, + "net/minecraft/world/storage/MapData": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/storage/MapData$MapInfo", + "inner_name": "MapInfo", + "outer_class": "net/minecraft/world/storage/MapData", + "start": "51" + }, + { + "access": "21", + "inner_class": "net/minecraft/world/storage/MapData$MapCoord", + "inner_name": "MapCoord", + "outer_class": "net/minecraft/world/storage/MapData" + } + ] + }, + "net/minecraft/network/play/client/C16PacketClientStatus$EnumState": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/client/C16PacketClientStatus" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/network/play/client/C16PacketClientStatus$EnumState", + "inner_name": "EnumState", + "outer_class": "net/minecraft/network/play/client/C16PacketClientStatus", + "start": "9" + } + ] + }, + "net/minecraft/command/IEntitySelector": { + "innerClasses": [ + { + "inner_class": "net/minecraft/command/IEntitySelector$1", + "start": "11" + }, + { + "inner_class": "net/minecraft/command/IEntitySelector$2", + "start": "17" + }, + { + "inner_class": "net/minecraft/command/IEntitySelector$3", + "start": "23" + }, + { + "access": "29", + "inner_class": "net/minecraft/command/IEntitySelector$ArmoredMob", + "inner_name": "ArmoredMob", + "outer_class": "net/minecraft/command/IEntitySelector", + "start": "36" + } + ] + }, + "net/minecraft/client/Minecraft": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$1", + "start": "245" + }, + { + "inner_class": "net/minecraft/client/Minecraft$2", + "start": "409" + }, + { + "inner_class": "net/minecraft/client/Minecraft$3", + "start": "1332" + }, + { + "inner_class": "net/minecraft/client/Minecraft$4", + "start": "1347" + }, + { + "inner_class": "net/minecraft/client/Minecraft$5", + "start": "1880" + }, + { + "inner_class": "net/minecraft/client/Minecraft$6", + "start": "1887" + }, + { + "inner_class": "net/minecraft/client/Minecraft$7", + "start": "1894" + }, + { + "inner_class": "net/minecraft/client/Minecraft$8", + "start": "1901" + }, + { + "inner_class": "net/minecraft/client/Minecraft$9", + "start": "1908" + }, + { + "inner_class": "net/minecraft/client/Minecraft$10", + "start": "1918" + }, + { + "inner_class": "net/minecraft/client/Minecraft$11", + "start": "1925" + }, + { + "inner_class": "net/minecraft/client/Minecraft$12", + "start": "1932" + }, + { + "inner_class": "net/minecraft/client/Minecraft$13", + "start": "1939" + }, + { + "inner_class": "net/minecraft/client/Minecraft$14", + "start": "1946" + }, + { + "inner_class": "net/minecraft/client/Minecraft$15", + "start": "1960" + }, + { + "inner_class": "net/minecraft/client/Minecraft$16", + "start": "2268" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/Minecraft$SwitchMovingObjectType", + "inner_name": "SwitchMovingObjectType", + "outer_class": "net/minecraft/client/Minecraft" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiBeacon$CancelButton": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiBeacon" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$CancelButton", + "inner_name": "CancelButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "272" + } + ] + }, + "net/minecraft/util/ChatComponentStyle": { + "innerClasses": [ + { + "inner_class": "net/minecraft/util/ChatComponentStyle$1", + "start": "84" + }, + { + "inner_class": "net/minecraft/util/ChatComponentStyle$2", + "start": "90" + } + ] + }, + "net/minecraft/command/CommandSpreadPlayers$Position": { + "enclosingMethod": { + "owner": "net/minecraft/command/CommandSpreadPlayers" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/command/CommandSpreadPlayers$Position", + "inner_name": "Position", + "outer_class": "net/minecraft/command/CommandSpreadPlayers", + "start": "238" + } + ] + }, + "net/minecraft/world/WorldServer$ServerBlockEventList": { + "enclosingMethod": { + "owner": "net/minecraft/world/WorldServer" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/WorldServer$ServerBlockEventList", + "inner_name": "ServerBlockEventList", + "outer_class": "net/minecraft/world/WorldServer" + } + ] + }, + "net/minecraft/tileentity/TileEntityCommandBlock": { + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntityCommandBlock$1", + "start": "17" + } + ] + }, + "net/minecraft/client/network/OldServerPinger$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/multiplayer/ServerData;)V", + "name": "func_147224_a", + "owner": "net/minecraft/client/network/OldServerPinger" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/OldServerPinger$1", + "start": "53" + } + ] + }, + "net/minecraft/client/network/OldServerPinger$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/client/multiplayer/ServerData;)V", + "name": "func_147225_b", + "owner": "net/minecraft/client/network/OldServerPinger" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/OldServerPinger$2", + "start": "157" + }, + { + "inner_class": "net/minecraft/client/network/OldServerPinger$2$1", + "start": "166" + } + ] + }, + "net/minecraft/entity/monster/EntitySpider": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/monster/EntitySpider$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/monster/EntitySpider", + "start": "191" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold$Door", + "inner_name": "Door", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stronghold", + "start": "223" + } + ] + }, + "net/minecraft/nbt/JsonToNBT": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$Compound", + "inner_name": "Compound", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "281" + }, + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$List", + "inner_name": "List", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "300" + }, + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$Primitive", + "inner_name": "Primitive", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "323" + }, + { + "access": "428", + "inner_class": "net/minecraft/nbt/JsonToNBT$Any", + "inner_name": "Any", + "outer_class": "net/minecraft/nbt/JsonToNBT" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$RightTurn", + "inner_name": "RightTurn", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "916" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Straight", + "inner_name": "Straight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "599" + } + ] + }, + "net/minecraft/client/settings/GameSettings$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/settings/GameSettings" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/settings/GameSettings$1", + "start": "35" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$SwitchDoor", + "inner_name": "SwitchDoor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + } + ] + }, + "net/minecraft/block/Block": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/Block$SoundType", + "inner_name": "SoundType", + "outer_class": "net/minecraft/block/Block", + "start": "126" + }, + { + "inner_class": "net/minecraft/block/Block$1", + "start": "155" + }, + { + "inner_class": "net/minecraft/block/Block$2", + "start": "169" + }, + { + "inner_class": "net/minecraft/block/Block$3", + "start": "175" + } + ] + }, + "net/minecraft/client/resources/SkinManager$SkinAvailableCallback": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/SkinManager" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/resources/SkinManager$SkinAvailableCallback", + "inner_name": "SkinAvailableCallback", + "outer_class": "net/minecraft/client/resources/SkinManager" + } + ] + }, + "net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/stream/GuiStreamUnavailable" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason", + "inner_name": "Reason", + "outer_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable", + "start": "174" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Hall": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Hall", + "inner_name": "Hall", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1216" + } + ] + }, + "net/minecraft/client/audio/SoundManager$SoundSystemStarterThread": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundManager" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/audio/SoundManager$SoundSystemStarterThread", + "inner_name": "SoundSystemStarterThread", + "outer_class": "net/minecraft/client/audio/SoundManager", + "start": "417" + } + ] + }, + "net/minecraft/client/gui/GuiScreenOptionsSounds": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiScreenOptionsSounds$Button", + "inner_name": "Button", + "outer_class": "net/minecraft/client/gui/GuiScreenOptionsSounds", + "start": "90" + } + ] + }, + "net/minecraft/client/stream/ChatController$SwitchChatState": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/ChatController" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/ChatController$SwitchChatState", + "inner_name": "SwitchChatState", + "outer_class": "net/minecraft/client/stream/ChatController" + } + ] + }, + "net/minecraft/world/WorldServer$1": { + "enclosingMethod": { + "owner": "net/minecraft/world/WorldServer" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/world/WorldServer$1" + } + ] + }, + "net/minecraft/creativetab/CreativeTabs": { + "innerClasses": [ + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$1", + "start": "16" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$2", + "start": "22" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$3", + "start": "33" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$4", + "start": "39" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$5", + "start": "45" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$6", + "start": "51" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$7", + "start": "58" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$8", + "start": "64" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$9", + "start": "71" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$10", + "start": "80" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$11", + "start": "86" + }, + { + "inner_class": "net/minecraft/creativetab/CreativeTabs$12", + "start": "92" + } + ] + }, + "net/minecraft/world/gen/structure/StructureMineshaftPieces": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Room", + "inner_name": "Room", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "86" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "210" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross", + "inner_name": "Cross", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "470" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "621" + } + ] + }, + "net/minecraft/network/NetworkStatistics": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkStatistics$Tracker", + "inner_name": "Tracker", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "86" + }, + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkStatistics$PacketStatData", + "inner_name": "PacketStatData", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "159" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/NetworkStatistics$PacketStat", + "inner_name": "PacketStat", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "209" + }, + { + "access": "1000", + "inner_class": "net/minecraft/network/NetworkStatistics$1" + } + ] + }, + "net/minecraft/world/biome/BiomeGenBase": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$TempCategory", + "inner_name": "TempCategory", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "26" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$Height", + "inner_name": "Height", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "42" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$SpawnListEntry", + "inner_name": "SpawnListEntry", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "326" + } + ] + }, + "net/minecraft/client/network/OldServerPinger$2$1": { + "enclosingMethod": { + "desc": "(Lio/netty/channel/Channel;)V", + "name": "initChannel", + "owner": "net/minecraft/client/network/OldServerPinger$2" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/OldServerPinger$2$1", + "start": "166" + } + ] + }, + "net/minecraft/world/chunk/storage/AnvilChunkLoader": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/world/chunk/storage/AnvilChunkLoader$PendingChunk", + "inner_name": "PendingChunk", + "outer_class": "net/minecraft/world/chunk/storage/AnvilChunkLoader" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden", + "inner_name": "House4Garden", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "676" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$1": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$1" + } + ] + }, + "net/minecraft/item/crafting/CraftingManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/item/crafting/CraftingManager$1", + "start": "727" + } + ] + }, + "net/minecraft/init/Bootstrap$5$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/dispenser/IBlockSource;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/item/ItemStack;", + "name": "func_82482_a", + "owner": "net/minecraft/init/Bootstrap$5" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$5$1", + "start": "67" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$9": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$9", + "start": "448" + } + ] + }, + "net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureMineshaftPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Cross", + "inner_name": "Cross", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "470" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$8": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$8", + "start": "441" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$7": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$7", + "start": "419" + } + ] + }, + "net/minecraft/inventory/ContainerHorseInventory$2": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerHorseInventory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerHorseInventory$2", + "start": "30" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$6": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$6", + "start": "412" + } + ] + }, + "net/minecraft/inventory/ContainerEnchantment": { + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerEnchantment$1", + "start": "21" + }, + { + "inner_class": "net/minecraft/inventory/ContainerEnchantment$2", + "start": "47" + } + ] + }, + "net/minecraft/inventory/ContainerHorseInventory$1": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerHorseInventory" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerHorseInventory$1", + "start": "24" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$5": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$5", + "start": "405" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$4", + "start": "398" + } + ] + }, + "net/minecraft/init/Bootstrap": { + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$1", + "start": "23" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$2", + "start": "32" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$3", + "start": "38" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$4", + "start": "44" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$5", + "start": "63" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$6", + "start": "89" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$7", + "start": "110" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$8", + "start": "132" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$9", + "start": "163" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$10", + "start": "203" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$11", + "start": "227" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$12", + "start": "262" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$13", + "start": "302" + }, + { + "inner_class": "net/minecraft/init/Bootstrap$14", + "start": "335" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$3", + "start": "391" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$2", + "start": "384" + } + ] + }, + "net/minecraft/world/storage/WorldInfo$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85118_a", + "owner": "net/minecraft/world/storage/WorldInfo" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$1", + "start": "377" + } + ] + }, + "net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetworkManager" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener", + "inner_name": "InboundHandlerTuplePacketListener", + "outer_class": "net/minecraft/network/NetworkManager", + "start": "279" + } + ] + }, + "net/minecraft/client/gui/stream/GuiStreamUnavailable": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable$Reason", + "inner_name": "Reason", + "outer_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable", + "start": "174" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason", + "inner_name": "SwitchReason", + "outer_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable" + } + ] + }, + "net/minecraft/client/renderer/texture/Stitcher$Slot": { + "enclosingMethod": { + "owner": "net/minecraft/client/renderer/texture/Stitcher" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/renderer/texture/Stitcher$Slot", + "inner_name": "Slot", + "outer_class": "net/minecraft/client/renderer/texture/Stitcher", + "start": "282" + } + ] + }, + "net/minecraft/item/ItemArmor$ArmorMaterial": { + "enclosingMethod": { + "owner": "net/minecraft/item/ItemArmor" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/item/ItemArmor$ArmorMaterial", + "inner_name": "ArmorMaterial", + "outer_class": "net/minecraft/item/ItemArmor", + "start": "60" + } + ] + }, + "net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState": { + "enclosingMethod": { + "owner": "net/minecraft/client/network/NetHandlerHandshakeMemory" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState", + "inner_name": "SwitchEnumConnectionState", + "outer_class": "net/minecraft/client/network/NetHandlerHandshakeMemory" + } + ] + }, + "net/minecraft/tileentity/TileEntityMobSpawner": { + "innerClasses": [ + { + "inner_class": "net/minecraft/tileentity/TileEntityMobSpawner$1", + "start": "14" + } + ] + }, + "net/minecraft/util/IntHashMap": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/util/IntHashMap$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/util/IntHashMap", + "start": "190" + } + ] + }, + "net/minecraft/world/biome/BiomeGenSavanna": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenSavanna$Mutated", + "inner_name": "Mutated", + "outer_class": "net/minecraft/world/biome/BiomeGenSavanna", + "start": "69" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$NetherStalkRoom", + "inner_name": "NetherStalkRoom", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1009" + } + ] + }, + "net/minecraft/client/gui/GuiSelectWorld$List": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiSelectWorld" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiSelectWorld$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiSelectWorld", + "start": "201" + } + ] + }, + "net/minecraft/client/renderer/texture/Stitcher$Holder": { + "enclosingMethod": { + "owner": "net/minecraft/client/renderer/texture/Stitcher" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/renderer/texture/Stitcher$Holder", + "inner_name": "Holder", + "outer_class": "net/minecraft/client/renderer/texture/Stitcher", + "start": "191" + } + ] + }, + "net/minecraft/client/stream/TwitchStream$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/TwitchStream" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/stream/TwitchStream$1", + "start": "81" + }, + { + "inner_class": "net/minecraft/client/stream/TwitchStream$1$1", + "start": "99" + } + ] + }, + "net/minecraft/entity/monster/EntityZombie": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/entity/monster/EntityZombie$GroupData", + "inner_name": "GroupData", + "outer_class": "net/minecraft/entity/monster/EntityZombie" + }, + { + "access": "1000", + "inner_class": "net/minecraft/entity/monster/EntityZombie$1" + } + ] + }, + "net/minecraft/client/audio/SoundList$SoundEntry": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundList" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/audio/SoundList$SoundEntry", + "inner_name": "SoundEntry", + "outer_class": "net/minecraft/client/audio/SoundList", + "start": "41" + }, + { + "access": "4029", + "inner_class": "net/minecraft/client/audio/SoundList$SoundEntry$Type", + "inner_name": "Type", + "outer_class": "net/minecraft/client/audio/SoundList$SoundEntry", + "start": "88" + } + ] + }, + "net/minecraft/world/biome/BiomeGenForest$2": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeGenForest" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/biome/BiomeGenForest$2", + "start": "176" + } + ] + }, + "net/minecraft/world/biome/BiomeGenForest$1": { + "enclosingMethod": { + "desc": "()Lnet/minecraft/world/biome/BiomeGenBase;", + "name": "func_150566_k", + "owner": "net/minecraft/world/biome/BiomeGenForest" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/biome/BiomeGenForest$1", + "start": "166" + } + ] + }, + "net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/client/C03PacketPlayer" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C05PacketPlayerLook", + "inner_name": "C05PacketPlayerLook", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "98" + } + ] + }, + "net/minecraft/world/WorldSettings$GameType": { + "enclosingMethod": { + "owner": "net/minecraft/world/WorldSettings" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/WorldSettings$GameType", + "inner_name": "GameType", + "outer_class": "net/minecraft/world/WorldSettings", + "start": "8" + } + ] + }, + "net/minecraft/world/storage/MapData$MapCoord": { + "enclosingMethod": { + "owner": "net/minecraft/world/storage/MapData" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/storage/MapData$MapCoord", + "inner_name": "MapCoord", + "outer_class": "net/minecraft/world/storage/MapData" + } + ] + }, + "net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureMineshaftPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureMineshaftPieces", + "start": "210" + } + ] + }, + "net/minecraft/client/stream/IngestServerTester$SwitchStatType": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/IngestServerTester" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/IngestServerTester$SwitchStatType", + "inner_name": "SwitchStatType", + "outer_class": "net/minecraft/client/stream/IngestServerTester" + } + ] + }, + "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier": { + "enclosingMethod": { + "owner": "net/minecraft/network/ServerStatusResponse" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier", + "inner_name": "MinecraftProtocolVersionIdentifier", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "136" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier", + "start": "143" + } + ] + }, + "net/minecraft/entity/boss/EntityWither$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/boss/EntityWither" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/boss/EntityWither$1", + "start": "44" + } + ] + }, + "net/minecraft/world/biome/BiomeGenBase$Height": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeGenBase" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$Height", + "inner_name": "Height", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "42" + } + ] + }, + "net/minecraft/init/Bootstrap$12": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$12", + "start": "262" + } + ] + }, + "net/minecraft/init/Bootstrap$13": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$13", + "start": "302" + } + ] + }, + "net/minecraft/init/Bootstrap$10": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$10", + "start": "203" + } + ] + }, + "net/minecraft/world/chunk/storage/RegionFile": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/world/chunk/storage/RegionFile$ChunkBuffer", + "inner_name": "ChunkBuffer", + "outer_class": "net/minecraft/world/chunk/storage/RegionFile", + "start": "232" + } + ] + }, + "net/minecraft/init/Bootstrap$11": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$11", + "start": "227" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiContainerCreative" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot", + "inner_name": "CreativeSlot", + "outer_class": "net/minecraft/client/gui/inventory/GuiContainerCreative", + "start": "724" + } + ] + }, + "net/minecraft/init/Bootstrap$14": { + "enclosingMethod": { + "desc": "()V", + "name": "func_151353_a", + "owner": "net/minecraft/init/Bootstrap" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/init/Bootstrap$14", + "start": "335" + } + ] + }, + "net/minecraft/world/biome/BiomeGenBase$TempCategory": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeGenBase" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/biome/BiomeGenBase$TempCategory", + "inner_name": "TempCategory", + "outer_class": "net/minecraft/world/biome/BiomeGenBase", + "start": "26" + } + ] + }, + "net/minecraft/client/gui/GuiSnooper$List": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiSnooper" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiSnooper$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiSnooper", + "start": "102" + } + ] + }, + "net/minecraft/inventory/ContainerEnchantment$1": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerEnchantment" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerEnchantment$1", + "start": "21" + } + ] + }, + "net/minecraft/util/Session$Type": { + "enclosingMethod": { + "owner": "net/minecraft/util/Session" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/util/Session$Type", + "inner_name": "Type", + "outer_class": "net/minecraft/util/Session", + "start": "54" + } + ] + }, + "net/minecraft/client/gui/GuiMerchant$MerchantButton": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiMerchant" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiMerchant$MerchantButton", + "inner_name": "MerchantButton", + "outer_class": "net/minecraft/client/gui/GuiMerchant", + "start": "191" + } + ] + }, + "net/minecraft/entity/player/InventoryPlayer$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/item/ItemStack;)Z", + "name": "func_70441_a", + "owner": "net/minecraft/entity/player/InventoryPlayer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/player/InventoryPlayer$1", + "start": "265" + } + ] + }, + "net/minecraft/inventory/ContainerEnchantment$2": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerEnchantment" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/inventory/ContainerEnchantment$2", + "start": "47" + } + ] + }, + "net/minecraft/entity/Entity$EnumEntitySize": { + "enclosingMethod": { + "owner": "net/minecraft/entity/Entity" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/Entity$EnumEntitySize", + "inner_name": "EnumEntitySize", + "outer_class": "net/minecraft/entity/Entity", + "start": "120" + } + ] + }, + "net/minecraft/client/renderer/texture/Stitcher": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/renderer/texture/Stitcher$Holder", + "inner_name": "Holder", + "outer_class": "net/minecraft/client/renderer/texture/Stitcher", + "start": "191" + }, + { + "access": "29", + "inner_class": "net/minecraft/client/renderer/texture/Stitcher$Slot", + "inner_name": "Slot", + "outer_class": "net/minecraft/client/renderer/texture/Stitcher", + "start": "282" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/layer/GenLayerEdge" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/world/gen/layer/GenLayerEdge$SwitchMode", + "inner_name": "SwitchMode", + "outer_class": "net/minecraft/world/gen/layer/GenLayerEdge" + } + ] + }, + "net/minecraft/server/management/PlayerManager$PlayerInstance": { + "enclosingMethod": { + "owner": "net/minecraft/server/management/PlayerManager" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/server/management/PlayerManager$PlayerInstance", + "inner_name": "PlayerInstance", + "outer_class": "net/minecraft/server/management/PlayerManager", + "start": "23" + } + ] + }, + "net/minecraft/client/util/JsonException$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/util/JsonException" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/client/util/JsonException$1" + } + ] + }, + "net/minecraft/enchantment/EnchantmentHelper$ModifierLiving": { + "enclosingMethod": { + "owner": "net/minecraft/enchantment/EnchantmentHelper" + }, + "innerClasses": [ + { + "access": "38", + "inner_class": "net/minecraft/enchantment/EnchantmentHelper$ModifierLiving", + "inner_name": "ModifierLiving", + "outer_class": "net/minecraft/enchantment/EnchantmentHelper", + "start": "156" + } + ] + }, + "net/minecraft/entity/Entity$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85029_a", + "owner": "net/minecraft/entity/Entity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/Entity$1", + "start": "1601" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$Stats": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats" + }, + "innerClasses": [ + { + "access": "420", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$Stats", + "inner_name": "Stats", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "249" + } + ] + }, + "net/minecraft/entity/Entity$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReportCategory;)V", + "name": "func_85029_a", + "owner": "net/minecraft/entity/Entity" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/Entity$2", + "start": "1608" + } + ] + }, + "net/minecraft/client/util/JsonException": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/util/JsonException$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/client/util/JsonException", + "start": "51" + }, + { + "access": "1000", + "inner_class": "net/minecraft/client/util/JsonException$1" + } + ] + }, + "net/minecraft/entity/boss/EntityWither": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/boss/EntityWither$1", + "start": "44" + } + ] + }, + "net/minecraft/block/BlockRailBase": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/block/BlockRailBase$Rail", + "inner_name": "Rail", + "outer_class": "net/minecraft/block/BlockRailBase", + "start": "44" + } + ] + }, + "net/minecraft/client/resources/data/IMetadataSerializer$Registration": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/data/IMetadataSerializer" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/resources/data/IMetadataSerializer$Registration", + "inner_name": "Registration", + "outer_class": "net/minecraft/client/resources/data/IMetadataSerializer" + } + ] + }, + "net/minecraft/client/stream/BroadcastController": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/BroadcastController$BroadcastState", + "inner_name": "BroadcastState", + "outer_class": "net/minecraft/client/stream/BroadcastController", + "start": "50" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/BroadcastController$SwitchBroadcastState", + "inner_name": "SwitchBroadcastState", + "outer_class": "net/minecraft/client/stream/BroadcastController" + }, + { + "access": "609", + "inner_class": "net/minecraft/client/stream/BroadcastController$BroadcastListener", + "inner_name": "BroadcastListener", + "outer_class": "net/minecraft/client/stream/BroadcastController" + } + ] + }, + "net/minecraft/client/stream/IStream": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/IStream$AuthFailureReason", + "inner_name": "AuthFailureReason", + "outer_class": "net/minecraft/client/stream/IStream", + "start": "11" + } + ] + }, + "net/minecraft/inventory/ContainerBrewingStand": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/inventory/ContainerBrewingStand$Potion", + "inner_name": "Potion", + "outer_class": "net/minecraft/inventory/ContainerBrewingStand", + "start": "131" + }, + { + "access": "20", + "inner_class": "net/minecraft/inventory/ContainerBrewingStand$Ingredient", + "inner_name": "Ingredient", + "outer_class": "net/minecraft/inventory/ContainerBrewingStand", + "start": "157" + } + ] + }, + "net/minecraft/client/gui/GuiKeyBindingList": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry", + "inner_name": "CategoryEntry", + "outer_class": "net/minecraft/client/gui/GuiKeyBindingList", + "start": "70" + }, + { + "access": "21", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$KeyEntry", + "inner_name": "KeyEntry", + "outer_class": "net/minecraft/client/gui/GuiKeyBindingList", + "start": "99" + }, + { + "access": "1000", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$1" + } + ] + }, + "net/minecraft/crash/CrashReport": { + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$1", + "start": "35" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$2", + "start": "42" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$3", + "start": "49" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$4", + "start": "56" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$5", + "start": "63" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$6", + "start": "78" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$7", + "start": "100" + }, + { + "inner_class": "net/minecraft/crash/CrashReport$8", + "start": "114" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor2", + "inner_name": "Corridor2", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1303" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor3", + "inner_name": "Corridor3", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1494" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor4", + "inner_name": "Corridor4", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1570" + } + ] + }, + "net/minecraft/entity/item/EntityPainting": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/item/EntityPainting$EnumArt", + "inner_name": "EnumArt", + "outer_class": "net/minecraft/entity/item/EntityPainting", + "start": "14" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor5", + "inner_name": "Corridor5", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1167" + } + ] + }, + "net/minecraft/network/play/server/S20PacketEntityProperties": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/network/play/server/S20PacketEntityProperties$Snapshot", + "inner_name": "Snapshot", + "outer_class": "net/minecraft/network/play/server/S20PacketEntityProperties", + "start": "94" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Well": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Well", + "inner_name": "Well", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "434" + } + ] + }, + "net/minecraft/client/gui/ServerListEntryNormal$1": { + "enclosingMethod": { + "desc": "(IIIIILnet/minecraft/client/renderer/Tessellator;IIZ)V", + "name": "func_148279_a", + "owner": "net/minecraft/client/gui/ServerListEntryNormal" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/ServerListEntryNormal$1", + "start": "66" + } + ] + }, + "net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiKeyBindingList" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/client/gui/GuiKeyBindingList$CategoryEntry", + "inner_name": "CategoryEntry", + "outer_class": "net/minecraft/client/gui/GuiKeyBindingList", + "start": "70" + } + ] + }, + "net/minecraft/client/gui/GuiOptionsRowList$Row": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiOptionsRowList" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/gui/GuiOptionsRowList$Row", + "inner_name": "Row", + "outer_class": "net/minecraft/client/gui/GuiOptionsRowList", + "start": "67" + } + ] + }, + "net/minecraft/block/BlockPortal": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/BlockPortal$Size", + "inner_name": "Size", + "outer_class": "net/minecraft/block/BlockPortal", + "start": "205" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStructure$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/world/World;IIII[Lnet/minecraft/block/Block;)V", + "name": "func_151538_a", + "owner": "net/minecraft/world/gen/structure/MapGenStructure" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$3", + "start": "66" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStructure$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/world/World;IIII[Lnet/minecraft/block/Block;)V", + "name": "func_151538_a", + "owner": "net/minecraft/world/gen/structure/MapGenStructure" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$2", + "start": "59" + } + ] + }, + "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer": { + "enclosingMethod": { + "owner": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier", + "start": "143" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenStructure$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/world/World;IIII[Lnet/minecraft/block/Block;)V", + "name": "func_151538_a", + "owner": "net/minecraft/world/gen/structure/MapGenStructure" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/world/gen/structure/MapGenStructure$1", + "start": "50" + } + ] + }, + "net/minecraft/client/gui/MapItemRenderer$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/MapItemRenderer" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/client/gui/MapItemRenderer$1" + } + ] + }, + "net/minecraft/network/rcon/RConThreadQuery$Auth": { + "enclosingMethod": { + "owner": "net/minecraft/network/rcon/RConThreadQuery" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/network/rcon/RConThreadQuery$Auth", + "inner_name": "Auth", + "outer_class": "net/minecraft/network/rcon/RConThreadQuery", + "start": "347" + } + ] + }, + "net/minecraft/world/World": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/World$1", + "start": "120" + }, + { + "inner_class": "net/minecraft/world/World$2", + "start": "491" + }, + { + "inner_class": "net/minecraft/world/World$3", + "start": "2575" + }, + { + "inner_class": "net/minecraft/world/World$4", + "start": "2582" + } + ] + }, + "net/minecraft/nbt/NBTTagCompound": { + "innerClasses": [ + { + "inner_class": "net/minecraft/nbt/NBTTagCompound$1", + "start": "268" + }, + { + "inner_class": "net/minecraft/nbt/NBTTagCompound$2", + "start": "274" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui$5": { + "enclosingMethod": { + "desc": "(Ljavax/swing/JTextArea;Ljavax/swing/JScrollPane;Ljava/lang/String;)V", + "name": "func_164247_a", + "owner": "net/minecraft/server/gui/MinecraftServerGui" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$5", + "start": "131" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "367" + } + ] + }, + "net/minecraft/client/Minecraft$SwitchMovingObjectType": { + "enclosingMethod": { + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/Minecraft$SwitchMovingObjectType", + "inner_name": "SwitchMovingObjectType", + "outer_class": "net/minecraft/client/Minecraft" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/server/dedicated/DedicatedServer;)V", + "name": "func_120016_a", + "owner": "net/minecraft/server/gui/MinecraftServerGui" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$1", + "start": "40" + } + ] + }, + "net/minecraft/entity/item/EntityPainting$EnumArt": { + "enclosingMethod": { + "owner": "net/minecraft/entity/item/EntityPainting" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/entity/item/EntityPainting$EnumArt", + "inner_name": "EnumArt", + "outer_class": "net/minecraft/entity/item/EntityPainting", + "start": "14" + } + ] + }, + "net/minecraft/item/ItemFishFood$FishType": { + "enclosingMethod": { + "owner": "net/minecraft/item/ItemFishFood" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/item/ItemFishFood$FishType", + "inner_name": "FishType", + "outer_class": "net/minecraft/item/ItemFishFood", + "start": "103" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui$2": { + "enclosingMethod": { + "desc": "()Ljavax/swing/JComponent;", + "name": "func_120018_d", + "owner": "net/minecraft/server/gui/MinecraftServerGui" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$2", + "start": "93" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui$3": { + "enclosingMethod": { + "owner": "net/minecraft/server/gui/MinecraftServerGui" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$3", + "start": "104" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui$4": { + "enclosingMethod": { + "desc": "()Ljavax/swing/JComponent;", + "name": "func_120018_d", + "owner": "net/minecraft/server/gui/MinecraftServerGui" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$4", + "start": "115" + } + ] + }, + "net/minecraft/world/biome/BiomeCache$Block": { + "enclosingMethod": { + "owner": "net/minecraft/world/biome/BiomeCache" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/biome/BiomeCache$Block", + "inner_name": "Block", + "outer_class": "net/minecraft/world/biome/BiomeCache", + "start": "31" + } + ] + }, + "net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/server/S14PacketEntity" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove", + "inner_name": "S15PacketEntityRelMove", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "61" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsGeneral": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsGeneral", + "inner_name": "StatsGeneral", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "149" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureManager$1", + "start": "84" + } + ] + }, + "net/minecraft/client/entity/AbstractClientPlayer$SwitchType": { + "enclosingMethod": { + "owner": "net/minecraft/client/entity/AbstractClientPlayer" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/entity/AbstractClientPlayer$SwitchType", + "inner_name": "SwitchType", + "outer_class": "net/minecraft/client/entity/AbstractClientPlayer" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats$StatsMobsList": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/achievement/GuiStats" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsMobsList", + "inner_name": "StatsMobsList", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "664" + } + ] + }, + "net/minecraft/client/util/JsonException$Entry": { + "enclosingMethod": { + "owner": "net/minecraft/client/util/JsonException" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/util/JsonException$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/client/util/JsonException", + "start": "51" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureMap": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$1", + "start": "170" + }, + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$2", + "start": "177" + }, + { + "inner_class": "net/minecraft/client/renderer/texture/TextureMap$3", + "start": "184" + } + ] + }, + "net/minecraft/server/dedicated/DedicatedServer$2": { + "enclosingMethod": { + "desc": "()Z", + "name": "func_71197_b", + "owner": "net/minecraft/server/dedicated/DedicatedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$2", + "start": "76" + } + ] + }, + "net/minecraft/client/gui/achievement/GuiStats": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsGeneral", + "inner_name": "StatsGeneral", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "149" + }, + { + "access": "420", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$Stats", + "inner_name": "Stats", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "249" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsItem", + "inner_name": "StatsItem", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "486" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsBlock", + "inner_name": "StatsBlock", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "599" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/achievement/GuiStats$StatsMobsList", + "inner_name": "StatsMobsList", + "outer_class": "net/minecraft/client/gui/achievement/GuiStats", + "start": "664" + } + ] + }, + "net/minecraft/server/dedicated/DedicatedServer$3": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/dedicated/DedicatedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$3", + "start": "249" + } + ] + }, + "net/minecraft/server/dedicated/DedicatedServer$4": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71230_b", + "owner": "net/minecraft/server/dedicated/DedicatedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$4", + "start": "258" + } + ] + }, + "net/minecraft/client/multiplayer/WorldClient": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$1", + "start": "291" + }, + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$2", + "start": "298" + }, + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$3", + "start": "305" + }, + { + "inner_class": "net/minecraft/client/multiplayer/WorldClient$4", + "start": "312" + } + ] + }, + "net/minecraft/client/stream/IngestServerTester$IngestTestState": { + "enclosingMethod": { + "owner": "net/minecraft/client/stream/IngestServerTester" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/IngestServerTester$IngestTestState", + "inner_name": "IngestTestState", + "outer_class": "net/minecraft/client/stream/IngestServerTester", + "start": "16" + } + ] + }, + "net/minecraft/nbt/JsonToNBT$Compound": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/JsonToNBT" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/nbt/JsonToNBT$Compound", + "inner_name": "Compound", + "outer_class": "net/minecraft/nbt/JsonToNBT", + "start": "281" + } + ] + }, + "net/minecraft/nbt/NBTSizeTracker": { + "innerClasses": [ + { + "inner_class": "net/minecraft/nbt/NBTSizeTracker$1", + "start": "8" + } + ] + }, + "net/minecraft/server/dedicated/DedicatedServer$1": { + "enclosingMethod": { + "owner": "net/minecraft/server/dedicated/DedicatedServer" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/server/dedicated/DedicatedServer$1", + "start": "63" + } + ] + }, + "net/minecraft/crash/CrashReport$3": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$3", + "start": "49" + } + ] + }, + "net/minecraft/entity/EntityList": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/EntityList$EntityEggInfo", + "inner_name": "EntityEggInfo", + "outer_class": "net/minecraft/entity/EntityList" + } + ] + }, + "net/minecraft/entity/ai/EntityAIAvoidEntity": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityAIAvoidEntity$1", + "start": "17" + } + ] + }, + "net/minecraft/crash/CrashReport$4": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$4", + "start": "56" + } + ] + }, + "net/minecraft/crash/CrashReport$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$1", + "start": "35" + } + ] + }, + "net/minecraft/crash/CrashReport$2": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$2", + "start": "42" + } + ] + }, + "net/minecraft/client/audio/SoundManager$2": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundManager$2", + "start": "360" + }, + { + "inner_class": "net/minecraft/client/audio/SoundManager$2$1", + "start": "364" + } + ] + }, + "net/minecraft/client/audio/SoundManager$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_148608_i", + "owner": "net/minecraft/client/audio/SoundManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundManager$1", + "start": "85" + } + ] + }, + "net/minecraft/world/gen/layer/GenLayerEdge$Mode": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/layer/GenLayerEdge" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/gen/layer/GenLayerEdge$Mode", + "inner_name": "Mode", + "outer_class": "net/minecraft/world/gen/layer/GenLayerEdge", + "start": "7" + } + ] + }, + "net/minecraft/command/CommandSpreadPlayers": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/command/CommandSpreadPlayers$Position", + "inner_name": "Position", + "outer_class": "net/minecraft/command/CommandSpreadPlayers", + "start": "238" + } + ] + }, + "net/minecraft/client/audio/SoundHandler$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundHandler" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundHandler$1", + "start": "38" + } + ] + }, + "net/minecraft/village/Village": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/village/Village$VillageAgressor", + "inner_name": "VillageAgressor", + "outer_class": "net/minecraft/village/Village" + } + ] + }, + "net/minecraft/client/audio/SoundHandler$2": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/audio/SoundList;)V", + "name": "func_147693_a", + "owner": "net/minecraft/client/audio/SoundHandler" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundHandler$2", + "start": "125" + } + ] + }, + "net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/stream/GuiStreamUnavailable" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable$SwitchReason", + "inner_name": "SwitchReason", + "outer_class": "net/minecraft/client/gui/stream/GuiStreamUnavailable" + } + ] + }, + "net/minecraft/stats/StatBase": { + "innerClasses": [ + { + "inner_class": "net/minecraft/stats/StatBase$1", + "start": "62" + }, + { + "inner_class": "net/minecraft/stats/StatBase$2", + "start": "71" + }, + { + "inner_class": "net/minecraft/stats/StatBase$3", + "start": "93" + }, + { + "inner_class": "net/minecraft/stats/StatBase$4", + "start": "109" + } + ] + }, + "net/minecraft/client/network/LanServerDetector$ThreadLanServerFind": { + "enclosingMethod": { + "owner": "net/minecraft/client/network/LanServerDetector" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/network/LanServerDetector$ThreadLanServerFind", + "inner_name": "ThreadLanServerFind", + "outer_class": "net/minecraft/client/network/LanServerDetector", + "start": "107" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$1": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$1" + } + ] + }, + "net/minecraft/entity/DataWatcher": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/entity/DataWatcher$WatchableObject", + "inner_name": "WatchableObject", + "outer_class": "net/minecraft/entity/DataWatcher", + "start": "323" + } + ] + }, + "net/minecraft/inventory/ContainerBeacon$BeaconSlot": { + "enclosingMethod": { + "owner": "net/minecraft/inventory/ContainerBeacon" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/inventory/ContainerBeacon$BeaconSlot", + "inner_name": "BeaconSlot", + "outer_class": "net/minecraft/inventory/ContainerBeacon", + "start": "123" + } + ] + }, + "net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData": { + "enclosingMethod": { + "owner": "net/minecraft/world/chunk/storage/ChunkLoader" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/chunk/storage/ChunkLoader$AnvilConverterData", + "inner_name": "AnvilConverterData", + "outer_class": "net/minecraft/world/chunk/storage/ChunkLoader" + } + ] + }, + "net/minecraft/crash/CrashReport$7": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$7", + "start": "100" + } + ] + }, + "net/minecraft/network/NetworkStatistics$1": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetworkStatistics" + }, + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/network/NetworkStatistics$1" + } + ] + }, + "net/minecraft/crash/CrashReport$8": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$8", + "start": "114" + } + ] + }, + "net/minecraft/crash/CrashReport$5": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$5", + "start": "63" + } + ] + }, + "net/minecraft/entity/ai/EntityMinecartMobSpawner": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityMinecartMobSpawner$1", + "start": "16" + } + ] + }, + "net/minecraft/crash/CrashReport$6": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71504_g", + "owner": "net/minecraft/crash/CrashReport" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReport$6", + "start": "78" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Village": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Village", + "inner_name": "Village", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "241" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenScatteredFeature": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenScatteredFeature$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenScatteredFeature" + } + ] + }, + "net/minecraft/client/settings/GameSettings": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/settings/GameSettings$1", + "start": "35" + }, + { + "access": "4029", + "inner_class": "net/minecraft/client/settings/GameSettings$Options", + "inner_name": "Options", + "outer_class": "net/minecraft/client/settings/GameSettings", + "start": "76" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/settings/GameSettings$SwitchOptions", + "inner_name": "SwitchOptions", + "outer_class": "net/minecraft/client/settings/GameSettings" + } + ] + }, + "net/minecraft/network/NetworkSystem": { + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkSystem$1", + "start": "51" + }, + { + "inner_class": "net/minecraft/network/NetworkSystem$2", + "start": "93" + }, + { + "inner_class": "net/minecraft/network/NetworkSystem$3", + "start": "140" + }, + { + "inner_class": "net/minecraft/network/NetworkSystem$4", + "start": "154" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces": { + "innerClasses": [ + { + "access": "428", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$Feature", + "inner_name": "Feature", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "55" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid", + "inner_name": "DesertPyramid", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "129" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$JunglePyramid", + "inner_name": "JunglePyramid", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "394" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$SwampHut", + "inner_name": "SwampHut", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "638" + }, + { + "access": "1000", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$1" + } + ] + }, + "net/minecraft/client/renderer/texture/TextureManager$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z", + "name": "func_110579_a", + "owner": "net/minecraft/client/renderer/texture/TextureManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/texture/TextureManager$1", + "start": "84" + } + ] + }, + "net/minecraft/network/play/server/S14PacketEntity": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S17PacketEntityLookMove", + "inner_name": "S17PacketEntityLookMove", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "19" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S15PacketEntityRelMove", + "inner_name": "S15PacketEntityRelMove", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "61" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S14PacketEntity$S16PacketEntityLook", + "inner_name": "S16PacketEntityLook", + "outer_class": "net/minecraft/network/play/server/S14PacketEntity", + "start": "95" + } + ] + }, + "net/minecraft/crash/CrashReportCategory": { + "innerClasses": [ + { + "inner_class": "net/minecraft/crash/CrashReportCategory$1", + "start": "154" + }, + { + "inner_class": "net/minecraft/crash/CrashReportCategory$2", + "start": "165" + }, + { + "inner_class": "net/minecraft/crash/CrashReportCategory$3", + "start": "176" + }, + { + "access": "28", + "inner_class": "net/minecraft/crash/CrashReportCategory$Entry", + "inner_name": "Entry", + "outer_class": "net/minecraft/crash/CrashReportCategory", + "start": "202" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Corridor", + "inner_name": "Corridor", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1400" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Throne", + "inner_name": "Throne", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "787" + } + ] + }, + "net/minecraft/network/NetworkManager": { + "innerClasses": [ + { + "inner_class": "net/minecraft/network/NetworkManager$1", + "start": "140" + }, + { + "inner_class": "net/minecraft/network/NetworkManager$2", + "start": "207" + }, + { + "inner_class": "net/minecraft/network/NetworkManager$3", + "start": "243" + }, + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkManager$InboundHandlerTuplePacketListener", + "inner_name": "InboundHandlerTuplePacketListener", + "outer_class": "net/minecraft/network/NetworkManager", + "start": "279" + } + ] + }, + "net/minecraft/client/renderer/ThreadDownloadImageData": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/ThreadDownloadImageData$1", + "start": "103" + } + ] + }, + "net/minecraft/client/network/NetHandlerHandshakeMemory": { + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/network/NetHandlerHandshakeMemory$SwitchEnumConnectionState", + "inner_name": "SwitchEnumConnectionState", + "outer_class": "net/minecraft/client/network/NetHandlerHandshakeMemory" + } + ] + }, + "net/minecraft/client/audio/SoundList": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/client/audio/SoundList$SoundEntry", + "inner_name": "SoundEntry", + "outer_class": "net/minecraft/client/audio/SoundList", + "start": "41" + } + ] + }, + "net/minecraft/client/network/NetHandlerPlayClient$1": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/network/play/server/S3FPacketCustomPayload;)V", + "name": "func_147240_a", + "owner": "net/minecraft/client/network/NetHandlerPlayClient" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/NetHandlerPlayClient$1", + "start": "1080" + } + ] + }, + "net/minecraft/client/gui/GuiLanguage$List": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiLanguage" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiLanguage$List", + "inner_name": "List", + "outer_class": "net/minecraft/client/gui/GuiLanguage", + "start": "100" + } + ] + }, + "net/minecraft/client/renderer/entity/RenderItem": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$1", + "start": "405" + }, + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$2", + "start": "412" + }, + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$3", + "start": "419" + }, + { + "inner_class": "net/minecraft/client/renderer/entity/RenderItem$4", + "start": "426" + } + ] + }, + "net/minecraft/client/gui/GuiFlatPresets": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/GuiFlatPresets$ListSlot", + "inner_name": "ListSlot", + "outer_class": "net/minecraft/client/gui/GuiFlatPresets", + "start": "211" + }, + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiFlatPresets$LayerItem", + "inner_name": "LayerItem", + "outer_class": "net/minecraft/client/gui/GuiFlatPresets" + } + ] + }, + "net/minecraft/client/gui/stream/GuiIngestServers$ServerList": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/stream/GuiIngestServers" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/stream/GuiIngestServers$ServerList", + "inner_name": "ServerList", + "outer_class": "net/minecraft/client/gui/stream/GuiIngestServers", + "start": "70" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing2", + "inner_name": "Crossing2", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "1234" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Crossing", + "inner_name": "Crossing", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1387" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Crossing3", + "inner_name": "Crossing3", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "541" + } + ] + }, + "net/minecraft/client/Minecraft$7": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$7", + "start": "1894" + } + ] + }, + "net/minecraft/client/Minecraft$8": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$8", + "start": "1901" + } + ] + }, + "net/minecraft/block/BlockJukebox$TileEntityJukebox": { + "enclosingMethod": { + "owner": "net/minecraft/block/BlockJukebox" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/block/BlockJukebox$TileEntityJukebox", + "inner_name": "TileEntityJukebox", + "outer_class": "net/minecraft/block/BlockJukebox", + "start": "20" + } + ] + }, + "net/minecraft/client/Minecraft$9": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$9", + "start": "1908" + } + ] + }, + "net/minecraft/client/network/OldServerPinger": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/network/OldServerPinger$1", + "start": "53" + }, + { + "inner_class": "net/minecraft/client/network/OldServerPinger$2", + "start": "157" + } + ] + }, + "net/minecraft/util/HttpUtil$1": { + "enclosingMethod": { + "desc": "(Ljava/io/File;Ljava/lang/String;Lnet/minecraft/util/HttpUtil$DownloadListener;Ljava/util/Map;ILnet/minecraft/util/IProgressUpdate;Ljava/net/Proxy;)V", + "name": "func_151223_a", + "owner": "net/minecraft/util/HttpUtil" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/util/HttpUtil$1", + "start": "97" + } + ] + }, + "net/minecraft/client/stream/IngestServerTester": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/stream/IngestServerTester$IngestTestState", + "inner_name": "IngestTestState", + "outer_class": "net/minecraft/client/stream/IngestServerTester", + "start": "16" + }, + { + "access": "609", + "inner_class": "net/minecraft/client/stream/IngestServerTester$IngestTestListener", + "inner_name": "IngestTestListener", + "outer_class": "net/minecraft/client/stream/IngestServerTester" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/stream/IngestServerTester$SwitchStatType", + "inner_name": "SwitchStatType", + "outer_class": "net/minecraft/client/stream/IngestServerTester" + } + ] + }, + "net/minecraft/entity/passive/EntitySheep": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/passive/EntitySheep$1", + "start": "31" + } + ] + }, + "net/minecraft/server/integrated/IntegratedServer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/integrated/IntegratedServer$1", + "start": "170" + }, + { + "inner_class": "net/minecraft/server/integrated/IntegratedServer$2", + "start": "177" + } + ] + }, + "net/minecraft/client/Minecraft$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71389_H", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$1", + "start": "245" + } + ] + }, + "net/minecraft/client/Minecraft$2": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71384_a", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$2", + "start": "409" + } + ] + }, + "net/minecraft/client/settings/GameSettings$Options": { + "enclosingMethod": { + "owner": "net/minecraft/client/settings/GameSettings" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/settings/GameSettings$Options", + "inner_name": "Options", + "outer_class": "net/minecraft/client/settings/GameSettings", + "start": "76" + }, + { + "access": "4000", + "inner_class": "net/minecraft/client/settings/GameSettings$Options$1", + "start": "114" + } + ] + }, + "net/minecraft/client/Minecraft$3": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71407_l", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$3", + "start": "1332" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$StairsStraight", + "inner_name": "StairsStraight", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "795" + } + ] + }, + "net/minecraft/client/Minecraft$4": { + "enclosingMethod": { + "desc": "()V", + "name": "func_71407_l", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$4", + "start": "1347" + } + ] + }, + "net/minecraft/client/Minecraft$5": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$5", + "start": "1880" + } + ] + }, + "net/minecraft/client/Minecraft$6": { + "enclosingMethod": { + "desc": "(Lnet/minecraft/crash/CrashReport;)Lnet/minecraft/crash/CrashReport;", + "name": "func_71396_d", + "owner": "net/minecraft/client/Minecraft" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/Minecraft$6", + "start": "1887" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "704" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "55" + }, + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Village", + "inner_name": "Village", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "241" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Well", + "inner_name": "Well", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "434" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "515" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Path", + "inner_name": "Path", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "550" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House4Garden", + "inner_name": "House4Garden", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "676" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Church", + "inner_name": "Church", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "813" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House1", + "inner_name": "House1", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "952" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$WoodHut", + "inner_name": "WoodHut", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1097" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Hall", + "inner_name": "Hall", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1216" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House3", + "inner_name": "House3", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1356" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$House2", + "inner_name": "House2", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1540" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Field2", + "inner_name": "Field2", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1682" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Field1", + "inner_name": "Field1", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1788" + }, + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Torch", + "inner_name": "Torch", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1897" + }, + { + "access": "429", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Road", + "inner_name": "Road", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces" + } + ] + }, + "net/minecraft/client/audio/SoundHandler": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundHandler$1", + "start": "38" + }, + { + "inner_class": "net/minecraft/client/audio/SoundHandler$2", + "start": "125" + }, + { + "access": "1018", + "inner_class": "net/minecraft/client/audio/SoundHandler$SwitchType", + "inner_name": "SwitchType", + "outer_class": "net/minecraft/client/audio/SoundHandler" + } + ] + }, + "net/minecraft/entity/ai/EntityAITasks": { + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/entity/ai/EntityAITasks$EntityAITaskEntry", + "inner_name": "EntityAITaskEntry", + "outer_class": "net/minecraft/entity/ai/EntityAITasks" + } + ] + }, + "net/minecraft/network/ServerStatusResponse": { + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$PlayerCountData", + "inner_name": "PlayerCountData", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "63" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$MinecraftProtocolVersionIdentifier", + "inner_name": "MinecraftProtocolVersionIdentifier", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "136" + }, + { + "access": "29", + "inner_class": "net/minecraft/network/ServerStatusResponse$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/network/ServerStatusResponse", + "start": "160" + } + ] + }, + "net/minecraft/world/storage/WorldInfo": { + "innerClasses": [ + { + "inner_class": "net/minecraft/world/storage/WorldInfo$1", + "start": "377" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$2", + "start": "384" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$3", + "start": "391" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$4", + "start": "398" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$5", + "start": "405" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$6", + "start": "412" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$7", + "start": "419" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$8", + "start": "441" + }, + { + "inner_class": "net/minecraft/world/storage/WorldInfo$9", + "start": "448" + } + ] + }, + "net/minecraft/client/gui/GuiScreenBook": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/GuiScreenBook$NextPageButton", + "inner_name": "NextPageButton", + "outer_class": "net/minecraft/client/gui/GuiScreenBook", + "start": "390" + } + ] + }, + "net/minecraft/util/HttpUtil": { + "innerClasses": [ + { + "inner_class": "net/minecraft/util/HttpUtil$1", + "start": "97" + }, + { + "access": "609", + "inner_class": "net/minecraft/util/HttpUtil$DownloadListener", + "inner_name": "DownloadListener", + "outer_class": "net/minecraft/util/HttpUtil" + } + ] + }, + "net/minecraft/server/gui/MinecraftServerGui": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$1", + "start": "40" + }, + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$2", + "start": "93" + }, + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$3", + "start": "104" + }, + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$4", + "start": "115" + }, + { + "inner_class": "net/minecraft/server/gui/MinecraftServerGui$5", + "start": "131" + } + ] + }, + "net/minecraft/util/ChatStyle": { + "innerClasses": [ + { + "inner_class": "net/minecraft/util/ChatStyle$1", + "start": "193" + }, + { + "access": "29", + "inner_class": "net/minecraft/util/ChatStyle$Serializer", + "inner_name": "Serializer", + "outer_class": "net/minecraft/util/ChatStyle", + "start": "246" + } + ] + }, + "net/minecraft/world/WorldServer": { + "innerClasses": [ + { + "access": "1000", + "inner_class": "net/minecraft/world/WorldServer$1" + }, + { + "access": "28", + "inner_class": "net/minecraft/world/WorldServer$ServerBlockEventList", + "inner_name": "ServerBlockEventList", + "outer_class": "net/minecraft/world/WorldServer" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$PieceWeight", + "inner_name": "PieceWeight", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "55" + } + ] + }, + "net/minecraft/client/audio/SoundHandler$SwitchType": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundHandler" + }, + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/audio/SoundHandler$SwitchType", + "inner_name": "SwitchType", + "outer_class": "net/minecraft/client/audio/SoundHandler" + } + ] + }, + "net/minecraft/item/Item": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/item/Item$ToolMaterial", + "inner_name": "ToolMaterial", + "outer_class": "net/minecraft/item/Item", + "start": "71" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Library": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Library", + "inner_name": "Library", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "1211" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiBeacon$PowerButton": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiBeacon" + }, + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$PowerButton", + "inner_name": "PowerButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "241" + } + ] + }, + "net/minecraft/scoreboard/Score$1": { + "enclosingMethod": { + "owner": "net/minecraft/scoreboard/Score" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/scoreboard/Score$1", + "start": "9" + } + ] + }, + "net/minecraft/client/resources/data/IMetadataSerializer": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/client/resources/data/IMetadataSerializer$Registration", + "inner_name": "Registration", + "outer_class": "net/minecraft/client/resources/data/IMetadataSerializer" + }, + { + "access": "1000", + "inner_class": "net/minecraft/client/resources/data/IMetadataSerializer$1" + } + ] + }, + "net/minecraft/network/play/client/C02PacketUseEntity": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/network/play/client/C02PacketUseEntity$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/network/play/client/C02PacketUseEntity", + "start": "11" + } + ] + }, + "net/minecraft/entity/monster/IMob": { + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/monster/IMob$1", + "start": "16" + } + ] + }, + "net/minecraft/server/MinecraftServer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/MinecraftServer$1", + "start": "139" + }, + { + "inner_class": "net/minecraft/server/MinecraftServer$2", + "start": "616" + }, + { + "inner_class": "net/minecraft/server/MinecraftServer$3", + "start": "628" + }, + { + "inner_class": "net/minecraft/server/MinecraftServer$4", + "start": "713" + }, + { + "inner_class": "net/minecraft/server/MinecraftServer$5", + "start": "721" + }, + { + "inner_class": "net/minecraft/server/MinecraftServer$6", + "start": "737" + } + ] + }, + "net/minecraft/client/gui/GuiListExtended$IGuiListEntry": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/GuiListExtended" + }, + "innerClasses": [ + { + "access": "609", + "inner_class": "net/minecraft/client/gui/GuiListExtended$IGuiListEntry", + "inner_name": "IGuiListEntry", + "outer_class": "net/minecraft/client/gui/GuiListExtended" + } + ] + }, + "net/minecraft/client/audio/SoundManager$2$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/audio/SoundManager$2" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/audio/SoundManager$2$1", + "start": "364" + } + ] + }, + "net/minecraft/network/NetworkStatistics$Tracker": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetworkStatistics" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/network/NetworkStatistics$Tracker", + "inner_name": "Tracker", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "86" + } + ] + }, + "net/minecraft/profiler/PlayerUsageSnooper": { + "innerClasses": [ + { + "inner_class": "net/minecraft/profiler/PlayerUsageSnooper$1", + "start": "48" + } + ] + }, + "net/minecraft/client/renderer/RenderGlobal": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/renderer/RenderGlobal$1", + "start": "1532" + } + ] + }, + "net/minecraft/block/BlockRedstoneTorch": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/block/BlockRedstoneTorch$Toggle", + "inner_name": "Toggle", + "outer_class": "net/minecraft/block/BlockRedstoneTorch" + } + ] + }, + "net/minecraft/entity/monster/IMob$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/monster/IMob" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/monster/IMob$1", + "start": "16" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiContainerCreative": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative", + "inner_name": "ContainerCreative", + "outer_class": "net/minecraft/client/gui/inventory/GuiContainerCreative", + "start": "79" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiContainerCreative$CreativeSlot", + "inner_name": "CreativeSlot", + "outer_class": "net/minecraft/client/gui/inventory/GuiContainerCreative", + "start": "724" + } + ] + }, + "net/minecraft/nbt/JsonToNBT$Any": { + "enclosingMethod": { + "owner": "net/minecraft/nbt/JsonToNBT" + }, + "innerClasses": [ + { + "access": "428", + "inner_class": "net/minecraft/nbt/JsonToNBT$Any", + "inner_name": "Any", + "outer_class": "net/minecraft/nbt/JsonToNBT" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiBeacon": { + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$Button", + "inner_name": "Button", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "193" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$PowerButton", + "inner_name": "PowerButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "241" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$ConfirmButton", + "inner_name": "ConfirmButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "260" + }, + { + "access": "20", + "inner_class": "net/minecraft/client/gui/inventory/GuiBeacon$CancelButton", + "inner_name": "CancelButton", + "outer_class": "net/minecraft/client/gui/inventory/GuiBeacon", + "start": "272" + } + ] + }, + "net/minecraft/block/Block$2": { + "enclosingMethod": { + "owner": "net/minecraft/block/Block" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/block/Block$2", + "start": "169" + } + ] + }, + "net/minecraft/block/Block$1": { + "enclosingMethod": { + "owner": "net/minecraft/block/Block" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/block/Block$1", + "start": "155" + } + ] + }, + "net/minecraft/block/Block$3": { + "enclosingMethod": { + "owner": "net/minecraft/block/Block" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/block/Block$3", + "start": "175" + } + ] + }, + "net/minecraft/item/crafting/CraftingManager$1": { + "enclosingMethod": { + "owner": "net/minecraft/item/crafting/CraftingManager" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/item/crafting/CraftingManager$1", + "start": "727" + } + ] + }, + "net/minecraft/server/network/NetHandlerLoginServer$LoginState": { + "enclosingMethod": { + "owner": "net/minecraft/server/network/NetHandlerLoginServer" + }, + "innerClasses": [ + { + "access": "4028", + "inner_class": "net/minecraft/server/network/NetHandlerLoginServer$LoginState", + "inner_name": "LoginState", + "outer_class": "net/minecraft/server/network/NetHandlerLoginServer", + "start": "176" + } + ] + }, + "net/minecraft/entity/ai/EntityAINearestAttackableTarget$1": { + "enclosingMethod": { + "owner": "net/minecraft/entity/ai/EntityAINearestAttackableTarget" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/entity/ai/EntityAINearestAttackableTarget$1", + "start": "32" + } + ] + }, + "net/minecraft/world/storage/MapData$MapInfo": { + "enclosingMethod": { + "owner": "net/minecraft/world/storage/MapData" + }, + "innerClasses": [ + { + "access": "21", + "inner_class": "net/minecraft/world/storage/MapData$MapInfo", + "inner_name": "MapInfo", + "outer_class": "net/minecraft/world/storage/MapData", + "start": "51" + } + ] + }, + "net/minecraft/network/play/client/C02PacketUseEntity$Action": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/client/C02PacketUseEntity" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/network/play/client/C02PacketUseEntity$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/network/play/client/C02PacketUseEntity", + "start": "11" + } + ] + }, + "net/minecraft/block/BlockRedstoneTorch$Toggle": { + "enclosingMethod": { + "owner": "net/minecraft/block/BlockRedstoneTorch" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/block/BlockRedstoneTorch$Toggle", + "inner_name": "Toggle", + "outer_class": "net/minecraft/block/BlockRedstoneTorch" + } + ] + }, + "net/minecraft/client/resources/ResourcePackRepository$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/resources/ResourcePackRepository" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$1", + "start": "32" + } + ] + }, + "net/minecraft/client/resources/ResourcePackRepository$2": { + "enclosingMethod": { + "desc": "(Ljava/lang/String;Ljava/io/File;)V", + "name": "func_148528_a", + "owner": "net/minecraft/client/resources/ResourcePackRepository" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/resources/ResourcePackRepository$2", + "start": "156" + } + ] + }, + "net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative": { + "enclosingMethod": { + "owner": "net/minecraft/client/gui/inventory/GuiContainerCreative" + }, + "innerClasses": [ + { + "access": "28", + "inner_class": "net/minecraft/client/gui/inventory/GuiContainerCreative$ContainerCreative", + "inner_name": "ContainerCreative", + "outer_class": "net/minecraft/client/gui/inventory/GuiContainerCreative", + "start": "79" + } + ] + }, + "net/minecraft/item/ItemMinecart": { + "innerClasses": [ + { + "inner_class": "net/minecraft/item/ItemMinecart$1", + "start": "16" + } + ] + }, + "net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/client/C03PacketPlayer" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/client/C03PacketPlayer$C06PacketPlayerPosLook", + "inner_name": "C06PacketPlayerPosLook", + "outer_class": "net/minecraft/network/play/client/C03PacketPlayer", + "start": "20" + } + ] + }, + "net/minecraft/network/rcon/RConThreadQuery": { + "innerClasses": [ + { + "access": "20", + "inner_class": "net/minecraft/network/rcon/RConThreadQuery$Auth", + "inner_name": "Auth", + "outer_class": "net/minecraft/network/rcon/RConThreadQuery", + "start": "347" + } + ] + }, + "net/minecraft/client/main/Main$2": { + "enclosingMethod": { + "owner": "net/minecraft/client/main/Main" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/main/Main$2", + "start": "103" + } + ] + }, + "net/minecraft/client/entity/AbstractClientPlayer": { + "innerClasses": [ + { + "access": "1018", + "inner_class": "net/minecraft/client/entity/AbstractClientPlayer$SwitchType", + "inner_name": "SwitchType", + "outer_class": "net/minecraft/client/entity/AbstractClientPlayer" + } + ] + }, + "net/minecraft/client/main/Main$1": { + "enclosingMethod": { + "owner": "net/minecraft/client/main/Main" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/main/Main$1", + "start": "20" + }, + { + "inner_class": "net/minecraft/client/main/Main$1$1", + "start": "24" + } + ] + }, + "net/minecraft/client/main/Main$3": { + "enclosingMethod": { + "desc": "([Ljava/lang/String;)V", + "name": "main", + "owner": "net/minecraft/client/main/Main" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/main/Main$3", + "start": "140" + } + ] + }, + "net/minecraft/network/NetworkStatistics$PacketStat": { + "enclosingMethod": { + "owner": "net/minecraft/network/NetworkStatistics" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/NetworkStatistics$PacketStat", + "inner_name": "PacketStat", + "outer_class": "net/minecraft/network/NetworkStatistics", + "start": "209" + } + ] + }, + "net/minecraft/world/WorldSettings": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/world/WorldSettings$GameType", + "inner_name": "GameType", + "outer_class": "net/minecraft/world/WorldSettings", + "start": "8" + } + ] + }, + "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces$DesertPyramid", + "inner_name": "DesertPyramid", + "outer_class": "net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces", + "start": "129" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Field1": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Field1", + "inner_name": "Field1", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1788" + } + ] + }, + "net/minecraft/block/material/Material$1": { + "enclosingMethod": { + "owner": "net/minecraft/block/material/Material" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/block/material/Material$1", + "start": "39" + } + ] + }, + "net/minecraft/world/gen/structure/StructureVillagePieces$Field2": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureVillagePieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureVillagePieces$Field2", + "inner_name": "Field2", + "outer_class": "net/minecraft/world/gen/structure/StructureVillagePieces", + "start": "1682" + } + ] + }, + "net/minecraft/server/management/PreYggdrasilConverter": { + "innerClasses": [ + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$1", + "start": "51" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$2", + "start": "85" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$3", + "start": "170" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$4", + "start": "212" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$5", + "start": "255" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$6", + "start": "307" + }, + { + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$7", + "start": "422" + }, + { + "access": "28", + "inner_class": "net/minecraft/server/management/PreYggdrasilConverter$ConversionError", + "inner_name": "ConversionError", + "outer_class": "net/minecraft/server/management/PreYggdrasilConverter" + } + ] + }, + "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureNetherBridgePieces" + }, + "innerClasses": [ + { + "access": "428", + "inner_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces$Piece", + "inner_name": "Piece", + "outer_class": "net/minecraft/world/gen/structure/StructureNetherBridgePieces", + "start": "148" + } + ] + }, + "net/minecraft/network/play/server/S21PacketChunkData$Extracted": { + "enclosingMethod": { + "owner": "net/minecraft/network/play/server/S21PacketChunkData" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/network/play/server/S21PacketChunkData$Extracted", + "inner_name": "Extracted", + "outer_class": "net/minecraft/network/play/server/S21PacketChunkData" + } + ] + }, + "net/minecraft/client/multiplayer/ServerData$ServerResourceMode": { + "enclosingMethod": { + "owner": "net/minecraft/client/multiplayer/ServerData" + }, + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/client/multiplayer/ServerData$ServerResourceMode", + "inner_name": "ServerResourceMode", + "outer_class": "net/minecraft/client/multiplayer/ServerData", + "start": "99" + } + ] + }, + "net/minecraft/client/gui/GuiOptions$1": { + "enclosingMethod": { + "desc": "()V", + "name": "func_73866_w_", + "owner": "net/minecraft/client/gui/GuiOptions" + }, + "innerClasses": [ + { + "inner_class": "net/minecraft/client/gui/GuiOptions$1", + "start": "67" + } + ] + }, + "net/minecraft/event/HoverEvent": { + "innerClasses": [ + { + "access": "4029", + "inner_class": "net/minecraft/event/HoverEvent$Action", + "inner_name": "Action", + "outer_class": "net/minecraft/event/HoverEvent", + "start": "52" + } + ] + }, + "net/minecraft/client/particle/EffectRenderer": { + "innerClasses": [ + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$1", + "start": "70" + }, + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$2", + "start": "77" + }, + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$3", + "start": "150" + }, + { + "inner_class": "net/minecraft/client/particle/EffectRenderer$4", + "start": "157" + } + ] + }, + "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/StructureStrongholdPieces" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces$Stairs", + "inner_name": "Stairs", + "outer_class": "net/minecraft/world/gen/structure/StructureStrongholdPieces", + "start": "479" + } + ] + }, + "net/minecraft/world/gen/structure/MapGenNetherBridge$Start": { + "enclosingMethod": { + "owner": "net/minecraft/world/gen/structure/MapGenNetherBridge" + }, + "innerClasses": [ + { + "access": "29", + "inner_class": "net/minecraft/world/gen/structure/MapGenNetherBridge$Start", + "inner_name": "Start", + "outer_class": "net/minecraft/world/gen/structure/MapGenNetherBridge" + } + ] + } +} \ No newline at end of file diff --git a/build/tmp/jar/MANIFEST.MF b/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..03e27d2 --- /dev/null +++ b/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +MixinConfigs: mixins.cinder_loe.json +FMLCorePluginContainsFMLMod: true +TweakClass: org.spongepowered.asm.launch.MixinTweaker +ForceLoadAsMod: true +FMLCorePlugin: com.zivilon.cinder_loe.coremod.CoreMod + diff --git a/build/tmp/mixins/mixins.cinder_loe.refmap.json b/build/tmp/mixins/mixins.cinder_loe.refmap.json new file mode 100644 index 0000000..456f831 --- /dev/null +++ b/build/tmp/mixins/mixins.cinder_loe.refmap.json @@ -0,0 +1,4 @@ +{ + "mappings": {}, + "data": {} +} \ No newline at end of file diff --git a/build/tmp/mixins/mixins.srg b/build/tmp/mixins/mixins.srg new file mode 100644 index 0000000..8739e47 --- /dev/null +++ b/build/tmp/mixins/mixins.srg @@ -0,0 +1,28 @@ +FD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/renderPassModel com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/field_77046_h +FD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/mainModel com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/field_77045_g +FD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/RES_ITEM_GLINT com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/field_110814_a +FD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/logger com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/field_147923_a +FD: com/zivilon/cinder_loe/mixins/MixinItemBlock/field_150939_a com/zivilon/cinder_loe/mixins/MixinItemBlock/field_150939_a +FD: com/zivilon/cinder_loe/mixins/MixinRenderItem/RES_ITEM_GLINT com/zivilon/cinder_loe/mixins/MixinRenderItem/field_110798_h +FD: com/zivilon/cinder_loe/mixins/MixinRenderItem/random com/zivilon/cinder_loe/mixins/MixinRenderItem/field_77025_h +FD: com/zivilon/cinder_loe/mixins/MixinRenderItem/renderInFrame com/zivilon/cinder_loe/mixins/MixinRenderItem/field_82407_g +FD: com/zivilon/cinder_loe/mixins/MixinItemRenderer/RES_ITEM_GLINT com/zivilon/cinder_loe/mixins/MixinItemRenderer/field_110930_b +FD: com/zivilon/cinder_loe/mixins/MixinItemRenderer/renderBlocksIr com/zivilon/cinder_loe/mixins/MixinItemRenderer/field_147720_h +FD: com/zivilon/cinder_loe/mixins/MixinItemRenderer/mc com/zivilon/cinder_loe/mixins/MixinItemRenderer/field_78455_a +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/inheritRenderPass (Lnet/minecraft/entity/EntityLivingBase;IF)I com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77035_b (Lnet/minecraft/entity/EntityLivingBase;IF)I +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/getColorMultiplier (Lnet/minecraft/entity/EntityLivingBase;FF)I com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77030_a (Lnet/minecraft/entity/EntityLivingBase;FF)I +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_82408_c (Lnet/minecraft/entity/EntityLivingBase;IF)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_82408_c (Lnet/minecraft/entity/EntityLivingBase;IF)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/renderEquippedItems (Lnet/minecraft/entity/EntityLivingBase;F)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77029_c (Lnet/minecraft/entity/EntityLivingBase;F)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/handleRotationFloat (Lnet/minecraft/entity/EntityLivingBase;F)F com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77044_a (Lnet/minecraft/entity/EntityLivingBase;F)F +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/rotateCorpse (Lnet/minecraft/entity/EntityLivingBase;FFF)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77043_a (Lnet/minecraft/entity/EntityLivingBase;FFF)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/renderLivingAt (Lnet/minecraft/entity/EntityLivingBase;DDD)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77039_a (Lnet/minecraft/entity/EntityLivingBase;DDD)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/passSpecialRender (Lnet/minecraft/entity/EntityLivingBase;DDD)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77033_b (Lnet/minecraft/entity/EntityLivingBase;DDD)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/shouldRenderPass (Lnet/minecraft/entity/EntityLivingBase;IF)I com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77032_a (Lnet/minecraft/entity/EntityLivingBase;IF)I +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/preRenderCallback (Lnet/minecraft/entity/EntityLivingBase;F)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77041_b (Lnet/minecraft/entity/EntityLivingBase;F)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/interpolateRotation (FFF)F com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77034_a (FFF)F +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/renderModel (Lnet/minecraft/entity/EntityLivingBase;FFFFFF)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77036_a (Lnet/minecraft/entity/EntityLivingBase;FFFFFF)V +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/renderSwingProgress (Lnet/minecraft/entity/EntityLivingBase;F)F com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_77040_d (Lnet/minecraft/entity/EntityLivingBase;F)F +MD: com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/doRender (Lnet/minecraft/entity/EntityLivingBase;DDDFF)V com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity/func_76986_a (Lnet/minecraft/entity/EntityLivingBase;DDDFF)V +MD: com/zivilon/cinder_loe/mixins/MixinRenderItem/renderGlint (IIIII)V com/zivilon/cinder_loe/mixins/MixinRenderItem/func_77018_a (IIIII)V +MD: com/zivilon/cinder_loe/mixins/MixinItemRenderer/renderItemIn2D (Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V com/zivilon/cinder_loe/mixins/MixinItemRenderer/func_78439_a (Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V +MD: com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager/onResourceManagerReload (Lnet/minecraft/client/resources/IResourceManager;)V com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager/func_110549_a (Lnet/minecraft/client/resources/IResourceManager;)V diff --git a/build/tmp/packageMcLauncher/MANIFEST.MF b/build/tmp/packageMcLauncher/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/build/tmp/packageMcLauncher/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/build/tmp/packagePatchedMc/MANIFEST.MF b/build/tmp/packagePatchedMc/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/build/tmp/packagePatchedMc/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/build/tmp/patchDecompiledJar/patching.log b/build/tmp/patchDecompiledJar/patching.log new file mode 100644 index 0000000..25e4d14 --- /dev/null +++ b/build/tmp/patchDecompiledJar/patching.log @@ -0,0 +1,311 @@ +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/block/Block.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/ClientBrandRetriever.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/LoadingScreenRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/Minecraft.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/FontRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiButton.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiCreateWorld.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngame.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiIngameMenu.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMainMenu.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiMultiplayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/GuiSelectWorld.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/gui/ServerListEntryNormal.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerLoginClient.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/NetHandlerPlayClient.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/network/OldServerPinger.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/RenderBlocks.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/entity/RenderVillager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/Stitcher.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureMap.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/renderer/texture/TextureUtil.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/AbstractResourcePack.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/LanguageManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/resources/SimpleReloadableResourceManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/client/settings/GameSettings.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/crash/CrashReport.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityList.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTracker.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/EntityTrackerEntry.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/boss/IBossDisplayData.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/item/EntityItem.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/monster/EntitySlime.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/passive/EntityVillager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/entity/player/EntityPlayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotCrafting.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/inventory/SlotFurnace.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/Item.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemEmptyMap.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemMap.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/item/ItemStack.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/NetworkSystem.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/ServerStatusResponse.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/realms/RealmsConnect.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/MinecraftServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/dedicated/DedicatedServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/gui/MinecraftServerGui.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/integrated/IntegratedServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/PlayerProfileCache.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/management/ServerConfigurationManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerHandshakeTCP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/server/network/NetHandlerLoginServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntity.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/tileentity/TileEntityFurnace.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/MouseHelper.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/ResourceLocation.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/util/StringTranslate.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/World.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldProvider.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/WorldType.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/ChunkProviderServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/MapData.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/SaveHandler.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_738e7e11b8550d6264ec655d50e310a3/net/minecraft/world/storage/WorldInfo.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/fmlpatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/Block.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockBush.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockButton.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCactus.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockChest.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCocoa.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockCrops.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDeadBush.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoor.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockDoublePlant.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFalling.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFarmland.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFire.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockFlowerPot.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockGrass.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockIce.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLadder.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLeaves.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLever.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLiquid.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockLog.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMobSpawner.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMushroom.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockMycelium.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNetherWart.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockNote.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockOre.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPane.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonBase.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPistonMoving.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPotato.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockPumpkin.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRailBase.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneComparator.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneOre.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockRedstoneWire.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockReed.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSapling.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSkull.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockSnow.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockStem.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTallGrass.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTorch.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTrapDoor.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockTripWireHook.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/block/BlockVine.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/Minecraft.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/audio/SoundManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityOtherPlayerMP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/entity/EntityPlayerSP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiChat.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiCreateWorld.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiIngameMenu.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiMainMenu.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiNewChat.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiScreen.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSleepMP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/GuiSlot.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/achievement/GuiAchievements.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/gui/inventory/GuiContainerCreative.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBase.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelBox.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/ModelRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/PositionTextureVertex.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/model/TexturedQuad.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/ChunkProviderClient.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/PlayerControllerMP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/multiplayer/WorldClient.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/network/NetHandlerPlayClient.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EffectRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/particle/EntityDiggingFX.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/EntityRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/InventoryEffectRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/ItemRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/OpenGlHelper.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderBlocks.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/RenderGlobal.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/Tessellator.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/WorldRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderBiped.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderItem.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderPlayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RenderSnowMan.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/entity/RendererLivingEntity.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureAtlasSprite.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/texture/TextureMap.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/RenderItemFrame.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/client/shader/Framebuffer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandEnchant.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/command/CommandHandler.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/crash/CrashReportCategory.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/creativetab/CreativeTabs.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/Enchantment.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/enchantment/EnchantmentHelper.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/Entity.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityList.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLiving.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityLivingBase.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTracker.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/EntityTrackerEntry.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/ai/EntityAIAttackOnCollide.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityDragon.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/boss/EntityWither.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/effect/EntityLightningBolt.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityEnderPearl.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityItem.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecart.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartContainer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartEmpty.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartFurnace.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityMinecartHopper.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/item/EntityXPOrb.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityEnderman.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityMagmaCube.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/monster/EntityZombie.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityHorse.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityMooshroom.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityOcelot.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntitySheep.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/passive/EntityVillager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/EntityPlayerMP.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/player/InventoryPlayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/entity/projectile/EntityFishHook.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBeacon.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerBrewingStand.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerEnchantment.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerPlayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/ContainerRepair.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/Slot.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/inventory/SlotCrafting.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/Item.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemArmor.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBlock.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBow.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucket.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemBucketMilk.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemDye.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemFlintAndSteel.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemHoe.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemLilyPad.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemRecord.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeedFood.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSeeds.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemShears.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSkull.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemStack.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemSword.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/ItemTool.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/CraftingManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/FurnaceRecipes.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/item/crafting/RecipeFireworks.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/CompressedStreamTools.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTSizeTracker.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagByteArray.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagCompound.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagIntArray.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagList.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/nbt/NBTTagString.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/NetHandlerPlayServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S21PacketChunkData.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/network/play/server/S26PacketMapChunkBulk.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/Potion.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/potion/PotionEffect.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/MinecraftServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/integrated/IntegratedServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ItemInWorldManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/PlayerManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/server/management/ServerConfigurationManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/stats/StatList.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntity.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBeacon.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityBrewingStand.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityFurnace.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityHopper.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/tileentity/TileEntityNote.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/MovingObjectPosition.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Session.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/Vec3.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandom.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/util/WeightedRandomChestContent.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/village/VillageCollection.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/ChunkCache.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/Explosion.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/IBlockAccess.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/SpawnerAnimals.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/World.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldProvider.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldServerMulti.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/WorldType.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeDecorator.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenBase.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenForest.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenHills.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenJungle.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenPlains.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/BiomeGenSwamp.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/biome/WorldChunkManager.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/Chunk.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/AnvilSaveHandler.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/chunk/storage/RegionFile.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderEnd.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderGenerate.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderHell.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/ChunkProviderServer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenCaves.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/MapGenRavine.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenAbstractTree.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigMushroom.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenBigTree.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenCanopyTree.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDeadBush.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenDungeons.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenForest.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenHugeTrees.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaJungle.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMegaPineTree.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenMinable.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSavannaTree.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenShrub.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenSwamp.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga1.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTaiga2.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTallGrass.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGenTrees.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/feature/WorldGeneratorBonusChest.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayer.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/layer/GenLayerBiome.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/ComponentScatteredFeaturePieces.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStronghold.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/MapGenStructure.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureComponent.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureMineshaftPieces.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStart.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureStrongholdPieces.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/gen/structure/StructureVillagePieces.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/MapData.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip +Applying patch /home/shinare/Java/CinderLoE/build/tmp/.cache/expanded/zip_32c9af2dd683a29fc6a9d74aa73adbdd/net/minecraft/world/storage/SaveHandler.java.patch from bundle /home/shinare/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/forgepatches.zip diff --git a/build/tmp/reobfJar/MANIFEST.MF b/build/tmp/reobfJar/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/build/tmp/reobfJar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/build/tmp/sourcesJar/MANIFEST.MF b/build/tmp/sourcesJar/MANIFEST.MF new file mode 100644 index 0000000..59499bc --- /dev/null +++ b/build/tmp/sourcesJar/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000..de4256b --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,40 @@ +/* + * Add your dependencies here. Supported configurations: + * - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod + * Available at runtime and compiletime for mods depending on this mod + * - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API + * Available at runtime but not compiletime for mods depending on this mod + * - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods + * Not available at all for mods depending on this mod, only visible at compiletime for this mod + * - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod + * Available at compiletime but not runtime for mods depending on this mod + * - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency + * Not available at all for mods depending on this mod, only visible at runtime for this mod + * - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime, + * but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing + * - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime + * Available at runtime for mods depending on this mod + * - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry + * - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main + * + * - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name + * Requires you to enable usesShadowedDependencies in gradle.properties + * + * - compile("g:n:v:c"): deprecated, replace with "api" (works like the old "compile") or "implementation" (can be more efficient) + * + * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed, + * but use this sparingly as it can break using your mod as another mod's dependency if you're not careful. + * + * To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven, + * or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file. + * + * Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not. + * The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published. + * + * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph + */ +dependencies { + implementation files('libs/cindercore.jar') + implementation files('libs/lotr.jar') + implementation files('libs/optifine.jar') +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..05450e8 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,152 @@ +modName = CinderLoE + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = cinder_loe + +modGroup = com.zivilon.cinder_loe + +# WHY is there no version field? +# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the +# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/ + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +minecraftVersion = 1.7.10 +forgeVersion = 10.13.4.1614 + +# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task. +channel = stable +mappingsVersion = 12 + +# Define other MCP mappings for dependency deobfuscation +remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ + +# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +developmentEnvironmentUserName = Developer + +# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8. +# See https://github.com/bsideup/jabel for details on how this works. +enableModernJavaSyntax = true + +# Enables injecting missing generics into the decompiled source code for a better coding experience +# Turns most publicly visible List, Map, etc. into proper List, Map types +enableGenericInjection = false + +# Generate a class with String fields for the mod id, name, version and group name named with the fields below +generateGradleTokenClass = com.zivilon.cinder_loe.Tags +gradleTokenModId = MODID +gradleTokenModName = MODNAME +gradleTokenVersion = +gradleTokenGroupName = GROUPNAME +# [DEPRECATED] +# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can +# leave this property empty. +# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +apiPackage = + +# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ +# There can be multiple files in a space-separated list. +# Example value: mymodid_at.cfg nei_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = true +# Adds some debug arguments like verbose output and export +usesMixinDebug = false +# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. +mixinPlugin = +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = mixins +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatibility only +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = coremod.CoreMod +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class +# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. +forceEnableMixins = false + +# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your +# responsibility check the licence and request permission for distribution, if required. +usesShadowedDependencies = false +# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access +# their own classes, making the minimization unreliable. +minimizeShadowedDependencies = true +# If disabled, won't rename the shadowed classes. +relocateShadowedDependencies = true + +# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories +includeWellKnownRepositories = false + +# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. +# Authenticate with the MAVEN_USERNAME and MAVEN_PASSWORD environment variables. +# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. +usesMavenPublishing = false +# mavenPublishUrl = http://jenkins.usrv.eu:8081/nexus/content/repositories/releases + +# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token. + +# The project's ID on Modrinth. Can be either the slug or the ID. +# Leave this empty if you don't want to publish on Modrinth. +modrinthProjectId = + +# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. +# Syntax: scope1-type1:name1;scope2-type2:name2;... +# Where scope can be one of [required, optional, incompatible, embedded], +# type can be one of [project, version], +# and the name is the Modrinth project or version slug/id of the other mod. +# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +modrinthRelations = + + +# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. + +# The project's numeric ID on CurseForge. You can find this in the About Project box. +# Leave this empty if you don't want to publish on CurseForge. +curseForgeProjectId = + +# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. +# Syntax: type1:name1;type2:name2;... +# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], +# and the name is the CurseForge project slug of the other mod. +# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft +# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true +curseForgeRelations = + + +# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older +# projects. New projects should not use this parameter. +# customArchiveBaseName = + +# Optional parameter to prevent the source code from being published +# noPublishedSources = + +# Uncomment this to disable spotless checks +# This should only be uncommented to keep it easier to sync with upstream/other forks. +# That is, if there is no other active fork/upstream, NEVER change this. +disableSpotless = true + +# Uncomment this to disable checkstyle checks (currently wildcard import check). + disableCheckstyle = true + +# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" +# (force use delegated build). +# This is meant to be set in $HOME/.gradle/gradle.properties. +# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build. +# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! +# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. +# ideaOverrideBuildType = idea diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..033e24c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..9f4197d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..fcb6fca --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..93e3f59 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..09bbb51 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/libs/cindercore.jar b/libs/cindercore.jar new file mode 100644 index 0000000..676fe6b Binary files /dev/null and b/libs/cindercore.jar differ diff --git a/libs/lotr.jar b/libs/lotr.jar new file mode 100644 index 0000000..810493a Binary files /dev/null and b/libs/lotr.jar differ diff --git a/libs/optifine.jar b/libs/optifine.jar new file mode 100644 index 0000000..a15b043 Binary files /dev/null and b/libs/optifine.jar differ diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000..c884390 --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,5 @@ +// Add any additional repositories for your dependencies here + +repositories { + +} diff --git a/run/natives/lwjgl2/jinput-dx8.dll b/run/natives/lwjgl2/jinput-dx8.dll new file mode 100644 index 0000000..bf3fe90 Binary files /dev/null and b/run/natives/lwjgl2/jinput-dx8.dll differ diff --git a/run/natives/lwjgl2/jinput-dx8_64.dll b/run/natives/lwjgl2/jinput-dx8_64.dll new file mode 100644 index 0000000..a56d9a7 Binary files /dev/null and b/run/natives/lwjgl2/jinput-dx8_64.dll differ diff --git a/run/natives/lwjgl2/jinput-raw.dll b/run/natives/lwjgl2/jinput-raw.dll new file mode 100644 index 0000000..1131d47 Binary files /dev/null and b/run/natives/lwjgl2/jinput-raw.dll differ diff --git a/run/natives/lwjgl2/jinput-raw_64.dll b/run/natives/lwjgl2/jinput-raw_64.dll new file mode 100644 index 0000000..38e1c10 Binary files /dev/null and b/run/natives/lwjgl2/jinput-raw_64.dll differ diff --git a/run/natives/lwjgl2/jinput-wintab.dll b/run/natives/lwjgl2/jinput-wintab.dll new file mode 100644 index 0000000..e075ec3 Binary files /dev/null and b/run/natives/lwjgl2/jinput-wintab.dll differ diff --git a/run/natives/lwjgl2/libjinput-linux.so b/run/natives/lwjgl2/libjinput-linux.so new file mode 100644 index 0000000..dba9e59 Binary files /dev/null and b/run/natives/lwjgl2/libjinput-linux.so differ diff --git a/run/natives/lwjgl2/libjinput-linux64.so b/run/natives/lwjgl2/libjinput-linux64.so new file mode 100644 index 0000000..8b5f9d8 Binary files /dev/null and b/run/natives/lwjgl2/libjinput-linux64.so differ diff --git a/run/natives/lwjgl2/libjinput-osx.jnilib b/run/natives/lwjgl2/libjinput-osx.jnilib new file mode 100644 index 0000000..59a3eab Binary files /dev/null and b/run/natives/lwjgl2/libjinput-osx.jnilib differ diff --git a/run/natives/lwjgl2/liblwjgl.so b/run/natives/lwjgl2/liblwjgl.so new file mode 100644 index 0000000..ba6e7f6 Binary files /dev/null and b/run/natives/lwjgl2/liblwjgl.so differ diff --git a/run/natives/lwjgl2/liblwjgl64.so b/run/natives/lwjgl2/liblwjgl64.so new file mode 100644 index 0000000..8ed0992 Binary files /dev/null and b/run/natives/lwjgl2/liblwjgl64.so differ diff --git a/run/natives/lwjgl2/libopenal.so b/run/natives/lwjgl2/libopenal.so new file mode 100644 index 0000000..0a3a619 Binary files /dev/null and b/run/natives/lwjgl2/libopenal.so differ diff --git a/run/natives/lwjgl2/libopenal64.so b/run/natives/lwjgl2/libopenal64.so new file mode 100644 index 0000000..e0693c0 Binary files /dev/null and b/run/natives/lwjgl2/libopenal64.so differ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e334397 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,28 @@ + +pluginManagement { + repositories { + maven { + // RetroFuturaGradle + name "GTNH Maven" + url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" + allowInsecureProtocol = true + mavenContent { + includeGroup("com.gtnewhorizons.retrofuturagradle") + } + } + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + +plugins { + id 'com.diffplug.blowdryerSetup' version '1.6.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains +} + +blowdryerSetup { + repoSubfolder 'gtnhShared' + github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.2') + //devLocal '.' // Use this when testing config updates locally +} diff --git a/shortcut b/shortcut new file mode 120000 index 0000000..7e5ec74 --- /dev/null +++ b/shortcut @@ -0,0 +1 @@ +src/main/java/com/zivilon/cinder_loe/ \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java new file mode 100644 index 0000000..680f909 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE.java @@ -0,0 +1,886 @@ +package com.zivilon.cinder_loe; + +import com.zivilon.cinder_loe.blocks.*; +import com.zivilon.cinder_loe.character.CharacterEventListener; +import com.zivilon.cinder_loe.character.CharacterRoleAPI; +import com.zivilon.cinder_loe.client.render.*; +import com.zivilon.cinder_loe.command.CommandCinderCharacter; +import com.zivilon.cinder_loe.entity.*; +import com.zivilon.cinder_loe.items.*; +import com.zivilon.cinder_loe.tileentity.*; +import com.zivilon.cinder_loe.util.Utilities; +import com.zivilon.cindercore.CinderCore; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.util.TraceClassVisitor; + +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; + +import lotr.client.render.entity.*; +import lotr.client.render.entity.LOTRRenderSauron; +import lotr.client.render.tileentity.LOTRRenderUtumnoPortal; +import lotr.common.LOTRCreativeTabs; +import lotr.common.LOTRMod; +import lotr.common.entity.animal.*; +import lotr.common.entity.npc.*; +import lotr.common.entity.npc.LOTREntityBarrowWight; +import lotr.common.entity.npc.LOTREntitySauron; +import lotr.common.entity.projectile.LOTREntityGandalfFireball; +import lotr.common.item.LOTRItemArmor; +import lotr.common.item.LOTRItemBattleaxe; +import lotr.common.item.LOTRItemBlowgun; +import lotr.common.item.LOTRItemCrossbow; +import lotr.common.item.LOTRItemDagger; +import lotr.common.item.LOTRItemHammer; +import lotr.common.item.LOTRItemMountArmor; +import lotr.common.item.LOTRItemPike; +import lotr.common.item.LOTRItemSpear; +import lotr.common.item.LOTRItemSword; +import lotr.common.item.LOTRItemTrident; +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRWeaponStats; +import lotr.common.world.biome.LOTRBiome; +import lotr.common.world.spawning.LOTRBiomeSpawnList; +import lotr.common.world.spawning.LOTRSpawnEntry; +import lotr.common.world.spawning.LOTRSpawnList; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; + +import static lotr.common.LOTRMod.horseArmorIron; + +@Mod( + modid = "cinder_loe", + version = "1.2", + name = "CinderLoE", + dependencies = "required-after:spongemixins@[1.1.0,);required-after:lotr", + acceptedMinecraftVersions = "[1.7.10]", + acceptableRemoteVersions = "*") +public class CinderLoE { + + @Instance("cinder_loe") + public static CinderLoE instance; + + public static final Logger LOG = LogManager.getLogger(Tags.MODID); + + // LOTR Materials + public static LOTRMaterial MATERIAL_RED_DWARF; + public static LOTRMaterial WIZARD; + public static LOTRMaterial MATERIAL_LIMWAITH_BONE; + public static LOTRMaterial MATERIAL_LIMWAITH_WOOD; + public static LOTRMaterial EVENT; + public static LOTRMaterial MATERIAL_BREE; + public static LOTRMaterial MATERIAL_BATTLENUN; + + // Blocks + public static Block cinderBlock; + public static Block ivoryBlock; + public static Block blockRedDwarfSteel; + public static Block barsRedDwarf; + public static Block chandelierRedDwarf; + public static Block furBundle; + public static Block leatherBundle; + public static Block reedBale; + public static Block dwarvenBrickRuned; + public static Block fishBarrel; + public static Block mistBlock; + public static Block silverChain; + public static Block goldChain; + public static Block ironChain; + + // Misc + public static Item frostblade; + public static Item spearsolidgold; + public static Item whip; + + // Red Dwarves + public static Item redDwarfSteel; + public static Item helmetRedDwarf; + public static Item bodyRedDwarf; + public static Item legsRedDwarf; + public static Item bootsRedDwarf; + public static Item spearRedDwarf; + public static Item swordRedDwarf; + public static Item battleaxeRedDwarf; + public static Item pikeRedDwarf; + public static Item hammerRedDwarf; + public static Item daggerRedDwarf; + public static Item daggerRedDwarfPoisoned; + public static Item crossbowRedDwarf; + public static Item boarArmorRedDwarf; + public static LOTRUnitTradeEntries RED_DWARF_COMMANDER; + + // Limwaith + public static Item helmetLimwaith; + public static Item bodyLimwaith; + public static Item legsLimwaith; + public static Item bootsLimwaith; + public static Item tridentLimwaith; + public static Item spearLimwaith; + public static Item truncheonLimwaith; + public static Item battleaxeLimwaith; + public static Item daggerLimwaith; + public static Item daggerLimwaithPoisoned; + public static Item blowgunLimwaith; + public static LOTRUnitTradeEntries LIMWAITH_COMMANDER; + + //Bree + public static Item helmetBree; + public static Item bodyBree; + public static Item legsBree; + public static Item bootsBree; + public static Item swordBree; + public static LOTRUnitTradeEntries BREE_CAPTAIN; + + // Arnor + public static Item helmetArnorBanner; + public static Item bodyArnorBanner; + public static Item legsArnorBanner; + public static Item bootsArnorBanner; + public static Item maceArnor; + public static LOTRUnitTradeEntries ARNOR_CAPTAIN; + public static Item battleNunSpawnEgg; + + // Wizards + public static Item radagastStaff; + public static Item pallandoStaff; + public static Item alatarStaff; + public static Item sarumanStaff; + + // Spawn eggs + public static Item redDwarfWarriorSpawnEgg; + public static Item redDwarfArbalestSpawnEgg; + public static Item redDwarfCommanderSpawnEgg; + public static Item redDwarfBannerBearerSpawnEgg; + + public static Item limwaithWarriorSpawnEgg; + public static Item limwaithBlowgunnerSpawnEgg; + public static Item limwaithBannerBearerSpawnEgg; + public static Item limwaithChieftainSpawnEgg; + + public static Item fangornBearSpawnEgg; + public static Item fangornWildBoarSpawnEgg; + public static Item fangornAurochSpawnEgg; + public static Item fangornElkSpawnEgg; + public static Item renegadeSpawnEgg; + public static Item renegadeCaptainSpawnEgg; + public static Item wraithSpawnEgg; + + public static Item ArnorSoldierSpawnEgg; + public static Item ArnorSoldierArcherSpawnEgg; + public static Item ArnorCaptainSpawnEgg; + public static Item ArnorBannerBearerSpawnEgg; + + public static Item BreeSoldierSpawnEgg; + public static Item BreeCrossbowmanSpawnEgg; + public static Item BreeCaptainSpawnEgg; + public static Item BreeSoldierBannerBearerSpawnEgg; + public static Item BreeOutriderSpawnEgg; + + public static Item SauronSpawnEgg; + + // Spawn lists + public static LOTRSpawnList RED_DWARF; + public static LOTRSpawnList LIMWAITH; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + CinderLoE_Config.init(event); + Materials.registerMaterials(); + registerItems(); + registerBlocks(); + registerEntities(); + } + + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + CommonProxy proxy = event.getSide() == Side.CLIENT ? new ClientProxy() : new ServerProxy(); + proxy.setup(); + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + FMLCommonHandler.instance().bus().register(this); + } + MinecraftForge.EVENT_BUS.register(this); + new CharacterEventListener(); + } + + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + if (event.getSide() + .isServer()) { + SpeechBankModifier.insertSpeechBanks(); + modifySpawnLists(); + } + Utilities.initialize_reflects(); + recipes.registerRecipes(); // Register recipes at com.zivilon.cinder_loe.recipes.java + setupTradeEntries(); + LOTRWeaponStats.registerMeleeReach(Whip.class, 1.5F); + } + + + @Mod.EventHandler + public void serverStarting(FMLServerStartingEvent event) { + CharacterRoleAPI.loadRolesFromFile(); + event.registerServerCommand(new CommandCinderCharacter()); + } + + public void registerEntities() { + GameRegistry.registerTileEntity(TileEntityMistBlock.class, "TileEntityMistBlock"); + + int entityID = 7320; // Always increment entityID by 1 over the last entity to ensure unique IDs + EntityRegistry.registerModEntity(SarumanFireball.class, "SarumanFireball", entityID + 0, this, 64, 10, true); + EntityRegistry.registerModEntity(Renegade.class, "Renegade", (entityID + 1), this, 64, 1, true); + EntityRegistry.registerModEntity(RenegadeCaptain.class, "RenegadeCaptain", (entityID + 16), this, 64, 1, true); + + EntityRegistry.registerModEntity(RedDwarfWarrior.class, "RedDwarfWarrior", (entityID + 2), this, 64, 1, true); + EntityRegistry.registerModEntity(RedDwarfArbalest.class, "RedDwarfArbalest", (entityID + 3), this, 64, 1, true); + EntityRegistry.registerModEntity(RedDwarfBannerBearer.class, "RedDwarfBannerBearer", (entityID + 4), this, 64, 1, true); + EntityRegistry.registerModEntity(RedDwarfCommander.class, "RedDwarfCommander", (entityID + 5), this, 64, 1, true); + + EntityRegistry.registerModEntity(FangornBear.class, "FangornBear", (entityID + 6), this, 64, 1, true); + EntityRegistry.registerModEntity(FangornWildBoar.class, "FangornWildBoar", (entityID + 7), this, 64, 1, true); + EntityRegistry.registerModEntity(FangornAuroch.class, "FangornAuroch", (entityID + 8), this, 64, 1, true); + EntityRegistry.registerModEntity(FangornElk.class, "FangornElk", (entityID + 9), this, 64, 1, true); + EntityRegistry.registerModEntity(FangornWolf.class, "FangornWolf", (entityID + 10), this, 64, 1, true); + + EntityRegistry.registerModEntity(LimwaithWarrior.class, "LimwaithWarrior", (entityID + 11), this, 64, 1, true); + EntityRegistry.registerModEntity(LimwaithBlowgunner.class, "LimwaithBlowgunner", (entityID + 12), this, 64, 1, true); + EntityRegistry.registerModEntity(LimwaithBannerBearer.class, "LimwaithBannerBearer", (entityID + 13), this, 64, 1, true); + EntityRegistry.registerModEntity(LimwaithChieftain.class, "LimwaithChieftain", (entityID + 14), this, 64, 1, true); + + EntityRegistry.registerModEntity(Wraith.class, "Wraith", (entityID + 15), this, 64, 1, true); + + EntityRegistry.registerModEntity(ArnorSoldier.class, "ArnorSoldier", (entityID + 17), this, 64, 1, true); + EntityRegistry.registerModEntity(ArnorSoldierArcher.class, "ArnorSoldierArcher", (entityID + 19), this, 64, 1, true); + EntityRegistry.registerModEntity(ArnorCaptain.class, "ArnorCaptain", (entityID + 20), this, 64, 1, true); + EntityRegistry.registerModEntity(ArnorBannerBearer.class, "ArnorBannerBearer", (entityID + 21), this, 64, 1, true); + EntityRegistry.registerModEntity(BattleNun.class, "BattleNun", (entityID + 27), this, 64, 1, true); + + EntityRegistry.registerModEntity(BreeSoldier.class, "BreeSoldier", (entityID + 22), this, 64, 1, true); + EntityRegistry.registerModEntity(BreeCrossbowman.class, "BreeCrossbowman", (entityID + 23), this, 64, 1, true); + EntityRegistry.registerModEntity(BreeCaptain.class, "BreeCaptain", (entityID + 24), this, 64, 1, true); + EntityRegistry.registerModEntity(BreeSoldierBannerBearer.class, "BreeSoldierBannerBearer", (entityID + 25), this, 64, 1, true); + EntityRegistry.registerModEntity(BreeOutrider.class, "BreeOutrider", (entityID + 26), this, 64, 1, true); + + EntityRegistry.registerModEntity(LOTREntitySauron.class, "LOTREntitySauron", (entityID + 28), this, 64, 1, true); + } + + public void registerBlocks() { + // Cinder Block + cinderBlock = (new CinderBlock()); + GameRegistry.registerBlock(cinderBlock, "cinderBlock"); + + // Ivory Block + ivoryBlock = (new IvoryBlock()); + GameRegistry.registerBlock(ivoryBlock, "ivoryBlock"); + + // Red Dwarven Steel Block + blockRedDwarfSteel = (new BlockRedDwarfSteel()); + GameRegistry.registerBlock(blockRedDwarfSteel, "blockRedDwarfSteel"); + + // Red Dwarven Steel Bars + barsRedDwarf = (new RedDwarfBars()); + GameRegistry.registerBlock(barsRedDwarf, "barsRedDwarf"); + + // Red dwarven chandelier + chandelierRedDwarf = (new RedDwarfChandelier()); + GameRegistry.registerBlock(chandelierRedDwarf, "chandelierRedDwarf"); + + // Fur bundle + furBundle = (new FurBundle()); + GameRegistry.registerBlock(furBundle, "furBundle"); + + // Leather bundle + leatherBundle = (new LeatherBundle()); + GameRegistry.registerBlock(leatherBundle, "leatherBundle"); + + // Reed bale + reedBale = (new ReedBale()); + GameRegistry.registerBlock(reedBale, "reedBale"); + + // Runed Dwarven Brick + dwarvenBrickRuned = (new RunedDwarvenBrick()); + GameRegistry.registerBlock(dwarvenBrickRuned, "dwarvenBrickRuned"); + + // Fish Barrel + fishBarrel = (new FishBarrel()); + GameRegistry.registerBlock(fishBarrel, "fishbarrel"); + + // Chains + silverChain = (new silverChain()); + GameRegistry.registerBlock(silverChain, "silverChain"); + goldChain = (new goldChain()); + GameRegistry.registerBlock(goldChain, "goldChain"); + ironChain = (new ironChain()); + GameRegistry.registerBlock(ironChain, "ironChain"); + + // Mist Block + mistBlock = (new MistBlock()); + GameRegistry.registerBlock(mistBlock, "mist"); + } + + public void registerItems() { + // Get materials tab via reflection because ForgeGradle insists on obfuscating it when it should not + LOTRCreativeTabs materials = null; + try { + Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabMaterials"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to be + materials = (LOTRCreativeTabs) tabField.get(null); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + + // Spawn eggs + redDwarfWarriorSpawnEgg = new CinderLoESpawnEgg(RedDwarfWarrior.class).setTextureName("lotr:spawn_egg"); + redDwarfArbalestSpawnEgg = new CinderLoESpawnEgg(RedDwarfArbalest.class).setTextureName("lotr:spawn_egg"); + redDwarfCommanderSpawnEgg = new CinderLoESpawnEgg(RedDwarfCommander.class).setTextureName("lotr:spawn_egg"); + redDwarfBannerBearerSpawnEgg = new CinderLoESpawnEgg(RedDwarfBannerBearer.class).setTextureName("lotr:spawn_egg"); + + limwaithWarriorSpawnEgg = new CinderLoESpawnEgg(LimwaithWarrior.class).setTextureName("lotr:spawn_egg"); + limwaithBlowgunnerSpawnEgg = new CinderLoESpawnEgg(LimwaithBlowgunner.class).setTextureName("lotr:spawn_egg"); + limwaithChieftainSpawnEgg = new CinderLoESpawnEgg(LimwaithChieftain.class).setTextureName("lotr:spawn_egg"); + limwaithBannerBearerSpawnEgg = new CinderLoESpawnEgg(LimwaithBannerBearer.class).setTextureName("lotr:spawn_egg"); + + fangornBearSpawnEgg = new CinderLoESpawnEgg(FangornBear.class).setTextureName("lotr:spawn_egg"); + fangornWildBoarSpawnEgg = new CinderLoESpawnEgg(FangornWildBoar.class).setTextureName("lotr:spawn_egg"); + fangornAurochSpawnEgg = new CinderLoESpawnEgg(FangornAuroch.class).setTextureName("lotr:spawn_egg"); + fangornElkSpawnEgg = new CinderLoESpawnEgg(FangornElk.class).setTextureName("lotr:spawn_egg"); + renegadeSpawnEgg = new CinderLoESpawnEgg(Renegade.class).setTextureName("lotr:spawn_egg"); + renegadeCaptainSpawnEgg = new CinderLoESpawnEgg(RenegadeCaptain.class).setTextureName("lotr:spawn_egg"); + wraithSpawnEgg = new CinderLoESpawnEgg(Wraith.class).setTextureName("lotr:spawn_egg"); + + ArnorSoldierSpawnEgg = new CinderLoESpawnEgg(ArnorSoldier.class).setTextureName("lotr:spawn_egg"); + ArnorSoldierArcherSpawnEgg = new CinderLoESpawnEgg(ArnorSoldierArcher.class).setTextureName("lotr:spawn_egg"); + ArnorCaptainSpawnEgg = new CinderLoESpawnEgg(ArnorCaptain.class).setTextureName("lotr:spawn_egg"); + ArnorBannerBearerSpawnEgg = new CinderLoESpawnEgg(ArnorBannerBearer.class).setTextureName("lotr:spawn_egg"); + battleNunSpawnEgg = new CinderLoESpawnEgg(BattleNun.class).setTextureName("lotr:spawn_egg"); + + BreeSoldierSpawnEgg = new CinderLoESpawnEgg(BreeSoldier.class).setTextureName("lotr:spawn_egg"); + BreeCrossbowmanSpawnEgg = new CinderLoESpawnEgg(BreeCrossbowman.class).setTextureName("lotr:spawn_egg"); + BreeCaptainSpawnEgg = new CinderLoESpawnEgg(BreeCaptain.class).setTextureName("lotr:spawn_egg"); + BreeSoldierBannerBearerSpawnEgg = new CinderLoESpawnEgg(BreeSoldierBannerBearer.class).setTextureName("lotr:spawn_egg"); + BreeOutriderSpawnEgg = new CinderLoESpawnEgg(BreeOutrider.class).setTextureName("lotr:spawn_egg"); + + SauronSpawnEgg = new CinderLoESpawnEgg(LOTREntitySauron.class).setTextureName("lotr:spawn_egg"); + + GameRegistry.registerItem(redDwarfWarriorSpawnEgg, "redDwarfWarriorSpawnEgg"); + GameRegistry.registerItem(redDwarfArbalestSpawnEgg, "redDwarfArbalestSpawnEgg"); + GameRegistry.registerItem(redDwarfCommanderSpawnEgg, "redDwarfCommanderSpawnEgg"); + GameRegistry.registerItem(redDwarfBannerBearerSpawnEgg, "redDwarfBannerBearerSpawnEgg"); + + GameRegistry.registerItem(fangornBearSpawnEgg, "fangornBearSpawnEgg"); + GameRegistry.registerItem(fangornWildBoarSpawnEgg, "fangornWildBoarSpawnEgg"); + GameRegistry.registerItem(fangornAurochSpawnEgg, "fangornAurochSpawnEgg"); + GameRegistry.registerItem(fangornElkSpawnEgg, "fangornElkSpawnEgg"); + GameRegistry.registerItem(renegadeSpawnEgg, "renegadeSpawnEgg"); + GameRegistry.registerItem(renegadeCaptainSpawnEgg, "renegadeCaptainSpawnEgg"); + GameRegistry.registerItem(wraithSpawnEgg, "wraithSpawnEgg"); + + GameRegistry.registerItem(limwaithWarriorSpawnEgg, "limwaithWarriorSpawnEgg"); + GameRegistry.registerItem(limwaithBlowgunnerSpawnEgg, "limwaithBlowgunnerSpawnEgg"); + GameRegistry.registerItem(limwaithBannerBearerSpawnEgg, "limwaithBannerBearerSpawnEgg"); + GameRegistry.registerItem(limwaithChieftainSpawnEgg, "limwaithChieftainSpawnEgg"); + + GameRegistry.registerItem(ArnorSoldierSpawnEgg, "ArnorSoldierSpawnEgg"); + GameRegistry.registerItem(ArnorSoldierArcherSpawnEgg, "ArnorSoldierArcherSpawnEgg"); + GameRegistry.registerItem(ArnorCaptainSpawnEgg, "ArnorCaptainSpawnEgg"); + GameRegistry.registerItem(ArnorBannerBearerSpawnEgg, "ArnorBannerBearerSpawnEgg"); + GameRegistry.registerItem(battleNunSpawnEgg, "battleNunSpawnEgg"); + + GameRegistry.registerItem(BreeSoldierSpawnEgg, "BreeSoldierSpawnEgg"); + GameRegistry.registerItem(BreeCrossbowmanSpawnEgg, "BreeCrossbowmanSpawnEgg"); + GameRegistry.registerItem(BreeCaptainSpawnEgg, "BreeCaptainSpawnEgg"); + GameRegistry.registerItem(BreeSoldierBannerBearerSpawnEgg, "BreeSoldierBannerBearerSpawnEgg"); + GameRegistry.registerItem(BreeOutriderSpawnEgg, "BreeOutriderSpawnEgg"); + + GameRegistry.registerItem(SauronSpawnEgg, "SauronSpawnEgg"); + + // Wizards + radagastStaff = (new RadagastStaff()).setUnlocalizedName("lotr:radagastStaff").setTextureName("lotr:radagastStaff"); + pallandoStaff = (new PallandoStaff()).setUnlocalizedName("lotr:pallandoStaff").setTextureName("lotr:pallandoStaff"); + alatarStaff = (new AlatarStaff()).setUnlocalizedName("lotr:alatarStaff").setTextureName("lotr:alatarStaff"); + sarumanStaff = (new SarumanStaff()).setUnlocalizedName("lotr:sarumanStaff").setTextureName("lotr:sarumanStaff"); + GameRegistry.registerItem(radagastStaff, "radagastStaff"); + GameRegistry.registerItem(pallandoStaff, "pallandoStaff"); + GameRegistry.registerItem(alatarStaff, "alatarStaff"); + GameRegistry.registerItem(sarumanStaff, "sarumanStaff"); + + linkLOTRWeapon(radagastStaff, "radagastStaff"); + linkLOTRWeapon(pallandoStaff, "pallandoStaff"); + linkLOTRWeapon(alatarStaff, "alatarStaff"); + linkLOTRWeapon(sarumanStaff, "sarumanStaff"); + + // Misc + EVENT = getLOTRMaterialByName("EVENT"); + frostblade = (new LOTRItemSword(EVENT)).setUnlocalizedName("lotr:frostblade").setTextureName("lotr:frostblade"); + spearsolidgold = (new LOTRItemSpear(EVENT)).setUnlocalizedName("lotr:spearsolidgold").setTextureName("lotr:spearsolidgold"); + whip = (new Whip()).setUnlocalizedName("lotr:whip").setTextureName("lotr:whip"); + GameRegistry.registerItem(frostblade, "frostblade"); + GameRegistry.registerItem(spearsolidgold, "spearsolidgold"); + GameRegistry.registerItem(whip, "whip"); + linkLOTRWeapon(frostblade, "frostblade"); + linkLOTRWeapon(spearsolidgold, "spearsolidgold"); + linkLOTRWeapon(whip, "whip"); + + // Red Dwarves + redDwarfSteel = new Item().setUnlocalizedName("lotr:redDwarfSteel").setTextureName("lotr:redDwarfSteel").setCreativeTab((CreativeTabs) materials); + GameRegistry.registerItem(redDwarfSteel, "redDwarfSteel"); + + MATERIAL_RED_DWARF = getLOTRMaterialByName("RED_DWARF"); + if (MATERIAL_RED_DWARF != null) { + helmetRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 0, "helmet")).setUnlocalizedName("lotr:helmetRedDwarf").setTextureName("lotr:helmetRedDwarf"); + bodyRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 1)).setUnlocalizedName("lotr:bodyRedDwarf").setTextureName("lotr:bodyRedDwarf"); + legsRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 2)).setUnlocalizedName("lotr:legsRedDwarf").setTextureName("lotr:legsRedDwarf"); + bootsRedDwarf = (new LOTRItemArmor(MATERIAL_RED_DWARF, 3)).setUnlocalizedName("lotr:bootsRedDwarf").setTextureName("lotr:bootsRedDwarf"); + spearRedDwarf = (new LOTRItemSpear(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:spearRedDwarf").setTextureName("lotr:spearRedDwarf"); + swordRedDwarf = (new LOTRItemSword(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:swordRedDwarf").setTextureName("lotr:swordRedDwarf"); + battleaxeRedDwarf = (new LOTRItemBattleaxe(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:battleaxeRedDwarf").setTextureName("lotr:battleaxeRedDwarf"); + pikeRedDwarf = (new LOTRItemPike(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:pikeRedDwarf").setTextureName("lotr:pikeRedDwarf"); + hammerRedDwarf = (new LOTRItemHammer(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:hammerRedDwarf").setTextureName("lotr:hammerRedDwarf"); + daggerRedDwarf = (new LOTRItemDagger(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:daggerRedDwarf").setTextureName("lotr:daggerRedDwarf"); + daggerRedDwarfPoisoned = (new LOTRItemDagger(MATERIAL_RED_DWARF, LOTRItemDagger.DaggerEffect.POISON)).setUnlocalizedName("lotr:daggerRedDwarfPoisoned").setTextureName("lotr:daggerRedDwarfPoisoned"); + crossbowRedDwarf = (new LOTRItemCrossbow(MATERIAL_RED_DWARF)).setUnlocalizedName("lotr:crossbowRedDwarf").setTextureName("lotr:crossbowRedDwarf"); + boarArmorRedDwarf = (new LOTRItemMountArmor(MATERIAL_RED_DWARF, LOTRItemMountArmor.Mount.BOAR)).setUnlocalizedName("lotr:boarArmorRedDwarf").setTextureName("lotr:boarArmorRedDwarf"); + + GameRegistry.registerItem(helmetRedDwarf, "helmetRedDwarf"); + GameRegistry.registerItem(bodyRedDwarf, "bodyRedDwarf"); + GameRegistry.registerItem(legsRedDwarf, "legsRedDwarf"); + GameRegistry.registerItem(bootsRedDwarf, "bootsRedDwarf"); + GameRegistry.registerItem(spearRedDwarf, "spearRedDwarf"); + GameRegistry.registerItem(swordRedDwarf, "swordRedDwarf"); + GameRegistry.registerItem(battleaxeRedDwarf, "battleaxeRedDwarf"); + GameRegistry.registerItem(pikeRedDwarf, "pikeRedDwarf"); + GameRegistry.registerItem(hammerRedDwarf, "hammerRedDwarf"); + GameRegistry.registerItem(daggerRedDwarf, "daggerRedDwarf"); + GameRegistry.registerItem(daggerRedDwarfPoisoned, "daggerRedDwarfPoisoned"); + GameRegistry.registerItem(crossbowRedDwarf, "crossbowRedDwarf"); + GameRegistry.registerItem(boarArmorRedDwarf, "boarArmorRedDwarf"); +// System.out.println("Registered red dwarf equipment"); + } else { + // Log an error or handle the case where the material could not be found + System.err.println("Failed to find RED_DWARF material for armor initialization."); + } + linkLOTRWeapon(spearRedDwarf, "spearRedDwarf"); + linkLOTRWeapon(swordRedDwarf, "swordRedDwarf"); + linkLOTRWeapon(battleaxeRedDwarf, "battleaxeRedDwarf"); + linkLOTRWeapon(pikeRedDwarf, "pikeRedDwarf"); + linkLOTRWeapon(hammerRedDwarf, "hammerRedDwarf"); + linkLOTRWeapon(daggerRedDwarf, "daggerRedDwarf"); + linkLOTRWeapon(daggerRedDwarfPoisoned, "daggerRedDwarfPoisoned"); + linkLOTRWeapon(crossbowRedDwarf, "crossbowRedDwarf"); + + // Limwaith + MATERIAL_LIMWAITH_BONE = getLOTRMaterialByName("LIMWAITH_BONE"); + MATERIAL_LIMWAITH_WOOD = getLOTRMaterialByName("LIMWAITH_WOOD"); + if (MATERIAL_LIMWAITH_WOOD != null && MATERIAL_LIMWAITH_BONE != null) { + helmetLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 0)).setUnlocalizedName("lotr:helmetLimwaith").setTextureName("lotr:helmetLimwaith"); + bodyLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 1)).setUnlocalizedName("lotr:bodyLimwaith").setTextureName("lotr:bodyLimwaith"); + legsLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 2)).setUnlocalizedName("lotr:legsLimwaith").setTextureName("lotr:legsLimwaith"); + bootsLimwaith = (new LOTRItemArmor(MATERIAL_LIMWAITH_WOOD, 3)).setUnlocalizedName("lotr:bootsLimwaith").setTextureName("lotr:bootsLimwaith"); + + spearLimwaith = (new LOTRItemSpear(MATERIAL_LIMWAITH_BONE)).setUnlocalizedName("lotr:spearLimwaith").setTextureName("lotr:spearLimwaith"); + truncheonLimwaith = (new LOTRItemSword(MATERIAL_LIMWAITH_BONE)).setUnlocalizedName("lotr:truncheonLimwaith").setTextureName("lotr:truncheonLimwaith"); + battleaxeLimwaith = (new LOTRItemBattleaxe(MATERIAL_LIMWAITH_BONE)).setUnlocalizedName("lotr:battleaxeLimwaith").setTextureName("lotr:battleaxeLimwaith"); + tridentLimwaith = (new LOTRItemTrident(MATERIAL_LIMWAITH_BONE)).setUnlocalizedName("lotr:tridentLimwaith").setTextureName("lotr:tridentLimwaith"); + daggerLimwaith = (new LOTRItemDagger(MATERIAL_LIMWAITH_BONE)).setUnlocalizedName("lotr:daggerLimwaith").setTextureName("lotr:daggerLimwaith"); + daggerLimwaithPoisoned = (new LOTRItemDagger(MATERIAL_LIMWAITH_BONE, LOTRItemDagger.DaggerEffect.POISON)).setUnlocalizedName("lotr:daggerLimwaithPoisoned").setTextureName("lotr:daggerLimwaithPoisoned"); + blowgunLimwaith = (new LOTRItemBlowgun(LOTRMaterial.TAUREDAIN)).setUnlocalizedName("lotr:blowgunLimwaith").setTextureName("lotr:blowgunLimwaith"); + + GameRegistry.registerItem(helmetLimwaith, "helmetLimwaith"); + GameRegistry.registerItem(bodyLimwaith, "bodyLimwaith"); + GameRegistry.registerItem(legsLimwaith, "legsLimwaith"); + GameRegistry.registerItem(bootsLimwaith, "bootsLimwaith"); + GameRegistry.registerItem(spearLimwaith, "spearLimwaith"); + GameRegistry.registerItem(tridentLimwaith, "tridentLimwaith"); + GameRegistry.registerItem(truncheonLimwaith, "truncheonLimwaith"); + GameRegistry.registerItem(battleaxeLimwaith, "battleaxeLimwaith"); + GameRegistry.registerItem(daggerLimwaith, "daggerLimwaith"); + GameRegistry.registerItem(daggerLimwaithPoisoned, "daggerLimwaithPoisoned"); + GameRegistry.registerItem(blowgunLimwaith, "blowgunLimwaith"); + } else { + System.err.println("Failed to find LIMWAITH material for armor initialization."); + } + linkLOTRWeapon(spearLimwaith, "spearLimwaith"); + linkLOTRWeapon(truncheonLimwaith, "truncheonLimwaith"); + linkLOTRWeapon(battleaxeLimwaith, "battleaxeLimwaith"); + linkLOTRWeapon(tridentLimwaith, "tridentLimwaith"); + linkLOTRWeapon(daggerLimwaith, "daggerLimwaith"); + linkLOTRWeapon(daggerLimwaithPoisoned, "daggerLimwaithPoisoned"); + linkLOTRWeapon(blowgunLimwaith, "blowgunLimwaith"); + + //Bree + MATERIAL_BREE = getLOTRMaterialByName("BREE"); + if (MATERIAL_BREE != null) { + helmetBree = (new LOTRItemArmor(MATERIAL_BREE, 0)).setUnlocalizedName("lotr:helmetBree").setTextureName("lotr:helmetBree"); + bodyBree = (new LOTRItemArmor(MATERIAL_BREE, 1)).setUnlocalizedName("lotr:bodyBree").setTextureName("lotr:bodyBree"); + legsBree = (new LOTRItemArmor(MATERIAL_BREE, 2)).setUnlocalizedName("lotr:legsBree").setTextureName("lotr:legsBree"); + bootsBree = (new LOTRItemArmor(MATERIAL_BREE, 3)).setUnlocalizedName("lotr:bootsBree").setTextureName("lotr:bootsBree"); + swordBree = (new LOTRItemSpear(MATERIAL_BREE)).setUnlocalizedName("lotr:swordBree").setTextureName("lotr:swordBree"); + + GameRegistry.registerItem(helmetBree, "helmetBree"); + GameRegistry.registerItem(bodyBree, "bodyBree"); + GameRegistry.registerItem(legsBree, "legsBree"); + GameRegistry.registerItem(bootsBree, "bootsBree"); + GameRegistry.registerItem(swordBree, "swordBree"); + } else { + System.err.println("Failed to find BREE material for armor initialization."); + } + linkLOTRWeapon(swordBree, "swordBree"); + + //Arnor + MATERIAL_BATTLENUN = getLOTRMaterialByName("BATTLENUN"); + if (MATERIAL_BATTLENUN != null) { + helmetArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 0)).setUnlocalizedName("lotr:helmetArnorBanner").setTextureName("lotr:helmetArnorBanner"); + bodyArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 1)).setUnlocalizedName("lotr:bodyArnorBanner").setTextureName("lotr:bodyArnorBanner"); + legsArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 2)).setUnlocalizedName("lotr:legsArnorBanner").setTextureName("lotr:legsArnorBanner"); + bootsArnorBanner = (new LOTRItemArmor(MATERIAL_BATTLENUN, 3)).setUnlocalizedName("lotr:bootsArnorBanner").setTextureName("lotr:bootsArnorBanner"); + maceArnor = (new LOTRItemHammer(LOTRMaterial.ARNOR)).setUnlocalizedName("lotr:maceArnor").setTextureName("lotr:maceArnor"); + + GameRegistry.registerItem(helmetArnorBanner, "helmetArnorBanner"); + GameRegistry.registerItem(bodyArnorBanner, "bodyArnorBanner"); + GameRegistry.registerItem(legsArnorBanner, "legsArnorBanner"); + GameRegistry.registerItem(bootsArnorBanner, "bootsArnorBanner"); + GameRegistry.registerItem(maceArnor, "maceArnor"); + } else { + System.err.println("Failed to find ARNOR material for armor initialization."); + } + linkLOTRWeapon(maceArnor, "maceArnor"); + } + + public static ModContainer getModContainer() { + return FMLCommonHandler.instance() + .findContainerFor(instance); + } + + public void linkLOTRWeapon(Item item, String weapon_name) { + try { + Field field = LOTRMod.class.getField(weapon_name); + field.set(null, item); + } catch (Exception e) { + System.err.println("[CinderLoE] linkLOTRWeapon: Failed to find field " + weapon_name + " in LOTRMod!"); + } + } + + public static class CommonProxy { + public void setup() { + } + } + + public static class ClientProxy extends CommonProxy { + @Override + public void setup() { + RenderingRegistry.registerEntityRenderingHandler(SarumanFireball.class, new RenderSarumanFireball()); + RenderingRegistry.registerEntityRenderingHandler(Renegade.class, new RenderRenegade()); + RenderingRegistry.registerEntityRenderingHandler(RenegadeCaptain.class, new RenderRenegade()); + RenderingRegistry.registerEntityRenderingHandler(Wraith.class, new RenderWraith()); + + RenderingRegistry.registerEntityRenderingHandler(RedDwarfWarrior.class, new LOTRRenderDwarf()); + RenderingRegistry.registerEntityRenderingHandler(RedDwarfArbalest.class, new LOTRRenderDwarf()); + RenderingRegistry.registerEntityRenderingHandler(RedDwarfBannerBearer.class, new LOTRRenderDwarf()); + RenderingRegistry.registerEntityRenderingHandler(RedDwarfCommander.class, new LOTRRenderDwarf()); + + RenderingRegistry.registerEntityRenderingHandler(LimwaithWarrior.class, new RenderLimwaith()); + RenderingRegistry.registerEntityRenderingHandler(LimwaithBlowgunner.class, new RenderLimwaith()); + RenderingRegistry.registerEntityRenderingHandler(LimwaithBannerBearer.class, new RenderLimwaith()); + RenderingRegistry.registerEntityRenderingHandler(LimwaithChieftain.class, new RenderLimwaith()); + + RenderingRegistry.registerEntityRenderingHandler(FangornBear.class, new RenderFangornBear()); + RenderingRegistry.registerEntityRenderingHandler(FangornWildBoar.class, new RenderFangornWildBoar()); + RenderingRegistry.registerEntityRenderingHandler(FangornAuroch.class, new RenderFangornAuroch()); + RenderingRegistry.registerEntityRenderingHandler(FangornElk.class, new RenderFangornElk()); + RenderingRegistry.registerEntityRenderingHandler(FangornWolf.class, new RenderFangornWolf()); + + RenderingRegistry.registerEntityRenderingHandler(ArnorSoldier.class, new LOTRRenderDunedain()); + RenderingRegistry.registerEntityRenderingHandler(ArnorSoldierArcher.class, new LOTRRenderDunedain()); + RenderingRegistry.registerEntityRenderingHandler(ArnorCaptain.class, new LOTRRenderDunedain()); + RenderingRegistry.registerEntityRenderingHandler(ArnorBannerBearer.class, new LOTRRenderDunedain()); + RenderingRegistry.registerEntityRenderingHandler(BattleNun.class, new RenderBattleNun()); + + RenderingRegistry.registerEntityRenderingHandler(BreeSoldier.class, new LOTRRenderBreeMan()); + RenderingRegistry.registerEntityRenderingHandler(BreeCrossbowman.class, new LOTRRenderBreeMan()); + RenderingRegistry.registerEntityRenderingHandler(BreeCaptain.class, new LOTRRenderBreeMan()); + RenderingRegistry.registerEntityRenderingHandler(BreeSoldierBannerBearer.class, new LOTRRenderBreeMan()); + RenderingRegistry.registerEntityRenderingHandler(BreeOutrider.class, new LOTRRenderBreeMan()); + + RenderingRegistry.registerEntityRenderingHandler(LOTREntitySauron.class, new LOTRRenderSauron()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMistBlock.class, (TileEntitySpecialRenderer)new LOTRRenderUtumnoPortal()); + } + } + + public static class ServerProxy extends CommonProxy { + @Override + public void setup() { + } + } + + public void modifySpawnLists() { + try { + // Retrieve the constructor of LOTRSpawnList class + Constructor constructor = LOTRSpawnList.class.getDeclaredConstructor(LOTRSpawnEntry[].class); + constructor.setAccessible(true); // Make the private constructor accessible + + // RED_DWARF is initialized earlier in this class + LOTRSpawnList RED_DWARF = constructor.newInstance((Object) new LOTRSpawnEntry[]{ + new LOTRSpawnEntry(LOTREntityDwarf.class, 100, 4, 4), + new LOTRSpawnEntry(LOTREntityDwarfMiner.class, 15, 1, 3), + new LOTRSpawnEntry(RedDwarfWarrior.class, 20, 4, 4), + new LOTRSpawnEntry(RedDwarfArbalest.class, 10, 4, 4) + }); + + LOTRSpawnList LIMWAITH = constructor.newInstance((Object) new LOTRSpawnEntry[]{ + new LOTRSpawnEntry(LimwaithWarrior.class, 100, 4, 4), + new LOTRSpawnEntry(LimwaithBlowgunner.class, 15, 1, 3) + }); + + + Field redDwarfField = LOTRSpawnList.class.getDeclaredField("RED_DWARF"); + redDwarfField.setAccessible(true); + redDwarfField.set(null, RED_DWARF); + + Field limwaithField = LOTRSpawnList.class.getDeclaredField("LIMWAITH"); + limwaithField.setAccessible(true); + limwaithField.set(null, LIMWAITH); + + + if (LOTRBiome.redMountains != null) { + LOTRBiome.redMountains.npcSpawnList.newFactionList(500) + .add(new LOTRBiomeSpawnList.SpawnListContainer[]{ + LOTRBiomeSpawnList.entry((LOTRSpawnList) redDwarfField.get(null), 10) + }); + } else { + System.out.println("Red Mountains biome is not available."); + } + if (LOTRBiome.farHaradMangrove != null) { + LOTRBiome.farHaradMangrove.npcSpawnList.newFactionList(500) + .add(new LOTRBiomeSpawnList.SpawnListContainer[]{ + LOTRBiomeSpawnList.entry((LOTRSpawnList) limwaithField.get(null), 10) + }); + } else { + System.out.println("Mangrove biome is not available."); + } + } catch (Exception e) { + System.err.println("[CinderLoE] linkLOTRWeapon: Failed to find field RED_DWARF in LOTRSpawnList!"); + } + } + + public static LOTRMaterial getLOTRMaterialByName(String materialName) { + try { + Field materialField = LOTRMaterial.class.getField(materialName); + return (LOTRMaterial) materialField.get(null); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + // Debug method + public static void printClass(String className) { + String resourcePath = "/" + className.replace('.', '/') + ".class"; + InputStream in = CinderLoE.class.getResourceAsStream(resourcePath); + if (in == null) { + System.out.println("Class resource not found: " + resourcePath); + return; + } + try { + ClassReader classReader = new ClassReader(in); + classReader.accept(new TraceClassVisitor(new PrintWriter(System.out)), 0); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + in.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + @SubscribeEvent + @SideOnly(Side.SERVER) + public void onWorldLoad(WorldEvent.Load event) { + CinderCore.registerItemFallback(Block.getIdFromBlock(cinderBlock), Block.getIdFromBlock(Blocks.netherrack), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(ivoryBlock), Block.getIdFromBlock(LOTRMod.boneBlock), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(blockRedDwarfSteel), Block.getIdFromBlock(LOTRMod.blockOreStorage), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(chandelierRedDwarf), Block.getIdFromBlock(LOTRMod.chandelier), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(barsRedDwarf), Block.getIdFromBlock(LOTRMod.dwarfBars), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(furBundle), Block.getIdFromBlock(Blocks.hay_block), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(leatherBundle), Block.getIdFromBlock(Blocks.hay_block), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(reedBale), Block.getIdFromBlock(Blocks.hay_block), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(dwarvenBrickRuned), Block.getIdFromBlock(LOTRMod.brick), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Block.getIdFromBlock(fishBarrel), Block.getIdFromBlock(LOTRMod.woodBeam1), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Block.getIdFromBlock(silverChain), Block.getIdFromBlock(LOTRMod.orcChain), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Block.getIdFromBlock(goldChain), Block.getIdFromBlock(LOTRMod.orcChain), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Block.getIdFromBlock(ironChain), Block.getIdFromBlock(LOTRMod.orcChain), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Block.getIdFromBlock(mistBlock), Block.getIdFromBlock(LOTRMod.utumnoPortal), "cinder_loe", "1.1"); + + CinderCore.registerItemFallback(Item.getIdFromItem(redDwarfSteel), Item.getIdFromItem(LOTRMod.dwarfSteel), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(spearRedDwarf), Item.getIdFromItem(LOTRMod.spearDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(swordRedDwarf), Item.getIdFromItem(LOTRMod.swordDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(battleaxeRedDwarf), Item.getIdFromItem(LOTRMod.battleaxeDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(pikeRedDwarf), Item.getIdFromItem(LOTRMod.pikeDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(hammerRedDwarf), Item.getIdFromItem(LOTRMod.hammerDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(daggerRedDwarf), Item.getIdFromItem(LOTRMod.daggerDwarven), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(daggerRedDwarfPoisoned), Item.getIdFromItem(LOTRMod.daggerDwarvenPoisoned), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(helmetRedDwarf), Item.getIdFromItem(LOTRMod.helmetDwarvenGold), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(bodyRedDwarf), Item.getIdFromItem(LOTRMod.bodyDwarvenGold), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(legsRedDwarf), Item.getIdFromItem(LOTRMod.legsDwarvenGold), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(bootsRedDwarf), Item.getIdFromItem(LOTRMod.bootsDwarvenGold), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(crossbowRedDwarf), Item.getIdFromItem(LOTRMod.ironCrossbow), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(boarArmorRedDwarf), Item.getIdFromItem(LOTRMod.boarArmorDwarven), "cinder_loe", "1.0"); + + CinderCore.registerItemFallback(Item.getIdFromItem(radagastStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(pallandoStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(alatarStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(sarumanStaff), Item.getIdFromItem(LOTRMod.gandalfStaffWhite), "cinder_loe", "1.0"); + + CinderCore.registerItemFallback(Item.getIdFromItem(frostblade), Item.getIdFromItem(LOTRMod.swordMithril), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(spearsolidgold), Item.getIdFromItem(LOTRMod.spearMithril), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(whip), Item.getIdFromItem(LOTRMod.balrogWhip), "cinder_loe", "1.2"); + + CinderCore.registerItemFallback(Item.getIdFromItem(fangornBearSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(fangornAurochSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(fangornWildBoarSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(fangornElkSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(redDwarfWarriorSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(redDwarfArbalestSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(redDwarfCommanderSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(redDwarfBannerBearerSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(limwaithWarriorSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(limwaithBlowgunnerSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(limwaithBannerBearerSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(limwaithChieftainSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(renegadeSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(renegadeCaptainSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(wraithSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(ArnorSoldierSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(ArnorSoldierArcherSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(ArnorCaptainSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(ArnorBannerBearerSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(battleNunSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(BreeSoldierSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(BreeCrossbowmanSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(BreeCaptainSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(BreeSoldierBannerBearerSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(BreeOutriderSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(SauronSpawnEgg), Item.getIdFromItem(Items.spawn_egg), "cinder_loe", "1.1"); + + CinderCore.registerItemFallback(Item.getIdFromItem(helmetLimwaith), Item.getIdFromItem(LOTRMod.helmetMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(bodyLimwaith), Item.getIdFromItem(LOTRMod.bodyMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(legsLimwaith), Item.getIdFromItem(LOTRMod.legsMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(bootsLimwaith), Item.getIdFromItem(LOTRMod.bootsMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(spearLimwaith), Item.getIdFromItem(LOTRMod.spearMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(tridentLimwaith), Item.getIdFromItem(LOTRMod.dunlendingTrident), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(truncheonLimwaith), Item.getIdFromItem(LOTRMod.swordMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(battleaxeLimwaith), Item.getIdFromItem(LOTRMod.battleaxeMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(daggerLimwaith), Item.getIdFromItem(LOTRMod.daggerMoredain), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(daggerLimwaithPoisoned), Item.getIdFromItem(LOTRMod.daggerMoredainPoisoned), "cinder_loe", "1.0"); + CinderCore.registerItemFallback(Item.getIdFromItem(blowgunLimwaith), Item.getIdFromItem(LOTRMod.tauredainBlowgun), "cinder_loe", "1.0"); + + CinderCore.registerItemFallback(Item.getIdFromItem(helmetBree), Item.getIdFromItem(Items.iron_helmet), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(bodyBree), Item.getIdFromItem(Items.chainmail_chestplate), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(legsBree), Item.getIdFromItem(Items.chainmail_leggings), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(bootsBree), Item.getIdFromItem(Items.iron_boots), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(swordBree), Item.getIdFromItem(Items.iron_sword), "cinder_loe", "1.1"); + + CinderCore.registerItemFallback(Item.getIdFromItem(helmetArnorBanner), Item.getIdFromItem(Items.chainmail_helmet), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(bodyArnorBanner), Item.getIdFromItem(Items.chainmail_chestplate), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(legsArnorBanner), Item.getIdFromItem(Items.chainmail_leggings), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(bootsArnorBanner), Item.getIdFromItem(Items.chainmail_boots), "cinder_loe", "1.1"); + CinderCore.registerItemFallback(Item.getIdFromItem(maceArnor), Item.getIdFromItem(LOTRMod.blacksmithHammer), "cinder_loe", "1.1"); + + CinderCore.registerEntityFallback(SarumanFireball.class, LOTREntityGandalfFireball.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(Renegade.class, LOTREntityBandit.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(RenegadeCaptain.class, LOTREntityBandit.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(Wraith.class, LOTREntityMarshWraith.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(LOTREntitySauron.class, LOTREntityBarrowWight.class, "cinder_loe", "1.1"); + + CinderCore.registerEntityFallback(RedDwarfWarrior.class, LOTREntityDwarfWarrior.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(RedDwarfArbalest.class, LOTREntityDwarfAxeThrower.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(RedDwarfBannerBearer.class, LOTREntityDwarfBannerBearer.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(RedDwarfCommander.class, LOTREntityDwarfCommander.class, "cinder_loe", "1.0"); + + CinderCore.registerEntityFallback(LimwaithWarrior.class, LOTREntityMoredain.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(LimwaithBlowgunner.class, LOTREntityMoredain.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(LimwaithBannerBearer.class, LOTREntityMoredainBannerBearer.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(LimwaithChieftain.class, LOTREntityMoredainChieftain.class, "cinder_loe", "1.0"); + + CinderCore.registerEntityFallback(FangornBear.class, LOTREntityBear.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(FangornWildBoar.class, LOTREntityWildBoar.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(FangornAuroch.class, LOTREntityAurochs.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(FangornElk.class, LOTREntityElk.class, "cinder_loe", "1.0"); + CinderCore.registerEntityFallback(FangornWolf.class, EntityWolf.class, "cinder_loe", "1.0"); + + CinderCore.registerEntityFallback(ArnorSoldier.class, LOTREntityDunedain.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(ArnorSoldierArcher.class, LOTREntityDunedain.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(ArnorCaptain.class, LOTREntityDunedain.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(ArnorBannerBearer.class, LOTREntityDunedain.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(BattleNun.class, LOTREntityDunedain.class, "cinder_loe", "1.1"); + + CinderCore.registerEntityFallback(BreeSoldier.class, LOTREntityBreeMan.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(BreeCrossbowman.class, LOTREntityBreeMan.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(BreeCaptain.class, LOTREntityBreeMan.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(BreeSoldierBannerBearer.class, LOTREntityBreeMan.class, "cinder_loe", "1.1"); + CinderCore.registerEntityFallback(BreeOutrider.class, LOTREntityBreeMan.class, "cinder_loe", "1.1"); + } + + // Create unit trade entries here, out of the way of important code + public void setupTradeEntries() { + RED_DWARF_COMMANDER = new LOTRUnitTradeEntries(200.0F, new LOTRUnitTradeEntry[]{ + new LOTRUnitTradeEntry(LOTREntityDwarf.class, 20, 0.0F), + (new LOTRUnitTradeEntry(RedDwarfWarrior.class, 30, 50.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.ANY_DWARF), + (new LOTRUnitTradeEntry(RedDwarfArbalest.class, 50, 100.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.ANY_DWARF), + (new LOTRUnitTradeEntry(RedDwarfWarrior.class, LOTREntityWildBoar.class, "RedDwarfWarrior_Boar", 50, 150.0F)).setMountArmor(boarArmorRedDwarf).setPledgeType(LOTRUnitTradeEntry.PledgeType.ANY_DWARF), + (new LOTRUnitTradeEntry(RedDwarfArbalest.class, LOTREntityWildBoar.class, "RedDwarfArbalest_Boar", 70, 200.0F)).setMountArmor(boarArmorRedDwarf).setPledgeType(LOTRUnitTradeEntry.PledgeType.ANY_DWARF), + (new LOTRUnitTradeEntry(RedDwarfBannerBearer.class, 50, 200.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.ANY_DWARF) }); + + LIMWAITH_COMMANDER = new LOTRUnitTradeEntries(200.0F, new LOTRUnitTradeEntry[]{ + new LOTRUnitTradeEntry(LimwaithWarrior.class, 30, 50.0F), + (new LOTRUnitTradeEntry(LimwaithBlowgunner.class, 50, 100.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(LimwaithBannerBearer.class, 50, 200.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION) }); + + ARNOR_CAPTAIN = new LOTRUnitTradeEntries(200.0F, new LOTRUnitTradeEntry[]{ + (new LOTRUnitTradeEntry(ArnorSoldier.class, 60, 250.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(ArnorSoldierArcher.class, 100, 300.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(ArnorSoldier.class, LOTREntityHorse.class, "Arnor_Horse", 100, 150.0F)).setMountArmor(horseArmorIron).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(ArnorSoldierArcher.class, LOTREntityHorse.class, "Arnor_Horse", 140, 200.0F)).setMountArmor(horseArmorIron).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(LOTREntityRangerNorth.class, 50, 0.0f)), + (new LOTRUnitTradeEntry(LOTREntityRangerNorth.class, LOTREntityHorse.class, "RangerNorth_Horse", 70, 100.0f)), + (new LOTRUnitTradeEntry(LOTREntityRangerNorthBannerBearer.class, 70, 150.0f)), + (new LOTRUnitTradeEntry(ArnorBannerBearer.class, 100, 400.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION) }); + + BREE_CAPTAIN = new LOTRUnitTradeEntries(150.0F, new LOTRUnitTradeEntry[]{ + (new LOTRUnitTradeEntry(LOTREntityBreeGuard.class, 20, 0.0f)), + (new LOTRUnitTradeEntry(BreeSoldier.class, 60, 250.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(BreeCrossbowman.class, 100, 300.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(BreeOutrider.class, LOTREntityHorse.class, "Bree_Horse", 150, 400.0F)).setMountArmor(horseArmorIron).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION), + (new LOTRUnitTradeEntry(LOTREntityBreeBannerBearer.class, 40, 150.0f)), + (new LOTRUnitTradeEntry(BreeSoldierBannerBearer.class, 100, 400.0F)).setPledgeType(LOTRUnitTradeEntry.PledgeType.FACTION) }); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java b/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java new file mode 100644 index 0000000..23c6693 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/CinderLoE_Config.java @@ -0,0 +1,38 @@ +package com.zivilon.cinder_loe; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +public class CinderLoE_Config { + public static Configuration config; + public static float enchantment_color_red; + public static float enchantment_color_green; + public static float enchantment_color_blue; + + public static void init(FMLPreInitializationEvent event) { + File configFile = new File(event.getModConfigurationDirectory(), "CinderLoE.cfg"); + config = new Configuration(configFile); + syncConfig(); + } + + public static void syncConfig() { + try { + // Load the configuration file + config.load(); + + // Read properties, define categories and keys + enchantment_color_red = config.getFloat("EnchantmentColorRed", Configuration.CATEGORY_GENERAL, 0.38f, 0.0f, 1.0f, "Configure red color for enchantments"); + enchantment_color_green = config.getFloat("EnchantmentColorGreen", Configuration.CATEGORY_GENERAL, 0.19f, 0.0f, 1.0f, "Configure green color for enchantments"); + enchantment_color_blue = config.getFloat("EnchantmentColorBlue", Configuration.CATEGORY_GENERAL, 0.608f, 0.0f, 1.0f, "Configure blue color for enchantments"); + + // Save the configuration if it has changed + if (config.hasChanged()) { + config.save(); + } + } catch (Exception e) { + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/Materials.java b/src/main/java/com/zivilon/cinder_loe/Materials.java new file mode 100644 index 0000000..3aa2963 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/Materials.java @@ -0,0 +1,67 @@ +package com.zivilon.cinder_loe; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; + +import lotr.common.item.LOTRMaterial; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Field; + +import com.zivilon.cinder_loe.CinderLoE; + +public class Materials { + public static void registerMaterials() { + modifyMaterial("RED_DWARF", 700, 3.0F, 0.7F, 3, 7.0F, 10, CinderLoE.redDwarfSteel); + modifyMaterial("WIZARD", 1000, 3.0F, 0.7F, 3, 7.0F, 10, null); + modifyMaterial("LIMWAITH_BONE", 250, 2.0F, 0.7F, 2, 6.0F, 10, null); + modifyMaterial("LIMWAITH_WOOD", 230, 1.5F, 0.5F, 2, 5.0F, 10, null); + modifyMaterial("EVENT", 2400, 5.0F, 0.0F, 0, 9.0F, 10, null); + modifyMaterial("BREE", 350, 2.5F, 0.6F, 2, 6.0F, 10, Items.iron_ingot); + modifyMaterial("BATTLENUN", 300, 3F, 0.6F, 2, 6.0F, 10, Items.iron_ingot); + } + + public static void modifyMaterial(String fieldName, int uses, float weapon_damage, float protection, int harvest_level, float speed, int enchantability, Item crafting_item) { + try { + Class lotrMaterialClass = Class.forName("lotr.common.item.LOTRMaterial"); + Field materialField = lotrMaterialClass.getField(fieldName); + + // Reflection to access and instantiate the private constructor of LOTRMaterial + Constructor constructor = lotrMaterialClass.getDeclaredConstructor(String.class); + constructor.setAccessible(true); + Object materialLocal = constructor.newInstance(fieldName); + + // Reflection to call the private methods on the new instance + Method setUses = lotrMaterialClass.getDeclaredMethod("setUses", int.class); + Method setDamage = lotrMaterialClass.getDeclaredMethod("setDamage", float.class); + Method setProtection = lotrMaterialClass.getDeclaredMethod("setProtection", float.class); + Method setHarvestLevel = lotrMaterialClass.getDeclaredMethod("setHarvestLevel", int.class); + Method setSpeed = lotrMaterialClass.getDeclaredMethod("setSpeed", float.class); + Method setEnchantability = lotrMaterialClass.getDeclaredMethod("setEnchantability", int.class); + Method setCraftingItem = lotrMaterialClass.getDeclaredMethod("setCraftingItem", Item.class); + + setUses.setAccessible(true); + setDamage.setAccessible(true); + setProtection.setAccessible(true); + setHarvestLevel.setAccessible(true); + setSpeed.setAccessible(true); + setEnchantability.setAccessible(true); + setCraftingItem.setAccessible(true); + + setUses.invoke(materialLocal, uses); + setDamage.invoke(materialLocal, weapon_damage); + setProtection.invoke(materialLocal, protection); + setHarvestLevel.invoke(materialLocal, harvest_level); + setSpeed.invoke(materialLocal, speed); + setEnchantability.invoke(materialLocal, enchantability); + if (crafting_item != null) { + setCraftingItem.invoke(materialLocal, crafting_item); + } + + materialField.set(null, materialLocal); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java b/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java new file mode 100644 index 0000000..0dab051 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/BarsBase.java @@ -0,0 +1,51 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.BlockPane; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +import lotr.common.LOTRCreativeTabs; +import lotr.common.block.LOTRBlockOrcChain; +import lotr.common.block.LOTRBlockPane; + +import com.zivilon.cinder_loe.util.Utilities; + +public abstract class BarsBase extends BlockPane { + public String textureName; + protected IIcon icon; + + public BarsBase(String blockName) { + super("", "", Material.iron, true); + this.textureName = Utilities.toSnakeCase(blockName); + this.setBlockName(blockName); + setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco); + setHardness(5.0F); + setResistance(10.0F); + setStepSound(Block.soundTypeMetal); + } + + public void registerBlockIcons(IIconRegister iconregister) { + this.icon = iconregister.registerIcon(textureName); + System.out.println("Registering texture " + textureName); + } + + public IIcon getIcon() { + return this.icon; + } + + public IIcon getIcon(int i, int j) { + return this.icon; + } + + public IIcon func_150097_e() { + return this.icon; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java b/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java new file mode 100644 index 0000000..3715765 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/BlockRedDwarfSteel.java @@ -0,0 +1,37 @@ +package com.zivilon.cinder_loe.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; + +import lotr.common.LOTRCreativeTabs; + +import java.lang.reflect.Field; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockRedDwarfSteel extends Block { + + public BlockRedDwarfSteel() { + super(Material.iron); // Choose the appropriate material + try { + Field tabField = LOTRCreativeTabs.class.getDeclaredField("tabBlock"); // Stupid workaround because ForgeGradle tries to obfuscate field LOTRCreativeTabs.tabBlock when it's not supposed to + LOTRCreativeTabs tab = (LOTRCreativeTabs)tabField.get(null); + setCreativeTab((CreativeTabs)tab); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + setHardness(5.0F); + setResistance(15.0F); + setStepSound(Block.soundTypeMetal); + setBlockTextureName("lotr:red_dwarf_steel"); + setBlockName("lotr:blockRedDwarfSteel"); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon("lotr:red_dwarf_steel"); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java b/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java new file mode 100644 index 0000000..1f345e5 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/ChandelierBase.java @@ -0,0 +1,105 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.util.ForgeDirection; + +import lotr.common.LOTRCreativeTabs; +import lotr.common.block.LOTRBlockOrcChain; + +import com.zivilon.cinder_loe.util.Utilities; + +public abstract class ChandelierBase extends Block { + public String textureName; + public IIcon icon; + + public ChandelierBase(String blockName) { + super(Material.circuits); + this.textureName = Utilities.toSnakeCase(blockName); + this.setBlockName(blockName); + setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabDeco); + setHardness(0.0F); + setResistance(2.0F); + setStepSound(Block.soundTypeMetal); + setLightLevel(0.9375F); + setBlockBounds(0.0625F, 0.1875F, 0.0625F, 0.9375F, 1.0F, 0.9375F); + } + + public IIcon getIcon(int i, int j) { + return this.icon; + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + icon = reg.registerIcon(this.textureName); + } + + public boolean isOpaqueCube() { + return false; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public int getRenderType() { + return 1; + } + + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { + return null; + } + + public boolean canBlockStay(World world, int i, int j, int k) { + Block block = world.getBlock(i, j + 1, k); + int meta = world.getBlockMetadata(i, j + 1, k); + if (block instanceof net.minecraft.block.BlockFence || block instanceof net.minecraft.block.BlockWall) + return true; + if (block instanceof net.minecraft.block.BlockSlab && !block.isOpaqueCube() && (meta & 0x8) == 0) + return true; + if (block instanceof net.minecraft.block.BlockStairs && (meta & 0x4) == 0) + return true; + if (block instanceof LOTRBlockOrcChain) + return true; + return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN); + } + + public boolean canPlaceBlockAt(World world, int i, int j, int k) { + return canBlockStay(world, i, j, k); + } + + public void onNeighborBlockChange(World world, int i, int j, int k, Block block) { + if (!canBlockStay(world, i, j, k)) { + dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0); + world.setBlockToAir(i, j, k); + } + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World world, int i, int j, int k, Random random) { + double d = 0.13D; + double d1 = 1.0D - d; + double d2 = 0.6875D; + spawnChandelierParticles(world, i + d, j + d2, k + d); + spawnChandelierParticles(world, i + d1, j + d2, k + d1); + spawnChandelierParticles(world, i + d, j + d2, k + d1); + spawnChandelierParticles(world, i + d1, j + d2, k + d); + } + + private void spawnChandelierParticles(World world, double d, double d1, double d2) { + world.spawnParticle("smoke", d, d1, d2, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", d, d1, d2, 0.0D, 0.0D, 0.0D); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/CinderBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/CinderBlock.java new file mode 100644 index 0000000..202e3cc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/CinderBlock.java @@ -0,0 +1,32 @@ +package com.zivilon.cinder_loe.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class CinderBlock extends Block { + + public CinderBlock() { + super(Material.rock); + setHardness(2.0F); + setResistance(5.0F); + setBlockTextureName("lotr:cinder_block"); + setBlockName("lotr:cinderBlock"); + setLightLevel(0.25F); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon("lotr:cinder_block"); + } + + @Override + public void onEntityWalking(World world, int x, int y, int z, Entity entity) { + entity.setFire(20); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java b/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java new file mode 100644 index 0000000..5a385fc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/FishBarrel.java @@ -0,0 +1,23 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.LOTRCreativeTabs; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.util.IIcon; + +import java.lang.reflect.Field; + +public class FishBarrel extends StaticBlockBase3 { + + public FishBarrel() { + super(Material.wood, "lotr:fishbarrel"); + setStepSound(Block.soundTypeWood); + setBlockName("lotr:fishbarrel"); + setHardness(1.0F); + setResistance(2.0F); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java b/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java new file mode 100644 index 0000000..a8e9a49 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/FurBundle.java @@ -0,0 +1,16 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; +import net.minecraft.block.Block; + +import net.minecraft.block.material.Material; + +public class FurBundle extends RotatableBlockBase3 { + public FurBundle() { + super(Material.cloth, "lotr:furBundle"); + setStepSound(Block.soundTypeCloth); + setBlockName("lotr:furBundle"); + setHardness(0.5F); + setResistance(0.5F); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/IvoryBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/IvoryBlock.java new file mode 100644 index 0000000..3fa59d1 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/IvoryBlock.java @@ -0,0 +1,17 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.blocks.RotatableBlockBase2; +import net.minecraft.block.Block; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; + +public class IvoryBlock extends RotatableBlockBase2 { + public IvoryBlock() { + super(Material.rock, "lotr:ivoryBlock"); + setStepSound(Block.soundTypeStone); + setBlockName("lotr:ivoryBlock"); + setHardness(1.0F); + setResistance(5.0F); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java b/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java new file mode 100644 index 0000000..d72a61e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/LeatherBundle.java @@ -0,0 +1,16 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; +import net.minecraft.block.Block; + +import net.minecraft.block.material.Material; + +public class LeatherBundle extends RotatableBlockBase3 { + public LeatherBundle() { + super(Material.cloth, "lotr:leatherBundle"); + setStepSound(Block.soundTypeCloth); + setBlockName("lotr:leatherBundle"); + setHardness(0.5F); + setResistance(0.5F); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/MistBlock.java b/src/main/java/com/zivilon/cinder_loe/blocks/MistBlock.java new file mode 100644 index 0000000..80fe590 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/MistBlock.java @@ -0,0 +1,56 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; +import java.util.Random; + +import lotr.common.LOTRDimension; +import lotr.common.block.LOTRBlockUtumnoPortal; +import lotr.common.tileentity.LOTRTileEntityUtumnoPortal; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import com.zivilon.cinder_loe.tileentity.TileEntityMistBlock; + +public class MistBlock extends LOTRBlockUtumnoPortal { + public float color_red; + public float color_green; + public float color_blue; + public MistBlock() { + super(); + color_red = 0.0F; + color_green = 0.0F; + color_blue = 0.0F; + setBlockTextureName("lotr:mist_block"); + setBlockName("lotr:mistBlock"); + } + public MistBlock(float r, float g, float b) { + super(); + color_red = r; + color_green = g; + color_blue = b; + setHardness(-1.0F); + setResistance(Float.MAX_VALUE); + setBlockTextureName("lotr:mist_block"); + setBlockName("lotr:mistBlock"); + } + + public TileEntity createNewTileEntity(World world, int i) { + return (TileEntity)new TileEntityMistBlock(color_red, color_green, color_blue); + } + + @Override + public void func_149670_a(World world, int i, int j, int k, Entity entity) {} + +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfBars.java b/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfBars.java new file mode 100644 index 0000000..1a34f73 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfBars.java @@ -0,0 +1,12 @@ +package com.zivilon.cinder_loe.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +import com.zivilon.cinder_loe.blocks.BarsBase; + +public class RedDwarfBars extends BarsBase { + public RedDwarfBars() { + super("lotr:barsRedDwarf"); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.java b/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.java new file mode 100644 index 0000000..d28ef08 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RedDwarfChandelier.java @@ -0,0 +1,12 @@ +package com.zivilon.cinder_loe.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +import com.zivilon.cinder_loe.blocks.ChandelierBase; + +public class RedDwarfChandelier extends ChandelierBase { + public RedDwarfChandelier() { + super("lotr:chandelierRedDwarf"); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java b/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java new file mode 100644 index 0000000..fb0f1f2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/ReedBale.java @@ -0,0 +1,16 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.blocks.RotatableBlockBase3; +import net.minecraft.block.Block; + +import net.minecraft.block.material.Material; + +public class ReedBale extends RotatableBlockBase3 { + public ReedBale() { + super(Material.grass, "lotr:reedBale"); + setStepSound(Block.soundTypeGrass); + setBlockName("lotr:reedBale"); + setHardness(0.5F); + setResistance(0.5F); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.java b/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.java new file mode 100644 index 0000000..9e64596 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase2.java @@ -0,0 +1,88 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.util.Utilities; + +public abstract class RotatableBlockBase2 extends BlockRotatedPillar { + public String textureName; + public IIcon[] icons = new IIcon[3]; + + public RotatableBlockBase2(Material material, String blockName) { + super(material); + this.textureName = Utilities.toSnakeCase(blockName); + this.setBlockName(blockName); + // Get LOTRCreativeTabs.tabBlock without ForgeGradle incorrectly obfuscating it. Uses cached field, not real-time reflection + this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block); + } + + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) { + int orientation = 0; + switch (side) { + case 0: // Bottom + case 1: // Top + orientation = 0; + break; + case 2: // North + case 3: // South + orientation = 1; + break; + case 4: // West + case 5: // East + orientation = 2; + break; + } + + return orientation; + } + + public int damageDropped(int i) { + return 0; + } + + + @Override + public IIcon getIcon(int side, int meta) { + switch(meta) { + case 0: // Facing up + if(side == 0 || side == 1) return this.icons[0]; + else return this.icons[1]; + case 1: // Facing North-South + if(side == 2 || side == 3) return this.icons[0]; + if(side == 4 || side == 5) return this.icons[2]; + else return this.icons[1]; + case 2: // Facing East-West + if(side == 4 || side == 5) return this.icons[0]; + else return this.icons[2]; + case 3: // Uniform block + return this.icons[1]; + } + + return this.blockIcon; // Default case, should not happen + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + icons[0] = reg.registerIcon(this.textureName + "_top"); + icons[1] = reg.registerIcon(this.textureName + "_side_0"); + icons[2] = reg.registerIcon(this.textureName + "_side_90"); + } + + @SideOnly(Side.CLIENT) + protected IIcon getSideIcon(int i) { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.java b/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.java new file mode 100644 index 0000000..9dac237 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RotatableBlockBase3.java @@ -0,0 +1,165 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.texture.IIconRegister; +import lotr.common.LOTRCreativeTabs; +import net.minecraft.creativetab.CreativeTabs; + +import com.zivilon.cinder_loe.util.Utilities; + +public abstract class RotatableBlockBase3 extends BlockRotatedPillar { + public String textureName; + public IIcon[] icons = new IIcon[6]; + + public RotatableBlockBase3(Material material, String blockName) { + super(material); + this.textureName = Utilities.toSnakeCase(blockName); + this.setBlockName(blockName); + // Get LOTRCreativeTabs.tabBlock without ForgeGradle incorrectly obfuscating it. Uses cached field, not real-time reflection + this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block); + +/* Examples for block properties + this.setHardness(2.0F); // How long it takes to break the block + this.setResistance(10.0F); // Explosion resistance + this.setStepSound(soundTypePiston); // The sound made when walking on the block + this.setLightLevel(0.5F); // Light emitted by the block, 0.0 - 1.0 + this.setLightOpacity(255); // How much light is blocked, 0 - 255 + this.setBlockName("exampleBlock"); // The unique name of the block + this.setBlockTextureName("modid:exampleBlock"); // Texture for the block + this.setCreativeTab(CreativeTabs.tabBlock); // The creative tab it appears in +*/ + } + + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) { + // Default orientation (meta 0) + int orientation = 0; + + // Determine orientation based on the side of the block the player is placing against + switch (side) { + case 0: // Bottom + orientation = 5; // Unique orientation for bottom + break; + case 1: // Top + orientation = 0; // Default vertical orientation + break; + case 2: // North + orientation = 1; // North-South horizontal + break; + case 3: // South + orientation = 2; // South-North horizontal + break; + case 4: // West + orientation = 3; // West-East horizontal + break; + case 5: // East + orientation = 4; // East-West horizontal + break; + } + + return orientation; + } + + public int damageDropped(int i) { + return 0; + } + + + @Override + public IIcon getIcon(int side, int meta) { + switch(meta) { + case 0: // Facing up + if(side == 0) return this.icons[0]; + else if(side == 1) return this.icons[1]; + else return this.icons[2]; + case 1: // Facing North + if(side == 0) return this.icons[2]; + else if(side == 1) return this.icons[2]; + else if(side == 2) return this.icons[1]; + else if(side == 3) return this.icons[0]; + else if(side == 4) return this.icons[5]; + else if(side == 5) return this.icons[3]; + case 2: // Facing South + if(side == 0) return this.icons[4]; + else if(side == 1) return this.icons[4]; + else if(side == 2) return this.icons[0]; + else if(side == 3) return this.icons[1]; + else if(side == 4) return this.icons[3]; + else if(side == 5) return this.icons[5]; + case 3: // Facing West + if(side == 0) return this.icons[5]; + else if(side == 1) return this.icons[5]; + else if(side == 2) return this.icons[3]; + else if(side == 3) return this.icons[5]; + else if(side == 4) return this.icons[1]; + else if(side == 5) return this.icons[0]; + case 4: // Facing East + if(side == 4) return this.icons[0]; + else if(side == 5) return this.icons[1]; + else return this.icons[2]; + case 5: // Facing down + if(side == 0) return this.icons[1]; + else if(side == 1) return this.icons[0]; + else if (side == 2) return this.icons[3]; + else if (side == 3) return this.icons[3]; + else return this.icons[4]; + } + + return this.blockIcon; + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + icons[0] = reg.registerIcon(this.textureName + "_bottom"); + icons[1] = reg.registerIcon(this.textureName + "_top"); + icons[2] = reg.registerIcon(this.textureName + "_side_0"); + icons[3] = reg.registerIcon(this.textureName + "_side_90"); + icons[4] = reg.registerIcon(this.textureName + "_side_180"); + icons[5] = reg.registerIcon(this.textureName + "_side_270"); + } + + @SideOnly(Side.CLIENT) + protected IIcon getSideIcon(int i) { + return null; + } +} + + +/* Example method overrides for blocks + @Override + public void onBlockAdded(World world, int x, int y, int z) { + // Called when the block is placed in the world + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int metadata) { + // Called when the block is broken + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + // Called when the player right-clicks the block + return true; + } + + @Override + public void onEntityWalking(World world, int x, int y, int z, Entity entity) { + // Called when an entity walks over the block + } + + @Override + public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) { + // Determines the redstone power output + return 15; + } +*/ \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java b/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java new file mode 100644 index 0000000..ec033d7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/RunedDwarvenBrick.java @@ -0,0 +1,31 @@ +package com.zivilon.cinder_loe.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import com.zivilon.cinder_loe.util.Utilities; + +public class RunedDwarvenBrick extends Block { + + public RunedDwarvenBrick() { + super(Material.rock); // Choose the appropriate material + // Set other properties like hardness, resistance, name, etc. + setHardness(2.0F); + setResistance(5.0F); + setBlockTextureName(Utilities.toSnakeCase("lotr:dwarven_brick_runed")); + setBlockName("lotr:dwarvenBrickRuned"); + setCreativeTab((CreativeTabs)Utilities.reflected_tab_block); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon("lotr:dwarven_brick_runed"); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/StaticBlockBase3.java b/src/main/java/com/zivilon/cinder_loe/blocks/StaticBlockBase3.java new file mode 100644 index 0000000..821147c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/StaticBlockBase3.java @@ -0,0 +1,55 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.material.Material; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.IIcon; +import net.minecraft.client.renderer.texture.IIconRegister; +import lotr.common.LOTRCreativeTabs; +import net.minecraft.creativetab.CreativeTabs; + +import com.zivilon.cinder_loe.util.Utilities; + +public abstract class StaticBlockBase3 extends Block { + public String textureName; + public IIcon[] icons = new IIcon[3]; + + public StaticBlockBase3(Material material, String blockName) { + super(material); + this.textureName = Utilities.toSnakeCase(blockName); + this.setBlockName(blockName); + this.setCreativeTab((CreativeTabs)Utilities.reflected_tab_block); + } + + @Override + public IIcon getIcon(int side, int meta) { + switch(side) { + case 0: // Facing down + return this.icons[0]; + case 1: // Facing up + return this.icons[1]; + case 2: // Facing North + case 3: // Facing South + case 4: // Facing West + case 5: // Facing East + return this.icons[2]; + } + + return this.blockIcon; + } + + @Override + public void registerBlockIcons(IIconRegister reg) { + icons[0] = reg.registerIcon(this.textureName + "_bottom"); + icons[1] = reg.registerIcon(this.textureName + "_top"); + icons[2] = reg.registerIcon(this.textureName + "_side"); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/goldChain.java b/src/main/java/com/zivilon/cinder_loe/blocks/goldChain.java new file mode 100644 index 0000000..b4498f1 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/goldChain.java @@ -0,0 +1,121 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.block.LOTRBlockChandelier; +import lotr.common.block.LOTRBlockOrcChain; +import net.minecraft.block.*; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class goldChain + extends LOTRBlockOrcChain { + + public IIcon icon; + @SideOnly(value= Side.CLIENT) + private IIcon iconMiddle; + @SideOnly(value=Side.CLIENT) + private IIcon iconTop; + @SideOnly(value=Side.CLIENT) + private IIcon iconBottom; + @SideOnly(value=Side.CLIENT) + private IIcon iconSingle; + + public goldChain() { + this.setHardness(1.0f); + this.setStepSound(Block.soundTypeMetal); + this.textureName = "lotr:goldChain"; + setBlockName("lotr:goldChain"); + setBlockTextureName("lotr:goldChain"); + float f = 0.2f; + this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f); + } + + @SideOnly(value=Side.CLIENT) + public void registerBlockIcons(IIconRegister iconregister) { + this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid"); + this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top"); + this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom"); + this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single"); + this.blockIcon = iconregister.registerIcon(this.getTextureName()); + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) { + boolean chainBelow; + Block above = world.getBlock(i, j + 1, k); + Block below = world.getBlock(i, j - 1, k); + boolean chainAbove = above instanceof goldChain; + boolean bl = chainBelow = below instanceof goldChain || below instanceof LOTRBlockChandelier; + if (chainAbove && chainBelow) { + return this.iconMiddle; + } + if (chainAbove) { + return this.iconBottom; + } + if (chainBelow) { + return this.iconTop; + } + return this.iconSingle; + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(int i, int j) { + return this.iconMiddle; + } + + @SideOnly(value=Side.CLIENT) + public String getItemIconName() { + return this.getTextureName(); + } + + public boolean canPlaceBlockAt(World world, int i, int j, int k) { + Block block = world.getBlock(i, j + 1, k); + int meta = world.getBlockMetadata(i, j + 1, k); + if (block instanceof goldChain) { + return true; + } + if (block instanceof BlockFence || block instanceof BlockWall) { + return true; + } + if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) { + return true; + } + if (block instanceof BlockStairs && (meta & 4) == 0) { + return true; + } + return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN); + } + + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) { + Block block; + int j1; + for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) { + } + if (j1 >= 0 && j1 < world.getHeight()) { + block = world.getBlock(i, j1, k); + if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) { + int thisMeta = world.getBlockMetadata(i, j, k); + world.setBlock(i, j1, k, (Block)this, thisMeta, 3); + world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null); + } + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/ironChain.java b/src/main/java/com/zivilon/cinder_loe/blocks/ironChain.java new file mode 100644 index 0000000..180e6b6 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/ironChain.java @@ -0,0 +1,121 @@ +package com.zivilon.cinder_loe.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.block.LOTRBlockChandelier; +import lotr.common.block.LOTRBlockOrcChain; +import net.minecraft.block.*; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class ironChain + extends LOTRBlockOrcChain { + + public IIcon icon; + @SideOnly(value= Side.CLIENT) + private IIcon iconMiddle; + @SideOnly(value=Side.CLIENT) + private IIcon iconTop; + @SideOnly(value=Side.CLIENT) + private IIcon iconBottom; + @SideOnly(value=Side.CLIENT) + private IIcon iconSingle; + + public ironChain() { + this.setHardness(1.0f); + this.setStepSound(Block.soundTypeMetal); + this.textureName = "lotr:ironChain"; + setBlockName("lotr:ironChain"); + setBlockTextureName("lotr:ironChain"); + float f = 0.2f; + this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f); + } + + @SideOnly(value=Side.CLIENT) + public void registerBlockIcons(IIconRegister iconregister) { + this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid"); + this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top"); + this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom"); + this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single"); + this.blockIcon = iconregister.registerIcon(this.getTextureName()); + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) { + boolean chainBelow; + Block above = world.getBlock(i, j + 1, k); + Block below = world.getBlock(i, j - 1, k); + boolean chainAbove = above instanceof ironChain; + boolean bl = chainBelow = below instanceof ironChain || below instanceof LOTRBlockChandelier; + if (chainAbove && chainBelow) { + return this.iconMiddle; + } + if (chainAbove) { + return this.iconBottom; + } + if (chainBelow) { + return this.iconTop; + } + return this.iconSingle; + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(int i, int j) { + return this.iconMiddle; + } + + @SideOnly(value=Side.CLIENT) + public String getItemIconName() { + return this.getTextureName(); + } + + public boolean canPlaceBlockAt(World world, int i, int j, int k) { + Block block = world.getBlock(i, j + 1, k); + int meta = world.getBlockMetadata(i, j + 1, k); + if (block instanceof ironChain) { + return true; + } + if (block instanceof BlockFence || block instanceof BlockWall) { + return true; + } + if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) { + return true; + } + if (block instanceof BlockStairs && (meta & 4) == 0) { + return true; + } + return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN); + } + + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) { + Block block; + int j1; + for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) { + } + if (j1 >= 0 && j1 < world.getHeight()) { + block = world.getBlock(i, j1, k); + if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) { + int thisMeta = world.getBlockMetadata(i, j, k); + world.setBlock(i, j1, k, (Block)this, thisMeta, 3); + world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null); + } + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/blocks/silverChain.java b/src/main/java/com/zivilon/cinder_loe/blocks/silverChain.java new file mode 100644 index 0000000..4236d1b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/blocks/silverChain.java @@ -0,0 +1,125 @@ +package com.zivilon.cinder_loe.blocks; + +import com.zivilon.cinder_loe.util.Utilities; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import lotr.common.LOTRMod; +import lotr.common.block.LOTRBlockChandelier; +import lotr.common.block.LOTRBlockOrcChain; +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class silverChain extends LOTRBlockOrcChain { + + public IIcon icon; + @SideOnly(value= Side.CLIENT) + private IIcon iconMiddle; + @SideOnly(value=Side.CLIENT) + private IIcon iconTop; + @SideOnly(value=Side.CLIENT) + private IIcon iconBottom; + @SideOnly(value=Side.CLIENT) + private IIcon iconSingle; + + public silverChain() { + this.setHardness(1.0f); + this.setStepSound(Block.soundTypeMetal); + this.textureName = "lotr:silverChain"; + setBlockName("lotr:silverChain"); + setBlockTextureName("lotr:silverChain"); + float f = 0.2f; + this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 1.0f, 0.5f + f); + } + + @SideOnly(value=Side.CLIENT) + public void registerBlockIcons(IIconRegister iconregister) { + this.iconMiddle = iconregister.registerIcon(this.getTextureName() + "_mid"); + this.iconTop = iconregister.registerIcon(this.getTextureName() + "_top"); + this.iconBottom = iconregister.registerIcon(this.getTextureName() + "_bottom"); + this.iconSingle = iconregister.registerIcon(this.getTextureName() + "_single"); + this.blockIcon = iconregister.registerIcon(this.getTextureName()); + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(IBlockAccess world, int i, int j, int k, int side) { + boolean chainBelow; + Block above = world.getBlock(i, j + 1, k); + Block below = world.getBlock(i, j - 1, k); + boolean chainAbove = above instanceof silverChain; + boolean bl = chainBelow = below instanceof silverChain || below instanceof LOTRBlockChandelier; + if (chainAbove && chainBelow) { + return this.iconMiddle; + } + if (chainAbove) { + return this.iconBottom; + } + if (chainBelow) { + return this.iconTop; + } + return this.iconSingle; + } + + @SideOnly(value=Side.CLIENT) + public IIcon getIcon(int i, int j) { + return this.iconMiddle; + } + + @SideOnly(value=Side.CLIENT) + public String getItemIconName() { + return this.getTextureName(); + } + + public boolean canPlaceBlockAt(World world, int i, int j, int k) { + Block block = world.getBlock(i, j + 1, k); + int meta = world.getBlockMetadata(i, j + 1, k); + if (block instanceof silverChain) { + return true; + } + if (block instanceof BlockFence || block instanceof BlockWall) { + return true; + } + if (block instanceof BlockSlab && !block.isOpaqueCube() && (meta & 8) == 0) { + return true; + } + if (block instanceof BlockStairs && (meta & 4) == 0) { + return true; + } + return world.getBlock(i, j + 1, k).isSideSolid((IBlockAccess)world, i, j + 1, k, ForgeDirection.DOWN); + } + + public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int side, float f, float f1, float f2) { + ItemStack itemstack = entityplayer.getHeldItem(); + if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock((Block)this)) { + Block block; + int j1; + for (j1 = j; j1 >= 0 && j1 < world.getHeight() && (block = world.getBlock(i, j1, k)) == this; --j1) { + } + if (j1 >= 0 && j1 < world.getHeight()) { + block = world.getBlock(i, j1, k); + if (this.canPlaceBlockOnSide(world, i, j1, k, side) && block.isReplaceable((IBlockAccess)world, i, j1, k) && !block.getMaterial().isLiquid()) { + int thisMeta = world.getBlockMetadata(i, j, k); + world.setBlock(i, j1, k, (Block)this, thisMeta, 3); + world.playSoundEffect((double)((float)i + 0.5f), (double)((float)j1 + 0.5f), (double)((float)k + 0.5f), this.stepSound.func_150496_b(), (this.stepSound.getVolume() + 1.0f) / 2.0f, this.stepSound.getPitch() * 0.8f); + if (!entityplayer.capabilities.isCreativeMode) { + --itemstack.stackSize; + } + if (itemstack.stackSize <= 0) { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null); + } + return true; + } + } + } + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java b/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java new file mode 100644 index 0000000..9a881c7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/character/CharacterEventListener.java @@ -0,0 +1,79 @@ +package com.zivilon.cinder_loe.character; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.FMLCommonHandler; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import com.zivilon.cinder_loe.character.CharacterRoleAPI; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class CharacterEventListener { + + public CharacterEventListener() { + // Register the event listener + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) + public void onLivingHurt(LivingHurtEvent event) { + // Check if the entity being hurt is a character of interest + EntityLivingBase damagedEntity = event.entityLiving; + + // Check if the source of damage is an entity + if (event.source.getSourceOfDamage() instanceof EntityLivingBase) { + // The entity that caused the damage + EntityLivingBase damagerEntity = (EntityLivingBase) event.source.getSourceOfDamage(); + + if (damagedEntity instanceof EntityPlayerMP) { + EntityPlayerMP player = (EntityPlayerMP)damagedEntity; + + UUID radagast = CharacterRoleAPI.getCharacterRoleUUID("Radagast"); + if (player.getUniqueID().equals(radagast)) { + List entities = findAnimalsAndFangornEntities((EntityLivingBase)player); + for (EntityLivingBase entity : entities) { + EntityLiving animal = (EntityLiving) entity; + animal.setAttackTarget((EntityLivingBase)damagerEntity); + } + } + } + } + } + + public static List findAnimalsAndFangornEntities(EntityLivingBase centerEntity) { + World world = centerEntity.worldObj; + double searchRadius = 32.0D; // Define the search radius + + // Calculate the search area + AxisAlignedBB searchArea = AxisAlignedBB.getBoundingBox( + centerEntity.posX - searchRadius, centerEntity.posY - searchRadius, centerEntity.posZ - searchRadius, + centerEntity.posX + searchRadius, centerEntity.posY + searchRadius, centerEntity.posZ + searchRadius); + + // Retrieve all entities within the search area + List entitiesWithinAABB = world.getEntitiesWithinAABB(EntityLivingBase.class, searchArea); + List foundEntities = new ArrayList(); + + // Manually filter the entities to match your criteria + for (Object obj : entitiesWithinAABB) { + if (obj instanceof EntityAnimal || obj instanceof FangornAnimal) { // Adjust for your custom entity + foundEntities.add((EntityLivingBase) obj); + } + } + + return foundEntities; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/character/CharacterRoleAPI.java b/src/main/java/com/zivilon/cinder_loe/character/CharacterRoleAPI.java new file mode 100644 index 0000000..c45722a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/character/CharacterRoleAPI.java @@ -0,0 +1,61 @@ +package com.zivilon.cinder_loe.character; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import java.io.*; +import java.nio.file.*; +import java.lang.reflect.Type; +import java.util.*; + +public class CharacterRoleAPI { + + private static final Path FILE_PATH = Paths.get("character_roles.json"); + private static Map characterRoles = new HashMap<>(); + + public static void loadRolesFromFile() { + if (!Files.exists(FILE_PATH)) { + try { + Files.createFile(FILE_PATH); + } catch (IOException e) { + e.printStackTrace(); + } + return; + } + + try (Reader reader = Files.newBufferedReader(FILE_PATH)) { + Gson gson = new Gson(); + Type type = new TypeToken>() {}.getType(); + characterRoles = gson.fromJson(reader, type); + if (characterRoles == null) { + characterRoles = new HashMap<>(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void saveRolesToFile() { + Gson gson = new Gson(); + try (Writer writer = Files.newBufferedWriter(FILE_PATH)) { + gson.toJson(characterRoles, writer); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static UUID getCharacterRoleUUID(String roleName) { + return characterRoles.get(roleName); + } + + public static void setCharacterRoleUUID(String roleName, UUID playerUUID) { + characterRoles.put(roleName, playerUUID); + saveRolesToFile(); + } + + public static void removeCharacterRole(String roleName) { + if (characterRoles.containsKey(roleName)) { + characterRoles.remove(roleName); + saveRolesToFile(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.java new file mode 100644 index 0000000..7fdd37f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornAuroch.java @@ -0,0 +1,126 @@ +package com.zivilon.cinder_loe.client.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +import com.zivilon.cinder_loe.entity.FangornAuroch; + +public class ModelFangornAuroch extends ModelBase { + public ModelRenderer body; + + public ModelRenderer leg1; + + public ModelRenderer leg2; + + public ModelRenderer leg3; + + public ModelRenderer leg4; + + public ModelRenderer tail; + + public ModelRenderer head; + + public ModelRenderer horns; + + public ModelRenderer hornLeft1; + + public ModelRenderer hornLeft2; + + public ModelRenderer hornRight1; + + public ModelRenderer hornRight2; + + public ModelFangornAuroch() { + this.textureWidth = 128; + this.textureHeight = 64; + this.body = new ModelRenderer(this, 0, 0); + this.body.setRotationPoint(0.0F, 2.0F, -1.0F); + this.body.addBox(-8.0F, -6.0F, -11.0F, 16, 16, 26); + this.body.setTextureOffset(28, 42).addBox(-8.0F, -8.0F, -8.0F, 16, 2, 10); + this.body.setTextureOffset(84, 31).addBox(-3.0F, 10.0F, 4.0F, 6, 1, 6); + this.leg1 = new ModelRenderer(this, 0, 42); + this.leg1.setRotationPoint(-5.0F, 12.0F, 9.0F); + this.leg1.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5); + this.leg2 = new ModelRenderer(this, 0, 42); + this.leg2.setRotationPoint(5.0F, 12.0F, 9.0F); + this.leg2.mirror = true; + this.leg2.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5); + this.leg3 = new ModelRenderer(this, 0, 42); + this.leg3.setRotationPoint(-5.0F, 12.0F, -7.0F); + this.leg3.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5); + this.leg4 = new ModelRenderer(this, 0, 42); + this.leg4.setRotationPoint(5.0F, 12.0F, -7.0F); + this.leg4.mirror = true; + this.leg4.addBox(-2.5F, 0.0F, -2.5F, 5, 12, 5); + this.tail = new ModelRenderer(this, 20, 42); + this.tail.setRotationPoint(0.0F, 1.0F, 14.0F); + this.tail.addBox(-1.0F, -1.0F, 0.0F, 2, 12, 1); + this.head = new ModelRenderer(this, 58, 0); + this.head.setRotationPoint(0.0F, -1.0F, -10.0F); + this.head.addBox(-5.0F, -4.0F, -12.0F, 10, 10, 11); + this.head.setTextureOffset(89, 0).addBox(-3.0F, 1.0F, -15.0F, 6, 4, 4); + this.head.setTextureOffset(105, 0); + this.head.addBox(-8.0F, -2.5F, -7.0F, 3, 2, 1); + this.head.mirror = true; + this.head.addBox(5.0F, -2.5F, -7.0F, 3, 2, 1); + this.head.mirror = false; + this.horns = new ModelRenderer(this, 98, 21); + this.horns.setRotationPoint(0.0F, -3.5F, -5.0F); + this.horns.addBox(-6.0F, -1.5F, -1.5F, 12, 3, 3); + this.head.addChild(this.horns); + this.hornLeft1 = new ModelRenderer(this, 112, 27); + this.hornLeft1.setRotationPoint(-6.0F, 0.0F, 0.0F); + this.hornLeft1.addBox(-5.0F, -1.0F, -1.0F, 6, 2, 2); + this.hornLeft2 = new ModelRenderer(this, 114, 31); + this.hornLeft2.setRotationPoint(-5.0F, 0.0F, 0.0F); + this.hornLeft2.addBox(-5.0F, -0.5F, -0.5F, 6, 1, 1); + this.hornLeft1.addChild(this.hornLeft2); + this.horns.addChild(this.hornLeft1); + this.hornRight1 = new ModelRenderer(this, 112, 27); + this.hornRight1.mirror = true; + this.hornRight1.setRotationPoint(6.0F, 0.0F, 0.0F); + this.hornRight1.addBox(-1.0F, -1.0F, -1.0F, 6, 2, 2); + this.hornRight2 = new ModelRenderer(this, 114, 31); + this.hornRight2.mirror = true; + this.hornRight2.setRotationPoint(5.0F, 0.0F, 0.0F); + this.hornRight2.addBox(-1.0F, -0.5F, -0.5F, 6, 1, 1); + this.hornRight1.addChild(this.hornRight2); + this.horns.addChild(this.hornRight1); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + this.horns.showModel = true; + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.head.render(f5); + this.body.render(f5); + this.leg1.render(f5); + this.leg2.render(f5); + this.leg3.render(f5); + this.leg4.render(f5); + this.tail.render(f5); + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + this.head.rotateAngleX = 0.0F; + this.head.rotateAngleY = 0.0F; + this.head.rotateAngleZ = 0.0F; + this.head.rotateAngleX += (float)Math.toRadians(f4); + this.head.rotateAngleY += (float)Math.toRadians(f3); + this.head.rotateAngleX += MathHelper.cos(f * 0.2F) * f1 * 0.4F; + this.hornLeft1.rotateAngleZ = (float)Math.toRadians(25.0D); + this.hornLeft2.rotateAngleZ = (float)Math.toRadians(15.0D); + this.hornRight1.rotateAngleZ = -this.hornLeft1.rotateAngleZ; + this.hornRight2.rotateAngleZ = -this.hornLeft2.rotateAngleZ; + this.hornLeft1.rotateAngleY = (float)Math.toRadians(-25.0D); + this.hornRight1.rotateAngleY = -this.hornLeft1.rotateAngleY; + this.hornLeft1.rotateAngleX = (float)Math.toRadians(35.0D); + this.hornRight1.rotateAngleX = this.hornLeft1.rotateAngleX; + this.leg1.rotateAngleX = MathHelper.cos(f * 0.4F) * f1 * 0.8F; + this.leg2.rotateAngleX = MathHelper.cos(f * 0.4F + 3.1415927F) * f1 * 0.8F; + this.leg3.rotateAngleX = MathHelper.cos(f * 0.4F + 3.1415927F) * f1 * 0.8F; + this.leg4.rotateAngleX = MathHelper.cos(f * 0.4F) * f1 * 0.8F; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java new file mode 100644 index 0000000..50e1a37 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornElk.java @@ -0,0 +1,188 @@ +package com.zivilon.cinder_loe.client.model; + +import lotr.client.LOTRTickHandlerClient; +import lotr.common.LOTRMod; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + +import com.zivilon.cinder_loe.entity.FangornElk; + +public class ModelFangornElk extends ModelBase { + private ModelRenderer body; + + private ModelRenderer leg1; + + private ModelRenderer leg2; + + private ModelRenderer leg3; + + private ModelRenderer leg4; + + private ModelRenderer head; + + private ModelRenderer nose; + + private ModelRenderer antlersRight_1; + + private ModelRenderer antlersRight_2; + + private ModelRenderer antlersRight_3; + + private ModelRenderer antlersRight_4; + + private ModelRenderer antlersLeft_1; + + private ModelRenderer antlersLeft_2; + + private ModelRenderer antlersLeft_3; + + private ModelRenderer antlersLeft_4; + + public ModelFangornElk() { + this(0.0F); + } + + public ModelFangornElk(float f) { + this.textureWidth = 128; + this.textureHeight = 64; + this.body = new ModelRenderer(this, 0, 0); + this.body.setRotationPoint(0.0F, 4.0F, 9.0F); + this.body.addBox(-6.0F, -4.0F, -21.0F, 12, 11, 26, f); + ModelRenderer tail = new ModelRenderer(this, 0, 54); + tail.addBox(-1.0F, -5.0F, 2.0F, 2, 2, 8, f); + tail.rotateAngleX = (float)Math.toRadians(-60.0D); + this.body.addChild(tail); + this.leg1 = new ModelRenderer(this, 42, 37); + this.leg1.setRotationPoint(-4.0F, 3.0F, 8.0F); + this.leg1.addBox(-5.5F, 0.0F, -3.0F, 7, 11, 8, f); + this.leg1.setTextureOffset(26, 37).addBox(-4.0F, 11.0F, -1.0F, 4, 10, 4, f); + this.leg2 = new ModelRenderer(this, 42, 37); + this.leg2.mirror = true; + this.leg2.setRotationPoint(4.0F, 3.0F, 8.0F); + this.leg2.addBox(-1.5F, 0.0F, -3.0F, 7, 11, 8, f); + this.leg2.setTextureOffset(26, 37).addBox(0.0F, 11.0F, -1.0F, 4, 10, 4, f); + this.leg3 = new ModelRenderer(this, 0, 37); + this.leg3.setRotationPoint(-4.0F, 4.0F, -6.0F); + this.leg3.addBox(-4.5F, 0.0F, -3.0F, 6, 10, 7, f); + this.leg3.setTextureOffset(26, 37).addBox(-3.5F, 10.0F, -2.0F, 4, 10, 4, f); + this.leg4 = new ModelRenderer(this, 0, 37); + this.leg4.mirror = true; + this.leg4.setRotationPoint(4.0F, 4.0F, -6.0F); + this.leg4.addBox(-1.5F, 0.0F, -3.0F, 6, 10, 7, f); + this.leg4.setTextureOffset(26, 37).addBox(-0.5F, 10.0F, -2.0F, 4, 10, 4, f); + this.head = new ModelRenderer(this, 50, 0); + this.head.setRotationPoint(0.0F, 4.0F, -10.0F); + this.head.addBox(-2.0F, -10.0F, -4.0F, 4, 12, 8, f); + this.head.setTextureOffset(74, 0).addBox(-3.0F, -16.0F, -8.0F, 6, 6, 13, f); + this.head.setTextureOffset(50, 20); + this.head.addBox(-2.0F, -18.0F, 3.0F, 1, 2, 1, f); + this.head.mirror = true; + this.head.addBox(1.0F, -18.0F, 3.0F, 1, 2, 1, f); + this.nose = new ModelRenderer(this, 56, 20); + this.nose.addBox(-1.0F, -14.5F, -9.0F, 2, 2, 1, f); + this.antlersRight_1 = new ModelRenderer(this, 0, 0); + this.antlersRight_1.addBox(10.0F, -19.0F, 2.5F, 1, 12, 1, f); + this.antlersRight_1.rotateAngleZ = (float)Math.toRadians(-65.0D); + this.antlersRight_2 = new ModelRenderer(this, 4, 0); + this.antlersRight_2.addBox(-3.0F, -23.6F, 2.5F, 1, 8, 1, f); + this.antlersRight_2.rotateAngleZ = (float)Math.toRadians(-15.0D); + this.antlersRight_3 = new ModelRenderer(this, 8, 0); + this.antlersRight_3.addBox(-8.0F, -36.0F, 2.5F, 1, 16, 1, f); + this.antlersRight_3.rotateAngleZ = (float)Math.toRadians(-15.0D); + this.antlersRight_4 = new ModelRenderer(this, 12, 0); + this.antlersRight_4.addBox(7.5F, -35.0F, 2.5F, 1, 10, 1, f); + this.antlersRight_4.rotateAngleZ = (float)Math.toRadians(-50.0D); + this.head.addChild(this.antlersRight_1); + this.head.addChild(this.antlersRight_2); + this.head.addChild(this.antlersRight_3); + this.head.addChild(this.antlersRight_4); + this.antlersLeft_1 = new ModelRenderer(this, 0, 0); + this.antlersLeft_1.mirror = true; + this.antlersLeft_1.addBox(-11.0F, -19.0F, 2.5F, 1, 12, 1, f); + this.antlersLeft_1.rotateAngleZ = (float)Math.toRadians(65.0D); + this.antlersLeft_2 = new ModelRenderer(this, 4, 0); + this.antlersLeft_2.mirror = true; + this.antlersLeft_2.addBox(2.0F, -23.6F, 2.5F, 1, 8, 1, f); + this.antlersLeft_2.rotateAngleZ = (float)Math.toRadians(15.0D); + this.antlersLeft_3 = new ModelRenderer(this, 8, 0); + this.antlersLeft_3.mirror = true; + this.antlersLeft_3.addBox(7.0F, -36.0F, 2.5F, 1, 16, 1, f); + this.antlersLeft_3.rotateAngleZ = (float)Math.toRadians(15.0D); + this.antlersLeft_4 = new ModelRenderer(this, 12, 0); + this.antlersLeft_4.mirror = true; + this.antlersLeft_4.addBox(-8.5F, -35.0F, 2.5F, 1, 10, 1, f); + this.antlersLeft_4.rotateAngleZ = (float)Math.toRadians(50.0D); + this.head.addChild(this.antlersLeft_1); + this.head.addChild(this.antlersLeft_2); + this.head.addChild(this.antlersLeft_3); + this.head.addChild(this.antlersLeft_4); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + FangornElk elk = (FangornElk)entity; + setRotationAngles(f, f1, f2, f3, f4, f5, (Entity)elk); + GL11.glPushMatrix(); + float scale = 1.0F; + GL11.glTranslatef(0.0F, 24.0F * (1.0F - scale) * f5, 0.0F); + GL11.glScalef(scale, scale, scale); + boolean showAntlers = (scale > 0.75F); + this.antlersRight_1.showModel = showAntlers; + this.antlersRight_2.showModel = showAntlers; + this.antlersRight_3.showModel = showAntlers; + this.antlersRight_4.showModel = showAntlers; + this.antlersLeft_1.showModel = showAntlers; + this.antlersLeft_2.showModel = showAntlers; + this.antlersLeft_3.showModel = showAntlers; + this.antlersLeft_4.showModel = showAntlers; + this.body.render(f5); + this.leg1.render(f5); + this.leg2.render(f5); + this.leg3.render(f5); + this.leg4.render(f5); + this.head.render(f5); + if (LOTRMod.isChristmas()) + GL11.glColor3f(1.0F, 0.0F, 0.0F); + this.nose.render(f5); + if (LOTRMod.isChristmas()) + GL11.glColor3f(1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { + float rearAmount = 0.0F; + float antiRearAmount = 1.0F - rearAmount; + this.head.rotationPointY = 4.0F; + this.head.rotationPointZ = -10.0F; + this.head.rotateAngleX = (float)Math.toRadians(20.0D); + this.head.rotateAngleY = 0.0F; + this.head.rotationPointY = rearAmount * -6.0F + antiRearAmount * this.head.rotationPointY; + this.head.rotationPointZ = rearAmount * -1.0F + antiRearAmount * this.head.rotationPointZ; + this.head.rotateAngleX = (float)(this.head.rotateAngleX + Math.toRadians(f4)); + this.head.rotateAngleY = (float)(this.head.rotateAngleY + Math.toRadians(f3)); + this.head.rotateAngleX = antiRearAmount * this.head.rotateAngleX; + this.head.rotateAngleY = antiRearAmount * this.head.rotateAngleY; + if (f1 > 0.2F) + this.head.rotateAngleX += MathHelper.cos(f * 0.3F) * 0.1F * f1; + this.nose.setRotationPoint(this.head.rotationPointX, this.head.rotationPointY, this.head.rotationPointZ); + this.nose.rotateAngleX = this.head.rotateAngleX; + this.nose.rotateAngleY = this.head.rotateAngleY; + this.nose.rotateAngleZ = this.head.rotateAngleZ; + this.body.rotateAngleX = 0.0F; + this.body.rotateAngleX = rearAmount * -0.7853982F + antiRearAmount * this.body.rotateAngleX; + float legRotation = MathHelper.cos(f * 0.4F + 3.1415927F) * f1; + float f17 = -1.0471976F; + float f18 = 0.2617994F * rearAmount; + float f19 = MathHelper.cos(f2 * 0.4F + 3.1415927F); + this.leg4.rotationPointY = -2.0F * rearAmount + 4.0F * antiRearAmount; + this.leg4.rotationPointZ = -2.0F * rearAmount + -6.0F * antiRearAmount; + this.leg3.rotationPointY = this.leg4.rotationPointY; + this.leg3.rotationPointZ = this.leg4.rotationPointZ; + this.leg1.rotateAngleX = f18 + legRotation * antiRearAmount; + this.leg2.rotateAngleX = f18 + -legRotation * antiRearAmount; + this.leg3.rotateAngleX = (f17 + -f19) * rearAmount + -legRotation * 0.8F * antiRearAmount; + this.leg4.rotateAngleX = (f17 + f19) * rearAmount + legRotation * 0.8F * antiRearAmount; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java new file mode 100644 index 0000000..c08dc8b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelFangornWolf.java @@ -0,0 +1,126 @@ +package com.zivilon.cinder_loe.client.model; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import com.zivilon.cinder_loe.entity.FangornWolf; + +@SideOnly(Side.CLIENT) +public class ModelFangornWolf extends ModelBase { + /** main box for the wolf head */ + public ModelRenderer wolfHeadMain; + /** The wolf's body */ + public ModelRenderer wolfBody; + /** Wolf'se first leg */ + public ModelRenderer wolfLeg1; + /** Wolf's second leg */ + public ModelRenderer wolfLeg2; + /** Wolf's third leg */ + public ModelRenderer wolfLeg3; + /** Wolf's fourth leg */ + public ModelRenderer wolfLeg4; + /** The wolf's tail */ + ModelRenderer wolfTail; + /** The wolf's mane */ + ModelRenderer wolfMane; + + public ModelFangornWolf() + { + float f = 0.0F; + float f1 = 13.5F; + this.wolfHeadMain = new ModelRenderer(this, 0, 0); + this.wolfHeadMain.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4, f); + this.wolfHeadMain.setRotationPoint(-1.0F, f1, -7.0F); + this.wolfBody = new ModelRenderer(this, 18, 14); + this.wolfBody.addBox(-4.0F, -2.0F, -3.0F, 6, 9, 6, f); + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfMane = new ModelRenderer(this, 21, 0); + this.wolfMane.addBox(-4.0F, -3.0F, -3.0F, 8, 6, 7, f); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, 2.0F); + this.wolfLeg1 = new ModelRenderer(this, 0, 18); + this.wolfLeg1.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2 = new ModelRenderer(this, 0, 18); + this.wolfLeg2.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3 = new ModelRenderer(this, 0, 18); + this.wolfLeg3.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4 = new ModelRenderer(this, 0, 18); + this.wolfLeg4.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfTail = new ModelRenderer(this, 9, 18); + this.wolfTail.addBox(-1.0F, 0.0F, -1.0F, 2, 8, 2, f); + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(-3.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(16, 14).addBox(1.0F, -5.0F, 0.0F, 2, 2, 1, f); + this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, f); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + this.wolfHeadMain.renderWithRotation(p_78088_7_); + this.wolfBody.render(p_78088_7_); + this.wolfLeg1.render(p_78088_7_); + this.wolfLeg2.render(p_78088_7_); + this.wolfLeg3.render(p_78088_7_); + this.wolfLeg4.render(p_78088_7_); + this.wolfTail.renderWithRotation(p_78088_7_); + this.wolfMane.render(p_78088_7_); + } + + /** + * Used for easily adding entity-dependent animations. The second and third float params here are the same second + * and third as in the setRotationAngles method. + */ + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) + { + FangornWolf entitywolf = (FangornWolf)p_78086_1_; + + this.wolfTail.rotateAngleY = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); + this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); + this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 16.0F, 7.0F); + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); + this.wolfLeg1.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + this.wolfLeg2.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg3.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F + (float)Math.PI) * 1.4F * p_78086_3_; + this.wolfLeg4.rotateAngleX = MathHelper.cos(p_78086_2_ * 0.6662F) * 1.4F * p_78086_3_; + + this.wolfHeadMain.rotateAngleZ = 0.0F; + this.wolfMane.rotateAngleZ = -0.08F; + this.wolfBody.rotateAngleZ = -0.16F; + this.wolfTail.rotateAngleZ = -0.2F; + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.wolfHeadMain.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.wolfHeadMain.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.wolfTail.rotateAngleX = p_78087_3_; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.java b/src/main/java/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.java new file mode 100644 index 0000000..aa001c5 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/model/ModelRedDwarfHelmet.java @@ -0,0 +1,61 @@ +package com.zivilon.cinder_loe.client.model; + +import lotr.client.model.LOTRModelBiped; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelRedDwarfHelmet extends LOTRModelBiped { + //fields + ModelRenderer rightneckguard; + ModelRenderer leftneckguard = new ModelRenderer(this, 32, 0); + ModelRenderer shape1 = new ModelRenderer(this, 32, 18); + + public ModelRedDwarfHelmet() { + + } + + public ModelRedDwarfHelmet(float f) { + super(f); + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.setRotationPoint(0F, 0F, 0F); + this.bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f); + + rightneckguard = new ModelRenderer(this, 32, 9); + rightneckguard.addBox(4.6F, 2.15F, -3.0F, 0, 1, 8); + rightneckguard.setRotationPoint(0F, 0F, 0F); + rightneckguard.setTextureSize(64, 32); + rightneckguard.mirror = true; + setRotation(rightneckguard, 0F, 0F, -0.2443461F); + this.bipedHead.addChild(rightneckguard); + + leftneckguard = new ModelRenderer(this, 32, 0); + leftneckguard.addBox(-4.6F, 2.15F, -3.0F, 0, 1, 8); + leftneckguard.setRotationPoint(0F, 0F, 0F); + leftneckguard.setTextureSize(64, 32); + leftneckguard.mirror = true; + setRotation(leftneckguard, 0F, 0F, 0.2443461F); + this.bipedHead.addChild(leftneckguard); + + shape1 = new ModelRenderer(this, 32, 18); + shape1.setRotationPoint(0F, 0F, 0F); + shape1.addBox(0F, -13F, -4F, 0, 4, 10); + shape1.setTextureSize(64, 32); + setRotation(shape1, 0F, 0F, 0F); + + this.bipedHead.addChild(shape1); + this.bipedHeadwear.cubeList.clear(); + this.bipedBody.cubeList.clear(); + this.bipedRightArm.cubeList.clear(); + this.bipedLeftArm.cubeList.clear(); + this.bipedRightLeg.cubeList.clear(); + this.bipedLeftLeg.cubeList.clear(); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java new file mode 100644 index 0000000..d4097a8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderBattleNun.java @@ -0,0 +1,40 @@ +package com.zivilon.cinder_loe.client.render; + +import com.zivilon.cinder_loe.entity.BattleNun; +import lotr.client.model.LOTRModelHuman; +import lotr.client.render.entity.LOTRRenderBiped; +import lotr.client.render.entity.LOTRRandomSkins; +import lotr.common.entity.LOTRRandomSkinEntity; +import lotr.common.entity.npc.LOTREntityNPC; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.entity.Limwaith; + +public class RenderBattleNun extends LOTRRenderBiped { + + public static LOTRRandomSkins skinsFemale; + + public ModelBiped outfitModel = (ModelBiped)new LOTRModelHuman(0.6F, false); + + public RenderBattleNun() { + super((ModelBiped)new LOTRModelHuman(), 0.5F); + setRenderPassModel((ModelBase)this.outfitModel); + skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/arnorNun/arnorNun_female"); + } + + public ResourceLocation getEntityTexture(Entity entity) { + BattleNun battleNun = (BattleNun)entity; + if (((LOTREntityNPC)battleNun).familyInfo.isMale()) + return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)battleNun); + return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)battleNun); + } + + public int shouldRenderPass(EntityLiving entity, int pass, float f) { + BattleNun battleNun = (BattleNun)entity; + return super.shouldRenderPass((EntityLiving)battleNun, pass, f); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java new file mode 100644 index 0000000..ab03624 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornAuroch.java @@ -0,0 +1,26 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.render.entity.LOTRRandomSkins; +import lotr.common.entity.LOTRRandomSkinEntity; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.client.model.ModelFangornAuroch; +import com.zivilon.cinder_loe.entity.FangornAuroch; + +public class RenderFangornAuroch extends RenderLiving { + public static LOTRRandomSkins aurochsSkins; + + public RenderFangornAuroch() { + super((ModelBase)new ModelFangornAuroch(), 0.5F); + aurochsSkins = LOTRRandomSkins.loadSkinsList("lotr:mob/aurochs"); + } + + public ResourceLocation getEntityTexture(Entity entity) { + FangornAuroch aurochs = (FangornAuroch)entity; + ResourceLocation skin = aurochsSkins.getRandomSkin((LOTRRandomSkinEntity)aurochs); + return skin; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java new file mode 100644 index 0000000..8876ae0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornBear.java @@ -0,0 +1,46 @@ +package com.zivilon.cinder_loe.client.render; + +import com.zivilon.cinder_loe.entity.FangornBear; + +import java.util.HashMap; +import java.util.Map; +import lotr.client.model.LOTRModelBear; +import lotr.client.render.entity.LOTRRenderBear; +import lotr.common.entity.animal.LOTREntityBear; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class RenderFangornBear extends RenderLiving { + public static Map bearSkins = new HashMap(); + + public RenderFangornBear() { + super((ModelBase)new LOTRModelBear(), 0.5F); + } + + protected ResourceLocation getEntityTexture(Entity entity) { + FangornBear bear = (FangornBear)entity; + return getBearSkin(bear.getBearType()); + } + public static ResourceLocation getBearSkin(LOTREntityBear.BearType type) { + String s = type.textureName(); + ResourceLocation skin = (ResourceLocation)bearSkins.get(s); + if (skin == null) { + skin = new ResourceLocation("lotr:mob/bear/" + s + ".png"); + bearSkins.put(s, skin); + } + return skin; + } + + public void preRenderCallback(EntityLivingBase entity, float f) { + scaleBearModel(); + } + + public static void scaleBearModel() { + float scale = 1.2F; + GL11.glScalef(scale, scale, scale); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java new file mode 100644 index 0000000..16f3ced --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornElk.java @@ -0,0 +1,32 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.common.entity.LOTRRandomSkinEntity; +import lotr.client.render.entity.LOTRRandomSkins; +import lotr.common.entity.animal.LOTREntityElk; +import lotr.common.entity.npc.LOTRNPCMount; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.client.model.ModelFangornElk; +import com.zivilon.cinder_loe.entity.FangornElk; + +public class RenderFangornElk extends RenderLiving { + private static LOTRRandomSkins elkSkins; + + private static ResourceLocation saddleTexture = new ResourceLocation("lotr:mob/elk/saddle.png"); + + public RenderFangornElk() { + super((ModelBase)new ModelFangornElk(), 0.5F); + setRenderPassModel((ModelBase)new ModelFangornElk(0.5F)); + elkSkins = LOTRRandomSkins.loadSkinsList("lotr:mob/elk/elk"); + } + + public ResourceLocation getEntityTexture(Entity entity) { + FangornElk elk = (FangornElk)entity; + ResourceLocation elkSkin = elkSkins.getRandomSkin((LOTRRandomSkinEntity)elk); + return elkSkin; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.java new file mode 100644 index 0000000..b6dd3e0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWildBoar.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.model.LOTRModelBoar; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +public class RenderFangornWildBoar extends RenderLiving { + public static ResourceLocation boarSkin = new ResourceLocation("lotr:mob/boar/boar.png"); + + public RenderFangornWildBoar() { + super((ModelBase)new LOTRModelBoar(), 0.7F); + setRenderPassModel((ModelBase)new LOTRModelBoar(0.5F)); + } + + protected ResourceLocation getEntityTexture(Entity entity) { + return boarSkin; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWolf.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWolf.java new file mode 100644 index 0000000..05153c4 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderFangornWolf.java @@ -0,0 +1,26 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.client.render.entity.LOTRRenderHorse; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.entity.FangornWolf; +import com.zivilon.cinder_loe.client.model.ModelFangornWolf; + +public class RenderFangornWolf extends RenderLiving { + public static final ResourceLocation wolfSkin = new ResourceLocation("minecraft:textures/entity/wolf/wolf.png"); + + public RenderFangornWolf() { + super((ModelBase)new ModelFangornWolf(), 0.7F); + setRenderPassModel((ModelBase)new ModelFangornWolf()); + } + + protected ResourceLocation getEntityTexture(Entity entity) { + return wolfSkin; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java new file mode 100644 index 0000000..783c0e5 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderLimwaith.java @@ -0,0 +1,42 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.model.LOTRModelHuman; +import lotr.client.render.entity.LOTRRenderBiped; +import lotr.client.render.entity.LOTRRandomSkins; +import lotr.common.entity.LOTRRandomSkinEntity; +import lotr.common.entity.npc.LOTREntityMoredain; +import lotr.common.entity.npc.LOTREntityNPC; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.entity.Limwaith; + +public class RenderLimwaith extends LOTRRenderBiped { + public static LOTRRandomSkins skinsMale; + + public static LOTRRandomSkins skinsFemale; + + public ModelBiped outfitModel = (ModelBiped)new LOTRModelHuman(0.6F, false); + + public RenderLimwaith() { + super((ModelBiped)new LOTRModelHuman(), 0.5F); + setRenderPassModel((ModelBase)this.outfitModel); + skinsMale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/limwaith/limwaith_male"); + skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/limwaith/limwaith_female"); + } + + public ResourceLocation getEntityTexture(Entity entity) { + Limwaith limwaith = (Limwaith)entity; + if (((LOTREntityNPC)limwaith).familyInfo.isMale()) + return skinsMale.getRandomSkin((LOTRRandomSkinEntity)limwaith); + return skinsFemale.getRandomSkin((LOTRRandomSkinEntity)limwaith); + } + + public int shouldRenderPass(EntityLiving entity, int pass, float f) { + Limwaith limwaith = (Limwaith)entity; + return super.shouldRenderPass((EntityLiving)limwaith, pass, f); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderRenegade.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderRenegade.java new file mode 100644 index 0000000..37b9ae3 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderRenegade.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.client.render; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +import com.zivilon.cinder_loe.entity.Renegade; + +import lotr.client.model.LOTRModelHuman; +import lotr.client.render.entity.LOTRRandomSkins; +import lotr.client.render.entity.LOTRRenderBiped; +import lotr.common.entity.LOTRRandomSkinEntity; +import lotr.common.entity.npc.LOTREntityNPC; + +public class RenderRenegade extends LOTRRenderBiped { + + private static LOTRRandomSkins skinsMale; + + private static LOTRRandomSkins skinsFemale; + + private static LOTRRandomSkins headwearFemale; + + protected ModelBiped outfitModel = (ModelBiped) new LOTRModelHuman(0.6F, false); + + public RenderRenegade() { + super((ModelBiped) new LOTRModelHuman(), 0.5F); + skinsMale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/renegade_male"); + skinsFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/renegade_female"); + headwearFemale = LOTRRandomSkins.loadSkinsList("cinder_loe:mob/renegade/headwear_female"); + } + + public ResourceLocation getEntityTexture(Entity entity) { + Renegade man = (Renegade) entity; + if (((LOTREntityNPC) man).familyInfo.isMale()) return skinsMale.getRandomSkin((LOTRRandomSkinEntity) man); + return skinsFemale.getRandomSkin((LOTRRandomSkinEntity) man); + } + + public int shouldRenderPass(EntityLiving entity, int pass, float f) { + Renegade man = (Renegade) entity; + if (pass == 0 && man.getEquipmentInSlot(4) == null) if (!((LOTREntityNPC) man).familyInfo.isMale() + && LOTRRandomSkins.nextInt((LOTRRandomSkinEntity) man, 4) == 0) { + setRenderPassModel((ModelBase) this.outfitModel); + bindTexture(headwearFemale.getRandomSkin((LOTRRandomSkinEntity) man)); + return 1; + } + return super.shouldRenderPass((EntityLiving) man, pass, f); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java new file mode 100644 index 0000000..fad8631 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderSarumanFireball.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.LOTRClientProxy; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import com.zivilon.cinder_loe.entity.SarumanFireball; + +public class RenderSarumanFireball extends Render { + public static final ResourceLocation particlesTexture = new ResourceLocation("cinder_loe:misc/particles.png"); + + protected ResourceLocation getEntityTexture(Entity entity) { + return particlesTexture; + } + + public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d, (float)d1, (float)d2); + GL11.glEnable(32826); + bindEntityTexture(entity); + Tessellator tessellator = Tessellator.instance; + drawSprite(tessellator, 24 + ((SarumanFireball)entity).animationTick); + GL11.glDisable(32826); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPopMatrix(); + } + + private void drawSprite(Tessellator tessellator, int index) { + float f = (index % 8 * 16 + 0) / 128.0F; + float f1 = (index % 8 * 16 + 16) / 128.0F; + float f2 = (index / 8 * 16 + 0) / 128.0F; + float f3 = (index / 8 * 16 + 16) / 128.0F; + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.setBrightness(15728880); + tessellator.addVertexWithUV((0.0F - f5), (0.0F - f6), 0.0D, f, f3); + tessellator.addVertexWithUV((f4 - f5), (0.0F - f6), 0.0D, f1, f3); + tessellator.addVertexWithUV((f4 - f5), (f4 - f6), 0.0D, f1, f2); + tessellator.addVertexWithUV((0.0F - f5), (f4 - f6), 0.0D, f, f2); + tessellator.draw(); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/RenderWraith.java b/src/main/java/com/zivilon/cinder_loe/client/render/RenderWraith.java new file mode 100644 index 0000000..d9ad866 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/RenderWraith.java @@ -0,0 +1,43 @@ +package com.zivilon.cinder_loe.client.render; + +import lotr.client.model.LOTRModelMarshWraith; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +import com.zivilon.cinder_loe.entity.Wraith; + +public class RenderWraith extends RenderLiving { + private static ResourceLocation skin = new ResourceLocation("cinder_loe:mob/wraith/wraith.png"); + + public RenderWraith() { + super((ModelBase)new LOTRModelMarshWraith(), 0.5F); + } + + protected ResourceLocation getEntityTexture(Entity entity) { + return skin; + } + + protected void preRenderCallback(EntityLivingBase entity, float f) { + super.preRenderCallback(entity, f); + float f1 = 0.9375F; + float hover = MathHelper.sin((((Entity)entity).ticksExisted + f) * 0.15F) * 0.2F - 0.5F; + GL11.glScalef(f1, f1, f1); + GL11.glTranslatef(0.0F, hover, 0.0F); + Wraith wraith = (Wraith)entity; + if (wraith.getDeathFadeTime() > 0) { + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glEnable(3008); + GL11.glColor4f(1.0F, 1.0F, 1.0F, wraith.getDeathFadeTime() / 30.0F); + } + } + + protected float getDeathMaxRotation(EntityLivingBase entity) { + return 0.0F; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.java b/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.java new file mode 100644 index 0000000..6c2a61a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/block/RenderMistBlock.java @@ -0,0 +1,43 @@ +package com.zivilon.cinder_loe.client.render.block; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import org.lwjgl.opengl.GL11; +import com.zivilon.cinder_loe.tileentity.TileEntityMistBlock; +import lotr.client.render.tileentity.LOTRRenderUtumnoPortal; + +public class RenderMistBlock extends TileEntitySpecialRenderer { + public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) { + TileEntityMistBlock mist = (TileEntityMistBlock)tileentity; + GL11.glPushMatrix(); + GL11.glDisable(2884); + GL11.glDisable(3553); + GL11.glDisable(2896); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glDepthMask(false); + int passes = 60; + for (int i = 0; i < passes; i++) { + GL11.glPushMatrix(); + GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.0F + i * 0.5F, (float)d2 + 0.5F); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(mist.color_red, mist.color_green, mist.color_blue, (passes - i) / passes); + double width = 0.5D; + tessellator.addVertexWithUV(width, 0.0D, width, 0.0D, 0.0D); + tessellator.addVertexWithUV(width, 0.0D, -width, 0.0D, 0.0D); + tessellator.addVertexWithUV(-width, 0.0D, -width, 0.0D, 0.0D); + tessellator.addVertexWithUV(-width, 0.0D, width, 0.0D, 0.0D); + tessellator.draw(); + GL11.glPopMatrix(); + } + GL11.glDepthMask(true); + GL11.glEnable(3553); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(3042); + GL11.glEnable(2896); + GL11.glEnable(2884); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/client/render/item/RenderHelper.java b/src/main/java/com/zivilon/cinder_loe/client/render/item/RenderHelper.java new file mode 100644 index 0000000..1d55579 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/client/render/item/RenderHelper.java @@ -0,0 +1,151 @@ +package com.zivilon.cinder_loe.client.render.item; + +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.RenderBlocks; + +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.MinecraftForgeClient; +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; + +public class RenderHelper extends ItemRenderer { + public RenderHelper() { + super(Minecraft.getMinecraft()); + } + + public static void customRenderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_, boolean enchant) { + if (!enchant) GL11.glPushMatrix(); // Save the current OpenGL state + if (!enchant) GL11.glEnable(GL11.GL_BLEND); // Enable blending + if (!enchant) OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); // Apply your custom blend function for semi-transparency + + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, 1.0F); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, -1.0F); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.draw(); + + + float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_; + float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_; + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F); + int k; + float f7; + float f8; + + for (k = 0; k < p_78439_5_; ++k) + { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + p_78439_0_.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(1.0F, 0.0F, 0.0F); + float f9; + + for (k = 0; k < p_78439_5_; ++k) + { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + f9 = f7 + 1.0F / (float)p_78439_5_; + p_78439_0_.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) + { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + f9 = f7 + 1.0F / (float)p_78439_6_; + p_78439_0_.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, -1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) + { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + p_78439_0_.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + } + + p_78439_0_.draw(); + if (!enchant) GL11.glPopMatrix(); // Restore the saved OpenGL state + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/command/CommandCinderCharacter.java b/src/main/java/com/zivilon/cinder_loe/command/CommandCinderCharacter.java new file mode 100644 index 0000000..971886e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/command/CommandCinderCharacter.java @@ -0,0 +1,81 @@ +package com.zivilon.cinder_loe.command; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ChatComponentText; + +import com.zivilon.cinder_loe.character.CharacterRoleAPI; +import com.zivilon.cinder_loe.util.Utilities; + +import java.util.UUID; + +public class CommandCinderCharacter extends CommandBase { + + @Override + public String getCommandName() { + return "cinder_character"; + } + + @Override + public String getCommandUsage(ICommandSender sender) { + return "/cinder_character [player_name]"; + } + + @Override + public int getRequiredPermissionLevel() { + return 4; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) { + if(args.length < 2) { + sender.addChatMessage(new ChatComponentText("Incorrect arguments. Usage: " + getCommandUsage(sender))); + return; + } + + String action = args[0]; + String character = args[1]; + + if (action.equals("set")) { + if(args.length < 3) { + // Set character UUID to player UUID + sender.addChatMessage(new ChatComponentText("Incorrect arguments. Please specify player: " + getCommandUsage(sender))); + } else { + String player = args[2]; + EntityPlayerMP player_entity = MinecraftServer.getServer().getConfigurationManager().func_152612_a(player); + if (player_entity == null) { + sender.addChatMessage(new ChatComponentText("Invalid player name")); + } else { + sender.addChatMessage(new ChatComponentText("Setting player " + player_entity.getCommandSenderName() + " as " + character)); + CharacterRoleAPI.setCharacterRoleUUID(character, player_entity.getUniqueID()); + } + } + } else if (action.equals("remove")) { + UUID uuid = CharacterRoleAPI.getCharacterRoleUUID(character); + if (uuid == null) { + sender.addChatMessage(new ChatComponentText("Invalid character name")); + return; + } + + sender.addChatMessage(new ChatComponentText("Cleared player for character " + character)); + CharacterRoleAPI.removeCharacterRole(character); + } else if (action.equals("get")) { + UUID uuid = CharacterRoleAPI.getCharacterRoleUUID(character); + if (uuid == null) { + sender.addChatMessage(new ChatComponentText("Character " + character + " is unclaimed")); + return; + } + String player_name = Utilities.getPlayerByUUID(uuid).getCommandSenderName(); + if (player_name != null) { + sender.addChatMessage(new ChatComponentText("Character " + character + " is currently set to " + player_name)); + return; + } + sender.addChatMessage(new ChatComponentText("Character " + character + " is currently set to offline player " + uuid.toString())); + } else { + sender.addChatMessage(new ChatComponentText("Incorrect arguments. Usage: " + getCommandUsage(sender))); + return; + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/CoreMod.java b/src/main/java/com/zivilon/cinder_loe/coremod/CoreMod.java new file mode 100644 index 0000000..09716a8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/CoreMod.java @@ -0,0 +1,43 @@ +package com.zivilon.cinder_loe.coremod; + +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; +import org.spongepowered.asm.launch.MixinBootstrap; +import org.spongepowered.asm.mixin.Mixins; +import java.util.Map; + +@TransformerExclusions({"com.zivilon.cinder_loe.coremod"}) +@SortingIndex(1001) +@MCVersion("1.7.10") +public class CoreMod implements IFMLLoadingPlugin { + @Override + public String[] getASMTransformerClass() { + return new String[] {"com.zivilon.cinder_loe.coremod.LOTRMaterialTransformer","com.zivilon.cinder_loe.coremod.DwarvenForgeTransformer","com.zivilon.cinder_loe.coremod.LOTRWeaponLinker", "com.zivilon.cinder_loe.coremod.LOTRBannerAdder", "com.zivilon.cinder_loe.coremod.LOTRSpawnListLinker", "com.zivilon.cinder_loe.coremod.OptiFinePatcher"}; + } + + @Override + public String getModContainerClass() { + // Return the class name of your @Mod class + return null; + } + + @Override + public String getSetupClass() { + // Return the class name that sets up coremod environment, or null if none + return null; + } + + @Override + public void injectData(Map data) { + MixinBootstrap.init(); + Mixins.addConfiguration("mixins.cinder_loe.json"); + } + + @Override + public String getAccessTransformerClass() { + // Return the class name of your access transformer or null if none + return null; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.java new file mode 100644 index 0000000..4f08720 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRBannerAdder.java @@ -0,0 +1,168 @@ +package com.zivilon.cinder_loe.coremod; + +import net.minecraft.launchwrapper.IClassTransformer; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.IntInsnNode; +import org.objectweb.asm.tree.TypeInsnNode; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; + +import java.util.List; +import java.util.ArrayList; + +public class LOTRBannerAdder implements IClassTransformer { + public static List custom_banners = new ArrayList<>(); + + public void registerBanners() { + custom_banners = new ArrayList<>(); + // Arguments: enum name, texture name, ID, faction name +// register("RED_DWARF", "redDwarf", 42, "DURINS_FOLK"); +// register("TEST", "test", 43, "GONDOR"); + + // NOT FUNCTIONAL, DO NOT REGISTER + // Non-compliant clients crash if original banner is unrecognized even if fallback is vanilla + // Most likely something in PacketEntityMetadata + } + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if ("lotr.common.item.LOTRItemBanner$BannerType".equals(transformedName)) { + registerBanners(); + + // Get class + ClassReader classReader = new ClassReader(basicClass); + ClassNode classNode = new ClassNode(); + classReader.accept(classNode, 0); + + + // Add the new enum constant + for (BannerInfo banner : custom_banners) { + FieldNode newEnumConstant = new FieldNode( + Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_ENUM, + banner.enum_name, + "Llotr/common/item/LOTRItemBanner$BannerType;", + null, + null + ); + classNode.fields.add(newEnumConstant); + } + + + // Locate + MethodNode clinit = null; + for (MethodNode method : classNode.methods) { + if ("".equals(method.name)) { + clinit = method; + break; + } + } + + InsnList insns = clinit.instructions; + AbstractInsnNode constructor_injection_point = null; + + for (int i = 0; i < insns.size(); i++) { + AbstractInsnNode insn = insns.get(i); + // Check if the instruction is a BIPUSH + if (insn.getOpcode() == Opcodes.BIPUSH) { + IntInsnNode intInsn = (IntInsnNode) insn; + // Check if the operand is 42, indicating the size of the $VALUES array + if (intInsn.operand == 42) { + // Found the instruction to modify + constructor_injection_point = insn; + // Modify the operand from 42 to 43 to account for the new enum constant + intInsn.operand = 42 + custom_banners.size(); + System.out.println("Enum array length set to " + intInsn.operand); + System.out.println("Banner list size: " + custom_banners.size()); + break; + } + } + } + + // Create the constructor instructions to add new banner + InsnList constructor_injection = new InsnList(); + for (BannerInfo banner : custom_banners) { + constructor_injection.add(new TypeInsnNode(Opcodes.NEW, "lotr/common/item/LOTRItemBanner$BannerType")); + constructor_injection.add(new InsnNode(Opcodes.DUP)); + System.out.println("Registering with enum " + banner.enum_name); + constructor_injection.add(new LdcInsnNode(banner.enum_name)); + System.out.println("Registering with ordinal " + banner.ordinal); + constructor_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal)); + constructor_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal)); + System.out.println("Registering with identifier " + banner.identifier); + constructor_injection.add(new LdcInsnNode(banner.identifier)); + constructor_injection.add(new FieldInsnNode(Opcodes.GETSTATIC, "lotr/common/fac/LOTRFaction", banner.faction, "Llotr/common/fac/LOTRFaction;")); + constructor_injection.add(new MethodInsnNode(Opcodes.INVOKESPECIAL, "lotr/common/item/LOTRItemBanner$BannerType", "", "(Ljava/lang/String;IILjava/lang/String;Llotr/common/fac/LOTRFaction;)V", false)); + constructor_injection.add(new FieldInsnNode(Opcodes.PUTSTATIC, "lotr/common/item/LOTRItemBanner$BannerType", banner.enum_name, "Llotr/common/item/LOTRItemBanner$BannerType;")); + } + // Insert the new instructions + if (constructor_injection_point != null) { + insns.insertBefore(constructor_injection_point, constructor_injection); + } + + + // Modifying the $VALUES array + // Create new instruction list to be injected later + InsnList values_array_injection = new InsnList(); + + // Add instructions to the instruction list + for (BannerInfo banner : custom_banners) { + values_array_injection.add(new InsnNode(Opcodes.DUP)); + values_array_injection.add(new IntInsnNode(Opcodes.BIPUSH, banner.ordinal)); + values_array_injection.add(new FieldInsnNode(Opcodes.GETSTATIC, "lotr/common/item/LOTRItemBanner$BannerType", banner.enum_name, "Llotr/common/item/LOTRItemBanner$BannerType;")); + values_array_injection.add(new InsnNode(Opcodes.AASTORE)); + } + + // Find the putstatic instruction for $VALUES + // This is where the fields are injected into a list, we want to inject our instructions before this + AbstractInsnNode values_injection_point = null; + + while (constructor_injection_point != null) { + constructor_injection_point = constructor_injection_point.getNext(); + if (constructor_injection_point.getOpcode() == Opcodes.PUTSTATIC) { + values_injection_point = constructor_injection_point; + break; + } + } + + // Insert the new instructions before the putstatic instruction + if (values_injection_point != null) { + insns.insertBefore(values_injection_point, values_array_injection); + } + + // Write the modified class back to a byte array + ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + classNode.accept(classWriter); + return classWriter.toByteArray(); // Return the modified class + } + return basicClass; // Return the unmodified class for all other classes + } + + public void register(String enum_name, String identifier, int ordinal, String faction) { + System.out.println("Registering banner " + enum_name + " " + identifier); + custom_banners.add(new BannerInfo(enum_name, identifier, ordinal, faction)); + } + + public class BannerInfo { + String enum_name; + String identifier; + int ordinal; + String faction; + + public BannerInfo(String enum_name, String identifier, int ordinal, String faction) { + this.enum_name = enum_name; + this.identifier = identifier; + this.ordinal = ordinal; + this.faction = faction; + } + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java new file mode 100644 index 0000000..c81c61e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRMaterialTransformer.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.coremod; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; + +public class LOTRMaterialTransformer implements IClassTransformer { + @Override + public byte[] transform(String name, String transformedName, byte[] classBytes) { + if (transformedName.equals("lotr.common.item.LOTRMaterial")) { + System.out.println("[CinderLoE] Transforming LOTRMaterial..."); + + ClassReader reader = new ClassReader(classBytes); + ClassNode classNode = new ClassNode(); + reader.accept(classNode, 0); + + // Add the RED_DWARF_STEEL field + addMaterial("RED_DWARF", classNode); + addMaterial("WIZARD", classNode); + addMaterial("LIMWAITH_BONE", classNode); + addMaterial("LIMWAITH_WOOD", classNode); + addMaterial("EVENT", classNode); + addMaterial("BREE", classNode); + addMaterial("BATTLENUN", classNode); + + // Convert your ClassNode back to byte array with ClassWriter + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); + + byte[] transformedBytes = writer.toByteArray(); + return transformedBytes; + } + return classBytes; + } + + public void addMaterial(String fieldName, ClassNode classNode) { + FieldNode field = new FieldNode( + Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, + fieldName, + "Llotr/common/item/LOTRMaterial;", // Adjust the descriptor based on the actual package name + null, + null + ); + classNode.fields.add(field); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.java new file mode 100644 index 0000000..917b82f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRSpawnListLinker.java @@ -0,0 +1,49 @@ +package com.zivilon.cinder_loe.coremod; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; + +public class LOTRSpawnListLinker implements IClassTransformer { + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if ("lotr.common.world.spawning.LOTRSpawnList".equals(transformedName)) { + System.out.println("[CinderLoE] Linking CinderLoE spawn-lists to LOTRMod..."); + return addLinks(basicClass, "RED_DWARF", "LIMWAITH"); // Can add any number of items, append with comma + } + return basicClass; + } + + private byte[] addLinks(byte[] classBytes, String... fieldNames) { + ClassReader reader = new ClassReader(classBytes); + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + + reader.accept(new ClassVisitor(Opcodes.ASM5, writer) { + @Override + public void visitEnd() { + // Add each field specified in the fieldNames array + for (String fieldName : fieldNames) { + addSpawnListLink(fieldName, cv); + } + super.visitEnd(); + } + }, 0); + + return writer.toByteArray(); + } + + private void addSpawnListLink(String fieldName, ClassVisitor cv) { + // Define the field with public static access, name from the parameter, and type net.minecraft.item.Item + FieldVisitor fv = cv.visitField(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, fieldName, "Llotr/common/world/spawning/LOTRSpawnList;", null, null); + if (fv != null) { + fv.visitEnd(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java new file mode 100644 index 0000000..9d9ed5d --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/LOTRWeaponLinker.java @@ -0,0 +1,57 @@ +package com.zivilon.cinder_loe.coremod; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldNode; + +public class LOTRWeaponLinker implements IClassTransformer { + + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) { + if ("lotr.common.LOTRMod".equals(transformedName)) { + System.out.println("[CinderLoE] Linking CinderLoE items to LOTRMod..."); + + // Can add any number of items, append with comma + return addLinks(basicClass, + "spearRedDwarf", "crossbowRedDwarf", "swordRedDwarf", "battleaxeRedDwarf", "pikeRedDwarf", "daggerRedDwarf", "daggerRedDwarfPoisoned", "hammerRedDwarf", + "radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff", + "spearLimwaith", "tridentLimwaith", "daggerLimwaith", "daggerLimwaithPoisoned", "truncheonLimwaith", "battleaxeLimwaith", "blowgunLimwaith", + "frostblade", "spearsolidgold", "whip", + "swordBree", + "maceArnor"); + } + return basicClass; + } + + private byte[] addLinks(byte[] classBytes, String... fieldNames) { + ClassReader reader = new ClassReader(classBytes); + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + + reader.accept(new ClassVisitor(Opcodes.ASM5, writer) { + @Override + public void visitEnd() { + // Add each field specified in the fieldNames array + for (String fieldName : fieldNames) { + addItemLink(fieldName, cv); + } + super.visitEnd(); + } + }, 0); + + return writer.toByteArray(); + } + + private void addItemLink(String fieldName, ClassVisitor cv) { + // Define the field with public static access, name from the parameter, and type net.minecraft.item.Item + FieldVisitor fv = cv.visitField(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, fieldName, "Lnet/minecraft/item/Item;", null, null); + if (fv != null) { + fv.visitEnd(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/coremod/OptiFinePatcher.java b/src/main/java/com/zivilon/cinder_loe/coremod/OptiFinePatcher.java new file mode 100644 index 0000000..46d83c5 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/coremod/OptiFinePatcher.java @@ -0,0 +1,130 @@ +package com.zivilon.cinder_loe.coremod; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.AbstractInsnNode; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.FieldInsnNode; +import org.objectweb.asm.tree.FieldNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.LdcInsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.util.Printer; +import org.objectweb.asm.util.Textifier; +import org.objectweb.asm.util.TraceMethodVisitor; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Iterator; + +import net.minecraft.launchwrapper.IClassTransformer; + +public class OptiFinePatcher implements IClassTransformer { + @Override + public byte[] transform(String name, String transformedName, byte[] classBytes) { + if (transformedName.equals("ItemRendererOF")) { + System.out.println("[CinderLoE] Transforming ItemRendererOF..."); + + ClassReader reader = new ClassReader(classBytes); + ClassNode classNode = new ClassNode(); + reader.accept(classNode, 0); + + for (MethodNode method : classNode.methods) { + if (method.name.equals("func_78443_a") && method.desc.equals("(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;I)V")) { + InsnList instructions = method.instructions; + AbstractInsnNode currentNode = null; + Iterator nodes = instructions.iterator(); + + int occurrenceCounter = 0; + + while (nodes.hasNext()) { + currentNode = nodes.next(); + + if (currentNode.getOpcode() == Opcodes.INVOKESTATIC) { + MethodInsnNode methodCall = (MethodInsnNode) currentNode; + if (methodCall.owner.equals("ItemRendererOF") && methodCall.name.equals("func_78439_a") && methodCall.desc.equals("(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) { + occurrenceCounter++; + + InsnNode bool = null; + + if (occurrenceCounter == 1) { + bool = new InsnNode(Opcodes.ICONST_0); + instructions.insertBefore(currentNode, bool); + MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false); + instructions.set(currentNode, newMethodCall); + } + + if (occurrenceCounter == 2) { + bool = new InsnNode(Opcodes.ICONST_1); + instructions.insertBefore(currentNode, bool); + MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false); + instructions.set(currentNode, newMethodCall); + } + + // Modify only the second occurrence + if (occurrenceCounter == 3) { + bool = new InsnNode(Opcodes.ICONST_1); + instructions.insertBefore(currentNode, bool); + MethodInsnNode newMethodCall = new MethodInsnNode(Opcodes.INVOKESTATIC, "com/zivilon/cinder_loe/client/render/item/RenderHelper", "customRenderItemIn2D", "(Lnet/minecraft/client/renderer/Tessellator;FFFFIIFZ)V", false); + instructions.set(currentNode, newMethodCall); + break; + } + } + } + } + // Color code here + int index = -1; + + for (int i = 0; i < instructions.size(); i++) { + currentNode = instructions.get(i); + if (currentNode.getOpcode() == Opcodes.LDC && ((LdcInsnNode) currentNode).cst.equals(0.7599999904632568f)) { + System.out.println("[CinderLoE-Coremod] Found Optifine code to remove..."); + index = i; + break; + } + } + + if (index != -1) { + for (int i = 0; i < 15; i++) { + AbstractInsnNode targetNode = instructions.get(index); + System.out.println(insnToString(targetNode)); + instructions.remove(targetNode); + } + + InsnList toInject = new InsnList(); + toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_red", "F")); + toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_green", "F")); + toInject.add(new FieldInsnNode(Opcodes.GETSTATIC, "com/zivilon/cinder_loe/CinderLoE_Config", "enchantment_color_blue", "F")); + toInject.add(new InsnNode(Opcodes.FCONST_1)); + toInject.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "org/lwjgl/opengl/GL11", "glColor4f", "(FFFF)V", false)); + + instructions.insertBefore(instructions.get(index), toInject); + break; + } + } + } + + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS); + classNode.accept(writer); // Liine 104 + + byte[] transformedBytes = writer.toByteArray(); + return transformedBytes; + } + return classBytes; + } + + // Method to convert an instruction node to string + public static String insnToString(AbstractInsnNode insn){ + insn.accept(new TraceMethodVisitor(new Textifier())); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Textifier textifier = new Textifier(); + TraceMethodVisitor tmv = new TraceMethodVisitor(textifier); + insn.accept(tmv); + textifier.print(pw); + return sw.toString(); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/ArnorBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/ArnorBannerBearer.java new file mode 100644 index 0000000..bd73ba8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/ArnorBannerBearer.java @@ -0,0 +1,23 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.entity.npc.LOTRBannerBearer; +import lotr.common.item.LOTRItemBanner; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ArnorBannerBearer extends ArnorSoldier implements LOTRBannerBearer { + public ArnorBannerBearer(World world) { + super(world); + } + @Override + public LOTRItemBanner.BannerType getBannerType() { + return LOTRItemBanner.BannerType.RANGER_NORTH; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.ArnorSoldierSpawnEgg, 1); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/ArnorCaptain.java b/src/main/java/com/zivilon/cinder_loe/entity/ArnorCaptain.java new file mode 100644 index 0000000..7f892f0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/ArnorCaptain.java @@ -0,0 +1,74 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRCapes; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTRUnitTradeEntries; +import lotr.common.entity.npc.LOTRUnitTradeable; +import lotr.common.world.spawning.LOTRInvasions; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ArnorCaptain extends ArnorSoldier implements LOTRUnitTradeable { + public ArnorCaptain(World world) { + super(world); + addTargetTasks(false); + this.npcCape = LOTRCapes.RANGER; + } + + public float getAlignmentBonus() { + return 5.0F; + } + + public LOTRUnitTradeEntries getUnits() { + return CinderLoE.ARNOR_CAPTAIN; + } + + public LOTRInvasions getWarhorn() { + return LOTRInvasions.RANGER_NORTH; + } + + public void onUnitTrade(EntityPlayer entityplayer) { + } + + public boolean canTradeWith(EntityPlayer entityplayer) { + return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer)); + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.ArnorCaptainSpawnEgg, 1); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(4); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor)); + } else if (i == 1 || i == 2) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.daggerArnor)); + } else if (i == 3 || i == 4) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor)); + } + if (rand.nextInt(4) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor)); + } + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(LOTRMod.bootsArnor)); + setCurrentItemOrArmor(2, new ItemStack(LOTRMod.legsArnor)); + setCurrentItemOrArmor(3, new ItemStack(LOTRMod.bodyArnor)); + setCurrentItemOrArmor(4, null); + return data; + } + public String getSpeechBank(EntityPlayer entityplayer) { + if (isFriendlyAndAligned(entityplayer)) { + return "arnorSoldier/captain/friendly"; + } + return "arnorSoldier/captain/neutral"; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldier.java new file mode 100644 index 0000000..e9aeda5 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldier.java @@ -0,0 +1,95 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.npc.LOTREntityDunedain; +import lotr.common.entity.npc.LOTREntityDwarfWarrior; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityGondorSoldier; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.CinderLoE; + +public class ArnorSoldier extends LOTREntityDunedain { + public ArnorSoldier(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_RANGER; + } + + @Override + public void setupNPCGender() { + this.familyInfo.setMale(true); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(4); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor)); + } else if (i == 1 || i == 2) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.swordArnor)); + } else if (i == 3 || i == 4) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor)); + } + if (rand.nextInt(4) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.spearArnor)); + } + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(LOTRMod.bootsArnor)); + setCurrentItemOrArmor(2, new ItemStack(LOTRMod.legsArnor)); + setCurrentItemOrArmor(3, new ItemStack(LOTRMod.bodyArnor)); + setCurrentItemOrArmor(4, new ItemStack(LOTRMod.helmetArnor)); + return data; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.ArnorSoldierSpawnEgg, 1); + } + @Override + public LOTRFaction getFaction() { + return LOTRFaction.RANGER_NORTH; + } + + @Override + public float getAlignmentBonus() { + return 2.0f; + } + + public String getSpeechBank(EntityPlayer entityplayer) { + if (isFriendlyAndAligned(entityplayer)) { + if (this.hiredNPCInfo.getHiringPlayer() == entityplayer) + return "arnorSoldier/soldier/hired"; + return "arnorSoldier/soldier/friendly"; + } + return "arnorSoldier/soldier/hostile"; + } + + @Override + public LOTRMiniQuest createMiniQuest() { + if (rand.nextInt(8) == 0) { + return LOTRMiniQuestFactory.RANGER_NORTH_ARNOR_RELIC.createQuest(this); + } + return LOTRMiniQuestFactory.RANGER_NORTH.createQuest(this); + } + + @Override + public LOTRMiniQuestFactory getBountyHelpSpeechDir() { + return LOTRMiniQuestFactory.RANGER_NORTH; + } + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.java b/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.java new file mode 100644 index 0000000..91f964a --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/ArnorSoldierArcher.java @@ -0,0 +1,54 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.projectile.LOTREntityDart; +import lotr.common.item.LOTRItemBlowgun; +import lotr.common.item.LOTRItemDart; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ArnorSoldierArcher extends ArnorSoldier { + + public ArnorSoldierArcher(World world) { + super(world); + this.spawnRidingHorse = false; + ((EntityLiving)this).tasks.addTask(0, (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.3, 30, 50, 16.0f)); + this.npcShield = null; + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setRangedWeapon(new ItemStack(LOTRMod.rangerBow)); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon()); + return data; + } + + @Override + protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) { + if (mode == LOTREntityNPC.AttackMode.IDLE) { + this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem()); + } else { + this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon()); + } + } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { + npcArrowAttack(target, f); + } + @Override + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + this.dropNPCArrows(i); + } +} + diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BattleNun.java b/src/main/java/com/zivilon/cinder_loe/entity/BattleNun.java new file mode 100644 index 0000000..7537970 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BattleNun.java @@ -0,0 +1,49 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRAchievement; +import lotr.common.LOTRShields; +import lotr.common.entity.npc.LOTREntityDunedain; +import lotr.common.entity.npc.LOTREntityMoredain; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BattleNun extends ArnorSoldier { + public BattleNun(World world) { + super(world); + this.spawnRidingHorse = false; + this.questInfo.setOfferChance(4000); + this.questInfo.setMinAlignment(150.0f); + this.npcShield = null; + } + + @Override + public void setupNPCGender() { + this.familyInfo.setMale(false); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.maceArnor)); + this.npcItemsInv.setIdleItem(new ItemStack(CinderLoE.maceArnor)); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsArnorBanner)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsArnorBanner)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyArnorBanner)); + if (this.rand.nextBoolean()) { + this.setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetArnorBanner)); + } else { + this.setCurrentItemOrArmor(4, null); + } + return data; + } + + @Override + public LOTRMiniQuest createMiniQuest() { + return LOTRMiniQuestFactory.RANGER_NORTH_ARNOR_RELIC.createQuest(this); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeCaptain.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeCaptain.java new file mode 100644 index 0000000..1d4239e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeCaptain.java @@ -0,0 +1,64 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRAchievement; +import lotr.common.LOTRCapes; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTRUnitTradeEntries; +import lotr.common.entity.npc.LOTRUnitTradeable; +import lotr.common.item.LOTRItemLeatherHat; +import lotr.common.world.spawning.LOTRInvasions; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class BreeCaptain extends BreeSoldier implements LOTRUnitTradeable { + public BreeCaptain(World world) { + super(world); + addTargetTasks(false); + this.npcCape = LOTRCapes.RANGER; + } + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setIdleItem(new ItemStack(Items.writable_book)); + ItemStack hat = new ItemStack(LOTRMod.leatherHat); + LOTRItemLeatherHat.setHatColor(hat, 6834742); + LOTRItemLeatherHat.setFeatherColor(hat, 40960); + this.setCurrentItemOrArmor(4, hat); + return data; + } + public float getAlignmentBonus() { + return 5.0F; + } + + public LOTRUnitTradeEntries getUnits() { + return CinderLoE.BREE_CAPTAIN; + } + + public LOTRInvasions getWarhorn() { + return LOTRInvasions.BREE; + } + + public void onUnitTrade(EntityPlayer entityplayer) { + LOTRLevelData.getData(entityplayer).addAchievement(LOTRAchievement.tradeBreeCaptain); + } + + public boolean canTradeWith(EntityPlayer entityplayer) { + return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer)); + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.BreeCaptainSpawnEgg, 1); + } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeCrossbowman.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeCrossbowman.java new file mode 100644 index 0000000..6f6af37 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeCrossbowman.java @@ -0,0 +1,53 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import lotr.common.entity.npc.LOTREntityNPC; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class BreeCrossbowman extends BreeSoldier { + + public BreeCrossbowman(World world) { + super(world); + this.npcShield = null; + } + + protected int addBreeAttackAI(int prio) { + ((EntityLiving)this).tasks.addTask(prio, (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.25, 30, 50, 16.0f)); + return prio; + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setRangedWeapon(new ItemStack(LOTRMod.ironCrossbow)); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon()); + return data; + } + + @Override + protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) { + if (mode == LOTREntityNPC.AttackMode.IDLE) { + this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem()); + } else { + this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon()); + } + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { + npcCrossbowAttack(target, f); + } + + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + dropNPCCrossbowBolts(i); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java new file mode 100644 index 0000000..ac8c0be --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeOutrider.java @@ -0,0 +1,101 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRCapes; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import lotr.common.entity.animal.LOTREntityHorse; +import lotr.common.entity.npc.LOTREntityGondorSoldier; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class BreeOutrider extends BreeCrossbowman { + protected EntityAIBase rangedAttackAI = this.createBreeRangedAttackAI(); + protected EntityAIBase meleeAttackAI = this.createBreeMeleeAttackAI(); + public BreeOutrider(World world) { + super(world); + this.npcCape = LOTRCapes.RANGER; + this.spawnRidingHorse = true; + this.npcShield = LOTRShields.ALIGNMENT_BREE; + } + + @Override + protected int addBreeAttackAI(int prio) { + ((EntityLiving)this).tasks.addTask(prio, (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.25, 30, 50, 16.0f)); + return prio; + } + + protected EntityAIBase createBreeRangedAttackAI() { + return new LOTREntityAIRangedAttack(this, 1.25, 30, 40, 16.0f); + } + + protected EntityAIBase createBreeMeleeAttackAI() { + return new LOTREntityAIAttackOnCollide(this, 1.45D, false); + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + return data; + } + + @Override + public void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) { + if (this.rangedAttackAI == null) System.out.println("Ranged attack AI is null"); + if (this.meleeAttackAI == null) System.out.println("Melee attack AI is null"); + if (mode == LOTREntityNPC.AttackMode.IDLE) { + ((EntityLiving)this).tasks.removeTask(this.meleeAttackAI); + ((EntityLiving)this).tasks.removeTask(this.rangedAttackAI); + this.setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem()); + } + if (mode == LOTREntityNPC.AttackMode.MELEE) { + ((EntityLiving)this).tasks.removeTask(this.meleeAttackAI); + ((EntityLiving)this).tasks.removeTask(this.rangedAttackAI); + ((EntityLiving)this).tasks.addTask(2, this.meleeAttackAI); + this.setCurrentItemOrArmor(0, this.npcItemsInv.getMeleeWeapon()); + } + if (mode == LOTREntityNPC.AttackMode.RANGED) { + ((EntityLiving)this).tasks.removeTask(this.meleeAttackAI); + ((EntityLiving)this).tasks.removeTask(this.rangedAttackAI); + ((EntityLiving)this).tasks.addTask(2, this.rangedAttackAI); + this.setCurrentItemOrArmor(0, this.npcItemsInv.getRangedWeapon()); + } + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.BreeOutriderSpawnEgg, 1); + } + @Override + public LOTRNPCMount createMountToRide() { + LOTREntityHorse horse = (LOTREntityHorse)super.createMountToRide(); + horse.setMountArmor(new ItemStack(LOTRMod.horseArmorIron)); + return horse; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { + npcCrossbowAttack(target, f); + } + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + dropNPCCrossbowBolts(i); + } + @Override + public float getAlignmentBonus() { + return 3.0f; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldier.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldier.java new file mode 100644 index 0000000..f38af2b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldier.java @@ -0,0 +1,30 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTREntityBreeGuard; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BreeSoldier extends LOTREntityBreeGuard { + private static ItemStack[] guardWeapons = new ItemStack[]{new ItemStack(CinderLoE.swordBree), new ItemStack(CinderLoE.swordBree), new ItemStack(LOTRMod.pikeIron)}; + + public BreeSoldier(World world) { + super(world); + this.spawnRidingHorse = false; + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = (rand.nextInt(guardWeapons.length)); + this.npcItemsInv.setMeleeWeapon(guardWeapons[i].copy()); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsBree)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsBree)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyBree)); + setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetBree)); + return data; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.java new file mode 100644 index 0000000..00b21b8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/BreeSoldierBannerBearer.java @@ -0,0 +1,22 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTRBannerBearer; +import lotr.common.item.LOTRItemBanner; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.world.World; + +public class BreeSoldierBannerBearer extends BreeSoldier implements LOTRBannerBearer { + public BreeSoldierBannerBearer(World world) { + super(world); + } + @Override + public LOTRItemBanner.BannerType getBannerType() { + return LOTRItemBanner.BannerType.BREE; + } + + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornAnimal.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornAnimal.java new file mode 100644 index 0000000..e13fc52 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornAnimal.java @@ -0,0 +1,85 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRAchievement; +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; +import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import lotr.common.world.LOTRWorldChunkManager; +import lotr.common.world.biome.LOTRBiome; +import lotr.common.world.biome.variant.LOTRBiomeVariant; +import lotr.common.world.structure.LOTRChestContents; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.WorldChunkManager; + +public abstract class FangornAnimal extends LOTREntityNPC { + public FangornAnimal(World world) { + super(world); + setSize(1.6F, 1.8F); + getNavigator().setAvoidsWater(true); + ((EntityLiving)this).tasks.addTask(0, (EntityAIBase)new EntityAISwimming((EntityLiving)this)); + ((EntityLiving)this).tasks.addTask(1, (EntityAIBase)new LOTREntityAIHiredRemainStill(this)); + ((EntityLiving)this).tasks.addTask(2, (EntityAIBase)new LOTREntityAIAttackOnCollide(this, 1.6D, false)); + ((EntityLiving)this).tasks.addTask(3, (EntityAIBase)new LOTREntityAIFollowHiringPlayer(this)); + ((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new EntityAIWander(this, 1.0D)); + ((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 8.0F, 0.02F)); + ((EntityLiving)this).tasks.addTask(6, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 5.0F, 0.02F)); + ((EntityLiving)this).tasks.addTask(7, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityLiving.class, 8.0F, 0.02F)); + ((EntityLiving)this).tasks.addTask(8, (EntityAIBase)new EntityAILookIdle((EntityLiving)this)); + addTargetTasks(true); + } + + public boolean canWorldGenSpawnAt(int i, int j, int k, LOTRBiome biome, LOTRBiomeVariant variant) { + int trees = biome.decorator.getVariantTreesPerChunk(variant); + return (trees >= 1); + } + + public LOTRFaction getFaction() { + return LOTRFaction.FANGORN; + } + + public float getAlignmentBonus() { + return 0.0F; + } + + public boolean getCanSpawnHere() { + WorldChunkManager worldChunkMgr = ((Entity)this).worldObj.getWorldChunkManager(); + if (worldChunkMgr instanceof LOTRWorldChunkManager) { + int i = MathHelper.floor_double(((Entity)this).posX); + int j = MathHelper.floor_double(((Entity)this).boundingBox.minY); + int k = MathHelper.floor_double(((Entity)this).posZ); + LOTRBiome biome = (LOTRBiome)((Entity)this).worldObj.getBiomeGenForCoords(i, k); + LOTRBiomeVariant variant = ((LOTRWorldChunkManager)worldChunkMgr).getBiomeVariantAt(i, k); + return (super.getCanSpawnHere() && canWorldGenSpawnAt(i, j, k, biome, variant)); + } + return super.getCanSpawnHere(); + } + + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornAuroch.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornAuroch.java new file mode 100644 index 0000000..4bc6a30 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornAuroch.java @@ -0,0 +1,79 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraft.util.MovingObjectPosition; + +import java.util.List; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class FangornAuroch extends FangornAnimal { + public FangornAuroch(World world) { + super(world); + setSize(1.5F, 1.7F); + } + + public void entityInit() { + super.entityInit(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f); + } + + protected void dropFewItems(boolean flag, int i) { + int hides = 2 + rand.nextInt(3) + rand.nextInt(1 + i); + for (int l = 0; l < hides; l++) + dropItem(Items.leather, 1); + int meats = 2 + rand.nextInt(3) + rand.nextInt(1 + i); + for (int j = 0; j < meats; j++) { + if (isBurning()) { + dropItem(Items.cooked_beef, 1); + } else { + dropItem(Items.beef, 1); + } + } + dropItem(LOTRMod.horn, 1); + } + + protected String getLivingSound() { + return "lotr:aurochs.say"; + } + + protected String getHurtSound() { + return "lotr:aurochs.hurt"; + } + + protected String getDeathSound() { + return "lotr:aurochs.hurt"; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // No ranged attack implemented + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.fangornAurochSpawnEgg, 1); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornBear.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornBear.java new file mode 100644 index 0000000..8ab23b0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornBear.java @@ -0,0 +1,148 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import lotr.common.entity.animal.LOTREntityBear; +import lotr.common.entity.animal.LOTREntityBear.BearType; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.List; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class FangornBear extends FangornAnimal { + public FangornBear(World world) { + super(world); + setSize(1.6F, 1.8F); + } + private int hostileTick = 0; + + public void entityInit() { + super.entityInit(); + dataWatcher.addObject(18, Byte.valueOf((byte)0)); + dataWatcher.addObject(20, Byte.valueOf((byte)0)); + setBearType(LOTREntityBear.BearType.forID(rand.nextInt((BearType.values()).length))); + } + + public BearType getBearType() { + int i = dataWatcher.getWatchableObjectByte(18); + return BearType.forID(i); + } + + public void setBearType(BearType t) { + dataWatcher.updateObject(18, Byte.valueOf((byte)t.bearID)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + public static class BearGroupSpawnData implements IEntityLivingData { + private BearGroupSpawnData() {} + + public int numSpawned = 0; + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f); + } + public boolean attackEntityFrom(DamageSource damagesource, float f) { + boolean flag = super.attackEntityFrom(damagesource, f); + if (flag) { + Entity attacker = damagesource.getEntity(); + if (attacker instanceof EntityLivingBase) + if (isChild()) { + double range = 12.0D; + List list = ((Entity)this).worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, ((Entity)this).boundingBox.expand(range, range, range)); + for (Object obj : list) { + Entity entity = (Entity)obj; + if (entity instanceof FangornBear) { + FangornBear bear = (FangornBear)entity; + if (!bear.isChild()) + bear.becomeAngryAt((EntityLivingBase)attacker); + } + } + } else { + becomeAngryAt((EntityLivingBase)attacker); + } + } + return flag; + } + + private void becomeAngryAt(EntityLivingBase entity) { + setAttackTarget(entity); + this.hostileTick = 200; + } + + public void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); + nbt.setByte("BearType", (byte)(getBearType()).bearID); + nbt.setInteger("Angry", this.hostileTick); + } + + public void readEntityFromNBT(NBTTagCompound nbt) { + super.readEntityFromNBT(nbt); + if (nbt.hasKey("BearType")) + setBearType(BearType.forID(nbt.getByte("BearType"))); + this.hostileTick = nbt.getInteger("Angry"); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + if (data == null) { + data = new BearGroupSpawnData(); + ((BearGroupSpawnData)data).numSpawned = 1; + } else if (data instanceof BearGroupSpawnData) { + BearGroupSpawnData bgsd = (BearGroupSpawnData)data; + bgsd.numSpawned++; + } + if (rand.nextInt(10000) == 0) setCustomNameTag("Wojtek"); + return data; + } + + protected void dropFewItems(boolean flag, int i) { + int furs = 1 + rand.nextInt(3) + rand.nextInt(i + 1); + for (int l = 0; l < furs; l++) + dropItem(LOTRMod.fur, 1); + if (flag) { + int rugChance = 30 - i * 5; + rugChance = Math.max(rugChance, 1); + if (rand.nextInt(rugChance) == 0) + entityDropItem(new ItemStack(LOTRMod.bearRug, 1, (getBearType()).bearID), 0.0F); + } + } + protected String getLivingSound() { + return "lotr:bear.say"; + } + + protected String getHurtSound() { + return "lotr:bear.hurt"; + } + + protected String getDeathSound() { + return "lotr:bear.death"; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // No ranged attack implemented + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.fangornBearSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornElk.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornElk.java new file mode 100644 index 0000000..aff8ddc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornElk.java @@ -0,0 +1,83 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.List; +import java.util.UUID; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class FangornElk extends FangornAnimal { + public FangornElk(World world) { + super(world); + setSize(1.6F, 1.8F); + } + + public void entityInit() { + super.entityInit(); + } + + public void setUniqueID(UUID uuid) { + entityUniqueID = uuid; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(35.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f); + } + + protected void dropFewItems(boolean flag, int i) { + int hide = rand.nextInt(3) + rand.nextInt(1 + i); + for (int l = 0; l < hide; l++) + dropItem(Items.leather, 1); + int meat = rand.nextInt(3) + rand.nextInt(1 + i); + for (int j = 0; j < meat; j++) { + if (isBurning()) { + dropItem(LOTRMod.deerCooked, 1); + } else { + dropItem(LOTRMod.deerRaw, 1); + } + } + } + + protected String getLivingSound() { + return "lotr:elk.say"; + } + + protected String getHurtSound() { + return "lotr:elk.hurt"; + } + + protected String getDeathSound() { + return "lotr:elk.death"; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // No ranged attack implemented + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.fangornElkSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornWildBoar.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornWildBoar.java new file mode 100644 index 0000000..239ec53 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornWildBoar.java @@ -0,0 +1,74 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.List; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class FangornWildBoar extends FangornAnimal { + public FangornWildBoar(World world) { + super(world); + setSize(0.9F, 0.8F); + } + + public void entityInit() { + super.entityInit(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f); + } + + protected void dropFewItems(boolean flag, int i) { + int meat = rand.nextInt(3) + 1 + rand.nextInt(1 + i); + for (int l = 0; l < meat; l++) { + if (isBurning()) { + dropItem(Items.cooked_porkchop, 1); + } else { + dropItem(Items.porkchop, 1); + } + } + } + protected String getLivingSound() { + return "mob.pig.say"; + } + + protected String getHurtSound() { + return "mob.pig.say"; + } + + protected String getDeathSound() { + return "mob.pig.death"; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // No ranged attack implemented + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.fangornWildBoarSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/FangornWolf.java b/src/main/java/com/zivilon/cinder_loe/entity/FangornWolf.java new file mode 100644 index 0000000..a71243e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/FangornWolf.java @@ -0,0 +1,70 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +import java.util.List; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +public class FangornWolf extends FangornAnimal { + public FangornWolf(World world) { + super(world); + setSize(0.6F, 0.8F); + } + + public void entityInit() { + super.entityInit(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); + getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D); + } + + public boolean attackEntityAsMob(Entity entity) { + float f = (float)getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + return entity.attackEntityFrom(DamageSource.causeMobDamage((EntityLivingBase)this), f); + } + + protected void dropFewItems(boolean flag, int i) { + int meat = rand.nextInt(3) + 1 + rand.nextInt(1 + i); + for (int l = 0; l < meat; l++) { + if (isBurning()) { + dropItem(Items.cooked_porkchop, 1); + } else { + dropItem(Items.porkchop, 1); + } + } + } + protected String getLivingSound() { + return "mob.wolf.growl"; + } + + protected String getHurtSound() { + return "mob.wolf.hurt"; + } + + protected String getDeathSound() { + return "mob.wolf.death"; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // No ranged attack implemented + } + + +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/Limwaith.java b/src/main/java/com/zivilon/cinder_loe/entity/Limwaith.java new file mode 100644 index 0000000..8c7bad8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/Limwaith.java @@ -0,0 +1,70 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTREntityMoredain; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.LOTRAchievement; +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIDrink; +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; +import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; +import lotr.common.entity.animal.LOTREntityZebra; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import lotr.common.world.structure.LOTRChestContents; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import com.zivilon.cinder_loe.CinderLoE; + +public class Limwaith extends LOTREntityMoredain { + public Limwaith(World world) { + super(world); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaith)); + this.npcItemsInv.setIdleItem(null); + return data; + } + + protected LOTRAchievement getKillAchievement() { + return null; + } + + public LOTRNPCMount createMountToRide() { + return null; +// return (LOTRNPCMount)new LimwaithCrocodile(((Entity)this).worldObj); + } + + public String getSpeechBank(EntityPlayer entityplayer) { + if (isFriendlyAndAligned(entityplayer)) { + if (this.hiredNPCInfo.getHiringPlayer() == entityplayer) + return "limwaith/moredain/hired"; + return "limwaith/moredain/friendly"; + } + return "limwaith/moredain/hostile"; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.java new file mode 100644 index 0000000..a7645da --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBannerBearer.java @@ -0,0 +1,24 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTRBannerBearer; +import lotr.common.item.LOTRItemBanner; +import net.minecraft.world.World; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.item.ItemStack; + +import com.zivilon.cinder_loe.entity.LimwaithWarrior; +import com.zivilon.cinder_loe.CinderLoE; + +public class LimwaithBannerBearer extends LimwaithWarrior implements LOTRBannerBearer { + public LimwaithBannerBearer(World world) { + super(world); + } + + public LOTRItemBanner.BannerType getBannerType() { + return LOTRItemBanner.BannerType.MOREDAIN; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.limwaithBannerBearerSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.java b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.java new file mode 100644 index 0000000..3b1f43b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithBlowgunner.java @@ -0,0 +1,74 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import lotr.common.entity.projectile.LOTREntityDart; +import lotr.common.item.LOTRItemBlowgun; +import lotr.common.item.LOTRItemDart; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.Limwaith; + +public class LimwaithBlowgunner extends Limwaith { + public LimwaithBlowgunner(World world) { + super(world); + } + + public EntityAIBase createHaradrimAttackAI() { + return (EntityAIBase)new LOTREntityAIRangedAttack(this, 1.5D, 10, 30, 16.0F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(24.0D); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.blowgunLimwaith)); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsLimwaith)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsLimwaith)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyLimwaith)); + return data; + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { + ItemStack heldItem = getHeldItem(); + float str = 1.0F + getDistanceToEntity((Entity)target) / 16.0F * 0.015F; + str *= LOTRItemBlowgun.getBlowgunLaunchSpeedFactor(heldItem); + LOTREntityDart dart = ((LOTRItemDart)LOTRMod.tauredainDart).createDart(((Entity)this).worldObj, (EntityLivingBase)this, target, new ItemStack(LOTRMod.tauredainDart), str, 1.0F); + if (heldItem != null) + LOTRItemBlowgun.applyBlowgunModifiers(dart, heldItem); + playSound("lotr:item.dart", 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 1.2F) + 0.5F); + ((Entity)this).worldObj.spawnEntityInWorld((Entity)dart); + } + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + dropNPCAmmo(LOTRMod.tauredainDart, i); + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.limwaithBlowgunnerSpawnEgg, 1); + } + +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/entity/LimwaithChieftain.java b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithChieftain.java new file mode 100644 index 0000000..02c055e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithChieftain.java @@ -0,0 +1,44 @@ +package com.zivilon.cinder_loe.entity; + +import net.minecraft.world.World; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; + +import lotr.common.LOTRLevelData; +import lotr.common.entity.npc.LOTRUnitTradeable; +import lotr.common.entity.npc.LOTRUnitTradeEntries; +import lotr.common.world.spawning.LOTRInvasions; + +import com.zivilon.cinder_loe.entity.LimwaithWarrior; +import com.zivilon.cinder_loe.CinderLoE; + +public class LimwaithChieftain extends LimwaithWarrior implements LOTRUnitTradeable { + public LimwaithChieftain(World world) { + super(world); + addTargetTasks(false); + } + + public float getAlignmentBonus() { + return 5.0F; + } + + public LOTRUnitTradeEntries getUnits() { + return CinderLoE.LIMWAITH_COMMANDER; + } + + public LOTRInvasions getWarhorn() { + return LOTRInvasions.MOREDAIN; + } + + public void onUnitTrade(EntityPlayer entityplayer) { + } + + public boolean canTradeWith(EntityPlayer entityplayer) { + return (LOTRLevelData.getData(entityplayer).getAlignment(getFaction()) >= 150.0F && isFriendlyAndAligned(entityplayer)); + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.limwaithChieftainSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/LimwaithWarrior.java b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithWarrior.java new file mode 100644 index 0000000..981dfcc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/LimwaithWarrior.java @@ -0,0 +1,86 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTREntityMoredain; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.LOTRAchievement; +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIDrink; +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; +import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; +import lotr.common.entity.animal.LOTREntityZebra; +import lotr.common.fac.LOTRFaction; +import lotr.common.quest.LOTRMiniQuest; +import lotr.common.quest.LOTRMiniQuestFactory; +import lotr.common.world.structure.LOTRChestContents; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.entity.Limwaith; + +public class LimwaithWarrior extends Limwaith { + public LimwaithWarrior(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_MOREDAIN; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(7); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.truncheonLimwaith)); + } else if (i == 1 || i == 2) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.tridentLimwaith)); + } else if (i == 3 || i == 4) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith)); + } else if (i == 5) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeLimwaith)); + } else if (i == 6) { + if (rand.nextInt(2) == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaith)); + } else { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.daggerLimwaithPoisoned)); + } + } + + if (rand.nextInt(6) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearLimwaith)); + } + + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsLimwaith)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsLimwaith)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyLimwaith)); + if (rand.nextInt(10) != 0) + setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetLimwaith)); + return data; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.limwaithWarriorSpawnEgg, 1); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfArbalest.java b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfArbalest.java new file mode 100644 index 0000000..775b33b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfArbalest.java @@ -0,0 +1,46 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTREntityDwarfAxeThrower; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIRangedAttack; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.init.Items; +import net.minecraft.util.MovingObjectPosition; + +import com.zivilon.cinder_loe.CinderLoE; + +public class RedDwarfArbalest extends LOTREntityDwarfAxeThrower { + public RedDwarfArbalest(World world) { + super(world); + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(5); + this.npcItemsInv.setRangedWeapon(new ItemStack(CinderLoE.crossbowRedDwarf)); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getRangedWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf)); + setCurrentItemOrArmor(4, null); + if (rand.nextInt(10) != 0) + setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf)); + return data; + } + public void attackEntityWithRangedAttack(EntityLivingBase target, float f) { + npcCrossbowAttack(target, f); + } + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + dropNPCCrossbowBolts(i); + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.redDwarfArbalestSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.java b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.java new file mode 100644 index 0000000..7df9cff --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfBannerBearer.java @@ -0,0 +1,25 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import lotr.common.item.LOTRItemBanner; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import lotr.common.entity.npc.LOTRBannerBearer; +import net.minecraft.util.MovingObjectPosition; + +import com.zivilon.cinder_loe.CinderLoE; + +public class RedDwarfBannerBearer extends RedDwarfWarrior implements LOTRBannerBearer { + public RedDwarfBannerBearer(World world) { + super(world); + } + + public LOTRItemBanner.BannerType getBannerType() { + return LOTRItemBanner.BannerType.DWARF; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.redDwarfBannerBearerSpawnEgg, 1); + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfCommander.java b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfCommander.java new file mode 100644 index 0000000..dfba8a2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfCommander.java @@ -0,0 +1,51 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.LOTRMod; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import lotr.common.entity.npc.LOTREntityDwarfCommander; +import lotr.common.entity.npc.LOTRUnitTradeable; +import lotr.common.entity.npc.LOTRUnitTradeEntries; +import net.minecraft.util.MovingObjectPosition; + +import com.zivilon.cinder_loe.CinderLoE; + +public class RedDwarfCommander extends LOTREntityDwarfCommander implements LOTRUnitTradeable { + public RedDwarfCommander(World world) { + super(world); + addTargetTasks(false); + } + + public LOTRUnitTradeEntries getUnits() { + return CinderLoE.RED_DWARF_COMMANDER; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(5); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.swordRedDwarf)); + } else if (i == 1 || i == 2) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeRedDwarf)); + } else if (i == 3 || i == 4) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf)); + } + if (rand.nextInt(6) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf)); + } + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf)); + setCurrentItemOrArmor(4, null); + if (rand.nextInt(10) != 0) + setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf)); + return data; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.redDwarfCommanderSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfWarrior.java b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfWarrior.java new file mode 100644 index 0000000..057379c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/RedDwarfWarrior.java @@ -0,0 +1,49 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.npc.LOTREntityDwarfWarrior; +import lotr.common.LOTRMod; +import lotr.common.LOTRShields; +import net.minecraft.entity.Entity; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.CinderLoE; + +public class RedDwarfWarrior extends LOTREntityDwarfWarrior { + public RedDwarfWarrior(World world) { + super(world); + this.npcShield = LOTRShields.ALIGNMENT_DWARF; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + int i = rand.nextInt(6); + if (i == 0) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.swordRedDwarf)); + } else if (i == 1 || i == 2) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.battleaxeRedDwarf)); + } else if (i == 3 || i == 4) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.pikeRedDwarf)); + } else if (i == 5) { + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.hammerRedDwarf)); + } + if (rand.nextInt(6) == 0) { + this.npcItemsInv.setSpearBackup(this.npcItemsInv.getMeleeWeapon()); + this.npcItemsInv.setMeleeWeapon(new ItemStack(CinderLoE.spearRedDwarf)); + } + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + setCurrentItemOrArmor(1, new ItemStack(CinderLoE.bootsRedDwarf)); + setCurrentItemOrArmor(2, new ItemStack(CinderLoE.legsRedDwarf)); + setCurrentItemOrArmor(3, new ItemStack(CinderLoE.bodyRedDwarf)); + setCurrentItemOrArmor(4, null); + if (rand.nextInt(10) != 0) + setCurrentItemOrArmor(4, new ItemStack(CinderLoE.helmetRedDwarf)); + return data; + } + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.redDwarfWarriorSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/Renegade.java b/src/main/java/com/zivilon/cinder_loe/entity/Renegade.java new file mode 100644 index 0000000..dc67a5f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/Renegade.java @@ -0,0 +1,193 @@ +package com.zivilon.cinder_loe.entity; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IRangedAttackMob; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIOpenDoor; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIDrink; +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; +import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; +import lotr.common.entity.animal.LOTREntityHorse; +import lotr.common.entity.npc.LOTREntityMan; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.entity.npc.LOTRNames; +import lotr.common.fac.LOTRFaction; + +import com.zivilon.cinder_loe.CinderLoE; + +public class Renegade extends LOTREntityMan { + + public Renegade(World world) { + super(world); + setSize(0.6F, 1.8F); + getNavigator().setAvoidsWater(true); + getNavigator().setBreakDoors(true); + ((EntityLiving) this).tasks.addTask(0, (EntityAIBase) new EntityAISwimming((EntityLiving) this)); + ((EntityLiving) this).tasks.addTask(1, (EntityAIBase) new LOTREntityAIHiredRemainStill(this)); + ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false)); + ((EntityLiving) this).tasks.addTask(3, (EntityAIBase) new LOTREntityAIFollowHiringPlayer(this)); + ((EntityLiving) this).tasks.addTask(4, (EntityAIBase) new EntityAIOpenDoor((EntityLiving) this, true)); + ((EntityLiving) this).tasks.addTask(6, (EntityAIBase) new LOTREntityAIEat(this, LOTRFoods.DUNLENDING, 8000)); + ((EntityLiving) this).tasks.addTask(6, (EntityAIBase) new LOTREntityAIDrink(this, LOTRFoods.DUNLENDING_DRINK, 8000)); + ((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, EntityPlayer.class, 8.0F, 0.02F)); + ((EntityLiving) this).tasks.addTask(7, (EntityAIBase) new EntityAIWatchClosest2((EntityLiving) this, LOTREntityNPC.class, 5.0F, 0.02F)); + ((EntityLiving) this).tasks.addTask(8, (EntityAIBase) new EntityAIWatchClosest((EntityLiving) this, EntityLiving.class, 8.0F, 0.02F)); + ((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this)); + addTargetTasks(true); + } + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // Do nothing + } + + public LOTRNPCMount createMountToRide() { + LOTREntityHorse horse = (LOTREntityHorse) super.createMountToRide(); + horse.setMountArmor(new ItemStack(LOTRMod.horseArmorIron)); + return (LOTRNPCMount) horse; + } + + public void setupNPCGender() { + this.familyInfo.setMale(this.rand.nextBoolean()); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + } + + public LOTRFaction getFaction() { + return LOTRFaction.UTUMNO; + } + + public String getNPCName() { + return this.familyInfo.getName(); + } + + public String getNPCFormattedName(String npcName, String entityName) { + if (getClass() == Renegade.class) return StatCollector + .translateToLocalFormatted("entity.cinder_loe.Renegade.entityName", new Object[] { npcName }); + return super.getNPCFormattedName(npcName, entityName); + } + + protected void onAttackModeChange(LOTREntityNPC.AttackMode mode, boolean mounted) { + if (mode == LOTREntityNPC.AttackMode.IDLE) { + setCurrentItemOrArmor(0, this.npcItemsInv.getIdleItem()); + } else { + setCurrentItemOrArmor(0, this.npcItemsInv.getMeleeWeapon()); + ((EntityLiving) this).tasks.addTask(5, (EntityAIBase) new EntityAIWander(this, 1.0D)); + } + } + + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + int bones = this.rand.nextInt(2) + this.rand.nextInt(i + 1); + for (int l = 0; l < bones; l++) dropItem(Items.bone, 1); + } + + public boolean getCanSpawnHere() { + return false; + } + + public String getSpeechBank(EntityPlayer entityplayer) { + if (isDrunkard()) return "renegade/drunkard/neutral"; + return "renegade/man/hostile"; + } + + List codeOptions = Arrays.asList(() -> { + this.familyInfo.setName(LOTRNames.getGondorName(this.rand, this.familyInfo.isMale())); + }, () -> { + this.familyInfo.setName(LOTRNames.getBreeName(this.rand, this.familyInfo.isMale())); + }, () -> { + this.familyInfo.setName(LOTRNames.getRhudaurName(this.rand, this.familyInfo.isMale())); + }, () -> { + this.familyInfo.setName(LOTRNames.getRohirricName(this.rand, this.familyInfo.isMale())); + }, + /* + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getDunlendingName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getDorwinionName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getDalishName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getRhunicName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getUmbarName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getHarnennorName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getSouthronCoastName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getNomadName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getGulfHaradName(this.rand, this.familyInfo.isMale())), + * } + * () -> { + * System.out.println("[CinderCore] Executing GondorName"); + * this.familyInfo.setName(LOTRNames.getMoredainName(this.rand, this.familyInfo.isMale())), + * } + */ + () -> { + this.familyInfo.setName(LOTRNames.getTauredainName(this.rand, this.familyInfo.isMale())); + }); + + public void setupNPCName() { + if (this.familyInfo == null) System.out.println("[CinderCore] Family info is null"); + if (this.rand == null) System.out.println("[CinderCore] rand is null"); + Boolean gender = this.familyInfo.isMale(); + if (gender == null) System.out.println("[CinderCore] Gender is null"); + /* + * int randomIndex = this.rand.nextInt(codeOptions.size()); + * codeOptions.get(randomIndex) + * .run();; + */ + this.familyInfo.setName(LOTRNames.getDorwinionName(this.rand, this.familyInfo.isMale())); + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.renegadeSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/RenegadeCaptain.java b/src/main/java/com/zivilon/cinder_loe/entity/RenegadeCaptain.java new file mode 100644 index 0000000..36adb59 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/RenegadeCaptain.java @@ -0,0 +1,37 @@ +package com.zivilon.cinder_loe.entity; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.entity.ai.*; +import lotr.common.entity.animal.LOTREntityHorse; +import lotr.common.entity.npc.LOTREntityMan; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTRNPCMount; +import lotr.common.entity.npc.LOTRNames; +import lotr.common.fac.LOTRFaction; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import java.util.Arrays; +import java.util.List; + +public class RenegadeCaptain extends Renegade { + + public RenegadeCaptain(World world) { + super(world); + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.renegadeCaptainSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/SarumanFireball.java b/src/main/java/com/zivilon/cinder_loe/entity/SarumanFireball.java new file mode 100644 index 0000000..7f7fab7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/SarumanFireball.java @@ -0,0 +1,102 @@ +package com.zivilon.cinder_loe.entity; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; + +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.animal.LOTREntityHorse; +import lotr.common.entity.projectile.LOTREntityGandalfFireball; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import java.util.ArrayList; +import java.util.List; + +public class SarumanFireball extends LOTREntityGandalfFireball { + public SarumanFireball(World world) { + super(world); + } + + public SarumanFireball(World world, EntityLivingBase entityliving) { + super(world, entityliving); + } + + public SarumanFireball(World world, double d, double d1, double d2) { + super(world, d, d1, d2); + } + + protected void onImpact(MovingObjectPosition m) { + if (!((Entity)this).worldObj.isRemote) + if (m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + explode((Entity)null); + } else if (m.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) { + explode(m.entityHit); + } + } + + private void explode(Entity target) { + if (((Entity)this).worldObj.isRemote) + return; + ((Entity)this).worldObj.playSoundAtEntity((Entity)this, "lotr:item.gandalfFireball", 4.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); + + List entities = ((Entity)this).worldObj.getEntitiesWithinAABB(EntityLiving.class, ((Entity)this).boundingBox.expand(6.0D, 6.0D, 6.0D)); + + if (!entities.isEmpty()) + for (int i = 0; i < entities.size(); i++) { + Entity entity = entities.get(i); + if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer) && !(entity instanceof LOTREntityHorse && ((LOTREntityHorse)entity).getBelongsToNPC() == true)) { + targetRandomEntity((EntityLiving)entity); + } + } + setDead(); + } + + public void targetRandomEntity(EntityLiving npc) { + LOTRFaction faction = null; + if (npc instanceof LOTREntityNPC) { + LOTREntityNPC lotrNpc = (LOTREntityNPC) npc; + faction = lotrNpc.getFaction(); + } + + // Define the search area based on the npc's location + IAttributeInstance followRangeAttribute = npc.getEntityAttribute(SharedMonsterAttributes.followRange); + double range = followRangeAttribute != null ? followRangeAttribute.getAttributeValue() : 12.0D; // Default to 12 if attribute is not found + + AxisAlignedBB searchArea = npc.boundingBox.expand(range, 4.0D, range); + + // Filter potential targets to not include hiring player or NPCs from same faction + List allTargets = npc.worldObj.getEntitiesWithinAABB(EntityLiving.class, searchArea); + List validTargets = new ArrayList<>(); + + for (EntityLiving potentialTarget : allTargets) { + Entity entity = (Entity)potentialTarget; // Because for some reason I can't directly check if EntityLiving is instance of EntityPlayer + if (entity != npc && + !(entity instanceof EntityPlayer) && + !(entity instanceof LOTREntityNPC && faction != null && ((LOTREntityNPC)entity).getFaction() == faction) && + !(entity instanceof LOTREntityHorse && ((LOTREntityHorse)entity).getBelongsToNPC() == true)) { + validTargets.add(potentialTarget); + } + } + + // Randomly select a new target from the filtered list + if (!validTargets.isEmpty()) { + EntityLiving newTarget = validTargets.get(npc.getRNG().nextInt(validTargets.size())); + npc.setAttackTarget(newTarget); // Set the new attack target + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/entity/SpeechBankModifier.java b/src/main/java/com/zivilon/cinder_loe/entity/SpeechBankModifier.java new file mode 100644 index 0000000..30386ed --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/SpeechBankModifier.java @@ -0,0 +1,108 @@ +package com.zivilon.cinder_loe.entity; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.Map; +import java.util.HashMap; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import com.zivilon.cinder_loe.CinderLoE; + +import cpw.mods.fml.common.ModContainer; + +public class SpeechBankModifier { + + public static List loadSpeechLines(String speechBankName) { + String speechPath = "assets/cinder_loe/speech/" + speechBankName + ".txt"; + List lines = new ArrayList<>(); + ZipFile zip = null; + + try { + ModContainer modContainer = CinderLoE.getModContainer(); + zip = new ZipFile(modContainer.getSource()); + + Enumeration entries = zip.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + if (entry.getName() + .startsWith(speechPath) + && entry.getName() + .endsWith(".txt")) { + InputStream inputStream = zip.getInputStream(entry); + BufferedReader reader = new BufferedReader( + new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + + String line; + while ((line = reader.readLine()) != null) { + lines.add(line); + } + reader.close(); + } + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (zip != null) { + try { + zip.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + return lines; + } + + public static Map> loadSpeechBanks() { + Map> speechBanks = new HashMap<>(); + speechBanks.put("renegade/man/hostile", loadSpeechLines("renegade/man/hostile")); + speechBanks.put("renegade/drunkard/neutral", loadSpeechLines("renegade/drunkard/neutral")); + speechBanks.put("limwaith/moredain/friendly", loadSpeechLines("limwaith/moredain/friendly")); + speechBanks.put("limwaith/moredain/hired", loadSpeechLines("limwaith/moredain/hired")); + speechBanks.put("limwaith/moredain/hostile", loadSpeechLines("limwaith/moredain/hostile")); + speechBanks.put("limwaith/chieftain/friendly", loadSpeechLines("limwaith/chieftain/friendly")); + speechBanks.put("limwaith/chieftain/neutral", loadSpeechLines("limwaith/chieftain/neutral")); + speechBanks.put("arnorSoldier/captain/friendly", loadSpeechLines("arnorSoldier/captain/friendly")); + speechBanks.put("arnorSoldier/captain/neutral", loadSpeechLines("arnorSoldier/captain/neutral")); + speechBanks.put("arnorSoldier/soldier/friendly", loadSpeechLines("arnorSoldier/soldier/friendly")); + speechBanks.put("arnorSoldier/soldier/hired", loadSpeechLines("arnorSoldier/soldier/hired")); + speechBanks.put("arnorSoldier/soldier/hostile", loadSpeechLines("arnorSoldier/soldier/hostile")); + return speechBanks; + } + + + public static void insertSpeechBanks() { + Map> speechBanks = loadSpeechBanks(); + + try { + Class lotrSpeechClass = Class.forName("lotr.common.entity.npc.LOTRSpeech"); + Class speechBankClass = Class.forName("lotr.common.entity.npc.LOTRSpeech$SpeechBank"); + + Constructor speechBankConstructor = speechBankClass.getDeclaredConstructor(String.class, boolean.class, List.class); + speechBankConstructor.setAccessible(true); + + Field allSpeechBanksField = lotrSpeechClass.getDeclaredField("allSpeechBanks"); + allSpeechBanksField.setAccessible(true); + + Map allSpeechBanks = (Map) allSpeechBanksField.get(null); + + for (Map.Entry> entry : speechBanks.entrySet()) { + Object speechBank = speechBankConstructor.newInstance(entry.getKey(), true, entry.getValue()); + allSpeechBanks.put(entry.getKey(), speechBank); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.java b/src/main/java/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.java new file mode 100644 index 0000000..b786eb9 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/UtumnoSlaveTrader.java @@ -0,0 +1,133 @@ +package com.zivilon.cinder_loe.entity; + +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.npc.LOTREntityMan; +import lotr.common.entity.npc.LOTRTradeEntries; +import lotr.common.entity.npc.LOTRTradeEntries.TradeType; +import lotr.common.entity.npc.LOTRTradeable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; +import lotr.common.LOTRFoods; +import lotr.common.LOTRMod; +import lotr.common.fac.LOTRFaction; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.item.ItemStack; +import lotr.common.entity.npc.LOTRTradeEntry; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.init.Items; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAIPanic; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIAvoidEntity; +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.ai.LOTREntityAIDrink; +import net.minecraft.entity.ai.EntityAIWatchClosest2; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.EntityAILookIdle; +import lotr.common.entity.npc.LOTREntityNPC; + +public class UtumnoSlaveTrader extends LOTREntityMan implements LOTRTradeable.Smith { + public static LOTRTradeEntries UTUMNO_SLAVE_BUY; + public static LOTRTradeEntries UTUMNO_SLAVE_SELL; + + public boolean bound = true; + + public UtumnoSlaveTrader(World world) { + super(world); + setSize(0.6F, 1.8F); + ((EntityLiving)this).tasks.addTask(1, (EntityAIBase)new EntityAIPanic(this, 1.6D)); + ((EntityLiving)this).tasks.addTask(2, (EntityAIBase)new EntityAIWander(this, 1.0D)); + ((EntityLiving)this).tasks.addTask(3, (EntityAIBase)new EntityAIAvoidEntity(this, EntityPlayer.class, 12.0F, 1.5D, 1.8D)); + ((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new LOTREntityAIEat(this, LOTRFoods.NURN_SLAVE, 8000)); + ((EntityLiving)this).tasks.addTask(4, (EntityAIBase)new LOTREntityAIDrink(this, LOTRFoods.NURN_SLAVE_DRINK, 8000)); + ((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, EntityPlayer.class, 10.0F, 0.1F)); + ((EntityLiving)this).tasks.addTask(5, (EntityAIBase)new EntityAIWatchClosest2((EntityLiving)this, LOTREntityNPC.class, 5.0F, 0.05F)); + ((EntityLiving)this).tasks.addTask(6, (EntityAIBase)new EntityAIWatchClosest((EntityLiving)this, EntityLiving.class, 8.0F, 0.02F)); + ((EntityLiving)this).tasks.addTask(7, (EntityAIBase)new EntityAILookIdle((EntityLiving)this)); + addTargetTasks(false); + } + + public LOTRFaction getFaction() { + if (bound) return LOTRFaction.UTUMNO; + return LOTRFaction.UNALIGNED; + } + + public boolean interact(EntityPlayer entityplayer) { + boolean flag = super.interact(entityplayer); + if (bound) { + bound = false; + return false; + } + return flag; + } + + public boolean canTradeWith(EntityPlayer entityplayer) { + return bound; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + data = super.onSpawnWithEgg(data); + this.npcItemsInv.setMeleeWeapon(new ItemStack(LOTRMod.pouch)); + this.npcItemsInv.setIdleItem(this.npcItemsInv.getMeleeWeapon()); + return data; + } + + public LOTRTradeEntries getBuyPool() { + return UTUMNO_SLAVE_BUY; + } + + public LOTRTradeEntries getSellPool() { + return UTUMNO_SLAVE_SELL; + } + + // Replace with correct speechbanks + public String getSpeechBank(EntityPlayer entityplayer) { + if (isFriendlyAndAligned(entityplayer)) { + if (canTradeWith(entityplayer)) + return "utumno/slaveTrader/friendly"; + return "utumno/slaveTrader/neutral"; + } + return "utumno/slaveTrader/hostile"; + } + + static { + UTUMNO_SLAVE_BUY = new LOTRTradeEntries(TradeType.BUY, + new LOTRTradeEntry[] { + new LOTRTradeEntry(new ItemStack(Items.arrow), 1), + new LOTRTradeEntry(new ItemStack(Items.iron_ingot), 6), + new LOTRTradeEntry(new ItemStack(LOTRMod.orcSteel), 6), + new LOTRTradeEntry(new ItemStack(LOTRMod.mugOrcDraught, 1, 4), 20), + new LOTRTradeEntry(new ItemStack(LOTRMod.modTemplate), 20) + } + ); + + + UTUMNO_SLAVE_SELL = new LOTRTradeEntries(TradeType.SELL, + new LOTRTradeEntry[] { + new LOTRTradeEntry(new ItemStack(Items.bread), 3), + new LOTRTradeEntry(new ItemStack(Items.iron_ingot), 5), + new LOTRTradeEntry(new ItemStack(Items.gold_ingot), 17), + new LOTRTradeEntry(new ItemStack(Items.stick, 4), 1), + new LOTRTradeEntry(new ItemStack(LOTRMod.bronze), 5), + new LOTRTradeEntry(new ItemStack(LOTRMod.orcSteel), 5), + new LOTRTradeEntry(new ItemStack(LOTRMod.amber), 15), + new LOTRTradeEntry(new ItemStack(LOTRMod.ruby), 15), + new LOTRTradeEntry(new ItemStack(LOTRMod.amethyst), 12), + new LOTRTradeEntry(new ItemStack(LOTRMod.mugWater), 5), + new LOTRTradeEntry(new ItemStack(LOTRMod.wargBone), 3), + new LOTRTradeEntry(new ItemStack(LOTRMod.orcBone), 3), + new LOTRTradeEntry(new ItemStack(LOTRMod.trollBone), 4) + } + ); + } + + @Override + public void onPlayerTrade(EntityPlayer entityplayer, LOTRTradeEntries.TradeType type, ItemStack itemstack) { + } + + @Override + public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/entity/Wraith.java b/src/main/java/com/zivilon/cinder_loe/entity/Wraith.java new file mode 100644 index 0000000..c633e2c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/entity/Wraith.java @@ -0,0 +1,178 @@ +package com.zivilon.cinder_loe.entity; + +import java.util.UUID; + +import lotr.common.LOTRAchievement; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentHelper; +import lotr.common.entity.ai.LOTREntityAIAttackOnCollide; +import lotr.common.entity.ai.LOTREntityAIDrink; +import lotr.common.entity.ai.LOTREntityAIEat; +import lotr.common.entity.ai.LOTREntityAIFollowHiringPlayer; +import lotr.common.entity.ai.LOTREntityAIHiredRemainStill; +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.projectile.LOTREntityMarshWraithBall; +import lotr.common.fac.LOTRFaction; +import lotr.common.world.structure.LOTRChestContents; + + + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIWander; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.CinderLoE; + +public class Wraith extends LOTREntityNPC { + + public Wraith(World world) { + super(world); + setSize(0.8F, 2.5F); + ((EntityLiving) this).tasks.addTask(1, (EntityAIBase) new LOTREntityAIHiredRemainStill(this)); + ((EntityLiving) this).tasks.addTask(2, (EntityAIBase) new LOTREntityAIAttackOnCollide(this, 1.3D, false)); + ((EntityLiving) this).tasks.addTask(3, (EntityAIBase) new LOTREntityAIFollowHiringPlayer(this)); + ((EntityLiving) this).tasks.addTask(5, (EntityAIBase) new EntityAIWander(this, 1.0D)); + ((EntityLiving) this).tasks.addTask(9, (EntityAIBase) new EntityAILookIdle((EntityLiving) this)); + addTargetTasks(true); + } + + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(17, Integer.valueOf(0)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50.0D); + getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D); + } + + public int getDeathFadeTime() { + return this.dataWatcher.getWatchableObjectInt(17); + } + + public void setDeathFadeTime(int i) { + this.dataWatcher.updateObject(17, Integer.valueOf(i)); + } + + public LOTRFaction getFaction() { + return LOTRFaction.HOSTILE; + } + + public void writeEntityToNBT(NBTTagCompound nbt) { + super.writeEntityToNBT(nbt); + nbt.setInteger("DeathFadeTime", getDeathFadeTime()); + } + + public void readEntityFromNBT(NBTTagCompound nbt) { + super.readEntityFromNBT(nbt); + setDeathFadeTime(nbt.getInteger("DeathFadeTime")); + } + + @Override + public void moveEntityWithHeading(float strafe, float forward) { + // First, call the super method to preserve normal movement behavior + super.moveEntityWithHeading(strafe, forward); + + // Check for water at the entity's feet + int x = MathHelper.floor_double(this.posX); + int y = MathHelper.floor_double(this.posY); + int z = MathHelper.floor_double(this.posZ); + + boolean isWater = this.worldObj.getBlock(x, y, z).getMaterial() == Material.water || + this.worldObj.getBlock(x, y - 1, z).getMaterial() == Material.water; // Check below the entity too + + if (isWater) { + this.onGround = true; // Treat water as solid ground + this.motionY = 0.0; // Stop falling/sinking + this.setPosition(this.posX, y + 1, this.posZ); // Adjust position to stay on top of the water + } + } + + + public void setInWeb() {} + + public void onLivingUpdate() { + super.onLivingUpdate(); + if (rand.nextBoolean()) + ((Entity)this).worldObj.spawnParticle("smoke", ((Entity)this).posX + (rand.nextDouble() - 0.5D) * ((Entity)this).width, ((Entity)this).posY + rand.nextDouble() * ((Entity)this).height, ((Entity)this).posZ + (rand.nextDouble() - 0.5D) * ((Entity)this).width, 0.0D, 0.0D, 0.0D); + if (!((Entity)this).worldObj.isRemote) { + if (getDeathFadeTime() > 0) + setDeathFadeTime(getDeathFadeTime() - 1); + if (getDeathFadeTime() == 1) + setDead(); + } + } + + public boolean attackEntityFrom(DamageSource damagesource, float f) { + boolean vulnerable = false; + Entity entity = damagesource.getEntity(); + if (entity instanceof EntityLivingBase && entity == damagesource.getSourceOfDamage()) { + ItemStack itemstack = ((EntityLivingBase)entity).getHeldItem(); + if (itemstack != null && LOTREnchantmentHelper.hasEnchant(itemstack, LOTREnchantment.baneWraith)) + vulnerable = true; + } + if (vulnerable && getDeathFadeTime() == 0) { + boolean flag = super.attackEntityFrom(damagesource, f); + return flag; + } + return false; + } + + public void onDeath(DamageSource damagesource) { + super.onDeath(damagesource); + if (!((Entity)this).worldObj.isRemote) + setDeathFadeTime(30); + } + + protected void dropFewItems(boolean flag, int i) { + super.dropFewItems(flag, i); + int flesh = 1 + rand.nextInt(3) + rand.nextInt(i + 1); + for (int l = 0; l < flesh; l++) + dropItem(Items.rotten_flesh, 1); + dropChestContents(LOTRChestContents.MARSH_REMAINS, 1, 3 + i); + } + + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + + protected String getHurtSound() { + return "lotr:wight.hurt"; + } + + protected String getDeathSound() { + return "lotr:wight.death"; + } + + public boolean handleWaterMovement() { + return false; + } + + protected void func_145780_a(int i, int j, int k, Block block) {} + + public void attackEntityWithRangedAttack(EntityLivingBase target, float distanceFactor) { + // Do nothing + } + + @Override + public ItemStack getPickedResult(MovingObjectPosition target) { + return new ItemStack(CinderLoE.wraithSpawnEgg, 1); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/AlatarStaff.java b/src/main/java/com/zivilon/cinder_loe/items/AlatarStaff.java new file mode 100644 index 0000000..751b1d4 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/AlatarStaff.java @@ -0,0 +1,71 @@ +package com.zivilon.cinder_loe.items; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import java.util.List; +import lotr.common.LOTRCreativeTabs; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.items.WizardStaff; + +public class AlatarStaff extends WizardStaff { + public AlatarStaff() { + super(); + } + + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.swingItem(); + itemstack.damageItem(2, (EntityLivingBase)entityplayer); + world.playSoundAtEntity((Entity)entityplayer, "lotr:elf.woodElf_teleport", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F); + LOTRFaction faction = getFaction(entityplayer); + if (!world.isRemote) { + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, ((Entity)entityplayer).boundingBox.expand(12.0D, 8.0D, 12.0D)); + if (!entities.isEmpty()) + for (int i = 0; i < entities.size(); i++) { + EntityLivingBase entity = entities.get(i); + if (entity != entityplayer) { + if (entity instanceof EntityLiving) { + EntityLiving entityliving = (EntityLiving)entity; + if (!faction.isGoodRelation(LOTRMod.getNPCFaction((Entity)entityliving))) + continue; + } + if (entity instanceof EntityPlayer) + if (!MinecraftServer.getServer().isPVPEnabled() || LOTRLevelData.getData((EntityPlayer)entity).getAlignment(faction) < 0.0F) + continue; + + entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 1200, 0)); + entity.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1200, 0)); + } + } + LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer); + LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D)); + } + return itemstack; + } + + private LOTRFaction getFaction(EntityPlayer player) { + LOTRFaction faction = LOTRLevelData.getData(player).getPledgeFaction(); + if (faction == null) { + faction = LOTRFaction.DORWINION; + } + return faction; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java b/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java new file mode 100644 index 0000000..1854254 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/CinderLoESpawnEgg.java @@ -0,0 +1,66 @@ +package com.zivilon.cinder_loe.items; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.CinderLoE; + +public class CinderLoESpawnEgg extends Item { + private Class entityClass; + + public CinderLoESpawnEgg(Class entityClass) { + this.entityClass = entityClass; + this.setUnlocalizedName("spawn_egg_" + entityClass.getSimpleName().toLowerCase()); + this.setTextureName("spawn_egg"); + this.setCreativeTab(CreativeTabs.tabMisc); // Or any other tab you prefer + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + if (!world.isRemote) { + // Perform a ray trace to find the block the player is looking at + MovingObjectPosition target = getMovingObjectPositionFromPlayer(world, player, true); + + if (target != null && target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) { + int x = target.blockX; + int y = target.blockY; + int z = target.blockZ; + + // Adjust the y coordinate to spawn the entity on top of the block clicked + y += 1; + + try { + Entity entity = entityClass.getConstructor(World.class).newInstance(world); + entity.setLocationAndAngles(x + 0.5, y, z + 0.5, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F); + spawnCustomCreature(world, entity); + } catch (Exception e) { + e.printStackTrace(); // Log any exceptions + } + } + } + if (!player.capabilities.isCreativeMode) { + --itemStack.stackSize; + } + return itemStack; + } + + + public static void spawnCustomCreature(World world, Entity entity) { + if (entity instanceof EntityLiving) { + EntityLiving entityLiving = (EntityLiving)entity; + + // The entity's location is already set, so we directly apply custom properties and spawn + entityLiving.onSpawnWithEgg(null); // Applies custom armor and equipment + + world.spawnEntityInWorld(entity); + entityLiving.playLivingSound(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/PallandoStaff.java b/src/main/java/com/zivilon/cinder_loe/items/PallandoStaff.java new file mode 100644 index 0000000..6c06934 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/PallandoStaff.java @@ -0,0 +1,71 @@ +package com.zivilon.cinder_loe.items; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import java.util.List; +import lotr.common.LOTRCreativeTabs; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.items.WizardStaff; + +public class PallandoStaff extends WizardStaff { + public PallandoStaff() { + super(); + } + + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.swingItem(); + itemstack.damageItem(2, (EntityLivingBase)entityplayer); + world.playSoundAtEntity((Entity)entityplayer, "lotr:elf.woodElf_teleport", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F); + LOTRFaction faction = getFaction(entityplayer); + if (!world.isRemote) { + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, ((Entity)entityplayer).boundingBox.expand(12.0D, 8.0D, 12.0D)); + if (!entities.isEmpty()) + for (int i = 0; i < entities.size(); i++) { + EntityLivingBase entity = entities.get(i); + if (entity != entityplayer) { + if (entity instanceof EntityLiving) { + EntityLiving entityliving = (EntityLiving)entity; + if (faction.isGoodRelation(LOTRMod.getNPCFaction((Entity)entityliving))) + continue; + } + if (entity instanceof EntityPlayer) + if (!MinecraftServer.getServer().isPVPEnabled() || LOTRLevelData.getData((EntityPlayer)entity).getAlignment(faction) > 0.0F) + continue; + + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 1200, 0)); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1200, 0)); + } + } + LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer); + LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D)); + } + return itemstack; + } + + private LOTRFaction getFaction(EntityPlayer player) { + LOTRFaction faction = LOTRLevelData.getData(player).getPledgeFaction(); + if (faction == null) { + faction = LOTRFaction.RHUDEL; + } + return faction; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java b/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java new file mode 100644 index 0000000..b13c219 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/RadagastStaff.java @@ -0,0 +1,93 @@ +package com.zivilon.cinder_loe.items; + + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import lotr.common.LOTRCreativeTabs; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.util.BlockPos; +import com.zivilon.cinder_loe.items.WizardStaff; +import com.zivilon.cinder_loe.entity.FangornBear; +import com.zivilon.cinder_loe.entity.FangornWildBoar; +import com.zivilon.cinder_loe.entity.FangornAuroch; +import com.zivilon.cinder_loe.entity.FangornElk; +import com.zivilon.cinder_loe.entity.FangornAnimal; + +import lotr.common.item.LOTRMaterial; +import java.util.Random; + + +import java.util.List; + +public class RadagastStaff extends WizardStaff { + public RadagastStaff() { + super(); + } + + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.swingItem(); + itemstack.damageItem(2, (EntityLivingBase)entityplayer); + if (!world.isRemote) { + BlockPos location = BlockPos.findSafeSpawnLocation(world, entityplayer); + if (location != null && !isAreaCrowded(world, entityplayer)) { + world.playSoundAtEntity((Entity)entityplayer, "lotr:ent.mallorn.summonEnt", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F); + spawnAnimal(location, world); + } else { + world.playSoundAtEntity((Entity)entityplayer, "lotr:item.puff", 1.0F, 2.0F); + } + } + return itemstack; + } + + public boolean isAreaCrowded(World world, EntityPlayer player) { + int radius = 30; // Check within 30 blocks + int maxEntities = 10; // Maximum allowed nearby entities + + AxisAlignedBB checkArea = AxisAlignedBB.getBoundingBox( + player.posX - radius, player.posY - radius, player.posZ - radius, + player.posX + radius, player.posY + radius, player.posZ + radius + ); + List listAnimals = world.getEntitiesWithinAABB(EntityAnimal.class, checkArea); + List listFangornBear = world.getEntitiesWithinAABB(FangornAnimal.class, checkArea); + + // Combine counts from both lists + int totalAnimals = listAnimals.size() + listFangornBear.size(); + + return totalAnimals >= maxEntities; + } + + public void spawnAnimal(BlockPos location, World world) { + Random rand = new Random(); + int choice = rand.nextInt(4); // Generate a random number between 0 and 2 + + EntityLivingBase entity = null; + switch (choice) { + case 0: + entity = new FangornBear(world); // Assuming FangornBear is your entity class for bears + break; + case 1: + entity = new FangornWildBoar(world); // Replace with your wild boar entity class + break; + case 2: + entity = new FangornAuroch(world); // Replace with your auroch entity class + break; + case 3: + entity = new FangornElk(world); // Replace with your auroch entity class + break; + } + + if (entity != null) { + entity.setPosition(location.x + 0.5, location.y, location.z + 0.5); // Center the entity on the block + world.spawnEntityInWorld(entity); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/SarumanStaff.java b/src/main/java/com/zivilon/cinder_loe/items/SarumanStaff.java new file mode 100644 index 0000000..46f3878 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/SarumanStaff.java @@ -0,0 +1,46 @@ +package com.zivilon.cinder_loe.items; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import java.util.List; +import lotr.common.LOTRCreativeTabs; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.fac.LOTRFaction; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.Potion; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.zivilon.cinder_loe.items.WizardStaff; +import com.zivilon.cinder_loe.entity.SarumanFireball; + +public class SarumanStaff extends WizardStaff { + public SarumanStaff() { + super(); + } + + public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.swingItem(); + itemstack.damageItem(2, (EntityLivingBase)entityplayer); + world.playSoundAtEntity((Entity)entityplayer, "mob.ghast.fireball", 2.0F, (Item.itemRand.nextFloat() - Item.itemRand.nextFloat()) * 0.2F + 1.0F); + if (!world.isRemote) { + world.spawnEntityInWorld((Entity)new SarumanFireball(world, ((EntityLivingBase)entityplayer))); + LOTRPacketWeaponFX packet = new LOTRPacketWeaponFX(LOTRPacketWeaponFX.Type.MACE_SAURON, (Entity)entityplayer); + LOTRPacketHandler.networkWrapper.sendToAllAround((IMessage)packet, LOTRPacketHandler.nearEntity((Entity)entityplayer, 64.0D)); + } + return itemstack; + } +} \ No newline at end of file diff --git a/src/main/java/com/zivilon/cinder_loe/items/Whip.java b/src/main/java/com/zivilon/cinder_loe/items/Whip.java new file mode 100644 index 0000000..2ef6db8 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/Whip.java @@ -0,0 +1,59 @@ +package com.zivilon.cinder_loe.items; + +import java.util.ArrayList; +import java.util.List; + +import lotr.common.LOTRBannerProtection; +import lotr.common.LOTRMod; +import lotr.common.enchant.LOTREnchantment; +import lotr.common.enchant.LOTREnchantmentHelper; +import lotr.common.item.LOTRItemSword; +import lotr.common.item.LOTRMaterial; +import lotr.common.item.LOTRWeaponStats; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public class Whip extends LOTRItemSword { + public Whip() { + super(LOTRMaterial.FUR); + this.lotrWeaponDamage = 4.0F; + LOTRWeaponStats.registerMeleeReach(Whip.class, 1.5F); + } + + public boolean func_77644_a(ItemStack itemstack, EntityLivingBase hitEntity, EntityLivingBase user) { + super.hitEntity(itemstack, hitEntity, user); + launchWhip(user, hitEntity); + return true; + } + + public EnumAction getItemUseAction(ItemStack itemstack) { + return EnumAction.none; + } + + private void launchWhip(EntityLivingBase user, EntityLivingBase hitEntity) { + World world = ((Entity)user).worldObj; + world.playSoundAtEntity((Entity)user, "lotr:item.balrogWhip", 2.0F, 0.7F + Item.itemRand.nextFloat() * 0.6F); + } + + public boolean getIsRepairable(ItemStack itemstack, ItemStack repairItem) { + return (repairItem.getItem() == Items.leather); + } + + private void checkIncompatibleModifiers(ItemStack itemstack) {} +} diff --git a/src/main/java/com/zivilon/cinder_loe/items/WizardStaff.java b/src/main/java/com/zivilon/cinder_loe/items/WizardStaff.java new file mode 100644 index 0000000..e65b292 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/items/WizardStaff.java @@ -0,0 +1,40 @@ +package com.zivilon.cinder_loe.items; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import lotr.common.LOTRCreativeTabs; +import lotr.common.entity.projectile.LOTREntityGandalfFireball; +import lotr.common.network.LOTRPacketHandler; +import lotr.common.network.LOTRPacketWeaponFX; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import lotr.common.item.LOTRItemSword; +import lotr.common.item.LOTRStoryItem; + +import com.zivilon.cinder_loe.CinderLoE; + +public class WizardStaff extends LOTRItemSword implements LOTRStoryItem { + public WizardStaff() { + super(CinderLoE.getLOTRMaterialByName("WIZARD")); + setCreativeTab((CreativeTabs)LOTRCreativeTabs.tabStory); + } + + public int getMaxItemUseDuration(ItemStack itemstack) { + return 40; + } + + public EnumAction getItemUseAction(ItemStack itemstack) { + return EnumAction.bow; + } + + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { + entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack)); + return itemstack; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java new file mode 100644 index 0000000..ef530a7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemBlock.java @@ -0,0 +1,39 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +@Mixin(ItemBlock.class) +public abstract class MixinItemBlock { + + @Shadow + public final Block field_150939_a; + + public MixinItemBlock(Block block) { + this.field_150939_a = block; + } + + @Overwrite(remap = false) + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { + + System.out.println("Placing block with metadata " + metadata); + if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) { + return false; + } + + if (world.getBlock(x, y, z) == field_150939_a) { + field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack); + field_150939_a.onPostBlockPlaced(world, x, y, z, metadata); + } + + return true; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java new file mode 100644 index 0000000..70fdd28 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinItemRenderer.java @@ -0,0 +1,275 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import com.zivilon.cinder_loe.util.Utilities; +import com.zivilon.cinder_loe.CinderLoE_Config; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemMap; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.storage.MapData; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.MinecraftForgeClient; + +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; + +@Mixin(ItemRenderer.class) +public abstract class MixinItemRenderer { + + @Shadow + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + @Shadow + private RenderBlocks renderBlocksIr; + + @Shadow + private Minecraft mc; + + @Overwrite(remap = false) + public void renderItem(EntityLivingBase p_78443_1_, ItemStack p_78443_2_, int p_78443_3_, ItemRenderType type) { + GL11.glPushMatrix(); + TextureManager texturemanager = this.mc.getTextureManager(); + Item item = p_78443_2_.getItem(); + Block block = Block.getBlockFromItem(item); + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_CULL_FACE); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + } + IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(p_78443_2_, type); + if (customRenderer != null) { + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, p_78443_1_, p_78443_2_); + } + else + if (p_78443_2_.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) { + texturemanager.bindTexture(texturemanager.getResourceLocation(0)); + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) { + GL11.glDepthMask(false); + this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F); + GL11.glDepthMask(true); + } + else { + this.renderBlocksIr.renderBlockAsItem(block, p_78443_2_.getItemDamage(), 1.0F); + } + } + else { + IIcon iicon = p_78443_1_.getItemIcon(p_78443_2_, p_78443_3_); + + if (iicon == null) { + GL11.glPopMatrix(); + return; + } + + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_152777_a(false, false, 1.0F); + Tessellator tessellator = Tessellator.instance; + float f = iicon.getMinU(); + float f1 = iicon.getMaxU(); + float f2 = iicon.getMinV(); + float f3 = iicon.getMaxV(); + float f4 = 0.0F; + float f5 = 0.3F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glTranslatef(-f4, -f5, 0.0F); + float f6 = 1.5F; + GL11.glScalef(f6, f6, f6); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); + + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F, false); + + if (p_78443_2_.hasEffect(p_78443_3_)) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + texturemanager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(768, 1, 1, 0); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f8 = 0.125F; + GL11.glScalef(f8, f8, f8); + float f9 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(f9, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true); + + + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f8, f8, f8); + f9 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-f9, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true); + + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber())); + TextureUtil.func_147945_b(); + } + + if (p_78443_2_ != null && block != null && block.getRenderBlockPass() != 0) { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + } + + private void customRenderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_, boolean enchant) { + if (!enchant) GL11.glPushMatrix(); // Save the current OpenGL state + if (!enchant) GL11.glEnable(GL11.GL_BLEND); // Enable blending + if (!enchant) OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO); // Apply your custom blend function for semi-transparency + + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, 1.0F); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 0.0F, -1.0F); + p_78439_0_.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_2_); + p_78439_0_.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)p_78439_4_); + p_78439_0_.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)p_78439_4_); + p_78439_0_.draw(); + + + float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float)p_78439_5_; + float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float)p_78439_6_; + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(-1.0F, 0.0F, 0.0F); + int k; + float f7; + float f8; + + for (k = 0; k < p_78439_5_; ++k) { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + p_78439_0_.addVertexWithUV((double)f7, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f7, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(1.0F, 0.0F, 0.0F); + float f9; + + for (k = 0; k < p_78439_5_; ++k) { + f7 = (float)k / (float)p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + f9 = f7 + 1.0F / (float)p_78439_5_; + p_78439_0_.addVertexWithUV((double)f9, 1.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 1.0D, 0.0D, (double)f8, (double)p_78439_2_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, 0.0D, (double)f8, (double)p_78439_4_); + p_78439_0_.addVertexWithUV((double)f9, 0.0D, (double)(0.0F - p_78439_7_), (double)f8, (double)p_78439_4_); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, 1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + f9 = f7 + 1.0F / (float)p_78439_6_; + p_78439_0_.addVertexWithUV(0.0D, (double)f9, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f9, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + } + + p_78439_0_.draw(); + p_78439_0_.startDrawingQuads(); + p_78439_0_.setNormal(0.0F, -1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) { + f7 = (float)k / (float)p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + p_78439_0_.addVertexWithUV(1.0D, (double)f7, 0.0D, (double)p_78439_3_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, 0.0D, (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(0.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_1_, (double)f8); + p_78439_0_.addVertexWithUV(1.0D, (double)f7, (double)(0.0F - p_78439_7_), (double)p_78439_3_, (double)f8); + } + + p_78439_0_.draw(); + if (!enchant) GL11.glPopMatrix(); // Restore the saved OpenGL state + } + + @Overwrite + public static void renderItemIn2D(Tessellator p_78439_0_, float p_78439_1_, float p_78439_2_, float p_78439_3_, float p_78439_4_, int p_78439_5_, int p_78439_6_, float p_78439_7_) { + // Redirect to new custom renderer. This should not be necessary but works as failsafe + RenderHelper.customRenderItemIn2D(p_78439_0_, p_78439_1_, p_78439_2_, p_78439_3_, p_78439_4_, p_78439_5_, p_78439_6_, p_78439_7_, false); + +/* DEBUG + System.out.println("Printing stacktrace from original render method"); + Utilities.writeLog("Printing stacktrace from original render method"); + StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); + for (StackTraceElement element : stackTraceElements) { + Utilities.writeLog(element.toString()); + } + Utilities.writeLog(""); +*/ + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java new file mode 100644 index 0000000..fc1acaa --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRArmorModels.java @@ -0,0 +1,109 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.CinderLoE; +import com.zivilon.cinder_loe.client.model.ModelRedDwarfHelmet; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import java.util.HashMap; +import java.util.Map; + +import lotr.client.model.LOTRArmorModels; +import lotr.client.model.LOTRModelArnorHelmet; +import lotr.client.model.LOTRModelBlackNumenoreanHelmet; +import lotr.client.model.LOTRModelBlackUrukHelmet; +import lotr.client.model.LOTRModelDorwinionElfHelmet; +import lotr.client.model.LOTRModelEasterlingHelmet; +import lotr.client.model.LOTRModelGaladhrimHelmet; +import lotr.client.model.LOTRModelGemsbokHelmet; +import lotr.client.model.LOTRModelGondolinHelmet; +import lotr.client.model.LOTRModelGondorHelmet; +import lotr.client.model.LOTRModelGulfChestplate; +import lotr.client.model.LOTRModelGundabadUrukHelmet; +import lotr.client.model.LOTRModelHaradRobes; +import lotr.client.model.LOTRModelHaradTurban; +import lotr.client.model.LOTRModelHarnedorChestplate; +import lotr.client.model.LOTRModelHarnedorHelmet; +import lotr.client.model.LOTRModelHeadPlate; +import lotr.client.model.LOTRModelHighElvenHelmet; +import lotr.client.model.LOTRModelHighElvenHelmet; +import lotr.client.model.LOTRModelHighElvenHelmet; +import lotr.client.model.LOTRModelLeatherHat; +import lotr.client.model.LOTRModelMoredainLionHelmet; +import lotr.client.model.LOTRModelMorgulHelmet; +import lotr.client.model.LOTRModelNearHaradWarlordHelmet; +import lotr.client.model.LOTRModelPartyHat; +import lotr.client.model.LOTRModelRohanMarshalHelmet; +import lotr.client.model.LOTRModelSwanChestplate; +import lotr.client.model.LOTRModelSwanHelmet; +import lotr.client.model.LOTRModelTauredainChieftainHelmet; +import lotr.client.model.LOTRModelTauredainGoldHelmet; +import lotr.client.model.LOTRModelUmbarHelmet; +import lotr.client.model.LOTRModelUrukHelmet; +import lotr.client.model.LOTRModelUrukHelmet; +import lotr.client.model.LOTRModelWingedHelmet; +import lotr.common.LOTRMod; + +import net.minecraft.client.model.ModelBiped; +import net.minecraft.item.Item; + +@Mixin(LOTRArmorModels.class) +public class MixinLOTRArmorModels { + + @Shadow + private Map> specialArmorModels; + + @Shadow + public void copyModelRotations(ModelBiped target, ModelBiped src) { + } + + private Map getSpecialModels(ModelBiped key) { + Map map = this.specialArmorModels.get(key); + if (map == null) { + map = new HashMap(); + map.put(LOTRMod.leatherHat, new LOTRModelLeatherHat()); + map.put(LOTRMod.helmetGondor, new LOTRModelGondorHelmet(1.0F)); + map.put(LOTRMod.helmetElven, new LOTRModelGaladhrimHelmet(1.0F)); + map.put(LOTRMod.helmetGondorWinged, new LOTRModelWingedHelmet(1.0F)); + map.put(LOTRMod.helmetMorgul, new LOTRModelMorgulHelmet(1.0F)); + map.put(LOTRMod.helmetGemsbok, new LOTRModelGemsbokHelmet(1.0F)); + map.put(LOTRMod.helmetHighElven, new LOTRModelHighElvenHelmet(1.0F)); + map.put(LOTRMod.helmetBlackUruk, new LOTRModelBlackUrukHelmet(1.0F)); + map.put(LOTRMod.helmetUruk, new LOTRModelUrukHelmet(1.0F)); + map.put(LOTRMod.helmetNearHaradWarlord, new LOTRModelNearHaradWarlordHelmet(1.0F)); + map.put(LOTRMod.helmetDolAmroth, new LOTRModelSwanHelmet(1.0F)); + map.put(LOTRMod.bodyDolAmroth, new LOTRModelSwanChestplate(1.0F)); + map.put(LOTRMod.helmetMoredainLion, new LOTRModelMoredainLionHelmet(1.0F)); + map.put(LOTRMod.helmetHaradRobes, new LOTRModelHaradTurban()); + map.put(LOTRMod.bodyHaradRobes, new LOTRModelHaradRobes(1.0F)); + map.put(LOTRMod.legsHaradRobes, new LOTRModelHaradRobes(0.5F)); + map.put(LOTRMod.bootsHaradRobes, new LOTRModelHaradRobes(1.0F)); + map.put(LOTRMod.helmetGondolin, new LOTRModelGondolinHelmet(1.0F)); + map.put(LOTRMod.helmetRohanMarshal, new LOTRModelRohanMarshalHelmet(1.0F)); + map.put(LOTRMod.helmetTauredainChieftain, new LOTRModelTauredainChieftainHelmet(1.0F)); + map.put(LOTRMod.helmetTauredainGold, new LOTRModelTauredainGoldHelmet(1.0F)); + map.put(LOTRMod.helmetGundabadUruk, new LOTRModelGundabadUrukHelmet(1.0F)); + map.put(LOTRMod.helmetUrukBerserker, new LOTRModelUrukHelmet(1.0F)); + map.put(LOTRMod.helmetDorwinionElf, new LOTRModelDorwinionElfHelmet(1.0F)); + map.put(LOTRMod.partyHat, new LOTRModelPartyHat(0.6F)); + map.put(LOTRMod.helmetArnor, new LOTRModelArnorHelmet(1.0F)); + map.put(LOTRMod.helmetRhunGold, new LOTRModelEasterlingHelmet(1.0F, false)); + map.put(LOTRMod.helmetRhunWarlord, new LOTRModelEasterlingHelmet(1.0F, true)); + map.put(LOTRMod.helmetRivendell, new LOTRModelHighElvenHelmet(1.0F)); + map.put(LOTRMod.bodyGulfHarad, new LOTRModelGulfChestplate(1.0F)); + map.put(LOTRMod.helmetUmbar, new LOTRModelUmbarHelmet(1.0F)); + map.put(LOTRMod.helmetHarnedor, new LOTRModelHarnedorHelmet(1.0F)); + map.put(LOTRMod.bodyHarnedor, new LOTRModelHarnedorChestplate(1.0F)); + map.put(LOTRMod.helmetBlackNumenorean, new LOTRModelBlackNumenoreanHelmet(1.0F)); + map.put(CinderLoE.helmetRedDwarf, new ModelRedDwarfHelmet(1.0F)); + map.put(LOTRMod.plate, new LOTRModelHeadPlate()); + map.put(LOTRMod.woodPlate, new LOTRModelHeadPlate()); + map.put(LOTRMod.ceramicPlate, new LOTRModelHeadPlate()); + for (ModelBiped armorModel : map.values()) + copyModelRotations(armorModel, key); + this.specialArmorModels.put(key, map); + } + return map; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java new file mode 100644 index 0000000..a81f479 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRClientProxy.java @@ -0,0 +1,55 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import com.zivilon.cinder_loe.CinderLoE_Config; +import org.lwjgl.opengl.GL11; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.LOTRClientProxy; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +@Mixin(LOTRClientProxy.class) +public abstract class MixinLOTRClientProxy { + @Shadow + public static final ResourceLocation enchantmentTexture = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + @Overwrite(remap = false) + public static void renderEnchantmentEffect() { + Tessellator tessellator = Tessellator.instance; + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + GL11.glDepthFunc(514); + GL11.glDisable(2896); + texturemanager.bindTexture(enchantmentTexture); + GL11.glEnable(3042); + GL11.glBlendFunc(768, 1); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + GL11.glMatrixMode(5890); + GL11.glPushMatrix(); + float scale = 0.125F; + GL11.glScalef(scale, scale, scale); + float randomShift = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(randomShift, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(scale, scale, scale); + randomShift = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-randomShift, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F, true); + GL11.glPopMatrix(); + GL11.glMatrixMode(5888); + GL11.glDisable(3042); + GL11.glEnable(2896); + GL11.glDepthFunc(515); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java new file mode 100644 index 0000000..d58d501 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRContainerAnvil.java @@ -0,0 +1,78 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import lotr.common.inventory.LOTRContainerAnvil; +import lotr.common.LOTRMod; +import lotr.common.item.LOTRMaterial; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.item.ItemTool; + +import com.zivilon.cinder_loe.CinderLoE; + +import java.util.Objects; + +@Mixin(LOTRContainerAnvil.class) +public class MixinLOTRContainerAnvil { + + /** + * @author Shinare + * @reason KeyLime + */ + @Overwrite(remap = false) + public boolean isRepairMaterial(ItemStack inputItem, ItemStack materialItem) { + if (inputItem.getItem().getIsRepairable(inputItem, materialItem)) + return true; + Item item = inputItem.getItem(); + if (item == Items.bow && LOTRMod.rohanBow.getIsRepairable(inputItem, materialItem)) + return true; + if (item instanceof net.minecraft.item.ItemFishingRod && materialItem.getItem() == Items.string) + return true; + if (item instanceof net.minecraft.item.ItemShears && materialItem.getItem() == Items.iron_ingot) + return true; + if (item instanceof lotr.common.item.LOTRItemChisel && materialItem.getItem() == Items.iron_ingot) + return true; + if (item instanceof net.minecraft.item.ItemEnchantedBook && materialItem.getItem() == Items.paper) + return true; + Item.ToolMaterial material = null; + if (item instanceof ItemTool) { + material = Item.ToolMaterial.valueOf(((ItemTool)item).getToolMaterialName()); + } else if (item instanceof ItemSword) { + material = Item.ToolMaterial.valueOf(((ItemSword)item).getToolMaterialName()); + } + if (material == Item.ToolMaterial.WOOD || material == LOTRMaterial.MOREDAIN_WOOD.toToolMaterial()) + return LOTRMod.isOreNameEqual(materialItem, "plankWood"); + if (material == LOTRMaterial.MALLORN.toToolMaterial()) + return (materialItem.getItem() == Item.getItemFromBlock(LOTRMod.planks) && materialItem.getItemDamage() == 1); + if (material == LOTRMaterial.MALLORN_MACE.toToolMaterial()) + return (materialItem.getItem() == Item.getItemFromBlock(LOTRMod.wood) && materialItem.getItemDamage() == 1); + if (material == CinderLoE.MATERIAL_RED_DWARF.toToolMaterial()) + return (materialItem.getItem() == CinderLoE.redDwarfSteel); + if (material == CinderLoE.MATERIAL_LIMWAITH_BONE.toToolMaterial()) + return LOTRMod.isOreNameEqual(materialItem, "bone"); + if (material == CinderLoE.EVENT.toToolMaterial()) + return LOTRMod.isOreNameEqual(materialItem, "ice"); + if (material == CinderLoE.MATERIAL_BREE.toToolMaterial()) + return (materialItem.getItem() == Items.iron_ingot); + if (item instanceof ItemArmor armor) { + ItemArmor.ArmorMaterial armorMaterial = armor.getArmorMaterial(); + if (armorMaterial == LOTRMaterial.BONE.toArmorMaterial()) + return LOTRMod.isOreNameEqual(materialItem, "bone"); + if (armorMaterial == CinderLoE.MATERIAL_RED_DWARF.toArmorMaterial()) + return (materialItem.getItem() == CinderLoE.redDwarfSteel); + if (armorMaterial == CinderLoE.MATERIAL_LIMWAITH_WOOD.toArmorMaterial()) + return (materialItem.getItem() == Item.getItemFromBlock(LOTRMod.planks) && materialItem.getItemDamage() == 15); + if (armorMaterial == CinderLoE.MATERIAL_BREE.toArmorMaterial()) + return (materialItem.getItem() == Items.iron_ingot); + if (armorMaterial == CinderLoE.MATERIAL_BATTLENUN.toArmorMaterial()) + return (materialItem.getItem() == Items.iron_ingot); + } + + return false; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.java new file mode 100644 index 0000000..e0cba86 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTREntitySauron.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import lotr.common.entity.npc.LOTREntityNPC; +import lotr.common.entity.npc.LOTREntitySauron; + +import net.minecraft.world.World; + +@Mixin(LOTREntitySauron.class) +public abstract class MixinLOTREntitySauron extends LOTREntityNPC { + MixinLOTREntitySauron(World world) { + super(world); + } + + public void setupNPCName() { + this.familyInfo.setName("Sauron"); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.java new file mode 100644 index 0000000..40ab1da --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRGenLayerRemoveMapRivers.java @@ -0,0 +1,117 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.world.gen.layer.GenLayer; +import cpw.mods.fml.common.FMLLog; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lotr.common.LOTRDimension; +import lotr.common.world.biome.LOTRBiome; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import java.util.Random; + +import lotr.common.world.genlayer.LOTRGenLayerRemoveMapRivers; +import lotr.common.world.genlayer.LOTRGenLayer; +import lotr.common.world.genlayer.LOTRIntCache; + +import com.zivilon.cinder_loe.util.Utilities; + +@Mixin(LOTRGenLayerRemoveMapRivers.class) +public abstract class MixinLOTRGenLayerRemoveMapRivers extends LOTRGenLayer { + + public MixinLOTRGenLayerRemoveMapRivers(long l, LOTRGenLayer biomes, LOTRDimension dim) { + super(l); + this.lotrParent = biomes; + this.dimension = dim; + } + + @Shadow + private static int MAX_PIXEL_RANGE; + + @Shadow + private LOTRDimension dimension; + + private static int[] cache; + + @Overwrite(remap = false) + public int[] getInts(World world, int i, int k, int xSize, int zSize) { + int maxRange = MAX_PIXEL_RANGE; + int[] biomes = this.lotrParent.getInts(world, i - maxRange, k - maxRange, xSize + maxRange * 2, zSize + maxRange * 2); + int[] ints = LOTRIntCache.get(world).getIntArray(xSize * zSize); + if (ints == null) { + ints = cache; + } else { + cache = ints; + } + if (ints == null) System.out.println("Ints array is null, loading cached array to prevent crash. May result in unexpected behavior! xSize: " + xSize + " and zSize: " + zSize); + for (int k1 = 0; k1 < zSize; k1++) { + for (int i1 = 0; i1 < xSize; i1++) { + initChunkSeed((i + i1), (k + k1)); + int biomeID = biomes[i1 + maxRange + (k1 + maxRange) * (xSize + maxRange * 2)]; + if (Utilities.reflected_river == null) System.out.println("Reflected river is null"); + if (biomeID == ((BiomeGenBase)Utilities.reflected_river).biomeID) { + int replaceID = -1; + for (int range = 1; range <= maxRange; range++) { + Map viableBiomes = new HashMap(); + Map viableBiomesWateryAdjacent = new HashMap(); + for (int k2 = k1 - range; k2 <= k1 + range; k2++) { + for (int i2 = i1 - range; i2 <= i1 + range; i2++) { + if (Math.abs(i2 - i1) == range || Math.abs(k2 - k1) == range) { + int subIndex = i2 + maxRange + (k2 + maxRange) * (xSize + maxRange * 2); + int subBiomeID = biomes[subIndex]; + LOTRBiome subBiome = this.dimension.biomeList[subBiomeID]; + if (subBiome != Utilities.reflected_river) { + boolean wateryAdjacent = (subBiome.isWateryBiome() && range == 1); + Map srcMap = wateryAdjacent ? viableBiomesWateryAdjacent : viableBiomes; + int count = 0; + if (srcMap.containsKey(Integer.valueOf(subBiomeID))) + count = ((Integer)srcMap.get(Integer.valueOf(subBiomeID))).intValue(); + count++; + srcMap.put(Integer.valueOf(subBiomeID), Integer.valueOf(count)); + } + } + } + } + + Map priorityMap = viableBiomes; + if (!viableBiomesWateryAdjacent.isEmpty()) + priorityMap = viableBiomesWateryAdjacent; + if (!priorityMap.isEmpty()) { + List maxCountBiomes = new ArrayList(); + int maxCount = 0; + for (Map.Entry e : priorityMap.entrySet()) { + int id = ((Integer)e.getKey()).intValue(); + int count = ((Integer)e.getValue()).intValue(); + if (count > maxCount) + maxCount = count; + } + for (Map.Entry e : priorityMap.entrySet()) { + int id = ((Integer)e.getKey()).intValue(); + int count = ((Integer)e.getValue()).intValue(); + if (count == maxCount) + maxCountBiomes.add(Integer.valueOf(id)); + } + replaceID = ((Integer)maxCountBiomes.get(nextInt(maxCountBiomes.size()))).intValue(); + break; + } + } + if (replaceID == -1) { + FMLLog.warning("WARNING! LOTR map generation failed to replace map river at %d, %d", new Object[] { Integer.valueOf(i), Integer.valueOf(k) }); + ints[i1 + k1 * xSize] = 0; + } else { + ints[i1 + k1 * xSize] = replaceID; + } + } else { + ints[i1 + k1 * xSize] = biomeID; + } + } + } + return ints; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java new file mode 100644 index 0000000..3139500 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRIntCache.java @@ -0,0 +1,77 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.world.gen.layer.GenLayer; +import cpw.mods.fml.common.FMLLog; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lotr.common.LOTRDimension; +import lotr.common.world.biome.LOTRBiome; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import java.util.Random; + +import lotr.common.world.genlayer.LOTRGenLayerRemoveMapRivers; +import lotr.common.world.genlayer.LOTRGenLayer; +import lotr.common.world.genlayer.LOTRIntCache; + +@Mixin(LOTRIntCache.class) +public abstract class MixinLOTRIntCache { + + @Shadow + private static LOTRIntCache SERVER; + @Shadow + private static LOTRIntCache CLIENT; + @Shadow + private int intCacheSize = 256; + @Shadow + private List freeSmallArrays; + @Shadow + private List inUseSmallArrays; + @Shadow + private List freeLargeArrays; + @Shadow + private List inUseLargeArrays; + + private static int[] cache; + + @Overwrite(remap = false) + public int[] getIntArray(int size) { + if (size <= 256) { + if (this.freeSmallArrays.isEmpty()) { + int[] arrayOfInt1 = new int[256]; + this.inUseSmallArrays.add(arrayOfInt1); + return arrayOfInt1 == null ? cache : cacheInts(arrayOfInt1); + } + int[] arrayOfInt = this.freeSmallArrays.remove(this.freeSmallArrays.size() - 1); + this.inUseSmallArrays.add(arrayOfInt); + return arrayOfInt == null ? cache : cacheInts(arrayOfInt); + } + if (size > this.intCacheSize) { + this.intCacheSize = size; + this.freeLargeArrays.clear(); + this.inUseLargeArrays.clear(); + int[] arrayOfInt = new int[this.intCacheSize]; + this.inUseLargeArrays.add(arrayOfInt); + return arrayOfInt == null ? cache : cacheInts(arrayOfInt); + } + if (this.freeLargeArrays.isEmpty()) { + int[] arrayOfInt = new int[this.intCacheSize]; + this.inUseLargeArrays.add(arrayOfInt); + return arrayOfInt == null ? cache : cacheInts(arrayOfInt); + } + int[] ints = this.freeLargeArrays.remove(this.freeLargeArrays.size() - 1); + this.inUseLargeArrays.add(ints); + return ints == null ? cache : cacheInts(ints); + } + + private int[] cacheInts(int[] ints) { + cache = ints; + return ints; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java new file mode 100644 index 0000000..4e1403b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRItemRendererManager.java @@ -0,0 +1,120 @@ +package com.zivilon.cinder_loe.mixins; + +import lotr.client.LOTRItemRendererManager; +import lotr.client.render.item.LOTRRenderLargeItem; + +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.item.Item; + +import java.lang.reflect.Field; + +import org.objectweb.asm.Opcodes; + +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import lotr.client.render.item.LOTRRenderBannerItem; +import lotr.client.render.item.LOTRRenderBlownItem; +import lotr.client.render.item.LOTRRenderBow; +import lotr.client.render.item.LOTRRenderCrossbow; +import lotr.client.render.item.LOTRRenderElvenBlade; +import lotr.client.render.item.LOTRRenderInvTableCommand; +import lotr.client.render.item.LOTRRenderLargeItem; +import lotr.client.render.item.LOTRRenderSkullStaff; +import lotr.client.render.tileentity.LOTRRenderAnimalJar; +import lotr.common.LOTRMod; +import lotr.common.item.LOTRItemSword; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.IReloadableResourceManager; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.client.resources.IResourceManagerReloadListener; +import net.minecraft.item.Item; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; + +@Mixin(LOTRItemRendererManager.class) +public abstract class MixinLOTRItemRendererManager { + +/* @Inject(method = "func_110549_a(Lnet/minecraft/client/resources/IResourceManager;)V", + at = @At(value = "JUMP", opcode = Opcodes.IFEQ, ordinal = 0, shift = At.Shift.BEFORE), + locals = LocalCapture.CAPTURE_FAILSOFT, + remap = false) + private void afterIsLargeSet(IResourceManager resourceManager, CallbackInfo ci, int i, Field[] fields, Field field, Item item, LOTRRenderLargeItem largeItemRenderer, boolean isLarge) { + System.out.println("\u001B[35mVerifying item in renderer manager..."); + System.out.println("Name of item is " + item.getUnlocalizedName()); + System.out.println("Is crossbow: " + (item instanceof lotr.common.item.LOTRItemCrossbow)); + System.out.println("Is bow: " + (item instanceof lotr.common.item.LOTRItemBow)); + System.out.println("Is sword: " + (item instanceof lotr.common.item.LOTRItemSword)); + System.out.println("Is large: " + isLarge); + }*/ + @Shadow + private static List largeItemRenderers; + + @Overwrite + public void onResourceManagerReload(IResourceManager resourceManager) { + largeItemRenderers.clear(); + try { + for (Field field : LOTRMod.class.getFields()) { + System.out.println("Found field " + field.getName() + " of type " + field.getType().getName()); + if (field.getName().equals("spearRedDwarf")) { + System.out.println("Found spearRedDwarf"); + System.out.println("Is type Item: " + (field.get(null) instanceof Item)); + } + if (field.get(null) instanceof Item) { + Item item = (Item)field.get(null); + MinecraftForgeClient.registerItemRenderer(item, null); + LOTRRenderLargeItem largeItemRenderer = LOTRRenderLargeItem.getRendererIfLarge(item); + boolean isLarge = (largeItemRenderer != null); + System.out.println("\u001B[35mVerifying item in renderer manager..."); + System.out.println("Name of item is " + item.getUnlocalizedName()); + System.out.println("Is crossbow: " + (item instanceof lotr.common.item.LOTRItemCrossbow)); + System.out.println("Is bow: " + (item instanceof lotr.common.item.LOTRItemBow)); + System.out.println("Is sword: " + (item instanceof lotr.common.item.LOTRItemSword)); + System.out.println("Is large: " + isLarge); + if (item instanceof lotr.common.item.LOTRItemCrossbow) { + MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderCrossbow()); + } else if (item instanceof lotr.common.item.LOTRItemBow) { + MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderBow(largeItemRenderer)); + } else if (item instanceof LOTRItemSword && ((LOTRItemSword)item).isElvenBlade()) { + double d = 24.0D; + if (item == LOTRMod.sting) + d = 40.0D; + MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderElvenBlade(d, largeItemRenderer)); + } else if (isLarge) { + MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)largeItemRenderer); + } + if (largeItemRenderer != null) + largeItemRenderers.add(largeItemRenderer); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(LOTRMod.commandTable), (IItemRenderer)new LOTRRenderInvTableCommand()); + MinecraftForgeClient.registerItemRenderer(LOTRMod.hobbitPipe, (IItemRenderer)new LOTRRenderBlownItem()); + MinecraftForgeClient.registerItemRenderer(LOTRMod.commandHorn, (IItemRenderer)new LOTRRenderBlownItem()); + MinecraftForgeClient.registerItemRenderer(LOTRMod.conquestHorn, (IItemRenderer)new LOTRRenderBlownItem()); + MinecraftForgeClient.registerItemRenderer(LOTRMod.banner, (IItemRenderer)new LOTRRenderBannerItem()); + MinecraftForgeClient.registerItemRenderer(LOTRMod.orcSkullStaff, (IItemRenderer)new LOTRRenderSkullStaff()); + Iterator itItems = Item.itemRegistry.iterator(); + while (itItems.hasNext()) { + Item item = itItems.next(); + if (item instanceof lotr.common.item.LOTRItemAnimalJar) + MinecraftForgeClient.registerItemRenderer(item, (IItemRenderer)new LOTRRenderAnimalJar()); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.java new file mode 100644 index 0000000..030695b --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRMaterial.java @@ -0,0 +1,61 @@ +package com.zivilon.cinder_loe.mixins; + +import net.minecraft.item.Item; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import lotr.common.item.LOTRMaterial; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Field; + +import com.zivilon.cinder_loe.CinderLoE; + +@Mixin(LOTRMaterial.class) +public class MixinLOTRMaterial { + static { + try { + Class lotrMaterialClass = Class.forName("lotr.common.item.LOTRMaterial"); + Field redDwarfSteelField = lotrMaterialClass.getField("RED_DWARF_STEEL"); + + // Reflection to access and instantiate the private constructor of LOTRMaterial + Constructor constructor = lotrMaterialClass.getDeclaredConstructor(String.class); + constructor.setAccessible(true); + Object redDwarfSteelMaterial = constructor.newInstance("RED_DWARF_STEEL"); + + // Reflection to call the private methods on the new instance + Method setUses = lotrMaterialClass.getDeclaredMethod("setUses", int.class); + Method setDamage = lotrMaterialClass.getDeclaredMethod("setDamage", float.class); + Method setProtection = lotrMaterialClass.getDeclaredMethod("setProtection", float.class); + Method setHarvestLevel = lotrMaterialClass.getDeclaredMethod("setHarvestLevel", int.class); + Method setSpeed = lotrMaterialClass.getDeclaredMethod("setSpeed", float.class); + Method setEnchantability = lotrMaterialClass.getDeclaredMethod("setEnchantability", int.class); + + setUses.setAccessible(true); + setDamage.setAccessible(true); + setProtection.setAccessible(true); + setHarvestLevel.setAccessible(true); + setSpeed.setAccessible(true); + setEnchantability.setAccessible(true); + + setUses.invoke(redDwarfSteelMaterial, 700); + setDamage.invoke(redDwarfSteelMaterial, 3.0F); + setProtection.invoke(redDwarfSteelMaterial, 0.7F); + setHarvestLevel.invoke(redDwarfSteelMaterial, 3); + setSpeed.invoke(redDwarfSteelMaterial, 7.0F); + setEnchantability.invoke(redDwarfSteelMaterial, 10); + + // Assuming a public method to set the crafting item exists + Method setCraftingItem = lotrMaterialClass.getDeclaredMethod("setCraftingItem", Item.class); + setCraftingItem.setAccessible(true); + setCraftingItem.invoke(redDwarfSteelMaterial, CinderLoE.redDwarfSteel); + + // Now, assign the created and configured LOTRMaterial instance to the static field + redDwarfSteelField.set(null, redDwarfSteelMaterial); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.java new file mode 100644 index 0000000..24b7fcd --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRNPCRendering.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRNPCRendering; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRNPCRendering.class) +public abstract class MixinLOTRNPCRendering { + @Redirect(method = "renderQuestBook(Llotr/common/entity/npc/LOTREntityNPC;DDD)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private static void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java new file mode 100644 index 0000000..0d3960f --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderArmorStand.java @@ -0,0 +1,150 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.CinderLoE_Config; +import org.lwjgl.opengl.GL11; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import io.gitlab.dwarfyassassin.lotrucp.client.util.FakeArmorStandEntity; + +import lotr.client.LOTRClientProxy; +import lotr.client.model.LOTRArmorModels; +import lotr.client.model.LOTRModelBiped; +import lotr.client.render.tileentity.LOTRRenderArmorStand; +import lotr.common.tileentity.LOTRTileEntityArmorStand; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; + +@Mixin(LOTRRenderArmorStand.class) +public abstract class MixinLOTRRenderArmorStand extends TileEntitySpecialRenderer { + + @Shadow + private static ModelBase standModel; + @Shadow + private static ResourceLocation standTexture; + + @Shadow + private static ModelBiped modelBipedMain; + @Shadow + private static ModelBiped modelBiped1; + @Shadow + private static ModelBiped modelBiped2; + @Shadow + private static float BIPED_ARM_ROTATION; + @Shadow + private static float BIPED_TICKS_EXISTED; + + @Overwrite(remap = false) + public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) { + LOTRTileEntityArmorStand armorStand = (LOTRTileEntityArmorStand)tileentity; + FakeArmorStandEntity fakeArmorStandEntity = FakeArmorStandEntity.INSTANCE; + GL11.glPushMatrix(); + GL11.glDisable(2884); + GL11.glEnable(32826); + GL11.glEnable(3008); + GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); + switch (armorStand.getBlockMetadata() & 0x3) { + case 0: + GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F); + break; + case 1: + GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); + break; + case 2: + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + break; + case 3: + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + break; + } + GL11.glScalef(-1.0F, -1.0F, 1.0F); + float scale = 0.0625F; + bindTexture(standTexture); + standModel.render((Entity)fakeArmorStandEntity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, scale); + LOTRArmorModels.INSTANCE.setupModelForRender(modelBipedMain, null, (EntityLivingBase)fakeArmorStandEntity); + GL11.glTranslatef(0.0F, -0.1875F, 0.0F); + for (int slot = 0; slot < 4; slot++) { + ItemStack itemstack = armorStand.func_70301_a(slot); + if (itemstack != null && (itemstack.getItem() instanceof ItemArmor || itemstack.getItem() instanceof lotr.common.item.LOTRItemPlate)) { + boolean isArmor = itemstack.getItem() instanceof ItemArmor; + if (isArmor) + bindTexture(RenderBiped.getArmorResource((Entity)fakeArmorStandEntity, itemstack, slot, null)); + ModelBiped armorModel = (slot == 2) ? modelBiped2 : modelBiped1; + LOTRArmorModels.INSTANCE.setupArmorForSlot(armorModel, slot); + armorModel = ForgeHooksClient.getArmorModel((EntityLivingBase)fakeArmorStandEntity, itemstack, slot, armorModel); + ModelBiped specialModel = LOTRArmorModels.INSTANCE.getSpecialArmorModel(itemstack, slot, (EntityLivingBase)fakeArmorStandEntity, modelBipedMain); + if (specialModel != null) + armorModel = specialModel; + LOTRArmorModels.INSTANCE.setupModelForRender(armorModel, null, (EntityLivingBase)fakeArmorStandEntity); + float f1 = 1.0F; + boolean isColoredArmor = false; + if (isArmor) { + int j = ((ItemArmor)itemstack.getItem()).getColor(itemstack); + if (j != -1) { + float f2 = (j >> 16 & 0xFF) / 255.0F; + float f3 = (j >> 8 & 0xFF) / 255.0F; + float f4 = (j & 0xFF) / 255.0F; + GL11.glColor3f(f1 * f2, f1 * f3, f1 * f4); + isColoredArmor = true; + } else { + GL11.glColor3f(f1, f1, f1); + } + } else { + GL11.glColor3f(f1, f1, f1); + } + armorModel.render((Entity)fakeArmorStandEntity, BIPED_ARM_ROTATION, 0.0F, BIPED_TICKS_EXISTED, 0.0F, 0.0F, scale); + if (isColoredArmor) { + bindTexture(RenderBiped.getArmorResource(null, itemstack, slot, "overlay")); + f1 = 1.0F; + GL11.glColor3f(f1, f1, f1); + armorModel.render((Entity)fakeArmorStandEntity, BIPED_ARM_ROTATION, 0.0F, BIPED_TICKS_EXISTED, 0.0F, 0.0F, scale); + } + if (itemstack.isItemEnchanted()) { + float f2 = armorStand.ticksExisted + f; + bindTexture(LOTRClientProxy.enchantmentTexture); + GL11.glEnable(3042); + float f3 = 0.5F; + GL11.glColor4f(f3, f3, f3, 1.0F); + GL11.glDepthFunc(514); + GL11.glDepthMask(false); + for (int k = 0; k < 2; k++) { + GL11.glDisable(2896); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + GL11.glBlendFunc(768, 1); + GL11.glMatrixMode(5890); + GL11.glLoadIdentity(); + float f5 = 0.33333334F; + GL11.glScalef(f5, f5, f5); + GL11.glRotatef(30.0F - k * 60.0F, 0.0F, 0.0F, 1.0F); + float f6 = f2 * (0.001F + k * 0.003F) * 20.0F; + GL11.glTranslatef(0.0F, f6, 0.0F); + GL11.glMatrixMode(5888); + armorModel.render((Entity)fakeArmorStandEntity, BIPED_ARM_ROTATION, 0.0F, BIPED_TICKS_EXISTED, 0.0F, 0.0F, scale); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(5890); + GL11.glDepthMask(true); + GL11.glLoadIdentity(); + GL11.glMatrixMode(5888); + GL11.glEnable(2896); + GL11.glDisable(3042); + GL11.glDepthFunc(515); + } + } + } + GL11.glEnable(2884); + GL11.glDisable(32826); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.java new file mode 100644 index 0000000..3a426f7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBlownItem.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.item.LOTRRenderBlownItem; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderBlownItem.class) +public abstract class MixinLOTRRenderBlownItem { + @Redirect(method = "renderItem(Lnet/minecraftforge/client/IItemRenderer$ItemRenderType;Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.java new file mode 100644 index 0000000..5733c81 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderBow.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.item.LOTRRenderBow; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderBow.class) +public abstract class MixinLOTRRenderBow { + @Redirect(method = "renderItem(Lnet/minecraftforge/client/IItemRenderer$ItemRenderType;Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.java new file mode 100644 index 0000000..73300bb --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderCrossbow.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.item.LOTRRenderCrossbow; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderCrossbow.class) +public abstract class MixinLOTRRenderCrossbow { + @Redirect(method = "renderItem(Lnet/minecraftforge/client/IItemRenderer$ItemRenderType;Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.java new file mode 100644 index 0000000..57502ae --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderDart.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRRenderDart; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderDart.class) +public abstract class MixinLOTRRenderDart { + @Redirect(method = "func_76986_a(Lnet/minecraft/entity/Entity;DDDFF)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.java new file mode 100644 index 0000000..0c98d8d --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElf.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRRenderElf; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderElf.class) +public abstract class MixinLOTRRenderElf { + @Redirect(method = "func_77029_c(Lnet/minecraft/entity/EntityLivingBase;F)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.java new file mode 100644 index 0000000..02d86b7 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderElvenBlade.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.item.LOTRRenderElvenBlade; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderElvenBlade.class) +public abstract class MixinLOTRRenderElvenBlade { + @Redirect(method = "renderItem(Lnet/minecraftforge/client/IItemRenderer$ItemRenderType;Lnet/minecraft/item/ItemStack;[Ljava/lang/Object;)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java new file mode 100644 index 0000000..f19a2dc --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderLargeItem.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.item.LOTRRenderLargeItem; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderLargeItem.class) +public abstract class MixinLOTRRenderLargeItem { + @Redirect(method = "renderLargeItem(Lnet/minecraft/util/IIcon;)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.java new file mode 100644 index 0000000..4e99bd0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderNPCRespawner.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRRenderNPCRespawner; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderNPCRespawner.class) +public abstract class MixinLOTRRenderNPCRespawner { + @Redirect(method = "func_76986_a(Lnet/minecraft/entity/Entity;DDDFF)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.java new file mode 100644 index 0000000..697587c --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderPlateFood.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.tileentity.LOTRRenderPlateFood; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderPlateFood.class) +public abstract class MixinLOTRRenderPlateFood { + @Redirect(method = "func_147500_a(Lnet/minecraft/tileentity/TileEntity;DDDF)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.java new file mode 100644 index 0000000..94929d2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderThrowingAxe.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRRenderThrowingAxe; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderThrowingAxe.class) +public abstract class MixinLOTRRenderThrowingAxe { + @Redirect(method = "func_76986_a(Lnet/minecraft/entity/Entity;DDDFF)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.java new file mode 100644 index 0000000..dabe6e2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRRenderTraderRespawn.java @@ -0,0 +1,21 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import lotr.client.render.entity.LOTRRenderTraderRespawn; + +import net.minecraft.client.renderer.Tessellator; + +@Mixin(LOTRRenderTraderRespawn.class) +public abstract class MixinLOTRRenderTraderRespawn { + @Redirect(method = "func_76986_a(Lnet/minecraft/entity/Entity;DDDFF)V", remap = false, + at = @At(value = "INVOKE", + target = "Lnet/minecraft/client/renderer/ItemRenderer;func_78439_a(Lnet/minecraft/client/renderer/Tessellator;FFFFIIF)V")) + private void onRenderItemIn2D(Tessellator tessellator, float f1, float f2, float f, float f3, int width, int height, float thickness) { + RenderHelper.customRenderItemIn2D(tessellator, f1, f2, f, f3, width, height, thickness, false); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java new file mode 100644 index 0000000..4631a3e --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRTileEntityDwarvenForge.java @@ -0,0 +1,59 @@ +package com.zivilon.cinder_loe.mixins; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.init.Items; + +import net.minecraftforge.oredict.OreDictionary; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Overwrite; + +import lotr.common.tileentity.LOTRTileEntityDwarvenForge; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Field; + +import com.zivilon.cinder_loe.CinderLoE; +import lotr.common.LOTRMod; + +@Mixin(LOTRTileEntityDwarvenForge.class) +public abstract class MixinLOTRTileEntityDwarvenForge { + protected boolean isCopper(ItemStack itemstack) { + return (LOTRMod.isOreNameEqual(itemstack, "oreCopper") || LOTRMod.isOreNameEqual(itemstack, "ingotCopper")); + } + + protected boolean isTin(ItemStack itemstack) { + return (LOTRMod.isOreNameEqual(itemstack, "oreTin") || LOTRMod.isOreNameEqual(itemstack, "ingotTin")); + } + + protected boolean isIron(ItemStack itemstack) { + return (LOTRMod.isOreNameEqual(itemstack, "oreIron") || LOTRMod.isOreNameEqual(itemstack, "ingotIron")); + } + + protected boolean isCoal(ItemStack itemstack) { + return (itemstack.getItem() == Items.coal); + } + + protected boolean isGoldNugget(ItemStack itemstack) { + return (itemstack.getItem() == Items.gold_nugget); + } + + @Overwrite(remap = false) + protected ItemStack getAlloySmeltingResult(ItemStack itemstack, ItemStack alloyItem) { + if (isIron(itemstack) && isCoal(alloyItem)) + return new ItemStack(LOTRMod.dwarfSteel); + if (isIron(itemstack) && alloyItem.getItem() == LOTRMod.quenditeCrystal) + return new ItemStack(LOTRMod.galvorn); + if (isIron(itemstack) && alloyItem.getItem() == Item.getItemFromBlock(LOTRMod.rock) && alloyItem.getItemDamage() == 3) + return new ItemStack(LOTRMod.blueDwarfSteel); + if (isCopper(itemstack) && alloyItem.getItem() == Item.getItemById(371)) + return new ItemStack(CinderLoE.redDwarfSteel); + if ((isCopper(itemstack) && isTin(alloyItem)) || (isTin(itemstack) && isCopper(alloyItem))) + return new ItemStack(LOTRMod.bronze, 2); + return null; + } +} + diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java new file mode 100644 index 0000000..76786c0 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinLOTRWorldGenMumakSkeleton.java @@ -0,0 +1,29 @@ +package com.zivilon.cinder_loe.mixins; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import lotr.common.world.structure2.LOTRWorldGenMumakSkeleton; + +import net.minecraft.block.Block; + +import java.util.Random; + +import com.zivilon.cinder_loe.CinderLoE; + +@Mixin(LOTRWorldGenMumakSkeleton.class) +public class MixinLOTRWorldGenMumakSkeleton { + + @Shadow + protected Block boneBlock; + + @Shadow + protected int boneMeta; + + @Overwrite(remap = false) + protected void setupRandomBlocks(Random random) { + this.boneBlock = CinderLoE.ivoryBlock; + this.boneMeta = 3; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java new file mode 100644 index 0000000..396b349 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRenderItem.java @@ -0,0 +1,228 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.CinderLoE_Config; +import com.zivilon.cinder_loe.client.render.item.RenderHelper; +import com.zivilon.cinder_loe.util.Utilities; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Random; +import java.util.concurrent.Callable; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemCloth; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ReportedException; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.ForgeHooksClient; + +@Mixin(RenderItem.class) +public abstract class MixinRenderItem extends Render { + @Shadow + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + @Shadow + private Random random; + + @Shadow + public static boolean renderInFrame; + + @Shadow + public byte getMiniBlockCount(ItemStack stack, byte original) { + return 0; + } + + @Shadow + public byte getMiniItemCount(ItemStack stack, byte original) { + return 0; + } + + @Shadow + public boolean shouldSpreadItems() { + return false; + } + + @Shadow + private void renderGlint(int p_77018_1_, int p_77018_2_, int p_77018_3_, int p_77018_4_, int p_77018_5_) {} + + @Overwrite(remap = false) + private void renderDroppedItem(EntityItem p_77020_1_, IIcon p_77020_2_, int p_77020_3_, float p_77020_4_, float p_77020_5_, float p_77020_6_, float p_77020_7_, int pass) { + Tessellator tessellator = Tessellator.instance; + + if (p_77020_2_ == null) { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + ResourceLocation resourcelocation = texturemanager.getResourceLocation(p_77020_1_.getEntityItem().getItemSpriteNumber()); + p_77020_2_ = ((TextureMap)texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno"); + } + + float f14 = ((IIcon)p_77020_2_).getMinU(); + float f15 = ((IIcon)p_77020_2_).getMaxU(); + float f4 = ((IIcon)p_77020_2_).getMinV(); + float f5 = ((IIcon)p_77020_2_).getMaxV(); + float f6 = 1.0F; + float f7 = 0.5F; + float f8 = 0.25F; + float f10; + + if (this.renderManager.options.fancyGraphics) { + GL11.glPushMatrix(); + + if (renderInFrame) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + else { + GL11.glRotatef((((float)p_77020_1_.age + p_77020_4_) / 20.0F + p_77020_1_.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + } + + float f9 = 0.0625F; + f10 = 0.021875F; + ItemStack itemstack = p_77020_1_.getEntityItem(); + int j = itemstack.stackSize; + byte b0; + + if (j < 2) { + b0 = 1; + } + else if (j < 16) { + b0 = 2; + } + else if (j < 32) { + b0 = 3; + } + else { + b0 = 4; + } + + b0 = getMiniItemCount(itemstack, b0); + + GL11.glTranslatef(-f7, -f8, -((f9 + f10) * (float)b0 / 2.0F)); + + for (int k = 0; k < b0; ++k) { + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + if (k > 0 && shouldSpreadItems()) { + float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; + GL11.glTranslatef(x, y, f9 + f10); + } + else { + GL11.glTranslatef(0f, 0f, f9 + f10); + } + + if (itemstack.getItemSpriteNumber() == 0) { + this.bindTexture(TextureMap.locationBlocksTexture); + } + else { + this.bindTexture(TextureMap.locationItemsTexture); + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + RenderHelper.customRenderItemIn2D(tessellator, f15, f4, f14, f5, ((IIcon)p_77020_2_).getIconWidth(), ((IIcon)p_77020_2_).getIconHeight(), f9, false); + + if (itemstack.hasEffect(pass)) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); + float f12 = 0.125F; + GL11.glScalef(f12, f12, f12); + float f13 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + GL11.glTranslatef(f13, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f9, true); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(f12, f12, f12); + f13 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + GL11.glTranslatef(-f13, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); + RenderHelper.customRenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f9, true); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + } + + GL11.glPopMatrix(); + } + else { + for (int l = 0; l < p_77020_3_; ++l) { + GL11.glPushMatrix(); + + if (l > 0) { + f10 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float f16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + float f17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; + GL11.glTranslatef(f10, f16, f17); + } + + if (!renderInFrame) { + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + } + + GL11.glColor4f(p_77020_5_, p_77020_6_, p_77020_7_, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + tessellator.addVertexWithUV((double)(0.0F - f7), (double)(0.0F - f8), 0.0D, (double)f14, (double)f5); + tessellator.addVertexWithUV((double)(f6 - f7), (double)(0.0F - f8), 0.0D, (double)f15, (double)f5); + tessellator.addVertexWithUV((double)(f6 - f7), (double)(1.0F - f8), 0.0D, (double)f15, (double)f4); + tessellator.addVertexWithUV((double)(0.0F - f7), (double)(1.0F - f8), 0.0D, (double)f14, (double)f4); + tessellator.draw(); + GL11.glPopMatrix(); + } + } + } + + @Overwrite(remap = false) + public void renderEffect(TextureManager manager, int x, int y) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(false); + manager.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java new file mode 100644 index 0000000..9c31081 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/mixins/MixinRendererLivingEntity.java @@ -0,0 +1,302 @@ +package com.zivilon.cinder_loe.mixins; + +import com.zivilon.cinder_loe.CinderLoE_Config; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.RenderLivingEvent; +import net.minecraftforge.common.MinecraftForge; + +@Mixin(RendererLivingEntity.class) +public abstract class MixinRendererLivingEntity extends Render { + + @Shadow + protected ModelBase renderPassModel; + + @Shadow + protected ModelBase mainModel; + + @Shadow + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + + @Shadow + private static final Logger logger = LogManager.getLogger(); + + @Shadow + protected int inheritRenderPass(EntityLivingBase p_77035_1_, int p_77035_2_, float p_77035_3_) { + return 0; + } + + @Shadow + protected int getColorMultiplier(EntityLivingBase p_77030_1_, float p_77030_2_, float p_77030_3_) { + return 0; + } + + @Shadow + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) {} + + @Shadow + protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {} + + @Shadow + protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) { + return 0.0F; + } + + @Shadow + protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {} + + @Shadow + protected void renderLivingAt(EntityLivingBase p_77039_1_, double p_77039_2_, double p_77039_4_, double p_77039_6_) {} + + @Shadow + protected void passSpecialRender(EntityLivingBase p_77033_1_, double p_77033_2_, double p_77033_4_, double p_77033_6_) {} + + @Shadow + protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_) { + return 0; + } + + @Shadow + protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_) {} + + @Shadow + private float interpolateRotation(float p_77034_1_, float p_77034_2_, float p_77034_3_) { + return 0.0F; + } + + @Shadow + protected void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) {} + + @Shadow + protected float renderSwingProgress(EntityLivingBase p_77040_1_, float p_77040_2_) { + return 0.0F; + } + + @Overwrite + public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + if (MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Pre(p_76986_1_, (RendererLivingEntity)(Object)this, p_76986_2_, p_76986_4_, p_76986_6_))) return; + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + this.mainModel.onGround = this.renderSwingProgress(p_76986_1_, p_76986_9_); + + if (this.renderPassModel != null) + { + this.renderPassModel.onGround = this.mainModel.onGround; + } + + this.mainModel.isRiding = p_76986_1_.isRiding(); + + if (this.renderPassModel != null) + { + this.renderPassModel.isRiding = this.mainModel.isRiding; + } + + this.mainModel.isChild = p_76986_1_.isChild(); + + if (this.renderPassModel != null) + { + this.renderPassModel.isChild = this.mainModel.isChild; + } + + try + { + float f2 = this.interpolateRotation(p_76986_1_.prevRenderYawOffset, p_76986_1_.renderYawOffset, p_76986_9_); + float f3 = this.interpolateRotation(p_76986_1_.prevRotationYawHead, p_76986_1_.rotationYawHead, p_76986_9_); + float f4; + + if (p_76986_1_.isRiding() && p_76986_1_.ridingEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase1 = (EntityLivingBase)p_76986_1_.ridingEntity; + f2 = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset, entitylivingbase1.renderYawOffset, p_76986_9_); + f4 = MathHelper.wrapAngleTo180_float(f3 - f2); + + if (f4 < -85.0F) + { + f4 = -85.0F; + } + + if (f4 >= 85.0F) + { + f4 = 85.0F; + } + + f2 = f3 - f4; + + if (f4 * f4 > 2500.0F) + { + f2 += f4 * 0.2F; + } + } + + float f13 = p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_; + this.renderLivingAt(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + f4 = this.handleRotationFloat(p_76986_1_, p_76986_9_); + this.rotateCorpse(p_76986_1_, f4, f2, p_76986_9_); + float f5 = 0.0625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.preRenderCallback(p_76986_1_, p_76986_9_); + GL11.glTranslatef(0.0F, -24.0F * f5 - 0.0078125F, 0.0F); + float f6 = p_76986_1_.prevLimbSwingAmount + (p_76986_1_.limbSwingAmount - p_76986_1_.prevLimbSwingAmount) * p_76986_9_; + float f7 = p_76986_1_.limbSwing - p_76986_1_.limbSwingAmount * (1.0F - p_76986_9_); + + if (p_76986_1_.isChild()) + { + f7 *= 3.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + this.mainModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_); + this.renderModel(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + int j; + float f8; + float f9; + float f10; + + for (int i = 0; i < 4; ++i) + { + j = this.shouldRenderPass(p_76986_1_, i, p_76986_9_); + + if (j > 0) + { + this.renderPassModel.setLivingAnimations(p_76986_1_, f7, f6, p_76986_9_); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + if ((j & 240) == 16) + { + this.func_82408_c(p_76986_1_, i, p_76986_9_); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + if ((j & 15) == 15) + { + f8 = (float)p_76986_1_.ticksExisted + p_76986_9_; + this.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + f9 = 0.5F; + GL11.glColor4f(f9, f9, f9, 1.0F); + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDepthMask(false); + + for (int k = 0; k < 2; ++k) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glColor4f(CinderLoE_Config.enchantment_color_red, CinderLoE_Config.enchantment_color_green, CinderLoE_Config.enchantment_color_blue, 1.0F); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f11 = f8 * (0.001F + (float)k * 0.003F) * 20.0F; + float f12 = 0.33333334F; + GL11.glScalef(f12, f12, f12); + GL11.glRotatef(30.0F - (float)k * 60.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, f11, 0.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glDepthMask(true); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } + + GL11.glDepthMask(true); + this.renderEquippedItems(p_76986_1_, p_76986_9_); + float f14 = p_76986_1_.getBrightness(p_76986_9_); + j = this.getColorMultiplier(p_76986_1_, f14, p_76986_9_); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + + if ((j >> 24 & 255) > 0 || p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthFunc(GL11.GL_EQUAL); + + if (p_76986_1_.hurtTime > 0 || p_76986_1_.deathTime > 0) + { + GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F); + this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + for (int l = 0; l < 4; ++l) + { + if (this.inheritRenderPass(p_76986_1_, l, p_76986_9_) >= 0) + { + GL11.glColor4f(f14, 0.0F, 0.0F, 0.4F); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + } + } + + if ((j >> 24 & 255) > 0) + { + f8 = (float)(j >> 16 & 255) / 255.0F; + f9 = (float)(j >> 8 & 255) / 255.0F; + float f15 = (float)(j & 255) / 255.0F; + f10 = (float)(j >> 24 & 255) / 255.0F; + GL11.glColor4f(f8, f9, f15, f10); + this.mainModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + + for (int i1 = 0; i1 < 4; ++i1) + { + if (this.inheritRenderPass(p_76986_1_, i1, p_76986_9_) >= 0) + { + GL11.glColor4f(f8, f9, f15, f10); + this.renderPassModel.render(p_76986_1_, f7, f6, f4, f3 - f2, f13, f5); + } + } + } + + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + catch (Exception exception) + { + logger.error("Couldn\'t render entity", exception); + } + + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + this.passSpecialRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_); + MinecraftForge.EVENT_BUS.post(new RenderLivingEvent.Post(p_76986_1_, (RendererLivingEntity)(Object)this, p_76986_2_, p_76986_4_, p_76986_6_)); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/recipes.java b/src/main/java/com/zivilon/cinder_loe/recipes.java new file mode 100644 index 0000000..5d7a227 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/recipes.java @@ -0,0 +1,133 @@ +package com.zivilon.cinder_loe; + +import com.zivilon.cinder_loe.CinderLoE; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraftforge.oredict.ShapedOreRecipe; +import lotr.common.LOTRMod; +import lotr.common.recipe.LOTRRecipes; +import lotr.common.recipe.LOTRRecipePoisonWeapon; + +public class recipes { + + public static void registerRecipes() { + // Register a block recipe + System.out.println("[CinderLoE] Registering recipes..."); + registerGeneralRecipes(); + registerRedDwarvenRecipes(); + registerLimwaithRecipes(); + registerBreeRecipes(); + registerArnorRecipes(); + } + public static void registerGeneralRecipes() { + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.cinderBlock), new Object[] { "XXX", "XYX", "XXX", + Character.valueOf('X'), Blocks.stone, Character.valueOf('Y'), LOTRMod.balrogFire })); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.reedBale), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), LOTRMod.reeds})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.leatherBundle), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), Items.leather})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.furBundle), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), LOTRMod.fur})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.fishBarrel), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), Items.fish})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.silverChain, 6), new Object[] { " X ", " X ", " X ", + Character.valueOf('X'), LOTRMod.silver})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.goldChain, 6), new Object[] { " X ", " X ", " X ", + Character.valueOf('X'), Items.gold_ingot})); + GameRegistry.addRecipe((IRecipe)new ShapedOreRecipe(new ItemStack(CinderLoE.ironChain, 6), new Object[] { " X ", " X ", " X ", + Character.valueOf('X'), Items.iron_ingot})); + } + public static void registerRedDwarvenRecipes() { + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.helmetRedDwarf), new Object[] { "XXX", "X X", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bodyRedDwarf), new Object[] { "X X", "XXX", "XXX", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.legsRedDwarf), new Object[] { "XXX", "X X", "X X", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bootsRedDwarf), new Object[] { "X X", "X X", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.spearRedDwarf), new Object[] { " X", " Y ", "Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.swordRedDwarf), new Object[] { " X ", " X ", " Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.battleaxeRedDwarf), new Object[] { "XXX", "XYX", " Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.pikeRedDwarf), new Object[] { " X", " YX", "Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.hammerRedDwarf), new Object[] { "XYX", "XYX", " Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.daggerRedDwarf), new Object[] { "X ", "Y ", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.crossbowRedDwarf), new Object[] { "XXY", "ZYX", "YZX", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "stickWood", Character.valueOf('Z'), "string" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.boarArmorRedDwarf), new Object[] { "X ", "XYX", "XXX", + Character.valueOf('X'), CinderLoE.redDwarfSteel, Character.valueOf('Y'), "leather" })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.blockRedDwarfSteel), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.redDwarfSteel), new Object[] { "X ", " ", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.chandelierRedDwarf, 2), new Object[] { " X ", "ZYZ", " ", + Character.valueOf('X'), "stickWood", Character.valueOf('Y'), CinderLoE.redDwarfSteel, Character.valueOf('Z'), Blocks.torch })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.barsRedDwarf, 16), new Object[] { "XXX", "XXX", " ", + Character.valueOf('X'), CinderLoE.redDwarfSteel })); + LOTRRecipes.dwarvenRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.dwarvenBrickRuned, 4), new Object[] { " X ", "XYX", " X ", + Character.valueOf('X'), new ItemStack(LOTRMod.brick, 1, 6), Character.valueOf('Y'), Items.gold_nugget})); + GameRegistry.addShapelessRecipe(new ItemStack(CinderLoE.redDwarfSteel, 9), new Object[] { new ItemStack(CinderLoE.blockRedDwarfSteel) }); + GameRegistry.addRecipe(new ItemStack(CinderLoE.blockRedDwarfSteel, 1), new Object[] { "XXX", "XXX", "XXX", + Character.valueOf('X'), CinderLoE.redDwarfSteel }); + GameRegistry.addRecipe(new LOTRRecipePoisonWeapon(CinderLoE.daggerRedDwarf, CinderLoE.daggerRedDwarfPoisoned)); + } + + public static void registerLimwaithRecipes() { + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.helmetLimwaith), new Object[] { "XXX", "Y Y", + Character.valueOf('X'), LOTRMod.driedReeds, Character.valueOf('Y'), new ItemStack(LOTRMod.planks, 1, 15)})); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bodyLimwaith), new Object[] { "X X", "YYY", "XXX", + Character.valueOf('X'), LOTRMod.driedReeds, Character.valueOf('Y'), new ItemStack(LOTRMod.planks, 1, 15)})); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.legsLimwaith), new Object[] { "XXX", "Y Y", "X X", + Character.valueOf('X'), LOTRMod.driedReeds, Character.valueOf('Y'), new ItemStack(LOTRMod.planks, 1, 15)})); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bootsLimwaith), new Object[] { "Y Y", "X X", + Character.valueOf('X'), LOTRMod.driedReeds, Character.valueOf('Y'), new ItemStack(LOTRMod.planks, 1, 15)})); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.spearLimwaith), new Object[] { " X", " Y ", "Y ", + Character.valueOf('X'), Items.bone, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.truncheonLimwaith), new Object[] { " X ", " X ", " Y ", + Character.valueOf('X'), Items.bone, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.battleaxeLimwaith), new Object[] { "XXX", "XYX", " Y ", + Character.valueOf('X'), Items.bone, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.tridentLimwaith), new Object[] { " XX", " YX", "Y ", + Character.valueOf('X'), Items.bone, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.daggerLimwaith), new Object[] { "X ", "Y ", + Character.valueOf('X'), Items.bone, Character.valueOf('Y'), "stickWood" })); + LOTRRecipes.moredainRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.blowgunLimwaith), new Object[] { "YXX", " ", " ", + Character.valueOf('X'), LOTRMod.reeds, Character.valueOf('Y'), "stickWood" })); + GameRegistry.addRecipe(new LOTRRecipePoisonWeapon(CinderLoE.daggerLimwaith, CinderLoE.daggerLimwaithPoisoned)); + } + + public static void registerBreeRecipes() { + LOTRRecipes.breeRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.helmetBree), new Object[] { "XXX", "X X", + Character.valueOf('X'), Items.iron_ingot})); + LOTRRecipes.breeRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bodyBree), new Object[] { "X X", "XXX", "XXX", + Character.valueOf('X'), Items.iron_ingot })); + LOTRRecipes.breeRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.legsBree), new Object[] { "XXX", "X X", "X X", + Character.valueOf('X'), Items.iron_ingot })); + LOTRRecipes.breeRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bootsBree), new Object[] { "X X", "X X", + Character.valueOf('X'), Items.iron_ingot })); + LOTRRecipes.breeRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.swordBree), new Object[] { " X ", " X ", " Y ", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), "stickWood" })); + } + + public static void registerArnorRecipes() { + LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.helmetArnorBanner), new Object[] { "YYY", "Y Y", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), Items.leather })); + LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bodyArnorBanner), new Object[] { "Y Y", "XXX", "YYY", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), Items.leather })); + LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.legsArnorBanner), new Object[] { "YYY", "X X", "Y Y", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), Items.leather })); + LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.bootsArnorBanner), new Object[] { "X X", "X X", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), Items.leather })); + LOTRRecipes.rangerRecipes.add(new ShapedOreRecipe(new ItemStack(CinderLoE.maceArnor), new Object[] { " XX", " XX", "Y ", + Character.valueOf('X'), Items.iron_ingot, Character.valueOf('Y'), "stickWood" })); + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.java b/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.java new file mode 100644 index 0000000..0f2f3c2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/tileentity/TileEntityMistBlock.java @@ -0,0 +1,66 @@ +package com.zivilon.cinder_loe.tileentity; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import java.util.List; + +import lotr.common.LOTRDimension; +import lotr.common.LOTRGuiMessageTypes; +import lotr.common.LOTRLevelData; +import lotr.common.LOTRMod; +import lotr.common.tileentity.LOTRTileEntityUtumnoPortal; +import lotr.common.world.LOTRTeleporterUtumno; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.Teleporter; +import net.minecraft.world.World; + +public class TileEntityMistBlock extends LOTRTileEntityUtumnoPortal { + public float color_red; + public float color_green; + public float color_blue; + + public TileEntityMistBlock() { + this(0.0F, 0.0F, 0.0F); + } + + public TileEntityMistBlock(float r, float g, float b) { + color_red = r; + color_green = g; + color_blue = b; + } + + public void func_149670_a(World world, int i, int j, int k, Entity entity) {} + + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setFloat("red", this.color_red); + nbt.setFloat("green", this.color_green); + nbt.setFloat("blue", this.color_blue); + } + + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + this.color_red = nbt.getFloat("red"); + this.color_green = nbt.getFloat("green"); + this.color_blue = nbt.getFloat("blue"); + } + + @Override + public void func_145845_h() {} + + @Override + public void transferEntity(Entity entity) {} + + private LOTRTileEntityUtumnoPortal findActingTargetingPortal() { + return null; + } +} diff --git a/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java b/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java new file mode 100644 index 0000000..61c6ac9 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/util/BlockPos.java @@ -0,0 +1,50 @@ +package com.zivilon.cinder_loe.util; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockBush; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.Random; + +public class BlockPos { + public int x, y, z; + + public BlockPos(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + public static BlockPos findSafeSpawnLocation(World world, EntityPlayer entityPlayer) { + Random rand = new Random(); + ArrayList validPositions = new ArrayList(); + int radius = 5; // 5-block radius + + int originX = MathHelper.floor_double(entityPlayer.posX); + int originY = MathHelper.floor_double(entityPlayer.posY); + int originZ = MathHelper.floor_double(entityPlayer.posZ); + + for (int x = originX - radius; x <= originX + radius; x++) { + for (int z = originZ - radius; z <= originZ + radius; z++) { + for (int y = originY - radius; y <= originY + radius; y++) { + Block block = world.getBlock(x, y, z); + Block blockAbove = world.getBlock(x, y + 1, z); + + // Check if the block is solid and there's air above it + if (!block.isAir(world, x, y, z) && !(block instanceof BlockBush) && (blockAbove.isAir(world, x, y + 1, z) || (blockAbove instanceof BlockBush))) { + validPositions.add(new BlockPos(x, y + 1, z)); // Add the position above the solid block + } + } + } + } + if (validPositions.isEmpty()) { + return null; // No valid position found + } + + // Select a random valid position + return validPositions.get(rand.nextInt(validPositions.size())); + } + +} diff --git a/src/main/java/com/zivilon/cinder_loe/util/Utilities.java b/src/main/java/com/zivilon/cinder_loe/util/Utilities.java new file mode 100644 index 0000000..745a2b2 --- /dev/null +++ b/src/main/java/com/zivilon/cinder_loe/util/Utilities.java @@ -0,0 +1,124 @@ +package com.zivilon.cinder_loe.util; + +import com.zivilon.cinder_loe.client.render.item.RenderHelper; + +import java.io.BufferedWriter; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.UUID; +import java.util.Vector; + +import lotr.common.LOTRCreativeTabs; +import lotr.common.world.biome.LOTRBiome; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.server.MinecraftServer; + +public class Utilities { + + public static LOTRBiome reflected_river; + public static LOTRCreativeTabs reflected_tab_block; + + public static void initialize_reflects() { + try { + Field riverField = LOTRBiome.class.getField("river"); + reflected_river = (LOTRBiome)riverField.get(null); + + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + public static void pre_init_reflects() { + try { + Field tabBlockField = LOTRCreativeTabs.class.getField("tabBlock"); + reflected_tab_block = (LOTRCreativeTabs)tabBlockField.get(null); + } catch (NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + public static EntityPlayerMP getPlayerByUUID(UUID playerUUID) { + MinecraftServer server = MinecraftServer.getServer(); // Get the server instance + if (server == null) { + return null; // Server instance is not available + } + + // Iterate through the list of online players and match UUID + for (Object obj : server.getConfigurationManager().playerEntityList) { + if (obj instanceof EntityPlayerMP) { + EntityPlayerMP player = (EntityPlayerMP) obj; + if (player.getUniqueID().equals(playerUUID)) { + return player; + } + } else { + System.err.println("[CinderCore] Player list having non-players, WHAT?!?!?!"); + } + } + return null; // Player not found or not online + } + + public static String toSnakeCase(String input) { + if (input == null || input.isEmpty()) { + return input; + } + + StringBuilder builder = new StringBuilder(); + char[] chars = input.toCharArray(); + + builder.append(Character.toLowerCase(chars[0])); + for (int i = 1; i < chars.length; i++) { + char c = chars[i]; + if (Character.isUpperCase(c)) { + builder.append('_').append(Character.toLowerCase(c)); + } else { + builder.append(c); + } + } + + return builder.toString(); + } + + public static void dumpClass(String className, String outputFilePath, Class contextClass) { + // Convert class name to a resource path + String resourcePath = className.replace('.', '/') + ".class"; + // Use the class loader of the context class to find the resource + try (InputStream classStream = contextClass.getClassLoader().getResourceAsStream(resourcePath)) { + if (classStream == null) { + System.err.println("Class " + className + " could not be found."); + return; + } + try (OutputStream outputStream = new FileOutputStream(outputFilePath)) { + // Copy the class stream to the output file + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = classStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + System.out.println("Dumped " + className + " to " + outputFilePath); + } catch (IOException e) { + System.err.println("Failed to write class file: " + e.getMessage()); + } + } catch (IOException e) { + System.err.println("Failed to read class file: " + e.getMessage()); + } + } + + public static void writeLog(String message) { + try (BufferedWriter writer = new BufferedWriter(new FileWriter("custom_log.txt", true))) { + LocalDateTime now = LocalDateTime.now(); + String timestamp = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + writer.write(timestamp + " - " + message + "\n"); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/src/main/resources/LICENSE b/src/main/resources/LICENSE new file mode 100644 index 0000000..be08a1d --- /dev/null +++ b/src/main/resources/LICENSE @@ -0,0 +1,88 @@ +Code of CinderLoE is marked with CC0 1.0 Universal. To view a copy of this license, visit http://creativecommons.org/publicdomain/zero/1.0 +License not applicable to graphics contained within the package. + +Graphics: +KeyLime17 & cleric_red: (All rights reserved) +- assets/cinder_loe/mob/limwaith/* +- assets/lotr/armor/* +- assets/lotr/item/banner/banner_redDwarf.png +- assets/lotr/textures/blocks/bars_red_dwarf.png +- assets/lotr/textures/blocks/chandelier_red_dwarf.png +- assets/lotr/textures/blocks/red_dwarf_steel.png +- assets/lotr/textures/items/alatarStaff.png +- assets/lotr/textures/items/pallandoStaff.png +- assets/lotr/textures/items/radagastStaff.png +- assets/lotr/textures/items/sarumanStaff.png +- assets/lotr/textures/items/banner_redDwarf.png +- assets/lotr/textures/items/battleaxeLimwaith.png +- assets/lotr/textures/items/blowgunLimwaith.png +- assets/lotr/textures/items/daggerLimwaith.png +- assets/lotr/textures/items/daggerLimwaithPoisoned.png +- assets/lotr/textures/items/tridentLimwaith.png +- assets/lotr/textures/items/truncheonLimwaith.png +- assets/lotr/textures/items/spearLimwaith.png +- assets/lotr/textures/items/helmetLimwaith.png +- assets/lotr/textures/items/bodyLimwaith.png +- assets/lotr/textures/items/legsLimwaith.png +- assets/lotr/textures/items/bootsLimwaith.png +- assets/lotr/textures/items/battleaxeRedDwarf.png +- assets/lotr/textures/items/crossbowRedDwarf.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_0.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_1.png +- assets/lotr/textures/items/crossbowRedDwarf_pull_2.png +- assets/lotr/textures/items/daggerRedDwarf.png +- assets/lotr/textures/items/daggerRedDwarfPoisoned.png +- assets/lotr/textures/items/hammerRedDwarf.png +- assets/lotr/textures/items/pikeRedDwarf.png +- assets/lotr/textures/items/spearRedDwarf.png +- assets/lotr/textures/items/swordRedDwarf.png +- assets/lotr/textures/items/redDwarfSteel.png +- assets/lotr/textures/items/helmetRedDwarf.png +- assets/lotr/textures/items/bodyRedDwarf.png +- assets/lotr/textures/items/legsRedDwarf.png +- assets/lotr/textures/items/bootsRedDwarf.png +- assets/lotr/textures/items/boarArmorRedDwarf.png +- assets/lotr/textures/items/large/alatarStaff.png +- assets/lotr/textures/items/large/pallandoStaff.png +- assets/lotr/textures/items/large/radagastStaff.png +- assets/lotr/textures/items/large/sarumanStaff.png +- assets/lotr/textures/items/large/battleaxeLimwaith.png +- assets/lotr/textures/items/large/tridentLimwaith.png +- assets/lotr/textures/items/large/spearLimwaith.png +- assets/lotr/textures/items/large/spearRedDwarf.png +- assets/lotr/textures/items/large2/pikeRedDwarf.png +- assets/lotr/textures/shield/alignment_RedDwarf.png + +LOTRMod team: (All rights reserved) +- assets/lotr/textures/blocks/fur_bundle_bottom.png +- assets/lotr/textures/blocks/fur_bundle_top.png +- assets/lotr/textures/blocks/fur_bundle_side_0.png +- assets/lotr/textures/blocks/fur_bundle_side_90.png +- assets/lotr/textures/blocks/fur_bundle_side_180.png +- assets/lotr/textures/blocks/fur_bundle_side_270.png +- assets/lotr/textures/blocks/leather_bundle_bottom.png +- assets/lotr/textures/blocks/leather_bundle_top.png +- assets/lotr/textures/blocks/leather_bundle_side_0.png +- assets/lotr/textures/blocks/leather_bundle_side_90.png +- assets/lotr/textures/blocks/leather_bundle_side_180.png +- assets/lotr/textures/blocks/leather_bundle_side_270.png +- assets/lotr/textures/blocks/reed_bale_bottom.png +- assets/lotr/textures/blocks/reed_bale_top.png +- assets/lotr/textures/blocks/reed_bale_side_0.png +- assets/lotr/textures/blocks/reed_bale_side_90.png +- assets/lotr/textures/blocks/reed_bale_side_180.png +- assets/lotr/textures/blocks/reed_bale_side_270.png +- assets/lotr/textures/items/gandalfStaffGrey.png +- assets/lotr/textures/items/gandalfStaffWhite.png +- assets/lotr/textures/items/large/gandalfStaffGrey.png +- assets/lotr/textures/items/large/gandalfStaffWhite.png + + +Mojang: (All rights reserved) +- assets/lotr/textures/items/spawn_egg.png + +Unidentified: (Assume all rights reserved) +- assets/lotr/textures/blocks/cinder_block.png +- assets/lotr/textures/blocks/ivory_block_top.png +- assets/lotr/textures/blocks/ivory_block_side_0.png +- assets/lotr/textures/blocks/ivory_block_side_90.png diff --git a/src/main/resources/assets/cinder_loe/lang/en_GB.lang b/src/main/resources/assets/cinder_loe/lang/en_GB.lang new file mode 100644 index 0000000..9206c9c --- /dev/null +++ b/src/main/resources/assets/cinder_loe/lang/en_GB.lang @@ -0,0 +1,2 @@ +item.lotr:sarumanStaff.name=Staff of Saruman of Many Colours +item.lotr:boarArmorRedDwarf.name=Red Dwarven Boar Armour diff --git a/src/main/resources/assets/cinder_loe/lang/en_US.lang b/src/main/resources/assets/cinder_loe/lang/en_US.lang new file mode 100644 index 0000000..b9b961e --- /dev/null +++ b/src/main/resources/assets/cinder_loe/lang/en_US.lang @@ -0,0 +1,116 @@ +tile.lotr:cinderBlock.name=Cinder Block +tile.lotr:ironChain.name=Iron Chain +tile.lotr:silverChain.name=Silver Chain +tile.lotr:goldChain.name=Gold Chain +tile.lotr:blockRedDwarfSteel.name=Red Dwarven Steel Block +tile.lotr:chandelierRedDwarf.name=Red Dwarven Chandelier +tile.lotr:barsRedDwarf.name=Red Dwarven Bars +tile.lotr:reedBale.name=Reed Bale +tile.lotr:leatherBundle.name=Leather Bundle +tile.lotr:furBundle.name=Fur Bundle +tile.lotr:dwarvenBrickRuned.name=Runed Dwarven Brick +tile.lotr:ivoryBlock.name=Ivory Block +tile.lotr:mistBlock.name=Mist +tile.lotr:fishbarrel.name=Barrel of Fish + +item.lotr:frostblade.name=Frostblade +item.lotr:whip.name=Whip +item.lotr:spearsolidgold.name=Solid Gold Spear +item.lotr:helmetRedDwarf.name=Red Dwarven Helmet +item.lotr:bodyRedDwarf.name=Red Dwarven Chestplate +item.lotr:legsRedDwarf.name=Red Dwarven Leggings +item.lotr:bootsRedDwarf.name=Red Dwarven Boots +item.lotr:redDwarfSteel.name=Red Dwarven Steel +item.lotr:spearRedDwarf.name=Red Dwarven Spear +item.lotr:swordRedDwarf.name=Red Dwarven Sword +item.lotr:battleaxeRedDwarf.name=Red Dwarven Battleaxe +item.lotr:pikeRedDwarf.name=Red Dwarven Pike +item.lotr:hammerRedDwarf.name=Red Dwarven Hammer +item.lotr:daggerRedDwarf.name=Red Dwarven Dagger +item.lotr:daggerRedDwarfPoisoned.name=Poisoned Red Dwarven Dagger +item.lotr:crossbowRedDwarf.name=Red Dwarven Crossbow +item.lotr:boarArmorRedDwarf.name=Red Dwarven Boar Armor +item.lotr:radagastStaff.name=Staff of Radagast the Brown +item.lotr:pallandoStaff.name=Staff of Pallando the Blue +item.lotr:alatarStaff.name=Staff of Alatar the Blue +item.lotr:sarumanStaff.name=Staff of Saruman of Many Colors +item.lotr:helmetLimwaith.name=Limwaith Helmet +item.lotr:bodyLimwaith.name=Limwaith Chestplate +item.lotr:legsLimwaith.name=Limwaith Leggings +item.lotr:bootsLimwaith.name=Limwaith Boots +item.lotr:spearLimwaith.name=Limwaith Spear +item.lotr:tridentLimwaith.name=Limwaith Trident +item.lotr:battleaxeLimwaith.name=Limwaith Battleaxe +item.lotr:truncheonLimwaith.name=Limwaith Truncheon +item.lotr:daggerLimwaith.name=Limwaith Dagger +item.lotr:daggerLimwaithPoisoned.name=Poisoned Limwaith Dagger +item.lotr:blowgunLimwaith.name=Limwaith Blowgun +item.lotr:helmetBree.name=Bree-land Helmet +item.lotr:bodyBree.name=Bree-land Chestplate +item.lotr:legsBree.name=Bree-land Leggings +item.lotr:bootsBree.name=Bree-land Boots +item.lotr:swordBree.name=Bree-land Sword + +item.lotr:helmetArnorBanner.name=Arnorian Hood +item.lotr:bodyArnorBanner.name=Light Arnorian Chestplate +item.lotr:legsArnorBanner.name=Light Arnorian Leggings +item.lotr:bootsArnorBanner.name=Light Arnorian Boots +item.lotr:maceArnor.name=Arnorian Mace + +item.spawn_egg_fangornauroch.name=Spawn Fangorn Auroch +item.spawn_egg_fangornbear.name=Spawn Fangorn Bear +item.spawn_egg_fangornwildboar.name=Spawn Fangorn Wild Boar +item.spawn_egg_fangornelk.name=Spawn Fangorn Elk +item.spawn_egg_reddwarfwarrior.name=Spawn Red Dwarf Warrior +item.spawn_egg_reddwarfarbalest.name=Spawn Red Dwarf Arbalest +item.spawn_egg_reddwarfbannerbearer.name=Spawn Red Dwarf Banner Bearer +item.spawn_egg_reddwarfcommander.name=Spawn Red Dwarf Commander +item.spawn_egg_limwaithwarrior.name=Spawn Limwaith Warrior +item.spawn_egg_limwaithblowgunner.name=Spawn Limwaith Blowgunner +item.spawn_egg_limwaithbannerbearer.name=Spawn Limwaith Banner Bearer +item.spawn_egg_limwaithchieftain.name=Spawn Limwaith Chieftain +item.spawn_egg_renegade.name=Spawn Renegade +item.spawn_egg_renegadecaptain.name=Spawn Renegade Captain +item.spawn_egg_wraith.name=Spawn Wraith +item.spawn_egg_lotrentitysauron.name=Spawn Sauron +item.spawn_egg_arnorsoldier.name=Spawn Arnorian Soldier +item.spawn_egg_arnorsoldierarcher.name=Spawn Arnorian Archer +item.spawn_egg_arnorcaptain.name=Spawn Arnorian Captain +item.spawn_egg_arnorbannerbearer.name=Spawn Arnorian Banner Bearer +item.spawn_egg_battlenun.name=Spawn Keeper of the Elendilmir +item.spawn_egg_breesoldier.name=Spawn Bree-Land Soldier +item.spawn_egg_breecrossbowman.name=Spawn Bree-Land Crossbowman +item.spawn_egg_breecaptain.name=Spawn Bree-Land Captain +item.spawn_egg_breesoldierbannerbearer.name=Spawn Bree-Land Bannerbearer +item.spawn_egg_breeoutrider.name=Spawn Bree-Land Outrider + +entity.cinder_loe.RedDwarfWarrior.name=Red Dwarf Warrior +entity.cinder_loe.RedDwarfArbalest.name=Red Dwarf Arbalest +entity.cinder_loe.RedDwarfBannerBearer.name=Red Dwarf Banner Bearer +entity.cinder_loe.RedDwarfCommander.name=Red Dwarf Commander +entity.cinder_loe.LimwaithWarrior.name=Limwaith Warrior +entity.cinder_loe.LimwaithBlowgunner.name=Limwaith Blowgunner +entity.cinder_loe.LimwaithBannerBearer.name=Limwaith Banner Bearer +entity.cinder_loe.LimwaithChieftain.name=Limwaith Chieftain +entity.cinder_loe.Renegade.entityName=%s the Renegade +entity.cinder_loe.RenegadeCaptain.name=Renegade Captain +entity.cinder_loe.FangornBear.name=Bear +entity.cinder_loe.FangornElk.name=Elk +entity.cinder_loe.FangornAuroch.name=Auroch +entity.cinder_loe.FangornWildBoar.name=Wild Boar +entity.cinder_loe.FangornWolf.name=Wolf +lotr.unit.RedDwarfWarrior_Boar=Boar Rider +lotr.unit.RedDwarfArbalest_Boar=Boar Arbalest Rider +entity.cinder_loe.ArnorSoldier.name=Arnorian Soldier +entity.cinder_loe.ArnorSoldierArcher.name=Arnorian Archer +entity.cinder_loe.ArnorBannerBearer.name=Arnorian Banner Bearer +entity.cinder_loe.ArnorCaptain.name=Captain of Arnor +entity.cinder_loe.BattleNun.name=Keeper of the Elendilmir +lotr.unit.Arnor_Horse=Arnorian Knight +entity.cinder_loe.BreeSoldier.name=Bree-land Soldier +entity.cinder_loe.BreeOutrider.name=Bree-land Outrider +entity.cinder_loe.BreeCrossbowman.name=Bree-land Crossbowman +entity.cinder_loe.BreeSoldierBannerBearer.name=Bree-land Banner Bearer +entity.cinder_loe.BreeCaptain.name=Bree-land Captain +lotr.unit.Bree_Horse=Bree-land Outrider +entity.cinder_loe.LOTREntitySauron.name=Sauron diff --git a/src/main/resources/assets/cinder_loe/misc/particles.png b/src/main/resources/assets/cinder_loe/misc/particles.png new file mode 100644 index 0000000..49e035d Binary files /dev/null and b/src/main/resources/assets/cinder_loe/misc/particles.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png b/src/main/resources/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png new file mode 100644 index 0000000..90a331b Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/arnorNun/arnorNun_female/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/0.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/0.png new file mode 100644 index 0000000..db405db Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/1.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/1.png new file mode 100644 index 0000000..2439ab5 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/1.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/2.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/2.png new file mode 100644 index 0000000..e6f4144 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_female/2.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/0.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/0.png new file mode 100644 index 0000000..b02b20c Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/1.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/1.png new file mode 100644 index 0000000..326a144 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/1.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/2.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/2.png new file mode 100644 index 0000000..7008447 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/2.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/3.png b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/3.png new file mode 100644 index 0000000..ef8ce6d Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/limwaith/limwaith_male/3.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/headwear_female/0.png b/src/main/resources/assets/cinder_loe/mob/renegade/headwear_female/0.png new file mode 100644 index 0000000..e13c741 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/headwear_female/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/0.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/0.png new file mode 100644 index 0000000..6428958 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/1.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/1.png new file mode 100644 index 0000000..e116169 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/1.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/2.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/2.png new file mode 100644 index 0000000..d4bedf3 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/2.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/3.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/3.png new file mode 100644 index 0000000..f442b73 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/3.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/4.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/4.png new file mode 100644 index 0000000..2807638 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/4.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/5.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/5.png new file mode 100644 index 0000000..8714484 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/5.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/6.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/6.png new file mode 100644 index 0000000..ab8815a Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/6.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/7.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/7.png new file mode 100644 index 0000000..c623dba Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_female/7.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/0.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/0.png new file mode 100644 index 0000000..775d84f Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/0.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/1.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/1.png new file mode 100644 index 0000000..dfd0311 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/1.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/10.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/10.png new file mode 100644 index 0000000..ed4ebef Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/10.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/11.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/11.png new file mode 100644 index 0000000..6a47a16 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/11.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/12.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/12.png new file mode 100644 index 0000000..6b8abbd Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/12.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/13.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/13.png new file mode 100644 index 0000000..9577f8e Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/13.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/2.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/2.png new file mode 100644 index 0000000..f3ca034 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/2.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/3.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/3.png new file mode 100644 index 0000000..9d462c2 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/3.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/4.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/4.png new file mode 100644 index 0000000..848293f Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/4.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/5.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/5.png new file mode 100644 index 0000000..c6dca42 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/5.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/6.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/6.png new file mode 100644 index 0000000..795a45c Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/6.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/7.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/7.png new file mode 100644 index 0000000..256ac7f Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/7.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/8.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/8.png new file mode 100644 index 0000000..02a3f2d Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/8.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/9.png b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/9.png new file mode 100644 index 0000000..c98b746 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/renegade/renegade_male/9.png differ diff --git a/src/main/resources/assets/cinder_loe/mob/wraith/wraith.png b/src/main/resources/assets/cinder_loe/mob/wraith/wraith.png new file mode 100644 index 0000000..3276887 Binary files /dev/null and b/src/main/resources/assets/cinder_loe/mob/wraith/wraith.png differ diff --git a/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt new file mode 100644 index 0000000..b89983a --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/friendly.txt @@ -0,0 +1,11 @@ +Do you seek to command the Dúnedain of the North, friend #? +These Dúnedain will follow your leadership for a small price, #. +Bring some silver coins and you can have some soldiers under your command. +Are you here with the intention of hiring Rangers of the North? +I can grant you the leadership of some excellent Dúnedain Soldiers in return for silver coins. +The Rangers of the North now respect you enough to follow your command, #. +The men of Arnor only follow good and valiant Men into battle. You are worthy to lead us. +My men are the finest warriors in all of the North! +I will give you some of my men for a dozen silver coins. +Such great warriors as my men do not fight for nothing, #! They require payment. +You are worthy enough to command my valiant Soldiers. \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt new file mode 100644 index 0000000..5d7c7e4 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/captain/neutral.txt @@ -0,0 +1,12 @@ +Only the strongest friends of the Dúnedain may fight with us in battle, #. +If you wish to captain the warriors of Arnor, you must prove your trust. +Are you friend or foe, #? +They say you are a friend of the Dúnedain, but I cannot be sure until you have done more good. +One does not simply command the men of Arnor without gaining some reputation first. +You are not yet thought of highly enough to fight with my warriors in battle, #. +Show us that you can be trusted, #, and we will fight alongside you. +You will have to prove yourself to our kin, if you wish to command some of our mighty warriors. +We Dúnedain do not follow any stranger into battle. You will have to prove that you truly fight for good in this world. +Prove your allegiance to us, and we shall ally with you. +You must prove yourself worthy first, if you wish to lead us to battle. +Only a true friend of our folk may lead us against the servants of evil. \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt new file mode 100644 index 0000000..505b7d7 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/friendly.txt @@ -0,0 +1,23 @@ +Long have we guarded these lands, #. +We Arnorians have watched over these lands for generations lost to memory. +What brings you to this wilderness, #? +May your journey be swift and your cloak warm, #. +By nightfall this land will be crawling with Orcs. +Be on your guard, #. There are many enemies in these parts. +Good day, #. From which land do you hail? +Keep a safe camp at night, and stay out of the shadows. +It is not for nothing that we watch these lands, #. Many foul beasts nest here. +We Arnorians remember the ancient lore of the West. We have ways to walk unseen. +These lands are my domain, #, and I do all in my power to safeguard them. +Beware the wretched Morgul-scum that crawls out at night, #. +The wolf that one hears is worse than the Orc that one fears. +Were it not for us, these lands would have fallen to the darkness long ago. +Many of the folk that dwell here consider us bandits and outcasts. They do not know our true duties. +My kin has long guarded these lands from the dangers that lie to the North. +Be wary, #. Many new dangers have arisen in these dark days. +As long as we watch over these lands, travellers such as you will be able to journey in peace, #. +Lonely folk are we, Soldiers of the North, guardians - but ever guarding against the servants of the Enemy. +The servants of the Enemy are found in many places, not in Mordor only. +Beware of the ancient wights and shades that roam this land, #. It is said they can take over your body. +In time of need, we will ride to the aid of Isildur's heir. +Our homes, such as we have, are here in the North. \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt new file mode 100644 index 0000000..ef5f61b --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hired.txt @@ -0,0 +1,15 @@ +My duty is to my captain # and the lands over which I stand guard. +The Morgul-filth of the night shall perish before us! +I have sworn to defend the lands of the free peoples, and defend them I shall! +May your journey be swift and your cloak warm, captain #. +By nightfall this land will be crawling with Orcs. +Be on your guard, captain #. There are many enemies in these parts. +Long have we guarded these lands, captain #. +We Soldiers have watched over these lands for generations lost to memory. +We Soldiers remember the ancient lore of the West. +The wolf that one hears is worse than the Orc that one fears. +My kin have long guarded these lands. +I will follow you wherever you go! +I have ways to move unseen in the shadows. +Let's hunt some Orc! +Be on your guard, captain #. There are keylimes lurking, waiting to nerf. \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt new file mode 100644 index 0000000..fb46e82 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/arnorSoldier/soldier/hostile.txt @@ -0,0 +1,16 @@ +Your death shall come swift as the arrow that pierces flesh, #! +I shall make an end of you! +You are not welcome in these lands, #! +Flee our lands, you wretched ally of the Morgul-filth! +You are an enemy of the race of Men, #! +What madness led you here? +Crawl back into the night, #! +You thought you could match our skill? You are sorely mistaken! +When did # forsake reason for madness? +Your doom approaches, #! +Do not underestimate the Kingdom of Arnor. +Go back to the darkness whence you came! +What devilry of the Dark Lord do you bring here? +Begone from these lands! +You shall meet your doom swiftly, scum of Mordor! +I will not allow you to harm the free folk of these lands! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt b/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt new file mode 100644 index 0000000..6ce35d7 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/friendly.txt @@ -0,0 +1,25 @@ +Do you seek my noble company, #? +You are indeed a brave warrior! +Let us share tales of war together! +You are indeed a Man of great bravery, #! +The Forest-Men have been cowering from you! +You come to hire my men? I have plenty of fierce warriors, #. +#! Have you been fighting in the North? +I hope the Forest-Men speak our names in fear, #! +The stars in the North make me dizzy. Have you felt this too? +The Great Sunken ones finds you worthy to lead my men, #. +Men wait to be led to their glory by you, #! +The finest warriors cost a pretty penny! +Even Jungle-blood does not buy an honourable warrior! I hope you come with money! +My men would be proud to serve under your banner. +Many fine tribesmen have fallen in battle and met the Great sunken ones. Many more would meet him for you! +Your blade speaks finer than the sharp sides of the sea! +Do you come from the tides, #? +For only a small commission my men will slice the throats of your enemies. +An enemy of my enemy is my friend! +I sell no ordinary warriors! +I hear tell of tall Men in the far south. I fear they may be trouble. +My warriors can be your warriors, #! +My warriors are better than anything the snake-men can muster! +The Great Sunken ones sleep beneath the tides... +My warriors would serve you bravely! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt b/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt new file mode 100644 index 0000000..a0fdf90 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/limwaith/chieftain/neutral.txt @@ -0,0 +1,22 @@ +My honour is proven. Do you wish to prove yours, #? +You wish to control my men? Prove your valour! +You are not yet worthy of mango. May you become so. +My men serve no commoner, #! +My men slaughter Forest-Men every day! +Who are you? I am from ancient Greece! +#? What a common name! +The best animal to hunt is Forest-Man! +Fish have more bravery than you, #. Prove your worth! +Your blade has not yet tasted Forest-Man, #. +I am a proven warrior. What are you? +The Sunken ones will soon notice my name! +Mangoes are the fruit of true warlords! +I have seen the Sunken Ones with my own eyes! +You must work harder for your rewards, #. +Soon my turn will come to see the Sunken Ones. +I have others more worthy of my time. +I wish to speak to honourable Men. Move out of my way, #! +Us Men of the Sea deserve more Men like me! +I do certainly desire to consume a mango. +The only Men you will lead are the banana-collectors, #. +Return with the lives of enemies upon your sword! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/friendly.txt b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/friendly.txt new file mode 100644 index 0000000..2ba88a5 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/friendly.txt @@ -0,0 +1,37 @@ +The filthy Forest-Men hide in their trees. So we chop them down. +The fruits of our land are sweeter even than the wines of the Snake-Men! +War makes men! +At night the Sunken Ones prowl the waters. Make sure you are safe, #. +#! Do you come to bring tidings of the war? +They may appear brave, but even our leaders fear the Sunken Ones. +May the Sunken Ones never devour your offspring! +The banner of our men stands stronger than ever. +Do you seek meat or merriment, #? +Have you seen the North, #? They say the stars are strange there. +A true warrior has the blood of the a Sea Serpent! +Gold and meat. What more do I need? +My dagger has pierced many a Forest-Man. +The Men of the Forests have the strength of a twig, the pride of a mango, and the wits of a Troll-Man! +The stars foretell death. +War is imminent. I shall finally be able to prove my strength! +The Forest-Men will fall to our warriors soon! +#, have you come to listen to my brave deeds? +My blade will stain the forest red! +If you want to kill Forest-Men, #, then join me, friend! +Our chieftains say that we must fight alongside the Troll-Men in the great war. +Beware the Troll-Men, #. They are demons in the form of Men. +The Troll-Men may march with us in the war to come, but I fear and hate them no less for this. +As long as we can remember, the Troll-Men have raided our villages and murdered our people. And now we must fight alongside them? I do not like this, #. +In the deep past, our chieftains led us out of the Shadow into the Sunlands. Now I fear the Shadow is falling upon us once more. +The tribes of the great forests have long been our enemies. +I know little of the Men in the North, but our chieftains say we must march to war against them. So we shall. +We will be slaves to the Forests no longer! +Merchants from the lands of the serpent often visit our tribe. Pay them no heed. They carry useless trinkets. +Some of my people have gone to fight for the Serpent, for silver. Honourless, I call them. +King or slave, brave or weak, old or young... in time, the Sunken Ones will drown us all. +The Serpent cannot swim, the Lion is a cat that fears water, true power is with the Sunken Ones +The Sunken Ones wait deep below, beyond the light. They wait for the end, #. +The Plains-Men are proud, #. But they forget, the Waters will soon drown us all. +Beware the forests, #. Wicked Men lurk within. +Long ago, the Forest-Men made war against our people. We do not forget. +Praise the great Eye, #! He has made an end to the Troll-Men raids! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hired.txt b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hired.txt new file mode 100644 index 0000000..d8f6958 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hired.txt @@ -0,0 +1,24 @@ +If I die fighting, my family shall be proud! +May the Sunken Ones bless our weapons! +#, do we stop for meat? +I can finally prove myself in battle! +The wind holds tidings of war. +I hope one day to return to my tribe. +My feet are sore, #. +Are we to fight for the flaming Eye? +It would take a lake to quench my thirst! +You fight like a lord, #. +I have hunted zebra and crocodile. One day I shall hunt Forest-Man! +It is merely a flesh wound. +I smell battle! +My children shall be big when I return! +When a man dies, his soul meets the Sunken Ones. Some day I too will meet them. +I have trained for many a day in the heat of the plains. +Some fruit and Snake-Man water would be a blessing! +The flaming Eye fills me with fear, #. +A banana is always welcome on my plate! +#, where are we headed today? +#! Please don't put me on guard duty again! +I know no fear! +Filthy Forest-Men fear my name! +Time for drinking! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hostile.txt b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hostile.txt new file mode 100644 index 0000000..7692b03 --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/limwaith/moredain/hostile.txt @@ -0,0 +1,23 @@ +The Sunken Ones will drown your soul, #! +Flee, coward! +May you never taste mango again! +The flaming Eye will destroy you! +Did the Forest-Men send you? +#, your name will be lost to the tides! +Another soul for my blade to feed on! +An enemy of the tribes has no friends in these lands! +Go back to the forest, you pitiful twig! +Raaaaargh! +For the Sunken Ones! +Flee, unworthy creature! +#, savour your demise! +I want your blood, #! +You have the strength of the flamingo! +You defy the Oceans? +Yaaargh! +Forest-Man! Die, #! +Run or face your death, soulless one! +I have no pity for you, coward! +Our tales tell of Men such as you, #! Know that they all met their end painfully! +A test for my strength! I shall savour my victory over you! +I have seen braver bananas than you, #! \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/renegade/drunkard/neutral.txt b/src/main/resources/assets/cinder_loe/speech/renegade/drunkard/neutral.txt new file mode 100644 index 0000000..fe8fdfb --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/renegade/drunkard/neutral.txt @@ -0,0 +1,7 @@ +With three beers down, the Orc did frown, and bid the Elf goodbye, for none could know, 'twas not for show, and someone had to die. +Never enough gold... just need one more good haul. +Should have known she was lying... she said she would wait for me, but they never wait.. +...mead, mead, mead... ...kill 'em to get some beer every now and then.. Stupid bees and their stupid honey... +Lying little harlot.. that brat ain't mine, could be anyone's... won't get a single silver from me... +Hmph, wizards... now that's power.. bet they got that "secret magic".. turn wood into gold.. yeah, wish I could turn wood into gold... +Go to the college, da said. Use your smarts, he said. Idiot, how was I supposed to know what college he meant? \ No newline at end of file diff --git a/src/main/resources/assets/cinder_loe/speech/renegade/man/hostile.txt b/src/main/resources/assets/cinder_loe/speech/renegade/man/hostile.txt new file mode 100644 index 0000000..5cb584a --- /dev/null +++ b/src/main/resources/assets/cinder_loe/speech/renegade/man/hostile.txt @@ -0,0 +1,6 @@ +Your money or your life! +You'll be so much easier to rob when you're dead! +Can't wait to count out your coin... +Tell you what. You start running so I can stab you in the back. +Lookie here. Looks like we got ourselves a hero. +You picked a bad time to get lost, friend. \ No newline at end of file diff --git a/src/main/resources/assets/lotr/armor/battlenun_1.png b/src/main/resources/assets/lotr/armor/battlenun_1.png new file mode 100644 index 0000000..99ceaaa Binary files /dev/null and b/src/main/resources/assets/lotr/armor/battlenun_1.png differ diff --git a/src/main/resources/assets/lotr/armor/battlenun_2.png b/src/main/resources/assets/lotr/armor/battlenun_2.png new file mode 100644 index 0000000..b4e925e Binary files /dev/null and b/src/main/resources/assets/lotr/armor/battlenun_2.png differ diff --git a/src/main/resources/assets/lotr/armor/bree_1.png b/src/main/resources/assets/lotr/armor/bree_1.png new file mode 100644 index 0000000..7f65418 Binary files /dev/null and b/src/main/resources/assets/lotr/armor/bree_1.png differ diff --git a/src/main/resources/assets/lotr/armor/bree_2.png b/src/main/resources/assets/lotr/armor/bree_2.png new file mode 100644 index 0000000..a036bdf Binary files /dev/null and b/src/main/resources/assets/lotr/armor/bree_2.png differ diff --git a/src/main/resources/assets/lotr/armor/limwaith_wood_1.png b/src/main/resources/assets/lotr/armor/limwaith_wood_1.png new file mode 100644 index 0000000..7bfda2f Binary files /dev/null and b/src/main/resources/assets/lotr/armor/limwaith_wood_1.png differ diff --git a/src/main/resources/assets/lotr/armor/limwaith_wood_2.png b/src/main/resources/assets/lotr/armor/limwaith_wood_2.png new file mode 100644 index 0000000..952e0ff Binary files /dev/null and b/src/main/resources/assets/lotr/armor/limwaith_wood_2.png differ diff --git a/src/main/resources/assets/lotr/armor/mount/boar_red_dwarf.png b/src/main/resources/assets/lotr/armor/mount/boar_red_dwarf.png new file mode 100644 index 0000000..2f30c0d Binary files /dev/null and b/src/main/resources/assets/lotr/armor/mount/boar_red_dwarf.png differ diff --git a/src/main/resources/assets/lotr/armor/red_dwarf_1.png b/src/main/resources/assets/lotr/armor/red_dwarf_1.png new file mode 100644 index 0000000..e97e829 Binary files /dev/null and b/src/main/resources/assets/lotr/armor/red_dwarf_1.png differ diff --git a/src/main/resources/assets/lotr/armor/red_dwarf_2.png b/src/main/resources/assets/lotr/armor/red_dwarf_2.png new file mode 100644 index 0000000..3382154 Binary files /dev/null and b/src/main/resources/assets/lotr/armor/red_dwarf_2.png differ diff --git a/src/main/resources/assets/lotr/armor/red_dwarf_helmet.png b/src/main/resources/assets/lotr/armor/red_dwarf_helmet.png new file mode 100644 index 0000000..d1c59be Binary files /dev/null and b/src/main/resources/assets/lotr/armor/red_dwarf_helmet.png differ diff --git a/src/main/resources/assets/lotr/item/banner/banner_redDwarf.png b/src/main/resources/assets/lotr/item/banner/banner_redDwarf.png new file mode 100644 index 0000000..bed495d Binary files /dev/null and b/src/main/resources/assets/lotr/item/banner/banner_redDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/bars_red_dwarf.png b/src/main/resources/assets/lotr/textures/blocks/bars_red_dwarf.png new file mode 100644 index 0000000..a8e2578 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/bars_red_dwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/chandelier_red_dwarf.png b/src/main/resources/assets/lotr/textures/blocks/chandelier_red_dwarf.png new file mode 100644 index 0000000..4ac4b7e Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/chandelier_red_dwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/cinder_block.png b/src/main/resources/assets/lotr/textures/blocks/cinder_block.png new file mode 100644 index 0000000..e992bfa Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/cinder_block.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/dwarven_brick_runed.png b/src/main/resources/assets/lotr/textures/blocks/dwarven_brick_runed.png new file mode 100644 index 0000000..a088a2b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/dwarven_brick_runed.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fishbarrel_bottom.png b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_bottom.png new file mode 100644 index 0000000..d34f15b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fishbarrel_side.png b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_side.png new file mode 100644 index 0000000..88b7466 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_side.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fishbarrel_top.png b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_top.png new file mode 100644 index 0000000..93f7d58 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fishbarrel_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_bottom.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_bottom.png new file mode 100644 index 0000000..83ed3e6 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_0.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_0.png new file mode 100644 index 0000000..88acb55 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_0.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_180.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_180.png new file mode 100644 index 0000000..2073682 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_180.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_270.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_270.png new file mode 100644 index 0000000..fda3957 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_270.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_90.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_90.png new file mode 100644 index 0000000..da635bb Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_side_90.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/fur_bundle_top.png b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_top.png new file mode 100644 index 0000000..9de20c3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/fur_bundle_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/goldChain_bottom.png b/src/main/resources/assets/lotr/textures/blocks/goldChain_bottom.png new file mode 100644 index 0000000..6b76c9b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/goldChain_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/goldChain_mid.png b/src/main/resources/assets/lotr/textures/blocks/goldChain_mid.png new file mode 100644 index 0000000..c40b6eb Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/goldChain_mid.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/goldChain_single.png b/src/main/resources/assets/lotr/textures/blocks/goldChain_single.png new file mode 100644 index 0000000..f8b0e15 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/goldChain_single.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/goldChain_top.png b/src/main/resources/assets/lotr/textures/blocks/goldChain_top.png new file mode 100644 index 0000000..f8b0e15 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/goldChain_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ironChain_bottom.png b/src/main/resources/assets/lotr/textures/blocks/ironChain_bottom.png new file mode 100644 index 0000000..05523c5 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ironChain_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ironChain_mid.png b/src/main/resources/assets/lotr/textures/blocks/ironChain_mid.png new file mode 100644 index 0000000..ee0680f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ironChain_mid.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ironChain_single.png b/src/main/resources/assets/lotr/textures/blocks/ironChain_single.png new file mode 100644 index 0000000..be3a2f4 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ironChain_single.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ironChain_top.png b/src/main/resources/assets/lotr/textures/blocks/ironChain_top.png new file mode 100644 index 0000000..be3a2f4 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ironChain_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_0.png b/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_0.png new file mode 100644 index 0000000..e427528 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_0.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_90.png b/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_90.png new file mode 100644 index 0000000..b6c0bfe Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ivory_block_side_90.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/ivory_block_top.png b/src/main/resources/assets/lotr/textures/blocks/ivory_block_top.png new file mode 100644 index 0000000..74ac7de Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/ivory_block_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_bottom.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_bottom.png new file mode 100644 index 0000000..0ef6a5f Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_0.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_0.png new file mode 100644 index 0000000..da97577 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_0.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_180.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_180.png new file mode 100644 index 0000000..2cf3158 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_180.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_270.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_270.png new file mode 100644 index 0000000..c61e62e Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_270.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_90.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_90.png new file mode 100644 index 0000000..781aba3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_side_90.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/leather_bundle_top.png b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_top.png new file mode 100644 index 0000000..852cd71 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/leather_bundle_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/red_dwarf_steel.png b/src/main/resources/assets/lotr/textures/blocks/red_dwarf_steel.png new file mode 100644 index 0000000..66984c3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/red_dwarf_steel.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_bottom.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_bottom.png new file mode 100644 index 0000000..7e4a8ad Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_0.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_0.png new file mode 100644 index 0000000..e6c2ef9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_0.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_180.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_180.png new file mode 100644 index 0000000..671c03a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_180.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_270.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_270.png new file mode 100644 index 0000000..0839f6a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_270.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_90.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_90.png new file mode 100644 index 0000000..51fdaec Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_side_90.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/reed_bale_top.png b/src/main/resources/assets/lotr/textures/blocks/reed_bale_top.png new file mode 100644 index 0000000..7e4a8ad Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/reed_bale_top.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/silverChain_bottom.png b/src/main/resources/assets/lotr/textures/blocks/silverChain_bottom.png new file mode 100644 index 0000000..b916cbf Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/silverChain_bottom.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/silverChain_mid.png b/src/main/resources/assets/lotr/textures/blocks/silverChain_mid.png new file mode 100644 index 0000000..f2fcebc Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/silverChain_mid.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/silverChain_single.png b/src/main/resources/assets/lotr/textures/blocks/silverChain_single.png new file mode 100644 index 0000000..3459046 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/silverChain_single.png differ diff --git a/src/main/resources/assets/lotr/textures/blocks/silverChain_top.png b/src/main/resources/assets/lotr/textures/blocks/silverChain_top.png new file mode 100644 index 0000000..3459046 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/blocks/silverChain_top.png differ diff --git a/src/main/resources/assets/lotr/textures/items/alatarStaff.png b/src/main/resources/assets/lotr/textures/items/alatarStaff.png new file mode 100644 index 0000000..e3c599a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/alatarStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/banner_redDwarf.png b/src/main/resources/assets/lotr/textures/items/banner_redDwarf.png new file mode 100644 index 0000000..67b317a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/banner_redDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/battleaxeLimwaith.png b/src/main/resources/assets/lotr/textures/items/battleaxeLimwaith.png new file mode 100644 index 0000000..5c54f68 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/battleaxeLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/battleaxeRedDwarf.png b/src/main/resources/assets/lotr/textures/items/battleaxeRedDwarf.png new file mode 100644 index 0000000..21c81a2 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/battleaxeRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/blowgunLimwaith.png b/src/main/resources/assets/lotr/textures/items/blowgunLimwaith.png new file mode 100644 index 0000000..26859f1 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/blowgunLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/boarArmorRedDwarf.png b/src/main/resources/assets/lotr/textures/items/boarArmorRedDwarf.png new file mode 100644 index 0000000..0ba3968 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/boarArmorRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bodyArnorBanner.png b/src/main/resources/assets/lotr/textures/items/bodyArnorBanner.png new file mode 100644 index 0000000..a50fc62 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bodyArnorBanner.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bodyBree.png b/src/main/resources/assets/lotr/textures/items/bodyBree.png new file mode 100644 index 0000000..386f36b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bodyBree.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bodyLimwaith.png b/src/main/resources/assets/lotr/textures/items/bodyLimwaith.png new file mode 100644 index 0000000..b919b0a Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bodyLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bodyRedDwarf.png b/src/main/resources/assets/lotr/textures/items/bodyRedDwarf.png new file mode 100644 index 0000000..6bff7e4 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bodyRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bootsArnorBanner.png b/src/main/resources/assets/lotr/textures/items/bootsArnorBanner.png new file mode 100644 index 0000000..09309d9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bootsArnorBanner.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bootsBree.png b/src/main/resources/assets/lotr/textures/items/bootsBree.png new file mode 100644 index 0000000..f794b8c Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bootsBree.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bootsLimwaith.png b/src/main/resources/assets/lotr/textures/items/bootsLimwaith.png new file mode 100644 index 0000000..2268432 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bootsLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/bootsRedDwarf.png b/src/main/resources/assets/lotr/textures/items/bootsRedDwarf.png new file mode 100644 index 0000000..a6b8890 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/bootsRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf.png b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf.png new file mode 100644 index 0000000..3896ba0 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png new file mode 100644 index 0000000..c161d32 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_0.png differ diff --git a/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png new file mode 100644 index 0000000..eecc1d9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_1.png differ diff --git a/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png new file mode 100644 index 0000000..fcf1e47 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/crossbowRedDwarf_pull_2.png differ diff --git a/src/main/resources/assets/lotr/textures/items/daggerLimwaith.png b/src/main/resources/assets/lotr/textures/items/daggerLimwaith.png new file mode 100644 index 0000000..8b7b130 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/daggerLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/daggerLimwaithPoisoned.png b/src/main/resources/assets/lotr/textures/items/daggerLimwaithPoisoned.png new file mode 100644 index 0000000..49d50ca Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/daggerLimwaithPoisoned.png differ diff --git a/src/main/resources/assets/lotr/textures/items/daggerRedDwarf.png b/src/main/resources/assets/lotr/textures/items/daggerRedDwarf.png new file mode 100644 index 0000000..3d34186 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/daggerRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/daggerRedDwarfPoisoned.png b/src/main/resources/assets/lotr/textures/items/daggerRedDwarfPoisoned.png new file mode 100644 index 0000000..d8acb24 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/daggerRedDwarfPoisoned.png differ diff --git a/src/main/resources/assets/lotr/textures/items/frostblade.png b/src/main/resources/assets/lotr/textures/items/frostblade.png new file mode 100644 index 0000000..16fb0b0 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/frostblade.png differ diff --git a/src/main/resources/assets/lotr/textures/items/gandalfStaffGrey.png b/src/main/resources/assets/lotr/textures/items/gandalfStaffGrey.png new file mode 100644 index 0000000..6dcb3ef Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/gandalfStaffGrey.png differ diff --git a/src/main/resources/assets/lotr/textures/items/gandalfStaffWhite.png b/src/main/resources/assets/lotr/textures/items/gandalfStaffWhite.png new file mode 100644 index 0000000..fba1bf1 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/gandalfStaffWhite.png differ diff --git a/src/main/resources/assets/lotr/textures/items/goldChain.png b/src/main/resources/assets/lotr/textures/items/goldChain.png new file mode 100644 index 0000000..3f28968 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/goldChain.png differ diff --git a/src/main/resources/assets/lotr/textures/items/hammerRedDwarf.png b/src/main/resources/assets/lotr/textures/items/hammerRedDwarf.png new file mode 100644 index 0000000..1447866 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/hammerRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/helmetArnorBanner.png b/src/main/resources/assets/lotr/textures/items/helmetArnorBanner.png new file mode 100644 index 0000000..89539fa Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/helmetArnorBanner.png differ diff --git a/src/main/resources/assets/lotr/textures/items/helmetBree.png b/src/main/resources/assets/lotr/textures/items/helmetBree.png new file mode 100644 index 0000000..49b55a3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/helmetBree.png differ diff --git a/src/main/resources/assets/lotr/textures/items/helmetLimwaith.png b/src/main/resources/assets/lotr/textures/items/helmetLimwaith.png new file mode 100644 index 0000000..191eaeb Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/helmetLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/helmetRedDwarf.png b/src/main/resources/assets/lotr/textures/items/helmetRedDwarf.png new file mode 100644 index 0000000..5b3c30e Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/helmetRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/ironChain.png b/src/main/resources/assets/lotr/textures/items/ironChain.png new file mode 100644 index 0000000..c9e8732 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/ironChain.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/alatarStaff.png b/src/main/resources/assets/lotr/textures/items/large/alatarStaff.png new file mode 100644 index 0000000..9ec9224 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/alatarStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/battleaxeLimwaith.png b/src/main/resources/assets/lotr/textures/items/large/battleaxeLimwaith.png new file mode 100644 index 0000000..59c9ef9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/battleaxeLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/frostblade.png b/src/main/resources/assets/lotr/textures/items/large/frostblade.png new file mode 100644 index 0000000..b03cd28 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/frostblade.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/gandalfStaffGrey.png b/src/main/resources/assets/lotr/textures/items/large/gandalfStaffGrey.png new file mode 100644 index 0000000..bc9a248 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/gandalfStaffGrey.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/gandalfStaffWhite.png b/src/main/resources/assets/lotr/textures/items/large/gandalfStaffWhite.png new file mode 100644 index 0000000..e86f7ab Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/gandalfStaffWhite.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/pallandoStaff.png b/src/main/resources/assets/lotr/textures/items/large/pallandoStaff.png new file mode 100644 index 0000000..f7ea81d Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/pallandoStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/radagastStaff.png b/src/main/resources/assets/lotr/textures/items/large/radagastStaff.png new file mode 100644 index 0000000..966a4b4 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/radagastStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/sarumanStaff.png b/src/main/resources/assets/lotr/textures/items/large/sarumanStaff.png new file mode 100644 index 0000000..0262cb5 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/sarumanStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/spearLimwaith.png b/src/main/resources/assets/lotr/textures/items/large/spearLimwaith.png new file mode 100644 index 0000000..22ac4ef Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/spearLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/spearRedDwarf.png b/src/main/resources/assets/lotr/textures/items/large/spearRedDwarf.png new file mode 100644 index 0000000..33b2080 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/spearRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png b/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png new file mode 100644 index 0000000..1ab9bc9 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta b/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta new file mode 100644 index 0000000..dbfacda --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/large/spearsolidgold.png.mcmeta @@ -0,0 +1,68 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 14 + ] + } +} diff --git a/src/main/resources/assets/lotr/textures/items/large/tridentLimwaith.png b/src/main/resources/assets/lotr/textures/items/large/tridentLimwaith.png new file mode 100644 index 0000000..0f0c260 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/tridentLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large/whip.png b/src/main/resources/assets/lotr/textures/items/large/whip.png new file mode 100644 index 0000000..838c6e6 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large/whip.png differ diff --git a/src/main/resources/assets/lotr/textures/items/large2/pikeRedDwarf.png b/src/main/resources/assets/lotr/textures/items/large2/pikeRedDwarf.png new file mode 100644 index 0000000..a2a5b41 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/large2/pikeRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/legsArnorBanner.png b/src/main/resources/assets/lotr/textures/items/legsArnorBanner.png new file mode 100644 index 0000000..00de686 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/legsArnorBanner.png differ diff --git a/src/main/resources/assets/lotr/textures/items/legsBree.png b/src/main/resources/assets/lotr/textures/items/legsBree.png new file mode 100644 index 0000000..2a93dfd Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/legsBree.png differ diff --git a/src/main/resources/assets/lotr/textures/items/legsLimwaith.png b/src/main/resources/assets/lotr/textures/items/legsLimwaith.png new file mode 100644 index 0000000..1b181d4 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/legsLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/legsRedDwarf.png b/src/main/resources/assets/lotr/textures/items/legsRedDwarf.png new file mode 100644 index 0000000..5ade19c Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/legsRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/maceArnor.png b/src/main/resources/assets/lotr/textures/items/maceArnor.png new file mode 100644 index 0000000..f7e7dd3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/maceArnor.png differ diff --git a/src/main/resources/assets/lotr/textures/items/pallandoStaff.png b/src/main/resources/assets/lotr/textures/items/pallandoStaff.png new file mode 100644 index 0000000..2f5793b Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/pallandoStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/pikeRedDwarf.png b/src/main/resources/assets/lotr/textures/items/pikeRedDwarf.png new file mode 100644 index 0000000..54c70a3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/pikeRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/radagastStaff.png b/src/main/resources/assets/lotr/textures/items/radagastStaff.png new file mode 100644 index 0000000..cb83a47 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/radagastStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/redDwarfSteel.png b/src/main/resources/assets/lotr/textures/items/redDwarfSteel.png new file mode 100644 index 0000000..d6dc164 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/redDwarfSteel.png differ diff --git a/src/main/resources/assets/lotr/textures/items/sarumanStaff.png b/src/main/resources/assets/lotr/textures/items/sarumanStaff.png new file mode 100644 index 0000000..c5eb5b8 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/sarumanStaff.png differ diff --git a/src/main/resources/assets/lotr/textures/items/silverChain.png b/src/main/resources/assets/lotr/textures/items/silverChain.png new file mode 100644 index 0000000..422357d Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/silverChain.png differ diff --git a/src/main/resources/assets/lotr/textures/items/spawn_egg.png b/src/main/resources/assets/lotr/textures/items/spawn_egg.png new file mode 100644 index 0000000..b1a25ee Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/spawn_egg.png differ diff --git a/src/main/resources/assets/lotr/textures/items/spearLimwaith.png b/src/main/resources/assets/lotr/textures/items/spearLimwaith.png new file mode 100644 index 0000000..51f8cdf Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/spearLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/spearRedDwarf.png b/src/main/resources/assets/lotr/textures/items/spearRedDwarf.png new file mode 100644 index 0000000..c794507 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/spearRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/spearsolidgold.png b/src/main/resources/assets/lotr/textures/items/spearsolidgold.png new file mode 100644 index 0000000..6e830d3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/spearsolidgold.png differ diff --git a/src/main/resources/assets/lotr/textures/items/spearsolidgold.png.mcmeta b/src/main/resources/assets/lotr/textures/items/spearsolidgold.png.mcmeta new file mode 100644 index 0000000..0b19d78 --- /dev/null +++ b/src/main/resources/assets/lotr/textures/items/spearsolidgold.png.mcmeta @@ -0,0 +1,66 @@ +{ + "animation": { + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7, + 7 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lotr/textures/items/swordBree.png b/src/main/resources/assets/lotr/textures/items/swordBree.png new file mode 100644 index 0000000..d641eb3 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/swordBree.png differ diff --git a/src/main/resources/assets/lotr/textures/items/swordRedDwarf.png b/src/main/resources/assets/lotr/textures/items/swordRedDwarf.png new file mode 100644 index 0000000..d54a24e Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/swordRedDwarf.png differ diff --git a/src/main/resources/assets/lotr/textures/items/tridentLimwaith.png b/src/main/resources/assets/lotr/textures/items/tridentLimwaith.png new file mode 100644 index 0000000..6170c89 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/tridentLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/truncheonLimwaith.png b/src/main/resources/assets/lotr/textures/items/truncheonLimwaith.png new file mode 100644 index 0000000..f815038 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/truncheonLimwaith.png differ diff --git a/src/main/resources/assets/lotr/textures/items/whip.png b/src/main/resources/assets/lotr/textures/items/whip.png new file mode 100644 index 0000000..7e22414 Binary files /dev/null and b/src/main/resources/assets/lotr/textures/items/whip.png differ diff --git a/src/main/resources/assets/lotr/textures/shield/alignment_RedDwarf.png b/src/main/resources/assets/lotr/textures/shield/alignment_RedDwarf.png new file mode 100644 index 0000000..065901c Binary files /dev/null and b/src/main/resources/assets/lotr/textures/shield/alignment_RedDwarf.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..360f3c8 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,21 @@ +{ + "modListVersion": 2, + "modList": [{ + "modid": "${modId}", + "name": "${modName}", + "description": "CINDER MOD.\nMod designed to add blocks to The Lord of Embers Minecraft server.", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", + "url": "thelordofembers.com", + "updateUrl": "", + "authorList": ["Shinare"], + "credits": "", + "logoFile": "", + "screenshots": [], + "parent": "", + "requiredMods": [], + "dependencies": [], + "dependants": [], + "useDependencyInformation": true + }] +} diff --git a/src/main/resources/mixins.cinder_loe.json b/src/main/resources/mixins.cinder_loe.json new file mode 100644 index 0000000..aae8119 --- /dev/null +++ b/src/main/resources/mixins.cinder_loe.json @@ -0,0 +1,34 @@ +{ + "required": true, + "minVersion": "0.7.11", + "package": "com.zivilon.cinder_loe.mixins", + "refmap": "mixins.cinder_loe.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "MixinLOTRTileEntityDwarvenForge", + "MixinLOTRIntCache", + "MixinLOTRWorldGenMumakSkeleton", + "MixinItemRenderer", + "MixinRenderItem", + "MixinLOTRClientProxy", + "MixinLOTRContainerAnvil", + "MixinLOTRArmorModels", + "MixinLOTRRenderElvenBlade", + "MixinLOTRRenderLargeItem", + "MixinLOTRRenderCrossbow", + "MixinLOTRRenderThrowingAxe", + "MixinLOTRRenderPlateFood", + "MixinLOTRRenderBlownItem", + "MixinLOTRRenderBow", + "MixinLOTRRenderElf", + "MixinLOTRNPCRendering", + "MixinLOTRRenderDart", + "MixinLOTRRenderTraderRespawn", + "MixinLOTRRenderNPCRespawner", + "MixinRendererLivingEntity", + "MixinLOTRRenderArmorStand", + "MixinLOTREntitySauron" + ], + "client": [] +}